@widelab-development/pirxey-webflow-dev 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blog.css +1 -0
- package/dist/blog.js +3987 -0
- package/dist/lp-10-hours.js +18 -18
- package/package.json +1 -1
package/dist/lp-10-hours.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(()=>{var Hh=()=>{let r=document.querySelectorAll("[data-contact-popup-toggler]"),t=document.querySelector("[data-contact-popup]");var e=0;if(!r||!t)return;let n=t.querySelector("[data-contact-popup-close]");if(!n)return;let i=t.querySelector(".contact-popup_box");if(!i)return;let s=(o,a)=>{let l=document.createElement("script"),c=document.getElementsByTagName("script")[0];l.async=1,l.onload=l.onreadystatechange=(u,f)=>{(f||!l.readyState||/loaded|complete/.test(l.readyState))&&(l.onload=l.onreadystatechange=null,l=void 0,f||a&&a())},l.src=o,c.parentNode.insertBefore(l,c)};r.forEach(o=>{o.addEventListener("click",a=>{a.preventDefault,e?(t.classList.add("-open"),document.body.classList.add("-popup-open")):s("https://assets.calendly.com/assets/external/widget.js",()=>{e=1,t.classList.add("-open"),document.body.classList.add("-popup-open")})})}),n.addEventListener("click",o=>{o.preventDefault,t.classList.remove("-open"),document.body.classList.remove("-popup-open")}),t.addEventListener("click",o=>{i.contains(o.target)||(t.classList.remove("-open"),document.body.classList.remove("-popup-open"))})};function bi(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function $h(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}var En={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},cs={duration:.5,overwrite:!1,delay:0},pc,tn,be,zn=1e8,xe=1/zn,ic=Math.PI*2,dg=ic/4,pg=0,Kh=Math.sqrt,mg=Math.cos,gg=Math.sin,Be=function(t){return typeof t=="string"},Ce=function(t){return typeof t=="function"},Ei=function(t){return typeof t=="number"},la=function(t){return typeof t>"u"},fi=function(t){return typeof t=="object"},wn=function(t){return t!==!1},mc=function(){return typeof window<"u"},Qo=function(t){return Ce(t)||Be(t)},jh=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},en=Array.isArray,rc=/(?:-?\.?\d|\.)+/gi,gc=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Tr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,$l=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,_c=/[+-]=-?[.\d]+/,Qh=/[^,'"\[\]\s]+/gi,_g=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Te,ui,sc,xc,Pn={},ia={},tf,ef=function(t){return(ia=Er(t,Pn))&&nn},ca=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},ho=function(t,e){return!e&&console.warn(t)},nf=function(t,e){return t&&(Pn[t]=e)&&ia&&(ia[t]=e)||Pn},fo=function(){return 0},xg={suppressEvents:!0,isStart:!0,kill:!1},ta={suppressEvents:!0,kill:!1},vg={suppressEvents:!0},vc={},Yi=[],oc={},rf,Mn={},Kl={},Gh=30,ea=[],yc="",Sc=function(t){var e=t[0],n,i;if(fi(e)||Ce(e)||(t=[t]),!(n=(e._gsap||{}).harness)){for(i=ea.length;i--&&!ea[i].targetTest(e););n=ea[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new wc(t[i],n)))||t.splice(i,1);return t},Zi=function(t){return t._gsap||Sc(kn(t))[0]._gsap},Mc=function(t,e,n){return(n=t[e])&&Ce(n)?t[e]():la(n)&&t.getAttribute&&t.getAttribute(e)||n},hn=function(t,e){return(t=t.split(",")).forEach(e)||t},Re=function(t){return Math.round(t*1e5)/1e5||0},Ge=function(t){return Math.round(t*1e7)/1e7||0},Ar=function(t,e){var n=e.charAt(0),i=parseFloat(e.substr(2));return t=parseFloat(t),n==="+"?t+i:n==="-"?t-i:n==="*"?t*i:t/i},yg=function(t,e){for(var n=e.length,i=0;t.indexOf(e[i])<0&&++i<n;);return i<n},ra=function(){var t=Yi.length,e=Yi.slice(0),n,i;for(oc={},Yi.length=0,n=0;n<t;n++)i=e[n],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},sf=function(t,e,n,i){Yi.length&&!tn&&ra(),t.render(e,n,i||tn&&e<0&&(t._initted||t._startAt)),Yi.length&&!tn&&ra()},of=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(Qh).length<2?e:Be(t)?t.trim():t},af=function(t){return t},Vn=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Sg=function(t){return function(e,n){for(var i in n)i in e||i==="duration"&&t||i==="ease"||(e[i]=n[i])}},Er=function(t,e){for(var n in e)t[n]=e[n];return t},Wh=function r(t,e){for(var n in e)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(t[n]=fi(e[n])?r(t[n]||(t[n]={}),e[n]):e[n]);return t},sa=function(t,e){var n={},i;for(i in t)i in e||(n[i]=t[i]);return n},lo=function(t){var e=t.parent||Te,n=t.keyframes?Sg(en(t.keyframes)):Vn;if(wn(t.inherit))for(;e;)n(t,e.vars.defaults),e=e.parent||e._dp;return t},Mg=function(t,e){for(var n=t.length,i=n===e.length;i&&n--&&t[n]===e[n];);return n<0},lf=function(t,e,n,i,s){n===void 0&&(n="_first"),i===void 0&&(i="_last");var o=t[i],a;if(s)for(a=e[s];o&&o[s]>a;)o=o._prev;return o?(e._next=o._next,o._next=e):(e._next=t[n],t[n]=e),e._next?e._next._prev=e:t[i]=e,e._prev=o,e.parent=e._dp=t,e},ua=function(t,e,n,i){n===void 0&&(n="_first"),i===void 0&&(i="_last");var s=e._prev,o=e._next;s?s._next=o:t[n]===e&&(t[n]=o),o?o._prev=s:t[i]===e&&(t[i]=s),e._next=e._prev=e.parent=null},Ji=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Mr=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var n=t;n;)n._dirty=1,n=n.parent;return t},bg=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},ac=function(t,e,n,i){return t._startAt&&(tn?t._startAt.revert(ta):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))},wg=function r(t){return!t||t._ts&&r(t.parent)},Xh=function(t){return t._repeat?us(t._tTime,t=t.duration()+t._rDelay)*t:0},us=function(t,e){var n=Math.floor(t/=e);return t&&n===t?n-1:n},oa=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},ha=function(t){return t._end=Ge(t._start+(t._tDur/Math.abs(t._ts||t._rts||xe)||0))},fa=function(t,e){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=Ge(n._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),ha(t),n._dirty||Mr(n,t)),t},cf=function(t,e){var n;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(n=oa(t.rawTime(),e),(!e._dur||go(0,e.totalDuration(),n)-e._tTime>xe)&&e.render(n,!0)),Mr(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(n=t;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;t._zTime=-xe}},hi=function(t,e,n,i){return e.parent&&Ji(e),e._start=Ge((Ei(n)?n:n||t!==Te?Bn(t,n,e):t._time)+e._delay),e._end=Ge(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),lf(t,e,"_first","_last",t._sort?"_start":0),lc(e)||(t._recent=e),i||cf(t,e),t._ts<0&&fa(t,t._tTime),t},uf=function(t,e){return(Pn.ScrollTrigger||ca("scrollTrigger",e))&&Pn.ScrollTrigger.create(e,t)},hf=function(t,e,n,i,s){if(Ac(t,e,s),!t._initted)return 1;if(!n&&t._pt&&!tn&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&rf!==bn.frame)return Yi.push(t),t._lazy=[s,i],1},Eg=function r(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||r(e))},lc=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},Tg=function(t,e,n,i){var s=t.ratio,o=e<0||!e&&(!t._start&&Eg(t)&&!(!t._initted&&lc(t))||(t._ts<0||t._dp._ts<0)&&!lc(t))?0:1,a=t._rDelay,l=0,c,u,f;if(a&&t._repeat&&(l=go(0,t._tDur,e),u=us(l,a),t._yoyo&&u&1&&(o=1-o),u!==us(t._tTime,a)&&(s=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==s||tn||i||t._zTime===xe||!e&&t._zTime){if(!t._initted&&hf(t,e,i,n,l))return;for(f=t._zTime,t._zTime=e||(n?xe:0),n||(n=e&&!f),t.ratio=o,t._from&&(o=1-o),t._time=0,t._tTime=l,c=t._pt;c;)c.r(o,c.d),c=c._next;e<0&&ac(t,e,n,!0),t._onUpdate&&!n&&Rn(t,"onUpdate"),l&&t._repeat&&!n&&t.parent&&Rn(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&Ji(t,1),!n&&!tn&&(Rn(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},Ag=function(t,e,n){var i;if(n>e)for(i=t._first;i&&i._start<=n;){if(i.data==="isPause"&&i._start>e)return i;i=i._next}else for(i=t._last;i&&i._start>=n;){if(i.data==="isPause"&&i._start<e)return i;i=i._prev}},hs=function(t,e,n,i){var s=t._repeat,o=Ge(e)||0,a=t._tTime/t._tDur;return a&&!i&&(t._time*=o/t._dur),t._dur=o,t._tDur=s?s<0?1e10:Ge(o*(s+1)+t._rDelay*s):o,a>0&&!i&&fa(t,t._tTime=t._tDur*a),t.parent&&ha(t),n||Mr(t.parent,t),t},qh=function(t){return t instanceof Ze?Mr(t):hs(t,t._dur)},Dg={_start:0,endTime:fo,totalDuration:fo},Bn=function r(t,e,n){var i=t.labels,s=t._recent||Dg,o=t.duration()>=zn?s.endTime(!1):t._dur,a,l,c;return Be(e)&&(isNaN(e)||e in i)?(l=e.charAt(0),c=e.substr(-1)==="%",a=e.indexOf("="),l==="<"||l===">"?(a>=0&&(e=e.replace(/=/,"")),(l==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(e.substr(1))||0)*(c?(a<0?s:n).totalDuration()/100:1)):a<0?(e in i||(i[e]=o),i[e]):(l=parseFloat(e.charAt(a-1)+e.substr(a+1)),c&&n&&(l=l/100*(en(n)?n[0]:n).totalDuration()),a>1?r(t,e.substr(0,a-1),n)+l:o+l)):e==null?o:+e},co=function(t,e,n){var i=Ei(e[1]),s=(i?2:1)+(t<2?0:1),o=e[s],a,l;if(i&&(o.duration=e[1]),o.parent=n,t){for(a=o,l=n;l&&!("immediateRender"in a);)a=l.vars.defaults||{},l=wn(l.vars.inherit)&&l.parent;o.immediateRender=wn(a.immediateRender),t<2?o.runBackwards=1:o.startAt=e[s-1]}return new Ie(e[0],o,e[s+1])},$i=function(t,e){return t||t===0?e(t):e},go=function(t,e,n){return n<t?t:n>e?e:n},Je=function(t,e){return!Be(t)||!(e=_g.exec(t))?"":e[1]},Cg=function(t,e,n){return $i(n,function(i){return go(t,e,i)})},cc=[].slice,ff=function(t,e){return t&&fi(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&fi(t[0]))&&!t.nodeType&&t!==ui},Rg=function(t,e,n){return n===void 0&&(n=[]),t.forEach(function(i){var s;return Be(i)&&!e||ff(i,1)?(s=n).push.apply(s,kn(i)):n.push(i)})||n},kn=function(t,e,n){return be&&!e&&be.selector?be.selector(t):Be(t)&&!n&&(sc||!fs())?cc.call((e||xc).querySelectorAll(t),0):en(t)?Rg(t,n):ff(t)?cc.call(t,0):t?[t]:[]},uc=function(t){return t=kn(t)[0]||ho("Invalid scope")||{},function(e){var n=t.current||t.nativeElement||t;return kn(e,n.querySelectorAll?n:n===t?ho("Invalid scope")||xc.createElement("div"):t)}},df=function(t){return t.sort(function(){return .5-Math.random()})},pf=function(t){if(Ce(t))return t;var e=fi(t)?t:{each:t},n=br(e.ease),i=e.from||0,s=parseFloat(e.base)||0,o={},a=i>0&&i<1,l=isNaN(i)||a,c=e.axis,u=i,f=i;return Be(i)?u=f={center:.5,edges:.5,end:1}[i]||0:!a&&l&&(u=i[0],f=i[1]),function(h,d,_){var g=(_||e).length,p=o[g],m,b,S,y,D,A,w,P,M;if(!p){if(M=e.grid==="auto"?0:(e.grid||[1,zn])[1],!M){for(w=-zn;w<(w=_[M++].getBoundingClientRect().left)&&M<g;);M<g&&M--}for(p=o[g]=[],m=l?Math.min(M,g)*u-.5:i%M,b=M===zn?0:l?g*f/M-.5:i/M|0,w=0,P=zn,A=0;A<g;A++)S=A%M-m,y=b-(A/M|0),p[A]=D=c?Math.abs(c==="y"?y:S):Kh(S*S+y*y),D>w&&(w=D),D<P&&(P=D);i==="random"&&df(p),p.max=w-P,p.min=P,p.v=g=(parseFloat(e.amount)||parseFloat(e.each)*(M>g?g-1:c?c==="y"?g/M:M:Math.max(M,g/M))||0)*(i==="edges"?-1:1),p.b=g<0?s-g:s,p.u=Je(e.amount||e.each)||0,n=n&&g<0?bf(n):n}return g=(p[h]-p.min)/p.max||0,Ge(p.b+(n?n(g):g)*p.v)+p.u}},hc=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(n){var i=Ge(Math.round(parseFloat(n)/t)*t*e);return(i-i%1)/e+(Ei(n)?0:Je(n))}},mf=function(t,e){var n=en(t),i,s;return!n&&fi(t)&&(i=n=t.radius||zn,t.values?(t=kn(t.values),(s=!Ei(t[0]))&&(i*=i)):t=hc(t.increment)),$i(e,n?Ce(t)?function(o){return s=t(o),Math.abs(s-o)<=i?s:o}:function(o){for(var a=parseFloat(s?o.x:o),l=parseFloat(s?o.y:0),c=zn,u=0,f=t.length,h,d;f--;)s?(h=t[f].x-a,d=t[f].y-l,h=h*h+d*d):h=Math.abs(t[f]-a),h<c&&(c=h,u=f);return u=!i||c<=i?t[u]:o,s||u===o||Ei(o)?u:u+Je(o)}:hc(t))},gf=function(t,e,n,i){return $i(en(t)?!e:n===!0?!!(n=0):!i,function(){return en(t)?t[~~(Math.random()*t.length)]:(n=n||1e-5)&&(i=n<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((t-n/2+Math.random()*(e-t+n*.99))/n)*n*i)/i})},Pg=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(i){return e.reduce(function(s,o){return o(s)},i)}},Ig=function(t,e){return function(n){return t(parseFloat(n))+(e||Je(n))}},Lg=function(t,e,n){return xf(t,e,0,1,n)},_f=function(t,e,n){return $i(n,function(i){return t[~~e(i)]})},Fg=function r(t,e,n){var i=e-t;return en(t)?_f(t,r(0,t.length),e):$i(n,function(s){return(i+(s-t)%i)%i+t})},Ng=function r(t,e,n){var i=e-t,s=i*2;return en(t)?_f(t,r(0,t.length-1),e):$i(n,function(o){return o=(s+(o-t)%s)%s||0,t+(o>i?s-o:o)})},ds=function(t){for(var e=0,n="",i,s,o,a;~(i=t.indexOf("random(",e));)o=t.indexOf(")",i),a=t.charAt(i+7)==="[",s=t.substr(i+7,o-i-7).match(a?Qh:rc),n+=t.substr(e,i-e)+gf(a?s:+s[0],a?0:+s[1],+s[2]||1e-5),e=o+1;return n+t.substr(e,t.length-e)},xf=function(t,e,n,i,s){var o=e-t,a=i-n;return $i(s,function(l){return n+((l-t)/o*a||0)})},Ug=function r(t,e,n,i){var s=isNaN(t+e)?0:function(d){return(1-d)*t+d*e};if(!s){var o=Be(t),a={},l,c,u,f,h;if(n===!0&&(i=1)&&(n=null),o)t={p:t},e={p:e};else if(en(t)&&!en(e)){for(u=[],f=t.length,h=f-2,c=1;c<f;c++)u.push(r(t[c-1],t[c]));f--,s=function(_){_*=f;var g=Math.min(h,~~_);return u[g](_-g)},n=e}else i||(t=Er(en(t)?[]:{},t));if(!u){for(l in e)Ec.call(a,t,l,"get",e[l]);s=function(_){return Rc(_,a)||(o?t.p:t)}}}return $i(n,s)},Yh=function(t,e,n){var i=t.labels,s=zn,o,a,l;for(o in i)a=i[o]-e,a<0==!!n&&a&&s>(a=Math.abs(a))&&(l=o,s=a);return l},Rn=function(t,e,n){var i=t.vars,s=i[e],o=be,a=t._ctx,l,c,u;if(s)return l=i[e+"Params"],c=i.callbackScope||t,n&&Yi.length&&ra(),a&&(be=a),u=l?s.apply(c,l):s.call(c),be=o,u},oo=function(t){return Ji(t),t.scrollTrigger&&t.scrollTrigger.kill(!!tn),t.progress()<1&&Rn(t,"onInterrupt"),t},ls,vf=[],yf=function(t){if(t)if(t=!t.name&&t.default||t,mc()||t.headless){var e=t.name,n=Ce(t),i=e&&!n&&t.init?function(){this._props=[]}:t,s={init:fo,render:Rc,add:Ec,kill:jg,modifier:Kg,rawVars:0},o={targetTest:0,get:0,getSetter:da,aliases:{},register:0};if(fs(),t!==i){if(Mn[e])return;Vn(i,Vn(sa(t,s),o)),Er(i.prototype,Er(s,sa(t,o))),Mn[i.prop=e]=i,t.targetTest&&(ea.push(i),vc[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}nf(e,i),t.register&&t.register(nn,i,fn)}else vf.push(t)},ge=255,ao={aqua:[0,ge,ge],lime:[0,ge,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,ge],navy:[0,0,128],white:[ge,ge,ge],olive:[128,128,0],yellow:[ge,ge,0],orange:[ge,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[ge,0,0],pink:[ge,192,203],cyan:[0,ge,ge],transparent:[ge,ge,ge,0]},jl=function(t,e,n){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(n-e)*t*6:t<.5?n:t*3<2?e+(n-e)*(2/3-t)*6:e)*ge+.5|0},Sf=function(t,e,n){var i=t?Ei(t)?[t>>16,t>>8&ge,t&ge]:0:ao.black,s,o,a,l,c,u,f,h,d,_;if(!i){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),ao[t])i=ao[t];else if(t.charAt(0)==="#"){if(t.length<6&&(s=t.charAt(1),o=t.charAt(2),a=t.charAt(3),t="#"+s+s+o+o+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return i=parseInt(t.substr(1,6),16),[i>>16,i>>8&ge,i&ge,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),i=[t>>16,t>>8&ge,t&ge]}else if(t.substr(0,3)==="hsl"){if(i=_=t.match(rc),!e)l=+i[0]%360/360,c=+i[1]/100,u=+i[2]/100,o=u<=.5?u*(c+1):u+c-u*c,s=u*2-o,i.length>3&&(i[3]*=1),i[0]=jl(l+1/3,s,o),i[1]=jl(l,s,o),i[2]=jl(l-1/3,s,o);else if(~t.indexOf("="))return i=t.match(gc),n&&i.length<4&&(i[3]=1),i}else i=t.match(rc)||ao.transparent;i=i.map(Number)}return e&&!_&&(s=i[0]/ge,o=i[1]/ge,a=i[2]/ge,f=Math.max(s,o,a),h=Math.min(s,o,a),u=(f+h)/2,f===h?l=c=0:(d=f-h,c=u>.5?d/(2-f-h):d/(f+h),l=f===s?(o-a)/d+(o<a?6:0):f===o?(a-s)/d+2:(s-o)/d+4,l*=60),i[0]=~~(l+.5),i[1]=~~(c*100+.5),i[2]=~~(u*100+.5)),n&&i.length<4&&(i[3]=1),i},Mf=function(t){var e=[],n=[],i=-1;return t.split(wi).forEach(function(s){var o=s.match(Tr)||[];e.push.apply(e,o),n.push(i+=o.length+1)}),e.c=n,e},Zh=function(t,e,n){var i="",s=(t+i).match(wi),o=e?"hsla(":"rgba(",a=0,l,c,u,f;if(!s)return t;if(s=s.map(function(h){return(h=Sf(h,e,1))&&o+(e?h[0]+","+h[1]+"%,"+h[2]+"%,"+h[3]:h.join(","))+")"}),n&&(u=Mf(t),l=n.c,l.join(i)!==u.c.join(i)))for(c=t.replace(wi,"1").split(Tr),f=c.length-1;a<f;a++)i+=c[a]+(~l.indexOf(a)?s.shift()||o+"0,0,0,0)":(u.length?u:s.length?s:n).shift());if(!c)for(c=t.split(wi),f=c.length-1;a<f;a++)i+=c[a]+s[a];return i+c[f]},wi=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in ao)r+="|"+t+"\\b";return new RegExp(r+")","gi")}(),Og=/hsl[a]?\(/,bc=function(t){var e=t.join(" "),n;if(wi.lastIndex=0,wi.test(e))return n=Og.test(e),t[1]=Zh(t[1],n),t[0]=Zh(t[0],n,Mf(t[1])),!0},po,bn=function(){var r=Date.now,t=500,e=33,n=r(),i=n,s=1e3/240,o=s,a=[],l,c,u,f,h,d,_=function g(p){var m=r()-i,b=p===!0,S,y,D,A;if((m>t||m<0)&&(n+=m-e),i+=m,D=i-n,S=D-o,(S>0||b)&&(A=++f.frame,h=D-f.time*1e3,f.time=D=D/1e3,o+=S+(S>=s?4:s-S),y=1),b||(l=c(g)),y)for(d=0;d<a.length;d++)a[d](D,h,A,p)};return f={time:0,frame:0,tick:function(){_(!0)},deltaRatio:function(p){return h/(1e3/(p||60))},wake:function(){tf&&(!sc&&mc()&&(ui=sc=window,xc=ui.document||{},Pn.gsap=nn,(ui.gsapVersions||(ui.gsapVersions=[])).push(nn.version),ef(ia||ui.GreenSockGlobals||!ui.gsap&&ui||{}),vf.forEach(yf)),u=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&f.sleep(),c=u||function(p){return setTimeout(p,o-f.time*1e3+1|0)},po=1,_(2))},sleep:function(){(u?cancelAnimationFrame:clearTimeout)(l),po=0,c=fo},lagSmoothing:function(p,m){t=p||1/0,e=Math.min(m||33,t)},fps:function(p){s=1e3/(p||240),o=f.time*1e3+s},add:function(p,m,b){var S=m?function(y,D,A,w){p(y,D,A,w),f.remove(S)}:p;return f.remove(p),a[b?"unshift":"push"](S),fs(),S},remove:function(p,m){~(m=a.indexOf(p))&&a.splice(m,1)&&d>=m&&d--},_listeners:a},f}(),fs=function(){return!po&&bn.wake()},se={},Bg=/^[\d.\-M][\d.\-,\s]/,zg=/["']/g,kg=function(t){for(var e={},n=t.substr(1,t.length-3).split(":"),i=n[0],s=1,o=n.length,a,l,c;s<o;s++)l=n[s],a=s!==o-1?l.lastIndexOf(","):l.length,c=l.substr(0,a),e[i]=isNaN(c)?c.replace(zg,"").trim():+c,i=l.substr(a+1).trim();return e},Vg=function(t){var e=t.indexOf("(")+1,n=t.indexOf(")"),i=t.indexOf("(",e);return t.substring(e,~i&&i<n?t.indexOf(")",n+1):n)},Hg=function(t){var e=(t+"").split("("),n=se[e[0]];return n&&e.length>1&&n.config?n.config.apply(null,~t.indexOf("{")?[kg(e[1])]:Vg(t).split(",").map(of)):se._CE&&Bg.test(t)?se._CE("",t):n},bf=function(t){return function(e){return 1-t(1-e)}},wf=function r(t,e){for(var n=t._first,i;n;)n instanceof Ze?r(n,e):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==e&&(n.timeline?r(n.timeline,e):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=e)),n=n._next},br=function(t,e){return t&&(Ce(t)?t:se[t]||Hg(t))||e},Dr=function(t,e,n,i){n===void 0&&(n=function(l){return 1-e(1-l)}),i===void 0&&(i=function(l){return l<.5?e(l*2)/2:1-e((1-l)*2)/2});var s={easeIn:e,easeOut:n,easeInOut:i},o;return hn(t,function(a){se[a]=Pn[a]=s,se[o=a.toLowerCase()]=n;for(var l in s)se[o+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=se[a+"."+l]=s[l]}),s},Ef=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},Ql=function r(t,e,n){var i=e>=1?e:1,s=(n||(t?.3:.45))/(e<1?e:1),o=s/ic*(Math.asin(1/i)||0),a=function(u){return u===1?1:i*Math.pow(2,-10*u)*gg((u-o)*s)+1},l=t==="out"?a:t==="in"?function(c){return 1-a(1-c)}:Ef(a);return s=ic/s,l.config=function(c,u){return r(t,c,u)},l},tc=function r(t,e){e===void 0&&(e=1.70158);var n=function(o){return o?--o*o*((e+1)*o+e)+1:0},i=t==="out"?n:t==="in"?function(s){return 1-n(1-s)}:Ef(n);return i.config=function(s){return r(t,s)},i};hn("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,t){var e=t<5?t+1:t;Dr(r+",Power"+(e-1),t?function(n){return Math.pow(n,e)}:function(n){return n},function(n){return 1-Math.pow(1-n,e)},function(n){return n<.5?Math.pow(n*2,e)/2:1-Math.pow((1-n)*2,e)/2})});se.Linear.easeNone=se.none=se.Linear.easeIn;Dr("Elastic",Ql("in"),Ql("out"),Ql());(function(r,t){var e=1/t,n=2*e,i=2.5*e,s=function(a){return a<e?r*a*a:a<n?r*Math.pow(a-1.5/t,2)+.75:a<i?r*(a-=2.25/t)*a+.9375:r*Math.pow(a-2.625/t,2)+.984375};Dr("Bounce",function(o){return 1-s(1-o)},s)})(7.5625,2.75);Dr("Expo",function(r){return r?Math.pow(2,10*(r-1)):0});Dr("Circ",function(r){return-(Kh(1-r*r)-1)});Dr("Sine",function(r){return r===1?1:-mg(r*dg)+1});Dr("Back",tc("in"),tc("out"),tc());se.SteppedEase=se.steps=Pn.SteppedEase={config:function(t,e){t===void 0&&(t=1);var n=1/t,i=t+(e?0:1),s=e?1:0,o=1-xe;return function(a){return((i*go(0,o,a)|0)+s)*n}}};cs.ease=se["quad.out"];hn("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return yc+=r+","+r+"Params,"});var wc=function(t,e){this.id=pg++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:Mc,this.set=e?e.getSetter:da},mo=function(){function r(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,hs(this,+e.duration,1,1),this.data=e.data,be&&(this._ctx=be,be.data.push(this)),po||bn.wake()}var t=r.prototype;return t.delay=function(n){return n||n===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+n-this._delay),this._delay=n,this):this._delay},t.duration=function(n){return arguments.length?this.totalDuration(this._repeat>0?n+(n+this._rDelay)*this._repeat:n):this.totalDuration()&&this._dur},t.totalDuration=function(n){return arguments.length?(this._dirty=0,hs(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(n,i){if(fs(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(fa(this,n),!s._dp||s.parent||cf(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&n<this._tDur||this._ts<0&&n>0||!this._tDur&&!n)&&hi(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===xe||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),sf(this,n,i)),this},t.time=function(n,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+Xh(this))%(this._dur+this._rDelay)||(n?this._dur:0),i):this._time},t.totalProgress=function(n,i){return arguments.length?this.totalTime(this.totalDuration()*n,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(n,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-n:n)+Xh(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(n,i){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(n-1)*s,i):this._repeat?us(this._tTime,s)+1:1},t.timeScale=function(n,i){if(!arguments.length)return this._rts===-xe?0:this._rts;if(this._rts===n)return this;var s=this.parent&&this._ts?oa(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-xe?0:this._rts,this.totalTime(go(-Math.abs(this._delay),this._tDur,s),i!==!1),ha(this),bg(this)},t.paused=function(n){return arguments.length?(this._ps!==n&&(this._ps=n,n?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(fs(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==xe&&(this._tTime-=xe)))),this):this._ps},t.startTime=function(n){if(arguments.length){this._start=n;var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&hi(i,this,n-this._delay),this}return this._start},t.endTime=function(n){return this._start+(wn(n)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(n){var i=this.parent||this._dp;return i?n&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?oa(i.rawTime(n),this):this._tTime:this._tTime},t.revert=function(n){n===void 0&&(n=vg);var i=tn;return tn=n,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),tn=i,this},t.globalTime=function(n){for(var i=this,s=arguments.length?n:i.rawTime();i;)s=i._start+s/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(n):s},t.repeat=function(n){return arguments.length?(this._repeat=n===1/0?-2:n,qh(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(n){if(arguments.length){var i=this._time;return this._rDelay=n,qh(this),i?this.time(i):this}return this._rDelay},t.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},t.seek=function(n,i){return this.totalTime(Bn(this,n),wn(i))},t.restart=function(n,i){return this.play().totalTime(n?-this._delay:0,wn(i))},t.play=function(n,i){return n!=null&&this.seek(n,i),this.reversed(!1).paused(!1)},t.reverse=function(n,i){return n!=null&&this.seek(n||this.totalDuration(),i),this.reversed(!0).paused(!1)},t.pause=function(n,i){return n!=null&&this.seek(n,i),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(n){return arguments.length?(!!n!==this.reversed()&&this.timeScale(-this._rts||(n?-xe:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-xe,this},t.isActive=function(){var n=this.parent||this._dp,i=this._start,s;return!!(!n||this._ts&&this._initted&&n.isActive()&&(s=n.rawTime(!0))>=i&&s<this.endTime(!0)-xe)},t.eventCallback=function(n,i,s){var o=this.vars;return arguments.length>1?(i?(o[n]=i,s&&(o[n+"Params"]=s),n==="onUpdate"&&(this._onUpdate=i)):delete o[n],this):o[n]},t.then=function(n){var i=this;return new Promise(function(s){var o=Ce(n)?n:af,a=function(){var c=i.then;i.then=null,Ce(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=c),s(o),i.then=c};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?a():i._prom=a})},t.kill=function(){oo(this)},r}();Vn(mo.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:-xe,_prom:0,_ps:!1,_rts:1});var Ze=function(r){$h(t,r);function t(n,i){var s;return n===void 0&&(n={}),s=r.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=wn(n.sortChildren),Te&&hi(n.parent||Te,bi(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&uf(bi(s),n.scrollTrigger),s}var e=t.prototype;return e.to=function(i,s,o){return co(0,arguments,this),this},e.from=function(i,s,o){return co(1,arguments,this),this},e.fromTo=function(i,s,o,a){return co(2,arguments,this),this},e.set=function(i,s,o){return s.duration=0,s.parent=this,lo(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Ie(i,s,Bn(this,o),1),this},e.call=function(i,s,o){return hi(this,Ie.delayedCall(0,i,s),o)},e.staggerTo=function(i,s,o,a,l,c,u){return o.duration=s,o.stagger=o.stagger||a,o.onComplete=c,o.onCompleteParams=u,o.parent=this,new Ie(i,o,Bn(this,l)),this},e.staggerFrom=function(i,s,o,a,l,c,u){return o.runBackwards=1,lo(o).immediateRender=wn(o.immediateRender),this.staggerTo(i,s,o,a,l,c,u)},e.staggerFromTo=function(i,s,o,a,l,c,u,f){return a.startAt=o,lo(a).immediateRender=wn(a.immediateRender),this.staggerTo(i,s,a,l,c,u,f)},e.render=function(i,s,o){var a=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,u=i<=0?0:Ge(i),f=this._zTime<0!=i<0&&(this._initted||!c),h,d,_,g,p,m,b,S,y,D,A,w;if(this!==Te&&u>l&&i>=0&&(u=l),u!==this._tTime||o||f){if(a!==this._time&&c&&(u+=this._time-a,i+=this._time-a),h=u,y=this._start,S=this._ts,m=!S,f&&(c||(a=this._zTime),(i||!s)&&(this._zTime=i)),this._repeat){if(A=this._yoyo,p=c+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(p*100+i,s,o);if(h=Ge(u%p),u===l?(g=this._repeat,h=c):(g=~~(u/p),g&&g===u/p&&(h=c,g--),h>c&&(h=c)),D=us(this._tTime,p),!a&&this._tTime&&D!==g&&this._tTime-D*p-this._dur<=0&&(D=g),A&&g&1&&(h=c-h,w=1),g!==D&&!this._lock){var P=A&&D&1,M=P===(A&&g&1);if(g<D&&(P=!P),a=P?0:u%c?c:u,this._lock=1,this.render(a||(w?0:Ge(g*p)),s,!c)._lock=0,this._tTime=u,!s&&this.parent&&Rn(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1),a&&a!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,M&&(this._lock=2,a=P?c:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!m)return this;wf(this,w)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(b=Ag(this,Ge(a),Ge(h)),b&&(u-=h-(h=b._start))),this._tTime=u,this._time=h,this._act=!S,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,a=0),!a&&h&&!s&&!g&&(Rn(this,"onStart"),this._tTime!==u))return this;if(h>=a&&i>=0)for(d=this._first;d;){if(_=d._next,(d._act||h>=d._start)&&d._ts&&b!==d){if(d.parent!==this)return this.render(i,s,o);if(d.render(d._ts>0?(h-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(h-d._start)*d._ts,s,o),h!==this._time||!this._ts&&!m){b=0,_&&(u+=this._zTime=-xe);break}}d=_}else{d=this._last;for(var v=i<0?i:h;d;){if(_=d._prev,(d._act||v<=d._end)&&d._ts&&b!==d){if(d.parent!==this)return this.render(i,s,o);if(d.render(d._ts>0?(v-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(v-d._start)*d._ts,s,o||tn&&(d._initted||d._startAt)),h!==this._time||!this._ts&&!m){b=0,_&&(u+=this._zTime=v?-xe:xe);break}}d=_}}if(b&&!s&&(this.pause(),b.render(h>=a?0:-xe)._zTime=h>=a?1:-1,this._ts))return this._start=y,ha(this),this.render(i,s,o);this._onUpdate&&!s&&Rn(this,"onUpdate",!0),(u===l&&this._tTime>=this.totalDuration()||!u&&a)&&(y===this._start||Math.abs(S)!==Math.abs(this._ts))&&(this._lock||((i||!c)&&(u===l&&this._ts>0||!u&&this._ts<0)&&Ji(this,1),!s&&!(i<0&&!a)&&(u||a||!l)&&(Rn(this,u===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(i,s){var o=this;if(Ei(s)||(s=Bn(this,s,i)),!(i instanceof mo)){if(en(i))return i.forEach(function(a){return o.add(a,s)}),this;if(Be(i))return this.addLabel(i,s);if(Ce(i))i=Ie.delayedCall(0,i);else return this}return this!==i?hi(this,i,s):this},e.getChildren=function(i,s,o,a){i===void 0&&(i=!0),s===void 0&&(s=!0),o===void 0&&(o=!0),a===void 0&&(a=-zn);for(var l=[],c=this._first;c;)c._start>=a&&(c instanceof Ie?s&&l.push(c):(o&&l.push(c),i&&l.push.apply(l,c.getChildren(!0,s,o)))),c=c._next;return l},e.getById=function(i){for(var s=this.getChildren(1,1,1),o=s.length;o--;)if(s[o].vars.id===i)return s[o]},e.remove=function(i){return Be(i)?this.removeLabel(i):Ce(i)?this.killTweensOf(i):(ua(this,i),i===this._recent&&(this._recent=this._last),Mr(this))},e.totalTime=function(i,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ge(bn.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),r.prototype.totalTime.call(this,i,s),this._forcing=0,this):this._tTime},e.addLabel=function(i,s){return this.labels[i]=Bn(this,s),this},e.removeLabel=function(i){return delete this.labels[i],this},e.addPause=function(i,s,o){var a=Ie.delayedCall(0,s||fo,o);return a.data="isPause",this._hasPause=1,hi(this,a,Bn(this,i))},e.removePause=function(i){var s=this._first;for(i=Bn(this,i);s;)s._start===i&&s.data==="isPause"&&Ji(s),s=s._next},e.killTweensOf=function(i,s,o){for(var a=this.getTweensOf(i,o),l=a.length;l--;)qi!==a[l]&&a[l].kill(i,s);return this},e.getTweensOf=function(i,s){for(var o=[],a=kn(i),l=this._first,c=Ei(s),u;l;)l instanceof Ie?yg(l._targets,a)&&(c?(!qi||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&o.push(l):(u=l.getTweensOf(a,s)).length&&o.push.apply(o,u),l=l._next;return o},e.tweenTo=function(i,s){s=s||{};var o=this,a=Bn(o,i),l=s,c=l.startAt,u=l.onStart,f=l.onStartParams,h=l.immediateRender,d,_=Ie.to(o,Vn({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale())||xe,onStart:function(){if(o.pause(),!d){var p=s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale());_._dur!==p&&hs(_,p,0,1).render(_._time,!0,!0),d=1}u&&u.apply(_,f||[])}},s));return h?_.render(0):_},e.tweenFromTo=function(i,s,o){return this.tweenTo(s,Vn({startAt:{time:Bn(this,i)}},o))},e.recent=function(){return this._recent},e.nextLabel=function(i){return i===void 0&&(i=this._time),Yh(this,Bn(this,i))},e.previousLabel=function(i){return i===void 0&&(i=this._time),Yh(this,Bn(this,i),1)},e.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+xe)},e.shiftChildren=function(i,s,o){o===void 0&&(o=0);for(var a=this._first,l=this.labels,c;a;)a._start>=o&&(a._start+=i,a._end+=i),a=a._next;if(s)for(c in l)l[c]>=o&&(l[c]+=i);return Mr(this)},e.invalidate=function(i){var s=this._first;for(this._lock=0;s;)s.invalidate(i),s=s._next;return r.prototype.invalidate.call(this,i)},e.clear=function(i){i===void 0&&(i=!0);for(var s=this._first,o;s;)o=s._next,this.remove(s),s=o;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),Mr(this)},e.totalDuration=function(i){var s=0,o=this,a=o._last,l=zn,c,u,f;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-i:i));if(o._dirty){for(f=o.parent;a;)c=a._prev,a._dirty&&a.totalDuration(),u=a._start,u>l&&o._sort&&a._ts&&!o._lock?(o._lock=1,hi(o,a,u-a._delay,1)._lock=0):l=u,u<0&&a._ts&&(s-=u,(!f&&!o._dp||f&&f.smoothChildTiming)&&(o._start+=u/o._ts,o._time-=u,o._tTime-=u),o.shiftChildren(-u,!1,-1/0),l=0),a._end>s&&a._ts&&(s=a._end),a=c;hs(o,o===Te&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(i){if(Te._ts&&(sf(Te,oa(i,Te)),rf=bn.frame),bn.frame>=Gh){Gh+=En.autoSleep||120;var s=Te._first;if((!s||!s._ts)&&En.autoSleep&&bn._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||bn.sleep()}}},t}(mo);Vn(Ze.prototype,{_lock:0,_hasPause:0,_forcing:0});var Gg=function(t,e,n,i,s,o,a){var l=new fn(this._pt,t,e,0,1,Cc,null,s),c=0,u=0,f,h,d,_,g,p,m,b;for(l.b=n,l.e=i,n+="",i+="",(m=~i.indexOf("random("))&&(i=ds(i)),o&&(b=[n,i],o(b,t,e),n=b[0],i=b[1]),h=n.match($l)||[];f=$l.exec(i);)_=f[0],g=i.substring(c,f.index),d?d=(d+1)%5:g.substr(-5)==="rgba("&&(d=1),_!==h[u++]&&(p=parseFloat(h[u-1])||0,l._pt={_next:l._pt,p:g||u===1?g:",",s:p,c:_.charAt(1)==="="?Ar(p,_)-p:parseFloat(_)-p,m:d&&d<4?Math.round:0},c=$l.lastIndex);return l.c=c<i.length?i.substring(c,i.length):"",l.fp=a,(_c.test(i)||m)&&(l.e=0),this._pt=l,l},Ec=function(t,e,n,i,s,o,a,l,c,u){Ce(i)&&(i=i(s||0,t,o));var f=t[e],h=n!=="get"?n:Ce(f)?c?t[e.indexOf("set")||!Ce(t["get"+e.substr(3)])?e:"get"+e.substr(3)](c):t[e]():f,d=Ce(f)?c?Zg:Df:Dc,_;if(Be(i)&&(~i.indexOf("random(")&&(i=ds(i)),i.charAt(1)==="="&&(_=Ar(h,i)+(Je(h)||0),(_||_===0)&&(i=_))),!u||h!==i||fc)return!isNaN(h*i)&&i!==""?(_=new fn(this._pt,t,e,+h||0,i-(h||0),typeof f=="boolean"?$g:Cf,0,d),c&&(_.fp=c),a&&_.modifier(a,this,t),this._pt=_):(!f&&!(e in t)&&ca(e,i),Gg.call(this,t,e,h,i,d,l||En.stringFilter,c))},Wg=function(t,e,n,i,s){if(Ce(t)&&(t=uo(t,s,e,n,i)),!fi(t)||t.style&&t.nodeType||en(t)||jh(t))return Be(t)?uo(t,s,e,n,i):t;var o={},a;for(a in t)o[a]=uo(t[a],s,e,n,i);return o},Tc=function(t,e,n,i,s,o){var a,l,c,u;if(Mn[t]&&(a=new Mn[t]).init(s,a.rawVars?e[t]:Wg(e[t],i,s,o,n),n,i,o)!==!1&&(n._pt=l=new fn(n._pt,s,t,0,1,a.render,a,0,a.priority),n!==ls))for(c=n._ptLookup[n._targets.indexOf(s)],u=a._props.length;u--;)c[a._props[u]]=l;return a},qi,fc,Ac=function r(t,e,n){var i=t.vars,s=i.ease,o=i.startAt,a=i.immediateRender,l=i.lazy,c=i.onUpdate,u=i.runBackwards,f=i.yoyoEase,h=i.keyframes,d=i.autoRevert,_=t._dur,g=t._startAt,p=t._targets,m=t.parent,b=m&&m.data==="nested"?m.vars.targets:p,S=t._overwrite==="auto"&&!pc,y=t.timeline,D,A,w,P,M,v,N,F,R,B,Y,H,J;if(y&&(!h||!s)&&(s="none"),t._ease=br(s,cs.ease),t._yEase=f?bf(br(f===!0?s:f,cs.ease)):0,f&&t._yoyo&&!t._repeat&&(f=t._yEase,t._yEase=t._ease,t._ease=f),t._from=!y&&!!i.runBackwards,!y||h&&!i.stagger){if(F=p[0]?Zi(p[0]).harness:0,H=F&&i[F.prop],D=sa(i,vc),g&&(g._zTime<0&&g.progress(1),e<0&&u&&a&&!d?g.render(-1,!0):g.revert(u&&_?ta:xg),g._lazy=0),o){if(Ji(t._startAt=Ie.set(p,Vn({data:"isStart",overwrite:!1,parent:m,immediateRender:!0,lazy:!g&&wn(l),startAt:null,delay:0,onUpdate:c&&function(){return Rn(t,"onUpdate")},stagger:0},o))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(tn||!a&&!d)&&t._startAt.revert(ta),a&&_&&e<=0&&n<=0){e&&(t._zTime=e);return}}else if(u&&_&&!g){if(e&&(a=!1),w=Vn({overwrite:!1,data:"isFromStart",lazy:a&&!g&&wn(l),immediateRender:a,stagger:0,parent:m},D),H&&(w[F.prop]=H),Ji(t._startAt=Ie.set(p,w)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(tn?t._startAt.revert(ta):t._startAt.render(-1,!0)),t._zTime=e,!a)r(t._startAt,xe,xe);else if(!e)return}for(t._pt=t._ptCache=0,l=_&&wn(l)||l&&!_,A=0;A<p.length;A++){if(M=p[A],N=M._gsap||Sc(p)[A]._gsap,t._ptLookup[A]=B={},oc[N.id]&&Yi.length&&ra(),Y=b===p?A:b.indexOf(M),F&&(R=new F).init(M,H||D,t,Y,b)!==!1&&(t._pt=P=new fn(t._pt,M,R.name,0,1,R.render,R,0,R.priority),R._props.forEach(function(O){B[O]=P}),R.priority&&(v=1)),!F||H)for(w in D)Mn[w]&&(R=Tc(w,D,t,Y,M,b))?R.priority&&(v=1):B[w]=P=Ec.call(t,M,w,"get",D[w],Y,b,0,i.stringFilter);t._op&&t._op[A]&&t.kill(M,t._op[A]),S&&t._pt&&(qi=t,Te.killTweensOf(M,B,t.globalTime(e)),J=!t.parent,qi=0),t._pt&&l&&(oc[N.id]=1)}v&&Pc(t),t._onInit&&t._onInit(t)}t._onUpdate=c,t._initted=(!t._op||t._pt)&&!J,h&&e<=0&&y.render(zn,!0,!0)},Xg=function(t,e,n,i,s,o,a,l){var c=(t._pt&&t._ptCache||(t._ptCache={}))[e],u,f,h,d;if(!c)for(c=t._ptCache[e]=[],h=t._ptLookup,d=t._targets.length;d--;){if(u=h[d][e],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return fc=1,t.vars[e]="+=0",Ac(t,a),fc=0,l?ho(e+" not eligible for reset"):1;c.push(u)}for(d=c.length;d--;)f=c[d],u=f._pt||f,u.s=(i||i===0)&&!s?i:u.s+(i||0)+o*u.c,u.c=n-u.s,f.e&&(f.e=Re(n)+Je(f.e)),f.b&&(f.b=u.s+Je(f.b))},qg=function(t,e){var n=t[0]?Zi(t[0]).harness:0,i=n&&n.aliases,s,o,a,l;if(!i)return e;s=Er({},e);for(o in i)if(o in s)for(l=i[o].split(","),a=l.length;a--;)s[l[a]]=s[o];return s},Yg=function(t,e,n,i){var s=e.ease||i||"power1.inOut",o,a;if(en(e))a=n[t]||(n[t]=[]),e.forEach(function(l,c){return a.push({t:c/(e.length-1)*100,v:l,e:s})});else for(o in e)a=n[o]||(n[o]=[]),o==="ease"||a.push({t:parseFloat(t),v:e[o],e:s})},uo=function(t,e,n,i,s){return Ce(t)?t.call(e,n,i,s):Be(t)&&~t.indexOf("random(")?ds(t):t},Tf=yc+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",Af={};hn(Tf+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return Af[r]=1});var Ie=function(r){$h(t,r);function t(n,i,s,o){var a;typeof i=="number"&&(s.duration=i,i=s,s=null),a=r.call(this,o?i:lo(i))||this;var l=a.vars,c=l.duration,u=l.delay,f=l.immediateRender,h=l.stagger,d=l.overwrite,_=l.keyframes,g=l.defaults,p=l.scrollTrigger,m=l.yoyoEase,b=i.parent||Te,S=(en(n)||jh(n)?Ei(n[0]):"length"in i)?[n]:kn(n),y,D,A,w,P,M,v,N;if(a._targets=S.length?Sc(S):ho("GSAP target "+n+" not found. https://gsap.com",!En.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=d,_||h||Qo(c)||Qo(u)){if(i=a.vars,y=a.timeline=new Ze({data:"nested",defaults:g||{},targets:b&&b.data==="nested"?b.vars.targets:S}),y.kill(),y.parent=y._dp=bi(a),y._start=0,h||Qo(c)||Qo(u)){if(w=S.length,v=h&&pf(h),fi(h))for(P in h)~Tf.indexOf(P)&&(N||(N={}),N[P]=h[P]);for(D=0;D<w;D++)A=sa(i,Af),A.stagger=0,m&&(A.yoyoEase=m),N&&Er(A,N),M=S[D],A.duration=+uo(c,bi(a),D,M,S),A.delay=(+uo(u,bi(a),D,M,S)||0)-a._delay,!h&&w===1&&A.delay&&(a._delay=u=A.delay,a._start+=u,A.delay=0),y.to(M,A,v?v(D,M,S):0),y._ease=se.none;y.duration()?c=u=0:a.timeline=0}else if(_){lo(Vn(y.vars.defaults,{ease:"none"})),y._ease=br(_.ease||i.ease||"none");var F=0,R,B,Y;if(en(_))_.forEach(function(H){return y.to(S,H,">")}),y.duration();else{A={};for(P in _)P==="ease"||P==="easeEach"||Yg(P,_[P],A,_.easeEach);for(P in A)for(R=A[P].sort(function(H,J){return H.t-J.t}),F=0,D=0;D<R.length;D++)B=R[D],Y={ease:B.e,duration:(B.t-(D?R[D-1].t:0))/100*c},Y[P]=B.v,y.to(S,Y,F),F+=Y.duration;y.duration()<c&&y.to({},{duration:c-y.duration()})}}c||a.duration(c=y.duration())}else a.timeline=0;return d===!0&&!pc&&(qi=bi(a),Te.killTweensOf(S),qi=0),hi(b,bi(a),s),i.reversed&&a.reverse(),i.paused&&a.paused(!0),(f||!c&&!_&&a._start===Ge(b._time)&&wn(f)&&wg(bi(a))&&b.data!=="nested")&&(a._tTime=-xe,a.render(Math.max(0,-u)||0)),p&&uf(bi(a),p),a}var e=t.prototype;return e.render=function(i,s,o){var a=this._time,l=this._tDur,c=this._dur,u=i<0,f=i>l-xe&&!u?l:i<xe?0:i,h,d,_,g,p,m,b,S,y;if(!c)Tg(this,i,s,o);else if(f!==this._tTime||!i||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u){if(h=f,S=this.timeline,this._repeat){if(g=c+this._rDelay,this._repeat<-1&&u)return this.totalTime(g*100+i,s,o);if(h=Ge(f%g),f===l?(_=this._repeat,h=c):(_=~~(f/g),_&&_===Ge(f/g)&&(h=c,_--),h>c&&(h=c)),m=this._yoyo&&_&1,m&&(y=this._yEase,h=c-h),p=us(this._tTime,g),h===a&&!o&&this._initted&&_===p)return this._tTime=f,this;_!==p&&(S&&this._yEase&&wf(S,m),this.vars.repeatRefresh&&!m&&!this._lock&&this._time!==g&&this._initted&&(this._lock=o=1,this.render(Ge(g*_),!0).invalidate()._lock=0))}if(!this._initted){if(hf(this,u?i:h,o,s,f))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&_!==p))return this;if(c!==this._dur)return this.render(i,s,o)}if(this._tTime=f,this._time=h,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=b=(y||this._ease)(h/c),this._from&&(this.ratio=b=1-b),h&&!a&&!s&&!_&&(Rn(this,"onStart"),this._tTime!==f))return this;for(d=this._pt;d;)d.r(b,d.d),d=d._next;S&&S.render(i<0?i:S._dur*S._ease(h/this._dur),s,o)||this._startAt&&(this._zTime=i),this._onUpdate&&!s&&(u&&ac(this,i,s,o),Rn(this,"onUpdate")),this._repeat&&_!==p&&this.vars.onRepeat&&!s&&this.parent&&Rn(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(u&&!this._onUpdate&&ac(this,i,!0,!0),(i||!c)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&Ji(this,1),!s&&!(u&&!a)&&(f||a||m)&&(Rn(this,f===l?"onComplete":"onReverseComplete",!0),this._prom&&!(f<l&&this.timeScale()>0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),r.prototype.invalidate.call(this,i)},e.resetTo=function(i,s,o,a,l){po||bn.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||Ac(this,c),u=this._ease(c/this._dur),Xg(this,i,s,o,a,u,c,l)?this.resetTo(i,s,o,a,1):(fa(this,0),this.parent||lf(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(i,s){if(s===void 0&&(s="all"),!i&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?oo(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(i,s,qi&&qi.vars.overwrite!==!0)._first||oo(this),this.parent&&o!==this.timeline.totalDuration()&&hs(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,l=i?kn(i):a,c=this._ptLookup,u=this._pt,f,h,d,_,g,p,m;if((!s||s==="all")&&Mg(a,l))return s==="all"&&(this._pt=0),oo(this);for(f=this._op=this._op||[],s!=="all"&&(Be(s)&&(g={},hn(s,function(b){return g[b]=1}),s=g),s=qg(a,s)),m=a.length;m--;)if(~l.indexOf(a[m])){h=c[m],s==="all"?(f[m]=s,_=h,d={}):(d=f[m]=f[m]||{},_=s);for(g in _)p=h&&h[g],p&&((!("kill"in p.d)||p.d.kill(g)===!0)&&ua(this,p,"_pt"),delete h[g]),d!=="all"&&(d[g]=1)}return this._initted&&!this._pt&&u&&oo(this),this},t.to=function(i,s){return new t(i,s,arguments[2])},t.from=function(i,s){return co(1,arguments)},t.delayedCall=function(i,s,o,a){return new t(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:s,onReverseComplete:s,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},t.fromTo=function(i,s,o){return co(2,arguments)},t.set=function(i,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new t(i,s)},t.killTweensOf=function(i,s,o){return Te.killTweensOf(i,s,o)},t}(mo);Vn(Ie.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});hn("staggerTo,staggerFrom,staggerFromTo",function(r){Ie[r]=function(){var t=new Ze,e=cc.call(arguments,0);return e.splice(r==="staggerFromTo"?5:4,0,0),t[r].apply(t,e)}});var Dc=function(t,e,n){return t[e]=n},Df=function(t,e,n){return t[e](n)},Zg=function(t,e,n,i){return t[e](i.fp,n)},Jg=function(t,e,n){return t.setAttribute(e,n)},da=function(t,e){return Ce(t[e])?Df:la(t[e])&&t.setAttribute?Jg:Dc},Cf=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},$g=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},Cc=function(t,e){var n=e._pt,i="";if(!t&&e.b)i=e.b;else if(t===1&&e.e)i=e.e;else{for(;n;)i=n.p+(n.m?n.m(n.s+n.c*t):Math.round((n.s+n.c*t)*1e4)/1e4)+i,n=n._next;i+=e.c}e.set(e.t,e.p,i,e)},Rc=function(t,e){for(var n=e._pt;n;)n.r(t,n.d),n=n._next},Kg=function(t,e,n,i){for(var s=this._pt,o;s;)o=s._next,s.p===i&&s.modifier(t,e,n),s=o},jg=function(t){for(var e=this._pt,n,i;e;)i=e._next,e.p===t&&!e.op||e.op===t?ua(this,e,"_pt"):e.dep||(n=1),e=i;return!n},Qg=function(t,e,n,i){i.mSet(t,e,i.m.call(i.tween,n,i.mt),i)},Pc=function(t){for(var e=t._pt,n,i,s,o;e;){for(n=e._next,i=s;i&&i.pr>e.pr;)i=i._next;(e._prev=i?i._prev:o)?e._prev._next=e:s=e,(e._next=i)?i._prev=e:o=e,e=n}t._pt=s},fn=function(){function r(e,n,i,s,o,a,l,c,u){this.t=n,this.s=s,this.c=o,this.p=i,this.r=a||Cf,this.d=l||this,this.set=c||Dc,this.pr=u||0,this._next=e,e&&(e._prev=this)}var t=r.prototype;return t.modifier=function(n,i,s){this.mSet=this.mSet||this.set,this.set=Qg,this.m=n,this.mt=s,this.tween=i},r}();hn(yc+"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(r){return vc[r]=1});Pn.TweenMax=Pn.TweenLite=Ie;Pn.TimelineLite=Pn.TimelineMax=Ze;Te=new Ze({sortChildren:!1,defaults:cs,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});En.stringFilter=bc;var wr=[],na={},t_=[],Jh=0,e_=0,ec=function(t){return(na[t]||t_).map(function(e){return e()})},dc=function(){var t=Date.now(),e=[];t-Jh>2&&(ec("matchMediaInit"),wr.forEach(function(n){var i=n.queries,s=n.conditions,o,a,l,c;for(a in i)o=ui.matchMedia(i[a]).matches,o&&(l=1),o!==s[a]&&(s[a]=o,c=1);c&&(n.revert(),l&&e.push(n))}),ec("matchMediaRevert"),e.forEach(function(n){return n.onMatch(n,function(i){return n.add(null,i)})}),Jh=t,ec("matchMedia"))},Rf=function(){function r(e,n){this.selector=n&&uc(n),this.data=[],this._r=[],this.isReverted=!1,this.id=e_++,e&&this.add(e)}var t=r.prototype;return t.add=function(n,i,s){Ce(n)&&(s=i,i=n,n=Ce);var o=this,a=function(){var c=be,u=o.selector,f;return c&&c!==o&&c.data.push(o),s&&(o.selector=uc(s)),be=o,f=i.apply(o,arguments),Ce(f)&&o._r.push(f),be=c,o.selector=u,o.isReverted=!1,f};return o.last=a,n===Ce?a(o,function(l){return o.add(null,l)}):n?o[n]=a:a},t.ignore=function(n){var i=be;be=null,n(this),be=i},t.getTweens=function(){var n=[];return this.data.forEach(function(i){return i instanceof r?n.push.apply(n,i.getTweens()):i instanceof Ie&&!(i.parent&&i.parent.data==="nested")&&n.push(i)}),n},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(n,i){var s=this;if(n?function(){for(var a=s.getTweens(),l=s.data.length,c;l--;)c=s.data[l],c.data==="isFlip"&&(c.revert(),c.getChildren(!0,!0,!1).forEach(function(u){return a.splice(a.indexOf(u),1)}));for(a.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,f){return f.g-u.g||-1/0}).forEach(function(u){return u.t.revert(n)}),l=s.data.length;l--;)c=s.data[l],c instanceof Ze?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof Ie)&&c.revert&&c.revert(n);s._r.forEach(function(u){return u(n,s)}),s.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),i)for(var o=wr.length;o--;)wr[o].id===this.id&&wr.splice(o,1)},t.revert=function(n){this.kill(n||{})},r}(),n_=function(){function r(e){this.contexts=[],this.scope=e,be&&be.data.push(this)}var t=r.prototype;return t.add=function(n,i,s){fi(n)||(n={matches:n});var o=new Rf(0,s||this.scope),a=o.conditions={},l,c,u;be&&!o.selector&&(o.selector=be.selector),this.contexts.push(o),i=o.add("onMatch",i),o.queries=n;for(c in n)c==="all"?u=1:(l=ui.matchMedia(n[c]),l&&(wr.indexOf(o)<0&&wr.push(o),(a[c]=l.matches)&&(u=1),l.addListener?l.addListener(dc):l.addEventListener("change",dc)));return u&&i(o,function(f){return o.add(null,f)}),this},t.revert=function(n){this.kill(n||{})},t.kill=function(n){this.contexts.forEach(function(i){return i.kill(n,!0)})},r}(),aa={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach(function(i){return yf(i)})},timeline:function(t){return new Ze(t)},getTweensOf:function(t,e){return Te.getTweensOf(t,e)},getProperty:function(t,e,n,i){Be(t)&&(t=kn(t)[0]);var s=Zi(t||{}).get,o=n?af:of;return n==="native"&&(n=""),t&&(e?o((Mn[e]&&Mn[e].get||s)(t,e,n,i)):function(a,l,c){return o((Mn[a]&&Mn[a].get||s)(t,a,l,c))})},quickSetter:function(t,e,n){if(t=kn(t),t.length>1){var i=t.map(function(u){return nn.quickSetter(u,e,n)}),s=i.length;return function(u){for(var f=s;f--;)i[f](u)}}t=t[0]||{};var o=Mn[e],a=Zi(t),l=a.harness&&(a.harness.aliases||{})[e]||e,c=o?function(u){var f=new o;ls._pt=0,f.init(t,n?u+n:u,ls,0,[t]),f.render(1,f),ls._pt&&Rc(1,ls)}:a.set(t,l);return o?c:function(u){return c(t,l,n?u+n:u,a,1)}},quickTo:function(t,e,n){var i,s=nn.to(t,Er((i={},i[e]="+=0.1",i.paused=!0,i),n||{})),o=function(l,c,u){return s.resetTo(e,l,c,u)};return o.tween=s,o},isTweening:function(t){return Te.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=br(t.ease,cs.ease)),Wh(cs,t||{})},config:function(t){return Wh(En,t||{})},registerEffect:function(t){var e=t.name,n=t.effect,i=t.plugins,s=t.defaults,o=t.extendTimeline;(i||"").split(",").forEach(function(a){return a&&!Mn[a]&&!Pn[a]&&ho(e+" effect requires "+a+" plugin.")}),Kl[e]=function(a,l,c){return n(kn(a),Vn(l||{},s),c)},o&&(Ze.prototype[e]=function(a,l,c){return this.add(Kl[e](a,fi(l)?l:(c=l)&&{},this),c)})},registerEase:function(t,e){se[t]=br(e)},parseEase:function(t,e){return arguments.length?br(t,e):se},getById:function(t){return Te.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var n=new Ze(t),i,s;for(n.smoothChildTiming=wn(t.smoothChildTiming),Te.remove(n),n._dp=0,n._time=n._tTime=Te._time,i=Te._first;i;)s=i._next,(e||!(!i._dur&&i instanceof Ie&&i.vars.onComplete===i._targets[0]))&&hi(n,i,i._start-i._delay),i=s;return hi(Te,n,0),n},context:function(t,e){return t?new Rf(t,e):be},matchMedia:function(t){return new n_(t)},matchMediaRefresh:function(){return wr.forEach(function(t){var e=t.conditions,n,i;for(i in e)e[i]&&(e[i]=!1,n=1);n&&t.revert()})||dc()},addEventListener:function(t,e){var n=na[t]||(na[t]=[]);~n.indexOf(e)||n.push(e)},removeEventListener:function(t,e){var n=na[t],i=n&&n.indexOf(e);i>=0&&n.splice(i,1)},utils:{wrap:Fg,wrapYoyo:Ng,distribute:pf,random:gf,snap:mf,normalize:Lg,getUnit:Je,clamp:Cg,splitColor:Sf,toArray:kn,selector:uc,mapRange:xf,pipe:Pg,unitize:Ig,interpolate:Ug,shuffle:df},install:ef,effects:Kl,ticker:bn,updateRoot:Ze.updateRoot,plugins:Mn,globalTimeline:Te,core:{PropTween:fn,globals:nf,Tween:Ie,Timeline:Ze,Animation:mo,getCache:Zi,_removeLinkedListItem:ua,reverting:function(){return tn},context:function(t){return t&&be&&(be.data.push(t),t._ctx=be),be},suppressOverwrites:function(t){return pc=t}}};hn("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return aa[r]=Ie[r]});bn.add(Ze.updateRoot);ls=aa.to({},{duration:0});var i_=function(t,e){for(var n=t._pt;n&&n.p!==e&&n.op!==e&&n.fp!==e;)n=n._next;return n},r_=function(t,e){var n=t._targets,i,s,o;for(i in e)for(s=n.length;s--;)o=t._ptLookup[s][i],o&&(o=o.d)&&(o._pt&&(o=i_(o,i)),o&&o.modifier&&o.modifier(e[i],t,n[s],i))},nc=function(t,e){return{name:t,rawVars:1,init:function(i,s,o){o._onInit=function(a){var l,c;if(Be(s)&&(l={},hn(s,function(u){return l[u]=1}),s=l),e){l={};for(c in s)l[c]=e(s[c]);s=l}r_(a,s)}}}},nn=aa.registerPlugin({name:"attr",init:function(t,e,n,i,s){var o,a,l;this.tween=n;for(o in e)l=t.getAttribute(o)||"",a=this.add(t,"setAttribute",(l||0)+"",e[o],i,s,0,0,o),a.op=o,a.b=l,this._props.push(o)},render:function(t,e){for(var n=e._pt;n;)tn?n.set(n.t,n.p,n.b,n):n.r(t,n.d),n=n._next}},{name:"endArray",init:function(t,e){for(var n=e.length;n--;)this.add(t,n,t[n]||0,e[n],0,0,0,0,0,1)}},nc("roundProps",hc),nc("modifiers"),nc("snap",mf))||aa;Ie.version=Ze.version=nn.version="3.12.5";tf=1;mc()&&fs();var s_=se.Power0,o_=se.Power1,a_=se.Power2,l_=se.Power3,c_=se.Power4,u_=se.Linear,h_=se.Quad,f_=se.Cubic,d_=se.Quart,p_=se.Quint,m_=se.Strong,g_=se.Elastic,__=se.Back,x_=se.SteppedEase,v_=se.Bounce,y_=se.Sine,S_=se.Expo,M_=se.Circ;var Pf,Ki,ms,Bc,Ir,b_,If,zc,w_=function(){return typeof window<"u"},Ai={},Pr=180/Math.PI,gs=Math.PI/180,ps=Math.atan2,Lf=1e8,kc=/([A-Z])/g,E_=/(left|right|width|margin|padding|x)/i,T_=/[\s,\(]\S/,di={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Fc=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},A_=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},D_=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},C_=function(t,e){var n=e.s+e.c*t;e.set(e.t,e.p,~~(n+(n<0?-.5:.5))+e.u,e)},kf=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},Vf=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},R_=function(t,e,n){return t.style[e]=n},P_=function(t,e,n){return t.style.setProperty(e,n)},I_=function(t,e,n){return t._gsap[e]=n},L_=function(t,e,n){return t._gsap.scaleX=t._gsap.scaleY=n},F_=function(t,e,n,i,s){var o=t._gsap;o.scaleX=o.scaleY=n,o.renderTransform(s,o)},N_=function(t,e,n,i,s){var o=t._gsap;o[e]=n,o.renderTransform(s,o)},Ae="transform",Tn=Ae+"Origin",U_=function r(t,e){var n=this,i=this.target,s=i.style,o=i._gsap;if(t in Ai&&s){if(this.tfm=this.tfm||{},t!=="transform")t=di[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return n.tfm[a]=Ti(i,a)}):this.tfm[t]=o.x?o[t]:Ti(i,t),t===Tn&&(this.tfm.zOrigin=o.zOrigin);else return di.transform.split(",").forEach(function(a){return r.call(n,a,e)});if(this.props.indexOf(Ae)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Tn,e,"")),t=Ae}(s||e)&&this.props.push(t,e,s[t])},Hf=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},O_=function(){var t=this.props,e=this.target,n=e.style,i=e._gsap,s,o;for(s=0;s<t.length;s+=3)t[s+1]?e[t[s]]=t[s+2]:t[s+2]?n[t[s]]=t[s+2]:n.removeProperty(t[s].substr(0,2)==="--"?t[s]:t[s].replace(kc,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)i[o]=this.tfm[o];i.svg&&(i.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),s=zc(),(!s||!s.isStart)&&!n[Ae]&&(Hf(n),i.zOrigin&&n[Tn]&&(n[Tn]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},Gf=function(t,e){var n={target:t,props:[],revert:O_,save:U_};return t._gsap||nn.core.getCache(t),e&&e.split(",").forEach(function(i){return n.save(i)}),n},Wf,Nc=function(t,e){var n=Ki.createElementNS?Ki.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Ki.createElement(t);return n&&n.style?n:Ki.createElement(t)},pi=function r(t,e,n){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(kc,"-$1").toLowerCase())||i.getPropertyValue(e)||!n&&r(t,_s(e)||e,1)||""},Ff="O,Moz,ms,Ms,Webkit".split(","),_s=function(t,e,n){var i=e||Ir,s=i.style,o=5;if(t in s&&!n)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);o--&&!(Ff[o]+t in s););return o<0?null:(o===3?"ms":o>=0?Ff[o]:"")+t},Uc=function(){w_()&&window.document&&(Pf=window,Ki=Pf.document,ms=Ki.documentElement,Ir=Nc("div")||{style:{}},b_=Nc("div"),Ae=_s(Ae),Tn=Ae+"Origin",Ir.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Wf=!!_s("perspective"),zc=nn.core.reverting,Bc=1)},Ic=function r(t){var e=Nc("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,s=this.style.cssText,o;if(ms.appendChild(e),e.appendChild(this),this.style.display="block",t)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),ms.removeChild(e),this.style.cssText=s,o},Nf=function(t,e){for(var n=e.length;n--;)if(t.hasAttribute(e[n]))return t.getAttribute(e[n])},Xf=function(t){var e;try{e=t.getBBox()}catch{e=Ic.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===Ic||(e=Ic.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+Nf(t,["x","cx","x1"])||0,y:+Nf(t,["y","cy","y1"])||0,width:0,height:0}:e},qf=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&Xf(t))},Lr=function(t,e){if(e){var n=t.style,i;e in Ai&&e!==Tn&&(e=Ae),n.removeProperty?(i=e.substr(0,2),(i==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),n.removeProperty(i==="--"?e:e.replace(kc,"-$1").toLowerCase())):n.removeAttribute(e)}},ji=function(t,e,n,i,s,o){var a=new fn(t._pt,e,n,0,1,o?Vf:kf);return t._pt=a,a.b=i,a.e=s,t._props.push(n),a},Uf={deg:1,rad:1,turn:1},B_={grid:1,flex:1},Qi=function r(t,e,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",a=Ir.style,l=E_.test(e),c=t.tagName.toLowerCase()==="svg",u=(c?"client":"offset")+(l?"Width":"Height"),f=100,h=i==="px",d=i==="%",_,g,p,m;if(i===o||!s||Uf[i]||Uf[o])return s;if(o!=="px"&&!h&&(s=r(t,e,n,"px")),m=t.getCTM&&qf(t),(d||o==="%")&&(Ai[e]||~e.indexOf("adius")))return _=m?t.getBBox()[l?"width":"height"]:t[u],Re(d?s/_*f:s/100*_);if(a[l?"width":"height"]=f+(h?o:i),g=~e.indexOf("adius")||i==="em"&&t.appendChild&&!c?t:t.parentNode,m&&(g=(t.ownerSVGElement||{}).parentNode),(!g||g===Ki||!g.appendChild)&&(g=Ki.body),p=g._gsap,p&&d&&p.width&&l&&p.time===bn.time&&!p.uncache)return Re(s/p.width*f);if(d&&(e==="height"||e==="width")){var b=t.style[e];t.style[e]=f+i,_=t[u],b?t.style[e]=b:Lr(t,e)}else(d||o==="%")&&!B_[pi(g,"display")]&&(a.position=pi(t,"position")),g===t&&(a.position="static"),g.appendChild(Ir),_=Ir[u],g.removeChild(Ir),a.position="absolute";return l&&d&&(p=Zi(g),p.time=bn.time,p.width=g[u]),Re(h?_*s/f:_&&s?f/_*s:0)},Ti=function(t,e,n,i){var s;return Bc||Uc(),e in di&&e!=="transform"&&(e=di[e],~e.indexOf(",")&&(e=e.split(",")[0])),Ai[e]&&e!=="transform"?(s=vo(t,i),s=e!=="transformOrigin"?s[e]:s.svg?s.origin:ma(pi(t,Tn))+" "+s.zOrigin+"px"):(s=t.style[e],(!s||s==="auto"||i||~(s+"").indexOf("calc("))&&(s=pa[e]&&pa[e](t,e,n)||pi(t,e)||Mc(t,e)||(e==="opacity"?1:0))),n&&!~(s+"").trim().indexOf(" ")?Qi(t,e,s,n)+n:s},z_=function(t,e,n,i){if(!n||n==="none"){var s=_s(e,t,1),o=s&&pi(t,s,1);o&&o!==n?(e=s,n=o):e==="borderColor"&&(n=pi(t,"borderTopColor"))}var a=new fn(this._pt,t.style,e,0,1,Cc),l=0,c=0,u,f,h,d,_,g,p,m,b,S,y,D;if(a.b=n,a.e=i,n+="",i+="",i==="auto"&&(g=t.style[e],t.style[e]=i,i=pi(t,e)||i,g?t.style[e]=g:Lr(t,e)),u=[n,i],bc(u),n=u[0],i=u[1],h=n.match(Tr)||[],D=i.match(Tr)||[],D.length){for(;f=Tr.exec(i);)p=f[0],b=i.substring(l,f.index),_?_=(_+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(_=1),p!==(g=h[c++]||"")&&(d=parseFloat(g)||0,y=g.substr((d+"").length),p.charAt(1)==="="&&(p=Ar(d,p)+y),m=parseFloat(p),S=p.substr((m+"").length),l=Tr.lastIndex-S.length,S||(S=S||En.units[e]||y,l===i.length&&(i+=S,a.e+=S)),y!==S&&(d=Qi(t,e,g,S)||0),a._pt={_next:a._pt,p:b||c===1?b:",",s:d,c:m-d,m:_&&_<4||e==="zIndex"?Math.round:0});a.c=l<i.length?i.substring(l,i.length):""}else a.r=e==="display"&&i==="none"?Vf:kf;return _c.test(i)&&(a.e=0),this._pt=a,a},Of={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},k_=function(t){var e=t.split(" "),n=e[0],i=e[1]||"50%";return(n==="top"||n==="bottom"||i==="left"||i==="right")&&(t=n,n=i,i=t),e[0]=Of[n]||n,e[1]=Of[i]||i,e.join(" ")},V_=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var n=e.t,i=n.style,s=e.u,o=n._gsap,a,l,c;if(s==="all"||s===!0)i.cssText="",l=1;else for(s=s.split(","),c=s.length;--c>-1;)a=s[c],Ai[a]&&(l=1,a=a==="transformOrigin"?Tn:Ae),Lr(n,a);l&&(Lr(n,Ae),o&&(o.svg&&n.removeAttribute("transform"),vo(n,1),o.uncache=1,Hf(i)))}},pa={clearProps:function(t,e,n,i,s){if(s.data!=="isFromStart"){var o=t._pt=new fn(t._pt,e,n,0,0,V_);return o.u=i,o.pr=-10,o.tween=s,t._props.push(n),1}}},xo=[1,0,0,1,0,0],Yf={},Zf=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Bf=function(t){var e=pi(t,Ae);return Zf(e)?xo:e.substr(7).match(gc).map(Re)},Vc=function(t,e){var n=t._gsap||Zi(t),i=t.style,s=Bf(t),o,a,l,c;return n.svg&&t.getAttribute("transform")?(l=t.transform.baseVal.consolidate().matrix,s=[l.a,l.b,l.c,l.d,l.e,l.f],s.join(",")==="1,0,0,1,0,0"?xo:s):(s===xo&&!t.offsetParent&&t!==ms&&!n.svg&&(l=i.display,i.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(c=1,a=t.nextElementSibling,ms.appendChild(t)),s=Bf(t),l?i.display=l:Lr(t,"display"),c&&(a?o.insertBefore(t,a):o?o.appendChild(t):ms.removeChild(t))),e&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},Oc=function(t,e,n,i,s,o){var a=t._gsap,l=s||Vc(t,!0),c=a.xOrigin||0,u=a.yOrigin||0,f=a.xOffset||0,h=a.yOffset||0,d=l[0],_=l[1],g=l[2],p=l[3],m=l[4],b=l[5],S=e.split(" "),y=parseFloat(S[0])||0,D=parseFloat(S[1])||0,A,w,P,M;n?l!==xo&&(w=d*p-_*g)&&(P=y*(p/w)+D*(-g/w)+(g*b-p*m)/w,M=y*(-_/w)+D*(d/w)-(d*b-_*m)/w,y=P,D=M):(A=Xf(t),y=A.x+(~S[0].indexOf("%")?y/100*A.width:y),D=A.y+(~(S[1]||S[0]).indexOf("%")?D/100*A.height:D)),i||i!==!1&&a.smooth?(m=y-c,b=D-u,a.xOffset=f+(m*d+b*g)-m,a.yOffset=h+(m*_+b*p)-b):a.xOffset=a.yOffset=0,a.xOrigin=y,a.yOrigin=D,a.smooth=!!i,a.origin=e,a.originIsAbsolute=!!n,t.style[Tn]="0px 0px",o&&(ji(o,a,"xOrigin",c,y),ji(o,a,"yOrigin",u,D),ji(o,a,"xOffset",f,a.xOffset),ji(o,a,"yOffset",h,a.yOffset)),t.setAttribute("data-svg-origin",y+" "+D)},vo=function(t,e){var n=t._gsap||new wc(t);if("x"in n&&!e&&!n.uncache)return n;var i=t.style,s=n.scaleX<0,o="px",a="deg",l=getComputedStyle(t),c=pi(t,Tn)||"0",u,f,h,d,_,g,p,m,b,S,y,D,A,w,P,M,v,N,F,R,B,Y,H,J,O,L,C,ot,vt,Wt,q,tt;return u=f=h=g=p=m=b=S=y=0,d=_=1,n.svg=!!(t.getCTM&&qf(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[Ae]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Ae]!=="none"?l[Ae]:"")),i.scale=i.rotate=i.translate="none"),w=Vc(t,n.svg),n.svg&&(n.uncache?(O=t.getBBox(),c=n.xOrigin-O.x+"px "+(n.yOrigin-O.y)+"px",J=""):J=!e&&t.getAttribute("data-svg-origin"),Oc(t,J||c,!!J||n.originIsAbsolute,n.smooth!==!1,w)),D=n.xOrigin||0,A=n.yOrigin||0,w!==xo&&(N=w[0],F=w[1],R=w[2],B=w[3],u=Y=w[4],f=H=w[5],w.length===6?(d=Math.sqrt(N*N+F*F),_=Math.sqrt(B*B+R*R),g=N||F?ps(F,N)*Pr:0,b=R||B?ps(R,B)*Pr+g:0,b&&(_*=Math.abs(Math.cos(b*gs))),n.svg&&(u-=D-(D*N+A*R),f-=A-(D*F+A*B))):(tt=w[6],Wt=w[7],C=w[8],ot=w[9],vt=w[10],q=w[11],u=w[12],f=w[13],h=w[14],P=ps(tt,vt),p=P*Pr,P&&(M=Math.cos(-P),v=Math.sin(-P),J=Y*M+C*v,O=H*M+ot*v,L=tt*M+vt*v,C=Y*-v+C*M,ot=H*-v+ot*M,vt=tt*-v+vt*M,q=Wt*-v+q*M,Y=J,H=O,tt=L),P=ps(-R,vt),m=P*Pr,P&&(M=Math.cos(-P),v=Math.sin(-P),J=N*M-C*v,O=F*M-ot*v,L=R*M-vt*v,q=B*v+q*M,N=J,F=O,R=L),P=ps(F,N),g=P*Pr,P&&(M=Math.cos(P),v=Math.sin(P),J=N*M+F*v,O=Y*M+H*v,F=F*M-N*v,H=H*M-Y*v,N=J,Y=O),p&&Math.abs(p)+Math.abs(g)>359.9&&(p=g=0,m=180-m),d=Re(Math.sqrt(N*N+F*F+R*R)),_=Re(Math.sqrt(H*H+tt*tt)),P=ps(Y,H),b=Math.abs(P)>2e-4?P*Pr:0,y=q?1/(q<0?-q:q):0),n.svg&&(J=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!Zf(pi(t,Ae)),J&&t.setAttribute("transform",J))),Math.abs(b)>90&&Math.abs(b)<270&&(s?(d*=-1,b+=g<=0?180:-180,g+=g<=0?180:-180):(_*=-1,b+=b<=0?180:-180)),e=e||n.uncache,n.x=u-((n.xPercent=u&&(!e&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-u)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+o,n.y=f-((n.yPercent=f&&(!e&&n.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-f)?-50:0)))?t.offsetHeight*n.yPercent/100:0)+o,n.z=h+o,n.scaleX=Re(d),n.scaleY=Re(_),n.rotation=Re(g)+a,n.rotationX=Re(p)+a,n.rotationY=Re(m)+a,n.skewX=b+a,n.skewY=S+a,n.transformPerspective=y+o,(n.zOrigin=parseFloat(c.split(" ")[2])||!e&&n.zOrigin||0)&&(i[Tn]=ma(c)),n.xOffset=n.yOffset=0,n.force3D=En.force3D,n.renderTransform=n.svg?G_:Wf?Jf:H_,n.uncache=0,n},ma=function(t){return(t=t.split(" "))[0]+" "+t[1]},Lc=function(t,e,n){var i=Je(e);return Re(parseFloat(e)+parseFloat(Qi(t,"x",n+"px",i)))+i},H_=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Jf(t,e)},Cr="0deg",_o="0px",Rr=") ",Jf=function(t,e){var n=e||this,i=n.xPercent,s=n.yPercent,o=n.x,a=n.y,l=n.z,c=n.rotation,u=n.rotationY,f=n.rotationX,h=n.skewX,d=n.skewY,_=n.scaleX,g=n.scaleY,p=n.transformPerspective,m=n.force3D,b=n.target,S=n.zOrigin,y="",D=m==="auto"&&t&&t!==1||m===!0;if(S&&(f!==Cr||u!==Cr)){var A=parseFloat(u)*gs,w=Math.sin(A),P=Math.cos(A),M;A=parseFloat(f)*gs,M=Math.cos(A),o=Lc(b,o,w*M*-S),a=Lc(b,a,-Math.sin(A)*-S),l=Lc(b,l,P*M*-S+S)}p!==_o&&(y+="perspective("+p+Rr),(i||s)&&(y+="translate("+i+"%, "+s+"%) "),(D||o!==_o||a!==_o||l!==_o)&&(y+=l!==_o||D?"translate3d("+o+", "+a+", "+l+") ":"translate("+o+", "+a+Rr),c!==Cr&&(y+="rotate("+c+Rr),u!==Cr&&(y+="rotateY("+u+Rr),f!==Cr&&(y+="rotateX("+f+Rr),(h!==Cr||d!==Cr)&&(y+="skew("+h+", "+d+Rr),(_!==1||g!==1)&&(y+="scale("+_+", "+g+Rr),b.style[Ae]=y||"translate(0, 0)"},G_=function(t,e){var n=e||this,i=n.xPercent,s=n.yPercent,o=n.x,a=n.y,l=n.rotation,c=n.skewX,u=n.skewY,f=n.scaleX,h=n.scaleY,d=n.target,_=n.xOrigin,g=n.yOrigin,p=n.xOffset,m=n.yOffset,b=n.forceCSS,S=parseFloat(o),y=parseFloat(a),D,A,w,P,M;l=parseFloat(l),c=parseFloat(c),u=parseFloat(u),u&&(u=parseFloat(u),c+=u,l+=u),l||c?(l*=gs,c*=gs,D=Math.cos(l)*f,A=Math.sin(l)*f,w=Math.sin(l-c)*-h,P=Math.cos(l-c)*h,c&&(u*=gs,M=Math.tan(c-u),M=Math.sqrt(1+M*M),w*=M,P*=M,u&&(M=Math.tan(u),M=Math.sqrt(1+M*M),D*=M,A*=M)),D=Re(D),A=Re(A),w=Re(w),P=Re(P)):(D=f,P=h,A=w=0),(S&&!~(o+"").indexOf("px")||y&&!~(a+"").indexOf("px"))&&(S=Qi(d,"x",o,"px"),y=Qi(d,"y",a,"px")),(_||g||p||m)&&(S=Re(S+_-(_*D+g*w)+p),y=Re(y+g-(_*A+g*P)+m)),(i||s)&&(M=d.getBBox(),S=Re(S+i/100*M.width),y=Re(y+s/100*M.height)),M="matrix("+D+","+A+","+w+","+P+","+S+","+y+")",d.setAttribute("transform",M),b&&(d.style[Ae]=M)},W_=function(t,e,n,i,s){var o=360,a=Be(s),l=parseFloat(s)*(a&&~s.indexOf("rad")?Pr:1),c=l-i,u=i+c+"deg",f,h;return a&&(f=s.split("_")[1],f==="short"&&(c%=o,c!==c%(o/2)&&(c+=c<0?o:-o)),f==="cw"&&c<0?c=(c+o*Lf)%o-~~(c/o)*o:f==="ccw"&&c>0&&(c=(c-o*Lf)%o-~~(c/o)*o)),t._pt=h=new fn(t._pt,e,n,i,c,A_),h.e=u,h.u="deg",t._props.push(n),h},zf=function(t,e){for(var n in e)t[n]=e[n];return t},X_=function(t,e,n){var i=zf({},n._gsap),s="perspective,force3D,transformOrigin,svgOrigin",o=n.style,a,l,c,u,f,h,d,_;i.svg?(c=n.getAttribute("transform"),n.setAttribute("transform",""),o[Ae]=e,a=vo(n,1),Lr(n,Ae),n.setAttribute("transform",c)):(c=getComputedStyle(n)[Ae],o[Ae]=e,a=vo(n,1),o[Ae]=c);for(l in Ai)c=i[l],u=a[l],c!==u&&s.indexOf(l)<0&&(d=Je(c),_=Je(u),f=d!==_?Qi(n,l,c,_):parseFloat(c),h=parseFloat(u),t._pt=new fn(t._pt,a,l,f,h-f,Fc),t._pt.u=_||0,t._props.push(l));zf(a,i)};hn("padding,margin,Width,Radius",function(r,t){var e="Top",n="Right",i="Bottom",s="Left",o=(t<3?[e,n,i,s]:[e+s,e+n,i+n,i+s]).map(function(a){return t<2?r+a:"border"+a+r});pa[t>1?"border"+r:r]=function(a,l,c,u,f){var h,d;if(arguments.length<4)return h=o.map(function(_){return Ti(a,_,c)}),d=h.join(" "),d.split(h[0]).length===5?h[0]:d;h=(u+"").split(" "),d={},o.forEach(function(_,g){return d[_]=h[g]=h[g]||h[(g-1)/2|0]}),a.init(l,d,f)}});var Hc={name:"css",register:Uc,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,n,i,s){var o=this._props,a=t.style,l=n.vars.startAt,c,u,f,h,d,_,g,p,m,b,S,y,D,A,w,P;Bc||Uc(),this.styles=this.styles||Gf(t),P=this.styles.props,this.tween=n;for(g in e)if(g!=="autoRound"&&(u=e[g],!(Mn[g]&&Tc(g,e,n,i,t,s)))){if(d=typeof u,_=pa[g],d==="function"&&(u=u.call(n,i,t,s),d=typeof u),d==="string"&&~u.indexOf("random(")&&(u=ds(u)),_)_(this,t,g,u,n)&&(w=1);else if(g.substr(0,2)==="--")c=(getComputedStyle(t).getPropertyValue(g)+"").trim(),u+="",wi.lastIndex=0,wi.test(c)||(p=Je(c),m=Je(u)),m?p!==m&&(c=Qi(t,g,c,m)+m):p&&(u+=p),this.add(a,"setProperty",c,u,i,s,0,0,g),o.push(g),P.push(g,0,a[g]);else if(d!=="undefined"){if(l&&g in l?(c=typeof l[g]=="function"?l[g].call(n,i,t,s):l[g],Be(c)&&~c.indexOf("random(")&&(c=ds(c)),Je(c+"")||c==="auto"||(c+=En.units[g]||Je(Ti(t,g))||""),(c+"").charAt(1)==="="&&(c=Ti(t,g))):c=Ti(t,g),h=parseFloat(c),b=d==="string"&&u.charAt(1)==="="&&u.substr(0,2),b&&(u=u.substr(2)),f=parseFloat(u),g in di&&(g==="autoAlpha"&&(h===1&&Ti(t,"visibility")==="hidden"&&f&&(h=0),P.push("visibility",0,a.visibility),ji(this,a,"visibility",h?"inherit":"hidden",f?"inherit":"hidden",!f)),g!=="scale"&&g!=="transform"&&(g=di[g],~g.indexOf(",")&&(g=g.split(",")[0]))),S=g in Ai,S){if(this.styles.save(g),y||(D=t._gsap,D.renderTransform&&!e.parseTransform||vo(t,e.parseTransform),A=e.smoothOrigin!==!1&&D.smooth,y=this._pt=new fn(this._pt,a,Ae,0,1,D.renderTransform,D,0,-1),y.dep=1),g==="scale")this._pt=new fn(this._pt,D,"scaleY",D.scaleY,(b?Ar(D.scaleY,b+f):f)-D.scaleY||0,Fc),this._pt.u=0,o.push("scaleY",g),g+="X";else if(g==="transformOrigin"){P.push(Tn,0,a[Tn]),u=k_(u),D.svg?Oc(t,u,0,A,0,this):(m=parseFloat(u.split(" ")[2])||0,m!==D.zOrigin&&ji(this,D,"zOrigin",D.zOrigin,m),ji(this,a,g,ma(c),ma(u)));continue}else if(g==="svgOrigin"){Oc(t,u,1,A,0,this);continue}else if(g in Yf){W_(this,D,g,h,b?Ar(h,b+u):u);continue}else if(g==="smoothOrigin"){ji(this,D,"smooth",D.smooth,u);continue}else if(g==="force3D"){D[g]=u;continue}else if(g==="transform"){X_(this,u,t);continue}}else g in a||(g=_s(g)||g);if(S||(f||f===0)&&(h||h===0)&&!T_.test(u)&&g in a)p=(c+"").substr((h+"").length),f||(f=0),m=Je(u)||(g in En.units?En.units[g]:p),p!==m&&(h=Qi(t,g,c,m)),this._pt=new fn(this._pt,S?D:a,g,h,(b?Ar(h,b+f):f)-h,!S&&(m==="px"||g==="zIndex")&&e.autoRound!==!1?C_:Fc),this._pt.u=m||0,p!==m&&m!=="%"&&(this._pt.b=c,this._pt.r=D_);else if(g in a)z_.call(this,t,g,c,b?b+u:u);else if(g in t)this.add(t,g,c||t[g],b?b+u:u,i,s);else if(g!=="parseTransform"){ca(g,u);continue}S||(g in a?P.push(g,0,a[g]):P.push(g,1,c||t[g])),o.push(g)}}w&&Pc(this)},render:function(t,e){if(e.tween._time||!zc())for(var n=e._pt;n;)n.r(t,n.d),n=n._next;else e.styles.revert()},get:Ti,aliases:di,getSetter:function(t,e,n){var i=di[e];return i&&i.indexOf(",")<0&&(e=i),e in Ai&&e!==Tn&&(t._gsap.x||Ti(t,"x"))?n&&If===n?e==="scale"?L_:I_:(If=n||{})&&(e==="scale"?F_:N_):t.style&&!la(t.style[e])?R_:~e.indexOf("-")?P_:da(t,e)},core:{_removeProperty:Lr,_getMatrix:Vc}};nn.utils.checkPrefix=_s;nn.core.getStyleSaver=Gf;(function(r,t,e,n){var i=hn(r+","+t+","+e,function(s){Ai[s]=1});hn(t,function(s){En.units[s]="deg",Yf[s]=1}),di[i[13]]=r+","+t,hn(n,function(s){var o=s.split(":");di[o[1]]=i[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");hn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){En.units[r]="px"});nn.registerPlugin(Hc);var lt=nn.registerPlugin(Hc)||nn,a1=lt.core.Tween;function $f(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function q_(r,t,e){return t&&$f(r.prototype,t),e&&$f(r,e),r}var $e,xa,Y_,In,tr,er,vs,jf,Fr,So,Qf,Di,jn,td,ed=function(){return $e||typeof window<"u"&&($e=window.gsap)&&$e.registerPlugin&&$e},nd=1,xs=[],ne=[],Qn=[],Mo=Date.now,Gc=function(t,e){return e},Z_=function(){var t=So.core,e=t.bridge||{},n=t._scrollers,i=t._proxies;n.push.apply(n,ne),i.push.apply(i,Qn),ne=n,Qn=i,Gc=function(o,a){return e[o](a)}},Ri=function(t,e){return~Qn.indexOf(t)&&Qn[Qn.indexOf(t)+1][e]},bo=function(t){return!!~Qf.indexOf(t)},pn=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:i!==!1,capture:!!s})},dn=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},ga="scrollLeft",_a="scrollTop",Wc=function(){return Di&&Di.isPressed||ne.cache++},va=function(t,e){var n=function i(s){if(s||s===0){nd&&(In.history.scrollRestoration="manual");var o=Di&&Di.isPressed;s=i.v=Math.round(s)||(Di&&Di.iOS?1:0),t(s),i.cacheID=ne.cache,o&&Gc("ss",s)}else(e||ne.cache!==i.cacheID||Gc("ref"))&&(i.cacheID=ne.cache,i.v=t());return i.v+i.offset};return n.offset=0,t&&n},rn={s:ga,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:va(function(r){return arguments.length?In.scrollTo(r,Ne.sc()):In.pageXOffset||tr[ga]||er[ga]||vs[ga]||0})},Ne={s:_a,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:rn,sc:va(function(r){return arguments.length?In.scrollTo(rn.sc(),r):In.pageYOffset||tr[_a]||er[_a]||vs[_a]||0})},mn=function(t,e){return(e&&e._ctx&&e._ctx.selector||$e.utils.toArray)(t)[0]||(typeof t=="string"&&$e.config().nullTargetWarn!==!1?console.warn("Element not found:",t):null)},Ci=function(t,e){var n=e.s,i=e.sc;bo(t)&&(t=tr.scrollingElement||er);var s=ne.indexOf(t),o=i===Ne.sc?1:2;!~s&&(s=ne.push(t)-1),ne[s+o]||pn(t,"scroll",Wc);var a=ne[s+o],l=a||(ne[s+o]=va(Ri(t,n),!0)||(bo(t)?i:va(function(c){return arguments.length?t[n]=c:t[n]})));return l.target=t,a||(l.smooth=$e.getProperty(t,"scrollBehavior")==="smooth"),l},ya=function(t,e,n){var i=t,s=t,o=Mo(),a=o,l=e||50,c=Math.max(500,l*3),u=function(_,g){var p=Mo();g||p-o>l?(s=i,i=_,a=o,o=p):n?i+=_:i=s+(_-s)/(p-a)*(o-a)},f=function(){s=i=n?0:i,a=o=0},h=function(_){var g=a,p=s,m=Mo();return(_||_===0)&&_!==i&&u(_),o===a||m-a>c?0:(i+(n?p:-p))/((n?m:o)-g)*1e3};return{update:u,reset:f,getVelocity:h}},yo=function(t,e){return e&&!t._gsapAllow&&t.preventDefault(),t.changedTouches?t.changedTouches[0]:t},Kf=function(t){var e=Math.max.apply(Math,t),n=Math.min.apply(Math,t);return Math.abs(e)>=Math.abs(n)?e:n},id=function(){So=$e.core.globals().ScrollTrigger,So&&So.core&&Z_()},rd=function(t){return $e=t||ed(),!xa&&$e&&typeof document<"u"&&document.body&&(In=window,tr=document,er=tr.documentElement,vs=tr.body,Qf=[In,tr,er,vs],Y_=$e.utils.clamp,td=$e.core.context||function(){},Fr="onpointerenter"in vs?"pointer":"mouse",jf=Pe.isTouch=In.matchMedia&&In.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in In||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,jn=Pe.eventTypes=("ontouchstart"in er?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in er?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return nd=0},500),id(),xa=1),xa};rn.op=Ne;ne.cache=0;var Pe=function(){function r(e){this.init(e)}var t=r.prototype;return t.init=function(n){xa||rd($e)||console.warn("Please gsap.registerPlugin(Observer)"),So||id();var i=n.tolerance,s=n.dragMinimum,o=n.type,a=n.target,l=n.lineHeight,c=n.debounce,u=n.preventDefault,f=n.onStop,h=n.onStopDelay,d=n.ignore,_=n.wheelSpeed,g=n.event,p=n.onDragStart,m=n.onDragEnd,b=n.onDrag,S=n.onPress,y=n.onRelease,D=n.onRight,A=n.onLeft,w=n.onUp,P=n.onDown,M=n.onChangeX,v=n.onChangeY,N=n.onChange,F=n.onToggleX,R=n.onToggleY,B=n.onHover,Y=n.onHoverEnd,H=n.onMove,J=n.ignoreCheck,O=n.isNormalizer,L=n.onGestureStart,C=n.onGestureEnd,ot=n.onWheel,vt=n.onEnable,Wt=n.onDisable,q=n.onClick,tt=n.scrollSpeed,pt=n.capture,st=n.allowClicks,Ft=n.lockAxis,Nt=n.onLockAxis;this.target=a=mn(a)||er,this.vars=n,d&&(d=$e.utils.toArray(d)),i=i||1e-9,s=s||0,_=_||1,tt=tt||1,o=o||"wheel,touch,pointer",c=c!==!1,l||(l=parseFloat(In.getComputedStyle(vs).lineHeight)||22);var V,Yt,Et,Tt,St,zt,Ut,k=this,Qt=0,T=0,x=n.passive||!u,I=Ci(a,rn),G=Ci(a,Ne),K=I(),Q=G(),ht=~o.indexOf("touch")&&!~o.indexOf("pointer")&&jn[0]==="pointerdown",ct=bo(a),nt=a.ownerDocument||tr,bt=[0,0,0],rt=[0,0,0],ft=0,Ot=function(){return ft=Mo()},it=function(Mt,le){return(k.event=Mt)&&d&&~d.indexOf(Mt.target)||le&&ht&&Mt.pointerType!=="touch"||J&&J(Mt,le)},yt=function(){k._vx.reset(),k._vy.reset(),Yt.pause(),f&&f(k)},Bt=function(){var Mt=k.deltaX=Kf(bt),le=k.deltaY=Kf(rt),mt=Math.abs(Mt)>=i,qt=Math.abs(le)>=i;N&&(mt||qt)&&N(k,Mt,le,bt,rt),mt&&(D&&k.deltaX>0&&D(k),A&&k.deltaX<0&&A(k),M&&M(k),F&&k.deltaX<0!=Qt<0&&F(k),Qt=k.deltaX,bt[0]=bt[1]=bt[2]=0),qt&&(P&&k.deltaY>0&&P(k),w&&k.deltaY<0&&w(k),v&&v(k),R&&k.deltaY<0!=T<0&&R(k),T=k.deltaY,rt[0]=rt[1]=rt[2]=0),(Tt||Et)&&(H&&H(k),Et&&(b(k),Et=!1),Tt=!1),zt&&!(zt=!1)&&Nt&&Nt(k),St&&(ot(k),St=!1),V=0},Vt=function(Mt,le,mt){bt[mt]+=Mt,rt[mt]+=le,k._vx.update(Mt),k._vy.update(le),c?V||(V=requestAnimationFrame(Bt)):Bt()},he=function(Mt,le){Ft&&!Ut&&(k.axis=Ut=Math.abs(Mt)>Math.abs(le)?"x":"y",zt=!0),Ut!=="y"&&(bt[2]+=Mt,k._vx.update(Mt,!0)),Ut!=="x"&&(rt[2]+=le,k._vy.update(le,!0)),c?V||(V=requestAnimationFrame(Bt)):Bt()},kt=function(Mt){if(!it(Mt,1)){Mt=yo(Mt,u);var le=Mt.clientX,mt=Mt.clientY,qt=le-k.x,It=mt-k.y,Xt=k.isDragging;k.x=le,k.y=mt,(Xt||Math.abs(k.startX-le)>=s||Math.abs(k.startY-mt)>=s)&&(b&&(Et=!0),Xt||(k.isDragging=!0),he(qt,It),Xt||p&&p(k))}},U=k.onPress=function(Ct){it(Ct,1)||Ct&&Ct.button||(k.axis=Ut=null,Yt.pause(),k.isPressed=!0,Ct=yo(Ct),Qt=T=0,k.startX=k.x=Ct.clientX,k.startY=k.y=Ct.clientY,k._vx.reset(),k._vy.reset(),pn(O?a:nt,jn[1],kt,x,!0),k.deltaX=k.deltaY=0,S&&S(k))},$=k.onRelease=function(Ct){if(!it(Ct,1)){dn(O?a:nt,jn[1],kt,!0);var Mt=!isNaN(k.y-k.startY),le=k.isDragging,mt=le&&(Math.abs(k.x-k.startX)>3||Math.abs(k.y-k.startY)>3),qt=yo(Ct);!mt&&Mt&&(k._vx.reset(),k._vy.reset(),u&&st&&$e.delayedCall(.08,function(){if(Mo()-ft>300&&!Ct.defaultPrevented){if(Ct.target.click)Ct.target.click();else if(nt.createEvent){var It=nt.createEvent("MouseEvents");It.initMouseEvent("click",!0,!0,In,1,qt.screenX,qt.screenY,qt.clientX,qt.clientY,!1,!1,!1,!1,0,null),Ct.target.dispatchEvent(It)}}})),k.isDragging=k.isGesturing=k.isPressed=!1,f&&le&&!O&&Yt.restart(!0),m&&le&&m(k),y&&y(k,mt)}},et=function(Mt){return Mt.touches&&Mt.touches.length>1&&(k.isGesturing=!0)&&L(Mt,k.isDragging)},ut=function(){return(k.isGesturing=!1)||C(k)},at=function(Mt){if(!it(Mt)){var le=I(),mt=G();Vt((le-K)*tt,(mt-Q)*tt,1),K=le,Q=mt,f&&Yt.restart(!0)}},Dt=function(Mt){if(!it(Mt)){Mt=yo(Mt,u),ot&&(St=!0);var le=(Mt.deltaMode===1?l:Mt.deltaMode===2?In.innerHeight:1)*_;Vt(Mt.deltaX*le,Mt.deltaY*le,0),f&&!O&&Yt.restart(!0)}},te=function(Mt){if(!it(Mt)){var le=Mt.clientX,mt=Mt.clientY,qt=le-k.x,It=mt-k.y;k.x=le,k.y=mt,Tt=!0,f&&Yt.restart(!0),(qt||It)&&he(qt,It)}},ae=function(Mt){k.event=Mt,B(k)},re=function(Mt){k.event=Mt,Y(k)},Zt=function(Mt){return it(Mt)||yo(Mt,u)&&q(k)};Yt=k._dc=$e.delayedCall(h||.25,yt).pause(),k.deltaX=k.deltaY=0,k._vx=ya(0,50,!0),k._vy=ya(0,50,!0),k.scrollX=I,k.scrollY=G,k.isDragging=k.isGesturing=k.isPressed=!1,td(this),k.enable=function(Ct){return k.isEnabled||(pn(ct?nt:a,"scroll",Wc),o.indexOf("scroll")>=0&&pn(ct?nt:a,"scroll",at,x,pt),o.indexOf("wheel")>=0&&pn(a,"wheel",Dt,x,pt),(o.indexOf("touch")>=0&&jf||o.indexOf("pointer")>=0)&&(pn(a,jn[0],U,x,pt),pn(nt,jn[2],$),pn(nt,jn[3],$),st&&pn(a,"click",Ot,!0,!0),q&&pn(a,"click",Zt),L&&pn(nt,"gesturestart",et),C&&pn(nt,"gestureend",ut),B&&pn(a,Fr+"enter",ae),Y&&pn(a,Fr+"leave",re),H&&pn(a,Fr+"move",te)),k.isEnabled=!0,Ct&&Ct.type&&U(Ct),vt&&vt(k)),k},k.disable=function(){k.isEnabled&&(xs.filter(function(Ct){return Ct!==k&&bo(Ct.target)}).length||dn(ct?nt:a,"scroll",Wc),k.isPressed&&(k._vx.reset(),k._vy.reset(),dn(O?a:nt,jn[1],kt,!0)),dn(ct?nt:a,"scroll",at,pt),dn(a,"wheel",Dt,pt),dn(a,jn[0],U,pt),dn(nt,jn[2],$),dn(nt,jn[3],$),dn(a,"click",Ot,!0),dn(a,"click",Zt),dn(nt,"gesturestart",et),dn(nt,"gestureend",ut),dn(a,Fr+"enter",ae),dn(a,Fr+"leave",re),dn(a,Fr+"move",te),k.isEnabled=k.isPressed=k.isDragging=!1,Wt&&Wt(k))},k.kill=k.revert=function(){k.disable();var Ct=xs.indexOf(k);Ct>=0&&xs.splice(Ct,1),Di===k&&(Di=0)},xs.push(k),O&&bo(a)&&(Di=k),k.enable(g)},q_(r,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),r}();Pe.version="3.12.5";Pe.create=function(r){return new Pe(r)};Pe.register=rd;Pe.getAll=function(){return xs.slice()};Pe.getById=function(r){return xs.filter(function(t){return t.vars.id===r})[0]};ed()&&$e.registerPlugin(Pe);var wt,Ms,oe,De,ti,ve,Md,Ua,Uo,Ro,Eo,Sa,sn,ka,jc,_n,sd,od,bs,bd,Xc,wd,gn,Qc,Ed,Td,nr,tu,su,ws,ou,Oa,eu,qc,Ma=1,on=Date.now,Yc=on(),Wn=0,To=0,ad=function(t,e,n){var i=Fn(t)&&(t.substr(0,6)==="clamp("||t.indexOf("max")>-1);return n["_"+e+"Clamp"]=i,i?t.substr(6,t.length-7):t},ld=function(t,e){return e&&(!Fn(t)||t.substr(0,6)!=="clamp(")?"clamp("+t+")":t},J_=function r(){return To&&requestAnimationFrame(r)},cd=function(){return ka=1},ud=function(){return ka=0},mi=function(t){return t},Ao=function(t){return Math.round(t*1e5)/1e5||0},Ad=function(){return typeof window<"u"},Dd=function(){return wt||Ad()&&(wt=window.gsap)&&wt.registerPlugin&&wt},kr=function(t){return!!~Md.indexOf(t)},Cd=function(t){return(t==="Height"?ou:oe["inner"+t])||ti["client"+t]||ve["client"+t]},Rd=function(t){return Ri(t,"getBoundingClientRect")||(kr(t)?function(){return Na.width=oe.innerWidth,Na.height=ou,Na}:function(){return Pi(t)})},$_=function(t,e,n){var i=n.d,s=n.d2,o=n.a;return(o=Ri(t,"getBoundingClientRect"))?function(){return o()[i]}:function(){return(e?Cd(s):t["client"+s])||0}},K_=function(t,e){return!e||~Qn.indexOf(t)?Rd(t):function(){return Na}},gi=function(t,e){var n=e.s,i=e.d2,s=e.d,o=e.a;return Math.max(0,(n="scroll"+i)&&(o=Ri(t,n))?o()-Rd(t)()[s]:kr(t)?(ti[n]||ve[n])-Cd(i):t[n]-t["offset"+i])},ba=function(t,e){for(var n=0;n<bs.length;n+=3)(!e||~e.indexOf(bs[n+1]))&&t(bs[n],bs[n+1],bs[n+2])},Fn=function(t){return typeof t=="string"},vn=function(t){return typeof t=="function"},Do=function(t){return typeof t=="number"},Nr=function(t){return typeof t=="object"},wo=function(t,e,n){return t&&t.progress(e?0:1)&&n&&t.pause()},Zc=function(t,e){if(t.enabled){var n=t._ctx?t._ctx.add(function(){return e(t)}):e(t);n&&n.totalTime&&(t.callbackAnimation=n)}},ys=Math.abs,Pd="left",Id="top",au="right",lu="bottom",Or="width",Br="height",Po="Right",Io="Left",Lo="Top",Fo="Bottom",Ue="padding",Hn="margin",Ts="Width",cu="Height",ze="px",Gn=function(t){return oe.getComputedStyle(t)},j_=function(t){var e=Gn(t).position;t.style.position=e==="absolute"||e==="fixed"?e:"relative"},hd=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Pi=function(t,e){var n=e&&Gn(t)[jc]!=="matrix(1, 0, 0, 1, 0, 0)"&&wt.to(t,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),i=t.getBoundingClientRect();return n&&n.progress(0).kill(),i},Ba=function(t,e){var n=e.d2;return t["offset"+n]||t["client"+n]||0},Ld=function(t){var e=[],n=t.labels,i=t.duration(),s;for(s in n)e.push(n[s]/i);return e},Q_=function(t){return function(e){return wt.utils.snap(Ld(t),e)}},uu=function(t){var e=wt.utils.snap(t),n=Array.isArray(t)&&t.slice(0).sort(function(i,s){return i-s});return n?function(i,s,o){o===void 0&&(o=.001);var a;if(!s)return e(i);if(s>0){for(i-=o,a=0;a<n.length;a++)if(n[a]>=i)return n[a];return n[a-1]}else for(a=n.length,i+=o;a--;)if(n[a]<=i)return n[a];return n[0]}:function(i,s,o){o===void 0&&(o=.001);var a=e(i);return!s||Math.abs(a-i)<o||a-i<0==s<0?a:e(s<0?i-t:i+t)}},t0=function(t){return function(e,n){return uu(Ld(t))(e,n.direction)}},wa=function(t,e,n,i){return n.split(",").forEach(function(s){return t(e,s,i)})},Xe=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:!i,capture:!!s})},We=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},Ea=function(t,e,n){n=n&&n.wheelHandler,n&&(t(e,"wheel",n),t(e,"touchmove",n))},fd={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},Ta={toggleActions:"play",anticipatePin:0},za={top:0,left:0,center:.5,bottom:1,right:1},Pa=function(t,e){if(Fn(t)){var n=t.indexOf("="),i=~n?+(t.charAt(n-1)+1)*parseFloat(t.substr(n+1)):0;~n&&(t.indexOf("%")>n&&(i*=e/100),t=t.substr(0,n-1)),t=i+(t in za?za[t]*e:~t.indexOf("%")?parseFloat(t)*e/100:parseFloat(t)||0)}return t},Aa=function(t,e,n,i,s,o,a,l){var c=s.startColor,u=s.endColor,f=s.fontSize,h=s.indent,d=s.fontWeight,_=De.createElement("div"),g=kr(n)||Ri(n,"pinType")==="fixed",p=t.indexOf("scroller")!==-1,m=g?ve:n,b=t.indexOf("start")!==-1,S=b?c:u,y="border-color:"+S+";font-size:"+f+";color:"+S+";font-weight:"+d+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return y+="position:"+((p||l)&&g?"fixed;":"absolute;"),(p||l||!g)&&(y+=(i===Ne?au:lu)+":"+(o+parseFloat(h))+"px;"),a&&(y+="box-sizing:border-box;text-align:left;width:"+a.offsetWidth+"px;"),_._isStart=b,_.setAttribute("class","gsap-marker-"+t+(e?" marker-"+e:"")),_.style.cssText=y,_.innerText=e||e===0?t+"-"+e:t,m.children[0]?m.insertBefore(_,m.children[0]):m.appendChild(_),_._offset=_["offset"+i.op.d2],Ia(_,0,i,b),_},Ia=function(t,e,n,i){var s={display:"block"},o=n[i?"os2":"p2"],a=n[i?"p2":"os2"];t._isFlipped=i,s[n.a+"Percent"]=i?-100:0,s[n.a]=i?"1px":0,s["border"+o+Ts]=1,s["border"+a+Ts]=0,s[n.p]=e+"px",wt.set(t,s)},ie=[],nu={},Oo,dd=function(){return on()-Wn>34&&(Oo||(Oo=requestAnimationFrame(Ii)))},Ss=function(){(!gn||!gn.isPressed||gn.startX>ve.clientWidth)&&(ne.cache++,gn?Oo||(Oo=requestAnimationFrame(Ii)):Ii(),Wn||Hr("scrollStart"),Wn=on())},Jc=function(){Td=oe.innerWidth,Ed=oe.innerHeight},Co=function(){ne.cache++,!sn&&!wd&&!De.fullscreenElement&&!De.webkitFullscreenElement&&(!Qc||Td!==oe.innerWidth||Math.abs(oe.innerHeight-Ed)>oe.innerHeight*.25)&&Ua.restart(!0)},Vr={},e0=[],Fd=function r(){return We(Pt,"scrollEnd",r)||Ur(!0)},Hr=function(t){return Vr[t]&&Vr[t].map(function(e){return e()})||e0},Ln=[],Nd=function(t){for(var e=0;e<Ln.length;e+=5)(!t||Ln[e+4]&&Ln[e+4].query===t)&&(Ln[e].style.cssText=Ln[e+1],Ln[e].getBBox&&Ln[e].setAttribute("transform",Ln[e+2]||""),Ln[e+3].uncache=1)},hu=function(t,e){var n;for(_n=0;_n<ie.length;_n++)n=ie[_n],n&&(!e||n._ctx===e)&&(t?n.kill(1):n.revert(!0,!0));Oa=!0,e&&Nd(e),e||Hr("revert")},Ud=function(t,e){ne.cache++,(e||!xn)&&ne.forEach(function(n){return vn(n)&&n.cacheID++&&(n.rec=0)}),Fn(t)&&(oe.history.scrollRestoration=su=t)},xn,zr=0,pd,n0=function(){if(pd!==zr){var t=pd=zr;requestAnimationFrame(function(){return t===zr&&Ur(!0)})}},Od=function(){ve.appendChild(ws),ou=!gn&&ws.offsetHeight||oe.innerHeight,ve.removeChild(ws)},md=function(t){return Uo(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach(function(e){return e.style.display=t?"none":"block"})},Ur=function(t,e){if(Wn&&!t&&!Oa){Xe(Pt,"scrollEnd",Fd);return}Od(),xn=Pt.isRefreshing=!0,ne.forEach(function(i){return vn(i)&&++i.cacheID&&(i.rec=i())});var n=Hr("refreshInit");bd&&Pt.sort(),e||hu(),ne.forEach(function(i){vn(i)&&(i.smooth&&(i.target.style.scrollBehavior="auto"),i(0))}),ie.slice(0).forEach(function(i){return i.refresh()}),Oa=!1,ie.forEach(function(i){if(i._subPinOffset&&i.pin){var s=i.vars.horizontal?"offsetWidth":"offsetHeight",o=i.pin[s];i.revert(!0,1),i.adjustPinSpacing(i.pin[s]-o),i.refresh()}}),eu=1,md(!0),ie.forEach(function(i){var s=gi(i.scroller,i._dir),o=i.vars.end==="max"||i._endClamp&&i.end>s,a=i._startClamp&&i.start>=s;(o||a)&&i.setPositions(a?s-1:i.start,o?Math.max(a?s:i.start+1,s):i.end,!0)}),md(!1),eu=0,n.forEach(function(i){return i&&i.render&&i.render(-1)}),ne.forEach(function(i){vn(i)&&(i.smooth&&requestAnimationFrame(function(){return i.target.style.scrollBehavior="smooth"}),i.rec&&i(i.rec))}),Ud(su,1),Ua.pause(),zr++,xn=2,Ii(2),ie.forEach(function(i){return vn(i.vars.onRefresh)&&i.vars.onRefresh(i)}),xn=Pt.isRefreshing=!1,Hr("refresh")},iu=0,La=1,No,Ii=function(t){if(t===2||!xn&&!Oa){Pt.isUpdating=!0,No&&No.update(0);var e=ie.length,n=on(),i=n-Yc>=50,s=e&&ie[0].scroll();if(La=iu>s?-1:1,xn||(iu=s),i&&(Wn&&!ka&&n-Wn>200&&(Wn=0,Hr("scrollEnd")),Eo=Yc,Yc=n),La<0){for(_n=e;_n-- >0;)ie[_n]&&ie[_n].update(0,i);La=1}else for(_n=0;_n<e;_n++)ie[_n]&&ie[_n].update(0,i);Pt.isUpdating=!1}Oo=0},ru=[Pd,Id,lu,au,Hn+Fo,Hn+Po,Hn+Lo,Hn+Io,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],Fa=ru.concat([Or,Br,"boxSizing","max"+Ts,"max"+cu,"position",Hn,Ue,Ue+Lo,Ue+Po,Ue+Fo,Ue+Io]),i0=function(t,e,n){Es(n);var i=t._gsap;if(i.spacerIsNative)Es(i.spacerState);else if(t._gsap.swappedIn){var s=e.parentNode;s&&(s.insertBefore(t,e),s.removeChild(e))}t._gsap.swappedIn=!1},$c=function(t,e,n,i){if(!t._gsap.swappedIn){for(var s=ru.length,o=e.style,a=t.style,l;s--;)l=ru[s],o[l]=n[l];o.position=n.position==="absolute"?"absolute":"relative",n.display==="inline"&&(o.display="inline-block"),a[lu]=a[au]="auto",o.flexBasis=n.flexBasis||"auto",o.overflow="visible",o.boxSizing="border-box",o[Or]=Ba(t,rn)+ze,o[Br]=Ba(t,Ne)+ze,o[Ue]=a[Hn]=a[Id]=a[Pd]="0",Es(i),a[Or]=a["max"+Ts]=n[Or],a[Br]=a["max"+cu]=n[Br],a[Ue]=n[Ue],t.parentNode!==e&&(t.parentNode.insertBefore(e,t),e.appendChild(t)),t._gsap.swappedIn=!0}},r0=/([A-Z])/g,Es=function(t){if(t){var e=t.t.style,n=t.length,i=0,s,o;for((t.t._gsap||wt.core.getCache(t.t)).uncache=1;i<n;i+=2)o=t[i+1],s=t[i],o?e[s]=o:e[s]&&e.removeProperty(s.replace(r0,"-$1").toLowerCase())}},Da=function(t){for(var e=Fa.length,n=t.style,i=[],s=0;s<e;s++)i.push(Fa[s],n[Fa[s]]);return i.t=t,i},s0=function(t,e,n){for(var i=[],s=t.length,o=n?8:0,a;o<s;o+=2)a=t[o],i.push(a,a in e?e[a]:t[o+1]);return i.t=t.t,i},Na={left:0,top:0},gd=function(t,e,n,i,s,o,a,l,c,u,f,h,d,_){vn(t)&&(t=t(l)),Fn(t)&&t.substr(0,3)==="max"&&(t=h+(t.charAt(4)==="="?Pa("0"+t.substr(3),n):0));var g=d?d.time():0,p,m,b;if(d&&d.seek(0),isNaN(t)||(t=+t),Do(t))d&&(t=wt.utils.mapRange(d.scrollTrigger.start,d.scrollTrigger.end,0,h,t)),a&&Ia(a,n,i,!0);else{vn(e)&&(e=e(l));var S=(t||"0").split(" "),y,D,A,w;b=mn(e,l)||ve,y=Pi(b)||{},(!y||!y.left&&!y.top)&&Gn(b).display==="none"&&(w=b.style.display,b.style.display="block",y=Pi(b),w?b.style.display=w:b.style.removeProperty("display")),D=Pa(S[0],y[i.d]),A=Pa(S[1]||"0",n),t=y[i.p]-c[i.p]-u+D+s-A,a&&Ia(a,A,i,n-A<20||a._isStart&&A>20),n-=n-A}if(_&&(l[_]=t||-.001,t<0&&(t=0)),o){var P=t+n,M=o._isStart;p="scroll"+i.d2,Ia(o,P,i,M&&P>20||!M&&(f?Math.max(ve[p],ti[p]):o.parentNode[p])<=P+1),f&&(c=Pi(a),f&&(o.style[i.op.p]=c[i.op.p]-i.op.m-o._offset+ze))}return d&&b&&(p=Pi(b),d.seek(h),m=Pi(b),d._caScrollDist=p[i.p]-m[i.p],t=t/d._caScrollDist*h),d&&d.seek(g),d?t:Math.round(t)},o0=/(webkit|moz|length|cssText|inset)/i,_d=function(t,e,n,i){if(t.parentNode!==e){var s=t.style,o,a;if(e===ve){t._stOrig=s.cssText,a=Gn(t);for(o in a)!+o&&!o0.test(o)&&a[o]&&typeof s[o]=="string"&&o!=="0"&&(s[o]=a[o]);s.top=n,s.left=i}else s.cssText=t._stOrig;wt.core.getCache(t).uncache=1,e.appendChild(t)}},Bd=function(t,e,n){var i=e,s=i;return function(o){var a=Math.round(t());return a!==i&&a!==s&&Math.abs(a-i)>3&&Math.abs(a-s)>3&&(o=a,n&&n()),s=i,i=o,o}},Ca=function(t,e,n){var i={};i[e.p]="+="+n,wt.set(t,i)},xd=function(t,e){var n=Ci(t,e),i="_scroll"+e.p2,s=function o(a,l,c,u,f){var h=o.tween,d=l.onComplete,_={};c=c||n();var g=Bd(n,c,function(){h.kill(),o.tween=0});return f=u&&f||0,u=u||a-c,h&&h.kill(),l[i]=a,l.inherit=!1,l.modifiers=_,_[i]=function(){return g(c+u*h.ratio+f*h.ratio*h.ratio)},l.onUpdate=function(){ne.cache++,o.tween&&Ii()},l.onComplete=function(){o.tween=0,d&&d.call(h)},h=o.tween=wt.to(t,l),h};return t[i]=n,n.wheelHandler=function(){return s.tween&&s.tween.kill()&&(s.tween=0)},Xe(t,"wheel",n.wheelHandler),Pt.isTouch&&Xe(t,"touchmove",n.wheelHandler),s},Pt=function(){function r(e,n){Ms||r.register(wt)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),tu(this),this.init(e,n)}var t=r.prototype;return t.init=function(n,i){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),!To){this.update=this.refresh=this.kill=mi;return}n=hd(Fn(n)||Do(n)||n.nodeType?{trigger:n}:n,Ta);var s=n,o=s.onUpdate,a=s.toggleClass,l=s.id,c=s.onToggle,u=s.onRefresh,f=s.scrub,h=s.trigger,d=s.pin,_=s.pinSpacing,g=s.invalidateOnRefresh,p=s.anticipatePin,m=s.onScrubComplete,b=s.onSnapComplete,S=s.once,y=s.snap,D=s.pinReparent,A=s.pinSpacer,w=s.containerAnimation,P=s.fastScrollEnd,M=s.preventOverlaps,v=n.horizontal||n.containerAnimation&&n.horizontal!==!1?rn:Ne,N=!f&&f!==0,F=mn(n.scroller||oe),R=wt.core.getCache(F),B=kr(F),Y=("pinType"in n?n.pinType:Ri(F,"pinType")||B&&"fixed")==="fixed",H=[n.onEnter,n.onLeave,n.onEnterBack,n.onLeaveBack],J=N&&n.toggleActions.split(" "),O="markers"in n?n.markers:Ta.markers,L=B?0:parseFloat(Gn(F)["border"+v.p2+Ts])||0,C=this,ot=n.onRefreshInit&&function(){return n.onRefreshInit(C)},vt=$_(F,B,v),Wt=K_(F,B),q=0,tt=0,pt=0,st=Ci(F,v),Ft,Nt,V,Yt,Et,Tt,St,zt,Ut,k,Qt,T,x,I,G,K,Q,ht,ct,nt,bt,rt,ft,Ot,it,yt,Bt,Vt,he,kt,U,$,et,ut,at,Dt,te,ae,re;if(C._startClamp=C._endClamp=!1,C._dir=v,p*=45,C.scroller=F,C.scroll=w?w.time.bind(w):st,Yt=st(),C.vars=n,i=i||n.animation,"refreshPriority"in n&&(bd=1,n.refreshPriority===-9999&&(No=C)),R.tweenScroll=R.tweenScroll||{top:xd(F,Ne),left:xd(F,rn)},C.tweenTo=Ft=R.tweenScroll[v.p],C.scrubDuration=function(mt){et=Do(mt)&&mt,et?$?$.duration(mt):$=wt.to(i,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:et,paused:!0,onComplete:function(){return m&&m(C)}}):($&&$.progress(1).kill(),$=0)},i&&(i.vars.lazy=!1,i._initted&&!C.isReverted||i.vars.immediateRender!==!1&&n.immediateRender!==!1&&i.duration()&&i.render(0,!0,!0),C.animation=i.pause(),i.scrollTrigger=C,C.scrubDuration(f),kt=0,l||(l=i.vars.id)),y&&((!Nr(y)||y.push)&&(y={snapTo:y}),"scrollBehavior"in ve.style&&wt.set(B?[ve,ti]:F,{scrollBehavior:"auto"}),ne.forEach(function(mt){return vn(mt)&&mt.target===(B?De.scrollingElement||ti:F)&&(mt.smooth=!1)}),V=vn(y.snapTo)?y.snapTo:y.snapTo==="labels"?Q_(i):y.snapTo==="labelsDirectional"?t0(i):y.directional!==!1?function(mt,qt){return uu(y.snapTo)(mt,on()-tt<500?0:qt.direction)}:wt.utils.snap(y.snapTo),ut=y.duration||{min:.1,max:2},ut=Nr(ut)?Ro(ut.min,ut.max):Ro(ut,ut),at=wt.delayedCall(y.delay||et/2||.1,function(){var mt=st(),qt=on()-tt<500,It=Ft.tween;if((qt||Math.abs(C.getVelocity())<10)&&!It&&!ka&&q!==mt){var Xt=(mt-Tt)/I,Ee=i&&!N?i.totalProgress():Xt,ee=qt?0:(Ee-U)/(on()-Eo)*1e3||0,Se=wt.utils.clamp(-Xt,1-Xt,ys(ee/2)*ee/.185),He=Xt+(y.inertia===!1?0:Se),Me,_e,E=y,z=E.onStart,W=E.onInterrupt,X=E.onComplete;if(Me=V(He,C),Do(Me)||(Me=He),_e=Math.round(Tt+Me*I),mt<=St&&mt>=Tt&&_e!==mt){if(It&&!It._initted&&It.data<=ys(_e-mt))return;y.inertia===!1&&(Se=Me-Xt),Ft(_e,{duration:ut(ys(Math.max(ys(He-Ee),ys(Me-Ee))*.185/ee/.05||0)),ease:y.ease||"power3",data:ys(_e-mt),onInterrupt:function(){return at.restart(!0)&&W&&W(C)},onComplete:function(){C.update(),q=st(),i&&($?$.resetTo("totalProgress",Me,i._tTime/i._tDur):i.progress(Me)),kt=U=i&&!N?i.totalProgress():C.progress,b&&b(C),X&&X(C)}},mt,Se*I,_e-mt-Se*I),z&&z(C,Ft.tween)}}else C.isActive&&q!==mt&&at.restart(!0)}).pause()),l&&(nu[l]=C),h=C.trigger=mn(h||d!==!0&&d),re=h&&h._gsap&&h._gsap.stRevert,re&&(re=re(C)),d=d===!0?h:mn(d),Fn(a)&&(a={targets:h,className:a}),d&&(_===!1||_===Hn||(_=!_&&d.parentNode&&d.parentNode.style&&Gn(d.parentNode).display==="flex"?!1:Ue),C.pin=d,Nt=wt.core.getCache(d),Nt.spacer?G=Nt.pinState:(A&&(A=mn(A),A&&!A.nodeType&&(A=A.current||A.nativeElement),Nt.spacerIsNative=!!A,A&&(Nt.spacerState=Da(A))),Nt.spacer=ht=A||De.createElement("div"),ht.classList.add("pin-spacer"),l&&ht.classList.add("pin-spacer-"+l),Nt.pinState=G=Da(d)),n.force3D!==!1&&wt.set(d,{force3D:!0}),C.spacer=ht=Nt.spacer,he=Gn(d),Ot=he[_+v.os2],nt=wt.getProperty(d),bt=wt.quickSetter(d,v.a,ze),$c(d,ht,he),Q=Da(d)),O){T=Nr(O)?hd(O,fd):fd,k=Aa("scroller-start",l,F,v,T,0),Qt=Aa("scroller-end",l,F,v,T,0,k),ct=k["offset"+v.op.d2];var Zt=mn(Ri(F,"content")||F);zt=this.markerStart=Aa("start",l,Zt,v,T,ct,0,w),Ut=this.markerEnd=Aa("end",l,Zt,v,T,ct,0,w),w&&(ae=wt.quickSetter([zt,Ut],v.a,ze)),!Y&&!(Qn.length&&Ri(F,"fixedMarkers")===!0)&&(j_(B?ve:F),wt.set([k,Qt],{force3D:!0}),yt=wt.quickSetter(k,v.a,ze),Vt=wt.quickSetter(Qt,v.a,ze))}if(w){var Ct=w.vars.onUpdate,Mt=w.vars.onUpdateParams;w.eventCallback("onUpdate",function(){C.update(0,0,1),Ct&&Ct.apply(w,Mt||[])})}if(C.previous=function(){return ie[ie.indexOf(C)-1]},C.next=function(){return ie[ie.indexOf(C)+1]},C.revert=function(mt,qt){if(!qt)return C.kill(!0);var It=mt!==!1||!C.enabled,Xt=sn;It!==C.isReverted&&(It&&(Dt=Math.max(st(),C.scroll.rec||0),pt=C.progress,te=i&&i.progress()),zt&&[zt,Ut,k,Qt].forEach(function(Ee){return Ee.style.display=It?"none":"block"}),It&&(sn=C,C.update(It)),d&&(!D||!C.isActive)&&(It?i0(d,ht,G):$c(d,ht,Gn(d),it)),It||C.update(It),sn=Xt,C.isReverted=It)},C.refresh=function(mt,qt,It,Xt){if(!((sn||!C.enabled)&&!qt)){if(d&&mt&&Wn){Xe(r,"scrollEnd",Fd);return}!xn&&ot&&ot(C),sn=C,Ft.tween&&!It&&(Ft.tween.kill(),Ft.tween=0),$&&$.pause(),g&&i&&i.revert({kill:!1}).invalidate(),C.isReverted||C.revert(!0,!0),C._subPinOffset=!1;var Ee=vt(),ee=Wt(),Se=w?w.duration():gi(F,v),He=I<=.01,Me=0,_e=Xt||0,E=Nr(It)?It.end:n.end,z=n.endTrigger||h,W=Nr(It)?It.start:n.start||(n.start===0||!h?0:d?"0 0":"0 100%"),X=C.pinnedContainer=n.pinnedContainer&&mn(n.pinnedContainer,C),Z=h&&Math.max(0,ie.indexOf(C))||0,dt=Z,gt,xt,Lt,Gt,Rt,At,fe,Fe,je,un,Jt,Ht,ci;for(O&&Nr(It)&&(Ht=wt.getProperty(k,v.p),ci=wt.getProperty(Qt,v.p));dt--;)At=ie[dt],At.end||At.refresh(0,1)||(sn=C),fe=At.pin,fe&&(fe===h||fe===d||fe===X)&&!At.isReverted&&(un||(un=[]),un.unshift(At),At.revert(!0,!0)),At!==ie[dt]&&(Z--,dt--);for(vn(W)&&(W=W(C)),W=ad(W,"start",C),Tt=gd(W,h,Ee,v,st(),zt,k,C,ee,L,Y,Se,w,C._startClamp&&"_startClamp")||(d?-.001:0),vn(E)&&(E=E(C)),Fn(E)&&!E.indexOf("+=")&&(~E.indexOf(" ")?E=(Fn(W)?W.split(" ")[0]:"")+E:(Me=Pa(E.substr(2),Ee),E=Fn(W)?W:(w?wt.utils.mapRange(0,w.duration(),w.scrollTrigger.start,w.scrollTrigger.end,Tt):Tt)+Me,z=h)),E=ad(E,"end",C),St=Math.max(Tt,gd(E||(z?"100% 0":Se),z,Ee,v,st()+Me,Ut,Qt,C,ee,L,Y,Se,w,C._endClamp&&"_endClamp"))||-.001,Me=0,dt=Z;dt--;)At=ie[dt],fe=At.pin,fe&&At.start-At._pinPush<=Tt&&!w&&At.end>0&&(gt=At.end-(C._startClamp?Math.max(0,At.start):At.start),(fe===h&&At.start-At._pinPush<Tt||fe===X)&&isNaN(W)&&(Me+=gt*(1-At.progress)),fe===d&&(_e+=gt));if(Tt+=Me,St+=Me,C._startClamp&&(C._startClamp+=Me),C._endClamp&&!xn&&(C._endClamp=St||-.001,St=Math.min(St,gi(F,v))),I=St-Tt||(Tt-=.01)&&.001,He&&(pt=wt.utils.clamp(0,1,wt.utils.normalize(Tt,St,Dt))),C._pinPush=_e,zt&&Me&&(gt={},gt[v.a]="+="+Me,X&&(gt[v.p]="-="+st()),wt.set([zt,Ut],gt)),d&&!(eu&&C.end>=gi(F,v)))gt=Gn(d),Gt=v===Ne,Lt=st(),rt=parseFloat(nt(v.a))+_e,!Se&&St>1&&(Jt=(B?De.scrollingElement||ti:F).style,Jt={style:Jt,value:Jt["overflow"+v.a.toUpperCase()]},B&&Gn(ve)["overflow"+v.a.toUpperCase()]!=="scroll"&&(Jt.style["overflow"+v.a.toUpperCase()]="scroll")),$c(d,ht,gt),Q=Da(d),xt=Pi(d,!0),Fe=Y&&Ci(F,Gt?rn:Ne)(),_?(it=[_+v.os2,I+_e+ze],it.t=ht,dt=_===Ue?Ba(d,v)+I+_e:0,dt&&(it.push(v.d,dt+ze),ht.style.flexBasis!=="auto"&&(ht.style.flexBasis=dt+ze)),Es(it),X&&ie.forEach(function(pe){pe.pin===X&&pe.vars.pinSpacing!==!1&&(pe._subPinOffset=!0)}),Y&&st(Dt)):(dt=Ba(d,v),dt&&ht.style.flexBasis!=="auto"&&(ht.style.flexBasis=dt+ze)),Y&&(Rt={top:xt.top+(Gt?Lt-Tt:Fe)+ze,left:xt.left+(Gt?Fe:Lt-Tt)+ze,boxSizing:"border-box",position:"fixed"},Rt[Or]=Rt["max"+Ts]=Math.ceil(xt.width)+ze,Rt[Br]=Rt["max"+cu]=Math.ceil(xt.height)+ze,Rt[Hn]=Rt[Hn+Lo]=Rt[Hn+Po]=Rt[Hn+Fo]=Rt[Hn+Io]="0",Rt[Ue]=gt[Ue],Rt[Ue+Lo]=gt[Ue+Lo],Rt[Ue+Po]=gt[Ue+Po],Rt[Ue+Fo]=gt[Ue+Fo],Rt[Ue+Io]=gt[Ue+Io],K=s0(G,Rt,D),xn&&st(0)),i?(je=i._initted,Xc(1),i.render(i.duration(),!0,!0),ft=nt(v.a)-rt+I+_e,Bt=Math.abs(I-ft)>1,Y&&Bt&&K.splice(K.length-2,2),i.render(0,!0,!0),je||i.invalidate(!0),i.parent||i.totalTime(i.totalTime()),Xc(0)):ft=I,Jt&&(Jt.value?Jt.style["overflow"+v.a.toUpperCase()]=Jt.value:Jt.style.removeProperty("overflow-"+v.a));else if(h&&st()&&!w)for(xt=h.parentNode;xt&&xt!==ve;)xt._pinOffset&&(Tt-=xt._pinOffset,St-=xt._pinOffset),xt=xt.parentNode;un&&un.forEach(function(pe){return pe.revert(!1,!0)}),C.start=Tt,C.end=St,Yt=Et=xn?Dt:st(),!w&&!xn&&(Yt<Dt&&st(Dt),C.scroll.rec=0),C.revert(!1,!0),tt=on(),at&&(q=-1,at.restart(!0)),sn=0,i&&N&&(i._initted||te)&&i.progress()!==te&&i.progress(te||0,!0).render(i.time(),!0,!0),(He||pt!==C.progress||w||g)&&(i&&!N&&i.totalProgress(w&&Tt<-.001&&!pt?wt.utils.normalize(Tt,St,0):pt,!0),C.progress=He||(Yt-Tt)/I===pt?0:pt),d&&_&&(ht._pinOffset=Math.round(C.progress*ft)),$&&$.invalidate(),isNaN(Ht)||(Ht-=wt.getProperty(k,v.p),ci-=wt.getProperty(Qt,v.p),Ca(k,v,Ht),Ca(zt,v,Ht-(Xt||0)),Ca(Qt,v,ci),Ca(Ut,v,ci-(Xt||0))),He&&!xn&&C.update(),u&&!xn&&!x&&(x=!0,u(C),x=!1)}},C.getVelocity=function(){return(st()-Et)/(on()-Eo)*1e3||0},C.endAnimation=function(){wo(C.callbackAnimation),i&&($?$.progress(1):i.paused()?N||wo(i,C.direction<0,1):wo(i,i.reversed()))},C.labelToScroll=function(mt){return i&&i.labels&&(Tt||C.refresh()||Tt)+i.labels[mt]/i.duration()*I||0},C.getTrailing=function(mt){var qt=ie.indexOf(C),It=C.direction>0?ie.slice(0,qt).reverse():ie.slice(qt+1);return(Fn(mt)?It.filter(function(Xt){return Xt.vars.preventOverlaps===mt}):It).filter(function(Xt){return C.direction>0?Xt.end<=Tt:Xt.start>=St})},C.update=function(mt,qt,It){if(!(w&&!It&&!mt)){var Xt=xn===!0?Dt:C.scroll(),Ee=mt?0:(Xt-Tt)/I,ee=Ee<0?0:Ee>1?1:Ee||0,Se=C.progress,He,Me,_e,E,z,W,X,Z;if(qt&&(Et=Yt,Yt=w?st():Xt,y&&(U=kt,kt=i&&!N?i.totalProgress():ee)),p&&d&&!sn&&!Ma&&Wn&&(!ee&&Tt<Xt+(Xt-Et)/(on()-Eo)*p?ee=1e-4:ee===1&&St>Xt+(Xt-Et)/(on()-Eo)*p&&(ee=.9999)),ee!==Se&&C.enabled){if(He=C.isActive=!!ee&&ee<1,Me=!!Se&&Se<1,W=He!==Me,z=W||!!ee!=!!Se,C.direction=ee>Se?1:-1,C.progress=ee,z&&!sn&&(_e=ee&&!Se?0:ee===1?1:Se===1?2:3,N&&(E=!W&&J[_e+1]!=="none"&&J[_e+1]||J[_e],Z=i&&(E==="complete"||E==="reset"||E in i))),M&&(W||Z)&&(Z||f||!i)&&(vn(M)?M(C):C.getTrailing(M).forEach(function(Lt){return Lt.endAnimation()})),N||($&&!sn&&!Ma?($._dp._time-$._start!==$._time&&$.render($._dp._time-$._start),$.resetTo?$.resetTo("totalProgress",ee,i._tTime/i._tDur):($.vars.totalProgress=ee,$.invalidate().restart())):i&&i.totalProgress(ee,!!(sn&&(tt||mt)))),d){if(mt&&_&&(ht.style[_+v.os2]=Ot),!Y)bt(Ao(rt+ft*ee));else if(z){if(X=!mt&&ee>Se&&St+1>Xt&&Xt+1>=gi(F,v),D)if(!mt&&(He||X)){var dt=Pi(d,!0),gt=Xt-Tt;_d(d,ve,dt.top+(v===Ne?gt:0)+ze,dt.left+(v===Ne?0:gt)+ze)}else _d(d,ht);Es(He||X?K:Q),Bt&&ee<1&&He||bt(rt+(ee===1&&!X?ft:0))}}y&&!Ft.tween&&!sn&&!Ma&&at.restart(!0),a&&(W||S&&ee&&(ee<1||!qc))&&Uo(a.targets).forEach(function(Lt){return Lt.classList[He||S?"add":"remove"](a.className)}),o&&!N&&!mt&&o(C),z&&!sn?(N&&(Z&&(E==="complete"?i.pause().totalProgress(1):E==="reset"?i.restart(!0).pause():E==="restart"?i.restart(!0):i[E]()),o&&o(C)),(W||!qc)&&(c&&W&&Zc(C,c),H[_e]&&Zc(C,H[_e]),S&&(ee===1?C.kill(!1,1):H[_e]=0),W||(_e=ee===1?1:3,H[_e]&&Zc(C,H[_e]))),P&&!He&&Math.abs(C.getVelocity())>(Do(P)?P:2500)&&(wo(C.callbackAnimation),$?$.progress(1):wo(i,E==="reverse"?1:!ee,1))):N&&o&&!sn&&o(C)}if(Vt){var xt=w?Xt/w.duration()*(w._caScrollDist||0):Xt;yt(xt+(k._isFlipped?1:0)),Vt(xt)}ae&&ae(-Xt/w.duration()*(w._caScrollDist||0))}},C.enable=function(mt,qt){C.enabled||(C.enabled=!0,Xe(F,"resize",Co),B||Xe(F,"scroll",Ss),ot&&Xe(r,"refreshInit",ot),mt!==!1&&(C.progress=pt=0,Yt=Et=q=st()),qt!==!1&&C.refresh())},C.getTween=function(mt){return mt&&Ft?Ft.tween:$},C.setPositions=function(mt,qt,It,Xt){if(w){var Ee=w.scrollTrigger,ee=w.duration(),Se=Ee.end-Ee.start;mt=Ee.start+Se*mt/ee,qt=Ee.start+Se*qt/ee}C.refresh(!1,!1,{start:ld(mt,It&&!!C._startClamp),end:ld(qt,It&&!!C._endClamp)},Xt),C.update()},C.adjustPinSpacing=function(mt){if(it&&mt){var qt=it.indexOf(v.d)+1;it[qt]=parseFloat(it[qt])+mt+ze,it[1]=parseFloat(it[1])+mt+ze,Es(it)}},C.disable=function(mt,qt){if(C.enabled&&(mt!==!1&&C.revert(!0,!0),C.enabled=C.isActive=!1,qt||$&&$.pause(),Dt=0,Nt&&(Nt.uncache=1),ot&&We(r,"refreshInit",ot),at&&(at.pause(),Ft.tween&&Ft.tween.kill()&&(Ft.tween=0)),!B)){for(var It=ie.length;It--;)if(ie[It].scroller===F&&ie[It]!==C)return;We(F,"resize",Co),B||We(F,"scroll",Ss)}},C.kill=function(mt,qt){C.disable(mt,qt),$&&!qt&&$.kill(),l&&delete nu[l];var It=ie.indexOf(C);It>=0&&ie.splice(It,1),It===_n&&La>0&&_n--,It=0,ie.forEach(function(Xt){return Xt.scroller===C.scroller&&(It=1)}),It||xn||(C.scroll.rec=0),i&&(i.scrollTrigger=null,mt&&i.revert({kill:!1}),qt||i.kill()),zt&&[zt,Ut,k,Qt].forEach(function(Xt){return Xt.parentNode&&Xt.parentNode.removeChild(Xt)}),No===C&&(No=0),d&&(Nt&&(Nt.uncache=1),It=0,ie.forEach(function(Xt){return Xt.pin===d&&It++}),It||(Nt.spacer=0)),n.onKill&&n.onKill(C)},ie.push(C),C.enable(!1,!1),re&&re(C),i&&i.add&&!I){var le=C.update;C.update=function(){C.update=le,Tt||St||C.refresh()},wt.delayedCall(.01,C.update),I=.01,Tt=St=0}else C.refresh();d&&n0()},r.register=function(n){return Ms||(wt=n||Dd(),Ad()&&window.document&&r.enable(),Ms=To),Ms},r.defaults=function(n){if(n)for(var i in n)Ta[i]=n[i];return Ta},r.disable=function(n,i){To=0,ie.forEach(function(o){return o[i?"kill":"disable"](n)}),We(oe,"wheel",Ss),We(De,"scroll",Ss),clearInterval(Sa),We(De,"touchcancel",mi),We(ve,"touchstart",mi),wa(We,De,"pointerdown,touchstart,mousedown",cd),wa(We,De,"pointerup,touchend,mouseup",ud),Ua.kill(),ba(We);for(var s=0;s<ne.length;s+=3)Ea(We,ne[s],ne[s+1]),Ea(We,ne[s],ne[s+2])},r.enable=function(){if(oe=window,De=document,ti=De.documentElement,ve=De.body,wt&&(Uo=wt.utils.toArray,Ro=wt.utils.clamp,tu=wt.core.context||mi,Xc=wt.core.suppressOverwrites||mi,su=oe.history.scrollRestoration||"auto",iu=oe.pageYOffset,wt.core.globals("ScrollTrigger",r),ve)){To=1,ws=document.createElement("div"),ws.style.height="100vh",ws.style.position="absolute",Od(),J_(),Pe.register(wt),r.isTouch=Pe.isTouch,nr=Pe.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),Qc=Pe.isTouch===1,Xe(oe,"wheel",Ss),Md=[oe,De,ti,ve],wt.matchMedia?(r.matchMedia=function(l){var c=wt.matchMedia(),u;for(u in l)c.add(u,l[u]);return c},wt.addEventListener("matchMediaInit",function(){return hu()}),wt.addEventListener("matchMediaRevert",function(){return Nd()}),wt.addEventListener("matchMedia",function(){Ur(0,1),Hr("matchMedia")}),wt.matchMedia("(orientation: portrait)",function(){return Jc(),Jc})):console.warn("Requires GSAP 3.11.0 or later"),Jc(),Xe(De,"scroll",Ss);var n=ve.style,i=n.borderTopStyle,s=wt.core.Animation.prototype,o,a;for(s.revert||Object.defineProperty(s,"revert",{value:function(){return this.time(-.01,!0)}}),n.borderTopStyle="solid",o=Pi(ve),Ne.m=Math.round(o.top+Ne.sc())||0,rn.m=Math.round(o.left+rn.sc())||0,i?n.borderTopStyle=i:n.removeProperty("border-top-style"),Sa=setInterval(dd,250),wt.delayedCall(.5,function(){return Ma=0}),Xe(De,"touchcancel",mi),Xe(ve,"touchstart",mi),wa(Xe,De,"pointerdown,touchstart,mousedown",cd),wa(Xe,De,"pointerup,touchend,mouseup",ud),jc=wt.utils.checkPrefix("transform"),Fa.push(jc),Ms=on(),Ua=wt.delayedCall(.2,Ur).pause(),bs=[De,"visibilitychange",function(){var l=oe.innerWidth,c=oe.innerHeight;De.hidden?(sd=l,od=c):(sd!==l||od!==c)&&Co()},De,"DOMContentLoaded",Ur,oe,"load",Ur,oe,"resize",Co],ba(Xe),ie.forEach(function(l){return l.enable(0,1)}),a=0;a<ne.length;a+=3)Ea(We,ne[a],ne[a+1]),Ea(We,ne[a],ne[a+2])}},r.config=function(n){"limitCallbacks"in n&&(qc=!!n.limitCallbacks);var i=n.syncInterval;i&&clearInterval(Sa)||(Sa=i)&&setInterval(dd,i),"ignoreMobileResize"in n&&(Qc=r.isTouch===1&&n.ignoreMobileResize),"autoRefreshEvents"in n&&(ba(We)||ba(Xe,n.autoRefreshEvents||"none"),wd=(n.autoRefreshEvents+"").indexOf("resize")===-1)},r.scrollerProxy=function(n,i){var s=mn(n),o=ne.indexOf(s),a=kr(s);~o&&ne.splice(o,a?6:2),i&&(a?Qn.unshift(oe,i,ve,i,ti,i):Qn.unshift(s,i))},r.clearMatchMedia=function(n){ie.forEach(function(i){return i._ctx&&i._ctx.query===n&&i._ctx.kill(!0,!0)})},r.isInViewport=function(n,i,s){var o=(Fn(n)?mn(n):n).getBoundingClientRect(),a=o[s?Or:Br]*i||0;return s?o.right-a>0&&o.left+a<oe.innerWidth:o.bottom-a>0&&o.top+a<oe.innerHeight},r.positionInViewport=function(n,i,s){Fn(n)&&(n=mn(n));var o=n.getBoundingClientRect(),a=o[s?Or:Br],l=i==null?a/2:i in za?za[i]*a:~i.indexOf("%")?parseFloat(i)*a/100:parseFloat(i)||0;return s?(o.left+l)/oe.innerWidth:(o.top+l)/oe.innerHeight},r.killAll=function(n){if(ie.slice(0).forEach(function(s){return s.vars.id!=="ScrollSmoother"&&s.kill()}),n!==!0){var i=Vr.killAll||[];Vr={},i.forEach(function(s){return s()})}},r}();Pt.version="3.12.5";Pt.saveStyles=function(r){return r?Uo(r).forEach(function(t){if(t&&t.style){var e=Ln.indexOf(t);e>=0&&Ln.splice(e,5),Ln.push(t,t.style.cssText,t.getBBox&&t.getAttribute("transform"),wt.core.getCache(t),tu())}}):Ln};Pt.revert=function(r,t){return hu(!r,t)};Pt.create=function(r,t){return new Pt(r,t)};Pt.refresh=function(r){return r?Co():(Ms||Pt.register())&&Ur(!0)};Pt.update=function(r){return++ne.cache&&Ii(r===!0?2:0)};Pt.clearScrollMemory=Ud;Pt.maxScroll=function(r,t){return gi(r,t?rn:Ne)};Pt.getScrollFunc=function(r,t){return Ci(mn(r),t?rn:Ne)};Pt.getById=function(r){return nu[r]};Pt.getAll=function(){return ie.filter(function(r){return r.vars.id!=="ScrollSmoother"})};Pt.isScrolling=function(){return!!Wn};Pt.snapDirectional=uu;Pt.addEventListener=function(r,t){var e=Vr[r]||(Vr[r]=[]);~e.indexOf(t)||e.push(t)};Pt.removeEventListener=function(r,t){var e=Vr[r],n=e&&e.indexOf(t);n>=0&&e.splice(n,1)};Pt.batch=function(r,t){var e=[],n={},i=t.interval||.016,s=t.batchMax||1e9,o=function(c,u){var f=[],h=[],d=wt.delayedCall(i,function(){u(f,h),f=[],h=[]}).pause();return function(_){f.length||d.restart(!0),f.push(_.trigger),h.push(_),s<=f.length&&d.progress(1)}},a;for(a in t)n[a]=a.substr(0,2)==="on"&&vn(t[a])&&a!=="onRefreshInit"?o(a,t[a]):t[a];return vn(s)&&(s=s(),Xe(Pt,"refresh",function(){return s=t.batchMax()})),Uo(r).forEach(function(l){var c={};for(a in n)c[a]=n[a];c.trigger=l,e.push(Pt.create(c))}),e};var vd=function(t,e,n,i){return e>i?t(i):e<0&&t(0),n>i?(i-e)/(n-e):n<0?e/(e-n):1},Kc=function r(t,e){e===!0?t.style.removeProperty("touch-action"):t.style.touchAction=e===!0?"auto":e?"pan-"+e+(Pe.isTouch?" pinch-zoom":""):"none",t===ti&&r(ve,e)},Ra={auto:1,scroll:1},a0=function(t){var e=t.event,n=t.target,i=t.axis,s=(e.changedTouches?e.changedTouches[0]:e).target,o=s._gsap||wt.core.getCache(s),a=on(),l;if(!o._isScrollT||a-o._isScrollT>2e3){for(;s&&s!==ve&&(s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth||!(Ra[(l=Gn(s)).overflowY]||Ra[l.overflowX]));)s=s.parentNode;o._isScroll=s&&s!==n&&!kr(s)&&(Ra[(l=Gn(s)).overflowY]||Ra[l.overflowX]),o._isScrollT=a}(o._isScroll||i==="x")&&(e.stopPropagation(),e._gsapAllow=!0)},zd=function(t,e,n,i){return Pe.create({target:t,capture:!0,debounce:!1,lockAxis:!0,type:e,onWheel:i=i&&a0,onPress:i,onDrag:i,onScroll:i,onEnable:function(){return n&&Xe(De,Pe.eventTypes[0],Sd,!1,!0)},onDisable:function(){return We(De,Pe.eventTypes[0],Sd,!0)}})},l0=/(input|label|select|textarea)/i,yd,Sd=function(t){var e=l0.test(t.target.tagName);(e||yd)&&(t._gsapAllow=!0,yd=e)},c0=function(t){Nr(t)||(t={}),t.preventDefault=t.isNormalizer=t.allowClicks=!0,t.type||(t.type="wheel,touch"),t.debounce=!!t.debounce,t.id=t.id||"normalizer";var e=t,n=e.normalizeScrollX,i=e.momentum,s=e.allowNestedScroll,o=e.onRelease,a,l,c=mn(t.target)||ti,u=wt.core.globals().ScrollSmoother,f=u&&u.get(),h=nr&&(t.content&&mn(t.content)||f&&t.content!==!1&&!f.smooth()&&f.content()),d=Ci(c,Ne),_=Ci(c,rn),g=1,p=(Pe.isTouch&&oe.visualViewport?oe.visualViewport.scale*oe.visualViewport.width:oe.outerWidth)/oe.innerWidth,m=0,b=vn(i)?function(){return i(a)}:function(){return i||2.8},S,y,D=zd(c,t.type,!0,s),A=function(){return y=!1},w=mi,P=mi,M=function(){l=gi(c,Ne),P=Ro(nr?1:0,l),n&&(w=Ro(0,gi(c,rn))),S=zr},v=function(){h._gsap.y=Ao(parseFloat(h._gsap.y)+d.offset)+"px",h.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(h._gsap.y)+", 0, 1)",d.offset=d.cacheID=0},N=function(){if(y){requestAnimationFrame(A);var O=Ao(a.deltaY/2),L=P(d.v-O);if(h&&L!==d.v+d.offset){d.offset=L-d.v;var C=Ao((parseFloat(h&&h._gsap.y)||0)-d.offset);h.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+C+", 0, 1)",h._gsap.y=C+"px",d.cacheID=ne.cache,Ii()}return!0}d.offset&&v(),y=!0},F,R,B,Y,H=function(){M(),F.isActive()&&F.vars.scrollY>l&&(d()>l?F.progress(1)&&d(l):F.resetTo("scrollY",l))};return h&&wt.set(h,{y:"+=0"}),t.ignoreCheck=function(J){return nr&&J.type==="touchmove"&&N(J)||g>1.05&&J.type!=="touchstart"||a.isGesturing||J.touches&&J.touches.length>1},t.onPress=function(){y=!1;var J=g;g=Ao((oe.visualViewport&&oe.visualViewport.scale||1)/p),F.pause(),J!==g&&Kc(c,g>1.01?!0:n?!1:"x"),R=_(),B=d(),M(),S=zr},t.onRelease=t.onGestureStart=function(J,O){if(d.offset&&v(),!O)Y.restart(!0);else{ne.cache++;var L=b(),C,ot;n&&(C=_(),ot=C+L*.05*-J.velocityX/.227,L*=vd(_,C,ot,gi(c,rn)),F.vars.scrollX=w(ot)),C=d(),ot=C+L*.05*-J.velocityY/.227,L*=vd(d,C,ot,gi(c,Ne)),F.vars.scrollY=P(ot),F.invalidate().duration(L).play(.01),(nr&&F.vars.scrollY>=l||C>=l-1)&&wt.to({},{onUpdate:H,duration:L})}o&&o(J)},t.onWheel=function(){F._ts&&F.pause(),on()-m>1e3&&(S=0,m=on())},t.onChange=function(J,O,L,C,ot){if(zr!==S&&M(),O&&n&&_(w(C[2]===O?R+(J.startX-J.x):_()+O-C[1])),L){d.offset&&v();var vt=ot[2]===L,Wt=vt?B+J.startY-J.y:d()+L-ot[1],q=P(Wt);vt&&Wt!==q&&(B+=q-Wt),d(q)}(L||O)&&Ii()},t.onEnable=function(){Kc(c,n?!1:"x"),Pt.addEventListener("refresh",H),Xe(oe,"resize",H),d.smooth&&(d.target.style.scrollBehavior="auto",d.smooth=_.smooth=!1),D.enable()},t.onDisable=function(){Kc(c,!0),We(oe,"resize",H),Pt.removeEventListener("refresh",H),D.kill()},t.lockAxis=t.lockAxis!==!1,a=new Pe(t),a.iOS=nr,nr&&!d()&&d(1),nr&&wt.ticker.add(mi),Y=a._dc,F=wt.to(a,{ease:"power4",paused:!0,inherit:!1,scrollX:n?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:Bd(d,d(),function(){return F.pause()})},onUpdate:Ii,onComplete:Y.vars.onComplete}),a};Pt.sort=function(r){return ie.sort(r||function(t,e){return(t.vars.refreshPriority||0)*-1e6+t.start-(e.start+(e.vars.refreshPriority||0)*-1e6)})};Pt.observe=function(r){return new Pe(r)};Pt.normalizeScroll=function(r){if(typeof r>"u")return gn;if(r===!0&&gn)return gn.enable();if(r===!1){gn&&gn.kill(),gn=r;return}var t=r instanceof Pe?r:c0(r);return gn&&gn.target===t.target&&gn.kill(),kr(t.target)&&(gn=t),t};Pt.core={_getVelocityProp:ya,_inputObserver:zd,_scrollers:ne,_proxies:Qn,bridge:{ss:function(){Wn||Hr("scrollStart"),Wn=on()},ref:function(){return sn}}};Dd()&&wt.registerPlugin(Pt);var u0=/(?:^\s+|\s+$)/g,fu=/([\uD800-\uDBFF][\uDC00-\uDFFF](?:[\u200D\uFE0F][\uD800-\uDBFF][\uDC00-\uDFFF]){2,}|\uD83D\uDC69(?:\u200D(?:(?:\uD83D\uDC69\u200D)?\uD83D\uDC67|(?:\uD83D\uDC69\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]\uFE0F|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC6F\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3C-\uDD3E\uDDD6-\uDDDF])\u200D[\u2640\u2642]\uFE0F|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F\u200D[\u2640\u2642]|(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642])\uFE0F|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC69\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708]))\uFE0F|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83D\uDC69\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]))|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\u200D(?:(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDD1-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])?|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])\uFE0F)/;function As(r){var t=r.nodeType,e="";if(t===1||t===9||t===11){if(typeof r.textContent=="string")return r.textContent;for(r=r.firstChild;r;r=r.nextSibling)e+=As(r)}else if(t===3||t===4)return r.nodeValue;return e}function ei(r,t,e,n){if(r+="",e&&(r=r.trim?r.trim():r.replace(u0,"")),t&&t!=="")return r.replace(/>/g,">").replace(/</g,"<").split(t);for(var i=[],s=r.length,o=0,a,l;o<s;o++)l=r.charAt(o),(l.charCodeAt(0)>=55296&&l.charCodeAt(0)<=56319||r.charCodeAt(o+1)>=65024&&r.charCodeAt(o+1)<=65039)&&(a=((r.substr(o,12).split(fu)||[])[1]||"").length||2,l=r.substr(o,a),i.emoji=1,o+=a-1),i.push(l===">"?">":l==="<"?"<":n&&l===" "&&(r.charAt(o-1)===" "||r.charAt(o+1)===" ")?" ":l);return i}var Ds,pu,Hd,Bo,Gd,Va,h0=/(?:\r|\n|\t\t)/g,f0=/(?:\s\s+)/g,d0="\xA0",Wd=function(t){Ds=document,pu=window,Bo=Bo||t||pu.gsap||console.warn("Please gsap.registerPlugin(SplitText)"),Bo&&(Va=Bo.utils.toArray,Gd=Bo.core.context||function(){},Hd=1)},p0=1,Xd=function(t){return pu.getComputedStyle(t)},mu=function(t){return t.position==="absolute"||t.absolute===!0},m0=function(t,e){for(var n=e.length,i;--n>-1;)if(i=e[n],t.substr(0,i.length)===i)return i.length},g0=" style='position:relative;display:inline-block;'",kd=function(t,e){t===void 0&&(t="");var n=~t.indexOf("++"),i=1;return n&&(t=t.split("++").join("")),function(){return"<"+e+g0+(t?" class='"+t+(n?i++:"")+"'>":">")}},qd=function r(t,e,n){var i=t.nodeType;if(i===1||i===9||i===11)for(t=t.firstChild;t;t=t.nextSibling)r(t,e,n);else(i===3||i===4)&&(t.nodeValue=t.nodeValue.split(e).join(n))},du=function(t,e){for(var n=e.length;--n>-1;)t.push(e[n])},Vd=function(t,e,n){for(var i;t&&t!==e;){if(i=t._next||t.nextSibling,i)return i.textContent.charAt(0)===n;t=t.parentNode||t._parent}},_0=function r(t){var e=Va(t.childNodes),n=e.length,i,s;for(i=0;i<n;i++)s=e[i],s._isSplit?r(s):i&&s.previousSibling&&s.previousSibling.nodeType===3?(s.previousSibling.nodeValue+=s.nodeType===3?s.nodeValue:s.firstChild.nodeValue,t.removeChild(s)):s.nodeType!==3&&(t.insertBefore(s.firstChild,s),t.removeChild(s))},_i=function(t,e){return parseFloat(e[t])||0},x0=function(t,e,n,i,s,o,a){var l=Xd(t),c=_i("paddingLeft",l),u=-999,f=_i("borderBottomWidth",l)+_i("borderTopWidth",l),h=_i("borderLeftWidth",l)+_i("borderRightWidth",l),d=_i("paddingTop",l)+_i("paddingBottom",l),_=_i("paddingLeft",l)+_i("paddingRight",l),g=_i("fontSize",l)*(e.lineThreshold||.2),p=l.textAlign,m=[],b=[],S=[],y=e.wordDelimiter||" ",D=e.tag?e.tag:e.span?"span":"div",A=e.type||e.split||"chars,words,lines",w=s&&~A.indexOf("lines")?[]:null,P=~A.indexOf("words"),M=~A.indexOf("chars"),v=mu(e),N=e.linesClass,F=~(N||"").indexOf("++"),R=[],B=l.display==="flex",Y=t.style.display,H,J,O,L,C,ot,vt,Wt,q,tt,pt,st;for(F&&(N=N.split("++").join("")),B&&(t.style.display="block"),J=t.getElementsByTagName("*"),O=J.length,C=[],H=0;H<O;H++)C[H]=J[H];if(w||v)for(H=0;H<O;H++)L=C[H],ot=L.parentNode===t,(ot||v||M&&!P)&&(st=L.offsetTop,w&&ot&&Math.abs(st-u)>g&&(L.nodeName!=="BR"||H===0)&&(vt=[],w.push(vt),u=st),v&&(L._x=L.offsetLeft,L._y=st,L._w=L.offsetWidth,L._h=L.offsetHeight),w&&((L._isSplit&&ot||!M&&ot||P&&ot||!P&&L.parentNode.parentNode===t&&!L.parentNode._isSplit)&&(vt.push(L),L._x-=c,Vd(L,t,y)&&(L._wordEnd=!0)),L.nodeName==="BR"&&(L.nextSibling&&L.nextSibling.nodeName==="BR"||H===0)&&w.push([])));for(H=0;H<O;H++){if(L=C[H],ot=L.parentNode===t,L.nodeName==="BR"){w||v?(L.parentNode&&L.parentNode.removeChild(L),C.splice(H--,1),O--):P||t.appendChild(L);continue}if(v&&(q=L.style,!P&&!ot&&(L._x+=L.parentNode._x,L._y+=L.parentNode._y),q.left=L._x+"px",q.top=L._y+"px",q.position="absolute",q.display="block",q.width=L._w+1+"px",q.height=L._h+"px"),!P&&M)if(L._isSplit)for(L._next=J=L.nextSibling,L.parentNode.appendChild(L);J&&J.nodeType===3&&J.textContent===" ";)L._next=J.nextSibling,L.parentNode.appendChild(J),J=J.nextSibling;else L.parentNode._isSplit?(L._parent=L.parentNode,!L.previousSibling&&L.firstChild&&(L.firstChild._isFirst=!0),L.nextSibling&&L.nextSibling.textContent===" "&&!L.nextSibling.nextSibling&&R.push(L.nextSibling),L._next=L.nextSibling&&L.nextSibling._isFirst?null:L.nextSibling,L.parentNode.removeChild(L),C.splice(H--,1),O--):ot||(st=!L.nextSibling&&Vd(L.parentNode,t,y),L.parentNode._parent&&L.parentNode._parent.appendChild(L),st&&L.parentNode.appendChild(Ds.createTextNode(" ")),D==="span"&&(L.style.display="inline"),m.push(L));else L.parentNode._isSplit&&!L._isSplit&&L.innerHTML!==""?b.push(L):M&&!L._isSplit&&(D==="span"&&(L.style.display="inline"),m.push(L))}for(H=R.length;--H>-1;)R[H].parentNode.removeChild(R[H]);if(w){for(v&&(tt=Ds.createElement(D),t.appendChild(tt),pt=tt.offsetWidth+"px",st=tt.offsetParent===t?0:t.offsetLeft,t.removeChild(tt)),q=t.style.cssText,t.style.cssText="display:none;";t.firstChild;)t.removeChild(t.firstChild);for(Wt=y===" "&&(!v||!P&&!M),H=0;H<w.length;H++){for(vt=w[H],tt=Ds.createElement(D),tt.style.cssText="display:block;text-align:"+p+";position:"+(v?"absolute;":"relative;"),N&&(tt.className=N+(F?H+1:"")),S.push(tt),O=vt.length,J=0;J<O;J++)vt[J].nodeName!=="BR"&&(L=vt[J],tt.appendChild(L),Wt&&L._wordEnd&&tt.appendChild(Ds.createTextNode(" ")),v&&(J===0&&(tt.style.top=L._y+"px",tt.style.left=c+st+"px"),L.style.top="0px",st&&(L.style.left=L._x-st+"px")));O===0?tt.innerHTML=" ":!P&&!M&&(_0(tt),qd(tt,"\xA0"," ")),v&&(tt.style.width=pt,tt.style.height=L._h+"px"),t.appendChild(tt)}t.style.cssText=q}v&&(a>t.clientHeight&&(t.style.height=a-d+"px",t.clientHeight<a&&(t.style.height=a+f+"px")),o>t.clientWidth&&(t.style.width=o-_+"px",t.clientWidth<o&&(t.style.width=o+h+"px"))),B&&(Y?t.style.display=Y:t.style.removeProperty("display")),du(n,m),P&&du(i,b),du(s,S)},v0=function(t,e,n,i){var s=e.tag?e.tag:e.span?"span":"div",o=e.type||e.split||"chars,words,lines",a=~o.indexOf("chars"),l=mu(e),c=e.wordDelimiter||" ",u=function(v){return v===c||v===d0&&c===" "},f=c!==" "?"":l?"­ ":" ",h="</"+s+">",d=1,_=e.specialChars?typeof e.specialChars=="function"?e.specialChars:m0:null,g,p,m,b,S,y,D,A,w=Ds.createElement("div"),P=t.parentNode;for(P.insertBefore(w,t),w.textContent=t.nodeValue,P.removeChild(t),t=w,g=As(t),D=g.indexOf("<")!==-1,e.reduceWhiteSpace!==!1&&(g=g.replace(f0," ").replace(h0,"")),D&&(g=g.split("<").join("{{LT}}")),S=g.length,p=(g.charAt(0)===" "?f:"")+n(),m=0;m<S;m++)if(y=g.charAt(m),_&&(A=_(g.substr(m),e.specialChars)))y=g.substr(m,A||1),p+=a&&y!==" "?i()+y+"</"+s+">":y,m+=A-1;else if(u(y)&&!u(g.charAt(m-1))&&m){for(p+=d?h:"",d=0;u(g.charAt(m+1));)p+=f,m++;m===S-1?p+=f:g.charAt(m+1)!==")"&&(p+=f+n(),d=1)}else y==="{"&&g.substr(m,6)==="{{LT}}"?(p+=a?i()+"{{LT}}</"+s+">":"{{LT}}",m+=5):y.charCodeAt(0)>=55296&&y.charCodeAt(0)<=56319||g.charCodeAt(m+1)>=65024&&g.charCodeAt(m+1)<=65039?(b=((g.substr(m,12).split(fu)||[])[1]||"").length||2,p+=a&&y!==" "?i()+g.substr(m,b)+"</"+s+">":g.substr(m,b),m+=b-1):p+=a&&y!==" "?i()+y+"</"+s+">":y;t.outerHTML=p+(d?h:""),D&&qd(P,"{{LT}}","<")},y0=function r(t,e,n,i){var s=Va(t.childNodes),o=s.length,a=mu(e),l,c;if(t.nodeType!==3||o>1){for(e.absolute=!1,l=0;l<o;l++)c=s[l],c._next=c._isFirst=c._parent=c._wordEnd=null,(c.nodeType!==3||/\S+/.test(c.nodeValue))&&(a&&c.nodeType!==3&&Xd(c).display==="inline"&&(c.style.display="inline-block",c.style.position="relative"),c._isSplit=!0,r(c,e,n,i));e.absolute=a,t._isSplit=!0;return}v0(t,e,n,i)},xi=function(){function r(e,n){Hd||Wd(),this.elements=Va(e),this.chars=[],this.words=[],this.lines=[],this._originals=[],this.vars=n||{},Gd(this),p0&&this.split(n)}var t=r.prototype;return t.split=function(n){this.isSplit&&this.revert(),this.vars=n=n||this.vars,this._originals.length=this.chars.length=this.words.length=this.lines.length=0;for(var i=this.elements.length,s=n.tag?n.tag:n.span?"span":"div",o=kd(n.wordsClass,s),a=kd(n.charsClass,s),l,c,u;--i>-1;)u=this.elements[i],this._originals[i]={html:u.innerHTML,style:u.getAttribute("style")},l=u.clientHeight,c=u.clientWidth,y0(u,n,o,a),x0(u,n,this.chars,this.words,this.lines,c,l);return this.chars.reverse(),this.words.reverse(),this.lines.reverse(),this.isSplit=!0,this},t.revert=function(){var n=this._originals;if(!n)throw"revert() call wasn't scoped properly.";return this.elements.forEach(function(i,s){i.innerHTML=n[s].html,i.setAttribute("style",n[s].style)}),this.chars=[],this.words=[],this.lines=[],this.isSplit=!1,this},r.create=function(n,i){return new r(n,i)},r}();xi.version="3.12.5";xi.register=Wd;var Yd=()=>{lt.registerPlugin(Pt,xi),document.querySelectorAll("[data-header-animation]").forEach(t=>{let e=t.querySelector("h2");if(e.classList.contains("is-all-strong")&&(e=e.querySelector("strong")),!e)return;let n=new xi(e,{type:"lines",tag:"span"}),i=new xi(e,{type:"lines",linesClass:"header_line"});n.lines=i.chars.concat(n.lines);let s=lt.timeline({scrollTrigger:{trigger:t,start:"top bottom",toggleActions:"play none none reset"}});s.fromTo(n.lines,{y:100},{y:0,duration:.75,stagger:.05,ease:"circ.out"},"+=0.25");let o=t.querySelector(".hero_holo");o&&s.fromTo(o,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"+-=0.25");let a=t.querySelector(".button");a&&s.fromTo(a,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"-=0.75")})};var Zd=()=>{if(lt.registerPlugin(Pt,xi),document.querySelector(".hero_grid")){let r=document.querySelector(".hero_grid"),t=r.querySelector(".hero_holo"),e=r.querySelector("h1"),n=r.querySelector(".paragraph-big"),i=new xi(e,{type:"lines",tag:"span"}),s=new xi(e,{type:"lines",linesClass:"header_line"});i.lines=s.chars.concat(i.lines),lt.timeline({scrollTrigger:{trigger:r,start:"top bottom",toggleActions:"play none none reset"}}).fromTo(n,{autoAlpha:0},{autoAlpha:1,duration:.35,ease:"circ.out"},"+=1.75").fromTo(i.lines,{y:"100%"},{y:0,duration:.75,stagger:.05,ease:"circ.out"},"-=0.25").fromTo(t,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"+-=0.25")}};var Jd=()=>{let r=document.querySelector(".is-section-loader");if(!r)return;let t=r.querySelector(".loader_line"),e=r.querySelector(".loader_value");!t||!e||lt.to(t,{width:"100%",duration:1.5,onUpdate:function(){let n=Math.round(this.progress()*100);e.innerHTML=`${n}%`},onComplete:function(){lt.to(r,{y:"-100dvh",duration:.75})}},"<")};var $d=()=>{lt.registerPlugin(Pt),lt.matchMedia().add("(min-width: 992px)",()=>{lt.set(".accomplish-box-wrap",{opacity:.1}),lt.timeline({scrollTrigger:{trigger:".is-accomplish-section",start:"top top",end:"+=5000",scrub:!0,pin:!0}}).to(".accomplish-second-row",{x:()=>{let r=document.querySelector(".accomplish-second-row"),t=document.querySelector(".is-accomplish-section");return-(r.scrollWidth-t.offsetWidth)},duration:1,ease:"none"}).to(".accomplish-box-wrap",{opacity:1,stagger:.1},"<")}),lt.matchMedia().add("(max-width: 991px)",()=>{document.querySelectorAll(".accomplish-box-wrap").forEach(t=>{lt.set(t,{opacity:0,y:50}),lt.to(t,{scrollTrigger:{trigger:t,start:"top bottom-=100",end:"bottom center",toggleActions:"play none none reverse"},opacity:1,y:0,duration:.8,ease:"power2.out"})})})};var Kd=()=>{lt.registerPlugin(Pt);let r=document.querySelector(".reviews-second-row"),t=r.scrollWidth-r.offsetWidth,e=lt.to(r,{x:-t,duration:30,ease:"none",repeat:-1,yoyo:!0,repeatDelay:0});r.addEventListener("mouseenter",()=>{e.pause()}),r.addEventListener("mouseleave",()=>{e.play()});let n=document.querySelector(".brand_container"),i=lt.utils.toArray(".brand-img-wrapper");i.forEach(f=>{let h=f.cloneNode(!0);n.appendChild(h)});let s=()=>i.reduce((f,h)=>{let d=h.offsetWidth,_=parseFloat(getComputedStyle(h).marginRight);return f+d+_},0),o=()=>{let f=s();return lt.set(n,{x:0}),lt.to(n,{x:-f,duration:30,ease:"none",repeat:-1})},a=o();window.addEventListener("resize",()=>{a&&a.kill(),lt.delayedCall(.2,()=>{a=o()})});let l=document.querySelectorAll(".faq-question-item");function c(){l.forEach(f=>{let h=f.querySelector(".is-answer"),d=f.querySelector(".plus_wrap");lt.to(h,{height:0,duration:.3,ease:"power2.out",overflow:"hidden"}),d.style.backgroundColor="#737678"})}function u(f){let h=f.querySelector(".is-answer"),d=f.querySelector(".plus_wrap");lt.to(h,{height:"auto",duration:.3,ease:"power2.out",overflow:"visible"}),d.style.backgroundColor="#FF8A00"}l.forEach((f,h)=>{f.addEventListener("click",()=>{c(),u(f)}),h===0&&u(f)})};lt.registerPlugin(Pt);var jd=()=>{lt.matchMedia().add("(min-width: 992px)",()=>{lt.set(".problem-box_wrap",{yPercent:100,opacity:0}),lt.timeline({scrollTrigger:{trigger:".section.background-color-primary.is-fading-section",start:"top top",end:"+=200%",pin:!0,scrub:1,anticipatePin:1}}).to("#first-choosing-box",{yPercent:0,opacity:1,duration:1,ease:"power2.out"}).to("#second-choosing-box",{yPercent:0,opacity:1,duration:1,ease:"power2.out"},"-=0.5").to("#third-choosing-box",{yPercent:0,opacity:1,duration:1,ease:"power2.out"},"-=0.5")}),lt.matchMedia().add("(max-width: 991px)",()=>{let r=Array.from(document.querySelectorAll(".problem-box_wrap"));lt.matchMedia().add("(orientation: portrait)",()=>{r.forEach((t,e)=>{let n=e===r.length-1;lt.to(t,{ease:"circ.out",startAt:{filter:"brightness(100%) blur(0px)",opacity:1,scale:1},filter:n?"none":"brightness(50%) blur(10px)",opacity:n?1:0,scale:n?1:.75,scrollTrigger:{trigger:t,startTrigger:t,start:"top top",endTrigger:n?t:r[e+1],end:n?"bottom bottom":"top top-=100%",pin:!0,pinSpacing:!1,id:"pin",scrub:1,invalidateOnRefresh:!0,smoothScroll:!0}})})}),r=Array.from(document.querySelectorAll(".problem-box_wrap")),lt.matchMedia().add("(orientation: landscape)",()=>{r.forEach((t,e)=>{let n=e===r.length-1;lt.to(t,{ease:"circ.out",startAt:{filter:"brightness(100%) blur(0px)",opacity:1,scale:1},filter:n?"none":"brightness(50%) blur(10px)",opacity:n?1:0,scale:n?1:.75,scrollTrigger:{trigger:t,startTrigger:t,start:"bottom bottom",endTrigger:n?t:r[e+1],end:n?"bottom bottom":"top top-=100%",pin:!0,pinSpacing:!1,id:"pin",scrub:1,invalidateOnRefresh:!0,smoothScroll:!0}})})})})};var Qd=()=>{lt.registerPlugin(Pt),document.querySelector(".continue-txt").addEventListener("click",function(r){r.preventDefault(),document.querySelector(".compare-txt.gradient-hide").classList.add("expanded"),this.classList.add("hide")}),lt.matchMedia().add("(min-width: 992px)",()=>{document.querySelector("#compare-section")&&document.querySelectorAll(".compare-box-wrap").forEach(t=>{let e=lt.timeline({scrollTrigger:{trigger:t,start:"10% 60%",toggleActions:"play none none reverse",invalidateOnRefresh:!0,smoothScroll:!0}}),n=t.querySelector(".compare-number"),i=t.querySelector(".compare-content-heading"),s=t.querySelector(".compare-img-wrap"),o=t.querySelector(".txt-button-wrapper");n&&e.fromTo(n,{autoAlpha:0},{autoAlpha:1,duration:1,ease:"power2.out"},0),i&&e.fromTo(i,{autoAlpha:0},{autoAlpha:1,duration:1,ease:"power2.out"},0),o&&e.fromTo(o,{autoAlpha:0,y:30},{autoAlpha:1,y:0,duration:.75,ease:"power2.out"},.3),s&&e.fromTo(s,{clipPath:"inset(0 100% 0 0)"},{clipPath:"inset(0 0% 0 0)",duration:1.5,ease:"power2.out"},0)})}),lt.matchMedia().add("(max-width: 991px)",()=>{document.querySelector("#compare-section")&&document.querySelectorAll(".compare-box-wrap").forEach(t=>{let e=lt.timeline({scrollTrigger:{trigger:t,start:"top 65%",toggleActions:"play none none reverse",invalidateOnRefresh:!0}}),n=t.querySelectorAll(".compare-content-box, .txt-number-wrapper");n.length&&e.fromTo(n,{autoAlpha:0},{autoAlpha:1,duration:.8,ease:"power2.out",stagger:.2},0);let i=t.querySelector(".compare-img-wrap");i&&e.fromTo(i,{autoAlpha:0,y:50},{autoAlpha:1,y:0,duration:2,ease:"power2.out"},.3)})})};var tp=()=>{lt.registerPlugin(Pt),document.querySelectorAll(".link-contact").forEach(t=>{let e=[t.querySelector(".msg-box.is-first"),t.querySelector(".msg-box.is-second"),t.querySelector(".msg-box.is-third")],n=t.querySelector(".msg-boxes"),i=!1;lt.set(e,{opacity:0,y:20,display:"none"});function s(){let h=t.getBoundingClientRect(),d=window.innerHeight,_=h.top,g=d-h.bottom;return _>g}function o(){let h=s(),d=window.innerWidth<768,_=t.querySelector(".text-is-contact .or-txt")!==null,g=t.classList.contains("is-centered-mobile"),p;return d?g?p=h?"auto auto 2em -50%":"2em auto auto -50%":_?p=h?"auto auto 2em 1.5em":"2em auto auto 1.5em":p=h?"auto auto 2em 0%":"2em auto auto 0%":_?p=h?"auto auto 3em 1.5em":"3em auto auto 1.5em":p=h?"auto auto 3em 0%":"3em auto auto 0%",lt.set(n,{inset:p}),h}function a(h){return new Promise(d=>{lt.to(h,{display:"flex",opacity:1,y:0,duration:.05,ease:"power1.in",onComplete:d})})}function l(h){return new Promise(d=>{lt.to(h,{opacity:0,y:20,duration:.1,ease:"power1.in",onComplete:()=>{lt.set(h,{display:"none"}),d()}})})}function c(){return new Promise(h=>{lt.to(n,{y:-4,duration:.1,ease:"power1.out",yoyo:!0,repeat:1,onComplete:h})})}async function u(){let d=o()?e:[...e].reverse();for(let _ of d)await a(_);await c(),i=!0}async function f(){let d=s()?[...e].reverse():e;for(let _ of d)await l(_);i=!1}t.addEventListener("click",h=>{h.stopPropagation(),i?f():u()}),document.addEventListener("click",h=>{i&&!t.contains(h.target)&&!n.contains(h.target)&&f()}),window.addEventListener("resize",()=>{i&&o()})})};var ep=()=>{lt.registerPlugin(Pt);let r=document.querySelectorAll(".download-pitch");window.addEventListener("resize",()=>{r.forEach(t=>{let e=t.nextElementSibling;if(!(!e||!e.classList.contains("popup-msg-wrapper"))&&e.style.display==="block"){let n=document.querySelector(".is-first-contact");n&&window.innerWidth>=992?lt.set(n,{visibility:"hidden"}):n&<.set(n,{visibility:"visible"})}})}),r.forEach(t=>{let e=t.nextElementSibling;if(!e||!e.classList.contains("popup-msg-wrapper"))return;let n=e.querySelector(".corner-bottom"),i=e.querySelector(".corner-top"),s=e.querySelector(".corner-center-bottom"),o=e.querySelector(".corner-center-top"),a=e.querySelector(".popup-msg-hide"),l=document.querySelector(".is-first-contact"),c=!1;lt.set(e,{opacity:0,display:"none"});function u(){[n,i,s,o].forEach(p=>{p&&(p.classList.add("hide"),lt.set(p,{opacity:0}))})}function f(p){p&&(p.classList.remove("hide"),lt.to(p,{opacity:1,duration:.2,ease:"power1.in"}))}function h(){let p=t.getBoundingClientRect(),m=window.innerHeight,b=p.top,S=m-p.bottom;return b>S}function d(){let p=h(),m=t.classList.contains("is-center"),b=window.innerWidth<992;return u(),!b&&!m?p?(lt.set(e,{inset:"auto auto 1.5em 20em"}),f(n)):(lt.set(e,{inset:"1em auto auto 20em"}),f(i)):!b&&m?p?(lt.set(e,{inset:"auto -50% 4.5em auto"}),f(s)):(lt.set(e,{inset:"4.5em -50% auto auto"}),f(o)):b&&!m?p?(lt.set(e,{inset:"auto auto 4.5em 0%"}),f(s)):(lt.set(e,{inset:"5em auto auto 0%"}),f(o)):b&&m&&(p?(lt.set(e,{inset:"auto auto 4.5em auto"}),f(s)):(lt.set(e,{inset:"5em auto auto auto"}),f(o))),p}function _(){d(),document.querySelectorAll(".pin-spacer").forEach(m=>{m.style.zIndex="1"}),lt.to(e,{display:"block",opacity:1,duration:.2,ease:"power1.in"}),l&&window.innerWidth>=992&<.to(l,{opacity:0,duration:.2,ease:"power1.in",onComplete:()=>{lt.set(l,{visibility:"hidden"})}}),c=!0}function g(){lt.to(e,{opacity:0,duration:.2,ease:"power1.out",onComplete:()=>{lt.set(e,{display:"none"}),document.querySelectorAll(".pin-spacer").forEach(m=>{m.style.zIndex="2"})}}),l&&window.innerWidth>=992&&(lt.set(l,{visibility:"visible"}),lt.to(l,{opacity:1,duration:.2,ease:"power1.out"})),c=!1}t.addEventListener("click",p=>{p.stopPropagation(),c?g():_()}),a.addEventListener("click",p=>{p.stopPropagation(),g()}),document.addEventListener("click",p=>{let m=e.contains(p.target),b=t.contains(p.target);c&&!m&&!b&&g()})})};lt.registerPlugin(Pt);var np=()=>{let r=lt.utils.toArray(".steps_item"),t=lt.utils.toArray(".steps_item-line");if(!r)return;let e=lt.matchMedia();e.add("(min-width: 992px)",()=>{t.forEach(i=>lt.set(i,{opacity:0}));let n=lt.timeline({defaults:{duration:4,ease:"none",immediateRender:!0},scrollTrigger:{trigger:"#steps-pin",start:()=>"top top",end:"clamp(bottom+=200% bottom)",pin:!0,scrub:!0,smoothScroll:!0,toggleActions:"play reverse play reverse"}});r.forEach((i,s)=>lt.set(i,{x:`${s*-100}%`}));for(let i=1;i<=3;i++)n.to(r[i],{x:`${(i-1)*-100}%`},"<");return n.to(t[0],{opacity:1,duration:.5}),n.to(r[2],{x:0},"<"),n.to(r[3],{x:"-100%"},"<"),n.to(t[1],{opacity:1,duration:.5}),n.to(r[3],{x:0},"<"),n.to(t[2],{opacity:1,duration:.5}),n.set({},{},"+=1"),()=>{r.forEach(i=>lt.set(i,{clearProps:"all"})),t.forEach(i=>lt.set(i,{clearProps:"all"}))}}),e.add("(max-width: 991px)",()=>(r.forEach(n=>lt.set(n,{clearProps:"all"})),t.forEach(n=>lt.set(n,{clearProps:"all"})),lt.set([r,t],{opacity:0,y:50}),r.forEach((n,i)=>{lt.to(n,{scrollTrigger:{trigger:n,start:"top bottom-=100",end:"top center",toggleActions:"play none none reverse"},opacity:1,y:0,duration:.8,ease:"power2.out"}),t[i]&<.to(t[i],{scrollTrigger:{trigger:n,start:"top bottom-=100",end:"top center",toggleActions:"play none none reverse"},opacity:1,y:0,duration:.8,delay:.2,ease:"power2.out"})}),()=>{Pt.getAll().forEach(n=>n.kill()),r.forEach(n=>lt.set(n,{clearProps:"all"})),t.forEach(n=>lt.set(n,{clearProps:"all"}))}))};var Ha=function(){function r(e){this.chars=ei(e),this.sets=[],this.length=50;for(var n=0;n<20;n++)this.sets[n]=rp(80,this.chars)}var t=r.prototype;return t.grow=function(n){for(var i=0;i<20;i++)this.sets[i]+=rp(n-this.length,this.chars);this.length=n},r}(),Gr,ap,lp=function(){return Gr||typeof window<"u"&&(Gr=window.gsap)&&Gr.registerPlugin&&Gr},S0=1,ip=/\s+/g,rp=function(t,e){for(var n=e.length,i="";--t>-1;)i+=e[~~(Math.random()*n)];return i},gu="ABCDEFGHIJKLMNOPQRSTUVWXYZ",sp=gu.toLowerCase(),M0={upperCase:new Ha(gu),lowerCase:new Ha(sp),upperAndLowerCase:new Ha(gu+sp)},op=function(){ap=Gr=lp()},zo={version:"3.12.5",name:"scrambleText",register:function(t,e,n){Gr=t,op()},init:function(t,e,n,i,s){if(ap||op(),this.prop="innerHTML"in t?"innerHTML":"textContent"in t?"textContent":0,!!this.prop){this.target=t,typeof e!="object"&&(e={text:e});var o=e.text||e.value||"",a=e.trim!==!1,l=this,c,u,f,h;return l.delimiter=c=e.delimiter||"",l.original=ei(As(t).replace(ip," ").split(" ").join(""),c,a),(o==="{original}"||o===!0||o==null)&&(o=l.original.join(c)),l.text=ei((o||"").replace(ip," "),c,a),l.hasClass=!!(e.newClass||e.oldClass),l.newClass=e.newClass,l.oldClass=e.oldClass,h=c==="",l.textHasEmoji=h&&!!l.text.emoji,l.charsHaveEmoji=!!e.chars&&!!ei(e.chars).emoji,l.length=h?l.original.length:l.original.join(c).length,l.lengthDif=(h?l.text.length:l.text.join(c).length)-l.length,l.fillChar=e.fillChar||e.chars&&~e.chars.indexOf(" ")?" ":"",l.charSet=f=M0[e.chars||"upperCase"]||new Ha(e.chars),l.speed=.05/(e.speed||1),l.prevScrambleTime=0,l.setIndex=Math.random()*20|0,u=l.length+Math.max(l.lengthDif,0),u>f.length&&f.grow(u),l.chars=f.sets[l.setIndex],l.revealDelay=e.revealDelay||0,l.tweenLength=e.tweenLength!==!1,l.tween=n,l.rightToLeft=!!e.rightToLeft,l._props.push("scrambleText","text"),S0}},render:function(t,e){var n=e.target,i=e.prop,s=e.text,o=e.delimiter,a=e.tween,l=e.prevScrambleTime,c=e.revealDelay,u=e.setIndex,f=e.chars,h=e.charSet,d=e.length,_=e.textHasEmoji,g=e.charsHaveEmoji,p=e.lengthDif,m=e.tweenLength,b=e.oldClass,S=e.newClass,y=e.rightToLeft,D=e.fillChar,A=e.speed,w=e.original,P=e.hasClass,M=s.length,v=a._time,N=v-l,F,R,B,Y,H,J,O,L,C,ot,vt;c&&(a._from&&(v=a._dur-v),t=v===0?0:v<c?1e-6:v===a._dur?1:a._ease((v-c)/(a._dur-c))),t<0?t=0:t>1&&(t=1),y&&(t=1-t),F=~~(t*M+.5),t?((N>A||N<-A)&&(e.setIndex=u=(u+(Math.random()*19|0))%20,e.chars=h.sets[u],e.prevScrambleTime+=N),Y=f):Y=w.join(o),vt=a._from?t:1-t,ot=d+(m?a._from?vt*vt*vt:1-vt*vt*vt:1)*p,y?t===1&&(a._from||a.data==="isFromStart")?(B="",Y=w.join(o)):(O=s.slice(F).join(o),g?B=ei(Y).slice(0,ot-(_?ei(O):O).length+.5|0).join(""):B=Y.substr(0,ot-(_?ei(O):O).length+.5|0),Y=O):(B=s.slice(0,F).join(o),R=(_?ei(B):B).length,g?Y=ei(Y).slice(R,ot+.5|0).join(""):Y=Y.substr(R,ot-R+.5|0)),P?(L=y?b:S,C=y?S:b,H=L&&F!==0,J=C&&F!==M,O=(H?"<span class='"+L+"'>":"")+B+(H?"</span>":"")+(J?"<span class='"+C+"'>":"")+o+Y+(J?"</span>":"")):O=B+o+Y,n[i]=D===" "&&~O.indexOf(" ")?O.split(" ").join(" "):O}};zo.emojiSafeSplit=ei;zo.getText=As;lp()&&Gr.registerPlugin(zo);lt.registerPlugin(zo);var cp=()=>{document.querySelectorAll("[data-scramble-link]").forEach(t=>{let e=t.querySelector("[data-scramble-text]");if(!e)return;let n=e.textContent;t.addEventListener("mouseenter",()=>{lt.matchMedia().add("(min-width: 768px)",()=>{lt.to(e,{duration:1,scrambleText:{text:n,chars:"10"}})})})})};function up(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function b0(r,t,e){return t&&up(r.prototype,t),e&&up(r,e),r}var de,Ga,Ke,Xr,Cs,ni,w0,Wr,hp,$t,vi,Wa,fp,dp,pp,mp,gp=function(){return typeof window<"u"},_p=function(){return de||gp()&&(de=window.gsap)&&de.registerPlugin&&de};var E0=function(t){return Math.round(t*1e5)/1e5||0},ir=function(t){return $t.maxScroll(t||Ke)},T0=function(t,e){var n=t.parentNode||Cs,i=t.getBoundingClientRect(),s=n.getBoundingClientRect(),o=s.top-i.top,a=s.bottom-i.bottom,l=(Math.abs(o)>Math.abs(a)?o:a)/(1-e),c=-l*e,u,f;return l>0&&(u=s.height/(Ke.innerHeight+s.height),f=u===.5?s.height*2:Math.min(s.height,Math.abs(-l*u/(2*u-1)))*2*(e||1),c+=e?-f*e:-f/2,l+=f),{change:l,offset:c}},A0=function(t){var e=Xr.querySelector(".ScrollSmoother-wrapper");return e||(e=Xr.createElement("div"),e.classList.add("ScrollSmoother-wrapper"),t.parentNode.insertBefore(e,t),e.appendChild(t)),e},Li=function(){function r(t){var e=this;Ga||r.register(de)||console.warn("Please gsap.registerPlugin(ScrollSmoother)"),t=this.vars=t||{},vi&&vi.kill(),vi=this,pp(this);var n=t,i=n.smoothTouch,s=n.onUpdate,o=n.onStop,a=n.smooth,l=n.onFocusIn,c=n.normalizeScroll,u=n.wholePixels,f,h,d,_,g,p,m,b,S,y,D,A,w,P,M=this,v=t.effectsPrefix||"",N=$t.getScrollFunc(Ke),F=$t.isTouch===1?i===!0?.8:parseFloat(i)||0:a===0||a===!1?0:parseFloat(a)||.8,R=F&&+t.speed||1,B=0,Y=0,H=1,J=fp(0),O=function(){return J.update(-B)},L={y:0},C=function(){return f.style.overflow="visible"},ot,vt=function(x){x.update();var I=x.getTween();I&&(I.pause(),I._time=I._dur,I._tTime=I._tDur),ot=!1,x.animation.progress(x.progress,!0)},Wt=function(x,I){(x!==B&&!y||I)&&(u&&(x=Math.round(x)),F&&(f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+x+", 0, 1)",f._gsap.y=x+"px"),Y=x-B,B=x,$t.isUpdating||r.isRefreshing||$t.update())},q=function(x){return arguments.length?(x<0&&(x=0),L.y=-x,ot=!0,y?B=-x:Wt(-x),$t.isRefreshing?_.update():N(x/R),this):-B},tt=typeof ResizeObserver<"u"&&t.autoResize!==!1&&new ResizeObserver(function(){if(!$t.isRefreshing){var T=ir(h)*R;T<-B&&q(T),mp.restart(!0)}}),pt,st=function(x){h.scrollTop=0,!(x.target.contains&&x.target.contains(h)||l&&l(e,x)===!1)&&($t.isInViewport(x.target)||x.target===pt||e.scrollTo(x.target,!1,"center center"),pt=x.target)},Ft=function(x,I){if(x<I.start)return x;var G=isNaN(I.ratio)?1:I.ratio,K=I.end-I.start,Q=x-I.start,ht=I.offset||0,ct=I.pins||[],nt=ct.offset||0,bt=I._startClamp&&I.start<=0||I.pins&&I.pins.offset?0:I._endClamp&&I.end===ir()?1:.5;return ct.forEach(function(rt){K-=rt.distance,rt.nativeStart<=x&&(Q-=rt.distance)}),nt&&(Q*=(K-nt/G)/K),x+(Q-ht*bt)/G-Q},Nt=function T(x,I,G){G||(x.pins.length=x.pins.offset=0);var K=x.pins,Q=x.markers,ht,ct,nt,bt,rt,ft,Ot,it;for(Ot=0;Ot<I.length;Ot++)if(it=I[Ot],x.trigger&&it.trigger&&x!==it&&(it.trigger===x.trigger||it.pinnedContainer===x.trigger||x.trigger.contains(it.trigger))&&(rt=it._startNative||it._startClamp||it.start,ft=it._endNative||it._endClamp||it.end,nt=Ft(rt,x),bt=it.pin&&ft>0?nt+(ft-rt):Ft(ft,x),it.setPositions(nt,bt,!0,(it._startClamp?Math.max(0,nt):nt)-rt),it.markerStart&&Q.push(de.quickSetter([it.markerStart,it.markerEnd],"y","px")),it.pin&&it.end>0&&!G)){if(ht=it.end-it.start,ct=x._startClamp&&it.start<0,ct){if(x.start>0){x.setPositions(0,x.end+(x._startNative-x.start),!0),T(x,I);return}ht+=it.start,K.offset=-it.start}K.push({start:it.start,nativeStart:rt,end:it.end,distance:ht,trig:it}),x.setPositions(x.start,x.end+(ct?-it.start:ht),!0)}},V=function(x,I){g.forEach(function(G){return Nt(G,x,I)})},Yt=function(){C(),requestAnimationFrame(C),g&&($t.getAll().forEach(function(x){x._startNative=x.start,x._endNative=x.end}),g.forEach(function(x){var I=x._startClamp||x.start,G=x.autoSpeed?Math.min(ir(),x.end):I+Math.abs((x.end-I)/x.ratio),K=G-x.end;if(I-=K/2,G-=K/2,I>G){var Q=I;I=G,G=Q}x._startClamp&&I<0?(G=x.ratio<0?ir():x.end/x.ratio,K=G-x.end,I=0):(x.ratio<0||x._endClamp&&G>=ir())&&(G=ir(),I=x.ratio<0||x.ratio>1?0:G-(G-x.start)/x.ratio,K=(G-I)*x.ratio-(x.end-x.start)),x.offset=K||1e-4,x.pins.length=x.pins.offset=0,x.setPositions(I,G,!0)}),V($t.sort())),J.reset()},Et=function(){return $t.addEventListener("refresh",Yt)},Tt=function(){return g&&g.forEach(function(x){return x.vars.onRefresh(x)})},St=function(){return g&&g.forEach(function(x){return x.vars.onRefreshInit(x)}),Tt},zt=function(x,I,G,K){return function(){var Q=typeof I=="function"?I(G,K):I;Q||Q===0||(Q=K.getAttribute("data-"+v+x)||(x==="speed"?1:0)),K.setAttribute("data-"+v+x,Q);var ht=(Q+"").substr(0,6)==="clamp(";return{clamp:ht,value:ht?Q.substr(6,Q.length-7):Q}}},Ut=function(x,I,G,K,Q){Q=(typeof Q=="function"?Q(K,x):Q)||0;var ht=zt("speed",I,K,x),ct=zt("lag",G,K,x),nt=de.getProperty(x,"y"),bt=x._gsap,rt,ft,Ot,it,yt,Bt,Vt=[],he=function(){I=ht(),G=parseFloat(ct().value),rt=parseFloat(I.value)||1,Ot=I.value==="auto",yt=Ot||ft&&ft._startClamp&&ft.start<=0||Vt.offset?0:ft&&ft._endClamp&&ft.end===ir()?1:.5,it&&it.kill(),it=G&&de.to(x,{ease:Wa,overwrite:!1,y:"+=0",duration:G}),ft&&(ft.ratio=rt,ft.autoSpeed=Ot)},kt=function(){bt.y=nt+"px",bt.renderTransform(1),he()},U=[],$=0,et=function(at){if(Ot){kt();var Dt=T0(x,hp(0,1,-at.start/(at.end-at.start)));$=Dt.change,Bt=Dt.offset}else Bt=Vt.offset||0,$=(at.end-at.start-Bt)*(1-rt);Vt.forEach(function(te){return $-=te.distance*(1-rt)}),at.offset=$||.001,at.vars.onUpdate(at),it&&it.progress(1)};return he(),(rt!==1||Ot||it)&&(ft=$t.create({trigger:Ot?x.parentNode:x,start:function(){return I.clamp?"clamp(top bottom+="+Q+")":"top bottom+="+Q},end:function(){return I.value<0?"max":I.clamp?"clamp(bottom top-="+Q+")":"bottom top-="+Q},scroller:h,scrub:!0,refreshPriority:-999,onRefreshInit:kt,onRefresh:et,onKill:function(at){var Dt=g.indexOf(at);Dt>=0&&g.splice(Dt,1),kt()},onUpdate:function(at){var Dt=nt+$*(at.progress-yt),te=Vt.length,ae=0,re,Zt,Ct;if(at.offset){if(te){for(Zt=-B,Ct=at.end;te--;){if(re=Vt[te],re.trig.isActive||Zt>=re.start&&Zt<=re.end){it&&(re.trig.progress+=re.trig.direction<0?.001:-.001,re.trig.update(0,0,1),it.resetTo("y",parseFloat(bt.y),-Y,!0),H&&it.progress(1));return}Zt>re.end&&(ae+=re.distance),Ct-=re.distance}Dt=nt+ae+$*((de.utils.clamp(at.start,at.end,Zt)-at.start-ae)/(Ct-at.start)-yt)}U.length&&!Ot&&U.forEach(function(Mt){return Mt(Dt-ae)}),Dt=E0(Dt+Bt),it?(it.resetTo("y",Dt,-Y,!0),H&&it.progress(1)):(bt.y=Dt+"px",bt.renderTransform(1))}}}),et(ft),de.core.getCache(ft.trigger).stRevert=St,ft.startY=nt,ft.pins=Vt,ft.markers=U,ft.ratio=rt,ft.autoSpeed=Ot,x.style.willChange="transform"),ft};Et(),$t.addEventListener("killAll",Et),de.delayedCall(.5,function(){return H=0}),this.scrollTop=q,this.scrollTo=function(T,x,I){var G=de.utils.clamp(0,ir(),isNaN(T)?e.offset(T,I,!!x&&!y):+T);x?y?de.to(e,{duration:F,scrollTop:G,overwrite:"auto",ease:Wa}):N(G):q(G)},this.offset=function(T,x,I){T=Wr(T)[0];var G=T.style.cssText,K=$t.create({trigger:T,start:x||"top top"}),Q;return g&&(H?$t.refresh():V([K],!0)),Q=K.start/(I?R:1),K.kill(!1),T.style.cssText=G,de.core.getCache(T).uncache=1,Q};function k(){return d=f.clientHeight,f.style.overflow="visible",ni.style.height=Ke.innerHeight+(d-Ke.innerHeight)/R+"px",d-Ke.innerHeight}this.content=function(T){if(arguments.length){var x=Wr(T||"#smooth-content")[0]||console.warn("ScrollSmoother needs a valid content element.")||ni.children[0];return x!==f&&(f=x,S=f.getAttribute("style")||"",tt&&tt.observe(f),de.set(f,{overflow:"visible",width:"100%",boxSizing:"border-box",y:"+=0"}),F||de.set(f,{clearProps:"transform"})),this}return f},this.wrapper=function(T){return arguments.length?(h=Wr(T||"#smooth-wrapper")[0]||A0(f),b=h.getAttribute("style")||"",k(),de.set(h,F?{overflow:"hidden",position:"fixed",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0}:{overflow:"visible",position:"relative",width:"100%",height:"auto",top:"auto",bottom:"auto",left:"auto",right:"auto"}),this):h},this.effects=function(T,x){var I;if(g||(g=[]),!T)return g.slice(0);T=Wr(T),T.forEach(function(rt){for(var ft=g.length;ft--;)g[ft].trigger===rt&&g[ft].kill()}),x=x||{};var G=x,K=G.speed,Q=G.lag,ht=G.effectsPadding,ct=[],nt,bt;for(nt=0;nt<T.length;nt++)bt=Ut(T[nt],K,Q,nt,ht),bt&&ct.push(bt);return(I=g).push.apply(I,ct),x.refresh!==!1&&$t.refresh(),ct},this.sections=function(T,x){var I;if(p||(p=[]),!T)return p.slice(0);var G=Wr(T).map(function(K){return $t.create({trigger:K,start:"top 120%",end:"bottom -20%",onToggle:function(ht){K.style.opacity=ht.isActive?"1":"0",K.style.pointerEvents=ht.isActive?"all":"none"}})});return x&&x.add?(I=p).push.apply(I,G):p=G.slice(0),G},this.content(t.content),this.wrapper(t.wrapper),this.render=function(T){return Wt(T||T===0?T:B)},this.getVelocity=function(){return J.getVelocity(-B)},$t.scrollerProxy(h,{scrollTop:q,scrollHeight:function(){return k()&&ni.scrollHeight},fixedMarkers:t.fixedMarkers!==!1&&!!F,content:f,getBoundingClientRect:function(){return{top:0,left:0,width:Ke.innerWidth,height:Ke.innerHeight}}}),$t.defaults({scroller:h});var Qt=$t.getAll().filter(function(T){return T.scroller===Ke||T.scroller===h});Qt.forEach(function(T){return T.revert(!0,!0)}),_=$t.create({animation:de.fromTo(L,{y:function(){return P=0,0}},{y:function(){return P=1,-k()},immediateRender:!1,ease:"none",data:"ScrollSmoother",duration:100,onUpdate:function(){if(P){var x=ot;x&&(vt(_),L.y=B),Wt(L.y,x),O(),s&&!y&&s(M)}}}),onRefreshInit:function(x){if(!r.isRefreshing){if(r.isRefreshing=!0,g){var I=$t.getAll().filter(function(K){return!!K.pin});g.forEach(function(K){K.vars.pinnedContainer||I.forEach(function(Q){if(Q.pin.contains(K.trigger)){var ht=K.vars;ht.pinnedContainer=Q.pin,K.vars=null,K.init(ht,K.animation)}})})}var G=x.getTween();w=G&&G._end>G._dp._time,A=B,L.y=0,F&&($t.isTouch===1&&(h.style.position="absolute"),h.scrollTop=0,$t.isTouch===1&&(h.style.position="fixed"))}},onRefresh:function(x){x.animation.invalidate(),x.setPositions(x.start,k()/R),w||vt(x),L.y=-N()*R,Wt(L.y),H||(w&&(ot=!1),x.animation.progress(de.utils.clamp(0,1,A/R/-x.end))),w&&(x.progress-=.001,x.update()),r.isRefreshing=!1},id:"ScrollSmoother",scroller:Ke,invalidateOnRefresh:!0,start:0,refreshPriority:-9999,end:function(){return k()/R},onScrubComplete:function(){J.reset(),o&&o(e)},scrub:F||!0}),this.smooth=function(T){return arguments.length&&(F=T||0,R=F&&+t.speed||1,_.scrubDuration(T)),_.getTween()?_.getTween().duration():0},_.getTween()&&(_.getTween().vars.ease=t.ease||Wa),this.scrollTrigger=_,t.effects&&this.effects(t.effects===!0?"[data-"+v+"speed], [data-"+v+"lag]":t.effects,{effectsPadding:t.effectsPadding,refresh:!1}),t.sections&&this.sections(t.sections===!0?"[data-section]":t.sections),Qt.forEach(function(T){T.vars.scroller=h,T.revert(!1,!0),T.init(T.vars,T.animation)}),this.paused=function(T,x){return arguments.length?(!!y!==T&&(T?(_.getTween()&&_.getTween().pause(),N(-B/R),J.reset(),D=$t.normalizeScroll(),D&&D.disable(),y=$t.observe({preventDefault:!0,type:"wheel,touch,scroll",debounce:!1,allowClicks:!0,onChangeY:function(){return q(-B)}}),y.nested=dp(Cs,"wheel,touch,scroll",!0,x!==!1)):(y.nested.kill(),y.kill(),y=0,D&&D.enable(),_.progress=(-B/R-_.start)/(_.end-_.start),vt(_))),this):!!y},this.kill=this.revert=function(){e.paused(!1),vt(_),_.kill();for(var T=(g||[]).concat(p||[]),x=T.length;x--;)T[x].kill();$t.scrollerProxy(h),$t.removeEventListener("killAll",Et),$t.removeEventListener("refresh",Yt),h.style.cssText=b,f.style.cssText=S;var I=$t.defaults({});I&&I.scroller===h&&$t.defaults({scroller:Ke}),e.normalizer&&$t.normalizeScroll(!1),clearInterval(m),vi=null,tt&&tt.disconnect(),ni.style.removeProperty("height"),Ke.removeEventListener("focusin",st)},this.refresh=function(T,x){return _.refresh(T,x)},c&&(this.normalizer=$t.normalizeScroll(c===!0?{debounce:!0,content:!F&&f}:c)),$t.config(t),"overscrollBehavior"in Ke.getComputedStyle(ni)&&de.set([ni,Cs],{overscrollBehavior:"none"}),"scrollBehavior"in Ke.getComputedStyle(ni)&&de.set([ni,Cs],{scrollBehavior:"auto"}),Ke.addEventListener("focusin",st),m=setInterval(O,250),Xr.readyState==="loading"||requestAnimationFrame(function(){return $t.refresh()})}return r.register=function(e){return Ga||(de=e||_p(),gp()&&window.document&&(Ke=window,Xr=document,Cs=Xr.documentElement,ni=Xr.body),de&&(Wr=de.utils.toArray,hp=de.utils.clamp,Wa=de.parseEase("expo"),pp=de.core.context||function(){},$t=de.core.globals().ScrollTrigger,de.core.globals("ScrollSmoother",r),ni&&$t&&(mp=de.delayedCall(.2,function(){return $t.isRefreshing||vi&&vi.refresh()}).pause(),w0=[Ke,Xr,Cs,ni],fp=$t.core._getVelocityProp,dp=$t.core._inputObserver,r.refresh=$t.refresh,Ga=1))),Ga},b0(r,[{key:"progress",get:function(){return this.scrollTrigger?this.scrollTrigger.animation._time/100:0}}]),r}();Li.version="3.12.5";Li.create=function(r){return vi&&r&&vi.content()===Wr(r.content)[0]?vi:new Li(r)};Li.get=function(){return vi};_p()&&de.registerPlugin(Li);lt.registerPlugin(Li,Pt);var xp=()=>{lt.registerPlugin(Li),Li.create({smooth:1.5,effects:!0}),Pt.refresh()};var Fh="164";var D0=0,vp=1,C0=2;var Xm=1,Nh=2,zi=3,gr=0,Cn=1,Vi=2,dr=0,pr=1,yp=2,Sp=3,Mp=4,R0=5,Qr=100,P0=101,I0=102,L0=103,F0=104,N0=200,U0=201,O0=202,B0=203,Ku=204,ju=205,z0=206,k0=207,V0=208,H0=209,G0=210,W0=211,X0=212,q0=213,Y0=214,Z0=0,J0=1,$0=2,gl=3,K0=4,j0=5,Q0=6,tx=7,qm=0,ex=1,nx=2,mr=0,ix=1,rx=2,sx=3,ox=4,ax=5,lx=6,cx=7;var Ym=300,js=301,Qs=302,Qu=303,th=304,Gl=306,eh=1e3,es=1001,nh=1002,Yn=1003,ux=1004;var Xa=1005;var oi=1006,_u=1007;var ns=1008;var _r=1009,hx=1010,fx=1011,Zm=1012,Jm=1013,to=1014,hr=1015,Wl=1016,$m=1017,Km=1018,Ko=1020,dx=35902,px=1021,mx=1022,Si=1023,gx=1024,_x=1025,Js=1026,Yo=1027,xx=1028,jm=1029,vx=1030,Qm=1031,tg=1033,xu=33776,vu=33777,yu=33778,Su=33779,bp=35840,wp=35841,Ep=35842,Tp=35843,Ap=36196,Dp=37492,Cp=37496,Rp=37808,Pp=37809,Ip=37810,Lp=37811,Fp=37812,Np=37813,Up=37814,Op=37815,Bp=37816,zp=37817,kp=37818,Vp=37819,Hp=37820,Gp=37821,Mu=36492,Wp=36494,Xp=36495,yx=36283,qp=36284,Yp=36285,Zp=36286;var _l=2300,xl=2301,bu=2302,Jp=2400,$p=2401,Kp=2402;var Sx=3200,Mx=3201,bx=0,wx=1,ur="",qn="srgb",yr="srgb-linear",Uh="display-p3",Xl="display-p3-linear",vl="linear",ye="srgb",yl="rec709",Sl="p3";var Rs=7680;var jp=519,Ex=512,Tx=513,Ax=514,eg=515,Dx=516,Cx=517,Rx=518,Px=519,Qp=35044;var tm="300 es",Hi=2e3,Ml=2001,xr=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let i=this._listeners[t];if(i!==void 0){let s=i.indexOf(e);s!==-1&&i.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let n=this._listeners[t.type];if(n!==void 0){t.target=this;let i=n.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,t);t.target=null}}},an=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var wu=Math.PI/180,ih=180/Math.PI;function jo(){let r=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(an[r&255]+an[r>>8&255]+an[r>>16&255]+an[r>>24&255]+"-"+an[t&255]+an[t>>8&255]+"-"+an[t>>16&15|64]+an[t>>24&255]+"-"+an[e&63|128]+an[e>>8&255]+"-"+an[e>>16&255]+an[e>>24&255]+an[n&255]+an[n>>8&255]+an[n>>16&255]+an[n>>24&255]).toLowerCase()}function Dn(r,t,e){return Math.max(t,Math.min(e,r))}function Ix(r,t){return(r%t+t)%t}function Eu(r,t,e){return(1-e)*r+e*t}function ko(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function An(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var ue=class r{constructor(t=0,e=0){r.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(Dn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),i=Math.sin(e),s=this.x-t.x,o=this.y-t.y;return this.x=s*n-o*i+t.x,this.y=s*i+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},jt=class r{constructor(t,e,n,i,s,o,a,l,c){r.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,o,a,l,c)}set(t,e,n,i,s,o,a,l,c){let u=this.elements;return u[0]=t,u[1]=i,u[2]=a,u[3]=e,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],f=n[7],h=n[2],d=n[5],_=n[8],g=i[0],p=i[3],m=i[6],b=i[1],S=i[4],y=i[7],D=i[2],A=i[5],w=i[8];return s[0]=o*g+a*b+l*D,s[3]=o*p+a*S+l*A,s[6]=o*m+a*y+l*w,s[1]=c*g+u*b+f*D,s[4]=c*p+u*S+f*A,s[7]=c*m+u*y+f*w,s[2]=h*g+d*b+_*D,s[5]=h*p+d*S+_*A,s[8]=h*m+d*y+_*w,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return e*o*u-e*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],f=u*o-a*c,h=a*l-u*s,d=c*s-o*l,_=e*f+n*h+i*d;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let g=1/_;return t[0]=f*g,t[1]=(i*c-u*n)*g,t[2]=(a*n-i*o)*g,t[3]=h*g,t[4]=(u*e-i*l)*g,t[5]=(i*s-a*e)*g,t[6]=d*g,t[7]=(n*l-c*e)*g,t[8]=(o*e-n*s)*g,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+t,-i*c,i*l,-i*(-c*o+l*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(Tu.makeScale(t,e)),this}rotate(t){return this.premultiply(Tu.makeRotation(-t)),this}translate(t,e){return this.premultiply(Tu.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},Tu=new jt;function ng(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}function bl(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function Lx(){let r=bl("canvas");return r.style.display="block",r}var em={};function Fx(r){r in em||(em[r]=!0,console.warn(r))}var nm=new jt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),im=new jt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),qa={[yr]:{transfer:vl,primaries:yl,toReference:r=>r,fromReference:r=>r},[qn]:{transfer:ye,primaries:yl,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[Xl]:{transfer:vl,primaries:Sl,toReference:r=>r.applyMatrix3(im),fromReference:r=>r.applyMatrix3(nm)},[Uh]:{transfer:ye,primaries:Sl,toReference:r=>r.convertSRGBToLinear().applyMatrix3(im),fromReference:r=>r.applyMatrix3(nm).convertLinearToSRGB()}},Nx=new Set([yr,Xl]),me={enabled:!0,_workingColorSpace:yr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!Nx.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,t,e){if(this.enabled===!1||t===e||!t||!e)return r;let n=qa[t].toReference,i=qa[e].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,t){return this.convert(r,this._workingColorSpace,t)},toWorkingColorSpace:function(r,t){return this.convert(r,t,this._workingColorSpace)},getPrimaries:function(r){return qa[r].primaries},getTransfer:function(r){return r===ur?vl:qa[r].transfer}};function $s(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Au(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var Ps,rh=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{Ps===void 0&&(Ps=bl("canvas")),Ps.width=t.width,Ps.height=t.height;let n=Ps.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Ps}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=bl("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let i=n.getImageData(0,0,t.width,t.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=$s(s[o]/255)*255;return n.putImageData(i,0,0),e}else if(t.data){let e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor($s(e[n]/255)*255):e[n]=$s(e[n]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},Ux=0,wl=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Ux++}),this.uuid=jo(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o<a;o++)i[o].isDataTexture?s.push(Du(i[o].image)):s.push(Du(i[o]))}else s=Du(i);n.url=s}return e||(t.images[this.uuid]=n),n}};function Du(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?rh.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Ox=0,$n=class r extends xr{constructor(t=r.DEFAULT_IMAGE,e=r.DEFAULT_MAPPING,n=es,i=es,s=oi,o=ns,a=Si,l=_r,c=r.DEFAULT_ANISOTROPY,u=ur){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Ox++}),this.uuid=jo(),this.name="",this.source=new wl(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new ue(0,0),this.repeat=new ue(1,1),this.center=new ue(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new jt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Ym)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case eh:t.x=t.x-Math.floor(t.x);break;case es:t.x=t.x<0?0:1;break;case nh:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case eh:t.y=t.y-Math.floor(t.y);break;case es:t.y=t.y<0?0:1;break;case nh:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};$n.DEFAULT_IMAGE=null;$n.DEFAULT_MAPPING=Ym;$n.DEFAULT_ANISOTROPY=1;var Ye=class r{constructor(t=0,e=0,n=0,i=1){r.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,s,l=t.elements,c=l[0],u=l[4],f=l[8],h=l[1],d=l[5],_=l[9],g=l[2],p=l[6],m=l[10];if(Math.abs(u-h)<.01&&Math.abs(f-g)<.01&&Math.abs(_-p)<.01){if(Math.abs(u+h)<.1&&Math.abs(f+g)<.1&&Math.abs(_+p)<.1&&Math.abs(c+d+m-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let S=(c+1)/2,y=(d+1)/2,D=(m+1)/2,A=(u+h)/4,w=(f+g)/4,P=(_+p)/4;return S>y&&S>D?S<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(S),i=A/n,s=w/n):y>D?y<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(y),n=A/i,s=P/i):D<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(D),n=w/s,i=P/s),this.set(n,i,s,e),this}let b=Math.sqrt((p-_)*(p-_)+(f-g)*(f-g)+(h-u)*(h-u));return Math.abs(b)<.001&&(b=1),this.x=(p-_)/b,this.y=(f-g)/b,this.z=(h-u)/b,this.w=Math.acos((c+d+m-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},sh=class extends xr{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Ye(0,0,t,e),this.scissorTest=!1,this.viewport=new Ye(0,0,t,e);let i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:oi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);let s=new $n(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];let o=n.count;for(let a=0;a<o;a++)this.textures[a]=s.clone(),this.textures[a].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let n=0,i=t.textures.length;n<i;n++)this.textures[n]=t.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;let e=Object.assign({},t.texture.image);return this.texture.source=new wl(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},Gi=class extends sh{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}},El=class extends $n{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=Yn,this.minFilter=Yn,this.wrapR=es,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var oh=class extends $n{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=Yn,this.minFilter=Yn,this.wrapR=es,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var vr=class{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,s,o,a){let l=n[i+0],c=n[i+1],u=n[i+2],f=n[i+3],h=s[o+0],d=s[o+1],_=s[o+2],g=s[o+3];if(a===0){t[e+0]=l,t[e+1]=c,t[e+2]=u,t[e+3]=f;return}if(a===1){t[e+0]=h,t[e+1]=d,t[e+2]=_,t[e+3]=g;return}if(f!==g||l!==h||c!==d||u!==_){let p=1-a,m=l*h+c*d+u*_+f*g,b=m>=0?1:-1,S=1-m*m;if(S>Number.EPSILON){let D=Math.sqrt(S),A=Math.atan2(D,m*b);p=Math.sin(p*A)/D,a=Math.sin(a*A)/D}let y=a*b;if(l=l*p+h*y,c=c*p+d*y,u=u*p+_*y,f=f*p+g*y,p===1-a){let D=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=D,c*=D,u*=D,f*=D}}t[e]=l,t[e+1]=c,t[e+2]=u,t[e+3]=f}static multiplyQuaternionsFlat(t,e,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],f=s[o],h=s[o+1],d=s[o+2],_=s[o+3];return t[e]=a*_+u*f+l*d-c*h,t[e+1]=l*_+u*h+c*f-a*d,t[e+2]=c*_+u*d+a*h-l*f,t[e+3]=u*_-a*f-l*h-c*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let n=t._x,i=t._y,s=t._z,o=t._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),f=a(s/2),h=l(n/2),d=l(i/2),_=l(s/2);switch(o){case"XYZ":this._x=h*u*f+c*d*_,this._y=c*d*f-h*u*_,this._z=c*u*_+h*d*f,this._w=c*u*f-h*d*_;break;case"YXZ":this._x=h*u*f+c*d*_,this._y=c*d*f-h*u*_,this._z=c*u*_-h*d*f,this._w=c*u*f+h*d*_;break;case"ZXY":this._x=h*u*f-c*d*_,this._y=c*d*f+h*u*_,this._z=c*u*_+h*d*f,this._w=c*u*f-h*d*_;break;case"ZYX":this._x=h*u*f-c*d*_,this._y=c*d*f+h*u*_,this._z=c*u*_-h*d*f,this._w=c*u*f+h*d*_;break;case"YZX":this._x=h*u*f+c*d*_,this._y=c*d*f+h*u*_,this._z=c*u*_-h*d*f,this._w=c*u*f-h*d*_;break;case"XZY":this._x=h*u*f-c*d*_,this._y=c*d*f-h*u*_,this._z=c*u*_+h*d*f,this._w=c*u*f+h*d*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],i=e[4],s=e[8],o=e[1],a=e[5],l=e[9],c=e[2],u=e[6],f=e[10],h=n+a+f;if(h>0){let d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(u-l)*d,this._y=(s-c)*d,this._z=(o-i)*d}else if(n>a&&n>f){let d=2*Math.sqrt(1+n-a-f);this._w=(u-l)/d,this._x=.25*d,this._y=(i+o)/d,this._z=(s+c)/d}else if(a>f){let d=2*Math.sqrt(1+a-n-f);this._w=(s-c)/d,this._x=(i+o)/d,this._y=.25*d,this._z=(l+u)/d}else{let d=2*Math.sqrt(1+f-n-a);this._w=(o-i)/d,this._x=(s+c)/d,this._y=(l+u)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Dn(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,i=t._y,s=t._z,o=t._w,a=e._x,l=e._y,c=e._z,u=e._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*t._w+n*t._x+i*t._y+s*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let d=1-e;return this._w=d*o+e*this._w,this._x=d*n+e*this._x,this._y=d*i+e*this._y,this._z=d*s+e*this._z,this.normalize(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),f=Math.sin((1-e)*u)/c,h=Math.sin(e*u)/c;return this._w=o*f+this._w*h,this._x=n*f+this._x*h,this._y=i*f+this._y*h,this._z=s*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},j=class r{constructor(t=0,e=0,n=0){r.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(rm.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(rm.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*i,this.y=s[1]*e+s[4]*n+s[7]*i,this.z=s[2]*e+s[5]*n+s[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=t.elements,o=1/(s[3]*e+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*e+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*e+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(t){let e=this.x,n=this.y,i=this.z,s=t.x,o=t.y,a=t.z,l=t.w,c=2*(o*i-a*n),u=2*(a*e-s*i),f=2*(s*n-o*e);return this.x=e+l*c+o*f-a*u,this.y=n+l*u+a*c-s*f,this.z=i+l*f+s*u-o*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i,this.y=s[1]*e+s[5]*n+s[9]*i,this.z=s[2]*e+s[6]*n+s[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,i=t.y,s=t.z,o=e.x,a=e.y,l=e.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Cu.copy(this).projectOnVector(t),this.sub(Cu)}reflect(t){return this.sub(Cu.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(Dn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},Cu=new j,rm=new vr,is=class{constructor(t=new j(1/0,1/0,1/0),e=new j(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(ii.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(ii.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let n=ii.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let n=t.geometry;if(n!==void 0){let s=n.getAttribute("position");if(e===!0&&s!==void 0&&t.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)t.isMesh===!0?t.getVertexPosition(o,ii):ii.fromBufferAttribute(s,o),ii.applyMatrix4(t.matrixWorld),this.expandByPoint(ii);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Ya.copy(t.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Ya.copy(n.boundingBox)),Ya.applyMatrix4(t.matrixWorld),this.union(Ya)}let i=t.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,ii),ii.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Vo),Za.subVectors(this.max,Vo),Is.subVectors(t.a,Vo),Ls.subVectors(t.b,Vo),Fs.subVectors(t.c,Vo),rr.subVectors(Ls,Is),sr.subVectors(Fs,Ls),qr.subVectors(Is,Fs);let e=[0,-rr.z,rr.y,0,-sr.z,sr.y,0,-qr.z,qr.y,rr.z,0,-rr.x,sr.z,0,-sr.x,qr.z,0,-qr.x,-rr.y,rr.x,0,-sr.y,sr.x,0,-qr.y,qr.x,0];return!Ru(e,Is,Ls,Fs,Za)||(e=[1,0,0,0,1,0,0,0,1],!Ru(e,Is,Ls,Fs,Za))?!1:(Ja.crossVectors(rr,sr),e=[Ja.x,Ja.y,Ja.z],Ru(e,Is,Ls,Fs,Za))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,ii).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(ii).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Fi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Fi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Fi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Fi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Fi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Fi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Fi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Fi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Fi),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},Fi=[new j,new j,new j,new j,new j,new j,new j,new j],ii=new j,Ya=new is,Is=new j,Ls=new j,Fs=new j,rr=new j,sr=new j,qr=new j,Vo=new j,Za=new j,Ja=new j,Yr=new j;function Ru(r,t,e,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){Yr.fromArray(r,s);let a=i.x*Math.abs(Yr.x)+i.y*Math.abs(Yr.y)+i.z*Math.abs(Yr.z),l=t.dot(Yr),c=e.dot(Yr),u=n.dot(Yr);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var Bx=new is,Ho=new j,Pu=new j,eo=class{constructor(t=new j,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let n=this.center;e!==void 0?n.copy(e):Bx.setFromPoints(t).getCenter(n);let i=0;for(let s=0,o=t.length;s<o;s++)i=Math.max(i,n.distanceToSquared(t[s]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Ho.subVectors(t,this.center);let e=Ho.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(Ho,i/n),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(Pu.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Ho.copy(t.center).add(Pu)),this.expandByPoint(Ho.copy(t.center).sub(Pu))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},Ni=new j,Iu=new j,$a=new j,or=new j,Lu=new j,Ka=new j,Fu=new j,Tl=class{constructor(t=new j,e=new j(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Ni)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=Ni.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Ni.copy(this.origin).addScaledVector(this.direction,e),Ni.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){Iu.copy(t).add(e).multiplyScalar(.5),$a.copy(e).sub(t).normalize(),or.copy(this.origin).sub(Iu);let s=t.distanceTo(e)*.5,o=-this.direction.dot($a),a=or.dot(this.direction),l=-or.dot($a),c=or.lengthSq(),u=Math.abs(1-o*o),f,h,d,_;if(u>0)if(f=o*l-a,h=o*a-l,_=s*u,f>=0)if(h>=-_)if(h<=_){let g=1/u;f*=g,h*=g,d=f*(f+o*h+2*a)+h*(o*f+h+2*l)+c}else h=s,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;else h=-s,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;else h<=-_?(f=Math.max(0,-(-o*s+a)),h=f>0?-s:Math.min(Math.max(-s,-l),s),d=-f*f+h*(h+2*l)+c):h<=_?(f=0,h=Math.min(Math.max(-s,-l),s),d=h*(h+2*l)+c):(f=Math.max(0,-(o*s+a)),h=f>0?s:Math.min(Math.max(-s,-l),s),d=-f*f+h*(h+2*l)+c);else h=o>0?-s:s,f=Math.max(0,-(o*h+a)),d=-f*f+h*(h+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(Iu).addScaledVector($a,h),d}intersectSphere(t,e){Ni.subVectors(t.center,this.origin);let n=Ni.dot(this.direction),i=Ni.dot(Ni)-n*n,s=t.radius*t.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return l<0?null:a<0?this.at(l,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,h=this.origin;return c>=0?(n=(t.min.x-h.x)*c,i=(t.max.x-h.x)*c):(n=(t.max.x-h.x)*c,i=(t.min.x-h.x)*c),u>=0?(s=(t.min.y-h.y)*u,o=(t.max.y-h.y)*u):(s=(t.max.y-h.y)*u,o=(t.min.y-h.y)*u),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),f>=0?(a=(t.min.z-h.z)*f,l=(t.max.z-h.z)*f):(a=(t.max.z-h.z)*f,l=(t.min.z-h.z)*f),n>l||a>i)||((a>n||n!==n)&&(n=a),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,Ni)!==null}intersectTriangle(t,e,n,i,s){Lu.subVectors(e,t),Ka.subVectors(n,t),Fu.crossVectors(Lu,Ka);let o=this.direction.dot(Fu),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;or.subVectors(this.origin,t);let l=a*this.direction.dot(Ka.crossVectors(or,Ka));if(l<0)return null;let c=a*this.direction.dot(Lu.cross(or));if(c<0||l+c>o)return null;let u=-a*or.dot(Fu);return u<0?null:this.at(u/o,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Le=class r{constructor(t,e,n,i,s,o,a,l,c,u,f,h,d,_,g,p){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,o,a,l,c,u,f,h,d,_,g,p)}set(t,e,n,i,s,o,a,l,c,u,f,h,d,_,g,p){let m=this.elements;return m[0]=t,m[4]=e,m[8]=n,m[12]=i,m[1]=s,m[5]=o,m[9]=a,m[13]=l,m[2]=c,m[6]=u,m[10]=f,m[14]=h,m[3]=d,m[7]=_,m[11]=g,m[15]=p,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new r().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,i=1/Ns.setFromMatrixColumn(t,0).length(),s=1/Ns.setFromMatrixColumn(t,1).length(),o=1/Ns.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,i=t.y,s=t.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),f=Math.sin(s);if(t.order==="XYZ"){let h=o*u,d=o*f,_=a*u,g=a*f;e[0]=l*u,e[4]=-l*f,e[8]=c,e[1]=d+_*c,e[5]=h-g*c,e[9]=-a*l,e[2]=g-h*c,e[6]=_+d*c,e[10]=o*l}else if(t.order==="YXZ"){let h=l*u,d=l*f,_=c*u,g=c*f;e[0]=h+g*a,e[4]=_*a-d,e[8]=o*c,e[1]=o*f,e[5]=o*u,e[9]=-a,e[2]=d*a-_,e[6]=g+h*a,e[10]=o*l}else if(t.order==="ZXY"){let h=l*u,d=l*f,_=c*u,g=c*f;e[0]=h-g*a,e[4]=-o*f,e[8]=_+d*a,e[1]=d+_*a,e[5]=o*u,e[9]=g-h*a,e[2]=-o*c,e[6]=a,e[10]=o*l}else if(t.order==="ZYX"){let h=o*u,d=o*f,_=a*u,g=a*f;e[0]=l*u,e[4]=_*c-d,e[8]=h*c+g,e[1]=l*f,e[5]=g*c+h,e[9]=d*c-_,e[2]=-c,e[6]=a*l,e[10]=o*l}else if(t.order==="YZX"){let h=o*l,d=o*c,_=a*l,g=a*c;e[0]=l*u,e[4]=g-h*f,e[8]=_*f+d,e[1]=f,e[5]=o*u,e[9]=-a*u,e[2]=-c*u,e[6]=d*f+_,e[10]=h-g*f}else if(t.order==="XZY"){let h=o*l,d=o*c,_=a*l,g=a*c;e[0]=l*u,e[4]=-f,e[8]=c*u,e[1]=h*f+g,e[5]=o*u,e[9]=d*f-_,e[2]=_*f-d,e[6]=a*u,e[10]=g*f+h}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(zx,t,kx)}lookAt(t,e,n){let i=this.elements;return Nn.subVectors(t,e),Nn.lengthSq()===0&&(Nn.z=1),Nn.normalize(),ar.crossVectors(n,Nn),ar.lengthSq()===0&&(Math.abs(n.z)===1?Nn.x+=1e-4:Nn.z+=1e-4,Nn.normalize(),ar.crossVectors(n,Nn)),ar.normalize(),ja.crossVectors(Nn,ar),i[0]=ar.x,i[4]=ja.x,i[8]=Nn.x,i[1]=ar.y,i[5]=ja.y,i[9]=Nn.y,i[2]=ar.z,i[6]=ja.z,i[10]=Nn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],f=n[5],h=n[9],d=n[13],_=n[2],g=n[6],p=n[10],m=n[14],b=n[3],S=n[7],y=n[11],D=n[15],A=i[0],w=i[4],P=i[8],M=i[12],v=i[1],N=i[5],F=i[9],R=i[13],B=i[2],Y=i[6],H=i[10],J=i[14],O=i[3],L=i[7],C=i[11],ot=i[15];return s[0]=o*A+a*v+l*B+c*O,s[4]=o*w+a*N+l*Y+c*L,s[8]=o*P+a*F+l*H+c*C,s[12]=o*M+a*R+l*J+c*ot,s[1]=u*A+f*v+h*B+d*O,s[5]=u*w+f*N+h*Y+d*L,s[9]=u*P+f*F+h*H+d*C,s[13]=u*M+f*R+h*J+d*ot,s[2]=_*A+g*v+p*B+m*O,s[6]=_*w+g*N+p*Y+m*L,s[10]=_*P+g*F+p*H+m*C,s[14]=_*M+g*R+p*J+m*ot,s[3]=b*A+S*v+y*B+D*O,s[7]=b*w+S*N+y*Y+D*L,s[11]=b*P+S*F+y*H+D*C,s[15]=b*M+S*R+y*J+D*ot,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],i=t[8],s=t[12],o=t[1],a=t[5],l=t[9],c=t[13],u=t[2],f=t[6],h=t[10],d=t[14],_=t[3],g=t[7],p=t[11],m=t[15];return _*(+s*l*f-i*c*f-s*a*h+n*c*h+i*a*d-n*l*d)+g*(+e*l*d-e*c*h+s*o*h-i*o*d+i*c*u-s*l*u)+p*(+e*c*f-e*a*d-s*o*f+n*o*d+s*a*u-n*c*u)+m*(-i*a*u-e*l*f+e*a*h+i*o*f-n*o*h+n*l*u)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],f=t[9],h=t[10],d=t[11],_=t[12],g=t[13],p=t[14],m=t[15],b=f*p*c-g*h*c+g*l*d-a*p*d-f*l*m+a*h*m,S=_*h*c-u*p*c-_*l*d+o*p*d+u*l*m-o*h*m,y=u*g*c-_*f*c+_*a*d-o*g*d-u*a*m+o*f*m,D=_*f*l-u*g*l-_*a*h+o*g*h+u*a*p-o*f*p,A=e*b+n*S+i*y+s*D;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/A;return t[0]=b*w,t[1]=(g*h*s-f*p*s-g*i*d+n*p*d+f*i*m-n*h*m)*w,t[2]=(a*p*s-g*l*s+g*i*c-n*p*c-a*i*m+n*l*m)*w,t[3]=(f*l*s-a*h*s-f*i*c+n*h*c+a*i*d-n*l*d)*w,t[4]=S*w,t[5]=(u*p*s-_*h*s+_*i*d-e*p*d-u*i*m+e*h*m)*w,t[6]=(_*l*s-o*p*s-_*i*c+e*p*c+o*i*m-e*l*m)*w,t[7]=(o*h*s-u*l*s+u*i*c-e*h*c-o*i*d+e*l*d)*w,t[8]=y*w,t[9]=(_*f*s-u*g*s-_*n*d+e*g*d+u*n*m-e*f*m)*w,t[10]=(o*g*s-_*a*s+_*n*c-e*g*c-o*n*m+e*a*m)*w,t[11]=(u*a*s-o*f*s-u*n*c+e*f*c+o*n*d-e*a*d)*w,t[12]=D*w,t[13]=(u*g*i-_*f*i+_*n*h-e*g*h-u*n*p+e*f*p)*w,t[14]=(_*a*i-o*g*i-_*n*l+e*g*l+o*n*p-e*a*p)*w,t[15]=(o*f*i-u*a*i+u*n*l-e*f*l-o*n*h+e*a*h)*w,this}scale(t){let e=this.elements,n=t.x,i=t.y,s=t.z;return e[0]*=n,e[4]*=i,e[8]*=s,e[1]*=n,e[5]*=i,e[9]*=s,e[2]*=n,e[6]*=i,e[10]*=s,e[3]*=n,e[7]*=i,e[11]*=s,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),i=Math.sin(e),s=1-n,o=t.x,a=t.y,l=t.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,s,o){return this.set(1,n,s,0,t,1,o,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){let i=this.elements,s=e._x,o=e._y,a=e._z,l=e._w,c=s+s,u=o+o,f=a+a,h=s*c,d=s*u,_=s*f,g=o*u,p=o*f,m=a*f,b=l*c,S=l*u,y=l*f,D=n.x,A=n.y,w=n.z;return i[0]=(1-(g+m))*D,i[1]=(d+y)*D,i[2]=(_-S)*D,i[3]=0,i[4]=(d-y)*A,i[5]=(1-(h+m))*A,i[6]=(p+b)*A,i[7]=0,i[8]=(_+S)*w,i[9]=(p-b)*w,i[10]=(1-(h+g))*w,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){let i=this.elements,s=Ns.set(i[0],i[1],i[2]).length(),o=Ns.set(i[4],i[5],i[6]).length(),a=Ns.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),t.x=i[12],t.y=i[13],t.z=i[14],ri.copy(this);let c=1/s,u=1/o,f=1/a;return ri.elements[0]*=c,ri.elements[1]*=c,ri.elements[2]*=c,ri.elements[4]*=u,ri.elements[5]*=u,ri.elements[6]*=u,ri.elements[8]*=f,ri.elements[9]*=f,ri.elements[10]*=f,e.setFromRotationMatrix(ri),n.x=s,n.y=o,n.z=a,this}makePerspective(t,e,n,i,s,o,a=Hi){let l=this.elements,c=2*s/(e-t),u=2*s/(n-i),f=(e+t)/(e-t),h=(n+i)/(n-i),d,_;if(a===Hi)d=-(o+s)/(o-s),_=-2*o*s/(o-s);else if(a===Ml)d=-o/(o-s),_=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=d,l[14]=_,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,i,s,o,a=Hi){let l=this.elements,c=1/(e-t),u=1/(n-i),f=1/(o-s),h=(e+t)*c,d=(n+i)*u,_,g;if(a===Hi)_=(o+s)*f,g=-2*f;else if(a===Ml)_=s*f,g=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-d,l[2]=0,l[6]=0,l[10]=g,l[14]=-_,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},Ns=new j,ri=new Le,zx=new j(0,0,0),kx=new j(1,1,1),ar=new j,ja=new j,Nn=new j,sm=new Le,om=new vr,Wi=class r{constructor(t=0,e=0,n=0,i=r.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){let i=t.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],f=i[2],h=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(Dn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Dn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(Dn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Dn(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Dn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-Dn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return sm.makeRotationFromQuaternion(t),this.setFromRotationMatrix(sm,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return om.setFromEuler(this),this.setFromQuaternion(om,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Wi.DEFAULT_ORDER="XYZ";var Al=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},Vx=0,am=new j,Us=new vr,Ui=new Le,Qa=new j,Go=new j,Hx=new j,Gx=new vr,lm=new j(1,0,0),cm=new j(0,1,0),um=new j(0,0,1),hm={type:"added"},Wx={type:"removed"},Os={type:"childadded",child:null},Nu={type:"childremoved",child:null},cn=class r extends xr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Vx++}),this.uuid=jo(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let t=new j,e=new Wi,n=new vr,i=new j(1,1,1);function s(){n.setFromEuler(e,!1)}function o(){e.setFromQuaternion(n,void 0,!1)}e._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Le},normalMatrix:{value:new jt}}),this.matrix=new Le,this.matrixWorld=new Le,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Al,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Us.setFromAxisAngle(t,e),this.quaternion.multiply(Us),this}rotateOnWorldAxis(t,e){return Us.setFromAxisAngle(t,e),this.quaternion.premultiply(Us),this}rotateX(t){return this.rotateOnAxis(lm,t)}rotateY(t){return this.rotateOnAxis(cm,t)}rotateZ(t){return this.rotateOnAxis(um,t)}translateOnAxis(t,e){return am.copy(t).applyQuaternion(this.quaternion),this.position.add(am.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(lm,t)}translateY(t){return this.translateOnAxis(cm,t)}translateZ(t){return this.translateOnAxis(um,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ui.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Qa.copy(t):Qa.set(t,e,n);let i=this.parent;this.updateWorldMatrix(!0,!1),Go.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ui.lookAt(Go,Qa,this.up):Ui.lookAt(Qa,Go,this.up),this.quaternion.setFromRotationMatrix(Ui),i&&(Ui.extractRotation(i.matrixWorld),Us.setFromRotationMatrix(Ui),this.quaternion.premultiply(Us.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(hm),Os.child=t,this.dispatchEvent(Os),Os.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(Wx),Nu.child=t,this.dispatchEvent(Nu),Nu.child=null),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Ui.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Ui.multiply(t.parent.matrixWorld)),t.applyMatrix4(Ui),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(hm),Os.child=t,this.dispatchEvent(Os),Os.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){let o=this.children[n].getObjectByProperty(t,e);if(o!==void 0)return o}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);let i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Go,t,Hx),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Go,Gx,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){let e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let n=0,i=e.length;n<i;n++){let s=e[n];(s.matrixWorldAutoUpdate===!0||t===!0)&&s.updateMatrixWorld(t)}}updateWorldMatrix(t,e){let n=this.parent;if(t===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){let i=this.children;for(let s=0,o=i.length;s<o;s++){let a=i[s];a.matrixWorldAutoUpdate===!0&&a.updateWorldMatrix(!1,!0)}}}toJSON(t){let e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(t.geometries,this.geometry);let a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){let l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){let f=l[c];s(t.shapes,f)}else s(t.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(s(t.materials,this.material[l]));i.material=a}else i.material=s(t.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){let l=this.animations[a];i.animations.push(s(t.animations,l))}}if(e){let a=o(t.geometries),l=o(t.materials),c=o(t.textures),u=o(t.images),f=o(t.shapes),h=o(t.skeletons),d=o(t.animations),_=o(t.nodes);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),f.length>0&&(n.shapes=f),h.length>0&&(n.skeletons=h),d.length>0&&(n.animations=d),_.length>0&&(n.nodes=_)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n<t.children.length;n++){let i=t.children[n];this.add(i.clone())}return this}};cn.DEFAULT_UP=new j(0,1,0);cn.DEFAULT_MATRIX_AUTO_UPDATE=!0;cn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var si=new j,Oi=new j,Uu=new j,Bi=new j,Bs=new j,zs=new j,fm=new j,Ou=new j,Bu=new j,zu=new j,Ys=class r{constructor(t=new j,e=new j,n=new j){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),si.subVectors(t,e),i.cross(si);let s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(t,e,n,i,s){si.subVectors(i,e),Oi.subVectors(n,e),Uu.subVectors(t,e);let o=si.dot(si),a=si.dot(Oi),l=si.dot(Uu),c=Oi.dot(Oi),u=Oi.dot(Uu),f=o*c-a*a;if(f===0)return s.set(0,0,0),null;let h=1/f,d=(c*l-a*u)*h,_=(o*u-a*l)*h;return s.set(1-d-_,_,d)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Bi)===null?!1:Bi.x>=0&&Bi.y>=0&&Bi.x+Bi.y<=1}static getInterpolation(t,e,n,i,s,o,a,l){return this.getBarycoord(t,e,n,i,Bi)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Bi.x),l.addScaledVector(o,Bi.y),l.addScaledVector(a,Bi.z),l)}static isFrontFacing(t,e,n,i){return si.subVectors(n,e),Oi.subVectors(t,e),si.cross(Oi).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return si.subVectors(this.c,this.b),Oi.subVectors(this.a,this.b),si.cross(Oi).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return r.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return r.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,s){return r.getInterpolation(t,this.a,this.b,this.c,e,n,i,s)}containsPoint(t){return r.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return r.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,i=this.b,s=this.c,o,a;Bs.subVectors(i,n),zs.subVectors(s,n),Ou.subVectors(t,n);let l=Bs.dot(Ou),c=zs.dot(Ou);if(l<=0&&c<=0)return e.copy(n);Bu.subVectors(t,i);let u=Bs.dot(Bu),f=zs.dot(Bu);if(u>=0&&f<=u)return e.copy(i);let h=l*f-u*c;if(h<=0&&l>=0&&u<=0)return o=l/(l-u),e.copy(n).addScaledVector(Bs,o);zu.subVectors(t,s);let d=Bs.dot(zu),_=zs.dot(zu);if(_>=0&&d<=_)return e.copy(s);let g=d*c-l*_;if(g<=0&&c>=0&&_<=0)return a=c/(c-_),e.copy(n).addScaledVector(zs,a);let p=u*_-d*f;if(p<=0&&f-u>=0&&d-_>=0)return fm.subVectors(s,i),a=(f-u)/(f-u+(d-_)),e.copy(i).addScaledVector(fm,a);let m=1/(p+g+h);return o=g*m,a=h*m,e.copy(n).addScaledVector(Bs,o).addScaledVector(zs,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},ig={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},lr={h:0,s:0,l:0},tl={h:0,s:0,l:0};function ku(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*6*(2/3-e):r}var ce=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let i=t;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=qn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,me.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=me.workingColorSpace){return this.r=t,this.g=e,this.b=n,me.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=me.workingColorSpace){if(t=Ix(t,1),e=Dn(e,0,1),n=Dn(n,0,1),e===0)this.r=this.g=this.b=n;else{let s=n<=.5?n*(1+e):n+e-n*e,o=2*n-s;this.r=ku(o,s,t+1/3),this.g=ku(o,s,t),this.b=ku(o,s,t-1/3)}return me.toWorkingColorSpace(this,i),this}setStyle(t,e=qn){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let s,o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){let s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(o===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=qn){let n=ig[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=$s(t.r),this.g=$s(t.g),this.b=$s(t.b),this}copyLinearToSRGB(t){return this.r=Au(t.r),this.g=Au(t.g),this.b=Au(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=qn){return me.fromWorkingColorSpace(ln.copy(this),t),Math.round(Dn(ln.r*255,0,255))*65536+Math.round(Dn(ln.g*255,0,255))*256+Math.round(Dn(ln.b*255,0,255))}getHexString(t=qn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=me.workingColorSpace){me.fromWorkingColorSpace(ln.copy(this),e);let n=ln.r,i=ln.g,s=ln.b,o=Math.max(n,i,s),a=Math.min(n,i,s),l,c,u=(a+o)/2;if(a===o)l=0,c=0;else{let f=o-a;switch(c=u<=.5?f/(o+a):f/(2-o-a),o){case n:l=(i-s)/f+(i<s?6:0);break;case i:l=(s-n)/f+2;break;case s:l=(n-i)/f+4;break}l/=6}return t.h=l,t.s=c,t.l=u,t}getRGB(t,e=me.workingColorSpace){return me.fromWorkingColorSpace(ln.copy(this),e),t.r=ln.r,t.g=ln.g,t.b=ln.b,t}getStyle(t=qn){me.fromWorkingColorSpace(ln.copy(this),t);let e=ln.r,n=ln.g,i=ln.b;return t!==qn?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(t,e,n){return this.getHSL(lr),this.setHSL(lr.h+t,lr.s+e,lr.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(lr),t.getHSL(tl);let n=Eu(lr.h,tl.h,e),i=Eu(lr.s,tl.s,e),s=Eu(lr.l,tl.l,e);return this.setHSL(n,i,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,n=this.g,i=this.b,s=t.elements;return this.r=s[0]*e+s[3]*n+s[6]*i,this.g=s[1]*e+s[4]*n+s[7]*i,this.b=s[2]*e+s[5]*n+s[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},ln=new ce;ce.NAMES=ig;var Xx=0,rs=class extends xr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Xx++}),this.uuid=jo(),this.name="",this.type="Material",this.blending=pr,this.side=gr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Ku,this.blendDst=ju,this.blendEquation=Qr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ce(0,0,0),this.blendAlpha=0,this.depthFunc=gl,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=jp,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Rs,this.stencilZFail=Rs,this.stencilZPass=Rs,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let i=this[e];if(i===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==pr&&(n.blending=this.blending),this.side!==gr&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Ku&&(n.blendSrc=this.blendSrc),this.blendDst!==ju&&(n.blendDst=this.blendDst),this.blendEquation!==Qr&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==gl&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==jp&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Rs&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Rs&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Rs&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(e){let s=i(t.textures),o=i(t.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,n=null;if(e!==null){let i=e.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=e[s].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}},Dl=class extends rs{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ce(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Wi,this.combine=qm,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}};var Oe=new j,el=new ue,Zn=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=Qp,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=hr,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Fx("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)el.fromBufferAttribute(this,e),el.applyMatrix3(t),this.setXY(e,el.x,el.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Oe.fromBufferAttribute(this,e),Oe.applyMatrix3(t),this.setXYZ(e,Oe.x,Oe.y,Oe.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Oe.fromBufferAttribute(this,e),Oe.applyMatrix4(t),this.setXYZ(e,Oe.x,Oe.y,Oe.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Oe.fromBufferAttribute(this,e),Oe.applyNormalMatrix(t),this.setXYZ(e,Oe.x,Oe.y,Oe.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Oe.fromBufferAttribute(this,e),Oe.transformDirection(t),this.setXYZ(e,Oe.x,Oe.y,Oe.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=ko(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=An(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=ko(e,this.array)),e}setX(t,e){return this.normalized&&(e=An(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=ko(e,this.array)),e}setY(t,e){return this.normalized&&(e=An(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=ko(e,this.array)),e}setZ(t,e){return this.normalized&&(e=An(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=ko(e,this.array)),e}setW(t,e){return this.normalized&&(e=An(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=An(e,this.array),n=An(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=An(e,this.array),n=An(n,this.array),i=An(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,s){return t*=this.itemSize,this.normalized&&(e=An(e,this.array),n=An(n,this.array),i=An(i,this.array),s=An(s,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==Qp&&(t.usage=this.usage),t}};var Cl=class extends Zn{constructor(t,e,n){super(new Uint16Array(t),e,n)}};var Rl=class extends Zn{constructor(t,e,n){super(new Uint32Array(t),e,n)}};var Jn=class extends Zn{constructor(t,e,n){super(new Float32Array(t),e,n)}},qx=0,Xn=new Le,Vu=new cn,ks=new j,Un=new is,Wo=new is,qe=new j,Mi=class r extends xr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:qx++}),this.uuid=jo(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(ng(t)?Rl:Cl)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new jt().getNormalMatrix(t);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Xn.makeRotationFromQuaternion(t),this.applyMatrix4(Xn),this}rotateX(t){return Xn.makeRotationX(t),this.applyMatrix4(Xn),this}rotateY(t){return Xn.makeRotationY(t),this.applyMatrix4(Xn),this}rotateZ(t){return Xn.makeRotationZ(t),this.applyMatrix4(Xn),this}translate(t,e,n){return Xn.makeTranslation(t,e,n),this.applyMatrix4(Xn),this}scale(t,e,n){return Xn.makeScale(t,e,n),this.applyMatrix4(Xn),this}lookAt(t){return Vu.lookAt(t),Vu.updateMatrix(),this.applyMatrix4(Vu.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ks).negate(),this.translate(ks.x,ks.y,ks.z),this}setFromPoints(t){let e=[];for(let n=0,i=t.length;n<i;n++){let s=t[n];e.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Jn(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new is);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new j(-1/0,-1/0,-1/0),new j(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){let s=e[n];Un.setFromBufferAttribute(s),this.morphTargetsRelative?(qe.addVectors(this.boundingBox.min,Un.min),this.boundingBox.expandByPoint(qe),qe.addVectors(this.boundingBox.max,Un.max),this.boundingBox.expandByPoint(qe)):(this.boundingBox.expandByPoint(Un.min),this.boundingBox.expandByPoint(Un.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new eo);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new j,1/0);return}if(t){let n=this.boundingSphere.center;if(Un.setFromBufferAttribute(t),e)for(let s=0,o=e.length;s<o;s++){let a=e[s];Wo.setFromBufferAttribute(a),this.morphTargetsRelative?(qe.addVectors(Un.min,Wo.min),Un.expandByPoint(qe),qe.addVectors(Un.max,Wo.max),Un.expandByPoint(qe)):(Un.expandByPoint(Wo.min),Un.expandByPoint(Wo.max))}Un.getCenter(n);let i=0;for(let s=0,o=t.count;s<o;s++)qe.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared(qe));if(e)for(let s=0,o=e.length;s<o;s++){let a=e[s],l=this.morphTargetsRelative;for(let c=0,u=a.count;c<u;c++)qe.fromBufferAttribute(a,c),l&&(ks.fromBufferAttribute(t,c),qe.add(ks)),i=Math.max(i,n.distanceToSquared(qe))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let n=e.position,i=e.normal,s=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Zn(new Float32Array(4*n.count),4));let o=this.getAttribute("tangent"),a=[],l=[];for(let P=0;P<n.count;P++)a[P]=new j,l[P]=new j;let c=new j,u=new j,f=new j,h=new ue,d=new ue,_=new ue,g=new j,p=new j;function m(P,M,v){c.fromBufferAttribute(n,P),u.fromBufferAttribute(n,M),f.fromBufferAttribute(n,v),h.fromBufferAttribute(s,P),d.fromBufferAttribute(s,M),_.fromBufferAttribute(s,v),u.sub(c),f.sub(c),d.sub(h),_.sub(h);let N=1/(d.x*_.y-_.x*d.y);isFinite(N)&&(g.copy(u).multiplyScalar(_.y).addScaledVector(f,-d.y).multiplyScalar(N),p.copy(f).multiplyScalar(d.x).addScaledVector(u,-_.x).multiplyScalar(N),a[P].add(g),a[M].add(g),a[v].add(g),l[P].add(p),l[M].add(p),l[v].add(p))}let b=this.groups;b.length===0&&(b=[{start:0,count:t.count}]);for(let P=0,M=b.length;P<M;++P){let v=b[P],N=v.start,F=v.count;for(let R=N,B=N+F;R<B;R+=3)m(t.getX(R+0),t.getX(R+1),t.getX(R+2))}let S=new j,y=new j,D=new j,A=new j;function w(P){D.fromBufferAttribute(i,P),A.copy(D);let M=a[P];S.copy(M),S.sub(D.multiplyScalar(D.dot(M))).normalize(),y.crossVectors(A,M);let N=y.dot(l[P])<0?-1:1;o.setXYZW(P,S.x,S.y,S.z,N)}for(let P=0,M=b.length;P<M;++P){let v=b[P],N=v.start,F=v.count;for(let R=N,B=N+F;R<B;R+=3)w(t.getX(R+0)),w(t.getX(R+1)),w(t.getX(R+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Zn(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let h=0,d=n.count;h<d;h++)n.setXYZ(h,0,0,0);let i=new j,s=new j,o=new j,a=new j,l=new j,c=new j,u=new j,f=new j;if(t)for(let h=0,d=t.count;h<d;h+=3){let _=t.getX(h+0),g=t.getX(h+1),p=t.getX(h+2);i.fromBufferAttribute(e,_),s.fromBufferAttribute(e,g),o.fromBufferAttribute(e,p),u.subVectors(o,s),f.subVectors(i,s),u.cross(f),a.fromBufferAttribute(n,_),l.fromBufferAttribute(n,g),c.fromBufferAttribute(n,p),a.add(u),l.add(u),c.add(u),n.setXYZ(_,a.x,a.y,a.z),n.setXYZ(g,l.x,l.y,l.z),n.setXYZ(p,c.x,c.y,c.z)}else for(let h=0,d=e.count;h<d;h+=3)i.fromBufferAttribute(e,h+0),s.fromBufferAttribute(e,h+1),o.fromBufferAttribute(e,h+2),u.subVectors(o,s),f.subVectors(i,s),u.cross(f),n.setXYZ(h+0,u.x,u.y,u.z),n.setXYZ(h+1,u.x,u.y,u.z),n.setXYZ(h+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)qe.fromBufferAttribute(t,e),qe.normalize(),t.setXYZ(e,qe.x,qe.y,qe.z)}toNonIndexed(){function t(a,l){let c=a.array,u=a.itemSize,f=a.normalized,h=new c.constructor(l.length*u),d=0,_=0;for(let g=0,p=l.length;g<p;g++){a.isInterleavedBufferAttribute?d=l[g]*a.data.stride+a.offset:d=l[g]*u;for(let m=0;m<u;m++)h[_++]=c[d++]}return new Zn(h,u,f)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new r,n=this.index.array,i=this.attributes;for(let a in i){let l=i[a],c=t(l,n);e.setAttribute(a,c)}let s=this.morphAttributes;for(let a in s){let l=[],c=s[a];for(let u=0,f=c.length;u<f;u++){let h=c[u],d=t(h,n);l.push(d)}e.morphAttributes[a]=l}e.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let a=0,l=o.length;a<l;a++){let c=o[a];e.addGroup(c.start,c.count,c.materialIndex)}return e}toJSON(){let t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let l in n){let c=n[l];t.data.attributes[l]=c.toJSON(t.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let f=0,h=c.length;f<h;f++){let d=c[f];u.push(d.toJSON(t.data))}u.length>0&&(i[l]=u,s=!0)}s&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone(e));let i=t.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(e))}let s=t.morphAttributes;for(let c in s){let u=[],f=s[c];for(let h=0,d=f.length;h<d;h++)u.push(f[h].clone(e));this.morphAttributes[c]=u}this.morphTargetsRelative=t.morphTargetsRelative;let o=t.groups;for(let c=0,u=o.length;c<u;c++){let f=o[c];this.addGroup(f.start,f.count,f.materialIndex)}let a=t.boundingBox;a!==null&&(this.boundingBox=a.clone());let l=t.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},dm=new Le,Zr=new Tl,nl=new eo,pm=new j,Vs=new j,Hs=new j,Gs=new j,Hu=new j,il=new j,rl=new ue,sl=new ue,ol=new ue,mm=new j,gm=new j,_m=new j,al=new j,ll=new j,ai=class extends cn{constructor(t=new Mi,e=new Dl){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){let a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(t,e){let n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;e.fromBufferAttribute(i,t);let a=this.morphTargetInfluences;if(s&&a){il.set(0,0,0);for(let l=0,c=s.length;l<c;l++){let u=a[l],f=s[l];u!==0&&(Hu.fromBufferAttribute(f,t),o?il.addScaledVector(Hu,u):il.addScaledVector(Hu.sub(e),u))}e.add(il)}return e}raycast(t,e){let n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),nl.copy(n.boundingSphere),nl.applyMatrix4(s),Zr.copy(t.ray).recast(t.near),!(nl.containsPoint(Zr.origin)===!1&&(Zr.intersectSphere(nl,pm)===null||Zr.origin.distanceToSquared(pm)>(t.far-t.near)**2))&&(dm.copy(s).invert(),Zr.copy(t.ray).applyMatrix4(dm),!(n.boundingBox!==null&&Zr.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Zr)))}_computeIntersections(t,e,n){let i,s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,f=s.attributes.normal,h=s.groups,d=s.drawRange;if(a!==null)if(Array.isArray(o))for(let _=0,g=h.length;_<g;_++){let p=h[_],m=o[p.materialIndex],b=Math.max(p.start,d.start),S=Math.min(a.count,Math.min(p.start+p.count,d.start+d.count));for(let y=b,D=S;y<D;y+=3){let A=a.getX(y),w=a.getX(y+1),P=a.getX(y+2);i=cl(this,m,t,n,c,u,f,A,w,P),i&&(i.faceIndex=Math.floor(y/3),i.face.materialIndex=p.materialIndex,e.push(i))}}else{let _=Math.max(0,d.start),g=Math.min(a.count,d.start+d.count);for(let p=_,m=g;p<m;p+=3){let b=a.getX(p),S=a.getX(p+1),y=a.getX(p+2);i=cl(this,o,t,n,c,u,f,b,S,y),i&&(i.faceIndex=Math.floor(p/3),e.push(i))}}else if(l!==void 0)if(Array.isArray(o))for(let _=0,g=h.length;_<g;_++){let p=h[_],m=o[p.materialIndex],b=Math.max(p.start,d.start),S=Math.min(l.count,Math.min(p.start+p.count,d.start+d.count));for(let y=b,D=S;y<D;y+=3){let A=y,w=y+1,P=y+2;i=cl(this,m,t,n,c,u,f,A,w,P),i&&(i.faceIndex=Math.floor(y/3),i.face.materialIndex=p.materialIndex,e.push(i))}}else{let _=Math.max(0,d.start),g=Math.min(l.count,d.start+d.count);for(let p=_,m=g;p<m;p+=3){let b=p,S=p+1,y=p+2;i=cl(this,o,t,n,c,u,f,b,S,y),i&&(i.faceIndex=Math.floor(p/3),e.push(i))}}}};function Yx(r,t,e,n,i,s,o,a){let l;if(t.side===Cn?l=n.intersectTriangle(o,s,i,!0,a):l=n.intersectTriangle(i,s,o,t.side===gr,a),l===null)return null;ll.copy(a),ll.applyMatrix4(r.matrixWorld);let c=e.ray.origin.distanceTo(ll);return c<e.near||c>e.far?null:{distance:c,point:ll.clone(),object:r}}function cl(r,t,e,n,i,s,o,a,l,c){r.getVertexPosition(a,Vs),r.getVertexPosition(l,Hs),r.getVertexPosition(c,Gs);let u=Yx(r,t,e,n,Vs,Hs,Gs,al);if(u){i&&(rl.fromBufferAttribute(i,a),sl.fromBufferAttribute(i,l),ol.fromBufferAttribute(i,c),u.uv=Ys.getInterpolation(al,Vs,Hs,Gs,rl,sl,ol,new ue)),s&&(rl.fromBufferAttribute(s,a),sl.fromBufferAttribute(s,l),ol.fromBufferAttribute(s,c),u.uv1=Ys.getInterpolation(al,Vs,Hs,Gs,rl,sl,ol,new ue)),o&&(mm.fromBufferAttribute(o,a),gm.fromBufferAttribute(o,l),_m.fromBufferAttribute(o,c),u.normal=Ys.getInterpolation(al,Vs,Hs,Gs,mm,gm,_m,new j),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));let f={a,b:l,c,normal:new j,materialIndex:0};Ys.getNormal(Vs,Hs,Gs,f.normal),u.face=f}return u}var Zo=class r extends Mi{constructor(t=1,e=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};let a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);let l=[],c=[],u=[],f=[],h=0,d=0;_("z","y","x",-1,-1,n,e,t,o,s,0),_("z","y","x",1,-1,n,e,-t,o,s,1),_("x","z","y",1,1,t,n,e,i,o,2),_("x","z","y",1,-1,t,n,-e,i,o,3),_("x","y","z",1,-1,t,e,n,i,s,4),_("x","y","z",-1,-1,t,e,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new Jn(c,3)),this.setAttribute("normal",new Jn(u,3)),this.setAttribute("uv",new Jn(f,2));function _(g,p,m,b,S,y,D,A,w,P,M){let v=y/w,N=D/P,F=y/2,R=D/2,B=A/2,Y=w+1,H=P+1,J=0,O=0,L=new j;for(let C=0;C<H;C++){let ot=C*N-R;for(let vt=0;vt<Y;vt++){let Wt=vt*v-F;L[g]=Wt*b,L[p]=ot*S,L[m]=B,c.push(L.x,L.y,L.z),L[g]=0,L[p]=0,L[m]=A>0?1:-1,u.push(L.x,L.y,L.z),f.push(vt/w),f.push(1-C/P),J+=1}}for(let C=0;C<P;C++)for(let ot=0;ot<w;ot++){let vt=h+ot+Y*C,Wt=h+ot+Y*(C+1),q=h+(ot+1)+Y*(C+1),tt=h+(ot+1)+Y*C;l.push(vt,Wt,tt),l.push(Wt,q,tt),O+=6}a.addGroup(d,O,M),d+=O,h+=J}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function no(r){let t={};for(let e in r){t[e]={};for(let n in r[e]){let i=r[e][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][n]=null):t[e][n]=i.clone():Array.isArray(i)?t[e][n]=i.slice():t[e][n]=i}}return t}function yn(r){let t={};for(let e=0;e<r.length;e++){let n=no(r[e]);for(let i in n)t[i]=n[i]}return t}function Zx(r){let t=[];for(let e=0;e<r.length;e++)t.push(r[e].clone());return t}function rg(r){let t=r.getRenderTarget();return t===null?r.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:me.workingColorSpace}var Jx={clone:no,merge:yn},$x=`void main() {
|
|
1
|
+
(()=>{var Hh=()=>{let r=document.querySelectorAll("[data-contact-popup-toggler]"),t=document.querySelector("[data-contact-popup]");var e=0;if(!r||!t)return;let n=t.querySelector("[data-contact-popup-close]");if(!n)return;let i=t.querySelector(".contact-popup_box");if(!i)return;let s=(o,a)=>{let l=document.createElement("script"),c=document.getElementsByTagName("script")[0];l.async=1,l.onload=l.onreadystatechange=(u,h)=>{(h||!l.readyState||/loaded|complete/.test(l.readyState))&&(l.onload=l.onreadystatechange=null,l=void 0,h||a&&a())},l.src=o,c.parentNode.insertBefore(l,c)};r.forEach(o=>{o.addEventListener("click",a=>{a.preventDefault,e?(t.classList.add("-open"),document.body.classList.add("-popup-open")):s("https://assets.calendly.com/assets/external/widget.js",()=>{e=1,t.classList.add("-open"),document.body.classList.add("-popup-open")})})}),n.addEventListener("click",o=>{o.preventDefault,t.classList.remove("-open"),document.body.classList.remove("-popup-open")}),t.addEventListener("click",o=>{i.contains(o.target)||(t.classList.remove("-open"),document.body.classList.remove("-popup-open"))})};function bi(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function $h(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}var En={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},cs={duration:.5,overwrite:!1,delay:0},pc,tn,be,zn=1e8,xe=1/zn,ic=Math.PI*2,dg=ic/4,pg=0,Kh=Math.sqrt,mg=Math.cos,gg=Math.sin,Be=function(t){return typeof t=="string"},Ce=function(t){return typeof t=="function"},Ei=function(t){return typeof t=="number"},la=function(t){return typeof t>"u"},fi=function(t){return typeof t=="object"},wn=function(t){return t!==!1},mc=function(){return typeof window<"u"},Qo=function(t){return Ce(t)||Be(t)},jh=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},en=Array.isArray,rc=/(?:-?\.?\d|\.)+/gi,gc=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Tr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,$l=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,_c=/[+-]=-?[.\d]+/,Qh=/[^,'"\[\]\s]+/gi,_g=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Te,ui,sc,xc,Pn={},ia={},tf,ef=function(t){return(ia=Er(t,Pn))&&nn},ca=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},ho=function(t,e){return!e&&console.warn(t)},nf=function(t,e){return t&&(Pn[t]=e)&&ia&&(ia[t]=e)||Pn},fo=function(){return 0},xg={suppressEvents:!0,isStart:!0,kill:!1},ta={suppressEvents:!0,kill:!1},vg={suppressEvents:!0},vc={},Yi=[],oc={},rf,Mn={},Kl={},Gh=30,ea=[],yc="",Sc=function(t){var e=t[0],n,i;if(fi(e)||Ce(e)||(t=[t]),!(n=(e._gsap||{}).harness)){for(i=ea.length;i--&&!ea[i].targetTest(e););n=ea[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new wc(t[i],n)))||t.splice(i,1);return t},Zi=function(t){return t._gsap||Sc(kn(t))[0]._gsap},Mc=function(t,e,n){return(n=t[e])&&Ce(n)?t[e]():la(n)&&t.getAttribute&&t.getAttribute(e)||n},hn=function(t,e){return(t=t.split(",")).forEach(e)||t},Re=function(t){return Math.round(t*1e5)/1e5||0},Ge=function(t){return Math.round(t*1e7)/1e7||0},Ar=function(t,e){var n=e.charAt(0),i=parseFloat(e.substr(2));return t=parseFloat(t),n==="+"?t+i:n==="-"?t-i:n==="*"?t*i:t/i},yg=function(t,e){for(var n=e.length,i=0;t.indexOf(e[i])<0&&++i<n;);return i<n},ra=function(){var t=Yi.length,e=Yi.slice(0),n,i;for(oc={},Yi.length=0,n=0;n<t;n++)i=e[n],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},sf=function(t,e,n,i){Yi.length&&!tn&&ra(),t.render(e,n,i||tn&&e<0&&(t._initted||t._startAt)),Yi.length&&!tn&&ra()},of=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(Qh).length<2?e:Be(t)?t.trim():t},af=function(t){return t},Vn=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Sg=function(t){return function(e,n){for(var i in n)i in e||i==="duration"&&t||i==="ease"||(e[i]=n[i])}},Er=function(t,e){for(var n in e)t[n]=e[n];return t},Wh=function r(t,e){for(var n in e)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(t[n]=fi(e[n])?r(t[n]||(t[n]={}),e[n]):e[n]);return t},sa=function(t,e){var n={},i;for(i in t)i in e||(n[i]=t[i]);return n},lo=function(t){var e=t.parent||Te,n=t.keyframes?Sg(en(t.keyframes)):Vn;if(wn(t.inherit))for(;e;)n(t,e.vars.defaults),e=e.parent||e._dp;return t},Mg=function(t,e){for(var n=t.length,i=n===e.length;i&&n--&&t[n]===e[n];);return n<0},lf=function(t,e,n,i,s){n===void 0&&(n="_first"),i===void 0&&(i="_last");var o=t[i],a;if(s)for(a=e[s];o&&o[s]>a;)o=o._prev;return o?(e._next=o._next,o._next=e):(e._next=t[n],t[n]=e),e._next?e._next._prev=e:t[i]=e,e._prev=o,e.parent=e._dp=t,e},ua=function(t,e,n,i){n===void 0&&(n="_first"),i===void 0&&(i="_last");var s=e._prev,o=e._next;s?s._next=o:t[n]===e&&(t[n]=o),o?o._prev=s:t[i]===e&&(t[i]=s),e._next=e._prev=e.parent=null},Ji=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Mr=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var n=t;n;)n._dirty=1,n=n.parent;return t},bg=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},ac=function(t,e,n,i){return t._startAt&&(tn?t._startAt.revert(ta):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))},wg=function r(t){return!t||t._ts&&r(t.parent)},Xh=function(t){return t._repeat?us(t._tTime,t=t.duration()+t._rDelay)*t:0},us=function(t,e){var n=Math.floor(t/=e);return t&&n===t?n-1:n},oa=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},ha=function(t){return t._end=Ge(t._start+(t._tDur/Math.abs(t._ts||t._rts||xe)||0))},fa=function(t,e){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=Ge(n._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),ha(t),n._dirty||Mr(n,t)),t},cf=function(t,e){var n;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(n=oa(t.rawTime(),e),(!e._dur||go(0,e.totalDuration(),n)-e._tTime>xe)&&e.render(n,!0)),Mr(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(n=t;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;t._zTime=-xe}},hi=function(t,e,n,i){return e.parent&&Ji(e),e._start=Ge((Ei(n)?n:n||t!==Te?Bn(t,n,e):t._time)+e._delay),e._end=Ge(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),lf(t,e,"_first","_last",t._sort?"_start":0),lc(e)||(t._recent=e),i||cf(t,e),t._ts<0&&fa(t,t._tTime),t},uf=function(t,e){return(Pn.ScrollTrigger||ca("scrollTrigger",e))&&Pn.ScrollTrigger.create(e,t)},hf=function(t,e,n,i,s){if(Ac(t,e,s),!t._initted)return 1;if(!n&&t._pt&&!tn&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&rf!==bn.frame)return Yi.push(t),t._lazy=[s,i],1},Eg=function r(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||r(e))},lc=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},Tg=function(t,e,n,i){var s=t.ratio,o=e<0||!e&&(!t._start&&Eg(t)&&!(!t._initted&&lc(t))||(t._ts<0||t._dp._ts<0)&&!lc(t))?0:1,a=t._rDelay,l=0,c,u,h;if(a&&t._repeat&&(l=go(0,t._tDur,e),u=us(l,a),t._yoyo&&u&1&&(o=1-o),u!==us(t._tTime,a)&&(s=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==s||tn||i||t._zTime===xe||!e&&t._zTime){if(!t._initted&&hf(t,e,i,n,l))return;for(h=t._zTime,t._zTime=e||(n?xe:0),n||(n=e&&!h),t.ratio=o,t._from&&(o=1-o),t._time=0,t._tTime=l,c=t._pt;c;)c.r(o,c.d),c=c._next;e<0&&ac(t,e,n,!0),t._onUpdate&&!n&&Rn(t,"onUpdate"),l&&t._repeat&&!n&&t.parent&&Rn(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&Ji(t,1),!n&&!tn&&(Rn(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},Ag=function(t,e,n){var i;if(n>e)for(i=t._first;i&&i._start<=n;){if(i.data==="isPause"&&i._start>e)return i;i=i._next}else for(i=t._last;i&&i._start>=n;){if(i.data==="isPause"&&i._start<e)return i;i=i._prev}},hs=function(t,e,n,i){var s=t._repeat,o=Ge(e)||0,a=t._tTime/t._tDur;return a&&!i&&(t._time*=o/t._dur),t._dur=o,t._tDur=s?s<0?1e10:Ge(o*(s+1)+t._rDelay*s):o,a>0&&!i&&fa(t,t._tTime=t._tDur*a),t.parent&&ha(t),n||Mr(t.parent,t),t},qh=function(t){return t instanceof Ze?Mr(t):hs(t,t._dur)},Dg={_start:0,endTime:fo,totalDuration:fo},Bn=function r(t,e,n){var i=t.labels,s=t._recent||Dg,o=t.duration()>=zn?s.endTime(!1):t._dur,a,l,c;return Be(e)&&(isNaN(e)||e in i)?(l=e.charAt(0),c=e.substr(-1)==="%",a=e.indexOf("="),l==="<"||l===">"?(a>=0&&(e=e.replace(/=/,"")),(l==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(e.substr(1))||0)*(c?(a<0?s:n).totalDuration()/100:1)):a<0?(e in i||(i[e]=o),i[e]):(l=parseFloat(e.charAt(a-1)+e.substr(a+1)),c&&n&&(l=l/100*(en(n)?n[0]:n).totalDuration()),a>1?r(t,e.substr(0,a-1),n)+l:o+l)):e==null?o:+e},co=function(t,e,n){var i=Ei(e[1]),s=(i?2:1)+(t<2?0:1),o=e[s],a,l;if(i&&(o.duration=e[1]),o.parent=n,t){for(a=o,l=n;l&&!("immediateRender"in a);)a=l.vars.defaults||{},l=wn(l.vars.inherit)&&l.parent;o.immediateRender=wn(a.immediateRender),t<2?o.runBackwards=1:o.startAt=e[s-1]}return new Ie(e[0],o,e[s+1])},$i=function(t,e){return t||t===0?e(t):e},go=function(t,e,n){return n<t?t:n>e?e:n},Je=function(t,e){return!Be(t)||!(e=_g.exec(t))?"":e[1]},Cg=function(t,e,n){return $i(n,function(i){return go(t,e,i)})},cc=[].slice,ff=function(t,e){return t&&fi(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&fi(t[0]))&&!t.nodeType&&t!==ui},Rg=function(t,e,n){return n===void 0&&(n=[]),t.forEach(function(i){var s;return Be(i)&&!e||ff(i,1)?(s=n).push.apply(s,kn(i)):n.push(i)})||n},kn=function(t,e,n){return be&&!e&&be.selector?be.selector(t):Be(t)&&!n&&(sc||!fs())?cc.call((e||xc).querySelectorAll(t),0):en(t)?Rg(t,n):ff(t)?cc.call(t,0):t?[t]:[]},uc=function(t){return t=kn(t)[0]||ho("Invalid scope")||{},function(e){var n=t.current||t.nativeElement||t;return kn(e,n.querySelectorAll?n:n===t?ho("Invalid scope")||xc.createElement("div"):t)}},df=function(t){return t.sort(function(){return .5-Math.random()})},pf=function(t){if(Ce(t))return t;var e=fi(t)?t:{each:t},n=br(e.ease),i=e.from||0,s=parseFloat(e.base)||0,o={},a=i>0&&i<1,l=isNaN(i)||a,c=e.axis,u=i,h=i;return Be(i)?u=h={center:.5,edges:.5,end:1}[i]||0:!a&&l&&(u=i[0],h=i[1]),function(f,d,_){var g=(_||e).length,m=o[g],p,b,y,S,D,A,w,P,M;if(!m){if(M=e.grid==="auto"?0:(e.grid||[1,zn])[1],!M){for(w=-zn;w<(w=_[M++].getBoundingClientRect().left)&&M<g;);M<g&&M--}for(m=o[g]=[],p=l?Math.min(M,g)*u-.5:i%M,b=M===zn?0:l?g*h/M-.5:i/M|0,w=0,P=zn,A=0;A<g;A++)y=A%M-p,S=b-(A/M|0),m[A]=D=c?Math.abs(c==="y"?S:y):Kh(y*y+S*S),D>w&&(w=D),D<P&&(P=D);i==="random"&&df(m),m.max=w-P,m.min=P,m.v=g=(parseFloat(e.amount)||parseFloat(e.each)*(M>g?g-1:c?c==="y"?g/M:M:Math.max(M,g/M))||0)*(i==="edges"?-1:1),m.b=g<0?s-g:s,m.u=Je(e.amount||e.each)||0,n=n&&g<0?bf(n):n}return g=(m[f]-m.min)/m.max||0,Ge(m.b+(n?n(g):g)*m.v)+m.u}},hc=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(n){var i=Ge(Math.round(parseFloat(n)/t)*t*e);return(i-i%1)/e+(Ei(n)?0:Je(n))}},mf=function(t,e){var n=en(t),i,s;return!n&&fi(t)&&(i=n=t.radius||zn,t.values?(t=kn(t.values),(s=!Ei(t[0]))&&(i*=i)):t=hc(t.increment)),$i(e,n?Ce(t)?function(o){return s=t(o),Math.abs(s-o)<=i?s:o}:function(o){for(var a=parseFloat(s?o.x:o),l=parseFloat(s?o.y:0),c=zn,u=0,h=t.length,f,d;h--;)s?(f=t[h].x-a,d=t[h].y-l,f=f*f+d*d):f=Math.abs(t[h]-a),f<c&&(c=f,u=h);return u=!i||c<=i?t[u]:o,s||u===o||Ei(o)?u:u+Je(o)}:hc(t))},gf=function(t,e,n,i){return $i(en(t)?!e:n===!0?!!(n=0):!i,function(){return en(t)?t[~~(Math.random()*t.length)]:(n=n||1e-5)&&(i=n<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((t-n/2+Math.random()*(e-t+n*.99))/n)*n*i)/i})},Pg=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(i){return e.reduce(function(s,o){return o(s)},i)}},Ig=function(t,e){return function(n){return t(parseFloat(n))+(e||Je(n))}},Lg=function(t,e,n){return xf(t,e,0,1,n)},_f=function(t,e,n){return $i(n,function(i){return t[~~e(i)]})},Fg=function r(t,e,n){var i=e-t;return en(t)?_f(t,r(0,t.length),e):$i(n,function(s){return(i+(s-t)%i)%i+t})},Ng=function r(t,e,n){var i=e-t,s=i*2;return en(t)?_f(t,r(0,t.length-1),e):$i(n,function(o){return o=(s+(o-t)%s)%s||0,t+(o>i?s-o:o)})},ds=function(t){for(var e=0,n="",i,s,o,a;~(i=t.indexOf("random(",e));)o=t.indexOf(")",i),a=t.charAt(i+7)==="[",s=t.substr(i+7,o-i-7).match(a?Qh:rc),n+=t.substr(e,i-e)+gf(a?s:+s[0],a?0:+s[1],+s[2]||1e-5),e=o+1;return n+t.substr(e,t.length-e)},xf=function(t,e,n,i,s){var o=e-t,a=i-n;return $i(s,function(l){return n+((l-t)/o*a||0)})},Ug=function r(t,e,n,i){var s=isNaN(t+e)?0:function(d){return(1-d)*t+d*e};if(!s){var o=Be(t),a={},l,c,u,h,f;if(n===!0&&(i=1)&&(n=null),o)t={p:t},e={p:e};else if(en(t)&&!en(e)){for(u=[],h=t.length,f=h-2,c=1;c<h;c++)u.push(r(t[c-1],t[c]));h--,s=function(_){_*=h;var g=Math.min(f,~~_);return u[g](_-g)},n=e}else i||(t=Er(en(t)?[]:{},t));if(!u){for(l in e)Ec.call(a,t,l,"get",e[l]);s=function(_){return Rc(_,a)||(o?t.p:t)}}}return $i(n,s)},Yh=function(t,e,n){var i=t.labels,s=zn,o,a,l;for(o in i)a=i[o]-e,a<0==!!n&&a&&s>(a=Math.abs(a))&&(l=o,s=a);return l},Rn=function(t,e,n){var i=t.vars,s=i[e],o=be,a=t._ctx,l,c,u;if(s)return l=i[e+"Params"],c=i.callbackScope||t,n&&Yi.length&&ra(),a&&(be=a),u=l?s.apply(c,l):s.call(c),be=o,u},oo=function(t){return Ji(t),t.scrollTrigger&&t.scrollTrigger.kill(!!tn),t.progress()<1&&Rn(t,"onInterrupt"),t},ls,vf=[],yf=function(t){if(t)if(t=!t.name&&t.default||t,mc()||t.headless){var e=t.name,n=Ce(t),i=e&&!n&&t.init?function(){this._props=[]}:t,s={init:fo,render:Rc,add:Ec,kill:jg,modifier:Kg,rawVars:0},o={targetTest:0,get:0,getSetter:da,aliases:{},register:0};if(fs(),t!==i){if(Mn[e])return;Vn(i,Vn(sa(t,s),o)),Er(i.prototype,Er(s,sa(t,o))),Mn[i.prop=e]=i,t.targetTest&&(ea.push(i),vc[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}nf(e,i),t.register&&t.register(nn,i,fn)}else vf.push(t)},ge=255,ao={aqua:[0,ge,ge],lime:[0,ge,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,ge],navy:[0,0,128],white:[ge,ge,ge],olive:[128,128,0],yellow:[ge,ge,0],orange:[ge,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[ge,0,0],pink:[ge,192,203],cyan:[0,ge,ge],transparent:[ge,ge,ge,0]},jl=function(t,e,n){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(n-e)*t*6:t<.5?n:t*3<2?e+(n-e)*(2/3-t)*6:e)*ge+.5|0},Sf=function(t,e,n){var i=t?Ei(t)?[t>>16,t>>8&ge,t&ge]:0:ao.black,s,o,a,l,c,u,h,f,d,_;if(!i){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),ao[t])i=ao[t];else if(t.charAt(0)==="#"){if(t.length<6&&(s=t.charAt(1),o=t.charAt(2),a=t.charAt(3),t="#"+s+s+o+o+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return i=parseInt(t.substr(1,6),16),[i>>16,i>>8&ge,i&ge,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),i=[t>>16,t>>8&ge,t&ge]}else if(t.substr(0,3)==="hsl"){if(i=_=t.match(rc),!e)l=+i[0]%360/360,c=+i[1]/100,u=+i[2]/100,o=u<=.5?u*(c+1):u+c-u*c,s=u*2-o,i.length>3&&(i[3]*=1),i[0]=jl(l+1/3,s,o),i[1]=jl(l,s,o),i[2]=jl(l-1/3,s,o);else if(~t.indexOf("="))return i=t.match(gc),n&&i.length<4&&(i[3]=1),i}else i=t.match(rc)||ao.transparent;i=i.map(Number)}return e&&!_&&(s=i[0]/ge,o=i[1]/ge,a=i[2]/ge,h=Math.max(s,o,a),f=Math.min(s,o,a),u=(h+f)/2,h===f?l=c=0:(d=h-f,c=u>.5?d/(2-h-f):d/(h+f),l=h===s?(o-a)/d+(o<a?6:0):h===o?(a-s)/d+2:(s-o)/d+4,l*=60),i[0]=~~(l+.5),i[1]=~~(c*100+.5),i[2]=~~(u*100+.5)),n&&i.length<4&&(i[3]=1),i},Mf=function(t){var e=[],n=[],i=-1;return t.split(wi).forEach(function(s){var o=s.match(Tr)||[];e.push.apply(e,o),n.push(i+=o.length+1)}),e.c=n,e},Zh=function(t,e,n){var i="",s=(t+i).match(wi),o=e?"hsla(":"rgba(",a=0,l,c,u,h;if(!s)return t;if(s=s.map(function(f){return(f=Sf(f,e,1))&&o+(e?f[0]+","+f[1]+"%,"+f[2]+"%,"+f[3]:f.join(","))+")"}),n&&(u=Mf(t),l=n.c,l.join(i)!==u.c.join(i)))for(c=t.replace(wi,"1").split(Tr),h=c.length-1;a<h;a++)i+=c[a]+(~l.indexOf(a)?s.shift()||o+"0,0,0,0)":(u.length?u:s.length?s:n).shift());if(!c)for(c=t.split(wi),h=c.length-1;a<h;a++)i+=c[a]+s[a];return i+c[h]},wi=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in ao)r+="|"+t+"\\b";return new RegExp(r+")","gi")}(),Og=/hsl[a]?\(/,bc=function(t){var e=t.join(" "),n;if(wi.lastIndex=0,wi.test(e))return n=Og.test(e),t[1]=Zh(t[1],n),t[0]=Zh(t[0],n,Mf(t[1])),!0},po,bn=function(){var r=Date.now,t=500,e=33,n=r(),i=n,s=1e3/240,o=s,a=[],l,c,u,h,f,d,_=function g(m){var p=r()-i,b=m===!0,y,S,D,A;if((p>t||p<0)&&(n+=p-e),i+=p,D=i-n,y=D-o,(y>0||b)&&(A=++h.frame,f=D-h.time*1e3,h.time=D=D/1e3,o+=y+(y>=s?4:s-y),S=1),b||(l=c(g)),S)for(d=0;d<a.length;d++)a[d](D,f,A,m)};return h={time:0,frame:0,tick:function(){_(!0)},deltaRatio:function(m){return f/(1e3/(m||60))},wake:function(){tf&&(!sc&&mc()&&(ui=sc=window,xc=ui.document||{},Pn.gsap=nn,(ui.gsapVersions||(ui.gsapVersions=[])).push(nn.version),ef(ia||ui.GreenSockGlobals||!ui.gsap&&ui||{}),vf.forEach(yf)),u=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&h.sleep(),c=u||function(m){return setTimeout(m,o-h.time*1e3+1|0)},po=1,_(2))},sleep:function(){(u?cancelAnimationFrame:clearTimeout)(l),po=0,c=fo},lagSmoothing:function(m,p){t=m||1/0,e=Math.min(p||33,t)},fps:function(m){s=1e3/(m||240),o=h.time*1e3+s},add:function(m,p,b){var y=p?function(S,D,A,w){m(S,D,A,w),h.remove(y)}:m;return h.remove(m),a[b?"unshift":"push"](y),fs(),y},remove:function(m,p){~(p=a.indexOf(m))&&a.splice(p,1)&&d>=p&&d--},_listeners:a},h}(),fs=function(){return!po&&bn.wake()},se={},Bg=/^[\d.\-M][\d.\-,\s]/,zg=/["']/g,kg=function(t){for(var e={},n=t.substr(1,t.length-3).split(":"),i=n[0],s=1,o=n.length,a,l,c;s<o;s++)l=n[s],a=s!==o-1?l.lastIndexOf(","):l.length,c=l.substr(0,a),e[i]=isNaN(c)?c.replace(zg,"").trim():+c,i=l.substr(a+1).trim();return e},Vg=function(t){var e=t.indexOf("(")+1,n=t.indexOf(")"),i=t.indexOf("(",e);return t.substring(e,~i&&i<n?t.indexOf(")",n+1):n)},Hg=function(t){var e=(t+"").split("("),n=se[e[0]];return n&&e.length>1&&n.config?n.config.apply(null,~t.indexOf("{")?[kg(e[1])]:Vg(t).split(",").map(of)):se._CE&&Bg.test(t)?se._CE("",t):n},bf=function(t){return function(e){return 1-t(1-e)}},wf=function r(t,e){for(var n=t._first,i;n;)n instanceof Ze?r(n,e):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==e&&(n.timeline?r(n.timeline,e):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=e)),n=n._next},br=function(t,e){return t&&(Ce(t)?t:se[t]||Hg(t))||e},Dr=function(t,e,n,i){n===void 0&&(n=function(l){return 1-e(1-l)}),i===void 0&&(i=function(l){return l<.5?e(l*2)/2:1-e((1-l)*2)/2});var s={easeIn:e,easeOut:n,easeInOut:i},o;return hn(t,function(a){se[a]=Pn[a]=s,se[o=a.toLowerCase()]=n;for(var l in s)se[o+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=se[a+"."+l]=s[l]}),s},Ef=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},Ql=function r(t,e,n){var i=e>=1?e:1,s=(n||(t?.3:.45))/(e<1?e:1),o=s/ic*(Math.asin(1/i)||0),a=function(u){return u===1?1:i*Math.pow(2,-10*u)*gg((u-o)*s)+1},l=t==="out"?a:t==="in"?function(c){return 1-a(1-c)}:Ef(a);return s=ic/s,l.config=function(c,u){return r(t,c,u)},l},tc=function r(t,e){e===void 0&&(e=1.70158);var n=function(o){return o?--o*o*((e+1)*o+e)+1:0},i=t==="out"?n:t==="in"?function(s){return 1-n(1-s)}:Ef(n);return i.config=function(s){return r(t,s)},i};hn("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,t){var e=t<5?t+1:t;Dr(r+",Power"+(e-1),t?function(n){return Math.pow(n,e)}:function(n){return n},function(n){return 1-Math.pow(1-n,e)},function(n){return n<.5?Math.pow(n*2,e)/2:1-Math.pow((1-n)*2,e)/2})});se.Linear.easeNone=se.none=se.Linear.easeIn;Dr("Elastic",Ql("in"),Ql("out"),Ql());(function(r,t){var e=1/t,n=2*e,i=2.5*e,s=function(a){return a<e?r*a*a:a<n?r*Math.pow(a-1.5/t,2)+.75:a<i?r*(a-=2.25/t)*a+.9375:r*Math.pow(a-2.625/t,2)+.984375};Dr("Bounce",function(o){return 1-s(1-o)},s)})(7.5625,2.75);Dr("Expo",function(r){return r?Math.pow(2,10*(r-1)):0});Dr("Circ",function(r){return-(Kh(1-r*r)-1)});Dr("Sine",function(r){return r===1?1:-mg(r*dg)+1});Dr("Back",tc("in"),tc("out"),tc());se.SteppedEase=se.steps=Pn.SteppedEase={config:function(t,e){t===void 0&&(t=1);var n=1/t,i=t+(e?0:1),s=e?1:0,o=1-xe;return function(a){return((i*go(0,o,a)|0)+s)*n}}};cs.ease=se["quad.out"];hn("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return yc+=r+","+r+"Params,"});var wc=function(t,e){this.id=pg++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:Mc,this.set=e?e.getSetter:da},mo=function(){function r(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,hs(this,+e.duration,1,1),this.data=e.data,be&&(this._ctx=be,be.data.push(this)),po||bn.wake()}var t=r.prototype;return t.delay=function(n){return n||n===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+n-this._delay),this._delay=n,this):this._delay},t.duration=function(n){return arguments.length?this.totalDuration(this._repeat>0?n+(n+this._rDelay)*this._repeat:n):this.totalDuration()&&this._dur},t.totalDuration=function(n){return arguments.length?(this._dirty=0,hs(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(n,i){if(fs(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(fa(this,n),!s._dp||s.parent||cf(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&n<this._tDur||this._ts<0&&n>0||!this._tDur&&!n)&&hi(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===xe||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),sf(this,n,i)),this},t.time=function(n,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+Xh(this))%(this._dur+this._rDelay)||(n?this._dur:0),i):this._time},t.totalProgress=function(n,i){return arguments.length?this.totalTime(this.totalDuration()*n,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(n,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-n:n)+Xh(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(n,i){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(n-1)*s,i):this._repeat?us(this._tTime,s)+1:1},t.timeScale=function(n,i){if(!arguments.length)return this._rts===-xe?0:this._rts;if(this._rts===n)return this;var s=this.parent&&this._ts?oa(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-xe?0:this._rts,this.totalTime(go(-Math.abs(this._delay),this._tDur,s),i!==!1),ha(this),bg(this)},t.paused=function(n){return arguments.length?(this._ps!==n&&(this._ps=n,n?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(fs(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==xe&&(this._tTime-=xe)))),this):this._ps},t.startTime=function(n){if(arguments.length){this._start=n;var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&hi(i,this,n-this._delay),this}return this._start},t.endTime=function(n){return this._start+(wn(n)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(n){var i=this.parent||this._dp;return i?n&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?oa(i.rawTime(n),this):this._tTime:this._tTime},t.revert=function(n){n===void 0&&(n=vg);var i=tn;return tn=n,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),tn=i,this},t.globalTime=function(n){for(var i=this,s=arguments.length?n:i.rawTime();i;)s=i._start+s/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(n):s},t.repeat=function(n){return arguments.length?(this._repeat=n===1/0?-2:n,qh(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(n){if(arguments.length){var i=this._time;return this._rDelay=n,qh(this),i?this.time(i):this}return this._rDelay},t.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},t.seek=function(n,i){return this.totalTime(Bn(this,n),wn(i))},t.restart=function(n,i){return this.play().totalTime(n?-this._delay:0,wn(i))},t.play=function(n,i){return n!=null&&this.seek(n,i),this.reversed(!1).paused(!1)},t.reverse=function(n,i){return n!=null&&this.seek(n||this.totalDuration(),i),this.reversed(!0).paused(!1)},t.pause=function(n,i){return n!=null&&this.seek(n,i),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(n){return arguments.length?(!!n!==this.reversed()&&this.timeScale(-this._rts||(n?-xe:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-xe,this},t.isActive=function(){var n=this.parent||this._dp,i=this._start,s;return!!(!n||this._ts&&this._initted&&n.isActive()&&(s=n.rawTime(!0))>=i&&s<this.endTime(!0)-xe)},t.eventCallback=function(n,i,s){var o=this.vars;return arguments.length>1?(i?(o[n]=i,s&&(o[n+"Params"]=s),n==="onUpdate"&&(this._onUpdate=i)):delete o[n],this):o[n]},t.then=function(n){var i=this;return new Promise(function(s){var o=Ce(n)?n:af,a=function(){var c=i.then;i.then=null,Ce(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=c),s(o),i.then=c};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?a():i._prom=a})},t.kill=function(){oo(this)},r}();Vn(mo.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:-xe,_prom:0,_ps:!1,_rts:1});var Ze=function(r){$h(t,r);function t(n,i){var s;return n===void 0&&(n={}),s=r.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=wn(n.sortChildren),Te&&hi(n.parent||Te,bi(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&uf(bi(s),n.scrollTrigger),s}var e=t.prototype;return e.to=function(i,s,o){return co(0,arguments,this),this},e.from=function(i,s,o){return co(1,arguments,this),this},e.fromTo=function(i,s,o,a){return co(2,arguments,this),this},e.set=function(i,s,o){return s.duration=0,s.parent=this,lo(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Ie(i,s,Bn(this,o),1),this},e.call=function(i,s,o){return hi(this,Ie.delayedCall(0,i,s),o)},e.staggerTo=function(i,s,o,a,l,c,u){return o.duration=s,o.stagger=o.stagger||a,o.onComplete=c,o.onCompleteParams=u,o.parent=this,new Ie(i,o,Bn(this,l)),this},e.staggerFrom=function(i,s,o,a,l,c,u){return o.runBackwards=1,lo(o).immediateRender=wn(o.immediateRender),this.staggerTo(i,s,o,a,l,c,u)},e.staggerFromTo=function(i,s,o,a,l,c,u,h){return a.startAt=o,lo(a).immediateRender=wn(a.immediateRender),this.staggerTo(i,s,a,l,c,u,h)},e.render=function(i,s,o){var a=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,u=i<=0?0:Ge(i),h=this._zTime<0!=i<0&&(this._initted||!c),f,d,_,g,m,p,b,y,S,D,A,w;if(this!==Te&&u>l&&i>=0&&(u=l),u!==this._tTime||o||h){if(a!==this._time&&c&&(u+=this._time-a,i+=this._time-a),f=u,S=this._start,y=this._ts,p=!y,h&&(c||(a=this._zTime),(i||!s)&&(this._zTime=i)),this._repeat){if(A=this._yoyo,m=c+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(m*100+i,s,o);if(f=Ge(u%m),u===l?(g=this._repeat,f=c):(g=~~(u/m),g&&g===u/m&&(f=c,g--),f>c&&(f=c)),D=us(this._tTime,m),!a&&this._tTime&&D!==g&&this._tTime-D*m-this._dur<=0&&(D=g),A&&g&1&&(f=c-f,w=1),g!==D&&!this._lock){var P=A&&D&1,M=P===(A&&g&1);if(g<D&&(P=!P),a=P?0:u%c?c:u,this._lock=1,this.render(a||(w?0:Ge(g*m)),s,!c)._lock=0,this._tTime=u,!s&&this.parent&&Rn(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1),a&&a!==this._time||p!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,M&&(this._lock=2,a=P?c:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!p)return this;wf(this,w)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(b=Ag(this,Ge(a),Ge(f)),b&&(u-=f-(f=b._start))),this._tTime=u,this._time=f,this._act=!y,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,a=0),!a&&f&&!s&&!g&&(Rn(this,"onStart"),this._tTime!==u))return this;if(f>=a&&i>=0)for(d=this._first;d;){if(_=d._next,(d._act||f>=d._start)&&d._ts&&b!==d){if(d.parent!==this)return this.render(i,s,o);if(d.render(d._ts>0?(f-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(f-d._start)*d._ts,s,o),f!==this._time||!this._ts&&!p){b=0,_&&(u+=this._zTime=-xe);break}}d=_}else{d=this._last;for(var v=i<0?i:f;d;){if(_=d._prev,(d._act||v<=d._end)&&d._ts&&b!==d){if(d.parent!==this)return this.render(i,s,o);if(d.render(d._ts>0?(v-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(v-d._start)*d._ts,s,o||tn&&(d._initted||d._startAt)),f!==this._time||!this._ts&&!p){b=0,_&&(u+=this._zTime=v?-xe:xe);break}}d=_}}if(b&&!s&&(this.pause(),b.render(f>=a?0:-xe)._zTime=f>=a?1:-1,this._ts))return this._start=S,ha(this),this.render(i,s,o);this._onUpdate&&!s&&Rn(this,"onUpdate",!0),(u===l&&this._tTime>=this.totalDuration()||!u&&a)&&(S===this._start||Math.abs(y)!==Math.abs(this._ts))&&(this._lock||((i||!c)&&(u===l&&this._ts>0||!u&&this._ts<0)&&Ji(this,1),!s&&!(i<0&&!a)&&(u||a||!l)&&(Rn(this,u===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(i,s){var o=this;if(Ei(s)||(s=Bn(this,s,i)),!(i instanceof mo)){if(en(i))return i.forEach(function(a){return o.add(a,s)}),this;if(Be(i))return this.addLabel(i,s);if(Ce(i))i=Ie.delayedCall(0,i);else return this}return this!==i?hi(this,i,s):this},e.getChildren=function(i,s,o,a){i===void 0&&(i=!0),s===void 0&&(s=!0),o===void 0&&(o=!0),a===void 0&&(a=-zn);for(var l=[],c=this._first;c;)c._start>=a&&(c instanceof Ie?s&&l.push(c):(o&&l.push(c),i&&l.push.apply(l,c.getChildren(!0,s,o)))),c=c._next;return l},e.getById=function(i){for(var s=this.getChildren(1,1,1),o=s.length;o--;)if(s[o].vars.id===i)return s[o]},e.remove=function(i){return Be(i)?this.removeLabel(i):Ce(i)?this.killTweensOf(i):(ua(this,i),i===this._recent&&(this._recent=this._last),Mr(this))},e.totalTime=function(i,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ge(bn.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),r.prototype.totalTime.call(this,i,s),this._forcing=0,this):this._tTime},e.addLabel=function(i,s){return this.labels[i]=Bn(this,s),this},e.removeLabel=function(i){return delete this.labels[i],this},e.addPause=function(i,s,o){var a=Ie.delayedCall(0,s||fo,o);return a.data="isPause",this._hasPause=1,hi(this,a,Bn(this,i))},e.removePause=function(i){var s=this._first;for(i=Bn(this,i);s;)s._start===i&&s.data==="isPause"&&Ji(s),s=s._next},e.killTweensOf=function(i,s,o){for(var a=this.getTweensOf(i,o),l=a.length;l--;)qi!==a[l]&&a[l].kill(i,s);return this},e.getTweensOf=function(i,s){for(var o=[],a=kn(i),l=this._first,c=Ei(s),u;l;)l instanceof Ie?yg(l._targets,a)&&(c?(!qi||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&o.push(l):(u=l.getTweensOf(a,s)).length&&o.push.apply(o,u),l=l._next;return o},e.tweenTo=function(i,s){s=s||{};var o=this,a=Bn(o,i),l=s,c=l.startAt,u=l.onStart,h=l.onStartParams,f=l.immediateRender,d,_=Ie.to(o,Vn({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale())||xe,onStart:function(){if(o.pause(),!d){var m=s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale());_._dur!==m&&hs(_,m,0,1).render(_._time,!0,!0),d=1}u&&u.apply(_,h||[])}},s));return f?_.render(0):_},e.tweenFromTo=function(i,s,o){return this.tweenTo(s,Vn({startAt:{time:Bn(this,i)}},o))},e.recent=function(){return this._recent},e.nextLabel=function(i){return i===void 0&&(i=this._time),Yh(this,Bn(this,i))},e.previousLabel=function(i){return i===void 0&&(i=this._time),Yh(this,Bn(this,i),1)},e.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+xe)},e.shiftChildren=function(i,s,o){o===void 0&&(o=0);for(var a=this._first,l=this.labels,c;a;)a._start>=o&&(a._start+=i,a._end+=i),a=a._next;if(s)for(c in l)l[c]>=o&&(l[c]+=i);return Mr(this)},e.invalidate=function(i){var s=this._first;for(this._lock=0;s;)s.invalidate(i),s=s._next;return r.prototype.invalidate.call(this,i)},e.clear=function(i){i===void 0&&(i=!0);for(var s=this._first,o;s;)o=s._next,this.remove(s),s=o;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),Mr(this)},e.totalDuration=function(i){var s=0,o=this,a=o._last,l=zn,c,u,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-i:i));if(o._dirty){for(h=o.parent;a;)c=a._prev,a._dirty&&a.totalDuration(),u=a._start,u>l&&o._sort&&a._ts&&!o._lock?(o._lock=1,hi(o,a,u-a._delay,1)._lock=0):l=u,u<0&&a._ts&&(s-=u,(!h&&!o._dp||h&&h.smoothChildTiming)&&(o._start+=u/o._ts,o._time-=u,o._tTime-=u),o.shiftChildren(-u,!1,-1/0),l=0),a._end>s&&a._ts&&(s=a._end),a=c;hs(o,o===Te&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(i){if(Te._ts&&(sf(Te,oa(i,Te)),rf=bn.frame),bn.frame>=Gh){Gh+=En.autoSleep||120;var s=Te._first;if((!s||!s._ts)&&En.autoSleep&&bn._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||bn.sleep()}}},t}(mo);Vn(Ze.prototype,{_lock:0,_hasPause:0,_forcing:0});var Gg=function(t,e,n,i,s,o,a){var l=new fn(this._pt,t,e,0,1,Cc,null,s),c=0,u=0,h,f,d,_,g,m,p,b;for(l.b=n,l.e=i,n+="",i+="",(p=~i.indexOf("random("))&&(i=ds(i)),o&&(b=[n,i],o(b,t,e),n=b[0],i=b[1]),f=n.match($l)||[];h=$l.exec(i);)_=h[0],g=i.substring(c,h.index),d?d=(d+1)%5:g.substr(-5)==="rgba("&&(d=1),_!==f[u++]&&(m=parseFloat(f[u-1])||0,l._pt={_next:l._pt,p:g||u===1?g:",",s:m,c:_.charAt(1)==="="?Ar(m,_)-m:parseFloat(_)-m,m:d&&d<4?Math.round:0},c=$l.lastIndex);return l.c=c<i.length?i.substring(c,i.length):"",l.fp=a,(_c.test(i)||p)&&(l.e=0),this._pt=l,l},Ec=function(t,e,n,i,s,o,a,l,c,u){Ce(i)&&(i=i(s||0,t,o));var h=t[e],f=n!=="get"?n:Ce(h)?c?t[e.indexOf("set")||!Ce(t["get"+e.substr(3)])?e:"get"+e.substr(3)](c):t[e]():h,d=Ce(h)?c?Zg:Df:Dc,_;if(Be(i)&&(~i.indexOf("random(")&&(i=ds(i)),i.charAt(1)==="="&&(_=Ar(f,i)+(Je(f)||0),(_||_===0)&&(i=_))),!u||f!==i||fc)return!isNaN(f*i)&&i!==""?(_=new fn(this._pt,t,e,+f||0,i-(f||0),typeof h=="boolean"?$g:Cf,0,d),c&&(_.fp=c),a&&_.modifier(a,this,t),this._pt=_):(!h&&!(e in t)&&ca(e,i),Gg.call(this,t,e,f,i,d,l||En.stringFilter,c))},Wg=function(t,e,n,i,s){if(Ce(t)&&(t=uo(t,s,e,n,i)),!fi(t)||t.style&&t.nodeType||en(t)||jh(t))return Be(t)?uo(t,s,e,n,i):t;var o={},a;for(a in t)o[a]=uo(t[a],s,e,n,i);return o},Tc=function(t,e,n,i,s,o){var a,l,c,u;if(Mn[t]&&(a=new Mn[t]).init(s,a.rawVars?e[t]:Wg(e[t],i,s,o,n),n,i,o)!==!1&&(n._pt=l=new fn(n._pt,s,t,0,1,a.render,a,0,a.priority),n!==ls))for(c=n._ptLookup[n._targets.indexOf(s)],u=a._props.length;u--;)c[a._props[u]]=l;return a},qi,fc,Ac=function r(t,e,n){var i=t.vars,s=i.ease,o=i.startAt,a=i.immediateRender,l=i.lazy,c=i.onUpdate,u=i.runBackwards,h=i.yoyoEase,f=i.keyframes,d=i.autoRevert,_=t._dur,g=t._startAt,m=t._targets,p=t.parent,b=p&&p.data==="nested"?p.vars.targets:m,y=t._overwrite==="auto"&&!pc,S=t.timeline,D,A,w,P,M,v,N,F,R,B,Y,H,J;if(S&&(!f||!s)&&(s="none"),t._ease=br(s,cs.ease),t._yEase=h?bf(br(h===!0?s:h,cs.ease)):0,h&&t._yoyo&&!t._repeat&&(h=t._yEase,t._yEase=t._ease,t._ease=h),t._from=!S&&!!i.runBackwards,!S||f&&!i.stagger){if(F=m[0]?Zi(m[0]).harness:0,H=F&&i[F.prop],D=sa(i,vc),g&&(g._zTime<0&&g.progress(1),e<0&&u&&a&&!d?g.render(-1,!0):g.revert(u&&_?ta:xg),g._lazy=0),o){if(Ji(t._startAt=Ie.set(m,Vn({data:"isStart",overwrite:!1,parent:p,immediateRender:!0,lazy:!g&&wn(l),startAt:null,delay:0,onUpdate:c&&function(){return Rn(t,"onUpdate")},stagger:0},o))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(tn||!a&&!d)&&t._startAt.revert(ta),a&&_&&e<=0&&n<=0){e&&(t._zTime=e);return}}else if(u&&_&&!g){if(e&&(a=!1),w=Vn({overwrite:!1,data:"isFromStart",lazy:a&&!g&&wn(l),immediateRender:a,stagger:0,parent:p},D),H&&(w[F.prop]=H),Ji(t._startAt=Ie.set(m,w)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(tn?t._startAt.revert(ta):t._startAt.render(-1,!0)),t._zTime=e,!a)r(t._startAt,xe,xe);else if(!e)return}for(t._pt=t._ptCache=0,l=_&&wn(l)||l&&!_,A=0;A<m.length;A++){if(M=m[A],N=M._gsap||Sc(m)[A]._gsap,t._ptLookup[A]=B={},oc[N.id]&&Yi.length&&ra(),Y=b===m?A:b.indexOf(M),F&&(R=new F).init(M,H||D,t,Y,b)!==!1&&(t._pt=P=new fn(t._pt,M,R.name,0,1,R.render,R,0,R.priority),R._props.forEach(function(O){B[O]=P}),R.priority&&(v=1)),!F||H)for(w in D)Mn[w]&&(R=Tc(w,D,t,Y,M,b))?R.priority&&(v=1):B[w]=P=Ec.call(t,M,w,"get",D[w],Y,b,0,i.stringFilter);t._op&&t._op[A]&&t.kill(M,t._op[A]),y&&t._pt&&(qi=t,Te.killTweensOf(M,B,t.globalTime(e)),J=!t.parent,qi=0),t._pt&&l&&(oc[N.id]=1)}v&&Pc(t),t._onInit&&t._onInit(t)}t._onUpdate=c,t._initted=(!t._op||t._pt)&&!J,f&&e<=0&&S.render(zn,!0,!0)},Xg=function(t,e,n,i,s,o,a,l){var c=(t._pt&&t._ptCache||(t._ptCache={}))[e],u,h,f,d;if(!c)for(c=t._ptCache[e]=[],f=t._ptLookup,d=t._targets.length;d--;){if(u=f[d][e],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return fc=1,t.vars[e]="+=0",Ac(t,a),fc=0,l?ho(e+" not eligible for reset"):1;c.push(u)}for(d=c.length;d--;)h=c[d],u=h._pt||h,u.s=(i||i===0)&&!s?i:u.s+(i||0)+o*u.c,u.c=n-u.s,h.e&&(h.e=Re(n)+Je(h.e)),h.b&&(h.b=u.s+Je(h.b))},qg=function(t,e){var n=t[0]?Zi(t[0]).harness:0,i=n&&n.aliases,s,o,a,l;if(!i)return e;s=Er({},e);for(o in i)if(o in s)for(l=i[o].split(","),a=l.length;a--;)s[l[a]]=s[o];return s},Yg=function(t,e,n,i){var s=e.ease||i||"power1.inOut",o,a;if(en(e))a=n[t]||(n[t]=[]),e.forEach(function(l,c){return a.push({t:c/(e.length-1)*100,v:l,e:s})});else for(o in e)a=n[o]||(n[o]=[]),o==="ease"||a.push({t:parseFloat(t),v:e[o],e:s})},uo=function(t,e,n,i,s){return Ce(t)?t.call(e,n,i,s):Be(t)&&~t.indexOf("random(")?ds(t):t},Tf=yc+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",Af={};hn(Tf+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return Af[r]=1});var Ie=function(r){$h(t,r);function t(n,i,s,o){var a;typeof i=="number"&&(s.duration=i,i=s,s=null),a=r.call(this,o?i:lo(i))||this;var l=a.vars,c=l.duration,u=l.delay,h=l.immediateRender,f=l.stagger,d=l.overwrite,_=l.keyframes,g=l.defaults,m=l.scrollTrigger,p=l.yoyoEase,b=i.parent||Te,y=(en(n)||jh(n)?Ei(n[0]):"length"in i)?[n]:kn(n),S,D,A,w,P,M,v,N;if(a._targets=y.length?Sc(y):ho("GSAP target "+n+" not found. https://gsap.com",!En.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=d,_||f||Qo(c)||Qo(u)){if(i=a.vars,S=a.timeline=new Ze({data:"nested",defaults:g||{},targets:b&&b.data==="nested"?b.vars.targets:y}),S.kill(),S.parent=S._dp=bi(a),S._start=0,f||Qo(c)||Qo(u)){if(w=y.length,v=f&&pf(f),fi(f))for(P in f)~Tf.indexOf(P)&&(N||(N={}),N[P]=f[P]);for(D=0;D<w;D++)A=sa(i,Af),A.stagger=0,p&&(A.yoyoEase=p),N&&Er(A,N),M=y[D],A.duration=+uo(c,bi(a),D,M,y),A.delay=(+uo(u,bi(a),D,M,y)||0)-a._delay,!f&&w===1&&A.delay&&(a._delay=u=A.delay,a._start+=u,A.delay=0),S.to(M,A,v?v(D,M,y):0),S._ease=se.none;S.duration()?c=u=0:a.timeline=0}else if(_){lo(Vn(S.vars.defaults,{ease:"none"})),S._ease=br(_.ease||i.ease||"none");var F=0,R,B,Y;if(en(_))_.forEach(function(H){return S.to(y,H,">")}),S.duration();else{A={};for(P in _)P==="ease"||P==="easeEach"||Yg(P,_[P],A,_.easeEach);for(P in A)for(R=A[P].sort(function(H,J){return H.t-J.t}),F=0,D=0;D<R.length;D++)B=R[D],Y={ease:B.e,duration:(B.t-(D?R[D-1].t:0))/100*c},Y[P]=B.v,S.to(y,Y,F),F+=Y.duration;S.duration()<c&&S.to({},{duration:c-S.duration()})}}c||a.duration(c=S.duration())}else a.timeline=0;return d===!0&&!pc&&(qi=bi(a),Te.killTweensOf(y),qi=0),hi(b,bi(a),s),i.reversed&&a.reverse(),i.paused&&a.paused(!0),(h||!c&&!_&&a._start===Ge(b._time)&&wn(h)&&wg(bi(a))&&b.data!=="nested")&&(a._tTime=-xe,a.render(Math.max(0,-u)||0)),m&&uf(bi(a),m),a}var e=t.prototype;return e.render=function(i,s,o){var a=this._time,l=this._tDur,c=this._dur,u=i<0,h=i>l-xe&&!u?l:i<xe?0:i,f,d,_,g,m,p,b,y,S;if(!c)Tg(this,i,s,o);else if(h!==this._tTime||!i||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u){if(f=h,y=this.timeline,this._repeat){if(g=c+this._rDelay,this._repeat<-1&&u)return this.totalTime(g*100+i,s,o);if(f=Ge(h%g),h===l?(_=this._repeat,f=c):(_=~~(h/g),_&&_===Ge(h/g)&&(f=c,_--),f>c&&(f=c)),p=this._yoyo&&_&1,p&&(S=this._yEase,f=c-f),m=us(this._tTime,g),f===a&&!o&&this._initted&&_===m)return this._tTime=h,this;_!==m&&(y&&this._yEase&&wf(y,p),this.vars.repeatRefresh&&!p&&!this._lock&&this._time!==g&&this._initted&&(this._lock=o=1,this.render(Ge(g*_),!0).invalidate()._lock=0))}if(!this._initted){if(hf(this,u?i:f,o,s,h))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&_!==m))return this;if(c!==this._dur)return this.render(i,s,o)}if(this._tTime=h,this._time=f,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=b=(S||this._ease)(f/c),this._from&&(this.ratio=b=1-b),f&&!a&&!s&&!_&&(Rn(this,"onStart"),this._tTime!==h))return this;for(d=this._pt;d;)d.r(b,d.d),d=d._next;y&&y.render(i<0?i:y._dur*y._ease(f/this._dur),s,o)||this._startAt&&(this._zTime=i),this._onUpdate&&!s&&(u&&ac(this,i,s,o),Rn(this,"onUpdate")),this._repeat&&_!==m&&this.vars.onRepeat&&!s&&this.parent&&Rn(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(u&&!this._onUpdate&&ac(this,i,!0,!0),(i||!c)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&Ji(this,1),!s&&!(u&&!a)&&(h||a||p)&&(Rn(this,h===l?"onComplete":"onReverseComplete",!0),this._prom&&!(h<l&&this.timeScale()>0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),r.prototype.invalidate.call(this,i)},e.resetTo=function(i,s,o,a,l){po||bn.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||Ac(this,c),u=this._ease(c/this._dur),Xg(this,i,s,o,a,u,c,l)?this.resetTo(i,s,o,a,1):(fa(this,0),this.parent||lf(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(i,s){if(s===void 0&&(s="all"),!i&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?oo(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(i,s,qi&&qi.vars.overwrite!==!0)._first||oo(this),this.parent&&o!==this.timeline.totalDuration()&&hs(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,l=i?kn(i):a,c=this._ptLookup,u=this._pt,h,f,d,_,g,m,p;if((!s||s==="all")&&Mg(a,l))return s==="all"&&(this._pt=0),oo(this);for(h=this._op=this._op||[],s!=="all"&&(Be(s)&&(g={},hn(s,function(b){return g[b]=1}),s=g),s=qg(a,s)),p=a.length;p--;)if(~l.indexOf(a[p])){f=c[p],s==="all"?(h[p]=s,_=f,d={}):(d=h[p]=h[p]||{},_=s);for(g in _)m=f&&f[g],m&&((!("kill"in m.d)||m.d.kill(g)===!0)&&ua(this,m,"_pt"),delete f[g]),d!=="all"&&(d[g]=1)}return this._initted&&!this._pt&&u&&oo(this),this},t.to=function(i,s){return new t(i,s,arguments[2])},t.from=function(i,s){return co(1,arguments)},t.delayedCall=function(i,s,o,a){return new t(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:s,onReverseComplete:s,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},t.fromTo=function(i,s,o){return co(2,arguments)},t.set=function(i,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new t(i,s)},t.killTweensOf=function(i,s,o){return Te.killTweensOf(i,s,o)},t}(mo);Vn(Ie.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});hn("staggerTo,staggerFrom,staggerFromTo",function(r){Ie[r]=function(){var t=new Ze,e=cc.call(arguments,0);return e.splice(r==="staggerFromTo"?5:4,0,0),t[r].apply(t,e)}});var Dc=function(t,e,n){return t[e]=n},Df=function(t,e,n){return t[e](n)},Zg=function(t,e,n,i){return t[e](i.fp,n)},Jg=function(t,e,n){return t.setAttribute(e,n)},da=function(t,e){return Ce(t[e])?Df:la(t[e])&&t.setAttribute?Jg:Dc},Cf=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},$g=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},Cc=function(t,e){var n=e._pt,i="";if(!t&&e.b)i=e.b;else if(t===1&&e.e)i=e.e;else{for(;n;)i=n.p+(n.m?n.m(n.s+n.c*t):Math.round((n.s+n.c*t)*1e4)/1e4)+i,n=n._next;i+=e.c}e.set(e.t,e.p,i,e)},Rc=function(t,e){for(var n=e._pt;n;)n.r(t,n.d),n=n._next},Kg=function(t,e,n,i){for(var s=this._pt,o;s;)o=s._next,s.p===i&&s.modifier(t,e,n),s=o},jg=function(t){for(var e=this._pt,n,i;e;)i=e._next,e.p===t&&!e.op||e.op===t?ua(this,e,"_pt"):e.dep||(n=1),e=i;return!n},Qg=function(t,e,n,i){i.mSet(t,e,i.m.call(i.tween,n,i.mt),i)},Pc=function(t){for(var e=t._pt,n,i,s,o;e;){for(n=e._next,i=s;i&&i.pr>e.pr;)i=i._next;(e._prev=i?i._prev:o)?e._prev._next=e:s=e,(e._next=i)?i._prev=e:o=e,e=n}t._pt=s},fn=function(){function r(e,n,i,s,o,a,l,c,u){this.t=n,this.s=s,this.c=o,this.p=i,this.r=a||Cf,this.d=l||this,this.set=c||Dc,this.pr=u||0,this._next=e,e&&(e._prev=this)}var t=r.prototype;return t.modifier=function(n,i,s){this.mSet=this.mSet||this.set,this.set=Qg,this.m=n,this.mt=s,this.tween=i},r}();hn(yc+"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(r){return vc[r]=1});Pn.TweenMax=Pn.TweenLite=Ie;Pn.TimelineLite=Pn.TimelineMax=Ze;Te=new Ze({sortChildren:!1,defaults:cs,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});En.stringFilter=bc;var wr=[],na={},t_=[],Jh=0,e_=0,ec=function(t){return(na[t]||t_).map(function(e){return e()})},dc=function(){var t=Date.now(),e=[];t-Jh>2&&(ec("matchMediaInit"),wr.forEach(function(n){var i=n.queries,s=n.conditions,o,a,l,c;for(a in i)o=ui.matchMedia(i[a]).matches,o&&(l=1),o!==s[a]&&(s[a]=o,c=1);c&&(n.revert(),l&&e.push(n))}),ec("matchMediaRevert"),e.forEach(function(n){return n.onMatch(n,function(i){return n.add(null,i)})}),Jh=t,ec("matchMedia"))},Rf=function(){function r(e,n){this.selector=n&&uc(n),this.data=[],this._r=[],this.isReverted=!1,this.id=e_++,e&&this.add(e)}var t=r.prototype;return t.add=function(n,i,s){Ce(n)&&(s=i,i=n,n=Ce);var o=this,a=function(){var c=be,u=o.selector,h;return c&&c!==o&&c.data.push(o),s&&(o.selector=uc(s)),be=o,h=i.apply(o,arguments),Ce(h)&&o._r.push(h),be=c,o.selector=u,o.isReverted=!1,h};return o.last=a,n===Ce?a(o,function(l){return o.add(null,l)}):n?o[n]=a:a},t.ignore=function(n){var i=be;be=null,n(this),be=i},t.getTweens=function(){var n=[];return this.data.forEach(function(i){return i instanceof r?n.push.apply(n,i.getTweens()):i instanceof Ie&&!(i.parent&&i.parent.data==="nested")&&n.push(i)}),n},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(n,i){var s=this;if(n?function(){for(var a=s.getTweens(),l=s.data.length,c;l--;)c=s.data[l],c.data==="isFlip"&&(c.revert(),c.getChildren(!0,!0,!1).forEach(function(u){return a.splice(a.indexOf(u),1)}));for(a.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,h){return h.g-u.g||-1/0}).forEach(function(u){return u.t.revert(n)}),l=s.data.length;l--;)c=s.data[l],c instanceof Ze?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof Ie)&&c.revert&&c.revert(n);s._r.forEach(function(u){return u(n,s)}),s.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),i)for(var o=wr.length;o--;)wr[o].id===this.id&&wr.splice(o,1)},t.revert=function(n){this.kill(n||{})},r}(),n_=function(){function r(e){this.contexts=[],this.scope=e,be&&be.data.push(this)}var t=r.prototype;return t.add=function(n,i,s){fi(n)||(n={matches:n});var o=new Rf(0,s||this.scope),a=o.conditions={},l,c,u;be&&!o.selector&&(o.selector=be.selector),this.contexts.push(o),i=o.add("onMatch",i),o.queries=n;for(c in n)c==="all"?u=1:(l=ui.matchMedia(n[c]),l&&(wr.indexOf(o)<0&&wr.push(o),(a[c]=l.matches)&&(u=1),l.addListener?l.addListener(dc):l.addEventListener("change",dc)));return u&&i(o,function(h){return o.add(null,h)}),this},t.revert=function(n){this.kill(n||{})},t.kill=function(n){this.contexts.forEach(function(i){return i.kill(n,!0)})},r}(),aa={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach(function(i){return yf(i)})},timeline:function(t){return new Ze(t)},getTweensOf:function(t,e){return Te.getTweensOf(t,e)},getProperty:function(t,e,n,i){Be(t)&&(t=kn(t)[0]);var s=Zi(t||{}).get,o=n?af:of;return n==="native"&&(n=""),t&&(e?o((Mn[e]&&Mn[e].get||s)(t,e,n,i)):function(a,l,c){return o((Mn[a]&&Mn[a].get||s)(t,a,l,c))})},quickSetter:function(t,e,n){if(t=kn(t),t.length>1){var i=t.map(function(u){return nn.quickSetter(u,e,n)}),s=i.length;return function(u){for(var h=s;h--;)i[h](u)}}t=t[0]||{};var o=Mn[e],a=Zi(t),l=a.harness&&(a.harness.aliases||{})[e]||e,c=o?function(u){var h=new o;ls._pt=0,h.init(t,n?u+n:u,ls,0,[t]),h.render(1,h),ls._pt&&Rc(1,ls)}:a.set(t,l);return o?c:function(u){return c(t,l,n?u+n:u,a,1)}},quickTo:function(t,e,n){var i,s=nn.to(t,Er((i={},i[e]="+=0.1",i.paused=!0,i),n||{})),o=function(l,c,u){return s.resetTo(e,l,c,u)};return o.tween=s,o},isTweening:function(t){return Te.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=br(t.ease,cs.ease)),Wh(cs,t||{})},config:function(t){return Wh(En,t||{})},registerEffect:function(t){var e=t.name,n=t.effect,i=t.plugins,s=t.defaults,o=t.extendTimeline;(i||"").split(",").forEach(function(a){return a&&!Mn[a]&&!Pn[a]&&ho(e+" effect requires "+a+" plugin.")}),Kl[e]=function(a,l,c){return n(kn(a),Vn(l||{},s),c)},o&&(Ze.prototype[e]=function(a,l,c){return this.add(Kl[e](a,fi(l)?l:(c=l)&&{},this),c)})},registerEase:function(t,e){se[t]=br(e)},parseEase:function(t,e){return arguments.length?br(t,e):se},getById:function(t){return Te.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var n=new Ze(t),i,s;for(n.smoothChildTiming=wn(t.smoothChildTiming),Te.remove(n),n._dp=0,n._time=n._tTime=Te._time,i=Te._first;i;)s=i._next,(e||!(!i._dur&&i instanceof Ie&&i.vars.onComplete===i._targets[0]))&&hi(n,i,i._start-i._delay),i=s;return hi(Te,n,0),n},context:function(t,e){return t?new Rf(t,e):be},matchMedia:function(t){return new n_(t)},matchMediaRefresh:function(){return wr.forEach(function(t){var e=t.conditions,n,i;for(i in e)e[i]&&(e[i]=!1,n=1);n&&t.revert()})||dc()},addEventListener:function(t,e){var n=na[t]||(na[t]=[]);~n.indexOf(e)||n.push(e)},removeEventListener:function(t,e){var n=na[t],i=n&&n.indexOf(e);i>=0&&n.splice(i,1)},utils:{wrap:Fg,wrapYoyo:Ng,distribute:pf,random:gf,snap:mf,normalize:Lg,getUnit:Je,clamp:Cg,splitColor:Sf,toArray:kn,selector:uc,mapRange:xf,pipe:Pg,unitize:Ig,interpolate:Ug,shuffle:df},install:ef,effects:Kl,ticker:bn,updateRoot:Ze.updateRoot,plugins:Mn,globalTimeline:Te,core:{PropTween:fn,globals:nf,Tween:Ie,Timeline:Ze,Animation:mo,getCache:Zi,_removeLinkedListItem:ua,reverting:function(){return tn},context:function(t){return t&&be&&(be.data.push(t),t._ctx=be),be},suppressOverwrites:function(t){return pc=t}}};hn("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return aa[r]=Ie[r]});bn.add(Ze.updateRoot);ls=aa.to({},{duration:0});var i_=function(t,e){for(var n=t._pt;n&&n.p!==e&&n.op!==e&&n.fp!==e;)n=n._next;return n},r_=function(t,e){var n=t._targets,i,s,o;for(i in e)for(s=n.length;s--;)o=t._ptLookup[s][i],o&&(o=o.d)&&(o._pt&&(o=i_(o,i)),o&&o.modifier&&o.modifier(e[i],t,n[s],i))},nc=function(t,e){return{name:t,rawVars:1,init:function(i,s,o){o._onInit=function(a){var l,c;if(Be(s)&&(l={},hn(s,function(u){return l[u]=1}),s=l),e){l={};for(c in s)l[c]=e(s[c]);s=l}r_(a,s)}}}},nn=aa.registerPlugin({name:"attr",init:function(t,e,n,i,s){var o,a,l;this.tween=n;for(o in e)l=t.getAttribute(o)||"",a=this.add(t,"setAttribute",(l||0)+"",e[o],i,s,0,0,o),a.op=o,a.b=l,this._props.push(o)},render:function(t,e){for(var n=e._pt;n;)tn?n.set(n.t,n.p,n.b,n):n.r(t,n.d),n=n._next}},{name:"endArray",init:function(t,e){for(var n=e.length;n--;)this.add(t,n,t[n]||0,e[n],0,0,0,0,0,1)}},nc("roundProps",hc),nc("modifiers"),nc("snap",mf))||aa;Ie.version=Ze.version=nn.version="3.12.5";tf=1;mc()&&fs();var s_=se.Power0,o_=se.Power1,a_=se.Power2,l_=se.Power3,c_=se.Power4,u_=se.Linear,h_=se.Quad,f_=se.Cubic,d_=se.Quart,p_=se.Quint,m_=se.Strong,g_=se.Elastic,__=se.Back,x_=se.SteppedEase,v_=se.Bounce,y_=se.Sine,S_=se.Expo,M_=se.Circ;var Pf,Ki,ms,Bc,Ir,b_,If,zc,w_=function(){return typeof window<"u"},Ai={},Pr=180/Math.PI,gs=Math.PI/180,ps=Math.atan2,Lf=1e8,kc=/([A-Z])/g,E_=/(left|right|width|margin|padding|x)/i,T_=/[\s,\(]\S/,di={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Fc=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},A_=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},D_=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},C_=function(t,e){var n=e.s+e.c*t;e.set(e.t,e.p,~~(n+(n<0?-.5:.5))+e.u,e)},kf=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},Vf=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},R_=function(t,e,n){return t.style[e]=n},P_=function(t,e,n){return t.style.setProperty(e,n)},I_=function(t,e,n){return t._gsap[e]=n},L_=function(t,e,n){return t._gsap.scaleX=t._gsap.scaleY=n},F_=function(t,e,n,i,s){var o=t._gsap;o.scaleX=o.scaleY=n,o.renderTransform(s,o)},N_=function(t,e,n,i,s){var o=t._gsap;o[e]=n,o.renderTransform(s,o)},Ae="transform",Tn=Ae+"Origin",U_=function r(t,e){var n=this,i=this.target,s=i.style,o=i._gsap;if(t in Ai&&s){if(this.tfm=this.tfm||{},t!=="transform")t=di[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return n.tfm[a]=Ti(i,a)}):this.tfm[t]=o.x?o[t]:Ti(i,t),t===Tn&&(this.tfm.zOrigin=o.zOrigin);else return di.transform.split(",").forEach(function(a){return r.call(n,a,e)});if(this.props.indexOf(Ae)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Tn,e,"")),t=Ae}(s||e)&&this.props.push(t,e,s[t])},Hf=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},O_=function(){var t=this.props,e=this.target,n=e.style,i=e._gsap,s,o;for(s=0;s<t.length;s+=3)t[s+1]?e[t[s]]=t[s+2]:t[s+2]?n[t[s]]=t[s+2]:n.removeProperty(t[s].substr(0,2)==="--"?t[s]:t[s].replace(kc,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)i[o]=this.tfm[o];i.svg&&(i.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),s=zc(),(!s||!s.isStart)&&!n[Ae]&&(Hf(n),i.zOrigin&&n[Tn]&&(n[Tn]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},Gf=function(t,e){var n={target:t,props:[],revert:O_,save:U_};return t._gsap||nn.core.getCache(t),e&&e.split(",").forEach(function(i){return n.save(i)}),n},Wf,Nc=function(t,e){var n=Ki.createElementNS?Ki.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Ki.createElement(t);return n&&n.style?n:Ki.createElement(t)},pi=function r(t,e,n){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(kc,"-$1").toLowerCase())||i.getPropertyValue(e)||!n&&r(t,_s(e)||e,1)||""},Ff="O,Moz,ms,Ms,Webkit".split(","),_s=function(t,e,n){var i=e||Ir,s=i.style,o=5;if(t in s&&!n)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);o--&&!(Ff[o]+t in s););return o<0?null:(o===3?"ms":o>=0?Ff[o]:"")+t},Uc=function(){w_()&&window.document&&(Pf=window,Ki=Pf.document,ms=Ki.documentElement,Ir=Nc("div")||{style:{}},b_=Nc("div"),Ae=_s(Ae),Tn=Ae+"Origin",Ir.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Wf=!!_s("perspective"),zc=nn.core.reverting,Bc=1)},Ic=function r(t){var e=Nc("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,s=this.style.cssText,o;if(ms.appendChild(e),e.appendChild(this),this.style.display="block",t)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),ms.removeChild(e),this.style.cssText=s,o},Nf=function(t,e){for(var n=e.length;n--;)if(t.hasAttribute(e[n]))return t.getAttribute(e[n])},Xf=function(t){var e;try{e=t.getBBox()}catch{e=Ic.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===Ic||(e=Ic.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+Nf(t,["x","cx","x1"])||0,y:+Nf(t,["y","cy","y1"])||0,width:0,height:0}:e},qf=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&Xf(t))},Lr=function(t,e){if(e){var n=t.style,i;e in Ai&&e!==Tn&&(e=Ae),n.removeProperty?(i=e.substr(0,2),(i==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),n.removeProperty(i==="--"?e:e.replace(kc,"-$1").toLowerCase())):n.removeAttribute(e)}},ji=function(t,e,n,i,s,o){var a=new fn(t._pt,e,n,0,1,o?Vf:kf);return t._pt=a,a.b=i,a.e=s,t._props.push(n),a},Uf={deg:1,rad:1,turn:1},B_={grid:1,flex:1},Qi=function r(t,e,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",a=Ir.style,l=E_.test(e),c=t.tagName.toLowerCase()==="svg",u=(c?"client":"offset")+(l?"Width":"Height"),h=100,f=i==="px",d=i==="%",_,g,m,p;if(i===o||!s||Uf[i]||Uf[o])return s;if(o!=="px"&&!f&&(s=r(t,e,n,"px")),p=t.getCTM&&qf(t),(d||o==="%")&&(Ai[e]||~e.indexOf("adius")))return _=p?t.getBBox()[l?"width":"height"]:t[u],Re(d?s/_*h:s/100*_);if(a[l?"width":"height"]=h+(f?o:i),g=~e.indexOf("adius")||i==="em"&&t.appendChild&&!c?t:t.parentNode,p&&(g=(t.ownerSVGElement||{}).parentNode),(!g||g===Ki||!g.appendChild)&&(g=Ki.body),m=g._gsap,m&&d&&m.width&&l&&m.time===bn.time&&!m.uncache)return Re(s/m.width*h);if(d&&(e==="height"||e==="width")){var b=t.style[e];t.style[e]=h+i,_=t[u],b?t.style[e]=b:Lr(t,e)}else(d||o==="%")&&!B_[pi(g,"display")]&&(a.position=pi(t,"position")),g===t&&(a.position="static"),g.appendChild(Ir),_=Ir[u],g.removeChild(Ir),a.position="absolute";return l&&d&&(m=Zi(g),m.time=bn.time,m.width=g[u]),Re(f?_*s/h:_&&s?h/_*s:0)},Ti=function(t,e,n,i){var s;return Bc||Uc(),e in di&&e!=="transform"&&(e=di[e],~e.indexOf(",")&&(e=e.split(",")[0])),Ai[e]&&e!=="transform"?(s=vo(t,i),s=e!=="transformOrigin"?s[e]:s.svg?s.origin:ma(pi(t,Tn))+" "+s.zOrigin+"px"):(s=t.style[e],(!s||s==="auto"||i||~(s+"").indexOf("calc("))&&(s=pa[e]&&pa[e](t,e,n)||pi(t,e)||Mc(t,e)||(e==="opacity"?1:0))),n&&!~(s+"").trim().indexOf(" ")?Qi(t,e,s,n)+n:s},z_=function(t,e,n,i){if(!n||n==="none"){var s=_s(e,t,1),o=s&&pi(t,s,1);o&&o!==n?(e=s,n=o):e==="borderColor"&&(n=pi(t,"borderTopColor"))}var a=new fn(this._pt,t.style,e,0,1,Cc),l=0,c=0,u,h,f,d,_,g,m,p,b,y,S,D;if(a.b=n,a.e=i,n+="",i+="",i==="auto"&&(g=t.style[e],t.style[e]=i,i=pi(t,e)||i,g?t.style[e]=g:Lr(t,e)),u=[n,i],bc(u),n=u[0],i=u[1],f=n.match(Tr)||[],D=i.match(Tr)||[],D.length){for(;h=Tr.exec(i);)m=h[0],b=i.substring(l,h.index),_?_=(_+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(_=1),m!==(g=f[c++]||"")&&(d=parseFloat(g)||0,S=g.substr((d+"").length),m.charAt(1)==="="&&(m=Ar(d,m)+S),p=parseFloat(m),y=m.substr((p+"").length),l=Tr.lastIndex-y.length,y||(y=y||En.units[e]||S,l===i.length&&(i+=y,a.e+=y)),S!==y&&(d=Qi(t,e,g,y)||0),a._pt={_next:a._pt,p:b||c===1?b:",",s:d,c:p-d,m:_&&_<4||e==="zIndex"?Math.round:0});a.c=l<i.length?i.substring(l,i.length):""}else a.r=e==="display"&&i==="none"?Vf:kf;return _c.test(i)&&(a.e=0),this._pt=a,a},Of={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},k_=function(t){var e=t.split(" "),n=e[0],i=e[1]||"50%";return(n==="top"||n==="bottom"||i==="left"||i==="right")&&(t=n,n=i,i=t),e[0]=Of[n]||n,e[1]=Of[i]||i,e.join(" ")},V_=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var n=e.t,i=n.style,s=e.u,o=n._gsap,a,l,c;if(s==="all"||s===!0)i.cssText="",l=1;else for(s=s.split(","),c=s.length;--c>-1;)a=s[c],Ai[a]&&(l=1,a=a==="transformOrigin"?Tn:Ae),Lr(n,a);l&&(Lr(n,Ae),o&&(o.svg&&n.removeAttribute("transform"),vo(n,1),o.uncache=1,Hf(i)))}},pa={clearProps:function(t,e,n,i,s){if(s.data!=="isFromStart"){var o=t._pt=new fn(t._pt,e,n,0,0,V_);return o.u=i,o.pr=-10,o.tween=s,t._props.push(n),1}}},xo=[1,0,0,1,0,0],Yf={},Zf=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Bf=function(t){var e=pi(t,Ae);return Zf(e)?xo:e.substr(7).match(gc).map(Re)},Vc=function(t,e){var n=t._gsap||Zi(t),i=t.style,s=Bf(t),o,a,l,c;return n.svg&&t.getAttribute("transform")?(l=t.transform.baseVal.consolidate().matrix,s=[l.a,l.b,l.c,l.d,l.e,l.f],s.join(",")==="1,0,0,1,0,0"?xo:s):(s===xo&&!t.offsetParent&&t!==ms&&!n.svg&&(l=i.display,i.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(c=1,a=t.nextElementSibling,ms.appendChild(t)),s=Bf(t),l?i.display=l:Lr(t,"display"),c&&(a?o.insertBefore(t,a):o?o.appendChild(t):ms.removeChild(t))),e&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},Oc=function(t,e,n,i,s,o){var a=t._gsap,l=s||Vc(t,!0),c=a.xOrigin||0,u=a.yOrigin||0,h=a.xOffset||0,f=a.yOffset||0,d=l[0],_=l[1],g=l[2],m=l[3],p=l[4],b=l[5],y=e.split(" "),S=parseFloat(y[0])||0,D=parseFloat(y[1])||0,A,w,P,M;n?l!==xo&&(w=d*m-_*g)&&(P=S*(m/w)+D*(-g/w)+(g*b-m*p)/w,M=S*(-_/w)+D*(d/w)-(d*b-_*p)/w,S=P,D=M):(A=Xf(t),S=A.x+(~y[0].indexOf("%")?S/100*A.width:S),D=A.y+(~(y[1]||y[0]).indexOf("%")?D/100*A.height:D)),i||i!==!1&&a.smooth?(p=S-c,b=D-u,a.xOffset=h+(p*d+b*g)-p,a.yOffset=f+(p*_+b*m)-b):a.xOffset=a.yOffset=0,a.xOrigin=S,a.yOrigin=D,a.smooth=!!i,a.origin=e,a.originIsAbsolute=!!n,t.style[Tn]="0px 0px",o&&(ji(o,a,"xOrigin",c,S),ji(o,a,"yOrigin",u,D),ji(o,a,"xOffset",h,a.xOffset),ji(o,a,"yOffset",f,a.yOffset)),t.setAttribute("data-svg-origin",S+" "+D)},vo=function(t,e){var n=t._gsap||new wc(t);if("x"in n&&!e&&!n.uncache)return n;var i=t.style,s=n.scaleX<0,o="px",a="deg",l=getComputedStyle(t),c=pi(t,Tn)||"0",u,h,f,d,_,g,m,p,b,y,S,D,A,w,P,M,v,N,F,R,B,Y,H,J,O,L,C,ot,vt,Wt,q,tt;return u=h=f=g=m=p=b=y=S=0,d=_=1,n.svg=!!(t.getCTM&&qf(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[Ae]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Ae]!=="none"?l[Ae]:"")),i.scale=i.rotate=i.translate="none"),w=Vc(t,n.svg),n.svg&&(n.uncache?(O=t.getBBox(),c=n.xOrigin-O.x+"px "+(n.yOrigin-O.y)+"px",J=""):J=!e&&t.getAttribute("data-svg-origin"),Oc(t,J||c,!!J||n.originIsAbsolute,n.smooth!==!1,w)),D=n.xOrigin||0,A=n.yOrigin||0,w!==xo&&(N=w[0],F=w[1],R=w[2],B=w[3],u=Y=w[4],h=H=w[5],w.length===6?(d=Math.sqrt(N*N+F*F),_=Math.sqrt(B*B+R*R),g=N||F?ps(F,N)*Pr:0,b=R||B?ps(R,B)*Pr+g:0,b&&(_*=Math.abs(Math.cos(b*gs))),n.svg&&(u-=D-(D*N+A*R),h-=A-(D*F+A*B))):(tt=w[6],Wt=w[7],C=w[8],ot=w[9],vt=w[10],q=w[11],u=w[12],h=w[13],f=w[14],P=ps(tt,vt),m=P*Pr,P&&(M=Math.cos(-P),v=Math.sin(-P),J=Y*M+C*v,O=H*M+ot*v,L=tt*M+vt*v,C=Y*-v+C*M,ot=H*-v+ot*M,vt=tt*-v+vt*M,q=Wt*-v+q*M,Y=J,H=O,tt=L),P=ps(-R,vt),p=P*Pr,P&&(M=Math.cos(-P),v=Math.sin(-P),J=N*M-C*v,O=F*M-ot*v,L=R*M-vt*v,q=B*v+q*M,N=J,F=O,R=L),P=ps(F,N),g=P*Pr,P&&(M=Math.cos(P),v=Math.sin(P),J=N*M+F*v,O=Y*M+H*v,F=F*M-N*v,H=H*M-Y*v,N=J,Y=O),m&&Math.abs(m)+Math.abs(g)>359.9&&(m=g=0,p=180-p),d=Re(Math.sqrt(N*N+F*F+R*R)),_=Re(Math.sqrt(H*H+tt*tt)),P=ps(Y,H),b=Math.abs(P)>2e-4?P*Pr:0,S=q?1/(q<0?-q:q):0),n.svg&&(J=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!Zf(pi(t,Ae)),J&&t.setAttribute("transform",J))),Math.abs(b)>90&&Math.abs(b)<270&&(s?(d*=-1,b+=g<=0?180:-180,g+=g<=0?180:-180):(_*=-1,b+=b<=0?180:-180)),e=e||n.uncache,n.x=u-((n.xPercent=u&&(!e&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-u)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+o,n.y=h-((n.yPercent=h&&(!e&&n.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-h)?-50:0)))?t.offsetHeight*n.yPercent/100:0)+o,n.z=f+o,n.scaleX=Re(d),n.scaleY=Re(_),n.rotation=Re(g)+a,n.rotationX=Re(m)+a,n.rotationY=Re(p)+a,n.skewX=b+a,n.skewY=y+a,n.transformPerspective=S+o,(n.zOrigin=parseFloat(c.split(" ")[2])||!e&&n.zOrigin||0)&&(i[Tn]=ma(c)),n.xOffset=n.yOffset=0,n.force3D=En.force3D,n.renderTransform=n.svg?G_:Wf?Jf:H_,n.uncache=0,n},ma=function(t){return(t=t.split(" "))[0]+" "+t[1]},Lc=function(t,e,n){var i=Je(e);return Re(parseFloat(e)+parseFloat(Qi(t,"x",n+"px",i)))+i},H_=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Jf(t,e)},Cr="0deg",_o="0px",Rr=") ",Jf=function(t,e){var n=e||this,i=n.xPercent,s=n.yPercent,o=n.x,a=n.y,l=n.z,c=n.rotation,u=n.rotationY,h=n.rotationX,f=n.skewX,d=n.skewY,_=n.scaleX,g=n.scaleY,m=n.transformPerspective,p=n.force3D,b=n.target,y=n.zOrigin,S="",D=p==="auto"&&t&&t!==1||p===!0;if(y&&(h!==Cr||u!==Cr)){var A=parseFloat(u)*gs,w=Math.sin(A),P=Math.cos(A),M;A=parseFloat(h)*gs,M=Math.cos(A),o=Lc(b,o,w*M*-y),a=Lc(b,a,-Math.sin(A)*-y),l=Lc(b,l,P*M*-y+y)}m!==_o&&(S+="perspective("+m+Rr),(i||s)&&(S+="translate("+i+"%, "+s+"%) "),(D||o!==_o||a!==_o||l!==_o)&&(S+=l!==_o||D?"translate3d("+o+", "+a+", "+l+") ":"translate("+o+", "+a+Rr),c!==Cr&&(S+="rotate("+c+Rr),u!==Cr&&(S+="rotateY("+u+Rr),h!==Cr&&(S+="rotateX("+h+Rr),(f!==Cr||d!==Cr)&&(S+="skew("+f+", "+d+Rr),(_!==1||g!==1)&&(S+="scale("+_+", "+g+Rr),b.style[Ae]=S||"translate(0, 0)"},G_=function(t,e){var n=e||this,i=n.xPercent,s=n.yPercent,o=n.x,a=n.y,l=n.rotation,c=n.skewX,u=n.skewY,h=n.scaleX,f=n.scaleY,d=n.target,_=n.xOrigin,g=n.yOrigin,m=n.xOffset,p=n.yOffset,b=n.forceCSS,y=parseFloat(o),S=parseFloat(a),D,A,w,P,M;l=parseFloat(l),c=parseFloat(c),u=parseFloat(u),u&&(u=parseFloat(u),c+=u,l+=u),l||c?(l*=gs,c*=gs,D=Math.cos(l)*h,A=Math.sin(l)*h,w=Math.sin(l-c)*-f,P=Math.cos(l-c)*f,c&&(u*=gs,M=Math.tan(c-u),M=Math.sqrt(1+M*M),w*=M,P*=M,u&&(M=Math.tan(u),M=Math.sqrt(1+M*M),D*=M,A*=M)),D=Re(D),A=Re(A),w=Re(w),P=Re(P)):(D=h,P=f,A=w=0),(y&&!~(o+"").indexOf("px")||S&&!~(a+"").indexOf("px"))&&(y=Qi(d,"x",o,"px"),S=Qi(d,"y",a,"px")),(_||g||m||p)&&(y=Re(y+_-(_*D+g*w)+m),S=Re(S+g-(_*A+g*P)+p)),(i||s)&&(M=d.getBBox(),y=Re(y+i/100*M.width),S=Re(S+s/100*M.height)),M="matrix("+D+","+A+","+w+","+P+","+y+","+S+")",d.setAttribute("transform",M),b&&(d.style[Ae]=M)},W_=function(t,e,n,i,s){var o=360,a=Be(s),l=parseFloat(s)*(a&&~s.indexOf("rad")?Pr:1),c=l-i,u=i+c+"deg",h,f;return a&&(h=s.split("_")[1],h==="short"&&(c%=o,c!==c%(o/2)&&(c+=c<0?o:-o)),h==="cw"&&c<0?c=(c+o*Lf)%o-~~(c/o)*o:h==="ccw"&&c>0&&(c=(c-o*Lf)%o-~~(c/o)*o)),t._pt=f=new fn(t._pt,e,n,i,c,A_),f.e=u,f.u="deg",t._props.push(n),f},zf=function(t,e){for(var n in e)t[n]=e[n];return t},X_=function(t,e,n){var i=zf({},n._gsap),s="perspective,force3D,transformOrigin,svgOrigin",o=n.style,a,l,c,u,h,f,d,_;i.svg?(c=n.getAttribute("transform"),n.setAttribute("transform",""),o[Ae]=e,a=vo(n,1),Lr(n,Ae),n.setAttribute("transform",c)):(c=getComputedStyle(n)[Ae],o[Ae]=e,a=vo(n,1),o[Ae]=c);for(l in Ai)c=i[l],u=a[l],c!==u&&s.indexOf(l)<0&&(d=Je(c),_=Je(u),h=d!==_?Qi(n,l,c,_):parseFloat(c),f=parseFloat(u),t._pt=new fn(t._pt,a,l,h,f-h,Fc),t._pt.u=_||0,t._props.push(l));zf(a,i)};hn("padding,margin,Width,Radius",function(r,t){var e="Top",n="Right",i="Bottom",s="Left",o=(t<3?[e,n,i,s]:[e+s,e+n,i+n,i+s]).map(function(a){return t<2?r+a:"border"+a+r});pa[t>1?"border"+r:r]=function(a,l,c,u,h){var f,d;if(arguments.length<4)return f=o.map(function(_){return Ti(a,_,c)}),d=f.join(" "),d.split(f[0]).length===5?f[0]:d;f=(u+"").split(" "),d={},o.forEach(function(_,g){return d[_]=f[g]=f[g]||f[(g-1)/2|0]}),a.init(l,d,h)}});var Hc={name:"css",register:Uc,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,n,i,s){var o=this._props,a=t.style,l=n.vars.startAt,c,u,h,f,d,_,g,m,p,b,y,S,D,A,w,P;Bc||Uc(),this.styles=this.styles||Gf(t),P=this.styles.props,this.tween=n;for(g in e)if(g!=="autoRound"&&(u=e[g],!(Mn[g]&&Tc(g,e,n,i,t,s)))){if(d=typeof u,_=pa[g],d==="function"&&(u=u.call(n,i,t,s),d=typeof u),d==="string"&&~u.indexOf("random(")&&(u=ds(u)),_)_(this,t,g,u,n)&&(w=1);else if(g.substr(0,2)==="--")c=(getComputedStyle(t).getPropertyValue(g)+"").trim(),u+="",wi.lastIndex=0,wi.test(c)||(m=Je(c),p=Je(u)),p?m!==p&&(c=Qi(t,g,c,p)+p):m&&(u+=m),this.add(a,"setProperty",c,u,i,s,0,0,g),o.push(g),P.push(g,0,a[g]);else if(d!=="undefined"){if(l&&g in l?(c=typeof l[g]=="function"?l[g].call(n,i,t,s):l[g],Be(c)&&~c.indexOf("random(")&&(c=ds(c)),Je(c+"")||c==="auto"||(c+=En.units[g]||Je(Ti(t,g))||""),(c+"").charAt(1)==="="&&(c=Ti(t,g))):c=Ti(t,g),f=parseFloat(c),b=d==="string"&&u.charAt(1)==="="&&u.substr(0,2),b&&(u=u.substr(2)),h=parseFloat(u),g in di&&(g==="autoAlpha"&&(f===1&&Ti(t,"visibility")==="hidden"&&h&&(f=0),P.push("visibility",0,a.visibility),ji(this,a,"visibility",f?"inherit":"hidden",h?"inherit":"hidden",!h)),g!=="scale"&&g!=="transform"&&(g=di[g],~g.indexOf(",")&&(g=g.split(",")[0]))),y=g in Ai,y){if(this.styles.save(g),S||(D=t._gsap,D.renderTransform&&!e.parseTransform||vo(t,e.parseTransform),A=e.smoothOrigin!==!1&&D.smooth,S=this._pt=new fn(this._pt,a,Ae,0,1,D.renderTransform,D,0,-1),S.dep=1),g==="scale")this._pt=new fn(this._pt,D,"scaleY",D.scaleY,(b?Ar(D.scaleY,b+h):h)-D.scaleY||0,Fc),this._pt.u=0,o.push("scaleY",g),g+="X";else if(g==="transformOrigin"){P.push(Tn,0,a[Tn]),u=k_(u),D.svg?Oc(t,u,0,A,0,this):(p=parseFloat(u.split(" ")[2])||0,p!==D.zOrigin&&ji(this,D,"zOrigin",D.zOrigin,p),ji(this,a,g,ma(c),ma(u)));continue}else if(g==="svgOrigin"){Oc(t,u,1,A,0,this);continue}else if(g in Yf){W_(this,D,g,f,b?Ar(f,b+u):u);continue}else if(g==="smoothOrigin"){ji(this,D,"smooth",D.smooth,u);continue}else if(g==="force3D"){D[g]=u;continue}else if(g==="transform"){X_(this,u,t);continue}}else g in a||(g=_s(g)||g);if(y||(h||h===0)&&(f||f===0)&&!T_.test(u)&&g in a)m=(c+"").substr((f+"").length),h||(h=0),p=Je(u)||(g in En.units?En.units[g]:m),m!==p&&(f=Qi(t,g,c,p)),this._pt=new fn(this._pt,y?D:a,g,f,(b?Ar(f,b+h):h)-f,!y&&(p==="px"||g==="zIndex")&&e.autoRound!==!1?C_:Fc),this._pt.u=p||0,m!==p&&p!=="%"&&(this._pt.b=c,this._pt.r=D_);else if(g in a)z_.call(this,t,g,c,b?b+u:u);else if(g in t)this.add(t,g,c||t[g],b?b+u:u,i,s);else if(g!=="parseTransform"){ca(g,u);continue}y||(g in a?P.push(g,0,a[g]):P.push(g,1,c||t[g])),o.push(g)}}w&&Pc(this)},render:function(t,e){if(e.tween._time||!zc())for(var n=e._pt;n;)n.r(t,n.d),n=n._next;else e.styles.revert()},get:Ti,aliases:di,getSetter:function(t,e,n){var i=di[e];return i&&i.indexOf(",")<0&&(e=i),e in Ai&&e!==Tn&&(t._gsap.x||Ti(t,"x"))?n&&If===n?e==="scale"?L_:I_:(If=n||{})&&(e==="scale"?F_:N_):t.style&&!la(t.style[e])?R_:~e.indexOf("-")?P_:da(t,e)},core:{_removeProperty:Lr,_getMatrix:Vc}};nn.utils.checkPrefix=_s;nn.core.getStyleSaver=Gf;(function(r,t,e,n){var i=hn(r+","+t+","+e,function(s){Ai[s]=1});hn(t,function(s){En.units[s]="deg",Yf[s]=1}),di[i[13]]=r+","+t,hn(n,function(s){var o=s.split(":");di[o[1]]=i[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");hn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){En.units[r]="px"});nn.registerPlugin(Hc);var at=nn.registerPlugin(Hc)||nn,a1=at.core.Tween;function $f(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function q_(r,t,e){return t&&$f(r.prototype,t),e&&$f(r,e),r}var $e,xa,Y_,In,tr,er,vs,jf,Fr,So,Qf,Di,jn,td,ed=function(){return $e||typeof window<"u"&&($e=window.gsap)&&$e.registerPlugin&&$e},nd=1,xs=[],ne=[],Qn=[],Mo=Date.now,Gc=function(t,e){return e},Z_=function(){var t=So.core,e=t.bridge||{},n=t._scrollers,i=t._proxies;n.push.apply(n,ne),i.push.apply(i,Qn),ne=n,Qn=i,Gc=function(o,a){return e[o](a)}},Ri=function(t,e){return~Qn.indexOf(t)&&Qn[Qn.indexOf(t)+1][e]},bo=function(t){return!!~Qf.indexOf(t)},pn=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:i!==!1,capture:!!s})},dn=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},ga="scrollLeft",_a="scrollTop",Wc=function(){return Di&&Di.isPressed||ne.cache++},va=function(t,e){var n=function i(s){if(s||s===0){nd&&(In.history.scrollRestoration="manual");var o=Di&&Di.isPressed;s=i.v=Math.round(s)||(Di&&Di.iOS?1:0),t(s),i.cacheID=ne.cache,o&&Gc("ss",s)}else(e||ne.cache!==i.cacheID||Gc("ref"))&&(i.cacheID=ne.cache,i.v=t());return i.v+i.offset};return n.offset=0,t&&n},rn={s:ga,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:va(function(r){return arguments.length?In.scrollTo(r,Ne.sc()):In.pageXOffset||tr[ga]||er[ga]||vs[ga]||0})},Ne={s:_a,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:rn,sc:va(function(r){return arguments.length?In.scrollTo(rn.sc(),r):In.pageYOffset||tr[_a]||er[_a]||vs[_a]||0})},mn=function(t,e){return(e&&e._ctx&&e._ctx.selector||$e.utils.toArray)(t)[0]||(typeof t=="string"&&$e.config().nullTargetWarn!==!1?console.warn("Element not found:",t):null)},Ci=function(t,e){var n=e.s,i=e.sc;bo(t)&&(t=tr.scrollingElement||er);var s=ne.indexOf(t),o=i===Ne.sc?1:2;!~s&&(s=ne.push(t)-1),ne[s+o]||pn(t,"scroll",Wc);var a=ne[s+o],l=a||(ne[s+o]=va(Ri(t,n),!0)||(bo(t)?i:va(function(c){return arguments.length?t[n]=c:t[n]})));return l.target=t,a||(l.smooth=$e.getProperty(t,"scrollBehavior")==="smooth"),l},ya=function(t,e,n){var i=t,s=t,o=Mo(),a=o,l=e||50,c=Math.max(500,l*3),u=function(_,g){var m=Mo();g||m-o>l?(s=i,i=_,a=o,o=m):n?i+=_:i=s+(_-s)/(m-a)*(o-a)},h=function(){s=i=n?0:i,a=o=0},f=function(_){var g=a,m=s,p=Mo();return(_||_===0)&&_!==i&&u(_),o===a||p-a>c?0:(i+(n?m:-m))/((n?p:o)-g)*1e3};return{update:u,reset:h,getVelocity:f}},yo=function(t,e){return e&&!t._gsapAllow&&t.preventDefault(),t.changedTouches?t.changedTouches[0]:t},Kf=function(t){var e=Math.max.apply(Math,t),n=Math.min.apply(Math,t);return Math.abs(e)>=Math.abs(n)?e:n},id=function(){So=$e.core.globals().ScrollTrigger,So&&So.core&&Z_()},rd=function(t){return $e=t||ed(),!xa&&$e&&typeof document<"u"&&document.body&&(In=window,tr=document,er=tr.documentElement,vs=tr.body,Qf=[In,tr,er,vs],Y_=$e.utils.clamp,td=$e.core.context||function(){},Fr="onpointerenter"in vs?"pointer":"mouse",jf=Pe.isTouch=In.matchMedia&&In.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in In||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,jn=Pe.eventTypes=("ontouchstart"in er?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in er?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return nd=0},500),id(),xa=1),xa};rn.op=Ne;ne.cache=0;var Pe=function(){function r(e){this.init(e)}var t=r.prototype;return t.init=function(n){xa||rd($e)||console.warn("Please gsap.registerPlugin(Observer)"),So||id();var i=n.tolerance,s=n.dragMinimum,o=n.type,a=n.target,l=n.lineHeight,c=n.debounce,u=n.preventDefault,h=n.onStop,f=n.onStopDelay,d=n.ignore,_=n.wheelSpeed,g=n.event,m=n.onDragStart,p=n.onDragEnd,b=n.onDrag,y=n.onPress,S=n.onRelease,D=n.onRight,A=n.onLeft,w=n.onUp,P=n.onDown,M=n.onChangeX,v=n.onChangeY,N=n.onChange,F=n.onToggleX,R=n.onToggleY,B=n.onHover,Y=n.onHoverEnd,H=n.onMove,J=n.ignoreCheck,O=n.isNormalizer,L=n.onGestureStart,C=n.onGestureEnd,ot=n.onWheel,vt=n.onEnable,Wt=n.onDisable,q=n.onClick,tt=n.scrollSpeed,pt=n.capture,st=n.allowClicks,Ft=n.lockAxis,Nt=n.onLockAxis;this.target=a=mn(a)||er,this.vars=n,d&&(d=$e.utils.toArray(d)),i=i||1e-9,s=s||0,_=_||1,tt=tt||1,o=o||"wheel,touch,pointer",c=c!==!1,l||(l=parseFloat(In.getComputedStyle(vs).lineHeight)||22);var V,Yt,Et,Tt,St,zt,Ut,k=this,Qt=0,T=0,x=n.passive||!u,I=Ci(a,rn),G=Ci(a,Ne),K=I(),Q=G(),ht=~o.indexOf("touch")&&!~o.indexOf("pointer")&&jn[0]==="pointerdown",ct=bo(a),nt=a.ownerDocument||tr,bt=[0,0,0],rt=[0,0,0],ft=0,Ot=function(){return ft=Mo()},it=function(Mt,le){return(k.event=Mt)&&d&&~d.indexOf(Mt.target)||le&&ht&&Mt.pointerType!=="touch"||J&&J(Mt,le)},yt=function(){k._vx.reset(),k._vy.reset(),Yt.pause(),h&&h(k)},Bt=function(){var Mt=k.deltaX=Kf(bt),le=k.deltaY=Kf(rt),mt=Math.abs(Mt)>=i,qt=Math.abs(le)>=i;N&&(mt||qt)&&N(k,Mt,le,bt,rt),mt&&(D&&k.deltaX>0&&D(k),A&&k.deltaX<0&&A(k),M&&M(k),F&&k.deltaX<0!=Qt<0&&F(k),Qt=k.deltaX,bt[0]=bt[1]=bt[2]=0),qt&&(P&&k.deltaY>0&&P(k),w&&k.deltaY<0&&w(k),v&&v(k),R&&k.deltaY<0!=T<0&&R(k),T=k.deltaY,rt[0]=rt[1]=rt[2]=0),(Tt||Et)&&(H&&H(k),Et&&(b(k),Et=!1),Tt=!1),zt&&!(zt=!1)&&Nt&&Nt(k),St&&(ot(k),St=!1),V=0},Vt=function(Mt,le,mt){bt[mt]+=Mt,rt[mt]+=le,k._vx.update(Mt),k._vy.update(le),c?V||(V=requestAnimationFrame(Bt)):Bt()},he=function(Mt,le){Ft&&!Ut&&(k.axis=Ut=Math.abs(Mt)>Math.abs(le)?"x":"y",zt=!0),Ut!=="y"&&(bt[2]+=Mt,k._vx.update(Mt,!0)),Ut!=="x"&&(rt[2]+=le,k._vy.update(le,!0)),c?V||(V=requestAnimationFrame(Bt)):Bt()},kt=function(Mt){if(!it(Mt,1)){Mt=yo(Mt,u);var le=Mt.clientX,mt=Mt.clientY,qt=le-k.x,It=mt-k.y,Xt=k.isDragging;k.x=le,k.y=mt,(Xt||Math.abs(k.startX-le)>=s||Math.abs(k.startY-mt)>=s)&&(b&&(Et=!0),Xt||(k.isDragging=!0),he(qt,It),Xt||m&&m(k))}},U=k.onPress=function(Ct){it(Ct,1)||Ct&&Ct.button||(k.axis=Ut=null,Yt.pause(),k.isPressed=!0,Ct=yo(Ct),Qt=T=0,k.startX=k.x=Ct.clientX,k.startY=k.y=Ct.clientY,k._vx.reset(),k._vy.reset(),pn(O?a:nt,jn[1],kt,x,!0),k.deltaX=k.deltaY=0,y&&y(k))},$=k.onRelease=function(Ct){if(!it(Ct,1)){dn(O?a:nt,jn[1],kt,!0);var Mt=!isNaN(k.y-k.startY),le=k.isDragging,mt=le&&(Math.abs(k.x-k.startX)>3||Math.abs(k.y-k.startY)>3),qt=yo(Ct);!mt&&Mt&&(k._vx.reset(),k._vy.reset(),u&&st&&$e.delayedCall(.08,function(){if(Mo()-ft>300&&!Ct.defaultPrevented){if(Ct.target.click)Ct.target.click();else if(nt.createEvent){var It=nt.createEvent("MouseEvents");It.initMouseEvent("click",!0,!0,In,1,qt.screenX,qt.screenY,qt.clientX,qt.clientY,!1,!1,!1,!1,0,null),Ct.target.dispatchEvent(It)}}})),k.isDragging=k.isGesturing=k.isPressed=!1,h&&le&&!O&&Yt.restart(!0),p&&le&&p(k),S&&S(k,mt)}},et=function(Mt){return Mt.touches&&Mt.touches.length>1&&(k.isGesturing=!0)&&L(Mt,k.isDragging)},ut=function(){return(k.isGesturing=!1)||C(k)},lt=function(Mt){if(!it(Mt)){var le=I(),mt=G();Vt((le-K)*tt,(mt-Q)*tt,1),K=le,Q=mt,h&&Yt.restart(!0)}},Dt=function(Mt){if(!it(Mt)){Mt=yo(Mt,u),ot&&(St=!0);var le=(Mt.deltaMode===1?l:Mt.deltaMode===2?In.innerHeight:1)*_;Vt(Mt.deltaX*le,Mt.deltaY*le,0),h&&!O&&Yt.restart(!0)}},te=function(Mt){if(!it(Mt)){var le=Mt.clientX,mt=Mt.clientY,qt=le-k.x,It=mt-k.y;k.x=le,k.y=mt,Tt=!0,h&&Yt.restart(!0),(qt||It)&&he(qt,It)}},ae=function(Mt){k.event=Mt,B(k)},re=function(Mt){k.event=Mt,Y(k)},Zt=function(Mt){return it(Mt)||yo(Mt,u)&&q(k)};Yt=k._dc=$e.delayedCall(f||.25,yt).pause(),k.deltaX=k.deltaY=0,k._vx=ya(0,50,!0),k._vy=ya(0,50,!0),k.scrollX=I,k.scrollY=G,k.isDragging=k.isGesturing=k.isPressed=!1,td(this),k.enable=function(Ct){return k.isEnabled||(pn(ct?nt:a,"scroll",Wc),o.indexOf("scroll")>=0&&pn(ct?nt:a,"scroll",lt,x,pt),o.indexOf("wheel")>=0&&pn(a,"wheel",Dt,x,pt),(o.indexOf("touch")>=0&&jf||o.indexOf("pointer")>=0)&&(pn(a,jn[0],U,x,pt),pn(nt,jn[2],$),pn(nt,jn[3],$),st&&pn(a,"click",Ot,!0,!0),q&&pn(a,"click",Zt),L&&pn(nt,"gesturestart",et),C&&pn(nt,"gestureend",ut),B&&pn(a,Fr+"enter",ae),Y&&pn(a,Fr+"leave",re),H&&pn(a,Fr+"move",te)),k.isEnabled=!0,Ct&&Ct.type&&U(Ct),vt&&vt(k)),k},k.disable=function(){k.isEnabled&&(xs.filter(function(Ct){return Ct!==k&&bo(Ct.target)}).length||dn(ct?nt:a,"scroll",Wc),k.isPressed&&(k._vx.reset(),k._vy.reset(),dn(O?a:nt,jn[1],kt,!0)),dn(ct?nt:a,"scroll",lt,pt),dn(a,"wheel",Dt,pt),dn(a,jn[0],U,pt),dn(nt,jn[2],$),dn(nt,jn[3],$),dn(a,"click",Ot,!0),dn(a,"click",Zt),dn(nt,"gesturestart",et),dn(nt,"gestureend",ut),dn(a,Fr+"enter",ae),dn(a,Fr+"leave",re),dn(a,Fr+"move",te),k.isEnabled=k.isPressed=k.isDragging=!1,Wt&&Wt(k))},k.kill=k.revert=function(){k.disable();var Ct=xs.indexOf(k);Ct>=0&&xs.splice(Ct,1),Di===k&&(Di=0)},xs.push(k),O&&bo(a)&&(Di=k),k.enable(g)},q_(r,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),r}();Pe.version="3.12.5";Pe.create=function(r){return new Pe(r)};Pe.register=rd;Pe.getAll=function(){return xs.slice()};Pe.getById=function(r){return xs.filter(function(t){return t.vars.id===r})[0]};ed()&&$e.registerPlugin(Pe);var wt,Ms,oe,De,ti,ve,Md,Ua,Uo,Ro,Eo,Sa,sn,ka,jc,_n,sd,od,bs,bd,Xc,wd,gn,Qc,Ed,Td,nr,tu,su,ws,ou,Oa,eu,qc,Ma=1,on=Date.now,Yc=on(),Wn=0,To=0,ad=function(t,e,n){var i=Fn(t)&&(t.substr(0,6)==="clamp("||t.indexOf("max")>-1);return n["_"+e+"Clamp"]=i,i?t.substr(6,t.length-7):t},ld=function(t,e){return e&&(!Fn(t)||t.substr(0,6)!=="clamp(")?"clamp("+t+")":t},J_=function r(){return To&&requestAnimationFrame(r)},cd=function(){return ka=1},ud=function(){return ka=0},mi=function(t){return t},Ao=function(t){return Math.round(t*1e5)/1e5||0},Ad=function(){return typeof window<"u"},Dd=function(){return wt||Ad()&&(wt=window.gsap)&&wt.registerPlugin&&wt},kr=function(t){return!!~Md.indexOf(t)},Cd=function(t){return(t==="Height"?ou:oe["inner"+t])||ti["client"+t]||ve["client"+t]},Rd=function(t){return Ri(t,"getBoundingClientRect")||(kr(t)?function(){return Na.width=oe.innerWidth,Na.height=ou,Na}:function(){return Pi(t)})},$_=function(t,e,n){var i=n.d,s=n.d2,o=n.a;return(o=Ri(t,"getBoundingClientRect"))?function(){return o()[i]}:function(){return(e?Cd(s):t["client"+s])||0}},K_=function(t,e){return!e||~Qn.indexOf(t)?Rd(t):function(){return Na}},gi=function(t,e){var n=e.s,i=e.d2,s=e.d,o=e.a;return Math.max(0,(n="scroll"+i)&&(o=Ri(t,n))?o()-Rd(t)()[s]:kr(t)?(ti[n]||ve[n])-Cd(i):t[n]-t["offset"+i])},ba=function(t,e){for(var n=0;n<bs.length;n+=3)(!e||~e.indexOf(bs[n+1]))&&t(bs[n],bs[n+1],bs[n+2])},Fn=function(t){return typeof t=="string"},vn=function(t){return typeof t=="function"},Do=function(t){return typeof t=="number"},Nr=function(t){return typeof t=="object"},wo=function(t,e,n){return t&&t.progress(e?0:1)&&n&&t.pause()},Zc=function(t,e){if(t.enabled){var n=t._ctx?t._ctx.add(function(){return e(t)}):e(t);n&&n.totalTime&&(t.callbackAnimation=n)}},ys=Math.abs,Pd="left",Id="top",au="right",lu="bottom",Or="width",Br="height",Po="Right",Io="Left",Lo="Top",Fo="Bottom",Ue="padding",Hn="margin",Ts="Width",cu="Height",ze="px",Gn=function(t){return oe.getComputedStyle(t)},j_=function(t){var e=Gn(t).position;t.style.position=e==="absolute"||e==="fixed"?e:"relative"},hd=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Pi=function(t,e){var n=e&&Gn(t)[jc]!=="matrix(1, 0, 0, 1, 0, 0)"&&wt.to(t,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),i=t.getBoundingClientRect();return n&&n.progress(0).kill(),i},Ba=function(t,e){var n=e.d2;return t["offset"+n]||t["client"+n]||0},Ld=function(t){var e=[],n=t.labels,i=t.duration(),s;for(s in n)e.push(n[s]/i);return e},Q_=function(t){return function(e){return wt.utils.snap(Ld(t),e)}},uu=function(t){var e=wt.utils.snap(t),n=Array.isArray(t)&&t.slice(0).sort(function(i,s){return i-s});return n?function(i,s,o){o===void 0&&(o=.001);var a;if(!s)return e(i);if(s>0){for(i-=o,a=0;a<n.length;a++)if(n[a]>=i)return n[a];return n[a-1]}else for(a=n.length,i+=o;a--;)if(n[a]<=i)return n[a];return n[0]}:function(i,s,o){o===void 0&&(o=.001);var a=e(i);return!s||Math.abs(a-i)<o||a-i<0==s<0?a:e(s<0?i-t:i+t)}},t0=function(t){return function(e,n){return uu(Ld(t))(e,n.direction)}},wa=function(t,e,n,i){return n.split(",").forEach(function(s){return t(e,s,i)})},Xe=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:!i,capture:!!s})},We=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},Ea=function(t,e,n){n=n&&n.wheelHandler,n&&(t(e,"wheel",n),t(e,"touchmove",n))},fd={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},Ta={toggleActions:"play",anticipatePin:0},za={top:0,left:0,center:.5,bottom:1,right:1},Pa=function(t,e){if(Fn(t)){var n=t.indexOf("="),i=~n?+(t.charAt(n-1)+1)*parseFloat(t.substr(n+1)):0;~n&&(t.indexOf("%")>n&&(i*=e/100),t=t.substr(0,n-1)),t=i+(t in za?za[t]*e:~t.indexOf("%")?parseFloat(t)*e/100:parseFloat(t)||0)}return t},Aa=function(t,e,n,i,s,o,a,l){var c=s.startColor,u=s.endColor,h=s.fontSize,f=s.indent,d=s.fontWeight,_=De.createElement("div"),g=kr(n)||Ri(n,"pinType")==="fixed",m=t.indexOf("scroller")!==-1,p=g?ve:n,b=t.indexOf("start")!==-1,y=b?c:u,S="border-color:"+y+";font-size:"+h+";color:"+y+";font-weight:"+d+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return S+="position:"+((m||l)&&g?"fixed;":"absolute;"),(m||l||!g)&&(S+=(i===Ne?au:lu)+":"+(o+parseFloat(f))+"px;"),a&&(S+="box-sizing:border-box;text-align:left;width:"+a.offsetWidth+"px;"),_._isStart=b,_.setAttribute("class","gsap-marker-"+t+(e?" marker-"+e:"")),_.style.cssText=S,_.innerText=e||e===0?t+"-"+e:t,p.children[0]?p.insertBefore(_,p.children[0]):p.appendChild(_),_._offset=_["offset"+i.op.d2],Ia(_,0,i,b),_},Ia=function(t,e,n,i){var s={display:"block"},o=n[i?"os2":"p2"],a=n[i?"p2":"os2"];t._isFlipped=i,s[n.a+"Percent"]=i?-100:0,s[n.a]=i?"1px":0,s["border"+o+Ts]=1,s["border"+a+Ts]=0,s[n.p]=e+"px",wt.set(t,s)},ie=[],nu={},Oo,dd=function(){return on()-Wn>34&&(Oo||(Oo=requestAnimationFrame(Ii)))},Ss=function(){(!gn||!gn.isPressed||gn.startX>ve.clientWidth)&&(ne.cache++,gn?Oo||(Oo=requestAnimationFrame(Ii)):Ii(),Wn||Hr("scrollStart"),Wn=on())},Jc=function(){Td=oe.innerWidth,Ed=oe.innerHeight},Co=function(){ne.cache++,!sn&&!wd&&!De.fullscreenElement&&!De.webkitFullscreenElement&&(!Qc||Td!==oe.innerWidth||Math.abs(oe.innerHeight-Ed)>oe.innerHeight*.25)&&Ua.restart(!0)},Vr={},e0=[],Fd=function r(){return We(Pt,"scrollEnd",r)||Ur(!0)},Hr=function(t){return Vr[t]&&Vr[t].map(function(e){return e()})||e0},Ln=[],Nd=function(t){for(var e=0;e<Ln.length;e+=5)(!t||Ln[e+4]&&Ln[e+4].query===t)&&(Ln[e].style.cssText=Ln[e+1],Ln[e].getBBox&&Ln[e].setAttribute("transform",Ln[e+2]||""),Ln[e+3].uncache=1)},hu=function(t,e){var n;for(_n=0;_n<ie.length;_n++)n=ie[_n],n&&(!e||n._ctx===e)&&(t?n.kill(1):n.revert(!0,!0));Oa=!0,e&&Nd(e),e||Hr("revert")},Ud=function(t,e){ne.cache++,(e||!xn)&&ne.forEach(function(n){return vn(n)&&n.cacheID++&&(n.rec=0)}),Fn(t)&&(oe.history.scrollRestoration=su=t)},xn,zr=0,pd,n0=function(){if(pd!==zr){var t=pd=zr;requestAnimationFrame(function(){return t===zr&&Ur(!0)})}},Od=function(){ve.appendChild(ws),ou=!gn&&ws.offsetHeight||oe.innerHeight,ve.removeChild(ws)},md=function(t){return Uo(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach(function(e){return e.style.display=t?"none":"block"})},Ur=function(t,e){if(Wn&&!t&&!Oa){Xe(Pt,"scrollEnd",Fd);return}Od(),xn=Pt.isRefreshing=!0,ne.forEach(function(i){return vn(i)&&++i.cacheID&&(i.rec=i())});var n=Hr("refreshInit");bd&&Pt.sort(),e||hu(),ne.forEach(function(i){vn(i)&&(i.smooth&&(i.target.style.scrollBehavior="auto"),i(0))}),ie.slice(0).forEach(function(i){return i.refresh()}),Oa=!1,ie.forEach(function(i){if(i._subPinOffset&&i.pin){var s=i.vars.horizontal?"offsetWidth":"offsetHeight",o=i.pin[s];i.revert(!0,1),i.adjustPinSpacing(i.pin[s]-o),i.refresh()}}),eu=1,md(!0),ie.forEach(function(i){var s=gi(i.scroller,i._dir),o=i.vars.end==="max"||i._endClamp&&i.end>s,a=i._startClamp&&i.start>=s;(o||a)&&i.setPositions(a?s-1:i.start,o?Math.max(a?s:i.start+1,s):i.end,!0)}),md(!1),eu=0,n.forEach(function(i){return i&&i.render&&i.render(-1)}),ne.forEach(function(i){vn(i)&&(i.smooth&&requestAnimationFrame(function(){return i.target.style.scrollBehavior="smooth"}),i.rec&&i(i.rec))}),Ud(su,1),Ua.pause(),zr++,xn=2,Ii(2),ie.forEach(function(i){return vn(i.vars.onRefresh)&&i.vars.onRefresh(i)}),xn=Pt.isRefreshing=!1,Hr("refresh")},iu=0,La=1,No,Ii=function(t){if(t===2||!xn&&!Oa){Pt.isUpdating=!0,No&&No.update(0);var e=ie.length,n=on(),i=n-Yc>=50,s=e&&ie[0].scroll();if(La=iu>s?-1:1,xn||(iu=s),i&&(Wn&&!ka&&n-Wn>200&&(Wn=0,Hr("scrollEnd")),Eo=Yc,Yc=n),La<0){for(_n=e;_n-- >0;)ie[_n]&&ie[_n].update(0,i);La=1}else for(_n=0;_n<e;_n++)ie[_n]&&ie[_n].update(0,i);Pt.isUpdating=!1}Oo=0},ru=[Pd,Id,lu,au,Hn+Fo,Hn+Po,Hn+Lo,Hn+Io,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],Fa=ru.concat([Or,Br,"boxSizing","max"+Ts,"max"+cu,"position",Hn,Ue,Ue+Lo,Ue+Po,Ue+Fo,Ue+Io]),i0=function(t,e,n){Es(n);var i=t._gsap;if(i.spacerIsNative)Es(i.spacerState);else if(t._gsap.swappedIn){var s=e.parentNode;s&&(s.insertBefore(t,e),s.removeChild(e))}t._gsap.swappedIn=!1},$c=function(t,e,n,i){if(!t._gsap.swappedIn){for(var s=ru.length,o=e.style,a=t.style,l;s--;)l=ru[s],o[l]=n[l];o.position=n.position==="absolute"?"absolute":"relative",n.display==="inline"&&(o.display="inline-block"),a[lu]=a[au]="auto",o.flexBasis=n.flexBasis||"auto",o.overflow="visible",o.boxSizing="border-box",o[Or]=Ba(t,rn)+ze,o[Br]=Ba(t,Ne)+ze,o[Ue]=a[Hn]=a[Id]=a[Pd]="0",Es(i),a[Or]=a["max"+Ts]=n[Or],a[Br]=a["max"+cu]=n[Br],a[Ue]=n[Ue],t.parentNode!==e&&(t.parentNode.insertBefore(e,t),e.appendChild(t)),t._gsap.swappedIn=!0}},r0=/([A-Z])/g,Es=function(t){if(t){var e=t.t.style,n=t.length,i=0,s,o;for((t.t._gsap||wt.core.getCache(t.t)).uncache=1;i<n;i+=2)o=t[i+1],s=t[i],o?e[s]=o:e[s]&&e.removeProperty(s.replace(r0,"-$1").toLowerCase())}},Da=function(t){for(var e=Fa.length,n=t.style,i=[],s=0;s<e;s++)i.push(Fa[s],n[Fa[s]]);return i.t=t,i},s0=function(t,e,n){for(var i=[],s=t.length,o=n?8:0,a;o<s;o+=2)a=t[o],i.push(a,a in e?e[a]:t[o+1]);return i.t=t.t,i},Na={left:0,top:0},gd=function(t,e,n,i,s,o,a,l,c,u,h,f,d,_){vn(t)&&(t=t(l)),Fn(t)&&t.substr(0,3)==="max"&&(t=f+(t.charAt(4)==="="?Pa("0"+t.substr(3),n):0));var g=d?d.time():0,m,p,b;if(d&&d.seek(0),isNaN(t)||(t=+t),Do(t))d&&(t=wt.utils.mapRange(d.scrollTrigger.start,d.scrollTrigger.end,0,f,t)),a&&Ia(a,n,i,!0);else{vn(e)&&(e=e(l));var y=(t||"0").split(" "),S,D,A,w;b=mn(e,l)||ve,S=Pi(b)||{},(!S||!S.left&&!S.top)&&Gn(b).display==="none"&&(w=b.style.display,b.style.display="block",S=Pi(b),w?b.style.display=w:b.style.removeProperty("display")),D=Pa(y[0],S[i.d]),A=Pa(y[1]||"0",n),t=S[i.p]-c[i.p]-u+D+s-A,a&&Ia(a,A,i,n-A<20||a._isStart&&A>20),n-=n-A}if(_&&(l[_]=t||-.001,t<0&&(t=0)),o){var P=t+n,M=o._isStart;m="scroll"+i.d2,Ia(o,P,i,M&&P>20||!M&&(h?Math.max(ve[m],ti[m]):o.parentNode[m])<=P+1),h&&(c=Pi(a),h&&(o.style[i.op.p]=c[i.op.p]-i.op.m-o._offset+ze))}return d&&b&&(m=Pi(b),d.seek(f),p=Pi(b),d._caScrollDist=m[i.p]-p[i.p],t=t/d._caScrollDist*f),d&&d.seek(g),d?t:Math.round(t)},o0=/(webkit|moz|length|cssText|inset)/i,_d=function(t,e,n,i){if(t.parentNode!==e){var s=t.style,o,a;if(e===ve){t._stOrig=s.cssText,a=Gn(t);for(o in a)!+o&&!o0.test(o)&&a[o]&&typeof s[o]=="string"&&o!=="0"&&(s[o]=a[o]);s.top=n,s.left=i}else s.cssText=t._stOrig;wt.core.getCache(t).uncache=1,e.appendChild(t)}},Bd=function(t,e,n){var i=e,s=i;return function(o){var a=Math.round(t());return a!==i&&a!==s&&Math.abs(a-i)>3&&Math.abs(a-s)>3&&(o=a,n&&n()),s=i,i=o,o}},Ca=function(t,e,n){var i={};i[e.p]="+="+n,wt.set(t,i)},xd=function(t,e){var n=Ci(t,e),i="_scroll"+e.p2,s=function o(a,l,c,u,h){var f=o.tween,d=l.onComplete,_={};c=c||n();var g=Bd(n,c,function(){f.kill(),o.tween=0});return h=u&&h||0,u=u||a-c,f&&f.kill(),l[i]=a,l.inherit=!1,l.modifiers=_,_[i]=function(){return g(c+u*f.ratio+h*f.ratio*f.ratio)},l.onUpdate=function(){ne.cache++,o.tween&&Ii()},l.onComplete=function(){o.tween=0,d&&d.call(f)},f=o.tween=wt.to(t,l),f};return t[i]=n,n.wheelHandler=function(){return s.tween&&s.tween.kill()&&(s.tween=0)},Xe(t,"wheel",n.wheelHandler),Pt.isTouch&&Xe(t,"touchmove",n.wheelHandler),s},Pt=function(){function r(e,n){Ms||r.register(wt)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),tu(this),this.init(e,n)}var t=r.prototype;return t.init=function(n,i){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),!To){this.update=this.refresh=this.kill=mi;return}n=hd(Fn(n)||Do(n)||n.nodeType?{trigger:n}:n,Ta);var s=n,o=s.onUpdate,a=s.toggleClass,l=s.id,c=s.onToggle,u=s.onRefresh,h=s.scrub,f=s.trigger,d=s.pin,_=s.pinSpacing,g=s.invalidateOnRefresh,m=s.anticipatePin,p=s.onScrubComplete,b=s.onSnapComplete,y=s.once,S=s.snap,D=s.pinReparent,A=s.pinSpacer,w=s.containerAnimation,P=s.fastScrollEnd,M=s.preventOverlaps,v=n.horizontal||n.containerAnimation&&n.horizontal!==!1?rn:Ne,N=!h&&h!==0,F=mn(n.scroller||oe),R=wt.core.getCache(F),B=kr(F),Y=("pinType"in n?n.pinType:Ri(F,"pinType")||B&&"fixed")==="fixed",H=[n.onEnter,n.onLeave,n.onEnterBack,n.onLeaveBack],J=N&&n.toggleActions.split(" "),O="markers"in n?n.markers:Ta.markers,L=B?0:parseFloat(Gn(F)["border"+v.p2+Ts])||0,C=this,ot=n.onRefreshInit&&function(){return n.onRefreshInit(C)},vt=$_(F,B,v),Wt=K_(F,B),q=0,tt=0,pt=0,st=Ci(F,v),Ft,Nt,V,Yt,Et,Tt,St,zt,Ut,k,Qt,T,x,I,G,K,Q,ht,ct,nt,bt,rt,ft,Ot,it,yt,Bt,Vt,he,kt,U,$,et,ut,lt,Dt,te,ae,re;if(C._startClamp=C._endClamp=!1,C._dir=v,m*=45,C.scroller=F,C.scroll=w?w.time.bind(w):st,Yt=st(),C.vars=n,i=i||n.animation,"refreshPriority"in n&&(bd=1,n.refreshPriority===-9999&&(No=C)),R.tweenScroll=R.tweenScroll||{top:xd(F,Ne),left:xd(F,rn)},C.tweenTo=Ft=R.tweenScroll[v.p],C.scrubDuration=function(mt){et=Do(mt)&&mt,et?$?$.duration(mt):$=wt.to(i,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:et,paused:!0,onComplete:function(){return p&&p(C)}}):($&&$.progress(1).kill(),$=0)},i&&(i.vars.lazy=!1,i._initted&&!C.isReverted||i.vars.immediateRender!==!1&&n.immediateRender!==!1&&i.duration()&&i.render(0,!0,!0),C.animation=i.pause(),i.scrollTrigger=C,C.scrubDuration(h),kt=0,l||(l=i.vars.id)),S&&((!Nr(S)||S.push)&&(S={snapTo:S}),"scrollBehavior"in ve.style&&wt.set(B?[ve,ti]:F,{scrollBehavior:"auto"}),ne.forEach(function(mt){return vn(mt)&&mt.target===(B?De.scrollingElement||ti:F)&&(mt.smooth=!1)}),V=vn(S.snapTo)?S.snapTo:S.snapTo==="labels"?Q_(i):S.snapTo==="labelsDirectional"?t0(i):S.directional!==!1?function(mt,qt){return uu(S.snapTo)(mt,on()-tt<500?0:qt.direction)}:wt.utils.snap(S.snapTo),ut=S.duration||{min:.1,max:2},ut=Nr(ut)?Ro(ut.min,ut.max):Ro(ut,ut),lt=wt.delayedCall(S.delay||et/2||.1,function(){var mt=st(),qt=on()-tt<500,It=Ft.tween;if((qt||Math.abs(C.getVelocity())<10)&&!It&&!ka&&q!==mt){var Xt=(mt-Tt)/I,Ee=i&&!N?i.totalProgress():Xt,ee=qt?0:(Ee-U)/(on()-Eo)*1e3||0,Se=wt.utils.clamp(-Xt,1-Xt,ys(ee/2)*ee/.185),He=Xt+(S.inertia===!1?0:Se),Me,_e,E=S,z=E.onStart,W=E.onInterrupt,X=E.onComplete;if(Me=V(He,C),Do(Me)||(Me=He),_e=Math.round(Tt+Me*I),mt<=St&&mt>=Tt&&_e!==mt){if(It&&!It._initted&&It.data<=ys(_e-mt))return;S.inertia===!1&&(Se=Me-Xt),Ft(_e,{duration:ut(ys(Math.max(ys(He-Ee),ys(Me-Ee))*.185/ee/.05||0)),ease:S.ease||"power3",data:ys(_e-mt),onInterrupt:function(){return lt.restart(!0)&&W&&W(C)},onComplete:function(){C.update(),q=st(),i&&($?$.resetTo("totalProgress",Me,i._tTime/i._tDur):i.progress(Me)),kt=U=i&&!N?i.totalProgress():C.progress,b&&b(C),X&&X(C)}},mt,Se*I,_e-mt-Se*I),z&&z(C,Ft.tween)}}else C.isActive&&q!==mt&<.restart(!0)}).pause()),l&&(nu[l]=C),f=C.trigger=mn(f||d!==!0&&d),re=f&&f._gsap&&f._gsap.stRevert,re&&(re=re(C)),d=d===!0?f:mn(d),Fn(a)&&(a={targets:f,className:a}),d&&(_===!1||_===Hn||(_=!_&&d.parentNode&&d.parentNode.style&&Gn(d.parentNode).display==="flex"?!1:Ue),C.pin=d,Nt=wt.core.getCache(d),Nt.spacer?G=Nt.pinState:(A&&(A=mn(A),A&&!A.nodeType&&(A=A.current||A.nativeElement),Nt.spacerIsNative=!!A,A&&(Nt.spacerState=Da(A))),Nt.spacer=ht=A||De.createElement("div"),ht.classList.add("pin-spacer"),l&&ht.classList.add("pin-spacer-"+l),Nt.pinState=G=Da(d)),n.force3D!==!1&&wt.set(d,{force3D:!0}),C.spacer=ht=Nt.spacer,he=Gn(d),Ot=he[_+v.os2],nt=wt.getProperty(d),bt=wt.quickSetter(d,v.a,ze),$c(d,ht,he),Q=Da(d)),O){T=Nr(O)?hd(O,fd):fd,k=Aa("scroller-start",l,F,v,T,0),Qt=Aa("scroller-end",l,F,v,T,0,k),ct=k["offset"+v.op.d2];var Zt=mn(Ri(F,"content")||F);zt=this.markerStart=Aa("start",l,Zt,v,T,ct,0,w),Ut=this.markerEnd=Aa("end",l,Zt,v,T,ct,0,w),w&&(ae=wt.quickSetter([zt,Ut],v.a,ze)),!Y&&!(Qn.length&&Ri(F,"fixedMarkers")===!0)&&(j_(B?ve:F),wt.set([k,Qt],{force3D:!0}),yt=wt.quickSetter(k,v.a,ze),Vt=wt.quickSetter(Qt,v.a,ze))}if(w){var Ct=w.vars.onUpdate,Mt=w.vars.onUpdateParams;w.eventCallback("onUpdate",function(){C.update(0,0,1),Ct&&Ct.apply(w,Mt||[])})}if(C.previous=function(){return ie[ie.indexOf(C)-1]},C.next=function(){return ie[ie.indexOf(C)+1]},C.revert=function(mt,qt){if(!qt)return C.kill(!0);var It=mt!==!1||!C.enabled,Xt=sn;It!==C.isReverted&&(It&&(Dt=Math.max(st(),C.scroll.rec||0),pt=C.progress,te=i&&i.progress()),zt&&[zt,Ut,k,Qt].forEach(function(Ee){return Ee.style.display=It?"none":"block"}),It&&(sn=C,C.update(It)),d&&(!D||!C.isActive)&&(It?i0(d,ht,G):$c(d,ht,Gn(d),it)),It||C.update(It),sn=Xt,C.isReverted=It)},C.refresh=function(mt,qt,It,Xt){if(!((sn||!C.enabled)&&!qt)){if(d&&mt&&Wn){Xe(r,"scrollEnd",Fd);return}!xn&&ot&&ot(C),sn=C,Ft.tween&&!It&&(Ft.tween.kill(),Ft.tween=0),$&&$.pause(),g&&i&&i.revert({kill:!1}).invalidate(),C.isReverted||C.revert(!0,!0),C._subPinOffset=!1;var Ee=vt(),ee=Wt(),Se=w?w.duration():gi(F,v),He=I<=.01,Me=0,_e=Xt||0,E=Nr(It)?It.end:n.end,z=n.endTrigger||f,W=Nr(It)?It.start:n.start||(n.start===0||!f?0:d?"0 0":"0 100%"),X=C.pinnedContainer=n.pinnedContainer&&mn(n.pinnedContainer,C),Z=f&&Math.max(0,ie.indexOf(C))||0,dt=Z,gt,xt,Lt,Gt,Rt,At,fe,Fe,je,un,Jt,Ht,ci;for(O&&Nr(It)&&(Ht=wt.getProperty(k,v.p),ci=wt.getProperty(Qt,v.p));dt--;)At=ie[dt],At.end||At.refresh(0,1)||(sn=C),fe=At.pin,fe&&(fe===f||fe===d||fe===X)&&!At.isReverted&&(un||(un=[]),un.unshift(At),At.revert(!0,!0)),At!==ie[dt]&&(Z--,dt--);for(vn(W)&&(W=W(C)),W=ad(W,"start",C),Tt=gd(W,f,Ee,v,st(),zt,k,C,ee,L,Y,Se,w,C._startClamp&&"_startClamp")||(d?-.001:0),vn(E)&&(E=E(C)),Fn(E)&&!E.indexOf("+=")&&(~E.indexOf(" ")?E=(Fn(W)?W.split(" ")[0]:"")+E:(Me=Pa(E.substr(2),Ee),E=Fn(W)?W:(w?wt.utils.mapRange(0,w.duration(),w.scrollTrigger.start,w.scrollTrigger.end,Tt):Tt)+Me,z=f)),E=ad(E,"end",C),St=Math.max(Tt,gd(E||(z?"100% 0":Se),z,Ee,v,st()+Me,Ut,Qt,C,ee,L,Y,Se,w,C._endClamp&&"_endClamp"))||-.001,Me=0,dt=Z;dt--;)At=ie[dt],fe=At.pin,fe&&At.start-At._pinPush<=Tt&&!w&&At.end>0&&(gt=At.end-(C._startClamp?Math.max(0,At.start):At.start),(fe===f&&At.start-At._pinPush<Tt||fe===X)&&isNaN(W)&&(Me+=gt*(1-At.progress)),fe===d&&(_e+=gt));if(Tt+=Me,St+=Me,C._startClamp&&(C._startClamp+=Me),C._endClamp&&!xn&&(C._endClamp=St||-.001,St=Math.min(St,gi(F,v))),I=St-Tt||(Tt-=.01)&&.001,He&&(pt=wt.utils.clamp(0,1,wt.utils.normalize(Tt,St,Dt))),C._pinPush=_e,zt&&Me&&(gt={},gt[v.a]="+="+Me,X&&(gt[v.p]="-="+st()),wt.set([zt,Ut],gt)),d&&!(eu&&C.end>=gi(F,v)))gt=Gn(d),Gt=v===Ne,Lt=st(),rt=parseFloat(nt(v.a))+_e,!Se&&St>1&&(Jt=(B?De.scrollingElement||ti:F).style,Jt={style:Jt,value:Jt["overflow"+v.a.toUpperCase()]},B&&Gn(ve)["overflow"+v.a.toUpperCase()]!=="scroll"&&(Jt.style["overflow"+v.a.toUpperCase()]="scroll")),$c(d,ht,gt),Q=Da(d),xt=Pi(d,!0),Fe=Y&&Ci(F,Gt?rn:Ne)(),_?(it=[_+v.os2,I+_e+ze],it.t=ht,dt=_===Ue?Ba(d,v)+I+_e:0,dt&&(it.push(v.d,dt+ze),ht.style.flexBasis!=="auto"&&(ht.style.flexBasis=dt+ze)),Es(it),X&&ie.forEach(function(pe){pe.pin===X&&pe.vars.pinSpacing!==!1&&(pe._subPinOffset=!0)}),Y&&st(Dt)):(dt=Ba(d,v),dt&&ht.style.flexBasis!=="auto"&&(ht.style.flexBasis=dt+ze)),Y&&(Rt={top:xt.top+(Gt?Lt-Tt:Fe)+ze,left:xt.left+(Gt?Fe:Lt-Tt)+ze,boxSizing:"border-box",position:"fixed"},Rt[Or]=Rt["max"+Ts]=Math.ceil(xt.width)+ze,Rt[Br]=Rt["max"+cu]=Math.ceil(xt.height)+ze,Rt[Hn]=Rt[Hn+Lo]=Rt[Hn+Po]=Rt[Hn+Fo]=Rt[Hn+Io]="0",Rt[Ue]=gt[Ue],Rt[Ue+Lo]=gt[Ue+Lo],Rt[Ue+Po]=gt[Ue+Po],Rt[Ue+Fo]=gt[Ue+Fo],Rt[Ue+Io]=gt[Ue+Io],K=s0(G,Rt,D),xn&&st(0)),i?(je=i._initted,Xc(1),i.render(i.duration(),!0,!0),ft=nt(v.a)-rt+I+_e,Bt=Math.abs(I-ft)>1,Y&&Bt&&K.splice(K.length-2,2),i.render(0,!0,!0),je||i.invalidate(!0),i.parent||i.totalTime(i.totalTime()),Xc(0)):ft=I,Jt&&(Jt.value?Jt.style["overflow"+v.a.toUpperCase()]=Jt.value:Jt.style.removeProperty("overflow-"+v.a));else if(f&&st()&&!w)for(xt=f.parentNode;xt&&xt!==ve;)xt._pinOffset&&(Tt-=xt._pinOffset,St-=xt._pinOffset),xt=xt.parentNode;un&&un.forEach(function(pe){return pe.revert(!1,!0)}),C.start=Tt,C.end=St,Yt=Et=xn?Dt:st(),!w&&!xn&&(Yt<Dt&&st(Dt),C.scroll.rec=0),C.revert(!1,!0),tt=on(),lt&&(q=-1,lt.restart(!0)),sn=0,i&&N&&(i._initted||te)&&i.progress()!==te&&i.progress(te||0,!0).render(i.time(),!0,!0),(He||pt!==C.progress||w||g)&&(i&&!N&&i.totalProgress(w&&Tt<-.001&&!pt?wt.utils.normalize(Tt,St,0):pt,!0),C.progress=He||(Yt-Tt)/I===pt?0:pt),d&&_&&(ht._pinOffset=Math.round(C.progress*ft)),$&&$.invalidate(),isNaN(Ht)||(Ht-=wt.getProperty(k,v.p),ci-=wt.getProperty(Qt,v.p),Ca(k,v,Ht),Ca(zt,v,Ht-(Xt||0)),Ca(Qt,v,ci),Ca(Ut,v,ci-(Xt||0))),He&&!xn&&C.update(),u&&!xn&&!x&&(x=!0,u(C),x=!1)}},C.getVelocity=function(){return(st()-Et)/(on()-Eo)*1e3||0},C.endAnimation=function(){wo(C.callbackAnimation),i&&($?$.progress(1):i.paused()?N||wo(i,C.direction<0,1):wo(i,i.reversed()))},C.labelToScroll=function(mt){return i&&i.labels&&(Tt||C.refresh()||Tt)+i.labels[mt]/i.duration()*I||0},C.getTrailing=function(mt){var qt=ie.indexOf(C),It=C.direction>0?ie.slice(0,qt).reverse():ie.slice(qt+1);return(Fn(mt)?It.filter(function(Xt){return Xt.vars.preventOverlaps===mt}):It).filter(function(Xt){return C.direction>0?Xt.end<=Tt:Xt.start>=St})},C.update=function(mt,qt,It){if(!(w&&!It&&!mt)){var Xt=xn===!0?Dt:C.scroll(),Ee=mt?0:(Xt-Tt)/I,ee=Ee<0?0:Ee>1?1:Ee||0,Se=C.progress,He,Me,_e,E,z,W,X,Z;if(qt&&(Et=Yt,Yt=w?st():Xt,S&&(U=kt,kt=i&&!N?i.totalProgress():ee)),m&&d&&!sn&&!Ma&&Wn&&(!ee&&Tt<Xt+(Xt-Et)/(on()-Eo)*m?ee=1e-4:ee===1&&St>Xt+(Xt-Et)/(on()-Eo)*m&&(ee=.9999)),ee!==Se&&C.enabled){if(He=C.isActive=!!ee&&ee<1,Me=!!Se&&Se<1,W=He!==Me,z=W||!!ee!=!!Se,C.direction=ee>Se?1:-1,C.progress=ee,z&&!sn&&(_e=ee&&!Se?0:ee===1?1:Se===1?2:3,N&&(E=!W&&J[_e+1]!=="none"&&J[_e+1]||J[_e],Z=i&&(E==="complete"||E==="reset"||E in i))),M&&(W||Z)&&(Z||h||!i)&&(vn(M)?M(C):C.getTrailing(M).forEach(function(Lt){return Lt.endAnimation()})),N||($&&!sn&&!Ma?($._dp._time-$._start!==$._time&&$.render($._dp._time-$._start),$.resetTo?$.resetTo("totalProgress",ee,i._tTime/i._tDur):($.vars.totalProgress=ee,$.invalidate().restart())):i&&i.totalProgress(ee,!!(sn&&(tt||mt)))),d){if(mt&&_&&(ht.style[_+v.os2]=Ot),!Y)bt(Ao(rt+ft*ee));else if(z){if(X=!mt&&ee>Se&&St+1>Xt&&Xt+1>=gi(F,v),D)if(!mt&&(He||X)){var dt=Pi(d,!0),gt=Xt-Tt;_d(d,ve,dt.top+(v===Ne?gt:0)+ze,dt.left+(v===Ne?0:gt)+ze)}else _d(d,ht);Es(He||X?K:Q),Bt&&ee<1&&He||bt(rt+(ee===1&&!X?ft:0))}}S&&!Ft.tween&&!sn&&!Ma&<.restart(!0),a&&(W||y&&ee&&(ee<1||!qc))&&Uo(a.targets).forEach(function(Lt){return Lt.classList[He||y?"add":"remove"](a.className)}),o&&!N&&!mt&&o(C),z&&!sn?(N&&(Z&&(E==="complete"?i.pause().totalProgress(1):E==="reset"?i.restart(!0).pause():E==="restart"?i.restart(!0):i[E]()),o&&o(C)),(W||!qc)&&(c&&W&&Zc(C,c),H[_e]&&Zc(C,H[_e]),y&&(ee===1?C.kill(!1,1):H[_e]=0),W||(_e=ee===1?1:3,H[_e]&&Zc(C,H[_e]))),P&&!He&&Math.abs(C.getVelocity())>(Do(P)?P:2500)&&(wo(C.callbackAnimation),$?$.progress(1):wo(i,E==="reverse"?1:!ee,1))):N&&o&&!sn&&o(C)}if(Vt){var xt=w?Xt/w.duration()*(w._caScrollDist||0):Xt;yt(xt+(k._isFlipped?1:0)),Vt(xt)}ae&&ae(-Xt/w.duration()*(w._caScrollDist||0))}},C.enable=function(mt,qt){C.enabled||(C.enabled=!0,Xe(F,"resize",Co),B||Xe(F,"scroll",Ss),ot&&Xe(r,"refreshInit",ot),mt!==!1&&(C.progress=pt=0,Yt=Et=q=st()),qt!==!1&&C.refresh())},C.getTween=function(mt){return mt&&Ft?Ft.tween:$},C.setPositions=function(mt,qt,It,Xt){if(w){var Ee=w.scrollTrigger,ee=w.duration(),Se=Ee.end-Ee.start;mt=Ee.start+Se*mt/ee,qt=Ee.start+Se*qt/ee}C.refresh(!1,!1,{start:ld(mt,It&&!!C._startClamp),end:ld(qt,It&&!!C._endClamp)},Xt),C.update()},C.adjustPinSpacing=function(mt){if(it&&mt){var qt=it.indexOf(v.d)+1;it[qt]=parseFloat(it[qt])+mt+ze,it[1]=parseFloat(it[1])+mt+ze,Es(it)}},C.disable=function(mt,qt){if(C.enabled&&(mt!==!1&&C.revert(!0,!0),C.enabled=C.isActive=!1,qt||$&&$.pause(),Dt=0,Nt&&(Nt.uncache=1),ot&&We(r,"refreshInit",ot),lt&&(lt.pause(),Ft.tween&&Ft.tween.kill()&&(Ft.tween=0)),!B)){for(var It=ie.length;It--;)if(ie[It].scroller===F&&ie[It]!==C)return;We(F,"resize",Co),B||We(F,"scroll",Ss)}},C.kill=function(mt,qt){C.disable(mt,qt),$&&!qt&&$.kill(),l&&delete nu[l];var It=ie.indexOf(C);It>=0&&ie.splice(It,1),It===_n&&La>0&&_n--,It=0,ie.forEach(function(Xt){return Xt.scroller===C.scroller&&(It=1)}),It||xn||(C.scroll.rec=0),i&&(i.scrollTrigger=null,mt&&i.revert({kill:!1}),qt||i.kill()),zt&&[zt,Ut,k,Qt].forEach(function(Xt){return Xt.parentNode&&Xt.parentNode.removeChild(Xt)}),No===C&&(No=0),d&&(Nt&&(Nt.uncache=1),It=0,ie.forEach(function(Xt){return Xt.pin===d&&It++}),It||(Nt.spacer=0)),n.onKill&&n.onKill(C)},ie.push(C),C.enable(!1,!1),re&&re(C),i&&i.add&&!I){var le=C.update;C.update=function(){C.update=le,Tt||St||C.refresh()},wt.delayedCall(.01,C.update),I=.01,Tt=St=0}else C.refresh();d&&n0()},r.register=function(n){return Ms||(wt=n||Dd(),Ad()&&window.document&&r.enable(),Ms=To),Ms},r.defaults=function(n){if(n)for(var i in n)Ta[i]=n[i];return Ta},r.disable=function(n,i){To=0,ie.forEach(function(o){return o[i?"kill":"disable"](n)}),We(oe,"wheel",Ss),We(De,"scroll",Ss),clearInterval(Sa),We(De,"touchcancel",mi),We(ve,"touchstart",mi),wa(We,De,"pointerdown,touchstart,mousedown",cd),wa(We,De,"pointerup,touchend,mouseup",ud),Ua.kill(),ba(We);for(var s=0;s<ne.length;s+=3)Ea(We,ne[s],ne[s+1]),Ea(We,ne[s],ne[s+2])},r.enable=function(){if(oe=window,De=document,ti=De.documentElement,ve=De.body,wt&&(Uo=wt.utils.toArray,Ro=wt.utils.clamp,tu=wt.core.context||mi,Xc=wt.core.suppressOverwrites||mi,su=oe.history.scrollRestoration||"auto",iu=oe.pageYOffset,wt.core.globals("ScrollTrigger",r),ve)){To=1,ws=document.createElement("div"),ws.style.height="100vh",ws.style.position="absolute",Od(),J_(),Pe.register(wt),r.isTouch=Pe.isTouch,nr=Pe.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),Qc=Pe.isTouch===1,Xe(oe,"wheel",Ss),Md=[oe,De,ti,ve],wt.matchMedia?(r.matchMedia=function(l){var c=wt.matchMedia(),u;for(u in l)c.add(u,l[u]);return c},wt.addEventListener("matchMediaInit",function(){return hu()}),wt.addEventListener("matchMediaRevert",function(){return Nd()}),wt.addEventListener("matchMedia",function(){Ur(0,1),Hr("matchMedia")}),wt.matchMedia("(orientation: portrait)",function(){return Jc(),Jc})):console.warn("Requires GSAP 3.11.0 or later"),Jc(),Xe(De,"scroll",Ss);var n=ve.style,i=n.borderTopStyle,s=wt.core.Animation.prototype,o,a;for(s.revert||Object.defineProperty(s,"revert",{value:function(){return this.time(-.01,!0)}}),n.borderTopStyle="solid",o=Pi(ve),Ne.m=Math.round(o.top+Ne.sc())||0,rn.m=Math.round(o.left+rn.sc())||0,i?n.borderTopStyle=i:n.removeProperty("border-top-style"),Sa=setInterval(dd,250),wt.delayedCall(.5,function(){return Ma=0}),Xe(De,"touchcancel",mi),Xe(ve,"touchstart",mi),wa(Xe,De,"pointerdown,touchstart,mousedown",cd),wa(Xe,De,"pointerup,touchend,mouseup",ud),jc=wt.utils.checkPrefix("transform"),Fa.push(jc),Ms=on(),Ua=wt.delayedCall(.2,Ur).pause(),bs=[De,"visibilitychange",function(){var l=oe.innerWidth,c=oe.innerHeight;De.hidden?(sd=l,od=c):(sd!==l||od!==c)&&Co()},De,"DOMContentLoaded",Ur,oe,"load",Ur,oe,"resize",Co],ba(Xe),ie.forEach(function(l){return l.enable(0,1)}),a=0;a<ne.length;a+=3)Ea(We,ne[a],ne[a+1]),Ea(We,ne[a],ne[a+2])}},r.config=function(n){"limitCallbacks"in n&&(qc=!!n.limitCallbacks);var i=n.syncInterval;i&&clearInterval(Sa)||(Sa=i)&&setInterval(dd,i),"ignoreMobileResize"in n&&(Qc=r.isTouch===1&&n.ignoreMobileResize),"autoRefreshEvents"in n&&(ba(We)||ba(Xe,n.autoRefreshEvents||"none"),wd=(n.autoRefreshEvents+"").indexOf("resize")===-1)},r.scrollerProxy=function(n,i){var s=mn(n),o=ne.indexOf(s),a=kr(s);~o&&ne.splice(o,a?6:2),i&&(a?Qn.unshift(oe,i,ve,i,ti,i):Qn.unshift(s,i))},r.clearMatchMedia=function(n){ie.forEach(function(i){return i._ctx&&i._ctx.query===n&&i._ctx.kill(!0,!0)})},r.isInViewport=function(n,i,s){var o=(Fn(n)?mn(n):n).getBoundingClientRect(),a=o[s?Or:Br]*i||0;return s?o.right-a>0&&o.left+a<oe.innerWidth:o.bottom-a>0&&o.top+a<oe.innerHeight},r.positionInViewport=function(n,i,s){Fn(n)&&(n=mn(n));var o=n.getBoundingClientRect(),a=o[s?Or:Br],l=i==null?a/2:i in za?za[i]*a:~i.indexOf("%")?parseFloat(i)*a/100:parseFloat(i)||0;return s?(o.left+l)/oe.innerWidth:(o.top+l)/oe.innerHeight},r.killAll=function(n){if(ie.slice(0).forEach(function(s){return s.vars.id!=="ScrollSmoother"&&s.kill()}),n!==!0){var i=Vr.killAll||[];Vr={},i.forEach(function(s){return s()})}},r}();Pt.version="3.12.5";Pt.saveStyles=function(r){return r?Uo(r).forEach(function(t){if(t&&t.style){var e=Ln.indexOf(t);e>=0&&Ln.splice(e,5),Ln.push(t,t.style.cssText,t.getBBox&&t.getAttribute("transform"),wt.core.getCache(t),tu())}}):Ln};Pt.revert=function(r,t){return hu(!r,t)};Pt.create=function(r,t){return new Pt(r,t)};Pt.refresh=function(r){return r?Co():(Ms||Pt.register())&&Ur(!0)};Pt.update=function(r){return++ne.cache&&Ii(r===!0?2:0)};Pt.clearScrollMemory=Ud;Pt.maxScroll=function(r,t){return gi(r,t?rn:Ne)};Pt.getScrollFunc=function(r,t){return Ci(mn(r),t?rn:Ne)};Pt.getById=function(r){return nu[r]};Pt.getAll=function(){return ie.filter(function(r){return r.vars.id!=="ScrollSmoother"})};Pt.isScrolling=function(){return!!Wn};Pt.snapDirectional=uu;Pt.addEventListener=function(r,t){var e=Vr[r]||(Vr[r]=[]);~e.indexOf(t)||e.push(t)};Pt.removeEventListener=function(r,t){var e=Vr[r],n=e&&e.indexOf(t);n>=0&&e.splice(n,1)};Pt.batch=function(r,t){var e=[],n={},i=t.interval||.016,s=t.batchMax||1e9,o=function(c,u){var h=[],f=[],d=wt.delayedCall(i,function(){u(h,f),h=[],f=[]}).pause();return function(_){h.length||d.restart(!0),h.push(_.trigger),f.push(_),s<=h.length&&d.progress(1)}},a;for(a in t)n[a]=a.substr(0,2)==="on"&&vn(t[a])&&a!=="onRefreshInit"?o(a,t[a]):t[a];return vn(s)&&(s=s(),Xe(Pt,"refresh",function(){return s=t.batchMax()})),Uo(r).forEach(function(l){var c={};for(a in n)c[a]=n[a];c.trigger=l,e.push(Pt.create(c))}),e};var vd=function(t,e,n,i){return e>i?t(i):e<0&&t(0),n>i?(i-e)/(n-e):n<0?e/(e-n):1},Kc=function r(t,e){e===!0?t.style.removeProperty("touch-action"):t.style.touchAction=e===!0?"auto":e?"pan-"+e+(Pe.isTouch?" pinch-zoom":""):"none",t===ti&&r(ve,e)},Ra={auto:1,scroll:1},a0=function(t){var e=t.event,n=t.target,i=t.axis,s=(e.changedTouches?e.changedTouches[0]:e).target,o=s._gsap||wt.core.getCache(s),a=on(),l;if(!o._isScrollT||a-o._isScrollT>2e3){for(;s&&s!==ve&&(s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth||!(Ra[(l=Gn(s)).overflowY]||Ra[l.overflowX]));)s=s.parentNode;o._isScroll=s&&s!==n&&!kr(s)&&(Ra[(l=Gn(s)).overflowY]||Ra[l.overflowX]),o._isScrollT=a}(o._isScroll||i==="x")&&(e.stopPropagation(),e._gsapAllow=!0)},zd=function(t,e,n,i){return Pe.create({target:t,capture:!0,debounce:!1,lockAxis:!0,type:e,onWheel:i=i&&a0,onPress:i,onDrag:i,onScroll:i,onEnable:function(){return n&&Xe(De,Pe.eventTypes[0],Sd,!1,!0)},onDisable:function(){return We(De,Pe.eventTypes[0],Sd,!0)}})},l0=/(input|label|select|textarea)/i,yd,Sd=function(t){var e=l0.test(t.target.tagName);(e||yd)&&(t._gsapAllow=!0,yd=e)},c0=function(t){Nr(t)||(t={}),t.preventDefault=t.isNormalizer=t.allowClicks=!0,t.type||(t.type="wheel,touch"),t.debounce=!!t.debounce,t.id=t.id||"normalizer";var e=t,n=e.normalizeScrollX,i=e.momentum,s=e.allowNestedScroll,o=e.onRelease,a,l,c=mn(t.target)||ti,u=wt.core.globals().ScrollSmoother,h=u&&u.get(),f=nr&&(t.content&&mn(t.content)||h&&t.content!==!1&&!h.smooth()&&h.content()),d=Ci(c,Ne),_=Ci(c,rn),g=1,m=(Pe.isTouch&&oe.visualViewport?oe.visualViewport.scale*oe.visualViewport.width:oe.outerWidth)/oe.innerWidth,p=0,b=vn(i)?function(){return i(a)}:function(){return i||2.8},y,S,D=zd(c,t.type,!0,s),A=function(){return S=!1},w=mi,P=mi,M=function(){l=gi(c,Ne),P=Ro(nr?1:0,l),n&&(w=Ro(0,gi(c,rn))),y=zr},v=function(){f._gsap.y=Ao(parseFloat(f._gsap.y)+d.offset)+"px",f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(f._gsap.y)+", 0, 1)",d.offset=d.cacheID=0},N=function(){if(S){requestAnimationFrame(A);var O=Ao(a.deltaY/2),L=P(d.v-O);if(f&&L!==d.v+d.offset){d.offset=L-d.v;var C=Ao((parseFloat(f&&f._gsap.y)||0)-d.offset);f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+C+", 0, 1)",f._gsap.y=C+"px",d.cacheID=ne.cache,Ii()}return!0}d.offset&&v(),S=!0},F,R,B,Y,H=function(){M(),F.isActive()&&F.vars.scrollY>l&&(d()>l?F.progress(1)&&d(l):F.resetTo("scrollY",l))};return f&&wt.set(f,{y:"+=0"}),t.ignoreCheck=function(J){return nr&&J.type==="touchmove"&&N(J)||g>1.05&&J.type!=="touchstart"||a.isGesturing||J.touches&&J.touches.length>1},t.onPress=function(){S=!1;var J=g;g=Ao((oe.visualViewport&&oe.visualViewport.scale||1)/m),F.pause(),J!==g&&Kc(c,g>1.01?!0:n?!1:"x"),R=_(),B=d(),M(),y=zr},t.onRelease=t.onGestureStart=function(J,O){if(d.offset&&v(),!O)Y.restart(!0);else{ne.cache++;var L=b(),C,ot;n&&(C=_(),ot=C+L*.05*-J.velocityX/.227,L*=vd(_,C,ot,gi(c,rn)),F.vars.scrollX=w(ot)),C=d(),ot=C+L*.05*-J.velocityY/.227,L*=vd(d,C,ot,gi(c,Ne)),F.vars.scrollY=P(ot),F.invalidate().duration(L).play(.01),(nr&&F.vars.scrollY>=l||C>=l-1)&&wt.to({},{onUpdate:H,duration:L})}o&&o(J)},t.onWheel=function(){F._ts&&F.pause(),on()-p>1e3&&(y=0,p=on())},t.onChange=function(J,O,L,C,ot){if(zr!==y&&M(),O&&n&&_(w(C[2]===O?R+(J.startX-J.x):_()+O-C[1])),L){d.offset&&v();var vt=ot[2]===L,Wt=vt?B+J.startY-J.y:d()+L-ot[1],q=P(Wt);vt&&Wt!==q&&(B+=q-Wt),d(q)}(L||O)&&Ii()},t.onEnable=function(){Kc(c,n?!1:"x"),Pt.addEventListener("refresh",H),Xe(oe,"resize",H),d.smooth&&(d.target.style.scrollBehavior="auto",d.smooth=_.smooth=!1),D.enable()},t.onDisable=function(){Kc(c,!0),We(oe,"resize",H),Pt.removeEventListener("refresh",H),D.kill()},t.lockAxis=t.lockAxis!==!1,a=new Pe(t),a.iOS=nr,nr&&!d()&&d(1),nr&&wt.ticker.add(mi),Y=a._dc,F=wt.to(a,{ease:"power4",paused:!0,inherit:!1,scrollX:n?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:Bd(d,d(),function(){return F.pause()})},onUpdate:Ii,onComplete:Y.vars.onComplete}),a};Pt.sort=function(r){return ie.sort(r||function(t,e){return(t.vars.refreshPriority||0)*-1e6+t.start-(e.start+(e.vars.refreshPriority||0)*-1e6)})};Pt.observe=function(r){return new Pe(r)};Pt.normalizeScroll=function(r){if(typeof r>"u")return gn;if(r===!0&&gn)return gn.enable();if(r===!1){gn&&gn.kill(),gn=r;return}var t=r instanceof Pe?r:c0(r);return gn&&gn.target===t.target&&gn.kill(),kr(t.target)&&(gn=t),t};Pt.core={_getVelocityProp:ya,_inputObserver:zd,_scrollers:ne,_proxies:Qn,bridge:{ss:function(){Wn||Hr("scrollStart"),Wn=on()},ref:function(){return sn}}};Dd()&&wt.registerPlugin(Pt);var u0=/(?:^\s+|\s+$)/g,fu=/([\uD800-\uDBFF][\uDC00-\uDFFF](?:[\u200D\uFE0F][\uD800-\uDBFF][\uDC00-\uDFFF]){2,}|\uD83D\uDC69(?:\u200D(?:(?:\uD83D\uDC69\u200D)?\uD83D\uDC67|(?:\uD83D\uDC69\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]\uFE0F|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC6F\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3C-\uDD3E\uDDD6-\uDDDF])\u200D[\u2640\u2642]\uFE0F|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F\u200D[\u2640\u2642]|(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642])\uFE0F|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC69\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708]))\uFE0F|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83D\uDC69\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]))|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\u200D(?:(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDD1-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])?|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])\uFE0F)/;function As(r){var t=r.nodeType,e="";if(t===1||t===9||t===11){if(typeof r.textContent=="string")return r.textContent;for(r=r.firstChild;r;r=r.nextSibling)e+=As(r)}else if(t===3||t===4)return r.nodeValue;return e}function ei(r,t,e,n){if(r+="",e&&(r=r.trim?r.trim():r.replace(u0,"")),t&&t!=="")return r.replace(/>/g,">").replace(/</g,"<").split(t);for(var i=[],s=r.length,o=0,a,l;o<s;o++)l=r.charAt(o),(l.charCodeAt(0)>=55296&&l.charCodeAt(0)<=56319||r.charCodeAt(o+1)>=65024&&r.charCodeAt(o+1)<=65039)&&(a=((r.substr(o,12).split(fu)||[])[1]||"").length||2,l=r.substr(o,a),i.emoji=1,o+=a-1),i.push(l===">"?">":l==="<"?"<":n&&l===" "&&(r.charAt(o-1)===" "||r.charAt(o+1)===" ")?" ":l);return i}var Ds,pu,Hd,Bo,Gd,Va,h0=/(?:\r|\n|\t\t)/g,f0=/(?:\s\s+)/g,d0="\xA0",Wd=function(t){Ds=document,pu=window,Bo=Bo||t||pu.gsap||console.warn("Please gsap.registerPlugin(SplitText)"),Bo&&(Va=Bo.utils.toArray,Gd=Bo.core.context||function(){},Hd=1)},p0=1,Xd=function(t){return pu.getComputedStyle(t)},mu=function(t){return t.position==="absolute"||t.absolute===!0},m0=function(t,e){for(var n=e.length,i;--n>-1;)if(i=e[n],t.substr(0,i.length)===i)return i.length},g0=" style='position:relative;display:inline-block;'",kd=function(t,e){t===void 0&&(t="");var n=~t.indexOf("++"),i=1;return n&&(t=t.split("++").join("")),function(){return"<"+e+g0+(t?" class='"+t+(n?i++:"")+"'>":">")}},qd=function r(t,e,n){var i=t.nodeType;if(i===1||i===9||i===11)for(t=t.firstChild;t;t=t.nextSibling)r(t,e,n);else(i===3||i===4)&&(t.nodeValue=t.nodeValue.split(e).join(n))},du=function(t,e){for(var n=e.length;--n>-1;)t.push(e[n])},Vd=function(t,e,n){for(var i;t&&t!==e;){if(i=t._next||t.nextSibling,i)return i.textContent.charAt(0)===n;t=t.parentNode||t._parent}},_0=function r(t){var e=Va(t.childNodes),n=e.length,i,s;for(i=0;i<n;i++)s=e[i],s._isSplit?r(s):i&&s.previousSibling&&s.previousSibling.nodeType===3?(s.previousSibling.nodeValue+=s.nodeType===3?s.nodeValue:s.firstChild.nodeValue,t.removeChild(s)):s.nodeType!==3&&(t.insertBefore(s.firstChild,s),t.removeChild(s))},_i=function(t,e){return parseFloat(e[t])||0},x0=function(t,e,n,i,s,o,a){var l=Xd(t),c=_i("paddingLeft",l),u=-999,h=_i("borderBottomWidth",l)+_i("borderTopWidth",l),f=_i("borderLeftWidth",l)+_i("borderRightWidth",l),d=_i("paddingTop",l)+_i("paddingBottom",l),_=_i("paddingLeft",l)+_i("paddingRight",l),g=_i("fontSize",l)*(e.lineThreshold||.2),m=l.textAlign,p=[],b=[],y=[],S=e.wordDelimiter||" ",D=e.tag?e.tag:e.span?"span":"div",A=e.type||e.split||"chars,words,lines",w=s&&~A.indexOf("lines")?[]:null,P=~A.indexOf("words"),M=~A.indexOf("chars"),v=mu(e),N=e.linesClass,F=~(N||"").indexOf("++"),R=[],B=l.display==="flex",Y=t.style.display,H,J,O,L,C,ot,vt,Wt,q,tt,pt,st;for(F&&(N=N.split("++").join("")),B&&(t.style.display="block"),J=t.getElementsByTagName("*"),O=J.length,C=[],H=0;H<O;H++)C[H]=J[H];if(w||v)for(H=0;H<O;H++)L=C[H],ot=L.parentNode===t,(ot||v||M&&!P)&&(st=L.offsetTop,w&&ot&&Math.abs(st-u)>g&&(L.nodeName!=="BR"||H===0)&&(vt=[],w.push(vt),u=st),v&&(L._x=L.offsetLeft,L._y=st,L._w=L.offsetWidth,L._h=L.offsetHeight),w&&((L._isSplit&&ot||!M&&ot||P&&ot||!P&&L.parentNode.parentNode===t&&!L.parentNode._isSplit)&&(vt.push(L),L._x-=c,Vd(L,t,S)&&(L._wordEnd=!0)),L.nodeName==="BR"&&(L.nextSibling&&L.nextSibling.nodeName==="BR"||H===0)&&w.push([])));for(H=0;H<O;H++){if(L=C[H],ot=L.parentNode===t,L.nodeName==="BR"){w||v?(L.parentNode&&L.parentNode.removeChild(L),C.splice(H--,1),O--):P||t.appendChild(L);continue}if(v&&(q=L.style,!P&&!ot&&(L._x+=L.parentNode._x,L._y+=L.parentNode._y),q.left=L._x+"px",q.top=L._y+"px",q.position="absolute",q.display="block",q.width=L._w+1+"px",q.height=L._h+"px"),!P&&M)if(L._isSplit)for(L._next=J=L.nextSibling,L.parentNode.appendChild(L);J&&J.nodeType===3&&J.textContent===" ";)L._next=J.nextSibling,L.parentNode.appendChild(J),J=J.nextSibling;else L.parentNode._isSplit?(L._parent=L.parentNode,!L.previousSibling&&L.firstChild&&(L.firstChild._isFirst=!0),L.nextSibling&&L.nextSibling.textContent===" "&&!L.nextSibling.nextSibling&&R.push(L.nextSibling),L._next=L.nextSibling&&L.nextSibling._isFirst?null:L.nextSibling,L.parentNode.removeChild(L),C.splice(H--,1),O--):ot||(st=!L.nextSibling&&Vd(L.parentNode,t,S),L.parentNode._parent&&L.parentNode._parent.appendChild(L),st&&L.parentNode.appendChild(Ds.createTextNode(" ")),D==="span"&&(L.style.display="inline"),p.push(L));else L.parentNode._isSplit&&!L._isSplit&&L.innerHTML!==""?b.push(L):M&&!L._isSplit&&(D==="span"&&(L.style.display="inline"),p.push(L))}for(H=R.length;--H>-1;)R[H].parentNode.removeChild(R[H]);if(w){for(v&&(tt=Ds.createElement(D),t.appendChild(tt),pt=tt.offsetWidth+"px",st=tt.offsetParent===t?0:t.offsetLeft,t.removeChild(tt)),q=t.style.cssText,t.style.cssText="display:none;";t.firstChild;)t.removeChild(t.firstChild);for(Wt=S===" "&&(!v||!P&&!M),H=0;H<w.length;H++){for(vt=w[H],tt=Ds.createElement(D),tt.style.cssText="display:block;text-align:"+m+";position:"+(v?"absolute;":"relative;"),N&&(tt.className=N+(F?H+1:"")),y.push(tt),O=vt.length,J=0;J<O;J++)vt[J].nodeName!=="BR"&&(L=vt[J],tt.appendChild(L),Wt&&L._wordEnd&&tt.appendChild(Ds.createTextNode(" ")),v&&(J===0&&(tt.style.top=L._y+"px",tt.style.left=c+st+"px"),L.style.top="0px",st&&(L.style.left=L._x-st+"px")));O===0?tt.innerHTML=" ":!P&&!M&&(_0(tt),qd(tt,"\xA0"," ")),v&&(tt.style.width=pt,tt.style.height=L._h+"px"),t.appendChild(tt)}t.style.cssText=q}v&&(a>t.clientHeight&&(t.style.height=a-d+"px",t.clientHeight<a&&(t.style.height=a+h+"px")),o>t.clientWidth&&(t.style.width=o-_+"px",t.clientWidth<o&&(t.style.width=o+f+"px"))),B&&(Y?t.style.display=Y:t.style.removeProperty("display")),du(n,p),P&&du(i,b),du(s,y)},v0=function(t,e,n,i){var s=e.tag?e.tag:e.span?"span":"div",o=e.type||e.split||"chars,words,lines",a=~o.indexOf("chars"),l=mu(e),c=e.wordDelimiter||" ",u=function(v){return v===c||v===d0&&c===" "},h=c!==" "?"":l?"­ ":" ",f="</"+s+">",d=1,_=e.specialChars?typeof e.specialChars=="function"?e.specialChars:m0:null,g,m,p,b,y,S,D,A,w=Ds.createElement("div"),P=t.parentNode;for(P.insertBefore(w,t),w.textContent=t.nodeValue,P.removeChild(t),t=w,g=As(t),D=g.indexOf("<")!==-1,e.reduceWhiteSpace!==!1&&(g=g.replace(f0," ").replace(h0,"")),D&&(g=g.split("<").join("{{LT}}")),y=g.length,m=(g.charAt(0)===" "?h:"")+n(),p=0;p<y;p++)if(S=g.charAt(p),_&&(A=_(g.substr(p),e.specialChars)))S=g.substr(p,A||1),m+=a&&S!==" "?i()+S+"</"+s+">":S,p+=A-1;else if(u(S)&&!u(g.charAt(p-1))&&p){for(m+=d?f:"",d=0;u(g.charAt(p+1));)m+=h,p++;p===y-1?m+=h:g.charAt(p+1)!==")"&&(m+=h+n(),d=1)}else S==="{"&&g.substr(p,6)==="{{LT}}"?(m+=a?i()+"{{LT}}</"+s+">":"{{LT}}",p+=5):S.charCodeAt(0)>=55296&&S.charCodeAt(0)<=56319||g.charCodeAt(p+1)>=65024&&g.charCodeAt(p+1)<=65039?(b=((g.substr(p,12).split(fu)||[])[1]||"").length||2,m+=a&&S!==" "?i()+g.substr(p,b)+"</"+s+">":g.substr(p,b),p+=b-1):m+=a&&S!==" "?i()+S+"</"+s+">":S;t.outerHTML=m+(d?f:""),D&&qd(P,"{{LT}}","<")},y0=function r(t,e,n,i){var s=Va(t.childNodes),o=s.length,a=mu(e),l,c;if(t.nodeType!==3||o>1){for(e.absolute=!1,l=0;l<o;l++)c=s[l],c._next=c._isFirst=c._parent=c._wordEnd=null,(c.nodeType!==3||/\S+/.test(c.nodeValue))&&(a&&c.nodeType!==3&&Xd(c).display==="inline"&&(c.style.display="inline-block",c.style.position="relative"),c._isSplit=!0,r(c,e,n,i));e.absolute=a,t._isSplit=!0;return}v0(t,e,n,i)},xi=function(){function r(e,n){Hd||Wd(),this.elements=Va(e),this.chars=[],this.words=[],this.lines=[],this._originals=[],this.vars=n||{},Gd(this),p0&&this.split(n)}var t=r.prototype;return t.split=function(n){this.isSplit&&this.revert(),this.vars=n=n||this.vars,this._originals.length=this.chars.length=this.words.length=this.lines.length=0;for(var i=this.elements.length,s=n.tag?n.tag:n.span?"span":"div",o=kd(n.wordsClass,s),a=kd(n.charsClass,s),l,c,u;--i>-1;)u=this.elements[i],this._originals[i]={html:u.innerHTML,style:u.getAttribute("style")},l=u.clientHeight,c=u.clientWidth,y0(u,n,o,a),x0(u,n,this.chars,this.words,this.lines,c,l);return this.chars.reverse(),this.words.reverse(),this.lines.reverse(),this.isSplit=!0,this},t.revert=function(){var n=this._originals;if(!n)throw"revert() call wasn't scoped properly.";return this.elements.forEach(function(i,s){i.innerHTML=n[s].html,i.setAttribute("style",n[s].style)}),this.chars=[],this.words=[],this.lines=[],this.isSplit=!1,this},r.create=function(n,i){return new r(n,i)},r}();xi.version="3.12.5";xi.register=Wd;var Yd=()=>{at.registerPlugin(Pt,xi),document.querySelectorAll("[data-header-animation]").forEach(t=>{let e=t.querySelector("h2");if(e.classList.contains("is-all-strong")&&(e=e.querySelector("strong")),!e)return;let n=new xi(e,{type:"lines",tag:"span"}),i=new xi(e,{type:"lines",linesClass:"header_line"});n.lines=i.chars.concat(n.lines);let s=at.timeline({scrollTrigger:{trigger:t,start:"top bottom",toggleActions:"play none none reset"}});s.fromTo(n.lines,{y:100},{y:0,duration:.75,stagger:.05,ease:"circ.out"},"+=0.25");let o=t.querySelector(".hero_holo");o&&s.fromTo(o,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"+-=0.25");let a=t.querySelector(".button");a&&s.fromTo(a,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"-=0.75")})};var Zd=()=>{if(at.registerPlugin(Pt,xi),document.querySelector(".hero_grid")){let r=document.querySelector(".hero_grid"),t=r.querySelector(".hero_holo"),e=r.querySelector("h1"),n=r.querySelector(".paragraph-big"),i=new xi(e,{type:"lines",tag:"span"}),s=new xi(e,{type:"lines",linesClass:"header_line"});i.lines=s.chars.concat(i.lines),at.timeline({scrollTrigger:{trigger:r,start:"top bottom",toggleActions:"play none none reset"}}).fromTo(n,{autoAlpha:0},{autoAlpha:1,duration:.35,ease:"circ.out"},"+=1.75").fromTo(i.lines,{y:"100%"},{y:0,duration:.75,stagger:.05,ease:"circ.out"},"-=0.25").fromTo(t,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"+-=0.25")}};var Jd=()=>{let r=document.querySelector(".is-section-loader");if(!r)return;let t=r.querySelector(".loader_line"),e=r.querySelector(".loader_value");!t||!e||at.to(t,{width:"100%",duration:1.5,onUpdate:function(){let n=Math.round(this.progress()*100);e.innerHTML=`${n}%`},onComplete:function(){at.to(r,{y:"-100dvh",duration:.75})}},"<")};var $d=()=>{at.registerPlugin(Pt),at.matchMedia().add("(min-width: 992px)",()=>{at.set(".accomplish-box-wrap",{opacity:.1}),at.timeline({scrollTrigger:{trigger:".is-accomplish-section",start:"top top",end:"+=5000",scrub:!0,pin:!0}}).to(".accomplish-second-row",{x:()=>{let r=document.querySelector(".accomplish-second-row"),t=document.querySelector(".is-accomplish-section");return-(r.scrollWidth-t.offsetWidth)},duration:1,ease:"none"}).to(".accomplish-box-wrap",{opacity:1,stagger:.1},"<")}),at.matchMedia().add("(max-width: 991px)",()=>{document.querySelectorAll(".accomplish-box-wrap").forEach(t=>{at.set(t,{opacity:0,y:50}),at.to(t,{scrollTrigger:{trigger:t,start:"top bottom-=100",end:"bottom center",toggleActions:"play none none reverse"},opacity:1,y:0,duration:.8,ease:"power2.out"})})})};var Kd=()=>{at.registerPlugin(Pt);let r=document.querySelector(".reviews-second-row"),t=r.scrollWidth-r.offsetWidth,e=at.to(r,{x:-t,duration:30,ease:"none",repeat:-1,yoyo:!0,repeatDelay:0});r.addEventListener("mouseenter",()=>{e.pause()}),r.addEventListener("mouseleave",()=>{e.play()});let n=document.querySelector(".brand_container"),i=at.utils.toArray(".brand-img-wrapper");i.forEach(h=>{let f=h.cloneNode(!0);n.appendChild(f)});let s=()=>i.reduce((h,f)=>{let d=f.offsetWidth,_=parseFloat(getComputedStyle(f).marginRight);return h+d+_},0),o=()=>{let h=s();return at.set(n,{x:0}),at.to(n,{x:-h,duration:30,ease:"none",repeat:-1})},a=o();window.addEventListener("resize",()=>{a&&a.kill(),at.delayedCall(.2,()=>{a=o()})});let l=document.querySelectorAll(".faq-question-item");function c(){l.forEach(h=>{let f=h.querySelector(".is-answer"),d=h.querySelector(".plus_wrap");at.to(f,{height:0,duration:.3,ease:"power2.out",overflow:"hidden"}),d.style.backgroundColor="#737678"})}function u(h){let f=h.querySelector(".is-answer"),d=h.querySelector(".plus_wrap");at.to(f,{height:"auto",duration:.3,ease:"power2.out",overflow:"visible"}),d.style.backgroundColor="#FF8A00"}l.forEach((h,f)=>{h.addEventListener("click",()=>{c(),u(h)}),f===0&&u(h)})};at.registerPlugin(Pt);var jd=()=>{at.matchMedia().add("(min-width: 992px)",()=>{at.set(".problem-box_wrap",{yPercent:100,opacity:0}),at.timeline({scrollTrigger:{trigger:".section.background-color-primary.is-fading-section",start:"top top",end:"+=200%",pin:!0,scrub:1,anticipatePin:1}}).to("#first-choosing-box",{yPercent:0,opacity:1,duration:1,ease:"power2.out"}).to("#second-choosing-box",{yPercent:0,opacity:1,duration:1,ease:"power2.out"},"-=0.5").to("#third-choosing-box",{yPercent:0,opacity:1,duration:1,ease:"power2.out"},"-=0.5")}),at.matchMedia().add("(max-width: 991px)",()=>{let r=Array.from(document.querySelectorAll(".problem-box_wrap"));at.matchMedia().add("(orientation: portrait)",()=>{r.forEach((t,e)=>{let n=e===r.length-1;at.to(t,{ease:"circ.out",startAt:{filter:"brightness(100%) blur(0px)",opacity:1,scale:1},filter:n?"none":"brightness(50%) blur(10px)",opacity:n?1:0,scale:n?1:.75,scrollTrigger:{trigger:t,startTrigger:t,start:"top top",endTrigger:n?t:r[e+1],end:n?"bottom bottom":"top top-=100%",pin:!0,pinSpacing:!1,id:"pin",scrub:1,invalidateOnRefresh:!0,smoothScroll:!0}})})}),r=Array.from(document.querySelectorAll(".problem-box_wrap")),at.matchMedia().add("(orientation: landscape)",()=>{r.forEach((t,e)=>{let n=e===r.length-1;at.to(t,{ease:"circ.out",startAt:{filter:"brightness(100%) blur(0px)",opacity:1,scale:1},filter:n?"none":"brightness(50%) blur(10px)",opacity:n?1:0,scale:n?1:.75,scrollTrigger:{trigger:t,startTrigger:t,start:"bottom bottom",endTrigger:n?t:r[e+1],end:n?"bottom bottom":"top top-=100%",pin:!0,pinSpacing:!1,id:"pin",scrub:1,invalidateOnRefresh:!0,smoothScroll:!0}})})})})};var Qd=()=>{at.registerPlugin(Pt),document.querySelector(".continue-txt").addEventListener("click",function(r){r.preventDefault(),document.querySelector(".compare-txt.gradient-hide").classList.add("expanded"),this.classList.add("hide")}),at.matchMedia().add("(min-width: 992px)",()=>{document.querySelector("#compare-section")&&document.querySelectorAll(".compare-box-wrap").forEach(t=>{let e=at.timeline({scrollTrigger:{trigger:t,start:"10% 60%",toggleActions:"play none none reverse",invalidateOnRefresh:!0,smoothScroll:!0}}),n=t.querySelector(".compare-number"),i=t.querySelector(".compare-content-heading"),s=t.querySelector(".compare-img-wrap"),o=t.querySelector(".txt-button-wrapper");n&&e.fromTo(n,{autoAlpha:0},{autoAlpha:1,duration:1,ease:"power2.out"},0),i&&e.fromTo(i,{autoAlpha:0},{autoAlpha:1,duration:1,ease:"power2.out"},0),o&&e.fromTo(o,{autoAlpha:0,y:30},{autoAlpha:1,y:0,duration:.75,ease:"power2.out"},.3),s&&e.fromTo(s,{clipPath:"inset(0 100% 0 0)"},{clipPath:"inset(0 0% 0 0)",duration:1.5,ease:"power2.out"},0)})}),at.matchMedia().add("(max-width: 991px)",()=>{document.querySelector("#compare-section")&&document.querySelectorAll(".compare-box-wrap").forEach(t=>{let e=at.timeline({scrollTrigger:{trigger:t,start:"top 65%",toggleActions:"play none none reverse",invalidateOnRefresh:!0}}),n=t.querySelectorAll(".compare-content-box, .txt-number-wrapper");n.length&&e.fromTo(n,{autoAlpha:0},{autoAlpha:1,duration:.8,ease:"power2.out",stagger:.2},0);let i=t.querySelector(".compare-img-wrap");i&&e.fromTo(i,{autoAlpha:0,y:50},{autoAlpha:1,y:0,duration:2,ease:"power2.out"},.3)})})};var tp=()=>{at.registerPlugin(Pt),document.querySelectorAll(".link-contact").forEach(t=>{let e=[t.querySelector(".msg-box.is-first"),t.querySelector(".msg-box.is-second"),t.querySelector(".msg-box.is-third")],n=t.querySelector(".msg-boxes"),i=!1;at.set(e,{opacity:0,y:20,display:"none"});function s(){let d=t.getBoundingClientRect(),_=window.innerHeight,g=d.top,m=_-d.bottom;return g>m}function o(){let d=s(),_=window.innerWidth<768,g=t.querySelector(".text-is-contact .or-txt")!==null,m=t.classList.contains("is-centered-mobile"),p;return _?m?p=d?"auto auto 2em -50%":"2em auto auto -50%":g?p=d?"auto auto 2em 1.5em":"2em auto auto 1.5em":p=d?"auto auto 2em 0%":"2em auto auto 0%":g?p=d?"auto auto 3em 1.5em":"3em auto auto 1.5em":p=d?"auto auto 3em 0%":"3em auto auto 0%",at.set(n,{inset:p}),d}function a(d){return new Promise(_=>{at.to(d,{display:"flex",opacity:1,y:0,duration:.05,ease:"power1.in",onComplete:_})})}function l(d){return new Promise(_=>{at.to(d,{opacity:0,y:20,duration:.1,ease:"power1.in",onComplete:()=>{at.set(d,{display:"none"}),_()}})})}function c(){return new Promise(d=>{at.to(n,{y:-4,duration:.1,ease:"power1.out",yoyo:!0,repeat:1,onComplete:d})})}function u(){document.querySelectorAll(".popup-msg-wrapper").forEach(_=>{at.to(_,{opacity:0,duration:.2,ease:"power1.out",onComplete:()=>{at.set(_,{display:"none"})}})})}async function h(){let _=o()?e:[...e].reverse();await a(_[0]),u();for(let g=1;g<_.length;g++)await a(_[g]);await c(),i=!0}async function f(){let _=s()?[...e].reverse():e;for(let g of _)await l(g);i=!1}t.addEventListener("click",d=>{d.stopPropagation(),i?f():h()}),document.addEventListener("click",d=>{i&&!t.contains(d.target)&&!n.contains(d.target)&&f()}),window.addEventListener("resize",()=>{i&&o()})})};var ep=()=>{at.registerPlugin(Pt);let r=document.querySelectorAll(".download-pitch");window.addEventListener("resize",()=>{r.forEach(t=>{let e=t.nextElementSibling;if(!(!e||!e.classList.contains("popup-msg-wrapper"))&&e.style.display==="block"){let n=document.querySelector(".is-first-contact");n&&window.innerWidth>=992?at.set(n,{visibility:"hidden"}):n&&at.set(n,{visibility:"visible"})}})}),r.forEach(t=>{let e=t.nextElementSibling;if(!e||!e.classList.contains("popup-msg-wrapper"))return;let n=e.querySelector(".corner-bottom"),i=e.querySelector(".corner-top"),s=e.querySelector(".corner-center-bottom"),o=e.querySelector(".corner-center-top"),a=e.querySelector(".popup-msg-hide"),l=document.querySelector(".is-first-contact"),c=!1;at.set(e,{opacity:0,display:"none"});function u(){[n,i,s,o].forEach(p=>{p&&(p.classList.add("hide"),at.set(p,{opacity:0}))})}function h(p){p&&(p.classList.remove("hide"),at.to(p,{opacity:1,duration:.2,ease:"power1.in"}))}function f(){let p=t.getBoundingClientRect(),b=window.innerHeight,y=p.top,S=b-p.bottom;return y>S}function d(){let p=f(),b=t.classList.contains("is-center"),y=window.innerWidth<992;return u(),!y&&!b?p?(at.set(e,{inset:"auto auto 1.5em 16.5em"}),h(n)):(at.set(e,{inset:"1em auto auto 16.5em"}),h(i)):!y&&b?p?(at.set(e,{inset:"auto -85% 4.5em auto"}),h(s)):(at.set(e,{inset:"4.5em -85% auto auto"}),h(o)):y&&!b?p?(at.set(e,{inset:"auto auto 4.5em 0%"}),h(s)):(at.set(e,{inset:"5em auto auto 0%"}),h(o)):y&&b&&(p?(at.set(e,{inset:"auto auto 4.5em auto"}),h(s)):(at.set(e,{inset:"5em auto auto auto"}),h(o))),p}function _(){document.querySelectorAll(".msg-boxes").forEach(b=>{b.querySelectorAll(".msg-box").forEach(S=>{at.to(S,{opacity:0,y:20,duration:.1,ease:"power1.in",onComplete:()=>{at.set(S,{display:"none"})}})})})}function g(){d(),document.querySelectorAll(".pin-spacer").forEach(b=>{b.style.zIndex="1"}),at.to(e,{display:"block",opacity:1,duration:.2,ease:"power1.in",onStart:()=>{_()}}),l&&window.innerWidth>=992&&at.to(l,{opacity:0,duration:.2,ease:"power1.in",onComplete:()=>{at.set(l,{visibility:"hidden"})}}),c=!0}function m(){at.to(e,{opacity:0,duration:.2,ease:"power1.out",onComplete:()=>{at.set(e,{display:"none"}),document.querySelectorAll(".pin-spacer").forEach(b=>{b.style.zIndex="2"})}}),l&&window.innerWidth>=992&&(at.set(l,{visibility:"visible"}),at.to(l,{opacity:1,duration:.2,ease:"power1.out"})),c=!1}t.addEventListener("click",p=>{p.stopPropagation(),c?m():g()}),a.addEventListener("click",p=>{p.stopPropagation(),m()}),document.addEventListener("click",p=>{let b=e.contains(p.target),y=t.contains(p.target);c&&!b&&!y&&m()})})};at.registerPlugin(Pt);var np=()=>{let r=at.utils.toArray(".steps_item"),t=at.utils.toArray(".steps_item-line");if(!r)return;let e=at.matchMedia();e.add("(min-width: 992px)",()=>{t.forEach(i=>at.set(i,{opacity:0}));let n=at.timeline({defaults:{duration:4,ease:"none",immediateRender:!0},scrollTrigger:{trigger:"#steps-pin",start:()=>"top top",end:"clamp(bottom+=200% bottom)",pin:!0,scrub:!0,smoothScroll:!0,toggleActions:"play reverse play reverse"}});r.forEach((i,s)=>at.set(i,{x:`${s*-100}%`}));for(let i=1;i<=3;i++)n.to(r[i],{x:`${(i-1)*-100}%`},"<");return n.to(t[0],{opacity:1,duration:.5}),n.to(r[2],{x:0},"<"),n.to(r[3],{x:"-100%"},"<"),n.to(t[1],{opacity:1,duration:.5}),n.to(r[3],{x:0},"<"),n.to(t[2],{opacity:1,duration:.5}),n.set({},{},"+=1"),()=>{r.forEach(i=>at.set(i,{clearProps:"all"})),t.forEach(i=>at.set(i,{clearProps:"all"}))}}),e.add("(max-width: 991px)",()=>(r.forEach(n=>at.set(n,{clearProps:"all"})),t.forEach(n=>at.set(n,{clearProps:"all"})),at.set([r,t],{opacity:0,y:50}),r.forEach((n,i)=>{at.to(n,{scrollTrigger:{trigger:n,start:"top bottom-=100",end:"top center",toggleActions:"play none none reverse"},opacity:1,y:0,duration:.8,ease:"power2.out"}),t[i]&&at.to(t[i],{scrollTrigger:{trigger:n,start:"top bottom-=100",end:"top center",toggleActions:"play none none reverse"},opacity:1,y:0,duration:.8,delay:.2,ease:"power2.out"})}),()=>{Pt.getAll().forEach(n=>n.kill()),r.forEach(n=>at.set(n,{clearProps:"all"})),t.forEach(n=>at.set(n,{clearProps:"all"}))}))};var Ha=function(){function r(e){this.chars=ei(e),this.sets=[],this.length=50;for(var n=0;n<20;n++)this.sets[n]=rp(80,this.chars)}var t=r.prototype;return t.grow=function(n){for(var i=0;i<20;i++)this.sets[i]+=rp(n-this.length,this.chars);this.length=n},r}(),Gr,ap,lp=function(){return Gr||typeof window<"u"&&(Gr=window.gsap)&&Gr.registerPlugin&&Gr},S0=1,ip=/\s+/g,rp=function(t,e){for(var n=e.length,i="";--t>-1;)i+=e[~~(Math.random()*n)];return i},gu="ABCDEFGHIJKLMNOPQRSTUVWXYZ",sp=gu.toLowerCase(),M0={upperCase:new Ha(gu),lowerCase:new Ha(sp),upperAndLowerCase:new Ha(gu+sp)},op=function(){ap=Gr=lp()},zo={version:"3.12.5",name:"scrambleText",register:function(t,e,n){Gr=t,op()},init:function(t,e,n,i,s){if(ap||op(),this.prop="innerHTML"in t?"innerHTML":"textContent"in t?"textContent":0,!!this.prop){this.target=t,typeof e!="object"&&(e={text:e});var o=e.text||e.value||"",a=e.trim!==!1,l=this,c,u,h,f;return l.delimiter=c=e.delimiter||"",l.original=ei(As(t).replace(ip," ").split(" ").join(""),c,a),(o==="{original}"||o===!0||o==null)&&(o=l.original.join(c)),l.text=ei((o||"").replace(ip," "),c,a),l.hasClass=!!(e.newClass||e.oldClass),l.newClass=e.newClass,l.oldClass=e.oldClass,f=c==="",l.textHasEmoji=f&&!!l.text.emoji,l.charsHaveEmoji=!!e.chars&&!!ei(e.chars).emoji,l.length=f?l.original.length:l.original.join(c).length,l.lengthDif=(f?l.text.length:l.text.join(c).length)-l.length,l.fillChar=e.fillChar||e.chars&&~e.chars.indexOf(" ")?" ":"",l.charSet=h=M0[e.chars||"upperCase"]||new Ha(e.chars),l.speed=.05/(e.speed||1),l.prevScrambleTime=0,l.setIndex=Math.random()*20|0,u=l.length+Math.max(l.lengthDif,0),u>h.length&&h.grow(u),l.chars=h.sets[l.setIndex],l.revealDelay=e.revealDelay||0,l.tweenLength=e.tweenLength!==!1,l.tween=n,l.rightToLeft=!!e.rightToLeft,l._props.push("scrambleText","text"),S0}},render:function(t,e){var n=e.target,i=e.prop,s=e.text,o=e.delimiter,a=e.tween,l=e.prevScrambleTime,c=e.revealDelay,u=e.setIndex,h=e.chars,f=e.charSet,d=e.length,_=e.textHasEmoji,g=e.charsHaveEmoji,m=e.lengthDif,p=e.tweenLength,b=e.oldClass,y=e.newClass,S=e.rightToLeft,D=e.fillChar,A=e.speed,w=e.original,P=e.hasClass,M=s.length,v=a._time,N=v-l,F,R,B,Y,H,J,O,L,C,ot,vt;c&&(a._from&&(v=a._dur-v),t=v===0?0:v<c?1e-6:v===a._dur?1:a._ease((v-c)/(a._dur-c))),t<0?t=0:t>1&&(t=1),S&&(t=1-t),F=~~(t*M+.5),t?((N>A||N<-A)&&(e.setIndex=u=(u+(Math.random()*19|0))%20,e.chars=f.sets[u],e.prevScrambleTime+=N),Y=h):Y=w.join(o),vt=a._from?t:1-t,ot=d+(p?a._from?vt*vt*vt:1-vt*vt*vt:1)*m,S?t===1&&(a._from||a.data==="isFromStart")?(B="",Y=w.join(o)):(O=s.slice(F).join(o),g?B=ei(Y).slice(0,ot-(_?ei(O):O).length+.5|0).join(""):B=Y.substr(0,ot-(_?ei(O):O).length+.5|0),Y=O):(B=s.slice(0,F).join(o),R=(_?ei(B):B).length,g?Y=ei(Y).slice(R,ot+.5|0).join(""):Y=Y.substr(R,ot-R+.5|0)),P?(L=S?b:y,C=S?y:b,H=L&&F!==0,J=C&&F!==M,O=(H?"<span class='"+L+"'>":"")+B+(H?"</span>":"")+(J?"<span class='"+C+"'>":"")+o+Y+(J?"</span>":"")):O=B+o+Y,n[i]=D===" "&&~O.indexOf(" ")?O.split(" ").join(" "):O}};zo.emojiSafeSplit=ei;zo.getText=As;lp()&&Gr.registerPlugin(zo);at.registerPlugin(zo);var cp=()=>{document.querySelectorAll("[data-scramble-link]").forEach(t=>{let e=t.querySelector("[data-scramble-text]");if(!e)return;let n=e.textContent;t.addEventListener("mouseenter",()=>{at.matchMedia().add("(min-width: 768px)",()=>{at.to(e,{duration:1,scrambleText:{text:n,chars:"10"}})})})})};function up(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function b0(r,t,e){return t&&up(r.prototype,t),e&&up(r,e),r}var de,Ga,Ke,Xr,Cs,ni,w0,Wr,hp,$t,vi,Wa,fp,dp,pp,mp,gp=function(){return typeof window<"u"},_p=function(){return de||gp()&&(de=window.gsap)&&de.registerPlugin&&de};var E0=function(t){return Math.round(t*1e5)/1e5||0},ir=function(t){return $t.maxScroll(t||Ke)},T0=function(t,e){var n=t.parentNode||Cs,i=t.getBoundingClientRect(),s=n.getBoundingClientRect(),o=s.top-i.top,a=s.bottom-i.bottom,l=(Math.abs(o)>Math.abs(a)?o:a)/(1-e),c=-l*e,u,h;return l>0&&(u=s.height/(Ke.innerHeight+s.height),h=u===.5?s.height*2:Math.min(s.height,Math.abs(-l*u/(2*u-1)))*2*(e||1),c+=e?-h*e:-h/2,l+=h),{change:l,offset:c}},A0=function(t){var e=Xr.querySelector(".ScrollSmoother-wrapper");return e||(e=Xr.createElement("div"),e.classList.add("ScrollSmoother-wrapper"),t.parentNode.insertBefore(e,t),e.appendChild(t)),e},Li=function(){function r(t){var e=this;Ga||r.register(de)||console.warn("Please gsap.registerPlugin(ScrollSmoother)"),t=this.vars=t||{},vi&&vi.kill(),vi=this,pp(this);var n=t,i=n.smoothTouch,s=n.onUpdate,o=n.onStop,a=n.smooth,l=n.onFocusIn,c=n.normalizeScroll,u=n.wholePixels,h,f,d,_,g,m,p,b,y,S,D,A,w,P,M=this,v=t.effectsPrefix||"",N=$t.getScrollFunc(Ke),F=$t.isTouch===1?i===!0?.8:parseFloat(i)||0:a===0||a===!1?0:parseFloat(a)||.8,R=F&&+t.speed||1,B=0,Y=0,H=1,J=fp(0),O=function(){return J.update(-B)},L={y:0},C=function(){return h.style.overflow="visible"},ot,vt=function(x){x.update();var I=x.getTween();I&&(I.pause(),I._time=I._dur,I._tTime=I._tDur),ot=!1,x.animation.progress(x.progress,!0)},Wt=function(x,I){(x!==B&&!S||I)&&(u&&(x=Math.round(x)),F&&(h.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+x+", 0, 1)",h._gsap.y=x+"px"),Y=x-B,B=x,$t.isUpdating||r.isRefreshing||$t.update())},q=function(x){return arguments.length?(x<0&&(x=0),L.y=-x,ot=!0,S?B=-x:Wt(-x),$t.isRefreshing?_.update():N(x/R),this):-B},tt=typeof ResizeObserver<"u"&&t.autoResize!==!1&&new ResizeObserver(function(){if(!$t.isRefreshing){var T=ir(f)*R;T<-B&&q(T),mp.restart(!0)}}),pt,st=function(x){f.scrollTop=0,!(x.target.contains&&x.target.contains(f)||l&&l(e,x)===!1)&&($t.isInViewport(x.target)||x.target===pt||e.scrollTo(x.target,!1,"center center"),pt=x.target)},Ft=function(x,I){if(x<I.start)return x;var G=isNaN(I.ratio)?1:I.ratio,K=I.end-I.start,Q=x-I.start,ht=I.offset||0,ct=I.pins||[],nt=ct.offset||0,bt=I._startClamp&&I.start<=0||I.pins&&I.pins.offset?0:I._endClamp&&I.end===ir()?1:.5;return ct.forEach(function(rt){K-=rt.distance,rt.nativeStart<=x&&(Q-=rt.distance)}),nt&&(Q*=(K-nt/G)/K),x+(Q-ht*bt)/G-Q},Nt=function T(x,I,G){G||(x.pins.length=x.pins.offset=0);var K=x.pins,Q=x.markers,ht,ct,nt,bt,rt,ft,Ot,it;for(Ot=0;Ot<I.length;Ot++)if(it=I[Ot],x.trigger&&it.trigger&&x!==it&&(it.trigger===x.trigger||it.pinnedContainer===x.trigger||x.trigger.contains(it.trigger))&&(rt=it._startNative||it._startClamp||it.start,ft=it._endNative||it._endClamp||it.end,nt=Ft(rt,x),bt=it.pin&&ft>0?nt+(ft-rt):Ft(ft,x),it.setPositions(nt,bt,!0,(it._startClamp?Math.max(0,nt):nt)-rt),it.markerStart&&Q.push(de.quickSetter([it.markerStart,it.markerEnd],"y","px")),it.pin&&it.end>0&&!G)){if(ht=it.end-it.start,ct=x._startClamp&&it.start<0,ct){if(x.start>0){x.setPositions(0,x.end+(x._startNative-x.start),!0),T(x,I);return}ht+=it.start,K.offset=-it.start}K.push({start:it.start,nativeStart:rt,end:it.end,distance:ht,trig:it}),x.setPositions(x.start,x.end+(ct?-it.start:ht),!0)}},V=function(x,I){g.forEach(function(G){return Nt(G,x,I)})},Yt=function(){C(),requestAnimationFrame(C),g&&($t.getAll().forEach(function(x){x._startNative=x.start,x._endNative=x.end}),g.forEach(function(x){var I=x._startClamp||x.start,G=x.autoSpeed?Math.min(ir(),x.end):I+Math.abs((x.end-I)/x.ratio),K=G-x.end;if(I-=K/2,G-=K/2,I>G){var Q=I;I=G,G=Q}x._startClamp&&I<0?(G=x.ratio<0?ir():x.end/x.ratio,K=G-x.end,I=0):(x.ratio<0||x._endClamp&&G>=ir())&&(G=ir(),I=x.ratio<0||x.ratio>1?0:G-(G-x.start)/x.ratio,K=(G-I)*x.ratio-(x.end-x.start)),x.offset=K||1e-4,x.pins.length=x.pins.offset=0,x.setPositions(I,G,!0)}),V($t.sort())),J.reset()},Et=function(){return $t.addEventListener("refresh",Yt)},Tt=function(){return g&&g.forEach(function(x){return x.vars.onRefresh(x)})},St=function(){return g&&g.forEach(function(x){return x.vars.onRefreshInit(x)}),Tt},zt=function(x,I,G,K){return function(){var Q=typeof I=="function"?I(G,K):I;Q||Q===0||(Q=K.getAttribute("data-"+v+x)||(x==="speed"?1:0)),K.setAttribute("data-"+v+x,Q);var ht=(Q+"").substr(0,6)==="clamp(";return{clamp:ht,value:ht?Q.substr(6,Q.length-7):Q}}},Ut=function(x,I,G,K,Q){Q=(typeof Q=="function"?Q(K,x):Q)||0;var ht=zt("speed",I,K,x),ct=zt("lag",G,K,x),nt=de.getProperty(x,"y"),bt=x._gsap,rt,ft,Ot,it,yt,Bt,Vt=[],he=function(){I=ht(),G=parseFloat(ct().value),rt=parseFloat(I.value)||1,Ot=I.value==="auto",yt=Ot||ft&&ft._startClamp&&ft.start<=0||Vt.offset?0:ft&&ft._endClamp&&ft.end===ir()?1:.5,it&&it.kill(),it=G&&de.to(x,{ease:Wa,overwrite:!1,y:"+=0",duration:G}),ft&&(ft.ratio=rt,ft.autoSpeed=Ot)},kt=function(){bt.y=nt+"px",bt.renderTransform(1),he()},U=[],$=0,et=function(lt){if(Ot){kt();var Dt=T0(x,hp(0,1,-lt.start/(lt.end-lt.start)));$=Dt.change,Bt=Dt.offset}else Bt=Vt.offset||0,$=(lt.end-lt.start-Bt)*(1-rt);Vt.forEach(function(te){return $-=te.distance*(1-rt)}),lt.offset=$||.001,lt.vars.onUpdate(lt),it&&it.progress(1)};return he(),(rt!==1||Ot||it)&&(ft=$t.create({trigger:Ot?x.parentNode:x,start:function(){return I.clamp?"clamp(top bottom+="+Q+")":"top bottom+="+Q},end:function(){return I.value<0?"max":I.clamp?"clamp(bottom top-="+Q+")":"bottom top-="+Q},scroller:f,scrub:!0,refreshPriority:-999,onRefreshInit:kt,onRefresh:et,onKill:function(lt){var Dt=g.indexOf(lt);Dt>=0&&g.splice(Dt,1),kt()},onUpdate:function(lt){var Dt=nt+$*(lt.progress-yt),te=Vt.length,ae=0,re,Zt,Ct;if(lt.offset){if(te){for(Zt=-B,Ct=lt.end;te--;){if(re=Vt[te],re.trig.isActive||Zt>=re.start&&Zt<=re.end){it&&(re.trig.progress+=re.trig.direction<0?.001:-.001,re.trig.update(0,0,1),it.resetTo("y",parseFloat(bt.y),-Y,!0),H&&it.progress(1));return}Zt>re.end&&(ae+=re.distance),Ct-=re.distance}Dt=nt+ae+$*((de.utils.clamp(lt.start,lt.end,Zt)-lt.start-ae)/(Ct-lt.start)-yt)}U.length&&!Ot&&U.forEach(function(Mt){return Mt(Dt-ae)}),Dt=E0(Dt+Bt),it?(it.resetTo("y",Dt,-Y,!0),H&&it.progress(1)):(bt.y=Dt+"px",bt.renderTransform(1))}}}),et(ft),de.core.getCache(ft.trigger).stRevert=St,ft.startY=nt,ft.pins=Vt,ft.markers=U,ft.ratio=rt,ft.autoSpeed=Ot,x.style.willChange="transform"),ft};Et(),$t.addEventListener("killAll",Et),de.delayedCall(.5,function(){return H=0}),this.scrollTop=q,this.scrollTo=function(T,x,I){var G=de.utils.clamp(0,ir(),isNaN(T)?e.offset(T,I,!!x&&!S):+T);x?S?de.to(e,{duration:F,scrollTop:G,overwrite:"auto",ease:Wa}):N(G):q(G)},this.offset=function(T,x,I){T=Wr(T)[0];var G=T.style.cssText,K=$t.create({trigger:T,start:x||"top top"}),Q;return g&&(H?$t.refresh():V([K],!0)),Q=K.start/(I?R:1),K.kill(!1),T.style.cssText=G,de.core.getCache(T).uncache=1,Q};function k(){return d=h.clientHeight,h.style.overflow="visible",ni.style.height=Ke.innerHeight+(d-Ke.innerHeight)/R+"px",d-Ke.innerHeight}this.content=function(T){if(arguments.length){var x=Wr(T||"#smooth-content")[0]||console.warn("ScrollSmoother needs a valid content element.")||ni.children[0];return x!==h&&(h=x,y=h.getAttribute("style")||"",tt&&tt.observe(h),de.set(h,{overflow:"visible",width:"100%",boxSizing:"border-box",y:"+=0"}),F||de.set(h,{clearProps:"transform"})),this}return h},this.wrapper=function(T){return arguments.length?(f=Wr(T||"#smooth-wrapper")[0]||A0(h),b=f.getAttribute("style")||"",k(),de.set(f,F?{overflow:"hidden",position:"fixed",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0}:{overflow:"visible",position:"relative",width:"100%",height:"auto",top:"auto",bottom:"auto",left:"auto",right:"auto"}),this):f},this.effects=function(T,x){var I;if(g||(g=[]),!T)return g.slice(0);T=Wr(T),T.forEach(function(rt){for(var ft=g.length;ft--;)g[ft].trigger===rt&&g[ft].kill()}),x=x||{};var G=x,K=G.speed,Q=G.lag,ht=G.effectsPadding,ct=[],nt,bt;for(nt=0;nt<T.length;nt++)bt=Ut(T[nt],K,Q,nt,ht),bt&&ct.push(bt);return(I=g).push.apply(I,ct),x.refresh!==!1&&$t.refresh(),ct},this.sections=function(T,x){var I;if(m||(m=[]),!T)return m.slice(0);var G=Wr(T).map(function(K){return $t.create({trigger:K,start:"top 120%",end:"bottom -20%",onToggle:function(ht){K.style.opacity=ht.isActive?"1":"0",K.style.pointerEvents=ht.isActive?"all":"none"}})});return x&&x.add?(I=m).push.apply(I,G):m=G.slice(0),G},this.content(t.content),this.wrapper(t.wrapper),this.render=function(T){return Wt(T||T===0?T:B)},this.getVelocity=function(){return J.getVelocity(-B)},$t.scrollerProxy(f,{scrollTop:q,scrollHeight:function(){return k()&&ni.scrollHeight},fixedMarkers:t.fixedMarkers!==!1&&!!F,content:h,getBoundingClientRect:function(){return{top:0,left:0,width:Ke.innerWidth,height:Ke.innerHeight}}}),$t.defaults({scroller:f});var Qt=$t.getAll().filter(function(T){return T.scroller===Ke||T.scroller===f});Qt.forEach(function(T){return T.revert(!0,!0)}),_=$t.create({animation:de.fromTo(L,{y:function(){return P=0,0}},{y:function(){return P=1,-k()},immediateRender:!1,ease:"none",data:"ScrollSmoother",duration:100,onUpdate:function(){if(P){var x=ot;x&&(vt(_),L.y=B),Wt(L.y,x),O(),s&&!S&&s(M)}}}),onRefreshInit:function(x){if(!r.isRefreshing){if(r.isRefreshing=!0,g){var I=$t.getAll().filter(function(K){return!!K.pin});g.forEach(function(K){K.vars.pinnedContainer||I.forEach(function(Q){if(Q.pin.contains(K.trigger)){var ht=K.vars;ht.pinnedContainer=Q.pin,K.vars=null,K.init(ht,K.animation)}})})}var G=x.getTween();w=G&&G._end>G._dp._time,A=B,L.y=0,F&&($t.isTouch===1&&(f.style.position="absolute"),f.scrollTop=0,$t.isTouch===1&&(f.style.position="fixed"))}},onRefresh:function(x){x.animation.invalidate(),x.setPositions(x.start,k()/R),w||vt(x),L.y=-N()*R,Wt(L.y),H||(w&&(ot=!1),x.animation.progress(de.utils.clamp(0,1,A/R/-x.end))),w&&(x.progress-=.001,x.update()),r.isRefreshing=!1},id:"ScrollSmoother",scroller:Ke,invalidateOnRefresh:!0,start:0,refreshPriority:-9999,end:function(){return k()/R},onScrubComplete:function(){J.reset(),o&&o(e)},scrub:F||!0}),this.smooth=function(T){return arguments.length&&(F=T||0,R=F&&+t.speed||1,_.scrubDuration(T)),_.getTween()?_.getTween().duration():0},_.getTween()&&(_.getTween().vars.ease=t.ease||Wa),this.scrollTrigger=_,t.effects&&this.effects(t.effects===!0?"[data-"+v+"speed], [data-"+v+"lag]":t.effects,{effectsPadding:t.effectsPadding,refresh:!1}),t.sections&&this.sections(t.sections===!0?"[data-section]":t.sections),Qt.forEach(function(T){T.vars.scroller=f,T.revert(!1,!0),T.init(T.vars,T.animation)}),this.paused=function(T,x){return arguments.length?(!!S!==T&&(T?(_.getTween()&&_.getTween().pause(),N(-B/R),J.reset(),D=$t.normalizeScroll(),D&&D.disable(),S=$t.observe({preventDefault:!0,type:"wheel,touch,scroll",debounce:!1,allowClicks:!0,onChangeY:function(){return q(-B)}}),S.nested=dp(Cs,"wheel,touch,scroll",!0,x!==!1)):(S.nested.kill(),S.kill(),S=0,D&&D.enable(),_.progress=(-B/R-_.start)/(_.end-_.start),vt(_))),this):!!S},this.kill=this.revert=function(){e.paused(!1),vt(_),_.kill();for(var T=(g||[]).concat(m||[]),x=T.length;x--;)T[x].kill();$t.scrollerProxy(f),$t.removeEventListener("killAll",Et),$t.removeEventListener("refresh",Yt),f.style.cssText=b,h.style.cssText=y;var I=$t.defaults({});I&&I.scroller===f&&$t.defaults({scroller:Ke}),e.normalizer&&$t.normalizeScroll(!1),clearInterval(p),vi=null,tt&&tt.disconnect(),ni.style.removeProperty("height"),Ke.removeEventListener("focusin",st)},this.refresh=function(T,x){return _.refresh(T,x)},c&&(this.normalizer=$t.normalizeScroll(c===!0?{debounce:!0,content:!F&&h}:c)),$t.config(t),"overscrollBehavior"in Ke.getComputedStyle(ni)&&de.set([ni,Cs],{overscrollBehavior:"none"}),"scrollBehavior"in Ke.getComputedStyle(ni)&&de.set([ni,Cs],{scrollBehavior:"auto"}),Ke.addEventListener("focusin",st),p=setInterval(O,250),Xr.readyState==="loading"||requestAnimationFrame(function(){return $t.refresh()})}return r.register=function(e){return Ga||(de=e||_p(),gp()&&window.document&&(Ke=window,Xr=document,Cs=Xr.documentElement,ni=Xr.body),de&&(Wr=de.utils.toArray,hp=de.utils.clamp,Wa=de.parseEase("expo"),pp=de.core.context||function(){},$t=de.core.globals().ScrollTrigger,de.core.globals("ScrollSmoother",r),ni&&$t&&(mp=de.delayedCall(.2,function(){return $t.isRefreshing||vi&&vi.refresh()}).pause(),w0=[Ke,Xr,Cs,ni],fp=$t.core._getVelocityProp,dp=$t.core._inputObserver,r.refresh=$t.refresh,Ga=1))),Ga},b0(r,[{key:"progress",get:function(){return this.scrollTrigger?this.scrollTrigger.animation._time/100:0}}]),r}();Li.version="3.12.5";Li.create=function(r){return vi&&r&&vi.content()===Wr(r.content)[0]?vi:new Li(r)};Li.get=function(){return vi};_p()&&de.registerPlugin(Li);at.registerPlugin(Li,Pt);var xp=()=>{at.registerPlugin(Li),Li.create({smooth:1.5,effects:!0}),Pt.refresh()};var Fh="164";var D0=0,vp=1,C0=2;var Xm=1,Nh=2,zi=3,gr=0,Cn=1,Vi=2,dr=0,pr=1,yp=2,Sp=3,Mp=4,R0=5,Qr=100,P0=101,I0=102,L0=103,F0=104,N0=200,U0=201,O0=202,B0=203,Ku=204,ju=205,z0=206,k0=207,V0=208,H0=209,G0=210,W0=211,X0=212,q0=213,Y0=214,Z0=0,J0=1,$0=2,gl=3,K0=4,j0=5,Q0=6,tx=7,qm=0,ex=1,nx=2,mr=0,ix=1,rx=2,sx=3,ox=4,ax=5,lx=6,cx=7;var Ym=300,js=301,Qs=302,Qu=303,th=304,Gl=306,eh=1e3,es=1001,nh=1002,Yn=1003,ux=1004;var Xa=1005;var oi=1006,_u=1007;var ns=1008;var _r=1009,hx=1010,fx=1011,Zm=1012,Jm=1013,to=1014,hr=1015,Wl=1016,$m=1017,Km=1018,Ko=1020,dx=35902,px=1021,mx=1022,Si=1023,gx=1024,_x=1025,Js=1026,Yo=1027,xx=1028,jm=1029,vx=1030,Qm=1031,tg=1033,xu=33776,vu=33777,yu=33778,Su=33779,bp=35840,wp=35841,Ep=35842,Tp=35843,Ap=36196,Dp=37492,Cp=37496,Rp=37808,Pp=37809,Ip=37810,Lp=37811,Fp=37812,Np=37813,Up=37814,Op=37815,Bp=37816,zp=37817,kp=37818,Vp=37819,Hp=37820,Gp=37821,Mu=36492,Wp=36494,Xp=36495,yx=36283,qp=36284,Yp=36285,Zp=36286;var _l=2300,xl=2301,bu=2302,Jp=2400,$p=2401,Kp=2402;var Sx=3200,Mx=3201,bx=0,wx=1,ur="",qn="srgb",yr="srgb-linear",Uh="display-p3",Xl="display-p3-linear",vl="linear",ye="srgb",yl="rec709",Sl="p3";var Rs=7680;var jp=519,Ex=512,Tx=513,Ax=514,eg=515,Dx=516,Cx=517,Rx=518,Px=519,Qp=35044;var tm="300 es",Hi=2e3,Ml=2001,xr=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let i=this._listeners[t];if(i!==void 0){let s=i.indexOf(e);s!==-1&&i.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let n=this._listeners[t.type];if(n!==void 0){t.target=this;let i=n.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,t);t.target=null}}},an=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var wu=Math.PI/180,ih=180/Math.PI;function jo(){let r=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(an[r&255]+an[r>>8&255]+an[r>>16&255]+an[r>>24&255]+"-"+an[t&255]+an[t>>8&255]+"-"+an[t>>16&15|64]+an[t>>24&255]+"-"+an[e&63|128]+an[e>>8&255]+"-"+an[e>>16&255]+an[e>>24&255]+an[n&255]+an[n>>8&255]+an[n>>16&255]+an[n>>24&255]).toLowerCase()}function Dn(r,t,e){return Math.max(t,Math.min(e,r))}function Ix(r,t){return(r%t+t)%t}function Eu(r,t,e){return(1-e)*r+e*t}function ko(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function An(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var ue=class r{constructor(t=0,e=0){r.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(Dn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),i=Math.sin(e),s=this.x-t.x,o=this.y-t.y;return this.x=s*n-o*i+t.x,this.y=s*i+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},jt=class r{constructor(t,e,n,i,s,o,a,l,c){r.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,o,a,l,c)}set(t,e,n,i,s,o,a,l,c){let u=this.elements;return u[0]=t,u[1]=i,u[2]=a,u[3]=e,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],f=n[2],d=n[5],_=n[8],g=i[0],m=i[3],p=i[6],b=i[1],y=i[4],S=i[7],D=i[2],A=i[5],w=i[8];return s[0]=o*g+a*b+l*D,s[3]=o*m+a*y+l*A,s[6]=o*p+a*S+l*w,s[1]=c*g+u*b+h*D,s[4]=c*m+u*y+h*A,s[7]=c*p+u*S+h*w,s[2]=f*g+d*b+_*D,s[5]=f*m+d*y+_*A,s[8]=f*p+d*S+_*w,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return e*o*u-e*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*o-a*c,f=a*l-u*s,d=c*s-o*l,_=e*h+n*f+i*d;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let g=1/_;return t[0]=h*g,t[1]=(i*c-u*n)*g,t[2]=(a*n-i*o)*g,t[3]=f*g,t[4]=(u*e-i*l)*g,t[5]=(i*s-a*e)*g,t[6]=d*g,t[7]=(n*l-c*e)*g,t[8]=(o*e-n*s)*g,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+t,-i*c,i*l,-i*(-c*o+l*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(Tu.makeScale(t,e)),this}rotate(t){return this.premultiply(Tu.makeRotation(-t)),this}translate(t,e){return this.premultiply(Tu.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},Tu=new jt;function ng(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}function bl(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function Lx(){let r=bl("canvas");return r.style.display="block",r}var em={};function Fx(r){r in em||(em[r]=!0,console.warn(r))}var nm=new jt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),im=new jt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),qa={[yr]:{transfer:vl,primaries:yl,toReference:r=>r,fromReference:r=>r},[qn]:{transfer:ye,primaries:yl,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[Xl]:{transfer:vl,primaries:Sl,toReference:r=>r.applyMatrix3(im),fromReference:r=>r.applyMatrix3(nm)},[Uh]:{transfer:ye,primaries:Sl,toReference:r=>r.convertSRGBToLinear().applyMatrix3(im),fromReference:r=>r.applyMatrix3(nm).convertLinearToSRGB()}},Nx=new Set([yr,Xl]),me={enabled:!0,_workingColorSpace:yr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!Nx.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,t,e){if(this.enabled===!1||t===e||!t||!e)return r;let n=qa[t].toReference,i=qa[e].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,t){return this.convert(r,this._workingColorSpace,t)},toWorkingColorSpace:function(r,t){return this.convert(r,t,this._workingColorSpace)},getPrimaries:function(r){return qa[r].primaries},getTransfer:function(r){return r===ur?vl:qa[r].transfer}};function $s(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Au(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var Ps,rh=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{Ps===void 0&&(Ps=bl("canvas")),Ps.width=t.width,Ps.height=t.height;let n=Ps.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Ps}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=bl("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let i=n.getImageData(0,0,t.width,t.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=$s(s[o]/255)*255;return n.putImageData(i,0,0),e}else if(t.data){let e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor($s(e[n]/255)*255):e[n]=$s(e[n]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},Ux=0,wl=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Ux++}),this.uuid=jo(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o<a;o++)i[o].isDataTexture?s.push(Du(i[o].image)):s.push(Du(i[o]))}else s=Du(i);n.url=s}return e||(t.images[this.uuid]=n),n}};function Du(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?rh.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Ox=0,$n=class r extends xr{constructor(t=r.DEFAULT_IMAGE,e=r.DEFAULT_MAPPING,n=es,i=es,s=oi,o=ns,a=Si,l=_r,c=r.DEFAULT_ANISOTROPY,u=ur){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Ox++}),this.uuid=jo(),this.name="",this.source=new wl(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new ue(0,0),this.repeat=new ue(1,1),this.center=new ue(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new jt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Ym)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case eh:t.x=t.x-Math.floor(t.x);break;case es:t.x=t.x<0?0:1;break;case nh:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case eh:t.y=t.y-Math.floor(t.y);break;case es:t.y=t.y<0?0:1;break;case nh:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};$n.DEFAULT_IMAGE=null;$n.DEFAULT_MAPPING=Ym;$n.DEFAULT_ANISOTROPY=1;var Ye=class r{constructor(t=0,e=0,n=0,i=1){r.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,s,l=t.elements,c=l[0],u=l[4],h=l[8],f=l[1],d=l[5],_=l[9],g=l[2],m=l[6],p=l[10];if(Math.abs(u-f)<.01&&Math.abs(h-g)<.01&&Math.abs(_-m)<.01){if(Math.abs(u+f)<.1&&Math.abs(h+g)<.1&&Math.abs(_+m)<.1&&Math.abs(c+d+p-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let y=(c+1)/2,S=(d+1)/2,D=(p+1)/2,A=(u+f)/4,w=(h+g)/4,P=(_+m)/4;return y>S&&y>D?y<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(y),i=A/n,s=w/n):S>D?S<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(S),n=A/i,s=P/i):D<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(D),n=w/s,i=P/s),this.set(n,i,s,e),this}let b=Math.sqrt((m-_)*(m-_)+(h-g)*(h-g)+(f-u)*(f-u));return Math.abs(b)<.001&&(b=1),this.x=(m-_)/b,this.y=(h-g)/b,this.z=(f-u)/b,this.w=Math.acos((c+d+p-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},sh=class extends xr{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Ye(0,0,t,e),this.scissorTest=!1,this.viewport=new Ye(0,0,t,e);let i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:oi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);let s=new $n(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];let o=n.count;for(let a=0;a<o;a++)this.textures[a]=s.clone(),this.textures[a].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let n=0,i=t.textures.length;n<i;n++)this.textures[n]=t.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;let e=Object.assign({},t.texture.image);return this.texture.source=new wl(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},Gi=class extends sh{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}},El=class extends $n{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=Yn,this.minFilter=Yn,this.wrapR=es,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var oh=class extends $n{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=Yn,this.minFilter=Yn,this.wrapR=es,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var vr=class{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,s,o,a){let l=n[i+0],c=n[i+1],u=n[i+2],h=n[i+3],f=s[o+0],d=s[o+1],_=s[o+2],g=s[o+3];if(a===0){t[e+0]=l,t[e+1]=c,t[e+2]=u,t[e+3]=h;return}if(a===1){t[e+0]=f,t[e+1]=d,t[e+2]=_,t[e+3]=g;return}if(h!==g||l!==f||c!==d||u!==_){let m=1-a,p=l*f+c*d+u*_+h*g,b=p>=0?1:-1,y=1-p*p;if(y>Number.EPSILON){let D=Math.sqrt(y),A=Math.atan2(D,p*b);m=Math.sin(m*A)/D,a=Math.sin(a*A)/D}let S=a*b;if(l=l*m+f*S,c=c*m+d*S,u=u*m+_*S,h=h*m+g*S,m===1-a){let D=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=D,c*=D,u*=D,h*=D}}t[e]=l,t[e+1]=c,t[e+2]=u,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],f=s[o+1],d=s[o+2],_=s[o+3];return t[e]=a*_+u*h+l*d-c*f,t[e+1]=l*_+u*f+c*h-a*d,t[e+2]=c*_+u*d+a*f-l*h,t[e+3]=u*_-a*h-l*f-c*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let n=t._x,i=t._y,s=t._z,o=t._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),f=l(n/2),d=l(i/2),_=l(s/2);switch(o){case"XYZ":this._x=f*u*h+c*d*_,this._y=c*d*h-f*u*_,this._z=c*u*_+f*d*h,this._w=c*u*h-f*d*_;break;case"YXZ":this._x=f*u*h+c*d*_,this._y=c*d*h-f*u*_,this._z=c*u*_-f*d*h,this._w=c*u*h+f*d*_;break;case"ZXY":this._x=f*u*h-c*d*_,this._y=c*d*h+f*u*_,this._z=c*u*_+f*d*h,this._w=c*u*h-f*d*_;break;case"ZYX":this._x=f*u*h-c*d*_,this._y=c*d*h+f*u*_,this._z=c*u*_-f*d*h,this._w=c*u*h+f*d*_;break;case"YZX":this._x=f*u*h+c*d*_,this._y=c*d*h+f*u*_,this._z=c*u*_-f*d*h,this._w=c*u*h-f*d*_;break;case"XZY":this._x=f*u*h-c*d*_,this._y=c*d*h-f*u*_,this._z=c*u*_+f*d*h,this._w=c*u*h+f*d*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],i=e[4],s=e[8],o=e[1],a=e[5],l=e[9],c=e[2],u=e[6],h=e[10],f=n+a+h;if(f>0){let d=.5/Math.sqrt(f+1);this._w=.25/d,this._x=(u-l)*d,this._y=(s-c)*d,this._z=(o-i)*d}else if(n>a&&n>h){let d=2*Math.sqrt(1+n-a-h);this._w=(u-l)/d,this._x=.25*d,this._y=(i+o)/d,this._z=(s+c)/d}else if(a>h){let d=2*Math.sqrt(1+a-n-h);this._w=(s-c)/d,this._x=(i+o)/d,this._y=.25*d,this._z=(l+u)/d}else{let d=2*Math.sqrt(1+h-n-a);this._w=(o-i)/d,this._x=(s+c)/d,this._y=(l+u)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Dn(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,i=t._y,s=t._z,o=t._w,a=e._x,l=e._y,c=e._z,u=e._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*t._w+n*t._x+i*t._y+s*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let d=1-e;return this._w=d*o+e*this._w,this._x=d*n+e*this._x,this._y=d*i+e*this._y,this._z=d*s+e*this._z,this.normalize(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-e)*u)/c,f=Math.sin(e*u)/c;return this._w=o*h+this._w*f,this._x=n*h+this._x*f,this._y=i*h+this._y*f,this._z=s*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},j=class r{constructor(t=0,e=0,n=0){r.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(rm.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(rm.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*i,this.y=s[1]*e+s[4]*n+s[7]*i,this.z=s[2]*e+s[5]*n+s[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=t.elements,o=1/(s[3]*e+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*e+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*e+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(t){let e=this.x,n=this.y,i=this.z,s=t.x,o=t.y,a=t.z,l=t.w,c=2*(o*i-a*n),u=2*(a*e-s*i),h=2*(s*n-o*e);return this.x=e+l*c+o*h-a*u,this.y=n+l*u+a*c-s*h,this.z=i+l*h+s*u-o*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i,this.y=s[1]*e+s[5]*n+s[9]*i,this.z=s[2]*e+s[6]*n+s[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,i=t.y,s=t.z,o=e.x,a=e.y,l=e.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Cu.copy(this).projectOnVector(t),this.sub(Cu)}reflect(t){return this.sub(Cu.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(Dn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},Cu=new j,rm=new vr,is=class{constructor(t=new j(1/0,1/0,1/0),e=new j(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(ii.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(ii.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let n=ii.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let n=t.geometry;if(n!==void 0){let s=n.getAttribute("position");if(e===!0&&s!==void 0&&t.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)t.isMesh===!0?t.getVertexPosition(o,ii):ii.fromBufferAttribute(s,o),ii.applyMatrix4(t.matrixWorld),this.expandByPoint(ii);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Ya.copy(t.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Ya.copy(n.boundingBox)),Ya.applyMatrix4(t.matrixWorld),this.union(Ya)}let i=t.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,ii),ii.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Vo),Za.subVectors(this.max,Vo),Is.subVectors(t.a,Vo),Ls.subVectors(t.b,Vo),Fs.subVectors(t.c,Vo),rr.subVectors(Ls,Is),sr.subVectors(Fs,Ls),qr.subVectors(Is,Fs);let e=[0,-rr.z,rr.y,0,-sr.z,sr.y,0,-qr.z,qr.y,rr.z,0,-rr.x,sr.z,0,-sr.x,qr.z,0,-qr.x,-rr.y,rr.x,0,-sr.y,sr.x,0,-qr.y,qr.x,0];return!Ru(e,Is,Ls,Fs,Za)||(e=[1,0,0,0,1,0,0,0,1],!Ru(e,Is,Ls,Fs,Za))?!1:(Ja.crossVectors(rr,sr),e=[Ja.x,Ja.y,Ja.z],Ru(e,Is,Ls,Fs,Za))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,ii).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(ii).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Fi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Fi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Fi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Fi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Fi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Fi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Fi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Fi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Fi),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},Fi=[new j,new j,new j,new j,new j,new j,new j,new j],ii=new j,Ya=new is,Is=new j,Ls=new j,Fs=new j,rr=new j,sr=new j,qr=new j,Vo=new j,Za=new j,Ja=new j,Yr=new j;function Ru(r,t,e,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){Yr.fromArray(r,s);let a=i.x*Math.abs(Yr.x)+i.y*Math.abs(Yr.y)+i.z*Math.abs(Yr.z),l=t.dot(Yr),c=e.dot(Yr),u=n.dot(Yr);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var Bx=new is,Ho=new j,Pu=new j,eo=class{constructor(t=new j,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let n=this.center;e!==void 0?n.copy(e):Bx.setFromPoints(t).getCenter(n);let i=0;for(let s=0,o=t.length;s<o;s++)i=Math.max(i,n.distanceToSquared(t[s]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Ho.subVectors(t,this.center);let e=Ho.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(Ho,i/n),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(Pu.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Ho.copy(t.center).add(Pu)),this.expandByPoint(Ho.copy(t.center).sub(Pu))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},Ni=new j,Iu=new j,$a=new j,or=new j,Lu=new j,Ka=new j,Fu=new j,Tl=class{constructor(t=new j,e=new j(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Ni)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=Ni.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Ni.copy(this.origin).addScaledVector(this.direction,e),Ni.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){Iu.copy(t).add(e).multiplyScalar(.5),$a.copy(e).sub(t).normalize(),or.copy(this.origin).sub(Iu);let s=t.distanceTo(e)*.5,o=-this.direction.dot($a),a=or.dot(this.direction),l=-or.dot($a),c=or.lengthSq(),u=Math.abs(1-o*o),h,f,d,_;if(u>0)if(h=o*l-a,f=o*a-l,_=s*u,h>=0)if(f>=-_)if(f<=_){let g=1/u;h*=g,f*=g,d=h*(h+o*f+2*a)+f*(o*h+f+2*l)+c}else f=s,h=Math.max(0,-(o*f+a)),d=-h*h+f*(f+2*l)+c;else f=-s,h=Math.max(0,-(o*f+a)),d=-h*h+f*(f+2*l)+c;else f<=-_?(h=Math.max(0,-(-o*s+a)),f=h>0?-s:Math.min(Math.max(-s,-l),s),d=-h*h+f*(f+2*l)+c):f<=_?(h=0,f=Math.min(Math.max(-s,-l),s),d=f*(f+2*l)+c):(h=Math.max(0,-(o*s+a)),f=h>0?s:Math.min(Math.max(-s,-l),s),d=-h*h+f*(f+2*l)+c);else f=o>0?-s:s,h=Math.max(0,-(o*f+a)),d=-h*h+f*(f+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(Iu).addScaledVector($a,f),d}intersectSphere(t,e){Ni.subVectors(t.center,this.origin);let n=Ni.dot(this.direction),i=Ni.dot(Ni)-n*n,s=t.radius*t.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return l<0?null:a<0?this.at(l,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,f=this.origin;return c>=0?(n=(t.min.x-f.x)*c,i=(t.max.x-f.x)*c):(n=(t.max.x-f.x)*c,i=(t.min.x-f.x)*c),u>=0?(s=(t.min.y-f.y)*u,o=(t.max.y-f.y)*u):(s=(t.max.y-f.y)*u,o=(t.min.y-f.y)*u),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),h>=0?(a=(t.min.z-f.z)*h,l=(t.max.z-f.z)*h):(a=(t.max.z-f.z)*h,l=(t.min.z-f.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,Ni)!==null}intersectTriangle(t,e,n,i,s){Lu.subVectors(e,t),Ka.subVectors(n,t),Fu.crossVectors(Lu,Ka);let o=this.direction.dot(Fu),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;or.subVectors(this.origin,t);let l=a*this.direction.dot(Ka.crossVectors(or,Ka));if(l<0)return null;let c=a*this.direction.dot(Lu.cross(or));if(c<0||l+c>o)return null;let u=-a*or.dot(Fu);return u<0?null:this.at(u/o,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Le=class r{constructor(t,e,n,i,s,o,a,l,c,u,h,f,d,_,g,m){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,o,a,l,c,u,h,f,d,_,g,m)}set(t,e,n,i,s,o,a,l,c,u,h,f,d,_,g,m){let p=this.elements;return p[0]=t,p[4]=e,p[8]=n,p[12]=i,p[1]=s,p[5]=o,p[9]=a,p[13]=l,p[2]=c,p[6]=u,p[10]=h,p[14]=f,p[3]=d,p[7]=_,p[11]=g,p[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new r().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,i=1/Ns.setFromMatrixColumn(t,0).length(),s=1/Ns.setFromMatrixColumn(t,1).length(),o=1/Ns.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,i=t.y,s=t.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(t.order==="XYZ"){let f=o*u,d=o*h,_=a*u,g=a*h;e[0]=l*u,e[4]=-l*h,e[8]=c,e[1]=d+_*c,e[5]=f-g*c,e[9]=-a*l,e[2]=g-f*c,e[6]=_+d*c,e[10]=o*l}else if(t.order==="YXZ"){let f=l*u,d=l*h,_=c*u,g=c*h;e[0]=f+g*a,e[4]=_*a-d,e[8]=o*c,e[1]=o*h,e[5]=o*u,e[9]=-a,e[2]=d*a-_,e[6]=g+f*a,e[10]=o*l}else if(t.order==="ZXY"){let f=l*u,d=l*h,_=c*u,g=c*h;e[0]=f-g*a,e[4]=-o*h,e[8]=_+d*a,e[1]=d+_*a,e[5]=o*u,e[9]=g-f*a,e[2]=-o*c,e[6]=a,e[10]=o*l}else if(t.order==="ZYX"){let f=o*u,d=o*h,_=a*u,g=a*h;e[0]=l*u,e[4]=_*c-d,e[8]=f*c+g,e[1]=l*h,e[5]=g*c+f,e[9]=d*c-_,e[2]=-c,e[6]=a*l,e[10]=o*l}else if(t.order==="YZX"){let f=o*l,d=o*c,_=a*l,g=a*c;e[0]=l*u,e[4]=g-f*h,e[8]=_*h+d,e[1]=h,e[5]=o*u,e[9]=-a*u,e[2]=-c*u,e[6]=d*h+_,e[10]=f-g*h}else if(t.order==="XZY"){let f=o*l,d=o*c,_=a*l,g=a*c;e[0]=l*u,e[4]=-h,e[8]=c*u,e[1]=f*h+g,e[5]=o*u,e[9]=d*h-_,e[2]=_*h-d,e[6]=a*u,e[10]=g*h+f}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(zx,t,kx)}lookAt(t,e,n){let i=this.elements;return Nn.subVectors(t,e),Nn.lengthSq()===0&&(Nn.z=1),Nn.normalize(),ar.crossVectors(n,Nn),ar.lengthSq()===0&&(Math.abs(n.z)===1?Nn.x+=1e-4:Nn.z+=1e-4,Nn.normalize(),ar.crossVectors(n,Nn)),ar.normalize(),ja.crossVectors(Nn,ar),i[0]=ar.x,i[4]=ja.x,i[8]=Nn.x,i[1]=ar.y,i[5]=ja.y,i[9]=Nn.y,i[2]=ar.z,i[6]=ja.z,i[10]=Nn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],f=n[9],d=n[13],_=n[2],g=n[6],m=n[10],p=n[14],b=n[3],y=n[7],S=n[11],D=n[15],A=i[0],w=i[4],P=i[8],M=i[12],v=i[1],N=i[5],F=i[9],R=i[13],B=i[2],Y=i[6],H=i[10],J=i[14],O=i[3],L=i[7],C=i[11],ot=i[15];return s[0]=o*A+a*v+l*B+c*O,s[4]=o*w+a*N+l*Y+c*L,s[8]=o*P+a*F+l*H+c*C,s[12]=o*M+a*R+l*J+c*ot,s[1]=u*A+h*v+f*B+d*O,s[5]=u*w+h*N+f*Y+d*L,s[9]=u*P+h*F+f*H+d*C,s[13]=u*M+h*R+f*J+d*ot,s[2]=_*A+g*v+m*B+p*O,s[6]=_*w+g*N+m*Y+p*L,s[10]=_*P+g*F+m*H+p*C,s[14]=_*M+g*R+m*J+p*ot,s[3]=b*A+y*v+S*B+D*O,s[7]=b*w+y*N+S*Y+D*L,s[11]=b*P+y*F+S*H+D*C,s[15]=b*M+y*R+S*J+D*ot,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],i=t[8],s=t[12],o=t[1],a=t[5],l=t[9],c=t[13],u=t[2],h=t[6],f=t[10],d=t[14],_=t[3],g=t[7],m=t[11],p=t[15];return _*(+s*l*h-i*c*h-s*a*f+n*c*f+i*a*d-n*l*d)+g*(+e*l*d-e*c*f+s*o*f-i*o*d+i*c*u-s*l*u)+m*(+e*c*h-e*a*d-s*o*h+n*o*d+s*a*u-n*c*u)+p*(-i*a*u-e*l*h+e*a*f+i*o*h-n*o*f+n*l*u)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],d=t[11],_=t[12],g=t[13],m=t[14],p=t[15],b=h*m*c-g*f*c+g*l*d-a*m*d-h*l*p+a*f*p,y=_*f*c-u*m*c-_*l*d+o*m*d+u*l*p-o*f*p,S=u*g*c-_*h*c+_*a*d-o*g*d-u*a*p+o*h*p,D=_*h*l-u*g*l-_*a*f+o*g*f+u*a*m-o*h*m,A=e*b+n*y+i*S+s*D;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/A;return t[0]=b*w,t[1]=(g*f*s-h*m*s-g*i*d+n*m*d+h*i*p-n*f*p)*w,t[2]=(a*m*s-g*l*s+g*i*c-n*m*c-a*i*p+n*l*p)*w,t[3]=(h*l*s-a*f*s-h*i*c+n*f*c+a*i*d-n*l*d)*w,t[4]=y*w,t[5]=(u*m*s-_*f*s+_*i*d-e*m*d-u*i*p+e*f*p)*w,t[6]=(_*l*s-o*m*s-_*i*c+e*m*c+o*i*p-e*l*p)*w,t[7]=(o*f*s-u*l*s+u*i*c-e*f*c-o*i*d+e*l*d)*w,t[8]=S*w,t[9]=(_*h*s-u*g*s-_*n*d+e*g*d+u*n*p-e*h*p)*w,t[10]=(o*g*s-_*a*s+_*n*c-e*g*c-o*n*p+e*a*p)*w,t[11]=(u*a*s-o*h*s-u*n*c+e*h*c+o*n*d-e*a*d)*w,t[12]=D*w,t[13]=(u*g*i-_*h*i+_*n*f-e*g*f-u*n*m+e*h*m)*w,t[14]=(_*a*i-o*g*i-_*n*l+e*g*l+o*n*m-e*a*m)*w,t[15]=(o*h*i-u*a*i+u*n*l-e*h*l-o*n*f+e*a*f)*w,this}scale(t){let e=this.elements,n=t.x,i=t.y,s=t.z;return e[0]*=n,e[4]*=i,e[8]*=s,e[1]*=n,e[5]*=i,e[9]*=s,e[2]*=n,e[6]*=i,e[10]*=s,e[3]*=n,e[7]*=i,e[11]*=s,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),i=Math.sin(e),s=1-n,o=t.x,a=t.y,l=t.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,s,o){return this.set(1,n,s,0,t,1,o,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){let i=this.elements,s=e._x,o=e._y,a=e._z,l=e._w,c=s+s,u=o+o,h=a+a,f=s*c,d=s*u,_=s*h,g=o*u,m=o*h,p=a*h,b=l*c,y=l*u,S=l*h,D=n.x,A=n.y,w=n.z;return i[0]=(1-(g+p))*D,i[1]=(d+S)*D,i[2]=(_-y)*D,i[3]=0,i[4]=(d-S)*A,i[5]=(1-(f+p))*A,i[6]=(m+b)*A,i[7]=0,i[8]=(_+y)*w,i[9]=(m-b)*w,i[10]=(1-(f+g))*w,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){let i=this.elements,s=Ns.set(i[0],i[1],i[2]).length(),o=Ns.set(i[4],i[5],i[6]).length(),a=Ns.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),t.x=i[12],t.y=i[13],t.z=i[14],ri.copy(this);let c=1/s,u=1/o,h=1/a;return ri.elements[0]*=c,ri.elements[1]*=c,ri.elements[2]*=c,ri.elements[4]*=u,ri.elements[5]*=u,ri.elements[6]*=u,ri.elements[8]*=h,ri.elements[9]*=h,ri.elements[10]*=h,e.setFromRotationMatrix(ri),n.x=s,n.y=o,n.z=a,this}makePerspective(t,e,n,i,s,o,a=Hi){let l=this.elements,c=2*s/(e-t),u=2*s/(n-i),h=(e+t)/(e-t),f=(n+i)/(n-i),d,_;if(a===Hi)d=-(o+s)/(o-s),_=-2*o*s/(o-s);else if(a===Ml)d=-o/(o-s),_=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=u,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=d,l[14]=_,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,i,s,o,a=Hi){let l=this.elements,c=1/(e-t),u=1/(n-i),h=1/(o-s),f=(e+t)*c,d=(n+i)*u,_,g;if(a===Hi)_=(o+s)*h,g=-2*h;else if(a===Ml)_=s*h,g=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-d,l[2]=0,l[6]=0,l[10]=g,l[14]=-_,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},Ns=new j,ri=new Le,zx=new j(0,0,0),kx=new j(1,1,1),ar=new j,ja=new j,Nn=new j,sm=new Le,om=new vr,Wi=class r{constructor(t=0,e=0,n=0,i=r.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){let i=t.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],f=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(Dn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Dn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Dn(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Dn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,d),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Dn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-Dn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return sm.makeRotationFromQuaternion(t),this.setFromRotationMatrix(sm,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return om.setFromEuler(this),this.setFromQuaternion(om,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Wi.DEFAULT_ORDER="XYZ";var Al=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},Vx=0,am=new j,Us=new vr,Ui=new Le,Qa=new j,Go=new j,Hx=new j,Gx=new vr,lm=new j(1,0,0),cm=new j(0,1,0),um=new j(0,0,1),hm={type:"added"},Wx={type:"removed"},Os={type:"childadded",child:null},Nu={type:"childremoved",child:null},cn=class r extends xr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Vx++}),this.uuid=jo(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let t=new j,e=new Wi,n=new vr,i=new j(1,1,1);function s(){n.setFromEuler(e,!1)}function o(){e.setFromQuaternion(n,void 0,!1)}e._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Le},normalMatrix:{value:new jt}}),this.matrix=new Le,this.matrixWorld=new Le,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Al,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Us.setFromAxisAngle(t,e),this.quaternion.multiply(Us),this}rotateOnWorldAxis(t,e){return Us.setFromAxisAngle(t,e),this.quaternion.premultiply(Us),this}rotateX(t){return this.rotateOnAxis(lm,t)}rotateY(t){return this.rotateOnAxis(cm,t)}rotateZ(t){return this.rotateOnAxis(um,t)}translateOnAxis(t,e){return am.copy(t).applyQuaternion(this.quaternion),this.position.add(am.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(lm,t)}translateY(t){return this.translateOnAxis(cm,t)}translateZ(t){return this.translateOnAxis(um,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ui.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Qa.copy(t):Qa.set(t,e,n);let i=this.parent;this.updateWorldMatrix(!0,!1),Go.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ui.lookAt(Go,Qa,this.up):Ui.lookAt(Qa,Go,this.up),this.quaternion.setFromRotationMatrix(Ui),i&&(Ui.extractRotation(i.matrixWorld),Us.setFromRotationMatrix(Ui),this.quaternion.premultiply(Us.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(hm),Os.child=t,this.dispatchEvent(Os),Os.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(Wx),Nu.child=t,this.dispatchEvent(Nu),Nu.child=null),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Ui.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Ui.multiply(t.parent.matrixWorld)),t.applyMatrix4(Ui),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(hm),Os.child=t,this.dispatchEvent(Os),Os.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){let o=this.children[n].getObjectByProperty(t,e);if(o!==void 0)return o}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);let i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Go,t,Hx),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Go,Gx,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){let e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let n=0,i=e.length;n<i;n++){let s=e[n];(s.matrixWorldAutoUpdate===!0||t===!0)&&s.updateMatrixWorld(t)}}updateWorldMatrix(t,e){let n=this.parent;if(t===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){let i=this.children;for(let s=0,o=i.length;s<o;s++){let a=i[s];a.matrixWorldAutoUpdate===!0&&a.updateWorldMatrix(!1,!0)}}}toJSON(t){let e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(t.geometries,this.geometry);let a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){let l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){let h=l[c];s(t.shapes,h)}else s(t.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(s(t.materials,this.material[l]));i.material=a}else i.material=s(t.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){let l=this.animations[a];i.animations.push(s(t.animations,l))}}if(e){let a=o(t.geometries),l=o(t.materials),c=o(t.textures),u=o(t.images),h=o(t.shapes),f=o(t.skeletons),d=o(t.animations),_=o(t.nodes);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),f.length>0&&(n.skeletons=f),d.length>0&&(n.animations=d),_.length>0&&(n.nodes=_)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n<t.children.length;n++){let i=t.children[n];this.add(i.clone())}return this}};cn.DEFAULT_UP=new j(0,1,0);cn.DEFAULT_MATRIX_AUTO_UPDATE=!0;cn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var si=new j,Oi=new j,Uu=new j,Bi=new j,Bs=new j,zs=new j,fm=new j,Ou=new j,Bu=new j,zu=new j,Ys=class r{constructor(t=new j,e=new j,n=new j){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),si.subVectors(t,e),i.cross(si);let s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(t,e,n,i,s){si.subVectors(i,e),Oi.subVectors(n,e),Uu.subVectors(t,e);let o=si.dot(si),a=si.dot(Oi),l=si.dot(Uu),c=Oi.dot(Oi),u=Oi.dot(Uu),h=o*c-a*a;if(h===0)return s.set(0,0,0),null;let f=1/h,d=(c*l-a*u)*f,_=(o*u-a*l)*f;return s.set(1-d-_,_,d)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Bi)===null?!1:Bi.x>=0&&Bi.y>=0&&Bi.x+Bi.y<=1}static getInterpolation(t,e,n,i,s,o,a,l){return this.getBarycoord(t,e,n,i,Bi)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Bi.x),l.addScaledVector(o,Bi.y),l.addScaledVector(a,Bi.z),l)}static isFrontFacing(t,e,n,i){return si.subVectors(n,e),Oi.subVectors(t,e),si.cross(Oi).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return si.subVectors(this.c,this.b),Oi.subVectors(this.a,this.b),si.cross(Oi).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return r.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return r.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,s){return r.getInterpolation(t,this.a,this.b,this.c,e,n,i,s)}containsPoint(t){return r.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return r.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,i=this.b,s=this.c,o,a;Bs.subVectors(i,n),zs.subVectors(s,n),Ou.subVectors(t,n);let l=Bs.dot(Ou),c=zs.dot(Ou);if(l<=0&&c<=0)return e.copy(n);Bu.subVectors(t,i);let u=Bs.dot(Bu),h=zs.dot(Bu);if(u>=0&&h<=u)return e.copy(i);let f=l*h-u*c;if(f<=0&&l>=0&&u<=0)return o=l/(l-u),e.copy(n).addScaledVector(Bs,o);zu.subVectors(t,s);let d=Bs.dot(zu),_=zs.dot(zu);if(_>=0&&d<=_)return e.copy(s);let g=d*c-l*_;if(g<=0&&c>=0&&_<=0)return a=c/(c-_),e.copy(n).addScaledVector(zs,a);let m=u*_-d*h;if(m<=0&&h-u>=0&&d-_>=0)return fm.subVectors(s,i),a=(h-u)/(h-u+(d-_)),e.copy(i).addScaledVector(fm,a);let p=1/(m+g+f);return o=g*p,a=f*p,e.copy(n).addScaledVector(Bs,o).addScaledVector(zs,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},ig={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},lr={h:0,s:0,l:0},tl={h:0,s:0,l:0};function ku(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*6*(2/3-e):r}var ce=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let i=t;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=qn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,me.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=me.workingColorSpace){return this.r=t,this.g=e,this.b=n,me.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=me.workingColorSpace){if(t=Ix(t,1),e=Dn(e,0,1),n=Dn(n,0,1),e===0)this.r=this.g=this.b=n;else{let s=n<=.5?n*(1+e):n+e-n*e,o=2*n-s;this.r=ku(o,s,t+1/3),this.g=ku(o,s,t),this.b=ku(o,s,t-1/3)}return me.toWorkingColorSpace(this,i),this}setStyle(t,e=qn){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let s,o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){let s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(o===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=qn){let n=ig[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=$s(t.r),this.g=$s(t.g),this.b=$s(t.b),this}copyLinearToSRGB(t){return this.r=Au(t.r),this.g=Au(t.g),this.b=Au(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=qn){return me.fromWorkingColorSpace(ln.copy(this),t),Math.round(Dn(ln.r*255,0,255))*65536+Math.round(Dn(ln.g*255,0,255))*256+Math.round(Dn(ln.b*255,0,255))}getHexString(t=qn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=me.workingColorSpace){me.fromWorkingColorSpace(ln.copy(this),e);let n=ln.r,i=ln.g,s=ln.b,o=Math.max(n,i,s),a=Math.min(n,i,s),l,c,u=(a+o)/2;if(a===o)l=0,c=0;else{let h=o-a;switch(c=u<=.5?h/(o+a):h/(2-o-a),o){case n:l=(i-s)/h+(i<s?6:0);break;case i:l=(s-n)/h+2;break;case s:l=(n-i)/h+4;break}l/=6}return t.h=l,t.s=c,t.l=u,t}getRGB(t,e=me.workingColorSpace){return me.fromWorkingColorSpace(ln.copy(this),e),t.r=ln.r,t.g=ln.g,t.b=ln.b,t}getStyle(t=qn){me.fromWorkingColorSpace(ln.copy(this),t);let e=ln.r,n=ln.g,i=ln.b;return t!==qn?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(t,e,n){return this.getHSL(lr),this.setHSL(lr.h+t,lr.s+e,lr.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(lr),t.getHSL(tl);let n=Eu(lr.h,tl.h,e),i=Eu(lr.s,tl.s,e),s=Eu(lr.l,tl.l,e);return this.setHSL(n,i,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,n=this.g,i=this.b,s=t.elements;return this.r=s[0]*e+s[3]*n+s[6]*i,this.g=s[1]*e+s[4]*n+s[7]*i,this.b=s[2]*e+s[5]*n+s[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},ln=new ce;ce.NAMES=ig;var Xx=0,rs=class extends xr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Xx++}),this.uuid=jo(),this.name="",this.type="Material",this.blending=pr,this.side=gr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Ku,this.blendDst=ju,this.blendEquation=Qr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ce(0,0,0),this.blendAlpha=0,this.depthFunc=gl,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=jp,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Rs,this.stencilZFail=Rs,this.stencilZPass=Rs,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let i=this[e];if(i===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==pr&&(n.blending=this.blending),this.side!==gr&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Ku&&(n.blendSrc=this.blendSrc),this.blendDst!==ju&&(n.blendDst=this.blendDst),this.blendEquation!==Qr&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==gl&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==jp&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Rs&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Rs&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Rs&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(e){let s=i(t.textures),o=i(t.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,n=null;if(e!==null){let i=e.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=e[s].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}},Dl=class extends rs{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ce(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Wi,this.combine=qm,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}};var Oe=new j,el=new ue,Zn=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=Qp,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=hr,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Fx("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)el.fromBufferAttribute(this,e),el.applyMatrix3(t),this.setXY(e,el.x,el.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Oe.fromBufferAttribute(this,e),Oe.applyMatrix3(t),this.setXYZ(e,Oe.x,Oe.y,Oe.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Oe.fromBufferAttribute(this,e),Oe.applyMatrix4(t),this.setXYZ(e,Oe.x,Oe.y,Oe.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Oe.fromBufferAttribute(this,e),Oe.applyNormalMatrix(t),this.setXYZ(e,Oe.x,Oe.y,Oe.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Oe.fromBufferAttribute(this,e),Oe.transformDirection(t),this.setXYZ(e,Oe.x,Oe.y,Oe.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=ko(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=An(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=ko(e,this.array)),e}setX(t,e){return this.normalized&&(e=An(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=ko(e,this.array)),e}setY(t,e){return this.normalized&&(e=An(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=ko(e,this.array)),e}setZ(t,e){return this.normalized&&(e=An(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=ko(e,this.array)),e}setW(t,e){return this.normalized&&(e=An(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=An(e,this.array),n=An(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=An(e,this.array),n=An(n,this.array),i=An(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,s){return t*=this.itemSize,this.normalized&&(e=An(e,this.array),n=An(n,this.array),i=An(i,this.array),s=An(s,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==Qp&&(t.usage=this.usage),t}};var Cl=class extends Zn{constructor(t,e,n){super(new Uint16Array(t),e,n)}};var Rl=class extends Zn{constructor(t,e,n){super(new Uint32Array(t),e,n)}};var Jn=class extends Zn{constructor(t,e,n){super(new Float32Array(t),e,n)}},qx=0,Xn=new Le,Vu=new cn,ks=new j,Un=new is,Wo=new is,qe=new j,Mi=class r extends xr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:qx++}),this.uuid=jo(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(ng(t)?Rl:Cl)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new jt().getNormalMatrix(t);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Xn.makeRotationFromQuaternion(t),this.applyMatrix4(Xn),this}rotateX(t){return Xn.makeRotationX(t),this.applyMatrix4(Xn),this}rotateY(t){return Xn.makeRotationY(t),this.applyMatrix4(Xn),this}rotateZ(t){return Xn.makeRotationZ(t),this.applyMatrix4(Xn),this}translate(t,e,n){return Xn.makeTranslation(t,e,n),this.applyMatrix4(Xn),this}scale(t,e,n){return Xn.makeScale(t,e,n),this.applyMatrix4(Xn),this}lookAt(t){return Vu.lookAt(t),Vu.updateMatrix(),this.applyMatrix4(Vu.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ks).negate(),this.translate(ks.x,ks.y,ks.z),this}setFromPoints(t){let e=[];for(let n=0,i=t.length;n<i;n++){let s=t[n];e.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Jn(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new is);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new j(-1/0,-1/0,-1/0),new j(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){let s=e[n];Un.setFromBufferAttribute(s),this.morphTargetsRelative?(qe.addVectors(this.boundingBox.min,Un.min),this.boundingBox.expandByPoint(qe),qe.addVectors(this.boundingBox.max,Un.max),this.boundingBox.expandByPoint(qe)):(this.boundingBox.expandByPoint(Un.min),this.boundingBox.expandByPoint(Un.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new eo);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new j,1/0);return}if(t){let n=this.boundingSphere.center;if(Un.setFromBufferAttribute(t),e)for(let s=0,o=e.length;s<o;s++){let a=e[s];Wo.setFromBufferAttribute(a),this.morphTargetsRelative?(qe.addVectors(Un.min,Wo.min),Un.expandByPoint(qe),qe.addVectors(Un.max,Wo.max),Un.expandByPoint(qe)):(Un.expandByPoint(Wo.min),Un.expandByPoint(Wo.max))}Un.getCenter(n);let i=0;for(let s=0,o=t.count;s<o;s++)qe.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared(qe));if(e)for(let s=0,o=e.length;s<o;s++){let a=e[s],l=this.morphTargetsRelative;for(let c=0,u=a.count;c<u;c++)qe.fromBufferAttribute(a,c),l&&(ks.fromBufferAttribute(t,c),qe.add(ks)),i=Math.max(i,n.distanceToSquared(qe))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let n=e.position,i=e.normal,s=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Zn(new Float32Array(4*n.count),4));let o=this.getAttribute("tangent"),a=[],l=[];for(let P=0;P<n.count;P++)a[P]=new j,l[P]=new j;let c=new j,u=new j,h=new j,f=new ue,d=new ue,_=new ue,g=new j,m=new j;function p(P,M,v){c.fromBufferAttribute(n,P),u.fromBufferAttribute(n,M),h.fromBufferAttribute(n,v),f.fromBufferAttribute(s,P),d.fromBufferAttribute(s,M),_.fromBufferAttribute(s,v),u.sub(c),h.sub(c),d.sub(f),_.sub(f);let N=1/(d.x*_.y-_.x*d.y);isFinite(N)&&(g.copy(u).multiplyScalar(_.y).addScaledVector(h,-d.y).multiplyScalar(N),m.copy(h).multiplyScalar(d.x).addScaledVector(u,-_.x).multiplyScalar(N),a[P].add(g),a[M].add(g),a[v].add(g),l[P].add(m),l[M].add(m),l[v].add(m))}let b=this.groups;b.length===0&&(b=[{start:0,count:t.count}]);for(let P=0,M=b.length;P<M;++P){let v=b[P],N=v.start,F=v.count;for(let R=N,B=N+F;R<B;R+=3)p(t.getX(R+0),t.getX(R+1),t.getX(R+2))}let y=new j,S=new j,D=new j,A=new j;function w(P){D.fromBufferAttribute(i,P),A.copy(D);let M=a[P];y.copy(M),y.sub(D.multiplyScalar(D.dot(M))).normalize(),S.crossVectors(A,M);let N=S.dot(l[P])<0?-1:1;o.setXYZW(P,y.x,y.y,y.z,N)}for(let P=0,M=b.length;P<M;++P){let v=b[P],N=v.start,F=v.count;for(let R=N,B=N+F;R<B;R+=3)w(t.getX(R+0)),w(t.getX(R+1)),w(t.getX(R+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Zn(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let f=0,d=n.count;f<d;f++)n.setXYZ(f,0,0,0);let i=new j,s=new j,o=new j,a=new j,l=new j,c=new j,u=new j,h=new j;if(t)for(let f=0,d=t.count;f<d;f+=3){let _=t.getX(f+0),g=t.getX(f+1),m=t.getX(f+2);i.fromBufferAttribute(e,_),s.fromBufferAttribute(e,g),o.fromBufferAttribute(e,m),u.subVectors(o,s),h.subVectors(i,s),u.cross(h),a.fromBufferAttribute(n,_),l.fromBufferAttribute(n,g),c.fromBufferAttribute(n,m),a.add(u),l.add(u),c.add(u),n.setXYZ(_,a.x,a.y,a.z),n.setXYZ(g,l.x,l.y,l.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let f=0,d=e.count;f<d;f+=3)i.fromBufferAttribute(e,f+0),s.fromBufferAttribute(e,f+1),o.fromBufferAttribute(e,f+2),u.subVectors(o,s),h.subVectors(i,s),u.cross(h),n.setXYZ(f+0,u.x,u.y,u.z),n.setXYZ(f+1,u.x,u.y,u.z),n.setXYZ(f+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)qe.fromBufferAttribute(t,e),qe.normalize(),t.setXYZ(e,qe.x,qe.y,qe.z)}toNonIndexed(){function t(a,l){let c=a.array,u=a.itemSize,h=a.normalized,f=new c.constructor(l.length*u),d=0,_=0;for(let g=0,m=l.length;g<m;g++){a.isInterleavedBufferAttribute?d=l[g]*a.data.stride+a.offset:d=l[g]*u;for(let p=0;p<u;p++)f[_++]=c[d++]}return new Zn(f,u,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new r,n=this.index.array,i=this.attributes;for(let a in i){let l=i[a],c=t(l,n);e.setAttribute(a,c)}let s=this.morphAttributes;for(let a in s){let l=[],c=s[a];for(let u=0,h=c.length;u<h;u++){let f=c[u],d=t(f,n);l.push(d)}e.morphAttributes[a]=l}e.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let a=0,l=o.length;a<l;a++){let c=o[a];e.addGroup(c.start,c.count,c.materialIndex)}return e}toJSON(){let t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let l in n){let c=n[l];t.data.attributes[l]=c.toJSON(t.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,f=c.length;h<f;h++){let d=c[h];u.push(d.toJSON(t.data))}u.length>0&&(i[l]=u,s=!0)}s&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone(e));let i=t.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(e))}let s=t.morphAttributes;for(let c in s){let u=[],h=s[c];for(let f=0,d=h.length;f<d;f++)u.push(h[f].clone(e));this.morphAttributes[c]=u}this.morphTargetsRelative=t.morphTargetsRelative;let o=t.groups;for(let c=0,u=o.length;c<u;c++){let h=o[c];this.addGroup(h.start,h.count,h.materialIndex)}let a=t.boundingBox;a!==null&&(this.boundingBox=a.clone());let l=t.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},dm=new Le,Zr=new Tl,nl=new eo,pm=new j,Vs=new j,Hs=new j,Gs=new j,Hu=new j,il=new j,rl=new ue,sl=new ue,ol=new ue,mm=new j,gm=new j,_m=new j,al=new j,ll=new j,ai=class extends cn{constructor(t=new Mi,e=new Dl){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){let a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(t,e){let n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;e.fromBufferAttribute(i,t);let a=this.morphTargetInfluences;if(s&&a){il.set(0,0,0);for(let l=0,c=s.length;l<c;l++){let u=a[l],h=s[l];u!==0&&(Hu.fromBufferAttribute(h,t),o?il.addScaledVector(Hu,u):il.addScaledVector(Hu.sub(e),u))}e.add(il)}return e}raycast(t,e){let n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),nl.copy(n.boundingSphere),nl.applyMatrix4(s),Zr.copy(t.ray).recast(t.near),!(nl.containsPoint(Zr.origin)===!1&&(Zr.intersectSphere(nl,pm)===null||Zr.origin.distanceToSquared(pm)>(t.far-t.near)**2))&&(dm.copy(s).invert(),Zr.copy(t.ray).applyMatrix4(dm),!(n.boundingBox!==null&&Zr.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Zr)))}_computeIntersections(t,e,n){let i,s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,f=s.groups,d=s.drawRange;if(a!==null)if(Array.isArray(o))for(let _=0,g=f.length;_<g;_++){let m=f[_],p=o[m.materialIndex],b=Math.max(m.start,d.start),y=Math.min(a.count,Math.min(m.start+m.count,d.start+d.count));for(let S=b,D=y;S<D;S+=3){let A=a.getX(S),w=a.getX(S+1),P=a.getX(S+2);i=cl(this,p,t,n,c,u,h,A,w,P),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=m.materialIndex,e.push(i))}}else{let _=Math.max(0,d.start),g=Math.min(a.count,d.start+d.count);for(let m=_,p=g;m<p;m+=3){let b=a.getX(m),y=a.getX(m+1),S=a.getX(m+2);i=cl(this,o,t,n,c,u,h,b,y,S),i&&(i.faceIndex=Math.floor(m/3),e.push(i))}}else if(l!==void 0)if(Array.isArray(o))for(let _=0,g=f.length;_<g;_++){let m=f[_],p=o[m.materialIndex],b=Math.max(m.start,d.start),y=Math.min(l.count,Math.min(m.start+m.count,d.start+d.count));for(let S=b,D=y;S<D;S+=3){let A=S,w=S+1,P=S+2;i=cl(this,p,t,n,c,u,h,A,w,P),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=m.materialIndex,e.push(i))}}else{let _=Math.max(0,d.start),g=Math.min(l.count,d.start+d.count);for(let m=_,p=g;m<p;m+=3){let b=m,y=m+1,S=m+2;i=cl(this,o,t,n,c,u,h,b,y,S),i&&(i.faceIndex=Math.floor(m/3),e.push(i))}}}};function Yx(r,t,e,n,i,s,o,a){let l;if(t.side===Cn?l=n.intersectTriangle(o,s,i,!0,a):l=n.intersectTriangle(i,s,o,t.side===gr,a),l===null)return null;ll.copy(a),ll.applyMatrix4(r.matrixWorld);let c=e.ray.origin.distanceTo(ll);return c<e.near||c>e.far?null:{distance:c,point:ll.clone(),object:r}}function cl(r,t,e,n,i,s,o,a,l,c){r.getVertexPosition(a,Vs),r.getVertexPosition(l,Hs),r.getVertexPosition(c,Gs);let u=Yx(r,t,e,n,Vs,Hs,Gs,al);if(u){i&&(rl.fromBufferAttribute(i,a),sl.fromBufferAttribute(i,l),ol.fromBufferAttribute(i,c),u.uv=Ys.getInterpolation(al,Vs,Hs,Gs,rl,sl,ol,new ue)),s&&(rl.fromBufferAttribute(s,a),sl.fromBufferAttribute(s,l),ol.fromBufferAttribute(s,c),u.uv1=Ys.getInterpolation(al,Vs,Hs,Gs,rl,sl,ol,new ue)),o&&(mm.fromBufferAttribute(o,a),gm.fromBufferAttribute(o,l),_m.fromBufferAttribute(o,c),u.normal=Ys.getInterpolation(al,Vs,Hs,Gs,mm,gm,_m,new j),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));let h={a,b:l,c,normal:new j,materialIndex:0};Ys.getNormal(Vs,Hs,Gs,h.normal),u.face=h}return u}var Zo=class r extends Mi{constructor(t=1,e=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};let a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);let l=[],c=[],u=[],h=[],f=0,d=0;_("z","y","x",-1,-1,n,e,t,o,s,0),_("z","y","x",1,-1,n,e,-t,o,s,1),_("x","z","y",1,1,t,n,e,i,o,2),_("x","z","y",1,-1,t,n,-e,i,o,3),_("x","y","z",1,-1,t,e,n,i,s,4),_("x","y","z",-1,-1,t,e,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new Jn(c,3)),this.setAttribute("normal",new Jn(u,3)),this.setAttribute("uv",new Jn(h,2));function _(g,m,p,b,y,S,D,A,w,P,M){let v=S/w,N=D/P,F=S/2,R=D/2,B=A/2,Y=w+1,H=P+1,J=0,O=0,L=new j;for(let C=0;C<H;C++){let ot=C*N-R;for(let vt=0;vt<Y;vt++){let Wt=vt*v-F;L[g]=Wt*b,L[m]=ot*y,L[p]=B,c.push(L.x,L.y,L.z),L[g]=0,L[m]=0,L[p]=A>0?1:-1,u.push(L.x,L.y,L.z),h.push(vt/w),h.push(1-C/P),J+=1}}for(let C=0;C<P;C++)for(let ot=0;ot<w;ot++){let vt=f+ot+Y*C,Wt=f+ot+Y*(C+1),q=f+(ot+1)+Y*(C+1),tt=f+(ot+1)+Y*C;l.push(vt,Wt,tt),l.push(Wt,q,tt),O+=6}a.addGroup(d,O,M),d+=O,f+=J}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function no(r){let t={};for(let e in r){t[e]={};for(let n in r[e]){let i=r[e][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][n]=null):t[e][n]=i.clone():Array.isArray(i)?t[e][n]=i.slice():t[e][n]=i}}return t}function yn(r){let t={};for(let e=0;e<r.length;e++){let n=no(r[e]);for(let i in n)t[i]=n[i]}return t}function Zx(r){let t=[];for(let e=0;e<r.length;e++)t.push(r[e].clone());return t}function rg(r){let t=r.getRenderTarget();return t===null?r.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:me.workingColorSpace}var Jx={clone:no,merge:yn},$x=`void main() {
|
|
2
2
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
3
3
|
}`,Kx=`void main() {
|
|
4
4
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
5
|
-
}`,Kn=class extends rs{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=$x,this.fragmentShader=Kx,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=no(t.uniforms),this.uniformsGroups=Zx(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){let e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(let i in this.uniforms){let o=this.uniforms[i].value;o&&o.isTexture?e.uniforms[i]={type:"t",value:o.toJSON(t).uuid}:o&&o.isColor?e.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?e.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?e.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?e.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?e.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?e.uniforms[i]={type:"m4",value:o.toArray()}:e.uniforms[i]={value:o}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},Pl=class extends cn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Le,this.projectionMatrix=new Le,this.projectionMatrixInverse=new Le,this.coordinateSystem=Hi}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},cr=new j,xm=new ue,vm=new ue,Sn=class extends Pl{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=ih*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(wu*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return ih*2*Math.atan(Math.tan(wu*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){cr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(cr.x,cr.y).multiplyScalar(-t/cr.z),cr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(cr.x,cr.y).multiplyScalar(-t/cr.z)}getViewSize(t,e){return this.getViewBounds(t,xm,vm),e.subVectors(vm,xm)}setViewOffset(t,e,n,i,s,o){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(wu*.5*this.fov)/this.zoom,n=2*e,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,e-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},Ws=-90,Xs=1,ah=class extends cn{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let i=new Sn(Ws,Xs,t,e);i.layers=this.layers,this.add(i);let s=new Sn(Ws,Xs,t,e);s.layers=this.layers,this.add(s);let o=new Sn(Ws,Xs,t,e);o.layers=this.layers,this.add(o);let a=new Sn(Ws,Xs,t,e);a.layers=this.layers,this.add(a);let l=new Sn(Ws,Xs,t,e);l.layers=this.layers,this.add(l);let c=new Sn(Ws,Xs,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[n,i,s,o,a,l]=e;for(let c of e)this.remove(c);if(t===Hi)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===Ml)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[s,o,a,l,c,u]=this.children,
|
|
5
|
+
}`,Kn=class extends rs{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=$x,this.fragmentShader=Kx,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=no(t.uniforms),this.uniformsGroups=Zx(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){let e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(let i in this.uniforms){let o=this.uniforms[i].value;o&&o.isTexture?e.uniforms[i]={type:"t",value:o.toJSON(t).uuid}:o&&o.isColor?e.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?e.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?e.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?e.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?e.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?e.uniforms[i]={type:"m4",value:o.toArray()}:e.uniforms[i]={value:o}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},Pl=class extends cn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Le,this.projectionMatrix=new Le,this.projectionMatrixInverse=new Le,this.coordinateSystem=Hi}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},cr=new j,xm=new ue,vm=new ue,Sn=class extends Pl{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=ih*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(wu*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return ih*2*Math.atan(Math.tan(wu*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){cr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(cr.x,cr.y).multiplyScalar(-t/cr.z),cr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(cr.x,cr.y).multiplyScalar(-t/cr.z)}getViewSize(t,e){return this.getViewBounds(t,xm,vm),e.subVectors(vm,xm)}setViewOffset(t,e,n,i,s,o){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(wu*.5*this.fov)/this.zoom,n=2*e,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,e-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},Ws=-90,Xs=1,ah=class extends cn{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let i=new Sn(Ws,Xs,t,e);i.layers=this.layers,this.add(i);let s=new Sn(Ws,Xs,t,e);s.layers=this.layers,this.add(s);let o=new Sn(Ws,Xs,t,e);o.layers=this.layers,this.add(o);let a=new Sn(Ws,Xs,t,e);a.layers=this.layers,this.add(a);let l=new Sn(Ws,Xs,t,e);l.layers=this.layers,this.add(l);let c=new Sn(Ws,Xs,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[n,i,s,o,a,l]=e;for(let c of e)this.remove(c);if(t===Hi)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===Ml)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[s,o,a,l,c,u]=this.children,h=t.getRenderTarget(),f=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),_=t.xr.enabled;t.xr.enabled=!1;let g=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,i),t.render(e,s),t.setRenderTarget(n,1,i),t.render(e,o),t.setRenderTarget(n,2,i),t.render(e,a),t.setRenderTarget(n,3,i),t.render(e,l),t.setRenderTarget(n,4,i),t.render(e,c),n.texture.generateMipmaps=g,t.setRenderTarget(n,5,i),t.render(e,u),t.setRenderTarget(h,f,d),t.xr.enabled=_,n.texture.needsPMREMUpdate=!0}},Il=class extends $n{constructor(t,e,n,i,s,o,a,l,c,u){t=t!==void 0?t:[],e=e!==void 0?e:js,super(t,e,n,i,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},lh=class extends Gi{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;let n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new Il(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:oi}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:`
|
|
6
6
|
|
|
7
7
|
varying vec3 vWorldDirection;
|
|
8
8
|
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
38
38
|
|
|
39
39
|
}
|
|
40
|
-
`},i=new Zo(5,5,5),s=new Kn({name:"CubemapFromEquirect",uniforms:no(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Cn,blending:dr});s.uniforms.tEquirect.value=e;let o=new ai(i,s),a=e.minFilter;return e.minFilter===ns&&(e.minFilter=oi),new ah(1,10,this).update(t,o),e.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,n,i){let s=t.getRenderTarget();for(let o=0;o<6;o++)t.setRenderTarget(this,o),t.clear(e,n,i);t.setRenderTarget(s)}},Gu=new j,jx=new j,Qx=new jt,ki=class{constructor(t=new j(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){let i=Gu.subVectors(n,e).cross(jx.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){let n=t.delta(Gu),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;let s=-(t.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:e.copy(t.start).addScaledVector(n,s)}intersectsLine(t){let e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let n=e||Qx.getNormalMatrix(t),i=this.coplanarPoint(Gu).applyMatrix4(t),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},Jr=new eo,ul=new j,Jo=class{constructor(t=new ki,e=new ki,n=new ki,i=new ki,s=new ki,o=new ki){this.planes=[t,e,n,i,s,o]}set(t,e,n,i,s,o){let a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(t){let e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=Hi){let n=this.planes,i=t.elements,s=i[0],o=i[1],a=i[2],l=i[3],c=i[4],u=i[5],
|
|
40
|
+
`},i=new Zo(5,5,5),s=new Kn({name:"CubemapFromEquirect",uniforms:no(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Cn,blending:dr});s.uniforms.tEquirect.value=e;let o=new ai(i,s),a=e.minFilter;return e.minFilter===ns&&(e.minFilter=oi),new ah(1,10,this).update(t,o),e.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,n,i){let s=t.getRenderTarget();for(let o=0;o<6;o++)t.setRenderTarget(this,o),t.clear(e,n,i);t.setRenderTarget(s)}},Gu=new j,jx=new j,Qx=new jt,ki=class{constructor(t=new j(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){let i=Gu.subVectors(n,e).cross(jx.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){let n=t.delta(Gu),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;let s=-(t.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:e.copy(t.start).addScaledVector(n,s)}intersectsLine(t){let e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let n=e||Qx.getNormalMatrix(t),i=this.coplanarPoint(Gu).applyMatrix4(t),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},Jr=new eo,ul=new j,Jo=class{constructor(t=new ki,e=new ki,n=new ki,i=new ki,s=new ki,o=new ki){this.planes=[t,e,n,i,s,o]}set(t,e,n,i,s,o){let a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(t){let e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=Hi){let n=this.planes,i=t.elements,s=i[0],o=i[1],a=i[2],l=i[3],c=i[4],u=i[5],h=i[6],f=i[7],d=i[8],_=i[9],g=i[10],m=i[11],p=i[12],b=i[13],y=i[14],S=i[15];if(n[0].setComponents(l-s,f-c,m-d,S-p).normalize(),n[1].setComponents(l+s,f+c,m+d,S+p).normalize(),n[2].setComponents(l+o,f+u,m+_,S+b).normalize(),n[3].setComponents(l-o,f-u,m-_,S-b).normalize(),n[4].setComponents(l-a,f-h,m-g,S-y).normalize(),e===Hi)n[5].setComponents(l+a,f+h,m+g,S+y).normalize();else if(e===Ml)n[5].setComponents(a,h,g,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Jr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),Jr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Jr)}intersectsSprite(t){return Jr.center.set(0,0,0),Jr.radius=.7071067811865476,Jr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Jr)}intersectsSphere(t){let e=this.planes,n=t.center,i=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(n)<i)return!1;return!0}intersectsBox(t){let e=this.planes;for(let n=0;n<6;n++){let i=e[n];if(ul.x=i.normal.x>0?t.max.x:t.min.x,ul.y=i.normal.y>0?t.max.y:t.min.y,ul.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(ul)<0)return!1}return!0}containsPoint(t){let e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function sg(){let r=null,t=!1,e=null,n=null;function i(s,o){e(s,o),n=r.requestAnimationFrame(i)}return{start:function(){t!==!0&&e!==null&&(n=r.requestAnimationFrame(i),t=!0)},stop:function(){r.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(s){e=s},setContext:function(s){r=s}}}function tv(r){let t=new WeakMap;function e(a,l){let c=a.array,u=a.usage,h=c.byteLength,f=r.createBuffer();r.bindBuffer(l,f),r.bufferData(l,c,u),a.onUploadCallback();let d;if(c instanceof Float32Array)d=r.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?d=r.HALF_FLOAT:d=r.UNSIGNED_SHORT;else if(c instanceof Int16Array)d=r.SHORT;else if(c instanceof Uint32Array)d=r.UNSIGNED_INT;else if(c instanceof Int32Array)d=r.INT;else if(c instanceof Int8Array)d=r.BYTE;else if(c instanceof Uint8Array)d=r.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)d=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:f,type:d,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:h}}function n(a,l,c){let u=l.array,h=l._updateRange,f=l.updateRanges;if(r.bindBuffer(c,a),h.count===-1&&f.length===0&&r.bufferSubData(c,0,u),f.length!==0){for(let d=0,_=f.length;d<_;d++){let g=f[d];r.bufferSubData(c,g.start*u.BYTES_PER_ELEMENT,u,g.start,g.count)}l.clearUpdateRanges()}h.count!==-1&&(r.bufferSubData(c,h.offset*u.BYTES_PER_ELEMENT,u,h.offset,h.count),h.count=-1),l.onUploadCallback()}function i(a){return a.isInterleavedBufferAttribute&&(a=a.data),t.get(a)}function s(a){a.isInterleavedBufferAttribute&&(a=a.data);let l=t.get(a);l&&(r.deleteBuffer(l.buffer),t.delete(a))}function o(a,l){if(a.isGLBufferAttribute){let u=t.get(a);(!u||u.version<a.version)&&t.set(a,{buffer:a.buffer,type:a.type,bytesPerElement:a.elementSize,version:a.version});return}a.isInterleavedBufferAttribute&&(a=a.data);let c=t.get(a);if(c===void 0)t.set(a,e(a,l));else if(c.version<a.version){if(c.size!==a.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(c.buffer,a,l),c.version=a.version}}return{get:i,remove:s,update:o}}var Ll=class r extends Mi{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};let s=t/2,o=e/2,a=Math.floor(n),l=Math.floor(i),c=a+1,u=l+1,h=t/a,f=e/l,d=[],_=[],g=[],m=[];for(let p=0;p<u;p++){let b=p*f-o;for(let y=0;y<c;y++){let S=y*h-s;_.push(S,-b,0),g.push(0,0,1),m.push(y/a),m.push(1-p/l)}}for(let p=0;p<l;p++)for(let b=0;b<a;b++){let y=b+c*p,S=b+c*(p+1),D=b+1+c*(p+1),A=b+1+c*p;d.push(y,S,A),d.push(S,D,A)}this.setIndex(d),this.setAttribute("position",new Jn(_,3)),this.setAttribute("normal",new Jn(g,3)),this.setAttribute("uv",new Jn(m,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r(t.width,t.height,t.widthSegments,t.heightSegments)}},ev=`#ifdef USE_ALPHAHASH
|
|
41
41
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
|
42
42
|
#endif`,nv=`#ifdef USE_ALPHAHASH
|
|
43
43
|
const float ALPHA_HASH_SCALE = 0.05;
|
|
@@ -3567,7 +3567,7 @@ void main() {
|
|
|
3567
3567
|
#include <tonemapping_fragment>
|
|
3568
3568
|
#include <colorspace_fragment>
|
|
3569
3569
|
#include <fog_fragment>
|
|
3570
|
-
}`,Kt={alphahash_fragment:ev,alphahash_pars_fragment:nv,alphamap_fragment:iv,alphamap_pars_fragment:rv,alphatest_fragment:sv,alphatest_pars_fragment:ov,aomap_fragment:av,aomap_pars_fragment:lv,batching_pars_vertex:cv,batching_vertex:uv,begin_vertex:hv,beginnormal_vertex:fv,bsdfs:dv,iridescence_fragment:pv,bumpmap_pars_fragment:mv,clipping_planes_fragment:gv,clipping_planes_pars_fragment:_v,clipping_planes_pars_vertex:xv,clipping_planes_vertex:vv,color_fragment:yv,color_pars_fragment:Sv,color_pars_vertex:Mv,color_vertex:bv,common:wv,cube_uv_reflection_fragment:Ev,defaultnormal_vertex:Tv,displacementmap_pars_vertex:Av,displacementmap_vertex:Dv,emissivemap_fragment:Cv,emissivemap_pars_fragment:Rv,colorspace_fragment:Pv,colorspace_pars_fragment:Iv,envmap_fragment:Lv,envmap_common_pars_fragment:Fv,envmap_pars_fragment:Nv,envmap_pars_vertex:Uv,envmap_physical_pars_fragment:Yv,envmap_vertex:Ov,fog_vertex:Bv,fog_pars_vertex:zv,fog_fragment:kv,fog_pars_fragment:Vv,gradientmap_pars_fragment:Hv,lightmap_pars_fragment:Gv,lights_lambert_fragment:Wv,lights_lambert_pars_fragment:Xv,lights_pars_begin:qv,lights_toon_fragment:Zv,lights_toon_pars_fragment:Jv,lights_phong_fragment:$v,lights_phong_pars_fragment:Kv,lights_physical_fragment:jv,lights_physical_pars_fragment:Qv,lights_fragment_begin:ty,lights_fragment_maps:ey,lights_fragment_end:ny,logdepthbuf_fragment:iy,logdepthbuf_pars_fragment:ry,logdepthbuf_pars_vertex:sy,logdepthbuf_vertex:oy,map_fragment:ay,map_pars_fragment:ly,map_particle_fragment:cy,map_particle_pars_fragment:uy,metalnessmap_fragment:hy,metalnessmap_pars_fragment:fy,morphinstance_vertex:dy,morphcolor_vertex:py,morphnormal_vertex:my,morphtarget_pars_vertex:gy,morphtarget_vertex:_y,normal_fragment_begin:xy,normal_fragment_maps:vy,normal_pars_fragment:yy,normal_pars_vertex:Sy,normal_vertex:My,normalmap_pars_fragment:by,clearcoat_normal_fragment_begin:wy,clearcoat_normal_fragment_maps:Ey,clearcoat_pars_fragment:Ty,iridescence_pars_fragment:Ay,opaque_fragment:Dy,packing:Cy,premultiplied_alpha_fragment:Ry,project_vertex:Py,dithering_fragment:Iy,dithering_pars_fragment:Ly,roughnessmap_fragment:Fy,roughnessmap_pars_fragment:Ny,shadowmap_pars_fragment:Uy,shadowmap_pars_vertex:Oy,shadowmap_vertex:By,shadowmask_pars_fragment:zy,skinbase_vertex:ky,skinning_pars_vertex:Vy,skinning_vertex:Hy,skinnormal_vertex:Gy,specularmap_fragment:Wy,specularmap_pars_fragment:Xy,tonemapping_fragment:qy,tonemapping_pars_fragment:Yy,transmission_fragment:Zy,transmission_pars_fragment:Jy,uv_pars_fragment:$y,uv_pars_vertex:Ky,uv_vertex:jy,worldpos_vertex:Qy,background_vert:tS,background_frag:eS,backgroundCube_vert:nS,backgroundCube_frag:iS,cube_vert:rS,cube_frag:sS,depth_vert:oS,depth_frag:aS,distanceRGBA_vert:lS,distanceRGBA_frag:cS,equirect_vert:uS,equirect_frag:hS,linedashed_vert:fS,linedashed_frag:dS,meshbasic_vert:pS,meshbasic_frag:mS,meshlambert_vert:gS,meshlambert_frag:_S,meshmatcap_vert:xS,meshmatcap_frag:vS,meshnormal_vert:yS,meshnormal_frag:SS,meshphong_vert:MS,meshphong_frag:bS,meshphysical_vert:wS,meshphysical_frag:ES,meshtoon_vert:TS,meshtoon_frag:AS,points_vert:DS,points_frag:CS,shadow_vert:RS,shadow_frag:PS,sprite_vert:IS,sprite_frag:LS},_t={common:{diffuse:{value:new ce(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new jt},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new jt}},envmap:{envMap:{value:null},envMapRotation:{value:new jt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new jt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new jt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new jt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new jt},normalScale:{value:new ue(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new jt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new jt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new jt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new jt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ce(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ce(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0},uvTransform:{value:new jt}},sprite:{diffuse:{value:new ce(16777215)},opacity:{value:1},center:{value:new ue(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new jt},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0}}},yi={basic:{uniforms:yn([_t.common,_t.specularmap,_t.envmap,_t.aomap,_t.lightmap,_t.fog]),vertexShader:Kt.meshbasic_vert,fragmentShader:Kt.meshbasic_frag},lambert:{uniforms:yn([_t.common,_t.specularmap,_t.envmap,_t.aomap,_t.lightmap,_t.emissivemap,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.fog,_t.lights,{emissive:{value:new ce(0)}}]),vertexShader:Kt.meshlambert_vert,fragmentShader:Kt.meshlambert_frag},phong:{uniforms:yn([_t.common,_t.specularmap,_t.envmap,_t.aomap,_t.lightmap,_t.emissivemap,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.fog,_t.lights,{emissive:{value:new ce(0)},specular:{value:new ce(1118481)},shininess:{value:30}}]),vertexShader:Kt.meshphong_vert,fragmentShader:Kt.meshphong_frag},standard:{uniforms:yn([_t.common,_t.envmap,_t.aomap,_t.lightmap,_t.emissivemap,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.roughnessmap,_t.metalnessmap,_t.fog,_t.lights,{emissive:{value:new ce(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Kt.meshphysical_vert,fragmentShader:Kt.meshphysical_frag},toon:{uniforms:yn([_t.common,_t.aomap,_t.lightmap,_t.emissivemap,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.gradientmap,_t.fog,_t.lights,{emissive:{value:new ce(0)}}]),vertexShader:Kt.meshtoon_vert,fragmentShader:Kt.meshtoon_frag},matcap:{uniforms:yn([_t.common,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.fog,{matcap:{value:null}}]),vertexShader:Kt.meshmatcap_vert,fragmentShader:Kt.meshmatcap_frag},points:{uniforms:yn([_t.points,_t.fog]),vertexShader:Kt.points_vert,fragmentShader:Kt.points_frag},dashed:{uniforms:yn([_t.common,_t.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Kt.linedashed_vert,fragmentShader:Kt.linedashed_frag},depth:{uniforms:yn([_t.common,_t.displacementmap]),vertexShader:Kt.depth_vert,fragmentShader:Kt.depth_frag},normal:{uniforms:yn([_t.common,_t.bumpmap,_t.normalmap,_t.displacementmap,{opacity:{value:1}}]),vertexShader:Kt.meshnormal_vert,fragmentShader:Kt.meshnormal_frag},sprite:{uniforms:yn([_t.sprite,_t.fog]),vertexShader:Kt.sprite_vert,fragmentShader:Kt.sprite_frag},background:{uniforms:{uvTransform:{value:new jt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Kt.background_vert,fragmentShader:Kt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new jt}},vertexShader:Kt.backgroundCube_vert,fragmentShader:Kt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Kt.cube_vert,fragmentShader:Kt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Kt.equirect_vert,fragmentShader:Kt.equirect_frag},distanceRGBA:{uniforms:yn([_t.common,_t.displacementmap,{referencePosition:{value:new j},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Kt.distanceRGBA_vert,fragmentShader:Kt.distanceRGBA_frag},shadow:{uniforms:yn([_t.lights,_t.fog,{color:{value:new ce(0)},opacity:{value:1}}]),vertexShader:Kt.shadow_vert,fragmentShader:Kt.shadow_frag}};yi.physical={uniforms:yn([yi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new jt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new jt},clearcoatNormalScale:{value:new ue(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new jt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new jt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new jt},sheen:{value:0},sheenColor:{value:new ce(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new jt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new jt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new jt},transmissionSamplerSize:{value:new ue},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new jt},attenuationDistance:{value:0},attenuationColor:{value:new ce(0)},specularColor:{value:new ce(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new jt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new jt},anisotropyVector:{value:new ue},anisotropyMap:{value:null},anisotropyMapTransform:{value:new jt}}]),vertexShader:Kt.meshphysical_vert,fragmentShader:Kt.meshphysical_frag};var hl={r:0,b:0,g:0},$r=new Wi,FS=new Le;function NS(r,t,e,n,i,s,o){let a=new ce(0),l=s===!0?0:1,c,u,f=null,h=0,d=null;function _(b){let S=b.isScene===!0?b.background:null;return S&&S.isTexture&&(S=(b.backgroundBlurriness>0?e:t).get(S)),S}function g(b){let S=!1,y=_(b);y===null?m(a,l):y&&y.isColor&&(m(y,1),S=!0);let D=r.xr.getEnvironmentBlendMode();D==="additive"?n.buffers.color.setClear(0,0,0,1,o):D==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||S)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil)}function p(b,S){let y=_(S);y&&(y.isCubeTexture||y.mapping===Gl)?(u===void 0&&(u=new ai(new Zo(1,1,1),new Kn({name:"BackgroundCubeMaterial",uniforms:no(yi.backgroundCube.uniforms),vertexShader:yi.backgroundCube.vertexShader,fragmentShader:yi.backgroundCube.fragmentShader,side:Cn,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(D,A,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),$r.copy(S.backgroundRotation),$r.x*=-1,$r.y*=-1,$r.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&($r.y*=-1,$r.z*=-1),u.material.uniforms.envMap.value=y,u.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(FS.makeRotationFromEuler($r)),u.material.toneMapped=me.getTransfer(y.colorSpace)!==ye,(f!==y||h!==y.version||d!==r.toneMapping)&&(u.material.needsUpdate=!0,f=y,h=y.version,d=r.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):y&&y.isTexture&&(c===void 0&&(c=new ai(new Ll(2,2),new Kn({name:"BackgroundMaterial",uniforms:no(yi.background.uniforms),vertexShader:yi.background.vertexShader,fragmentShader:yi.background.fragmentShader,side:gr,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=y,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.toneMapped=me.getTransfer(y.colorSpace)!==ye,y.matrixAutoUpdate===!0&&y.updateMatrix(),c.material.uniforms.uvTransform.value.copy(y.matrix),(f!==y||h!==y.version||d!==r.toneMapping)&&(c.material.needsUpdate=!0,f=y,h=y.version,d=r.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function m(b,S){b.getRGB(hl,rg(r)),n.buffers.color.setClear(hl.r,hl.g,hl.b,S,o)}return{getClearColor:function(){return a},setClearColor:function(b,S=1){a.set(b),l=S,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,m(a,l)},render:g,addToRenderList:p}}function US(r,t){let e=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=h(null),s=i,o=!1;function a(v,N,F,R,B){let Y=!1,H=f(R,F,N);s!==H&&(s=H,c(s.object)),Y=d(v,R,F,B),Y&&_(v,R,F,B),B!==null&&t.update(B,r.ELEMENT_ARRAY_BUFFER),(Y||o)&&(o=!1,y(v,N,F,R),B!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(B).buffer))}function l(){return r.createVertexArray()}function c(v){return r.bindVertexArray(v)}function u(v){return r.deleteVertexArray(v)}function f(v,N,F){let R=F.wireframe===!0,B=n[v.id];B===void 0&&(B={},n[v.id]=B);let Y=B[N.id];Y===void 0&&(Y={},B[N.id]=Y);let H=Y[R];return H===void 0&&(H=h(l()),Y[R]=H),H}function h(v){let N=[],F=[],R=[];for(let B=0;B<e;B++)N[B]=0,F[B]=0,R[B]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:N,enabledAttributes:F,attributeDivisors:R,object:v,attributes:{},index:null}}function d(v,N,F,R){let B=s.attributes,Y=N.attributes,H=0,J=F.getAttributes();for(let O in J)if(J[O].location>=0){let C=B[O],ot=Y[O];if(ot===void 0&&(O==="instanceMatrix"&&v.instanceMatrix&&(ot=v.instanceMatrix),O==="instanceColor"&&v.instanceColor&&(ot=v.instanceColor)),C===void 0||C.attribute!==ot||ot&&C.data!==ot.data)return!0;H++}return s.attributesNum!==H||s.index!==R}function _(v,N,F,R){let B={},Y=N.attributes,H=0,J=F.getAttributes();for(let O in J)if(J[O].location>=0){let C=Y[O];C===void 0&&(O==="instanceMatrix"&&v.instanceMatrix&&(C=v.instanceMatrix),O==="instanceColor"&&v.instanceColor&&(C=v.instanceColor));let ot={};ot.attribute=C,C&&C.data&&(ot.data=C.data),B[O]=ot,H++}s.attributes=B,s.attributesNum=H,s.index=R}function g(){let v=s.newAttributes;for(let N=0,F=v.length;N<F;N++)v[N]=0}function p(v){m(v,0)}function m(v,N){let F=s.newAttributes,R=s.enabledAttributes,B=s.attributeDivisors;F[v]=1,R[v]===0&&(r.enableVertexAttribArray(v),R[v]=1),B[v]!==N&&(r.vertexAttribDivisor(v,N),B[v]=N)}function b(){let v=s.newAttributes,N=s.enabledAttributes;for(let F=0,R=N.length;F<R;F++)N[F]!==v[F]&&(r.disableVertexAttribArray(F),N[F]=0)}function S(v,N,F,R,B,Y,H){H===!0?r.vertexAttribIPointer(v,N,F,B,Y):r.vertexAttribPointer(v,N,F,R,B,Y)}function y(v,N,F,R){g();let B=R.attributes,Y=F.getAttributes(),H=N.defaultAttributeValues;for(let J in Y){let O=Y[J];if(O.location>=0){let L=B[J];if(L===void 0&&(J==="instanceMatrix"&&v.instanceMatrix&&(L=v.instanceMatrix),J==="instanceColor"&&v.instanceColor&&(L=v.instanceColor)),L!==void 0){let C=L.normalized,ot=L.itemSize,vt=t.get(L);if(vt===void 0)continue;let Wt=vt.buffer,q=vt.type,tt=vt.bytesPerElement,pt=q===r.INT||q===r.UNSIGNED_INT||L.gpuType===Jm;if(L.isInterleavedBufferAttribute){let st=L.data,Ft=st.stride,Nt=L.offset;if(st.isInstancedInterleavedBuffer){for(let V=0;V<O.locationSize;V++)m(O.location+V,st.meshPerAttribute);v.isInstancedMesh!==!0&&R._maxInstanceCount===void 0&&(R._maxInstanceCount=st.meshPerAttribute*st.count)}else for(let V=0;V<O.locationSize;V++)p(O.location+V);r.bindBuffer(r.ARRAY_BUFFER,Wt);for(let V=0;V<O.locationSize;V++)S(O.location+V,ot/O.locationSize,q,C,Ft*tt,(Nt+ot/O.locationSize*V)*tt,pt)}else{if(L.isInstancedBufferAttribute){for(let st=0;st<O.locationSize;st++)m(O.location+st,L.meshPerAttribute);v.isInstancedMesh!==!0&&R._maxInstanceCount===void 0&&(R._maxInstanceCount=L.meshPerAttribute*L.count)}else for(let st=0;st<O.locationSize;st++)p(O.location+st);r.bindBuffer(r.ARRAY_BUFFER,Wt);for(let st=0;st<O.locationSize;st++)S(O.location+st,ot/O.locationSize,q,C,ot*tt,ot/O.locationSize*st*tt,pt)}}else if(H!==void 0){let C=H[J];if(C!==void 0)switch(C.length){case 2:r.vertexAttrib2fv(O.location,C);break;case 3:r.vertexAttrib3fv(O.location,C);break;case 4:r.vertexAttrib4fv(O.location,C);break;default:r.vertexAttrib1fv(O.location,C)}}}}b()}function D(){P();for(let v in n){let N=n[v];for(let F in N){let R=N[F];for(let B in R)u(R[B].object),delete R[B];delete N[F]}delete n[v]}}function A(v){if(n[v.id]===void 0)return;let N=n[v.id];for(let F in N){let R=N[F];for(let B in R)u(R[B].object),delete R[B];delete N[F]}delete n[v.id]}function w(v){for(let N in n){let F=n[N];if(F[v.id]===void 0)continue;let R=F[v.id];for(let B in R)u(R[B].object),delete R[B];delete F[v.id]}}function P(){M(),o=!0,s!==i&&(s=i,c(s.object))}function M(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:a,reset:P,resetDefaultState:M,dispose:D,releaseStatesOfGeometry:A,releaseStatesOfProgram:w,initAttributes:g,enableAttribute:p,disableUnusedAttributes:b}}function OS(r,t,e){let n;function i(c){n=c}function s(c,u){r.drawArrays(n,c,u),e.update(u,n,1)}function o(c,u,f){f!==0&&(r.drawArraysInstanced(n,c,u,f),e.update(u,n,f))}function a(c,u,f){if(f===0)return;let h=t.get("WEBGL_multi_draw");if(h===null)for(let d=0;d<f;d++)this.render(c[d],u[d]);else{h.multiDrawArraysWEBGL(n,c,0,u,0,f);let d=0;for(let _=0;_<f;_++)d+=u[_];e.update(d,n,1)}}function l(c,u,f,h){if(f===0)return;let d=t.get("WEBGL_multi_draw");if(d===null)for(let _=0;_<c.length;_++)o(c[_],u[_],h[_]);else{d.multiDrawArraysInstancedWEBGL(n,c,0,u,0,h,0,f);let _=0;for(let g=0;g<f;g++)_+=u[g];for(let g=0;g<h.length;g++)e.update(_,n,h[g])}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=l}function BS(r,t,e,n){let i;function s(){if(i!==void 0)return i;if(t.has("EXT_texture_filter_anisotropic")===!0){let A=t.get("EXT_texture_filter_anisotropic");i=r.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(A){return!(A!==Si&&n.convert(A)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(A){let w=A===Wl&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(A!==_r&&n.convert(A)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&A!==hr&&!w)}function l(A){if(A==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp",u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);let f=e.logarithmicDepthBuffer===!0,h=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),d=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),g=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),p=r.getParameter(r.MAX_VERTEX_ATTRIBS),m=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),b=r.getParameter(r.MAX_VARYING_VECTORS),S=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),y=d>0,D=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,maxTextures:h,maxVertexTextures:d,maxTextureSize:_,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:m,maxVaryings:b,maxFragmentUniforms:S,vertexTextures:y,maxSamples:D}}function zS(r){let t=this,e=null,n=0,i=!1,s=!1,o=new ki,a=new jt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){let d=f.length!==0||h||n!==0||i;return i=h,n=f.length,d},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,h){e=u(f,h,0)},this.setState=function(f,h,d){let _=f.clippingPlanes,g=f.clipIntersection,p=f.clipShadows,m=r.get(f);if(!i||_===null||_.length===0||s&&!p)s?u(null):c();else{let b=s?0:n,S=b*4,y=m.clippingState||null;l.value=y,y=u(_,h,S,d);for(let D=0;D!==S;++D)y[D]=e[D];m.clippingState=y,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=b}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function u(f,h,d,_){let g=f!==null?f.length:0,p=null;if(g!==0){if(p=l.value,_!==!0||p===null){let m=d+g*4,b=h.matrixWorldInverse;a.getNormalMatrix(b),(p===null||p.length<m)&&(p=new Float32Array(m));for(let S=0,y=d;S!==g;++S,y+=4)o.copy(f[S]).applyMatrix4(b,a),o.normal.toArray(p,y),p[y+3]=o.constant}l.value=p,l.needsUpdate=!0}return t.numPlanes=g,t.numIntersection=0,p}}function kS(r){let t=new WeakMap;function e(o,a){return a===Qu?o.mapping=js:a===th&&(o.mapping=Qs),o}function n(o){if(o&&o.isTexture){let a=o.mapping;if(a===Qu||a===th)if(t.has(o)){let l=t.get(o).texture;return e(l,o.mapping)}else{let l=o.image;if(l&&l.height>0){let c=new lh(l.height);return c.fromEquirectangularTexture(r,o),t.set(o,c),o.addEventListener("dispose",i),e(c.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=t.get(a);l!==void 0&&(t.delete(a),l.dispose())}function s(){t=new WeakMap}return{get:n,dispose:s}}var Fl=class extends Pl{constructor(t=-1,e=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-t,o=n+t,a=i+e,l=i-e;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}},Zs=4,ym=[.125,.215,.35,.446,.526,.582],ts=20,Wu=new Fl,Sm=new ce,Xu=null,qu=0,Yu=0,Zu=!1,jr=(1+Math.sqrt(5))/2,qs=1/jr,Mm=[new j(-jr,qs,0),new j(jr,qs,0),new j(-qs,0,jr),new j(qs,0,jr),new j(0,jr,-qs),new j(0,jr,qs),new j(-1,1,-1),new j(1,1,-1),new j(-1,1,1),new j(1,1,1)],Nl=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){Xu=this._renderer.getRenderTarget(),qu=this._renderer.getActiveCubeFace(),Yu=this._renderer.getActiveMipmapLevel(),Zu=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,n,i,s),e>0&&this._blur(s,0,0,e),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Em(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=wm(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Xu,qu,Yu),this._renderer.xr.enabled=Zu,t.scissorTest=!1,fl(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===js||t.mapping===Qs?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Xu=this._renderer.getRenderTarget(),qu=this._renderer.getActiveCubeFace(),Yu=this._renderer.getActiveMipmapLevel(),Zu=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:oi,minFilter:oi,generateMipmaps:!1,type:Wl,format:Si,colorSpace:yr,depthBuffer:!1},i=bm(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=bm(t,e,n);let{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=VS(s)),this._blurMaterial=HS(s,t,e)}return i}_compileMaterial(t){let e=new ai(this._lodPlanes[0],t);this._renderer.compile(e,Wu)}_sceneToCubeUV(t,e,n,i){let a=new Sn(90,1,e,n),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],u=this._renderer,f=u.autoClear,h=u.toneMapping;u.getClearColor(Sm),u.toneMapping=mr,u.autoClear=!1;let d=new Dl({name:"PMREM.Background",side:Cn,depthWrite:!1,depthTest:!1}),_=new ai(new Zo,d),g=!1,p=t.background;p?p.isColor&&(d.color.copy(p),t.background=null,g=!0):(d.color.copy(Sm),g=!0);for(let m=0;m<6;m++){let b=m%3;b===0?(a.up.set(0,l[m],0),a.lookAt(c[m],0,0)):b===1?(a.up.set(0,0,l[m]),a.lookAt(0,c[m],0)):(a.up.set(0,l[m],0),a.lookAt(0,0,c[m]));let S=this._cubeSize;fl(i,b*S,m>2?S:0,S,S),u.setRenderTarget(i),g&&u.render(_,a),u.render(t,a)}_.geometry.dispose(),_.material.dispose(),u.toneMapping=h,u.autoClear=f,t.background=p}_textureToCubeUV(t,e){let n=this._renderer,i=t.mapping===js||t.mapping===Qs;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=Em()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=wm());let s=i?this._cubemapMaterial:this._equirectMaterial,o=new ai(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=t;let l=this._cubeSize;fl(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(o,Wu)}_applyPMREM(t){let e=this._renderer,n=e.autoClear;e.autoClear=!1;let i=this._lodPlanes.length;for(let s=1;s<i;s++){let o=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),a=Mm[(i-s-1)%Mm.length];this._blur(t,s-1,s,o,a)}e.autoClear=n}_blur(t,e,n,i,s){let o=this._pingPongRenderTarget;this._halfBlur(t,o,e,n,i,"latitudinal",s),this._halfBlur(o,t,n,n,i,"longitudinal",s)}_halfBlur(t,e,n,i,s,o,a){let l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let u=3,f=new ai(this._lodPlanes[i],c),h=c.uniforms,d=this._sizeLods[n]-1,_=isFinite(s)?Math.PI/(2*d):2*Math.PI/(2*ts-1),g=s/_,p=isFinite(s)?1+Math.floor(u*g):ts;p>ts&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${p} samples when the maximum is set to ${ts}`);let m=[],b=0;for(let w=0;w<ts;++w){let P=w/g,M=Math.exp(-P*P/2);m.push(M),w===0?b+=M:w<p&&(b+=2*M)}for(let w=0;w<m.length;w++)m[w]=m[w]/b;h.envMap.value=t.texture,h.samples.value=p,h.weights.value=m,h.latitudinal.value=o==="latitudinal",a&&(h.poleAxis.value=a);let{_lodMax:S}=this;h.dTheta.value=_,h.mipInt.value=S-n;let y=this._sizeLods[i],D=3*y*(i>S-Zs?i-S+Zs:0),A=4*(this._cubeSize-y);fl(e,D,A,3*y,2*y),l.setRenderTarget(e),l.render(f,Wu)}};function VS(r){let t=[],e=[],n=[],i=r,s=r-Zs+1+ym.length;for(let o=0;o<s;o++){let a=Math.pow(2,i);e.push(a);let l=1/a;o>r-Zs?l=ym[o-r+Zs-1]:o===0&&(l=0),n.push(l);let c=1/(a-2),u=-c,f=1+c,h=[u,u,f,u,f,f,u,u,f,f,u,f],d=6,_=6,g=3,p=2,m=1,b=new Float32Array(g*_*d),S=new Float32Array(p*_*d),y=new Float32Array(m*_*d);for(let A=0;A<d;A++){let w=A%3*2/3-1,P=A>2?0:-1,M=[w,P,0,w+2/3,P,0,w+2/3,P+1,0,w,P,0,w+2/3,P+1,0,w,P+1,0];b.set(M,g*_*A),S.set(h,p*_*A);let v=[A,A,A,A,A,A];y.set(v,m*_*A)}let D=new Mi;D.setAttribute("position",new Zn(b,g)),D.setAttribute("uv",new Zn(S,p)),D.setAttribute("faceIndex",new Zn(y,m)),t.push(D),i>Zs&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function bm(r,t,e){let n=new Gi(r,t,e);return n.texture.mapping=Gl,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function fl(r,t,e,n,i){r.viewport.set(t,e,n,i),r.scissor.set(t,e,n,i)}function HS(r,t,e){let n=new Float32Array(ts),i=new j(0,1,0);return new Kn({name:"SphericalGaussianBlur",defines:{n:ts,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Oh(),fragmentShader:`
|
|
3570
|
+
}`,Kt={alphahash_fragment:ev,alphahash_pars_fragment:nv,alphamap_fragment:iv,alphamap_pars_fragment:rv,alphatest_fragment:sv,alphatest_pars_fragment:ov,aomap_fragment:av,aomap_pars_fragment:lv,batching_pars_vertex:cv,batching_vertex:uv,begin_vertex:hv,beginnormal_vertex:fv,bsdfs:dv,iridescence_fragment:pv,bumpmap_pars_fragment:mv,clipping_planes_fragment:gv,clipping_planes_pars_fragment:_v,clipping_planes_pars_vertex:xv,clipping_planes_vertex:vv,color_fragment:yv,color_pars_fragment:Sv,color_pars_vertex:Mv,color_vertex:bv,common:wv,cube_uv_reflection_fragment:Ev,defaultnormal_vertex:Tv,displacementmap_pars_vertex:Av,displacementmap_vertex:Dv,emissivemap_fragment:Cv,emissivemap_pars_fragment:Rv,colorspace_fragment:Pv,colorspace_pars_fragment:Iv,envmap_fragment:Lv,envmap_common_pars_fragment:Fv,envmap_pars_fragment:Nv,envmap_pars_vertex:Uv,envmap_physical_pars_fragment:Yv,envmap_vertex:Ov,fog_vertex:Bv,fog_pars_vertex:zv,fog_fragment:kv,fog_pars_fragment:Vv,gradientmap_pars_fragment:Hv,lightmap_pars_fragment:Gv,lights_lambert_fragment:Wv,lights_lambert_pars_fragment:Xv,lights_pars_begin:qv,lights_toon_fragment:Zv,lights_toon_pars_fragment:Jv,lights_phong_fragment:$v,lights_phong_pars_fragment:Kv,lights_physical_fragment:jv,lights_physical_pars_fragment:Qv,lights_fragment_begin:ty,lights_fragment_maps:ey,lights_fragment_end:ny,logdepthbuf_fragment:iy,logdepthbuf_pars_fragment:ry,logdepthbuf_pars_vertex:sy,logdepthbuf_vertex:oy,map_fragment:ay,map_pars_fragment:ly,map_particle_fragment:cy,map_particle_pars_fragment:uy,metalnessmap_fragment:hy,metalnessmap_pars_fragment:fy,morphinstance_vertex:dy,morphcolor_vertex:py,morphnormal_vertex:my,morphtarget_pars_vertex:gy,morphtarget_vertex:_y,normal_fragment_begin:xy,normal_fragment_maps:vy,normal_pars_fragment:yy,normal_pars_vertex:Sy,normal_vertex:My,normalmap_pars_fragment:by,clearcoat_normal_fragment_begin:wy,clearcoat_normal_fragment_maps:Ey,clearcoat_pars_fragment:Ty,iridescence_pars_fragment:Ay,opaque_fragment:Dy,packing:Cy,premultiplied_alpha_fragment:Ry,project_vertex:Py,dithering_fragment:Iy,dithering_pars_fragment:Ly,roughnessmap_fragment:Fy,roughnessmap_pars_fragment:Ny,shadowmap_pars_fragment:Uy,shadowmap_pars_vertex:Oy,shadowmap_vertex:By,shadowmask_pars_fragment:zy,skinbase_vertex:ky,skinning_pars_vertex:Vy,skinning_vertex:Hy,skinnormal_vertex:Gy,specularmap_fragment:Wy,specularmap_pars_fragment:Xy,tonemapping_fragment:qy,tonemapping_pars_fragment:Yy,transmission_fragment:Zy,transmission_pars_fragment:Jy,uv_pars_fragment:$y,uv_pars_vertex:Ky,uv_vertex:jy,worldpos_vertex:Qy,background_vert:tS,background_frag:eS,backgroundCube_vert:nS,backgroundCube_frag:iS,cube_vert:rS,cube_frag:sS,depth_vert:oS,depth_frag:aS,distanceRGBA_vert:lS,distanceRGBA_frag:cS,equirect_vert:uS,equirect_frag:hS,linedashed_vert:fS,linedashed_frag:dS,meshbasic_vert:pS,meshbasic_frag:mS,meshlambert_vert:gS,meshlambert_frag:_S,meshmatcap_vert:xS,meshmatcap_frag:vS,meshnormal_vert:yS,meshnormal_frag:SS,meshphong_vert:MS,meshphong_frag:bS,meshphysical_vert:wS,meshphysical_frag:ES,meshtoon_vert:TS,meshtoon_frag:AS,points_vert:DS,points_frag:CS,shadow_vert:RS,shadow_frag:PS,sprite_vert:IS,sprite_frag:LS},_t={common:{diffuse:{value:new ce(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new jt},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new jt}},envmap:{envMap:{value:null},envMapRotation:{value:new jt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new jt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new jt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new jt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new jt},normalScale:{value:new ue(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new jt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new jt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new jt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new jt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ce(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ce(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0},uvTransform:{value:new jt}},sprite:{diffuse:{value:new ce(16777215)},opacity:{value:1},center:{value:new ue(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new jt},alphaMap:{value:null},alphaMapTransform:{value:new jt},alphaTest:{value:0}}},yi={basic:{uniforms:yn([_t.common,_t.specularmap,_t.envmap,_t.aomap,_t.lightmap,_t.fog]),vertexShader:Kt.meshbasic_vert,fragmentShader:Kt.meshbasic_frag},lambert:{uniforms:yn([_t.common,_t.specularmap,_t.envmap,_t.aomap,_t.lightmap,_t.emissivemap,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.fog,_t.lights,{emissive:{value:new ce(0)}}]),vertexShader:Kt.meshlambert_vert,fragmentShader:Kt.meshlambert_frag},phong:{uniforms:yn([_t.common,_t.specularmap,_t.envmap,_t.aomap,_t.lightmap,_t.emissivemap,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.fog,_t.lights,{emissive:{value:new ce(0)},specular:{value:new ce(1118481)},shininess:{value:30}}]),vertexShader:Kt.meshphong_vert,fragmentShader:Kt.meshphong_frag},standard:{uniforms:yn([_t.common,_t.envmap,_t.aomap,_t.lightmap,_t.emissivemap,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.roughnessmap,_t.metalnessmap,_t.fog,_t.lights,{emissive:{value:new ce(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Kt.meshphysical_vert,fragmentShader:Kt.meshphysical_frag},toon:{uniforms:yn([_t.common,_t.aomap,_t.lightmap,_t.emissivemap,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.gradientmap,_t.fog,_t.lights,{emissive:{value:new ce(0)}}]),vertexShader:Kt.meshtoon_vert,fragmentShader:Kt.meshtoon_frag},matcap:{uniforms:yn([_t.common,_t.bumpmap,_t.normalmap,_t.displacementmap,_t.fog,{matcap:{value:null}}]),vertexShader:Kt.meshmatcap_vert,fragmentShader:Kt.meshmatcap_frag},points:{uniforms:yn([_t.points,_t.fog]),vertexShader:Kt.points_vert,fragmentShader:Kt.points_frag},dashed:{uniforms:yn([_t.common,_t.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Kt.linedashed_vert,fragmentShader:Kt.linedashed_frag},depth:{uniforms:yn([_t.common,_t.displacementmap]),vertexShader:Kt.depth_vert,fragmentShader:Kt.depth_frag},normal:{uniforms:yn([_t.common,_t.bumpmap,_t.normalmap,_t.displacementmap,{opacity:{value:1}}]),vertexShader:Kt.meshnormal_vert,fragmentShader:Kt.meshnormal_frag},sprite:{uniforms:yn([_t.sprite,_t.fog]),vertexShader:Kt.sprite_vert,fragmentShader:Kt.sprite_frag},background:{uniforms:{uvTransform:{value:new jt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Kt.background_vert,fragmentShader:Kt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new jt}},vertexShader:Kt.backgroundCube_vert,fragmentShader:Kt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Kt.cube_vert,fragmentShader:Kt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Kt.equirect_vert,fragmentShader:Kt.equirect_frag},distanceRGBA:{uniforms:yn([_t.common,_t.displacementmap,{referencePosition:{value:new j},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Kt.distanceRGBA_vert,fragmentShader:Kt.distanceRGBA_frag},shadow:{uniforms:yn([_t.lights,_t.fog,{color:{value:new ce(0)},opacity:{value:1}}]),vertexShader:Kt.shadow_vert,fragmentShader:Kt.shadow_frag}};yi.physical={uniforms:yn([yi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new jt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new jt},clearcoatNormalScale:{value:new ue(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new jt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new jt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new jt},sheen:{value:0},sheenColor:{value:new ce(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new jt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new jt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new jt},transmissionSamplerSize:{value:new ue},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new jt},attenuationDistance:{value:0},attenuationColor:{value:new ce(0)},specularColor:{value:new ce(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new jt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new jt},anisotropyVector:{value:new ue},anisotropyMap:{value:null},anisotropyMapTransform:{value:new jt}}]),vertexShader:Kt.meshphysical_vert,fragmentShader:Kt.meshphysical_frag};var hl={r:0,b:0,g:0},$r=new Wi,FS=new Le;function NS(r,t,e,n,i,s,o){let a=new ce(0),l=s===!0?0:1,c,u,h=null,f=0,d=null;function _(b){let y=b.isScene===!0?b.background:null;return y&&y.isTexture&&(y=(b.backgroundBlurriness>0?e:t).get(y)),y}function g(b){let y=!1,S=_(b);S===null?p(a,l):S&&S.isColor&&(p(S,1),y=!0);let D=r.xr.getEnvironmentBlendMode();D==="additive"?n.buffers.color.setClear(0,0,0,1,o):D==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||y)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil)}function m(b,y){let S=_(y);S&&(S.isCubeTexture||S.mapping===Gl)?(u===void 0&&(u=new ai(new Zo(1,1,1),new Kn({name:"BackgroundCubeMaterial",uniforms:no(yi.backgroundCube.uniforms),vertexShader:yi.backgroundCube.vertexShader,fragmentShader:yi.backgroundCube.fragmentShader,side:Cn,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(D,A,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),$r.copy(y.backgroundRotation),$r.x*=-1,$r.y*=-1,$r.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&($r.y*=-1,$r.z*=-1),u.material.uniforms.envMap.value=S,u.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(FS.makeRotationFromEuler($r)),u.material.toneMapped=me.getTransfer(S.colorSpace)!==ye,(h!==S||f!==S.version||d!==r.toneMapping)&&(u.material.needsUpdate=!0,h=S,f=S.version,d=r.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):S&&S.isTexture&&(c===void 0&&(c=new ai(new Ll(2,2),new Kn({name:"BackgroundMaterial",uniforms:no(yi.background.uniforms),vertexShader:yi.background.vertexShader,fragmentShader:yi.background.fragmentShader,side:gr,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=S,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.toneMapped=me.getTransfer(S.colorSpace)!==ye,S.matrixAutoUpdate===!0&&S.updateMatrix(),c.material.uniforms.uvTransform.value.copy(S.matrix),(h!==S||f!==S.version||d!==r.toneMapping)&&(c.material.needsUpdate=!0,h=S,f=S.version,d=r.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function p(b,y){b.getRGB(hl,rg(r)),n.buffers.color.setClear(hl.r,hl.g,hl.b,y,o)}return{getClearColor:function(){return a},setClearColor:function(b,y=1){a.set(b),l=y,p(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,p(a,l)},render:g,addToRenderList:m}}function US(r,t){let e=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=f(null),s=i,o=!1;function a(v,N,F,R,B){let Y=!1,H=h(R,F,N);s!==H&&(s=H,c(s.object)),Y=d(v,R,F,B),Y&&_(v,R,F,B),B!==null&&t.update(B,r.ELEMENT_ARRAY_BUFFER),(Y||o)&&(o=!1,S(v,N,F,R),B!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(B).buffer))}function l(){return r.createVertexArray()}function c(v){return r.bindVertexArray(v)}function u(v){return r.deleteVertexArray(v)}function h(v,N,F){let R=F.wireframe===!0,B=n[v.id];B===void 0&&(B={},n[v.id]=B);let Y=B[N.id];Y===void 0&&(Y={},B[N.id]=Y);let H=Y[R];return H===void 0&&(H=f(l()),Y[R]=H),H}function f(v){let N=[],F=[],R=[];for(let B=0;B<e;B++)N[B]=0,F[B]=0,R[B]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:N,enabledAttributes:F,attributeDivisors:R,object:v,attributes:{},index:null}}function d(v,N,F,R){let B=s.attributes,Y=N.attributes,H=0,J=F.getAttributes();for(let O in J)if(J[O].location>=0){let C=B[O],ot=Y[O];if(ot===void 0&&(O==="instanceMatrix"&&v.instanceMatrix&&(ot=v.instanceMatrix),O==="instanceColor"&&v.instanceColor&&(ot=v.instanceColor)),C===void 0||C.attribute!==ot||ot&&C.data!==ot.data)return!0;H++}return s.attributesNum!==H||s.index!==R}function _(v,N,F,R){let B={},Y=N.attributes,H=0,J=F.getAttributes();for(let O in J)if(J[O].location>=0){let C=Y[O];C===void 0&&(O==="instanceMatrix"&&v.instanceMatrix&&(C=v.instanceMatrix),O==="instanceColor"&&v.instanceColor&&(C=v.instanceColor));let ot={};ot.attribute=C,C&&C.data&&(ot.data=C.data),B[O]=ot,H++}s.attributes=B,s.attributesNum=H,s.index=R}function g(){let v=s.newAttributes;for(let N=0,F=v.length;N<F;N++)v[N]=0}function m(v){p(v,0)}function p(v,N){let F=s.newAttributes,R=s.enabledAttributes,B=s.attributeDivisors;F[v]=1,R[v]===0&&(r.enableVertexAttribArray(v),R[v]=1),B[v]!==N&&(r.vertexAttribDivisor(v,N),B[v]=N)}function b(){let v=s.newAttributes,N=s.enabledAttributes;for(let F=0,R=N.length;F<R;F++)N[F]!==v[F]&&(r.disableVertexAttribArray(F),N[F]=0)}function y(v,N,F,R,B,Y,H){H===!0?r.vertexAttribIPointer(v,N,F,B,Y):r.vertexAttribPointer(v,N,F,R,B,Y)}function S(v,N,F,R){g();let B=R.attributes,Y=F.getAttributes(),H=N.defaultAttributeValues;for(let J in Y){let O=Y[J];if(O.location>=0){let L=B[J];if(L===void 0&&(J==="instanceMatrix"&&v.instanceMatrix&&(L=v.instanceMatrix),J==="instanceColor"&&v.instanceColor&&(L=v.instanceColor)),L!==void 0){let C=L.normalized,ot=L.itemSize,vt=t.get(L);if(vt===void 0)continue;let Wt=vt.buffer,q=vt.type,tt=vt.bytesPerElement,pt=q===r.INT||q===r.UNSIGNED_INT||L.gpuType===Jm;if(L.isInterleavedBufferAttribute){let st=L.data,Ft=st.stride,Nt=L.offset;if(st.isInstancedInterleavedBuffer){for(let V=0;V<O.locationSize;V++)p(O.location+V,st.meshPerAttribute);v.isInstancedMesh!==!0&&R._maxInstanceCount===void 0&&(R._maxInstanceCount=st.meshPerAttribute*st.count)}else for(let V=0;V<O.locationSize;V++)m(O.location+V);r.bindBuffer(r.ARRAY_BUFFER,Wt);for(let V=0;V<O.locationSize;V++)y(O.location+V,ot/O.locationSize,q,C,Ft*tt,(Nt+ot/O.locationSize*V)*tt,pt)}else{if(L.isInstancedBufferAttribute){for(let st=0;st<O.locationSize;st++)p(O.location+st,L.meshPerAttribute);v.isInstancedMesh!==!0&&R._maxInstanceCount===void 0&&(R._maxInstanceCount=L.meshPerAttribute*L.count)}else for(let st=0;st<O.locationSize;st++)m(O.location+st);r.bindBuffer(r.ARRAY_BUFFER,Wt);for(let st=0;st<O.locationSize;st++)y(O.location+st,ot/O.locationSize,q,C,ot*tt,ot/O.locationSize*st*tt,pt)}}else if(H!==void 0){let C=H[J];if(C!==void 0)switch(C.length){case 2:r.vertexAttrib2fv(O.location,C);break;case 3:r.vertexAttrib3fv(O.location,C);break;case 4:r.vertexAttrib4fv(O.location,C);break;default:r.vertexAttrib1fv(O.location,C)}}}}b()}function D(){P();for(let v in n){let N=n[v];for(let F in N){let R=N[F];for(let B in R)u(R[B].object),delete R[B];delete N[F]}delete n[v]}}function A(v){if(n[v.id]===void 0)return;let N=n[v.id];for(let F in N){let R=N[F];for(let B in R)u(R[B].object),delete R[B];delete N[F]}delete n[v.id]}function w(v){for(let N in n){let F=n[N];if(F[v.id]===void 0)continue;let R=F[v.id];for(let B in R)u(R[B].object),delete R[B];delete F[v.id]}}function P(){M(),o=!0,s!==i&&(s=i,c(s.object))}function M(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:a,reset:P,resetDefaultState:M,dispose:D,releaseStatesOfGeometry:A,releaseStatesOfProgram:w,initAttributes:g,enableAttribute:m,disableUnusedAttributes:b}}function OS(r,t,e){let n;function i(c){n=c}function s(c,u){r.drawArrays(n,c,u),e.update(u,n,1)}function o(c,u,h){h!==0&&(r.drawArraysInstanced(n,c,u,h),e.update(u,n,h))}function a(c,u,h){if(h===0)return;let f=t.get("WEBGL_multi_draw");if(f===null)for(let d=0;d<h;d++)this.render(c[d],u[d]);else{f.multiDrawArraysWEBGL(n,c,0,u,0,h);let d=0;for(let _=0;_<h;_++)d+=u[_];e.update(d,n,1)}}function l(c,u,h,f){if(h===0)return;let d=t.get("WEBGL_multi_draw");if(d===null)for(let _=0;_<c.length;_++)o(c[_],u[_],f[_]);else{d.multiDrawArraysInstancedWEBGL(n,c,0,u,0,f,0,h);let _=0;for(let g=0;g<h;g++)_+=u[g];for(let g=0;g<f.length;g++)e.update(_,n,f[g])}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=l}function BS(r,t,e,n){let i;function s(){if(i!==void 0)return i;if(t.has("EXT_texture_filter_anisotropic")===!0){let A=t.get("EXT_texture_filter_anisotropic");i=r.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(A){return!(A!==Si&&n.convert(A)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(A){let w=A===Wl&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(A!==_r&&n.convert(A)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&A!==hr&&!w)}function l(A){if(A==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp",u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);let h=e.logarithmicDepthBuffer===!0,f=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),d=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),g=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),m=r.getParameter(r.MAX_VERTEX_ATTRIBS),p=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),b=r.getParameter(r.MAX_VARYING_VECTORS),y=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),S=d>0,D=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:h,maxTextures:f,maxVertexTextures:d,maxTextureSize:_,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:p,maxVaryings:b,maxFragmentUniforms:y,vertexTextures:S,maxSamples:D}}function zS(r){let t=this,e=null,n=0,i=!1,s=!1,o=new ki,a=new jt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){let d=h.length!==0||f||n!==0||i;return i=f,n=h.length,d},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,f){e=u(h,f,0)},this.setState=function(h,f,d){let _=h.clippingPlanes,g=h.clipIntersection,m=h.clipShadows,p=r.get(h);if(!i||_===null||_.length===0||s&&!m)s?u(null):c();else{let b=s?0:n,y=b*4,S=p.clippingState||null;l.value=S,S=u(_,f,y,d);for(let D=0;D!==y;++D)S[D]=e[D];p.clippingState=S,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=b}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function u(h,f,d,_){let g=h!==null?h.length:0,m=null;if(g!==0){if(m=l.value,_!==!0||m===null){let p=d+g*4,b=f.matrixWorldInverse;a.getNormalMatrix(b),(m===null||m.length<p)&&(m=new Float32Array(p));for(let y=0,S=d;y!==g;++y,S+=4)o.copy(h[y]).applyMatrix4(b,a),o.normal.toArray(m,S),m[S+3]=o.constant}l.value=m,l.needsUpdate=!0}return t.numPlanes=g,t.numIntersection=0,m}}function kS(r){let t=new WeakMap;function e(o,a){return a===Qu?o.mapping=js:a===th&&(o.mapping=Qs),o}function n(o){if(o&&o.isTexture){let a=o.mapping;if(a===Qu||a===th)if(t.has(o)){let l=t.get(o).texture;return e(l,o.mapping)}else{let l=o.image;if(l&&l.height>0){let c=new lh(l.height);return c.fromEquirectangularTexture(r,o),t.set(o,c),o.addEventListener("dispose",i),e(c.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=t.get(a);l!==void 0&&(t.delete(a),l.dispose())}function s(){t=new WeakMap}return{get:n,dispose:s}}var Fl=class extends Pl{constructor(t=-1,e=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-t,o=n+t,a=i+e,l=i-e;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}},Zs=4,ym=[.125,.215,.35,.446,.526,.582],ts=20,Wu=new Fl,Sm=new ce,Xu=null,qu=0,Yu=0,Zu=!1,jr=(1+Math.sqrt(5))/2,qs=1/jr,Mm=[new j(-jr,qs,0),new j(jr,qs,0),new j(-qs,0,jr),new j(qs,0,jr),new j(0,jr,-qs),new j(0,jr,qs),new j(-1,1,-1),new j(1,1,-1),new j(-1,1,1),new j(1,1,1)],Nl=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){Xu=this._renderer.getRenderTarget(),qu=this._renderer.getActiveCubeFace(),Yu=this._renderer.getActiveMipmapLevel(),Zu=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,n,i,s),e>0&&this._blur(s,0,0,e),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Em(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=wm(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Xu,qu,Yu),this._renderer.xr.enabled=Zu,t.scissorTest=!1,fl(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===js||t.mapping===Qs?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Xu=this._renderer.getRenderTarget(),qu=this._renderer.getActiveCubeFace(),Yu=this._renderer.getActiveMipmapLevel(),Zu=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:oi,minFilter:oi,generateMipmaps:!1,type:Wl,format:Si,colorSpace:yr,depthBuffer:!1},i=bm(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=bm(t,e,n);let{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=VS(s)),this._blurMaterial=HS(s,t,e)}return i}_compileMaterial(t){let e=new ai(this._lodPlanes[0],t);this._renderer.compile(e,Wu)}_sceneToCubeUV(t,e,n,i){let a=new Sn(90,1,e,n),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],u=this._renderer,h=u.autoClear,f=u.toneMapping;u.getClearColor(Sm),u.toneMapping=mr,u.autoClear=!1;let d=new Dl({name:"PMREM.Background",side:Cn,depthWrite:!1,depthTest:!1}),_=new ai(new Zo,d),g=!1,m=t.background;m?m.isColor&&(d.color.copy(m),t.background=null,g=!0):(d.color.copy(Sm),g=!0);for(let p=0;p<6;p++){let b=p%3;b===0?(a.up.set(0,l[p],0),a.lookAt(c[p],0,0)):b===1?(a.up.set(0,0,l[p]),a.lookAt(0,c[p],0)):(a.up.set(0,l[p],0),a.lookAt(0,0,c[p]));let y=this._cubeSize;fl(i,b*y,p>2?y:0,y,y),u.setRenderTarget(i),g&&u.render(_,a),u.render(t,a)}_.geometry.dispose(),_.material.dispose(),u.toneMapping=f,u.autoClear=h,t.background=m}_textureToCubeUV(t,e){let n=this._renderer,i=t.mapping===js||t.mapping===Qs;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=Em()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=wm());let s=i?this._cubemapMaterial:this._equirectMaterial,o=new ai(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=t;let l=this._cubeSize;fl(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(o,Wu)}_applyPMREM(t){let e=this._renderer,n=e.autoClear;e.autoClear=!1;let i=this._lodPlanes.length;for(let s=1;s<i;s++){let o=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),a=Mm[(i-s-1)%Mm.length];this._blur(t,s-1,s,o,a)}e.autoClear=n}_blur(t,e,n,i,s){let o=this._pingPongRenderTarget;this._halfBlur(t,o,e,n,i,"latitudinal",s),this._halfBlur(o,t,n,n,i,"longitudinal",s)}_halfBlur(t,e,n,i,s,o,a){let l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let u=3,h=new ai(this._lodPlanes[i],c),f=c.uniforms,d=this._sizeLods[n]-1,_=isFinite(s)?Math.PI/(2*d):2*Math.PI/(2*ts-1),g=s/_,m=isFinite(s)?1+Math.floor(u*g):ts;m>ts&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${ts}`);let p=[],b=0;for(let w=0;w<ts;++w){let P=w/g,M=Math.exp(-P*P/2);p.push(M),w===0?b+=M:w<m&&(b+=2*M)}for(let w=0;w<p.length;w++)p[w]=p[w]/b;f.envMap.value=t.texture,f.samples.value=m,f.weights.value=p,f.latitudinal.value=o==="latitudinal",a&&(f.poleAxis.value=a);let{_lodMax:y}=this;f.dTheta.value=_,f.mipInt.value=y-n;let S=this._sizeLods[i],D=3*S*(i>y-Zs?i-y+Zs:0),A=4*(this._cubeSize-S);fl(e,D,A,3*S,2*S),l.setRenderTarget(e),l.render(h,Wu)}};function VS(r){let t=[],e=[],n=[],i=r,s=r-Zs+1+ym.length;for(let o=0;o<s;o++){let a=Math.pow(2,i);e.push(a);let l=1/a;o>r-Zs?l=ym[o-r+Zs-1]:o===0&&(l=0),n.push(l);let c=1/(a-2),u=-c,h=1+c,f=[u,u,h,u,h,h,u,u,h,h,u,h],d=6,_=6,g=3,m=2,p=1,b=new Float32Array(g*_*d),y=new Float32Array(m*_*d),S=new Float32Array(p*_*d);for(let A=0;A<d;A++){let w=A%3*2/3-1,P=A>2?0:-1,M=[w,P,0,w+2/3,P,0,w+2/3,P+1,0,w,P,0,w+2/3,P+1,0,w,P+1,0];b.set(M,g*_*A),y.set(f,m*_*A);let v=[A,A,A,A,A,A];S.set(v,p*_*A)}let D=new Mi;D.setAttribute("position",new Zn(b,g)),D.setAttribute("uv",new Zn(y,m)),D.setAttribute("faceIndex",new Zn(S,p)),t.push(D),i>Zs&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function bm(r,t,e){let n=new Gi(r,t,e);return n.texture.mapping=Gl,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function fl(r,t,e,n,i){r.viewport.set(t,e,n,i),r.scissor.set(t,e,n,i)}function HS(r,t,e){let n=new Float32Array(ts),i=new j(0,1,0);return new Kn({name:"SphericalGaussianBlur",defines:{n:ts,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Oh(),fragmentShader:`
|
|
3571
3571
|
|
|
3572
3572
|
precision mediump float;
|
|
3573
3573
|
precision mediump int;
|
|
@@ -3717,7 +3717,7 @@ void main() {
|
|
|
3717
3717
|
gl_Position = vec4( position, 1.0 );
|
|
3718
3718
|
|
|
3719
3719
|
}
|
|
3720
|
-
`}function GS(r){let t=new WeakMap,e=null;function n(a){if(a&&a.isTexture){let l=a.mapping,c=l===Qu||l===th,u=l===js||l===Qs;if(c||u){let f=t.get(a),h=f!==void 0?f.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==h)return e===null&&(e=new Nl(r)),f=c?e.fromEquirectangular(a,f):e.fromCubemap(a,f),f.texture.pmremVersion=a.pmremVersion,t.set(a,f),f.texture;if(f!==void 0)return f.texture;{let d=a.image;return c&&d&&d.height>0||u&&d&&i(d)?(e===null&&(e=new Nl(r)),f=c?e.fromEquirectangular(a):e.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,t.set(a,f),a.addEventListener("dispose",s),f.texture):null}}}return a}function i(a){let l=0,c=6;for(let u=0;u<c;u++)a[u]!==void 0&&l++;return l===c}function s(a){let l=a.target;l.removeEventListener("dispose",s);let c=t.get(l);c!==void 0&&(t.delete(l),c.dispose())}function o(){t=new WeakMap,e!==null&&(e.dispose(),e=null)}return{get:n,dispose:o}}function WS(r){let t={};function e(n){if(t[n]!==void 0)return t[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return t[n]=i,i}return{has:function(n){return e(n)!==null},init:function(){e("EXT_color_buffer_float"),e("WEBGL_clip_cull_distance"),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture"),e("WEBGL_render_shared_exponent")},get:function(n){let i=e(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function XS(r,t,e,n){let i={},s=new WeakMap;function o(f){let h=f.target;h.index!==null&&t.remove(h.index);for(let _ in h.attributes)t.remove(h.attributes[_]);for(let _ in h.morphAttributes){let g=h.morphAttributes[_];for(let p=0,m=g.length;p<m;p++)t.remove(g[p])}h.removeEventListener("dispose",o),delete i[h.id];let d=s.get(h);d&&(t.remove(d),s.delete(h)),n.releaseStatesOfGeometry(h),h.isInstancedBufferGeometry===!0&&delete h._maxInstanceCount,e.memory.geometries--}function a(f,h){return i[h.id]===!0||(h.addEventListener("dispose",o),i[h.id]=!0,e.memory.geometries++),h}function l(f){let h=f.attributes;for(let _ in h)t.update(h[_],r.ARRAY_BUFFER);let d=f.morphAttributes;for(let _ in d){let g=d[_];for(let p=0,m=g.length;p<m;p++)t.update(g[p],r.ARRAY_BUFFER)}}function c(f){let h=[],d=f.index,_=f.attributes.position,g=0;if(d!==null){let b=d.array;g=d.version;for(let S=0,y=b.length;S<y;S+=3){let D=b[S+0],A=b[S+1],w=b[S+2];h.push(D,A,A,w,w,D)}}else if(_!==void 0){let b=_.array;g=_.version;for(let S=0,y=b.length/3-1;S<y;S+=3){let D=S+0,A=S+1,w=S+2;h.push(D,A,A,w,w,D)}}else return;let p=new(ng(h)?Rl:Cl)(h,1);p.version=g;let m=s.get(f);m&&t.remove(m),s.set(f,p)}function u(f){let h=s.get(f);if(h){let d=f.index;d!==null&&h.version<d.version&&c(f)}else c(f);return s.get(f)}return{get:a,update:l,getWireframeAttribute:u}}function qS(r,t,e){let n;function i(h){n=h}let s,o;function a(h){s=h.type,o=h.bytesPerElement}function l(h,d){r.drawElements(n,d,s,h*o),e.update(d,n,1)}function c(h,d,_){_!==0&&(r.drawElementsInstanced(n,d,s,h*o,_),e.update(d,n,_))}function u(h,d,_){if(_===0)return;let g=t.get("WEBGL_multi_draw");if(g===null)for(let p=0;p<_;p++)this.render(h[p]/o,d[p]);else{g.multiDrawElementsWEBGL(n,d,0,s,h,0,_);let p=0;for(let m=0;m<_;m++)p+=d[m];e.update(p,n,1)}}function f(h,d,_,g){if(_===0)return;let p=t.get("WEBGL_multi_draw");if(p===null)for(let m=0;m<h.length;m++)c(h[m]/o,d[m],g[m]);else{p.multiDrawElementsInstancedWEBGL(n,d,0,s,h,0,g,0,_);let m=0;for(let b=0;b<_;b++)m+=d[b];for(let b=0;b<g.length;b++)e.update(m,n,g[b])}}this.setMode=i,this.setIndex=a,this.render=l,this.renderInstances=c,this.renderMultiDraw=u,this.renderMultiDrawInstances=f}function YS(r){let t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,a){switch(e.calls++,o){case r.TRIANGLES:e.triangles+=a*(s/3);break;case r.LINES:e.lines+=a*(s/2);break;case r.LINE_STRIP:e.lines+=a*(s-1);break;case r.LINE_LOOP:e.lines+=a*s;break;case r.POINTS:e.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:i,update:n}}function ZS(r,t,e){let n=new WeakMap,i=new Ye;function s(o,a,l){let c=o.morphTargetInfluences,u=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,f=u!==void 0?u.length:0,h=n.get(a);if(h===void 0||h.count!==f){let M=function(){w.dispose(),n.delete(a),a.removeEventListener("dispose",M)};h!==void 0&&h.texture.dispose();let d=a.morphAttributes.position!==void 0,_=a.morphAttributes.normal!==void 0,g=a.morphAttributes.color!==void 0,p=a.morphAttributes.position||[],m=a.morphAttributes.normal||[],b=a.morphAttributes.color||[],S=0;d===!0&&(S=1),_===!0&&(S=2),g===!0&&(S=3);let y=a.attributes.position.count*S,D=1;y>t.maxTextureSize&&(D=Math.ceil(y/t.maxTextureSize),y=t.maxTextureSize);let A=new Float32Array(y*D*4*f),w=new El(A,y,D,f);w.type=hr,w.needsUpdate=!0;let P=S*4;for(let v=0;v<f;v++){let N=p[v],F=m[v],R=b[v],B=y*D*4*v;for(let Y=0;Y<N.count;Y++){let H=Y*P;d===!0&&(i.fromBufferAttribute(N,Y),A[B+H+0]=i.x,A[B+H+1]=i.y,A[B+H+2]=i.z,A[B+H+3]=0),_===!0&&(i.fromBufferAttribute(F,Y),A[B+H+4]=i.x,A[B+H+5]=i.y,A[B+H+6]=i.z,A[B+H+7]=0),g===!0&&(i.fromBufferAttribute(R,Y),A[B+H+8]=i.x,A[B+H+9]=i.y,A[B+H+10]=i.z,A[B+H+11]=R.itemSize===4?i.w:1)}}h={count:f,texture:w,size:new ue(y,D)},n.set(a,h),a.addEventListener("dispose",M)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)l.getUniforms().setValue(r,"morphTexture",o.morphTexture,e);else{let d=0;for(let g=0;g<c.length;g++)d+=c[g];let _=a.morphTargetsRelative?1:1-d;l.getUniforms().setValue(r,"morphTargetBaseInfluence",_),l.getUniforms().setValue(r,"morphTargetInfluences",c)}l.getUniforms().setValue(r,"morphTargetsTexture",h.texture,e),l.getUniforms().setValue(r,"morphTargetsTextureSize",h.size)}return{update:s}}function JS(r,t,e,n){let i=new WeakMap;function s(l){let c=n.render.frame,u=l.geometry,f=t.get(l,u);if(i.get(f)!==c&&(t.update(f),i.set(f,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",a)===!1&&l.addEventListener("dispose",a),i.get(l)!==c&&(e.update(l.instanceMatrix,r.ARRAY_BUFFER),l.instanceColor!==null&&e.update(l.instanceColor,r.ARRAY_BUFFER),i.set(l,c))),l.isSkinnedMesh){let h=l.skeleton;i.get(h)!==c&&(h.update(),i.set(h,c))}return f}function o(){i=new WeakMap}function a(l){let c=l.target;c.removeEventListener("dispose",a),e.remove(c.instanceMatrix),c.instanceColor!==null&&e.remove(c.instanceColor)}return{update:s,dispose:o}}var Ul=class extends $n{constructor(t,e,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Js,u!==Js&&u!==Yo)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Js&&(n=to),n===void 0&&u===Yo&&(n=Ko),super(null,i,s,o,a,l,u,n,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=a!==void 0?a:Yn,this.minFilter=l!==void 0?l:Yn,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){let e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}},og=new $n,ag=new Ul(1,1);ag.compareFunction=eg;var lg=new El,cg=new oh,ug=new Il,Tm=[],Am=[],Dm=new Float32Array(16),Cm=new Float32Array(9),Rm=new Float32Array(4);function ro(r,t,e){let n=r[0];if(n<=0||n>0)return r;let i=t*e,s=Tm[i];if(s===void 0&&(s=new Float32Array(i),Tm[i]=s),t!==0){n.toArray(s,0);for(let o=1,a=0;o!==t;++o)a+=e,r[o].toArray(s,a)}return s}function ke(r,t){if(r.length!==t.length)return!1;for(let e=0,n=r.length;e<n;e++)if(r[e]!==t[e])return!1;return!0}function Ve(r,t){for(let e=0,n=t.length;e<n;e++)r[e]=t[e]}function ql(r,t){let e=Am[t];e===void 0&&(e=new Int32Array(t),Am[t]=e);for(let n=0;n!==t;++n)e[n]=r.allocateTextureUnit();return e}function $S(r,t){let e=this.cache;e[0]!==t&&(r.uniform1f(this.addr,t),e[0]=t)}function KS(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(ke(e,t))return;r.uniform2fv(this.addr,t),Ve(e,t)}}function jS(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(r.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(ke(e,t))return;r.uniform3fv(this.addr,t),Ve(e,t)}}function QS(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(ke(e,t))return;r.uniform4fv(this.addr,t),Ve(e,t)}}function tM(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(ke(e,t))return;r.uniformMatrix2fv(this.addr,!1,t),Ve(e,t)}else{if(ke(e,n))return;Rm.set(n),r.uniformMatrix2fv(this.addr,!1,Rm),Ve(e,n)}}function eM(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(ke(e,t))return;r.uniformMatrix3fv(this.addr,!1,t),Ve(e,t)}else{if(ke(e,n))return;Cm.set(n),r.uniformMatrix3fv(this.addr,!1,Cm),Ve(e,n)}}function nM(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(ke(e,t))return;r.uniformMatrix4fv(this.addr,!1,t),Ve(e,t)}else{if(ke(e,n))return;Dm.set(n),r.uniformMatrix4fv(this.addr,!1,Dm),Ve(e,n)}}function iM(r,t){let e=this.cache;e[0]!==t&&(r.uniform1i(this.addr,t),e[0]=t)}function rM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(ke(e,t))return;r.uniform2iv(this.addr,t),Ve(e,t)}}function sM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(ke(e,t))return;r.uniform3iv(this.addr,t),Ve(e,t)}}function oM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(ke(e,t))return;r.uniform4iv(this.addr,t),Ve(e,t)}}function aM(r,t){let e=this.cache;e[0]!==t&&(r.uniform1ui(this.addr,t),e[0]=t)}function lM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(ke(e,t))return;r.uniform2uiv(this.addr,t),Ve(e,t)}}function cM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(ke(e,t))return;r.uniform3uiv(this.addr,t),Ve(e,t)}}function uM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(ke(e,t))return;r.uniform4uiv(this.addr,t),Ve(e,t)}}function hM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);let s=this.type===r.SAMPLER_2D_SHADOW?ag:og;e.setTexture2D(t||s,i)}function fM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture3D(t||cg,i)}function dM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTextureCube(t||ug,i)}function pM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture2DArray(t||lg,i)}function mM(r){switch(r){case 5126:return $S;case 35664:return KS;case 35665:return jS;case 35666:return QS;case 35674:return tM;case 35675:return eM;case 35676:return nM;case 5124:case 35670:return iM;case 35667:case 35671:return rM;case 35668:case 35672:return sM;case 35669:case 35673:return oM;case 5125:return aM;case 36294:return lM;case 36295:return cM;case 36296:return uM;case 35678:case 36198:case 36298:case 36306:case 35682:return hM;case 35679:case 36299:case 36307:return fM;case 35680:case 36300:case 36308:case 36293:return dM;case 36289:case 36303:case 36311:case 36292:return pM}}function gM(r,t){r.uniform1fv(this.addr,t)}function _M(r,t){let e=ro(t,this.size,2);r.uniform2fv(this.addr,e)}function xM(r,t){let e=ro(t,this.size,3);r.uniform3fv(this.addr,e)}function vM(r,t){let e=ro(t,this.size,4);r.uniform4fv(this.addr,e)}function yM(r,t){let e=ro(t,this.size,4);r.uniformMatrix2fv(this.addr,!1,e)}function SM(r,t){let e=ro(t,this.size,9);r.uniformMatrix3fv(this.addr,!1,e)}function MM(r,t){let e=ro(t,this.size,16);r.uniformMatrix4fv(this.addr,!1,e)}function bM(r,t){r.uniform1iv(this.addr,t)}function wM(r,t){r.uniform2iv(this.addr,t)}function EM(r,t){r.uniform3iv(this.addr,t)}function TM(r,t){r.uniform4iv(this.addr,t)}function AM(r,t){r.uniform1uiv(this.addr,t)}function DM(r,t){r.uniform2uiv(this.addr,t)}function CM(r,t){r.uniform3uiv(this.addr,t)}function RM(r,t){r.uniform4uiv(this.addr,t)}function PM(r,t,e){let n=this.cache,i=t.length,s=ql(e,i);ke(n,s)||(r.uniform1iv(this.addr,s),Ve(n,s));for(let o=0;o!==i;++o)e.setTexture2D(t[o]||og,s[o])}function IM(r,t,e){let n=this.cache,i=t.length,s=ql(e,i);ke(n,s)||(r.uniform1iv(this.addr,s),Ve(n,s));for(let o=0;o!==i;++o)e.setTexture3D(t[o]||cg,s[o])}function LM(r,t,e){let n=this.cache,i=t.length,s=ql(e,i);ke(n,s)||(r.uniform1iv(this.addr,s),Ve(n,s));for(let o=0;o!==i;++o)e.setTextureCube(t[o]||ug,s[o])}function FM(r,t,e){let n=this.cache,i=t.length,s=ql(e,i);ke(n,s)||(r.uniform1iv(this.addr,s),Ve(n,s));for(let o=0;o!==i;++o)e.setTexture2DArray(t[o]||lg,s[o])}function NM(r){switch(r){case 5126:return gM;case 35664:return _M;case 35665:return xM;case 35666:return vM;case 35674:return yM;case 35675:return SM;case 35676:return MM;case 5124:case 35670:return bM;case 35667:case 35671:return wM;case 35668:case 35672:return EM;case 35669:case 35673:return TM;case 5125:return AM;case 36294:return DM;case 36295:return CM;case 36296:return RM;case 35678:case 36198:case 36298:case 36306:case 35682:return PM;case 35679:case 36299:case 36307:return IM;case 35680:case 36300:case 36308:case 36293:return LM;case 36289:case 36303:case 36311:case 36292:return FM}}var ch=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=mM(e.type)}},uh=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=NM(e.type)}},hh=class{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){let i=this.seq;for(let s=0,o=i.length;s!==o;++s){let a=i[s];a.setValue(t,e[a.id],n)}}},Ju=/(\w+)(\])?(\[|\.)?/g;function Pm(r,t){r.seq.push(t),r.map[t.id]=t}function UM(r,t,e){let n=r.name,i=n.length;for(Ju.lastIndex=0;;){let s=Ju.exec(n),o=Ju.lastIndex,a=s[1],l=s[2]==="]",c=s[3];if(l&&(a=a|0),c===void 0||c==="["&&o+2===i){Pm(e,c===void 0?new ch(a,r,t):new uh(a,r,t));break}else{let f=e.map[a];f===void 0&&(f=new hh(a),Pm(e,f)),e=f}}}var Ks=class{constructor(t,e){this.seq=[],this.map={};let n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){let s=t.getActiveUniform(e,i),o=t.getUniformLocation(e,s.name);UM(s,o,this)}}setValue(t,e,n,i){let s=this.map[e];s!==void 0&&s.setValue(t,n,i)}setOptional(t,e,n){let i=e[n];i!==void 0&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let s=0,o=e.length;s!==o;++s){let a=e[s],l=n[a.id];l.needsUpdate!==!1&&a.setValue(t,l.value,i)}}static seqWithValue(t,e){let n=[];for(let i=0,s=t.length;i!==s;++i){let o=t[i];o.id in e&&n.push(o)}return n}};function Im(r,t,e){let n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),n}var OM=37297,BM=0;function zM(r,t){let e=r.split(`
|
|
3720
|
+
`}function GS(r){let t=new WeakMap,e=null;function n(a){if(a&&a.isTexture){let l=a.mapping,c=l===Qu||l===th,u=l===js||l===Qs;if(c||u){let h=t.get(a),f=h!==void 0?h.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==f)return e===null&&(e=new Nl(r)),h=c?e.fromEquirectangular(a,h):e.fromCubemap(a,h),h.texture.pmremVersion=a.pmremVersion,t.set(a,h),h.texture;if(h!==void 0)return h.texture;{let d=a.image;return c&&d&&d.height>0||u&&d&&i(d)?(e===null&&(e=new Nl(r)),h=c?e.fromEquirectangular(a):e.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,t.set(a,h),a.addEventListener("dispose",s),h.texture):null}}}return a}function i(a){let l=0,c=6;for(let u=0;u<c;u++)a[u]!==void 0&&l++;return l===c}function s(a){let l=a.target;l.removeEventListener("dispose",s);let c=t.get(l);c!==void 0&&(t.delete(l),c.dispose())}function o(){t=new WeakMap,e!==null&&(e.dispose(),e=null)}return{get:n,dispose:o}}function WS(r){let t={};function e(n){if(t[n]!==void 0)return t[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return t[n]=i,i}return{has:function(n){return e(n)!==null},init:function(){e("EXT_color_buffer_float"),e("WEBGL_clip_cull_distance"),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture"),e("WEBGL_render_shared_exponent")},get:function(n){let i=e(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function XS(r,t,e,n){let i={},s=new WeakMap;function o(h){let f=h.target;f.index!==null&&t.remove(f.index);for(let _ in f.attributes)t.remove(f.attributes[_]);for(let _ in f.morphAttributes){let g=f.morphAttributes[_];for(let m=0,p=g.length;m<p;m++)t.remove(g[m])}f.removeEventListener("dispose",o),delete i[f.id];let d=s.get(f);d&&(t.remove(d),s.delete(f)),n.releaseStatesOfGeometry(f),f.isInstancedBufferGeometry===!0&&delete f._maxInstanceCount,e.memory.geometries--}function a(h,f){return i[f.id]===!0||(f.addEventListener("dispose",o),i[f.id]=!0,e.memory.geometries++),f}function l(h){let f=h.attributes;for(let _ in f)t.update(f[_],r.ARRAY_BUFFER);let d=h.morphAttributes;for(let _ in d){let g=d[_];for(let m=0,p=g.length;m<p;m++)t.update(g[m],r.ARRAY_BUFFER)}}function c(h){let f=[],d=h.index,_=h.attributes.position,g=0;if(d!==null){let b=d.array;g=d.version;for(let y=0,S=b.length;y<S;y+=3){let D=b[y+0],A=b[y+1],w=b[y+2];f.push(D,A,A,w,w,D)}}else if(_!==void 0){let b=_.array;g=_.version;for(let y=0,S=b.length/3-1;y<S;y+=3){let D=y+0,A=y+1,w=y+2;f.push(D,A,A,w,w,D)}}else return;let m=new(ng(f)?Rl:Cl)(f,1);m.version=g;let p=s.get(h);p&&t.remove(p),s.set(h,m)}function u(h){let f=s.get(h);if(f){let d=h.index;d!==null&&f.version<d.version&&c(h)}else c(h);return s.get(h)}return{get:a,update:l,getWireframeAttribute:u}}function qS(r,t,e){let n;function i(f){n=f}let s,o;function a(f){s=f.type,o=f.bytesPerElement}function l(f,d){r.drawElements(n,d,s,f*o),e.update(d,n,1)}function c(f,d,_){_!==0&&(r.drawElementsInstanced(n,d,s,f*o,_),e.update(d,n,_))}function u(f,d,_){if(_===0)return;let g=t.get("WEBGL_multi_draw");if(g===null)for(let m=0;m<_;m++)this.render(f[m]/o,d[m]);else{g.multiDrawElementsWEBGL(n,d,0,s,f,0,_);let m=0;for(let p=0;p<_;p++)m+=d[p];e.update(m,n,1)}}function h(f,d,_,g){if(_===0)return;let m=t.get("WEBGL_multi_draw");if(m===null)for(let p=0;p<f.length;p++)c(f[p]/o,d[p],g[p]);else{m.multiDrawElementsInstancedWEBGL(n,d,0,s,f,0,g,0,_);let p=0;for(let b=0;b<_;b++)p+=d[b];for(let b=0;b<g.length;b++)e.update(p,n,g[b])}}this.setMode=i,this.setIndex=a,this.render=l,this.renderInstances=c,this.renderMultiDraw=u,this.renderMultiDrawInstances=h}function YS(r){let t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,a){switch(e.calls++,o){case r.TRIANGLES:e.triangles+=a*(s/3);break;case r.LINES:e.lines+=a*(s/2);break;case r.LINE_STRIP:e.lines+=a*(s-1);break;case r.LINE_LOOP:e.lines+=a*s;break;case r.POINTS:e.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:i,update:n}}function ZS(r,t,e){let n=new WeakMap,i=new Ye;function s(o,a,l){let c=o.morphTargetInfluences,u=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,h=u!==void 0?u.length:0,f=n.get(a);if(f===void 0||f.count!==h){let M=function(){w.dispose(),n.delete(a),a.removeEventListener("dispose",M)};f!==void 0&&f.texture.dispose();let d=a.morphAttributes.position!==void 0,_=a.morphAttributes.normal!==void 0,g=a.morphAttributes.color!==void 0,m=a.morphAttributes.position||[],p=a.morphAttributes.normal||[],b=a.morphAttributes.color||[],y=0;d===!0&&(y=1),_===!0&&(y=2),g===!0&&(y=3);let S=a.attributes.position.count*y,D=1;S>t.maxTextureSize&&(D=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);let A=new Float32Array(S*D*4*h),w=new El(A,S,D,h);w.type=hr,w.needsUpdate=!0;let P=y*4;for(let v=0;v<h;v++){let N=m[v],F=p[v],R=b[v],B=S*D*4*v;for(let Y=0;Y<N.count;Y++){let H=Y*P;d===!0&&(i.fromBufferAttribute(N,Y),A[B+H+0]=i.x,A[B+H+1]=i.y,A[B+H+2]=i.z,A[B+H+3]=0),_===!0&&(i.fromBufferAttribute(F,Y),A[B+H+4]=i.x,A[B+H+5]=i.y,A[B+H+6]=i.z,A[B+H+7]=0),g===!0&&(i.fromBufferAttribute(R,Y),A[B+H+8]=i.x,A[B+H+9]=i.y,A[B+H+10]=i.z,A[B+H+11]=R.itemSize===4?i.w:1)}}f={count:h,texture:w,size:new ue(S,D)},n.set(a,f),a.addEventListener("dispose",M)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)l.getUniforms().setValue(r,"morphTexture",o.morphTexture,e);else{let d=0;for(let g=0;g<c.length;g++)d+=c[g];let _=a.morphTargetsRelative?1:1-d;l.getUniforms().setValue(r,"morphTargetBaseInfluence",_),l.getUniforms().setValue(r,"morphTargetInfluences",c)}l.getUniforms().setValue(r,"morphTargetsTexture",f.texture,e),l.getUniforms().setValue(r,"morphTargetsTextureSize",f.size)}return{update:s}}function JS(r,t,e,n){let i=new WeakMap;function s(l){let c=n.render.frame,u=l.geometry,h=t.get(l,u);if(i.get(h)!==c&&(t.update(h),i.set(h,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",a)===!1&&l.addEventListener("dispose",a),i.get(l)!==c&&(e.update(l.instanceMatrix,r.ARRAY_BUFFER),l.instanceColor!==null&&e.update(l.instanceColor,r.ARRAY_BUFFER),i.set(l,c))),l.isSkinnedMesh){let f=l.skeleton;i.get(f)!==c&&(f.update(),i.set(f,c))}return h}function o(){i=new WeakMap}function a(l){let c=l.target;c.removeEventListener("dispose",a),e.remove(c.instanceMatrix),c.instanceColor!==null&&e.remove(c.instanceColor)}return{update:s,dispose:o}}var Ul=class extends $n{constructor(t,e,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Js,u!==Js&&u!==Yo)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Js&&(n=to),n===void 0&&u===Yo&&(n=Ko),super(null,i,s,o,a,l,u,n,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=a!==void 0?a:Yn,this.minFilter=l!==void 0?l:Yn,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){let e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}},og=new $n,ag=new Ul(1,1);ag.compareFunction=eg;var lg=new El,cg=new oh,ug=new Il,Tm=[],Am=[],Dm=new Float32Array(16),Cm=new Float32Array(9),Rm=new Float32Array(4);function ro(r,t,e){let n=r[0];if(n<=0||n>0)return r;let i=t*e,s=Tm[i];if(s===void 0&&(s=new Float32Array(i),Tm[i]=s),t!==0){n.toArray(s,0);for(let o=1,a=0;o!==t;++o)a+=e,r[o].toArray(s,a)}return s}function ke(r,t){if(r.length!==t.length)return!1;for(let e=0,n=r.length;e<n;e++)if(r[e]!==t[e])return!1;return!0}function Ve(r,t){for(let e=0,n=t.length;e<n;e++)r[e]=t[e]}function ql(r,t){let e=Am[t];e===void 0&&(e=new Int32Array(t),Am[t]=e);for(let n=0;n!==t;++n)e[n]=r.allocateTextureUnit();return e}function $S(r,t){let e=this.cache;e[0]!==t&&(r.uniform1f(this.addr,t),e[0]=t)}function KS(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(ke(e,t))return;r.uniform2fv(this.addr,t),Ve(e,t)}}function jS(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(r.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(ke(e,t))return;r.uniform3fv(this.addr,t),Ve(e,t)}}function QS(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(ke(e,t))return;r.uniform4fv(this.addr,t),Ve(e,t)}}function tM(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(ke(e,t))return;r.uniformMatrix2fv(this.addr,!1,t),Ve(e,t)}else{if(ke(e,n))return;Rm.set(n),r.uniformMatrix2fv(this.addr,!1,Rm),Ve(e,n)}}function eM(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(ke(e,t))return;r.uniformMatrix3fv(this.addr,!1,t),Ve(e,t)}else{if(ke(e,n))return;Cm.set(n),r.uniformMatrix3fv(this.addr,!1,Cm),Ve(e,n)}}function nM(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(ke(e,t))return;r.uniformMatrix4fv(this.addr,!1,t),Ve(e,t)}else{if(ke(e,n))return;Dm.set(n),r.uniformMatrix4fv(this.addr,!1,Dm),Ve(e,n)}}function iM(r,t){let e=this.cache;e[0]!==t&&(r.uniform1i(this.addr,t),e[0]=t)}function rM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(ke(e,t))return;r.uniform2iv(this.addr,t),Ve(e,t)}}function sM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(ke(e,t))return;r.uniform3iv(this.addr,t),Ve(e,t)}}function oM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(ke(e,t))return;r.uniform4iv(this.addr,t),Ve(e,t)}}function aM(r,t){let e=this.cache;e[0]!==t&&(r.uniform1ui(this.addr,t),e[0]=t)}function lM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(ke(e,t))return;r.uniform2uiv(this.addr,t),Ve(e,t)}}function cM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(ke(e,t))return;r.uniform3uiv(this.addr,t),Ve(e,t)}}function uM(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(ke(e,t))return;r.uniform4uiv(this.addr,t),Ve(e,t)}}function hM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);let s=this.type===r.SAMPLER_2D_SHADOW?ag:og;e.setTexture2D(t||s,i)}function fM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture3D(t||cg,i)}function dM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTextureCube(t||ug,i)}function pM(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture2DArray(t||lg,i)}function mM(r){switch(r){case 5126:return $S;case 35664:return KS;case 35665:return jS;case 35666:return QS;case 35674:return tM;case 35675:return eM;case 35676:return nM;case 5124:case 35670:return iM;case 35667:case 35671:return rM;case 35668:case 35672:return sM;case 35669:case 35673:return oM;case 5125:return aM;case 36294:return lM;case 36295:return cM;case 36296:return uM;case 35678:case 36198:case 36298:case 36306:case 35682:return hM;case 35679:case 36299:case 36307:return fM;case 35680:case 36300:case 36308:case 36293:return dM;case 36289:case 36303:case 36311:case 36292:return pM}}function gM(r,t){r.uniform1fv(this.addr,t)}function _M(r,t){let e=ro(t,this.size,2);r.uniform2fv(this.addr,e)}function xM(r,t){let e=ro(t,this.size,3);r.uniform3fv(this.addr,e)}function vM(r,t){let e=ro(t,this.size,4);r.uniform4fv(this.addr,e)}function yM(r,t){let e=ro(t,this.size,4);r.uniformMatrix2fv(this.addr,!1,e)}function SM(r,t){let e=ro(t,this.size,9);r.uniformMatrix3fv(this.addr,!1,e)}function MM(r,t){let e=ro(t,this.size,16);r.uniformMatrix4fv(this.addr,!1,e)}function bM(r,t){r.uniform1iv(this.addr,t)}function wM(r,t){r.uniform2iv(this.addr,t)}function EM(r,t){r.uniform3iv(this.addr,t)}function TM(r,t){r.uniform4iv(this.addr,t)}function AM(r,t){r.uniform1uiv(this.addr,t)}function DM(r,t){r.uniform2uiv(this.addr,t)}function CM(r,t){r.uniform3uiv(this.addr,t)}function RM(r,t){r.uniform4uiv(this.addr,t)}function PM(r,t,e){let n=this.cache,i=t.length,s=ql(e,i);ke(n,s)||(r.uniform1iv(this.addr,s),Ve(n,s));for(let o=0;o!==i;++o)e.setTexture2D(t[o]||og,s[o])}function IM(r,t,e){let n=this.cache,i=t.length,s=ql(e,i);ke(n,s)||(r.uniform1iv(this.addr,s),Ve(n,s));for(let o=0;o!==i;++o)e.setTexture3D(t[o]||cg,s[o])}function LM(r,t,e){let n=this.cache,i=t.length,s=ql(e,i);ke(n,s)||(r.uniform1iv(this.addr,s),Ve(n,s));for(let o=0;o!==i;++o)e.setTextureCube(t[o]||ug,s[o])}function FM(r,t,e){let n=this.cache,i=t.length,s=ql(e,i);ke(n,s)||(r.uniform1iv(this.addr,s),Ve(n,s));for(let o=0;o!==i;++o)e.setTexture2DArray(t[o]||lg,s[o])}function NM(r){switch(r){case 5126:return gM;case 35664:return _M;case 35665:return xM;case 35666:return vM;case 35674:return yM;case 35675:return SM;case 35676:return MM;case 5124:case 35670:return bM;case 35667:case 35671:return wM;case 35668:case 35672:return EM;case 35669:case 35673:return TM;case 5125:return AM;case 36294:return DM;case 36295:return CM;case 36296:return RM;case 35678:case 36198:case 36298:case 36306:case 35682:return PM;case 35679:case 36299:case 36307:return IM;case 35680:case 36300:case 36308:case 36293:return LM;case 36289:case 36303:case 36311:case 36292:return FM}}var ch=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=mM(e.type)}},uh=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=NM(e.type)}},hh=class{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){let i=this.seq;for(let s=0,o=i.length;s!==o;++s){let a=i[s];a.setValue(t,e[a.id],n)}}},Ju=/(\w+)(\])?(\[|\.)?/g;function Pm(r,t){r.seq.push(t),r.map[t.id]=t}function UM(r,t,e){let n=r.name,i=n.length;for(Ju.lastIndex=0;;){let s=Ju.exec(n),o=Ju.lastIndex,a=s[1],l=s[2]==="]",c=s[3];if(l&&(a=a|0),c===void 0||c==="["&&o+2===i){Pm(e,c===void 0?new ch(a,r,t):new uh(a,r,t));break}else{let h=e.map[a];h===void 0&&(h=new hh(a),Pm(e,h)),e=h}}}var Ks=class{constructor(t,e){this.seq=[],this.map={};let n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){let s=t.getActiveUniform(e,i),o=t.getUniformLocation(e,s.name);UM(s,o,this)}}setValue(t,e,n,i){let s=this.map[e];s!==void 0&&s.setValue(t,n,i)}setOptional(t,e,n){let i=e[n];i!==void 0&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let s=0,o=e.length;s!==o;++s){let a=e[s],l=n[a.id];l.needsUpdate!==!1&&a.setValue(t,l.value,i)}}static seqWithValue(t,e){let n=[];for(let i=0,s=t.length;i!==s;++i){let o=t[i];o.id in e&&n.push(o)}return n}};function Im(r,t,e){let n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),n}var OM=37297,BM=0;function zM(r,t){let e=r.split(`
|
|
3721
3721
|
`),n=[],i=Math.max(t-6,0),s=Math.min(t+6,e.length);for(let o=i;o<s;o++){let a=o+1;n.push(`${a===t?">":" "} ${a}: ${e[o]}`)}return n.join(`
|
|
3722
3722
|
`)}function kM(r){let t=me.getPrimaries(me.workingColorSpace),e=me.getPrimaries(r),n;switch(t===e?n="":t===Sl&&e===yl?n="LinearDisplayP3ToLinearSRGB":t===yl&&e===Sl&&(n="LinearSRGBToLinearDisplayP3"),r){case yr:case Xl:return[n,"LinearTransferOETF"];case qn:case Uh:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[n,"LinearTransferOETF"]}}function Lm(r,t,e){let n=r.getShaderParameter(t,r.COMPILE_STATUS),i=r.getShaderInfoLog(t).trim();if(n&&i==="")return"";let s=/ERROR: 0:(\d+)/.exec(i);if(s){let o=parseInt(s[1]);return e.toUpperCase()+`
|
|
3723
3723
|
|
|
@@ -3745,28 +3745,28 @@ void main() {
|
|
|
3745
3745
|
`;return r.precision==="highp"?t+=`
|
|
3746
3746
|
#define HIGH_PRECISION`:r.precision==="mediump"?t+=`
|
|
3747
3747
|
#define MEDIUM_PRECISION`:r.precision==="lowp"&&(t+=`
|
|
3748
|
-
#define LOW_PRECISION`),t}function KM(r){let t="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===Xm?t="SHADOWMAP_TYPE_PCF":r.shadowMapType===Nh?t="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===zi&&(t="SHADOWMAP_TYPE_VSM"),t}function jM(r){let t="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case js:case Qs:t="ENVMAP_TYPE_CUBE";break;case Gl:t="ENVMAP_TYPE_CUBE_UV";break}return t}function QM(r){let t="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case Qs:t="ENVMAP_MODE_REFRACTION";break}return t}function tb(r){let t="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case qm:t="ENVMAP_BLENDING_MULTIPLY";break;case ex:t="ENVMAP_BLENDING_MIX";break;case nx:t="ENVMAP_BLENDING_ADD";break}return t}function eb(r){let t=r.envMapCubeUVHeight;if(t===null)return null;let e=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),7*16)),texelHeight:n,maxMip:e}}function nb(r,t,e,n){let i=r.getContext(),s=e.defines,o=e.vertexShader,a=e.fragmentShader,l=KM(e),c=jM(e),u=QM(e),
|
|
3749
|
-
`:"";e.isRawShaderMaterial?(
|
|
3750
|
-
`),p.length>0&&(p+=`
|
|
3751
|
-
`),m=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_].filter(Xo).join(`
|
|
3748
|
+
#define LOW_PRECISION`),t}function KM(r){let t="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===Xm?t="SHADOWMAP_TYPE_PCF":r.shadowMapType===Nh?t="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===zi&&(t="SHADOWMAP_TYPE_VSM"),t}function jM(r){let t="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case js:case Qs:t="ENVMAP_TYPE_CUBE";break;case Gl:t="ENVMAP_TYPE_CUBE_UV";break}return t}function QM(r){let t="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case Qs:t="ENVMAP_MODE_REFRACTION";break}return t}function tb(r){let t="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case qm:t="ENVMAP_BLENDING_MULTIPLY";break;case ex:t="ENVMAP_BLENDING_MIX";break;case nx:t="ENVMAP_BLENDING_ADD";break}return t}function eb(r){let t=r.envMapCubeUVHeight;if(t===null)return null;let e=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),7*16)),texelHeight:n,maxMip:e}}function nb(r,t,e,n){let i=r.getContext(),s=e.defines,o=e.vertexShader,a=e.fragmentShader,l=KM(e),c=jM(e),u=QM(e),h=tb(e),f=eb(e),d=GM(e),_=WM(s),g=i.createProgram(),m,p,b=e.glslVersion?"#version "+e.glslVersion+`
|
|
3749
|
+
`:"";e.isRawShaderMaterial?(m=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_].filter(Xo).join(`
|
|
3752
3750
|
`),m.length>0&&(m+=`
|
|
3753
|
-
`)
|
|
3751
|
+
`),p=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_].filter(Xo).join(`
|
|
3752
|
+
`),p.length>0&&(p+=`
|
|
3753
|
+
`)):(m=[Om(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+u:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.useLegacyLights?"#define LEGACY_LIGHTS":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
|
|
3754
3754
|
`].filter(Xo).join(`
|
|
3755
|
-
`),
|
|
3755
|
+
`),p=[Om(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+u:"",e.envMap?"#define "+h:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.useLegacyLights?"#define LEGACY_LIGHTS":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==mr?"#define TONE_MAPPING":"",e.toneMapping!==mr?Kt.tonemapping_pars_fragment:"",e.toneMapping!==mr?HM("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Kt.colorspace_pars_fragment,VM("linearToOutputTexel",e.outputColorSpace),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",`
|
|
3756
3756
|
`].filter(Xo).join(`
|
|
3757
3757
|
`)),o=fh(o),o=Fm(o,e),o=Nm(o,e),a=fh(a),a=Fm(a,e),a=Nm(a,e),o=Um(o),a=Um(a),e.isRawShaderMaterial!==!0&&(b=`#version 300 es
|
|
3758
|
-
`,
|
|
3758
|
+
`,m=[d,"#define attribute in","#define varying out","#define texture2D texture"].join(`
|
|
3759
3759
|
`)+`
|
|
3760
|
-
`+p
|
|
3760
|
+
`+m,p=["#define varying in",e.glslVersion===tm?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===tm?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
|
|
3761
3761
|
`)+`
|
|
3762
|
-
`+
|
|
3762
|
+
`+p);let y=b+m+o,S=b+p+a,D=Im(i,i.VERTEX_SHADER,y),A=Im(i,i.FRAGMENT_SHADER,S);i.attachShader(g,D),i.attachShader(g,A),e.index0AttributeName!==void 0?i.bindAttribLocation(g,0,e.index0AttributeName):e.morphTargets===!0&&i.bindAttribLocation(g,0,"position"),i.linkProgram(g);function w(N){if(r.debug.checkShaderErrors){let F=i.getProgramInfoLog(g).trim(),R=i.getShaderInfoLog(D).trim(),B=i.getShaderInfoLog(A).trim(),Y=!0,H=!0;if(i.getProgramParameter(g,i.LINK_STATUS)===!1)if(Y=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(i,g,D,A);else{let J=Lm(i,D,"vertex"),O=Lm(i,A,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(g,i.VALIDATE_STATUS)+`
|
|
3763
3763
|
|
|
3764
3764
|
Material Name: `+N.name+`
|
|
3765
3765
|
Material Type: `+N.type+`
|
|
3766
3766
|
|
|
3767
3767
|
Program Info Log: `+F+`
|
|
3768
3768
|
`+J+`
|
|
3769
|
-
`+O)}else F!==""?console.warn("THREE.WebGLProgram: Program Info Log:",F):(R===""||B==="")&&(H=!1);H&&(N.diagnostics={runnable:Y,programLog:F,vertexShader:{log:R,prefix:p},fragmentShader:{log:B,prefix:m}})}i.deleteShader(D),i.deleteShader(A),P=new Ks(i,g),M=XM(i,g)}let P;this.getUniforms=function(){return P===void 0&&w(this),P};let M;this.getAttributes=function(){return M===void 0&&w(this),M};let v=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return v===!1&&(v=i.getProgramParameter(g,OM)),v},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(g),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=BM++,this.cacheKey=t,this.usedTimes=1,this.program=g,this.vertexShader=D,this.fragmentShader=A,this}var ib=0,dh=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(t);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(t){let e=this.materialCache.get(t);for(let n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){let e=this.materialCache,n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){let e=this.shaderCache,n=e.get(t);return n===void 0&&(n=new ph(t),e.set(t,n)),n}},ph=class{constructor(t){this.id=ib++,this.code=t,this.usedTimes=0}};function rb(r,t,e,n,i,s,o){let a=new Al,l=new dh,c=new Set,u=[],f=i.logarithmicDepthBuffer,h=i.vertexTextures,d=i.precision,_={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(M){return c.add(M),M===0?"uv":`uv${M}`}function p(M,v,N,F,R){let B=F.fog,Y=R.geometry,H=M.isMeshStandardMaterial?F.environment:null,J=(M.isMeshStandardMaterial?e:t).get(M.envMap||H),O=J&&J.mapping===Gl?J.image.height:null,L=_[M.type];M.precision!==null&&(d=i.getMaxPrecision(M.precision),d!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",d,"instead."));let C=Y.morphAttributes.position||Y.morphAttributes.normal||Y.morphAttributes.color,ot=C!==void 0?C.length:0,vt=0;Y.morphAttributes.position!==void 0&&(vt=1),Y.morphAttributes.normal!==void 0&&(vt=2),Y.morphAttributes.color!==void 0&&(vt=3);let Wt,q,tt,pt;if(L){let Zt=yi[L];Wt=Zt.vertexShader,q=Zt.fragmentShader}else Wt=M.vertexShader,q=M.fragmentShader,l.update(M),tt=l.getVertexShaderID(M),pt=l.getFragmentShaderID(M);let st=r.getRenderTarget(),Ft=R.isInstancedMesh===!0,Nt=R.isBatchedMesh===!0,V=!!M.map,Yt=!!M.matcap,Et=!!J,Tt=!!M.aoMap,St=!!M.lightMap,zt=!!M.bumpMap,Ut=!!M.normalMap,k=!!M.displacementMap,Qt=!!M.emissiveMap,T=!!M.metalnessMap,x=!!M.roughnessMap,I=M.anisotropy>0,G=M.clearcoat>0,K=M.dispersion>0,Q=M.iridescence>0,ht=M.sheen>0,ct=M.transmission>0,nt=I&&!!M.anisotropyMap,bt=G&&!!M.clearcoatMap,rt=G&&!!M.clearcoatNormalMap,ft=G&&!!M.clearcoatRoughnessMap,Ot=Q&&!!M.iridescenceMap,it=Q&&!!M.iridescenceThicknessMap,yt=ht&&!!M.sheenColorMap,Bt=ht&&!!M.sheenRoughnessMap,Vt=!!M.specularMap,he=!!M.specularColorMap,kt=!!M.specularIntensityMap,U=ct&&!!M.transmissionMap,$=ct&&!!M.thicknessMap,et=!!M.gradientMap,ut=!!M.alphaMap,at=M.alphaTest>0,Dt=!!M.alphaHash,te=!!M.extensions,ae=mr;M.toneMapped&&(st===null||st.isXRRenderTarget===!0)&&(ae=r.toneMapping);let re={shaderID:L,shaderType:M.type,shaderName:M.name,vertexShader:Wt,fragmentShader:q,defines:M.defines,customVertexShaderID:tt,customFragmentShaderID:pt,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:d,batching:Nt,instancing:Ft,instancingColor:Ft&&R.instanceColor!==null,instancingMorph:Ft&&R.morphTexture!==null,supportsVertexTextures:h,outputColorSpace:st===null?r.outputColorSpace:st.isXRRenderTarget===!0?st.texture.colorSpace:yr,alphaToCoverage:!!M.alphaToCoverage,map:V,matcap:Yt,envMap:Et,envMapMode:Et&&J.mapping,envMapCubeUVHeight:O,aoMap:Tt,lightMap:St,bumpMap:zt,normalMap:Ut,displacementMap:h&&k,emissiveMap:Qt,normalMapObjectSpace:Ut&&M.normalMapType===wx,normalMapTangentSpace:Ut&&M.normalMapType===bx,metalnessMap:T,roughnessMap:x,anisotropy:I,anisotropyMap:nt,clearcoat:G,clearcoatMap:bt,clearcoatNormalMap:rt,clearcoatRoughnessMap:ft,dispersion:K,iridescence:Q,iridescenceMap:Ot,iridescenceThicknessMap:it,sheen:ht,sheenColorMap:yt,sheenRoughnessMap:Bt,specularMap:Vt,specularColorMap:he,specularIntensityMap:kt,transmission:ct,transmissionMap:U,thicknessMap:$,gradientMap:et,opaque:M.transparent===!1&&M.blending===pr&&M.alphaToCoverage===!1,alphaMap:ut,alphaTest:at,alphaHash:Dt,combine:M.combine,mapUv:V&&g(M.map.channel),aoMapUv:Tt&&g(M.aoMap.channel),lightMapUv:St&&g(M.lightMap.channel),bumpMapUv:zt&&g(M.bumpMap.channel),normalMapUv:Ut&&g(M.normalMap.channel),displacementMapUv:k&&g(M.displacementMap.channel),emissiveMapUv:Qt&&g(M.emissiveMap.channel),metalnessMapUv:T&&g(M.metalnessMap.channel),roughnessMapUv:x&&g(M.roughnessMap.channel),anisotropyMapUv:nt&&g(M.anisotropyMap.channel),clearcoatMapUv:bt&&g(M.clearcoatMap.channel),clearcoatNormalMapUv:rt&&g(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ft&&g(M.clearcoatRoughnessMap.channel),iridescenceMapUv:Ot&&g(M.iridescenceMap.channel),iridescenceThicknessMapUv:it&&g(M.iridescenceThicknessMap.channel),sheenColorMapUv:yt&&g(M.sheenColorMap.channel),sheenRoughnessMapUv:Bt&&g(M.sheenRoughnessMap.channel),specularMapUv:Vt&&g(M.specularMap.channel),specularColorMapUv:he&&g(M.specularColorMap.channel),specularIntensityMapUv:kt&&g(M.specularIntensityMap.channel),transmissionMapUv:U&&g(M.transmissionMap.channel),thicknessMapUv:$&&g(M.thicknessMap.channel),alphaMapUv:ut&&g(M.alphaMap.channel),vertexTangents:!!Y.attributes.tangent&&(Ut||I),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!Y.attributes.color&&Y.attributes.color.itemSize===4,pointsUvs:R.isPoints===!0&&!!Y.attributes.uv&&(V||ut),fog:!!B,useFog:M.fog===!0,fogExp2:!!B&&B.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:f,skinning:R.isSkinnedMesh===!0,morphTargets:Y.morphAttributes.position!==void 0,morphNormals:Y.morphAttributes.normal!==void 0,morphColors:Y.morphAttributes.color!==void 0,morphTargetsCount:ot,morphTextureStride:vt,numDirLights:v.directional.length,numPointLights:v.point.length,numSpotLights:v.spot.length,numSpotLightMaps:v.spotLightMap.length,numRectAreaLights:v.rectArea.length,numHemiLights:v.hemi.length,numDirLightShadows:v.directionalShadowMap.length,numPointLightShadows:v.pointShadowMap.length,numSpotLightShadows:v.spotShadowMap.length,numSpotLightShadowsWithMaps:v.numSpotLightShadowsWithMaps,numLightProbes:v.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:M.dithering,shadowMapEnabled:r.shadowMap.enabled&&N.length>0,shadowMapType:r.shadowMap.type,toneMapping:ae,useLegacyLights:r._useLegacyLights,decodeVideoTexture:V&&M.map.isVideoTexture===!0&&me.getTransfer(M.map.colorSpace)===ye,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===Vi,flipSided:M.side===Cn,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:te&&M.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:te&&M.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return re.vertexUv1s=c.has(1),re.vertexUv2s=c.has(2),re.vertexUv3s=c.has(3),c.clear(),re}function m(M){let v=[];if(M.shaderID?v.push(M.shaderID):(v.push(M.customVertexShaderID),v.push(M.customFragmentShaderID)),M.defines!==void 0)for(let N in M.defines)v.push(N),v.push(M.defines[N]);return M.isRawShaderMaterial===!1&&(b(v,M),S(v,M),v.push(r.outputColorSpace)),v.push(M.customProgramCacheKey),v.join()}function b(M,v){M.push(v.precision),M.push(v.outputColorSpace),M.push(v.envMapMode),M.push(v.envMapCubeUVHeight),M.push(v.mapUv),M.push(v.alphaMapUv),M.push(v.lightMapUv),M.push(v.aoMapUv),M.push(v.bumpMapUv),M.push(v.normalMapUv),M.push(v.displacementMapUv),M.push(v.emissiveMapUv),M.push(v.metalnessMapUv),M.push(v.roughnessMapUv),M.push(v.anisotropyMapUv),M.push(v.clearcoatMapUv),M.push(v.clearcoatNormalMapUv),M.push(v.clearcoatRoughnessMapUv),M.push(v.iridescenceMapUv),M.push(v.iridescenceThicknessMapUv),M.push(v.sheenColorMapUv),M.push(v.sheenRoughnessMapUv),M.push(v.specularMapUv),M.push(v.specularColorMapUv),M.push(v.specularIntensityMapUv),M.push(v.transmissionMapUv),M.push(v.thicknessMapUv),M.push(v.combine),M.push(v.fogExp2),M.push(v.sizeAttenuation),M.push(v.morphTargetsCount),M.push(v.morphAttributeCount),M.push(v.numDirLights),M.push(v.numPointLights),M.push(v.numSpotLights),M.push(v.numSpotLightMaps),M.push(v.numHemiLights),M.push(v.numRectAreaLights),M.push(v.numDirLightShadows),M.push(v.numPointLightShadows),M.push(v.numSpotLightShadows),M.push(v.numSpotLightShadowsWithMaps),M.push(v.numLightProbes),M.push(v.shadowMapType),M.push(v.toneMapping),M.push(v.numClippingPlanes),M.push(v.numClipIntersection),M.push(v.depthPacking)}function S(M,v){a.disableAll(),v.supportsVertexTextures&&a.enable(0),v.instancing&&a.enable(1),v.instancingColor&&a.enable(2),v.instancingMorph&&a.enable(3),v.matcap&&a.enable(4),v.envMap&&a.enable(5),v.normalMapObjectSpace&&a.enable(6),v.normalMapTangentSpace&&a.enable(7),v.clearcoat&&a.enable(8),v.iridescence&&a.enable(9),v.alphaTest&&a.enable(10),v.vertexColors&&a.enable(11),v.vertexAlphas&&a.enable(12),v.vertexUv1s&&a.enable(13),v.vertexUv2s&&a.enable(14),v.vertexUv3s&&a.enable(15),v.vertexTangents&&a.enable(16),v.anisotropy&&a.enable(17),v.alphaHash&&a.enable(18),v.batching&&a.enable(19),v.dispersion&&a.enable(20),M.push(a.mask),a.disableAll(),v.fog&&a.enable(0),v.useFog&&a.enable(1),v.flatShading&&a.enable(2),v.logarithmicDepthBuffer&&a.enable(3),v.skinning&&a.enable(4),v.morphTargets&&a.enable(5),v.morphNormals&&a.enable(6),v.morphColors&&a.enable(7),v.premultipliedAlpha&&a.enable(8),v.shadowMapEnabled&&a.enable(9),v.useLegacyLights&&a.enable(10),v.doubleSided&&a.enable(11),v.flipSided&&a.enable(12),v.useDepthPacking&&a.enable(13),v.dithering&&a.enable(14),v.transmission&&a.enable(15),v.sheen&&a.enable(16),v.opaque&&a.enable(17),v.pointsUvs&&a.enable(18),v.decodeVideoTexture&&a.enable(19),v.alphaToCoverage&&a.enable(20),M.push(a.mask)}function y(M){let v=_[M.type],N;if(v){let F=yi[v];N=Jx.clone(F.uniforms)}else N=M.uniforms;return N}function D(M,v){let N;for(let F=0,R=u.length;F<R;F++){let B=u[F];if(B.cacheKey===v){N=B,++N.usedTimes;break}}return N===void 0&&(N=new nb(r,v,M,s),u.push(N)),N}function A(M){if(--M.usedTimes===0){let v=u.indexOf(M);u[v]=u[u.length-1],u.pop(),M.destroy()}}function w(M){l.remove(M)}function P(){l.dispose()}return{getParameters:p,getProgramCacheKey:m,getUniforms:y,acquireProgram:D,releaseProgram:A,releaseShaderCache:w,programs:u,dispose:P}}function sb(){let r=new WeakMap;function t(s){let o=r.get(s);return o===void 0&&(o={},r.set(s,o)),o}function e(s){r.delete(s)}function n(s,o,a){r.get(s)[o]=a}function i(){r=new WeakMap}return{get:t,remove:e,update:n,dispose:i}}function ob(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.material.id!==t.material.id?r.material.id-t.material.id:r.z!==t.z?r.z-t.z:r.id-t.id}function Bm(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.z!==t.z?t.z-r.z:r.id-t.id}function zm(){let r=[],t=0,e=[],n=[],i=[];function s(){t=0,e.length=0,n.length=0,i.length=0}function o(f,h,d,_,g,p){let m=r[t];return m===void 0?(m={id:f.id,object:f,geometry:h,material:d,groupOrder:_,renderOrder:f.renderOrder,z:g,group:p},r[t]=m):(m.id=f.id,m.object=f,m.geometry=h,m.material=d,m.groupOrder=_,m.renderOrder=f.renderOrder,m.z=g,m.group=p),t++,m}function a(f,h,d,_,g,p){let m=o(f,h,d,_,g,p);d.transmission>0?n.push(m):d.transparent===!0?i.push(m):e.push(m)}function l(f,h,d,_,g,p){let m=o(f,h,d,_,g,p);d.transmission>0?n.unshift(m):d.transparent===!0?i.unshift(m):e.unshift(m)}function c(f,h){e.length>1&&e.sort(f||ob),n.length>1&&n.sort(h||Bm),i.length>1&&i.sort(h||Bm)}function u(){for(let f=t,h=r.length;f<h;f++){let d=r[f];if(d.id===null)break;d.id=null,d.object=null,d.geometry=null,d.material=null,d.group=null}}return{opaque:e,transmissive:n,transparent:i,init:s,push:a,unshift:l,finish:u,sort:c}}function ab(){let r=new WeakMap;function t(n,i){let s=r.get(n),o;return s===void 0?(o=new zm,r.set(n,[o])):i>=s.length?(o=new zm,s.push(o)):o=s[i],o}function e(){r=new WeakMap}return{get:t,dispose:e}}function lb(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new j,color:new ce};break;case"SpotLight":e={position:new j,direction:new j,color:new ce,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new j,color:new ce,distance:0,decay:0};break;case"HemisphereLight":e={direction:new j,skyColor:new ce,groundColor:new ce};break;case"RectAreaLight":e={color:new ce,position:new j,halfWidth:new j,halfHeight:new j};break}return r[t.id]=e,e}}}function cb(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ue};break;case"SpotLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ue};break;case"PointLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ue,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[t.id]=e,e}}}var ub=0;function hb(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function fb(r){let t=new lb,e=cb(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new j);let i=new j,s=new Le,o=new Le;function a(c,u){let f=0,h=0,d=0;for(let N=0;N<9;N++)n.probe[N].set(0,0,0);let _=0,g=0,p=0,m=0,b=0,S=0,y=0,D=0,A=0,w=0,P=0;c.sort(hb);let M=u===!0?Math.PI:1;for(let N=0,F=c.length;N<F;N++){let R=c[N],B=R.color,Y=R.intensity,H=R.distance,J=R.shadow&&R.shadow.map?R.shadow.map.texture:null;if(R.isAmbientLight)f+=B.r*Y*M,h+=B.g*Y*M,d+=B.b*Y*M;else if(R.isLightProbe){for(let O=0;O<9;O++)n.probe[O].addScaledVector(R.sh.coefficients[O],Y);P++}else if(R.isDirectionalLight){let O=t.get(R);if(O.color.copy(R.color).multiplyScalar(R.intensity*M),R.castShadow){let L=R.shadow,C=e.get(R);C.shadowBias=L.bias,C.shadowNormalBias=L.normalBias,C.shadowRadius=L.radius,C.shadowMapSize=L.mapSize,n.directionalShadow[_]=C,n.directionalShadowMap[_]=J,n.directionalShadowMatrix[_]=R.shadow.matrix,S++}n.directional[_]=O,_++}else if(R.isSpotLight){let O=t.get(R);O.position.setFromMatrixPosition(R.matrixWorld),O.color.copy(B).multiplyScalar(Y*M),O.distance=H,O.coneCos=Math.cos(R.angle),O.penumbraCos=Math.cos(R.angle*(1-R.penumbra)),O.decay=R.decay,n.spot[p]=O;let L=R.shadow;if(R.map&&(n.spotLightMap[A]=R.map,A++,L.updateMatrices(R),R.castShadow&&w++),n.spotLightMatrix[p]=L.matrix,R.castShadow){let C=e.get(R);C.shadowBias=L.bias,C.shadowNormalBias=L.normalBias,C.shadowRadius=L.radius,C.shadowMapSize=L.mapSize,n.spotShadow[p]=C,n.spotShadowMap[p]=J,D++}p++}else if(R.isRectAreaLight){let O=t.get(R);O.color.copy(B).multiplyScalar(Y),O.halfWidth.set(R.width*.5,0,0),O.halfHeight.set(0,R.height*.5,0),n.rectArea[m]=O,m++}else if(R.isPointLight){let O=t.get(R);if(O.color.copy(R.color).multiplyScalar(R.intensity*M),O.distance=R.distance,O.decay=R.decay,R.castShadow){let L=R.shadow,C=e.get(R);C.shadowBias=L.bias,C.shadowNormalBias=L.normalBias,C.shadowRadius=L.radius,C.shadowMapSize=L.mapSize,C.shadowCameraNear=L.camera.near,C.shadowCameraFar=L.camera.far,n.pointShadow[g]=C,n.pointShadowMap[g]=J,n.pointShadowMatrix[g]=R.shadow.matrix,y++}n.point[g]=O,g++}else if(R.isHemisphereLight){let O=t.get(R);O.skyColor.copy(R.color).multiplyScalar(Y*M),O.groundColor.copy(R.groundColor).multiplyScalar(Y*M),n.hemi[b]=O,b++}}m>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=_t.LTC_FLOAT_1,n.rectAreaLTC2=_t.LTC_FLOAT_2):(n.rectAreaLTC1=_t.LTC_HALF_1,n.rectAreaLTC2=_t.LTC_HALF_2)),n.ambient[0]=f,n.ambient[1]=h,n.ambient[2]=d;let v=n.hash;(v.directionalLength!==_||v.pointLength!==g||v.spotLength!==p||v.rectAreaLength!==m||v.hemiLength!==b||v.numDirectionalShadows!==S||v.numPointShadows!==y||v.numSpotShadows!==D||v.numSpotMaps!==A||v.numLightProbes!==P)&&(n.directional.length=_,n.spot.length=p,n.rectArea.length=m,n.point.length=g,n.hemi.length=b,n.directionalShadow.length=S,n.directionalShadowMap.length=S,n.pointShadow.length=y,n.pointShadowMap.length=y,n.spotShadow.length=D,n.spotShadowMap.length=D,n.directionalShadowMatrix.length=S,n.pointShadowMatrix.length=y,n.spotLightMatrix.length=D+A-w,n.spotLightMap.length=A,n.numSpotLightShadowsWithMaps=w,n.numLightProbes=P,v.directionalLength=_,v.pointLength=g,v.spotLength=p,v.rectAreaLength=m,v.hemiLength=b,v.numDirectionalShadows=S,v.numPointShadows=y,v.numSpotShadows=D,v.numSpotMaps=A,v.numLightProbes=P,n.version=ub++)}function l(c,u){let f=0,h=0,d=0,_=0,g=0,p=u.matrixWorldInverse;for(let m=0,b=c.length;m<b;m++){let S=c[m];if(S.isDirectionalLight){let y=n.directional[f];y.direction.setFromMatrixPosition(S.matrixWorld),i.setFromMatrixPosition(S.target.matrixWorld),y.direction.sub(i),y.direction.transformDirection(p),f++}else if(S.isSpotLight){let y=n.spot[d];y.position.setFromMatrixPosition(S.matrixWorld),y.position.applyMatrix4(p),y.direction.setFromMatrixPosition(S.matrixWorld),i.setFromMatrixPosition(S.target.matrixWorld),y.direction.sub(i),y.direction.transformDirection(p),d++}else if(S.isRectAreaLight){let y=n.rectArea[_];y.position.setFromMatrixPosition(S.matrixWorld),y.position.applyMatrix4(p),o.identity(),s.copy(S.matrixWorld),s.premultiply(p),o.extractRotation(s),y.halfWidth.set(S.width*.5,0,0),y.halfHeight.set(0,S.height*.5,0),y.halfWidth.applyMatrix4(o),y.halfHeight.applyMatrix4(o),_++}else if(S.isPointLight){let y=n.point[h];y.position.setFromMatrixPosition(S.matrixWorld),y.position.applyMatrix4(p),h++}else if(S.isHemisphereLight){let y=n.hemi[g];y.direction.setFromMatrixPosition(S.matrixWorld),y.direction.transformDirection(p),g++}}}return{setup:a,setupView:l,state:n}}function km(r){let t=new fb(r),e=[],n=[];function i(u){c.camera=u,e.length=0,n.length=0}function s(u){e.push(u)}function o(u){n.push(u)}function a(u){t.setup(e,u)}function l(u){t.setupView(e,u)}let c={lightsArray:e,shadowsArray:n,camera:null,lights:t,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function db(r){let t=new WeakMap;function e(i,s=0){let o=t.get(i),a;return o===void 0?(a=new km(r),t.set(i,[a])):s>=o.length?(a=new km(r),o.push(a)):a=o[s],a}function n(){t=new WeakMap}return{get:e,dispose:n}}var mh=class extends rs{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Sx,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}},gh=class extends rs{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}},pb=`void main() {
|
|
3769
|
+
`+O)}else F!==""?console.warn("THREE.WebGLProgram: Program Info Log:",F):(R===""||B==="")&&(H=!1);H&&(N.diagnostics={runnable:Y,programLog:F,vertexShader:{log:R,prefix:m},fragmentShader:{log:B,prefix:p}})}i.deleteShader(D),i.deleteShader(A),P=new Ks(i,g),M=XM(i,g)}let P;this.getUniforms=function(){return P===void 0&&w(this),P};let M;this.getAttributes=function(){return M===void 0&&w(this),M};let v=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return v===!1&&(v=i.getProgramParameter(g,OM)),v},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(g),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=BM++,this.cacheKey=t,this.usedTimes=1,this.program=g,this.vertexShader=D,this.fragmentShader=A,this}var ib=0,dh=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(t);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(t){let e=this.materialCache.get(t);for(let n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){let e=this.materialCache,n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){let e=this.shaderCache,n=e.get(t);return n===void 0&&(n=new ph(t),e.set(t,n)),n}},ph=class{constructor(t){this.id=ib++,this.code=t,this.usedTimes=0}};function rb(r,t,e,n,i,s,o){let a=new Al,l=new dh,c=new Set,u=[],h=i.logarithmicDepthBuffer,f=i.vertexTextures,d=i.precision,_={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(M){return c.add(M),M===0?"uv":`uv${M}`}function m(M,v,N,F,R){let B=F.fog,Y=R.geometry,H=M.isMeshStandardMaterial?F.environment:null,J=(M.isMeshStandardMaterial?e:t).get(M.envMap||H),O=J&&J.mapping===Gl?J.image.height:null,L=_[M.type];M.precision!==null&&(d=i.getMaxPrecision(M.precision),d!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",d,"instead."));let C=Y.morphAttributes.position||Y.morphAttributes.normal||Y.morphAttributes.color,ot=C!==void 0?C.length:0,vt=0;Y.morphAttributes.position!==void 0&&(vt=1),Y.morphAttributes.normal!==void 0&&(vt=2),Y.morphAttributes.color!==void 0&&(vt=3);let Wt,q,tt,pt;if(L){let Zt=yi[L];Wt=Zt.vertexShader,q=Zt.fragmentShader}else Wt=M.vertexShader,q=M.fragmentShader,l.update(M),tt=l.getVertexShaderID(M),pt=l.getFragmentShaderID(M);let st=r.getRenderTarget(),Ft=R.isInstancedMesh===!0,Nt=R.isBatchedMesh===!0,V=!!M.map,Yt=!!M.matcap,Et=!!J,Tt=!!M.aoMap,St=!!M.lightMap,zt=!!M.bumpMap,Ut=!!M.normalMap,k=!!M.displacementMap,Qt=!!M.emissiveMap,T=!!M.metalnessMap,x=!!M.roughnessMap,I=M.anisotropy>0,G=M.clearcoat>0,K=M.dispersion>0,Q=M.iridescence>0,ht=M.sheen>0,ct=M.transmission>0,nt=I&&!!M.anisotropyMap,bt=G&&!!M.clearcoatMap,rt=G&&!!M.clearcoatNormalMap,ft=G&&!!M.clearcoatRoughnessMap,Ot=Q&&!!M.iridescenceMap,it=Q&&!!M.iridescenceThicknessMap,yt=ht&&!!M.sheenColorMap,Bt=ht&&!!M.sheenRoughnessMap,Vt=!!M.specularMap,he=!!M.specularColorMap,kt=!!M.specularIntensityMap,U=ct&&!!M.transmissionMap,$=ct&&!!M.thicknessMap,et=!!M.gradientMap,ut=!!M.alphaMap,lt=M.alphaTest>0,Dt=!!M.alphaHash,te=!!M.extensions,ae=mr;M.toneMapped&&(st===null||st.isXRRenderTarget===!0)&&(ae=r.toneMapping);let re={shaderID:L,shaderType:M.type,shaderName:M.name,vertexShader:Wt,fragmentShader:q,defines:M.defines,customVertexShaderID:tt,customFragmentShaderID:pt,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:d,batching:Nt,instancing:Ft,instancingColor:Ft&&R.instanceColor!==null,instancingMorph:Ft&&R.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:st===null?r.outputColorSpace:st.isXRRenderTarget===!0?st.texture.colorSpace:yr,alphaToCoverage:!!M.alphaToCoverage,map:V,matcap:Yt,envMap:Et,envMapMode:Et&&J.mapping,envMapCubeUVHeight:O,aoMap:Tt,lightMap:St,bumpMap:zt,normalMap:Ut,displacementMap:f&&k,emissiveMap:Qt,normalMapObjectSpace:Ut&&M.normalMapType===wx,normalMapTangentSpace:Ut&&M.normalMapType===bx,metalnessMap:T,roughnessMap:x,anisotropy:I,anisotropyMap:nt,clearcoat:G,clearcoatMap:bt,clearcoatNormalMap:rt,clearcoatRoughnessMap:ft,dispersion:K,iridescence:Q,iridescenceMap:Ot,iridescenceThicknessMap:it,sheen:ht,sheenColorMap:yt,sheenRoughnessMap:Bt,specularMap:Vt,specularColorMap:he,specularIntensityMap:kt,transmission:ct,transmissionMap:U,thicknessMap:$,gradientMap:et,opaque:M.transparent===!1&&M.blending===pr&&M.alphaToCoverage===!1,alphaMap:ut,alphaTest:lt,alphaHash:Dt,combine:M.combine,mapUv:V&&g(M.map.channel),aoMapUv:Tt&&g(M.aoMap.channel),lightMapUv:St&&g(M.lightMap.channel),bumpMapUv:zt&&g(M.bumpMap.channel),normalMapUv:Ut&&g(M.normalMap.channel),displacementMapUv:k&&g(M.displacementMap.channel),emissiveMapUv:Qt&&g(M.emissiveMap.channel),metalnessMapUv:T&&g(M.metalnessMap.channel),roughnessMapUv:x&&g(M.roughnessMap.channel),anisotropyMapUv:nt&&g(M.anisotropyMap.channel),clearcoatMapUv:bt&&g(M.clearcoatMap.channel),clearcoatNormalMapUv:rt&&g(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ft&&g(M.clearcoatRoughnessMap.channel),iridescenceMapUv:Ot&&g(M.iridescenceMap.channel),iridescenceThicknessMapUv:it&&g(M.iridescenceThicknessMap.channel),sheenColorMapUv:yt&&g(M.sheenColorMap.channel),sheenRoughnessMapUv:Bt&&g(M.sheenRoughnessMap.channel),specularMapUv:Vt&&g(M.specularMap.channel),specularColorMapUv:he&&g(M.specularColorMap.channel),specularIntensityMapUv:kt&&g(M.specularIntensityMap.channel),transmissionMapUv:U&&g(M.transmissionMap.channel),thicknessMapUv:$&&g(M.thicknessMap.channel),alphaMapUv:ut&&g(M.alphaMap.channel),vertexTangents:!!Y.attributes.tangent&&(Ut||I),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!Y.attributes.color&&Y.attributes.color.itemSize===4,pointsUvs:R.isPoints===!0&&!!Y.attributes.uv&&(V||ut),fog:!!B,useFog:M.fog===!0,fogExp2:!!B&&B.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:R.isSkinnedMesh===!0,morphTargets:Y.morphAttributes.position!==void 0,morphNormals:Y.morphAttributes.normal!==void 0,morphColors:Y.morphAttributes.color!==void 0,morphTargetsCount:ot,morphTextureStride:vt,numDirLights:v.directional.length,numPointLights:v.point.length,numSpotLights:v.spot.length,numSpotLightMaps:v.spotLightMap.length,numRectAreaLights:v.rectArea.length,numHemiLights:v.hemi.length,numDirLightShadows:v.directionalShadowMap.length,numPointLightShadows:v.pointShadowMap.length,numSpotLightShadows:v.spotShadowMap.length,numSpotLightShadowsWithMaps:v.numSpotLightShadowsWithMaps,numLightProbes:v.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:M.dithering,shadowMapEnabled:r.shadowMap.enabled&&N.length>0,shadowMapType:r.shadowMap.type,toneMapping:ae,useLegacyLights:r._useLegacyLights,decodeVideoTexture:V&&M.map.isVideoTexture===!0&&me.getTransfer(M.map.colorSpace)===ye,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===Vi,flipSided:M.side===Cn,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:te&&M.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:te&&M.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return re.vertexUv1s=c.has(1),re.vertexUv2s=c.has(2),re.vertexUv3s=c.has(3),c.clear(),re}function p(M){let v=[];if(M.shaderID?v.push(M.shaderID):(v.push(M.customVertexShaderID),v.push(M.customFragmentShaderID)),M.defines!==void 0)for(let N in M.defines)v.push(N),v.push(M.defines[N]);return M.isRawShaderMaterial===!1&&(b(v,M),y(v,M),v.push(r.outputColorSpace)),v.push(M.customProgramCacheKey),v.join()}function b(M,v){M.push(v.precision),M.push(v.outputColorSpace),M.push(v.envMapMode),M.push(v.envMapCubeUVHeight),M.push(v.mapUv),M.push(v.alphaMapUv),M.push(v.lightMapUv),M.push(v.aoMapUv),M.push(v.bumpMapUv),M.push(v.normalMapUv),M.push(v.displacementMapUv),M.push(v.emissiveMapUv),M.push(v.metalnessMapUv),M.push(v.roughnessMapUv),M.push(v.anisotropyMapUv),M.push(v.clearcoatMapUv),M.push(v.clearcoatNormalMapUv),M.push(v.clearcoatRoughnessMapUv),M.push(v.iridescenceMapUv),M.push(v.iridescenceThicknessMapUv),M.push(v.sheenColorMapUv),M.push(v.sheenRoughnessMapUv),M.push(v.specularMapUv),M.push(v.specularColorMapUv),M.push(v.specularIntensityMapUv),M.push(v.transmissionMapUv),M.push(v.thicknessMapUv),M.push(v.combine),M.push(v.fogExp2),M.push(v.sizeAttenuation),M.push(v.morphTargetsCount),M.push(v.morphAttributeCount),M.push(v.numDirLights),M.push(v.numPointLights),M.push(v.numSpotLights),M.push(v.numSpotLightMaps),M.push(v.numHemiLights),M.push(v.numRectAreaLights),M.push(v.numDirLightShadows),M.push(v.numPointLightShadows),M.push(v.numSpotLightShadows),M.push(v.numSpotLightShadowsWithMaps),M.push(v.numLightProbes),M.push(v.shadowMapType),M.push(v.toneMapping),M.push(v.numClippingPlanes),M.push(v.numClipIntersection),M.push(v.depthPacking)}function y(M,v){a.disableAll(),v.supportsVertexTextures&&a.enable(0),v.instancing&&a.enable(1),v.instancingColor&&a.enable(2),v.instancingMorph&&a.enable(3),v.matcap&&a.enable(4),v.envMap&&a.enable(5),v.normalMapObjectSpace&&a.enable(6),v.normalMapTangentSpace&&a.enable(7),v.clearcoat&&a.enable(8),v.iridescence&&a.enable(9),v.alphaTest&&a.enable(10),v.vertexColors&&a.enable(11),v.vertexAlphas&&a.enable(12),v.vertexUv1s&&a.enable(13),v.vertexUv2s&&a.enable(14),v.vertexUv3s&&a.enable(15),v.vertexTangents&&a.enable(16),v.anisotropy&&a.enable(17),v.alphaHash&&a.enable(18),v.batching&&a.enable(19),v.dispersion&&a.enable(20),M.push(a.mask),a.disableAll(),v.fog&&a.enable(0),v.useFog&&a.enable(1),v.flatShading&&a.enable(2),v.logarithmicDepthBuffer&&a.enable(3),v.skinning&&a.enable(4),v.morphTargets&&a.enable(5),v.morphNormals&&a.enable(6),v.morphColors&&a.enable(7),v.premultipliedAlpha&&a.enable(8),v.shadowMapEnabled&&a.enable(9),v.useLegacyLights&&a.enable(10),v.doubleSided&&a.enable(11),v.flipSided&&a.enable(12),v.useDepthPacking&&a.enable(13),v.dithering&&a.enable(14),v.transmission&&a.enable(15),v.sheen&&a.enable(16),v.opaque&&a.enable(17),v.pointsUvs&&a.enable(18),v.decodeVideoTexture&&a.enable(19),v.alphaToCoverage&&a.enable(20),M.push(a.mask)}function S(M){let v=_[M.type],N;if(v){let F=yi[v];N=Jx.clone(F.uniforms)}else N=M.uniforms;return N}function D(M,v){let N;for(let F=0,R=u.length;F<R;F++){let B=u[F];if(B.cacheKey===v){N=B,++N.usedTimes;break}}return N===void 0&&(N=new nb(r,v,M,s),u.push(N)),N}function A(M){if(--M.usedTimes===0){let v=u.indexOf(M);u[v]=u[u.length-1],u.pop(),M.destroy()}}function w(M){l.remove(M)}function P(){l.dispose()}return{getParameters:m,getProgramCacheKey:p,getUniforms:S,acquireProgram:D,releaseProgram:A,releaseShaderCache:w,programs:u,dispose:P}}function sb(){let r=new WeakMap;function t(s){let o=r.get(s);return o===void 0&&(o={},r.set(s,o)),o}function e(s){r.delete(s)}function n(s,o,a){r.get(s)[o]=a}function i(){r=new WeakMap}return{get:t,remove:e,update:n,dispose:i}}function ob(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.material.id!==t.material.id?r.material.id-t.material.id:r.z!==t.z?r.z-t.z:r.id-t.id}function Bm(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.z!==t.z?t.z-r.z:r.id-t.id}function zm(){let r=[],t=0,e=[],n=[],i=[];function s(){t=0,e.length=0,n.length=0,i.length=0}function o(h,f,d,_,g,m){let p=r[t];return p===void 0?(p={id:h.id,object:h,geometry:f,material:d,groupOrder:_,renderOrder:h.renderOrder,z:g,group:m},r[t]=p):(p.id=h.id,p.object=h,p.geometry=f,p.material=d,p.groupOrder=_,p.renderOrder=h.renderOrder,p.z=g,p.group=m),t++,p}function a(h,f,d,_,g,m){let p=o(h,f,d,_,g,m);d.transmission>0?n.push(p):d.transparent===!0?i.push(p):e.push(p)}function l(h,f,d,_,g,m){let p=o(h,f,d,_,g,m);d.transmission>0?n.unshift(p):d.transparent===!0?i.unshift(p):e.unshift(p)}function c(h,f){e.length>1&&e.sort(h||ob),n.length>1&&n.sort(f||Bm),i.length>1&&i.sort(f||Bm)}function u(){for(let h=t,f=r.length;h<f;h++){let d=r[h];if(d.id===null)break;d.id=null,d.object=null,d.geometry=null,d.material=null,d.group=null}}return{opaque:e,transmissive:n,transparent:i,init:s,push:a,unshift:l,finish:u,sort:c}}function ab(){let r=new WeakMap;function t(n,i){let s=r.get(n),o;return s===void 0?(o=new zm,r.set(n,[o])):i>=s.length?(o=new zm,s.push(o)):o=s[i],o}function e(){r=new WeakMap}return{get:t,dispose:e}}function lb(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new j,color:new ce};break;case"SpotLight":e={position:new j,direction:new j,color:new ce,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new j,color:new ce,distance:0,decay:0};break;case"HemisphereLight":e={direction:new j,skyColor:new ce,groundColor:new ce};break;case"RectAreaLight":e={color:new ce,position:new j,halfWidth:new j,halfHeight:new j};break}return r[t.id]=e,e}}}function cb(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ue};break;case"SpotLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ue};break;case"PointLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ue,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[t.id]=e,e}}}var ub=0;function hb(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function fb(r){let t=new lb,e=cb(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new j);let i=new j,s=new Le,o=new Le;function a(c,u){let h=0,f=0,d=0;for(let N=0;N<9;N++)n.probe[N].set(0,0,0);let _=0,g=0,m=0,p=0,b=0,y=0,S=0,D=0,A=0,w=0,P=0;c.sort(hb);let M=u===!0?Math.PI:1;for(let N=0,F=c.length;N<F;N++){let R=c[N],B=R.color,Y=R.intensity,H=R.distance,J=R.shadow&&R.shadow.map?R.shadow.map.texture:null;if(R.isAmbientLight)h+=B.r*Y*M,f+=B.g*Y*M,d+=B.b*Y*M;else if(R.isLightProbe){for(let O=0;O<9;O++)n.probe[O].addScaledVector(R.sh.coefficients[O],Y);P++}else if(R.isDirectionalLight){let O=t.get(R);if(O.color.copy(R.color).multiplyScalar(R.intensity*M),R.castShadow){let L=R.shadow,C=e.get(R);C.shadowBias=L.bias,C.shadowNormalBias=L.normalBias,C.shadowRadius=L.radius,C.shadowMapSize=L.mapSize,n.directionalShadow[_]=C,n.directionalShadowMap[_]=J,n.directionalShadowMatrix[_]=R.shadow.matrix,y++}n.directional[_]=O,_++}else if(R.isSpotLight){let O=t.get(R);O.position.setFromMatrixPosition(R.matrixWorld),O.color.copy(B).multiplyScalar(Y*M),O.distance=H,O.coneCos=Math.cos(R.angle),O.penumbraCos=Math.cos(R.angle*(1-R.penumbra)),O.decay=R.decay,n.spot[m]=O;let L=R.shadow;if(R.map&&(n.spotLightMap[A]=R.map,A++,L.updateMatrices(R),R.castShadow&&w++),n.spotLightMatrix[m]=L.matrix,R.castShadow){let C=e.get(R);C.shadowBias=L.bias,C.shadowNormalBias=L.normalBias,C.shadowRadius=L.radius,C.shadowMapSize=L.mapSize,n.spotShadow[m]=C,n.spotShadowMap[m]=J,D++}m++}else if(R.isRectAreaLight){let O=t.get(R);O.color.copy(B).multiplyScalar(Y),O.halfWidth.set(R.width*.5,0,0),O.halfHeight.set(0,R.height*.5,0),n.rectArea[p]=O,p++}else if(R.isPointLight){let O=t.get(R);if(O.color.copy(R.color).multiplyScalar(R.intensity*M),O.distance=R.distance,O.decay=R.decay,R.castShadow){let L=R.shadow,C=e.get(R);C.shadowBias=L.bias,C.shadowNormalBias=L.normalBias,C.shadowRadius=L.radius,C.shadowMapSize=L.mapSize,C.shadowCameraNear=L.camera.near,C.shadowCameraFar=L.camera.far,n.pointShadow[g]=C,n.pointShadowMap[g]=J,n.pointShadowMatrix[g]=R.shadow.matrix,S++}n.point[g]=O,g++}else if(R.isHemisphereLight){let O=t.get(R);O.skyColor.copy(R.color).multiplyScalar(Y*M),O.groundColor.copy(R.groundColor).multiplyScalar(Y*M),n.hemi[b]=O,b++}}p>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=_t.LTC_FLOAT_1,n.rectAreaLTC2=_t.LTC_FLOAT_2):(n.rectAreaLTC1=_t.LTC_HALF_1,n.rectAreaLTC2=_t.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=f,n.ambient[2]=d;let v=n.hash;(v.directionalLength!==_||v.pointLength!==g||v.spotLength!==m||v.rectAreaLength!==p||v.hemiLength!==b||v.numDirectionalShadows!==y||v.numPointShadows!==S||v.numSpotShadows!==D||v.numSpotMaps!==A||v.numLightProbes!==P)&&(n.directional.length=_,n.spot.length=m,n.rectArea.length=p,n.point.length=g,n.hemi.length=b,n.directionalShadow.length=y,n.directionalShadowMap.length=y,n.pointShadow.length=S,n.pointShadowMap.length=S,n.spotShadow.length=D,n.spotShadowMap.length=D,n.directionalShadowMatrix.length=y,n.pointShadowMatrix.length=S,n.spotLightMatrix.length=D+A-w,n.spotLightMap.length=A,n.numSpotLightShadowsWithMaps=w,n.numLightProbes=P,v.directionalLength=_,v.pointLength=g,v.spotLength=m,v.rectAreaLength=p,v.hemiLength=b,v.numDirectionalShadows=y,v.numPointShadows=S,v.numSpotShadows=D,v.numSpotMaps=A,v.numLightProbes=P,n.version=ub++)}function l(c,u){let h=0,f=0,d=0,_=0,g=0,m=u.matrixWorldInverse;for(let p=0,b=c.length;p<b;p++){let y=c[p];if(y.isDirectionalLight){let S=n.directional[h];S.direction.setFromMatrixPosition(y.matrixWorld),i.setFromMatrixPosition(y.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(m),h++}else if(y.isSpotLight){let S=n.spot[d];S.position.setFromMatrixPosition(y.matrixWorld),S.position.applyMatrix4(m),S.direction.setFromMatrixPosition(y.matrixWorld),i.setFromMatrixPosition(y.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(m),d++}else if(y.isRectAreaLight){let S=n.rectArea[_];S.position.setFromMatrixPosition(y.matrixWorld),S.position.applyMatrix4(m),o.identity(),s.copy(y.matrixWorld),s.premultiply(m),o.extractRotation(s),S.halfWidth.set(y.width*.5,0,0),S.halfHeight.set(0,y.height*.5,0),S.halfWidth.applyMatrix4(o),S.halfHeight.applyMatrix4(o),_++}else if(y.isPointLight){let S=n.point[f];S.position.setFromMatrixPosition(y.matrixWorld),S.position.applyMatrix4(m),f++}else if(y.isHemisphereLight){let S=n.hemi[g];S.direction.setFromMatrixPosition(y.matrixWorld),S.direction.transformDirection(m),g++}}}return{setup:a,setupView:l,state:n}}function km(r){let t=new fb(r),e=[],n=[];function i(u){c.camera=u,e.length=0,n.length=0}function s(u){e.push(u)}function o(u){n.push(u)}function a(u){t.setup(e,u)}function l(u){t.setupView(e,u)}let c={lightsArray:e,shadowsArray:n,camera:null,lights:t,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function db(r){let t=new WeakMap;function e(i,s=0){let o=t.get(i),a;return o===void 0?(a=new km(r),t.set(i,[a])):s>=o.length?(a=new km(r),o.push(a)):a=o[s],a}function n(){t=new WeakMap}return{get:e,dispose:n}}var mh=class extends rs{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Sx,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}},gh=class extends rs{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}},pb=`void main() {
|
|
3770
3770
|
gl_Position = vec4( position, 1.0 );
|
|
3771
3771
|
}`,mb=`uniform sampler2D shadow_pass;
|
|
3772
3772
|
uniform vec2 resolution;
|
|
@@ -3794,7 +3794,7 @@ void main() {
|
|
|
3794
3794
|
squared_mean = squared_mean / samples;
|
|
3795
3795
|
float std_dev = sqrt( squared_mean - mean * mean );
|
|
3796
3796
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
3797
|
-
}`;function gb(r,t,e){let n=new Jo,i=new ue,s=new ue,o=new Ye,a=new mh({depthPacking:Mx}),l=new gh,c={},u=e.maxTextureSize,f={[gr]:Cn,[Cn]:gr,[Vi]:Vi},h=new Kn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ue},radius:{value:4}},vertexShader:pb,fragmentShader:mb}),d=h.clone();d.defines.HORIZONTAL_PASS=1;let _=new Mi;_.setAttribute("position",new Zn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new ai(_,h),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Xm;let m=this.type;this.render=function(A,w,P){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||A.length===0)return;let M=r.getRenderTarget(),v=r.getActiveCubeFace(),N=r.getActiveMipmapLevel(),F=r.state;F.setBlending(dr),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);let R=m!==zi&&this.type===zi,B=m===zi&&this.type!==zi;for(let Y=0,H=A.length;Y<H;Y++){let J=A[Y],O=J.shadow;if(O===void 0){console.warn("THREE.WebGLShadowMap:",J,"has no shadow.");continue}if(O.autoUpdate===!1&&O.needsUpdate===!1)continue;i.copy(O.mapSize);let L=O.getFrameExtents();if(i.multiply(L),s.copy(O.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/L.x),i.x=s.x*L.x,O.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/L.y),i.y=s.y*L.y,O.mapSize.y=s.y)),O.map===null||R===!0||B===!0){let ot=this.type!==zi?{minFilter:Yn,magFilter:Yn}:{};O.map!==null&&O.map.dispose(),O.map=new Gi(i.x,i.y,ot),O.map.texture.name=J.name+".shadowMap",O.camera.updateProjectionMatrix()}r.setRenderTarget(O.map),r.clear();let C=O.getViewportCount();for(let ot=0;ot<C;ot++){let vt=O.getViewport(ot);o.set(s.x*vt.x,s.y*vt.y,s.x*vt.z,s.y*vt.w),F.viewport(o),O.updateMatrices(J,ot),n=O.getFrustum(),y(w,P,O.camera,J,this.type)}O.isPointLightShadow!==!0&&this.type===zi&&b(O,P),O.needsUpdate=!1}m=this.type,p.needsUpdate=!1,r.setRenderTarget(M,v,N)};function b(A,w){let P=t.update(g);h.defines.VSM_SAMPLES!==A.blurSamples&&(h.defines.VSM_SAMPLES=A.blurSamples,d.defines.VSM_SAMPLES=A.blurSamples,h.needsUpdate=!0,d.needsUpdate=!0),A.mapPass===null&&(A.mapPass=new Gi(i.x,i.y)),h.uniforms.shadow_pass.value=A.map.texture,h.uniforms.resolution.value=A.mapSize,h.uniforms.radius.value=A.radius,r.setRenderTarget(A.mapPass),r.clear(),r.renderBufferDirect(w,null,P,h,g,null),d.uniforms.shadow_pass.value=A.mapPass.texture,d.uniforms.resolution.value=A.mapSize,d.uniforms.radius.value=A.radius,r.setRenderTarget(A.map),r.clear(),r.renderBufferDirect(w,null,P,d,g,null)}function S(A,w,P,M){let v=null,N=P.isPointLight===!0?A.customDistanceMaterial:A.customDepthMaterial;if(N!==void 0)v=N;else if(v=P.isPointLight===!0?l:a,r.localClippingEnabled&&w.clipShadows===!0&&Array.isArray(w.clippingPlanes)&&w.clippingPlanes.length!==0||w.displacementMap&&w.displacementScale!==0||w.alphaMap&&w.alphaTest>0||w.map&&w.alphaTest>0){let F=v.uuid,R=w.uuid,B=c[F];B===void 0&&(B={},c[F]=B);let Y=B[R];Y===void 0&&(Y=v.clone(),B[R]=Y,w.addEventListener("dispose",D)),v=Y}if(v.visible=w.visible,v.wireframe=w.wireframe,M===zi?v.side=w.shadowSide!==null?w.shadowSide:w.side:v.side=w.shadowSide!==null?w.shadowSide:f[w.side],v.alphaMap=w.alphaMap,v.alphaTest=w.alphaTest,v.map=w.map,v.clipShadows=w.clipShadows,v.clippingPlanes=w.clippingPlanes,v.clipIntersection=w.clipIntersection,v.displacementMap=w.displacementMap,v.displacementScale=w.displacementScale,v.displacementBias=w.displacementBias,v.wireframeLinewidth=w.wireframeLinewidth,v.linewidth=w.linewidth,P.isPointLight===!0&&v.isMeshDistanceMaterial===!0){let F=r.properties.get(v);F.light=P}return v}function y(A,w,P,M,v){if(A.visible===!1)return;if(A.layers.test(w.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&v===zi)&&(!A.frustumCulled||n.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,A.matrixWorld);let R=t.update(A),B=A.material;if(Array.isArray(B)){let Y=R.groups;for(let H=0,J=Y.length;H<J;H++){let O=Y[H],L=B[O.materialIndex];if(L&&L.visible){let C=S(A,L,M,v);A.onBeforeShadow(r,A,w,P,R,C,O),r.renderBufferDirect(P,null,R,C,A,O),A.onAfterShadow(r,A,w,P,R,C,O)}}}else if(B.visible){let Y=S(A,B,M,v);A.onBeforeShadow(r,A,w,P,R,Y,null),r.renderBufferDirect(P,null,R,Y,A,null),A.onAfterShadow(r,A,w,P,R,Y,null)}}let F=A.children;for(let R=0,B=F.length;R<B;R++)y(F[R],w,P,M,v)}function D(A){A.target.removeEventListener("dispose",D);for(let P in c){let M=c[P],v=A.target.uuid;v in M&&(M[v].dispose(),delete M[v])}}}function _b(r){function t(){let U=!1,$=new Ye,et=null,ut=new Ye(0,0,0,0);return{setMask:function(at){et!==at&&!U&&(r.colorMask(at,at,at,at),et=at)},setLocked:function(at){U=at},setClear:function(at,Dt,te,ae,re){re===!0&&(at*=ae,Dt*=ae,te*=ae),$.set(at,Dt,te,ae),ut.equals($)===!1&&(r.clearColor(at,Dt,te,ae),ut.copy($))},reset:function(){U=!1,et=null,ut.set(-1,0,0,0)}}}function e(){let U=!1,$=null,et=null,ut=null;return{setTest:function(at){at?pt(r.DEPTH_TEST):st(r.DEPTH_TEST)},setMask:function(at){$!==at&&!U&&(r.depthMask(at),$=at)},setFunc:function(at){if(et!==at){switch(at){case Z0:r.depthFunc(r.NEVER);break;case J0:r.depthFunc(r.ALWAYS);break;case $0:r.depthFunc(r.LESS);break;case gl:r.depthFunc(r.LEQUAL);break;case K0:r.depthFunc(r.EQUAL);break;case j0:r.depthFunc(r.GEQUAL);break;case Q0:r.depthFunc(r.GREATER);break;case tx:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}et=at}},setLocked:function(at){U=at},setClear:function(at){ut!==at&&(r.clearDepth(at),ut=at)},reset:function(){U=!1,$=null,et=null,ut=null}}}function n(){let U=!1,$=null,et=null,ut=null,at=null,Dt=null,te=null,ae=null,re=null;return{setTest:function(Zt){U||(Zt?pt(r.STENCIL_TEST):st(r.STENCIL_TEST))},setMask:function(Zt){$!==Zt&&!U&&(r.stencilMask(Zt),$=Zt)},setFunc:function(Zt,Ct,Mt){(et!==Zt||ut!==Ct||at!==Mt)&&(r.stencilFunc(Zt,Ct,Mt),et=Zt,ut=Ct,at=Mt)},setOp:function(Zt,Ct,Mt){(Dt!==Zt||te!==Ct||ae!==Mt)&&(r.stencilOp(Zt,Ct,Mt),Dt=Zt,te=Ct,ae=Mt)},setLocked:function(Zt){U=Zt},setClear:function(Zt){re!==Zt&&(r.clearStencil(Zt),re=Zt)},reset:function(){U=!1,$=null,et=null,ut=null,at=null,Dt=null,te=null,ae=null,re=null}}}let i=new t,s=new e,o=new n,a=new WeakMap,l=new WeakMap,c={},u={},f=new WeakMap,h=[],d=null,_=!1,g=null,p=null,m=null,b=null,S=null,y=null,D=null,A=new ce(0,0,0),w=0,P=!1,M=null,v=null,N=null,F=null,R=null,B=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Y=!1,H=0,J=r.getParameter(r.VERSION);J.indexOf("WebGL")!==-1?(H=parseFloat(/^WebGL (\d)/.exec(J)[1]),Y=H>=1):J.indexOf("OpenGL ES")!==-1&&(H=parseFloat(/^OpenGL ES (\d)/.exec(J)[1]),Y=H>=2);let O=null,L={},C=r.getParameter(r.SCISSOR_BOX),ot=r.getParameter(r.VIEWPORT),vt=new Ye().fromArray(C),Wt=new Ye().fromArray(ot);function q(U,$,et,ut){let at=new Uint8Array(4),Dt=r.createTexture();r.bindTexture(U,Dt),r.texParameteri(U,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(U,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let te=0;te<et;te++)U===r.TEXTURE_3D||U===r.TEXTURE_2D_ARRAY?r.texImage3D($,0,r.RGBA,1,1,ut,0,r.RGBA,r.UNSIGNED_BYTE,at):r.texImage2D($+te,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,at);return Dt}let tt={};tt[r.TEXTURE_2D]=q(r.TEXTURE_2D,r.TEXTURE_2D,1),tt[r.TEXTURE_CUBE_MAP]=q(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),tt[r.TEXTURE_2D_ARRAY]=q(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),tt[r.TEXTURE_3D]=q(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),pt(r.DEPTH_TEST),s.setFunc(gl),zt(!1),Ut(vp),pt(r.CULL_FACE),Tt(dr);function pt(U){c[U]!==!0&&(r.enable(U),c[U]=!0)}function st(U){c[U]!==!1&&(r.disable(U),c[U]=!1)}function Ft(U,$){return u[U]!==$?(r.bindFramebuffer(U,$),u[U]=$,U===r.DRAW_FRAMEBUFFER&&(u[r.FRAMEBUFFER]=$),U===r.FRAMEBUFFER&&(u[r.DRAW_FRAMEBUFFER]=$),!0):!1}function Nt(U,$){let et=h,ut=!1;if(U){et=f.get($),et===void 0&&(et=[],f.set($,et));let at=U.textures;if(et.length!==at.length||et[0]!==r.COLOR_ATTACHMENT0){for(let Dt=0,te=at.length;Dt<te;Dt++)et[Dt]=r.COLOR_ATTACHMENT0+Dt;et.length=at.length,ut=!0}}else et[0]!==r.BACK&&(et[0]=r.BACK,ut=!0);ut&&r.drawBuffers(et)}function V(U){return d!==U?(r.useProgram(U),d=U,!0):!1}let Yt={[Qr]:r.FUNC_ADD,[P0]:r.FUNC_SUBTRACT,[I0]:r.FUNC_REVERSE_SUBTRACT};Yt[L0]=r.MIN,Yt[F0]=r.MAX;let Et={[N0]:r.ZERO,[U0]:r.ONE,[O0]:r.SRC_COLOR,[Ku]:r.SRC_ALPHA,[G0]:r.SRC_ALPHA_SATURATE,[V0]:r.DST_COLOR,[z0]:r.DST_ALPHA,[B0]:r.ONE_MINUS_SRC_COLOR,[ju]:r.ONE_MINUS_SRC_ALPHA,[H0]:r.ONE_MINUS_DST_COLOR,[k0]:r.ONE_MINUS_DST_ALPHA,[W0]:r.CONSTANT_COLOR,[X0]:r.ONE_MINUS_CONSTANT_COLOR,[q0]:r.CONSTANT_ALPHA,[Y0]:r.ONE_MINUS_CONSTANT_ALPHA};function Tt(U,$,et,ut,at,Dt,te,ae,re,Zt){if(U===dr){_===!0&&(st(r.BLEND),_=!1);return}if(_===!1&&(pt(r.BLEND),_=!0),U!==R0){if(U!==g||Zt!==P){if((p!==Qr||S!==Qr)&&(r.blendEquation(r.FUNC_ADD),p=Qr,S=Qr),Zt)switch(U){case pr:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case yp:r.blendFunc(r.ONE,r.ONE);break;case Sp:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Mp:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",U);break}else switch(U){case pr:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case yp:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case Sp:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Mp:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",U);break}m=null,b=null,y=null,D=null,A.set(0,0,0),w=0,g=U,P=Zt}return}at=at||$,Dt=Dt||et,te=te||ut,($!==p||at!==S)&&(r.blendEquationSeparate(Yt[$],Yt[at]),p=$,S=at),(et!==m||ut!==b||Dt!==y||te!==D)&&(r.blendFuncSeparate(Et[et],Et[ut],Et[Dt],Et[te]),m=et,b=ut,y=Dt,D=te),(ae.equals(A)===!1||re!==w)&&(r.blendColor(ae.r,ae.g,ae.b,re),A.copy(ae),w=re),g=U,P=!1}function St(U,$){U.side===Vi?st(r.CULL_FACE):pt(r.CULL_FACE);let et=U.side===Cn;$&&(et=!et),zt(et),U.blending===pr&&U.transparent===!1?Tt(dr):Tt(U.blending,U.blendEquation,U.blendSrc,U.blendDst,U.blendEquationAlpha,U.blendSrcAlpha,U.blendDstAlpha,U.blendColor,U.blendAlpha,U.premultipliedAlpha),s.setFunc(U.depthFunc),s.setTest(U.depthTest),s.setMask(U.depthWrite),i.setMask(U.colorWrite);let ut=U.stencilWrite;o.setTest(ut),ut&&(o.setMask(U.stencilWriteMask),o.setFunc(U.stencilFunc,U.stencilRef,U.stencilFuncMask),o.setOp(U.stencilFail,U.stencilZFail,U.stencilZPass)),Qt(U.polygonOffset,U.polygonOffsetFactor,U.polygonOffsetUnits),U.alphaToCoverage===!0?pt(r.SAMPLE_ALPHA_TO_COVERAGE):st(r.SAMPLE_ALPHA_TO_COVERAGE)}function zt(U){M!==U&&(U?r.frontFace(r.CW):r.frontFace(r.CCW),M=U)}function Ut(U){U!==D0?(pt(r.CULL_FACE),U!==v&&(U===vp?r.cullFace(r.BACK):U===C0?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):st(r.CULL_FACE),v=U}function k(U){U!==N&&(Y&&r.lineWidth(U),N=U)}function Qt(U,$,et){U?(pt(r.POLYGON_OFFSET_FILL),(F!==$||R!==et)&&(r.polygonOffset($,et),F=$,R=et)):st(r.POLYGON_OFFSET_FILL)}function T(U){U?pt(r.SCISSOR_TEST):st(r.SCISSOR_TEST)}function x(U){U===void 0&&(U=r.TEXTURE0+B-1),O!==U&&(r.activeTexture(U),O=U)}function I(U,$,et){et===void 0&&(O===null?et=r.TEXTURE0+B-1:et=O);let ut=L[et];ut===void 0&&(ut={type:void 0,texture:void 0},L[et]=ut),(ut.type!==U||ut.texture!==$)&&(O!==et&&(r.activeTexture(et),O=et),r.bindTexture(U,$||tt[U]),ut.type=U,ut.texture=$)}function G(){let U=L[O];U!==void 0&&U.type!==void 0&&(r.bindTexture(U.type,null),U.type=void 0,U.texture=void 0)}function K(){try{r.compressedTexImage2D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function Q(){try{r.compressedTexImage3D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function ht(){try{r.texSubImage2D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function ct(){try{r.texSubImage3D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function nt(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function bt(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function rt(){try{r.texStorage2D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function ft(){try{r.texStorage3D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function Ot(){try{r.texImage2D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function it(){try{r.texImage3D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function yt(U){vt.equals(U)===!1&&(r.scissor(U.x,U.y,U.z,U.w),vt.copy(U))}function Bt(U){Wt.equals(U)===!1&&(r.viewport(U.x,U.y,U.z,U.w),Wt.copy(U))}function Vt(U,$){let et=l.get($);et===void 0&&(et=new WeakMap,l.set($,et));let ut=et.get(U);ut===void 0&&(ut=r.getUniformBlockIndex($,U.name),et.set(U,ut))}function he(U,$){let ut=l.get($).get(U);a.get($)!==ut&&(r.uniformBlockBinding($,ut,U.__bindingPointIndex),a.set($,ut))}function kt(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),c={},O=null,L={},u={},f=new WeakMap,h=[],d=null,_=!1,g=null,p=null,m=null,b=null,S=null,y=null,D=null,A=new ce(0,0,0),w=0,P=!1,M=null,v=null,N=null,F=null,R=null,vt.set(0,0,r.canvas.width,r.canvas.height),Wt.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),o.reset()}return{buffers:{color:i,depth:s,stencil:o},enable:pt,disable:st,bindFramebuffer:Ft,drawBuffers:Nt,useProgram:V,setBlending:Tt,setMaterial:St,setFlipSided:zt,setCullFace:Ut,setLineWidth:k,setPolygonOffset:Qt,setScissorTest:T,activeTexture:x,bindTexture:I,unbindTexture:G,compressedTexImage2D:K,compressedTexImage3D:Q,texImage2D:Ot,texImage3D:it,updateUBOMapping:Vt,uniformBlockBinding:he,texStorage2D:rt,texStorage3D:ft,texSubImage2D:ht,texSubImage3D:ct,compressedTexSubImage2D:nt,compressedTexSubImage3D:bt,scissor:yt,viewport:Bt,reset:kt}}function xb(r,t,e,n,i,s,o){let a=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new ue,u=new WeakMap,f,h=new WeakMap,d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(T,x){return d?new OffscreenCanvas(T,x):bl("canvas")}function g(T,x,I){let G=1,K=Qt(T);if((K.width>I||K.height>I)&&(G=I/Math.max(K.width,K.height)),G<1)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap||typeof VideoFrame<"u"&&T instanceof VideoFrame){let Q=Math.floor(G*K.width),ht=Math.floor(G*K.height);f===void 0&&(f=_(Q,ht));let ct=x?_(Q,ht):f;return ct.width=Q,ct.height=ht,ct.getContext("2d").drawImage(T,0,0,Q,ht),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+K.width+"x"+K.height+") to ("+Q+"x"+ht+")."),ct}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+K.width+"x"+K.height+")."),T;return T}function p(T){return T.generateMipmaps&&T.minFilter!==Yn&&T.minFilter!==oi}function m(T){r.generateMipmap(T)}function b(T,x,I,G,K=!1){if(T!==null){if(r[T]!==void 0)return r[T];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let Q=x;if(x===r.RED&&(I===r.FLOAT&&(Q=r.R32F),I===r.HALF_FLOAT&&(Q=r.R16F),I===r.UNSIGNED_BYTE&&(Q=r.R8)),x===r.RED_INTEGER&&(I===r.UNSIGNED_BYTE&&(Q=r.R8UI),I===r.UNSIGNED_SHORT&&(Q=r.R16UI),I===r.UNSIGNED_INT&&(Q=r.R32UI),I===r.BYTE&&(Q=r.R8I),I===r.SHORT&&(Q=r.R16I),I===r.INT&&(Q=r.R32I)),x===r.RG&&(I===r.FLOAT&&(Q=r.RG32F),I===r.HALF_FLOAT&&(Q=r.RG16F),I===r.UNSIGNED_BYTE&&(Q=r.RG8)),x===r.RG_INTEGER&&(I===r.UNSIGNED_BYTE&&(Q=r.RG8UI),I===r.UNSIGNED_SHORT&&(Q=r.RG16UI),I===r.UNSIGNED_INT&&(Q=r.RG32UI),I===r.BYTE&&(Q=r.RG8I),I===r.SHORT&&(Q=r.RG16I),I===r.INT&&(Q=r.RG32I)),x===r.RGB&&I===r.UNSIGNED_INT_5_9_9_9_REV&&(Q=r.RGB9_E5),x===r.RGBA){let ht=K?vl:me.getTransfer(G);I===r.FLOAT&&(Q=r.RGBA32F),I===r.HALF_FLOAT&&(Q=r.RGBA16F),I===r.UNSIGNED_BYTE&&(Q=ht===ye?r.SRGB8_ALPHA8:r.RGBA8),I===r.UNSIGNED_SHORT_4_4_4_4&&(Q=r.RGBA4),I===r.UNSIGNED_SHORT_5_5_5_1&&(Q=r.RGB5_A1)}return(Q===r.R16F||Q===r.R32F||Q===r.RG16F||Q===r.RG32F||Q===r.RGBA16F||Q===r.RGBA32F)&&t.get("EXT_color_buffer_float"),Q}function S(T,x){return p(T)===!0||T.isFramebufferTexture&&T.minFilter!==Yn&&T.minFilter!==oi?Math.log2(Math.max(x.width,x.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?x.mipmaps.length:1}function y(T){let x=T.target;x.removeEventListener("dispose",y),A(x),x.isVideoTexture&&u.delete(x)}function D(T){let x=T.target;x.removeEventListener("dispose",D),P(x)}function A(T){let x=n.get(T);if(x.__webglInit===void 0)return;let I=T.source,G=h.get(I);if(G){let K=G[x.__cacheKey];K.usedTimes--,K.usedTimes===0&&w(T),Object.keys(G).length===0&&h.delete(I)}n.remove(T)}function w(T){let x=n.get(T);r.deleteTexture(x.__webglTexture);let I=T.source,G=h.get(I);delete G[x.__cacheKey],o.memory.textures--}function P(T){let x=n.get(T);if(T.depthTexture&&T.depthTexture.dispose(),T.isWebGLCubeRenderTarget)for(let G=0;G<6;G++){if(Array.isArray(x.__webglFramebuffer[G]))for(let K=0;K<x.__webglFramebuffer[G].length;K++)r.deleteFramebuffer(x.__webglFramebuffer[G][K]);else r.deleteFramebuffer(x.__webglFramebuffer[G]);x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer[G])}else{if(Array.isArray(x.__webglFramebuffer))for(let G=0;G<x.__webglFramebuffer.length;G++)r.deleteFramebuffer(x.__webglFramebuffer[G]);else r.deleteFramebuffer(x.__webglFramebuffer);if(x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer),x.__webglMultisampledFramebuffer&&r.deleteFramebuffer(x.__webglMultisampledFramebuffer),x.__webglColorRenderbuffer)for(let G=0;G<x.__webglColorRenderbuffer.length;G++)x.__webglColorRenderbuffer[G]&&r.deleteRenderbuffer(x.__webglColorRenderbuffer[G]);x.__webglDepthRenderbuffer&&r.deleteRenderbuffer(x.__webglDepthRenderbuffer)}let I=T.textures;for(let G=0,K=I.length;G<K;G++){let Q=n.get(I[G]);Q.__webglTexture&&(r.deleteTexture(Q.__webglTexture),o.memory.textures--),n.remove(I[G])}n.remove(T)}let M=0;function v(){M=0}function N(){let T=M;return T>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+i.maxTextures),M+=1,T}function F(T){let x=[];return x.push(T.wrapS),x.push(T.wrapT),x.push(T.wrapR||0),x.push(T.magFilter),x.push(T.minFilter),x.push(T.anisotropy),x.push(T.internalFormat),x.push(T.format),x.push(T.type),x.push(T.generateMipmaps),x.push(T.premultiplyAlpha),x.push(T.flipY),x.push(T.unpackAlignment),x.push(T.colorSpace),x.join()}function R(T,x){let I=n.get(T);if(T.isVideoTexture&&Ut(T),T.isRenderTargetTexture===!1&&T.version>0&&I.__version!==T.version){let G=T.image;if(G===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(G.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{vt(I,T,x);return}}e.bindTexture(r.TEXTURE_2D,I.__webglTexture,r.TEXTURE0+x)}function B(T,x){let I=n.get(T);if(T.version>0&&I.__version!==T.version){vt(I,T,x);return}e.bindTexture(r.TEXTURE_2D_ARRAY,I.__webglTexture,r.TEXTURE0+x)}function Y(T,x){let I=n.get(T);if(T.version>0&&I.__version!==T.version){vt(I,T,x);return}e.bindTexture(r.TEXTURE_3D,I.__webglTexture,r.TEXTURE0+x)}function H(T,x){let I=n.get(T);if(T.version>0&&I.__version!==T.version){Wt(I,T,x);return}e.bindTexture(r.TEXTURE_CUBE_MAP,I.__webglTexture,r.TEXTURE0+x)}let J={[eh]:r.REPEAT,[es]:r.CLAMP_TO_EDGE,[nh]:r.MIRRORED_REPEAT},O={[Yn]:r.NEAREST,[ux]:r.NEAREST_MIPMAP_NEAREST,[Xa]:r.NEAREST_MIPMAP_LINEAR,[oi]:r.LINEAR,[_u]:r.LINEAR_MIPMAP_NEAREST,[ns]:r.LINEAR_MIPMAP_LINEAR},L={[Ex]:r.NEVER,[Px]:r.ALWAYS,[Tx]:r.LESS,[eg]:r.LEQUAL,[Ax]:r.EQUAL,[Rx]:r.GEQUAL,[Dx]:r.GREATER,[Cx]:r.NOTEQUAL};function C(T,x){if(x.type===hr&&t.has("OES_texture_float_linear")===!1&&(x.magFilter===oi||x.magFilter===_u||x.magFilter===Xa||x.magFilter===ns||x.minFilter===oi||x.minFilter===_u||x.minFilter===Xa||x.minFilter===ns)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(T,r.TEXTURE_WRAP_S,J[x.wrapS]),r.texParameteri(T,r.TEXTURE_WRAP_T,J[x.wrapT]),(T===r.TEXTURE_3D||T===r.TEXTURE_2D_ARRAY)&&r.texParameteri(T,r.TEXTURE_WRAP_R,J[x.wrapR]),r.texParameteri(T,r.TEXTURE_MAG_FILTER,O[x.magFilter]),r.texParameteri(T,r.TEXTURE_MIN_FILTER,O[x.minFilter]),x.compareFunction&&(r.texParameteri(T,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(T,r.TEXTURE_COMPARE_FUNC,L[x.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(x.magFilter===Yn||x.minFilter!==Xa&&x.minFilter!==ns||x.type===hr&&t.has("OES_texture_float_linear")===!1)return;if(x.anisotropy>1||n.get(x).__currentAnisotropy){let I=t.get("EXT_texture_filter_anisotropic");r.texParameterf(T,I.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(x.anisotropy,i.getMaxAnisotropy())),n.get(x).__currentAnisotropy=x.anisotropy}}}function ot(T,x){let I=!1;T.__webglInit===void 0&&(T.__webglInit=!0,x.addEventListener("dispose",y));let G=x.source,K=h.get(G);K===void 0&&(K={},h.set(G,K));let Q=F(x);if(Q!==T.__cacheKey){K[Q]===void 0&&(K[Q]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,I=!0),K[Q].usedTimes++;let ht=K[T.__cacheKey];ht!==void 0&&(K[T.__cacheKey].usedTimes--,ht.usedTimes===0&&w(x)),T.__cacheKey=Q,T.__webglTexture=K[Q].texture}return I}function vt(T,x,I){let G=r.TEXTURE_2D;(x.isDataArrayTexture||x.isCompressedArrayTexture)&&(G=r.TEXTURE_2D_ARRAY),x.isData3DTexture&&(G=r.TEXTURE_3D);let K=ot(T,x),Q=x.source;e.bindTexture(G,T.__webglTexture,r.TEXTURE0+I);let ht=n.get(Q);if(Q.version!==ht.__version||K===!0){e.activeTexture(r.TEXTURE0+I);let ct=me.getPrimaries(me.workingColorSpace),nt=x.colorSpace===ur?null:me.getPrimaries(x.colorSpace),bt=x.colorSpace===ur||ct===nt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,bt);let rt=g(x.image,!1,i.maxTextureSize);rt=k(x,rt);let ft=s.convert(x.format,x.colorSpace),Ot=s.convert(x.type),it=b(x.internalFormat,ft,Ot,x.colorSpace,x.isVideoTexture);C(G,x);let yt,Bt=x.mipmaps,Vt=x.isVideoTexture!==!0,he=ht.__version===void 0||K===!0,kt=Q.dataReady,U=S(x,rt);if(x.isDepthTexture)it=r.DEPTH_COMPONENT16,x.type===hr?it=r.DEPTH_COMPONENT32F:x.type===to?it=r.DEPTH_COMPONENT24:x.type===Ko&&(it=r.DEPTH24_STENCIL8),he&&(Vt?e.texStorage2D(r.TEXTURE_2D,1,it,rt.width,rt.height):e.texImage2D(r.TEXTURE_2D,0,it,rt.width,rt.height,0,ft,Ot,null));else if(x.isDataTexture)if(Bt.length>0){Vt&&he&&e.texStorage2D(r.TEXTURE_2D,U,it,Bt[0].width,Bt[0].height);for(let $=0,et=Bt.length;$<et;$++)yt=Bt[$],Vt?kt&&e.texSubImage2D(r.TEXTURE_2D,$,0,0,yt.width,yt.height,ft,Ot,yt.data):e.texImage2D(r.TEXTURE_2D,$,it,yt.width,yt.height,0,ft,Ot,yt.data);x.generateMipmaps=!1}else Vt?(he&&e.texStorage2D(r.TEXTURE_2D,U,it,rt.width,rt.height),kt&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,rt.width,rt.height,ft,Ot,rt.data)):e.texImage2D(r.TEXTURE_2D,0,it,rt.width,rt.height,0,ft,Ot,rt.data);else if(x.isCompressedTexture)if(x.isCompressedArrayTexture){Vt&&he&&e.texStorage3D(r.TEXTURE_2D_ARRAY,U,it,Bt[0].width,Bt[0].height,rt.depth);for(let $=0,et=Bt.length;$<et;$++)yt=Bt[$],x.format!==Si?ft!==null?Vt?kt&&e.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,$,0,0,0,yt.width,yt.height,rt.depth,ft,yt.data,0,0):e.compressedTexImage3D(r.TEXTURE_2D_ARRAY,$,it,yt.width,yt.height,rt.depth,0,yt.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Vt?kt&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,$,0,0,0,yt.width,yt.height,rt.depth,ft,Ot,yt.data):e.texImage3D(r.TEXTURE_2D_ARRAY,$,it,yt.width,yt.height,rt.depth,0,ft,Ot,yt.data)}else{Vt&&he&&e.texStorage2D(r.TEXTURE_2D,U,it,Bt[0].width,Bt[0].height);for(let $=0,et=Bt.length;$<et;$++)yt=Bt[$],x.format!==Si?ft!==null?Vt?kt&&e.compressedTexSubImage2D(r.TEXTURE_2D,$,0,0,yt.width,yt.height,ft,yt.data):e.compressedTexImage2D(r.TEXTURE_2D,$,it,yt.width,yt.height,0,yt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Vt?kt&&e.texSubImage2D(r.TEXTURE_2D,$,0,0,yt.width,yt.height,ft,Ot,yt.data):e.texImage2D(r.TEXTURE_2D,$,it,yt.width,yt.height,0,ft,Ot,yt.data)}else if(x.isDataArrayTexture)Vt?(he&&e.texStorage3D(r.TEXTURE_2D_ARRAY,U,it,rt.width,rt.height,rt.depth),kt&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,rt.width,rt.height,rt.depth,ft,Ot,rt.data)):e.texImage3D(r.TEXTURE_2D_ARRAY,0,it,rt.width,rt.height,rt.depth,0,ft,Ot,rt.data);else if(x.isData3DTexture)Vt?(he&&e.texStorage3D(r.TEXTURE_3D,U,it,rt.width,rt.height,rt.depth),kt&&e.texSubImage3D(r.TEXTURE_3D,0,0,0,0,rt.width,rt.height,rt.depth,ft,Ot,rt.data)):e.texImage3D(r.TEXTURE_3D,0,it,rt.width,rt.height,rt.depth,0,ft,Ot,rt.data);else if(x.isFramebufferTexture){if(he)if(Vt)e.texStorage2D(r.TEXTURE_2D,U,it,rt.width,rt.height);else{let $=rt.width,et=rt.height;for(let ut=0;ut<U;ut++)e.texImage2D(r.TEXTURE_2D,ut,it,$,et,0,ft,Ot,null),$>>=1,et>>=1}}else if(Bt.length>0){if(Vt&&he){let $=Qt(Bt[0]);e.texStorage2D(r.TEXTURE_2D,U,it,$.width,$.height)}for(let $=0,et=Bt.length;$<et;$++)yt=Bt[$],Vt?kt&&e.texSubImage2D(r.TEXTURE_2D,$,0,0,ft,Ot,yt):e.texImage2D(r.TEXTURE_2D,$,it,ft,Ot,yt);x.generateMipmaps=!1}else if(Vt){if(he){let $=Qt(rt);e.texStorage2D(r.TEXTURE_2D,U,it,$.width,$.height)}kt&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,ft,Ot,rt)}else e.texImage2D(r.TEXTURE_2D,0,it,ft,Ot,rt);p(x)&&m(G),ht.__version=Q.version,x.onUpdate&&x.onUpdate(x)}T.__version=x.version}function Wt(T,x,I){if(x.image.length!==6)return;let G=ot(T,x),K=x.source;e.bindTexture(r.TEXTURE_CUBE_MAP,T.__webglTexture,r.TEXTURE0+I);let Q=n.get(K);if(K.version!==Q.__version||G===!0){e.activeTexture(r.TEXTURE0+I);let ht=me.getPrimaries(me.workingColorSpace),ct=x.colorSpace===ur?null:me.getPrimaries(x.colorSpace),nt=x.colorSpace===ur||ht===ct?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,nt);let bt=x.isCompressedTexture||x.image[0].isCompressedTexture,rt=x.image[0]&&x.image[0].isDataTexture,ft=[];for(let et=0;et<6;et++)!bt&&!rt?ft[et]=g(x.image[et],!0,i.maxCubemapSize):ft[et]=rt?x.image[et].image:x.image[et],ft[et]=k(x,ft[et]);let Ot=ft[0],it=s.convert(x.format,x.colorSpace),yt=s.convert(x.type),Bt=b(x.internalFormat,it,yt,x.colorSpace),Vt=x.isVideoTexture!==!0,he=Q.__version===void 0||G===!0,kt=K.dataReady,U=S(x,Ot);C(r.TEXTURE_CUBE_MAP,x);let $;if(bt){Vt&&he&&e.texStorage2D(r.TEXTURE_CUBE_MAP,U,Bt,Ot.width,Ot.height);for(let et=0;et<6;et++){$=ft[et].mipmaps;for(let ut=0;ut<$.length;ut++){let at=$[ut];x.format!==Si?it!==null?Vt?kt&&e.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut,0,0,at.width,at.height,it,at.data):e.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut,Bt,at.width,at.height,0,at.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Vt?kt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut,0,0,at.width,at.height,it,yt,at.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut,Bt,at.width,at.height,0,it,yt,at.data)}}}else{if($=x.mipmaps,Vt&&he){$.length>0&&U++;let et=Qt(ft[0]);e.texStorage2D(r.TEXTURE_CUBE_MAP,U,Bt,et.width,et.height)}for(let et=0;et<6;et++)if(rt){Vt?kt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,0,0,0,ft[et].width,ft[et].height,it,yt,ft[et].data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,0,Bt,ft[et].width,ft[et].height,0,it,yt,ft[et].data);for(let ut=0;ut<$.length;ut++){let Dt=$[ut].image[et].image;Vt?kt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut+1,0,0,Dt.width,Dt.height,it,yt,Dt.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut+1,Bt,Dt.width,Dt.height,0,it,yt,Dt.data)}}else{Vt?kt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,0,0,0,it,yt,ft[et]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,0,Bt,it,yt,ft[et]);for(let ut=0;ut<$.length;ut++){let at=$[ut];Vt?kt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut+1,0,0,it,yt,at.image[et]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut+1,Bt,it,yt,at.image[et])}}}p(x)&&m(r.TEXTURE_CUBE_MAP),Q.__version=K.version,x.onUpdate&&x.onUpdate(x)}T.__version=x.version}function q(T,x,I,G,K,Q){let ht=s.convert(I.format,I.colorSpace),ct=s.convert(I.type),nt=b(I.internalFormat,ht,ct,I.colorSpace);if(!n.get(x).__hasExternalTextures){let rt=Math.max(1,x.width>>Q),ft=Math.max(1,x.height>>Q);K===r.TEXTURE_3D||K===r.TEXTURE_2D_ARRAY?e.texImage3D(K,Q,nt,rt,ft,x.depth,0,ht,ct,null):e.texImage2D(K,Q,nt,rt,ft,0,ht,ct,null)}e.bindFramebuffer(r.FRAMEBUFFER,T),zt(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,G,K,n.get(I).__webglTexture,0,St(x)):(K===r.TEXTURE_2D||K>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&K<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,G,K,n.get(I).__webglTexture,Q),e.bindFramebuffer(r.FRAMEBUFFER,null)}function tt(T,x,I){if(r.bindRenderbuffer(r.RENDERBUFFER,T),x.depthBuffer&&!x.stencilBuffer){let G=r.DEPTH_COMPONENT24;if(I||zt(x)){let K=x.depthTexture;K&&K.isDepthTexture&&(K.type===hr?G=r.DEPTH_COMPONENT32F:K.type===to&&(G=r.DEPTH_COMPONENT24));let Q=St(x);zt(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Q,G,x.width,x.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,Q,G,x.width,x.height)}else r.renderbufferStorage(r.RENDERBUFFER,G,x.width,x.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,T)}else if(x.depthBuffer&&x.stencilBuffer){let G=St(x);I&&zt(x)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,G,r.DEPTH24_STENCIL8,x.width,x.height):zt(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,G,r.DEPTH24_STENCIL8,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,x.width,x.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,T)}else{let G=x.textures;for(let K=0;K<G.length;K++){let Q=G[K],ht=s.convert(Q.format,Q.colorSpace),ct=s.convert(Q.type),nt=b(Q.internalFormat,ht,ct,Q.colorSpace),bt=St(x);I&&zt(x)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,bt,nt,x.width,x.height):zt(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,bt,nt,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,nt,x.width,x.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function pt(T,x){if(x&&x.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(r.FRAMEBUFFER,T),!(x.depthTexture&&x.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(x.depthTexture).__webglTexture||x.depthTexture.image.width!==x.width||x.depthTexture.image.height!==x.height)&&(x.depthTexture.image.width=x.width,x.depthTexture.image.height=x.height,x.depthTexture.needsUpdate=!0),R(x.depthTexture,0);let G=n.get(x.depthTexture).__webglTexture,K=St(x);if(x.depthTexture.format===Js)zt(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,G,0,K):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,G,0);else if(x.depthTexture.format===Yo)zt(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,G,0,K):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,G,0);else throw new Error("Unknown depthTexture format")}function st(T){let x=n.get(T),I=T.isWebGLCubeRenderTarget===!0;if(T.depthTexture&&!x.__autoAllocateDepthBuffer){if(I)throw new Error("target.depthTexture not supported in Cube render targets");pt(x.__webglFramebuffer,T)}else if(I){x.__webglDepthbuffer=[];for(let G=0;G<6;G++)e.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer[G]),x.__webglDepthbuffer[G]=r.createRenderbuffer(),tt(x.__webglDepthbuffer[G],T,!1)}else e.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer),x.__webglDepthbuffer=r.createRenderbuffer(),tt(x.__webglDepthbuffer,T,!1);e.bindFramebuffer(r.FRAMEBUFFER,null)}function Ft(T,x,I){let G=n.get(T);x!==void 0&&q(G.__webglFramebuffer,T,T.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),I!==void 0&&st(T)}function Nt(T){let x=T.texture,I=n.get(T),G=n.get(x);T.addEventListener("dispose",D);let K=T.textures,Q=T.isWebGLCubeRenderTarget===!0,ht=K.length>1;if(ht||(G.__webglTexture===void 0&&(G.__webglTexture=r.createTexture()),G.__version=x.version,o.memory.textures++),Q){I.__webglFramebuffer=[];for(let ct=0;ct<6;ct++)if(x.mipmaps&&x.mipmaps.length>0){I.__webglFramebuffer[ct]=[];for(let nt=0;nt<x.mipmaps.length;nt++)I.__webglFramebuffer[ct][nt]=r.createFramebuffer()}else I.__webglFramebuffer[ct]=r.createFramebuffer()}else{if(x.mipmaps&&x.mipmaps.length>0){I.__webglFramebuffer=[];for(let ct=0;ct<x.mipmaps.length;ct++)I.__webglFramebuffer[ct]=r.createFramebuffer()}else I.__webglFramebuffer=r.createFramebuffer();if(ht)for(let ct=0,nt=K.length;ct<nt;ct++){let bt=n.get(K[ct]);bt.__webglTexture===void 0&&(bt.__webglTexture=r.createTexture(),o.memory.textures++)}if(T.samples>0&&zt(T)===!1){I.__webglMultisampledFramebuffer=r.createFramebuffer(),I.__webglColorRenderbuffer=[],e.bindFramebuffer(r.FRAMEBUFFER,I.__webglMultisampledFramebuffer);for(let ct=0;ct<K.length;ct++){let nt=K[ct];I.__webglColorRenderbuffer[ct]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,I.__webglColorRenderbuffer[ct]);let bt=s.convert(nt.format,nt.colorSpace),rt=s.convert(nt.type),ft=b(nt.internalFormat,bt,rt,nt.colorSpace,T.isXRRenderTarget===!0),Ot=St(T);r.renderbufferStorageMultisample(r.RENDERBUFFER,Ot,ft,T.width,T.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+ct,r.RENDERBUFFER,I.__webglColorRenderbuffer[ct])}r.bindRenderbuffer(r.RENDERBUFFER,null),T.depthBuffer&&(I.__webglDepthRenderbuffer=r.createRenderbuffer(),tt(I.__webglDepthRenderbuffer,T,!0)),e.bindFramebuffer(r.FRAMEBUFFER,null)}}if(Q){e.bindTexture(r.TEXTURE_CUBE_MAP,G.__webglTexture),C(r.TEXTURE_CUBE_MAP,x);for(let ct=0;ct<6;ct++)if(x.mipmaps&&x.mipmaps.length>0)for(let nt=0;nt<x.mipmaps.length;nt++)q(I.__webglFramebuffer[ct][nt],T,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+ct,nt);else q(I.__webglFramebuffer[ct],T,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+ct,0);p(x)&&m(r.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(ht){for(let ct=0,nt=K.length;ct<nt;ct++){let bt=K[ct],rt=n.get(bt);e.bindTexture(r.TEXTURE_2D,rt.__webglTexture),C(r.TEXTURE_2D,bt),q(I.__webglFramebuffer,T,bt,r.COLOR_ATTACHMENT0+ct,r.TEXTURE_2D,0),p(bt)&&m(r.TEXTURE_2D)}e.unbindTexture()}else{let ct=r.TEXTURE_2D;if((T.isWebGL3DRenderTarget||T.isWebGLArrayRenderTarget)&&(ct=T.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),e.bindTexture(ct,G.__webglTexture),C(ct,x),x.mipmaps&&x.mipmaps.length>0)for(let nt=0;nt<x.mipmaps.length;nt++)q(I.__webglFramebuffer[nt],T,x,r.COLOR_ATTACHMENT0,ct,nt);else q(I.__webglFramebuffer,T,x,r.COLOR_ATTACHMENT0,ct,0);p(x)&&m(ct),e.unbindTexture()}T.depthBuffer&&st(T)}function V(T){let x=T.textures;for(let I=0,G=x.length;I<G;I++){let K=x[I];if(p(K)){let Q=T.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,ht=n.get(K).__webglTexture;e.bindTexture(Q,ht),m(Q),e.unbindTexture()}}}let Yt=[],Et=[];function Tt(T){if(T.samples>0){if(zt(T)===!1){let x=T.textures,I=T.width,G=T.height,K=r.COLOR_BUFFER_BIT,Q=T.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ht=n.get(T),ct=x.length>1;if(ct)for(let nt=0;nt<x.length;nt++)e.bindFramebuffer(r.FRAMEBUFFER,ht.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+nt,r.RENDERBUFFER,null),e.bindFramebuffer(r.FRAMEBUFFER,ht.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+nt,r.TEXTURE_2D,null,0);e.bindFramebuffer(r.READ_FRAMEBUFFER,ht.__webglMultisampledFramebuffer),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,ht.__webglFramebuffer);for(let nt=0;nt<x.length;nt++){if(T.resolveDepthBuffer&&(T.depthBuffer&&(K|=r.DEPTH_BUFFER_BIT),T.stencilBuffer&&T.resolveStencilBuffer&&(K|=r.STENCIL_BUFFER_BIT)),ct){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,ht.__webglColorRenderbuffer[nt]);let bt=n.get(x[nt]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,bt,0)}r.blitFramebuffer(0,0,I,G,0,0,I,G,K,r.NEAREST),l===!0&&(Yt.length=0,Et.length=0,Yt.push(r.COLOR_ATTACHMENT0+nt),T.depthBuffer&&T.resolveDepthBuffer===!1&&(Yt.push(Q),Et.push(Q),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,Et)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,Yt))}if(e.bindFramebuffer(r.READ_FRAMEBUFFER,null),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),ct)for(let nt=0;nt<x.length;nt++){e.bindFramebuffer(r.FRAMEBUFFER,ht.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+nt,r.RENDERBUFFER,ht.__webglColorRenderbuffer[nt]);let bt=n.get(x[nt]).__webglTexture;e.bindFramebuffer(r.FRAMEBUFFER,ht.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+nt,r.TEXTURE_2D,bt,0)}e.bindFramebuffer(r.DRAW_FRAMEBUFFER,ht.__webglMultisampledFramebuffer)}else if(T.depthBuffer&&T.resolveDepthBuffer===!1&&l){let x=T.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[x])}}}function St(T){return Math.min(i.maxSamples,T.samples)}function zt(T){let x=n.get(T);return T.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&x.__useRenderToTexture!==!1}function Ut(T){let x=o.render.frame;u.get(T)!==x&&(u.set(T,x),T.update())}function k(T,x){let I=T.colorSpace,G=T.format,K=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||I!==yr&&I!==ur&&(me.getTransfer(I)===ye?(G!==Si||K!==_r)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",I)),x}function Qt(T){return typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement?(c.width=T.naturalWidth||T.width,c.height=T.naturalHeight||T.height):typeof VideoFrame<"u"&&T instanceof VideoFrame?(c.width=T.displayWidth,c.height=T.displayHeight):(c.width=T.width,c.height=T.height),c}this.allocateTextureUnit=N,this.resetTextureUnits=v,this.setTexture2D=R,this.setTexture2DArray=B,this.setTexture3D=Y,this.setTextureCube=H,this.rebindTextures=Ft,this.setupRenderTarget=Nt,this.updateRenderTargetMipmap=V,this.updateMultisampleRenderTarget=Tt,this.setupDepthRenderbuffer=st,this.setupFrameBufferTexture=q,this.useMultisampledRTT=zt}function vb(r,t){function e(n,i=ur){let s,o=me.getTransfer(i);if(n===_r)return r.UNSIGNED_BYTE;if(n===$m)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Km)return r.UNSIGNED_SHORT_5_5_5_1;if(n===dx)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===hx)return r.BYTE;if(n===fx)return r.SHORT;if(n===Zm)return r.UNSIGNED_SHORT;if(n===Jm)return r.INT;if(n===to)return r.UNSIGNED_INT;if(n===hr)return r.FLOAT;if(n===Wl)return r.HALF_FLOAT;if(n===px)return r.ALPHA;if(n===mx)return r.RGB;if(n===Si)return r.RGBA;if(n===gx)return r.LUMINANCE;if(n===_x)return r.LUMINANCE_ALPHA;if(n===Js)return r.DEPTH_COMPONENT;if(n===Yo)return r.DEPTH_STENCIL;if(n===xx)return r.RED;if(n===jm)return r.RED_INTEGER;if(n===vx)return r.RG;if(n===Qm)return r.RG_INTEGER;if(n===tg)return r.RGBA_INTEGER;if(n===xu||n===vu||n===yu||n===Su)if(o===ye)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===xu)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===vu)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===yu)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Su)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===xu)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===vu)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===yu)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Su)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===bp||n===wp||n===Ep||n===Tp)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===bp)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===wp)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Ep)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Tp)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Ap||n===Dp||n===Cp)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(n===Ap||n===Dp)return o===ye?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===Cp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Rp||n===Pp||n===Ip||n===Lp||n===Fp||n===Np||n===Up||n===Op||n===Bp||n===zp||n===kp||n===Vp||n===Hp||n===Gp)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(n===Rp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Pp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Ip)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Lp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Fp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Np)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Up)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Op)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Bp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===zp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===kp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Vp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Hp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Gp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Mu||n===Wp||n===Xp)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(n===Mu)return o===ye?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Wp)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Xp)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===yx||n===qp||n===Yp||n===Zp)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(n===Mu)return s.COMPRESSED_RED_RGTC1_EXT;if(n===qp)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Yp)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Zp)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Ko?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:e}}var _h=class extends Sn{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}},fr=class extends cn{constructor(){super(),this.isGroup=!0,this.type="Group"}},yb={type:"move"},qo=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new fr,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new fr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new j,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new j),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new fr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new j,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new j),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let i=null,s=null,o=null,a=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){o=!0;for(let g of t.hand.values()){let p=e.getJointPose(g,n),m=this._getHandJoint(c,g);p!==null&&(m.matrix.fromArray(p.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=p.radius),m.visible=p!==null}let u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],h=u.position.distanceTo(f.position),d=.02,_=.005;c.inputState.pinching&&h>d+_?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&h<=d-_&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=e.getPose(t.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(yb)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){let n=new fr;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}},Sb=`
|
|
3797
|
+
}`;function gb(r,t,e){let n=new Jo,i=new ue,s=new ue,o=new Ye,a=new mh({depthPacking:Mx}),l=new gh,c={},u=e.maxTextureSize,h={[gr]:Cn,[Cn]:gr,[Vi]:Vi},f=new Kn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ue},radius:{value:4}},vertexShader:pb,fragmentShader:mb}),d=f.clone();d.defines.HORIZONTAL_PASS=1;let _=new Mi;_.setAttribute("position",new Zn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new ai(_,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Xm;let p=this.type;this.render=function(A,w,P){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||A.length===0)return;let M=r.getRenderTarget(),v=r.getActiveCubeFace(),N=r.getActiveMipmapLevel(),F=r.state;F.setBlending(dr),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);let R=p!==zi&&this.type===zi,B=p===zi&&this.type!==zi;for(let Y=0,H=A.length;Y<H;Y++){let J=A[Y],O=J.shadow;if(O===void 0){console.warn("THREE.WebGLShadowMap:",J,"has no shadow.");continue}if(O.autoUpdate===!1&&O.needsUpdate===!1)continue;i.copy(O.mapSize);let L=O.getFrameExtents();if(i.multiply(L),s.copy(O.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/L.x),i.x=s.x*L.x,O.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/L.y),i.y=s.y*L.y,O.mapSize.y=s.y)),O.map===null||R===!0||B===!0){let ot=this.type!==zi?{minFilter:Yn,magFilter:Yn}:{};O.map!==null&&O.map.dispose(),O.map=new Gi(i.x,i.y,ot),O.map.texture.name=J.name+".shadowMap",O.camera.updateProjectionMatrix()}r.setRenderTarget(O.map),r.clear();let C=O.getViewportCount();for(let ot=0;ot<C;ot++){let vt=O.getViewport(ot);o.set(s.x*vt.x,s.y*vt.y,s.x*vt.z,s.y*vt.w),F.viewport(o),O.updateMatrices(J,ot),n=O.getFrustum(),S(w,P,O.camera,J,this.type)}O.isPointLightShadow!==!0&&this.type===zi&&b(O,P),O.needsUpdate=!1}p=this.type,m.needsUpdate=!1,r.setRenderTarget(M,v,N)};function b(A,w){let P=t.update(g);f.defines.VSM_SAMPLES!==A.blurSamples&&(f.defines.VSM_SAMPLES=A.blurSamples,d.defines.VSM_SAMPLES=A.blurSamples,f.needsUpdate=!0,d.needsUpdate=!0),A.mapPass===null&&(A.mapPass=new Gi(i.x,i.y)),f.uniforms.shadow_pass.value=A.map.texture,f.uniforms.resolution.value=A.mapSize,f.uniforms.radius.value=A.radius,r.setRenderTarget(A.mapPass),r.clear(),r.renderBufferDirect(w,null,P,f,g,null),d.uniforms.shadow_pass.value=A.mapPass.texture,d.uniforms.resolution.value=A.mapSize,d.uniforms.radius.value=A.radius,r.setRenderTarget(A.map),r.clear(),r.renderBufferDirect(w,null,P,d,g,null)}function y(A,w,P,M){let v=null,N=P.isPointLight===!0?A.customDistanceMaterial:A.customDepthMaterial;if(N!==void 0)v=N;else if(v=P.isPointLight===!0?l:a,r.localClippingEnabled&&w.clipShadows===!0&&Array.isArray(w.clippingPlanes)&&w.clippingPlanes.length!==0||w.displacementMap&&w.displacementScale!==0||w.alphaMap&&w.alphaTest>0||w.map&&w.alphaTest>0){let F=v.uuid,R=w.uuid,B=c[F];B===void 0&&(B={},c[F]=B);let Y=B[R];Y===void 0&&(Y=v.clone(),B[R]=Y,w.addEventListener("dispose",D)),v=Y}if(v.visible=w.visible,v.wireframe=w.wireframe,M===zi?v.side=w.shadowSide!==null?w.shadowSide:w.side:v.side=w.shadowSide!==null?w.shadowSide:h[w.side],v.alphaMap=w.alphaMap,v.alphaTest=w.alphaTest,v.map=w.map,v.clipShadows=w.clipShadows,v.clippingPlanes=w.clippingPlanes,v.clipIntersection=w.clipIntersection,v.displacementMap=w.displacementMap,v.displacementScale=w.displacementScale,v.displacementBias=w.displacementBias,v.wireframeLinewidth=w.wireframeLinewidth,v.linewidth=w.linewidth,P.isPointLight===!0&&v.isMeshDistanceMaterial===!0){let F=r.properties.get(v);F.light=P}return v}function S(A,w,P,M,v){if(A.visible===!1)return;if(A.layers.test(w.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&v===zi)&&(!A.frustumCulled||n.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,A.matrixWorld);let R=t.update(A),B=A.material;if(Array.isArray(B)){let Y=R.groups;for(let H=0,J=Y.length;H<J;H++){let O=Y[H],L=B[O.materialIndex];if(L&&L.visible){let C=y(A,L,M,v);A.onBeforeShadow(r,A,w,P,R,C,O),r.renderBufferDirect(P,null,R,C,A,O),A.onAfterShadow(r,A,w,P,R,C,O)}}}else if(B.visible){let Y=y(A,B,M,v);A.onBeforeShadow(r,A,w,P,R,Y,null),r.renderBufferDirect(P,null,R,Y,A,null),A.onAfterShadow(r,A,w,P,R,Y,null)}}let F=A.children;for(let R=0,B=F.length;R<B;R++)S(F[R],w,P,M,v)}function D(A){A.target.removeEventListener("dispose",D);for(let P in c){let M=c[P],v=A.target.uuid;v in M&&(M[v].dispose(),delete M[v])}}}function _b(r){function t(){let U=!1,$=new Ye,et=null,ut=new Ye(0,0,0,0);return{setMask:function(lt){et!==lt&&!U&&(r.colorMask(lt,lt,lt,lt),et=lt)},setLocked:function(lt){U=lt},setClear:function(lt,Dt,te,ae,re){re===!0&&(lt*=ae,Dt*=ae,te*=ae),$.set(lt,Dt,te,ae),ut.equals($)===!1&&(r.clearColor(lt,Dt,te,ae),ut.copy($))},reset:function(){U=!1,et=null,ut.set(-1,0,0,0)}}}function e(){let U=!1,$=null,et=null,ut=null;return{setTest:function(lt){lt?pt(r.DEPTH_TEST):st(r.DEPTH_TEST)},setMask:function(lt){$!==lt&&!U&&(r.depthMask(lt),$=lt)},setFunc:function(lt){if(et!==lt){switch(lt){case Z0:r.depthFunc(r.NEVER);break;case J0:r.depthFunc(r.ALWAYS);break;case $0:r.depthFunc(r.LESS);break;case gl:r.depthFunc(r.LEQUAL);break;case K0:r.depthFunc(r.EQUAL);break;case j0:r.depthFunc(r.GEQUAL);break;case Q0:r.depthFunc(r.GREATER);break;case tx:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}et=lt}},setLocked:function(lt){U=lt},setClear:function(lt){ut!==lt&&(r.clearDepth(lt),ut=lt)},reset:function(){U=!1,$=null,et=null,ut=null}}}function n(){let U=!1,$=null,et=null,ut=null,lt=null,Dt=null,te=null,ae=null,re=null;return{setTest:function(Zt){U||(Zt?pt(r.STENCIL_TEST):st(r.STENCIL_TEST))},setMask:function(Zt){$!==Zt&&!U&&(r.stencilMask(Zt),$=Zt)},setFunc:function(Zt,Ct,Mt){(et!==Zt||ut!==Ct||lt!==Mt)&&(r.stencilFunc(Zt,Ct,Mt),et=Zt,ut=Ct,lt=Mt)},setOp:function(Zt,Ct,Mt){(Dt!==Zt||te!==Ct||ae!==Mt)&&(r.stencilOp(Zt,Ct,Mt),Dt=Zt,te=Ct,ae=Mt)},setLocked:function(Zt){U=Zt},setClear:function(Zt){re!==Zt&&(r.clearStencil(Zt),re=Zt)},reset:function(){U=!1,$=null,et=null,ut=null,lt=null,Dt=null,te=null,ae=null,re=null}}}let i=new t,s=new e,o=new n,a=new WeakMap,l=new WeakMap,c={},u={},h=new WeakMap,f=[],d=null,_=!1,g=null,m=null,p=null,b=null,y=null,S=null,D=null,A=new ce(0,0,0),w=0,P=!1,M=null,v=null,N=null,F=null,R=null,B=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Y=!1,H=0,J=r.getParameter(r.VERSION);J.indexOf("WebGL")!==-1?(H=parseFloat(/^WebGL (\d)/.exec(J)[1]),Y=H>=1):J.indexOf("OpenGL ES")!==-1&&(H=parseFloat(/^OpenGL ES (\d)/.exec(J)[1]),Y=H>=2);let O=null,L={},C=r.getParameter(r.SCISSOR_BOX),ot=r.getParameter(r.VIEWPORT),vt=new Ye().fromArray(C),Wt=new Ye().fromArray(ot);function q(U,$,et,ut){let lt=new Uint8Array(4),Dt=r.createTexture();r.bindTexture(U,Dt),r.texParameteri(U,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(U,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let te=0;te<et;te++)U===r.TEXTURE_3D||U===r.TEXTURE_2D_ARRAY?r.texImage3D($,0,r.RGBA,1,1,ut,0,r.RGBA,r.UNSIGNED_BYTE,lt):r.texImage2D($+te,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,lt);return Dt}let tt={};tt[r.TEXTURE_2D]=q(r.TEXTURE_2D,r.TEXTURE_2D,1),tt[r.TEXTURE_CUBE_MAP]=q(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),tt[r.TEXTURE_2D_ARRAY]=q(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),tt[r.TEXTURE_3D]=q(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),pt(r.DEPTH_TEST),s.setFunc(gl),zt(!1),Ut(vp),pt(r.CULL_FACE),Tt(dr);function pt(U){c[U]!==!0&&(r.enable(U),c[U]=!0)}function st(U){c[U]!==!1&&(r.disable(U),c[U]=!1)}function Ft(U,$){return u[U]!==$?(r.bindFramebuffer(U,$),u[U]=$,U===r.DRAW_FRAMEBUFFER&&(u[r.FRAMEBUFFER]=$),U===r.FRAMEBUFFER&&(u[r.DRAW_FRAMEBUFFER]=$),!0):!1}function Nt(U,$){let et=f,ut=!1;if(U){et=h.get($),et===void 0&&(et=[],h.set($,et));let lt=U.textures;if(et.length!==lt.length||et[0]!==r.COLOR_ATTACHMENT0){for(let Dt=0,te=lt.length;Dt<te;Dt++)et[Dt]=r.COLOR_ATTACHMENT0+Dt;et.length=lt.length,ut=!0}}else et[0]!==r.BACK&&(et[0]=r.BACK,ut=!0);ut&&r.drawBuffers(et)}function V(U){return d!==U?(r.useProgram(U),d=U,!0):!1}let Yt={[Qr]:r.FUNC_ADD,[P0]:r.FUNC_SUBTRACT,[I0]:r.FUNC_REVERSE_SUBTRACT};Yt[L0]=r.MIN,Yt[F0]=r.MAX;let Et={[N0]:r.ZERO,[U0]:r.ONE,[O0]:r.SRC_COLOR,[Ku]:r.SRC_ALPHA,[G0]:r.SRC_ALPHA_SATURATE,[V0]:r.DST_COLOR,[z0]:r.DST_ALPHA,[B0]:r.ONE_MINUS_SRC_COLOR,[ju]:r.ONE_MINUS_SRC_ALPHA,[H0]:r.ONE_MINUS_DST_COLOR,[k0]:r.ONE_MINUS_DST_ALPHA,[W0]:r.CONSTANT_COLOR,[X0]:r.ONE_MINUS_CONSTANT_COLOR,[q0]:r.CONSTANT_ALPHA,[Y0]:r.ONE_MINUS_CONSTANT_ALPHA};function Tt(U,$,et,ut,lt,Dt,te,ae,re,Zt){if(U===dr){_===!0&&(st(r.BLEND),_=!1);return}if(_===!1&&(pt(r.BLEND),_=!0),U!==R0){if(U!==g||Zt!==P){if((m!==Qr||y!==Qr)&&(r.blendEquation(r.FUNC_ADD),m=Qr,y=Qr),Zt)switch(U){case pr:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case yp:r.blendFunc(r.ONE,r.ONE);break;case Sp:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Mp:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",U);break}else switch(U){case pr:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case yp:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case Sp:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Mp:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",U);break}p=null,b=null,S=null,D=null,A.set(0,0,0),w=0,g=U,P=Zt}return}lt=lt||$,Dt=Dt||et,te=te||ut,($!==m||lt!==y)&&(r.blendEquationSeparate(Yt[$],Yt[lt]),m=$,y=lt),(et!==p||ut!==b||Dt!==S||te!==D)&&(r.blendFuncSeparate(Et[et],Et[ut],Et[Dt],Et[te]),p=et,b=ut,S=Dt,D=te),(ae.equals(A)===!1||re!==w)&&(r.blendColor(ae.r,ae.g,ae.b,re),A.copy(ae),w=re),g=U,P=!1}function St(U,$){U.side===Vi?st(r.CULL_FACE):pt(r.CULL_FACE);let et=U.side===Cn;$&&(et=!et),zt(et),U.blending===pr&&U.transparent===!1?Tt(dr):Tt(U.blending,U.blendEquation,U.blendSrc,U.blendDst,U.blendEquationAlpha,U.blendSrcAlpha,U.blendDstAlpha,U.blendColor,U.blendAlpha,U.premultipliedAlpha),s.setFunc(U.depthFunc),s.setTest(U.depthTest),s.setMask(U.depthWrite),i.setMask(U.colorWrite);let ut=U.stencilWrite;o.setTest(ut),ut&&(o.setMask(U.stencilWriteMask),o.setFunc(U.stencilFunc,U.stencilRef,U.stencilFuncMask),o.setOp(U.stencilFail,U.stencilZFail,U.stencilZPass)),Qt(U.polygonOffset,U.polygonOffsetFactor,U.polygonOffsetUnits),U.alphaToCoverage===!0?pt(r.SAMPLE_ALPHA_TO_COVERAGE):st(r.SAMPLE_ALPHA_TO_COVERAGE)}function zt(U){M!==U&&(U?r.frontFace(r.CW):r.frontFace(r.CCW),M=U)}function Ut(U){U!==D0?(pt(r.CULL_FACE),U!==v&&(U===vp?r.cullFace(r.BACK):U===C0?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):st(r.CULL_FACE),v=U}function k(U){U!==N&&(Y&&r.lineWidth(U),N=U)}function Qt(U,$,et){U?(pt(r.POLYGON_OFFSET_FILL),(F!==$||R!==et)&&(r.polygonOffset($,et),F=$,R=et)):st(r.POLYGON_OFFSET_FILL)}function T(U){U?pt(r.SCISSOR_TEST):st(r.SCISSOR_TEST)}function x(U){U===void 0&&(U=r.TEXTURE0+B-1),O!==U&&(r.activeTexture(U),O=U)}function I(U,$,et){et===void 0&&(O===null?et=r.TEXTURE0+B-1:et=O);let ut=L[et];ut===void 0&&(ut={type:void 0,texture:void 0},L[et]=ut),(ut.type!==U||ut.texture!==$)&&(O!==et&&(r.activeTexture(et),O=et),r.bindTexture(U,$||tt[U]),ut.type=U,ut.texture=$)}function G(){let U=L[O];U!==void 0&&U.type!==void 0&&(r.bindTexture(U.type,null),U.type=void 0,U.texture=void 0)}function K(){try{r.compressedTexImage2D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function Q(){try{r.compressedTexImage3D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function ht(){try{r.texSubImage2D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function ct(){try{r.texSubImage3D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function nt(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function bt(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function rt(){try{r.texStorage2D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function ft(){try{r.texStorage3D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function Ot(){try{r.texImage2D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function it(){try{r.texImage3D.apply(r,arguments)}catch(U){console.error("THREE.WebGLState:",U)}}function yt(U){vt.equals(U)===!1&&(r.scissor(U.x,U.y,U.z,U.w),vt.copy(U))}function Bt(U){Wt.equals(U)===!1&&(r.viewport(U.x,U.y,U.z,U.w),Wt.copy(U))}function Vt(U,$){let et=l.get($);et===void 0&&(et=new WeakMap,l.set($,et));let ut=et.get(U);ut===void 0&&(ut=r.getUniformBlockIndex($,U.name),et.set(U,ut))}function he(U,$){let ut=l.get($).get(U);a.get($)!==ut&&(r.uniformBlockBinding($,ut,U.__bindingPointIndex),a.set($,ut))}function kt(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),c={},O=null,L={},u={},h=new WeakMap,f=[],d=null,_=!1,g=null,m=null,p=null,b=null,y=null,S=null,D=null,A=new ce(0,0,0),w=0,P=!1,M=null,v=null,N=null,F=null,R=null,vt.set(0,0,r.canvas.width,r.canvas.height),Wt.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),o.reset()}return{buffers:{color:i,depth:s,stencil:o},enable:pt,disable:st,bindFramebuffer:Ft,drawBuffers:Nt,useProgram:V,setBlending:Tt,setMaterial:St,setFlipSided:zt,setCullFace:Ut,setLineWidth:k,setPolygonOffset:Qt,setScissorTest:T,activeTexture:x,bindTexture:I,unbindTexture:G,compressedTexImage2D:K,compressedTexImage3D:Q,texImage2D:Ot,texImage3D:it,updateUBOMapping:Vt,uniformBlockBinding:he,texStorage2D:rt,texStorage3D:ft,texSubImage2D:ht,texSubImage3D:ct,compressedTexSubImage2D:nt,compressedTexSubImage3D:bt,scissor:yt,viewport:Bt,reset:kt}}function xb(r,t,e,n,i,s,o){let a=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new ue,u=new WeakMap,h,f=new WeakMap,d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(T,x){return d?new OffscreenCanvas(T,x):bl("canvas")}function g(T,x,I){let G=1,K=Qt(T);if((K.width>I||K.height>I)&&(G=I/Math.max(K.width,K.height)),G<1)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap||typeof VideoFrame<"u"&&T instanceof VideoFrame){let Q=Math.floor(G*K.width),ht=Math.floor(G*K.height);h===void 0&&(h=_(Q,ht));let ct=x?_(Q,ht):h;return ct.width=Q,ct.height=ht,ct.getContext("2d").drawImage(T,0,0,Q,ht),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+K.width+"x"+K.height+") to ("+Q+"x"+ht+")."),ct}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+K.width+"x"+K.height+")."),T;return T}function m(T){return T.generateMipmaps&&T.minFilter!==Yn&&T.minFilter!==oi}function p(T){r.generateMipmap(T)}function b(T,x,I,G,K=!1){if(T!==null){if(r[T]!==void 0)return r[T];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let Q=x;if(x===r.RED&&(I===r.FLOAT&&(Q=r.R32F),I===r.HALF_FLOAT&&(Q=r.R16F),I===r.UNSIGNED_BYTE&&(Q=r.R8)),x===r.RED_INTEGER&&(I===r.UNSIGNED_BYTE&&(Q=r.R8UI),I===r.UNSIGNED_SHORT&&(Q=r.R16UI),I===r.UNSIGNED_INT&&(Q=r.R32UI),I===r.BYTE&&(Q=r.R8I),I===r.SHORT&&(Q=r.R16I),I===r.INT&&(Q=r.R32I)),x===r.RG&&(I===r.FLOAT&&(Q=r.RG32F),I===r.HALF_FLOAT&&(Q=r.RG16F),I===r.UNSIGNED_BYTE&&(Q=r.RG8)),x===r.RG_INTEGER&&(I===r.UNSIGNED_BYTE&&(Q=r.RG8UI),I===r.UNSIGNED_SHORT&&(Q=r.RG16UI),I===r.UNSIGNED_INT&&(Q=r.RG32UI),I===r.BYTE&&(Q=r.RG8I),I===r.SHORT&&(Q=r.RG16I),I===r.INT&&(Q=r.RG32I)),x===r.RGB&&I===r.UNSIGNED_INT_5_9_9_9_REV&&(Q=r.RGB9_E5),x===r.RGBA){let ht=K?vl:me.getTransfer(G);I===r.FLOAT&&(Q=r.RGBA32F),I===r.HALF_FLOAT&&(Q=r.RGBA16F),I===r.UNSIGNED_BYTE&&(Q=ht===ye?r.SRGB8_ALPHA8:r.RGBA8),I===r.UNSIGNED_SHORT_4_4_4_4&&(Q=r.RGBA4),I===r.UNSIGNED_SHORT_5_5_5_1&&(Q=r.RGB5_A1)}return(Q===r.R16F||Q===r.R32F||Q===r.RG16F||Q===r.RG32F||Q===r.RGBA16F||Q===r.RGBA32F)&&t.get("EXT_color_buffer_float"),Q}function y(T,x){return m(T)===!0||T.isFramebufferTexture&&T.minFilter!==Yn&&T.minFilter!==oi?Math.log2(Math.max(x.width,x.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?x.mipmaps.length:1}function S(T){let x=T.target;x.removeEventListener("dispose",S),A(x),x.isVideoTexture&&u.delete(x)}function D(T){let x=T.target;x.removeEventListener("dispose",D),P(x)}function A(T){let x=n.get(T);if(x.__webglInit===void 0)return;let I=T.source,G=f.get(I);if(G){let K=G[x.__cacheKey];K.usedTimes--,K.usedTimes===0&&w(T),Object.keys(G).length===0&&f.delete(I)}n.remove(T)}function w(T){let x=n.get(T);r.deleteTexture(x.__webglTexture);let I=T.source,G=f.get(I);delete G[x.__cacheKey],o.memory.textures--}function P(T){let x=n.get(T);if(T.depthTexture&&T.depthTexture.dispose(),T.isWebGLCubeRenderTarget)for(let G=0;G<6;G++){if(Array.isArray(x.__webglFramebuffer[G]))for(let K=0;K<x.__webglFramebuffer[G].length;K++)r.deleteFramebuffer(x.__webglFramebuffer[G][K]);else r.deleteFramebuffer(x.__webglFramebuffer[G]);x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer[G])}else{if(Array.isArray(x.__webglFramebuffer))for(let G=0;G<x.__webglFramebuffer.length;G++)r.deleteFramebuffer(x.__webglFramebuffer[G]);else r.deleteFramebuffer(x.__webglFramebuffer);if(x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer),x.__webglMultisampledFramebuffer&&r.deleteFramebuffer(x.__webglMultisampledFramebuffer),x.__webglColorRenderbuffer)for(let G=0;G<x.__webglColorRenderbuffer.length;G++)x.__webglColorRenderbuffer[G]&&r.deleteRenderbuffer(x.__webglColorRenderbuffer[G]);x.__webglDepthRenderbuffer&&r.deleteRenderbuffer(x.__webglDepthRenderbuffer)}let I=T.textures;for(let G=0,K=I.length;G<K;G++){let Q=n.get(I[G]);Q.__webglTexture&&(r.deleteTexture(Q.__webglTexture),o.memory.textures--),n.remove(I[G])}n.remove(T)}let M=0;function v(){M=0}function N(){let T=M;return T>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+i.maxTextures),M+=1,T}function F(T){let x=[];return x.push(T.wrapS),x.push(T.wrapT),x.push(T.wrapR||0),x.push(T.magFilter),x.push(T.minFilter),x.push(T.anisotropy),x.push(T.internalFormat),x.push(T.format),x.push(T.type),x.push(T.generateMipmaps),x.push(T.premultiplyAlpha),x.push(T.flipY),x.push(T.unpackAlignment),x.push(T.colorSpace),x.join()}function R(T,x){let I=n.get(T);if(T.isVideoTexture&&Ut(T),T.isRenderTargetTexture===!1&&T.version>0&&I.__version!==T.version){let G=T.image;if(G===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(G.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{vt(I,T,x);return}}e.bindTexture(r.TEXTURE_2D,I.__webglTexture,r.TEXTURE0+x)}function B(T,x){let I=n.get(T);if(T.version>0&&I.__version!==T.version){vt(I,T,x);return}e.bindTexture(r.TEXTURE_2D_ARRAY,I.__webglTexture,r.TEXTURE0+x)}function Y(T,x){let I=n.get(T);if(T.version>0&&I.__version!==T.version){vt(I,T,x);return}e.bindTexture(r.TEXTURE_3D,I.__webglTexture,r.TEXTURE0+x)}function H(T,x){let I=n.get(T);if(T.version>0&&I.__version!==T.version){Wt(I,T,x);return}e.bindTexture(r.TEXTURE_CUBE_MAP,I.__webglTexture,r.TEXTURE0+x)}let J={[eh]:r.REPEAT,[es]:r.CLAMP_TO_EDGE,[nh]:r.MIRRORED_REPEAT},O={[Yn]:r.NEAREST,[ux]:r.NEAREST_MIPMAP_NEAREST,[Xa]:r.NEAREST_MIPMAP_LINEAR,[oi]:r.LINEAR,[_u]:r.LINEAR_MIPMAP_NEAREST,[ns]:r.LINEAR_MIPMAP_LINEAR},L={[Ex]:r.NEVER,[Px]:r.ALWAYS,[Tx]:r.LESS,[eg]:r.LEQUAL,[Ax]:r.EQUAL,[Rx]:r.GEQUAL,[Dx]:r.GREATER,[Cx]:r.NOTEQUAL};function C(T,x){if(x.type===hr&&t.has("OES_texture_float_linear")===!1&&(x.magFilter===oi||x.magFilter===_u||x.magFilter===Xa||x.magFilter===ns||x.minFilter===oi||x.minFilter===_u||x.minFilter===Xa||x.minFilter===ns)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(T,r.TEXTURE_WRAP_S,J[x.wrapS]),r.texParameteri(T,r.TEXTURE_WRAP_T,J[x.wrapT]),(T===r.TEXTURE_3D||T===r.TEXTURE_2D_ARRAY)&&r.texParameteri(T,r.TEXTURE_WRAP_R,J[x.wrapR]),r.texParameteri(T,r.TEXTURE_MAG_FILTER,O[x.magFilter]),r.texParameteri(T,r.TEXTURE_MIN_FILTER,O[x.minFilter]),x.compareFunction&&(r.texParameteri(T,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(T,r.TEXTURE_COMPARE_FUNC,L[x.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(x.magFilter===Yn||x.minFilter!==Xa&&x.minFilter!==ns||x.type===hr&&t.has("OES_texture_float_linear")===!1)return;if(x.anisotropy>1||n.get(x).__currentAnisotropy){let I=t.get("EXT_texture_filter_anisotropic");r.texParameterf(T,I.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(x.anisotropy,i.getMaxAnisotropy())),n.get(x).__currentAnisotropy=x.anisotropy}}}function ot(T,x){let I=!1;T.__webglInit===void 0&&(T.__webglInit=!0,x.addEventListener("dispose",S));let G=x.source,K=f.get(G);K===void 0&&(K={},f.set(G,K));let Q=F(x);if(Q!==T.__cacheKey){K[Q]===void 0&&(K[Q]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,I=!0),K[Q].usedTimes++;let ht=K[T.__cacheKey];ht!==void 0&&(K[T.__cacheKey].usedTimes--,ht.usedTimes===0&&w(x)),T.__cacheKey=Q,T.__webglTexture=K[Q].texture}return I}function vt(T,x,I){let G=r.TEXTURE_2D;(x.isDataArrayTexture||x.isCompressedArrayTexture)&&(G=r.TEXTURE_2D_ARRAY),x.isData3DTexture&&(G=r.TEXTURE_3D);let K=ot(T,x),Q=x.source;e.bindTexture(G,T.__webglTexture,r.TEXTURE0+I);let ht=n.get(Q);if(Q.version!==ht.__version||K===!0){e.activeTexture(r.TEXTURE0+I);let ct=me.getPrimaries(me.workingColorSpace),nt=x.colorSpace===ur?null:me.getPrimaries(x.colorSpace),bt=x.colorSpace===ur||ct===nt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,bt);let rt=g(x.image,!1,i.maxTextureSize);rt=k(x,rt);let ft=s.convert(x.format,x.colorSpace),Ot=s.convert(x.type),it=b(x.internalFormat,ft,Ot,x.colorSpace,x.isVideoTexture);C(G,x);let yt,Bt=x.mipmaps,Vt=x.isVideoTexture!==!0,he=ht.__version===void 0||K===!0,kt=Q.dataReady,U=y(x,rt);if(x.isDepthTexture)it=r.DEPTH_COMPONENT16,x.type===hr?it=r.DEPTH_COMPONENT32F:x.type===to?it=r.DEPTH_COMPONENT24:x.type===Ko&&(it=r.DEPTH24_STENCIL8),he&&(Vt?e.texStorage2D(r.TEXTURE_2D,1,it,rt.width,rt.height):e.texImage2D(r.TEXTURE_2D,0,it,rt.width,rt.height,0,ft,Ot,null));else if(x.isDataTexture)if(Bt.length>0){Vt&&he&&e.texStorage2D(r.TEXTURE_2D,U,it,Bt[0].width,Bt[0].height);for(let $=0,et=Bt.length;$<et;$++)yt=Bt[$],Vt?kt&&e.texSubImage2D(r.TEXTURE_2D,$,0,0,yt.width,yt.height,ft,Ot,yt.data):e.texImage2D(r.TEXTURE_2D,$,it,yt.width,yt.height,0,ft,Ot,yt.data);x.generateMipmaps=!1}else Vt?(he&&e.texStorage2D(r.TEXTURE_2D,U,it,rt.width,rt.height),kt&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,rt.width,rt.height,ft,Ot,rt.data)):e.texImage2D(r.TEXTURE_2D,0,it,rt.width,rt.height,0,ft,Ot,rt.data);else if(x.isCompressedTexture)if(x.isCompressedArrayTexture){Vt&&he&&e.texStorage3D(r.TEXTURE_2D_ARRAY,U,it,Bt[0].width,Bt[0].height,rt.depth);for(let $=0,et=Bt.length;$<et;$++)yt=Bt[$],x.format!==Si?ft!==null?Vt?kt&&e.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,$,0,0,0,yt.width,yt.height,rt.depth,ft,yt.data,0,0):e.compressedTexImage3D(r.TEXTURE_2D_ARRAY,$,it,yt.width,yt.height,rt.depth,0,yt.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Vt?kt&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,$,0,0,0,yt.width,yt.height,rt.depth,ft,Ot,yt.data):e.texImage3D(r.TEXTURE_2D_ARRAY,$,it,yt.width,yt.height,rt.depth,0,ft,Ot,yt.data)}else{Vt&&he&&e.texStorage2D(r.TEXTURE_2D,U,it,Bt[0].width,Bt[0].height);for(let $=0,et=Bt.length;$<et;$++)yt=Bt[$],x.format!==Si?ft!==null?Vt?kt&&e.compressedTexSubImage2D(r.TEXTURE_2D,$,0,0,yt.width,yt.height,ft,yt.data):e.compressedTexImage2D(r.TEXTURE_2D,$,it,yt.width,yt.height,0,yt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Vt?kt&&e.texSubImage2D(r.TEXTURE_2D,$,0,0,yt.width,yt.height,ft,Ot,yt.data):e.texImage2D(r.TEXTURE_2D,$,it,yt.width,yt.height,0,ft,Ot,yt.data)}else if(x.isDataArrayTexture)Vt?(he&&e.texStorage3D(r.TEXTURE_2D_ARRAY,U,it,rt.width,rt.height,rt.depth),kt&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,rt.width,rt.height,rt.depth,ft,Ot,rt.data)):e.texImage3D(r.TEXTURE_2D_ARRAY,0,it,rt.width,rt.height,rt.depth,0,ft,Ot,rt.data);else if(x.isData3DTexture)Vt?(he&&e.texStorage3D(r.TEXTURE_3D,U,it,rt.width,rt.height,rt.depth),kt&&e.texSubImage3D(r.TEXTURE_3D,0,0,0,0,rt.width,rt.height,rt.depth,ft,Ot,rt.data)):e.texImage3D(r.TEXTURE_3D,0,it,rt.width,rt.height,rt.depth,0,ft,Ot,rt.data);else if(x.isFramebufferTexture){if(he)if(Vt)e.texStorage2D(r.TEXTURE_2D,U,it,rt.width,rt.height);else{let $=rt.width,et=rt.height;for(let ut=0;ut<U;ut++)e.texImage2D(r.TEXTURE_2D,ut,it,$,et,0,ft,Ot,null),$>>=1,et>>=1}}else if(Bt.length>0){if(Vt&&he){let $=Qt(Bt[0]);e.texStorage2D(r.TEXTURE_2D,U,it,$.width,$.height)}for(let $=0,et=Bt.length;$<et;$++)yt=Bt[$],Vt?kt&&e.texSubImage2D(r.TEXTURE_2D,$,0,0,ft,Ot,yt):e.texImage2D(r.TEXTURE_2D,$,it,ft,Ot,yt);x.generateMipmaps=!1}else if(Vt){if(he){let $=Qt(rt);e.texStorage2D(r.TEXTURE_2D,U,it,$.width,$.height)}kt&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,ft,Ot,rt)}else e.texImage2D(r.TEXTURE_2D,0,it,ft,Ot,rt);m(x)&&p(G),ht.__version=Q.version,x.onUpdate&&x.onUpdate(x)}T.__version=x.version}function Wt(T,x,I){if(x.image.length!==6)return;let G=ot(T,x),K=x.source;e.bindTexture(r.TEXTURE_CUBE_MAP,T.__webglTexture,r.TEXTURE0+I);let Q=n.get(K);if(K.version!==Q.__version||G===!0){e.activeTexture(r.TEXTURE0+I);let ht=me.getPrimaries(me.workingColorSpace),ct=x.colorSpace===ur?null:me.getPrimaries(x.colorSpace),nt=x.colorSpace===ur||ht===ct?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,nt);let bt=x.isCompressedTexture||x.image[0].isCompressedTexture,rt=x.image[0]&&x.image[0].isDataTexture,ft=[];for(let et=0;et<6;et++)!bt&&!rt?ft[et]=g(x.image[et],!0,i.maxCubemapSize):ft[et]=rt?x.image[et].image:x.image[et],ft[et]=k(x,ft[et]);let Ot=ft[0],it=s.convert(x.format,x.colorSpace),yt=s.convert(x.type),Bt=b(x.internalFormat,it,yt,x.colorSpace),Vt=x.isVideoTexture!==!0,he=Q.__version===void 0||G===!0,kt=K.dataReady,U=y(x,Ot);C(r.TEXTURE_CUBE_MAP,x);let $;if(bt){Vt&&he&&e.texStorage2D(r.TEXTURE_CUBE_MAP,U,Bt,Ot.width,Ot.height);for(let et=0;et<6;et++){$=ft[et].mipmaps;for(let ut=0;ut<$.length;ut++){let lt=$[ut];x.format!==Si?it!==null?Vt?kt&&e.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut,0,0,lt.width,lt.height,it,lt.data):e.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut,Bt,lt.width,lt.height,0,lt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Vt?kt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut,0,0,lt.width,lt.height,it,yt,lt.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut,Bt,lt.width,lt.height,0,it,yt,lt.data)}}}else{if($=x.mipmaps,Vt&&he){$.length>0&&U++;let et=Qt(ft[0]);e.texStorage2D(r.TEXTURE_CUBE_MAP,U,Bt,et.width,et.height)}for(let et=0;et<6;et++)if(rt){Vt?kt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,0,0,0,ft[et].width,ft[et].height,it,yt,ft[et].data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,0,Bt,ft[et].width,ft[et].height,0,it,yt,ft[et].data);for(let ut=0;ut<$.length;ut++){let Dt=$[ut].image[et].image;Vt?kt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut+1,0,0,Dt.width,Dt.height,it,yt,Dt.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut+1,Bt,Dt.width,Dt.height,0,it,yt,Dt.data)}}else{Vt?kt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,0,0,0,it,yt,ft[et]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,0,Bt,it,yt,ft[et]);for(let ut=0;ut<$.length;ut++){let lt=$[ut];Vt?kt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut+1,0,0,it,yt,lt.image[et]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+et,ut+1,Bt,it,yt,lt.image[et])}}}m(x)&&p(r.TEXTURE_CUBE_MAP),Q.__version=K.version,x.onUpdate&&x.onUpdate(x)}T.__version=x.version}function q(T,x,I,G,K,Q){let ht=s.convert(I.format,I.colorSpace),ct=s.convert(I.type),nt=b(I.internalFormat,ht,ct,I.colorSpace);if(!n.get(x).__hasExternalTextures){let rt=Math.max(1,x.width>>Q),ft=Math.max(1,x.height>>Q);K===r.TEXTURE_3D||K===r.TEXTURE_2D_ARRAY?e.texImage3D(K,Q,nt,rt,ft,x.depth,0,ht,ct,null):e.texImage2D(K,Q,nt,rt,ft,0,ht,ct,null)}e.bindFramebuffer(r.FRAMEBUFFER,T),zt(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,G,K,n.get(I).__webglTexture,0,St(x)):(K===r.TEXTURE_2D||K>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&K<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,G,K,n.get(I).__webglTexture,Q),e.bindFramebuffer(r.FRAMEBUFFER,null)}function tt(T,x,I){if(r.bindRenderbuffer(r.RENDERBUFFER,T),x.depthBuffer&&!x.stencilBuffer){let G=r.DEPTH_COMPONENT24;if(I||zt(x)){let K=x.depthTexture;K&&K.isDepthTexture&&(K.type===hr?G=r.DEPTH_COMPONENT32F:K.type===to&&(G=r.DEPTH_COMPONENT24));let Q=St(x);zt(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Q,G,x.width,x.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,Q,G,x.width,x.height)}else r.renderbufferStorage(r.RENDERBUFFER,G,x.width,x.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,T)}else if(x.depthBuffer&&x.stencilBuffer){let G=St(x);I&&zt(x)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,G,r.DEPTH24_STENCIL8,x.width,x.height):zt(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,G,r.DEPTH24_STENCIL8,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,x.width,x.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,T)}else{let G=x.textures;for(let K=0;K<G.length;K++){let Q=G[K],ht=s.convert(Q.format,Q.colorSpace),ct=s.convert(Q.type),nt=b(Q.internalFormat,ht,ct,Q.colorSpace),bt=St(x);I&&zt(x)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,bt,nt,x.width,x.height):zt(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,bt,nt,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,nt,x.width,x.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function pt(T,x){if(x&&x.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(r.FRAMEBUFFER,T),!(x.depthTexture&&x.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(x.depthTexture).__webglTexture||x.depthTexture.image.width!==x.width||x.depthTexture.image.height!==x.height)&&(x.depthTexture.image.width=x.width,x.depthTexture.image.height=x.height,x.depthTexture.needsUpdate=!0),R(x.depthTexture,0);let G=n.get(x.depthTexture).__webglTexture,K=St(x);if(x.depthTexture.format===Js)zt(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,G,0,K):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,G,0);else if(x.depthTexture.format===Yo)zt(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,G,0,K):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,G,0);else throw new Error("Unknown depthTexture format")}function st(T){let x=n.get(T),I=T.isWebGLCubeRenderTarget===!0;if(T.depthTexture&&!x.__autoAllocateDepthBuffer){if(I)throw new Error("target.depthTexture not supported in Cube render targets");pt(x.__webglFramebuffer,T)}else if(I){x.__webglDepthbuffer=[];for(let G=0;G<6;G++)e.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer[G]),x.__webglDepthbuffer[G]=r.createRenderbuffer(),tt(x.__webglDepthbuffer[G],T,!1)}else e.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer),x.__webglDepthbuffer=r.createRenderbuffer(),tt(x.__webglDepthbuffer,T,!1);e.bindFramebuffer(r.FRAMEBUFFER,null)}function Ft(T,x,I){let G=n.get(T);x!==void 0&&q(G.__webglFramebuffer,T,T.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),I!==void 0&&st(T)}function Nt(T){let x=T.texture,I=n.get(T),G=n.get(x);T.addEventListener("dispose",D);let K=T.textures,Q=T.isWebGLCubeRenderTarget===!0,ht=K.length>1;if(ht||(G.__webglTexture===void 0&&(G.__webglTexture=r.createTexture()),G.__version=x.version,o.memory.textures++),Q){I.__webglFramebuffer=[];for(let ct=0;ct<6;ct++)if(x.mipmaps&&x.mipmaps.length>0){I.__webglFramebuffer[ct]=[];for(let nt=0;nt<x.mipmaps.length;nt++)I.__webglFramebuffer[ct][nt]=r.createFramebuffer()}else I.__webglFramebuffer[ct]=r.createFramebuffer()}else{if(x.mipmaps&&x.mipmaps.length>0){I.__webglFramebuffer=[];for(let ct=0;ct<x.mipmaps.length;ct++)I.__webglFramebuffer[ct]=r.createFramebuffer()}else I.__webglFramebuffer=r.createFramebuffer();if(ht)for(let ct=0,nt=K.length;ct<nt;ct++){let bt=n.get(K[ct]);bt.__webglTexture===void 0&&(bt.__webglTexture=r.createTexture(),o.memory.textures++)}if(T.samples>0&&zt(T)===!1){I.__webglMultisampledFramebuffer=r.createFramebuffer(),I.__webglColorRenderbuffer=[],e.bindFramebuffer(r.FRAMEBUFFER,I.__webglMultisampledFramebuffer);for(let ct=0;ct<K.length;ct++){let nt=K[ct];I.__webglColorRenderbuffer[ct]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,I.__webglColorRenderbuffer[ct]);let bt=s.convert(nt.format,nt.colorSpace),rt=s.convert(nt.type),ft=b(nt.internalFormat,bt,rt,nt.colorSpace,T.isXRRenderTarget===!0),Ot=St(T);r.renderbufferStorageMultisample(r.RENDERBUFFER,Ot,ft,T.width,T.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+ct,r.RENDERBUFFER,I.__webglColorRenderbuffer[ct])}r.bindRenderbuffer(r.RENDERBUFFER,null),T.depthBuffer&&(I.__webglDepthRenderbuffer=r.createRenderbuffer(),tt(I.__webglDepthRenderbuffer,T,!0)),e.bindFramebuffer(r.FRAMEBUFFER,null)}}if(Q){e.bindTexture(r.TEXTURE_CUBE_MAP,G.__webglTexture),C(r.TEXTURE_CUBE_MAP,x);for(let ct=0;ct<6;ct++)if(x.mipmaps&&x.mipmaps.length>0)for(let nt=0;nt<x.mipmaps.length;nt++)q(I.__webglFramebuffer[ct][nt],T,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+ct,nt);else q(I.__webglFramebuffer[ct],T,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+ct,0);m(x)&&p(r.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(ht){for(let ct=0,nt=K.length;ct<nt;ct++){let bt=K[ct],rt=n.get(bt);e.bindTexture(r.TEXTURE_2D,rt.__webglTexture),C(r.TEXTURE_2D,bt),q(I.__webglFramebuffer,T,bt,r.COLOR_ATTACHMENT0+ct,r.TEXTURE_2D,0),m(bt)&&p(r.TEXTURE_2D)}e.unbindTexture()}else{let ct=r.TEXTURE_2D;if((T.isWebGL3DRenderTarget||T.isWebGLArrayRenderTarget)&&(ct=T.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),e.bindTexture(ct,G.__webglTexture),C(ct,x),x.mipmaps&&x.mipmaps.length>0)for(let nt=0;nt<x.mipmaps.length;nt++)q(I.__webglFramebuffer[nt],T,x,r.COLOR_ATTACHMENT0,ct,nt);else q(I.__webglFramebuffer,T,x,r.COLOR_ATTACHMENT0,ct,0);m(x)&&p(ct),e.unbindTexture()}T.depthBuffer&&st(T)}function V(T){let x=T.textures;for(let I=0,G=x.length;I<G;I++){let K=x[I];if(m(K)){let Q=T.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,ht=n.get(K).__webglTexture;e.bindTexture(Q,ht),p(Q),e.unbindTexture()}}}let Yt=[],Et=[];function Tt(T){if(T.samples>0){if(zt(T)===!1){let x=T.textures,I=T.width,G=T.height,K=r.COLOR_BUFFER_BIT,Q=T.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ht=n.get(T),ct=x.length>1;if(ct)for(let nt=0;nt<x.length;nt++)e.bindFramebuffer(r.FRAMEBUFFER,ht.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+nt,r.RENDERBUFFER,null),e.bindFramebuffer(r.FRAMEBUFFER,ht.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+nt,r.TEXTURE_2D,null,0);e.bindFramebuffer(r.READ_FRAMEBUFFER,ht.__webglMultisampledFramebuffer),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,ht.__webglFramebuffer);for(let nt=0;nt<x.length;nt++){if(T.resolveDepthBuffer&&(T.depthBuffer&&(K|=r.DEPTH_BUFFER_BIT),T.stencilBuffer&&T.resolveStencilBuffer&&(K|=r.STENCIL_BUFFER_BIT)),ct){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,ht.__webglColorRenderbuffer[nt]);let bt=n.get(x[nt]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,bt,0)}r.blitFramebuffer(0,0,I,G,0,0,I,G,K,r.NEAREST),l===!0&&(Yt.length=0,Et.length=0,Yt.push(r.COLOR_ATTACHMENT0+nt),T.depthBuffer&&T.resolveDepthBuffer===!1&&(Yt.push(Q),Et.push(Q),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,Et)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,Yt))}if(e.bindFramebuffer(r.READ_FRAMEBUFFER,null),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),ct)for(let nt=0;nt<x.length;nt++){e.bindFramebuffer(r.FRAMEBUFFER,ht.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+nt,r.RENDERBUFFER,ht.__webglColorRenderbuffer[nt]);let bt=n.get(x[nt]).__webglTexture;e.bindFramebuffer(r.FRAMEBUFFER,ht.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+nt,r.TEXTURE_2D,bt,0)}e.bindFramebuffer(r.DRAW_FRAMEBUFFER,ht.__webglMultisampledFramebuffer)}else if(T.depthBuffer&&T.resolveDepthBuffer===!1&&l){let x=T.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[x])}}}function St(T){return Math.min(i.maxSamples,T.samples)}function zt(T){let x=n.get(T);return T.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&x.__useRenderToTexture!==!1}function Ut(T){let x=o.render.frame;u.get(T)!==x&&(u.set(T,x),T.update())}function k(T,x){let I=T.colorSpace,G=T.format,K=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||I!==yr&&I!==ur&&(me.getTransfer(I)===ye?(G!==Si||K!==_r)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",I)),x}function Qt(T){return typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement?(c.width=T.naturalWidth||T.width,c.height=T.naturalHeight||T.height):typeof VideoFrame<"u"&&T instanceof VideoFrame?(c.width=T.displayWidth,c.height=T.displayHeight):(c.width=T.width,c.height=T.height),c}this.allocateTextureUnit=N,this.resetTextureUnits=v,this.setTexture2D=R,this.setTexture2DArray=B,this.setTexture3D=Y,this.setTextureCube=H,this.rebindTextures=Ft,this.setupRenderTarget=Nt,this.updateRenderTargetMipmap=V,this.updateMultisampleRenderTarget=Tt,this.setupDepthRenderbuffer=st,this.setupFrameBufferTexture=q,this.useMultisampledRTT=zt}function vb(r,t){function e(n,i=ur){let s,o=me.getTransfer(i);if(n===_r)return r.UNSIGNED_BYTE;if(n===$m)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Km)return r.UNSIGNED_SHORT_5_5_5_1;if(n===dx)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===hx)return r.BYTE;if(n===fx)return r.SHORT;if(n===Zm)return r.UNSIGNED_SHORT;if(n===Jm)return r.INT;if(n===to)return r.UNSIGNED_INT;if(n===hr)return r.FLOAT;if(n===Wl)return r.HALF_FLOAT;if(n===px)return r.ALPHA;if(n===mx)return r.RGB;if(n===Si)return r.RGBA;if(n===gx)return r.LUMINANCE;if(n===_x)return r.LUMINANCE_ALPHA;if(n===Js)return r.DEPTH_COMPONENT;if(n===Yo)return r.DEPTH_STENCIL;if(n===xx)return r.RED;if(n===jm)return r.RED_INTEGER;if(n===vx)return r.RG;if(n===Qm)return r.RG_INTEGER;if(n===tg)return r.RGBA_INTEGER;if(n===xu||n===vu||n===yu||n===Su)if(o===ye)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===xu)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===vu)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===yu)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Su)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===xu)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===vu)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===yu)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Su)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===bp||n===wp||n===Ep||n===Tp)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===bp)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===wp)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Ep)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Tp)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Ap||n===Dp||n===Cp)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(n===Ap||n===Dp)return o===ye?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===Cp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Rp||n===Pp||n===Ip||n===Lp||n===Fp||n===Np||n===Up||n===Op||n===Bp||n===zp||n===kp||n===Vp||n===Hp||n===Gp)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(n===Rp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Pp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Ip)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Lp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Fp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Np)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Up)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Op)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Bp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===zp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===kp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Vp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Hp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Gp)return o===ye?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Mu||n===Wp||n===Xp)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(n===Mu)return o===ye?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Wp)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Xp)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===yx||n===qp||n===Yp||n===Zp)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(n===Mu)return s.COMPRESSED_RED_RGTC1_EXT;if(n===qp)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Yp)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Zp)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Ko?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:e}}var _h=class extends Sn{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}},fr=class extends cn{constructor(){super(),this.isGroup=!0,this.type="Group"}},yb={type:"move"},qo=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new fr,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new fr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new j,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new j),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new fr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new j,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new j),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let i=null,s=null,o=null,a=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){o=!0;for(let g of t.hand.values()){let m=e.getJointPose(g,n),p=this._getHandJoint(c,g);m!==null&&(p.matrix.fromArray(m.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=m.radius),p.visible=m!==null}let u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],f=u.position.distanceTo(h.position),d=.02,_=.005;c.inputState.pinching&&f>d+_?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&f<=d-_&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=e.getPose(t.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(yb)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){let n=new fr;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}},Sb=`
|
|
3798
3798
|
void main() {
|
|
3799
3799
|
|
|
3800
3800
|
gl_Position = vec4( position, 1.0 );
|
|
@@ -3818,7 +3818,7 @@ void main() {
|
|
|
3818
3818
|
|
|
3819
3819
|
}
|
|
3820
3820
|
|
|
3821
|
-
}`,xh=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){let i=new $n,s=t.properties.get(i);s.__webglTexture=e.texture,(e.depthNear!=n.depthNear||e.depthFar!=n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}render(t,e){if(this.texture!==null){if(this.mesh===null){let n=e.cameras[0].viewport,i=new Kn({vertexShader:Sb,fragmentShader:Mb,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new ai(new Ll(20,20),i)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},vh=class extends xr{constructor(t,e){super();let n=this,i=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,f=null,h=null,d=null,_=null,g=new xh,p=e.getContextAttributes(),m=null,b=null,S=[],y=[],D=new ue,A=null,w=new Sn;w.layers.enable(1),w.viewport=new Ye;let P=new Sn;P.layers.enable(2),P.viewport=new Ye;let M=[w,P],v=new _h;v.layers.enable(1),v.layers.enable(2);let N=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(q){let tt=S[q];return tt===void 0&&(tt=new qo,S[q]=tt),tt.getTargetRaySpace()},this.getControllerGrip=function(q){let tt=S[q];return tt===void 0&&(tt=new qo,S[q]=tt),tt.getGripSpace()},this.getHand=function(q){let tt=S[q];return tt===void 0&&(tt=new qo,S[q]=tt),tt.getHandSpace()};function R(q){let tt=y.indexOf(q.inputSource);if(tt===-1)return;let pt=S[tt];pt!==void 0&&(pt.update(q.inputSource,q.frame,c||o),pt.dispatchEvent({type:q.type,data:q.inputSource}))}function B(){i.removeEventListener("select",R),i.removeEventListener("selectstart",R),i.removeEventListener("selectend",R),i.removeEventListener("squeeze",R),i.removeEventListener("squeezestart",R),i.removeEventListener("squeezeend",R),i.removeEventListener("end",B),i.removeEventListener("inputsourceschange",Y);for(let q=0;q<S.length;q++){let tt=y[q];tt!==null&&(y[q]=null,S[q].disconnect(tt))}N=null,F=null,g.reset(),t.setRenderTarget(m),d=null,h=null,f=null,i=null,b=null,Wt.stop(),n.isPresenting=!1,t.setPixelRatio(A),t.setSize(D.width,D.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(q){s=q,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(q){a=q,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(q){c=q},this.getBaseLayer=function(){return h!==null?h:d},this.getBinding=function(){return f},this.getFrame=function(){return _},this.getSession=function(){return i},this.setSession=async function(q){if(i=q,i!==null){if(m=t.getRenderTarget(),i.addEventListener("select",R),i.addEventListener("selectstart",R),i.addEventListener("selectend",R),i.addEventListener("squeeze",R),i.addEventListener("squeezestart",R),i.addEventListener("squeezeend",R),i.addEventListener("end",B),i.addEventListener("inputsourceschange",Y),p.xrCompatible!==!0&&await e.makeXRCompatible(),A=t.getPixelRatio(),t.getSize(D),i.renderState.layers===void 0){let tt={antialias:p.antialias,alpha:!0,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(i,e,tt),i.updateRenderState({baseLayer:d}),t.setPixelRatio(1),t.setSize(d.framebufferWidth,d.framebufferHeight,!1),b=new Gi(d.framebufferWidth,d.framebufferHeight,{format:Si,type:_r,colorSpace:t.outputColorSpace,stencilBuffer:p.stencil})}else{let tt=null,pt=null,st=null;p.depth&&(st=p.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,tt=p.stencil?Yo:Js,pt=p.stencil?Ko:to);let Ft={colorFormat:e.RGBA8,depthFormat:st,scaleFactor:s};f=new XRWebGLBinding(i,e),h=f.createProjectionLayer(Ft),i.updateRenderState({layers:[h]}),t.setPixelRatio(1),t.setSize(h.textureWidth,h.textureHeight,!1),b=new Gi(h.textureWidth,h.textureHeight,{format:Si,type:_r,depthTexture:new Ul(h.textureWidth,h.textureHeight,pt,void 0,void 0,void 0,void 0,void 0,void 0,tt),stencilBuffer:p.stencil,colorSpace:t.outputColorSpace,samples:p.antialias?4:0,resolveDepthBuffer:h.ignoreDepthValues===!1})}b.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await i.requestReferenceSpace(a),Wt.setContext(i),Wt.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function Y(q){for(let tt=0;tt<q.removed.length;tt++){let pt=q.removed[tt],st=y.indexOf(pt);st>=0&&(y[st]=null,S[st].disconnect(pt))}for(let tt=0;tt<q.added.length;tt++){let pt=q.added[tt],st=y.indexOf(pt);if(st===-1){for(let Nt=0;Nt<S.length;Nt++)if(Nt>=y.length){y.push(pt),st=Nt;break}else if(y[Nt]===null){y[Nt]=pt,st=Nt;break}if(st===-1)break}let Ft=S[st];Ft&&Ft.connect(pt)}}let H=new j,J=new j;function O(q,tt,pt){H.setFromMatrixPosition(tt.matrixWorld),J.setFromMatrixPosition(pt.matrixWorld);let st=H.distanceTo(J),Ft=tt.projectionMatrix.elements,Nt=pt.projectionMatrix.elements,V=Ft[14]/(Ft[10]-1),Yt=Ft[14]/(Ft[10]+1),Et=(Ft[9]+1)/Ft[5],Tt=(Ft[9]-1)/Ft[5],St=(Ft[8]-1)/Ft[0],zt=(Nt[8]+1)/Nt[0],Ut=V*St,k=V*zt,Qt=st/(-St+zt),T=Qt*-St;tt.matrixWorld.decompose(q.position,q.quaternion,q.scale),q.translateX(T),q.translateZ(Qt),q.matrixWorld.compose(q.position,q.quaternion,q.scale),q.matrixWorldInverse.copy(q.matrixWorld).invert();let x=V+Qt,I=Yt+Qt,G=Ut-T,K=k+(st-T),Q=Et*Yt/I*x,ht=Tt*Yt/I*x;q.projectionMatrix.makePerspective(G,K,Q,ht,x,I),q.projectionMatrixInverse.copy(q.projectionMatrix).invert()}function L(q,tt){tt===null?q.matrixWorld.copy(q.matrix):q.matrixWorld.multiplyMatrices(tt.matrixWorld,q.matrix),q.matrixWorldInverse.copy(q.matrixWorld).invert()}this.updateCamera=function(q){if(i===null)return;g.texture!==null&&(q.near=g.depthNear,q.far=g.depthFar),v.near=P.near=w.near=q.near,v.far=P.far=w.far=q.far,(N!==v.near||F!==v.far)&&(i.updateRenderState({depthNear:v.near,depthFar:v.far}),N=v.near,F=v.far,w.near=N,w.far=F,P.near=N,P.far=F,w.updateProjectionMatrix(),P.updateProjectionMatrix(),q.updateProjectionMatrix());let tt=q.parent,pt=v.cameras;L(v,tt);for(let st=0;st<pt.length;st++)L(pt[st],tt);pt.length===2?O(v,w,P):v.projectionMatrix.copy(w.projectionMatrix),C(q,v,tt)};function C(q,tt,pt){pt===null?q.matrix.copy(tt.matrixWorld):(q.matrix.copy(pt.matrixWorld),q.matrix.invert(),q.matrix.multiply(tt.matrixWorld)),q.matrix.decompose(q.position,q.quaternion,q.scale),q.updateMatrixWorld(!0),q.projectionMatrix.copy(tt.projectionMatrix),q.projectionMatrixInverse.copy(tt.projectionMatrixInverse),q.isPerspectiveCamera&&(q.fov=ih*2*Math.atan(1/q.projectionMatrix.elements[5]),q.zoom=1)}this.getCamera=function(){return v},this.getFoveation=function(){if(!(h===null&&d===null))return l},this.setFoveation=function(q){l=q,h!==null&&(h.fixedFoveation=q),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=q)},this.hasDepthSensing=function(){return g.texture!==null};let ot=null;function vt(q,tt){if(u=tt.getViewerPose(c||o),_=tt,u!==null){let pt=u.views;d!==null&&(t.setRenderTargetFramebuffer(b,d.framebuffer),t.setRenderTarget(b));let st=!1;pt.length!==v.cameras.length&&(v.cameras.length=0,st=!0);for(let Nt=0;Nt<pt.length;Nt++){let V=pt[Nt],Yt=null;if(d!==null)Yt=d.getViewport(V);else{let Tt=f.getViewSubImage(h,V);Yt=Tt.viewport,Nt===0&&(t.setRenderTargetTextures(b,Tt.colorTexture,h.ignoreDepthValues?void 0:Tt.depthStencilTexture),t.setRenderTarget(b))}let Et=M[Nt];Et===void 0&&(Et=new Sn,Et.layers.enable(Nt),Et.viewport=new Ye,M[Nt]=Et),Et.matrix.fromArray(V.transform.matrix),Et.matrix.decompose(Et.position,Et.quaternion,Et.scale),Et.projectionMatrix.fromArray(V.projectionMatrix),Et.projectionMatrixInverse.copy(Et.projectionMatrix).invert(),Et.viewport.set(Yt.x,Yt.y,Yt.width,Yt.height),Nt===0&&(v.matrix.copy(Et.matrix),v.matrix.decompose(v.position,v.quaternion,v.scale)),st===!0&&v.cameras.push(Et)}let Ft=i.enabledFeatures;if(Ft&&Ft.includes("depth-sensing")){let Nt=f.getDepthInformation(pt[0]);Nt&&Nt.isValid&&Nt.texture&&g.init(t,Nt,i.renderState)}}for(let pt=0;pt<S.length;pt++){let st=y[pt],Ft=S[pt];st!==null&&Ft!==void 0&&Ft.update(st,tt,c||o)}g.render(t,v),ot&&ot(q,tt),tt.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:tt}),_=null}let Wt=new sg;Wt.setAnimationLoop(vt),this.setAnimationLoop=function(q){ot=q},this.dispose=function(){}}},Kr=new Wi,bb=new Le;function wb(r,t){function e(p,m){p.matrixAutoUpdate===!0&&p.updateMatrix(),m.value.copy(p.matrix)}function n(p,m){m.color.getRGB(p.fogColor.value,rg(r)),m.isFog?(p.fogNear.value=m.near,p.fogFar.value=m.far):m.isFogExp2&&(p.fogDensity.value=m.density)}function i(p,m,b,S,y){m.isMeshBasicMaterial||m.isMeshLambertMaterial?s(p,m):m.isMeshToonMaterial?(s(p,m),f(p,m)):m.isMeshPhongMaterial?(s(p,m),u(p,m)):m.isMeshStandardMaterial?(s(p,m),h(p,m),m.isMeshPhysicalMaterial&&d(p,m,y)):m.isMeshMatcapMaterial?(s(p,m),_(p,m)):m.isMeshDepthMaterial?s(p,m):m.isMeshDistanceMaterial?(s(p,m),g(p,m)):m.isMeshNormalMaterial?s(p,m):m.isLineBasicMaterial?(o(p,m),m.isLineDashedMaterial&&a(p,m)):m.isPointsMaterial?l(p,m,b,S):m.isSpriteMaterial?c(p,m):m.isShadowMaterial?(p.color.value.copy(m.color),p.opacity.value=m.opacity):m.isShaderMaterial&&(m.uniformsNeedUpdate=!1)}function s(p,m){p.opacity.value=m.opacity,m.color&&p.diffuse.value.copy(m.color),m.emissive&&p.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity),m.map&&(p.map.value=m.map,e(m.map,p.mapTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,e(m.alphaMap,p.alphaMapTransform)),m.bumpMap&&(p.bumpMap.value=m.bumpMap,e(m.bumpMap,p.bumpMapTransform),p.bumpScale.value=m.bumpScale,m.side===Cn&&(p.bumpScale.value*=-1)),m.normalMap&&(p.normalMap.value=m.normalMap,e(m.normalMap,p.normalMapTransform),p.normalScale.value.copy(m.normalScale),m.side===Cn&&p.normalScale.value.negate()),m.displacementMap&&(p.displacementMap.value=m.displacementMap,e(m.displacementMap,p.displacementMapTransform),p.displacementScale.value=m.displacementScale,p.displacementBias.value=m.displacementBias),m.emissiveMap&&(p.emissiveMap.value=m.emissiveMap,e(m.emissiveMap,p.emissiveMapTransform)),m.specularMap&&(p.specularMap.value=m.specularMap,e(m.specularMap,p.specularMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);let b=t.get(m),S=b.envMap,y=b.envMapRotation;if(S&&(p.envMap.value=S,Kr.copy(y),Kr.x*=-1,Kr.y*=-1,Kr.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(Kr.y*=-1,Kr.z*=-1),p.envMapRotation.value.setFromMatrix4(bb.makeRotationFromEuler(Kr)),p.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=m.reflectivity,p.ior.value=m.ior,p.refractionRatio.value=m.refractionRatio),m.lightMap){p.lightMap.value=m.lightMap;let D=r._useLegacyLights===!0?Math.PI:1;p.lightMapIntensity.value=m.lightMapIntensity*D,e(m.lightMap,p.lightMapTransform)}m.aoMap&&(p.aoMap.value=m.aoMap,p.aoMapIntensity.value=m.aoMapIntensity,e(m.aoMap,p.aoMapTransform))}function o(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,m.map&&(p.map.value=m.map,e(m.map,p.mapTransform))}function a(p,m){p.dashSize.value=m.dashSize,p.totalSize.value=m.dashSize+m.gapSize,p.scale.value=m.scale}function l(p,m,b,S){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.size.value=m.size*b,p.scale.value=S*.5,m.map&&(p.map.value=m.map,e(m.map,p.uvTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,e(m.alphaMap,p.alphaMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest)}function c(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.rotation.value=m.rotation,m.map&&(p.map.value=m.map,e(m.map,p.mapTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,e(m.alphaMap,p.alphaMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest)}function u(p,m){p.specular.value.copy(m.specular),p.shininess.value=Math.max(m.shininess,1e-4)}function f(p,m){m.gradientMap&&(p.gradientMap.value=m.gradientMap)}function h(p,m){p.metalness.value=m.metalness,m.metalnessMap&&(p.metalnessMap.value=m.metalnessMap,e(m.metalnessMap,p.metalnessMapTransform)),p.roughness.value=m.roughness,m.roughnessMap&&(p.roughnessMap.value=m.roughnessMap,e(m.roughnessMap,p.roughnessMapTransform)),m.envMap&&(p.envMapIntensity.value=m.envMapIntensity)}function d(p,m,b){p.ior.value=m.ior,m.sheen>0&&(p.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),p.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(p.sheenColorMap.value=m.sheenColorMap,e(m.sheenColorMap,p.sheenColorMapTransform)),m.sheenRoughnessMap&&(p.sheenRoughnessMap.value=m.sheenRoughnessMap,e(m.sheenRoughnessMap,p.sheenRoughnessMapTransform))),m.clearcoat>0&&(p.clearcoat.value=m.clearcoat,p.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(p.clearcoatMap.value=m.clearcoatMap,e(m.clearcoatMap,p.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,e(m.clearcoatRoughnessMap,p.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(p.clearcoatNormalMap.value=m.clearcoatNormalMap,e(m.clearcoatNormalMap,p.clearcoatNormalMapTransform),p.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Cn&&p.clearcoatNormalScale.value.negate())),m.dispersion>0&&(p.dispersion.value=m.dispersion),m.iridescence>0&&(p.iridescence.value=m.iridescence,p.iridescenceIOR.value=m.iridescenceIOR,p.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(p.iridescenceMap.value=m.iridescenceMap,e(m.iridescenceMap,p.iridescenceMapTransform)),m.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=m.iridescenceThicknessMap,e(m.iridescenceThicknessMap,p.iridescenceThicknessMapTransform))),m.transmission>0&&(p.transmission.value=m.transmission,p.transmissionSamplerMap.value=b.texture,p.transmissionSamplerSize.value.set(b.width,b.height),m.transmissionMap&&(p.transmissionMap.value=m.transmissionMap,e(m.transmissionMap,p.transmissionMapTransform)),p.thickness.value=m.thickness,m.thicknessMap&&(p.thicknessMap.value=m.thicknessMap,e(m.thicknessMap,p.thicknessMapTransform)),p.attenuationDistance.value=m.attenuationDistance,p.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(p.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(p.anisotropyMap.value=m.anisotropyMap,e(m.anisotropyMap,p.anisotropyMapTransform))),p.specularIntensity.value=m.specularIntensity,p.specularColor.value.copy(m.specularColor),m.specularColorMap&&(p.specularColorMap.value=m.specularColorMap,e(m.specularColorMap,p.specularColorMapTransform)),m.specularIntensityMap&&(p.specularIntensityMap.value=m.specularIntensityMap,e(m.specularIntensityMap,p.specularIntensityMapTransform))}function _(p,m){m.matcap&&(p.matcap.value=m.matcap)}function g(p,m){let b=t.get(m).light;p.referencePosition.value.setFromMatrixPosition(b.matrixWorld),p.nearDistance.value=b.shadow.camera.near,p.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function Eb(r,t,e,n){let i={},s={},o=[],a=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(b,S){let y=S.program;n.uniformBlockBinding(b,y)}function c(b,S){let y=i[b.id];y===void 0&&(_(b),y=u(b),i[b.id]=y,b.addEventListener("dispose",p));let D=S.program;n.updateUBOMapping(b,D);let A=t.render.frame;s[b.id]!==A&&(h(b),s[b.id]=A)}function u(b){let S=f();b.__bindingPointIndex=S;let y=r.createBuffer(),D=b.__size,A=b.usage;return r.bindBuffer(r.UNIFORM_BUFFER,y),r.bufferData(r.UNIFORM_BUFFER,D,A),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,S,y),y}function f(){for(let b=0;b<a;b++)if(o.indexOf(b)===-1)return o.push(b),b;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function h(b){let S=i[b.id],y=b.uniforms,D=b.__cache;r.bindBuffer(r.UNIFORM_BUFFER,S);for(let A=0,w=y.length;A<w;A++){let P=Array.isArray(y[A])?y[A]:[y[A]];for(let M=0,v=P.length;M<v;M++){let N=P[M];if(d(N,A,M,D)===!0){let F=N.__offset,R=Array.isArray(N.value)?N.value:[N.value],B=0;for(let Y=0;Y<R.length;Y++){let H=R[Y],J=g(H);typeof H=="number"||typeof H=="boolean"?(N.__data[0]=H,r.bufferSubData(r.UNIFORM_BUFFER,F+B,N.__data)):H.isMatrix3?(N.__data[0]=H.elements[0],N.__data[1]=H.elements[1],N.__data[2]=H.elements[2],N.__data[3]=0,N.__data[4]=H.elements[3],N.__data[5]=H.elements[4],N.__data[6]=H.elements[5],N.__data[7]=0,N.__data[8]=H.elements[6],N.__data[9]=H.elements[7],N.__data[10]=H.elements[8],N.__data[11]=0):(H.toArray(N.__data,B),B+=J.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,F,N.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function d(b,S,y,D){let A=b.value,w=S+"_"+y;if(D[w]===void 0)return typeof A=="number"||typeof A=="boolean"?D[w]=A:D[w]=A.clone(),!0;{let P=D[w];if(typeof A=="number"||typeof A=="boolean"){if(P!==A)return D[w]=A,!0}else if(P.equals(A)===!1)return P.copy(A),!0}return!1}function _(b){let S=b.uniforms,y=0,D=16;for(let w=0,P=S.length;w<P;w++){let M=Array.isArray(S[w])?S[w]:[S[w]];for(let v=0,N=M.length;v<N;v++){let F=M[v],R=Array.isArray(F.value)?F.value:[F.value];for(let B=0,Y=R.length;B<Y;B++){let H=R[B],J=g(H),O=y%D;O!==0&&D-O<J.boundary&&(y+=D-O),F.__data=new Float32Array(J.storage/Float32Array.BYTES_PER_ELEMENT),F.__offset=y,y+=J.storage}}}let A=y%D;return A>0&&(y+=D-A),b.__size=y,b.__cache={},this}function g(b){let S={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(S.boundary=4,S.storage=4):b.isVector2?(S.boundary=8,S.storage=8):b.isVector3||b.isColor?(S.boundary=16,S.storage=12):b.isVector4?(S.boundary=16,S.storage=16):b.isMatrix3?(S.boundary=48,S.storage=48):b.isMatrix4?(S.boundary=64,S.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),S}function p(b){let S=b.target;S.removeEventListener("dispose",p);let y=o.indexOf(S.__bindingPointIndex);o.splice(y,1),r.deleteBuffer(i[S.id]),delete i[S.id],delete s[S.id]}function m(){for(let b in i)r.deleteBuffer(i[b]);o=[],i={},s={}}return{bind:l,update:c,dispose:m}}var Ol=class{constructor(t={}){let{canvas:e=Lx(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:f=!1}=t;this.isWebGLRenderer=!0;let h;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");h=n.getContextAttributes().alpha}else h=o;let d=new Uint32Array(4),_=new Int32Array(4),g=null,p=null,m=[],b=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=qn,this._useLegacyLights=!1,this.toneMapping=mr,this.toneMappingExposure=1;let S=this,y=!1,D=0,A=0,w=null,P=-1,M=null,v=new Ye,N=new Ye,F=null,R=new ce(0),B=0,Y=e.width,H=e.height,J=1,O=null,L=null,C=new Ye(0,0,Y,H),ot=new Ye(0,0,Y,H),vt=!1,Wt=new Jo,q=!1,tt=!1,pt=new Le,st=new j,Ft={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Nt(){return w===null?J:1}let V=n;function Yt(E,z){return e.getContext(E,z)}try{let E={alpha:!0,depth:i,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Fh}`),e.addEventListener("webglcontextlost",U,!1),e.addEventListener("webglcontextrestored",$,!1),e.addEventListener("webglcontextcreationerror",et,!1),V===null){let z="webgl2";if(V=Yt(z,E),V===null)throw Yt(z)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let Et,Tt,St,zt,Ut,k,Qt,T,x,I,G,K,Q,ht,ct,nt,bt,rt,ft,Ot,it,yt,Bt,Vt;function he(){Et=new WS(V),Et.init(),yt=new vb(V,Et),Tt=new BS(V,Et,t,yt),St=new _b(V),zt=new YS(V),Ut=new sb,k=new xb(V,Et,St,Ut,Tt,yt,zt),Qt=new kS(S),T=new GS(S),x=new tv(V),Bt=new US(V,x),I=new XS(V,x,zt,Bt),G=new JS(V,I,x,zt),ft=new ZS(V,Tt,k),nt=new zS(Ut),K=new rb(S,Qt,T,Et,Tt,Bt,nt),Q=new wb(S,Ut),ht=new ab,ct=new db(Et),rt=new NS(S,Qt,T,St,G,h,l),bt=new gb(S,G,Tt),Vt=new Eb(V,zt,Tt,St),Ot=new OS(V,Et,zt),it=new qS(V,Et,zt),zt.programs=K.programs,S.capabilities=Tt,S.extensions=Et,S.properties=Ut,S.renderLists=ht,S.shadowMap=bt,S.state=St,S.info=zt}he();let kt=new vh(S,V);this.xr=kt,this.getContext=function(){return V},this.getContextAttributes=function(){return V.getContextAttributes()},this.forceContextLoss=function(){let E=Et.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){let E=Et.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return J},this.setPixelRatio=function(E){E!==void 0&&(J=E,this.setSize(Y,H,!1))},this.getSize=function(E){return E.set(Y,H)},this.setSize=function(E,z,W=!0){if(kt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Y=E,H=z,e.width=Math.floor(E*J),e.height=Math.floor(z*J),W===!0&&(e.style.width=E+"px",e.style.height=z+"px"),this.setViewport(0,0,E,z)},this.getDrawingBufferSize=function(E){return E.set(Y*J,H*J).floor()},this.setDrawingBufferSize=function(E,z,W){Y=E,H=z,J=W,e.width=Math.floor(E*W),e.height=Math.floor(z*W),this.setViewport(0,0,E,z)},this.getCurrentViewport=function(E){return E.copy(v)},this.getViewport=function(E){return E.copy(C)},this.setViewport=function(E,z,W,X){E.isVector4?C.set(E.x,E.y,E.z,E.w):C.set(E,z,W,X),St.viewport(v.copy(C).multiplyScalar(J).round())},this.getScissor=function(E){return E.copy(ot)},this.setScissor=function(E,z,W,X){E.isVector4?ot.set(E.x,E.y,E.z,E.w):ot.set(E,z,W,X),St.scissor(N.copy(ot).multiplyScalar(J).round())},this.getScissorTest=function(){return vt},this.setScissorTest=function(E){St.setScissorTest(vt=E)},this.setOpaqueSort=function(E){O=E},this.setTransparentSort=function(E){L=E},this.getClearColor=function(E){return E.copy(rt.getClearColor())},this.setClearColor=function(){rt.setClearColor.apply(rt,arguments)},this.getClearAlpha=function(){return rt.getClearAlpha()},this.setClearAlpha=function(){rt.setClearAlpha.apply(rt,arguments)},this.clear=function(E=!0,z=!0,W=!0){let X=0;if(E){let Z=!1;if(w!==null){let dt=w.texture.format;Z=dt===tg||dt===Qm||dt===jm}if(Z){let dt=w.texture.type,gt=dt===_r||dt===to||dt===Zm||dt===Ko||dt===$m||dt===Km,xt=rt.getClearColor(),Lt=rt.getClearAlpha(),Gt=xt.r,Rt=xt.g,At=xt.b;gt?(d[0]=Gt,d[1]=Rt,d[2]=At,d[3]=Lt,V.clearBufferuiv(V.COLOR,0,d)):(_[0]=Gt,_[1]=Rt,_[2]=At,_[3]=Lt,V.clearBufferiv(V.COLOR,0,_))}else X|=V.COLOR_BUFFER_BIT}z&&(X|=V.DEPTH_BUFFER_BIT),W&&(X|=V.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),V.clear(X)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",U,!1),e.removeEventListener("webglcontextrestored",$,!1),e.removeEventListener("webglcontextcreationerror",et,!1),ht.dispose(),ct.dispose(),Ut.dispose(),Qt.dispose(),T.dispose(),G.dispose(),Bt.dispose(),Vt.dispose(),K.dispose(),kt.dispose(),kt.removeEventListener("sessionstart",Zt),kt.removeEventListener("sessionend",Ct),Mt.stop()};function U(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),y=!0}function $(){console.log("THREE.WebGLRenderer: Context Restored."),y=!1;let E=zt.autoReset,z=bt.enabled,W=bt.autoUpdate,X=bt.needsUpdate,Z=bt.type;he(),zt.autoReset=E,bt.enabled=z,bt.autoUpdate=W,bt.needsUpdate=X,bt.type=Z}function et(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function ut(E){let z=E.target;z.removeEventListener("dispose",ut),at(z)}function at(E){Dt(E),Ut.remove(E)}function Dt(E){let z=Ut.get(E).programs;z!==void 0&&(z.forEach(function(W){K.releaseProgram(W)}),E.isShaderMaterial&&K.releaseShaderCache(E))}this.renderBufferDirect=function(E,z,W,X,Z,dt){z===null&&(z=Ft);let gt=Z.isMesh&&Z.matrixWorld.determinant()<0,xt=He(E,z,W,X,Z);St.setMaterial(X,gt);let Lt=W.index,Gt=1;if(X.wireframe===!0){if(Lt=I.getWireframeAttribute(W),Lt===void 0)return;Gt=2}let Rt=W.drawRange,At=W.attributes.position,fe=Rt.start*Gt,Fe=(Rt.start+Rt.count)*Gt;dt!==null&&(fe=Math.max(fe,dt.start*Gt),Fe=Math.min(Fe,(dt.start+dt.count)*Gt)),Lt!==null?(fe=Math.max(fe,0),Fe=Math.min(Fe,Lt.count)):At!=null&&(fe=Math.max(fe,0),Fe=Math.min(Fe,At.count));let je=Fe-fe;if(je<0||je===1/0)return;Bt.setup(Z,X,xt,W,Lt);let un,Jt=Ot;if(Lt!==null&&(un=x.get(Lt),Jt=it,Jt.setIndex(un)),Z.isMesh)X.wireframe===!0?(St.setLineWidth(X.wireframeLinewidth*Nt()),Jt.setMode(V.LINES)):Jt.setMode(V.TRIANGLES);else if(Z.isLine){let Ht=X.linewidth;Ht===void 0&&(Ht=1),St.setLineWidth(Ht*Nt()),Z.isLineSegments?Jt.setMode(V.LINES):Z.isLineLoop?Jt.setMode(V.LINE_LOOP):Jt.setMode(V.LINE_STRIP)}else Z.isPoints?Jt.setMode(V.POINTS):Z.isSprite&&Jt.setMode(V.TRIANGLES);if(Z.isBatchedMesh)Z._multiDrawInstances!==null?Jt.renderMultiDrawInstances(Z._multiDrawStarts,Z._multiDrawCounts,Z._multiDrawCount,Z._multiDrawInstances):Jt.renderMultiDraw(Z._multiDrawStarts,Z._multiDrawCounts,Z._multiDrawCount);else if(Z.isInstancedMesh)Jt.renderInstances(fe,je,Z.count);else if(W.isInstancedBufferGeometry){let Ht=W._maxInstanceCount!==void 0?W._maxInstanceCount:1/0,ci=Math.min(W.instanceCount,Ht);Jt.renderInstances(fe,je,ci)}else Jt.render(fe,je)};function te(E,z,W){E.transparent===!0&&E.side===Vi&&E.forceSinglePass===!1?(E.side=Cn,E.needsUpdate=!0,Ee(E,z,W),E.side=gr,E.needsUpdate=!0,Ee(E,z,W),E.side=Vi):Ee(E,z,W)}this.compile=function(E,z,W=null){W===null&&(W=E),p=ct.get(W),p.init(z),b.push(p),W.traverseVisible(function(Z){Z.isLight&&Z.layers.test(z.layers)&&(p.pushLight(Z),Z.castShadow&&p.pushShadow(Z))}),E!==W&&E.traverseVisible(function(Z){Z.isLight&&Z.layers.test(z.layers)&&(p.pushLight(Z),Z.castShadow&&p.pushShadow(Z))}),p.setupLights(S._useLegacyLights);let X=new Set;return E.traverse(function(Z){let dt=Z.material;if(dt)if(Array.isArray(dt))for(let gt=0;gt<dt.length;gt++){let xt=dt[gt];te(xt,W,Z),X.add(xt)}else te(dt,W,Z),X.add(dt)}),b.pop(),p=null,X},this.compileAsync=function(E,z,W=null){let X=this.compile(E,z,W);return new Promise(Z=>{function dt(){if(X.forEach(function(gt){Ut.get(gt).currentProgram.isReady()&&X.delete(gt)}),X.size===0){Z(E);return}setTimeout(dt,10)}Et.get("KHR_parallel_shader_compile")!==null?dt():setTimeout(dt,10)})};let ae=null;function re(E){ae&&ae(E)}function Zt(){Mt.stop()}function Ct(){Mt.start()}let Mt=new sg;Mt.setAnimationLoop(re),typeof self<"u"&&Mt.setContext(self),this.setAnimationLoop=function(E){ae=E,kt.setAnimationLoop(E),E===null?Mt.stop():Mt.start()},kt.addEventListener("sessionstart",Zt),kt.addEventListener("sessionend",Ct),this.render=function(E,z){if(z!==void 0&&z.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(y===!0)return;E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),z.parent===null&&z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),kt.enabled===!0&&kt.isPresenting===!0&&(kt.cameraAutoUpdate===!0&&kt.updateCamera(z),z=kt.getCamera()),E.isScene===!0&&E.onBeforeRender(S,E,z,w),p=ct.get(E,b.length),p.init(z),b.push(p),pt.multiplyMatrices(z.projectionMatrix,z.matrixWorldInverse),Wt.setFromProjectionMatrix(pt),tt=this.localClippingEnabled,q=nt.init(this.clippingPlanes,tt),g=ht.get(E,m.length),g.init(),m.push(g),le(E,z,0,S.sortObjects),g.finish(),S.sortObjects===!0&&g.sort(O,L);let W=kt.enabled===!1||kt.isPresenting===!1||kt.hasDepthSensing()===!1;W&&rt.addToRenderList(g,E),this.info.render.frame++,q===!0&&nt.beginShadows();let X=p.state.shadowsArray;bt.render(X,E,z),q===!0&&nt.endShadows(),this.info.autoReset===!0&&this.info.reset();let Z=g.opaque,dt=g.transmissive;if(p.setupLights(S._useLegacyLights),z.isArrayCamera){let gt=z.cameras;if(dt.length>0)for(let xt=0,Lt=gt.length;xt<Lt;xt++){let Gt=gt[xt];qt(Z,dt,E,Gt)}W&&rt.render(E);for(let xt=0,Lt=gt.length;xt<Lt;xt++){let Gt=gt[xt];mt(g,E,Gt,Gt.viewport)}}else dt.length>0&&qt(Z,dt,E,z),W&&rt.render(E),mt(g,E,z);w!==null&&(k.updateMultisampleRenderTarget(w),k.updateRenderTargetMipmap(w)),E.isScene===!0&&E.onAfterRender(S,E,z),Bt.resetDefaultState(),P=-1,M=null,b.pop(),b.length>0?(p=b[b.length-1],q===!0&&nt.setGlobalState(S.clippingPlanes,p.state.camera)):p=null,m.pop(),m.length>0?g=m[m.length-1]:g=null};function le(E,z,W,X){if(E.visible===!1)return;if(E.layers.test(z.layers)){if(E.isGroup)W=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(z);else if(E.isLight)p.pushLight(E),E.castShadow&&p.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||Wt.intersectsSprite(E)){X&&st.setFromMatrixPosition(E.matrixWorld).applyMatrix4(pt);let gt=G.update(E),xt=E.material;xt.visible&&g.push(E,gt,xt,W,st.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||Wt.intersectsObject(E))){let gt=G.update(E),xt=E.material;if(X&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),st.copy(E.boundingSphere.center)):(gt.boundingSphere===null&>.computeBoundingSphere(),st.copy(gt.boundingSphere.center)),st.applyMatrix4(E.matrixWorld).applyMatrix4(pt)),Array.isArray(xt)){let Lt=gt.groups;for(let Gt=0,Rt=Lt.length;Gt<Rt;Gt++){let At=Lt[Gt],fe=xt[At.materialIndex];fe&&fe.visible&&g.push(E,gt,fe,W,st.z,At)}}else xt.visible&&g.push(E,gt,xt,W,st.z,null)}}let dt=E.children;for(let gt=0,xt=dt.length;gt<xt;gt++)le(dt[gt],z,W,X)}function mt(E,z,W,X){let Z=E.opaque,dt=E.transmissive,gt=E.transparent;p.setupLightsView(W),q===!0&&nt.setGlobalState(S.clippingPlanes,W),X&&St.viewport(v.copy(X)),Z.length>0&&It(Z,z,W),dt.length>0&&It(dt,z,W),gt.length>0&&It(gt,z,W),St.buffers.depth.setTest(!0),St.buffers.depth.setMask(!0),St.buffers.color.setMask(!0),St.setPolygonOffset(!1)}function qt(E,z,W,X){if((W.isScene===!0?W.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[X.id]===void 0&&(p.state.transmissionRenderTarget[X.id]=new Gi(1,1,{generateMipmaps:!0,type:Et.has("EXT_color_buffer_half_float")||Et.has("EXT_color_buffer_float")?Wl:_r,minFilter:ns,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1}));let dt=p.state.transmissionRenderTarget[X.id],gt=X.viewport||v;dt.setSize(gt.z,gt.w);let xt=S.getRenderTarget();S.setRenderTarget(dt),S.getClearColor(R),B=S.getClearAlpha(),B<1&&S.setClearColor(16777215,.5),S.clear();let Lt=S.toneMapping;S.toneMapping=mr;let Gt=X.viewport;if(X.viewport!==void 0&&(X.viewport=void 0),p.setupLightsView(X),q===!0&&nt.setGlobalState(S.clippingPlanes,X),It(E,W,X),k.updateMultisampleRenderTarget(dt),k.updateRenderTargetMipmap(dt),Et.has("WEBGL_multisampled_render_to_texture")===!1){let Rt=!1;for(let At=0,fe=z.length;At<fe;At++){let Fe=z[At],je=Fe.object,un=Fe.geometry,Jt=Fe.material,Ht=Fe.group;if(Jt.side===Vi&&je.layers.test(X.layers)){let ci=Jt.side;Jt.side=Cn,Jt.needsUpdate=!0,Xt(je,W,X,un,Jt,Ht),Jt.side=ci,Jt.needsUpdate=!0,Rt=!0}}Rt===!0&&(k.updateMultisampleRenderTarget(dt),k.updateRenderTargetMipmap(dt))}S.setRenderTarget(xt),S.setClearColor(R,B),Gt!==void 0&&(X.viewport=Gt),S.toneMapping=Lt}function It(E,z,W){let X=z.isScene===!0?z.overrideMaterial:null;for(let Z=0,dt=E.length;Z<dt;Z++){let gt=E[Z],xt=gt.object,Lt=gt.geometry,Gt=X===null?gt.material:X,Rt=gt.group;xt.layers.test(W.layers)&&Xt(xt,z,W,Lt,Gt,Rt)}}function Xt(E,z,W,X,Z,dt){E.onBeforeRender(S,z,W,X,Z,dt),E.modelViewMatrix.multiplyMatrices(W.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),Z.onBeforeRender(S,z,W,X,E,dt),Z.transparent===!0&&Z.side===Vi&&Z.forceSinglePass===!1?(Z.side=Cn,Z.needsUpdate=!0,S.renderBufferDirect(W,z,X,Z,E,dt),Z.side=gr,Z.needsUpdate=!0,S.renderBufferDirect(W,z,X,Z,E,dt),Z.side=Vi):S.renderBufferDirect(W,z,X,Z,E,dt),E.onAfterRender(S,z,W,X,Z,dt)}function Ee(E,z,W){z.isScene!==!0&&(z=Ft);let X=Ut.get(E),Z=p.state.lights,dt=p.state.shadowsArray,gt=Z.state.version,xt=K.getParameters(E,Z.state,dt,z,W),Lt=K.getProgramCacheKey(xt),Gt=X.programs;X.environment=E.isMeshStandardMaterial?z.environment:null,X.fog=z.fog,X.envMap=(E.isMeshStandardMaterial?T:Qt).get(E.envMap||X.environment),X.envMapRotation=X.environment!==null&&E.envMap===null?z.environmentRotation:E.envMapRotation,Gt===void 0&&(E.addEventListener("dispose",ut),Gt=new Map,X.programs=Gt);let Rt=Gt.get(Lt);if(Rt!==void 0){if(X.currentProgram===Rt&&X.lightsStateVersion===gt)return Se(E,xt),Rt}else xt.uniforms=K.getUniforms(E),E.onBuild(W,xt,S),E.onBeforeCompile(xt,S),Rt=K.acquireProgram(xt,Lt),Gt.set(Lt,Rt),X.uniforms=xt.uniforms;let At=X.uniforms;return(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(At.clippingPlanes=nt.uniform),Se(E,xt),X.needsLights=_e(E),X.lightsStateVersion=gt,X.needsLights&&(At.ambientLightColor.value=Z.state.ambient,At.lightProbe.value=Z.state.probe,At.directionalLights.value=Z.state.directional,At.directionalLightShadows.value=Z.state.directionalShadow,At.spotLights.value=Z.state.spot,At.spotLightShadows.value=Z.state.spotShadow,At.rectAreaLights.value=Z.state.rectArea,At.ltc_1.value=Z.state.rectAreaLTC1,At.ltc_2.value=Z.state.rectAreaLTC2,At.pointLights.value=Z.state.point,At.pointLightShadows.value=Z.state.pointShadow,At.hemisphereLights.value=Z.state.hemi,At.directionalShadowMap.value=Z.state.directionalShadowMap,At.directionalShadowMatrix.value=Z.state.directionalShadowMatrix,At.spotShadowMap.value=Z.state.spotShadowMap,At.spotLightMatrix.value=Z.state.spotLightMatrix,At.spotLightMap.value=Z.state.spotLightMap,At.pointShadowMap.value=Z.state.pointShadowMap,At.pointShadowMatrix.value=Z.state.pointShadowMatrix),X.currentProgram=Rt,X.uniformsList=null,Rt}function ee(E){if(E.uniformsList===null){let z=E.currentProgram.getUniforms();E.uniformsList=Ks.seqWithValue(z.seq,E.uniforms)}return E.uniformsList}function Se(E,z){let W=Ut.get(E);W.outputColorSpace=z.outputColorSpace,W.batching=z.batching,W.instancing=z.instancing,W.instancingColor=z.instancingColor,W.instancingMorph=z.instancingMorph,W.skinning=z.skinning,W.morphTargets=z.morphTargets,W.morphNormals=z.morphNormals,W.morphColors=z.morphColors,W.morphTargetsCount=z.morphTargetsCount,W.numClippingPlanes=z.numClippingPlanes,W.numIntersection=z.numClipIntersection,W.vertexAlphas=z.vertexAlphas,W.vertexTangents=z.vertexTangents,W.toneMapping=z.toneMapping}function He(E,z,W,X,Z){z.isScene!==!0&&(z=Ft),k.resetTextureUnits();let dt=z.fog,gt=X.isMeshStandardMaterial?z.environment:null,xt=w===null?S.outputColorSpace:w.isXRRenderTarget===!0?w.texture.colorSpace:yr,Lt=(X.isMeshStandardMaterial?T:Qt).get(X.envMap||gt),Gt=X.vertexColors===!0&&!!W.attributes.color&&W.attributes.color.itemSize===4,Rt=!!W.attributes.tangent&&(!!X.normalMap||X.anisotropy>0),At=!!W.morphAttributes.position,fe=!!W.morphAttributes.normal,Fe=!!W.morphAttributes.color,je=mr;X.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(je=S.toneMapping);let un=W.morphAttributes.position||W.morphAttributes.normal||W.morphAttributes.color,Jt=un!==void 0?un.length:0,Ht=Ut.get(X),ci=p.state.lights;if(q===!0&&(tt===!0||E!==M)){let On=E===M&&X.id===P;nt.setState(X,E,On)}let pe=!1;X.version===Ht.__version?(Ht.needsLights&&Ht.lightsStateVersion!==ci.state.version||Ht.outputColorSpace!==xt||Z.isBatchedMesh&&Ht.batching===!1||!Z.isBatchedMesh&&Ht.batching===!0||Z.isInstancedMesh&&Ht.instancing===!1||!Z.isInstancedMesh&&Ht.instancing===!0||Z.isSkinnedMesh&&Ht.skinning===!1||!Z.isSkinnedMesh&&Ht.skinning===!0||Z.isInstancedMesh&&Ht.instancingColor===!0&&Z.instanceColor===null||Z.isInstancedMesh&&Ht.instancingColor===!1&&Z.instanceColor!==null||Z.isInstancedMesh&&Ht.instancingMorph===!0&&Z.morphTexture===null||Z.isInstancedMesh&&Ht.instancingMorph===!1&&Z.morphTexture!==null||Ht.envMap!==Lt||X.fog===!0&&Ht.fog!==dt||Ht.numClippingPlanes!==void 0&&(Ht.numClippingPlanes!==nt.numPlanes||Ht.numIntersection!==nt.numIntersection)||Ht.vertexAlphas!==Gt||Ht.vertexTangents!==Rt||Ht.morphTargets!==At||Ht.morphNormals!==fe||Ht.morphColors!==Fe||Ht.toneMapping!==je||Ht.morphTargetsCount!==Jt)&&(pe=!0):(pe=!0,Ht.__version=X.version);let Sr=Ht.currentProgram;pe===!0&&(Sr=Ee(X,z,Z));let kh=!1,so=!1,Yl=!1,Qe=Sr.getUniforms(),Xi=Ht.uniforms;if(St.useProgram(Sr.program)&&(kh=!0,so=!0,Yl=!0),X.id!==P&&(P=X.id,so=!0),kh||M!==E){Qe.setValue(V,"projectionMatrix",E.projectionMatrix),Qe.setValue(V,"viewMatrix",E.matrixWorldInverse);let On=Qe.map.cameraPosition;On!==void 0&&On.setValue(V,st.setFromMatrixPosition(E.matrixWorld)),Tt.logarithmicDepthBuffer&&Qe.setValue(V,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(X.isMeshPhongMaterial||X.isMeshToonMaterial||X.isMeshLambertMaterial||X.isMeshBasicMaterial||X.isMeshStandardMaterial||X.isShaderMaterial)&&Qe.setValue(V,"isOrthographic",E.isOrthographicCamera===!0),M!==E&&(M=E,so=!0,Yl=!0)}if(Z.isSkinnedMesh){Qe.setOptional(V,Z,"bindMatrix"),Qe.setOptional(V,Z,"bindMatrixInverse");let On=Z.skeleton;On&&(On.boneTexture===null&&On.computeBoneTexture(),Qe.setValue(V,"boneTexture",On.boneTexture,k))}Z.isBatchedMesh&&(Qe.setOptional(V,Z,"batchingTexture"),Qe.setValue(V,"batchingTexture",Z._matricesTexture,k));let Zl=W.morphAttributes;if((Zl.position!==void 0||Zl.normal!==void 0||Zl.color!==void 0)&&ft.update(Z,W,Sr),(so||Ht.receiveShadow!==Z.receiveShadow)&&(Ht.receiveShadow=Z.receiveShadow,Qe.setValue(V,"receiveShadow",Z.receiveShadow)),X.isMeshGouraudMaterial&&X.envMap!==null&&(Xi.envMap.value=Lt,Xi.flipEnvMap.value=Lt.isCubeTexture&&Lt.isRenderTargetTexture===!1?-1:1),X.isMeshStandardMaterial&&X.envMap===null&&z.environment!==null&&(Xi.envMapIntensity.value=z.environmentIntensity),so&&(Qe.setValue(V,"toneMappingExposure",S.toneMappingExposure),Ht.needsLights&&Me(Xi,Yl),dt&&X.fog===!0&&Q.refreshFogUniforms(Xi,dt),Q.refreshMaterialUniforms(Xi,X,J,H,p.state.transmissionRenderTarget[E.id]),Ks.upload(V,ee(Ht),Xi,k)),X.isShaderMaterial&&X.uniformsNeedUpdate===!0&&(Ks.upload(V,ee(Ht),Xi,k),X.uniformsNeedUpdate=!1),X.isSpriteMaterial&&Qe.setValue(V,"center",Z.center),Qe.setValue(V,"modelViewMatrix",Z.modelViewMatrix),Qe.setValue(V,"normalMatrix",Z.normalMatrix),Qe.setValue(V,"modelMatrix",Z.matrixWorld),X.isShaderMaterial||X.isRawShaderMaterial){let On=X.uniformsGroups;for(let Jl=0,fg=On.length;Jl<fg;Jl++){let Vh=On[Jl];Vt.update(Vh,Sr),Vt.bind(Vh,Sr)}}return Sr}function Me(E,z){E.ambientLightColor.needsUpdate=z,E.lightProbe.needsUpdate=z,E.directionalLights.needsUpdate=z,E.directionalLightShadows.needsUpdate=z,E.pointLights.needsUpdate=z,E.pointLightShadows.needsUpdate=z,E.spotLights.needsUpdate=z,E.spotLightShadows.needsUpdate=z,E.rectAreaLights.needsUpdate=z,E.hemisphereLights.needsUpdate=z}function _e(E){return E.isMeshLambertMaterial||E.isMeshToonMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isShadowMaterial||E.isShaderMaterial&&E.lights===!0}this.getActiveCubeFace=function(){return D},this.getActiveMipmapLevel=function(){return A},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(E,z,W){Ut.get(E.texture).__webglTexture=z,Ut.get(E.depthTexture).__webglTexture=W;let X=Ut.get(E);X.__hasExternalTextures=!0,X.__autoAllocateDepthBuffer=W===void 0,X.__autoAllocateDepthBuffer||Et.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),X.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(E,z){let W=Ut.get(E);W.__webglFramebuffer=z,W.__useDefaultFramebuffer=z===void 0},this.setRenderTarget=function(E,z=0,W=0){w=E,D=z,A=W;let X=!0,Z=null,dt=!1,gt=!1;if(E){let Lt=Ut.get(E);Lt.__useDefaultFramebuffer!==void 0?(St.bindFramebuffer(V.FRAMEBUFFER,null),X=!1):Lt.__webglFramebuffer===void 0?k.setupRenderTarget(E):Lt.__hasExternalTextures&&k.rebindTextures(E,Ut.get(E.texture).__webglTexture,Ut.get(E.depthTexture).__webglTexture);let Gt=E.texture;(Gt.isData3DTexture||Gt.isDataArrayTexture||Gt.isCompressedArrayTexture)&&(gt=!0);let Rt=Ut.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(Array.isArray(Rt[z])?Z=Rt[z][W]:Z=Rt[z],dt=!0):E.samples>0&&k.useMultisampledRTT(E)===!1?Z=Ut.get(E).__webglMultisampledFramebuffer:Array.isArray(Rt)?Z=Rt[W]:Z=Rt,v.copy(E.viewport),N.copy(E.scissor),F=E.scissorTest}else v.copy(C).multiplyScalar(J).floor(),N.copy(ot).multiplyScalar(J).floor(),F=vt;if(St.bindFramebuffer(V.FRAMEBUFFER,Z)&&X&&St.drawBuffers(E,Z),St.viewport(v),St.scissor(N),St.setScissorTest(F),dt){let Lt=Ut.get(E.texture);V.framebufferTexture2D(V.FRAMEBUFFER,V.COLOR_ATTACHMENT0,V.TEXTURE_CUBE_MAP_POSITIVE_X+z,Lt.__webglTexture,W)}else if(gt){let Lt=Ut.get(E.texture),Gt=z||0;V.framebufferTextureLayer(V.FRAMEBUFFER,V.COLOR_ATTACHMENT0,Lt.__webglTexture,W||0,Gt)}P=-1},this.readRenderTargetPixels=function(E,z,W,X,Z,dt,gt){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let xt=Ut.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&>!==void 0&&(xt=xt[gt]),xt){St.bindFramebuffer(V.FRAMEBUFFER,xt);try{let Lt=E.texture,Gt=Lt.format,Rt=Lt.type;if(!Tt.textureFormatReadable(Gt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Tt.textureTypeReadable(Rt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}z>=0&&z<=E.width-X&&W>=0&&W<=E.height-Z&&V.readPixels(z,W,X,Z,yt.convert(Gt),yt.convert(Rt),dt)}finally{let Lt=w!==null?Ut.get(w).__webglFramebuffer:null;St.bindFramebuffer(V.FRAMEBUFFER,Lt)}}},this.copyFramebufferToTexture=function(E,z,W=0){let X=Math.pow(2,-W),Z=Math.floor(z.image.width*X),dt=Math.floor(z.image.height*X);k.setTexture2D(z,0),V.copyTexSubImage2D(V.TEXTURE_2D,W,0,0,E.x,E.y,Z,dt),St.unbindTexture()},this.copyTextureToTexture=function(E,z,W,X=0){let Z=z.image.width,dt=z.image.height,gt=yt.convert(W.format),xt=yt.convert(W.type);k.setTexture2D(W,0),V.pixelStorei(V.UNPACK_FLIP_Y_WEBGL,W.flipY),V.pixelStorei(V.UNPACK_PREMULTIPLY_ALPHA_WEBGL,W.premultiplyAlpha),V.pixelStorei(V.UNPACK_ALIGNMENT,W.unpackAlignment),z.isDataTexture?V.texSubImage2D(V.TEXTURE_2D,X,E.x,E.y,Z,dt,gt,xt,z.image.data):z.isCompressedTexture?V.compressedTexSubImage2D(V.TEXTURE_2D,X,E.x,E.y,z.mipmaps[0].width,z.mipmaps[0].height,gt,z.mipmaps[0].data):V.texSubImage2D(V.TEXTURE_2D,X,E.x,E.y,gt,xt,z.image),X===0&&W.generateMipmaps&&V.generateMipmap(V.TEXTURE_2D),St.unbindTexture()},this.copyTextureToTexture3D=function(E,z,W,X,Z=0){let dt=E.max.x-E.min.x,gt=E.max.y-E.min.y,xt=E.max.z-E.min.z,Lt=yt.convert(X.format),Gt=yt.convert(X.type),Rt;if(X.isData3DTexture)k.setTexture3D(X,0),Rt=V.TEXTURE_3D;else if(X.isDataArrayTexture||X.isCompressedArrayTexture)k.setTexture2DArray(X,0),Rt=V.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(V.UNPACK_FLIP_Y_WEBGL,X.flipY),V.pixelStorei(V.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),V.pixelStorei(V.UNPACK_ALIGNMENT,X.unpackAlignment);let At=V.getParameter(V.UNPACK_ROW_LENGTH),fe=V.getParameter(V.UNPACK_IMAGE_HEIGHT),Fe=V.getParameter(V.UNPACK_SKIP_PIXELS),je=V.getParameter(V.UNPACK_SKIP_ROWS),un=V.getParameter(V.UNPACK_SKIP_IMAGES),Jt=W.isCompressedTexture?W.mipmaps[Z]:W.image;V.pixelStorei(V.UNPACK_ROW_LENGTH,Jt.width),V.pixelStorei(V.UNPACK_IMAGE_HEIGHT,Jt.height),V.pixelStorei(V.UNPACK_SKIP_PIXELS,E.min.x),V.pixelStorei(V.UNPACK_SKIP_ROWS,E.min.y),V.pixelStorei(V.UNPACK_SKIP_IMAGES,E.min.z),W.isDataTexture||W.isData3DTexture?V.texSubImage3D(Rt,Z,z.x,z.y,z.z,dt,gt,xt,Lt,Gt,Jt.data):X.isCompressedArrayTexture?V.compressedTexSubImage3D(Rt,Z,z.x,z.y,z.z,dt,gt,xt,Lt,Jt.data):V.texSubImage3D(Rt,Z,z.x,z.y,z.z,dt,gt,xt,Lt,Gt,Jt),V.pixelStorei(V.UNPACK_ROW_LENGTH,At),V.pixelStorei(V.UNPACK_IMAGE_HEIGHT,fe),V.pixelStorei(V.UNPACK_SKIP_PIXELS,Fe),V.pixelStorei(V.UNPACK_SKIP_ROWS,je),V.pixelStorei(V.UNPACK_SKIP_IMAGES,un),Z===0&&X.generateMipmaps&&V.generateMipmap(Rt),St.unbindTexture()},this.initTexture=function(E){E.isCubeTexture?k.setTextureCube(E,0):E.isData3DTexture?k.setTexture3D(E,0):E.isDataArrayTexture||E.isCompressedArrayTexture?k.setTexture2DArray(E,0):k.setTexture2D(E,0),St.unbindTexture()},this.resetState=function(){D=0,A=0,w=null,St.reset(),Bt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Hi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Uh?"display-p3":"srgb",e.unpackColorSpace=me.workingColorSpace===Xl?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}};var Bl=class r{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new ce(t),this.near=e,this.far=n}clone(){return new r(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}},zl=class extends cn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Wi,this.environmentIntensity=1,this.environmentRotation=new Wi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}};var yh=class extends rs{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new ce(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},Vm=new Le,Sh=new Tl,dl=new eo,pl=new j,kl=class extends cn{constructor(t=new Mi,e=new yh){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){let n=this.geometry,i=this.matrixWorld,s=t.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),dl.copy(n.boundingSphere),dl.applyMatrix4(i),dl.radius+=s,t.ray.intersectsSphere(dl)===!1)return;Vm.copy(i).invert(),Sh.copy(t.ray).applyMatrix4(Vm);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=n.index,f=n.attributes.position;if(c!==null){let h=Math.max(0,o.start),d=Math.min(c.count,o.start+o.count);for(let _=h,g=d;_<g;_++){let p=c.getX(_);pl.fromBufferAttribute(f,p),Hm(pl,p,l,i,t,e,this)}}else{let h=Math.max(0,o.start),d=Math.min(f.count,o.start+o.count);for(let _=h,g=d;_<g;_++)pl.fromBufferAttribute(f,_),Hm(pl,_,l,i,t,e,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){let a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}};function Hm(r,t,e,n,i,s,o){let a=Sh.distanceSqToPoint(r);if(a<e){let l=new j;Sh.closestPointToPoint(r,l),l.applyMatrix4(n);let c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:t,face:null,object:o})}}function ml(r,t,e){return!r||!e&&r.constructor===t?r:typeof t.BYTES_PER_ELEMENT=="number"?new t(r):Array.prototype.slice.call(r)}function Tb(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var io=class{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,n=this._cachedIndex,i=e[n],s=e[n-1];n:{t:{let o;e:{i:if(!(t<i)){for(let a=n+2;;){if(i===void 0){if(t<s)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(s=i,i=e[++n],t<i)break t}o=e.length;break e}if(!(t>=s)){let a=e[1];t<a&&(n=2,s=a);for(let l=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=s,s=e[--n-1],t>=s)break t}o=n,n=0;break e}break n}for(;n<o;){let a=n+o>>>1;t<e[a]?o=a:n=a+1}if(i=e[n],s=e[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=t*i;for(let o=0;o!==i;++o)e[o]=n[s+o];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},Mh=class extends io{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Jp,endingEnd:Jp}}intervalChanged_(t,e,n){let i=this.parameterPositions,s=t-2,o=t+1,a=i[s],l=i[o];if(a===void 0)switch(this.getSettings_().endingStart){case $p:s=t,a=2*e-n;break;case Kp:s=i.length-2,a=e+i[s]-i[s+1];break;default:s=t,a=n}if(l===void 0)switch(this.getSettings_().endingEnd){case $p:o=t,l=2*n-e;break;case Kp:o=1,l=n+i[1]-i[0];break;default:o=t-1,l=e}let c=(n-e)*.5,u=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(l-n),this._offsetPrev=s*u,this._offsetNext=o*u}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,c=l-a,u=this._offsetPrev,f=this._offsetNext,h=this._weightPrev,d=this._weightNext,_=(n-e)/(i-e),g=_*_,p=g*_,m=-h*p+2*h*g-h*_,b=(1+h)*p+(-1.5-2*h)*g+(-.5+h)*_+1,S=(-1-d)*p+(1.5+d)*g+.5*_,y=d*p-d*g;for(let D=0;D!==a;++D)s[D]=m*o[u+D]+b*o[c+D]+S*o[l+D]+y*o[f+D];return s}},bh=class extends io{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,c=l-a,u=(n-e)/(i-e),f=1-u;for(let h=0;h!==a;++h)s[h]=o[c+h]*f+o[l+h]*u;return s}},wh=class extends io{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}},li=class{constructor(t,e,n,i){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ml(e,this.TimeBufferType),this.values=ml(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:ml(t.times,Array),values:ml(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(n.interpolation=i)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new wh(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new bh(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Mh(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case _l:e=this.InterpolantFactoryMethodDiscrete;break;case xl:e=this.InterpolantFactoryMethodLinear;break;case bu:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return _l;case this.InterpolantFactoryMethodLinear:return xl;case this.InterpolantFactoryMethodSmooth:return bu}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){let n=this.times,i=n.length,s=0,o=i-1;for(;s!==i&&n[s]<t;)++s;for(;o!==-1&&n[o]>e;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),t=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),t=!1;break}o=l}if(i!==void 0&&Tb(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===bu,s=t.length-1,o=1;for(let a=1;a<s;++a){let l=!1,c=t[a],u=t[a+1];if(c!==u&&(a!==1||c!==t[0]))if(i)l=!0;else{let f=a*n,h=f-n,d=f+n;for(let _=0;_!==n;++_){let g=e[f+_];if(g!==e[h+_]||g!==e[d+_]){l=!0;break}}}if(l){if(a!==o){t[o]=t[a];let f=a*n,h=o*n;for(let d=0;d!==n;++d)e[h+d]=e[f+d]}++o}}if(s>0){t[o]=t[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)e[l+c]=e[a+c];++o}return o!==t.length?(this.times=t.slice(0,o),this.values=e.slice(0,o*n)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}};li.prototype.TimeBufferType=Float32Array;li.prototype.ValueBufferType=Float32Array;li.prototype.DefaultInterpolation=xl;var ss=class extends li{};ss.prototype.ValueTypeName="bool";ss.prototype.ValueBufferType=Array;ss.prototype.DefaultInterpolation=_l;ss.prototype.InterpolantFactoryMethodLinear=void 0;ss.prototype.InterpolantFactoryMethodSmooth=void 0;var Eh=class extends li{};Eh.prototype.ValueTypeName="color";var Th=class extends li{};Th.prototype.ValueTypeName="number";var Ah=class extends io{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-e)/(i-e),c=t*a;for(let u=c+a;c!==u;c+=4)vr.slerpFlat(s,0,o,c-a,o,c,l);return s}},$o=class extends li{InterpolantFactoryMethodLinear(t){return new Ah(this.times,this.values,this.getValueSize(),t)}};$o.prototype.ValueTypeName="quaternion";$o.prototype.DefaultInterpolation=xl;$o.prototype.InterpolantFactoryMethodSmooth=void 0;var os=class extends li{};os.prototype.ValueTypeName="string";os.prototype.ValueBufferType=Array;os.prototype.DefaultInterpolation=_l;os.prototype.InterpolantFactoryMethodLinear=void 0;os.prototype.InterpolantFactoryMethodSmooth=void 0;var Dh=class extends li{};Dh.prototype.ValueTypeName="vector";var Ch=class{constructor(t,e,n){let i=this,s=!1,o=0,a=0,l,c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(u){a++,s===!1&&i.onStart!==void 0&&i.onStart(u,o,a),s=!0},this.itemEnd=function(u){o++,i.onProgress!==void 0&&i.onProgress(u,o,a),o===a&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(u){i.onError!==void 0&&i.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,f){return c.push(u,f),this},this.removeHandler=function(u){let f=c.indexOf(u);return f!==-1&&c.splice(f,2),this},this.getHandler=function(u){for(let f=0,h=c.length;f<h;f+=2){let d=c[f],_=c[f+1];if(d.global&&(d.lastIndex=0),d.test(u))return _}return null}}},Ab=new Ch,Rh=class{constructor(t){this.manager=t!==void 0?t:Ab,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let n=this;return new Promise(function(i,s){n.load(t,i,e,s)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};Rh.DEFAULT_MATERIAL_NAME="__DEFAULT";var Vl=class extends cn{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new ce(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),e}},Hl=class extends Vl{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(cn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ce(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}},$u=new Le,Gm=new j,Wm=new j,Ph=class{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new ue(512,512),this.map=null,this.mapPass=null,this.matrix=new Le,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Jo,this._frameExtents=new ue(1,1),this._viewportCount=1,this._viewports=[new Ye(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,n=this.matrix;Gm.setFromMatrixPosition(t.matrixWorld),e.position.copy(Gm),Wm.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Wm),e.updateMatrixWorld(),$u.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix($u),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply($u)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let t={};return this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}};var Ih=class extends Ph{constructor(){super(new Fl(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},as=class extends Vl{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(cn.DEFAULT_UP),this.updateMatrix(),this.target=new cn,this.shadow=new Ih}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}};var Bh="\\[\\]\\.:\\/",Db=new RegExp("["+Bh+"]","g"),zh="[^"+Bh+"]",Cb="[^"+Bh.replace("\\.","")+"]",Rb=/((?:WC+[\/:])*)/.source.replace("WC",zh),Pb=/(WCOD+)?/.source.replace("WCOD",Cb),Ib=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",zh),Lb=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",zh),Fb=new RegExp("^"+Rb+Pb+Ib+Lb+"$"),Nb=["material","materials","bones","map"],Lh=class{constructor(t,e,n){let i=n||we.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(t,e)}setValue(t,e){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}},we=class r{constructor(t,e,n){this.path=e,this.parsedPath=n||r.parseTrackName(e),this.node=r.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new r.Composite(t,e,n):new r(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Db,"")}static parseTrackName(t){let e=Fb.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);Nb.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let n=t.skeleton.getBoneByName(e);if(n!==void 0)return n}if(t.children){let n=function(s){for(let o=0;o<s.length;o++){let a=s[o];if(a.name===e||a.uuid===e)return a;let l=n(a.children);if(l)return l}return null},i=n(t.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)t[e++]=n[i]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,s=e.propertyIndex;if(t||(t=r.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let c=e.objectIndex;switch(n){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let u=0;u<t.length;u++)if(t[u].name===c){c=u;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[n]}if(c!==void 0){if(t[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[c]}}let o=t[i];if(o===void 0){let c=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+i+" but it wasn't found.",t);return}let a=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[s]!==void 0&&(s=t.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};we.Composite=Lh;we.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};we.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};we.prototype.GetterByBindingType=[we.prototype._getValue_direct,we.prototype._getValue_array,we.prototype._getValue_arrayElement,we.prototype._getValue_toArray];we.prototype.SetterByBindingTypeAndVersioning=[[we.prototype._setValue_direct,we.prototype._setValue_direct_setNeedsUpdate,we.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[we.prototype._setValue_array,we.prototype._setValue_array_setNeedsUpdate,we.prototype._setValue_array_setMatrixWorldNeedsUpdate],[we.prototype._setValue_arrayElement,we.prototype._setValue_arrayElement_setNeedsUpdate,we.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[we.prototype._setValue_fromArray,we.prototype._setValue_fromArray_setNeedsUpdate,we.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var nw=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Fh}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Fh);var hg=()=>{var r=new fr;function t(){let e=document.querySelector("#canvas"),n=new Ol({canvas:e,antialias:!0,alpha:!0}),i=new zl,s=new Sn(18);s.near=1,s.far=2e3,s.position.z=-10,n.outputColorSpace=qn,n.shadowMap.enabled=!0,n.shadowMap.type=Nh,i.fog=new Bl(3741705,9,15),i.add(r);function o(){let u=new Hl(16777215,41378,1),f=new as(3355443,4);f.position.set(5,5,5),f.lookAt(0,0,0),f.castShadow=!0,f.shadow.mapSize.width=512,f.shadow.mapSize.height=512,f.shadow.camera.near=.5,f.shadow.camera.far=500,i.add(f),i.add(u);let h=[];h[0]=new as(16777215,1),h[0].position.set(1,0,0),h[1]=new as(11460838,1),h[1].position.set(.75,1,.5),h[2]=new as(14277490,1),h[2].position.set(-.75,-1,.5),i.add(h[0]),i.add(h[1]),i.add(h[2])}function a(u,f){let h=new Mi,d=[],_=[],g=f||25,p=g/2;for(let S=0;S<(u||7e3);S++){let y=Math.random()*g-p,D=Math.random()*g-p,A=Math.random()*g-p;d.push(y,D,A),_.push(Math.random()*.9+.1)}h.setAttribute("position",new Jn(d,3)),h.setAttribute("opacity",new Jn(_,1)),h.computeBoundingSphere();let m=new Kn({vertexShader:`
|
|
3821
|
+
}`,xh=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){let i=new $n,s=t.properties.get(i);s.__webglTexture=e.texture,(e.depthNear!=n.depthNear||e.depthFar!=n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}render(t,e){if(this.texture!==null){if(this.mesh===null){let n=e.cameras[0].viewport,i=new Kn({vertexShader:Sb,fragmentShader:Mb,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new ai(new Ll(20,20),i)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},vh=class extends xr{constructor(t,e){super();let n=this,i=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,h=null,f=null,d=null,_=null,g=new xh,m=e.getContextAttributes(),p=null,b=null,y=[],S=[],D=new ue,A=null,w=new Sn;w.layers.enable(1),w.viewport=new Ye;let P=new Sn;P.layers.enable(2),P.viewport=new Ye;let M=[w,P],v=new _h;v.layers.enable(1),v.layers.enable(2);let N=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(q){let tt=y[q];return tt===void 0&&(tt=new qo,y[q]=tt),tt.getTargetRaySpace()},this.getControllerGrip=function(q){let tt=y[q];return tt===void 0&&(tt=new qo,y[q]=tt),tt.getGripSpace()},this.getHand=function(q){let tt=y[q];return tt===void 0&&(tt=new qo,y[q]=tt),tt.getHandSpace()};function R(q){let tt=S.indexOf(q.inputSource);if(tt===-1)return;let pt=y[tt];pt!==void 0&&(pt.update(q.inputSource,q.frame,c||o),pt.dispatchEvent({type:q.type,data:q.inputSource}))}function B(){i.removeEventListener("select",R),i.removeEventListener("selectstart",R),i.removeEventListener("selectend",R),i.removeEventListener("squeeze",R),i.removeEventListener("squeezestart",R),i.removeEventListener("squeezeend",R),i.removeEventListener("end",B),i.removeEventListener("inputsourceschange",Y);for(let q=0;q<y.length;q++){let tt=S[q];tt!==null&&(S[q]=null,y[q].disconnect(tt))}N=null,F=null,g.reset(),t.setRenderTarget(p),d=null,f=null,h=null,i=null,b=null,Wt.stop(),n.isPresenting=!1,t.setPixelRatio(A),t.setSize(D.width,D.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(q){s=q,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(q){a=q,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(q){c=q},this.getBaseLayer=function(){return f!==null?f:d},this.getBinding=function(){return h},this.getFrame=function(){return _},this.getSession=function(){return i},this.setSession=async function(q){if(i=q,i!==null){if(p=t.getRenderTarget(),i.addEventListener("select",R),i.addEventListener("selectstart",R),i.addEventListener("selectend",R),i.addEventListener("squeeze",R),i.addEventListener("squeezestart",R),i.addEventListener("squeezeend",R),i.addEventListener("end",B),i.addEventListener("inputsourceschange",Y),m.xrCompatible!==!0&&await e.makeXRCompatible(),A=t.getPixelRatio(),t.getSize(D),i.renderState.layers===void 0){let tt={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(i,e,tt),i.updateRenderState({baseLayer:d}),t.setPixelRatio(1),t.setSize(d.framebufferWidth,d.framebufferHeight,!1),b=new Gi(d.framebufferWidth,d.framebufferHeight,{format:Si,type:_r,colorSpace:t.outputColorSpace,stencilBuffer:m.stencil})}else{let tt=null,pt=null,st=null;m.depth&&(st=m.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,tt=m.stencil?Yo:Js,pt=m.stencil?Ko:to);let Ft={colorFormat:e.RGBA8,depthFormat:st,scaleFactor:s};h=new XRWebGLBinding(i,e),f=h.createProjectionLayer(Ft),i.updateRenderState({layers:[f]}),t.setPixelRatio(1),t.setSize(f.textureWidth,f.textureHeight,!1),b=new Gi(f.textureWidth,f.textureHeight,{format:Si,type:_r,depthTexture:new Ul(f.textureWidth,f.textureHeight,pt,void 0,void 0,void 0,void 0,void 0,void 0,tt),stencilBuffer:m.stencil,colorSpace:t.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1})}b.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await i.requestReferenceSpace(a),Wt.setContext(i),Wt.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function Y(q){for(let tt=0;tt<q.removed.length;tt++){let pt=q.removed[tt],st=S.indexOf(pt);st>=0&&(S[st]=null,y[st].disconnect(pt))}for(let tt=0;tt<q.added.length;tt++){let pt=q.added[tt],st=S.indexOf(pt);if(st===-1){for(let Nt=0;Nt<y.length;Nt++)if(Nt>=S.length){S.push(pt),st=Nt;break}else if(S[Nt]===null){S[Nt]=pt,st=Nt;break}if(st===-1)break}let Ft=y[st];Ft&&Ft.connect(pt)}}let H=new j,J=new j;function O(q,tt,pt){H.setFromMatrixPosition(tt.matrixWorld),J.setFromMatrixPosition(pt.matrixWorld);let st=H.distanceTo(J),Ft=tt.projectionMatrix.elements,Nt=pt.projectionMatrix.elements,V=Ft[14]/(Ft[10]-1),Yt=Ft[14]/(Ft[10]+1),Et=(Ft[9]+1)/Ft[5],Tt=(Ft[9]-1)/Ft[5],St=(Ft[8]-1)/Ft[0],zt=(Nt[8]+1)/Nt[0],Ut=V*St,k=V*zt,Qt=st/(-St+zt),T=Qt*-St;tt.matrixWorld.decompose(q.position,q.quaternion,q.scale),q.translateX(T),q.translateZ(Qt),q.matrixWorld.compose(q.position,q.quaternion,q.scale),q.matrixWorldInverse.copy(q.matrixWorld).invert();let x=V+Qt,I=Yt+Qt,G=Ut-T,K=k+(st-T),Q=Et*Yt/I*x,ht=Tt*Yt/I*x;q.projectionMatrix.makePerspective(G,K,Q,ht,x,I),q.projectionMatrixInverse.copy(q.projectionMatrix).invert()}function L(q,tt){tt===null?q.matrixWorld.copy(q.matrix):q.matrixWorld.multiplyMatrices(tt.matrixWorld,q.matrix),q.matrixWorldInverse.copy(q.matrixWorld).invert()}this.updateCamera=function(q){if(i===null)return;g.texture!==null&&(q.near=g.depthNear,q.far=g.depthFar),v.near=P.near=w.near=q.near,v.far=P.far=w.far=q.far,(N!==v.near||F!==v.far)&&(i.updateRenderState({depthNear:v.near,depthFar:v.far}),N=v.near,F=v.far,w.near=N,w.far=F,P.near=N,P.far=F,w.updateProjectionMatrix(),P.updateProjectionMatrix(),q.updateProjectionMatrix());let tt=q.parent,pt=v.cameras;L(v,tt);for(let st=0;st<pt.length;st++)L(pt[st],tt);pt.length===2?O(v,w,P):v.projectionMatrix.copy(w.projectionMatrix),C(q,v,tt)};function C(q,tt,pt){pt===null?q.matrix.copy(tt.matrixWorld):(q.matrix.copy(pt.matrixWorld),q.matrix.invert(),q.matrix.multiply(tt.matrixWorld)),q.matrix.decompose(q.position,q.quaternion,q.scale),q.updateMatrixWorld(!0),q.projectionMatrix.copy(tt.projectionMatrix),q.projectionMatrixInverse.copy(tt.projectionMatrixInverse),q.isPerspectiveCamera&&(q.fov=ih*2*Math.atan(1/q.projectionMatrix.elements[5]),q.zoom=1)}this.getCamera=function(){return v},this.getFoveation=function(){if(!(f===null&&d===null))return l},this.setFoveation=function(q){l=q,f!==null&&(f.fixedFoveation=q),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=q)},this.hasDepthSensing=function(){return g.texture!==null};let ot=null;function vt(q,tt){if(u=tt.getViewerPose(c||o),_=tt,u!==null){let pt=u.views;d!==null&&(t.setRenderTargetFramebuffer(b,d.framebuffer),t.setRenderTarget(b));let st=!1;pt.length!==v.cameras.length&&(v.cameras.length=0,st=!0);for(let Nt=0;Nt<pt.length;Nt++){let V=pt[Nt],Yt=null;if(d!==null)Yt=d.getViewport(V);else{let Tt=h.getViewSubImage(f,V);Yt=Tt.viewport,Nt===0&&(t.setRenderTargetTextures(b,Tt.colorTexture,f.ignoreDepthValues?void 0:Tt.depthStencilTexture),t.setRenderTarget(b))}let Et=M[Nt];Et===void 0&&(Et=new Sn,Et.layers.enable(Nt),Et.viewport=new Ye,M[Nt]=Et),Et.matrix.fromArray(V.transform.matrix),Et.matrix.decompose(Et.position,Et.quaternion,Et.scale),Et.projectionMatrix.fromArray(V.projectionMatrix),Et.projectionMatrixInverse.copy(Et.projectionMatrix).invert(),Et.viewport.set(Yt.x,Yt.y,Yt.width,Yt.height),Nt===0&&(v.matrix.copy(Et.matrix),v.matrix.decompose(v.position,v.quaternion,v.scale)),st===!0&&v.cameras.push(Et)}let Ft=i.enabledFeatures;if(Ft&&Ft.includes("depth-sensing")){let Nt=h.getDepthInformation(pt[0]);Nt&&Nt.isValid&&Nt.texture&&g.init(t,Nt,i.renderState)}}for(let pt=0;pt<y.length;pt++){let st=S[pt],Ft=y[pt];st!==null&&Ft!==void 0&&Ft.update(st,tt,c||o)}g.render(t,v),ot&&ot(q,tt),tt.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:tt}),_=null}let Wt=new sg;Wt.setAnimationLoop(vt),this.setAnimationLoop=function(q){ot=q},this.dispose=function(){}}},Kr=new Wi,bb=new Le;function wb(r,t){function e(m,p){m.matrixAutoUpdate===!0&&m.updateMatrix(),p.value.copy(m.matrix)}function n(m,p){p.color.getRGB(m.fogColor.value,rg(r)),p.isFog?(m.fogNear.value=p.near,m.fogFar.value=p.far):p.isFogExp2&&(m.fogDensity.value=p.density)}function i(m,p,b,y,S){p.isMeshBasicMaterial||p.isMeshLambertMaterial?s(m,p):p.isMeshToonMaterial?(s(m,p),h(m,p)):p.isMeshPhongMaterial?(s(m,p),u(m,p)):p.isMeshStandardMaterial?(s(m,p),f(m,p),p.isMeshPhysicalMaterial&&d(m,p,S)):p.isMeshMatcapMaterial?(s(m,p),_(m,p)):p.isMeshDepthMaterial?s(m,p):p.isMeshDistanceMaterial?(s(m,p),g(m,p)):p.isMeshNormalMaterial?s(m,p):p.isLineBasicMaterial?(o(m,p),p.isLineDashedMaterial&&a(m,p)):p.isPointsMaterial?l(m,p,b,y):p.isSpriteMaterial?c(m,p):p.isShadowMaterial?(m.color.value.copy(p.color),m.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function s(m,p){m.opacity.value=p.opacity,p.color&&m.diffuse.value.copy(p.color),p.emissive&&m.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(m.map.value=p.map,e(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,e(p.alphaMap,m.alphaMapTransform)),p.bumpMap&&(m.bumpMap.value=p.bumpMap,e(p.bumpMap,m.bumpMapTransform),m.bumpScale.value=p.bumpScale,p.side===Cn&&(m.bumpScale.value*=-1)),p.normalMap&&(m.normalMap.value=p.normalMap,e(p.normalMap,m.normalMapTransform),m.normalScale.value.copy(p.normalScale),p.side===Cn&&m.normalScale.value.negate()),p.displacementMap&&(m.displacementMap.value=p.displacementMap,e(p.displacementMap,m.displacementMapTransform),m.displacementScale.value=p.displacementScale,m.displacementBias.value=p.displacementBias),p.emissiveMap&&(m.emissiveMap.value=p.emissiveMap,e(p.emissiveMap,m.emissiveMapTransform)),p.specularMap&&(m.specularMap.value=p.specularMap,e(p.specularMap,m.specularMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest);let b=t.get(p),y=b.envMap,S=b.envMapRotation;if(y&&(m.envMap.value=y,Kr.copy(S),Kr.x*=-1,Kr.y*=-1,Kr.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(Kr.y*=-1,Kr.z*=-1),m.envMapRotation.value.setFromMatrix4(bb.makeRotationFromEuler(Kr)),m.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=p.reflectivity,m.ior.value=p.ior,m.refractionRatio.value=p.refractionRatio),p.lightMap){m.lightMap.value=p.lightMap;let D=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=p.lightMapIntensity*D,e(p.lightMap,m.lightMapTransform)}p.aoMap&&(m.aoMap.value=p.aoMap,m.aoMapIntensity.value=p.aoMapIntensity,e(p.aoMap,m.aoMapTransform))}function o(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,p.map&&(m.map.value=p.map,e(p.map,m.mapTransform))}function a(m,p){m.dashSize.value=p.dashSize,m.totalSize.value=p.dashSize+p.gapSize,m.scale.value=p.scale}function l(m,p,b,y){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.size.value=p.size*b,m.scale.value=y*.5,p.map&&(m.map.value=p.map,e(p.map,m.uvTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,e(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function c(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.rotation.value=p.rotation,p.map&&(m.map.value=p.map,e(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,e(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function u(m,p){m.specular.value.copy(p.specular),m.shininess.value=Math.max(p.shininess,1e-4)}function h(m,p){p.gradientMap&&(m.gradientMap.value=p.gradientMap)}function f(m,p){m.metalness.value=p.metalness,p.metalnessMap&&(m.metalnessMap.value=p.metalnessMap,e(p.metalnessMap,m.metalnessMapTransform)),m.roughness.value=p.roughness,p.roughnessMap&&(m.roughnessMap.value=p.roughnessMap,e(p.roughnessMap,m.roughnessMapTransform)),p.envMap&&(m.envMapIntensity.value=p.envMapIntensity)}function d(m,p,b){m.ior.value=p.ior,p.sheen>0&&(m.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),m.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(m.sheenColorMap.value=p.sheenColorMap,e(p.sheenColorMap,m.sheenColorMapTransform)),p.sheenRoughnessMap&&(m.sheenRoughnessMap.value=p.sheenRoughnessMap,e(p.sheenRoughnessMap,m.sheenRoughnessMapTransform))),p.clearcoat>0&&(m.clearcoat.value=p.clearcoat,m.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(m.clearcoatMap.value=p.clearcoatMap,e(p.clearcoatMap,m.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,e(p.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(m.clearcoatNormalMap.value=p.clearcoatNormalMap,e(p.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Cn&&m.clearcoatNormalScale.value.negate())),p.dispersion>0&&(m.dispersion.value=p.dispersion),p.iridescence>0&&(m.iridescence.value=p.iridescence,m.iridescenceIOR.value=p.iridescenceIOR,m.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(m.iridescenceMap.value=p.iridescenceMap,e(p.iridescenceMap,m.iridescenceMapTransform)),p.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=p.iridescenceThicknessMap,e(p.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),p.transmission>0&&(m.transmission.value=p.transmission,m.transmissionSamplerMap.value=b.texture,m.transmissionSamplerSize.value.set(b.width,b.height),p.transmissionMap&&(m.transmissionMap.value=p.transmissionMap,e(p.transmissionMap,m.transmissionMapTransform)),m.thickness.value=p.thickness,p.thicknessMap&&(m.thicknessMap.value=p.thicknessMap,e(p.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=p.attenuationDistance,m.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(m.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(m.anisotropyMap.value=p.anisotropyMap,e(p.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=p.specularIntensity,m.specularColor.value.copy(p.specularColor),p.specularColorMap&&(m.specularColorMap.value=p.specularColorMap,e(p.specularColorMap,m.specularColorMapTransform)),p.specularIntensityMap&&(m.specularIntensityMap.value=p.specularIntensityMap,e(p.specularIntensityMap,m.specularIntensityMapTransform))}function _(m,p){p.matcap&&(m.matcap.value=p.matcap)}function g(m,p){let b=t.get(p).light;m.referencePosition.value.setFromMatrixPosition(b.matrixWorld),m.nearDistance.value=b.shadow.camera.near,m.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function Eb(r,t,e,n){let i={},s={},o=[],a=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(b,y){let S=y.program;n.uniformBlockBinding(b,S)}function c(b,y){let S=i[b.id];S===void 0&&(_(b),S=u(b),i[b.id]=S,b.addEventListener("dispose",m));let D=y.program;n.updateUBOMapping(b,D);let A=t.render.frame;s[b.id]!==A&&(f(b),s[b.id]=A)}function u(b){let y=h();b.__bindingPointIndex=y;let S=r.createBuffer(),D=b.__size,A=b.usage;return r.bindBuffer(r.UNIFORM_BUFFER,S),r.bufferData(r.UNIFORM_BUFFER,D,A),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,y,S),S}function h(){for(let b=0;b<a;b++)if(o.indexOf(b)===-1)return o.push(b),b;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function f(b){let y=i[b.id],S=b.uniforms,D=b.__cache;r.bindBuffer(r.UNIFORM_BUFFER,y);for(let A=0,w=S.length;A<w;A++){let P=Array.isArray(S[A])?S[A]:[S[A]];for(let M=0,v=P.length;M<v;M++){let N=P[M];if(d(N,A,M,D)===!0){let F=N.__offset,R=Array.isArray(N.value)?N.value:[N.value],B=0;for(let Y=0;Y<R.length;Y++){let H=R[Y],J=g(H);typeof H=="number"||typeof H=="boolean"?(N.__data[0]=H,r.bufferSubData(r.UNIFORM_BUFFER,F+B,N.__data)):H.isMatrix3?(N.__data[0]=H.elements[0],N.__data[1]=H.elements[1],N.__data[2]=H.elements[2],N.__data[3]=0,N.__data[4]=H.elements[3],N.__data[5]=H.elements[4],N.__data[6]=H.elements[5],N.__data[7]=0,N.__data[8]=H.elements[6],N.__data[9]=H.elements[7],N.__data[10]=H.elements[8],N.__data[11]=0):(H.toArray(N.__data,B),B+=J.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,F,N.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function d(b,y,S,D){let A=b.value,w=y+"_"+S;if(D[w]===void 0)return typeof A=="number"||typeof A=="boolean"?D[w]=A:D[w]=A.clone(),!0;{let P=D[w];if(typeof A=="number"||typeof A=="boolean"){if(P!==A)return D[w]=A,!0}else if(P.equals(A)===!1)return P.copy(A),!0}return!1}function _(b){let y=b.uniforms,S=0,D=16;for(let w=0,P=y.length;w<P;w++){let M=Array.isArray(y[w])?y[w]:[y[w]];for(let v=0,N=M.length;v<N;v++){let F=M[v],R=Array.isArray(F.value)?F.value:[F.value];for(let B=0,Y=R.length;B<Y;B++){let H=R[B],J=g(H),O=S%D;O!==0&&D-O<J.boundary&&(S+=D-O),F.__data=new Float32Array(J.storage/Float32Array.BYTES_PER_ELEMENT),F.__offset=S,S+=J.storage}}}let A=S%D;return A>0&&(S+=D-A),b.__size=S,b.__cache={},this}function g(b){let y={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(y.boundary=4,y.storage=4):b.isVector2?(y.boundary=8,y.storage=8):b.isVector3||b.isColor?(y.boundary=16,y.storage=12):b.isVector4?(y.boundary=16,y.storage=16):b.isMatrix3?(y.boundary=48,y.storage=48):b.isMatrix4?(y.boundary=64,y.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),y}function m(b){let y=b.target;y.removeEventListener("dispose",m);let S=o.indexOf(y.__bindingPointIndex);o.splice(S,1),r.deleteBuffer(i[y.id]),delete i[y.id],delete s[y.id]}function p(){for(let b in i)r.deleteBuffer(i[b]);o=[],i={},s={}}return{bind:l,update:c,dispose:p}}var Ol=class{constructor(t={}){let{canvas:e=Lx(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1}=t;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=o;let d=new Uint32Array(4),_=new Int32Array(4),g=null,m=null,p=[],b=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=qn,this._useLegacyLights=!1,this.toneMapping=mr,this.toneMappingExposure=1;let y=this,S=!1,D=0,A=0,w=null,P=-1,M=null,v=new Ye,N=new Ye,F=null,R=new ce(0),B=0,Y=e.width,H=e.height,J=1,O=null,L=null,C=new Ye(0,0,Y,H),ot=new Ye(0,0,Y,H),vt=!1,Wt=new Jo,q=!1,tt=!1,pt=new Le,st=new j,Ft={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Nt(){return w===null?J:1}let V=n;function Yt(E,z){return e.getContext(E,z)}try{let E={alpha:!0,depth:i,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${Fh}`),e.addEventListener("webglcontextlost",U,!1),e.addEventListener("webglcontextrestored",$,!1),e.addEventListener("webglcontextcreationerror",et,!1),V===null){let z="webgl2";if(V=Yt(z,E),V===null)throw Yt(z)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let Et,Tt,St,zt,Ut,k,Qt,T,x,I,G,K,Q,ht,ct,nt,bt,rt,ft,Ot,it,yt,Bt,Vt;function he(){Et=new WS(V),Et.init(),yt=new vb(V,Et),Tt=new BS(V,Et,t,yt),St=new _b(V),zt=new YS(V),Ut=new sb,k=new xb(V,Et,St,Ut,Tt,yt,zt),Qt=new kS(y),T=new GS(y),x=new tv(V),Bt=new US(V,x),I=new XS(V,x,zt,Bt),G=new JS(V,I,x,zt),ft=new ZS(V,Tt,k),nt=new zS(Ut),K=new rb(y,Qt,T,Et,Tt,Bt,nt),Q=new wb(y,Ut),ht=new ab,ct=new db(Et),rt=new NS(y,Qt,T,St,G,f,l),bt=new gb(y,G,Tt),Vt=new Eb(V,zt,Tt,St),Ot=new OS(V,Et,zt),it=new qS(V,Et,zt),zt.programs=K.programs,y.capabilities=Tt,y.extensions=Et,y.properties=Ut,y.renderLists=ht,y.shadowMap=bt,y.state=St,y.info=zt}he();let kt=new vh(y,V);this.xr=kt,this.getContext=function(){return V},this.getContextAttributes=function(){return V.getContextAttributes()},this.forceContextLoss=function(){let E=Et.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){let E=Et.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return J},this.setPixelRatio=function(E){E!==void 0&&(J=E,this.setSize(Y,H,!1))},this.getSize=function(E){return E.set(Y,H)},this.setSize=function(E,z,W=!0){if(kt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Y=E,H=z,e.width=Math.floor(E*J),e.height=Math.floor(z*J),W===!0&&(e.style.width=E+"px",e.style.height=z+"px"),this.setViewport(0,0,E,z)},this.getDrawingBufferSize=function(E){return E.set(Y*J,H*J).floor()},this.setDrawingBufferSize=function(E,z,W){Y=E,H=z,J=W,e.width=Math.floor(E*W),e.height=Math.floor(z*W),this.setViewport(0,0,E,z)},this.getCurrentViewport=function(E){return E.copy(v)},this.getViewport=function(E){return E.copy(C)},this.setViewport=function(E,z,W,X){E.isVector4?C.set(E.x,E.y,E.z,E.w):C.set(E,z,W,X),St.viewport(v.copy(C).multiplyScalar(J).round())},this.getScissor=function(E){return E.copy(ot)},this.setScissor=function(E,z,W,X){E.isVector4?ot.set(E.x,E.y,E.z,E.w):ot.set(E,z,W,X),St.scissor(N.copy(ot).multiplyScalar(J).round())},this.getScissorTest=function(){return vt},this.setScissorTest=function(E){St.setScissorTest(vt=E)},this.setOpaqueSort=function(E){O=E},this.setTransparentSort=function(E){L=E},this.getClearColor=function(E){return E.copy(rt.getClearColor())},this.setClearColor=function(){rt.setClearColor.apply(rt,arguments)},this.getClearAlpha=function(){return rt.getClearAlpha()},this.setClearAlpha=function(){rt.setClearAlpha.apply(rt,arguments)},this.clear=function(E=!0,z=!0,W=!0){let X=0;if(E){let Z=!1;if(w!==null){let dt=w.texture.format;Z=dt===tg||dt===Qm||dt===jm}if(Z){let dt=w.texture.type,gt=dt===_r||dt===to||dt===Zm||dt===Ko||dt===$m||dt===Km,xt=rt.getClearColor(),Lt=rt.getClearAlpha(),Gt=xt.r,Rt=xt.g,At=xt.b;gt?(d[0]=Gt,d[1]=Rt,d[2]=At,d[3]=Lt,V.clearBufferuiv(V.COLOR,0,d)):(_[0]=Gt,_[1]=Rt,_[2]=At,_[3]=Lt,V.clearBufferiv(V.COLOR,0,_))}else X|=V.COLOR_BUFFER_BIT}z&&(X|=V.DEPTH_BUFFER_BIT),W&&(X|=V.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),V.clear(X)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",U,!1),e.removeEventListener("webglcontextrestored",$,!1),e.removeEventListener("webglcontextcreationerror",et,!1),ht.dispose(),ct.dispose(),Ut.dispose(),Qt.dispose(),T.dispose(),G.dispose(),Bt.dispose(),Vt.dispose(),K.dispose(),kt.dispose(),kt.removeEventListener("sessionstart",Zt),kt.removeEventListener("sessionend",Ct),Mt.stop()};function U(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),S=!0}function $(){console.log("THREE.WebGLRenderer: Context Restored."),S=!1;let E=zt.autoReset,z=bt.enabled,W=bt.autoUpdate,X=bt.needsUpdate,Z=bt.type;he(),zt.autoReset=E,bt.enabled=z,bt.autoUpdate=W,bt.needsUpdate=X,bt.type=Z}function et(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function ut(E){let z=E.target;z.removeEventListener("dispose",ut),lt(z)}function lt(E){Dt(E),Ut.remove(E)}function Dt(E){let z=Ut.get(E).programs;z!==void 0&&(z.forEach(function(W){K.releaseProgram(W)}),E.isShaderMaterial&&K.releaseShaderCache(E))}this.renderBufferDirect=function(E,z,W,X,Z,dt){z===null&&(z=Ft);let gt=Z.isMesh&&Z.matrixWorld.determinant()<0,xt=He(E,z,W,X,Z);St.setMaterial(X,gt);let Lt=W.index,Gt=1;if(X.wireframe===!0){if(Lt=I.getWireframeAttribute(W),Lt===void 0)return;Gt=2}let Rt=W.drawRange,At=W.attributes.position,fe=Rt.start*Gt,Fe=(Rt.start+Rt.count)*Gt;dt!==null&&(fe=Math.max(fe,dt.start*Gt),Fe=Math.min(Fe,(dt.start+dt.count)*Gt)),Lt!==null?(fe=Math.max(fe,0),Fe=Math.min(Fe,Lt.count)):At!=null&&(fe=Math.max(fe,0),Fe=Math.min(Fe,At.count));let je=Fe-fe;if(je<0||je===1/0)return;Bt.setup(Z,X,xt,W,Lt);let un,Jt=Ot;if(Lt!==null&&(un=x.get(Lt),Jt=it,Jt.setIndex(un)),Z.isMesh)X.wireframe===!0?(St.setLineWidth(X.wireframeLinewidth*Nt()),Jt.setMode(V.LINES)):Jt.setMode(V.TRIANGLES);else if(Z.isLine){let Ht=X.linewidth;Ht===void 0&&(Ht=1),St.setLineWidth(Ht*Nt()),Z.isLineSegments?Jt.setMode(V.LINES):Z.isLineLoop?Jt.setMode(V.LINE_LOOP):Jt.setMode(V.LINE_STRIP)}else Z.isPoints?Jt.setMode(V.POINTS):Z.isSprite&&Jt.setMode(V.TRIANGLES);if(Z.isBatchedMesh)Z._multiDrawInstances!==null?Jt.renderMultiDrawInstances(Z._multiDrawStarts,Z._multiDrawCounts,Z._multiDrawCount,Z._multiDrawInstances):Jt.renderMultiDraw(Z._multiDrawStarts,Z._multiDrawCounts,Z._multiDrawCount);else if(Z.isInstancedMesh)Jt.renderInstances(fe,je,Z.count);else if(W.isInstancedBufferGeometry){let Ht=W._maxInstanceCount!==void 0?W._maxInstanceCount:1/0,ci=Math.min(W.instanceCount,Ht);Jt.renderInstances(fe,je,ci)}else Jt.render(fe,je)};function te(E,z,W){E.transparent===!0&&E.side===Vi&&E.forceSinglePass===!1?(E.side=Cn,E.needsUpdate=!0,Ee(E,z,W),E.side=gr,E.needsUpdate=!0,Ee(E,z,W),E.side=Vi):Ee(E,z,W)}this.compile=function(E,z,W=null){W===null&&(W=E),m=ct.get(W),m.init(z),b.push(m),W.traverseVisible(function(Z){Z.isLight&&Z.layers.test(z.layers)&&(m.pushLight(Z),Z.castShadow&&m.pushShadow(Z))}),E!==W&&E.traverseVisible(function(Z){Z.isLight&&Z.layers.test(z.layers)&&(m.pushLight(Z),Z.castShadow&&m.pushShadow(Z))}),m.setupLights(y._useLegacyLights);let X=new Set;return E.traverse(function(Z){let dt=Z.material;if(dt)if(Array.isArray(dt))for(let gt=0;gt<dt.length;gt++){let xt=dt[gt];te(xt,W,Z),X.add(xt)}else te(dt,W,Z),X.add(dt)}),b.pop(),m=null,X},this.compileAsync=function(E,z,W=null){let X=this.compile(E,z,W);return new Promise(Z=>{function dt(){if(X.forEach(function(gt){Ut.get(gt).currentProgram.isReady()&&X.delete(gt)}),X.size===0){Z(E);return}setTimeout(dt,10)}Et.get("KHR_parallel_shader_compile")!==null?dt():setTimeout(dt,10)})};let ae=null;function re(E){ae&&ae(E)}function Zt(){Mt.stop()}function Ct(){Mt.start()}let Mt=new sg;Mt.setAnimationLoop(re),typeof self<"u"&&Mt.setContext(self),this.setAnimationLoop=function(E){ae=E,kt.setAnimationLoop(E),E===null?Mt.stop():Mt.start()},kt.addEventListener("sessionstart",Zt),kt.addEventListener("sessionend",Ct),this.render=function(E,z){if(z!==void 0&&z.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),z.parent===null&&z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),kt.enabled===!0&&kt.isPresenting===!0&&(kt.cameraAutoUpdate===!0&&kt.updateCamera(z),z=kt.getCamera()),E.isScene===!0&&E.onBeforeRender(y,E,z,w),m=ct.get(E,b.length),m.init(z),b.push(m),pt.multiplyMatrices(z.projectionMatrix,z.matrixWorldInverse),Wt.setFromProjectionMatrix(pt),tt=this.localClippingEnabled,q=nt.init(this.clippingPlanes,tt),g=ht.get(E,p.length),g.init(),p.push(g),le(E,z,0,y.sortObjects),g.finish(),y.sortObjects===!0&&g.sort(O,L);let W=kt.enabled===!1||kt.isPresenting===!1||kt.hasDepthSensing()===!1;W&&rt.addToRenderList(g,E),this.info.render.frame++,q===!0&&nt.beginShadows();let X=m.state.shadowsArray;bt.render(X,E,z),q===!0&&nt.endShadows(),this.info.autoReset===!0&&this.info.reset();let Z=g.opaque,dt=g.transmissive;if(m.setupLights(y._useLegacyLights),z.isArrayCamera){let gt=z.cameras;if(dt.length>0)for(let xt=0,Lt=gt.length;xt<Lt;xt++){let Gt=gt[xt];qt(Z,dt,E,Gt)}W&&rt.render(E);for(let xt=0,Lt=gt.length;xt<Lt;xt++){let Gt=gt[xt];mt(g,E,Gt,Gt.viewport)}}else dt.length>0&&qt(Z,dt,E,z),W&&rt.render(E),mt(g,E,z);w!==null&&(k.updateMultisampleRenderTarget(w),k.updateRenderTargetMipmap(w)),E.isScene===!0&&E.onAfterRender(y,E,z),Bt.resetDefaultState(),P=-1,M=null,b.pop(),b.length>0?(m=b[b.length-1],q===!0&&nt.setGlobalState(y.clippingPlanes,m.state.camera)):m=null,p.pop(),p.length>0?g=p[p.length-1]:g=null};function le(E,z,W,X){if(E.visible===!1)return;if(E.layers.test(z.layers)){if(E.isGroup)W=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(z);else if(E.isLight)m.pushLight(E),E.castShadow&&m.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||Wt.intersectsSprite(E)){X&&st.setFromMatrixPosition(E.matrixWorld).applyMatrix4(pt);let gt=G.update(E),xt=E.material;xt.visible&&g.push(E,gt,xt,W,st.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||Wt.intersectsObject(E))){let gt=G.update(E),xt=E.material;if(X&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),st.copy(E.boundingSphere.center)):(gt.boundingSphere===null&>.computeBoundingSphere(),st.copy(gt.boundingSphere.center)),st.applyMatrix4(E.matrixWorld).applyMatrix4(pt)),Array.isArray(xt)){let Lt=gt.groups;for(let Gt=0,Rt=Lt.length;Gt<Rt;Gt++){let At=Lt[Gt],fe=xt[At.materialIndex];fe&&fe.visible&&g.push(E,gt,fe,W,st.z,At)}}else xt.visible&&g.push(E,gt,xt,W,st.z,null)}}let dt=E.children;for(let gt=0,xt=dt.length;gt<xt;gt++)le(dt[gt],z,W,X)}function mt(E,z,W,X){let Z=E.opaque,dt=E.transmissive,gt=E.transparent;m.setupLightsView(W),q===!0&&nt.setGlobalState(y.clippingPlanes,W),X&&St.viewport(v.copy(X)),Z.length>0&&It(Z,z,W),dt.length>0&&It(dt,z,W),gt.length>0&&It(gt,z,W),St.buffers.depth.setTest(!0),St.buffers.depth.setMask(!0),St.buffers.color.setMask(!0),St.setPolygonOffset(!1)}function qt(E,z,W,X){if((W.isScene===!0?W.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[X.id]===void 0&&(m.state.transmissionRenderTarget[X.id]=new Gi(1,1,{generateMipmaps:!0,type:Et.has("EXT_color_buffer_half_float")||Et.has("EXT_color_buffer_float")?Wl:_r,minFilter:ns,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1}));let dt=m.state.transmissionRenderTarget[X.id],gt=X.viewport||v;dt.setSize(gt.z,gt.w);let xt=y.getRenderTarget();y.setRenderTarget(dt),y.getClearColor(R),B=y.getClearAlpha(),B<1&&y.setClearColor(16777215,.5),y.clear();let Lt=y.toneMapping;y.toneMapping=mr;let Gt=X.viewport;if(X.viewport!==void 0&&(X.viewport=void 0),m.setupLightsView(X),q===!0&&nt.setGlobalState(y.clippingPlanes,X),It(E,W,X),k.updateMultisampleRenderTarget(dt),k.updateRenderTargetMipmap(dt),Et.has("WEBGL_multisampled_render_to_texture")===!1){let Rt=!1;for(let At=0,fe=z.length;At<fe;At++){let Fe=z[At],je=Fe.object,un=Fe.geometry,Jt=Fe.material,Ht=Fe.group;if(Jt.side===Vi&&je.layers.test(X.layers)){let ci=Jt.side;Jt.side=Cn,Jt.needsUpdate=!0,Xt(je,W,X,un,Jt,Ht),Jt.side=ci,Jt.needsUpdate=!0,Rt=!0}}Rt===!0&&(k.updateMultisampleRenderTarget(dt),k.updateRenderTargetMipmap(dt))}y.setRenderTarget(xt),y.setClearColor(R,B),Gt!==void 0&&(X.viewport=Gt),y.toneMapping=Lt}function It(E,z,W){let X=z.isScene===!0?z.overrideMaterial:null;for(let Z=0,dt=E.length;Z<dt;Z++){let gt=E[Z],xt=gt.object,Lt=gt.geometry,Gt=X===null?gt.material:X,Rt=gt.group;xt.layers.test(W.layers)&&Xt(xt,z,W,Lt,Gt,Rt)}}function Xt(E,z,W,X,Z,dt){E.onBeforeRender(y,z,W,X,Z,dt),E.modelViewMatrix.multiplyMatrices(W.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),Z.onBeforeRender(y,z,W,X,E,dt),Z.transparent===!0&&Z.side===Vi&&Z.forceSinglePass===!1?(Z.side=Cn,Z.needsUpdate=!0,y.renderBufferDirect(W,z,X,Z,E,dt),Z.side=gr,Z.needsUpdate=!0,y.renderBufferDirect(W,z,X,Z,E,dt),Z.side=Vi):y.renderBufferDirect(W,z,X,Z,E,dt),E.onAfterRender(y,z,W,X,Z,dt)}function Ee(E,z,W){z.isScene!==!0&&(z=Ft);let X=Ut.get(E),Z=m.state.lights,dt=m.state.shadowsArray,gt=Z.state.version,xt=K.getParameters(E,Z.state,dt,z,W),Lt=K.getProgramCacheKey(xt),Gt=X.programs;X.environment=E.isMeshStandardMaterial?z.environment:null,X.fog=z.fog,X.envMap=(E.isMeshStandardMaterial?T:Qt).get(E.envMap||X.environment),X.envMapRotation=X.environment!==null&&E.envMap===null?z.environmentRotation:E.envMapRotation,Gt===void 0&&(E.addEventListener("dispose",ut),Gt=new Map,X.programs=Gt);let Rt=Gt.get(Lt);if(Rt!==void 0){if(X.currentProgram===Rt&&X.lightsStateVersion===gt)return Se(E,xt),Rt}else xt.uniforms=K.getUniforms(E),E.onBuild(W,xt,y),E.onBeforeCompile(xt,y),Rt=K.acquireProgram(xt,Lt),Gt.set(Lt,Rt),X.uniforms=xt.uniforms;let At=X.uniforms;return(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(At.clippingPlanes=nt.uniform),Se(E,xt),X.needsLights=_e(E),X.lightsStateVersion=gt,X.needsLights&&(At.ambientLightColor.value=Z.state.ambient,At.lightProbe.value=Z.state.probe,At.directionalLights.value=Z.state.directional,At.directionalLightShadows.value=Z.state.directionalShadow,At.spotLights.value=Z.state.spot,At.spotLightShadows.value=Z.state.spotShadow,At.rectAreaLights.value=Z.state.rectArea,At.ltc_1.value=Z.state.rectAreaLTC1,At.ltc_2.value=Z.state.rectAreaLTC2,At.pointLights.value=Z.state.point,At.pointLightShadows.value=Z.state.pointShadow,At.hemisphereLights.value=Z.state.hemi,At.directionalShadowMap.value=Z.state.directionalShadowMap,At.directionalShadowMatrix.value=Z.state.directionalShadowMatrix,At.spotShadowMap.value=Z.state.spotShadowMap,At.spotLightMatrix.value=Z.state.spotLightMatrix,At.spotLightMap.value=Z.state.spotLightMap,At.pointShadowMap.value=Z.state.pointShadowMap,At.pointShadowMatrix.value=Z.state.pointShadowMatrix),X.currentProgram=Rt,X.uniformsList=null,Rt}function ee(E){if(E.uniformsList===null){let z=E.currentProgram.getUniforms();E.uniformsList=Ks.seqWithValue(z.seq,E.uniforms)}return E.uniformsList}function Se(E,z){let W=Ut.get(E);W.outputColorSpace=z.outputColorSpace,W.batching=z.batching,W.instancing=z.instancing,W.instancingColor=z.instancingColor,W.instancingMorph=z.instancingMorph,W.skinning=z.skinning,W.morphTargets=z.morphTargets,W.morphNormals=z.morphNormals,W.morphColors=z.morphColors,W.morphTargetsCount=z.morphTargetsCount,W.numClippingPlanes=z.numClippingPlanes,W.numIntersection=z.numClipIntersection,W.vertexAlphas=z.vertexAlphas,W.vertexTangents=z.vertexTangents,W.toneMapping=z.toneMapping}function He(E,z,W,X,Z){z.isScene!==!0&&(z=Ft),k.resetTextureUnits();let dt=z.fog,gt=X.isMeshStandardMaterial?z.environment:null,xt=w===null?y.outputColorSpace:w.isXRRenderTarget===!0?w.texture.colorSpace:yr,Lt=(X.isMeshStandardMaterial?T:Qt).get(X.envMap||gt),Gt=X.vertexColors===!0&&!!W.attributes.color&&W.attributes.color.itemSize===4,Rt=!!W.attributes.tangent&&(!!X.normalMap||X.anisotropy>0),At=!!W.morphAttributes.position,fe=!!W.morphAttributes.normal,Fe=!!W.morphAttributes.color,je=mr;X.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(je=y.toneMapping);let un=W.morphAttributes.position||W.morphAttributes.normal||W.morphAttributes.color,Jt=un!==void 0?un.length:0,Ht=Ut.get(X),ci=m.state.lights;if(q===!0&&(tt===!0||E!==M)){let On=E===M&&X.id===P;nt.setState(X,E,On)}let pe=!1;X.version===Ht.__version?(Ht.needsLights&&Ht.lightsStateVersion!==ci.state.version||Ht.outputColorSpace!==xt||Z.isBatchedMesh&&Ht.batching===!1||!Z.isBatchedMesh&&Ht.batching===!0||Z.isInstancedMesh&&Ht.instancing===!1||!Z.isInstancedMesh&&Ht.instancing===!0||Z.isSkinnedMesh&&Ht.skinning===!1||!Z.isSkinnedMesh&&Ht.skinning===!0||Z.isInstancedMesh&&Ht.instancingColor===!0&&Z.instanceColor===null||Z.isInstancedMesh&&Ht.instancingColor===!1&&Z.instanceColor!==null||Z.isInstancedMesh&&Ht.instancingMorph===!0&&Z.morphTexture===null||Z.isInstancedMesh&&Ht.instancingMorph===!1&&Z.morphTexture!==null||Ht.envMap!==Lt||X.fog===!0&&Ht.fog!==dt||Ht.numClippingPlanes!==void 0&&(Ht.numClippingPlanes!==nt.numPlanes||Ht.numIntersection!==nt.numIntersection)||Ht.vertexAlphas!==Gt||Ht.vertexTangents!==Rt||Ht.morphTargets!==At||Ht.morphNormals!==fe||Ht.morphColors!==Fe||Ht.toneMapping!==je||Ht.morphTargetsCount!==Jt)&&(pe=!0):(pe=!0,Ht.__version=X.version);let Sr=Ht.currentProgram;pe===!0&&(Sr=Ee(X,z,Z));let kh=!1,so=!1,Yl=!1,Qe=Sr.getUniforms(),Xi=Ht.uniforms;if(St.useProgram(Sr.program)&&(kh=!0,so=!0,Yl=!0),X.id!==P&&(P=X.id,so=!0),kh||M!==E){Qe.setValue(V,"projectionMatrix",E.projectionMatrix),Qe.setValue(V,"viewMatrix",E.matrixWorldInverse);let On=Qe.map.cameraPosition;On!==void 0&&On.setValue(V,st.setFromMatrixPosition(E.matrixWorld)),Tt.logarithmicDepthBuffer&&Qe.setValue(V,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(X.isMeshPhongMaterial||X.isMeshToonMaterial||X.isMeshLambertMaterial||X.isMeshBasicMaterial||X.isMeshStandardMaterial||X.isShaderMaterial)&&Qe.setValue(V,"isOrthographic",E.isOrthographicCamera===!0),M!==E&&(M=E,so=!0,Yl=!0)}if(Z.isSkinnedMesh){Qe.setOptional(V,Z,"bindMatrix"),Qe.setOptional(V,Z,"bindMatrixInverse");let On=Z.skeleton;On&&(On.boneTexture===null&&On.computeBoneTexture(),Qe.setValue(V,"boneTexture",On.boneTexture,k))}Z.isBatchedMesh&&(Qe.setOptional(V,Z,"batchingTexture"),Qe.setValue(V,"batchingTexture",Z._matricesTexture,k));let Zl=W.morphAttributes;if((Zl.position!==void 0||Zl.normal!==void 0||Zl.color!==void 0)&&ft.update(Z,W,Sr),(so||Ht.receiveShadow!==Z.receiveShadow)&&(Ht.receiveShadow=Z.receiveShadow,Qe.setValue(V,"receiveShadow",Z.receiveShadow)),X.isMeshGouraudMaterial&&X.envMap!==null&&(Xi.envMap.value=Lt,Xi.flipEnvMap.value=Lt.isCubeTexture&&Lt.isRenderTargetTexture===!1?-1:1),X.isMeshStandardMaterial&&X.envMap===null&&z.environment!==null&&(Xi.envMapIntensity.value=z.environmentIntensity),so&&(Qe.setValue(V,"toneMappingExposure",y.toneMappingExposure),Ht.needsLights&&Me(Xi,Yl),dt&&X.fog===!0&&Q.refreshFogUniforms(Xi,dt),Q.refreshMaterialUniforms(Xi,X,J,H,m.state.transmissionRenderTarget[E.id]),Ks.upload(V,ee(Ht),Xi,k)),X.isShaderMaterial&&X.uniformsNeedUpdate===!0&&(Ks.upload(V,ee(Ht),Xi,k),X.uniformsNeedUpdate=!1),X.isSpriteMaterial&&Qe.setValue(V,"center",Z.center),Qe.setValue(V,"modelViewMatrix",Z.modelViewMatrix),Qe.setValue(V,"normalMatrix",Z.normalMatrix),Qe.setValue(V,"modelMatrix",Z.matrixWorld),X.isShaderMaterial||X.isRawShaderMaterial){let On=X.uniformsGroups;for(let Jl=0,fg=On.length;Jl<fg;Jl++){let Vh=On[Jl];Vt.update(Vh,Sr),Vt.bind(Vh,Sr)}}return Sr}function Me(E,z){E.ambientLightColor.needsUpdate=z,E.lightProbe.needsUpdate=z,E.directionalLights.needsUpdate=z,E.directionalLightShadows.needsUpdate=z,E.pointLights.needsUpdate=z,E.pointLightShadows.needsUpdate=z,E.spotLights.needsUpdate=z,E.spotLightShadows.needsUpdate=z,E.rectAreaLights.needsUpdate=z,E.hemisphereLights.needsUpdate=z}function _e(E){return E.isMeshLambertMaterial||E.isMeshToonMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isShadowMaterial||E.isShaderMaterial&&E.lights===!0}this.getActiveCubeFace=function(){return D},this.getActiveMipmapLevel=function(){return A},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(E,z,W){Ut.get(E.texture).__webglTexture=z,Ut.get(E.depthTexture).__webglTexture=W;let X=Ut.get(E);X.__hasExternalTextures=!0,X.__autoAllocateDepthBuffer=W===void 0,X.__autoAllocateDepthBuffer||Et.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),X.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(E,z){let W=Ut.get(E);W.__webglFramebuffer=z,W.__useDefaultFramebuffer=z===void 0},this.setRenderTarget=function(E,z=0,W=0){w=E,D=z,A=W;let X=!0,Z=null,dt=!1,gt=!1;if(E){let Lt=Ut.get(E);Lt.__useDefaultFramebuffer!==void 0?(St.bindFramebuffer(V.FRAMEBUFFER,null),X=!1):Lt.__webglFramebuffer===void 0?k.setupRenderTarget(E):Lt.__hasExternalTextures&&k.rebindTextures(E,Ut.get(E.texture).__webglTexture,Ut.get(E.depthTexture).__webglTexture);let Gt=E.texture;(Gt.isData3DTexture||Gt.isDataArrayTexture||Gt.isCompressedArrayTexture)&&(gt=!0);let Rt=Ut.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(Array.isArray(Rt[z])?Z=Rt[z][W]:Z=Rt[z],dt=!0):E.samples>0&&k.useMultisampledRTT(E)===!1?Z=Ut.get(E).__webglMultisampledFramebuffer:Array.isArray(Rt)?Z=Rt[W]:Z=Rt,v.copy(E.viewport),N.copy(E.scissor),F=E.scissorTest}else v.copy(C).multiplyScalar(J).floor(),N.copy(ot).multiplyScalar(J).floor(),F=vt;if(St.bindFramebuffer(V.FRAMEBUFFER,Z)&&X&&St.drawBuffers(E,Z),St.viewport(v),St.scissor(N),St.setScissorTest(F),dt){let Lt=Ut.get(E.texture);V.framebufferTexture2D(V.FRAMEBUFFER,V.COLOR_ATTACHMENT0,V.TEXTURE_CUBE_MAP_POSITIVE_X+z,Lt.__webglTexture,W)}else if(gt){let Lt=Ut.get(E.texture),Gt=z||0;V.framebufferTextureLayer(V.FRAMEBUFFER,V.COLOR_ATTACHMENT0,Lt.__webglTexture,W||0,Gt)}P=-1},this.readRenderTargetPixels=function(E,z,W,X,Z,dt,gt){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let xt=Ut.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&>!==void 0&&(xt=xt[gt]),xt){St.bindFramebuffer(V.FRAMEBUFFER,xt);try{let Lt=E.texture,Gt=Lt.format,Rt=Lt.type;if(!Tt.textureFormatReadable(Gt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Tt.textureTypeReadable(Rt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}z>=0&&z<=E.width-X&&W>=0&&W<=E.height-Z&&V.readPixels(z,W,X,Z,yt.convert(Gt),yt.convert(Rt),dt)}finally{let Lt=w!==null?Ut.get(w).__webglFramebuffer:null;St.bindFramebuffer(V.FRAMEBUFFER,Lt)}}},this.copyFramebufferToTexture=function(E,z,W=0){let X=Math.pow(2,-W),Z=Math.floor(z.image.width*X),dt=Math.floor(z.image.height*X);k.setTexture2D(z,0),V.copyTexSubImage2D(V.TEXTURE_2D,W,0,0,E.x,E.y,Z,dt),St.unbindTexture()},this.copyTextureToTexture=function(E,z,W,X=0){let Z=z.image.width,dt=z.image.height,gt=yt.convert(W.format),xt=yt.convert(W.type);k.setTexture2D(W,0),V.pixelStorei(V.UNPACK_FLIP_Y_WEBGL,W.flipY),V.pixelStorei(V.UNPACK_PREMULTIPLY_ALPHA_WEBGL,W.premultiplyAlpha),V.pixelStorei(V.UNPACK_ALIGNMENT,W.unpackAlignment),z.isDataTexture?V.texSubImage2D(V.TEXTURE_2D,X,E.x,E.y,Z,dt,gt,xt,z.image.data):z.isCompressedTexture?V.compressedTexSubImage2D(V.TEXTURE_2D,X,E.x,E.y,z.mipmaps[0].width,z.mipmaps[0].height,gt,z.mipmaps[0].data):V.texSubImage2D(V.TEXTURE_2D,X,E.x,E.y,gt,xt,z.image),X===0&&W.generateMipmaps&&V.generateMipmap(V.TEXTURE_2D),St.unbindTexture()},this.copyTextureToTexture3D=function(E,z,W,X,Z=0){let dt=E.max.x-E.min.x,gt=E.max.y-E.min.y,xt=E.max.z-E.min.z,Lt=yt.convert(X.format),Gt=yt.convert(X.type),Rt;if(X.isData3DTexture)k.setTexture3D(X,0),Rt=V.TEXTURE_3D;else if(X.isDataArrayTexture||X.isCompressedArrayTexture)k.setTexture2DArray(X,0),Rt=V.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(V.UNPACK_FLIP_Y_WEBGL,X.flipY),V.pixelStorei(V.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),V.pixelStorei(V.UNPACK_ALIGNMENT,X.unpackAlignment);let At=V.getParameter(V.UNPACK_ROW_LENGTH),fe=V.getParameter(V.UNPACK_IMAGE_HEIGHT),Fe=V.getParameter(V.UNPACK_SKIP_PIXELS),je=V.getParameter(V.UNPACK_SKIP_ROWS),un=V.getParameter(V.UNPACK_SKIP_IMAGES),Jt=W.isCompressedTexture?W.mipmaps[Z]:W.image;V.pixelStorei(V.UNPACK_ROW_LENGTH,Jt.width),V.pixelStorei(V.UNPACK_IMAGE_HEIGHT,Jt.height),V.pixelStorei(V.UNPACK_SKIP_PIXELS,E.min.x),V.pixelStorei(V.UNPACK_SKIP_ROWS,E.min.y),V.pixelStorei(V.UNPACK_SKIP_IMAGES,E.min.z),W.isDataTexture||W.isData3DTexture?V.texSubImage3D(Rt,Z,z.x,z.y,z.z,dt,gt,xt,Lt,Gt,Jt.data):X.isCompressedArrayTexture?V.compressedTexSubImage3D(Rt,Z,z.x,z.y,z.z,dt,gt,xt,Lt,Jt.data):V.texSubImage3D(Rt,Z,z.x,z.y,z.z,dt,gt,xt,Lt,Gt,Jt),V.pixelStorei(V.UNPACK_ROW_LENGTH,At),V.pixelStorei(V.UNPACK_IMAGE_HEIGHT,fe),V.pixelStorei(V.UNPACK_SKIP_PIXELS,Fe),V.pixelStorei(V.UNPACK_SKIP_ROWS,je),V.pixelStorei(V.UNPACK_SKIP_IMAGES,un),Z===0&&X.generateMipmaps&&V.generateMipmap(Rt),St.unbindTexture()},this.initTexture=function(E){E.isCubeTexture?k.setTextureCube(E,0):E.isData3DTexture?k.setTexture3D(E,0):E.isDataArrayTexture||E.isCompressedArrayTexture?k.setTexture2DArray(E,0):k.setTexture2D(E,0),St.unbindTexture()},this.resetState=function(){D=0,A=0,w=null,St.reset(),Bt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Hi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Uh?"display-p3":"srgb",e.unpackColorSpace=me.workingColorSpace===Xl?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}};var Bl=class r{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new ce(t),this.near=e,this.far=n}clone(){return new r(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}},zl=class extends cn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Wi,this.environmentIntensity=1,this.environmentRotation=new Wi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}};var yh=class extends rs{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new ce(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},Vm=new Le,Sh=new Tl,dl=new eo,pl=new j,kl=class extends cn{constructor(t=new Mi,e=new yh){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){let n=this.geometry,i=this.matrixWorld,s=t.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),dl.copy(n.boundingSphere),dl.applyMatrix4(i),dl.radius+=s,t.ray.intersectsSphere(dl)===!1)return;Vm.copy(i).invert(),Sh.copy(t.ray).applyMatrix4(Vm);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=n.index,h=n.attributes.position;if(c!==null){let f=Math.max(0,o.start),d=Math.min(c.count,o.start+o.count);for(let _=f,g=d;_<g;_++){let m=c.getX(_);pl.fromBufferAttribute(h,m),Hm(pl,m,l,i,t,e,this)}}else{let f=Math.max(0,o.start),d=Math.min(h.count,o.start+o.count);for(let _=f,g=d;_<g;_++)pl.fromBufferAttribute(h,_),Hm(pl,_,l,i,t,e,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){let a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}};function Hm(r,t,e,n,i,s,o){let a=Sh.distanceSqToPoint(r);if(a<e){let l=new j;Sh.closestPointToPoint(r,l),l.applyMatrix4(n);let c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:t,face:null,object:o})}}function ml(r,t,e){return!r||!e&&r.constructor===t?r:typeof t.BYTES_PER_ELEMENT=="number"?new t(r):Array.prototype.slice.call(r)}function Tb(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var io=class{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,n=this._cachedIndex,i=e[n],s=e[n-1];n:{t:{let o;e:{i:if(!(t<i)){for(let a=n+2;;){if(i===void 0){if(t<s)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(s=i,i=e[++n],t<i)break t}o=e.length;break e}if(!(t>=s)){let a=e[1];t<a&&(n=2,s=a);for(let l=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=s,s=e[--n-1],t>=s)break t}o=n,n=0;break e}break n}for(;n<o;){let a=n+o>>>1;t<e[a]?o=a:n=a+1}if(i=e[n],s=e[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=t*i;for(let o=0;o!==i;++o)e[o]=n[s+o];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},Mh=class extends io{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Jp,endingEnd:Jp}}intervalChanged_(t,e,n){let i=this.parameterPositions,s=t-2,o=t+1,a=i[s],l=i[o];if(a===void 0)switch(this.getSettings_().endingStart){case $p:s=t,a=2*e-n;break;case Kp:s=i.length-2,a=e+i[s]-i[s+1];break;default:s=t,a=n}if(l===void 0)switch(this.getSettings_().endingEnd){case $p:o=t,l=2*n-e;break;case Kp:o=1,l=n+i[1]-i[0];break;default:o=t-1,l=e}let c=(n-e)*.5,u=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(l-n),this._offsetPrev=s*u,this._offsetNext=o*u}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,c=l-a,u=this._offsetPrev,h=this._offsetNext,f=this._weightPrev,d=this._weightNext,_=(n-e)/(i-e),g=_*_,m=g*_,p=-f*m+2*f*g-f*_,b=(1+f)*m+(-1.5-2*f)*g+(-.5+f)*_+1,y=(-1-d)*m+(1.5+d)*g+.5*_,S=d*m-d*g;for(let D=0;D!==a;++D)s[D]=p*o[u+D]+b*o[c+D]+y*o[l+D]+S*o[h+D];return s}},bh=class extends io{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,c=l-a,u=(n-e)/(i-e),h=1-u;for(let f=0;f!==a;++f)s[f]=o[c+f]*h+o[l+f]*u;return s}},wh=class extends io{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}},li=class{constructor(t,e,n,i){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ml(e,this.TimeBufferType),this.values=ml(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:ml(t.times,Array),values:ml(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(n.interpolation=i)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new wh(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new bh(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Mh(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case _l:e=this.InterpolantFactoryMethodDiscrete;break;case xl:e=this.InterpolantFactoryMethodLinear;break;case bu:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return _l;case this.InterpolantFactoryMethodLinear:return xl;case this.InterpolantFactoryMethodSmooth:return bu}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){let n=this.times,i=n.length,s=0,o=i-1;for(;s!==i&&n[s]<t;)++s;for(;o!==-1&&n[o]>e;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),t=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),t=!1;break}o=l}if(i!==void 0&&Tb(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===bu,s=t.length-1,o=1;for(let a=1;a<s;++a){let l=!1,c=t[a],u=t[a+1];if(c!==u&&(a!==1||c!==t[0]))if(i)l=!0;else{let h=a*n,f=h-n,d=h+n;for(let _=0;_!==n;++_){let g=e[h+_];if(g!==e[f+_]||g!==e[d+_]){l=!0;break}}}if(l){if(a!==o){t[o]=t[a];let h=a*n,f=o*n;for(let d=0;d!==n;++d)e[f+d]=e[h+d]}++o}}if(s>0){t[o]=t[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)e[l+c]=e[a+c];++o}return o!==t.length?(this.times=t.slice(0,o),this.values=e.slice(0,o*n)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}};li.prototype.TimeBufferType=Float32Array;li.prototype.ValueBufferType=Float32Array;li.prototype.DefaultInterpolation=xl;var ss=class extends li{};ss.prototype.ValueTypeName="bool";ss.prototype.ValueBufferType=Array;ss.prototype.DefaultInterpolation=_l;ss.prototype.InterpolantFactoryMethodLinear=void 0;ss.prototype.InterpolantFactoryMethodSmooth=void 0;var Eh=class extends li{};Eh.prototype.ValueTypeName="color";var Th=class extends li{};Th.prototype.ValueTypeName="number";var Ah=class extends io{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-e)/(i-e),c=t*a;for(let u=c+a;c!==u;c+=4)vr.slerpFlat(s,0,o,c-a,o,c,l);return s}},$o=class extends li{InterpolantFactoryMethodLinear(t){return new Ah(this.times,this.values,this.getValueSize(),t)}};$o.prototype.ValueTypeName="quaternion";$o.prototype.DefaultInterpolation=xl;$o.prototype.InterpolantFactoryMethodSmooth=void 0;var os=class extends li{};os.prototype.ValueTypeName="string";os.prototype.ValueBufferType=Array;os.prototype.DefaultInterpolation=_l;os.prototype.InterpolantFactoryMethodLinear=void 0;os.prototype.InterpolantFactoryMethodSmooth=void 0;var Dh=class extends li{};Dh.prototype.ValueTypeName="vector";var Ch=class{constructor(t,e,n){let i=this,s=!1,o=0,a=0,l,c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(u){a++,s===!1&&i.onStart!==void 0&&i.onStart(u,o,a),s=!0},this.itemEnd=function(u){o++,i.onProgress!==void 0&&i.onProgress(u,o,a),o===a&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(u){i.onError!==void 0&&i.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,h){return c.push(u,h),this},this.removeHandler=function(u){let h=c.indexOf(u);return h!==-1&&c.splice(h,2),this},this.getHandler=function(u){for(let h=0,f=c.length;h<f;h+=2){let d=c[h],_=c[h+1];if(d.global&&(d.lastIndex=0),d.test(u))return _}return null}}},Ab=new Ch,Rh=class{constructor(t){this.manager=t!==void 0?t:Ab,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let n=this;return new Promise(function(i,s){n.load(t,i,e,s)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};Rh.DEFAULT_MATERIAL_NAME="__DEFAULT";var Vl=class extends cn{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new ce(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),e}},Hl=class extends Vl{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(cn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ce(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}},$u=new Le,Gm=new j,Wm=new j,Ph=class{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new ue(512,512),this.map=null,this.mapPass=null,this.matrix=new Le,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Jo,this._frameExtents=new ue(1,1),this._viewportCount=1,this._viewports=[new Ye(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,n=this.matrix;Gm.setFromMatrixPosition(t.matrixWorld),e.position.copy(Gm),Wm.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Wm),e.updateMatrixWorld(),$u.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix($u),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply($u)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let t={};return this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}};var Ih=class extends Ph{constructor(){super(new Fl(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},as=class extends Vl{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(cn.DEFAULT_UP),this.updateMatrix(),this.target=new cn,this.shadow=new Ih}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}};var Bh="\\[\\]\\.:\\/",Db=new RegExp("["+Bh+"]","g"),zh="[^"+Bh+"]",Cb="[^"+Bh.replace("\\.","")+"]",Rb=/((?:WC+[\/:])*)/.source.replace("WC",zh),Pb=/(WCOD+)?/.source.replace("WCOD",Cb),Ib=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",zh),Lb=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",zh),Fb=new RegExp("^"+Rb+Pb+Ib+Lb+"$"),Nb=["material","materials","bones","map"],Lh=class{constructor(t,e,n){let i=n||we.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(t,e)}setValue(t,e){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}},we=class r{constructor(t,e,n){this.path=e,this.parsedPath=n||r.parseTrackName(e),this.node=r.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new r.Composite(t,e,n):new r(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Db,"")}static parseTrackName(t){let e=Fb.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);Nb.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let n=t.skeleton.getBoneByName(e);if(n!==void 0)return n}if(t.children){let n=function(s){for(let o=0;o<s.length;o++){let a=s[o];if(a.name===e||a.uuid===e)return a;let l=n(a.children);if(l)return l}return null},i=n(t.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)t[e++]=n[i]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,s=e.propertyIndex;if(t||(t=r.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let c=e.objectIndex;switch(n){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let u=0;u<t.length;u++)if(t[u].name===c){c=u;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[n]}if(c!==void 0){if(t[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[c]}}let o=t[i];if(o===void 0){let c=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+i+" but it wasn't found.",t);return}let a=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[s]!==void 0&&(s=t.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};we.Composite=Lh;we.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};we.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};we.prototype.GetterByBindingType=[we.prototype._getValue_direct,we.prototype._getValue_array,we.prototype._getValue_arrayElement,we.prototype._getValue_toArray];we.prototype.SetterByBindingTypeAndVersioning=[[we.prototype._setValue_direct,we.prototype._setValue_direct_setNeedsUpdate,we.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[we.prototype._setValue_array,we.prototype._setValue_array_setNeedsUpdate,we.prototype._setValue_array_setMatrixWorldNeedsUpdate],[we.prototype._setValue_arrayElement,we.prototype._setValue_arrayElement_setNeedsUpdate,we.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[we.prototype._setValue_fromArray,we.prototype._setValue_fromArray_setNeedsUpdate,we.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var nw=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Fh}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Fh);var hg=()=>{var r=new fr;function t(){let e=document.querySelector("#canvas"),n=new Ol({canvas:e,antialias:!0,alpha:!0}),i=new zl,s=new Sn(18);s.near=1,s.far=2e3,s.position.z=-10,n.outputColorSpace=qn,n.shadowMap.enabled=!0,n.shadowMap.type=Nh,i.fog=new Bl(3741705,9,15),i.add(r);function o(){let u=new Hl(16777215,41378,1),h=new as(3355443,4);h.position.set(5,5,5),h.lookAt(0,0,0),h.castShadow=!0,h.shadow.mapSize.width=512,h.shadow.mapSize.height=512,h.shadow.camera.near=.5,h.shadow.camera.far=500,i.add(h),i.add(u);let f=[];f[0]=new as(16777215,1),f[0].position.set(1,0,0),f[1]=new as(11460838,1),f[1].position.set(.75,1,.5),f[2]=new as(14277490,1),f[2].position.set(-.75,-1,.5),i.add(f[0]),i.add(f[1]),i.add(f[2])}function a(u,h){let f=new Mi,d=[],_=[],g=h||25,m=g/2;for(let y=0;y<(u||7e3);y++){let S=Math.random()*g-m,D=Math.random()*g-m,A=Math.random()*g-m;d.push(S,D,A),_.push(Math.random()*.9+.1)}f.setAttribute("position",new Jn(d,3)),f.setAttribute("opacity",new Jn(_,1)),f.computeBoundingSphere();let p=new Kn({vertexShader:`
|
|
3822
3822
|
attribute float opacity; // Custom attribute for opacity
|
|
3823
3823
|
varying float vOpacity; // Varying to pass opacity to fragment shader
|
|
3824
3824
|
varying float distanceToCamera; // Varying to pass distance to camera
|
|
@@ -3843,7 +3843,7 @@ void main() {
|
|
|
3843
3843
|
// Combine alpha with opacity and distance factor
|
|
3844
3844
|
gl_FragColor = vec4(1.0, 1.0, 1.0, alpha * vOpacity * opacityFactor);
|
|
3845
3845
|
}
|
|
3846
|
-
`,blending:pr,transparent:!0});
|
|
3846
|
+
`,blending:pr,transparent:!0});p.needsUpdate=!0;let b=new kl(f,p);r.add(b)}function l(){requestAnimationFrame(l);let u=Date.now()*.003;r.rotation.z+=.001/4,r.rotation.y+=5e-4/4,r.position.y=Math.sin(u*.05)*.05,s.lookAt(i.position),s.updateMatrixWorld(),n.render(i,s)}function c(){let u=window.innerWidth,h=window.innerHeight;s.aspect=u/h,s.updateProjectionMatrix(),n.setSize(u,h)}a(),o(),c(),n.compile(i,s),l(),window.addEventListener("resize",c,!1)}window.addEventListener("load",t,!1)};window.Webflow||(window.Webflow=[]);window.Webflow.push(()=>{xp(),Jd(),Hh(),hg(),cp(),Zd(),Yd(),np(),Kd(),$d(),Qd(),jd(),tp(),ep()});})();
|
|
3847
3847
|
/*! Bundled license information:
|
|
3848
3848
|
|
|
3849
3849
|
gsap/gsap-core.js:
|