/*! For license information please see main.d2700.js.LICENSE.txt */ !function(){var __webpack_modules__={248:function(module,exports,__webpack_require__){"undefined"!=typeof navigator&&function(e){module.exports=e()}(function(){"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(e){_useWebWorker=!!e},getWebWorker=function(){return _useWebWorker},setLocationHref=function(e){locationHref=e},getLocationHref=function(){return locationHref};function createTag(e){return document.createElement(e)}function extendPrototype(e,t){for(var r,n=e.length,i=0;it[0]||!(t[0]>e[0])&&(e[1]>t[1]||!(t[1]>e[1])&&(e[2]>t[2]||(t[2],void e[2])))}n=[4,4,14];var n,a=function(e){if(i(n,e.v)&&(o(e.layers),e.assets))for(var t=e.assets.length,r=0;rthis.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));for(var t,r=this.animationData.layers,n=r.length,i=e.layers,a=i.length,o=0;othis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},AnimationItem.prototype.play=function(e){e&&this.name!==e||!0===this.isPaused&&(this.isPaused=!1,this.trigger("_pause"),this.audioController.resume(),this._idle)&&(this._idle=!1,this.trigger("_active"))},AnimationItem.prototype.pause=function(e){e&&this.name!==e||!1===this.isPaused&&(this.isPaused=!0,this.trigger("_play"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(e){e&&this.name!==e||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(e){for(var t,r=0;r=this.totalFrames-1&&0=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(t=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(t=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),t)&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))},AnimationItem.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(e,t){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFramet&&(r=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),"object"===_typeof$4(e[0]))for(var r=e.length,n=0;no?-1:1,u=!0;u;)if(n[a]<=o&&n[a+1]>o?(s=(o-n[a])/(n[a+1]-n[a]),u=!1):a+=l,a<0||i-1<=a){if(a===i-1)return r[a];u=!1}return r[a]+(r[a+1]-r[a])*s}var D=createTypedArray("float32",8);return{getSegmentsLength:function(e){for(var t=segmentsLengthPool.newElement(),r=e.c,n=e.v,i=e.o,a=e.i,o=e._length,s=t.lengths,l=0,u=0;u=i.t-o){n.h&&(n=i),s=0;break}if(i.t-o>e){s=l;break}l=r&&r<=e||this._caching.lastFrame=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0),r=this.interpolateValue(e,this._caching),this.pv=r),this._caching.lastFrame=e,this.pv}function f(e){var t;if("unidimensional"===this.propType)t=e*this.mult,1e-5=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}a[n]&&(!a[n]||i)||(a[n]=pointPool.newElement()),a[n][0]=e,a[n][1]=t},ShapePath.prototype.setTripleAt=function(e,t,r,n,i,a,o,s){this.setXYAt(e,t,"v",o,s),this.setXYAt(r,n,"o",o,s),this.setXYAt(i,a,"i",o,s)},ShapePath.prototype.reverse=function(){for(var e=new ShapePath,t=(e.setPathData(this.c,this._length),this.v),r=this.o,n=this.i,i=0,a=(this.c&&(e.setTripleAt(t[0][0],t[0][1],n[0][0],n[0][1],r[0][0],r[0][1],0,!1),i=1),this._length-1),o=this._length,s=i;s=h[h.length-1].t-this.offsetTime)n=(h[h.length-1].s?h[h.length-1].s:h[h.length-2].e)[0],i=!0;else{for(var p,d,f,m,g,v,y=c,b=h.length-1,x=!0;x&&(p=h[y],!((d=h[y+1]).t-this.offsetTime>e));)y=d.t-this.offsetTime?1:en+r||(a=o.s*i<=n?0:(o.s*i-n)/r,o=o.e*i>=n+r?1:(o.e*i-n)/r,l.push([a,o]));return l.length||l.push([0,0]),l},TrimModifier.prototype.releasePathsData=function(e){for(var t=e.length,r=0;rt.e){r.c=!1;break}t.s<=f&&t.e>=f+c.addedLength?(this.addSegment(p[n].v[i-1],p[n].o[i-1],p[n].i[i],p[n].v[i],r,o,g),g=!1):(l=bez.getNewSegment(p[n].v[i-1],p[n].v[i],p[n].o[i-1],p[n].i[i],(t.s-f)/c.addedLength,(t.e-f)/c.addedLength,s[i-1]),this.addSegmentFromArray(l,r,o,g),r.c=g=!1),f+=c.addedLength,o+=1}if(p[n].c&&s.length&&(c=s[i-1],f<=t.e?(u=s[i-1].addedLength,t.s<=f&&t.e>=f+u?(this.addSegment(p[n].v[i-1],p[n].o[i-1],p[n].i[0],p[n].v[0],r,o,g),g=!1):(l=bez.getNewSegment(p[n].v[i-1],p[n].v[0],p[n].o[i-1],p[n].i[0],(t.s-f)/u,(t.e-f)/u,s[i-1]),this.addSegmentFromArray(l,r,o,g),r.c=g=!1)):r.c=!1,f+=c.addedLength,o+=1),r._length&&(r.setXYAt(r.v[v][0],r.v[v][1],"i",v),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),f>t.e)break;n=this.p.keyframes[this.p.keyframes.length-1].t?(t=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/e,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/e,0)):(t=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/e,this.p.offsetTime)):this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime?(t=[],r=[],n=this.px,i=this.py,n._caching.lastFrame+n.offsetTime<=n.keyframes[0].t?(t[0]=n.getValueAtTime((n.keyframes[0].t+.01)/e,0),t[1]=i.getValueAtTime((i.keyframes[0].t+.01)/e,0),r[0]=n.getValueAtTime(n.keyframes[0].t/e,0),r[1]=i.getValueAtTime(i.keyframes[0].t/e,0)):n._caching.lastFrame+n.offsetTime>=n.keyframes[n.keyframes.length-1].t?(t[0]=n.getValueAtTime(n.keyframes[n.keyframes.length-1].t/e,0),t[1]=i.getValueAtTime(i.keyframes[i.keyframes.length-1].t/e,0),r[0]=n.getValueAtTime((n.keyframes[n.keyframes.length-1].t-.01)/e,0),r[1]=i.getValueAtTime((i.keyframes[i.keyframes.length-1].t-.01)/e,0)):(t=[n.pv,i.pv],r[0]=n.getValueAtTime((n._caching.lastFrame+n.offsetTime-.01)/e,n.offsetTime),r[1]=i.getValueAtTime((i._caching.lastFrame+i.offsetTime-.01)/e,i.offsetTime))):t=r=a,this.v.rotate(-Math.atan2(t[1]-r[1],t[0]-r[0]))),this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])),this.frameId=this.elem.globalData.frameId)},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],n),n.prototype.addDynamicProperty=function(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0},n.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(e,t,r){return new n(e,t,r)}}}();function RepeaterModifier(){}function RoundCornersModifier(){}function floatEqual(e,t){return 1e5*Math.abs(e-t)<=Math.min(Math.abs(e),Math.abs(t))}function floatZero(e){return Math.abs(e)<=1e-5}function lerp(e,t,r){return e*(1-r)+t*r}function lerpPoint(e,t,r){return[lerp(e[0],t[0],r),lerp(e[1],t[1],r)]}function quadRoots(e,t,r){return 0===e||(r=t*t-4*e*r)<0?[]:(t=-t/(2*e),0==r?[t]:[t-(r=Math.sqrt(r)/(2*e)),t+r])}function polynomialCoefficients(e,t,r,n){return[3*t-e-3*r+n,3*e-6*t+3*r,-3*e+3*t,e]}function singlePoint(e){return new PolynomialBezier(e,e,e,e,!1)}function PolynomialBezier(e,t,r,n,i){i&&pointEqual(e,t)&&(t=lerpPoint(e,n,1/3)),i&&pointEqual(r,n)&&(r=lerpPoint(e,n,2/3));var i=polynomialCoefficients(e[0],t[0],r[0],n[0]),a=polynomialCoefficients(e[1],t[1],r[1],n[1]);this.a=[i[0],a[0]],this.b=[i[1],a[1]],this.c=[i[2],a[2]],this.d=[i[3],a[3]],this.points=[e,t,r,n]}function extrema(e,t){for(var r,n,i=e.points[0][t],a=e.points[e.points.length-1][t],o=(ae?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){for(var e=this.renderableComponents.length,t=0;te-this.layers[t].st&&this.buildItem(t),this.completeLayers=!!this.elements[t]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e);default:return this.createNull(e)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(e){return new AudioElement(e,this.globalData,this)},BaseRenderer.prototype.createFootage=function(e){return new FootageElement(e,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){for(var e=this.layers.length,t=0;tt);)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(e){for(var t,r,n=[],i=0,a=e.length,o=!1;ithis.minimumFontSize&&B=u(i)?s(0,l(e-i<0?l(a,1)-(i-e):a-e,1)):n),100!==this.sm.v&&(n<(r=.5-.5*(t=0===(t=.01*this.sm.v)?1e-8:t))?n=0:1<(n=(n-r)/t)&&(n=1)),n*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,t=this.o.v/e,r=this.s.v/e+t,e=this.e.v/e+t;e=s.length&&(i=0,s=l[a+=1]?l[a].points:c.v.c?l[a=i=0].points:(n-=r.partialLength,null)),s)&&(o=r,N=(r=s[i]).partialLength);S=m[x].an/2-m[x].add,f.translate(-S,0,0)}else S=m[x].an/2-m[x].add,f.translate(-S,0,0),f.translate(-h[0]*m[x].an*.005,-h[1]*K*.01,0);for(R=0;R=e.x+e.width&&this.currentBBox.height+this.currentBBox.y>=e.y+e.height},HShapeElement.prototype.renderInnerContent=function(){var e,t;this._renderShapeFrame(),this.hidden||!this._isFirstFrame&&!this._mdf||((t=this.tempBoundingBox).x=e=999999,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax=e)return this.threeDElements[t].perspectiveElem;t+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(e,t){var r,n=createTag("div"),i=(styleDiv(n),createTag("div")),a=(styleDiv(i),"3d"===t&&((a=n.style).width=this.globalData.compSize.w+"px",a.height=this.globalData.compSize.h+"px",a.webkitTransformOrigin=r="50% 50%",a.mozTransformOrigin=r,a.transformOrigin=r,(a=i.style).transform=r="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)",a.webkitTransform=r),n.appendChild(i),{container:i,perspectiveElem:n,startPos:e,endPos:e,type:t});return this.threeDElements.push(a),a},HybridRendererBase.prototype.build3dContainers=function(){for(var e,t=this.layers.length,r="",n=0;n>>=1;return(e+r)/t}var i=[],e=b(function e(t,r){var n,i=[],a=_typeof$1(t);if(r&&"object"==a)for(n in t)try{i.push(e(t[n],r-1))}catch(e){}return i.length?i:"string"==a?t:t+"\0"}((t=!0===t?{entropy:!0}:t||{}).entropy?[e,x(o)]:null===e?function(){try{return l?x(l.randomBytes(c)):(t=new Uint8Array(c),(u.crypto||u.msCrypto).getRandomValues(t),x(t))}catch(e){var t=u.navigator,t=t&&t.plugins;return[+new Date,u,t,u.screen,x(o)]}}():e,3),i),a=new v(i);return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,b(x(a.S),o),(t.pass||r||function(e,t,r,n){return n&&(n.S&&y(n,a),e.state=function(){return y(a,{})}),r?(s[p]=e,t):e})(n,e,"global"in t?t.global:this==s,t.state)},b(s.random(),o)}function initialize$2(e){seedRandom([],e)}var propTypes={SHAPE:"shape"};function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null;function $bm_isInstanceOfArray(e){return e.constructor===Array||e.constructor===Float32Array}function isNumerable(e,t){return"number"===e||"boolean"===e||"string"===e||t instanceof Number}function $bm_neg(e){var t=_typeof(e);if("number"===t||"boolean"===t||e instanceof Number)return-e;if($bm_isInstanceOfArray(e)){for(var r=e.length,n=[],i=0;idata.k[t].t&&edata.k[t+1].t-e?(r=t+2,data.k[t+1]):(r=t+1,data.k[t])).t;break}}-1===r&&(r=t+1,n=data.k[t].t)}else n=r=0;var a={};return a.index=r,a.time=n/elem.comp.globalData.frameRate,a}function key(e){if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+e);for(var t={time:data.k[--e].t/elem.comp.globalData.frameRate,value:[]},r=Object.prototype.hasOwnProperty.call(data.k[e],"s")?data.k[e].s:data.k[e-1].e,n=r.length,i=0;iu.length-1)&&(t=u.length-1),n=c-(i=u[u.length-1-t].t)),"pingpong"===e){if(Math.floor((l-i)/n)%2!=0)return this.getValueAtTime((n-(l-i)%n+i)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var h=this.getValueAtTime(i/this.comp.globalData.frameRate,0),p=this.getValueAtTime(c/this.comp.globalData.frameRate,0),d=this.getValueAtTime(((l-i)%n+i)/this.comp.globalData.frameRate,0),f=Math.floor((l-i)/n);if(this.pv.length){for(o=(s=new Array(h.length)).length,a=0;au.length-1?u.length-1:t].t)-c,"pingpong"===e){if(Math.floor((c-l)/n)%2==0)return this.getValueAtTime(((c-l)%n+c)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var h=this.getValueAtTime(c/this.comp.globalData.frameRate,0),p=this.getValueAtTime(i/this.comp.globalData.frameRate,0),d=this.getValueAtTime((n-(c-l)%n+c)/this.comp.globalData.frameRate,0),f=Math.floor((c-l)/n)+1;if(this.pv.length){for(o=(s=new Array(h.length)).length,a=0;ai){var l=a,u=r.c&&a===o-1?0:a+1,c=(i-s)/n[a].addedLength,h=bez.getPointInSegment(r.v[l],r.v[u],r.o[l],r.i[u],c,n[a]);break}s+=n[a].addedLength,a+=1}return h=h||(r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]])},vectorOnPath:function(e,t,r){1==e?e=this.v.c:0==e&&(e=.999);var n=this.pointOnPath(e,t),e=this.pointOnPath(e+.001,t),t=e[0]-n[0],e=e[1]-n[1],n=Math.sqrt(Math.pow(t,2)+Math.pow(e,2));return 0===n?[0,0]:"tangent"===r?[t/n,e/n]:[-e/n,t/n]},tangentOnPath:function(e,t){return this.vectorOnPath(e,t,"tangent")},normalOnPath:function(e,t){return this.vectorOnPath(e,t,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([r],e),extendPrototype([r],t),t.prototype.getValueAtTime=function(e){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),(e=(e*=this.elem.globalData.frameRate)-this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime
\x3c!--\x3e
\x3c!-->e/4).toString(16)}catch(e){return""}}),$={categories:o,level:o,revision:x.revision,data:g,rfc_cookie:x.use_rfc_cookie,consent_date:u.toISOString(),consent_uuid:h},(Q||0<_.length)&&(R=!0,c=c?new Date:u,$.last_consent_update=c.toISOString(),C=me(fe()),ge(x.cookie_name,JSON.stringify($)),de()),Q&&(x.autoclear_cookies&&E(!0),"function"==typeof D&&D(K.getUserPreferences(),$),"function"==typeof P&&P($),Q=!1,"opt-in"===x.mode)||("function"==typeof T&&0<_.length&&T($,_),F&&window.location.reload())},K.eraseCookies=function(e,t,r){var n=[],r=r?[r,"."+r]:[x.cookie_domain,"."+x.cookie_domain];if("object"==typeof e&&0{if("undefined"!=typeof document){var e=B[0],t={};for(const i of B)if(i?.[1]in document){for(var[r,n]of i.entries())t[e[r]]=n;return t}}return!1})(),r={change:N.fullscreenchange,error:N.fullscreenerror};let z={request(i=document.documentElement,a){return new Promise((e,t)=>{const r=()=>{z.off("change",r),e()};z.on("change",r);var n=i[N.requestFullscreen](a);n instanceof Promise&&n.then(r).catch(t)})},exit(){return new Promise((e,t)=>{if(z.isFullscreen){const n=()=>{z.off("change",n),e()};z.on("change",n);var r=document[N.exitFullscreen]();r instanceof Promise&&r.then(n).catch(t)}else e()})},toggle(e,t){return z.isFullscreen?z.exit():z.request(e,t)},onchange(e){z.on("change",e)},onerror(e){z.on("error",e)},on(e,t){e=r[e];e&&document.addEventListener(e,t,!1)},off(e,t){e=r[e];e&&document.removeEventListener(e,t,!1)},raw:N};Object.defineProperties(z,{isFullscreen:{get:()=>Boolean(document[N.fullscreenElement])},element:{enumerable:!0,get:()=>document[N.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>Boolean(document[N.fullscreenEnabled])}}),N||(z={isEnabled:!1});function V(e,t){var r,n,i,a,o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(o)return n=!(r=!0),{s:function(){o=o.call(e)},n:function(){var e=o.next();return r=e.done,e},e:function(e){n=!0,i=e},f:function(){try{r||null==o.return||o.return()}finally{if(n)throw i}}};if(Array.isArray(e)||(o=H(e))||t&&e&&"number"==typeof e.length)return o&&(e=o),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||H(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e,t){var r;if(e)return"string"==typeof e?n(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=rt(r,lt))&&(nt(r,ct,t),nt(r,ht,e),r.update())}}),et(this,"didStart",function(){}),et(this,"didResume",function(){}),et(this,"didPause",function(){}),et(this,"doUpdate",function(){}),et(this,"resize",function(){}),nt(this,ut,1e3/t)});function ft(e){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mt(e){return function(e){if(Array.isArray(e))return gt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){var r;if(e)return"string"==typeof e?gt(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gt(e,t):void 0}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r":">")}}function Rr(e,t,r,n){var i,a,o=Gr(e.childNodes),s=o.length,l=Wr(t);if(3!==e.nodeType||1",v=1,y=t.specialChars?"function"==typeof t.specialChars?t.specialChars:qr:null,d=Fr.createElement("div"),b=e.parentNode;for(b.insertBefore(d,e),d.textContent=e.nodeValue,b.removeChild(e),d=-1!==(i=function e(t){var r=t.nodeType,n="";if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=e(t)}else if(3===r||4===r)return t.nodeValue;return n}(e=d)).indexOf("<"),!1!==t.reduceWhiteSpace&&(i=i.replace(Vr," ").replace(zr,"")),l=(i=d?i.split("<").join("{{LT}}"):i).length,a=(" "===i.charAt(0)?m:"")+r(),o=0;o":u,o+=c-1;else if(u===f&&i.charAt(o-1)!==f&&o){for(a+=v?g:"",v=0;i.charAt(o+1)===f;)a+=m,o++;o===l-1?a+=m:")"!==i.charAt(o+1)&&(a+=m+r(),v=1)}else"{"===u&&"{{LT}}"===i.substr(o,6)?(a+=p?n()+"{{LT}}":"{{LT}}",o+=5):55296<=u.charCodeAt(0)&&u.charCodeAt(0)<=56319||65024<=i.charCodeAt(o+1)&&i.charCodeAt(o+1)<=65039?(s=((i.substr(o,12).split(Ir)||[])[1]||"").length||2,a+=p&&" "!==u?n()+i.substr(o,s)+"":i.substr(o,s),o+=s-1):a+=p&&" "!==u?n()+u+"":u;e.outerHTML=a+(v?g:""),d&&Yr(b,"{{LT}}","<")},en=function(){function r(e,t){Nr||(Fr=document,Br=window,Nr=1),this.elements=Gr(e),this.chars=[],this.words=[],this.lines=[],this._originals=[],this.vars=t||{},this.split(t)}var e=r.prototype;return e.split=function(e){this.isSplit&&this.revert(),this.vars=e=e||this.vars,this._originals.length=this.chars.length=this.words.length=this.lines.length=0;for(var t=this.elements.length,r=e.tag||(e.span?"span":"div"),F=kr(e.wordsClass,r),B=kr(e.charsClass,r);-1<--t;){y=this.elements[t],this._originals[t]=y.innerHTML,g=y.clientHeight,m=y.clientWidth,Rr(y,e,F,B),f=d=p=h=c=u=l=s=o=a=i=n=R=k=L=I=O=A=C=D=T=P=E=M=G=H=U=j=V=S=w=_=x=void 0;var n,i,a,o,s,l,u,c,h,p,d,f,m,g,v=y,y=e,N=this.chars,z=this.words,b=this.lines,x=jr(v),_=$r("paddingLeft",x),w=-999,S=$r("borderBottomWidth",x)+$r("borderTopWidth",x),V=$r("borderLeftWidth",x)+$r("borderRightWidth",x),j=$r("paddingTop",x)+$r("paddingBottom",x),U=$r("paddingLeft",x)+$r("paddingRight",x),H=.2*$r("fontSize",x),G=x.textAlign,M=[],E=[],P=[],T=y.wordDelimiter||" ",D=y.tag||(y.span?"span":"div"),x=y.type||y.split||"chars,words,lines",C=b&&~x.indexOf("lines")?[]:null,A=~x.indexOf("words"),O=~x.indexOf("chars"),I=Wr(y),L=y.linesClass,k=~(L||"").indexOf("++"),R=[];for(k&&(L=L.split("++").join("")),a=(i=v.getElementsByTagName("*")).length,s=[],n=0;nH&&("BR"!==o.nodeName||0===n)&&(C.push(u=[]),w=f),I&&(o._x=o.offsetLeft,o._y=f,o._w=o.offsetWidth,o._h=o.offsetHeight),C)&&((o._isSplit&&l||!O&&l||A&&l||!A&&o.parentNode.parentNode===v&&!o.parentNode._isSplit)&&(u.push(o),o._x-=_,Jr(o,v,T))&&(o._wordEnd=!0),"BR"===o.nodeName)&&(o.nextSibling&&"BR"===o.nextSibling.nodeName||0===n)&&C.push([]);for(n=0;nv.clientHeight&&(v.style.height=g-j+"px",v.clientHeightv.clientWidth)&&(v.style.width=m-U+"px",v.clientWidth(i=Math.abs(i))&&(a=n,s=i);return a}function Mn(e){return ia(e),e.scrollTrigger&&e.scrollTrigger.kill(!!An),e.progress()<1&&Oa(e,"onInterrupt"),e}function En(e,t){for(var r,n=e._first;n;)n instanceof To?En(n,t):!n.vars.yoyoEase||n._yoyo&&n._repeat||n._yoyo===t||(n.timeline?En(n.timeline,t):(r=n._ease,n._ease=n._yEase,n._yEase=r,n._yoyo=t)),n=n._next}function Pn(e,t,r,n){var i,a={easeIn:t,easeOut:r=void 0===r?function(e){return 1-t(1-e)}:r,easeInOut:n=void 0===n?function(e){return e<.5?t(2*e)/2:1-t(2*(1-e))/2}:n};qi(e,function(e){for(var t in D[e]=Pi[e]=a,D[i=e.toLowerCase()]=r,a)D[i+("easeIn"===t?".in":"easeOut"===t?".out":".inOut")]=D[e+"."+t]=a[t]})}function Tn(r,e,t){function n(e){return 1===e?1:i*Math.pow(2,-10*e)*ci((e-a)*o)+1}var i=1<=e?e:1,a=(o=(t||(r?.3:.45))/(e<1?e:1))/ai*(Math.asin(1/i)||0),t="out"===r?n:"in"===r?function(e){return 1-n(1-e)}:Ja(n),o=ai/o;return t.config=function(e,t){return Tn(r,e,t)},t}function Dn(t,r){function n(e){return e?--e*e*((r+1)*e+r)+1:0}void 0===r&&(r=1.70158);var e="out"===t?n:"in"===t?function(e){return 1-n(1-e)}:Ja(n);return e.config=function(e){return Dn(t,e)},e}var Cn,An,On,In,Ln,kn,Rn,Fn,Bn,Nn,zn,Vn,jn,Un,Hn,Gn,Wn,qn,Xn,Yn,Zn,Jn,Kn,$n,Qn,ei,ti={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},ri={duration:.5,overwrite:!1,delay:0},ni=1e8,ii=1/ni,ai=2*Math.PI,oi=ai/4,si=0,li=Math.sqrt,ui=Math.cos,ci=Math.sin,hi=function(e){return"string"==typeof e},pi=function(e){return"function"==typeof e},di=function(e){return"number"==typeof e},fi=function(e){return void 0===e},mi=function(e){return"object"==typeof e},gi=function(e){return!1!==e},vi="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},yi=Array.isArray,bi=/(?:-?\.?\d|\.)+/gi,xi=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,_i=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,wi=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Si=/[+-]=-?[.\d]+/,Mi=/[^,'"\[\]\s]+/gi,Ei=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Pi={},Ti={},Di=function(e,t){},Ci=function(e,t){return!t&&void 0},Ai=function(e,t){return e&&(Pi[e]=t)&&Ti&&(Ti[e]=t)||Pi},Oi=function(){return 0},Ii={suppressEvents:!0,isStart:!0,kill:!1},Li={suppressEvents:!0,kill:!1},ki={suppressEvents:!0},Ri={},Fi=[],Bi={},Ni={},zi={},Vi=30,ji=[],Ui="",Hi=function(e){var t,r,n=e[0];if(mi(n)||pi(n)||(e=[e]),!(t=(n._gsap||{}).harness)){for(r=ji.length;r--&&!ji[r].targetTest(n););t=ji[r]}for(r=e.length;r--;)e[r]&&(e[r]._gsap||(e[r]._gsap=new Eo(e[r],t)))||e.splice(r,1);return e},Gi=function(e){return e._gsap||Hi(Ma(e))[0]._gsap},Wi=function(e,t,r){return(r=e[t])&&pi(r)?e[t]():fi(r)&&e.getAttribute&&e.getAttribute(t)||r},qi=function(e,t){return(e=e.split(",")).forEach(t)||e},Xi=function(e){return Math.round(1e5*e)/1e5||0},Yi=function(e){return Math.round(1e7*e)/1e7||0},Zi=function(e,t){var r=t.charAt(0),t=parseFloat(t.substr(2));return e=parseFloat(e),"+"===r?e+t:"-"===r?e-t:"*"===r?e*t:e/t},Ji=function(){var e,t,r=Fi.length,n=Fi.slice(0);for(Bi={},e=Fi.length=0;ea;)o=o._prev;return o?(t._next=o._next,o._next=t):(t._next=e[r],e[r]=t),t._next?t._next._prev=t:e[n]=t,t._prev=o,t.parent=t._dp=e,t},na=function(e,t,r,n){void 0===r&&(r="_first"),void 0===n&&(n="_last");var i=t._prev,a=t._next;i?i._next=a:e[r]===t&&(e[r]=a),a?a._prev=i:e[n]===t&&(e[n]=i),t._next=t._prev=t.parent=null},ia=function(e,t){!e.parent||t&&!e.parent.autoRemoveChildren||e.parent.remove(e),e._act=0},aa=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var r=e;r;)r._dirty=1,r=r.parent;return e},oa=function(e,t,r,n){return e._startAt&&(An?e._startAt.revert(Li):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))},sa=function(e,t){t=Math.floor(e/=t);return e&&t===e?t-1:t},la=function(e,t){return(e-t._start)*t._ts+(0<=t._ts?0:t._dirty?t.totalDuration():t._tDur)},ua=function(e){return e._end=Yi(e._start+(e._tDur/Math.abs(e._ts||e._rts||ii)||0))},ca=function(e,t){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Yi(r._time-(0ii)&&t.render(r,!0),aa(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=ni?l.endTime(!1):t._dur;return hi(r)&&(isNaN(r)||r in s)?(a=r.charAt(0),o="%"===r.substr(-1),i=r.indexOf("="),"<"===a||">"===a?(0<=i&&(r=r.replace(/=/,"")),("<"===a?l._start:l.endTime(0<=l._repeat))+(parseFloat(r.substr(1))||0)*(o?(i<0?l:n).totalDuration()/100:1)):i<0?(r in s||(s[r]=u),s[r]):(a=parseFloat(r.charAt(i-1)+r.substr(i+1)),o&&n&&(a=a/100*(yi(n)?n[0]:n).totalDuration()),1>16,e>>8&Ia,e&Ia]:0:La.black;if(!c){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),La[e])c=La[e];else if("#"===e.charAt(0)){if(9===(e=e.length<6?"#"+(n=e.charAt(1))+n+(i=e.charAt(2))+i+(a=e.charAt(3))+a+(5===e.length?e.charAt(4)+e.charAt(4):""):e).length)return[(c=parseInt(e.substr(1,6),16))>>16,c>>8&Ia,c&Ia,parseInt(e.substr(7),16)/255];c=[(e=parseInt(e.substr(1),16))>>16,e>>8&Ia,e&Ia]}else if("hsl"===e.substr(0,3))if(c=u=e.match(bi),t){if(~e.indexOf("="))return c=e.match(xi),r&&c.length<4&&(c[3]=1),c}else o=+c[0]%360/360,s=+c[1]/100,n=2*(l=+c[2]/100)-(i=l<=.5?l*(s+1):l+s-l*s),3=t&&et)return n;n=n._next}else for(n=e._last;n&&n._start>=r;){if("isPause"===n.data&&n._start=b._start)&&b._ts&&l!==b){if(b.parent!==this)return this.render(e,t,r);if(b.render(0=this.totalDuration()||!g&&d)||c!==this._start&&Math.abs(u)===Math.abs(this._ts)||this._lock||(!e&&m||!(g===f&&0=n&&(a instanceof Fo?t&&i.push(a):(r&&i.push(a),e&&i.push.apply(i,a.getChildren(!0,t,r)))),a=a._next;return i},t.getById=function(e){for(var t=this.getChildren(1,1,1),r=t.length;r--;)if(t[r].vars.id===e)return t[r]},t.remove=function(e){return hi(e)?this.removeLabel(e):pi(e)?this.killTweensOf(e):(na(this,e),e===this._recent&&(this._recent=this._last),aa(this))},t.totalTime=function(e,t){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Yi(ja.time-(0t:!t||a.isActive())&&n.push(a):(r=a.getTweensOf(i,t)).length&&n.push.apply(n,r),a=a._next;return n},t.tweenTo=function(e,t){t=t||{};var r,n=this,i=va(n,e),e=t,a=e.startAt,o=e.onStart,s=e.onStartParams,e=e.immediateRender,l=Fo.to(n,$i({ease:t.ease||"none",lazy:!1,immediateRender:!1,time:i,overwrite:"auto",duration:t.duration||Math.abs((i-(a&&"time"in a?a.time:n._time))/n.timeScale())||ii,onStart:function(){var e;n.pause(),r||(e=t.duration||Math.abs((i-(a&&"time"in a?a.time:n._time))/n.timeScale()),l._dur!==e&&ma(l,e,0,1).render(l._time,!0,!0),r=1),o&&o.apply(l,s||[])}},t));return e?l.render(0):l},t.tweenFromTo=function(e,t,r){return this.tweenTo(t,$i({startAt:{time:va(this,e)}},r))},t.recent=function(){return this._recent},t.nextLabel=function(e){return void 0===e&&(e=this._time),Sn(this,va(this,e))},t.previousLabel=function(e){return void 0===e&&(e=this._time),Sn(this,va(this,e),1)},t.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+ii)},t.shiftChildren=function(e,t,r){void 0===r&&(r=0);for(var n,i=this._first,a=this.labels;i;)i._start>=r&&(i._start+=e,i._end+=e),i=i._next;if(t)for(n in a)a[n]>=r&&(a[n]+=e);return aa(this)},t.invalidate=function(e){var t=this._first;for(this._lock=0;t;)t.invalidate(e),t=t._next;return n.prototype.invalidate.call(this,e)},t.clear=function(e){void 0===e&&(e=!0);for(var t,r=this._first;r;)t=r._next,this.remove(r),r=t;return this._dp&&(this._time=this._tTime=this._pTime=0),e&&(this.labels={}),aa(this)},t.totalDuration=function(e){var t,r,n,i=0,a=this,o=a._last,s=ni;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-e:e));if(a._dirty){for(n=a.parent;o;)t=o._prev,o._dirty&&o.totalDuration(),s<(r=o._start)&&a._sort&&o._ts&&!a._lock?(a._lock=1,dn(a,o,r-o._delay,1)._lock=0):s=r,r<0&&o._ts&&(i-=r,(!n&&!a._dp||n&&n.smoothChildTiming)&&(a._start+=r/a._ts,a._time-=r,a._tTime-=r),a.shiftChildren(-r,!1,-1/0),s=0),o._end>i&&o._ts&&(i=o._end),o=t;ma(a,a===In&&a._time>i?a._time:i,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(e){if(In._ts&&(sn(In,la(e,In)),Bn=ja.frame),ja.frame>=Vi){Vi+=ti.autoSleep||120;var t=In._first;if((!t||!t._ts)&&ti.autoSleep&&ja._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||ja.sleep()}}},e}(Po)),Do=($i(To.prototype,{_lock:0,_hasPause:0,_forcing:0}),function(e,t,r,n,i,a,o){var s,l,u,c,h,p=new Zo(this._pt,e,t,0,1,Go,null,i),d=0,f=0;for(p.b=r,p.e=n,r+="",(i=~(n+="").indexOf("random("))&&(n=Ca(n)),a&&(a(a=[r,n],e,t),r=a[0],n=a[1]),s=r.match(wi)||[];c=wi.exec(n);)u=c[0],c=n.substring(d,c.index),l?l=(l+1)%5:"rgba("===c.substr(-5)&&(l=1),u!==s[f++]&&(h=parseFloat(s[f-1])||0,p._pt={_next:p._pt,p:c||1===f?c:",",s:h,c:"="===u.charAt(1)?Zi(h,u)-h:parseFloat(u)-h,m:l&&l<4?Math.round:0},d=wi.lastIndex);return p.c=d")}),a.duration();else{for(u in s={},y)"ease"!==u&&"easeEach"!==u&&function(e,r,t,n){var i,a,o=r.ease||n||"power1.inOut";if(yi(r))a=t[e]||(t[e]=[]),r.forEach(function(e,t){return a.push({t:t/(r.length-1)*100,v:e,e:o})});else for(i in r)a=t[i]||(t[i]=[]),"ease"!==i&&a.push({t:parseFloat(e),v:r[i],e:o})}(u,y[u],s,y.easeEach);for(u in s)for(S=s[u].sort(function(e,t){return e.t-t.t}),o=P=0;o=d._tDur||f<0)&&d.ratio===y&&(y&&ia(d,1),m||An||(Oa(d,y?"onComplete":"onReverseComplete",!0),d._prom&&d._prom()))}}else d._zTime||(d._zTime=f)}return this},e.targets=function(){return this._targets},e.invalidate=function(e){return e&&this.vars.runBackwards||(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(e),T.prototype.invalidate.call(this,e)},e.resetTo=function(e,t,r,n){zn||ja.wake(),this._ts||this.play();var i,a=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||Io(this,a),i=this._ease(a/this._dur),function(e,t,r,n,i,a,o){var s,l,u,c,h=(e._pt&&e._ptCache||(e._ptCache={}))[t];if(!h)for(h=e._ptCache[t]=[],u=e._ptLookup,c=e._targets.length;c--;){if((s=u[c][t])&&s.d&&s.d._pt)for(s=s.d._pt;s&&s.p!==t&&s.fp!==t;)s=s._next;if(!s)return mo=1,e.vars[t]="+=0",Io(e,o),mo=0,1;h.push(s)}for(c=h.length;c--;)(s=(l=h[c])._pt||l).s=!n&&0!==n||i?s.s+(n||0)+a*s.c:n,s.c=r-s.s,l.e&&(l.e=Xi(r)+xa(l.e)),l.b&&(l.b=s.s+xa(l.b))}(this,e,t,r,n,i,a)?this.resetTo(e,t,r,n):(ca(this,0),this.parent||ra(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(e,t){if(void 0===t&&(t="all"),!(e||t&&"all"!==t))return this._lazy=this._pt=0,this.parent?Mn(this):this;if(this.timeline)p=this.timeline.totalDuration(),this.timeline.killTweensOf(e,t,fo&&!0!==fo.vars.overwrite)._first||Mn(this),this.parent&&p!==this.timeline.totalDuration()&&ma(this,this._dur*this.timeline._tDur/p,0,1);else{var r,n,i,a,o,s,l,u=this._targets,c=e?Ma(e):u,h=this._ptLookup,p=this._pt;if((!t||"all"===t)&&function(e,t){for(var r=e.length,n=r===t.length;n&&r--&&e[r]===t[r];);return r<0}(u,c))return"all"===t&&(this._pt=0),Mn(this);for(r=this._op=this._op||[],"all"!==t&&(hi(t)&&(o={},qi(t,function(e){return o[e]=1}),t=o),t=function(e,t){var r,n,i,a,e=e[0]?Gi(e[0]).harness:0,o=e&&e.aliases;if(!o)return t;for(n in r=ea({},t),o)if(n in r)for(i=(a=o[n].split(",")).length;i--;)r[a[i]]=r[n];return r}(u,t)),l=u.length;l--;)if(~c.indexOf(u[l]))for(o in n=h[l],"all"===t?(r[l]=t,a=n,i={}):(i=r[l]=r[l]||{},a=t),a)(s=n&&n[o])&&("kill"in s.d&&!0!==s.d.kill(o)||na(this,s,"_pt"),delete n[o]),"all"!==i&&(i[o]=1);this._initted&&!this._pt&&p&&Mn(this)}return this},i.to=function(e,t){return new i(e,t,arguments[2])},i.from=function(e,t){return gn(1,arguments)},i.delayedCall=function(e,t,r,n){return new i(t,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:t,onReverseComplete:t,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:n})},i.fromTo=function(e,t,r){return gn(2,arguments)},i.set=function(e,t){return t.duration=0,t.repeatDelay||(t.repeat=0),new i(e,t)},i.killTweensOf=function(e,t,r){return In.killTweensOf(e,t,r)},i}(Po)),Bo=($i(Fo.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),qi("staggerTo,staggerFrom,staggerFromTo",function(r){Fo[r]=function(){var e=new To,t=_a.call(arguments,0);return t.splice("staggerFromTo"===r?5:4,0,0),e[r].apply(e,t)}}),function(e,t,r){return e[t]=r}),No=function(e,t,r){return e[t](r)},zo=function(e,t,r,n){return e[t](n.fp,r)},Vo=function(e,t,r){return e.setAttribute(t,r)},jo=function(e,t){return pi(e[t])?No:fi(e[t])&&e.setAttribute?Vo:Bo},Uo=function(e,t){return t.set(t.t,t.p,Math.round(1e6*(t.s+t.c*e))/1e6,t)},Ho=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},Go=function(e,t){var r=t._pt,n="";if(!e&&t.b)n=t.b;else if(1===e&&t.e)n=t.e;else{for(;r;)n=r.p+(r.m?r.m(r.s+r.c*e):Math.round(1e4*(r.s+r.c*e))/1e4)+n,r=r._next;n+=t.c}t.set(t.t,t.p,n,t)},Wo=function(e,t){for(var r=t._pt;r;)r.r(e,r.d),r=r._next},qo=function(e,t,r,n){for(var i,a=this._pt;a;)i=a._next,a.p===n&&a.modifier(e,t,r),a=i},Xo=function(e){for(var t,r,n=this._pt;n;)r=n._next,n.p===e&&!n.op||n.op===e?na(this,n,"_pt"):n.dep||(t=1),n=r;return!t},Yo=function(e){for(var t,r,n,i,a=e._pt;a;){for(t=a._next,r=n;r&&r.pr>a.pr;)r=r._next;(a._prev=r?r._prev:i)?a._prev._next=a:n=a,(a._next=r)?r._prev=a:i=a,a=t}e._pt=n},Zo=function(){function e(e,t,r,n,i,a,o,s,l){this.t=t,this.s=n,this.c=i,this.p=r,this.r=a||Uo,this.d=o||this,this.set=s||Bo,this.pr=l||0,(this._next=e)&&(e._prev=this)}return e.prototype.modifier=function(e,t,r){this.mSet=this.mSet||this.set,this.set=Qa,this.m=e,this.mt=r,this.tween=t},e}(),Jo=(qi(Ui+"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 Ri[e]=1}),Pi.TweenMax=Pi.TweenLite=Fo,Pi.TimelineLite=Pi.TimelineMax=To,In=new To({sortChildren:!1,defaults:ri,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),ti.stringFilter=Va,[]),Ko={},$o=[],Qo=0,es=function(e){return(Ko[e]||$o).map(function(e){return e()})},ts=function(){function r(e,t){this.selector=t&&vn(t),this.data=[],this._r=[],this.isReverted=!1,e&&this.add(e)}var e=r.prototype;return e.add=function(e,n,i){pi(e)&&(i=n,n=e,e=pi);function t(){var e,t=On,r=a.selector;return t&&t!==a&&t.data.push(a),i&&(a.selector=vn(i)),On=a,e=n.apply(a,arguments),pi(e)&&a._r.push(e),On=t,a.selector=r,a.isReverted=!1,e}var a=this;return a.last=t,e===pi?t(a):e?a[e]=t:t},e.ignore=function(e){var t=On;On=null,e(this),On=t},e.getTweens=function(){var t=[];return this.data.forEach(function(e){return e instanceof r?t.push.apply(t,e.getTweens()):e instanceof Fo&&!(e.parent&&"nested"===e.parent.data)&&t.push(e)}),t},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,e){var r,n=this;t?(r=this.getTweens(),this.data.forEach(function(e){"isFlip"===e.data&&(e.revert(),e.getChildren(!0,!0,!1).forEach(function(e){return r.splice(r.indexOf(e),1)}))}),r.map(function(e){return{g:e.globalTime(0),t:e}}).sort(function(e,t){return t.g-e.g||-1}).forEach(function(e){return e.t.revert(t)}),this.data.forEach(function(e){return!(e instanceof Po)&&e.revert&&e.revert(t)}),this._r.forEach(function(e){return e(t,n)}),this.isReverted=!0):this.data.forEach(function(e){return e.kill&&e.kill()}),this.clear(),e&&~(e=Jo.indexOf(this))&&Jo.splice(e,1)},e.revert=function(e){this.kill(e||{})},r}(),rs=function(){function e(e){this.contexts=[],this.scope=e}var t=e.prototype;return t.add=function(e,t,r){mi(e)||(e={matches:e});var n,i,a,o=new ts(0,r||this.scope),s=o.conditions={};for(i in this.contexts.push(o),t=o.add("onMatch",t),o.queries=e)"all"===i?a=1:(n=Ln.matchMedia(e[i]))&&(Jo.indexOf(o)<0&&Jo.push(o),(s[i]=n.matches)&&(a=1),n.addListener?n.addListener(eo):n.addEventListener("change",eo));return a&&t(o),this},t.revert=function(e){this.kill(e||{})},t.kill=function(t){this.contexts.forEach(function(e){return e.kill(t,!0)})},e}(),ns={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),r=0;r>8&255]+Ec[e>>16&255]+Ec[e>>24&255]+"-"+Ec[255&t]+Ec[t>>8&255]+"-"+Ec[t>>16&15|64]+Ec[t>>24&255]+"-"+Ec[63&r|128]+Ec[r>>8&255]+"-"+Ec[r>>16&255]+Ec[r>>24&255]+Ec[255&n]+Ec[n>>8&255]+Ec[n>>16&255]+Ec[n>>24&255]).toUpperCase()}function Ac(e,t,r){return Math.max(t,Math.min(r,e))}function Oc(e,t){return(e%t+t)%t}function Ic(e,t,r){return(1-r)*e+r*t}function Lc(e){return 0==(e&e-1)&&0!==e}function kc(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function Rc(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var Fc=Object.freeze({__proto__:null,DEG2RAD:Tc,RAD2DEG:Dc,generateUUID:Cc,clamp:Ac,euclideanModulo:Oc,mapLinear:function(e,t,r,n,i){return n+(e-t)*(i-n)/(r-t)},inverseLerp:function(e,t,r){return e!==t?(r-e)/(t-e):0},lerp:Ic,damp:function(e,t,r,n){return Ic(e,t,1-Math.exp(-r*n))},pingpong:function(e,t=1){return t-Math.abs(Oc(e,2*t)-t)},smoothstep:function(e,t,r){return e<=t?0:r<=e?1:(e=(e-t)/(r-t))*e*(3-2*e)},smootherstep:function(e,t,r){return e<=t?0:r<=e?1:(e=(e-t)/(r-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return((Pc=16807*(Pc=void 0!==e?e%2147483647:Pc)%2147483647)-1)/2147483646},degToRad:function(e){return e*Tc},radToDeg:function(e){return e*Dc},isPowerOfTwo:Lc,ceilPowerOfTwo:kc,floorPowerOfTwo:Rc,setQuaternionFromProperEuler:function(e,t,r,n,i){var a=Math.cos,o=Math.sin,s=a(r/2),l=o(r/2),u=a((t+n)/2),c=o((t+n)/2),h=a((t-n)/2),p=o((t-n)/2),d=a((n-t)/2),f=o((n-t)/2);switch(i){case"XYX":e.set(s*c,l*h,l*p,s*u);break;case"YZY":e.set(l*p,s*c,l*h,s*u);break;case"ZXZ":e.set(l*h,l*p,s*c,s*u);break;case"XZX":e.set(s*c,l*f,l*d,s*u);break;case"YXY":e.set(l*d,s*c,l*f,s*u);break;case"ZYZ":e.set(l*f,l*d,s*c,s*u)}}});class Ce{constructor(e=0,t=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 new 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 new 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,t){return void 0!==t?this.addVectors(e,t):(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}sub(e,t){return void 0!==t?this.subVectors(e,t):(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){var t=this.x,r=this.y,e=e.elements;return this.x=e[0]*t+e[3]*r+e[6],this.y=e[1]*t+e[4]*r+e[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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(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}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){var t=this.x-e.x,e=this.y-e.y;return t*t+e*e}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,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,r){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){var r=Math.cos(t),t=Math.sin(t),n=this.x-e.x,i=this.y-e.y;return this.x=n*r-i*t+e.x,this.y=n*t+i*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}Ce.prototype.isVector2=!0;class Bc{constructor(){this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,r,n,i,a,o,s,l){var u=this.elements;return u[0]=e,u[1]=n,u[2]=o,u[3]=t,u[4]=i,u[5]=s,u[6]=r,u[7]=a,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){var t=this.elements,e=e.elements;return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){e=e.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){var e=e.elements,t=t.elements,r=this.elements,n=e[0],i=e[3],a=e[6],o=e[1],s=e[4],l=e[7],u=e[2],c=e[5],e=e[8],h=t[0],p=t[3],d=t[6],f=t[1],m=t[4],g=t[7],v=t[2],y=t[5],t=t[8];return r[0]=n*h+i*f+a*v,r[3]=n*p+i*m+a*y,r[6]=n*d+i*g+a*t,r[1]=o*h+s*f+l*v,r[4]=o*p+s*m+l*y,r[7]=o*d+s*g+l*t,r[2]=u*h+c*f+e*v,r[5]=u*p+c*m+e*y,r[8]=u*d+c*g+e*t,this}multiplyScalar(e){var 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(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],e=e[8];return t*a*e-t*o*l-r*i*e+r*o*s+n*i*l-n*a*s}invert(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=u*a-o*l,h=o*s-u*i,p=l*i-a*s,d=t*c+r*h+n*p;return 0==d?this.set(0,0,0,0,0,0,0,0,0):(e[0]=c*(c=1/d),e[1]=(n*l-u*r)*c,e[2]=(o*r-n*a)*c,e[3]=h*c,e[4]=(u*t-n*s)*c,e[5]=(n*i-o*t)*c,e[6]=p*c,e[7]=(r*s-l*t)*c,e[8]=(a*t-r*i)*c,this)}transpose(){var e=this.elements,t=e[1];return e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){var 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,r,n,i,a,o){var s=Math.cos(i),i=Math.sin(i);return this.set(r*s,r*i,-r*(s*a+i*o)+a+e,-n*i,n*s,-n*(-i*a+s*o)+o+t,0,0,1),this}scale(e,t){var r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=t,r[4]*=t,r[7]*=t,this}rotate(e){var t=Math.cos(e),e=Math.sin(e),r=this.elements,n=r[0],i=r[3],a=r[6],o=r[1],s=r[4],l=r[7];return r[0]=t*n+e*o,r[3]=t*i+e*s,r[6]=t*a+e*l,r[1]=-e*n+t*o,r[4]=-e*i+t*s,r[7]=-e*a+t*l,this}translate(e,t){var r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=t*r[2],r[4]+=t*r[5],r[7]+=t*r[8],this}equals(e){var t=this.elements,r=e.elements;for(let e=0;e<9;e++)if(t[e]!==r[e])return!1;return!0}fromArray(t,r=0){for(let e=0;e<9;e++)this.elements[e]=t[e+r];return this}toArray(e=[],t=0){var r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}function Nc(t){for(let e=t.length-1;0<=e;--e)if(65535>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,r){return this.r=e,this.g=t,this.b=r,this}setHSL(e,t,r){return e=Oc(e,1),t=Ac(t,0,1),r=Ac(r,0,1),0===t?this.r=this.g=this.b=r:(this.r=Hc(t=2*r-(r=r<=.5?r*(1+t):r+t-r*t),r,e+1/3),this.g=Hc(t,r,e),this.b=Hc(t,r,e-1/3)),this}setStyle(e){function t(e){void 0!==e&&parseFloat(e)}if(s=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;var r,n,i,a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r=parseFloat(e[1])/360,n=parseInt(e[2],10)/100,i=parseInt(e[3],10)/100,t(e[4]),this.setHSL(r,n,i)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){var a=s[1],s=a.length;if(3===s)return this.r=parseInt(a.charAt(0)+a.charAt(0),16)/255,this.g=parseInt(a.charAt(1)+a.charAt(1),16)/255,this.b=parseInt(a.charAt(2)+a.charAt(2),16)/255,this;if(6===s)return this.r=parseInt(a.charAt(0)+a.charAt(1),16)/255,this.g=parseInt(a.charAt(2)+a.charAt(3),16)/255,this.b=parseInt(a.charAt(4)+a.charAt(5),16)/255,this}return e&&0Number.EPSILON&&(d=Math.sqrt(d),a=Math.atan2(d,a*p),e=Math.sin(e*a)/d,o=Math.sin(o*a)/d),o*p);s=s*e+r*a,l=l*e+n*a,u=u*e+h*a,c=c*e+i*a,e===1-o&&(d=1/Math.sqrt(s*s+l*l+u*u+c*c),s*=d,l*=d,u*=d,c*=d)}e[t]=s,e[t+1]=l,e[t+2]=u,e[t+3]=c}}static multiplyQuaternionsFlat(e,t,r,n,i,a){var o=r[n],s=r[n+1],l=r[n+2],r=r[n+3],n=i[a],u=i[a+1],c=i[a+2],i=i[a+3];return e[t]=o*i+r*n+s*c-l*u,e[t+1]=s*i+r*u+l*n-o*c,e[t+2]=l*i+r*c+o*u-s*n,e[t+3]=r*i-o*n-s*u-l*c,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,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,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){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var r=e._x,n=e._y,i=e._z,e=e._order,a=Math.cos,o=Math.sin,s=a(r/2),l=a(n/2),u=a(i/2),c=o(r/2),h=o(n/2),p=o(i/2);switch(e){case"XYZ":this._x=c*l*u+s*h*p,this._y=s*h*u-c*l*p,this._z=s*l*p+c*h*u,this._w=s*l*u-c*h*p;break;case"YXZ":this._x=c*l*u+s*h*p,this._y=s*h*u-c*l*p,this._z=s*l*p-c*h*u,this._w=s*l*u+c*h*p;break;case"ZXY":this._x=c*l*u-s*h*p,this._y=s*h*u+c*l*p,this._z=s*l*p+c*h*u,this._w=s*l*u-c*h*p;break;case"ZYX":this._x=c*l*u-s*h*p,this._y=s*h*u+c*l*p,this._z=s*l*p-c*h*u,this._w=s*l*u+c*h*p;break;case"YZX":this._x=c*l*u+s*h*p,this._y=s*h*u+c*l*p,this._z=s*l*p-c*h*u,this._w=s*l*u-c*h*p;break;case"XZY":this._x=c*l*u-s*h*p,this._y=s*h*u-c*l*p,this._z=s*l*p+c*h*u,this._w=s*l*u+c*h*p}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){var t=t/2,r=Math.sin(t);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(t),this._onChangeCallback(),this}setFromRotationMatrix(e){var e=e.elements,t=e[0],r=e[4],n=e[8],i=e[1],a=e[5],o=e[9],s=e[2],l=e[6],e=e[10],u=t+a+e;return 0Math.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=r,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ac(this.dot(e),-1,1)))}rotateTowards(e,t){var r=this.angleTo(e);return 0!==r&&(t=Math.min(1,t/r),this.slerp(e,t)),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(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(this._x=this._x*(e=1/e),this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?this.multiplyQuaternions(e,t):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){var r=e._x,n=e._y,i=e._z,e=e._w,a=t._x,o=t._y,s=t._z,t=t._w;return this._x=r*t+e*a+n*s-i*o,this._y=n*t+e*o+i*a-r*s,this._z=i*t+e*s+r*o-n*a,this._w=e*t-r*a-n*o-i*s,this._onChangeCallback(),this}slerp(t,r){if(0!==r){if(1===r)return this.copy(t);var n,i,a=this._x,o=this._y,s=this._z,l=this._w;let e=l*t._w+a*t._x+o*t._y+s*t._z;e<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,e=-e):this.copy(t),1<=e?(this._w=l,this._x=a,this._y=o,this._z=s):((t=1-e*e)<=Number.EPSILON?(this._w=(n=1-r)*l+r*this._w,this._x=n*a+r*this._x,this._y=n*o+r*this._y,this._z=n*s+r*this._z,this.normalize()):(n=Math.sqrt(t),t=Math.atan2(n,e),i=Math.sin((1-r)*t)/n,r=Math.sin(r*t)/n,this._w=l*i+this._w*r,this._x=a*i+this._x*r,this._y=o*i+this._y*r,this._z=s*i+this._z*r),this._onChangeCallback())}return this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){var e=Math.random(),t=Math.sqrt(1-e),e=Math.sqrt(e),r=2*Math.PI*Math.random(),n=2*Math.PI*Math.random();return this.set(t*Math.cos(r),e*Math.sin(n),e*Math.cos(n),t*Math.sin(r))}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}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}rh.prototype.isQuaternion=!0;class Ae{constructor(e=0,t=0,r=0){this.x=e,this.y=t,this.z=r}set(e,t,r){return void 0===r&&(r=this.z),this.x=e,this.y=t,this.z=r,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 new 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 new 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,t){return void 0!==t?this.addVectors(e,t):(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,t){return void 0!==t?this.subVectors(e,t):(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,t){return void 0!==t?this.multiplyVectors(e,t):(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 e&&e.isEuler,this.applyQuaternion(ih.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ih.setFromAxisAngle(e,t))}applyMatrix3(e){var t=this.x,r=this.y,n=this.z,e=e.elements;return this.x=e[0]*t+e[3]*r+e[6]*n,this.y=e[1]*t+e[4]*r+e[7]*n,this.z=e[2]*t+e[5]*r+e[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){var t=this.x,r=this.y,n=this.z,e=e.elements,i=1/(e[3]*t+e[7]*r+e[11]*n+e[15]);return this.x=(e[0]*t+e[4]*r+e[8]*n+e[12])*i,this.y=(e[1]*t+e[5]*r+e[9]*n+e[13])*i,this.z=(e[2]*t+e[6]*r+e[10]*n+e[14])*i,this}applyQuaternion(e){var t=this.x,r=this.y,n=this.z,i=e.x,a=e.y,o=e.z,e=e.w,s=e*t+a*n-o*r,l=e*r+o*t-i*n,u=e*n+i*r-a*t,t=-i*t-a*r-o*n;return this.x=s*e+t*-i+l*-o-u*-a,this.y=l*e+t*-a+u*-i-s*-o,this.z=u*e+t*-o+s*-a-l*-i,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){var t=this.x,r=this.y,n=this.z,e=e.elements;return this.x=e[0]*t+e[4]*r+e[8]*n,this.y=e[1]*t+e[5]*r+e[9]*n,this.z=e[2]*t+e[6]*r+e[10]*n,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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e,t){return void 0!==t?this.crossVectors(e,t):this.crossVectors(this,e)}crossVectors(e,t){var r=e.x,n=e.y,e=e.z,i=t.x,a=t.y,t=t.z;return this.x=n*t-e*a,this.y=e*i-r*t,this.z=r*a-n*i,this}projectOnVector(e){var t=e.lengthSq();return 0===t?this.set(0,0,0):(t=e.dot(this)/t,this.copy(e).multiplyScalar(t))}projectOnPlane(e){return nh.copy(this).projectOnVector(e),this.sub(nh)}reflect(e){return this.sub(nh.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:(e=this.dot(e)/t,Math.acos(Ac(e,-1,1)))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){var t=this.x-e.x,r=this.y-e.y,e=this.z-e.z;return t*t+r*r+e*e}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,r){var n=Math.sin(t)*e;return this.x=n*Math.sin(r),this.y=Math.cos(t)*e,this.z=n*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){e=e.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(e){var t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),e=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=e,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}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,r){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(){var e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(t),this.y=r*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}Ae.prototype.isVector3=!0;const nh=new Ae,ih=new rh;class ah{constructor(e=new Ae(1/0,1/0,1/0),t=new Ae(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(r){let n=1/0,i=1/0,a=1/0,o=-1/0,s=-1/0,l=-1/0;for(let e=0,t=r.length;eo&&(o=u),c>s&&(s=c),h>l&&(l=h)}return this.min.set(n,i,a),this.max.set(o,s,l),this}setFromBufferAttribute(r){let n=1/0,i=1/0,a=1/0,o=-1/0,s=-1/0,l=-1/0;for(let e=0,t=r.count;eo&&(o=u),c>s&&(s=c),h>l&&(l=h)}return this.min.set(n,i,a),this.max.set(o,s,l),this}setFromPoints(r){this.makeEmpty();for(let e=0,t=r.length;ethis.max.x||e.ythis.max.y||e.zthis.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.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,sh),sh.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return r=0=-e.constant}intersectsTriangle(e){return!this.isEmpty()&&(this.getCenter(mh),gh.subVectors(this.max,mh),uh.subVectors(e.a,mh),ch.subVectors(e.b,mh),hh.subVectors(e.c,mh),ph.subVectors(ch,uh),dh.subVectors(hh,ch),fh.subVectors(uh,hh),!!bh([0,-ph.z,ph.y,0,-dh.z,dh.y,0,-fh.z,fh.y,ph.z,0,-ph.x,dh.z,0,-dh.x,fh.z,0,-fh.x,-ph.y,ph.x,0,-dh.y,dh.x,0,-fh.y,fh.x,0],uh,ch,hh,gh))&&!!bh([1,0,0,0,1,0,0,0,1],uh,ch,hh,gh)&&(vh.crossVectors(ph,dh),bh([vh.x,vh.y,vh.z],uh,ch,hh,gh))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return sh.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(sh).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()||(oh[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),oh[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),oh[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),oh[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),oh[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),oh[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),oh[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),oh[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(oh)),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)}}ah.prototype.isBox3=!0;const oh=[new Ae,new Ae,new Ae,new Ae,new Ae,new Ae,new Ae,new Ae],sh=new Ae,lh=new ah,uh=new Ae,ch=new Ae,hh=new Ae,ph=new Ae,dh=new Ae,fh=new Ae,mh=new Ae,gh=new Ae,vh=new Ae,yh=new Ae;function bh(r,n,i,a,o){for(let e=0,t=r.length-3;e<=t;e+=3){yh.fromArray(r,e);var s=o.x*Math.abs(yh.x)+o.y*Math.abs(yh.y)+o.z*Math.abs(yh.z),l=n.dot(yh),u=i.dot(yh),c=a.dot(yh);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>s)return!1}return!0}const xh=new ah,_h=new Ae,wh=new Ae,Sh=new Ae;class Mh{constructor(e=new Ae,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(r,e){var n=this.center;void 0!==e?n.copy(e):xh.setFromPoints(r).getCenter(n);let i=0;for(let e=0,t=r.length;ethis.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}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){Sh.subVectors(e,this.center);var t,e=Sh.lengthSq();return e>this.radius*this.radius&&(t=.5*((e=Math.sqrt(e))-this.radius),this.center.add(Sh.multiplyScalar(t/e)),this.radius+=t),this}union(e){return(!0===this.center.equals(e.center)?wh.set(0,0,1):wh.subVectors(e.center,this.center).normalize()).multiplyScalar(e.radius),this.expandByPoint(_h.copy(e.center).add(wh)),this.expandByPoint(_h.copy(e.center).sub(wh)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Eh=new Ae,Ph=new Ae,Th=new Ae,Dh=new Ae,Ch=new Ae,Ah=new Ae,Oh=new Ae;class Ih{constructor(e=new Ae,t=new Ae(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.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Eh)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);e=t.dot(this.direction);return e<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(e).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){var t=Eh.subVectors(e,this.origin).dot(this.direction);return(t<0?this.origin:(Eh.copy(this.direction).multiplyScalar(t).add(this.origin),Eh)).distanceToSquared(e)}distanceSqToSegment(e,t,r,n){Ph.copy(e).add(t).multiplyScalar(.5),Th.copy(t).sub(e).normalize(),Dh.copy(this.origin).sub(Ph);var e=.5*e.distanceTo(t),t=-this.direction.dot(Th),i=Dh.dot(this.direction),a=-Dh.dot(Th),o=Dh.lengthSq(),s=Math.abs(1-t*t);let l,u,c,h;return c=0=-h?u<=h?(s=1/s,l*=s,u*=s,l*(l+t*u+2*i)+u*(t*l+u+2*a)+o):(u=e,-(l=Math.max(0,-(t*u+i)))*l+u*(u+2*a)+o):(u=-e,-(l=Math.max(0,-(t*u+i)))*l+u*(u+2*a)+o):u<=-h?(l=Math.max(0,-(-t*e+i)),u=0a||i>n||((i>r||r!=r)&&(r=i),(as)||o>n||((o>r||r!=r)&&(r=o),(n=sa||(n=-o*Dh.dot(Oh))<0?null:this.at(n/a,i)}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)}}class Oe{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,r,n,i,a,o,s,l,u,c,h,p,d,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=n,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=l,g[6]=u,g[10]=c,g[14]=h,g[3]=p,g[7]=d,g[11]=f,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 Oe).fromArray(this.elements)}copy(e){var t=this.elements,e=e.elements;return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],this}copyPosition(e){var t=this.elements,e=e.elements;return t[12]=e[12],t[13]=e[13],t[14]=e[14],this}setFromMatrix3(e){e=e.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){var t=this.elements,r=e.elements,n=1/Lh.setFromMatrixColumn(e,0).length(),i=1/Lh.setFromMatrixColumn(e,1).length(),e=1/Lh.setFromMatrixColumn(e,2).length();return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=0,t[4]=r[4]*i,t[5]=r[5]*i,t[6]=r[6]*i,t[7]=0,t[8]=r[8]*e,t[9]=r[9]*e,t[10]=r[10]*e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler;var t,r,n,i,a=this.elements,o=e.x,s=e.y,l=e.z,u=Math.cos(o),o=Math.sin(o),c=Math.cos(s),s=Math.sin(s),h=Math.cos(l),l=Math.sin(l);return"XYZ"===e.order?(r=u*h,n=u*l,i=o*h,t=o*l,a[0]=c*h,a[4]=-c*l,a[8]=s,a[1]=n+i*s,a[5]=r-t*s,a[9]=-o*c,a[2]=t-r*s,a[6]=i+n*s,a[10]=u*c):"YXZ"===e.order?(t=c*l,r=s*h,a[0]=(i=c*h)+(n=s*l)*o,a[4]=r*o-t,a[8]=u*s,a[1]=u*l,a[5]=u*h,a[9]=-o,a[2]=t*o-r,a[6]=n+i*o,a[10]=u*c):"ZXY"===e.order?(t=c*l,r=s*h,a[0]=(n=c*h)-(i=s*l)*o,a[4]=-u*l,a[8]=r+t*o,a[1]=t+r*o,a[5]=u*h,a[9]=i-n*o,a[2]=-u*s,a[6]=o,a[10]=u*c):"ZYX"===e.order?(t=u*h,r=u*l,i=o*h,n=o*l,a[0]=c*h,a[4]=i*s-r,a[8]=t*s+n,a[1]=c*l,a[5]=n*s+t,a[9]=r*s-i,a[2]=-s,a[6]=o*c,a[10]=u*c):"YZX"===e.order?(n=u*c,t=u*s,r=o*c,i=o*s,a[0]=c*h,a[4]=i-n*l,a[8]=r*l+t,a[1]=l,a[5]=u*h,a[9]=-o*h,a[2]=-s*h,a[6]=t*l+r,a[10]=n-i*l):"XZY"===e.order&&(t=u*c,r=u*s,n=o*c,i=o*s,a[0]=c*h,a[4]=-l,a[8]=s*h,a[1]=t*l+i,a[5]=u*h,a[9]=r*l-n,a[2]=n*l-r,a[6]=o*h,a[10]=i*l+t),a[3]=0,a[7]=0,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Rh,e,Fh)}lookAt(e,t,r){var n=this.elements;return zh.subVectors(e,t),0===zh.lengthSq()&&(zh.z=1),zh.normalize(),Bh.crossVectors(r,zh),0===Bh.lengthSq()&&(1===Math.abs(r.z)?zh.x+=1e-4:zh.z+=1e-4,zh.normalize(),Bh.crossVectors(r,zh)),Bh.normalize(),Nh.crossVectors(zh,Bh),n[0]=Bh.x,n[4]=Nh.x,n[8]=zh.x,n[1]=Bh.y,n[5]=Nh.y,n[9]=zh.y,n[2]=Bh.z,n[6]=Nh.z,n[10]=zh.z,this}multiply(e,t){return void 0!==t?this.multiplyMatrices(e,t):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){var e=e.elements,t=t.elements,r=this.elements,n=e[0],i=e[4],a=e[8],o=e[12],s=e[1],l=e[5],u=e[9],c=e[13],h=e[2],p=e[6],d=e[10],f=e[14],m=e[3],g=e[7],v=e[11],e=e[15],y=t[0],b=t[4],x=t[8],_=t[12],w=t[1],S=t[5],M=t[9],E=t[13],P=t[2],T=t[6],D=t[10],C=t[14],A=t[3],O=t[7],I=t[11],t=t[15];return r[0]=n*y+i*w+a*P+o*A,r[4]=n*b+i*S+a*T+o*O,r[8]=n*x+i*M+a*D+o*I,r[12]=n*_+i*E+a*C+o*t,r[1]=s*y+l*w+u*P+c*A,r[5]=s*b+l*S+u*T+c*O,r[9]=s*x+l*M+u*D+c*I,r[13]=s*_+l*E+u*C+c*t,r[2]=h*y+p*w+d*P+f*A,r[6]=h*b+p*S+d*T+f*O,r[10]=h*x+p*M+d*D+f*I,r[14]=h*_+p*E+d*C+f*t,r[3]=m*y+g*w+v*P+e*A,r[7]=m*b+g*S+v*T+e*O,r[11]=m*x+g*M+v*D+e*I,r[15]=m*_+g*E+v*C+e*t,this}multiplyScalar(e){var 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(){var e=this.elements,t=e[0],r=e[4],n=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],u=e[2],c=e[6],h=e[10],p=e[14];return e[3]*(+i*s*c-n*l*c-i*o*h+r*l*h+n*o*p-r*s*p)+e[7]*(+t*s*p-t*l*h+i*a*h-n*a*p+n*l*u-i*s*u)+e[11]*(+t*l*c-t*o*p-i*a*c+r*a*p+i*o*u-r*l*u)+e[15]*(-n*o*u-t*s*c+t*o*h+n*a*c-r*a*h+r*s*u)}transpose(){var e=this.elements,t=e[1];return e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,r){var n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=r),this}invert(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],p=e[11],d=e[12],f=e[13],m=e[14],g=e[15],v=c*m*l-f*h*l+f*s*p-o*m*p-c*s*g+o*h*g,y=d*h*l-u*m*l-d*s*p+a*m*p+u*s*g-a*h*g,b=u*f*l-d*c*l+d*o*p-a*f*p-u*o*g+a*c*g,x=d*c*s-u*f*s-d*o*h+a*f*h+u*o*m-a*c*m,_=t*v+r*y+n*b+i*x;return 0==_?this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0):(e[0]=v*(v=1/_),e[1]=(f*h*i-c*m*i-f*n*p+r*m*p+c*n*g-r*h*g)*v,e[2]=(o*m*i-f*s*i+f*n*l-r*m*l-o*n*g+r*s*g)*v,e[3]=(c*s*i-o*h*i-c*n*l+r*h*l+o*n*p-r*s*p)*v,e[4]=y*v,e[5]=(u*m*i-d*h*i+d*n*p-t*m*p-u*n*g+t*h*g)*v,e[6]=(d*s*i-a*m*i-d*n*l+t*m*l+a*n*g-t*s*g)*v,e[7]=(a*h*i-u*s*i+u*n*l-t*h*l-a*n*p+t*s*p)*v,e[8]=b*v,e[9]=(d*c*i-u*f*i-d*r*p+t*f*p+u*r*g-t*c*g)*v,e[10]=(a*f*i-d*o*i+d*r*l-t*f*l-a*r*g+t*o*g)*v,e[11]=(u*o*i-a*c*i-u*r*l+t*c*l+a*r*p-t*o*p)*v,e[12]=x*v,e[13]=(u*f*n-d*c*n+d*r*h-t*f*h-u*r*m+t*c*m)*v,e[14]=(d*o*n-a*f*n-d*r*s+t*f*s+a*r*m-t*o*m)*v,e[15]=(a*c*n-u*o*n+u*r*s-t*c*s-a*r*h+t*o*h)*v,this)}scale(e){var t=this.elements,r=e.x,n=e.y,e=e.z;return t[0]*=r,t[4]*=n,t[8]*=e,t[1]*=r,t[5]*=n,t[9]*=e,t[2]*=r,t[6]*=n,t[10]*=e,t[3]*=r,t[7]*=n,t[11]*=e,this}getMaxScaleOnAxis(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,e))}makeTranslation(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){var t=Math.cos(e),e=Math.sin(e);return this.set(1,0,0,0,0,t,-e,0,0,e,t,0,0,0,0,1),this}makeRotationY(e){var t=Math.cos(e),e=Math.sin(e);return this.set(t,0,e,0,0,1,0,0,-e,0,t,0,0,0,0,1),this}makeRotationZ(e){var t=Math.cos(e),e=Math.sin(e);return this.set(t,-e,0,0,e,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){var r=Math.cos(t),t=Math.sin(t),n=1-r,i=e.x,a=e.y,e=e.z,o=n*i,s=n*a;return this.set(o*i+r,o*a-t*e,o*e+t*a,0,o*a+t*e,s*a+r,s*e-t*i,0,o*e-t*a,s*e+t*i,n*e*e+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,n,i,a){return this.set(1,r,i,0,e,1,a,0,t,n,1,0,0,0,0,1),this}compose(e,t,r){var n=this.elements,i=t._x,a=t._y,o=t._z,t=t._w,s=i+i,l=a+a,u=o+o,c=i*s,h=i*l,i=i*u,p=a*l,a=a*u,o=o*u,s=t*s,l=t*l,t=t*u,u=r.x,d=r.y,r=r.z;return n[0]=(1-(p+o))*u,n[1]=(h+t)*u,n[2]=(i-l)*u,n[3]=0,n[4]=(h-t)*d,n[5]=(1-(c+o))*d,n[6]=(a+s)*d,n[7]=0,n[8]=(i+l)*r,n[9]=(a-s)*r,n[10]=(1-(c+p))*r,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,r){var n=this.elements;let i=Lh.set(n[0],n[1],n[2]).length();var a=Lh.set(n[4],n[5],n[6]).length(),o=Lh.set(n[8],n[9],n[10]).length(),e=(this.determinant()<0&&(i=-i),e.x=n[12],e.y=n[13],e.z=n[14],kh.copy(this),1/i),n=1/a,s=1/o;return kh.elements[0]*=e,kh.elements[1]*=e,kh.elements[2]*=e,kh.elements[4]*=n,kh.elements[5]*=n,kh.elements[6]*=n,kh.elements[8]*=s,kh.elements[9]*=s,kh.elements[10]*=s,t.setFromRotationMatrix(kh),r.x=i,r.y=a,r.z=o,this}makePerspective(e,t,r,n,i,a){var o=this.elements,s=2*i/(r-n),l=(t+e)/(t-e),r=(r+n)/(r-n),n=-(a+i)/(a-i),a=-2*a*i/(a-i);return o[0]=2*i/(t-e),o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=s,o[9]=r,o[13]=0,o[2]=0,o[6]=0,o[10]=n,o[14]=a,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,r,n,i,a){var o=this.elements,s=1/(t-e),l=1/(r-n),u=1/(a-i),t=(t+e)*s,e=(r+n)*l,r=(a+i)*u;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-t,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-e,o[2]=0,o[6]=0,o[10]=-2*u,o[14]=-r,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){var t=this.elements,r=e.elements;for(let e=0;e<16;e++)if(t[e]!==r[e])return!1;return!0}fromArray(t,r=0){for(let e=0;e<16;e++)this.elements[e]=t[e+r];return this}toArray(e=[],t=0){var r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}Oe.prototype.isMatrix4=!0;const Lh=new Ae,kh=new Oe,Rh=new Ae(0,0,0),Fh=new Ae(1,1,1),Bh=new Ae,Nh=new Ae,zh=new Ae,Vh=new Oe,jh=new rh;class Uh{constructor(e=0,t=0,r=0,n=Uh.DefaultOrder){this._x=e,this._y=t,this._z=r,this._order=n}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,r,n=this._order){return this._x=e,this._y=t,this._z=r,this._order=n,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,r=!0){var e=e.elements,n=e[0],i=e[4],a=e[8],o=e[1],s=e[5],l=e[9],u=e[2],c=e[6],h=e[10];switch(t){case"XYZ":this._y=Math.asin(Ac(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-l,h),this._z=Math.atan2(-i,n)):(this._x=Math.atan2(c,s),this._z=0);break;case"YXZ":this._x=Math.asin(-Ac(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(o,s)):(this._y=Math.atan2(-u,n),this._z=0);break;case"ZXY":this._x=Math.asin(Ac(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-u,h),this._z=Math.atan2(-i,s)):(this._y=0,this._z=Math.atan2(o,n));break;case"ZYX":this._y=Math.asin(-Ac(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(c,h),this._z=Math.atan2(o,n)):(this._x=0,this._z=Math.atan2(-i,s));break;case"YZX":this._z=Math.asin(Ac(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,s),this._y=Math.atan2(-u,n)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-Ac(i,-1,1)),Math.abs(i)<.9999999?(this._x=Math.atan2(c,s),this._y=Math.atan2(a,n)):(this._x=Math.atan2(-l,h),this._y=0)}return this._order=t,!0===r&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return Vh.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Vh,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return jh.setFromEuler(this),this.setFromQuaternion(jh,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(){}}Uh.prototype.isEuler=!0,Uh.DefaultOrder="XYZ",Uh.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Hh{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<r.far?null:{distance:n,point:qp.clone(),object:e}}(e,t,r,n,Lp,kp,Rp,Wp);return i&&(s&&(Up.fromBufferAttribute(s,u),Hp.fromBufferAttribute(s,c),Gp.fromBufferAttribute(s,h),i.uv=fp.getUV(Wp,Lp,kp,Rp,Up,Hp,Gp,new Ce)),l&&(Up.fromBufferAttribute(l,u),Hp.fromBufferAttribute(l,c),Gp.fromBufferAttribute(l,h),i.uv2=fp.getUV(Wp,Lp,kp,Rp,Up,Hp,Gp,new Ce)),e={a:u,b:c,c:h,normal:new Ae,materialIndex:0},fp.getNormal(Lp,kp,Rp,e.normal),i.face=e),i}Xp.prototype.isMesh=!0;class Zp extends P{constructor(e=1,t=1,r=1,n=1,i=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:n,heightSegments:i,depthSegments:a};const T=this,D=(n=Math.floor(n),i=Math.floor(i),a=Math.floor(a),[]),C=[],A=[],O=[];let I=0,L=0;function o(r,n,i,a,o,e,t,s,l,u,c){var h=e/l,p=t/u,d=e/2,f=t/2,m=s/2,g=l+1,v=u+1;let y=0,b=0;var x=new Ae;for(let t=0;t #include } `,fragmentShader:` uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); } `},n=new Zp(5,5,5),r=new Qp({name:"CubemapFromEquirect",uniforms:Jp(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:yl,blending:xl}),n=(r.uniforms.tEquirect.value=t,new Xp(n,r)),r=t.minFilter;return t.minFilter===bu&&(t.minFilter=vu),new rd(1,10,this).update(e,n),t.minFilter=r,n.geometry.dispose(),n.material.dispose(),this}clear(t,r,n,i){var e=t.getRenderTarget();for(let e=0;e<6;e++)t.setRenderTarget(this,e),t.clear(r,n,i);t.setRenderTarget(e)}}id.prototype.isWebGLCubeRenderTarget=!0;const ad=new Ae,od=new Ae,sd=new Bc;class ld{constructor(e=new Ae(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,n){return this.normal.set(e,t,r),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){r=ad.subVectors(r,t).cross(od.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){var 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(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){var r=e.delta(ad),n=this.normal.dot(r);return 0===n?0===this.distanceToPoint(e.start)?t.copy(e.start):null:(n=-(e.start.dot(this.normal)+this.constant)/n)<0||1 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn 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\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn 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\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn 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\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\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; }\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 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ) + 0.5;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn 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\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec;\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\t#else\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\t\t\t#endif\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tlightMapIrradiance *= PI;\n\t#endif\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",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\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\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\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\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\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform vec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tfloat texelIndex = float( vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset );\n\t\t\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\n\t\t\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\n\t\t\treturn texture( morphTargetsTexture, morphUV );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn 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\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_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;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},C={common:{diffuse:{value:new m(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Bc},uv2Transform:{value:new Bc},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Ce(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new m(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new m(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Bc}},sprite:{diffuse:{value:new m(16777215)},opacity:{value:1},center:{value:new Ce(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Bc}}},md={basic:{uniforms:Kp([C.common,C.specularmap,C.envmap,C.aomap,C.lightmap,C.fog]),vertexShader:_.meshbasic_vert,fragmentShader:_.meshbasic_frag},lambert:{uniforms:Kp([C.common,C.specularmap,C.envmap,C.aomap,C.lightmap,C.emissivemap,C.fog,C.lights,{emissive:{value:new m(0)}}]),vertexShader:_.meshlambert_vert,fragmentShader:_.meshlambert_frag},phong:{uniforms:Kp([C.common,C.specularmap,C.envmap,C.aomap,C.lightmap,C.emissivemap,C.bumpmap,C.normalmap,C.displacementmap,C.fog,C.lights,{emissive:{value:new m(0)},specular:{value:new m(1118481)},shininess:{value:30}}]),vertexShader:_.meshphong_vert,fragmentShader:_.meshphong_frag},standard:{uniforms:Kp([C.common,C.envmap,C.aomap,C.lightmap,C.emissivemap,C.bumpmap,C.normalmap,C.displacementmap,C.roughnessmap,C.metalnessmap,C.fog,C.lights,{emissive:{value:new m(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:_.meshphysical_vert,fragmentShader:_.meshphysical_frag},toon:{uniforms:Kp([C.common,C.aomap,C.lightmap,C.emissivemap,C.bumpmap,C.normalmap,C.displacementmap,C.gradientmap,C.fog,C.lights,{emissive:{value:new m(0)}}]),vertexShader:_.meshtoon_vert,fragmentShader:_.meshtoon_frag},matcap:{uniforms:Kp([C.common,C.bumpmap,C.normalmap,C.displacementmap,C.fog,{matcap:{value:null}}]),vertexShader:_.meshmatcap_vert,fragmentShader:_.meshmatcap_frag},points:{uniforms:Kp([C.points,C.fog]),vertexShader:_.points_vert,fragmentShader:_.points_frag},dashed:{uniforms:Kp([C.common,C.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:_.linedashed_vert,fragmentShader:_.linedashed_frag},depth:{uniforms:Kp([C.common,C.displacementmap]),vertexShader:_.depth_vert,fragmentShader:_.depth_frag},normal:{uniforms:Kp([C.common,C.bumpmap,C.normalmap,C.displacementmap,{opacity:{value:1}}]),vertexShader:_.meshnormal_vert,fragmentShader:_.meshnormal_frag},sprite:{uniforms:Kp([C.sprite,C.fog]),vertexShader:_.sprite_vert,fragmentShader:_.sprite_frag},background:{uniforms:{uvTransform:{value:new Bc},t2D:{value:null}},vertexShader:_.background_vert,fragmentShader:_.background_frag},cube:{uniforms:Kp([C.envmap,{opacity:{value:1}}]),vertexShader:_.cube_vert,fragmentShader:_.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:_.equirect_vert,fragmentShader:_.equirect_frag},distanceRGBA:{uniforms:Kp([C.common,C.displacementmap,{referencePosition:{value:new Ae},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:_.distanceRGBA_vert,fragmentShader:_.distanceRGBA_frag},shadow:{uniforms:Kp([C.lights,C.fog,{color:{value:new m(0)},opacity:{value:1}}]),vertexShader:_.shadow_vert,fragmentShader:_.shadow_frag}};function gd(i,a,r,o,e,n){const s=new m(0);let l=!0===e?0:1,u,c,h=null,p=0,d=null;function f(e,t){r.buffers.color.setClear(e.r,e.g,e.b,t,n)}return{getClearColor:function(){return s},setClearColor:function(e,t=1){s.set(e),l=t,f(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(e){l=e,f(s,l)},render:function(e,t){let r=!1,n=!0===t.isScene?t.background:null;n&&n.isTexture&&(n=a.get(n)),t=(t=i.xr).getSession&&t.getSession(),null===(n=t&&"additive"===t.environmentBlendMode?null:n)?f(s,l):n&&n.isColor&&(f(n,1),r=!0),(i.autoClear||r)&&i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil),n&&(n.isCubeTexture||n.mapping===uu)?(void 0===c&&((c=new Xp(new Zp(1,1,1),new Qp({name:"BackgroundCubeMaterial",uniforms:Jp(md.cube.uniforms),vertexShader:md.cube.vertexShader,fragmentShader:md.cube.fragmentShader,side:yl,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),o.update(c)),c.material.uniforms.envMap.value=n,c.material.uniforms.flipEnvMap.value=n.isCubeTexture&&!1===n.isRenderTargetTexture?-1:1,h===n&&p===n.version&&d===i.toneMapping||(c.material.needsUpdate=!0,h=n,p=n.version,d=i.toneMapping),e.unshift(c,c.geometry,c.material,0,0,null)):n&&n.isTexture&&(void 0===u&&((u=new Xp(new fd(2,2),new Qp({name:"BackgroundMaterial",uniforms:Jp(md.background.uniforms),vertexShader:md.background.vertexShader,fragmentShader:md.background.fragmentShader,side:vl,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),o.update(u)),!0===(u.material.uniforms.t2D.value=n).matrixAutoUpdate&&n.updateMatrix(),u.material.uniforms.uvTransform.value.copy(n.matrix),h===n&&p===n.version&&d===i.toneMapping||(u.material.needsUpdate=!0,h=n,p=n.version,d=i.toneMapping),e.unshift(u,u.geometry,u.material,0,0,null))}}}function vd(b,x,_,w){const i=b.getParameter(34921),p=w.isWebGL2?null:x.get("OES_vertex_array_object"),d=w.isWebGL2||null!==p,f={},e=v(null);let m=e;function g(e){if(w.isWebGL2)return b.bindVertexArray(e);p.bindVertexArrayOES(e)}function a(e){if(w.isWebGL2)return b.deleteVertexArray(e);p.deleteVertexArrayOES(e)}function v(e){var t=[],r=[],n=[];for(let e=0;er-Sd?e=Md[t-r+Sd-1]:0===t&&(e=0),a.push(e);var s=1/(s-1),l=-s/2,s=1+s/2,u=[l,l,s,l,s,s,l,l,s,s,l,s],c=new Float32Array(108),h=new Float32Array(72),p=new Float32Array(36);for(let e=0;e<6;e++){var d=e%3*2/3-1,f=2Sd&&o--}return{lodPlanes:n,sizeLods:i,sigmas:a}}(i),this._blurMaterial=(i=i,r=r,n=n,e=new Float32Array(Ed),t=new Ae(0,1,0),r=new Qp({name:"SphericalGaussianBlur",defines:{n:Ed,CUBEUV_TEXEL_WIDTH:1/r,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:i+".0"},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t}},vertexShader:Bd(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform int samples; uniform float weights[ n ]; uniform bool latitudinal; uniform float dTheta; uniform float mipInt; uniform vec3 poleAxis; #define ENVMAP_TYPE_CUBE_UV #include vec3 getSample( float theta, vec3 axis ) { float cosTheta = cos( theta ); // Rodrigues' axis-angle rotation vec3 sampleDirection = vOutputDirection * cosTheta + cross( axis, vOutputDirection ) * sin( theta ) + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); return bilinearCubeUV( envMap, sampleDirection, mipInt ); } void main() { vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); if ( all( equal( axis, vec3( 0.0 ) ) ) ) { axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); } axis = normalize( axis ); gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); for ( int i = 1; i < n; i++ ) { if ( i >= samples ) { break; } float theta = dTheta * float( i ); gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); } } `,blending:xl,depthTest:!1,depthWrite:!1}))),a}_compileMaterial(e){e=new Xp(this._lodPlanes[0],e);this._renderer.compile(e,Pd)}_sceneToCubeUV(t,e,r,n){var i=new td(90,1,e,r),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,e=s.autoClear,r=s.toneMapping,l=(s.getClearColor(Td),s.toneMapping=Ql,s.autoClear=!1,new vp({name:"PMREM.Background",side:yl,depthWrite:!1,depthTest:!1})),u=new Xp(new Zp,l);let c=!1;var h=t.background;h?h.isColor&&(l.color.copy(h),t.background=null,c=!0):(l.color.copy(Td),c=!0);for(let e=0;e<6;e++){var p=e%3,d=(0==p?(i.up.set(0,a[e],0),i.lookAt(o[e],0,0)):1==p?(i.up.set(0,0,a[e]),i.lookAt(0,o[e],0)):(i.up.set(0,a[e],0),i.lookAt(0,0,o[e])),this._cubeSize);kd(n,p*d,2i-Sd?n-i+Sd:0);a=4*(this._cubeSize-e);kd(t,g,a,3*e,2*e),s.setRenderTarget(t),s.render(u,Pd)}}function Ld(e,t,r){e=new Qc(e,t,r);return e.texture.mapping=uu,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function kd(e,t,r,n,i){e.viewport.set(t,r,n,i),e.scissor.set(t,r,n,i)}function Rd(){return new Qp({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Bd(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; #include void main() { vec3 outputDirection = normalize( vOutputDirection ); vec2 uv = equirectUv( outputDirection ); gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } `,blending:xl,depthTest:!1,depthWrite:!1})}function Fd(){return new Qp({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Bd(),fragmentShader:` precision mediump float; precision mediump int; uniform float flipEnvMap; varying vec3 vOutputDirection; uniform samplerCube envMap; void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } `,blending:xl,depthTest:!1,depthWrite:!1})}function Bd(){return` precision mediump float; precision mediump int; attribute float faceIndex; varying vec3 vOutputDirection; // RH coordinate system; PMREM face-indexing convention vec3 getDirection( vec2 uv, float face ) { uv = 2.0 * uv - 1.0; vec3 direction = vec3( uv, 1.0 ); if ( face == 0.0 ) { direction = direction.zyx; // ( 1, v, u ) pos x } else if ( face == 1.0 ) { direction = direction.xzy; direction.xz *= -1.0; // ( -u, 1, -v ) pos y } else if ( face == 2.0 ) { direction.x *= -1.0; // ( -u, v, 1 ) pos z } else if ( face == 3.0 ) { direction = direction.zyx; direction.xz *= -1.0; // ( -1, v, -u ) neg x } else if ( face == 4.0 ) { direction = direction.xzy; direction.xy *= -1.0; // ( -u, -1, v ) neg y } else if ( face == 5.0 ) { direction.z *= -1.0; // ( u, v, -1 ) neg z } return direction; } void main() { vOutputDirection = getDirection( uv, faceIndex ); gl_Position = vec4( position, 1.0 ); } `}function Nd(i){let a=new WeakMap,o=null;function s(e){var e=e.target,t=(e.removeEventListener("dispose",s),a.get(e));void 0!==t&&(a.delete(e),t.dispose())}return{get:function(e){if(e&&e.isTexture){var t,r=e.mapping,n=r===su||r===lu,r=r===au||r===ou;if(n||r)return e.isRenderTargetTexture&&!0===e.needsPMREMUpdate?(e.needsPMREMUpdate=!1,t=a.get(e),null===o&&(o=new Id(i)),t=n?o.fromEquirectangular(e,t):o.fromCubemap(e,t),a.set(e,t),t.texture):a.has(e)?a.get(e).texture:(t=e.image,n&&t&&0D.maxTextureSize&&(r=Math.ceil(t/D.maxTextureSize),t=D.maxTextureSize);var f=new Float32Array(t*r*4*s);const P=new eh(f,t,r,s);P.format=Lu,P.type=Pu,P.needsUpdate=!0;var m=4*e;for(let e=0;e/gm;function om(e){return e.replace(am,sm)}function sm(e,t){var r=_[t];if(void 0===r)throw new Error("Can not resolve #include <"+t+">");return om(r)}const lm=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,um=/#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 cm(e){return e.replace(um,pm).replace(lm,hm)}function hm(e,t,r,n){return pm(0,t,r,n)}function pm(e,t,r,n){let i="";for(let e=parseInt(t);e=n.get(e).length?(r=new wm,n.get(e).push(r)):r=n.get(e)[t],r},dispose:function(){n=new WeakMap}}}function Mm(){const r={};return{get:function(e){if(void 0!==r[e.id])return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Ae,color:new m};break;case"SpotLight":t={position:new Ae,direction:new Ae,color:new m,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Ae,color:new m,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Ae,skyColor:new m,groundColor:new m};break;case"RectAreaLight":t={color:new m,position:new Ae,halfWidth:new Ae,halfHeight:new Ae}}return r[e.id]=t}}}let Em=0;function Pm(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Tm(t,M){const E=new Mm,P=function(){const r={};return{get:function(e){if(void 0!==r[e.id])return r[e.id];let t;switch(e.type){case"DirectionalLight":case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ce};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ce,shadowCameraNear:1,shadowCameraFar:1e3}}return r[e.id]=t}}}(),T={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)T.probe.push(new Ae);const d=new Ae,f=new Oe,m=new Oe;return{setup:function(r,e){let n=0,i=0,a=0;for(let e=0;e<9;e++)T.probe[e].set(0,0,0);let o=0,s=0,l=0,u=0,c=0,h=0,p=0,d=0;r.sort(Pm);var f=!0!==e?Math.PI:1;for(let e=0,t=r.length;e=a.get(e).length?(r=new Dm(n,i),a.get(e).push(r)):r=a.get(e)[t],r},dispose:function(){a=new WeakMap}}}class Am extends gp{constructor(e){super(),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.fog=!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}}Am.prototype.isMeshDepthMaterial=!0;class Om extends gp{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new Ae,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}Om.prototype.isMeshDistanceMaterial=!0;const Im="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",Lm="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";function km(m,g,e){let v=new hd;const f=new Ce,y=new Ce,b=new $c,l=new Am({depthPacking:yc}),u=new Om,c={},x=e.maxTextureSize,h={0:yl,1:vl,2:bl},_=new Qp({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ce},radius:{value:4}},vertexShader:Im,fragmentShader:Lm}),w=_.clone();w.defines.HORIZONTAL_PASS=1;e=new P;e.setAttribute("position",new xp(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const S=new Xp(e,_),M=this;function E(r,n,e,t,i,a){let o=null;r=!0===e.isPointLight?r.customDistanceMaterial:r.customDepthMaterial;if(o=void 0!==r?r:!0===e.isPointLight?u:l,m.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&0x||f.y>x)&&(f.x>x&&(y.x=Math.floor(x/h.x),f.x=y.x*h.x,l.mapSize.x=y.x),f.y>x)&&(y.y=Math.floor(x/h.y),f.y=y.y*h.y,l.mapSize.y=y.y),null!==l.map||l.isPointLightShadow||this.type!==gl||(h={minFilter:vu,magFilter:vu,format:Lu},l.map=new Qc(f.x,f.y,h),l.map.texture.name=s.name+".shadowMap",l.mapPass=new Qc(f.x,f.y,h),l.camera.updateProjectionMatrix()),null===l.map&&(h={minFilter:fu,magFilter:fu,format:Lu},l.map=new Qc(f.x,f.y,h),l.map.texture.name=s.name+".shadowMap",l.camera.updateProjectionMatrix()),m.setRenderTarget(l.map),m.clear(),l.getViewportCount());for(let e=0;en||e.height>n?n/Math.max(e.width,e.height):i)<1||!0===t?"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?(t=(n=t?Rc:Math.floor)(i*e.width),n=n(i*e.height),void 0===s&&(s=c(t,n)),(r=r?c(t,n):s).width=t,r.height=n,r.getContext("2d").drawImage(e,0,0,t,n),r):(0 in e,e):e}function M(e){return Lc(e.width)&&Lc(e.height)}function E(e,t){return e.generateMipmaps&&t&&e.minFilter!==fu&&e.minFilter!==vu}function P(e){y.generateMipmap(e)}function T(e,t,r,n,i=!1){if(!1===w)return t;if(null!==e&&void 0!==y[e])return y[e];let a=t;return 6403===t&&(5126===r&&(a=33326),5131===r&&(a=33325),5121===r)&&(a=33321),33319===t&&(5126===r&&(a=33328),5131===r&&(a=33327),5121===r)&&(a=33323),33325!==(a=6408===t&&(5126===r&&(a=34836),5131===r&&(a=34842),5121===r&&(a=n===vc&&!1===i?35907:32856),32819===r&&(a=32854),32820===r)?32855:a)&&33326!==a&&33327!==a&&33328!==a&&34842!==a&&34836!==a||o.get("EXT_color_buffer_float"),a}function D(e,t,r){return!0===E(e,r)||e.isFramebufferTexture&&e.minFilter!==fu&&e.minFilter!==vu?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&0e.far||t.push({distance:r,point:eg.clone(),uv:fp.getUV(eg,og,sg,lg,ug,cg,hg,new Ce),face:null,object:this})}copy(e){return super.copy(e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function dg(e,t,r,n,i,a){ng.subVectors(e,r).addScalar(.5).multiply(n),void 0!==i?(ig.x=a*ng.x-i*ng.y,ig.y=i*ng.x+a*ng.y):ig.copy(ng),e.copy(t),e.x+=ig.x,e.y+=ig.y,e.applyMatrix4(ag)}pg.prototype.isSprite=!0;(class extends null{});const fg=new Ae,mg=new $c,gg=new $c,vg=new Ae,yg=new Oe;class bg extends Xp{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Oe,this.bindMatrixInverse=new Oe}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){var r=new $c,n=this.geometry.attributes.skinWeight;for(let e=0,t=n.count;er.far||n.push({distance:g,point:u.clone().applyMatrix4(this.matrixWorld),index:e,face:null,faceIndex:null,object:this})}else for(let e=Math.max(0,a.start),t=Math.min(f.count,a.start+a.count)-1;er.far||n.push({distance:p,point:u.clone().applyMatrix4(this.matrixWorld),index:e,face:null,faceIndex:null,object:this})}else e.isGeometry}}updateMorphTargets(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,r=Object.keys(t);if(0i.far||a.push({distance:e,distanceToRay:Math.sqrt(s),point:r,index:t,face:null,object:o}))}Xg.prototype.isPoints=!0;Kc;Kc;class Zg extends Kc{constructor(e,t,r,n,i,a,o,s,l,u,c,h){super(null,a,o,s,l,u,n,i,c,h),this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}Zg.prototype.isCompressedTexture=class extends Kc{constructor(e,t,r){super({width:e,height:t}),this.format=r,this.magFilter=fu,this.minFilter=fu,this.generateMipmaps=!1,this.needsUpdate=!0}}.prototype.isFramebufferTexture=class extends Kc{constructor(t,e,r,n,i,a,o,s,l){super(t,e,r,n,i,a,o,s,l),this.minFilter=void 0!==a?a:vu,this.magFilter=void 0!==i?i:vu,this.generateMipmaps=!1;const u=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(function e(){u.needsUpdate=!0,t.requestVideoFrameCallback(e)})}clone(){return new this.constructor(this.image).copy(this)}update(){var e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}.prototype.isVideoTexture=!0;Kc;(class extends Kc{constructor(e,t,r,n,i,a,o,s,l){super(e,t,r,n,i,a,o,s,l),this.needsUpdate=!0}}).prototype.isCanvasTexture=!0;class Jg extends P{constructor(r=1,n=8,i=0,a=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:r,segments:n,thetaStart:i,thetaLength:a},n=Math.max(3,n);var t=[],o=[],s=[],l=[],u=new Ae,c=new Ce;o.push(0,0,0),s.push(0,0,1),l.push(.5,.5);for(let e=0,t=3;e<=n;e++,t+=3){var h=i+e/n*a;u.x=r*Math.cos(h),u.y=r*Math.sin(h),o.push(u.x,u.y,u.z),s.push(0,0,1),c.x=(o[t]/r+1)/2,c.y=(o[t+1]/r+1)/2,l.push(c.x,c.y)}for(let e=1;e<=n;e++)t.push(e,e+1,0);this.setIndex(t),this.setAttribute("position",new U(o,3)),this.setAttribute("normal",new U(s,3)),this.setAttribute("uv",new U(l,2))}static fromJSON(e){return new Jg(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Kg extends P{constructor(d=1,f=1,t=1,m=8,n=1,e=!1,g=0,v=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:d,radiusBottom:f,height:t,radialSegments:m,heightSegments:n,openEnded:e,thetaStart:g,thetaLength:v};const y=this,b=(m=Math.floor(m),n=Math.floor(n),[]),x=[],_=[],w=[];let S=0;const i=[],M=t/2;let E=0;{var a=new Ae,o=new Ae;let r=0;var s=(f-d)/t;for(let e=0;e<=n;e++){var l=[],u=e/n,c=u*(f-d)+d;for(let e=0;e<=m;e++){var h=e/m,p=h*v+g,P=Math.sin(p),p=Math.cos(p);o.x=c*P,o.y=-u*t+M,o.z=c*p,x.push(o.x,o.y,o.z),a.set(P,s,p).normalize(),_.push(a.x,a.y,a.z),w.push(h,1-u),l.push(S++)}i.push(l)}for(let t=0;tNumber.EPSILON&&(o.normalize(),c=Math.acos(Ac(n[e-1].dot(n[e]),-1,1)),i[e].applyMatrix4(s.makeRotationAxis(o,c))),a[e].crossVectors(n[e],i[e]);if(!0===e){let t=Math.acos(Ac(i[0].dot(i[r]),-1,1));t/=r,0r;)n-=r;nr.length-2?r.length-1:n+1],r=r[n>r.length-3?r.length-1:n+2];return t.set(mv(e,i.x,a.x,o.x,r.x),mv(e,i.y,a.y,o.y,r.y)),t}copy(r){super.copy(r),this.points=[];for(let e=0,t=r.points.length;e=a)return r=o[s]-a,i=(n=this.curves[s]).getLength(),n.getPointAt(0===i?0:1-r/i,t);s++}return null}getLength(){var e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;var r=[];let n=0;for(let e=0,t=this.curves.length;e=n.next.y&&n.next.y!==n.y){var t=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=i&&t>o){if((o=t)===i){if(a===n.y)return n;if(a===n.next.y)return n.next}s=n.x=n.x&&n.x>=u&&i!==n.x&&kv(as.x||n.x===s.x&&function(e,t){return Rv(e.prev,e,t.prev)<0&&Rv(t.next,e,e.next)<0}(s,n)))&&(s=n,e=t),(n=n.next)!==l;);}return s}(e,t))&&(e=jv(t,e),Av(t,t.next),Av(e,e.next))}(i[a],r),r=Av(r,r.next);return r}(s,l,p,u)),s.length>80*u){t=n=s[0],r=i=s[1];for(let e=u;en&&(n=a),o>i&&(i=o);e=0!==(e=Math.max(n-t,i-r))?1/e:0}Ov(p,d,u,t,r,e)}return d}};function Cv(e,t,r,n,i){let a,o;if(i===0=t;a-=n)o=Uv(a,e[a],e[a+1],o);return o&&Fv(o,o.next)&&(Hv(o),o=o.next),o}function Av(e,t){if(!e)return e;t=t||e;let r=e,n;do{if(n=!1,r.steiner||!Fv(r,r.next)&&0!==Rv(r.prev,r,r.next))r=r.next;else{if(Hv(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function Ov(n,i,a,o,s,l,u){if(n){if(!u&&l){var c=n,h=o,p=s,d=l;let u=c;for(;null===u.z&&(u.z=Lv(u.x,u.y,h,p,d)),u.prevZ=u.prev,u.nextZ=u.next,(u=u.next)!==c;);u.prevZ.nextZ=null,u.prevZ=null;{var f=u;let e,t,r,n,i,a,o,s,l=1;do{for(t=f,f=null,i=null,a=0;t;){for(a++,r=t,o=0,e=0;ea.x?i.x>o.x?i:o:a.x>o.x?a:o).x,c=(i.y>a.y?i.y>o.y?i:o:a.y>o.y?a:o).y,h=Lv(s,l,t,r,n),p=Lv(u,c,t,r,n);let d=e.prevZ,f=e.nextZ;for(;d&&d.z>=h&&f&&f.z<=p;){if(d!==e.prev&&d!==e.next&&kv(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&0<=Rv(d.prev,d,d.next))return;if(d=d.prevZ,f!==e.prev&&f!==e.next&&kv(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=Rv(f.prev,f,f.next))return;f=f.nextZ}for(;d&&d.z>=h;){if(d!==e.prev&&d!==e.next&&kv(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&0<=Rv(d.prev,d,d.next))return;d=d.prevZ}for(;f&&f.z<=p;){if(f!==e.prev&&f!==e.next&&kv(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=Rv(f.prev,f,f.next))return;f=f.nextZ}return 1}(n,o,s,l):function(e){var t=e.prev,r=e,n=e.next;if(0<=Rv(t,r,n))return;let i=e.next.next;for(;i!==e.prev;){if(kv(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&0<=Rv(i.prev,i,i.next))return;i=i.next}return 1}(n))i.push(t.i/a),i.push(n.i/a),i.push(r.i/a),Hv(n),n=r.next,e=r.next;else if((n=r)===e){u?1===u?Ov(n=function(e,t,r){let n=e;do{var i=n.prev,a=n.next.next;!Fv(i,a)&&Bv(i,n,n.next,a)&&Vv(i,a)&&Vv(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),Hv(n),Hv(n.next),n=e=a),n=n.next}while(n!==e);return Av(n)}(Av(n),i,a),i,a,o,s,l,2):2===u&&function(e,t,r,n,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){var s;if(o.i!==e.i&&function(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Bv(r,r.next,e,t))return 1}while(r=r.next,r!==e);return}(e,t)&&(Vv(e,t)&&Vv(t,e)&&function(e,t){let r=e,n=!1;var i=(e.x+t.x)/2,a=(e.y+t.y)/2;for(;r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next,r!==e;);return n}(e,t)&&(Rv(e.prev,e,t.prev)||Rv(e,t.prev,t))||Fv(e,t)&&0=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function zv(e){return 0Number.EPSILON){var h=Math.sqrt(c),p=Math.sqrt(l*l+u*u),d=t.x-s/h,t=t.y+o/h,h=((r.x-u/p-d)*u-(r.y+l/p-t)*l)/(o*u-s*l),r=(n=d+o*h-e.x,i=t+s*h-e.y,n*n+i*i);if(r<=2)return new Ce(n,i);a=Math.sqrt(r/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(s)===Math.sign(u)&&(e=!0),a=e?(n=-s,i=o,Math.sqrt(c)):(n=o,i=s,Math.sqrt(c/2))}return new Ce(n/a,i/a)}var S=[];for(let e=0,t=b.length,r=t-1,n=e+1;ea.tracks[e].times[0]&&(p=a.tracks[e].times[0]);for(let e=0;e=g.times[p]?(u=(l=p*s+e)+s-e,b0.arraySlice(g.values,l,u)):(p=g.createInterpolant(),c=s-(s=e),p.evaluate(a),b0.arraySlice(p.resultBuffer,s,c)),"quaternion"===v&&(new rh).fromArray(r).normalize().conjugate().toArray(r);var d=o.times.length;for(let e=0;e=a)break e;var s=r[1];t=(a=r[--n-1]))break t}e=n,n=0}for(;n>>1;tt;)--o;return++o,0===a&&o===i||(a>=o&&(o=Math.max(o,1),a=o-1),r=this.getValueSize(),this.times=b0.arraySlice(n,a,o),this.values=b0.arraySlice(this.values,a*r,o*r)),this}validate(){let r=!0;var e=this.getValueSize(),t=(e-Math.floor(e)!=0&&(r=!1),this.times),n=this.values,i=t.length;0===i&&(r=!1);let a=null;for(let e=0;e!==i;e++){var o=t[e];if("number"==typeof o&&isNaN(o)){r=!1;break}if(null!==a&&a>o){r=!1;break}a=o}if(void 0!==n&&b0.isTypedArray(n))for(let e=0,t=n.length;e!==t;++e){var s=n[e];if(isNaN(s)){r=!1;break}}return r}optimize(){var r=b0.arraySlice(this.times),n=b0.arraySlice(this.values),i=this.getValueSize(),a=2302===this.getInterpolation(),o=r.length-1;let s=1;for(let e=1;e{e&&e(n),this.manager.itemEnd(a)},0),n;if(void 0!==B0[a])B0[a].push({onLoad:e,onProgress:t,onError:r});else{B0[a]=[],B0[a].push({onLoad:e,onProgress:t,onError:r});t=new Request(a,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"});const i=this.mimeType,o=this.responseType;fetch(t).then(e=>{if(200!==e.status&&0!==e.status)throw Error(`fetch for "${e.url}" responded with ${e.status}: `+e.statusText);{if(e.status,"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const s=B0[a],t=e.body.getReader();e=e.headers.get("Content-Length");const l=e?parseInt(e):0,u=0!==l;let o=0;e=new ReadableStream({start(a){!function i(){t.read().then(({done:e,value:t})=>{if(e)a.close();else{o+=t.byteLength;const r=new ProgressEvent("progress",{lengthComputable:u,loaded:o,total:l});for(let e=0,t=s.length;e{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then(e=>{return(new DOMParser).parseFromString(e,i)});case"json":return e.json();default:if(void 0===i)return e.text();{var t=/charset="?([^;"\s]*)"?/i.exec(i),t=t&&t[1]?t[1].toLowerCase():void 0;const r=new TextDecoder(t);return e.arrayBuffer().then(e=>r.decode(e))}}}).then(r=>{L0.add(a,r);var n=B0[a];delete B0[a];for(let e=0,t=n.length;e{var n=B0[a];if(void 0===n)throw this.manager.itemError(a),r;delete B0[a];for(let e=0,t=n.length;e{this.manager.itemEnd(a)}),this.manager.itemStart(a)}}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}(class extends null{});(class extends null{});class z0 extends F0{constructor(e){super(e)}load(t,e,r,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const i=this,a=L0.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout(function(){e&&e(a),i.manager.itemEnd(t)},0),a;const o=zc("img");function s(){u(),L0.add(t,this),e&&e(this),i.manager.itemEnd(t)}function l(e){u(),n&&n(e),i.manager.itemError(t),i.manager.itemEnd(t)}function u(){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(t),o.src=t,o}}class V0 extends F0{constructor(e){super(e)}load(r,n,e,i){const a=new nd,o=new z0(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let s=0;for(let e=0;e>16&32768,r=e>>12&2047;var n=e>>23&255;if(!(n<103)){if(142>114-n)+(r>>113-n&1);t=(t|=n-112<<10|r>>1)+(1&r)}return t}}ov.create=function(e,t){return e.prototype=Object.create(ov.prototype),(e.prototype.constructor=e).prototype.getPoint=t,e},Pv.prototype.fromPoints=function(e){return this.setFromPoints(e)},F0.prototype.extractUrlBase=function(e){return ly.extractUrlBase(e)},F0.Handlers={add:function(){},get:function(){}},ah.prototype.center=function(e){return this.getCenter(e)},ah.prototype.empty=function(){return this.isEmpty()},ah.prototype.isIntersectionBox=function(e){return this.intersectsBox(e)},ah.prototype.isIntersectionSphere=function(e){return this.intersectsSphere(e)},ah.prototype.size=function(e){return this.getSize(e)},Uh.prototype.toVector3=function(){},Mh.prototype.empty=function(){return this.isEmpty()},hd.prototype.setFromMatrix=function(e){return this.setFromProjectionMatrix(e)},Bc.prototype.flattenToArrayOffset=function(e,t){return this.toArray(e,t)},Bc.prototype.multiplyVector3=function(e){return e.applyMatrix3(this)},Bc.prototype.multiplyVector3Array=function(){},Bc.prototype.applyToBufferAttribute=function(e){return e.applyMatrix3(this)},Bc.prototype.applyToVector3Array=function(){},Bc.prototype.getInverse=function(e){return this.copy(e).invert()},Oe.prototype.extractPosition=function(e){return this.copyPosition(e)},Oe.prototype.flattenToArrayOffset=function(e,t){return this.toArray(e,t)},Oe.prototype.getPosition=function(){return(new Ae).setFromMatrixColumn(this,3)},Oe.prototype.setRotationFromQuaternion=function(e){return this.makeRotationFromQuaternion(e)},Oe.prototype.multiplyToArray=function(){},Oe.prototype.multiplyVector3=function(e){return e.applyMatrix4(this)},Oe.prototype.multiplyVector4=function(e){return e.applyMatrix4(this)},Oe.prototype.multiplyVector3Array=function(){},Oe.prototype.rotateAxis=function(e){e.transformDirection(this)},Oe.prototype.crossVector=function(e){return e.applyMatrix4(this)},Oe.prototype.translate=function(){},Oe.prototype.rotateX=function(){},Oe.prototype.rotateY=function(){},Oe.prototype.rotateZ=function(){},Oe.prototype.rotateByAxis=function(){},Oe.prototype.applyToBufferAttribute=function(e){return e.applyMatrix4(this)},Oe.prototype.applyToVector3Array=function(){},Oe.prototype.makeFrustum=function(e,t,r,n,i,a){return this.makePerspective(e,t,n,r,i,a)},Oe.prototype.getInverse=function(e){return this.copy(e).invert()},ld.prototype.isIntersectionLine=function(e){return this.intersectsLine(e)},rh.prototype.multiplyVector3=function(e){return e.applyQuaternion(this)},rh.prototype.inverse=function(){return this.invert()},Ih.prototype.isIntersectionBox=function(e){return this.intersectsBox(e)},Ih.prototype.isIntersectionPlane=function(e){return this.intersectsPlane(e)},Ih.prototype.isIntersectionSphere=function(e){return this.intersectsSphere(e)},fp.prototype.area=function(){return this.getArea()},fp.prototype.barycoordFromPoint=function(e,t){return this.getBarycoord(e,t)},fp.prototype.midpoint=function(e){return this.getMidpoint(e)},fp.prototypenormal=function(e){return this.getNormal(e)},fp.prototype.plane=function(e){return this.getPlane(e)},fp.barycoordFromPoint=function(e,t,r,n,i){return fp.getBarycoord(e,t,r,n,i)},fp.normal=function(e,t,r,n){return fp.getNormal(e,t,r,n)},Tv.prototype.extractAllPoints=function(e){return this.extractPoints(e)},Tv.prototype.extrude=function(e){return new Yv(this,e)},Tv.prototype.makeGeometry=function(e){return new e0(this,e)},Ce.prototype.fromAttribute=function(e,t,r){return this.fromBufferAttribute(e,t,r)},Ce.prototype.distanceToManhattan=function(e){return this.manhattanDistanceTo(e)},Ce.prototype.lengthManhattan=function(){return this.manhattanLength()},Ae.prototype.setEulerFromRotationMatrix=function(){},Ae.prototype.setEulerFromQuaternion=function(){},Ae.prototype.getPositionFromMatrix=function(e){return this.setFromMatrixPosition(e)},Ae.prototype.getScaleFromMatrix=function(e){return this.setFromMatrixScale(e)},Ae.prototype.getColumnFromMatrix=function(e,t){return this.setFromMatrixColumn(t,e)},Ae.prototype.applyProjection=function(e){return this.applyMatrix4(e)},Ae.prototype.fromAttribute=function(e,t,r){return this.fromBufferAttribute(e,t,r)},Ae.prototype.distanceToManhattan=function(e){return this.manhattanDistanceTo(e)},Ae.prototype.lengthManhattan=function(){return this.manhattanLength()},$c.prototype.fromAttribute=function(e,t,r){return this.fromBufferAttribute(e,t,r)},$c.prototype.lengthManhattan=function(){return this.manhattanLength()},np.prototype.getChildByName=function(e){return this.getObjectByName(e)},np.prototype.renderDepth=function(){},np.prototype.translate=function(e,t){return this.translateOnAxis(t,e)},np.prototype.getWorldRotation=function(){},np.prototype.applyMatrix=function(e){return this.applyMatrix4(e)},Object.defineProperties(np.prototype,{eulerOrder:{get:function(){return this.rotation.order},set:function(e){this.rotation.order=e}},useQuaternion:{get:function(){},set:function(){}}}),Xp.prototype.setDrawMode=function(){},Object.defineProperties(Xp.prototype,{drawMode:{get:function(){return 0},set:function(){}}}),bg.prototype.initBones=function(){},td.prototype.setLens=function(e,t){void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(H0.prototype,{onlyShadow:{set:function(){}},shadowCameraFov:{set:function(e){this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){}},shadowBias:{set:function(e){this.shadow.bias=e}},shadowDarkness:{set:function(){}},shadowMapWidth:{set:function(e){this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){this.shadow.mapSize.height=e}}}),Object.defineProperties(xp.prototype,{length:{get:function(){return this.array.length}},dynamic:{get:function(){return this.usage===_c},set:function(){this.setUsage(_c)}}}),xp.prototype.setDynamic=function(e){return this.setUsage(!0===e?_c:35044),this},xp.prototype.copyIndicesArray=function(){},xp.prototype.setArray=function(){},P.prototype.addIndex=function(e){this.setIndex(e)},P.prototype.addAttribute=function(e,t){return t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(this.setIndex(t),this):this.setAttribute(e,t):this.setAttribute(e,new xp(t,arguments[2]))},P.prototype.addDrawCall=function(e,t,r){this.addGroup(e,t)},P.prototype.clearDrawCalls=function(){this.clearGroups()},P.prototype.computeOffsets=function(){},P.prototype.removeAttribute=function(e){return this.deleteAttribute(e)},P.prototype.applyMatrix=function(e){return this.applyMatrix4(e)},Object.defineProperties(P.prototype,{drawcalls:{get:function(){return this.groups}},offsets:{get:function(){return this.groups}}}),Zm.prototype.setDynamic=function(e){return this.setUsage(!0===e?_c:35044),this},Zm.prototype.setArray=function(){},Yv.prototype.getArrays=function(){},Yv.prototype.addShapeList=function(){},Yv.prototype.addShape=function(){},Ym.prototype.dispose=function(){},class sC{constructor(e){this.value=e="string"==typeof e?arguments[1]:e}clone(){return new sC(void 0===this.value.clone?this.value:this.value.clone())}}.prototype.onUpdate=function(){return this},Object.defineProperties(gp.prototype,{wrapAround:{get:function(){},set:function(){}},overdraw:{get:function(){},set:function(){}},wrapRGB:{get:function(){return new m}},shading:{get:function(){},set:function(e){this.flatShading=1===e}},stencilMask:{get:function(){return this.stencilFuncMask},set:function(e){this.stencilFuncMask=e}},vertexTangents:{get:function(){},set:function(){}}}),Object.defineProperties(Qp.prototype,{derivatives:{get:function(){return this.extensions.derivatives},set:function(e){this.extensions.derivatives=e}}}),Wm.prototype.clearTarget=function(e,t,r,n){this.setRenderTarget(e),this.clear(t,r,n)},Wm.prototype.animate=function(e){this.setAnimationLoop(e)},Wm.prototype.getCurrentRenderTarget=function(){return this.getRenderTarget()},Wm.prototype.getMaxAnisotropy=function(){return this.capabilities.getMaxAnisotropy()},Wm.prototype.getPrecision=function(){return this.capabilities.precision},Wm.prototype.resetGLState=function(){return this.state.reset()},Wm.prototype.supportsFloatTextures=function(){return this.extensions.get("OES_texture_float")},Wm.prototype.supportsHalfFloatTextures=function(){return this.extensions.get("OES_texture_half_float")},Wm.prototype.supportsStandardDerivatives=function(){return this.extensions.get("OES_standard_derivatives")},Wm.prototype.supportsCompressedTextureS3TC=function(){return this.extensions.get("WEBGL_compressed_texture_s3tc")},Wm.prototype.supportsCompressedTexturePVRTC=function(){return this.extensions.get("WEBGL_compressed_texture_pvrtc")},Wm.prototype.supportsBlendMinMax=function(){return this.extensions.get("EXT_blend_minmax")},Wm.prototype.supportsVertexTextures=function(){return this.capabilities.vertexTextures},Wm.prototype.supportsInstancedArrays=function(){return this.extensions.get("ANGLE_instanced_arrays")},Wm.prototype.enableScissorTest=function(e){this.setScissorTest(e)},Wm.prototype.initMaterial=function(){},Wm.prototype.addPrePlugin=function(){},Wm.prototype.addPostPlugin=function(){},Wm.prototype.updateShadowMap=function(){},Wm.prototype.setFaceCulling=function(){},Wm.prototype.allocTextureUnit=function(){},Wm.prototype.setTexture=function(){},Wm.prototype.setTexture2D=function(){},Wm.prototype.setTextureCube=function(){},Wm.prototype.getActiveMipMapLevel=function(){return this.getActiveMipmapLevel()},Object.defineProperties(Wm.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){this.shadowMap.type=e}},shadowMapCullFace:{get:function(){},set:function(){}},context:{get:function(){return this.getContext()}},vr:{get:function(){return this.xr}},gammaInput:{get:function(){return!1},set:function(){}},gammaOutput:{get:function(){return!1},set:function(e){this.outputEncoding=!0===e?vc:gc}},toneMappingWhitePoint:{get:function(){return 1},set:function(){}},gammaFactor:{get:function(){return 2},set:function(){}}}),Object.defineProperties(km.prototype,{cullFace:{get:function(){},set:function(){}},renderReverseSided:{get:function(){},set:function(){}},renderSingleSided:{get:function(){},set:function(){}}}),Object.defineProperties(Qc.prototype,{wrapS:{get:function(){return this.texture.wrapS},set:function(e){this.texture.wrapS=e}},wrapT:{get:function(){return this.texture.wrapT},set:function(e){this.texture.wrapT=e}},magFilter:{get:function(){return this.texture.magFilter},set:function(e){this.texture.magFilter=e}},minFilter:{get:function(){return this.texture.minFilter},set:function(e){this.texture.minFilter=e}},anisotropy:{get:function(){return this.texture.anisotropy},set:function(e){this.texture.anisotropy=e}},offset:{get:function(){return this.texture.offset},set:function(e){this.texture.offset=e}},repeat:{get:function(){return this.texture.repeat},set:function(e){this.texture.repeat=e}},format:{get:function(){return this.texture.format},set:function(e){this.texture.format=e}},type:{get:function(){return this.texture.type},set:function(e){this.texture.type=e}},generateMipmaps:{get:function(){return this.texture.generateMipmaps},set:function(e){this.texture.generateMipmaps=e}}}),rd.prototype.updateCubeMap=function(e,t){return this.update(e,t)},rd.prototype.clear=function(e,t,r,n){return this.renderTarget.clear(e,t,r,n)},Xc.crossOrigin=void 0,Xc.loadTexture=function(e,t,r,n){var i=new U0,i=(i.setCrossOrigin(this.crossOrigin),i.load(e,r,void 0,n));return t&&(i.mapping=t),i},Xc.loadTextureCube=function(e,t,r,n){var i=new V0,i=(i.setCrossOrigin(this.crossOrigin),i.load(e,r,void 0,n));return t&&(i.mapping=t),i},Xc.loadCompressedTexture=function(){},Xc.loadCompressedTextureCube=function(){};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:ll}})),"undefined"==typeof window||window.__THREE__||(window.__THREE__=ll);const Ey={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:` varying vec2 vUv; void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }`,fragmentShader:` uniform float opacity; uniform sampler2D tDiffuse; varying vec2 vUv; void main() { vec4 texel = texture2D( tDiffuse, vUv ); gl_FragColor = opacity * texel; }`};class Py{constructor(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){}}const Ty=new wd(-1,1,1,-1,0,1),Dy=new P;Dy.setAttribute("position",new U([-1,3,0,-1,-1,0,3,-1,0],3)),Dy.setAttribute("uv",new U([0,2,0,0,2,0],2));class Cy{constructor(e){this._mesh=new Xp(Dy,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,Ty)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class Ay extends Py{constructor(e,t){super(),this.textureID=void 0!==t?t:"tDiffuse",e instanceof Qp?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=$p.clone(e.uniforms),this.material=new Qp({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Cy(this.material)}render(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.fsQuad.material=this.material,this.renderToScreen?e.setRenderTarget(null):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil)),this.fsQuad.render(e)}}class Oy extends Py{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,r){var n=e.getContext(),i=e.state;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0);let a,o;o=this.inverse?(a=0,1):(a=1,0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(n.REPLACE,n.REPLACE,n.REPLACE),i.buffers.stencil.setFunc(n.ALWAYS,a,4294967295),i.buffers.stencil.setClear(o),i.buffers.stencil.setLocked(!0),e.setRenderTarget(r),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.stencil.setLocked(!1),i.buffers.stencil.setFunc(n.EQUAL,1,4294967295),i.buffers.stencil.setOp(n.KEEP,n.KEEP,n.KEEP),i.buffers.stencil.setLocked(!0)}}class Iy{constructor(e,t){var r,n;this.renderer=e,void 0===t?(r={minFilter:vu,magFilter:vu,format:Lu},n=e.getSize(new Ce),this._pixelRatio=e.getPixelRatio(),this._width=n.width,this._height=n.height,(t=new Qc(this._width*this._pixelRatio,this._height*this._pixelRatio,r)).texture.name="EffectComposer.rt1"):(this._pixelRatio=1,this._width=t.width,this._height=t.height),this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],Ey,Ay,this.copyPass=new Ay(Ey),this.clock=new hy}swapBuffers(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){e=this.passes.indexOf(e);-1!==e&&this.passes.splice(e,1)}isLastEnabledPass(t){for(let e=t+1;e varying vec2 vUv; uniform sampler2D colorTexture; uniform vec2 texSize; uniform vec2 direction; float gaussianPdf(in float x, in float sigma) { return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma; } void main() { vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb; vec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb; diffuseSum += (sample1 + sample2) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, 1.0); }`})}getCompositeMaterial(e){return new Qp({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`varying vec2 vUv; void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }`,fragmentShader:`varying vec2 vUv; uniform sampler2D blurTexture1; uniform sampler2D blurTexture2; uniform sampler2D blurTexture3; uniform sampler2D blurTexture4; uniform sampler2D blurTexture5; uniform sampler2D dirtTexture; uniform float bloomStrength; uniform float bloomRadius; uniform float bloomFactors[NUM_MIPS]; uniform vec3 bloomTintColors[NUM_MIPS]; float lerpBloomFactor(const in float factor) { float mirrorFactor = 1.2 - factor; return mix(factor, mirrorFactor, bloomRadius); } void main() { gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) ); }`})}}Fy.BlurDirectionX=new Ce(1,0),Fy.BlurDirectionY=new Ce(0,1);class By extends j0{constructor(e){super(e),this.type=Tu}parse(e){const r=-1,m=1,n=2,g=3,v=4,y=function(e,t){switch(e){case m:case n:case g:break;default:case v:}return r},l=1,u=2,c=4,h="\n",p=function(e,t,r){t=t||1024;let n=e.pos,i=-1,a=0,o="",s=String.fromCharCode.apply(null,new Uint16Array(e.subarray(n,n+128)));for(;(i=s.indexOf(h))<0&&a=e.byteLength||!(o=p(e)))return y(m,"no header found");if(!(s=o.match(/^#\?(\S+)/)))return y(g,"bad initial token");for(a.valid|=l,a.programtype=s[1],a.string+=o+"\n";;){if(!1===(o=p(e)))break;if(a.string+=o+"\n","#"===o.charAt(0))a.comments+=o+"\n";else if((s=o.match(t))&&(a.gamma=parseFloat(s[1])),(s=o.match(r))&&(a.exposure=parseFloat(s[1])),(s=o.match(n))&&(a.valid|=u,a.format=s[1]),(s=o.match(i))&&(a.valid|=c,a.height=parseInt(s[1],10),a.width=parseInt(s[2],10)),a.valid&u&&a.valid&c)break}return a.valid&u?a.valid&c?a:y(g,"missing image size specifier"):y(g,"missing format specifier")}(e));if(r!==S){var M=S.width,E=S.height,P=function(e,t,r){var n=t;if(n<8||32767e.byteLength)return y(m);if(l[0]=e[o++],l[1]=e[o++],l[2]=e[o++],l[3]=e[o++],2!=l[0]||2!=l[1]||(l[2]<<8|l[3])!=n)return y(g,"bad rgbe scanline format");let t=0,r;for(;ts)return y(g,"bad scanline data");if(h){var p=e[o++];for(let e=0;e=2.0 are supported."));else{var l=new Fb(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e",r).replace("#include ",n).replace("#include ",i).replace("#include ",a).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(e){s.specular.value=e}},specularMap:{get:function(){return s.specularMap.value},set:function(e){(s.specularMap.value=e)?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return s.glossiness.value},set:function(e){s.glossiness.value=e}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(e){(s.glossinessMap.value=e)?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class yb{constructor(){this.name=eb.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return vb}extendParams(e,t,r){var n,t=t.extensions[this.name],i=(e.color=new m(1,1,1),e.opacity=1,[]);return Array.isArray(t.diffuseFactor)&&(n=t.diffuseFactor,e.color.fromArray(n),e.opacity=n[3]),void 0!==t.diffuseTexture&&i.push(r.assignTexture(e,"map",t.diffuseTexture)),e.emissive=new m(0,0,0),e.glossiness=void 0!==t.glossinessFactor?t.glossinessFactor:1,e.specular=new m(1,1,1),Array.isArray(t.specularFactor)&&e.specular.fromArray(t.specularFactor),void 0!==t.specularGlossinessTexture&&(n=t.specularGlossinessTexture,i.push(r.assignTexture(e,"glossinessMap",n)),i.push(r.assignTexture(e,"specularMap",n))),Promise.all(i)}createMaterial(e){var t=new vb(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=bc,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class bb{constructor(){this.name=eb.KHR_MESH_QUANTIZATION}}class xb extends x0{constructor(e,t,r,n){super(e,t,r,n)}copySampleValue_(e){var t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,i=e*n*3+n;for(let e=0;e!==n;e++)t[e]=r[i+e];return t}}xb.prototype.beforeStart_=xb.prototype.copySampleValue_,xb.prototype.afterEnd_=xb.prototype.copySampleValue_,xb.prototype.interpolate_=function(e,t,r,n){var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=2*o,l=3*o,u=n-t,n=(r-t)/u,r=n*n,t=r*n,c=e*l,h=c-l,p=-2*t+3*r,d=t-r,f=1-p,m=d-r+n;for(let e=0;e!==o;e++){var g=a[h+e+o],v=a[h+e+s]*u,y=a[c+e+o],b=a[c+e]*u;i[e]=f*g+m*v+p*y+d*b}return i};const _b=new rh;class wb extends xb{interpolate_(e,t,r,n){e=super.interpolate_(e,t,r,n);return _b.fromArray(e).normalize().toArray(e),e}}const Sb={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Mb={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Eb={9728:fu,9729:vu,9984:mu,9985:yu,9986:gu,9987:bu},Pb={33071:pu,33648:du,10497:hu},Tb={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Db={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Cb={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Ab={CUBICSPLINE:void 0,LINEAR:2301,STEP:2300},Ob={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Ib(e,t,r){for(const n in r.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=r.extensions[n])}function Lb(e,t){void 0!==t.extras&&"object"==typeof t.extras&&Object.assign(e.userData,t.extras)}function kb(r){let n="";var i=Object.keys(r).sort();for(let e=0,t=i.length;e{var r,n,i=this.associations.get(e);null!=i&&this.associations.set(t,i);for([r,n]of e.children.entries())a(n,t.children[r])};return a(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(t){var r=Object.values(this.plugins);r.push(this);for(let e=0;e{const r=new Map;for(var[t,n]of i.associations)(t instanceof gp||t instanceof Kc)&&r.set(t,n);return e.traverse(e=>{var t=i.associations.get(e);null!=t&&r.set(e,t)}),r})(n),n})}}function Bb(f,e,m){var t=e.attributes,r=[];for(const b in t){var n=Db[b]||b.toLowerCase();n in f.attributes||r.push(function(e,t){return m.getDependency("accessor",e).then(function(e){f.setAttribute(t,e)})}(t[b],n))}void 0===e.indices||f.index||(i=m.getDependency("accessor",e.indices).then(function(e){f.setIndex(e)}),r.push(i)),Lb(f,e);var i=f,a=e,o=m,s=a.attributes,l=new ah;if(void 0!==s.POSITION){var s=o.json.accessors[s.POSITION],u=s.min,c=s.max;if(void 0!==u&&void 0!==c){l.set(new Ae(u[0],u[1],u[2]),new Ae(c[0],c[1],c[2])),s.normalized&&(u=Rb(Mb[s.componentType]),l.min.multiplyScalar(u),l.max.multiplyScalar(u));var h=a.targets;if(void 0!==h){var p=new Ae,d=new Ae;for(let e=0,t=h.length;eu.maxParticleY&&u.restartParticle(e)})}}),c(s(u),"doUpdate",function(){var e=0span",e),y(e,{"--t":"".concat(s||.65,"s")}),t.forEach(function(e,t){return y(e,{"--d":"".concat(t/(u||8)+c,"s")})})):h.splitText(e,n,c)),o&&e._DOMPlane){i=e._DOMPlane,a=i.plane;if(!a||!a.geometry)return;r1(a.geometry).forEach(function(e){var t=Math.hypot(e.x,e.y)/3+c;e.z=.06*aboutSection.dom3d.camera.position.z,E.to(e,{duration:.5,z:0,ease:"Back.easeOut(5)",delay:t})}),E.to(i,{opacity:1,duration:.5,delay:c,ease:p.easeInOut})}y(e,{"--d":"".concat(c,"s")}),requestAnimationFrame(function(){return g(e,"show")}),xe.unobserve(r.id,e)}}},{key:"mouseMoveHandler",value:function(e){var a=J(e,!0),o=8*ae();magnetics.forEach(function(e){y(e,{transform:""});var t=b(e),r=.05*t.width,n=.1*t.height,r=(t.x+=r,t.maxX-=r,t.y+=n,t.maxY-=n,a.x<=t.x?t.x-a.x:a.x>t.maxX?t.maxX-a.x:0),n=a.y<=t.y?t.y-a.y:a.y>t.maxY?t.maxY-a.y:0,i=t.cX-a.x,t=t.cY-a.y,r=Math.min(Math.hypot(r,n),o),n=Math.atan2(t,i),t=Math.cos(n),i=Math.sin(n),n=.5*o,n=Math.abs(Math.abs((r-n)/n)-1);E.to(e,{x:.25*(t*r*-n),y:.25*(i*r*-n),ease:p.easeOut})})}}],(t=null)&&ox(e.prototype,t),r&&ox(e,r),Object.defineProperty(e,"prototype",{writable:!1}),h}();function ux(e){return(ux="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cx(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function hx(t){for(var e=1;ee.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);ro.lastScrollIndex?"calc(-100% - 1px)":"calc(100% + 1.5px)"}),r?(o.scene3d.pauseCursor(),o.scene3d.setFPSLimit(30),E.to(o.stage3dEl,{filter:"blur(8px)",duration:1.5,ease:p.easeInOut,onComplete:function(){return o.scene3d.setFPSLimit(0)}}),E.to(n,{maxVolume:.075,duration:1.5,ease:p.easeInOut,onUpdate:o.soundIc.updateVolume}),E.set(r,{delay:o.lastScrollIndex<2?.6:0,onComplete:function(){return y(r,{"--y":"0%"})}}),r.lastChild.addEventListener("transitionend",R_(h(o),U_),{once:!0}),o.timer=E.to(o.wordsEl,{duration:o.scrollIndex>=e.length-1?8:5,onComplete:function(){o.lastScrollIndex=o.scrollIndex,o.scrollIndex>=e.length-1?o.scrollIndex=0:o.scrollIndex++,R_(h(o),H_).call(h(o))}}),q(o.startBt,"disable")&&(w(o.startBt,"disable"),E.to(o.startBt,{opacity:1,duration:1.5,ease:p.easeInOut}))):(t.addEventListener("transitionend",R_(h(o),U_),{once:!0}),o.scene3d.startCursor(),o.scene3d.setFPSLimit(30),E.to(o.stage3dEl,{filter:"blur(0px)",duration:1.5,ease:p.easeInOut,clearProps:"filter",onComplete:function(){return o.scene3d.setFPSLimit(0)}}),E.to(n,{maxVolume:.15,duration:1.5,ease:p.easeInOut,onUpdate:o.soundIc.updateVolume}),innerWidth<600&&(g(o.startBt,"disable"),E.to(o.startBt,{opacity:0,duration:1.25,ease:p.easeInOut})))}}),L_(h(o),"resize",function(){y(main.el,{height:"".concat(innerHeight,"px")}),o.maxProgress=innerHeight}),o;throw new TypeError("Cannot call a class as a function")}return e=a,r&&D_(e.prototype,r),n&&D_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(),W_=`uniform vec4 resolution; uniform sampler2D uTexture; uniform float opacity; uniform float scaleY; uniform float pctY; varying vec2 vUv; void main() { vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5) + vec2(.0, (-scaleY*.5)+(scaleY*pctY)); gl_FragColor = texture2D(uTexture,newUV); gl_FragColor.a = opacity; }`,q_=`uniform vec2 uOffset; // uniform float uBend; // uniform float uZ; varying vec2 vUv; #define M_PI 3.1415926535897932384626433832795 vec3 deformationCurve(vec3 position, vec2 uv, vec2 offset) { position.x = position.x + (sin(uv.y * M_PI) * offset.x); position.y = position.y + (sin(uv.x * M_PI) * offset.y); return position; } void main() { vUv = uv; // vec3 newPosition = position; vec3 newPosition = deformationCurve(position, uv, uOffset); // float x = position.x; // float y = position.y; // float d = sqrt(x * x + y * y); // float maxZ = sqrt(.5 * .5 + .5 * .5); // newPosition = vec3(x, y, uZ + ((d-maxZ)*200.0*uBend)); gl_Position = projectionMatrix * modelViewMatrix * vec4( newPosition, 1.0 ); }`,X_=`uniform float time; uniform float progress; uniform sampler2D tDiffuse; uniform vec2 resolution; varying vec2 vUv; uniform vec2 uMouse; uniform float uVelo; uniform float zoom; uniform float scale; uniform float cursorScale; float circle(vec2 uv, vec2 disc_center, float disc_radius, float border_size) { uv -= disc_center; uv *= resolution; float dist = sqrt(dot(uv, uv)); return smoothstep(disc_radius + border_size, disc_radius - border_size, dist); } void main() { vec2 newUV = vUv; vec4 color = texture2D(tDiffuse, newUV); if(zoom > 0.0){ vec2 uCenter = vec2(.5, .5); float intensity = .0375*zoom; float c = circle(newUV, uCenter, 0.0, 0.2 + intensity * scale) * 40. * intensity; newUV = mix(vUv, uCenter, c); // color = texture2D(tDiffuse, newUV);// + texture2D(tDiffuse,warpedUV)*vec4(vec3(c),1.); } float c = circle(newUV, uMouse, 0.0, cursorScale); color = texture2D(tDiffuse, newUV.xy + c * uVelo); gl_FragColor = color; }`,Y_=`varying vec2 vUv; void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`;function Z_(e){return(Z_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function J_(e,t,r){t=sw(e,t,"set");if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}function K_(e,t){for(var r=0;rn?(t=ow(d(i),pw)/ow(d(i),dw)*n,1):(t=1,ow(d(i),dw)/ow(d(i),pw)/n),i.uniforms.resolution.value.x=ow(d(i),pw),i.uniforms.resolution.value.y=ow(d(i),dw),i.uniforms.resolution.value.z=t,i.uniforms.resolution.value.w=r),i._overScale&&(n=Ct((e.y-innerHeight)/-(innerHeight+e.height)),i.uniforms?(i.uniforms.scaleY.value=1-i._overScale,i.uniforms.pctY.value=n,i.uniforms.resolution.value.z*=i._overScale,i.uniforms.resolution.value.w*=i._overScale):(i.texture.repeat.set(i._scaleX*i._overScale,i._scaleY*i._overScale),i.texture.offset.set(.5*(1-i._overScale),(1-i._overScale)*n))),i.scale.set(e.width*i._scaleX,e.height*i._scaleY,1),i.position.x=e.x,i.position.y=-e.y)}),y(r,{visibility:"hidden"});var i,e=r.attributes,t=e.ignoretrigger,n=e.overScale,a=e.bend,o=e.shader,e=(r._DOMPlane=d(i),r.setAttribute("image3d","1"),t||(r.setAttribute("trigger","1"),g(r,"trigger")),i._overScale=!!n&&(parseFloat(n)||.75),i._bend=Boolean(a),i._shader=Boolean(o),i.img=r,J_(d(i),pw,r.width),J_(d(i),dw,r.height),new U0);return e.setCrossOrigin("anonymous"),e.load(r.src,function(e){i.texture=e;var t=new fd(1,1,16,16),e=o?new Qp({uniforms:{uTexture:{value:e},uOffset:{value:new Ce(0,0)},resolution:{value:new $c},opacity:{value:0},scaleY:{value:0},pctY:{value:0}},vertexShader:q_,fragmentShader:W_,transparent:!0,depthTest:!1}):new vp({map:e,side:vl,transparent:!0,depthWrite:!1,depthTest:!1});i.uniforms=e.uniforms,i.plane=new Xp(t,e),i.plane.position.x=.5,i.plane.position.y=-.5,i.plane.renderOrder=1,i.add(i.plane),i.opacity=i.opacity,i.resizeObserver.observe(r),i.update(),xe.observe(0,r,i.triggerObserver),i._bend&&(i.interpolator.onUpdate=i.updateBend)},void 0,function(e){}),lx.add(r),i}return $_(l,[{key:"scaleX",get:function(){return this._scaleX},set:function(e){this._scaleX=e,this.update()}},{key:"scaleY",get:function(){return this._scaleY},set:function(e){this._scaleY=e,this.update()}},{key:"opacity",get:function(){return this._opacity},set:function(e){this._opacity=e,this.plane&&(this.uniforms?this.uniforms.opacity.value=e:this.plane.material.opacity=e)}}]),l}(),mw=fy;Math.PI,Math.cos,Math.sin,Math.pow,Math.sqrt;function gw(e){return(gw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vw(e,t){for(var r=0;rMath.PI&&(t-=l),r<-Math.PI?r+=l:r>Math.PI&&(r-=l),t<=r?d.theta=Math.max(t,Math.min(r,d.theta)):d.theta=d.theta>(t+r)/2?Math.max(t,d.theta):Math.min(r,d.theta)),d.phi=Math.max(u.minPolarAngle,Math.min(u.maxPolarAngle,d.phi)),d.makeSafe(),d.radius*=m,d.radius=Math.max(u.minDistance,Math.min(u.maxDistance,d.radius)),!0===u.enableDamping?u.target.addScaledVector(g,u.dampingFactor):u.target.add(g),n.setFromSpherical(d),n.applyQuaternion(a),e.copy(u.target).add(n),u.object.lookAt(u.target),!0===u.enableDamping?(f.theta*=1-u.dampingFactor,f.phi*=1-u.dampingFactor,g.multiplyScalar(1-u.dampingFactor)):(f.set(0,0,0),g.set(0,0,0)),m=1,!(!(v||o.distanceToSquared(u.object.position)>p||8*(1-s.dot(u.object.quaternion))>p)||(u.dispatchEvent(Aw),o.copy(u.object.position),s.copy(u.object.quaternion),v=!1))}}(),this.dispose=function(){u.domElement.removeEventListener("contextmenu",W),u.domElement.removeEventListener("pointerdown",j),u.domElement.removeEventListener("pointercancel",U),u.domElement.removeEventListener("wheel",H),u.domElement.removeEventListener("pointermove",k),u.domElement.removeEventListener("pointerup",R),null!==u._domElementKeyEvents&&u._domElementKeyEvents.removeEventListener("keydown",G)};const u=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let h=c.NONE;const p=1e-6,d=new _y,f=new _y;let m=1;const g=new Ae;let v=!1;const n=new Ce,i=new Ce,a=new Ce,o=new Ce,s=new Ce,l=new Ce,y=new Ce,b=new Ce,x=new Ce,_=[],r={};function w(){return Math.pow(.95,u.zoomSpeed)}function S(e){f.theta-=e}function M(e){f.phi-=e}const E=function(){const r=new Ae;return function(e,t){r.setFromMatrixColumn(t,0),r.multiplyScalar(-e),g.add(r)}}(),P=function(){const r=new Ae;return function(e,t){!0===u.screenSpacePanning?r.setFromMatrixColumn(t,1):(r.setFromMatrixColumn(t,0),r.crossVectors(u.object.up,r)),r.multiplyScalar(e),g.add(r)}}(),T=function(){const i=new Ae;return function(e,t){var r,n=u.domElement;u.object.isPerspectiveCamera?(r=u.object.position,i.copy(r).sub(u.target),r=i.length(),r*=Math.tan(u.object.fov/2*Math.PI/180),E(2*e*r/n.clientHeight,u.object.matrix),P(2*t*r/n.clientHeight,u.object.matrix)):u.object.isOrthographicCamera?(E(e*(u.object.right-u.object.left)/u.object.zoom/n.clientWidth,u.object.matrix),P(t*(u.object.top-u.object.bottom)/u.object.zoom/n.clientHeight,u.object.matrix)):u.enablePan=!1}}();function D(e){u.object.isPerspectiveCamera?m/=e:u.object.isOrthographicCamera?(u.object.zoom=Math.max(u.minZoom,Math.min(u.maxZoom,u.object.zoom*e)),u.object.updateProjectionMatrix(),v=!0):u.enableZoom=!1}function C(e){u.object.isPerspectiveCamera?m*=e:u.object.isOrthographicCamera?(u.object.zoom=Math.max(u.minZoom,Math.min(u.maxZoom,u.object.zoom/e)),u.object.updateProjectionMatrix(),v=!0):u.enableZoom=!1}function A(e){n.set(e.clientX,e.clientY)}function O(e){o.set(e.clientX,e.clientY)}function I(){var e,t;1===_.length?n.set(_[0].pageX,_[0].pageY):(e=.5*(_[0].pageX+_[1].pageX),t=.5*(_[0].pageY+_[1].pageY),n.set(e,t))}function L(){var e,t;1===_.length?o.set(_[0].pageX,_[0].pageY):(e=.5*(_[0].pageX+_[1].pageX),t=.5*(_[0].pageY+_[1].pageY),o.set(e,t))}function B(){var e=_[0].pageX-_[1].pageX,t=_[0].pageY-_[1].pageY,e=Math.sqrt(e*e+t*t);y.set(0,e)}function N(e){1==_.length?i.set(e.pageX,e.pageY):(r=F(e),t=.5*(e.pageX+r.x),e=.5*(e.pageY+r.y),i.set(t,e)),a.subVectors(i,n).multiplyScalar(u.rotateSpeed);var t,r=u.domElement;S(2*Math.PI*a.x/r.clientHeight),M(2*Math.PI*a.y/r.clientHeight),n.copy(i)}function z(e){var t,r;1===_.length?s.set(e.pageX,e.pageY):(t=F(e),r=.5*(e.pageX+t.x),e=.5*(e.pageY+t.y),s.set(r,e)),l.subVectors(s,o).multiplyScalar(u.panSpeed),T(l.x,l.y),o.copy(s)}function V(e){var t=F(e),r=e.pageX-t.x,e=e.pageY-t.y,t=Math.sqrt(r*r+e*e);b.set(0,t),x.set(0,Math.pow(b.y/y.y,u.zoomSpeed)),D(x.y),y.copy(b)}function j(t){if(!1!==u.enabled){var e;if(0===_.length&&(u.domElement.setPointerCapture(t.pointerId),u.domElement.addEventListener("pointermove",k),u.domElement.addEventListener("pointerup",R)),e=t,_.push(e),"touch"!==t.pointerType){var r=t;let e;switch(r.button){case 0:e=u.mouseButtons.LEFT;break;case 1:e=u.mouseButtons.MIDDLE;break;case 2:e=u.mouseButtons.RIGHT;break;default:e=-1}switch(e){case ul.DOLLY:if(!1===u.enableZoom)return;!function(e){y.set(e.clientX,e.clientY)}(r),h=c.DOLLY;break;case ul.ROTATE:if(r.ctrlKey||r.metaKey||r.shiftKey){if(!1===u.enablePan)return;O(r),h=c.PAN}else{if(!1===u.enableRotate)return;A(r),h=c.ROTATE}break;case ul.PAN:if(r.ctrlKey||r.metaKey||r.shiftKey){if(!1===u.enableRotate)return;A(r),h=c.ROTATE}else{if(!1===u.enablePan)return;O(r),h=c.PAN}break;default:h=c.NONE}}else switch(X(t),_.length){case 1:switch(u.touches.ONE){case cl.ROTATE:if(!1===u.enableRotate)return;I(),h=c.TOUCH_ROTATE;break;case cl.PAN:if(!1===u.enablePan)return;L(),h=c.TOUCH_PAN;break;default:h=c.NONE}break;case 2:switch(u.touches.TWO){case cl.DOLLY_PAN:if(!1===u.enableZoom&&!1===u.enablePan)return;u.enableZoom&&B(),u.enablePan&&L(),h=c.TOUCH_DOLLY_PAN;break;case cl.DOLLY_ROTATE:if(!1===u.enableZoom&&!1===u.enableRotate)return;u.enableZoom&&B(),u.enableRotate&&I(),h=c.TOUCH_DOLLY_ROTATE;break;default:h=c.NONE}break;default:h=c.NONE}h!==c.NONE&&u.dispatchEvent(Ow)}}function k(e){if(!1!==u.enabled)if("touch"===e.pointerType){var t=e;switch(X(t),h){case c.TOUCH_ROTATE:!1!==u.enableRotate&&(N(t),u.update());break;case c.TOUCH_PAN:!1!==u.enablePan&&(z(t),u.update());break;case c.TOUCH_DOLLY_PAN:!1===u.enableZoom&&!1===u.enablePan||(!function(e){u.enableZoom&&V(e),u.enablePan&&z(e)}(t),u.update());break;case c.TOUCH_DOLLY_ROTATE:!1===u.enableZoom&&!1===u.enableRotate||(!function(e){u.enableZoom&&V(e),u.enableRotate&&N(e)}(t),u.update());break;default:h=c.NONE}}else{var r=e;if(!1!==u.enabled)switch(h){case c.ROTATE:!1!==u.enableRotate&&!function(e){i.set(e.clientX,e.clientY),a.subVectors(i,n).multiplyScalar(u.rotateSpeed),e=u.domElement,S(2*Math.PI*a.x/e.clientHeight),M(2*Math.PI*a.y/e.clientHeight),n.copy(i),u.update()}(r);break;case c.DOLLY:!1!==u.enableZoom&&!function(e){b.set(e.clientX,e.clientY),x.subVectors(b,y),0 #include #include #include #include #include #include #include #include #include #include void main() { vec2 cellSize = vec2( 1.0 / WIDTH, 1.0 / WIDTH ); #include #include #include vec3 objectNormal = vec3( ( texture2D( heightmap, uv + vec2( - cellSize.x, 0 ) ).x - texture2D( heightmap, uv + vec2( cellSize.x, 0 ) ).x ) * WIDTH / BOUNDS, ( texture2D( heightmap, uv + vec2( 0, - cellSize.y ) ).x - texture2D( heightmap, uv + vec2( 0, cellSize.y ) ).x ) * WIDTH / BOUNDS, 1.0 ); #include #include #include #include vNormal = normalize( transformedNormal ); float heightValue = texture2D( heightmap, uv ).x; vec3 transformed = vec3( position.x, position.y, heightValue ); #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include }`,fragmentShader:_.meshphong_frag}),t=(e.lights=!0,e.color=new m(6893),e.specular=new m(0),e.shininess=50,e.uniforms.diffuse.value=e.color,e.uniforms.specular.value=e.specular,e.uniforms.shininess.value=Math.max(e.shininess,1e-4),e.uniforms.opacity.value=e.opacity,e.defines.WIDTH=256..toFixed(1),e.defines.BOUNDS=768..toFixed(1),this.waterUniforms=e.uniforms,new fd(768,768,255,255)),t=(this.waterMesh=new Xp(t,e),this.waterMesh.rotation.x=-Math.PI/2,this.waterMesh.matrixAutoUpdate=!1,this.waterMesh.updateMatrix(),new fd(768,768,1,1)),e=(this.meshRay=new Xp(t,new vp({color:9214457,visible:!1})),this.meshRay.rotation.x=-Math.PI/2,this.meshRay.matrixAutoUpdate=!1,this.meshRay.updateMatrix(),this.scene.add(this.waterMesh),this.scene.add(this.meshRay),this.gpuCompute=new Cw(256,256,this.renderer),this.gpuCompute.createTexture());this.heightmapVariable=this.gpuCompute.addVariable("heightmap",`#include uniform vec2 mousePos; uniform float mouseSize; uniform float viscosityConstant; uniform float heightCompensation; void main() { vec2 cellSize = 1.0 / resolution.xy; vec2 uv = gl_FragCoord.xy * cellSize; vec4 heightmapValue = texture2D(heightmap, uv); vec4 north = texture2D(heightmap, uv + vec2(0.0, cellSize.y)); vec4 south = texture2D(heightmap, uv + vec2(0.0, -cellSize.y)); vec4 east = texture2D(heightmap, uv + vec2(cellSize.x, 0.0)); vec4 west = texture2D(heightmap, uv + vec2(-cellSize.x, 0.0)); float newHeight = ((north.x + south.x + east.x + west.x) * 0.5 - heightmapValue.y) * viscosityConstant; float mousePhase = clamp(length((uv - vec2(0.5)) * BOUNDS - vec2(mousePos.x, -mousePos.y)) * PI / mouseSize, 0.0, PI); newHeight += (cos(mousePhase) + 1.0) * 0.28; heightmapValue.y = heightmapValue.x; heightmapValue.x = newHeight; gl_FragColor = heightmapValue; }`,e),this.gpuCompute.setVariableDependencies(this.heightmapVariable,[this.heightmapVariable]),this.heightmapVariable.material.uniforms.mousePos={value:new Ce(1e4,1e4)},this.heightmapVariable.material.uniforms.mouseSize={value:20},this.heightmapVariable.material.uniforms.viscosityConstant={value:.98},this.heightmapVariable.material.uniforms.heightCompensation={value:0},this.heightmapVariable.material.defines.BOUNDS=768..toFixed(1),this.gpuCompute.init();this.smoothShader=this.gpuCompute.createShaderMaterial(`uniform sampler2D smoothTexture; void main() { vec2 cellSize = 1.0 / resolution.xy; vec2 uv = gl_FragCoord.xy * cellSize; vec4 textureValue = texture2D(smoothTexture, uv); textureValue += texture2D(smoothTexture, uv + vec2(0.0, cellSize.y)); textureValue += texture2D(smoothTexture, uv + vec2(0.0, -cellSize.y)); textureValue += texture2D(smoothTexture, uv + vec2(cellSize.x, 0.0)); textureValue += texture2D(smoothTexture, uv + vec2(-cellSize.x, 0.0)); textureValue /= 5.0; gl_FragColor = textureValue; }`,{smoothTexture:{value:null}}),this.readWaterLevelShader=this.gpuCompute.createShaderMaterial(`uniform vec2 point1; uniform sampler2D levelTexture; float shift_right(float v, float amt) { v = floor(v) + 0.5; return floor(v / exp2(amt)); } float shift_left(float v, float amt) { return floor(v * exp2(amt) + 0.5); } float mask_last(float v, float bits) { return mod(v, shift_left(1.0, bits)); } float extract_bits(float num, float from, float to) { from = floor(from + 0.5); to = floor(to + 0.5); return mask_last(shift_right(num, from), to - from); } vec4 encode_float(float val) { if(val == 0.0) return vec4(0, 0, 0, 0); float sign = val > 0.0 ? 0.0 : 1.0; val = abs(val); float exponent = floor(log2(val)); float biased_exponent = exponent + 127.0; float fraction = ((val / exp2(exponent)) - 1.0) * 8388608.0; float t = biased_exponent / 2.0; float last_bit_of_biased_exponent = fract(t) * 2.0; float remaining_bits_of_biased_exponent = floor(t); float byte4 = extract_bits(fraction, 0.0, 8.0) / 255.0; float byte3 = extract_bits(fraction, 8.0, 16.0) / 255.0; float byte2 = (last_bit_of_biased_exponent * 128.0 + extract_bits(fraction, 16.0, 23.0)) / 255.0; float byte1 = (sign * 128.0 + remaining_bits_of_biased_exponent) / 255.0; return vec4(byte4, byte3, byte2, byte1); } void main() { vec2 cellSize = 1.0 / resolution.xy; float waterLevel = texture2D(levelTexture, point1).x; vec2 normal = vec2((texture2D(levelTexture, point1 + vec2(-cellSize.x, 0)).x - texture2D(levelTexture, point1 + vec2(cellSize.x, 0)).x) * WIDTH / BOUNDS, (texture2D(levelTexture, point1 + vec2(0, -cellSize.y)).x - texture2D(levelTexture, point1 + vec2(0, cellSize.y)).x) * WIDTH / BOUNDS); if(gl_FragCoord.x < 1.5) { gl_FragColor = encode_float(waterLevel); } else if(gl_FragCoord.x < 2.5) { gl_FragColor = encode_float(normal.x); } else if(gl_FragCoord.x < 3.5) { gl_FragColor = encode_float(normal.y); } else { gl_FragColor = encode_float(0.0); } }`,{point1:{value:new Ce},levelTexture:{value:null}}),this.readWaterLevelShader.defines.WIDTH=256..toFixed(1),this.readWaterLevelShader.defines.BOUNDS=768..toFixed(1),this.readWaterLevelImage=new Uint8Array(16),this.readWaterLevelRenderTarget=new Qc(4,1,{wrapS:pu,wrapT:pu,minFilter:fu,magFilter:fu,format:Lu,type:xu,stencilBuffer:!1,depthBuffer:!1})}}])&&Rw(e.prototype,r),t&&Rw(e,t),Object.defineProperty(e,"prototype",{writable:!1}),i}(),Cd=__webpack_require__(248),qw=__webpack_require__.n(Cd);function Xw(e){return(Xw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yw(e,t){for(var r=0;ru,!l&&u?(g(h.container,"fixed"),y(h.container,{position:"fixed","--y":""})):l&&!u&&(w(h.container,"fixed"),y(h.container,{position:""}),h.updateContainer())),h.tl.seek(s,!1),l=h.tl.progress(),c=(u=h.animations[o]).start,u=u.end,c=c.progress(),u=u.progress(),t&&0h.maxEndEnable)?g(h.el,"disable"):e&&.6<=c&&u<=h.maxEndEnable&&w(h.el,"disable"),i=scrollbar.speed,!nS&&!scrollbar.dragging&&0=h.triggerIn&&l<1?h.goTo():h.autoScrollOut&&0=h.triggerIn&&c<1&&(l=o-1,h.animations[l]?h.goTo(l):(u=iS[Qw(h,aS)-1])&&(c=u.animations.length-1,u.goTo(c)))),h.introPct=n,h.fullPct=r,eS(h,sS,i),1==r&&h.updateContainer()):!(r<=0||1<=r&&h.autoScrollOut)||e&&t||g(h.el,"disable","hidden"))}),Kw(this,"goTo",function(){nS=!0;var e=h.animations[0e.length)&&(t=e.length);for(var r=0,n=new Array(t);rf.limit?f.difX<0?Math.floor(h):0e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r50/2560*innerWidth?l.next(0=l.sentencesContainer.children.length?0:l.sentenceIndex,l.show(e)}),YM(WM(l),"show",function(e){g(l.sentencesContainer,"disable");var t=l.sentencesContainer.children[l.sentenceIndex].children;requestAnimationFrame(function(){y(VM(t),{"--x":!e||0e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=n.length-1||(t=$("svg",{class:"line"}),r=new Nx(null,500,1),t.appendChild(r.path),e.appendChild(t),c.lines.push(r))}),xe.observe(0,c.nav,pE(sE(c),dE))}),uE(sE(c),dE,{writable:!0,value:function(e,t,r){(t.isIntersecting?Y:Z)(window,"mousemove touchmove touchstart",pE(sE(c),fE))}}),uE(sE(c),fE,{writable:!0,value:function(e){var l=J(e,!0),u=(c.lastCursorValue||(c.lastCursorValue=l),Math.min(Math.hypot(l.x-c.lastCursorValue.x,l.y-c.lastCursorValue.y),100)/100);c.lines.forEach(function(e){var t,r,n,i=e.points,a=e.path,a=b(a),o=a.y-l.y,s=a.y-c.lastCursorValue.y;o*s<0&&l.x>a.x&&l.xe.length)&&(t=e.length);for(var r=0,n=new Array(t);ri?(a=bP(I(s),CP)/bP(I(s),AP)*i,1):(a=1,bP(I(s),AP)/bP(I(s),CP)/i),s.uniforms.resolution.value.x=bP(I(s),CP),s.uniforms.resolution.value.y=bP(I(s),AP),s.uniforms.resolution.value.z=a,s.uniforms.resolution.value.w=o,s.scale.set(r,n,1),s.disable||s.position.set(e,t,bP(I(s),DP)))}),s.assetID=n;var e,t=wP[n];return t?(e=(t=t.clone(!0)).material.uniforms.uTexture.value,xP(I(s),CP,e.image.videoWidth||e.image.width),xP(I(s),AP,e.image.videoHeight||e.image.height),s.material=t.material,s.uniforms=s.material.uniforms,s.texture=e,s.plane=t,s.add(s.plane)):((e=new U0).setCrossOrigin("anonymous"),e.load(URL.createObjectURL(loaders.cases.get(n).result),function(e){s.texture=e;var t=new fd(1,1,16,16),r=new Qp({uniforms:{uTexture:{value:e},uOffset:{value:new Ce(0,0)},resolution:{value:new $c},opacity:{value:0}},vertexShader:q_,fragmentShader:W_,transparent:!0,depthTest:!1});s.plane=new Xp(t,r),s.add(s.plane),s.material=r,s.uniforms=r.uniforms,xP(I(s),CP,e.image.videoWidth||e.image.width),xP(I(s),AP,e.image.videoHeight||e.image.height),wP[n]=s.plane,s.update(),i&&i()})),s.aspectRatio=1,s.size=1,s}return t=o,(e=[{key:"size",get:function(){return bP(this,MP)},set:function(e){xP(this,MP,e),this.update()}},{key:"aspectRatio",get:function(){return bP(this,SP)},set:function(e){xP(this,SP,e),this.update()}},{key:"x",get:function(){return bP(this,PP)},set:function(e){xP(this,PP,e),this.update()}},{key:"y",get:function(){return bP(this,TP)},set:function(e){xP(this,TP,e),this.update()}},{key:"z",get:function(){return bP(this,DP)},set:function(e){xP(this,DP,e),this.update()}},{key:"_scale",get:function(){return bP(this,EP)},set:function(e){xP(this,EP,e),this.update()}},{key:"vertexList",get:function(){return this.plane?r1(this.plane.geometry):null}},{key:"opacity",get:function(){return this.uniforms?this.uniforms.opacity.value:null},set:function(e){this.uniforms&&(this.uniforms.opacity.value=e)}},{key:"uOffset",get:function(){return this.uniforms?this.uniforms.uOffset.value:null},set:function(e){this.uniforms&&(this.uniforms.uOffset.value=e)}}])&&pP(t.prototype,e),r&&pP(t,r),Object.defineProperty(t,"prototype",{writable:!1}),o}(zm),IP=class{target;name;intersected;wasIntersected=!1;distance;constructor(e,t){this.target=e,this.name=t,this.intersected=!1,this.distance=0}},LP=class{type;cancelBubble;originalEvent;coords=new Ce(0,0);distance=0;intersected=!1;constructor(e,t=null){this.cancelBubble=!1,this.type=e,this.originalEvent=t}stopPropagation(){this.cancelBubble=!0}},kP=class{renderer;camera;domElement;bindEventsOnBodyElement;autoAdd;scene;mouse;supportsPointerEvents;interactiveObjects;closestObject;raycaster;treatTouchEventsAsMouseEvents;constructor(e,t,r,n){this.renderer=e,this.camera=t,this.domElement=r,this.bindEventsOnBodyElement=!(n&&typeof n.bindEventsOnBodyElement<"u")||n.bindEventsOnBodyElement,this.scene=n&&typeof n.scene<"u"?n.scene:null,this.scene&&(this.scene.onBeforeRender=()=>{this.autoAdd&&null!==this.scene&&this.scene.traverse(e=>{this.add(e),e.addEventListener("removed",e=>{this.remove(e.target)})}),this.update()}),this.autoAdd=!!(n&&typeof n.autoAdd<"u")&&n.autoAdd,this.autoAdd&&this.scene,this.mouse=new Ce(-1,1),this.supportsPointerEvents=!!window.PointerEvent,this.interactiveObjects=[],this.closestObject=null,this.raycaster=new yy,r.addEventListener("click",this.onMouseClick),this.supportsPointerEvents&&((this.bindEventsOnBodyElement?r.ownerDocument:r).addEventListener("pointermove",this.onDocumentPointerMove),r.addEventListener("pointerdown",this.onPointerDown),r.addEventListener("pointerup",this.onPointerUp)),(this.bindEventsOnBodyElement?r.ownerDocument:r).addEventListener("mousemove",this.onDocumentMouseMove),r.addEventListener("mousedown",this.onMouseDown),r.addEventListener("mouseup",this.onMouseUp),r.addEventListener("touchstart",this.onTouchStart,{passive:!0}),r.addEventListener("touchmove",this.onTouchMove,{passive:!0}),r.addEventListener("touchend",this.onTouchEnd,{passive:!0}),this.treatTouchEventsAsMouseEvents=!0}dispose=()=>{this.domElement.removeEventListener("click",this.onMouseClick),this.supportsPointerEvents&&((this.bindEventsOnBodyElement?this.domElement.ownerDocument:this.domElement).removeEventListener("pointermove",this.onDocumentPointerMove),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointerup",this.onPointerUp)),(this.bindEventsOnBodyElement?this.domElement.ownerDocument:this.domElement).removeEventListener("mousemove",this.onDocumentMouseMove),this.domElement.removeEventListener("mousedown",this.onMouseDown),this.domElement.removeEventListener("mouseup",this.onMouseUp),this.domElement.removeEventListener("touchstart",this.onTouchStart),this.domElement.removeEventListener("touchmove",this.onTouchMove),this.domElement.removeEventListener("touchend",this.onTouchEnd)};add=(r,e=[])=>{r&&!this.interactiveObjects.find(e=>e.target===r)&&(0{var t=r.getObjectByName(e);t&&(t=new IP(t,e),this.interactiveObjects.push(t))}):(e=new IP(r,r.name),this.interactiveObjects.push(e)))};remove=(e,r=[])=>{if(e){let t=new Set(0!t.has(e.name))}};update=()=>{this.raycaster.setFromCamera(this.mouse,this.camera),this.interactiveObjects.forEach(e=>{e.target&&this.checkIntersection(e)}),this.interactiveObjects.sort(function(e,t){return e.distance-t.distance});var e,t=this.interactiveObjects.find(e=>e.intersected)??null;t!=this.closestObject&&(this.closestObject&&(e=new LP("mouseout"),this.dispatch(this.closestObject,e)),t&&(e=new LP("mouseover"),this.dispatch(t,e)),this.closestObject=t);let r;this.interactiveObjects.forEach(e=>{!e.intersected&&e.wasIntersected&&(r=r||new LP("mouseleave"),this.dispatch(e,r))});let n;this.interactiveObjects.forEach(e=>{e.intersected&&!e.wasIntersected&&(n=n||new LP("mouseenter"),this.dispatch(e,n))})};checkIntersection=e=>{var r=this.raycaster.intersectObjects([e.target],!0);if(e.wasIntersected=e.intersected,0{e.distance{this.mapPositionToPoint(this.mouse,e.clientX,e.clientY);let t=new LP("mousemove",e);this.interactiveObjects.forEach(e=>{this.dispatch(e,t)})};onDocumentPointerMove=e=>{this.mapPositionToPoint(this.mouse,e.clientX,e.clientY);let t=new LP("pointermove",e);this.interactiveObjects.forEach(e=>{this.dispatch(e,t)})};onTouchMove=e=>{0{this.dispatch(e,t)})};onMouseClick=e=>{this.update();let t=new LP("click",e);this.interactiveObjects.forEach(e=>{e.intersected&&this.dispatch(e,t)})};onMouseDown=e=>{this.mapPositionToPoint(this.mouse,e.clientX,e.clientY),this.update();let t=new LP("mousedown",e);this.interactiveObjects.forEach(e=>{e.intersected&&this.dispatch(e,t)})};onPointerDown=e=>{this.mapPositionToPoint(this.mouse,e.clientX,e.clientY),this.update();let t=new LP("pointerdown",e);this.interactiveObjects.forEach(e=>{e.intersected&&this.dispatch(e,t)})};onTouchStart=e=>{0{e.intersected&&this.dispatch(e,t)})};onMouseUp=e=>{let t=new LP("mouseup",e);this.interactiveObjects.forEach(e=>{this.dispatch(e,t)})};onPointerUp=e=>{let t=new LP("pointerup",e);this.interactiveObjects.forEach(e=>{this.dispatch(e,t)})};onTouchEnd=e=>{0{this.dispatch(e,t)})};dispatch=(e,t)=>{e.target&&!t.cancelBubble&&(t.coords=this.mouse,t.distance=e.distance,t.intersected=e.intersected,e.target.dispatchEvent(t))};mapPositionToPoint=(e,t,r)=>{var n=this.renderer.domElement.getBoundingClientRect();e.x=(t-n.left)/n.width*2-1,e.y=2*-((r-n.top)/n.height)+1}};function RP(e){return(RP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function FP(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function BP(t){for(var e=1;ee.length)&&(t=e.length);for(var r=0,n=new Array(t);re?1:-1,u.currentNameEl&&(M([u.currentNameEl,u.currentPageEl]),E.to(u.currentNameEl,{"--i":"".concat(100*t,"%"),opacity:0,duration:.8,ease:ls.easeInOut,onCompleteParams:[u.currentNameEl],onComplete:function(e){return e.remove()}}),E.to(u.currentPageEl,{"--i":"".concat(100*t,"%"),opacity:0,duration:.8,ease:ls.easeInOut,onCompleteParams:[u.currentPageEl],onComplete:function(e){return e.remove()}})),a="i_".concat(e),n=".".concat(a),r=S(n,u.h3El),n=S(n,u.startEl),i=r||ie("span",{class:a}),a=n||ie("span",{class:a}),i.innerHTML=u.casesData[e].name,a.innerHTML=e+1,u.h3El.appendChild(i),u.startEl.appendChild(a),u.currentNameEl=i,u.currentPageEl=a,M([i,a]),r||E.set(i,{"--i":"".concat(100*-t,"%"),opacity:0}),n||E.set(a,{"--i":"".concat(100*-t,"%"),opacity:0}),E.to(i,{"--i":"0%",opacity:1,duration:.8,ease:ls.easeInOut}),E.to(a,{"--i":"0%",opacity:1,duration:.8,ease:ls.easeInOut}),u.lastIndex=e)}}),GP(L(u),DT,{writable:!0,value:function(e){u.wheelInterpolator.onUpdate=null;var t=-u.index*u.absolutePageSize;e=e||(innerWidth<600?.5:.8),E.killTweensOf(u.container3d.position),E.to(u.container3d.position,{x:t,duration:e,ease:p.easeOut,onUpdate:R(L(u),wT),onComplete:R(L(u),ET)}),R(L(u),TT).call(L(u),R(L(u),MT).call(L(u),u.index))}}),GP(L(u),CT,{writable:!0,value:function(){var e,r;u.opened&&(e=u.container3d.position.x-u.lastSliderX,u.sliderSpeed+=.2*(e-u.sliderSpeed),r=u.sliderSpeed/(599e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);ra.inputEl.clientWidth&&(y(a.inputEl.parentNode,{"--fs":e-=.025}),$T(a,tD).call(a))}}),ZT(this,rD,{writable:!0,value:function(e){a.answer=e,a.value=JT({},a.data.name,a.answer.name||a.answer);var t=e.el,r=t.parentNode,r=S(".active",r);r&&r!==t&&w(r,"active"),g(t,"active"),e.description&&$T(a,nD).call(a,e.description),a.onUpdate&&a.onUpdate(a)}}),ZT(this,nD,{writable:!0,value:function(e){var t,r=b(a.descriptionEl).height,n=a.descriptionEl.children[0],i=a.descriptionEl.p.cloneNode(),e=(M([a.descriptionEl,i.children,n.children]),y(a.descriptionEl,{height:""}),y(i,{position:"","--y":"",opacity:""}),i.innerHTML=e,WT(a.descriptionEl.children));se(a.descriptionEl),a.descriptionEl.appendChild(i),lx.splitText(i),a.splitedTextParts=G(".split-text .line-container",a.el),t=a.descriptionEl,j(e).forEach(function(e){return t.appendChild(e)}),y(n,{position:"absolute"}),e=b(a.descriptionEl).height,E.fromTo(i.children,{"--y":"35%",opacity:0},{"--y":"0%",opacity:1,duration:.75,ease:p.easeOut,delay:.25,stagger:1/8}),n.children&&n.children.length&&E.to(n.children,{"--y":"-35%",opacity:0,duration:.7,ease:p.easeOut,stagger:.1,onCompleteParams:[n],onComplete:function(e){return e.remove()}}),E.fromTo(a.descriptionEl,{height:r},{height:e,duration:.7,ease:p.easeInOut,delay:.15,clearProps:"height"})}}),ZT(this,iD,{writable:!0,value:function(){a.value=a.answer=null,a.onBack&&a.onBack(a)}}),ZT(this,aD,{writable:!0,value:function(e){13===e.keyCode&&a.onNext&&!a.thanksAnim&&(!a.data.options||a.data.options&&a.value)&&a.onNext()}}),JT(this,"validate",function(){var e={valid:!0},t="pt-br"==lang;switch(a.data.type){case"options":case"carousel":break;case"input":(e=function(e,t){var r=e.value?e.value.trim():"",n=r.length,i=e.attributes,a=i.type,o=i.name,s=i.ignore,l=i.minLength,i=i.maxLength,e=e.tagName.toLowerCase(),s=!(void 0!==s),a=a&&a.value.toLowerCase(),l=l?l.value:2,i=i?i.value:"textarea"==e?1e3:140;if(s&&"hidden"!=a){var u=!0;switch(a){case"tel":u=!(n<10);break;case"email":u=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r.toLowerCase())}return{valid:u=u&&!(ne.length)&&(t=e.length);for(var r=0,n=new Array(t);rr?u:0);E.fromTo(h.stepsEl,{height:s.height},{height:r,duration:.7,delay:e,ease:p.easeInOut,clearProps:"height,flex"}),c&&E.fromTo(wrapper,{height:a},{height:c,duration:.7,delay:e,ease:p.easeInOut,clearProps:"height"})}),h.currentStep=o,xD(F(h),ED).call(F(h))}),gD(F(h),ED,{writable:!0,value:function(){E.to(h.progressEl,{"--p":h.stepIndex/(h.steps.length-1),duration:.75,ease:p.easeInOut})}}),gD(F(h),PD,{writable:!0,value:function(e){h.lastAnswer=e.answer&&e.answer.value?e.answer:h.lastAnswer,h.formData=uD(uD({},h.formData),e.value),xD(F(h),DD).call(F(h))}}),gD(F(h),TD,{writable:!0,value:function(e){h.currentStep.answer&&w(h.nextBtEl,"disable"),h.stepIndex==h.steps.length-2&&w(h.footerFinishEl,"disable"),w(h.footerEl,"disable")}}),gD(F(h),DD,{writable:!0,value:function(){w([h.inputFinishEl,h.footerFinishEl],"error"),h.currentStep.active&&h.stepIndex!=h.steps.length-2&&w(h.nextBtEl,"disable");function n(e){var t;e.answer&&(t=h.answerElTemplate.cloneNode(!0),(e.aswerEl=t).innerHTML=e.answer.name,requestAnimationFrame(function(){h.answersEl.appendChild(t),requestAnimationFrame(function(){g(t,"show"),e.swipingAnswer=!1})}))}var e;h.steps.forEach(function(t){var e,r=t.aswerEl;r?t.swipingAnswer||t.answer&&r.textContent===t.answer.name||(t.swipingAnswer=!0,e=function(e){r.remove(),t.aswerEl=null,n(t)},parseFloat(te(r,"opacity"))?(r.addEventListener("transitionend",e,{once:!0,signal:xD(F(h),MD).signal}),w(r,"show")):e()):n(t)}),h.footerEl.clientHeight||(g(h.footerProgressEl,"show"),y(h.footerEl,{height:""}),e=b(h.footerEl).height,y(h.footerEl,{height:0}),E.to(h.footerEl,{height:"".concat(e,"px"),clearProps:"height",duration:.8,ease:p.easeInOut}),E.to(h.footerEl,{opacity:1,duration:.8,ease:p.easeInOut,delay:.24}))}}),gD(F(h),CD,{writable:!0,value:function(){var t,r,n={"pt-br":{error:"Desculpe, houve um problema. Por favor tente novamente.",warningTerms:"Por favor aceite os termos antes de enviar."},"en-us":{error:"Sorry, there was a problem. Please try again.",warningTerms:"Please accept the terms before submitting."}};h.currentStep.validate().valid&&(h.checkEl.checked?(h.sendBt.append(h.loader),g([h.stepsEl,h.footerEl],"disable"),g(h.footerEl,"sending"),w([h.inputFinishEl,h.footerFinishEl],"error"),t="",h.quizJson.forEach(function(e){e=e.name;t+="".concat(e,": ").concat(h.formData[e],"\n")}),(r=new FormData).append("text",t),fetch("/slack.php",{method:"POST",body:r,signal:xD(F(h),MD).signal}).then(function(e){if(e.ok)return e.text();throw window.ga&>ag("send","exception",{exDescription:e.text()}),new Error("There was a problem")}).then(function(t){"ok"==t?(w([h.stepsEl],"disable"),w(h.footerEl,"sending"),window.ga&>ag("send","pageview","/thank-you"),h.next()):(h.warningEl.innerHTML=n[lang].error,g(h.footerFinishEl,"error"),w([h.stepsEl,h.footerEl],"disable"),w(h.footerEl,"sending"),window.ga&>ag("send","exception",{exDescription:e.message}))}).catch(function(e){h.warningEl.innerHTML=n[lang].error,g(h.footerFinishEl,"error"),w([h.stepsEl,h.footerEl],"disable"),w(h.footerEl,"sending"),window.ga&>ag("send","exception",{exDescription:e.message})})):(h.warningEl.innerHTML=n[lang].warningTerms,g([h.footerFinishEl,h.inputFinishEl],"error")))}}),vD(F(h),"doOpen",function(){h.el.insertBefore(h.water2d.canvas,h.el.children[0]),h.water2d.start(),h.swapStep(.3),E.to([h.progressEl],{opacity:1,duration:1,delay:.65,ease:p.easeInOut})}),vD(F(h),"doClose",function(){}),h;throw new TypeError("Cannot call a class as a function")}return t=o,n&&pD(t.prototype,n),i&&pD(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}();function OD(e){return(OD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ID(e){return function(e){if(Array.isArray(e))return LD(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){var r;if(e)return"string"==typeof e?LD(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?LD(e,t):void 0}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function LD(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);rSee your Cookie Settings.',primary_btn:{text:"Accept",role:"accept_all"}},settings_modal:{title:"Privacy Overview",save_settings_btn:"Save settings",accept_all_btn:"Accept all",reject_all_btn:"Reject all",cookie_table_headers:[{col1:"Name"},{col2:"Domain"},{col3:"Expiration"},{col4:"Description"},{col5:"Type"}],blocks:[{title:"Cookie usage",description:"I use cookies to ensure the basic functionalities of the website and to enhance your online experience. You can choose for each category to opt-in/out whenever you want."},{title:"Analytics cookies",description:"These cookies collect information about how you use the website, which pages you visited and which links you clicked on. All of the data is anonymized and cannot be used to identify you.",toggle:{value:"analytics",enabled:!0,readonly:!1},cookie_table:[{col1:"^_ga",col2:"google.com",col3:"2 years",col4:"",col5:"Permanent cookie",is_regex:!0},{col1:"_gid",col2:"google.com",col3:"1 day",col4:"",col5:"Permanent cookie"}]}]}},"pt-br":{consent_modal:{description:'Usamos cookies em nosso site.
Consulte suas Configurações.',primary_btn:{text:"Aceitar",role:"accept_all"}},settings_modal:{title:"Visão geral da privacidade",save_settings_btn:"Salvar configurações",accept_all_btn:"Aceitar tudo",reject_all_btn:"Rejeitar tudo",cookie_table_headers:[{col1:"Nome"},{col2:"Domínio"},{col3:"Expiração"},{col4:"Descrição"},{col5:"Tipo"}],blocks:[{title:"Uso de cookies",description:"Eu uso cookies para garantir as funcionalidades básicas do site e para aprimorar sua experiência online. Você pode escolher cada categoria para entrar/sair sempre que quiser."},{title:"Cookies analíticos",description:"Esses cookies coletam informações sobre como você usa o site, quais páginas você visitou e em quais links você clicou. Todos os dados são anonimizados e não podem ser usados para identificá-lo.",toggle:{value:"analytics",enabled:!0,readonly:!1},cookie_table:[{col1:"^_ga",col2:"google.com",col3:"2 years",col4:"",col5:"Permanent cookie",is_regex:!0},{col1:"_gid",col2:"google.com",col3:"1 day",col4:"",col5:"Permanent cookie"}]}]}}}});var e=S("#cc--main button");g(e,"mask-hover","split-hover"),AnimationSetup.scan(e.parentNode)}}),nC(this,"start",function(){var e=[menu.logo,menu.hamburguer,menu.nav],e=(599