PageSourceSearch

https://www.hotel-le-coudon.fr/js/150.js

js hotel-le-coudon.fr collected 2026-09-25 12:15:49 UTC 726,459 bytes, 2 lines download raw bytes

1/*! For license information please see 150.js.LICENSE.txt */
2(self.webpackChunksiteref_mgs=self.webpackChunksiteref_mgs||[]).push([[150,367],{2367(t,e,i){!function(t,e,i){"use strict";function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(){return s=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},s.apply(this,arguments)}function o(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,a(t,e)}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t){this.message=t,"captureStackTrace"in Error?Error.captureStackTrace(this,c):this.stack=(new Error).stack}c.prototype=Object.create(Error.prototype),c.prototype.name="PSVError",c.prototype.constructor=c;var h=function(){function t(t){this.psv=t}var i=t.prototype;return i.destroy=function(){delete this.psv},i.supportsTransition=function(t){return!1},i.supportsPreload=function(t){return!1},i.loadTexture=function(t,e,i){throw new c("loadTexture not implemented")},i.createMesh=function(t){throw new c("createMesh not implemented")},i.setTexture=function(t,e,i){throw new c("setTexture not implemented")},i.setTextureOpacity=function(t,e){throw new c("setTextureOpacity not implemented")},i.disposeTexture=function(t){throw new c("disposeTexture not implemented")},i.setOverlay=function(t,e,i){throw new c("setOverlay not implemented")},t.createOverlayMaterial=function(i){var n,r=void 0===i?{}:i,o=r.additionalUniforms,a=r.overrideVertexShader;return new e.ShaderMaterial({uniforms:s({},o,(n={},n[t.OVERLAY_UNIFORMS.panorama]={value:new e.Texture},n[t.OVERLAY_UNIFORMS.overlay]={value:new e.Texture},n[t.OVERLAY_UNIFORMS.globalOpacity]={value:1},n[t.OVERLAY_UNIFORMS.overlayOpacity]={value:1},n)),vertexShader:a||"\nvarying vec2 vUv;\n\nvoid main() {\n  vUv = uv;\n  gl_Position = projectionMatrix *  modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"\nuniform sampler2D "+t.OVERLAY_UNIFORMS.panorama+";\nuniform sampler2D "+t.OVERLAY_UNIFORMS.overlay+";\nuniform float "+t.OVERLAY_UNIFORMS.globalOpacity+";\nuniform float "+t.OVERLAY_UNIFORMS.overlayOpacity+";\n\nvarying vec2 vUv;\n\nvoid main() {\n  vec4 tColor1 = texture2D( "+t.OVERLAY_UNIFORMS.panorama+", vUv );\n  vec4 tColor2 = texture2D( "+t.OVERLAY_UNIFORMS.overlay+", vUv );\n  gl_FragColor = vec4(\n    mix( tColor1.rgb, tColor2.rgb, tColor2.a * "+t.OVERLAY_UNIFORMS.overlayOpacity+" ),\n    "+t.OVERLAY_UNIFORMS.globalOpacity+"\n  );\n}"})},t}();h.id=null,h.supportsDownload=!1,h.supportsOverlay=!1,h.OVERLAY_UNIFORMS={panorama:"panorama",overlay:"overlay",globalOpacity:"globalOpacity",overlayOpacity:"overlayOpacity"};var u=1500,d=500,p=4,f=300,m=500,g=100,v=2e3,_=300,y=10,x="photoSphereViewer",M="psvSphere",b={ROTATE_LAT_UP:"rotateLatitudeUp",ROTATE_LAT_DOWN:"rotateLatitudeDown",ROTATE_LONG_RIGHT:"rotateLongitudeRight",ROTATE_LONG_LEFT:"rotateLongitudeLeft",ZOOM_IN:"zoomIn",ZOOM_OUT:"zoomOut",TOGGLE_AUTOROTATE:"toggleAutorotate"},w={AUTOROTATE:"autorotate",BEFORE_RENDER:"before-render",BEFORE_ROTATE:"before-rotate",CLICK:"click",CLOSE_PANEL:"close-panel",CONFIG_CHANGED:"config-changed",DOUBLE_CLICK:"dblclick",FULLSCREEN_UPDATED:"fullscreen-updated",HIDE_NOTIFICATION:"hide-notification",HIDE_OVERLAY:"hide-overlay",HIDE_TOOLTIP:"hide-tooltip",KEY_PRESS:"key-press",LOAD_PROGRESS:"load-progress",OPEN_PANEL:"open-panel",PANORAMA_LOADED:"panorama-loaded",POSITION_UPDATED:"position-updated",READY:"ready",RENDER:"render",SHOW_NOTIFICATION:"show-notification",SHOW_OVERLAY:"show-overlay",SHOW_TOOLTIP:"show-tooltip",SIZE_UPDATED:"size-updated",STOP_ALL:"stop-all",ZOOM_UPDATED:"zoom-updated"}
2,S={GET_ANIMATE_POSITION:"get-animate-position",GET_ROTATE_POSITION:"get-rotate-position"},E={ENTER_OBJECT:"enter-object",HOVER_OBJECT:"hover-object",LEAVE_OBJECT:"leave-object"},T={MENU:"menu",TWO_FINGERS:"twoFingers",CTRL_ZOOM:"ctrlZoom",ERROR:"error",DESCRIPTION:"description"},A={linear:function(t){return t},inQuad:function(t){return t*t},outQuad:function(t){return t*(2-t)},inOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},inCubic:function(t){return t*t*t},outCubic:function(t){return--t*t*t+1},inOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},inQuart:function(t){return t*t*t*t},outQuart:function(t){return 1- --t*t*t*t},inOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},inQuint:function(t){return t*t*t*t*t},outQuint:function(t){return 1+--t*t*t*t*t},inOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t},inSine:function(t){return 1-Math.cos(t*(Math.PI/2))},outSine:function(t){return Math.sin(t*(Math.PI/2))},inOutSine:function(t){return.5-.5*Math.cos(Math.PI*t)},inExpo:function(t){return Math.pow(2,10*(t-1))},outExpo:function(t){return 1-Math.pow(2,-10*t)},inOutExpo:function(t){return(t=2*t-1)<0?.5*Math.pow(2,10*t):1-.5*Math.pow(2,-10*t)},inCirc:function(t){return 1-Math.sqrt(1-t*t)},outCirc:function(t){return Math.sqrt(1-(t-1)*(t-1))},inOutCirc:function(t){return(t*=2)<1?.5-.5*Math.sqrt(1-t*t):.5+.5*Math.sqrt(1-(t-=2)*t)}},R={Enter:"Enter",Control:"Control",Escape:"Escape",Space:" ",PageUp:"PageUp",PageDown:"PageDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Delete:"Delete",Plus:"+",Minus:"-"},C=Object.freeze({__proto__:null,DEFAULT_TRANSITION:u,ANIMATION_MIN_DURATION:d,MOVE_THRESHOLD:p,DBLCLICK_DELAY:f,LONGTOUCH_DELAY:m,TWOFINGERSOVERLAY_DELAY:g,CTRLZOOM_TIMEOUT:v,INERTIA_WINDOW:_,SPHERE_RADIUS:y,VIEWER_DATA:x,MESH_USER_DATA:M,ACTIONS:b,EVENTS:w,CHANGE_EVENTS:S,OBJECT_EVENTS:E,IDS:T,EASINGS:A,KEY_CODES:R}),L=x+"_touchSupport",P={loaded:!1,pixelRatio:1,isWebGLSupported:!1,isTouchEnabled:null,maxTextureWidth:0,mouseWheelEvent:null,fullscreenEvent:null,load:function(){if(!P.loaded){var t=O();P.loaded=!0,P.pixelRatio=window.devicePixelRatio||1,P.isWebGLSupported=null!=t,P.isTouchEnabled=D(),P.maxTextureWidth=N(t),P.mouseWheelEvent=F(),P.fullscreenEvent=B()}}},I=null;function O(){var t=document.createElement("canvas"),e=["webgl","experimental-webgl","moz-webgl","webkit-3d"],i=null;return t.getContext&&e.some(function(e){try{return null!==(i=t.getContext(e))}catch(t){return!1}})?i:null}function D(){var t="ontouchstart"in window||navigator.maxTouchPoints>0;L in localStorage&&(t="true"===localStorage[L]);var e=new Promise(function(e){var i,n=function(){i(),localStorage[L]=!1,e(!1)},r=function(){i(),localStorage[L]=!0,e(!0)},s=function(){i(),localStorage[L]=t,e(t)};window.addEventListener("mousedown",n,!1),window.addEventListener("touchstart",r,!1);var o=setTimeout(s,1e4);i=function(){window.removeEventListener("mousedown",n),window.removeEventListener("touchstart",r),clearTimeout(o)}});return{initial:t,promise:e}}function N(t){return null!==t?t.getParameter(t.MAX_TEXTURE_SIZE):0}function U(t){var e=document.createElement("canvas"),i=e.getContext("2d");for(e.width=t,e.height=t/2;e.width>1024;){i.fillStyle="white",i.fillRect(0,0,1,1);try{if(i.getImageData(0,0,1,1).data[0]>0)return e.width}catch(t){}e.width/=2,e.height/=2}throw new c("Unable to detect system capabilities")}function F(){return"onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll"}P.getMaxCanvasWidth=function(){return null===I&&(I=U(P.maxTextureWidth)),I};var z={exitFullscreen:"fullscreenchange",webkitExitFullscreen:"webkitfullscreenchange",mozCancelFullScreen:"mozfullscreenchange",msExitFullscreen:"MSFullscreenChange"};function B(){var t=Object.keys(z).filter(function(t){return t in document});return t.length?z[t[0]]:null}function k(t,e,i){void 0===i?t.classList.toggle(e):i?t.classList.add(e):i||t.classList.remove(e)}function H(t,e){var i;(i=t.classList).add.apply(i,e.split(" "))}function G(t,e){var i;(i=t.classList).remove.apply(i,e.split(" "))}function V(t,e){var i=t;do{if(i===e)return!0;
2i=i.parentNode}while(i);return!1}function W(t,e){if(null==t||!t.matches)return null;var i=t;do{if(i.matches(e))return i;i=i instanceof SVGElement?i.parentNode:i.parentElement}while(i);return null}function X(t){for(var e=0,i=0,n=t;n;)e+=n.offsetLeft-n.scrollLeft+n.clientLeft,i+=n.offsetTop-n.scrollTop+n.clientTop,n=n.offsetParent;return{left:e,top:i}}function j(t){return(document.fullscreenElement||document.webkitFullscreenElement)===t}function Y(t){(t.requestFullscreen||t.webkitRequestFullscreen).call(t)}function q(){(document.exitFullscreen||document.webkitExitFullscreen).call(document)}function Z(t,e){return window.getComputedStyle(t,null)[e]}function J(t){var e=10,i=40,n=800,r=0,s=0,o=0,a=0;return"detail"in t&&(s=t.detail),"wheelDelta"in t&&(s=-t.wheelDelta/120),"wheelDeltaY"in t&&(s=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(r=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(r=s,s=0),o=r*e,a=s*e,"deltaY"in t&&(a=t.deltaY),"deltaX"in t&&(o=t.deltaX),(o||a)&&t.deltaMode&&(1===t.deltaMode?(o*=i,a*=i):(o*=n,a*=n)),o&&!r&&(r=o<1?-1:1),a&&!s&&(s=a<1?-1:1),{spinX:r,spinY:s,pixelX:o,pixelY:a}}function K(t,i,n){return e.MathUtils.clamp(t,i,n)}function Q(t,e){var i=t%e;return i<0&&(i+=e),i}function $(t){return e.MathUtils.isPowerOfTwo(t)}function tt(t){return t.reduce(function(t,e){return t+e},0)}function et(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function it(t,e){return[0,2*Math.PI,2*-Math.PI].reduce(function(i,n){var r=e-t+n;return Math.abs(r)<Math.abs(i)?r:i},1/0)}function nt(t,e){return Math.acos(Math.cos(t.latitude)*Math.cos(e.latitude)*Math.cos(t.longitude-e.longitude)+Math.sin(t.latitude)*Math.sin(e.latitude))}function rt(t,e){var i=t[0],n=t[1],r=e[0],s=e[1],o=(r-i)*Math.cos((n+s)/2),a=s-n;return Math.sqrt(o*o+a*a)}function st(t){return t.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,function(t,e){return(e>0?"-":"")+t.toLowerCase()})}function ot(t,e){var i,n,r,s,o=0,a=function(){o=Date.now(),s=void 0,r=t.apply(i,n),s||(i=n=null)};return function(){var l=Date.now();o||(o=l);var c=e-(l-o);return i=this,n=arguments,c<=0||c>e?(s&&(clearTimeout(s),s=void 0),o=l,r=t.apply(i,n),s||(i=n=null)):s||(s=setTimeout(a,c)),r}}function at(t){if("object"==typeof t&&null!==t){if("function"==typeof Object.getPrototypeOf){var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}return"[object Object]"===Object.prototype.toString.call(t)}return!1}function lt(t,e){var i=e;return function t(e,n){return Array.isArray(n)?(e&&Array.isArray(e)?e.length=0:e=[],n.forEach(function(i,n){e[n]=t(null,i)})):"object"==typeof n?(e&&!Array.isArray(e)||(e={}),Object.keys(n).forEach(function(r){"object"==typeof n[r]&&n[r]&&at(n[r])?n[r]!=i&&(e[r]?t(e[r],n[r]):e[r]=t(null,n[r])):e[r]=n[r]})):e=n,e}(t,e)}function ct(t){return lt(null,t)}function ht(t){return!t||0===Object.keys(t).length&&t.constructor===Object}function ut(t,e){Object.keys(t).forEach(function(i){e(t[i],i)})}function dt(t){return null==t}function pt(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];for(var n=0,r=e;n<r.length;n++){var s=r[n];if(!dt(s))return s}}function ft(t,e){if(t===e)return!0;if(mt(t)&&mt(e)){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];if(!ft(t[r],e[r]))return!1}return!0}return!1}function mt(t){return"object"==typeof t&&null!=t}function gt(t,e){if(t)for(var i=0,n=[["_",t]].concat(Object.entries(t));i<n.length;i++){var r=n[i][1];if(r.prototype instanceof e)return r}return null}function vt(){var t=new Error("Loading was aborted.");return t.name="AbortError",t}function _t(t){return"AbortError"===(null==t?void 0:t.name)}function yt(t){console.warn("PhotoSphereViewer: "+t)}function xt(t){return[["x","y"],["longitude","latitude"]].some(function(e){var i=e[0],n=e[1];return void 0!==t[i]&&void 0!==t[n]})}function Mt(t,e){var i=t.match("<GPano:"+e+">(.*)</GPano:"+e+">");if(null!==i){var n=parseInt(i[1],10);return isNaN(n)?null:n}if(null!==(i=t.match("GPano:"+e+'="(.*?)"'))){var r=parseInt(i[1],10);return isNaN(r)?null:r}return null}var bt={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"};function wt(t){if(!t)return{x:.5,y:.5};if("object"==typeof t)return t;var e=t.toLocaleLowerCase().split(" ").slice(0,2);1===e.length&&(e=void 0!==bt[e[0]]?[e[0],"center"]:[e[0],e[0]]);var i="left"!==e[1]&&"right"!==e[1]&&"top"!==e[0]&&"bottom"!==e[0];e=e.map(function(t){return bt[t]||t}),i||e.reverse();var n=e.join(" ").match(/^([0-9.]+)% ([0-9.]+)%$/);return n?{x:parseFloat(n[1])/100,y:parseFloat(n[2])/100}:{x:.5,y:.5}}var St=["left","center","right"],Et=["top","center","bottom"],Tt=[].concat(St,Et),At="center";function Rt(t,e){var i=void 0===e?{allowCenter:!0,cssOrder:!0}:e,n=i.allowCenter,r=i.cssOrder;return t?("string"==typeof t&&(t=t.split(" ")),1===t.length&&(t[0]===At?t=[At,At]:-1!==St.indexOf(t[0])?t=[At,t[0]]:-1!==Et.indexOf(t[0])&&(t=[t[0],At])),2!==t.length||-1===Tt.indexOf(t[0])||-1===Tt.indexOf(t[1])?(yt("Unparsable position "+t),null):n||t[0]!==At||t[1]!==At?(r&&!Ct(t)&&(t=[t[1],t[0]]),t[1]===At&&-1!==St.indexOf(t[0])&&(t=[At,t[0]]),t[0]===At&&-1!==Et.indexOf(t[1])&&(t=[t[1],At]),t):(yt("Invalid position center center"),null)):null}function Ct(t){return-1!==Et.indexOf(t[0])&&-1!==St.indexOf(t[1])}function Lt(t){var i;
2if("string"==typeof t){var n=t.toString().trim(),r=parseFloat(n.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/,"$1")),s=n.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim();switch(s.match(/(pm|per minute)$/)&&(r/=60),s){case"dpm":case"degrees per minute":case"dps":case"degrees per second":i=e.MathUtils.degToRad(r);break;case"rdpm":case"radians per minute":case"rdps":case"radians per second":i=r;break;case"rpm":case"revolutions per minute":case"rps":case"revolutions per second":i=r*Math.PI*2;break;default:throw new c('Unknown speed unit "'+s+'"')}}else i=t;return i}function Pt(t,i,n){var r;if(void 0===i&&(i=!1),void 0===n&&(n=i),"string"==typeof t){var s=t.toLowerCase().trim().match(/^(-?[0-9]+(?:\.[0-9]*)?)(.*)$/);if(!s)throw new c('Unknown angle "'+t+'"');var o=parseFloat(s[1]),a=s[2];if(a)switch(a){case"deg":case"degs":r=e.MathUtils.degToRad(o);break;case"rad":case"rads":r=o;break;default:throw new c('Unknown angle unit "'+a+'"')}else r=o}else{if("number"!=typeof t||isNaN(t))throw new c('Unknown angle "'+t+'"');r=t}return r=Q(i?r+Math.PI:r,2*Math.PI),i?e.MathUtils.clamp(r-Math.PI,-Math.PI/(n?2:1),Math.PI/(n?2:1)):r}function It(t){var i=new e.Texture(t);return i.needsUpdate=!0,i.minFilter=e.LinearFilter,i.generateMipmaps=!1,i}var Ot=new e.Quaternion;function Dt(t,e){Ot.setFromEuler(e).invert(),t.applyQuaternion(Ot)}var Nt=function(){function t(t){var e=this;this.__callbacks=[],t?(t.easing&&"string"!=typeof t.easing||(t.easing=A[t.easing||"linear"]),this.__start=null,this.options=t,t.delay?this.__delayTimeout=setTimeout(function(){e.__delayTimeout=null,e.__animationFrame=window.requestAnimationFrame(function(t){return e.__run(t)})},t.delay):this.__animationFrame=window.requestAnimationFrame(function(t){return e.__run(t)})):this.__resolved=!0}var e=t.prototype;return e.__run=function(t){var e=this;if(!this.__cancelled){null===this.__start&&(this.__start=t);var i=(t-this.__start)/this.options.duration,n={};i<1?(ut(this.options.properties,function(t,r){t&&(n[r]=t.start+(t.end-t.start)*e.options.easing(i))}
2),this.options.onTick(n,i),this.__animationFrame=window.requestAnimationFrame(function(t){return e.__run(t)})):(ut(this.options.properties,function(t,e){t&&(n[e]=t.end)}),this.options.onTick(n,1),this.__animationFrame=window.requestAnimationFrame(function(){e.__resolved=!0,e.__resolve(!0)}))}},e.__resolve=function(t){this.__callbacks.forEach(function(e){return e(t)}),this.__callbacks.length=0},e.then=function(t){var e=this;return this.__resolved||this.__cancelled?Promise.resolve(this.__resolved).then(t):new Promise(function(t){e.__callbacks.push(t)}).then(t)},e.cancel=function(){this.__cancelled||this.__resolved||(this.__cancelled=!0,this.__resolve(!1),this.__delayTimeout&&(window.clearTimeout(this.__delayTimeout),this.__delayTimeout=null),this.__animationFrame&&(window.cancelAnimationFrame(this.__animationFrame),this.__animationFrame=null))},t}(),Ut=function(){function t(e,i,n,r,s){if(void 0===i&&(i=0),void 0===n&&(n=-1/0),void 0===r&&(r=1/0),void 0===s&&(s=!1),this.fn=e,this.mode=t.STOP,this.speed=0,this.speedMult=1,this.currentSpeed=0,this.target=0,this.current=i,this.min=n,this.max=r,this.loopValue=s,s&&0!==n)throw new c("invalid config");this.fn&&this.fn(i)}var i=t.prototype;return i.setSpeed=function(t){this.speed=t},i.goto=function(i,n){void 0===n&&(n=1),this.mode=t.POSITION,this.target=this.loopValue?Q(i,this.max):e.MathUtils.clamp(i,this.min,this.max),this.speedMult=n},i.step=function(e,i){void 0===i&&(i=1),this.mode!==t.POSITION&&(this.target=this.current),this.goto(this.target+e,i)},i.roll=function(e,i){void 0===e&&(e=!1),void 0===i&&(i=1),this.mode=t.INFINITE,this.target=e?-1/0:1/0,this.speedMult=i},i.stop=function(){this.mode=t.STOP},i.setValue=function(i){return this.target=this.loopValue?Q(i,this.max):e.MathUtils.clamp(i,this.min,this.max),this.mode=t.STOP,this.target!==this.current&&(this.current=this.target,this.fn&&this.fn(this.current),!0)},i.update=function(i){if(this.mode===t.POSITION){this.loopValue&&Math.abs(this.target-this.current)>this.max/2&&(this.current=this.current<this.target?this.current+this.max:this.current-this.max);var n=this.currentSpeed*this.currentSpeed/(this.speed*this.speedMult*4);Math.abs(this.target-this.current)<=n&&(this.mode=t.STOP)}var r=this.mode===t.STOP?0:this.speed*this.speedMult;this.target<this.current&&(r=-r),this.currentSpeed<r?this.currentSpeed=Math.min(r,this.currentSpeed+i/1e3*this.speed*this.speedMult*2):this.currentSpeed>r&&(this.currentSpeed=Math.max(r,this.currentSpeed-i/1e3*this.speed*this.speedMult*2));var s=null;return this.current>this.target&&this.currentSpeed?s=Math.max(this.target,this.current+this.currentSpeed*i/1e3):this.current<this.target&&this.currentSpeed&&(s=Math.min(this.target,this.current+this.currentSpeed*i/1e3)),null!==s&&(s=this.loopValue?Q(s,this.max):e.MathUtils.clamp(s,this.min,this.max))!==this.current&&(this.current=s,this.fn&&this.fn(this.current),!0)},t}();Ut.STOP=0,Ut.INFINITE=1,Ut.POSITION=2;var Ft=function(){function t(t,e){this.fn=e,this.dynamics=t,this.fn&&this.fn(this.current)}var e=t.prototype;return e.setSpeed=function(t){ut(this.dynamics,function(e){e.setSpeed(t)})},e.goto=function(t,e){var i=this;void 0===e&&(e=1),ut(t,function(t,n){i.dynamics[n].goto(t,e)})},e.step=function(t,e){var i=this;void 0===e&&(e=1),ut(t,function(t,n){i.dynamics[n].step(t,e)})},e.roll=function(t,e){var i=this;void 0===e&&(e=1),ut(t,function(t,n){i.dynamics[n].roll(t,e)})},e.stop=function(){ut(this.dynamics,function(t){return t.stop()})},e.setValue=function(t){var e=this,i=!1;return ut(t,function(t,n){i|=e.dynamics[n].setValue(t)}),i&&this.fn&&this.fn(this.current),i},e.update=function(t){var e=!1;return ut(this.dynamics,function(i){e|=i.update(t)}),e&&this.fn&&this.fn(this.current),e},r(t,[{key:"current",get:function(){var t={};return ut(this.dynamics,function(e,i){t[i]=e.current}),t}}]),t}(),zt=function(t){function e(e){var i,n=e.psv,r=e.container,s=e.direction,o=e.onUpdate;return(i=t.call(this)||this).psv=n,i.container=r,i.prop={onUpdate:o,direction:s,mousedown:!1,mouseover:!1},i.container.addEventListener("click",l(i)),i.container.addEventListener("mousedown",l(i)),i.container.addEventListener("mouseenter",l(i)),i.container.addEventListener("mouseleave",l(i)),i.container.addEventListener("touchstart",l(i)),i.container.addEventListener("mousemove",l(i),!0),i.container.addEventListener("touchmove",l(i),!0),window.addEventListener("mouseup",l(i)),window.addEventListener("touchend",l(i)),i}o(e,t);var i=e.prototype;return i.destroy=function(){window.removeEventListener("mouseup",this),window.removeEventListener("touchend",this)},i.handleEvent=function(t){switch(t.type){case"click":t.stopPropagation();break;case"mousedown":this.__onMouseDown(t);break;case"mouseenter":this.__onMouseEnter(t);break;case"mouseleave":this.__onMouseLeave(t);break;case"touchstart":this.__onTouchStart(t);break;case"mousemove":this.__onMouseMove(t);break;case"touchmove":this.__onTouchMove(t);break;case"mouseup":this.__onMouseUp(t);break;case"touchend":this.__onTouchEnd(t)}},i.__onMouseDown=function(t){this.prop.mousedown=!0,this.__update(t,!0)},i.__onMouseEnter=function(t){this.prop.mouseover=!0,this.__update(t,!0)},i.__onTouchStart=function(t){this.prop.mouseover=!0,this.prop.mousedown=!0,this.__update(t.changedTouches[0],!0)},i.__onMouseMove=function(t){(this.prop.mousedown||this.prop.mouseover)&&(t.stopPropagation(),this.__update(t,!0))},i.__onTouchMove=function(t){(this.prop.mousedown||this.prop.mouseover)&&(t.stopPropagation(),this.__update(t.changedTouches[0],!0))},i.__onMouseUp=function(t){this.prop.mousedown&&(this.prop.mousedown=!1,this.__update(t,!1))},i.__onMouseLeave=function(t){this.prop.mouseover&&(this.prop.mouseover=!1,this.__update(t,!0))},i.__onTouchEnd=function(t){this.prop.mousedown&&(this.prop.mouseover=!1,this.prop.mousedown=!1,this.__update(t.changedTouches[0],!1))},i.__update=function(t,e){var i=this.container.getBoundingClientRect(),n=t[this.vertical?"clientY":"clientX"],r=i[this.vertical?"bottom":"left"],s=i[this.vertical?"height":"width"],o=Math.abs((r-n)/s);this.prop.onUpdate({value:o,click:!e,mousedown:this.prop.mousedown,mouseover:this.prop.mouseover,cursor:t})},r(e,[{key:"vertical",get:function(){return this.prop.direction===e.VERTICAL}}]),e}(i.EventEmitter);zt.VERTICAL=1,zt.HORIZONTAL=2;var Bt=Object.freeze({__proto__:null,toggleClass:k,addClasses:H,removeClasses:G,hasParent:V,getClosest:W,getPosition:X,isFullscreenEnabled:j,requestFullscreen:Y,exitFullscreen:q,getStyle:Z,normalizeWheel:J,bound:K,loop:Q,isPowerOfTwo:$,sum:tt,distance:et,getShortestArc:it,getAngle:nt,greatArcDistance:rt,dasherize:st,throttle:ot,isPlainObject:at,deepmerge:lt,clone:ct,isEmpty:ht,each:ut,isNil
2:dt,firstNonNull:pt,deepEqual:ft,pluginInterop:gt,getAbortError:vt,isAbortError:_t,logWarn:yt,isExtendedPosition:xt,getXMPValue:Mt,parsePosition:wt,cleanPosition:Rt,positionIsOrdered:Ct,parseSpeed:Lt,parseAngle:Pt,createTexture:It,applyEulerInverse:Dt,Animation:Nt,Dynamic:Ut,MultiDynamic:Ft,Slider:zt}),kt=function(t){function i(i,n){var r;if((r=t.call(this,i)||this).config=s({resolution:64},n),!e.MathUtils.isPowerOfTwo(r.config.resolution))throw new c("EquirectangularAdapter resolution must be power of two");return r.SPHERE_SEGMENTS=r.config.resolution,r.SPHERE_HORIZONTAL_SEGMENTS=r.SPHERE_SEGMENTS/2,r}o(i,t);var n=i.prototype;return n.supportsTransition=function(){return!0},n.supportsPreload=function(){return!0},n.loadTexture=function(t,e,i){var n=this;return void 0===i&&(i=this.psv.config.useXmpData),"string"!=typeof t?((Array.isArray(t)||"object"==typeof t&&t.left)&&yt("Cubemap support now requires an additional adapter, see https://photo-sphere-viewer.js.org/guide/adapters"),Promise.reject(new c("Invalid panorama url, are you using the right adapter?"))):(i?this.__loadXMP(t,function(t){return n.psv.loader.setProgress(t)}).then(function(e){return n.psv.textureLoader.loadImage(t).then(function(t){return{img:t,xmpPanoData:e}})}):this.psv.textureLoader.loadImage(t,function(t){return n.psv.loader.setProgress(t)}).then(function(t){return{img:t,xmpPanoData:null}})).then(function(i){var r,s,o,a,l,c,h,u,d,p=i.img,f=i.xmpPanoData;"function"==typeof e&&(e=e(p));var m={fullWidth:pt(null==(r=e)?void 0:r.fullWidth,null==f?void 0:f.fullWidth,p.width),fullHeight:pt(null==(s=e)?void 0:s.fullHeight,null==f?void 0:f.fullHeight,p.height),croppedWidth:pt(null==(o=e)?void 0:o.croppedWidth,null==f?void 0:f.croppedWidth,p.width),croppedHeight:pt(null==(a=e)?void 0:a.croppedHeight,null==f?void 0:f.croppedHeight,p.height),croppedX:pt(null==(l=e)?void 0:l.croppedX,null==f?void 0:f.croppedX,0),croppedY:pt(null==(c=e)?void 0:c.croppedY,null==f?void 0:f.croppedY,0),poseHeading:pt(null==(h=e)?void 0:h.poseHeading,null==f?void 0:f.poseHeading,0),posePitch:pt(null==(u=e)?void 0:u.posePitch,null==f?void 0:f.posePitch,0),poseRoll:pt(null==(d=e)?void 0:d.poseRoll,null==f?void 0:f.poseRoll,0)};m.croppedWidth===p.width&&m.croppedHeight===p.height||yt("Invalid panoData, croppedWidth and/or croppedHeight is not coherent with loaded image.\n    panoData: "+m.croppedWidth+"x"+m.croppedHeight+", image: "+p.width+"x"+p.height),(e||f)&&m.fullWidth!==2*m.fullHeight&&yt("Invalid panoData, fullWidth should be twice fullHeight");var g=n.__createEquirectangularTexture(p,m);return{panorama:t,texture:g,panoData:m}})},n.__loadXMP=function(t,e){var i=this;return this.psv.textureLoader.loadFile(t,e).then(function(t){return i.__loadBlobAsString(t)}).then(function(t){var e=t.indexOf("<x:xmpmeta"),i=t.indexOf("</x:xmpmeta>"),n=t.substring(e,i);return-1!==e&&-1!==i&&n.includes("GPano:")?{fullWidth:Mt(n,"FullPanoWidthPixels"),fullHeight:Mt(n,"FullPanoHeightPixels"),croppedWidth:Mt(n,"CroppedAreaImageWidthPixels"),croppedHeight:Mt(n,"CroppedAreaImageHeightPixels"),croppedX:Mt(n,"CroppedAreaLeftPixels"),croppedY:Mt(n,"CroppedAreaTopPixels"),poseHeading:Mt(n,"PoseHeadingDegrees"),posePitch:Mt(n,"PosePitchDegrees"),poseRoll:Mt(n,"PoseRollDegrees")}:null})},n.__loadBlobAsString=function(t){return new Promise(function(e,i){var n=new FileReader;n.onload=function(){return e(n.result)},n.onerror=i,n.readAsText(t)})},n.__createEquirectangularTexture=function(t,e){if(e.fullWidth>P.maxTextureWidth||e.croppedWidth!==e.fullWidth||e.croppedHeight!==e.fullHeight){var i=P.getMaxCanvasWidth()/e.fullWidth,n=s({},e);i<1&&(n.fullWidth*=i,n.fullHeight*=i,n.croppedWidth*=i,n.croppedHeight*=i,n.croppedX*=i,n.croppedY*=i);var r=document.createElement("canvas");return r.width=n.fullWidth,r.height=n.fullHeight,r.getContext("2d").drawImage(t,n.croppedX,n.croppedY,n.croppedWidth,n.croppedHeight),It(r)}return It(t)},n.createMesh=function(t){void 0===t&&(t=1);var i=new e.SphereGeometry(y*t,this.SPHERE_SEGMENTS,this.SPHERE_HORIZONTAL_SEGMENTS,-Math.PI/2).scale(-1,1,1),n=h.createOverlayMaterial();return new e.Mesh(i,n)},n.setTexture=function(t,e){this.__setUniform(t,h.OVERLAY_UNIFORMS.panorama,e.texture),this.setOverlay(t,null)},n.setOverlay=function(t,i,n){this.__setUniform(t,h.OVERLAY_UNIFORMS.overlayOpacity,n),i?this.__setUniform(t,h.OVERLAY_UNIFORMS.overlay,i.texture):this.__setUniform(t,h.OVERLAY_UNIFORMS.overlay,new e.Texture)},n.setTextureOpacity=function(t,e){this.__setUniform(t,h.OVERLAY_UNIFORMS.globalOpacity,e),t.material.transparent=e<1},n.disposeTexture=function(t){var e;null==(e=t.texture)||e.dispose()},n.__setUniform=function(t,i,n){t.material.uniforms[i].value instanceof e.Texture&&t.material.uniforms[i].value.dispose(),t.material.uniforms[i].value=n},i}(h);
2kt.id="equirectangular",kt.supportsDownload=!0,kt.supportsOverlay=!0;var Ht=function(){function t(t,e){this.psv=t.psv||t,this.parent=t,this.parent.children.push(this),this.children=[],this.prop={visible:!0},this.container=document.createElement("div"),this.container.className=e,this.parent.container.appendChild(this.container)}var e=t.prototype;return e.destroy=function(){this.parent.container.removeChild(this.container);var t=this.parent.children.indexOf(this);-1!==t&&this.parent.children.splice(t,1),this.children.slice().forEach(function(t){return t.destroy()}),this.children.length=0,delete this.container,delete this.parent,delete this.psv,delete this.prop},e.refreshUi=function(){var t=this;this.children.every(function(e){return e.refreshUi(),!0===t.psv.prop.uiRefresh})},e.toggle=function(t){!1===t||void 0===t&&this.isVisible()?this.hide():(!0===t||void 0===t&&!this.isVisible())&&this.show()},e.hide=function(){this.container.style.display="none",this.prop.visible=!1},e.show=function(){this.container.style.display="",this.prop.visible=!0},e.isVisible=function(){return this.prop.visible},t}(),Gt=function(t){function e(e,i,n,r){var o;return void 0===i&&(i=""),void 0===n&&(n=!1),void 0===r&&(r=!0),(o=t.call(this,e,"psv-button "+i)||this).prop=s({},o.prop,{id:o.constructor.id,collapsable:n,enabled:!0,supported:!0,collapsed:!1,active:!1,width:o.container.offsetWidth}),o.constructor.icon&&o.__setIcon(o.constructor.icon),o.prop.id&&o.psv.config.lang[o.prop.id]&&(o.container.title=o.psv.config.lang[o.prop.id]),r&&(o.container.tabIndex=0),o.container.addEventListener("click",function(t){o.prop.enabled&&o.onClick(),t.stopPropagation()}),o.container.addEventListener("keydown",function(t){t.key===R.Enter&&o.prop.enabled&&(o.onClick(),t.stopPropagation())}),o}o(e,t);var i=e.prototype;return i.checkSupported=function(){var t=this,e=this.isSupported();at(e)?(!1===e.initial&&(this.hide(),this.prop.supported=!1),e.promise.then(function(e){t.prop&&(t.prop.supported=e,t.toggle(e))})):(this.prop.supported=e,e||this.hide())},i.isSupported=function(){return!0},i.toggleActive=function(t){this.prop.active=void 0!==t?t:!this.prop.active,k(this.container,"psv-button--active",this.prop.active),this.constructor.iconActive&&this.__setIcon(this.prop.active?this.constructor.iconActive:this.constructor.icon)},i.show=function(t){void 0===t&&(t=!0),this.isVisible()||(this.prop.visible=!0,this.prop.collapsed||(this.container.style.display=""),t&&this.psv.refreshUi("show button "+this.prop.id))},i.hide=function(t){void 0===t&&(t=!0),this.isVisible()&&(this.prop.visible=!1,this.container.style.display="none",t&&this.psv.refreshUi("hide button "+this.prop.id))},i.disable=function(){this.container.classList.add("psv-button--disabled"),this.prop.enabled=!1},i.enable=function(){this.container.classList.remove("psv-button--disabled"),this.prop.enabled=!0},i.collapse=function(){this.prop.collapsed=!0,this.container.style.display="none"},i.uncollapse=function(){this.prop.collapsed=!1,this.prop.visible&&(this.container.style.display="")},i.__setIcon=function(t,e){void 0===e&&(e=this.container),t?(e.innerHTML=t,e.querySelector("svg").classList.add("psv-button-svg")):e.innerHTML=""},i.onClick=function(){throw new c('onClick not implemented for button "'+this.prop.id+'".')},e}(Ht);Gt.id=null,Gt.groupId=null,Gt.icon=null,Gt.iconActive=null;var Vt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 41 41"><path fill="currentColor" d="M40.5 14.1c-.1-.1-1.2-.5-2.898-1-.102 0-.202-.1-.202-.2C34.5 6.5 28 2 20.5 2S6.6 6.5 3.7 12.9c0 .1-.1.1-.2.2-1.7.6-2.8 1-2.9 1l-.6.3v12.1l.6.2c.1 0 1.1.399 2.7.899.1 0 .2.101.2.199C6.3 34.4 12.9 39 20.5 39c7.602 0 14.102-4.6 16.9-11.1 0-.102.1-.102.199-.2 1.699-.601 2.699-1 2.801-1l.6-.3V14.3l-.5-.2zM6.701 11.5C9.7 7 14.8 4 20.5 4c5.8 0 10.9 3 13.8 7.5.2.3-.1.6-.399.5-3.799-1-8.799-2-13.6-2-4.7 0-9.5 1-13.2 2-.3.1-.5-.2-.4-.5zM25.1 20.3L18.7 24c-.3.2-.7 0-.7-.5v-7.4c0-.4.4-.6.7-.4l6.399 3.8c.301.1.301.6.001.8zm9.4 8.901A16.421 16.421 0 0 1 20.5 37c-5.9 0-11.1-3.1-14-7.898-.2-.302.1-.602.4-.5 3.9 1 8.9 2.1 13.6 2.1 5 0 9.9-1 13.602-2 .298-.1.5.198.398.499z"/>\x3c!--Created by Nick Bluth from the Noun Project--\x3e</svg>\n',Wt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 41 41">
2<path fill="currentColor" d="M40.5 14.1c-.1-.1-1.2-.5-2.899-1-.101 0-.2-.1-.2-.2C34.5 6.5 28 2 20.5 2S6.6 6.5 3.7 12.9c0 .1-.1.1-.2.2-1.7.6-2.8 1-2.9 1l-.6.3v12.1l.6.2c.1 0 1.1.4 2.7.9.1 0 .2.1.2.199C6.3 34.4 12.9 39 20.5 39c7.601 0 14.101-4.6 16.9-11.1 0-.101.1-.101.2-.2 1.699-.6 2.699-1 2.8-1l.6-.3V14.3l-.5-.2zM20.5 4c5.8 0 10.9 3 13.8 7.5.2.3-.1.6-.399.5-3.8-1-8.8-2-13.6-2-4.7 0-9.5 1-13.2 2-.3.1-.5-.2-.4-.5C9.7 7 14.8 4 20.5 4zm0 33c-5.9 0-11.1-3.1-14-7.899-.2-.301.1-.601.4-.5 3.9 1 8.9 2.1 13.6 2.1 5 0 9.9-1 13.601-2 .3-.1.5.2.399.5A16.422 16.422 0 0 1 20.5 37zm18.601-12.1c0 .1-.101.3-.2.3-2.5.9-10.4 3.6-18.4 3.6-7.1 0-15.6-2.699-18.3-3.6C2.1 25.2 2 25 2 24.9V16c0-.1.1-.3.2-.3 2.6-.9 10.6-3.6 18.2-3.6 7.5 0 15.899 2.7 18.5 3.6.1 0 .2.2.2.3v8.9z"/><path fill="currentColor" d="M18.7 24l6.4-3.7c.3-.2.3-.7 0-.8l-6.4-3.8c-.3-.2-.7 0-.7.4v7.4c0 .5.4.7.7.5z"/>\x3c!--Created by Nick Bluth from the Noun Project--\x3e</svg>\n',Xt=function(t){function e(e){var i;return(i=t.call(this,e,"psv-button--hover-scale psv-autorotate-button",!0)||this).psv.on(w.AUTOROTATE,l(i)),i}o(e,t);var i=e.prototype;return i.destroy=function(){this.psv.off(w.AUTOROTATE,this),t.prototype.destroy.call(this)},i.handleEvent=function(t){t.type===w.AUTOROTATE&&this.toggleActive(t.args[0])},i.onClick=function(){this.psv.isAutorotateEnabled()&&(this.psv.config.autorotateIdle=!1,this.psv.resetIdleTimer()),this.psv.toggleAutorotate()},e}(Gt);Xt.id="autorotate",Xt.icon=Wt,Xt.iconActive=Vt;var jt=function(t){function e(e,i){var n;return(n=t.call(this,e,"psv-custom-button",!1!==i.collapsable,!1!==i.tabbable)||this).config=i,n.config.id?n.prop.id=n.config.id:n.prop.id="psvButton-"+Math.random().toString(36).substr(2,9),n.config.className&&H(n.container,n.config.className),n.config.title&&(n.container.title=n.config.title),n.config.content&&(n.container.innerHTML=n.config.content),n.prop.width=n.container.offsetWidth,!1===n.config.enabled&&n.disable(),!1===n.config.visible&&n.hide(),n}o(e,t);var i=e.prototype;return i.destroy=function(){delete this.config,t.prototype.destroy.call(this)},i.onClick=function(){this.config.onClick&&this.config.onClick.call(this.psv,this.psv)},e}(Gt),Yt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path fill="currentColor" d="M28.3 26.1c-1 2.6-1.9 4.8-2.6 7-2.5 7.4-5 14.7-7.2 22-1.3 4.4.5 7.2 4.3 7.8 1.3.2 2.8.2 4.2-.1 8.2-2 11.9-8.6 15.7-15.2l-2.2 2a18.8 18.8 0 0 1-7.4 5.2 2 2 0 0 1-1.6-.2c-.2-.1 0-1 0-1.4l.8-1.8L41.9 28c.5-1.4.9-3 .7-4.4-.2-2.6-3-4.4-6.3-4.4-8.8.2-15 4.5-19.5 11.8-.2.3-.2.6-.3 1.3 3.7-2.8 6.8-6.1 11.8-6.2z"/><circle fill="currentColor" cx="39.3" cy="9.2" r="8.2"/>\x3c!--Created by Arafat Uddin from the Noun Project--\x3e</svg>\n',qt=1,Zt=2,Jt=function(t){function e(e){var i;return(i=t.call(this,e,"psv-button--hover-scale psv-description-button")||this).prop=s({},i.prop,{mode:null}),i.psv.on(w.HIDE_NOTIFICATION,l(i)),i.psv.on(w.SHOW_NOTIFICATION,l(i)),i.psv.on(w.CLOSE_PANEL,l(i)),i.psv.on(w.OPEN_PANEL,l(i)),i}o(e,t);var i=e.prototype;return i.destroy=function(){this.psv.off(w.HIDE_NOTIFICATION,this),this.psv.off(w.SHOW_NOTIFICATION,this),this.psv.off(w.CLOSE_PANEL,this),this.psv.off(w.OPEN_PANEL,this),t.prototype.destroy.call(this)},i.handleEvent=function(t){if(this.prop.mode){var e=!1;switch(t.type){case w.HIDE_NOTIFICATION:e=this.prop.mode===qt;break;case w.SHOW_NOTIFICATION:e=this.prop.mode===qt&&t.args[0]!==T.DESCRIPTION;break;case w.CLOSE_PANEL:e=this.prop.mode===Zt;break;case w.OPEN_PANEL:e=this.prop.mode===Zt&&t.args[0]!==T.DESCRIPTION}e&&(this.toggleActive(!1),this.prop.mode=null)}},i.hide=function(e){t.prototype.hide.call(this,e),this.prop.mode&&this.__close()},i.refreshUi=function(t){if(void 0===t&&(t=!1),t){var e=this.psv.navbar.getButton("caption",!1),i=e&&!e.isVisible(),n=!!this.psv.config.description;i||n?this.show(!1):this.hide(!1)}},i.onClick=function(){this.prop.mode?this.__close():this.__open()},i.__close=function(){switch(this.prop.mode){case qt:this.psv.notification.hide(T.DESCRIPTION);break;case Zt:this.psv.panel.hide(T.DESCRIPTION)}},i.__open=function(){this.toggleActive(!0),this.psv.config.description?(this.prop.mode=Zt,this.psv.panel.show({id:T.DESCRIPTION,content:(this.psv.config.caption?"<p>"+this.psv.config.caption+"</p>":"")+this.psv.config.description})):(this.prop.mode=qt,this.psv.notification.show({id:T.DESCRIPTION,content:this.psv.config.caption}))},e}(Gt);Jt.id="description",Jt.icon=Yt;var Kt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
2<path fill="currentColor" d="M83.3 35.6h-17V3H32.2v32.6H16.6l33.6 32.7 33-32.7z"/><path fill="currentColor" d="M83.3 64.2v16.3H16.6V64.2H-.1v32.6H100V64.2H83.3z"/>\x3c!--Created by Michael Zenaty from the Noun Project--\x3e</svg>\n',Qt=function(t){function e(e){return t.call(this,e,"psv-button--hover-scale psv-download-button",!0)||this}o(e,t);var i=e.prototype;return i.onClick=function(){var t=this,e=document.createElement("a");e.href=this.psv.config.downloadUrl||this.psv.config.panorama,e.download=e.href.split("/").pop(),this.psv.container.appendChild(e),e.click(),setTimeout(function(){t.psv.container.removeChild(e)},100)},i.refreshUi=function(){var t=this.psv.adapter.constructor.supportsDownload||this.psv.config.downloadUrl;t&&!this.prop.visible?this.show():!t&&this.prop.visible&&this.hide()},e}(Gt);Qt.id="download",Qt.icon=Kt;var $t='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M100 40H87.1V18.8h-21V6H100zM100 93.2H66V80.3h21.1v-21H100zM34 93.2H0v-34h12.9v21.1h21zM12.9 40H0V6h34v12.9H12.8z"/>\x3c!--Created by Garrett Knoll from the Noun Project--\x3e</svg>\n',te='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M66 7h13v21h21v13H66zM66 60.3h34v12.9H79v21H66zM0 60.3h34v34H21V73.1H0zM21 7h13v34H0V28h21z"/>\x3c!--Created by Garrett Knoll from the Noun Project--\x3e</svg>\n',ee=function(t){function e(e){var i;return(i=t.call(this,e,"psv-button--hover-scale psv-fullscreen-button")||this).psv.on(w.FULLSCREEN_UPDATED,l(i)),i}o(e,t);var i=e.prototype;return i.destroy=function(){this.psv.off(w.FULLSCREEN_UPDATED,this),t.prototype.destroy.call(this)},i.handleEvent=function(t){t.type===w.FULLSCREEN_UPDATED&&this.toggleActive(t.args[0])},i.onClick=function(){this.psv.toggleFullscreen()},e}(Gt);ee.id="fullscreen",ee.icon=$t,ee.iconActive=te;var ie='<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 10 80 80"><g fill="currentColor"><circle r="10" cx="20" cy="20"/><circle r="10" cx="50" cy="20"/><circle r="10" cx="80" cy="20"/><circle r="10" cx="20" cy="50"/><circle r="10" cx="50" cy="50"/><circle r="10" cx="80" cy="50"/><circle r="10" cx="20" cy="80"/><circle r="10" cx="50" cy="80"/><circle r="10" cx="80" cy="80"/></g>\x3c!-- Created by Richard Kunák from the Noun Project--\x3e</svg>\n',ne=function(t){function e(e){var i;return(i=t.call(this,e,"psv-button--hover-scale psv-menu-button")||this).psv.on(w.OPEN_PANEL,l(i)),i.psv.on(w.CLOSE_PANEL,l(i)),t.prototype.hide.call(l(i)),i}o(e,t);var i=e.prototype;return i.destroy=function(){this.psv.off(w.OPEN_PANEL,this),this.psv.off(w.CLOSE_PANEL,this),t.prototype.destroy.call(this)},i.handleEvent=function(t){switch(t.type){case w.OPEN_PANEL:this.toggleActive(t.args[0]===T.MENU);break;case w.CLOSE_PANEL:this.toggleActive(!1)}},i.hide=function(e){t.prototype.hide.call(this,e),this.__hideMenu()},i.show=function(e){t.prototype.show.call(this,e),this.prop.active&&this.__showMenu()},i.onClick=function(){this.prop.active?this.__hideMenu():this.__showMenu()},i.__showMenu=function(){var t=this;this.psv.panel.show({id:T.MENU,content:e.MENU_TEMPLATE(this.parent.collapsed,this.psv,st(e.BUTTON_DATA)),noMargin:!0,clickHandler:function(i){var n=i.target?W(i.target,"li"):void 0,r=n?n.dataset[e.BUTTON_DATA]:void 0;r&&(t.parent.getButton(r).onClick(),t.__hideMenu())}})},i.__hideMenu=function(){this.psv.panel.hide(T.MENU)},e}(Gt);ne.id="menu",ne.icon=ie,ne.BUTTON_DATA="psvButton",ne.MENU_TEMPLATE=function(t,e,i){return'\n<div class="psv-panel-menu psv-panel-menu--stripped">\n  <h1 class="psv-panel-menu-title">'+ie+" "+e.config.lang.menu+'</h1>\n  <ul class="psv-panel-menu-list">\n    '+t.map(function(t){return"\n    <li data-"+i+'="'+t.prop.id+'" class="psv-panel-menu-item" tabindex="0">
2\n      <span class="psv-panel-menu-item-icon">'+t.container.innerHTML+'</span>\n      <span class="psv-panel-menu-item-label">'+t.container.title+"</span>\n    </li>\n    "}).join("")+"\n  </ul>\n</div>\n"};var re='<svg xmlns="http://www.w3.org/2000/svg" viewBox="40 40 432 432"><g transform="rotate(0, 256, 256)"><path fill="currentColor" d="M425.23 210.55H227.39a5 5 0 01-3.53-8.53l56.56-56.57a45.5 45.5 0 000-64.28 45.15 45.15 0 00-32.13-13.3 45.15 45.15 0 00-32.14 13.3L41.32 256l174.83 174.83a45.15 45.15 0 0032.14 13.3 45.15 45.15 0 0032.13-13.3 45.5 45.5 0 000-64.28l-56.57-56.57a5 5 0 013.54-8.53h197.84c25.06 0 45.45-20.39 45.45-45.45s-20.4-45.45-45.45-45.45z"/></g>\x3c!-- Created by Flatart from the Noun Project --\x3e</svg>\n',se=function(){function t(t){void 0===t&&(t=200),this.delay=t,this.time=0,this.timeout=null}var e=t.prototype;return e.down=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.time=(new Date).getTime()},e.up=function(t){var e=this;this.time&&((new Date).getTime()-this.time<this.delay?this.timeout=setTimeout(function(){t(),e.timeout=null,e.time=0},this.delay):(t(),this.time=0))},t}();function oe(t){var e=0;switch(t){case"up":e=90;break;case"right":e=180;break;case"down":e=-90;break;default:e=0}return re.replace("rotate(0","rotate("+e)}var ae=function(t){function e(e,i){var n;return(n=t.call(this,e,"psv-button--hover-scale psv-move-button")||this).container.title=n.psv.config.lang.move,n.prop=s({},n.prop,{value:i,handler:new se}),n.container.addEventListener("mousedown",l(n)),n.container.addEventListener("keydown",l(n)),n.container.addEventListener("keyup",l(n)),n.psv.container.addEventListener("mouseup",l(n)),n.psv.container.addEventListener("touchend",l(n)),n}o(e,t);var i=e.prototype;return i.destroy=function(){this.__onMouseUp(),this.psv.container.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchend",this),t.prototype.destroy.call(this)},i.handleEvent=function(t){switch(t.type){case"mousedown":this.__onMouseDown();break;case"mouseup":case"touchend":this.__onMouseUp();break;case"keydown":t.key===R.Enter&&this.__onMouseDown();break;case"keyup":t.key===R.Enter&&this.__onMouseUp()}},i.isSupported=function(){return{initial:!P.isTouchEnabled.initial,promise:P.isTouchEnabled.promise.then(function(t){return!t})}},i.onClick=function(){},i.__onMouseDown=function(){this.prop.enabled&&(this.psv.__stopAll(),this.psv.dynamics.position.roll(this.prop.value),this.prop.handler.down())},i.__onMouseUp=function(){var t=this;this.prop.enabled&&this.prop.handler.up(function(){t.psv.dynamics.position.stop(),t.psv.resetIdleTimer()})},e}(Gt);ae.groupId="move";var le=function(t){function e(e){return t.call(this,e,{latitude:!0})||this}return o(e,t),e}(ae);le.id="moveDown",le.icon=oe("down");var ce=function(t){function e(e){return t.call(this,e,{longitude:!0})||this}return o(e,t),e}(ae);ce.id="moveLeft",ce.icon=oe("left");var he=function(t){function e(e){return t.call(this,e,{longitude:!1})||this}return o(e,t),e}(ae);he.id="moveRight",he.icon=oe("right");var ue=function(t){function e(e){return t.call(this,e,{latitude:!1})||this}return o(e,t),e}(ae);ue.id="moveUp",ue.icon=oe("up");var de=function(t){function e(e,i){var n;return(n=t.call(this,e,"psv-button--hover-scale psv-zoom-button")||this).prop=s({},n.prop,{value:i,handler:new se}),n.container.addEventListener("mousedown",l(n)),n.container.addEventListener("keydown",l(n)),n.container.addEventListener("keyup",l(n)),n.psv.container.addEventListener("mouseup",l(n)),n.psv.container.addEventListener("touchend",l(n)),n}o(e,t);var i=e.prototype;return i.destroy=function(){this.__onMouseUp(),this.psv.container.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchend",this),t.prototype.destroy.call(this)},i.handleEvent=function(t){switch(t.type){case"mousedown":this.__onMouseDown();break;case"mouseup":case"touchend":this.__onMouseUp();break;case"keydown":t.key===R.Enter&&this.__onMouseDown();break;case"keyup":t.key===R.Enter&&this.__onMouseUp()}},i.isSupported=function(){return{initial:!P.isTouchEnabled.initial,promise:P.isTouchEnabled.promise.then(function(t){return!t})}},i.onClick=function(){},i.__onMouseDown=function(){this.prop.enabled&&(this.psv.dynamics.zoom.roll(this.prop.value),this.prop.handler.down())},i.__onMouseUp=function(){var t=this;this.prop.enabled&&this.prop.handler.up(function(){return t.psv.dynamics.zoom.stop()})},e}(Gt);de.groupId="zoom";var pe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
2<path fill="currentColor" d="M14.043 12.22a7.738 7.738 0 1 0-1.823 1.822l4.985 4.985c.503.504 1.32.504 1.822 0a1.285 1.285 0 0 0 0-1.822l-4.984-4.985zm-6.305 1.043a5.527 5.527 0 1 1 0-11.053 5.527 5.527 0 0 1 0 11.053z"/><path fill="currentColor" d="M8.728 4.009H6.744v2.737H4.006V8.73h2.738v2.736h1.984V8.73h2.737V6.746H8.728z"/>\x3c!--Created by Ryan Canning from the Noun Project--\x3e</svg>\n',fe=function(t){function e(e){return t.call(this,e,!1)||this}return o(e,t),e}(de);fe.id="zoomIn",fe.icon=pe;var me='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="currentColor" d="M14.043 12.22a7.738 7.738 0 1 0-1.823 1.822l4.985 4.985c.503.504 1.32.504 1.822 0a1.285 1.285 0 0 0 0-1.822l-4.984-4.985zm-6.305 1.043a5.527 5.527 0 1 1 0-11.053 5.527 5.527 0 0 1 0 11.053z"/><path fill="currentColor" d="M4.006 6.746h7.459V8.73H4.006z"/>\x3c!--Created by Ryan Canning from the Noun Project--\x3e</svg>\n',ge=function(t){function e(e){return t.call(this,e,!0)||this}return o(e,t),e}(de);ge.id="zoomOut",ge.icon=me;var ve=function(t){function e(e){var i;return(i=t.call(this,e,"psv-zoom-range",!1,!1)||this).prop=s({},i.prop,{mediaMinWidth:0}),i.zoomRange=document.createElement("div"),i.zoomRange.className="psv-zoom-range-line",i.container.appendChild(i.zoomRange),i.zoomValue=document.createElement("div"),i.zoomValue.className="psv-zoom-range-handle",i.zoomRange.appendChild(i.zoomValue),i.slider=new zt({container:i.container,direction:zt.HORIZONTAL,onUpdate:function(t){return i.__onSliderUpdate(t)}}),i.prop.mediaMinWidth=parseInt(Z(i.container,"maxWidth"),10),i.psv.on(w.ZOOM_UPDATED,l(i)),i.psv.prop.ready?i.__moveZoomValue(i.psv.getZoomLevel()):i.psv.once(w.READY,l(i)),i.refreshUi(),i}o(e,t);var i=e.prototype;return i.destroy=function(){this.slider.destroy(),delete this.zoomRange,delete this.zoomValue,this.psv.off(w.ZOOM_UPDATED,this),this.psv.off(w.READY,this),t.prototype.destroy.call(this)},i.handleEvent=function(t){switch(t.type){case w.ZOOM_UPDATED:this.__moveZoomValue(t.args[0]);break;case w.READY:this.__moveZoomValue(this.psv.getZoomLevel())}},i.isSupported=function(){return{initial:!P.isTouchEnabled.initial,promise:P.isTouchEnabled.promise.then(function(t){return!t})}},i.refreshUi=function(){this.prop.supported&&(this.psv.prop.size.width<=this.prop.mediaMinWidth&&this.prop.visible?this.hide():this.psv.prop.size.width>this.prop.mediaMinWidth&&!this.prop.visible&&this.show())},i.onClick=function(){},i.__moveZoomValue=function(t){this.zoomValue.style.left=t/100*this.zoomRange.offsetWidth-this.zoomValue.offsetWidth/2+"px"},i.__onSliderUpdate=function(t){t.mousedown&&this.psv.zoom(100*t.value)},e}(Gt);ve.id="zoomRange",ve.groupId="zoom";var _e,ye=function(t){function e(e){var i;return(i=t.call(this)||this).psv=e,i}o(e,t);var i=e.prototype;return i.init=function(){},i.destroy=function(){delete this.psv},e}(i.EventEmitter);ye.id=null;var xe={panorama:null,overlay:null,overlayOpacity:1,container:null,adapter:null,plugins:[],caption:null,description:null,downloadUrl:null,loadingImg:null,loadingTxt:"Loading...",size:null,fisheye:!1,minFov:30,maxFov:90,defaultZoomLvl:50,defaultLong:0,defaultLat:0,sphereCorrection:null,moveSpeed:1,zoomSpeed:1,autorotateDelay:null,autorotateIdle:!1,autorotateSpeed:"2rpm",autorotateLat:null,autorotateZoomLvl:null,moveInertia:!0,mousewheel:!0,mousemove:!0,mousewheelCtrlKey:!1,touchmoveTwoFingers:!1,useXmpData:!0,panoData:null,requestHeaders:null,canvasBackground:"#000",withCredentials:!1,navbar:["autorotate","zoom","move","download","description","caption","fullscreen"],lang:{autorotate:"Automatic rotation",zoom:"Zoom",zoomOut:"Zoom out",zoomIn:"Zoom in",move:"Move",download:"Download",fullscreen:"Fullscreen",menu:"Menu",twoFingers:"Use two fingers to navigate",ctrlZoom:"Use ctrl + scroll to zoom the image",loadError:"The panorama can't be loaded"},keyboard:(_e={},_e[R.ArrowUp]=b.ROTATE_LAT_UP,_e[R.ArrowDown]=b.ROTATE_LAT_DOWN,_e[R.ArrowRight]=b.ROTATE_LONG_RIGHT,_e[R.ArrowLeft]=b.ROTATE_LONG_LEFT,_e[R.PageUp]=b.ZOOM_IN,_e[R.PageDown]=b.ZOOM_OUT,_e[R.Plus]=b.ZOOM_IN,_e[R.Minus]=b.ZOOM_OUT,_e[R.Space]=b.TOGGLE_AUTOROTATE,_e)},Me={panorama:"Use setPanorama method to change the panorama",panoData:"Use setPanorama method to change the panorama",container:"Cannot change viewer container",adapter:"Cannot change adapter",plugins:"Cannot change plugins"},be={captureCursor:"captureCursor is deprecated"},we={container:function(t){if(!t)throw new c("No value given for container.");return t},adapter:function(t){if(!(t=t?Array.isArray(t)?[gt(t[0],h),t[1]]:[gt(t,h)]:[kt])[0])throw new c("Un undefined value with given for adapter.");return t},overlayOpacity:function(t){return e.MathUtils.clamp(t,0,1)},defaultLong:function(t){return Pt(t)},defaultLat:function(t){return Pt(t,!0)},defaultZoomLvl:function(t){return e.MathUtils.clamp(t,0,100)},minFov:function(t,i){return i.maxFov<t&&(yt("maxFov cannot be lower than minFov"),t=i.maxFov),e.MathUtils.clamp(t,1,179)},maxFov:function(t,i){return t<i.minFov&&(t=i.minFov),e.MathUtils.clamp(t,1,179)},lang:function(t){return Array.isArray(t.twoFingers)&&(yt("lang.twoFingers must not be an array"),t.twoFingers=t.twoFingers[0]),s({},xe.lang,t)},keyboard:function(t){return!0===t?ct(xe.keyboard):t},autorotateLat:function(t,e){return Pt(null===t?e.defaultLat:t,!0)},autorotateZoomLvl:function(t){return dt(t)?null:e.MathUtils.clamp(t,0,100)},autorotateSpeed:function(t){return Lt(t)},autorotateIdle:function(t,e){return t&&dt(e.autorotateDelay)?(yt("autorotateIdle requires a non null autorotateDelay"),!1):t},fisheye:function(t){return!0===t?1:!1===t?0:t},plugins:function(t){return t.map(function(t){if(!(t=Array.isArray(t)?[gt(t[0],ye),t[1]]:[gt(t,ye)])[0])throw new c("Un undefined value was given for plugins.");return t})}};function Se(t){var e=ct(xe);lt(e,t);var i={};return ut(e,function(t,n){if(be[n])yt(be[n]);else{if(!Object.prototype.hasOwnProperty.call(xe,n))throw new c("Unknown option "+n);we[n]?i[n]=we[n](t,e):i[n]=t}}),i}var Ee=function(t){function e(e,i){var n;return(n=t.call(this,e,"psv-caption")||this).prop=s({},n.prop,{id:n.constructor.id,collapsable:!1,width:0,contentWidth:0}),n.content=document.createElement("div"),n.content.className="psv-caption-content",n.container.appendChild(n.content),n.setCaption(i),n}o(e,t);var i=e.prototype;return i.destroy=function(){delete this.content,t.prototype.destroy.call(this)},i.setCaption=function(t){this.show(),this.content.innerHTML=t,this.prop.contentWidth=t?this.content.offsetWidth:0,this.refreshUi()},i.refreshUi=function(){this.toggle(this.container.offsetWidth>=this.prop.contentWidth),this.__refreshButton()},i.hide=function(){this.content.style.display="none",this.prop.visible=!1},i.show=function(){this.content.style.display="",this.prop.visible=!0},i.__refreshButton=function(){var t;null==(t=this.psv.navbar.getButton(Jt.id,!1))||t.refreshUi(!0)},e}(Ht);Ee.id="caption";var Te={},Ae={};function Re(t,e){if(!t.id)throw new c("Button ID is required");if(Te[t.id]=t,t.groupId&&(Ae[t.groupId]=Ae[t.groupId]||[],Ae[t.groupId].push(t)),"string"==typeof e)switch(e){case"start":xe.navbar.unshift(t.id);break;case"end":xe.navbar.push(t.id);break;default:var i=e.split(":"),n=i[0],r=i[1];
2xe.navbar.splice(xe.navbar.indexOf(n)+("right"===r?1:0),0,t.id)}}[Xt,ge,ve,fe,Jt,Qt,ee,ce,he,ue,le].forEach(Re);var Ce=function(t){function e(e){var i;return(i=t.call(this,e,"psv-navbar psv--capture-event")||this).children=[],i.collapsed=[],i}o(e,t);var i=e.prototype;return i.setButtons=function(t){var e=this;this.children.slice().forEach(function(t){return t.destroy()}),this.children.length=0;var i=this.__cleanButtons(t);-1!==i.indexOf(Ee.id)&&-1===i.indexOf(Jt.id)&&i.splice(i.indexOf(Ee.id),0,Jt.id),i.forEach(function(t){if("object"==typeof t)new jt(e,t);else if(Te[t])new Te[t](e);else if(Ae[t])Ae[t].forEach(function(t){return new t(e)});else{if(t!==Ee.id)throw new c("Unknown button "+t);new Ee(e,e.psv.config.caption)}}),new ne(this),this.children.forEach(function(t){"function"==typeof t.checkSupported&&t.checkSupported()})},i.setCaption=function(t){var e=this.getButton(Ee.id,!1);null==e||e.setCaption(t)},i.getButton=function(t,e){void 0===e&&(e=!0);var i=null;return this.children.some(function(e){return e.prop.id===t&&(i=e,!0)}),!i&&e&&yt('button "'+t+'" not found in the navbar'),i},i.show=function(){this.container.classList.add("psv-navbar--open"),this.prop.visible=!0},i.hide=function(){this.container.classList.remove("psv-navbar--open"),this.prop.visible=!1},i.refreshUi=function(){if(t.prototype.refreshUi.call(this),!0===this.psv.prop.uiRefresh){var e=this.container.offsetWidth,i=0,n=[],r=[];if(this.children.forEach(function(t){t.prop.visible&&(i+=t.prop.width,n.push(t),t.prop.collapsable&&r.push(t))}),!n.length)return;e<i&&r.length>0?(r.forEach(function(t){return t.collapse()}),this.collapsed=r,this.getButton(ne.id).show(!1)):e>=i&&this.collapsed.length>0&&(this.collapsed.forEach(function(t){return t.uncollapse()}),this.collapsed=[],this.getButton(ne.id).hide(!1));var s=this.getButton(Ee.id,!1);s&&s.refreshUi()}},i.__cleanButtons=function(t){return!0===t?ct(xe.navbar):"string"==typeof t?t.split(/[ ,]/):t||[]},e}(Ht),Le=function(t){function i(e){var i;return(i=t.call(this,e,"psv-loader-container")||this).loader=document.createElement("div"),i.loader.className="psv-loader",i.container.appendChild(i.loader),i.canvas=document.createElement("canvas"),i.canvas.className="psv-loader-canvas",i.canvas.width=i.loader.clientWidth*P.pixelRatio,i.canvas.height=i.loader.clientWidth*P.pixelRatio,i.loader.appendChild(i.canvas),i.prop=s({},i.prop,{tickness:(i.loader.offsetWidth-i.loader.clientWidth)/2*P.pixelRatio,current:null}),i.refreshUi(),i.hide(),i}o(i,t);var n=i.prototype;return n.destroy=function(){delete this.loader,delete this.canvas,t.prototype.destroy.call(this)},n.refreshUi=function(){if(this.prop.current!==(this.psv.config.loadingImg||this.psv.config.loadingTxt)){var t;if(this.prop.current&&this.loader.removeChild(this.loader.lastChild),this.psv.config.loadingImg?((t=document.createElement("img")).className="psv-loader-image",t.src=this.psv.config.loadingImg):this.psv.config.loadingTxt&&((t=document.createElement("div")).className="psv-loader-text",t.innerHTML=this.psv.config.loadingTxt),t){var e=Math.round(Math.sqrt(2*Math.pow((this.canvas.width/2-this.prop.tickness/2)/P.pixelRatio,2)));t.style.maxWidth=e+"px",t.style.maxHeight=e+"px",this.loader.appendChild(t)}this.prop.current=this.psv.config.loadingImg||this.psv.config.loadingTxt}},n.setProgress=function(t){var i=this.canvas.getContext("2d");i.clearRect(0,0,this.canvas.width,this.canvas.height),i.lineWidth=this.prop.tickness,i.strokeStyle=Z(this.loader,"color"),i.beginPath(),i.arc(this.canvas.width/2,this.canvas.height/2,this.canvas.width/2-this.prop.tickness/2,-Math.PI/2,e.MathUtils.clamp(t,0,100)/100*2*Math.PI-Math.PI/2),i.stroke(),this.psv.trigger(w.LOAD_PROGRESS,Math.round(t))},i}(Ht),Pe=function(t){function e(e){var i;return(i=t.call(this,e,"psv-notification")||this).prop=s({},i.prop,{visible:!1,contentId:void 0,timeout:null}),i.content=document.createElement("div"),i.content.className="psv-notification-content",i.container.appendChild(i.content),i.content.addEventListener("click",function(){return i.hide()}),i}o(e,t);var i=e.prototype;return i.destroy=function(){delete this.content,t.prototype.destroy.call(this)},i.isVisible=function(t){return this.prop.visible&&(!t||!this.prop.contentId||this.prop.contentId===t)},i.toggle=function(){throw new c("Notification cannot be toggled")},i.show=function(t){var e=this;this.prop.timeout&&(clearTimeout(this.prop.timeout),this.prop.timeout=null),"string"==typeof t&&(t={content:t}),this.prop.contentId=t.id,this.content.innerHTML=t.content,this.container.classList.add("psv-notification--visible"),this.prop.visible=!0,this.psv.trigger(w.SHOW_NOTIFICATION,t.id),t.timeout&&(this.prop.timeout=setTimeout(function(){return e.hide(t.id)},t.timeout))},i.hide=function(t){if(this.isVisible(t)){var e=this.prop.contentId;this.container.classList.remove("psv-notification--visible"),this.prop.visible=!1,this.prop.contentId=void 0,this.psv.trigger(w.HIDE_NOTIFICATION,e)}},e}(Ht),Ie=function(t){function e(e){var i;
2return(i=t.call(this,e,"psv-overlay")||this).prop=s({},i.prop,{contentId:void 0,dissmisable:!0}),i.image=document.createElement("div"),i.image.className="psv-overlay-image",i.container.appendChild(i.image),i.text=document.createElement("div"),i.text.className="psv-overlay-text",i.container.appendChild(i.text),i.subtext=document.createElement("div"),i.subtext.className="psv-overlay-subtext",i.container.appendChild(i.subtext),i.psv.on(w.CLICK,l(i)),i.psv.on(w.KEY_PRESS,l(i)),t.prototype.hide.call(l(i)),i}o(e,t);var i=e.prototype;return i.destroy=function(){this.psv.off(w.CLICK,this),this.psv.off(w.KEY_PRESS,this),delete this.image,delete this.text,delete this.subtext,t.prototype.destroy.call(this)},i.handleEvent=function(t){switch(t.type){case w.CLICK:this.isVisible()&&this.prop.dissmisable&&(this.hide(),t.stopPropagation());break;case w.KEY_PRESS:this.isVisible()&&this.prop.dissmisable&&t.args[0]===R.Escape&&(this.hide(),t.preventDefault())}},i.isVisible=function(t){return this.prop.visible&&(!t||!this.prop.contentId||this.prop.contentId===t)},i.toggle=function(){throw new c("Overlay cannot be toggled")},i.show=function(e){"string"==typeof e&&(e={text:e}),this.prop.contentId=e.id,this.prop.dissmisable=!1!==e.dissmisable,this.image.innerHTML=e.image||"",this.text.innerHTML=e.text||"",this.subtext.innerHTML=e.subtext||"",t.prototype.show.call(this),this.psv.trigger(w.SHOW_OVERLAY,e.id)},i.hide=function(e){if(this.isVisible(e)){var i=this.prop.contentId;t.prototype.hide.call(this),this.prop.contentId=void 0,this.psv.trigger(w.HIDE_OVERLAY,i)}},e}(Ht),Oe=200,De=function(t){function e(e){var i;(i=t.call(this,e,"psv-panel psv--capture-event")||this).prop=s({},i.prop,{visible:!1,contentId:void 0,mouseX:0,mouseY:0,mousedown:!1,clickHandler:null,keyHandler:null,width:{}});var n=document.createElement("div");n.className="psv-panel-resizer",i.container.appendChild(n);var r=document.createElement("div");return r.className="psv-panel-close-button",i.container.appendChild(r),i.content=document.createElement("div"),i.content.className="psv-panel-content",i.container.appendChild(i.content),i.container.addEventListener(P.mouseWheelEvent,function(t){return t.stopPropagation()}),r.addEventListener("click",function(){return i.hide()}),n.addEventListener("mousedown",l(i)),n.addEventListener("touchstart",l(i)),i.psv.container.addEventListener("mouseup",l(i)),i.psv.container.addEventListener("touchend",l(i)),i.psv.container.addEventListener("mousemove",l(i)),i.psv.container.addEventListener("touchmove",l(i)),i.psv.on(w.KEY_PRESS,l(i)),i}o(e,t);var i=e.prototype;return i.destroy=function(){this.psv.off(w.KEY_PRESS,this),this.psv.container.removeEventListener("mousemove",this),this.psv.container.removeEventListener("touchmove",this),this.psv.container.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchend",this),delete this.prop,delete this.content,t.prototype.destroy.call(this)},i.handleEvent=function(t){switch(t.type){case"mousedown":this.__onMouseDown(t);break;case"touchstart":this.__onTouchStart(t);break;case"mousemove":this.__onMouseMove(t);break;case"touchmove":this.__onTouchMove(t);break;case"mouseup":case"touchend":this.__onMouseUp(t);break;case w.KEY_PRESS:this.isVisible()&&t.args[0]===R.Escape&&(this.hide(),t.preventDefault())}},i.isVisible=function(t){return this.prop.visible&&(!t||!this.prop.contentId||this.prop.contentId===t)},i.toggle=function(){throw new c("Panel cannot be toggled")},i.show=function(t){var e=this,i=this.isVisible(t.id);"string"==typeof t&&(t={content:t}),this.prop.contentId=t.id,this.prop.visible=!0,this.prop.clickHandler&&(this.content.removeEventListener("click",this.prop.clickHandler),this.content.removeEventListener("keydown",this.prop.keyHandler),this.prop.clickHandler=null,this.prop.keyHandler=null),t.id&&this.prop.width[t.id]?this.container.style.width=this.prop.width[t.id]:t.width?this.container.style.width=t.width:this.container.style.width=null,this.content.innerHTML=t.content,this.content.scrollTop=0,this.container.classList.add("psv-panel--open"),k(this.content,"psv-panel-content--no-margin",!0===t.noMargin),t.clickHandler&&(this.prop.clickHandler=t.clickHandler,this.prop.keyHandler=function(e){e.key===R.Enter&&t.clickHandler(e)},this.content.addEventListener("click",this.prop.clickHandler),this.content.addEventListener("keydown",this.prop.keyHandler),i||setTimeout(function(){var t;null==(t=e.content.querySelector("a,button,[tabindex]"))||t.focu
2s()},300)),this.psv.trigger(w.OPEN_PANEL,t.id)},i.hide=function(t){if(this.isVisible(t)){var e=this.prop.contentId;this.prop.visible=!1,this.prop.contentId=void 0,this.content.innerHTML=null,this.container.classList.remove("psv-panel--open"),this.prop.clickHandler&&(this.content.removeEventListener("click",this.prop.clickHandler),this.prop.clickHandler=null),this.psv.trigger(w.CLOSE_PANEL,e)}},i.__onMouseDown=function(t){t.stopPropagation(),this.__startResize(t)},i.__onTouchStart=function(t){t.stopPropagation(),this.__startResize(t.changedTouches[0])},i.__onMouseUp=function(t){this.prop.mousedown&&(t.stopPropagation(),this.prop.mousedown=!1,this.content.classList.remove("psv-panel-content--no-interaction"))},i.__onMouseMove=function(t){this.prop.mousedown&&(t.stopPropagation(),this.__resize(t))},i.__onTouchMove=function(t){this.prop.mousedown&&this.__resize(t.touches[0])},i.__startResize=function(t){this.prop.mouseX=t.clientX,this.prop.mouseY=t.clientY,this.prop.mousedown=!0,this.content.classList.add("psv-panel-content--no-interaction")},i.__resize=function(t){var e=t.clientX,i=t.clientY,n=Math.max(Oe,this.container.offsetWidth-(e-this.prop.mouseX))+"px";this.prop.contentId&&(this.prop.width[this.prop.contentId]=n),this.container.style.width=n,this.prop.mouseX=e,this.prop.mouseY=i},e}(Ht),Ne='<svg xmlns="http://www.w3.org/2000/svg" viewBox="15 15 70 70"><path fill="currentColor" d="M50,16.2c-18.6,0-33.8,15.1-33.8,33.8S31.4,83.7,50,83.7S83.8,68.6,83.8,50S68.6,16.2,50,16.2z M50,80.2c-16.7,0-30.2-13.6-30.2-30.2S33.3,19.7,50,19.7S80.3,33.3,80.3,50S66.7,80.2,50,80.2z"/><rect fill="currentColor" x="48" y="31.7" width="4" height="28"/><rect fill="currentColor" x="48" y="63.2" width="4" height="5"/>\x3c!--Created by Shastry from the Noun Project--\x3e</svg>\n',Ue=function(){function t(t){this.psv=t,this.config=t.config,this.prop=t.prop}return t.prototype.destroy=function(){delete this.psv,delete this.config,delete this.prop},t}(),Fe=new e.Vector2,ze=new e.Vector3,Be=new e.Euler(0,0,0,"ZXY"),ke=function(t){function i(e){return t.call(this,e)||this}o(i,t);var n=i.prototype;return n.fovToZoomLevel=function(t){var e=Math.round((t-this.config.minFov)/(this.config.maxFov-this.config.minFov)*100);return e-2*(e-50)},n.zoomLevelToFov=function(t){return this.config.maxFov+t/100*(this.config.minFov-this.config.maxFov)},n.vFovToHFov=function(t){return e.MathUtils.radToDeg(2*Math.atan(Math.tan(e.MathUtils.degToRad(t)/2)*this.prop.aspect))},n.speedToDuration=function(t,e){if(t&&"number"==typeof t)return Math.abs(t);var i=t?Lt(t):this.config.autorotateSpeed;return e/Math.abs(i)*1e3},n.textureCoordsToSphericalCoords=function(t){var e=this.prop.panoData;if(!e)throw new c("Current adapter does not support texture coordinates.");var i=(t.x+e.croppedX)/e.fullWidth*Math.PI*2,n=(t.y+e.croppedY)/e.fullHeight*Math.PI,r={longitude:i>=Math.PI?i-Math.PI:i+Math.PI,latitude:Math.PI/2-n};return Be.equals(this.psv.renderer.mesh.rotation)&&Be.equals(this.psv.renderer.meshContainer.rotation)?r:(this.sphericalCoordsToVector3(r,ze),ze.applyEuler(this.psv.renderer.mesh.rotation),ze.applyEuler(this.psv.renderer.meshContainer.rotation),this.vector3ToSphericalCoords(ze))},n.sphericalCoordsToTextureCoords=function(t){var e=this.prop.panoData;if(!e)throw new c("Current adapter does not support texture coordinates.");Be.equals(this.psv.renderer.mesh.rotation)&&Be.equals(this.psv.renderer.meshContainer.rotation)||(this.sphericalCoordsToVector3(t,ze),Dt(ze,this.psv.renderer.meshContainer.rotation),Dt(ze,this.psv.renderer.mesh.rotation),t=this.vector3ToSphericalCoords(ze));var i=t.longitude/Math.PI/2*e.fullWidth,n=t.latitude/Math.PI*e.fullHeight;return{x:Math.round(t.longitude<Math.PI?i+e.fullWidth/2:i-e.fullWidth/2)-e.croppedX,y:Math.round(e.fullHeight/2-n)-e.croppedY}},n.sphericalCoordsToVector3=function(t,i){return i||(i=new e.Vector3),i.x=y*-Math.cos(t.latitude)*Math.sin(t.longitude),i.y=y*Math.sin(t.latitude),i.z=y*Math.cos(t.latitude)*Math.cos(t.longitude),i},n.vector3ToSphericalCoords=function(t){var e=Math.acos(t.y/Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)),i=Math.atan2(t.x,t.z);return{longitude:i<0?-i:2*Math.PI-i,latitude:Math.PI/2-e}},n.viewerCoordsToVector3=function(t){var e=this.getIntersections(t).filter(function(t){return t.object.userData[M]});return e.length?e[0].point:null},n.vector3ToViewerCoords=function(t){var e=t.clone();return e.project(this.psv.renderer.camera),{x:Math.round((e.x+1)/2*this.prop.size.width),y:Math.round((1-e.y)/2*this.prop.size.height)}},n.sphericalCoordsToViewerCoords=function(t){return this.vector3ToViewerCoords(this.sphericalCoordsToVector3(t,ze))},n.getIntersections=function(t){return Fe.x=2*t.x/this.prop.size.width-1,Fe.y=-2*t.y/this.prop.size.height+1,this.psv.renderer.raycaster.setFromCamera(Fe,this.psv.renderer.camera),this.psv.renderer.raycaster.intersectObjects(this.psv.renderer.scene.children,!0).filter(function(t){return!!t.object.userData})},n.cleanPosition=function(t){return void 0!==t.x&&void 0!==t.y?this.textureCoordsToSphericalCoords(t):{longitude:Pt(t.longitude),latitude:Pt(t.latitude,!this.prop.littlePlanet)}},n.cleanSphereCorrection=function(t){return{pan:Pt((null==t?void 0:t.pan)||0),tilt:Pt((null==t?void 0:t.t
2ilt)||0,!0),roll:Pt((null==t?void 0:t.roll)||0,!0,!1)}},n.cleanPanoramaPose=function(t){return{pan:e.MathUtils.degToRad((null==t?void 0:t.poseHeading)||0),tilt:e.MathUtils.degToRad((null==t?void 0:t.posePitch)||0),roll:e.MathUtils.degToRad((null==t?void 0:t.poseRoll)||0)}},i}(Ue),He='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M33.38 33.2a1.96 1.96 0 0 0 1.5-3.23 10.61 10.61 0 0 1 7.18-17.51c.7-.06 1.31-.49 1.61-1.12a13.02 13.02 0 0 1 11.74-7.43c7.14 0 12.96 5.8 12.96 12.9 0 3.07-1.1 6.05-3.1 8.38-.7.82-.61 2.05.21 2.76.83.7 2.07.6 2.78-.22a16.77 16.77 0 0 0 4.04-10.91C72.3 7.54 64.72 0 55.4 0a16.98 16.98 0 0 0-14.79 8.7 14.6 14.6 0 0 0-12.23 14.36c0 3.46 1.25 6.82 3.5 9.45.4.45.94.69 1.5.69m45.74 43.55a22.13 22.13 0 0 1-5.23 12.4c-4 4.55-9.53 6.86-16.42 6.86-12.6 0-20.1-10.8-20.17-10.91a1.82 1.82 0 0 0-.08-.1c-5.3-6.83-14.55-23.82-17.27-28.87-.05-.1 0-.21.02-.23a6.3 6.3 0 0 1 8.24 1.85l9.38 12.59a1.97 1.97 0 0 0 3.54-1.17V25.34a4 4 0 0 1 1.19-2.87 3.32 3.32 0 0 1 2.4-.95c1.88.05 3.4 1.82 3.4 3.94v24.32a1.96 1.96 0 0 0 3.93 0v-33.1a3.5 3.5 0 0 1 7 0v35.39a1.96 1.96 0 0 0 3.93 0v-.44c.05-2.05 1.6-3.7 3.49-3.7 1.93 0 3.5 1.7 3.5 3.82v5.63c0 .24.04.48.13.71l.1.26a1.97 1.97 0 0 0 3.76-.37c.33-1.78 1.77-3.07 3.43-3.07 1.9 0 3.45 1.67 3.5 3.74l-1.77 18.1zM77.39 51c-1.25 0-2.45.32-3.5.9v-.15c0-4.27-3.33-7.74-7.42-7.74-1.26 0-2.45.33-3.5.9V16.69a7.42 7.42 0 0 0-14.85 0v1.86a7 7 0 0 0-3.28-.94 7.21 7.21 0 0 0-5.26 2.07 7.92 7.92 0 0 0-2.38 5.67v37.9l-5.83-7.82a10.2 10.2 0 0 0-13.35-2.92 4.1 4.1 0 0 0-1.53 5.48C20 64.52 28.74 80.45 34.07 87.34c.72 1.04 9.02 12.59 23.4 12.59 7.96 0 14.66-2.84 19.38-8.2a26.06 26.06 0 0 0 6.18-14.6l1.78-18.2v-.2c0-4.26-3.32-7.73-7.42-7.73z"/>\x3c!--Created by AomAm from the Noun Project--\x3e</svg>\n',Ge='<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 17 79 79"><path fill="currentColor" d="M38.1 29.27c-.24 0-.44.2-.44.45v10.7a.45.45 0 00.9 0v-10.7c0-.25-.2-.45-.45-.45zm10.2 26.66a11.54 11.54 0 01-8.48-6.14.45.45 0 10-.8.41 12.45 12.45 0 009.22 6.62.45.45 0 00.07-.9zm24.55-13.08a23.04 23.04 0 00-22.56-23v7.07l-.01.05a2.83 2.83 0 012.39 2.78v14.03l.09-.02h8.84v-9.22a.45.45 0 11.9 0v9.22h10.35v-.9zm0 27.33V44.66H62.5c-.02 2.01-.52 4-1.47 5.76a.45.45 0 01-.61.18.45.45 0 01-.19-.61 11.54 11.54 0 001.36-5.33h-8.83l-.1-.01a2.83 2.83 0 01-2.83 2.84h-.04-.04a2.83 2.83 0 01-2.83-2.83v-14.9a2.82 2.82 0 012.47-2.8v-7.11a23.04 23.04 0 00-22.57 23v.91h14.72V29.88a8.2 8.2 0 015.02-7.57c.22-.1.5.01.59.24.1.23-.01.5-.24.6a7.3 7.3 0 00-4.47 6.73v13.88h3.9a.45.45 0 110 .9h-3.9v.15a7.32 7.32 0 0011.23 6.17.45.45 0 01.49.76 8.22 8.22 0 01-12.62-6.93v-.15H26.82v25.52a23.04 23.04 0 0023.01 23.01 23.04 23.04 0 0023.02-23.01zm1.8-27.33v27.33A24.85 24.85 0 0149.84 95a24.85 24.85 0 01-24.82-24.82V42.85a24.85 24.85 0 0124.82-24.82 24.85 24.85 0 0124.83 24.82zM57.98 29.88v9.36a.45.45 0 11-.9 0v-9.36a7.28 7.28 0 00-3.4-6.17.45.45 0 01.49-.76 8.18 8.18 0 013.8 6.93z"/>\x3c!-- Created by Icon Island from the Noun Project --\x3e</svg>\n',Ve=0,We=1,Xe=2,je=function(t){function i(e){var i;return(i=t.call(this,e)||this).state={moveThreshold:p*P.pixelRatio,keyboardEnabled:!1,step:Ve,mousedown:!1,startMouseX:0,startMouseY:0,mouseX:0,mouseY:0,mouseHistory:[],pinchDist:0,keyHandler:new se,ctrlKeyDown:!1,dblclickData:null,dblclickTimeout:null,longtouchTimeout:null,twofingersTimeout:null,ctrlZoomTimeout:null},i.__onResize=ot(function(){return i.psv.autoSize()},50),i}o(i,t);var n=i.prototype;return n.init=function(){window.addEventListener("resize",this),window.addEventListener("keydown",this,{passive:!1}),window.addEventListener("keyup",this),this.psv.container.addEventListener("mousedown",this),window.addEventListener("mousemove",this,{passive:!1}),window.addEventListener("mouseup",this),this.psv.container.addEventListener("touchstart",this,{passive:!1}),window.addEventListener("touchmove",this,{passive:!1}),window.addEventListener("touchend",this,{passive:!1}),this.psv.container.addEventListener(P.mouseWheelEvent,this,{passive:!1}),P.fullscreenEvent&&document.addEventListener(P.fullscreenEvent,this)},n.destroy=function(){window.removeEventListener("resize",this),window.removeEventListener("keydown",this),window.removeEventListener("keyup",this),this.psv.container.removeEventListener("mousedown",this),window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchstart",this),window.removeEventListener("touchmove",this),window.removeEventListener("touchend",this),this.psv.container.removeEventListener(P.mouseWheelEvent,this),P.fullscreenEvent&&document.removeEventListener(P.fullscreenEvent,this),clearTimeout(this.state.dblclickTimeout),clearTimeout(this.state.longtouchTimeout),clearTimeout(this.state.twofingersTimeout),clearTimeout(this.state.ctrlZoomTimeout),delete this.state,t.prototype.destroy.call(this)},n.handleEvent=function(t){switch(t.type){case"resize":this.__onResize();break;case"keydown":this.__onKeyDown(t);break;case"keyup":this.__onKeyUp();break;case"mousemove":this.__onMouseMove(t);break;case"mouseup":this.__onMouseUp(t);break;case"touchmove":this.__onTouchMove(t);break;case"touchend":this.__onTouchEnd(t);break;case P.fullscreenEvent:this.__fullscreenToggled()}if(!W(t.target,".psv--capture-event"))switch(t.type){case"mousedown":this.__onMouseDown(t);break;case"touchstart":this.__onTouchStart(t);break;case P.mouseWheelEvent:this.__onMouseWheel(t)}},n.enableKeyboard=function(){this.state.keyboardEnabled=!0},n.disableKeyboard=function(){this.state.keyboardEnabled=!1},n.__onKeyDown=function(t){if(this.config.mousewheelCtrlKey&&(this.state.ctrlKeyDown=t.key===R.Control,this.state.ctrlKeyDown&&(clearTimeout(this.state.ctrlZoomTimeout),this.psv.overlay.hide(T.CTRL_ZOOM))),!this.psv.trigger(w.KEY_PRESS,t.key).isDefaultPrevented()&&this.state.keyboardEnabled){var e=this.config.keyboard[t.key];if(e===b.TOGGLE_AUTOROTATE)this.psv.toggleAutorotate(),t.preventDefault();else if(e&&!this.state.keyHandler.time){switch(e!==b.ZOOM_IN&&e!==b.ZOOM_OUT&&this.psv.__stopAll(),e){case b.ROTATE_LAT_UP:this.psv.dynamics.position.roll({latitude:!1});break;case b.ROTATE_LAT_DOWN:this.psv.dynamics.position.roll({latitude:!0});break;case b.ROTATE_LONG_RIGHT:this.psv.dynamics.position.roll({longitude:!1});break;case b.ROTATE_LONG_LEFT:this.psv.dynamics.position.roll({longitude:!0});break;case b.ZOOM_IN:this.psv.dynamics.zoom.roll(!1);break;case b.ZOOM_OUT:this.psv.dynamics.zoom.roll(!0)}this.state.keyHandler.down(),t.preventDefault()}}},n.__onKeyUp=function(){var t=this;this.state.ctrlKeyDown=!1,this.state.keyboardEnabled&&this.state.keyHandler.up(function(){t.psv.dynamics.position.stop(),t.psv.dynamics.zoom.stop(),t.psv.resetIdleTimer()})},n.__onMouseDown=function(t){this.state.mousedown=!0,this.state.startMouseX=t.clientX,this.state.startMouseY=t.clientY},n.__onMouseUp=function(t){(this.state.mousedown||this.state.step===We)&&this.__stopMove(t.clientX,t.clientY,t.target,2===t.button)},n.__onMouseMove=function(t){if(this.config.mousemove&&(this.state.mousedown||this.state.step===We)&&(t.preventDefault(),this.__move(t.clientX,t.clientY)),!ht(this.prop.objectsObservers)&&V(t.target,this.psv.container)){var e=X(this.psv.container),i={x:t.clientX-e.left,y:t.clientY-e.top},n=this.psv.dataHelper.getIntersections(i),r=function(e,n,r){e.listener.handleEvent(new CustomEvent(r,{detail:{originalEvent:t,object:e.object,data:e.object.userData[n],viewerPoint:i}}
2))};ut(this.prop.objectsObservers,function(t,e){var i=n.find(function(t){return t.object.userData[e]});i?(t.object&&i.object!==t.object&&(r(t,e,E.LEAVE_OBJECT),delete t.object),t.object?r(t,e,E.HOVER_OBJECT):(t.object=i.object,r(t,e,E.ENTER_OBJECT))):t.object&&(r(t,e,E.LEAVE_OBJECT),delete t.object)})}},n.__onTouchStart=function(t){var e=this;1===t.touches.length?(this.state.mousedown=!0,this.state.startMouseX=t.touches[0].clientX,this.state.startMouseY=t.touches[0].clientY,this.prop.longtouchTimeout||(this.prop.longtouchTimeout=setTimeout(function(){var i=t.touches[0];e.__stopMove(i.clientX,i.clientY,i.target,!0),e.prop.longtouchTimeout=null},m))):2===t.touches.length&&(this.state.mousedown=!1,this.__cancelLongTouch(),this.config.mousemove&&(this.__cancelTwoFingersOverlay(),this.__startMoveZoom(t),t.preventDefault()))},n.__onTouchEnd=function(t){if(this.__cancelLongTouch(),this.state.mousedown||this.state.step===We)if(t.preventDefault(),this.__cancelTwoFingersOverlay(),1===t.touches.length)this.__stopMove(this.state.mouseX,this.state.mouseY);else if(0===t.touches.length){var e=t.changedTouches[0];this.__stopMove(e.clientX,e.clientY,e.target)}},n.__onTouchMove=function(t){var e=this;if(this.__cancelLongTouch(),this.config.mousemove)if(1===t.touches.length){if(this.config.touchmoveTwoFingers)this.state.mousedown&&!this.prop.twofingersTimeout&&(this.prop.twofingersTimeout=setTimeout(function(){e.psv.overlay.show({id:T.TWO_FINGERS,image:He,text:e.config.lang.twoFingers})},g));else if(this.state.mousedown||this.state.step===We){t.preventDefault();var i=t.touches[0];this.__move(i.clientX,i.clientY)}}else this.__moveZoom(t),this.__cancelTwoFingersOverlay()},n.__cancelLongTouch=function(){this.prop.longtouchTimeout&&(clearTimeout(this.prop.longtouchTimeout),this.prop.longtouchTimeout=null)},n.__cancelTwoFingersOverlay=function(){this.config.touchmoveTwoFingers&&(this.prop.twofingersTimeout&&(clearTimeout(this.prop.twofingersTimeout),this.prop.twofingersTimeout=null),this.psv.overlay.hide(T.TWO_FINGERS))},n.__onMouseWheel=function(t){var e=this;if(this.config.mousewheel){if(this.config.mousewheelCtrlKey&&!this.state.ctrlKeyDown)return this.psv.overlay.show({id:T.CTRL_ZOOM,image:Ge,text:this.config.lang.ctrlZoom}),clearTimeout(this.state.ctrlZoomTimeout),void(this.state.ctrlZoomTimeout=setTimeout(function(){return e.psv.overlay.hide(T.CTRL_ZOOM)},v));t.preventDefault(),t.stopPropagation();var i=5*J(t).spinY*this.config.zoomSpeed;0!==i&&this.psv.dynamics.zoom.step(-i,5)}},n.__fullscreenToggled=function(t){this.prop.fullscreen=void 0!==t?t:j(this.psv.container),this.config.keyboard&&(this.prop.fullscreen?this.psv.startKeyboardControl():this.psv.stopKeyboardControl()),this.psv.trigger(w.FULLSCREEN_UPDATED,this.prop.fullscreen)},n.__resetMove=function(){this.state.step=Ve,this.state.mousedown=!1,this.state.mouseX=0,this.state.mouseY=0,this.state.startMouseX=0,this.state.startMouseY=0,this.state.mouseHistory.length=0},n.__startMoveZoom=function(t){this.psv.__stopAll(),this.__resetMove();var e={x:t.touches[0].clientX,y:t.touches[0].clientY},i={x:t.touches[1].clientX,y:t.touches[1].clientY};this.state.step=We,this.state.pinchDist=et(e,i),this.state.mouseX=(e.x+i.x)/2,this.state.mouseY=(e.y+i.y)/2,this.__logMouseMove(this.state.mouseX,this.state.mouseY)},n.__stopMove=function(t,e,i,n){void 0===i&&(i=null),void 0===n&&(n=!1),this.state.step===We?this.config.moveInertia?(this.__logMouseMove(t,e),this.__stopMoveInertia(t,e)):(this.__resetMove(),this.psv.resetIdleTimer()):this.state.mousedown&&(this.psv.stopAnimation(),this.__click(t,e,i,n),this.__resetMove(),this.psv.resetIdleTimer())},n.__stopMoveInertia=function(t,i){var n=this,r=new e.SplineCurve(this.state.mouseHistory.map(function(t){var i=t[1],n=t[2];return new e.Vector2(i,n)})).getTangent(1),s=this.state.mouseHistory.slice(1).reduce(function(t,e){var i=t.total,n=t.prev;return{total:i+et({x:n[1],y:n[2]},{x:e[1],y:e[2]})/(e[0]-n[0]),prev:e}},{total:0,prev:this.state.mouseHistory[0]}).total/this.state.mouseHistory.length;if(!s)return this.__resetMove(),void this.psv.resetIdleTimer();this.state.step=Xe;var o=t,a=i;this.prop.animationPromise=new Nt({properties:{speed:{start:s,end:0}},duration:1e3,easing:"outQuad",onTick:function(t){o+=t.speed*r.x*3*P.pixelRatio,a+=t.speed*r.y*3*P.pixelRatio,n.__applyMove(o,a)}}),this.prop.animationPromise.then(function(t){n.prop.animationPromise=null,t&&(n.__resetMove(),n.psv.resetIdleTimer())})}
2,n.__click=function(t,e,i,n){var r=this;void 0===n&&(n=!1);var s=this.psv.container.getBoundingClientRect(),o={rightclick:n,target:i,clientX:t,clientY:e,viewerX:t-s.left,viewerY:e-s.top},a=this.psv.dataHelper.getIntersections({x:o.viewerX,y:o.viewerY}),l=a.find(function(t){return t.object.userData[M]});if(l){var c=this.psv.dataHelper.vector3ToSphericalCoords(l.point);o.longitude=c.longitude,o.latitude=c.latitude,o.objects=a.map(function(t){return t.object}).filter(function(t){return!t.userData[M]});try{var h=this.psv.dataHelper.sphericalCoordsToTextureCoords(o);o.textureX=h.x,o.textureY=h.y}catch(t){o.textureX=NaN,o.textureY=NaN}this.state.dblclickTimeout?(Math.abs(this.state.dblclickData.clientX-o.clientX)<this.state.moveThreshold&&Math.abs(this.state.dblclickData.clientY-o.clientY)<this.state.moveThreshold&&this.psv.trigger(w.DOUBLE_CLICK,this.state.dblclickData),clearTimeout(this.state.dblclickTimeout),this.state.dblclickTimeout=null,this.state.dblclickData=null):(this.psv.trigger(w.CLICK,o),this.state.dblclickData=ct(o),this.state.dblclickTimeout=setTimeout(function(){r.state.dblclickTimeout=null,r.state.dblclickData=null},f))}},n.__move=function(t,e){this.state.mousedown&&(Math.abs(t-this.state.startMouseX)>=this.state.moveThreshold||Math.abs(e-this.state.startMouseY)>=this.state.moveThreshold)?(this.psv.__stopAll(),this.__resetMove(),this.state.step=We,this.state.mouseX=t,this.state.mouseY=e,this.__logMouseMove(t,e)):this.state.step===We&&(this.__applyMove(t,e),this.__logMouseMove(t,e))},n.__applyMove=function(t,i){var n={longitude:(t-this.state.mouseX)/this.prop.size.width*this.config.moveSpeed*e.MathUtils.degToRad(this.prop.littlePlanet?90:this.prop.hFov),latitude:(i-this.state.mouseY)/this.prop.size.height*this.config.moveSpeed*e.MathUtils.degToRad(this.prop.littlePlanet?90:this.prop.vFov)},r=this.psv.getPosition();this.psv.rotate({longitude:r.longitude-n.longitude,latitude:r.latitude+n.latitude}),this.state.mouseX=t,this.state.mouseY=i},n.__moveZoom=function(t){if(this.state.step===We){t.preventDefault();var e={x:t.touches[0].clientX,y:t.touches[0].clientY},i={x:t.touches[1].clientX,y:t.touches[1].clientY},n=et(e,i),r=(n-this.state.pinchDist)/P.pixelRatio*this.config.zoomSpeed;this.psv.zoom(this.psv.getZoomLevel()+r),this.__move((e.x+i.x)/2,(e.y+i.y)/2),this.state.pinchDist=n}},n.__logMouseMove=function(t,e){var i=Date.now(),n=this.state.mouseHistory.length?this.state.mouseHistory[this.state.mouseHistory.length-1]:[0,-1,-1];n[1]===t&&n[2]===e?n[0]=i:i===n[0]?(n[1]=t,n[2]=e):this.state.mouseHistory.push([i,t,e]);for(var r=null,s=0;s<this.state.mouseHistory.length;)this.state.mouseHistory[s][0]<i-_?this.state.mouseHistory.splice(s,1):r&&this.state.mouseHistory[s][0]-r>_/10?(this.state.mouseHistory.splice(0,s),s=0,r=this.state.mouseHistory[s][0]):(r=this.state.mouseHistory[s][0],s++)},i}(Ue),Ye=function(t){function i(i){var n,r;return(r=t.call(this,i)||this).renderer=new e.WebGLRenderer({alpha:!0,antialias:!0}),r.renderer.setPixelRatio(P.pixelRatio),r.renderer.domElement.className="psv-canvas",r.scene=new e.Scene,r.camera=new e.PerspectiveCamera(50,16/9,.1,2*y),r.mesh=r.psv.adapter.createMesh(),r.mesh.userData=((n={})[M]=!0,n),r.meshContainer=new e.Group,r.meshContainer.add(r.mesh),r.scene.add(r.meshContainer),r.raycaster=new e.Raycaster,r.timestamp=null,r.ready=!1,r.canvasContainer=document.createElement("div"),r.canvasContainer.className="psv-canvas-container",r.canvasContainer.style.background=r.psv.config.canvasBackground,r.canvasContainer.style.cursor=r.psv.config.mousemove?"move":"default",r.canvasContainer.appendChild(r.renderer.domElement),r.psv.container.appendChild(r.canvasContainer),i.on(w.SIZE_UPDATED,l(r)),i.on(w.ZOOM_UPDATED,l(r)),i.on(w.POSITION_UPDATED,l(r)),i.on(w.CONFIG_CHANGED,l(r)),r.hide(),r}o(i,t);var n=i.prototype;return n.destroy=function(){this.renderer.setAnimationLoop(null),this.__cleanTHREEScene(this.scene),this.psv.container.removeChild(this.canvasContainer),delete this.canvasContainer,delete this.renderer,delete this.scene,delete this.camera,delete this.mesh,delete this.meshContainer,delete this.raycaster,t.prototype.destroy.call(this)},n.handleEvent=function(t){switch(t.type){case w.SIZE_UPDATED:this.__onSizeUpdated();break;
2case w.ZOOM_UPDATED:this.__onZoomUpdated();break;case w.POSITION_UPDATED:this.__onPositionUpdated();break;case w.CONFIG_CHANGED:t.args[0].includes("fisheye")&&this.__onPositionUpdated(),t.args[0].includes("mousemove")&&(this.canvasContainer.style.cursor=this.psv.config.mousemove?"move":"default")}},n.hide=function(){this.canvasContainer.style.opacity=0},n.show=function(){this.canvasContainer.style.opacity=1},n.__onSizeUpdated=function(){this.renderer.setSize(this.prop.size.width,this.prop.size.height),this.camera.aspect=this.prop.aspect,this.camera.updateProjectionMatrix(),this.prop.needsUpdate=!0},n.__onZoomUpdated=function(){this.camera.fov=this.prop.vFov,this.camera.updateProjectionMatrix(),this.prop.needsUpdate=!0},n.__onPositionUpdated=function(){this.camera.position.set(0,0,0),this.camera.lookAt(this.prop.direction),this.config.fisheye&&this.camera.position.copy(this.prop.direction).multiplyScalar(this.config.fisheye/2).negate(),this.prop.needsUpdate=!0},n.__renderLoop=function(t){var e=null!==this.timestamp?t-this.timestamp:0;this.timestamp=t,this.psv.trigger(w.BEFORE_RENDER,t,e),ut(this.psv.dynamics,function(t){return t.update(e)}),this.prop.idleTime>0&&t-this.prop.idleTime>this.config.autorotateDelay&&this.psv.startAutorotate(),this.prop.needsUpdate&&(this.render(),this.prop.needsUpdate=!1)},n.render=function(){this.renderer.render(this.scene,this.camera),this.psv.trigger(w.RENDER)},n.setTexture=function(t){var e=this;this.prop.panoData=t.panoData,this.psv.adapter.setTexture(this.mesh,t),this.ready||(this.renderer.setAnimationLoop(function(t){return e.__renderLoop(t)}),this.ready=!0),this.psv.needsUpdate(),this.psv.trigger(w.PANORAMA_LOADED,t)},n.setOverlay=function(t,e){this.psv.adapter.setOverlay(this.mesh,t,e),this.psv.needsUpdate()},n.setPanoramaPose=function(t,e){void 0===e&&(e=this.mesh);var i=this.psv.dataHelper.cleanPanoramaPose(t);e.rotation.set(-i.tilt,-i.pan,-i.roll,"ZXY")},n.setSphereCorrection=function(t,e){void 0===e&&(e=this.meshContainer);var i=this.psv.dataHelper.cleanSphereCorrection(t);e.rotation.set(i.tilt,i.pan,i.roll,"ZXY")},n.transition=function(t,i){var n=this,r=xt(i),s="zoom"in i,o=new e.Group,a=this.psv.adapter.createMesh(.5);if(this.psv.adapter.setTexture(a,t,!0),this.psv.adapter.setTextureOpacity(a,0),this.setPanoramaPose(t.panoData,a),this.setSphereCorrection(i.sphereCorrection,o),r){var l=this.psv.dataHelper.cleanPosition(i),c=this.psv.getPosition(),h=new e.Vector3(0,1,0);o.rotateOnWorldAxis(h,l.longitude-c.longitude);var u=new e.Vector3(0,1,0).cross(this.camera.getWorldDirection(new e.Vector3)).normalize();o.rotateOnWorldAxis(u,l.latitude-c.latitude)}o.add(a),this.scene.add(o);var d=new Nt({properties:{opacity:{start:0,end:1},zoom:s?{start:this.psv.getZoomLevel(),end:i.zoom}:void 0},duration:i.transition,easing:"outCubic",onTick:function(t){n.psv.adapter.setTextureOpacity(a,t.opacity),n.psv.adapter.setTextureOpacity(n.mesh,1-t.opacity),s&&n.psv.zoom(t.zoom),n.psv.needsUpdate()}});return d.then(function(e){e?(n.setTexture(t),n.psv.adapter.setTextureOpacity(n.mesh,1),n.setPanoramaPose(t.panoData),n.setSphereCorrection(i.sphereCorrection),r&&n.psv.rotate(i)):n.psv.adapter.disposeTexture(t),n.scene.remove(o),a.geometry.dispose(),a.geometry=null}),d},n.__cleanTHREEScene=function(t){var i=this;t.traverse(function(n){n.geometry&&n.geometry.dispose(),n.material&&(Array.isArray(n.material)?n.material.forEach(function(t){t.map&&t.map.dispose(),t.dispose()}):(n.material.map&&n.material.map.dispose(),n.material.dispose())),!n.dispose||n instanceof e.Scene||n.dispose(),n!==t&&i.__cleanTHREEScene(n)})},i}(Ue),qe=function(t){function i(i){var n;return(n=t.call(this,i)||this).loader=new e.FileLoader,n.loader.setResponseType("blob"),n.config.withCredentials&&n.loader.setWithCredentials(!0),n.config.requestHeaders&&"object"==typeof n.config.requestHeaders&&n.loader.setRequestHeader(n.config.requestHeaders),n}o(i,t);var n=i.prototype;return n.destroy=function(){this.abortLoading(),t.prototype.destroy.call(this)},n.abortLoading=function(){},n.loadFile=function(t,e){var i=this;return this.config.requestHeaders&&"function"==typeof this.config.requestHeaders&&this.loader.setRequestHeader(this.config.requestHeaders(t)),new Promise(function(n,r){var s=0;null==e||e(s),i.loader.load(t,function(t){s=100,null==e||e(s),n(t)},function(t){if(t.lengthComputable){var i=t.loaded/t.total*100;i>s&&(s=i,null==e||e(s))}},function(t){r(t)})})},n.loadImage=function(t,e){return this.loadFile(t,e).then(function(t){return new Promise(function(e,i){var n=document.createElementNS("http://www.w3.org/1999/xhtml","img");n.onload=function(){URL.revokeObjectURL(n.src),e(n)},n.onerror=i,n.src=URL.createObjectURL(t)})})},n.preloadPanorama=function(t){return this.psv.adapter.supportsPreload(t)?this.psv.adapter.loadTexture(t):Prom
2ise.resolve()},i}(Ue),Ze={NONE:0,SHOWING:1,HIDING:2,READY:3},Je=function(t){function e(e,i){var n;return(n=t.call(this,e,"psv-tooltip")||this).prop=s({},n.prop,i,{state:Ze.NONE,width:0,height:0,pos:"",config:null,data:null}),n.content=document.createElement("div"),n.content.className="psv-tooltip-content",n.container.appendChild(n.content),n.arrow=document.createElement("div"),n.arrow.className="psv-tooltip-arrow",n.container.appendChild(n.arrow),n.container.addEventListener("transitionend",l(n)),n.container.style.top="-1000px",n.container.style.left="-1000px",n}o(e,t);var i=e.prototype;return i.destroy=function(){delete this.arrow,delete this.content,t.prototype.destroy.call(this)},i.handleEvent=function(t){"transitionend"===t.type&&this.__onTransitionEnd(t)},i.toggle=function(){throw new c("Tooltip cannot be toggled")},i.show=function(t){if(this.prop.state!==Ze.NONE)throw new c("Initialized tooltip cannot be re-initialized");t.className&&H(this.container,t.className),this.content.innerHTML=t.content;var e=this.container.getBoundingClientRect();this.prop.width=e.right-e.left,this.prop.height=e.bottom-e.top,this.prop.state=Ze.READY,this.move(t),this.prop.data=t.data,this.prop.state=Ze.SHOWING,this.psv.trigger(w.SHOW_TOOLTIP,this.prop.data,this),this.__waitImages()},i.move=function(t){if(this.prop.state!==Ze.SHOWING&&this.prop.state!==Ze.READY)throw new c("Uninitialized tooltip cannot be moved");t.box||(t.box={width:0,height:0}),this.config=t;var e=this.container,i=this.arrow,n={posClass:Rt(t.position,{allowCenter:!1,cssOrder:!1})||["top","center"],width:this.prop.width,height:this.prop.height,top:0,left:0,arrowTop:0,arrowLeft:0};this.__computeTooltipPosition(n,t);var r=null,s=null;if(n.top<0?r="bottom":n.top+n.height>this.psv.prop.size.height&&(r="top"),n.left<0?s="right":n.left+n.width>this.psv.prop.size.width&&(s="left"),s||r){var o=Ct(n.posClass);r&&(n.posClass[o?0:1]=r),s&&(n.posClass[o?1:0]=s),this.__computeTooltipPosition(n,t)}e.style.top=n.top+"px",e.style.left=n.left+"px",i.style.top=n.arrowTop+"px",i.style.left=n.arrowLeft+"px";var a=n.posClass.join("-");a!==this.prop.pos&&(e.classList.remove("psv-tooltip--"+this.prop.pos),this.prop.pos=a,e.classList.add("psv-tooltip--"+this.prop.pos))},i.hide=function(){this.container.classList.remove("psv-tooltip--visible"),this.prop.state=Ze.HIDING,this.psv.trigger(w.HIDE_TOOLTIP,this.prop.data)},i.__onTransitionEnd=function(t){if("transform"===t.propertyName)switch(this.prop.state){case Ze.SHOWING:this.container.classList.add("psv-tooltip--visible"),this.prop.state=Ze.READY;break;case Ze.HIDING:this.prop.state=Ze.NONE,this.destroy()}},i.__computeTooltipPosition=function(t,e){var i=this.prop.arrow,n=e.top,r=t.height,s=e.left,o=t.width,a=i+this.prop.border,l=e.box.width/2+2*i,c=e.box.height/2+2*i;switch(t.posClass.join("-")){case"top-left":t.top=n-c-r,t.left=s+a-o,t.arrowTop=r,t.arrowLeft=o-a-i;break;case"top-center":t.top=n-c-r,t.left=s-o/2,t.arrowTop=r,t.arrowLeft=o/2-i;break;case"top-right":t.top=n-c-r,t.left=s-a,t.arrowTop=r,t.arrowLeft=i;break;case"bottom-left":t.top=n+c,t.left=s+a-o,t.arrowTop=2*-i,t.arrowLeft=o-a-i;break;case"bottom-center":t.top=n+c,t.left=s-o/2,t.arrowTop=2*-i,t.arrowLeft=o/2-i;break;case"bottom-right":t.top=n+c,t.left=s-a,t.arrowTop=2*-i,t.arrowLeft=i;break;case"left-top":t.top=n+a-r,t.left=s-l-o,t.arrowTop=r-a-i,t.arrowLeft=o;break;case"center-left":t.top=n-r/2,t.left=s-l-o,t.arrowTop=r/2-i,t.arrowLeft=o;break;case"left-bottom":t.top=n-a,t.left=s-l-o,t.arrowTop=i,t.arrowLeft=o;break;case"right-top":t.top=n+a-r,t.left=s+l,t.arrowTop=r-a-i,t.arrowLeft=2*-i;break;case"center-right":t.top=n-r/2,t.left=s+l,t.arrowTop=r/2-i,t.arrowLeft=2*-i;break;case"right-bottom":t.top=n-a,t.left=s+l,t.arrowTop=i,t.arrowLeft=2*-i}},i.__waitImages=function(){var t=this,e=this.content.querySelectorAll("img");if(e.length>0){var i=[];e.forEach(function(t){i.push(new Promise(function(e){t.onload=e,t.onerror=e}))}),Promise.all(i).then(function(){if(t.prop.state===Ze.SHOWING||t.prop.state===Ze.READY){var e=t.container.getBoundingClientRect();t.prop.width=e.right-e.left,t.prop.height=e.bottom-e.top,t.move(t.config)}})}},e}(Ht),Ke=function(t){function e(e){var i;i=t.call(this,e)||this;var n=new Je(i.psv,{arrow:0,border:0});
2return i.size={arrow:parseInt(Z(n.arrow,"borderTopWidth"),10),border:parseInt(Z(n.container,"borderTopLeftRadius"),10)},n.destroy(),i}o(e,t);var i=e.prototype;return i.destroy=function(){delete this.size,t.prototype.destroy.call(this)},i.create=function(t){var e=new Je(this.psv,this.size);return e.show(t),e},e}(Ue);e.Cache.enabled=!0;var Qe=function(t){function i(i){var n;if(n=t.call(this)||this,P.load(),!P.isWebGLSupported)throw new c("WebGL is not supported.");if(0===P.maxTextureWidth)throw new c("Unable to detect system capabilities");return n.prop={ready:!1,uiRefresh:!1,needsUpdate:!1,fullscreen:!1,direction:new e.Vector3(0,0,y),vFov:null,hFov:null,aspect:null,autorotateEnabled:!1,animationPromise:null,loadingPromise:null,littlePlanet:!1,idleTime:-1,objectsObservers:{},size:{width:0,height:0},panoData:{fullWidth:0,fullHeight:0,croppedWidth:0,croppedHeight:0,croppedX:0,croppedY:0,poseHeading:0,posePitch:0,poseRoll:0}},n.config=Se(i),n.parent="string"==typeof i.container?document.getElementById(i.container):i.container,n.parent[x]=l(n),n.container=document.createElement("div"),n.container.classList.add("psv-container"),n.parent.appendChild(n.container),n.adapter=new n.config.adapter[0](l(n),n.config.adapter[1]),n.children=[],n.plugins={},n.renderer=new Ye(l(n)),n.textureLoader=new qe(l(n)),n.eventsHandler=new je(l(n)),n.dataHelper=new ke(l(n)),n.loader=new Le(l(n)),n.navbar=new Ce(l(n)),n.panel=new De(l(n)),n.tooltip=new Ke(l(n)),n.notification=new Pe(l(n)),n.overlay=new Ie(l(n)),n.dynamics={zoom:new Ut(function(t){n.prop.vFov=n.dataHelper.zoomLevelToFov(t),n.prop.hFov=n.dataHelper.vFovToHFov(n.prop.vFov),n.trigger(w.ZOOM_UPDATED,t)},n.config.defaultZoomLvl,0,100),position:new Ft({longitude:new Ut(null,n.config.defaultLong,0,2*Math.PI,!0),latitude:n.prop.littlePlanet?new Ut(null,n.config.defaultLat,0,2*Math.PI,!0):new Ut(null,n.config.defaultLat,-Math.PI/2,Math.PI/2)},function(t){n.dataHelper.sphericalCoordsToVector3(t,n.prop.direction),n.trigger(w.POSITION_UPDATED,t)})},n.__updateSpeeds(),n.eventsHandler.init(),n.__resizeRefresh=ot(function(){return n.refreshUi("resize")},500),n.resize(n.config.size),n.config.plugins.forEach(function(t){var e=t[0],i=t[1];n.plugins[e.id]=new e(l(n),i)}),ut(n.plugins,function(t){return null==t.init?void 0:t.init()}),n.navbar.setButtons(n.config.navbar),n.config.panorama&&n.setPanorama(n.config.panorama),k(n.container,"psv--is-touch",P.isTouchEnabled.initial),P.isTouchEnabled.promise.then(function(t){return k(n.container,"psv--is-touch",t)}),n.once(w.RENDER,function(){n.config.navbar&&(n.container.classList.add("psv--has-navbar"),n.navbar.show()),dt(n.config.autorotateDelay)||(n.prop.idleTime=performance.now()),n.prop.ready=!0,setTimeout(function(){n.refreshUi("init"),n.trigger(w.READY)},0)}),n}o(i,t);var n=i.prototype;return n.destroy=function(){this.__stopAll(),this.stopKeyboardControl(),this.exitFullscreen(),ut(this.plugins,function(t){return t.destroy()}),delete this.plugins,this.children.slice().forEach(function(t){return t.destroy()}),this.children.length=0,this.eventsHandler.destroy(),this.renderer.destroy(),this.textureLoader.destroy(),this.dataHelper.destroy(),this.adapter.destroy(),this.parent.removeChild(this.container),delete this.parent[x],delete this.parent,delete this.container,delete this.loader,delete this.navbar,delete this.panel,delete this.tooltip,delete this.notification,delete this.overlay,delete this.dynamics,delete this.config},n.refreshUi=function(t){var e=this;this.prop.ready&&(this.prop.uiRefresh?"new"!==this.prop.uiRefresh&&(this.prop.uiRefresh="new",setTimeout(function(){e.prop.uiRefresh=!1,e.refreshUi(t)})):(this.prop.uiRefresh=!0,this.children.every(function(t){return t.refreshUi(),!0===e.prop.uiRefresh}),this.prop.uiRefresh=!1))},n.getPlugin=function(t){if("string"==typeof t)return this.plugins[t];var e=gt(t,ye);return e?this.plugins[e.id]:void 0},n.getPosition=function(){return this.dataHelper.cleanPosition(this.dynamics.position.current)},n.getZoomLevel=function(){return this.dynamics.zoom.current},n.getSize=function(){return s({},this.prop.size)},n.isAutorotateEnabled=function(){return this.prop.autorotateEnabled},n.isFullscreenEnabled=function(){return P.fullscreenEvent?j(this.container):this.prop.fullscreen},n.needsUpdate=function(){this.prop.needsUpdate=!0},n.autoSize=function(){this.container.clientWidth===this.prop.size.width&&this.container.clientHeight===this.prop.size.height||(this.prop.size.width=Math.round(this.container.clientWidth),this.prop.size.height=Math.round(this.container.clientHeight),this.prop.aspect=this.prop.size.width/this.prop.size.height,this.prop.hFov=this.dataHelper.vFovToHFov(this.prop.vFov),this.trigger(w.SIZE_UPDATED,this.get
2Size()),this.__resizeRefresh())},n.setPanorama=function(t,e){var i,n=this;void 0===e&&(e={}),this.textureLoader.abortLoading(),null==(i=this.prop.transitionAnimation)||i.cancel(),this.prop.ready||["sphereCorrection","panoData","overlay","overlayOpacity"].forEach(function(t){t in e||(e[t]=n.config[t])}),void 0!==e.transition&&!0!==e.transition||(e.transition=u),void 0===e.showLoader&&(e.showLoader=!0),void 0===e.caption&&(e.caption=this.config.caption),void 0===e.description&&(e.description=this.config.description),e.panoData||"function"!=typeof this.config.panoData||(e.panoData=this.config.panoData);var r=xt(e),s="zoom"in e;(r||s)&&this.__stopAll(),this.hideError(),this.config.panorama=t,this.config.caption=e.caption,this.config.description=e.description;var o=function(t){if(n.loader.hide(),n.prop.loadingPromise=null,_t(t))return!1;if(t)throw n.navbar.setCaption(""),n.showError(n.config.lang.loadError),console.error(t),t;return n.resetIdleTimer(),n.setOverlay(e.overlay,e.overlayOpacity),n.navbar.setCaption(n.config.caption),!0};this.navbar.setCaption("<em>"+(this.config.loadingTxt||"")+"</em>"),!e.showLoader&&this.prop.ready||this.loader.show();var a=this.adapter.loadTexture(this.config.panorama,e.panoData).then(function(t){if(t.panorama!==n.config.panorama)throw n.adapter.disposeTexture(t),vt();return t});return e.transition&&this.prop.ready&&this.adapter.supportsTransition(this.config.panorama)?this.prop.loadingPromise=a.then(function(t){return n.loader.hide(),n.prop.transitionAnimation=n.renderer.transition(t,e),n.prop.transitionAnimation}).then(function(t){if(n.prop.transitionAnimation=null,!t)throw vt()}).then(o,o):this.prop.loadingPromise=a.then(function(t){n.renderer.show(),n.renderer.setTexture(t),n.renderer.setPanoramaPose(t.panoData),n.renderer.setSphereCorrection(e.sphereCorrection),s&&n.zoom(e.zoom),r&&n.rotate(e)}).then(o,o),this.prop.loadingPromise},n.setOverlay=function(t,e){var i=this;
2return void 0===e&&(e=1),t?this.adapter.constructor.supportsOverlay?this.adapter.loadTexture(t,function(t){var e=i.prop.panoData,n=t.width/e.croppedWidth;return{fullWidth:n*e.fullWidth,fullHeight:n*e.fullHeight,croppedWidth:n*e.croppedWidth,croppedHeight:n*e.croppedHeight,croppedX:n*e.croppedX,croppedY:n*e.croppedY}},!1).then(function(t){i.renderer.setOverlay(t,e)}):Promise.reject(new c(this.adapter.constructor.id+" adapter does not supports overlay")):(this.adapter.constructor.supportsOverlay&&this.renderer.setOverlay(null,0),Promise.resolve())},n.setOptions=function(t){var e=this,i=s({},this.config,t);ut(t,function(t,n){if(be[n])yt(be[n]);else{if(!Object.prototype.hasOwnProperty.call(xe,n))throw new c("Unknown option "+n);if(Me[n])throw new c(Me[n]);switch(we[n]?e.config[n]=we[n](t,i):e.config[n]=t,n){case"overlay":case"overlayOpacity":e.setOverlay(e.config.overlay,e.config.overlayOpacity);break;case"caption":case"description":e.navbar.setCaption(e.config.caption);break;case"size":e.resize(t);break;case"sphereCorrection":e.renderer.setSphereCorrection(t);break;case"navbar":case"lang":e.navbar.setButtons(e.config.navbar);break;case"moveSpeed":case"zoomSpeed":e.__updateSpeeds();break;case"minFov":case"maxFov":e.dynamics.zoom.setValue(e.dataHelper.fovToZoomLevel(e.prop.vFov)),e.trigger(w.ZOOM_UPDATED,e.getZoomLevel());break;case"canvasBackground":e.renderer.canvasContainer.style.background=e.config.canvasBackground;break;case"autorotateIdle":e.resetIdleTimer()}}}),this.needsUpdate(),this.refreshUi("set options"),this.trigger(w.CONFIG_CHANGED,Object.keys(t))},n.setOption=function(t,e){var i;this.setOptions(((i={})[t]=e,i))},n.resetIdleTimer=function(){this.prop.idleTime=this.config.autorotateIdle?performance.now():-1},n.disableIdleTimer=function(){this.prop.idleTime=-1},n.startAutorotate=function(t){void 0===t&&(t=!1),t&&!this.isAutorotateEnabled()||!t&&this.isAutorotateEnabled()||(t||this.__stopAll(),this.dynamics.position.roll({longitude:this.config.autorotateSpeed<0},Math.abs(this.config.autorotateSpeed/this.config.moveSpeed)),this.dynamics.position.goto({latitude:this.config.autorotateLat},Math.abs(this.config.autorotateSpeed/this.config.moveSpeed)),null!==this.config.autorotateZoomLvl&&this.dynamics.zoom.goto(this.config.autorotateZoomLvl),this.prop.autorotateEnabled=!0,t||this.trigger(w.AUTOROTATE,!0))},n.stopAutorotate=function(){this.isAutorotateEnabled()&&(this.dynamics.position.stop(),this.dynamics.zoom.stop(),this.prop.autorotateEnabled=!1,this.trigger(w.AUTOROTATE,!1))},n.toggleAutorotate=function(){this.isAutorotateEnabled()?this.stopAutorotate():this.startAutorotate()},n.showError=function(t){this.overlay.show({id:T.ERROR,image:Ne,text:t,dissmisable:!1})},n.hideError=function(){this.overlay.hide(T.ERROR)},n.rotate=function(t){if(!this.trigger(w.BEFORE_ROTATE,t).isDefaultPrevented()){var e=this.change(S.GET_ROTATE_POSITION,this.dataHelper.cleanPosition(t));this.dynamics.position.setValue(e)}},n.animate=function(t){var e=this;this.__stopAll();var i,n=xt(t),r=void 0!==t.zoom,s={};if(n){var o=this.change(S.GET_ANIMATE_POSITION,this.dataHelper.cleanPosition(t)),a=this.getPosition(),l=it(a.longitude,o.longitude);s.longitude={start:a.longitude,end:a.longitude+l},s.latitude={start:a.latitude,end:o.latitude},i=this.dataHelper.speedToDuration(t.speed,nt(a,o))}if(r){var c=Math.abs(t.zoom-this.getZoomLevel());s.zoom={start:this.getZoomLevel(),end:t.zoom},i||(i=this.dataHelper.speedToDuration(t.speed,Math.PI/4*c/100))}return i?(this.prop.animationPromise=new Nt({properties:s,duration:Math.max(d,i),easing:"inOutSine",onTick:function(t){n&&e.rotate(t),r&&e.zoom(t.zoom)}}),this.prop.animationPromise.then(function(){e.prop.animationPromise=null,e.resetIdleTimer()}),this.prop.animationPromise):(n&&this.rotate(t),r&&this.zoom(t.zoom),new Nt)},n.stopAnimation=function(){return this.prop.animationPromise?(this.prop.animationPromise.cancel(),this.prop.animationPromise):Promise.resolve()},n.zoom=function(t){this.dynamics.zoom.setValue(t)},n.zoomIn=function(t){void 0===t&&(t=1),this.dynamics.zoom.step(t)},n.zoomOut=function(t){void 0===t&&(t=1),this.dynamics.zoom.step(-t)},n.resize=function(t){var e=this;["width","height"].forEach(function(i){t&&t[i]&&(/^[0-9.]+$/.test(t[i])&&(t[i]+="px"),e.parent.style[i]=t[i])}),this.autoSize()},n.enterFullscreen=function(){P.fullscreenEvent?Y(this.container):(this.container.classList.add("psv-container--fullscreen"),this.autoSize(),this.eventsHandler.__fullscreenToggled(!0))},n.exitFullscreen=function(){this.isFullscreenEnabled()&&(P.fullscreenEvent?q():(this.container.classList.remove("psv-container--fullscreen"),this.autoSize(),this.eventsHandler.__fullscreenToggled(!1)))},n.toggleFullscreen=function(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()}
2,n.startKeyboardControl=function(){this.eventsHandler.enableKeyboard()},n.stopKeyboardControl=function(){this.eventsHandler.disableKeyboard()},n.observeObjects=function(t,e){var i=this;return this.prop.objectsObservers[t]={listener:e},function(){delete i.prop.objectsObservers[t]}},n.__stopAll=function(){return this.trigger(w.STOP_ALL),this.disableIdleTimer(),this.stopAutorotate(),this.stopAnimation()},n.__updateSpeeds=function(){this.dynamics.zoom.setSpeed(50*this.config.zoomSpeed),this.dynamics.position.setSpeed(e.MathUtils.degToRad(50*this.config.moveSpeed))},i}(i.EventEmitter);t.AbstractAdapter=h,t.AbstractButton=Gt,t.AbstractComponent=Ht,t.AbstractPlugin=ye,t.CONSTANTS=C,t.DEFAULTS=xe,t.EquirectangularAdapter=kt,t.PSVError=c,t.SYSTEM=P,t.Viewer=Qe,t.registerButton=Re,t.utils=Bt,Object.defineProperty(t,"__esModule",{value:!0})}(e,i(2557),i(53))},150(t,e,i){!function(t,e,i){"use strict";function n(){return n=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},n.apply(this,arguments)}function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,s(t,e)}
2function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}function o(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var a={GYROSCOPE_UPDATED:"gyroscope-updated"},l=new e.Vector3(0,0,1),c=new e.Euler,h=new e.Quaternion,u=new e.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),d=function(t){!1===window.isSecureContext&&console.error("THREE.DeviceOrientationControls: DeviceOrientationEvent is only available in secure contexts (https)");var i=this,n=1e-6,r=new e.Quaternion;this.object=t,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var s=function(t){i.deviceOrientation=t},o=function(){i.screenOrientation=window.orientation||0},a=function(t,e,i,n,r){c.set(i,e,-n,"YXZ"),t.setFromEuler(c),t.multiply(u),t.multiply(h.setFromAxisAngle(l,-r))};this.connect=function(){o(),void 0!==window.DeviceOrientationEvent&&"function"==typeof window.DeviceOrientationEvent.requestPermission?window.DeviceOrientationEvent.requestPermission().then(function(t){"granted"==t&&(window.addEventListener("orientationchange",o),window.addEventListener("deviceorientation",s))}).catch(function(t){console.error("THREE.DeviceOrientationControls: Unable to use DeviceOrientation API:",t)}):(window.addEventListener("orientationchange",o),window.addEventListener("deviceorientation",s)),i.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",o),window.removeEventListener("deviceorientation",s),i.enabled=!1},this.update=function(){if(!1!==i.enabled){var t=i.deviceOrientation;if(t){var s=t.alpha?e.MathUtils.degToRad(t.alpha)+i.alphaOffset:0,o=t.beta?e.MathUtils.degToRad(t.beta):0,l=t.gamma?e.MathUtils.degToRad(t.gamma):0,c=i.screenOrientation?e.MathUtils.degToRad(i.screenOrientation):0;a(i.object.quaternion,s,o,l,c),8*(1-r.dot(i.object.quaternion))>n&&r.copy(i.object.quaternion)}}},this.dispose=function(){i.disconnect()},this.connect()},p='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M50 0a50 50 0 1 0 0 100A50 50 0 0 0 50 0zm0 88.81a38.86 38.86 0 0 1-38.81-38.8 38.86 38.86 0 0 1 38.8-38.82A38.86 38.86 0 0 1 88.82 50 38.87 38.87 0 0 1 50 88.81z"/><path fill="currentColor" d="M72.07 25.9L40.25 41.06 27.92 74.12l31.82-15.18v-.01l12.32-33.03zM57.84 54.4L44.9 42.58l21.1-10.06-8.17 21.9z"/>\x3c!--Created by iconoci from the Noun Project--\x3e</svg>\n',f=function(t){function e(e){var i;return(i=t.call(this,e,"psv-button--hover-scale psv-gyroscope-button",!0)||this).plugin=i.psv.getPlugin("gyroscope"),i.plugin&&i.plugin.on(a.GYROSCOPE_UPDATED,o(i)),i}r(e,t);var i=e.prototype;return i.destroy=function(){this.plugin&&this.plugin.off(a.GYROSCOPE_UPDATED,this),delete this.plugin,t.prototype.destroy.call(this)},i.isSupported=function(){return!!this.plugin&&{initial:!1,promise:this.plugin.prop.isSupported}},i.handleEvent=function(t){t.type===a.GYROSCOPE_UPDATED&&this.toggleActive(t.args[0])},i.onClick=function(){this.plugin.toggle()},e}(i.AbstractButton);f.id="gyroscope",f.icon=p,i.DEFAULTS.lang[f.id]="Gyroscope",i.registerButton(f,"caption:right");var m=new e.Vector3,g=function(t){function s(e,i){var r;return(r=t.call(this,e)||this).prop={isSupported:r.__checkSupport(),alphaOffset:0,enabled:!1,config_moveInertia:!0},r.config=n({touchmove:!0,absolutePosition:!1,moveMode:"smooth"},i),r.controls=null,r}r(s,t);var o=s.prototype;return o.init=function(){t.prototype.init.call(this),this.psv.on(i.CONSTANTS.EVENTS.STOP_ALL,this),this.psv.on(i.CONSTANTS.EVENTS.BEFORE_ROTATE,this),this.psv.on(i.CONSTANTS.EVENTS.BEFORE_RENDER,this)},o.destroy=function(){this.psv.off(i.CONSTANTS.EVENTS.STOP_ALL,this),this.psv.off(i.CONSTANTS.EVENTS.BEFORE_ROTATE,this),this.psv.off(i.CONSTANTS.EVENTS.BEFORE_RENDER,this),this.stop(),delete this.controls,t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case i.CONSTANTS.EVENTS.STOP_ALL:this.stop();break;case i.CONSTANTS.EVENTS.BEFORE_RENDER:this.__onBeforeRender();break;case i.CONSTANTS.EVENTS.BEFORE_ROTATE:this.__onBeforeRotate(t)}},o.isEnabled=function(){return this.prop.enabled},o.start=function(){var t=this;return this.prop.isSupported.then(function(e){return e?t.__requestPermission():(i.utils.logWarn("gyroscope not available"),Promise.reject())}).then(function(t){return t?Promise.resolve():(i.utils.logWarn("gyroscope not allowed"),Promise.reject())}).then(function(){t.psv.__stopAll(),t.prop.config_moveInertia=t.psv.config.moveInertia,t.psv.config.moveInertia=!1,t.controls?t.controls.connect():t.controls=new d(new e.Object3D),t.controls.deviceOrientation=null,t.controls.screenOrientation=0,t.controls.alphaOffset=0,t.prop.alph
2aOffset=t.config.absolutePosition?0:null,t.prop.enabled=!0,t.trigger(a.GYROSCOPE_UPDATED,!0)})},o.stop=function(){this.isEnabled()&&(this.controls.disconnect(),this.prop.enabled=!1,this.psv.config.moveInertia=this.prop.config_moveInertia,this.trigger(a.GYROSCOPE_UPDATED,!1),this.psv.resetIdleTimer())},o.toggle=function(){this.isEnabled()?this.stop():this.start()},o.__onBeforeRender=function(){if(this.isEnabled()&&this.controls.deviceOrientation){var t=this.psv.getPosition();if(null===this.prop.alphaOffset){this.controls.update(),this.controls.object.getWorldDirection(m);var e=this.psv.dataHelper.vector3ToSphericalCoords(m);this.prop.alphaOffset=e.longitude-t.longitude}else{this.controls.alphaOffset=this.prop.alphaOffset,this.controls.update(),this.controls.object.getWorldDirection(m);var n=this.psv.dataHelper.vector3ToSphericalCoords(m),r={longitude:n.longitude,latitude:-n.latitude},s="smooth"===this.config.moveMode?3:10;this.psv.dynamics.position.goto(r,i.utils.getAngle(t,r)<.01?1:s)}}},o.__onBeforeRotate=function(t){this.isEnabled()&&(t.preventDefault(),this.config.touchmove&&(this.prop.alphaOffset-=t.args[0].longitude-this.psv.getPosition().longitude))},o.__checkSupport=function(){return"DeviceMotionEvent"in window&&"function"==typeof DeviceMotionEvent.requestPermission?Promise.resolve(!0):"DeviceOrientationEvent"in window?new Promise(function(t){var e=function e(i){t(i&&null!==i.alpha&&!isNaN(i.alpha)),window.removeEventListener("deviceorientation",e)};window.addEventListener("deviceorientation",e,!1),setTimeout(e,1e4)}):Promise.resolve(!1)},o.__requestPermission=function(){return"DeviceMotionEvent"in window&&"function"==typeof DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(function(t){return"granted"===t}).catch(function(){return!1}):Promise.resolve(!0)},s}(i.AbstractPlugin);g.id="gyroscope",g.EVENTS=a,t.EVENTS=a,t.GyroscopePlugin=g,Object.defineProperty(t,"__esModule",{value:!0})}(e,i(2557),i(2367))},53(t,e){!function(t){"use strict";var e=function(){return!0},i=function(){return!1},n=function(){function t(t,e,n){Object.defineProperties(this,{target:{get:function(){return t},set:function(){},enumerable:!0},type:{get:function(){return e},set:function(){},enumerable:!0},args:{get:function(){return n},set:function(){},enumerable:!0}}),this.isDefaultPrevented=i,this.isPropagationStopped=i}var n=t.prototype;return n.preventDefault=function(){this.isDefaultPrevented=e},n.stopPropagation=function(){this.isPropagationStopped=e},t}(),r=function(){function t(){}var e=t.prototype;return e.on=function(t,e){var i=this;if(this.__events=this.__events||{},"object"==typeof t)for(var n in t)t.hasOwnProperty(n)&&(this.__events[n]=this.__events[n]||[],this.__events[n].push(t[n]));else t.split(" ").forEach(function(t){i.__events[t]=i.__events[t]||[],i.__events[t].push(e)});return this},e.off=function(t,e){var i=this;if("object"==typeof t){for(var n in t)if(t.hasOwnProperty(n)){if(this.__events&&n in this.__events){var r=this.__events[n].indexOf(t[n]);-1!==r&&this.__events[n].splice(r,1)}if(this.__once&&n in this.__once){var s=this.__once[n].indexOf(t[n]);-1!==s&&this.__once[n].splice(s,1)}}}else t?t.split(" ").forEach(function(t){if(i.__events&&t in i.__events)if(e){var n=i.__events[t].indexOf(e);-1!==n&&i.__events[t].splice(n,1)}else i.__events[t].length=0;if(i.__once&&t in i.__once)if(e){var r=i.__once[t].indexOf(e);-1!==r&&i.__once[t].splice(r,1)}else i.__once[t].length=0}):(this.__events={},this.__once={});return this},e.once=function(t,e){var i=this;if(this.__once=this.__once||{},"object"==typeof t)for(var n in t)t.hasOwnProperty(n)&&(this.__once[n]=this.__once[n]||[],this.__once[n].push(t[n]));else t.split(" ").forEach(function(t){i.__once[t]=i.__once[t]||[],i.__once[t].push(e)});return this},e.trigger=function(t){var e=Array.prototype.slice.call(arguments,1),i=new n(this,t,e);if(this.__events&&t in this.__events)for(var r=0,s=this.__events[t].length;r<s;r++){var o=this.__events[t][r];if("object"==typeof o?o.handleEvent(i):o.call.apply(o,[this,i].concat(e)),i.isPropagationStopped())break}if(this.__once&&t in this.__once){for(var a=0,l=this.__once[t].length;a<l;a++){var c=this.__once[t][a];if("object"==typeof c?c.handleEvent(i):c.call.apply(c,[this,i].concat(e)),i.isPropagationStopped())break}delete this.__once[t]}return i},e.change=function(t,e){var i=Array.prototype.slice.call(arguments,2),r=new n(this,t,i);if(r.value=e,this.__events&&t in this.__events)for(var s=0,o=this.__events[t].length;s<o;s++){var a=this.__events[t][s];if(r.value="object"==typeof a?a.handleEvent(r):a.call.apply(a,[this,r,r.value].concat(i)),r.isPropagationStopped())break}return r.value},t}(),s=r;function o(t){return t="function"==typeof t?t.prototype:t,["on","off","once","trigger","change"].forEach(function(e){t[e]=s.prototype[e]}),t}var a={EventEmitter:s,Event:n,mixin:o},l=a.EventEmitter,c=a.Event,h=a.mixin;t.Event=c,t.EventEmitter=l,t.default=a,t.mixin=h,Object.defineProperty(t,"__esMo
2dule",{value:!0})}(e)},2557(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i="147",n=100,r=101,s=102,o=200,a=201,l=202,c=203,h=204,u=205,d=206,p=207,f=208,m=209,g=210,v=300,_=301,y=302,x=303,M=304,b=306,w=1e3,S=1001,E=1002,T=1003,A=1004,R=1005,C=1006,L=1007,P=1008,I=1009,O=1012,D=1014,N=1015,U=1016,F=1020,z=1023,B=1026,k=1027,H=33776,G=33777,V=33778,W=33779,X=35840,j=35841,Y=35842,q=35843,Z=37492,J=37496,K=37808,Q=37809,$=37810,tt=37811,et=37812,it=37813,nt=37814,rt=37815,st=37816,ot=37817,at=37818,lt=37819,ct=37820,ht=37821,ut=36492,dt=2300,pt=2301,ft=2302,mt=2400,gt=2401,vt=2402,_t=2500,yt=2501,xt=3e3,Mt=3001,bt="srgb",wt="srgb-linear",St=7680,Et=35044,Tt="300 es",At=1035;class Rt{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const i=this._listeners[t];if(void 0!==i){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const i=e.slice(0);for(let e=0,n=i.length;e<n;e++)i[e].call(this,t);t.target=null}}}const Ct=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Lt=1234567;const Pt=Math.PI/180,It=180/Math.PI;function Ot(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(Ct[255&t]+Ct[t>>8&255]+Ct[t>>16&255]+Ct[t>>24&255]+"-"+Ct[255&e]+Ct[e>>8&255]+"-"+Ct[e>>16&15|64]+Ct[e>>24&255]+"-"+Ct[63&i|128]+Ct[i>>8&255]+"-"+Ct[i>>16&255]+Ct[i>>24&255]+Ct[255&n]+Ct[n>>8&255]+Ct[n>>16&255]+Ct[n>>24&255]).toLowerCase()}function Dt(t,e,i){return Math.max(e,Math.min(i,t))}function Nt(t,e){return(t%e+e)%e}function Ut(t,e,i){return(1-i)*t+i*e}function Ft(t){return!(t&t-1)&&0!==t}function zt(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Bt(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function kt(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Ht(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}var Gt=Object.freeze({__proto__:null,DEG2RAD:Pt,RAD2DEG:It,generateUUID:Ot,clamp:Dt,euclideanModulo:Nt,mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},inverseLerp:function(t,e,i){return t!==e?(i-t)/(e-t):0}
vendor: 4,450 bytes, line 2
2,lerp:Ut,damp:function(t,e,i,n){return Ut(t,e,1-Math.exp(-i*n))},pingpong:function(t,e=1){return e-Math.abs(Nt(t,2*e)-e)},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(Lt=t);let e=Lt+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*Pt},radToDeg:function(t){return t*It},isPowerOfTwo:Ft,ceilPowerOfTwo:zt,floorPowerOfTwo:Bt,setQuaternionFromProperEuler:function(t,e,i,n,r){const s=Math.cos,o=Math.sin,a=s(i/2),l=o(i/2),c=s((e+n)/2),h=o((e+n)/2),u=s((e-n)/2),d=o((e-n)/2),p=s((n-e)/2),f=o((n-e)/2);switch(r){case"XYX":t.set(a*h,l*u,l*d,a*c);break;case"YZY":t.set(l*d,a*h,l*u,a*c);break;case"ZXZ":t.set(l*u,l*d,a*h,a*c);break;case"XZX":t.set(a*h,l*f,l*p,a*c);break;case"YXY":t.set(l*p,a*h,l*f,a*c);break;case"ZYZ":t.set(l*f,l*p,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:Ht,denormalize:kt});class Vt{constructor(t=0,e=0){Vt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}
vendor: 3,618 bytes, line 2
2rotateAround(t,e){const i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*i-s*n+t.x,this.y=r*n+s*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Wt{constructor(){Wt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(t,e,i,n,r,s,o,a,l){const c=this.elements;return c[0]=t,c[1]=n,c[2]=o,c[3]=e,c[4]=r,c[5]=a,c[6]=i,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],h=i[7],u=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],v=n[1],_=n[4],y=n[7],x=n[2],M=n[5],b=n[8];return r[0]=s*f+o*v+a*x,r[3]=s*m+o*_+a*M,r[6]=s*g+o*y+a*b,r[1]=l*f+c*v+h*x,r[4]=l*m+c*_+h*M,r[7]=l*g+c*y+h*b,r[2]=u*f+d*v+p*x,r[5]=u*m+d*_+p*M,r[8]=u*g+d*y+p*b,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8];return e*s*c-e*o*l-i*r*c+i*o*a+n*r*l-n*s*a}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8],h=c*s-o*l,u=o*a-c*r,d=l*r-s*a,p=e*h+i*u+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=h*f,t[1]=(n*l-c*i)*f,t[2]=(o*i-n*s)*f,t[3]=u*f,t[4]=(c*e-n*a)*f,t[5]=(n*r-o*e)*f,t[6]=d*f,t[7]=(i*a-l*e)*f,t[8]=(s*e-i*r)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,n,r,s,o){const a=Math.cos(r),l=Math.sin(r);return this.set(i*a,i*l,-i*(a*s+l*o)+s+t,-n*l,n*a,-n*(-l*s+a*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Xt.makeScale(t,e)),this}rotate(t){return this.premultiply(Xt.makeRotation(-t)),this}translate(t,e){return this.premultiply(Xt.makeTranslation(t,e)),this}makeTranslation(t,e){return this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const Xt=new Wt;function jt(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const Yt={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function qt(t,e){return new Yt[t](e)}function Zt(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Jt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}
vendor: 22,082 bytes, line 2
2function Kt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Qt={[bt]:{[wt]:Jt},[wt]:{[bt]:Kt}},$t={legacyMode:!0,get workingColorSpace(){return wt},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,i){if(this.legacyMode||e===i||!e||!i)return t;if(Qt[e]&&void 0!==Qt[e][i]){const n=Qt[e][i];return t.r=n(t.r),t.g=n(t.g),t.b=n(t.b),t}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}},te={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ee={r:0,g:0,b:0},ie={h:0,s:0,l:0},ne={h:0,s:0,l:0};function re(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}function se(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class oe{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=bt){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,$t.toWorkingColorSpace(this,e),this}setRGB(t,e,i,n=$t.workingColorSpace){return this.r=t,this.g=e,this.b=i,$t.toWorkingColorSpace(this,n),this}setHSL(t,e,i,n=$t.workingColorSpace){if(t=Nt(t,1),e=Dt(e,0,1),i=Dt(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,r=2*i-n;this.r=re(r,n,t+1/3),this.g=re(r,n,t),this.b=re(r,n,t-1/3)}return $t.toWorkingColorSpace(this,n),this}setStyle(t,e=bt){function i(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const r=n[1],s=n[2];switch(r){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,$t.toWorkingColorSpace(this,e),i(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,$t.toWorkingColorSpace(this,e),i(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const n=parseFloat(t[1])/360,r=parseFloat(t[2])/100,s=parseFloat(t[3])/100;return i(t[4]),this.setHSL(n,r,s,e)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=n[1],i=t.length;if(3===i)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,$t.toWorkingColorSpace(this,e),this;if(6===i)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,$t.toWorkingColorSpace(this,e),this}return t&&t.length>0?this.setColorName(t,e):this}setColorName(t,e=bt){const i=te[t.toLowerCase()];return void 0!==i?this.setHex(i,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Jt(t.r),this.g=Jt(t.g),this.b=Jt(t.b),this}copyLinearToSRGB(t){return this.r=Kt(t.r),this.g=Kt(t.g),this.b=Kt(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=bt){return $t.fromWorkingColorSpace(se(this,ee),t),Dt(255*ee.r,0,255)<<16^Dt(255*ee.g,0,255)<<8^Dt(255*ee.b,0,255)}getHexString(t=bt){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=$t.workingColorSpace){$t.fromWorkingColorSpace(se(this,ee),e);const i=ee.r,n=ee.g,r=ee.b,s=Math.max(i,n,r),o=Math.min(i,n,r);let a,l;const c=(o+s)/2;if(o===s)a=0,l=0;else{const t=s-o;switch(l=c<=.5?t/(s+o):t/(2-s-o),s){case i:a=(n-r)/t+(n<r?6:0);break;case n:a=(r-i)/t+2;break;case r:a=(i-n)/t+4}a/=6}return t.h=a,t.s=l,t.l=c,t}getRGB(t,e=$t.workingColorSpace){return $t.fromWorkingColorSpace(se(this,ee),e),t.r=ee.r,t.g=ee.g,t.b=ee.b,t}getStyle(t=bt){return $t.fromWorkingColorSpace(se(this,ee),t),t!==bt?`color(${t} ${ee.r} ${ee.g} ${ee.b})`:`rgb(${255*ee.r|0},${255*ee.g|0},${255*ee.b|0})`}offsetHSL(t,e,i){return this.getHSL(ie),ie.h+=t,ie.s+=e,ie.l+=i,this.setHSL(ie.h,ie.s,ie.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(ie),t.getHSL(ne);const i=Ut(ie.h,ne.h,e),n=Ut(ie.s,ne.s,e),r=Ut(ie.l,ne.l,e);return this.setHSL(i,n,r),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let ae;oe.NAMES=te;class le{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===ae&&(ae=Zt("canvas")),ae.width=t.width,ae.height=t.height;const i=ae.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=ae}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=Zt("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const n=i.getImageData(0,0,t.width,t.height),r=n.data;for(let t=0;t<r.length;t++)r[t]=255*Jt(r[t]/255);return i.putImageData(n,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*Jt(e[t]/255)):e[t]=Jt(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}class ce{constructor(t=null){this.isSource=!0,this.uuid=Ot(),this.data=t,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const i={uuid:this.uuid,url:""},n=this.data;if(null!==n){let t;if(Array.isArray(n)){t=[];for(let e=0,i=n.length;e<i;e++)n[e].isDataTexture?t.push(he(n[e].image)):t.push(he(n[e]))}else t=he(n);i.url=t}return e||(t.images[this.uuid]=i),i}}function he(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?le.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let ue=0;class de extends Rt{constructor(t=de.DEFAULT_IMAGE,e=de.DEFAULT_MAPPING,i=1001,n=1001,r=1006,s=1008,o=1023,a=1009,l=de.DEFAULT_ANISOTROPY,c=3e3){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ue++}),this.uuid=Ot(),this.name="",this.source=new ce(t),this.mipmaps=[],this.mapping=e,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=s,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=a,this.offset=new Vt(0,0),this.repeat=new Vt(1,1),this.center=new Vt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Wt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==v)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case w:t.x=t.x-Math.floor(t.x);break;case S:t.x=t.x<0?0:1;break;case E:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case w:t.y=t.y-Math.floor(t.y);break;case S:t.y=t.y<0?0:1;break;case E:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}}de.DEFAULT_IMAGE=null,de.DEFAULT_MAPPING=v,de.DEFAULT_ANISOTROPY=1;class pe{constructor(t=0,e=0,i=0,n=1){pe.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,n,r;const s=.01,o=.1,a=t.elements,l=a[0],c=a[4],h=a[8],u=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-u)<s&&Math.abs(h-f)<s&&Math.abs(p-m)<s){if(Math.abs(c+u)<o&&Math.abs(h+f)<o&&Math.abs(p+m)<o&&Math.abs(l+d+g-3)<o)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,a=(d+1)/2,v=(g+1)/2,_=(c+u)/4,y=(h+f)/4,x=(p+m)/4;return t>a&&t>v?t<s?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(t),n=_/i,r=y/i):a>v?a<s?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(a),i=_/n,r=x/n):v<s?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(v),i=y/r,n=x/r),this.set(i,n,r,e),this}let v=Math.sqrt((m-p)*(m-p)+(h-f)*(h-f)+(u-c)*(u-c));return Math.abs(v)<.001&&(v=1),this.x=(m-p)/v,this.y=(h-f)/v,this.z=(u-c)/v,this.w=Math.acos((l+d+g-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=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.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class fe extends Rt{constructor(t=1,e=1,i={}){super(),this.isWebGLRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new pe(0,0,t,e),this.scissorTest=!1,this.viewport=new pe(0,0,t,e);const n={width:t,height:e,depth:1};this.texture=new de(n,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.internalFormat=void 0!==i.internalFormat?i.internalFormat:null,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:C,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null,this.samples=void 0!==i.samples?i.samples:0}setSize(t,e,i=1){this.width===t&&this.height===e&&this.depth===i||(this.width=t,this.height=e,this.depth=i,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new ce(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class me extends de{constructor(t=null,e=1,i=1,n=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:i,depth:n},this.magFilter=T,this.minFilter=T,this.wrapR=S,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ge extends de{constructor(t=null,e=1,i=1,n=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:i,depth:n},this.magFilter=T,this.minFilter=T,this.wrapR=S,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ve{constructor(t=0,e=0,i=0,n=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=n}static slerpFlat(t,e,i,n,r,s,o){let a=i[n+0],l=i[n+1],c=i[n+2],h=i[n+3];const u=r[s+0],d=r[s+1],p=r[s+2],f=r[s+3];if(0===o)return t[e+0]=a,t[e+1]=l,t[e+2]=c,void(t[e+3]=h);if(1===o)return t[e+0]=u,t[e+1]=d,t[e+2]=p,void(t[e+3]=f);if(h!==f||a!==u||l!==d||c!==p){let t=1-o;const e=a*u+l*d+c*p+h*f,i=e>=0?1:-1,n=1-e*e;if(n>Number.EPSILON){const r=Math.sqrt(n),s=Math.atan2(r,e*i);t=Math.sin(t*s)/r,o=Math.sin(o*s)/r}const r=o*i;if(a=a*t+u*r,l=l*t+d*r,c=c*t+p*r,h=h*t+f*r,t===1-o){const t=1/Math.sqrt(a*a+l*l+c*c+h*h);a*=t,l*=t,c*=t,h*=t}}t[e]=a,t[e+1]=l,t[e+2]=c,t[e+3]=h}static multiplyQuaternionsFlat(t,e,i,n,r,s){const o=i[n],a=i[n+1],l=i[n+2],c=i[n+3],h=r[s],u=r[s+1],d=r[s+2],p=r[s+3];
vendor: 4,386 bytes, line 2
2return t[e]=o*p+c*h+a*d-l*u,t[e+1]=a*p+c*u+l*h-o*d,t[e+2]=l*p+c*d+o*u-a*h,t[e+3]=c*p-o*h-a*u-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const i=t._x,n=t._y,r=t._z,s=t._order,o=Math.cos,a=Math.sin,l=o(i/2),c=o(n/2),h=o(r/2),u=a(i/2),d=a(n/2),p=a(r/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],n=e[4],r=e[8],s=e[1],o=e[5],a=e[9],l=e[2],c=e[6],h=e[10],u=i+o+h;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(c-a)*t,this._y=(r-l)*t,this._z=(s-n)*t}else if(i>o&&i>h){const t=2*Math.sqrt(1+i-o-h);this._w=(c-a)/t,this._x=.25*t,this._y=(n+s)/t,this._z=(r+l)/t}else if(o>h){const t=2*Math.sqrt(1+o-i-h);this._w=(r-l)/t,this._x=(n+s)/t,this._y=.25*t,this._z=(a+c)/t}else{const t=2*Math.sqrt(1+h-i-o);this._w=(s-n)/t,this._x=(r+l)/t,this._y=(a+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Dt(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(0===i)return this;const n=Math.min(1,e/i);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,n=t._y,r=t._z,s=t._w,o=e._x,a=e._y,l=e._z,c=e._w;return this._x=i*c+s*o+n*l-r*a,this._y=n*c+s*a+r*o-i*l,this._z=r*c+s*l+i*a-n*o,this._w=s*c-i*o-n*a-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this._x,n=this._y,r=this._z,s=this._w;let o=s*t._w+i*t._x+n*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=s,this._x=i,this._y=n,this._z=r,this;const a=1-o*o;if(a<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*i+e*this._x,this._y=t*n+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,o),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=s*h+this._w*u,this._x=i*h+this._x*u,this._y=n*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=Math.random(),e=Math.sqrt(1-t),i=Math.sqrt(t),n=2*Math.PI*Math.random(),r
vendor: 13,609 bytes, line 2
2=2*Math.PI*Math.random();return this.set(e*Math.cos(n),i*Math.sin(r),i*Math.cos(r),e*Math.sin(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class _e{constructor(t=0,e=0,i=0){_e.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(xe.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(xe.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=t.elements,s=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this}applyQuaternion(t){const e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z,a=t.w,l=a*e+s*n-o*i,c=a*i+o*e-r*n,h=a*n+r*i-s*e,u=-r*e-s*i-o*n;return this.x=l*a+u*-r+c*-o-h*-s,this.y=c*a+u*-s+h*-r-l*-o,this.z=h*a+u*-o+l*-s-c*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,n=t.y,r=t.z,s=e.x,o=e.y,a=e.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-n*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return ye.copy(this).projectOnVector(t),this.sub(ye)}reflect(t){return this.sub(ye.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Dt(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,i=Math.sqrt(1-t**2);return this.x=i*Math.cos(e),this.y=i*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const ye=new _e,xe=new ve;class Me{constructor(t=new _e(1/0,1/0,1/0),e=new _e(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,l=t.length;a<l;a+=3){const l=t[a],c=t[a+1],h=t[a+2];l<e&&(e=l),c<i&&(i=c),h<n&&(n=h),l>r&&(r=l),c>s&&(s=c),h>o&&(o=h)}return this.min.set(e,i,n),this.max.set(r,s,o),this}setFromBufferAttribute(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,l=t.count;a<l;a++){const l=t.getX(a),c=t.getY(a),h=t.getZ(a);l<e&&(e=l),c<i&&(i=c),h<n&&(n=h),l>r&&(r=l),c>s&&(s=c),h>o&&(o=h)}return this.min.set(e,i,n),this.max.set(r,s,o),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=we.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const i=t.geometry;if(void 0!==i)if(e&&null!=i.attributes&&void 0!==i.attributes.position){const e=i.attributes.position;for(let i=0,n=e.count;i<n;i++)we.fromBufferAttribute(e,i).applyMatrix4(t.matrixWorld),this.expandByPoint(we)}else null===i.boundingBox&&i.computeBoundingBox(),Se.copy(i.boundingBox),Se.applyMatrix4(t.matrixWorld),this.union(Se);const n=t.children;for(let t=0,i=n.length;t<i;t++)this.expandByObject(n[t],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,we),we.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Pe),Ie.subVectors(this.max,Pe),Ee.subVectors(t.a,Pe),Te.subVectors(t.b,Pe),Ae.subVectors(t.c,Pe),Re.subVectors(Te,Ee),Ce.subVectors(Ae,Te),Le.subVectors(Ee,Ae);let e=[0,-Re.z,Re.y,0,-Ce.z,Ce.y,0,-Le.z,Le.y,Re.z,0,-Re.x,Ce.z,0,-Ce.x,Le.z,0,-Le.x,-Re.y,Re.x,0,-Ce.y,Ce.x,0,-Le.y,Le.x,0];return!!Ne(e,Ee,Te,Ae,Ie)&&(e=[1,0,0,0,1,0,0,0,1],!!Ne(e,Ee,Te,Ae,Ie)&&(Oe.crossVectors(Re,Ce),e=[Oe.x,Oe.y,Oe.z],Ne(e,Ee,Te,Ae,Ie)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return we.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(we).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(be[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),be[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),be[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),be[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),be[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),be[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),be[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),be[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(be)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const be=[new _e,new _e,new _e,new _e,new _e,new _e,new _e,new _e],we=new _e,Se=new Me,Ee=new _e,Te=new _e,Ae=new _e,Re=new _e,Ce=new _e,Le=new _e,Pe=new _e,Ie=new _e,Oe=new _e,De=new _e;function Ne(t,e,i,n,r){for(let s=0,o=t.length-3;s<=o;s+=3){De.fromArray(t,s);const o=r.x*Math.abs(De.x)+r.y*Math.abs(De.y)+r.z*Math.abs(De.z),a=e.dot(De),l=i.dot(De),c=n.dot(De);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>o)return!1}return!0}const Ue=new Me,Fe=new _e,ze=new _e;class Be{constructor(t=new _e,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;void 0!==e?i.copy(e):Ue.setFromPoints(t).getCenter(i);let n=0;for(let e=0,r=t.length;e<r;e++)n=Math.max(n,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(n),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}
vendor: 5,908 bytes, line 2
2applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Fe.subVectors(t,this.center);const e=Fe.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),i=.5*(t-this.radius);this.center.addScaledVector(Fe,i/t),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(ze.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Fe.copy(t.center).add(ze)),this.expandByPoint(Fe.copy(t.center).sub(ze))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const ke=new _e,He=new _e,Ge=new _e,Ve=new _e,We=new _e,Xe=new _e,je=new _e;class Ye{constructor(t=new _e,e=new _e(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,ke)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=ke.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ke.copy(this.direction).multiplyScalar(e).add(this.origin),ke.distanceToSquared(t))}distanceSqToSegment(t,e,i,n){He.copy(t).add(e).multiplyScalar(.5),Ge.copy(e).sub(t).normalize(),Ve.copy(this.origin).sub(He);const r=.5*t.distanceTo(e),s=-this.direction.dot(Ge),o=Ve.dot(this.direction),a=-Ve.dot(Ge),l=Ve.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*a-o,u=s*o-a,p=r*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+s*u+2*o)+u*(s*h+u+2*a)+l}else u=r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u=-r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u<=-p?(h=Math.max(0,-(-s*r+o)),u=h>0?-r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l):u<=p?(h=0,u=Math.min(Math.max(-r,-a),r),d=u*(u+2*a)+l):(h=Math.max(0,-(s*r+o)),u=h>0?r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l);else u=s>0?-r:r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;return i&&i.copy(this.direction).multiplyScalar(h).add(this.origin),n&&n.copy(Ge).multiplyScalar(u).add(He),d}intersectSphere(t,e){ke.subVectors(t.center,this.origin);const i=ke.dot(this.direction),n=ke.dot(ke)-i*i,r=t.radius*t.radius;if(n>r)return null;const s=Math.sqrt(r-n),o=i-s,a=i+s;return o<0&&a<0?null:o<0?this.at(a,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,n,r,s,o,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(i=(t.min.x-u.x)*l,n=(t.max.x-u.x)*l):(i=(t.max.x-u.x)*l,n=(t.min.x-u.x)*l),c>=0?(r=(t.min.y-u.y)*c,s=(t.max.y-u.y)*c):(r=(t.max.y-u.y)*c,s=(t.min.y-u.y)*c),i>s||r>n?null:((r>i||isNaN(i))&&(i=r),(s<n||isNaN(n))&&(n=s),h>=0?(o=(t.min.z-u.z)*h,a=(t.max.z-u.z)*h):(o=(t.max.z-u.z)*h,a=(t.min.z-u.z)*h),i>a||o>n?null:((o>i||i!=i)&&(i=o),(a<n||n!=n)&&(n=a),n<0?null:this.at(i>=0?i:n,e)))}intersectsBox(t){return null!==this.intersectBox(t,ke)}intersectTriangle(t,e,i,n,r){We.subVectors(e,t),Xe.subVectors(i,t),je.crossVectors(We,Xe);let s,o=this.direction.dot(je);if(o>0){if(n)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}Ve.subVectors(this.origin,t);const a=s*this.direction.dot(Xe.crossVectors(Ve,Xe));if(a<0)return null;const l=s*this.direction.dot(We.cross(Ve));if(l<0)return null;if(a+l>o)return null;const c=-s*Ve.dot(je);return c<0?null:this.at(c/o,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class qe{constructor(){qe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,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 qe).fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,n=1/Ze.setFromMatrixColumn(t,0).length(),r=1/Ze.setFromMatrixColumn(t,1).length(),s=1/Ze.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*s,e[9]=i[9]*s,e[10
vendor: 4,449 bytes, line 2
2]=i[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,n=t.y,r=t.z,s=Math.cos(i),o=Math.sin(i),a=Math.cos(n),l=Math.sin(n),c=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=s*c,i=s*h,n=o*c,r=o*h;e[0]=a*c,e[4]=-a*h,e[8]=l,e[1]=i+n*l,e[5]=t-r*l,e[9]=-o*a,e[2]=r-t*l,e[6]=n+i*l,e[10]=s*a}else if("YXZ"===t.order){const t=a*c,i=a*h,n=l*c,r=l*h;e[0]=t+r*o,e[4]=n*o-i,e[8]=s*l,e[1]=s*h,e[5]=s*c,e[9]=-o,e[2]=i*o-n,e[6]=r+t*o,e[10]=s*a}else if("ZXY"===t.order){const t=a*c,i=a*h,n=l*c,r=l*h;e[0]=t-r*o,e[4]=-s*h,e[8]=n+i*o,e[1]=i+n*o,e[5]=s*c,e[9]=r-t*o,e[2]=-s*l,e[6]=o,e[10]=s*a}else if("ZYX"===t.order){const t=s*c,i=s*h,n=o*c,r=o*h;e[0]=a*c,e[4]=n*l-i,e[8]=t*l+r,e[1]=a*h,e[5]=r*l+t,e[9]=i*l-n,e[2]=-l,e[6]=o*a,e[10]=s*a}else if("YZX"===t.order){const t=s*a,i=s*l,n=o*a,r=o*l;e[0]=a*c,e[4]=r-t*h,e[8]=n*h+i,e[1]=h,e[5]=s*c,e[9]=-o*c,e[2]=-l*c,e[6]=i*h+n,e[10]=t-r*h}else if("XZY"===t.order){const t=s*a,i=s*l,n=o*a,r=o*l;e[0]=a*c,e[4]=-h,e[8]=l*c,e[1]=t*h+r,e[5]=s*c,e[9]=i*h-n,e[2]=n*h-i,e[6]=o*c,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Ke,t,Qe)}lookAt(t,e,i){const n=this.elements;return ei.subVectors(t,e),0===ei.lengthSq()&&(ei.z=1),ei.normalize(),$e.crossVectors(i,ei),0===$e.lengthSq()&&(1===Math.abs(i.z)?ei.x+=1e-4:ei.z+=1e-4,ei.normalize(),$e.crossVectors(i,ei)),$e.normalize(),ti.crossVectors(ei,$e),n[0]=$e.x,n[4]=ti.x,n[8]=ei.x,n[1]=$e.y,n[5]=ti.y,n[9]=ei.y,n[2]=$e.z,n[6]=ti.z,n[10]=ei.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,s=i[0],o=i[4],a=i[8],l=i[12],c=i[1],h=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],_=i[7],y=i[11],x=i[15],M=n[0],b=n[4],w=n[8],S=n[12],E=n[1],T=n[5],A=n[9],R=n[13],C=n[2],L=n[6],P=n[10],I=n[14],O=n[3],D=n[7],N=n[11],U=n[15];return r[0]=s*M+o*E+a*C+l*O,r[4]=s*b+o*T+a*L+l*D,r[8]=s*w+o*A+a*P+l*N,r[12]=s*S+o*R+a*I+l*U,r[1]=c*M+h*E+u*C+d*O,r[5]=c*b+h*T+u*L+d*D,r[9]=c*w+h*A+u*P+d*N,r[13]=c*S+h*R+u*I+d*U,r[2]=p*M+f*E+m*C+g*O,r[6]=p*b+f*T+m*L+g*D,r[10]=p*w+f*A+m*P+g*N,r[14]=p*S+f*R+m*I+g*U,r[3]=v*M+_*E+y*C+x*O,r[7]=v*b+_*T+y*L+x*D,r[11]=v*w+_*A+y*P+x*N,r[15]=v*S+_*R+y*I+x*U,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],s=t[1],o=t[5],a=t[9],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(+r*a*h-n*l*h-r*o*u+i*l*u+n*o*d-i*a*d)+t[7]*(+e*a*d-e*l*u+r*s*u-n*s*d+n*l*c-r*a*c)+t[11]*(+e*l*h-e*o*d-r*s*h+i*s*d+r*o*c-i*l*c)+t[15]*(-n*o*c-e*a*h+e*o*u+n*s*h-i*s*u+i*a*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8],h=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],v=h*m*l-f*u*l+f*a*d-o*m*d-h*a*g+o*u*g,_=p*u*l-c*m*l-p*a*d+s*m*d+c*a*g-s*u*g,y=c*f*l-p*h*l+p*o*d-s*f*d-c*o*g+s*h*g,x=p*h*a-c*f*a-p*o*u+s*f*u+c*o*m-s*h*m,M=e*v+i*_+n*y+r*x;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/M;return t[0]=v*b,t[1]=(f*u*r-h*m*r-f*n*d+i*m*d+h*n*g-i*u*g)*b,t[2]=(o*m*r-f*a*r+f*n*l-i*m*l-o*n*g+i*a*g)*b,t[3]=(h*a*r-o*u*r-h*n*l+i*u*l+o*n*d-i*a*d)*b,t[4]=_*b,t[5]=(c*m*r-p*u*r+p*n*d-e*m*d-c*n*g+e*u*g)*b,t[6]=(p*a*r-s*m*r-p*n*l+e*m*l+s*n*g-e*a*g)*b,t[7]=(s*u*r-c*a*r+c*n*l-e*u*l-s*n*d+e*a*d)*b,t[8]=y*b,t[9]=(p*h*r-c*f*r-p*i*d+e*f*d+c*i*g-e*h*g)*b,t[10]=(s*f*r-p*o*r+p*i*l-e*f*l-s*i*g+e*o*g)*b,t[11]=(c*o*r-s*h*r-c*i*l+e*h*l+s*i*d-e*o*d)*b,t[12]=x*b,t[13]=(c*f*n-p*h*n+p*i*u-e*f*u-c*i*m+e*h*m)*b,t[14]=(p*o*n-s*f*n-p*i*a+e*f*a+s*i*m-e*o*m)*b,t[15]=(s*h*n-c*o*n+c*i*a-e*h*a-s*i*u+e*o*u)*b,this}scale(t){const e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}
vendor: 5,202 bytes, line 2
2makeTranslation(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,o=t.y,a=t.z,l=r*s,c=r*o;return this.set(l*s+i,l*o-n*a,l*a+n*o,0,l*o+n*a,c*o+i,c*a-n*s,0,l*a-n*o,c*a+n*s,r*a*a+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,n,r,s){return this.set(1,i,r,0,t,1,s,0,e,n,1,0,0,0,0,1),this}compose(t,e,i){const n=this.elements,r=e._x,s=e._y,o=e._z,a=e._w,l=r+r,c=s+s,h=o+o,u=r*l,d=r*c,p=r*h,f=s*c,m=s*h,g=o*h,v=a*l,_=a*c,y=a*h,x=i.x,M=i.y,b=i.z;return n[0]=(1-(f+g))*x,n[1]=(d+y)*x,n[2]=(p-_)*x,n[3]=0,n[4]=(d-y)*M,n[5]=(1-(u+g))*M,n[6]=(m+v)*M,n[7]=0,n[8]=(p+_)*b,n[9]=(m-v)*b,n[10]=(1-(u+f))*b,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,i){const n=this.elements;let r=Ze.set(n[0],n[1],n[2]).length();const s=Ze.set(n[4],n[5],n[6]).length(),o=Ze.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],Je.copy(this);const a=1/r,l=1/s,c=1/o;return Je.elements[0]*=a,Je.elements[1]*=a,Je.elements[2]*=a,Je.elements[4]*=l,Je.elements[5]*=l,Je.elements[6]*=l,Je.elements[8]*=c,Je.elements[9]*=c,Je.elements[10]*=c,e.setFromRotationMatrix(Je),i.x=r,i.y=s,i.z=o,this}makePerspective(t,e,i,n,r,s){const o=this.elements,a=2*r/(e-t),l=2*r/(i-n),c=(e+t)/(e-t),h=(i+n)/(i-n),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return o[0]=a,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=l,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,i,n,r,s){const o=this.elements,a=1/(e-t),l=1/(i-n),c=1/(s-r),h=(e+t)*a,u=(i+n)*l,d=(s+r)*c;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}const Ze=new _e,Je=new qe,Ke=new _e(0,0,0),Qe=new _e(1,1,1),$e=new _e,ti=new _e,ei=new _e,ii=new qe,ni=new ve;class ri{constructor(t=0,e=0,i=0,n=ri.DefaultOrder){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,n=this._order){return this._x=t,this._y=e,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const n=t.elements,r=n[0],s=n[4],o=n[8],a=n[1],l=n[5],c=n[9],h=n[2],u=n[6],d=n[10];switch(e){case"XYZ":this._y=Math.asin(Dt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Dt(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(Dt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(a,r));break;case"ZYX":this._y=Math.asin(-Dt(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(a,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(Dt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-Dt(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return ii.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ii,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return ni.setFromEuler(this),this.setFromQuaternion(ni,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}
2toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}ri.DefaultOrder="XYZ",ri.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class si{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return 0!==(this.mask&t.mask)}isEnabled(t){return!!(this.mask&1<<t)}}let oi=0;const ai=new _e,li=new ve,ci=new qe,hi=new _e,ui=new _e,di=new _e,pi=new ve,fi=new _e(1,0,0),mi=new _e(0,1,0),gi=new _e(0,0,1),vi={type:"added"},_i={type:"removed"};class yi extends Rt{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:oi++}),this.uuid=Ot(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=yi.DefaultUp.clone();const t=new _e,e=new ri,i=new ve,n=new _e(1,1,1);e._onChange(function(){i.setFromEuler(e,!1)}),i._onChange(function(){e.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new qe},normalMatrix:{value:new Wt}}),this.matrix=new qe,this.matrixWorld=new qe,this.matrixAutoUpdate=yi.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=yi.DefaultMatrixWorldAutoUpdate,this.layers=new si,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return li.setFromAxisAngle(t,e),this.quaternion.multiply(li),this}rotateOnWorldAxis(t,e){return li.setFromAxisAngle(t,e),this.quaternion.premultiply(li),this}rotateX(t){return this.rotateOnAxis(fi,t)}rotateY(t){return this.rotateOnAxis(mi,t)}rotateZ(t){return this.rotateOnAxis(gi,t)}translateOnAxis(t,e){return ai.copy(t).applyQuaternion(this.quaternion),this.position.add(ai.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(fi,t)}translateY(t){return this.translateOnAxis(mi,t)}translateZ(t){return this.translateOnAxis(gi,t)}localToWorld(t){return t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return t.applyMatrix4(ci.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?hi.copy(t):hi.set(t,e,i);const n=this.parent;this.updateWorldMatrix(!0,!1),ui.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ci.lookAt(ui,hi,this.up):ci.lookAt(hi,ui,this.up),this.quaternion.setFromRotationMatrix(ci),n&&(ci.extractRotation(n.matrixWorld),li.setFromRotationMatrix(ci),this.quaternion.premultiply(li.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(vi)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(_i)),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(_i)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),ci.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),ci.multiply(t.parent.matrixWorld)),t.applyM
vendor: 23,985 bytes, line 2
2atrix4(ci),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,n=this.children.length;i<n;i++){const n=this.children[i].getObjectByProperty(t,e);if(void 0!==n)return n}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ui,t,di),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ui,pi,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let i=0,n=e.length;i<n;i++){const n=e[i];!0!==n.matrixWorldAutoUpdate&&!0!==t||n.updateMatrixWorld(t)}}updateWorldMatrix(t,e){const i=this.parent;if(!0===t&&null!==i&&!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,i=t.length;e<i;e++){const i=t[e];!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const n={};function r(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const i=e.shapes;if(Array.isArray(i))for(let e=0,n=i.length;e<n;e++){const n=i[e];r(t.shapes,n)}else r(t.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let i=0,n=this.material.length;i<n;i++)e.push(r(t.materials,this.material[i]));n.material=e}else n.material=r(t.materials,this.material);if(this.children.length>0){n.children=[];for(let e=0;e<this.children.length;e++)n.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){n.animations=[];for(let e=0;e<this.animations.length;e++){const i=this.animations[e];n.animations.push(r(t.animations,i))}}if(e){const e=s(t.geometries),n=s(t.materials),r=s(t.textures),o=s(t.images),a=s(t.shapes),l=s(t.skeletons),c=s(t.animations),h=s(t.nodes);e.length>0&&(i.geometries=e),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),o.length>0&&(i.images=o),a.length>0&&(i.shapes=a),l.length>0&&(i.skeletons=l),c.length>0&&(i.animations=c),h.length>0&&(i.nodes=h)}return i.object=n,i;function s(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const i=t.children[e];this.add(i.clone())}return this}}yi.DefaultUp=new _e(0,1,0),yi.DefaultMatrixAutoUpdate=!0,yi.DefaultMatrixWorldAutoUpdate=!0;const xi=new _e,Mi=new _e,bi=new _e,wi=new _e,Si=new _e,Ei=new _e,Ti=new _e,Ai=new _e,Ri=new _e,Ci=new _e;class Li{constructor(t=new _e,e=new _e,i=new _e){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,n){n.subVectors(i,e),xi.subVectors(t,e),n.cross(xi);const r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(t,e,i,n,r){xi.subVectors(n,e),Mi.subVectors(i,e),bi.subVectors(t,e);const s=xi.dot(xi),o=xi.dot(Mi),a=xi.dot(bi),l=Mi.dot(Mi),c=Mi.dot(bi),h=s*l-o*o;if(0===h)return r.set(-2,-1,-1);const u=1/h,d=(l*a-o*c)*u,p=(s*c-o*a)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,i,n){return this.getBarycoord(t,e,i,n,wi),wi.x>=0&&wi.y>=0&&wi.x+wi.y<=1}static getUV(t,e,i,n,r,s,o,a){return this.getBarycoord(t,e,i,n,wi),a.set(0,0),a.addScaledVector(r,wi.x),a.addScaledVector(s,wi.y),a.addScaledVector(o,wi.z),a}static isFrontFacing(t,e,i,n){return xi.subVectors(i,e),Mi.subVectors(t,e),xi.cross(Mi).dot(n)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this}setFromAttributeAndIndices(t,e,i,n){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,n),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return xi.subVectors(this.c,this.b),Mi.subVectors(this.a,this.b),.5*xi.cross(Mi).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Li.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Li.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,i,n,r){return Li.getUV(t,this.a,this.b,this.c,e,i,n,r)}containsPoint(t){return Li.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Li.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,n=this.b,r=this.c;let s,o;Si.subVectors(n,i),Ei.subVectors(r,i),Ai.subVectors(t,i);const a=Si.dot(Ai),l=Ei.dot(Ai);if(a<=0&&l<=0)return e.copy(i);Ri.subVectors(t,n);const c=Si.dot(Ri),h=Ei.dot(Ri);if(c>=0&&h<=c)return e.copy(n);const u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return s=a/(a-c),e.copy(i).addScaledVector(Si,s);Ci.subVectors(t,r);const d=Si.dot(Ci),p=Ei.dot(Ci);if(p>=0&&d<=p)return e.copy(r);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),e.copy(i).addScaledVector(Ei,o);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return Ti.subVectors(r,n),o=(h-c)/(h-c+(d-p)),e.copy(n).addScaledVector(Ti,o);const g=1/(m+f+u);return s=f*g,o=u*g,e.copy(i).addScaledVector(Si,s).addScaledVector(Ei,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Pi=0;class Ii extends Rt{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Pi++}),this.uuid=Ot(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=n,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=St,this.stencilZFail=St,this.stencilZPass=St,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const i=t[e];if(void 0===i){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}const n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e){const e=n(t.textures),r=n(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(null!==e){const t=e.length;i=new Array(t);for(let n=0;n!==t;++n)i[n]=e[n].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}class Oi extends Ii{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new oe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Di=new _e,Ni=new Vt;class Ui{constructor(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===i,this.usage=Et,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let n=0,r=this.itemSize;n<r;n++)this.array[t+n]=e.array[i+n];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,i=this.count;e<i;e++)Ni.fromBufferAttribute(this,e),Ni.applyMatrix3(t),this.setXY(e,Ni.x,Ni.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)Di.fromBufferAttribute(this,e),Di.applyMatrix3(t),this.setXYZ(e,Di.x,Di.y,Di.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)Di.fromBufferAttribute(this,e),Di.applyMatrix4(t),this.setXYZ(e,Di.x,Di.y,Di.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)Di.fromBufferAttribute(this,e),Di.applyNormalMatrix(t),this.setXYZ(e,Di.x,Di.y,Di.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)Di.fromBufferAttribute(this,e),Di.transformDirection(t),this.setXYZ(e,Di.x,Di.y,Di.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=kt(e,this.array)),e}setX(t,e){return this.normalized&&(e=Ht(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=kt(e,this.array)),e}setY(t,e){return this.normalized&&(e=Ht(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=kt(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Ht(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=kt(e,this.array)),e}setW(t,e){return this.normalized&&(e=Ht(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=Ht(e,this.array),i=Ht(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,n){return t*=this.itemSize,this.normalized&&(e=Ht(e,this.array),i=Ht(i,this.array),n=Ht(n,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this}setXYZW(t,e,i,n,r){return t*=this.itemSize,this.normalized&&(e=Ht(e,this.array),i=Ht(i,this.array),n=Ht(n,this.array),r=Ht(r,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==Et&&(t.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(t.updateRange=this.updateRange),t}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}}class Fi extends Ui{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class zi extends Ui{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class Bi extends Ui{constructor(t,e,i){super(new Float32Array(t),e,i)}}let ki=0;const Hi=new qe,Gi=new yi,Vi=new _e,Wi=new Me,Xi=new Me,ji=new _e;class Yi extends Rt{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:ki++}),this.uuid=Ot(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(jt(t)?zi:Fi)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,i=0){this.groups.push({start:t,count:e,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;
vendor: 1,479 bytes, line 2
2void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const i=this.attributes.normal;if(void 0!==i){const e=(new Wt).getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}const n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(t),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return Hi.makeRotationFromQuaternion(t),this.applyMatrix4(Hi),this}rotateX(t){return Hi.makeRotationX(t),this.applyMatrix4(Hi),this}rotateY(t){return Hi.makeRotationY(t),this.applyMatrix4(Hi),this}rotateZ(t){return Hi.makeRotationZ(t),this.applyMatrix4(Hi),this}translate(t,e,i){return Hi.makeTranslation(t,e,i),this.applyMatrix4(Hi),this}scale(t,e,i){return Hi.makeScale(t,e,i),this.applyMatrix4(Hi),this}lookAt(t){return Gi.lookAt(t),Gi.updateMatrix(),this.applyMatrix4(Gi.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Vi).negate(),this.translate(Vi.x,Vi.y,Vi.z),this}setFromPoints(t){const e=[];for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new Bi(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Me);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "fal
2se".',this),void this.boundingBox.set(new _e(-1/0,-1/0,-1/0),new _e(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];Wi.setFromBufferAttribute(i),this.morphTargetsRelative?(ji.addVectors(this.boundingBox.min,Wi.min),this.boundingBox.expandByPoint(ji),ji.addVectors(this.boundingBox.max,Wi.max),this.boundingBox.expandByPoint(ji)):(this.boundingBox.expandByPoint(Wi.min),this.boundingBox.expandByPoint(Wi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Be);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "fal
2se".',this),void this.boundingSphere.set(new _e,1/0);if(t){const i=this.boundingSphere.center;if(Wi.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];Xi.setFromBufferAttribute(i),this.morphTargetsRelative?(ji.addVectors(Wi.min,Xi.min),Wi.expandByPoint(ji),ji.addVectors(Wi.max,Xi.max),Wi.expandByPoint(ji)):(Wi.expandByPoint(Xi.min),Wi.expandByPoint(Xi.max))}Wi.getCenter(i);let n=0;for(let e=0,r=t.count;e<r;e++)ji.fromBufferAttribute(t,e),n=Math.max(n,i.distanceToSquared(ji));if(e)for(let r=0,s=e.length;r<s;r++){const s=e[r],o=this.morphTargetsRelative;for(let e=0,r=s.count;e<r;e++)ji.fromBufferAttribute(s,e),o&&(Vi.fromBufferAttribute(t,e),ji.add(Vi)),n=Math.max(n,i.distanceToSquared(ji))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const i=t.array,n=e.position.array,r=e.normal.array,s=e.uv.array,o=n.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Ui(new Float32Array(4*o),4));const a=this.getAttribute("tangent").array,l=[],c=[];for(let t=0;t<o;t++)l[t]=new _e,c[t]=new _e;const h=new _e,u=new _e,d=new _e,p=new Vt,f=new Vt,m=new Vt,g=new _e,v=new _e;function _(t,e,i){h.fromArray(n,3*t),u.fromArray(n,3*e),d.fromArray(n,3*i),p.fromArray(s,2*t),f.fromArray(s,2*e),m.fromArray(s,2*i),u.sub(h),d.sub(h),f.sub(p),m.sub(p);const r=1/(f.x*m.y-m.x*f.y);isFinite(r)&&(g.copy(u).multiplyScalar(m.y).addScaledVector(d,-f.y).multiplyScalar(r),v.copy(d).multiplyScalar(f.x).addScaledVector(u,-m.x).multiplyScalar(r),l[t].add(g),l[e].add(g),l[i].add(g),c[t].add(v),c[e].add(v),c[i].add(v))}let y=this.groups;0===y.length&&(y=[{start:0,count:i.length}]);for(let t=0,e=y.length;t<e;++t){const e=y[t],n=e.start;for(let t=n,r=n+e.count;t<r;t+=3)_(i[t+0],i[t+1],i[t+2])}const x=new _e,M=new _e,b=new _e,w=new _e;function S(t){b.fromArray(r,3*t),w.copy(b);const e=l[t];x.copy(e),x.sub(b.multiplyScalar(b.dot(e))).normalize(),M.crossVectors(w,e);const i=M.dot(c[t])<0?-1:1;a[4*t]=x.x,a[4*t+1]=x.y,a[4*t+2]=x.z,a[4*t+3]=i}for(let t=0,e=y.length;t<e;++t){const e=y[t],n=e.start;for(let t=n,r=n+e.count;t<r;t+=3)S(i[t+0]),S(i[t+1]),S(i[t+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i)i=new Ui(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let t=0,e=i.count;t<e;t++)i.setXYZ(t,0,0,0);const n=new _e,r=new _e,s=new _e,o=new _e,a=new _e,l=new _e,c=new _e,h=new _e;if(t)for(let u=0,d=t.count;u<d;u+=3){const d=t.getX(u+0),p=t.getX(u+1),f=t.getX(u+2);n.fromBufferAttribute(e,d),r.fromBufferAttribute(e,p),s.fromBufferAttribute(e,f),c.subVectors(s,r),h.subVectors(n,r),c.cross(h),o.fromBufferAttribute(i,d),a.fromBufferAttribute(i,p),l.fromBufferAttribute(i,f),o.add(c),a.add(c),l.add(c),i.setXYZ(d,o.x,o.y,o.z),i.setXYZ(p,a.x,a.y,a.z),i.setXYZ(f,l.x,l.y,l.z)}else for(let t=0,o=e.count;t<o;t+=3)n.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),s.fromBufferAttribute(e,t+2),c.subVectors(s,r),h.subVectors(n,r),c.cross(h),i.setXYZ(t+0,c.x,c.y,c.z),i.setXYZ(t+1,c.x,c.y,c.z),i.setXYZ(t+2,c.x,c.y,c.z);this.normalizeNormals(),i.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead."),this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)ji.fromBufferAttribute(t,e),ji.normalize(),t.setXYZ(e,ji.x,ji.y,ji.z)}toNonIndexed(){function t(t,e){const i=t.array,n=t.itemSize,r=t.normalized,s=new i.constructor(e.length*n);let o=0,a=0;for(let r=0,l=e.length;r<l;r++){o=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*n;for(let t=0;t<n;t++)s[a++]=i[o++]}return new Ui(s,n,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new Yi,i=this.index.array,n=this.attributes;for(const r in n){const s=t(n[r],i);e.setAttribute(r,s)}const r=this.morphAttributes;for(const n in r){const s=[],o=r[n];for(let e=0,n=o.length;e<n;e++){const n=t(o[e],i);s.push(n)}e.morphAttributes[n]=s}e.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let t=0,i=s.length;t<i;t++){const i=s[t];e.addGroup(i.start,i.count,i.materialIndex)}return e}toJSON(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
vendor: 21,314 bytes, line 2
2if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const e in i){const n=i[e];t.data.attributes[e]=n.toJSON(t.data)}const n={};let r=!1;for(const e in this.morphAttributes){const i=this.morphAttributes[e],s=[];for(let e=0,n=i.length;e<n;e++){const n=i[e];s.push(n.toJSON(t.data))}s.length>0&&(n[e]=s,r=!0)}r&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;null!==i&&this.setIndex(i.clone(e));const n=t.attributes;for(const t in n){const i=n[t];this.setAttribute(t,i.clone(e))}const r=t.morphAttributes;for(const t in r){const i=[],n=r[t];for(let t=0,r=n.length;t<r;t++)i.push(n[t].clone(e));this.morphAttributes[t]=i}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let t=0,e=s.length;t<e;t++){const e=s[t];this.addGroup(e.start,e.count,e.materialIndex)}const o=t.boundingBox;null!==o&&(this.boundingBox=o.clone());const a=t.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,void 0!==t.parameters&&(this.parameters=Object.assign({},t.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}const qi=new qe,Zi=new Ye,Ji=new Be,Ki=new _e,Qi=new _e,$i=new _e,tn=new _e,en=new _e,nn=new _e,rn=new _e,sn=new _e,on=new _e,an=new Vt,ln=new Vt,cn=new Vt,hn=new _e,un=new _e;class dn extends yi{constructor(t=new Yi,e=new Oi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){const e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}raycast(t,e){const i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0===n)return;if(null===i.boundingSphere&&i.computeBoundingSphere(),Ji.copy(i.boundingSphere),Ji.applyMatrix4(r),!1===t.ray.intersectsSphere(Ji))return;if(qi.copy(r).invert(),Zi.copy(t.ray).applyMatrix4(qi),null!==i.boundingBox&&!1===Zi.intersectsBox(i.boundingBox))return;let s;const o=i.index,a=i.attributes.position,l=i.morphAttributes.position,c=i.morphTargetsRelative,h=i.attributes.uv,u=i.attributes.uv2,d=i.groups,p=i.drawRange;if(null!==o)if(Array.isArray(n))for(let i=0,r=d.length;i<r;i++){const r=d[i],f=n[r.materialIndex];for(let i=Math.max(r.start,p.start),n=Math.min(o.count,Math.min(r.start+r.count,p.start+p.count));i<n;i+=3){const n=o.getX(i),d=o.getX(i+1),p=o.getX(i+2);s=pn(this,f,t,Zi,a,l,c,h,u,n,d,p),s&&(s.faceIndex=Math.floor(i/3),s.face.materialIndex=r.materialIndex,e.push(s))}}else{for(let i=Math.max(0,p.start),r=Math.min(o.count,p.start+p.count);i<r;i+=3){const r=o.getX(i),d=o.getX(i+1),p=o.getX(i+2);s=pn(this,n,t,Zi,a,l,c,h,u,r,d,p),s&&(s.faceIndex=Math.floor(i/3),e.push(s))}}else if(void 0!==a)if(Array.isArray(n))for(let i=0,r=d.length;i<r;i++){const r=d[i],o=n[r.materialIndex];for(let i=Math.max(r.start,p.start),n=Math.min(a.count,Math.min(r.start+r.count,p.start+p.count));i<n;i+=3){s=pn(this,o,t,Zi,a,l,c,h,u,i,i+1,i+2),s&&(s.faceIndex=Math.floor(i/3),s.face.materialIndex=r.materialIndex,e.push(s))}}else{for(let i=Math.max(0,p.start),r=Math.min(a.count,p.start+p.count);i<r;i+=3){s=pn(this,n,t,Zi,a,l,c,h,u,i,i+1,i+2),s&&(s.faceIndex=Math.floor(i/3),e.push(s))}}}}function pn(t,e,i,n,r,s,o,a,l,c,h,u){Ki.fromBufferAttribute(r,c),Qi.fromBufferAttribute(r,h),$i.fromBufferAttribute(r,u);const d=t.morphTargetInfluences;if(s&&d){rn.set(0,0,0),sn.set(0,0,0),on.set(0,0,0);for(let t=0,e=s.length;t<e;t++){const e=d[t],i=s[t];0!==e&&(tn.fromBufferAttribute(i,c),en.fromBufferAttribute(i,h),nn.fromBufferAttribute(i,u),o?(rn.addScaledVector(tn,e),sn.addScaledVector(en,e),on.addScaledVector(nn,e)):(rn.addScaledVector(tn.sub(Ki),e),sn.addScaledVector(en.sub(Qi),e),on.addScaledVector(nn.sub($i),e)))}Ki.add(rn),Qi.add(sn),$i.add(on)}t.isSkinnedMesh&&(t.boneTransform(c,Ki),t.boneTransform(h,Qi),t.boneTransform(u,$i));const p=function(t,e,i,n,r,s,o,a){let l;if(l=1===e.side?n.intersectTriangle(o,s,r,!0,a):n.intersectTriangle(r,s,o,2!==e.side,a),null===l)return null;un.copy(a),un.applyMatrix4(t.matrixWorld);const c=i.ray.origin.distanceTo(un);return c<i.near||c>i.far?null:{distance:c,point:un.clone(),object:t}}(t,e,i,n,Ki,Qi,$i,hn);if(p){a&&(an.fromBufferAttribute(a,c),ln.fromBufferAttribute(a,h),cn.fromBufferAttribute(a,u),p.uv=Li.getUV(hn,Ki,Qi,$i,an,ln,cn,new Vt)),l&&(an.fromBufferAttribute(l,c),ln.fromBufferAttribute(l,h),cn.fromBufferAttribute(l,u),p.uv2=Li.getUV(hn,Ki,Qi,$i,an,ln,cn,new Vt));const t={a:c,b:h,c:u,normal:new _e,materialIndex:0};Li.getNormal(Ki,Qi,$i,t.normal),p.face=t}return p}class fn extends Yi{constructor(t=1,e=1,i=1,n=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:s};const o=this;n=Math.floor(n),r=Math.floor(r),s=Math.floor(s);const a=[],l=[],c=[],h=[];let u=0,d=0;function p(t,e,i,n,r,s,p,f,m,g,v){const _=s/m,y=p/g,x=s/2,M=p/2,b=f/2,w=m+1,S=g+1;let E=0,T=0;const A=new _e;for(let s=0;s<S;s++){const o=s*y-M;for(let a=0;a<w;a++){const u=a*_-x;A[t]=u*n,A[e]=o*r,A[i]=b,l.push(A.x,A.y,A.z),A[t]=0,A[e]=0,A[i]=f>0?1:-1,c.push(A.x,A.y,A.z),h.push(a/m),h.push(1-s/g),E+=1}}for(let t=0;t<g;t++)for(let e=0;e<m;e++){const i=u+e+w*t,n=u+e+w*(t+1),r=u+(e+1)+w*(t+1),s=u+(e+1)+w*t;a.push(i,n,s),a.push(n,r,s),T+=6}o.addGroup(d,T,v),d+=T,u+=E}p("z","y","x",-1,-1,i,e,t,s,r,0),p("z","y","x",1,-1,i,e,-t,s,r,1),p("x","z","y",1,1,t,i,e,n,s,2),p("x","z","y",1,-1,t,i,-e,n,s,3),p("x","y","z",1,-1,t,e,i,n,r,4),p("x","y","z",-1,-1,t,e,-i,n,r,5),this.setIndex(a),this.setAttribute("position",new Bi(l,3)),this.setAttribute("normal",new Bi(c,3)),this.setAttribute("uv",new Bi(h,2))}static fromJSON(t){return new fn(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function mn(t){const e={};for(const i in t){e[i]={};for(const n in t[i]){const r=t[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?e[i][n]=r.clone():Array.isArray(r)?e[i][n]=r.slice():e[i][n]=r}}return e}function gn(t){const e={};for(let i=0;i<t.length;i++){const n=mn(t[i]);for(const t in n)e[t]=n[t]}return e}function vn(t){return null===t.getRenderTarget()&&t.outputEncoding===Mt?bt:wt}const _n={clone:mn,merge:gn};class yn extends Ii{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=mn(t.uniforms),this.uniformsGroups=function(t){const e=[];for(let i=0;i<t.length;i++)e.push(t[i].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const i in this.uniforms){const n=this.uniforms[i].value;n&&n.isTexture?e.uniforms[i]={type:"t",value:n.toJSON(t).uuid}:n&&n.isColor?e.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?e.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?e.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?e.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?e.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?e.uniforms[i]={type:"m4",value:n.toArray()}:e.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const i={};for(const t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}class xn extends yi{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new qe,this.projectionMatrix=new qe,this.projectionMatrixInverse=new qe}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class Mn extends xn{constructor(t=50,e=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*It*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*Pt*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*It*Math.atan(Math.tan(.5*Pt*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,i,n,r,s){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*Pt*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,o=s.fullHeight;r+=s.offsetX*n/t,e-=s.offsetY*i/o,n*=s.width/t,i*=s.height/o}const o=this.filmOffset;0!==o&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const bn=-90;class wn extends yi{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i;const n=new Mn(bn,1,t,e);n.layers=this.layers,n.up.set(0,1,0),n.lookAt(1,0,0),this.add(n);const r=new Mn(bn,1,t,e);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(-1,0,0),this.add(r);const s=new Mn(bn,1,t,e);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(0,1,0),this.add(s);const o=new Mn(bn,1,t,e);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(0,-1,0),this.add(o);const a=new Mn(bn,1,t,e);a.layers=this.layers,a.up.set(0,1,0),a.lookAt(0,0,1),this.add(a);const l=new Mn(bn,1,t,e);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,-1),this.add(l)}update(t,e){null===this.parent&&this.updateMatrixWorld();const i=this.renderTarget,[n,r,s,o,a,l]=this.children,c=t.getRenderTarget(),h=t.toneMapping,u=t.xr.enabled;t.toneMapping=0,t.xr.enabled=!1;const d=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,n),t.setRenderTarget(i,1),t.render(e,r),t.setRenderTarget(i,2),t.render(e,s),t.setRenderTarget(i,3),t.render(e,o),t.setRenderTarget(i,4),t.render(e,a),i.texture.generateMipmaps=d,t.setRenderTarget(i,5),t.render(e,l),t.setRenderTarget(c),t.toneMapping=h,t.xr.enabled=u,i.texture.needsPMREMUpdate=!0}}class Sn extends de{constructor(t,e,i,n,r,s,o,a,l,c){super(t=void 0!==t?t:[],e=void 0!==e?e:_,i,n,r,s,o,a,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class En extends fe{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const i={width:t,height:t,depth:1},n=[i,i,i,i,i,i];this.texture=new Sn(n,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:C}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},n=new fn(5,5,5),r=new yn({name:"CubemapFromEquirect",uniforms:mn(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const s=new dn(n,r),o=e.minFilter;e.minFilter===P&&(e.minFilter=C);return new wn(1,10,this).update(t,s),e.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,i,n){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,i,n);t.setRenderTarget(r)}}const Tn=new _e,An=new _e,Rn=new Wt;class Cn{constructor(t=new _e(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const n=Tn.subVectors(i,e).cross(An.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){const i=t.delta(Tn),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:e.copy(i).multiplyScalar(r).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||Rn.getNormalMatrix(t),n=this.coplanarPoint(Tn).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Ln=new Be,Pn=new _e;class In{constructor(t=new Cn,e=new Cn,i=new Cn,n=new Cn,r=new Cn,s=new Cn){this.planes=[t,e,i,n,r,s]}set(t,e,i,n,r,s){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(s),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t){const e=this.planes,i=t.elements,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],l=i[5],c=i[6],h=i[7],u=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],_=i[15];return e[0].setComponents(o-n,h-a,f-u,_-m).normalize(),e[1].setComponents(o+n,h+a,f+u,_+m).normalize(),e[2].setComponents(o+r,h+l,f+d,_+g).normalize(),e[3].setComponents(o-r,h-l,f-d,_-g).normalize(),e[4].setComponents(o-s,h-c,f-p,_-v).normalize(),e[5].setComponents(o+s,h+c,f+p,_+v).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Ln.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Ln)}intersectsSprite(t){return Ln.center.set(0,0,0),Ln.radius=.7071067811865476,Ln.applyMatrix4(t.matrixWorld),this.intersectsSphere(Ln)}intersectsSphere(t){const e=this.planes,i=t.center,n=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(i)<n)return!1}return!0}intersectsBox(t){const e=this.planes;for(let i=0;i<6;i++){const n=e[i];if(Pn.x=n.normal.x>0?t.max.x:t.min.x,Pn.y=n.normal.y>0?t.max.y:t.min.y,Pn.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(Pn)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function On(){let t=null,e=!1,i=null,n=null;function r(e,s){i(e,s),n=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==i&&(n=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(t){i=t},setContext:function(e){t=e}}}function Dn(t,e){const i=e.isWebGL2,n=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),n.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const i=n.get(e);i&&(t.deleteBuffer(i.buffer),n.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=n.get(e);return void((!t||t.version<e.version)&&n.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version}))}e.isInterleavedBufferAttribute&&(e=e.data);const s=n.get(e);void 0===s?n.set(e,function(e,n){const r=e.array,s=e.usage,o=t.createBuffer();let a;if(t.bindBuffer(n,o),t.bufferData(n,r,s),e.onUploadCallback(),r instanceof Float32Array)a=t.FLOAT;else if(r instanceof Uint16Array)if(e.isFloat16BufferAttribute){if(!i)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");a=t.HALF_FLOAT}else a=t.UNSIGNED_SHORT;else if(r instanceof Int16Array)a=t.SHORT;else if(r instanceof Uint32Array)a=t.UNSIGNED_INT;else if(r instanceof Int32Array)a=t.INT;else if(r instanceof Int8Array)a=t.BYTE;else if(r instanceof Uint8Array)a=t.UNSIGNED_BYTE;else{if(!(r instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r);a=t.UNSIGNED_BYTE}return{buffer:o,type:a,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version}}(e,r)):s.version<e.version&&(!function(e,n,r){const s=n.array,o=n.updateRange;t.bindBuffer(r,e),-1===o.count?t.bufferSubData(r,0,s):(i?t.bufferSubData(r,o.offset*s.BYTES_PER_ELEMENT,s,o.offset,o.count):t.bufferSubData(r,o.offset*s.BYTES_PER_ELEMENT,s.subarray(o.offset,o.offset+o.count)),o.count=-1),n.onUploadCallback()}(s.buffer,e,r),s.version=e.version)}}}class Nn extends Yi{constructor(t=1,e=1,i=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n};
vendor: 4,533 bytes, line 2
2const r=t/2,s=e/2,o=Math.floor(i),a=Math.floor(n),l=o+1,c=a+1,h=t/o,u=e/a,d=[],p=[],f=[],m=[];for(let t=0;t<c;t++){const e=t*u-s;for(let i=0;i<l;i++){const n=i*h-r;p.push(n,-e,0),f.push(0,0,1),m.push(i/o),m.push(1-t/a)}}for(let t=0;t<a;t++)for(let e=0;e<o;e++){const i=e+l*t,n=e+l*(t+1),r=e+1+l*(t+1),s=e+1+l*t;d.push(i,n,s),d.push(n,r,s)}this.setIndex(d),this.setAttribute("position",new Bi(p,3)),this.setAttribute("normal",new Bi(f,3)),this.setAttribute("uv",new Bi(m,2))}static fromJSON(t){return new Nn(t.width,t.height,t.widthSegments,t.heightSegments)}}const Un={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n\t\tfloat x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n\t\tfloat x2 = x * x;\n\t\tfloat x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n\t\treturn ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\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 dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\n#ifdef USE_IRIDESCENCE\n\tvec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;
2\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 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",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660,\t0.0556434,\n\t\t-1.5371385,\t1.8760108, -0.2040259,\n\t\t-0.4985314,\t0.0415560,\t
vendor: 13,848 bytes, line 2
21.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\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 = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\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; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\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 luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, 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 - 2.0 ) + 1.0;\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 cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_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 ), cubeUV_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#el
2se\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 ) || defined( LAMBERT )\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 ) || defined( LAMBERT )\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\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 = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\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}
2 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\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial 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}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",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}
2\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",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
vendor: 6,955 bytes, line 2
2",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\tmaterial.ior = 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( ( material.ior - 1.0 ) / ( material.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_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\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_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\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}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 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(
2\t\t0, 1,\t\t
vendor: 15,871 bytes, line 2
20 ),\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\t#ifdef USE_IRIDESCENCE\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\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\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\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\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\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\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\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 ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\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, vSpotLightCoord[ 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\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 ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\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 = 
2dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\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 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\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",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.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}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 25
25.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:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#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\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;
2\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\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t\tf.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\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t\tf.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}
2\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#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\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:"#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 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_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ 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, vSpotLightCoord[ 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\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\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;
2\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(\t1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,\t1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,\t1.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\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= 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, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\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 ( isinf( attenuationDistance ) ) {\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 ) || NUM_SPOT_L
2IGHT_COORDS > 0\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;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = tex
vendor: 31,014 bytes, line 2
2Color;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\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 <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\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 <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\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 * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\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 <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\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 <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\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_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\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 <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\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 <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\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 <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},
vendor: 604 bytes, line 2
2Fn={common:{diffuse:{value:new oe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Wt},uv2Transform:{value:new Wt},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 Vt(1,1)}}
vendor: 6,609 bytes, line 2
2,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 oe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new oe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Wt}},sprite:{diffuse:{value:new oe(16777215)},opacity:{value:1},center:{value:new Vt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Wt}}},zn={basic:{uniforms:gn([Fn.common,Fn.specularmap,Fn.envmap,Fn.aomap,Fn.lightmap,Fn.fog]),vertexShader:Un.meshbasic_vert,fragmentShader:Un.meshbasic_frag},lambert:{uniforms:gn([Fn.common,Fn.specularmap,Fn.envmap,Fn.aomap,Fn.lightmap,Fn.emissivemap,Fn.bumpmap,Fn.normalmap,Fn.displacementmap,Fn.fog,Fn.lights,{emissive:{value:new oe(0)}}]),vertexShader:Un.meshlambert_vert,fragmentShader:Un.meshlambert_frag},phong:{uniforms:gn([Fn.common,Fn.specularmap,Fn.envmap,Fn.aomap,Fn.lightmap,Fn.emissivemap,Fn.bumpmap,Fn.normalmap,Fn.displacementmap,Fn.fog,Fn.lights,{emissive:{value:new oe(0)},specular:{value:new oe(1118481)},shininess:{value:30}}]),vertexShader:Un.meshphong_vert,fragmentShader:Un.meshphong_frag},standard:{uniforms:gn([Fn.common,Fn.envmap,Fn.aomap,Fn.lightmap,Fn.emissivemap,Fn.bumpmap,Fn.normalmap,Fn.displacementmap,Fn.roughnessmap,Fn.metalnessmap,Fn.fog,Fn.lights,{emissive:{value:new oe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Un.meshphysical_vert,fragmentShader:Un.meshphysical_frag},toon:{uniforms:gn([Fn.common,Fn.aomap,Fn.lightmap,Fn.emissivemap,Fn.bumpmap,Fn.normalmap,Fn.displacementmap,Fn.gradientmap,Fn.fog,Fn.lights,{emissive:{value:new oe(0)}}]),vertexShader:Un.meshtoon_vert,fragmentShader:Un.meshtoon_frag},matcap:{uniforms:gn([Fn.common,Fn.bumpmap,Fn.normalmap,Fn.displacementmap,Fn.fog,{matcap:{value:null}}]),vertexShader:Un.meshmatcap_vert,fragmentShader:Un.meshmatcap_frag},points:{uniforms:gn([Fn.points,Fn.fog]),vertexShader:Un.points_vert,fragmentShader:Un.points_frag},dashed:{uniforms:gn([Fn.common,Fn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Un.linedashed_vert,fragmentShader:Un.linedashed_frag},depth:{uniforms:gn([Fn.common,Fn.displacementmap]),vertexShader:Un.depth_vert,fragmentShader:Un.depth_frag},normal:{uniforms:gn([Fn.common,Fn.bumpmap,Fn.normalmap,Fn.displacementmap,{opacity:{value:1}}]),vertexShader:Un.meshnormal_vert,fragmentShader:Un.meshnormal_frag},sprite:{uniforms:gn([Fn.sprite,Fn.fog]),vertexShader:Un.sprite_vert,fragmentShader:Un.sprite_frag},background:{uniforms:{uvTransform:{value:new Wt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Un.background_vert,fragmentShader:Un.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Un.backgroundCube_vert,fragmentShader:Un.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Un.cube_vert,fragmentShader:Un.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Un.equirect_vert,fragmentShader:Un.equirect_frag},distanceRGBA:{uniforms:gn([Fn.common,Fn.displacementmap,{referencePosition:{value:new _e},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Un.distanceRGBA_vert,fragmentShader:Un.distanceRGBA_frag},shadow:{uniforms:gn([Fn.lights,Fn.fog,{color:{value:new oe(0)},opacity:{value:1}}]),vertexShader:Un.shadow_vert,fragmentShader:Un.shadow_frag}};zn.physical={uniforms:gn([zn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Vt(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new oe(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Vt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new oe(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new oe(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Un.meshphysical_vert,fragmentShader:Un.meshphysical_frag};const Bn={r:0,b:0,g:0};function kn(t,e,i,n,r,s,o){const a=new oe(0);let l,c,h=!0===s?0:1,u=null,d=0,p=null;function f(e,i){e.getRGB(Bn,vn(t)),n.buffers.color.setClear(Bn.r,Bn.g,Bn.b,i,o)}return{getClearColor:function(){return a},setClearColor:function(t,e=1){a.set(t),h=e,f(a,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,f(a,h)},render:function(n,s){let o=!1,m=!0===s.isScene?s.background:null;if(m&&m.isTexture){m=(s.backgroundBlurriness>0?i:e).get(m)}const g=t.xr,v=g.getSession&&g.getSession();v&&"additive"===v.environmentBlendMode&&(m=null),null===m?f(a,h):m&&m.isColor&&(f(m,1),o=!0),(t.autoClear||o)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),m&&(m.isCubeTexture||m.mapping===b)?(void 0===c&&(c=new dn(new fn(1,1,1),new yn({name:"Backgroun
2dCubeMaterial",uniforms:mn(zn.backgroundCube.uniforms),vertexShader:zn.backgroundCube.vertexShader,fragmentShader:zn.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),c.material.uniforms.envMap.value=m,c.material.uniforms.flipEnvMap.value=m.isCubeTexture&&!1===m.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=s.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=s.backgroundIntensity,u===m&&d===m.version&&p===t.toneMapping||(c.material.needsUpdate=!0,u=m,d=m.version,p=t.toneMapping),c.layers.enableAll(),n.unshift(c,c.geometry,c.material,0,0,null)):m&&m.isTexture&&(void 0===l&&(l=new dn(new Nn(2,2),new yn({name:"BackgroundMaterial",uniforms:mn(zn.background.uniforms),vertexShader:zn.background.vertexShader,fragmentShader:zn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=m,l.material.uniforms.backgroundIntensity.value=s.backgroundIntensity,!0===m.matrixAutoUpdate&&m.updateMatrix(),l.material.uniforms.uvTransform.value.copy(m.matrix),u===m&&d===m.version&&p===t.toneMapping||(l.material.needsUpdate=!0,u=m,d=m.version,p=t.toneMapping),l.layers.enableAll(),n.unshift(l,l.geometry,l.material,0,0,null))}}}function Hn(t,e,i,n){const r=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||null!==s,a={},l=p(null);let c=l,h=!1;function u(e){return n.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function d(e){return n.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function p(t){const e=[],i=[],n=[];for(let t=0;t<r;t++)e[t]=0,i[t]=0,n[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:i,attributeDivisors:n,object:t,attributes:{},index:null}}function f(){const t=c.newAttributes;for(let e=0,i=t.length;e<i;e++)t[e]=0}function m(t){g(t,0)}function g(i,r){const s=c.newAttributes,o=c.enabledAttributes,a=c.attributeDivisors;if(s[i]=1,0===o[i]&&(t.enableVertexAttribArray(i),o[i]=1),a[i]!==r){(n.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,r),a[i]=r}}function v(){const e=c.newAttributes,i=c.enabledAttributes;for(let n=0,r=i.length;n<r;n++)i[n]!==e[n]&&(t.disableVertexAttribArray(n),i[n]=0)}function _(e,i,r,s,o,a){!0!==n.isWebGL2||r!==t.INT&&r!==t.UNSIGNED_INT?t.vertexAttribPointer(e,i,r,s,o,a):t.vertexAttribIPointer(e,i,r,o,a)}function y(){x(),h=!0,c!==l&&(c=l,u(c.object))}function x(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(r,l,d,y,x){let M=!1;if(o){const e=function(e,i,r){const o=!0===r.wireframe;let l=a[e.id];void 0===l&&(l={},a[e.id]=l);let c=l[i.id];void 0===c&&(c={},l[i.id]=c);let h=c[o];void 0===h&&(h=p(n.isWebGL2?t.createVertexArray():s.createVertexArrayOES()),c[o]=h);return h}(y,d,l);c!==e&&(c=e,u(c.object)),M=function(t,e,i,n){const r=c.attributes,s=e.attributes;let o=0;const a=i.getAttributes();for(const e in a){if(a[e].location>=0){const i=r[e];let n=s[e];if(void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor)),void 0===i)return!0;if(i.attribute!==n)return!0;if(n&&i.data!==n.data)return!0;o++}}return c.attributesNum!==o||c.index!==n}(r,y,d,x),M&&function(t,e,i,n){const r={},s=e.attributes;let o=0;const a=i.getAttributes();for(const e in a){if(a[e].location>=0){let i=s[e];void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor));const n={};n.attribute=i,i&&i.data&&(n.data=i.data),r[e]=n,o++}}c.attributes=r,c.attributesNum=o,c.index=n}(r,y,d,x)}else{const t=!0===l.wireframe;c.geometry===y.id&&c.program===d.id&&c.wireframe===t||(c.geometry=y.id,c.program=d.id,c.wireframe=t,M=!0)}null!==x&&i.update(x,t.ELEMENT_ARRAY_BUFFER),(M||h)&&(h=!1,function(r,s,o,a){if(!1===n.isWebG
vendor: 5,416 bytes, line 2
2L2&&(r.isInstancedMesh||a.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;f();const l=a.attributes,c=o.getAttributes(),h=s.defaultAttributeValues;for(const e in c){const n=c[e];if(n.location>=0){let s=l[e];if(void 0===s&&("instanceMatrix"===e&&r.instanceMatrix&&(s=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(s=r.instanceColor)),void 0!==s){const e=s.normalized,o=s.itemSize,l=i.get(s);if(void 0===l)continue;const c=l.buffer,h=l.type,u=l.bytesPerElement;if(s.isInterleavedBufferAttribute){const i=s.data,l=i.stride,d=s.offset;if(i.isInstancedInterleavedBuffer){for(let t=0;t<n.locationSize;t++)g(n.location+t,i.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=i.meshPerAttribute*i.count)}else for(let t=0;t<n.locationSize;t++)m(n.location+t);t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<n.locationSize;t++)_(n.location+t,o/n.locationSize,h,e,l*u,(d+o/n.locationSize*t)*u)}else{if(s.isInstancedBufferAttribute){for(let t=0;t<n.locationSize;t++)g(n.location+t,s.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let t=0;t<n.locationSize;t++)m(n.location+t);t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<n.locationSize;t++)_(n.location+t,o/n.locationSize,h,e,o*u,o/n.locationSize*t*u)}}else if(void 0!==h){const i=h[e];if(void 0!==i)switch(i.length){case 2:t.vertexAttrib2fv(n.location,i);break;case 3:t.vertexAttrib3fv(n.location,i);break;case 4:t.vertexAttrib4fv(n.location,i);break;default:t.vertexAttrib1fv(n.location,i)}}}}v()}(r,l,d,y),null!==x&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){y();for(const t in a){const e=a[t];for(const t in e){const i=e[t];for(const t in i)d(i[t].object),delete i[t];delete e[t]}delete a[t]}},releaseStatesOfGeometry:function(t){if(void 0===a[t.id])return;const e=a[t.id];for(const t in e){const i=e[t];for(const t in i)d(i[t].object),delete i[t];delete e[t]}delete a[t.id]},releaseStatesOfProgram:function(t){for(const e in a){const i=a[e];if(void 0===i[t.id])continue;const n=i[t.id];for(const t in n)d(n[t].object),delete n[t];delete i[t.id]}},initAttributes:f,enableAttribute:m,disableUnusedAttributes:v}}function Gn(t,e,i,n){const r=n.isWebGL2;let s;this.setMode=function(t){s=t},this.render=function(e,n){t.drawArrays(s,e,n),i.update(n,s,1)},this.renderInstances=function(n,o,a){if(0===a)return;let l,c;if(r)l=t,c="drawArraysInstanced";else if(l=e.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](s,n,o,a),i.update(o,s,a)}}function Vn(t,e,i){let n;function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let o=void 0!==i.precision?i.precision:"highp";const a=r(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=s||e.has("WEBGL_draw_buffers"),c=!0===i.logarithmicDepthBuffer,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),f=t.getParameter(t.MAX_VERTEX_ATTRIBS),m=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),v=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),_=u>0,y=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===e.has("EXT_texture_filter_anisotropic")){const i=e.get("EXT_texture_filter_anisotropic");n=t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:_,floatFragmentTextures:y,floatVertexTextures:_&&y,maxSamples:s?t.getParameter(t.MAX_SAMPLES):0}}function Wn(t){const e=this;let i=null,n=0,r=!1,s=!1;const o=new Cn,a=new Wt,l={value:null,needsUpdate:!1};function c(){l.value!==i&&(l.value=i,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(t,i,n,r){const s=null!==t?t.length:0;let c=null;if(0!==s){if(c=l.value,!0!==r||null===c){const e=n+4*s,r=i.matrixWorldInverse;a.getNormalMatrix(r),(null===c||c.length<e)&&(c=new Float32Array(e));for(let e=0,i=n;e!==s;++e,i+=4)o.copy(t[e]).applyMatrix4(r,a),o.normal.toArray(c,i),c[i+3]=o.constant}l.value=c,l.needsUpdate=!0}return e.numPlanes=s,e.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,s){const o=0!==t.length||e||0!==n||r;return r=e,i=h(t,s,0),n=t.length,o},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1,c()},this.setState=function(e,o,a){const u=e.clippingPlanes,d=e.clipIntersection,p=e.clipSh
vendor: 38,134 bytes, line 2
2adows,f=t.get(e);if(!r||null===u||0===u.length||s&&!p)s?h(null):c();else{const t=s?0:n,e=4*t;let r=f.clippingState||null;l.value=r,r=h(u,o,e,a);for(let t=0;t!==e;++t)r[t]=i[t];f.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function Xn(t){let e=new WeakMap;function i(t,e){return e===x?t.mapping=_:e===M&&(t.mapping=y),t}function n(t){const i=t.target;i.removeEventListener("dispose",n);const r=e.get(i);void 0!==r&&(e.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){const s=r.mapping;if(s===x||s===M){if(e.has(r)){return i(e.get(r).texture,r.mapping)}{const s=r.image;if(s&&s.height>0){const o=new En(s.height/2);return o.fromEquirectangularTexture(t,r),e.set(r,o),r.addEventListener("dispose",n),i(o.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}class jn extends xn{constructor(t=-1,e=1,i=1,n=-1,r=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=n,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,i,n,r,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-t,s=i+t,o=n+e,a=n-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,o-=e*this.view.offsetY,a=o-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,o,a,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const Yn=[.125,.215,.35,.446,.526,.582],qn=20,Zn=new jn,Jn=new oe;let Kn=null;const Qn=(1+Math.sqrt(5))/2,$n=1/Qn,tr=[new _e(1,1,1),new _e(-1,1,1),new _e(1,1,-1),new _e(-1,1,-1),new _e(0,Qn,$n),new _e(0,Qn,-$n),new _e($n,0,Qn),new _e(-$n,0,Qn),new _e(Qn,$n,0),new _e(-Qn,$n,0)];class er{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,n=100){Kn=this._renderer.getRenderTarget(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,i,n,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=sr(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=rr(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Kn),t.scissorTest=!1,nr(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===_||t.mapping===y?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Kn=this._renderer.getRenderTarget();const i=e||this._allocateTargets();return this._textureToCubeUV(t,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,i={magFilter:C,minFilter:C,generateMipmaps:!1,type:U,format:z,encoding:xt,depthBuffer:!1},n=ir(t,e,i);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=ir(t,e,i);const{_lodMax:n}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(t){const e=[],i=[],n=[];let r=t;const s=t-4+1+Yn.length;for(let o=0;o<s;o++){const s=Math.pow(2,r);i.push(s);let a=1/s;o>t-4?a=Yn[o-t+4-1]:0===o&&(a=0),n.push(a);const l=1/(s-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,f=3,m=2,g=1,v=new Float32Array(f*p*d),_=new Float32Array(m*p*d),y=new Float32Array(g*p*d);for(let t=0;t<d;t++){const e=t%3*2/3-1,i=t>2?0:-1,n=[e,i,0,e+2/3,i,0,e+2/3,i+1,0,e,i,0,e+2/3,i+1,0,e,i+1,0];v.set(n,f*p*t),_.set(u,m*p*t);const r=[t,t,t,t,t,t];y.set(r,g*p*t)}const x=new Yi;x.setAttribute("position",new Ui(v,f)),x.setAttribute("uv",new Ui(_,m)),x.setAttribute("faceIndex",new Ui(y,g)),e.push(x),r>4&&r--}return{lodPlanes:e,sizeLods:i,sigmas:n}}(n)),this._blurMaterial=function(t,e,i){const n=new Float32Array(qn),r=new _e(0,1,0),s=new yn({name:"SphericalGaussianBlur",defines:{n:qn,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:or(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return s}(n,t,e)}return n}_compileMaterial(t){const e=new dn(this._lodPlanes[0],t);this._renderer.compile(e,Zn)}_sceneToCubeUV(t,e,i,n){const r=new Mn(90,1,e,i),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.toneMapping;a.getClearColor(Jn),a.toneMapping=0,a.autoClear=!1;const h=new Oi({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),u=new dn(new fn,h);let d=!1;const p=t.background;p?p.isColor&&(h.color.copy(p),t.background=null,d=!0):(h.color.copy(Jn),d=!0);for(let e=0;e<6;e++){const i=e%3;0===i?(r.up.set(0,s[e],0),r.lookAt(o[e],0,0)):1===i?(r.up.set(0,0,s[e]),r.lookAt(0,o[e],0)):(r.up.set(0,s[e],0),r.lookAt(0,0,o[e]));const l=this._cubeSize;nr(n,i*l,e>2?l:0,l,l),a.setRenderTarget(n),d&&a.render(u,r),a.render(t,r)}u.geometry.dispose(),u.material.dispose(),a.toneMapping=c,a.autoClear=l,t.background=p}_textureToCubeUV(t,e){const i=this._renderer,n=t.mapping===_||t.mapping===y;n?(null===this._cubemapMaterial&&(this._cubemapMaterial=sr()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=rr());const r=n?this._cubemapMaterial:this._equirectMaterial,s=new dn(this._lodPlanes[0],r);r.uniforms.envMap.value=t;const o=this._cubeSize;nr(e,0,0,3*o,2*o),i.setRenderTarget(e),i.render(s,Zn)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;for(let e=1;e<this._lodPlanes.length;e++){const i=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),n=tr[(e-1)%tr.length];this._blur(t,e-1,e,i,n)}e.autoClear=i}_blur(t,e,i,n,r){const s=this._pingPongRenderTarget;this._halfBlur(t,s,e,i,n,"latitudinal",r),this._halfBlur(s,t,i,i,n,"longitudinal",r)}_halfBlur(t,e,i,n,r,s,o){const a=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new dn(this._lodPlanes[n],l),h=l.uniforms,u=this._sizeLods[i]-1,d=isFinite(r)?Math.PI/(2*u):2*Math.PI/39,p=r/d,f=isFinite(r)?1+Math.floor(3*p):qn;f>qn&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t<qn;++t){const e=t/p,i=Math.exp(-e*e/2);m.push(i),0===t?g+=i:t<f&&(g+=2*i)}for(let t=0;t<m.length;t++)m[t]=m[t]/g;h.envMap.value=t.texture,h.samples.value=f,h.weights.value=m,h.latitudinal.value="latitudinal"===s,o&&(h.poleAxis.value=o);const{_lodMax:v}=this;h.dTheta.value=d,h.mipInt.value=v-i;const _=this._sizeLods[n];nr(e,3*_*(n>v-4?n-v+4:0),4*(this._cubeSize-_),3*_,2*_),a.setRenderTarget(e),a.render(c,Zn)}}function ir(t,e,i){const n=new fe(t,e,i);return n.texture.mapping=b,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function nr(t,e,i,n,r){t.viewport.set(e,i,n,r),t.scissor.set(e,i,n,r)}function rr(){return new yn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:or(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function sr(){return new yn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:or(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function or(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function ar(t){let e=new WeakMap,i=null;function n(t){const i=t.target;i.removeEventListener("dispose",n);const r=e.get(i);void 0!==r&&(e.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping,o=s===x||s===M,a=s===_||s===y;if(o||a){if(r.isRenderTargetTexture&&!0===r.needsPMREMUpdate){r.needsPMREMUpdate=!1;let n=e.get(r);return null===i&&(i=new er(t)),n=o?i.fromEquirectangular(r,n):i.fromCubemap(r,n),e.set(r,n),n.texture}if(e.has(r))return e.get(r).texture;{const s=r.image;if(o&&s&&s.height>0||a&&s&&function(t){let e=0;const i=6;for(let n=0;n<i;n++)void 0!==t[n]&&e++;return e===i}(s)){null===i&&(i=new er(t));const s=o?i.fromEquirectangular(r):i.fromCubemap(r);return e.set(r,s),r.addEventListener("dispose",n),s.texture}return null}}}return r},dispose:function(){e=new WeakMap,null!==i&&(i.dispose(),i=null)}}}function lr(t){const e={};function i(i){if(void 0!==e[i])return e[i];let n;switch(i){case"WEBGL_depth_texture":n=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=t.getExtension(i)}return e[i]=n,n}return{has:function(t){return null!==i(t)},init:function(t){t.isWebGL2?i("EXT_color_buffer_float"):(i("WEBGL_depth_texture"),i("OES_texture_float"),i("OES_texture_half_float"),i("OES_texture_half_float_linear"),i("OES_standard_derivatives"),i("OES_element_index_uint"),i("OES_vertex_array_object"),i("ANGLE_instanced_arrays")),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture")},get:function(t){const e=i(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function cr(t,e,i,n){const r={},s=new WeakMap;function o(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);a.removeEventListener("dispose",o),delete r[a.id];const l=s.get(a);l&&(e.remove(l),s.delete(a)),n.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,i.memory.geometries--}function a(t){const i=[],n=t.index,r=t.attributes.position;let o=0;if(null!==n){const t=n.array;o=n.version;for(let e=0,n=t.length;e<n;e+=3){const n=t[e+0],r=t[e+1],s=t[e+2];i.push(n,r,r,s,s,n)}}else{const t=r.array;o=r.version;for(let e=0,n=t.length/3-1;e<n;e+=3){const t=e+0,n=e+1,r=e+2;i.push(t,n,n,r,r,t)}}const a=new(jt(i)?zi:Fi)(i,1);a.version=o;const l=s.get(t);l&&e.remove(l),s.set(t,a)}return{get:function(t,e){return!0===r[e.id]||(e.addEventListener("dispose",o),r[e.id]=!0,i.memory.geometries++),e},update:function(i){const n=i.attributes;for(const i in n)e.update(n[i],t.ARRAY_BUFFER);const r=i.morphAttributes;for(const i in r){const n=r[i];for(let i=0,r=n.length;i<r;i++)e.update(n[i],t.ARRAY_BUFFER)}},getWireframeAttribute:function(t){const e=s.get(t);if(e){const i=t.index;null!==i&&e.version<i.version&&a(t)}else a(t);return s.get(t)}}}function hr(t,e,i,n){const r=n.isWebGL2;let s,o,a;this.setMode=function(t){s=t},this.setIndex=function(t){o=t.type,a=t.bytesPerElement},this.render=function(e,n){t.drawElements(s,n,o,e*a),i.update(n,s,1)},this.renderInstances=function(n,l,c){if(0===c)return;let h,u;if(r)h=t,u="drawElementsInstanced";else if(h=e.get("ANGLE_instanced_arrays"),u="drawElementsInstancedANGLE",null===h)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[u](s,l,o,n*a,c),i.update(l,s,c)}}function ur(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(i,n,r){switch(e.calls++,n){case t.TRIANGLES:e.triangles+=r*(i/3);break;case t.LINES:e.lines+=r*(i/2);break;case t.LINE_STRIP:e.lines+=r*(i-1);break;case t.LINE_LOOP:e.lines+=r*i;break;case t.POINTS:e.points+=r*i;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function dr(t,e){return t[0]-e[0]}function pr(t,e){return Math.abs(e[1])-Math.abs(t[1])}function fr(t,e,i){const n={},r=new Float32Array(8),s=new WeakMap,o=new pe,a=[];for(let t=0;t<8;t++)a[t]=[t,0];return{update:function(l,c,h,u){const d=l.morphTargetInfluences;if(!0===e.isWebGL2){const p=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,f=void 0!==p?p.length:0;let m=s.get(c);if(void 0===m||m.count!==f){void 0!==m&&m.texture.dispose();const _=void 0!==c.morphAttributes.position,y=void 0!==c.morphAttributes.normal,x=void 0!==c.morphAttributes.color,M=c.morphAttributes.position||[],b=c.morphAttributes.normal||[],w=c.morphAttributes.color||[];let S=0;!0===_&&(S=1),!0===y&&(S=2),!0===x&&(S=3);let E=c.attributes.position.count*S,T=1;E>e.maxTextureSize&&(T=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);const A=new Float32Array(E*T*4*f),R=new me(A,E,T,f);R.type=N,R.needsUpdate=!0;const C=4*S;for(let P=0;P<f;P++){const I=M[P],O=b[P],D=w[P],U=E*T*4*P;for(let F=0;F<I.count;F++){const z=F*C;!0===_&&(o.fromBufferAttribute(I,F),A[U+z+0]=o.x,A[U+z+1]=o.y,A[U+z+2]=o.z,A[U+z+3]=0),!0===y&&(o.fromBufferAttribute(O,F),A[U+z+4]=o.x,A[U+z+5]=o.y,A[U+z+6]=o.z,A[U+z+7]=0),!0===x&&(o.fromBufferAttribute(D,F),A[U+z+8]=o.x,A[U+z+9]=o.y,A[U+z+10]=o.z,A[U+z+11]=4===D.itemSize?o.w:1)}}function L(){R.dispose(),s.delete(c),c.removeEventListener("dispose",L)}m={count:f,texture:R,size:new Vt(E,T)},s.set(c,m),c.addEventListener("dispose",L)}let g=0;for(let B=0;B<d.length;B++)g+=d[B];const v=c.morphTargetsRelative?1:1-g;u.getUniforms().setValue(t,"morphTargetBaseInfluence",v),u.getUniforms().setValue(t,"morphTargetInfluences",d),u.getUniforms().setValue(t,"morphTargetsTexture",m.texture,i),u.getUniforms().setValue(t,"morphTargetsTextureSize",m.size)}else{const k=void 0===d?0:d.length;let H=n[c.id];if(void 0===H||H.length!==k){H=[];for(let j=0;j<k;j++)H[j]=[j,0];n[c.id]=H}for(let Y=0;Y<k;Y++){const q=H[Y];q[0]=Y,q[1]=d[Y]}H.sort(pr);for(let Z=0;Z<8;Z++)Z<k&&H[Z][1]?(a[Z][0]=H[Z][0],a[Z][1]=H[Z][1]):(a[Z][0]=Number.MAX_SAFE_INTEGER,a[Z][1]=0);a.sort(dr);const G=c.morphAttributes.position,V=c.morphAttributes.normal;let W=0;for(let J=0;J<8;J++){const K=a[J],Q=K[0],$=K[1];Q!==Number.MAX_SAFE_INTEGER&&$?(G&&c.getAttribute("morphTarget"+J)!==G[Q]&&c.setAttribute("morphTarget"+J,G[Q]),V&&c.getAttribute("morphNormal"+J)!==V[Q]&&c.setAttribute("morphNormal"+J,V[Q]),r[J]=$,W+=$):(G&&!0===c.hasAttribute("morphTarget"+J)&&c.deleteAttribute("morphTarget"+J),V&&!0===c.hasAttribute("morphNormal"+J)&&c.deleteAttribute("morphNormal"+J),r[J]=0)}const X=c.morphTargetsRelative?1:1-W;u.getUniforms().setValue(t,"morphTargetBaseInfluence",X),u.getUniforms().setValue(t,"morphTargetInfluences",r)}}}}function mr(t,e,i,n){let r=new WeakMap;function s(t){const e=t.target;e.removeEventListener("dispose",s),i.remove(e.instanceMatrix),null!==e.instanceColor&&i.remove(e.instanceColor)}return{update:function(o){const a=n.render.frame,l=o.geometry,c=e.get(o,l);return r.get(c)!==a&&(e.update(c),r.set(c,a)),o.isInstancedMesh&&(!1===o.hasEventListener("dispose",s)&&o.addEventListener("dispose",s),i.update(o.instanceMatrix,t.ARRAY_BUFFER),null!==o.instanceColor&&i.update(o.instanceColor,t.ARRAY_BUFFER)),c},dispose:function(){r=new WeakMap}}}const gr=new de,vr=new me,_r=new ge,yr=new Sn,xr=[],Mr=[],br=new Float32Array(16),wr=new Float32Array(9),Sr=new Float32Array(4);function Er(t,e,i){const n=t[0];if(n<=0||n>0)return t;const r=e*i;let s=xr[r];if(void 0===s&&(s=new Float32Array(r),xr[r]=s),0!==e){n.toArray(s,0);for(let n=1,r=0;n!==e;++n)r+=i,t[n].toArray(s,r)}return s}function Tr(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i<n;i++)if(t[i]!==e[i])return!1;return!0}function Ar(t,e){for(let i=0,n=e.length;i<n;i++)t[i]=e[i]}function Rr(t,e){let i=Mr[e];void 0===i&&(i=new Int32Array(e),Mr[e]=i);for(let n=0;n!==e;++n)i[n]=t.allocateTextureUnit();return i}function Cr(t,e){const i=this.cache;i[0]!==e&&(t.uniform1f(this.addr,e),i[0]=e)}function Lr(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(Tr(i,e))return;t.uniform2fv(this.addr,e),Ar(i,e)}}function Pr(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else if(void 0!==e.r)i[0]===e.r&&i[1]===e.g&&i[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),i[0]=e.r,i[1]=e.g,i[2]=e.b);else{if(Tr(i,e))return;t.uniform3fv(this.addr,e),Ar(i,e)}}function Ir(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z&&i[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(Tr(i,e))return;t.uniform4fv(this.addr,e),Ar(i,e)}}function Or(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(Tr(i,e))return;t.uniformMatrix2fv(this.addr,!1,e),Ar(i,e)}else{if(Tr(i,n))return;Sr.set(n),t.uniformMatrix2fv(this.addr,!1,Sr),Ar(i,n)}}function Dr(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(Tr(i,e))return;t.uniformMatrix3fv(this.addr,!1,e),Ar(i,e)}else{if(Tr(i,n))return;wr.set(n),t.uniformMatrix3fv(this.addr,!1,wr),Ar(i,n)}}function Nr(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(Tr(i,e))return;t.uniformMatrix4fv(this.addr,!1,e),Ar(i,e)}else{if(Tr(i,n))return;br.set(n),t.uniformMatrix4fv(this.addr,!1,br),Ar(i,n)}}function Ur(t,e){const i=this.cache;i[0]!==e&&(t.uniform1i(this.addr,e),i[0]=e)}function Fr(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y||(t.uniform2i(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(Tr(i,e))return;t.uniform2iv(this.addr,e),Ar(i,e)}}function zr(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z||(t.uniform3i(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else{if(Tr(i,e))return;t.uniform3iv(this.addr,e),Ar(i,e)}}function Br(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z&&i[3]===e.w||(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(Tr(i,e))return;t.uniform4iv(this.addr,e),Ar(i,e)}}function kr(t,e){const i=this.cache;i[0]!==e&&(t.uniform1ui(this.addr,e),i[0]=e)}function Hr(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y||(t.uniform2ui(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(Tr(i,e))return;t.uniform2uiv(this.addr,e),Ar(i,e)}}function Gr(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z||(t.uniform3ui(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else{if(Tr(i,e))return;t.uniform3uiv(this.addr,e),Ar(i,e)}}function Vr(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z&&i[3]===e.w||(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(Tr(i,e))return;t.uniform4uiv(this.addr,e),Ar(i,e)}}function Wr(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture2D(e||gr,r)}function Xr(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(e||_r,r)}function jr(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTextureCube(e||yr,r)}function Yr(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture2DArray(e||vr,r)}function qr(t,e){t.uniform1fv(this.addr,e)}function Zr(t,e){const i=Er(e,this.size,2);t.uniform2fv(this.addr,i)}function Jr(t,e){const i=Er(e,this.size,3);t.uniform3fv(this.addr,i)}function Kr(t,e){const i=Er(e,this.size,4);t.uniform4fv(this.addr,i)}function Qr(t,e){const i=Er(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,i)}function $r(t,e){const i=Er(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,i)}function ts(t,e){const i=Er(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,i)}function es(t,e){t.uniform1iv(this.addr,e)}function is(t,e){t.uniform2iv(this.addr,e)}function ns(t,e){t.uniform3iv(this.addr,e)}function rs(t,e){t.uniform4iv(this.addr,e)}function ss(t,e){t.uniform1uiv(this.addr,e)}function os(t,e){t.uniform2uiv(this.addr,e)}function as(t,e){t.uniform3uiv(this.addr,e)}function ls(t,e){t.uniform4uiv(this.addr,e)}function cs(t,e,i){const n=this.cache,r=e.length,s=Rr(i,r);Tr(n,s)||(t.uniform1iv(this.addr,s),Ar(n,s));for(let t=0;t!==r;++t)i.setTexture2D(e[t]||gr,s[t])}function hs(t,e,i){const n=this.cache,r=e.length,s=Rr(i,r);Tr(n,s)||(t.uniform1iv(this.addr,s),Ar(n,s));for(let t=0;t!==r;++t)i.setTexture3D(e[t]||_r,s[t])}function us(t,e,i){const n=this.cache,r=e.length,s=Rr(i,r);Tr(n,s)||(t.uniform1iv(this.addr,s),Ar(n,s));for(let t=0;t!==r;++t)i.setTextureCube(e[t]||yr,s[t])}function ds(t,e,i){const n=this.cache,r=e.length,s=Rr(i,r);Tr(n,s)||(t.uniform1iv(this.addr,s),Ar(n,s));for(let t=0;t!==r;++t)i.setTexture2DArray(e[t]||vr,s[t])}class ps{constructor(t,e,i){this.id=t,this.addr=i,this.cache=[],this.setValue=function(t){switch(t){case 5126:return Cr;case 35664:return Lr;case 35665:return Pr;case 35666:return Ir;case 35674:return Or;case 35675:return Dr;case 35676:return Nr;case 5124:case 35670:return Ur;case 35667:case 35671:return Fr;case 35668:case 35672:return zr;case 35669:case 35673:return Br;case 5125:return kr;case 36294:return Hr;case 36295:return Gr;case 36296:return Vr;case 35678:case 36198:case 36298:case 36306:case 35682:return Wr;case 35679:case 36299:case 36307:return Xr;case 35680:case 36300:case 36308:case 36293:return jr;case 36289:case 36303:case 36311:case 36292:return Yr}}(e.type)}}class fs{constructor(t,e,i){this.id=t,this.addr=i,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return qr;case 35664:return Zr;case 35665:return Jr;case 35666:return Kr;case 35674:return Qr;case 35675:return $r;case 35676:return ts;case 5124:case 35670:return es;case 35667:case 35671:return is;case 35668:case 35672:return ns;case 35669:case 35673:return rs;case 5125:return ss;case 36294:return os;case 36295:return as;case 36296:return ls;case 35678:case 36198:case 36298:case 36306:case 35682:return cs;case 35679:case 36299:case 36307:return hs;case 35680:case 36300:case 36308:case 36293:return us;case 36289:case 36303:case 36311:case 36292:return ds}}(e.type)}}class ms{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,i){const n=this.seq;for(let r=0,s=n.length;r!==s;++r){const s=n[r];s.setValue(t,e[s.id],i)}}}const gs=/(\w+)(\])?(\[|\.)?/g;function vs(t,e){t.seq.push(e),t.map[e.id]=e}function _s(t,e,i){const n=t.name,r=n.length;for(gs.lastIndex=0;;){const s=gs.exec(n),o=gs.lastIndex;let a=s[1];const l="]"===s[2],c=s[3];if(l&&(a|=0),void 0===c||"["===c&&o+2===r){vs(i,void 0===c?new ps(a,t,e):new fs(a,t,e));break}{let t=i.map[a];void 0===t&&(t=new ms(a),vs(i,t)),i=t}}}class ys{constructor(t,e){this.seq=[],this.map={};const i=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let n=0;n<i;++n){const i=t.getActiveUniform(e,n);_s(i,t.getUniformLocation(e,i.name),this)}}setValue(t,e,i,n){const r=this.map[e];void 0!==r&&r.setValue(t,i,n)}setOptional(t,e,i){const n=e[i];void 0!==n&&this.setValue(t,i,n)}static upload(t,e,i,n){for(let r=0,s=e.length;r!==s;++r){const s=e[r],o=i[s.id];!1!==o.needsUpdate&&s.setValue(t,o.value,n)}}static seqWithValue(t,e){const i=[];for(let n=0,r=t.length;n!==r;++n){const r=t[n];r.id in e&&i.push(r)}return i}}function xs(t,e,i){const n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),n}let Ms=0;function bs(t,e,i){const n=t.getShaderParameter(e,t.COMPILE_STATUS),r=t.getShaderInfoLog(e).trim();if(n&&""===r)return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const n=parseInt(s[1]);return i.toUpperCase()+"\n\n"+r+"\n\n"+function(t,e){const i=t.split("\n"),n=[],r=Math.max(e-6,0),s=Math.min(e+6,i.length);for(let t=r;t<s;t++){const r=t+1;n.push(`${r===e?">":" "} ${r}: ${i[t]}`)}return n.join("\n")}(t.getShaderSource(e),n)}return r}function ws(t,e){const i=function(t){switch(t){case xt:return["Linear","( value )"];case Mt:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function Ss(t,e){let i;switch(e){case 1:i="Linear";break;case 2:i="Reinhard";break;case 3:i="OptimizedCineon";break;case 4:i="ACESFilmic";break;case 5:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),i="Linear"}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function Es(t){return""!==t}function Ts(t,e){const i=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,i).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function As(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Rs=/^[ \t]*#include +<([\w\d./]+)>/gm;function Cs(t){return t.replace(Rs,Ls)}function Ls(t,e){const i=Un[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return Cs(i)}const Ps=/#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 Is(t){return t.replace(Ps,Os)}function Os(t,e,i,n){let r="";for(let t=parseInt(e);t<parseInt(i);t++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return r}function Ds(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function Ns(t,e,i,n){const r=t.getContext(),s=i.defines;let o=i.vertexShader,a=i.fragmentShader;const l=function(t){let e="SHADOWMAP_TYPE_BASIC";return 1===t.shadowMapType?e="SHADOWMAP_TYPE_PCF":2===t.shadowMapType?e="SHADOWMAP_TYPE_PCF_SOFT":3===t.shadowMapType&&(e="SHADOWMAP_TYPE_VSM"),e}(i),c=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case _:case y:e="ENVMAP_TYPE_CUBE";break;case b:e="ENVMAP_TYPE_CUBE_UV"}return e}(i),h=function(t){let e="ENVMAP_MODE_REFLECTION";t.envMap&&t.envMapMode===y&&(e="ENVMAP_MODE_REFRACTION");return e}(i),u=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(i),d=function(t){const e=t.envMapCubeUVHeight;if(null===e)return null;const i=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,i),112)),texelHeight:n,maxMip:i}}(i),p=i.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Es).join("\n")}(i),f=function(t){const e=[];for(const i in t){const n=t[i];!1!==n&&e.push("#define "+i+" "+n)}return e.join("\n")}(s),m=r.createProgram();let g,v,x=i.glslVersion?"#version "+i.glslVersion+"\n":"";i.isRawShaderMaterial?(g=[f].filter(Es).join("\n"),g.length>0&&(g+="\n"),v=[p,f].filter(Es).join("\n"),v.length>0&&(v+="\n")):(g=[Ds(i),"#define SHADER_NAME "+i.shaderName,f,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"",i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+h:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.morphColors&&i.isWebGL2?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Es).join("\n"),v=[p,Ds(i),"#define SHADER_NAME "+i.shaderName,f,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.envMap?"#define "+h:"",i.envMap?"#define "+u:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescence?"#define USE_IR
2IDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==i.toneMapping?"#define TONE_MAPPING":"",0!==i.toneMapping?Un.tonemapping_pars_fragment:"",0!==i.toneMapping?Ss("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",Un.encodings_pars_fragment,ws("linearToOutputTexel",i.outputEncoding),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Es).join("\n")),o=Cs(o),o=Ts(o,i),o=As(o,i),a=Cs(a),a=Ts(a,i),a=As(a,i),o=Is(o),a=Is(a),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(x="#version 300 es\n",g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in",i.glslVersion===Tt?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===Tt?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+v);const M=x+g+o,w=x+v+a,S=xs(r,r.VERTEX_SHADER,M),E=xs(r,r.FRAGMENT_SHADER,w);if(r.attachShader(m,S),r.attachShader(m,E),void 0!==i.index0AttributeName?r.bindAttribLocation(m,0,i.index0AttributeName):!0===i.morphTargets&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),t.debug.checkShaderErrors){const t=r.getProgramInfoLog(m).trim(),e=r.getShaderInfoLog(S).trim(),i=r.getShaderInfoLog(E).trim();let n=!0,s=!0;if(!1===r.getProgramParameter(m,r.LINK_STATUS)){n=!1;const e=bs(r,S,"vertex"),i=bs(r,E,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(m,r.VALIDATE_STATUS)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+i)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):""!==e&&""!==i||(s=!1);s&&(this.diagnostics={runnable:n,programLog:t,vertexShader:{log:e,prefix:g},fragmentShader:{log:i,prefix:v}})}let T,A;return r.deleteShader(S),r.deleteShader(E),this.getUniforms=function(){return void 0===T&&(T=new ys(r,m)),T},this.getAttributes=function(){return void 0===A&&(A=function(t,e){const i={},n=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r<n;r++){const n=t.getActiveAttrib(e,r),s=n.name;let o=1;n.type===t.FLOAT_MAT2&&(o=2),n.type===t.FLOAT_MAT3&&(o=3),n.type===t.FLOAT_MAT4&&(o=4),i[s]={type:n.type,location:t.getAttribLocation(e,s),locationSize:o}}return i}(r,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(m),this.program=void 0},this.name=i.shaderName,this.id=Ms++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=S,this.fragmentShader=E,this}let Us=0;class Fs{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,i=t.fragmentShader,n=this._getShaderStage(e),r=this._getShaderStage(i),s=this._getShaderCacheForMaterial(t);return!1===s.has(n)&&(s.add(n),n.usedTimes++),!1===s.has(r)&&(s.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const t of e)t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let i=e.get(t);return void 0===i&&(i=new Set,e.set(t,i)),i}_getShaderStage(t){const e=this.shaderCache;let i=e.get(t);return void 0===i&&(i=new zs(t),e.set(t,i)),i}}class zs{constructor(t){this.id=Us++,this.code=t,this.usedTimes=0}}function Bs(t,e,i,n,r,s,o){const a=new si,l=new Fs,c=[],h=r.isWebGL2,u=r.logarithmicDepthBuffer,d=r.vertexTextures;let p=r.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};return{getParameters:function(s,a,c,m,g){const v=m.fog,_=g.geometry,y=s.isMeshStandardMaterial?m.environment:null,x=(s.isMeshStandardMaterial?i:e).get(s.envMap||y),M=x&&x.mapping===b?x.image.height:null,w=f[s.type];null!==s.precision&&(p=r.getMaxPrecision(s.precision),p!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",
vendor: 22,032 bytes, line 2
2s.precision,"not supported, using",p,"instead."));const S=_.morphAttributes.position||_.morphAttributes.normal||_.morphAttributes.color,E=void 0!==S?S.length:0;let T,A,R,C,L=0;if(void 0!==_.morphAttributes.position&&(L=1),void 0!==_.morphAttributes.normal&&(L=2),void 0!==_.morphAttributes.color&&(L=3),w){const t=zn[w];T=t.vertexShader,A=t.fragmentShader}else T=s.vertexShader,A=s.fragmentShader,l.update(s),R=l.getVertexShaderID(s),C=l.getFragmentShaderID(s);const P=t.getRenderTarget(),I=s.alphaTest>0,O=s.clearcoat>0,D=s.iridescence>0;return{isWebGL2:h,shaderID:w,shaderName:s.type,vertexShader:T,fragmentShader:A,defines:s.defines,customVertexShaderID:R,customFragmentShaderID:C,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:p,instancing:!0===g.isInstancedMesh,instancingColor:!0===g.isInstancedMesh&&null!==g.instanceColor,supportsVertexTextures:d,outputEncoding:null===P?t.outputEncoding:!0===P.isXRRenderTarget?P.texture.encoding:xt,map:!!s.map,matcap:!!s.matcap,envMap:!!x,envMapMode:x&&x.mapping,envMapCubeUVHeight:M,lightMap:!!s.lightMap,aoMap:!!s.aoMap,emissiveMap:!!s.emissiveMap,bumpMap:!!s.bumpMap,normalMap:!!s.normalMap,objectSpaceNormalMap:1===s.normalMapType,tangentSpaceNormalMap:0===s.normalMapType,decodeVideoTexture:!!s.map&&!0===s.map.isVideoTexture&&s.map.encoding===Mt,clearcoat:O,clearcoatMap:O&&!!s.clearcoatMap,clearcoatRoughnessMap:O&&!!s.clearcoatRoughnessMap,clearcoatNormalMap:O&&!!s.clearcoatNormalMap,iridescence:D,iridescenceMap:D&&!!s.iridescenceMap,iridescenceThicknessMap:D&&!!s.iridescenceThicknessMap,displacementMap:!!s.displacementMap,roughnessMap:!!s.roughnessMap,metalnessMap:!!s.metalnessMap,specularMap:!!s.specularMap,specularIntensityMap:!!s.specularIntensityMap,specularColorMap:!!s.specularColorMap,opaque:!1===s.transparent&&1===s.blending,alphaMap:!!s.alphaMap,alphaTest:I,gradientMap:!!s.gradientMap,sheen:s.sheen>0,sheenColorMap:!!s.sheenColorMap,sheenRoughnessMap:!!s.sheenRoughnessMap,transmission:s.transmission>0,transmissionMap:!!s.transmissionMap,thicknessMap:!!s.thicknessMap,combine:s.combine,vertexTangents:!!s.normalMap&&!!_.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!_.attributes.color&&4===_.attributes.color.itemSize,vertexUvs:!!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatMap||s.clearcoatRoughnessMap||s.clearcoatNormalMap||s.iridescenceMap||s.iridescenceThicknessMap||s.displacementMap||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheenColorMap||s.sheenRoughnessMap),uvsVertexOnly:!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatNormalMap||s.iridescenceMap||s.iridescenceThicknessMap||s.transmission>0||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheen>0||s.sheenColorMap||s.sheenRoughnessMap||!s.displacementMap),fog:!!v,useFog:!0===s.fog,fogExp2:v&&v.isFogExp2,flatShading:!!s.flatShading,sizeAttenuation:s.sizeAttenuation,logarithmicDepthBuffer:u,skinning:!0===g.isSkinnedMesh,morphTargets:void 0!==_.morphAttributes.position,morphNormals:void 0!==_.morphAttributes.normal,morphColors:void 0!==_.morphAttributes.color,morphTargetsCount:E,morphTextureStride:L,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numSpotLightMaps:a.spotLightMap.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numSpotLightShadowsWithMaps:a.numSpotLightShadowsWithMaps,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.length>0,shadowMapType:t.shadowMap.type,toneMapping:s.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:1===s.side,useDepthPacking:!!s.depthPacking,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:s.extensions&&s.extensions.derivatives,extensionFragDepth:s.extensions&&s.extensions.fragDepth,extensionDrawBuffers:s.extensions&&s.extensions.drawBuffers,extensionShaderTextureLOD:s.extensions&&s.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||n.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const i=[];if(e.shaderID?i.push(e.shaderID):(i.push(e.customVertexShaderID),i.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)i.push(t),i.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputEncoding),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.combine),t.push(e.vertexUvs),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(i,e),function(t,e){a.disableAll(),e.isWebGL2&&a.enable(0);e.supportsVertexTextures&&a.enable(1);e.instancing&&a.enable(2);e.instancingColor&&a.enable(3);e.map&&a.enable(4);e.matcap&&a.enable(5);e.envMap&&a.enable(6);e.lightMap&&a.enable(7);e.aoMap&&a.enable(8);e.emissiveMap&&a.enable(9);e.bumpMap&&a.enable(10);e.normalMap&&a.enable(11);e.objectSpaceNormalMap&&a.enable(12);e.tangentSpaceNormalMap&&a.enable(13);e.clearcoat&&a.enable(14);e.clearcoatMap&&a.enable(15);e.clearcoatRoughnessMap&&a.enable(16);e.clearcoatNormalMap&&a.enable(17);e.iridescence&&a.enable(18);e.iridescenceMap&&a.enable(19);e.iridescenceThicknessMap&&a.enable(20);e.displacementMap&&a.enable(21);e.specularMap&&a.enable(22);e.roughnessMap&&a.enable(23);e.metalnessMap&&a.enable(24);e.gradientMap&&a.enable(25);e.alphaMap&&a.enable(26);e.alphaTest&&a.enable(27);e.vertexColors&&a.enable(28);e.vertexAlphas&&a.enable(29);e.vertexUvs&&a.enable(30);e.vertexTangents&&a.enable(31);e.uvsVertexOnly&&a.enable(32);t.push(a.mask),a.disableAll(),e.fog&&a.enable(0);e.useFog&&a.enable(1);e.flatShading&&a.enable(2);e.logarithmicDepthBuffer&&a.enable(3);e.skinning&&a.enable(4);e.morphTargets&&a.enable(5);e.morphNormals&&a.enable(6);e.morphColors&&a.enable(7);e.premultipliedAlpha&&a.enable(8);e.shadowMapEnabled&&a.enable(9);e.physicallyCorrectLights&&a.enable(10);e.doubleSided&&a.enable(11);e.flipSided&&a.enable(12);e.useDepthPacking&&a.enable(13);e.dithering&&a.enable(14);e.specularIntensityMap&&a.enable(15);e.specularColorMap&&a.enable(16);e.transmission&&a.enable(17);e.transmissionMap&&a.enable(18);e.thicknessMap&&a.enable(19);e.sheen&&a.enable(20);e.sheenColorMap&&a.enable(21);e.sheenRoughnessMap&&a.enable(22);e.decodeVideoTexture&&a.enable(23);e.opaque&&a.enable(24);t.push(a.mask)}(i,e),i.push(t.outputEncoding)),i.push(e.customProgramCacheKey),i.join()},getUniforms:function(t){const e=f[t.type];let i;if(e){const t=zn[e];i=_n.clone(t.uniforms)}else i=t.uniforms;return i},acquireProgram:function(e,i){let n;for(let t=0,e=c.length;t<e;t++){const e=c[t];if(e.cacheKey===i){n=e,++n.usedTimes;break}}return void 0===n&&(n=new Ns(t,i,e,s),c.push(n)),n},releaseProgram:function(t){if(0===--t.usedTimes){const e=c.indexOf(t);c[e]=c[c.length-1],c.pop(),t.destroy()}},releaseShaderCache:function(t){l.remove(t)},programs:c,dispose:function(){l.dispose()}}}function ks(){let t=new WeakMap;return{get:function(e){let i=t.get(e);return void 0===i&&(i={},t.set(e,i)),i},remove:function(e){t.delete(e)},update:function(e,i,n){t.get(e)[i]=n},dispose:function(){t=new WeakMap}}}function Hs(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Gs(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Vs(){const t=[];let e=0;const i=[],n=[],r=[];function s(i,n,r,s,o,a){let l=t[e];return void 0===l?(l={id:i.id,object:i,geometry:n,material:r,groupOrder:s,renderOrder:i.renderOrder,z:o,group:a},t[e]=l):(l.id=i.id,l.object=i,l.geometry=n,l.material=r,l.groupOrder=s,l.renderOrder=i.renderOrder,l.z=o,l.group=a),e++,l}return{opaque:i,transmissive:n,transparent:r,init:function(){e=0,i.length=0,n.length=0,r.length=0},push:function(t,e,o,a,l,c){const h=s(t,e,o,a,l,c);o.transmission>0?n.push(h):!0===o.transparent?r.push(h):i.push(h)},unshift:function(t,e,o,a,l,c){const h=s(t,e,o,a,l,c);o.transmission>0?n.unshift(h):!0===o.transparent?r.unshift(h):i.unshift(h)},finish:function(){for(let i=e,n=t.length;i<n;i++){const e=t[i];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null}},sort:function(t,e){i.length>1&&i.sort(t||Hs),n.length>1&&n.sort(e||Gs),r.length>1&&r.sort(e||Gs)}}}function Ws(){let t=new WeakMap;return{get:function(e,i){const n=t.get(e);let r;return void 0===n?(r=new Vs,t.set(e,[r])):i>=n.length?(r=new Vs,n.push(r)):r=n[i],r},dispose:function(){t=new WeakMap}}}function Xs(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":i={direction:new _e,color:new oe};break;case"SpotLight":i={position:new _e,direction:new _e,color:new oe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new _e,color:new oe,distance:0,decay:0};break;case"HemisphereLight":i={direction:new _e,skyColor:new oe,groundColor:new oe};break;case"RectAreaLight":i={color:new oe,position:new _e,halfWidth:new _e,halfHeight:new _e}}return t[e.id]=i,i}}}let js=0;function Ys(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function qs(t,e){const i=new Xs,n=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vt};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vt,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=i,i}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let t=0;t<9;t++)r.probe.push(new _e);const s=new _e,o=new qe,a=new qe;return{setup:function(s,o){let a=0,l=0,c=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let h=0,u=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,y=0;s.sort(Ys);const x=!0!==o?Math.PI:1;for(let t=0,e=s.length;t<e;t++){const e=s[t],o=e.color,M=e.intensity,b=e.distance,w=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)a+=o.r*M*x,l+=o.g*M*x,c+=o.b*M*x;else if(e.isLightProbe)for(let t=0;t<9;t++)r.probe[t].addScaledVector(e.sh.coefficients[t],M);else if(e.isDirectionalLight){const t=i.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*x),e.castShadow){const t=e.shadow,i=n.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,r.directionalShadow[h]=i,r.directionalShadowMap[h]=w,r.directionalShadowMatrix[h]=e.shadow.matrix,m++}r.directional[h]=t,h++}else if(e.isSpotLight){const t=i.get(e);t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(o).multiplyScalar(M*x),t.distance=b,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,r.spot[d]=t;const s=e.shadow;if(e.map&&(r.spotLightMap[_]=e.map,_++,s.updateMatrices(e),e.castShadow&&y++),r.spotLightMatrix[d]=s.matrix,e.castShadow){const t=n.get(e);t.shadowBias=s.bias,t.shadowNormalBias=s.normalBias,t.shadowRadius=s.radius,t.shadowMapSize=s.mapSize,r.spotShadow[d]=t,r.spotShadowMap[d]=w,v++}d++}else if(e.isRectAreaLight){const t=i.get(e);t.color.copy(o).multiplyScalar(M),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),r.rectArea[p]=t,p++}else if(e.isPointLight){const t=i.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*x),t.distance=e.distance,t.decay=e.decay,e.castShadow){const t=e.shadow,i=n.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,i.shadowCameraNear=t.camera.near,i.shadowCameraFar=t.camera.far,r.pointShadow[u]=i,r.pointShadowMap[u]=w,r.pointShadowMatrix[u]=e.shadow.matrix,g++}r.point[u]=t,u++}else if(e.isHemisphereLight){const t=i.get(e);t.skyColor.copy(e.color).multiplyScalar(M*x),t.groundColor.copy(e.groundColor).multiplyScalar(M*x),r.hemi[f]=t,f++}}p>0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=Fn.LTC_FLOAT_1,r.rectAreaLTC2=Fn.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=Fn.LTC_HALF_1,r.rectAreaLTC2=Fn.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=a,r.ambient[1]=l,r.ambient[2]=c;const M=r.hash;M.directionalLength===h&&M.pointLength===u&&M.spotLength===d&&M.rectAreaLength===p&&M.hemiLength===f&&M.numDirectionalShadows===m&&M.numPointShadows===g&&M.numSpotShadows===v&&M.numSpotMaps===_||(r.directional.length=h,r.spot.length=d,r.rectArea.length=p,r.point.length=u,r.hemi.length=f,r.directionalShadow.length=m,r.directionalShadowMap.length=m,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=m,r.pointShadowMatrix.length=g,r.spotLightMatrix.length=v+_-y,r.spotLightMap.length=_,r.numSpotLightShadowsWithMaps=y,M.directionalLength=h,M.pointLength=u,M.spotLength=d,M.rectAreaLength=p,M.hemiLength=f,M.numDirectionalShadows=m,M.numPointShadows=g,M.numSpotShadows=v,M.numSpotMaps=_,r.version=js++)},setupView:function(t,e){let i=0,n=0,l=0,c=0,h=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e<d;e++){const d=t[e];if(d.isDirectionalLight){const t=r.directional[i];t.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(s),t.direction.transformDirection(u),i++}else if(d.isSpotLight){const t=r.spot[l];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(u),t.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(s),t.direction.transformDirection(u),l++}else if(d.isRectAreaLight){const t=r.rectArea[c];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(u),a.identity(),o.copy(d.matrixWorld),o.premultiply(u),a.extractRotation(o),t.halfWidth.set(.5*d.width,0,0),t.halfHeight.set(0,.5*d.height,0),t.halfWidth.applyMatrix4(a),t.halfHeight.applyMatrix4(a),c++}else if(d.isPointLight){const t=r.point[n];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(u),n++}else if(d.isHemisphereLight){const t=r.hemi[h];t.direction.setFromMatrixPosition(d.matrixWorld),t.direction.transformDirection(u),h++}}},state:r}}function Zs(t,e){const i=new qs(t,e),n=[],r=[];return{init:function(){n.length=0,r.length=0},state:{lightsArray:n,shadowsArray:r,lights:i},setupLights:function(t){i.setup(n,t)},setupLightsView:function(t){i.setupView(n,t)},pushLight:function(t){n.push(t)},pushShadow:function(t){r.push(t)}}}function Js(t,e){let i=new WeakMap;return{get:function(n,r=0){const s=i.get(n);let o;return void 0===s?(o=new Zs(t,e),i.set(n,[o])):r>=s.length?(o=new Zs(t,e),s.push(o)):o=s[r],o},dispose:function(){i=new WeakMap}}}class Ks extends Ii{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class Qs extends Ii{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new _e,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function $s(t,e,i){let n=new In;const r=new Vt,s=new Vt,o=new pe,a=new Ks({depthPacking:3201}),l=new Qs,c={},h=i.maxTextureSize,u={0:1,1:0,2:2},d=new yn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vt},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\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}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;const f=new Yi;f.setAttribute("position",new Ui(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new dn(f,d),g=this;function v(i,n){const s=e.update(m);d.defines.VSM_SAMPLES!==i.blurSamples&&(d.defines.VSM_SAMPLES=i.blurSamples,p.defines.VSM_SAMPLES=i.blurSamples,d.needsUpdate=!0,p.needsUpdate=!0),null===i.mapPass&&(i.mapPass=new fe(r.x,r.y)),d.uniforms.shadow_pass.value=i.map.texture,d.uniforms.resolution.value=i.mapSize,d.uniforms.radius.value=i.radius,t.setRenderTarget(i.mapPass),t.clear(),t.renderBufferDirect(n,null,s,d,m,null),p.uniforms.shadow_pass.value=i.mapPass.texture,p.uniforms.resolution.value=i.mapSize,p.uniforms.radius.value=i.radius,t.setRenderTarget(i.map),t.clear(),t.renderBufferDirect(n,null,s,p,m,null)}function _(e,i,n,r,s,o){let h=null;const d=!0===n.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(h=void 0!==d?d:!0===n.isPointLight?l:a,t.localClippingEnabled&&!0===i.clipShadows&&Array.isArray(i.clippingPlanes)&&0!==i.clippingPlanes.length||i.displacementMap&&0!==i.displacementScale||i.alphaMap&&i.alphaTest>0||i.map&&i.alphaTest>0){const t=h.uuid,e=i.uuid;let n=c[t];void 0===n&&(n={},c[t]=n);let r=n[e];void 0===r&&(r=h.clone(),n[e]=r),h=r}return h.visible=i.visible,h.wireframe=i.wireframe,h.side=3===o?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:u[i.side],h.alphaMap=i.alphaMap,h.alphaTest=i.alphaTest,h.map=i.map,h.clipShadows=i.clipShadows,h.clippingPlanes=i.clippingPlanes,h.clipIntersection=i.clipIntersection,h.displacementMap=i.displacementMap,h.displacementScale=i.displacementScale,h.displacementBias=i.displacementBias,h.wireframeLinewidth=i.wireframeLinewidth,h.linewidth=i.linewidth,!0===n.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(n.matrixWorld),h.nearDistance=r,h.farDistance=s),h}function y(i,r,s,o,a){if(!1===i.visible)return;if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&3===a)&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,i.matrixWorld);const n=e.update(i),r=i.material;if(Array.isArray(r)){const e=n.groups;for(let l=0,c=e.length;l<c;l++){const c=e[l],h=r[c.materialIndex];if(h&&h.visible){const e=_(i,h,o,s.near,s.far,a);t.renderBufferDirect(s,null,n,e,i,c)}}}else if(r.visible){const e=_(i,r,o,s.near,s.far,a);t.renderBufferDirect(s,null,n,e,i,null)}}const l=i.children;for(let t=0,e=l.length;t<e;t++)y(l[t],r,s,o,a)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(e,i,a){if(!1===g.enabled)return;if(!1===g.autoUpdate&&!1===g.needsUpdate)return;if(0===e.length)return;const l=t.getRenderTarget(),c=t.getActiveCubeFace(),u=t.getActiveMipmapLevel(),d=t.state;d.setBlending(0),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(let l=0,c=e.length;l<c;l++){const c=e[l],u=c.shadow;if(void 0===u){console.warn("THREE.WebGLShadowMap:",c,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;r.copy(u.mapSize);const p=u.getFrameExtents();
vendor: 10,069 bytes, line 2
2if(r.multiply(p),s.copy(u.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/p.x),r.x=s.x*p.x,u.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/p.y),r.y=s.y*p.y,u.mapSize.y=s.y)),null===u.map){const t=3!==this.type?{minFilter:T,magFilter:T}:{};u.map=new fe(r.x,r.y,t),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const f=u.getViewportCount();for(let t=0;t<f;t++){const e=u.getViewport(t);o.set(s.x*e.x,s.y*e.y,s.x*e.z,s.y*e.w),d.viewport(o),u.updateMatrices(c,t),n=u.getFrustum(),y(i,a,u.camera,c,this.type)}!0!==u.isPointLightShadow&&3===this.type&&v(u,a),u.needsUpdate=!1}g.needsUpdate=!1,t.setRenderTarget(l,c,u)}}function to(t,e,i){const v=i.isWebGL2;const _=new function(){let e=!1;const i=new pe;let n=null;const r=new pe(0,0,0,0);return{setMask:function(i){n===i||e||(t.colorMask(i,i,i,i),n=i)},setLocked:function(t){e=t},setClear:function(e,n,s,o,a){!0===a&&(e*=o,n*=o,s*=o),i.set(e,n,s,o),!1===r.equals(i)&&(t.clearColor(e,n,s,o),r.copy(i))},reset:function(){e=!1,n=null,r.set(-1,0,0,0)}}},y=new function(){let e=!1,i=null,n=null,r=null;return{setTest:function(e){e?tt(t.DEPTH_TEST):et(t.DEPTH_TEST)},setMask:function(n){i===n||e||(t.depthMask(n),i=n)},setFunc:function(e){if(n!==e){switch(e){case 0:t.depthFunc(t.NEVER);break;case 1:t.depthFunc(t.ALWAYS);break;case 2:t.depthFunc(t.LESS);break;case 3:default:t.depthFunc(t.LEQUAL);break;case 4:t.depthFunc(t.EQUAL);break;case 5:t.depthFunc(t.GEQUAL);break;case 6:t.depthFunc(t.GREATER);break;case 7:t.depthFunc(t.NOTEQUAL)}n=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,i=null,n=null,r=null}}},x=new function(){let e=!1,i=null,n=null,r=null,s=null,o=null,a=null,l=null,c=null;return{setTest:function(i){e||(i?tt(t.STENCIL_TEST):et(t.STENCIL_TEST))},setMask:function(n){i===n||e||(t.stencilMask(n),i=n)},setFunc:function(e,i,o){n===e&&r===i&&s===o||(t.stencilFunc(e,i,o),n=e,r=i,s=o)},setOp:function(e,i,n){o===e&&a===i&&l===n||(t.stencilOp(e,i,n),o=e,a=i,l=n)},setLocked:function(t){e=t},setClear:function(e){c!==e&&(t.clearStencil(e),c=e)},reset:function(){e=!1,i=null,n=null,r=null,s=null,o=null,a=null,l=null,c=null}}},M=new WeakMap,b=new WeakMap;let w={},S={},E=new WeakMap,T=[],A=null,R=!1,C=null,L=null,P=null,I=null,O=null,D=null,N=null,U=!1,F=null,z=null,B=null,k=null,H=null;const G=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let V=!1,W=0;const X=t.getParameter(t.VERSION);-1!==X.indexOf("WebGL")?(W=parseFloat(/^WebGL (\d)/.exec(X)[1]),V=W>=1):-1!==X.indexOf("OpenGL ES")&&(W=parseFloat(/^OpenGL ES (\d)/.exec(X)[1]),V=W>=2);let j=null,Y={};const q=t.getParameter(t.SCISSOR_BOX),Z=t.getParameter(t.VIEWPORT),J=(new pe).fromArray(q),K=(new pe).fromArray(Z);function Q(e,i,n){const r=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let e=0;e<n;e++)t.texImage2D(i+e,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r);return s}const $={};function tt(e){!0!==w[e]&&(t.enable(e),w[e]=!0)}function et(e){!1!==w[e]&&(t.disable(e),w[e]=!1)}$[t.TEXTURE_2D]=Q(t.TEXTURE_2D,t.TEXTURE_2D,1),$[t.TEXTURE_CUBE_MAP]=Q(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),_.setClear(0,0,0,1),y.setClear(1),x.setClear(0),tt(t.DEPTH_TEST),y.setFunc(3),st(!1),ot(1),tt(t.CULL_FACE),rt(0);const it={[n]:t.FUNC_ADD,[r]:t.FUNC_SUBTRACT,[s]:t.FUNC_REVERSE_SUBTRACT};if(v)it[103]=t.MIN,it[104]=t.MAX;else{const t=e.get("EXT_blend_minmax");null!==t&&(it[103]=t.MIN_EXT,it[104]=t.MAX_EXT)}const nt={[o]:t.ZERO,[a]:t.ONE,[l]:t.SRC_COLOR,[h]:t.SRC_ALPHA,[g]:t.SRC_ALPHA_SATURATE,[f]:t.DST_COLOR,[d]:t.DST_ALPHA,[c]:t.ONE_MINUS_SRC_COLOR,[u]:t.ONE_MINUS_SRC_ALPHA,[m]:t.ONE_MINUS_DST_COLOR,[p]:t.ONE_MINUS_DST_ALPHA};function rt(e,i,r,s,o,a,l,c){if(0!==e){if(!1===R&&(tt(t.BLEND),R=!0),5===e)o=o||i,a=a||r,l=l||s,i===L&&o===O||(t.blendEquationSeparate(it[i],it[o]),L=i,O=o),r===P&&s===I&&a===D&&l===N||(t.blendFuncSeparate(nt[r],nt[s],nt[a],nt[l]),P=r,I=s,D=a,N=l),C=e,U=!1;else if(e!==C||c!==U){if(L===n&&O===n||(t.blendEquation(t.FUNC_ADD),L=n,O=n),c)switch(e){case 1:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.ONE,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case 1:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}P=null,I=null,D=null,N=null,C=e,U=c}}else!0===R&&(et(t.BLEND),R=!1)}function st(e){F!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),F=e)}function ot(e){0!==e?(tt(t.CULL_FACE),e!==z&&(1===e?t.cullFace(t.BACK):2===e?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):et(t.CULL_FACE),z=e}function at(e,i,n){e?(tt(t.POLYGON_OFFSET_FILL),k===i&&H===n||(t.polygonOffset(i,n),k=i,H=n)):et(t.POLYGON_OFFSET_FILL)}return{buffers:{color:_,depth:y,stencil:x},enable:tt,disable:et,bindFramebuffer:function(e,i){return S[e]!==i&&(t.bindFramebuffer(e,i),S[e]=i,v&&(e===t.DRAW_FRAMEBUFFER&&(S[t.FRAMEBUFFER]=i),e===t.FRAMEBUFFER&&(S[t.DRAW_FRAMEBUFFER]=i)),!0)},drawBuffers:function(n,r){let s=T,o=!1;if(n)if(s=E.get(r),void 0===s&&(s=[],E.set(r,s)),n.isWebGLMultipleRenderTargets){const e=n.texture;if(s.length!==e.length||s[0]!==t.COLOR_ATTACHMENT0){for(let i=0,n=e.length;i<n;i++)s[i]=t.COLOR_ATTACHMENT0+i;s.length=e.length,o=!0}}else s[0]!==t.COLOR_ATTACHMENT0&&(s[0]=t.COLOR_ATTACHMENT0,o=!0);else s[0]!==t.BACK&&(s[0]=t.BACK,o=!0);o&&(i.isWebGL2?t.drawBuffers(s):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(s))},useProgram:function(e){return A!==e&&(t.useProgram(e),A=e,!0)},setBlending:rt,setMaterial:function(e,i){2===e.side?et(t.CULL_FACE):tt(t.CULL_FACE);let n=1===e.side;i&&(n=!n),st(n),1===e.blending&&!1===e.transparent?rt(0):rt(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),y.setFunc(e.depthFunc),y.setTest(e.depthTest),y.setMask(e.depthWrite),_.setMask(e.colorWrite);const r=e.stencilWrite;x.setTest(r),r&&(x.setMask(e.stencilWriteMask),x.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),x.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),at(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?tt(t.SAMPLE_ALPHA_TO_COVERAGE):et(t.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:st,setCullFace:ot,setLineWidth:function(e){e!==B&&(V&&t.lineWidth(e),B=e)},setPolygonOffset:at,setScissorTest:function(e){e?tt(t.SCISSOR_TEST):et(t.SCISSOR_TEST)},activeTexture:function(e){void 0===e&&(e=t.TEXTURE0+G-1),j!==e&&(t.activeTexture(e),j=e)},bindTexture:function(e,i,n){void 0===n&&(n=null===j?t.TEXTURE0+G-1:j);let r=Y[n];void 0===r&&(r={type:void 0,texture:void 0},Y[n]=r),r.type===e&&r.texture===i||(j!==n&&(t.activeTexture(n),j=n),t.bindTexture(e,i||$[e]),r.type=e,r.texture=i)},unbindTexture:function(){const e=Y[j];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexImage3D:function(){try{t.compressedTexImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},updateUBOMapping:function(e,i){let n=b.get(i);void 0===n&&(n=new WeakMap,b.set(i,n));let r=n.get(e);void 0===r&&(r=t.getUniformBlockIndex(i,e.name),n.set(e,r))},uniformBlockBinding:function(e,i){const n=b.get(i).get(e);M.get(e)!==n&&(t.uniformBlockBinding(i,n,e.__bindingPointIndex),M.set(e,n))},texStorage2D:function(){try{t.texStorage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{t.texStorage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{t.texSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{t.texSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage3D:function(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===J.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),J.copy(e))},viewport:function(e){!1===K.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),K.copy(e))},reset:function(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),!0===v&&(t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),w={},j=null,Y={},S={},E=new WeakMap,T=[],A=null,R=!1,C=null,L=null,P=null,I=null,O=null,D=null,N=null,U=!1,F=null,z=null,B=null,k=null,H=null,J.set(0,0,t.canvas.width,t.canvas.height),K.set(0,0,t.canvas.width,t.canvas.height),_.reset(),y.reset(),x.reset()}}}
2function eo(t,e,i,n,r,s,o){const a=r.isWebGL2,l=r.maxTextures,c=r.maxCubemapSize,h=r.maxTextureSize,u=r.maxSamples,d=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,p="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let m;const g=new WeakMap;let v=!1;try{v="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function _(t,e){return v?new OffscreenCanvas(t,e):Zt("canvas")}function y(t,e,i,n){let r=1;if((t.width>n||t.height>n)&&(r=n/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const n=e?Bt:Math.floor,s=n(r*t.width),o=n(r*t.height);void 0===m&&(m=_(s,o));const a=i?_(s,o):m;a.width=s,a.height=o;return a.getContext("2d").drawImage(t,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+o+")."),a}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function x(t){return Ft(t.width)&&Ft(t.height)}function M(t,e){return t.generateMipmaps&&e&&t.minFilter!==T&&t.minFilter!==C}function b(e){t.generateMipmap(e)}function H(i,n,r,s,o=!1){if(!1===a)return n;if(null!==i){if(void 0!==t[i])return t[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let l=n;return n===t.RED&&(r===t.FLOAT&&(l=t.R32F),r===t.HALF_FLOAT&&(l=t.R16F),r===t.UNSIGNED_BYTE&&(l=t.R8)),n===t.RG&&(r===t.FLOAT&&(l=t.RG32F),r===t.HALF_FLOAT&&(l=t.RG16F),r===t.UNSIGNED_BYTE&&(l=t.RG8)),n===t.RGBA&&(r===t.FLOAT&&(l=t.RGBA32F),r===t.HALF_FLOAT&&(l=t.RGBA16F),r===t.UNSIGNED_BYTE&&(l=s===Mt&&!1===o?t.SRGB8_ALPHA8:t.RGBA8),r===t.UNSIGNED_SHORT_4_4_4_4&&(l=t.RGBA4),r===t.UNSIGNED_SHORT_5_5_5_1&&(l=t.RGB5_A1)),l!==t.R16F&&l!==t.R32F&&l!==t.RG16F&&l!==t.RG32F&&l!==t.RGBA16F&&l!==t.RGBA32F||e.get("EXT_color_buffer_float"),l}function G(t,e,i){return!0===M(t,i)||t.isFramebufferTexture&&t.minFilter!==T&&t.minFilter!==C?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function V(e){return e===T||e===A||e===R?t.NEAREST:t.LINEAR}function W(t){const e=t.target;e.removeEventListener("dispose",W),function(t){const e=n.get(t);if(void 0===e.__webglInit)return;const i=t.source,r=g.get(i);if(r){const n=r[e.__cacheKey];n.usedTimes--,0===n.usedTimes&&j(t),0===Object.keys(r).length&&g.delete(i)}n.remove(t)}(e),e.isVideoTexture&&f.delete(e)}function X(e){const i=e.target;i.removeEventListener("dispose",X),function(e){const i=e.texture,r=n.get(e),s=n.get(i);void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),o.memory.textures--);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(r.__webglFramebuffer[e]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[e]);else{if(t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer)for(let e=0;e<r.__webglColorRenderbuffer.length;e++)r.__webglColorRenderbuffer[e]&&t.deleteRenderbuffer(r.__webglColorRenderbuffer[e]);r.__webglDepthRenderbuffer&&t.deleteRenderbuffer(r.__webglDepthRenderbuffer)}if(e.isWebGLMultipleRenderTargets)for(let e=0,r=i.length;e<r;e++){const r=n.get(i[e]);r.__webglTexture&&(t.deleteTexture(r.__webglTexture),o.memory.textures--),n.remove(i[e])}n.remove(i),n.remove(e)}(i)}function j(e){const i=n.get(e);t.deleteTexture(i.__webglTexture);const r=e.source;delete g.get(r)[i.__cacheKey],o.memory.textures--}let Y=0;function q(e,r){const s=n.get(e);if(e.isVideoTexture&&function(t){const e=o.render.frame;f.get(t)!==e&&(f.set(t,e),t.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&s.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==t.complete)return void $(s,e,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.bindTexture(t.TEXTURE_2D,s.__webglTexture,t.TEXTURE0+r)}const Z={[w]:t.REPEAT,[S]:t.CLAMP_TO_EDGE,[E]:t.MIRRORED_REPEAT},J={[T]:t.NEAREST,[A]:t.NEAREST_MIPMAP_NEAREST,[R]:t.NEAREST_MIPMAP_LINEAR,[C]:t.LINEAR,[L]:t.LINEAR_MIPMAP_NEAREST,[P]:t.LINEAR_MIPMAP_LINEAR};function K(i,s,o){if(o?(t.texParameteri(i,t.TEXTURE_WRAP_S,Z[s.wrapS]),t.texParameteri(i,t.TEXTURE_WRAP_T,Z[s.wrapT]),i!==t.TEXTURE_3D&&i!==t.TEXTURE_2D_ARRAY||t.texParameteri(i,t.TEXTURE_WRAP_R,Z[s.wrapR]),t.texParameteri(i,t.TEXTURE_MAG_FILTER,J[s.magFilter]),t.texParameteri(i,t.TEXTURE_MIN_FILTER,J[s.minFilter])):(t.texParameteri(i,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(i,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),i!==t.TEXTURE_3D&&i!==t.TEXTURE_2D_ARRAY||t.texParameteri(i,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),s.wrapS===S&&s.wrapT===S||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(i,t.TEXTURE_MAG_FILTER,V(s.magFilter)),t.texParameteri(i,t.TEXTURE_MIN_FILTER,V(s.minFilter)),s.minFilter!==T&&s.minFilter!==C&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===e.has("EXT_texture_filter_anisotropic")){const o=e.get("EXT_texture_filter_anisotropic");if(s.type===N&&!1===e.has("OES_texture_float_linear"))return;if(!1===a&&s.type===U&&!1===e.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||n.get(s).__currentAnisotropy)&&(t.texParameterf(i,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy)}}function Q(e,i){let n=!1;void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",W));const r=i.source;let s=g.get(r);void 0===s&&(s={},g.set(r,s));const a=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.encoding),e.join()}(i);if(a!==e.__cacheKey){void 0===s[a]&&(s[a]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,n=!0),s[a].usedTimes++;const r=s[e.__cacheKey];void 0!==r&&(s[e.__cacheKey].usedTimes--,0===r.usedTimes&&j(i)),e.__cacheKey=a,e.__webglTexture=s[a].texture}return n}function $(e,r,o){let l=t.TEXTURE_2D;(r.isDataArrayTexture||r.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),r.isData3DTexture&&(l=t.TEXTURE_3D);const c=Q(e,r),u=r.source;i.bindTexture(l,e.__webglTexture,t.TEXTURE0+o);const d=n.get(u);if(u.version!==d.__version||!0===c){i.activeTexture(t.TEXTURE0+o),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=function(t){return!a&&(t.wrapS!==S||t.wrapT!==S||t.minFilter!==T&&t.minFilter!==C)}(r)&&!1===x(r.image);let n=y(r.image,e,!1,h);n=st(r,n);const p=x(n)||a,f=s.convert(r.format,r.encoding);let m,g=s.convert(r.type),v=H(r.internalFormat,f,g,r.encoding,r.isVideoTexture);K(l,r,p);const _=r.mipmaps,w=a&&!0!==r.isVideoTexture,E=void 0===d.__version||!0===c,A=G(r,
2n,p);if(r.isDepthTexture)v=t.DEPTH_COMPONENT,a?v=r.type===N?t.DEPTH_COMPONENT32F:r.type===D?t.DEPTH_COMPONENT24:r.type===F?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:r.type===N&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===B&&v===t.DEPTH_COMPONENT&&r.type!==O&&r.type!==D&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=D,g=s.convert(r.type)),r.format===k&&v===t.DEPTH_COMPONENT&&(v=t.DEPTH_STENCIL,r.type!==F&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=F,g=s.convert(r.type))),E&&(w?i.texStorage2D(t.TEXTURE_2D,1,v,n.width,n.height):i.texImage2D(t.TEXTURE_2D,0,v,n.width,n.height,0,f,g,null));else if(r.isDataTexture)if(_.length>0&&p){w&&E&&i.texStorage2D(t.TEXTURE_2D,A,v,_[0].width,_[0].height);for(let e=0,n=_.length;e<n;e++)m=_[e],w?i.texSubImage2D(t.TEXTURE_2D,e,0,0,m.width,m.height,f,g,m.data):i.texImage2D(t.TEXTURE_2D,e,v,m.width,m.height,0,f,g,m.data);r.generateMipmaps=!1}else w?(E&&i.texStorage2D(t.TEXTURE_2D,A,v,n.width,n.height),i.texSubImage2D(t.TEXTURE_2D,0,0,0,n.width,n.height,f,g,n.data)):i.texImage2D(t.TEXTURE_2D,0,v,n.width,n.height,0,f,g,n.data);else if(r.isCompressedTexture)if(r.isCompressedArrayTexture){w&&E&&i.texStorage3D(t.TEXTURE_2D_ARRAY,A,v,_[0].width,_[0].height,n.depth);for(let e=0,s=_.length;e<s;e++)m=_[e],r.format!==z?null!==f?w?i.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,m.width,m.height,n.depth,f,m.data,0,0):i.compressedTexImage3D(t.TEXTURE_2D_ARRAY,e,v,m.width,m.height,n.depth,0,m.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):w?i.texSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,m.width,m.height,n.depth,f,g,m.data):i.texImage3D(t.TEXTURE_2D_ARRAY,e,v,m.width,m.height,n.depth,0,f,g,m.data)}else{w&&E&&i.texStorage2D(t.TEXTURE_2D,A,v,_[0].width,_[0].height);for(let e=0,n=_.length;e<n;e++)m=_[e],r.format!==z?null!==f?w?i.compressedTexSubImage2D(t.TEXTURE_2D,e,0,0,m.width,m.height,f,m.data):i.compressedTexImage2D(t.TEXTURE_2D,e,v,m.width,m.height,0,m.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):w?i.texSubImage2D(t.TEXTURE_2D,e,0,0,m.width,m.height,f,g,m.data):i.texImage2D(t.TEXTURE_2D,e,v,m.width,m.height,0,f,g,m.data)}else if(r.isDataArrayTexture)w?(E&&i.texStorage3D(t.TEXTURE_2D_ARRAY,A,v,n.width,n.height,n.depth),i.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,n.width,n.height,n.depth,f,g,n.data)):i.texImage3D(t.TEXTURE_2D_ARRAY,0,v,n.width,n.height,n.depth,0,f,g,n.data);else if(r.isData3DTexture)w?(E&&i.texStorage3D(t.TEXTURE_3D,A,v,n.width,n.height,n.depth),i.texSubImage3D(t.TEXTURE_3D,0,0,0,0,n.width,n.height,n.depth,f,g,n.data)):i.texImage3D(t.TEXTURE_3D,0,v,n.width,n.height,n.depth,0,f,g,n.data);else if(r.isFramebufferTexture){if(E)if(w)i.texStorage2D(t.TEXTURE_2D,A,v,n.width,n.height);else{let e=n.width,r=n.height;for(let n=0;n<A;n++)i.texImage2D(t.TEXTURE_2D,n,v,e,r,0,f,g,null),e>>=1,r>>=1}}else if(_.length>0&&p){w&&E&&i.texStorage2D(t.TEXTURE_2D,A,v,_[0].width,_[0].height);for(let e=0,n=_.length;e<n;e++)m=_[e],w?i.texSubImage2D(t.TEXTURE_2D,e,0,0,f,g,m):i.texImage2D(t.TEXTURE_2D,e,v,f,g,m);r.generateMipmaps=!1}else w?(E&&i.texStorage2D(t.TEXTURE_2D,A,v,n.width,n.height),i.texSubImage2D(t.TEXTURE_2D,0,0,0,f,g,n)):i.texImage2D(t.TEXTURE_2D,0,v,f,g,n);M(r,p)&&b(l),d.__version=u.version,r.onUpdate&&r.onUpdate(r)}e.__version=r.version}function tt(e,r,o,a,l){const c=s.convert(o.format,o.encoding),h=s.convert(o.type),u=H(o.internalFormat,c,h,o.encoding);n.get(r).__hasExternalTextures||(l===t.TEXTURE_3D||l===t.TEXTURE_2D_ARRAY?i.texImage3D(l,0,u,r.width,r.height,r.depth,0,c,h,null):i.texImage2D(l,0,u,r.width,r.height,0,c,h,null)),i.bindFramebuffer(t.FRAMEBUFFER,e),rt(r)?d.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,a,l,n.get(o).__webglTexture,0,nt(r)):(l===t.TEXTURE_2D||l>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,a,l,n.get(o).__webglTexture,0),i.bindFramebuffer(t.FRAMEBUFFER,null)}function et(e,i,n){if(t.bindRenderbuffer(t.RENDERBUFFER,e),i.depthBuffer&&!i.stencilBuffer){let r=t.DEPTH_COMPONENT16;if(n||rt(i)){const e=i.depthTexture;e&&e.isDepthTexture&&(e.type===N?r=t.DEPTH_COMPONENT32F:e.type===D&&(r=t.DEPTH_COMPONENT24));const n=nt(i);rt(i)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,n,r,i.width,i.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,n,r,i.width,i.height)}else t.renderbufferStorage(t.RENDERBUFFER,r,i.width,i.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(i.depthBuffer&&i.stencilBuffer){const r=nt(i);n&&!1===rt(i)?t.renderbufferStorageMultisample(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,i.width,i.height):rt(i)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,i.width,i.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,i.width,i.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}
vendor: 2,185 bytes, line 2
2else{const e=!0===i.isWebGLMultipleRenderTargets?i.texture:[i.texture];for(let r=0;r<e.length;r++){const o=e[r],a=s.convert(o.format,o.encoding),l=s.convert(o.type),c=H(o.internalFormat,a,l,o.encoding),h=nt(i);n&&!1===rt(i)?t.renderbufferStorageMultisample(t.RENDERBUFFER,h,c,i.width,i.height):rt(i)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,h,c,i.width,i.height):t.renderbufferStorage(t.RENDERBUFFER,c,i.width,i.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function it(e){const r=n.get(e),s=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture&&!r.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,r){if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(i.bindFramebuffer(t.FRAMEBUFFER,e),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),q(r.depthTexture,0);const s=n.get(r.depthTexture).__webglTexture,o=nt(r);if(r.depthTexture.format===B)rt(r)?d.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,s,0,o):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,s,0);else{if(r.depthTexture.format!==k)throw new Error("Unknown depthTexture format");rt(r)?d.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,s,0,o):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,s,0)}}(r.__webglFramebuffer,e)}else if(s){r.__webglDepthbuffer=[];for(let n=0;n<6;n++)i.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer[n]),r.__webglDepthbuffer[n]=t.createRenderbuffer(),et(r.__webglDepthbuffer[n],e,!1)}else i.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer),r.__webglDepthbuffer=t.createRenderbuffer(),et(r.__webglDepthbuffer,e,!1);i.bindFramebuffer(t.FRAMEBUFFER,null)}function nt(t){return Math.min(u,t.samples)}function rt(t){const i=n.get(t);
2return a&&t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==i.__useRenderToTexture}function st(t,i){const n=t.encoding,r=t.format,s=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===At||n!==xt&&(n===Mt?!1===a?!0===e.has("EXT_sRGB")&&r===z?(t.format=At,t.minFilter=C,t.generateMipmaps=!1):i=le.sRGBToLinear(i):r===z&&s===I||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",n)),i}this.allocateTextureUnit=function(){const t=Y;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),Y+=1,t},this.resetTextureUnits=function(){Y=0},this.setTexture2D=q,this.setTexture2DArray=function(e,r){const s=n.get(e);e.version>0&&s.__version!==e.version?$(s,e,r):i.bindTexture(t.TEXTURE_2D_ARRAY,s.__webglTexture,t.TEXTURE0+r)},this.setTexture3D=function(e,r){const s=n.get(e);e.version>0&&s.__version!==e.version?$(s,e,r):i.bindTexture(t.TEXTURE_3D,s.__webglTexture,t.TEXTURE0+r)},this.setTextureCube=function(e,r){const o=n.get(e);e.version>0&&o.__version!==e.version?function(e,r,o){if(6!==r.image.length)return;const l=Q(e,r),h=r.source;i.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+o);const u=n.get(h);if(h.version!==u.__version||!0===l){i.activeTexture(t.TEXTURE0+o),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=r.isCompressedTexture||r.image[0].isCompressedTexture,n=r.image[0]&&r.image[0].isDataTexture,d=[];for(let t=0;t<6;t++)d[t]=e||n?n?r.image[t].image:r.image[t]:y(r.image[t],!1,!0,c),d[t]=st(r,d[t]);const p=d[0],f=x(p)||a,m=s.convert(r.format,r.encoding),g=s.convert(r.type),v=H(r.internalFormat,m,g,r.encoding),_=a&&!0!==r.isVideoTexture,w=void 0===u.__version||!0===l;let S,E=G(r,p,f);if(K(t.TEXTURE_CUBE_MAP,r,f),e){_&&w&&i.texStorage2D(t.TEXTURE_CUBE_MAP,E,v,p.width,p.height);for(let e=0;e<6;e++){S=d[e].mipmaps;for(let n=0;n<S.length;n++){const s=S[n];r.format!==z?null!==m?_?i.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,n,0,0,s.width,s.height,m,s.data):i.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,n,v,s.width,s.height,0,s.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):_?i.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,n,0,0,s.width,s.height,m,g,s.data):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,n,v,s.width,s.height,0,m,g,s.data)}}}else{S=r.mipmaps,_&&w&&(S.length>0&&E++,i.texStorage2D(t.TEXTURE_CUBE_MAP,E,v,d[0].width,d[0].height));for(let e=0;e<6;e++)if(n){_?i.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,d[e].width,d[e].height,m,g,d[e].data):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,v,d[e].width,d[e].height,0,m,g,d[e].data);for(let n=0;n<S.length;n++){const r=S[n].image[e].image;_?i.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,n+1,0,0,r.width,r.height,m,g,r.data):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,n+1,v,r.width,r.height,0,m,g,r.data)}}else{_?i.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,m,g,d[e]):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,v,m,g,d[e]);for(let n=0;n<S.length;n++){const r=S[n];_?i.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,n+1,0,0,m,g,r.image[e]):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,n+1,v,m,g,r.image[e])}}}M(r,f)&&b(t.TEXTURE_CUBE_MAP),u.__version=h.version,r.onUpdate&&r.onUpdate(r)}e.__version=r.version}(o,e,r):i.bindTexture(t.TEXTURE_CUBE_MAP,o.__webglTexture,t.TEXTURE0+r)},this.rebindTextures=function(e,i,r){const s=n.get(e);void 0!==i&&tt(s.__webglFramebuffer,e,e.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D),void 0!==r&&it(e)},this.setupRenderTarget=function(e){const l=e.texture,c=n.get(e),h=n.get(l);e.addEventListener("dispose",X),!0!==e.isWebGLMultipleRenderTargets&&(void 0===h.__webglTexture&&(h.__webglTexture=t.createTexture()),h.__version=l.version,o.memory.textures++);
2const u=!0===e.isWebGLCubeRenderTarget,d=!0===e.isWebGLMultipleRenderTargets,p=x(e)||a;if(u){c.__webglFramebuffer=[];for(let e=0;e<6;e++)c.__webglFramebuffer[e]=t.createFramebuffer()}else{if(c.__webglFramebuffer=t.createFramebuffer(),d)if(r.drawBuffers){const i=e.texture;for(let e=0,r=i.length;e<r;e++){const r=n.get(i[e]);void 0===r.__webglTexture&&(r.__webglTexture=t.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(a&&e.samples>0&&!1===rt(e)){const n=d?l:[l];c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=[],i.bindFramebuffer(t.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let i=0;i<n.length;i++){const r=n[i];c.__webglColorRenderbuffer[i]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,c.__webglColorRenderbuffer[i]);const o=s.convert(r.format,r.encoding),a=s.convert(r.type),l=H(r.internalFormat,o,a,r.encoding,!0===e.isXRRenderTarget),h=nt(e);t.renderbufferStorageMultisample(t.RENDERBUFFER,h,l,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+i,t.RENDERBUFFER,c.__webglColorRenderbuffer[i])}t.bindRenderbuffer(t.RENDERBUFFER,null),e.depthBuffer&&(c.__webglDepthRenderbuffer=t.createRenderbuffer(),et(c.__webglDepthRenderbuffer,e,!0)),i.bindFramebuffer(t.FRAMEBUFFER,null)}}if(u){i.bindTexture(t.TEXTURE_CUBE_MAP,h.__webglTexture),K(t.TEXTURE_CUBE_MAP,l,p);for(let i=0;i<6;i++)tt(c.__webglFramebuffer[i],e,l,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+i);M(l,p)&&b(t.TEXTURE_CUBE_MAP),i.unbindTexture()}else if(d){const r=e.texture;for(let s=0,o=r.length;s<o;s++){const o=r[s],a=n.get(o);i.bindTexture(t.TEXTURE_2D,a.__webglTexture),K(t.TEXTURE_2D,o,p),tt(c.__webglFramebuffer,e,o,t.COLOR_ATTACHMENT0+s,t.TEXTURE_2D),M(o,p)&&b(t.TEXTURE_2D)}i.unbindTexture()}else{let n=t.TEXTURE_2D;(e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&(a?n=e.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),i.bindTexture(n,h.__webglTexture),K(n,l,p),tt(c.__webglFramebuffer,e,l,t.COLOR_ATTACHMENT0,n),M(l,p)&&b(n),i.unbindTexture()}e.depthBuffer&&it(e)},this.updateRenderTargetMipmap=function(e){const r=x(e)||a,s=!0===e.isWebGLMultipleRenderTargets?e.texture:[e.texture];for(let o=0,a=s.length;o<a;o++){const a=s[o];if(M(a,r)){const r=e.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,s=n.get(a).__webglTexture;i.bindTexture(r,s),b(r),i.unbindTexture()}}},this.updateMultisampleRenderTarget=function(e){if(a&&e.samples>0&&!1===rt(e)){const r=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],s=e.width,o=e.height;let a=t.COLOR_BUFFER_BIT;const l=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,h=n.get(e),u=!0===e.isWebGLMultipleRenderTargets;if(u)for(let e=0;e<r.length;e++)i.bindFramebuffer(t.FRAMEBUFFER,h.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,null),i.bindFramebuffer(t.FRAMEBUFFER,h.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,null,0);i.bindFramebuffer(t.READ_FRAMEBUFFER,h.__webglMultisampledFramebuffer),i.bindFramebuffer(t.DRAW_FRAMEBUFFER,h.__webglFramebuffer);for(let i=0;i<r.length;i++){l.push(t.COLOR_ATTACHMENT0+i),e.depthBuffer&&l.push(c);const d=void 0!==h.__ignoreDepthValues&&h.__ignoreDepthValues;if(!1===d&&(e.depthBuffer&&(a|=t.DEPTH_BUFFER_BIT),e.stencilBuffer&&(a|=t.STENCIL_BUFFER_BIT)),u&&t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,h.__webglColorRenderbuffer[i]),!0===d&&(t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[c]),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[c])),u){const e=n.get(r[i]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0)}t.blitFramebuffer(0,0,s,o,0,0,s,o,a,t.NEAREST),p&&t.invalidateFramebuffer(t.READ_FRAMEBUFFER,l)}if(i.bindFramebuffer(t.READ_FRAMEBUFFER,null),i.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),u)for(let e=0;e<r.length;e++){i.bindFramebuffer(t.FRAMEBUFFER,h.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,h.__webglColorRen
vendor: 10,507 bytes, line 2
2derbuffer[e]);const s=n.get(r[e]).__webglTexture;i.bindFramebuffer(t.FRAMEBUFFER,h.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,s,0)}i.bindFramebuffer(t.DRAW_FRAMEBUFFER,h.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=it,this.setupFrameBufferTexture=tt,this.useMultisampledRTT=rt}function io(t,e,i){const n=i.isWebGL2;return{convert:function(i,r=null){let s;if(i===I)return t.UNSIGNED_BYTE;if(1017===i)return t.UNSIGNED_SHORT_4_4_4_4;if(1018===i)return t.UNSIGNED_SHORT_5_5_5_1;if(1010===i)return t.BYTE;if(1011===i)return t.SHORT;if(i===O)return t.UNSIGNED_SHORT;if(1013===i)return t.INT;if(i===D)return t.UNSIGNED_INT;if(i===N)return t.FLOAT;if(i===U)return n?t.HALF_FLOAT:(s=e.get("OES_texture_half_float"),null!==s?s.HALF_FLOAT_OES:null);if(1021===i)return t.ALPHA;if(i===z)return t.RGBA;if(1024===i)return t.LUMINANCE;if(1025===i)return t.LUMINANCE_ALPHA;if(i===B)return t.DEPTH_COMPONENT;if(i===k)return t.DEPTH_STENCIL;if(1022===i)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),t.RGBA;if(i===At)return s=e.get("EXT_sRGB"),null!==s?s.SRGB_ALPHA_EXT:null;if(1028===i)return t.RED;if(1029===i)return t.RED_INTEGER;if(1030===i)return t.RG;if(1031===i)return t.RG_INTEGER;if(1033===i)return t.RGBA_INTEGER;if(i===H||i===G||i===V||i===W)if(r===Mt){if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===s)return null;if(i===H)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===G)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===V)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===W)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(s=e.get("WEBGL_compressed_texture_s3tc"),null===s)return null;if(i===H)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===G)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===V)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===W)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(i===X||i===j||i===Y||i===q){if(s=e.get("WEBGL_compressed_texture_pvrtc"),null===s)return null;if(i===X)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===j)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Y)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===q)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===i)return s=e.get("WEBGL_compressed_texture_etc1"),null!==s?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(i===Z||i===J){if(s=e.get("WEBGL_compressed_texture_etc"),null===s)return null;if(i===Z)return r===Mt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===J)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}if(i===K||i===Q||i===$||i===tt||i===et||i===it||i===nt||i===rt||i===st||i===ot||i===at||i===lt||i===ct||i===ht){if(s=e.get("WEBGL_compressed_texture_astc"),null===s)return null;if(i===K)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Q)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===$)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===tt)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===et)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===it)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===nt)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===rt)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===st)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===ot)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===at)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===lt)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===ct)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===ht)return r===Mt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}if(i===ut){if(s=e.get("EXT_texture_compression_bptc"),null===s)return null;if(i===ut)return r===Mt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}return i===F?n?t.UNSIGNED_INT_24_8:(s=e.get("WEBGL_depth_texture"),null!==s?s.UNSIGNED_INT_24_8_WEBGL:null):void 0!==t[i]?t[i]:null}}}class no extends Mn{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class ro extends yi{constructor(){super(),this.isGroup=!0,this.type="Group"}}const so={type:"move"};class oo{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new ro,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new ro,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new _e,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new _e),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new ro,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new _e,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new _e),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const i of t.hand.values())this._getHandJoint(e,i)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,i){let n=null,r=null,s=null;const o=this._targetRay,a=this._grip,l=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(l&&t.hand){s=!0;for(const n of t.hand.values()){const t=e.getJointPose(n,i),r=this._getHandJoint(l,n);null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.jointRadius=t.radius),r.visible=null!==t}const n=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],o=n.position.distanceTo(r.position),a=.02,c=.005;l.inputState.pinching&&o>a+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&o<=a-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==a&&t.gripSpace&&(r=e.getPose(t.gripSpace,i),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1));null!==o&&(n=e.getPose(t.targetRaySpace,i),null===n&&null!==r&&(n=r),null!==n&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),n.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(n.linearVelocity)):o.hasLinearVelocity=!1,n.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(n.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(so)))}return null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==r),null!==l&&(l.visible=null!==s),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const i=new ro;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[e.jointName]=i,t.add(i)}return t.joints[e.jointName]}}class ao extends de{constructor(t,e,i,n,r,s,o,a,l,c){if((c=void 0!==c?c:B)!==B&&c!==k)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&c===B&&(i=D),void 0===i&&c===k&&(i=F),super(null,n,r,s,o,a,c,i,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==o?o:T,this.minFilter=void 0!==a?a:T,this.flipY=!1,this.generateMipmaps=!1}}class lo extends Rt{constructor(t,e){super();const i=this;let n=null,r=1,s=null,o="local-floor",a=null,l=null,c=null,h=null,u=null,d=null;const p=e.getContextAttributes();let f=null,m=null;const g=[],v=[],_=new Set,y=new Map,x=new Mn;x.layers.enable(1),x.viewport=new pe;const M=new Mn;M.layers.enable(2),M.viewport=new pe;const b=[x,M],w=new no;w.layers.enable(1),w.layers.enable(2);let S=null,E=null;function T(t){const e=v.indexOf(t.inputSource);if(-1===e)return;const i=g[e];void 0!==i&&i.dispatchEvent({type:t.type,data:t.inputSource})}function A(){n.removeEventListener("select",T),n.removeEventListener("selectstart",T),n.removeEventListener("selectend",T),n.removeEventListener("squeeze",T),n.removeEventListener("squeezestart",T),n.removeEventListener("squeezeend",T),n.removeEventListener("end",A),n.removeEventListener("inputsourceschange",R);for(let t=0;t<g.length;t++){const e=v[t];null!==e&&(v[t]=null,g[t].disconnect(e))}S=null,E=null,t.setRenderTarget(f),u=null,h=null,c=null,n=null,m=null,N.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function R(t){for(let e=0;e<t.removed.length;e++){const i=t.removed[e],n=v.indexOf(i);n>=0&&(v[n]=null,g[n].disconnect(i))}for(let e=0;e<t.added.length;e++){const i=t.added[e];let n=v.indexOf(i);if(-1===n){for(let t=0;t<g.length;t++){if(t>=v.length){v.push(i),n=t;break}if(null===v[t]){v[t]=i,n=t;break}}if(-1===n)break}const r=g[n];r&&r.connect(i)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=g[t];return void 0===e&&(e=new oo,g[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=g[t];return void 0===e&&(e=new oo,g[t]=e),e.getGripSpace()},this.getHand=function(t){let e=g[t];return void 0===e&&(e=new oo,g[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){o=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a||s},this.setReferenceSpace=function(t){a=t},this.getBaseLayer=function(){return null!==h?h:u},this.getBinding=function(){return c},this.getFrame=function(){return d}
2,this.getSession=function(){return n},this.setSession=async function(l){if(n=l,null!==n){if(f=t.getRenderTarget(),n.addEventListener("select",T),n.addEventListener("selectstart",T),n.addEventListener("selectend",T),n.addEventListener("squeeze",T),n.addEventListener("squeezestart",T),n.addEventListener("squeezeend",T),n.addEventListener("end",A),n.addEventListener("inputsourceschange",R),!0!==p.xrCompatible&&await e.makeXRCompatible(),void 0===n.renderState.layers||!1===t.capabilities.isWebGL2){const i={antialias:void 0!==n.renderState.layers||p.antialias,alpha:p.alpha,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:r};u=new XRWebGLLayer(n,e,i),n.updateRenderState({baseLayer:u}),m=new fe(u.framebufferWidth,u.framebufferHeight,{format:z,type:I,encoding:t.outputEncoding,stencilBuffer:p.stencil})}else{let i=null,s=null,o=null;p.depth&&(o=p.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,i=p.stencil?k:B,s=p.stencil?F:D);const a={colorFormat:e.RGBA8,depthFormat:o,scaleFactor:r};c=new XRWebGLBinding(n,e),h=c.createProjectionLayer(a),n.updateRenderState({layers:[h]}),m=new fe(h.textureWidth,h.textureHeight,{format:z,type:I,depthTexture:new ao(h.textureWidth,h.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,i),stencilBuffer:p.stencil,encoding:t.outputEncoding,samples:p.antialias?4:0});t.properties.get(m).__ignoreDepthValues=h.ignoreDepthValues}m.isXRRenderTarget=!0,this.setFoveation(1),a=null,s=await n.requestReferenceSpace(o),N.setContext(n),N.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};const C=new _e,L=new _e;function P(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===n)return;w.near=M.near=x.near=t.near,w.far=M.far=x.far=t.far,S===w.near&&E===w.far||(n.updateRenderState({depthNear:w.near,depthFar:w.far}),S=w.near,E=w.far);const e=t.parent,i=w.cameras;P(w,e);for(let t=0;t<i.length;t++)P(i[t],e);w.matrixWorld.decompose(w.position,w.quaternion,w.scale),t.matrix.copy(w.matrix),t.matrix.decompose(t.position,t.quaternion,t.scale);const r=t.children;for(let t=0,e=r.length;t<e;t++)r[t].updateMatrixWorld(!0);2===i.length?function(t,e,i){C.setFromMatrixPosition(e.matrixWorld),L.setFromMatrixPosition(i.matrixWorld);const n=C.distanceTo(L),r=e.projectionMatrix.elements,s=i.projectionMatrix.elements,o=r[14]/(r[10]-1),a=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],h=(r[8]-1)/r[0],u=(s[8]+1)/s[0],d=o*h,p=o*u,f=n/(-h+u),m=f*-h;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const g=o+f,v=a+f,_=d-m,y=p+(n-m),x=l*a/v*g,M=c*a/v*g;t.projectionMatrix.makePerspective(_,y,x,M,g,v)}(w,x,M):w.projectionMatrix.copy(x.projectionMatrix)},this.getCamera=function(){return w},this.getFoveation=function(){return null!==h?h.fixedFoveation:null!==u?u.fixedFoveation:void 0},this.setFoveation=function(t){null!==h&&(h.fixedFoveation=t),null!==u&&void 0!==u.fixedFoveation&&(u.fixedFoveation=t)},this.getPlanes=function(){return _};let O=null;const N=new On;N.setAnimationLoop(function(e,n){if(l=n.getViewerPose(a||s),d=n,null!==l){const e=l.views;null!==u&&(t.setRenderTargetFramebuffer(m,u.framebuffer),t.setRenderTarget(m));let i=!1;e.length!==w.cameras.length&&(w.cameras.length=0,i=!0);for(let n=0;n<e.length;n++){const r=e[n];let s=null;if(null!==u)s=u.getViewport(r);else{const e=c.getViewSubImage(h,r);s=e.viewport,0===n&&(t.setRenderTargetTextures(m,e.colorTexture,h.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(m))}let o=b[n];void 0===o&&(o=new Mn,o.layers.enable(n),o.viewport=new pe,b[n]=o),o.matrix.fromArray(r.transform.matrix),o.projectionMatrix.fromArray(r.projectionMatrix),o.viewport.set(s.x,s.y,s.width,s.height),0===n&&w.matrix.copy(o.matrix),!0===i&&w.cameras.push(o)}}for(let t=0;t<g.length;t++){const e=v[t],i=g[t];null!==e&&void 0!==i&&i.update(e,n,a||s)}if(O&&O(e,n),n.detectedPlanes){i.dispatchEvent({type:"planesdetected",data:n.detectedPlanes});let t=null;for(const e of _)n.detectedPlanes.has(e)||(null===t&&(t=[]),t.push(e));if(null!==t)for(const e of t)_.delete(e),y.delete(e),i.dispatchEvent({type:"planeremoved",data:e});for(const t of n.detectedPlanes)if(_.has(t)){const e=y.get(t);t.lastChangedTime>e&&(y.set(t,t.lastChangedTime),i.dispatchEvent({type:"planechanged",data:t}))}else _.add(t),y.set(t,n.lastChangedTime),i.dispatchEvent({type:"planeadded",data:t})}d=null}),this.setAnimationLoop=function(t){O=t},this.dispose=function(){}}}function co(t,e){function i(i,n){i.opacity.value=n.opacity,n.color&&i.diffuse.value.copy(n.
2color),n.emissive&&i.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(i.map.value=n.map),n.alphaMap&&(i.alphaMap.value=n.alphaMap),n.bumpMap&&(i.bumpMap.value=n.bumpMap,i.bumpScale.value=n.bumpScale,1===n.side&&(i.bumpScale.value*=-1)),n.displacementMap&&(i.displacementMap.value=n.displacementMap,i.displacementScale.value=n.displacementScale,i.displacementBias.value=n.displacementBias),n.emissiveMap&&(i.emissiveMap.value=n.emissiveMap),n.normalMap&&(i.normalMap.value=n.normalMap,i.normalScale.value.copy(n.normalScale),1===n.side&&i.normalScale.value.negate()),n.specularMap&&(i.specularMap.value=n.specularMap),n.alphaTest>0&&(i.alphaTest.value=n.alphaTest);const r=e.get(n).envMap;if(r&&(i.envMap.value=r,i.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,i.reflectivity.value=n.reflectivity,i.ior.value=n.ior,i.refractionRatio.value=n.refractionRatio),n.lightMap){i.lightMap.value=n.lightMap;const e=!0!==t.physicallyCorrectLights?Math.PI:1;i.lightMapIntensity.value=n.lightMapIntensity*e}let s,o;n.aoMap&&(i.aoMap.value=n.aoMap,i.aoMapIntensity.value=n.aoMapIntensity),n.map?s=n.map:n.specularMap?s=n.specularMap:n.displacementMap?s=n.displacementMap:n.normalMap?s=n.normalMap:n.bumpMap?s=n.bumpMap:n.roughnessMap?s=n.roughnessMap:n.metalnessMap?s=n.metalnessMap:n.alphaMap?s=n.alphaMap:n.emissiveMap?s=n.emissiveMap:n.clearcoatMap?s=n.clearcoatMap:n.clearcoatNormalMap?s=n.clearcoatNormalMap:n.clearcoatRoughnessMap?s=n.clearcoatRoughnessMap:n.iridescenceMap?s=n.iridescenceMap:n.iridescenceThicknessMap?s=n.iridescenceThicknessMap:n.specularIntensityMap?s=n.specularIntensityMap:n.specularColorMap?s=n.specularColorMap:n.transmissionMap?s=n.transmissionMap:n.thicknessMap?s=n.thicknessMap:n.sheenColorMap?s=n.sheenColorMap:n.sheenRoughnessMap&&(s=n.sheenRoughnessMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),i.uvTransform.value.copy(s.matrix)),n.aoMap?o=n.aoMap:n.lightMap&&(o=n.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),i.uv2Transform.value.copy(o.matrix))}return{refreshFogUniforms:function(e,i){i.color.getRGB(e.fogColor.value,vn(t)),i.isFog?(e.fogNear.value=i.near,e.fogFar.value=i.far):i.isFogExp2&&(e.fogDensity.value=i.density)},refreshMaterialUniforms:function(t,n,r,s,o){n.isMeshBasicMaterial||n.isMeshLambertMaterial?i(t,n):n.isMeshToonMaterial?(i(t,n),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,n)):n.isMeshPhongMaterial?(i(t,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,n)):n.isMeshStandardMaterial?(i(t,n),function(t,i){t.roughness.value=i.roughness,t.metalness.value=i.metalness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap);i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap);const n=e.get(i).envMap;n&&(t.envMapIntensity.value=i.envMapIntensity)}(t,n),n.isMeshPhysicalMaterial&&function(t,e,i){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate()));e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap);e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap)}
vendor: 11,362 bytes, line 2
2(t,n,o)):n.isMeshMatcapMaterial?(i(t,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,n)):n.isMeshDepthMaterial?i(t,n):n.isMeshDistanceMaterial?(i(t,n),function(t,e){t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,n)):n.isMeshNormalMaterial?i(t,n):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,n)):n.isPointsMaterial?function(t,e,i,n){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);e.alphaTest>0&&(t.alphaTest.value=e.alphaTest);let r;e.map?r=e.map:e.alphaMap&&(r=e.alphaMap);void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}(t,n,r,s):n.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);e.alphaTest>0&&(t.alphaTest.value=e.alphaTest);let i;e.map?i=e.map:e.alphaMap&&(i=e.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}(t,n):n.isShadowMaterial?(t.color.value.copy(n.color),t.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function ho(t,e,i,n){let r={},s={},o=[];const a=i.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(t,e,i){const n=t.value;if(void 0===i[e])return i[e]="number"==typeof n?n:n.clone(),!0;if("number"==typeof n){if(i[e]!==n)return i[e]=n,!0}else{const t=i[e];if(!1===t.equals(n))return t.copy(n),!0}return!1}function c(t){const e=t.value,i={boundary:0,storage:0};return"number"==typeof e?(i.boundary=4,i.storage=4):e.isVector2?(i.boundary=8,i.storage=8):e.isVector3||e.isColor?(i.boundary=16,i.storage=12):e.isVector4?(i.boundary=16,i.storage=16):e.isMatrix3?(i.boundary=48,i.storage=48):e.isMatrix4?(i.boundary=64,i.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),i}function h(e){const i=e.target;i.removeEventListener("dispose",h);const n=o.indexOf(i.__bindingPointIndex);o.splice(n,1),t.deleteBuffer(r[i.id]),delete r[i.id],delete s[i.id]}return{bind:function(t,e){const i=e.program;n.uniformBlockBinding(t,i)},update:function(i,u){let d=r[i.id];void 0===d&&(!function(t){const e=t.uniforms;let i=0;const n=16;let r=0;for(let t=0,s=e.length;t<s;t++){const s=e[t],o=c(s);if(s.__data=new Float32Array(o.storage/Float32Array.BYTES_PER_ELEMENT),s.__offset=i,t>0){r=i%n;0!==r&&n-r-o.boundary<0&&(i+=n-r,s.__offset=i)}i+=o.storage}r=i%n,r>0&&(i+=n-r);t.__size=i,t.__cache={}}(i),d=function(e){const i=function(){for(let t=0;t<a;t++)if(-1===o.indexOf(t))return o.push(t),t;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();e.__bindingPointIndex=i;const n=t.createBuffer(),r=e.__size,s=e.usage;return t.bindBuffer(t.UNIFORM_BUFFER,n),t.bufferData(t.UNIFORM_BUFFER,r,s),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,i,n),n}(i),r[i.id]=d,i.addEventListener("dispose",h));const p=u.program;n.updateUBOMapping(i,p);const f=e.render.frame;s[i.id]!==f&&(!function(e){const i=r[e.id],n=e.uniforms,s=e.__cache;t.bindBuffer(t.UNIFORM_BUFFER,i);for(let e=0,i=n.length;e<i;e++){const i=n[e];if(!0===l(i,e,s)){const e=i.value,n=i.__offset;"number"==typeof e?(i.__data[0]=e,t.bufferSubData(t.UNIFORM_BUFFER,n,i.__data)):(i.value.isMatrix3?(i.__data[0]=i.value.elements[0],i.__data[1]=i.value.elements[1],i.__data[2]=i.value.elements[2],i.__data[3]=i.value.elements[0],i.__data[4]=i.value.elements[3],i.__data[5]=i.value.elements[4],i.__data[6]=i.value.elements[5],i.__data[7]=i.value.elements[0],i.__data[8]=i.value.elements[6],i.__data[9]=i.value.elements[7],i.__data[10]=i.value.elements[8],i.__data[11]=i.value.elements[0]):e.toArray(i.__data),t.bufferSubData(t.UNIFORM_BUFFER,n,i.__data))}}t.bindBuffer(t.UNIFORM_BUFFER,null)}(i),s[i.id]=f)},dispose:function(){for(const e in r)t.deleteBuffer(r[e]);o=[],r={},s={}}}}function uo(t={}){this.isWebGLRenderer=!0;const e=void 0!==t.canvas?t.canvas:function(){const t=Zt("canvas");return t.style.display="block",t}(),n=void 0!==t.context?t.context:null,r=void 0===t.depth||t.depth,s=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,a=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,c=void 0!==t.powerPreference?t.powerPreference:"default",h=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;let u;u=null!==n?n.getContextAttributes().alpha:void 0!==t.alpha&&t.alpha;let d=null,p=null;const f=[],m=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=xt,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const g=this;let v=!1,_=0,y=0,x=null,M=-1,b=null;const w=new pe,S=new pe;let E=null,T=e.width,A=e.height,R=1,C=null,L=null;const O=new pe(0,0,T,A),D=new pe(0,0,T,A);let F=!1;const B=new In;let k=!1,H=!1,G=null;const V=new qe,W=new Vt,X=new _e,j={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Y(){return null===x?R:1}let q,Z,J,K,Q,$,tt,et,it,nt,rt,st,ot,at,lt,ct,ht,ut,dt,pt,ft,mt,gt,vt,_t=n;function yt(t,i){for(let n=0;n<t.length;n++){const r=t[n],s=e.getContext(r,i);if(null!==s)return s}return null}try{const t={alpha:!0,depth:r,stencil:s,antialias:o,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:h};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${i}`),e.addEventListener("webglcontextlost",wt,!1),e.addEventListener("webglcontextrestored",St,!1),e.addEventListener("webglcontextcreationerror",Et,!1),null===_t){const e=["webgl2","webgl","experimental-webgl"];if(!0===g.isWebGL1Renderer&&e.shift(),_t=yt(e,t),null===_t)throw yt(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===_t.getShaderPrecisionFormat&&(_t.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function Mt(){q=new lr(_t),Z=new Vn(_t,q,t),q.init(Z),mt=new io(_t,q,Z),J=new to(_t,q,Z),K=new ur(_t),Q=new ks,$=new eo(_t,q,J,Q,Z,mt,K),tt=new Xn(g),et=new ar(g),it=new Dn(_t,Z),gt=new Hn(_t,q,it,Z),nt=new cr(_t,it,K,gt),rt=new mr(_t,nt,it,K),dt=new fr(_t,Z,$),ct=new Wn(Q),st=new Bs(g,tt,et,q,Z,gt,ct),ot=new co(g,Q),at=new Ws,lt=new Js(q,Z),ut=new kn(g,tt,et,J,rt,u,a),ht=new $s(g,rt,Z),vt=new ho(_t,K,Z,J),pt=new Gn(_t,q,K,Z),ft=new hr(_t,q,K,Z),K.programs=st.programs,g.capabilities=Z,g.extensions=q,g.properties=Q,g.renderLists=at,g.shadowMap=ht,g.state=J,g.info=K}Mt();const bt=new lo(g,_t);function wt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),v=!0}function St(){console.log("THREE.WebGLRenderer: Context Restored."),v=!1;const t=K.autoReset,e=ht.enabled,i=ht.autoUpdate,n=ht.needsUpdate,r=ht.type;Mt(),K.autoReset=t,ht.enabled=e,ht.autoUpdate=i,ht.needsUpdate=n,ht.type=r}function Et(t){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",t.statusMessage)}function Tt(t){const e=t.target;e.removeEventListener("dispose",Tt),function(t){(function(t){const e=Q.get(t).programs;void 0!==e&&(e.forEach(function(t){st.releaseProgram(t)}),t.isShaderMaterial&&st.releaseShaderCache(t))})(t),Q.remove(t)}(e)}this.xr=bt,this.getContext=function(){return _t},this.getContextAttributes=function(){return _t.getContextAttributes()},this.forceContextLoss=function(){const t=q.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=q.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return R},this.setPixelRatio=function(t){void 0!==t&&(R=t,this.setSize(T,A,!1))},this.getSize=function(t){return t.set(T,A)},this.setSize=function(t,i,n){bt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(T=t,A=i,e.width=Math.floor(t*R),e.height=Math.floor(i*R),!1!==n&&(e.style.width=t+"px",e.style.height=i+"px"),this.setViewport(0,0,t,i))},this.getDrawingBufferSize=function(t){return t.set(T*R,A*R).floor()},this.setDrawingBufferSize=function(t,i,n){T=t,A=i,R=n,e.width=Math.floor(t*n),e.height=Math.floor(i*n),this.setViewport(0,0,t,i)},this.getCurrentViewport=function(t){return t.copy(w)},this.getViewport=function(t){return t.copy(O)},this.setViewport=function(t,e,i,n){t.isVector4?O.set(t.x,t.y,t.z,t.w):O.set(t,e,i,n),J.viewport(w.copy(O).multiplyScalar(R).floor())},this.getScissor=function(t){return t.copy(D)},this.setScissor=function(t,e,i,n){t.isVector4?D.set(t.x,t.y,t.z,t.w):D.set(t,e,i,n),J.scissor(S.copy(D).multiplyScalar(R).floor())},this.getScissorTest=function(){return F},this.setScissorTest=function(t){J.setScissorTest(F=t)},this.setOpaqueSort=function(t){C=t},this.setTransparentSort=function(t){L=t},this.getClearColor=function(t){return t.copy(ut.getClearColor())},this.setClearColor=function(){ut.setClearColor.apply(ut,arguments)},this.getClearAlpha=function(){return ut.getClearAlpha()},this.setClearAlpha=function(){ut.setClearAlpha.apply(ut,arguments)},this.clear=function(t=!0,e=!0,i=!0){let n=0;t&&(n|=_t.COLOR_BUFFER_BIT),e&&(n|=_t.DEPTH_BUFFER_BIT),i&&(n|=_t.STENCIL_BUFFER_BIT),_t.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",wt,!1),e.removeEventListener("webglcontextrestored",St,!1),e.removeEventListener("webglcontextcreationerror",Et,!1),at.dispose(),lt.dispose(),Q.dispose(),tt.dispose(),et.dispose(),rt.dispose(),gt.dispose(),vt.dispose(),st.dispose(),bt.dispose(),bt.removeEventListener("sessionstart",Rt),bt.removeEventListener("sessionend",Ct),G&&(G.dispose(),G=null),Lt.stop()},this.renderBufferDirect=function(t,e,i,n,r,s){null===e&&(e=j);const o=r.isMesh&&r.matrixWorld.determinant()<0,a=function(t,e,i,n,r){!0!==e.isScene&&(e=j);$.resetTextureUnits();const s=e.fog,o=n.isMeshStandardMaterial?e.environment:null,a=null===x?g.outputEncoding:!0===x.isXRRenderTarget?x.texture.encoding:xt,l=(n.isMeshStandardMaterial?et:tt).get(n.envMap||o),c=!0===n.vertexColors&&!!i.attributes.color&&4===i.attributes.color.itemSize,h=!!n.normalMap&&!!i.attributes.tangent,u=!!i.morphAttributes.position,d=!!i.morphAttributes.normal,f=!!i.morphAttributes.color,m=n.toneMapped?g.toneMapping:0,v=i.morphAttributes.position||i.morphAttributes.normal||i.morphAttributes.color,_=void 0!==v?v.length:0,y=Q.get(n),w=p.state.lights;if(!0===k&&(!0===H||t!==b)){const e=t===b&&n.id===M;ct.setState(n,t,e)}let S=!1;n.version===y.__version?y.needsLights&&y.lightsStateVersion!==w.state.version||y.outputEncoding!==a||r.isInstancedMesh&&!1===y.instancing?S=!0:r.isInstancedMesh||!0!==y.instancing?r.isSkinnedMesh&&
2!1===y.skinning?S=!0:r.isSkinnedMesh||!0!==y.skinning?y.envMap!==l||!0===n.fog&&y.fog!==s?S=!0:void 0===y.numClippingPlanes||y.numClippingPlanes===ct.numPlanes&&y.numIntersection===ct.numIntersection?(y.vertexAlphas!==c||y.vertexTangents!==h||y.morphTargets!==u||y.morphNormals!==d||y.morphColors!==f||y.toneMapping!==m||!0===Z.isWebGL2&&y.morphTargetsCount!==_)&&(S=!0):S=!0:S=!0:S=!0:(S=!0,y.__version=n.version);let E=y.currentProgram;!0===S&&(E=Nt(n,e,r));let T=!1,C=!1,L=!1;const P=E.getUniforms(),I=y.uniforms;J.useProgram(E.program)&&(T=!0,C=!0,L=!0);n.id!==M&&(M=n.id,C=!0);if(T||b!==t){if(P.setValue(_t,"projectionMatrix",t.projectionMatrix),Z.logarithmicDepthBuffer&&P.setValue(_t,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),b!==t&&(b=t,C=!0,L=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){const e=P.map.cameraPosition;void 0!==e&&e.setValue(_t,X.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&P.setValue(_t,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||r.isSkinnedMesh)&&P.setValue(_t,"viewMatrix",t.matrixWorldInverse)}if(r.isSkinnedMesh){P.setOptional(_t,r,"bindMatrix"),P.setOptional(_t,r,"bindMatrixInverse");const t=r.skeleton;t&&(Z.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),P.setValue(_t,"boneTexture",t.boneTexture,$),P.setValue(_t,"boneTextureSize",t.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const O=i.morphAttributes;(void 0!==O.position||void 0!==O.normal||void 0!==O.color&&!0===Z.isWebGL2)&&dt.update(r,i,n,E);(C||y.receiveShadow!==r.receiveShadow)&&(y.receiveShadow=r.receiveShadow,P.setValue(_t,"receiveShadow",r.receiveShadow));n.isMeshGouraudMaterial&&null!==n.envMap&&(I.envMap.value=l,I.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);C&&(P.setValue(_t,"toneMappingExposure",g.toneMappingExposure),y.needsLights&&(N=L,(D=I).ambientLightColor.needsUpdate=N,D.lightProbe.needsUpdate=N,D.directionalLights.needsUpdate=N,D.directionalLightShadows.needsUpdate=N,D.pointLights.needsUpdate=N,D.pointLightShadows.needsUpdate=N,D.spotLights.needsUpdate=N,D.spotLightShadows.needsUpdate=N,D.rectAreaLights.needsUpdate=N,D.hemisphereLights.needsUpdate=N),s&&!0===n.fog&&ot.refreshFogUniforms(I,s),ot.refreshMaterialUniforms(I,n,R,A,G),ys.upload(_t,y.uniformsList,I,$));var D,N;n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(ys.upload(_t,y.uniformsList,I,$),n.uniformsNeedUpdate=!1);n.isSpriteMaterial&&P.setValue(_t,"center",r.center);if(P.setValue(_t,"modelViewMatrix",r.modelViewMatrix),P.setValue(_t,"normalMatrix",r.normalMatrix),P.setValue(_t,"modelMatrix",r.matrixWorld),n.isShaderMaterial||n.isRawShaderMaterial){const t=n.uniformsGroups;for(let e=0,i=t.length;e<i;e++)if(Z.isWebGL2){const i=t[e];vt.update(i,E),vt.bind(i,E)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return E}(t,e,i,n,r);J.setMaterial(n,o);let l=i.index,c=1;!0===n.wireframe&&(l=nt.getWireframeAttribute(i),c=2);const h=i.drawRange,u=i.attributes.position;let d=h.start*c,f=(h.start+h.count)*c;null!==s&&(d=Math.max(d,s.start*c),f=Math.min(f,(s.start+s.count)*c)),null!==l?(d=Math.max(d,0),f=Math.min(f,l.count)):null!=u&&(d=Math.max(d,0),f=Math.min(f,u.count));const m=f-d;if(m<0||m===1/0)return;let v;gt.setup(r,n,a,i,l);let _=pt;if(null!==l&&(v=it.get(l),_=ft,_.setIndex(v)),r.isMesh)!0===n.wireframe?(J.setLineWidth(n.wireframeLinewidth*Y()),_.setMode(_t.LINES)):_.setMode(_t.TRIANGLES);else if(r.isLine){let t=n.linewidth;void 0===t&&(t=1),J.setLineWidth(t*Y()),r.isLineSegments?_.setMode(_t.LINES):r.isLineLoop?_.setMode(_t.LINE_LOOP):_.setMode(_t.LINE_STRIP)}else r.isPoints?_.setMode(_t.POINTS):r.isSprite&&_.setMode(_t.TRIANGLES);if(r.isInstancedMesh)_.renderInstances(d,m,r.count);else if(i.isInstancedBufferGeometry){const t=void 0!==i._maxInstanceCount?i._maxInstanceCount:1/0,e=Math.min(i.instanceCount,t);_.renderInstances(d,m,e)}else _.render(d,m)},this.compile=function(t,e){function i(t,e,i){!0===t.transparent&&2===t.side?(t.side=1,t.needsUpdate=!0,Nt(t,e,i),t.side=0,t.needsUpdate=!0,Nt(t,e,i),t.side=2):Nt(t,e,i)}p=lt.get(t),p.init(),m.push(p),t.traverseVisible(function(t){t.isLight&&t.layers.test(e.layers
vendor: 5,897 bytes, line 2
2)&&(p.pushLight(t),t.castShadow&&p.pushShadow(t))}),p.setupLights(g.physicallyCorrectLights),t.traverse(function(e){const n=e.material;if(n)if(Array.isArray(n))for(let r=0;r<n.length;r++){i(n[r],t,e)}else i(n,t,e)}),m.pop(),p=null};let At=null;function Rt(){Lt.stop()}function Ct(){Lt.start()}const Lt=new On;function Pt(t,e,i,n){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)i=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)p.pushLight(t),t.castShadow&&p.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||B.intersectsSprite(t)){n&&X.setFromMatrixPosition(t.matrixWorld).applyMatrix4(V);const e=rt.update(t),r=t.material;r.visible&&d.push(t,e,r,i,X.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==K.render.frame&&(t.skeleton.update(),t.skeleton.frame=K.render.frame),!t.frustumCulled||B.intersectsObject(t))){n&&X.setFromMatrixPosition(t.matrixWorld).applyMatrix4(V);const e=rt.update(t),r=t.material;if(Array.isArray(r)){const n=e.groups;for(let s=0,o=n.length;s<o;s++){const o=n[s],a=r[o.materialIndex];a&&a.visible&&d.push(t,e,a,i,X.z,o)}}else r.visible&&d.push(t,e,r,i,X.z,null)}const r=t.children;for(let t=0,s=r.length;t<s;t++)Pt(r[t],e,i,n)}function It(t,e,i,n){const r=t.opaque,s=t.transmissive,a=t.transparent;p.setupLightsView(i),s.length>0&&function(t,e,i){const n=Z.isWebGL2;null===G&&(G=new fe(1,1,{generateMipmaps:!0,type:q.has("EXT_color_buffer_half_float")?U:I,minFilter:P,samples:n&&!0===o?4:0}));g.getDrawingBufferSize(W),n?G.setSize(W.x,W.y):G.setSize(Bt(W.x),Bt(W.y));const r=g.getRenderTarget();g.setRenderTarget(G),g.clear();const s=g.toneMapping;g.toneMapping=0,Ot(t,e,i),g.toneMapping=s,$.updateMultisampleRenderTarget(G),$.updateRenderTargetMipmap(G),g.setRenderTarget(r)}(r,e,i),n&&J.viewport(w.copy(n)),r.length>0&&Ot(r,e,i),s.length>0&&Ot(s,e,i),a.length>0&&Ot(a,e,i),J.buffers.depth.setTest(!0),J.buffers.depth.setMask(!0),J.buffers.color.setMask(!0),J.setPolygonOffset(!1)}function Ot(t,e,i){const n=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r<s;r++){const s=t[r],o=s.object,a=s.geometry,l=null===n?s.material:n,c=s.group;o.layers.test(i.layers)&&Dt(o,e,i,a,l,c)}}function Dt(t,e,i,n,r,s){t.onBeforeRender(g,e,i,n,r,s),t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),r.onBeforeRender(g,e,i,n,t,s),!0===r.transparent&&2===r.side?(r.side=1,r.needsUpdate=!0,g.renderBufferDirect(i,e,n,r,t,s),r.side=0,r.needsUpdate=!0,g.renderBufferDirect(i,e,n,r,t,s),r.side=2):g.renderBufferDirect(i,e,n,r,t,s),t.onAfterRender(g,e,i,n,r,s)}function Nt(t,e,i){!0!==e.isScene&&(e=j);const n=Q.get(t),r=p.state.lights,s=p.state.shadowsArray,o=r.state.version,a=st.getParameters(t,r.state,s,e,i),l=st.getProgramCacheKey(a);let c=n.programs;n.environment=t.isMeshStandardMaterial?e.environment:null,n.fog=e.fog,n.envMap=(t.isMeshStandardMaterial?et:tt).get(t.envMap||n.environment),void 0===c&&(t.addEventListener("dispose",Tt),c=new Map,n.programs=c);let h=c.get(l);if(void 0!==h){if(n.currentProgram===h&&n.lightsStateVersion===o)return Ut(t,a),h}else a.uniforms=st.getUniforms(t),t.onBuild(i,a,g),t.onBeforeCompile(a,g),h=st.acquireProgram(a,l),c.set(l,h),n.uniforms=a.uniforms;const u=n.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(u.clippingPlanes=ct.uniform),Ut(t,a),n.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),n.lightsStateVersion=o,n.needsLights&&(u.ambientLightColor.value=r.state.ambient,u.lightProbe.value=r.state.probe,u.directionalLights.value=r.state.directional,u.directionalLightShadows.value=r.state.directionalShadow,u.spotLights.value=r.state.spot,u.spotLightShadows.value=r.state.spotShadow,u.rectAreaLights.value=r.state.rectArea,u.ltc_1.value=r.state.rectAreaLTC1,u.ltc_2.value=r.state.rectAreaLTC2,u.pointLights.value=r.state.point,u.pointLightShadows.value=r.state.pointShadow,u.hemisphereLights.value=r.state.hemi,u.directionalShadowMap.value=r.state.directionalShadowMap,u.directionalShadowMatrix.value=r.state.directionalShadowMatrix,u.spotShadowMap.value=r.state.spotShadowMap,u.spotLightMatrix.value=r.state.spotLightMatrix,u.spotLightMap.value=r.state.spotLightMap,u.pointShadowMap.value=r.state.pointShadowMap,u.pointShadowMatrix.value=r.state.pointShadowMatrix);const d=h.getUniforms(),f=ys.seqWithValue(d.seq,u);return n.currentProgram=h,n.uniformsList=f,h}function Ut(t,e){const i=Q.get(t);i.outputEncoding=e.outputEncoding,i.instancing=e.instancing,i.skinning=e.skinning,i.morphTargets=e.morphTargets,i.morphNormals=e.morphNormals,i.morphColors=e.morphColors,i.morphTargetsCount=e.morphTargetsCount,i.numClippingPlanes=e.numClippingPlanes,i.numIntersection=e.numClipIntersection,i.vertexAlphas=e.vertexAlphas,i.vertexTangents=e.vertexTangents,i.toneMapping=e.toneMapping}Lt.setAnimationLoop(function(t){At&&At(t)}),"undefined"!=typeof self&&Lt.setContext(self),this.setAnimationLoop=function(t){At=t,bt.setAnimationLoop(t),null===t?Lt.stop():Lt.start()},bt.addEventListener("sessionstart",Rt),bt.addEventListener("sessionend",Ct),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===v)return;!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),!0===bt.enabled&&!0===bt.isPresenting&&(!0===bt.cameraAutoUpdate&&bt.updateCamera(e),e=bt.getCamera()),!0===t.isScene&&t.onBeforeRender(g,t,e,x),p=lt.get(t,m.length),p.init(),m.push(p),V.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),B.setFromProjectionMatrix(V),H=this.localClippingEnabled,k=ct.init(this.clippingPlanes,H,e),d=at.get(t,f.length),d.init(),f.pu
2sh(d),Pt(t,e,0,g.sortObjects),d.finish(),!0===g.sortObjects&&d.sort(C,L),!0===k&&ct.beginShadows();const i=p.state.shadowsArray;if(ht.render(i,t,e),!0===k&&ct.endShadows(),!0===this.info.autoReset&&this.info.reset(),ut.render(d,t),p.setupLights(g.physicallyCorrectLights),e.isArrayCamera){const i=e.cameras;for(let e=0,n=i.length;e<n;e++){const n=i[e];It(d,t,n,n.viewport)}}else It(d,t,e);null!==x&&($.updateMultisampleRenderTarget(x),$.updateRenderTargetMipmap(x)),!0===t.isScene&&t.onAfterRender(g,t,e),gt.resetDefaultState(),M=-1,b=null,m.pop(),p=m.length>0?m[m.length-1]:null,f.pop(),d=f.length>0?f[f.length-1]:null},this.getActiveCubeFace=function(){return _},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return x},this.setRenderTargetTextures=function(t,e,i){Q.get(t.texture).__webglTexture=e,Q.get(t.depthTexture).__webglTexture=i;const n=Q.get(t);n.__hasExternalTextures=!0,n.__hasExternalTextures&&(n.__autoAllocateDepthBuffer=void 0===i,n.__autoAllocateDepthBuffer||!0===q.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),n.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const i=Q.get(t);i.__webglFramebuffer=e,i.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,i=0){x=t,_=e,y=i;let n=!0,r=null,s=!1,o=!1;if(t){const i=Q.get(t);void 0!==i.__useDefaultFramebuffer?(J.bindFramebuffer(_t.FRAMEBUFFER,null),n=!1):void 0===i.__webglFramebuffer?$.setupRenderTarget(t):i.__hasExternalTextures&&$.rebindTextures(t,Q.get(t.texture).__webglTexture,Q.get(t.depthTexture).__webglTexture);const a=t.texture;(a.isData3DTexture||a.isDataArrayTexture||a.isCompressedArrayTexture)&&(o=!0);const l=Q.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=l[e],s=!0):r=Z.isWebGL2&&t.samples>0&&!1===$.useMultisampledRTT(t)?Q.get(t).__webglMultisampledFramebuffer:l,w.copy(t.viewport),S.copy(t.scissor),E=t.scissorTest}else w.copy(O).multiplyScalar(R).floor(),S.copy(D).multiplyScalar(R).floor(),E=F;if(J.bindFramebuffer(_t.FRAMEBUFFER,r)&&Z.drawBuffers&&n&&J.drawBuffers(t,r),J.viewport(w),J.scissor(S),J.setScissorTest(E),s){const n=Q.get(t.texture);_t.framebufferTexture2D(_t.FRAMEBUFFER,_t.COLOR_ATTACHMENT0,_t.TEXTURE_CUBE_MAP_POSITIVE_X+e,n.__webglTexture,i)}else if(o){const n=Q.get(t.texture),r=e||0;_t.framebufferTextureLayer(_t.FRAMEBUFFER,_t.COLOR_ATTACHMENT0,n.__webglTexture,i||0,r)}M=-1},this.readRenderTargetPixels=function(t,e,i,n,r,s,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=Q.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){J.bindFramebuffer(_t.FRAMEBUFFER,a);try{const o=t.texture,a=o.format,l=o.type;if(a!==z&&mt.convert(a)!==_t.getParameter(_t.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===U&&(q.has("EXT_color_buffer_half_float")||Z.isWebGL2&&q.has("EXT_color_buffer_float"));if(!(l===I||mt.convert(l)===_t.getParameter(_t.IMPLEMENTATION_COLOR_READ_TYPE)||l===N&&(Z.isWebGL2||q.has("OES_texture_float")||q.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&_t.readPixels(e,i,n,r,mt.convert(a),mt.convert(l),s)}finally{const t=null!==x?Q.get(x).__webglFramebuffer:null;J.bindFramebuffer(_t.FRAMEBUFFER,t)}}},this.copyFramebufferToTexture=function(t,e,i=0){const n=Math.pow(2,-i),r=Math.floor(e.image.width*n),s=Math.floor(e.image.height*n);$.setTexture2D(e,0),_t.copyTexSubImage2D(_t.TEXTURE_2D,i,0,0,t.x,t.y,r,s),J.unbindTexture()},this.copyTextureToTexture=function(t,e,i,n=0){const r=e.image.width,s=e.image.height,o=mt.convert(i.format),a=mt.convert(i.type);$.setTexture2D(i,0),_t.pixelStorei(_t.UNPACK_FLIP_Y_WEBGL,i.flipY),_t.pixelStorei(_t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),_t.pixelStorei(_t.UNPACK_ALIGNMENT,i.unpackAlignment),e.isDataTexture?_t.texSubImage2D(_t.TEXTURE_2D,n,t.x,t.y,r,s,o,a,e.image.data):e.isCompressedTexture?_t.compressedTexSubImage2D(_t.TEXTURE_2D,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):_t.texSubImage2D(_t.TEXTURE_2D,n,t.x,t.y,o,a,e.image),0===n&&i.generateMipmaps&&_t.generateMipmap(_t.TEXTURE_2D),J.unbindTexture()}
vendor: 40,550 bytes, line 2
2,this.copyTextureToTexture3D=function(t,e,i,n,r=0){if(g.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=t.max.x-t.min.x+1,o=t.max.y-t.min.y+1,a=t.max.z-t.min.z+1,l=mt.convert(n.format),c=mt.convert(n.type);let h;if(n.isData3DTexture)$.setTexture3D(n,0),h=_t.TEXTURE_3D;else{if(!n.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");$.setTexture2DArray(n,0),h=_t.TEXTURE_2D_ARRAY}_t.pixelStorei(_t.UNPACK_FLIP_Y_WEBGL,n.flipY),_t.pixelStorei(_t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),_t.pixelStorei(_t.UNPACK_ALIGNMENT,n.unpackAlignment);const u=_t.getParameter(_t.UNPACK_ROW_LENGTH),d=_t.getParameter(_t.UNPACK_IMAGE_HEIGHT),p=_t.getParameter(_t.UNPACK_SKIP_PIXELS),f=_t.getParameter(_t.UNPACK_SKIP_ROWS),m=_t.getParameter(_t.UNPACK_SKIP_IMAGES),v=i.isCompressedTexture?i.mipmaps[0]:i.image;_t.pixelStorei(_t.UNPACK_ROW_LENGTH,v.width),_t.pixelStorei(_t.UNPACK_IMAGE_HEIGHT,v.height),_t.pixelStorei(_t.UNPACK_SKIP_PIXELS,t.min.x),_t.pixelStorei(_t.UNPACK_SKIP_ROWS,t.min.y),_t.pixelStorei(_t.UNPACK_SKIP_IMAGES,t.min.z),i.isDataTexture||i.isData3DTexture?_t.texSubImage3D(h,r,e.x,e.y,e.z,s,o,a,l,c,v.data):i.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),_t.compressedTexSubImage3D(h,r,e.x,e.y,e.z,s,o,a,l,v.data)):_t.texSubImage3D(h,r,e.x,e.y,e.z,s,o,a,l,c,v),_t.pixelStorei(_t.UNPACK_ROW_LENGTH,u),_t.pixelStorei(_t.UNPACK_IMAGE_HEIGHT,d),_t.pixelStorei(_t.UNPACK_SKIP_PIXELS,p),_t.pixelStorei(_t.UNPACK_SKIP_ROWS,f),_t.pixelStorei(_t.UNPACK_SKIP_IMAGES,m),0===r&&n.generateMipmaps&&_t.generateMipmap(h),J.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?$.setTextureCube(t,0):t.isData3DTexture?$.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?$.setTexture2DArray(t,0):$.setTexture2D(t,0),J.unbindTexture()},this.resetState=function(){_=0,y=0,x=null,J.reset(),gt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class po extends uo{}po.prototype.isWebGL1Renderer=!0;class fo{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new oe(t),this.density=e}clone(){return new fo(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class mo{constructor(t,e=1,i=1e3){this.isFog=!0,this.name="",this.color=new oe(t),this.near=e,this.far=i}clone(){return new mo(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class go extends yi{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.backgroundIntensity=this.backgroundIntensity),e}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(t){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=t}}class vo{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Et,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ot()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let n=0,r=this.stride;n<r;n++)this.array[t+n]=e.array[i+n];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Ot()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Ot()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const _o=new _e;class yo{constructor(t,e,i,n=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=!0===n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,i=this.data.count;e<i;e++)_o.fromBufferAttribute(this,e),_o.applyMatrix4(t),this.setXYZ(e,_o.x,_o.y,_o.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)_o.fromBufferAttribute(this,e),_o.applyNormalMatrix(t),this.setXYZ(e,_o.x,_o.y,_o.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)_o.fromBufferAttribute(this,e),_o.transformDirection(t),this.setXYZ(e,_o.x,_o.y,_o.z);return this}setX(t,e){return this.normalized&&(e=Ht(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Ht(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Ht(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Ht(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=kt(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=kt(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=kt(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=kt(e,this.array)),e}setXY(t,e,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Ht(e,this.array),i=Ht(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=Ht(e,this.array),i=Ht(i,this.array),n=Ht(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this}setXYZW(t,e,i,n,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=Ht(e,this.array),i=Ht(i,this.array),n=Ht(n,this.array),r=Ht(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this.data.array[t+3]=r,this}clone(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return new Ui(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new yo(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class xo extends Ii{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new oe(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let Mo;const bo=new _e,wo=new _e,So=new _e,Eo=new Vt,To=new Vt,Ao=new qe,Ro=new _e,Co=new _e,Lo=new _e,Po=new Vt,Io=new Vt,Oo=new Vt;class Do extends yi{constructor(t){if(super(),this.isSprite=!0,this.type="Sprite",void 0===Mo){Mo=new Yi;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),e=new vo(t,5);Mo.setIndex([0,1,2,0,2,3]),Mo.setAttribute("position",new yo(e,3,0,!1)),Mo.setAttribute("uv",new yo(e,2,3,!1))}this.geometry=Mo,this.material=void 0!==t?t:new xo,this.center=new Vt(.5,.5)}raycast(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),wo.setFromMatrixScale(this.matrixWorld),Ao.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),So.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&wo.multiplyScalar(-So.z);const i=this.material.rotation;let n,r;0!==i&&(r=Math.cos(i),n=Math.sin(i));const s=this.center;No(Ro.set(-.5,-.5,0),So,s,wo,n,r),No(Co.set(.5,-.5,0),So,s,wo,n,r),No(Lo.set(.5,.5,0),So,s,wo,n,r),Po.set(0,0),Io.set(1,0),Oo.set(1,1);let o=t.ray.intersectTriangle(Ro,Co,Lo,!1,bo);if(null===o&&(No(Co.set(-.5,.5,0),So,s,wo,n,r),Io.set(0,1),o=t.ray.intersectTriangle(Ro,Lo,Co,!1,bo),null===o))return;const a=t.ray.origin.distanceTo(bo);a<t.near||a>t.far||e.push({distance:a,point:bo.clone(),uv:Li.getUV(bo,Ro,Co,Lo,Po,Io,Oo,new Vt),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function No(t,e,i,n,r,s){Eo.subVectors(t,i).addScalar(.5).multiply(n),void 0!==r?(To.x=s*Eo.x-r*Eo.y,To.y=r*Eo.x+s*Eo.y):To.copy(Eo),t.copy(e),t.x+=To.x,t.y+=To.y,t.applyMatrix4(Ao)}const Uo=new _e,Fo=new _e;class zo extends yi{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,i=e.length;t<i;t++){const i=e[t];this.addLevel(i.object.clone(),i.distance,i.hysteresis)}return this.autoUpdate=t.autoUpdate,this}addLevel(t,e=0,i=0){e=Math.abs(e);const n=this.levels;let r;for(r=0;r<n.length&&!(e<n[r].distance);r++);return n.splice(r,0,{distance:e,hysteresis:i,object:t}),this.add(t),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(t){const e=this.levels;if(e.length>0){let i,n;for(i=1,n=e.length;i<n;i++){let n=e[i].distance;if(e[i].object.visible&&(n-=n*e[i].hysteresis),t<n)break}return e[i-1].object}return null}raycast(t,e){if(this.levels.length>0){Uo.setFromMatrixPosition(this.matrixWorld);const i=t.ray.origin.distanceTo(Uo);this.getObjectForDistance(i).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){Uo.setFromMatrixPosition(t.matrixWorld),Fo.setFromMatrixPosition(this.matrixWorld);const i=Uo.distanceTo(Fo)/t.zoom;let n,r;for(e[0].object.visible=!0,n=1,r=e.length;n<r;n++){let t=e[n].distance;if(e[n].object.visible&&(t-=t*e[n].hysteresis),!(i>=t))break;e[n-1].object.visible=!1,e[n].object.visible=!0}for(this._currentLevel=n-1;n<r;n++)e[n].object.visible=!1}}toJSON(t){const e=super.toJSON(t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];const i=this.levels;for(let t=0,n=i.length;t<n;t++){const n=i[t];e.object.levels.push({object:n.object.uuid,distance:n.distance,hysteresis:n.hysteresis})}return e}}const Bo=new _e,ko=new pe,Ho=new pe,Go=new _e,Vo=new qe;class Wo extends dn{constructor(t,e){super(t,e),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new qe,this.bindMatrixInverse=new qe}copy(t,e){return super.copy(t,e),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new pe,e=this.geometry.attributes.skinWeight;for(let i=0,n=e.count;i<n;i++){t.fromBufferAttribute(e,i);const n=1/t.manhattanLength();n!==1/0?t.multiplyScalar(n):t.set(1,0,0,0),e.setXYZW(i,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(t,e){const i=this.skeleton,n=this.geometry;ko.fromBufferAttribute(n.attributes.skinIndex,t),Ho.fromBufferAttribute(n.attributes.skinWeight,t),Bo.copy(e).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let t=0;t<4;t++){const n=Ho.getComponent(t);if(0!==n){const r=ko.getComponent(t);Vo.multiplyMatrices(i.bones[r].matrixWorld,i.boneInverses[r]),e.addScaledVector(Go.copy(Bo).applyMatrix4(Vo),n)}}return e.applyMatrix4(this.bindMatrixInverse)}}class Xo extends yi{constructor(){super(),this.isBone=!0,this.type="Bone"}}class jo extends de{constructor(t=null,e=1,i=1,n,r,s,o,a,l=1003,c=1003,h,u){super(null,s,o,a,l,c,n,r,h,u),this.isDataTexture=!0,this.image={data:t,width:e,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Yo=new qe,qo=new qe;class Zo{constructor(t=[],e=[]){this.uuid=Ot(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new qe)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){const e=new qe;this.bones[t]&&e.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(e)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&e.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.copy(e.parent.matrixWorld).invert(),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}}update(){const t=this.bones,e=this.boneInverses,i=this.boneMatrices,n=this.boneTexture;for(let n=0,r=t.length;n<r;n++){const r=t[n]?t[n].matrixWorld:qo;Yo.multiplyMatrices(r,e[n]),Yo.toArray(i,16*n)}null!==n&&(n.needsUpdate=!0)}clone(){return new Zo(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(4*this.bones.length);t=zt(t),t=Math.max(t,4);const e=new Float32Array(t*t*4);e.set(this.boneMatrices);const i=new jo(e,t,t,z,N);return i.needsUpdate=!0,this.boneMatrices=e,this.boneTexture=i,this.boneTextureSize=t,this}getBoneByName(t){for(let e=0,i=this.bones.length;e<i;e++){const i=this.bones[e];if(i.name===t)return i}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let i=0,n=t.bones.length;i<n;i++){const n=t.bones[i];let r=e[n];void 0===r&&(console.warn("THREE.Skeleton: No bone found with UUID:",n),r=new Xo),this.bones.push(r),this.boneInverses.push((new qe).fromArray(t.boneInverses[i]))}return this.init(),this}toJSON(){const t={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;const e=this.bones,i=this.boneInverses;for(let n=0,r=e.length;n<r;n++){const r=e[n];t.bones.push(r.uuid);const s=i[n];t.boneInverses.push(s.toArray())}return t}}class Jo extends Ui{constructor(t,e,i,n=1){super(t,e,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}const Ko=new qe,Qo=new qe,$o=[],ta=new qe,ea=new dn;class ia extends dn{constructor(t,e,i){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new Jo(new Float32Array(16*i),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1;for(let t=0;t<i;t++)this.setMatrixAt(t,ta)}copy(t,e){return super.copy(t,e),this.instanceMatrix.copy(t.instanceMatrix),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,this}getColorAt(t,e){e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){e.fromArray(this.instanceMatrix.array,16*t)}raycast(t,e){const i=this.matrixWorld,n=this.count;if(ea.geometry=this.geometry,ea.material=this.material,void 0!==ea.material)for(let r=0;r<n;r++){this.getMatrixAt(r,Ko),Qo.multiplyMatrices(i,Ko),ea.matrixWorld=Qo,ea.raycast(t,$o);for(let t=0,i=$o.length;t<i;t++){const i=$o[t];i.instanceId=r,i.object=this,e.push(i)}$o.length=0}}setColorAt(t,e){null===this.instanceColor&&(this.instanceColor=new Jo(new Float32Array(3*this.instanceMatrix.count),3)),e.toArray(this.instanceColor.array,3*t)}setMatrixAt(t,e){e.toArray(this.instanceMatrix.array,16*t)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}class na extends Ii{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new oe(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const ra=new _e,sa=new _e,oa=new qe,aa=new Ye,la=new Be;class ca extends yi{constructor(t=new Yi,e=new na){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,i=[0];for(let t=1,n=e.count;t<n;t++)ra.fromBufferAttribute(e,t-1),sa.fromBufferAttribute(e,t),i[t]=i[t-1],i[t]+=ra.distanceTo(sa);t.setAttribute("lineDistance",new Bi(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const i=this.geometry,n=this.matrixWorld,r=t.params.Line.threshold,s=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),la.copy(i.boundingSphere),la.applyMatrix4(n),la.radius+=r,!1===t.ray.intersectsSphere(la))return;oa.copy(n).invert(),aa.copy(t.ray).applyMatrix4(oa);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,l=new _e,c=new _e,h=new _e,u=new _e,d=this.isLineSegments?2:1,p=i.index,f=i.attributes.position;if(null!==p){for(let i=Math.max(0,s.start),n=Math.min(p.count,s.start+s.count)-1;i<n;i+=d){const n=p.getX(i),r=p.getX(i+1);l.fromBufferAttribute(f,n),c.fromBufferAttribute(f,r);if(aa.distanceSqToSegment(l,c,u,h)>a)continue;u.applyMatrix4(this.matrixWorld);const s=t.ray.origin.distanceTo(u);s<t.near||s>t.far||e.push({distance:s,point:h.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else{for(let i=Math.max(0,s.start),n=Math.min(f.count,s.start+s.count)-1;i<n;i+=d){l.fromBufferAttribute(f,i),c.fromBufferAttribute(f,i+1);if(aa.distanceSqToSegment(l,c,u,h)>a)continue;u.applyMatrix4(this.matrixWorld);const n=t.ray.origin.distanceTo(u);n<t.near||n>t.far||e.push({distance:n,point:h.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){const e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}const ha=new _e,ua=new _e;class da extends ca{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,i=[];for(let t=0,n=e.count;t<n;t+=2)ha.fromBufferAttribute(e,t),ua.fromBufferAttribute(e,t+1),i[t]=0===t?0:i[t-1],i[t+1]=i[t]+ha.distanceTo(ua);t.setAttribute("lineDistance",new Bi(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class pa extends ca{constructor(t,e){super(t,e),this.isLineLoop=!0,this.type="LineLoop"}}class fa extends Ii{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new oe(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}const ma=new qe,ga=new Ye,va=new Be,_a=new _e;class ya extends yi{constructor(t=new Yi,e=new fa){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=t.material,this.geometry=t.geometry,this}raycast(t,e){const i=this.geometry,n=this.matrixWorld,r=t.params.Points.threshold,s=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),va.copy(i.boundingSphere),va.applyMatrix4(n),va.radius+=r,!1===t.ray.intersectsSphere(va))return;ma.copy(n).invert(),ga.copy(t.ray).applyMatrix4(ma);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,l=i.index,c=i.attributes.position;if(null!==l){for(let i=Math.max(0,s.start),r=Math.min(l.count,s.start+s.count);i<r;i++){const r=l.getX(i);_a.fromBufferAttribute(c,r),xa(_a,r,a,n,t,e,this)}}else{for(let i=Math.max(0,s.start),r=Math.min(c.count,s.start+s.count);i<r;i++)_a.fromBufferAttribute(c,i),xa(_a,i,a,n,t,e,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){const e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function xa(t,e,i,n,r,s,o){const a=ga.distanceSqToPoint(t);if(a<i){const i=new _e;ga.closestPointToPoint(t,i),i.applyMatrix4(n);const l=r.ray.origin.distanceTo(i);if(l<r.near||l>r.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:i,index:e,face:null,object:o})}}class Ma extends de{constructor(t,e,i,n,r,s,o,a,l,c,h,u){super(null,s,o,a,l,c,n,r,h,u),this.isCompressedTexture=!0,this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class ba{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,n=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)i=this.getPoint(s/t),r+=i.distanceTo(n),e.push(r),n=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const i=this.getLengths();let n=0;const r=i.length;let s;s=e||t*i[r-1];let o,a=0,l=r-1;for(;a<=l;)if(n=Math.floor(a+(l-a)/2),o=i[n]-s,o<0)a=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(n=l,i[n]===s)return n/(r-1);const c=i[n];return(n+(s-c)/(i[n+1]-c))/(r-1)}getTangent(t,e){const i=1e-4;let n=t-i,r=t+i;n<0&&(n=0),r>1&&(r=1);const s=this.getPoint(n),o=this.getPoint(r),a=e||(s.isVector2?new Vt:new _e);return a.copy(o).sub(s).normalize(),a}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){const i=new _e,n=[],r=[],s=[],o=new _e,a=new qe;for(let e=0;e<=t;e++){const i=e/t;n[e]=this.getTangentAt(i,new _e)}r[0]=new _e,s[0]=new _e;let l=Number.MAX_VALUE;const c=Math.abs(n[0].x),h=Math.abs(n[0].y),u=Math.abs(n[0].z);c<=l&&(l=c,i.set(1,0,0)),h<=l&&(l=h,i.set(0,1,0)),u<=l&&i.set(0,0,1),o.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],o),s[0].crossVectors(n[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),o.crossVectors(n[e-1],n[e]),o.length()>Number.EPSILON){o.normalize();const t=Math.acos(Dt(n[e-1].dot(n[e]),-1,1));r[e].applyMatrix4(a.makeRotationAxis(o,t))}s[e].crossVectors(n[e],r[e])}if(!0===e){let e=Math.acos(Dt(r[0].dot(r[t]),-1,1));e/=t,n[0].dot(o.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(a.makeRotationAxis(n[i],e*i)),s[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class wa extends ba{constructor(t=0,e=0,i=1,n=1,r=0,s=2*Math.PI,o=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(t,e){const i=e||new Vt,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=s?0:n),!0!==this.aClockwise||s||(r===n?r=-n:r-=n);const o=this.aStartAngle+t*r;let a=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),i=a-this.aX,n=l-this.aY;a=i*t-n*e+this.aX,l=i*e+n*t+this.aY}return i.set(a,l)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}class Sa extends wa{constructor(t,e,i,n,r,s){super(t,e,i,i,n,r,s),this.isArcCurve=!0,this.type="ArcCurve"}}function Ea(){let t=0,e=0,i=0,n=0;function r(r,s,o,a){t=r,e=o,i=-3*r+3*s-2*o-a,n=2*r-2*s+o+a}return{initCatmullRom:function(t,e,i,n,s){r(e,i,s*(i-t),s*(n-e))},initNonuniformCatmullRom:function(t,e,i,n,s,o,a){let l=(e-t)/s-(i-t)/(s+o)+(i-e)/o,c=(i-e)/o-(n-e)/(o+a)+(n-i)/a;l*=o,c*=o,r(e,i,l,c)},calc:function(r){const s=r*r;return t+e*r+i*s+n*(s*r)}}}const Ta=new _e,Aa=new Ea,Ra=new Ea,Ca=new Ea;class La extends ba{constructor(t=[],e=!1,i="centripetal",n=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=n}getPoint(t,e=new _e){const i=e,n=this.points,r=n.length,s=(r-(this.closed?0:1))*t;let o,a,l=Math.floor(s),c=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?o=n[(l-1)%r]:(Ta.subVectors(n[0],n[1]).add(n[0]),o=Ta);const h=n[l%r],u=n[(l+1)%r];if(this.closed||l+2<r?a=n[(l+2)%r]:(Ta.subVectors(n[r-1],n[r-2]).add(n[r-1]),a=Ta),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(o.distanceToSquared(h),t),i=Math.pow(h.distanceToSquared(u),t),n=Math.pow(u.distanceToSquared(a),t);i<1e-4&&(i=1),e<1e-4&&(e=i),n<1e-4&&(n=i),Aa.initNonuniformCatmullRom(o.x,h.x,u.x,a.x,e,i,n),Ra.initNonuniformCatmullRom(o.y,h.y,u.y,a.y,e,i,n),Ca.initNonuniformCatmullRom(o.z,h.z,u.z,a.z,e,i,n)}else"catmullrom"===this.curveType&&(Aa.initCatmullRom(o.x,h.x,u.x,a.x,this.tension),Ra.initCatmullRom(o.y,h.y,u.y,a.y,this.tension),Ca.initCatmullRom(o.z,h.z,u.z,a.z,this.tension));return i.set(Aa.calc(c),Ra.calc(c),Ca.calc(c)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){const i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push((new _e).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function Pa(t,e,i,n,r){const s=.5*(n-e),o=.5*(r-i),a=t*t;return(2*i-2*n+s+o)*(t*a)+(-3*i+3*n-2*s-o)*a+s*t+i}function Ia(t,e,i,n){return function(t,e){const i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}function Oa(t,e,i,n,r){return function(t,e){const i=1-t;return i*i*i*e}(t,e)+function(t,e){const i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,r)}class Da extends ba{constructor(t=new Vt,e=new Vt,i=new Vt,n=new Vt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=n}getPoint(t,e=new Vt){const i=e,n=this.v0,r=this.v1,s=this.v2,o=this.v3;return i.set(Oa(t,n.x,r.x,s.x,o.x),Oa(t,n.y,r.y,s.y,o.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Na extends ba{constructor(t=new _e,e=new _e,i=new _e,n=new _e){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=n}getPoint(t,e=new _e){const i=e,n=this.v0,r=this.v1,s=this.v2,o=this.v3;return i.set(Oa(t,n.x,r.x,s.x,o.x),Oa(t,n.y,r.y,s.y,o.y),Oa(t,n.z,r.z,s.z,o.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Ua extends ba{constructor(t=new Vt,e=new Vt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new Vt){const i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){const i=e||new Vt;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Fa extends ba{constructor(t=new _e,e=new _e){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new _e){const i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class za extends ba{constructor(t=new Vt,e=new Vt,i=new Vt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new Vt){const i=e,n=this.v0,r=this.v1,s=this.v2;return i.set(Ia(t,n.x,r.x,s.x),Ia(t,n.y,r.y,s.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Ba extends ba{constructor(t=new _e,e=new _e,i=new _e){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new _e){const i=e,n=this.v0,r=this.v1,s=this.v2;return i.set(Ia(t,n.x,r.x,s.x),Ia(t,n.y,r.y,s.y),Ia(t,n.z,r.z,s.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class ka extends ba{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new Vt){const i=e,n=this.points,r=(n.length-1)*t,s=Math.floor(r),o=r-s,a=n[0===s?s:s-1],l=n[s],c=n[s>n.length-2?n.length-1:s+1],h=n[s>n.length-3?n.length-1:s+2];return i.set(Pa(o,a.x,l.x,c.x,h.x),Pa(o,a.y,l.y,c.y,h.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push(i.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){const i=this.points[e];t.points.push(i.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push((new Vt).fromArray(i))}return this}}var Ha=Object.freeze({__proto__:null,ArcCurve:Sa,CatmullRomCurve3:La,CubicBezierCurve:Da,CubicBezierCurve3:Na,EllipseCurve:wa,LineCurve:Ua,LineCurve3:Fa,QuadraticBezierCurve:za,QuadraticBezierCurve3:Ba,SplineCurve:ka});class Ga extends ba{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Ua(e,t))}getPoint(t,e){const i=t*this.getLength(),n=this.getCurveLengths();let r=0;for(;r<n.length;){if(n[r]>=i){const t=n[r]-i,s=this.curves[r],o=s.getLength(),a=0===o?0:1-t/o;return s.getPointAt(a,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let i=0,n=this.curves.length;i<n;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let i;for(let n=0,r=this.curves;n<r.length;n++){const s=r[n],o=s.isEllipseCurve?2*t:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?t*s.points.length:t,a=s.getPoints(o);for(let t=0;t<a.length;t++){const n=a[t];i&&i.equals(n)||(e.push(n),i=n)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){const i=this.curves[e];t.curves.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const i=t.curves[e];this.curves.push((new Ha[i.type]).fromJSON(i))}return this}}class Va extends Ga{constructor(t){super(),this.type="Path",this.currentPoint=new Vt,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const i=new Ua(this.currentPoint.clone(),new Vt(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,n){const r=new za(this.currentPoint.clone(),new Vt(t,e),new Vt(i,n));return this.curves.push(r),this.currentPoint.set(i,n),this}bezierCurveTo(t,e,i,n,r,s){const o=new Da(this.currentPoint.clone(),new Vt(t,e),new Vt(i,n),new Vt(r,s));return this.curves.push(o),this.currentPoint.set(r,s),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),i=new ka(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,n,r,s){const o=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(t+o,e+a,i,n,r,s),this}absarc(t,e,i,n,r,s){return this.absellipse(t,e,i,i,n,r,s),this}ellipse(t,e,i,n,r,s,o,a){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+l,e+c,i,n,r,s,o,a),this}absellipse(t,e,i,n,r,s,o,a){const l=new wa(t,e,i,n,r,s,o,a);if(this.curves.length>0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class Wa extends Yi{constructor(t=[new Vt(0,-.5),new Vt(.5,0),new Vt(0,.5)],e=12,i=0,n=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},e=Math.floor(e),n=Dt(n,0,2*Math.PI);const r=[],s=[],o=[],a=[],l=[],c=1/e,h=new _e,u=new Vt,d=new _e,p=new _e,f=new _e;let m=0,g=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),a.push(d.x,d.y,d.z);break;case t.length-1:a.push(f.x,f.y,f.z);break;default:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),a.push(d.x,d.y,d.z),f.copy(p)}for(let r=0;r<=e;r++){const d=i+r*c*n,p=Math.sin(d),f=Math.cos(d);for(let i=0;i<=t.length-1;i++){h.x=t[i].x*p,h.y=t[i].y,h.z=t[i].x*f,s.push(h.x,h.y,h.z),u.x=r/e,u.y=i/(t.length-1),o.push(u.x,u.y);const n=a[3*i+0]*p,c=a[3*i+1],d=a[3*i+0]*f;l.push(n,c,d)}}for(let i=0;i<e;i++)for(let e=0;e<t.length-1;e++){const n=e+i*t.length,s=n,o=n+t.length,a=n+t.length+1,l=n+1;r.push(s,o,l),r.push(a,l,o)}this.setIndex(r),this.setAttribute("position",new Bi(s,3)),this.setAttribute("uv",new Bi(o,2)),this.setAttribute("normal",new Bi(l,3))}static fromJSON(t){return new Wa(t.points,t.segments,t.phiStart,t.phiLength)}}class Xa extends Wa{constructor(t=1,e=1,i=4,n=8){const r=new Va;r.absarc(0,-e/2,t,1.5*Math.PI,0),r.absarc(0,e/2,t,0,.5*Math.PI),super(r.getPoints(i),n),this.type="CapsuleGeometry",this.parameters={radiu
vendor: 2,479 bytes, line 2
2s:t,height:e,capSegments:i,radialSegments:n}}static fromJSON(t){return new Xa(t.radius,t.length,t.capSegments,t.radialSegments)}}class ja extends Yi{constructor(t=1,e=8,i=0,n=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},e=Math.max(3,e);const r=[],s=[],o=[],a=[],l=new _e,c=new Vt;s.push(0,0,0),o.push(0,0,1),a.push(.5,.5);for(let r=0,h=3;r<=e;r++,h+=3){const u=i+r/e*n;l.x=t*Math.cos(u),l.y=t*Math.sin(u),s.push(l.x,l.y,l.z),o.push(0,0,1),c.x=(s[h]/t+1)/2,c.y=(s[h+1]/t+1)/2,a.push(c.x,c.y)}for(let t=1;t<=e;t++)r.push(t,t+1,0);this.setIndex(r),this.setAttribute("position",new Bi(s,3)),this.setAttribute("normal",new Bi(o,3)),this.setAttribute("uv",new Bi(a,2))}static fromJSON(t){return new ja(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class Ya extends Yi{constructor(t=1,e=1,i=1,n=8,r=1,s=!1,o=0,a=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:a};const l=this;n=Math.floor(n),r=Math.floor(r);const c=[],h=[],u=[],d=[];let p=0;const f=[],m=i/2;let g=0;function v(i){const r=p,s=new Vt,f=new _e;let v=0;const _=!0===i?t:e,y=!0===i?1:-1;for(let t=1;t<=n;t++)h.push(0,m*y,0),u.push(0,y,0),d.push(.5,.5),p++;const x=p;for(let t=0;t<=n;t++){const e=t/n*a+o,i=Math.cos(e),r=Math.sin(e);f.x=_*r,f.y=m*y,f.z=_*i,h.push(f.x,f.y,f.z),u.push(0,y,0),s.x=.5*i+.5,s.y=.5*r*y+.5,d.push(s.x,s.y),p++}for(let t=0;t<n;t++){const e=r+t,n=x+t;!0===i?c.push(n,n+1,e):c.push(n+1,n,e),v+=3}l.addGroup(g,v,!0===i?1:2),g+=v}!function(){const s=new _e,v=new _e;let _=0;const y=(e-t)/i;for(let l=0;l<=r;l++){const c=[],g=l/r,_=g*(e-t)+t;for(let t=0;t<=n;t++){const e=t/n,r=e*a+o,l=Math.sin(r),f=Math.cos(r);v.x=_*l,v.y=-g*i+m,v.z=_*f,h.push(v.x,v.y,v.z),s.set(l,y,f).normalize(),u.push(s.x,s.y,s.z),d.push(e,1-g),c.push(p++)}f.push(c)}for(let t=0;t<n;t++)for(let e=0;e<r;e++){const i=f[e][t],n=f[e+1][t],r=f[e+1][t+1],s=f[e][t+1];c.push(i,n,s),c.push(n,r,s),_+=6}l.addGroup(g,_,0),g+=_}(),!1===s&&(t>0&&v(!0),e>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new Bi(h,3)),this.setAttribute("normal",new Bi(u,3)),this.setAttribute("uv",new Bi(d,2))}static fromJSON(t){return new Ya(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class qa extends Ya{constructor(t=1,e=1,i=8,n=1,r=!1,s=0,o=2*Math.PI){super(0,t,e,i,n,r,s,o),this.type="C
2oneGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:s,thetaLength:o}}static fromJSON(t){return new qa(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Za extends Yi{constructor(t=[],e=[],i=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:n};const r=[],s=[];function o(t,e,i,n){const r=n+1,s=[];for(let n=0;n<=r;n++){s[n]=[];const o=t.clone().lerp(i,n/r),a=e.clone().lerp(i,n/r),l=r-n;for(let t=0;t<=l;t++)s[n][t]=0===t&&n===r?o:o.clone().lerp(a,t/l)}for(let t=0;t<r;t++)for(let e=0;e<2*(r-t)-1;e++){const i=Math.floor(e/2);e%2==0?(a(s[t][i+1]),a(s[t+1][i]),a(s[t][i])):(a(s[t][i+1]),a(s[t+1][i+1]),a(s[t+1][i]))}}function a(t){r.push(t.x,t.y,t.z)}function l(e,i){const n=3*e;i.x=t[n+0],i.y=t[n+1],i.z=t[n+2]}function c(t,e,i,n){n<0&&1===t.x&&(s[e]=t.x-1),0===i.x&&0===i.z&&(s[e]=n/2/Math.PI+.5)}function h(t){return Math.atan2(t.z,-t.x)}function u(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}!function(t){const i=new _e,n=new _e,r=new _e;for(let s=0;s<e.length;s+=3)l(e[s+0],i),l(e[s+1],n),l(e[s+2],r),o(i,n,r,t)}(n),function(t){const e=new _e;for(let i=0;i<r.length;i+=3)e.x=r[i+0],e.y=r[i+1],e.z=r[i+2],e.normalize().multiplyScalar(t),r[i+0]=e.x,r[i+1]=e.y,r[i+2]=e.z}(i),function(){const t=new _e;for(let e=0;e<r.length;e+=3){t.x=r[e+0],t.y=r[e+1],t.z=r[e+2];const i=h(t)/2/Math.PI+.5,n=u(t)/Math.PI+.5;s.push(i,1-n)}(function(){const t=new _e,e=new _e,i=new _e,n=new _e,o=new Vt,a=new Vt,l=new Vt;for(let u=0,d=0;u<r.length;u+=9,d+=6){t.set(r[u+0],r[u+1],r[u+2]),e.set(r[u+3],r[u+4],r[u+5]),i.set(r[u+6],r[u+7],r[u+8]),o.set(s[d+0],s[d+1]),a.set(s[d+2],s[d+3]),l.set(s[d+4],s[d+5]),n.copy(t).add(e).add(i).divideScalar(3);const p=h(n);c(o,d+0,t,p),c(a,d+2,e,p),c(l,d+4,i,p)}})(),function(){for(let t=0;t<s.length;t+=6){const e=s[t+0],i=s[t+2],n=s[t+4],r=Math.max(e,i,n),o=Math.min(e,i,n);r>.9&&o<.1&&(e<.2&&(s[t+0]+=1),i<.2&&(s[t+2]+=1),n<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new Bi(r,3)),this.setAttribute("normal",new Bi(r.slice(),3)),this.setAttribute("uv",new Bi(s,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(t){return new Za(t.vertices,t.indices,t.radius,t.details)}}class Ja extends Za{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2,n=1/i;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,
vendor: 17,453 bytes, line 2
219,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Ja(t.radius,t.detail)}}const Ka=new _e,Qa=new _e,$a=new _e,tl=new Li;class el extends Yi{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const i=4,n=Math.pow(10,i),r=Math.cos(Pt*e),s=t.getIndex(),o=t.getAttribute("position"),a=s?s.count:o.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let t=0;t<a;t+=3){s?(l[0]=s.getX(t),l[1]=s.getX(t+1),l[2]=s.getX(t+2)):(l[0]=t,l[1]=t+1,l[2]=t+2);const{a:e,b:i,c:a}=tl;if(e.fromBufferAttribute(o,l[0]),i.fromBufferAttribute(o,l[1]),a.fromBufferAttribute(o,l[2]),tl.getNormal($a),h[0]=`${Math.round(e.x*n)},${Math.round(e.y*n)},${Math.round(e.z*n)}`,h[1]=`${Math.round(i.x*n)},${Math.round(i.y*n)},${Math.round(i.z*n)}`,h[2]=`${Math.round(a.x*n)},${Math.round(a.y*n)},${Math.round(a.z*n)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let t=0;t<3;t++){const e=(t+1)%3,i=h[t],n=h[e],s=tl[c[t]],o=tl[c[e]],a=`${i}_${n}`,p=`${n}_${i}`;p in u&&u[p]?($a.dot(u[p].normal)<=r&&(d.push(s.x,s.y,s.z),d.push(o.x,o.y,o.z)),u[p]=null):a in u||(u[a]={index0:l[t],index1:l[e],normal:$a.clone()})}}for(const t in u)if(u[t]){const{index0:e,index1:i}=u[t];Ka.fromBufferAttribute(o,e),Qa.fromBufferAttribute(o,i),d.push(Ka.x,Ka.y,Ka.z),d.push(Qa.x,Qa.y,Qa.z)}this.setAttribute("position",new Bi(d,3))}}}class il extends Va{constructor(t){super(t),this.uuid=Ot(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let i=0,n=this.holes.length;i<n;i++)e[i]=this.holes[i].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){const i=t.holes[e];this.holes.push(i.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,i=this.holes.length;e<i;e++){const i=this.holes[e];t.holes.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){const i=t.holes[e];this.holes.push((new Va).fromJSON(i))}return this}}const nl=function(t,e,i=2){const n=e&&e.length,r=n?e[0]*i:t.length;let s=rl(t,0,r,i,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c,h,u,d,p;if(n&&(s=function(t,e,i,n){const r=[];let s,o,a,l,c;for(s=0,o=e.length;s<o;s++)a=e[s]*n,l=s<o-1?e[s+1]*n:t.length,c=rl(t,a,l,n,!1),c===c.next&&(c.steiner=!0),r.push(ml(c));for(r.sort(ul),s=0;s<r.length;s++)i=dl(r[s],i);return i}(t,e,s,i)),t.length>80*i){a=c=t[0],l=h=t[1];for(let e=i;e<r;e+=i)u=t[e],d=t[e+1],u<a&&(a=u),d<l&&(l=d),u>c&&(c=u),d>h&&(h=d);p=Math.max(c-a,h-l),p=0!==p?32767/p:0}return ol(s,o,i,a,l,p,0),o};function rl(t,e,i,n,r){let s,o;if(r===function(t,e,i,n){let r=0;for(let s=e,o=i-n;s<i;s+=n)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}(t,e,i,n)>0)for(s=e;s<i;s+=n)o=El(s,t[s],t[s+1],o);else for(s=i-n;s>=e;s-=n)o=El(s,t[s],t[s+1],o);return o&&yl(o,o.next)&&(Tl(o),o=o.next),o}function sl(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!yl(n,n.next)&&0!==_l(n.prev,n,n.next))n=n.next;else{if(Tl(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function ol(t,e,i,n,r,s,o){if(!t)return;!o&&s&&function(t,e,i,n){let r=t;do{0===r.z&&(r.z=fl(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,i,n,r,s,o,a,l,c=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,n=i,a=0,e=0;e<c&&(a++,n=n.nextZ,n);e++);for(l=c;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,c*=2}while(o>1)}(r)}(t,n,r,s);let a,l,c=t;for(;t.prev!==t.next;)if(a=t.prev,l=t.next,s?ll(t,n,r,s):al(t))e.push(a.i/i|0),e.push(t.i/i|0),e.push(l.i/i|0),Tl(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?ol(t=cl(sl(t),e,i),e,i,n,r,s,2):2===o&&hl(t,e,i,n,r,s):ol(sl(t),e,i,n,r,s,1);break}}function al(t){const e=t.prev,i=t,n=t.next;if(_l(e,i,n)>=0)return!1;const r=e.x,s=i.x,o=n.x,a=e.y,l=i.y,c=n.y,h=r<s?r<o?r:o:s<o?s:o,u=a<l?a<c?a:c:l<c?l:c,d=r>s?r>o?r:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c;let f=n.next;for(;f!==e;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&gl(r,a,s,l,o,c,f.x,f.y)&&_l(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function ll(t,e,i,n){const r=t.prev,s=t,o=t.next;if(_l(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,h=r.y,u=s.y,d=o.y,p=a<l?a<c?a:c:l<c?l:c,f=h<u?h<d?h:d:u<d?u:d,m=a>l?a>c?a:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,v=fl(p,f,e,i,n),_=fl(m,g,e,i,n);let y=t.prevZ,x=t.nextZ;for(;y&&y.z>=v&&x&&x.z<=_;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==r&&y!==o&&gl(a,h,l,u,c,d,y.x,y.y)&&_l(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==r&&x!==o&&gl(a,h,l,u,c,d,x.x,x.y)&&_l(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;y&&y.z>=v;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==r&&y!==o&&gl(a,h,l,u,c,d,y.x,y.y)&&_l(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=_;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==r&&x!==o&&gl(a,h,l,u,c,d,x.x,x.y)&&_l(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function cl(t,e,i){let n=t;do{const r=n.prev,s=n.next.next;!yl(r,s)&&xl(r,n,n.next,s)&&wl(r,s)&&wl(s,r)&&(e.push(r.i/i|0),e.push(n.i/i|0),e.push(s.i/i|0),Tl(n),Tl(n.next),n=t=s),n=n.next}while(n!==t);return sl(n)}function hl(t,e,i,n,r,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&vl(o,t)){let a=Sl(o,t);return o=sl(o,o.next),a=sl(a,a.next),ol(o,e,i,n,r,s,0),void ol(a,e,i,n,r,s,0)}t=t.next}o=o.next}while(o!==t)}function ul(t,e){return t.x-e.x}function dl(t,e){const i=function(t,e){let i,n=e,r=-1/0;const s=t.x,o=t.y;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){const t=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=s&&t>r&&(r=t,i=n.x<n.next.x?n:n.next,t===s))return i}n=n.next}while(n!==e);if(!i)return null;const a=i,l=i.x,c=i.y;let h,u=1/0;n=i;do{s>=n.x&&n.x>=l&&s!==n.x&&gl(o<c?s:r,o,l,c,o<c?r:s,o,n.x,n.y)&&(h=Math.abs(o-n.y)/(s-n.x),wl(n,t)&&(h<u||h===u&&(n.x>i.x||n.x===i.x&&pl(i,n)))&&(i=n,u=h)),n=n.next}while(n!==a);return i}(t,e);if(!i)return e;const n=Sl(i,t);return sl(n,n.next),sl(i,i.next)}function pl(t,e){return _l(t.prev,t,e.prev)<0&&_l(e.next,t,t.next)<0}function fl(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ml(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function gl(t,e,i,n,r,s,o,a){return(r-o)*(e-a)>=(t-o)*(s-a)&&(t-o)*(n-a)>=(i-o)*(e-a)&&(i-o)*(s-a)>=(r-o)*(n-a)}function vl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&xl(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(wl(t,e)&&wl(e,t)&&function(t,e){let i=t,n=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(_l(t.prev,t,e.prev)||_l(t,e.prev,e))||yl(t,e)&&_l(t.prev,t,t.next)>0&&_l(e.prev,e,e.next)>0)}function _l(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function yl(t,e){return t.x===e.x&&t.y===e.y}function xl(t,e,i,n){const r=bl(_l(t,e,i)),s=bl(_l(t,e,n)),o=bl(_l(i,n,t)),a=bl(_l(i,n,e));return r!==s&&o!==a||(!(0!==r||!Ml(t,i,e))||(!(0!==s||!Ml(t,n,e))||(!(0!==o||!Ml(i,t,n))||!(0!==a||!Ml(i,e,n)))))}function Ml(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function bl(t){return t>0?1:t<0?-1:0}function wl(t,e){return _l(t.prev,t,t.next)<0?_l(t,e,t.next)>=0&&_l(t,t.prev,e)>=0:_l(t,e,t.prev)<0||_l(t,t.next,e)<0}function Sl(t,e){const i=new Al(t.i,t.x,t.y),n=new Al(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function El(t,e,i,n){const r=new Al(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Tl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Al(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Rl{static area(t){const e=t.length;let i=0;for(let n=e-1,r=0;r<e;n=r++)i+=t[n].x*t[r].y-t[r].x*t[n].y;return.5*i}static isClockWise(t){return Rl.area(t)<0}static triangulateShape(t,e){const i=[],n=[],r=[];Cl(t),Ll(i,t);let s=t.length;e.forEach(Cl);for(let t=0;t<e.length;t++)n.push(s),s+=e[t].length,Ll(i,e[t]);const o=nl(i,n);for(let t=0;t<o.length;t+=3)r.push(o.slice(t,t+3));return r}}function Cl(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Ll(t,e){for(let i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}class Pl extends Yi{constructor(t=new il([new Vt(.5,.5),new Vt(-.5,.5),new Vt(-.5,-.5),new Vt(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const i=this,n=[],r=[];for(let e=0,i=t.length;e<i;e++){s(t[e])}function s(t){const s=[],o=void 0!==e.curveSegments?e.curveSegments:12,a=void 0!==e.steps?e.steps:1,l=void 0!==e.depth?e.depth:1;let c=void 0===e.bevelEnabled||e.bevelEnabled,h=void 0!==e.bevelThickness?e.bevelThickness:.2,u=void 0!==e.bevelSize?e.bevelSize:h-.1,d=void 0!==e.bevelOffset?e.bevelOffset:0,p=void 0!==e.bevelSegments?e.bevelSegments:3;const f=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:Il;let g,v,_,y,x,M=!1;f&&(g=f.getSpacedPoints(a),M=!0,c=!1,v=f.computeFrenetFrames(a,!1),_=new _e,y=new _e,x=new _e),c||(p=0,h=0,u=0,d=0);const b=t.extractPoints(o);let w=b.shape;const S=b.holes;if(!Rl.isClockWise(w)){w=w.reverse();for(let t=0,e=S.length;t<e;t++){const e=S[t];Rl.isClockWise(e)&&(S[t]=e.reverse())}}const E=Rl.triangulateShape(w,S),T=w;for(let t=0,e=S.length;t<e;t++){const e=S[t];w=w.concat(e)}function A(t,e,i){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(i).add(t)}const R=w.length,C=E.length;function L(t,e,i){let n,r,s;const o=t.x-e.x,a=t.y-e.y,l=i.x-t.x,c=i.y-t.y,h=o*o+a*a,u=o*c-a*l;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-a/u,f=e.y+o/u,m=((i.x-c/d-p)*c-(i.y+l/d-f)*l)/(o*c-a*l);n=p+o*m-t.x,r=f+a*m-t.y;const g=n*n+r*r;if(g<=2)return new Vt(n,r);s=Math.sqrt(g/2)}else{let t=!1;o>Number.EPSILON?l>Number.EPSILON&&(t=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(c)&&(t=!0),t?(n=-a,r=o,s=Math.sqrt(h)):(n=o,r=a,s=Math.sqrt(h/2))}return new Vt(n/s,r/s)}const P=[];for(let t=0,e=T.length,i=e-1,n=t+1;t<e;t++,i++,n++)i===e&&(i=0),n===e&&(n=0),P[t]=L(T[t],T[i],T[n]);const I=[];let O,D=P.concat();for(let t=0,e=S.length;t<e;t++){const e=S[t];O=[];for(let t=0,i=e.length,n=i-1,r=t+1;t<i;t++,n++,r++)n===i&&(n=0),r===i&&(r=0),O[t]=L(e[t],e[n],e[r]);I.push(O),D=D.concat(O)}for(let t=0;t<p;t++){const e=t/p,i=h*Math.cos(e*Math.PI/2),n=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=T.length;t<e;t++){const e=A(T[t],P[t],n);F(e.x,e.y,-i)}for(let t=0,e=S.length;t<e;t++){const e=S[t];O=I[t];for(let t=0,r=e.length;t<r;t++){const r=A(e[t],O[t],n);F(r.x,r.y,-i)}}}const N=u+d;for(let t=0;t<R;t++){const e=c?A(w[t],D[t],N):w[t];M?(y.copy(v.normals[0]).multiplyScalar(e.x),_.copy(v.binormals[0]).multiplyScalar(e.y),x.copy(g[0]).add(y).add(_),F(x.x,x.y,x.z)):F(e.x,e.y,0)}for(let t=1;t<=a;t++)for(let e=0;e<R;e++){const i=c?A(w[e],D[e],N):w[e];M?(y.copy(v.normals[t]).multiplyScalar(i.x),_.copy(v.binormals[t]).multiplyScalar(i.y),x.copy(g[t]).add(y).add(_),F(x.x,x.y,x.z)):F(i.x,i.y,l/a*t)}for(let t=p-1;t>=0;t--){const e=t/p,i=h*Math.cos(e*Math.PI/2),n=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=T.length;t<e;t++){const e=A(T[t],P[t],n);F(e.x,e.y,l+i)}for(let t=0,e=S.length;t<e;t++){const e=S[t];O=I[t];for(let t=0,r=e.length;t<r;t++){const r=A(e[t],O[t],n);M?F(r.x,r.y+g[a-1].y,g[a-1].x+i):F(r.x,r.y,l+i)}}}function U(t,e){let i=t.length;for(;--i>=0;){const n=i;let r=i-1;r<0&&(r=t.length-1);for(let t=0,i=a+2*p;t<i;t++){const i=R*t,s=R*(t+1);B(e+n+i,e+r+i,e+r+s,e+n+s)}}}function F(t,e,i){s.push(t),s.push(e),s.push(i)}function z(t,e,r){k(t),k(e),k(r);const s=n.length/3,o=m.generateTopUV(i,n,s-3,s-2,s-1);H(o[0]),H(o[1]),H(o[2])}function B(t,e,r,s){k(t),k(e),k(s),k(e),k(r),k(s);const o=n.length/3,a=m.generateSideWallUV(i,n,o-6,o-3,o-2,o-1);H(a[0]),H(a[1]),H(a[3]),H(a[1]),H(a[2]),H(a[3])}function k(t){n.push(s[3*t+0]),n.push(s[3*t+1]),n.push(s[3*t+2])}function H(t){r.push(t.x),r.push(t.y)}!function(){const t=n.length/3;if(c){let t=0,e=R*t;for(let t=0;t<C;t++){const i=E[t];z(i[2]+e,i[1]+e,i[0]+e)}t=a+2*p,e=R*t;for(let t=0;t<C;t++){const i=E[t];z(i[0]+e,i[1]+e,i[2]+e)}}else{for(let t=0;t<C;t++){const e=E[t];z(e[2],e[1],e[0])}for(let t=0;t<C;t++){const e=E[t];z(e[0]+R*a,e[1]+R*a,e[2]+R*a)}}i.addGroup(t,n.length/3-t,0)}(),function(){const t=n.length/3;let e=0;U(T,e),e+=T.length;for(let t=0,i=S.length;t<i;t++){const i=S[t];U(i,e),e+=i.length}i.addGroup(t,n.length/3-t,1)}()}this.setAttribute("position",new Bi(n,3)),this.setAttribute("uv",new Bi(r,2)),this.computeVertexNormals()}toJSON(){const t=super.toJSON();return function(t,e,i){if(i.shapes=[],Array.isArray(t))for(let e=0,n=t.length;e<n;e++){const n=t[e];i.shapes.push(n.uuid)}else i.shapes.push(t.uuid);i.options=Object.assign({},e),void 0!==e.extrudePath&&(i.options.extrudePath=e.extrudePath.toJSON());return i}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const i=[];for(let n=0,r=t.shapes.length;n<r;n++){const r=e[t.shapes[n]];i.push(r)}const n=t.options.extrudePath;return void 0!==n&&(t.options.extrudePath=(new Ha[n.type]).fromJSON(n)),new Pl(i,t.options)}}const Il={generateTopUV:function(t,e,i,n,r){const s=e[3*i],o=e[3*i+1],a=e[3*n],l=e[3*n+1],c=e[3*r],h=e[3*r+1];return[new Vt(s,o),new Vt(a,l),new Vt(c,h)]},generateSideWallUV:function(t,e,i,n,r,s){const o=e[3*i],a=e[3*i+1],l=e[3*i+2],c=e[3*n],h=e[3*n+1],u=e[3*n+2],d=e[3*r],p=e[3*r+1],f=e[3*r+2],m=e[3*s],g=e[3*s+1],v=e[3*s+2];return Math.abs(a-h)<Math.abs(o-c)?[new Vt(o,1-l),new Vt(c,1-u),new Vt(d,1-f),new Vt(m,1-v)]:[new Vt(a,1-l),new Vt(h,1-u),new Vt(p,1-f),new Vt(g,1-v)]}};class Ol extends Za{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Ol(t.radius,t.detail)}}class Dl extends Za{constructor(t=1,e=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Dl(t.radius,t.detail)}}class Nl extends Yi{constructor(t=.5,e=1,i=8,n=1,r=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:s},i=Math.max(3,i);const o=[],a=[],l=[],c=[];let h=t;const u=(e-t)/(n=Math.max(1,n)),d=new _e,p=new Vt;for(let t=0;t<=n;t++){for(let t=0;t<=i;t++){const n=r+t/i*s;d.x=h*Math.cos(n),d.y=h*Math.sin(n),a.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(d.x/e+1)/2,p.y=(d.y/e+1)/2,c.push(p.x,p.y)}h+=u}for(let t=0;t<n;t++){const e=t*(i+1);for(let t=0;t<i;t++){const n=t+e,r=n,s=n+i+1,a=n+i+2,l=n+1;o.push(r,s,l),o.push(s,a,l)}}this.setIndex(o),this.setAttribute("position",new Bi(a,3)),this.setAttribute("normal",new Bi(l,3)),this.setAttribute("uv",new Bi(c,2))}static fromJSON(t){return new Nl(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}}class Ul extends Yi{constructor(t=new il([new Vt(0,.5),new Vt(-.5,-.5),new Vt(.5,-.5)]),e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const i=[],n=[],r=[],s=[];let o=0,a=0;if(!1===Array.isArray(t))l(t);else for(let e=0;e<t.length;e++)l(t[e]),this.addGroup(o,a,e),o+=a,a=0;function l(t){const o=n.length/3,l=t.extractPoints(e);let c=l.shape;const h=l.holes;!1===Rl.isClockWise(c)&&(c=c.reverse());for(let t=0,e=h.length;t<e;t++){const e=h[t];!0===Rl.isClockWise(e)&&(h[t]=e.reverse())}const u=Rl.triangulateShape(c,h);for(let t=0,e=h.length;t<e;t++){const e=h[t];c=c.concat(e)}for(let t=0,e=c.length;t<e;t++){const e=c[t];n.push(e.x,e.y,0),r.push(0,0,1),s.push(e.x,e.y)}for(let t=0,e=u.length;t<e;t++){const e=u[t],n=e[0]+o,r=e[1]+o,s=e[2]+o;i.push(n,r,s),a+=3}}this.setIndex(i),this.setAttribute("position",new Bi(n,3)),this.setAttribute("normal",new Bi(r,3)),this.setAttribute("uv",new Bi(s,2))}toJSON(){const t=super.toJSON();return function(t,e){if(e.shapes=[],Array.isArray(t))for(let i=0,n=t.length;i<n;i++){const n=t[i];e.shapes.push(n.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}static fromJSON(t,e){const i=[];for(let n=0,r=t.shapes.length;n<r;n++){const r=e[t.shapes[n]];i.push(r)}return new Ul(i,t.curveSegments)}}class Fl extends Yi{constructor(t=1,e=32,i=16,n=0,r=2*Math.PI,s=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:s,thetaLength:o},e=Math.max(3,Math.floor(e)),i=Math.max(2,Math.floor(i));const a=Math.min(s+o,Math.PI);let l=0;const c=[],h=new _e,u=new _e,d=[],p=[],f=[],m=[];for(let d=0;d<=i;d++){const g=[],v=d/i;let _=0;0==d&&0==s?_=.5/e:d==i&&a==Math.PI&&(_=-.5/e);for(let i=0;i<=e;i++){const a=i/e;
vendor: 4,275 bytes, line 2
2h.x=-t*Math.cos(n+a*r)*Math.sin(s+v*o),h.y=t*Math.cos(s+v*o),h.z=t*Math.sin(n+a*r)*Math.sin(s+v*o),p.push(h.x,h.y,h.z),u.copy(h).normalize(),f.push(u.x,u.y,u.z),m.push(a+_,1-v),g.push(l++)}c.push(g)}for(let t=0;t<i;t++)for(let n=0;n<e;n++){const e=c[t][n+1],r=c[t][n],o=c[t+1][n],l=c[t+1][n+1];(0!==t||s>0)&&d.push(e,r,l),(t!==i-1||a<Math.PI)&&d.push(r,o,l)}this.setIndex(d),this.setAttribute("position",new Bi(p,3)),this.setAttribute("normal",new Bi(f,3)),this.setAttribute("uv",new Bi(m,2))}static fromJSON(t){return new Fl(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class zl extends Za{constructor(t=1,e=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new zl(t.radius,t.detail)}}class Bl extends Yi{constructor(t=1,e=.4,i=8,n=6,r=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},i=Math.floor(i),n=Math.floor(n);const s=[],o=[],a=[],l=[],c=new _e,h=new _e,u=new _e;for(let s=0;s<=i;s++)for(let d=0;d<=n;d++){const p=d/n*r,f=s/i*Math.PI*2;h.x=(t+e*Math.cos(f))*Math.cos(p),h.y=(t+e*Math.cos(f))*Math.sin(p),h.z=e*Math.sin(f),o.push(h.x,h.y,h.z),c.x=t*Math.cos(p),c.y=t*Math.sin(p),u.subVectors(h,c).normalize(),a.push(u.x,u.y,u.z),l.push(d/n),l.push(s/i)}for(let t=1;t<=i;t++)for(let e=1;e<=n;e++){const i=(n+1)*t+e-1,r=(n+1)*(t-1)+e-1,o=(n+1)*(t-1)+e,a=(n+1)*t+e;s.push(i,r,a),s.push(r,o,a)}this.setIndex(s),this.setAttribute("position",new Bi(o,3)),this.setAttribute("normal",new Bi(a,3)),this.setAttribute("uv",new Bi(l,2))}static fromJSON(t){return new Bl(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}}class kl extends Yi{constructor(t=1,e=.4,i=64,n=8,r=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:s},i=Math.floor(i),n=Math.floor(n);const o=[],a=[],l=[],c=[],h=new _e,u=new _e,d=new _e,p=new _e,f=new _e,m=new _e,g=new _e;for(let o=0;o<=i;++o){const _=o/i*r*Math.PI*2;v(_,r,s,t,d),v(_+.01,r,s,t,p),m.subVectors(p,d),g.addVectors(p,d),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let t=0;t<=n;++t){const r=t/n*Math.PI*2,s=-e*Math.cos(r),p=e*Math.sin(r);h.x=d.x+(s*g.x+p*f.x),h.y=d.y+(s*g.y+p*f.y),h.z=d.z+(s*g.z+p*f.z),a.push(h.x,h.y,h.z),u.subVectors(h,d).normalize(),l.push(u.x,u.y,u.z),c.push(o/i),c.push(t/n)}}for(let t=1;t<=i;t++)for(let e=1;e<=n;e++){const i=(n+1)*(t-1)+(e-1),r=(n+1)*t+(e-1),s=(n+1)*t+e,a=(n+1)*(t-1)+e;o.push(i,r,a),o.push(r,s,a)}function v(t,e,i,n,r){const s=Math.cos(t),o=Math.sin(t),a=i/e*t,l=Math.cos(a);r.x=n*(2+l)*.5*s,r.y=n*(2+l)*o*.5,r.z=n*Math.sin(a)*.5}this.setIndex(o),this.setAttribute("position",new Bi(a,3)),this.setAttribute("normal",new Bi(l,3)),this.setAttribute("uv",new Bi(c,2))}static fromJSON(t){return new kl(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}}class Hl extends Yi{constructor(t=new Ba(new _e(-1,-1,0),new _e(-1,1,0),new _e(1,1,0)),e=64,i=1,n=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r};const s=t.computeFrenetFrames(e,r);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const o=new _e,a=new _e,l=new Vt;let c=new _e;const h=[],u=[],d=[],p=[];function f(r){c=t.getPointAt(r/e,c);const l=s.normals[r],d=s.binormals[r];for(let t=0;t<=n;t++){const e=t/n*Math.PI*2,r=Math.sin(e),s=-Math.cos(e);a.x=s*l.x+r*d.x,a.y=s*l.y+r*d.y,a.z=s*l.z+r*d.z,a.normalize(),u.push(a.x,a.y,a.z),o.x=c.x+i*a.x,o.y=c.y+i*a.y,o.z=c.z+i*a.z,h.push(o.x,o.y,o.z)}}!function(){for(let t=0;t<e;t++)f(t);f(!1===r?e:0),function(){for(let t=0;t<=e;t++)for(let i=0;i<=n;i++)l.x=t/e,l.y=i/n,d.push(l.x,l.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=n;e++){const i=(n+1)*(t-1)+(e-1),r=(n+1)*t+(e-1),s=(n+1)*t+e,o=(n+1)*(t-1)+e;p.push(i,r,o),p.push(r,s,o)}}()}(),this.setIndex(p),this.setAttribute("position",new Bi(h,3)),this.setAttribute("normal",new Bi(u,3)),this.setAttribute("uv",new Bi(d,2))}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new Hl((new Ha[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radiu
vendor: 29,151 bytes, line 2
2s,t.radialSegments,t.closed)}}class Gl extends Yi{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){const e=[],i=new Set,n=new _e,r=new _e;if(null!==t.index){const s=t.attributes.position,o=t.index;let a=t.groups;0===a.length&&(a=[{start:0,count:o.count,materialIndex:0}]);for(let t=0,l=a.length;t<l;++t){const l=a[t],c=l.start;for(let t=c,a=c+l.count;t<a;t+=3)for(let a=0;a<3;a++){const l=o.getX(t+a),c=o.getX(t+(a+1)%3);n.fromBufferAttribute(s,l),r.fromBufferAttribute(s,c),!0===Vl(n,r,i)&&(e.push(n.x,n.y,n.z),e.push(r.x,r.y,r.z))}}}else{const s=t.attributes.position;for(let t=0,o=s.count/3;t<o;t++)for(let o=0;o<3;o++){const a=3*t+o,l=3*t+(o+1)%3;n.fromBufferAttribute(s,a),r.fromBufferAttribute(s,l),!0===Vl(n,r,i)&&(e.push(n.x,n.y,n.z),e.push(r.x,r.y,r.z))}}this.setAttribute("position",new Bi(e,3))}}}function Vl(t,e,i){const n=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==i.has(n)&&!0!==i.has(r)&&(i.add(n),i.add(r),!0)}var Wl=Object.freeze({__proto__:null,BoxGeometry:fn,CapsuleGeometry:Xa,CircleGeometry:ja,ConeGeometry:qa,CylinderGeometry:Ya,DodecahedronGeometry:Ja,EdgesGeometry:el,ExtrudeGeometry:Pl,IcosahedronGeometry:Ol,LatheGeometry:Wa,OctahedronGeometry:Dl,PlaneGeometry:Nn,PolyhedronGeometry:Za,RingGeometry:Nl,ShapeGeometry:Ul,SphereGeometry:Fl,TetrahedronGeometry:zl,TorusGeometry:Bl,TorusKnotGeometry:kl,TubeGeometry:Hl,WireframeGeometry:Gl});class Xl extends Ii{constructor(t){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new oe(0),this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.fog=t.fog,this}}class jl extends yn{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class Yl extends Ii{constructor(t){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new oe(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new oe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Vt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class ql extends Yl{constructor(t){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Vt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Dt(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new oe(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new oe(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new oe(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._iridescence=0,this._transmission=0,this.setValues(t)}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class Zl extends Ii{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new oe(16777215),this.specular=new oe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new oe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Vt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Jl extends Ii{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new oe(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new oe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Vt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class Kl extends Ii{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Vt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class Ql extends Ii{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new oe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new oe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Vt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class $l extends Ii{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new oe(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Vt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class tc extends na{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function ec(t,e,i){return nc(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)}function ic(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function nc(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function rc(t){const e=t.length,i=new Array(e);for(let t=0;t!==e;++t)i[t]=t;return i.sort(function(e,i){return t[e]-t[i]}),i}function sc(t,e,i){const n=t.length,r=new t.constructor(n);for(let s=0,o=0;o!==n;++s){const n=i[s]*e;for(let i=0;i!==e;++i)r[o++]=t[n+i]}return r}function oc(t,e,i,n){let r=1,s=t[0];for(;void 0!==s&&void 0===s[n];)s=t[r++];if(void 0===s)return;let o=s[n];if(void 0!==o)if(Array.isArray(o))do{o=s[n],void 0!==o&&(e.push(s.time),i.push.apply(i,o)),s=t[r++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[n],void 0!==o&&(e.push(s.time),o.toArray(i,i.length)),s=t[r++]}while(void 0!==s);else do{o=s[n],void 0!==o&&(e.push(s.time),i.push(o)),s=t[r++]}while(void 0!==s)}var ac=Object.freeze({__proto__:null,arraySlice:ec,convertArray:ic,isTypedArray:nc,getKeyframeOrder:rc,sortedArray:sc,flattenJSON:oc,subclip:function(t,e,i,n,r=30){const s=t.clone();s.name=e;const o=[];for(let t=0;t<s.tracks.length;++t){const e=s.tracks[t],a=e.getValueSize(),l=[],c=[];for(let t=0;t<e.times.length;++t){const s=e.times[t]*r;if(!(s<i||s>=n)){l.push(e.times[t]);for(let i=0;i<a;++i)c.push(e.values[t*a+i])}}0!==l.length&&(e.times=ic(l,e.times.constructor),e.values=ic(c,e.values.constructor),o.push(e))}s.tracks=o;let a=1/0;for(let t=0;t<s.tracks.length;++t)a>s.tracks[t].times[0]&&(a=s.tracks[t].times[0]);for(let t=0;t<s.tracks.length;++t)s.tracks[t].shift(-1*a);return s.resetDuration(),s},makeClipAdditive:function(t,e=0,i=t,n=30){n<=0&&(n=30);const r=i.tracks.length,s=e/n;for(let e=0;e<r;++e){const n=i.tracks[e],r=n.ValueTypeName;if("bool"===r||"string"===r)continue;const o=t.tracks.find(function(t){return t.name===n.name&&t.ValueTypeName===r});if(void 0===o)continue;let a=0;const l=n.getValueSize();n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(a=l/3);let c=0;const h=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=h/3);const u=n.times.length-1;let d;if(s<=n.times[0]){const t=a,e=l-a;d=ec(n.values,t,e)}else if(s>=n.times[u]){const t=u*l+a,e=t+l-a;d=ec(n.values,t,e)}else{const t=n.createInterpolant(),e=a,i=l-a;t.evaluate(s),d=ec(t.resultBuffer,e,i)}if("quaternion"===r){(new ve).fromArray(d).normalize().conjugate().toArray(d)}const p=o.times.length;for(let t=0;t<p;++t){const e=t*h+c;if("quaternion"===r)ve.multiplyQuaternionsFlat(o.values,e,d,0,o.values,e);else{const t=h-2*c;for(let i=0;i<t;++i)o.values[e+i]-=d[i]}}}return t.blendMode=yt,t}});class lc{constructor(t,e,i,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let i=this._cachedIndex,n=e[i],r=e[i-1];t:{e:{let s;i:{n:if(!(t<n)){for(let s=i+2;;){if(void 0===n){if(t<r)break n;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===s)break;if(r=n,n=e[++i],t<n)break e}s=e.length;break i}if(!(t>=r)){const o=e[1];t<o&&(i=2,r=o);for(let s=i-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(i===s)break;if(n=r,r=e[--i-1],t>=r)break e}s=i,i=0;break i}break t}for(;i<s;){const n=i+s>>>1;t<e[n]?s=n:i=n+1}if(n=e[i],r=e[i-1],void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===n)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,t,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n;for(let t=0;t!==n;++t)e[t]=i[r+t];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class cc extends lc{constructor(t,e,i,n){super(t,e,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:mt,endingEnd:mt}}intervalChanged_(t,e,i){const n=this.parameterPositions;let r=t-2,s=t+1,o=n[r],a=n[s];if(void 0===o)switch(this.getSettings_().endingStart){case gt:r=t,o=2*e-i;break;case vt:r=n.length-2,o=e+n[r]-n[r+1];break;default:r=t,o=i}if(void 0===a)switch(this.getSettings_().endingEnd){case gt:s=t,a=2*i-e;break;case vt:s=1,a=i+n[1]-n[0];break;default:s=t-1,a=e}const l=.5*(i-e),c=this.valueSize;this._weightPrev=l/(e-o),this._weightNext=l/(a-i),this._offsetPrev=r*c,this._offsetNext=s*c}interpolate_(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=t*o,l=a-o,c=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(i-e)/(n-e),f=p*p,m=f*p,g=-u*m+2*u*f-u*p,v=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*p+1,_=(-1-d)*m+(1.5+d)*f+.5*p,y=d*m-d*f;for(let t=0;t!==o;++t)r[t]=g*s[c+t]+v*s[l+t]+_*s[a+t]+y*s[h+t];return r}}class hc extends lc{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=t*o,l=a-o,c=(i-e)/(n-e),h=1-c;for(let t=0;t!==o;++t)r[t]=s[l+t]*h+s[a+t]*c;return r}}class uc extends lc{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t){return this.copySampleValue_(t-1)}}class dc{constructor(t,e,i,n){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ic(e,this.TimeBufferType),this.values=ic(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:ic(t.times,Array),values:ic(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(i.interpolation=e)}return i.type=t.ValueTypeName,i}InterpolantFactoryMethodDiscrete(t){return new uc(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new hc(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new cc(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case dt:e=this.InterpolantFactoryMethodDiscrete;break;case pt:e=this.InterpolantFactoryMethodLinear;break;case ft:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return dt;case this.InterpolantFactoryMethodLinear:return pt;case this.InterpolantFactoryMethodSmooth:return ft}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]+=t}return this}scale(t){if(1!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]*=t}return this}trim(t,e){const i=this.times,n=i.length;let r=0,s=n-1;for(;r!==n&&i[r]<t;)++r;for(;-1!==s&&i[s]>e;)--s;if(++s,0!==r||s!==n){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=ec(i,r,s),this.values=ec(this.values,r*t,s*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){const n=i[e];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,n),t=!1;break}if(null!==s&&s>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,n,s),t=!1;break}s=n}if(void 0!==n&&nc(n))for(let e=0,i=n.length;e!==i;++e){const i=n[e];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t}optimize(){const t=ec(this.times),e=ec(this.values),i=this.getValueSize(),n=this.getInterpolation()===ft,r=t.length-1;let s=1;for(let o=1;o<r;++o){let r=!1;const a=t[o];if(a!==t[o+1]&&(1!==o||a!==t[0]))if(n)r=!0;else{const t=o*i,n=t-i,s=t+i;for(let o=0;o!==i;++o){const i=e[t+o];if(i!==e[n+o]||i!==e[s+o]){r=!0;break}}}if(r){if(o!==s){t[s]=t[o];const n=o*i,r=s*i;for(let t=0;t!==i;++t)e[r+t]=e[n+t]}++s}}if(r>0){t[s]=t[r];for(let t=r*i,n=s*i,o=0;o!==i;++o)e[n+o]=e[t+o];++s}return s!==t.length?(this.times=ec(t,0,s),this.values=ec(e,0,s*i)):(this.times=t,this.values=e),this}clone(){const t=ec(this.times,0),e=ec(this.values,0),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}dc.prototype.TimeBufferType=Float32Array,dc.prototype.ValueBufferType=Float32Array,dc.prototype.DefaultInterpolation=pt;class pc extends dc{}pc.prototype.ValueTypeName="bool",pc.prototype.ValueBufferType=Array,pc.prototype.DefaultInterpolation=dt,pc.prototype.InterpolantFactoryMethodLinear=void 0,pc.prototype.InterpolantFactoryMethodSmooth=void 0;class fc extends dc{}fc.prototype.ValueTypeName="color";class mc extends dc{}mc.prototype.ValueTypeName="number";class gc extends lc{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(i-e)/(n-e);let l=t*o;for(let t=l+o;l!==t;l+=4)ve.slerpFlat(r,0,s,l-o,s,l,a);return r}}class vc extends dc{InterpolantFactoryMethodLinear(t){return new gc(this.times,this.values,this.getValueSize(),t)}}vc.prototype.ValueTypeName="quaternion",vc.prototype.DefaultInterpolation=pt,vc.prototype.InterpolantFactoryMethodSmooth=void 0;class _c extends dc{}_c.prototype.ValueTypeName="string",_c.prototype.ValueBufferType=Array,_c.prototype.DefaultInterpolation=dt,_c.prototype.InterpolantFactoryMethodLinear=void 0,_c.prototype.InterpolantFactoryMethodSmooth=void 0;class yc extends dc{}yc.prototype.ValueTypeName="vector";class xc{constructor(t,e=-1,i,n=2500){this.name=t,this.tracks=i,this.duration=e,this.blendMode=n,this.uuid=Ot(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,n=1/(t.fps||1);for(let t=0,r=i.length;t!==r;++t)e.push(Mc(i[t]).scale(n));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,n=i.length;t!==n;++t)e.push(dc.toJSON(i[t]));return n}static CreateFromMorphTargetSequence(t,e,i,n){const r=e.length,s=[];for(let t=0;t<r;t++){let o=[],a=[];o.push((t+r-1)%r,t,(t+1)%r),a.push(0,1,0);const l=rc(o);o=sc(o,1,l),a=sc(a,1,l),n||0!==o[0]||(o.push(r),a.push(a[0])),s.push(new mc(".morphTargetInfluences["+e[t].name+"]",o,a).scale(1/i))}return new this(t,-1,s)}static findByName(t,e){let i=t;if(!Array.isArray(t)){const e=t;i=e.geometry&&e.geometry.animations||e.animations}for(let t=0;t<i.length;t++)if(i[t].name===e)return i[t];return null}static CreateClipsFromMorphTargetSequences(t,e,i){const n={},r=/^([\w-]*?)([\d]+)$/;for(let e=0,i=t.length;e<i;e++){const i=t[e],s=i.name.match(r);if(s&&s.length>1){const t=s[1];let e=n[t];e||(n[t]=e=[]),e.push(i)}}const s=[];for(const t in n)s.push(this.CreateFromMorphTargetSequence(t,n[t],e,i));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(t,e,i,n,r){if(0!==i.length){const s=[],o=[];oc(i,s,o,n),0!==s.length&&r.push(new t(e,s,o))}},n=[],r=t.name||"default",s=t.fps||30,o=t.blendMode;let a=t.length||-1;const l=t.hierarchy||[];for(let t=0;t<l.length;t++){const r=l[t].keys;if(r&&0!==r.length)if(r[0].morphTargets){const t={};let e;for(e=0;e<r.length;e++)if(r[e].morphTargets)for(let i=0;i<r[e].morphTargets.length;i++)t[r[e].morphTargets[i]]=-1;for(const i in t){const t=[],s=[];for(let n=0;n!==r[e].morphTargets.length;++n){const n=r[e];t.push(n.time),s.push(n.morphTarget===i?1:0)}n.push(new mc(".morphTargetInfluence["+i+"]",t,s))}a=t.length*s}else{const s=".bones["+e[t].name+"]";i(yc,s+".position",r,"pos",n),i(vc,s+".quaternion",r,"rot",n),i(yc,s+".scale",r,"scl",n)}}if(0===n.length)return null;return new this(r,a,n,o)}resetDuration(){let t=0;for(let e=0,i=this.tracks.length;e!==i;++e){const i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function Mc(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return mc;case"vector":case"vector2":case"vector3":case"vector4":return yc;case"color":return fc;case"quaternion":return vc;case"bool":case"boolean":return pc;case"string":return _c}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){const e=[],i=[];oc(t.keys,e,i,"value"),t.times=e,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const bc={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class wc{constructor(t,e,i){const n=this;let r,s=!1,o=0,a=0;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){a++,!1===s&&void 0!==n.onStart&&n.onStart(t,o,a),s=!0},this.itemEnd=function(t){o++,void 0!==n.onProgress&&n.onProgress(t,o,a),o===a&&(s=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)},this.resolveURL=function(t){return r?r(t):t},this.setURLModifier=function(t){return r=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){const e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(let e=0,i=l.length;e<i;e+=2){const i=l[e],n=l[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return n}return null}}}const Sc=new wc;class Ec{constructor(t){this.manager=void 0!==t?t:Sc,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const i=this;return new Promise(function(n,r){i.load(t,n,e,r)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const Tc={};class Ac extends Error{constructor(t,e){super(t),this.response=e}}class Rc extends Ec{constructor(t){super(t)}load(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=bc.get(t);if(void 0!==r)return this.manager.itemStart(t),setTimeout(()=>{e&&e(r),this.manager.itemEnd(t)},0),r;if(void 0!==Tc[t])return void Tc[t].push({onLoad:e,onProgress:i,onError:n});Tc[t]=[],Tc[t].push({onLoad:e,onProgress:i,onError:n});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(s).then(e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;
vendor: 6,807 bytes, line 2
2const i=Tc[t],n=e.body.getReader(),r=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),s=r?parseInt(r):0,o=0!==s;let a=0;const l=new ReadableStream({start(t){!function e(){n.read().then(({done:n,value:r})=>{if(n)t.close();else{a+=r.byteLength;const n=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:s});for(let t=0,e=i.length;t<e;t++){const e=i[t];e.onProgress&&e.onProgress(n)}t.enqueue(r),e()}})}()}});return new Response(l)}throw new Ac(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)}).then(t=>{switch(a){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>(new DOMParser).parseFromString(t,o));case"json":return t.json();default:if(void 0===o)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(o),i=e&&e[1]?e[1].toLowerCase():void 0,n=new TextDecoder(i);return t.arrayBuffer().then(t=>n.decode(t))}}}).then(e=>{bc.add(t,e);const i=Tc[t];delete Tc[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onLoad&&n.onLoad(e)}}).catch(e=>{const i=Tc[t];if(void 0===i)throw this.manager.itemError(t),e;delete Tc[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onError&&n.onError(e)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Cc extends Ec{constructor(t){super(t)}load(t,e,i,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=bc.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout(function(){e&&e(s),r.manager.itemEnd(t)},0),s;const o=Zt("img");function a(){c(),bc.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){c(),n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}function c(){o.removeEventListener("load",a,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",a,!1),o.addEventListener("error",l,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(t),o.src=t,o}}class Lc extends yi{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new oe(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}class Pc extends Lc{constructor(t,e,i){super(t,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(yi.DefaultUp),this.updateMatrix(),this.groundColor=new oe(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}}const Ic=new qe,Oc=new _e,Dc=new _e;class Nc{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Vt(512,512),this.map=null,this.mapPass=null,this.matrix=new qe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new In,this._frameExtents=new Vt(1,1),this._viewportCount=1,this._viewports=[new pe(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,i=this.matrix;Oc.setFromMatrixPosition(t.matrixWorld),e.position.copy(Oc),Dc.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Dc),e.updateMatrixWorld(),Ic.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ic),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Ic)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class Uc extends Nc{constructor(){super(new Mn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(t){const e=this.camera,i=2*It*t.angle*this.focus,n=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;i===e.fov&&n===e.aspect&&r===e.far||(e.fov=i,e.aspect=n,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class Fc extends Lc{constructor(t,e,i=0,n=Math.PI/3,r=0,s=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(yi.DefaultUp),this.updateMatrix(),this.target=new yi,this.distance=i,this.angle=n,this.penumbra=r,this.decay=s,this.map=null,this.shadow=new Uc}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}const zc=new qe,Bc=new _e,kc=new _e;class Hc extends Nc{constructor(){super(new Mn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Vt(4,2),this._viewportCount=6,this._viewports=[new pe(2,1,1,1),new pe(0,1,1,1),new pe(3,1,1,1),new pe(1,1,1,1),new pe(3,0,1,1),new pe(1,0,1,1)],this._cubeDirections=[new _e(1,0,0),new _e(-1,0,0),new _e(0,0,1),new _e(0,0,-1),new _e(0,1,0),new _e(0,-1,0)],this._cubeUps=[new _e(0,1,0),new _e(0,1,0),new _e(0,1,0),new _e(0,1,0),new _e(0,0,1),new _e(0,0,-1)]}updateMatrices(t,e=0){const i=this.camera,n=this.matrix,r=t.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),Bc.setFromMatrixPosition(t.matrixWorld),i.position.copy(Bc),kc.copy(i.position),kc.add(this._cubeDirections[e]),i.up.copy(this._cubeUps[e]),i.lookAt(kc),i.updateMatrixWorld(),n.makeTranslation(-Bc.x,-Bc.y,-Bc.z),zc.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(zc)}}class Gc extends Lc{constructor(t,e,i=0,n=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new Hc}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}class Vc extends Nc{constructor(){super(new jn(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}
vendor: 25,708 bytes, line 2
2}class Wc extends Lc{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(yi.DefaultUp),this.updateMatrix(),this.target=new yi,this.shadow=new Vc}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class Xc extends Lc{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class jc extends Lc{constructor(t,e,i=10,n=10){super(t,e),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=n}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}class Yc{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new _e)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const i=t.x,n=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*n),e.addScaledVector(s[2],.488603*r),e.addScaledVector(s[3],.488603*i),e.addScaledVector(s[4],i*n*1.092548),e.addScaledVector(s[5],n*r*1.092548),e.addScaledVector(s[6],.315392*(3*r*r-1)),e.addScaledVector(s[7],i*r*1.092548),e.addScaledVector(s[8],.546274*(i*i-n*n)),e}getIrradianceAt(t,e){const i=t.x,n=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*n),e.addScaledVector(s[2],1.023328*r),e.addScaledVector(s[3],1.023328*i),e.addScaledVector(s[4],.858086*i*n),e.addScaledVector(s[5],.858086*n*r),e.addScaledVector(s[6],.743125*r*r-.247708),e.addScaledVector(s[7],.858086*i*r),e.addScaledVector(s[8],.429043*(i*i-n*n)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(t.coefficients[i],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let i=0;i<9;i++)this.coefficients[i].lerp(t.coefficients[i],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].fromArray(t,e+3*n);return this}toArray(t=[],e=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].toArray(t,e+3*n);return t}static getBasisAt(t,e){const i=t.x,n=t.y,r=t.z;e[0]=.282095,e[1]=.488603*n,e[2]=.488603*r,e[3]=.488603*i,e[4]=1.092548*i*n,e[5]=1.092548*n*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*i*r,e[8]=.546274*(i*i-n*n)}}class qc extends Lc{constructor(t=new Yc,e=1){super(void 0,e),this.isLightProbe=!0,this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}class Zc extends Ec{constructor(t){super(t),this.textures={}}load(t,e,i,n){const r=this,s=new Rc(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}},i,n)}parse(t){const e=this.textures;function i(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}const n=Zc.createMaterialFromType(t.type);if(void 0!==t.uuid&&(n.uuid=t.uuid),void 0!==t.name&&(n.name=t.name),void 0!==t.color&&void 0!==n.color&&n.color.setHex(t.color),void 0!==t.roughness&&(n.roughness=t.roughness),void 0!==t.metalness&&(n.metalness=t.metalness),void 0!==t.sheen&&(n.sheen=t.sheen),void 0!==t.sheenColor&&(n.sheenColor=(new oe).setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(n.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==n.emissive&&n.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==n.specular&&n.specular.setHex(t.specular),void 0!==t.specularIntensity&&(n.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==n.specularColor&&n.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(n.shininess=t.shininess),void 0!==t.clearcoat&&(n.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(n.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.iridescence&&(n.iridescence=t.iridescence),void 0!==t.iridescenceIOR&&(n.iridescenceIOR=t.iridescenceIOR),void 0!==t.iridescenceThicknessRange&&(n.iridescenceThicknessRange=t.iridescenceThicknessRange),void 0!==t.transmission&&(n.transmission=t.transmission),void 0!==t.thickness&&(n.thickness=t.thickness),void 0!==t.attenuationDistance&&(n.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==n.attenuationColor&&n.attenuationColor.setHex(t.attenuationColor),void 0!==t.fog&&(n.fog=t.fog),void 0!==t.flatShading&&(n.flatShading=t.flatShading),void 0!==t.blending&&(n.blending=t.blending),void 0!==t.combine&&(n.combine=t.combine),void 0!==t.side&&(n.side=t.side),void 0!==t.shadowSide&&(n.shadowSide=t.shadowSide),void 0!==t.opacity&&(n.opacity=t.opacity),void 0!==t.transparent&&(n.transparent=t.transparent),void 0!==t.alphaTest&&(n.alphaTest=t.alphaTest),void 0!==t.depthTest&&(n.depthTest=t.depthTest),void 0!==t.depthWrite&&(n.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(n.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(n.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(n.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(n.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(n.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(n.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(n.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(n.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(n.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(n.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(n.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(n.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(n.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(n.rotation=t.rotation),1!==t.linewidth&&(n.linewidth=t.linewidth),void 0!==t.dashSize&&(n.dashSize=t.dashSize),void 0!==t.gapSize&&(n.gapSize=t.gapSize),void 0!==t.scale&&(n.scale=t.scale),void 0!==t.polygonOffset&&(n.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(n.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(n.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(n.dithering=t.dithering),void 0!==t.alphaToCoverage&&(n.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(n.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.toneMapped&&(n.toneMapped=t.toneMapped),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?n.vertexColors=t.vertexColors>0:n.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const r=t.uniforms[e];switch(n.uniforms[e]={},r.type){case"t":n.uniforms[e].value=i(r.value);break;case"c":n.uniforms[e].value=(new oe).setHex(r.value);break;case"v2":n.uniforms[e].value=(new Vt).fromArray(r.value);break;case"v3":n.uniforms[e].value=(new _e).fromArray(r.value);break;case"v4":n.uniforms[e].value=(new pe).fromArray(r.value);break;case"m3":n.uniforms[e].value=(new Wt).fromArray(r.value);break;case"m4":n.uniforms[e].value=(new qe).fromArray(r.value);break;default:n.uniforms[e].value=r.value}}if(void 0!==t.defines&&(n.defines=t.defines),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(n.glslVersion=t.glslVersion),void 0!==t.extensions)for(const e in t.extensions)n.extensions[e]=t.extensions[e];if(void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=i(t.map)),void 0!==t.matcap&&(n.matcap=i(t.matcap)),void 0!==t.alphaMap&&(n.alphaMap=i(t.alphaMap)),void 0!==t.bumpMap&&(n.bumpMap=i(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=i(t.normalMap)),void 0!==t.normalMapType&&(n.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),n.normalScale=(new Vt).fromArray(e)}return void 0!==t.displacementMap&&(n.displacementMap=i(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=i(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=i(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=i(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=i(t.specularMap)),void 0!==t.specularIntensityMap&&(n.specularIntensityMap=i(t.specularIntensityMap)),void 0!==t.specularColorMap&&(n.specularColorMap=i(t.specularColorMap)),void 0!==t.envMap&&(n.envMap=i(t.envMap)),void 0!==t.envMapIntensity&&(n.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(n.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(n.lightMap=i(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=i(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(n.gradientMap=i(t.gradientMap)),void 0!==t.clearcoatMap&&(n.clearcoatMap=i(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(n.clearcoatNormalMap=i(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(n.clearcoatNormalScale=(new Vt).fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(n.iridescenceMap=i(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(n.iridescenceThicknessMap=i(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(n.transmissionMap=i(t.transmissionMap)),void 0!==t.thicknessMap&&(n.thicknessMap=i(t.thicknessMap)),void 0!==t.sheenColorMap&&(n.sheenColorMap=i(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(n.sheenRoughnessMap=i(t.sheenRoughnessMap)),n}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){return new{ShadowMaterial:Xl,SpriteMaterial:xo,RawShaderMaterial:jl,ShaderMaterial:yn,PointsMaterial:fa,MeshPhysicalMaterial:ql,MeshStandardMaterial:Yl,MeshPhongMaterial:Zl,MeshToonMaterial:Jl,MeshNormalMaterial:Kl,MeshLambertMaterial:Ql,MeshDepthMaterial:Ks,MeshDistanceMaterial:Qs,MeshBasicMaterial:Oi,MeshMatcapMaterial:$l,LineDashedMaterial:tc,LineBasicMaterial:na,Material:Ii}[t]}}class Jc{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let i=0,n=t.length;i<n;i++)e+=String.fromCharCode(t[i]);try{return decodeURIComponent(escape(e))}catch(t){return e}}static extractUrlBase(t){const e=t.lastIndexOf("/");return-1===e?"./":t.slice(0,e+1)}static resolveURL(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}}class Kc extends Yi{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}class Qc extends Ec{constructor(t){super(t)}load(t,e,i,n){const r=this,s=new Rc(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}},i,n)}parse(t){const e={},i={};function n(t,n){if(void 0!==e[n])return e[n];const r=t.interleavedBuffers[n],s=function(t,e){if(void 0!==i[e])return i[e];const n=t.arrayBuffers,r=n[e],s=new Uint32Array(r).buffer;return i[e]=s,s}(t,r.buffer),o=qt(r.type,s),a=new vo(o,r.stride);return a.uuid=r.uuid,e[n]=a,a}const r=t.isInstancedBufferGeometry?new Kc:new Yi,s=t.data.index;if(void 0!==s){const t=qt(s.type,s.array);r.setIndex(new Ui(t,1))}const o=t.data.attributes;for(const e in o){const i=o[e];let s;if(i.isInterleavedBufferAttribute){const e=n(t.data,i.data);s=new yo(e,i.itemSize,i.offset,i.normalized)}else{const t=qt(i.type,i.array);s=new(i.isInstancedBufferAttribute?Jo:Ui)(t,i.itemSize,i.normalized)}void 0!==i.name&&(s.name=i.name),void 0!==i.usage&&s.setUsage(i.usage),void 0!==i.updateRange&&(s.updateRange.offset=i.updateRange.offset,s.updateRange.count=i.updateRange.count),r.setAttribute(e,s)}const a=t.data.morphAttributes;if(a)for(const e in a){const i=a[e],s=[];for(let e=0,r=i.length;e<r;e++){const r=i[e];let o;if(r.isInterleavedBufferAttribute){const e=n(t.data,r.data);o=new yo(e,r.itemSize,r.offset,r.normalized)}else{const t=qt(r.type,r.array);o=new Ui(t,r.itemSize,r.normalized)}void 0!==r.name&&(o.name=r.name),s.push(o)}r.morphAttributes[e]=s}t.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);const l=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==l)for(let t=0,e=l.length;t!==e;++t){const e=l[t];r.addGroup(e.start,e.count,e.materialIndex)}const c=t.data.boundingSphere;if(void 0!==c){const t=new _e;void 0!==c.center&&t.fromArray(c.center),r.boundingSphere=new Be(t,c.radius)}return t.name&&(r.name=t.name),t.userData&&(r.userData=t.userData),r}}const $c={UVMapping:v,CubeReflectionMapping:_,CubeRefractionMapping:y,EquirectangularReflectionMapping:x,EquirectangularRefractionMapping:M,CubeUVReflectionMapping:b},th={RepeatWrapping:w,ClampToEdgeWrapping:S,MirroredRepeatWrapping:E},eh={NearestFilter:T,NearestMipmapNearestFilter:A,NearestMipmapLinearFilter:R,LinearFilter:C,LinearMipmapNearestFilter:L,LinearMipmapLinearFilter:P};let ih;class nh{static getContext(){return void 0===ih&&(ih=new(window.AudioContext||window.webkitAudioContext)),ih}static setContext(t){ih=t}}const rh=new qe,sh=new qe,oh=new qe;class ah{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=lh(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=lh();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function lh(){return("undefined"==typeof performance?Date:performance).now()}const ch=new _e,hh=new ve,uh=new _e,dh=new _e;class ph extends yi{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}const fh=new _e,mh=new ve,gh=new _e,vh=new _e;class _h{constructor(t,e,i){let n,r,s;switch(this.binding=t,this.valueSize=i,e){case"quaternion":n=this._slerp,r=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":n=this._select,r=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:n=this._lerp,r=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=r,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const i=this.buffer,n=this.valueSize,r=t*n+n;let s=this.cumulativeWeight;if(0===s){for(let t=0;t!==n;++t)i[r+t]=i[t];s=e}else{s+=e;const t=e/s;this._mixBufferRegion(i,r,0,t,n)}this.cumulativeWeight=s}accumulateAdditive(t){const e=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,n,0,t,i),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,i=this.buffer,n=t*e+e,r=this.cumulativeWeight,s=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const t=e*this._origIndex;this._mixBufferRegion(i,n,t,1-r,e)}s>0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(i[t]!==i[t+e]){o.setValue(i,n);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(let t=i,r=n;t!==r;++t)e[t]=e[n+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i<e;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[e+i]=this.buffer[t+i]}_select(t,e,i,n,r){if(n>=.5)for(let n=0;n!==r;++n)t[e+n]=t[i+n]}_slerp(t,e,i,n){ve.slerpFlat(t,e,t,e,t,i,n)}_slerpAdditive(t,e,i,n,r){const s=this._workIndex*r;ve.multiplyQuaternionsFlat(t,s,t,e,t,i),ve.slerpFlat(t,e,t,e,t,s,n)}_lerp(t,e,i,n,r){const s=1-n;for(let o=0;o!==r;++o){const r=e+o;t[r]=t[r]*s+t[i+o]*n}}_lerpAdditive(t,e,i,n,r){for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]+t[i+s]*n}}}const yh="\\[\\]\\.:\\/",xh=new RegExp("["+yh+"]","g"),Mh="[^"+yh+"]",bh="[^"+yh.replace("\\.","")+"]",wh=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",Mh)+/(WCOD+)?/.source.replace("WCOD",bh)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Mh)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Mh)+"$"),Sh=["material","materials","bones","map"];class Eh{constructor(t,e,i){this.path=e,this.parsedPath=i||Eh.parseTrackName(e),this.node=Eh.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new Eh.Composite(t,e,i):new Eh(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(xh,"")}static parseTrackName(t){const e=wh.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const t=i.nodeName.substring(n+1);-1!==Sh.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){const i=function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.name===e||r.uuid===e)return r;const s=i(r.children);if(s)return s}return null},n=i(t.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)t[e++]=i[n]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,i=e.objectName,n=e.propertyName;let r=e.propertyIndex;if(t||(t=Eh.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(i){let n=e.objectIndex;switch(i){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as no
2de does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===n){n=e;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(void 0!==n){if(void 0===t[n])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[n]}}const s=t[n];if(void 0===s){const i=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+i+"."+n+" but it wasn't found.",t)}let o=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?o=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(o=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}a=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(a=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Eh.Composite=class{constructor(t,e,i){const n=i||Eh.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}getValue(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)}setValue(t,e){const i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},Eh.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Eh.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Eh.prototype.GetterByBindingType=[Eh.prototype._getValue_direct,Eh.prototype._getValue_array,Eh.prototype._getValue_arrayElement,Eh.prototype._getValue_toArray],Eh.prototype.SetterByBindingTypeAndVersioning=[[Eh.prototype._setValue_direct,Eh.prototype._setValue_direct_setNeedsUpdate,Eh.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Eh.prototype._setValue_array,Eh.prototype._setValue_array_setNeedsUpdate,Eh.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Eh.prototype._setValue_arrayElement,Eh.prototype._setValue_arrayElement_setNeedsUpdate,Eh.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Eh.prototype._setValue_fromArray,Eh.prototype._setValue_fromArray_setNeedsUpdate,Eh.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Th{constructor(t,e,i=null,n=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;const r=e.tracks,s=r.length,o=new Array(s),a={endingStart:mt,endingEnd:mt};for(let t=0;t!==s;++t){const e=r[t].createInterpolant(null);o[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){const i=this._clip.duration,n=t._clip.duration,r=n/i,s=i/n;t.warp(1,r,e),this.warp(s,1,e)}return this}
vendor: 10,289 bytes, line 2
2crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){const n=this._mixer,r=n.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=r,a[1]=r+i,l[0]=t/s,l[1]=e/s,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const n=(t-r)*i;n<0||0===i?e=0:(this._startTime=null,e=i*n)}e*=this._updateTimeScale(t);const s=this._updateTime(e),o=this._updateWeight(t);if(o>0){const t=this._interpolants,e=this._propertyBindings;if(this.blendMode===yt)for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(s),e[i].accumulateAdditive(o);else for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(s),e[i].accumulate(n,o)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(null!==i){e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,r=this._loopCount;const s=2202===i;if(0===t)return-1===r||!s||1&~r?n:e-n;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,r+=Math.abs(i);const o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===o){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&!(1&~r))return e-n}return n}_setEndings(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=gt,n.endingEnd=gt):(n.endingStart=t?this.zeroSlopeAtStart?gt:mt:vt,n.endingEnd=e?this.zeroSlopeAtEnd?gt:mt:vt)}_scheduleFading(t,e,i){const n=this._mixer,r=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=r,a[0]=e,o[1]=r+t,a[1]=i,this}}const Ah=new Float32Array(1);class Rh{constructor(t){this.value=t}clone(){return new Rh(void 0===this.value.clone?this.value:this.value.clone())}}let Ch=0;function Lh(t,e){return t.distance-e.distance}function Ph(t,e,i,n){if(t.layers.test(e.layers)&&t.raycast(e,i),!0===n){const n=t.children;for(let t=0,r=n.length;t<r;t++)Ph(n[t],e,i,!0)}}const Ih=new Vt;const Oh=new _e,Dh=new _e;const Nh=new _e;const Uh=new _e,Fh=new qe,zh=new qe;function Bh(t){const e=[];!0===t.isBone&&e.push(t);for(let i=0;i<t.children.length;i++)e.push.apply(e,Bh(t.children[i]));return e}const kh=new _e,Hh=new oe,Gh=new oe;const Vh=new _e,Wh=new _e,Xh=new _e;const jh=new _e,Yh=new xn;function qh(t,e,i,n,r,s,o){jh.set(r,s,o).unproject(n);const a=e[t];if(void 0!==a){const t=i.getAttribute("position");for(let e=0,i=a.length;e<i;e++)t.setXYZ(a[e],jh.x,jh.y,jh.z)}}const Zh=new Me;const Jh=new _e;let Kh,Qh;const $h=tu();function tu(){const t=new ArrayBuffer(4),e=new Float32Array(t),i=new Uint32Array(t),n=new Uint32Array(512),r=new Uint32Array(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(n[t]=0,n[256|t]=32768,r[t]=24,r[256|t]=24):e<-14?(n[t]=1024>>-e-14,n[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(n[t]=e+15<<10,n[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(n[t]=31744,n[256|t]=64512,r[t]=24,r[256|t]=24):(n[t]=31744,n[256|t]=64512,r[t]=13,r[256|t]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,i=0;for(;!(8388608&e);)e<<=1,i-=8388608;e&=-8388609,i+=947912704,s[t]=e|i}for(let t=1024;t<2048;++t)s[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)o[t]=t<<23;o[31]=1199570944,o[32]=2147483648;for(let t=33;t<63;++t)o[t]=2147483648+(t-32<<23);o[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(a[t]=1024);return{floatView:e,uint32View:i,baseTable:n,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}var eu=Object.freeze({__proto__:null,toHalfFloat:function(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Dt(t,-65504,65504),$h.floatView[0]=t;const e=$h.uint32View[0],i=e>>23&511;return $h.baseTable[i]+((8388607&e)>>$h.shiftTable[i])},fromHalfFloat:function(t){const e=t>>10;return $h.uint32View[0]=$h.mantissaTable[$h.offsetTable[e]+(1023&t)]+$h.exponentTable[e],$h.floatView[0]}});"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:i}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=i),e.ACESFilmicToneMapping=4,e.AddEquation=n,e.AddOperation=2,e.AdditiveAnimationBlendMode=yt,e.AdditiveBlending=2,e.AlphaFormat=1021,e.AlwaysDepth=1,e.AlwaysStencilFunc=519,e.AmbientLight=Xc,e.AmbientLightProbe=class extends qc{constructor(t,e=1){super(void 0,e),this.isAmbientLightProbe=!0;const i=(new oe).set(t);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}},e.AnimationClip=xc,e.AnimationLoader=class extends Ec{constructor(t){super(t)}load(t,e,i,n){const r=this,s=new Rc(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}},i,n)}parse(t){const e=[];for(let i=0;i<t.length;i++){const n=xc.parse(t[i]);e.push(n)}return e}},e.AnimationMixer=class extends Rt{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,s=t._propertyBindings,o=t._interpolants,a=i.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let t=0;t!==r;++t){const r=n[t],l=r.name;let h=c[l];if(void 0!==h)++h.referenceCount,s[t]=h;else{if(h=s[t],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,a,l));continue}const n=e&&e._propertyBindings[t].binding.parsedPath;h=new _h(Eh.create(i,l,n),r.ValueTypeName,r.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,a,l),s[t]=h}o[t].resultBuffer=h.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0===i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0===--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return null!==e&&e<this._nActiveActions}_addInactiveAction(t,e,i){const n=this._actions,r=this._actionsByClip;let s=r[e];if(void 0===s)s={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=s;else{const e=s.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=n.length,n.push(t),s.actionByRoot[i]=t}_removeInactiveAction(t){const e=this._actions,i=e[e.length-1],n=t._cacheIndex;i._cacheIndex=n,e[n]=i,e.pop(),t._cacheIndex=null;const r=t._clip.uuid,s=this._actionsByClip,o=s[r],a=o.knownActions,l=a[a.length-1],c=t._byClipCacheIndex;l._byClipCacheIndex=c,a[c]=l,a.pop(),t._byClipCacheIndex=null;delete o.actionByRoot[(t._localRoot||this._root).uuid],0===a.length&&delete s[r],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0===--i.referenceCount&&this._removeInactiveBinding(i)}}_lendAction(t){const e=this._actions,i=t._cacheIndex,n=this._nActiveActions++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_takeBackAction(t){const e=this._actions,i=t._cacheIndex,n=--this._nActiveActions,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_addInactiveBinding(t,e,i){const n=this._bindingsByRootAndName,r=this._bindings;let s=n[e];void 0===s&&(s={},n[e]=s),s[i]=t,t._cacheIndex=r.length,r.push(t)}_removeInactiveBinding(t){const e=this._bindings,i=t.binding,n=i.rootNode.uuid,r=i.path,s=this._bindingsByRootAndName,o=s[n],a=e[e.length-1],l=t._cacheIndex;
vendor: 11,773 bytes, line 2
2a._cacheIndex=l,e[l]=a,e.pop(),delete o[r],0===Object.keys(o).length&&delete s[n]}_lendBinding(t){const e=this._bindings,i=t._cacheIndex,n=this._nActiveBindings++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_takeBackBinding(t){const e=this._bindings,i=t._cacheIndex,n=--this._nActiveBindings,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_lendControlInterpolant(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let i=t[e];return void 0===i&&(i=new hc(new Float32Array(2),new Float32Array(2),1,Ah),i.__cacheIndex=e,t[e]=i),i}_takeBackControlInterpolant(t){const e=this._controlInterpolants,i=t.__cacheIndex,n=--this._nActiveControlInterpolants,r=e[n];t.__cacheIndex=n,e[n]=t,r.__cacheIndex=i,e[i]=r}clipAction(t,e,i){const n=e||this._root,r=n.uuid;let s="string"==typeof t?xc.findByName(n,t):t;const o=null!==s?s.uuid:t,a=this._actionsByClip[o];let l=null;if(void 0===i&&(i=null!==s?s.blendMode:_t),void 0!==a){const t=a.actionByRoot[r];if(void 0!==t&&t.blendMode===i)return t;l=a.knownActions[0],null===s&&(s=l._clip)}if(null===s)return null;const c=new Th(this,s,e,i);return this._bindAction(c,l),this._addInactiveAction(c,o,r),c}existingAction(t,e){const i=e||this._root,n=i.uuid,r="string"==typeof t?xc.findByName(i,t):t,s=r?r.uuid:t,o=this._actionsByClip[s];return void 0!==o&&o.actionByRoot[n]||null}stopAllAction(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let o=0;o!==i;++o){e[o]._update(n,t,r,s)}const o=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)o[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){const e=this._actions,i=t.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){const t=r.knownActions;for(let i=0,n=t.length;i!==n;++i){const n=t[i];this._deactivateAction(n);const r=n._cacheIndex,s=e[e.length-1];n._cacheIndex=null,n._byClipCacheIndex=null,s._cacheIndex=r,e[r]=s,e.pop(),this._removeInactiveBindingsForAction(n)}delete n[i]}}uncacheRoot(t){const e=t.uuid,i=this._actionsByClip;for(const t in i){const n=i[t].actionByRoot[e];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}const n=this._bindingsByRootAndName[e];if(void 0!==n)for(const t in n){const e=n[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){const i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}},e.AnimationObjectGroup=class{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Ot(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const t={};this._indicesByUUID=t;for(let e=0,i=arguments.length;e!==i;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}add(){const t=this._objects,e=this._indicesByUUID,i=this._paths,n=this._parsedPaths,r=this._bindings,s=r.length;let o,a=t.length,l=this.nCachedObjects_;for(let c=0,h=arguments.length;c!==h;++c){const h=arguments[c],u=h.uuid;let d=e[u];if(void 0===d){d=a++,e[u]=d,t.push(h);for(let t=0,e=s;t!==e;++t)r[t].push(new Eh(h,i[t],n[t]))}else if(d<l){o=t[d];const a=--l,c=t[a];e[c.uuid]=d,t[d]=c,e[u]=a,t[a]=h;for(let t=0,e=s;t!==e;++t){const e=r[t],s=e[a];let o=e[d];e[d]=s,void 0===o&&(o=new Eh(h,i[t],n[t])),e[a]=o}}else t[d]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_;for(let s=0,o=arguments.length;s!==o;++s){const o=arguments[s],a=o.uuid,l=e[a];if(void 0!==l&&l>=r){const s=r++,c=t[s];e[c.uuid]=l,t[l]=c,e[a]=s,t[s]=o;for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[s],r=e[l];e[l]=n,e[s]=r}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_,s=t.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=e[a];if(void 0!==l)if(delete e[a],l<r){const o=--r,a=t[o],c=--s,h=t[c];e[a.uuid]=l,t[l]=a,e[h.uuid]=o,t[o]=h,t.pop();for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[o],r=e[c];e[l]=n,e[o]=r,e.pop()}}else{const r=--s,o=t[r];r>0&&(e[o.uuid]=l),t[l]=o,t.pop();for(let t=0,e=n;t!==e;++t){const e=i[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const i=this._bindingsIndicesByPath;let n=i[t];const r=this._bindings;if(void 0!==n)return r[n];const s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,h=new Array(l);n=r.length,i[t]=n,s.push(t),o.push(e),r.push(h);for(let i=c,n=a.length;i!==n;++i){const n=a[i];h[i]=new Eh(n,t,e)}return h}unsubscribe_(t){const e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){const n=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];e[t[o]]=i,s[i]=a,s.pop(),r[i]=r[o],r.pop(),n[i]=n[o],n.pop()}}},e.AnimationUtils=ac,e.ArcCurve=Sa,e.ArrayCamera=no,e.ArrowHelper=class extends yi{constructor(t=new _e(0,0,1),e=new _e(0,0,0),i=1,n=16776960,r=.2*i,s=.2*r){super(),this.type="ArrowHelper",void 0===Kh&&(Kh=new Yi,Kh.setAttribute("position",new Bi([0,0,0,0,1,0],3)),Qh=new Ya(0,.5,1,5,1),Qh.translate(0,-.5,0)),this.position.copy(e),this.line=new ca(Kh,new na({color:n,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new dn(Qh,new Oi({color:n,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(i,r,s)}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Jh.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Jh,e)}}setLength(t,e=.2*t,i=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},e.Audio=ph,e.AudioAnalyser=class{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;const e=this.getFrequencyData();for(let i=0;i<e.length;i++)t+=e[i];return t/e.length}},e.AudioContext=nh,e.AudioListener=class extends yi{constructor(){super(),this.type="AudioListener",this.context=nh.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new ah}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t);const e=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ch,hh,uh),dh.set(0,0,-1).applyQuaternion(hh),e.positionX){const t=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(ch.x,t),e.positionY.linearRampToValueAtTime(ch.y,t),e.positionZ.linearRampToValueAtTime(ch.z,t),e.forwardX.linearRampToValueAtTime(dh.x,t),e.forwardY.linearRampToValueAtTime(dh.y,t),e.forwardZ.linearRampToValueAtTime(dh.z,t),e.upX.linearRampToValueAtTime(i.x,t),e.upY.linearRampToValueAtTime(i.y,t),e.upZ.linearRampToValueAtTime(i.z,t)}else e.setPosition(ch.x,ch.y,ch.z),e.setOrientation(dh.x,dh.y,dh.z,i.x,i.y,i.z)}},e.AudioLoader=class extends Ec{constructor(t){super(t)}load(t,e,i,n){const r=this,s=new Rc(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(i){try{const t=i.slice(0);nh.getContext().decodeAudioData(t,function(t){e(t)})}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}},i,n)}},e.AxesHelper=class extends da{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=new Yi;i.setAttribute("position",new Bi(e,3)),i.setAttribute("color",new Bi([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(i,new na({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,i){const n=new oe,r=this.geometry.attributes.color.array;return n.set(t),n.toArray(r,0),n.toArray(r,3),n.set(e),n.toArray(r,6),n.toArray(r,9),n.set(i),n.toArray(r,12),n.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},e.BackSide=1,e.BasicDepthPacking=3200,e.BasicShadowMap=0,e.Bone=Xo,e.BooleanKeyframeTrack=pc,e.Box2=class{constructor(t=new Vt(1/0,1/0),e=new Vt(-1/0,-1/0)){this.isBox2=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=Ih.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Ih.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},e.Box3=Me,e.Box3Helper=class extends da{constructor(t,e=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Yi;n.setIndex(new Ui(i,1)),n.setAttribute("position",new Bi([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(n,new n
vendor: 4,924 bytes, line 2
2a({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){const e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}dispose(){this.geometry.dispose(),this.material.dispose()}},e.BoxBufferGeometry=class extends fn{constructor(t,e,i,n,r,s){console.warn("THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry."),super(t,e,i,n,r,s)}},e.BoxGeometry=fn,e.BoxHelper=class extends da{constructor(t,e=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),r=new Yi;r.setIndex(new Ui(i,1)),r.setAttribute("position",new Ui(n,3)),super(r,new na({color:e,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Zh.setFromObject(this.object),Zh.isEmpty())return;const e=Zh.min,i=Zh.max,n=this.geometry.attributes.position,r=n.array;r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=e.x,r[4]=i.y,r[5]=i.z,r[6]=e.x,r[7]=e.y,r[8]=i.z,r[9]=i.x,r[10]=e.y,r[11]=i.z,r[12]=i.x,r[13]=i.y,r[14]=e.z,r[15]=e.x,r[16]=i.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=i.x,r[22]=e.y,r[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t,e){return super.copy(t,e),this.object=t.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}},e.BufferAttribute=Ui,e.BufferGeometry=Yi,e.BufferGeometryLoader=Qc,e.ByteType=1010,e.Cache=bc,e.Camera=xn,e.CameraHelper=class extends da{constructor(t){const e=new Yi,i=new na({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],r=[],s={};function o(t,e){a(t),a(e)}function a(t){n.push(0,0,0),r.push(0,0,0),void 0===s[t]&&(s[t]=[]),s[t].push(n.length/3-1)}o("n1","n2"),o("n2","n4"),o("n4","n3"),o("n3","n1"),o("f1","f2"),o("f2","f4"),o("f4","f3"),o("f3","f1"),o("n1","f1"),o("n2","f2"),o("n3","f3"),o("n4","f4"),o("p","n1"),o("p","n2"),o("p","n3"),o("p","n4"),o("u1","u2"),o("u2","u3"),o("u3","u1"),o("c","t"),o("p","c"),o("cn1","cn2"),o("cn3","cn4"),o("cf1","cf2"),o("cf3","cf4"),e.setAttribute("position",new Bi(n,3)),e.setAttribute("color",new Bi(r,3)),super(e,i),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();const l=new oe(16755200),c=new oe(16711680),h=new oe(43775),u=new oe(16777215),d=new oe(3355443);this.setColors(l,c,h,u,d)}setColors(t,e,i,n,r){const s=this.geometry.getAttribute("color");s.setXYZ(0,t.r,t.g,t.b),s.setXYZ(1,t.r,t.g,t.b),s.setXYZ(2,t.r,t.g,t.b),s.setXYZ(3,t.r,t.g,t.b),s.setXYZ(4,t.r,t.g,t.b),s.setXYZ(5,t.r,t.g,t.b),s.setXYZ(6,t.r,t.g,t.b),s.setXYZ(7,t.r,t.g,t.b),s.setXYZ(8,t.r,t.g,t.b),s.setXYZ(9,t.r,t.g,t.b),s.setXYZ(10,t.r,t.g,t.b),s.setXYZ(11,t.r,t.g,t.b),s.setXYZ(12,t.r,t.g,t.b),s.setXYZ(13,t.r,t.g,t.b),s.setXYZ(14,t.r,t.g,t.b),s.setXYZ(15,t.r,t.g,t.b),s.setXYZ(16,t.r,t.g,t.b),s.setXYZ(17,t.r,t.g,t.b),s.setXYZ(18,t.r,t.g,t.b),s.setXYZ(19,t.r,t.g,t.b),s.setXYZ(20,t.r,t.g,t.b),s.setXYZ(21,t.r,t.g,t.b),s.setXYZ(22,t.r,t.g,t.b),s.setXYZ(23,t.r,t.g,t.b),s.setXYZ(24,e.r,e.g,e.b),s.setXYZ(25,e.r,e.g,e.b),s.setXYZ(26,e.r,e.g,e.b),s.setXYZ(27,e.r,e.g,e.b),s.setXYZ(28,e.r,e.g,e.b),s.setXYZ(29,e.r,e.g,e.b),s.setXYZ(30,e.r,e.g,e.b),s.setXYZ(31,e.r,e.g,e.b),s.setXYZ(32,i.r,i.g,i.b),s.setXYZ(33,i.r,i.g,i.b),s.setXYZ(34,i.r,i.g,i.b),s.setXYZ(35,i.r,i.g,i.b),s.setXYZ(36,i.r,i.g,i.b),s.setXYZ(37,i.r,i.g,i.b),s.setXYZ(38,n.r,n.g,n.b),s.setXYZ(39,n.r,n.g,n.b),s.setXYZ(40,r.r,r.g,r.b),s.setXYZ(41,r.r,r.g,r.b),s.setXYZ(42,r.r,r.g,r.b),s.setXYZ(43,r.r,r.g,r.b),s.setXYZ(44,r.r,r.g,r.b),s.setXYZ(45,r.r,r.g,r.b),s.setXYZ(46,r.r,r.g,r.b),s.setXYZ(47,r.r,r.g,r.b),s.setXYZ(48,r.r,r.g,r.b),s.setXYZ(49,r.r,r.g,r.b),s.needsUpdate=!0}update(){const t=this.geometry,e=this.pointMap;Yh.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),qh("c",e,t,Yh,0,0,-1),qh("t",e,t,Yh,0,0,1),qh("n1",e,t,Yh,-1,-1,-1),qh("n2",e,t,Yh,1,-1,-1),qh("n3",e,t,Yh,-1,1,-1),qh("n4",e,t,Yh,1,1,-1),qh("f1",e,t,Yh,-1,-1,1),qh("f2",e,t,Yh,1,-1,1),qh("f3",e,t,Yh,-1,1,1),qh("f4",e,t,Yh,1,1,1),qh("u1",e,t,Yh,.7,1.1,-1),qh("u2",e,t,Yh,-.7,1.1,-1),qh("u3",e,t,Yh,0,2,-1),qh("cf1",e,t,Yh,-1,0,1),qh("cf2",e,t,Yh,1,0,1),qh("cf3",e,t,Yh,0,-1,1),qh("cf4",e,t,Yh,0,1,1),qh("cn1",e,t,Yh,-1,0,-1),qh("cn2",e,t,Yh,1,0,-1),qh("cn3",e,t,Yh,0,-1,-1),qh("cn4",e,t,Yh,0,1,-1),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}},e.CanvasTexture=class extends de{constructor(t,e,i,n,r,s,o,a,l){super(t,e,i,n,r,s,o,a,l),this.isCanvasTexture=!0,this.needsUpdate=!0}},e.CapsuleBufferGeometry=class extends Xa{constructor(t,e,i,n){console.warn("THREE.CapsuleBufferGeometry has been renamed to THREE.C
2apsuleGeometry."),super(t,e,i,n)}},e.CapsuleGeometry=Xa,e.CatmullRomCurve3=La,e.CineonToneMapping=3,e.CircleBufferGeometry=class extends ja{constructor(t,e,i,n){console.warn("THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry."),super(t,e,i,n)}},e.CircleGeometry=ja,e.ClampToEdgeWrapping=S,e.Clock=ah,e.Color=oe,e.ColorKeyframeTrack=fc,e.ColorManagement=$t,e.CompressedArrayTexture=class extends Ma{constructor(t,e,i,n,r,s){super(t,e,i,r,s),this.isCompressedArrayTexture=!0,this.image.depth=n,this.wrapR=S}},e.CompressedTexture=Ma,e.CompressedTextureLoader=class extends Ec{constructor(t){super(t)}load(t,e,i,n){const r=this,s=[],o=new Ma,a=new Rc(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(r.withCredentials);let l=0;function c(c){a.load(t[c],function(t){const i=r.parse(t,!0);s[c]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},l+=1,6===l&&(1===i.mipmapCount&&(o.minFilter=C),o.image=s,o.format=i.format,o.needsUpdate=!0,e&&e(o))},i,n)}if(Array.isArray(t))for(let e=0,i=t.length;e<i;++e)c(e);else a.load(t,function(t){const i=r.parse(t,!0);if(i.isCubemap){const t=i.mipmaps.length/i.mipmapCount;for(let e=0;e<t;e++){s[e]={mipmaps:[]};for(let t=0;t<i.mipmapCount;t++)s[e].mipmaps.push(i.mipmaps[e*i.mipmapCount+t]),s[e].format=i.format,s[e].width=i.width,s[e].height=i.height}o.image=s}else o.image.width=i.width,o.image.height=i.height,o.mipmaps=i.mipmaps;1===i.mipmapCount&&(o.minFilter=C),o.format=i.format,o.needsUpdate=!0,e&&e(o)},i,n);return o}},e.ConeBufferGeometry=class extends qa{constructor(t,e,i,n,r,s,o){console.warn("THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry."),super(t,e,i,n,r,s,o)}},e.ConeGeometry=qa,e.CubeCamera=wn,e.CubeReflectionMapping=_,e.CubeRefractionMapping=y,e.CubeTexture=Sn,e.CubeTextureLoader=class extends Ec{constructor(t){super(t)}load(t,e,i,n){const r=new Sn,s=new Cc(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let o=0;function a(i){s.load(t[i],function(t){r.images[i]=t,o++,6===o&&(r.needsUpdate=!0,e&&e(r))},void 0,n)}for(let e=0;e<t.length;++e)a(e);return r}},e.CubeUVReflectionMapping=b,e.CubicBezierCurve=Da,e.CubicBezierCurve3=Na,e.CubicInterpolant=cc,e.CullFaceBack=1,e.CullFaceFront=2,e.CullFaceFrontBack=3,e.CullFaceNone=0,e.Curve=ba,e.CurvePath=Ga,e.CustomBlending=5,e.CustomToneMapping=5,e.CylinderBufferGeometry=class extends Ya{constructor(t,e,i,n,r,s,o,a){console.warn("THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry."),super(t,e,i,n,r,s,o,a)}},e.CylinderGeometry=Ya,e.Cylindrical=class{constructor(t=1,e=0,i=0){return this.radius=t,this.theta=e,this.y=i,this}set(t,e,i){return this.radius=t,this.theta=e,this.y=i,this}copy(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+i*i),this.theta=Math.atan2(t,i),this.y=e,this}clone(){return(new this.constructor).copy(this)}},e.Data3DTexture=ge,e.DataArrayTexture=me,e.DataTexture=jo,e.DataTexture2DArray=class extends me{constructor(t,e,i,n){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(t,e,i,n)}},e.DataTexture3D=class extends ge{constructor(t,e,i,n){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(t,e,i,n)}},e.DataTextureLoader=class extends Ec{constructor(t){super(t)}load(t,e,i,n){const r=this,s=new jo,o=new Rc(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(t,function(t){const i=r.parse(t);i&&(void 0!==i.image?s.image=i.image:void 0!==i.data&&(s.image.width=i.width,s.image.height=i.height,s.image.data=i.data),s.wrapS=void 0!==i.wrapS?i.wrapS:S,s.wrapT=void 0!==i.wrapT?i.wrapT:S,s.magFilter=void 0!==i.magFilter?i.magFilter:C,s.minFilter=void 0!==i.minFilter?i.minFilter:C,s.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.encoding&&(s.encoding=i.encoding),void 0!==i.flipY&&(s.flipY=i.flipY),void 0!==i.format&&(s.format=i.format),void 0!==i.type&&(s.type=i.type),void 0!==i.mipmaps&&(s.mipmaps=i.mipmaps,s.minFilter=P),1===i.mipmapCount&&(s.minFilter=C),void 0!==i.generateMipmaps&&(s.generateMipmaps=i.generateMipmaps),s.needsUpdate=!0,e&&e(s,i))},i,n),s}},e.DataUtils=eu,e.DecrementStencilOp=7683,e.DecrementWrapStencilOp=34056,e.DefaultLoadingManager=Sc,e.DepthFormat=B,e.DepthStencilFormat=k,e.DepthTexture=ao,e.DirectionalLight=Wc,e.DirectionalLightHelper=class extends yi{constructor(t,e,i){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",void 0===e&&(e=1);let n=new Yi;n.setAttribute("position",new Bi([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));const r=new na({fog:!1,toneMapped:!1});this.lightPlane=new ca(n,r),this.add(this.lightPlane),n=new Yi,n.setAttribute("position",new Bi([0,0,0,0,0,1],3)),this.targetLine=new ca(n,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),Vh.setFromMatrixPosition(this.light.matrixWorld),Wh.setFromMatrixPosition(this.light.target.matrixWorld),Xh.subVectors(Wh,Vh),this.lightPlane.lookAt(Wh),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Wh),this.targetLine.scale.z
2=Xh.length()}},e.DiscreteInterpolant=uc,e.DodecahedronBufferGeometry=class extends Ja{constructor(t,e){console.warn("THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry."),super(t,e)}},e.DodecahedronGeometry=Ja,e.DoubleSide=2,e.DstAlphaFactor=206,e.DstColorFactor=208,e.DynamicCopyUsage=35050,e.DynamicDrawUsage=35048,e.DynamicReadUsage=35049,e.EdgesGeometry=el,e.EllipseCurve=wa,e.EqualDepth=4,e.EqualStencilFunc=514,e.EquirectangularReflectionMapping=x,e.EquirectangularRefractionMapping=M,e.Euler=ri,e.EventDispatcher=Rt,e.ExtrudeBufferGeometry=class extends Pl{constructor(t,e){console.warn("THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry."),super(t,e)}},e.ExtrudeGeometry=Pl,e.FileLoader=Rc,e.Float16BufferAttribute=class extends Ui{constructor(t,e,i){super(new Uint16Array(t),e,i),this.isFloat16BufferAttribute=!0}},e.Float32BufferAttribute=Bi,e.Float64BufferAttribute=class extends Ui{constructor(t,e,i){super(new Float64Array(t),e,i)}},e.FloatType=N,e.Fog=mo,e.FogExp2=fo,e.FramebufferTexture=class extends de{constructor(t,e,i){super({width:t,height:e}),this.isFramebufferTexture=!0,this.format=i,this.magFilter=T,this.minFilter=T,this.generateMipmaps=!1,this.needsUpdate=!0}},e.FrontSide=0,e.Frustum=In,e.GLBufferAttribute=class{constructor(t,e,i,n,r){this.isGLBufferAttribute=!0,this.buffer=t,this.type=e,this.itemSize=i,this.elementSize=n,this.count=r,this.version=0}set needsUpdate(t){!0===t&&this.version++}setBuffer(t){return this.buffer=t,this}setType(t,e){return this.type=t,this.elementSize=e,this}setItemSize(t){return this.itemSize=t,this}setCount(t){return this.count=t,this}},e.GLSL1="100",e.GLSL3=Tt,e.GreaterDepth=6,e.GreaterEqualDepth=5,e.GreaterEqualStencilFunc=518,e.GreaterStencilFunc=516,e.GridHelper=class extends da{constructor(t=10,e=10,i=4473924,n=8947848){i=new oe(i),n=new oe(n);const r=e/2,s=t/e,o=t/2,a=[],l=[];for(let t=0,c=0,h=-o;t<=e;t++,h+=s){a.push(-o,0,h,o,0,h),a.push(h,0,-o,h,0,o);const e=t===r?i:n;e.toArray(l,c),c+=3,e.toArray(l,c),c+=3,e.toArray(l,c),c+=3,e.toArray(l,c),c+=3}const c=new Yi;c.setAttribute("position",new Bi(a,3)),c.setAttribute("color",new Bi(l,3));super(c,new na({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}},e.Group=ro,e.HalfFloatType=U,e.HemisphereLight=Pc,e.HemisphereLightHelper=class extends yi{constructor(t,e,i){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";const n=new Dl(e);n.rotateY(.5*Math.PI),this.material=new Oi({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const r=n.getAttribute("position"),s=new Float32Array(3*r.count);n.setAttribute("color",new Ui(s,3)),this.add(new dn(n,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const e=t.geometry.getAttribute("color");Hh.copy(this.light.color),Gh.copy(this.light.groundColor);for(let t=0,i=e.count;t<i;t++){const n=t<i/2?Hh:Gh;e.setXYZ(t,n.r,n.g,n.b)}e.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),t.lookAt(kh.setFromMatrixPosition(this.light.matrixWorld).negate())}},e.HemisphereLightProbe=class extends qc{constructor(t,e,i=1){super(void 0,i),this.isHemisphereLightProbe=!0;const n=(new oe).set(t),r=(new oe).set(e),s=new _e(n.r,n.g,n.b),o=new _e(r.r,r.g,r.b),a=Math.sqrt(Math.PI),l=a*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(o).multiplyScalar(a),this.sh.coefficients[1].copy(s).sub(o).multiplyScalar(l)}},e.IcosahedronBufferGeometry=class extends Ol{constructor(t,e){console.warn("THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry."),super(t,e)}},e.IcosahedronGeometry=Ol,e.ImageBitmapLoader=class extends Ec{constructor(t){super(t),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=bc.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout(function(){e&&e(s),r.manager.itemEnd(t)},0),s;const o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",o.headers=this.requestHeader,fetch(t,o).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(i){bc.add(t,i),e&&e(i),r.manager.itemEnd(t)}
vendor: 20,509 bytes, line 2
2).catch(function(e){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}),r.manager.itemStart(t)}},e.ImageLoader=Cc,e.ImageUtils=le,e.ImmediateRenderObject=function(){console.error("THREE.ImmediateRenderObject has been removed.")},e.IncrementStencilOp=7682,e.IncrementWrapStencilOp=34055,e.InstancedBufferAttribute=Jo,e.InstancedBufferGeometry=Kc,e.InstancedInterleavedBuffer=class extends vo{constructor(t,e,i=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}},e.InstancedMesh=ia,e.Int16BufferAttribute=class extends Ui{constructor(t,e,i){super(new Int16Array(t),e,i)}},e.Int32BufferAttribute=class extends Ui{constructor(t,e,i){super(new Int32Array(t),e,i)}},e.Int8BufferAttribute=class extends Ui{constructor(t,e,i){super(new Int8Array(t),e,i)}},e.IntType=1013,e.InterleavedBuffer=vo,e.InterleavedBufferAttribute=yo,e.Interpolant=lc,e.InterpolateDiscrete=dt,e.InterpolateLinear=pt,e.InterpolateSmooth=ft,e.InvertStencilOp=5386,e.KeepStencilOp=St,e.KeyframeTrack=dc,e.LOD=zo,e.LatheBufferGeometry=class extends Wa{constructor(t,e,i,n){console.warn("THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry."),super(t,e,i,n)}},e.LatheGeometry=Wa,e.Layers=si,e.LessDepth=2,e.LessEqualDepth=3,e.LessEqualStencilFunc=515,e.LessStencilFunc=513,e.Light=Lc,e.LightProbe=qc,e.Line=ca,e.Line3=class{constructor(t=new _e,e=new _e){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Oh.subVectors(t,this.start),Dh.subVectors(this.end,this.start);const i=Dh.dot(Dh);let n=Dh.dot(Oh)/i;return e&&(n=Dt(n,0,1)),n}closestPointToPoint(t,e,i){const n=this.closestPointToPointParameter(t,e);return this.delta(i).multiplyScalar(n).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},e.LineBasicMaterial=na,e.LineCurve=Ua,e.LineCurve3=Fa,e.LineDashedMaterial=tc,e.LineLoop=pa,e.LineSegments=da,e.LinearEncoding=xt,e.LinearFilter=C,e.LinearInterpolant=hc,e.LinearMipMapLinearFilter=1008,e.LinearMipMapNearestFilter=1007,e.LinearMipmapLinearFilter=P,e.LinearMipmapNearestFilter=L,e.LinearSRGBColorSpace=wt,e.LinearToneMapping=1,e.Loader=Ec,e.LoaderUtils=Jc,e.LoadingManager=wc,e.LoopOnce=2200,e.LoopPingPong=2202,e.LoopRepeat=2201,e.LuminanceAlphaFormat=1025,e.LuminanceFormat=1024,e.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},e.Material=Ii,e.MaterialLoader=Zc,e.MathUtils=Gt,e.Matrix3=Wt,e.Matrix4=qe,e.MaxEquation=104,e.Mesh=dn,e.MeshBasicMaterial=Oi,e.MeshDepthMaterial=Ks,e.MeshDistanceMaterial=Qs,e.MeshLambertMaterial=Ql,e.MeshMatcapMaterial=$l,e.MeshNormalMaterial=Kl,e.MeshPhongMaterial=Zl,e.MeshPhysicalMaterial=ql,e.MeshStandardMaterial=Yl,e.MeshToonMaterial=Jl,e.MinEquation=103,e.MirroredRepeatWrapping=E,e.MixOperation=1,e.MultiplyBlending=4,e.MultiplyOperation=0,e.NearestFilter=T,e.NearestMipMapLinearFilter=1005,e.NearestMipMapNearestFilter=1004,e.NearestMipmapLinearFilter=R,e.NearestMipmapNearestFilter=A,e.NeverDepth=0,e.NeverStencilFunc=512,e.NoBlending=0,e.NoColorSpace="",e.NoToneMapping=0,e.NormalAnimationBlendMode=_t,e.NormalBlending=1,e.NotEqualDepth=7,e.NotEqualStencilFunc=517,e.NumberKeyframeTrack=mc,e.Object3D=yi,e.ObjectLoader=class extends Ec{constructor(t){super(t)}load(t,e,i,n){const r=this,s=""===this.path?Jc.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||s;const o=new Rc(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(i){let s=null;try{s=JSON.parse(i)}catch(e){return void 0!==n&&n(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}const o=s.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())return void 0!==n&&n(new Error("THREE.ObjectLoader: Can't load "+t)),void console.error("THREE.ObjectLoader: Can't load "+t);r.parse(s,e)},i,n)}async loadAsync(t,e){const i=""===this.path?Jc.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||i;const n=new Rc(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials);const r=await n.loadAsync(t,e),s=JSON.parse(r),o=s.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+t);return await this.parseAsync(s)}parse(t,e){const i=this.parseAnimations(t.animations),n=this.parseShapes(t.shapes),r=this.parseGeometries(t.geometries,n),s=this.parseImages(t.images,function(){void 0!==e&&e(l)}),o=this.parseTextures(t.textures,s),a=this.parseMaterials(t.materials,o),l=this.parseObject(t.object,r,a,o,i),c=this.parseSkeletons(t.skeletons,l);if(this.bindSkeletons(l,c),void 0!==e){let t=!1;for(const e in s)if(s[e].data instanceof HTMLImageElement){t=!0;break}!1===t&&e(l)}return l}async parseAsync(t){const e=this.parseAnimations(t.animations),i=this.parseShapes(t.shapes),n=this.parseGeometries(t.geometries,i),r=await this.parseImagesAsync(t.images),s=this.parseTextures(t.textures,r),o=this.parseMaterials(t.materials,s),a=this.parseObject(t.object,n,o,s,e),l=this.parseSkeletons(t.skeletons,a);return this.bindSkeletons(a,l),a}parseShapes(t){const e={};if(void 0!==t)for(let i=0,n=t.length;i<n;i++){const n=(new il).fromJSON(t[i]);e[n.uuid]=n}return e}parseSkeletons(t,e){const i={},n={};if(e.traverse(function(t){t.isBone&&(n[t.uuid]=t)}),void 0!==t)for(let e=0,r=t.length;e<r;e++){const r=(new Zo).fromJSON(t[e],n);i[r.uuid]=r}return i}parseGeometries(t,e){const i={};if(void 0!==t){const n=new Qc;for(let r=0,s=t.length;r<s;r++){let s;const o=t[r];switch(o.type){case"BufferGeometry":case"InstancedBufferGeometry":s=n.parse(o);break;default:o.type in Wl?s=Wl[o.type].fromJSON(o,e):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${o.type}"`)}s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),!0===s.isBufferGeometry&&void 0!==o.userData&&(s.userData=o.userData),i[o.uuid]=s}}return i}parseMaterials(t,e){const i={},n={};if(void 0!==t){const r=new Zc;r.setTextures(e);for(let e=0,s=t.length;e<s;e++){const s=t[e];void 0===i[s.uuid]&&(i[s.uuid]=r.parse(s)),n[s.uuid]=i[s.uuid]}}return n}parseAnimations(t){const e={};if(void 0!==t)for(let i=0;i<t.length;i++){const n=t[i],r=xc.parse(n);e[r.uuid]=r}return e}parseImages(t,e){const i=this,n={};let r;function s(t){if("string"==typeof t){const e=t;return function(t){return i.manager.itemStart(t),r.load(t,function(){i.manager.itemEnd(t)},void 0,function(){i.manager.itemError(t),i.manager.itemEnd(t)})}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(e)?e:i.resourcePath+e)}return t.data?{data:qt(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){const i=new wc(e);r=new Cc(i),r.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e<i;e++){const i=t[e],r=i.url;if(Array.isArray(r)){const t=[];for(let e=0,i=r.length;e<i;e++){const i=s(r[e]);null!==i&&(i instanceof HTMLImageElement?t.push(i):t.push(new jo(i.data,i.width,i.height)))}n[i.uuid]=new ce(t)}else{const t=s(i.url);n[i.uuid]=new ce(t)}}}return n}async parseImagesAsync(t){const e=this,i={};let n;async function r(t){if("string"==typeof t){const i=t,r=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(i)?i:e.resourcePath+i;return await n.loadAsync(r)}return t.data?{data:qt(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){n=new Cc(this.manager),n.setCrossOrigin(this.crossOrigin);for(let e=0,n=t.length;e<n;e++){const n=t[e],s=n.url;if(Array.isArray(s)){const t=[];for(let e=0,i=s.length;e<i;e++){const i=s[e],n=await r(i);null!==n&&(n instanceof HTMLImageElement?t.push(n):t.push(new jo(n.data,n.width,n.height)))}i[n.uuid]=new ce(t)}else{const t=await r(n.url);i[n.uuid]=new ce(t)}}}return i}parseTextures(t,e){function i(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}const n={};if(void 0!==t)for(let r=0,s=t.length;r<s;r++){const s=t[r];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);const o=e[s.image],a=o.data;let l;Array.isArray(a)?(l=new Sn,6===a.length&&(l.needsUpdate=!0)):(l=a&&a.data?new jo:new de,a&&(l.needsUpdate=!0)),l.source=o,l.uuid=s.uuid,void 0!==s.name&&(l.name=s.name),void 0!==s.mapping&&(l.mapping=i(s.mapping,$c)),void 0!==s.offset&&l.offset.fromArray(s.offset),void 0!==s.repeat&&l.repeat.fromArray(s.repeat),void 0!==s.center&&l.center.fromArray(s.center),void 0!==s.rotation&&(l.rotation=s.rotation),void 0!==s.wrap&&(l.wrapS=i(s.wrap[0],th),l.wrapT=i(s.wrap[1],th)),void 0!==s.format&&(l.format=s.format),void 0!==s.type&&(l.type=s.type),void 0!==s.encoding&&(l.encoding=s.encoding),void 0!==s.minFilter&&(l.minFilter=i(s.minFilter,eh)),void 0!==s.magFilter&&(l.magFilter=i(s.magFilter,eh)),void 0!==s.anisotropy&&(l.anisotropy=s.anisotropy),void 0!==s.flipY&&(l.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(l.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(l.unpackAlignment=s.unpackAlignment),void 0!==s.userData&&(l.userData=s.userData),n[s.uuid]=l}return n}parseObject(t,e,i,n,r){let s,o,a;function l(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function c(t){if(void 0!==t){if(Array.isArray(t)){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];void 0===i[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),e.push(i[r])}return e}return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),i[t]}}function h(t){return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined texture",t),n[t]}switch(t.type){case"Scene":s=new go,void 0!==t.background&&(Number.isInteger(t.background)?s.background=new oe(t.background):s.background=h(t.background)),void 0!==t.environment&&(s.environment=h(t.environment)),void 0!==t.fog&&("Fog"===t.fog.type?s.fog=new mo(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(s.fog=new fo(t.fog.color,t.fog.density))),void 0!==t.backgroundBlurriness&&(s.backgroundBlurriness=t.backgroundBlurriness);break;case"PerspectiveCamera":s=new Mn(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(s.focus=t.focus),void 0!==t.zoom&&(s.zoom=t.zoom),void 0!==t.filmGauge&&(s.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(s.filmOffset=t.filmOffset),void 0!==t.view&&(s.view=Object.assign({},t.view));break;case"OrthographicCamera":s=new jn(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(s.zoom=t.zoom),void 0!==t.view&&(s.view=Object.assign({},t.view));break;case"AmbientLight":s=new Xc(t.color,t.intensity);break;case"DirectionalLight":s=new Wc(t.color,t.intensity);break;case"PointLight":s=new Gc(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":s=new jc(t.color,t.intensity,t.width,t.height);break;case"SpotLight":s=new Fc(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":s=new Pc(t.color,t.groundColor,t.intensity);break;case"LightProbe":s=(new qc).fromJSON(t);break;case"SkinnedMesh":o=l(t.geometry),a=c(t.material),s=new Wo(o,a),void 0!==t.bindMode&&(s.bindMode=t.bindMode),void 0!==t.bindMatrix&&s.bindMatrix.fromArray(t.bindMatrix),void 0!==t.skeleton&&(s.skeleton=t.skeleton);break;case"Mesh":o=l(t.geometry),a=c(t.material),s=new dn(o,a);break;case"InstancedMesh":o=l(t.geometry),a=c(t.material);const e=t.count,i=t.instanceMatrix,n=t.instanceColor;s=new ia(o,a,e),s.instanceMatrix=new Jo(new Float32Array(i.array),16),void 0!==n&&(s.instanceColor=new Jo(new Float32Array(n.array),n.itemSize));break;case"LOD":s=new zo;break;case"Line":s=new ca(l(t.geometry),c(t.material));break;case"LineLoop":s=new pa(l(t.geometry),c(t.material));break;case"LineSegments":s=new da(l(t.geometry),c(t.material));break;case"PointCloud":case"Points":s=new ya(l(t.geometry),c(t.material));break;case"Sprite":s=new Do(c(t.material));break;case"Group":s=new ro;break;case"Bone":s=new Xo;break;default:s=new yi}if(s.uuid=t.uuid,void 0!==t.name&&(s.name=t.name),void 0!==t.matrix?(s.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(s.matrixAutoUpdate=t.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==t.position&&s.position.fromArray(t.position),void 0!==t.rotation&&s.rotation.fromArray(t.rotation),void 0!==t.quaternion&&s.quaternion.fromArray(t.quaternion),void 0!==t.scale&&s.scale.fromArray(t.scale)),void 0!==t.castShadow&&(s.castShadow=t.castShadow),void 0!==t.receiveShadow&&(s.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(s.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(s.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(s.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&s.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(s.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(s.visible=t.visible),void 0!==t.frustumCulled&&(s.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(s.renderOrder=t.renderOrder),void 0!==t.userData&&(s.userData=t.userData),void 0!==t.layers&&(s.layers.mask=t.layers),void 0!==t.children){const o=t.children;for(let t=0;t<o.length;t++)s.add(this.parseObject(o[t],e,i,n,r))}if(void 0!==t.animations){const e=t.animations;for(let t=0;t<e.length;t++){const i=e[t];s.animations.push(r[i])}}if("LOD"===t.type){void 0!==t.autoUpdate&&(s.autoUpdate=t.autoUpdate);const e=t.levels;for(let t=0;t<e.length;t++){const i=e[t],n=s.getObjectByProperty("uuid",i.object);void 0!==n&&s.addLevel(n,i.distance,i.hysteresis)}}return s}bindSkeletons(t,e){0!==Object.keys(e).length&&t.traverse(function(t){if(!0===t.isSkinnedMesh&&void 0!==t.skeleton){const i=e[t.skeleton];void 0===i?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",t.skeleton):t.bind(i,t.bindMatrix)}})}},e.ObjectSpaceNormalMap=1,e.OctahedronBufferGeometry=class extends Dl{constructor(t,e){console.warn("THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry."),super(t,e)}},e.OctahedronGeometry=Dl,e.OneFactor=201,e.OneMinusDstAlphaFactor=207,e.OneMinusDstColorFactor=209,e.OneMinusSrcAlphaFactor=205,e.OneMinusSrcColorFactor=203,e.OrthographicCamera=jn,e.PCFShadowMap=1,e.PCFSoftShadowMap=2,e.PMREMGenerator=er,e.Path=Va,e.PerspectiveCamera=Mn,e.Plane=Cn,e.PlaneBufferGeometry=class extends Nn{constructor(t,e,i,n){console.warn("THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry."),super(t,e,i,n)}},e.PlaneGeometry=Nn,e.PlaneHelper=class extends ca{constructor(t,e=1,i=16776960){const n=i,r=new Yi;r.setAttribute("position",new Bi([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),r.computeBoundingSphere(),super(r,new na({color:n,toneMapped:!1})),this.type="PlaneHelper",this.plane=t,this.size=e;const s=new Yi;s.setAttribute("position",new Bi([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),s.computeBoundingSphere(),this.add(new dn(s,new Oi({color:n,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(t){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(t)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}},e.PointLight=Gc,e.PointLightHelper=class extends dn{constructor(t,e,i){super(new Fl(e,4,2),new Oi({wireframe:!0,fog:!1,toneMapped:!1})),this.light=t,this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},e.Points=ya,e.PointsMaterial=fa,e.PolarGridHelper=class extends da{constructor(t=10,e=16,i=8,n=64,r=4473924,s=8947848){r=new oe(r),s=new oe(s);const o=[],a=[];if(e>1)for(let i=0;i<e;i++){const n=i/e*(2*Math.PI),l=Math.sin(n)*t,c=Math.cos(n)*t;o.push(0,0,0),o.push(l,0,c);const h=1&i?r:s;a.push(h.r,h.g,h.b),a.push(h.r,h.g,h.b)}for(let e=0;e<i;e++){const l=1&e?r:s,c=t-t/i*e;for(let t=0;t<n;t++){let e=t/n*(2*Math.PI),i=Math.sin(e)*c,r=Math.cos(e)*c;o.push(i,0,r),a.push(l.r,l.g,l.b),e=(t+1)/n*(2*Math.PI),i=Math.sin(e)*c,r=Math.cos(e)*c,o.push(i,0,r),a.push(l.r,l.g,l.b)}}const l=new Yi;l.setAttribute("position",new Bi(o,3)),l.setAttribute("color",new Bi(a,3));super(l,new na({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}},e.PolyhedronBufferGeometry=class extends Za{constructor(t,e,i,n){console.warn("THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry."),super(t,e,i,n)}},e.PolyhedronGeometry=Za,e.PositionalAudio=class extends ph{constructor(t){super(t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(t){return this.panner.refDistance=t,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(t){return this.panner.rolloffFactor=t,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(t){return this.panner.distanceModel=t,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(t){return this.panner.maxDistance=t,this}setDirectionalCone(t,e,i){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=i,this}updateMatrixWorld(t){if(super.updateMatrixWorld(t),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(fh,mh,gh),vh.set(0,0,1).applyQuaternion(mh);const e=this.panner;if(e.positionX){const t=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(fh.x,t),e.positionY.linearRampToValueAtTime(fh.y,t),e.positionZ.linearRampToValueAtTime(fh.z,t),e.orientationX.linearRampToValueAtTime(vh.x,t),e.orientationY.linearRampToValueAtTime(vh.y,t),e.orientationZ.linearRampToValueAtTime(vh.z,t)}else e.setPosition(fh.x,fh.y,fh.z),e.setOrientation(vh.x,vh.y,vh.z)}},e.PropertyBinding=Eh,e.PropertyMixer=_h,e.QuadraticBezierCurve=za,e.QuadraticBezierCurve3=Ba,e.Quaternion=ve,e.QuaternionKeyframeTrack=vc,e.QuaternionLinearInterpolant=gc,e.REVISION=i,e.RGBADepthPacking=3201,e.RGBAFormat=z,e.RGBAIntegerFormat=1033,e.RGBA_ASTC_10x10_Format=lt,e.RGBA_ASTC_10x5_Format=st,e.RGBA_ASTC_10x6_Format=ot,e.RGBA_ASTC_10x8_Format=at,e.RGBA_ASTC_12x10_Format=ct,e.RGBA_ASTC_12x12_Format=ht,e.RGBA_ASTC_4x4_Format=K,e.RGBA_ASTC_5x4_Format=Q,e.RGBA_ASTC_5x5_Format=$,e.RGBA_ASTC_6x5_Format=tt,e.RGBA_ASTC_6x6_Format=et,e.RGBA_ASTC_8x5_Format=it,e.RGBA_ASTC_8x6_Format=nt,e.RGBA_ASTC_8x8_Format=rt,e.RGBA_BPTC_Format=ut,e.RGBA_ETC2_EAC_Format=J,e.RGBA_PVRTC_2BPPV1_Format=q,e.RGBA_PVRTC_4BPPV1_Format=Y,e.RGBA_S3TC_DXT1_Format=G,e.RGBA_S3TC_DXT3_Format=V,e.RGBA_S3TC_DXT5_Format=W,e.RGBFormat=1022,e.RGB_ETC1_Format=36196,e.RGB_ETC2_Format=Z,e.RGB_PVRTC_2BPPV1_Format=j,e.RGB_PVRTC_4BPPV1_Format=X,e.RGB_S3TC_DXT1_Format=H,e.RGFormat=1030,e.RGIntegerFormat=1031,e.RawShaderMaterial=jl,e.Ray=Ye,e.Raycaster=class{constructor(t,e,i=0,n=1/0){this.ray=new Ye(t,e),this.near=i,this.far=n,this.camera=null,this.layers=new si,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: 
2Unsupported camera type: "+e.type)}intersectObject(t,e=!0,i=[]){return Ph(t,this,i,e),i.sort(Lh),i}intersectObjects(t,e=!0,i=[]){for(let n=0,r=t.length;n<r;n++)Ph(t[n],this,i,e);return i.sort(Lh),i}},e.RectAreaLight=jc,e.RedFormat=1028,e.RedIntegerFormat=1029,e.ReinhardToneMapping=2,e.RepeatWrapping=w,e.ReplaceStencilOp=7681,e.ReverseSubtractEquation=102,e.RingBufferGeometry=class extends Nl{constructor(t,e,i,n,r,s){console.warn("THREE.RingBufferGeometry has been renamed to THREE.RingGeometry."),super(t,e,i,n,r,s)}},e.RingGeometry=Nl,e.SRGBColorSpace=bt,e.Scene=go,e.ShaderChunk=Un,e.ShaderLib=zn,e.ShaderMaterial=yn,e.ShadowMaterial=Xl,e.Shape=il,e.ShapeBufferGeometry=class extends Ul{constructor(t,e){console.warn("THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry."),super(t,e)}},e.ShapeGeometry=Ul,e.ShapePath=class{constructor(){this.type="ShapePath",this.color=new oe,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new Va,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.currentPath.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,s){return this.currentPath.bezierCurveTo(t,e,i,n,r,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const i=e.length;let n=!1;for(let r=i-1,s=0;s<i;r=s++){let i=e[r],o=e[s],a=o.x-i.x,l=o.y-i.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(i=e[s],a=-a,o=e[r],l=-l),t.y<i.y||t.y>o.y)continue;if(t.y===i.y){if(t.x===i.x)return!0}else{const e=l*(t.x-i.x)-a*(t.y-i.y);if(0===e)return!0;if(e<0)continue;n=!n}}else{if(t.y!==i.y)continue;if(o.x<=t.x&&t.x<=i.x||i.x<=t.x&&t.x<=o.x)return!0}}return n}const i=Rl.isClockWise,n=this.subPaths;if(0===n.length)return[];let r,s,o;const a=[];if(1===n.length)return s=n[0],o=new il,o.curves=s.curves,a.push(o),a;let l=!i(n[0].getPoints());l=t?!l:l;const c=[],h=[];let u,d,p=[],f=0;h[f]=void 0,p[f]=[];for(let e=0,o=n.length;e<o;e++)s=n[e],u=s.getPoints(),r=i(u),r=t?!r:r,r?(!l&&h[f]&&f++,h[f]={s:new il,p:u},h[f].s.curves=s.curves,l&&f++,p[f]=[]):p[f].push({h:s,p:u[0]});if(!h[0])return function(t){const e=[];for(let i=0,n=t.length;i<n;i++){const n=t[i],r=new il;r.curves=n.curves,e.push(r)}return e}(n);if(h.length>1){let t=!1,i=0;for(let t=0,e=h.length;t<e;t++)c[t]=[];for(let n=0,r=h.length;n<r;n++){const r=p[n];for(let s=0;s<r.length;s++){const o=r[s];let a=!0;for(let r=0;r<h.length;r++)e(o.p,h[r].p)&&(n!==r&&i++,a?(a=!1,c[r].push(o)):t=!0);a&&c[n].push(o)}}i>0&&!1===t&&(p=c)}for(let t=0,e=h.length;t<e;t++){o=h[t].s,a.push(o),d=p[t];for(let t=0,e=d.length;t<e;t++)o.holes.push(d[t].h)}return a}},e.ShapeUtils=Rl,e.ShortType=1011,e.Skeleton=Zo,e.SkeletonHelper=class extends da{constructor(t){const e=Bh(t),i=new Yi,n=[],r=[],s=new oe(0,0,1),o=new oe(0,1,0);for(let t=0;t<e.length;t++){const i=e[t];i.parent&&i.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(s.r,s.g,s.b),r.push(o.r,o.g,o.b))}i.setAttribute("position",new Bi(n,3)),i.setAttribute("color",new Bi(r,3));super(i,new na({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(t){const e=this.bones,i=this.geometry,n=i.getAttribute("position");zh.copy(this.root.matrixWorld).invert();for(let t=0,i=0;t<e.length;t++){const r=e[t];r.parent&&r.parent.isBone&&(Fh.multiplyMatrices(zh,r.matrixWorld),Uh.setFromMatrixPosition(Fh),n.setXYZ(i,Uh.x,Uh.y,Uh.z),Fh.multiplyMatrices(zh,r.parent.matrixWorld),Uh.setFromMatrixPosition(Fh),n.setXYZ(i+1,Uh.x,Uh.y,Uh.z),i+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(t)}dispose(){this.geometry.dispose(),this.material.dispose()}},e.SkinnedMesh=Wo,e.Source=ce,e.Sphere=Be,e.SphereBufferGeometry=class extends Fl{constructor(t,e,i,n,r,s,o){console.warn("THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry."),super(t,e,i,n,r,s,o)}},e.SphereGeometry=Fl,e.Spherical=class{constructor(t=1,e=0,i=0){return this.radius=t,this.phi=e,this.theta=i,this}set(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){const t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+e*e+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,i),this.phi=Math.acos(Dt(e/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}},e.SphericalHarmonics3=Yc,e.SplineCurve=ka,e.SpotLight=Fc,e.SpotLightHelper=class extends yi{constructor(t,e){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const i=new Yi,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let t=0,e=1,i=32;t<i;t++,e++){const r=t/i*Math.PI*2,s=e/i*Math.PI*2;n.push(Math.cos(r),Math.sin(r),1,Math.cos(s),Math.sin(s),1)}i.setAttribute("position",new Bi(n,3));const r=new na({fog:!1,toneMapped:!1});this.cone=new da(i,r),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1);const t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),Nh.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Nh),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},e.Sprite=Do,e.SpriteMaterial=xo,e.SrcAlphaFactor=204,e.SrcAlphaSaturateFactor=210,e.SrcColorFactor=202,e.StaticCopyUsage=35046,e.StaticDrawUsage=Et,e.StaticReadUsage=35045,e.StereoCamera=class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Mn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Mn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(t){const e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov
2=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep,oh.copy(t.projectionMatrix);const i=e.eyeSep/2,n=i*e.near/e.focus,r=e.near*Math.tan(Pt*e.fov*.5)/e.zoom;let s,o;sh.elements[12]=-i,rh.elements[12]=i,s=-r*e.aspect+n,o=r*e.aspect+n,oh.elements[0]=2*e.near/(o-s),oh.elements[8]=(o+s)/(o-s),this.cameraL.projectionMatrix.copy(oh),s=-r*e.aspect-n,o=r*e.aspect-n,oh.elements[0]=2*e.near/(o-s),oh.elements[8]=(o+s)/(o-s),this.cameraR.projectionMatrix.copy(oh)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(sh),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(rh)}},e.StreamCopyUsage=35042,e.StreamDrawUsage=35040,e.StreamReadUsage=35041,e.StringKeyframeTrack=_c,e.SubtractEquation=101,e.SubtractiveBlending=3,e.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},e.TangentSpaceNormalMap=0,e.TetrahedronBufferGeometry=class extends zl{constructor(t,e){console.warn("THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry."),super(t,e)}},e.TetrahedronGeometry=zl,e.Texture=de,e.TextureLoader=class extends Ec{constructor(t){super(t)}load(t,e,i,n){const r=new de,s=new Cc(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(t,function(t){r.image=t,r.needsUpdate=!0,void 0!==e&&e(r)},i,n),r}},e.TorusBufferGeometry=class extends Bl{constructor(t,e,i,n,r){console.warn("THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry."),super(t,e,i,n,r)}},e.TorusGeometry=Bl,e.TorusKnotBufferGeometry=class extends kl{constructor(t,e,i,n,r,s){console.warn("THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry."),super(t,e,i,n,r,s)}},e.TorusKnotGeometry=kl,e.Triangle=Li,e.TriangleFanDrawMode=2,e.TriangleStripDrawMode=1,e.TrianglesDrawMode=0,e.TubeBufferGeometry=class extends Hl{constructor(t,e,i,n,r){console.warn("THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry."),super(t,e,i,n,r)}},e.TubeGeometry=Hl,e.UVMapping=v,e.Uint16BufferAttribute=Fi,e.Uint32BufferAttribute=zi,e.Uint8BufferAttribute=class extends Ui{constructor(t,e,i){super(new Uint8Array(t),e,i)}},e.Uint8ClampedBufferAttribute=class extends Ui{constructor(t,e,i){super(new Uint8ClampedArray(t),e,i)}},e.Uniform=Rh,e.UniformsGroup=class extends Rt{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:Ch++}),this.name="",this.usage=Et,this.uniforms=[]}add(t){return this.uniforms.push(t),this}remove(t){const e=this.uniforms.indexOf(t);return-1!==e&&this.uniforms.splice(e,1),this}setName(t){return this.name=t,this}setUsage(t){return this.usage=t,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(t){this.name=t.name,this.usage=t.usage;const e=t.uniforms;this.uniforms.length=0;for(let t=0,i=e.length;t<i;t++)this.uniforms.push(e[t].clone());return this}clone(){return(new this.constructor).copy(this)}},e.UniformsLib=Fn,e.UniformsUtils=_n,e.UnsignedByteType=I,e.UnsignedInt248Type=F,e.UnsignedIntType=D,e.UnsignedShort4444Type=1017,e.UnsignedShort5551Type=1018,e.UnsignedShortType=O,e.VSMShadowMap=3,e.Vector2=Vt,e.Vector3=_e,e.Vector4=pe,e.VectorKeyframeTrack=yc,e.VideoTexture=class extends de{constructor(t,e,i,n,r,s,o,a,l){super(t,e,i,n,r,s,o,a,l),this.isVideoTexture=!0,this.minFilter=void 0!==s?s:C,this.magFilter=void 0!==r?r:C,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(function e(){c.needsUpdate=!0,t.requestVideoFrameCallback(e)})}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},e.WebGL1Renderer=po,e.WebGL3DRenderTarget=class extends fe{constructor(t=1,e=1,i=1){super(t,e),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new ge(null,t,e,i),this.texture.isRenderTargetTexture=!0}},e.WebGLArrayRenderTarget=class extends fe{constructor(t=1,e=1,i=1){super(t,e),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new me(null,t,e,i),this.texture.isRenderTargetTexture=!0}},e.WebGLCubeRenderTarget=En,e.WebGLMultipleRenderTargets=class extends fe{constructor(t=1,e=1,i=1,n={}
2){super(t,e,n),this.isWebGLMultipleRenderTargets=!0;const r=this.texture;this.texture=[];for(let t=0;t<i;t++)this.texture[t]=r.clone(),this.texture[t].isRenderTargetTexture=!0}setSize(t,e,i=1){if(this.width!==t||this.height!==e||this.depth!==i){this.width=t,this.height=e,this.depth=i;for(let n=0,r=this.texture.length;n<r;n++)this.texture[n].image.width=t,this.texture[n].image.height=e,this.texture[n].image.depth=i;this.dispose()}return this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e),this}copy(t){this.dispose(),this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.texture.length=0;for(let e=0,i=t.texture.length;e<i;e++)this.texture[e]=t.texture[e].clone(),this.texture[e].isRenderTargetTexture=!0;return this}},e.WebGLMultisampleRenderTarget=class extends fe{constructor(t,e,i){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(t,e,i),this.samples=4}},e.WebGLRenderTarget=fe,e.WebGLRenderer=uo,e.WebGLUtils=io,e.WireframeGeometry=Gl,e.WrapAroundEnding=vt,e.ZeroCurvatureEnding=mt,e.ZeroFactor=200,e.ZeroSlopeEnding=gt,e.ZeroStencilOp=0,e._SRGBAFormat=At,e.sRGBEncoding=Mt}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.