1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78532,(e,t,n)=>{t.exports=e.r(36828)},9960,e=>{"use strict";var t=e.i(50109),n=e.i(91983),i=e.i(78532);function r(){return"u">typeof window}function a(){return"production"}function s(){return"development"===((r()?window.vam:a())||"production")}function o(e){return RegExp(`/${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?=[/?#]|$)`)}function l(e){return(0,n.useEffect)(()=>{var t;e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),(0,n.useEffect)(()=>{!function(e={debug:!0}){var t;if(!r())return;!function(e="auto"){if("auto"===e){window.vam=a();return}window.vam=e}(e.mode),window.va||(window.va=function(...e){(window.vaq=window.vaq||[]).push(e)}),e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend));let n=e.scriptSrc?e.scriptSrc:s()?"https://va.vercel-scripts.com/v1/script.debug.js":e.basePath?`${e.basePath}/insights/script.js`:"/_vercel/insights/script.js";if(document.head.querySelector(`script[src*="${n}"]`))return;let i=document.createElement("script");i.src=n,i.defer=!0,i.dataset.sdkn="@vercel/analytics"+(e.framework?`/${e.framework}`:""),i.dataset.sdkv="1.6.1",e.disableAutoTrack&&(i.dataset.disableAutoTrack="1"),e.endpoint?i.dataset.endpoint=e.endpoint:e.basePath&&(i.dataset.endpoint=`${e.basePath}/insights`),e.dsn&&(i.dataset.dsn=e.dsn),i.onerror=()=>{let e=s()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${n}. ${e}`)},s()&&!1===e.debug&&(i.dataset.debug="false"),document.head.appendChild(i)}({framework:e.framework||"react",basePath:e.basePath??function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}(),...void 0!==e.route&&{disableAutoTrack:!0},...e})},[]),(0,n.useEffect)(()=>{e.route&&e.path&&function({route:e,path:t}){var n;null==(n=window.va)||n.call(window,"pageview",{route:e,path:t})}({route:e.route,path:e.path})},[e.route,e.path]),null}function c(e){let r,a,s,{route:c,path:u}=(r=(0,i.useParams)(),a=(0,i.useSearchParams)(),s=(0,i.usePathname)(),r?{route:function(e,t){if(!e||!t)return e;let n=e;try{let e=Object.entries(t);for(let[t,i]of e)if(!Array.isArray(i)){let e=o(i);e.test(n)&&(n=n.replace(e,`/[${t}]`))}for(let[t,i]of e)if(Array.isArray(i)){let e=o(i.join("/"));e.test(n)&&(n=n.replace(e,`/[...${t}]`))}return n}catch(t){return e}}(s,Object.keys(r).length?r:Object.fromEntries(a.entries())),path:s}:{route:null,path:s});return n.default.createElement(l,{path:u,route:c,...e,basePath:function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.NEXT_PUBLIC_VERCEL_OBSERVABILITY_BASEPATH}(),framework:"next"})}e.s(["Analytics",0,function(e){return n.default.createElement(n.Suspense,{fallback:null},n.default.createElement(c,{...e}))}])},14950,e=>{"use strict";var t=e.i(91983);function n(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var r,a,s,o,l,c,u,h,d,f,p,m,g,_,v,x,y,M,S,T,E,b,w,A,R,C,P={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},D={duration:.5,overwrite:!1,delay:0},L=2*Math.PI,U=L/4,N=0,I=Math.sqrt,O=Math.cos,F=Math.sin,B=function(e){return"string"==typeof e},z=function(e){return"function"==typeof e},k=function(e){return"number"==typeof e},V=function(e){return void 0===e},H=function(e){return"object"==typeof e},G=function(e){return!1!==e},W=function(){return"u">typeof window},X=function(e){return z(e)||B(e)},j="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},Y=Array.isArray,q=/random\([^)]+\)/g,K=/,\s*/g,Z=/(?:-?\.?\d|\.)+/gi,J=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,$=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Q=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,ee=/[+-]=-?[.\d]+/,et=/[^,'"\[\]\s]+/gi,en=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,ei={},er={},ea=function(e){return(er=eI(e,ei))&&nA},es=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},eo=function(e,t){return!t&&console.warn(e)},el=function(e,t){return e&&(ei[e]=t)&&er&&(er[e]=t)||ei},ec=function(){return 0},eu={suppressEvents:!0,isStart:!0,kill:!1},eh={suppressEvents:!0,kill:!1},ed={suppressEvents:!0},ef={},ep=[],em={},eg={},e_={},ev=30,ex=[],ey="",eM=function(e){var t,n,i=e[0];if(H(i)||z(i)||(e=[e]),!(t=(i._gsap||{}).harness)){for(n=ex.length;n--&&!ex[n].targetTest(i););t=ex[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new tG(e[n],t)))||e.splice(n,1);return e},eS=function(e){return e._gsap||eM(ta(e))[0]._gsap},eT=function(e,t,n){return(n=e[t])&&z(n)?e[t]():V(n)&&e.getAttribute&&e.getAttribute(t)||n}
1,eE=function(e,t){return(e=e.split(",")).forEach(t)||e},eb=function(e){return Math.round(1e5*e)/1e5||0},ew=function(e){return Math.round(1e7*e)/1e7||0},eA=function(e,t){var n=t.charAt(0),i=parseFloat(t.substr(2));return e=parseFloat(e),"+"===n?e+i:"-"===n?e-i:"*"===n?e*i:e/i},eR=function(e,t){for(var n=t.length,i=0;0>e.indexOf(t[i])&&++i<n;);return i<n},eC=function(){var e,t,n=ep.length,i=ep.slice(0);for(e=0,em={},ep.length=0;e<n;e++)(t=i[e])&&t._lazy&&(t.render(t._lazy[0],t._lazy[1],!0)._lazy=0)},eP=function(e){return!!(e._initted||e._startAt||e.add)},eD=function(e,t,n,i){ep.length&&!y&&eC(),e.render(t,n,i||!!(y&&t<0&&eP(e))),ep.length&&!y&&eC()},eL=function(e){var t=parseFloat(e);return(t||0===t)&&(e+"").match(et).length<2?t:B(e)?e.trim():e},eU=function(e){return e},eN=function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e},eI=function(e,t){for(var n in t)e[n]=t[n];return e},eO=function e(t,n){for(var i in n)"__proto__"!==i&&"constructor"!==i&&"prototype"!==i&&(t[i]=H(n[i])?e(t[i]||(t[i]={}),n[i]):n[i]);return t},eF=function(e,t){var n,i={};for(n in e)n in t||(i[n]=e[n]);return i},eB=function(e){var t,n=e.parent||S,i=e.keyframes?(t=Y(e.keyframes),function(e,n){for(var i in n)i in e||"duration"===i&&t||"ease"===i||(e[i]=n[i])}):eN;if(G(e.inherit))for(;n;)i(e,n.vars.defaults),n=n.parent||n._dp;return e},ez=function(e,t){for(var n=e.length,i=n===t.length;i&&n--&&e[n]===t[n];);return n<0},ek=function(e,t,n,i,r){void 0===n&&(n="_first"),void 0===i&&(i="_last");var a,s=e[i];if(r)for(a=t[r];s&&s[r]>a;)s=s._prev;return s?(t._next=s._next,s._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[i]=t,t._prev=s,t.parent=t._dp=e,t},eV=function(e,t,n,i){void 0===n&&(n="_first"),void 0===i&&(i="_last");var r=t._prev,a=t._next;r?r._next=a:e[n]===t&&(e[n]=a),a?a._prev=r:e[i]===t&&(e[i]=r),t._next=t._prev=t.parent=null},eH=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},eG=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},eW=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},eX=function(e,t,n,i){return e._startAt&&(y?e._startAt.revert(eh):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,i))},ej=function(e){return e._repeat?eY(e._tTime,e=e.duration()+e._rDelay)*e:0},eY=function(e,t){var n=Math.floor(e=ew(e/t));return e&&n===e?n-1:n},eq=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},eK=function(e){return e._end=ew(e._start+(e._tDur/Math.abs(e._ts||e._rts||1e-8)||0))},eZ=function(e,t){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=ew(n._time-(e._ts>0?t/e._ts:-(((e._dirty?e.totalDuration():e._tDur)-t)/e._ts))),eK(e),n._dirty||eG(n,e)),e},eJ=function(e,t){var n;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(n=eq(e.rawTime(),t),(!t._dur||tt(0,t.totalDuration(),n)-t._tTime>1e-8)&&t.render(n,!0)),eG(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(n=e;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-1e-8}},e$=function(e,t,n,i){return t.parent&&eH(t),t._start=ew((k(n)?n:n||e!==S?e9(e,n,t):e._time)+t._delay),t._end=ew(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),ek(e,t,"_first","_last",e._sort?"_start":0),e3(t)||(e._recent=t),i||eJ(e,t),e._ts<0&&eZ(e,e._tTime),e},eQ=function(e,t){return(ei.ScrollTrigger||es("scrollTrigger",t))&&ei.ScrollTrigger.create(t,e)},e0=function(e,t,n,i,r){return(t3(e,t,r),e._initted)?!n&&e._pt&&!y&&(e._dur&&!1!==e.vars.lazy||!e._dur&&e.vars.lazy)&&A!==tR.frame?(ep.push(e),e._lazy=[r,i],1):void 0:1},e1=function e(t){var n=t.parent;return n&&n._ts&&n._initted&&!n._lock&&(0>n.rawTime()||e(n))},e3=function(e){var t=e.data;return"isFromStart"===t||"isStart"===t},e2=function(e,t,n,i){var r,a,s,o=e.ratio,l=t<0||!t&&(!e._start&&e1(e)&&!(!e._initted&&e3(e))||(e._ts<0||e._dp._ts<0)&&!e3(e))?0:1,c=e._rDelay,u=0;if(c&&e._repeat&&(a=eY(u=tt(0,e._tDur,t),c),e._yoyo&&1&a&&(l=1-l),a!==eY(e._tTime,c)&&(o=1-l,e.vars.repeatRefresh&&e._initted&&e.invali
1date())),l!==o||y||i||1e-8===e._zTime||!t&&e._zTime){if(!e._initted&&e0(e,t,i,n,u))return;for(s=e._zTime,e._zTime=t||1e-8*!!n,n||(n=t&&!s),e.ratio=l,e._from&&(l=1-l),e._time=0,e._tTime=u,r=e._pt;r;)r.r(l,r.d),r=r._next;t<0&&eX(e,t,n,!0),e._onUpdate&&!n&&tg(e,"onUpdate"),u&&e._repeat&&!n&&e.parent&&tg(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===l&&(l&&eH(e,1),n||y||(tg(e,l?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},e4=function(e,t,n){var i;if(n>t)for(i=e._first;i&&i._start<=n;){if("isPause"===i.data&&i._start>t)return i;i=i._next}else for(i=e._last;i&&i._start>=n;){if("isPause"===i.data&&i._start<t)return i;i=i._prev}},e5=function(e,t,n,i){var r=e._repeat,a=ew(t)||0,s=e._tTime/e._tDur;return s&&!i&&(e._time*=a/e._dur),e._dur=a,e._tDur=r?r<0?1e10:ew(a*(r+1)+e._rDelay*r):a,s>0&&!i&&eZ(e,e._tTime=e._tDur*s),e.parent&&eK(e),n||eG(e.parent,e),e},e6=function(e){return e instanceof tX?eG(e):e5(e,e._dur)},e8={_start:0,endTime:ec,totalDuration:ec},e9=function e(t,n,i){var r,a,s,o=t.labels,l=t._recent||e8,c=t.duration()>=1e8?l.endTime(!1):t._dur;return B(n)&&(isNaN(n)||n in o)?(a=n.charAt(0),s="%"===n.substr(-1),r=n.indexOf("="),"<"===a||">"===a)?(r>=0&&(n=n.replace(/=/,"")),("<"===a?l._start:l.endTime(l._repeat>=0))+(parseFloat(n.substr(1))||0)*(s?(r<0?l:i).totalDuration()/100:1)):r<0?(n in o||(o[n]=c),o[n]):(a=parseFloat(n.charAt(r-1)+n.substr(r+1)),s&&i&&(a=a/100*(Y(i)?i[0]:i).totalDuration()),r>1?e(t,n.substr(0,r-1),i)+a:c+a):null==n?c:+n},e7=function(e,t,n){var i,r,a=k(t[1]),s=(a?2:1)+(e<2?0:1),o=t[s];if(a&&(o.duration=t[1]),o.parent=n,e){for(i=o,r=n;r&&!("immediateRender"in i);)i=r.vars.defaults||{},r=G(r.vars.inherit)&&r.parent;o.immediateRender=G(i.immediateRender),e<2?o.runBackwards=1:o.startAt=t[s-1]}return new t7(t[0],o,t[s+1])},te=function(e,t){return e||0===e?t(e):t},tt=function(e,t,n){return n<e?e:n>t?t:n},tn=function(e,t){return B(e)&&(t=en.exec(e))?t[1]:""},ti=[].slice,tr=function(e,t){return e&&H(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&H(e[0]))&&!e.nodeType&&e!==T},ta=function(e,t,n){var i;return M&&!t&&M.selector?M.selector(e):B(e)&&!n&&(E||!tC())?ti.call((t||b).querySelectorAll(e),0):Y(e)?(void 0===i&&(i=[]),e.forEach(function(e){var t;return B(e)&&!n||tr(e,1)?(t=i).push.apply(t,ta(e)):i.push(e)})||i):tr(e)?ti.call(e,0):e?[e]:[]},ts=function(e){return e=ta(e)[0]||eo("Invalid scope")||{},function(t){var n=e.current||e.nativeElement||e;return ta(t,n.querySelectorAll?n:n===e?eo("Invalid scope")||b.createElement("div"):e)}},to=function(e){return e.sort(function(){return .5-Math.random()})},tl=function(e){if(z(e))return e;var t=H(e)?e:{each:e},n=tB(t.ease),i=t.from||0,r=parseFloat(t.base)||0,a={},s=i>0&&i<1,o=isNaN(i)||s,l=t.axis,c=i,u=i;return B(i)?c=u=({center:.5,edges:.5,end:1})[i]||0:!s&&o&&(c=i[0],u=i[1]),function(e,s,h){var d,f,p,m,g,_,v,x,y,M=(h||t).length,S=a[M];if(!S){if(!(y="auto"===t.grid?0:(t.grid||[1,1e8])[1])){for(v=-1e8;v<(v=h[y++].getBoundingClientRect().left)&&y<M;);y<M&&y--}for(_=0,S=a[M]=[],d=o?Math.min(y,M)*c-.5:i%y,f=1e8===y?0:o?M*u/y-.5:i/y|0,v=0,x=1e8;_<M;_++)p=_%y-d,m=f-(_/y|0),S[_]=g=l?Math.abs("y"===l?m:p):I(p*p+m*m),g>v&&(v=g),g<x&&(x=g);"random"===i&&to(S),S.max=v-x,S.min=x,S.v=M=(parseFloat(t.amount)||parseFloat(t.each)*(y>M?M-1:l?"y"===l?M/y:y:Math.max(y,M/y))||0)*("edges"===i?-1:1),S.b=M<0?r-M:r,S.u=tn(t.amount||t.each)||0,n=n&&M<0?tO(n):n}return M=(S[e]-S.min)/S.max||0,ew(S.b+(n?n(M):M)*S.v)+S.u}},tc=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(n){var i=ew(Math.round(parseFloat(n)/e)*e*t);return(i-i%1)/t+(k(n)?0:tn(n))}},tu=function(e,t){var n,i,r=Y(e);return!r&&H(e)&&(n=r=e.radius||1e8,e.values?(i=!k((e=ta(e.values))[0]))&&(n*=n):e=tc(e.increment)),te(t,r?z(e)?function(t){return Math.abs((i=e(t))-t)<=n?i:t}:function(t){for(var r,a,s=parseFloat(i?t.x:t),o=parseFloat(i?t.y:0),l=1e8,c=0,u=e.length;u--;)(r=i?(r=e[u].x-s)*r+(a=e[u].y-o)*a:Math.abs(e[u]-s))<l&&(l=r,c=u);return c=!n||l<=n?e[c]:t,i||c===t||k(t)?c:c+tn(t)}:tc(e))},th=function(e,t,n,i){return te(Y(e)?!t:!0===n?(n=0,!1):!i,function(){return Y(e)?e[~~(Math.random()*e.length)]:(i=(n=n||1e-5)<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((e-n/2+Math.random()*(t-e+.99*n))/n)
1*n*i)/i})},td=function(e,t,n){return te(n,function(n){return e[~~t(n)]})},tf=function(e){return e.replace(q,function(e){var t=e.indexOf("[")+1,n=e.substring(t||7,t?e.indexOf("]"):e.length-1).split(K);return th(t?n:+n[0],t?0:+n[1],+n[2]||1e-5)})},tp=function(e,t,n,i,r){var a=t-e,s=i-n;return te(r,function(t){return n+((t-e)/a*s||0)})},tm=function(e,t,n){var i,r,a,s=e.labels,o=1e8;for(i in s)(r=s[i]-t)<0==!!n&&r&&o>(r=Math.abs(r))&&(a=i,o=r);return a},tg=function(e,t,n){var i,r,a,s=e.vars,o=s[t],l=M,c=e._ctx;if(o)return i=s[t+"Params"],r=s.callbackScope||e,n&&ep.length&&eC(),c&&(M=c),a=i?o.apply(r,i):o.call(r),M=l,a},t_=function(e){return eH(e),e.scrollTrigger&&e.scrollTrigger.kill(!!y),1>e.progress()&&tg(e,"onInterrupt"),e},tv=[],tx=function(e){if(e)if(e=!e.name&&e.default||e,W()||e.headless){var t=e.name,n=z(e),i=t&&!n&&e.init?function(){this._props=[]}:e,r={init:ec,render:nl,add:tQ,kill:nu,modifier:nc,rawVars:0},a={targetTest:0,get:0,getSetter:nr,aliases:{},register:0};if(tC(),e!==i){if(eg[t])return;eN(i,eN(eF(e,r),a)),eI(i.prototype,eI(r,eF(e,a))),eg[i.prop=t]=i,e.targetTest&&(ex.push(i),ef[t]=1),t=("css"===t?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}el(t,i),e.register&&e.register(nA,i,nf)}else tv.push(e)},ty={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},tM=function(e,t,n){return(6*(e+=e<0?1:e>1?-1:0)<1?t+(n-t)*e*6:e<.5?n:3*e<2?t+(n-t)*(2/3-e)*6:t)*255+.5|0},tS=function(e,t,n){var i,r,a,s,o,l,c,u,h,d,f=e?k(e)?[e>>16,e>>8&255,255&e]:0:ty.black;if(!f){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),ty[e])f=ty[e];else if("#"===e.charAt(0)){if(e.length<6&&(i=e.charAt(1),e="#"+i+i+(r=e.charAt(2))+r+(a=e.charAt(3))+a+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(f=parseInt(e.substr(1,6),16))>>16,f>>8&255,255&f,parseInt(e.substr(7),16)/255];f=[(e=parseInt(e.substr(1),16))>>16,e>>8&255,255&e]}else if("hsl"===e.substr(0,3))if(f=d=e.match(Z),t){if(~e.indexOf("="))return f=e.match(J),n&&f.length<4&&(f[3]=1),f}else s=f[0]%360/360,o=f[1]/100,r=(l=f[2]/100)<=.5?l*(o+1):l+o-l*o,i=2*l-r,f.length>3&&(f[3]*=1),f[0]=tM(s+1/3,i,r),f[1]=tM(s,i,r),f[2]=tM(s-1/3,i,r);else f=e.match(Z)||ty.transparent;f=f.map(Number)}return t&&!d&&(i=f[0]/255,l=((c=Math.max(i,r=f[1]/255,a=f[2]/255))+(u=Math.min(i,r,a)))/2,c===u?s=o=0:(h=c-u,o=l>.5?h/(2-c-u):h/(c+u),s=(c===i?(r-a)/h+6*(r<a):c===r?(a-i)/h+2:(i-r)/h+4)*60),f[0]=~~(s+.5),f[1]=~~(100*o+.5),f[2]=~~(100*l+.5)),n&&f.length<4&&(f[3]=1),f},tT=function(e){var t=[],n=[],i=-1;return e.split(tb).forEach(function(e){var r=e.match($)||[];t.push.apply(t,r),n.push(i+=r.length+1)}),t.c=n,t},tE=function(e,t,n){var i,r,a,s,o="",l=(e+o).match(tb),c=t?"hsla(":"rgba(",u=0;if(!l)return e;if(l=l.map(function(e){return(e=tS(e,t,1))&&c+(t?e[0]+","+e[1]+"%,"+e[2]+"%,"+e[3]:e.join(","))+")"}),n&&(a=tT(e),(i=n.c).join(o)!==a.c.join(o)))for(s=(r=e.replace(tb,"1").split($)).length-1;u<s;u++)o+=r[u]+(~i.indexOf(u)?l.shift()||c+"0,0,0,0)":(a.length?a:l.length?l:n).shift());if(!r)for(s=(r=e.split(tb)).length-1;u<s;u++)o+=r[u]+l[u];return o+r[s]},tb=function(){var e,t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(e in ty)t+="|"+e+"\\b";return RegExp(t+")","gi")}(),tw=/hsl[a]?\(/,tA=function(e){var t,n=e.join(" ");if(tb.lastIndex=0,tb.test(n))return t=tw.test(n),e[1]=tE(e[1],t),e[0]=tE(e[0],t,tT(e[1])),!0},tR=(u=Date.now,h=500,d=33,p=f=u(),m=1e3/240,g=1e3/240,_=[],v=function e(t){var n,i,s,v,x=u()-p,y=!0===t;if((x>h||x<0)&&(f+=x-d),p+=x,((n=(s=p-f)-g)>0||y)&&(v=++o.frame,l=s-1e3*o.time,o.time=s/=1e3,g+=n+(n>=m?4:m-n),i=1),y||(r=a(e)),i)for(c=0;c<_.length;c++)_[c](s,l,v,t)},o={time:0,frame:0,tick:function(){v(!0)},deltaRatio:function(e){return l/(1e3/(e||60))},wake:function(){w&&(!E&&W()&&(b=(T=E=window).document||{},ei.gsap=nA,(T.gsapVersions||(T.gsapVersions=[])).push(nA.version),ea(er||T.GreenSockGlobals||!T.gsap&&T||{}),tv.forEach(tx)),s="u">typeof requestAnimationFrame&&requestAnimationFrame,r&&o.sleep(),a=s||function(e){return setTimeout(e,g-1e3*o.time+1|0)},C=1,v(2))},sleep:function(){(s?cancelAnimationFrame:clearTimeout)(r),C=0,a=ec},lagSmoothing:function(e,t){d=Math.min(t||33,h=e||1/0)},fps:function(e){m=1e3/(e||240),g=1e3*o.time+m},add:function(e,t,n){var i=t?function(t,n,r,a){e(t,n,r,a),o.remove(i)}:e;return o.remove(e),_[n?"unshift":"push"](i),tC(),i},remove:function(e,t){~(t=_.indexOf(e))&&_.splice(t,1)&&c>=t&&c--},_listeners:_}),tC=function(){return!C&&tR.wake()},tP={},tD=/^[\d.\-M][\d.\-,\s]/,tL=/["']/g,tU=function(e){for(var t,n,i,r={},a=e.substr(1,e.length-3).split(":"),s=a[0],o=1,l=a.length;o<l;o++)n=a[o],t=o!==l-1?n.lastIndexOf(","):n.length,i=n.substr(0,t),r[s]=isNaN(i)?i.replace(tL,"").trim():+i,s=n.substr(t+1).trim();return r},tN=function(e){var t=e.indexOf("(")+1,n=e.indexOf(")"),i=e.indexOf("(",t);return e.substring(t,~i&&i<n?e.indexOf(")",n+1):n)},tI=function(e){var t=(e+"").split("("),n=tP[t[0]];return n&&t.length>1&&n.config?n.config.apply(null,~e.indexOf("{")?[tU(t[1])]:tN(e).split(",").map(eL)):tP._CE&&tD.test(e)?tP._CE("",e):n},tO=function(e){return function(t){return 1-e(1-t)}},tF=function e(t,n){for(var i,r=t._first;r;)r instanceof tX?e(r,n):!r.vars.yoyoEase||r._yoyo&&r._repeat||r._yoyo===n||(r.timeline?e(r.timeline,n):(i=r._ease,r._ease=r._yEase,r._yEase=i,r._yoyo=n)),r=r._next},tB=function(e,t){return e&&(z(e)?e:tP[e]||tI(e))||t},tz=function(e,t,n,i){void 0===n&&(n=function(e){return 1-t(1-e)}),void 0===i&&(i=function(e){return e<.5?t(2*e)/2:1-t((1-e)*2)/2});var r,a={easeIn:t,easeOut:n,easeInOut:i};return eE(e,function(e){for(var t in tP[e]=ei[e]=a,tP[r=e.toLowerCase()]=n,a)tP[r+("easeIn"===t?".in":"easeOut"===t?".out":".inOut")]=tP[e+"."+t]=a[t]}),a},tk=function(e){return function(t){return t<.5?(1-e(1-2*t))/2:.5+e((t-.5)*2)/2}},tV=function e(t,n,i){var r=n>=1?n:1,a=(i||(t?.3:.45))/(n<1?n:1),s=a/L*(Math.asin(1/r)||0),o=function(e){return 1===e?1:r*Math.pow(2,-10*e)*F((e-s)*a)+1},l="out"===t?o:"in"===t?function(e){return 1-o(1-e)}:tk(o);return a=L/a,l.config=function(n,i){return e(t,n,i)},l},tH=function e(t,n){void 0===n&&(n=1.70158);var i=function(e){return e?--e*e*((n+1)*e+n)+1:0},r="out"===t?i:"in"===t?function(e){return 1-i(1-e)}:tk(i);return r.config=function(n){return e(t,n)},r};eE("Linear,Quad,Cubic,Quart,Quint,Strong",function(e,t){var n=t<5?t+1:t;tz(e+",Power"+(n-1),t?function(e){return Math.pow(e,n)}:function(e){return e},function(e){return 1-Math.pow(1-e,n)},function(e){return e<.5?Math.pow(2*e,n)/2:1-Math.pow((1-e)*2,n)/2})}),tP.Linear.easeNone=tP.none=tP.Linear.easeIn,tz("Elastic",tV("in"),tV("out"),tV()),tY=2*(tj=1/2.75),tq=2.5*tj,tz("Bounce",function(e){return 1-tK(1-e)},tK=function(e){return e<tj?7.5625*e*e:e<tY?7.5625*Math.pow(e-1.5/2.75,2)+.75:e<tq?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*Math.pow(e-2.625/2.75,2)+.984375}),tz("Expo",function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)}),tz("Circ",function(e){return-(I(1-e*e)-1)}),tz("Sine",function(e){return 1===e?1:-O(e*U)+1}),tz("Back",tH("in"),tH("out"),tH()),tP.SteppedEase=tP.steps=ei.SteppedEase={config:function(e,t){void 0===e&&(e=1);var n=1/e,i=e+ +!t,r=+!!t,a=.99999999;return function(e){return((i*tt(0,a,e)|0)+r)*n}}},D.ease=tP["quad.out"],eE("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(e){return ey+=e+","+e+"Params,"});var tG=function(e,t){this.id=N++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:eT,this.set=t?t.getSetter:nr},tW=function(){function e(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,e5(this,+e.duration,1,1),this.data=e.data,M&&(this._ctx=M,M.data.push(this)),C||tR.wake()}var t=e.prototype;return t.delay=function(e){return e||0===e?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+e-this._delay),this._delay=e,this):this._delay},t.duration=function(e){return arguments.length?this.totalDuration(this._repeat>0?e+(e+this._rDelay)*this._repeat:e):this.totalDuration()&&this._dur},t.totalDuration=function(e){return arguments.length?(this._dirty=0,e5(this,this._repeat<0?e:(e-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(e,t){if(tC(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(eZ(this,e),!n._dp||n.parent||eJ(n,this);n&&n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:-((n.totalDuration()-n._tTime)/n._ts))&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&e<this._tDur||this._ts<0&&e>0||!this._tDur&&!e)&&e$(this._dp,this,this._start-this._delay)}return(this._tTime!==e||!this._dur&&!t||this._initted&&1e-8===Math.abs(this._zTime)||!this._initted&&this._dur&&e||!e&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=e),eD(this,e,t)),this},t.time=function(e,t){return arguments.length?this.totalTime(Math.min(this.totalDuration(),e+ej(this))%(this._dur+this._rDelay)||(e?this._dur:0),t):this._time},t.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(1&this.iteration())?1-e:e)+ej(this),t):this.duration()?Math.min(1,this._time/this._dur):+(this.rawTime()>0)},t.iteration=function(e,t){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(e-1)*n,t):this._repeat?eY(this._tTime,n)+1:1},t.timeScale=function(e,t){if(!arguments.length)return -1e-8===this._rts?0:this._rts;if(this._rts===e)return this;var n=this.parent&&this._ts?eq(this.parent._time,this):this._tTime;return this._rts=+e||0,this._ts=this._ps||-1e-8===e?0:this._rts,this.totalTime(tt(-Math.abs(this._delay),this.totalDuration(),n),!1!==t),eK(this),eW(this)},t.paused=function(e){return arguments.length?(this._ps!==e&&(this._ps=e,e?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(tC(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&1e-8!==Math.abs(this._zTime)&&(this._tTime-=1e-8)))),this):this._ps},t.startTime=function(e){if(arguments.length){this._start=ew(e);var t=this.parent||this._dp;return t&&(t._sort||!this.parent)&&e$(t,this,this._start-this._delay),this}return this._start},t.endTime=function(e){return this._start+(G(e)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(e){var t=this.parent||this._dp;return t?e&&(!this._ts||this._repeat&&this._time&&1>this.totalProgress())?this._tTime%(this._dur+this._rDelay):this._ts?eq(t.rawTime(e),this):this._tTime:this._tTime},t.revert=function(e){void 0===e&&(e=ed);var t=y;return y=e,eP(this)&&(this.timeline&&this.timeline.revert(e),this.totalTime(-.01,e.suppressEvents)),"nested"!==this.data&&!1!==e.kill&&this.kill(),y=t,this},t.globalTime=function(e){for(var t=this,n=arguments.length?e:t.rawTime();t;)n=t._start+n/(Math.abs(t._ts)||1),t=t._dp;return!this.parent&&this._sat?this._sat.globalTime(e):n},t.repeat=function(e){return arguments.length?(this._repeat=e===1/0?-2:e,e6(this)):-2===this._repeat?1/0:this._repeat},t.repeatDelay=function(e){if(arguments.length){var t=this._time;return this._rDelay=e,e6(this),t?this.time(t):this}return this._rDelay},t.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},t.seek=function(e,t){return this.totalTime(e9(this,e),G(t))},t.restart=function(e,t){return this.play().totalTime(e?-this._delay:0,G(t)),this._dur||(this._zTime=-1e-8),this},t.play=function(e,t){return null!=e&&this.seek(e,t),this.reversed(!1).paused(!1)},t.reverse=function(e,t){return null!=e&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},t.pause=function(e,t){return null!=e&&this.seek(e,t),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(e){return arguments.length?(!!e!==this.reversed()&&this.timeScale(-this._rts||(e?-1e-8:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},t.isActive=function(){var e,t=this.parent||this._dp,n=this._start;return!!(!t||this._ts&&this._initted&&t.isActive()&&(e=t.rawTime(!0))>=n&&e<this.endTime(!0)-1e-8)},t.eventCallback=function(e,t,n){var i=this.vars;return arguments.length>
vendor: 4,104 bytes, line 1
11?(t?(i[e]=t,n&&(i[e+"Params"]=n),"onUpdate"===e&&(this._onUpdate=t)):delete i[e],this):i[e]},t.then=function(e){var t=this,n=t._prom;return new Promise(function(i){var r=z(e)?e:eU,a=function(){var e=t.then;t.then=null,n&&n(),z(r)&&(r=r(t))&&(r.then||r===t)&&(t.then=e),i(r),t.then=e};t._initted&&1===t.totalProgress()&&t._ts>=0||!t._tTime&&t._ts<0?a():t._prom=a})},t.kill=function(){t_(this)},e}();eN(tW.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var tX=function(e){function t(t,i){var r;return void 0===t&&(t={}),(r=e.call(this,t)||this).labels={},r.smoothChildTiming=!!t.smoothChildTiming,r.autoRemoveChildren=!!t.autoRemoveChildren,r._sort=G(t.sortChildren),S&&e$(t.parent||S,n(r),i),t.reversed&&r.reverse(),t.paused&&r.paused(!0),t.scrollTrigger&&eQ(n(r),t.scrollTrigger),r}i(t,e);var r=t.prototype;return r.to=function(e,t,n){return e7(0,arguments,this),this},r.from=function(e,t,n){return e7(1,arguments,this),this},r.fromTo=function(e,t,n,i){return e7(2,arguments,this),this},r.set=function(e,t,n){return t.duration=0,t.parent=this,eB(t).repeatDelay||(t.repeat=0),t.immediateRender=!!t.immediateRender,new t7(e,t,e9(this,n),1),this},r.call=function(e,t,n){return e$(this,t7.delayedCall(0,e,t),n)},r.staggerTo=function(e,t,n,i,r,a,s){return n.duration=t,n.stagger=n.stagger||i,n.onComplete=a,n.onCompleteParams=s,n.parent=this,new t7(e,n,e9(this,r)),this},r.staggerFrom=function(e,t,n,i,r,a,s){return n.runBackwards=1,eB(n).immediateRender=G(n.immediateRender),this.staggerTo(e,t,n,i,r,a,s)},r.staggerFromTo=function(e,t,n,i,r,a,s,o){return i.startAt=n,eB(i).immediateRender=G(i.immediateRender),this.staggerTo(e,t,i,r,a,s,o)},r.render=function(e,t,n){var i,r,a,s,o,l,c,u,h,d,f,p,m=this._time,g=this._dirty?this.totalDuration():this._tDur,_=this._dur,v=e<=0?0:ew(e),x=this._zTime<0!=e<0&&(this._initted||!_);if(this!==S&&v>g&&e>=0&&(v=g),v!==this._tTime||n||x){if(m!==this._time&&_&&(v+=this._time-m,e+=this._time-m),i=v,h=this._start,l=!(u=this._ts),x&&(_||(m=this._zTime),(e||!t)&&(this._zTime=e)),this._repeat){if(f=this._yoyo,o=_+this._rDelay,this._repeat<-1&&e<0)return this.totalTime(100*o+e,t,n);if(i=ew(v%o),v===g?(s=this._repeat,i=_):((s=~~(d=ew(v/o)))&&s===d&&(i=_,s--),i>_&&(i=_)),d=eY(this._tTime,o),!m&&this._tTime&&d!==s&&this._tTime-d*o-this._dur<=0&&(d=s),f&&1&s&&(i=_-i,p=1),s!==d&&!this._lock){var M=f&&1&d,T=M===(f&&1&s);if(s<d&&(M=!M),m=M?0:v%_?_:v,this._lock=1,this.render(m||(p?0:ew(s*o)),t,!_)._lock=0,this._tTime=v,!t&&this.parent&&tg(this,"onRepeat"),this.vars.repeatRefresh&&!p&&(this.invalidate()._lock=1,d=s),m&&m!==this._time||!this._ts!==l||this.vars.onRepeat&&!this.parent&&!this._act||(_=this._dur,g=this._tDur,T&&(this._lock=2,m=M?_:-1e-4,this.render(m,!0),this.vars.repeatRefresh&&!p&&this.invalidate()),this._lock=0,!this._ts&&!l))return this;tF(this,p)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(c=e4(this,ew(m),ew(i)))&&(v-=i-(i=c._start)),this._tTime=v,this._time=i,this._act=!u,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=e,m=0),!m&&v&&_&&!t&&!d&&(tg(this,"onStart"),this._tTime!==v))return this;if(i>=m&&e>=0)for(r=this._first;r;){if(a=r._next,(r._act||i>=r._start)&&r._ts&&c!==r){if(r.parent!==this)return this.render(e,t,n);if(r.render(r._ts>0?(i-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(i-r._start)*r._ts,t,n),i!==this._time||!this._ts&&!l){c=0,a&&(v+=this._zTime=-1e-8);break}}r=a}else{r=this._last;for(var E=e<0?e:i;r;){if(a=r._prev,(r._act||E<=r._end)&&r._ts&&c!==r){if(r.parent!==this)return this.render(e,t,n);if(r.render(r._ts>0?(E-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(E-r._start)*r._ts,t,n||y&&eP(r)),i!==this._time||!this._ts&&!l){c=0,a&&(v+=this._zTime=E?-1e-8:1e-8);break}}r=a}}if(c&&!t&&(this.pause(),c.render(i>=m?0:-1e-8)._zTime=i>=m?1:-1,this._ts))return this._start=h,eK(this),this.render(e,t,n);this._onUpdate&&!t&&tg(this,"onUpdate",!0),(v===g&&this._tTime>=this.totalDuration()||!v&&m)&&(h===this._start||Math.abs(u)!==Math.abs(this._ts
vendor: 8,827 bytes, line 1
1))&&!this._lock&&((e||!_)&&(v===g&&this._ts>0||!v&&this._ts<0)&&eH(this,1),t||e<0&&!m||!v&&!m&&g||(tg(this,v===g&&e>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(v<g&&this.timeScale()>0)&&this._prom()))}return this},r.add=function(e,t){var n=this;if(k(t)||(t=e9(this,t,e)),!(e instanceof tW)){if(Y(e))return e.forEach(function(e){return n.add(e,t)}),this;if(B(e))return this.addLabel(e,t);if(!z(e))return this;e=t7.delayedCall(0,e)}return this!==e?e$(this,e,t):this},r.getChildren=function(e,t,n,i){void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===n&&(n=!0),void 0===i&&(i=-1e8);for(var r=[],a=this._first;a;)a._start>=i&&(a instanceof t7?t&&r.push(a):(n&&r.push(a),e&&r.push.apply(r,a.getChildren(!0,t,n)))),a=a._next;return r},r.getById=function(e){for(var t=this.getChildren(1,1,1),n=t.length;n--;)if(t[n].vars.id===e)return t[n]},r.remove=function(e){return B(e)?this.removeLabel(e):z(e)?this.killTweensOf(e):(e.parent===this&&eV(this,e),e===this._recent&&(this._recent=this._last),eG(this))},r.totalTime=function(t,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=ew(tR.time-(this._ts>0?t/this._ts:-((this.totalDuration()-t)/this._ts)))),e.prototype.totalTime.call(this,t,n),this._forcing=0,this):this._tTime},r.addLabel=function(e,t){return this.labels[e]=e9(this,t),this},r.removeLabel=function(e){return delete this.labels[e],this},r.addPause=function(e,t,n){var i=t7.delayedCall(0,t||ec,n);return i.data="isPause",this._hasPause=1,e$(this,i,e9(this,e))},r.removePause=function(e){var t=this._first;for(e=e9(this,e);t;)t._start===e&&"isPause"===t.data&&eH(t),t=t._next},r.killTweensOf=function(e,t,n){for(var i=this.getTweensOf(e,n),r=i.length;r--;)tZ!==i[r]&&i[r].kill(e,t);return this},r.getTweensOf=function(e,t){for(var n,i=[],r=ta(e),a=this._first,s=k(t);a;)a instanceof t7?eR(a._targets,r)&&(s?(!tZ||a._initted&&a._ts)&&a.globalTime(0)<=t&&a.globalTime(a.totalDuration())>t:!t||a.isActive())&&i.push(a):(n=a.getTweensOf(r,t)).length&&i.push.apply(i,n),a=a._next;return i},r.tweenTo=function(e,t){t=t||{};var n,i=this,r=e9(i,e),a=t,s=a.startAt,o=a.onStart,l=a.onStartParams,c=a.immediateRender,u=t7.to(i,eN({ease:t.ease||"none",lazy:!1,immediateRender:!1,time:r,overwrite:"auto",duration:t.duration||Math.abs((r-(s&&"time"in s?s.time:i._time))/i.timeScale())||1e-8,onStart:function(){if(i.pause(),!n){var e=t.duration||Math.abs((r-(s&&"time"in s?s.time:i._time))/i.timeScale());u._dur!==e&&e5(u,e,0,1).render(u._time,!0,!0),n=1}o&&o.apply(u,l||[])}},t));return c?u.render(0):u},r.tweenFromTo=function(e,t,n){return this.tweenTo(t,eN({startAt:{time:e9(this,e)}},n))},r.recent=function(){return this._recent},r.nextLabel=function(e){return void 0===e&&(e=this._time),tm(this,e9(this,e))},r.previousLabel=function(e){return void 0===e&&(e=this._time),tm(this,e9(this,e),1)},r.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+1e-8)},r.shiftChildren=function(e,t,n){void 0===n&&(n=0);var i,r=this._first,a=this.labels;for(e=ew(e);r;)r._start>=n&&(r._start+=e,r._end+=e),r=r._next;if(t)for(i in a)a[i]>=n&&(a[i]+=e);return eG(this)},r.invalidate=function(t){var n=this._first;for(this._lock=0;n;)n.invalidate(t),n=n._next;return e.prototype.invalidate.call(this,t)},r.clear=function(e){void 0===e&&(e=!0);for(var t,n=this._first;n;)t=n._next,this.remove(n),n=t;return this._dp&&(this._time=this._tTime=this._pTime=0),e&&(this.labels={}),eG(this)},r.totalDuration=function(e){var t,n,i,r=0,a=this._last,s=1e8;if(arguments.length)return this.timeScale((this._repeat<0?this.duration():this.totalDuration())/(this.reversed()?-e:e));if(this._dirty){for(i=this.parent;a;)t=a._prev,a._dirty&&a.totalDuration(),(n=a._start)>s&&this._sort&&a._ts&&!this._lock?(this._lock=1,e$(this,a,n-a._delay,1)._lock=0):s=n,n<0&&a._ts&&(r-=n,(!i&&!this._dp||i&&i.smoothChildTiming)&&(this._start+=ew(n/this._ts),this._time-=n,this._tTime-=n),this.shiftChildren(-n,!1,-Infinity),s=0),a._end>r&&a._ts&&(r=a._end),a=t;e5(this,this===S&&this._time>r?this._time:r,1,1),this._dirty=0}return this._tDur},t.updateRoot=function(e){if(S._ts&&(eD(S,eq(e,S)),A=tR.frame),tR.frame>=ev){ev+=P.autoSleep||120;var t=S._first;if((!t||!t._ts)&&P.autoSleep&&tR._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||tR.sleep()}}},t}(tW);eN(tX.prototype,{_lock:0,_hasPause:0,_forcing:0});var tj,tY,tq,tK,tZ,tJ,t$=function(e,t,n,i,r,a,s){var o,l,c,u,h,d,f,p,m=new nf(this._pt,e,t,0,1,no,null,r),g=0,_=0;for(m.b=n,m.e=i,n+="",i+="",(f=~i.indexOf("random("))&&(i=tf(i)),a&&(a(p=[n,i],e,t),n=p[0],i=p[1]),l=n.match(Q)||[];o=Q.exec(i);)u=o[0],h=i.substring(g,o.index),c?c=(c+1)%5:"rgba("===h.substr(-5)&&(c=1),u!==l[_++]&&(d=parseFloat(l[_-1])||0,m._pt={_next:m._pt,p:h||1===_?h:",",s:d,c:"="===u.charAt(1)?eA(d,u)-d:parseFloat(u)-d,m:c&&c<4?Math.round:0},g=Q.lastIndex);return m.c=g<i.length?i.substring(g,i.length):"",m.fp=s,(ee.test(i)||f)&&(m.e=0),this._pt=m,m},tQ=function(e,t,n,i,r,a,s,o,l,c){z(i)&&(i=i(r||0,e,a));var u,h=e[t],d="get"!==n?n:z(h)?l?e[t.indexOf("set")||!z(e["get"+t.substr(3)])?t:"get"+t.substr(3)](l):e[t]():h,f=z(h)?l?nn:nt:ne;if(B(i)&&(~i.indexOf("random(")&&(i=tf(i)),"="===i.charAt(1)&&((u=eA(d,i)+(tn(d)||0))||0===u)&&(i=u)),!c||d!==i||tJ)return isNaN(d*i)||""===i?(h||t in e||es(t,i),t$.call(this,e,t,d,i,f,o||P.stringFilter,l)):(u=new nf(this._pt,e,t,+d||0,i-(d||0),"boolean"==typeof h?ns:na,0,f),l&&(u.fp=l),s&&u.modifier(s,this,e),this._pt=u)},t0=function(e,t,n,i,r){if(z(e)&&(e=t6(e,r,t,n,i)),!H(e)||e.style&&e.nodeType||Y(e)||j(e))return B(e)?t6(e,r,t,n,i):e;var a,s={};for(a in e)s[a]=t6(e[a],r,t,n,i);return s},t1=function(e,t,n,i,r,a){var s,o,l,c;if(eg[e]&&!1!==(s=new eg[e]).init(r,s.rawVars?t[e]:t0(t[e],i,r,a,n),n,i,a)&&(n._pt=o=new nf(n._pt,r,e,0,1,s.render,s,0,s.priority),n!==R))for(l=n._ptLookup[n._targets.indexOf(r)],c=s._props.length;c--;)l[s._props[c]]=o;return s},t3=function e(t,n,i){var r,a,s,o,l,c,u,h,d,f,p,m,g,_=t.vars,v=_.ease,M=_.startAt,T=_.immediateRender,E=_.lazy,b=_.onUpdate,w=_.runBackwards,A=_.yoyoEase,R=_.keyframes,C=_.autoRevert,P=t._dur,L=t._startAt,U=t._targets,N=t.parent,I=N&&"nested"===N.data?N.vars.targets:U,O="auto"===t._overwrite&&!x,F=t.timeline;if(!F||R&&v||(v="none"),t._ease=tB(v,D.ease),t._yEase=A?tO(tB(!0===A?v:A,D.ease)):0,A&&t._yoyo&&!t._repeat&&(A=t._yEase,t._yEase=t._ease,t._ease=A),t._from=!F&&!!_.runBackwards,!F||R&&!_.stagger){if(m=(h=U[0]?eS(U[0]).harness:0)&&_[h.prop],r=eF(_,ef),L&&(L._zTime<0&&L.progress(1),n<0&&w&&T&&!C?L.render(-1,!0):L.revert(w&&P?eh:eu),L._lazy=0),M){if(eH(t._startAt=t7.set(U,eN({data:"isStart",overwrite:!1,parent:N,immediateRender:!0,lazy:!L&&G(E),startAt:null,delay:0,onUpdate:b&&function(){return tg(t,"onUpdate")},stagger:0},M))),t._startAt._dp=0,t._startAt._sat=t,n<0&&(y||!T&&!C)&&t._startAt.revert(eh),T&&P&&n<=0&&i<=0){n&&(t._zTime=n);return}}else if(w&&P&&!L)if(n&&(T=!1),s=eN({overwrite:!1,data:"isFromStart",lazy:T&&!L&&G(E),immediateRender:T,stagger:0,parent:N},r),m&&(s[h.prop]=m),eH(t._startAt=t7.set(U,s)),t._startAt._dp=0,t._startAt._sat=t,n<0&&(y?t._startAt.revert(eh):t._startAt.render(-1,!0)),t._zTime=n,T){if(!n)return}else e(t._startAt,1e-8,1e-8);for(a=0,t._pt=t._ptCache=0,E=P&&G(E)||E&&!P;a<U.length;a++){if(u=(l=U[a])._gsap||eM(U)[a]._gsap,t._ptLookup[a]=f={},em[u.id]&&ep.length&&eC(),p=I===U?a:I.indexOf(l),h&&!1!==(d=new h).init(l,m||r,t,p,I)&&(t._pt=o=new nf(t._pt,l,d.name,0,1,d.render,d,0,d.priority),d._props.forEach(function(e){f[e]=o}),d.priority&&(c=1)),!h||m)for(s in r)eg[s]&&(d=t1(s,r,t,p,l,I))?d.priority&&(c=1):f[s]=o=tQ.call(t,l,s,"get",r[s],p,I,0,_.stringFilter);t._op&&t._op[a]&&t.kill(l,t._op[a]),O&&t._pt&&(tZ=t,S.killTweensOf(l,f,t.globalTime(n)),g=!t.parent,tZ=0),t._pt&&E&&(em[u.id]=1)}c&&nd(t),t._onInit&&t._onInit(t)}t._onUpdate=b,t._initted=(!t._op||t._pt)&&!g,R&&n<=0&&F.render(1e8,!0,!0)},t2=function(e,t,n,i,r,a,s,o){var l,c,u,h,d=(e._pt&&e._ptCache||(e._ptCache={}))[t];if(!d)for(d=e._ptCache[t]=[],u=e._ptLookup,h=e._targets.length;h--;){if((l=u[h][t])&&l.d&&l.d._pt)for(l=l.d._pt;l&&l.p!==t&&l.fp!==t;)l=l._next;if(!l)return tJ=1,e.vars[t]="+=0",t3(e,s),tJ=0,o?eo(t+" not eligible for reset"):1;d.push(l)}for(h=d.length;h--;)(l=(c=d[h])._pt||c).s=(i||0===i)&&!r?i:l.s+(i||0)+a*l.c,l.c=n-l.s,c.e&&(c.e=eb(n)+tn(c.e)),c.b&&(c.b=l.s+tn(c.b))},t4=function(e,t){var n,i,r,a,s=e[0]?eS(e[0]).harness:0,o=s&&s.aliases;if(!o)return t;for(i in n=eI({},t),o)if(i in n)for(r=(a=o[i].split(",")).length;r--;)n[a[r]]=n[i];return n},t5=function(e,t,n,i){var r,a,s=t.ease||i||"power1.inOut";if(Y(t))a=n[e]||(n[e]=[]),t.forEach(function(e,n){return a.push({t:n/(t.length-1)*100,v:e,e:s})});else for(r in t)a=n[r]||(n[r]=[]),"ease"===r||a.push({t:parseFloat(e),v:t[r],e:s})},t6=function(e,t,n,i,r){return z(e)?e.call(t,n,i,r):B(e)&&~e.indexOf("random(")?tf(e):e},t8=ey+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",t9={};
1eE(t8+",id,stagger,delay,duration,paused,scrollTrigger",function(e){return t9[e]=1});var t7=function(e){function t(t,i,r,a){"number"==typeof i&&(r.duration=i,i=r,r=null);var s,o,l,c,u,h,d,f,p=e.call(this,a?i:eB(i))||this,m=p.vars,g=m.duration,_=m.delay,v=m.immediateRender,y=m.stagger,M=m.overwrite,T=m.keyframes,E=m.defaults,b=m.scrollTrigger,w=m.yoyoEase,A=i.parent||S,R=(Y(t)||j(t)?k(t[0]):"length"in i)?[t]:ta(t);if(p._targets=R.length?eM(R):eo("GSAP target "+t+" not found. https://gsap.com",!P.nullTargetWarn)||[],p._ptLookup=[],p._overwrite=M,T||y||X(g)||X(_)){if(i=p.vars,(s=p.timeline=new tX({data:"nested",defaults:E||{},targets:A&&"nested"===A.data?A.vars.targets:R})).kill(),s.parent=s._dp=n(p),s._start=0,y||X(g)||X(_)){if(c=R.length,d=y&&tl(y),H(y))for(u in y)~t8.indexOf(u)&&(f||(f={}),f[u]=y[u]);for(o=0;o<c;o++)(l=eF(i,t9)).stagger=0,w&&(l.yoyoEase=w),f&&eI(l,f),h=R[o],l.duration=+t6(g,n(p),o,h,R),l.delay=(+t6(_,n(p),o,h,R)||0)-p._delay,!y&&1===c&&l.delay&&(p._delay=_=l.delay,p._start+=_,l.delay=0),s.to(h,l,d?d(o,h,R):0),s._ease=tP.none;s.duration()?g=_=0:p.timeline=0}else if(T){eB(eN(s.vars.defaults,{ease:"none"})),s._ease=tB(T.ease||i.ease||"none");var C,D,L,U=0;if(Y(T))T.forEach(function(e){return s.to(R,e,">")}),s.duration();else{for(u in l={},T)"ease"===u||"easeEach"===u||t5(u,T[u],l,T.easeEach);for(u in l)for(o=0,C=l[u].sort(function(e,t){return e.t-t.t}),U=0;o<C.length;o++)(L={ease:(D=C[o]).e,duration:(D.t-(o?C[o-1].t:0))/100*g})[u]=D.v,s.to(R,L,U),U+=L.duration;s.duration()<g&&s.to({},{duration:g-s.duration()})}}g||p.duration(g=s.duration())}else p.timeline=0;return!0!==M||x||(tZ=n(p),S.killTweensOf(R),tZ=0),e$(A,n(p),r),i.reversed&&p.reverse(),i.paused&&p.paused(!0),(v||!g&&!T&&p._start===ew(A._time)&&G(v)&&function e(t){return!t||t._ts&&e(t.parent)}(n(p))&&"nested"!==A.data)&&(p._tTime=-1e-8,p.render(Math.max(0,-_)||0)),b&&eQ(n(p),b),p}i(t,e);var r=t.prototype;return r.render=function(e,t,n){var i,r,a,s,o,l,c,u,h,d=this._time,f=this._tDur,p=this._dur,m=e<0,g=e>f-1e-8&&!m?f:e<1e-8?0:e;if(p){if(g!==this._tTime||!e||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==m||this._lazy){if(i=g,u=this.timeline,this._repeat){if(s=p+this._rDelay,this._repeat<-1&&m)return this.totalTime(100*s+e,t,n);if(i=ew(g%s),g===f?(a=this._repeat,i=p):(a=~~(o=ew(g/s)))&&a===o?(i=p,a--):i>p&&(i=p),(l=this._yoyo&&1&a)&&(h=this._yEase,i=p-i),o=eY(this._tTime,s),i===d&&!n&&this._initted&&a===o)return this._tTime=g,this;a!==o&&(u&&this._yEase&&tF(u,l),this.vars.repeatRefresh&&!l&&!this._lock&&i!==s&&this._initted&&(this._lock=n=1,this.render(ew(s*a),!0).invalidate()._lock=0))}if(!this._initted){if(e0(this,m?e:i,n,t,g))return this._tTime=0,this;if(d!==this._time&&!(n&&this.vars.repeatRefresh&&a!==o))return this;if(p!==this._dur)return this.render(e,t,n)}if(this._tTime=g,this._time=i,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=c=(h||this._ease)(i/p),this._from&&(this.ratio=c=1-c),!d&&g&&!t&&!o&&(tg(this,"onStart"),this._tTime!==g))return this;for(r=this._pt;r;)r.r(c,r.d),r=r._next;u&&u.render(e<0?e:u._dur*u._ease(i/this._dur),t,n)||this._startAt&&(this._zTime=e),this._onUpdate&&!t&&(m&&eX(this,e,t,n),tg(this,"onUpdate")),this._repeat&&a!==o&&this.vars.onRepeat&&!t&&this.parent&&tg(this,"onRepeat"),(g===this._tDur||!g)&&this._tTime===g&&(m&&!this._onUpdate&&eX(this,e,!0,!0),(e||!p)&&(g===this._tDur&&this._ts>0||!g&&this._ts<0)&&eH(this,1),!t&&!(m&&!d)&&(g||d||l)&&(tg(this,g===f?"onComplete":"onReverseComplete",!0),this._prom&&!(g<f&&this.timeScale()>0)&&this._prom()))}}else e2(this,e,t,n);return this},r.targets=function(){return this._targets},r.invalidate=function(t){return t&&this.vars.runBackwards||(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),e.prototype.invalidate.call(this,t)},r.resetTo=function(e,t,n,i,r){C||tR.wake(),this._ts||this.play();var a=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return(this._initted||t3(this,a),t2(this,e,t,n,i,this._ease(a/this._dur),a,r))?this.resetTo(e,t,n,i,1):(eZ(this,0),this.parent||ek(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},r.kill=function(e,t){if(void 0===t&&(t="all"),!e&&(!t||"all"===t))return this._lazy=this._pt=0,this.parent?t_(this):this.scrollTrigger&&this.scrollTrigger.kill(!!y),this;if(this.timeline){var n=this.timeline.totalDuration();
vendor: 4,515 bytes, line 1
1return this.timeline.killTweensOf(e,t,tZ&&!0!==tZ.vars.overwrite)._first||t_(this),this.parent&&n!==this.timeline.totalDuration()&&e5(this,this._dur*this.timeline._tDur/n,0,1),this}var i,r,a,s,o,l,c,u=this._targets,h=e?ta(e):u,d=this._ptLookup,f=this._pt;if((!t||"all"===t)&&ez(u,h))return"all"===t&&(this._pt=0),t_(this);for(i=this._op=this._op||[],"all"!==t&&(B(t)&&(o={},eE(t,function(e){return o[e]=1}),t=o),t=t4(u,t)),c=u.length;c--;)if(~h.indexOf(u[c]))for(o in r=d[c],"all"===t?(i[c]=t,s=r,a={}):(a=i[c]=i[c]||{},s=t),s)(l=r&&r[o])&&("kill"in l.d&&!0!==l.d.kill(o)||eV(this,l,"_pt"),delete r[o]),"all"!==a&&(a[o]=1);return this._initted&&!this._pt&&f&&t_(this),this},t.to=function(e,n){return new t(e,n,arguments[2])},t.from=function(e,t){return e7(1,arguments)},t.delayedCall=function(e,n,i,r){return new t(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:n,onReverseComplete:n,onCompleteParams:i,onReverseCompleteParams:i,callbackScope:r})},t.fromTo=function(e,t,n){return e7(2,arguments)},t.set=function(e,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new t(e,n)},t.killTweensOf=function(e,t,n){return S.killTweensOf(e,t,n)},t}(tW);eN(t7.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),eE("staggerTo,staggerFrom,staggerFromTo",function(e){t7[e]=function(){var t=new tX,n=ti.call(arguments,0);return n.splice("staggerFromTo"===e?5:4,0,0),t[e].apply(t,n)}});var ne=function(e,t,n){return e[t]=n},nt=function(e,t,n){return e[t](n)},nn=function(e,t,n,i){return e[t](i.fp,n)},ni=function(e,t,n){return e.setAttribute(t,n)},nr=function(e,t){return z(e[t])?nt:V(e[t])&&e.setAttribute?ni:ne},na=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},ns=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},no=function(e,t){var n=t._pt,i="";if(!e&&t.b)i=t.b;else if(1===e&&t.e)i=t.e;else{for(;n;)i=n.p+(n.m?n.m(n.s+n.c*e):Math.round((n.s+n.c*e)*1e4)/1e4)+i,n=n._next;i+=t.c}t.set(t.t,t.p,i,t)},nl=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},nc=function(e,t,n,i){for(var r,a=this._pt;a;)r=a._next,a.p===i&&a.modifier(e,t,n),a=r},nu=function(e){for(var t,n,i=this._pt;i;)n=i._next,(i.p!==e||i.op)&&i.op!==e?i.dep||(t=1):eV(this,i,"_pt"),i=n;return!t},nh=function(e,t,n,i){i.mSet(e,t,i.m.call(i.tween,n,i.mt),i)},nd=function(e){for(var t,n,i,r,a=e._pt;a;){for(t=a._next,n=i;n&&n.pr>a.pr;)n=n._next;(a._prev=n?n._prev:r)?a._prev._next=a:i=a,(a._next=n)?n._prev=a:r=a,a=t}e._pt=i},nf=function(){function e(e,t,n,i,r,a,s,o,l){this.t=t,this.s=i,this.c=r,this.p=n,this.r=a||na,this.d=s||this,this.set=o||ne,this.pr=l||0,this._next=e,e&&(e._prev=this)}return e.prototype.modifier=function(e,t,n){this.mSet=this.mSet||this.set,this.set=nh,this.m=e,this.mt=n,this.tween=t},e}();eE(ey+"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(e){return ef[e]=1}),ei.TweenMax=ei.TweenLite=t7,ei.TimelineLite=ei.TimelineMax=tX,S=new tX({sortChildren:!1,defaults:D,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),P.stringFilter=tA;var np=[],nm={},ng=[],n_=0,nv=0,nx=function(e){return(nm[e]||ng).map(function(e){return e()})},ny=function(){var e=Date.now(),t=[];e-n_>2&&(nx("matchMediaInit"),np.forEach(function(e){var n,i,r,a,s=e.queries,o=e.conditions;for(i in s)(n=T.matchMedia(s[i]).matches)&&(r=1),n!==o[i]&&(o[i]=n,a=1);a&&(e.revert(),r&&t.push(e))}),nx("matchMediaRevert"),t.forEach(function(e){return e.onMatch(e,function(t){return e.add(null,t)})}),n_=e,nx("matchMedia"))},nM=function(){function e(e,t){this.selector=t&&ts(t),this.data=[],this._r=[],this.isReverted=!1,this.id=nv++,e&&this.add(e)}var t=e.prototype;return t.add=function(e,t,n){z(e)&&(n=t,t=e,e=z);var i=this,r=function(){var e,r=M,a=i.selector;return r&&r!==i&&r.data.push(i),n&&(i.selector=ts(n)),M=i,e=t.apply(i,arguments),z(e)&&i._r.push(e),M=r,i.selector=a,i.isReverted=!1,e};return i.last=r,e===z?r(i,function(e){return i.add(null,e)}):e?i[e]=r:r},t.ignore=function(e){var t=M;M=null,e(this),M=t},t.getTweens=function(){var t=[];return this.data.forEach(function(n){return n instanceof e?t.push.apply(t,n.getTweens()):n instanceof t7&&!(n.parent&&"nested"===n.parent.data)&&t.push(n)}),t},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(e,t){var n=this;if(e){for(var i,r=n.getTweens(),a=n.data.length;a--;)"isFlip"===(i=n.data[a]).data&&(i.revert(),i.getChildren(!0,!0,!1).forEac
1h(function(e){return r.splice(r.indexOf(e),1)}));for(r.map(function(e){return{g:e._dur||e._delay||e._sat&&!e._sat.vars.immediateRender?e.globalTime(0):-1/0,t:e}}).sort(function(e,t){return t.g-e.g||-1/0}).forEach(function(t){return t.t.revert(e)}),a=n.data.length;a--;)(i=n.data[a])instanceof tX?"nested"!==i.data&&(i.scrollTrigger&&i.scrollTrigger.revert(),i.kill()):i instanceof t7||!i.revert||i.revert(e);n._r.forEach(function(t){return t(e,n)}),n.isReverted=!0}else this.data.forEach(function(e){return e.kill&&e.kill()});if(this.clear(),t)for(var s=np.length;s--;)np[s].id===this.id&&np.splice(s,1)},t.revert=function(e){this.kill(e||{})},e}(),nS=function(){function e(e){this.contexts=[],this.scope=e,M&&M.data.push(this)}var t=e.prototype;return t.add=function(e,t,n){H(e)||(e={matches:e});var i,r,a,s=new nM(0,n||this.scope),o=s.conditions={};for(r in M&&!s.selector&&(s.selector=M.selector),this.contexts.push(s),t=s.add("onMatch",t),s.queries=e,e)"all"===r?a=1:(i=T.matchMedia(e[r]))&&(0>np.indexOf(s)&&np.push(s),(o[r]=i.matches)&&(a=1),i.addListener?i.addListener(ny):i.addEventListener("change",ny));return a&&t(s,function(e){return s.add(null,e)}),this},t.revert=function(e){this.kill(e||{})}
vendor: 4,873 bytes, line 1
1,t.kill=function(e){this.contexts.forEach(function(t){return t.kill(e,!0)})},e}(),nT={registerPlugin:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t.forEach(function(e){return tx(e)})},timeline:function(e){return new tX(e)},getTweensOf:function(e,t){return S.getTweensOf(e,t)},getProperty:function(e,t,n,i){B(e)&&(e=ta(e)[0]);var r=eS(e||{}).get,a=n?eU:eL;return"native"===n&&(n=""),e?t?a((eg[t]&&eg[t].get||r)(e,t,n,i)):function(t,n,i){return a((eg[t]&&eg[t].get||r)(e,t,n,i))}:e},quickSetter:function(e,t,n){if((e=ta(e)).length>1){var i=e.map(function(e){return nA.quickSetter(e,t,n)}),r=i.length;return function(e){for(var t=r;t--;)i[t](e)}}e=e[0]||{};var a=eg[t],s=eS(e),o=s.harness&&(s.harness.aliases||{})[t]||t,l=a?function(t){var i=new a;R._pt=0,i.init(e,n?t+n:t,R,0,[e]),i.render(1,i),R._pt&&nl(1,R)}:s.set(e,o);return a?l:function(t){return l(e,o,n?t+n:t,s,1)}},quickTo:function(e,t,n){var i,r=nA.to(e,eN(((i={})[t]="+=0.1",i.paused=!0,i.stagger=0,i),n||{})),a=function(e,n,i){return r.resetTo(t,e,n,i)};return a.tween=r,a},isTweening:function(e){return S.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=tB(e.ease,D.ease)),eO(D,e||{})},config:function(e){return eO(P,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,i=e.plugins,r=e.defaults,a=e.extendTimeline;(i||"").split(",").forEach(function(e){return e&&!eg[e]&&!ei[e]&&eo(t+" effect requires "+e+" plugin.")}),e_[t]=function(e,t,i){return n(ta(e),eN(t||{},r),i)},a&&(tX.prototype[t]=function(e,n,i){return this.add(e_[t](e,H(n)?n:(i=n)&&{},this),i)})},registerEase:function(e,t){tP[e]=tB(t)},parseEase:function(e,t){return arguments.length?tB(e,t):tP},getById:function(e){return S.getById(e)},exportRoot:function(e,t){void 0===e&&(e={});var n,i,r=new tX(e);for(r.smoothChildTiming=G(e.smoothChildTiming),S.remove(r),r._dp=0,r._time=r._tTime=S._time,n=S._first;n;)i=n._next,(t||!(!n._dur&&n instanceof t7&&n.vars.onComplete===n._targets[0]))&&e$(r,n,n._start-n._delay),n=i;return e$(S,r,0),r},context:function(e,t){return e?new nM(e,t):M},matchMedia:function(e){return new nS(e)},matchMediaRefresh:function(){return np.forEach(function(e){var t,n,i=e.conditions;for(n in i)i[n]&&(i[n]=!1,t=1);t&&e.revert()})||ny()},addEventListener:function(e,t){var n=nm[e]||(nm[e]=[]);~n.indexOf(t)||n.push(t)},removeEventListener:function(e,t){var n=nm[e],i=n&&n.indexOf(t);i>=0&&n.splice(i,1)},utils:{wrap:function e(t,n,i){var r=n-t;return Y(t)?td(t,e(0,t.length),n):te(i,function(e){return(r+(e-t)%r)%r+t})},wrapYoyo:function e(t,n,i){var r=n-t,a=2*r;return Y(t)?td(t,e(0,t.length-1),n):te(i,function(e){return e=(a+(e-t)%a)%a||0,t+(e>r?a-e:e)})},distribute:tl,random:th,snap:tu,normalize:function(e,t,n){return tp(e,t,0,1,n)},getUnit:tn,clamp:function(e,t,n){return te(n,function(n){return tt(e,t,n)})},splitColor:tS,toArray:ta,selector:ts,mapRange:tp,pipe:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduce(function(e,t){return t(e)},e)}},unitize:function(e,t){return function(n){return e(parseFloat(n))+(t||tn(n))}},interpolate:function e(t,n,i,r){var a=isNaN(t+n)?0:function(e){return(1-e)*t+e*n};if(!a){var s,o,l,c,u,h=B(t),d={};if(!0===i&&(r=1)&&(i=null),h)t={p:t},n={p:n};else if(Y(t)&&!Y(n)){for(o=1,l=[],u=(c=t.length)-2;o<c;o++)l.push(e(t[o-1],t[o]));c--,a=function(e){var t=Math.min(u,~~(e*=c));return l[t](e-t)},i=n}else r||(t=eI(Y(t)?[]:{},t));if(!l){for(s in n)tQ.call(d,t,s,"get",n[s]);a=function(e){return nl(e,d)||(h?t.p:t)}}}return te(i,a)},shuffle:to},install:ea,effects:e_,ticker:tR,updateRoot:tX.updateRoot,plugins:eg,globalTimeline:S,core:{PropTween:nf,globals:el,Tween:t7,Timeline:tX,Animation:tW,getCache:eS,_removeLinkedListItem:eV,reverting:function(){return y},context:function(e){return e&&M&&(M.data.push(e),e._ctx=M),M},suppressOverwrites:function(e){return x=e}}};eE("to,from,fromTo,delayedCall,set,killTweensOf",function(e){return nT[e]=t7[e]}),tR.add(tX.updateRoot),R=nT.to({},{duration:0});var nE=function(e,t){for(var n=e._pt;n&&n.p!==t&&n.op!==t&&n.fp!==t;)n=n._next;return n},nb=function(e,t){var n,i,r,a=e._targets;for(n in t)for(i=a.length;i--;)(r=e._ptLookup[i][n])&&(r=r.d)&&(r._pt&&(r=nE(r,n)),r&&r.modifier&&r.modifier(t[n],e,a[i],n))},nw=function(e,t){return{name:e,headless:1,rawVars:1,init:function(e,n,i){i._onInit=function(e){var i,r;if(B(n)&&(i={},eE(n,function(e){return i[e]=1}),n=i),t){for(r in i={},n)i[r]=t(n[r]);n=i}nb(e,n)}}}},nA=nT.registerPlugin({name:"attr",init:function(e,t,n,i,r){var a,s,o;for(a in this.tween=n,t)o=e.getAttribute(a)||"",(s=this.add(e,"setAttribute",(o||0)+"",t[a],i,r,0,0,a)).op=a,s.b=o,this._props.push(a)},render:function(e,t){for(var n=t._pt;n;)y?n.set(n.t,n.p,n.b,n):n.r(e,n.d),n=n._next}},{name:"endArray",headless:1,init:function(e,t){for(var n=t.length;n--;)this.add(e,n,e[n]||0,t[n],0,0,0,0,0,1)}}
1,nw("roundProps",tc),nw("modifiers"),nw("snap",tu))||nT;t7.version=tX.version=nA.version="3.14.2",w=1,W()&&tC(),tP.Power0,tP.Power1,tP.Power2,tP.Power3,tP.Power4,tP.Linear,tP.Quad,tP.Cubic,tP.Quart,tP.Quint,tP.Strong,tP.Elastic,tP.Back,tP.SteppedEase,tP.Bounce,tP.Sine,tP.Expo,tP.Circ;var nR,nC,nP,nD,nL,nU,nN,nI={},nO=180/Math.PI,nF=Math.PI/180,nB=Math.atan2,nz=/([A-Z])/g,nk=/(left|right|width|margin|padding|x)/i,nV=/[\s,\(]\S/,nH={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},nG=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},nW=function(e,t){return t.set(t.t,t.p,1===e?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},nX=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},nj=function(e,t){return t.set(t.t,t.p,1===e?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},nY=function(e,t){var n=t.s+t.c*e;t.set(t.t,t.p,~~(n+(n<0?-.5:.5))+t.u,t)},nq=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},nK=function(e,t){return t.set(t.t,t.p,1!==e?t.b:t.e,t)},nZ=function(e,t,n){return e.style[t]=n},nJ=function(e,t,n){return e.style.setProperty(t,n)},n$=function(e,t,n){return e._gsap[t]=n},nQ=function(e,t,n){return e._gsap.scaleX=e._gsap.scaleY=n},n0=function(e,t,n,i,r){var a=e._gsap;a.scaleX=a.scaleY=n,a.renderTransform(r,a)},n1=function(e,t,n,i,r){var a=e._gsap;a[t]=n,a.renderTransform(r,a)},n3="transform",n2=n3+"Origin",n4=function e(t,n){var i=this,r=this.target,a=r.style,s=r._gsap;if(t in nI&&a){if(this.tfm=this.tfm||{},"transform"===t)return nH.transform.split(",").forEach(function(t){return e.call(i,t,n)});if(~(t=nH[t]||t).indexOf(",")?t.split(",").forEach(function(e){return i.tfm[e]=ip(r,e)}):this.tfm[t]=s.x?s[t]:ip(r,t),t===n2&&(this.tfm.zOrigin=s.zOrigin),this.props.indexOf(n3)>=0)return;s.svg&&(this.svgo=r.getAttribute("data-svg-origin"),this.props.push(n2,n,"")),t=n3}(a||n)&&this.props.push(t,n,a[t])},n5=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},n6=function(){var e,t,n=this.props,i=this.target,r=i.style,a=i._gsap;for(e=0;e<n.length;e+=3)n[e+1]?2===n[e+1]?i[n[e]](n[e+2]):i[n[e]]=n[e+2]:n[e+2]?r[n[e]]=n[e+2]:r.removeProperty("--"===n[e].substr(0,2)?n[e]:n[e].replace(nz,"-$1").toLowerCase());if(this.tfm){for(t in this.tfm)a[t]=this.tfm[t];a.svg&&(a.renderTransform(),i.setAttribute("data-svg-origin",this.svgo||"")),(e=nU())&&e.isStart||r[n3]||(n5(r),a.zOrigin&&r[n2]&&(r[n2]+=" "+a.zOrigin+"px",a.zOrigin=0,a.renderTransform()),a.uncache=1)}},n8=function(e,t){var n={target:e,props:[],revert:n6,save:n4};return e._gsap||nA.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(e){return n.save(e)}),n},n9=function(e,t){var n=nR.createElementNS?nR.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):nR.createElement(e);return n&&n.style?n:nR.createElement(e)},n7=function e(t,n,i){var r=getComputedStyle(t);return r[n]||r.getPropertyValue(n.replace(nz,"-$1").toLowerCase())||r.getPropertyValue(n)||!i&&e(t,it(n)||n,1)||""},ie="O,Moz,ms,Ms,Webkit".split(","),it=function(e,t,n){var i=(t||nD).style,r=5;if(e in i&&!n)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);r--&&!(ie[r]+e in i););return r<0?null:(3===r?"ms":r>=0?ie[r]:"")+e},ii=function(){"u">typeof window&&window.document&&(nC=(nR=window.document).documentElement,nD=n9("div")||{style:{}},n9("div"),n2=(n3=it(n3))+"Origin",nD.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",nN=!!it("perspective"),nU=nA.core.reverting,nP=1)},ir=function(e){var t,n=e.ownerSVGElement,i=n9("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),r=e.cloneNode(!0);r.style.display="block",i.appendChild(r),nC.appendChild(i);try{t=r.getBBox()}catch(e){}return i.removeChild(r),nC.removeChild(i),t},ia=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},is=function(e){var t,n;try{t=e.getBBox()}catch(i){t=ir(e),n=1}return t&&(t.width||t.height)||n||(t=ir(e)),!t||t.width||t.x||t.y?t:{x:+ia(e,["x","cx","x1"])||0,y:+ia(e,["y","cy","y1"])||0,width:0,height:0}},io=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&is(e))},il=function(e,t){if(t){var n,i=e.style;t in nI&&t!==n2&&(t=n3),i.removeProperty?(("ms"===(n=t.substr(0,2))||"webkit"===t.substr(0,6))&&(t="-"+t),i.removeProperty("--"===n?t:t.replace(nz,"-$1").toLowerCase())):i.removeAttribute(t)}},ic=function(e,t,n,i,r,a){var s=new nf(e._pt,t,n,0,1,a?nK:nq);return e._pt=s,s.b=i,s.e=r,e._props.push(n),s},iu={deg:1,rad:1,turn:1},ih={grid:1,flex:1},id=function e(t,n,i,r){var a,s,o,l,c=parseFloat(i)||0,u=(i+"").trim().substr((c+"").length)||"px",h=nD.style,d=nk.test(n),f="svg"===t.tagName.toLowerCase(),p=(f?"client":"offset")+(d?"Width":"Height"),m="px"===r,g="%"===r;if(r===u||!c||iu[r]||iu[u])return c;if("px"===u||m||(c=e(t,n,i,"px")),l=t.getCTM&&io(t),(g||"%"===u)&&(nI[n]||~n.indexOf("adius")))return a=l?t.getBBox()[d?"width":"height"]:t[p],eb(g?c/a*100:c/100*a);if(h[d?"width":"height"]=100+(m?u:r),s="rem"!==r&&~n.indexOf("adius")||"em"===r&&t.appendChild&&!f?t:t.parentNode,l&&(s=(t.ownerSVGElement||{}).parentNode),s&&s!==nR&&s.appendChild||(s=nR.body),(o=s._gsap)&&g&&o.width&&d&&o.time===tR.time&&!o.uncache)return eb(c/o.width*100);if(g&&("height"===n||"width"===n)){var _=t.style[n];t.style[n]=100+r,a=t[p],_?t.style[n]=_:il(t,n)}else(g||"%"===u)&&!ih[n7(s,"display")]&&(h.position=n7(t,"position")),s===t&&(h.position="static"),s.appendChild(nD),a=nD[p],s.removeChild(nD),h.position="absolute";return d&&g&&((o=eS(s)).time=tR.time,o.width=s[p]),eb(m?a*c/100:a&&c?100/a*c:0)},ip=function(e,t,n,i){var r;return nP||ii(),t in nH&&"transform"!==t&&~(t=nH[t]).indexOf(",")&&(t=t.
1split(",")[0]),nI[t]&&"transform"!==t?(r=iw(e,i),r="transformOrigin"!==t?r[t]:r.svg?r.origin:iA(n7(e,n2))+" "+r.zOrigin+"px"):(!(r=e.style[t])||"auto"===r||i||~(r+"").indexOf("calc("))&&(r=ix[t]&&ix[t](e,t,n)||n7(e,t)||eT(e,t)||+("opacity"===t)),n&&!~(r+"").trim().indexOf(" ")?id(e,t,r,n)+n:r},im=function(e,t,n,i){if(!n||"none"===n){var r=it(t,e,1),a=r&&n7(e,r,1);a&&a!==n?(t=r,n=a):"borderColor"===t&&(n=n7(e,"borderTopColor"))}var s,o,l,c,u,h,d,f,p,m,g,_=new nf(this._pt,e.style,t,0,1,no),v=0,x=0;if(_.b=n,_.e=i,n+="","var(--"===(i+="").substring(0,6)&&(i=n7(e,i.substring(4,i.indexOf(")")))),"auto"===i&&(h=e.style[t],e.style[t]=i,i=n7(e,t)||i,h?e.style[t]=h:il(e,t)),tA(s=[n,i]),n=s[0],i=s[1],l=n.match($)||[],(i.match($)||[]).length){for(;o=$.exec(i);)d=o[0],p=i.substring(v,o.index),u?u=(u+1)%5:("rgba("===p.substr(-5)||"hsla("===p.substr(-5))&&(u=1),d!==(h=l[x++]||"")&&(c=parseFloat(h)||0,g=h.substr((c+"").length),"="===d.charAt(1)&&(d=eA(c,d)+g),f=parseFloat(d),m=d.substr((f+"").length),v=$.lastIndex-m.length,m||(m=m||P.units[t]||g,v===i.length&&(i+=m,_.e+=m)),g!==m&&(c=id(e,t,h,m)||0),_._pt={_next:_._pt,p:p||1===x?p:",",s:c,c:f-c,m:u&&u<4||"zIndex"===t?Math.round:0});_.c=v<i.length?i.substring(v,i.length):""}else _.r="display"===t&&"none"===i?nK:nq;return ee.test(i)&&(_.e=0),this._pt=_,_},ig={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},i_=function(e){var t=e.split(" "),n=t[0],i=t[1]||"50%";return("top"===n||"bottom"===n||"left"===i||"right"===i)&&(e=n,n=i,i=e),t[0]=ig[n]||n,t[1]=ig[i]||i,t.join(" ")},iv=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var n,i,r,a=t.t,s=a.style,o=t.u,l=a._gsap;if("all"===o||!0===o)s.cssText="",i=1;else for(r=(o=o.split(",")).length;--r>-1;)nI[n=o[r]]&&(i=1,n="transformOrigin"===n?n2:n3),il(a,n);i&&(il(a,n3),l&&(l.svg&&a.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",iw(a,1),l.uncache=1,n5(s)))}},ix={clearProps:function(e,t,n,i,r){if("isFromStart"!==r.data){var a=e._pt=new nf(e._pt,t,n,0,0,iv);return a.u=i,a.pr=-10,a.tween=r,e._props.push(n),1}}},iy=[1,0,0,1,0,0],iM={},iS=function(e){return"matrix(1, 0, 0, 1, 0, 0)"===e||"none"===e||!e},iT=function(e){var t=n7(e,n3);return iS(t)?iy:t.substr(7).match(J).map(eb)},iE=function(e,t){var n,i,r,a,s=e._gsap||eS(e),o=e.style,l=iT(e);return s.svg&&e.getAttribute("transform")?"1,0,0,1,0,0"===(l=[(r=e.transform.baseVal.consolidate().matrix).a,r.b,r.c,r.d,r.e,r.f]).join(",")?iy:l:(l!==iy||e.offsetParent||e===nC||s.svg||(r=o.display,o.display="block",(n=e.parentNode)&&(e.offsetParent||e.getBoundingClientRect().width)||(a=1,i=e.nextElementSibling,nC.appendChild(e)),l=iT(e),r?o.display=r:il(e,"display"),a&&(i?n.insertBefore(e,i):n?n.appendChild(e):nC.removeChild(e))),t&&l.length>6?[l[0],l[1],l[4],l[5],l[12],l[13]]:l)},ib=function(e,t,n,i,r,a){var s,o,l,c,u=e._gsap,h=r||iE(e,!0),d=u.xOrigin||0,f=u.yOrigin||0,p=u.xOffset||0,m=u.yOffset||0,g=h[0],_=h[1],v=h[2],x=h[3],y=h[4],M=h[5],S=t.split(" "),T=parseFloat(S[0])||0,E=parseFloat(S[1])||0;n?h!==iy&&(o=g*x-_*v)&&(l=x/o*T+-v/o*E+(v*M-x*y)/o,c=-_/o*T+g/o*E-(g*M-_*y)/o,T=l,E=c):(T=(s=is(e)).x+(~S[0].indexOf("%")?T/100*s.width:T),E=s.y+(~(S[1]||S[0]).indexOf("%")?E/100*s.height:E)),i||!1!==i&&u.smooth?(u.xOffset=p+((y=T-d)*g+(M=E-f)*v)-y,u.yOffset=m+(y*_+M*x)-M):u.xOffset=u.yOffset=0,u.xOrigin=T,u.yOrigin=E,u.smooth=!!i,u.origin=t,u.originIsAbsolute=!!n,e.style[n2]="0px 0px",a&&(ic(a,u,"xOrigin",d,T),ic(a,u,"yOrigin",f,E),ic(a,u,"xOffset",p,u.xOffset),ic(a,u,"yOffset",m,u.yOffset)),e.setAttribute("data-svg-origin",T+" "+E)},iw=function(e,t){var n=e._gsap||new tG(e);if("x"in n&&!t&&!n.uncache)return n;var i,r,a,s,o,l,c,u,h,d,f,p,m,g,_,v,x,y,M,S,T,E,b,w,A,R,C,D,L,U,N,I,O=e.style,F=n.scaleX<0,B=getComputedStyle(e),z=n7(e,n2)||"0";return i=r=a=l=c=u=h=d=f=0,s=o=1,n.svg=!!(e.getCTM&&io(e)),B.translate&&(("none"!==B.translate||"none"!==B.scale||"none"!==B.rotate)&&(O[n3]=("none"!==B.translate?"translate3d("+(B.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==B.rotate?"rotate("+B.rotate+") ":"")+("none"!==B.scale?"scale("+B.scale.split(" ").join(",")+") ":"")+("none"!==B[n3]?B[n3]:"")),O.scale=O.rotate=O.translate="none"),g=iE(e,n.svg),n.svg&&(n.uncache?(A=e.getBBox(),z=n.xOrigin-A.x+"px "+(n.yOrigin-A.y)+"px",w=""):w=!t&&e.getAttribute("data-svg-origin"),ib(e,w||z,!!w||n.originIsAbsolute,!1!==n.smooth,g)),p=n.xOrigin||0,m=n.yOrigin||0,g!==iy&&(y=g[0],M=g[1],S=g[2],T=g[3],i=E=g[4],r=b=g[5],6===g.length?(s=Math.sqrt(y*y+M*M),o=Math.sqrt(T*T+S*S),l=y||M?nB(M,y)*nO:0,(h=S||T?nB(S,T)*nO+l:0)&&(o*=Math.abs(Math.cos(h*nF))),n.svg&&(i-=p-(p*y+m*S),r-=m-(p*M+m*T))):(I=g[6],U=g[7],C=g[8],D=g[9],L=g[10
1],N=g[11],i=g[12],r=g[13],a=g[14],c=(_=nB(I,L))*nO,_&&(w=E*(v=Math.cos(-_))+C*(x=Math.sin(-_)),A=b*v+D*x,R=I*v+L*x,C=-(E*x)+C*v,D=-(b*x)+D*v,L=-(I*x)+L*v,N=-(U*x)+N*v,E=w,b=A,I=R),u=(_=nB(-S,L))*nO,_&&(w=y*(v=Math.cos(-_))-C*(x=Math.sin(-_)),A=M*v-D*x,R=S*v-L*x,N=T*x+N*v,y=w,M=A,S=R),l=(_=nB(M,y))*nO,_&&(w=y*(v=Math.cos(_))+M*(x=Math.sin(_)),A=E*v+b*x,M=M*v-y*x,b=b*v-E*x,y=w,E=A),c&&Math.abs(c)+Math.abs(l)>359.9&&(c=l=0,u=180-u),s=eb(Math.sqrt(y*y+M*M+S*S)),o=eb(Math.sqrt(b*b+I*I)),h=Math.abs(_=nB(E,b))>2e-4?_*nO:0,f=N?1/(N<0?-N:N):0),n.svg&&(w=e.getAttribute("transform"),n.forceCSS=e.setAttribute("transform","")||!iS(n7(e,n3)),w&&e.setAttribute("transform",w))),Math.abs(h)>90&&270>Math.abs(h)&&(F?(s*=-1,h+=l<=0?180:-180,l+=l<=0?180:-180):(o*=-1,h+=h<=0?180:-180)),t=t||n.uncache,n.x=i-((n.xPercent=i&&(!t&&n.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-i)?-50:0)))?e.offsetWidth*n.xPercent/100:0)+"px",n.y=r-((n.yPercent=r&&(!t&&n.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-r)?-50:0)))?e.offsetHeight*n.yPercent/100:0)+"px",n.z=a+"px",n.scaleX=eb(s),n.scaleY=eb(o),n.rotation=eb(l)+"deg",n.rotationX=eb(c)+"deg",n.rotationY=eb(u)+"deg",n.skewX=h+"deg",n.skewY=d+"deg",n.transformPerspective=f+"px",(n.zOrigin=parseFloat(z.split(" ")[2])||!t&&n.zOrigin||0)&&(O[n2]=iA(z)),n.xOffset=n.yOffset=0,n.force3D=P.force3D,n.renderTransform=n.svg?iL:nN?iD:iC,n.uncache=0,n},iA=function(e){return(e=e.split(" "))[0]+" "+e[1]},iR=function(e,t,n){var i=tn(t);return eb(parseFloat(t)+parseFloat(id(e,"x",n+"px",i)))+i},iC=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,iD(e,t)},iP="0deg",iD=function(e,t){var n=t||this,i=n.xPercent,r=n.yPercent,a=n.x,s=n.y,o=n.z,l=n.rotation,c=n.rotationY,u=n.rotationX,h=n.skewX,d=n.skewY,f=n.scaleX,p=n.scaleY,m=n.transformPerspective,g=n.force3D,_=n.target,v=n.zOrigin,x="",y="auto"===g&&e&&1!==e||!0===g;if(v&&(u!==iP||c!==iP)){var M,S=parseFloat(c)*nF,T=Math.sin(S),E=Math.cos(S);a=iR(_,a,-(T*(M=Math.cos(S=parseFloat(u)*nF))*v)),s=iR(_,s,-(-Math.sin(S)*v)),o=iR(_,o,-(E*M*v)+v)}"0px"!==m&&(x+="perspective("+m+") "),(i||r)&&(x+="translate("+i+"%, "+r+"%) "),(y||"0px"!==a||"0px"!==s||"0px"!==o)&&(x+="0px"!==o||y?"translate3d("+a+", "+s+", "+o+") ":"translate("+a+", "+s+") "),l!==iP&&(x+="rotate("+l+") "),c!==iP&&(x+="rotateY("+c+") "),u!==iP&&(x+="rotateX("+u+") "),(h!==iP||d!==iP)&&(x+="skew("+h+", "+d+") "),(1!==f||1!==p)&&(x+="scale("+f+", "+p+") "),_.style[n3]=x||"translate(0, 0)"},iL=function(e,t){var n,i,r,a,s,o=t||this,l=o.xPercent,c=o.yPercent,u=o.x,h=o.y,d=o.rotation,f=o.skewX,p=o.skewY,m=o.scaleX,g=o.scaleY,_=o.target,v=o.xOrigin,x=o.yOrigin,y=o.xOffset,M=o.yOffset,S=o.forceCSS,T=parseFloat(u),E=parseFloat(h);d=parseFloat(d),f=parseFloat(f),(p=parseFloat(p))&&(f+=p=parseFloat(p),d+=p),d||f?(d*=nF,f*=nF,n=Math.cos(d)*m,i=Math.sin(d)*m,r=-(Math.sin(d-f)*g),a=Math.cos(d-f)*g,f&&(p*=nF,r*=s=Math.sqrt(1+(s=Math.tan(f-p))*s),a*=s,p&&(n*=s=Math.sqrt(1+(s=Math.tan(p))*s),i*=s)),n=eb(n),i=eb(i),r=eb(r),a=eb(a)):(n=m,a=g,i=r=0),(T&&!~(u+"").indexOf("px")||E&&!~(h+"").indexOf("px"))&&(T=id(_,"x",u,"px"),E=id(_,"y",h,"px")),(v||x||y||M)&&(T=eb(T+v-(v*n+x*r)+y),E=eb(E+x-(v*i+x*a)+M)),(l||c)&&(T=eb(T+l/100*(s=_.getBBox()).width),E=eb(E+c/100*s.height)),s="matrix("+n+","+i+","+r+","+a+","+T+","+E+")",_.setAttribute("transform",s),S&&(_.style[n3]=s)},iU=function(e,t,n,i,r){var a,s,o=B(r),l=parseFloat(r)*(o&&~r.indexOf("rad")?nO:1)-i,c=i+l+"deg";return o&&("short"===(a=r.split("_")[1])&&(l%=360)!=l%180&&(l+=l<0?360:-360),"cw"===a&&l<0?l=(l+36e9)%360-360*~~(l/360):"ccw"===a&&l>0&&(l=(l-36e9)%360-360*~~(l/360))),e._pt=s=new nf(e._pt,t,n,i,l,nW),s.e=c,s.u="deg",e._props.push(n),s},iN=function(e,t){for(var n in t)e[n]=t[n];return e},iI=function(e,t,n){var i,r,a,s,o,l,c,u=iN({},n._gsap),h=n.style;for(r in u.svg?(a=n.getAttribute("transform"),n.setAttribute("transform",""),h[n3]=t,i=iw(n,1),il(n,n3),n.setAttribute("transform",a)):(a=getComputedStyle(n)[n3],h[n3]=t,i=iw(n,1),h[n3]=a),nI)(a=u[r])!==(s=i[r])&&0>"perspective,force3D,transformOrigin,svgOrigin".indexOf(r)&&(o=tn(a)!==(c=tn(s))?id(n,r,a,c):parseFloat(a),l=parseFloat(s),e._pt=new nf(e._pt,i,r,o,l-o,nG),e._pt.u=c||0,e._props.push(r));iN(i,u)};eE("padding,margin,Width,Radius",function(e,t){var n="Right",i="Bottom",r="Left",a=(t<3?["Top",n,i,r]:["Top"+r,"Top"+n,i+n,i+r]).map(function(n){return t<2?e+n:"border"+n+e});ix[t>1?"border"+e:e]=function(e,t,n,i,r){var s,o;if(arguments.length<4)return 5===(o=(s=a.map(function(t){return ip(e,t,n
1)})).join(" ")).split(s[0]).length?s[0]:o;s=(i+"").split(" "),o={},a.forEach(function(e,t){return o[e]=s[t]=s[t]||s[(t-1)/2|0]}),e.init(t,o,r)}});var iO={name:"css",register:ii,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,i,r){var a,s,o,l,c,u,h,d,f,p,m,g,_,v,x,y,M,S=this._props,T=e.style,E=n.vars.startAt;for(h in nP||ii(),this.styles=this.styles||n8(e),y=this.styles.props,this.tween=n,t)if("autoRound"!==h&&(s=t[h],!(eg[h]&&t1(h,t,n,i,e,r)))){if(c=typeof s,u=ix[h],"function"===c&&(c=typeof(s=s.call(n,i,e,r))),"string"===c&&~s.indexOf("random(")&&(s=tf(s)),u)u(this,e,h,s,n)&&(x=1);else if("--"===h.substr(0,2))a=(getComputedStyle(e).getPropertyValue(h)+"").trim(),s+="",tb.lastIndex=0,!tb.test(a)&&(d=tn(a),(f=tn(s))?d!==f&&(a=id(e,h,a,f)+f):d&&(s+=d)),this.add(T,"setProperty",a,s,i,r,0,0,h),S.push(h),y.push(h,0,T[h]);else if("undefined"!==c){if(E&&h in E?(B(a="function"==typeof E[h]?E[h].call(n,i,e,r):E[h])&&~a.indexOf("random(")&&(a=tf(a)),tn(a+"")||"auto"===a||(a+=P.units[h]||tn(ip(e,h))||""),"="===(a+"").charAt(1)&&(a=ip(e,h))):a=ip(e,h),l=parseFloat(a),(p="string"===c&&"="===s.charAt(1)&&s.substr(0,2))&&(s=s.substr(2)),o=parseFloat(s),h in nH&&("autoAlpha"===h&&(1===l&&"hidden"===ip(e,"visibility")&&o&&(l=0),y.push("visibility",0,T.visibility),ic(this,T,"visibility",l?"inherit":"hidden",o?"inherit":"hidden",!o)),"scale"!==h&&"transform"!==h&&~(h=nH[h]).indexOf(",")&&(h=h.split(",")[0])),m=h in nI){if(this.styles.save(h),M=s,"string"===c&&"var(--"===s.substring(0,6)){if("calc("===(s=n7(e,s.substring(4,s.indexOf(")")))).substring(0,5)){var b=e.style.perspective;e.style.perspective=s,s=n7(e,"perspective"),b?e.style.perspective=b:il(e,"perspective")}o=parseFloat(s)}if(g||((_=e._gsap).renderTransform&&!t.parseTransform||iw(e,t.parseTransform),v=!1!==t.smoothOrigin&&_.smooth,(g=this._pt=new nf(this._pt,T,n3,0,1,_.renderTransform,_,0,-1)).dep=1),"scale"===h)this._pt=new nf(this._pt,_,"scaleY",_.scaleY,(p?eA(_.scaleY,p+o):o)-_.scaleY||0,nG),this._pt.u=0,S.push("scaleY",h),h+="X";else if("transformOrigin"===h){y.push(n2,0,T[n2]),s=i_(s),_.svg?ib(e,s,0,v,0,this):((f=parseFloat(s.split(" ")[2])||0)!==_.zOrigin&&ic(this,_,"zOrigin",_.zOrigin,f),ic(this,T,h,iA(a),iA(s)));continue}else if("svgOrigin"===h){ib(e,s,1,v,0,this);continue}else if(h in iM){iU(this,_,h,l,p?eA(l,p+s):s);continue}else if("smoothOrigin"===h){ic(this,_,"smooth",_.smooth,s);continue}else if("force3D"===h){_[h]=s;continue}else if("transform"===h){iI(this,s,e);continue}}else h in T||(h=it(h)||h);if(m||(o||0===o)&&(l||0===l)&&!nV.test(s)&&h in T)d=(a+"").substr((l+"").length),o||(o=0),f=tn(s)||(h in P.units?P.units[h]:d),d!==f&&(l=id(e,h,a,f)),this._pt=new nf(this._pt,m?_:T,h,l,(p?eA(l,p+o):o)-l,!m&&("px"===f||"zIndex"===h)&&!1!==t.autoRound?nY:nG),this._pt.u=f||0,m&&M!==s?(this._pt.b=a,this._pt.e=M,this._pt.r=nj):d!==f&&"%"!==f&&(this._pt.b=a,this._pt.r=nX);else if(h in T)im.call(this,e,h,a,p?p+s:s);else if(h in e)this.add(e,h,a||e[h],p?p+s:s,i,r);else if("parseTransform"!==h){es(h,s);continue}m||(h in T?y.push(h,0,T[h]):"function"==typeof e[h]?y.push(h,2,e[h]()):y.push(h,1,a||e[h])),S.push(h)}}x&&nd(this)},render:function(e,t){if(t.tween._time||!nU())for(var n=t._pt;n;)n.r(e,n.d),n=n._next;else t.styles.revert()},get:ip,aliases:nH,getSetter:function(e,t,n){var i=nH[t];return i&&0>i.indexOf(",")&&(t=i),t in nI&&t!==n2&&(e._gsap.x||ip(e,"x"))?n&&nL===n?"scale"===t?nQ:n$:(nL=n||{},"scale"===t?n0:n1):e.style&&!V(e.style[t])?nZ:~t.indexOf("-")?nJ:nr(e,t)},core:{_removeProperty:il,_getMatrix:iE}};nA.utils.checkPrefix=it,nA.core.getStyleSaver=n8,iz=eE("x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+(iB="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",function(e){nI[e]=1}),eE(iB,function(e){P.units[e]="deg",iM[e]=1}),nH[iz[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+iB,eE("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",function(e){var t=e.split(":");nH[t[1]]=iz[t[0]]}),eE("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(e){P.units[e]="px"}),nA.registerPlugin(iO);var iF=nA.registerPlugin(iO)||nA;iF.core.Tween;var iB,iz,ik,iV,iH,iG,iW,iX,ij,iY,iq,iK,iZ,iJ,i$,iQ=function(){return ik||"u">typeof window&&(ik=window.gsap)&&ik.registerPlugin&&ik},i0=1,i1=[],i3=[],i2=[],i4=Date.now,i5=function(e,t){return t},i6=function(){var e=iq.core,t=e.bridge||{},n=e._scrollers,i=e._proxies;n.push.apply(n,i3),i.push.apply(i,i2),i3=n,i2=i,i5=function(e,n){return t[e](n)}},i8=function(e,t){return~i2.indexOf(e)&&i2[i2.indexOf(e)+1][t]},i9=function(e){return!!~iK.indexOf(e)},i7=function(e,t,n,i,r){return e.addEventListener(t,n,{passive:!1!==i,capture:!!r})},re=function(e,t,n,i){return e.removeEventListener(t,n,!!i)},rt="scrollLeft",rn="scrollTop",ri=function(){return iZ&&iZ.isPressed||i3.cache++},rr=function(e,t){var n=function n(i){if(i||0===i){i0&&(iH.history.scrollRestoration="manual");var r=iZ&&iZ.isPressed;e(i=n.v=Math.round(i)||(iZ&&iZ.iOS?1:0)),n.cacheID=i3.cache,r&&i5("ss",i)}else(t||i3.cache!==n.cacheID||i5("ref"))&&(n.cacheID=i3.cache,n.v=e());return n.v+n.offset};return n.offset=0,e&&n},ra={s:rt,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:rr(function(e){return arguments.length?iH.scrollTo(e,rs.sc()):iH.pageXOffset||iG[rt]||iW[rt]||iX[rt]||0})},rs={s:rn,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:ra,sc:rr(function(e){return arguments.length?iH.scrollTo(ra.sc(),e):iH.pageYOffset||iG[rn]||iW[rn]||iX[rn]||0})},ro=function(e,t){return(t&&t._ctx&&t._ctx.selector||ik.utils.toArray)(e)[0]||("string"==typeof e&&!1!==ik.config().nullTargetWarn?console.warn("Element not found:",e):null)},rl=function(e,t){for(var n=t.length;n--;)if(t[n]===e||t[n].contains(e))return!0;return!1},rc=function(e,t){var n=t.s,i=t.sc;i9(e)&&(e=iG.scrollingElement||iW);var r=i3.indexOf(e),a=i===rs.sc?1:2;~r||(r=i3.push(e)-1),i3[r+a]||i7(e,"scroll",ri);var s=i3[r+a],o=s||(i3[r+a]=rr(i8(e,n),!0)||(i9(e)?i:rr(function(t){return arguments.length?e[n]=t:e[n]})));return o.target=e,s||(o.smooth="smooth"===ik.getProperty(e,"scrollBehavior")),o},ru=function(e,t,n){var i=e,r=e,a=i4(),s=a,o=t||50,l=Math.max(500,3*o),c=function(e,t){var l=i4();t||l-a>o?(r=i,i=e,s=a,a=l):n?i+=e:i=r+(e-r)/(l-s)*(a-s)};return{update:c,reset:function(){r=i=n?0:i,s=a=0},getVelocity:function(e){var t=s,o=r,u=i4();return(e||0===e)&&e!==i&&c(e),a===s||u-s>l?0:(i+(n?o:-o))/((n?u:a)-t)*1e3}}},rh=function(e,t){return t&&!e._gsapAllow&&e.preventDefault(),e.changedTouches?e.changedTouches[0]:e},rd=function(e){var t=Math.max.apply(Math,e),n=Math.min.apply(Math,e);return Math.abs(t)>=Math.abs(n)?t:n},rf=function(){(iq=ik.core.globals().ScrollTrigger)&&iq.core&&i6()},rp=function(e){return ik=e||iQ(),!iV&&ik&&"u">typeof document&&document.body&&(iH=window,iW=(iG=document).documentElement,iX=iG.body,iK=[iH,iG,iW,iX],ik.utils.clamp,i$=ik.core.context||function(){},iY="onpointerenter"in iX?"pointer":"mouse",ij=rm.isTouch=iH.matchMedia&&iH.matchMedia("(hover: none), (pointer: coarse)").matches?1:2*("ontouchstart"in iH||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),iJ=rm.eventTypes=("ontouchstart"in iW?"touchstart,touchmove,touchcancel,touchend":!("onpointerdown"in iW)?"mousedown,mousemove,mouseup,mouseup":"pointerdown,pointermove,pointercancel,pointerup").split(","),setTimeout(function(){return i0=0},500),rf(),iV=1),iV};ra.op=rs,i3.cache=0;var rm=function(){var e;function t(e){this.init(e)}return t.prototype.init=function(e){iV||rp(ik)||console.warn("Please gsap.registerPlugin(Observer)"),iq||rf();var t=e.tolerance,n=e.dragMinimum,i=e.type,r=e.target,a=e.lineHeight,s=e.debounce,o=e.preventDefault,l=e.onStop,c=e.onStopDelay,u=e.ignore,h=e.wheelSpeed,d=e.event,f=e.onDragStart,p=e.onDragEnd,m=e.onDrag,g=e.onPress,_=e.onRelease,v=e.onRight,x=e.onLeft,y=e.onUp,M=e.onDown,S=e.onCh
vendor: 15,964 bytes, line 1
1angeX,T=e.onChangeY,E=e.onChange,b=e.onToggleX,w=e.onToggleY,A=e.onHover,R=e.onHoverEnd,C=e.onMove,P=e.ignoreCheck,D=e.isNormalizer,L=e.onGestureStart,U=e.onGestureEnd,N=e.onWheel,I=e.onEnable,O=e.onDisable,F=e.onClick,B=e.scrollSpeed,z=e.capture,k=e.allowClicks,V=e.lockAxis,H=e.onLockAxis;this.target=r=ro(r)||iW,this.vars=e,u&&(u=ik.utils.toArray(u)),t=t||1e-9,n=n||0,h=h||1,B=B||1,i=i||"wheel,touch,pointer",s=!1!==s,a||(a=parseFloat(iH.getComputedStyle(iX).lineHeight)||22);var G,W,X,j,Y,q,K,Z=this,J=0,$=0,Q=e.passive||!o&&!1!==e.passive,ee=rc(r,ra),et=rc(r,rs),en=ee(),ei=et(),er=~i.indexOf("touch")&&!~i.indexOf("pointer")&&"pointerdown"===iJ[0],ea=i9(r),es=r.ownerDocument||iG,eo=[0,0,0],el=[0,0,0],ec=0,eu=function(){return ec=i4()},eh=function(e,t){return(Z.event=e)&&u&&rl(e.target,u)||t&&er&&"touch"!==e.pointerType||P&&P(e,t)},ed=function(){var e=Z.deltaX=rd(eo),n=Z.deltaY=rd(el),i=Math.abs(e)>=t,r=Math.abs(n)>=t;E&&(i||r)&&E(Z,e,n,eo,el),i&&(v&&Z.deltaX>0&&v(Z),x&&Z.deltaX<0&&x(Z),S&&S(Z),b&&Z.deltaX<0!=J<0&&b(Z),J=Z.deltaX,eo[0]=eo[1]=eo[2]=0),r&&(M&&Z.deltaY>0&&M(Z),y&&Z.deltaY<0&&y(Z),T&&T(Z),w&&Z.deltaY<0!=$<0&&w(Z),$=Z.deltaY,el[0]=el[1]=el[2]=0),(j||X)&&(C&&C(Z),X&&(f&&1===X&&f(Z),m&&m(Z),X=0),j=!1),q&&(q=!1,1)&&H&&H(Z),Y&&(N(Z),Y=!1),G=0},ef=function(e,t,n){eo[n]+=e,el[n]+=t,Z._vx.update(e),Z._vy.update(t),s?G||(G=requestAnimationFrame(ed)):ed()},ep=function(e,t){V&&!K&&(Z.axis=K=Math.abs(e)>Math.abs(t)?"x":"y",q=!0),"y"!==K&&(eo[2]+=e,Z._vx.update(e,!0)),"x"!==K&&(el[2]+=t,Z._vy.update(t,!0)),s?G||(G=requestAnimationFrame(ed)):ed()},em=function(e){if(!eh(e,1)){var t=(e=rh(e,o)).clientX,i=e.clientY,r=t-Z.x,a=i-Z.y,s=Z.isDragging;Z.x=t,Z.y=i,(s||(r||a)&&(Math.abs(Z.startX-t)>=n||Math.abs(Z.startY-i)>=n))&&(X||(X=s?2:1),s||(Z.isDragging=!0),ep(r,a))}},eg=Z.onPress=function(e){eh(e,1)||e&&e.button||(Z.axis=K=null,W.pause(),Z.isPressed=!0,e=rh(e),J=$=0,Z.startX=Z.x=e.clientX,Z.startY=Z.y=e.clientY,Z._vx.reset(),Z._vy.reset(),i7(D?r:es,iJ[1],em,Q,!0),Z.deltaX=Z.deltaY=0,g&&g(Z))},e_=Z.onRelease=function(e){if(!eh(e,1)){re(D?r:es,iJ[1],em,!0);var t=!isNaN(Z.y-Z.startY),n=Z.isDragging,i=n&&(Math.abs(Z.x-Z.startX)>3||Math.abs(Z.y-Z.startY)>3),a=rh(e);!i&&t&&(Z._vx.reset(),Z._vy.reset(),o&&k&&ik.delayedCall(.08,function(){if(i4()-ec>300&&!e.defaultPrevented){if(e.target.click)e.target.click();else if(es.createEvent){var t=es.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,iH,1,a.screenX,a.screenY,a.clientX,a.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(t)}}})),Z.isDragging=Z.isGesturing=Z.isPressed=!1,l&&n&&!D&&W.restart(!0),X&&ed(),p&&n&&p(Z),_&&_(Z,i)}},ev=function(e){return e.touches&&e.touches.length>1&&(Z.isGesturing=!0)&&L(e,Z.isDragging)},ex=function(){return Z.isGesturing=!1,U(Z)},ey=function(e){if(!eh(e)){var t=ee(),n=et();ef((t-en)*B,(n-ei)*B,1),en=t,ei=n,l&&W.restart(!0)}},eM=function(e){if(!eh(e)){e=rh(e,o),N&&(Y=!0);var t=(1===e.deltaMode?a:2===e.deltaMode?iH.innerHeight:1)*h;ef(e.deltaX*t,e.deltaY*t,0),l&&!D&&W.restart(!0)}},eS=function(e){if(!eh(e)){var t=e.clientX,n=e.clientY,i=t-Z.x,r=n-Z.y;Z.x=t,Z.y=n,j=!0,l&&W.restart(!0),(i||r)&&ep(i,r)}},eT=function(e){Z.event=e,A(Z)},eE=function(e){Z.event=e,R(Z)},eb=function(e){return eh(e)||rh(e,o)&&F(Z)};W=Z._dc=ik.delayedCall(c||.25,function(){Z._vx.reset(),Z._vy.reset(),W.pause(),l&&l(Z)}).pause(),Z.deltaX=Z.deltaY=0,Z._vx=ru(0,50,!0),Z._vy=ru(0,50,!0),Z.scrollX=ee,Z.scrollY=et,Z.isDragging=Z.isGesturing=Z.isPressed=!1,i$(this),Z.enable=function(e){return!Z.isEnabled&&(i7(ea?es:r,"scroll",ri),i.indexOf("scroll")>=0&&i7(ea?es:r,"scroll",ey,Q,z),i.indexOf("wheel")>=0&&i7(r,"wheel",eM,Q,z),(i.indexOf("touch")>=0&&ij||i.indexOf("pointer")>=0)&&(i7(r,iJ[0],eg,Q,z),i7(es,iJ[2],e_),i7(es,iJ[3],e_),k&&i7(r,"click",eu,!0,!0),F&&i7(r,"click",eb),L&&i7(es,"gesturestart",ev),U&&i7(es,"gestureend",ex),A&&i7(r,iY+"enter",eT),R&&i7(r,iY+"leave",eE),C&&i7(r,iY+"move",eS)),Z.isEnabled=!0,Z.isDragging=Z.isGesturing=Z.isPressed=j=X=!1,Z._vx.reset(),Z._vy.reset(),en=ee(),ei=et(),e&&e.type&&eg(e),I&&I(Z)),Z},Z.disable=function(){Z.isEnabled&&(i1.filter(function(e){return e!==Z&&i9(e.target)}).length||re(ea?es:r,"scroll",ri),Z.isPressed&&(Z._vx.reset(),Z._vy.reset(),re(D?r:es,iJ[1],em,!0)),re(ea?es:r,"scroll",ey,z),re(r,"wheel",eM,z),re(r,iJ[0],eg,z),re(es,iJ[2],e_),re(es,iJ[3],e_),re(r,"click",eu,!0),re(r,"click",eb),re(es,"gesturestart",ev),re(es,"gestureend",ex),re(r,iY+"enter",eT),re(r,iY+"leave",eE),re(r,iY+"move",eS),Z.isEnabled=Z.isPressed=Z.isDragging=!1,O&&O(Z))},Z.kill=Z.revert=function(){Z.disable();var e=i1.indexOf(Z);e>=0&&i1.splice(e,1),iZ===Z&&(iZ=0)},i1.push(Z),D&&i9(r)&&(iZ=Z),Z.enable(d)},e=[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}],function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(t.prototype,e),t}();rm.version="3.14.2",rm.create=function(e){return new rm(e)},rm.register=rp,rm.getAll=function(){return i1.slice()},rm.getById=function(e){return i1.filter(function(t){return t.vars.id===e})[0]},iQ()&&ik.registerPlugin(rm);var rg,r_,rv,rx,ry,rM,rS,rT,rE,rb,rw,rA,rR,rC,rP,rD,rL,rU,rN,rI,rO,rF,rB,rz,rk,rV,rH,rG,rW,rX,rj,rY,rq,rK,rZ,rJ,r$,rQ,r0=1,r1=Date.now,r3=r1(),r2=0,r4=0,r5=function(e,t,n){var i=ac(e)&&("clamp("===e.substr(0,6)||e.indexOf("max")>-1);return n["_"+t+"Clamp"]=i,i?e.substr(6,e.length-7):e},r6=function(e,t){return t&&(!ac(e)||"clamp("!==e.substr(0,6))?"clamp("+e+")":e},r8=function(){return rC=1},r9=function(){return rC=0},r7=function(e){return e},ae=function(e){return Math.round(1e5*e)/1e5||0},at=function(){return"u">typeof window},an=function(){return rg||at()&&(rg=window.gsap)&&rg.registerPlugin&&rg},ai=function(e){return!!~rS.indexOf(e)},ar=function(e){return("Height"===e?rj:rv["inner"+e])||ry["client"+e]||rM["client"+e]},aa=function(e){return i8(e,"getBoundingClientRect")||(ai(e)?function(){return sd.width=rv.innerWidth,sd.height=rj,sd}:function(){return aD(e)})},as=function(e,t,n){var i=n.d,r=n.d2,a=n.a;return(a=i8(e,"getBoundingClientRect"))?function(){return a()[i]}:function(){return(t?ar(r):e["client"+r])||0}},ao=function(e,t){var n=t.s,i=t.d2,r=t.d,a=t.a;return Math.max(0,(a=i8(e,n="scroll"+i))?a()-aa(e)()[r]:ai(e)?(ry[n]||rM[n])-ar(i):e[n]-e["offset"+i])},al=function(e,t){for(var n=0;n<rN.length;n+=3)(!t||~t.indexOf(rN[n+1]))&&e(rN[n],rN[n+1],rN[n+2])},ac=function(e){return"string"==typeof e},au=function(e){return"function"==typeof e},ah=function(e){return"number"==typeof e},ad=function(e){return"object"==typeof e},af=function(e,t,n){return e&&e.progress(+!t)&&n&&e.pause()},ap=function(e,t){if(e.enabled){var n=e._ctx?e._ctx.add(function(){return t(e)}):t(e);n&&n.totalTime&&(e.callbackAnimation=n)}},am=Math.abs,ag="left",a_="right",av="bottom",ax="width",ay="height",aM="Right",aS="Left",aT="Bottom",aE="padding",ab="margin",aw="Width",aA="Height",aR=function(e){return rv.getComputedStyle(e)},aC=function(e){var t=aR(e).position;e.style.position="absolute"===t||"fixed"===t?t:"relative"},aP=function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e},aD=function(e,t){var n=t&&"matrix(1, 0, 0, 1, 0, 0)"!==aR(e)[rP]&&rg.to(e,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),i=e.getBoundingClientRect();return n&&n.progress(0).kill(),i},aL=function(e,t){var n=t.d2;return e["offset"+n]||e["client"+n]||0},aU=function(e){var t,n=[],i=e.labels,r=e.duration();for(t in i)n.push(i[t]/r);return n},aN=function(e){var t=rg.utils.snap(e),n=Array.isArray(e)&&e.slice(0).sort(function(e,t){return e-t});return n?function(e,i,r){var a;if(void 0===r&&(r=.001),!i)return t(e);if(i>0){for(e-=r,a=0;a<n.length;a++)if(n[a]>=e)return n[a];return n[a-1]}for(a=n.length,e+=r;a--;)if(n[a]<=e)return n[a];return n[0]}:function(n,i,r){void 0===r&&(r=.001);var a=t(n);return!i||Math.abs(a-n)<r||a-n<0==i<0?a:t(i<0?n-e:n+e)}},aI=function(e,t,n,i){return n.split(",").forEach(function(n){return e(t,n,i)})},aO=function(e,t,n,i,r){return e.addEventListener(t,n,{passive:!i,capture:!!r})},aF=function(e,t,n,i){return e.removeEventListener(t,n,!!i)},aB=function(e,t,n){(n=n&&n.wheelHandler)&&(e(t,"wheel",n),e(t,"touchmove",n))},az={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},ak={toggleActions:"play",anticipatePin:0},aV={top:0,left:0,center:.5,bottom:1,right:1},aH=function(e,t){if(ac(e)){var n=e.indexOf("="),i=~n?(e.charAt(n-1)+1)*parseFloat(e.substr(n+1)):0;~n&&(e.indexOf("%")>n&&(i*=t/100),e=e.substr(0,n-1)),e=i+(e in aV?aV[e]*t:~e.indexOf("%")?parseFloat(e)*t/100:parseFloat(e)||0)}return e},aG=function(e,t,n,i,r,a,s,o){var l=r.startColor,c=r.endColor,u=r.fontSize,h=r.indent,d=r.fontWeight,f=rx.createElement("div"),p=ai(n)||"fixed"===i8(n,"pinType"),m=-1!==e.indexOf("scroller"),g=p?rM:n,_=-1!==e.indexOf("start"),v=_?l:c,x="border-color:"+v+";font-size:"+u+";color:"+v+";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 x+="position:"+((m||o)&&p?"fixed;":"absolute;"),(m||o||!p)&&(x+=(i===rs?a_:av)+":"+(a+parseFloat(h))+"px;"),s&&(x+="box-sizing:border-box;text-align:left;width:"+s.offsetWidth+"px;"),f._isStart=_,f.setAttribute("class","gsap-marker-"+e+(t?" marker-"+t:"")),f.style.cssText=x,f.innerText=t||0===t?e+"-"+t:e,g.children[0]?g.insertBefore(f,g.children[0]):g.appendChild(f),f._offset=f["offset"+i.op.d2],aW(f,0,i,_),f},aW=function(e,t,n,i){var r={display:"block"},a=n[i?"os2":"p2"],s=n[i?"p2":"os2"];e._isFlipped=i,r[n.a+"Percent"]=i?-100:0,r[n.a]=i?"1px":0,r["border"+a+aw]=1,r["border"+s+aw]=0,r[n.p]=t+"px",rg.set(e,r)},aX=[],aj={},aY=function(){return r1()-r2>34&&(rZ||(rZ=requestAnimationFrame(si)))},aq=function(){rB&&rB.isPressed&&!(rB.startX>rM.clientWidth)||(i3.cache++,rB?rZ||(rZ=requestAnimationFrame(si)):si(),r2||a0("scrollStart"),r2=r1())},aK=function(){rV=rv.innerWidth,rk=rv.innerHeight},aZ=function(e){i3.cache++,(!0===e||!rR&&!rF&&!rx.fullscreenElement&&!rx.webkitFullscreenElement&&(!rz||rV!==rv.innerWidth||Math.abs(rv.innerHeight-rk)>.25*rv.innerHeight))&&rT.restart(!0)},aJ={},a$=[],aQ=function e(){return aF(sx,"scrollEnd",e)||se(!0)},a0=function(e){return aJ[e]&&aJ[e].map(function(e){return e()})||a$},a1=[],a3=function(e){for(var t=0;t<a1.length;t+=5)(!e||a1[t+4]&&a1[t+4].query===e)&&(a1[t].style.cssText=a1[t+1],a1[t].getBBox&&a1[t].setAttribute("transform",a1[t+2]||""),a1[t+3].uncache=1)},a2=function(){return i3.forEach(function(e){return au(e)&&++e.cacheID&&(e.rec=e())})},a4=function(e,t){var n;for(rD=0;rD<aX.length;rD++)(n=aX[rD])&&(!t||n._ctx===t)&&(e?n.kill(1):n.revert(!0,!0));rY=!0,t&&a3(t),t||a0("revert")},a5=function(e,t){i3.cache++,(t||!rJ)&&i3.forEach(function(e){return au(e)&&e.cacheID++&&(e.rec=0)}),ac(e)&&(rv.history.scrollRestoration=rW=e)},a6=0,a8=function(){if(r$!==a6){var e=r$=a6;requestAnimationFrame(function(){return e===a6&&se(!0)})}},a9=function(){rM.appendChild(rX),rj=!rB&&rX.offsetHeight||rv.innerHeight,rM.removeChild(rX)},a7=function(e){return rE(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach(function(t){return t.style.display=e?"none":"block"})},se=function(e,t){if(ry=rx.documentElement,rM=rx.body,rS=[rv,rx,ry,rM],r2&&!e&&!rY)return void aO(sx,"scrollEnd",aQ);a9(),rJ=sx.isRefreshing=!0,rY||a2();var n=a0("refreshInit");rI&&sx.sort(),t||a4(),i3.forEach(function(e){au(e)&&(e.smooth&&(e.target.style.scrollBehavior="auto"),e(0))}),aX.slice(0).forEach(function(e){return e.refresh()}),rY=!1,aX.forEach(function(e){if(e._subPinOffset&&e.pin){var t=e.vars.horizontal?"offsetWidth":"offsetHeight",n=e.pin[t];e.revert(!0,1),e.adjustPinSpacing(e.pin[t]-n),e.refresh()}}),rq=1,a7(!0),aX.forEach(function(e){var t=ao(e.scroller,e._dir),n="max"===e.vars.end||e._endClamp&&e.end>t,i=e._startClamp&&e.start>=t;(n||i)&&e.setPositions(i?t-1:e.start,n?Math.max(i?t:e.start+1,t):e.end,!0)}),a7(!1),rq=0,n.forEach(function(e){return e&&e.render&&e.render(-1)}),i3.forEach(function(e){au(e)&&(e.smooth&&requestAnimationFrame(function(){return e.target.style.scrollBehavior="smooth"}),e.rec&&e(e.rec))}),a5(rW,1),rT.pause(),a6++,rJ=2,si(2),aX.forEach(function(e){return au(e.vars.onRefresh)&&e.vars.onRefresh(e)}),rJ=sx.isRefreshing=!1,a0("refresh")},st=0,sn=1,si=function(e){if(2===e||!rJ&&!rY){sx.isUpdating=!0,rQ&&rQ.update(0);var t=aX.length,n=r1(),i=n-r3>=50,r=t&&aX[0].scroll();if(sn=st>r?-1:1,rJ||(st=r),i&&(r2&&!rC&&n-r2>200&&(r2=0,a0("scrollEnd")),rw=r3,r3=n),sn<0){for(rD=t;rD-- >0;)aX[rD]&&aX[rD].update(0,i);sn=1}else for(rD=0;rD<t;rD++)aX[rD]&&aX[rD].update(0,i);sx.isUpdating=!1}rZ=0},sr=[ag,"top",av,a_,ab+aT,ab+aM,ab+"Top",ab+aS,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],sa=sr.concat([ax,ay,"boxSizing","max"+aw,"max"+aA,"position",ab,aE,aE+"Top",aE+aM,aE+aT,aE+aS]),ss=function(e,t,n){sc(n);var i=e._gsap;if(i.spacerIsNative)sc(i.spacerState);else if(e._gsap.swappedIn){var r=t.parentNode;r&&(r.insertBefore(e,t),r.removeChild(t))}e._gsap.swappedIn=!1},so=function(e,t,n,i){if(!e._gsap.swappedIn){for(var r,a=sr.length,s=t.style,o=e.style;a--;)s[r=sr[a]]=n[r];s.position="absolute"===n.position?"absolute":"relative","inline"===n.display&&(s.display="inline-block"),o[av]=o[a_]="auto",s.flexBasis=n.flexBasis||"auto",s.overflow="visible",s.boxSizing="border-box",s[ax]=aL(e,ra)+"px",s[ay]=aL(e,rs)+"px",s[aE]=o[ab]=o.top=o[ag]="0",sc(i),o[ax]=o["max"+aw]=n[ax],o[ay]=o["max"+aA]=n[ay],o[aE]=n[aE],e.parentNode!==t&&(e.parentNode.insertBefore(t,e),t.appendChild(e)),e._gsap.swappedIn=!0}},sl=/([A-Z])/g,sc=function(e){if(e){var t,n,i=e.t.style,r=e.length,a=0;for((e.t._gsap||rg.core.getCache(e.t)).uncache=1;a<r;a+=2)n=e[a+1],t=e[a],n?i[t]=n:i[t]&&i.removeProperty(t.replace(sl,"-$1").toLowerCase())}},su=function(e){for(var t=sa.length,n=e.style,i=[],r=0;r<t;r++)i.push(sa[r],n[sa[r]]);return i.t=e,i},sh=function(e,t,n){for(var i,r=[],a=e.length,s=8*!!n;s<a;s+=2)i=e[s],r.push(i,i in t?t[i]:e[s+1]);return r.t=e.t,r},sd={left:0,top:0},sf=function(e,t,n,i,r,a,s,o,l,c,u,h,d,f){au(e)&&(e=e(o)),ac(e)&&"max"===e.substr(0,3)&&(e=h+("="===e.charAt(4)?aH("0"+e.substr(3),n):0));var p,m,g,_=d?d.time():0;if(d&&d.seek(0),isNaN(e)||(e*=1),ah(e))d&&(e=rg.utils.mapRange(d.scrollTrigger.start,d.scrollTrigger.end,0,h,e)),s&&aW(s,n,i,!0);else{au(t)&&(t=t(o));var v,x,y,M,S=(e||"0").split(" ");(v=aD(g=ro(t,o)||rM)||{}).left||v.top||"none"!==aR(g).display||(M=g.style.display,g.style.display="block",v=aD(g),M?g.style.display=M:g.style.removeProperty("display")),x=aH(S[0],v[i.d]),y=aH(S[1]||"0",n),e=v[i.p]-l[i.p]-c+x+r-y,s&&aW(s,y,i,n-y<20||s._isStart&&y>20),n-=n-y}if(f&&(o[f]=e||-.001,e<0&&(e=0)),a){var T=e+n,E=a._isStart;p="scroll"+i.d2,aW(a,T,i,E&&T>20||!E&&(u?Math.max(rM[p],ry[p]):a.parentNode[p])<=T+1),u&&(l=aD(s),u&&(a.style[i.op.p]=l[i.op.p]-i.op.m-a._offset+"px"))}return d&&g&&(p=aD(g),d.seek(h),m=aD(g),d._caScrollDist=p[i.p]-m[i.p],e=e/d._caScrollDist*h),d&&d.seek(_),d?e:Math.round(e)},sp=/(webkit|moz|length|cssText|inset)/i,sm=function(e,t,n,i){if(e.parentNode!==t){var r,a,s=e.style;if(t===rM){for(r in e._stOrig=s.cssText,a=aR(e))+r||sp.test(r)||!a[r]||"string"!=typeof s[r]||"0"===r||(s[r]=a[r]);s.top=n,s.left=i}else s.cssText=e._stOrig;rg.core.getCache(e).uncache=1,t.appendChild(e)}},sg=function(e,t,n){var i=t,r=i;return function(t){var a=Math.round(e());return a!==i&&a!==r&&Math.abs(a-i)>3&&Math.abs(a-r)>3&&(t=a,n&&n()),r=i,i=Math.round(t)}},s_=function(e,t,n){var i={};i[t.p]="+="+n,rg.set(e,i)},sv=function(e,t){var n=rc(e,t),i="_scroll"+t.p2,r=function t(r,a,s,o,l){var c=t.tween,u=a.onComplete,h={};s=s||n();var d=sg(n,s,function(){c.kill(),t.tween=0});return l=o&&l||0,o=o||r-s,c&&c.kill(),a[i]=r,a.inherit=!1,a.modifiers=h,h[i]=function(){return d(s+o*c.ratio+l*c.ratio*c.ratio)}
1,a.onUpdate=function(){i3.cache++,t.tween&&si()},a.onComplete=function(){t.tween=0,u&&u.call(c)},c=t.tween=rg.to(e,a)};return e[i]=n,n.wheelHandler=function(){return r.tween&&r.tween.kill()&&(r.tween=0)},aO(e,"wheel",n.wheelHandler),sx.isTouch&&aO(e,"touchmove",n.wheelHandler),r},sx=function(){function e(t,n){r_||e.register(rg)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),rG(this),this.init(t,n)}return e.prototype.init=function(t,n){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),!r4){this.update=this.refresh=this.kill=r7;return}var i,r,a,s,o,l,c,u,h,d,f,p,m,g,_,v,x,y,M,S,T,E,b,w,A,R,C,P,D,L,U,N,I,O,F,B,z,k,V,H,G,W=t=aP(ac(t)||ah(t)||t.nodeType?{trigger:t}:t,ak),X=W.onUpdate,j=W.toggleClass,Y=W.id,q=W.onToggle,K=W.onRefresh,Z=W.scrub,J=W.trigger,$=W.pin,Q=W.pinSpacing,ee=W.invalidateOnRefresh,et=W.anticipatePin,en=W.onScrubComplete,ei=W.onSnapComplete,er=W.once,ea=W.snap,es=W.pinReparent,eo=W.pinSpacer,el=W.containerAnimation,ec=W.fastScrollEnd,eu=W.preventOverlaps,eh=t.horizontal||t.containerAnimation&&!1!==t.horizontal?ra:rs,ed=!Z&&0!==Z,ef=ro(t.scroller||rv),ep=rg.core.getCache(ef),em=ai(ef),eg=("pinType"in t?t.pinType:i8(ef,"pinType")||em&&"fixed")==="fixed",e_=[t.onEnter,t.onLeave,t.onEnterBack,t.onLeaveBack],ev=ed&&t.toggleActions.split(" "),ex="markers"in t?t.markers:ak.markers,ey=em?0:parseFloat(aR(ef)["border"+eh.p2+aw])||0,eM=this,eS=t.onRefreshInit&&function(){return t.onRefreshInit(eM)},eT=as(ef,em,eh),eE=!em||~i2.indexOf(ef)?aa(ef):function(){return sd},eb=0,ew=0,eA=0,eR=rc(ef,eh);if(eM._startClamp=eM._endClamp=!1,eM._dir=eh,et*=45,eM.scroller=ef,eM.scroll=el?el.time.bind(el):eR,l=eR(),eM.vars=t,n=n||t.animation,"refreshPriority"in t&&(rI=1,-9999===t.refreshPriority&&(rQ=eM)),ep.tweenScroll=ep.tweenScroll||{top:sv(ef,rs),left:sv(ef,ra)},eM.tweenTo=a=ep.tweenScroll[eh.p],eM.scrubDuration=function(e){(F=ah(e)&&e)?O?O.duration(e):O=rg.to(n,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:F,paused:!0,onComplete:function(){return en&&en(eM)}}):(O&&O.progress(1).kill(),O=0)},n&&(n.vars.lazy=!1,n._initted&&!eM.isReverted||!1!==n.vars.immediateRender&&!1!==t.immediateRender&&n.duration()&&n.render(0,!0,!0),eM.animation=n.pause(),n.scrollTrigger=eM,eM.scrubDuration(Z),N=0,Y||(Y=n.vars.id)),ea&&((!ad(ea)||ea.push)&&(ea={snapTo:ea}),"scrollBehavior"in rM.style&&rg.set(em?[rM,ry]:ef,{scrollBehavior:"auto"}),i3.forEach(function(e){return au(e)&&e.target===(em?rx.scrollingElement||ry:ef)&&(e.smooth=!1)}),o=au(ea.snapTo)?ea.snapTo:"labels"===ea.snapTo?(i=n,function(e){return rg.utils.snap(aU(i),e)}):"labelsDirectional"===ea.snapTo?(r=n,function(e,t){return aN(aU(r))(e,t.direction)}):!1!==ea.directional?function(e,t){return aN(ea.snapTo)(e,r1()-ew<500?0:t.direction)}:rg.utils.snap(ea.snapTo),B=ad(B=ea.duration||{min:.1,max:2})?rb(B.min,B.max):rb(B,B),z=rg.delayedCall(ea.delay||F/2||.1,function(){var e=eR(),t=r1()-ew<500,i=a.tween;if((t||10>Math.abs(eM.getVelocity()))&&!i&&!rC&&eb!==e){var r,s,l=(e-u)/v,c=n&&!ed?n.totalProgress():l,d=t?0:(c-I)/(r1()-rw)*1e3||0,f=rg.utils.clamp(-l,1-l,am(d/2)*d/.185),p=l+(!1===ea.inertia?0:f),m=ea,g=m.onStart,_=m.onInterrupt,x=m.onComplete;if(ah(r=o(p,eM))||(r=p),s=Math.max(0,Math.round(u+r*v)),e<=h&&e>=u&&s!==e){if(i&&!i._initted&&i.data<=am(s-e))return;!1===ea.inertia&&(f=r-l),a(s,{duration:B(am(.185*Math.max(am(p-c),am(r-c))/d/.05||0)),ease:ea.ease||"power3",data:am(s-e),onInterrupt:function(){return z.restart(!0)&&_&&_(eM)},onComplete:function(){eM.update(),eb=eR(),n&&!ed&&(O?O.resetTo("totalProgress",r,n._tTime/n._tDur):n.progress(r)),N=I=n&&!ed?n.totalProgress():eM.progress,ei&&ei(eM),x&&x(eM)}},e,f*v,s-e-f*v),g&&g(eM,a.tween)}}else eM.isActive&&eb!==e&&z.restart(!0)}).pause()),Y&&(aj[Y]=eM),(G=(J=eM.trigger=ro(J||!0!==$&&$))&&J._gsap&&J._gsap.stRevert)&&(G=G(eM)),$=!0===$?J:ro($),ac(j)&&(j={targets:J,className:j}),$&&(!1===Q||Q===ab||(Q=(!!Q||!$.parentNode||!$.parentNode.style||"flex"!==aR($.parentNode).display)&&aE),eM.pin=$,(s=rg.core.getCache($)).spacer?x=s.pinState:(eo&&((eo=ro(eo))&&!eo.nodeType&&(eo=eo.current||eo.nativeElement),s.spacerIsNative=!!eo,eo&&(s.spacerState=su(eo))),s.spacer=S=eo||rx.createElement("div"),S.classList.add("pin-spacer"),Y&&S.classList.add("pin-spacer-"+Y),s.pinState=x=su($)),!1!==t.force3D&&rg.set($,{force3D:!0}),eM.spacer=S=s.spacer,R=(U=aR($))[Q+eh.os2],E=rg.getProperty($),b=rg.quickSetter($,eh.a,"px"),so($,S,U),M=su($)),ex){g=ad(ex)?aP(ex,az):az,p=aG("scroller-start",Y,ef,eh,g,0),m=aG("scroller-end",Y,ef,eh,g,0,p),T=p["offset"+eh.op.d2];var eC=ro(i8(ef,"content")||ef);d=this.markerStart=aG("start",Y,eC,eh,g,T,0,el),f=this.markerEnd=aG("end",Y,eC,eh,g,T,0,el),el&&(H=rg.quickSetter([d,f],eh.a,"px")),eg||i2.length&&!0===i8(ef,"fixedMarkers")||(aC(em?rM:ef),rg.set([p,m],{force3D:!0}),P=rg.quickSetter(p,eh.a,"px"),L=rg.quickSetter(m,eh.a,"px"))}
1if(el){var eP=el.vars.onUpdate,eD=el.vars.onUpdateParams;el.eventCallback("onUpdate",function(){eM.update(0,0,1),eP&&eP.apply(el,eD||[])})}if(eM.previous=function(){return aX[aX.indexOf(eM)-1]},eM.next=function(){return aX[aX.indexOf(eM)+1]},eM.revert=function(e,t){if(!t)return eM.kill(!0);var i=!1!==e||!eM.enabled,r=rR;i!==eM.isReverted&&(i&&(k=Math.max(eR(),eM.scroll.rec||0),eA=eM.progress,V=n&&n.progress()),d&&[d,f,p,m].forEach(function(e){return e.style.display=i?"none":"block"}),i&&(rR=eM,eM.update(i)),!$||es&&eM.isActive||(i?ss($,S,x):so($,S,aR($),C)),i||eM.update(i),rR=r,eM.isReverted=i)},eM.refresh=function(i,r,s,o){if(!rR&&eM.enabled||r){if($&&i&&r2)return void aO(e,"scrollEnd",aQ);!rJ&&eS&&eS(eM),rR=eM,a.tween&&!s&&(a.tween.kill(),a.tween=0),O&&O.pause(),ee&&n&&(n.revert({kill:!1}).invalidate(),n.getChildren?n.getChildren(!0,!0,!1).forEach(function(e){return e.vars.immediateRender&&e.render(0,!0,!0)}):n.vars.immediateRender&&n.render(0,!0,!0)),eM.isReverted||eM.revert(!0,!0),eM._subPinOffset=!1;var g,T,b,R,P,L,U,N,I,F,B,H,G,W=eT(),X=eE(),j=el?el.duration():ao(ef,eh),Y=v<=.01||!v,q=0,Z=o||0,et=ad(s)?s.end:t.end,en=t.endTrigger||J,ei=ad(s)?s.start:t.start||(0!==t.start&&J?$?"0 0":"0 100%":0),er=eM.pinnedContainer=t.pinnedContainer&&ro(t.pinnedContainer,eM),ea=J&&Math.max(0,aX.indexOf(eM))||0,eo=ea;for(ex&&ad(s)&&(H=rg.getProperty(p,eh.p),G=rg.getProperty(m,eh.p));eo-- >0;)(L=aX[eo]).end||L.refresh(0,1)||(rR=eM),(U=L.pin)&&(U===J||U===$||U===er)&&!L.isReverted&&(F||(F=[]),F.unshift(L),L.revert(!0,!0)),L!==aX[eo]&&(ea--,eo--);for(au(ei)&&(ei=ei(eM)),u=sf(ei=r5(ei,"start",eM),J,W,eh,eR(),d,p,eM,X,ey,eg,j,el,eM._startClamp&&"_startClamp")||($?-.001:0),au(et)&&(et=et(eM)),ac(et)&&!et.indexOf("+=")&&(~et.indexOf(" ")?et=(ac(ei)?ei.split(" ")[0]:"")+et:(q=aH(et.substr(2),W),et=ac(ei)?ei:(el?rg.utils.mapRange(0,el.duration(),el.scrollTrigger.start,el.scrollTrigger.end,u):u)+q,en=J)),et=r5(et,"end",eM),h=Math.max(u,sf(et||(en?"100% 0":j),en,W,eh,eR()+q,f,m,eM,X,ey,eg,j,el,eM._endClamp&&"_endClamp"))||-.001,q=0,eo=ea;eo--;)(U=(L=aX[eo]||{}).pin)&&L.start-L._pinPush<=u&&!el&&L.end>0&&(g=L.end-(eM._startClamp?Math.max(0,L.start):L.start),(U===J&&L.start-L._pinPush<u||U===er)&&isNaN(ei)&&(q+=g*(1-L.progress)),U===$&&(Z+=g));if(u+=q,h+=q,eM._startClamp&&(eM._startClamp+=q),eM._endClamp&&!rJ&&(eM._endClamp=h||-.001,h=Math.min(h,ao(ef,eh))),v=h-u||(u-=.01)&&.001,Y&&(eA=rg.utils.clamp(0,1,rg.utils.normalize(u,h,k))),eM._pinPush=Z,d&&q&&((g={})[eh.a]="+="+q,er&&(g[eh.p]="-="+eR()),rg.set([d,f],g)),$&&!(rq&&eM.end>=ao(ef,eh)))g=aR($),R=eh===rs,b=eR(),w=parseFloat(E(eh.a))+Z,!j&&h>1&&(B={style:B=(em?rx.scrollingElement||ry:ef).style,value:B["overflow"+eh.a.toUpperCase()]},em&&"scroll"!==aR(rM)["overflow"+eh.a.toUpperCase()]&&(B.style["overflow"+eh.a.toUpperCase()]="scroll")),so($,S,g),M=su($),T=aD($,!0),N=eg&&rc(ef,R?ra:rs)(),Q?((C=[Q+eh.os2,v+Z+"px"]).t=S,(eo=Q===aE?aL($,eh)+v+Z:0)&&(C.push(eh.d,eo+"px"),"auto"!==S.style.flexBasis&&(S.style.flexBasis=eo+"px")),sc(C),er&&aX.forEach(function(e){e.pin===er&&!1!==e.vars.pinSpacing&&(e._subPinOffset=!0)}),eg&&eR(k)):(eo=aL($,eh))&&"auto"!==S.style.flexBasis&&(S.style.flexBasis=eo+"px"),eg&&((P={top:T.top+(R?b-u:N)+"px",left:T.left+(R?N:b-u)+"px",boxSizing:"border-box",position:"fixed"})[ax]=P["max"+aw]=Math.ceil(T.width)+"px",P[ay]=P["max"+aA]=Math.ceil(T.height)+"px",P[ab]=P[ab+"Top"]=P[ab+aM]=P[ab+aT]=P[ab+aS]="0",P[aE]=g[aE],P[aE+"Top"]=g[aE+"Top"],P[aE+aM]=g[aE+aM],P[aE+aT]=g[aE+aT],P[aE+aS]=g[aE+aS],y=sh(x,P,es),rJ&&eR(0)),n?(I=n._initted,rO(1),n.render(n.duration(),!0,!0),A=E(eh.a)-w+v+Z,D=Math.abs(v-A)>1,eg&&D&&y.splice(y.length-2,2),n.render(0,!0,!0),I||n.invalidate(!0),n.parent||n.totalTime(n.totalTime()),rO(0)):A=v,B&&(B.value?B.style["overflow"+eh.a.toUpperCase()]=B.value:B.style.removeProperty("overflow-"+eh.a));else if(J&&eR()&&!el)for(T=J.parentNode;T&&T!==rM;)T._pinOffset&&(u-=T._pinOffset,h-=T._pinOffset),T=T.parentNode;F&&F.forEach(function(e){return e.revert(!1,!0)}),eM.start=u,eM.end=h,l=c=rJ?k:eR(),el||rJ||(l<k&&eR(k),eM.scroll.rec=0),eM.revert(!1,!0),ew=r1(),z&&(eb=-1,z.restart(!0)),rR=0,n&&ed&&(n._initted||V)&&n.progress()!==V&&n.progress(V||0,!0).render(n.time(),!0,!0),(Y||eA!==eM.progress||el||ee||n&&!n._initted)&&(n&&!ed&&(n._initted||eA||!1!==n.vars.immediateRender)&&n.totalProgress(el&&u<-.001&&!eA?rg.utils.normalize(u,h,0):eA,!0),eM.progress=Y||(l-u)/v===eA?0:eA),$&&Q&&(S._pinOffset=Math.round(eM.progress*A)),O&&O.invalidate(),isNaN(H)||(H-=rg.getProperty(p,eh.p),G-=rg.getProperty(m,eh.p),s_(p,eh,H),s_(d,eh,H-(o||0)),s_(m,eh,G),s_(f,eh,G-(o||0))),Y&&!rJ&&eM.update(),!K||rJ||_||(_=!0,K(eM),_=!1)}},eM.getVelocity=function(){return(eR()-c)/(r1()-rw)*1e3||0}
1,eM.endAnimation=function(){af(eM.callbackAnimation),n&&(O?O.progress(1):n.paused()?ed||af(n,eM.direction<0,1):af(n,n.reversed()))},eM.labelToScroll=function(e){return n&&n.labels&&(u||eM.refresh()||u)+n.labels[e]/n.duration()*v||0},eM.getTrailing=function(e){var t=aX.indexOf(eM),n=eM.direction>0?aX.slice(0,t).reverse():aX.slice(t+1);return(ac(e)?n.filter(function(t){return t.vars.preventOverlaps===e}):n).filter(function(e){return eM.direction>0?e.end<=u:e.start>=h})},eM.update=function(e,t,i){if(!el||i||e){var r,s,o,d,f,m,g,_=!0===rJ?k:eM.scroll(),x=e?0:(_-u)/v,T=x<0?0:x>1?1:x||0,E=eM.progress;if(t&&(c=l,l=el?eR():_,ea&&(I=N,N=n&&!ed?n.totalProgress():T)),et&&$&&!rR&&!r0&&r2&&(!T&&u<_+(_-c)/(r1()-rw)*et?T=1e-4:1===T&&h>_+(_-c)/(r1()-rw)*et&&(T=.9999)),T!==E&&eM.enabled){if(d=(f=(r=eM.isActive=!!T&&T<1)!=(!!E&&E<1))||!!T!=!!E,eM.direction=T>E?1:-1,eM.progress=T,d&&!rR&&(s=T&&!E?0:1===T?1:1===E?2:3,ed&&(o=!f&&"none"!==ev[s+1]&&ev[s+1]||ev[s],g=n&&("complete"===o||"reset"===o||o in n))),eu&&(f||g)&&(g||Z||!n)&&(au(eu)?eu(eM):eM.getTrailing(eu).forEach(function(e){return e.endAnimation()})),!ed&&(!O||rR||r0?n&&n.totalProgress(T,!!(rR&&(ew||e))):(O._dp._time-O._start!==O._time&&O.render(O._dp._time-O._start),O.resetTo?O.resetTo("totalProgress",T,n._tTime/n._tDur):(O.vars.totalProgress=T,O.invalidate().restart()))),$)if(e&&Q&&(S.style[Q+eh.os2]=R),eg){if(d){if(m=!e&&T>E&&h+1>_&&_+1>=ao(ef,eh),es)if(!e&&(r||m)){var C=aD($,!0),U=_-u;sm($,rM,C.top+(eh===rs?U:0)+"px",C.left+(eh===rs?0:U)+"px")}else sm($,S);sc(r||m?y:M),D&&T<1&&r||b(w+(1!==T||m?0:A))}}else b(ae(w+A*T));!ea||a.tween||rR||r0||z.restart(!0),j&&(f||er&&T&&(T<1||!rK))&&rE(j.targets).forEach(function(e){return e.classList[r||er?"add":"remove"](j.className)}),!X||ed||e||X(eM),d&&!rR?(ed&&(g&&("complete"===o?n.pause().totalProgress(1):"reset"===o?n.restart(!0).pause():"restart"===o?n.restart(!0):n[o]()),X&&X(eM)),(f||!rK)&&(q&&f&&ap(eM,q),e_[s]&&ap(eM,e_[s]),er&&(1===T?eM.kill(!1,1):e_[s]=0),!f&&e_[s=1===T?1:3]&&ap(eM,e_[s])),ec&&!r&&Math.abs(eM.getVelocity())>(ah(ec)?ec:2500)&&(af(eM.callbackAnimation),O?O.progress(1):af(n,"reverse"===o?1:!T,1))):ed&&X&&!rR&&X(eM)}if(L){var F=el?_/el.duration()*(el._caScrollDist||0):_;P(F+ +!!p._isFlipped),L(F)}H&&H(-_/el.duration()*(el._caScrollDist||0))}},eM.enable=function(t,n){eM.enabled||(eM.enabled=!0,aO(ef,"resize",aZ),em||aO(ef,"scroll",aq),eS&&aO(e,"refreshInit",eS),!1!==t&&(eM.progress=eA=0,l=c=eb=eR()),!1!==n&&eM.refresh())},eM.getTween=function(e){return e&&a?a.tween:O},eM.setPositions=function(e,t,n,i){if(el){var r=el.scrollTrigger,a=el.duration(),s=r.end-r.start;e=r.start+s*e/a,t=r.start+s*t/a}eM.refresh(!1,!1,{start:r6(e,n&&!!eM._startClamp),end:r6(t,n&&!!eM._endClamp)},i),eM.update()},eM.adjustPinSpacing=function(e){if(C&&e){var t=C.indexOf(eh.d)+1;C[t]=parseFloat(C[t])+e+"px",C[1]=parseFloat(C[1])+e+"px",sc(C)}},eM.disable=function(t,n){if(!1!==t&&eM.revert(!0,!0),eM.enabled&&(eM.enabled=eM.isActive=!1,n||O&&O.pause(),k=0,s&&(s.uncache=1),eS&&aF(e,"refreshInit",eS),z&&(z.pause(),a.tween&&a.tween.kill()&&(a.tween=0)),!em)){for(var i=aX.length;i--;)if(aX[i].scroller===ef&&aX[i]!==eM)return;aF(ef,"resize",aZ),em||aF(ef,"scroll",aq)}},eM.kill=function(e,i){eM.disable(e,i),O&&!i&&O.kill(),Y&&delete aj[Y];var r=aX.indexOf(eM);r>=0&&aX.splice(r,1),r===rD&&sn>0&&rD--,r=0,aX.forEach(function(e){return e.scroller===eM.scroller&&(r=1)}),r||rJ||(eM.scroll.rec=0),n&&(n.scrollTrigger=null,e&&n.revert({kill:!1}),i||n.kill()),d&&[d,f,p,m].forEach(function(e){return e.parentNode&&e.parentNode.removeChild(e)}),rQ===eM&&(rQ=0),$&&(s&&(s.uncache=1),r=0,aX.forEach(function(e){return e.pin===$&&r++}),r||(s.spacer=0)),t.onKill&&t.onKill(eM)},aX.push(eM),eM.enable(!1,!1),G&&G(eM),n&&n.add&&!v){var eL=eM.update;eM.update=function(){eM.update=eL,i3.cache++,u||h||eM.refresh()},rg.delayedCall(.01,eM.update),v=.01,u=h=0}else eM.refresh();$&&a8()},e.register=function(t){return r_||(rg=t||an(),at()&&window.document&&e.enable(),r_=r4),r_},e.defaults=function(e){if(e)for(var t in e)ak[t]=e[t];return ak},e.disable=function(e,t){r4=0,aX.forEach(function(n){return n[t?"kill":"disable"](e)}),aF(rv,"wheel",aq),aF(rx,"scroll",aq),clearInterval(rA),aF(rx,"touchcancel",r7),aF(rM,"touchstart",r7),aI(aF,rx,"pointerdown,touchstart,mousedown",r8),aI(aF,rx,"pointerup,touchend,mouseup",r9),rT.kill(),al(aF);for(var n=0;n<i3.length;n+=3)aB(aF,i3[n],i3[n+1]),aB(aF,i3[n],i3[n+2])},e.enable=function(){if(rv=window,ry=(rx=document).documentElement,rM=rx.body,rg&&(rE=rg.utils.toArray,rb=rg.utils.clamp,rG=rg.core.context||r7,rO=rg.core.suppressOverwrites||r7,rW=rv.history.scrollRestoration||"auto",st=rv.pageYOffset||0,rg.core.globals("ScrollTrigger",e),rM)){r4=1,(rX=document.createElement("div")).style.height="100vh",rX.style.position="absolute",a9(),function e(){return r4&&requestAnimationFrame(e)}(),rm.register(rg),e.isTouch=rm.isTouch,rH=rm.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),rz=1===rm.isTouch,aO(rv,"wheel",aq),rS=[rv,rx,ry,rM],rg.matchMedia?(e.matchMedia=function(e){var t,n=rg.matchMedia();for(t in e)n.add(t,e[t]);return n},rg.addEventListener("matchMediaInit",function(){a2(),a4()}),rg.addEventListener("matchMediaRevert",function(){return a3()}),rg.addEventListener("matchMedia",function(){se(0,1),a0("matchMedia")}),rg.matchMedia().add("(orientation: portrait)",function(){return aK(),aK})):console.warn("Requires GSAP 3.11.0 or later"),aK(),aO(rx,"scroll",aq);var t,n,i=rM.hasAttribute("style"),r=rM.style,a=r.borderTopStyle,s=rg.core.Animation.prototype;for(s.revert||Object.defineProperty(s,"revert",{value:function(){return this.time(-.01,!0)}}),r.borderTopStyle="solid",rs.m=Math.round((t=aD(rM)).top+rs.sc())||0,ra.m=Math.round(t.left+ra.sc())||0,a?r.borderTopStyle=a:r.removeProperty("border-top-style"),i||(rM.setAttribute("style",""),rM.removeAttribute("style")),rA=setInterval(aY,250),rg.delayedCall(.5,function(){return r0=0}),aO(rx,"touchcancel",r7),aO(rM,"touchstart",r7),aI(aO,rx,"pointerdown,touchstart,mousedown",r8),aI(aO,rx,"pointerup,touchend,mouseup",r9),rP=rg.utils.checkPrefix("transform"),sa.push(rP),r_=r1(),rT=rg.delayedCall(.2,se).pause(),rN=[rx,"visibilitychange",function(){var e=rv.innerWidth,t=rv.innerHe
vendor: 4,406 bytes, line 1
1ight;rx.hidden?(rL=e,rU=t):(rL!==e||rU!==t)&&aZ()},rx,"DOMContentLoaded",se,rv,"load",se,rv,"resize",aZ],al(aO),aX.forEach(function(e){return e.enable(0,1)}),n=0;n<i3.length;n+=3)aB(aF,i3[n],i3[n+1]),aB(aF,i3[n],i3[n+2])}},e.config=function(t){"limitCallbacks"in t&&(rK=!!t.limitCallbacks);var n=t.syncInterval;n&&clearInterval(rA)||(rA=n)&&setInterval(aY,n),"ignoreMobileResize"in t&&(rz=1===e.isTouch&&t.ignoreMobileResize),"autoRefreshEvents"in t&&(al(aF)||al(aO,t.autoRefreshEvents||"none"),rF=-1===(t.autoRefreshEvents+"").indexOf("resize"))},e.scrollerProxy=function(e,t){var n=ro(e),i=i3.indexOf(n),r=ai(n);~i&&i3.splice(i,r?6:2),t&&(r?i2.unshift(rv,t,rM,t,ry,t):i2.unshift(n,t))},e.clearMatchMedia=function(e){aX.forEach(function(t){return t._ctx&&t._ctx.query===e&&t._ctx.kill(!0,!0)})},e.isInViewport=function(e,t,n){var i=(ac(e)?ro(e):e).getBoundingClientRect(),r=i[n?ax:ay]*t||0;return n?i.right-r>0&&i.left+r<rv.innerWidth:i.bottom-r>0&&i.top+r<rv.innerHeight},e.positionInViewport=function(e,t,n){ac(e)&&(e=ro(e));var i=e.getBoundingClientRect(),r=i[n?ax:ay],a=null==t?r/2:t in aV?aV[t]*r:~t.indexOf("%")?parseFloat(t)*r/100:parseFloat(t)||0;return n?(i.left+a)/rv.innerWidth:(i.top+a)/rv.innerHeight},e.killAll=function(e){if(aX.slice(0).forEach(function(e){return"ScrollSmoother"!==e.vars.id&&e.kill()}),!0!==e){var t=aJ.killAll||[];aJ={},t.forEach(function(e){return e()})}},e}();sx.version="3.14.2",sx.saveStyles=function(e){return e?rE(e).forEach(function(e){if(e&&e.style){var t=a1.indexOf(e);t>=0&&a1.splice(t,5),a1.push(e,e.style.cssText,e.getBBox&&e.getAttribute("transform"),rg.core.getCache(e),rG())}}):a1},sx.revert=function(e,t){return a4(!e,t)},sx.create=function(e,t){return new sx(e,t)},sx.refresh=function(e){return e?aZ(!0):(r_||sx.register())&&se(!0)},sx.update=function(e){return++i3.cache&&si(2*(!0===e))},sx.clearScrollMemory=a5,sx.maxScroll=function(e,t){return ao(e,t?ra:rs)},sx.getScrollFunc=function(e,t){return rc(ro(e),t?ra:rs)},sx.getById=function(e){return aj[e]},sx.getAll=function(){return aX.filter(function(e){return"ScrollSmoother"!==e.vars.id})},sx.isScrolling=function(){return!!r2},sx.snapDirectional=aN,sx.addEventListener=function(e,t){var n=aJ[e]||(aJ[e]=[]);~n.indexOf(t)||n.push(t)},sx.removeEventListener=function(e,t){var n=aJ[e],i=n&&n.indexOf(t);i>=0&&n.splice(i,1)},sx.batch=function(e,t){var n,i=[],r={},a=t.interval||.016,s=t.batchMax||1e9,o=function(e,t){var n=[],i=[],r=rg.delayedCall(a,function(){t(n,i),n=[],i=[]}).pause();return function(e){n.length||r.restart(!0),n.push(e.trigger),i.push(e),s<=n.length&&r.progress(1)}};for(n in t)r[n]="on"===n.substr(0,2)&&au(t[n])&&"onRefreshInit"!==n?o(n,t[n]):t[n];return au(s)&&(s=s(),aO(sx,"refresh",function(){return s=t.batchMax()})),rE(e).forEach(function(e){var t={};for(n in r)t[n]=r[n];t.trigger=e,i.push(sx.create(t))}),i};var sy,sM=function(e,t,n,i){return t>i?e(i):t<0&&e(0),n>i?(i-t)/(n-t):n<0?t/(t-n):1},sS=function e(t,n){!0===n?t.style.removeProperty("touch-action"):t.style.touchAction=!0===n?"auto":n?"pan-"+n+(rm.isTouch?" pinch-zoom":""):"none",t===ry&&e(rM,n)},sT={auto:1,scroll:1},sE=function(e){var t,n=e.event,i=e.target,r=e.axis,a=(n.changedTouches?n.changedTouches[0]:n).target,s=a._gsap||rg.core.getCache(a),o=r1();if(!s._isScrollT||o-s._isScrollT>2e3){for(;a&&a!==rM&&(a.scrollHeight<=a.clientHeight&&a.scrollWidth<=a.clientWidth||!(sT[(t=aR(a)).overflowY]||sT[t.overflowX]));)a=a.parentNode;s._isScroll=a&&a!==i&&!ai(a)&&(sT[(t=aR(a)).overflowY]||sT[t.overflowX]),s._isScrollT=o}(s._isScroll||"x"===r)&&(n.stopPropagation(),n._gsapAllow=!0)},sb=function(e,t,n,i){return rm.create({target:e,capture:!0,debounce:!1,lockAxis:!0,type:t,onWheel:i=i&&sE,onPress:i,onDrag:i,onScroll:i,onEnable:function(){return n&&aO(rx,rm.eventTypes[0],sA,!1,!0)},onDisable:function(){return aF(rx,rm.eventTypes[0],sA,!0)}})},sw=/(input|label|select|textarea)/i,sA=function(e){var t=sw.test(e.target.tagName);(t||sy)&&(e._gsapAllow=!0,sy=t)},sR=function(e){ad(e)||(e={}),e.preventDefault=e.isNormalizer=e.allowClicks=!0,e.type||(e.type="wheel,touch"),e.debounce=!!e.debounce,e.id=e.id||"normalizer";var t,n,i,r,a,s,o,l,c=e,u=c.normalizeScrollX,h=c.momentum,d=c.allowNestedScroll,f=c.onRelease,p=ro(e.target)||ry,m=rg.core.globals().ScrollSmoother,g=m&&m.get(),_=rH&&(e.content&&ro(e.content)||g&&!1!==e.content&&!g.smooth()&&g.content()),v=rc(p,rs),x=rc(p,ra),y=1,M=(rm.isTouch&&rv.visualVie
1wport?rv.visualViewport.scale*rv.visualViewport.width:rv.outerWidth)/rv.innerWidth,S=0,T=au(h)?function(){return h(t)}:function(){return h||2.8},E=sb(p,e.type,!0,d),b=function(){return r=!1},w=r7,A=r7,R=function(){n=ao(p,rs),A=rb(+!!rH,n),u&&(w=rb(0,ao(p,ra))),i=a6},C=function(){_._gsap.y=ae(parseFloat(_._gsap.y)+v.offset)+"px",_.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(_._gsap.y)+", 0, 1)",v.offset=v.cacheID=0},P=function(){if(r){requestAnimationFrame(b);var e=ae(t.deltaY/2),n=A(v.v-e);if(_&&n!==v.v+v.offset){v.offset=n-v.v;var i=ae((parseFloat(_&&_._gsap.y)||0)-v.offset);_.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+i+", 0, 1)",_._gsap.y=i+"px",v.cacheID=i3.cache,si()}return!0}v.offset&&C(),r=!0},D=function(){R(),a.isActive()&&a.vars.scrollY>n&&(v()>n?a.progress(1)&&v(n):a.resetTo("scrollY",n))};return _&&rg.set(_,{y:"+=0"}),e.ignoreCheck=function(e){return rH&&"touchmove"===e.type&&P(e)||y>1.05&&"touchstart"!==e.type||t.isGesturing||e.touches&&e.touches.length>1},e.onPress=function(){r=!1;var e=y;y=ae((rv.visualViewport&&rv.visualViewport.scale||1)/M),a.pause(),e!==y&&sS(p,y>1.01||!u&&"x"),s=x(),o=v(),R(),i=a6},e.onRelease=e.onGestureStart=function(e,t){if(v.offset&&C(),t){i3.cache++;var i,r,s=T();u&&(r=(i=x())+-(.05*s*e.velocityX)/.227,s*=sM(x,i,r,ao(p,ra)),a.vars.scrollX=w(r)),r=(i=v())+-(.05*s*e.velocityY)/.227,s*=sM(v,i,r,ao(p,rs)),a.vars.scrollY=A(r),a.invalidate().duration(s).play(.01),(rH&&a.vars.scrollY>=n||i>=n-1)&&rg.to({},{onUpdate:D,duration:s})}else l.restart(!0);f&&f(e)},e.onWheel=function(){a._ts&&a.pause(),r1()-S>1e3&&(i=0,S=r1())},e.onChange=function(e,t,n,r,a){if(a6!==i&&R(),t&&u&&x(w(r[2]===t?s+(e.startX-e.x):x()+t-r[1])),n){v.offset&&C();var l=a[2]===n,c=l?o+e.startY-e.y:v()+n-a[1],h=A(c);l&&c!==h&&(o+=h-c),v(h)}(n||t)&&si()},e.onEnable=function(){sS(p,!u&&"x"),sx.addEventListener("refresh",D),aO(rv,"resize",D),v.smooth&&(v.target.style.scrollBehavior="auto",v.smooth=x.smooth=!1),E.enable()},e.onDisable=function(){sS(p,!0),aF(rv,"resize",D),sx.removeEventListener("refresh",D),E.kill()},e.lockAxis=!1!==e.lockAxis,(t=new rm(e)).iOS=rH,rH&&!v()&&v(1),rH&&rg.ticker.add(r7),l=t._dc,a=rg.to(t,{ease:"power4",paused:!0,inherit:!1,scrollX:u?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:sg(v,v(),function(){return a.pause()})},onUpdate:si,onComplete:l.vars.onComplete}),t};sx.sort=function(e){if(au(e))return aX.sort(e);var t=rv.pageYOffset||0;return sx.getAll().forEach(function(e){return e._sortY=e.trigger?t+e.trigger.getBoundingClientRect().top:e.start+rv.innerHeight}),aX.sort(e||function(e,t){return -1e6*(e.vars.refreshPriority||0)+(e.vars.containerAnimation?1e6:e._sortY)-((t.vars.containerAnimation?1e6:t._sortY)+-1e6*(t.vars.refreshPriority||0))})},sx.observe=function(e){return new rm(e)},sx.normalizeScroll=function(e){if(void 0===e)return rB;if(!0===e&&rB)return rB.enable();if(!1===e){rB&&rB.kill(),rB=e;return}var t=e instanceof rm?e:sR(e);return rB&&rB.target===t.target&&rB.kill(),ai(t.target)&&(rB=t),t},sx.core={_getVelocityProp:ru,_inputObserver:sb,_scrollers:i3,_proxies:i2,bridge:{ss:function(){r2||a0("scrollStart"),r2=r1()},ref:function(){return rR}}},an()&&rg.registerPlugin(sx),e.s(["ScrollReveal",0,function(){return(0,t.useEffect)(()=>{iF.registerPlugin(sx);let e=Array.from(document.querySelectorAll("main section, main article, [data-reveal]"));if(!e.length||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let t=iF.context(()=>{e.forEach(e=>{iF.fromTo(e,{autoAlpha:0,y:60,filter:"blur(8px)"},{autoAlpha:1,y:0,filter:"blur(0px)",duration:1.1,ease:"power3.out",scrollTrigger:{trigger:e,start:"top 85%",toggleActions:"play none none none",once:!0}})})});return()=>{t.revert(),sx.getAll().forEach(e=>e.kill())}},[]),null}],14950)},10366,e=>{"use strict";var t=e.i(77117),n=e.i(91983),i=e.i(8872),r=e.i(43871),a=e.i(12086),s=e.i(40802);let o=(0,e.i(31763).default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);var l=e.i(92013),c=e.i(96918);let u=[{label:"Home",href:"/"},{label:"About",href:"/about"},{label:"Packages",href:"/packages"},{label:"Gallery",href:"/gallery"},{label:"Testimonials",href:"/testimonials"},{label:"Contact",href:"/contact"}];e.s(["Navbar1",0,()=>
1{let[e,h]=(0,n.useState)(!1),d=()=>h(e=>!e);return(0,t.jsxs)("div",{className:"fixed top-0 left-0 right-0 z-50 flex justify-center w-full py-4 px-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-5 py-2.5 bg-white/95 backdrop-blur-md rounded-full shadow-luxe border border-gold/15 w-full max-w-5xl relative z-10",children:[(0,t.jsx)(r.default,{href:"/",className:"flex items-center group","aria-label":"3 Jewels Adventures — Home",children:(0,t.jsx)(a.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},whileHover:{scale:1.03},transition:{duration:.3},className:"relative h-10 w-[150px] sm:h-11 sm:w-[170px]",children:(0,t.jsx)(i.default,{src:"/logo assests/full horizontal no bg.png",alt:"3 Jewels Adventures — Discover the Jewels of Himalayas",fill:!0,priority:!0,sizes:"170px",className:"object-contain object-left"})})}),(0,t.jsx)("nav",{className:"hidden md:flex items-center space-x-7",children:u.map((e,n)=>(0,t.jsx)(a.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.05*n},whileHover:{scale:1.05},children:(0,t.jsx)(r.default,{href:e.href,className:"text-sm text-navy hover:text-saffron transition-colors font-medium",children:e.label})},e.label))}),(0,t.jsx)(a.motion.div,{className:"hidden md:block",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,delay:.3},whileHover:{scale:1.05},children:(0,t.jsxs)(r.default,{href:"/contact",className:"inline-flex items-center gap-2 px-5 py-2 text-sm font-semibold text-white bg-gradient-saffron rounded-full hover:shadow-gold-glow transition-all",children:[(0,t.jsx)(c.Phone,{size:14,strokeWidth:2.5}),"Enquire Now"]})}),(0,t.jsx)(a.motion.button,{className:"md:hidden flex items-center text-navy",onClick:d,whileTap:{scale:.9},"aria-label":"Open menu",children:(0,t.jsx)(o,{className:"h-6 w-6"})})]}),(0,t.jsx)(s.AnimatePresence,{children:e&&(0,t.jsxs)(a.motion.div,{className:"fixed inset-0 bg-ivory z-50 pt-24 px-6 md:hidden",initial:{opacity:0,x:"100%"},animate:{opacity:1,x:0},exit:{opacity:0,x:"100%"},transition:{type:"spring",damping:25,stiffness:300},children:[(0,t.jsx)(a.motion.button,{className:"absolute top-6 right-6 p-2 text-navy",onClick:d,whileTap:{scale:.9},initial:{opacity:0}
1,animate:{opacity:1},transition:{delay:.2},"aria-label":"Close menu",children:(0,t.jsx)(l.X,{className:"h-6 w-6"})}),(0,t.jsxs)("div",{className:"flex flex-col space-y-6",children:[u.map((e,n)=>(0,t.jsx)(a.motion.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.1*n+.1},exit:{opacity:0,x:20},children:(0,t.jsx)(r.default,{href:e.href,className:"text-lg text-navy font-medium hover:text-saffron transition-colors",onClick:d,children:e.label})},e.label)),(0,t.jsx)(a.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5},exit:{opacity:0,y:20},className:"pt-4",children:(0,t.jsxs)(r.default,{href:"/contact",onClick:d,className:"inline-flex items-center justify-center gap-2 w-full px-5 py-3 text-base font-semibold text-white bg-gradient-saffron rounded-full transition-all",children:[(0,t.jsx)(c.Phone,{size:16,strokeWidth:2.5}),"Enquire Now"]})})]})]})})]})}],10366)},44820,e=>{"use strict";let t,n,i,r,a;var s=e.i(77117),o=e.i(91983);let l="srgb",c="srgb-linear",u="linear",h="srgb",d="300 es";function f(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;let p={};function m(...e){console.log("THREE."+e.shift(),...e)}function g(e){let t=e[0];if("string"==typeof t&&t.startsWith("TSL:")){let t=e[1];t&&t.isStackTrace?e[0]+=" "+t.getLocation():e[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return e}function _(...e){let t="THREE."+(e=g(e)).shift();{let n=e[0];n&&n.isStackTrace?console.warn(n.getError(t)):console.warn(t,...e)}}function v(...e){let t="THREE."+(e=g(e)).shift();{let n=e[0];n&&n.isStackTrace?console.error(n.getError(t)):console.error(t,...e)}}function x(...e){let t=e.join(" ");t in p||(p[t]=!0,_(...e))}let y={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3};class M{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return void 0!==n&&void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){let n=this._listeners;if(void 0===n)return;let i=n[e];if(void 0!==i){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(void 0===t)return;let n=t[e.type];if(void 0!==n){e.target=this;let t=n.slice(0);for(let n=0,i=t.length;n<i;n++)t[n].call(this,e);e.target=null}}}let S=["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"],T=Math.PI/180,E=180/Math.PI;function b(){let e=0xffffffff*Math.random()|0,t=0xffffffff*Math.random()|0,n=0xffffffff*Math.random()|0,i=0xffffffff*Math.random()|0;return(S[255&e]+S[e>>8&255]+S[e>>16&255]+S[e>>24&255]+"-"+S[255&t]+S[t>>8&255]+"-"+S[t>>16&15|64]+S[t>>24&255]+"-"+S[63&n|128]+S[n>>8&255]+"-"+S[n>>16&255]+S[n>>24&255]+S[255&i]+S[i>>8&255]+S[i>>16&255]+S[i>>24&255]).toLowerCase()}function w(e,t,n){return Math.max(t,Math.min(n,e))}function A(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/0xffffffff;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/0x7fffffff,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function R(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(0xffffffff*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(0x7fffffff*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error("Invalid component type.")}}class C{constructor(e=0,t=0){C.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}
vendor: 5,387 bytes, line 1
1sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=w(this.x,e.x,t.x),this.y=w(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=w(this.x,e,t),this.y=w(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(w(n,e,t))}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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.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(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(w(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class P{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,a,s){let o=n[i+0],l=n[i+1],c=n[i+2],u=n[i+3],h=r[a+0],d=r[a+1],f=r[a+2],p=r[a+3];if(u!==p||o!==h||l!==d||c!==f){let e=o*h+l*d+c*f+u*p;e<0&&(h=-h,d=-d,f=-f,p=-p,e=-e);let t=1-s;if(e<.9995){let n=Math.acos(e),i=Math.sin(n);o=o*(t=Math.sin(t*n)/i)+h*(s=Math.sin(s*n)/i),l=l*t+d*s,c=c*t+f*s,u=u*t+p*s}else{let e=1/Math.sqrt((o=o*t+h*s)*o+(l=l*t+d*s)*l+(c=c*t+f*s)*c+(u=u*t+p*s)*u);o*=e,l*=e,c*=e,u*=e}}e[t]=o,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,i,r,a){let s=n[i],o=n[i+1],l=n[i+2],c=n[i+3],u=r[a],h=r[a+1],d=r[a+2],f=r[a+3];return e[t]=s*f+c*u+o*d-l*h,e[t+1]=o*f+c*h+l*u-s*d,e[t+2]=l*f+c*d+s*h-o*u,e[t+3]=c*f-s*u-o*h-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,i=e._y,r=e._z,a=e._order,s=Math.cos,o=Math.sin,l=s(n/2),c=s(i/2),u=s(r/2),h=o(n/2),d=o(i/2),f=o(r/2);switch(a){case"XYZ":this._x=h*c*u+l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u-h*d*f;break;case"YXZ":this._x=h*c*u+l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u+h*d*f;break;case"ZXY":this._x=h*c*u-l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u-h*d*f;break;case"ZYX":this._x=h*c*u-l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u+h*d*f;break;case"YZX":this._x=h*c*u+l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u-h*d*f;break;case"XZY":this._x=h*c*u-l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u+h*d*f;break;default:_("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],r=t[8],a=t[1],s=t[5],o=t[9],l=t[2],c=t[6],u=t[10],h=n+s+u;if(h>0){let e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-o)*e,this._y=(r-l)*e,this._z=(a-i)*e}else if(n>s&&n>u){let e=2*Math.sqrt(1+n-s-u);this._w=(c-o)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(r+l)/e}else if(s>u){let e=2*Math.sqrt(1+s-n-u);this._w=(r-l)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(o+c)/e}else{let e=2*Math.sqrt(1+u-n-s);this._w=(a-i)/e,this._x=(r+l)/e,this._y=(o+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>
vendor: 9,056 bytes, line 1
1Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=n,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(w(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(0===n)return this;let i=Math.min(1,t/n);return this.slerp(e,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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,r=e._z,a=e._w,s=t._x,o=t._y,l=t._z,c=t._w;return this._x=n*c+a*s+i*l-r*o,this._y=i*c+a*o+r*s-n*l,this._z=r*c+a*l+n*o-i*s,this._w=a*c-n*s-i*o-r*l,this._onChangeCallback(),this}slerp(e,t){let n=e._x,i=e._y,r=e._z,a=e._w,s=this.dot(e);s<0&&(n=-n,i=-i,r=-r,a=-a,s=-s);let o=1-t;if(s<.9995){let e=Math.acos(s),l=Math.sin(e);o=Math.sin(o*e)/l,t=Math.sin(t*e)/l,this._x=this._x*o+n*t,this._y=this._y*o+i*t,this._z=this._z*o+r*t,this._w=this._w*o+a*t,this._onChangeCallback()}else this._x=this._x*o+n*t,this._y=this._y*o+i*t,this._z=this._z*o+r*t,this._w=this._w*o+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class D{constructor(e=0,t=0,n=0){D.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(U.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(U.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,s=e.z,o=e.w,l=2*(a*i-s*n),c=2*(s*t-r*i),u=2*(r*n-a*t);return this.x=t+o*l+a*u-s*c,this.y=n+o*c+s*l-r*u,this.z=i+o*u+r*c-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=w(this.x,e.x,t.x),this.y=w(this.y,e.y,t.y),this.z=w(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=w(this.x,e,t),this.y=w(this.y,e,t),this.z=w(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(w(n,e,t))}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(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,r=e.z,a=t.x,s=t.y,o=t.z;return this.x=i*o-r*s,this.y=r*a-n*o,this.z=n*s-i*a,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return L.copy(this).projectOnVector(e),this.sub(L)}reflect(e){return this.sub(L.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(w(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let L=new D,U=new P;class N{constructor(e,t,n,i,r,a,s,o,l){N.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,s,o,l)}set(e,t,n,i,r,a,s,o,l){let c=this.elements;
vendor: 5,114 bytes, line 1
1return c[0]=e,c[1]=i,c[2]=s,c[3]=t,c[4]=r,c[5]=o,c[6]=n,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,r=this.elements,a=n[0],s=n[3],o=n[6],l=n[1],c=n[4],u=n[7],h=n[2],d=n[5],f=n[8],p=i[0],m=i[3],g=i[6],_=i[1],v=i[4],x=i[7],y=i[2],M=i[5],S=i[8];return r[0]=a*p+s*_+o*y,r[3]=a*m+s*v+o*M,r[6]=a*g+s*x+o*S,r[1]=l*p+c*_+u*y,r[4]=l*m+c*v+u*M,r[7]=l*g+c*x+u*S,r[2]=h*p+d*_+f*y,r[5]=h*m+d*v+f*M,r[8]=h*g+d*x+f*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8];return t*a*c-t*s*l-n*r*c+n*s*o+i*r*l-i*a*o}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8],u=c*a-s*l,h=s*o-c*r,d=l*r-a*o,f=t*u+n*h+i*d;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);let p=1/f;return e[0]=u*p,e[1]=(i*l-c*n)*p,e[2]=(s*n-i*a)*p,e[3]=h*p,e[4]=(c*t-i*o)*p,e[5]=(i*r-s*t)*p,e[6]=d*p,e[7]=(n*o-l*t)*p,e[8]=(a*t-n*r)*p,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,a,s){let o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*a+l*s)+a+e,-i*l,i*o,-i*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(I.makeScale(e,t)),this}rotate(e){return this.premultiply(I.makeRotation(-e)),this}translate(e,t){return this.premultiply(I.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}let I=new N,O=new N().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),F=new N().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),B=(i=[.64,.33,.3,.6,.15,.06],r=[.2126,.7152,.0722],a=[.3127,.329],(n={enabled:!0,workingColorSpace:c,spaces:{},convert:function(e,t,n){return!1!==this.enabled&&t!==n&&t&&n&&(this.spaces[t].transfer===h&&(e.r=z(e.r),e.g=z(e.g),e.b=z(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===h&&(e.r=k(e.r),e.g=k(e.g),e.b=k(e.b))),e},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return""===e?u:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(e,t){return x("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(e,t)},toWorkingColorSpace:function(e,t){return x("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(e,t)}}).define({[c]:{primaries:i,whitePoint:a,transfer:u,toXYZ:O,fromXYZ:F,luminanceCoefficients:r,workingColorSpaceConfig:{unpackColorSpace:l},outputColorSpaceConfig:{drawingBufferColorSpace:l}},[l]:{primaries:i,whitePoint:a,transfer:h,toXYZ:O,fromXYZ:F,luminanceCoefficients:r,outputColorSpaceConfig:{drawingBufferColorSpace:l}}}),n);function z(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}
1function k(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class V{static getDataURL(e,n="image/png"){let i;if(/^data:/i.test(e.src)||"u"<typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)i=e;else{void 0===t&&(t=f("canvas")),t.width=e.width,t.height=e.height;let n=t.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),i=t}return i.toDataURL(n)}static sRGBToLinear(e){if("u">typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap){let t=f("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);let i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let e=0;e<r.length;e++)r[e]=255*z(r[e]/255);return n.putImageData(i,0,0),t}if(!e.data)return _("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e;{let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*z(t[e]/255)):t[e]=z(t[e]);return{data:t,width:e.width,height:e.height}}}}let H=0;class G{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:H++}),this.uuid=b(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let t=this.data;return"u">typeof HTMLVideoElement&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):"u">typeof VideoFrame&&t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):null!==t?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){!0===e&&this.version++}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;t<n;t++)i[t].isDataTexture?e.push(W(i[t].image)):e.push(W(i[t]))}else e=W(i);n.url=e}return t||(e.images[this.uuid]=n),n}}function W(e){return"u">typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap?V.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(_("Texture: Unable to serialize Texture."),{})}let X=0,j=new D;class Y extends M{constructor(e=Y.DEFAULT_IMAGE,t=Y.DEFAULT_MAPPING,n=1001,i=1001,r=1006,a=1008,s=1023,o=1009,l=Y.DEFAULT_ANISOTROPY,c=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:X++}),this.uuid=b(),this.name="",this.source=new G(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new C(0,0),this.repeat=new C(1,1),this.center=new C(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new N,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!e&&!!e.depth&&e.depth>1,this.pmremVersion=0}get width(){return this.source.getSize(j).x}get height(){return this.source.getSize(j).y}get depth(){return this.source.getSize(j).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace
1=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(void 0===n){_(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let i=this[t];if(void 0===i){_(`Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];let n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).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),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}Y.DEFAULT_IMAGE=null,Y.DEFAULT_MAPPING=300,Y.DEFAULT_ANISOTROPY=1;class q{constructor(e=0,t=0,n=0,i=1){q.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r,a=e.elements,s=a[0],o=a[4],l=a[8],c=a[1],u=a[5],h=a[9],d=a[2],f=a[6],p=a[10];if(.01>Math.abs(o-c)&&.01>Math.abs(l-d)&&.01>Math.abs(h-f)){if(.1>Math.abs(o+c)&&.1>Math.abs(l+d)&&.1>Math.abs(h+f)&&.1>Math.abs(s+u+p-3))return this.set(1,0,0,0),this;t=Math.PI;let e=(s+1)/2,a=(u+1)/2,m=(p+1)/2,g=(o+c)/4,_=(l+d)/4,v=(h+f)/4;return e>a&&e>m?e<.01?(n=0,i=.707106781,r=.707106781):(i=g/(n=Math.sqrt(e)),r=_/n):a>m?a<.01?(n=.707106781,i=0,r=.707106781):(n=g/(i=Math.sqrt(a)),r=v/i):m<.01?(n=.707106781,i=.707106781,r=0):(n=_/(r=Math.sqrt(m)),i=v/r),this.set(n,i,r,t),this}let m=Math.sqrt((f-h)*(f-h)+(l-d)*(l-d)+(c-o)*(c-o));return .001>Math.abs(m)&&(m=1),this.x=(f-h)/m,this.y=(l-d)/m,this.z=(c-o)/m,this.w=Math.acos((s+u+p-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=w(this.x,e.x,t.x),this.y=w(this.y,e.y,t.y),this.z=w(this.z,e.z,t.z),this.w=w(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=w(this.x,e,t),this.y=w(this.y,e,t),this.z=w(this.z,e,t),this.w=w(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(w(n,e,t))}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}
vendor: 4,650 bytes, line 1
1round(){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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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}}class K extends M{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:1006,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new q(0,0,e,t),this.scissorTest=!1,this.viewport=new q(0,0,e,t),this.textures=[];const i=new Y({width:e,height:t,depth:n.depth}),r=n.count;for(let e=0;e<r;e++)this.textures[e]=i.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){let t={minFilter:1006,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==e.mapping&&(t.mapping=e.mapping),void 0!==e.wrapS&&(t.wrapS=e.wrapS),void 0!==e.wrapT&&(t.wrapT=e.wrapT),void 0!==e.wrapR&&(t.wrapR=e.wrapR),void 0!==e.magFilter&&(t.magFilter=e.magFilter),void 0!==e.minFilter&&(t.minFilter=e.minFilter),void 0!==e.format&&(t.format=e.format),void 0!==e.type&&(t.type=e.type),void 0!==e.anisotropy&&(t.anisotropy=e.anisotropy),void 0!==e.colorSpace&&(t.colorSpace=e.colorSpace),void 0!==e.flipY&&(t.flipY=e.flipY),void 0!==e.generateMipmaps&&(t.generateMipmaps=e.generateMipmaps),void 0!==e.internalFormat&&(t.internalFormat=e.internalFormat);for(let e=0;e<this.textures.length;e++)this.textures[e].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){null!==this._depthTexture&&(this._depthTexture.renderTarget=null),null!==e&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n,!0!==this.textures[i].isData3DTexture&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;let n=Object.assign({},e.textures[t].image);this.textures[t].source=new G(n)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Z extends K{constructor(e=1,t=1,n={}
vendor: 8,142 bytes, line 1
1){super(e,t,n),this.isWebGLRenderTarget=!0}}class J extends Y{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ${constructor(e,t,n,i,r,a,s,o,l,c,u,h,d,f,p,m){$.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,s,o,l,c,u,h,d,f,p,m)}set(e,t,n,i,r,a,s,o,l,c,u,h,d,f,p,m){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=s,g[13]=o,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=f,g[11]=p,g[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 $().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return 0===this.determinant()?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1)):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2)),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(0===e.determinant())return this.identity();let t=this.elements,n=e.elements,i=1/Q.setFromMatrixColumn(e,0).length(),r=1/Q.setFromMatrixColumn(e,1).length(),a=1/Q.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),s=Math.sin(n),o=Math.cos(i),l=Math.sin(i),c=Math.cos(r),u=Math.sin(r);if("XYZ"===e.order){let e=a*c,n=a*u,i=s*c,r=s*u;t[0]=o*c,t[4]=-o*u,t[8]=l,t[1]=n+i*l,t[5]=e-r*l,t[9]=-s*o,t[2]=r-e*l,t[6]=i+n*l,t[10]=a*o}else if("YXZ"===e.order){let e=o*c,n=o*u,i=l*c,r=l*u;t[0]=e+r*s,t[4]=i*s-n,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-s,t[2]=n*s-i,t[6]=r+e*s,t[10]=a*o}else if("ZXY"===e.order){let e=o*c,n=o*u,i=l*c,r=l*u;t[0]=e-r*s,t[4]=-a*u,t[8]=i+n*s,t[1]=n+i*s,t[5]=a*c,t[9]=r-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){let e=a*c,n=a*u,i=s*c,r=s*u;t[0]=o*c,t[4]=i*l-n,t[8]=e*l+r,t[1]=o*u,t[5]=r*l+e,t[9]=n*l-i,t[2]=-l,t[6]=s*o,t[10]=a*o}else if("YZX"===e.order){let e=a*o,n=a*l,i=s*o,r=s*l;t[0]=o*c,t[4]=r-e*u,t[8]=i*u+n,t[1]=u,t[5]=a*c,t[9]=-s*c,t[2]=-l*c,t[6]=n*u+i,t[10]=e-r*u}else if("XZY"===e.order){let e=a*o,n=a*l,i=s*o,r=s*l;t[0]=o*c,t[4]=-u,t[8]=l*c,t[1]=e*u+r,t[5]=a*c,t[9]=n*u-i,t[2]=i*u-n,t[6]=s*c,t[10]=r*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(et,e,en)}lookAt(e,t,n){let i=this.elements;return ea.subVectors(e,t),0===ea.lengthSq()&&(ea.z=1),ea.normalize(),ei.crossVectors(n,ea),0===ei.lengthSq()&&(1===Math.abs(n.z)?ea.x+=1e-4:ea.z+=1e-4,ea.normalize(),ei.crossVectors(n,ea)),ei.normalize(),er.crossVectors(ea,ei),i[0]=ei.x,i[4]=er.x,i[8]=ea.x,i[1]=ei.y,i[5]=er.y,i[9]=ea.y,i[2]=ei.z,i[6]=er.z,i[10]=ea.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,r=this.elements,a=n[0],s=n[4],o=n[8],l=n[12],c=n[1],u=n[5],h=n[9],d=n[13],f=n[2],p=n[6],m=n[10],g=n[14],_=n[3],v=n[7],x=n[11],y=n[15],M=i[0],S=i[4],T=i[8],E=i[12],b=i[1],w=i[5],A=i[9],R=i[13],C=i[2],P=i[6],D=i[10],L=i[14],U=i[3],N=i[7],I=i[11],O=i[15];return r[0]=a*M+s*b+o*C+l*U,r[4]=a*S+s*w+o*P+l*N,r[8]=a*T+s*A+o*D+l*I,r[12]=a*E+s*R+o*L+l*O,r[1]=c*M+u*b+h*C+d*U,r[5]=c*S+u*w+h*P+d*N,r[9]=c*T+u*A+h*D+d*I,r[13]=c*E+u*R+h*L+d*O,r[2]=f*M+p*b+m*C+g*U,r[6]=f*S+p*w+m*P+g*N,r[10]=f*T+p*A+m*D+g*I,r[14]=f*E+p*R+m*L+g*O,r[3]=_*M+v*b+x*C+y*U,r[7]=_*S+v*w+x*P+y*N,r[11]=_*T+v*A+x*D+y*I,r[15]=_*E+v*R+x*L+y*O,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],s=e[5],o=e[9],l=e[13],c=e[2],u=e[6],h=e[10],d=e[14],f=e[3],p=e[7],m=e[11],g=e[15],_=o*d-l*h,v=s*d-l*u,x=s*h-o*u,y=a*d-l*c,M=a*h-o*c,S=a*u-s*c;return t*(p*_-m*v+g*x)-n*(f*_-m*y+g*M)+i*(f*v-p*y+g*S)-r*(f*x-p*M+m*S)}transpose(){let e,t=this.elements;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(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],f=e[12],p=e[13],m=e[14],g=e[15],_=t*s-n*a,v=t*o-i*a,x=t*l-r*a,y=n*o-i*s,M=n*l-r*s,S=i*l-r*o,T=c*p-u*f,E=c*m-h*f,b=c*g-d*f,w=u*m-h*p,A=u*g-d*p,R=h*g-d*m,C=_*R-v*A+x*w+y*b-M*E+S*T;if(0===C)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let P=1/C;return e[0]=(s*R-o*A+l*w)*P,e[1]=(i*A-n*R-r*w)*P,e[2]=(p*S-m*M+g*y)*P,e[3]=(h*M-u*S-d*y)*P,e[4]=(o*b-a*R-l*E)*P,e[5]=(t*R-i*b+r*E)*P,e[6]=(m*x-f*S-g*v)*P,e[7]=(c*S-h*x+d*v)*P,e[8]=(a*A-s*b+l*T)*P,e[9]=(n*b-t*A-r*T)*P,e[10]=(f*M-p*x+g*_)*P,e[11]=(u*x-c*M-d*_)*P,e[12]=(s*E-a*w-o*T)*P,e[13]=(t*w-n*E+i*T)*P,e[14]=(p*v-f*y-m*_)*P,e[15]=(c*y-u*v+h*_)*P,this}scale(e){let t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,s=e.y,o=e.z,l=r*a,c=r*s;return this.set(l*a+n,l*s-i*o,l*o+i*s,0,l*s+i*o,c*s+n,c*o-i*a,0,l*o-i*s,c*o+i*a,r*o*o+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,a){return this.set(1,n,r,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,r=t._x,a=t._y,s=t._z,o=t._w,l=r+r,c=a+a,u=s+s,h=r*l,d=r*c,f=r*u,p=a*c,m=a*u,g=s*u,_=o*l,v=o*c,x=o*u,y=n.x,M=n.y,S=n.z;return i[0]=(1-(p+g))*y,i[1]=(d+x)*y,i[2]=(f-v)*y,i[3]=0,i[4]=(d-x)*M,i[5]=(1-(h+g))*M,i[6]=(m+_)*M,i[7]=0,i[8]=(f+v)*S,i[9]=(m-_)*S,i[10]=(1-(h+p))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements;e.x=i[12],e.y=i[13],e.z=i[14];let r=this.determinant();if(0===r)return n.set(1,1,1),t.identity(),this;let a=Q.set(i[0],i[1],i[2]).length(),s=Q.set(i[4],i[5],i[6]).length(),o=Q.set(i[8],i[9],i[10]).length();r<0&&(a=-a),ee.copy(this);let l=1/a,c=1/s,u=1/o;return ee.elements[0]*=l,ee.elements[1]*=l,ee.elements[2]*=l,ee.elements[4]*=c,ee.elements[5]*=c,ee.elements[6]*=c,ee.elements[8]*=u,ee.elements[9]*=u,ee.elements[10]*=u,t.setFromRotationMatrix(ee),n.x=a,n.y=s,n.z=o,this}makePerspective(e,t,n,i,r,a,s=2e3,o=!1){let l,c,u=this.elements;if(o)l=r/(a-r),c=a*r/(a-r);else if(2e3===s)l=-(a+r)/(a-r),c=-2*a*r/(a-r);else if(2001===s)l=-a/(a-r),c=-a*r/(a-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return u[0]=2*r/(t-e),u[4]=0,u[8]=(t+e)/(t-e),u[12]=0,u[1]=0,u[5]=2*r/(n-i),u[9]=(n+i)/(n-i),u[13]=0,u[2]=0,u[6]=0,u[10]=l,u[14]=c,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}
1makeOrthographic(e,t,n,i,r,a,s=2e3,o=!1){let l,c,u=this.elements;if(o)l=1/(a-r),c=a/(a-r);else if(2e3===s)l=-2/(a-r),c=-(a+r)/(a-r);else if(2001===s)l=-1/(a-r),c=-r/(a-r);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return u[0]=2/(t-e),u[4]=0,u[8]=0,u[12]=-(t+e)/(t-e),u[1]=0,u[5]=2/(n-i),u[9]=0,u[13]=-(n+i)/(n-i),u[2]=0,u[6]=0,u[10]=l,u[14]=c,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}let Q=new D,ee=new $,et=new D(0,0,0),en=new D(1,1,1),ei=new D,er=new D,ea=new D,es=new $,eo=new P;class el{constructor(e=0,t=0,n=0,i=el.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,r=i[0],a=i[4],s=i[8],o=i[1],l=i[5],c=i[9],u=i[2],h=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(w(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-w(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(w(h,-1,1)),.9999999>Math.abs(h)?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-w(u,-1,1)),.9999999>Math.abs(u)?(this._x=Math.atan2(h,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(w(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-w(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:_("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return es.makeRotationFromQuaternion(e),this.setFromRotationMatrix(es,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return eo.setFromEuler(this),this.setFromQuaternion(eo,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}el.DEFAULT_ORDER="XYZ";class ec{constructor(){this.mask=1}set(e){this.mask=1<<e>>>0}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!=0}isEnabled(e){return(this.mask&1<<e)!=0}}let eu=0,eh=new D,ed=new P,ef=new $,ep=new D,em=new D,eg=new D,e_=new P,ev=new D(1,0,0),ex=new D(0,1,0),ey=new D(0,0,1),eM={type:"added"},eS={type:"removed"},eT={type:"childadded",child:null},eE={type:"childremoved",child:null};class eb extends M{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:eu++}),this.uuid=b(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=eb.DEFAULT_UP.clone();
vendor: 5,263 bytes, line 1
1const e=new D,t=new el,n=new P,i=new D(1,1,1);t._onChange(function(){n.setFromEuler(t,!1)}),n._onChange(function(){t.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new $},normalMatrix:{value:new N}}),this.matrix=new $,this.matrixWorld=new $,this.matrixAutoUpdate=eb.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=eb.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new ec,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return ed.setFromAxisAngle(e,t),this.quaternion.multiply(ed),this}rotateOnWorldAxis(e,t){return ed.setFromAxisAngle(e,t),this.quaternion.premultiply(ed),this}rotateX(e){return this.rotateOnAxis(ev,e)}rotateY(e){return this.rotateOnAxis(ex,e)}rotateZ(e){return this.rotateOnAxis(ey,e)}translateOnAxis(e,t){return eh.copy(e).applyQuaternion(this.quaternion),this.position.add(eh.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(ev,e)}translateY(e){return this.translateOnAxis(ex,e)}translateZ(e){return this.translateOnAxis(ey,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ef.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?ep.copy(e):ep.set(e,t,n);let i=this.parent;this.updateWorldMatrix(!0,!1),em.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ef.lookAt(em,ep,this.up):ef.lookAt(ep,em,this.up),this.quaternion.setFromRotationMatrix(ef),i&&(ef.extractRotation(i.matrixWorld),ed.setFromRotationMatrix(ef),this.quaternion.premultiply(ed.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?v("Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(eM),eT.child=e,this.dispatchEvent(eT),eT.child=null):v("Object3D.add: object not an instance of THREE.Object3D.",e),this}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return -1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(eS),eE.child=e,this.dispatchEvent(eE),eE.child=null),this}removeFromParent(){let e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),ef.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),ef.multiply(e.parent.matrixWorld)),e.applyMatrix4(ef),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(eM),eT.child=e,this.dispatchEvent(eT),eT.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){let i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(em,e,eg),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(em,e_,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);let t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let e=this.pivot;if(null!==e){let t=e.x,n=e.y,i=e.z,r=this.matrix.elements;r[12]+=t-r[0]*t-r[4]*n-r[8]*i,r[13]+=n-r[1]*t-r[5]*n-r[9]*i,r[14]+=i-r[2]*t-r[6]*n-r[10]*i}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix
1):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){let n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===t){let e=this.children;for(let t=0,n=e.length;t<n;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){let t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let i={};function r(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),!1!==this.static&&(i.static=this.static),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(),null!==this.pivot&&(i.pivot=this.pivot.toArray()),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),void 0!==this.morphTargetDictionary&&(i.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),void 0!==this.morphTargetInfluences&&(i.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(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.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(e=>({...e})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(i.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(i.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);let t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){let n=t.shapes;if(Array.isArray(n))for(let t=0,i=n.length;t<i;t++){let i=n[t];r(e.shapes,i)}else r(e.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let t=[];for(let n=0,i=this.material.length;n<i;n++)t.push(r(e.materials,this.material[n]));i.material=t}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(let t=0;t<this.children.length;t++)i.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let t=0;t<this.animations.length;t++){let n=this.animations[t];i.animations.push(r(e.animations,n))}}if(t){let t=a(e.geometries),i=a(e.materials),r=a(e.textures),s=a(e.images),o=a(e.shapes),l=a(e.skeletons),c=a(e.animations),u=a(e.nodes);t.length>0&&(n.geometries=t),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),s.length>0&&(n.images=s),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),u.length>0&&(n.nodes=u)}return n.object=i,n;function a(e){let t=[];for(let n in e){let i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),null!==e.pivot&&(this.pivot=e.pivot.clone()),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){let n=e.children[t];this.add(n.clone())}return this}}eb.DEFAULT_UP=new D(0,1,0),eb.DEFAULT_MATRIX_AUTO_UPDATE=!0,eb.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class ew extends eb{constructor(){super(),this.isGroup=!0,this.type="Group"}}let eA={type:"move"};class eR{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new ew,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new ew,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new D,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new D),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new ew,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new D,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new D),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,a=null,s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){for(let i of(a=!0,e.hand.values())
1){let e=t.getJointPose(i,n),r=this._getHandJoint(l,i);null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=e.radius),r.visible=null!==e}let i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],s=i.position.distanceTo(r.position);l.inputState.pinching&&s>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&null!==(r=t.getPose(e.gripSpace,n))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1);null!==s&&(null===(i=t.getPose(e.targetRaySpace,n))&&null!==r&&(i=r),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(eA)))}return null!==s&&(s.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){let n=new ew;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}let eC={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},eP={h:0,s:0,l:0},eD={h:0,s:0,l:0};
1function eL(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*6*(2/3-n):e}class eU{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){return void 0===t&&void 0===n?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,t,n),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=l){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,B.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=B.workingColorSpace){return this.r=e,this.g=t,this.b=n,B.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=B.workingColorSpace){if(e=(e%1+1)%1,t=w(t,0,1),n=w(n,0,1),0===t)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=eL(r,i,e+1/3),this.g=eL(r,i,e),this.b=eL(r,i,e-1/3)}return B.colorSpaceToWorking(this,i),this}setStyle(e,t=l){let n;function i(t){void 0!==t&&1>parseFloat(t)&&_("Color: Alpha component of "+e+" will be ignored.")}if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let r,a=n[1],s=n[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:_("Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],r=i.length;if(3===r)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,t);if(6===r)return this.setHex(parseInt(i,16),t);_("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=l){let n=eC[e.toLowerCase()];return void 0!==n?this.setHex(n,t):_("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=z(e.r),this.g=z(e.g),this.b=z(e.b),this}copyLinearToSRGB(e){return this.r=k(e.r),this.g=k(e.g),this.b=k(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=l){return B.workingToColorSpace(eN.copy(this),e),65536*Math.round(w(255*eN.r,0,255))+256*Math.round(w(255*eN.g,0,255))+Math.round(w(255*eN.b,0,255))}getHexString(e=l){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=B.workingColorSpace){let n,i;B.workingToColorSpace(eN.copy(this),t);let r=eN.r,a=eN.g,s=eN.b,o=Math.max(r,a,s),l=Math.min(r,a,s),c=(l+o)/2;if(l===o)n=0,i=0;else{let e=o-l;switch(i=c<=.5?e/(o+l):e/(2-o-l),o){case r:n=(a-s)/e+6*(a<s);break;case a:n=(s-r)/e+2;break;case s:n=(r-a)/e+4}n/=6}return e.h=n,e.s=i,e.l=c,e}getRGB(e,t=B.workingColorSpace){return B.workingToColorSpace(eN.copy(this),t),e.r=eN.r,e.g=eN.g,e.b=eN.b,e}getStyle(e=l){B.workingToColorSpace(eN.copy(this),e);let t=eN.r,n=eN.g,i=eN.b;return e!==l?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*i)})`}offsetHSL(e,t,n){return this.getHSL(eP),this.setHSL(eP.h+e,eP.s+t,eP.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}
vendor: 7,183 bytes, line 1
1lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){var n,i,r;this.getHSL(eP),e.getHSL(eD);let a=(n=eP.h,(1-t)*n+t*eD.h),s=(i=eP.s,(1-t)*i+t*eD.s),o=(r=eP.l,(1-t)*r+t*eD.l);return this.setHSL(a,s,o),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let eN=new eU;eU.NAMES=eC;class eI extends eb{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 el,this.environmentIntensity=1,this.environmentRotation=new el,this.overrideMaterial=null,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}let eO=new D,eF=new D,eB=new D,ez=new D,ek=new D,eV=new D,eH=new D,eG=new D,eW=new D,eX=new D,ej=new q,eY=new q,eq=new q;class eK{constructor(e=new D,t=new D,n=new D){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),eO.subVectors(e,t),i.cross(eO);let r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){eO.subVectors(i,t),eF.subVectors(n,t),eB.subVectors(e,t);let a=eO.dot(eO),s=eO.dot(eF),o=eO.dot(eB),l=eF.dot(eF),c=eF.dot(eB),u=a*l-s*s;if(0===u)return r.set(0,0,0),null;let h=1/u,d=(l*o-s*c)*h,f=(a*c-s*o)*h;return r.set(1-d-f,f,d)}static containsPoint(e,t,n,i){return null!==this.getBarycoord(e,t,n,i,ez)&&ez.x>=0&&ez.y>=0&&ez.x+ez.y<=1}static getInterpolation(e,t,n,i,r,a,s,o){return null===this.getBarycoord(e,t,n,i,ez)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,ez.x),o.addScaledVector(a,ez.y),o.addScaledVector(s,ez.z),o)}static getInterpolatedAttribute(e,t,n,i,r,a){return ej.setScalar(0),eY.setScalar(0),eq.setScalar(0),ej.fromBufferAttribute(e,t),eY.fromBufferAttribute(e,n),eq.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(ej,r.x),a.addScaledVector(eY,r.y),a.addScaledVector(eq,r.z),a}static isFrontFacing(e,t,n,i){return eO.subVectors(n,t),eF.subVectors(e,t),0>eO.cross(eF).dot(i)}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return eO.subVectors(this.c,this.b),eF.subVectors(this.a,this.b),.5*eO.cross(eF).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return eK.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return eK.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return eK.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return eK.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return eK.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n,i,r=this.a,a=this.b,s=this.c;ek.subVectors(a,r),eV.subVectors(s,r),eG.subVectors(e,r);let o=ek.dot(eG),l=eV.dot(eG);if(o<=0&&l<=0)return t.copy(r);eW.subVectors(e,a);let c=ek.dot(eW),u=eV.dot(eW);if(c>=0&&u<=c)return t.copy(a);let h=o*u-c*l;if(h<=0&&o>=0&&c<=0)return n=o/(o-c),t.copy(r).addScaledVector(ek,n);eX.subVectors(e,s);let d=ek.dot(eX),f=eV.dot(eX);if(f>=0&&d<=f)return t.copy(s);let p=d*l-o*f;if(p<=0&&l>=0&&f<=0)return i=l/(l-f),t.copy(r).addScaledVector(eV,i);let m=c*f-d*u;if(m<=0&&u-c>=0&&d-f>=0)return eH.subVectors(s,a),i=(u-c)/(u-c+(d-f)),t.copy(a).addScaledVector(eH,i);let g=1/(m+p+h);return n=p*g,i=h*g,t.copy(r).addScaledVector(ek,n).addScaledVector(eV,i)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class eZ{constructor(e=new D(Infinity,Infinity,Infinity),t=new D(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(e$.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(e$.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=e$.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=Infinity,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(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let n=e.geometry;if(void 0!==n){let i=n.getAttribute("position");if(!0===t&&void 0!==i&&!0!==e.isInstancedMesh)for(let t=0,n=i.count;t<n;t++)!0===e.isMesh?e.getVertexPosition(t,e$):e$.fromBufferAttribute(i,t),e$.applyM
1atrix4(e.matrixWorld),this.expandByPoint(e$);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),eQ.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),eQ.copy(n.boundingBox)),eQ.applyMatrix4(e.matrixWorld),this.union(eQ)}let i=e.children;for(let e=0,n=i.length;e<n;e++)this.expandByObject(i[e],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,e$),e$.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(e6),e8.subVectors(this.max,e6),e0.subVectors(e.a,e6),e1.subVectors(e.b,e6),e3.subVectors(e.c,e6),e2.subVectors(e1,e0),e4.subVectors(e3,e1),e5.subVectors(e0,e3);let t=[0,-e2.z,e2.y,0,-e4.z,e4.y,0,-e5.z,e5.y,e2.z,0,-e2.x,e4.z,0,-e4.x,e5.z,0,-e5.x,-e2.y,e2.x,0,-e4.y,e4.x,0,-e5.y,e5.x,0];return!!te(t,e0,e1,e3,e8)&&!!te(t=[1,0,0,0,1,0,0,0,1],e0,e1,e3,e8)&&(e9.crossVectors(e2,e4),te(t=[e9.x,e9.y,e9.z],e0,e1,e3,e8))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,e$).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(e$).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(eJ[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),eJ[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),eJ[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),eJ[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),eJ[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),eJ[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),eJ[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),eJ[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(eJ)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}let eJ=[new D,new D,new D,new D,new D,new D,new D,new D],e$=new D,eQ=new eZ,e0=new D,e1=new D,e3=new D,e2=new D,e4=new D,e5=new D,e6=new D,e8=new D,e9=new D,e7=new D;function te(e,t,n,i,r){for(let a=0,s=e.length-3;a<=s;a+=3){e7.fromArray(e,a);let s=r.x*Math.abs(e7.x)+r.y*Math.abs(e7.y)+r.z*Math.abs(e7.z),o=t.dot(e7),l=n.dot(e7),c=i.dot(e7);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>s)return!1}return!0}let tt=new D,tn=new C,ti=0;class tr{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:ti++}),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=35044,this.updateRanges=[],this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;
vendor: 4,095 bytes, line 1
1for(let i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)tn.fromBufferAttribute(this,t),tn.applyMatrix3(e),this.setXY(t,tn.x,tn.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)tt.fromBufferAttribute(this,t),tt.applyMatrix3(e),this.setXYZ(t,tt.x,tt.y,tt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)tt.fromBufferAttribute(this,t),tt.applyMatrix4(e),this.setXYZ(t,tt.x,tt.y,tt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)tt.fromBufferAttribute(this,t),tt.applyNormalMatrix(e),this.setXYZ(t,tt.x,tt.y,tt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)tt.fromBufferAttribute(this,t),tt.transformDirection(e),this.setXYZ(t,tt.x,tt.y,tt.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=A(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=R(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=A(t,this.array)),t}setX(e,t){return this.normalized&&(t=R(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=A(t,this.array)),t}setY(e,t){return this.normalized&&(t=R(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=A(t,this.array)),t}setZ(e,t){return this.normalized&&(t=R(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=A(t,this.array)),t}setW(e,t){return this.normalized&&(t=R(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=R(t,this.array),n=R(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=R(t,this.array),n=R(n,this.array),i=R(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=R(t,this.array),n=R(n,this.array),i=R(i,this.array),r=R(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),35044!==this.usage&&(e.usage=this.usage),e}}class ta extends tr{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class ts extends tr{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class to extends tr{constructor(e,t,n){super(new Float32Array(e),t,n)}}let tl=new eZ,tc=new D,tu=new D;class th{constructor(e=new D,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;void 0!==t?n.copy(t):tl.setFromPoints(e).getCenter(n);let i=0;for(let t=0,r=e.length;t<r;t++)i=Math.max(i,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}
1applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;tc.subVectors(e,this.center);let t=tc.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(tc,n/e),this.radius+=n}return this}union(e){return e.isEmpty()||(this.isEmpty()?this.copy(e):!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(tu.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(tc.copy(e.center).add(tu)),this.expandByPoint(tc.copy(e.center).sub(tu)))),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let td=0,tf=new $,tp=new eb,tm=new D,tg=new eZ,t_=new eZ,tv=new D;class tx extends M{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:td++}),this.uuid=b(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,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(e){return Array.isArray(e)?this.index=new(!function(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}(e)?ta:ts)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(void 0!==n){let t=new N().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return tf.makeRotationFromQuaternion(e),this.applyMatrix4(tf),this}rotateX(e){return tf.makeRotationX(e),this.applyMatrix4(tf),this}rotateY(e){return tf.makeRotationY(e),this.applyMatrix4(tf),this}rotateZ(e){return tf.makeRotationZ(e),this.applyMatrix4(tf),this}translate(e,t,n){return tf.makeTranslation(e,t,n),this.applyMatrix4(tf),this}scale(e,t,n){return tf.makeScale(e,t,n),this.applyMatrix4(tf),this}lookAt(e){return tp.lookAt(e),tp.updateMatrix(),this.applyMatrix4(tp.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(tm).negate(),this.translate(tm.x,tm.y,tm.z),this}setFromPoints(e){let t=this.getAttribute("position");if(void 0===t){let t=[];for(let n=0,i=e.length;n<i;n++){let i=e[n];t.push(i.x,i.y,i.z||0)}this.setAttribute("position",new to(t,3))}else{let n=Math.min(e.length,t.count);for(let i=0;i<n;i++){let n=e[i];t.setXYZ(i,n.x,n.y,n.z||0)}e.length>t.count&&_("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new eZ);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){v("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new D(-1/0,-1/0,-1/0),new D(Infinity,Infinity,Infinity));return}if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];tg.setFromBufferAttribute(n),this.morphTargetsRelative?(tv.addVectors(this.boundingBox.min,tg.min),this.boundingBox.expandByPoint(tv),tv.addVectors(this.boundingBox.max,tg.max),this.boundingBox.expandByPoint(tv)):(this.boundingBox.expandByPoint(tg.min),this.boundingBox.expandByPoint(tg.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&v('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new th);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){v("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new D,1/0);return}if(e){let n=this.boundingSphere.center;if(tg.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];t_.setFromBufferAttribute(n),this.morphTargetsRelative?(tv.addVectors(tg.min,t_.min),tg.expandByPoint(tv),tv.addVectors(tg.max,t_.max),tg.expandByPoint(tv)):(tg.expandByPoint(t_.min),tg.expandByPoint(t_.max))}tg.getCenter(n);let i=0;for(let t=0,r=e.count;t<r;t++)tv.fromBufferAttribute(e,t),i=Math.max(i,n.distanceToSquared(tv));if(t)for(let r=0,a=t.length;r<a;r++){let a=t[r],s=this.morphTargetsRelative;for(let t=0,r=a.count;t<r;t++)tv.fromBufferAttribute(a,t),s&&(tm.fromBufferAttribute(e,t),tv.add(tm)),i=Math.max(i,n.distanceToSquared(tv))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&v('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void v("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");let n=t.position,i=t.normal,r=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new tr(new Float32Array(4*n.count),4));let a=this.getAttribute("tangent"),s=[],o=[];for(let e=0;e<n.count;e++)s[e]=new D,o[e]=new D;let l=new D,c=new D,u=new D,h=new C,d=new C,f=new C,p=new D,m=new D,g=this.groups;0===g.length&&(g=[{start:0,count:e.count}]);for(let t=0,i=g.length;t<i;++t){let i=g[t],a=i.start,_=i.count;for(let t=a,i=a+_;t<i;t+=3)!function(e,t,i){l.fromBufferAttribute(n,e),c.fromBufferAttribute(n,t),u.fromBufferAttribute(n,i),h.fromBufferAttribute(r,e),d.fromBufferAttribute(r,t),f.fromBufferAttribute(r,i),c.sub(l),u.sub(l),d.sub(h),f.sub(h);let a=1/(d.x*f.y-f.x*d.y);isFinite(a)&&(p.copy(c).multiplyScalar(f.y).addScaledVector(u,-d.y).multiplyScalar(a),m.copy(u).multiplyScalar(d.x).addScaledVector(c,-f.x).multiplyScalar(a),s[e].add(p),s[t].add(p),s[i].add(p),o[e].add(m),o[t].add(m),o[i].add(m))}(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let _=new D,x=new D,y=new D,M=new D;
vendor: 5,993 bytes, line 1
1function S(e){y.fromBufferAttribute(i,e),M.copy(y);let t=s[e];_.copy(t),_.sub(y.multiplyScalar(y.dot(t))).normalize(),x.crossVectors(M,t);let n=x.dot(o[e]);a.setXYZW(e,_.x,_.y,_.z,n<0?-1:1)}for(let t=0,n=g.length;t<n;++t){let n=g[t],i=n.start,r=n.count;for(let t=i,n=i+r;t<n;t+=3)S(e.getX(t+0)),S(e.getX(t+1)),S(e.getX(t+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new tr(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);let i=new D,r=new D,a=new D,s=new D,o=new D,l=new D,c=new D,u=new D;if(e)for(let h=0,d=e.count;h<d;h+=3){let d=e.getX(h+0),f=e.getX(h+1),p=e.getX(h+2);i.fromBufferAttribute(t,d),r.fromBufferAttribute(t,f),a.fromBufferAttribute(t,p),c.subVectors(a,r),u.subVectors(i,r),c.cross(u),s.fromBufferAttribute(n,d),o.fromBufferAttribute(n,f),l.fromBufferAttribute(n,p),s.add(c),o.add(c),l.add(c),n.setXYZ(d,s.x,s.y,s.z),n.setXYZ(f,o.x,o.y,o.z),n.setXYZ(p,l.x,l.y,l.z)}else for(let e=0,s=t.count;e<s;e+=3)i.fromBufferAttribute(t,e+0),r.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),c.subVectors(a,r),u.subVectors(i,r),c.cross(u),n.setXYZ(e+0,c.x,c.y,c.z),n.setXYZ(e+1,c.x,c.y,c.z),n.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)tv.fromBufferAttribute(e,t),tv.normalize(),e.setXYZ(t,tv.x,tv.y,tv.z)}toNonIndexed(){function e(e,t){let n=e.array,i=e.itemSize,r=e.normalized,a=new n.constructor(t.length*i),s=0,o=0;for(let r=0,l=t.length;r<l;r++){s=e.isInterleavedBufferAttribute?t[r]*e.data.stride+e.offset:t[r]*i;for(let e=0;e<i;e++)a[o++]=n[s++]}return new tr(a,i,r)}if(null===this.index)return _("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new tx,n=this.index.array,i=this.attributes;for(let r in i){let a=e(i[r],n);t.setAttribute(r,a)}let r=this.morphAttributes;for(let i in r){let a=[],s=r[i];for(let t=0,i=s.length;t<i;t++){let i=e(s[t],n);a.push(i)}t.morphAttributes[i]=a}t.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let e=0,n=a.length;e<n;e++){let n=a[e];t.addGroup(n.start,n.count,n.materialIndex)}return t}toJSON(){let e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){let t=this.parameters;for(let n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let i=n[t];e.data.attributes[t]=i.toJSON(e.data)}let i={},r=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,i=n.length;t<i;t++){let i=n[t];a.push(i.toJSON(e.data))}a.length>0&&(i[t]=a,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let s=this.boundingSphere;return null!==s&&(e.data.boundingSphere=s.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;null!==n&&this.setIndex(n.clone());let i=e.attributes;for(let e in i){let n=i[e];this.setAttribute(e,n.clone(t))}let r=e.morphAttributes;for(let e in r){let n=[],i=r[e];for(let e=0,r=i.length;e<r;e++)n.push(i[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let s=e.boundingBox;null!==s&&(this.boundingBox=s.clone());let o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}let ty=0;class tM extends M{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ty++}),this.uuid=b(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new eU(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,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.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let t in e){let n=e[t];if(void 0===n){_(`Material: parameter '${t}' has value of undefined.`);continue}let i=this[t];if(void 0===i){_(`Material: '${t}' 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[t]=n}}toJSON(e){let t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function i(e){let t=[];for(let n in e){let i=e[n];delete i.metadata,t.push(i)}return t}
vendor: 5,648 bytes, line 1
1if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),100!==this.blendEquation&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&
1(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),7680!==this.stencilFail&&(n.stencilFail=this.stencilFail),7680!==this.stencilZFail&&(n.stencilZFail=this.stencilZFail),7680!==this.stencilZPass&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!1===this.allowOverride&&(n.allowOverride=!1),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){let t=i(e.textures),r=i(e.images);t.length>0&&(n.textures=t),r.length>0&&(n.images=r)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(null!==t){let e=t.length;n=Array(e);for(let i=0;i!==e;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}let tS=new D,tT=new D,tE=new D,tb=new D,tw=new D,tA=new D,tR=new D;class tC extends tM{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new eU(0xffffff),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 el,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}let tP=new $,tD=new class{constructor(e=new D,t=new D(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,tS)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=tS.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(tS.copy(this.origin).addScaledVector(this.direction,t),tS.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){let r,a,s,o;tT.copy(e).add(t).multiplyScalar(.5),tE.copy(t).sub(e).normalize(),tb.copy(this.origin).sub(tT);let l=.5*e.distanceTo(t),c=-this.direction.dot(tE),u=tb.dot(this.direction),h=-tb.dot(tE),d=tb.lengthSq(),f=Math.abs(1-c*c);if(f>0)if(r=c*h-u,a=c*u-h,o=l*f,r>=0)if(a>=-o)if(a<=o){let e=1/f;r*=e,a*=e,s=r*(r+c*a+2*u)+a*(c*r+a+2*h)+d}else s=-(r=Math.max(0,-(c*(a=l)+u)))*r+a*(a+2*h)+d;else s=-(r=Math.max(0,-(c*(a=-l)+u)))*r+a*(a+2*h)+d;else a<=-o?(a=(r=Math.max(0,-(-c*l+u)))>0?-l:Math.min(Math.max(-l,-h),l),s=-r*r+a*(a+2*h)+d):a<=o?(r=0,s=(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+d):(a=(r=Math.max(0,-(c*l+u)))>0?l:Math.min(Math.max(-l,-h),l),s=-r*r+a*(a+2*h)+d);else a=c>0?-l:l,s=-(r=Math.max(0,-(c*a+u)))*r+a*(a+2*h)+d;return n&&n.copy(this.origin).addScaledVector(this.direction,r),i&&i.copy(tT).addScaledVector(tE,a),s}intersectSphere(e,t){tS.subVectors(e.center,this.origin);
1let n=tS.dot(this.direction),i=tS.dot(tS)-n*n,r=e.radius*e.radius;if(i>r)return null;let a=Math.sqrt(r-i),s=n-a,o=n+a;return o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return!!(0===t||e.normal.dot(this.direction)*t<0)}intersectBox(e,t){let n,i,r,a,s,o,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return(l>=0?(n=(e.min.x-h.x)*l,i=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,i=(e.min.x-h.x)*l),c>=0?(r=(e.min.y-h.y)*c,a=(e.max.y-h.y)*c):(r=(e.max.y-h.y)*c,a=(e.min.y-h.y)*c),n>a||r>i||((r>n||isNaN(n))&&(n=r),(a<i||isNaN(i))&&(i=a),u>=0?(s=(e.min.z-h.z)*u,o=(e.max.z-h.z)*u):(s=(e.max.z-h.z)*u,o=(e.min.z-h.z)*u),n>o||s>i||((s>n||n!=n)&&(n=s),(o<i||i!=i)&&(i=o),i<0)))?null:this.at(n>=0?n:i,t)}intersectsBox(e){return null!==this.intersectBox(e,tS)}intersectTriangle(e,t,n,i,r){let a;tw.subVectors(t,e),tA.subVectors(n,e),tR.crossVectors(tw,tA);let s=this.direction.dot(tR);if(s>0){if(i)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}tb.subVectors(this.origin,e);let o=a*this.direction.dot(tA.crossVectors(tb,tA));if(o<0)return null;let l=a*this.direction.dot(tw.cross(tb));if(l<0||o+l>s)return null;let c=-a*tb.dot(tR);return c<0?null:this.at(c/s,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},tL=new th,tU=new D,tN=new D,tI=new D,tO=new D,tF=new D,tB=new D,tz=new D,tk=new D;class tV extends eb{constructor(e=new tx,t=new tC){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);let s=this.morphTargetInfluences;if(r&&s){tB.set(0,0,0);for(let n=0,i=r.length;n<i;n++){let i=s[n],o=r[n];0!==i&&(tF.fromBufferAttribute(o,e),a?tB.addScaledVector(tF,i):tB.addScaledVector(tF.sub(t),i))}t.add(tB)}return t}raycast(e,t){let n=this.geometry,i=this.material,r=this.matrixWorld;void 0===i||(null===n.boundingSphere&&n.computeBoundingSphere(),tL.copy(n.boundingSphere),tL.applyMatrix4(r),tD.copy(e.ray).recast(e.near),!1===tL.containsPoint(tD.origin)&&(null===tD.intersectSphere(tL,tU)||tD.origin.distanceToSquared(tU)>(e.far-e.near)**2)||(tP.copy(r).invert(),tD.copy(e.ray).applyMatrix4(tP),(null===n.boundingBox||!1!==tD.intersectsBox(n.boundingBox))&&this._computeIntersections(e,t,tD)))}_computeIntersections(e,t,n){let i,r=this.geometry,a=this.material,s=r.index,o=r.attributes.position,l=r.attributes.uv,c=r.attributes.uv1,u=r.attributes.normal,h=r.groups,d=r.drawRange;if(null!==s)if(Array.isArray(a))for(let r=0,o=h.length;r<o;r++){let o=h[r],f=a[o.materialIndex],p=Math.max(o.start,d.start),m=Math.min(s.count,Math.min(o.start+o.count,d.start+d.count));for(let r=p;r<m;r+=3)(i=tH(this,f,e,n,l,c,u,s.getX(r),s.getX(r+1),s.getX(r+2)))&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=o.materialIndex,t.push(i))}else{let r=Math.max(0,d.start),o=Math.min(s.count,d.start+d.count);for(let h=r;h<o;
1h+=3)(i=tH(this,a,e,n,l,c,u,s.getX(h),s.getX(h+1),s.getX(h+2)))&&(i.faceIndex=Math.floor(h/3),t.push(i))}else if(void 0!==o)if(Array.isArray(a))for(let r=0,s=h.length;r<s;r++){let s=h[r],f=a[s.materialIndex],p=Math.max(s.start,d.start),m=Math.min(o.count,Math.min(s.start+s.count,d.start+d.count));for(let r=p;r<m;r+=3)(i=tH(this,f,e,n,l,c,u,r,r+1,r+2))&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=s.materialIndex,t.push(i))}else{let r=Math.max(0,d.start),s=Math.min(o.count,d.start+d.count);for(let o=r;o<s;o+=3)(i=tH(this,a,e,n,l,c,u,o,o+1,o+2))&&(i.faceIndex=Math.floor(o/3),t.push(i))}}}function tH(e,t,n,i,r,a,s,o,l,c){e.getVertexPosition(o,tN),e.getVertexPosition(l,tI),e.getVertexPosition(c,tO);let u=function(e,t,n,i,r,a,s,o){if(null===(1===t.side?i.intersectTriangle(s,a,r,!0,o):i.intersectTriangle(r,a,s,0===t.side,o)))return null;tk.copy(o),tk.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(tk);return l<n.near||l>n.far?null:{distance:l,point:tk.clone(),object:e}}(e,t,n,i,tN,tI,tO,tz);if(u){let e=new D;eK.getBarycoord(tz,tN,tI,tO,e),r&&(u.uv=eK.getInterpolatedAttribute(r,o,l,c,e,new C)),a&&(u.uv1=eK.getInterpolatedAttribute(a,o,l,c,e,new C)),s&&(u.normal=eK.getInterpolatedAttribute(s,o,l,c,e,new D),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));let t={a:o,b:l,c:c,normal:new D,materialIndex:0};eK.getNormal(tN,tI,tO,t.normal),u.face=t,u.barycoord=e}return u}class tG extends Y{constructor(e=null,t=1,n=1,i,r,a,s,o,l=1003,c=1003,u,h){super(null,a,s,o,l,c,i,r,u,h),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}let tW=new D,tX=new D,tj=new N;class tY{constructor(e=new D(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=tW.subVectors(n,t).cross(tX.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let n=e.delta(tW),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;let r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||tj.getNormalMatrix(e),i=this.coplanarPoint(tW).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}let tq=new th,tK=new C(.5,.5),tZ=new D;class tJ{constructor(e=new tY,t=new tY,n=new tY,i=new tY,r=new tY,a=new tY){this.planes=[e,t,n,i,r,a]}set(e,t,n,i,r,a){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(n),s[3].copy(i),s[4].copy(r),s[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=2e3,n=!1){let i=this.planes,r=e.elements,a=r[0],s=r[1],o=r[2],l=r[3],c=r[4],u=r[5],h=r[6],d=r[7],f=r[8],p=r[9],m=r[10],g=r[11],_=r[12],v=r[13],x=r[14],y=r[15];if(i[0].setComponents(l-a,d-c,g-f,y-_).normalize(),i[1].setComponents(l+a,d+c,g+f,y+_).normalize(),i[2].setComponents(l+s,d+u,g+p,y+v).normalize(),i[3].setComponents(l-s,d-u,g-p,y-v).normalize(),n)i[4].setComponents(o,h,m,x).normalize(),i[5].setComponents(l-o,d-h,g-m,y-x).normalize();else if(i[4].setComponents(l-o,d-h,g-m,y-x).normalize(),2e3===t)i[5].setComponents(l+o,d+h,g+m,y+x).normalize();else if(2001===t)i[5].setComponents(o,h,m,x).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),tq.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),tq.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(tq)}intersectsSprite(e){return tq.center.set(0,0,0),tq.radius=.7071067811865476+tK.distanceTo(e.center),tq.applyMatrix4(e.matrixWorld),this.intersectsSphere(tq)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let i=t[n];if(tZ.x=i.normal.x>0?e.max.x:e.min.x,tZ.y=i.normal.y>0?e.max.y:e.min.y,tZ.z=i.normal.z>0?e.max.z:e.min.z,0>i.distanceToPoint(tZ))return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(0>t[n].distanceToPoint(e))return!1;return!0}clone(){return new this.constructor().copy(this)}}class t$ extends Y{constructor(e=[],t=301,n,i,r,a,s,o,l,c){super(e,t,n,i,r,a,s,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class tQ extends Y{constructor(e,t,n=1014,i,r,a,s=1003,o=1003,l,c=1026,u=1){if(1026!==c&&1027!==c)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:e,height:t,depth:u},i,r,a,s,o,c,n,l),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new G(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}class t0 extends tQ{constructor(e,t=1014,n=301,i,r,a=1003,s=1003,o,l=1026){const c={width:e,height:e,depth:1};super(e,e,t,n,i,r,a,s,o,l),this.image=[c,c,c,c,c,c],this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class t1 extends Y{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class t3 extends tx{constructor(e=1,t=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const s=this;i=Math.floor(i),r=Math.floor(r);const o=[],l=[],c=[],u=[];let h=0,d=0;function f(e,t,n,i,r,a,f,p,m,g,_){let v=a/m,x=f/g,y=a/2,M=f/2,S=p/2,T=m+1,E=g+1,b=0,w=0,A=new D;for(let a=0;a<E;a++){let s=a*x-M;for(let o=0;o<T;o++){let h=o*v-y;A[e]=h*i,A[t]=s*r,A[n]=S,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[n]=p>0?1:-1,c.push(A.x,A.y,A.z),u.push(o/m),u.push(1-a/g),b+=1}
1}for(let e=0;e<g;e++)for(let t=0;t<m;t++){let n=h+t+T*e,i=h+t+T*(e+1),r=h+(t+1)+T*(e+1),a=h+(t+1)+T*e;o.push(n,i,a),o.push(i,r,a),w+=6}s.addGroup(d,w,_),d+=w,h+=b}f("z","y","x",-1,-1,n,t,e,a=Math.floor(a),r,0),f("z","y","x",1,-1,n,t,-e,a,r,1),f("x","z","y",1,1,e,n,t,i,a,2),f("x","z","y",1,-1,e,n,-t,i,a,3),f("x","y","z",1,-1,e,t,n,i,r,4),f("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(o),this.setAttribute("position",new to(l,3)),this.setAttribute("normal",new to(c,3)),this.setAttribute("uv",new to(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new t3(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class t2{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){_("Curve: .getPoint() not implemented.")}getPointAt(e,t){let n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){let t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){let t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],n,i=this.getPoint(0),r=0;t.push(0);for(let a=1;a<=e;a++)t.push(r+=(n=this.getPoint(a/e)).distanceTo(i)),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){let n,i=this.getLengths(),r=0,a=i.length;n=t||e*i[a-1];let s=0,o=a-1,l;for(;s<=o;)if((l=i[r=Math.floor(s+(o-s)/2)]-n)<0)s=r+1;else if(l>0)o=r-1;else{o=r;break}if(i[r=o]===n)return r/(a-1);let c=i[r],u=i[r+1];return(r+(n-c)/(u-c))/(a-1)}getTangent(e,t){let n=e-1e-4,i=e+1e-4;n<0&&(n=0),i>1&&(i=1);let r=this.getPoint(n),a=this.getPoint(i),s=t||(r.isVector2?new C:new D);return s.copy(a).sub(r).normalize(),s}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){let n=new D,i=[],r=[],a=[],s=new D,o=new $;for(let t=0;t<=e;t++){let n=t/e;i[t]=this.getTangentAt(n,new D)}r[0]=new D,a[0]=new D;let l=Number.MAX_VALUE,c=Math.abs(i[0].x),u=Math.abs(i[0].y),h=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),h<=l&&n.set(0,0,1),s.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],s),a[0].crossVectors(i[0],r[0]);for(let t=1;t<=e;t++){if(r[t]=r[t-1].clone(),a[t]=a[t-1].clone(),s.crossVectors(i[t-1],i[t]),s.length()>Number.EPSILON){s.normalize();let e=Math.acos(w(i[t-1].dot(i[t]),-1,1));r[t].applyMatrix4(o.makeRotationAxis(s,e))}a[t].crossVectors(i[t],r[t])}if(!0===t){let t=Math.acos(w(r[0].dot(r[e]),-1,1));t/=e,i[0].dot(s.crossVectors(r[0],r[e]))>0&&(t=-t);for(let n=1;n<=e;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],t*n)),a[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class t4 extends t2{constructor(e=0,t=0,n=1,i=1,r=0,a=2*Math.PI,s=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=s,this.aRotation=o}getPoint(e,t=new C){let n=2*Math.PI,i=this.aEndAngle-this.aStartAngle,r=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=n;for(;i>n;)i-=n;i<Number.EPSILON&&(i=r?0:n),!0!==this.aClockwise||r||(i===n?i=-n:i-=n);let a=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(a),o=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=s-this.aX,i=o-this.aY;s=n*e-i*t+this.aX,o=n*t+i*e+this.aY}return t.set(s,o)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}function t5(){let e=0,t=0,n=0,i=0;function r(r,a,s,o){e=r,t=s,n=-3*r+3*a-2*s-o,i=2*r-2*a+s+o}return{initCatmullRom:function(e,t,n,i,a){r(t,n,a*(n-e),a*(i-t))},initNonuniformCatmullRom:function(e,t,n,i,a,s,o){let l=(t-e)/a-(n-e)/(a+s)+(n-t)/s,c=(n-t)/s-(i-t)/(s+o)+(i-n)/o;r(t,n,l*=s,c*=s)},calc:function(r){let a=r*r;return e+t*r+n*a+a*r*i}}}let t6=new D,t8=new t5,t9=new t5,t7=new t5;function ne(e,t,n,i,r){let a=(i-t)*.5,s=(r-n)*.5,o=e*e;return e*o*(2*n-2*i+a+s)+(-3*n+3*i-2*a-s)*o+a*e+n}function nt(e,t,n,i){let r;return(r=1-e)*r*t+2*(1-e)*e*n+e*e*i}function nn(e,t,n,i,r){let a,s;return(a=1-e)*a*a*t+3*(s=1-e)*s*e*n+3*(1-e)*e*e*i+e*e*e*r}class ni extends t2{constructor(e=new C,t=new C,n=new C,i=new C){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new C){let n=this.v0,i=this.v1,r=this.v2,a=this.v3;return t.set(nn(e,n.x,i.x,r.x,a.x),nn(e,n.y,i.y,r.y,a.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class nr extends t2{constructor(e=new C,t=new C){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new C){return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}
1getTangent(e,t=new C){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class na extends t2{constructor(e=new C,t=new C,n=new C){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new C){let n=this.v0,i=this.v1,r=this.v2;return t.set(nt(e,n.x,i.x,r.x),nt(e,n.y,i.y,r.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class ns extends t2{constructor(e=new D,t=new D,n=new D){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new D){let n=this.v0,i=this.v1,r=this.v2;return t.set(nt(e,n.x,i.x,r.x),nt(e,n.y,i.y,r.y),nt(e,n.z,i.z,r.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class no extends t2{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new C){let n=this.points,i=(n.length-1)*e,r=Math.floor(i),a=i-r,s=n[0===r?r:r-1],o=n[r],l=n[r>n.length-2?n.length-1:r+1],c=n[r>n.length-3?n.length-1:r+2];return t.set(ne(a,s.x,o.x,l.x,c.x),ne(a,s.y,o.y,l.y,c.y)),t}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(n.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){let n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(new C().fromArray(n))}return this}}class nl extends tx{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const r=e/2,a=t/2,s=Math.floor(n),o=Math.floor(i),l=s+1,c=o+1,u=e/s,h=t/o,d=[],f=[],p=[],m=[];for(let e=0;e<c;e++){const t=e*h-a;for(let n=0;n<l;n++){const i=n*u-r;f.push(i,-t,0),p.push(0,0,1),m.push(n/s),m.push(1-e/o)}}for(let e=0;e<o;e++)for(let t=0;t<s;t++){const n=t+l*e,i=t+l*(e+1),r=t+1+l*(e+1),a=t+1+l*e;d.push(n,i,a),d.push(i,r,a)}this.setIndex(d),this.setAttribute("position",new to(f,3)),this.setAttribute("normal",new to(p,3)),this.setAttribute("uv",new to(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new nl(e.width,e.height,e.widthSegments,e.heightSegments)}}function nc(e){let t={};for(let n in e)for(let i in t[n]={},e[n]){let r=e[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(_("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][i]=null):t[n][i]=r.clone():Array.isArray(r)?t[n][i]=r.slice():t[n][i]=r}return t}function nu(e){let t={};for(let n=0;n<e.length;n++){let i=nc(e[n]);for(let e in i)t[e]=i[e]}return t}function nh(e){let t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:B.workingColorSpace}class nd extends tM{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",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,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=nc(e.uniforms),this.uniformsGroups=function(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){let t=super.toJSON(e);for(let n in t.glslVersion=this.glslVersion,t.uniforms={},this.uniforms){let i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class nf extends nd{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class np extends tM{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class nm extends tM{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function ng(e,t){return e&&e.constructor!==t?"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e):e}class n_{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,i=t[n],r=t[n-1];e:{t:{let a;n:{i:if(!(e<i)){for(let a=n+2;;){if(void 0===i){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(r=i,e<(i=t[++n]))break t}a=t.length;break n}if(!(e>=r)){let s=t[1];e<s&&(n=2,r=s);for(let a=n-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(i=r,e>=(r=t[--n-1]))break t}a=n,n=0;break n}break e}for(;n<a;){let i=n+a>>>1;e<t[i]?a=i:n=i+1}if(i=t[n],void 0===(r=t[n-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===i)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i;for(let e=0;e!==i;++e)t[e]=n[r+e];return t}interpolate_(){throw Error("call to abstract method")}intervalChanged_(){}}class nv extends n_{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(e,t,n){let i=this.parameterPositions,r=e-2,a=e+1,s=i[r],o=i[a];if(void 0===s)switch(this.getSettings_().endingStart){case 2401:r=e,s=2*t-n;break;case 2402:r=i.length-2,s=t+i[r]-i[r+1];break;default:r=e,s=n}if(void 0===o)switch(this.getSettings_().endingEnd){case 2401:a=e,o=2*n-t;break;case 2402:a=1,o=n+i[1]-i[0];break;default:a=e-1,o=t}let l=(n-t)*.5,c=this.valueSize;this._weightPrev=l/(t-s),this._weightNext=l/(o-n),this._offsetPrev=r*c,this._offsetNext=a*c}interpolate_(e,t,n,i){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,f=(n-t)/(i-t),p=f*f,m=p*f,g=-h*m+2*h*p-h*f,_=(1+h)*m+(-1.5-2*h)*p+(-.5+h)*f+1,v=(-1-d)*m+(1.5+d)*p+.5*f,x=d*m-d*p;for(let e=0;e!==s;++e)r[e]=g*a[c+e]+_*a[l+e]+v*a[o+e]+x*a[u+e];return r}}class nx extends n_{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=(n-t)/(i-t),u=1-c;for(let e=0;e!==s;++e)r[e]=a[l+e]*u+a[o+e]*c;return r}}class ny extends n_{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class nM extends n_{interpolate_(e,t,n,i){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=this.settings||this.DefaultSettings_,u=c.inTangents,h=c.outTangents;
1if(!u||!h){let e=(n-t)/(i-t),c=1-e;for(let t=0;t!==s;++t)r[t]=a[l+t]*c+a[o+t]*e;return r}let d=2*s,f=e-1;for(let c=0;c!==s;++c){let s,p,m,g,_,v=a[l+c],x=a[o+c],y=f*d+2*c,M=h[y],S=h[y+1],T=e*d+2*c,E=u[T],b=u[T+1],w=(n-t)/(i-t);for(let e=0;e<8;e++){p=(s=w*w)*w;let e=(_=(g=(m=1-w)*m)*m)*t+3*g*w*M+3*m*s*E+p*i-n;if(1e-10>Math.abs(e))break;let r=3*g*(M-t)+6*m*w*(E-M)+3*s*(i-E);if(1e-10>Math.abs(r))break;w-=e/r,w=Math.max(0,Math.min(1,w))}r[c]=_*v+3*g*w*S+3*m*s*b+p*x}return r}}class nS{constructor(e,t,n,i){if(void 0===e)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=ng(t,this.TimeBufferType),this.values=ng(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){let t,n=e.constructor;if(n.toJSON!==this.toJSON)t=n.toJSON(e);else{t={name:e.name,times:ng(e.times,Array),values:ng(e.values,Array)};let n=e.getInterpolation();n!==e.DefaultInterpolation&&(t.interpolation=n)}return t.type=e.ValueTypeName,t}InterpolantFactoryMethodDiscrete(e){return new ny(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new nx(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new nv(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodBezier(e){let t=new nM(this.times,this.values,this.getValueSize(),e);return this.settings&&(t.settings=this.settings),t}setInterpolation(e){let t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth;break;case 2303:t=this.InterpolantFactoryMethodBezier}if(void 0===t){let t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(t);return _("KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302;case this.InterpolantFactoryMethodBezier:return 2303}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){let t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(1!==e){let t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){let n=this.times,i=n.length,r=0,a=i-1;for(;r!==i&&n[r]<e;)++r;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==r||a!==i){r>=a&&(r=(a=Math.max(a,1))-1);let e=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*e,a*e)}return this}validate(){var e;let t=!0,n=this.getValueSize();n-Math.floor(n)!=0&&(v("KeyframeTrack: Invalid value size in track.",this),t=!1);let i=this.times,r=this.values,a=i.length;0===a&&(v("KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==a;e++){let n=i[e];if("number"==typeof n&&isNaN(n)){v("KeyframeTrack: Time is not a valid number.",this,e,n),t=!1;break}if(null!==s&&s>n){v("KeyframeTrack: Out of order keys.",this,e,n,s),t=!1;break}s=n}if(void 0!==r&&ArrayBuffer.isView(e=r)&&!(e instanceof DataView))for(let e=0,n=r.length;e!==n;++e){let n=r[e];if(isNaN(n)){v("KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=2302===this.getInterpolation(),r=e.length-1,a=1;for(let s=1;s<r;++s){let r=!1,o=e[s];if(o!==e[s+1]&&(1!==s||o!==e[0]))if(i)r=!0;else{let e=s*n,i=e-n,a=e+n;for(let s=0;s!==n;++s){let n=t[e+s];if(n!==t[i+s]||n!==t[a+s]){r=!0;break}}}if(r){if(s!==a){e[a]=e[s];let i=s*n,r=a*n;for(let e=0;e!==n;++e)t[r+e]=t[i+e]}++a}}if(r>0){e[a]=e[r];for(let e=r*n,i=a*n,s=0;s!==n;++s)t[i+s]=t[e+s];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}nS.prototype.ValueTypeName="",nS.prototype.TimeBufferType=Float32Array,nS.prototype.ValueBufferType=Float32Array,nS.prototype.DefaultInterpolation=2301;class nT extends nS{constructor(e,t,n){super(e,t,n)}}nT.prototype.ValueTypeName="bool",nT.prototype.ValueBufferType=Array,nT.prototype.DefaultInterpolation=2300,nT.prototype.InterpolantFactoryMethodLinear=void 0,nT.prototype.InterpolantFactoryMethodSmooth=void 0,(class extends nS{constructor(e,t,n,i){super(e,t,n,i)}}).prototype.ValueTypeName="color",(class extends nS{constructor(e,t,n,i){super(e,t,n,i)}}).prototype.ValueTypeName="number";class nE extends n_{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=(n-t)/(i-t),l=e*s;for(let e=l+s;
1l!==e;l+=4)P.slerpFlat(r,0,a,l-s,a,l,o);return r}}class nb extends nS{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new nE(this.times,this.values,this.getValueSize(),e)}}nb.prototype.ValueTypeName="quaternion",nb.prototype.InterpolantFactoryMethodSmooth=void 0;class nw extends nS{constructor(e,t,n){super(e,t,n)}}nw.prototype.ValueTypeName="string",nw.prototype.ValueBufferType=Array,nw.prototype.DefaultInterpolation=2300,nw.prototype.InterpolantFactoryMethodLinear=void 0,nw.prototype.InterpolantFactoryMethodSmooth=void 0,(class extends nS{constructor(e,t,n,i){super(e,t,n,i)}}).prototype.ValueTypeName="vector",new WeakMap;let nA=new D,nR=new P,nC=new D;class nP extends eb{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new $,this.projectionMatrix=new $,this.projectionMatrixInverse=new $,this.coordinateSystem=2e3,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(nA,nR,nC),1===nC.x&&1===nC.y&&1===nC.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(nA,nR,nC.set(1,1,1)).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorld.decompose(nA,nR,nC),1===nC.x&&1===nC.y&&1===nC.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(nA,nR,nC.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}let nD=new D,nL=new C,nU=new C;class nN extends nP{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=2*E*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*T*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*E*Math.atan(Math.tan(.5*T*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){nD.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(nD.x,nD.y).multiplyScalar(-e/nD.z),nD.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(nD.x,nD.y).multiplyScalar(-e/nD.z)}getViewSize(e,t){return this.getViewBounds(e,nL,nU),t.subVectors(nU,nL)}setViewOffset(e,t,n,i,r,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*T*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){let e=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/e,t-=a.offsetY*n/s,i*=a.width/e,n*=a.height/s}let s=this.filmOffset;0!==s&&(r+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class nI extends nP{constructor(e=-1,t=1,n=1,i=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="Orthogra
1phicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-e,a=n+e,s=i+t,o=i-t;if(null!==this.view&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=e*this.view.offsetX,a=r+e*this.view.width,s-=t*this.view.offsetY,o=s-t*this.view.height}this.projectionMatrix.makeOrthographic(r,a,s,o,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}new WeakMap;class nO extends eb{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new nN(-90,1,e,t);i.layers=this.layers,this.add(i);const r=new nN(-90,1,e,t);r.layers=this.layers,this.add(r);const a=new nN(-90,1,e,t);a.layers=this.layers,this.add(a);const s=new nN(-90,1,e,t);s.layers=this.layers,this.add(s);const o=new nN(-90,1,e,t);o.layers=this.layers,this.add(o);const l=new nN(-90,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,i,r,a,s,o]=t;for(let e of t)this.remove(e);if(2e3===e)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(2001===e)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[r,a,s,o,l,c]=this.children,u=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.xr.enabled;e.xr.enabled=!1;let p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let m=!1;m=!0===e.isWebGLRenderer?e.state.buffers.depth.getReversed():e.reversedDepthBuffer,e.setRenderTarget(n,0,i),m&&!1===e.autoClear&&e.clearDepth(),e.render(t,r),e.setRenderTarget(n,1,i),m&&!1===e.autoClear&&e.clearDepth(),e.render(t,a),e.setRenderTarget(n,2,i),m&&!1===e.autoClear&&e.clearDepth(),e.render(t,s),e.setRenderTarget(n,3,i),m&&!1===e.autoClear&&e.clearDepth(),e.render(t,o),e.setRenderTarget(n,4,i),m&&!1===e.autoClear&&e.clearDepth(),e.render(t,l),n.texture.generateMipmaps=p,e.setRenderTarget(n,5,i),m&&!1===e.autoClear&&e.clearDepth(),e.render(t,c),e.setRenderTarget(u,h,d),e.xr.enabled=f,n.texture.needsPMREMUpdate=!0}}class nF extends nN{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}let nB="\\[\\]\\.:\\/",nz=RegExp("["+nB+"]","g"),nk="[^"+nB+"]",nV="[^"+nB.replace("\\.","")+"]",nH=RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",nk)+/(WCOD+)?/.source.replace("WCOD",nV)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",nk)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",nk)+"$"),nG=["material","materials","bones","map"];class nW{constructor(e,t,n){this.path=t,this.parsedPath=n||nW.parseTrackName(t),this.node=nW.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nW.Composite(e,t,n):new nW(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(nz,"")}static parseTrackName(e){let t=nH.exec(e);if(null===t)throw Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){let e=n.nodeName.substring(i+1);-1!==nG.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){let n=function(e){for(let i=0;i<e.length;i++){let r=e[i];if(r.name===t||r.uuid===t)return r;let a=n(r.children);if(a)return a}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}
vendor: 4,545 bytes, line 1
1_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,n=t.objectName,i=t.propertyName,r=t.propertyIndex;if(e||(e=nW.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void _("PropertyBinding: No target node found for track: "+this.path+".");if(n){let i=t.objectIndex;switch(n){case"materials":if(!e.material)return void v("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void v("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void v("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===i){i=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void v("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void v("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[n])return void v("PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==i){if(void 0===e[i])return void v("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[i]}}let a=e[i];if(void 0===a)return void v("PropertyBinding: Trying to update property for track: "+t.nodeName+"."+i+" but it wasn't found.",e);let s=this.Versioning.None;this.targetObject=e,!0===e.isMaterial?s=this.Versioning.NeedsUpdate:!0===e.isObject3D&&(s=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!e.geometry)return void v("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void v("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[r]&&(r=e.morphTargetDictionary[r])}o=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(o=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}function nX(e,t,n,i){let r=function(e){switch(e){case 1009:case 1010:return{byteLength:1,components:1};case 1012:case 1011:case 1016:return{byteLength:2,components:1};case 1017:case 1018:return{byteLength:2,components:4};case 1014:case 1013:case 1015:return{byteLength:4,components:1};case 35902:case 35899:return{byteLength:4,components:3}}throw Error(`Unknown texture type ${e}.`)}(i);switch(n){case 1021:return e*t;case 1028:case 1029:return e*t/r.components*r.byteLength;case 1030:case 1031:return e*t*2/r.components*r.byteLength;case 1022:return e*t*3/r.components*r.byteLength;case 1023:case 1033:return e*t*4/r.components*r.byteLength;case 33776:case 33777:case 36196:case 37492:case 37488:case 37489:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case 33778:case 33779:case 37496:case 37490:case 37491:case 37808:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case 35841:case 35843:return Math.max(e,16)*Math.max(t,8)/4;case 35840:case 35842:return Math.max(e,8)*Math.max(t,8)/2;
1case 37809:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case 37810:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case 37811:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case 37812:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case 37813:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case 37814:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case 37815:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case 37816:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case 37817:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case 37818:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case 37819:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case 37820:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case 37821:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case 36492:case 36494:case 36495:case 36285:case 36286:return Math.ceil(e/4)*Math.ceil(t/4)*16;case 36283:case 36284:return Math.ceil(e/4)*Math.ceil(t/4)*8}throw Error(`Unable to determine texture byte length for ${n} format.`)}function nj(){let e=null,t=!1,n=null,i=null;function r(t,a){n(t,a),i=e.requestAnimationFrame(r)}return{start:function(){!0===t||null!==n&&(i=e.requestAnimationFrame(r),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function nY(e){let t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);let i=t.get(n);i&&(e.deleteBuffer(i.buffer),t.delete(n))},update:function(n,i){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){let e=t.get(n);(!e||e.version<n.version)&&t.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version});return}let r=t.get(n);if(void 0===r)t.set(n,function(t,n){let i,r=t.array,a=t.usage,s=r.byteLength,o=e.createBuffer();if(e.bindBuffer(n,o),e.bufferData(n,r,a),t.onUploadCallback(),r instanceof Float32Array)i=e.FLOAT;else if("u">typeof Float16Array&&r instanceof Float16Array)i=e.HALF_FLOAT;else if(r instanceof Uint16Array)i=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)i=e.SHORT;else if(r instanceof Uint32Array)i=e.UNSIGNED_INT;else if(r instanceof Int32Array)i=e.INT;else if(r instanceof Int8Array)i=e.BYTE;else if(r instanceof Uint8Array)i=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)i=e.UNSIGNED_BYTE;else throw Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r);return{buffer:o,type:i,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:s}}(n,i));else if(r.version<n.version){if(r.size!==n.array.byteLength)throw Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(t,n,i){let r=n.array,a=n.updateRanges;if(e.bindBuffer(i,t),0===a.length)e.bufferSubData(i,0,r);else{a.sort((e,t)=>e.start-t.start);let t=0;for(let e=1;e<a.length;e++){let n=a[t],i=a[e];i.start<=n.start+n.count+1?n.count=Math.max(n.count,i.start+i.count-n.start):a[++t]=i}a.length=t+1;for(let t=0,n=a.length;t<n;t++){let n=a[t];e.bufferSubData(i,n.start*r.BYTES_PER_ELEMENT,r,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}(r.buffer,n,i),r.version=n.version}}}}nW.Composite=class{constructor(e,t,n){const i=n||nW.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nW.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},nW.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},nW.prototype.GetterByBindingType=[nW.prototype._getValue_direct,nW.prototype._getValue_array,nW.prototype._getValue_arrayElement,nW.prototype._getValue_toArray],nW.prototype.SetterByBindingTypeAndVersioning=[[nW.prototype._setValue_direct,nW.prototype._setValue_direct_setNeedsUpdate,nW.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[nW.prototype._setValue_array,nW.prototype._setValue_array_setNeedsUpdate,nW.prototype._setValue_array_setMatr
1ixWorldNeedsUpdate],[nW.prototype._setValue_arrayElement,nW.prototype._setValue_arrayElement_setNeedsUpdate,nW.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[nW.prototype._setValue_fromArray,nW.prototype._setValue_fromArray_setNeedsUpdate,nW.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]],new Float32Array(1),"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"183"}})),"u">typeof window&&(window.__THREE__?_("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="183");let nq={alphahash_fragment:"#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n const float ALPHA_HASH_SCALE = 0.05;\n float hash2D( vec2 value ) {\n return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n }\n float hash3D( vec3 value ) {\n return hash2D( vec2( hash2D( value.xy ), value.z ) );\n }\n float getAlphaHashThreshold( vec3 position ) {\n float maxDeriv = max(\n length( dFdx( position.xyz ) ),\n length( dFdy( position.xyz ) )\n );\n float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n vec2 pixScales = vec2(\n exp2( floor( log2( pixScale ) ) ),\n exp2( ceil( log2( pixScale ) ) )\n );\n vec2 alpha = vec2(\n hash3D( floor( pixScales.x * position.xyz ) ),\n hash3D( floor( pixScales.y * position.xyz ) )\n );\n float lerpFactor = fract( log2( pixScale ) );\n float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n float a = min( lerpFactor, 1.0 - lerpFactor );\n vec3 cases = vec3(\n x * x / ( 2.0 * a * ( 1.0 - a ) ),\n ( x - 0.5 * a ) / ( 1.0 - a ),\n 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n );\n float threshold = ( x < ( 1.0 - a ) )\n ? ( ( x < a ) ? cases.x : cases.y )\n : cases.z;\n return clamp( threshold , 1.0e-6, 1.0 );\n }\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n #ifdef ALPHA_TO_COVERAGE\n diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_CLEARCOAT ) \n clearcoatSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_SHEEN ) \n sheenSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n #if ! defined( GL_ANGLE_multi_draw )\n #define gl_DrawID _gl_DrawID\n uniform int _gl_DrawID;\n #endif\n uniform highp sampler2D batchingTexture;\n uniform highp usampler2D batchingIdTexture;\n mat4 getBatchingMatrix( const in float i ) {\n int size = textureSize( batchingTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n float getIndirectIndex( const in int i ) {\n int size = textureSize( batchingIdTexture, 0 ).x;\n int x = i % size;\n int y = i / size;\n return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n }\n#endif\n#ifdef USE_BATCHING_COLOR\n uniform sampler2D batchingColorTexture;\n vec4 getBatchingColor( const in float i ) {\n int size = textureSize( batchingColorTexture, 0 ).x;\n int j = int( i );\n int x = j % size;\n int y = j / size;\n return texelFetch( batchingColorTexture, ivec2( x, y ), 0 );\n }\n#endif",batching_vertex:"#ifdef USE_BATCHING\n mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n vPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( lightDir + viewDir );
1\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n const mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n }\n vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n }\n float IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n }\n vec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n }\n vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );
1\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++ m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n }\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vBumpMapUv );\n vec2 dSTdy = dFdy( vBumpMapUv );\n float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #ifdef ALPHA_TO_COVERAGE\n float distanceToPlane, distanceGradient;\n float clipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n if ( clipOpacity == 0.0 ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n float unionClipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n }\n #pragma unroll_loop_end\n clipOpacity *= 1.0 - unionClipOpacity;\n #endif\n diffuseColor.a *= clipOpacity;\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n #endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec4 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec4( 1.0 );\n#endif\n#ifdef USE_COLOR_ALPHA\n vColor *= color;\n#elif defined( USE_COLOR )\n vColor.rgb *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.rgb *= instanceColor.rgb;\n#endif\n#ifdef USE_BATCHING_COLOR\n vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n varying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define cubeUV_r0 1.0\n #define cubeUV_m0 - 2.0\n #define cubeUV_r1 0.8\n #define cubeUV_m1 - 1.0\n #define cubeUV_r4 0.4\n #define cubeUV_m4 2.0\n #define cubeUV_r5 0.305\n #define cubeUV_m5 3.0\n #define cubeUV_r6 0.21\n #define cubeUV_m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= cubeUV_r1 ) {\n mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n } else if ( roughness >= cubeUV_r4 ) {\n mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n } else if ( roughness >= cubeUV_r5 ) {\n mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n } else if ( roughness >= cubeUV_r6 ) {\n mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n vec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n mat3 bm = mat3( batchingMatrix );
1\n transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n transformedNormal = bm * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = bm * transformedTangent;\n #endif\n#endif\n#ifdef USE_INSTANCING\n mat3 im = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n transformedNormal = im * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = im * transformedTangent;\n #endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n emissiveColor = sRGBTransferEOTF( emissiveColor );\n #endif\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"vec4 LinearTransferOETF( in vec4 value ) {\n return value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n #endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 reflectVec = reflect( - viewDir, normal );
1\n reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n #ifdef USE_ANISOTROPY\n vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 bentNormal = cross( bitangent, viewDir );\n bentNormal = normalize( cross( bentNormal, bitangent ) );\n bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n return getIBLRadiance( viewDir, bentNormal, roughness );\n #else\n return vec3( 0.0 );\n #endif\n }\n #endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n }
1 else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif",fog_vertex:"#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n vec2 fw = fwidth( coord ) * 0.5;\n return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n #endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n vec3 diffuseColor;\n float specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Lambert\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }
1\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.metalness = metalnessFactor;\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n material.ior = ior;\n #ifdef USE_SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;\n material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = vec3( 0.04 );\n material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;
1\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEEN_COLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );\n #ifdef USE_SHEEN_ROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n #ifdef USE_ANISOTROPYMAP\n mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n #else\n vec2 anisotropyV = anisotropyVector;\n #endif\n material.anisotropy = length( anisotropyV );\n if( material.anisotropy == 0.0 ) {\n anisotropyV = vec2( 1.0, 0.0 );\n } else {\n anisotropyV /= material.anisotropy;\n material.anisotropy = saturate( material.anisotropy );\n }\n material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"uniform sampler2D dfgLUT;\nstruct PhysicalMaterial {\n vec3 diffuseColor;\n vec3 diffuseContribution;\n vec3 specularColor;\n vec3 specularColorBlended;\n float roughness;\n float metalness;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n vec3 iridescenceFresnelDielectric;\n vec3 iridescenceFresnelMetallic;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n float gv = dotNL * length( vec3( alphaT * dotTV, alph
1aB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return v;\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColorBlended;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x >
1 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float rInv = 1.0 / ( roughness + 0.1 );\n float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;\n float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;\n float DG = exp( a * dotNV + b );\n return saturate( DG );\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\nvec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
1\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;\n vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;\n vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;\n vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;\n float Ess_V = dfgV.x + dfgV.y;\n float Ess_L = dfgL.x + dfgL.y;\n float Ems_V = 1.0 - Ess_V;\n float Ems_L = 1.0 - Ess_L;\n vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;\n vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );\n float compensationFactor = Ems_V * Ems_L;\n vec3 multiScatter = Fms * compensationFactor;\n return singleScatter + multiScatter;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n #ifdef USE_CLEARCOAT\n vec3 Ncc = geometryClearcoatNormal;\n vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );\n vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );\n vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );\n mat3 mInvClearcoat = mat3(\n vec3( t1Clearcoat.x, 0, t1Clearcoat.y ),\n vec3( 0, 1, 0 ),\n vec3( t1Clearcoat.z, 0, t1Clearcoat.w )\n );\n vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;\n clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );\n #endif\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n \n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n \n float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );\n \n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );\n \n irradiance *= sheenEnergyComp;\n \n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );\n #ifdef USE_SHEEN\n float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n diffuse *= sheenEnergyComp;\n #endif\n reflectedLight.indirectDiffuse += diffuse;\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;\n #endif\n vec3 singleScatteringDielectric = vec3( 0.0 );\n vec3 multiScatteringDielectric = vec3( 0.0 );\n vec3 singleScatteringMetallic = vec3( 0.0 );\n vec3 multiScatteringMetallic = vec3( 0.0 );
1\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n #endif\n vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );\n vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );\n vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;\n vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n vec3 indirectSpecular = radiance * singleScattering;\n indirectSpecular += multiScattering * cosineWeightedIrradiance;\n vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;\n #ifdef USE_SHEEN\n float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n indirectSpecular *= sheenEnergyComp;\n indirectDiffuse *= sheenEnergyComp;\n #endif\n reflectedLight.indirectSpecular += indirectSpecular;\n reflectedLight.indirectDiffuse += indirectDiffuse;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );\n material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }
1\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )\n #if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )\n iblIrradiance += getIBLIrradiance( geometryNormal );\n #endif\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n #ifdef USE_ANISOTROPY\n radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n #else\n radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n #endif\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n #if defined( LAMBERT ) || defined( PHONG )\n irradiance += iblIrradiance;\n #endif\n RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vMapUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n uniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n #if defined( USE_POINTS_UV )\n vec2 uv = vUv;\n #else\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n #endif\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n varying vec2 vUv;\n#else\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n #endif\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n metalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n }\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n #endif\n }\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n #ifndef USE_INSTANCING_MORPH\n uniform float morphTargetBaseInfluence;\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n #endif\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal *= faceDirection;\n #endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n #ifdef USE_TANGENT\n mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn = getTangentFrame( - vViewPosition, normal,\n #if defined( USE_NORMALMAP )\n vNormalMapUv\n #elif defined( USE_CLEARCOAT_NORMALMAP )\n vClearcoatNormalMapUv\n #else\n vUv\n #endif\n );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn[0] *= faceDirection;\n tbn[1] *= faceDirection;\n #endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n #ifdef USE_TANGENT\n mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn2[0] *= faceDirection;\n tbn2[1] *= faceDirection;\n #endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );
1\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n return mat3( T * scale, B * scale, N );\n }\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n clearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n if( v <= 0.0 )\n return vec4( 0., 0., 0., 0. );\n if( v >= 1.0 )\n return vec4( 1., 1., 1., 1. );\n float vuf;\n float af = modf( v * PackFactors.a, vuf );\n float bf = modf( vuf * ShiftRight8, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n if( v <= 0.0 )\n return vec3( 0., 0., 0. );\n if( v >= 1.0 )\n return vec3( 1., 1., 1. );\n float vuf;\n float bf = modf( v * PackFactors.b, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n if( v <= 0.0 )\n return vec2( 0., 0. );\n if( v >= 1.0 )\n return vec2( 1., 1. );\n float vuf;\n float gf = modf( v * 256., vuf );\n return vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n return dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 25
15.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n #ifdef USE_REVERSED_DEPTH_BUFFER\n \n return depth * ( far - near ) - far;\n #else\n return depth * ( near - far ) - near;\n #endif\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n \n #ifdef USE_REVERSED_DEPTH_BUFFER\n return ( near * far ) / ( ( near - far ) * depth - near );\n #else\n return ( near * far ) / ( ( far - near ) * depth - far );\n #endif\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n mvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n roughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n #else\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n #else\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n #elif defined( SHADOWMAP_TYPE_BASIC )\n uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n #if defined( SHADOWMAP_TYPE_PCF )\n float interleavedGradientNoise( vec2 position ) {\n return fract( 52.9829189 * fract( dot
1( position, vec2( 0.06711056, 0.00583715 ) ) ) );\n }\n vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {\n const float goldenAngle = 2.399963229728653;\n float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );\n float theta = float( sampleIndex ) * goldenAngle + phi;\n return vec2( cos( theta ), sin( theta ) ) * r;\n }\n #endif\n #if defined( SHADOWMAP_TYPE_PCF )\n float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float radius = shadowRadius * texelSize.x;\n float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;\n shadow = (\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )\n ) * 0.2;\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #elif defined( SHADOWMAP_TYPE_VSM )\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadowCoord.z -= shadowBias;\n #else\n shadowCoord.z += shadowBias;\n #endif\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;\n float mean = distribution.x;\n float variance = distribution.y * distribution.y;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float hard_shadow = step( mean, shadowCoord.z );\n #else\n float hard_shadow = step( shadowCoord.z, mean );\n #endif\n \n if ( hard_shadow == 1.0 ) {\n shadow = 1.0;\n } else {\n variance = max( variance, 0.0000001 );\n float d = shadowCoord.z - mean;\n float p_max = variance / ( variance + d * d );\n p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );\n shadow = max( hard_shadow, p_max );\n }\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #else\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadowCoord.z -= shadowBias;\n #else\n shadowCoord.z += shadowBias;\n #endif\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n float depth = texture2D( shadowMap, shadowCoord.xy ).r;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadow = step( depth, shadowCoord.z );\n #else\n shadow = step( shadowCoord.z, depth );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n vec3 bd3D = normalize( lightToPosition );\n vec3 absVec = abs( lightToPosition );\n float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\n if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1\n dp -= shadowBias;\n #else\n float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\n #endif\n float texelSize = shadowRadius / shadowMapSize.x;\n vec3 absDir = abs( bd3D );\n vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );\n tangent = normalize( cross( bd3D, tangent ) );\n vec3 bitangent = cross( bd3D, tangent );\n float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;\n vec2 sample0 = vogelDiskSample( 0, 5, phi );\n vec2 sample1 = vogelDiskSample( 1, 5, phi );\n vec2 sample2 = vogelDiskSample( 2, 5, phi );\n vec2 sample3 = vogelDiskSample( 3, 5, phi );\n vec2 sample4 = vogelDiskSample( 4, 5, phi );\n shadow = (\n texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )\n ) * 0.2;\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #elif defined( SHADOWMAP_TYPE_BASIC )\n float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n vec3 absVec = abs( lightToPosition );\n float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\n if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\n float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n float depth = textureCube( shadowMap, bd3D ).r;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n depth = 1.0 - depth;\n #endif\n shadow = step( dp, depth );\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #endif\n #endif\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }
1\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n mat4 getBoneMatrix( const in float i ) {\n int size = textureSize( boneTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;
1\nvec3 LinearToneMapping( vec3 color ) {\n return saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n vec3( 1.6605, - 0.1246, - 0.0182 ),\n vec3( - 0.5876, 1.1329, - 0.1006 ),\n vec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n vec3( 0.6274, 0.0691, 0.0164 ),\n vec3( 0.3293, 0.9195, 0.0880 ),\n vec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n vec3 x2 = x * x;\n vec3 x4 = x2 * x2;\n return + 15.5 * x4 * x2\n - 40.14 * x4 * x\n + 31.96 * x4\n - 6.868 * x2 * x\n + 0.4298 * x2\n + 0.1191 * x\n - 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n const mat3 AgXInsetMatrix = mat3(\n vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n );
1\n const mat3 AgXOutsetMatrix = mat3(\n vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n );\n const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;\n color *= toneMappingExposure;\n color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n color = AgXInsetMatrix * color;\n color = max( color, 1e-10 ); color = log2( color );\n color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n color = clamp( color, 0.0, 1.0 );\n color = agxDefaultContrastApprox( color );\n color = AgXOutsetMatrix * color;\n color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n color = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n color = clamp( color, 0.0, 1.0 );\n return color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n const float StartCompression = 0.8 - 0.04;\n const float Desaturation = 0.15;\n color *= toneMappingExposure;\n float x = min( color.r, min( color.g, color.b ) );\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max( color.r, max( color.g, color.b ) );\n if ( peak < StartCompression ) return color;\n float d = 1. - StartCompression;\n float newPeak = 1. - d * d / ( peak + d - StartCompression );\n color *= newPeak / peak;\n float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n return mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n material.transmission = transmission;\n material.transmissionAlpha = 1.0;\n material.thickness = thickness;\n material.attenuationDistance = attenuationDistance;\n material.attenuationColor = attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmitted = getIBLVolumeRefraction(\n n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n material.attenuationColor, material.attenuationDistance );\n material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n float w0( float a ) {\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n }\n float w1( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n }\n float w2( float a ){\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n }\n float w3( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * a );\n }\n float g0( float a ) {\n return w0( a ) + w1( a );\n }\n float g1( float a ) {\n return w2( a ) + w3( a );\n }\n float h0( float a ) {\n return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n }\n float h1( float a ) {\n return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n }\n vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n uv = uv * texelSize.zw + 0.5;\n vec2 iuv = floor( uv );\n vec2 fuv = fract( uv );\n float g0x = g0( fuv.x );\n float g1x = g1( fuv.x );\n float h0x = h0( fuv.x );\n float h1x = h1( fuv.x );\n float h0y = h0( fuv.y );\n float h1y = h1( fuv.y );\n vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n }\n vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n vec2 fLodSizeInv = 1.0 / fLodSize;\n vec2 cLodSizeInv = 1.0 / cLodSize;\n vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n return mix( fSample, cSample, fract( lod ) );\n }\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n }\n vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( isinf( attenuationDistance ) ) {\n return vec3( 1.0 );\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec4 transmittedLight;\n vec3 transmittance;\n #ifdef USE_DISPERSION\n float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n for ( int i = 0; i < 3; i ++ ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n transmittedLight[ i ] = transmissionSample[ i ];\n transmittedLight.a += transmissionSample.a;\n transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n }\n transmittedLight.a /= 3.0;\n #else\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n #endif\n vec3 attenuatedColor = transmittance * transmittedLight.rgb;\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n }\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n varying vec2 vMapUv;
1\n#endif\n#ifdef USE_ALPHAMAP\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n uniform mat3 mapTransform;\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n uniform mat3 alphaMapTransform;\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n uniform mat3 lightMapTransform;\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n uniform mat3 aoMapTransform;\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n uniform mat3 bumpMapTransform;\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n uniform mat3 normalMapTransform;\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n uniform mat3 displacementMapTransform;\n varying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n uniform mat3 emissiveMapTransform;\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n uniform mat3 metalnessMapTransform;\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n uniform mat3 roughnessMapTransform;\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n uniform mat3 anisotropyMapTransform;\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n uniform mat3 clearcoatMapTransform;\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform mat3 clearcoatNormalMapTransform;\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform mat3 clearcoatRoughnessMapTransform;\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n uniform mat3 sheenColorMapTransform;\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n uniform mat3 sheenRoughnessMapTransform;\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n uniform mat3 iridescenceMapTransform;\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform mat3 iridescenceThicknessMapTransform;\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n uniform mat3 specularMapTransform;\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n uniform mat3 specularColorMapTransform;\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n uniform mat3 specularIntensityMapTransform;\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n vUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
1\n#endif\n#ifdef USE_IRIDESCENCEMAP\n vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_BATCHING\n worldPosition = batchingMatrix * worldPosition;\n #endif\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <logdepthbuf_fragment>\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\n #else\n float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\n #endif\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #elif DEPTH_PACKING == 3202\n gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n #elif DEPTH_PACKING == 3203\n gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n #endif\n}",distance_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n vWorldPosition = worldPosition.xyz;\n}",distance_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vLineDistance = scale * lineDistance;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include <aomap_fragment>\n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_verte
1x>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n vViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n #else\n vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n vViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );\n #ifdef OPAQUE\n gl_FragColor.a = 1.0;\n #endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_phong_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n#ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n #define IOR\n #define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n uniform float ior;\n#endif\n#ifdef USE_SPECULAR\n uniform float specularIntensity;\n uniform vec3 specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n uniform sampler2D specularColorMap;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n uniform sampler2D specularIntensityMap;\n #endif\n#endif\n#ifdef USE_CLEARCOAT\n uniform float clearcoat;
1\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n uniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n uniform float iridescence;\n uniform float iridescenceIOR;\n uniform float iridescenceThicknessMinimum;\n uniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheenColor;\n uniform float sheenRoughness;\n #ifdef USE_SHEEN_COLORMAP\n uniform sampler2D sheenColorMap;\n #endif\n #ifdef USE_SHEEN_ROUGHNESSMAP\n uniform sampler2D sheenRoughnessMap;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n uniform vec2 anisotropyVector;\n #ifdef USE_ANISOTROPYMAP\n uniform sampler2D anisotropyMap;\n #endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <roughnessmap_fragment>\n #include <metalnessmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <clearcoat_normal_fragment_begin>\n #include <clearcoat_normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_physical_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include <transmission_fragment>\n vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n #ifdef USE_SHEEN\n \n outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;\n \n #endif\n #ifdef USE_CLEARCOAT\n float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
1\n #endif\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_toon_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\nvoid main() {\n #ifdef USE_POINTS_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n #endif\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_particle_fragment>\n #include <color_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n #include <logdepthbuf_fragment>\n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n vec4 mvPosition = modelViewMatrix[ 3 ];\n vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}"},nK={common:{diffuse:{value:new eU(0xffffff)},opacity:{value:1},map:{value:null},mapTransform:{value:new N}
vendor: 7,358 bytes, line 1
1,alphaMap:{value:null},alphaMapTransform:{value:new N},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new N}},envmap:{envMap:{value:null},envMapRotation:{value:new N},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new N}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new N}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new N},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new N},normalScale:{value:new C(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new N},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new N}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new N}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new N}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new eU(0xffffff)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},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 eU(0xffffff)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new N},alphaTest:{value:0},uvTransform:{value:new N}},sprite:{diffuse:{value:new eU(0xffffff)},opacity:{value:1},center:{value:new C(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new N},alphaMap:{value:null},alphaMapTransform:{value:new N},alphaTest:{value:0}}},nZ={basic:{uniforms:nu([nK.common,nK.specularmap,nK.envmap,nK.aomap,nK.lightmap,nK.fog]),vertexShader:nq.meshbasic_vert,fragmentShader:nq.meshbasic_frag},lambert:{uniforms:nu([nK.common,nK.specularmap,nK.envmap,nK.aomap,nK.lightmap,nK.emissivemap,nK.bumpmap,nK.normalmap,nK.displacementmap,nK.fog,nK.lights,{emissive:{value:new eU(0)},envMapIntensity:{value:1}}]),vertexShader:nq.meshlambert_vert,fragmentShader:nq.meshlambert_frag},phong:{uniforms:nu([nK.common,nK.specularmap,nK.envmap,nK.aomap,nK.lightmap,nK.emissivemap,nK.bumpmap,nK.normalmap,nK.displacementmap,nK.fog,nK.lights,{emissive:{value:new eU(0)},specular:{value:new eU(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:nq.meshphong_vert,fragmentShader:nq.meshphong_frag},standard:{uniforms:nu([nK.common,nK.envmap,nK.aomap,nK.lightmap,nK.emissivemap,nK.bumpmap,nK.normalmap,nK.displacementmap,nK.roughnessmap,nK.metalnessmap,nK.fog,nK.lights,{emissive:{value:new eU(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:nq.meshphysical_vert,fragmentShader:nq.meshphysical_frag},toon:{uniforms:nu([nK.common,nK.aomap,nK.lightmap,nK.emissivemap,nK.bumpmap,nK.normalmap,nK.displacementmap,nK.gradientmap,nK.fog,nK.lights,{emissive:{value:new eU(0)}}]),vertexShader:nq.meshtoon_vert,fragmentShader:nq.meshtoon_frag},matcap:{uniforms:nu([nK.common,nK.bumpmap,nK.normalmap,nK.displacementmap,nK.fog,{matcap:{value:null}}]),vertexShader:nq.meshmatcap_vert,fragmentShader:nq.meshmatcap_frag},points:{uniforms:nu([nK.points,nK.fog]),vertexShader:nq.points_vert,fragmentShader:nq.points_frag},dashed:{uniforms:nu([nK.common,nK.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:nq.linedashed_vert,fragmentShader:nq.linedashed_frag},depth:{uniforms:nu([nK.common,nK.displacementmap]),vertexShader:nq.depth_vert,fragmentShader:nq.depth_frag},normal:{uniforms:nu([nK.common,nK.bumpmap,nK.normalmap,nK.displacementmap,{opacity:{value:1}}]),vertexShader:nq.meshnormal_vert,fragmentShader:nq.meshnormal_frag},sprite:{uniforms:nu([nK.sprite,nK.fog]),vertexShader:nq.sprite_vert,fragmentShader:nq.sprite_frag},background:{uniforms:{uvTransform:{value:new N},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:nq.background_vert,fragmentShader:nq.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new N}},vertexShader:nq.backgroundCube_vert,fragmentShader:nq.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:nq.cube_vert,fragmentShader:nq.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:nq.equirect_vert,fragmentShader:nq.equirect_frag},distance:{uniforms:nu([nK.common,nK.displacementmap,{referencePosition:{value:new D},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:nq.distance_vert,fragmentShader:nq.distance_frag},shadow:{uniforms:nu([nK.lights,nK.fog,{color:{value:new eU(0)},opacity:{value:1}}]),vertexShader:nq.shadow_vert,fragmentShader:nq.shadow_frag}};nZ.physical={uniforms:nu([nZ.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new N},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new N},clearcoatNormalScale:{value:new C(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new N},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new N},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new N},sheen:{value:0},sheenColor:{value:new eU(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new N},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new N},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new N},transmissionSamplerSize:{value:new C},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new N},attenuationDistance:{value:0},attenuationColor:{value:new eU(0)},specularColor:{value:new eU(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new N},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new N},anisotropyVector:{value:new C},anisotropyMap:{value:null},anisotropyMapTransform:{value:new N}}]),vertexShader:nq.meshphysical_vert,fragmentShader:nq.meshphysical_frag};let nJ={r:0,b:0,g:0}
1,n$=new el,nQ=new $;function n0(e,t,n,i,r,a){let s,o,l=new eU(0),c=+(!0!==r),u=null,d=0,f=null;function p(e){let n=!0===e.isScene?e.background:null;if(n&&n.isTexture){let i=e.backgroundBlurriness>0;n=t.get(n,i)}return n}function m(t,i){t.getRGB(nJ,nh(e)),n.buffers.color.setClear(nJ.r,nJ.g,nJ.b,i,a)}return{getClearColor:function(){return l},setClearColor:function(e,t=1){l.set(e),m(l,c=t)},getClearAlpha:function(){return c},setClearAlpha:function(e){m(l,c=e)},render:function(t){let i=!1,r=p(t);null===r?m(l,c):r&&r.isColor&&(m(r,1),i=!0);let s=e.xr.getEnvironmentBlendMode();"additive"===s?n.buffers.color.setClear(0,0,0,1,a):"alpha-blend"===s&&n.buffers.color.setClear(0,0,0,0,a),(e.autoClear||i)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,n){let r=p(n);r&&(r.isCubeTexture||306===r.mapping)?(void 0===o&&((o=new tV(new t3(1,1,1),new nd({name:"BackgroundCubeMaterial",uniforms:nc(nZ.backgroundCube.uniforms),vertexShader:nZ.backgroundCube.vertexShader,fragmentShader:nZ.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(o)),n$.copy(n.backgroundRotation),n$.x*=-1,n$.y*=-1,n$.z*=-1,r.isCubeTexture&&!1===r.isRenderTargetTexture&&(n$.y*=-1,n$.z*=-1),o.material.uniforms.envMap.value=r,o.material.uniforms.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,o.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,o.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,o.material.uniforms.backgroundRotation.value.setFromMatrix4(nQ.makeRotationFromEuler(n$)),o.material.toneMapped=B.getTransfer(r.colorSpace)!==h,(u!==r||d!==r.version||f!==e.toneMapping)&&(o.material.needsUpdate=!0,u=r,d=r.version,f=e.toneMapping),o.layers.enableAll(),t.unshift(o,o.geometry,o.material,0,0,null)):r&&r.isTexture&&(void 0===s&&((s=new tV(new nl(2,2),new nd({name:"BackgroundMaterial",uniforms:nc(nZ.background.uniforms),vertexShader:nZ.background.vertexShader,fragmentShader:nZ.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(s.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(s)),s.material.uniforms.t2D.value=r,s.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,s.material.toneMapped=B.getTransfer(r.colorSpace)!==h,!0===r.matrixAutoUpdate&&r.updateMatrix(),s.material.uniforms.uvTransform.value.copy(r.matrix),(u!==r||d!==r.version||f!==e.toneMapping)&&(s.material.needsUpdate=!0,u=r,d=r.version,f=e.toneMapping),s.layers.enableAll(),t.unshift(s,s.geometry,s.material,0,0,null))},dispose:function(){void 0!==o&&(o.geometry.dispose(),o.material.dispose(),o=void 0),void 0!==s&&(s.geometry.dispose(),s.material.dispose(),s=void 0)}}}function n1(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),i={},r=c(null),a=r,s=!1;function o(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function c(e){let t=[],i=[],r=[];for(let e=0;e<n;e++)t[e]=0,i[e]=0,r[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:i,attributeDivisors:r,object:e,attributes:{},index:null}}function u(){let e=a.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function h(e){d(e,0)}function d(t,n){let i=a.newAttributes,r=a.enabledAttributes,s=a.attributeDivisors;i[t]=1,0===r[t]&&(e.enableVertexAttribArray(t),r[t]=1),s[t]!==n&&(e.vertexAttribDivisor(t,n),s[t]=n)}function f(){let t=a.newAttributes,n=a.enabledAttributes;for(let i=0,r=n.length;i<r;i++)n[i]!==t[i]&&(e.disableVertexAttribArray(i),n[i]=0)}function p(t,n,i,r,a,s,o){!0===o?e.vertexAttribIPointer(t,n,i,a,s):e.vertexAttribPointer(t,n,i,r,a,s)}function m(){g(),s=!0,a!==r&&o((a=r).object)}function g(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:function(n,r,l,m,g){var _,v,x;let y,M,S,T,E,b,w=!1,A=(_=n,v=m,x=l,y=!0===r.wireframe,void 0===(M=i[v.id])&&(M={},i[v.id]=M),void 0===(T=M[S=!0===_.isInstancedMesh?_.id:0])&&(T={},M[S]=T),void 0===(E=T[x.id])&&(E={},T[x.id]=E),void 0===(b=E[y])&&(b=c(e.createVertexArray()),E[y]=b),b);a!==A&&o((a=A).object),(w=function(e,t,n,i){let r=a.attributes,s=t.attributes,o=0,l=n.getAttributes();for(let t in l)if(l[t].location>=0){let n=r[t],i=s[t];if(void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor)),void 0===n||n.attribute!==i||i&&n.data!==i.data)return!0;o++}return a.attributesNum!==o||a.index!==i}(n,m,l,g))&&function(e,t,n,i){let r={},s=t.attributes,o=0,l=n.getAttributes();for(let t in l)if(l[t].location>=0){let n=s[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));let i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[t]=i,o++}a.attributes=r,a.attributesNum=o,a.index=i}(n,m,l,g),null!==g&&t.update(g,e.ELEMENT_ARRAY_BUFFER),(w||s)&&(s=!1,function(n,i,r,a){u();let s=a.attributes,o=r.getAttributes(),l=i.defaultAttributeValues;for(let i in o){let r=o[i];if(r.location>=0){let o=s[i];if(void 0===o&&("instanceMatrix"===i&&n.instanceMatrix&&(o=n.instanceMatrix),"instanceColor"===i&&n.instanceColor&&(o=n.instanceColor)),void 0!==o){let i=o.normalized,s=o.itemSize,l=t.get(o);if(void 0===l)continue;let c=l.buffer,u=l.type,f=l.bytesPerElement,m=u===e.INT||u===e.UNSIGNED_INT||1013===o.gpuType;if(o.isInterleavedBufferAttribute){let t=o.data,l=t.stride,g=o.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<r.locationSize;e++)d(r.location+e,t.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<r.locationSize;e++)h(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)p(r.location+e,s/r.locationSize,u,i,l*f,(g+s/r.locationSize*e)*f,m)}else{if(o.isInstancedBufferAttribute){for(let e=0;e<r.locationSize;e++)d(r.location+e,o.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=o.meshPerAttribute*o.count)}
vendor: 1,943 bytes, line 1
1else for(let e=0;e<r.locationSize;e++)h(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)p(r.location+e,s/r.locationSize,u,i,s*f,s/r.locationSize*e*f,m)}}else if(void 0!==l){let t=l[i];if(void 0!==t)switch(t.length){case 2:e.vertexAttrib2fv(r.location,t);break;case 3:e.vertexAttrib3fv(r.location,t);break;case 4:e.vertexAttrib4fv(r.location,t);break;default:e.vertexAttrib1fv(r.location,t)}}}}f()}(n,r,l,m),null!==g&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(g).buffer))},reset:m,resetDefaultState:g,dispose:function(){for(let e in m(),i){let t=i[e];for(let e in t){let n=t[e];for(let e in n){let t=n[e];for(let e in t)l(t[e].object),delete t[e];delete n[e]}}delete i[e]}},releaseStatesOfGeometry:function(e){if(void 0===i[e.id])return;let t=i[e.id];for(let e in t){let n=t[e];for(let e in n){let t=n[e];for(let e in t)l(t[e].object),delete t[e];delete n[e]}}delete i[e.id]},releaseStatesOfObject:function(e){for(let t in i){let n=i[t],r=!0===e.isInstancedMesh?e.id:0,a=n[r];if(void 0!==a){for(let e in a){let t=a[e];for(let e in t)l(t[e].object),delete t[e];delete a[e]}delete n[r],0===Object.keys(n).length&&delete i[t]}}},releaseStatesOfProgram:function(e){for(let t in i){let n=i[t];for(let t in n){let i=n[t];if(void 0===i[e.id])continue;let r=i[e.id];for(let e in r)l(r[e].object),delete r[e];delete i[e.id]}}},initAttributes:u,enableAttribute:h,disableUnusedAttributes:f}}function n3(e,t,n){let i;function r(t,r,a){0!==a&&(e.drawArraysInstanced(i,t,r,a),n.update(r,i,a))}this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i,1)},this.renderInstances=r,this.renderMultiDraw=function(e,r,a){if(0===a)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,e,0,r,0,a);let s=0;for(let e=0;e<a;e++)s+=r[e];n.update(s,i,1)},this.renderMultiDrawInstances=function(e,a,s,o){if(0===s)return;let l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<e.length;t++)r(e[t],a[t],o[t]);
1else{l.multiDrawArraysInstancedWEBGL(i,e,0,a,0,o,0,s);let t=0;for(let e=0;e<s;e++)t+=a[e]*o[e];n.update(t,i,1)}}}function n2(e,t,n,i){let r;function a(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let s=void 0!==n.precision?n.precision:"highp",o=a(s);return o!==s&&(_("WebGLRenderer:",s,"not supported, using",o,"instead."),s=o),{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){let n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:a,textureFormatReadable:function(t){return 1023===t||i.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){let r=1016===n&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return 1009===n||i.convert(n)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)||1015===n||!!r},precision:s,logarithmicDepthBuffer:!0===n.logarithmicDepthBuffer,reversedDepthBuffer:!0===n.reversedDepthBuffer&&t.has("EXT_clip_control"),maxTextures:e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextures:e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),maxSamples:e.getParameter(e.MAX_SAMPLES),samples:e.getParameter(e.SAMPLES)}}function n4(e){let t=this,n=null,i=0,r=!1,a=!1,s=new tY,o=new N,l={value:null,needsUpdate:!1};function c(e,n,i,r){let a=null!==e?e.length:0,c=null;if(0!==a){if(c=l.value,!0!==r||null===c){let t=i+4*a,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===c||c.length<t)&&(c=new Float32Array(t));for(let t=0,n=i;t!==a;++t,n+=4)s.copy(e[t]).applyMatrix4(r,o),s.normal.toArray(c,n),c[n+3]=s.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=0!==e.length||t||0!==i||r;return r=t,i=e.length,n},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=c(e,t,0)},this.setState=function(s,o,u){let h=s.clippingPlanes,d=s.clipIntersection,f=s.clipShadows,p=e.get(s);if(r&&null!==h&&0!==h.length&&(!a||f)){let e=a?0:i,t=4*e,r=p.clippingState||null;l.value=r,r=c(h,o,t,u);for(let e=0;e!==t;++e)r[e]=n[e];p.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}else a?c(null):(l.value!==n&&(l.value=n,l.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0)}}let n5=[.125,.215,.35,.446,.526,.582],n6=new nI,n8=new eU,n9=null,n7=0,ie=0,it=!1,ii=new D;class ir{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,i=100,r={}){let{size:a=256,position:s=ii}=r;n9=this._renderer.getRenderTarget(),n7=this._renderer.getActiveCubeFace(),ie=this._renderer.getActiveMipmapLevel(),it=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,n,i,o,s),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=il(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=io(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose(),null!==this._backgroundBox&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._ggxMaterial&&this._ggxMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(n9,n7,ie),this._renderer.xr.enabled=it,e.scissorTest=!1,is(e,0,0,e.width,e.height)}_fromTexture(e,t){301===e.mapping||302===e.mapping?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),n9=this._renderer.getRenderTarget(),n7=this._renderer.getActiveCubeFace(),ie=this._renderer.getActiveMipmapLevel(),it=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:1006,minFilter:1006,generateMipmaps:!1,type:1016,format:1023,colorSpace:c,depthBuffer:!1}
1,i=ia(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){var r,a;null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=ia(e,t,n);let{_lodMax:i}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=function(e){let t=[],n=[],i=[],r=e,a=e-4+1+n5.length;for(let s=0;s<a;s++){let a=Math.pow(2,r);t.push(a);let o=1/a;s>e-4?o=n5[s-e+4-1]:0===s&&(o=0),n.push(o);let l=1/(a-2),c=-l,u=1+l,h=[c,c,u,c,u,u,c,c,u,u,c,u],d=new Float32Array(108),f=new Float32Array(72),p=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,i=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];d.set(i,18*e),f.set(h,12*e);let r=[e,e,e,e,e,e];p.set(r,6*e)}let m=new tx;m.setAttribute("position",new tr(d,3)),m.setAttribute("uv",new tr(f,2)),m.setAttribute("faceIndex",new tr(p,1)),i.push(new tV(m,null)),r>4&&r--}return{lodMeshes:i,sizeLods:t,sigmas:n}}(i)),this._blurMaterial=(r=i,new nd({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(20)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new D(0,1,0)}},vertexShader:ic(),fragmentShader:` 2 3 precision mediump float; 4 precision mediump int; 5 6 varying vec3 vOutputDirection; 7 8 uniform sampler2D envMap; 9 uniform int samples; 10 uniform float weights[ n ]; 11 uniform bool latitudinal; 12 uniform float dTheta; 13 uniform float mipInt; 14 uniform vec3 poleAxis; 15 16 #define ENVMAP_TYPE_CUBE_UV 17 #include <cube_uv_reflection_fragment> 18 19 vec3 getSample( float theta, vec3 axis ) { 20 21 float cosTheta = cos( theta ); 22 // Rodrigues' axis-angle rotation 23 vec3 sampleDirection = vOutputDirection * cosTheta 24 + cross( axis, vOutputDirection ) * sin( theta ) 25 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 26 27 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 28 29 } 30 31 void main() { 32 33 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 34 35 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 36 37 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 38 39 } 40 41 axis = normalize( axis ); 42 43 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 44 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 45 46 for ( int i = 1; i < n; i++ ) { 47 48 if ( i >= samples ) { 49 50 break; 51 52 } 53 54 float theta = dTheta * float( i ); 55 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 56 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 57 58 } 59 60 } 61 `,blending:0,depthTest:!1,depthWrite:!1})),this._ggxMaterial=(a=i,new nd({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:256,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${a}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:ic(),fragmentShader:` 62 63 precision highp float; 64 precision highp int; 65 66 varying vec3 vOutputDirection; 67 68 uniform sampler2D envMap; 69 uniform float roughness; 70 uniform float mipInt; 71 72 #define ENVMAP_TYPE_CUBE_UV 73 #include <cube_uv_reflection_fragment> 74 75 #define PI 3.14159265359 76 77 // Van der Corput radical inverse 78 float radicalInverse_VdC(uint bits) { 79 bits = (bits << 16u) | (bits >> 16u); 80 bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); 81 bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); 82 bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); 83 bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); 84 return float(bits) * 2.3283064365386963e-10; // / 0x100000000 85 } 86 87 // Hammersley sequence 88 vec2 hammersley(uint i, uint N) { 89 return vec2(float(i) / float(N), radicalInverse_VdC(i)); 90 } 91 92 // GGX VNDF importance sampling (Eric Heitz 2018) 93 // "Sampling the GGX Distribution of Visible Normals" 94 // https://jcgt.org/published/0007/04/01/ 95 vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { 96 float alpha = roughness * roughness; 97 98 // Section 4.1: Orthonormal basis 99 vec3 T1 = vec3(1.0, 0.0, 0.0); 100 vec3 T2 = cross(V, T1); 101 102 // Section 4.2: Parameterization of projected area 103 float r = sqrt(Xi.x); 104 float phi = 2.0 * PI * Xi.y; 105 float t1 = r * cos(phi); 106 float t2 = r * sin(phi); 107 float s = 0.5 * (1.0 + V.z); 108 t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; 109 110 // Section 4.3: Reprojection onto hemisphere 111 vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V; 112 113 // Section 3.4: Transform back to ellipsoid configuration 114 return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); 115 } 116 117 void main() { 118 vec3 N = normalize(vOutputDirection); 119 vec3 V = N; // Assume view direction equals normal for pre-filtering 120 121 vec3 prefilteredColor = vec3(0.0); 122 float totalWeight = 0.0; 123 124 // For very low roughness, just sample the environment directly 125 if (roughness < 0.001) { 126 gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); 127 return; 128 } 129 130 // Tangent space basis for VNDF sampling 131 vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); 132 vec3 tangent = normalize(cross(up, N)); 133 vec3 bitangent = cross(N, tangent); 134
135 for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { 136 vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); 137 138 // For PMREM, V = N, so in tangent space V is always (0, 0, 1) 139 vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); 140 141 // Transform H back to world space 142 vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); 143 vec3 L = normalize(2.0 * dot(V, H) * H - V); 144 145 float NdotL = max(dot(N, L), 0.0); 146 147 if(NdotL > 0.0) { 148 // Sample environment at fixed mip level 149 // VNDF importance sampling handles the distribution filtering 150 vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); 151 152 // Weight by NdotL for the split-sum approximation 153 // VNDF PDF naturally accounts for the visible microfacet distribution 154 prefilteredColor += sampleColor * NdotL; 155 totalWeight += NdotL; 156 } 157 } 158 159 if (totalWeight > 0.0) { 160 prefilteredColor = prefilteredColor / totalWeight; 161 } 162 163 gl_FragColor = vec4(prefilteredColor, 1.0); 164 } 165 `,blending:0,depthTest:!1,depthWrite:!1}))}return i}_compileMaterial(e){let t=new tV(new tx,e);this._renderer.compile(t,n6)}_sceneToCubeUV(e,t,n,i,r){let a=new nN(90,1,t,n),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],l=this._renderer,c=l.autoClear,u=l.toneMapping;l.getClearColor(n8),l.toneMapping=0,l.autoClear=!1,l.state.buffers.depth.getReversed()&&(l.setRenderTarget(i),l.clearDepth(),l.setRenderTarget(null)),null===this._backgroundBox&&(this._backgroundBox=new tV(new t3,new tC({name:"PMREM.Backgroun
165d",side:1,depthWrite:!1,depthTest:!1})));let h=this._backgroundBox,d=h.material,f=!1,p=e.background;p?p.isColor&&(d.color.copy(p),e.background=null,f=!0):(d.color.copy(n8),f=!0);for(let t=0;t<6;t++){let n=t%3;0===n?(a.up.set(0,s[t],0),a.position.set(r.x,r.y,r.z),a.lookAt(r.x+o[t],r.y,r.z)):1===n?(a.up.set(0,0,s[t]),a.position.set(r.x,r.y,r.z),a.lookAt(r.x,r.y+o[t],r.z)):(a.up.set(0,s[t],0),a.position.set(r.x,r.y,r.z),a.lookAt(r.x,r.y,r.z+o[t]));let c=this._cubeSize;is(i,n*c,t>2?c:0,c,c),l.setRenderTarget(i),f&&l.render(h,a),l.render(e,a)}l.toneMapping=u,l.autoClear=c,e.background=p}_textureToCubeUV(e,t){let n=this._renderer,i=301===e.mapping||302===e.mapping;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=il()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=io());let r=i?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=r,r.uniforms.envMap.value=e;let s=this._cubeSize;is(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,n6)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let i=this._lodMeshes.length;for(let t=1;t<i;t++)this._applyGGXFilter(e,t-1,t);t.autoClear=n}_applyGGXFilter(e,t,n){let i=this._renderer,r=this._pingPongRenderTarget,a=this._ggxMaterial,s=this._lodMeshes[n];s.material=a;let o=a.uniforms,l=n/(this._lodMeshes.length-1),c=t/(this._lodMeshes.length-1),u=Math.sqrt(l*l-c*c),{_lodMax:h}=this,d=this._sizeLods[n],f=3*d*(n>h-4?n-h+4:0),p=4*(this._cubeSize-d);o.envMap.value=e.texture,o.roughness.value=u*(0+1.25*l),o.mipInt.value=h-t,is(r,f,p,3*d,2*d),i.setRenderTarget(r),i.render(s,n6),o.envMap.value=r.texture,o.roughness.value=0,o.mipInt.value=h-n,is(e,f,p,3*d,2*d),i.setRenderTarget(e),i.render(s,n6)}_blur(e,t,n,i,r){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)}_halfBlur(e,t,n,i,r,a,s){let o=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&v("blur direction must be either latitudinal or longitudinal!");let c=this._lodMeshes[i];c.material=l;let u=l.uniforms,h=this._sizeLods[n]-1,d=isFinite(r)?Math.PI/(2*h):2*Math.PI/39,f=r/d,p=isFinite(r)?1+Math.floor(3*f):20;p>20&&_(`sigmaRadians, ${r}, is too large and will clip, as it requested ${p} samples when the maximum is set to 20`);let m=[],g=0;for(let e=0;e<20;++e){let t=e/f,n=Math.exp(-t*t/2);m.push(n),0===e?g+=n:e<p&&(g+=2*n)}for(let e=0;e<m.length;e++)m[e]=m[e]/g;u.envMap.value=e.texture,u.samples.value=p,u.weights.value=m,u.latitudinal.value="latitudinal"===a,s&&(u.poleAxis.value=s);let{_lodMax:x}=this;u.dTheta.value=d,u.mipInt.value=x-n;let y=this._sizeLods[i],M=4*(this._cubeSize-y);is(t,3*y*(i>x-4?i-x+4:0),M,3*y,2*y),o.setRenderTarget(t),o.render(c,n6)}}function ia(e,t,n){let i=new Z(e,t,n);return i.texture.mapping=306,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function is(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function io(){return new nd({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ic(),fragmentShader:` 166 167 precision mediump float; 168 precision mediump int; 169 170 varying vec3 vOutputDirection; 171 172 uniform sampler2D envMap; 173 174 #include <common> 175 176 void main() { 177 178 vec3 outputDirection = normalize( vOutputDirection ); 179 vec2 uv = equirectUv( outputDirection ); 180 181 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 182 183 } 184 `,blending:0,depthTest:!1,depthWrite:!1})}function il(){return new nd({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ic(),fragmentShader:` 185 186 precision mediump float; 187 precision mediump int; 188 189 uniform float flipEnvMap; 190 191 varying vec3 vOutputDirection; 192 193 uniform samplerCube envMap; 194 195 void main() { 196 197 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 198 199 } 200 `,blending:0,depthTest:!1,depthWrite:!1})}function ic(){return` 201 202 precision mediump float; 203 precision mediump int; 204 205 attribute float faceIndex; 206 207 varying vec3 vOutputDirection; 208 209 // RH coordinate system; PMREM face-indexing convention 210 vec3 getDirection( vec2 uv, float face ) { 211 212 uv = 2.0 * uv - 1.0; 213 214 vec3 direction = vec3( uv, 1.0 ); 215 216 if ( face == 0.0 ) { 217 218 direction = direction.zyx; // ( 1, v, u ) pos x 219 220 } else if ( face == 1.0 ) { 221 222 direction = direction.xzy; 223 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 224 225 } else if ( face == 2.0 ) { 226 227 direction.x *= -1.0; // ( -u, v, 1 ) pos z 228 229 } else if ( face == 3.0 ) { 230 231 direction = direction.zyx; 232 direction.xz *= -1.0; // ( -1, v, -u ) neg x 233 234 } else if ( face == 4.0 ) { 235 236 direction = direction.xzy; 237 direction.xy *= -1.0; // ( -u, -1, v ) neg y 238 239 } else if ( face == 5.0 ) { 240 241 direction.z *= -1.0; // ( u, v, -1 ) neg z 242 243 } 244 245 return direction; 246 247 } 248 249 void main() { 250 251 vOutputDirection = getDirection( uv, faceIndex ); 252 gl_Position = vec4( position, 1.0 ); 253 254 } 255 `}class iu extends Z{constructor(e=1,t={}
255){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1};this.texture=new t$([n,n,n,n,n,n]),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` 256 257 varying vec3 vWorldDirection; 258 259 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 260 261 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 262 263 } 264 265 void main() { 266 267 vWorldDirection = transformDirection( position, modelMatrix ); 268 269 #include <begin_vertex> 270 #include <project_vertex> 271 272 } 273 `,fragmentShader:` 274 275 uniform sampler2D tEquirect; 276 277 varying vec3 vWorldDirection; 278 279 #include <common> 280 281 void main() { 282 283 vec3 direction = normalize( vWorldDirection ); 284 285 vec2 sampleUV = equirectUv( direction ); 286 287 gl_FragColor = texture2D( tEquirect, sampleUV ); 288 289 } 290 `},i=new t3(5,5,5),r=new nd({name:"CubemapFromEquirect",uniforms:nc(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=t;let a=new tV(i,r),s=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new nO(1,10,this).update(e,a),t.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){let r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,n,i);e.setRenderTarget(r)}}function ih(e){let t=new WeakMap,n=new WeakMap,i=null;function r(e,t){return 303===t?e.mapping=301:304===t&&(e.mapping=302),e}function a(e){let n=e.target;n.removeEventListener("dispose",a);let i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}function s(e){let t=e.target;t.removeEventListener("dispose",s);let i=n.get(t);void 0!==i&&(n.delete(t),i.dispose())}return{get:function(o,l=!1){return null==o?null:l?function(t){if(t&&t.isTexture){let r=t.mapping,a=303===r||304===r,o=301===r||302===r;if(a||o){let r=n.get(t),l=void 0!==r?r.texture.pmremVersion:0;if(t.isRenderTargetTexture&&t.pmremVersion!==l)return null===i&&(i=new ir(e)),(r=a?i.fromEquirectangular(t,r):i.fromCubemap(t,r)).texture.pmremVersion=t.pmremVersion,n.set(t,r),r.texture;{if(void 0!==r)return r.texture;let l=t.image;return a&&l&&l.height>0||o&&l&&function(e){let t=0;for(let n=0;n<6;n++)void 0!==e[n]&&t++;return 6===t}(l)?(null===i&&(i=new ir(e)),(r=a?i.fromEquirectangular(t):i.fromCubemap(t)).texture.pmremVersion=t.pmremVersion,n.set(t,r),t.addEventListener("dispose",s),r.texture):null}}}return t}(o):function(n){if(n&&n.isTexture){let i=n.mapping;if(303===i||304===i)if(t.has(n))return r(t.get(n).texture,n.mapping);else{let i=n.image;if(!i||!(i.height>0))return null;{let s=new iu(i.height);return s.fromEquirectangularTexture(e,n),t.set(n,s),n.addEventListener("dispose",a),r(s.texture,n.mapping)}}}return n}(o)},dispose:function(){t=new WeakMap,n=new WeakMap,null!==i&&(i.dispose(),i=null)}}}function id(e){let t={};
vendor: 5,030 bytes, line 290
290function n(n){if(void 0!==t[n])return t[n];let i=e.getExtension(n);return t[n]=i,i}return{has:function(e){return null!==n(e)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(e){let t=n(e);return null===t&&x("WebGLRenderer: "+e+" extension not supported."),t}}}function ip(e,t,n,i){let r={},a=new WeakMap;function s(e){let o=e.target;for(let e in null!==o.index&&t.remove(o.index),o.attributes)t.remove(o.attributes[e]);o.removeEventListener("dispose",s),delete r[o.id];let l=a.get(o);l&&(t.remove(l),a.delete(o)),i.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(e){let n=[],i=e.index,r=e.attributes.position,s=0;if(void 0===r)return;if(null!==i){let e=i.array;s=i.version;for(let t=0,i=e.length;t<i;t+=3){let i=e[t+0],r=e[t+1],a=e[t+2];n.push(i,r,r,a,a,i)}}else{let e=r.array;s=r.version;for(let t=0,i=e.length/3-1;t<i;t+=3){let e=t+0,i=t+1,r=t+2;n.push(e,i,i,r,r,e)}}let o=new(r.count>=65535?ts:ta)(n,1);o.version=s;let l=a.get(e);l&&t.remove(l),a.set(e,o)}return{get:function(e,t){return!0===r[t.id]||(t.addEventListener("dispose",s),r[t.id]=!0,n.memory.geometries++),t},update:function(n){let i=n.attributes;for(let n in i)t.update(i[n],e.ARRAY_BUFFER)},getWireframeAttribute:function(e){let t=a.get(e);if(t){let n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return a.get(e)}}}function im(e,t,n){let i,r,a;function s(t,s,o){0!==o&&(e.drawElementsInstanced(i,s,r,t*a,o),n.update(s,i,o))}this.setMode=function(e){i=e},this.setIndex=function(e){r=e.type,a=e.bytesPerElement},this.render=function(t,s){e.drawElements(i,s,r,t*a),n.update(s,i,1)},this.renderInstances=s,this.renderMultiDraw=function(e,a,s){if(0===s)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,a,0,r,e,0,s);let o=0;for(let e=0;e<s;e++)o+=a[e];n.update(o,i,1)},this.renderMultiDrawInstances=function(e,o,l,c){if(0===l)return;let u=t.get("WEBGL_multi_draw");if(null===u)for(let t=0;t<e.length;t++)s(e[t]/a,o[t],c[t]);else{u.multiDrawElementsInstancedWEBGL(i,o,0,r,e,0,c,0,l);let t=0;for(let e=0;e<l;e++)t+=o[e]*c[e];n.update(t,i,1)}}}function ig(e){let t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,i,r){switch(t.calls++,i){case e.TRIANGLES:t.triangles+=n/3*r;break;case e.LINES:t.lines+=n/2*r;break;case e.LINE_STRIP:t.lines+=r*(n-1);break;case e.LINE_LOOP:t.lines+=r*n;break;case e.POINTS:t.points+=r*n;break;default:v("WebGLInfo: Unknown draw mode:",i)}}}}function i_(e,t,n){let i=new WeakMap,r=new q;return{update:function(a,s,o){let l=a.morphTargetInfluences,c=s.morphAttributes.position||s.morphAttributes.normal||s.morphAttributes.color,u=void 0!==c?c.length:0,h=i.get(s);if(void 0===h||h.count!==u){void 0!==h&&h.texture.dispose();let e=void 0!==s.morphAttributes.position,n=void 0!==s.morphAttributes.normal,a=void 0!==s.morphAttributes.color,o=s.morphAttributes.position||[],l=s.morphAttributes.normal||[],c=s.morphAttributes.color||[],d=0;!0===e&&(d=1),!0===n&&(d=2),!0===a&&(d=3);let f=s.attributes.position.count*d,p=1;f>t.maxTextureSize&&(p=Math.ceil(f/t.maxTextureSize),f=t.maxTextureSize);let m=new Float32Array(f*p*4*u),g=new J(m,f,p,u);g.type=1015,g.needsUpdate=!0;let _=4*d;for(let t=0;t<u;t++){let i=o[t],s=l[t],u=c[t],h=f*p*4*t;for(let t=0;t<i.count;t++){let o=t*_;!0===e&&(r.fromBufferAttribute(i,t),m[h+o+0]=r.x,m[h+o+1]=r.y,m[h+o+2]=r.z,m[h+o+3]=0),!0===n&&(r.fromBufferAttribute(s,t),m[h+o+4]=r.x,m[h+o+5]=r.y,m[h+o+6]=r.z,m[h+o+7]=0),!0===a&&(r.fromBufferAttribute(u,t),m[h+o+8]=r.x,m[h+o+9]=r.y,m[h+o+10]=r.z,m[h+o+11]=4===u.itemSize?r.w:1)}}h={count:u,texture:g,size:new C(f,p)},i.set(s,h),s.addEventListener("dispose",function e(){g.dispose(),i.delete(s),s.removeEventListener("dispose",e)})}if(!0===a.isInstancedMesh&&null!==a.morphTexture)o.getUniforms().setValue(e,"morphTexture",a.morphTexture,n);else{let t=0;for(let e=0;e<l.length;e++)t+=l[e];let n=s.morphTargetsRelative?1:1-t;o.getUniforms().setValue(e,"morphTargetBaseInfluence",n),o.getUniforms().setValue(e,"morphTargetInfluences",l)}o.getUniforms().setValue(e,"morphTargetsTexture",h.texture,n),o.getUniforms().setValue(e,"morphTargetsTextureSize",h.size)}}}function iv(e,t,n,i,r){let a=new WeakMap;function s(e){let t=e.target;t.removeEventListener("dispose",s),i.releaseStatesOfObject(t),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(i){let o=r.render.frame,l=i.geometry,c=t.get(i,l);if(a.get(c)!==o&&(t.update(c),a.set(c,o)),i.isInstancedMesh&&(!1===i.hasEventListener("dispose",s)&&i.addEventListener("dispose",s),a.get(i)!==o&&(n.update(i.instanceMatrix,e.ARRAY_BUFFER),null!==i.instanceColor&&n.update(i.instanceColor,e.ARRAY_BUFFER),a.set(i,o))),i.isSkinnedMesh){let e=i.skeleton;
290a.get(e)!==o&&(e.update(),a.set(e,o))}return c},dispose:function(){a=new WeakMap}}}let ix={1:"LINEAR_TONE_MAPPING",2:"REINHARD_TONE_MAPPING",3:"CINEON_TONE_MAPPING",4:"ACES_FILMIC_TONE_MAPPING",6:"AGX_TONE_MAPPING",7:"NEUTRAL_TONE_MAPPING",5:"CUSTOM_TONE_MAPPING"};function iy(e,t,n,i,r){let a,s=new Z(t,n,{type:e,depthBuffer:i,stencilBuffer:r}),o=new Z(t,n,{type:1016,depthBuffer:!1,stencilBuffer:!1}),l=new tx;l.setAttribute("position",new to([-1,3,0,-1,-1,0,3,-1,0],3)),l.setAttribute("uv",new to([0,2,0,0,2,0],2));let c=new nf({uniforms:{tDiffuse:{value:null}},vertexShader:` 291 precision highp float; 292 293 uniform mat4 modelViewMatrix; 294 uniform mat4 projectionMatrix; 295 296 attribute vec3 position; 297 attribute vec2 uv; 298 299 varying vec2 vUv; 300 301 void main() { 302 vUv = uv; 303 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 304 }`,fragmentShader:` 305 precision highp float; 306 307 uniform sampler2D tDiffuse; 308 309 varying vec2 vUv; 310 311 #include <tonemapping_pars_fragment> 312 #include <colorspace_pars_fragment> 313 314 void main() { 315 gl_FragColor = texture2D( tDiffuse, vUv ); 316 317 #ifdef LINEAR_TONE_MAPPING 318 gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); 319 #elif defined( REINHARD_TONE_MAPPING ) 320 gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); 321 #elif defined( CINEON_TONE_MAPPING ) 322 gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); 323 #elif defined( ACES_FILMIC_TONE_MAPPING ) 324 gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); 325 #elif defined( AGX_TONE_MAPPING ) 326 gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); 327 #elif defined( NEUTRAL_TONE_MAPPING ) 328 gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); 329 #elif defined( CUSTOM_TONE_MAPPING ) 330 gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); 331 #endif 332 333 #ifdef SRGB_TRANSFER 334 gl_FragColor = sRGBTransferOETF( gl_FragColor ); 335 #endif 336 }`,depthTest:!1,depthWrite:!1}),u=new tV(l,c),d=new nI(-1,1,1,-1,0,1),f=null,p=null,m=!1,g=null,_=[],v=!1;this.setSize=function(e,t){s.setSize(e,t),o.setSize(e,t);for(let n=0;n<_.length;n++){let i=_[n];i.setSize&&i.setSize(e,t)}},this.setEffects=function(e){v=(_=e).length>0&&!0===_[0].isRenderPass;let t=s.width,n=s.height;for(let e=0;e<_.length;e++){let i=_[e];i.setSize&&i.setSize(t,n)}},this.begin=function(e,t){if(m||0===e.toneMapping&&0===_.length)return!1;if(g=t,null!==t){let e=t.width,n=t.height;(s.width!==e||s.height!==n)&&this.setSize(e,n)}return!1===v&&e.setRenderTarget(s),a=e.toneMapping,e.toneMapping=0,!0},this.hasRenderPass=function(){return v},this.end=function(e,t){e.toneMapping=a,m=!0;let n=s,i=o;for(let r=0;r<_.length;r++){let a=_[r];if(!1!==a.enabled&&(a.render(e,i,n,t),!1!==a.needsSwap)){let e=n;n=i,i=e}}if(f!==e.outputColorSpace||p!==e.toneMapping){f=e.outputColorSpace,p=e.toneMapping,c.defines={},B.getTransfer(f)===h&&(c.defines.SRGB_TRANSFER="");let t=ix[p];t&&(c.defines[t]=""),c.needsUpdate=!0}c.uniforms.tDiffuse.value=n.texture,e.setRenderTarget(g),e.render(u,d),g=null,m=!1},this.isCompositing=function(){return m},this.dispose=function(){s.dispose(),o.dispose(),l.dispose(),c.dispose()}}let iM=new Y,iS=new tQ(1,1),iT=new J,iE=new class extends Y{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},ib=new t$,iw=[],iA=[],iR=new Float32Array(16),iC=new Float32Array(9),iP=new Float32Array(4);function iD(e,t,n){let i=e[0];if(i<=0||i>0)return e;let r=t*n,a=iw[r];if(void 0===a&&(a=new Float32Array(r),iw[r]=a),0!==t){i.toArray(a,0);for(let i=1,r=0;i!==t;++i)r+=n,e[i].toArray(a,r)}return a}function iL(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function iU(e,t){for(let n=0,i=t.length;n<i;n++)e[n]=t[n]}function iN(e,t){let n=iA[t];void 0===n&&(n=new Int32Array(t),iA[t]=n);for(let i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function iI(e,t){let n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function iO(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(iL(n,t))return;e.uniform2fv(this.addr,t),iU(n,t)}}function iF(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)(n[0]!==t.r||n[1]!==t.g||n[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(iL(n,t))return;e.uniform3fv(this.addr,t),iU(n,t)}}function iB(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(iL(n,t))return;e.uniform4fv(this.addr,t),iU(n,t)}}function iz(e,t){let n=this.cache,i=t.elements;if(void 0===i){if(iL(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),iU(n,t)}else{if(iL(n,i))return;iP.set(i),e.uniformMatrix2fv(this.addr,!1,iP),iU(n,i)}}function ik(e,t){let n=this.cache,i=t.elements;if(void 0===i){if(iL(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),iU(n,t)}else{if(iL(n,i))return;iC.set(i),e.uniformMatrix3fv(this.addr,!1,iC),iU(n,i)}}function iV(e,t){let n=this.cache,i=t.elements;if(void 0===i){if(iL(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),iU(n,t)}else{if(iL(n,i))return;iR.set(i),e.uniformMatrix4fv(this.addr,!1,iR),iU(n,i)}}function iH(e,t){let n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function iG(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(iL(n,t))return;e.uniform2iv(this.addr,t),iU(n,t)}}function iW(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(iL(n,t))return;e.uniform3iv(this.addr,t),iU(n,t)}}function iX(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(iL(n,t))return;e.uniform4iv(this.addr,t),iU(n,t)}}function ij(e,t){let n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function iY(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(iL(n,t))return;e.uniform2uiv(this.addr,t),iU(n,t)}}function iq(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(iL(n,t))return;e.uniform3uiv(this.addr,t),iU(n,t)}}function iK(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(iL(n,t))return;e.uniform4uiv(this.addr,t),iU(n,t)}}
336function iZ(e,t,n){let i,r=this.cache,a=n.allocateTextureUnit();r[0]!==a&&(e.uniform1i(this.addr,a),r[0]=a),this.type===e.SAMPLER_2D_SHADOW?(iS.compareFunction=n.isReversedDepthBuffer()?518:515,i=iS):i=iM,n.setTexture2D(t||i,a)}function iJ(e,t,n){let i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(t||iE,r)}function i$(e,t,n){let i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(t||ib,r)}function iQ(e,t,n){let i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(t||iT,r)}function i0(e,t){e.uniform1fv(this.addr,t)}function i1(e,t){let n=iD(t,this.size,2);e.uniform2fv(this.addr,n)}function i3(e,t){let n=iD(t,this.size,3);e.uniform3fv(this.addr,n)}function i2(e,t){let n=iD(t,this.size,4);e.uniform4fv(this.addr,n)}function i4(e,t){let n=iD(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function i5(e,t){let n=iD(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function i6(e,t){let n=iD(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function i8(e,t){e.uniform1iv(this.addr,t)}function i9(e,t){e.uniform2iv(this.addr,t)}function i7(e,t){e.uniform3iv(this.addr,t)}function re(e,t){e.uniform4iv(this.addr,t)}function rt(e,t){e.uniform1uiv(this.addr,t)}function rn(e,t){e.uniform2uiv(this.addr,t)}function ri(e,t){e.uniform3uiv(this.addr,t)}function rr(e,t){e.uniform4uiv(this.addr,t)}function ra(e,t,n){let i,r=this.cache,a=t.length,s=iN(n,a);iL(r,s)||(e.uniform1iv(this.addr,s),iU(r,s)),i=this.type===e.SAMPLER_2D_SHADOW?iS:iM;for(let e=0;e!==a;++e)n.setTexture2D(t[e]||i,s[e])}function rs(e,t,n){let i=this.cache,r=t.length,a=iN(n,r);iL(i,a)||(e.uniform1iv(this.addr,a),iU(i,a));for(let e=0;e!==r;++e)n.setTexture3D(t[e]||iE,a[e])}function ro(e,t,n){let i=this.cache,r=t.length,a=iN(n,r);iL(i,a)||(e.uniform1iv(this.addr,a),iU(i,a));for(let e=0;e!==r;++e)n.setTextureCube(t[e]||ib,a[e])}function rl(e,t,n){let i=this.cache,r=t.length,a=iN(n,r);iL(i,a)||(e.uniform1iv(this.addr,a),iU(i,a));for(let e=0;e!==r;++e)n.setTexture2DArray(t[e]||iT,a[e])}class rc{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=function(e){switch(e){case 5126:return iI;case 35664:return iO;case 35665:return iF;case 35666:return iB;case 35674:return iz;case 35675:return ik;case 35676:return iV;case 5124:case 35670:return iH;case 35667:case 35671:return iG;case 35668:case 35672:return iW;case 35669:case 35673:return iX;case 5125:return ij;case 36294:return iY;case 36295:return iq;case 36296:return iK;case 35678:case 36198:case 36298:case 36306:case 35682:return iZ;case 35679:case 36299:case 36307:return iJ;case 35680:case 36300:case 36308:case 36293:return i$;case 36289:case 36303:case 36311:case 36292:return iQ}}(t.type)}}class ru{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return i0;case 35664:return i1;case 35665:return i3;case 35666:return i2;case 35674:return i4;case 35675:return i5;case 35676:return i6;case 5124:case 35670:return i8;case 35667:case 35671:return i9;case 35668:case 35672:return i7;case 35669:case 35673:return re;case 5125:return rt;case 36294:return rn;case 36295:return ri;case 36296:return rr;case 35678:case 36198:case 36298:case 36306:case 35682:return ra;case 35679:case 36299:case 36307:return rs;case 35680:case 36300:case 36308:case 36293:return ro;case 36289:case 36303:case 36311:case 36292:return rl}}(t.type)}}class rh{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){let i=this.seq;for(let r=0,a=i.length;r!==a;++r){let a=i[r];a.setValue(e,t[a.id],n)}}}let rd=/(\w+)(\])?(\[|\.)?/g;function rf(e,t){e.seq.push(t),e.map[t.id]=t}class rp{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const n=e.getActiveUniform(t,i),r=e.getUniformLocation(t,n.name);!function(e,t,n){let i=e.name,r=i.length;for(rd.lastIndex=0;;){let a=rd.exec(i),s=rd.lastIndex,o=a[1],l="]"===a[2],c=a[3];if(l&&(o|=0),void 0===c||"["===c&&s+2===r){rf(n,void 0===c?new rc(o,e,t):new ru(o,e,t));break}{let e=n.map[o];void 0===e&&rf(n,e=new rh(o)),n=e}}}(n,r,this)}const i=[],r=[];for(const t of this.seq)t.type===e.SAMPLER_2D_SHADOW||t.type===e.SAMPLER_CUBE_SHADOW||t.type===e.SAMPLER_2D_ARRAY_SHADOW?i.push(t):r.push(t);i.length>0&&(this.seq=i.concat(r))}setValue(e,t,n,i){let r=this.map[t];void 0!==r&&r.setValue(e,n,i)}setOptional(e,t,n){let i=t[n];void 0!==i&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let r=0,a=t.length;r!==a;++r){let a=t[r],s=n[a.id];!1!==s.needsUpdate&&a.setValue(e,s.value,i)}}static seqWithValue(e,t){let n=[];for(let i=0,r=e.length;i!==r;++i){let r=e[i];r.id in t&&n.push(r)}return n}}function rm(e,t,n){let i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}
336let rg=0,r_=new N;function rv(e,t,n){let i=e.getShaderParameter(t,e.COMPILE_STATUS),r=(e.getShaderInfoLog(t)||"").trim();if(i&&""===r)return"";let a=/ERROR: 0:(\d+)/.exec(r);if(!a)return r;{let i=parseInt(a[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+function(e,t){let n=e.split("\n"),i=[],r=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=r;e<a;e++){let r=e+1;i.push(`${r===t?">":" "} ${r}: ${n[e]}`)}return i.join("\n")}(e.getShaderSource(t),i)}}let rx={1:"Linear",2:"Reinhard",3:"Cineon",4:"ACESFilmic",6:"AgX",7:"Neutral",5:"Custom"},ry=new D;function rM(e){return""!==e}function rS(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function rT(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}let rE=/^[ \t]*#include +<([\w\d./]+)>/gm;function rb(e){return e.replace(rE,rA)}let rw=new Map;function rA(e,t){let n=nq[t];if(void 0===n){let e=rw.get(t);if(void 0!==e)n=nq[e],_('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e);else throw Error("Can not resolve #include <"+t+">")}return rb(n)}let rR=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function rC(e){return e.replace(rR,rP)}function rP(e,t,n,i){let r="";for(let e=parseInt(t);e<parseInt(n);e++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return r}function rD(e){let t=`precision ${e.precision} float; 337 precision ${e.precision} int; 338 precision ${e.precision} sampler2D; 339 precision ${e.precision} samplerCube; 340 precision ${e.precision} sampler3D; 341 precision ${e.precision} sampler2DArray; 342 precision ${e.precision} sampler2DShadow; 343 precision ${e.precision} samplerCubeShadow; 344 precision ${e.precision} sampler2DArrayShadow; 345 precision ${e.precision} isampler2D; 346 precision ${e.precision} isampler3D; 347 precision ${e.precision} isamplerCube; 348 precision ${e.precision} isampler2DArray; 349 precision ${e.precision} usampler2D; 350 precision ${e.precision} usampler3D; 351 precision ${e.precision} usamplerCube; 352 precision ${e.precision} usampler2DArray; 353 `;return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}let rL={1:"SHADOWMAP_TYPE_PCF",3:"SHADOWMAP_TYPE_VSM"},rU={301:"ENVMAP_TYPE_CUBE",302:"ENVMAP_TYPE_CUBE",306:"ENVMAP_TYPE_CUBE_UV"},rN={302:"ENVMAP_MODE_REFRACTION"},rI={0:"ENVMAP_BLENDING_MULTIPLY",1:"ENVMAP_BLENDING_MIX",2:"ENVMAP_BLENDING_ADD"};function rO(e,t,n,i){var r,a;let s,o,l,c,f=e.getContext(),p=n.defines,m=n.vertexShader,g=n.fragmentShader,x=rL[n.shadowMapType]||"SHADOWMAP_TYPE_BASIC",y=!1===n.envMap?"ENVMAP_TYPE_CUBE":rU[n.envMapMode]||"ENVMAP_TYPE_CUBE",M=!1===n.envMap?"ENVMAP_MODE_REFLECTION":rN[n.envMapMode]||"ENVMAP_MODE_REFLECTION",S=!1===n.envMap?"ENVMAP_BLENDING_NONE":rI[n.combine]||"ENVMAP_BLENDING_NONE",T=function(e){let t=e.envMapCubeUVHeight;if(null===t)return null;let n=Math.log2(t)-2;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:1/t,maxMip:n}}(n),E=[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(rM).join("\n"),b=function(e){let t=[];for(let n in e){let i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(p),w=f.createProgram(),A=n.glslVersion?"#version "+n.glslVersion+"\n":"";if(n.isRawShaderMaterial)(s=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b].filter(rM).join("\n")).length>0&&(s+="\n"),(o=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b].filter(rM).join("\n")).length>0&&(o+="\n");else{let e,t,i,l,c;s=[rD(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b,n.extensionCl
vendor: 5,447 bytes, line 353
353ipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+M:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+x:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","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","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif","\n"].filter(rM).join("\n"),o=[rD(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alph
353aToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+y:"",n.envMap?"#define "+M:"",n.envMap?"#define "+S:"",T?"#define CUBEUV_TEXEL_WIDTH "+T.texelWidth:"",T?"#define CUBEUV_TEXEL_HEIGHT "+T.texelHeight:"",T?"#define CUBEUV_MAX_MIP "+T.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas||n.batchingColor?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+x:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?nq.tonemapping_pars_fragment:"",0!==n.toneMapping?(r="toneMapping",void 0===(e=rx[a=n.toneMapping])?(_("WebGLProgram: Unsupported toneMapping:",a),"vec3 "+r+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+r+"( vec3 color ) { return "+e+"ToneMapping( color ); }"):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",nq.colorspace_pars_fragment,(t=function(e){B._getMatrix(r_,B.workingColorSpace,e);let t=`mat3( ${r_.elements.map(e=>e.toFixed(4))} )`;switch(B.getTransfer(e)){case u:return[t,"LinearTransferOETF"];case h:return[t,"sRGBTransferOETF"];default:return _("WebGLProgram: Unsupported color space: ",e),[t,"LinearTransferOETF"]}}(n.outputColorSpace),`vec4 linearToOutputTexel( vec4 value ) { 354 return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) ); 355}`),(B.getLuminanceCoefficients(ry),i=ry.x.toFixed(4),l=ry.y.toFixed(4),c=ry.z.toFixed(4),`float luminance( const in vec3 rgb ) { 356 const vec3 weights = vec3( ${i}, ${l}, ${c} ); 357 return dot( weights, rgb ); 358}`),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(rM).join("\n")}m=rT(m=rS(m=rb(m),n),n),g=rT(g=rS(g=rb(g),n),n),m=rC(m),g=rC(g),!0!==n.isRawShaderMaterial&&(A="#version 300 es\n",s=[E,"#define attribute in\n#define varying out\n#define texture2D texture"].join("\n")+"\n"+s,o=["#define varying in",
358n.glslVersion===d?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===d?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+o);let R=A+s+m,C=A+o+g,P=rm(f,f.VERTEX_SHADER,R),D=rm(f,f.FRAGMENT_SHADER,C);function L(t){if(e.debug.checkShaderErrors){let n=f.getProgramInfoLog(w)||"",i=f.getShaderInfoLog(P)||"",r=f.getShaderInfoLog(D)||"",a=n.trim(),l=i.trim(),c=r.trim(),u=!0,h=!0;if(!1===f.getProgramParameter(w,f.LINK_STATUS))if(u=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(f,w,P,D);else{let e=rv(f,P,"vertex"),n=rv(f,D,"fragment");v("THREE.WebGLProgram: Shader Error "+f.getError()+" - VALIDATE_STATUS "+f.getProgramParameter(w,f.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+a+"\n"+e+"\n"+n)}else""!==a?_("WebGLProgram: Program Info Log:",a):(""===l||""===c)&&(h=!1);h&&(t.diagnostics={runnable:u,programLog:a,vertexShader:{log:l,prefix:s},fragmentShader:{log:c,prefix:o}})}f.deleteShader(P),f.deleteShader(D),l=new rp(f,w),c=function(e,t){let n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){let i=e.getActiveAttrib(t,r),a=i.name,s=1;i.type===e.FLOAT_MAT2&&(s=2),i.type===e.FLOAT_MAT3&&(s=3),i.type===e.FLOAT_MAT4&&(s=4),n[a]={type:i.type,location:e.getAttribLocation(t,a),locationSize:s}}return n}(f,w)}f.attachShader(w,P),f.attachShader(w,D),void 0!==n.index0AttributeName?f.bindAttribLocation(w,0,n.index0AttributeName):!0===n.morphTargets&&f.bindAttribLocation(w,0,"position"),f.linkProgram(w),this.getUniforms=function(){return void 0===l&&L(this),l},this.getAttributes=function(){return void 0===c&&L(this),c};let U=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===U&&(U=f.getProgramParameter(w,37297)),U},this.destroy=function(){i.releaseStatesOfProgram(this),f.deleteProgram(w),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=rg++,this.cacheKey=t,this.usedTimes=1,this.program=w,this.vertexShader=P,this.fragmentShader=D,this}let rF=0;class rB{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return!1===a.has(i)&&(a.add(i),i.usedTimes++),!1===a.has(r)&&(a.add(r),r.usedTimes++),this}remove(e){for(let t of this.materialCache.get(e))t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return void 0===n&&(n=new rz(e),t.set(e,n)),n}}class rz{constructor(e){this.id=rF++,this.code=e,this.usedTimes=0}}function rk(e,t,n,i,r,a){let s=new ec,o=new rB,l=new Set,u=[],d=new Map,f=i.logarithmicDepthBuffer,p=i.precision,m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",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(e){return(l.add(e),0===e)?"uv":`uv${e}`}return{getParameters:function(r,s,u,d,v){let x,y,M,S,T=d.fog,E=v.geometry,b=r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial?d.environment:null,w=r.isMeshStandardMaterial||r.isMeshLambertMaterial&&!r.envMap||r.isMeshPhongMaterial&&!r.envMap,A=t.get(r.envMap||b,w),R=A&&306===A.mapping?A.image.height:null,C=m[r.type];null!==r.precision&&(p=i.getMaxPrecision(r.precision))!==r.precision&&_("WebGLProgram.getParameters:",r.precision,"not supported, using",p,"instead.");let P=E.morphAttributes.position||E.morphAttributes.normal||E.morphAttributes.color,D=void 0!==P?P.length:0,L=0;if(void 0!==E.morphAttributes.position&&(L=1),void 0!==E.morphAttributes.normal&&(L=2),void 0!==E.morphAttributes.color&&(L=3),C){let e=nZ[C];x=e.vertexShader,y=e.fragmentShader}else x=r.vertexShader,y=r.fragmentShader,o.update(r),M=o.getVertexShaderID(r),S=o.getFragmentShaderID(r);let U=e.getRenderTarget(),N=e.state.buffers.depth.getReversed(),I=!0===v.isInstancedMesh,O=!0===v.isBatchedMesh,F=!!r.map,z=!!r.matcap,k=!!A,V=!!r.aoMap,H=!!r.lightMap,G=!!r.bumpMap,W=!!r.normalMap,X=!!r.displacementMap,j=!!r.emissiveMap,Y=!!r.metalnessMap,q=!!r.roughnessMap,K=r.anisotropy>0,Z=r.clearcoat>0,J=r.dispersion>0,$=r.iridescence>0,Q=r.sheen>0,ee=r.transmission>0,et=K&&!!r.anisotropyMap,en=Z&&!!r.clearcoatMap,ei=Z&&!!r.clearcoatNormalMap,er=Z&&!!r.clearcoatRoughnessMap,ea=$&&!!r.iridescenceMap,es=$&&!!r.iridescenceThicknessMap,eo=Q&&!!r.sheenColorMap,el=Q&&!!r.sheenRoughnessMap,ec=!!r.specularMap,eu=!!r.specularColorMap,eh=!!r.specularIntensityMap,ed=ee&&!!r.transmissionMap,ef=ee&&!!r.thicknessMap,ep=!!r.gradientMap,em=!!r.alphaMap,eg=r.alphaTest>0,e_=!!r.alphaHash,ev=!!r.extensions,ex=0;r.toneMapped&&(null===U||!0===U.isXRRenderTarget)&&(ex=e.toneMapping);let ey={shaderID:C,shaderType:r.type,shaderName:r.name,vertexShader:x,fragmentShader:y,defines:r.defines,customVertexShaderID:M,customFragmentShaderID:S,isRawShaderMaterial:!0===r.isRawShaderMaterial,glslVersion:r.glslVersion,precision:p,batching:O,batchingColor:O&&null!==v._colorsTexture,instancing:I,instancingColor:I&&null!==v.instanceColor,
358instancingMorph:I&&null!==v.morphTexture,outputColorSpace:null===U?e.outputColorSpace:!0===U.isXRRenderTarget?U.texture.colorSpace:c,alphaToCoverage:!!r.alphaToCoverage,map:F,matcap:z,envMap:k,envMapMode:k&&A.mapping,envMapCubeUVHeight:R,aoMap:V,lightMap:H,bumpMap:G,normalMap:W,displacementMap:X,emissiveMap:j,normalMapObjectSpace:W&&1===r.normalMapType,normalMapTangentSpace:W&&0===r.normalMapType,metalnessMap:Y,roughnessMap:q,anisotropy:K,anisotropyMap:et,clearcoat:Z,clearcoatMap:en,clearcoatNormalMap:ei,clearcoatRoughnessMap:er,dispersion:J,iridescence:$,iridescenceMap:ea,iridescenceThicknessMap:es,sheen:Q,sheenColorMap:eo,sheenRoughnessMap:el,specularMap:ec,specularColorMap:eu,specularIntensityMap:eh,transmission:ee,transmissionMap:ed,thicknessMap:ef,gradientMap:ep,opaque:!1===r.transparent&&1===r.blending&&!1===r.alphaToCoverage,alphaMap:em,alphaTest:eg,alphaHash:e_,combine:r.combine,mapUv:F&&g(r.map.channel),aoMapUv:V&&g(r.aoMap.channel),lightMapUv:H&&g(r.lightMap.channel),bumpMapUv:G&&g(r.bumpMap.channel),normalMapUv:W&&g(r.normalMap.channel),displacementMapUv:X&&g(r.displacementMap.channel),emissiveMapUv:j&&g(r.emissiveMap.channel),metalnessMapUv:Y&&g(r.metalnessMap.channel),roughnessMapUv:q&&g(r.roughnessMap.channel),anisotropyMapUv:et&&g(r.anisotropyMap.channel),clearcoatMapUv:en&&g(r.clearcoatMap.channel),clearcoatNormalMapUv:ei&&g(r.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:er&&g(r.clearcoatRoughnessMap.channel),iridescenceMapUv:ea&&g(r.iridescenceMap.channel),iridescenceThicknessMapUv:es&&g(r.iridescenceThicknessMap.channel),sheenColorMapUv:eo&&g(r.sheenColorMap.channel),sheenRoughnessMapUv:el&&g(r.sheenRoughnessMap.channel),specularMapUv:ec&&g(r.specularMap.channel),specularColorMapUv:eu&&g(r.specularColorMap.channel),specularIntensityMapUv:eh&&g(r.specularIntensityMap.channel),transmissionMapUv:ed&&g(r.transmissionMap.channel),thicknessMapUv:ef&&g(r.thicknessMap.channel),alphaMapUv:em&&g(r.alphaMap.channel),vertexTangents:!!E.attributes.tangent&&(W||K),vertexColors:r.vertexColors,vertexAlphas:!0===r.vertexColors&&!!E.attributes.color&&4===E.attributes.color.itemSize,pointsUvs:!0===v.isPoints&&!!E.attributes.uv&&(F||em),fog:!!T,useFog:!0===r.fog,fogExp2:!!T&&T.isFogExp2,flatShading:!1===r.wireframe&&(!0===r.flatShading||void 0===E.attributes.normal&&!1===W&&(r.isMeshLambertMaterial||r.isMeshPhongMaterial||r.isMeshStandardMaterial||r.isMeshPhysicalMaterial)),sizeAttenuation:!0===r.sizeAttenuation,logarithmicDepthBuffer:f,reversedDepthBuffer:N,skinning:!0===v.isSkinnedMesh,morphTargets:void 0!==E.morphAttributes.position,morphNormals:void 0!==E.morphAttributes.normal,morphColors:void 0!==E.morphAttributes.color,morphTargetsCount:D,morphTextureStride:L,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:r.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:ex,decodeVideoTexture:F&&!0===r.map.isVideoTexture&&B.getTransfer(r.map.colorSpace)===h,decodeVideoTextureEmissive:j&&!0===r.emissiveMap.isVideoTexture&&B.getTransfer(r.emissiveMap.colorSpace)===h,premultipliedAlpha:r.premultipliedAlpha,doubleSided:2===r.side,flipSided:1===r.side,useDepthPacking:r.depthPacking>=0,depthPacking:r.depthPacking||0,index0AttributeName:r.index0AttributeName,extensionClipCullDistance:ev&&!0===r.extensions.clipCullDistance&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ev&&!0===r.extensions.multiDraw||O)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:r.customProgramCacheKey()};return ey.vertexUv1s=l.has(1),ey.vertexUv2s=l.has(2),ey.vertexUv3s=l.has(3),l.clear(),ey},getProgramCacheKey:function(t){var n,i,r,a;let o=[];if(t.shaderID?o.push(t.shaderID):(o.push(t.customVertexShaderID),o.push(t.customFragmentShaderID)),void 0!==t.defines)for(let e in t.defines)o.push(e),o.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(n=o,i=t,n.push(i.precision),n.push(i.outputColorSpace),n.push(i.envMapMode),n.push(i.envMapCubeUVHeight),n.push(i.mapUv),n.push(i.alphaMapUv),n.push(i.lightMapUv),n.push(i.aoMapUv),n.push(i.bumpMapUv),n.push(i.normalMapUv),n.push(i.displacementMapUv),n.push(i.emissiveMapUv),n.push(i.metalnessMapUv),n.push(i.roughnessMapUv),n.push(i.anisotropyMapUv),n.push(i.clearcoatMapUv),n.push(i.clearcoatNormalMapUv),n.push(i.clearcoatRoughnessMapUv),n.push(i.iridescenceMapUv),n.push(i.iridescenceThicknessMapUv),n.push(i.sheenColorMapUv),n.push(i.sheenRoughnessMapUv),n.push(i.specularMapUv),n.push(i.specularColorMapUv),n.push(i.specularIntensityMapUv),n.push(i.transmissionMapUv),n.push(i.thicknessMapUv),n.push(i.combine),n.push(i.fogExp2),n.push(i.sizeAttenuation),n.push(i.morphTargetsCount),n.push(i.morphAttributeCount),n.push(i.numDirLights),n.push(i.numPointLights),n.push(i.numSpotLights),n.push(i.numSpotLightMaps),n.push(i.numHemiLights),n.push(i.numRectAreaLights),n.push(i.numDirLightShadows),n.push(i.numPointLightShadows),n.push(i.numSpotLightShadows),n.push(i.numSpotLightShadowsWithMaps),n.push(i.numLightProbes),n.push(i.shadowMapType),n.push(i.toneMapping),n.push(i.numClippingPlanes),n.push(i.numClipIntersection),n.push(i.depthPacking),r=o,a=t,s.disableAll(),a.instancing&&s.enable(0),a.instancingColor&&s.enable(1),a.instancingMorph&&s.enable(2),a.matcap&&s.enable(3),a.envMap&&s.enable(4),a.normalMapObjectSpace&&s.enable(5),a.normalMapTangentSpace&&s.enable(6),a.clearcoat&&s.enable(7),a.iridescence&&s.enable(8),a.alphaTest&&s.enable(9),a.vertexColors&&s.enable(10),a.vertexAlphas&&s.enable(11),a.vertexUv1s&&s.enable(12),a.vertexUv2s&&s.enable(13),a.vertexUv3s&&s.enable(14),a.vertexTangents&&s.enable(15),a.anisotropy&&s.enable(16),a.alphaHash&&s.enable(17),a.batching&&s.enable(18),a.dispersion&&s.enable(19),a.batchingColor&&s.enable(20),a.gradientMap&&s.enable(21),r.push(s.mask),s.disableAll(),a.fog&&s.enable(0),a.useFog&&s.enable(1),a.flatShading&&s.enable(2),a.logarithmicDepthBuffer&&s.enable(3),a.reversedDepthBuffer&&s.enable(4),a.skinning&&s.enable(5),a.morphTargets&&s.enable(6),a.morphNormals&&s.enable(7),a.morphColors&&s.enable(8),a.premultipliedAlpha&&s.enable(9),a.shadowMapEnabled&&s.enable(10),a.doubleSided&&s.enable(11),a.flipSided&&s.enable(12),a.useDepthPacking&&s.enable(13),a.dithering&&s.enable(14),a.transmission&&s.enable(15),a.sheen&&s.enable(16),a.opaque&&s.enable(17),a.pointsUvs&&s.enable(18),a.decodeVideoTexture&&s.enable(19),a.decodeVideoTextureEmissive&&s.enable(20),a.alphaToCoverage&&s.enable(21),r.push(s.mask),o.push(e.outputColorSpace)),o.push(t.customProgramCacheKey),o.join()},getUniforms:function(e){let t,n=m[e.type];return t=n?nc(nZ[n].uniforms):e.uniforms},acquireProgram:function(t,n){let i=d.get(n);return void 0!==i?++i.usedTimes:(i=new rO(e,n,t,r),u.push(i),d.set(n,i)),i},releaseProgram:function(e){if(0==--e.usedTimes){let t=u.indexOf(e);
358u[t]=u[u.length-1],u.pop(),d.delete(e.cacheKey),e.destroy()}},releaseShaderCache:function(e){o.remove(e)},programs:u,dispose:function(){o.dispose()}}}function rV(){let e=new WeakMap;return{has:function(t){return e.has(t)},get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}function rH(e,t){if(e.groupOrder!==t.groupOrder)return e.groupOrder-t.groupOrder;if(e.renderOrder!==t.renderOrder)return e.renderOrder-t.renderOrder;if(e.material.id!==t.material.id)return e.material.id-t.material.id;if(e.materialVariant!==t.materialVariant)return e.materialVariant-t.materialVariant;if(e.z!==t.z)return e.z-t.z;else return e.id-t.id}function rG(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function rW(){let e=[],t=0,n=[],i=[],r=[];function a(e){let t=0;return e.isInstancedMesh&&(t+=2),e.isSkinnedMesh&&(t+=1),t}function s(n,i,r,s,o,l){let c=e[t];return void 0===c?(c={id:n.id,object:n,geometry:i,material:r,materialVariant:a(n),groupOrder:s,renderOrder:n.renderOrder,z:o,group:l},e[t]=c):(c.id=n.id,c.object=n,c.geometry=i,c.material=r,c.materialVariant=a(n),c.groupOrder=s,c.renderOrder=n.renderOrder,c.z=o,c.group=l),t++,c}return{opaque:n,transmissive:i,transparent:r,init:function(){t=0,n.length=0,i.length=0,r.length=0},push:function(e,t,a,o,l,c){let u=s(e,t,a,o,l,c);a.transmission>0?i.push(u):!0===a.transparent?r.push(u):n.push(u)},unshift:function(e,t,a,o,l,c){let u=s(e,t,a,o,l,c);a.transmission>0?i.unshift(u):!0===a.transparent?r.unshift(u):n.unshift(u)},finish:function(){for(let n=t,i=e.length;n<i;n++){let t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){n.length>1&&n.sort(e||rH),i.length>1&&i.sort(t||rG),r.length>1&&r.sort(t||rG)}}}function rX(){let e=new WeakMap;return{get:function(t,n){let i,r=e.get(t);return void 0===r?(i=new rW,e.set(t,[i])):n>=r.length?(i=new rW,r.push(i)):i=r[n],i},dispose:function(){e=new WeakMap}}}function rj(){let e={};return{get:function(t){let n;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":n={direction:new D,color:new eU};break;case"SpotLight":n={position:new D,direction:new D,color:new eU,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new D,color:new eU,distance:0,decay:0};break;case"HemisphereLight":n={direction:new D,skyColor:new eU,groundColor:new eU};break;case"RectAreaLight":n={color:new eU,position:new D,halfWidth:new D,halfHeight:new D}}return e[t.id]=n,n}}}let rY=0;function rq(e,t){return 2*!!t.castShadow-2*!!e.castShadow+ +!!t.map-!!e.map}function rK(e){let t,n=new rj,i=(t={},{get:function(e){let n;if(void 0!==t[e.id])return t[e.id];switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new C};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new C,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}),r={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 e=0;e<9;e++)r.probe.push(new D);let a=new D,s=new $,o=new $;return{setup:function(t){let a=0,s=0,o=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,_=0,v=0;t.sort(rq);for(let e=0,x=t.length;e<x;e++){let x=t[e],y=x.color,M=x.intensity,S=x.distance,T=null;if(x.shadow&&x.shadow.map&&(T=1030===x.shadow.map.texture.format?x.shadow.map.texture:x.shadow.map.depthTexture||x.shadow.map.texture),x.isAmbientLight)a+=y.r*M,s+=y.g*M,o+=y.b*M;else if(x.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(x.sh.coefficients[e],M);v++}else if(x.isDirectionalLight){let e=n.get(x);if(e.color.copy(x.color).multiplyScalar(x.intensity),x.castShadow){let e=x.shadow,t=i.get(x);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.n
vendor: 4,514 bytes, line 358
358ormalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[l]=t,r.directionalShadowMap[l]=T,r.directionalShadowMatrix[l]=x.shadow.matrix,f++}r.directional[l]=e,l++}else if(x.isSpotLight){let e=n.get(x);e.position.setFromMatrixPosition(x.matrixWorld),e.color.copy(y).multiplyScalar(M),e.distance=S,e.coneCos=Math.cos(x.angle),e.penumbraCos=Math.cos(x.angle*(1-x.penumbra)),e.decay=x.decay,r.spot[u]=e;let t=x.shadow;if(x.map&&(r.spotLightMap[g]=x.map,g++,t.updateMatrices(x),x.castShadow&&_++),r.spotLightMatrix[u]=t.matrix,x.castShadow){let e=i.get(x);e.shadowIntensity=t.intensity,e.shadowBias=t.bias,e.shadowNormalBias=t.normalBias,e.shadowRadius=t.radius,e.shadowMapSize=t.mapSize,r.spotShadow[u]=e,r.spotShadowMap[u]=T,m++}u++}else if(x.isRectAreaLight){let e=n.get(x);e.color.copy(y).multiplyScalar(M),e.halfWidth.set(.5*x.width,0,0),e.halfHeight.set(0,.5*x.height,0),r.rectArea[h]=e,h++}else if(x.isPointLight){let e=n.get(x);if(e.color.copy(x.color).multiplyScalar(x.intensity),e.distance=x.distance,e.decay=x.decay,x.castShadow){let e=x.shadow,t=i.get(x);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[c]=t,r.pointShadowMap[c]=T,r.pointShadowMatrix[c]=x.shadow.matrix,p++}r.point[c]=e,c++}else if(x.isHemisphereLight){let e=n.get(x);e.skyColor.copy(x.color).multiplyScalar(M),e.groundColor.copy(x.groundColor).multiplyScalar(M),r.hemi[d]=e,d++}}h>0&&(!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=nK.LTC_FLOAT_1,r.rectAreaLTC2=nK.LTC_FLOAT_2):(r.rectAreaLTC1=nK.LTC_HALF_1,r.rectAreaLTC2=nK.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=s,r.ambient[2]=o;let x=r.hash;(x.directionalLength!==l||x.pointLength!==c||x.spotLength!==u||x.rectAreaLength!==h||x.hemiLength!==d||x.numDirectionalShadows!==f||x.numPointShadows!==p||x.numSpotShadows!==m||x.numSpotMaps!==g||x.numLightProbes!==v)&&(r.directional.length=l,r.spot.length=u,r.rectArea.length=h,r.point.length=c,r.hemi.length=d,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=p,r.pointShadowMap.length=p,r.spotShadow.length=m,r.spotShadowMap.length=m,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=p,r.spotLightMatrix.length=m+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,x.directionalLength=l,x.pointLength=c,x.spotLength=u,x.rectAreaLength=h,x.hemiLength=d,x.numDirectionalShadows=f,x.numPointShadows=p,x.numSpotShadows=m,x.numSpotMaps=g,x.numLightProbes=v,r.version=rY++)},setupView:function(e,t){let n=0,i=0,l=0,c=0,u=0,h=t.matrixWorldInverse;for(let t=0,d=e.length;t<d;t++){let d=e[t];if(d.isDirectionalLight){let e=r.directional[n];e.direction.setFromMatrixPosition(d.matrixWorld),a.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(a),e.direction.transformDirection(h),n++}else if(d.isSpotLight){let e=r.spot[l];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),e.direction.setFromMatrixPosition(d.matrixWorld),a.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(a),e.direction.transformDirection(h),l++}else if(d.isRectAreaLight){let e=r.rectArea[c];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),o.identity(),s.copy(d.matrixWorld),s.premultiply(h),o.extractRotation(s),e.halfWidth.set(.5*d.width,0,0),e.halfHeight.set(0,.5*d.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),c++}else if(d.isPointLight){let e=r.point[i];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),i++}else if(d.isHemisphereLight){let e=r.hemi[u];e.direction.setFromMatrixPosition(d.matrixWorld),e.direction.transformDirection(h),u++}}},state:r}}function rZ(e){let t=new rK(e),n=[],i=[],r={lightsArray:n,shadowsArray:i,camera:null,lights:t,transmissionRenderTarget:{}};return{init:function(e){r.camera=e,n.length=0,i.length=0},state:r,setupLights:function(){t.setup(n)},setupLightsView:function(e){t.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){i.push(e)}}}function rJ(e){let t=new WeakMap;return{get:function(n,i=0){let r,a=t.get(n);return void 0===a?(r=new rZ(e),t.set(n,[r])):i>=a.length?(r=new rZ(e),a.push(r)):r=a[i],r},dispose:function(){t=new WeakMap}}}let r$=[new D(1,0,0),new D(-1,0,0),new D(0,1,0),new D(0,-1,0),new D(0,0,1),new D(0,0,-1)],rQ=[new D(0,-1,0),new D(0,-1,0),new D(0,0,1),new D(0,0,-1),new D(0,-1,0),new D(0,-1,0)],r0=new $,r1=new D,r3=ne
358w D;function r2(e,t,n){let i=new tJ,r=new C,a=new C,s=new q,o=new np,l=new nm,c={},u=n.maxTextureSize,h={0:1,1:0,2:2},d=new nd({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new C},radius:{value:4}},vertexShader:"void main() {\n gl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );\n gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );\n}"}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new tx;p.setAttribute("position",new tr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new tV(p,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let v=this.type;function x(t,n,i,r){let a=null,s=!0===i.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==s)a=s;else if(a=!0===i.isPointLight?l:o,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||!0===n.alphaToCoverage){let e=a.uuid,t=n.uuid,i=c[e];void 0===i&&(i={},c[e]=i);let r=i[t];void 0===r&&(r=a.clone(),i[t]=r,n.addEventListener("dispose",y)),a=r}return a.visible=n.visible,a.wireframe=n.wireframe,3===r?a.side=null!==n.shadowSide?n.shadowSide:n.side:a.side=null!==n.shadowSide?n.shadowSide:h[n.side],a.alphaMap=n.alphaMap,a.alphaTest=!0===n.alphaToCoverage?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===i.isPointLight&&!0===a.isMeshDistanceMaterial&&(e.properties.get(a).light=i),a}function y(e){for(let t in e.target.removeEventListener("dispose",y),c){let n=c[t],i=e.target.uuid;i in n&&(n[i].dispose(),delete n[i])}}this.render=function(n,o,l){if(!1===g.enabled||!1===g.autoUpdate&&!1===g.needsUpdate||0===n.length)return;2===this.type&&(_("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=1);let c=e.getRenderTarget(),h=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),y=e.state;y.setBlending(0),!0===y.buffers.depth.getReversed()?y.buffers.color.setClear(0,0,0,0):y.buffers.color.setClear(1,1,1,1),y.buffers.depth.setTest(!0),y.setScissorTest(!1);let M=v!==this.type;M&&o.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let c=0,h=n.length;c<h;c++){let h=n[c],p=h.shadow;if(void 0===p){_("WebGLShadowMap:",h,"has no shadow.");continue}if(!1===p.autoUpdate&&!1===p.needsUpdate)continue;r.copy(p.mapSize);let g=p.getFrameExtents();r.multiply(g),a.copy(p.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(a.x=Math.floor(u/g.x),r.x=a.x*g.x,p.mapSize.x=a.x),r.y>u&&(a.y=Math.floor(u/g.y),r.y=a.y*g.y,p.mapSize.y=a.y));let v=e.state.buffers.depth.getReversed();if(p.camera._reversedDepth=v,null===p.map||!0===M){if(null!==p.map&&(null!==p.map.depthTexture&&(p.map.depthTexture.dispose(),p.map.depthTexture=null),p.map.dispose()),3===this.type){if(h.isPointLight){_("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}p.map=new Z(r.x,r.y,{format:1030,type:1016,minFilter:1006,magFilter:1006,generateMipmaps:!1}),p.map.texture.name=h.name+".shadowMap",p.map.depthTexture=new tQ(r.x,r.y,1015),p.map.depthTexture.name=h.name+".shadowMapDepth",p.map.depthTexture.format=1026,p.map.depthTexture.compareFunction=null,p.map.depthTexture.minFilter=1003,p.map.depthTexture.magFilter=1003}else h.isPointLight?(p.map=new iu(r.x),p.map.depthTexture=new t0(r.x,1014)):(p.map=new Z(r.x,r.y),p.map.depthTexture=new tQ(r.x,r.y,1014)),p.map.depthTexture.name=h.name+".shadowMap",p.map.depthTexture.format=1026,1===this.type?(p.map.depthTexture.compareFunction=v?518:515,p.map.depthTexture.minFilter=1006,p.map.depthTexture.magFilter=1006):(p.map.depthTexture.compareFunction=null,p.map.depthTexture.minFilter=1003,p.map.depthTexture.magFilter=1003);p.camera.updateProjectionMatrix()}
358let S=p.map.isWebGLCubeRenderTarget?6:1;for(let n=0;n<S;n++){if(p.map.isWebGLCubeRenderTarget)e.setRenderTarget(p.map,n),e.clear();else{0===n&&(e.setRenderTarget(p.map),e.clear());let t=p.getViewport(n);s.set(a.x*t.x,a.y*t.y,a.x*t.z,a.y*t.w),y.viewport(s)}if(h.isPointLight){let e=p.camera,t=p.matrix,i=h.distance||e.far;i!==e.far&&(e.far=i,e.updateProjectionMatrix()),r1.setFromMatrixPosition(h.matrixWorld),e.position.copy(r1),r3.copy(e.position),r3.add(r$[n]),e.up.copy(rQ[n]),e.lookAt(r3),e.updateMatrixWorld(),t.makeTranslation(-r1.x,-r1.y,-r1.z),r0.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),p._frustum.setFromProjectionMatrix(r0,e.coordinateSystem,e.reversedDepth)}else p.updateMatrices(h);i=p.getFrustum(),function n(r,a,s,o,l){if(!1===r.visible)return;if(r.layers.test(a.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&3===l)&&(!r.frustumCulled||i.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,r.matrixWorld);let n=t.update(r),i=r.material;if(Array.isArray(i)){let t=n.groups;for(let c=0,u=t.length;c<u;c++){let u=t[c],h=i[u.materialIndex];if(h&&h.visible){let t=x(r,h,o,l);r.onBeforeShadow(e,r,a,s,n,t,u),e.renderBufferDirect(s,null,n,t,r,u),r.onAfterShadow(e,r,a,s,n,t,u)}}}else if(i.visible){let t=x(r,i,o,l);r.onBeforeShadow(e,r,a,s,n,t,null),e.renderBufferDirect(s,null,n,t,r,null),r.onAfterShadow(e,r,a,s,n,t,null)}}let c=r.children;for(let e=0,t=c.length;e<t;e++)n(c[e],a,s,o,l)}(o,l,p.camera,h,this.type)}!0!==p.isPointLightShadow&&3===this.type&&function(n,i){let a=t.update(m);d.defines.VSM_SAMPLES!==n.blurSamples&&(d.defines.VSM_SAMPLES=n.blurSamples,f.defines.VSM_SAMPLES=n.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new Z(r.x,r.y,{format:1030,type:1016})),d.uniforms.shadow_pass.value=n.map.depthTexture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,a,d,m,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,a,f,m,null)}(p,l),p.needsUpdate=!1}v=this.type,g.needsUpdate=!1,e.setRenderTarget(c,h,p)}}function r4(e,t){let n=new function(){let t=!1,n=new q,i=null,r=new q(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,a,s,o){!0===o&&(t*=s,i*=s,a*=s),n.set(t,i,a,s),!1===r.equals(n)&&(e.clearColor(t,i,a,s),r.copy(n))},reset:function(){t=!1,i=null,r.set(-1,0,0,0)}}},i=new function(){let n=!1,i=!1,r=null,a=null,s=null;return{setReversed:function(e){if(i!==e){let n=t.get("EXT_clip_control");e?n.clipControlEXT(n.LOWER_LEFT_EXT,n.ZERO_TO_ONE_EXT):n.clipControlEXT(n.LOWER_LEFT_EXT,n.NEGATIVE_ONE_TO_ONE_EXT),i=e;let r=s;s=null,this.setClear(r)}},getReversed:function(){return i},setTest:function(t){t?V(e.DEPTH_TEST):H(e.DEPTH_TEST)},setMask:function(t){r===t||n||(e.depthMask(t),r=t)},setFunc:function(t){if(i&&(t=y[t]),a!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:default:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL)}a=t}},setLocked:function(e){n=e},setClear:function(t){s!==t&&(s=t,i&&(t=1-t),e.clearDepth(t))},reset:function(){n=!1,r=null,a=null,s=null,i=!1}}},r=new function(){let t=!1,n=null,i=null,r=null,a=null,s=null,o=null,l=null,c=null;return{setTest:function(n){t||(n?V(e.STENCIL_TEST):H(e.STENCIL_TEST))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,s){(i!==t||r!==n||a!==s)&&(e.stencilFunc(t,n,s),i=t,r=n,a=s)},setOp:function(t,n,i){(s!==t||o!==n||l!==i)&&(e.stencilOp(t,n,i),s=t,o=n,l=i)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,i=null,r=null,a=null,s=null,o=null,l=null,c=null}}},a=new WeakMap,s=new WeakMap,o={},l={},c=new WeakMap,u=[],h=null,d=!1,f=null,p=null,m=null,g=null,_=null,x=null,M=null,S=new eU(0,0,0),T=0,E=!1,b=null,w=null,A=null,R=null,C=null,P=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),D=!1,L=e.getParameter(e.VERSION);-1!==L.indexOf("WebGL")?D=parseFloat(/^WebGL (\d)/.exec(L)[1])>=1:-1!==L.indexOf("OpenGL ES")&&(D=parseFloat(/^OpenGL ES (\d)/.exec(L)[1])>=2);let U=null,N={},I=e.getParameter(e.SCISSOR_BOX),O=e.getParameter(e.VIEWPORT),F=new q().fromArray(I),B=new q().fromArray(O);function z(t,n,i,r){let a=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let s=0;s<i;s++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,r,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+s,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return s}let k={};function V(t){!0!==o[t]&&(e.enable(t),o[t]=!0)}function H(t){!1!==o[t]&&(e.disable(t),o[t]=!1)}k[e.TEXTURE_2D]=z(e.TEXTURE_2D,e.TEXTURE_2D,1),k[e.TEXTURE_CUBE_MAP]=z(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),k[e.TEXTURE_2D_ARRAY]=z(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),k[e.TEXTURE_3D]=z(e.TEXTURE_3D,e.TEXTURE_3D,1,1),n.setClear(0,0,0,1),i.setClear(1),r.setClear(0),V(e.DEPTH_TEST),i.setFunc(3),j(!1),Y(1),V(e.CULL_FACE),X(0);let G={100:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT};G[103]=e.MIN,G[104]=e.MAX;let W={200:e.ZERO,201:e.ONE,202:e.SRC_COLOR,204:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,205:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA,211:e.CONSTANT_COLOR,212:e.ONE_MINUS_CONSTANT_COLOR,213:e.CONSTANT_ALPHA,214:e.ONE_MINUS_CONSTANT_ALPHA};function X(t,n,i,r,a,s,o,l,c,u){if(0===t){!0===d&&(H(e.BLEND),d=!1);return}if(!1===d&&(V(e.BLEND),d=!0),5!==t){if(t!==f||u!==E){if((100!==p||100!==_)&&(e.blendEquation(e.FUNC_ADD),p=100,_=100),u)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ZERO,e.ONE);break;default:v("WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE,e.ONE,e.ONE);break;case 3:v("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case 4:v("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:v("WebGLState: Invalid blending: ",t)}m=null,g=null,x=null,M=null,S.set(0,0,0),T=0,f=t,E=u}return}a=a||n,s=s||i,o=o||r,(n!==p||a!==_)&&(e.blendEquationSeparate(G[n],G[a]),p=n,_=a),(i!==m||r!==g||s!==x||o!==M)&&(e.blendFuncSeparate(W[i],W[r],W[s],W[o]),m=i,g=r,x=s,M=o),(!1===l.equals(S)||c!==T)&&(e.blendColor
358(l.r,l.g,l.b,c),S.copy(l),T=c),f=t,E=!1}function j(t){b!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),b=t)}function Y(t){0!==t?(V(e.CULL_FACE),t!==w&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):H(e.CULL_FACE),w=t}function K(t,n,r){t?(V(e.POLYGON_OFFSET_FILL),(R!==n||C!==r)&&(R=n,C=r,i.getReversed()&&(n=-n),e.polygonOffset(n,r))):H(e.POLYGON_OFFSET_FILL)}return{buffers:{color:n,depth:i,stencil:r},enable:V,disable:H,bindFramebuffer:function(t,n){return l[t]!==n&&(e.bindFramebuffer(t,n),l[t]=n,t===e.DRAW_FRAMEBUFFER&&(l[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(l[e.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function(t,n){let i=u,r=!1;if(t){void 0===(i=c.get(n))&&(i=[],c.set(n,i));let a=t.textures;if(i.length!==a.length||i[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=a.length;t<n;t++)i[t]=e.COLOR_ATTACHMENT0+t;i.length=a.length,r=!0}}else i[0]!==e.BACK&&(i[0]=e.BACK,r=!0);r&&e.drawBuffers(i)},useProgram:function(t){return h!==t&&(e.useProgram(t),h=t,!0)},setBlending:X,setMaterial:function(t,a){2===t.side?H(e.CULL_FACE):V(e.CULL_FACE);let s=1===t.side;a&&(s=!s),j(s),1===t.blending&&!1===t.transparent?X(0):X(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),i.setFunc(t.depthFunc),i.setTest(t.depthTest),i.setMask(t.depthWrite),n.setMask(t.colorWrite);let o=t.stencilWrite;r.setTest(o),o&&(r.setMask(t.stencilWriteMask),r.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),r.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),K(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?V(e.SAMPLE_ALPHA_TO_COVERAGE):H(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:j,setCullFace:Y,setLineWidth:function(t){t!==A&&(D&&e.lineWidth(t),A=t)},setPolygonOffset:K,setScissorTest:function(t){t?V(e.SCISSOR_TEST):H(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+P-1),U!==t&&(e.activeTexture(t),U=t)},bindTexture:function(t,n,i){void 0===i&&(i=null===U?e.TEXTURE0+P-1:U);let r=N[i];void 0===r&&(r={type:void 0,texture:void 0},N[i]=r),(r.type!==t||r.texture!==n)&&(U!==i&&(e.activeTexture(i),U=i),e.bindTexture(t,n||k[t]),r.type=t,r.texture=n)},unbindTexture:function(){let t=N[U];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D(...arguments)}catch(e){v("WebGLState:",e)}},compressedTexImage3D:function(){try{e.compressedTexImage3D(...arguments)}catch(e){v("WebGLState:",e)}},texImage2D:function(){try{e.texImage2D(...arguments)}catch(e){v("WebGLState:",e)}},texImage3D:function(){try{e.texImage3D(...arguments)}catch(e){v("WebGLState:",e)}},updateUBOMapping:function(t,n){let i=s.get(n);void 0===i&&(i=new WeakMap,s.set(n,i));let r=i.get(t);void 0===r&&(r=e.getUniformBlockIndex(n,t.name),i.set(t,r))},uniformBlockBinding:function(t,n){let i=s.get(n).get(t);a.get(n)!==i&&(e.uniformBlockBinding(n,i,t.__bindingPointIndex),a.set(n,i))},texStorage2D:function(){try{e.texStorage2D(...arguments)}catch(e){v("WebGLState:",e)}},texStorage3D:function(){try{e.texStorage3D(...arguments)}catch(e){v("WebGLState:",e)}},texSubImage2D:function(){try{e.texSubImage2D(...arguments)}catch(e){v("WebGLState:",e)}},texSubImage3D:function(){try{e.texSubImage3D(...arguments)}catch(e){v("WebGLState:",e)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D(...arguments)}catch(e){v("WebGLState:",e)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D(...arguments)}catch(e){v("WebGLState:",e)}},scissor:function(t){!1===F.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),F.copy(t))},viewport:function(t){!1===B.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),B.copy(t))},reset:function(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),i.setReversed(!1),e.clearDepth(1),e.stencilMask(0xffffffff),e.stencilFunc(e.ALWAYS,0,0xffffffff),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),o={},U=null,N={},l={},c=new WeakMap,u=[],h=null,d=!1,f=null,p=null,m=null,g=null,_=null,x=null,M=null,S=new eU(0,0,0),T=0,E=!1,b=null,w=null,A=null,R=null,C=null,F.set(0,0,e.canvas.width,e.canvas.height),B.set(0,0,e.canvas.width,e.canvas.height),n.reset(),i.reset(),r.reset()}}}function r5(e,t,n,i,r,a,s){let o,l=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,d="u">typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),p=new C,m=new WeakMap,g=new WeakMap,x=!1;try{x="u">typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function y(e,t){return x?new OffscreenCanvas(e,t):f("canvas")}function M(e,t,n){let i=1,r=Z(e);if((r.width>n||r.height>n)&&(i=n/Math.max(r.width,r.height)),i<1)if("u">typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap||"u">typeof VideoFrame&&e instanceof VideoFrame){let n=Math.floor(i*r.width),a=Math.floor(i*r.height);void 0===o&&(o=y(n,a));let s=t?y(n,a):o;return s.width=n,s.height=a,s.getContext("2d").drawImage(e,0,0,n,a),_("WebGLRenderer: Texture has been resized from ("+r.width+"x"+r.height+") to ("+n+"x"+a+")."),s}else"data"in e&&_("WebGLRenderer: Image in DataTexture is too big ("+r.width+"x"+r.height+").");return e}function S(e){return e.generateMipmaps}function T(t){e.generateMipmap(t)}function E(n,i,r,a,s=!1){if(null!==n){if(void 0!==e[n])return e[n];_("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let o=i;if(i===e.RED&&(r===e.FLOAT&&(o=e.R32F),r===e.HALF_FLOAT&&(o=e.R16F),r===e.UNSIGNED_BYTE&&(o=e.R8)),i===e.RED_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.R8UI),r===e.UNSIGNED_SHORT&&(o=e.R16UI),r===e.UNSIGNED_INT&&(
358o=e.R32UI),r===e.BYTE&&(o=e.R8I),r===e.SHORT&&(o=e.R16I),r===e.INT&&(o=e.R32I)),i===e.RG&&(r===e.FLOAT&&(o=e.RG32F),r===e.HALF_FLOAT&&(o=e.RG16F),r===e.UNSIGNED_BYTE&&(o=e.RG8)),i===e.RG_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.RG8UI),r===e.UNSIGNED_SHORT&&(o=e.RG16UI),r===e.UNSIGNED_INT&&(o=e.RG32UI),r===e.BYTE&&(o=e.RG8I),r===e.SHORT&&(o=e.RG16I),r===e.INT&&(o=e.RG32I)),i===e.RGB_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.RGB8UI),r===e.UNSIGNED_SHORT&&(o=e.RGB16UI),r===e.UNSIGNED_INT&&(o=e.RGB32UI),r===e.BYTE&&(o=e.RGB8I),r===e.SHORT&&(o=e.RGB16I),r===e.INT&&(o=e.RGB32I)),i===e.RGBA_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.RGBA8UI),r===e.UNSIGNED_SHORT&&(o=e.RGBA16UI),r===e.UNSIGNED_INT&&(o=e.RGBA32UI),r===e.BYTE&&(o=e.RGBA8I),r===e.SHORT&&(o=e.RGBA16I),r===e.INT&&(o=e.RGBA32I)),i===e.RGB&&(r===e.UNSIGNED_INT_5_9_9_9_REV&&(o=e.RGB9_E5),r===e.UNSIGNED_INT_10F_11F_11F_REV&&(o=e.R11F_G11F_B10F)),i===e.RGBA){let t=s?u:B.getTransfer(a);r===e.FLOAT&&(o=e.RGBA32F),r===e.HALF_FLOAT&&(o=e.RGBA16F),r===e.UNSIGNED_BYTE&&(o=t===h?e.SRGB8_ALPHA8:e.RGBA8),r===e.UNSIGNED_SHORT_4_4_4_4&&(o=e.RGBA4),r===e.UNSIGNED_SHORT_5_5_5_1&&(o=e.RGB5_A1)}return(o===e.R16F||o===e.R32F||o===e.RG16F||o===e.RG32F||o===e.RGBA16F||o===e.RGBA32F)&&t.get("EXT_color_buffer_float"),o}function b(t,n){let i;return t?null===n||1014===n||1020===n?i=e.DEPTH24_STENCIL8:1015===n?i=e.DEPTH32F_STENCIL8:1012===n&&(i=e.DEPTH24_STENCIL8,_("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||1014===n||1020===n?i=e.DEPTH_COMPONENT24:1015===n?i=e.DEPTH_COMPONENT32F:1012===n&&(i=e.DEPTH_COMPONENT16),i}function w(e,t){return!0===S(e)||e.isFramebufferTexture&&1003!==e.minFilter&&1006!==e.minFilter?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function A(e){let t=e.target;t.removeEventListener("dispose",A),function(e){let t=i.get(e);if(void 0===t.__webglInit)return;let n=e.source,r=g.get(n);if(r){let i=r[t.__cacheKey];i.usedTimes--,0===i.usedTimes&&P(e),0===Object.keys(r).length&&g.delete(n)}i.remove(e)}(t),t.isVideoTexture&&m.delete(t)}function R(t){let n=t.target;n.removeEventListener("dispose",R),function(t){let n=i.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),i.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let i=0;i<n.__webglFramebuffer[t].length;i++)e.deleteFramebuffer(n.__webglFramebuffer[t][i]);else e.deleteFramebuffer(n.__webglFramebuffer[t]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}let r=t.textures;for(let t=0,n=r.length;t<n;t++){let n=i.get(r[t]);n.__webglTexture&&(e.deleteTexture(n.__webglTexture),s.memory.textures--),i.remove(r[t])}i.remove(t)}(n)}function P(t){let n=i.get(t);e.deleteTexture(n.__webglTexture);let r=t.source,a=g.get(r);delete a[n.__cacheKey],s.memory.textures--}let D=0;function L(t,r){var a;let o,l=i.get(t);if(t.isVideoTexture&&(a=t,o=s.render.frame,m.get(a)!==o&&(m.set(a,o),a.update())),!1===t.isRenderTargetTexture&&!0!==t.isExternalTexture&&t.version>0&&l.__version!==t.version){let e=t.image;if(null===e)_("WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void k(l,t,r);_("WebGLRenderer: Texture marked for update but image is incomplete")}}else t.isExternalTexture&&(l.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,l.__webglTexture,e.TEXTURE0+r)}let U={1e3:e.REPEAT,1001:e.CLAMP_TO_EDGE,1002:e.MIRRORED_REPEAT},N={1003:e.NEAREST,1004:e.NEAREST_MIPMAP_NEAREST,1005:e.NEAREST_MIPMAP_LINEAR,1006:e.LINEAR,1007:e.LINEAR_MIPMAP_NEAREST,1008:e.LINEAR_MIPMAP_LINEAR},I={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function O(n,a){if((1015===a.type&&!1===t.has("OES_texture_float_linear")&&(1006===a.magFilter||1007===a.magFilter||1005===a.magFilter||1008===a.magFilter||1006===a.minFilter||1007===a.minFilter||1005===a.minFilter||1008===a.minFilter)&&_("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(n,e.TEXTURE_WRAP_S,U[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,U[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,U[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,N[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,N[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,I[a.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic"))&&1003!==a.magFilter&&(1005===a.minFilter||1008===a.minFilter)&&(1015!==a.type||!1!==t.has("OES_texture_float_linear"))&&(a.anisotropy>1||i.get(a).__currentAnisotropy)){let s=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy}}function F(t,n){let i,r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",A));let a=n.source,o=g.get(a);void 0===o&&(o={},g.set(a,o));let l=((i=[]).push(n.wrapS),i.push(n.wrapT),i.push(n.wrapR||0),i.push(n.magFilter),i.push(n.minFilter),i.push(n.anisotropy),i.push(n.internalFormat),i.push(n.format),i.push(n.type),i.push(n.generateMipmaps),i.push(n.premultiplyAlpha),i.push(n.flipY),i.push(n.unpackAlignment),i.push(n.colorSpace),i.join());if(l!==t.__cacheKey){void 0===o[l]&&(o[l]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,r=!0),o[l].usedTimes++;let i=o[t.__cacheKey];void 0!==i&&(o[t.__cacheKey].usedTimes--,0===i.usedTimes&&P(n)),t.__cacheKey=l,t.__webglTexture=o[l].texture}return r}function z(e,t,n){return Math.floor(Math.floor(e/n)/t)}
358function k(t,s,o){let l=e.TEXTURE_2D;(s.isDataArrayTexture||s.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),s.isData3DTexture&&(l=e.TEXTURE_3D);let c=F(t,s),u=s.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+o);let h=i.get(u);if(u.version!==h.__version||!0===c){let t;n.activeTexture(e.TEXTURE0+o);let i=B.getPrimaries(B.workingColorSpace),d=""===s.colorSpace?null:B.getPrimaries(s.colorSpace),f=""===s.colorSpace||i===d?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,f);let p=M(s.image,!1,r.maxTextureSize);p=K(s,p);let m=a.convert(s.format,s.colorSpace),g=a.convert(s.type),v=E(s.internalFormat,m,g,s.colorSpace,s.isVideoTexture);O(l,s);let x=s.mipmaps,y=!0!==s.isVideoTexture,A=void 0===h.__version||!0===c,R=u.dataReady,C=w(s,p);if(s.isDepthTexture)v=b(1027===s.format,s.type),A&&(y?n.texStorage2D(e.TEXTURE_2D,1,v,p.width,p.height):n.texImage2D(e.TEXTURE_2D,0,v,p.width,p.height,0,m,g,null));else if(s.isDataTexture)if(x.length>0){y&&A&&n.texStorage2D(e.TEXTURE_2D,C,v,x[0].width,x[0].height);for(let i=0,r=x.length;i<r;i++)t=x[i],y?R&&n.texSubImage2D(e.TEXTURE_2D,i,0,0,t.width,t.height,m,g,t.data):n.texImage2D(e.TEXTURE_2D,i,v,t.width,t.height,0,m,g,t.data);s.generateMipmaps=!1}else y?(A&&n.texStorage2D(e.TEXTURE_2D,C,v,p.width,p.height),R&&function(t,i,r,a){let s=t.updateRanges;if(0===s.length)n.texSubImage2D(e.TEXTURE_2D,0,0,0,i.width,i.height,r,a,i.data);else{s.sort((e,t)=>e.start-t.start);let o=0;for(let e=1;e<s.length;e++){let t=s[o],n=s[e],r=t.start+t.count,a=z(n.start,i.width,4),l=z(t.start,i.width,4);n.start<=r+1&&a===l&&z(n.start+n.count-1,i.width,4)===a?t.count=Math.max(t.count,n.start+n.count-t.start):s[++o]=n}s.length=o+1;let l=e.getParameter(e.UNPACK_ROW_LENGTH),c=e.getParameter(e.UNPACK_SKIP_PIXELS),u=e.getParameter(e.UNPACK_SKIP_ROWS);e.pixelStorei(e.UNPACK_ROW_LENGTH,i.width);for(let t=0,o=s.length;t<o;t++){let o=s[t],l=Math.floor(o.start/4),c=Math.ceil(o.count/4),u=l%i.width,h=Math.floor(l/i.width);e.pixelStorei(e.UNPACK_SKIP_PIXELS,u),e.pixelStorei(e.UNPACK_SKIP_ROWS,h),n.texSubImage2D(e.TEXTURE_2D,0,u,h,c,1,r,a,i.data)}t.clearUpdateRanges(),e.pixelStorei(e.UNPACK_ROW_LENGTH,l),e.pixelStorei(e.UNPACK_SKIP_PIXELS,c),e.pixelStorei(e.UNPACK_SKIP_ROWS,u)}}(s,p,m,g)):n.texImage2D(e.TEXTURE_2D,0,v,p.width,p.height,0,m,g,p.data);else if(s.isCompressedTexture)if(s.isCompressedArrayTexture){y&&A&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,v,x[0].width,x[0].height,p.depth);for(let i=0,r=x.length;i<r;i++)if(t=x[i],1023!==s.format)if(null!==m)if(y){if(R)if(s.layerUpdates.size>0){let r=nX(t.width,t.height,s.format,s.type);for(let a of s.layerUpdates){let s=t.data.subarray(a*r/t.data.BYTES_PER_ELEMENT,(a+1)*r/t.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,a,t.width,t.height,1,m,s)}s.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,t.width,t.height,p.depth,m,t.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,i,v,t.width,t.height,p.depth,0,t.data,0,0);else _("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else y?R&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,t.width,t.height,p.depth,m,g,t.data):n.texImage3D(e.TEXTURE_2D_ARRAY,i,v,t.width,t.height,p.depth,0,m,g,t.data)}else{y&&A&&n.texStorage2D(e.TEXTURE_2D,C,v,x[0].width,x[0].height);for(let i=0,r=x.length;i<r;i++)t=x[i],1023!==s.format?null!==m?y?R&&n.compressedTexSubImage2D(e.TEXTURE_2D,i,0,0,t.width,t.height,m,t.data):n.compressedTexImage2D(e.TEXTURE_2D,i,v,t.width,t.height,0,t.data):_("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):y?R&&n.texSubImage2D(e.TEXTURE_2D,i,0,0,t.width,t.height,m,g,t.data):n.texImage2D(e.TEXTURE_2D,i,v,t.width,t.height,0,m,g,t.data)}else if(s.isDataArrayTexture)if(y){if(A&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,v,p.width,p.height,p.depth),R)if(s.layerUpdates.size>0){let t=nX(p.width,p.height,s.format,s.type);for(let i of s.layerUpdates){let r=p.data.subarray(i*t/p.data.BYTES_PER_ELEMENT,(i+1)
358*t/p.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,i,p.width,p.height,1,m,g,r)}s.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,p.width,p.height,p.depth,m,g,p.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,v,p.width,p.height,p.depth,0,m,g,p.data);else if(s.isData3DTexture)y?(A&&n.texStorage3D(e.TEXTURE_3D,C,v,p.width,p.height,p.depth),R&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,p.width,p.height,p.depth,m,g,p.data)):n.texImage3D(e.TEXTURE_3D,0,v,p.width,p.height,p.depth,0,m,g,p.data);else if(s.isFramebufferTexture){if(A)if(y)n.texStorage2D(e.TEXTURE_2D,C,v,p.width,p.height);else{let t=p.width,i=p.height;for(let r=0;r<C;r++)n.texImage2D(e.TEXTURE_2D,r,v,t,i,0,m,g,null),t>>=1,i>>=1}}else if(x.length>0){if(y&&A){let t=Z(x[0]);n.texStorage2D(e.TEXTURE_2D,C,v,t.width,t.height)}for(let i=0,r=x.length;i<r;i++)t=x[i],y?R&&n.texSubImage2D(e.TEXTURE_2D,i,0,0,m,g,t):n.texImage2D(e.TEXTURE_2D,i,v,m,g,t);s.generateMipmaps=!1}else if(y){if(A){let t=Z(p);n.texStorage2D(e.TEXTURE_2D,C,v,t.width,t.height)}R&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,m,g,p)}else n.texImage2D(e.TEXTURE_2D,0,v,m,g,p);S(s)&&T(l),h.__version=u.version,s.onUpdate&&s.onUpdate(s)}t.__version=s.version}function V(t,r,s,o,c,u){let h=a.convert(s.format,s.colorSpace),d=a.convert(s.type),f=E(s.internalFormat,h,d,s.colorSpace),p=i.get(r),m=i.get(s);if(m.__renderTarget=r,!p.__hasExternalTextures){let t=Math.max(1,r.width>>u),i=Math.max(1,r.height>>u);c===e.TEXTURE_3D||c===e.TEXTURE_2D_ARRAY?n.texImage3D(c,u,f,t,i,r.depth,0,h,d,null):n.texImage2D(c,u,f,t,i,0,h,d,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),q(r)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,o,c,m.__webglTexture,0,Y(r)):(c===e.TEXTURE_2D||c>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&c<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,o,c,m.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function H(t,n,i){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let r=n.depthTexture,a=r&&r.isDepthTexture?r.type:null,s=b(n.stencilBuffer,a),o=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;q(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,Y(n),s,n.width,n.height):i?e.renderbufferStorageMultisample(e.RENDERBUFFER,Y(n),s,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,s,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,o,e.RENDERBUFFER,t)}else{let t=n.textures;for(let r=0;r<t.length;r++){let s=t[r],o=a.convert(s.format,s.colorSpace),c=a.convert(s.type),u=E(s.internalFormat,o,c,s.colorSpace);q(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,Y(n),u,n.width,n.height):i?e.renderbufferStorageMultisample(e.RENDERBUFFER,Y(n),u,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,u,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function G(t,r,s){let o=!0===r.isWebGLCubeRenderTarget;if(n.bindFramebuffer(e.FRAMEBUFFER,t),!(r.depthTexture&&r.depthTexture.isDepthTexture))throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");let c=i.get(r.depthTexture);if(c.__renderTarget=r,c.__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),o){if(void 0===c.__webglInit&&(c.__webglInit=!0,r.depthTexture.addEventListener("dispose",A)),void 0===c.__webglTexture){let t;c.__webglTexture=e.createTexture(),n.bindTexture(e.TEXTURE_CUBE_MAP,c.__webglTexture),O(e.TEXTURE_CUBE_MAP,r.depthTexture);let i=a.convert(r.depthTexture.format),s=a.convert(r.depthTexture.type);1026===r.depthTexture.format?t=e.DEPTH_COMPONENT24:1027===r.depthTexture.format&&(t=e.DEPTH24_STENCIL8);for(let n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,t,r.width,r.height,0,i,s,null)}}else L(r.depthTexture,0);let u=c.__webglTexture,h=Y(r),d=o?e.TEXTURE_CUBE_MAP_POSITIVE_X+s:e.TEXTURE_2D,f=1027===r.depthTexture.format?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;if(1026===r.depthTexture.format)q(r)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,f,d,u,0,h):e.framebufferTexture2D(e.FRAMEBUFFER,f,d,u,0);else if(1027===r.depthTexture.format)q(r)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,f,d,u,0,h):e.framebufferTexture2D(e.FRAMEBUFFER,f,d,u,0);else throw Error("Unknown depthTexture format")}
358function W(t){let r=i.get(t),a=!0===t.isWebGLCubeRenderTarget;if(r.__boundDepthTexture!==t.depthTexture){let e=t.depthTexture;if(r.__depthDisposeCallback&&r.__depthDisposeCallback(),e){let t=()=>{delete r.__boundDepthTexture,delete r.__depthDisposeCallback,e.removeEventListener("dispose",t)};e.addEventListener("dispose",t),r.__depthDisposeCallback=t}r.__boundDepthTexture=e}if(t.depthTexture&&!r.__autoAllocateDepthBuffer)if(a)for(let e=0;e<6;e++)G(r.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?G(r.__webglFramebuffer[0],t,0):G(r.__webglFramebuffer,t,0)}else if(a){r.__webglDepthbuffer=[];for(let i=0;i<6;i++)if(n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer[i]),void 0===r.__webglDepthbuffer[i])r.__webglDepthbuffer[i]=e.createRenderbuffer(),H(r.__webglDepthbuffer[i],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=r.__webglDepthbuffer[i];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let i=t.texture.mipmaps;if(i&&i.length>0?n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer),void 0===r.__webglDepthbuffer)r.__webglDepthbuffer=e.createRenderbuffer(),H(r.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,i=r.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,i),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,i)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}let X=[],j=[];function Y(e){return Math.min(r.maxSamples,e.samples)}function q(e){let n=i.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function K(e,t){let n=e.colorSpace,i=e.format,r=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==c&&""!==n&&(B.getTransfer(n)===h?(1023!==i||1009!==r)&&_("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):v("WebGLTextures: Unsupported texture color space:",n)),t}function Z(e){return"u">typeof HTMLImageElement&&e instanceof HTMLImageElement?(p.width=e.naturalWidth||e.width,p.height=e.naturalHeight||e.height):"u">typeof VideoFrame&&e instanceof VideoFrame?(p.width=e.displayWidth,p.height=e.displayHeight):(p.width=e.width,p.height=e.height),p}this.allocateTextureUnit=function(){let e=D;return e>=r.maxTextures&&_("WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+r.maxTextures),D+=1,e},this.resetTextureUnits=function(){D=0},this.setTexture2D=L,this.setTexture2DArray=function(t,r){let a=i.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?k(a,t,r):(t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null),n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+r))},this.setTexture3D=function(t,r){let a=i.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?k(a,t,r):n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+r)},this.setTextureCube=function(t,s){let o=i.get(t);!0!==t.isCubeDepthTexture&&t.version>0&&o.__version!==t.version?function(t,s,o){if(6!==s.image.length)return;let l=F(t,s),c=s.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+o);let u=i.get(c);if(c.version!==u.__version||!0===l){let t;n.activeTexture(e.TEXTURE0+o);let i=B.getPrimaries(B.workingColorSpace),h=""===s.colorSpace?null:B.getPrimaries(s.colorSpace),d=""===s.colorSpace||i===h?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let f=s.isCompressedTexture||s.image[0].isCompressedTexture,p=s.image[0]&&s.image[0].isDataTexture,m=[];for(let e=0;e<6;e++)f||p?m[e]=p?s.image[e].image:s.image[e]:m[e]=M(s.image[e],!0,r.maxCubemapSize),m[e]=K(s,m[e]);let g=m[0],v=a.convert(s.format,s.colorSpace),x=a.convert(s.type),y=E(s.internalFormat,v,x,s.colorSpace),b=!0!==s.isVideoTexture,A=void 0===u.__version||!0===l,R=c.dataReady,C=w(s,g);if(O(e.TEXTURE_CUBE_MAP,s),f){b&&A&&n.texStorage2D(e.TEXTURE_CUBE_MAP,C,y,g.width,g.height);for(let i=0;i<6;i++){t=m[i].mipmaps;for(let r=0;r<t.length;r++){let a=t[r];
vendor: 4,568 bytes, line 358
3581023!==s.format?null!==v?b?R&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r,0,0,a.width,a.height,v,a.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r,y,a.width,a.height,0,a.data):_("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):b?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r,0,0,a.width,a.height,v,x,a.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r,y,a.width,a.height,0,v,x,a.data)}}}else{if(t=s.mipmaps,b&&A){t.length>0&&C++;let i=Z(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,C,y,i.width,i.height)}for(let i=0;i<6;i++)if(p){b?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,0,0,m[i].width,m[i].height,v,x,m[i].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,y,m[i].width,m[i].height,0,v,x,m[i].data);for(let r=0;r<t.length;r++){let a=t[r].image[i].image;b?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r+1,0,0,a.width,a.height,v,x,a.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r+1,y,a.width,a.height,0,v,x,a.data)}}else{b?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,0,0,v,x,m[i]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,y,v,x,m[i]);for(let r=0;r<t.length;r++){let a=t[r];b?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r+1,0,0,v,x,a.image[i]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r+1,y,v,x,a.image[i])}}}S(s)&&T(e.TEXTURE_CUBE_MAP),u.__version=c.version,s.onUpdate&&s.onUpdate(s)}t.__version=s.version}(o,t,s):n.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture,e.TEXTURE0+s)},this.rebindTextures=function(t,n,r){let a=i.get(t);void 0!==n&&V(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==r&&W(t)},this.setupRenderTarget=function(t){let r=t.texture,o=i.get(t),l=i.get(r);t.addEventListener("dispose",R);let c=t.textures,u=!0===t.isWebGLCubeRenderTarget,h=c.length>1;if(!h&&(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=r.version,s.memory.textures++),u){o.__webglFramebuffer=[];for(let t=0;t<6;t++)if(r.mipmaps&&r.mipmaps.length>0){o.__webglFramebuffer[t]=[];for(let n=0;n<r.mipmaps.length;n++)o.__webglFramebuffer[t][n]=e.createFramebuffer()}else o.__webglFramebuffer[t]=e.createFramebuffer()}else{if(r.mipmaps&&r.mipmaps.length>0){o.__webglFramebuffer=[];for(let t=0;t<r.mipmaps.length;t++)o.__webglFramebuffer[t]=e.createFramebuffer()}else o.__webglFramebuffer=e.createFramebuffer();if(h)for(let t=0,n=c.length;t<n;t++){let n=i.get(c[t]);void 0===n.__webglTexture&&(n.__webglTexture=e.createTexture(),s.memory.textures++)}if(t.samples>0&&!1===q(t)){o.__webglMultisampledFramebuffer=e.createFramebuffer(),o.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,o.__webglMultisampledFramebuffer);for(let n=0;n<c.length;n++){let i=c[n];o.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,o.__webglColorRenderbuffer[n]);let r=a.convert(i.format,i.colorSpace),s=a.convert(i.type),l=E(i.internalFormat,r,s,i.colorSpace,!0===t.isXRRenderTarget),u=Y(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,o.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(o.__webglDepthRenderbuffer=e.createRenderbuffer(),H(o.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),O(e.TEXTURE_CUBE_MAP,r);for(let n=0;n<6;n++)if(r.mipmaps&&r.mipmaps.length>0)for(let i=0;i<r.mipmaps.length;i++)V(o.__webglFramebuffer[n][i],t,r,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,i);else V(o.__webglFramebuffer[n],t,r,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);S(r)&&T(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(h){for(let r=0,a=c.length;r<a;r++){let a=c[r],s=i.get(a),l=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(l=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(l,s.__webglTexture),O(l,a),V(o.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+r,l,0),S(a)&&T(l)}n.unbindTexture()}else{let i=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(i=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(i,l.__webglTexture),O(i,r),r.mipmaps&&r.mipmaps.length>0)for(let n=0;n<r.mipmaps.length;n++)V(o.__webglFramebuffer[n],t,r,e.COLOR_ATTACHMENT0,i,n);else V(o.__webglFramebuffer,t,r,e.COLOR_ATTACHMENT0,i,0);S(r)&&T(i),n.unbindTexture()}t.depthBuffer&&W(t)},this.updateRenderTargetMipmap=function(t){let r=t.textures;for(let a=0,s=r.length;a<s;a++){let s=r[a];
358if(S(s)){let r=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D,a=i.get(s).__webglTexture;n.bindTexture(r,a),T(r),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.samples>0){if(!1===q(t)){let r=t.textures,a=t.width,s=t.height,o=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=i.get(t),u=r.length>1;if(u)for(let t=0;t<r.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,c.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,c.__webglMultisampledFramebuffer);let h=t.texture.mipmaps;h&&h.length>0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer);for(let n=0;n<r.length;n++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(o|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(o|=e.STENCIL_BUFFER_BIT)),u){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,c.__webglColorRenderbuffer[n]);let t=i.get(r[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,s,0,0,a,s,o,e.NEAREST),!0===d&&(X.length=0,j.length=0,X.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&!1===t.resolveDepthBuffer&&(X.push(l),j.push(l),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,j)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,X))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),u)for(let t=0;t<r.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,c.__webglColorRenderbuffer[t]);let a=i.get(r[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,c.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&!1===t.resolveDepthBuffer&&d){let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}}},this.setupDepthRenderbuffer=W,this.setupFrameBufferTexture=V,this.useMultisampledRTT=q,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function r6(e,t){return{convert:function(n,i=""){let r,a=B.getTransfer(i);if(1009===n)return e.UNSIGNED_BYTE;if(1017===n)return e.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return e.UNSIGNED_SHORT_5_5_5_1;if(35902===n)return e.UNSIGNED_INT_5_9_9_9_REV;if(35899===n)return e.UNSIGNED_INT_10F_11F_11F_REV;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(1012===n)return e.UNSIGNED_SHORT;if(1013===n)return e.INT;if(1014===n)return e.UNSIGNED_INT;if(1015===n)return e.FLOAT;if(1016===n)return e.HALF_FLOAT;if(1021===n)return e.ALPHA;if(1022===n)return e.RGB;if(1023===n)return e.RGBA;if(1026===n)return e.DEPTH_COMPONENT;if(1027===n)return e.DEPTH_STENCIL;if(1028===n)return e.RED;if(1029===n)return e.RED_INTEGER;if(1030===n)return e.RG;if(1031===n)return e.RG_INTEGER;if(1033===n)return e.RGBA_INTEGER;if(33776===n||33777===n||33778===n||33779===n)if(a===h){if(null===(r=t.get("WEBGL_compressed_texture_s3tc_srgb")))return null;if(33776===n)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(33777===n)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(33778===n)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(33779===n)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(null===(r=t.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===n)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===n)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===n)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===n)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===n||35841===n||35842===n||35843===n){if(null===(r=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===n)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n||37492===n||37496===n||37488===n||37489===n||37490===n||37491===n){if(null===(r=t.get("WEBGL_compressed_texture_etc")))return null;if(36196===n||37492===n)return a===h?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(37496===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC;
358if(37488===n)return r.COMPRESSED_R11_EAC;if(37489===n)return r.COMPRESSED_SIGNED_R11_EAC;if(37490===n)return r.COMPRESSED_RG11_EAC;if(37491===n)return r.COMPRESSED_SIGNED_RG11_EAC}if(37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n){if(null===(r=t.get("WEBGL_compressed_texture_astc")))return null;if(37808===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===n)return a===h?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(36492===n||36494===n||36495===n){if(null===(r=t.get("EXT_texture_compression_bptc")))return null;if(36492===n)return a===h?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(36494===n)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(36495===n)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||36284===n||36285===n||36286===n){if(null===(r=t.get("EXT_texture_compression_rgtc")))return null;if(36283===n)return r.COMPRESSED_RED_RGTC1_EXT;if(36284===n)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===n)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===n)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return 1020===n?e.UNSIGNED_INT_24_8:void 0!==e[n]?e[n]:null}}}let r8=` 359void main() { 360 361 gl_Position = vec4( position, 1.0 ); 362 363}`,r9=` 364uniform sampler2DArray depthColor; 365uniform float depthWidth; 366uniform float depthHeight; 367 368void main() { 369 370 vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); 371 372 if ( coord.x >= 1.0 ) { 373 374 gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; 375 376 } else { 377 378 gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; 379 380 } 381 382}`;class r7{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(null===this.texture){let n=new t1(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(null!==this.texture&&null===this.mesh){let t=e.cameras[0].viewport,n=new nd({vertexShader:r8,fragmentShader:r9,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new tV(new nl(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class ae extends M{constructor(e,t){super();const n=this;let i=null,r=1,a=null,s="local-floor",o=1,l=null,c=null,u=null,h=null,d=null,f=null;const p="u">typeof XRWebGLBinding,m=new r7,g={},v=t.getContextAttributes();let x=null,y=null;const M=[],S=[],T=new C;let b=null;const w=new nN;w.viewport=new q;const A=new nN;A.viewport=new q;const R=[w,A],P=new nF;let L=null,U=null;function N(e){let t=S.indexOf(e.inputSource);if(-1===t)return;let n=M[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function I(){i.removeEventListener("select",N),i.removeEventListener("selectstart",N),i.removeEventListener("selectend",N),i.removeEventListener("squeeze",N),i.removeEventListener("squeezestart",N),i.removeEventListener("squeezeend",N),i.removeEventListener("end",I),i.removeEventListener("inputsourceschange",O);for(let e=0;e<M.length;e++){let t=S[e];null!==t&&(S[e]=null,M[e].disconnect(t))}for(let e in L=null,U=null,m.reset(),g)delete g[e];e.setRenderTarget(x),d=null,h=null,u=null,i=null,y=null,V.stop(),n.isPresenting=!1,e.setPixelRatio(b),e.setSize(T.width,T.height,!1),n.dispatchEvent({type:"sessionend"})}function O(e){for(let t=0;t<e.removed.length;t++){let n=e.removed[t],i=S.indexOf(n);i>=0&&(S[i]=null,M[i].disconnect(n))}for(let t=0;t<e.added.length;t++){let n=e.added[t],i=S.indexOf(n);if(-1===i){for(let e=0;e<M.length;e++)if(e>=S.length){S.push(n),i=e;break}else if(null===S[e]){S[e]=n,i=e;break}if(-1===i)break}let r=M[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=M[e];return void 0===t&&(t=new eR,M[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=M[e];return void 0===t&&(t=new eR,M[e]=t),t.getGripSpace()},this.getHand=function(e){let t=M[e];return void 0===t&&(t=new eR,M[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){r=e,!0===n.isPresenting&&_("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){s=e,!0===n.isPresenting&&_("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return null===u&&p&&(u=new XRWebGLBinding(i,t)),u},this.getFrame=function(){return f}
382,this.getSession=function(){return i},this.setSession=async function(c){if(null!==(i=c)){if(x=e.getRenderTarget(),i.addEventListener("select",N),i.addEventListener("selectstart",N),i.addEventListener("selectend",N),i.addEventListener("squeeze",N),i.addEventListener("squeezestart",N),i.addEventListener("squeezeend",N),i.addEventListener("end",I),i.addEventListener("inputsourceschange",O),!0!==v.xrCompatible&&await t.makeXRCompatible(),b=e.getPixelRatio(),e.getSize(T),p&&"createProjectionLayer"in XRWebGLBinding.prototype){let n=null,a=null,s=null;v.depth&&(s=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=v.stencil?1027:1026,a=v.stencil?1020:1014);let o={colorFormat:t.RGBA8,depthFormat:s,scaleFactor:r};h=(u=this.getBinding()).createProjectionLayer(o),i.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),y=new Z(h.textureWidth,h.textureHeight,{format:1023,type:1009,depthTexture:new tQ(h.textureWidth,h.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:4*!!v.antialias,resolveDepthBuffer:!1===h.ignoreDepthValues,resolveStencilBuffer:!1===h.ignoreDepthValues})}else{let n={antialias:v.antialias,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(i,t,n),i.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),y=new Z(d.framebufferWidth,d.framebufferHeight,{format:1023,type:1009,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil,resolveDepthBuffer:!1===d.ignoreDepthValues,resolveStencilBuffer:!1===d.ignoreDepthValues})}y.isXRRenderTarget=!0,this.setFoveation(o),l=null,a=await i.requestReferenceSpace(s),V.setContext(i),V.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};const F=new D,B=new D;function z(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){var t,n,r;if(null===i)return;let a=e.near,s=e.far;null!==m.texture&&(m.depthNear>0&&(a=m.depthNear),m.depthFar>0&&(s=m.depthFar)),P.near=A.near=w.near=a,P.far=A.far=w.far=s,(L!==P.near||U!==P.far)&&(i.updateRenderState({depthNear:P.near,depthFar:P.far}),L=P.near,U=P.far),P.layers.mask=6|e.layers.mask,w.layers.mask=-5&P.layers.mask,A.layers.mask=-3&P.layers.mask;let o=e.parent,l=P.cameras;z(P,o);for(let e=0;e<l.length;e++)z(l[e],o);2===l.length?function(e,t,n){F.setFromMatrixPosition(t.matrixWorld),B.setFromMatrixPosition(n.matrixWorld);let i=F.distanceTo(B),r=t.projectionMatrix.elements,a=n.projectionMatrix.elements,s=r[14]/(r[10]-1),o=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(a[8]+1)/a[0],d=i/(-u+h),f=-(d*u);if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(f),e.translateZ(d),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),-1===r[10])e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=s+d,n=o+d;e.projectionMatrix.makePerspective(s*u-f,s*h+(i-f),l*o/n*t,c*o/n*t,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}(P,w,A):P.projectionMatrix.copy(w.projectionMatrix),t=e,n=P,null===(r=o)?t.matrix.copy(n.matrixWorld):(t.matrix.copy(r.matrixWorld),t.matrix.invert(),t.matrix.multiply(n.matrixWorld)),t.matrix.decompose(t.position,t.quaternion,t.scale),t.updateMatrixWorld(!0),t.projectionMatrix.copy(n.projectionMatrix),t.projectionMatrixInverse.copy(n.projectionMatrixInverse),t.isPerspectiveCamera&&(t.fov=2*E*Math.atan(1/t.projectionMatrix.elements[5]),t.zoom=1)},this.getCamera=function(){return P},this.getFoveation=function(){if(null!==h||null!==d)return o},this.setFoveation=function(e){o=e,null!==h&&(h.fixedFoveation=e),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=e)},this.hasDepthSensing=function(){return null!==m.texture},this.getDepthSensingMesh=function(){return m.getMesh(P)},this.getCameraTexture=function(e){return g[e]};let k=null;const V=new nj;V.setAnimationLoop(function(t,r){if(c=r.getViewerPose(l||a),f=r,null!==c){let t=c.views;null!==d&&(e.setRenderTargetFramebuffer(y,d.framebuffer),e.setRenderTarget(y));let r=!1;t.length!==P.cameras.length&&(P.cameras.length=0,r=!0);for(let n=0;n<t.length;n++){let i=t[n],a=null;if(null!==d)a=d.getViewport(i);else{let t=u.getViewSubImage(h,i);a=t.viewport,0===n&&(e.setRenderTargetTextures(y,t.colorTexture,t.depthStencilTexture),e.setRenderTarget(y))}let s=R[n];void 0===s&&((s=new nN).layers.enable(n),s.viewport=new q,R[n]=s),s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.quaternion,s.scale),s.projectionMatrix.fromArray(i.projectionMatrix),s.projectionMatrixInverse.copy(s.projectionMatrix).invert(),s.viewport.set(a.x,a.y,a.width,a.height),0===n&&(P.matrix.copy(s.matrix
382),P.matrix.decompose(P.position,P.quaternion,P.scale)),!0===r&&P.cameras.push(s)}let a=i.enabledFeatures;if(a&&a.includes("depth-sensing")&&"gpu-optimized"==i.depthUsage&&p){let e=(u=n.getBinding()).getDepthInformation(t[0]);e&&e.isValid&&e.texture&&m.init(e,i.renderState)}if(a&&a.includes("camera-access")&&p){e.state.unbindTexture(),u=n.getBinding();for(let e=0;e<t.length;e++){let n=t[e].camera;if(n){let e=g[n];e||(e=new t1,g[n]=e);let t=u.getCameraImage(n);e.sourceTexture=t}}}}for(let e=0;e<M.length;e++){let t=S[e],n=M[e];null!==t&&void 0!==n&&n.update(t,r,l||a)}k&&k(t,r),r.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:r}),f=null}),this.setAnimationLoop=function(e){k=e},this.dispose=function(){}}}let at=new el,an=new $;function ai(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function i(e,i){e.opacity.value=i.opacity,i.color&&e.diffuse.value.copy(i.color),i.emissive&&e.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(e.map.value=i.map,n(i.map,e.mapTransform)),i.alphaMap&&(e.alphaMap.value=i.alphaMap,n(i.alphaMap,e.alphaMapTransform)),i.bumpMap&&(e.bumpMap.value=i.bumpMap,n(i.bumpMap,e.bumpMapTransform),e.bumpScale.value=i.bumpScale,1===i.side&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,n(i.normalMap,e.normalMapTransform),e.normalScale.value.copy(i.normalScale),1===i.side&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,n(i.displacementMap,e.displacementMapTransform),e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias),i.emissiveMap&&(e.emissiveMap.value=i.emissiveMap,n(i.emissiveMap,e.emissiveMapTransform)),i.specularMap&&(e.specularMap.value=i.specularMap,n(i.specularMap,e.specularMapTransform)),i.alphaTest>0&&(e.alphaTest.value=i.alphaTest);let r=t.get(i),a=r.envMap,s=r.envMapRotation;a&&(e.envMap.value=a,at.copy(s),at.x*=-1,at.y*=-1,at.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(at.y*=-1,at.z*=-1),e.envMapRotation.value.setFromMatrix4(an.makeRotationFromEuler(at)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,e.reflectivity.value=i.reflectivity,e.ior.value=i.ior,e.refractionRatio.value=i.refractionRatio),i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity,n(i.lightMap,e.lightMapTransform)),i.aoMap&&(e.aoMap.value=i.aoMap,e.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,nh(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,r,a,s,o){var l,c,u,h,d,f,p,m,g,_,v,x,y,M,S,T,E,b,w,A,R,C,P;let D;r.isMeshBasicMaterial?i(e,r):r.isMeshLambertMaterial?(i(e,r),r.envMap&&(e.envMapIntensity.value=r.envMapIntensity)):r.isMeshToonMaterial?(i(e,r),l=e,(c=r).gradientMap&&(l.gradientMap.value=c.gradientMap)):r.isMeshPhongMaterial?(i(e,r),u=e,h=r,u.specular.value.copy(h.specular),u.shininess.value=Math.max(h.shininess,1e-4),r.envMap&&(e.envMapIntensity.value=r.envMapIntensity)):r.isMeshStandardMaterial?(i(e,r),d=e,f=r,d.metalness.value=f.metalness,f.metalnessMap&&(d.metalnessMap.value=f.metalnessMap,n(f.metalnessMap,d.metalnessMapTransform)),d.roughness.value=f.roughness,f.roughnessMap&&(d.roughnessMap.value=f.roughnessMap,n(f.roughnessMap,d.roughnessMapTransform)),f.envMap&&(d.envMapIntensity.value=f.envMapIntensity),r.isMeshPhysicalMaterial&&(p=e,m=r,g=o,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,n(m.sheenColorMap,p.sheenColorMapTransform)),m.sheenRoughnessMap&&(p.sheenRoughnessMap.value=m.sheenRoughnessMap,n(m.sheenRoughnessMap,p.sheenRoughnessMapTransform))),m.clearcoat>0&&(p.clearcoat.value=m.clearcoat,p.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(p.clearcoatMap.value=m.clearcoatMap,n(m.clearcoatMap,p.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,n(m.clearcoatRoughnessMap,p.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(p.clearcoatNormalMap.value=m.clearcoatNormalMap,n(m.clearcoatNormalMap,p.clearcoatNormalMapTransform),p.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),1===m.side&&p.clearcoatNormalScale.value.negate())),m.dispersion>
3820&&(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,n(m.iridescenceMap,p.iridescenceMapTransform)),m.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=m.iridescenceThicknessMap,n(m.iridescenceThicknessMap,p.iridescenceThicknessMapTransform))),m.transmission>0&&(p.transmission.value=m.transmission,p.transmissionSamplerMap.value=g.texture,p.transmissionSamplerSize.value.set(g.width,g.height),m.transmissionMap&&(p.transmissionMap.value=m.transmissionMap,n(m.transmissionMap,p.transmissionMapTransform)),p.thickness.value=m.thickness,m.thicknessMap&&(p.thicknessMap.value=m.thicknessMap,n(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,n(m.anisotropyMap,p.anisotropyMapTransform))),p.specularIntensity.value=m.specularIntensity,p.specularColor.value.copy(m.specularColor),m.specularColorMap&&(p.specularColorMap.value=m.specularColorMap,n(m.specularColorMap,p.specularColorMapTransform)),m.specularIntensityMap&&(p.specularIntensityMap.value=m.specularIntensityMap,n(m.specularIntensityMap,p.specularIntensityMapTransform)))):r.isMeshMatcapMaterial?(i(e,r),_=e,(v=r).matcap&&(_.matcap.value=v.matcap)):r.isMeshDepthMaterial?i(e,r):r.isMeshDistanceMaterial?(i(e,r),x=e,y=r,D=t.get(y).light,x.referencePosition.value.setFromMatrixPosition(D.matrixWorld),x.nearDistance.value=D.shadow.camera.near,x.farDistance.value=D.shadow.camera.far):r.isMeshNormalMaterial?i(e,r):r.isLineBasicMaterial?(M=e,S=r,M.diffuse.value.copy(S.color),M.opacity.value=S.opacity,S.map&&(M.map.value=S.map,n(S.map,M.mapTransform)),r.isLineDashedMaterial&&(T=e,E=r,T.dashSize.value=E.dashSize,T.totalSize.value=E.dashSize+E.gapSize,T.scale.value=E.scale)):r.isPointsMaterial?(b=e,w=r,A=a,R=s,b.diffuse.value.copy(w.color),b.opacity.value=w.opacity,b.size.value=w.size*A,b.scale.value=.5*R,w.map&&(b.map.value=w.map,n(w.map,b.uvTransform)),w.alphaMap&&(b.alphaMap.value=w.alphaMap,n(w.alphaMap,b.alphaMapTransform)),w.alphaTest>0&&(b.alphaTest.value=w.alphaTest)):r.isSpriteMaterial?(C=e,P=r,C.diffuse.value.copy(P.color),C.opacity.value=P.opacity,C.rotation.value=P.rotation,P.map&&(C.map.value=P.map,n(P.map,C.mapTransform)),P.alphaMap&&(C.alphaMap.value=P.alphaMap,n(P.alphaMap,C.alphaMapTransform)),P.alphaTest>0&&(C.alphaTest.value=P.alphaTest)):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function ar(e,t,n,i){let r={},a={},s=[],o=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e){let t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?_("WebGLRenderer: Texture samplers can not be part of an uniforms group."):_("WebGLRenderer: Unsupported uniform value type.",e),t}function c(t){let n=t.target;n.removeEventListener("dispose",c);let i=s.indexOf(n.__bindingPointIndex);s.splice(i,1),e.deleteBuffer(r[n.id]),delete r[n.id],delete a[n.id]}return{bind:function(e,t){let n=t.program;i.uniformBlockBinding(e,n)},update:function(n,u){var h;let d,f,p,m,g=r[n.id];void 0===g&&(function(e){let t=e.uniforms,n=0;for(let e=0,i=t.length;e<i;e++){let i=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=i.length;e<t;e++){let t=i[e],r=Array.isArray(t.value)?t.value:[t.value];for(let e=0,i=r.length;e<i;e++){let i=l(r[e]),a=n%16,s=a%i.boundary,o=a+s;n+=s,0!==o&&16-o<i.storage&&(n+=16-o),t.__data=new Float32Array(i.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,n+=i.storage}}}let i=n%16;i>0&&(n+=16-i),e.__size=n,e.__cache={}}(n),(h=n).__bindingPointIndex=d=function(){for(let e=0;e<o;e++)if(-1===s.indexOf(e))return s.push(e),e;return v("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}(),f=e.createBuffer(),p=h.__size,m=h.usage,e.bindBuffer(e.UNIFORM_BUFFER,f),e.bufferData(e.UNIFORM_BUFFER,p,m),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,d,f),g=f,r[n.id]=g,n.addEventListener("dispose",c));let _=u.program;i.updateUBOMapping(n,_);let x=t.render.frame;a[n.id]!==x&&(function(t){let n=r[t.id],i=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let t=0,n=i.length;t<n;t++){let n=Array.isArray(i[t])?i[t]:[i[t]];for(let i=0,r=n.length;i<r;i++){let r=n[i];if(!0===function(e,t,n,i){let r=e.value,a=t+"_"+n;if(void 0===i[a])return"number"==typeof r||"boolean"==typeof r?i[a]=r:i[a]=r.clone(),!0;{let e=i[a];if("number"==typeof r||"boolean"==typeof r){if(e!==r)return i[a]=r,!0}else if(!1===e.equals(r))return e.copy(r),!0}return!1}(r,t,i,a)){let t=r.__offset,n=Array.isArray(r.value)?r.value:[r.value],i=0;for(let a=0;a<n.length;a++){let s=n[a],o=l(s);"number"==typeof s||"boolean"==typeof s?(r.__data[0]=s,e.bufferSubData(e.UNIFORM_BUFFER,t+i,r.__data)):s.isMatrix3?(r.__data[0]=s.elements[0],r.__data[1]=s.elements[1],r.__data[2]=s.elements[2],r.__data[3]=0,r.__data[4]=s.elements[3],r.__data[5]=s.elements[4],r.__data[6]=s.elements[5],r.__data[7]=0,r.__data[8]=s.elements[6],r.__data[9]=s.elements[7],r.__data[10]=s.elements[8],r.__data[11]=0):(s.toArray(r.__data,i),i+=o.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,r.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),a[n.id]=x)},dispose:function(){for(let t in r)e.deleteBuffer(r[t]);s=[],r={},a={}}}}let aa=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10
382751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),as=null;class ao{constructor(e={}){let t,n,i,r,a,s,o,u,h,d,p,g,y,M,S,T,E,b,w,A,R,C,P,L;const{canvas:U=function(){let e=f("canvas");return e.style.display="block",e}(),context:N=null,depth:I=!0,stencil:O=!1,alpha:F=!1,antialias:z=!1,premultipliedAlpha:k=!0,preserveDrawingBuffer:V=!1,powerPreference:H="default",failIfMajorPerformanceCaveat:G=!1,reversedDepthBuffer:W=!1,outputBufferType:X=1009}=e;if(this.isWebGLRenderer=!0,null!==N){if("u">typeof WebGLRenderingContext&&N instanceof WebGLRenderingContext)throw Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");t=N.getContextAttributes().alpha}else t=F;const j=new Set([1033,1031,1029]),Y=new Set([1009,1014,1012,1020,1017,1018]),K=new Uint32Array(4),J=new Int32Array(4);let Q=null,ee=null;const et=[],en=[];let ei=null;this.domElement=U,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.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const er=this;let ea=!1;this._outputColorSpace=l;let es=0,eo=0,el=null,ec=-1,eu=null;const eh=new q,ed=new q;let ef=null;const ep=new eU(0);let em=0,eg=U.width,e_=U.height,ev=1,ex=null,ey=null;const eM=new q(0,0,eg,e_),eS=new q(0,0,eg,e_);let eT=!1;const eE=new tJ;let eb=!1,ew=!1;const eA=new $,eR=new D,eC=new q,eP={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let eD=!1;function eL(){return null===el?ev:1}let eN=N;function eI(e,t){return U.getContext(e,t)}try{if("setAttribute"in U&&U.setAttribute("data-engine","three.js r183"),U.addEventListener("webglcontextlost",eB,!1),U.addEventListener("webglcontextrestored",ez,!1),U.addEventListener("webglcontextcreationerror",ek,!1),null===eN){const e="webgl2";if(eN=eI(e,{alpha:!0,depth:I,stencil:O,antialias:z,premultipliedAlpha:k,preserveDrawingBuffer:V,powerPreference:H,failIfMajorPerformanceCaveat:G}),null===eN)if(eI(e))throw Error("Error creating WebGL context with your selected attributes.");else throw Error("Error creating WebGL context.")}}
382catch(e){throw v("WebGLRenderer: "+e.message),e}function eO(){(n=new id(eN)).init(),C=new r6(eN,n),i=new n2(eN,n,e,C),r=new r4(eN,n),i.reversedDepthBuffer&&W&&r.buffers.depth.setReversed(!0),a=new ig(eN),s=new rV,o=new r5(eN,n,r,s,i,C,a),u=new ih(er),h=new nY(eN),P=new n1(eN,h),d=new ip(eN,h,a,P),p=new iv(eN,d,h,P,a),w=new i_(eN,i,o),T=new n4(s),g=new rk(er,u,n,i,P,T),y=new ai(er,s),M=new rX,S=new rJ(n),b=new n0(er,u,r,p,t,k),E=new r2(er,p,i),L=new ar(eN,a,i,r),A=new n3(eN,n,a),R=new im(eN,n,a),a.programs=g.programs,er.capabilities=i,er.extensions=n,er.properties=s,er.renderLists=M,er.shadowMap=E,er.state=r,er.info=a}eO(),1009!==X&&(ei=new iy(X,U.width,U.height,I,O));const eF=new ae(er,eN);function eB(e){e.preventDefault(),m("WebGLRenderer: Context Lost."),ea=!0}function ez(){m("WebGLRenderer: Context Restored."),ea=!1;let e=a.autoReset,t=E.enabled,n=E.autoUpdate,i=E.needsUpdate,r=E.type;eO(),a.autoReset=e,E.enabled=t,E.autoUpdate=n,E.needsUpdate=i,E.type=r}function ek(e){v("WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function eV(e){var t,n;let i,r=e.target;r.removeEventListener("dispose",eV),n=t=r,void 0!==(i=s.get(n).programs)&&(i.forEach(function(e){g.releaseProgram(e)}),n.isShaderMaterial&&g.releaseShaderCache(n)),s.remove(t)}function eH(e,t,n){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=1,e.needsUpdate=!0,e$(e,t,n),e.side=0,e.needsUpdate=!0,e$(e,t,n),e.side=2):e$(e,t,n)}this.xr=eF,this.getContext=function(){return eN},this.getContextAttributes=function(){return eN.getContextAttributes()},this.forceContextLoss=function(){let e=n.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){let e=n.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return ev},this.setPixelRatio=function(e){void 0!==e&&(ev=e,this.setSize(eg,e_,!1))},this.getSize=function(e){return e.set(eg,e_)},this.setSize=function(e,t,n=!0){eF.isPresenting?_("WebGLRenderer: Can't change size while VR device is presenting."):(eg=e,e_=t,U.width=Math.floor(e*ev),U.height=Math.floor(t*ev),!0===n&&(U.style.width=e+"px",U.style.height=t+"px"),null!==ei&&ei.setSize(U.width,U.height),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return e.set(eg*ev,e_*ev).floor()},this.setDrawingBufferSize=function(e,t,n){eg=e,e_=t,ev=n,U.width=Math.floor(e*n),U.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.setEffects=function(e){if(1009===X)return void console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");if(e){for(let t=0;t<e.length;t++)if(!0===e[t].isOutputPass){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}ei.setEffects(e||[])},this.getCurrentViewport=function(e){return e.copy(eh)},this.getViewport=function(e){return e.copy(eM)},this.setViewport=function(e,t,n,i){e.isVector4?eM.set(e.x,e.y,e.z,e.w):eM.set(e,t,n,i),r.viewport(eh.copy(eM).multiplyScalar(ev).round())},this.getScissor=function(e){return e.copy(eS)},this.setScissor=function(e,t,n,i){e.isVector4?eS.set(e.x,e.y,e.z,e.w):eS.set(e,t,n,i),r.scissor(ed.copy(eS).multiplyScalar(ev).round())},this.getScissorTest=function(){return eT},this.setScissorTest=function(e){r.setScissorTest(eT=e)},this.setOpaqueSort=function(e){ex=e},this.setTransparentSort=function(e){ey=e},this.getClearColor=function(e){return e.copy(b.getClearColor())},this.setClearColor=function(){b.setClearColor(...arguments)},this.getClearAlpha=function(){return b.getClearAlpha()},this.setClearAlpha=function(){b.setClearAlpha(...arguments)},this.clear=function(e=!0,t=!0,n=!0){let i=0;if(e){let e=!1;if(null!==el){let t=el.texture.format;e=j.has(t)}if(e){let e=el.texture.type,t=Y.has(e),n=b.getClearColor(),i=b.getClearAlpha(),r=n.r,a=n.g,s=n.b;t?(K[0]=r,K[1]=a,K[2]=s,K[3]=i,eN.clearBufferuiv(eN.COLOR,0,K)):(J[0]=r,J[1]=a,J[2]=s,J[3]=i,eN.clearBufferiv(eN.COLOR,0,J))}else i|=eN.COLOR_BUFFER_BIT}t&&(i|=eN.DEPTH_BUFFER_BIT),n&&(i|=eN.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(0xffffffff)),0!==i&&eN.clear(i)},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(){U.removeEventListener("webglcontextlost",eB,!1),U.removeEventListener("webglcontextrestored",ez,!1),U.removeEventListener("webglcontextcreationerror",ek,!1),b.dispose(),M.dispose(),S.dispose(),s.dispose(),u.dispose(),p.dispose(),P.dispose(),L.dispose(),g.dispose(),eF.dispose(),eF.removeEventListener("sessionstart",eW),eF.removeEventListener("sessionend",eX),ej.stop()},this.renderBufferDirect=function(e,t,a,l,f,p){let m;null===t&&(t=eP);let g=f.isMesh&&0>f.matrixWorld.determinant(),_=function(e,t,n,a,l){var h,d;!0!==t.isScene&&(t=eP),o.resetTextureUnits();let f=t.fog,p=a.isMeshStandardMaterial||a.isMeshLambertMaterial||a.isMeshPhongMaterial?t.environment:null,m=null===el?er.outputColorSpace:!0===el.isXRRenderTarget?el.texture.colorSpace:c,g=a.isMeshStandardMaterial||a.isMeshLambertMaterial&&!a.envMap||a.isMeshPhongMaterial&&!a.envMap,_=u.get(a.envMap||p,g),v=!0===a.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,x=!!n.attributes.tangent&&(!!a.normalMap||a.anisotropy>0),M=!!n.morphAttributes.position,S=!!n.morphAttributes.normal,E=!!n.morphAttributes.color,b=0;a.toneMapped&&(null===el||!0===el.isXRRenderTarget)&&(b=er.toneMapping);let A=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,R=void 0!==A?A.length:0,C=s.get(a),P=ee.state.lights;if(!0===eb&&(!0===ew||e!==eu)){let t=e===eu&&a.id===ec;T.setState(a,e,t)}let D=!1;a.version===C.__version?C.needsLights&&C.lightsStateVersion!==P.state.ver
382sion||C.outputColorSpace!==m||l.isBatchedMesh&&!1===C.batching?D=!0:l.isBatchedMesh||!0!==C.batching?l.isBatchedMesh&&!0===C.batchingColor&&null===l.colorTexture||l.isBatchedMesh&&!1===C.batchingColor&&null!==l.colorTexture||l.isInstancedMesh&&!1===C.instancing?D=!0:l.isInstancedMesh||!0!==C.instancing?l.isSkinnedMesh&&!1===C.skinning?D=!0:l.isSkinnedMesh||!0!==C.skinning?l.isInstancedMesh&&!0===C.instancingColor&&null===l.instanceColor||l.isInstancedMesh&&!1===C.instancingColor&&null!==l.instanceColor||l.isInstancedMesh&&!0===C.instancingMorph&&null===l.morphTexture||l.isInstancedMesh&&!1===C.instancingMorph&&null!==l.morphTexture||C.envMap!==_||!0===a.fog&&C.fog!==f||void 0!==C.numClippingPlanes&&(C.numClippingPlanes!==T.numPlanes||C.numIntersection!==T.numIntersection)||C.vertexAlphas!==v||C.vertexTangents!==x||C.morphTargets!==M||C.morphNormals!==S||C.morphColors!==E||C.toneMapping!==b?D=!0:C.morphTargetsCount!==R&&(D=!0):D=!0:D=!0:D=!0:(D=!0,C.__version=a.version);let U=C.currentProgram;!0===D&&(U=e$(a,t,l));let N=!1,I=!1,O=!1,F=U.getUniforms(),B=C.uniforms;if(r.useProgram(U.program)&&(N=!0,I=!0,O=!0),a.id!==ec&&(ec=a.id,I=!0),N||eu!==e){r.buffers.depth.getReversed()&&!0!==e.reversedDepth&&(e._reversedDepth=!0,e.updateProjectionMatrix()),F.setValue(eN,"projectionMatrix",e.projectionMatrix),F.setValue(eN,"viewMatrix",e.matrixWorldInverse);let t=F.map.cameraPosition;void 0!==t&&t.setValue(eN,eR.setFromMatrixPosition(e.matrixWorld)),i.logarithmicDepthBuffer&&F.setValue(eN,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(a.isMeshPhongMaterial||a.isMeshToonMaterial||a.isMeshLambertMaterial||a.isMeshBasicMaterial||a.isMeshStandardMaterial||a.isShaderMaterial)&&F.setValue(eN,"isOrthographic",!0===e.isOrthographicCamera),eu!==e&&(eu=e,I=!0,O=!0)}if(C.needsLights&&(P.state.directionalShadowMap.length>0&&F.setValue(eN,"directionalShadowMap",P.state.directionalShadowMap,o),P.state.spotShadowMap.length>0&&F.setValue(eN,"spotShadowMap",P.state.spotShadowMap,o),P.state.pointShadowMap.length>0&&F.setValue(eN,"pointShadowMap",P.state.pointShadowMap,o)),l.isSkinnedMesh){F.setOptional(eN,l,"bindMatrix"),F.setOptional(eN,l,"bindMatrixInverse");let e=l.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),F.setValue(eN,"boneTexture",e.boneTexture,o))}l.isBatchedMesh&&(F.setOptional(eN,l,"batchingTexture"),F.setValue(eN,"batchingTexture",l._matricesTexture,o),F.setOptional(eN,l,"batchingIdTexture"),F.setValue(eN,"batchingIdTexture",l._indirectTexture,o),F.setOptional(eN,l,"batchingColorTexture"),null!==l._colorsTexture&&F.setValue(eN,"batchingColorTexture",l._colorsTexture,o));let z=n.morphAttributes;if((void 0!==z.position||void 0!==z.normal||void 0!==z.color)&&w.update(l,n,U),(I||C.receiveShadow!==l.receiveShadow)&&(C.receiveShadow=l.receiveShadow,F.setValue(eN,"receiveShadow",l.receiveShadow)),(a.isMeshStandardMaterial||a.isMeshLambertMaterial||a.isMeshPhongMaterial)&&null===a.envMap&&null!==t.environment&&(B.envMapIntensity.value=t.environmentIntensity),void 0!==B.dfgLUT&&(B.dfgLUT.value=(null===as&&((as=new tG(aa,16,16,1030,1016)).name="DFG_LUT",as.minFilter=1006,as.magFilter=1006,as.wrapS=1001,as.wrapT=1001,as.generateMipmaps=!1,as.needsUpdate=!0),as)),I&&(F.setValue(eN,"toneMappingExposure",er.toneMappingExposure),C.needsLights&&(h=B,d=O,h.ambientLightColor.needsUpdate=d,h.lightProbe.needsUpdate=d,h.directionalLights.needsUpdate=d,h.directionalLightShadows.needsUpdate=d,h.pointLights.needsUpdate=d,h.pointLightShadows.needsUpdate=d,h.spotLights.needsUpdate=d,h.spotLightShadows.needsUpdate=d,h.rectAreaLights.needsUpdate=d,h.hemisphereLights.needsUpdate=d),f&&!0===a.fog&&y.refreshFogUniforms(B,f),y.refreshMaterialUniforms(B,a,ev,e_,ee.state.transmissionRenderTarget[e.id]),rp.upload(eN,eQ(C),B,o)),a.isShaderMaterial&&!0===a.uniformsNeedUpdate&&(rp.upload(eN,eQ(C),B,o),a.uniformsNeedUpdate=!1),a.isSpriteMaterial&&F.setValue(eN,"center",l.center),F.setValue(eN,"modelViewMatrix",l.modelViewMatrix),F.setValue(eN,"normalMatrix",l.normalMatrix),F.setValue(eN,"modelMatrix",l.matrixWorld),a.isShaderMaterial||a.isRawShaderMaterial){let e=a.uniformsGroups;for(let t=0,n=e.length;t<n;t++){let n=e[t];L.update(n,U),L.bind(n,U)}}return U}(e,t,a,l,f);r.setMaterial(l,g);let v=a.index,M=1;if(!0===l.wireframe){if(void 0===(v=d.getWireframeAttribute(a)))return;M=2}let S=a.drawRange,E=a.attributes.position,b=S.start*M,C=(S.start+S.count)*M;null!==p&&(b=Math.max(b,p.start*M),C=Math.min(C,(p.start+p.count)*M)),null!==v?(b=Math.max(b,0),C=Math.min(C,v.count)):null!=E&&(b=Math.max(b,0),C=Math.min(C,E.count));let D=C-b;if(D<0||D===1/0)return;P.setup(f,l,_,a,v);let U=A;if(null!==v&&(m=h.get(v),(U=R).setIndex(m)),f.isMesh)!0===l.wireframe?(r.setLineWidth(l.wireframeLinewidth*eL()),U.setMode(eN.LINES)):U.setMode(eN.TRIANGLES);else if(f.isLine){let e=l.linewidth;void 0===e&&(e=1),r.setLineWidth(e*eL()),f.isLineSegments?U.setMode(eN.LINES):f.isLineLoop?U.setMode(eN.LINE_LOOP):U.setMode(eN.LINE_STRIP)}else f.isPoints?U.setMode(eN.POINTS):f.isSprite&&U.setMode(eN.TRIANGLES);if(f.isBatchedMesh)if(null!==f._multiDrawInstances)x("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),U.renderMultiDrawInstances(f._multiDrawStarts,f._multiDrawCounts,f._multiDrawCount,f._multiDrawInstances);else if(n.get("WEBGL_multi_draw"))U.renderMultiDraw(f._multiDrawStarts,f._multiDrawCounts,f._multiDrawCount);else{let e=f._multiDrawStarts,t=f._multiDrawCounts,n=f._multiDrawCount,i=v?h.get(v).bytesPerElement:1,r=s.get(l).currentProgram.getUniforms();for(let a=0;a<n;a++)r.setValue(eN,"_gl_DrawID",a),U.render(e[a]/i,t[a])}else if(f.isInstancedMesh)U.renderInstances(b,D,f.count);else if(a.isInstancedBufferGeometry){let e=void 0!==a._maxInstanceCount?a._maxInstanceCount:1/0,t=Math.min(a.instanceCount,e);U.renderInstances(b,D,t)}else U.render(b,D)},this.compile=function(e,t,n=null){null===n&&(n=e),(ee=S.get(n)).init(t),en.push(ee),n.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(ee.pushLight(e),e.castShadow&&ee.pushShadow(e))}),e!==n&&e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(ee.pushLight(e),e.castShadow&&ee.pushShadow(e))}),ee.setupLights();let i=new Set;return e.traverse(function(e){if(!(e.isMesh||e.isPoints||e.isLine||e.isSprite))return;let t=e.material;if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++){let a=t[r];eH(a,n,e),i.add(a)}else eH(t,n,e),i.add(t)}),ee=en.pop(),i},this.compileAsync=function(e,t,i=null){let r=this.compile(e,t,i);return new Promise(t=>
382{function i(){(r.forEach(function(e){s.get(e).currentProgram.isReady()&&r.delete(e)}),0===r.size)?t(e):setTimeout(i,10)}null!==n.get("KHR_parallel_shader_compile")?i():setTimeout(i,10)})};let eG=null;function eW(){ej.stop()}function eX(){ej.start()}const ej=new nj;function eY(e,t,n,i){if(!1===e.visible)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)ee.pushLight(e),e.castShadow&&ee.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||eE.intersectsSprite(e)){i&&eC.setFromMatrixPosition(e.matrixWorld).applyMatrix4(eA);let t=p.update(e),r=e.material;r.visible&&Q.push(e,t,r,n,eC.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||eE.intersectsObject(e))){let t=p.update(e),r=e.material;if(i&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),eC.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),eC.copy(t.boundingSphere.center)),eC.applyMatrix4(e.matrixWorld).applyMatrix4(eA)),Array.isArray(r)){let i=t.groups;for(let a=0,s=i.length;a<s;a++){let s=i[a],o=r[s.materialIndex];o&&o.visible&&Q.push(e,t,o,n,eC.z,s)}}else r.visible&&Q.push(e,t,r,n,eC.z,null)}}let r=e.children;for(let e=0,a=r.length;e<a;e++)eY(r[e],t,n,i)}function eq(e,t,n,i){let{opaque:a,transmissive:s,transparent:o}=e;ee.setupLightsView(n),!0===eb&&T.setGlobalState(er.clippingPlanes,n),i&&r.viewport(eh.copy(i)),a.length>0&&eZ(a,t,n),s.length>0&&eZ(s,t,n),o.length>0&&eZ(o,t,n),r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),r.setPolygonOffset(!1)}function eK(e,t,r,a){if(null!==(!0===r.isScene?r.overrideMaterial:null))return;if(void 0===ee.state.transmissionRenderTarget[a.id]){let e=n.has("EXT_color_buffer_half_float")||n.has("EXT_color_buffer_float");ee.state.transmissionRenderTarget[a.id]=new Z(1,1,{generateMipmaps:!0,type:e?1016:1009,minFilter:1008,samples:Math.max(4,i.samples),stencilBuffer:O,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:B.workingColorSpace})}let s=ee.state.transmissionRenderTarget[a.id],l=a.viewport||eh;s.setSize(l.z*er.transmissionResolutionScale,l.w*er.transmissionResolutionScale);let c=er.getRenderTarget(),u=er.getActiveCubeFace(),h=er.getActiveMipmapLevel();er.setRenderTarget(s),er.getClearColor(ep),(em=er.getClearAlpha())<1&&er.setClearColor(0xffffff,.5),er.clear(),eD&&b.render(r);let d=er.toneMapping;er.toneMapping=0;let f=a.viewport;if(void 0!==a.viewport&&(a.viewport=void 0),ee.setupLightsView(a),!0===eb&&T.setGlobalState(er.clippingPlanes,a),eZ(e,r,a),o.updateMultisampleRenderTarget(s),o.updateRenderTargetMipmap(s),!1===n.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let n=0,i=t.length;n<i;n++){let{object:i,geometry:s,material:o,group:l}=t[n];if(2===o.side&&i.layers.test(a.layers)){let t=o.side;o.side=1,o.needsUpdate=!0,eJ(i,r,a,s,o,l),o.side=t,o.needsUpdate=!0,e=!0}}!0===e&&(o.updateMultisampleRenderTarget(s),o.updateRenderTargetMipmap(s))}er.setRenderTarget(c,u,h),er.setClearColor(ep,em),void 0!==f&&(a.viewport=f),er.toneMapping=d}function eZ(e,t,n){let i=!0===t.isScene?t.overrideMaterial:null;for(let r=0,a=e.length;r<a;r++){let a=e[r],{object:s,geometry:o,group:l}=a,c=a.material;!0===c.allowOverride&&null!==i&&(c=i),s.layers.test(n.layers)&&eJ(s,t,n,o,c,l)}}function eJ(e,t,n,i,r,a){e.onBeforeRender(er,t,n,i,r,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),r.onBeforeRender(er,t,n,i,e,a),!0===r.transparent&&2===r.side&&!1===r.forceSinglePass?(r.side=1,r.needsUpdate=!0,er.renderBufferDirect(n,t,i,r,e,a),r.side=0,r.needsUpdate=!0,er.renderBufferDirect(n,t,i,r,e,a),r.side=2):er.renderBufferDirect(n,t,i,r,e,a),e.onAfterRender(er,t,n,i,r,a)}function e$(e,t,n){var i;!0!==t.isScene&&(t=eP);let r=s.get(e),a=ee.state.lights,o=ee.state.shadowsArray,l=a.state.version,c=g.getParameters(e,a.state,o,t,n),h=g.getProgramCacheKey(c),d=r.programs;r.environment=e.isMeshStandardMaterial||e.isMeshLambertMaterial||e.isMeshPhongMaterial?t.environment:null,r.fog=t.fog;let f=e.isMeshStandardMaterial||e.isMeshLambertMaterial&&!e.envMap||e.isMeshPhongMaterial&&!e.envMap;r.envMap=u.get(e.envMap||r.environment,f),r.envMapRotation=null!==r.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===d&&(e.addEventListener("dispose",eV),r.programs=d=new Map);let p=d.get(h);if(void 0!==p){if(r.currentProgram===p&&r.lightsStateVersion===l)return e0(e,c),p}else c.uniforms=g.getUniforms(e),e.onBeforeCompile(c,er),p=g.acquireProgram(c,h),d.set(h,p),r.uniforms=c.uniforms;let m=r.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(m.clippingPlanes=T.uniform),e0(e,c),r.needsLights=(i=e).isMeshLambertMaterial||i.isMeshToonMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.isShadowMaterial||i.isShaderMaterial&&!0===i.lights,r.lightsStateVersion=l,r.needsLights&&(m.ambientLightColor.value=a.state.ambient,m.lightProbe.value=a.state.probe,m.directionalLights.value=a.state.directional,m.directionalLightShadows.value=a.state.directionalShadow,m.spotLights.value=a.state.spot,m.spotLightShadows.value=a.state.spotShadow,m.rectAreaLights.value=a.state.rectArea,m.ltc_1.value=a.state.rectAreaLTC1,m.ltc_2.value=a.state.rectAreaLTC2,m.pointLights.value=a.state.point,m.pointLightShadows.value=a.state.pointShadow,m.hemisphereLights.value=a.state.hemi,m.directionalShadowMatrix.value=a.state.directionalShadowMatrix,m.spotLightMatrix.value=a.state.spotLightMatrix,m.spotLightMap.value=a.state.spotLightMap,m.pointShadowMatrix.value=a.state.pointShadowMatrix),r.currentProgram=p,r.uniformsList=null,p}function eQ(e){if(null===e.uniformsList){let t=e.currentProgram.getUniforms();e.uniformsList=rp.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function e0(e,t){let n=s.get(e);
382n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}ej.setAnimationLoop(function(e){eG&&eG(e)}),"u">typeof self&&ej.setContext(self),this.setAnimationLoop=function(e){eG=e,eF.setAnimationLoop(e),null===e?ej.stop():ej.start()},eF.addEventListener("sessionstart",eW),eF.addEventListener("sessionend",eX),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void v("WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===ea)return;let n=!0===eF.enabled&&!0===eF.isPresenting,i=null!==ei&&(null===el||n)&&ei.begin(er,el);if(!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===eF.enabled&&!0===eF.isPresenting&&(null===ei||!1===ei.isCompositing())&&(!0===eF.cameraAutoUpdate&&eF.updateCamera(t),t=eF.getCamera()),!0===e.isScene&&e.onBeforeRender(er,e,t,el),(ee=S.get(e,en.length)).init(t),en.push(ee),eA.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),eE.setFromProjectionMatrix(eA,2e3,t.reversedDepth),ew=this.localClippingEnabled,eb=T.init(this.clippingPlanes,ew),(Q=M.get(e,et.length)).init(),et.push(Q),!0===eF.enabled&&!0===eF.isPresenting){let e=er.xr.getDepthSensingMesh();null!==e&&eY(e,t,-1/0,er.sortObjects)}eY(e,t,0,er.sortObjects),Q.finish(),!0===er.sortObjects&&Q.sort(ex,ey),(eD=!1===eF.enabled||!1===eF.isPresenting||!1===eF.hasDepthSensing())&&b.addToRenderList(Q,e),this.info.render.frame++,!0===eb&&T.beginShadows();let r=ee.state.shadowsArray;if(E.render(r,e,t),!0===eb&&T.endShadows(),!0===this.info.autoReset&&this.info.reset(),!1===(i&&ei.hasRenderPass())){let n=Q.opaque,i=Q.transmissive;if(ee.setupLights(),t.isArrayCamera){let r=t.cameras;if(i.length>0)for(let t=0,a=r.length;t<a;t++)eK(n,i,e,r[t]);eD&&b.render(e);for(let t=0,n=r.length;t<n;t++){let n=r[t];eq(Q,e,n,n.viewport)}}else i.length>0&&eK(n,i,e,t),eD&&b.render(e),eq(Q,e,t)}null!==el&&0===eo&&(o.updateMultisampleRenderTarget(el),o.updateRenderTargetMipmap(el)),i&&ei.end(er),!0===e.isScene&&e.onAfterRender(er,e,t),P.resetDefaultState(),ec=-1,eu=null,en.pop(),en.length>0?(ee=en[en.length-1],!0===eb&&T.setGlobalState(er.clippingPlanes,ee.state.camera)):ee=null,et.pop(),Q=et.length>0?et[et.length-1]:null},this.getActiveCubeFace=function(){return es},this.getActiveMipmapLevel=function(){return eo},this.getRenderTarget=function(){return el},this.setRenderTargetTextures=function(e,t,n){let i=s.get(e);i.__autoAllocateDepthBuffer=!1===e.resolveDepthBuffer,!1===i.__autoAllocateDepthBuffer&&(i.__useRenderToTexture=!1),s.get(e.texture).__webglTexture=t,s.get(e.depthTexture).__webglTexture=i.__autoAllocateDepthBuffer?void 0:n,i.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let n=s.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t};const e1=eN.createFramebuffer();this.setRenderTarget=function(e,t=0,n=0){el=e,es=t,eo=n;let i=null,a=!1,l=!1;if(e){let c=s.get(e);if(void 0!==c.__useDefaultFramebuffer){r.bindFramebuffer(eN.FRAMEBUFFER,c.__webglFramebuffer),eh.copy(e.viewport),ed.copy(e.scissor),ef=e.scissorTest,r.viewport(eh),r.scissor(ed),r.setScissorTest(ef),ec=-1;return}if(void 0===c.__webglFramebuffer)o.setupRenderTarget(e);else if(c.__hasExternalTextures)o.rebindTextures(e,s.get(e.texture).__webglTexture,s.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(c.__boundDepthTexture!==t){if(null!==t&&s.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");o.setupDepthRenderbuffer(e)}}let u=e.texture;(u.isData3DTexture||u.isDataArrayTexture||u.isCompressedArrayTexture)&&(l=!0);let h=s.get(e).__webglFramebuffer;
382e.isWebGLCubeRenderTarget?(i=Array.isArray(h[t])?h[t][n]:h[t],a=!0):i=e.samples>0&&!1===o.useMultisampledRTT(e)?s.get(e).__webglMultisampledFramebuffer:Array.isArray(h)?h[n]:h,eh.copy(e.viewport),ed.copy(e.scissor),ef=e.scissorTest}else eh.copy(eM).multiplyScalar(ev).floor(),ed.copy(eS).multiplyScalar(ev).floor(),ef=eT;if(0!==n&&(i=e1),r.bindFramebuffer(eN.FRAMEBUFFER,i)&&r.drawBuffers(e,i),r.viewport(eh),r.scissor(ed),r.setScissorTest(ef),a){let i=s.get(e.texture);eN.framebufferTexture2D(eN.FRAMEBUFFER,eN.COLOR_ATTACHMENT0,eN.TEXTURE_CUBE_MAP_POSITIVE_X+t,i.__webglTexture,n)}else if(l)for(let i=0;i<e.textures.length;i++){let r=s.get(e.textures[i]);eN.framebufferTextureLayer(eN.FRAMEBUFFER,eN.COLOR_ATTACHMENT0+i,r.__webglTexture,n,t)}else if(null!==e&&0!==n){let t=s.get(e.texture);eN.framebufferTexture2D(eN.FRAMEBUFFER,eN.COLOR_ATTACHMENT0,eN.TEXTURE_2D,t.__webglTexture,n)}ec=-1},this.readRenderTargetPixels=function(e,t,n,a,o,l,c,u=0){if(!(e&&e.isWebGLRenderTarget))return void v("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let h=s.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==c&&(h=h[c]),h){r.bindFramebuffer(eN.FRAMEBUFFER,h);try{let r=e.textures[u],s=r.format,c=r.type;if(e.textures.length>1&&eN.readBuffer(eN.COLOR_ATTACHMENT0+u),!i.textureFormatReadable(s))return void v("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!i.textureTypeReadable(c))return void v("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-a&&n>=0&&n<=e.height-o&&eN.readPixels(t,n,a,o,C.convert(s),C.convert(c),l)}finally{let e=null!==el?s.get(el).__webglFramebuffer:null;r.bindFramebuffer(eN.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,a,o,l,c,u=0){if(!(e&&e.isWebGLRenderTarget))throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let h=s.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==c&&(h=h[c]),h)if(t>=0&&t<=e.width-a&&n>=0&&n<=e.height-o){var d;r.bindFramebuffer(eN.FRAMEBUFFER,h);let c=e.textures[u],f=c.format,p=c.type;if(e.textures.length>1&&eN.readBuffer(eN.COLOR_ATTACHMENT0+u),!i.textureFormatReadable(f))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!i.textureTypeReadable(p))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let m=eN.createBuffer();eN.bindBuffer(eN.PIXEL_PACK_BUFFER,m),eN.bufferData(eN.PIXEL_PACK_BUFFER,l.byteLength,eN.STREAM_READ),eN.readPixels(t,n,a,o,C.convert(f),C.convert(p),0);let g=null!==el?s.get(el).__webglFramebuffer:null;r.bindFramebuffer(eN.FRAMEBUFFER,g);let _=eN.fenceSync(eN.SYNC_GPU_COMMANDS_COMPLETE,0);return eN.flush(),await (d=eN,new Promise(function(e,t){setTimeout(function n(){switch(d.clientWaitSync(_,d.SYNC_FLUSH_COMMANDS_BIT,0)){case d.WAIT_FAILED:t();break;case d.TIMEOUT_EXPIRED:setTimeout(n,4);break;default:e()}},4)})),eN.bindBuffer(eN.PIXEL_PACK_BUFFER,m),eN.getBufferSubData(eN.PIXEL_PACK_BUFFER,0,l),eN.deleteBuffer(m),eN.deleteSync(_),l}else throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(e,t=null,n=0){let i=Math.pow(2,-n),a=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i),l=null!==t?t.x:0,c=null!==t?t.y:0;o.setTexture2D(e,0),eN.copyTexSubImage2D(eN.TEXTURE_2D,n,0,0,l,c,a,s),r.unbindTexture()};const e3=eN.createFramebuffer(),e2=eN.createFramebuffer();this.copyTextureToTexture=function(e,t,n=null,i=null,a=0,l=0){let c,u,h,d,f,p,m,g,_,v,x=e.isCompressedTexture?e.mipmaps[l]:e.image;if(null!==n)c=n.max.x-n.min.x,u=n.max.y-n.min.y,h=n.isBox3?n.max.z-n.min.z:1,d=n.min.x,f=n.min.y,p=n.isBox3?n.min.z:0;else{let t=Math.pow(2,-a);c=Math.floor(x.width*t),u=Math.floor(x.height*t),h=e.isDataArrayTexture?x.depth:e.isData3DTexture?Math.floor(x.depth*t):1,d=0,f=0,p=0}null!==i?(m=i.x,g=i.y,_=i.z):(m=0,g=0,_=0);let y=C.convert(t.format),M=C.convert(t.type);t.isData3DTexture?(o.setTexture3D(t,0),v=eN.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(o.setTexture2DArray(t,0),v=eN.TEXTURE_2D_ARRAY):(o.setTexture2D(t,0),v=eN.TEXTURE_2D),eN.pixelStorei(eN.UNPACK_FLIP_Y_WEBGL,t.flipY),eN.pixelStorei(eN.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),eN.pixelStorei(eN.UNPACK_ALIGNMENT,t.unpackAlignment);let S=eN.getParameter(eN.UNPACK_ROW_LENGTH),T=eN.getParameter(eN.UNPACK_IMAGE_HEIGHT),E=eN.getParameter(eN.UNPACK_SKIP_PIXELS),b=eN.getParameter(eN.UNPACK_SKIP_ROWS),w=eN.getParameter(eN.UNPACK_SKIP_IMAGES);eN.pixelStorei(eN.UNPACK_ROW_LENGTH,x.width),eN.pixelStorei(eN.UNPACK_IMAGE_HEIGHT,x.height),eN.pixelStorei(eN.UNPACK_SKIP_PIXELS,d),eN.pixelStorei(eN.UNPACK_SKIP_ROWS,f),eN.pixelStorei(eN.UNPACK_SKIP_IMAGES,p);let A=e.isDataArrayTexture||e.isData3DTexture,R=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=s.get(e),i=s.get(t),o=s.get(n.__renderTarget),v=s.get(i.__renderTarget);
382r.bindFramebuffer(eN.READ_FRAMEBUFFER,o.__webglFramebuffer),r.bindFramebuffer(eN.DRAW_FRAMEBUFFER,v.__webglFramebuffer);for(let n=0;n<h;n++)A&&(eN.framebufferTextureLayer(eN.READ_FRAMEBUFFER,eN.COLOR_ATTACHMENT0,s.get(e).__webglTexture,a,p+n),eN.framebufferTextureLayer(eN.DRAW_FRAMEBUFFER,eN.COLOR_ATTACHMENT0,s.get(t).__webglTexture,l,_+n)),eN.blitFramebuffer(d,f,c,u,m,g,c,u,eN.DEPTH_BUFFER_BIT,eN.NEAREST);r.bindFramebuffer(eN.READ_FRAMEBUFFER,null),r.bindFramebuffer(eN.DRAW_FRAMEBUFFER,null)}else if(0!==a||e.isRenderTargetTexture||s.has(e)){let n=s.get(e),i=s.get(t);r.bindFramebuffer(eN.READ_FRAMEBUFFER,e3),r.bindFramebuffer(eN.DRAW_FRAMEBUFFER,e2);for(let e=0;e<h;e++)A?eN.framebufferTextureLayer(eN.READ_FRAMEBUFFER,eN.COLOR_ATTACHMENT0,n.__webglTexture,a,p+e):eN.framebufferTexture2D(eN.READ_FRAMEBUFFER,eN.COLOR_ATTACHMENT0,eN.TEXTURE_2D,n.__webglTexture,a),R?eN.framebufferTextureLayer(eN.DRAW_FRAMEBUFFER,eN.COLOR_ATTACHMENT0,i.__webglTexture,l,_+e):eN.framebufferTexture2D(eN.DRAW_FRAMEBUFFER,eN.COLOR_ATTACHMENT0,eN.TEXTURE_2D,i.__webglTexture,l),0!==a?eN.blitFramebuffer(d,f,c,u,m,g,c,u,eN.COLOR_BUFFER_BIT,eN.NEAREST):R?eN.copyTexSubImage3D(v,l,m,g,_+e,d,f,c,u):eN.copyTexSubImage2D(v,l,m,g,d,f,c,u);r.bindFramebuffer(eN.READ_FRAMEBUFFER,null),r.bindFramebuffer(eN.DRAW_FRAMEBUFFER,null)}else R?e.isDataTexture||e.isData3DTexture?eN.texSubImage3D(v,l,m,g,_,c,u,h,y,M,x.data):t.isCompressedArrayTexture?eN.compressedTexSubImage3D(v,l,m,g,_,c,u,h,y,x.data):eN.texSubImage3D(v,l,m,g,_,c,u,h,y,M,x):e.isDataTexture?eN.texSubImage2D(eN.TEXTURE_2D,l,m,g,c,u,y,M,x.data):e.isCompressedTexture?eN.compressedTexSubImage2D(eN.TEXTURE_2D,l,m,g,x.width,x.height,y,x.data):eN.texSubImage2D(eN.TEXTURE_2D,l,m,g,c,u,y,M,x);eN.pixelStorei(eN.UNPACK_ROW_LENGTH,S),eN.pixelStorei(eN.UNPACK_IMAGE_HEIGHT,T),eN.pixelStorei(eN.UNPACK_SKIP_PIXELS,E),eN.pixelStorei(eN.UNPACK_SKIP_ROWS,b),eN.pixelStorei(eN.UNPACK_SKIP_IMAGES,w),0===l&&t.generateMipmaps&&eN.generateMipmap(v),r.unbindTexture()},this.initRenderTarget=function(e){void 0===s.get(e).__webglFramebuffer&&o.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?o.setTextureCube(e,0):e.isData3DTexture?o.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?o.setTexture2DArray(e,0):o.setTexture2D(e,0),r.unbindTexture()},this.resetState=function(){es=0,eo=0,el=null,r.reset(),P.reset()},"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return 2e3}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=B._getDrawingBufferColorSpace(e),t.unpackColorSpace=B._getUnpackColorSpace()}}var al=e.i(47163);function ac({width:e="100%",height:t="100%",cameraZ:n=125,planeSize:i=256,speed:r=.5,flowSpeed:a=30,displacementScale:l=1,opacityBoost:c=1,className:u}){let h=(0,o.useRef)(null),d=(0,o.useRef)(null);return(0,o.useEffect)(()=>{let e=h.current,t=d.current;if(!e||!t)return;let s=new ao({canvas:e,antialias:!1,alpha:!0,powerPreference:"high-performance"}),o=new eI,u=new nN(45,1,1,1e4),f=performance.now(),p=new class{uniforms;mesh;time;constructor(){this.uniforms={time:{value:0},flowSpeed:{value:a},displacementScale:{value:l},opacityBoost:{value:c}},this.mesh=this.createMesh(),this.time=r}createMesh(){return new tV(new nl(i,i,i,i),new nf({uniforms:this.uniforms,vertexShader:` 383 #define GLSLIFY 1 384 attribute vec3 position; 385 uniform mat4 projectionMatrix; 386 uniform mat4 modelViewMatrix; 387 uniform float time; 388 uniform float flowSpeed; 389 uniform float displacementScale; 390 varying vec3 vPosition; 391 392 mat4 rotateMatrixX(float radian) { 393 return mat4( 394 1.0, 0.0, 0.0, 0.0, 395 0.0, cos(radian), -sin(radian), 0.0, 396 0.0, sin(radian), cos(radian), 0.0, 397 0.0, 0.0, 0.0, 1.0 398 ); 399 } 400 401 vec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
402 vec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; } 403 vec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); } 404 vec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; } 405 vec3 fade(vec3 t) { return t*t*t*(t*(t*6.0-15.0)+10.0); } 406 407 float cnoise(vec3 P) { 408 vec3 Pi0 = floor(P); 409 vec3 Pi1 = Pi0 + vec3(1.0); 410 Pi0 = mod289(Pi0); 411 Pi1 = mod289(Pi1); 412 vec3 Pf0 = fract(P); 413 vec3 Pf1 = Pf0 - vec3(1.0); 414 vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); 415 vec4 iy = vec4(Pi0.yy, Pi1.yy); 416 vec4 iz0 = Pi0.zzzz; 417 vec4 iz1 = Pi1.zzzz; 418 419 vec4 ixy = permute(permute(ix) + iy); 420 vec4 ixy0 = permute(ixy + iz0); 421 vec4 ixy1 = permute(ixy + iz1); 422 423 vec4 gx0 = ixy0 * (1.0 / 7.0); 424 vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5; 425 gx0 = fract(gx0); 426 vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); 427 vec4 sz0 = step(gz0, vec4(0.0)); 428 gx0 -= sz0 * (step(0.0, gx0) - 0.5); 429 gy0 -= sz0 * (step(0.0, gy0) - 0.5); 430 431 vec4 gx1 = ixy1 * (1.0 / 7.0); 432 vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5; 433 gx1 = fract(gx1); 434 vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); 435 vec4 sz1 = step(gz1, vec4(0.0)); 436 gx1 -= sz1 * (step(0.0, gx1) - 0.5); 437 gy1 -= sz1 * (step(0.0, gy1) - 0.5); 438 439 vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); 440 vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); 441 vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); 442 vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); 443 vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); 444 vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); 445 vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); 446 vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); 447 448 vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); 449 g000 *= norm0.x; 450 g010 *= norm0.y; 451 g100 *= norm0.z; 452 g110 *= norm0.w; 453 vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); 454 g001 *= norm1.x; 455 g011 *= norm1.y; 456 g101 *= norm1.z; 457 g111 *= norm1.w; 458 459 float n000 = dot(g000, Pf0); 460 float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); 461 float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); 462 float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); 463 float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); 464 float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); 465 float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); 466 float n111 = dot(g111, Pf1); 467 468 vec3 fade_xyz = fade(Pf0); 469 vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); 470 vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); 471 float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); 472 return 2.2 * n_xyz; 473 } 474 475 void main(void) { 476 vec3 updatePosition = (rotateMatrixX(radians(90.0)) * vec4(position, 1.0)).xyz; 477 float sin1 = sin(radians(updatePosition.x / 128.0 * 90.0)); 478 vec3 noisePosition = updatePosition + vec3(0.0, 0.0, time * -flowSpeed); 479 float noise1 = cnoise(noisePosition * 0.08); 480 float noise2 = cnoise(noisePosition * 0.06); 481 float noise3 = cnoise(noisePosition * 0.4); 482 float disp = displacementScale * ( 483 noise1 * sin1 * 8.0 484 + noise2 * sin1 * 8.0 485 + noise3 * (abs(sin1) * 2.0 + 0.5) 486 + pow(sin1, 2.0) * 40.0 487 ); 488 vec3 lastPosition = updatePosition + vec3(0.0, disp, 0.0); 489 490 vPosition = lastPosition; 491 gl_Position = projectionMatrix * modelViewMatrix * vec4(lastPosition, 1.0
491); 492 } 493 `,fragmentShader:` 494 precision highp float; 495 #define GLSLIFY 1 496 uniform float opacityBoost; 497 varying vec3 vPosition; 498 499 void main(void) { 500 float base = (96.0 - length(vPosition)) / 256.0; 501 float opacity = clamp(base * 0.85 * opacityBoost, 0.0, 0.98); 502 vec3 color = vec3(0.78 + base * 0.12); 503 gl_FragColor = vec4(color, opacity); 504 } 505 `,transparent:!0}))}render(e){this.uniforms.time.value+=e*this.time}},m=0,g=!1,_=()=>{if(g||!t)return;let e=Math.max(1,Math.floor(t.clientWidth)),n=Math.max(1,Math.floor(t.clientHeight));u.aspect=e/n,u.updateProjectionMatrix(),s.setPixelRatio(Math.min(window.devicePixelRatio,2)),s.setSize(e,n,!1)},v=()=>{g||((()=>{if(g)return;let e=performance.now(),t=(e-f)/1e3;f=e,p.render(t),s.render(o,u)})(),m=requestAnimationFrame(v))},x=new ResizeObserver(()=>{_()});return x.observe(t),s.setClearColor(0,0),u.position.set(0,16,n),u.lookAt(new D(0,28,0)),o.add(p.mesh),window.addEventListener("resize",_),_(),m=requestAnimationFrame(v),()=>{g=!0,cancelAnimationFrame(m),window.removeEventListener("resize",_),x.disconnect(),o.remove(p.mesh),p.mesh.geometry.dispose();let e=p.mesh.material;Array.isArray(e)?e.forEach(e=>e.dispose()):e.dispose(),s.dispose()}},[n,i,r,a,l,c]),(0,s.jsx)("div",{ref:d,className:(0,al.cn)("relative min-h-[12rem] w-full",u),style:{width:"number"==typeof e?`${e}px`:e,height:"number"==typeof t?`${t}px`:t},children:(0,s.jsx)("canvas",{ref:h,className:"absolute inset-0 z-[1] h-full w-full","aria-hidden":!0})})}e.s(["FooterHillsBackdrop",0,function(){let[e,t]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{let e=window.matchMedia("(prefers-reduced-motion: reduce)"),n=()=>t(!e.matches);return n(),e.addEventListener("change",n),()=>e.removeEventListener("change",n)},[]),(0,s.jsxs)("div",{className:"pointer-events-none absolute inset-0 z-0 min-h-full overflow-hidden","aria-hidden":!0,children:[e?(0,s.jsx)("div",{className:"absolute inset-0",children:(0,s.jsx)(ac,{width:"100%",height:"100%",cameraZ:102,planeSize:256,speed:.95,flowSpeed:52,displacementScale:1.35,opacityBoost:1.65,className:"!min-h-0 h-full w-full"})}):(0,s.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-[#e8e4dc] via-[#f0ebe3] to-[#e5dfd4]"}),(0,s.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-[#faf8f3]/92 via-[#f5f0e8]/90 to-[#efe8dc]/93"}),(0,s.jsx)("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_95%_75%_at_50%_-5%,rgba(201,168,76,0.06),transparent_50%)]"})]})}],44820)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.