PageSourceSearch

https://www.drawtonomy.com/assets/Scene3DView-KIhFZiiK.js

js drawtonomy.com collected 2026-10-02 01:28:37 UTC 879,193 bytes, 5,400 lines download raw bytes

1var sd=Object.defineProperty;var rd=(s,e,t)=>e in s?sd(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var le=(s,e,t)=>rd(s,typeof e!="symbol"?e+"":e,t);import{P as po,b5 as Jh,b6 as ad,aB as Zh,b7 as od,a1 as Wr,b8 as cd,b9 as ld,ba as hd,bb as ud,bc as dd,bd as Ma,be as fd,bf as pd,bg as cl,bh as ll,bi as hl,bj as md,bk as gd,u as bd,bl as xd,k as Et,n as wt,bm as vd,bn as _d,aT as Md,m as yd,ae as bs}from"./index-tUqbAMuH.js";/**
2 * @license
3 * Copyright 2010-2026 Three.js Authors
4 * SPDX-License-Identifier: MIT
5 */const mc="185",es={ROTATE:0,DOLLY:1,PAN:2},Qi={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Sd=0,ul=1,Td=2,Xr=1,Qh=2,Ps=3,ei=0,en=1,Yt=2,Xt=0,ts=1,mo=2,dl=3,fl=4,$h=5,Tn=100,Ed=101,wd=102,Ad=103,Rd=104,Ds=200,Cd=201,Pd=202,Dd=203,go=204,bo=205,xo=206,Ld=207,vo=208,Nd=209,Id=210,Fd=211,Ud=212,Od=213,Bd=214,_o=0,Mo=1,yo=2,rs=3,So=4,To=5,Eo=6,wo=7,eu=0,kd=1,zd=2,Gn=0,gc=1,bc=2,xc=3,vc=4,_c=5,ua=6,Mc=7,pl="attached",Gd="detached",tu=300,Ci=301,as=302,Us=303,ya=304,da=306,_n=1e3,xn=1001,Qr=1002,Rt=1003,nu=1004,Ls=1005,Mt=1006,qr=1007,An=1008,Jt=1009,iu=1010,su=1011,Vs=1012,yc=1013,Vn=1014,rn=1015,Ct=1016,Sc=1017,Tc=1018,os=1020,ru=35902,au=35899,ou=1021,cu=1022,un=1023,ti=1026,pi=1027,Ec=1028,wc=1029,Pi=1030,Ac=1031,Rc=1033,jr=33776,Kr=33777,Yr=33778,Jr=33779,Ao=35840,Ro=35841,Co=35842,Po=35843,Do=36196,Lo=37492,No=37496,Io=37488,Fo=37489,$r=37490,Uo=37491,Oo=37808,Bo=37809,ko=37810,zo=37811,Go=37812,Vo=37813,Ho=37814,Wo=37815,Xo=37816,qo=37817,jo=37818,Ko=37819,Yo=37820,Jo=37821,Zo=36492,Qo=36494,$o=36495,ec=36283,tc=36284,ea=36285,nc=36286,Hs=2300,Ws=2301,Sa=2302,ml=2303,gl=2400,bl=2401,xl=2402,Vd=2500,Hd=0,lu=1,ic=2,Wd=3200,ta=0,Xd=1,Jn="",kt="srgb",an="srgb-linear",na="linear",ct="srgb",Ui=7680,vl=519,qd=512,jd=513,Kd=514,Cc=515,Yd=516,Jd=517,Pc=518,Zd=519,sc=35044,rc=35048,_l="300 es",kn=2e3,Xs=2001;function Qd(s){for(let e=s.length-1;e>=0;--e)if(s[e]>=65535)return!0;return!1}function $d(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)}function qs(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function ef(){const s=qs("canvas");return s.style.display="block",s}const Ml={};function ia(...s){const e="THREE."+s.shift();console.log(e,...s)}function hu(s){const e=s[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=s[1];t&&t.isStackTrace?s[0]+=" "+t.getLocation():s[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return s}function Ce(...s){s=hu(s);const e="THREE."+s.shift();{const t=s[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...s)}}function We(...s){s=hu(s);const e="THREE."+s.shift();{const t=s[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...s)}}function ns(...s){const e=s.join(" ");e in Ml||(Ml[e]=!0,Ce(...s))}function tf(s,e,t){return new Promise(function(n,i){function r(){switch(s.clientWaitSync(e,s.SYNC_FLUSH_COMMANDS_BIT,0)){case s.WAIT_FAILED:i();break;case s.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:n()}}setTimeout(r,t)})}const nf={[_o]:Mo,[yo]:Eo,[So]:wo,[rs]:To,[Mo]:_o,[Eo]:yo,[wo]:So,[To]:rs};class xi{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const i=n[e];if(i!==void 0){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let r=0,a=i.length;r<a;r++)i[r].call(this,e);e.target=null}}}const jt=["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","5
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 yl=1234567;const Os=Math.PI/180,cs=180/Math.PI;function vn(){const s=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(jt[s&255]+jt[s>>8&255]+jt[s>>16&255]+jt[s>>24&255]+"-"+jt[e&255]+jt[e>>8&255]+"-"+jt[e>>16&15|64]+jt[e>>24&255]+"-"+jt[t&63|128]+jt[t>>8&255]+"-"+jt[t>>16&255]+jt[t>>24&255]+jt[n&255]+jt[n>>8&255]+jt[n>>16&255]+jt[n>>24&255]).toLowerCase()}function Qe(s,e,t){return Math.max(e,Math.min(t,s))}function Dc(s,e){return(s%e+e)%e}function sf(s,e,t,n,i){return n+(s-e)*(i-n)/(t-e)}function rf(s,e,t){return s!==e?(t-s)/(e-s):0}function Bs(s,e,t){return(1-t)*s+t*e}function af(s,e,t,n){return Bs(s,e,1-Math.exp(-t*n))}function of(s,e=1){return e-Math.abs(Dc(s,e*2)-e)}function cf(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*(3-2*s))}function lf(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*s*(s*(s*6-15)+10))}function hf(s,e){return s+Math.floor(Math.random()*(e-s+1))}function uf(s,e){return s+Math.random()*(e-s)}function df(s){return s*(.5-Math.random())}function ff(s){s!==void 0&&(yl=s);let e=yl+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function pf(s){return s*Os}function mf(s){return s*cs}function gf(s){return(s&s-1)===0&&s!==0}function bf(s){return Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))}function xf(s){return Math.pow(2,Math.floor(Math.log(s)/Math.LN2))}function vf(s,e,t,n,i){const r=Math.cos,a=Math.sin,o=r(t/2),c=a(t/2),l=r((e+n)/2),h=a((e+n)/2),u=r((e-n)/2),d=a((e-n)/2),f=r((n-e)/2),g=a((n-e)/2);switch(i){case"XYX":s.set(o*h,c*u,c*d,o*l);break;case"YZY":s.set(c*d,o*h,c*u,o*l);break;case"ZXZ":s.set(c*u,c*d,o*h,o*l);break;case"XZX":s.set(o*h,c*g,c*f,o*l);break;case"YXY":s.set(c*f,o*h,c*g,o*l);break;case"ZYZ":s.set(c*g,c*f,o*h,o*l);break;default:Ce("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function En(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("THREE.MathUtils: Invalid component type.")}}function lt(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("THREE.MathUtils: Invalid component type.")}}const Lt={DEG2RAD:Os,RAD2DEG:cs,generateUUID:vn,clamp:Qe,euclideanModulo:Dc,mapLinear:sf,inverseLerp:rf,lerp:Bs,damp:af,pingpong:of,smoothstep:cf,smootherstep:lf,randInt:hf,randFloat:uf,randFloatSpread:df,seededRandom:ff,degToRad:pf,radToDeg:mf,isPowerOfTwo:gf,ceilPowerOfTwo:bf,floorPowerOfTwo:xf,setQuaternionFromProperEuler:vf,normalize:lt,denormalize:En},Kc=class Kc{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("THREE.Vector2: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("THREE.Vector2: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}
vendor: 39,681 bytes, line 5
5sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Qe(this.x,e.x,t.x),this.y=Qe(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Qe(this.x,e,t),this.y=Qe(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Qe(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Qe(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};Kc.prototype.isVector2=!0;let te=Kc;class dn{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,a,o){let c=n[i+0],l=n[i+1],h=n[i+2],u=n[i+3],d=r[a+0],f=r[a+1],g=r[a+2],b=r[a+3];if(u!==b||c!==d||l!==f||h!==g){let m=c*d+l*f+h*g+u*b;m<0&&(d=-d,f=-f,g=-g,b=-b,m=-m);let p=1-o;if(m<.9995){const _=Math.acos(m),y=Math.sin(_);p=Math.sin(p*_)/y,o=Math.sin(o*_)/y,c=c*p+d*o,l=l*p+f*o,h=h*p+g*o,u=u*p+b*o}else{c=c*p+d*o,l=l*p+f*o,h=h*p+g*o,u=u*p+b*o;const _=1/Math.sqrt(c*c+l*l+h*h+u*u);c*=_,l*=_,h*=_,u*=_}}e[t]=c,e[t+1]=l,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,i,r,a){const o=n[i],c=n[i+1],l=n[i+2],h=n[i+3],u=r[a],d=r[a+1],f=r[a+2],g=r[a+3];return e[t]=o*g+h*u+c*f-l*d,e[t+1]=c*g+h*d+l*u-o*f,e[t+2]=l*g+h*f+o*d-c*u,e[t+3]=h*g-o*u-c*d-l*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,r=e._z,a=e._order,o=Math.cos,c=Math.sin,l=o(n/2),h=o(i/2),u=o(r/2),d=c(n/2),f=c(i/2),g=c(r/2);switch(a){case"XYZ":this._x=d*h*u+l*f*g,this._y=l*f*u-d*h*g,this._z=l*h*g+d*f*u,this._w=l*h*u-d*f*g;break;case"YXZ":this._x=d*h*u+l*f*g,this._y=l*f*u-d*h*g,this._z=l*h*g-d*f*u,this._w=l*h*u+d*f*g;break;case"ZXY":this._x=d*h*u-l*f*g,this._y=l*f*u+d*h*g,this._z=l*h*g+d*f*u,this._w=l*h*u-d*f*g;break;case"ZYX":this._x=d*h*u-l*f*g,this._y=l*f*u+d*h*g,this._z=l*h*g-d*f*u,this._w=l*h*u+d*f*g;break;case"YZX":this._x=d*h*u+l*f*g,this._y=l*f*u+d*h*g,this._z=l*h*g-d*f*u,this._w=l*h*u-d*f*g;break;case"XZY":this._x=d*h*u-l*f*g,this._y=l*f*u-d*h*g,this._z=l*h*g+d*f*u,this._w=l*h*u+d*f*g;break;default:Ce("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],r=t[8],a=t[1],o=t[5],c=t[9],l=t[2],h=t[6],u=t[10],d=n+o+u;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(h-c)*f,this._y=(r-l)*f,this._z=(a-i)*f}else if(n>o&&n>u){const f=2*Math.sqrt(1+n-o-u);this._w=(h-c)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(r+l)/f}else if(o>u){const f=2*Math.sqrt(1+o-n-u);this._w=(r-l)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(c+h)/f}else{const f=2*Math.sqrt(1+u-n-o);this._w=(a-i)/f,this._x=(r+l)/f,this._y=(c+h)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Qe(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,r=e._z,a=e._w,o=t._x,c=t._y,l=t._z,h=t._w;return this._x=n*h+a*o+i*l-r*c,this._y=i*h+a*c+r*o-n*l,this._z=r*h+a*l+n*c-i*o,this._w=a*h-n*o-i*c-r*l,this._onChangeCallback(),this}slerp(e,t){let n=e._x,i=e._y,r=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,i=-i,r=-r,a=-a,o=-o);let c=1-t;if(o<.9995){const l=Math.acos(o),h=Math.sin(l);c=Math.sin(c*l)/h,t=Math.sin(t*l)/h,this._x=this._x*c+n*t,this._y=this._y*c+i*t,this._z=this._z*c+r*t,this._w=this._w*c+a*t,this._onChangeCallback()}else this._x=this._x*c+n*t,this._y=this._y*c+i*t,this._z=this._z*c+r*t,this._w=this._w*c+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const Yc=class Yc{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("THREE.Vector3: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("THREE.Vector3: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Sl.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Sl.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z,c=e.w,l=2*(a*i-o*n),h=2*(o*t-r*i),u=2*(r*n-a*t);return this.x=t+c*l+a*u-o*h,this.y=n+c*h+o*l-r*u,this.z=i+c*u+r*h-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Qe(this.x,e.x,t.x),this.y=Qe(this.y,e.y,t.y),this.z=Qe(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Qe(this.x,e,t),this.y=Qe(this.y,e,t),this.z=Qe(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Qe(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,r=e.z,a=t.x,o=t.y,c=t.z;return this.x=i*c-r*o,this.y=r*a-n*c,this.z=n*o-i*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Ta.copy(this).projectOnVector(e),this.sub(Ta)}reflect(e){return this.sub(Ta.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Qe(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};Yc.prototype.isVector3=!0;let L=Yc;const Ta=new L,Sl=new dn,Jc=class Jc{constructor(e,t,n,i,r,a,o,c,l){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,a,o,c,l)}set(e,t,n,i,r,a,o,c,l){const h=this.elements;return h[0]=e,h[1]=i,h[2]=o,h[3]=t,h[4]=r,h[5]=c,h[6]=n,h[7]=a,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[3],c=n[6],l=n[1],h=n[4],u=n[7],d=n[2],f=n[5],g=n[8],b=i[0],m=i[3],p=i[6],_=i[1],y=i[4],v=i[7],T=i[2],E=i[5],C=i[8];return r[0]=a*b+o*_+c*T,r[3]=a*m+o*y+c*E,r[6]=a*p+o*v+c*C,r[1]=l*b+h*_+u*T,r[4]=l*m+h*y+u*E,r[7]=l*p+h*v+u*C,r[2]=d*b+f*_+g*T,r[5]=d*m+f*y+g*E,r[8]=d*p+f*v+g*C,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],c=e[6],l=e[7],h=e[8];return t*a*h-t*o*l-n*r*h+n*o*c+i*r*l-i*a*c}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],c=e[6],l=e[7],h=e[8],u=h*a-o*l,d=o*c-h*r,f=l*r-a*c,g=t*u+n*d+i*f;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const b=1/g;return e[0]=u*b,e[1]=(i*l-h*n)*b,e[2]=(o*n-i*a)*b,e[3]=d*b,e[4]=(h*t-i*c)*b,e[5]=(i*r-o*t)*b,e[6]=f*b,e[7]=(n*c-l*t)*b,e[8]=(a*t-n*r)*b,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,a,o){const c=Math.cos(r),l=Math.sin(r);return this.set(n*c,n*l,-n*(c*a+l*o)+a+e,-i*l,i*c,-i*(-l*a+c*o)+o+t,0,0,1),this}scale(e,t){return ns("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(Ea.makeScale(e,t)),this}rotate(e){return ns("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(Ea.makeRotation(-e)),this}translate(e,t){return ns("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(Ea.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Jc.prototype.isMatrix3=!0;let Je=Jc;const Ea=new Je,Tl=new Je().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),El=new Je().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function _f(){const s={enabled:!0,workingColorSpace:an,spaces:{},convert:function(i,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===ct&&(i.r=$n(i.r),i.g=$n(i.g),i.b=$n(i.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[r].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===ct&&(i.r=is(i.r),i.g=is(i.g),i.b=is(i.b))),i},workingToColorSpace:function(i,r){return this.convert(i,this.workingColorSpace,r)},colorSpaceToWorking:function(i,r){return this.convert(i,r,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Jn?na:this.spaces[i].transfer},getToneMappingMode:function(i){return this.spaces[i].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(i,r=this.workingColorSpace){return i.fromArray(this.spaces[r].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,r,a){return i.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,r){return ns("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),s.workingToColorSpace(i,r)},toWorkingColorSpace:function(i,r){return ns("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),s.colorSpaceToWorking(i,r)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return s.define({[an]:{primaries:e,whitePoint:n,transfer:na,toXYZ:Tl,fromXYZ:El,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:kt},outputColorSpaceConfig:{drawingBufferColorSpace:kt}},[kt]:{primaries:e,whitePoint:n,transfer:ct,toXYZ:Tl,fromXYZ:El,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:kt}}}),s}const nt=_f();function $n(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function is(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}let Oi;class Mf{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Oi===void 0&&(Oi=qs("canvas")),Oi.width=e.width,Oi.height=e.height;const i=Oi.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=Oi}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=qs("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let a=0;a<r.length;a++)r[a]=$n(r[a]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor($n(t[n]/255)*255):t[n]=$n(t[n]);return{data:t,width:e.width,height:e.height}}else return Ce("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let yf=0;class Lc{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:yf++}),this.uuid=vn(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let r;if(Array.isArray(i)){r=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?r.push(wa(i[a].image)):r.push(wa(i[a]))}else r=wa(i);n.url=r}return t||(e.images[this.uuid]=n),n}}function wa(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?Mf.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(Ce("Texture: Unable to serialize Texture."),{})}let Sf=0;const Aa=new L;class Nt extends xi{constructor(e=Nt.DEFAULT_IMAGE,t=Nt.DEFAULT_MAPPING,n=xn,i=xn,r=Mt,a=An,o=un,c=Jt,l=Nt.DEFAULT_ANISOTROPY,h=Jn){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Sf++}),this.uuid=vn(),this.name="",this.source=new Lc(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=c,this.offset=new te(0,0),this.repeat=new te(1,1),this.center=new te(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Je,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Aa).x}get height(){return this.source.getSize(Aa).y}get depth(){return this.source.getSize(Aa).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){Ce(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){Ce(`Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==tu)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case _n:e.x=e.x-Math.floor(e.x);break;case xn:e.x=e.x<0?0:1;break;case Qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case _n:e.y=e.y-Math.floor(e.y);break;case xn:e.y=e.y<0?0:1;break;case Qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Nt.DEFAULT_IMAGE=null;Nt.DEFAULT_MAPPING=tu;Nt.DEFAULT_ANISOTROPY=1;const Zc=class Zc{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("THREE.Vector4: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("THREE.Vector4: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r;const c=e.elements,l=c[0],h=c[4],u=c[8],d=c[1],f=c[5],g=c[9],b=c[2],m=c[6],p=c[10];if(Math.abs(h-d)<.01&&Math.abs(u-b)<.01&&Math.abs(g-m)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+b)<.1&&Math.abs(g+m)<.1&&Math.abs(l+f+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const y=(l+1)/2,v=(f+1)/2,T=(p+1)/2,E=(h+d)/4,C=(u+b)/4,x=(g+m)/4;return y>v&&y>T?y<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(y),i=E/n,r=C/n):v>T?v<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(v),n=E/i,r=x/i):T<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(T),n=C/r,i=x/r),this.set(n,i,r,t),this}let _=Math.sqrt((m-g)*(m-g)+(u-b)*(u-b)+(d-h)*(d-h));return Math.abs(_)<.001&&(_=1),this.x=(m-g)/_,this.y=(u-b)/_,this.z=(d-h)/_,this.w=Math.acos((l+f+p-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Qe(this.x,e.x,t.x),this.y=Qe(this.y,e.y,t.y),this.z=Qe(this.z,e.z,t.z),this.w=Qe(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Qe(this.x,e,t),this.y=Qe(this.y,e,t),this.z=Qe(this.z,e,t),this.w=Qe(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Qe(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};Zc.prototype.isVector4=!0;let dt=Zc;class Tf extends xi{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Mt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new dt(0,0,e,t),this.scissorTest=!1,this.viewport=new dt(0,0,e,t),this.textures=[];const i={width:e,height:t,depth:n.depth},r=new Nt(i),a=n.count;for(let o=0;o<a;o++)this.textures[o]=r.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview,this.useArrayDepthTexture=n.useArrayDepthTexture}_setTextureOptions(e={}){const t={minFilter:Mt,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n,this.textures[i].isData3DTexture!==!0&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const i=Object.assign({},e.textures[t].image);this.textures[t].source=new Lc(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class zt extends Tf{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class uu extends Nt{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Rt,this.minFilter=Rt,this.wrapR=xn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Ef extends Nt{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Rt,this.minFilter=Rt,this.wrapR=xn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const ha=class ha{constructor(e,t,n,i,r,a,o,c,l,h,u,d,f,g,b,m){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,a,o,c,l,h,u,d,f,g,b,m)}set(e,t,n,i,r,a,o,c,l,h,u,d,f,g,b,m){const p=this.elements;return p[0]=e,p[4]=t,p[8]=n,p[12]=i,p[1]=r,p[5]=a,p[9]=o,p[13]=c,p[2]=l,p[6]=h,p[10]=u,p[14]=d,p[3]=f,p[7]=g,p[11]=b,p[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new ha().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinantAffine()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();const t=this.elements,n=e.elements,i=1/Bi.setFromMatrixColumn(e,0).length(),r=1/Bi.setFromMatrixColumn(e,1).length(),a=1/Bi.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),c=Math.cos(i),l=Math.sin(i),h=Math.cos(r),u=Math.sin(r);if(e.order==="XYZ"){const d=a*h,f=a*u,g=o*h,b=o*u;t[0]=c*h,t[4]=-c*u,t[8]=l,t[1]=f+g*l,t[5]=d-b*l,t[9]=-o*c,t[2]=b-d*l,t[6]=g+f*l,t[10]=a*c}else if(e.order==="YXZ"){const d=c*h,f=c*u,g=l*h,b=l*u;t[0]=d+b*o,t[4]=g*o-f,t[8]=a*l,t[1]=a*u,t[5]=a*h,t[9]=-o,t[2]=f*o-g,t[6]=b+d*o,t[10]=a*c}else if(e.order==="ZXY"){const d=c*h,f=c*u,g=l*h,b=l*u;t[0]=d-b*o,t[4]=-a*u,t[8]=g+f*o,t[1]=f+g*o,t[5]=a*h,t[9]=b-d*o,t[2]=-a*l,t[6]=o,t[10]=a*c}else if(e.order==="ZYX"){const d=a*h,f=a*u,g=o*h,b=o*u;t[0]=c*h,t[4]=g*l-f,t[8]=d*l+b,t[1]=c*u,t[5]=b*l+d,t[9]=f*l-g,t[2]=-l,t[6]=o*c,t[10]=a*c}else if(e.order==="YZX"){const d=a*c,f=a*l,g=o*c,b=o*l;t[0]=c*h,t[4]=b-d*u,t[8]=g*u+f,t[1]=u,t[5]=a*h,t[9]=-o*h,t[2]=-l*h,t[6]=f*u+g,t[10]=d-b*u}else if(e.order==="XZY"){const d=a*c,f=a*l,g=o*c,b=o*l;t[0]=c*h,t[4]=-u,t[8]=l*h,t[1]=d*u+b,t[5]=a*h,t[9]=f*u-g,t[2]=g*u-f,t[6]=o*h,t[10]=b*u+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(wf,e,Af)}lookAt(e,t,n){const i=this.elements;return cn.subVectors(e,t),cn.lengthSq()===0&&(cn.z=1),cn.normalize(),ai.crossVectors(n,cn),ai.lengthSq()===0&&(Math.abs(n.z)===1?cn.x+=1e-4:cn.z+=1e-4,cn.normalize(),ai.crossVectors(n,cn)),ai.normalize(),or.crossVectors(cn,ai),i[0]=ai.x,i[4]=or.x,i[8]=cn.x,i[1]=ai.y,i[5]=or.y,i[9]=cn.y,i[2]=ai.z,i[6]=or.z,i[10]=cn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[4],c=n[8],l=n[12],h=n[1],u=n[5],d=n[9],f=n[13],g=n[2],b=n[6],m=n[10],p=n[14],_=n[3],y=n[7],v=n[11],T=n[15],E=i[0],C=i[4],x=i[8],S=i[12],A=i[1],R=i[5],D=i[9],F=i[13],O=i[2],I=i[6],B=i[10],G=i[14],j=i[3],Y=i[7],ne=i[11],oe=i[15];
vendor: 4,452 bytes, line 5
5return r[0]=a*E+o*A+c*O+l*j,r[4]=a*C+o*R+c*I+l*Y,r[8]=a*x+o*D+c*B+l*ne,r[12]=a*S+o*F+c*G+l*oe,r[1]=h*E+u*A+d*O+f*j,r[5]=h*C+u*R+d*I+f*Y,r[9]=h*x+u*D+d*B+f*ne,r[13]=h*S+u*F+d*G+f*oe,r[2]=g*E+b*A+m*O+p*j,r[6]=g*C+b*R+m*I+p*Y,r[10]=g*x+b*D+m*B+p*ne,r[14]=g*S+b*F+m*G+p*oe,r[3]=_*E+y*A+v*O+T*j,r[7]=_*C+y*R+v*I+T*Y,r[11]=_*x+y*D+v*B+T*ne,r[15]=_*S+y*F+v*G+T*oe,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],o=e[5],c=e[9],l=e[13],h=e[2],u=e[6],d=e[10],f=e[14],g=e[3],b=e[7],m=e[11],p=e[15],_=c*f-l*d,y=o*f-l*u,v=o*d-c*u,T=a*f-l*h,E=a*d-c*h,C=a*u-o*h;return t*(b*_-m*y+p*v)-n*(g*_-m*T+p*E)+i*(g*y-b*T+p*C)-r*(g*v-b*E+m*C)}determinantAffine(){const e=this.elements,t=e[0],n=e[4],i=e[8],r=e[1],a=e[5],o=e[9],c=e[2],l=e[6],h=e[10];return t*(a*h-o*l)-n*(r*h-o*c)+i*(r*l-a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],c=e[6],l=e[7],h=e[8],u=e[9],d=e[10],f=e[11],g=e[12],b=e[13],m=e[14],p=e[15],_=t*o-n*a,y=t*c-i*a,v=t*l-r*a,T=n*c-i*o,E=n*l-r*o,C=i*l-r*c,x=h*b-u*g,S=h*m-d*g,A=h*p-f*g,R=u*m-d*b,D=u*p-f*b,F=d*p-f*m,O=_*F-y*D+v*R+T*A-E*S+C*x;if(O===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const I=1/O;return e[0]=(o*F-c*D+l*R)*I,e[1]=(i*D-n*F-r*R)*I,e[2]=(b*C-m*E+p*T)*I,e[3]=(d*E-u*C-f*T)*I,e[4]=(c*A-a*F-l*S)*I,e[5]=(t*F-i*A+r*S)*I,e[6]=(m*v-g*C-p*y)*I,e[7]=(h*C-d*v+f*y)*I,e[8]=(a*D-o*A+l*x)*I,e[9]=(n*A-t*D-r*x)*I,e[10]=(g*E-b*v+p*_)*I,e[11]=(u*v-h*E-f*_)*I,e[12]=(o*S-a*R-c*x)*I,e[13]=(t*R-n*S+i*x)*I,e[14]=(b*y-g*T-m*_)*I,e[15]=(h*T-u*y+d*_)*I,this}scale(e){const t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,o=e.y,c=e.z,l=r*a,h=r*o;return this.set(l*a+n,l*o-i*c,l*c+i*o,0,l*o+i*c,h*o+n,h*c-i*a,0,l*c-i*o,h*c+i*a,r*c*c+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,a){return this.set(1,n,r,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,r=t._x,a=t._y,o=t._z,c=t._w,l=r+r,h=a+a,u=o+o,d=r*l,f=r*h,g=r*u,b=a*h,m=a*u,p=o*u,_=c*l,y=c*h,v=c*u,T=n.x,E=n.y,C=n.z;return i[0]=(1-(b+p))*T,i[1]=(f+v)*T,i[2]=(g-y)*T,i[3]=0,i[4]=(f-v)*E,i[5]=(1-(d+p))*E,i[6]=(m+_)*E,i[7]=0,i[8]=(g+y)*C,i[9]=(m-_)*C,i[10]=(1-(d+b))*C,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;e.x=i[12],e.y=i[13],e.z=i[14];const r=this.determinantAffine();if(r===0)return n.set(1,1,1),t.identity(),this;let a=Bi.set(i[0],i[1],i[2]).length();const o=Bi.set(i[4],i[5],i[6]).length(),c=Bi.set(i[8],i[9],i[10]).length();r<0&&(a=-a),Mn.copy(this);const l=1/a,h=1/o,u=1/c;return Mn.elements[0]*=l,Mn.elements[1]*=l,Mn.elements[2]*=l,Mn.elements[4]*=h,Mn.elements[5]*=h,Mn.elements[6]*=h,Mn.elements[8]*=u,Mn.elements[9]*=u,Mn.elements[10]*=u,t.setFromRotationMatrix(Mn),n.x=a,n.y=o,n.z=c,this}makePerspective(e,t,n,i,r,a,o=kn,c=!1){const l=this.elements,h=2*r/(t-e),u=2*r/(n-i),d=(t+e)/(t-e),f=(n+i)/(n-i);let g,b;if(c)g=r/(a-r),b=a*r/(a-r);else if(o===kn)g=-(a+r)/(a-r),b=-2*a*r/(a-r);else if(o===Xs)g=-a/(a-r),b=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=h,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=u,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10
vendor: 25,840 bytes, line 5
5]=g,l[14]=b,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,i,r,a,o=kn,c=!1){const l=this.elements,h=2/(t-e),u=2/(n-i),d=-(t+e)/(t-e),f=-(n+i)/(n-i);let g,b;if(c)g=1/(a-r),b=a/(a-r);else if(o===kn)g=-2/(a-r),b=-(a+r)/(a-r);else if(o===Xs)g=-1/(a-r),b=-r/(a-r);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=h,l[4]=0,l[8]=0,l[12]=d,l[1]=0,l[5]=u,l[9]=0,l[13]=f,l[2]=0,l[6]=0,l[10]=g,l[14]=b,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};ha.prototype.isMatrix4=!0;let Ye=ha;const Bi=new L,Mn=new Ye,wf=new L(0,0,0),Af=new L(1,1,1),ai=new L,or=new L,cn=new L,wl=new Ye,Al=new dn;class gi{constructor(e=0,t=0,n=0,i=gi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,r=i[0],a=i[4],o=i[8],c=i[1],l=i[5],h=i[9],u=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Qe(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Qe(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(Qe(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-Qe(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(Qe(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(o,f));break;case"XZY":this._z=Math.asin(-Qe(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,f),this._y=0);break;default:Ce("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return wl.makeRotationFromQuaternion(e),this.setFromRotationMatrix(wl,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Al.setFromEuler(this),this.setFromQuaternion(Al,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}gi.DEFAULT_ORDER="XYZ";class du{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let Rf=0;const Rl=new L,ki=new dn,Wn=new Ye,cr=new L,xs=new L,Cf=new L,Pf=new dn,Cl=new L(1,0,0),Pl=new L(0,1,0),Dl=new L(0,0,1),Ll={type:"added"},Df={type:"removed"},zi={type:"childadded",child:null},Ra={type:"childremoved",child:null};class yt extends xi{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Rf++}),this.uuid=vn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=yt.DEFAULT_UP.clone();const e=new L,t=new gi,n=new dn,i=new L(1,1,1);function r(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Ye},normalMatrix:{value:new Je}}),this.matrix=new Ye,this.matrixWorld=new Ye,this.matrixAutoUpdate=yt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=yt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new du,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return ki.setFromAxisAngle(e,t),this.quaternion.multiply(ki),this}rotateOnWorldAxis(e,t){return ki.setFromAxisAngle(e,t),this.quaternion.premultiply(ki),this}rotateX(e){return this.rotateOnAxis(Cl,e)}rotateY(e){return this.rotateOnAxis(Pl,e)}rotateZ(e){return this.rotateOnAxis(Dl,e)}translateOnAxis(e,t){return Rl.copy(e).applyQuaternion(this.quaternion),this.position.add(Rl.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Cl,e)}translateY(e){return this.translateOnAxis(Pl,e)}translateZ(e){return this.translateOnAxis(Dl,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Wn.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?cr.copy(e):cr.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),xs.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Wn.lookAt(xs,cr,this.up):Wn.lookAt(cr,xs,this.up),this.quaternion.setFromRotationMatrix(Wn),i&&(Wn.extractRotation(i.matrixWorld),ki.setFromRotationMatrix(Wn),this.quaternion.premultiply(ki.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(We("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Ll),zi.child=e,this.dispatchEvent(zi),zi.child=null):We("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Df),Ra.child=e,this.dispatchEvent(Ra),Ra.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Wn.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Wn.multiply(e.parent.matrixWorld)),e.applyMatrix4(Wn),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Ll),zi.child=e,this.dispatchEvent(zi),zi.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(xs,e,Cf),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(xs,Pf,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const t=e.x,n=e.y,i=e.z,r=this.matrix.elements;r[12]+=t-r[0]*t-r[4]*n-r[8]*i,r[13]+=n-r[1]*t-r[5]*n-r[9]*i,r[14]+=i-r[2]*t-r[6]*n-r[10]*i}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t,n=!1){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,n=!0),t===!0){const r=this.children;for(let a=0,o=r.length;a<o;a++)r[a].updateWorldMatrix(!1,!0,n)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),this.static!==!1&&(i.static=this.static),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.pivot!==null&&(i.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(i.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(i.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(o=>({...o})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function r(o,c){return o[c.uuid]===void 0&&(o[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const c=o.shapes;if(Array.isArray(c))for(let l=0,h=c.length;l<h;l++){const u=c[l];r(e.shapes,u)}else r(e.shapes,c)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let c=0,l=this.material.length;c<l;c++)o.push(r(e.materials,this.material[c]));i.material=o}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const c=this.animations[o];i.animations.push(r(e.animations,c))}}if(t){const o=a(e.geometries),c=a(e.materials),l=a(e.textures),h=a(e.images),u=a(e.shapes),d=a(e.skeletons),f=a(e.animations),g=a(e.nodes);o.length>0&&(n.geometries=o),c.length>0&&(n.materials=c),l.length>0&&(n.textures=l),h.length>0&&(n.images=h),u.length>0&&(n.shapes=u),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f),g.length>0&&(n.nodes=g)}return n.object=i,n;function a(o){const c=[];for(const l in o){const h=o[l];delete h.metadata,c.push(h)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}yt.DEFAULT_UP=new L(0,1,0);yt.DEFAULT_MATRIX_AUTO_UPDATE=!0;yt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class ut extends yt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Lf={type:"move"};class Ca{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ut,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ut,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new L,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new L),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ut,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new L,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new L,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,a=null;const o=this._targetRay,c=this._grip,l=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(l&&e.hand){a=!0;for(const b of e.hand.values()){const m=t.getJointPose(b,n),p=this._getHandJoint(l,b);m!==null&&(p.matrix.fromArray(m.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=m.radius),p.visible=m!==null}const h=l.joints["index-finger-tip"],u=l.joints["thumb-tip"],d=h.position.distanceTo(u.position),f=.02,g=.005;l.inputState.pinching&&d>f+g?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&d<=f-g&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1,c.eventsEnabled&&c.dispatchEvent({type:"gripUpdated",data:e,target:this})));o!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&r!==null&&(i=r),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Lf)))}return o!==null&&(o.visible=i!==null),c!==null&&(c.visible=r!==null),l!==null&&(l.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new ut;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const fu={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},oi={h:0,s:0,l:0},lr={h:0,s:0,l:0};function Pa(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?s+(e-s)*6*t:t<1/2?e:t<2/3?s+(e-s)*6*(2/3-t):s}class ze{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=kt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,nt.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=nt.workingColorSpace){return this.r=e,this.g=t,this.b=n,nt.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=nt.workingColorSpace){if(e=Dc(e,1),t=Qe(t,0,1),n=Qe(n,0,1),t===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,a=2*n-r;this.r=Pa(a,r,e+1/3),this.g=Pa(a,r,e),this.b=Pa(a,r,e-1/3)}return nt.colorSpaceToWorking(this,i),this}setStyle(e,t=kt){function n(r){r!==void 0&&parseFloat(r)<1&&Ce("Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:Ce("Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=i[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(r,16),t);Ce("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=kt){const n=fu[e.toLowerCase()];return n!==void 0?this.setHex(n,t):Ce("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=$n(e.r),this.g=$n(e.g),this.b=$n(e.b),this}copyLinearToSRGB(e){return this.r=is(e.r),this.g=is(e.g),this.b=is(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=kt){return nt.workingToColorSpace(Kt.copy(this),e),Math.round(Qe(Kt.r*255,0,255))*65536+Math.round(Qe(Kt.g*255,0,255))*256+Math.round(Qe(Kt.b*255,0,255))}getHexString(e=kt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=nt.workingColorSpace){nt.workingToColorSpace(Kt.copy(this),t);const n=Kt.r,i=Kt.g,r=Kt.b,a=Math.max(n,i,r),o=Math.min(n,i,r);let c,l;const h=(o+a)/2;if(o===a)c=0,l=0;else{const u=a-o;switch(l=h<=.5?u/(a+o):u/(2-a-o),a){case n:c=(i-r)/u+(i<r?6:0);break;case i:c=(r-n)/u+2;break;case r:c=(n-i)/u+4;break}c/=6}return e.h=c,e.s=l,e.l=h,e}getRGB(e,t=nt.workingColorSpace){return nt.workingToColorSpace(Kt.copy(this),t),e.r=Kt.r,e.g=Kt.g,e.b=Kt.b,e}getStyle(e=kt){nt.workingToColorSpace(Kt.copy(this),e);const t=Kt.r,n=Kt.g,i=Kt.b;return e!==kt?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(oi),this.setHSL(oi.h+e,oi.s+t,oi.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}
vendor: 5,249 bytes, line 5
5lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(oi),e.getHSL(lr);const n=Bs(oi.h,lr.h,t),i=Bs(oi.s,lr.s,t),r=Bs(oi.l,lr.l,t);return this.setHSL(n,i,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Kt=new ze;ze.NAMES=fu;class Nc{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new ze(e),this.density=t}clone(){return new Nc(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Nl extends yt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new gi,this.environmentIntensity=1,this.environmentRotation=new gi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const yn=new L,Xn=new L,Da=new L,qn=new L,Gi=new L,Vi=new L,Il=new L,La=new L,Na=new L,Ia=new L,Fa=new dt,Ua=new dt,Oa=new dt;class wn{constructor(e=new L,t=new L,n=new L){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),yn.subVectors(e,t),i.cross(yn);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){yn.subVectors(i,t),Xn.subVectors(n,t),Da.subVectors(e,t);const a=yn.dot(yn),o=yn.dot(Xn),c=yn.dot(Da),l=Xn.dot(Xn),h=Xn.dot(Da),u=a*l-o*o;if(u===0)return r.set(0,0,0),null;const d=1/u,f=(l*c-o*h)*d,g=(a*h-o*c)*d;return r.set(1-f-g,g,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,qn)===null?!1:qn.x>=0&&qn.y>=0&&qn.x+qn.y<=1}static getInterpolation(e,t,n,i,r,a,o,c){return this.getBarycoord(e,t,n,i,qn)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(r,qn.x),c.addScaledVector(a,qn.y),c.addScaledVector(o,qn.z),c)}static getInterpolatedAttribute(e,t,n,i,r,a){return Fa.setScalar(0),Ua.setScalar(0),Oa.setScalar(0),Fa.fromBufferAttribute(e,t),Ua.fromBufferAttribute(e,n),Oa.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(Fa,r.x),a.addScaledVector(Ua,r.y),a.addScaledVector(Oa,r.z),a}static isFrontFacing(e,t,n,i){return yn.subVectors(n,t),Xn.subVectors(e,t),yn.cross(Xn).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return yn.subVectors(this.c,this.b),Xn.subVectors(this.a,this.b),yn.cross(Xn).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return wn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return wn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return wn.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return wn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return wn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,r=this.c;let a,o;Gi.subVectors(i,n),Vi.subVectors(r,n),La.subVectors(e,n);const c=Gi.dot(La),l=Vi.dot(La);if(c<=0&&l<=0)return t.copy(n);Na.subVectors(e,i);const h=Gi.dot(Na),u=Vi.dot(Na);if(h>=0&&u<=h)return t.copy(i);const d=c*u-h*l;
vendor: 30,689 bytes, line 5
5if(d<=0&&c>=0&&h<=0)return a=c/(c-h),t.copy(n).addScaledVector(Gi,a);Ia.subVectors(e,r);const f=Gi.dot(Ia),g=Vi.dot(Ia);if(g>=0&&f<=g)return t.copy(r);const b=f*l-c*g;if(b<=0&&l>=0&&g<=0)return o=l/(l-g),t.copy(n).addScaledVector(Vi,o);const m=h*g-f*u;if(m<=0&&u-h>=0&&f-g>=0)return Il.subVectors(r,i),o=(u-h)/(u-h+(f-g)),t.copy(i).addScaledVector(Il,o);const p=1/(m+b+d);return a=b*p,o=d*p,t.copy(n).addScaledVector(Gi,a).addScaledVector(Vi,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class tn{constructor(e=new L(1/0,1/0,1/0),t=new L(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Sn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Sn.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Sn.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=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(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const r=n.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=r.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,Sn):Sn.fromBufferAttribute(r,a),Sn.applyMatrix4(e.matrixWorld),this.expandByPoint(Sn);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),hr.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),hr.copy(n.boundingBox)),hr.applyMatrix4(e.matrixWorld),this.union(hr)}const i=e.children;for(let r=0,a=i.length;r<a;r++)this.expandByObject(i[r],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Sn),Sn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(vs),ur.subVectors(this.max,vs),Hi.subVectors(e.a,vs),Wi.subVectors(e.b,vs),Xi.subVectors(e.c,vs),ci.subVectors(Wi,Hi),li.subVectors(Xi,Wi),Mi.subVectors(Hi,Xi);let t=[0,-ci.z,ci.y,0,-li.z,li.y,0,-Mi.z,Mi.y,ci.z,0,-ci.x,li.z,0,-li.x,Mi.z,0,-Mi.x,-ci.y,ci.x,0,-li.y,li.x,0,-Mi.y,Mi.x,0];return!Ba(t,Hi,Wi,Xi,ur)||(t=[1,0,0,0,1,0,0,0,1],!Ba(t,Hi,Wi,Xi,ur))?!1:(dr.crossVectors(ci,li),t=[dr.x,dr.y,dr.z],Ba(t,Hi,Wi,Xi,ur))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Sn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Sn).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(jn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),jn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),jn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),jn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),jn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),jn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),jn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),jn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(jn),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const jn=[new L,new L,new L,new L,new L,new L,new L,new L],Sn=new L,hr=new tn,Hi=new L,Wi=new L,Xi=new L,ci=new L,li=new L,Mi=new L,vs=new L,ur=new L,dr=new L,yi=new L;function Ba(s,e,t,n,i){for(let r=0,a=s.length-3;r<=a;r+=3){yi.fromArray(s,r);const o=i.x*Math.abs(yi.x)+i.y*Math.abs(yi.y)+i.z*Math.abs(yi.z),c=e.dot(yi),l=t.dot(yi),h=n.dot(yi);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>o)return!1}return!0}const Zn=Nf();function Nf(){const s=new ArrayBuffer(4),e=new Float32Array(s),t=new Uint32Array(s),n=new Uint32Array(512),i=new Uint32Array(512);for(let c=0;c<256;++c){const l=c-127;l<-27?(n[c]=0,n[c|256]=32768,i[c]=24,i[c|256]=24):l<-14?(n[c]=1024>>-l-14,n[c|256]=1024>>-l-14|32768,i[c]=-l-1,i[c|256]=-l-1):l<=15?(n[c]=l+15<<10,n[c|256]=l+15<<10|32768,i[c]=13,i[c|256]=13):l<128?(n[c]=31744,n[c|256]=64512,i[c]=24,i[c|256]=24):(n[c]=31744,n[c|256]=64512,i[c]=13,i[c|256]=13)}const r=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let c=1;c<1024;++c){let l=c<<13,h=0;for(;!(l&8388608);)l<<=1,h-=8388608;l&=-8388609,h+=947912704,r[c]=l|h}for(let c=1024;c<2048;++c)r[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)a[c]=c<<23;a[31]=1199570944,a[32]=2147483648;for(let c=33;c<63;++c)a[c]=2147483648+(c-32<<23);a[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(o[c]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:r,exponentTable:a,offsetTable:o}}function If(s){Math.abs(s)>65504&&Ce("DataUtils.toHalfFloat(): Value out of range."),s=Qe(s,-65504,65504),Zn.floatView[0]=s;const e=Zn.uint32View[0],t=e>>23&511;return Zn.baseTable[t]+((e&8388607)>>Zn.shiftTable[t])}function Ff(s){const e=s>>10;return Zn.uint32View[0]=Zn.mantissaTable[Zn.offsetTable[e]+(s&1023)]+Zn.exponentTable[e],Zn.floatView[0]}class Ns{static toHalfFloat(e){return If(e)}static fromHalfFloat(e){return Ff(e)}}const Ot=new L,fr=new te;let Uf=0;class Gt extends xi{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Uf++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=sc,this.updateRanges=[],this.gpuType=rn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)fr.fromBufferAttribute(this,t),fr.applyMatrix3(e),this.setXY(t,fr.x,fr.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Ot.fromBufferAttribute(this,t),Ot.applyMatrix3(e),this.setXYZ(t,Ot.x,Ot.y,Ot.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Ot.fromBufferAttribute(this,t),Ot.applyMatrix4(e),this.setXYZ(t,Ot.x,Ot.y,Ot.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Ot.fromBufferAttribute(this,t),Ot.applyNormalMatrix(e),this.setXYZ(t,Ot.x,Ot.y,Ot.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Ot.fromBufferAttribute(this,t),Ot.transformDirection(e),this.setXYZ(t,Ot.x,Ot.y,Ot.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=En(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=lt(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=En(t,this.array)),t}setX(e,t){return this.normalized&&(t=lt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=En(t,this.array)),t}setY(e,t){return this.normalized&&(t=lt(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=En(t,this.array)),t}setZ(e,t){return this.normalized&&(t=lt(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=En(t,this.array)),t}setW(e,t){return this.normalized&&(t=lt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=lt(t,this.array),n=lt(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=lt(t,this.array),n=lt(n,this.array),i=lt(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=lt(t,this.array),n=lt(n,this.array),i=lt(i,this.array),r=lt(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==sc&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class pu extends Gt{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class mu extends Gt{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class rt extends Gt{constructor(e,t,n){super(new Float32Array(e),t,n)}}const Of=new tn,_s=new L,ka=new L;class Cn{constructor(e=new L,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):Of.setFromPoints(e).getCenter(n);let i=0;for(let r=0,a=e.length;r<a;r++)i=Math.max(i,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;_s.subVectors(e,this.center);const t=_s.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(_s,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(ka.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(_s.copy(e.center).add(ka)),this.expandByPoint(_s.copy(e.center).sub(ka))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let Bf=0;const mn=new Ye,za=new yt,qi=new L,ln=new tn,Ms=new tn,Wt=new L;class xt extends xi{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Bf++}),this.uuid=vn(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Qd(e)?mu:pu)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const r=new Je().getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return mn.makeRotationFromQuaternion(e),this.applyMatrix4(mn),this}rotateX(e){return mn.makeRotationX(e),this.applyMatrix4(mn),this}rotateY(e){return mn.makeRotationY(e),this.applyMatrix4(mn),this}rotateZ(e){return mn.makeRotationZ(e),this.applyMatrix4(mn),this}translate(e,t,n){return mn.makeTranslation(e,t,n),this.applyMatrix4(mn),this}scale(e,t,n){return mn.makeScale(e,t,n),this.applyMatrix4(mn),this}lookAt(e){return za.lookAt(e),za.updateMatrix(),this.applyMatrix4(za.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(qi).negate(),this.translate(qi.x,qi.y,qi.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let i=0,r=e.length;i<r;i++){const a=e[i];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new rt(n,3))}else{const n=Math.min(e.length,t.count);for(let i=0;i<n;i++){const r=e[i];t.setXYZ(i,r.x,r.y,r.z||0)}e.length>t.count&&Ce("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new tn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){We("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new L(-1/0,-1/0,-1/0),new L(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const r=t[n];ln.setFromBufferAttribute(r),this.morphTargetsRelative?(Wt.addVectors(this.boundingBox.min,ln.min),this.boundingBox.expandByPoint(Wt),Wt.addVectors(this.boundingBox.max,ln.max),this.boundingBox.expandByPoint(Wt)):(this.boundingBox.expandByPoint(ln.min),this.boundingBox.expandByPoint(ln.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&We('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Cn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){We("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new L,1/0);return}if(e){const n=this.boundingSphere.center;if(ln.setFromBufferAttribute(e),t)for(let r=0,a=t.length;r<a;r++){const o=t[r];Ms.setFromBufferAttribute(o),this.morphTargetsRelative?(Wt.addVectors(ln.min,Ms.min),ln.expandByPoint(Wt),Wt.addVectors(ln.max,Ms.max),ln.expandByPoint(Wt)):(ln.expandByPoint(Ms.min),ln.expandByPoint(Ms.max))}ln.getCenter(n);let i=0;for(let r=0,a=e.count;r<a;r++)Wt.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(Wt));if(t)for(let r=0,a=t.length;r<a;r++){const o=t[r],c=this.morphTargetsRelative;for(let l=0,h=o.count;l<h;l++)Wt.fromBufferAttribute(o,l),c&&(qi.fromBufferAttribute(e,l),Wt.add(qi)),i=Math.max(i,n.distanceToSquared(Wt))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&We('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){We("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,r=t.uv;let a=this.getAttribute("tangent");(a===void 0||a.count!==n.count)&&(a=new Gt(new Float32Array(4*n.count),4),this.setAttribute("tangent",a));const o=[],c=[];for(let x=0;x<n.count;x++)o[x]=new L,c[x]=new L;const l=new L,h=new L,u=new L,d=new te,f=new te,g=new te,b=new L,m=new L;function p(x,S,A){l.fromBufferAttribute(n,x),h.fromBufferAttribute(n,S),u.fromBufferAttribute(n,A),d.fromBufferAttribute(r,x),f.fromBufferAttribute(r,S),g.fromBufferAttribute(r,A),h.sub(l),u.sub(l),f.sub(d),g.sub(d);const R=1/(f.x*g.y-g.x*f.y);isFinite(R)&&(b.copy(h).multiplyScalar(g.y).addScaledVector(u,-f.y).multiplyScalar(R),m.copy(u).multiplyScalar(f.x).addScaledVector(h,-g.x).multiplyScalar(R),o[x].add(b),o[S].add(b),o[A].add(b),c[x].add(m),c[S].add(m),c[A].add(m))}let _=this.groups;_.length===0&&(_=[{start:0,count:e.count}]);for(let x=0,S=_.length;x<S;++x){const A=_[x],R=A.start,D=A.count;for(let F=R,O=R+D;F<O;F+=3)p(e.getX(F+0),e.getX(F+1),e.getX(F+2))}const y=new L,v=new L,T=new L,E=new L;function C(x){T.fromBufferAttribute(i,x),E.copy(T);const S=o[x];y.copy(S),y.sub(T.multiplyScalar(T.dot(S))).normalize(),v.crossVectors(E,S);const R=v.dot(c[x])<0?-1:1;a.setXYZW(x,y.x,y.y,y.z,R)}for(let x=0,S=_.length;x<S;++x){const A=_[x],R=A.start,D=A.count;for(let F=R,O=R+D;F<O;F+=3)C(e.getX(F+0)),C(e.getX(F+1)),C(e.getX(F+2))}this._transformed=!0}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0||n.count!==t.count)n=new Gt(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,f=n.count;d<f;d++)n.setXYZ(d,0,0,0);const i=new L,r=new L,a=new L,o=new L,c=new L,l=new L,h=new L,u=new L;if(e)for(let d=0,f=e.count;d<f;d+=3){const g=e.getX(d+0),b=e.getX(d+1),m=e.getX(d+2);i.fromBufferAttribute(t,g),r.fromBufferAttribute(t,b),a.fromBufferAttribute(t,m),h.subVectors(a,r),u.subVectors(i,r),h.cross(u),o.fromBufferAttribute(n,g),c.fromBufferAttribute(n,b),l.fromBufferAttribute(n,m),o.add(h),c.add(h),l.add(h),n.setXYZ(g,o.x,o.y,o.z),n.setXYZ(b,c.x,c.y,c.z),n.setXYZ(m,l.x,l.y,l.z)}else for(let d=0,f=t.count;d<f;d+=3)i.fromBufferAttribute(t,d+0),r.fromBufferAttribute(t,d+1),a.fromBufferAttribute(t,d+2),h.subVectors(a,r),u.subVectors(i,r),h.cross(u),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Wt.fromBufferAttribute(e,t),Wt.normalize(),e.setXYZ(t,Wt.x,Wt.y,Wt.z)}toNonIndexed(){function e(o,c){const l=o.array,h=o.itemSize,u=o.normalized,d=new l.constructor(c.length*h);let f=0,g=0;for(let b=0,m=c.length;b<m;b++){o.isInterleavedBufferAttribute?f=c[b]*o.data.stride+o.offset:f=c[b]*h;for(let p=0;p<h;p++)d[g++]=l[f++]}return new Gt(d,h,u)}if(this.index===null)return Ce("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new xt,n=this.index.array,i=this.attributes;for(const o in i){const c=i[o],l=e(c,n);t.setAttribute(o,l)}const r=this.morphAttributes;for(const o in r){const c=[],l=r[o];for(let h=0,u=l.length;h<u;h++){const d=l[h],f=e(d,n);c.push(f)}t.morphAttributes[o]=c}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,c=a.length;o<c;o++){const l=a[o];t.addGroup(l.start,l.count,l.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.parameters!==void 0&&this._transformed===!0?"BufferGeometry":this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0&&this._transformed!==!0){const c=this.parameters;for(const l in c)c[l]!==void 0&&(e[l]=c[l]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const c in n){const l=n[c];e.data.attributes[c]=l.toJSON(e.data)}const i={};let r=!1;for(const c in this.morphAttributes){const l=this.morphAttributes[c],h=[];for(let u=0,d=l.length;u<d;u++){const f=l[u];h.push(f.toJSON(e.data))}h.length>0&&(i[c]=h,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const i=e.attributes;for(const l in i){const h=i[l];this.setAttribute(l,h.clone(t))}const r=e.morphAttributes;for(const l in r){const h=[],u=r[l];for(let d=0,f=u.length;d<f;d++)h.push(u[d].clone(t));this.morphAttributes[l]=h}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let l=0,h=a.length;l<h;l++){const u=a[l];this.addGroup(u.start,u.count,u.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const c=e.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:"dispose"})}}class kf{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=sc,this.updateRanges=[],this.version=0,this.uuid=vn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=vn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=vn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.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 Zt=new L;class fa{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Zt.fromBufferAttribute(this,t),Zt.applyMatrix4(e),this.setXYZ(t,Zt.x,Zt.y,Zt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Zt.fromBufferAttribute(this,t),Zt.applyNormalMatrix(e),this.setXYZ(t,Zt.x,Zt.y,Zt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Zt.fromBufferAttribute(this,t),Zt.transformDirection(e),this.setXYZ(t,Zt.x,Zt.y,Zt.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=En(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=lt(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=lt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=lt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=lt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=lt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=En(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=En(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=En(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=En(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=lt(t,this.array),n=lt(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=lt(t,this.array),n=lt(n,this.array),i=lt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=lt(t,this.array),n=lt(n,this.array),i=lt(i,this.array),r=lt(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=r,this}clone(e){if(e===void 0){ia("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[i+r])}return new Gt(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new fa(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){ia("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[i+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}let zf=0;class Rn extends xi{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:zf++}),this.uuid=vn(),this.name="",this.type="Material",this.blending=ts,this.side=ei,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=go,this.blendDst=bo,this.blendEquation=Tn,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ze(0,0,0),this.blendAlpha=0,this.depthFunc=rs,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=vl,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ui,this.stencilZFail=Ui,this.stencilZPass=Ui,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){Ce(`Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){Ce(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector2&&n&&n.isVector2||i&&i.isEuler&&n&&n.isEuler||i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};
vendor: 16,661 bytes, line 5
5n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==ts&&(n.blending=this.blending),this.side!==ei&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==go&&(n.blendSrc=this.blendSrc),this.blendDst!==bo&&(n.blendDst=this.blendDst),this.blendEquation!==Tn&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==rs&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==vl&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ui&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Ui&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Ui&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(r){const a=[];for(const o in r){const c=r[o];delete c.metadata,a.push(c)}return a}if(t){const r=i(e.textures),a=i(e.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}fromJSON(e,t){if(e.uuid!==void 0&&(this.uuid=e.uuid),e.name!==void 0&&(this.name=e.name),e.color!==void 0&&this.color!==void 0&&this.color.setHex(e.color),e.roughness!==void 0&&(this.roughness=e.roughness),e.metalness!==void 0&&(this.metalness=e.metalness),e.sheen!==void 0&&(this.sheen=e.sheen),e.sheenColor!==void 0&&(this.sheenColor=new ze().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(this.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&this.emissive!==void 0&&this.emissive.setHex(e.emissive),e.specular!==void 0&&this.specular!==void 0&&this.specular.setHex(e.specular),e.specularIntensity!==void 0&&(this.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&this.specularColor!==void 0&&this.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(this.shininess=e.shininess),e.clearcoat!==void 0&&(this.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(this.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(this.dispersion=e.dispersion),e.iridescence!==void 0&&(this.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(this.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(this.transmission=e.transmission),e.thickness!==void 0&&(this.thickness=e.thickness),e.attenuationDistance!==void 0&&(this.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&this.attenuationColor!==void 0&&this.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(this.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(this.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(this.fog=e.fog),e.flatShading!==void 0&&(this.flatShading=e.flatShading),e.blending!==void 0&&(this.blending=e.blending),e.combine!==void 0&&(this.combine=e.combine),e.side!==void 0&&(this.side=e.side),e.shadowSide!==void 0&&(this.shadowSide=e.shadowSide),e.opacity!==void 0&&(this.opacity=e.opacity),e.transparent!==void 0&&(this.transparent=e.transparent),e.alphaTest!==void 0&&(this.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(this.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(this.depthFunc=e.depthFunc),e.depthTest!==void 0&&(this.depthTest=e.depthTest),e.depthWrite!==void 0&&(this.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(this.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(this.blendSrc=e.blendSrc),e.blendDst!==void 0&&(this.blendDst=e.blendDst),e.blendEquation!==void 0&&(this.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(this.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(this.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(this.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&this.blendColor!==void 0&&this.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(this.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(this.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(this.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(this.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(this.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(this.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(this.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(this.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(this.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(this.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(this.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(this.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(this.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(this.rotation=e.rotation),e.linewidth!==void 0&&(this.linewidth=e.linewidth),e.dashSize!==void 0&&(this.dashSize=e.dashSize),e.gapSize!==void 0&&(this.gapSize=e.gapSize),e.scale!==void 0&&(this.scale=e.scale),e.polygonOffset!==void 0&&(this.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(this.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(this.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(this.dithering=e.dithering),e.alphaToCoverage!==void 0&&(this.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(this.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(this.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(this.allowOverride=e.allowOverride),e.visible!==void 0&&(this.visible=e.visible),e.toneMapped!==void 0&&(this.toneMapped=e.toneMapped),e.userData!==void 0&&(this.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?this.vertexColors=e.vertexColors>0:this.vertexColors=e.vertexColors),e.size!==void 0&&(this.size=e.size),e.sizeAttenuation!==void 0&&(this.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(this.map=t[e.map]||null),e.matcap!==void 0&&(this.matcap=t[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=t[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=t[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=t[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let n=e.normalScale;Array.isArray(n)===!1&&(n=[n,n]),this.normalScale=new te().fromArray(n)}return e.displacementMap!==void 0&&(this.displacementMap=t[e.displacementMap]||null),e.displacementScale!==void 0&&(this.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(this.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(this.roughnessMap=t[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=t[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=t[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=t[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=t[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=t[e.envMap]||null),e.envMapRotation!==void 0&&this.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(this.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(this.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(this.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(this.lightMap=t[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=t[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=t[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=t[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new te().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=t[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=t[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=t[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=t[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=t[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(this.sheenRoughnessMap=t[e.sheenRoughnessMap]||null),this}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let r=0;r!==i;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
vendor: 29,403 bytes, line 5
5adows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const Kn=new L,Ga=new L,pr=new L,hi=new L,Va=new L,mr=new L,Ha=new L;class er{constructor(e=new L,t=new L(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Kn)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Kn.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Kn.copy(this.origin).addScaledVector(this.direction,t),Kn.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){Ga.copy(e).add(t).multiplyScalar(.5),pr.copy(t).sub(e).normalize(),hi.copy(this.origin).sub(Ga);const r=e.distanceTo(t)*.5,a=-this.direction.dot(pr),o=hi.dot(this.direction),c=-hi.dot(pr),l=hi.lengthSq(),h=Math.abs(1-a*a);let u,d,f,g;if(h>0)if(u=a*c-o,d=a*o-c,g=r*h,u>=0)if(d>=-g)if(d<=g){const b=1/h;u*=b,d*=b,f=u*(u+a*d+2*o)+d*(a*u+d+2*c)+l}else d=r,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*c)+l;else d=-r,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*c)+l;else d<=-g?(u=Math.max(0,-(-a*r+o)),d=u>0?-r:Math.min(Math.max(-r,-c),r),f=-u*u+d*(d+2*c)+l):d<=g?(u=0,d=Math.min(Math.max(-r,-c),r),f=d*(d+2*c)+l):(u=Math.max(0,-(a*r+o)),d=u>0?r:Math.min(Math.max(-r,-c),r),f=-u*u+d*(d+2*c)+l);else d=a>0?-r:r,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*c)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(Ga).addScaledVector(pr,d),f}intersectSphere(e,t){Kn.subVectors(e.center,this.origin);const n=Kn.dot(this.direction),i=Kn.dot(Kn)-n*n,r=e.radius*e.radius;if(i>r)return null;const a=Math.sqrt(r-i),o=n-a,c=n+a;return c<0?null:o<0?this.at(c,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,r,a,o,c;const l=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,i=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,i=(e.min.x-d.x)*l),h>=0?(r=(e.min.y-d.y)*h,a=(e.max.y-d.y)*h):(r=(e.max.y-d.y)*h,a=(e.min.y-d.y)*h),n>a||r>i||((r>n||isNaN(n))&&(n=r),(a<i||isNaN(i))&&(i=a),u>=0?(o=(e.min.z-d.z)*u,c=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,c=(e.min.z-d.z)*u),n>c||o>i)||((o>n||n!==n)&&(n=o),(c<i||i!==i)&&(i=c),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Kn)!==null}intersectTriangle(e,t,n,i,r){Va.subVectors(t,e),mr.subVectors(n,e),Ha.crossVectors(Va,mr);let a=this.direction.dot(Ha),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;hi.subVectors(this.origin,e);const c=o*this.direction.dot(mr.crossVectors(hi,mr));if(c<0)return null;const l=o*this.direction.dot(Va.cross(hi));if(l<0||c+l>a)return null;const h=-o*hi.dot(Ha);return h<0?null:this.at(h/a,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class zn extends Rn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ze(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new gi,this.combine=eu,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Fl=new Ye,Si=new er,gr=new Cn,Ul=new L,br=new L,xr=new L,vr=new L,Wa=new L,_r=new L,Ol=new L,Mr=new L;class Ke extends yt{constructor(e=new xt,t=new zn){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(r&&o){_r.set(0,0,0);for(let c=0,l=r.length;c<l;c++){const h=o[c],u=r[c];h!==0&&(Wa.fromBufferAttribute(u,e),a?_r.addScaledVector(Wa,h):_r.addScaledVector(Wa.sub(t),h))}t.add(_r)}return t}raycast(e,t){const n=this.geometry,i=this.material,r=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),gr.copy(n.boundingSphere),gr.applyMatrix4(r),Si.copy(e.ray).recast(e.near),!(gr.containsPoint(Si.origin)===!1&&(Si.intersectSphere(gr,Ul)===null||Si.origin.distanceToSquared(Ul)>(e.far-e.near)**2))&&(Fl.copy(r).invert(),Si.copy(e.ray).applyMatrix4(Fl),!(n.boundingBox!==null&&Si.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Si)))}_computeIntersections(e,t,n){let i;const r=this.geometry,a=this.material,o=r.index,c=r.attributes.position,l=r.attributes.uv,h=r.attributes.uv1,u=r.attributes.normal,d=r.groups,f=r.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,b=d.length;g<b;g++){const m=d[g],p=a[m.materialIndex],_=Math.max(m.start,f.start),y=Math.min(o.count,Math.min(m.start+m.count,f.start+f.count));for(let v=_,T=y;v<T;v+=3){const E=o.getX(v),C=o.getX(v+1),x=o.getX(v+2);i=yr(this,p,e,n,l,h,u,E,C,x),i&&(i.faceIndex=Math.floor(v/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const g=Math.max(0,f.start),b=Math.min(o.count,f.start+f.count);for(let m=g,p=b;m<p;m+=3){const _=o.getX(m),y=o.getX(m+1),v=o.getX(m+2);i=yr(this,a,e,n,l,h,u,_,y,v),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}else if(c!==void 0)if(Array.isArray(a))for(let g=0,b=d.length;g<b;g++){const m=d[g],p=a[m.materialIndex],_=Math.max(m.start,f.start),y=Math.min(c.count,Math.min(m.start+m.count,f.start+f.count));for(let v=_,T=y;v<T;v+=3){const E=v,C=v+1,x=v+2;i=yr(this,p,e,n,l,h,u,E,C,x),i&&(i.faceIndex=Math.floor(v/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const g=Math.max(0,f.start),b=Math.min(c.count,f.start+f.count);for(let m=g,p=b;m<p;m+=3){const _=m,y=m+1,v=m+2;i=yr(this,a,e,n,l,h,u,_,y,v),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}}}function Gf(s,e,t,n,i,r,a,o){let c;if(e.side===en?c=n.intersectTriangle(a,r,i,!0,o):c=n.intersectTriangle(i,r,a,e.side===ei,o),c===null)return null;Mr.copy(o),Mr.applyMatrix4(s.matrixWorld);const l=t.ray.origin.distanceTo(Mr);return l<t.near||l>t.far?null:{distance:l,point:Mr.clone(),object:s}}function yr(s,e,t,n,i,r,a,o,c,l){s.getVertexPosition(o,br),s.getVertexPosition(c,xr),s.getVertexPosition(l,vr);const h=Gf(s,e,t,n,br,xr,vr,Ol);if(h){const u=new L;wn.getBarycoord(Ol,br,xr,vr,u),i&&(h.uv=wn.getInterpolatedAttribute(i,o,c,l,u,new te)),r&&(h.uv1=wn.getInterpolatedAttribute(r,o,c,l,u,new te)),a&&(h.normal=wn.getInterpolatedAttribute(a,o,c,l,u,new L),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const d={a:o,b:c,c:l,normal:new L,materialIndex:0};wn.getNormal(br,xr,vr,d.normal),h.face=d,h.barycoord=u}return h}const ys=new dt,Bl=new dt,kl=new dt,Vf=new dt,zl=new Ye,Sr=new L,Xa=new Cn,Gl=new Ye,qa=new er;class Hf extends Ke{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=pl,this.bindMatrix=new Ye,this.bindMatrixInverse=new Ye,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new tn),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Sr),this.boundingBox.expandByPoint(Sr)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Cn),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Sr),this.boundingSphere.expandByPoint(Sr)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Xa.copy(this.boundingSphere),Xa.applyMatrix4(i),e.ray.intersectsSphere(Xa)!==!1&&(Gl.copy(i).invert(),qa.copy(e.ray).applyMatrix4(Gl),!(this.boundingBox!==null&&qa.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,qa)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new dt,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===pl?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===Gd?this.bindMatrixInverse.copy(this.bindMatrix).invert():Ce("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;Bl.fromBufferAttribute(i.attributes.skinIndex,e),kl.fromBufferAttribute(i.attributes.skinWeight,e),t.isVector4?(ys.copy(t),t.set(0,0,0,0)):(ys.set(...t,1),t.set(0,0,0)),ys.applyMatrix4(this.bindMatrix);for(let r=0;r<4;r++){const a=kl.getComponent(r);if(a!==0){const o=Bl.getComponent(r);zl.multiplyMatrices(n.bones[o].matrixWorld,n.boneInverses[o]),t.addScaledVector(Vf.copy(ys).applyMatrix4(zl),a)}}return t.isVector4&&(t.w=ys.w),t.applyMatrix4(this.bindMatrixInverse)}}class gu extends yt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class bi extends Nt{constructor(e=null,t=1,n=1,i,r,a,o,c,l=Rt,h=Rt,u,d){super(null,a,o,c,l,h,i,r,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Vl=new Ye,Wf=new Ye;class Ic{constructor(e=[],t=[]){this.uuid=vn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){Ce("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new Ye)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new Ye;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let r=0,a=e.length;r<a;r++){const o=e[r]?e[r].matrixWorld:Wf;Vl.multiplyMatrices(o,t[r]),Vl.toArray(n,r*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new Ic(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new bi(t,e,e,un,rn);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const r=e.bones[n];let a=t[r];a===void 0&&(Ce("Skeleton: No bone found with UUID:",r),a=new gu),this.bones.push(a),this.boneInverses.push(new Ye().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,r=t.length;i<r;i++){const a=t[i];e.bones.push(a.uuid);const o=n[i];e.boneInverses.push(o.toArray())}return e}}class ac extends Gt{constructor(e,t,n,i=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const ji=new Ye,Hl=new Ye,Tr=[],Wl=new tn,Xf=new Ye,Ss=new Ke,Ts=new Cn;class sa extends Ke{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new ac(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<n;i++)this.setMatrixAt(i,Xf)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new tn),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,ji),Wl.copy(e.boundingBox).applyMatrix4(ji),this.boundingBox.union(Wl)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Cn),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,ji),Ts.copy(e.boundingSphere).applyMatrix4(ji),this.boundingSphere.union(Ts)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){return this.instanceColor===null?t.setRGB(1,1,1):t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){return t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,i=this.morphTexture.source.data.data,r=n.length+1,a=e*r+1;for(let o=0;o<n.length;o++)n[o]=i[a+o]}raycast(e,t){const n=this.matrixWorld,i=this.count;if(Ss.geometry=this.geometry,Ss.material=this.material,Ss.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Ts.copy(this.boundingSphere),Ts.applyMatrix4(n),e.ray.intersectsSphere(Ts)!==!1))for(let r=0;r<i;r++){this.getMatrixAt(r,ji),Hl.multiplyMatrices(n,ji),Ss.matrixWorld=Hl,Ss.raycast(e,Tr);for(let a=0,o=Tr.length;a<o;a++){const c=Tr[a];c.instanceId=r,c.object=this,t.push(c)}Tr.length=0}}setColorAt(e,t){return this.instanceColor===null&&(this.instanceColor=new ac(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3),this}setMatrixAt(e,t){return t.toArray(this.instanceMatrix.array,e*16),this}setMorphAt(e,t){const n=t.morphTargetInfluences,i=n.length+1;this.morphTexture===null&&(this.morphTexture=new bi(new Float32Array(i*this.count),i,this.count,Ec,rn));const r=this.morphTexture.source.data.data;let a=0;for(let l=0;l<n.length;l++)a+=n[l];const o=this.geometry.morphTargetsRelative?1:1-a,c=i*e;return r[c]=o,r.set(n,c+1),this}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const ja=new L,qf=new L,jf=new Je;class fi{constructor(e=new L(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=ja.subVectors(n,t).cross(qf.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,n=!0){const i=e.delta(ja),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/r;return n===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(i,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||jf.getNormalMatrix(e),i=this.coplanarPoint(ja).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ti=new Cn,Kf=new te(.5,.5),Er=new L;class Fc{constructor(e=new fi,t=new fi,n=new fi,i=new fi,r=new fi,a=new fi){this.planes=[e,t,n,i,r,a]}set(e,t,n,i,r,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=kn,n=!1){const i=this.planes,r=e.elements,a=r[0],o=r[1],c=r[2],l=r[3],h=r[4],u=r[5],d=r[6],f=r[7],g=r[8],b=r[9],m=r[10],p=r[11],_=r[12],y=r[13],v=r[14],T=r[15];if(i[0].setComponents(l-a,f-h,p-g,T-_).normalize(),i[1].setComponents(l+a,f+h,p+g,T+_).normalize(),i[2].setComponents(l+o,f+u,p+b,T+y).normalize(),i[3].setComponents(l-o,f-u,p-b,T-y).normalize(),n)i[4].setComponents(c,d,m,v).normalize(),i[5].setComponents(l-c,f-d,p-m,T-v).normalize();else if(i[4].setComponents(l-c,f-d,p-m,T-v).normalize(),t===kn)i[5].setComponents(l+c,f+d,p+m,T+v).normalize();else if(t===Xs)i[5].setComponents(c,d,m,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ti.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Ti.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ti)}intersectsSprite(e){Ti.center.set(0,0,0);const t=Kf.distanceTo(e.center);return Ti.radius=.7071067811865476+t,Ti.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ti)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(Er.x=i.normal.x>0?e.max.x:e.min.x,Er.y=i.normal.y>0?e.max.y:e.min.y,Er.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Er)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Uc extends Rn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new ze(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const ra=new L,aa=new L,Xl=new Ye,Es=new er,wr=new Cn,Ka=new L,ql=new L;class tr extends yt{constructor(e=new xt,t=new Uc){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,r=t.count;i<r;i++)ra.fromBufferAttribute(t,i-1),aa.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=ra.distanceTo(aa);e.setAttribute("lineDistance",new rt(n,1))}else Ce("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),wr.copy(n.boundingSphere),wr.applyMatrix4(i),wr.radius+=r,e.ray.intersectsSphere(wr)===!1)return;Xl.copy(i).invert(),Es.copy(e.ray).applyMatrix4(Xl);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),c=o*o,l=this.isLineSegments?2:1,h=n.index,d=n.attributes.position;if(h!==null){const f=Math.max(0,a.start),g=Math.min(h.count,a.start+a.count);for(let b=f,m=g-1;b<m;b+=l){const p=h.getX(b),_=h.getX(b+1),y=Ar(this,e,Es,c,p,_,b);y&&t.push(y)}if(this.isLineLoop){const b=h.getX(g-1),m=h.getX(f),p=Ar(this,e,Es,c,b,m,g-1);p&&t.push(p)}}else{const f=Math.max(0,a.start),g=Math.min(d.count,a.start+a.count);for(let b=f,m=g-1;b<m;b+=l){const p=Ar(this,e,Es,c,b,b+1,b);p&&t.push(p)}if(this.isLineLoop){const b=Ar(this,e,Es,c,g-1,f,g-1);b&&t.push(b)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Ar(s,e,t,n,i,r,a){const o=s.geometry.attributes.position;if(ra.fromBufferAttribute(o,i),aa.fromBufferAttribute(o,r),t.distanceSqToSegment(ra,aa,Ka,ql)>n)return;Ka.applyMatrix4(s.matrixWorld);const l=e.ray.origin.distanceTo(Ka);if(!(l<e.near||l>e.far))return{distance:l,point:ql.clone().applyMatrix4(s.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:s}}const jl=new L,Kl=new L;class Yf extends tr{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,r=t.count;i<r;i+=2)jl.fromBufferAttribute(t,i),Kl.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+jl.distanceTo(Kl);e.setAttribute("lineDistance",new rt(n,1))}else Ce("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Jf extends tr{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class bu extends Rn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new ze(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Yl=new Ye,oc=new er,Rr=new Cn,Cr=new L;class Zf extends yt{constructor(e=new xt,t=new bu){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Rr.copy(n.boundingSphere),Rr.applyMatrix4(i),Rr.radius+=r,e.ray.intersectsSphere(Rr)===!1)return;Yl.copy(i).invert(),oc.copy(e.ray).applyMatrix4(Yl);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),c=o*o,l=n.index,u=n.attributes.position;if(l!==null){const d=Math.max(0,a.start),f=Math.min(l.count,a.start+a.count);for(let g=d,b=f;g<b;g++){const m=l.getX(g);Cr.fromBufferAttribute(u,m),Jl(Cr,m,c,i,e,t,this)}}else{const d=Math.max(0,a.start),f=Math.min(u.count,a.start+a.count);for(let g=d,b=f;g<b;g++)Cr.fromBufferAttribute(u,g),Jl(Cr,g,c,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Jl(s,e,t,n,i,r,a){const o=oc.distanceSqToPoint(s);if(o<t){const c=new L;oc.closestPointToPoint(s,c),c.applyMatrix4(n);const l=i.ray.origin.distanceTo(c);if(l<i.near||l>i.far)return;r.push({distance:l,distanceToRay:Math.sqrt(o),point:c,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class xu extends Nt{constructor(e=[],t=Ci,n,i,r,a,o,c,l,h){super(e,t,n,i,r,a,o,c,l,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Qf extends Nt{constructor(e,t,n,i,r,a,o,c,l){super(e,t,n,i,r,a,o,c,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Di extends Nt{constructor(e,t,n=Vn,i,r,a,o=Rt,c=Rt,l,h=ti,u=1){if(h!==ti&&h!==pi)throw new Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const d={width:e,height:t,depth:u};super(d,i,r,a,o,c,h,n,l),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Lc(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class $f extends Di{constructor(e,t=Vn,n=Ci,i,r,a=Rt,o=Rt,c,l=ti){const h={width:e,height:e,depth:1},u=[h,h,h,h,h,h];super(e,e,t,n,i,r,a,o,c,l),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class vu extends Nt{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class ni extends xt{constructor(e=1,t=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const o=this;i=Math.floor(i),r=Math.floor(r),a=Math.floor(a);const c=[],l=[],h=[],u=[];let d=0,f=0;g("z","y","x",-1,-1,n,t,e,a,r,0),g("z","y","x",1,-1,n,t,-e,a,r,1),g("x","z","y",1,1,e,n,t,i,a,2),g("x","z","y",1,-1,e,n,-t,i,a,3),g("x","y","z",1,-1,e,t,n,i,r,4),g("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(c),this.setAttribute("position",new rt(l,3)),this.setAttribute("normal",new rt(h,3)),this.setAttribute("uv",new rt(u,2));
5function g(b,m,p,_,y,v,T,E,C,x,S){const A=v/C,R=T/x,D=v/2,F=T/2,O=E/2,I=C+1,B=x+1;let G=0,j=0;const Y=new L;for(let ne=0;ne<B;ne++){const oe=ne*R-F;for(let ce=0;ce<I;ce++){const Ee=ce*A-D;Y[b]=Ee*_,Y[m]=oe*y,Y[p]=O,l.push(Y.x,Y.y,Y.z),Y[b]=0,Y[m]=0,Y[p]=E>0?1:-1,h.push(Y.x,Y.y,Y.z),u.push(ce/C),u.push(1-ne/x),G+=1}}for(let ne=0;ne<x;ne++)for(let oe=0;oe<C;oe++){const ce=d+oe+I*ne,Ee=d+oe+I*(ne+1),je=d+(oe+1)+I*(ne+1),Ve=d+(oe+1)+I*ne;c.push(ce,Ee,Ve),c.push(Ee,je,Ve),j+=6}o.addGroup(f,j,S),f+=j,d+=G}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ni(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class Oc extends xt{constructor(e=1,t=1,n=4,i=8,r=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:i,heightSegments:r},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),i=Math.max(3,Math.floor(i)),r=Math.max(1,Math.floor(r));const a=[],o=[],c=[],l=[],h=t/2,u=Math.PI/2*e,d=t,f=2*u+d,g=n*2+r,b=i+1,m=new L,p=new L;for(let _=0;_<=g;_++){let y=0,v=0,T=0,E=0;if(_<=n){const S=_/n,A=S*Math.PI/2;v=-h-e*Math.cos(A),T=e*Math.sin(A),E=-e*Math.cos(A),y=S*u}else if(_<=n+r){const S=(_-n)/r;v=-h+S*t,T=e,E=0,y=u+S*d}else{const S=(_-n-r)/n,A=S*Math.PI/2;v=h+e*Math.sin(A),T=e*Math.cos(A),E=e*Math.sin(A),y=u+d+S*u}const C=Math.max(0,Math.min(1,y/f));let x=0;_===0?x=.5/i:_===g&&(x=-.5/i);for(let S=0;S<=i;S++){const A=S/i,R=A*Math.PI*2,D=Math.sin(R),F=Math.cos(R);p.x=-T*F,p.y=v,p.z=T*D,o.push(p.x,p.y,p.z),m.set(-T*F,E,T*D),m.normalize(),c.push(m.x,m.y,m.z),l.push(A+x,C)}if(_>0){const S=(_-1)*b;for(let A=0;A<i;A++){const R=S+A,D=S+A+1,F=_*b+A,O=_*b+A+1;a.push(R,D,F),a.push(D,O,F)}}}this.setIndex(a),this.setAttribute("position",new rt(o,3)),this.setAttribute("normal",new rt(c,3)),this.setAttribute("uv",new rt(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Oc(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class js extends xt{constructor(e=1,t=1,n=1,i=32,r=1,a=!1,o=0,c=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:c};const l=this;i=Math.floor(i),r=Math.floor(r);const h=[],u=[],d=[],f=[];let g=0;const b=[],m=n/2;let p=0;_(),a===!1&&(e>0&&y(!0),t>0&&y(!1)),this.setIndex(h),this.setAttribute("position",new rt(u,3)),this.setAttribute("normal",new rt(d,3)),this.setAttribute("uv",new rt(f,2));function _(){const v=new L,T=new L;let E=0;const C=(t-e)/n;for(let x=0;x<=r;x++){const S=[],A=x/r,R=A*(t-e)+e;for(let D=0;D<=i;D++){const F=D/i,O=F*c+o,I=Math.sin(O),B=Math.cos(O);T.x=R*I,T.y=-A*n+m,T.z=R*B,u.push(T.x,T.y,T.z),v.set(I,C,B).normalize(),d.push(v.x,v.y,v.z),f.push(F,1-A),S.push(g++)}b.push(S)}for(let x=0;x<i;x++)for(let S=0;S<r;S++){const A=b[S][x],R=b[S+1][x],D=b[S+1][x+1],F=b[S][x+1];(e>0||S!==0)&&(h.push(A,R,F),E+=3),(t>0||S!==r-1)&&(h.push(R,D,F),E+=3)}l.addGroup(p,E,0),p+=E}function y(v){const T=g,E=new te,C=new L;let x=0;const S=v===!0?e:t,A=v===!0?1:-1;for(let D=1;D<=i;D++)u.push(0,m*A,0),d.push(0,A,0),f.push(.5,.5),g++;const R=g;for(let D=0;D<=i;D++){const O=D/i*c+o,I=Math.cos(O),B=Math.sin(O);C.x=S*B,C.y=m*A,C.z=S*I,u.push(C.x,C.y,C.z),d.push(0,A,0),E.x=I*.5+.5,E.y=B*.5*A+.5,f.push(E.x,E.y),g++}for(let D=0;D<i;D++){const F=T+D,O=R+D;v===!0?h.push(O,O+1,F):h.push(O+1,O,F),x+=3}l.addGroup(p,x,v===!0?1:2),p+=x}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new js(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Hn{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){Ce("Curve: .getPoint() not implemented.")}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),r=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),r+=n.distanceTo(i),t.push(r),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const n=this.getLengths();let i=0;const r=n.length;let a;t?a=t:a=e*n[r-1];let o=0,c=r-1,l;for(;o<=c;)if(i=Math.floor(o+(c-o)/2),l=n[i]-a,l<0)o=i+1;else if(l>0)c=i-1;else{c=i;break}if(i=c,n[i]===a)return i/(r-1);const h=n[i],d=n[i+1]-h,f=(a-h)/d;return(i+f)/(r-1)}getTangent(e,t){let i=e-1e-4,r=e+1e-4;i<0&&(i=0),r>1&&(r=1);const a=this.getPoint(i),o=this.getPoint(r),c=t||(a.isVector2?new te:new L);return c.copy(o).sub(a).normalize(),c}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){const n=new L,i=[],r=[],a=[],o=new L,c=new Ye;for(let f=0;f<=e;f++){const g=f/e;i[f]=this.getTangentAt(g,new L)}r[0]=new L,a[0]=new L;let l=Number.MAX_VALUE;const h=Math.abs(i[0].x),u=Math.abs(i[0].y),d=Math.abs(i[0].z);h<=l&&(l=h,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),d<=l&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],o),a[0].crossVectors(i[0],r[0]);for(let f=1;f<=e;f++){if(r[f]=r[f-1].clone(),a[f]=a[f-1].clone(),o.crossVectors(i[f-1],i[f]),o.length()>Number.EPSILON){o.normalize();
vendor: 4,971 bytes, line 5
5const g=Math.acos(Qe(i[f-1].dot(i[f]),-1,1));r[f].applyMatrix4(c.makeRotationAxis(o,g))}a[f].crossVectors(i[f],r[f])}if(t===!0){let f=Math.acos(Qe(r[0].dot(r[e]),-1,1));f/=e,i[0].dot(o.crossVectors(r[0],r[e]))>0&&(f=-f);for(let g=1;g<=e;g++)r[g].applyMatrix4(c.makeRotationAxis(i[g],f*g)),a[g].crossVectors(i[g],r[g])}return{tangents:i,normals:r,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Bc extends Hn{constructor(e=0,t=0,n=1,i=1,r=0,a=Math.PI*2,o=!1,c=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=o,this.aRotation=c}getPoint(e,t=new te){const n=t,i=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const a=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(a?r=0:r=i),this.aClockwise===!0&&!a&&(r===i?r=-i:r=r-i);const o=this.aStartAngle+e*r;let c=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const h=Math.cos(this.aRotation),u=Math.sin(this.aRotation),d=c-this.aX,f=l-this.aY;c=d*h-f*u+this.aX,l=d*u+f*h+this.aY}return n.set(c,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class ep extends Bc{constructor(e,t,n,i,r,a){super(e,t,n,n,i,r,a),this.isArcCurve=!0,this.type="ArcCurve"}}function kc(){let s=0,e=0,t=0,n=0;function i(r,a,o,c){s=r,e=o,t=-3*r+3*a-2*o-c,n=2*r-2*a+o+c}return{initCatmullRom:function(r,a,o,c,l){i(a,o,l*(o-r),l*(c-a))},initNonuniformCatmullRom:function(r,a,o,c,l,h,u){let d=(a-r)/l-(o-r)/(l+h)+(o-a)/h,f=(o-a)/h-(c-a)/(h+u)+(c-o)/u;d*=h,f*=h,i(a,o,d,f)},calc:function(r){const a=r*r,o=a*r;return s+e*r+t*a+n*o}}}const Zl=new L,Ql=new L,Ya=new kc,Ja=new kc,Za=new kc;class tp extends Hn{constructor(e=[],t=!1,n="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e,t=new L){const n=t,i=this.points,r=i.length,a=(r-(this.closed?0:1))*e;let o=Math.floor(a),c=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/r)+1)*r:c===0&&o===r-1&&(o=r-2,c=1);let l,h;this.closed||o>0?l=i[(o-1)%r]:(Ql.subVectors(i[0],i[1]).add(i[0]),l=Ql);const u=i[o%r],d=i[(o+1)%r];if(this.closed||o+2<r?h=i[(o+2)%r]:(Zl.subVectors(i[r-1],i[r-2]).add(i[r-1]),h=Zl),this.curveType==="centripetal"||this.curveType==="chordal"){const f=this.curveType==="chordal"?.5:.25;let g=Math.pow(l.distanceToSquared(u),f),b=Math.pow(u.distanceToSquared(d),f),m=Math.pow(d.distanceToSquared(h),f);b<1e-4&&(b=1),g<1e-4&&(g=b),m<1e-4&&(m=b),Ya.initNonuniformCatmullRom(l.x,u.x,d.x,h.x,g,b,m),Ja.initNonuniformCatmullRom(l.y,u.y,d.y,h.y,g,b,m),Za.initNonuniformCatmullRom(l.z,u.z,d.z,h.z,g,b,m)}else this.curveType==="catmullrom"&&(Ya.initCatmullRom(l.x,u.x,d.x,h.x,this.tension),Ja.initCatmullRom(l.y,u.y,d.y,h.y,this.tension),Za.initCatmullRom(l.z,u.z,d.z,h.z,this.tension));return n.set(Ya.calc(c),Ja.calc(c),Za.calc(c)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new L().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function $l(s,e,t,n,i){const r=(n-e)*.5,a=(i-t)*.5,o=s*s,c=s*o;return(2*t-2*n+r+a)*c+(-3*t+3*n-2*r-a)*o+r*s+t}function np(s,e){const t=1-s;return t*t*e}function ip(s,e){return 2*(1-s)*s*e}function sp(s,e){return s*s*e}function ks(s,e,t,n){return np(s,e)+ip(s,t)+sp(s,n)}function rp(s,e){const t=1-s;return t*t*t*e}function ap(s,e){const t=1-s;return 3*t*t*s*e}function op(s,e){return 3*(1-s)*s*s*e}function cp(s,e){return s*s*s*e}function zs(s,e,t,n,i){return rp(s,e)+ap(s,t)+op(s,n)+cp(s,i)}
vendor: 15,632 bytes, line 5
5class _u extends Hn{constructor(e=new te,t=new te,n=new te,i=new te){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new te){const n=t,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(zs(e,i.x,r.x,a.x,o.x),zs(e,i.y,r.y,a.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class lp extends Hn{constructor(e=new L,t=new L,n=new L,i=new L){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new L){const n=t,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(zs(e,i.x,r.x,a.x,o.x),zs(e,i.y,r.y,a.y,o.y),zs(e,i.z,r.z,a.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class Mu extends Hn{constructor(e=new te,t=new te){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new te){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new te){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class hp extends Hn{constructor(e=new L,t=new L){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new L){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new L){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class yu extends Hn{constructor(e=new te,t=new te,n=new te){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new te){const n=t,i=this.v0,r=this.v1,a=this.v2;return n.set(ks(e,i.x,r.x,a.x),ks(e,i.y,r.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class up extends Hn{constructor(e=new L,t=new L,n=new L){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new L){const n=t,i=this.v0,r=this.v1,a=this.v2;return n.set(ks(e,i.x,r.x,a.x),ks(e,i.y,r.y,a.y),ks(e,i.z,r.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Su extends Hn{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new te){const n=t,i=this.points,r=(i.length-1)*e,a=Math.floor(r),o=r-a,c=i[a===0?a:a-1],l=i[a],h=i[a>i.length-2?i.length-1:a+1],u=i[a>i.length-3?i.length-1:a+2];return n.set($l(o,c.x,l.x,h.x,u.x),$l(o,c.y,l.y,h.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new te().fromArray(i))}return this}}var cc=Object.freeze({__proto__:null,ArcCurve:ep,CatmullRomCurve3:tp,CubicBezierCurve:_u,CubicBezierCurve3:lp,EllipseCurve:Bc,LineCurve:Mu,LineCurve3:hp,QuadraticBezierCurve:yu,QuadraticBezierCurve3:up,SplineCurve:Su});class dp extends Hn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const n=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new cc[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=n){const a=i[r]-n,o=this.curves[r],c=o.getLength(),l=c===0?0:1-a/c;return o.getPointAt(l,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let i=0,r=this.curves;i<r.length;i++){const a=r[i],o=a.isEllipseCurve?e*2:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?e*a.points.length:e,c=a.getPoints(o);for(let l=0;l<c.length;l++){const h=c[l];n&&n.equals(h)||(t.push(h),n=h)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(new cc[i.type]().fromJSON(i))}return this}}class eh extends dp{constructor(e){super(),this.type="Path",this.currentPoint=new te,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new Mu(this.currentPoint.clone(),new te(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,i){const r=new yu(this.currentPoint.clone(),new te(e,t),new te(n,i));return this.curves.push(r),this.currentPoint.set(n,i),this}bezierCurveTo(e,t,n,i,r,a){const o=new _u(this.currentPoint.clone(),new te(e,t),new te(n,i),new te(r,a));return this.curves.push(o),this.currentPoint.set(r,a),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new Su(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,i,r,a){const o=this.currentPoint.x,c=this.currentPoint.y;return this.absarc(e+o,t+c,n,i,r,a),this}absarc(e,t,n,i,r,a){return this.absellipse(e,t,n,n,i,r,a),this}ellipse(e,t,n,i,r,a,o,c){const l=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+l,t+h,n,i,r,a,o,c),this}absellipse(e,t,n,i,r,a,o,c){const l=new Bc(e,t,n,i,r,a,o,c);if(this.curves.length>0){const u=l.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(l);const h=l.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class zc extends eh{constructor(e){super(e),this.uuid=vn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(new eh().fromJSON(i))}return this}}function fp(s,e,t=2){const n=e&&e.length,i=n?e[0]*t:s.length;let r=Tu(s,0,i,t,!0);const a=[];if(!r||r.next===r.prev)return a;let o,c,l;if(n&&(r=xp(s,e,r,t)),s.length>80*t){o=s[0],c=s[1];let h=o,u=c;for(let d=t;d<i;d+=t){const f=s[d],g=s[d+1];f<o&&(o=f),g<c&&(c=g),f>h&&(h=f),g>u&&(u=g)}l=Math.max(h-o,u-c),l=l!==0?32767/l:0}return Ks(r,a,t,o,c,l,0),a}function Tu(s,e,t,n,i){let r;if(i===Cp(s,e,t,n)>0)for(let a=e;a<t;a+=n)r=th(a/n|0,s[a],s[a+1],r);else for(let a=t-n;a>=e;a-=n)r=th(a/n|0,s[a],s[a+1],r);return r&&ls(r,r.next)&&(Js(r),r=r.next),r}function Li(s,e){if(!s)return s;e||(e=s);let t=s,n;do if(n=!1,!t.steiner&&(ls(t,t.next)||At(t.prev,t,t.next)===0)){if(Js(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function Ks(s,e,t,n,i,r,a){if(!s)return;!a&&r&&Sp(s,n,i,r);let o=s;for(;s.prev!==s.next;){const c=s.prev,l=s.next;if(r?mp(s,n,i,r):pp(s)){e.push(c.i,s.i,l.i),Js(s),s=l.next,o=l.next;continue}if(s=l,s===o){a?a===1?(s=gp(Li(s),e),Ks(s,e,t,n,i,r,2)):a===2&&bp(s,e,t,n,i,r):Ks(Li(s),e,t,n,i,r,1);break}}}function pp(s){const e=s.prev,t=s,n=s.next;if(At(e,t,n)>=0)return!1;const i=e.x,r=t.x,a=n.x,o=e.y,c=t.y,l=n.y,h=Math.min(i,r,a),u=Math.min(o,c,l),d=Math.max(i,r,a),f=Math.max(o,c,l);let g=n.next;for(;g!==e;){if(g.x>=h&&g.x<=d&&g.y>=u&&g.y<=f&&Is(i,o,r,c,a,l,g.x,g.y)&&At(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function mp(s,e,t,n){const i=s.prev,r=s,a=s.next;if(At(i,r,a)>=0)return!1;const o=i.x,c=r.x,l=a.x,h=i.y,u=r.y,d=a.y,f=Math.min(o,c,l),g=Math.min(h,u,d),b=Math.max(o,c,l),m=Math.max(h,u,d),p=lc(f,g,e,t,n),_=lc(b,m,e,t,n);let y=s.prevZ,v=s.nextZ;for(;y&&y.z>=p&&v&&v.z<=_;){if(y.x>=f&&y.x<=b&&y.y>=g&&y.y<=m&&y!==i&&y!==a&&Is(o,h,c,u,l,d,y.x,y.y)&&At(y.prev,y,y.next)>=0||(y=y.prevZ,v.x>=f&&v.x<=b&&v.y>=g&&v.y<=m&&v!==i&&v!==a&&Is(o,h,c,u,l,d,v.x,v.y)&&At(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;y&&y.z>=p;){if(y.x>=f&&y.x<=b&&y.y>=g&&y.y<=m&&y!==i&&y!==a&&Is(o,h,c,u,l,d,y.x,y.y)&&At(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;v&&v.z<=_;){if(v.x>=f&&v.x<=b&&v.y>=g&&v.y<=m&&v!==i&&v!==a&&Is(o,h,c,u,l,d,v.x,v.y)&&At(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function gp(s,e){let t=s;do{const n=t.prev,i=t.next.next;!ls(n,i)&&wu(n,t,t.next,i)&&Ys(n,i)&&Ys(i,n)&&(e.push(n.i,t.i,i.i),Js(t),Js(t.next),t=s=i),t=t.next}while(t!==s);return Li(t)}function bp(s,e,t,n,i,r){let a=s;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&wp(a,o)){let c=Au(a,o);a=Li(a,a.next),c=Li(c,c.next),Ks(a,e,t,n,i,r,0),Ks(c,e,t,n,i,r,0);return}o=o.next}a=a.next}while(a!==s)}function xp(s,e,t,n){const i=[];for(let r=0,a=e.length;r<a;r++){const o=e[r]*n,c=r<a-1?e[r+1]*n:s.length,l=Tu(s,o,c,n,!1);l===l.next&&(l.steiner=!0),i.push(Ep(l))}i.sort(vp);for(let r=0;r<i.length;r++)t=_p(i[r],t);return t}function vp(s,e){let t=s.x-e.x;if(t===0&&(t=s.y-e.y,t===0)){const n=(s.next.y-s.y)/(s.next.x-s.x),i=(e.next.y-e.y)/(e.next.x-e.x);t=n-i}return t}function _p(s,e){const t=Mp(s,e);if(!t)return e;const n=Au(t,s);return Li(n,n.next),Li(t,t.next)}function Mp(s,e){let t=e;const n=s.x,i=s.y;let r=-1/0,a;if(ls(s,t))return t;do{if(ls(s,t.next))return t.next;if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){const u=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(u<=n&&u>r&&(r=u,a=t.x<t.next.x?t:t.next,u===n))return a}t=t.next}while(t!==e);if(!a)return null;const o=a,c=a.x,l=a.y;let h=1/0;t=a;do{if(n>=t.x&&t.x>=c&&n!==t.x&&Eu(i<l?n:r,i,c,l,i<l?r:n,i,t.x,t.y)){const u=Math.abs(i-t.y)/(n-t.x);Ys(t,s)&&(u<h||u===h&&(t.x>a.x||t.x===a.x&&yp(a,t)))&&(a=t,h=u)}t=t.next}while(t!==o);return a}function yp(s,e){return At(s.prev,s,e.prev)<0&&At(e.next,s,s.next)<0}function Sp(s,e,t,n){let i=s;do i.z===0&&(i.z=lc(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==s);i.prevZ.nextZ=null,i.prevZ=null,Tp(i)}function Tp(s){let e,t=1;do{let n=s,i;s=null;let r=null;for(e=0;n;){e++;let a=n,o=0;for(let l=0;l<t&&(o++,a=a.nextZ,!!a);l++);let c=t;for(;o>0||c>0&&a;)o!==0&&(c===0||!a||n.z<=a.z)?(i=n,n=n.nextZ,o--):(i=a,a=a.nextZ,c--),r?r.nextZ=i:s=i,i.prevZ=r,r=i;n=a}r.nextZ=null,t*=2}while(e>1);return s}function lc(s,e,t,n,i){return s=(s-t)*i|0,e=(e-n)*i|0,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,s|e<<1}function Ep(s){let e=s,t=s;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==s);return t}function Eu(s,e,t,n,i,r,a,o){return(i-a)*(e-o)>=(s-a)*(r-o)&&(s-a)*(n-o)>=(t-a)*(e-o)&&(t-a)*(r-o)>=(i-a)*(n-o)}function Is(s,e,t,n,i,r,a,o){return!(s===a&&e===o)&&Eu(s,e,t,n,i,r,a,o)}function wp(s,e){return s.next.i!==e.i&&s.prev.i!==e.i&&!Ap(s,e)&&(Ys(s,e)&&Ys(e,s)&&Rp(s,e)&&(At(s.prev,s,e.prev)||At(s,e.prev,e))||ls(s,e)&&At(s.prev,s,s.next)>0&&At(e.prev,e,e.next)>0)}function At(s,e,t){return(e.y-s.y)*(t.x-e.x)-(e.x-s.x)*(t.y-e.y)}function ls(s,e){return s.x===e.x&&s.y===e.y}function wu(s,e,t,n){const i=Dr(At(s,e,t)),r=Dr(At(s,e,n)),a=Dr(At(t,n,s)),o=Dr(At(t,n,e));return!!(i!==r&&a!==o||i===0&&Pr(s,t,e)||r===0&&Pr(s,n,e)||a===0&&Pr(t,s,n)||o===0&&Pr(t,e,n))}function Pr(s,e,t){return e.x<=Math.max(s.x,t.x)&&e.x>=Math.min(s.x,t.x)&&e.y<=Math.max(s.y,t.y)&&e.y>=Math.min(s.y,t.y)}function Dr(s){return s>0?1:s<0?-1:0}function Ap(s,e){let t=s;do{if(t.i!==s.i&&t.next.i!==s.i&&t.i!==e.i&&t.next.i!==e.i&&wu(t,t.next,s,e))return!0;t=t.next}while(t!==s);return!1}function Ys(s,e){return At(s.prev,s,s.next)<0?At(s,e,s.next)>=0&&At(s,s.prev,e)>=0:At(s,e,s.prev)<0||At(s,s.next,e)<0}function Rp(s,e){let t=s,n=!1;const i=(s.x+e.x)/2,r=(s.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&i<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==s);return n}function Au(s,e){const t=hc(s.i,s.x,s.y),n=hc(e.i,e.x,e.y),i=s.next,r=e.prev;return s.next=e,e.prev=s,t.next=i,i.prev=t,n.next=t,t.prev=n,r.next=n,n.prev=r,n}function th(s,e,t,n){const i=hc(s,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Js(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function hc(s,e,t){return{i:s,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Cp(s,e,t,n){let i=0;for(let r=e,a=t-n;r<t;r+=n)i+=(s[a]-s[r])*(s[r+1]+s[a+1]),a=r;return i}class Pp{static triangulate(e,t,n=2){return fp(e,t,n)}}class Ai{static area(e){const t=e.length;let n=0;for(let i=t-1,r=0;r<t;i=r++)n+=e[i].x*e[r].y-e[r].x*e[i].y;return n*.5}static isClockWise(e){return Ai.area(e)<0}
5static triangulateShape(e,t){const n=[],i=[],r=[];nh(e),ih(n,e);let a=e.length;t.forEach(nh);for(let c=0;c<t.length;c++)i.push(a),a+=t[c].length,ih(n,t[c]);const o=Pp.triangulate(n,i);for(let c=0;c<o.length;c+=3)r.push(o.slice(c,c+3));return r}}function nh(s){const e=s.length;e>2&&s[e-1].equals(s[0])&&s.pop()}function ih(s,e){for(let t=0;t<e.length;t++)s.push(e[t].x),s.push(e[t].y)}class pa extends xt{constructor(e=new zc([new te(.5,.5),new te(-.5,.5),new te(-.5,-.5),new te(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,i=[],r=[];for(let o=0,c=e.length;o<c;o++){const l=e[o];a(l)}this.setAttribute("position",new rt(i,3)),this.setAttribute("uv",new rt(r,2)),this.computeVertexNormals();function a(o){const c=[],l=t.curveSegments!==void 0?t.curveSegments:12,h=t.steps!==void 0?t.steps:1,u=t.depth!==void 0?t.depth:1;let d=t.bevelEnabled!==void 0?t.bevelEnabled:!0,f=t.bevelThickness!==void 0?t.bevelThickness:.2,g=t.bevelSize!==void 0?t.bevelSize:f-.1,b=t.bevelOffset!==void 0?t.bevelOffset:0,m=t.bevelSegments!==void 0?t.bevelSegments:3;const p=t.extrudePath,_=t.UVGenerator!==void 0?t.UVGenerator:Dp;let y,v=!1,T,E,C,x;if(p){y=p.getSpacedPoints(h),v=!0,d=!1;const ie=p.isCatmullRomCurve3?p.closed:!1;T=p.computeFrenetFrames(h,ie),E=new L,C=new L,x=new L}d||(m=0,f=0,g=0,b=0);const S=o.extractPoints(l);let A=S.shape;const R=S.holes;if(!Ai.isClockWise(A)){A=A.reverse();for(let ie=0,ae=R.length;ie<ae;ie++){const re=R[ie];Ai.isClockWise(re)&&(R[ie]=re.reverse())}}function F(ie){const re=10000000000000001e-36;let be=ie[0];for(let pe=1;pe<=ie.length;pe++){const ke=pe%ie.length,Ae=ie[ke],Ge=Ae.x-be.x,Xe=Ae.y-be.y,N=Ge*Ge+Xe*Xe,ot=Math.max(Math.abs(Ae.x),Math.abs(Ae.y),Math.abs(be.x),Math.abs(be.y)),$e=re*ot*ot;if(N<=$e){ie.splice(ke,1),pe--;continue}be=Ae}}F(A),R.forEach(F);const O=R.length,I=A;for(let ie=0;ie<O;ie++){const ae=R[ie];A=A.concat(ae)}function B(ie,ae,re){return ae||We("ExtrudeGeometry: vec does not exist"),ie.clone().addScaledVector(ae,re)}const G=A.length;function j(ie,ae,re){let be,pe,ke;const Ae=ie.x-ae.x,Ge=ie.y-ae.y,Xe=re.x-ie.x,N=re.y-ie.y,ot=Ae*Ae+Ge*Ge,$e=Ae*N-Ge*Xe;if(Math.abs($e)>Number.EPSILON){const P=Math.sqrt(ot),M=Math.sqrt(Xe*Xe+N*N),V=ae.x-Ge/P,H=ae.y+Ae/P,K=re.x-N/M,he=re.y+Xe/M,ue=((K-V)*N-(he-H)*Xe)/(Ae*N-Ge*Xe);be=V+Ae*ue-ie.x,pe=H+Ge*ue-ie.y;const J=be*be+pe*pe;if(J<=2)return new te(be,pe);ke=Math.sqrt(J/2)}else{let P=!1;Ae>Number.EPSILON?Xe>Number.EPSILON&&(P=!0):Ae<-Number.EPSILON?Xe<-Number.EPSILON&&(P=!0):Math.sign(Ge)===Math.sign(N)&&(P=!0),P?(be=-Ge,pe=Ae,ke=Math.sqrt(ot)):(be=Ae,pe=Ge,ke=Math.sqrt(ot/2))}return new te(be/ke,pe/ke)}const Y=[];for(let ie=0,ae=I.length,re=ae-1,be=ie+1;ie<ae;ie++,re++,be++)re===ae&&(re=0),be===ae&&(be=0),Y[ie]=j(I[ie],I[re],I[be]);const ne=[];let oe,ce=Y.concat();for(let ie=0,ae=O;ie<ae;ie++){const re=R[ie];oe=[];for(let be=0,pe=re.length,ke=pe-1,Ae=be+1;be<pe;be++,ke++,Ae++)ke===pe&&(ke=0),Ae===pe&&(Ae=0),oe[be]=j(re[be],re[ke],re[Ae]);ne.push(oe),ce=ce.concat(oe)}let Ee;if(m===0)Ee=Ai.triangulateShape(I,R);else{const ie=[],ae=[];for(let re=0;re<m;re++){const be=re/m,pe=f*Math.cos(be*Math.PI/2),ke=g*Math.sin(be*Math.PI/2)+b;for(let Ae=0,Ge=I.length;Ae<Ge;Ae++){const Xe=B(I[Ae],Y[Ae],ke);Se(Xe.x,Xe.y,-pe),be===0&&ie.push(Xe)}for(let Ae=0,Ge=O;Ae<Ge;Ae++){const Xe=R[Ae];oe=ne[Ae];const N=[];for(let ot=0,$e=Xe.length;ot<$e;ot++){const P=B(Xe[ot],oe[ot],ke);Se(P.x,P.y,-pe),be===0&&N.push(P)}be===0&&ae.push(N)}}Ee=Ai.triangulateShape(ie,ae)}const je=Ee.length,Ve=g+b;for(let ie=0;ie<G;ie++){const ae=d?B(A[ie],ce[ie],Ve):A[ie];v?(C.copy(T.normals[0]).multiplyScalar(ae.x),E.copy(T.binormals[0]).multiplyScalar(ae.y),x.copy(y[0]).add(C).add(E),Se(x.x,x.y,x.z)):Se(ae.x,ae.y,0)}for(let ie=1;ie<=h;ie++)for(let ae=0;ae<G;ae++){const re=d?B(A[ae],ce[ae],Ve):A[ae];v?(C.copy(T.normals[ie]).multiplyScalar(re.x),E.copy(T.binormals[ie]).multiplyScalar(re.y),x.copy(y[ie]).add(C).add(E),Se(x.x,x.y,x.z)):Se(re.x,re.y,u/h*ie)}for(let ie=m-1;ie>=0;ie--){const ae=ie/m,re=f*Math.cos(ae*Math.PI/2),be=g*Math.sin(ae*Math.PI/2)+b;for(let pe=0,ke=I.length;pe<ke;pe++){const Ae=B(I[pe],Y[pe],be);Se(Ae.x,Ae.y,u+re)}for(let pe=0,ke=R.length;pe<ke;pe++){const Ae=R[pe];oe=ne[pe];for(let Ge=0,Xe=Ae.length;Ge<Xe;Ge++){const N=B(Ae[Ge],oe[Ge],be);v?Se(N.x,N.y+y[h-1].y,y[h-1].x+re):Se(N.x,N.y,u+re)}}}k(),ee();function k(){const ie=i.length/3;if(d){let ae=0,re=G*ae;for(let be=0;be<je;be++){const pe=Ee[be];Le(pe[2]+re,pe[1]+re,pe[0]+re)}ae=h+m*2,re=G*ae;for(let be=0;be<je;be++){const pe=Ee[be];Le(pe[0]+re,pe[1]+re,pe[2]+re)}}else{for(let ae=0;ae<je;ae++){const re=Ee[ae];Le(re[2],re[1],re[0])}for(let ae=0;ae<je;ae++){const re=Ee[ae];
vendor: 18,716 bytes, lines 5-9
5Le(re[0]+G*h,re[1]+G*h,re[2]+G*h)}}n.addGroup(ie,i.length/3-ie,0)}function ee(){const ie=i.length/3;let ae=0;Q(I,ae),ae+=I.length;for(let re=0,be=R.length;re<be;re++){const pe=R[re];Q(pe,ae),ae+=pe.length}n.addGroup(ie,i.length/3-ie,1)}function Q(ie,ae){let re=ie.length;for(;--re>=0;){const be=re;let pe=re-1;pe<0&&(pe=ie.length-1);for(let ke=0,Ae=h+m*2;ke<Ae;ke++){const Ge=G*ke,Xe=G*(ke+1),N=ae+be+Ge,ot=ae+pe+Ge,$e=ae+pe+Xe,P=ae+be+Xe;Ie(N,ot,$e,P)}}}function Se(ie,ae,re){c.push(ie),c.push(ae),c.push(re)}function Le(ie,ae,re){st(ie),st(ae),st(re);const be=i.length/3,pe=_.generateTopUV(n,i,be-3,be-2,be-1);He(pe[0]),He(pe[1]),He(pe[2])}function Ie(ie,ae,re,be){st(ie),st(ae),st(be),st(ae),st(re),st(be);const pe=i.length/3,ke=_.generateSideWallUV(n,i,pe-6,pe-3,pe-2,pe-1);He(ke[0]),He(ke[1]),He(ke[3]),He(ke[1]),He(ke[2]),He(ke[3])}function st(ie){i.push(c[ie*3+0]),i.push(c[ie*3+1]),i.push(c[ie*3+2])}function He(ie){r.push(ie.x),r.push(ie.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return Lp(t,n,e)}static fromJSON(e,t){const n=[];for(let r=0,a=e.shapes.length;r<a;r++){const o=t[e.shapes[r]];n.push(o)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new cc[i.type]().fromJSON(i)),new pa(n,e.options)}}const Dp={generateTopUV:function(s,e,t,n,i){const r=e[t*3],a=e[t*3+1],o=e[n*3],c=e[n*3+1],l=e[i*3],h=e[i*3+1];return[new te(r,a),new te(o,c),new te(l,h)]},generateSideWallUV:function(s,e,t,n,i,r){const a=e[t*3],o=e[t*3+1],c=e[t*3+2],l=e[n*3],h=e[n*3+1],u=e[n*3+2],d=e[i*3],f=e[i*3+1],g=e[i*3+2],b=e[r*3],m=e[r*3+1],p=e[r*3+2];return Math.abs(o-h)<Math.abs(a-l)?[new te(a,1-c),new te(l,1-u),new te(d,1-g),new te(b,1-p)]:[new te(o,1-c),new te(h,1-u),new te(f,1-g),new te(m,1-p)]}};function Lp(s,e,t){if(t.shapes=[],Array.isArray(s))for(let n=0,i=s.length;n<i;n++){const r=s[n];t.shapes.push(r.uuid)}else t.shapes.push(s.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class nr extends xt{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const r=e/2,a=t/2,o=Math.floor(n),c=Math.floor(i),l=o+1,h=c+1,u=e/o,d=t/c,f=[],g=[],b=[],m=[];for(let p=0;p<h;p++){const _=p*d-a;for(let y=0;y<l;y++){const v=y*u-r;g.push(v,-_,0),b.push(0,0,1),m.push(y/o),m.push(1-p/c)}}for(let p=0;p<c;p++)for(let _=0;_<o;_++){const y=_+l*p,v=_+l*(p+1),T=_+1+l*(p+1),E=_+1+l*p;f.push(y,v,E),f.push(v,T,E)}this.setIndex(f),this.setAttribute("position",new rt(g,3)),this.setAttribute("normal",new rt(b,3)),this.setAttribute("uv",new rt(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new nr(e.width,e.height,e.widthSegments,e.heightSegments)}}class Zs extends xt{constructor(e=1,t=32,n=16,i=0,r=Math.PI*2,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const c=Math.min(a+o,Math.PI);let l=0;const h=[],u=new L,d=new L,f=[],g=[],b=[],m=[];for(let p=0;p<=n;p++){const _=[],y=p/n,v=a+y*o,T=e*Math.cos(v),E=Math.sqrt(e*e-T*T);let C=0;p===0&&a===0?C=.5/t:p===n&&c===Math.PI&&(C=-.5/t);for(let x=0;x<=t;x++){const S=x/t,A=i+S*r;u.x=-E*Math.cos(A),u.y=T,u.z=E*Math.sin(A),g.push(u.x,u.y,u.z),d.copy(u).normalize(),b.push(d.x,d.y,d.z),m.push(S+C,1-y),_.push(l++)}h.push(_)}for(let p=0;p<n;p++)for(let _=0;_<t;_++){const y=h[p][_+1],v=h[p][_],T=h[p+1][_],E=h[p+1][_+1];(p!==0||a>0)&&f.push(y,v,E),(p!==n-1||c<Math.PI)&&f.push(v,T,E)}this.setIndex(f),this.setAttribute("position",new rt(g,3)),this.setAttribute("normal",new rt(b,3)),this.setAttribute("uv",new rt(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Zs(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}function hs(s){const e={};for(const t in s){e[t]={};for(const n in s[t]){const i=s[t][n];if(sh(i))i.isRenderTargetTexture?(Ce("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone();else if(Array.isArray(i))if(sh(i[0])){const r=[];for(let a=0,o=i.length;a<o;a++)r[a]=i[a].clone();e[t][n]=r}else e[t][n]=i.slice();else e[t][n]=i}}return e}function Qt(s){const e={};for(let t=0;t<s.length;t++){const n=hs(s[t]);for(const i in n)e[i]=n[i]}return e}function sh(s){return s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)}function Np(s){const e=[];for(let t=0;t<s.length;t++)e.push(s[t].clone());return e}function Ru(s){const e=s.getRenderTarget();return e===null?s.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:nt.workingColorSpace}const sn={clone:hs,merge:Qt};var Ip=`void main() {
6	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
7}`,Fp=`void main() {
8	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
9}`;class Tt extends Rn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Ip,this.fragmentShader=Fp,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=hs(e.uniforms),this.uniformsGroups=Np(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?t.uniforms[i]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[i]={type:"m4",value:a.toArray()}:t.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}fromJSON(e,t){if(super.fromJSON(e,t),e.uniforms!==void 0)for(const n in e.uniforms){const i=e.uniforms[n];switch(this.uniforms[n]={},i.type){case"t":this.uniforms[n].value=t[i.value]||null;break;case"c":this.uniforms[n].value=new ze().setHex(i.value);break;case"v2":this.uniforms[n].value=new te().fromArray(i.value);break;case"v3":this.uniforms[n].value=new L().fromArray(i.value);break;case"v4":this.uniforms[n].value=new dt().fromArray(i.value);break;case"m3":this.uniforms[n].value=new Je().fromArray(i.value);break;case"m4":this.uniforms[n].value=new Ye().fromArray(i.value);break;default:this.uniforms[n].value=i.value}}if(e.defines!==void 0&&(this.defines=e.defines),e.vertexShader!==void 0&&(this.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(this.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(this.glslVersion=e.glslVersion),e.extensions!==void 0)for(const n in e.extensions)this.extensions[n]=e.extensions[n];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}}class Cu extends Tt{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class St extends Rn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new ze(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 ze(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ta,this.normalScale=new te(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new gi,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class fn extends St{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new te(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Qe(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 ze(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 ze(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new ze(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Up extends Rn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ta,this.normalScale=new te(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class Op extends Rn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Wd,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Bp extends Rn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Lr(s,e){return!s||s.constructor===e?s:typeof e.BYTES_PER_ELEMENT=="number"?new e(s):Array.prototype.slice.call(s)}function kp(s){function e(i,r){return s[i]-s[r]}const t=s.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function rh(s,e,t){const n=s.length,i=new s.constructor(n);for(let r=0,a=0;a!==n;++r){const o=t[r]*e;for(let c=0;c!==e;++c)i[a++]=s[o+c]}return i}function zp(s,e,t,n){let i=1,r=s[0];for(;r!==void 0&&r[n]===void 0;)r=s[i++];if(r===void 0)return;let a=r[n];if(a!==void 0)if(Array.isArray(a))do a=r[n],a!==void 0&&(e.push(r.time),t.push(...a)),r=s[i++];while(r!==void 0);else if(a.toArray!==void 0)do a=r[n],a!==void 0&&(e.push(r.time),a.toArray(t,t.length)),r=s[i++];while(r!==void 0);else do a=r[n],a!==void 0&&(e.push(r.time),t.push(a)),r=s[i++];while(r!==void 0)}class fs{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],r=t[n-1];n:{e:{let a;t:{i:if(!(e<i)){for(let o=n+2;;){if(i===void 0){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(r=i,i=t[++n],e<i)break e}a=t.length;break t}if(!(e>=r)){const o=t[1];e<o&&(n=2,r=o);for(let c=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===c)break;if(i=r,r=t[--n-1],e>=r)break e}a=n,n=0;break t}break n}for(;n<a;){const o=n+a>>>1;e<t[o]?a=o:n=o+1}if(i=t[n],r=t[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i;for(let a=0;a!==i;++a)t[a]=n[r+a];return t}interpolate_(){throw new Error("THREE.Interpolant: Call to abstract method.")}intervalChanged_(){}}class Gp extends fs{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:gl,endingEnd:gl}}intervalChanged_(e,t,n){const i=this.parameterPositions;let r=e-2,a=e+1,o=i[r],c=i[a];if(o===void 0)switch(this.getSettings_().endingStart){case bl:r=e,o=2*t-n;break;case xl:r=i.length-2,o=t+i[r]-i[r+1];break;default:r=e,o=n}if(c===void 0)switch(this.getSettings_().endingEnd){case bl:a=e,c=2*n-t;break;case xl:a=1,c=n+i[1]-i[0];break;default:a=e-1,c=t}const l=(n-t)*.5,h=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(c-n),this._offsetPrev=r*h,this._offsetNext=a*h}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=e*o,l=c-o,h=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,g=(n-t)/(i-t),b=g*g,m=b*g,p=-d*m+2*d*b-d*g,_=(1+d)*m+(-1.5-2*d)*b+(-.5+d)*g+1,y=(-1-f)*m+(1.5+f)*b+.5*g,v=f*m-f*b;for(let T=0;T!==o;++T)r[T]=p*a[h+T]+_*a[l+T]+y*a[c+T]+v*a[u+T];return r}}class Vp extends fs{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=e*o,l=c-o,h=(n-t)/(i-t),u=1-h;for(let d=0;d!==o;++d)r[d]=a[l+d]*u+a[c+d]*h;return r}}class Hp extends fs{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Wp extends fs{interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=e*o,l=c-o,h=this.inTangents,u=this.outTangents;if(!h||!u){const g=(n-t)/(i-t),b=1-g;
9for(let m=0;m!==o;++m)r[m]=a[l+m]*b+a[c+m]*g;return r}const d=o*2,f=e-1;for(let g=0;g!==o;++g){const b=a[l+g],m=a[c+g],p=f*d+g*2,_=u[p],y=u[p+1],v=e*d+g*2,T=h[v],E=h[v+1];let C=(n-t)/(i-t),x,S,A,R,D;for(let F=0;F<8;F++){x=C*C,S=x*C,A=1-C,R=A*A,D=R*A;const I=D*t+3*R*C*_+3*A*x*T+S*i-n;if(Math.abs(I)<1e-10)break;const B=3*R*(_-t)+6*A*C*(T-_)+3*x*(i-T);if(Math.abs(B)<1e-10)break;C=C-I/B,C=Math.max(0,Math.min(1,C))}r[g]=D*b+3*R*C*y+3*A*x*E+S*m}return r}}class Pn{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Lr(t,this.TimeBufferType),this.values=Lr(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Lr(e.times,Array),values:Lr(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new Hp(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Vp(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Gp(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodBezier(e){const t=new Wp(this.times,this.values,this.getValueSize(),e);return this.settings&&(t.inTangents=this.settings.inTangents,t.outTangents=this.settings.outTangents),t}setInterpolation(e){let t;switch(e){case Hs:t=this.InterpolantFactoryMethodDiscrete;break;case Ws:t=this.InterpolantFactoryMethodLinear;break;case Sa:t=this.InterpolantFactoryMethodSmooth;break;case ml:t=this.InterpolantFactoryMethodBezier;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return Ce("KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Hs;case this.InterpolantFactoryMethodLinear:return Ws;case this.InterpolantFactoryMethodSmooth:return Sa;case this.InterpolantFactoryMethodBezier:return ml}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let r=0,a=i-1;for(;r!==i&&n[r]<e;)++r;for(;a!==-1&&n[a]>t;)--a;if(++a,r!==0||a!==i){r>=a&&(a=Math.max(a,1),r=a-1);const o=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*o,a*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(We("KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,r=n.length;r===0&&(We("KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==r;o++){const c=n[o];if(typeof c=="number"&&isNaN(c)){We("KeyframeTrack: Time is not a valid number.",this,o,c),e=!1;break}if(a!==null&&a>c){We("KeyframeTrack: Out of order keys.",this,o,c,a),e=!1;break}a=c}if(i!==void 0&&$d(i))for(let o=0,c=i.length;o!==c;++o){const l=i[o];if(isNaN(l)){We("KeyframeTrack: Value is not a valid number.",this,o,l),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===Sa,r=e.length-1;let a=1;for(let o=1;o<r;++o){let c=!1;const l=e[o],h=e[o+1];if(l!==h&&(o!==1||l!==e[0]))if(i)c=!0;else{const u=o*n,d=u-n,f=u+n;for(let g=0;g!==n;++g){const b=t[u+g];if(b!==t[d+g]||b!==t[f+g]){c=!0;break}}}if(c){if(o!==a){e[a]=e[o];const u=o*n,d=a*n;for(let f=0;f!==n;++f)t[d+f]=t[u+f]}++a}}if(r>0){e[a]=e[r];for(let o=r*n,c=a*n,l=0;l!==n;++l)t[c+l]=t[o+l];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Pn.prototype.ValueTypeName="";Pn.prototype.TimeBufferType=Float32Array;Pn.prototype.ValueBufferType=Float32Array;Pn.prototype.DefaultInterpolation=Ws;class ps extends Pn{constructor(e,t,n){super(e,t,n)}}ps.prototype.ValueTypeName="bool";ps.prototype.ValueBufferType=Array;ps.prototype.DefaultInterpolation=Hs;ps.prototype.InterpolantFactoryMethodLinear=void 0;ps.prototype.InterpolantFactoryMethodSmooth=void 0;class Pu extends Pn{constructor(e,t,n,i){super(e,t,n,i)}}Pu.prototype.ValueTypeName="color";class Qs extends Pn{constructor(e,t,n,i){super(e,t,n,i)}}Qs.prototype.ValueTypeName="number";class Xp extends fs{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=(n-t)/(i-t);let l=e*o;for(let h=l+o;l!==h;l+=4)dn.slerpFlat(r,0,a,l-o,a,l,c);return r}}class $s extends Pn{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new Xp(this.times,this.values,this.getValueSize(),e)}}$s.prototype.ValueTypeName="quaternion";$s.prototype.InterpolantFactoryMethodSmooth=void 0;class ms extends Pn{constructor(e,t,n){super(e,t,n)}}ms.prototype.ValueTypeName="string";ms.prototype.ValueBufferType=Array;ms.prototype.DefaultInterpolation=Hs;ms.prototype.InterpolantFactoryMethodLinear=void 0;ms.prototype.InterpolantFactoryMethodSmooth=void 0;class oa extends Pn{constructor(e,t,n,i){super(e,t,n,i)}}oa.prototype.ValueTypeName="vector";class qp{constructor(e="",t=-1,n=[],i=Vd){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=vn(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let a=0,o=n.length;a!==o;++a)t.push(Kp(n[a]).scale(i));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r.userData=JSON.parse(e.userData||"{}"),r}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let r=0,a=n.length;r!==a;++r)t.push(Pn.toJSON(n[r]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const r=t.length,a=[];for(let o=0;o<r;o++){let c=[],l=[];c.push((o+r-1)%r,o,(o+1)%r),l.push(0,1,0);const h=kp(c);c=rh(c,1,h),l=rh(l,1,h),!i&&c[0]===0&&(c.push(r),l.push(l[0])),a.push(new Qs(".morphTargetInfluences["+t[o].name+"]",c,l).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},r=/^([\w-]*?)([\d]+)$/;for(let o=0,c=e.length;o<c;o++){const l=e[o],h=l.name.match(r);if(h&&h.length>1){const u=h[1];let d=i[u];d||(i[u]=d=[]),d.push(l)}}const a=[];for(const o in i)a.push(this.CreateFromMorphTargetSequence(o,i[o],t,n));return a}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const r=this.tracks[n];
9t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let n=0;n<this.tracks.length;n++)e.push(this.tracks[n].clone());const t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}}function jp(s){switch(s.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Qs;case"vector":case"vector2":case"vector3":case"vector4":return oa;case"color":return Pu;case"quaternion":return $s;case"bool":case"boolean":return ps;case"string":return ms}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+s)}function Kp(s){if(s.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=jp(s.type);if(s.times===void 0){const t=[],n=[];zp(s.keys,t,n,"value"),s.times=t,s.values=n}return e.parse!==void 0?e.parse(s):new e(s.name,s.times,s.values,s.interpolation)}const Qn={enabled:!1,files:{},add:function(s,e){this.enabled!==!1&&(ah(s)||(this.files[s]=e))},get:function(s){if(this.enabled!==!1&&!ah(s))return this.files[s]},remove:function(s){delete this.files[s]},clear:function(){this.files={}}};function ah(s){try{const e=s.slice(s.indexOf(":")+1);return new URL(e).protocol==="blob:"}catch{return!1}}class Du{constructor(e,t,n){const i=this;let r=!1,a=0,o=0,c;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(h){o++,r===!1&&i.onStart!==void 0&&i.onStart(h,a,o),r=!0},this.itemEnd=function(h){a++,i.onProgress!==void 0&&i.onProgress(h,a,o),a===o&&(r=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return h=h.normalize("NFC"),c?c(h):h},this.setURLModifier=function(h){return c=h,this},this.addHandler=function(h,u){return l.push(h,u),this},this.removeHandler=function(h){const u=l.indexOf(h);return u!==-1&&l.splice(u,2),this},this.getHandler=function(h){for(let u=0,d=l.length;u<d;u+=2){const f=l[u],g=l[u+1];if(f.global&&(f.lastIndex=0),f.test(h))return g}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const Yp=new Du;class Ni{constructor(e){this.manager=e!==void 0?e:Yp,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,r){n.load(e,i,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}}Ni.DEFAULT_MATERIAL_NAME="__DEFAULT";const Yn={};class Jp extends Error{constructor(e,t){super(e),this.response=t}}class Gc extends Ni{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=Qn.get(`file:${e}`);if(r!==void 0){this.manager.itemStart(e),setTimeout(()=>{t&&t(r),this.manager.itemEnd(e)},0);return}if(Yn[e]!==void 0){Yn[e].push({onLoad:t,onProgress:n,onError:i});return}Yn[e]=[],Yn[e].push({onLoad:t,onProgress:n,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,c=this.responseType;fetch(a).then(l=>{if(l.status===200||l.status===0){if(l.status===0&&Ce("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||l.body===void 0||l.body.getReader===void 0)return l;const h=Yn[e],u=l.body.getReader(),d=l.headers.get("X-File-Size")||l.headers.get("Content-Length"),f=d?parseInt(d):0,g=f!==0;let b=0;const m=new ReadableStream({start(p){_();function _(){u.read().then(({done:y,value:v})=>
vendor: 16,572 bytes, line 9
9{if(y)p.close();else{b+=v.byteLength;const T=new ProgressEvent("progress",{lengthComputable:g,loaded:b,total:f});for(let E=0,C=h.length;E<C;E++){const x=h[E];x.onProgress&&x.onProgress(T)}p.enqueue(v),_()}},y=>{p.error(y)})}}});return new Response(m)}else throw new Jp(`fetch for "${l.url}" responded with ${l.status}: ${l.statusText}`,l)}).then(l=>{switch(c){case"arraybuffer":return l.arrayBuffer();case"blob":return l.blob();case"document":return l.text().then(h=>new DOMParser().parseFromString(h,o));case"json":return l.json();default:if(o==="")return l.text();{const u=/charset="?([^;"\s]*)"?/i.exec(o),d=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(d);return l.arrayBuffer().then(g=>f.decode(g))}}}).then(l=>{Qn.add(`file:${e}`,l);const h=Yn[e];delete Yn[e];for(let u=0,d=h.length;u<d;u++){const f=h[u];f.onLoad&&f.onLoad(l)}}).catch(l=>{const h=Yn[e];if(h===void 0)throw this.manager.itemError(e),l;delete Yn[e];for(let u=0,d=h.length;u<d;u++){const f=h[u];f.onError&&f.onError(l)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}const Ki=new WeakMap;class Zp extends Ni{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=Qn.get(`image:${e}`);if(a!==void 0){if(a.complete===!0)r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0);else{let u=Ki.get(a);u===void 0&&(u=[],Ki.set(a,u)),u.push({onLoad:t,onError:i})}return a}const o=qs("img");function c(){h(),t&&t(this);const u=Ki.get(this)||[];for(let d=0;d<u.length;d++){const f=u[d];f.onLoad&&f.onLoad(this)}Ki.delete(this),r.manager.itemEnd(e)}function l(u){h(),i&&i(u),Qn.remove(`image:${e}`);const d=Ki.get(this)||[];for(let f=0;f<d.length;f++){const g=d[f];g.onError&&g.onError(u)}Ki.delete(this),r.manager.itemError(e),r.manager.itemEnd(e)}function h(){o.removeEventListener("load",c,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",c,!1),o.addEventListener("error",l,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),Qn.add(`image:${e}`,o),r.manager.itemStart(e),o.src=e,o}}class Qp extends Ni{constructor(e){super(e)}load(e,t,n,i){const r=this,a=new bi,o=new Gc(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(e,function(c){let l;try{l=r.parse(c)}catch(h){i!==void 0?i(h):We(h);return}r._applyTexData(a,l),t&&t(a,l)},n,i),a}createDataTexture(e){const t=new bi;return this._applyTexData(t,this.parse(e)),t}_applyTexData(e,t){t.image!==void 0?e.image=t.image:t.data!==void 0&&(e.image.width=t.width,e.image.height=t.height,e.image.data=t.data),e.wrapS=t.wrapS!==void 0?t.wrapS:xn,e.wrapT=t.wrapT!==void 0?t.wrapT:xn,e.magFilter=t.magFilter!==void 0?t.magFilter:Mt,e.minFilter=t.minFilter!==void 0?t.minFilter:Mt,e.anisotropy=t.anisotropy!==void 0?t.anisotropy:1,t.colorSpace!==void 0&&(e.colorSpace=t.colorSpace),t.flipY!==void 0&&(e.flipY=t.flipY),t.format!==void 0&&(e.format=t.format),t.type!==void 0&&(e.type=t.type),t.mipmaps!==void 0&&(e.mipmaps=t.mipmaps,e.minFilter=An),t.mipmapCount===1&&(e.minFilter=Mt),t.generateMipmaps!==void 0&&(e.generateMipmaps=t.generateMipmaps),e.needsUpdate=!0}}class Lu extends Ni{constructor(e){super(e)}load(e,t,n,i){const r=new Nt,a=new Zp(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){r.image=o,r.needsUpdate=!0,t!==void 0&&t(r)},n,i),r}}class ma extends yt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new ze(e),this.intensity=t}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}}class $p extends ma{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(yt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ze(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}toJSON(e){const t=super.toJSON(e);return t.object.groundColor=this.groundColor.getHex(),t}}const Qa=new Ye,oh=new L,ch=new L;class Vc{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new te(512,512),this.mapType=Jt,this.map=null,this.mapPass=null,this.matrix=new Ye,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Fc,this._frameExtents=new te(1,1),this._viewportCount=1,this._viewports=[new dt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;oh.setFromMatrixPosition(e.matrixWorld),t.position.copy(oh),ch.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(ch),t.updateMatrixWorld(),Qa.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Qa,t.coordinateSystem,t.reversedDepth),t.coordinateSystem===Xs||t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Qa)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this.biasNode=e.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}const Nr=new L,Ir=new dn,In=new L;class Nu extends yt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ye,this.projectionMatrix=new Ye,this.projectionMatrixInverse=new Ye,this.coordinateSystem=kn,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(Nr,Ir,In),In.x===1&&In.y===1&&In.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Nr,Ir,In.set(1,1,1)).invert()}updateWorldMatrix(e,t,n=!1){super.updateWorldMatrix(e,t,n),this.matrixWorld.decompose(Nr,Ir,In),In.x===1&&In.y===1&&In.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Nr,Ir,In.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const ui=new L,lh=new te,hh=new te;class $t extends Nu{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=cs*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Os*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return cs*2*Math.atan(Math.tan(Os*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){ui.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ui.x,ui.y).multiplyScalar(-e/ui.z),ui.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(ui.x,ui.y).multiplyScalar(-e/ui.z)}getViewSize(e,t){return this.getViewBounds(e,lh,hh),t.subVectors(hh,lh)}setViewOffset(e,t,n,i,r,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Os*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const c=a.fullWidth,l=a.fullHeight;r+=a.offsetX*i/c,t-=a.offsetY*n/l,i*=a.width/c,n*=a.height/l}const o=this.filmOffset;o!==0&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class em extends Vc{constructor(){super(new $t(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,n=cs*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,r=e.distance||t.far;(n!==t.fov||i!==t.aspect||r!==t.far)&&(t.fov=n,t.aspect=i,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class tm extends ma{constructor(e,t,n=0,i=Math.PI/3,r=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(yt.DEFAULT_UP),this.updateMatrix(),this.target=new yt,this.distance=n,this.angle=i,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new em}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}}class nm extends Vc{constructor(){super(new $t(90,1,.5,500)),this.isPointLightShadow=!0}}class im extends ma{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new nm}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}}class ir extends Nu{constructor(e=-1,t=1,n=1,i=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,r,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-e,a=n+e,o=i+t,c=i-t;if(this.view!==null&&this.view.enabled){const l=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=l*this.view.offsetX,a=r+l*this.view.width,o-=h*this.view.offsetY,c=o-h*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,c,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class sm extends Vc{constructor(){super(new ir(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Iu extends ma{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(yt.DEFAULT_UP),this.updateMatrix(),this.target=new yt,this.shadow=new sm}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}}class Gs{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}const $a=new WeakMap;class rm extends Ni{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&Ce("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&Ce("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=Qn.get(`image-bitmap:${e}`);if(a!==void 0){if(r.manager.itemStart(e),a.then){a.then(l=>{$a.has(a)===!0?(i&&i($a.get(a)),r.manager.itemError(e),r.manager.itemEnd(e)):(t&&t(l),r.manager.itemEnd(e))});return}setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0);return}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader,o.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const c=fetch(e,o).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){Qn.add(`image-bitmap:${e}`,l),t&&t(l),r.manager.itemEnd(e)}).catch(function(l){i&&i(l),$a.set(c,l),Qn.remove(`image-bitmap:${e}`),r.manager.itemError(e),r.manager.itemEnd(e)});Qn.add(`image-bitmap:${e}`,c),r.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}const Yi=-90,Ji=1;class Fu extends yt{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new $t(Yi,Ji,e,t);i.layers=this.layers,this.add(i);const r=new $t(Yi,Ji,e,t);r.layers=this.layers,this.add(r);const a=new $t(Yi,Ji,e,t);a.layers=this.layers,this.add(a);const o=new $t(Yi,Ji,e,t);o.layers=this.layers,this.add(o);const c=new $t(Yi,Ji,e,t);c.layers=this.layers,this.add(c);const l=new $t(Yi,Ji,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,r,a,o,c]=t;for(const l of t)this.remove(l);
9if(e===kn)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(e===Xs)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const l of t)this.add(l),l.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,c,l,h]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),g=e.xr.enabled;e.xr.enabled=!1;const b=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let m=!1;e.isWebGLRenderer===!0?m=e.state.buffers.depth.getReversed():m=e.reversedDepthBuffer,e.setRenderTarget(n,0,i),m&&e.autoClear===!1&&e.clearDepth(),e.render(t,r),e.setRenderTarget(n,1,i),m&&e.autoClear===!1&&e.clearDepth(),e.render(t,a),e.setRenderTarget(n,2,i),m&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(n,3,i),m&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),e.setRenderTarget(n,4,i),m&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),n.texture.generateMipmaps=b,e.setRenderTarget(n,5,i),m&&e.autoClear===!1&&e.clearDepth(),e.render(t,h),e.setRenderTarget(u,d,f),e.xr.enabled=g,n.texture.needsPMREMUpdate=!0}}class am extends $t{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class om{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=cm.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e!==void 0?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function cm(){this._document.hidden===!1&&this.reset()}const Hc="\\[\\]\\.:\\/",lm=new RegExp("["+Hc+"]","g"),Wc="[^"+Hc+"]",hm="[^"+Hc.replace("\\.","")+"]",um=/((?:WC+[\/:])*)/.source.replace("WC",Wc),dm=/(WCOD+)?/.source.replace("WCOD",hm),fm=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Wc),pm=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Wc),mm=new RegExp("^"+um+dm+fm+pm+"$"),gm=["material","materials","bones","map"];class bm{constructor(e,t,n){const i=n||ht.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class ht{constructor(e,t,n){this.path=t,this.parsedPath=n||ht.parseTrackName(t),this.node=ht.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new ht.Composite(e,t,n):new ht(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lm,"")}static parseTrackName(e){const t=mm.exec(e);if(t===null)throw new Error("THREE.PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const r=n.nodeName.substring(i+1);gm.indexOf(r)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("THREE.PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(r){for(let a=0;a<r.length;a++){const o=r[a];if(o.name===t||o.uuid===t)return o;const c=n(o.children);if(c)return c}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}
vendor: 4,165 bytes, line 9
9_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let r=t.propertyIndex;if(e||(e=ht.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){Ce("PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let l=t.objectIndex;switch(n){case"materials":if(!e.material){We("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){We("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){We("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let h=0;h<e.length;h++)if(e[h].name===l){l=h;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){We("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){We("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){We("PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(l!==void 0){if(e[l]===void 0){We("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[l]}}const a=e[i];if(a===void 0){const l=t.nodeName;We("PropertyBinding: Trying to update property for track: "+l+"."+i+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?o=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(r!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){We("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){We("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[r]!==void 0&&(r=e.morphTargetDictionary[r])}c=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else a.fromArray!==void 0&&a.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(c=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}ht.Composite=bm;ht.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};ht.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};ht.prototype.GetterByBindingType=[ht.prototype._getValue_direct,ht.prototype._getValue_array,ht.prototype._getValue_arrayElement,ht.prototype._getValue_toArray];ht.prototype.SetterByBindingTypeAndVersioning=[[ht.prototype._setValue_direct,ht.prototype._setValue_direct_setNeedsUpdate,ht.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[ht.prototype._setValue_array,ht.prototype._setValue_array_setNeedsUpdate,ht.prototype._setValue_array_setMatr
9ixWorldNeedsUpdate],[ht.prototype._setValue_arrayElement,ht.prototype._setValue_arrayElement_setNeedsUpdate,ht.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[ht.prototype._setValue_fromArray,ht.prototype._setValue_fromArray_setNeedsUpdate,ht.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class uh{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Qe(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Qe(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const Qc=class Qc{constructor(e,t,n,i){this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,i)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,i){const r=this.elements;return r[0]=e,r[2]=t,r[1]=n,r[3]=i,this}};Qc.prototype.isMatrix2=!0;let dh=Qc;class xm extends xi{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){Ce("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function fh(s,e,t,n){const i=vm(n);switch(t){case ou:return s*e;case Ec:return s*e/i.components*i.byteLength;case wc:return s*e/i.components*i.byteLength;case Pi:return s*e*2/i.components*i.byteLength;case Ac:return s*e*2/i.components*i.byteLength;case cu:return s*e*3/i.components*i.byteLength;case un:return s*e*4/i.components*i.byteLength;case Rc:return s*e*4/i.components*i.byteLength;case jr:case Kr:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case Yr:case Jr:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case Ro:case Po:return Math.max(s,16)*Math.max(e,8)/4;case Ao:case Co:return Math.max(s,8)*Math.max(e,8)/2;case Do:case Lo:case Io:case Fo:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case No:case $r:case Uo:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case Oo:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case Bo:return Math.floor((s+4)/5)*Math.floor((e+3)/4)*16;case ko:return Math.floor((s+4)/5)*Math.floor((e+4)/5)*16;case zo:return Math.floor((s+5)/6)*Math.floor((e+4)/5)*16;case Go:return Math.floor((s+5)/6)*Math.floor((e+5)/6)*16;case Vo:return Math.floor((s+7)/8)*Math.floor((e+4)/5)*16;case Ho:return Math.floor((s+7)/8)*Math.floor((e+5)/6)*16;case Wo:return Math.floor((s+7)/8)*Math.floor((e+7)/8)*16;case Xo:return Math.floor((s+9)/10)*Math.floor((e+4)/5)*16;case qo:return Math.floor((s+9)/10)*Math.floor((e+5)/6)*16;case jo:return Math.floor((s+9)/10)*Math.floor((e+7)/8)*16;case Ko:return Math.floor((s+9)/10)*Math.floor((e+9)/10)*16;case Yo:return Math.floor((s+11)/12)*Math.floor((e+9)/10)*16;case Jo:return Math.floor((s+11)/12)*Math.floor((e+11)/12)*16;case Zo:case Qo:case $o:return Math.ceil(s/4)*Math.ceil(e/4)*16;case ec:case tc:return Math.ceil(s/4)*Math.ceil(e/4)*8;case ea:case nc:return Math.ceil(s/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function vm(s){switch(s){case Jt:case iu:return{byteLength:1,components:1};case Vs:case su:case Ct:return{byteLength:2,components:1};case Sc:case Tc:return{byteLength:2,components:4};case Vn:case yc:case rn:return{byteLength:4,components:1};case ru:case au:return{byteLength:4,components:3}}throw new Error(`THREE.TextureUtils: Unknown texture type ${s}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:mc}}));typeof window<"u"&&(window.__THREE__?Ce("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=mc);/**
10 * @license
11 * Copyright 2010-2026 Three.js Authors
12 * SPDX-License-Identifier: MIT
13 */function Uu(){let s=null,e=!1,t=null,n=null;function i(r,a){t(r,a),n=s.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&s!==null&&(n=s.requestAnimationFrame(i),e=!0)},stop:function(){s!==null&&s.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){s=r}}}function _m(s){const e=new WeakMap;function t(o,c){const l=o.array,h=o.usage,u=l.byteLength,d=s.createBuffer();s.bindBuffer(c,d),s.bufferData(c,l,h),o.onUploadCallback();let f;if(l instanceof Float32Array)f=s.FLOAT;else if(typeof Float16Array<"u"&&l instanceof Float16Array)f=s.HALF_FLOAT;else if(l instanceof Uint16Array)o.isFloat16BufferAttribute?f=s.HALF_FLOAT:f=s.UNSIGNED_SHORT;else if(l instanceof Int16Array)f=s.SHORT;else if(l instanceof Uint32Array)f=s.UNSIGNED_INT;else if(l instanceof Int32Array)f=s.INT;else if(l instanceof Int8Array)f=s.BYTE;else if(l instanceof Uint8Array)f=s.UNSIGNED_BYTE;else if(l instanceof Uint8ClampedArray)f=s.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+l);return{buffer:d,type:f,bytesPerElement:l.BYTES_PER_ELEMENT,version:o.version,size:u}}function n(o,c,l){const h=c.array,u=c.updateRanges;if(s.bindBuffer(l,o),u.length===0)s.bufferSubData(l,0,h);else{u.sort((f,g)=>f.start-g.start);let d=0;for(let f=1;f<u.length;f++){const g=u[d],b=u[f];b.start<=g.start+g.count+1?g.count=Math.max(g.count,b.start+b.count-g.start):(++d,u[d]=b)}u.length=d+1;for(let f=0,g=u.length;f<g;f++){const b=u[f];s.bufferSubData(l,b.start*h.BYTES_PER_ELEMENT,h,b.start,b.count)}c.clearUpdateRanges()}c.onUploadCallback()}function i(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function r(o){o.isInterleavedBufferAttribute&&(o=o.data);const c=e.get(o);c&&(s.deleteBuffer(c.buffer),e.delete(o))}function a(o,c){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const h=e.get(o);(!h||h.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const l=e.get(o);if(l===void 0)e.set(o,t(o,c));else if(l.version<o.version){if(l.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(l.buffer,o,c),l.version=o.version}}return{get:i,remove:r,update:a}}var Mm=`#ifdef USE_ALPHAHASH
14	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
15#endif`,ym=`#ifdef USE_ALPHAHASH
16	const float ALPHA_HASH_SCALE = 0.05;
17	float hash2D( vec2 value ) {
18		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
19	}
20	float hash3D( vec3 value ) {
21		return hash2D( vec2( hash2D( value.xy ), value.z ) );
22	}
23	float getAlphaHashThreshold( vec3 position ) {
24		float maxDeriv = max(
25			length( dFdx( position.xyz ) ),
26			length( dFdy( position.xyz ) )
27		);
28		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
29		vec2 pixScales = vec2(
30			exp2( floor( log2( pixScale ) ) ),
31			exp2( ceil( log2( pixScale ) ) )
32		);
33		vec2 alpha = vec2(
34			hash3D( floor( pixScales.x * position.xyz ) ),
35			hash3D( floor( pixScales.y * position.xyz ) )
36		);
37		float lerpFactor = fract( log2( pixScale ) );
38		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
39		float a = min( lerpFactor, 1.0 - lerpFactor );
40		vec3 cases = vec3(
41			x * x / ( 2.0 * a * ( 1.0 - a ) ),
42			( x - 0.5 * a ) / ( 1.0 - a ),
43			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
44		);
45		float threshold = ( x < ( 1.0 - a ) )
46			? ( ( x < a ) ? cases.x : cases.y )
47			: cases.z;
48		return clamp( threshold , 1.0e-6, 1.0 );
49	}
50#endif`,Sm=`#ifdef USE_ALPHAMAP
51	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
52#endif`,Tm=`#ifdef USE_ALPHAMAP
53	uniform sampler2D alphaMap;
54#endif`,Em=`#ifdef USE_ALPHATEST
55	#ifdef ALPHA_TO_COVERAGE
56	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
57	if ( diffuseColor.a == 0.0 ) discard;
58	#else
59	if ( diffuseColor.a < alphaTest ) discard;
60	#endif
61#endif`,wm=`#ifdef USE_ALPHATEST
62	uniform float alphaTest;
63#endif`,Am=`#ifdef USE_AOMAP
64	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
65	reflectedLight.indirectDiffuse *= ambientOcclusion;
66	#if defined( USE_CLEARCOAT ) 
67		clearcoatSpecularIndirect *= ambientOcclusion;
68	#endif
69	#if defined( USE_SHEEN ) 
70		sheenSpecularIndirect *= ambientOcclusion;
71	#endif
72	#if defined( USE_ENVMAP ) && defined( STANDARD )
73		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
74		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
75	#endif
76#endif`,Rm=`#ifdef USE_AOMAP
77	uniform sampler2D aoMap;
78	uniform float aoMapIntensity;
79#endif`,Cm=`#ifdef USE_BATCHING
80	#if ! defined( GL_ANGLE_multi_draw )
81	#define gl_DrawID _gl_DrawID
82	uniform int _gl_DrawID;
83	#endif
84	uniform highp sampler2D batchingTexture;
85	uniform highp usampler2D batchingIdTexture;
86	mat4 getBatchingMatrix( const in float i ) {
87		int size = textureSize( batchingTexture, 0 ).x;
88		int j = int( i ) * 4;
89		int x = j % size;
90		int y = j / size;
91		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
92		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
93		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
94		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
95		return mat4( v1, v2, v3, v4 );
96	}
97	float getIndirectIndex( const in int i ) {
98		int size = textureSize( batchingIdTexture, 0 ).x;
99		int x = i % size;
100		int y = i / size;
101		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
102	}
103#endif
104#ifdef USE_BATCHING_COLOR
105	uniform sampler2D batchingColorTexture;
106	vec4 getBatchingColor( const in float i ) {
107		int size = textureSize( batchingColorTexture, 0 ).x;
108		int j = int( i );
109		int x = j % size;
110		int y = j / size;
111		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 );
112	}
113#endif`,Pm=`#ifdef USE_BATCHING
114	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
115#endif`,Dm=`vec3 transformed = vec3( position );
116#ifdef USE_ALPHAHASH
117	vPosition = vec3( position );
118#endif`,Lm=`vec3 objectNormal = vec3( normal );
119#ifdef USE_TANGENT
120	vec3 objectTangent = vec3( tangent.xyz );
121#endif`,Nm=`float G_BlinnPhong_Implicit( ) {
122	return 0.25;
123}
124float D_BlinnPhong( const in float shininess, const in float dotNH ) {
125	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
126}
127vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
128	vec3 halfDir = normalize( lightDir + viewDir );
129	float dotNH = saturate( dot( normal, halfDir ) );
130	float dotVH = saturate( dot( viewDir, halfDir ) );
131	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
132	float G = G_BlinnPhong_Implicit( );
133	float D = D_BlinnPhong( shininess, dotNH );
134	return F * ( G * D );
135} // validated`,Im=`#ifdef USE_IRIDESCENCE
136	const mat3 XYZ_TO_REC709 = mat3(
137		 3.2404542, -0.9692660,  0.0556434,
138		-1.5371385,  1.8760108, -0.2040259,
139		-0.4985314,  0.0415560,  1.0572252
140	);
141	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
142		vec3 sqrtF0 = sqrt( fresnel0 );
143		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
144	}
145	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
146		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
147	}
148	float IorToFresnel0( float transmittedIor, float incidentIor ) {
149		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
150	}
151	vec3 evalSensitivity( float OPD, vec3 shift ) {
152		float phase = 2.0 * PI * OPD * 1.0e-9;
153		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
154		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
155		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
156		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
157		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
158		xyz /= 1.0685e-7;
159		vec3 rgb = XYZ_TO_REC709 * xyz;
160		return rgb;
161	}
162	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
163		vec3 I;
164		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
165		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
166		float cosTheta2Sq = 1.0 - sinTheta2Sq;
167		if ( cosTheta2Sq < 0.0 ) {
168			return vec3( 1.0 );
169		}
170		float cosTheta2 = sqrt( cosTheta2Sq );
171		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
172		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
173		float T121 = 1.0 - R12;
174		float phi12 = 0.0;
175		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
176		float phi21 = PI - phi12;
177		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
178		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
179		vec3 phi23 = vec3( 0.0 );
180		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
181		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
182		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
183		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
184		vec3 phi = vec3( phi21 ) + phi23;
185		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
186		vec3 r123 = sqrt( R123 );
187		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
188		vec3 C0 = R12 + Rs;
189		I = C0;
190		vec3 Cm = Rs - T121;
191		for ( int m = 1; m <= 2; ++ m ) {
192			Cm *= r123;
193			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
194			I += Cm * Sm;
195		}
196		return max( I, vec3( 0.0 ) );
197	}
198#endif`,Fm=`#ifdef USE_BUMPMAP
199	uniform sampler2D bumpMap;
200	uniform float bumpScale;
201	vec2 dHdxy_fwd() {
202		vec2 dSTdx = dFdx( vBumpMapUv );
203		vec2 dSTdy = dFdy( vBumpMapUv );
204		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
205		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
206		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
207		return vec2( dBx, dBy );
208	}
209	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
210		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
211		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
212		vec3 vN = surf_norm;
213		vec3 R1 = cross( vSigmaY, vN );
214		vec3 R2 = cross( vN, vSigmaX );
215		float fDet = dot( vSigmaX, R1 ) * faceDirection;
216		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
217		return normalize( abs( fDet ) * surf_norm - vGrad );
218	}
219#endif`,Um=`#if NUM_CLIPPING_PLANES > 0
220	vec4 plane;
221	#ifdef ALPHA_TO_COVERAGE
222		float distanceToPlane, distanceGradient;
223		float clipOpacity = 1.0;
224		#pragma unroll_loop_start
225		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
226			plane = clippingPlanes[ i ];
227			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
228			distanceGradient = fwidth( distanceToPlane ) / 2.0;
229			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
230			if ( clipOpacity == 0.0 ) discard;
231		}
232		#pragma unroll_loop_end
233		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
234			float unionClipOpacity = 1.0;
235			#pragma unroll_loop_start
236			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
237				plane = clippingPlanes[ i ];
238				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
239				distanceGradient = fwidth( distanceToPlane ) / 2.0;
240				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
241			}
242			#pragma unroll_loop_end
243			clipOpacity *= 1.0 - unionClipOpacity;
244		#endif
245		diffuseColor.a *= clipOpacity;
246		if ( diffuseColor.a == 0.0 ) discard;
247	#else
248		#pragma unroll_loop_start
249		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
250			plane = clippingPlanes[ i ];
251			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
252		}
253		#pragma unroll_loop_end
254		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
255			bool clipped = true;
256			#pragma unroll_loop_start
257			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
258				plane = clippingPlanes[ i ];
259				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
260			}
261			#pragma unroll_loop_end
262			if ( clipped ) discard;
263		#endif
264	#endif
265#endif`,Om=`#if NUM_CLIPPING_PLANES > 0
266	varying vec3 vClipPosition;
267	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
268#endif`,Bm=`#if NUM_CLIPPING_PLANES > 0
269	varying vec3 vClipPosition;
270#endif`,km=`#if NUM_CLIPPING_PLANES > 0
271	vClipPosition = - mvPosition.xyz;
272#endif`,zm=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
273	diffuseColor *= vColor;
274#endif`,Gm=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
275	varying vec4 vColor;
276#endif`,Vm=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
277	varying vec4 vColor;
278#endif`,Hm=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
279	vColor = vec4( 1.0 );
280#endif
281#ifdef USE_COLOR_ALPHA
282	vColor *= color;
283#elif defined( USE_COLOR )
284	vColor.rgb *= color;
285#endif
286#ifdef USE_INSTANCING_COLOR
287	vColor.rgb *= instanceColor.rgb;
288#endif
289#ifdef USE_BATCHING_COLOR
290	vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );
291#endif`,Wm=`#define PI 3.141592653589793
292#define PI2 6.283185307179586
293#define PI_HALF 1.5707963267948966
294#define RECIPROCAL_PI 0.3183098861837907
295#define RECIPROCAL_PI2 0.15915494309189535
296#define EPSILON 1e-6
297#ifndef saturate
298#define saturate( a ) clamp( a, 0.0, 1.0 )
299#endif
300#define whiteComplement( a ) ( 1.0 - saturate( a ) )
301float pow2( const in float x ) { return x*x; }
302vec3 pow2( const in vec3 x ) { return x*x; }
303float pow3( const in float x ) { return x*x*x; }
304float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
305float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
306float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
307highp float rand( const in vec2 uv ) {
308	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
309	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
310	return fract( sin( sn ) * c );
311}
312#ifdef HIGH_PRECISION
313	float precisionSafeLength( vec3 v ) { return length( v ); }
314#else
315	float precisionSafeLength( vec3 v ) {
316		float maxComponent = max3( abs( v ) );
317		return length( v / maxComponent ) * maxComponent;
318	}
319#endif
320struct IncidentLight {
321	vec3 color;
322	vec3 direction;
323	bool visible;
324};
325struct ReflectedLight {
326	vec3 directDiffuse;
327	vec3 directSpecular;
328	vec3 indirectDiffuse;
329	vec3 indirectSpecular;
330};
331#ifdef USE_ALPHAHASH
332	varying vec3 vPosition;
333#endif
334vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
335	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
336}
337#define inverseTransformDirection transformDirectionByInverseViewMatrix
338vec3 transformNormalByInverseViewMatrix( in vec3 normal, in mat4 viewMatrix ) {
339	return normalize( ( vec4( normal, 0.0 ) * viewMatrix ).xyz );
340}
341vec3 transformDirectionByInverseViewMatrix( in vec3 dir, in mat4 viewMatrix ) {
342	return normalize( ( vec4( dir, 0.0 ) * viewMatrix ).xyz );
343}
344bool isPerspectiveMatrix( mat4 m ) {
345	return m[ 2 ][ 3 ] == - 1.0;
346}
347vec2 equirectUv( in vec3 dir ) {
348	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
349	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
350	return vec2( u, v );
351}
352vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
353	return RECIPROCAL_PI * diffuseColor;
354}
355vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
356	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
357	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
358}
359float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
360	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
361	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
362} // validated`,Xm=`#ifdef ENVMAP_TYPE_CUBE_UV
363	#define cubeUV_minMipLevel 4.0
364	#define cubeUV_minTileSize 16.0
365	float getFace( vec3 direction ) {
366		vec3 absDirection = abs( direction );
367		float face = - 1.0;
368		if ( absDirection.x > absDirection.z ) {
369			if ( absDirection.x > absDirection.y )
370				face = direction.x > 0.0 ? 0.0 : 3.0;
371			else
372				face = direction.y > 0.0 ? 1.0 : 4.0;
373		} else {
374			if ( absDirection.z > absDirection.y )
375				face = direction.z > 0.0 ? 2.0 : 5.0;
376			else
377				face = direction.y > 0.0 ? 1.0 : 4.0;
378		}
379		return face;
380	}
381	vec2 getUV( vec3 direction, float face ) {
382		vec2 uv;
383		if ( face == 0.0 ) {
384			uv = vec2( direction.z, direction.y ) / abs( direction.x );
385		} else if ( face == 1.0 ) {
386			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
387		} else if ( face == 2.0 ) {
388			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
389		} else if ( face == 3.0 ) {
390			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
391		} else if ( face == 4.0 ) {
392			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
393		} else {
394			uv = vec2( direction.x, direction.y ) / abs( direction.z );
395		}
396		return 0.5 * ( uv + 1.0 );
397	}
398	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
399		float face = getFace( direction );
400		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
401		mipInt = max( mipInt, cubeUV_minMipLevel );
402		float faceSize = exp2( mipInt );
403		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
404		if ( face > 2.0 ) {
405			uv.y += faceSize;
406			face -= 3.0;
407		}
408		uv.x += face * faceSize;
409		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
410		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
411		uv.x *= CUBEUV_TEXEL_WIDTH;
412		uv.y *= CUBEUV_TEXEL_HEIGHT;
413		#ifdef texture2DGradEXT
414			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
415		#else
416			return texture2D( envMap, uv ).rgb;
417		#endif
418	}
419	#define cubeUV_r0 1.0
420	#define cubeUV_m0 - 2.0
421	#define cubeUV_r1 0.8
422	#define cubeUV_m1 - 1.0
423	#define cubeUV_r4 0.4
424	#define cubeUV_m4 2.0
425	#define cubeUV_r5 0.305
426	#define cubeUV_m5 3.0
427	#define cubeUV_r6 0.21
428	#define cubeUV_m6 4.0
429	float roughnessToMip( float roughness ) {
430		float mip = 0.0;
431		if ( roughness >= cubeUV_r1 ) {
432			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
433		} else if ( roughness >= cubeUV_r4 ) {
434			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
435		} else if ( roughness >= cubeUV_r5 ) {
436			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
437		} else if ( roughness >= cubeUV_r6 ) {
438			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
439		} else {
440			mip = - 2.0 * log2( 1.16 * roughness );		}
441		return mip;
442	}
443	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
444		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
445		float mipF = fract( mip );
446		float mipInt = floor( mip );
447		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
448		if ( mipF == 0.0 ) {
449			return vec4( color0, 1.0 );
450		} else {
451			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
452			return vec4( mix( color0, color1, mipF ), 1.0 );
453		}
454	}
455#endif`,qm=`vec3 transformedNormal = objectNormal;
456#ifdef USE_TANGENT
457	vec3 transformedTangent = objectTangent;
458#endif
459#ifdef USE_BATCHING
460	mat3 bm = mat3( batchingMatrix );
461	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
462	transformedNormal = bm * transformedNormal;
463	#ifdef USE_TANGENT
464		transformedTangent = bm * transformedTangent;
465	#endif
466#endif
467#ifdef USE_INSTANCING
468	mat3 im = mat3( instanceMatrix );
469	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
470	transformedNormal = im * transformedNormal;
471	#ifdef USE_TANGENT
472		transformedTangent = im * transformedTangent;
473	#endif
474#endif
475transformedNormal = normalMatrix * transformedNormal;
476#ifdef FLIP_SIDED
477	transformedNormal = - transformedNormal;
478#endif
479#ifdef USE_TANGENT
480	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
481#endif`,jm=`#ifdef USE_DISPLACEMENTMAP
482	uniform sampler2D displacementMap;
483	uniform float displacementScale;
484	uniform float displacementBias;
485#endif`,Km=`#ifdef USE_DISPLACEMENTMAP
486	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
486placementBias );
487#endif`,Ym=`#ifdef USE_EMISSIVEMAP
488	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
489	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
490		emissiveColor = sRGBTransferEOTF( emissiveColor );
491	#endif
492	totalEmissiveRadiance *= emissiveColor.rgb;
493#endif`,Jm=`#ifdef USE_EMISSIVEMAP
494	uniform sampler2D emissiveMap;
495#endif`,Zm="gl_FragColor = linearToOutputTexel( gl_FragColor );",Qm=`vec4 LinearTransferOETF( in vec4 value ) {
496	return value;
497}
498vec4 sRGBTransferEOTF( in vec4 value ) {
499	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
500}
501vec4 sRGBTransferOETF( in vec4 value ) {
502	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
503}`,$m=`#ifdef USE_ENVMAP
504	#ifdef ENV_WORLDPOS
505		vec3 cameraToFrag;
506		if ( isOrthographic ) {
507			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
508		} else {
509			cameraToFrag = normalize( vWorldPosition - cameraPosition );
510		}
511		vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );
512		#ifdef ENVMAP_MODE_REFLECTION
513			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
514		#else
515			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
516		#endif
517	#else
518		vec3 reflectVec = vReflect;
519	#endif
520	#ifdef ENVMAP_TYPE_CUBE
521		vec4 envColor = textureCube( envMap, envMapRotation * reflectVec );
522		#ifdef ENVMAP_BLENDING_MULTIPLY
523			outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
524		#elif defined( ENVMAP_BLENDING_MIX )
525			outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
526		#elif defined( ENVMAP_BLENDING_ADD )
527			outgoingLight += envColor.xyz * specularStrength * reflectivity;
528		#endif
529	#endif
530#endif`,eg=`#ifdef USE_ENVMAP
531	uniform float envMapIntensity;
532	uniform mat3 envMapRotation;
533	#ifdef ENVMAP_TYPE_CUBE
534		uniform samplerCube envMap;
535	#else
536		uniform sampler2D envMap;
537	#endif
538#endif`,tg=`#ifdef USE_ENVMAP
539	uniform float reflectivity;
540	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
541		#define ENV_WORLDPOS
542	#endif
543	#ifdef ENV_WORLDPOS
544		varying vec3 vWorldPosition;
545		uniform float refractionRatio;
546	#else
547		varying vec3 vReflect;
548	#endif
549#endif`,ng=`#ifdef USE_ENVMAP
550	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
551		#define ENV_WORLDPOS
552	#endif
553	#ifdef ENV_WORLDPOS
554		
555		varying vec3 vWorldPosition;
556	#else
557		varying vec3 vReflect;
558		uniform float refractionRatio;
559	#endif
560#endif`,ig=`#ifdef USE_ENVMAP
561	#ifdef ENV_WORLDPOS
562		vWorldPosition = worldPosition.xyz;
563	#else
564		vec3 cameraToVertex;
565		if ( isOrthographic ) {
566			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
567		} else {
568			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
569		}
570		vec3 worldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );
571		#ifdef ENVMAP_MODE_REFLECTION
572			vReflect = reflect( cameraToVertex, worldNormal );
573		#else
574			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
575		#endif
576	#endif
577#endif`,sg=`#ifdef USE_FOG
578	vFogDepth = - mvPosition.z;
579#endif`,rg=`#ifdef USE_FOG
580	varying float vFogDepth;
581#endif`,ag=`#ifdef USE_FOG
582	#ifdef FOG_EXP2
583		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
584	#else
585		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
586	#endif
587	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
588#endif`,og=`#ifdef USE_FOG
589	uniform vec3 fogColor;
590	varying float vFogDepth;
591	#ifdef FOG_EXP2
592		uniform float fogDensity;
593	#else
594		uniform float fogNear;
595		uniform float fogFar;
596	#endif
597#endif`,cg=`#ifdef USE_GRADIENTMAP
598	uniform sampler2D gradientMap;
599#endif
600vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
601	float dotNL = dot( normal, lightDirection );
602	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
603	#ifdef USE_GRADIENTMAP
604		return vec3( texture2D( gradientMap, coord ).r );
605	#else
606		vec2 fw = fwidth( coord ) * 0.5;
607		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
608	#endif
609}`,lg=`#ifdef USE_LIGHTMAP
610	uniform sampler2D lightMap;
611	uniform float lightMapIntensity;
612#endif`,hg=`LambertMaterial material;
613material.diffuseColor = diffuseColor.rgb;
614material.specularStrength = specularStrength;`,ug=`varying vec3 vViewPosition;
615struct LambertMaterial {
616	vec3 diffuseColor;
617	float specularStrength;
618};
619void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
620	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
621	vec3 irradiance = dotNL * directLight.color;
622	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
623}
624void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
625	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
626}
627#define RE_Direct				RE_Direct_Lambert
628#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,dg=`uniform bool receiveShadow;
629uniform vec3 ambientLightColor;
630#if defined( USE_LIGHT_PROBES )
631	uniform vec3 lightProbe[ 9 ];
632#endif
633vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
634	float x = normal.x, y = normal.y, z = normal.z;
635	vec3 result = shCoefficients[ 0 ] * 0.886227;
636	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
637	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
638	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
639	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
640	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
641	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
642	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
643	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
644	return result;
645}
646vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
647	vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );
648	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
649	return irradiance;
650}
651vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
652	vec3 irradiance = ambientLightColor;
653	return irradiance;
654}
655float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
656	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
657	if ( cutoffDistance > 0.0 ) {
658		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
659	}
660	return distanceFalloff;
661}
662float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
663	return smoothstep( coneCosine, penumbraCosine, angleCosine );
664}
665#if NUM_DIR_LIGHTS > 0
666	struct DirectionalLight {
667		vec3 direction;
668		vec3 color;
669	};
670	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
671	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
672		light.color = directionalLight.color;
673		light.direction = directionalLight.direction;
674		light.visible = true;
675	}
676#endif
677#if NUM_POINT_LIGHTS > 0
678	struct PointLight {
679		vec3 position;
680		vec3 color;
681		float distance;
682		float decay;
683	};
684	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
685	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
686		vec3 lVector = pointLight.position - geometryPosition;
687		light.direction = normalize( lVector );
688		float lightDistance = length( lVector );
689		light.color = pointLight.color;
690		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
691		light.visible = ( light.color != vec3( 0.0 ) );
692	}
693#endif
694#if NUM_SPOT_LIGHTS > 0
695	struct SpotLight {
696		vec3 position;
697		vec3 direction;
698		vec3 color;
699		float distance;
700		float decay;
701		float coneCos;
702		float penumbraCos;
703	};
704	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
705	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
706		vec3 lVector = spotLight.position - geometryPosition;
707		light.direction = normalize( lVector );
708		float angleCos = dot( light.direction, spotLight.direction );
709		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
710		if ( spotAttenuation > 0.0 ) {
711			float lightDistance = length( lVector );
712			light.color = spotLight.color * spotAttenuation;
713			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
714			light.visible = ( light.color != vec3( 0.0 ) );
715		} else {
716			light.color = vec3( 0.0 );
717			light.visible = false;
718		}
719	}
720#endif
721#if NUM_RECT_AREA_LIGHTS > 0
722	struct RectAreaLight {
723		vec3 color;
724		vec3 position;
725		vec3 halfWidth;
726		vec3 halfHeight;
727	};
728	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
729	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
730#endif
731#if NUM_HEMI_LIGHTS > 0
732	struct HemisphereLight {
733		vec3 direction;
734		vec3 skyColor;
735		vec3 groundColor;
736	};
737	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
738	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
739		float dotNL = dot( normal, hemiLight.direction );
740		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
741		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
742		return irradiance;
743	}
744#endif
745#include <lightprobes_pars_fragment>`,fg=`#ifdef USE_ENVMAP
746	vec3 getIBLIrradiance( const in vec3 normal ) {
747		#ifdef ENVMAP_TYPE_CUBE_UV
748			vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );
749			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
750			return PI * envMapColor.rgb * envMapIntensity;
751		#else
752			return vec3( 0.0 );
753		#endif
754	}
755	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
756		#ifdef ENVMAP_TYPE_CUBE_UV
757			vec3 reflectVec = reflect( - viewDir, normal );
758			reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );
759			reflectVec = transformDirectionByInverseViewMatrix( reflectVec, viewMatrix );
760			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
761			return envMapColor.rgb * envMapIntensity;
762		#else
763			return vec3( 0.0 );
764		#endif
765	}
766	#ifdef USE_ANISOTROPY
767		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
768			#ifdef ENVMAP_TYPE_CUBE_UV
769				vec3 bentNormal = cross( bitangent, viewDir );
770				bentNormal = normalize( cross( bentNormal, bitangent ) );
771				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
772				return getIBLRadiance( viewDir, bentNormal, roughness );
773			#else
774				return vec3( 0.0 );
775			#endif
776		}
777	#endif
778#endif`,pg=`ToonMaterial material;
779material.diffuseColor = diffuseColor.rgb;`,mg=`varying vec3 vViewPosition;
780struct ToonMaterial {
781	vec3 diffuseColor;
782};
783void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
784	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
785	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
786}
787void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
788	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
789}
790#define RE_Direct				RE_Direct_Toon
791#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,gg=`BlinnPhongMaterial material;
792material.diffuseColor = diffuseColor.rgb;
793material.specularColor = specular;
794material.specularShininess = shininess;
795material.specularStrength = specularStrength;`,bg=`varying vec3 vViewPosition;
796struct BlinnPhongMaterial {
797	vec3 diffuseColor;
798	vec3 specularColor;
799	float specularShininess;
800	float specularStrength;
801};
802void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
803	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
804	vec3 irradiance = dotNL * directLight.color;
805	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
806	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
807}
808void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
809	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
810}
811#define RE_Direct				RE_Direct_BlinnPhong
812#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,xg=`PhysicalMaterial material;
813material.diffuseColor = diffuseColor.rgb;
814material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );
815material.metalness = metalnessFactor;
816vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
817float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
818material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
819material.roughness = min( material.roughness, 1.0 );
820#ifdef IOR
821	material.ior = ior;
822	#ifdef USE_SPECULAR
823		float specularIntensityFactor = specularIntensity;
824		vec3 specularColorFactor = specularColor;
825		#ifdef USE_SPECULAR_COLORMAP
826			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
827		#endif
828		#ifdef USE_SPECULAR_INTENSITYMAP
829			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
830		#endif
831		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
832	#else
833		float specularIntensityFactor = 1.0;
834		vec3 specularColorFactor = vec3( 1.0 );
835		material.specularF90 = 1.0;
836	#endif
837	material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;
838	material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
839#else
840	material.specularColor = vec3( 0.04 );
841	material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
842	material.specularF90 = 1.0;
843#endif
844#ifdef USE_CLEARCOAT
845	material.clearcoat = clearcoat;
846	material.clearcoatRoughness = clearcoatRoughness;
847	material.clearcoatF0 = vec3( 0.04 );
848	material.clearcoatF90 = 1.0;
849	#ifdef USE_CLEARCOATMAP
850		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
851	#endif
852	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
853		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
854	#endif
855	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
856	material.clearcoatRoughness += geometryRoughness;
857	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
858#endif
859#ifdef USE_DISPERSION
860	material.dispersion = dispersion;
861#endif
862#ifdef USE_IRIDESCENCE
863	material.iridescence = iridescence;
864	material.iridescenceIOR = iridescenceIOR;
865	#ifdef USE_IRIDESCENCEMAP
866		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
867	#endif
868	#ifdef USE_IRIDESCENCE_THICKNESSMAP
869		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
870	#else
871		material.iridescenceThickness = iridescenceThicknessMaximum;
872	#endif
873#endif
874#ifdef USE_SHEEN
875	material.sheenColor = sheenColor;
876	#ifdef USE_SHEEN_COLORMAP
877		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
878	#endif
879	material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );
880	#ifdef USE_SHEEN_ROUGHNESSMAP
881		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
882	#endif
883#endif
884#ifdef USE_ANISOTROPY
885	#ifdef USE_ANISOTROPYMAP
886		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
887		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
888		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
889	#else
890		vec2 anisotropyV = anisotropyVector;
891	#endif
892	material.anisotropy = length( anisotropyV );
893	if( material.anisotropy == 0.0 ) {
894		anisotropyV = vec2( 1.0, 0.0 );
895	} else {
896		anisotropyV /= material.anisotropy;
897		material.anisotropy = saturate( material.anisotropy );
898	}
899	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
900	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
901	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
902#endif`,vg=`uniform sampler2D dfgLUT;
903struct PhysicalMaterial {
904	vec3 diffuseColor;
905	vec3 diffuseContribution;
906	vec3 specularColor;
907	vec3 specularColorBlended;
908	float roughness;
909	float metalness;
910	float specularF90;
911	float dispersion;
912	#ifdef USE_CLEARCOAT
913		float clearcoat;
914		float clearcoatRoughness;
915		vec3 clearcoatF0;
916		float clearcoatF90;
917	#endif
918	#ifdef USE_IRIDESCENCE
919		float iridescence;
920		float iridescenceIOR;
921		float iridescenceThickness;
922		vec3 iridescenceFresnel;
923		vec3 iridescenceF0;
924		vec3 iridescenceFresnelDielectric;
925		vec3 iridescenceFresnelMetallic;
926	#endif
927	#ifdef USE_SHEEN
928		vec3 sheenColor;
929		float sheenRoughness;
930	#endif
931	#ifdef IOR
932		float ior;
933	#endif
934	#ifdef USE_TRANSMISSION
935		float transmission;
936		float transmissionAlpha;
937		float thickness;
938		float attenuationDistance;
939		vec3 attenuationColor;
940	#endif
941	#ifdef USE_ANISOTROPY
942		float anisotropy;
943		float alphaT;
944		vec3 anisotropyT;
945		vec3 anisotropyB;
946	#endif
947};
948vec3 clearcoatSpecularDirect = vec3( 0.0 );
949vec3 clearcoatSpecularIndirect = vec3( 0.0 );
950vec3 sheenSpecularDirect = vec3( 0.0 );
951vec3 sheenSpecularIndirect = vec3(0.0 );
952vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
953    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
954    float x2 = x * x;
955    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
956    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
957}
958float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
959	float a2 = pow2( alpha );
960	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
961	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
962	return 0.5 / max( gv + gl, EPSILON );
963}
964float D_GGX( const in float alpha, const in float dotNH ) {
965	float a2 = pow2( alpha );
966	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
967	return RECIPROCAL_PI * a2 / pow2( denom );
968}
969#ifdef USE_ANISOTROPY
970	float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
971		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
972		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
973		return 0.5 / max( gv + gl, EPSILON )
vendor: 7,372 bytes, lines 973-1132
973;
974	}
975	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
976		float a2 = alphaT * alphaB;
977		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
978		highp float v2 = dot( v, v );
979		float w2 = a2 / v2;
980		return RECIPROCAL_PI * a2 * pow2 ( w2 );
981	}
982#endif
983#ifdef USE_CLEARCOAT
984	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
985		vec3 f0 = material.clearcoatF0;
986		float f90 = material.clearcoatF90;
987		float roughness = material.clearcoatRoughness;
988		float alpha = pow2( roughness );
989		vec3 halfDir = normalize( lightDir + viewDir );
990		float dotNL = saturate( dot( normal, lightDir ) );
991		float dotNV = saturate( dot( normal, viewDir ) );
992		float dotNH = saturate( dot( normal, halfDir ) );
993		float dotVH = saturate( dot( viewDir, halfDir ) );
994		vec3 F = F_Schlick( f0, f90, dotVH );
995		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
996		float D = D_GGX( alpha, dotNH );
997		return F * ( V * D );
998	}
999#endif
1000vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1001	vec3 f0 = material.specularColorBlended;
1002	float f90 = material.specularF90;
1003	float roughness = material.roughness;
1004	float alpha = pow2( roughness );
1005	vec3 halfDir = normalize( lightDir + viewDir );
1006	float dotNL = saturate( dot( normal, lightDir ) );
1007	float dotNV = saturate( dot( normal, viewDir ) );
1008	float dotNH = saturate( dot( normal, halfDir ) );
1009	float dotVH = saturate( dot( viewDir, halfDir ) );
1010	vec3 F = F_Schlick( f0, f90, dotVH );
1011	#ifdef USE_IRIDESCENCE
1012		F = mix( F, material.iridescenceFresnel, material.iridescence );
1013	#endif
1014	#ifdef USE_ANISOTROPY
1015		float dotTL = dot( material.anisotropyT, lightDir );
1016		float dotTV = dot( material.anisotropyT, viewDir );
1017		float dotTH = dot( material.anisotropyT, halfDir );
1018		float dotBL = dot( material.anisotropyB, lightDir );
1019		float dotBV = dot( material.anisotropyB, viewDir );
1020		float dotBH = dot( material.anisotropyB, halfDir );
1021		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
1022		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
1023	#else
1024		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1025		float D = D_GGX( alpha, dotNH );
1026	#endif
1027	return F * ( V * D );
1028}
1029vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
1030	const float LUT_SIZE = 64.0;
1031	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
1032	const float LUT_BIAS = 0.5 / LUT_SIZE;
1033	float dotNV = saturate( dot( N, V ) );
1034	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
1035	uv = uv * LUT_SCALE + LUT_BIAS;
1036	return uv;
1037}
1038float LTC_ClippedSphereFormFactor( const in vec3 f ) {
1039	float l = length( f );
1040	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
1041}
1042vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
1043	float x = dot( v1, v2 );
1044	float y = abs( x );
1045	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
1046	float b = 3.4175940 + ( 4.1616724 + y ) * y;
1047	float v = a / b;
1048	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
1049	return cross( v1, v2 ) * theta_sintheta;
1050}
1051vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
1052	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
1053	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
1054	vec3 lightNormal = cross( v1, v2 );
1055	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
1056	vec3 T1, T2;
1057	T1 = normalize( V - N * dot( V, N ) );
1058	T2 = - cross( N, T1 );
1059	mat3 mat = mInv * transpose( mat3( T1, T2, N ) );
1060	vec3 coords[ 4 ];
1061	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
1062	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
1063	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
1064	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
1065	coords[ 0 ] = normalize( coords[ 0 ] );
1066	coords[ 1 ] = normalize( coords[ 1 ] );
1067	coords[ 2 ] = normalize( coords[ 2 ] );
1068	coords[ 3 ] = normalize( coords[ 3 ] );
1069	vec3 vectorFormFactor = vec3( 0.0 );
1070	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
1071	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
1072	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
1073	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
1074	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
1075	return vec3( result );
1076}
1077#if defined( USE_SHEEN )
1078float D_Charlie( float roughness, float dotNH ) {
1079	float alpha = pow2( roughness );
1080	float invAlpha = 1.0 / alpha;
1081	float cos2h = dotNH * dotNH;
1082	float sin2h = max( 1.0 - cos2h, 0.0078125 );
1083	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
1084}
1085float V_Neubelt( float dotNV, float dotNL ) {
1086	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
1087}
1088vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
1089	vec3 halfDir = normalize( lightDir + viewDir );
1090	float dotNL = saturate( dot( normal, lightDir ) );
1091	float dotNV = saturate( dot( normal, viewDir ) );
1092	float dotNH = saturate( dot( normal, halfDir ) );
1093	float D = D_Charlie( sheenRoughness, dotNH );
1094	float V = V_Neubelt( dotNV, dotNL );
1095	return sheenColor * ( D * V );
1096}
1097#endif
1098float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1099	float dotNV = saturate( dot( normal, viewDir ) );
1100	float r2 = roughness * roughness;
1101	float rInv = 1.0 / ( roughness + 0.1 );
1102	float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;
1103	float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;
1104	float DG = exp( a * dotNV + b );
1105	return saturate( DG );
1106}
1107vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
1108	float dotNV = saturate( dot( normal, viewDir ) );
1109	vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
1110	return specularColor * fab.x + specularF90 * fab.y;
1111}
1112#ifdef USE_IRIDESCENCE
1113void 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 ) {
1114#else
1115void 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 ) {
1116#endif
1117	float dotNV = saturate( dot( normal, viewDir ) );
1118	vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
1119	#ifdef USE_IRIDESCENCE
1120		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
1121	#else
1122		vec3 Fr = specularColor;
1123	#endif
1124	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
1125	float Ess = fab.x + fab.y;
1126	float Ems = 1.0 - Ess;
1127	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
1128	singleScatter += FssEss;
1129	multiScatter += Fms * Ems;
1130}
1131vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1132	vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
vendor: 8,354 bytes, lines 1133-1262
1133	float dotNL = saturate( dot( normal, lightDir ) );
1134	float dotNV = saturate( dot( normal, viewDir ) );
1135	vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;
1136	vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;
1137	vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;
1138	vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;
1139	float Ess_V = dfgV.x + dfgV.y;
1140	float Ess_L = dfgL.x + dfgL.y;
1141	float Ems_V = 1.0 - Ess_V;
1142	float Ems_L = 1.0 - Ess_L;
1143	vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;
1144	vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );
1145	float compensationFactor = Ems_V * Ems_L;
1146	vec3 multiScatter = Fms * compensationFactor;
1147	return singleScatter + multiScatter;
1148}
1149#if NUM_RECT_AREA_LIGHTS > 0
1150	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
1151		vec3 normal = geometryNormal;
1152		vec3 viewDir = geometryViewDir;
1153		vec3 position = geometryPosition;
1154		vec3 lightPos = rectAreaLight.position;
1155		vec3 halfWidth = rectAreaLight.halfWidth;
1156		vec3 halfHeight = rectAreaLight.halfHeight;
1157		vec3 lightColor = rectAreaLight.color;
1158		float roughness = material.roughness;
1159		vec3 rectCoords[ 4 ];
1160		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
1161		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
1162		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
1163		vec2 uv = LTC_Uv( normal, viewDir, roughness );
1164		vec4 t1 = texture2D( ltc_1, uv );
1165		vec4 t2 = texture2D( ltc_2, uv );
1166		mat3 mInv = mat3(
1167			vec3( t1.x, 0, t1.y ),
1168			vec3(    0, 1,    0 ),
1169			vec3( t1.z, 0, t1.w )
1170		);
1171		vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );
1172		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
1173		reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
1174		#ifdef USE_CLEARCOAT
1175			vec3 Ncc = geometryClearcoatNormal;
1176			vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );
1177			vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );
1178			vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );
1179			mat3 mInvClearcoat = mat3(
1180				vec3( t1Clearcoat.x, 0, t1Clearcoat.y ),
1181				vec3(             0, 1,             0 ),
1182				vec3( t1Clearcoat.z, 0, t1Clearcoat.w )
1183			);
1184			vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;
1185			clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );
1186		#endif
1187	}
1188#endif
1189void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
1190	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
1191	vec3 irradiance = dotNL * directLight.color;
1192	#ifdef USE_CLEARCOAT
1193		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
1194		vec3 ccIrradiance = dotNLcc * directLight.color;
1195		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
1196	#endif
1197	#ifdef USE_SHEEN
1198 
1199 		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
1200 
1201 		float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1202 		float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );
1203 
1204 		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );
1205 
1206 		irradiance *= sheenEnergyComp;
1207 
1208 	#endif
1209	reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );
1210	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );
1211}
1212void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
1213	vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );
1214	#ifdef USE_SHEEN
1215		float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1216		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
1217		diffuse *= sheenEnergyComp;
1218	#endif
1219	reflectedLight.indirectDiffuse += diffuse;
1220}
1221void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
1222	#ifdef USE_CLEARCOAT
1223		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
1224	#endif
1225	#ifdef USE_SHEEN
1226		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;
1227 	#endif
1228	vec3 singleScatteringDielectric = vec3( 0.0 );
1229	vec3 multiScatteringDielectric = vec3( 0.0 );
1230	vec3 singleScatteringMetallic = vec3( 0.0 );
1231	vec3 multiScatteringMetallic = vec3( 0.0 );
1232	#ifdef USE_IRIDESCENCE
1233		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
1234		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
1235	#else
1236		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
1237		computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
1238	#endif
1239	vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );
1240	vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );
1241	vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;
1242	vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );
1243	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
1244	vec3 indirectSpecular = radiance * singleScattering;
1245	indirectSpecular += multiScattering * cosineWeightedIrradiance;
1246	vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;
1247	#ifdef USE_SHEEN
1248		float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1249		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
1250		indirectSpecular *= sheenEnergyComp;
1251		indirectDiffuse *= sheenEnergyComp;
1252	#endif
1253	reflectedLight.indirectSpecular += indirectSpecular;
1254	reflectedLight.indirectDiffuse += indirectDiffuse;
1255}
1256#define RE_Direct				RE_Direct_Physical
1257#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
1258#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
1259#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
1260float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1261	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1262}`,
1262_g=`
1263vec3 geometryPosition = - vViewPosition;
1264vec3 geometryNormal = normal;
1265vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
1266vec3 geometryClearcoatNormal = vec3( 0.0 );
1267#ifdef USE_CLEARCOAT
1268	geometryClearcoatNormal = clearcoatNormal;
1269#endif
1270#ifdef USE_IRIDESCENCE
1271	float dotNVi = saturate( dot( normal, geometryViewDir ) );
1272	if ( material.iridescenceThickness == 0.0 ) {
1273		material.iridescence = 0.0;
1274	} else {
1275		material.iridescence = saturate( material.iridescence );
1276	}
1277	if ( material.iridescence > 0.0 ) {
1278		material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
1279		material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );
1280		material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );
1281		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
1282	}
1283#endif
1284IncidentLight directLight;
1285#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
1286	PointLight pointLight;
1287	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
1288	PointLightShadow pointLightShadow;
1289	#endif
1290	#pragma unroll_loop_start
1291	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
1292		pointLight = pointLights[ i ];
1293		getPointLightInfo( pointLight, geometryPosition, directLight );
1294		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
1295		pointLightShadow = pointLightShadows[ i ];
1296		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
1297		#endif
1298		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1299	}
1300	#pragma unroll_loop_end
1301#endif
1302#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
1303	SpotLight spotLight;
1304	vec4 spotColor;
1305	vec3 spotLightCoord;
1306	bool inSpotLightMap;
1307	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
1308	SpotLightShadow spotLightShadow;
1309	#endif
1310	#pragma unroll_loop_start
1311	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
1312		spotLight = spotLights[ i ];
1313		getSpotLightInfo( spotLight, geometryPosition, directLight );
1314		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1315		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
1316		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1317		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
1318		#else
1319		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1320		#endif
1321		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
1322			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
1323			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
1324			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
1325			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
1326		#endif
1327		#undef SPOT_LIGHT_MAP_INDEX
1328		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1329		spotLightShadow = spotLightShadows[ i ];
1330		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
1331		#endif
1332		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1333	}
1334	#pragma unroll_loop_end
1335#endif
1336#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
1337	DirectionalLight directionalLight;
1338	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
1339	DirectionalLightShadow directionalLightShadow;
1340	#endif
1341	#pragma unroll_loop_start
1342	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
1343		directionalLight = directionalLights[ i ];
1344		getDirectionalLightInfo( directionalLight, directLight );
1345		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
1346		directionalLightShadow = directionalLightShadows[ i ];
1347		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
1348		#endif
1349		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1350	}
1351	#pragma unroll_loop_end
1352#endif
1353#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
1354	RectAreaLight rectAreaLight;
1355	#pragma unroll_loop_start
1356	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
1357		rectAreaLight = rectAreaLights[ i ];
1358		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1359	}
1360	#pragma unroll_loop_end
1361#endif
1362#if defined( RE_IndirectDiffuse )
1363	vec3 iblIrradiance = vec3( 0.0 );
1364	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
1365	#if defined( USE_LIGHT_PROBES )
1366		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
1367	#endif
1368	#if ( NUM_HEMI_LIGHTS > 0 )
1369		#pragma unroll_loop_start
1370		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
1371			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
1372		}
1373		#pragma unroll_loop_end
1374	#endif
1375	#ifdef USE_LIGHT_PROBES_GRID
1376		vec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz;
1377		vec3 probeWorldNormal = transformNormalByInverseViewMatrix( geometryNormal, viewMatrix );
1378		irradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal );
1379	#endif
1380#endif
1381#if defined( RE_IndirectSpecular )
1382	vec3 radiance = vec3( 0.0 );
1383	vec3 clearcoatRadiance = vec3( 0.0 );
1384#endif`,Mg=`#if defined( RE_IndirectDiffuse )
1385	#ifdef USE_LIGHTMAP
1386		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1387		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
1388		irradiance += lightMapIrradiance;
1389	#endif
1390	#if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )
1391		#if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )
1392			iblIrradiance += getIBLIrradiance( geometryNormal );
1393		#endif
1394	#endif
1395#endif
1396#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
1397	#ifdef USE_ANISOTROPY
1398		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
1399	#else
1400		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
1401	#endif
1402	#ifdef USE_CLEARCOAT
1403		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1404	#endif
1405#endif`,yg=`#if defined( RE_IndirectDiffuse )
1406	#if defined( LAMBERT ) || defined( PHONG )
1407		irradiance += iblIrradiance;
1408	#endif
1409	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1410#endif
1411#if defined( RE_IndirectSpecular )
1412	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1413#endif`,Sg=`#ifdef USE_LIGHT_PROBES_GRID
1414uniform highp sampler3D probesSH;
1415uniform vec3 probesMin;
1416uniform vec3 probesMax;
1417uniform vec3 probesResolution;
1418vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {
1419	vec3 res = probesResolution;
1420	vec3 gridRange = probesMax - probesMin;
1421	vec3 resMinusOne = res - 1.0;
1422	vec3 probeSpacing = gridRange / resMinusOne;
1423	vec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5;
1424	vec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 );
1425	uvw = uvw * resMinusOne / res + 0.5 / res;
1426	float nz          = res.z;
1427	float paddedSlices = nz + 2.0;
1428	float atlasDepth  = 7.0 * paddedSlices;
1429	float uvZBase     = uvw.z * nz + 1.0;
1430	vec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase                       ) / atlasDepth ) );
1431	vec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase +       paddedSlices   ) / atlasDepth ) );
1432	vec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices   ) / atlasDepth ) );
1433	vec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices   ) / atlasDepth ) );
1434	vec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices   ) / atlasDepth ) );
1435	vec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices   ) / atlasDepth ) );
1436	vec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices   ) / atlasDepth ) );
1437	vec3 c0 = s0.xyz;
1438	vec3 c1 = vec3( s0.w, s1.xy );
1439	vec3 c2 = vec3( s1.zw, s2.x );
1440	vec3 c3 = s2.yzw;
1441	vec3 c4 = s3.xyz;
1442	vec3 c5 = vec3( s3.w, s4.xy );
1443	vec3 c6 = vec3( s4.zw, s5.x );
1444	vec3 c7 = s5.yzw;
1445	vec3 c8 = s6.xyz;
1446	float x = worldNormal.x, y = worldNormal.y, z = worldNormal.z;
1447	vec3 result = c0 * 0.886227;
1448	result += c1 * 2.0 * 0.511664 * y;
1449	result += c2 * 2.0 * 0.511664 * z;
1450	result += c3 * 2.0 * 0.511664 * x;
1451	result += c4 * 2.0 * 0.429043 * x * y;
1452	result += c5 * 2.0 * 0.429043 * y * z;
1453	result += c6 * ( 0.743125 * z * z - 0.247708 );
1454	result += c7 * 2.0 * 0.429043 * x * z;
1455	result += c8 * 0.429043 * ( x * x - y * y );
1456	return max( result, vec3( 0.0 ) );
1457}
1458#endif`,Tg=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1459	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1460#endif`,Eg=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1461	uniform float logDepthBufFC;
1462	varying float vFragDepth;
1463	varying float vIsPerspective;
1464#endif`,wg=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1465	varying float vFragDepth;
1466	varying float vIsPerspective;
1467#endif`,Ag=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1468	vFragDepth = 1.0 + gl_Position.w;
1469	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1470#endif`,Rg=`#ifdef USE_MAP
1471	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1472	#ifdef DECODE_VIDEO_TEXTURE
1473		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
1474	#endif
1475	diffuseColor *= sampledDiffuseColor;
1476#endif`,Cg=`#ifdef USE_MAP
1477	uniform sampler2D map;
1478#endif`,Pg=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1479	#if defined( USE_POINTS_UV )
1480		vec2 uv = vUv;
1481	#else
1482		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
1483	#endif
1484#endif
1485#ifdef USE_MAP
1486	diffuseColor *= texture2D( map, uv );
1487#endif
1488#ifdef USE_ALPHAMAP
1489	diffuseColor.a *= texture2D( alphaMap, uv ).g;
1490#endif`,Dg=`#if defined( USE_POINTS_UV )
1491	varying vec2 vUv;
1492#else
1493	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1494		uniform mat3 uvTransform;
1495	#endif
1496#endif
1497#ifdef USE_MAP
1498	uniform sampler2D map;
1499#endif
1500#ifdef USE_ALPHAMAP
1501	uniform sampler2D alphaMap;
1502#endif`,Lg=`float metalnessFactor = metalness;
1503#ifdef USE_METALNESSMAP
1504	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1505	metalnessFactor *= texelMetalness.b;
1506#endif`,Ng=`#ifdef USE_METALNESSMAP
1507	uniform sampler2D metalnessMap;
1508#endif`,Ig=`#ifdef USE_INSTANCING_MORPH
1509	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1510	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
1511	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1512		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
1513	}
1514#endif`,Fg=`#if defined( USE_MORPHCOLORS )
1515	vColor *= morphTargetBaseInfluence;
1516	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1517		#if defined( USE_COLOR_ALPHA )
1518			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
1519		#elif defined( USE_COLOR )
1520			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1521		#endif
1522	}
1523#endif`,Ug=`#ifdef USE_MORPHNORMALS
1524	objectNormal *= morphTargetBaseInfluence;
1525	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1526		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
1527	}
1528#endif`,Og=`#ifdef USE_MORPHTARGETS
1529	#ifndef USE_INSTANCING_MORPH
1530		uniform float morphTargetBaseInfluence;
1531		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1532	#endif
1533	uniform sampler2DArray morphTargetsTexture;
1534	uniform ivec2 morphTargetsTextureSize;
1535	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
1536		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
1537		int y = texelIndex / morphTargetsTextureSize.x;
1538		int x = texelIndex - y * morphTargetsTextureSize.x;
1539		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
1540		return texelFetch( morphTargetsTexture, morphUV, 0 );
1541	}
1542#endif`,Bg=`#ifdef USE_MORPHTARGETS
1543	transformed *= morphTargetBaseInfluence;
1544	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1545		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
1546	}
1547#endif`,kg=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1548#ifdef FLAT_SHADED
1549	vec3 fdx = dFdx( vViewPosition );
1550	vec3 fdy = dFdy( vViewPosition );
1551	vec3 normal = normalize( cross( fdx, fdy ) );
1552#else
1553	vec3 normal = normalize( vNormal );
1554	#ifdef DOUBLE_SIDED
1555		normal *= faceDirection;
1556	#endif
1557#endif
1558#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
1559	#ifdef USE_TANGENT
1560		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1561	#else
1562		mat3 tbn = getTangentFrame( - vViewPosition, normal,
1563		#if defined( USE_NORMALMAP )
1564			vNormalMapUv
1565		#elif defined( USE_CLEARCOAT_NORMALMAP )
1566			vClearcoatNormalMapUv
1567		#else
1568			vUv
1569		#endif
1570		);
1571	#endif
1572	#ifdef DOUBLE_SIDED
1573		tbn[0] *= faceDirection;
1574		tbn[1] *= faceDirection;
1575	#endif
1576#endif
1577#ifdef USE_CLEARCOAT_NORMALMAP
1578	#ifdef USE_TANGENT
1579		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1580	#else
1581		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
1582	#endif
1583	#ifdef DOUBLE_SIDED
1584		tbn2[0] *= faceDirection;
1585		tbn2[1] *= faceDirection;
1586	#endif
1587#endif
1588vec3 nonPerturbedNormal = normal;
1588`,zg=`#ifdef USE_NORMALMAP_OBJECTSPACE
1589	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1590	#ifdef FLIP_SIDED
1591		normal = - normal;
1592	#endif
1593	#ifdef DOUBLE_SIDED
1594		normal = normal * faceDirection;
1595	#endif
1596	normal = normalize( normalMatrix * normal );
1597#elif defined( USE_NORMALMAP_TANGENTSPACE )
1598	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1599	#if defined( USE_PACKED_NORMALMAP )
1600		mapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) );
1601	#endif
1602	mapN.xy *= normalScale;
1603	normal = normalize( tbn * mapN );
1604#elif defined( USE_BUMPMAP )
1605	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1606#endif`,Gg=`#ifndef FLAT_SHADED
1607	varying vec3 vNormal;
1608	#ifdef USE_TANGENT
1609		varying vec3 vTangent;
1610		varying vec3 vBitangent;
1611	#endif
1612#endif`,Vg=`#ifndef FLAT_SHADED
1613	varying vec3 vNormal;
1614	#ifdef USE_TANGENT
1615		varying vec3 vTangent;
1616		varying vec3 vBitangent;
1617	#endif
1618#endif`,Hg=`#ifndef FLAT_SHADED
1619	vNormal = normalize( transformedNormal );
1620	#ifdef USE_TANGENT
1621		vTangent = normalize( transformedTangent );
1622		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
1623		#ifdef FLIP_SIDED
1624			vBitangent = - vBitangent;
1625		#endif
1626	#endif
1627#endif`,Wg=`#ifdef USE_NORMALMAP
1628	uniform sampler2D normalMap;
1629	uniform vec2 normalScale;
1630#endif
1631#ifdef USE_NORMALMAP_OBJECTSPACE
1632	uniform mat3 normalMatrix;
1633#endif
1634#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
1635	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
1636		vec3 q0 = dFdx( eye_pos.xyz );
1637		vec3 q1 = dFdy( eye_pos.xyz );
1638		vec2 st0 = dFdx( uv.st );
1639		vec2 st1 = dFdy( uv.st );
1640		vec3 N = surf_norm;
1641		vec3 q1perp = cross( q1, N );
1642		vec3 q0perp = cross( N, q0 );
1643		vec3 T = q1perp * st0.x + q0perp * st1.x;
1644		vec3 B = q1perp * st0.y + q0perp * st1.y;
1645		float det = max( dot( T, T ), dot( B, B ) );
1646		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1647		return mat3( T * scale, B * scale, N );
1648	}
1649#endif`,Xg=`#ifdef USE_CLEARCOAT
1650	vec3 clearcoatNormal = nonPerturbedNormal;
1651#endif`,qg=`#ifdef USE_CLEARCOAT_NORMALMAP
1652	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1653	clearcoatMapN.xy *= clearcoatNormalScale;
1654	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1655#endif`,jg=`#ifdef USE_CLEARCOATMAP
1656	uniform sampler2D clearcoatMap;
1657#endif
1658#ifdef USE_CLEARCOAT_NORMALMAP
1659	uniform sampler2D clearcoatNormalMap;
1660	uniform vec2 clearcoatNormalScale;
1661#endif
1662#ifdef USE_CLEARCOAT_ROUGHNESSMAP
1663	uniform sampler2D clearcoatRoughnessMap;
1664#endif`,Kg=`#ifdef USE_IRIDESCENCEMAP
1665	uniform sampler2D iridescenceMap;
1666#endif
1667#ifdef USE_IRIDESCENCE_THICKNESSMAP
1668	uniform sampler2D iridescenceThicknessMap;
1669#endif`,Yg=`#ifdef OPAQUE
1670diffuseColor.a = 1.0;
1671#endif
1672#ifdef USE_TRANSMISSION
1673diffuseColor.a *= material.transmissionAlpha;
1674#endif
1675gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Jg=`vec3 packNormalToRGB( const in vec3 normal ) {
1676	return normalize( normal ) * 0.5 + 0.5;
1677}
1678vec3 unpackRGBToNormal( const in vec3 rgb ) {
1679	return 2.0 * rgb.xyz - 1.0;
1680}
1681const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
1682const float Inv255 = 1. / 255.;
1683const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
1684const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
1685const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
1686const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
1687vec4 packDepthToRGBA( const in float v ) {
1688	if( v <= 0.0 )
1689		return vec4( 0., 0., 0., 0. );
1690	if( v >= 1.0 )
1691		return vec4( 1., 1., 1., 1. );
1692	float vuf;
1693	float af = modf( v * PackFactors.a, vuf );
1694	float bf = modf( vuf * ShiftRight8, vuf );
1695	float gf = modf( vuf * ShiftRight8, vuf );
1696	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
1697}
1698vec3 packDepthToRGB( const in float v ) {
1699	if( v <= 0.0 )
1700		return vec3( 0., 0., 0. );
1701	if( v >= 1.0 )
1702		return vec3( 1., 1., 1. );
1703	float vuf;
1704	float bf = modf( v * PackFactors.b, vuf );
1705	float gf = modf( vuf * ShiftRight8, vuf );
1706	return vec3( vuf * Inv255, gf * PackUpscale, bf );
1707}
1708vec2 packDepthToRG( const in float v ) {
1709	if( v <= 0.0 )
1710		return vec2( 0., 0. );
1711	if( v >= 1.0 )
1712		return vec2( 1., 1. );
1713	float vuf;
1714	float gf = modf( v * 256., vuf );
1715	return vec2( vuf * Inv255, gf );
1716}
1717float unpackRGBAToDepth( const in vec4 v ) {
1718	return dot( v, UnpackFactors4 );
1719}
1720float unpackRGBToDepth( const in vec3 v ) {
1721	return dot( v, UnpackFactors3 );
1722}
1723float unpackRGToDepth( const in vec2 v ) {
1724	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
1725}
1726vec4 pack2HalfToRGBA( const in vec2 v ) {
1727	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
1728	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
1729}
1730vec2 unpackRGBATo2Half( const in vec4 v ) {
1731	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
1732}
1733float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
1734	return ( viewZ + near ) / ( near - far );
1735}
1736float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
1737	#ifdef USE_REVERSED_DEPTH_BUFFER
1738	
1739		return depth * ( far - near ) - far;
1740	#else
1741		return depth * ( near - far ) - near;
1742	#endif
1743}
1744float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
1745	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
1746}
1747float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
1748	
1749	#ifdef USE_REVERSED_DEPTH_BUFFER
1750		return ( near * far ) / ( ( near - far ) * depth - near );
1751	#else
1752		return ( near * far ) / ( ( far - near ) * depth - far );
1753	#endif
1754}`,Zg=`#ifdef PREMULTIPLIED_ALPHA
1755	gl_FragColor.rgb *= gl_FragColor.a;
1756#endif`,Qg=`vec4 mvPosition = vec4( transformed, 1.0 );
1757#ifdef USE_BATCHING
1758	mvPosition = batchingMatrix * mvPosition;
1759#endif
1760#ifdef USE_INSTANCING
1761	mvPosition = instanceMatrix * mvPosition;
1762#endif
1763mvPosition = modelViewMatrix * mvPosition;
1764gl_Position = projectionMatrix * mvPosition;`,$g=`#ifdef DITHERING
1765	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
1766#endif`,e0=`#ifdef DITHERING
1767	vec3 dithering( vec3 color ) {
1768		float grid_position = rand( gl_FragCoord.xy );
1769		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
1770		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
1771		return color + dither_shift_RGB;
1772	}
1773#endif`,t0=`float roughnessFactor = roughness;
1774#ifdef USE_ROUGHNESSMAP
1775	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
1776	roughnessFactor *= texelRoughness.g;
1777#endif`,n0=`#ifdef USE_ROUGHNESSMAP
1778	uniform sampler2D roughnessMap;
1779#endif`,i0=`#if NUM_SPOT_LIGHT_COORDS > 0
1780	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1781#endif
1782#if NUM_SPOT_LIGHT_MAPS > 0
1783	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
1784#endif
1785#ifdef USE_SHADOWMAP
1786	#if NUM_DIR_LIGHT_SHADOWS > 0
1787		#if defined( SHADOWMAP_TYPE_PCF )
1788			uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1789		#else
1790			uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1791		#endif
1792		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1793		struct DirectionalLightShadow {
1794			float shadowIntensity;
1795			float shadowBias;
1796			float shadowNormalBias;
1797			float shadowRadius;
1798			vec2 shadowMapSize;
1799		};
1800		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1801	#endif
1802	#if NUM_SPOT_LIGHT_SHADOWS > 0
1803		#if defined( SHADOWMAP_TYPE_PCF )
1804			uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
1805		#else
1806			uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
1807		#endif
1808		struct SpotLightShadow {
1809			float shadowIntensity;
1810			float shadowBias;
1811			float shadowNormalBias;
1812			float shadowRadius;
1813			vec2 shadowMapSize;
1814		};
1815		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1816	#endif
1817	#if NUM_POINT_LIGHT_SHADOWS > 0
1818		#if defined( SHADOWMAP_TYPE_PCF )
1819			uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
1820		#elif defined( SHADOWMAP_TYPE_BASIC )
1821			uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
1822		#endif
1823		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1824		struct PointLightShadow {
1825			float shadowIntensity;
1826			float shadowBias;
1827			float shadowNormalBias;
1828			float shadowRadius;
1829			vec2 shadowMapSize;
1830			float shadowCameraNear;
1831			float shadowCameraFar;
1832		};
1833		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1834	#endif
1835	#if defined( SHADOWMAP_TYPE_PCF )
1836		float interleavedGradientNoise( vec2 position ) {
1837			return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );
1838		}
1839		vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {
1840			const float goldenAngle = 2.399963229728653;
1841			float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );
1842			float theta = float( sampleIndex ) * goldenAngle + phi;
1843			return vec2( cos( theta ), sin( theta ) ) * r;
1844		}
1845	#endif
1846	#if defined( SHADOWMAP_TYPE_PCF )
1847		float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1848			float shadow = 1.0;
1849			shadowCoord.xyz /= shadowCoord.w;
1850			shadowCoord.z += shadowBias;
1851			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1852			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1853			if ( frustumTest ) {
1854				vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
1855				float radius = shadowRadius * texelSize.x;
1856				float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
1857				shadow = (
1858					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +
1859					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +
1860					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +
1861					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +
1862					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )
1863				) * 0.2;
1864			}
1865			return mix( 1.0, shadow, shadowIntensity );
1866		}
1867	#elif defined( SHADOWMAP_TYPE_VSM )
1868		float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1869			float shadow = 1.0;
1870			shadowCoord.xyz /= shadowCoord.w;
1871			#ifdef USE_REVERSED_DEPTH_BUFFER
1872				shadowCoord.z -= shadowBias;
1873			#else
1874				shadowCoord.z += shadowBias;
1875			#endif
1876			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1877			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1878			if ( frustumTest ) {
1879				vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;
1880				float mean = distribution.x;
1881				float variance = distribution.y * distribution.y;
1882				#ifdef USE_REVERSED_DEPTH_BUFFER
1883					float hard_shadow = step( mean, shadowCoord.z );
1884				#else
1885					float hard_shadow = step( shadowCoord.z, mean );
1886				#endif
1887				
1888				if ( hard_shadow == 1.0 ) {
1889					shadow = 1.0;
1890				} else {
1891					variance = max( variance, 0.0000001 );
1892					float d = shadowCoord.z - mean;
1893					float p_max = variance / ( variance + d * d );
1894					p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );
1895					shadow = max( hard_shadow, p_max );
1896				}
1897			}
1898			return mix( 1.0, shadow, shadowIntensity );
1899		}
1900	#else
1901		float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1902			float shadow = 1.0;
1903			shadowCoord.xyz /= shadowCoord.w;
1904			#ifdef USE_REVERSED_DEPTH_BUFFER
1905				shadowCoord.z -= shadowBias;
1906			#else
1907				shadowCoord.z += shadowBias;
1908			#endif
1909			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1910			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1911			if ( frustumTest ) {
1912				float depth = texture2D( shadowMap, shadowCoord.xy ).r;
1913				#ifdef USE_REVERSED_DEPTH_BUFFER
1914					shadow = step( depth, shadowCoord.z );
1915				#else
1916					shadow = step( shadowCoord.z, depth );
1917				#endif
1918			}
1919			return mix( 1.0, shadow, shadowIntensity );
1920		}
1921	#endif
1922	#if NUM_POINT_LIGHT_SHADOWS > 0
1923	#if defined( SHADOWMAP_TYPE_PCF )
1924	float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
1925		float shadow = 1.0;
1926		vec3 lightToPosition = shadowCoord.xyz;
1927		vec3 bd3D = normalize( lightToPosition );
1928		vec3 absVec = abs( lightToPosition );
1929		float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
1930		if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
1931			#ifdef USE_REVERSED_DEPTH_BUFFER
1932				float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1933				dp -= shadowBias;
1934			#else
1935				float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1936				dp += shadowBias;
1937			#endif
1938			float texelSize = shadowRadius / shadowMapSize.x;
1939			vec3 absDir = abs( bd3D );
1940			vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );
1941			tangent = normalize( cross( bd3D, tangent ) );
1942			vec3 bitangent = cross( bd3D, tangent );
1943			float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
1944			vec2 sample0 = vogelDiskSample( 0, 5, phi );
1945			vec2 sample1 = vogelDiskSample( 1, 5, phi );
1946			vec2 sample2 = vogelDiskSample( 2, 5, phi );
1947			vec2 sample3 = vogelDiskSample( 3, 5, phi );
1948			vec2 sample4 = vogelDiskSample( 4, 5, phi );
1949			shadow = (
1950				texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +
1951				texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +
1952				texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +
1953				texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +
1954				texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )
1955			) * 0.2;
1956		}
1957		return mix( 1.0, shadow, shadowIntensity );
1958	}
1959	#elif defined( SHADOWMAP_TYPE_BASIC )
1960	float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
1961		float shadow = 1.0;
1962		vec3 lightToPosition = shadowCoord.xyz;
1963		vec3 absVec = abs( lightToPosition );
1964		float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
1965		if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
1966			float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1967			dp += shadowBias;
1968			vec3 bd3D = normalize( lightToPosition );
1969			float depth = textureCube( shadowMap, bd3D ).r;
1970			#ifdef USE_REVERSED_DEPTH_BUFFER
1971				depth = 1.0 - depth;
1972			#endif
1973			shadow = step( dp, depth );
1974		}
1975		return mix( 1.0, shadow, shadowIntensity );
1976	}
1977	#endif
1978	#endif
1979#endif`,s0=`#if NUM_SPOT_LIGHT_COORDS > 0
1980	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
1981	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1982#endif
1983#ifdef USE_SHADOWMAP
1984	#if NUM_DIR_LIGHT_SHADOWS > 0
1985		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
1986		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1987		struct DirectionalLightShadow {
1988			float shadowIntensity;
1989			float shadowBias;
1990			float shadowNormalBias;
1991			float shadowRadius;
1992			vec2 shadowMapSize;
1993		};
1994		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1995	#endif
1996	#if NUM_SPOT_LIGHT_SHADOWS > 0
1997		struct SpotLightShadow {
1998			float shadowIntensity;
1999			float shadowBias;
2000			float shadowNormalBias;
2001			float shadowRadius;
2002			vec2 shadowMapSize;
2003		};
2004		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
2005	#endif
2006	#if NUM_POINT_LIGHT_SHADOWS > 0
2007		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
2008		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
2009		struct PointLightShadow {
2010			float shadowIntensity;
2011			float shadowBias;
2012			float shadowNormalBias;
2013			float shadowRadius;
2014			vec2 shadowMapSize;
2015			float shadowCameraNear;
2016			float shadowCameraFar;
2017		};
2018		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
2019	#endif
2020#endif`,r0=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
2021	#ifdef HAS_NORMAL
2022		vec3 shadowWorldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );
2023	#else
2024		vec3 shadowWorldNormal = vec3( 0.0 );
2025	#endif
2026	vec4 shadowWorldPosition;
2027#endif
2028#if defined( USE_SHADOWMAP )
2029	#if NUM_DIR_LIGHT_SHADOWS > 0
2030		#pragma unroll_loop_start
2031		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2032			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
2033			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
2034		}
2035		#pragma unroll_loop_end
2036	#endif
2037	#if NUM_POINT_LIGHT_SHADOWS > 0
2038		#pragma unroll_loop_start
2039		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2040			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
2041			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
2042		}
2043		#pragma unroll_loop_end
2044	#endif
2045#endif
2046#if NUM_SPOT_LIGHT_COORDS > 0
2047	#pragma unroll_loop_start
2048	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
2049		shadowWorldPosition = worldPosition;
2050		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
2051			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
2052		#endif
2053		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
2054	}
2055	#pragma unroll_loop_end
2056#endif`,a0=`float getShadowMask() {
2057	float shadow = 1.0;
2058	#ifdef USE_SHADOWMAP
2059	#if NUM_DIR_LIGHT_SHADOWS > 0
2060	DirectionalLightShadow directionalLight;
2061	#pragma unroll_loop_start
2062	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2063		directionalLight = directionalLightShadows[ i ];
2064		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
2065	}
2066	#pragma unroll_loop_end
2067	#endif
2068	#if NUM_SPOT_LIGHT_SHADOWS > 0
2069	SpotLightShadow spotLight;
2070	#pragma unroll_loop_start
2071	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
2072		spotLight = spotLightShadows[ i ];
2073		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
2074	}
2075	#pragma unroll_loop_end
2076	#endif
2077	#if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
2078	PointLightShadow pointLight;
2079	#pragma unroll_loop_start
2080	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2081		pointLight = pointLightShadows[ i ];
2082		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
2083	}
2084	#pragma unroll_loop_end
2085	#endif
2086	#endif
2087	return shadow;
2088}`,o0=`#ifdef USE_SKINNING
2089	mat4 boneMatX = getBoneMatrix( skinIndex.x );
2090	mat4 boneMatY = getBoneMatrix( skinIndex.y );
2091	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
2092	mat4 boneMatW = getBoneMatrix( skinIndex.w );
2093#endif`,c0=`#ifdef USE_SKINNING
2094	uniform mat4 bindMatrix;
2095	uniform mat4 bindMatrixInverse;
2096	uniform highp sampler2D boneTexture;
2097	mat4 getBoneMatrix( const in float i ) {
2098		int size = textureSize( boneTexture, 0 ).x;
2099		int j = int( i ) * 4;
2100		int x = j % size;
2101		int y = j / size;
2102		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
2103		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
2104		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
2105		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
2106		return mat4( v1, v2, v3, v4 );
2107	}
2108#endif`,l0=`#ifdef USE_SKINNING
2109	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2110	vec4 skinned = vec4( 0.0 );
2111	skinned += boneMatX * skinVertex * skinWeight.x;
2112	skinned += boneMatY * skinVertex * skinWeight.y;
2113	skinned += boneMatZ * skinVertex * skinWeight.z;
2114	skinned += boneMatW * skinVertex * skinWeight.w;
2115	transformed = ( bindMatrixInverse * skinned ).xyz;
2116#endif`,h0=`#ifdef USE_SKINNING
2117	mat4 skinMatrix = mat4( 0.0 );
2118	skinMatrix += skinWeight.x * boneMatX;
2119	skinMatrix += skinWeight.y * boneMatY;
2120	skinMatrix += skinWeight.z * boneMatZ;
2121	skinMatrix += skinWeight.w * boneMatW;
2122	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
2123	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
2124	#ifdef USE_TANGENT
2125		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2126	#endif
2127#endif`,u0=`float specularStrength;
2128#ifdef USE_SPECULARMAP
2129	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
2130	specularStrength = texelSpecular.r;
2131#else
2132	specularStrength = 1.0;
2133#endif`,d0=`#ifdef USE_SPECULARMAP
2134	uniform sampler2D specularMap;
2135#endif`,f0=`#if defined( TONE_MAPPING )
2136	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2137#endif`,p0=`#ifndef saturate
2138#define saturate( a ) clamp( a, 0.0, 1.0 )
2139#endif
2140uniform float toneMappingExposure;
2141vec3 LinearToneMapping( vec3 color ) {
2142	return saturate( toneMappingExposure * color );
2143}
2144vec3 ReinhardToneMapping( vec3 color ) {
2145	color *= toneMappingExposure;
2146	return saturate( color / ( vec3( 1.0 ) + color ) );
2147}
2148vec3 CineonToneMapping( vec3 color ) {
2149	color *= toneMappingExposure;
2150	color = max( vec3( 0.0 ), color - 0.004 );
2151	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
2152}
2153vec3 RRTAndODTFit( vec3 v ) {
2154	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
2155	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
2156	return a / b;
2157}
2158vec3 ACESFilmicToneMapping( vec3 color ) {
2159	const mat3 ACESInputMat = mat3(
2160		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
2161		vec3( 0.04823, 0.01566, 0.83777 )
2162	);
2163	const mat3 ACESOutputMat = mat3(
2164		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
2165		vec3( -0.07367, -0.00605,  1.07602 )
2166	);
2167	color *= toneMappingExposure / 0.6;
2168	color = ACESInputMat * color;
2169	color = RRTAndODTFit( color );
2170	color = ACESOutputMat * color;
2171	return saturate( color );
2172}
2173const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
2174	vec3( 1.6605, - 0.1246, - 0.0182 ),
2175	vec3( - 0.5876, 1.1329, - 0.1006 ),
2176	vec3( - 0.0728, - 0.0083, 1.1187 )
2177);
2178const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
2179	vec3( 0.6274, 0.0691, 0.0164 ),
2180	vec3( 0.3293, 0.9195, 0.0880 ),
2181	vec3( 0.0433, 0.0113, 0.8956 )
2182);
2183vec3 agxDefaultContrastApprox( vec3 x ) {
2184	vec3 x2 = x * x;
2185	vec3 x4 = x2 * x2;
2186	return + 15.5 * x4 * x2
2187		- 40.14 * x4 * x
2188		+ 31.96 * x4
2189		- 6.868 * x2 * x
2190		+ 0.4298 * x2
2191		+ 0.1191 * x
2192		- 0.00232;
2193}
2194vec3 AgXToneMapping( vec3 color ) {
2195	const mat3 AgXInsetMatrix = mat3(
2196		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
2197		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
2198		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
2199	);
2200	const mat3 AgXOutsetMatrix = mat3(
2201		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
2202		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
2203		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
2204	);
2205	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
2206	color *= toneMappingExposure;
2207	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
2208	color = AgXInsetMatrix * color;
2209	color = max( color, 1e-10 );	color = log2( color );
2210	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
2211	color = clamp( color, 0.0, 1.0 );
2212	color = agxDefaultContrastApprox( color );
2213	color = AgXOutsetMatrix * color;
2214	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
2215	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
2216	color = clamp( color, 0.0, 1.0 );
2217	return color;
2218}
2219vec3 NeutralToneMapping( vec3 color ) {
2220	const float StartCompression = 0.8 - 0.04;
2221	const float Desaturation = 0.15;
2222	color *= toneMappingExposure;
2223	float x = min( color.r, min( color.g, color.b ) );
2224	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
2225	color -= offset;
2226	float peak = max( color.r, max( color.g, color.b ) );
2227	if ( peak < StartCompression ) return color;
2228	float d = 1. - StartCompression;
2229	float newPeak = 1. - d * d / ( peak + d - StartCompression );
2230	color *= newPeak / peak;
2231	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
2232	return mix( color, vec3( newPeak ), g );
2233}
2234vec3 CustomToneMapping( vec3 color ) { return color; }`,m0=`#ifdef USE_TRANSMISSION
2235	material.transmission = transmission;
2236	material.transmissionAlpha = 1.0;
2237	material.thickness = thickness;
2238	material.attenuationDistance = attenuationDistance;
2239	material.attenuationColor = attenuationColor;
2240	#ifdef USE_TRANSMISSIONMAP
2241		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
2242	#endif
2243	#ifdef USE_THICKNESSMAP
2244		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
2245	#endif
2246	vec3 pos = vWorldPosition;
2247	vec3 v = normalize( cameraPosition - pos );
2248	vec3 n = transformNormalByInverseViewMatrix( normal, viewMatrix );
2249	vec4 transmitted = getIBLVolumeRefraction(
2250		n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,
2251		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
2252		material.attenuationColor, material.attenuationDistance );
2253	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2254	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2255#endif`,g0=`#ifdef USE_TRANSMISSION
2256	uniform float transmission;
2257	uniform float thickness;
2258	uniform float attenuationDistance;
2259	uniform vec3 attenuationColor;
2260	#ifdef USE_TRANSMISSIONMAP
2261		uniform sampler2D transmissionMap;
2262	#endif
2263	#ifdef USE_THICKNESSMAP
2264		uniform sampler2D thicknessMap;
2265	#endif
2266	uniform vec2 transmissionSamplerSize;
2267	uniform sampler2D transmissionSamplerMap;
2268	uniform mat4 modelMatrix;
2269	uniform mat4 projectionMatrix;
2270	varying vec3 vWorldPosition;
2271	float w0( float a ) {
2272		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
2273	}
2274	float w1( float a ) {
2275		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
2276	}
2277	float w2( float a ){
2278		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
2279	}
2280	float w3( float a ) {
2281		return ( 1.0 / 6.0 ) * ( a * a * a );
2282	}
2283	float g0( float a ) {
2284		return w0( a ) + w1( a );
2285	}
2286	float g1( float a ) {
2287		return w2( a ) + w3( a );
2288	}
2289	float h0( float a ) {
2290		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
2291	}
2292	float h1( float a ) {
2293		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
2294	}
2295	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
2296		uv = uv * texelSize.zw + 0.5;
2297		vec2 iuv = floor( uv );
2298		vec2 fuv = fract( uv );
2299		float g0x = g0( fuv.x );
2300		float g1x = g1( fuv.x );
2301		float h0x = h0( fuv.x );
2302		float h1x = h1( fuv.x );
2303		float h0y = h0( fuv.y );
2304		float h1y = h1( fuv.y );
2305		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2306		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2307		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2308		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2309		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
2310			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
2311	}
2312	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
2313		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
2314		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
2315		vec2 fLodSizeInv = 1.0 / fLodSize;
2316		vec2 cLodSizeInv = 1.0 / cLodSize;
2317		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
2318		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
2319		return mix( fSample, cSample, fract( lod ) );
2320	}
2321	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
2322		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
2323		vec3 modelScale;
2324		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
2325		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
2326		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
2327		return normalize( refractionVector ) * thickness * modelScale;
2328	}
2329	float applyIorToRoughness( const in float roughness, const in float ior ) {
2330		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
2331	}
2332	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
2333		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
2334		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
2335	}
2336	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
2337		if ( isinf( attenuationDistance ) ) {
2338			return vec3( 1.0 );
2339		} else {
2340			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
2341			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
2342		}
2343	}
2344	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
2345		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
2346		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
2347		const in vec3 attenuationColor, const in float attenuationDistance ) {
2348		vec4 transmittedLight;
2349		vec3 transmittance;
2350		#ifdef USE_DISPERSION
2351			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
2352			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
2353			for ( int i = 0; i < 3; i ++ ) {
2354				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
2355				vec3 refractedRayExit = position + transmissionRay;
2356				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2357				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2358				refractionCoords += 1.0;
2359				refractionCoords /= 2.0;
2360				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
2361				transmittedLight[ i ] = transmissionSample[ i ];
2362				transmittedLight.a += transmissionSample.a;
2363				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
2364			}
2365			transmittedLight.a /= 3.0;
2366		#else
2367			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
2368			vec3 refractedRayExit = position + transmissionRay;
2369			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2370			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2371			refractionCoords += 1.0;
2372			refractionCoords /= 2.0;
2373			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
2374			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
2375		#endif
2376		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
2377		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
2378		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2379		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2380	}
2381#endif`,b0=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2382	varying vec2 vUv;
2383#endif
2384#ifdef USE_MAP
2385	varying vec2 vMapUv;
2386#endif
2387#ifdef USE_ALPHAMAP
2388	varying vec2 vAlphaMapUv;
2389#endif
2390#ifdef USE_LIGHTMAP
2391	varying vec2 vLightMapUv;
2392#endif
2393#ifdef USE_AOMAP
2394	varying vec2 vAoMapUv;
2395#endif
2396#ifdef USE_BUMPMAP
2397	varying vec2 vBumpMapUv;
2398#endif
2399#ifdef USE_NORMALMAP
2400	varying vec2 vNormalMapUv;
2401#endif
2402#ifdef USE_EMISSIVEMAP
2403	varying vec2 vEmissiveMapUv;
2404#endif
2405#ifdef USE_METALNESSMAP
2406	varying vec2 vMetalnessMapUv;
2407#endif
2408#ifdef USE_ROUGHNESSMAP
2409	varying vec2 vRoughnessMapUv;
2410#endif
2411#ifdef USE_ANISOTROPYMAP
2412	varying vec2 vAnisotropyMapUv;
2413#endif
2414#ifdef USE_CLEARCOATMAP
2415	varying vec2 vClearcoatMapUv;
2416#endif
2417#ifdef USE_CLEARCOAT_NORMALMAP
2418	varying vec2 vClearcoatNormalMapUv;
2419#endif
2420#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2421	varying vec2 vClearcoatRoughnessMapUv;
2422#endif
2423#ifdef USE_IRIDESCENCEMAP
2424	varying vec2 vIridescenceMapUv;
2425#endif
2426#ifdef USE_IRIDESCENCE_THICKNESSMAP
2427	varying vec2 vIridescenceThicknessMapUv;
2428#endif
2429#ifdef USE_SHEEN_COLORMAP
2430	varying vec2 vSheenColorMapUv;
2431#endif
2432#ifdef USE_SHEEN_ROUGHNESSMAP
2433	varying vec2 vSheenRoughnessMapUv;
2434#endif
2435#ifdef USE_SPECULARMAP
2436	varying vec2 vSpecularMapUv;
2437#endif
2438#ifdef USE_SPECULAR_COLORMAP
2439	varying vec2 vSpecularColorMapUv;
2440#endif
2441#ifdef USE_SPECULAR_INTENSITYMAP
2442	varying vec2 vSpecularIntensityMapUv;
2443#endif
2444#ifdef USE_TRANSMISSIONMAP
2445	uniform mat3 transmissionMapTransform;
2446	varying vec2 vTransmissionMapUv;
2447#endif
2448#ifdef USE_THICKNESSMAP
2449	uniform mat3 thicknessMapTransform;
2450	varying vec2 vThicknessMapUv;
2451#endif`,x0=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2452	varying vec2 vUv;
2453#endif
2454#ifdef USE_MAP
2455	uniform mat3 mapTransform;
2456	varying vec2 vMapUv;
2457#endif
2458#ifdef USE_ALPHAMAP
2459	uniform mat3 alphaMapTransform;
2460	varying vec2 vAlphaMapUv;
2461#endif
2462#ifdef USE_LIGHTMAP
2463	uniform mat3 lightMapTransform;
2464	varying vec2 vLightMapUv;
2465#endif
2466#ifdef USE_AOMAP
2467	uniform mat3 aoMapTransform;
2468	varying vec2 vAoMapUv;
2469#endif
2470#ifdef USE_BUMPMAP
2471	uniform mat3 bumpMapTransform;
2472	varying vec2 vBumpMapUv;
2473#endif
2474#ifdef USE_NORMALMAP
2475	uniform mat3 normalMapTransform;
2476	varying vec2 vNormalMapUv;
2477#endif
2478#ifdef USE_DISPLACEMENTMAP
2479	uniform mat3 displacementMapTransform;
2480	varying vec2 vDisplacementMapUv;
2481#endif
2482#ifdef USE_EMISSIVEMAP
2483	uniform mat3 emissiveMapTransform;
2484	varying vec2 vEmissiveMapUv;
2485#endif
2486#ifdef USE_METALNESSMAP
2487	uniform mat3 metalnessMapTransform;
2488	varying vec2 vMetalnessMapUv;
2489#endif
2490#ifdef USE_ROUGHNESSMAP
2491	uniform mat3 roughnessMapTransform;
2492	varying vec2 vRoughnessMapUv;
2493#endif
2494#ifdef USE_ANISOTROPYMAP
2495	uniform mat3 anisotropyMapTransform;
2496	varying vec2 vAnisotropyMapUv;
2497#endif
2498#ifdef USE_CLEARCOATMAP
2499	uniform mat3 clearcoatMapTransform;
2500	varying vec2 vClearcoatMapUv;
2501#endif
2502#ifdef USE_CLEARCOAT_NORMALMAP
2503	uniform mat3 clearcoatNormalMapTransform;
2504	varying vec2 vClearcoatNormalMapUv;
2505#endif
2506#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2507	uniform mat3 clearcoatRoughnessMapTransform;
2508	varying vec2 vClearcoatRoughnessMapUv;
2509#endif
2510#ifdef USE_SHEEN_COLORMAP
2511	uniform mat3 sheenColorMapTransform;
2512	varying vec2 vSheenColorMapUv;
2513#endif
2514#ifdef USE_SHEEN_ROUGHNESSMAP
2515	uniform mat3 sheenRoughnessMapTransform;
2516	varying vec2 vSheenRoughnessMapUv;
2517#endif
2518#ifdef USE_IRIDESCENCEMAP
2519	uniform mat3 iridescenceMapTransform;
2520	varying vec2 vIridescenceMapUv;
2521#endif
2522#ifdef USE_IRIDESCENCE_THICKNESSMAP
2523	uniform mat3 iridescenceThicknessMapTransform;
2524	varying vec2 vIridescenceThicknessMapUv;
2525#endif
2526#ifdef USE_SPECULARMAP
2527	uniform mat3 specularMapTransform;
2528	varying vec2 vSpecularMapUv;
2529#endif
2530#ifdef USE_SPECULAR_COLORMAP
2531	uniform mat3 specularColorMapTransform;
2532	varying vec2 vSpecularColorMapUv;
2533#endif
2534#ifdef USE_SPECULAR_INTENSITYMAP
2535	uniform mat3 specularIntensityMapTransform;
2536	varying vec2 vSpecularIntensityMapUv;
2537#endif
2538#ifdef USE_TRANSMISSIONMAP
2539	uniform mat3 transmissionMapTransform;
2540	varying vec2 vTransmissionMapUv;
2541#endif
2542#ifdef USE_THICKNESSMAP
2543	uniform mat3 thicknessMapTransform;
2544	varying vec2 vThicknessMapUv;
2545#endif`,v0=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2546	vUv = vec3( uv, 1 ).xy;
2547#endif
2548#ifdef USE_MAP
2549	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
2550#endif
2551#ifdef USE_ALPHAMAP
2552	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
2553#endif
2554#ifdef USE_LIGHTMAP
2555	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
2556#endif
2557#ifdef USE_AOMAP
2558	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
2559#endif
2560#ifdef USE_BUMPMAP
2561	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
2562#endif
2563#ifdef USE_NORMALMAP
2564	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
2565#endif
2566#ifdef USE_DISPLACEMENTMAP
2567	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
2568#endif
2569#ifdef USE_EMISSIVEMAP
2570	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
2571#endif
2572#ifdef USE_METALNESSMAP
2573	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
2574#endif
2575#ifdef USE_ROUGHNESSMAP
2576	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
2577#endif
2578#ifdef USE_ANISOTROPYMAP
2579	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
2580#endif
2581#ifdef USE_CLEARCOATMAP
2582	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
2583#endif
2584#ifdef USE_CLEARCOAT_NORMALMAP
2585	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
2586#endif
2587#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2588	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
2589#endif
2590#ifdef USE_IRIDESCENCEMAP
2591	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
2592#endif
2593#ifdef USE_IRIDESCENCE_THICKNESSMAP
2594	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
2595#endif
2596#ifdef USE_SHEEN_COLORMAP
2597	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
2598#endif
2599#ifdef USE_SHEEN_ROUGHNESSMAP
2600	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
2601#endif
2602#ifdef USE_SPECULARMAP
2603	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
2604#endif
2605#ifdef USE_SPECULAR_COLORMAP
2606	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
2607#endif
2608#ifdef USE_SPECULAR_INTENSITYMAP
2609	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
2610#endif
2611#ifdef USE_TRANSMISSIONMAP
2612	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
2613#endif
2614#ifdef USE_THICKNESSMAP
2615	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2616#endif`,_0=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2617	vec4 worldPosition = vec4( transformed, 1.0 );
2618	#ifdef USE_BATCHING
2619		worldPosition = batchingMatrix * worldPosition;
2620	#endif
2621	#ifdef USE_INSTANCING
2622		worldPosition = instanceMatrix * worldPosition;
2623	#endif
2624	worldPosition = modelMatrix * worldPosition;
2625#endif`;const M0=`varying vec2 vUv;
2626uniform mat3 uvTransform;
2627void main() {
2628	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2629	gl_Position = vec4( position.xy, 1.0, 1.0 );
2630}`,y0=`uniform sampler2D t2D;
2631uniform float backgroundIntensity;
2632varying vec2 vUv;
2633void main() {
2634	vec4 texColor = texture2D( t2D, vUv );
2635	#ifdef DECODE_VIDEO_TEXTURE
2636		texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
2637	#endif
2638	texColor.rgb *= backgroundIntensity;
2639	gl_FragColor = texColor;
2640	#include <tonemapping_fragment>
2641	#include <colorspace_fragment>
2642}`,S0=`varying vec3 vWorldDirection;
2643#include <common>
2644void main() {
2645	vWorldDirection = transformDirection( position, modelMatrix );
2646	#include <begin_vertex>
2647	#include <project_vertex>
2648	gl_Position.z = gl_Position.w;
2649}`,T0=`#ifdef ENVMAP_TYPE_CUBE
2650	uniform samplerCube envMap;
2651#elif defined( ENVMAP_TYPE_CUBE_UV )
2652	uniform sampler2D envMap;
2653#endif
2654uniform float backgroundBlurriness;
2655uniform float backgroundIntensity;
2656uniform mat3 backgroundRotation;
2657varying vec3 vWorldDirection;
2658#include <cube_uv_reflection_fragment>
2659void main() {
2660	#ifdef ENVMAP_TYPE_CUBE
2661		vec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection );
2662	#elif defined( ENVMAP_TYPE_CUBE_UV )
2663		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
2664	#else
2665		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
2666	#endif
2667	texColor.rgb *= backgroundIntensity;
2668	gl_FragColor = texColor;
2669	#include <tonemapping_fragment>
2670	#include <colorspace_fragment>
2671}`,E0=`varying vec3 vWorldDirection;
2672#include <common>
2673void main() {
2674	vWorldDirection = transformDirection( position, modelMatrix );
2675	#include <begin_vertex>
2676	#include <project_vertex>
2677	gl_Position.z = gl_Position.w;
2678}`,w0=`uniform samplerCube tCube;
2679uniform float tFlip;
2680uniform float opacity;
2681varying vec3 vWorldDirection;
2682void main() {
2683	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
2684	gl_FragColor = texColor;
2685	gl_FragColor.a *= opacity;
2686	#include <tonemapping_fragment>
2687	#include <colorspace_fragment>
2688}`,A0=`#include <common>
2689#include <batching_pars_vertex>
2690#include <uv_pars_vertex>
2691#include <displacementmap_pars_vertex>
2692#include <morphtarget_pars_vertex>
2693#include <skinning_pars_vertex>
2694#include <logdepthbuf_pars_vertex>
2695#include <clipping_planes_pars_vertex>
2696varying vec2 vHighPrecisionZW;
2697void main() {
2698	#include <uv_vertex>
2699	#include <batching_vertex>
2700	#include <skinbase_vertex>
2701	#include <morphinstance_vertex>
2702	#ifdef USE_DISPLACEMENTMAP
2703		#include <beginnormal_vertex>
2704		#include <morphnormal_vertex>
2705		#include <skinnormal_vertex>
2706	#endif
2707	#include <begin_vertex>
2708	#include <morphtarget_vertex>
2709	#include <skinning_vertex>
2710	#include <displacementmap_vertex>
2711	#include <project_vertex>
2712	#include <logdepthbuf_vertex>
2713	#include <clipping_planes_vertex>
2714	vHighPrecisionZW = gl_Position.zw;
2715}`,R0=`#if DEPTH_PACKING == 3200
2716	uniform float opacity;
2717#endif
2718#include <common>
2719#include <packing>
2720#include <uv_pars_fragment>
2721#include <map_pars_fragment>
2722#include <alphamap_pars_fragment>
2723#include <alphatest_pars_fragment>
2724#include <alphahash_pars_fragment>
2725#include <logdepthbuf_pars_fragment>
2726#include <clipping_planes_pars_fragment>
2727varying vec2 vHighPrecisionZW;
2728void main() {
2729	vec4 diffuseColor = vec4( 1.0 );
2730	#include <clipping_planes_fragment>
2731	#if DEPTH_PACKING == 3200
2732		diffuseColor.a = opacity;
2733	#endif
2734	#include <map_fragment>
2735	#include <alphamap_fragment>
2736	#include <alphatest_fragment>
2737	#include <alphahash_fragment>
2738	#include <logdepthbuf_fragment>
2739	#ifdef USE_REVERSED_DEPTH_BUFFER
2740		float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
2741	#else
2742		float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
2743	#endif
2744	#if DEPTH_PACKING == 3200
2745		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
2746	#elif DEPTH_PACKING == 3201
2747		gl_FragColor = packDepthToRGBA( fragCoordZ );
2748	#elif DEPTH_PACKING == 3202
2749		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
2750	#elif DEPTH_PACKING == 3203
2751		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
2752	#endif
2753}`,C0=`#define DISTANCE
2754varying vec3 vWorldPosition;
2755#include <common>
2756#include <batching_pars_vertex>
2757#include <uv_pars_vertex>
2758#include <displacementmap_pars_vertex>
2759#include <morphtarget_pars_vertex>
2760#include <skinning_pars_vertex>
2761#include <clipping_planes_pars_vertex>
2762void main() {
2763	#include <uv_vertex>
2764	#include <batching_vertex>
2765	#include <skinbase_vertex>
2766	#include <morphinstance_vertex>
2767	#ifdef USE_DISPLACEMENTMAP
2768		#include <beginnormal_vertex>
2769		#include <morphnormal_vertex>
2770		#include <skinnormal_vertex>
2771	#endif
2772	#include <begin_vertex>
2773	#include <morphtarget_vertex>
2774	#include <skinning_vertex>
2775	#include <displacementmap_vertex>
2776	#include <project_vertex>
2777	#include <worldpos_vertex>
2778	#include <clipping_planes_vertex>
2779	vWorldPosition = worldPosition.xyz;
2780}`,P0=`#define DISTANCE
2781uniform vec3 referencePosition;
2782uniform float nearDistance;
2783uniform float farDistance;
2784varying vec3 vWorldPosition;
2785#include <common>
2786#include <uv_pars_fragment>
2787#include <map_pars_fragment>
2788#include <alphamap_pars_fragment>
2789#include <alphatest_pars_fragment>
2790#include <alphahash_pars_fragment>
2791#include <clipping_planes_pars_fragment>
2792void main() {
2793	vec4 diffuseColor = vec4( 1.0 );
2794	#include <clipping_planes_fragment>
2795	#include <map_fragment>
2796	#include <alphamap_fragment>
2797	#include <alphatest_fragment>
2798	#include <alphahash_fragment>
2799	float dist = length( vWorldPosition - referencePosition );
2800	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
2801	dist = saturate( dist );
2802	gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );
2803}`,D0=`varying vec3 vWorldDirection;
2804#include <common>
2805void main() {
2806	vWorldDirection = transformDirection( position, modelMatrix );
2807	#include <begin_vertex>
2808	#include <project_vertex>
2809}`,L0=`uniform sampler2D tEquirect;
2810varying vec3 vWorldDirection;
2811#include <common>
2812void main() {
2813	vec3 direction = normalize( vWorldDirection );
2814	vec2 sampleUV = equirectUv( direction );
2815	gl_FragColor = texture2D( tEquirect, sampleUV );
2816	#include <tonemapping_fragment>
2817	#include <colorspace_fragment>
2818}`,N0=`uniform float scale;
2819attribute float lineDistance;
2820varying float vLineDistance;
2821#include <common>
2822#include <uv_pars_vertex>
2823#include <color_pars_vertex>
2824#include <fog_pars_vertex>
2825#include <morphtarget_pars_vertex>
2826#include <logdepthbuf_pars_vertex>
2827#include <clipping_planes_pars_vertex>
2828void main() {
2829	vLineDistance = scale * lineDistance;
2830	#include <uv_vertex>
2831	#include <color_vertex>
2832	#include <morphinstance_vertex>
2833	#include <morphcolor_vertex>
2834	#include <begin_vertex>
2835	#include <morphtarget_vertex>
2836	#include <project_vertex>
2837	#include <logdepthbuf_vertex>
2838	#include <clipping_planes_vertex>
2839	#include <fog_vertex>
2840}`,I0=`uniform vec3 diffuse;
2841uniform float opacity;
2842uniform float dashSize;
2843uniform float totalSize;
2844varying float vLineDistance;
2845#include <common>
2846#include <color_pars_fragment>
2847#include <uv_pars_fragment>
2848#include <map_pars_fragment>
2849#include <fog_pars_fragment>
2850#include <logdepthbuf_pars_fragment>
2851#include <clipping_planes_pars_fragment>
2852void main() {
2853	vec4 diffuseColor = vec4( diffuse, opacity );
2854	#include <clipping_planes_fragment>
2855	if ( mod( vLineDistance, totalSize ) > dashSize ) {
2856		discard;
2857	}
2858	vec3 outgoingLight = vec3( 0.0 );
2859	#include <logdepthbuf_fragment>
2860	#include <map_fragment>
2861	#include <color_fragment>
2862	outgoingLight = diffuseColor.rgb;
2863	#include <opaque_fragment>
2864	#include <tonemapping_fragment>
2865	#include <colorspace_fragment>
2866	#include <fog_fragment>
2867	#include <premultiplied_alpha_fragment>
2868}`,F0=`#include <common>
2869#include <batching_pars_vertex>
2870#include <uv_pars_vertex>
2871#include <envmap_pars_vertex>
2872#include <color_pars_vertex>
2873#include <fog_pars_vertex>
2874#include <morphtarget_pars_vertex>
2875#include <skinning_pars_vertex>
2876#include <logdepthbuf_pars_vertex>
2877#include <clipping_planes_pars_vertex>
2878void main() {
2879	#include <uv_vertex>
2880	#include <color_vertex>
2881	#include <morphinstance_vertex>
2882	#include <morphcolor_vertex>
2883	#include <batching_vertex>
2884	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
2885		#include <beginnormal_vertex>
2886		#include <morphnormal_vertex>
2887		#include <skinbase_vertex>
2888		#include <skinnormal_vertex>
2889		#include <defaultnormal_vertex>
2890	#endif
2891	#include <begin_vertex>
2892	#include <morphtarget_vertex>
2893	#include <skinning_vertex>
2894	#include <project_vertex>
2895	#include <logdepthbuf_vertex>
2896	#include <clipping_planes_vertex>
2897	#include <worldpos_vertex>
2898	#include <envmap_vertex>
2899	#include <fog_vertex>
2900}`,U0=`uniform vec3 diffuse;
2901uniform float opacity;
2902#ifndef FLAT_SHADED
2903	varying vec3 vNormal;
2904#endif
2905#include <common>
2906#include <dithering_pars_fragment>
2907#include <color_pars_fragment>
2908#include <uv_pars_fragment>
2909#include <map_pars_fragment>
2910#include <alphamap_pars_fragment>
2911#include <alphatest_pars_fragment>
2912#include <alphahash_pars_fragment>
2913#include <aomap_pars_fragment>
2914#include <lightmap_pars_fragment>
2915#include <envmap_common_pars_fragment>
2916#include <envmap_pars_fragment>
2917#include <fog_pars_fragment>
2918#include <specularmap_pars_fragment>
2919#include <logdepthbuf_pars_fragment>
2920#include <clipping_planes_pars_fragment>
2921void main() {
2922	vec4 diffuseColor = vec4( diffuse, opacity );
2923	#include <clipping_planes_fragment>
2924	#include <logdepthbuf_fragment>
2925	#include <map_fragment>
2926	#include <color_fragment>
2927	#include <alphamap_fragment>
2928	#include <alphatest_fragment>
2929	#include <alphahash_fragment>
2930	#include <specularmap_fragment>
2931	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
2932	#ifdef USE_LIGHTMAP
2933		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
2934		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
2935	#else
2936		reflectedLight.indirectDiffuse += vec3( 1.0 );
2937	#endif
2938	#include <aomap_fragment>
2939	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
2940	vec3 outgoingLight = reflectedLight.indirectDiffuse;
2941	#include <envmap_fragment>
2942	#include <opaque_fragment>
2943	#include <tonemapping_fragment>
2944	#include <colorspace_fragment>
2945	#include <fog_fragment>
2946	#include <premultiplied_alpha_fragment>
2947	#include <dithering_fragment>
2948}`,O0=`#define LAMBERT
2949varying vec3 vViewPosition;
2950#include <common>
2951#include <batching_pars_vertex>
2952#include <uv_pars_vertex>
2953#include <displacementmap_pars_vertex>
2954#include <envmap_pars_vertex>
2955#include <color_pars_vertex>
2956#include <fog_pars_vertex>
2957#include <normal_pars_vertex>
2958#include <morphtarget_pars_vertex>
2959#include <skinning_pars_vertex>
2960#include <shadowmap_pars_vertex>
2961#include <logdepthbuf_pars_vertex>
2962#include <clipping_planes_pars_vertex>
2963void main() {
2964	#include <uv_vertex>
2965	#include <color_vertex>
2966	#include <morphinstance_vertex>
2967	#include <morphcolor_vertex>
2968	#include <batching_vertex>
2969	#include <beginnormal_vertex>
2970	#include <morphnormal_vertex>
2971	#include <skinbase_vertex>
2972	#include <skinnormal_vertex>
2973	#include <defaultnormal_vertex>
2974	#include <normal_vertex>
2975	#include <begin_vertex>
2976	#include <morphtarget_vertex>
2977	#include <skinning_vertex>
2978	#include <displacementmap_vertex>
2979	#include <project_vertex>
2980	#include <logdepthbuf_vertex>
2981	#include <clipping_planes_vertex>
2982	vViewPosition = - mvPosition.xyz;
2983	#include <worldpos_vertex>
2984	#include <envmap_vertex>
2985	#include <shadowmap_vertex>
2986	#include <fog_vertex>
2987}`,B0=`#define LAMBERT
2988uniform vec3 diffuse;
2989uniform vec3 emissive;
2990uniform float opacity;
2991#include <common>
2992#include <dithering_pars_fragment>
2993#include <color_pars_fragment>
2994#include <uv_pars_fragment>
2995#include <map_pars_fragment>
2996#include <alphamap_pars_fragment>
2997#include <alphatest_pars_fragment>
2998#include <alphahash_pars_fragment>
2999#include <aomap_pars_fragment>
3000#include <lightmap_pars_fragment>
3001#include <emissivemap_pars_fragment>
3002#include <cube_uv_reflection_fragment>
3003#include <envmap_common_pars_fragment>
3004#include <envmap_pars_fragment>
3005#include <envmap_physical_pars_fragment>
3006#include <fog_pars_fragment>
3007#include <bsdfs>
3008#include <lights_pars_begin>
3009#include <normal_pars_fragment>
3010#include <lights_lambert_pars_fragment>
3011#include <shadowmap_pars_fragment>
3012#include <bumpmap_pars_fragment>
3013#include <normalmap_pars_fragment>
3014#include <specularmap_pars_fragment>
3015#include <logdepthbuf_pars_fragment>
3016#include <clipping_planes_pars_fragment>
3017void main() {
3018	vec4 diffuseColor = vec4( diffuse, opacity );
3019	#include <clipping_planes_fragment>
3020	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3021	vec3 totalEmissiveRadiance = emissive;
3022	#include <logdepthbuf_fragment>
3023	#include <map_fragment>
3024	#include <color_fragment>
3025	#include <alphamap_fragment>
3026	#include <alphatest_fragment>
3027	#include <alphahash_fragment>
3028	#include <specularmap_fragment>
3029	#include <normal_fragment_begin>
3030	#include <normal_fragment_maps>
3031	#include <emissivemap_fragment>
3032	#include <lights_lambert_fragment>
3033	#include <lights_fragment_begin>
3034	#include <lights_fragment_maps>
3035	#include <lights_fragment_end>
3036	#include <aomap_fragment>
3037	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3038	#include <envmap_fragment>
3039	#include <opaque_fragment>
3040	#include <tonemapping_fragment>
3041	#include <colorspace_fragment>
3042	#include <fog_fragment>
3043	#include <premultiplied_alpha_fragment>
3044	#include <dithering_fragment>
3045}`,k0=`#define MATCAP
3046varying vec3 vViewPosition;
3047#include <common>
3048#include <batching_pars_vertex>
3049#include <uv_pars_vertex>
3050#include <color_pars_vertex>
3051#include <displacementmap_pars_vertex>
3052#include <fog_pars_vertex>
3053#include <normal_pars_vertex>
3054#include <morphtarget_pars_vertex>
3055#include <skinning_pars_vertex>
3056#include <logdepthbuf_pars_vertex>
3057#include <clipping_planes_pars_vertex>
3058void main() {
3059	#include <uv_vertex>
3060	#include <color_vertex>
3061	#include <morphinstance_vertex>
3062	#include <morphcolor_vertex>
3063	#include <batching_vertex>
3064	#include <beginnormal_vertex>
3065	#include <morphnormal_vertex>
3066	#include <skinbase_vertex>
3067	#include <skinnormal_vertex>
3068	#include <defaultnormal_vertex>
3069	#include <normal_vertex>
3070	#include <begin_vertex>
3071	#include <morphtarget_vertex>
3072	#include <skinning_vertex>
3073	#include <displacementmap_vertex>
3074	#include <project_vertex>
3075	#include <logdepthbuf_vertex>
3076	#include <clipping_planes_vertex>
3077	#include <fog_vertex>
3078	vViewPosition = - mvPosition.xyz;
3079}`,z0=`#define MATCAP
3080uniform vec3 diffuse;
3081uniform float opacity;
3082uniform sampler2D matcap;
3083varying vec3 vViewPosition;
3084#include <common>
3085#include <dithering_pars_fragment>
3086#include <color_pars_fragment>
3087#include <uv_pars_fragment>
3088#include <map_pars_fragment>
3089#include <alphamap_pars_fragment>
3090#include <alphatest_pars_fragment>
3091#include <alphahash_pars_fragment>
3092#include <fog_pars_fragment>
3093#include <normal_pars_fragment>
3094#include <bumpmap_pars_fragment>
3095#include <normalmap_pars_fragmen
3095t>
3096#include <logdepthbuf_pars_fragment>
3097#include <clipping_planes_pars_fragment>
3098void main() {
3099	vec4 diffuseColor = vec4( diffuse, opacity );
3100	#include <clipping_planes_fragment>
3101	#include <logdepthbuf_fragment>
3102	#include <map_fragment>
3103	#include <color_fragment>
3104	#include <alphamap_fragment>
3105	#include <alphatest_fragment>
3106	#include <alphahash_fragment>
3107	#include <normal_fragment_begin>
3108	#include <normal_fragment_maps>
3109	vec3 viewDir = normalize( vViewPosition );
3110	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
3111	vec3 y = cross( viewDir, x );
3112	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
3113	#ifdef USE_MATCAP
3114		vec4 matcapColor = texture2D( matcap, uv );
3115	#else
3116		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
3117	#endif
3118	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
3119	#include <opaque_fragment>
3120	#include <tonemapping_fragment>
3121	#include <colorspace_fragment>
3122	#include <fog_fragment>
3123	#include <premultiplied_alpha_fragment>
3124	#include <dithering_fragment>
3125}`,G0=`#define NORMAL
3126#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3127	varying vec3 vViewPosition;
3128#endif
3129#include <common>
3130#include <batching_pars_vertex>
3131#include <uv_pars_vertex>
3132#include <displacementmap_pars_vertex>
3133#include <normal_pars_vertex>
3134#include <morphtarget_pars_vertex>
3135#include <skinning_pars_vertex>
3136#include <logdepthbuf_pars_vertex>
3137#include <clipping_planes_pars_vertex>
3138void main() {
3139	#include <uv_vertex>
3140	#include <batching_vertex>
3141	#include <beginnormal_vertex>
3142	#include <morphinstance_vertex>
3143	#include <morphnormal_vertex>
3144	#include <skinbase_vertex>
3145	#include <skinnormal_vertex>
3146	#include <defaultnormal_vertex>
3147	#include <normal_vertex>
3148	#include <begin_vertex>
3149	#include <morphtarget_vertex>
3150	#include <skinning_vertex>
3151	#include <displacementmap_vertex>
3152	#include <project_vertex>
3153	#include <logdepthbuf_vertex>
3154	#include <clipping_planes_vertex>
3155#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3156	vViewPosition = - mvPosition.xyz;
3157#endif
3158}`,V0=`#define NORMAL
3159uniform float opacity;
3160#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3161	varying vec3 vViewPosition;
3162#endif
3163#include <uv_pars_fragment>
3164#include <normal_pars_fragment>
3165#include <bumpmap_pars_fragment>
3166#include <normalmap_pars_fragment>
3167#include <logdepthbuf_pars_fragment>
3168#include <clipping_planes_pars_fragment>
3169void main() {
3170	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
3171	#include <clipping_planes_fragment>
3172	#include <logdepthbuf_fragment>
3173	#include <normal_fragment_begin>
3174	#include <normal_fragment_maps>
3175	gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );
3176	#ifdef OPAQUE
3177		gl_FragColor.a = 1.0;
3178	#endif
3179}`,H0=`#define PHONG
3180varying vec3 vViewPosition;
3181#include <common>
3182#include <batching_pars_vertex>
3183#include <uv_pars_vertex>
3184#include <displacementmap_pars_vertex>
3185#include <envmap_pars_vertex>
3186#include <color_pars_vertex>
3187#include <fog_pars_vertex>
3188#include <normal_pars_vertex>
3189#include <morphtarget_pars_vertex>
3190#include <skinning_pars_vertex>
3191#include <shadowmap_pars_vertex>
3192#include <logdepthbuf_pars_vertex>
3193#include <clipping_planes_pars_vertex>
3194void main() {
3195	#include <uv_vertex>
3196	#include <color_vertex>
3197	#include <morphcolor_vertex>
3198	#include <batching_vertex>
3199	#include <beginnormal_vertex>
3200	#include <morphinstance_vertex>
3201	#include <morphnormal_vertex>
3202	#include <skinbase_vertex>
3203	#include <skinnormal_vertex>
3204	#include <defaultnormal_vertex>
3205	#include <normal_vertex>
3206	#include <begin_vertex>
3207	#include <morphtarget_vertex>
3208	#include <skinning_vertex>
3209	#include <displacementmap_vertex>
3210	#include <project_vertex>
3211	#include <logdepthbuf_vertex>
3212	#include <clipping_planes_vertex>
3213	vViewPosition = - mvPosition.xyz;
3214	#include <worldpos_vertex>
3215	#include <envmap_vertex>
3216	#include <shadowmap_vertex>
3217	#include <fog_vertex>
3218}`,W0=`#define PHONG
3219uniform vec3 diffuse;
3220uniform vec3 emissive;
3221uniform vec3 specular;
3222uniform float shininess;
3223uniform float opacity;
3224#include <common>
3225#include <dithering_pars_fragment>
3226#include <color_pars_fragment>
3227#include <uv_pars_fragment>
3228#include <map_pars_fragment>
3229#include <alphamap_pars_fragment>
3230#include <alphatest_pars_fragment>
3231#include <alphahash_pars_fragment>
3232#include <aomap_pars_fragment>
3233#include <lightmap_pars_fragment>
3234#include <emissivemap_pars_fragment>
3235#include <cube_uv_reflection_fragment>
3236#include <envmap_common_pars_fragment>
3237#include <envmap_pars_fragment>
3238#include <envmap_physical_pars_fragment>
3239#include <fog_pars_fragment>
3240#include <bsdfs>
3241#include <lights_pars_begin>
3242#include <normal_pars_fragment>
3243#include <lights_phong_pars_fragment>
3244#include <shadowmap_pars_fragment>
3245#include <bumpmap_pars_fragment>
3246#include <normalmap_pars_fragment>
3247#include <specularmap_pars_fragment>
3248#include <logdepthbuf_pars_fragment>
3249#include <clipping_planes_pars_fragment>
3250void main() {
3251	vec4 diffuseColor = vec4( diffuse, opacity );
3252	#include <clipping_planes_fragment>
3253	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3254	vec3 totalEmissiveRadiance = emissive;
3255	#include <logdepthbuf_fragment>
3256	#include <map_fragment>
3257	#include <color_fragment>
3258	#include <alphamap_fragment>
3259	#include <alphatest_fragment>
3260	#include <alphahash_fragment>
3261	#include <specularmap_fragment>
3262	#include <normal_fragment_begin>
3263	#include <normal_fragment_maps>
3264	#include <emissivemap_fragment>
3265	#include <lights_phong_fragment>
3266	#include <lights_fragment_begin>
3267	#include <lights_fragment_maps>
3268	#include <lights_fragment_end>
3269	#include <aomap_fragment>
3270	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
3271	#include <envmap_fragment>
3272	#include <opaque_fragment>
3273	#include <tonemapping_fragment>
3274	#include <colorspace_fragment>
3275	#include <fog_fragment>
3276	#include <premultiplied_alpha_fragment>
3277	#include <dithering_fragment>
3278}`,X0=`#define STANDARD
3279varying vec3 vViewPosition;
3280#ifdef USE_TRANSMISSION
3281	varying vec3 vWorldPosition;
3282#endif
3283#include <common>
3284#include <batching_pars_vertex>
3285#include <uv_pars_vertex>
3286#include <displacementmap_pars_vertex>
3287#include <color_pars_vertex>
3288#include <fog_pars_vertex>
3289#include <normal_pars_vertex>
3290#include <morphtarget_pars_vertex>
3291#include <skinning_pars_vertex>
3292#include <shadowmap_pars_vertex>
3293#include <logdepthbuf_pars_vertex>
3294#include <clipping_planes_pars_vertex>
3295void main() {
3296	#include <uv_vertex>
3297	#include <color_vertex>
3298	#include <morphinstance_vertex>
3299	#include <morphcolor_vertex>
3300	#include <batching_vertex>
3301	#include <beginnormal_vertex>
3302	#include <morphnormal_vertex>
3303	#include <skinbase_vertex>
3304	#include <skinnormal_vertex>
3305	#include <defaultnormal_vertex>
3306	#include <normal_vertex>
3307	#include <begin_vertex>
3308	#include <morphtarget_vertex>
3309	#include <skinning_vertex>
3310	#include <displacementmap_vertex>
3311	#include <project_vertex>
3312	#include <logdepthbuf_vertex>
3313	#include <clipping_planes_vertex>
3314	vViewPosition = - mvPosition.xyz;
3315	#include <worldpos_vertex>
3316	#include <shadowmap_vertex>
3317	#include <fog_vertex>
3318#ifdef USE_TRANSMISSION
3319	vWorldPosition = worldPosition.xyz;
3320#endif
3321}`,q0=`#define STANDARD
3322#ifdef PHYSICAL
3323	#define IOR
3324	#define USE_SPECULAR
3325#endif
3326uniform vec3 diffuse;
3327uniform vec3 emissive;
3328uniform float roughness;
3329uniform float metalness;
3330uniform float opacity;
3331#ifdef IOR
3332	uniform float ior;
3333#endif
3334#ifdef USE_SPECULAR
3335	uniform float specularIntensity;
3336	uniform vec3 specularColor;
3337	#ifdef USE_SPECULAR_COLORMAP
3338		uniform sampler2D specularColorMap;
3339	#endif
3340	#ifdef USE_SPECULAR_INTENSITYMAP
3341		uniform sampler2D specularIntensityMap;
3342	#endif
3343#endif
3344#ifdef USE_CLEARCOAT
3345	uniform float clearcoat;
3346	uniform float clearcoatRoughness;
3347#endif
3348#ifdef USE_DISPERSION
3349	uniform float dispersion;
3350#endif
3351#ifdef USE_IRIDESCENCE
3352	uniform float iridescence;
3353	uniform float iridescenceIOR;
3354	uniform float iridescenceThicknessMinimum;
3355	uniform float iridescenceThicknessMaximum;
3356#endif
3357#ifdef USE_SHEEN
3358	uniform vec3 sheenColor;
3359	uniform float sheenRoughness;
3360	#ifdef USE_SHEEN_COLORMAP
3361		uniform sampler2D sheenColorMap;
3362	#endif
3363	#ifdef USE_SHEEN_ROUGHNESSMAP
3364		uniform sampler2D sheenRoughnessMap;
3365	#endif
3366#endif
3367#ifdef USE_ANISOTROPY
3368	uniform vec2 anisotropyVector;
3369	#ifdef USE_ANISOTROPYMAP
3370		uniform sampler2D anisotropyMap;
3371	#endif
3372#endif
3373varying vec3 vViewPosition;
3374#include <common>
3375#include <dithering_pars_fragment>
3376#include <color_pars_fragment>
3377#include <uv_pars_fragment>
3378#include <map_pars_fragment>
3379#include <alphamap_pars_fragment>
3380#include <alphatest_pars_fragment>
3381#include <alphahash_pars_fragment>
3382#include <aomap_pars_fragment>
3383#include <lightmap_pars_fragment>
3384#include <emissivemap_pars_fragment>
3385#include <iridescence_fragment>
3386#include <cube_uv_reflection_fragment>
3387#include <envmap_common_pars_fragment>
3388#include <envmap_physical_pars_fragment>
3389#include <fog_pars_fragment>
3390#include <lights_pars_begin>
3391#include <normal_pars_fragment>
3392#include <lights_physical_pars_fragment>
3393#include <transmission_pars_fragment>
3394#include <shadowmap_pars_fragment>
3395#include <bumpmap_pars_fragment>
3396#include <normalmap_pars_fragment>
3397#include <clearcoat_pars_fragment>
3398#include <iridescence_pars_fragment>
3399#include <roughnessmap_pars_fragment>
3400#include <metalnessmap_pars_fragment>
3401#include <logdepthbuf_pars_fragment>
3402#include <clipping_planes_pars_fragment>
3403void main() {
3404	vec4 diffuseColor = vec4( diffuse, opacity );
3405	#include <clipping_planes_fragment>
3406	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3407	vec3 totalEmissiveRadiance = emissive;
3408	#include <logdepthbuf_fragment>
3409	#include <map_fragment>
3410	#include <color_fragment>
3411	#include <alphamap_fragment>
3412	#include <alphatest_fragment>
3413	#include <alphahash_fragment>
3414	#include <roughnessmap_fragment>
3415	#include <metalnessmap_fragment>
3416	#include <normal_fragment_begin>
3417	#include <normal_fragment_maps>
3418	#include <clearcoat_normal_fragment_begin>
3419	#include <clearcoat_normal_fragment_maps>
3420	#include <emissivemap_fragment>
3421	#include <lights_physical_fragment>
3422	#include <lights_fragment_begin>
3423	#include <lights_fragment_maps>
3424	#include <lights_fragment_end>
3425	#include <aomap_fragment>
3426	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
3427	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
3428	#include <transmission_fragment>
3429	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
3430	#ifdef USE_SHEEN
3431 
3432		outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;
3433 
3434 	#endif
3435	#ifdef USE_CLEARCOAT
3436		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
3437		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
3438		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
3439	#endif
3440	#include <opaque_fragment>
3441	#include <tonemapping_fragment>
3442	#include <colorspace_fragment>
3443	#include <fog_fragment>
3444	#include <premultiplied_alpha_fragment>
3445	#include <dithering_fragment>
3446}`,j0=`#define TOON
3447varying vec3 vViewPosition;
3448#include <common>
3449#include <batching_pars_vertex>
3450#include <uv_pars_vertex>
3451#include <displacementmap_pars_vertex>
3452#include <color_pars_vertex>
3453#include <fog_pars_vertex>
3454#include <normal_pars_vertex>
3455#include <morphtarget_pars_vertex>
3456#include <skinning_pars_vertex>
3457#include <shadowmap_pars_vertex>
3458#include <logdepthbuf_pars_vertex>
3459#include <clipping_planes_pars_vertex>
3460void main() {
3461	#include <uv_vertex>
3462	#include <color_vertex>
3463	#include <morphinstance_vertex>
3464	#include <morphcolor_vertex>
3465	#include <batching_vertex>
3466	#include <beginnormal_vertex>
3467	#include <morphnormal_vertex>
3468	#include <skinbase_vertex>
3469	#include <skinnormal_vertex>
3470	#include <defaultnormal_vertex>
3471	#include <normal_vertex>
3472	#include <begin_vertex>
3473	#include <morphtarget_vertex>
3474	#include <skinning_vertex>
3475	#include <displacementmap_vertex>
3476	#include <project_vertex>
3477	#include <logdepthbuf_vertex>
3478	#include <clipping_planes_vertex>
3479	vViewPosition = - mvPosition.xyz;
3480	#include <worldpos_vertex>
3481	#include <shadowmap_vertex>
3482	#include <fog_vertex>
3483}`,K0=`#define TOON
3484uniform vec3 diffuse;
3485uniform vec3 emissive;
3486uniform float opacity;
3487#include <common>
3488#include <dithering_pars_fragment>
3489#include <color_pars_fragment>
3490#include <uv_pars_fragment>
3491#include <map_pars_fragment>
3492#include <alphamap_pars_fragment>
3493#include <alphatest_pars_fragment>
3494#include <alphahash_pars_fragment>
3495#include <aomap_pars_fragment>
3496#include <lightmap_pars_fragment>
3497#include <emissivemap_pars_fragment>
3498#include <gradientmap_pars_fragment>
3499#include <fog_pars_fragment>
3500#include <bsdfs>
3501#include <lights_pars_begin>
3502#include <normal_pars_fragment>
3503#include <lights_toon_pars_fragment>
3504#include <shadowmap_pars_fragment>
3505#include <bumpmap_pars_fragment>
3506#include <normalmap_pars_fragment>
3507#include <logdepthbuf_pars_fragment>
3508#include <clipping_planes_pars_fragment>
3509void main() {
3510	vec4 diffuseColor = vec4( diffuse, opacity );
3511	#include <clipping_planes_fragment>
3512	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3513	vec3 totalEmissiveRadiance = emissive;
3514	#include <logdepthbuf_fragment>
3515	#include <map_fragment>
3516	#include <color_fragment>
3517	#include <alphamap_fragment>
3518	#include <alphatest_fragment>
3519	#include <alphahash_fragment>
3520	#include <normal_fragment_begin>
3521	#include <normal_fragment_maps>
3522	#include <emissivemap_fragment>
3523	#include <lights_toon_fragment>
3524	#include <lights_fragment_begin>
3525	#include <lights_fragment_maps>
3526	#include <lights_fragment_end>
3527	#include <aomap_fragment>
3528	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3529	#include <opaque_fragment>
3530	#include <tonemapping_fragment>
3531	#include <colorspace_fragment>
3532	#include <fog_fragment>
3533	#include <premultiplied_alpha_fragment>
3534	#include <dithering_fragment>
3535}`,Y0=`uniform float size;
3536uniform float scale;
3537#include <common>
3538#include <color_pars_vertex>
3539#include <fog_pars_vertex>
3540#include <morphtarget_pars_vertex>
3541#include <logdepthbuf_pars_vertex>
3542#include <clipping_planes_pars_vertex>
3543#ifdef USE_POINTS_UV
3544	varying vec2 vUv;
3545	uniform mat3 uvTransform;
3546#endif
3547void main() {
3548	#ifdef USE_POINTS_UV
3549		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
3550	#endif
3551	#include <color_vertex>
3552	#include <morphinstance_vertex>
3553	#include <morphcolor_vertex>
3554	#include <begin_vertex>
3555	#include <morphtarget_vertex>
3556	#include <project_vertex>
3557	gl_PointSize = size;
3558	#ifdef USE_SIZEATTENUATION
3559		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3560		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
3561	#endif
3562	#include <logdepthbuf_vertex>
3563	#include <clipping_planes_vertex>
3564	#include <worldpos_vertex>
3565	#include <fog_vertex>
3566}`,J0=`uniform vec3 diffuse;
3567uniform float opacity;
3568#include <common>
3569#include <color_pars_fragment>
3570#include <map_particle_pars_fragment>
3571#include <alphatest_pars_fragment>
3572#include <alphahash_pars_fragment>
3573#include <fog_pars_fragment>
3574#include <logdepthbuf_pars_fragment>
3575#include <clipping_planes_pars_fragment>
3576void main() {
3577	vec4 diffuseColor = vec4( diffuse, opacity );
3578	#include <clipping_planes_fragment>
3579	vec3 outgoingLight = vec3( 0.0 );
3580	#include <logdepthbuf_fragment>
3581	#include <map_particle_fragment>
3582	#include <color_fragment>
3583	#include <alphatest_fragment>
3584	#include <alphahash_fragment>
3585	outgoingLight = diffuseColor.rgb;
3586	#include <opaque_fragment>
3587	#include <tonemapping_fragment>
3588	#include <colorspace_fragment>
3589	#include <fog_fragment>
3590	#include <premultiplied_alpha_fragment>
3591}`,Z0=`#include <common>
3592#include <batching_pars_vertex>
3593#include <fog_pars_vertex>
3594#include <morphtarget_pars_vertex>
3595#include <skinning_pars_vertex>
3596#include <logdepthbuf_pars_vertex>
3597#include <shadowmap_pars_vertex>
3598void main() {
3599	#include <batching_vertex>
3600	#include <beginnormal_vertex>
3601	#include <morphinstance_vertex>
3602	#include <morphnormal_vertex>
3603	#include <skinbase_vertex>
3604	#include <skinnormal_vertex>
3605	#include <defaultnormal_vertex>
3606	#include <begin_vertex>
3607	#include <morphtarget_vertex>
3608	#include <skinning_vertex>
3609	#include <project_vertex>
3610	#include <logdepthbuf_vertex>
3611	#include <worldpos_vertex>
3612	#include <shadowmap_vertex>
3613	#include <fog_vertex>
3614}`,Q0=`uniform vec3 color;
3615uniform float opacity;
3616#include <common>
3617#include <fog_pars_fragment>
3618#include <bsdfs>
3619#include <lights_pars_begin>
3620#include <logdepthbuf_pars_fragment>
3621#include <shadowmap_pars_fragment>
3622#include <shadowmask_pars_fragment>
3623void main() {
3624	#include <logdepthbuf_fragment>
3625	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
3626	#include <tonemapping_fragment>
3627	#include <colorspace_fragment>
3628	#include <fog_fragment>
3629	#include <premultiplied_alpha_fragment>
3630}`,$0=`uniform float rotation;
3631uniform vec2 center;
3632#include <common>
3633#include <uv_pars_vertex>
3634#include <fog_pars_vertex>
3635#include <logdepthbuf_pars_vertex>
3636#include <clipping_planes_pars_vertex>
3637void main() {
3638	#include <uv_vertex>
3639	vec4 mvPosition = modelViewMatrix[ 3 ];
3640	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
3641	#ifndef USE_SIZEATTENUATION
3642		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3643		if ( isPerspective ) scale *= - mvPosition.z;
3644	#endif
3645	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
3646	vec2 rotatedPosition;
3647	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
3648	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
3649	mvPosition.xy += rotatedPosition;
3650	gl_Position = projectionMatrix * mvPosition;
3651	#include <logdepthbuf_vertex>
3652	#include <clipping_planes_vertex>
3653	#include <fog_vertex>
3654}`,eb=`uniform vec3 diffuse;
3655uniform float opacity;
3656#include <common>
3657#include <uv_pars_fragment>
3658#include <map_pars_fragment>
3659#include <alphamap_pars_fragment>
3660#include <alphatest_pars_fragment>
3661#include <alphahash_pars_fragment>
3662#include <fog_pars_fragment>
3663#include <logdepthbuf_pars_fragment>
3664#include <clipping_planes_pars_fragment>
3665void main() {
3666	vec4 diffuseColor = vec4( diffuse, opacity );
3667	#include <clipping_planes_fragment>
3668	vec3 outgoingLight = vec3( 0.0 );
3669	#include <logdepthbuf_fragment>
3670	#include <map_fragment>
3671	#include <alphamap_fragment>
3672	#include <alphatest_fragment>
3673	#include <alphahash_fragment>
3674	outgoingLight = diffuseColor.rgb;
3675	#include <opaque_fragment>
3676	#include <tonemapping_fragment>
3677	#include <colorspace_fragment>
3678	#include <fog_fragment>
3679}`,et={alphahash_fragment:Mm,alphahash_pars_fragment:ym,alphamap_fragment:Sm,alphamap_pars_fragment:Tm,alphatest_fragment:Em,alphatest_pars_fragment:wm,aomap_fragment:Am,aomap_pars_fragment:Rm,batching_pars_vertex:Cm,batching_vertex:Pm,begin_vertex:Dm,beginnormal_vertex:Lm,bsdfs:Nm,iridescence_fragment:Im,bumpmap_pars_fragment:Fm,clipping_planes_fragment:Um,clipping_planes_pars_fragment:Om,clipping_planes_pars_vertex:Bm,clipping_planes_vertex:km,color_fragment:zm,color_pars_fragment:Gm,color_pars_vertex:Vm,color_vertex:Hm,common:Wm,cube_uv_reflection_fragment:Xm,defaultnormal_vertex:qm,displacementmap_pars_vertex:jm,displacementmap_vertex:Km,emissivemap_fragment:Ym,emissivemap_pars_fragment:Jm,colorspace_fragment:Zm,colorspace_pars_fragment:Qm,envmap_fragment:$m,envmap_common_pars_fragment:eg,envmap_pars_fragment:tg,envmap_pars_vertex:ng,envmap_physical_pars_fragment:fg,envmap_vertex:ig,fog_vertex:sg,fog_pars_vertex:rg,fog_fragment:ag,fog_pars_fragment:og,gradientmap_pars_fragment:cg,lightmap_pars_fragment:lg,lights_lambert_fragment:hg,lights_lambert_pars_fragment:ug,lights_pars_begin:dg,lights_toon_fragment:pg,lights_toon_pars_fragment:mg,lights_phong_fragment:gg,lights_phong_pars_fragment:bg,lights_physical_fragment:xg,lights_physical_pars_fragment:vg,lights_fragment_begin:_g,lights_fragment_maps:Mg,lights_fragment_end:yg,lightprobes_pars_fragment:Sg,logdepthbuf_fragment:Tg,logdepthbuf_pars_fragment:Eg,logdepthbuf_pars_vertex:wg,logdepthbuf_vertex:Ag,map_fragment:Rg,map_pars_fragment:Cg,map_particle_fragment:Pg,map_particle_pars_fragment:Dg,metalnessmap_fragment:Lg,metalnessmap_pars_fragment:Ng,morphinstance_vertex:Ig,morphcolor_vertex:Fg,morphnormal_vertex:Ug,morphtarget_pars_vertex:Og,morphtarget_vertex:Bg,normal_fragment_begin:kg,normal_fragment_maps:zg,normal_pars_fragment:Gg,normal_pars_vertex:Vg,normal_vertex:Hg,normalmap_pars_fragment:Wg,clearcoat_normal_fragment_begin:Xg,clearcoat_normal_fragment_maps:qg,clearcoat_pars_fragment:jg,iridescence_pars_fragment:Kg,opaque_fragment:Yg,packing:Jg,premultiplied_alpha_fragment:Zg,project_vertex:Qg,dithering_fragment:$g,dithering_pars_fragment:e0,roughnessmap_fragment:t0,roughnessmap_pars_fragment:n0,shadowmap_pars_fragment:i0,shadowmap_pars_vertex:s0,shadowmap_vertex:r0,shadowmask_pars_fragment:a0,skinbase_vertex:o0,skinning_pars_vertex:c0,skinning_vertex:l0,skinnormal_vertex:h0,specularmap_fragment:u0,specularmap_pars_fragment:d0,tonemapping_fragment:f0,tonemapping_pars_fragment:p0,transmission_fragment:m0,transmission_pars_fragment:g0,uv_pars_fragment:b0,uv_pars_vertex:x0,uv_vertex:v0,worldpos_vertex:_0,background_vert:M0,background_frag:y0,backgroundCube_vert:S0,backgroundCube_frag:T0,cube_vert:E0,cube_frag:w0,depth_vert:A0,depth_frag:R0,distance_vert:C0,distance_frag:P0,equirect_vert:D0,equirect_frag:L0,linedashed_vert:N0,linedashed_frag:I0,meshbasic_vert:F0,meshbasic_frag:U0,meshlambert_vert:O0,meshlambert_frag:B0,meshmatcap_vert:k0,meshmatcap_frag:z0,meshnormal_vert:G0,meshnormal_frag:V0,meshphong_vert:H0,meshphong_frag:W
vendor: 9,667 bytes, line 3679
36790,meshphysical_vert:X0,meshphysical_frag:q0,meshtoon_vert:j0,meshtoon_frag:K0,points_vert:Y0,points_frag:J0,shadow_vert:Z0,shadow_frag:Q0,sprite_vert:$0,sprite_frag:eb},ve={common:{diffuse:{value:new ze(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Je},alphaMap:{value:null},alphaMapTransform:{value:new Je},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Je}},envmap:{envMap:{value:null},envMapRotation:{value:new Je},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Je}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Je}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Je},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Je},normalScale:{value:new te(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Je},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Je}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Je}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Je}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ze(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new L},probesMax:{value:new L},probesResolution:{value:new L}},points:{diffuse:{value:new ze(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Je},alphaTest:{value:0},uvTransform:{value:new Je}},sprite:{diffuse:{value:new ze(16777215)},opacity:{value:1},center:{value:new te(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Je},alphaMap:{value:null},alphaMapTransform:{value:new Je},alphaTest:{value:0}}},Bn={basic:{uniforms:Qt([ve.common,ve.specularmap,ve.envmap,ve.aomap,ve.lightmap,ve.fog]),vertexShader:et.meshbasic_vert,fragmentShader:et.meshbasic_frag},lambert:{uniforms:Qt([ve.common,ve.specularmap,ve.envmap,ve.aomap,ve.lightmap,ve.emissivemap,ve.bumpmap,ve.normalmap,ve.displacementmap,ve.fog,ve.lights,{emissive:{value:new ze(0)},envMapIntensity:{value:1}}]),vertexShader:et.meshlambert_vert,fragmentShader:et.meshlambert_frag},phong:{uniforms:Qt([ve.common,ve.specularmap,ve.envmap,ve.aomap,ve.lightmap,ve.emissivemap,ve.bumpmap,ve.normalmap,ve.displacementmap,ve.fog,ve.lights,{emissive:{value:new ze(0)},specular:{value:new ze(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:et.meshphong_vert,fragmentShader:et.meshphong_frag},standard:{uniforms:Qt([ve.common,ve.envmap,ve.aomap,ve.lightmap,ve.emissivemap,ve.bumpmap,ve.normalmap,ve.displacementmap,ve.roughnessmap,ve.metalnessmap,ve.fog,ve.lights,{emissive:{value:new ze(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:et.meshphysical_vert,fragmentShader:et.meshphysical_frag},toon:{uniforms:Qt([ve.common,ve.aomap,ve.lightmap,ve.emissivemap,ve.bumpmap,ve.normalmap,ve.displacementmap,ve.gradientmap,ve.fog,ve.lights,{emissive:{value:new ze(0)}}]),vertexShader:et.meshtoon_vert,fragmentShader:et.meshtoon_frag},matcap:{uniforms:Qt([ve.common,ve.bumpmap,ve.normalmap,ve.displacementmap,ve.fog,{matcap:{value:null}}]),vertexShader:et.meshmatcap_vert,fragmentShader:et.meshmatcap_frag},points:{uniforms:Qt([ve.points,ve.fog]),vertexShader:et.points_vert,fragmentShader:et.points_frag},dashed:{uniforms:Qt([ve.common,ve.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:et.linedashed_vert,fragmentShader:et.linedashed_frag},depth:{uniforms:Qt([ve.common,ve.displacementmap]),vertexShader:et.depth_vert,fragmentShader:et.depth_frag},normal:{uniforms:Qt([ve.common,ve.bumpmap,ve.normalmap,ve.displacementmap,{opacity:{value:1}}]),vertexShader:et.meshnormal_vert,fragmentShader:et.meshnormal_frag},sprite:{uniforms:Qt([ve.sprite,ve.fog]),vertexShader:et.sprite_vert,fragmentShader:et.sprite_frag},background:{uniforms:{uvTransform:{value:new Je},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:et.background_vert,fragmentShader:et.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Je}},vertexShader:et.backgroundCube_vert,fragmentShader:et.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:et.cube_vert,fragmentShader:et.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:et.equirect_vert,fragmentShader:et.equirect_frag},distance:{uniforms:Qt([ve.common,ve.displacementmap,{referencePosition:{value:new L},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:et.distance_vert,fragmentShader:et.distance_frag},shadow:{uniforms:Qt([ve.lights,ve.fog,{color:{value:new ze(0)},opacity:{value:1}}]),vertexShader:et.shadow_vert,fragmentShader:et.shadow_frag}};Bn.physical={uniforms:Qt([Bn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Je},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Je},clearcoatNormalScale:{value:new te(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Je},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Je},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Je},sheen:{value:0},sheenColor:{value:new ze(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Je},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Je},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Je},transmissionSamplerSize:{value:new te},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Je},attenuationDistance:{value:0},attenuationColor:{value:new ze(0)},specularColor:{value:new ze(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Je},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Je},anisotropyVector:{value:new te},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Je}}]),vertexShader:et.meshphysical_vert,fragmentShader:et.meshphysical_frag};const Fr={r:0,b:0,g:0},tb=new Ye,Ou=new Je;Ou.set(-1,0,0,0,1,0,0,0,1);function nb(s,e,t,n,i,r){const a=new ze(0);let o=i===!0?0:1,c,l,h=null,u=0,d=null;function f(_){let y=_.isScene===!0?_.background:null;if(y&&y.isTexture){const v=_.backgroundBlurriness>0;y=e.get(y,v)}return y}function g(_){let y=!1;const v=f(_);v===null?m(a,o):v&&v.isColor&&(m(v,1),y=!0);const T=s.xr.getEnvironmentBlendMode();T==="additive"?t.buffers.color.setClear(0,0,0,1,r):T==="alpha-blend"&&t.buffers.color.setClear(0,0,0,0,r),(s.autoClear||y)&&(t.buffers.depth.setTest(!0),t.buffers.depth.setMask(!0),t.buffers.color.setMask(!0),s.clear(s.autoClearColor,s.autoClearDepth,s.autoClearStencil))}function b(_,y){const v=f(y);v&&(v.isCubeTexture||v.mapping===da)?(l===void 0&&(l=new Ke(new ni(1,1,1),new Tt({name:"BackgroundCubeMaterial",uniforms:hs(Bn.backgroundCube.uniforms),vertexShader:Bn.backgroundCube.vertexShader,fragmentShader:Bn.backgroundCube.fragmentShader,side:en,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(T,E,C){this.matrixWorld.copyPosition(C.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=v,l.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(tb.makeRotationFromEuler(y.backgroundRotation)).transpose(),v.isCubeTexture&&v.isRenderTargetTexture===!1&&l.material.uniforms.backgroundRotation.value.premultiply(Ou),l.material.toneMapped=nt.getTransfer(v.colorSpace)!==ct,(h!==v||u!==v.version||d!==s.toneMapping)&&(l.material.needsUpdate=!0,h=v,u=v.version,d=s.toneMapping),l.layers.enableAll(),_.unshift(l,l.geometry,l.material,0,0,null)):v&&v.isTexture&&(c===void 0&&(c=new Ke(new nr(2,2),new Tt({name:"Backgroun
3679dMaterial",uniforms:hs(Bn.background.uniforms),vertexShader:Bn.background.vertexShader,fragmentShader:Bn.background.fragmentShader,side:ei,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(c)),c.material.uniforms.t2D.value=v,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.toneMapped=nt.getTransfer(v.colorSpace)!==ct,v.matrixAutoUpdate===!0&&v.updateMatrix(),c.material.uniforms.uvTransform.value.copy(v.matrix),(h!==v||u!==v.version||d!==s.toneMapping)&&(c.material.needsUpdate=!0,h=v,u=v.version,d=s.toneMapping),c.layers.enableAll(),_.unshift(c,c.geometry,c.material,0,0,null))}function m(_,y){_.getRGB(Fr,Ru(s)),t.buffers.color.setClear(Fr.r,Fr.g,Fr.b,y,r)}function p(){l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return a},setClearColor:function(_,y=1){a.set(_),o=y,m(a,o)},getClearAlpha:function(){return o},setClearAlpha:function(_){o=_,m(a,o)},render:g,addToRenderList:b,dispose:p}}function ib(s,e){const t=s.getParameter(s.MAX_VERTEX_ATTRIBS),n={},i=d(null);let r=i,a=!1;function o(R,D,F,O,I){let B=!1;const G=u(R,O,F,D);r!==G&&(r=G,l(r.object)),B=f(R,O,F,I),B&&g(R,O,F,I),I!==null&&e.update(I,s.ELEMENT_ARRAY_BUFFER),(B||a)&&(a=!1,v(R,D,F,O),I!==null&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e.get(I).buffer))}function c(){return s.createVertexArray()}function l(R){return s.bindVertexArray(R)}function h(R){return s.deleteVertexArray(R)}function u(R,D,F,O){const I=O.wireframe===!0;let B=n[D.id];B===void 0&&(B={},n[D.id]=B);const G=R.isInstancedMesh===!0?R.id:0;let j=B[G];j===void 0&&(j={},B[G]=j);let Y=j[F.id];Y===void 0&&(Y={},j[F.id]=Y);let ne=Y[I];return ne===void 0&&(ne=d(c()),Y[I]=ne),ne}function d(R){const D=[],F=[],O=[];for(let I=0;I<t;I++)D[I]=0,F[I]=0,O[I]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:D,enabledAttributes:F,attributeDivisors:O,object:R,attributes:{},index:null}}function f(R,D,F,O){const I=r.attributes,B=D.attributes;let G=0;const j=F.getAttributes();for(const Y in j)if(j[Y].location>=0){const oe=I[Y];let ce=B[Y];if(ce===void 0&&(Y==="instanceMatrix"&&R.instanceMatrix&&(ce=R.instanceMatrix),Y==="instanceColor"&&R.instanceColor&&(ce=R.instanceColor)),oe===void 0||oe.attribute!==ce||ce&&oe.data!==ce.data)return!0;G++}return r.attributesNum!==G||r.index!==O}function g(R,D,F,O){const I={},B=D.attributes;let G=0;const j=F.getAttributes();for(const Y in j)if(j[Y].location>=0){let oe=B[Y];oe===void 0&&(Y==="instanceMatrix"&&R.instanceMatrix&&(oe=R.instanceMatrix),Y==="instanceColor"&&R.instanceColor&&(oe=R.instanceColor));const ce={};ce.attribute=oe,oe&&oe.data&&(ce.data=oe.data),I[Y]=ce,G++}r.attributes=I,r.attributesNum=G,r.index=O}function b(){const R=r.newAttributes;for(let D=0,F=R.length;D<F;D++)R[D]=0}function m(R){p(R,0)}function p(R,D){const F=r.newAttributes,O=r.enabledAttributes,I=r.attributeDivisors;F[R]=1,O[R]===0&&(s.enableVertexAttribArray(R),O[R]=1),I[R]!==D&&(s.vertexAttribDivisor(R,D),I[R]=D)}function _(){const R=r.newAttributes,D=r.enabledAttributes;for(let F=0,O=D.length;F<O;F++)D[F]!==R[F]&&(s.disableVertexAttribArray(F),D[F]=0)}function y(R,D,F,O,I,B,G){G===!0?s.vertexAttribIPointer(R,D,F,I,B):s.vertexAttribPointer(R,D,F,O,I,B)}function v(R,D,F,O){b();const I=O.attributes,B=F.getAttributes(),G=D.defaultAttributeValues;for(const j in B){const Y=B[j];if(Y.location>=0){let ne=I[j];if(ne===void 0&&(j==="instanceMatrix"&&R.instanceMatrix&&(ne=R.instanceMatrix),j==="instanceColor"&&R.instanceColor&&(ne=R.instanceColor)),ne!==void 0){const oe=ne.normalized,ce=ne.itemSize,Ee=e.get(ne);if(Ee===void 0)continue;const je=Ee.buffer,Ve=Ee.type,k=Ee.bytesPerElement,ee=Ve===s.INT||Ve===s.UNSIGNED_INT||ne.gpuType===yc;if(ne.isInterleavedBufferAttribute){const Q=ne.data,Se=Q.stride,Le=ne.offset;if(Q.isInstancedInterleavedBuffer){for(let Ie=0;Ie<Y.locationSize;Ie++)p(Y.location+Ie,Q.meshPerAttribute);R.isInstancedMesh!==!0&&O._maxInstanceCount===void 0&&(O._maxInstanceCount=Q.meshPerAttribute*Q.count)}
3679else for(let Ie=0;Ie<Y.locationSize;Ie++)m(Y.location+Ie);s.bindBuffer(s.ARRAY_BUFFER,je);for(let Ie=0;Ie<Y.locationSize;Ie++)y(Y.location+Ie,ce/Y.locationSize,Ve,oe,Se*k,(Le+ce/Y.locationSize*Ie)*k,ee)}else{if(ne.isInstancedBufferAttribute){for(let Q=0;Q<Y.locationSize;Q++)p(Y.location+Q,ne.meshPerAttribute);R.isInstancedMesh!==!0&&O._maxInstanceCount===void 0&&(O._maxInstanceCount=ne.meshPerAttribute*ne.count)}else for(let Q=0;Q<Y.locationSize;Q++)m(Y.location+Q);s.bindBuffer(s.ARRAY_BUFFER,je);for(let Q=0;Q<Y.locationSize;Q++)y(Y.location+Q,ce/Y.locationSize,Ve,oe,ce*k,ce/Y.locationSize*Q*k,ee)}}else if(G!==void 0){const oe=G[j];if(oe!==void 0)switch(oe.length){case 2:s.vertexAttrib2fv(Y.location,oe);break;case 3:s.vertexAttrib3fv(Y.location,oe);break;case 4:s.vertexAttrib4fv(Y.location,oe);break;default:s.vertexAttrib1fv(Y.location,oe)}}}}_()}function T(){S();for(const R in n){const D=n[R];for(const F in D){const O=D[F];for(const I in O){const B=O[I];for(const G in B)h(B[G].object),delete B[G];delete O[I]}}delete n[R]}}function E(R){if(n[R.id]===void 0)return;const D=n[R.id];for(const F in D){const O=D[F];for(const I in O){const B=O[I];for(const G in B)h(B[G].object),delete B[G];delete O[I]}}delete n[R.id]}function C(R){for(const D in n){const F=n[D];for(const O in F){const I=F[O];if(I[R.id]===void 0)continue;const B=I[R.id];for(const G in B)h(B[G].object),delete B[G];delete I[R.id]}}}function x(R){for(const D in n){const F=n[D],O=R.isInstancedMesh===!0?R.id:0,I=F[O];if(I!==void 0){for(const B in I){const G=I[B];for(const j in G)h(G[j].object),delete G[j];delete I[B]}delete F[O],Object.keys(F).length===0&&delete n[D]}}}function S(){A(),a=!0,r!==i&&(r=i,l(r.object))}function A(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:S,resetDefaultState:A,dispose:T,releaseStatesOfGeometry:E,releaseStatesOfObject:x,releaseStatesOfProgram:C,initAttributes:b,enableAttribute:m,disableUnusedAttributes:_}}function sb(s,e,t){let n;function i(c){n=c}function r(c,l){s.drawArrays(n,c,l),t.update(l,n,1)}function a(c,l,h){h!==0&&(s.drawArraysInstanced(n,c,l,h),t.update(l,n,h))}function o(c,l,h){if(h===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,c,0,l,0,h);let d=0;for(let f=0;f<h;f++)d+=l[f];t.update(d,n,1)}this.setMode=i,this.render=r,this.renderInstances=a,this.renderMultiDraw=o}function rb(s,e,t,n){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const C=e.get("EXT_texture_filter_anisotropic");i=s.getParameter(C.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(C){return!(C!==un&&n.convert(C)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(C){const x=C===Ct&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(C!==Jt&&n.convert(C)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_TYPE)&&C!==rn&&!x)}function c(C){if(C==="highp"){if(s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision>0)return"highp";C="mediump"}return C==="mediump"&&s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.MEDIUM_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let l=t.precision!==void 0?t.precision:"highp";const h=c(l);h!==l&&(Ce("WebGLRenderer:",l,"not supported, using",h,"instead."),l=h);const u=t.logarithmicDepthBuffer===!0,d=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control");t.reversedDepthBuffer===!0&&d===!1&&Ce("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");const f=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),g=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),b=s.getParameter(s.MAX_TEXTURE_SIZE),m=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),p=s.getParameter(s.MAX_VERTEX_ATTRIBS),_=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),y=s.getParameter(s.MAX_VARYING_VECTORS),v=s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS),T=s.getParameter(s.MAX_SAMPLES),E=s.getParameter(s.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:c,textureFormatReadable:a,textureTypeReadable:o,precision:l,logarithmicDepthBuffer:u,reversedDepthBuffer:d,maxTextures:f,maxVertexTextures:g,maxTextureSize:b,maxCubemapSize:m,maxAttributes:p,maxVertexUniforms:_,maxVaryings:y,maxFragmentUniforms:v,maxSamples:T,samples:E}}function ab(s){const e=this;let t=null,n=0,i=!1,r=!1;const a=new fi,o=new Je,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(u,d){const f=u.length!==0||d||n!==0||i;return i=d,n=u.length,f},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(u,d){t=h(u,d,0)},this.setState=function(u,d,f){const g=u.clippingPlanes,b=u.clipIntersection,m=u.clipSh
vendor: 4,108 bytes, line 3679
3679adows,p=s.get(u);if(!i||g===null||g.length===0||r&&!m)r?h(null):l();else{const _=r?0:n,y=_*4;let v=p.clippingState||null;c.value=v,v=h(g,d,y,f);for(let T=0;T!==y;++T)v[T]=t[T];p.clippingState=v,this.numIntersection=b?this.numPlanes:0,this.numPlanes+=_}};function l(){c.value!==t&&(c.value=t,c.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(u,d,f,g){const b=u!==null?u.length:0;let m=null;if(b!==0){if(m=c.value,g!==!0||m===null){const p=f+b*4,_=d.matrixWorldInverse;o.getNormalMatrix(_),(m===null||m.length<p)&&(m=new Float32Array(p));for(let y=0,v=f;y!==b;++y,v+=4)a.copy(u[y]).applyMatrix4(_,o),a.normal.toArray(m,v),m[v+3]=a.constant}c.value=m,c.needsUpdate=!0}return e.numPlanes=b,e.numIntersection=0,m}}const mi=4,ph=[.125,.215,.35,.446,.526,.582],wi=20,ob=256,ws=new ir,mh=new ze;let eo=null,to=0,no=0,io=!1;const cb=new L;class ca{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,i=100,r={}){const{size:a=256,position:o=cb}=r;eo=this._renderer.getRenderTarget(),to=this._renderer.getActiveCubeFace(),no=this._renderer.getActiveMipmapLevel(),io=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const c=this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(e,n,i,c,o),t>0&&this._blur(c,0,0,t),this._applyPMREM(c),this._cleanup(c),c}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=xh(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=bh(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(eo,to,no),this._renderer.xr.enabled=io,e.scissorTest=!1,Zi(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Ci||e.mapping===as?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),eo=this._renderer.getRenderTarget(),to=this._renderer.getActiveCubeFace(),no=this._renderer.getActiveMipmapLevel(),io=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:Mt,minFilter:Mt,generateMipmaps:!1,type:Ct,format:un,colorSpace:an,depthBuffer:!1},i=gh(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=gh(e,t,n);const{_lodMax:r}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=lb(r)),this._blurMaterial=ub(r,e,t),this._ggxMaterial=hb(r,e,t)}return i}_compileMaterial(e){const t=new Ke(new xt,e);this._renderer.compile(t,ws)}_sceneToCubeUV(e,t,n,i,r){const c=new $t(90,1,t,n),l=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,f=u.toneMapping;u.getClearColor(mh),u.toneMapping=Gn,u.autoClear=!1,u.state.buffers.depth.getReversed()&&(u.setRenderTarget(i),u.clearDepth(),u.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new Ke(new ni,new zn({name:"PMREM.Backgroun
3679d",side:en,depthWrite:!1,depthTest:!1})));const b=this._backgroundBox,m=b.material;let p=!1;const _=e.background;_?_.isColor&&(m.color.copy(_),e.background=null,p=!0):(m.color.copy(mh),p=!0);for(let y=0;y<6;y++){const v=y%3;v===0?(c.up.set(0,l[y],0),c.position.set(r.x,r.y,r.z),c.lookAt(r.x+h[y],r.y,r.z)):v===1?(c.up.set(0,0,l[y]),c.position.set(r.x,r.y,r.z),c.lookAt(r.x,r.y+h[y],r.z)):(c.up.set(0,l[y],0),c.position.set(r.x,r.y,r.z),c.lookAt(r.x,r.y,r.z+h[y]));const T=this._cubeSize;Zi(i,v*T,y>2?T:0,T,T),u.setRenderTarget(i),p&&u.render(b,c),u.render(e,c)}u.toneMapping=f,u.autoClear=d,e.background=_}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===Ci||e.mapping===as;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=xh()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=bh());const r=i?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=r;const o=r.uniforms;o.envMap.value=e;const c=this._cubeSize;Zi(t,0,0,3*c,2*c),n.setRenderTarget(t),n.render(a,ws)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodMeshes.length;for(let r=1;r<i;r++)this._applyGGXFilter(e,r-1,r);t.autoClear=n}_applyGGXFilter(e,t,n){const i=this._renderer,r=this._pingPongRenderTarget,a=this._ggxMaterial,o=this._lodMeshes[n];o.material=a;const c=a.uniforms,l=n/(this._lodMeshes.length-1),h=t/(this._lodMeshes.length-1),u=Math.sqrt(l*l-h*h),d=0+l*1.25,f=u*d,{_lodMax:g}=this,b=this._sizeLods[n],m=3*b*(n>g-mi?n-g+mi:0),p=4*(this._cubeSize-b);c.envMap.value=e.texture,c.roughness.value=f,c.mipInt.value=g-t,Zi(r,m,p,3*b,2*b),i.setRenderTarget(r),i.render(o,ws),c.envMap.value=r.texture,c.roughness.value=0,c.mipInt.value=g-n,Zi(e,m,p,3*b,2*b),i.setRenderTarget(e),i.render(o,ws)}_blur(e,t,n,i,r){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)}_halfBlur(e,t,n,i,r,a,o){const c=this._renderer,l=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&We("blur direction must be either latitudinal or longitudinal!");const h=3,u=this._lodMeshes[i];u.material=l;const d=l.uniforms,f=this._sizeLods[n]-1,g=isFinite(r)?Math.PI/(2*f):2*Math.PI/(2*wi-1),b=r/g,m=isFinite(r)?1+Math.floor(h*b):wi;m>wi&&Ce(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${wi}`);const p=[];let _=0;for(let C=0;C<wi;++C){const x=C/b,S=Math.exp(-x*x/2);p.push(S),C===0?_+=S:C<m&&(_+=2*S)}for(let C=0;C<p.length;C++)p[C]=p[C]/_;d.envMap.value=e.texture,d.samples.value=m,d.weights.value=p,d.latitudinal.value=a==="latitudinal",o&&(d.poleAxis.value=o);const{_lodMax:y}=this;d.dTheta.value=g,d.mipInt.value=y-n;const v=this._sizeLods[i],T=3*v*(i>y-mi?i-y+mi:0),E=4*(this._cubeSize-v);Zi(t,T,E,3*v,2*v),c.setRenderTarget(t),c.render(u,ws)}}function lb(s){const e=[],t=[],n=[];let i=s;const r=s-mi+1+ph.length;for(let a=0;a<r;a++){const o=Math.pow(2,i);e.push(o);let c=1/o;a>s-mi?c=ph[a-s+mi-1]:a===0&&(c=0),t.push(c);const l=1/(o-2),h=-l,u=1+l,d=[h,h,u,h,u,u,h,h,u,u,h,u],f=6,g=6,b=3,m=2,p=1,_=new Float32Array(b*g*f),y=new Float32Array(m*g*f),v=new Float32Array(p*g*f);for(let E=0;E<f;E++){const C=E%3*2/3-1,x=E>2?0:-1,S=[C,x,0,C+2/3,x,0,C+2/3,x+1,0,C,x,0,C+2/3,x+1,0,C,x+1,0];_.set(S,b*g*E),y.set(d,m*g*E);const A=[E,E,E,E,E,E];v.set(A,p*g*E)}const T=new xt;T.setAttribute("position",new Gt(_,b)),T.setAttribute("uv",new Gt(y,m)),T.setAttribute("faceIndex",new Gt(v,p)),n.push(new Ke(T,null)),i>mi&&i--}return{lodMeshes:n,sizeLods:e,sigmas:t}}function gh(s,e,t){const n=new zt(s,e,t);return n.texture.mapping=da,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Zi(s,e,t,n,i){s.viewport.set(e,t,n,i),s.scissor.set(e,t,n,i)}function hb(s,e,t){return new Tt({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:ob,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${s}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:ga(),fragmentShader:`
3680
3681			precision highp float;
3682			precision highp int;
3683
3684			varying vec3 vOutputDirection;
3685
3686			uniform sampler2D envMap;
3687			uniform float roughness;
3688			uniform float mipInt;
3689
3690			#define ENVMAP_TYPE_CUBE_UV
3691			#include <cube_uv_reflection_fragment>
3692
3693			#define PI 3.14159265359
3694
3695			// Van der Corput radical inverse
3696			float radicalInverse_VdC(uint bits) {
3697				bits = (bits << 16u) | (bits >> 16u);
3698				bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
3699				bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
3700				bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
3701				bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
3702				return float(bits) * 2.3283064365386963e-10; // / 0x100000000
3703			}
3704
3705			// Hammersley sequence
3706			vec2 hammersley(uint i, uint N) {
3707				return vec2(float(i) / float(N), radicalInverse_VdC(i));
3708			}
3709
3710			// GGX VNDF importance sampling (Eric Heitz 2018)
3711			// "Sampling the GGX Distribution of Visible Normals"
3712			// https://jcgt.org/published/0007/04/01/
3713			vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
3714				float alpha = roughness * roughness;
3715
3716				// Section 4.1: Orthonormal basis
3717				vec3 T1 = vec3(1.0, 0.0, 0.0);
3718				vec3 T2 = cross(V, T1);
3719
3720				// Section 4.2: Parameterization of projected area
3721				float r = sqrt(Xi.x);
3722				float phi = 2.0 * PI * Xi.y;
3723				float t1 = r * cos(phi);
3724				float t2 = r * sin(phi);
3725				float s = 0.5 * (1.0 + V.z);
3726				t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
3727
3728				// Section 4.3: Reprojection onto hemisphere
3729				vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V;
3730
3731				// Section 3.4: Transform back to ellipsoid configuration
3732				return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
3733			}
3734
3735			void main() {
3736				vec3 N = normalize(vOutputDirection);
3737				vec3 V = N; // Assume view direction equals normal for pre-filtering
3738
3739				vec3 prefilteredColor = vec3(0.0);
3740				float totalWeight = 0.0;
3741
3742				// For very low roughness, just sample the environment directly
3743				if (roughness < 0.001) {
3744					gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
3745					return;
3746				}
3747
3748				// Tangent space basis for VNDF sampling
3749				vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
3750				vec3 tangent = normalize(cross(up, N));
3751				vec3 bitangent = cross(N, tangent);
3752
3753				for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
3754					vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
3755
3756					// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
3757					vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
3758
3759					// Transform H back to world space
3760					vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
3761					vec3 L = normalize(2.0 * dot(V, H) * H - V);
3762
3763					float NdotL = max(dot(N, L), 0.0);
3764
3765					if(NdotL > 0.0) {
3766						// Sample environment at fixed mip level
3767						// VNDF importance sampling handles the distribution filtering
3768						vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
3769
3770						// Weight by NdotL for the split-sum approximation
3771						// VNDF PDF naturally accounts for the visible microfacet distribution
3772						prefilteredColor += sampleColor * NdotL;
3773						totalWeight += NdotL;
3774					}
3775				}
3776
3777				if (totalWeight > 0.0) {
3778					prefilteredColor = prefilteredColor / totalWeight;
3779				}
3780
3781				gl_FragColor = vec4(prefilteredColor, 1.0);
3782			}
3783		`,blending:Xt,depthTest:!1,depthWrite:!1})}function ub(s,e,t){const n=new Float32Array(wi),i=new L(0,1,0);return new Tt({name:"SphericalGaussianBlur",defines:{n:wi,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${s}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:ga(),fragmentShader:`
3784
3785			precision mediump float;
3786			precision mediump int;
3787
3788			varying vec3 vOutputDirection;
3789
3790			uniform sampler2D envMap;
3791			uniform int samples;
3792			uniform float weights[ n ];
3793			uniform bool latitudinal;
3794			uniform float dTheta;
3795			uniform float mipInt;
3796			uniform vec3 poleAxis;
3797
3798			#define ENVMAP_TYPE_CUBE_UV
3799			#include <cube_uv_reflection_fragment>
3800
3801			vec3 getSample( float theta, vec3 axis ) {
3802
3803				float cosTheta = cos( theta );
3804				// Rodrigues' axis-angle rotation
3805				vec3 sampleDirection = vOutputDirection * cosTheta
3806					+ cross( axis, vOutputDirection ) * sin( theta )
3807					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
3808
3809				return bilinearCubeUV( envMap, sampleDirection, mipInt );
3810
3811			}
3812
3813			void main() {
3814
3815				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
3816
3817				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
3818
3819					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
3820
3821				}
3822
3823				axis = normalize( axis );
3824
3825				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
3826				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
3827
3828				for ( int i = 1; i < n; i++ ) {
3829
3830					if ( i >= samples ) {
3831
3832						break;
3833
3834					}
3835
3836					float theta = dTheta * float( i );
3837					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
3838					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
3839
3840				}
3841
3842			}
3843		`,blending:Xt,depthTest:!1,depthWrite:!1})}function bh(){return new Tt({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ga(),fragmentShader:`
3844
3845			precision mediump float;
3846			precision mediump int;
3847
3848			varying vec3 vOutputDirection;
3849
3850			uniform sampler2D envMap;
3851
3852			#include <common>
3853
3854			void main() {
3855
3856				vec3 outputDirection = normalize( vOutputDirection );
3857				vec2 uv = equirectUv( outputDirection );
3858
3859				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
3860
3861			}
3862		`,blending:Xt,depthTest:!1,depthWrite:!1})}function xh(){return new Tt({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ga(),fragmentShader:`
3863
3864			precision mediump float;
3865			precision mediump int;
3866
3867			uniform float flipEnvMap;
3868
3869			varying vec3 vOutputDirection;
3870
3871			uniform samplerCube envMap;
3872
3873			void main() {
3874
3875				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
3876
3877			}
3878		`,blending:Xt,depthTest:!1,depthWrite:!1})}function ga(){return`
3879
3880		precision mediump float;
3881		precision mediump int;
3882
3883		attribute float faceIndex;
3884
3885		varying vec3 vOutputDirection;
3886
3887		// RH coordinate system; PMREM face-indexing convention
3888		vec3 getDirection( vec2 uv, float face ) {
3889
3890			uv = 2.0 * uv - 1.0;
3891
3892			vec3 direction = vec3( uv, 1.0 );
3893
3894			if ( face == 0.0 ) {
3895
3896				direction = direction.zyx; // ( 1, v, u ) pos x
3897
3898			} else if ( face == 1.0 ) {
3899
3900				direction = direction.xzy;
3901				direction.xz *= -1.0; // ( -u, 1, -v ) pos y
3902
3903			} else if ( face == 2.0 ) {
3904
3905				direction.x *= -1.0; // ( -u, v, 1 ) pos z
3906
3907			} else if ( face == 3.0 ) {
3908
3909				direction = direction.zyx;
3910				direction.xz *= -1.0; // ( -1, v, -u ) neg x
3911
3912			} else if ( face == 4.0 ) {
3913
3914				direction = direction.xzy;
3915				direction.xy *= -1.0; // ( -u, -1, v ) neg y
3916
3917			} else if ( face == 5.0 ) {
3918
3919				direction.z *= -1.0; // ( u, v, -1 ) neg z
3920
3921			}
3922
3923			return direction;
3924
3925		}
3926
3927		void main() {
3928
3929			vOutputDirection = getDirection( uv, faceIndex );
3930			gl_Position = vec4( position, 1.0 );
3931
3932		}
3933	`}class Xc extends zt{constructor(e=1,t={}
vendor: 25,790 bytes, lines 3933-4049
3933){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},i=[n,n,n,n,n,n];this.texture=new xu(i),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:`
3934
3935				varying vec3 vWorldDirection;
3936
3937				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
3938
3939					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
3940
3941				}
3942
3943				void main() {
3944
3945					vWorldDirection = transformDirection( position, modelMatrix );
3946
3947					#include <begin_vertex>
3948					#include <project_vertex>
3949
3950				}
3951			`,fragmentShader:`
3952
3953				uniform sampler2D tEquirect;
3954
3955				varying vec3 vWorldDirection;
3956
3957				#include <common>
3958
3959				void main() {
3960
3961					vec3 direction = normalize( vWorldDirection );
3962
3963					vec2 sampleUV = equirectUv( direction );
3964
3965					gl_FragColor = texture2D( tEquirect, sampleUV );
3966
3967				}
3968			`},i=new ni(5,5,5),r=new Tt({name:"CubemapFromEquirect",uniforms:hs(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:en,blending:Xt});r.uniforms.tEquirect.value=t;const a=new Ke(i,r),o=t.minFilter;return t.minFilter===An&&(t.minFilter=Mt),new Fu(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){const r=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,i);e.setRenderTarget(r)}}function db(s){let e=new WeakMap,t=new WeakMap,n=null;function i(d,f=!1){return d==null?null:f?a(d):r(d)}function r(d){if(d&&d.isTexture){const f=d.mapping;if(f===Us||f===ya)if(e.has(d)){const g=e.get(d).texture;return o(g,d.mapping)}else{const g=d.image;if(g&&g.height>0){const b=new Xc(g.height);return b.fromEquirectangularTexture(s,d),e.set(d,b),d.addEventListener("dispose",l),o(b.texture,d.mapping)}else return null}}return d}function a(d){if(d&&d.isTexture){const f=d.mapping,g=f===Us||f===ya,b=f===Ci||f===as;if(g||b){let m=t.get(d);const p=m!==void 0?m.texture.pmremVersion:0;if(d.isRenderTargetTexture&&d.pmremVersion!==p)return n===null&&(n=new ca(s)),m=g?n.fromEquirectangular(d,m):n.fromCubemap(d,m),m.texture.pmremVersion=d.pmremVersion,t.set(d,m),m.texture;if(m!==void 0)return m.texture;{const _=d.image;return g&&_&&_.height>0||b&&_&&c(_)?(n===null&&(n=new ca(s)),m=g?n.fromEquirectangular(d):n.fromCubemap(d),m.texture.pmremVersion=d.pmremVersion,t.set(d,m),d.addEventListener("dispose",h),m.texture):null}}}return d}function o(d,f){return f===Us?d.mapping=Ci:f===ya&&(d.mapping=as),d}function c(d){let f=0;const g=6;for(let b=0;b<g;b++)d[b]!==void 0&&f++;return f===g}function l(d){const f=d.target;f.removeEventListener("dispose",l);const g=e.get(f);g!==void 0&&(e.delete(f),g.dispose())}function h(d){const f=d.target;f.removeEventListener("dispose",h);const g=t.get(f);g!==void 0&&(t.delete(f),g.dispose())}function u(){e=new WeakMap,t=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:i,dispose:u}}function fb(s){const e={};function t(n){if(e[n]!==void 0)return e[n];const i=s.getExtension(n);return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const i=t(n);return i===null&&ns("WebGLRenderer: "+n+" extension not supported."),i}}}function pb(s,e,t,n){const i={},r=new WeakMap;function a(u){const d=u.target;d.index!==null&&e.remove(d.index);for(const g in d.attributes)e.remove(d.attributes[g]);d.removeEventListener("dispose",a),delete i[d.id];const f=r.get(d);f&&(e.remove(f),r.delete(d)),n.releaseStatesOfGeometry(d),d.isInstancedBufferGeometry===!0&&delete d._maxInstanceCount,t.memory.geometries--}function o(u,d){return i[d.id]===!0||(d.addEventListener("dispose",a),i[d.id]=!0,t.memory.geometries++),d}function c(u){const d=u.attributes;for(const f in d)e.update(d[f],s.ARRAY_BUFFER)}function l(u){const d=[],f=u.index,g=u.attributes.position;let b=0;if(g===void 0)return;if(f!==null){const _=f.array;b=f.version;for(let y=0,v=_.length;y<v;y+=3){const T=_[y+0],E=_[y+1],C=_[y+2];d.push(T,E,E,C,C,T)}}else{const _=g.array;b=g.version;for(let y=0,v=_.length/3-1;y<v;y+=3){const T=y+0,E=y+1,C=y+2;d.push(T,E,E,C,C,T)}}const m=new(g.count>=65535?mu:pu)(d,1);m.version=b;const p=r.get(u);p&&e.remove(p),r.set(u,m)}function h(u){const d=r.get(u);if(d){const f=u.index;f!==null&&d.version<f.version&&l(u)}else l(u);return r.get(u)}return{get:o,update:c,getWireframeAttribute:h}}function mb(s,e,t){let n;function i(u){n=u}let r,a;function o(u){r=u.type,a=u.bytesPerElement}function c(u,d){s.drawElements(n,d,r,u*a),t.update(d,n,1)}function l(u,d,f){f!==0&&(s.drawElementsInstanced(n,d,r,u*a,f),t.update(d,n,f))}function h(u,d,f){if(f===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,d,0,r,u,0,f);let b=0;for(let m=0;m<f;m++)b+=d[m];t.update(b,n,1)}this.setMode=i,this.setIndex=o,this.render=c,this.renderInstances=l,this.renderMultiDraw=h}function gb(s){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(r,a,o){switch(t.calls++,a){case s.TRIANGLES:t.triangles+=o*(r/3);break;case s.LINES:t.lines+=o*(r/2);break;case s.LINE_STRIP:t.lines+=o*(r-1);break;case s.LINE_LOOP:t.lines+=o*r;break;case s.POINTS:t.points+=o*r;break;default:We("WebGLInfo: Unknown draw mode:",a);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:n}}function bb(s,e,t){const n=new WeakMap,i=new dt;function r(a,o,c){const l=a.morphTargetInfluences,h=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=h!==void 0?h.length:0;let d=n.get(o);if(d===void 0||d.count!==u){let S=function(){C.dispose(),n.delete(o),o.removeEventListener("dispose",S)};d!==void 0&&d.texture.dispose();const f=o.morphAttributes.position!==void 0,g=o.morphAttributes.normal!==void 0,b=o.morphAttributes.color!==void 0,m=o.morphAttributes.position||[],p=o.morphAttributes.normal||[],_=o.morphAttributes.color||[];let y=0;f===!0&&(y=1),g===!0&&(y=2),b===!0&&(y=3);let v=o.attributes.position.count*y,T=1;v>e.maxTextureSize&&(T=Math.ceil(v/e.maxTextureSize),v=e.maxTextureSize);const E=new Float32Array(v*T*4*u),C=new uu(E,v,T,u);C.type=rn,C.needsUpdate=!0;const x=y*4;for(let A=0;A<u;A++){const R=m[A],D=p[A],F=_[A],O=v*T*4*A;for(let I=0;I<R.count;I++){const B=I*x;f===!0&&(i.fromBufferAttribute(R,I),E[O+B+0]=i.x,E[O+B+1]=i.y,E[O+B+2]=i.z,E[O+B+3]=0),g===!0&&(i.fromBufferAttribute(D,I),E[O+B+4]=i.x,E[O+B+5]=i.y,E[O+B+6]=i.z,E[O+B+7]=0),b===!0&&(i.fromBufferAttribute(F,I),E[O+B+8]=i.x,E[O+B+9]=i.y,E[O+B+10]=i.z,E[O+B+11]=F.itemSize===4?i.w:1)}}d={count:u,texture:C,size:new te(v,T)},n.set(o,d),o.addEventListener("dispose",S)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)c.getUniforms().setValue(s,"morphTexture",a.morphTexture,t);else{let f=0;for(let b=0;b<l.length;b++)f+=l[b];const g=o.morphTargetsRelative?1:1-f;c.getUniforms().setValue(s,"morphTargetBaseInfluence",g),c.getUniforms().setValue(s,"morphTargetInfluences",l)}c.getUniforms().setValue(s,"morphTargetsTexture",d.texture,t),c.getUniforms().setValue(s,"morphTargetsTextureSize",d.size)}return{update:r}}function xb(s,e,t,n,i){let r=new WeakMap;function a(l){const h=i.render.frame,u=l.geometry,d=e.get(l,u);if(r.get(d)!==h&&(e.update(d),r.set(d,h)),l.isInstancedMesh&&(l.hasEventListener("dispose",c)===!1&&l.addEventListener("dispose",c),r.get(l)!==h&&(t.update(l.instanceMatrix,s.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,s.ARRAY_BUFFER),r.set(l,h))),l.isSkinnedMesh){const f=l.skeleton;r.get(f)!==h&&(f.update(),r.set(f,h))}return d}function o(){r=new WeakMap}function c(l){const h=l.target;h.removeEventListener("dispose",c),n.releaseStatesOfObject(h),t.remove(h.instanceMatrix),h.instanceColor!==null&&t.remove(h.instanceColor)}return{update:a,dispose:o}}const vb={[gc]:"LINEAR_TONE_MAPPING",[bc]:"REINHARD_TONE_MAPPING",[xc]:"CINEON_TONE_MAPPING",[vc]:"ACES_FILMIC_TONE_MAPPING",[ua]:"AGX_TONE_MAPPING",[Mc]:"NEUTRAL_TONE_MAPPING",[_c]:"CUSTOM_TONE_MAPPING"};function _b(s,e,t,n,i,r){const a=new zt(e,t,{type:s,depthBuffer:i,stencilBuffer:r,samples:n?4:0,depthTexture:i?new Di(e,t):void 0}),o=new zt(e,t,{type:Ct,depthBuffer:!1,stencilBuffer:!1}),c=new xt;c.setAttribute("position",new rt([-1,3,0,-1,-1,0,3,-1,0],3)),c.setAttribute("uv",new rt([0,2,0,0,2,0],2));const l=new Cu({uniforms:{tDiffuse:{value:null}},vertexShader:`
3969			precision highp float;
3970
3971			uniform mat4 modelViewMatrix;
3972			uniform mat4 projectionMatrix;
3973
3974			attribute vec3 position;
3975			attribute vec2 uv;
3976
3977			varying vec2 vUv;
3978
3979			void main() {
3980				vUv = uv;
3981				gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
3982			}`,fragmentShader:`
3983			precision highp float;
3984
3985			uniform sampler2D tDiffuse;
3986
3987			varying vec2 vUv;
3988
3989			#include <tonemapping_pars_fragment>
3990			#include <colorspace_pars_fragment>
3991
3992			void main() {
3993				gl_FragColor = texture2D( tDiffuse, vUv );
3994
3995				#ifdef LINEAR_TONE_MAPPING
3996					gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
3997				#elif defined( REINHARD_TONE_MAPPING )
3998					gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
3999				#elif defined( CINEON_TONE_MAPPING )
4000					gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );
4001				#elif defined( ACES_FILMIC_TONE_MAPPING )
4002					gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
4003				#elif defined( AGX_TONE_MAPPING )
4004					gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );
4005				#elif defined( NEUTRAL_TONE_MAPPING )
4006					gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
4007				#elif defined( CUSTOM_TONE_MAPPING )
4008					gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
4009				#endif
4010
4011				#ifdef SRGB_TRANSFER
4012					gl_FragColor = sRGBTransferOETF( gl_FragColor );
4013				#endif
4014			}`,depthTest:!1,depthWrite:!1}),h=new Ke(c,l),u=new ir(-1,1,1,-1,0,1);let d=null,f=null,g=!1,b,m=null,p=[],_=!1;this.setSize=function(y,v){a.setSize(y,v),o.setSize(y,v);for(let T=0;T<p.length;T++){const E=p[T];E.setSize&&E.setSize(y,v)}},this.setEffects=function(y){p=y,_=p.length>0&&p[0].isRenderPass===!0;const v=a.width,T=a.height;for(let E=0;E<p.length;E++){const C=p[E];C.setSize&&C.setSize(v,T)}},this.begin=function(y,v){if(g||y.toneMapping===Gn&&p.length===0)return!1;if(m=v,v!==null){const T=v.width,E=v.height;(a.width!==T||a.height!==E)&&this.setSize(T,E)}return _===!1&&y.setRenderTarget(a),b=y.toneMapping,y.toneMapping=Gn,!0},this.hasRenderPass=function(){return _},this.end=function(y,v){y.toneMapping=b,g=!0;let T=a,E=o;for(let C=0;C<p.length;C++){const x=p[C];if(x.enabled!==!1&&(x.render(y,E,T,v),x.needsSwap!==!1)){const S=T;T=E,E=S}}if(d!==y.outputColorSpace||f!==y.toneMapping){d=y.outputColorSpace,f=y.toneMapping,l.defines={},nt.getTransfer(d)===ct&&(l.defines.SRGB_TRANSFER="");const C=vb[f];C&&(l.defines[C]=""),l.needsUpdate=!0}l.uniforms.tDiffuse.value=T.texture,y.setRenderTarget(m),y.render(h,u),m=null,g=!1},this.isCompositing=function(){return g},this.dispose=function(){a.depthTexture&&a.depthTexture.dispose(),a.dispose(),o.dispose(),c.dispose(),l.dispose()}}const Bu=new Nt,uc=new Di(1,1),ku=new uu,zu=new Ef,Gu=new xu,vh=[],_h=[],Mh=new Float32Array(16),yh=new Float32Array(9),Sh=new Float32Array(4);function gs(s,e,t){const n=s[0];if(n<=0||n>0)return s;const i=e*t;let r=vh[i];if(r===void 0&&(r=new Float32Array(i),vh[i]=r),e!==0){n.toArray(r,0);for(let a=1,o=0;a!==e;++a)o+=t,s[a].toArray(r,o)}return r}function Vt(s,e){if(s.length!==e.length)return!1;for(let t=0,n=s.length;t<n;t++)if(s[t]!==e[t])return!1;return!0}function Ht(s,e){for(let t=0,n=e.length;t<n;t++)s[t]=e[t]}function ba(s,e){let t=_h[e];t===void 0&&(t=new Int32Array(e),_h[e]=t);for(let n=0;n!==e;++n)t[n]=s.allocateTextureUnit();return t}function Mb(s,e){const t=this.cache;t[0]!==e&&(s.uniform1f(this.addr,e),t[0]=e)}function yb(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Vt(t,e))return;s.uniform2fv(this.addr,e),Ht(t,e)}}function Sb(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(s.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Vt(t,e))return;s.uniform3fv(this.addr,e),Ht(t,e)}}function Tb(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Vt(t,e))return;s.uniform4fv(this.addr,e),Ht(t,e)}}function Eb(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(Vt(t,e))return;s.uniformMatrix2fv(this.addr,!1,e),Ht(t,e)}else{if(Vt(t,n))return;Sh.set(n),s.uniformMatrix2fv(this.addr,!1,Sh),Ht(t,n)}}function wb(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(Vt(t,e))return;s.uniformMatrix3fv(this.addr,!1,e),Ht(t,e)}else{if(Vt(t,n))return;yh.set(n),s.uniformMatrix3fv(this.addr,!1,yh),Ht(t,n)}}function Ab(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(Vt(t,e))return;s.uniformMatrix4fv(this.addr,!1,e),Ht(t,e)}else{if(Vt(t,n))return;Mh.set(n),s.uniformMatrix4fv(this.addr,!1,Mh),Ht(t,n)}}function Rb(s,e){const t=this.cache;t[0]!==e&&(s.uniform1i(this.addr,e),t[0]=e)}function Cb(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Vt(t,e))return;s.uniform2iv(this.addr,e),Ht(t,e)}}function Pb(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Vt(t,e))return;s.uniform3iv(this.addr,e),Ht(t,e)}}function Db(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Vt(t,e))return;s.uniform4iv(this.addr,e),Ht(t,e)}}function Lb(s,e){const t=this.cache;t[0]!==e&&(s.uniform1ui(this.addr,e),t[0]=e)}function Nb(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Vt(t,e))return;s.uniform2uiv(this.addr,e),Ht(t,e)}}function Ib(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Vt(t,e))return;s.uniform3uiv(this.addr,e),Ht(t,e)}}function Fb(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Vt(t,e))return;s.uniform4uiv(this.addr,e),Ht(t,e)}}function Ub(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i);let r;this.type===s.SAMPLER_2D_SHADOW?(uc.compareFunction=t.isReversedDepthBuffer()?Pc:Cc,r=uc):r=Bu,t.setTexture2D(e||r,i)}function Ob(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||zu,i)}function Bb(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||Gu,i)}function kb(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||ku,i)}function zb(s){switch(s){case 5126:return Mb;case 35664:return yb;case 35665:return Sb;case 35666:return Tb;case 35674:return Eb;case 35675:return wb;case 35676:return Ab;case 5124:case 35670:return Rb;case 35667:case 35671:return Cb;case 35668:case 35672:return Pb;case 35669:case 35673:return Db;case 5125:return Lb;case 36294:return Nb;case 36295:return Ib;case 36296:return Fb;case 35678:case 36198:case 36298:case 36306:case 35682:return Ub;case 35679:case 36299:case 36307:return Ob;case 35680:case 36300:case 36308:case 36293:return Bb;case 36289:case 36303:case 36311:case 36292:return kb}}function Gb(s,e){s.uniform1fv(this.addr,e)}function Vb(s,e){const t=gs(e,this.size,2);s.uniform2fv(this.addr,t)}function Hb(s,e){const t=gs(e,this.size,3);s.uniform3fv(this.addr,t)}function Wb(s,e){const t=gs(e,this.size,4);s.uniform4fv(this.addr,t)}function Xb(s,e){const t=gs(e,this.size,4);s.uniformMatrix2fv(this.addr,!1,t)}function qb(s,e){const t=gs(e,this.size,9);s.uniformMatrix3fv(this.addr,!1,t)}function jb(s,e){const t=gs(e,this.size,16);s.uniformMatrix4fv(this.addr,!1,t)}function Kb(s,e){s.uniform1iv(this.addr,e)}function Yb(s,e){s.uniform2iv(this.addr,e)}function Jb(s,e){s.uniform3iv(this.addr,e)}function Zb(s,e){s.uniform4iv(this.addr,e)}function Qb(s,e){s.uniform1uiv(this.addr,e)}function $b(s,e){s.uniform2uiv(this.addr,e)}function ex(s,e){s.uniform3uiv(this.addr,e)}function tx(s,e){s.uniform4uiv(this.addr,e)}function nx(s,e,t){const n=this.cache,i=e.length,r=ba(t,i);Vt(n,r)||(s.uniform1iv(this.addr,r),Ht(n,r));let a;this.type===s.SAMPLER_2D_SHADOW?a=uc:a=Bu;for(let o=0;o!==i;++o)t.setTexture2D(e[o]||a,r[o])}function ix(s,e,t){const n=this.cache,i=e.length,r=ba(t,i);Vt(n,r)||(s.uniform1iv(this.addr,r),Ht(n,r));for(let a=0;a!==i;++a)t.setTexture3D(e[a]||zu,r[a])}function sx(s,e,t){const n=this.cache,i=e.length,r=ba(t,i);Vt(n,r)||(s.uniform1iv(this.addr,r),Ht(n,r));for(let a=0;a!==i;++a)t.setTextureCube(e[a]||Gu,r[a])}function rx(s,e,t){const n=this.cache,i=e.length,r=ba(t,i);Vt(n,r)||(s.uniform1iv(this.addr,r),Ht(n,r));for(let a=0;a!==i;++a)t.setTexture2DArray(e[a]||ku,r[a])}function ax(s){switch(s){case 5126:return Gb;case 35664:return Vb;case 35665:return Hb;case 35666:return Wb;case 35674:return Xb;case 35675:return qb;case 35676:return jb;case 5124:case 35670:return Kb;case 35667:case 35671:return Yb;case 35668:case 35672:return Jb;case 35669:case 35673:return Zb;case 5125:return Qb;case 36294:return $b;case 36295:return ex;case 36296:return tx;case 35678:case 36198:case 36298:case 36306:case 35682:return nx;case 35679:case 36299:case 36307:return ix;case 35680:case 36300:case 36308:case 36293:return sx;case 36289:case 36303:case 36311:case 36292:return rx}}class ox{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=zb(t.type)}}class cx{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=ax(t.type)}}class lx{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let r=0,a=i.length;r!==a;++r){const o=i[r];o.setValue(e,t[o.id],n)}}}const so=/(\w+)(\])?(\[|\.)?/g;function Th(s,e){s.seq.push(e),s.map[e.id]=e}function hx(s,e,t){const n=s.name,i=n.length;for(so.lastIndex=0;;){const r=so.exec(n),a=so.lastIndex;let o=r[1];const c=r[2]==="]",l=r[3];if(c&&(o=o|0),l===void 0||l==="["&&a+2===i){Th(t,l===void 0?new ox(o,s,e):new cx(o,s,e));break}else{let u=t.map[o];u===void 0&&(u=new lx(o),Th(t,u)),t=u}}}class Zr{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let a=0;a<n;++a){const o=e.getActiveUniform(t,a),c=e.getUniformLocation(t,o.name);hx(o,c,this)}const i=[],r=[];for(const a of this.seq)a.type===e.SAMPLER_2D_SHADOW||a.type===e.SAMPLER_CUBE_SHADOW||a.type===e.SAMPLER_2D_ARRAY_SHADOW?i.push(a):r.push(a);i.length>0&&(this.seq=i.concat(r))}setValue(e,t,n,i){const r=this.map[t];r!==void 0&&r.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];i!==void 0&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let r=0,a=t.length;r!==a;++r){const o=t[r],c=n[o.id];c.needsUpdate!==!1&&o.setValue(e,c.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,r=e.length;i!==r;++i){const a=e[i];a.id in t&&n.push(a)}return n}}function Eh(s,e,t){const n=s.createShader(e);return s.shaderSource(n,t),s.compileShader(n),n}const ux=37297;let dx=0;function fx(s,e){const t=s.split(`
4015`),n=[],i=Math.max(e-6,0),r=Math.min(e+6,t.length);for(let a=i;a<r;a++){const o=a+1;n.push(`${o===e?">":" "} ${o}: ${t[a]}`)}return n.join(`
4016`)}const wh=new Je;function px(s){nt._getMatrix(wh,nt.workingColorSpace,s);const e=`mat3( ${wh.elements.map(t=>t.toFixed(4))} )`;switch(nt.getTransfer(s)){case na:return[e,"LinearTransferOETF"];case ct:return[e,"sRGBTransferOETF"];default:return Ce("WebGLProgram: Unsupported color space: ",s),[e,"LinearTransferOETF"]}}function Ah(s,e,t){const n=s.getShaderParameter(e,s.COMPILE_STATUS),r=(s.getShaderInfoLog(e)||"").trim();if(n&&r==="")return"";const a=/ERROR: 0:(\d+)/.exec(r);if(a){const o=parseInt(a[1]);return t.toUpperCase()+`
4017
4018`+r+`
4019
4020`+fx(s.getShaderSource(e),o)}else return r}function mx(s,e){const t=px(e);return[`vec4 ${s}( vec4 value ) {`,`	return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`
4021`)}const gx={[gc]:"Linear",[bc]:"Reinhard",[xc]:"Cineon",[vc]:"ACESFilmic",[ua]:"AgX",[Mc]:"Neutral",[_c]:"Custom"};function bx(s,e){const t=gx[e];return t===void 0?(Ce("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+s+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+s+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Ur=new L;function xx(){nt.getLuminanceCoefficients(Ur);const s=Ur.x.toFixed(4),e=Ur.y.toFixed(4),t=Ur.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",`	const vec3 weights = vec3( ${s}, ${e}, ${t} );`,"	return dot( weights, rgb );","}"].join(`
4022`)}function vx(s){return[s.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",s.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Fs).join(`
4023`)}function _x(s){const e=[];for(const t in s){const n=s[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
4024`)}function Mx(s,e){const t={},n=s.getProgramParameter(e,s.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const r=s.getActiveAttrib(e,i),a=r.name;let o=1;r.type===s.FLOAT_MAT2&&(o=2),r.type===s.FLOAT_MAT3&&(o=3),r.type===s.FLOAT_MAT4&&(o=4),t[a]={type:r.type,location:s.getAttribLocation(e,a),locationSize:o}}return t}function Fs(s){return s!==""}function Rh(s,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return s.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,t).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 Ch(s,e){return s.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const yx=/^[ \t]*#include +<([\w\d./]+)>/gm;function dc(s){return s.replace(yx,Tx)}const Sx=new Map;function Tx(s,e){let t=et[e];if(t===void 0){const n=Sx.get(e);if(n!==void 0)t=et[n],Ce('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("THREE.WebGLProgram: Can not resolve #include <"+e+">")}return dc(t)}const Ex=/#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 Ph(s){return s.replace(Ex,wx)}function wx(s,e,t,n){let i="";for(let r=parseInt(e);r<parseInt(t);r++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+r+" ]").replace(/UNROLLED_LOOP_INDEX/g,r);return i}function Dh(s){let e=`precision ${s.precision} float;
4025	precision ${s.precision} int;
4026	precision ${s.precision} sampler2D;
4027	precision ${s.precision} samplerCube;
4028	precision ${s.precision} sampler3D;
4029	precision ${s.precision} sampler2DArray;
4030	precision ${s.precision} sampler2DShadow;
4031	precision ${s.precision} samplerCubeShadow;
4032	precision ${s.precision} sampler2DArrayShadow;
4033	precision ${s.precision} isampler2D;
4034	precision ${s.precision} isampler3D;
4035	precision ${s.precision} isamplerCube;
4036	precision ${s.precision} isampler2DArray;
4037	precision ${s.precision} usampler2D;
4038	precision ${s.precision} usampler3D;
4039	precision ${s.precision} usamplerCube;
4040	precision ${s.precision} usampler2DArray;
4041	`;return s.precision==="highp"?e+=`
4042#define HIGH_PRECISION`:s.precision==="mediump"?e+=`
4043#define MEDIUM_PRECISION`:s.precision==="lowp"&&(e+=`
4044#define LOW_PRECISION`),e}const Ax={[Xr]:"SHADOWMAP_TYPE_PCF",[Ps]:"SHADOWMAP_TYPE_VSM"};function Rx(s){return Ax[s.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const Cx={[Ci]:"ENVMAP_TYPE_CUBE",[as]:"ENVMAP_TYPE_CUBE",[da]:"ENVMAP_TYPE_CUBE_UV"};function Px(s){return s.envMap===!1?"ENVMAP_TYPE_CUBE":Cx[s.envMapMode]||"ENVMAP_TYPE_CUBE"}const Dx={[as]:"ENVMAP_MODE_REFRACTION"};function Lx(s){return s.envMap===!1?"ENVMAP_MODE_REFLECTION":Dx[s.envMapMode]||"ENVMAP_MODE_REFLECTION"}const Nx={[eu]:"ENVMAP_BLENDING_MULTIPLY",[kd]:"ENVMAP_BLENDING_MIX",[zd]:"ENVMAP_BLENDING_ADD"};function Ix(s){return s.envMap===!1?"ENVMAP_BLENDING_NONE":Nx[s.combine]||"ENVMAP_BLENDING_NONE"}function Fx(s){const e=s.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:n,maxMip:t}}function Ux(s,e,t,n){const i=s.getContext(),r=t.defines;let a=t.vertexShader,o=t.fragmentShader;const c=Rx(t),l=Px(t),h=Lx(t),u=Ix(t),d=Fx(t),f=vx(t),g=_x(r),b=i.createProgram();let m,p,_=t.glslVersion?"#version "+t.glslVersion+`
4045`:"";t.isRawShaderMaterial?(m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(Fs).join(`
4046`),m.length>0&&(m+=`
4047`),p=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(Fs).join(`
4048`),p.length>0&&(p+=`
4049`)):(m=[Dh(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.extensionCl
vendor: 6,566 bytes, lines 4049-4051
4049ipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexNormals?"#define HAS_NORMAL":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","	attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","	attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","	uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","	attribute vec2 uv1;","#endif","#ifdef USE_UV2","	attribute vec2 uv2;","#endif","#ifdef USE_UV3","	attribute vec2 uv3;","#endif","#ifdef USE_TANGENT","	attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","	attribute vec4 color;","#elif defined( USE_COLOR )","	attribute vec3 color;","#endif","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif",`
4050`].filter(Fs).join(`
4051`),p=[Dh(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+l:"",t.envMap?"#define "+h:"",t.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":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.packedNormalMap?"#define USE_PACKED_NORMALMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IR
4051IDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas||t.batchingColor?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.numLightProbeGrids>0?"#define USE_LIGHT_PROBES_GRID":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Gn?"#define TONE_MAPPING":"",t.toneMapping!==Gn?et.tonemapping_pars_fragment:"",t.toneMapping!==Gn?bx("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",et.colorspace_pars_fragment,mx("linearToOutputTexel",t.outputColorSpace),xx(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
4052`].filter(Fs).join(`
4053`)),a=dc(a),a=Rh(a,t),a=Ch(a,t),o=dc(o),o=Rh(o,t),o=Ch(o,t),a=Ph(a),o=Ph(o),t.isRawShaderMaterial!==!0&&(_=`#version 300 es
4054`,m=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(`
4055`)+`
4056`+m,p=["#define varying in",t.glslVersion===_l?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===_l?"":"#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(`
4057`)+`
4058`+p);const y=_+m+a,v=_+p+o,T=Eh(i,i.VERTEX_SHADER,y),E=Eh(i,i.FRAGMENT_SHADER,v);i.attachShader(b,T),i.attachShader(b,E),t.index0AttributeName!==void 0?i.bindAttribLocation(b,0,t.index0AttributeName):t.hasPositionAttribute===!0&&i.bindAttribLocation(b,0,"position"),i.linkProgram(b);function C(R){if(s.debug.checkShaderErrors){const D=i.getProgramInfoLog(b)||"",F=i.getShaderInfoLog(T)||"",O=i.getShaderInfoLog(E)||"",I=D.trim(),B=F.trim(),G=O.trim();let j=!0,Y=!0;if(i.getProgramParameter(b,i.LINK_STATUS)===!1)if(j=!1,typeof s.debug.onShaderError=="function")s.debug.onShaderError(i,b,T,E);else{const ne=Ah(i,T,"vertex"),oe=Ah(i,E,"fragment");We("WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(b,i.VALIDATE_STATUS)+`
4059
4060Material Name: `+R.name+`
4061Material Type: `+R.type+`
4062
4063Program Info Log: `+I+`
4064`+ne+`
4065`+oe)}else I!==""?Ce("WebGLProgram: Program Info Log:",I):(B===""||G==="")&&(Y=!1);Y&&(R.diagnostics={runnable:j,programLog:I,vertexShader:{log:B,prefix:m},fragmentShader:{log:G,prefix:p}})}i.deleteShader(T),i.deleteShader(E),x=new Zr(i,b),S=Mx(i,b)}let x;this.getUniforms=function(){return x===void 0&&C(this),x};let S;this.getAttributes=function(){return S===void 0&&C(this),S};let A=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return A===!1&&(A=i.getProgramParameter(b,ux)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(b),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=dx++,this.cacheKey=e,this.usedTimes=1,this.program=b,this.vertexShader=T,this.fragmentShader=E,this}let Ox=0;class Bx{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,t,n){const i=this._getShaderCacheForMaterial(e);return i.has(t)===!1&&(i.add(t),t.usedTimes++),i.has(n)===!1&&(i.add(n),n.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new kx(e),t.set(e,n)),n}}class kx{constructor(e){this.id=Ox++,this.code=e,this.usedTimes=0}}function zx(s){return s===Pi||s===$r||s===ea}function Gx(s,e,t,n,i,r){const a=new du,o=new Bx,c=new Set,l=[],h=new Map,u=n.logarithmicDepthBuffer;let d=n.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(x){return c.add(x),x===0?"uv":`uv${x}`}function b(x,S,A,R,D,F){const O=R.fog,I=D.geometry,B=x.isMeshStandardMaterial||x.isMeshLambertMaterial||x.isMeshPhongMaterial?R.environment:null,G=x.isMeshStandardMaterial||x.isMeshLambertMaterial&&!x.envMap||x.isMeshPhongMaterial&&!x.envMap,j=e.get(x.envMap||B,G),Y=j&&j.mapping===da?j.image.height:null,ne=f[x.type];x.precision!==null&&(d=n.getMaxPrecision(x.precision),d!==x.precision&&Ce("WebGLProgram.getParameters:",x.precision,"not supported, using",d,"instead."));const oe=I.morphAttributes.position||I.morphAttributes.normal||I.morphAttributes.color,ce=oe!==void 0?oe.length:0;let Ee=0;I.morphAttributes.position!==void 0&&(Ee=1),I.morphAttributes.normal!==void 0&&(Ee=2),I.morphAttributes.color!==void 0&&(Ee=3);let je,Ve,k,ee;if(ne){const Re=Bn[ne];je=Re.vertexShader,Ve=Re.fragmentShader}else{je=x.vertexShader,Ve=x.fragmentShader;const Re=o.getVertexShaderStage(x),Pt=o.getFragmentShaderStage(x);o.update(x,Re,Pt),k=Re.id,ee=Pt.id}const Q=s.getRenderTarget(),Se=s.state.buffers.depth.getReversed(),Le=D.isInstancedMesh===!0,Ie=D.isBatchedMesh===!0,st=!!x.map,He=!!x.matcap,ie=!!j,ae=!!x.aoMap,re=!!x.lightMap,be=!!x.bumpMap&&x.wireframe===!1,pe=!!x.normalMap,ke=!!x.displacementMap,Ae=!!x.emissiveMap,Ge=!!x.metalnessMap,Xe=!!x.roughnessMap,N=x.anisotropy>0,ot=x.clearcoat>0,$e=x.dispersion>0,P=x.iridescence>0,M=x.sheen>0,V=x.transmission>0,H=N&&!!x.anisotropyMap,K=ot&&!!x.clearcoatMap,he=ot&&!!x.clearcoatNormalMap,ue=ot&&!!x.clearcoatRoughnessMap,J=P&&!!x.iridescenceMap,Z=P&&!!x.iridescenceThicknessMap,me=M&&!!x.sheenColorMap,Ne=M&&!!x.sheenRoughnessMap,fe=!!x.specularMap,de=!!x.specularColorMap,Pe=!!x.specularIntensityMap,Oe=V&&!!x.transmissionMap,qe=V&&!!x.thicknessMap,U=!!x.gradientMap,ge=!!x.alphaMap,$=x.alph
vendor: 4,433 bytes, line 4065
4065aTest>0,xe=!!x.alphaHash,ye=!!x.extensions;let se=Gn;x.toneMapped&&(Q===null||Q.isXRRenderTarget===!0)&&(se=s.toneMapping);const Fe={shaderID:ne,shaderType:x.type,shaderName:x.name,vertexShader:je,fragmentShader:Ve,defines:x.defines,customVertexShaderID:k,customFragmentShaderID:ee,isRawShaderMaterial:x.isRawShaderMaterial===!0,glslVersion:x.glslVersion,precision:d,batching:Ie,batchingColor:Ie&&D._colorsTexture!==null,instancing:Le,instancingColor:Le&&D.instanceColor!==null,instancingMorph:Le&&D.morphTexture!==null,outputColorSpace:Q===null?s.outputColorSpace:Q.isXRRenderTarget===!0?Q.texture.colorSpace:nt.workingColorSpace,alphaToCoverage:!!x.alphaToCoverage,map:st,matcap:He,envMap:ie,envMapMode:ie&&j.mapping,envMapCubeUVHeight:Y,aoMap:ae,lightMap:re,bumpMap:be,normalMap:pe,displacementMap:ke,emissiveMap:Ae,normalMapObjectSpace:pe&&x.normalMapType===Xd,normalMapTangentSpace:pe&&x.normalMapType===ta,packedNormalMap:pe&&x.normalMapType===ta&&zx(x.normalMap.format),metalnessMap:Ge,roughnessMap:Xe,anisotropy:N,anisotropyMap:H,clearcoat:ot,clearcoatMap:K,clearcoatNormalMap:he,clearcoatRoughnessMap:ue,dispersion:$e,iridescence:P,iridescenceMap:J,iridescenceThicknessMap:Z,sheen:M,sheenColorMap:me,sheenRoughnessMap:Ne,specularMap:fe,specularColorMap:de,specularIntensityMap:Pe,transmission:V,transmissionMap:Oe,thicknessMap:qe,gradientMap:U,opaque:x.transparent===!1&&x.blending===ts&&x.alphaToCoverage===!1,alphaMap:ge,alphaTest:$,alphaHash:xe,combine:x.combine,mapUv:st&&g(x.map.channel),aoMapUv:ae&&g(x.aoMap.channel),lightMapUv:re&&g(x.lightMap.channel),bumpMapUv:be&&g(x.bumpMap.channel),normalMapUv:pe&&g(x.normalMap.channel),displacementMapUv:ke&&g(x.displacementMap.channel),emissiveMapUv:Ae&&g(x.emissiveMap.channel),metalnessMapUv:Ge&&g(x.metalnessMap.channel),roughnessMapUv:Xe&&g(x.roughnessMap.channel),anisotropyMapUv:H&&g(x.anisotropyMap.channel),clearcoatMapUv:K&&g(x.clearcoatMap.channel),clearcoatNormalMapUv:he&&g(x.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ue&&g(x.clearcoatRoughnessMap.channel),iridescenceMapUv:J&&g(x.iridescenceMap.channel),iridescenceThicknessMapUv:Z&&g(x.iridescenceThicknessMap.channel),sheenColorMapUv:me&&g(x.sheenColorMap.channel),sheenRoughnessMapUv:Ne&&g(x.sheenRoughnessMap.channel),specularMapUv:fe&&g(x.specularMap.channel),specularColorMapUv:de&&g(x.specularColorMap.channel),specularIntensityMapUv:Pe&&g(x.specularIntensityMap.channel),transmissionMapUv:Oe&&g(x.transmissionMap.channel),thicknessMapUv:qe&&g(x.thicknessMap.channel),alphaMapUv:ge&&g(x.alphaMap.channel),vertexTangents:!!I.attributes.tangent&&(pe||N),vertexNormals:!!I.attributes.normal,vertexColors:x.vertexColors,vertexAlphas:x.vertexColors===!0&&!!I.attributes.color&&I.attributes.color.itemSize===4,pointsUvs:D.isPoints===!0&&!!I.attributes.uv&&(st||ge),fog:!!O,useFog:x.fog===!0,fogExp2:!!O&&O.isFogExp2,flatShading:x.wireframe===!1&&(x.flatShading===!0||I.attributes.normal===void 0&&pe===!1&&(x.isMeshLambertMaterial||x.isMeshPhongMaterial||x.isMeshStandardMaterial||x.isMeshPhysicalMaterial)),sizeAttenuation:x.sizeAttenuation===!0,logarithmicDepthBuffer:u,reversedDepthBuffer:Se,skinning:D.isSkinnedMesh===!0,hasPositionAttribute:I.attributes.position!==void 0,morphTargets:I.morphAttributes.position!==void 0,morphNormals:I.morphAttributes.normal!==void 0,morphColors:I.morphAttributes.color!==void 0,morphTargetsCount:ce,morphTextureStride:Ee,numDirLights:S.directional.length,numPointLights:S.point.length,numSpotLights:S.spot.length,numSpotLightMaps:S.spotLightMap.length,numRectAreaLights:S.rectArea.length,numHemiLights:S.hemi.length,numDirLightShadows:S.directionalShadowMap.length,numPointLightShadows:S.pointShadowMap.length,numSpotLightShadows:S.spotShadowMap.length,numSpotLightShadowsWithMaps:S.numSpotLightShadowsWithMaps,numLightProbes:S.numLightProbes,numLightProbeGrids:F.length,numClippingPlanes:r.numPlanes,numClipIntersection:r.numIntersection,dithering:x.dithering,shadowMapEnabled:s.shadowMap.enabled&&A.length>0,shadowMapType:s.shadowMap.type,toneMapping:se,decodeVideoTexture:st&&x.map.isVideoTexture===!0&&nt.getTransfer(x.map.colorSpace)===ct,decodeVideoTextureEmissive:Ae&&x.emissiveMap.isVideoTexture===!0&&nt.getTransfer(x.emissiveMap.colorSpace)===ct,premultipliedAlpha:x.premultipliedAlpha,doubleSided:x.side===Yt,flipSided:x.side===en,useDepthPacking:x.depthPacking>=0,depthPacking:x.depthPacking||0,index0AttributeName:x.index0AttributeName,extensionCl
vendor: 14,412 bytes, lines 4065-4092
4065ipCullDistance:ye&&x.extensions.clipCullDistance===!0&&t.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ye&&x.extensions.multiDraw===!0||Ie)&&t.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:t.has("KHR_parallel_shader_compile"),customProgramCacheKey:x.customProgramCacheKey()};return Fe.vertexUv1s=c.has(1),Fe.vertexUv2s=c.has(2),Fe.vertexUv3s=c.has(3),c.clear(),Fe}function m(x){const S=[];if(x.shaderID?S.push(x.shaderID):(S.push(x.customVertexShaderID),S.push(x.customFragmentShaderID)),x.defines!==void 0)for(const A in x.defines)S.push(A),S.push(x.defines[A]);return x.isRawShaderMaterial===!1&&(p(S,x),_(S,x),S.push(s.outputColorSpace)),S.push(x.customProgramCacheKey),S.join()}function p(x,S){x.push(S.precision),x.push(S.outputColorSpace),x.push(S.envMapMode),x.push(S.envMapCubeUVHeight),x.push(S.mapUv),x.push(S.alphaMapUv),x.push(S.lightMapUv),x.push(S.aoMapUv),x.push(S.bumpMapUv),x.push(S.normalMapUv),x.push(S.displacementMapUv),x.push(S.emissiveMapUv),x.push(S.metalnessMapUv),x.push(S.roughnessMapUv),x.push(S.anisotropyMapUv),x.push(S.clearcoatMapUv),x.push(S.clearcoatNormalMapUv),x.push(S.clearcoatRoughnessMapUv),x.push(S.iridescenceMapUv),x.push(S.iridescenceThicknessMapUv),x.push(S.sheenColorMapUv),x.push(S.sheenRoughnessMapUv),x.push(S.specularMapUv),x.push(S.specularColorMapUv),x.push(S.specularIntensityMapUv),x.push(S.transmissionMapUv),x.push(S.thicknessMapUv),x.push(S.combine),x.push(S.fogExp2),x.push(S.sizeAttenuation),x.push(S.morphTargetsCount),x.push(S.morphAttributeCount),x.push(S.numDirLights),x.push(S.numPointLights),x.push(S.numSpotLights),x.push(S.numSpotLightMaps),x.push(S.numHemiLights),x.push(S.numRectAreaLights),x.push(S.numDirLightShadows),x.push(S.numPointLightShadows),x.push(S.numSpotLightShadows),x.push(S.numSpotLightShadowsWithMaps),x.push(S.numLightProbes),x.push(S.shadowMapType),x.push(S.toneMapping),x.push(S.numClippingPlanes),x.push(S.numClipIntersection),x.push(S.depthPacking)}function _(x,S){a.disableAll(),S.instancing&&a.enable(0),S.instancingColor&&a.enable(1),S.instancingMorph&&a.enable(2),S.matcap&&a.enable(3),S.envMap&&a.enable(4),S.normalMapObjectSpace&&a.enable(5),S.normalMapTangentSpace&&a.enable(6),S.clearcoat&&a.enable(7),S.iridescence&&a.enable(8),S.alphaTest&&a.enable(9),S.vertexColors&&a.enable(10),S.vertexAlphas&&a.enable(11),S.vertexUv1s&&a.enable(12),S.vertexUv2s&&a.enable(13),S.vertexUv3s&&a.enable(14),S.vertexTangents&&a.enable(15),S.anisotropy&&a.enable(16),S.alphaHash&&a.enable(17),S.batching&&a.enable(18),S.dispersion&&a.enable(19),S.batchingColor&&a.enable(20),S.gradientMap&&a.enable(21),S.packedNormalMap&&a.enable(22),S.vertexNormals&&a.enable(23),x.push(a.mask),a.disableAll(),S.fog&&a.enable(0),S.useFog&&a.enable(1),S.flatShading&&a.enable(2),S.logarithmicDepthBuffer&&a.enable(3),S.reversedDepthBuffer&&a.enable(4),S.skinning&&a.enable(5),S.morphTargets&&a.enable(6),S.morphNormals&&a.enable(7),S.morphColors&&a.enable(8),S.premultipliedAlpha&&a.enable(9),S.shadowMapEnabled&&a.enable(10),S.doubleSided&&a.enable(11),S.flipSided&&a.enable(12),S.useDepthPacking&&a.enable(13),S.dithering&&a.enable(14),S.transmission&&a.enable(15),S.sheen&&a.enable(16),S.opaque&&a.enable(17),S.pointsUvs&&a.enable(18),S.decodeVideoTexture&&a.enable(19),S.decodeVideoTextureEmissive&&a.enable(20),S.alphaToCoverage&&a.enable(21),S.numLightProbeGrids>0&&a.enable(22),S.hasPositionAttribute&&a.enable(23),x.push(a.mask)}function y(x){const S=f[x.type];let A;if(S){const R=Bn[S];A=sn.clone(R.uniforms)}else A=x.uniforms;return A}function v(x,S){let A=h.get(S);return A!==void 0?++A.usedTimes:(A=new Ux(s,S,x,i),l.push(A),h.set(S,A)),A}function T(x){if(--x.usedTimes===0){const S=l.indexOf(x);l[S]=l[l.length-1],l.pop(),h.delete(x.cacheKey),x.destroy()}}function E(x){o.remove(x)}function C(){o.dispose()}return{getParameters:b,getProgramCacheKey:m,getUniforms:y,acquireProgram:v,releaseProgram:T,releaseShaderCache:E,programs:l,dispose:C}}function Vx(){let s=new WeakMap;function e(a){return s.has(a)}function t(a){let o=s.get(a);return o===void 0&&(o={},s.set(a,o)),o}function n(a){s.delete(a)}function i(a,o,c){s.get(a)[o]=c}function r(){s=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:r}}function Hx(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.material.id!==e.material.id?s.material.id-e.material.id:s.materialVariant!==e.materialVariant?s.materialVariant-e.materialVariant:s.z!==e.z?s.z-e.z:s.id-e.id}function Lh(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.z!==e.z?e.z-s.z:s.id-e.id}function Nh(){const s=[];let e=0;const t=[],n=[],i=[];function r(){e=0,t.length=0,n.length=0,i.length=0}function a(d){let f=0;return d.isInstancedMesh&&(f+=2),d.isSkinnedMesh&&(f+=1),f}function o(d,f,g,b,m,p){let _=s[e];return _===void 0?(_={id:d.id,object:d,geometry:f,material:g,materialVariant:a(d),groupOrder:b,renderOrder:d.renderOrder,z:m,group:p},s[e]=_):(_.id=d.id,_.object=d,_.geometry=f,_.material=g,_.materialVariant=a(d),_.groupOrder=b,_.renderOrder=d.renderOrder,_.z=m,_.group=p),e++,_}function c(d,f,g,b,m,p){const _=o(d,f,g,b,m,p);g.transmission>0?n.push(_):g.transparent===!0?i.push(_):t.push(_)}function l(d,f,g,b,m,p){const _=o(d,f,g,b,m,p);g.transmission>0?n.unshift(_):g.transparent===!0?i.unshift(_):t.unshift(_)}function h(d,f,g){t.length>1&&t.sort(d||Hx),n.length>1&&n.sort(f||Lh),i.length>1&&i.sort(f||Lh),g&&(t.reverse(),n.reverse(),i.reverse())}function u(){for(let d=e,f=s.length;d<f;d++){const g=s[d];if(g.id===null)break;g.id=null,g.object=null,g.geometry=null,g.material=null,g.group=null}}return{opaque:t,transmissive:n,transparent:i,init:r,push:c,unshift:l,finish:u,sort:h}}function Wx(){let s=new WeakMap;function e(n,i){const r=s.get(n);let a;return r===void 0?(a=new Nh,s.set(n,[a])):i>=r.length?(a=new Nh,r.push(a)):a=r[i],a}function t(){s=new WeakMap}return{get:e,dispose:t}}function Xx(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new L,color:new ze};break;case"SpotLight":t={position:new L,direction:new L,color:new ze,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new L,color:new ze,distance:0,decay:0};break;case"HemisphereLight":t={direction:new L,skyColor:new ze,groundColor:new ze};break;case"RectAreaLight":t={color:new ze,position:new L,halfWidth:new L,halfHeight:new L};break}return s[e.id]=t,t}}}function qx(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new te};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new te};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new te,shadowCameraNear:1,shadowCameraFar:1e3};break}return s[e.id]=t,t}}}let jx=0;function Kx(s,e){return(e.castShadow?2:0)-(s.castShadow?2:0)+(e.map?1:0)-(s.map?1:0)}function Yx(s){const e=new Xx,t=qx(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let l=0;l<9;l++)n.probe.push(new L);const i=new L,r=new Ye,a=new Ye;function o(l){let h=0,u=0,d=0;for(let S=0;S<9;S++)n.probe[S].set(0,0,0);let f=0,g=0,b=0,m=0,p=0,_=0,y=0,v=0,T=0,E=0,C=0;l.sort(Kx);for(let S=0,A=l.length;S<A;S++){const R=l[S],D=R.color,F=R.intensity,O=R.distance;let I=null;if(R.shadow&&R.shadow.map&&(R.shadow.map.texture.format===Pi?I=R.shadow.map.texture:I=R.shadow.map.depthTexture||R.shadow.map.texture),R.isAmbientLight)h+=D.r*F,u+=D.g*F,d+=D.b*F;else if(R.isLightProbe){for(let B=0;B<9;B++)n.probe[B].addScaledVector(R.sh.coefficients[B],F);C++}else if(R.isDirectionalLight){const B=e.get(R);if(B.color.copy(R.color).multiplyScalar(R.intensity),R.castShadow){const G=R.shadow,j=t.get(R);j.shadowIntensity=G.intensity,j.shadowBias=G.bias,j.shadowNormalBias=G.normalBias,j.shadowRadius=G.radius,j.shadowMapSize=G.mapSize,n.directionalShadow[f]=j,n.directionalShadowMap[f]=I,n.directionalShadowMatrix[f]=R.shadow.matrix,_++}n.directional[f]=B,f++}else if(R.isSpotLight){const B=e.get(R);B.position.setFromMatrixPosition(R.matrixWorld),B.color.copy(D).multiplyScalar(F),B.distance=O,B.coneCos=Math.cos(R.angle),B.penumbraCos=Math.cos(R.angle*(1-R.penumbra)),B.decay=R.decay,n.spot[b]=B;const G=R.shadow;if(R.map&&(n.spotLightMap[T]=R.map,T++,G.updateMatrices(R),R.castShadow&&E++),n.spotLightMatrix[b]=G.matrix,R.castShadow){const j=t.get(R);j.shadowIntensity=G.intensity,j.shadowBias=G.bias,j.shadowNormalBias=G.normalBias,j.shadowRadius=G.radius,j.shadowMapSize=G.mapSize,n.spotShadow[b]=j,n.spotShadowMap[b]=I,v++}b++}else if(R.isRectAreaLight){const B=e.get(R);B.color.copy(D).multiplyScalar(F),B.halfWidth.set(R.width*.5,0,0),B.halfHeight.set(0,R.height*.5,0),n.rectArea[m]=B,m++}else if(R.isPointLight){const B=e.get(R);if(B.color.copy(R.color).multiplyScalar(R.intensity),B.distance=R.distance,B.decay=R.decay,R.castShadow){const G=R.shadow,j=t.get(R);j.shadowIntensity=G.intensity,j.shadowBias=G.bias,j.shadowNormalBias=G.normalBias,j.shadowRadius=G.radius,j.shadowMapSize=G.mapSize,j.shadowCameraNear=G.camera.near,j.shadowCameraFar=G.camera.far,n.pointShadow[g]=j,n.pointShadowMap[g]=I,n.pointShadowMatrix[g]=R.shadow.matrix,y++}n.point[g]=B,g++}else if(R.isHemisphereLight){const B=e.get(R);B.skyColor.copy(R.color).multiplyScalar(F),B.groundColor.copy(R.groundColor).multiplyScalar(F),n.hemi[p]=B,p++}}m>0&&(s.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=ve.LTC_FLOAT_1,n.rectAreaLTC2=ve.LTC_FLOAT_2):(n.rectAreaLTC1=ve.LTC_HALF_1,n.rectAreaLTC2=ve.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=u,n.ambient[2]=d;const x=n.hash;(x.directionalLength!==f||x.pointLength!==g||x.spotLength!==b||x.rectAreaLength!==m||x.hemiLength!==p||x.numDirectionalShadows!==_||x.numPointShadows!==y||x.numSpotShadows!==v||x.numSpotMaps!==T||x.numLightProbes!==C)&&(n.directional.length=f,n.spot.length=b,n.rectArea.length=m,n.point.length=g,n.hemi.length=p,n.directionalShadow.length=_,n.directionalShadowMap.length=_,n.pointShadow.length=y,n.pointShadowMap.length=y,n.spotShadow.length=v,n.spotShadowMap.length=v,n.directionalShadowMatrix.length=_,n.pointShadowMatrix.length=y,n.spotLightMatrix.length=v+T-E,n.spotLightMap.length=T,n.numSpotLightShadowsWithMaps=E,n.numLightProbes=C,x.directionalLength=f,x.pointLength=g,x.spotLength=b,x.rectAreaLength=m,x.hemiLength=p,x.numDirectionalShadows=_,x.numPointShadows=y,x.numSpotShadows=v,x.numSpotMaps=T,x.numLightProbes=C,n.version=jx++)}function c(l,h){let u=0,d=0,f=0,g=0,b=0;const m=h.matrixWorldInverse;for(let p=0,_=l.length;p<_;p++){const y=l[p];if(y.isDirectionalLight){const v=n.directional[u];v.direction.setFromMatrixPosition(y.matrixWorld),i.setFromMatrixPosition(y.target.matrixWorld),v.direction.sub(i),v.direction.transformDirection(m),u++}else if(y.isSpotLight){const v=n.spot[f];v.position.setFromMatrixPosition(y.matrixWorld),v.position.applyMatrix4(m),v.direction.setFromMatrixPosition(y.matrixWorld),i.setFromMatrixPosition(y.target.matrixWorld),v.direction.sub(i),v.direction.transformDirection(m),f++}else if(y.isRectAreaLight){const v=n.rectArea[g];v.position.setFromMatrixPosition(y.matrixWorld),v.position.applyMatrix4(m),a.identity(),r.copy(y.matrixWorld),r.premultiply(m),a.extractRotation(r),v.halfWidth.set(y.width*.5,0,0),v.halfHeight.set(0,y.height*.5,0),v.halfWidth.applyMatrix4(a),v.halfHeight.applyMatrix4(a),g++}else if(y.isPointLight){const v=n.point[d];v.position.setFromMatrixPosition(y.matrixWorld),v.position.applyMatrix4(m),d++}else if(y.isHemisphereLight){const v=n.hemi[b];v.direction.setFromMatrixPosition(y.matrixWorld),v.direction.transformDirection(m),b++}}}return{setup:o,setupView:c,state:n}}function Ih(s){const e=new Yx(s),t=[],n=[],i=[];function r(d){u.camera=d,t.length=0,n.length=0,i.length=0}function a(d){t.push(d)}function o(d){n.push(d)}function c(d){i.push(d)}function l(){e.setup(t)}function h(d){e.setupView(t,d)}const u={lightsArray:t,shadowsArray:n,lightProbeGridArray:i,camera:null,lights:e,transmissionRenderTarget:{},textureUnits:0};return{init:r,state:u,setupLights:l,setupLightsView:h,pushLight:a,pushShadow:o,pushLightProbeGrid:c}}function Jx(s){let e=new WeakMap;function t(i,r=0){const a=e.get(i);let o;return a===void 0?(o=new Ih(s),e.set(i,[o])):r>=a.length?(o=new Ih(s),a.push(o)):o=a[r],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const Zx=`void main() {
4066	gl_Position = vec4( position, 1.0 );
4067}`,Qx=`uniform sampler2D shadow_pass;
4068uniform vec2 resolution;
4069uniform float radius;
4070void main() {
4071	const float samples = float( VSM_SAMPLES );
4072	float mean = 0.0;
4073	float squared_mean = 0.0;
4074	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
4075	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
4076	for ( float i = 0.0; i < samples; i ++ ) {
4077		float uvOffset = uvStart + i * uvStride;
4078		#ifdef HORIZONTAL_PASS
4079			vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;
4080			mean += distribution.x;
4081			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
4082		#else
4083			float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;
4084			mean += depth;
4085			squared_mean += depth * depth;
4086		#endif
4087	}
4088	mean = mean / samples;
4089	squared_mean = squared_mean / samples;
4090	float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
4091	gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
4092}`,$x=[new L(1,0,0),new L(-1,0,0),new L(0,1,0),new L(0,-1,0),new L(0,0,1),new L(0,0,-1)],ev=[new L(0,-1,0),new L(0,-1,0),new L(0,0,1),new L(0,0,-1),new L(0,-1,0),new L(0,-1,0)],Fh=new Ye,As=new L,ro=new L;function tv(s,e,t){let n=new Fc;const i=new te,r=new te,a=new dt,o=new Op,c=new Bp,l={},h=t.maxTextureSize,u={[ei]:en,[en]:ei,[Yt]:Yt}
vendor: 4,196 bytes, line 4092
4092,d=new Tt({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new te},radius:{value:4}},vertexShader:Zx,fragmentShader:Qx}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const g=new xt;g.setAttribute("position",new Gt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new Ke(g,d),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Xr;let p=this.type;this.render=function(E,C,x){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||E.length===0)return;this.type===Qh&&(Ce("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=Xr);const S=s.getRenderTarget(),A=s.getActiveCubeFace(),R=s.getActiveMipmapLevel(),D=s.state;D.setBlending(Xt),D.buffers.depth.getReversed()===!0?D.buffers.color.setClear(0,0,0,0):D.buffers.color.setClear(1,1,1,1),D.buffers.depth.setTest(!0),D.setScissorTest(!1);const F=p!==this.type;F&&C.traverse(function(O){O.material&&(Array.isArray(O.material)?O.material.forEach(I=>I.needsUpdate=!0):O.material.needsUpdate=!0)});for(let O=0,I=E.length;O<I;O++){const B=E[O],G=B.shadow;if(G===void 0){Ce("WebGLShadowMap:",B,"has no shadow.");continue}if(G.autoUpdate===!1&&G.needsUpdate===!1)continue;i.copy(G.mapSize);const j=G.getFrameExtents();i.multiply(j),r.copy(G.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(r.x=Math.floor(h/j.x),i.x=r.x*j.x,G.mapSize.x=r.x),i.y>h&&(r.y=Math.floor(h/j.y),i.y=r.y*j.y,G.mapSize.y=r.y));const Y=s.state.buffers.depth.getReversed();if(G.camera._reversedDepth=Y,G.map===null||F===!0){if(G.map!==null&&(G.map.depthTexture!==null&&(G.map.depthTexture.dispose(),G.map.depthTexture=null),G.map.dispose()),this.type===Ps){if(B.isPointLight){Ce("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}G.map=new zt(i.x,i.y,{format:Pi,type:Ct,minFilter:Mt,magFilter:Mt,generateMipmaps:!1}),G.map.texture.name=B.name+".shadowMap",G.map.depthTexture=new Di(i.x,i.y,rn),G.map.depthTexture.name=B.name+".shadowMapDepth",G.map.depthTexture.format=ti,G.map.depthTexture.compareFunction=null,G.map.depthTexture.minFilter=Rt,G.map.depthTexture.magFilter=Rt}else B.isPointLight?(G.map=new Xc(i.x),G.map.depthTexture=new $f(i.x,Vn)):(G.map=new zt(i.x,i.y),G.map.depthTexture=new Di(i.x,i.y,Vn)),G.map.depthTexture.name=B.name+".shadowMap",G.map.depthTexture.format=ti,this.type===Xr?(G.map.depthTexture.compareFunction=Y?Pc:Cc,G.map.depthTexture.minFilter=Mt,G.map.depthTexture.magFilter=Mt):(G.map.depthTexture.compareFunction=null,G.map.depthTexture.minFilter=Rt,G.map.depthTexture.magFilter=Rt);G.camera.updateProjectionMatrix()}const ne=G.map.isWebGLCubeRenderTarget?6:1;for(let oe=0;oe<ne;oe++){if(G.map.isWebGLCubeRenderTarget)s.setRenderTarget(G.map,oe),s.clear();else{oe===0&&(s.setRenderTarget(G.map),s.clear());const ce=G.getViewport(oe);a.set(r.x*ce.x,r.y*ce.y,r.x*ce.z,r.y*ce.w),D.viewport(a)}if(B.isPointLight){const ce=G.camera,Ee=G.matrix,je=B.distance||ce.far;je!==ce.far&&(ce.far=je,ce.updateProjectionMatrix()),As.setFromMatrixPosition(B.matrixWorld),ce.position.copy(As),ro.copy(ce.position),ro.add($x[oe]),ce.up.copy(ev[oe]),ce.lookAt(ro),ce.updateMatrixWorld(),Ee.makeTranslation(-As.x,-As.y,-As.z),Fh.multiplyMatrices(ce.projectionMatrix,ce.matrixWorldInverse),G._frustum.setFromProjectionMatrix(Fh,ce.coordinateSystem,ce.reversedDepth)}else G.updateMatrices(B);n=G.getFrustum(),v(C,x,G.camera,B,this.type)}G.isPointLightShadow!==!0&&this.type===Ps&&_(G,x),G.needsUpdate=!1}p=this.type,m.needsUpdate=!1,s.setRenderTarget(S,A,R)};function _(E,C){const x=e.update(b);d.defines.VSM_SAMPLES!==E.blurSamples&&(d.defines.VSM_SAMPLES=E.blurSamples,f.defines.VSM_SAMPLES=E.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),E.mapPass===null&&(E.mapPass=new zt(i.x,i.y,{format:Pi,type:Ct})),d.uniforms.shadow_pass.value=E.map.depthTexture,d.uniforms.resolution.value=E.mapSize,d.uniforms.radius.value=E.radius,s.setRenderTarget(E.mapPass),s.clear(),s.renderBufferDirect(C,null,x,d,b,null),f.uniforms.shadow_pass.value=E.mapPass.texture,f.uniforms.resolution.value=E.mapSize,f.uniforms.radius.value=E.radius,s.setRenderTarget(E.map),s.clear(),s.renderBufferDirect(C,null,x,f,b,null)}function y(E,C,x,S){let A=null;
vendor: 7,691 bytes, line 4092
4092const R=x.isPointLight===!0?E.customDistanceMaterial:E.customDepthMaterial;if(R!==void 0)A=R;else if(A=x.isPointLight===!0?c:o,s.localClippingEnabled&&C.clipShadows===!0&&Array.isArray(C.clippingPlanes)&&C.clippingPlanes.length!==0||C.displacementMap&&C.displacementScale!==0||C.alphaMap&&C.alphaTest>0||C.map&&C.alphaTest>0||C.alphaToCoverage===!0){const D=A.uuid,F=C.uuid;let O=l[D];O===void 0&&(O={},l[D]=O);let I=O[F];I===void 0&&(I=A.clone(),O[F]=I,C.addEventListener("dispose",T)),A=I}if(A.visible=C.visible,A.wireframe=C.wireframe,S===Ps?A.side=C.shadowSide!==null?C.shadowSide:C.side:A.side=C.shadowSide!==null?C.shadowSide:u[C.side],A.alphaMap=C.alphaMap,A.alphaTest=C.alphaToCoverage===!0?.5:C.alphaTest,A.map=C.map,A.clipShadows=C.clipShadows,A.clippingPlanes=C.clippingPlanes,A.clipIntersection=C.clipIntersection,A.displacementMap=C.displacementMap,A.displacementScale=C.displacementScale,A.displacementBias=C.displacementBias,A.wireframeLinewidth=C.wireframeLinewidth,A.linewidth=C.linewidth,x.isPointLight===!0&&A.isMeshDistanceMaterial===!0){const D=s.properties.get(A);D.light=x}return A}function v(E,C,x,S,A){if(E.visible===!1)return;if(E.layers.test(C.layers)&&(E.isMesh||E.isLine||E.isPoints)&&(E.castShadow||E.receiveShadow&&A===Ps)&&(!E.frustumCulled||n.intersectsObject(E))){E.modelViewMatrix.multiplyMatrices(x.matrixWorldInverse,E.matrixWorld);const F=e.update(E),O=E.material;if(Array.isArray(O)){const I=F.groups;for(let B=0,G=I.length;B<G;B++){const j=I[B],Y=O[j.materialIndex];if(Y&&Y.visible){const ne=y(E,Y,S,A);E.onBeforeShadow(s,E,C,x,F,ne,j),s.renderBufferDirect(x,null,F,ne,E,j),E.onAfterShadow(s,E,C,x,F,ne,j)}}}else if(O.visible){const I=y(E,O,S,A);E.onBeforeShadow(s,E,C,x,F,I,null),s.renderBufferDirect(x,null,F,I,E,null),E.onAfterShadow(s,E,C,x,F,I,null)}}const D=E.children;for(let F=0,O=D.length;F<O;F++)v(D[F],C,x,S,A)}function T(E){E.target.removeEventListener("dispose",T);for(const x in l){const S=l[x],A=E.target.uuid;A in S&&(S[A].dispose(),delete S[A])}}}function nv(s,e){function t(){let U=!1;const ge=new dt;let $=null;const xe=new dt(0,0,0,0);return{setMask:function(ye){$!==ye&&!U&&(s.colorMask(ye,ye,ye,ye),$=ye)},setLocked:function(ye){U=ye},setClear:function(ye,se,Fe,Re,Pt){Pt===!0&&(ye*=Re,se*=Re,Fe*=Re),ge.set(ye,se,Fe,Re),xe.equals(ge)===!1&&(s.clearColor(ye,se,Fe,Re),xe.copy(ge))},reset:function(){U=!1,$=null,xe.set(-1,0,0,0)}}}function n(){let U=!1,ge=!1,$=null,xe=null,ye=null;return{setReversed:function(se){if(ge!==se){const Fe=e.get("EXT_clip_control");se?Fe.clipControlEXT(Fe.LOWER_LEFT_EXT,Fe.ZERO_TO_ONE_EXT):Fe.clipControlEXT(Fe.LOWER_LEFT_EXT,Fe.NEGATIVE_ONE_TO_ONE_EXT),ge=se;const Re=ye;ye=null,this.setClear(Re)}},getReversed:function(){return ge},setTest:function(se){se?Q(s.DEPTH_TEST):Se(s.DEPTH_TEST)},setMask:function(se){$!==se&&!U&&(s.depthMask(se),$=se)},setFunc:function(se){if(ge&&(se=nf[se]),xe!==se){switch(se){case _o:s.depthFunc(s.NEVER);break;case Mo:s.depthFunc(s.ALWAYS);break;case yo:s.depthFunc(s.LESS);break;case rs:s.depthFunc(s.LEQUAL);break;case So:s.depthFunc(s.EQUAL);break;case To:s.depthFunc(s.GEQUAL);break;case Eo:s.depthFunc(s.GREATER);break;case wo:s.depthFunc(s.NOTEQUAL);break;default:s.depthFunc(s.LEQUAL)}xe=se}},setLocked:function(se){U=se},setClear:function(se){ye!==se&&(ye=se,ge&&(se=1-se),s.clearDepth(se))},reset:function(){U=!1,$=null,xe=null,ye=null,ge=!1}}}function i(){let U=!1,ge=null,$=null,xe=null,ye=null,se=null,Fe=null,Re=null,Pt=null;return{setTest:function(vt){U||(vt?Q(s.STENCIL_TEST):Se(s.STENCIL_TEST))},setMask:function(vt){ge!==vt&&!U&&(s.stencilMask(vt),ge=vt)},setFunc:function(vt,Dn,Ln){($!==vt||xe!==Dn||ye!==Ln)&&(s.stencilFunc(vt,Dn,Ln),$=vt,xe=Dn,ye=Ln)},setOp:function(vt,Dn,Ln){(se!==vt||Fe!==Dn||Re!==Ln)&&(s.stencilOp(vt,Dn,Ln),se=vt,Fe=Dn,Re=Ln)},setLocked:function(vt){U=vt},setClear:function(vt){Pt!==vt&&(s.clearStencil(vt),Pt=vt)},reset:function(){U=!1,ge=null,$=null,xe=null,ye=null,se=null,Fe=null,Re=null,Pt=null}}}const r=new t,a=new n,o=new i,c=new WeakMap,l=new WeakMap;let h={},u={},d={},f=new WeakMap,g=[],b=null,m=!1,p=null,_=null,y=null,v=null,T=null,E=null,C=null,x=new ze(0,0,0),S=0,A=!1,R=null,D=null,F=null,O=null,I=null;const B=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let G=!1,j=0;const Y=s.getParameter(s.VERSION);Y.indexOf("WebGL")!==-1?(j=parseFloat(/^WebGL (\d)/.exec(Y)[1]),G=j>=1):Y.indexOf("OpenGL ES")!==-1&&(j=parseFloat(/^OpenGL ES (\d)/.exec(Y)[1]),G=j>=2);let ne=null,oe={};const ce=s.getParameter(s.SCISSOR_BOX),Ee=s.getParameter(s.VIEWPORT),je=new dt().fromArray(ce),Ve=new dt().fromArray(Ee);function k(U,ge,$,xe){const ye=new Uint8Array(4),se=s.createTexture();s.bindTexture(U,se),s.texParameteri(U,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(U,s.TEXTURE_MAG_FILTER,s.NEAREST);for(let Fe=0;Fe<$;Fe++)U===s.TEXTURE_3D||U===s.TEXTURE_2D_ARRAY?s.texImage3D(ge,0,s.RGBA,1,1,xe,0,s.RGBA,s.UNSIGNED_BYTE,ye):s.texImage2D(ge+Fe,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,ye);return se}const ee={};ee[s.TEXTURE_2D]=k(s.TEXTURE_2D,s.TEXTURE_2D,1),ee[s.TEXTURE_CUBE_MAP]=k(s.TEXTURE_CUBE_MAP,s.TEXTURE_CUBE_MAP_POSITIVE_X,6),ee[s.TEXTURE_2D_ARRAY]=k(s.TEXTURE_2D_ARRAY,s.TEXTURE_2D_ARRAY,1,1),ee[s.TEXTURE_3D]=k(s.TEXTURE_3D,s.TEXTURE_3D,1,1),r.setClear(0,0,0,1),a.setClear(1),o.setClear(0),Q(s.DEPTH_TEST),a.setFunc(rs),be(!1),pe(ul),Q(s.CULL_FACE),ae(Xt);function Q(U){h[U]!==!0&&(s.enable(U),h[U]=!0)}function Se(U){h[U]!==!1&&(s.disable(U),h[U]=!1)}function Le(U,ge){return d[U]!==ge?(s.bindFramebuffer(U,ge),d[U]=ge,U===s.DRAW_FRAMEBUFFER&&(d[s.FRAMEBUFFER]=ge),U===s.FRAMEBUFFER&&(d[s.DRAW_FRAMEBUFFER]=ge),!0):!1}function Ie(U,ge){let $=g,xe=!1;if(U){$=f.get(ge),$===void 0&&($=[],f.set(ge,$));const ye=U.textures;if($.length!==ye.length||$[0]!==s.COLOR_ATTACHMENT0){for(let se=0,Fe=ye.length;se<Fe;se++)$[se]=s.COLOR_ATTACHMENT0+se;$.length=ye.length,xe=!0}}else $[0]!==s.BACK&&($[0]=s.BACK,xe=!0);xe&&s.drawBuffers($)}function st(U){return b!==U?(s.useProgram(U),b=U,!0):!1}const He={[Tn]:s.FUNC_ADD,[Ed]:s.FUNC_SUBTRACT,[wd]:s.FUNC_REVERSE_SUBTRACT};He[Ad]=s.MIN,He[Rd]=s.MAX;const ie={[Ds]:s.ZERO,[Cd]:s.ONE,[Pd]:s.SRC_COLOR,[go]:s.SRC_ALPHA,[Id]:s.SRC_ALPHA_SATURATE,[vo]:s.DST_COLOR,[xo]:s.DST_ALPHA,[Dd]:s.ONE_MINUS_SRC_COLOR,[bo]:s.ONE_MINUS_SRC_ALPHA,[Nd]:s.ONE_MINUS_DST_COLOR,[Ld]:s.ONE_MINUS_DST_ALPHA,[Fd]:s.CONSTANT_COLOR,[Ud]:s.ONE_MINUS_CONSTANT_COLOR,[Od]:s.CONSTANT_ALPHA,[Bd]:s.ONE_MINUS_CONSTANT_ALPHA};function ae(U,ge,$,xe,ye,se,Fe,Re,Pt,vt){if(U===Xt){m===!0&&(Se(s.BLEND),m=!1);return}if(m===!1&&(Q(s.BLEND),m=!0),U!==$h){if(U!==p||vt!==A){if((_!==Tn||T!==Tn)&&(s.blendEquation(s.FUNC_ADD),_=Tn,T=Tn),vt)switch(U){case ts:s.blendFuncSeparate(s.ONE,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case mo:s.blendFunc(s.ONE,s.ONE);break;case dl:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case fl:s.blendFuncSeparate(s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ZERO,s.ONE);break;default:We("WebGLState: Invalid blending: ",U);break}else switch(U){case ts:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case mo:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE,s.ONE,s.ONE);break;case dl:We("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case fl:We("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:We("WebGLState: Invalid blending: ",U);break}y=null,v=null,E=null,C=null,x.set(0,0,0),S=0,p=U,A=vt}return}ye=ye||ge,se=se||$,Fe=Fe||xe,(ge!==_||ye!==T)&&(s.blendEquationSeparate(He[ge],He[ye]),_=ge,T=ye),($!==y||xe!==v||se!==E||Fe!==C)&&(s.blendFuncSeparate(ie[$],ie[xe],ie[se],ie[Fe]),y=$,v=xe,E=se,C=Fe),(Re.equals(x)===!1||Pt!==S)&&(s.blendColor
vendor: 10,064 bytes, line 4092
4092(Re.r,Re.g,Re.b,Pt),x.copy(Re),S=Pt),p=U,A=!1}function re(U,ge){U.side===Yt?Se(s.CULL_FACE):Q(s.CULL_FACE);let $=U.side===en;ge&&($=!$),be($),U.blending===ts&&U.transparent===!1?ae(Xt):ae(U.blending,U.blendEquation,U.blendSrc,U.blendDst,U.blendEquationAlpha,U.blendSrcAlpha,U.blendDstAlpha,U.blendColor,U.blendAlpha,U.premultipliedAlpha),a.setFunc(U.depthFunc),a.setTest(U.depthTest),a.setMask(U.depthWrite),r.setMask(U.colorWrite);const xe=U.stencilWrite;o.setTest(xe),xe&&(o.setMask(U.stencilWriteMask),o.setFunc(U.stencilFunc,U.stencilRef,U.stencilFuncMask),o.setOp(U.stencilFail,U.stencilZFail,U.stencilZPass)),Ae(U.polygonOffset,U.polygonOffsetFactor,U.polygonOffsetUnits),U.alphaToCoverage===!0?Q(s.SAMPLE_ALPHA_TO_COVERAGE):Se(s.SAMPLE_ALPHA_TO_COVERAGE)}function be(U){R!==U&&(U?s.frontFace(s.CW):s.frontFace(s.CCW),R=U)}function pe(U){U!==Sd?(Q(s.CULL_FACE),U!==D&&(U===ul?s.cullFace(s.BACK):U===Td?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK))):Se(s.CULL_FACE),D=U}function ke(U){U!==F&&(G&&s.lineWidth(U),F=U)}function Ae(U,ge,$){U?(Q(s.POLYGON_OFFSET_FILL),(O!==ge||I!==$)&&(O=ge,I=$,a.getReversed()&&(ge=-ge),s.polygonOffset(ge,$))):Se(s.POLYGON_OFFSET_FILL)}function Ge(U){U?Q(s.SCISSOR_TEST):Se(s.SCISSOR_TEST)}function Xe(U){U===void 0&&(U=s.TEXTURE0+B-1),ne!==U&&(s.activeTexture(U),ne=U)}function N(U,ge,$){$===void 0&&(ne===null?$=s.TEXTURE0+B-1:$=ne);let xe=oe[$];xe===void 0&&(xe={type:void 0,texture:void 0},oe[$]=xe),(xe.type!==U||xe.texture!==ge)&&(ne!==$&&(s.activeTexture($),ne=$),s.bindTexture(U,ge||ee[U]),xe.type=U,xe.texture=ge)}function ot(){const U=oe[ne];U!==void 0&&U.type!==void 0&&(s.bindTexture(U.type,null),U.type=void 0,U.texture=void 0)}function $e(){try{s.compressedTexImage2D(...arguments)}catch(U){We("WebGLState:",U)}}function P(){try{s.compressedTexImage3D(...arguments)}catch(U){We("WebGLState:",U)}}function M(){try{s.texSubImage2D(...arguments)}catch(U){We("WebGLState:",U)}}function V(){try{s.texSubImage3D(...arguments)}catch(U){We("WebGLState:",U)}}function H(){try{s.compressedTexSubImage2D(...arguments)}catch(U){We("WebGLState:",U)}}function K(){try{s.compressedTexSubImage3D(...arguments)}catch(U){We("WebGLState:",U)}}function he(){try{s.texStorage2D(...arguments)}catch(U){We("WebGLState:",U)}}function ue(){try{s.texStorage3D(...arguments)}catch(U){We("WebGLState:",U)}}function J(){try{s.texImage2D(...arguments)}catch(U){We("WebGLState:",U)}}function Z(){try{s.texImage3D(...arguments)}catch(U){We("WebGLState:",U)}}function me(U){return u[U]!==void 0?u[U]:s.getParameter(U)}function Ne(U,ge){u[U]!==ge&&(s.pixelStorei(U,ge),u[U]=ge)}function fe(U){je.equals(U)===!1&&(s.scissor(U.x,U.y,U.z,U.w),je.copy(U))}function de(U){Ve.equals(U)===!1&&(s.viewport(U.x,U.y,U.z,U.w),Ve.copy(U))}function Pe(U,ge){let $=l.get(ge);$===void 0&&($=new WeakMap,l.set(ge,$));let xe=$.get(U);xe===void 0&&(xe=s.getUniformBlockIndex(ge,U.name),$.set(U,xe))}function Oe(U,ge){const xe=l.get(ge).get(U);c.get(ge)!==xe&&(s.uniformBlockBinding(ge,xe,U.__bindingPointIndex),c.set(ge,xe))}function qe(){s.disable(s.BLEND),s.disable(s.CULL_FACE),s.disable(s.DEPTH_TEST),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SCISSOR_TEST),s.disable(s.STENCIL_TEST),s.disable(s.SAMPLE_ALPHA_TO_COVERAGE),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.ONE,s.ZERO),s.blendFuncSeparate(s.ONE,s.ZERO,s.ONE,s.ZERO),s.blendColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clearColor(0,0,0,0),s.depthMask(!0),s.depthFunc(s.LESS),a.setReversed(!1),s.clearDepth(1),s.stencilMask(4294967295),s.stencilFunc(s.ALWAYS,0,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),s.clearStencil(0),s.cullFace(s.BACK),s.frontFace(s.CCW),s.polygonOffset(0,0),s.activeTexture(s.TEXTURE0),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.useProgram(null),s.lineWidth(1),s.scissor(0,0,s.canvas.width,s.canvas.height),s.viewport(0,0,s.canvas.width,s.canvas.height),s.pixelStorei(s.PACK_ALIGNMENT,4),s.pixelStorei(s.UNPACK_ALIGNMENT,4),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL),s.pixelStorei(s.PACK_ROW_LENGTH,0),s.pixelStorei(s.PACK_SKIP_PIXELS,0),s.pixelStorei(s.PACK_SKIP_ROWS,0),s.pixelStorei(s.UNPACK_ROW_LENGTH,0),s.pixelStorei(s.UNPACK_IMAGE_HEIGHT,0),s.pixelStorei(s.UNPACK_SKIP_PIXELS,0),s.pixelStorei(s.UNPACK_SKIP_ROWS,0),s.pixelStorei(s.UNPACK_SKIP_IMAGES,0),h={},u={},ne=null,oe={},d={},f=new WeakMap,g=[],b=null,m=!1,p=null,_=null,y=null,v=null,T=null,E=null,C=null,x=new ze(0,0,0),S=0,A=!1,R=null,D=null,F=null,O=null,I=null,je.set(0,0,s.canvas.width,s.canvas.height),Ve.set(0,0,s.canvas.width,s.canvas.height),r.reset(),a.reset(),o.reset()}return{buffers:{color:r,depth:a,stencil:o},enable:Q,disable:Se,bindFramebuffer:Le,drawBuffers:Ie,useProgram:st,setBlending:ae,setMaterial:re,setFlipSided:be,setCullFace:pe,setLineWidth:ke,setPolygonOffset:Ae,setScissorTest:Ge,activeTexture:Xe,bindTexture:N,unbindTexture:ot,compressedTexImage2D:$e,compressedTexImage3D:P,texImage2D:J,texImage3D:Z,pixelStorei:Ne,getParameter:me,updateUBOMapping:Pe,uniformBlockBinding:Oe,texStorage2D:he,texStorage3D:ue,texSubImage2D:M,texSubImage3D:V,compressedTexSubImage2D:H,compressedTexSubImage3D:K,scissor:fe,viewport:de,reset:qe}}function iv(s,e,t,n,i,r,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,c=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),l=new te,h=new WeakMap,u=new Set;let d;const f=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function b(P,M){return g?new OffscreenCanvas(P,M):qs("canvas")}function m(P,M,V){let H=1;const K=$e(P);if((K.width>V||K.height>V)&&(H=V/Math.max(K.width,K.height)),H<1)if(typeof HTMLImageElement<"u"&&P instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&P instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&P instanceof ImageBitmap||typeof VideoFrame<"u"&&P instanceof VideoFrame){const he=Math.floor(H*K.width),ue=Math.floor(H*K.height);d===void 0&&(d=b(he,ue));const J=M?b(he,ue):d;return J.width=he,J.height=ue,J.getContext("2d").drawImage(P,0,0,he,ue),Ce("WebGLRenderer: Texture has been resized from ("+K.width+"x"+K.height+") to ("+he+"x"+ue+")."),J}else return"data"in P&&Ce("WebGLRenderer: Image in DataTexture is too big ("+K.width+"x"+K.height+")."),P;return P}function p(P){return P.generateMipmaps}function _(P){s.generateMipmap(P)}function y(P){return P.isWebGLCubeRenderTarget?s.TEXTURE_CUBE_MAP:P.isWebGL3DRenderTarget?s.TEXTURE_3D:P.isWebGLArrayRenderTarget||P.isCompressedArrayTexture?s.TEXTURE_2D_ARRAY:s.TEXTURE_2D}function v(P,M,V,H,K,he=!1){if(P!==null){if(s[P]!==void 0)return s[P];Ce("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+P+"'")}let ue;H&&(ue=e.get("EXT_texture_norm16"),ue||Ce("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));let J=M;if(M===s.RED&&(V===s.FLOAT&&(J=s.R32F),V===s.HALF_FLOAT&&(J=s.R16F),V===s.UNSIGNED_BYTE&&(J=s.R8),V===s.UNSIGNED_SHORT&&ue&&(J=ue.R16_EXT),V===s.SHORT&&ue&&(J=ue.R16_SNORM_EXT)),M===s.RED_INTEGER&&(V===s.UNSIGNED_BYTE&&(J=s.R8UI),V===s.UNSIGNED_SHORT&&(J=s.R16UI),V===s.UNSIGNED_INT&&(J=s.R32UI),V===s.BYTE&&(J=s.R8I),V===s.SHORT&&(J=s.R16I),V===s.INT&&(J=s.R32I)),M===s.RG&&(V===s.FLOAT&&(J=s.RG32F),V===s.HALF_FLOAT&&(J=s.RG16F),V===s.UNSIGNED_BYTE&&(J=s.RG8),V===s.UNSIGNED_SHORT&&ue&&(J=ue.RG16_EXT),V===s.SHORT&&ue&&(J=ue.RG16_SNORM_EXT)),M===s.RG_INTEGER&&(V===s.UNSIGNED_BYTE&&(J=s.RG8UI),V===s.UNSIGNED_SHORT&&(J=s.RG16UI),V===s.UNSIGNED_INT&&(J=s.RG32UI),V===s.BYTE&&(J=s.RG8I),V===s.SHORT&&(J=s.RG16I),V===s.INT&&(J=s.RG32I)),M===s.RGB_INTEGER&&(V===s.UNSIGNED_BYTE&&(J=s.RGB8UI),V===s.UNSIGNED_SHORT&&(J=s.RGB16UI),V===s.UNSIGNED_INT&&(J=s.RGB32UI),V===s.BYTE&&(J=s.RGB8I),V===s.SHORT&&(J=s.RGB16I),V===s.INT&&(J=s.RGB32I)),M===s.RGBA_INTEGER&&(V===s.UNSIGNED_BYTE&&(J=s.RGBA8UI),V===s.UNSIGNED_SHORT&&(J=s.RGBA16UI),V===s.UNSIGNED_INT&&(J=s.RGBA32UI),V===s.BYTE&&(J=s.RGBA8I),V===s.SHORT&&(J=s.RGBA16I),V===s.INT&&(J=s.RGBA32I)),M===s.RGB&&(V===s.UNSIGNED_SHORT&&ue&&(J=ue.RGB16_EXT),V===s.SHORT&&ue&&(J=ue.RGB16_SNORM_EXT),V===s.UNSIGNED_INT_5_9_9_9_REV&&(J=s.RGB9_E5),V===s.UNSIGNED_INT_10F_11F_11F_REV&&(J=s.R11F_G11F_B10F)),M===s.RGBA){const Z=he?na:nt.getTransfer(K);V===s.FLOAT&&(J=s.RGBA32F),V===s.HALF_FLOAT&&(J=s.RGBA16F),V===s.UNSIGNED_BYTE&&(J=Z===ct?s.SRGB8_ALPHA8:s.RGBA8),V===s.UNSIGNED_SHORT&&ue&&(J=ue.RGBA16_EXT),V===s.SHORT&&ue&&(J=ue.RGBA16_SNORM_EXT),V===s.UNSIGNED_SHORT_4_4_4_4&&(J=s.RGBA4),V===s.UNSIGNED_SHORT_5_5_5_1&&(J=s.RGB5_A1)}return(J===s.R16F||J===s.R32F||J===s.RG16F||J===s.RG32F||J===s.RGBA16F||J===s.RGBA32F)&&e.get("EXT_color_buffer_float"),J}function T(P,M){let V;return P?M===null||M===Vn||M===os?V=s.DEPTH24_STENCIL8:M===rn?V=s.DEPTH32F_STENCIL8:M===Vs&&(V=s.DEPTH24_STENCIL8,Ce("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):M===null||M===Vn||M===os?V=s.DEPTH_COMPONENT24:M===rn?V=s.DEPTH_COMPONENT32F:M===Vs&&(V=s.DEPTH_COMPONENT16),V}function E(P,M){return p(P)===!0||P.isFramebufferTexture&&P.minFilter!==Rt&&P.minFilter!==Mt?Math.log2(Math.max(M.width,M.height))+1:P.mipmaps!==void 0&&P.mipmaps.length>0?P.mipmaps.length:P.isCompressedTexture&&Array.isArray(P.image)?M.mipmaps.length:1}function C(P){const M=P.target;M.removeEventListener("dispose",C),S(M),M.isVideoTexture&&h.delete(M),M.isHTMLTexture&&u.delete(M)}function x(P){const M=P.target;M.removeEventListener("dispose",x),R(M)}function S(P){const M=n.get(P);if(M.__webglInit===void 0)return;const V=P.source,H=f.get(V);if(H){const K=H[M.__cacheKey];K.usedTimes--,K.usedTimes===0&&A(P),Object.keys(H).length===0&&f.delete(V)}n.remove(P)}function A(P){const M=n.get(P);s.deleteTexture(M.__webglTexture);const V=P.source,H=f.get(V);delete H[M.__cacheKey],a.memory.textures--}function R(P){const M=n.get(P);if(P.depthTexture&&(P.depthTexture.dispose(),n.remove(P.depthTexture)),P.isWebGLCubeRen
vendor: 4,396 bytes, line 4092
4092derTarget)for(let H=0;H<6;H++){if(Array.isArray(M.__webglFramebuffer[H]))for(let K=0;K<M.__webglFramebuffer[H].length;K++)s.deleteFramebuffer(M.__webglFramebuffer[H][K]);else s.deleteFramebuffer(M.__webglFramebuffer[H]);M.__webglDepthbuffer&&s.deleteRenderbuffer(M.__webglDepthbuffer[H])}else{if(Array.isArray(M.__webglFramebuffer))for(let H=0;H<M.__webglFramebuffer.length;H++)s.deleteFramebuffer(M.__webglFramebuffer[H]);else s.deleteFramebuffer(M.__webglFramebuffer);if(M.__webglDepthbuffer&&s.deleteRenderbuffer(M.__webglDepthbuffer),M.__webglMultisampledFramebuffer&&s.deleteFramebuffer(M.__webglMultisampledFramebuffer),M.__webglColorRenderbuffer)for(let H=0;H<M.__webglColorRenderbuffer.length;H++)M.__webglColorRenderbuffer[H]&&s.deleteRenderbuffer(M.__webglColorRenderbuffer[H]);M.__webglDepthRenderbuffer&&s.deleteRenderbuffer(M.__webglDepthRenderbuffer)}const V=P.textures;for(let H=0,K=V.length;H<K;H++){const he=n.get(V[H]);he.__webglTexture&&(s.deleteTexture(he.__webglTexture),a.memory.textures--),n.remove(V[H])}n.remove(P)}let D=0;function F(){D=0}function O(){return D}function I(P){D=P}function B(){const P=D;return P>=i.maxTextures&&Ce("WebGLTextures: Trying to use "+P+" texture units while this GPU supports only "+i.maxTextures),D+=1,P}function G(P){const M=[];return M.push(P.wrapS),M.push(P.wrapT),M.push(P.wrapR||0),M.push(P.magFilter),M.push(P.minFilter),M.push(P.anisotropy),M.push(P.internalFormat),M.push(P.format),M.push(P.type),M.push(P.generateMipmaps),M.push(P.premultiplyAlpha),M.push(P.flipY),M.push(P.unpackAlignment),M.push(P.colorSpace),M.join()}function j(P,M){const V=n.get(P);if(P.isVideoTexture&&N(P),P.isRenderTargetTexture===!1&&P.isExternalTexture!==!0&&P.version>0&&V.__version!==P.version){const H=P.image;if(H===null)Ce("WebGLRenderer: Texture marked for update but no image data found.");else if(H.complete===!1)Ce("WebGLRenderer: Texture marked for update but image is incomplete");else{Se(V,P,M);return}}else P.isExternalTexture&&(V.__webglTexture=P.sourceTexture?P.sourceTexture:null);t.bindTexture(s.TEXTURE_2D,V.__webglTexture,s.TEXTURE0+M)}function Y(P,M){const V=n.get(P);if(P.isRenderTargetTexture===!1&&P.version>0&&V.__version!==P.version){Se(V,P,M);return}else P.isExternalTexture&&(V.__webglTexture=P.sourceTexture?P.sourceTexture:null);t.bindTexture(s.TEXTURE_2D_ARRAY,V.__webglTexture,s.TEXTURE0+M)}function ne(P,M){const V=n.get(P);if(P.isRenderTargetTexture===!1&&P.version>0&&V.__version!==P.version){Se(V,P,M);return}t.bindTexture(s.TEXTURE_3D,V.__webglTexture,s.TEXTURE0+M)}function oe(P,M){const V=n.get(P);if(P.isCubeDepthTexture!==!0&&P.version>0&&V.__version!==P.version){Le(V,P,M);return}t.bindTexture(s.TEXTURE_CUBE_MAP,V.__webglTexture,s.TEXTURE0+M)}const ce={[_n]:s.REPEAT,[xn]:s.CLAMP_TO_EDGE,[Qr]:s.MIRRORED_REPEAT},Ee={[Rt]:s.NEAREST,[nu]:s.NEAREST_MIPMAP_NEAREST,[Ls]:s.NEAREST_MIPMAP_LINEAR,[Mt]:s.LINEAR,[qr]:s.LINEAR_MIPMAP_NEAREST,[An]:s.LINEAR_MIPMAP_LINEAR},je={[qd]:s.NEVER,[Zd]:s.ALWAYS,[jd]:s.LESS,[Cc]:s.LEQUAL,[Kd]:s.EQUAL,[Pc]:s.GEQUAL,[Yd]:s.GREATER,[Jd]:s.NOTEQUAL};function Ve(P,M){if(M.type===rn&&e.has("OES_texture_float_linear")===!1&&(M.magFilter===Mt||M.magFilter===qr||M.magFilter===Ls||M.magFilter===An||M.minFilter===Mt||M.minFilter===qr||M.minFilter===Ls||M.minFilter===An)&&Ce("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),s.texParameteri(P,s.TEXTURE_WRAP_S,ce[M.wrapS]),s.texParameteri(P,s.TEXTURE_WRAP_T,ce[M.wrapT]),(P===s.TEXTURE_3D||P===s.TEXTURE_2D_ARRAY)&&s.texParameteri(P,s.TEXTURE_WRAP_R,ce[M.wrapR]),s.texParameteri(P,s.TEXTURE_MAG_FILTER,Ee[M.magFilter]),s.texParameteri(P,s.TEXTURE_MIN_FILTER,Ee[M.minFilter]),M.compareFunction&&(s.texParameteri(P,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(P,s.TEXTURE_COMPARE_FUNC,je[M.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(M.magFilter===Rt||M.minFilter!==Ls&&M.minFilter!==An||M.type===rn&&e.has("OES_texture_float_linear")===!1)return;if(M.anisotropy>1||n.get(M).__currentAnisotropy){const V=e.get("EXT_texture_filter_anisotropic");s.texParameterf(P,V.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(M.anisotropy,i.getMaxAnisotropy())),n.get(M).__currentAnisotropy=M.anisotropy}}}function k(P,M){let V=!1;P.__webglInit===void 0&&(P.__webglInit=!0,M.addEventListener("dispose",C));const H=M.source;let K=f.get(H);
vendor: 7,086 bytes, line 4092
4092K===void 0&&(K={},f.set(H,K));const he=G(M);if(he!==P.__cacheKey){K[he]===void 0&&(K[he]={texture:s.createTexture(),usedTimes:0},a.memory.textures++,V=!0),K[he].usedTimes++;const ue=K[P.__cacheKey];ue!==void 0&&(K[P.__cacheKey].usedTimes--,ue.usedTimes===0&&A(M)),P.__cacheKey=he,P.__webglTexture=K[he].texture}return V}function ee(P,M,V){return Math.floor(Math.floor(P/V)/M)}function Q(P,M,V,H){const he=P.updateRanges;if(he.length===0)t.texSubImage2D(s.TEXTURE_2D,0,0,0,M.width,M.height,V,H,M.data);else{he.sort((Ne,fe)=>Ne.start-fe.start);let ue=0;for(let Ne=1;Ne<he.length;Ne++){const fe=he[ue],de=he[Ne],Pe=fe.start+fe.count,Oe=ee(de.start,M.width,4),qe=ee(fe.start,M.width,4);de.start<=Pe+1&&Oe===qe&&ee(de.start+de.count-1,M.width,4)===Oe?fe.count=Math.max(fe.count,de.start+de.count-fe.start):(++ue,he[ue]=de)}he.length=ue+1;const J=t.getParameter(s.UNPACK_ROW_LENGTH),Z=t.getParameter(s.UNPACK_SKIP_PIXELS),me=t.getParameter(s.UNPACK_SKIP_ROWS);t.pixelStorei(s.UNPACK_ROW_LENGTH,M.width);for(let Ne=0,fe=he.length;Ne<fe;Ne++){const de=he[Ne],Pe=Math.floor(de.start/4),Oe=Math.ceil(de.count/4),qe=Pe%M.width,U=Math.floor(Pe/M.width),ge=Oe,$=1;t.pixelStorei(s.UNPACK_SKIP_PIXELS,qe),t.pixelStorei(s.UNPACK_SKIP_ROWS,U),t.texSubImage2D(s.TEXTURE_2D,0,qe,U,ge,$,V,H,M.data)}P.clearUpdateRanges(),t.pixelStorei(s.UNPACK_ROW_LENGTH,J),t.pixelStorei(s.UNPACK_SKIP_PIXELS,Z),t.pixelStorei(s.UNPACK_SKIP_ROWS,me)}}function Se(P,M,V){let H=s.TEXTURE_2D;(M.isDataArrayTexture||M.isCompressedArrayTexture)&&(H=s.TEXTURE_2D_ARRAY),M.isData3DTexture&&(H=s.TEXTURE_3D);const K=k(P,M),he=M.source;t.bindTexture(H,P.__webglTexture,s.TEXTURE0+V);const ue=n.get(he);if(he.version!==ue.__version||K===!0){if(t.activeTexture(s.TEXTURE0+V),(typeof ImageBitmap<"u"&&M.image instanceof ImageBitmap)===!1){const $=nt.getPrimaries(nt.workingColorSpace),xe=M.colorSpace===Jn?null:nt.getPrimaries(M.colorSpace),ye=M.colorSpace===Jn||$===xe?s.NONE:s.BROWSER_DEFAULT_WEBGL;t.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,M.flipY),t.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,M.premultiplyAlpha),t.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,ye)}t.pixelStorei(s.UNPACK_ALIGNMENT,M.unpackAlignment);let Z=m(M.image,!1,i.maxTextureSize);Z=ot(M,Z);const me=r.convert(M.format,M.colorSpace),Ne=r.convert(M.type);let fe=v(M.internalFormat,me,Ne,M.normalized,M.colorSpace,M.isVideoTexture);Ve(H,M);let de;const Pe=M.mipmaps,Oe=M.isVideoTexture!==!0,qe=ue.__version===void 0||K===!0,U=he.dataReady,ge=E(M,Z);if(M.isDepthTexture)fe=T(M.format===pi,M.type),qe&&(Oe?t.texStorage2D(s.TEXTURE_2D,1,fe,Z.width,Z.height):t.texImage2D(s.TEXTURE_2D,0,fe,Z.width,Z.height,0,me,Ne,null));else if(M.isDataTexture)if(Pe.length>0){Oe&&qe&&t.texStorage2D(s.TEXTURE_2D,ge,fe,Pe[0].width,Pe[0].height);for(let $=0,xe=Pe.length;$<xe;$++)de=Pe[$],Oe?U&&t.texSubImage2D(s.TEXTURE_2D,$,0,0,de.width,de.height,me,Ne,de.data):t.texImage2D(s.TEXTURE_2D,$,fe,de.width,de.height,0,me,Ne,de.data);M.generateMipmaps=!1}else Oe?(qe&&t.texStorage2D(s.TEXTURE_2D,ge,fe,Z.width,Z.height),U&&Q(M,Z,me,Ne)):t.texImage2D(s.TEXTURE_2D,0,fe,Z.width,Z.height,0,me,Ne,Z.data);else if(M.isCompressedTexture)if(M.isCompressedArrayTexture){Oe&&qe&&t.texStorage3D(s.TEXTURE_2D_ARRAY,ge,fe,Pe[0].width,Pe[0].height,Z.depth);for(let $=0,xe=Pe.length;$<xe;$++)if(de=Pe[$],M.format!==un)if(me!==null)if(Oe){if(U)if(M.layerUpdates.size>0){const ye=fh(de.width,de.height,M.format,M.type);for(const se of M.layerUpdates){const Fe=de.data.subarray(se*ye/de.data.BYTES_PER_ELEMENT,(se+1)*ye/de.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,$,0,0,se,de.width,de.height,1,me,Fe)}M.clearLayerUpdates()}else t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,$,0,0,0,de.width,de.height,Z.depth,me,de.data)}else t.compressedTexImage3D(s.TEXTURE_2D_ARRAY,$,fe,de.width,de.height,Z.depth,0,de.data,0,0);else Ce("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Oe?U&&t.texSubImage3D(s.TEXTURE_2D_ARRAY,$,0,0,0,de.width,de.height,Z.depth,me,Ne,de.data):t.texImage3D(s.TEXTURE_2D_ARRAY,$,fe,de.width,de.height,Z.depth,0,me,Ne,de.data)}else{Oe&&qe&&t.texStorage2D(s.TEXTURE_2D,ge,fe,Pe[0].width,Pe[0].height);for(let $=0,xe=Pe.length;$<xe;$++)de=Pe[$],M.format!==un?me!==null?Oe?U&&t.compressedTexSubImage2D(s.TEXTURE_2D,$,0,0,de.width,de.height,me,de.data):t.compressedTexImage2D(s.TEXTURE_2D,$,fe,de.width,de.height,0,de.data):Ce("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Oe?U&&t.texSubImage2D(s.TEXTURE_2D,$,0,0,de.width,de.height,me,Ne,de.data):t.texImage2D(s.TEXTURE_2D,$,fe,de.width,de.height,0,me,Ne,de.data)}else if(M.isDataArrayTexture)if(Oe){if(qe&&t.texStorage3D(s.TEXTURE_2D_ARRAY,ge,fe,Z.width,Z.height,Z.depth),U)if(M.layerUpdates.size>0){const $=fh(Z.width,Z.height,M.format,M.type);for(const xe of M.layerUpdates){const ye=Z.data.subarray(xe*$/Z.data.BYTES_PER_ELEMENT,(xe+1)*$/Z.data.BYTES_PER_ELEMENT);t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,xe,Z.width,Z.height,1,me,Ne,ye)}M.clearLayerUpdates()}else t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,0,Z.width,Z.height,Z.depth,me,Ne,Z.data)}else t.texImage3D(s.TEXTURE_2D_ARRAY,0,fe,Z.width,Z.height,Z.depth,0,me,Ne,Z.data);else if(M.isData3DTexture)Oe?(qe&&t.texStorage3D(s.TEXTURE_3D,ge,fe,Z.width,Z.height,Z.depth),U&&t.texSubImage3D(s.TEXTURE_3D,0,0,0,0,Z.width,Z.height,Z.depth,me,Ne,Z.data)):t.texImage3D(s.TEXTURE_3D,0,fe,Z.width,Z.height,Z.depth,0,me,Ne,Z.data);else if(M.isFramebufferTexture){if(qe)if(Oe)t.texStorage2D(s.TEXTURE_2D,ge,fe,Z.width,Z.height);else{let $=Z.width,xe=Z.height;for(let ye=0;ye<ge;ye++)t.texImage2D(s.TEXTURE_2D,ye,fe,$,xe,0,me,Ne,null),$>>=1,xe>>=1}}else if(M.isHTMLTexture){if("texElementImage2D"in s){const $=s.canvas;if($.hasAttribute("layoutsubtree")||$.setAttribute("layoutsubtree","true"),Z.parentNode!==$){$.appendChild(Z),u.add(M),$.onpaint=xe=>{const ye=xe.changedElements;for(const se of u)ye.includes(se.image)&&(se.needsUpdate=!0)},$.requestPaint();return}if(s.texElementImage2D.length===3)s.texElementImage2D(s.TEXTURE_2D,s.RGBA8,Z);else{const ye=s.RGBA,se=s.RGBA,Fe=s.UNSIGNED_BYTE;s.texElementImage2D(s.TEXTURE_2D,0,ye,se,Fe,Z)}s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE)}}else if(Pe.length>0){if(Oe&&qe){const $=$e(Pe[0]);t.texStorage2D(s.TEXTURE_2D,ge,fe,$.width,$.height)}for(let $=0,xe=Pe.length;$<xe;$++)de=Pe[$],Oe?U&&t.texSubImage2D(s.TEXTURE_2D,$,0,0,me,Ne,de):t.texImage2D(s.TEXTURE_2D,$,fe,me,Ne,de);M.generateMipmaps=!1}else if(Oe){if(qe){const $=$e(Z);t.texStorage2D(s.TEXTURE_2D,ge,fe,$.width,$.height)}U&&t.texSubImage2D(s.TEXTURE_2D,0,0,0,me,Ne,Z)}else t.texImage2D(s.TEXTURE_2D,0,fe,me,Ne,Z);p(M)&&_(H),ue.__version=he.version,M.onUpdate&&M.onUpdate(M)}P.__version=M.version}function Le(P,M,V){if(M.image.length!==6)return;const H=k(P,M),K=M.source;t.bindTexture(s.TEXTURE_CUBE_MAP,P.__webglTexture,s.TEXTURE0+V);const he=n.get(K);if(K.version!==he.__version||H===!0){t.activeTexture(s.TEXTURE0+V);
vendor: 28,630 bytes, lines 4092-4116
4092const ue=nt.getPrimaries(nt.workingColorSpace),J=M.colorSpace===Jn?null:nt.getPrimaries(M.colorSpace),Z=M.colorSpace===Jn||ue===J?s.NONE:s.BROWSER_DEFAULT_WEBGL;t.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,M.flipY),t.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,M.premultiplyAlpha),t.pixelStorei(s.UNPACK_ALIGNMENT,M.unpackAlignment),t.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Z);const me=M.isCompressedTexture||M.image[0].isCompressedTexture,Ne=M.image[0]&&M.image[0].isDataTexture,fe=[];for(let se=0;se<6;se++)!me&&!Ne?fe[se]=m(M.image[se],!0,i.maxCubemapSize):fe[se]=Ne?M.image[se].image:M.image[se],fe[se]=ot(M,fe[se]);const de=fe[0],Pe=r.convert(M.format,M.colorSpace),Oe=r.convert(M.type),qe=v(M.internalFormat,Pe,Oe,M.normalized,M.colorSpace),U=M.isVideoTexture!==!0,ge=he.__version===void 0||H===!0,$=K.dataReady;let xe=E(M,de);Ve(s.TEXTURE_CUBE_MAP,M);let ye;if(me){U&&ge&&t.texStorage2D(s.TEXTURE_CUBE_MAP,xe,qe,de.width,de.height);for(let se=0;se<6;se++){ye=fe[se].mipmaps;for(let Fe=0;Fe<ye.length;Fe++){const Re=ye[Fe];M.format!==un?Pe!==null?U?$&&t.compressedTexSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+se,Fe,0,0,Re.width,Re.height,Pe,Re.data):t.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+se,Fe,qe,Re.width,Re.height,0,Re.data):Ce("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):U?$&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+se,Fe,0,0,Re.width,Re.height,Pe,Oe,Re.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+se,Fe,qe,Re.width,Re.height,0,Pe,Oe,Re.data)}}}else{if(ye=M.mipmaps,U&&ge){ye.length>0&&xe++;const se=$e(fe[0]);t.texStorage2D(s.TEXTURE_CUBE_MAP,xe,qe,se.width,se.height)}for(let se=0;se<6;se++)if(Ne){U?$&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,0,0,fe[se].width,fe[se].height,Pe,Oe,fe[se].data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,qe,fe[se].width,fe[se].height,0,Pe,Oe,fe[se].data);for(let Fe=0;Fe<ye.length;Fe++){const Pt=ye[Fe].image[se].image;U?$&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+se,Fe+1,0,0,Pt.width,Pt.height,Pe,Oe,Pt.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+se,Fe+1,qe,Pt.width,Pt.height,0,Pe,Oe,Pt.data)}}else{U?$&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,0,0,Pe,Oe,fe[se]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,qe,Pe,Oe,fe[se]);for(let Fe=0;Fe<ye.length;Fe++){const Re=ye[Fe];U?$&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+se,Fe+1,0,0,Pe,Oe,Re.image[se]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+se,Fe+1,qe,Pe,Oe,Re.image[se])}}}p(M)&&_(s.TEXTURE_CUBE_MAP),he.__version=K.version,M.onUpdate&&M.onUpdate(M)}P.__version=M.version}function Ie(P,M,V,H,K,he){const ue=r.convert(V.format,V.colorSpace),J=r.convert(V.type),Z=v(V.internalFormat,ue,J,V.normalized,V.colorSpace),me=n.get(M),Ne=n.get(V);if(Ne.__renderTarget=M,!me.__hasExternalTextures){const fe=Math.max(1,M.width>>he),de=Math.max(1,M.height>>he);K===s.TEXTURE_3D||K===s.TEXTURE_2D_ARRAY?t.texImage3D(K,he,Z,fe,de,M.depth,0,ue,J,null):t.texImage2D(K,he,Z,fe,de,0,ue,J,null)}t.bindFramebuffer(s.FRAMEBUFFER,P),Xe(M)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,H,K,Ne.__webglTexture,0,Ge(M)):(K===s.TEXTURE_2D||K>=s.TEXTURE_CUBE_MAP_POSITIVE_X&&K<=s.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&s.framebufferTexture2D(s.FRAMEBUFFER,H,K,Ne.__webglTexture,he),t.bindFramebuffer(s.FRAMEBUFFER,null)}function st(P,M,V){if(s.bindRenderbuffer(s.RENDERBUFFER,P),M.depthBuffer){const H=M.depthTexture,K=H&&H.isDepthTexture?H.type:null,he=T(M.stencilBuffer,K),ue=M.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;Xe(M)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Ge(M),he,M.width,M.height):V?s.renderbufferStorageMultisample(s.RENDERBUFFER,Ge(M),he,M.width,M.height):s.renderbufferStorage(s.RENDERBUFFER,he,M.width,M.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,ue,s.RENDERBUFFER,P)}else{const H=M.textures;for(let K=0;K<H.length;K++){const he=H[K],ue=r.convert(he.format,he.colorSpace),J=r.convert(he.type),Z=v(he.internalFormat,ue,J,he.normalized,he.colorSpace);Xe(M)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Ge(M),Z,M.width,M.height):V?s.renderbufferStorageMultisample(s.RENDERBUFFER,Ge(M),Z,M.width,M.height):s.renderbufferStorage(s.RENDERBUFFER,Z,M.width,M.height)}}s.bindRenderbuffer(s.RENDERBUFFER,null)}function He(P,M,V){const H=M.isWebGLCubeRenderTarget===!0;if(t.bindFramebuffer(s.FRAMEBUFFER,P),!(M.depthTexture&&M.depthTexture.isDepthTexture))throw new Error("THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.");const K=n.get(M.depthTexture);if(K.__renderTarget=M,(!K.__webglTexture||M.depthTexture.image.width!==M.width||M.depthTexture.image.height!==M.height)&&(M.depthTexture.image.width=M.width,M.depthTexture.image.height=M.height,M.depthTexture.needsUpdate=!0),H){if(K.__webglInit===void 0&&(K.__webglInit=!0,M.depthTexture.addEventListener("dispose",C)),K.__webglTexture===void 0){K.__webglTexture=s.createTexture(),t.bindTexture(s.TEXTURE_CUBE_MAP,K.__webglTexture),Ve(s.TEXTURE_CUBE_MAP,M.depthTexture);const me=r.convert(M.depthTexture.format),Ne=r.convert(M.depthTexture.type);let fe;M.depthTexture.format===ti?fe=s.DEPTH_COMPONENT24:M.depthTexture.format===pi&&(fe=s.DEPTH24_STENCIL8);for(let de=0;de<6;de++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,fe,M.width,M.height,0,me,Ne,null)}}else j(M.depthTexture,0);const he=K.__webglTexture,ue=Ge(M),J=H?s.TEXTURE_CUBE_MAP_POSITIVE_X+V:s.TEXTURE_2D,Z=M.depthTexture.format===pi?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;if(M.depthTexture.format===ti)Xe(M)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,Z,J,he,0,ue):s.framebufferTexture2D(s.FRAMEBUFFER,Z,J,he,0);else if(M.depthTexture.format===pi)Xe(M)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,Z,J,he,0,ue):s.framebufferTexture2D(s.FRAMEBUFFER,Z,J,he,0);else throw new Error("THREE.WebGLTextures: Unknown depthTexture format.")}function ie(P){const M=n.get(P),V=P.isWebGLCubeRenderTarget===!0;if(M.__boundDepthTexture!==P.depthTexture){const H=P.depthTexture;if(M.__depthDisposeCallback&&M.__depthDisposeCallback(),H){const K=()=>{delete M.__boundDepthTexture,delete M.__depthDisposeCallback,H.removeEventListener("dispose",K)};H.addEventListener("dispose",K),M.__depthDisposeCallback=K}M.__boundDepthTexture=H}if(P.depthTexture&&!M.__autoAllocateDepthBuffer)if(V)for(let H=0;H<6;H++)He(M.__webglFramebuffer[H],P,H);else{const H=P.texture.mipmaps;H&&H.length>0?He(M.__webglFramebuffer[0],P,0):He(M.__webglFramebuffer,P,0)}else if(V){M.__webglDepthbuffer=[];for(let H=0;H<6;H++)if(t.bindFramebuffer(s.FRAMEBUFFER,M.__webglFramebuffer[H]),M.__webglDepthbuffer[H]===void 0)M.__webglDepthbuffer[H]=s.createRenderbuffer(),st(M.__webglDepthbuffer[H],P,!1);else{const K=P.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,he=M.__webglDepthbuffer[H];s.bindRenderbuffer(s.RENDERBUFFER,he),s.framebufferRenderbuffer(s.FRAMEBUFFER,K,s.RENDERBUFFER,he)}}else{const H=P.texture.mipmaps;if(H&&H.length>0?t.bindFramebuffer(s.FRAMEBUFFER,M.__webglFramebuffer[0]):t.bindFramebuffer(s.FRAMEBUFFER,M.__webglFramebuffer),M.__webglDepthbuffer===void 0)M.__webglDepthbuffer=s.createRenderbuffer(),st(M.__webglDepthbuffer,P,!1);else{const K=P.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,he=M.__webglDepthbuffer;s.bindRenderbuffer(s.RENDERBUFFER,he),s.framebufferRenderbuffer(s.FRAMEBUFFER,K,s.RENDERBUFFER,he)}}t.bindFramebuffer(s.FRAMEBUFFER,null)}function ae(P,M,V){const H=n.get(P);M!==void 0&&Ie(H.__webglFramebuffer,P,P.texture,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,0),V!==void 0&&ie(P)}function re(P){const M=P.texture,V=n.get(P),H=n.get(M);P.addEventListener("dispose",x);const K=P.textures,he=P.isWebGLCubeRenderTarget===!0,ue=K.length>1;if(ue||(H.__webglTexture===void 0&&(H.__webglTexture=s.createTexture()),H.__version=M.version,a.memory.textures++),he){V.__webglFramebuffer=[];for(let J=0;J<6;J++)if(M.mipmaps&&M.mipmaps.length>0){V.__webglFramebuffer[J]=[];for(let Z=0;Z<M.mipmaps.length;Z++)V.__webglFramebuffer[J][Z]=s.createFramebuffer()}else V.__webglFramebuffer[J]=s.createFramebuffer()}else{if(M.mipmaps&&M.mipmaps.length>0){V.__webglFramebuffer=[];for(let J=0;J<M.mipmaps.length;J++)V.__webglFramebuffer[J]=s.createFramebuffer()}else V.__webglFramebuffer=s.createFramebuffer();if(ue)for(let J=0,Z=K.length;J<Z;J++){const me=n.get(K[J]);me.__webglTexture===void 0&&(me.__webglTexture=s.createTexture(),a.memory.textures++)}if(P.samples>0&&Xe(P)===!1){V.__webglMultisampledFramebuffer=s.createFramebuffer(),V.__webglColorRenderbuffer=[],t.bindFramebuffer(s.FRAMEBUFFER,V.__webglMultisampledFramebuffer);for(let J=0;J<K.length;J++){const Z=K[J];V.__webglColorRenderbuffer[J]=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,V.__webglColorRenderbuffer[J]);const me=r.convert(Z.format,Z.colorSpace),Ne=r.convert(Z.type),fe=v(Z.internalFormat,me,Ne,Z.normalized,Z.colorSpace,P.isXRRenderTarget===!0),de=Ge(P);s.renderbufferStorageMultisample(s.RENDERBUFFER,de,fe,P.width,P.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+J,s.RENDERBUFFER,V.__webglColorRenderbuffer[J])}s.bindRenderbuffer(s.RENDERBUFFER,null),P.depthBuffer&&(V.__webglDepthRenderbuffer=s.createRenderbuffer(),st(V.__webglDepthRenderbuffer,P,!0)),t.bindFramebuffer(s.FRAMEBUFFER,null)}}if(he){t.bindTexture(s.TEXTURE_CUBE_MAP,H.__webglTexture),Ve(s.TEXTURE_CUBE_MAP,M);for(let J=0;J<6;J++)if(M.mipmaps&&M.mipmaps.length>0)for(let Z=0;Z<M.mipmaps.length;Z++)Ie(V.__webglFramebuffer[J][Z],P,M,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+J,Z);else Ie(V.__webglFramebuffer[J],P,M,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+J,0);p(M)&&_(s.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(ue){for(let J=0,Z=K.length;J<Z;J++){const me=K[J],Ne=n.get(me);let fe=s.TEXTURE_2D;(P.isWebGL3DRenderTarget||P.isWebGLArrayRenderTarget)&&(fe=P.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(fe,Ne.__webglTexture),Ve(fe,me),Ie(V.__webglFramebuffer,P,me,s.COLOR_ATTACHMENT0+J,fe,0),p(me)&&_(fe)}t.unbindTexture()}else{let J=s.TEXTURE_2D;if((P.isWebGL3DRenderTarget||P.isWebGLArrayRenderTarget)&&(J=P.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(J,H.__webglTexture),Ve(J,M),M.mipmaps&&M.mipmaps.length>0)for(let Z=0;Z<M.mipmaps.length;Z++)Ie(V.__webglFramebuffer[Z],P,M,s.COLOR_ATTACHMENT0,J,Z);else Ie(V.__webglFramebuffer,P,M,s.COLOR_ATTACHMENT0,J,0);p(M)&&_(J),t.unbindTexture()}P.depthBuffer&&ie(P)}function be(P){const M=P.textures;for(let V=0,H=M.length;V<H;V++){const K=M[V];if(p(K)){const he=y(P),ue=n.get(K).__webglTexture;t.bindTexture(he,ue),_(he),t.unbindTexture()}}}const pe=[],ke=[];function Ae(P){if(P.samples>0){if(Xe(P)===!1){const M=P.textures,V=P.width,H=P.height;let K=s.COLOR_BUFFER_BIT;const he=P.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,ue=n.get(P),J=M.length>1;if(J)for(let me=0;me<M.length;me++)t.bindFramebuffer(s.FRAMEBUFFER,ue.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+me,s.RENDERBUFFER,null),t.bindFramebuffer(s.FRAMEBUFFER,ue.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+me,s.TEXTURE_2D,null,0);t.bindFramebuffer(s.READ_FRAMEBUFFER,ue.__webglMultisampledFramebuffer);const Z=P.texture.mipmaps;Z&&Z.length>0?t.bindFramebuffer(s.DRAW_FRAMEBUFFER,ue.__webglFramebuffer[0]):t.bindFramebuffer(s.DRAW_FRAMEBUFFER,ue.__webglFramebuffer);for(let me=0;me<M.length;me++){if(P.resolveDepthBuffer&&(P.depthBuffer&&(K|=s.DEPTH_BUFFER_BIT),P.stencilBuffer&&P.resolveStencilBuffer&&(K|=s.STENCIL_BUFFER_BIT)),J){s.framebufferRenderbuffer(s.READ_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,ue.__webglColorRenderbuffer[me]);const Ne=n.get(M[me]).__webglTexture;s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,Ne,0)}s.blitFramebuffer(0,0,V,H,0,0,V,H,K,s.NEAREST),c===!0&&(pe.length=0,ke.length=0,pe.push(s.COLOR_ATTACHMENT0+me),P.depthBuffer&&P.resolveDepthBuffer===!1&&(pe.push(he),ke.push(he),s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,ke)),s.invalidateFramebuffer(s.READ_FRAMEBUFFER,pe))}if(t.bindFramebuffer(s.READ_FRAMEBUFFER,null),t.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),J)for(let me=0;me<M.length;me++){t.bindFramebuffer(s.FRAMEBUFFER,ue.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+me,s.RENDERBUFFER,ue.__webglColorRenderbuffer[me]);const Ne=n.get(M[me]).__webglTexture;t.bindFramebuffer(s.FRAMEBUFFER,ue.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+me,s.TEXTURE_2D,Ne,0)}t.bindFramebuffer(s.DRAW_FRAMEBUFFER,ue.__webglMultisampledFramebuffer)}else if(P.depthBuffer&&P.resolveDepthBuffer===!1&&c){const M=P.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,[M])}}}function Ge(P){return Math.min(i.maxSamples,P.samples)}function Xe(P){const M=n.get(P);return P.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&M.__useRenderToTexture!==!1}function N(P){const M=a.render.frame;h.get(P)!==M&&(h.set(P,M),P.update())}function ot(P,M){const V=P.colorSpace,H=P.format,K=P.type;return P.isCompressedTexture===!0||P.isVideoTexture===!0||V!==an&&V!==Jn&&(nt.getTransfer(V)===ct?(H!==un||K!==Jt)&&Ce("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):We("WebGLTextures: Unsupported texture color space:",V)),M}function $e(P){return typeof HTMLImageElement<"u"&&P instanceof HTMLImageElement?(l.width=P.naturalWidth||P.width,l.height=P.naturalHeight||P.height):typeof VideoFrame<"u"&&P instanceof VideoFrame?(l.width=P.displayWidth,l.height=P.displayHeight):(l.width=P.width,l.height=P.height),l}this.allocateTextureUnit=B,this.resetTextureUnits=F,this.getTextureUnits=O,this.setTextureUnits=I,this.setTexture2D=j,this.setTexture2DArray=Y,this.setTexture3D=ne,this.setTextureCube=oe,this.rebindTextures=ae,this.setupRenderTarget=re,this.updateRenderTargetMipmap=be,this.updateMultisampleRenderTarget=Ae,this.setupDepthRenderbuffer=ie,this.setupFrameBufferTexture=Ie,this.useMultisampledRTT=Xe,this.isReversedDepthBuffer=function(){return t.buffers.depth.getReversed()}}function sv(s,e){function t(n,i=Jn){let r;const a=nt.getTransfer(i);if(n===Jt)return s.UNSIGNED_BYTE;if(n===Sc)return s.UNSIGNED_SHORT_4_4_4_4;if(n===Tc)return s.UNSIGNED_SHORT_5_5_5_1;if(n===ru)return s.UNSIGNED_INT_5_9_9_9_REV;if(n===au)return s.UNSIGNED_INT_10F_11F_11F_REV;if(n===iu)return s.BYTE;if(n===su)return s.SHORT;if(n===Vs)return s.UNSIGNED_SHORT;if(n===yc)return s.INT;if(n===Vn)return s.UNSIGNED_INT;if(n===rn)return s.FLOAT;if(n===Ct)return s.HALF_FLOAT;if(n===ou)return s.ALPHA;if(n===cu)return s.RGB;if(n===un)return s.RGBA;if(n===ti)return s.DEPTH_COMPONENT;if(n===pi)return s.DEPTH_STENCIL;if(n===Ec)return s.RED;if(n===wc)return s.RED_INTEGER;if(n===Pi)return s.RG;if(n===Ac)return s.RG_INTEGER;if(n===Rc)return s.RGBA_INTEGER;if(n===jr||n===Kr||n===Yr||n===Jr)if(a===ct)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===jr)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Kr)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Yr)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Jr)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===jr)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Kr)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Yr)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Jr)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Ao||n===Ro||n===Co||n===Po)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===Ao)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Ro)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Co)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Po)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Do||n===Lo||n===No||n===Io||n===Fo||n===$r||n===Uo)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(n===Do||n===Lo)return a===ct?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===No)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC;if(n===Io)return r.COMPRESSED_R11_EAC;if(n===Fo)return r.COMPRESSED_SIGNED_R11_EAC;if(n===$r)return r.COMPRESSED_RG11_EAC;if(n===Uo)return r.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===Oo||n===Bo||n===ko||n===zo||n===Go||n===Vo||n===Ho||n===Wo||n===Xo||n===qo||n===jo||n===Ko||n===Yo||n===Jo)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(n===Oo)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Bo)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===ko)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===zo)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Go)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Vo)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Ho)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Wo)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Xo)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===qo)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===jo)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Ko)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Yo)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Jo)return a===ct?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Zo||n===Qo||n===$o)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(n===Zo)return a===ct?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Qo)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===$o)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===ec||n===tc||n===ea||n===nc)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(n===ec)return r.COMPRESSED_RED_RGTC1_EXT;if(n===tc)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===ea)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===nc)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===os?s.UNSIGNED_INT_24_8:s[n]!==void 0?s[n]:null}return{convert:t}}const rv=`
4093void main() {
4094
4095	gl_Position = vec4( position, 1.0 );
4096
4097}`,av=`
4098uniform sampler2DArray depthColor;
4099uniform float depthWidth;
4100uniform float depthHeight;
4101
4102void main() {
4103
4104	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
4105
4106	if ( coord.x >= 1.0 ) {
4107
4108		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
4109
4110	} else {
4111
4112		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
4113
4114	}
4115
4116}`;class ov{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new vu(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Tt({vertexShader:rv,fragmentShader:av,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ke(new nr(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class cv extends xi{constructor(e,t){super();const n=this;let i=null,r=1,a=null,o="local-floor",c=1,l=null,h=null,u=null,d=null,f=null,g=null;const b=typeof XRWebGLBinding<"u",m=new ov,p={},_=t.getContextAttributes();let y=null,v=null;const T=[],E=[],C=new te;let x=null;const S=new $t;S.viewport=new dt;const A=new $t;A.viewport=new dt;const R=[S,A],D=new am;let F=null,O=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(k){let ee=T[k];return ee===void 0&&(ee=new Ca,T[k]=ee),ee.getTargetRaySpace()},this.getControllerGrip=function(k){let ee=T[k];return ee===void 0&&(ee=new Ca,T[k]=ee),ee.getGripSpace()},this.getHand=function(k){let ee=T[k];return ee===void 0&&(ee=new Ca,T[k]=ee),ee.getHandSpace()};function I(k){const ee=E.indexOf(k.inputSource);if(ee===-1)return;const Q=T[ee];Q!==void 0&&(Q.update(k.inputSource,k.frame,l||a),Q.dispatchEvent({type:k.type,data:k.inputSource}))}function B(){i.removeEventListener("select",I),i.removeEventListener("selectstart",I),i.removeEventListener("selectend",I),i.removeEventListener("squeeze",I),i.removeEventListener("squeezestart",I),i.removeEventListener("squeezeend",I),i.removeEventListener("end",B),i.removeEventListener("inputsourceschange",G);for(let k=0;k<T.length;k++){const ee=E[k];ee!==null&&(E[k]=null,T[k].disconnect(ee))}F=null,O=null,m.reset();for(const k in p)delete p[k];e.setRenderTarget(y),f=null,d=null,u=null,i=null,v=null,Ve.stop(),n.isPresenting=!1,e.setPixelRatio(x),e.setSize(C.width,C.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(k){r=k,n.isPresenting===!0&&Ce("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(k){o=k,n.isPresenting===!0&&Ce("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(k){l=k},this.getBaseLayer=function(){return d!==null?d:f},this.getBinding=function(){return u===null&&b&&(u=new XRWebGLBinding(i,t)),u},this.getFrame=function(){return g},this.getSession=function(){return i},this.setSession=async function(k){if(i=k,i!==null){if(y=e.getRenderTarget(),i.addEventListener("select",I),i.addEventListener("selectstart",I),i.addEventListener("selectend",I),i.addEventListener("squeeze",I),i.addEventListener("squeezestart",I),i.addEventListener("squeezeend",I),i.addEventListener("end",B),i.addEventListener("inputsourceschange",G),_.xrCompatible!==!0&&await t.makeXRCompatible(),x=e.getPixelRatio(),e.getSize(C),b&&"createProjectionLayer"in XRWebGLBinding.prototype){let Q=null,Se=null,Le=null;_.depth&&(Le=_.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,Q=_.stencil?pi:ti,Se=_.stencil?os:Vn);const Ie={colorFormat:t.RGBA8,depthFormat:Le,scaleFactor:r};u=this.getBinding(),d=u.createProjectionLayer(Ie),i.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),v=new zt(d.textureWidth,d.textureHeight,{format:un,type:Jt,depthTexture:new Di(d.textureWidth,d.textureHeight,Se,void 0,void 0,void 0,void 0,void 0,void 0,Q),stencilBuffer:_.stencil,colorSpace:e.outputColorSpace,samples:_.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const Q={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:r};f=new XRWebGLLayer(i,t,Q),i.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),v=new zt(f.framebufferWidth,f.framebufferHeight,{format:un,type:Jt,colorSpace:e.outputColorSpace,stencilBuffer:_.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}v.isXRRenderTarget=!0,this.setFoveation(c),l=null,a=await i.requestReferenceSpace(o),Ve.setContext(i),Ve.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};function G(k){for(let ee=0;ee<k.removed.length;ee++){const Q=k.removed[ee],Se=E.indexOf(Q);Se>=0&&(E[Se]=null,T[Se].disconnect(Q))}for(let ee=0;ee<k.added.length;ee++){const Q=k.added[ee];let Se=E.indexOf(Q);if(Se===-1){for(let Ie=0;Ie<T.length;Ie++)if(Ie>=E.length){E.push(Q),Se=Ie;break}else if(E[Ie]===null){E[Ie]=Q,Se=Ie;break}if(Se===-1)break}const Le=T[Se];Le&&Le.connect(Q)}}const j=new L,Y=new L;function ne(k,ee,Q){j.setFromMatrixPosition(ee.matrixWorld),Y.setFromMatrixPosition(Q.matrixWorld);const Se=j.distanceTo(Y),Le=ee.projectionMatrix.elements,Ie=Q.projectionMatrix.elements,st=Le[14]/(Le[10]-1),He=Le[14]/(Le[10]+1),ie=(Le[9]+1)/Le[5],ae=(Le[9]-1)/Le[5],re=(Le[8]-1)/Le[0],be=(Ie[8]+1)/Ie[0],pe=st*re,ke=st*be,Ae=Se/(-re+be),Ge=Ae*-re;if(ee.matrixWorld.decompose(k.position,k.quaternion,k.scale),k.translateX(Ge),k.translateZ(Ae),k.matrixWorld.compose(k.position,k.quaternion,k.scale),k.matrixWorldInverse.copy(k.matrixWorld).invert(),Le[10]===-1)k.projectionMatrix.copy(ee.projectionMatrix),k.projectionMatrixInverse.copy(ee.projectionMatrixInverse);else{const Xe=st+Ae,N=He+Ae,ot=pe-Ge,$e=ke+(Se-Ge),P=ie*He/N*Xe,M=ae*He/N*Xe;k.projectionMatrix.makePerspective(ot,$e,P,M,Xe,N),k.projectionMatrixInverse.copy(k.projectionMatrix).invert()}}function oe(k,ee){ee===null?k.matrixWorld.copy(k.matrix):k.matrixWorld.multiplyMatrices(ee.matrixWorld,k.matrix),k.matrixWorldInverse.copy(k.matrixWorld).invert()}this.updateCamera=function(k){if(i===null)return;let ee=k.near,Q=k.far;m.texture!==null&&(m.depthNear>0&&(ee=m.depthNear),m.depthFar>0&&(Q=m.depthFar)),D.near=A.near=S.near=ee,D.far=A.far=S.far=Q,(F!==D.near||O!==D.far)&&(i.updateRenderState({depthNear:D.near,depthFar:D.far}),F=D.near,O=D.far),D.layers.mask=k.layers.mask|6,S.layers.mask=D.layers.mask&-5,A.layers.mask=D.layers.mask&-3;const Se=k.parent,Le=D.cameras;oe(D,Se);for(let Ie=0;Ie<Le.length;Ie++)oe(Le[Ie],Se);Le.length===2?ne(D,S,A):D.projectionMatrix.copy(S.projectionMatrix),ce(k,D,Se)};function ce(k,ee,Q){Q===null?k.matrix.copy(ee.matrixWorld):(k.matrix.copy(Q.matrixWorld),k.matrix.invert(),k.matrix.multiply(ee.matrixWorld)),k.matrix.decompose(k.position,k.quaternion,k.scale),k.updateMatrixWorld(!0),k.projectionMatrix.copy(ee.projectionMatrix),k.projectionMatrixInverse.copy(ee.projectionMatrixInverse),k.isPerspectiveCamera&&(k.fov=cs*2*Math.atan(1/k.projectionMatrix.elements[5]),k.zoom=1)}this.getCamera=function(){return D},this.getFoveation=function(){if(!(d===null&&f===null))return c},this.setFoveation=function(k){c=k,d!==null&&(d.fixedFoveation=k),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=k)},this.hasDepthSensing=function(){return m.texture!==null},this.getDepthSensingMesh=function(){return m.getMesh(D)},this.getCameraTexture=function(k){return p[k]};let Ee=null;function je(k,ee){if(h=ee.getViewerPose(l||a),g=ee,h!==null){const Q=h.views;f!==null&&(e.setRenderTargetFramebuffer(v,f.framebuffer),e.setRenderTarget(v));let Se=!1;Q.length!==D.cameras.length&&(D.cameras.length=0,Se=!0);for(let He=0;He<Q.length;He++){const ie=Q[He];let ae=null;if(f!==null)ae=f.getViewport(ie);else{const be=u.getViewSubImage(d,ie);ae=be.viewport,He===0&&(e.setRenderTargetTextures(v,be.colorTexture,be.depthStencilTexture),e.setRenderTarget(v))}let re=R[He];re===void 0&&(re=new $t,re.layers.enable(He),re.viewport=new dt,R[He]=re),re.matrix.fromArray(ie.transform.matrix),re.matrix.decompose(re.position,re.quaternion,re.scale),re.projectionMatrix.fromArray(ie.projectionMatrix),re.projectionMatrixInverse.copy(re.projectionMatrix).invert(),re.viewport.set(ae.x,ae.y,ae.width,ae.height),He===0&&(D.matrix.copy(re.matrix),D.matrix.decompose(D.position,D.quaternion,D.scale)),Se===!0&&D.cameras.push(re)}const Le=i.enabledFeatures;if(Le&&Le.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&b){u=n.getBinding();const He=u.getDepthInformation(Q[0]);He&&He.isValid&&He.texture&&m.init(He,i.renderState)}if(Le&&Le.includes("camera-access")&&b){e.state.unbindTexture(),u=n.getBinding();for(let He=0;He<Q.length;He++){const ie=Q[He].camera;if(ie){let ae=p[ie];ae||(ae=new vu,p[ie]=ae);const re=u.getCameraImage(ie);ae.sourceTexture=re}}}}for(let Q=0;Q<T.length;Q++){const Se=E[Q],Le=T[Q];Se!==null&&Le!==void 0&&Le.update(Se,ee,l||a)}Ee&&Ee(k,ee),ee.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ee}),g=null}const Ve=new Uu;Ve.setAnimationLoop(je),this.setAnimationLoop=function(k){Ee=k},this.dispose=function(){}}}const lv=new Ye,Vu=new Je;Vu.set(-1,0,0,0,1,0,0,0,1);function hv(s,e){function t(m,p){m.matrixAutoUpdate===!0&&m.updateMatrix(),p.value.copy(m.matrix)}function n(m,p){p.color.getRGB(m.fogColor.value,Ru(s)),p.isFog?(m.fogNear.value=p.near,m.fogFar.value=p.far):p.isFogExp2&&(m.fogDensity.value=p.density)}function i(m,p,_,y,v){p.isNodeMaterial?p.uniformsNeedUpdate=!1:p.isMeshBasicMaterial?r(m,p):p.isMeshLambertMaterial?(r(m,p),p.envMap&&(m.envMapIntensity.value=p.envMapIntensity)):p.isMeshToonMaterial?(r(m,p),u(m,p)):p.isMeshPhongMaterial?(r(m,p),h(m,p),p.envMap&&(m.envMapIntensity.value=p.envMapIntensity)):p.isMeshStandardMaterial?(r(m,p),d(m,p),p.isMeshPhysicalMaterial&&f(m,p,v)):p.isMeshMat
vendor: 4,301 bytes, line 4116
4116capMaterial?(r(m,p),g(m,p)):p.isMeshDepthMaterial?r(m,p):p.isMeshDistanceMaterial?(r(m,p),b(m,p)):p.isMeshNormalMaterial?r(m,p):p.isLineBasicMaterial?(a(m,p),p.isLineDashedMaterial&&o(m,p)):p.isPointsMaterial?c(m,p,_,y):p.isSpriteMaterial?l(m,p):p.isShadowMaterial?(m.color.value.copy(p.color),m.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function r(m,p){m.opacity.value=p.opacity,p.color&&m.diffuse.value.copy(p.color),p.emissive&&m.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(m.map.value=p.map,t(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,t(p.alphaMap,m.alphaMapTransform)),p.bumpMap&&(m.bumpMap.value=p.bumpMap,t(p.bumpMap,m.bumpMapTransform),m.bumpScale.value=p.bumpScale,p.side===en&&(m.bumpScale.value*=-1)),p.normalMap&&(m.normalMap.value=p.normalMap,t(p.normalMap,m.normalMapTransform),m.normalScale.value.copy(p.normalScale),p.side===en&&m.normalScale.value.negate()),p.displacementMap&&(m.displacementMap.value=p.displacementMap,t(p.displacementMap,m.displacementMapTransform),m.displacementScale.value=p.displacementScale,m.displacementBias.value=p.displacementBias),p.emissiveMap&&(m.emissiveMap.value=p.emissiveMap,t(p.emissiveMap,m.emissiveMapTransform)),p.specularMap&&(m.specularMap.value=p.specularMap,t(p.specularMap,m.specularMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest);const _=e.get(p),y=_.envMap,v=_.envMapRotation;y&&(m.envMap.value=y,m.envMapRotation.value.setFromMatrix4(lv.makeRotationFromEuler(v)).transpose(),y.isCubeTexture&&y.isRenderTargetTexture===!1&&m.envMapRotation.value.premultiply(Vu),m.reflectivity.value=p.reflectivity,m.ior.value=p.ior,m.refractionRatio.value=p.refractionRatio),p.lightMap&&(m.lightMap.value=p.lightMap,m.lightMapIntensity.value=p.lightMapIntensity,t(p.lightMap,m.lightMapTransform)),p.aoMap&&(m.aoMap.value=p.aoMap,m.aoMapIntensity.value=p.aoMapIntensity,t(p.aoMap,m.aoMapTransform))}function a(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,p.map&&(m.map.value=p.map,t(p.map,m.mapTransform))}function o(m,p){m.dashSize.value=p.dashSize,m.totalSize.value=p.dashSize+p.gapSize,m.scale.value=p.scale}function c(m,p,_,y){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.size.value=p.size*_,m.scale.value=y*.5,p.map&&(m.map.value=p.map,t(p.map,m.uvTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,t(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function l(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.rotation.value=p.rotation,p.map&&(m.map.value=p.map,t(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,t(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function h(m,p){m.specular.value.copy(p.specular),m.shininess.value=Math.max(p.shininess,1e-4)}function u(m,p){p.gradientMap&&(m.gradientMap.value=p.gradientMap)}function d(m,p){m.metalness.value=p.metalness,p.metalnessMap&&(m.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,m.metalnessMapTransform)),m.roughness.value=p.roughness,p.roughnessMap&&(m.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,m.roughnessMapTransform)),p.envMap&&(m.envMapIntensity.value=p.envMapIntensity)}function f(m,p,_){m.ior.value=p.ior,p.sheen>0&&(m.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),m.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(m.sheenColorMap.value=p.sheenColorMap,t(p.sheenColorMap,m.sheenColorMapTransform)),p.sheenRoughnessMap&&(m.sheenRoughnessMap.value=p.sheenRoughnessMap,t(p.sheenRoughnessMap,m.sheenRoughnessMapTransform))),p.clearcoat>0&&(m.clearcoat.value=p.clearcoat,m.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(m.clearcoatMap.value=p.clearcoatMap,t(p.clearcoatMap,m.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,t(p.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(m.clearcoatNormalMap.value=p.clearcoatNormalMap,t(p.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===en&&m.clearcoatNormalScale.value.negate())),p.dispersion>0&&(m.dispersion.value=p.dispersion),p.iridescence>0&&(m.iridescence.value=p.iridescence,m.iridescenceIOR.value=p.iridescenceIOR,m.
4116iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(m.iridescenceMap.value=p.iridescenceMap,t(p.iridescenceMap,m.iridescenceMapTransform)),p.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=p.iridescenceThicknessMap,t(p.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),p.transmission>0&&(m.transmission.value=p.transmission,m.transmissionSamplerMap.value=_.texture,m.transmissionSamplerSize.value.set(_.width,_.height),p.transmissionMap&&(m.transmissionMap.value=p.transmissionMap,t(p.transmissionMap,m.transmissionMapTransform)),m.thickness.value=p.thickness,p.thicknessMap&&(m.thicknessMap.value=p.thicknessMap,t(p.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=p.attenuationDistance,m.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(m.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(m.anisotropyMap.value=p.anisotropyMap,t(p.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=p.specularIntensity,m.specularColor.value.copy(p.specularColor),p.specularColorMap&&(m.specularColorMap.value=p.specularColorMap,t(p.specularColorMap,m.specularColorMapTransform)),p.specularIntensityMap&&(m.specularIntensityMap.value=p.specularIntensityMap,t(p.specularIntensityMap,m.specularIntensityMapTransform))}function g(m,p){p.matcap&&(m.matcap.value=p.matcap)}function b(m,p){const _=e.get(p).light;m.referencePosition.value.setFromMatrixPosition(_.matrixWorld),m.nearDistance.value=_.shadow.camera.near,m.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function uv(s,e,t,n){let i={},r={},a=[];const o=s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS);function c(v,T){const E=T.program;n.uniformBlockBinding(v,E)}function l(v,T){let E=i[v.id];E===void 0&&(m(v),E=h(v),i[v.id]=E,v.addEventListener("dispose",_));const C=T.program;n.updateUBOMapping(v,C);const x=e.render.frame;r[v.id]!==x&&(d(v),r[v.id]=x)}function h(v){const T=u();v.__bindingPointIndex=T;const E=s.createBuffer(),C=v.__size,x=v.usage;return s.bindBuffer(s.UNIFORM_BUFFER,E),s.bufferData(s.UNIFORM_BUFFER,C,x),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,T,E),E}function u(){for(let v=0;v<o;v++)if(a.indexOf(v)===-1)return a.push(v),v;return We("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(v){const T=i[v.id],E=v.uniforms,C=v.__cache;s.bindBuffer(s.UNIFORM_BUFFER,T);for(let x=0,S=E.length;x<S;x++){const A=E[x];if(Array.isArray(A))for(let R=0,D=A.length;R<D;R++)f(A[R],x,R,C);else f(A,x,0,C)}s.bindBuffer(s.UNIFORM_BUFFER,null)}function f(v,T,E,C){if(b(v,T,E,C)===!0){const x=v.__offset,S=v.value;if(Array.isArray(S)){let A=0;for(let R=0;R<S.length;R++){const D=S[R],F=p(D);g(D,v.__data,A),typeof D!="number"&&typeof D!="boolean"&&!D.isMatrix3&&!ArrayBuffer.isView(D)&&(A+=F.storage/Float32Array.BYTES_PER_ELEMENT)}}else g(S,v.__data,0);s.bufferSubData(s.UNIFORM_BUFFER,x,v.__data)}}function g(v,T,E){typeof v=="number"||typeof v=="boolean"?T[0]=v:v.isMatrix3?(T[0]=v.elements[0],T[1]=v.elements[1],T[2]=v.elements[2],T[3]=0,T[4]=v.elements[3],T[5]=v.elements[4],T[6]=v.elements[5],T[7]=0,T[8]=v.elements[6],T[9]=v.elements[7],T[10]=v.elements[8],T[11]=0):ArrayBuffer.isView(v)?T.set(new v.constructor(v.buffer,v.byteOffset,T.length)):v.toArray(T,E)}function b(v,T,E,C){const x=v.value,S=T+"_"+E;if(C[S]===void 0)return typeof x=="number"||typeof x=="boolean"?C[S]=x:ArrayBuffer.isView(x)?C[S]=x.slice():C[S]=x.clone(),!0;{const A=C[S];if(typeof x=="number"||typeof x=="boolean"){if(A!==x)return C[S]=x,!0}else{if(ArrayBuffer.isView(x))return!0;if(A.equals(x)===!1)return A.copy(x),!0}}return!1}function m(v){const T=v.uniforms;let E=0;const C=16;for(let S=0,A=T.length;S<A;S++){const R=Array.isArray(T[S])?T[S]:[T[S]];for(let D=0,F=R.length;D<F;D++){const O=R[D],I=Array.isArray(O.value)?O.value:[O.value];for(let B=0,G=I.length;B<G;B++){const j=I[B],Y=p(j),ne=E%C,oe=ne%Y.boundary,ce=ne+oe;E+=oe,ce!==0&&C-ce<Y.storage&&(E+=C-ce),O.__data=new Float32Array(Y.storage/Float32Array.BYTES_PER_ELEMENT),O.__offset=E,E+=Y.storage}}}const x=E%C;return x>0&&(E+=C-x),v.__size=E,v.__cache={},this}function p(v){const T={boundary:0,storage:0};return typeof v=="number"||typeof v=="boolean"?(T.boundary=4,T.storage=4):v.isVector2?(T.boundary=8,T.storage=8):v.isVector3||v.isColor?(T.boundary=16,T.storage=12):v.isVector4?(T.boundary=16,T.storage=16):v.isMatrix3?(T.boundary=48,T.storage=48):v.isMatrix4?(T.boundary=64,T.storage=64):v.isTexture?Ce("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(v)?(T.boundary=16,T.storage=v.byteLength):Ce("WebGLRenderer: Unsupported uniform value type.",v),T}function _(v){const T=v.target;T.removeEventListener("dispose",_);const E=a.indexOf(T.__bindingPointIndex);a.splice(E,1),s.deleteBuffer(i[T.id]),delete i[T.id],delete r[T.id]}function y(){for(const v in i)s.deleteBuffer(i[v]);a=[],i={},r={}}return{bind:c,update:l,dispose:y}}const dv=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10
vendor: 5,233 bytes, line 4116
4116751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Fn=null;function fv(){return Fn===null&&(Fn=new bi(dv,16,16,Pi,Ct),Fn.name="DFG_LUT",Fn.minFilter=Mt,Fn.magFilter=Mt,Fn.wrapS=xn,Fn.wrapT=xn,Fn.generateMipmaps=!1,Fn.needsUpdate=!0),Fn}class pv{constructor(e={}){const{canvas:t=ef(),context:n=null,depth:i=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:l=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1,outputBufferType:f=Jt}=e;this.isWebGLRenderer=!0;let g;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=n.getContextAttributes().alpha}else g=a;const b=f,m=new Set([Rc,Ac,wc]),p=new Set([Jt,Vn,Vs,os,Sc,Tc]),_=new Uint32Array(4),y=new Int32Array(4),v=new L;let T=null,E=null;const C=[],x=[];let S=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Gn,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const A=this;let R=!1,D=null,F=null,O=null,I=null;this._outputColorSpace=kt;let B=0,G=0,j=null,Y=-1,ne=null;const oe=new dt,ce=new dt;let Ee=null;const je=new ze(0);let Ve=0,k=t.width,ee=t.height,Q=1,Se=null,Le=null;const Ie=new dt(0,0,k,ee),st=new dt(0,0,k,ee);let He=!1;const ie=new Fc;let ae=!1,re=!1;const be=new Ye,pe=new L,ke=new dt,Ae={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ge=!1;function Xe(){return j===null?Q:1}let N=n;function ot(w,z){return t.getContext(w,z)}try{const w={alpha:!0,depth:i,stencil:r,antialias:o,premultipliedAlpha:c,preserveDrawingBuffer:l,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${mc}`),t.addEventListener("webglcontextlost",Pt,!1),t.addEventListener("webglcontextrestored",vt,!1),t.addEventListener("webglcontextcreationerror",Dn,!1),N===null){const z="webgl2";if(N=ot(z,w),N===null)throw ot(z)?new Error("THREE.WebGLRenderer: Error creating WebGL context with your selected attributes."):new Error("THREE.WebGLRenderer: Error creating WebGL context.")}}catch(w){throw We("WebGLRenderer: "+w.message),w}let $e,P,M,V,H,K,he,ue,J,Z,me,Ne,fe,de,Pe,Oe,qe,U,ge,$,xe,ye,se;function Fe(){$e=new fb(N),$e.init(),xe=new sv(N,$e),P=new rb(N,$e,e,xe),M=new nv(N,$e),P.reversedDepthBuffer&&d&&M.buffers.depth.setReversed(!0),F=N.createFramebuffer(),O=N.createFramebuffer(),I=N.createFramebuffer(),V=new gb(N),H=new Vx,K=new iv(N,$e,M,H,P,xe,V),he=new db(A),ue=new _m(N),ye=new ib(N,ue),J=new pb(N,ue,V,ye),Z=new xb(N,J,ue,ye,V),U=new bb(N,P,K),Pe=new ab(H),me=new Gx(A,he,$e,P,ye,Pe),Ne=new hv(A,H),fe=new Wx,de=new Jx($e),qe=new nb(A,he,M,Z,g,c),Oe=new tv
vendor: 4,937 bytes, line 4116
4116(A,Z,P),se=new uv(N,V,P,M),ge=new sb(N,$e,V),$=new mb(N,$e,V),V.programs=me.programs,A.capabilities=P,A.extensions=$e,A.properties=H,A.renderLists=fe,A.shadowMap=Oe,A.state=M,A.info=V}Fe(),b!==Jt&&(S=new _b(b,t.width,t.height,o,i,r));const Re=new cv(A,N);this.xr=Re,this.getContext=function(){return N},this.getContextAttributes=function(){return N.getContextAttributes()},this.forceContextLoss=function(){const w=$e.get("WEBGL_lose_context");w&&w.loseContext()},this.forceContextRestore=function(){const w=$e.get("WEBGL_lose_context");w&&w.restoreContext()},this.getPixelRatio=function(){return Q},this.setPixelRatio=function(w){w!==void 0&&(Q=w,this.setSize(k,ee,!1))},this.getSize=function(w){return w.set(k,ee)},this.setSize=function(w,z,q=!0){if(Re.isPresenting){Ce("WebGLRenderer: Can't change size while VR device is presenting.");return}k=w,ee=z,t.width=Math.floor(w*Q),t.height=Math.floor(z*Q),q===!0&&(t.style.width=w+"px",t.style.height=z+"px"),S!==null&&S.setSize(t.width,t.height),this.setViewport(0,0,w,z)},this.getDrawingBufferSize=function(w){return w.set(k*Q,ee*Q).floor()},this.setDrawingBufferSize=function(w,z,q){k=w,ee=z,Q=q,t.width=Math.floor(w*q),t.height=Math.floor(z*q),this.setViewport(0,0,w,z)},this.setEffects=function(w){if(b===Jt){We("WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(w){for(let z=0;z<w.length;z++)if(w[z].isOutputPass===!0){Ce("WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}S.setEffects(w||[])},this.getCurrentViewport=function(w){return w.copy(oe)},this.getViewport=function(w){return w.copy(Ie)},this.setViewport=function(w,z,q,W){w.isVector4?Ie.set(w.x,w.y,w.z,w.w):Ie.set(w,z,q,W),M.viewport(oe.copy(Ie).multiplyScalar(Q).round())},this.getScissor=function(w){return w.copy(st)},this.setScissor=function(w,z,q,W){w.isVector4?st.set(w.x,w.y,w.z,w.w):st.set(w,z,q,W),M.scissor(ce.copy(st).multiplyScalar(Q).round())},this.getScissorTest=function(){return He},this.setScissorTest=function(w){M.setScissorTest(He=w)},this.setOpaqueSort=function(w){Se=w},this.setTransparentSort=function(w){Le=w},this.getClearColor=function(w){return w.copy(qe.getClearColor())},this.setClearColor=function(){qe.setClearColor(...arguments)},this.getClearAlpha=function(){return qe.getClearAlpha()},this.setClearAlpha=function(){qe.setClearAlpha(...arguments)},this.clear=function(w=!0,z=!0,q=!0){let W=0;if(w){let X=!1;if(j!==null){const Me=j.texture.format;X=m.has(Me)}if(X){const Me=j.texture.type,we=p.has(Me),_e=qe.getClearColor(),De=qe.getClearAlpha(),Ue=_e.r,Ze=_e.g,tt=_e.b;we?(_[0]=Ue,_[1]=Ze,_[2]=tt,_[3]=De,N.clearBufferuiv(N.COLOR,0,_)):(y[0]=Ue,y[1]=Ze,y[2]=tt,y[3]=De,N.clearBufferiv(N.COLOR,0,y))}else W|=N.COLOR_BUFFER_BIT}z&&(W|=N.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),q&&(W|=N.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),W!==0&&N.clear(W)},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.setNodesHandler=function(w){w.setRenderer(this),D=w},this.dispose=function(){t.removeEventListener("webglcontextlost",Pt,!1),t.removeEventListener("webglcontextrestored",vt,!1),t.removeEventListener("webglcontextcreationerror",Dn,!1),qe.dispose(),fe.dispose(),de.dispose(),H.dispose(),he.dispose(),Z.dispose(),ye.dispose(),se.dispose(),me.dispose(),Re.dispose(),Re.removeEventListener("sessionstart",el),Re.removeEventListener("sessionend",tl),_i.stop()};function Pt(w){w.preventDefault(),ia("WebGLRenderer: Context Lost."),R=!0}function vt(){ia("WebGLRenderer: Context Restored."),R=!1;const w=V.autoReset,z=Oe.enabled,q=Oe.autoUpdate,W=Oe.needsUpdate,X=Oe.type;Fe(),V.autoReset=w,Oe.enabled=z,Oe.autoUpdate=q,Oe.needsUpdate=W,Oe.type=X}function Dn(w){We("WebGLRenderer: A WebGL context could not be created. Reason: ",w.statusMessage)}function Ln(w){const z=w.target;z.removeEventListener("dispose",Ln),Zu(z)}function Zu(w){Qu(w),H.remove(w)}function Qu(w){const z=H.get(w).programs;z!==void 0&&(z.forEach(function(q){me.releaseProgram(q)}),w.isShaderMaterial&&me.releaseShaderCache(w))}this.renderBufferDirect=function(w,z,q,W,X,Me){z===null&&(z=Ae);const we=X.isMesh&&X.matrixWorld.determinantAffine()<0,_e=td(w,z,q,W,X);M.setMaterial(W,we);let De=q.index,Ue=1;if(W.wireframe===!0){if(De=J.getWireframeAttribute(q),De===void 0)return;Ue=2}const Ze=q.drawRange,tt=q.attributes.position;let Be=Ze.start*Ue,ft=(Ze.start+Ze.count)*Ue;Me!==null&&(Be=Math.max(Be,Me.start*Ue),ft=Math.min(ft,(Me.start+Me.count)*Ue)),De!==null?(Be=Math.max(Be,0),ft=Math.min(ft,De.count)):tt!=null&&(Be=Math.max(Be,0),ft=Math.min(ft,tt.count));const It=ft-Be;if(It<0||It===1/0)return;ye.setup(X,W,_e,q,De);let Dt,gt=ge;if(De!==null&&(Dt=ue.get(De),gt=$,gt.setIndex(Dt)),X.isMesh)W.wireframe===!0?(M.setLineWidth(W.wireframeLinewidth*Xe()
vendor: 10,192 bytes, line 4116
4116),gt.setMode(N.LINES)):gt.setMode(N.TRIANGLES);else if(X.isLine){let qt=W.linewidth;qt===void 0&&(qt=1),M.setLineWidth(qt*Xe()),X.isLineSegments?gt.setMode(N.LINES):X.isLineLoop?gt.setMode(N.LINE_LOOP):gt.setMode(N.LINE_STRIP)}else X.isPoints?gt.setMode(N.POINTS):X.isSprite&&gt.setMode(N.TRIANGLES);if(X.isBatchedMesh)if($e.get("WEBGL_multi_draw"))gt.renderMultiDraw(X._multiDrawStarts,X._multiDrawCounts,X._multiDrawCount);else{const qt=X._multiDrawStarts,Te=X._multiDrawCounts,on=X._multiDrawCount,at=De?ue.get(De).bytesPerElement:1,pn=H.get(W).currentProgram.getUniforms();for(let Nn=0;Nn<on;Nn++)pn.setValue(N,"_gl_DrawID",Nn),gt.render(qt[Nn]/at,Te[Nn])}else if(X.isInstancedMesh)gt.renderInstances(Be,It,X.count);else if(q.isInstancedBufferGeometry){const qt=q._maxInstanceCount!==void 0?q._maxInstanceCount:1/0,Te=Math.min(q.instanceCount,qt);gt.renderInstances(Be,It,Te)}else gt.render(Be,It)};function $c(w,z,q){w.transparent===!0&&w.side===Yt&&w.forceSinglePass===!1?(w.side=en,w.needsUpdate=!0,ar(w,z,q),w.side=ei,w.needsUpdate=!0,ar(w,z,q),w.side=Yt):ar(w,z,q)}this.compile=function(w,z,q=null){q===null&&(q=w),E=de.get(q),E.init(z),x.push(E),q.traverseVisible(function(X){X.isLight&&X.layers.test(z.layers)&&(E.pushLight(X),X.castShadow&&E.pushShadow(X))}),w!==q&&w.traverseVisible(function(X){X.isLight&&X.layers.test(z.layers)&&(E.pushLight(X),X.castShadow&&E.pushShadow(X))}),E.setupLights();const W=new Set;return w.traverse(function(X){if(!(X.isMesh||X.isPoints||X.isLine||X.isSprite))return;const Me=X.material;if(Me)if(Array.isArray(Me))for(let we=0;we<Me.length;we++){const _e=Me[we];$c(_e,q,X),W.add(_e)}else $c(Me,q,X),W.add(Me)}),E=x.pop(),W},this.compileAsync=function(w,z,q=null){const W=this.compile(w,z,q);return new Promise(X=>{function Me(){if(W.forEach(function(we){H.get(we).currentProgram.isReady()&&W.delete(we)}),W.size===0){X(w);return}setTimeout(Me,10)}$e.get("KHR_parallel_shader_compile")!==null?Me():setTimeout(Me,10)})};let va=null;function $u(w){va&&va(w)}function el(){_i.stop()}function tl(){_i.start()}const _i=new Uu;_i.setAnimationLoop($u),typeof self<"u"&&_i.setContext(self),this.setAnimationLoop=function(w){va=w,Re.setAnimationLoop(w),w===null?_i.stop():_i.start()},Re.addEventListener("sessionstart",el),Re.addEventListener("sessionend",tl),this.render=function(w,z){if(z!==void 0&&z.isCamera!==!0){We("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(R===!0)return;D!==null&&D.renderStart(w,z);const q=Re.enabled===!0&&Re.isPresenting===!0,W=S!==null&&(j===null||q)&&S.begin(A,j);if(w.matrixWorldAutoUpdate===!0&&w.updateMatrixWorld(),z.parent===null&&z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),Re.enabled===!0&&Re.isPresenting===!0&&(S===null||S.isCompositing()===!1)&&(Re.cameraAutoUpdate===!0&&Re.updateCamera(z),z=Re.getCamera()),w.isScene===!0&&w.onBeforeRender(A,w,z,j),E=de.get(w,x.length),E.init(z),E.state.textureUnits=K.getTextureUnits(),x.push(E),be.multiplyMatrices(z.projectionMatrix,z.matrixWorldInverse),ie.setFromProjectionMatrix(be,kn,z.reversedDepth),re=this.localClippingEnabled,ae=Pe.init(this.clippingPlanes,re),T=fe.get(w,C.length),T.init(),C.push(T),Re.enabled===!0&&Re.isPresenting===!0){const we=A.xr.getDepthSensingMesh();we!==null&&_a(we,z,-1/0,A.sortObjects)}_a(w,z,0,A.sortObjects),T.finish(),A.sortObjects===!0&&T.sort(Se,Le,z.reversedDepth),Ge=Re.enabled===!1||Re.isPresenting===!1||Re.hasDepthSensing()===!1,Ge&&qe.addToRenderList(T,w),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),ae===!0&&Pe.beginShadows();const X=E.state.shadowsArray;if(Oe.render(X,w,z),ae===!0&&Pe.endShadows(),(W&&S.hasRenderPass())===!1){const we=T.opaque,_e=T.transmissive;if(E.setupLights(),z.isArrayCamera){const De=z.cameras;if(_e.length>0)for(let Ue=0,Ze=De.length;Ue<Ze;Ue++){const tt=De[Ue];il(we,_e,w,tt)}Ge&&qe.render(w);for(let Ue=0,Ze=De.length;Ue<Ze;Ue++){const tt=De[Ue];nl(T,w,tt,tt.viewport)}}else _e.length>0&&il(we,_e,w,z),Ge&&qe.render(w),nl(T,w,z)}j!==null&&G===0&&(K.updateMultisampleRenderTarget(j),K.updateRenderTargetMipmap(j)),W&&S.end(A),w.isScene===!0&&w.onAfterRender(A,w,z),ye.resetDefaultState(),Y=-1,ne=null,x.pop(),x.length>0?(E=x[x.length-1],K.setTextureUnits(E.state.textureUnits),ae===!0&&Pe.setGlobalState(A.clippingPlanes,E.state.camera)):E=null,C.pop(),C.length>0?T=C[C.length-1]:T=null,D!==null&&D.renderEnd()};function _a(w,z,q,W){if(w.visible===!1)return;if(w.layers.test(z.layers)){if(w.isGroup)q=w.renderOrder;else if(w.isLOD)w.autoUpdate===!0&&w.update(z);else if(w.isLightProbeGrid)E.pushLightProbeGrid(w);else if(w.isLight)E.pushLight(w),w.castShadow&&E.pushShadow(w);else if(w.isSprite){if(!w.frustumCulled||ie.intersectsSprite(w)){W&&ke.setFromMatrixPosition(w.matrixWorld).applyMatrix4(be);const we=Z.update(w),_e=w.material;_e.visible&&T.push(w,we,_e,q,ke.z,null)}}else if((w.isMesh||w.isLine||w.isPoints)&&(!w.frustumCulled||ie.intersectsObject(w))){const we=Z.update(w),_e=w.material;if(W&&(w.boundingSphere!==void 0?(w.boundingSphere===null&&w.computeBoundingSphere(),ke.copy(w.boundingSphere.center)):(we.boundingSphere===null&&we.computeBoundingSphere(),ke.copy(we.boundingSphere.center)),ke.applyMatrix4(w.matrixWorld).applyMatrix4(be)),Array.isArray(_e)){const De=we.groups;for(let Ue=0,Ze=De.length;Ue<Ze;Ue++){const tt=De[Ue],Be=_e[tt.materialIndex];Be&&Be.visible&&T.push(w,we,Be,q,ke.z,tt)}}else _e.visible&&T.push(w,we,_e,q,ke.z,null)}}const Me=w.children;for(let we=0,_e=Me.length;we<_e;we++)_a(Me[we],z,q,W)}function nl(w,z,q,W){const{opaque:X,transmissive:Me,transparent:we}=w;E.setupLightsView(q),ae===!0&&Pe.setGlobalState(A.clippingPlanes,q),W&&M.viewport(oe.copy(W)),X.length>0&&rr(X,z,q),Me.length>0&&rr(Me,z,q),we.length>0&&rr(we,z,q),M.buffers.depth.setTest(!0),M.buffers.depth.setMask(!0),M.buffers.color.setMask(!0),M.setPolygonOffset(!1)}function il(w,z,q,W){if((q.isScene===!0?q.overrideMaterial:null)!==null)return;if(E.state.transmissionRenderTarget[W.id]===void 0){const Be=$e.has("EXT_color_buffer_half_float")||$e.has("EXT_color_buffer_float");E.state.transmissionRenderTarget[W.id]=new zt(1,1,{generateMipmaps:!0,type:Be?Ct:Jt,minFilter:An,samples:Math.max(4,P.samples),stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:nt.workingColorSpace})}const Me=E.state.transmissionRenderTarget[W.id],we=W.viewport||oe;Me.setSize(we.z*A.transmissionResolutionScale,we.w*A.transmissionResolutionScale);const _e=A.getRenderTarget(),De=A.getActiveCubeFace(),Ue=A.getActiveMipmapLevel();A.setRenderTarget(Me),A.getClearColor(je),Ve=A.getClearAlpha(),Ve<1&&A.setClearColor(16777215,.5),A.clear(),Ge&&qe.render(q);const Ze=A.toneMapping;A.toneMapping=Gn;const tt=W.viewport;if(W.viewport!==void 0&&(W.viewport=void 0),E.setupLightsView(W),ae===!0&&Pe.setGlobalState(A.clippingPlanes,W),rr(w,q,W),K.updateMultisampleRenderTarget(Me),K.updateRenderTargetMipmap(Me),$e.has("WEBGL_multisampled_render_to_texture")===!1){let Be=!1;for(let ft=0,It=z.length;ft<It;ft++){const Dt=z[ft],{object:gt,geometry:qt,material:Te,group:on}=Dt;if(Te.side===Yt&&gt.layers.test(W.layers)){const at=Te.side;Te.side=en,Te.needsUpdate=!0,sl(gt,q,W,qt,Te,on),Te.side=at,Te.needsUpdate=!0,Be=!0}}Be===!0&&(K.updateMultisampleRenderTarget(Me),K.updateRenderTargetMipmap(Me))}A.setRenderTarget(_e,De,Ue),A.setClearColor(je,Ve),tt!==void 0&&(W.viewport=tt),A.toneMapping=Ze}function rr(w,z,q){const W=z.isScene===!0?z.overrideMaterial:null;for(let X=0,Me=w.length;X<Me;X++){const we=w[X],{object:_e,geometry:De,group:Ue}=we;let Ze=we.material;Ze.allowOverride===!0&&W!==null&&(Ze=W),_e.layers.test(q.layers)&&sl(_e,z,q,De,Ze,Ue)}}function sl(w,z,q,W,X,Me){w.onBeforeRender(A,z,q,W,X,Me),w.modelViewMatrix.multiplyMatrices(q.matrixWorldInverse,w.matrixWorld),w.normalMatrix.getNormalMatrix(w.modelViewMatrix),X.onBeforeRender(A,z,q,W,w,Me),X.transparent===!0&&X.side===Yt&&X.forceSinglePass===!1?(X.side=en,X.needsUpdate=!0,A.renderBufferDirect(q,z,W,X,w,Me),X.side=ei,X.needsUpdate=!0,A.renderBufferDirect(q,z,W,X,w,Me),X.side=Yt):A.renderBufferDirect(q,z,W,X,w,Me),w.onAfterRender(A,z,q,W,X,Me)}function ar(w,z,q){z.isScene!==!0&&(z=Ae);const W=H.get(w),X=E.state.lights,Me=E.state.shadowsArray,we=X.state.version,_e=me.getParameters(w,X.state,Me,z,q,E.state.lightProbeGridArray),De=me.getProgramCacheKey(_e);let Ue=W.programs;W.environment=w.isMeshStandardMaterial||w.isMeshLambertMaterial||w.isMeshPhongMaterial?z.environment:null,W.fog=z.fog;const Ze=w.isMeshStandardMaterial||w.isMeshLambertMaterial&&!w.envMap||w.isMeshPhongMaterial&&!w.envMap;W.envMap=he.get(w.envMap||W.environment,Ze),W.envMapRotation=W.environment!==null&&w.envMap===null?z.environmentRotation:w.envMapRotation,Ue===void 0&&(w.addEventListener("dispose",Ln),Ue=new Map,W.programs=Ue);let tt=Ue.get(De);if(tt!==void 0){if(W.currentProgram===tt&&W.lightsStateVersion===we)return al(w,_e),tt}else _e.uniforms=me.getUniforms(w),D!==null&&w.isNodeMaterial&&D.build(w,q,_e),w.onBeforeCompile(_e,A),tt=me.acquireProgram(_e,De),Ue.set(De,tt),W.uniforms=_e.uniforms;const Be=W.uniforms;return(!w.isShaderMaterial&&!w.isRawShaderMaterial||w.clipping===!0)&&(Be.clippingPlanes=Pe.uniform),al(w,_e),W.needsLights=id(w),W.lightsStateVersion=we,W.needsLights&&(Be.ambientLightColor.value=X.state.ambient,Be.lightProbe.value=X.state.probe,Be.directionalLights.value=X.state.directional,Be.directionalLightShadows.value=X.state.directionalShadow,Be.spotLights.value=X.state.spot,Be.spotLightShadows.value=X.state.spotShadow,Be.rectAreaLights.value=X.state.rectArea,Be.ltc_1.value=X.state.rectAreaLTC1,Be.ltc_2.value=X.state.rectAreaLTC2,Be.pointLights.value=X.state.point,Be.pointLightShadows.value=X.state.pointShadow,Be.hemisphereLights.value=X.state.hemi,Be.directionalShadowMatrix.value=X.state.directionalShadowMatrix,Be.spotLightMatrix.value=X.state.spotLightMatrix,Be.spotLightMap.value=X.state.spotLightMap,Be.pointShadowMatrix.value=X.state.pointShadowMatrix),W.lightProbeGrid=E.state.lightProbeGridArray.length>0,W.currentProgram=tt,W.uniformsList=null,tt}function rl(w){if(w.uniformsList===null){const z=w.currentProgram.getUniforms();w.uniformsList=Zr.seqWithValue(z.seq,w.uniforms)}return w.uniformsList}function al(w,z){const q=H.get(w);
vendor: 9,171 bytes, line 4116
4116q.outputColorSpace=z.outputColorSpace,q.batching=z.batching,q.batchingColor=z.batchingColor,q.instancing=z.instancing,q.instancingColor=z.instancingColor,q.instancingMorph=z.instancingMorph,q.skinning=z.skinning,q.morphTargets=z.morphTargets,q.morphNormals=z.morphNormals,q.morphColors=z.morphColors,q.morphTargetsCount=z.morphTargetsCount,q.numClippingPlanes=z.numClippingPlanes,q.numIntersection=z.numClipIntersection,q.vertexAlphas=z.vertexAlphas,q.vertexTangents=z.vertexTangents,q.toneMapping=z.toneMapping}function ed(w,z){if(w.length===0)return null;if(w.length===1)return w[0].texture!==null?w[0]:null;v.setFromMatrixPosition(z.matrixWorld);for(let q=0,W=w.length;q<W;q++){const X=w[q];if(X.texture!==null&&X.boundingBox.containsPoint(v))return X}return null}function td(w,z,q,W,X){z.isScene!==!0&&(z=Ae),K.resetTextureUnits();const Me=z.fog,we=W.isMeshStandardMaterial||W.isMeshLambertMaterial||W.isMeshPhongMaterial?z.environment:null,_e=j===null?A.outputColorSpace:j.isXRRenderTarget===!0?j.texture.colorSpace:nt.workingColorSpace,De=W.isMeshStandardMaterial||W.isMeshLambertMaterial&&!W.envMap||W.isMeshPhongMaterial&&!W.envMap,Ue=he.get(W.envMap||we,De),Ze=W.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,tt=!!q.attributes.tangent&&(!!W.normalMap||W.anisotropy>0),Be=!!q.morphAttributes.position,ft=!!q.morphAttributes.normal,It=!!q.morphAttributes.color;let Dt=Gn;W.toneMapped&&(j===null||j.isXRRenderTarget===!0)&&(Dt=A.toneMapping);const gt=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,qt=gt!==void 0?gt.length:0,Te=H.get(W),on=E.state.lights;if(ae===!0&&(re===!0||w!==ne)){const _t=w===ne&&W.id===Y;Pe.setState(W,w,_t)}let at=!1;W.version===Te.__version?(Te.needsLights&&Te.lightsStateVersion!==on.state.version||Te.outputColorSpace!==_e||X.isBatchedMesh&&Te.batching===!1||!X.isBatchedMesh&&Te.batching===!0||X.isBatchedMesh&&Te.batchingColor===!0&&X.colorTexture===null||X.isBatchedMesh&&Te.batchingColor===!1&&X.colorTexture!==null||X.isInstancedMesh&&Te.instancing===!1||!X.isInstancedMesh&&Te.instancing===!0||X.isSkinnedMesh&&Te.skinning===!1||!X.isSkinnedMesh&&Te.skinning===!0||X.isInstancedMesh&&Te.instancingColor===!0&&X.instanceColor===null||X.isInstancedMesh&&Te.instancingColor===!1&&X.instanceColor!==null||X.isInstancedMesh&&Te.instancingMorph===!0&&X.morphTexture===null||X.isInstancedMesh&&Te.instancingMorph===!1&&X.morphTexture!==null||Te.envMap!==Ue||W.fog===!0&&Te.fog!==Me||Te.numClippingPlanes!==void 0&&(Te.numClippingPlanes!==Pe.numPlanes||Te.numIntersection!==Pe.numIntersection)||Te.vertexAlphas!==Ze||Te.vertexTangents!==tt||Te.morphTargets!==Be||Te.morphNormals!==ft||Te.morphColors!==It||Te.toneMapping!==Dt||Te.morphTargetsCount!==qt||!!Te.lightProbeGrid!=E.state.lightProbeGridArray.length>0)&&(at=!0):(at=!0,Te.__version=W.version);let pn=Te.currentProgram;at===!0&&(pn=ar(W,z,X),D&&W.isNodeMaterial&&D.onUpdateProgram(W,pn,Te));let Nn=!1,ii=!1,Ii=!1;const bt=pn.getUniforms(),Ft=Te.uniforms;if(M.useProgram(pn.program)&&(Nn=!0,ii=!0,Ii=!0),W.id!==Y&&(Y=W.id,ii=!0),Te.needsLights){const _t=ed(E.state.lightProbeGridArray,X);Te.lightProbeGrid!==_t&&(Te.lightProbeGrid=_t,ii=!0)}if(Nn||ne!==w){M.buffers.depth.getReversed()&&w.reversedDepth!==!0&&(w._reversedDepth=!0,w.updateProjectionMatrix()),bt.setValue(N,"projectionMatrix",w.projectionMatrix),bt.setValue(N,"viewMatrix",w.matrixWorldInverse);const ri=bt.map.cameraPosition;ri!==void 0&&ri.setValue(N,pe.setFromMatrixPosition(w.matrixWorld)),P.logarithmicDepthBuffer&&bt.setValue(N,"logDepthBufFC",2/(Math.log(w.far+1)/Math.LN2)),(W.isMeshPhongMaterial||W.isMeshToonMaterial||W.isMeshLambertMaterial||W.isMeshBasicMaterial||W.isMeshStandardMaterial||W.isShaderMaterial)&&bt.setValue(N,"isOrthographic",w.isOrthographicCamera===!0),ne!==w&&(ne=w,ii=!0,Ii=!0)}if(Te.needsLights&&(on.state.directionalShadowMap.length>0&&bt.setValue(N,"directionalShadowMap",on.state.directionalShadowMap,K),on.state.spotShadowMap.length>0&&bt.setValue(N,"spotShadowMap",on.state.spotShadowMap,K),on.state.pointShadowMap.length>0&&bt.setValue(N,"pointShadowMap",on.state.pointShadowMap,K)),X.isSkinnedMesh){bt.setOptional(N,X,"bindMatrix"),bt.setOptional(N,X,"bindMatrixInverse");const _t=X.skeleton;_t&&(_t.boneTexture===null&&_t.computeBoneTexture(),bt.setValue(N,"boneTexture",_t.boneTexture,K))}X.isBatchedMesh&&(bt.setOptional(N,X,"batchingTexture"),bt.setValue(N,"batchingTexture",X._matricesTexture,K),bt.setOptional(N,X,"batchingIdTexture"),bt.setValue(N,"batchingIdTexture",X._indirectTexture,K),bt.setOptional(N,X,"batchingColorTexture"),X._colorsTexture!==null&&bt.setValue(N,"batchingColorTexture",X._colorsTexture,K));const si=q.morphAttributes;if((si.position!==void 0||si.normal!==void 0||si.color!==void 0)&&U.update(X,q,pn),(ii||Te.receiveShadow!==X.receiveShadow)&&(Te.receiveShadow=X.receiveShadow,bt.setValue(N,"receiveShadow",X.receiveShadow)),(W.isMeshStandardMaterial||W.isMeshLambertMaterial||W.isMeshPhongMaterial)&&W.envMap===null&&z.environment!==null&&(Ft.envMapIntensity.value=z.environmentIntensity),Ft.dfgLUT!==void 0&&(Ft.dfgLUT.value=fv()),ii){if(bt.setValue(N,"toneMappingExposure",A.toneMappingExposure),Te.needsLights&&nd(Ft,Ii),Me&&W.fog===!0&&Ne.refreshFogUniforms(Ft,Me),Ne.refreshMaterialUniforms(Ft,W,Q,ee,E.state.transmissionRenderTarget[w.id]),Te.needsLights&&Te.lightProbeGrid){const _t=Te.lightProbeGrid;Ft.probesSH.value=_t.texture,Ft.probesMin.value.copy(_t.boundingBox.min),Ft.probesMax.value.copy(_t.boundingBox.max),Ft.probesResolution.value.copy(_t.resolution)}Zr.upload(N,rl(Te),Ft,K)}if(W.isShaderMaterial&&W.uniformsNeedUpdate===!0&&(Zr.upload(N,rl(Te),Ft,K),W.uniformsNeedUpdate=!1),W.isSpriteMaterial&&bt.setValue(N,"center",X.center),bt.setValue(N,"modelViewMatrix",X.modelViewMatrix),bt.setValue(N,"normalMatrix",X.normalMatrix),bt.setValue(N,"modelMatrix",X.matrixWorld),W.uniformsGroups!==void 0){const _t=W.uniformsGroups;for(let ri=0,Fi=_t.length;ri<Fi;ri++){const ol=_t[ri];se.update(ol,pn),se.bind(ol,pn)}}return pn}function nd(w,z){w.ambientLightColor.needsUpdate=z,w.lightProbe.needsUpdate=z,w.directionalLights.needsUpdate=z,w.directionalLightShadows.needsUpdate=z,w.pointLights.needsUpdate=z,w.pointLightShadows.needsUpdate=z,w.spotLights.needsUpdate=z,w.spotLightShadows.needsUpdate=z,w.rectAreaLights.needsUpdate=z,w.hemisphereLights.needsUpdate=z}function id(w){return w.isMeshLambertMaterial||w.isMeshToonMaterial||w.isMeshPhongMaterial||w.isMeshStandardMaterial||w.isShadowMaterial||w.isShaderMaterial&&w.lights===!0}this.getActiveCubeFace=function(){return B},this.getActiveMipmapLevel=function(){return G},this.getRenderTarget=function(){return j},this.setRenderTargetTextures=function(w,z,q){const W=H.get(w);W.__autoAllocateDepthBuffer=w.resolveDepthBuffer===!1,W.__autoAllocateDepthBuffer===!1&&(W.__useRenderToTexture=!1),H.get(w.texture).__webglTexture=z,H.get(w.depthTexture).__webglTexture=W.__autoAllocateDepthBuffer?void 0:q,W.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(w,z){const q=H.get(w);q.__webglFramebuffer=z,q.__useDefaultFramebuffer=z===void 0},this.setRenderTarget=function(w,z=0,q=0){j=w,B=z,G=q;let W=null,X=!1,Me=!1;if(w){const _e=H.get(w);if(_e.__useDefaultFramebuffer!==void 0){M.bindFramebuffer(N.FRAMEBUFFER,_e.__webglFramebuffer),oe.copy(w.viewport),ce.copy(w.scissor),Ee=w.scissorTest,M.viewport(oe),M.scissor(ce),M.setScissorTest(Ee),Y=-1;return}else if(_e.__webglFramebuffer===void 0)K.setupRenderTarget(w);else if(_e.__hasExternalTextures)K.rebindTextures(w,H.get(w.texture).__webglTexture,H.get(w.depthTexture).__webglTexture);else if(w.depthBuffer){const Ze=w.depthTexture;if(_e.__boundDepthTexture!==Ze){if(Ze!==null&&H.has(Ze)&&(w.width!==Ze.image.width||w.height!==Ze.image.height))throw new Error("THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.");K.setupDepthRenderbuffer(w)}}const De=w.texture;(De.isData3DTexture||De.isDataArrayTexture||De.isCompressedArrayTexture)&&(Me=!0);const Ue=H.get(w).__webglFramebuffer;w.isWebGLCubeRenderTarget?(Array.isArray(Ue[z])?W=Ue[z][q]:W=Ue[z],X=!0):w.samples>0&&K.useMultisampledRTT(w)===!1?W=H.get(w).__webglMultisampledFramebuffer:Array.isArray(Ue)?W=Ue[q]:W=Ue,oe.copy(w.viewport),ce.copy(w.scissor),Ee=w.scissorTest}else oe.copy(Ie).multiplyScalar(Q).floor(),ce.copy(st).multiplyScalar(Q).floor(),Ee=He;if(q!==0&&(W=F),M.bindFramebuffer(N.FRAMEBUFFER,W)&&M.drawBuffers(w,W),M.viewport(oe),M.scissor(ce),M.setScissorTest(Ee),X){const _e=H.get(w.texture);N.framebufferTexture2D(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,N.TEXTURE_CUBE_MAP_POSITIVE_X+z,_e.__webglTexture,q)}else if(Me){const _e=z;for(let De=0;De<w.textures.length;De++){const Ue=H.get(w.textures[De]);N.framebufferTextureLayer(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0+De,Ue.__webglTexture,q,_e)}}else if(w!==null&&q!==0){const _e=H.get(w.texture);N.framebufferTexture2D(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,N.TEXTURE_2D,_e.__webglTexture,q)}Y=-1},this.readRenderTargetPixels=function(w,z,q,W,X,Me,we,_e=0){if(!(w&&w.isWebGLRenderTarget)){We("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let De=H.get(w).__webglFramebuffer;
vendor: 6,083 bytes, line 4116
4116if(w.isWebGLCubeRenderTarget&&we!==void 0&&(De=De[we]),De){M.bindFramebuffer(N.FRAMEBUFFER,De);try{const Ue=w.textures[_e],Ze=Ue.format,tt=Ue.type;if(w.textures.length>1&&N.readBuffer(N.COLOR_ATTACHMENT0+_e),!P.textureFormatReadable(Ze)){We("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!P.textureTypeReadable(tt)){We("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}z>=0&&z<=w.width-W&&q>=0&&q<=w.height-X&&N.readPixels(z,q,W,X,xe.convert(Ze),xe.convert(tt),Me)}finally{const Ue=j!==null?H.get(j).__webglFramebuffer:null;M.bindFramebuffer(N.FRAMEBUFFER,Ue)}}},this.readRenderTargetPixelsAsync=async function(w,z,q,W,X,Me,we,_e=0){if(!(w&&w.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let De=H.get(w).__webglFramebuffer;if(w.isWebGLCubeRenderTarget&&we!==void 0&&(De=De[we]),De)if(z>=0&&z<=w.width-W&&q>=0&&q<=w.height-X){M.bindFramebuffer(N.FRAMEBUFFER,De);const Ue=w.textures[_e],Ze=Ue.format,tt=Ue.type;if(w.textures.length>1&&N.readBuffer(N.COLOR_ATTACHMENT0+_e),!P.textureFormatReadable(Ze))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!P.textureTypeReadable(tt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Be=N.createBuffer();N.bindBuffer(N.PIXEL_PACK_BUFFER,Be),N.bufferData(N.PIXEL_PACK_BUFFER,Me.byteLength,N.STREAM_READ),N.readPixels(z,q,W,X,xe.convert(Ze),xe.convert(tt),0);const ft=j!==null?H.get(j).__webglFramebuffer:null;M.bindFramebuffer(N.FRAMEBUFFER,ft);const It=N.fenceSync(N.SYNC_GPU_COMMANDS_COMPLETE,0);return N.flush(),await tf(N,It,4),N.bindBuffer(N.PIXEL_PACK_BUFFER,Be),N.getBufferSubData(N.PIXEL_PACK_BUFFER,0,Me),N.deleteBuffer(Be),N.deleteSync(It),Me}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(w,z=null,q=0){const W=Math.pow(2,-q),X=Math.floor(w.image.width*W),Me=Math.floor(w.image.height*W),we=z!==null?z.x:0,_e=z!==null?z.y:0;K.setTexture2D(w,0),N.copyTexSubImage2D(N.TEXTURE_2D,q,0,0,we,_e,X,Me),M.unbindTexture()},this.copyTextureToTexture=function(w,z,q=null,W=null,X=0,Me=0){let we,_e,De,Ue,Ze,tt,Be,ft,It;const Dt=w.isCompressedTexture?w.mipmaps[Me]:w.image;if(q!==null)we=q.max.x-q.min.x,_e=q.max.y-q.min.y,De=q.isBox3?q.max.z-q.min.z:1,Ue=q.min.x,Ze=q.min.y,tt=q.isBox3?q.min.z:0;else{const Ft=Math.pow(2,-X);we=Math.floor(Dt.width*Ft),_e=Math.floor(Dt.height*Ft),w.isDataArrayTexture?De=Dt.depth:w.isData3DTexture?De=Math.floor(Dt.depth*Ft):De=1,Ue=0,Ze=0,tt=0}W!==null?(Be=W.x,ft=W.y,It=W.z):(Be=0,ft=0,It=0);const gt=xe.convert(z.format),qt=xe.convert(z.type);let Te;z.isData3DTexture?(K.setTexture3D(z,0),Te=N.TEXTURE_3D):z.isDataArrayTexture||z.isCompressedArrayTexture?(K.setTexture2DArray(z,0),Te=N.TEXTURE_2D_ARRAY):(K.setTexture2D(z,0),Te=N.TEXTURE_2D),M.activeTexture(N.TEXTURE0),M.pixelStorei(N.UNPACK_FLIP_Y_WEBGL,z.flipY),M.pixelStorei(N.UNPACK_PREMULTIPLY_ALPHA_WEBGL,z.premultiplyAlpha),M.pixelStorei(N.UNPACK_ALIGNMENT,z.unpackAlignment);const on=M.getParameter(N.UNPACK_ROW_LENGTH),at=M.getParameter(N.UNPACK_IMAGE_HEIGHT),pn=M.getParameter(N.UNPACK_SKIP_PIXELS),Nn=M.getParameter(N.UNPACK_SKIP_ROWS),ii=M.getParameter(N.UNPACK_SKIP_IMAGES);M.pixelStorei(N.UNPACK_ROW_LENGTH,Dt.width),M.pixelStorei(N.UNPACK_IMAGE_HEIGHT,Dt.height),M.pixelStorei(N.UNPACK_SKIP_PIXELS,Ue),M.pixelStorei(N.UNPACK_SKIP_ROWS,Ze),M.pixelStorei(N.UNPACK_SKIP_IMAGES,tt);const Ii=w.isDataArrayTexture||w.isData3DTexture,bt=z.isDataArrayTexture||z.isData3DTexture;if(w.isDepthTexture){const Ft=H.get(w),si=H.get(z),_t=H.get(Ft.__renderTarget),ri=H.get(si.__renderTarget);M.bindFramebuffer(N.READ_FRAMEBUFFER,_t.__webglFramebuffer),M.bindFramebuffer(N.DRAW_FRAMEBUFFER,ri.__webglFramebuffer);for(let Fi=0;Fi<De;Fi++)Ii&&(N.framebufferTextureLayer(N.READ_FRAMEBUFFER,N.COLOR_ATTACHMENT0,H.get(w).__webglTexture,X,tt+Fi),N.framebufferTextureLayer(N.DRAW_FRAMEBUFFER,N.COLOR_ATTACHMENT0,H.get(z).__webglTexture,Me,It+Fi)),N.blitFramebuffer(Ue,Ze,we,_e,Be,ft,we,_e,N.DEPTH_BUFFER_BIT,N.NEAREST);M.bindFramebuffer(N.READ_FRAMEBUFFER,null),M.bindFramebuffer(N.DRAW_FRAMEBUFFER,null)}else if(X!==0||w.isRenderTargetTexture||H.has(w)){const Ft=H.get(w),si=H.get(z);M.bindFramebuffer(N.READ_FRAMEBUFFER,O),M.bindFramebuffer(N.DRAW_FRAMEBUFFER,I);for(let _t=0;_t<De;_t++)Ii?N.framebufferTextureLayer(N.READ_FRAMEBUFFER,N.COLOR_ATTACHMENT0,Ft.__webglTexture,X,tt+_t):N.framebufferTexture2D(N.READ_FRAMEBUFFER,N.COLOR_ATTACHMENT0,N.TEXTURE_2D,Ft.__webglTexture,X),bt?N.framebufferTextureLayer(N.DRAW_FRAMEBUFFER,N.COLOR_ATTACHMENT0,si.__webglTexture,Me,It+_t):N.framebufferTexture2D(N.DRAW_FRAMEBUFFER,N.COLOR_ATTACHMENT0,N.TEXTURE_2D,si.__webglTexture,Me),X!==0?N.blitFramebuffer(Ue,Ze,we,_e,Be,ft,we,_e,N.COLOR_BUFFER_BIT,N.NEAREST):bt?N.copyTexSubImage3D(Te,Me,Be,ft,It+_t,Ue,Ze,we,_e):N.copyTexSubImage2D(Te,Me,Be,ft,Ue,Ze,we,_e);M.bindFramebuffer(N.READ_FRAMEBUFFER,null),M.bindFramebuffer(N.DRAW_FRAMEBUFFER,null)}else bt?w.isDataTexture||w.isData3DTexture?N.texSubImage3D(Te,Me,Be,ft,It,we,_e,De,gt,qt,Dt.data):z.isCompressedArrayTexture?N.compressedTexSubImage3D(Te,Me,Be,ft,It,we,_e,De,gt,Dt.data):N.texSubImage3D(Te,Me,Be,ft,It,we,_e,De,gt,qt,Dt):w.isDataTexture?N.texSubImage2D(N.TEXTURE_2D,Me,Be,ft,we,_e,gt,qt,Dt.data):w.isCompressedTexture?N.compressedTexSubImage2D(N.TEXTURE_2D,Me,Be,ft,Dt.width,Dt.height,gt,Dt.data):N.texSubImage2D(N.TEXTURE_2D,Me,Be,ft,we,_e,gt,qt,Dt);M.pixelStorei(N.UNPACK_ROW_LENGTH,on),M.pixelStorei(N.UNPACK_IMAGE_HEIGHT,at),M.pixelStorei(N.UNPACK_SKIP_PIXELS,pn),M.pixelStorei(N.UNPACK_SKIP_ROWS,Nn),M.pixelStorei(N.UNPACK_SKIP_IMAGES,ii),Me===0&&z.generateMipmaps&&N.generateMipmap(Te),M.unbindTexture()},this.initRenderTarget=function(w){H.get(w).__webglFramebuffer===void 0&&K.setupRenderTarget(w)}
4116,this.initTexture=function(w){w.isCubeTexture?K.setTextureCube(w,0):w.isData3DTexture?K.setTexture3D(w,0):w.isDataArrayTexture||w.isCompressedArrayTexture?K.setTexture2DArray(w,0):K.setTexture2D(w,0),M.unbindTexture()},this.resetState=function(){B=0,G=0,j=null,M.reset(),ye.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return kn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=nt._getDrawingBufferColorSpace(e),t.unpackColorSpace=nt._getUnpackColorSpace()}}function mv(s){s.onBeforeCompile=e=>{e.vertexShader=`varying vec2 grassWorld;
4117`+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include <begin_vertex>",`
4118      #include <begin_vertex>
4119      grassWorld = (modelMatrix * vec4(position, 1.0)).xz * vec2(1.0, -1.0);
4120    `),e.fragmentShader=`
4121      varying vec2 grassWorld;
4122      float grassHash(vec2 p) {
4123        vec3 q = fract(vec3(p.xyx) * 0.1031);
4124        q += dot(q, q.yzx + 33.33);
4125        return fract((q.x + q.y) * q.z);
4126      }
4127      float grassNoise(vec2 p) {
4128        vec2 cell = floor(p), f = fract(p);
4129        f = f * f * (3.0 - 2.0 * f);
4130        return mix(mix(grassHash(cell), grassHash(cell + vec2(1, 0)), f.x),
4131                   mix(grassHash(cell + vec2(0, 1)), grassHash(cell + vec2(1, 1)), f.x), f.y);
4132      }
4133    `+e.fragmentShader,e.fragmentShader=e.fragmentShader.replace("void main() {",`void main() {
4134      // Smooth, non-periodic displacement preserves the fine grass grain; no tile seams.
4135      vec2 warp = vec2(grassNoise(grassWorld / 13.0), grassNoise(grassWorld / 17.0 + 71.0));
4136      vec2 grassUv = grassWorld / 6.0 + (warp - 0.5) * 0.8;
4137      float meadow = grassNoise(grassWorld / 47.0 + 19.0);
4138    `);for(const t of["map_fragment","normal_fragment_begin","normal_fragment_maps","roughnessmap_fragment","aomap_fragment"])e.fragmentShader=e.fragmentShader.replace(`#include <${t}>`,et[t].replace(/v(?:Map|NormalMap|RoughnessMap|AoMap)Uv/g,"grassUv"));e.fragmentShader=e.fragmentShader.replace("#include <color_fragment>",`
4139      #include <color_fragment>
4140      diffuseColor.rgb *= mix(vec3(0.82, 0.91, 0.76), vec3(1.08, 1.04, 0.92), meadow);
4141    `)},s.customProgramCacheKey=()=>"natural-ground-v1",s.needsUpdate=!0}function gv(s,e,t){if(t==="bev")return s.position.copy(e.position).add(new L(0,35,0)),s.up.set(0,0,-1).applyAxisAngle(new L(0,1,0),e.rotation.y),s.lookAt(e.position),e.position;s.up.set(0,1,0);const n=t==="driver",i=new L(n?-.32:0,n?1.75*e.scale.y:4.2,n?-(e.userData.nominalLength*e.scale.z/2+.2):8);s.position.copy(i.applyQuaternion(e.quaternion).add(e.position));const r=new L(0,n?1.5*e.scale.y:1.1,n?-18:-4).applyQuaternion(e.quaternion).add(e.position);return s.lookAt(r),r}const Uh={type:"change"},qc={type:"start"},Hu={type:"end"},Or=new er,Oh=new fi,bv=Math.cos(70*Lt.DEG2RAD),Bt=new L,nn=2*Math.PI,pt={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},ao=1e-6;class xv extends xm{constructor(e,t=null){super(e,t),this.state=pt.NONE,this.target=new L,this.cursor=new L,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:es.ROTATE,MIDDLE:es.DOLLY,RIGHT:es.PAN},this.touches={ONE:Qi.ROTATE,TWO:Qi.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle="auto",this._domElementKeyEvents=null,this._lastPosition=new L,this._lastQuaternion=new dn,this._lastTargetPosition=new L,this._quat=new dn().setFromUnitVectors(e.up,new L(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new uh,this._sphericalDelta=new uh,this._scale=1,this._panOffset=new L,this._rotateStart=new te,this._rotateEnd=new te,this._rotateDelta=new te,this._panStart=new te,this._panEnd=new te,this._panDelta=new te,this._dollyStart=new te,this._dollyEnd=new te,this._dollyDelta=new te,this._dollyDirection=new L,this._mouse=new te,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=_v.bind(this),this._onPointerDown=vv.bind(this),this._onPointerUp=Mv.bind(this),this._onContextMenu=Rv.bind(this),this._onMouseWheel=Tv.bind(this),this._onKeyDown=Ev.bind(this),this._onTouchStart=wv.bind(this),this._onTouchMove=Av.bind(this),this._onMouseDown=yv.bind(this),this._onMouseMove=Sv.bind(this),this._interceptControlDown=Cv.bind(this),this._interceptControlUp=Pv.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(e){this._cursorStyle=e,e==="grab"?this.domElement.style.cursor="grab":this.domElement.style.cursor="auto"}get cursorStyle(){return this._cursorStyle}connect(e){super.connect(e),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=""}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Uh),this.update(),this.state=pt.NONE}pan(e,t){this._pan(e,t),this.update()}dollyIn(e){this._dollyIn(e),this.update()}dollyOut(e){this._dollyOut(e),this.update()}rotateLeft(e){this._rotateLeft(e),this.update()}rotateUp(e){this._rotateUp(e),this.update()}update(e=null){const t=this.object.position;Bt.copy(t).sub(this.target),Bt.applyQuaternion(this._quat),this._spherical.setFromVector3(Bt),this.autoRotate&&this.state===pt.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,i=this.maxAzimuthAngle;isFinite(n)&&isFinite(i)&&(n<-Math.PI?n+=nn:n>Math.PI&&(n-=nn),i<-Math.PI?i+=nn:i>Math.PI&&(i-=nn),n<=i?this._spherical.theta=Math.max(n,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+i)/2?Math.max(n,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radiu
vendor: 14,708 bytes, lines 4141-4142
4141s=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=a!=this._spherical.radius}if(Bt.setFromSpherical(this._spherical),Bt.applyQuaternion(this._quatInverse),t.copy(this.target).add(Bt),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const o=Bt.length();a=this._clampDistance(o*this._scale);const c=o-a;this.object.position.addScaledVector(this._dollyDirection,c),this.object.updateMatrixWorld(),r=!!c}else if(this.object.isOrthographicCamera){const o=new L(this._mouse.x,this._mouse.y,0);o.unproject(this.object);const c=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=c!==this.object.zoom;const l=new L(this._mouse.x,this._mouse.y,0);l.unproject(this.object),this.object.position.sub(l).add(o),this.object.updateMatrixWorld(),a=Bt.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(Or.origin.copy(this.object.position),Or.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Or.direction))<bv?this.object.lookAt(this.target):(Oh.setFromNormalAndCoplanarPoint(this.object.up,this.target),Or.intersectPlane(Oh,this.target))))}else if(this.object.isOrthographicCamera){const a=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),a!==this.object.zoom&&(this.object.updateProjectionMatrix(),r=!0)}return this._scale=1,this._performCursorZoom=!1,r||this._lastPosition.distanceToSquared(this.object.position)>ao||8*(1-this._lastQuaternion.dot(this.object.quaternion))>ao||this._lastTargetPosition.distanceToSquared(this.target)>ao?(this.dispatchEvent(Uh),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?nn/60*this.autoRotateSpeed*e:nn/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){Bt.setFromMatrixColumn(t,0),Bt.multiplyScalar(-e),this._panOffset.add(Bt)}_panUp(e,t){this.screenSpacePanning===!0?Bt.setFromMatrixColumn(t,1):(Bt.setFromMatrixColumn(t,0),Bt.crossVectors(this.object.up,Bt)),Bt.multiplyScalar(e),this._panOffset.add(Bt)}_pan(e,t){const n=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;Bt.copy(i).sub(this.target);let r=Bt.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*r/n.clientHeight,this.object.matrix),this._panUp(2*t*r/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),i=e-n.left,r=t-n.top,a=n.width,o=n.height;this._mouse.x=i/a*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(nn*this._rotateDelta.x/t.clientHeight),this._rotateUp(nn*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(nn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-nn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(nn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-nn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._rotateStart.set(n,i)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._panStart.set(n,i)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,i=e.pageY-t.y,r=Math.sqrt(n*n+i*i);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._rotateEnd.set(i,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(nn*this._rotateDelta.x/t.clientHeight),this._rotateUp(nn*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this._panEnd.set(n,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,i=e.pageY-t.y,r=Math.sqrt(n*n+i*i);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new te,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}}function vv(s){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(s.pointerId),this.domElement.ownerDocument.addEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(s)&&(this._addPointer(s),s.pointerType==="touch"?this._onTouchStart(s):this._onMouseDown(s),this._cursorStyle==="grab"&&(this.domElement.style.cursor="grabbing")))}function _v(s){this.enabled!==!1&&(s.pointerType==="touch"?this._onTouchMove(s):this._onMouseMove(s))}function Mv(s){switch(this._removePointer(s),this._pointers.length){case 0:this.domElement.releasePointerCapture(s.pointerId),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(Hu),this.state=pt.NONE,this._cursorStyle==="grab"&&(this.domElement.style.cursor="grab");break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function yv(s){let e;switch(s.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case es.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(s),this.state=pt.DOLLY;break;case es.ROTATE:if(s.ctrlKey||s.metaKey||s.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(s),this.state=pt.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(s),this.state=pt.ROTATE}break;case es.PAN:if(s.ctrlKey||s.metaKey||s.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(s),this.state=pt.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(s),this.state=pt.PAN}break;default:this.state=pt.NONE}this.state!==pt.NONE&&this.dispatchEvent(qc)}function Sv(s){switch(this.state){case pt.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(s);break;case pt.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(s);break;case pt.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(s);break}}function Tv(s){this.enabled===!1||this.enableZoom===!1||this.state!==pt.NONE||(s.preventDefault(),this.dispatchEvent(qc),this._handleMouseWheel(this._customWheelEvent(s)),this.dispatchEvent(Hu))}function Ev(s){this.enabled!==!1&&this._handleKeyDown(s)}function wv(s){switch(this._trackPointer(s),this._pointers.length){case 1:switch(this.touches.ONE){case Qi.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(s),this.state=pt.TOUCH_ROTATE;break;case Qi.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(s),this.state=pt.TOUCH_PAN;break;default:this.state=pt.NONE}break;case 2:switch(this.touches.TWO){case Qi.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(s),this.state=pt.TOUCH_DOLLY_PAN;break;case Qi.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(s),this.state=pt.TOUCH_DOLLY_ROTATE;break;default:this.state=pt.NONE}break;default:this.state=pt.NONE}this.state!==pt.NONE&&this.dispatchEvent(qc)}function Av(s){switch(this._trackPointer(s),this.state){case pt.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(s),this.update();break;case pt.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(s),this.update();break;case pt.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(s),this.update();break;case pt.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(s),this.update();break;default:this.state=pt.NONE}}function Rv(s){this.enabled!==!1&&s.preventDefault()}function Cv(s){s.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Pv(s){s.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class Dv extends Qp{constructor(e){super(e),this.type=Ct}parse(e){const a=function(x,S){switch(x){case 1:throw new Error("THREE.HDRLoader: Read Error: "+(S||""));case 2:throw new Error("THREE.HDRLoader: Write Error: "+(S||""));case 3:throw new Error("THREE.HDRLoader: Bad File Format: "+(S||""));default:case 4:throw new Error("THREE.HDRLoader: Memory Error: "+(S||""))}},h=`
4142`,u=function(x,S,A){S=S||1024;let D=x.pos,F=-1,O=0,I="",B=String.fromCharCode.apply(null,new Uint16Array(x.subarray(D,D+128)));for(;0>(F=B.indexOf(h))&&O<S&&D<x.byteLength;)I+=B,O+=B.length,D+=128,B=String.fromCharCode.apply(null,new Uint16Array(x.subarray(D,D+128)));return-1<F?(x.pos+=O+F+1,I+B.slice(0,F)):!1},d=function(x){const S=/^#\?(\S+)/,A=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,R=/^\s*EXPOSURE\s*=\s
4142*(\d+(\.\d+)?)\s*$/,D=/^\s*FORMAT=(\S+)\s*$/,F=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,O={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let I,B;for((x.pos>=x.byteLength||!(I=u(x)))&&a(1,"no header found"),(B=I.match(S))||a(3,"bad initial token"),O.valid|=1,O.programtype=B[1],O.string+=I+`
4143`;I=u(x),I!==!1;){if(O.string+=I+`
4144`,I.charAt(0)==="#"){O.comments+=I+`
4145`;continue}if((B=I.match(A))&&(O.gamma=parseFloat(B[1])),(B=I.match(R))&&(O.exposure=parseFloat(B[1])),(B=I.match(D))&&(O.valid|=2,O.format=B[1]),(B=I.match(F))&&(O.valid|=4,O.height=parseInt(B[1],10),O.width=parseInt(B[2],10)),O.valid&2&&O.valid&4)break}return O.valid&2||a(3,"missing format specifier"),O.valid&4||a(3,"missing image size specifier"),O},f=function(x,S,A){const R=S;if(R<8||R>32767||x[0]!==2||x[1]!==2||x[2]&128)return new Uint8Array(x);R!==(x[2]<<8|x[3])&&a(3,"wrong scanline width");const D=new Uint8Array(4*S*A);D.length||a(4,"unable to allocate buffer space");let F=0,O=0;const I=4*R,B=new Uint8Array(4),G=new Uint8Array(I);let j=A;for(;j>0&&O<x.byteLength;){O+4>x.byteLength&&a(1),B[0]=x[O++],B[1]=x[O++],B[2]=x[O++],B[3]=x[O++],(B[0]!=2||B[1]!=2||(B[2]<<8|B[3])!=R)&&a(3,"bad rgbe scanline format");let Y=0,ne;for(;Y<I&&O<x.byteLength;){ne=x[O++];const ce=ne>128;if(ce&&(ne-=128),(ne===0||Y+ne>I)&&a(3,"bad scanline data"),ce){const Ee=x[O++];for(let je=0;je<ne;je++)G[Y++]=Ee}else G.set(x.subarray(O,O+ne),Y),Y+=ne,O+=ne}const oe=R;for(let ce=0;ce<oe;ce++){let Ee=0;D[F]=G[ce+Ee],Ee+=R,D[F+1]=G[ce+Ee],Ee+=R,D[F+2]=G[ce+Ee],Ee+=R,D[F+3]=G[ce+Ee],F+=4}j--}return D},g=function(x,S,A,R){const D=x[S+3],F=Math.pow(2,D-128)/255;A[R+0]=x[S+0]*F,A[R+1]=x[S+1]*F,A[R+2]=x[S+2]*F,A[R+3]=1},b=function(x,S,A,R){const D=x[S+3],F=Math.pow(2,D-128)/255;A[R+0]=Ns.toHalfFloat(Math.min(x[S+0]*F,65504)),A[R+1]=Ns.toHalfFloat(Math.min(x[S+1]*F,65504)),A[R+2]=Ns.toHalfFloat(Math.min(x[S+2]*F,65504)),A[R+3]=Ns.toHalfFloat(1)},m=new Uint8Array(e);m.pos=0;const p=d(m),_=p.width,y=p.height,v=f(m.subarray(m.pos),_,y);let T,E,C;switch(this.type){case rn:C=v.length/4;const x=new Float32Array(C*4);for(let A=0;A<C;A++)g(v,A*4,x,A*4);T=x,E=rn;break;case Ct:C=v.length/4;const S=new Uint16Array(C*4);for(let A=0;A<C;A++)b(v,A*4,S,A*4);T=S,E=Ct;break;default:throw new Error("THREE.HDRLoader: Unsupported type: "+this.type)}return{width:_,height:y,data:T,header:p.string,gamma:p.gamma,exposure:p.exposure,type:E,colorSpace:an,minFilter:Mt,magFilter:Mt,generateMipmaps:!1,flipY:!0}}setDataType(e){return this.type=e,this}}function Wu(s,e=!1){const t=s[0].index!==null,n=new Set(Object.keys(s[0].attributes)),i=new Set(Object.keys(s[0].morphAttributes)),r={},a={},o=s[0].morphTargetsRelative,c=new xt;let l=0;for(let h=0;h<s.length;++h){const u=s[h];let d=0;if(t!==(u.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const f in u.attributes){if(!n.has(f))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+f+'" attribute exists among all geometries, or in none of them.'),null;r[f]===void 0&&(r[f]=[]),r[f].push(u.attributes[f]),d++}if(d!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(o!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const f in u.morphAttributes){if(!i.has(f))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+".  .morphAttributes must be consistent throughout all geometries."),null;a[f]===void 0&&(a[f]=[]),a[f].push(u.morphAttributes[f])}if(e){let f;if(t)f=u.index.count;else if(u.attributes.position!==void 0)f=u.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;c.addGroup(l,f,h),l+=f}}if(t){let h=0;const u=[];for(let d=0;d<s.length;++d){const f=s[d].index;for(let g=0;g<f.count;++g)u.push(f.getX(g)+h);h+=s[d].attributes.position.count}c.setIndex(u)}for(const h in r){const u=Bh(r[h]);if(!u)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" attribute."),null;c.setAttribute(h,u)}for(const h in a){const u=a[h][0].length;if(u!==0){c.morphAttributes=c.morphAttributes||{},c.morphAttributes[h]=[];for(let d=0;d<u;++d){const f=[];for(let b=0;b<a[h].length;++b)f.push(a[h][b][d]);const g=Bh(f);if(!g)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" morphAttribute."),null;c.morphAttributes[h].push(g)}}}return c}function Bh(s){let e,t,n,i=-1,r=0;for(let l=0;l<s.length;++l){const h=s[l];
4145if(e===void 0&&(e=h.array.constructor),e!==h.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=h.itemSize),t!==h.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=h.normalized),n!==h.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=h.gpuType),i!==h.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;r+=h.count*t}const a=new e(r),o=new Gt(a,t,n);let c=0;for(let l=0;l<s.length;++l){const h=s[l];if(h.isInterleavedBufferAttribute){const u=c/t;for(let d=0,f=h.count;d<f;d++)for(let g=0;g<t;g++){const b=h.getComponent(d,g);o.setComponent(d+u,g,b)}}else a.set(h.array,c);c+=h.count*t}return i!==void 0&&(o.gpuType=i),o}function kh(s,e){if(e===Hd)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),s;if(e===ic||e===lu){let t=s.getIndex();if(t===null){const a=[],o=s.getAttribute("position");if(o!==void 0){for(let c=0;c<o.count;c++)a.push(c);s.setIndex(a),t=s.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),s}const n=t.count-2,i=[];if(e===ic)for(let a=1;a<=n;a++)i.push(t.getX(0)),i.push(t.getX(a)),i.push(t.getX(a+1));else for(let a=0;a<n;a++)a%2===0?(i.push(t.getX(a)),i.push(t.getX(a+1)),i.push(t.getX(a+2))):(i.push(t.getX(a+2)),i.push(t.getX(a+1)),i.push(t.getX(a)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const r=s.clone();return r.setIndex(i),r.clearGroups(),r}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),s}function Lv(s){const e=new L().setFromMatrixColumn(s,0).normalize();return new dn().setFromUnitVectors(e,new L(e.x<0?-1:1,0,0))}function Nv(s){const e=new ut;e.userData.nominalWidth=.58,e.userData.nominalLength=.32,e.userData.nominalHeight=1.75;const t=new St({color:s,roughness:.96,metalness:0}),n=new St({color:"#384453",roughness:1}),i=new St({color:"#bc8a6c",roughness:.82}),r=new St({color:"#302721",roughness:1}),a=new St({color:"#272a2e",roughness:.9}),o=new St({color:"#67686a",roughness:1}),c=new St({color:"#302b27",roughness:.6}),l=new St({color:"#936653",roughness:.9}),h=(m,p,_,y,v,T)=>{const E=new Ke(p,_);return E.position.set(y,v,T),E.castShadow=E.receiveShadow=!0,m.add(E),E},u=(m,p,_,y,v,T,E,C)=>h(m,new Zs(1,20,14).scale(T,E,C),p,_,y,v),d=(m,p,_,y=0,v=0,T=0)=>{const E=[],C=[];_.forEach(([A,R,D])=>{for(let F=0;F<=24;F++){const O=F/24*Math.PI*2;E.push(Math.cos(O)*R,A,Math.sin(O)*D)}});for(let A=0;A<_.length-1;A++)for(let R=0;R<24;R++){const D=A*25+R,F=D+24+1;C.push(D,F,D+1,F,F+1,D+1)}const S=new xt;return S.setAttribute("position",new rt(E,3)),S.setIndex(C),S.computeVertexNormals(),h(m,S,p,y,v,T)},f=new ut;f.name="pedestrian-body",e.add(f),d(f,n,[[.81,0,0],[.84,.16,.105],[.96,.17,.105],[1.03,.145,.1],[1.04,0,0]]),d(f,t,[[.98,0,0],[.99,.17,.113],[1.06,.16,.11],[1.2,.175,.12],[1.34,.205,.12],[1.4,.21,.095],[1.45,.095,.07],[1.45,0,0]]),u(f,i,0,1.465,0,.055,.09,.052);const g=u(f,i,0,1.62,-.004,.086,.121,.094);g.name="pedestrian-head",u(f,i,0,1.558,-.022,.061,.052,.072),h(f,new Zs(1,24,16,0,Math.PI*2,0,Math.PI*.43).scale(.09,.125,.1),r,0,1.625,.003),u(f,i,0,1.616,-.096,.018,.029,.025),u(f,l,0,1.574,-.09,.027,.004,.004);for(const m of[-1,1]){u(f,i,m*.087,1.618,.001,.014,.027,.019),u(f,c,m*.034,1.638,-.089,.011,.004,.004),u(f,r,m*.034,1.655,-.087,.019,.003,.004);const p=new ut;p.name=m<0?"leg-left":"leg-right",p.position.set(m*.094,.91,0),f.add(p),d(p,n,[[-.43,.058,.065],[-.29,.074,.084],[-.1,.088,.101],[.03,.084,.093],[.04,0,0]]);const _=new ut;_.name="knee",_.position.y=-.41,p.add(_),u(_,n,0,0,0,.059,.065,.066),d(_,n,[[-.39,0,0],[-.38,.047,.052],[-.23,.058,.064],[-.1,.064,.074],[0,.058,.064]]),u(_,a,0,-.393,0,.037,.047,.044),u(_,o,0,-.479,-.04,.057,.021,.13),u(_,a,0,-.449,-.04,.056,.04,.126);const y=new ut;y.name=m<0?"arm-left":"arm-right",y.position.set(m*.207,1.38,0),y.rotation.z=m*.09,f.add(y),u(y,t,0,-.055,0,.076,.09,.083),d(y,t,[[-.16,.059,.063],[-.05,.071,.079],[.015,0,0]]),d(y,i,[[-.29,.038,.04],[-.18,.051,.054],[-.14,.05,.054]]);const v=new ut;v.name="elbow",v.position.y=-.29,v.rotation.x=.13,y.add(v),u(v,i,0,0,0,.04,.043,.042),d(v,i,[[-.245,.024,.028],[-.16,.033,.036],[-.06,.043,.044],[0,.038,.04]]),u(v,i,0,-.282,-.002,.031,.05,.021);for(let T=0;T<4;T++)u(v,i,0,-.331,(T-1.5)*.011,.011,.029-Math.abs(T-1.5)*.005,.006);
4145u(v,i,-m*.027,-.293,-.017,.012,.031,.013)}const b=[];e.traverse(m=>{m instanceof ut&&b.push(m)});for(const m of b){const p=new Map;for(const _ of m.children){if(!(_ instanceof Ke)||_.name||Array.isArray(_.material))continue;const y=p.get(_.material)??[];y.push(_),p.set(_.material,y)}for(const[_,y]of p){if(y.length<2)continue;const v=y.map(E=>{E.updateMatrix();const C=E.geometry.clone().applyMatrix4(E.matrix);for(const x of Object.keys(C.attributes))["position","normal"].includes(x)||C.deleteAttribute(x);return C}),T=Wu(v);v.forEach(E=>E.dispose()),T&&(y.forEach(E=>{m.remove(E),E.geometry.dispose()}),h(m,T,_,0,0,0))}}return e}function Iv(s,e=0,t=0){const n=Math.abs(t)>.05&&Number.isFinite(e)&&Number.isFinite(t),i=n?e*Math.PI*2/.95:0,r=n?Math.min(1,Math.abs(t)/1.4):0;for(const[a,o]of[["left",0],["right",Math.PI]]){const c=Math.sin(i+o)*r,l=s.getObjectByName(`leg-${a}`);l.rotation.x=c*.37,l.getObjectByName("knee").rotation.x=-Math.max(0,-c)*.62,s.getObjectByName(`arm-${a}`).rotation.x=-c*.28}}const Rs=new L;function gn(s,e,t,n,i,r){const a=2*Math.PI*i/4,o=Math.max(r-2*i,0),c=Math.PI/4;Rs.copy(e),Rs[n]=0,Rs.normalize();const l=.5*a/(a+o),h=1-Rs.angleTo(s)/c;return Math.sign(Rs[t])===1?h*l:o/(a+o)+l+l*(1-h)}class jc extends ni{constructor(e=1,t=1,n=1,i=2,r=.1){const a=i*2+1;if(r=Math.min(e/2,t/2,n/2,r),super(1,1,1,a,a,a),this.type="RoundedBoxGeometry",this.parameters={width:e,height:t,depth:n,segments:i,radius:r},a===1)return;const o=this.toNonIndexed();this.index=null,this.attributes.position=o.attributes.position,this.attributes.normal=o.attributes.normal,this.attributes.uv=o.attributes.uv;const c=new L,l=new L,h=new L(e,t,n).divideScalar(2).subScalar(r),u=this.attributes.position.array,d=this.attributes.normal.array,f=this.attributes.uv.array,g=u.length/6,b=new L,m=.5/a;for(let p=0,_=0;p<u.length;p+=3,_+=2)switch(c.fromArray(u,p),l.copy(c),l.x-=Math.sign(l.x)*m,l.y-=Math.sign(l.y)*m,l.z-=Math.sign(l.z)*m,l.normalize(),u[p+0]=h.x*Math.sign(c.x)+l.x*r,u[p+1]=h.y*Math.sign(c.y)+l.y*r,u[p+2]=h.z*Math.sign(c.z)+l.z*r,d[p+0]=l.x,d[p+1]=l.y,d[p+2]=l.z,Math.floor(p/g)){case 0:b.set(1,0,0),f[_+0]=gn(b,l,"z","y",r,n),f[_+1]=1-gn(b,l,"y","z",r,t);break;case 1:b.set(-1,0,0),f[_+0]=1-gn(b,l,"z","y",r,n),f[_+1]=1-gn(b,l,"y","z",r,t);break;case 2:b.set(0,1,0),f[_+0]=1-gn(b,l,"x","z",r,e),f[_+1]=gn(b,l,"z","x",r,n);break;case 3:b.set(0,-1,0),f[_+0]=1-gn(b,l,"x","z",r,e),f[_+1]=1-gn(b,l,"z","x",r,n);break;case 4:b.set(0,0,1),f[_+0]=1-gn(b,l,"x","y",r,e),f[_+1]=1-gn(b,l,"y","x",r,t);break;case 5:b.set(0,0,-1),f[_+0]=gn(b,l,"x","y",r,e),f[_+1]=1-gn(b,l,"y","x",r,t);break}}static fromJSON(e){return new jc(e.width,e.height,e.depth,e.segments,e.radius)}}function Fv(s,e){if(/pedestrian/.test(e))return Nv(s);const t=new ut,n=new fn({color:s,metalness:.72,roughness:.26,clearcoat:1,clearcoatRoughness:.12}),i=new fn({color:"#172c38",metalness:.35,roughness:.12,clearcoat:1}),r=new St({color:"#141619",roughness:.88}),a=new St({color:"#bdc5ce",metalness:.95,roughness:.22}),o=d=>new St({color:d,emissive:d,emissiveIntensity:2}),c=o("#f1f6ff"),l=o("#e72821"),h=(d,f,g,b,m,p,_,y=.06)=>{const v=new Ke(new jc(d,f,g,1,y),_);return v.position.set(b,m,p),v.castShadow=!0,v.receiveShadow=!0,t.add(v),v},u=/bus|truck/.test(e);if(h(1.83,.5,4.5,0,.64,0,n,.17),h(1.69,.12,4.22,0,.32,0,r),u){if(h(1.77,1.38,3.7,0,1.52,.28,/truck/.test(e)?a:n,.1),h(1.65,.66,.04,0,1.56,-1.59,i),/bus/.test(e))for(const d of[-1,1])h(.035,.67,3.05,d*.897,1.62,.28,i)}else{const d=new zc;d.moveTo(-1.5,.86),d.lineTo(-.72,1.43),d.quadraticCurveTo(-.55,1.51,-.3,1.51),d.lineTo(.65,1.48),d.lineTo(1.43,.86),d.closePath();const f=new Ke(new pa(d,{depth:1.52,bevelEnabled:!0,bevelSize:.045,bevelThickness:.04,bevelSegments:3,steps:1}),i);f.rotation.y=-Math.PI/2,f.position.x=.76,f.castShadow=!0,t.add(f),h(1.47,.085,1.16,0,1.52,.06,n);for(const g of[-1,1]){h(.055,.48,.1,g*.79,1.15,.1,n,.02),h(.24,.12,.3,g*.99,1,-.92,n),h(.027,.024,2.52,g*.926,.9,.05,a,.005);for(const b of[-.28,.87])h(.035,.045,.19,g*.93,.8,b,a,.01)}}h(1.1,.22,.055,0,.58,-2.25,r,.015);for(let d=0;d<5;d++)h(.95,.013,.02,0,.5+d*.035,-2.285,a,.003);for(const d of[-1,1]){h(.45,.09,.09,d*.61,.83,-2.21,c,.025),h(.47,.1,.07,d*.6,.81,2.22,l,.02);for(const f of[-1.43,1.43]){const g=new ut;g.position.set(d*.87,.35,f);const b=new Ke(new js(.35,.35,.24,32),r);b.rotation.z=Math.PI/2,b.castShadow=!0,g.add(b);const m=new Ke(new js(.25,.25,.248,24),a);m.rotation.z=Math.PI/2,g.add(m);for(let p=0;p<5;p++){const _=new Ke(new ni(.256,.04,.44),r);_.rotation.x=p*Math.PI/5,g.add(_)}g.name="wheel",t.add(g)}}return t.userData.nominalWidth=1.83,t.userData.nominalLength=4.5,t}function $i(s){const e=new Set,t=new Set;s.traverse(n=>{if(n instanceof Ke||n instanceof tr){n.userData.sharedGeometry||e.add(n.geometry);for(const i of Array.isArray(n.material)?n.material:[n.material])t.add(i)}}),e.forEach(n=>n.dispose()),t.forEach(n=>n.dispose())}function Uv(s){const e=new Map,t=new Map,n=s.clone();return Xu(s,n,function(i,r){e.set(r,i),t.set(i,r)}),n.traverse(function(i){if(!i.isSkinnedMesh)return;const r=i,a=e.get(i),o=a.skeleton.bones;r.skeleton=a.skeleton.clone(),r.bindMatrix.copy(a.bindMatrix),r.skeleton.bones=o.map(function(c){return t.get(c)}),r.bind(r.skeleton,r.bindMatrix)}),n}function Xu(s,e,t){t(s,e);for(let n=0;n<s.children.length;n++)Xu(s.children[n],e.children[n],t)}class Ov extends Ni{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Vv(t)}),this.register(function(t){return new Hv(t)}),this.register(function(t){return new Qv(t)}),this.register(function(t){return new $v(t)}),this.register(function(t){return new e_(t)}),this.register(function(t){return new Xv(t)}),this.register(function(t){return new qv(t)}),this.register(function(t){return new jv(t)}),this.register(function(t){return new Kv(t)}),this.register(function(t){return new Gv(t)}),this.register(function(t){return new Yv(t)}),this.register(function(t){return new Wv(t)}),this.register(function(t){return new Zv(t)}),this.register(function(t){return new Jv(t)}),this.register(function(t){return new kv(t)}),this.register(function(t){return new zh(t,it.EXT_MESHOPT_COMPRESSION)}),this.register(function(t){return new zh(t,it.KHR_MESHOPT_COMPRESSION)}),this.register(function(t){return new t_(t)})}load(e,t,n,i){const r=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const l=Gs.extractUrlBase(e);a=Gs.resolveURL(l,this.path)}else a=Gs.extractUrlBase(e);this.manager.itemStart(e);const o=function(l){i?i(l):console.error(l),r.manager.itemError(e),r.manager.itemEnd(e)},c=new Gc(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(e,function(l){try{r.parse(l,a,function(h){t(h),r.manager.itemEnd(e)},o)}catch(h){o(h)}},n,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let r;const a={},o={},c=new TextDecoder;if(typeof e=="string")r=JSON.parse(e);else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===qu){try{a[it.KHR_BINARY_GLTF]=new n_(e)}catch(u){i&&i(u);return}r=JSON.parse(a[it.KHR_BINARY_GLTF].content)}else r=JSON.parse(c.decode(e));else r=e;if(r.asset===void 0||r.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const l=new m_(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){const u=this.pluginCallbacks[h](l);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),o[u.name]=u,a[u.name]=!0}if(r.extensionsUsed)for(let h=0;h<r.extensionsUsed.length;++h){const u=r.extensionsUsed[h],d=r.extensionsRequired||[];
vendor: 17,910 bytes, line 4145
4145switch(u){case it.KHR_MATERIALS_UNLIT:a[u]=new zv;break;case it.KHR_DRACO_MESH_COMPRESSION:a[u]=new i_(r,this.dracoLoader);break;case it.KHR_TEXTURE_TRANSFORM:a[u]=new s_;break;case it.KHR_MESH_QUANTIZATION:a[u]=new r_;break;default:d.indexOf(u)>=0&&o[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}l.setExtensions(a),l.setPlugins(o),l.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,r){n.parse(e,t,i,r)})}}function Bv(){let s={};return{get:function(e){return s[e]},add:function(e,t){s[e]=t},remove:function(e){delete s[e]},removeAll:function(){s={}}}}function Ut(s,e,t){const n=s.json.materials[e];return n.extensions&&n.extensions[t]?n.extensions[t]:null}const it={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",KHR_MESHOPT_COMPRESSION:"KHR_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class kv{constructor(e){this.parser=e,this.name=it.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;n++){const r=t[n];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const r=t.json,c=((r.extensions&&r.extensions[this.name]||{}).lights||[])[e];let l;const h=new ze(16777215);c.color!==void 0&&h.setRGB(c.color[0],c.color[1],c.color[2],an);const u=c.range!==void 0?c.range:0;switch(c.type){case"directional":l=new Iu(h),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new im(h),l.distance=u;break;case"spot":l=new tm(h),l.distance=u,c.spot=c.spot||{},c.spot.innerConeAngle=c.spot.innerConeAngle!==void 0?c.spot.innerConeAngle:0,c.spot.outerConeAngle=c.spot.outerConeAngle!==void 0?c.spot.outerConeAngle:Math.PI/4,l.angle=c.spot.outerConeAngle,l.penumbra=1-c.spot.innerConeAngle/c.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+c.type)}return l.position.set(0,0,0),Un(l,c),c.intensity!==void 0&&(l.intensity=c.intensity),l.name=t.createUniqueName(c.name||"light_"+e),i=Promise.resolve(l),t.cache.add(n,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,r=n.json.nodes[e],o=(r.extensions&&r.extensions[this.name]||{}).light;return o===void 0?null:this._loadLight(o).then(function(c){return n._getNodeRef(t.cache,o,c)})}}class zv{constructor(){this.name=it.KHR_MATERIALS_UNLIT}getMaterialType(){return zn}extendParams(e,t,n){const i=[];e.color=new ze(1,1,1),e.opacity=1;const r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){const a=r.baseColorFactor;e.color.setRGB(a[0],a[1],a[2],an),e.opacity=a[3]}r.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",r.baseColorTexture,kt))}return Promise.all(i)}}class Gv{constructor(e){this.parser=e,this.name=it.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=Ut(this.parser,e,this.name);return n===null||n.emissiveStrength!==void 0&&(t.emissiveIntensity=n.emissiveStrength),Promise.resolve()}}class Vv{constructor(e){this.parser=e,this.name=it.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){return Ut(this.parser,e,this.name)!==null?fn:null}extendMaterialParams(e,t){const n=Ut(this.parser,e,this.name);if(n===null)return Promise.resolve();const i=[];if(n.clearcoatFactor!==void 0&&(t.clearcoat=n.clearcoatFactor),n.clearcoatTexture!==void 0&&i.push(this.parser.assignTexture(t,"clearcoatMap",n.clearcoatTexture)),n.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=n.clearcoatRoughnessFactor),n.clearcoatRoughnessTexture!==void 0&&i.push(this.parser.assignTexture(t,"clearcoatRoughnessMap",n.clearcoatRoughnessTexture)),n.clearcoatNormalTexture!==void 0&&(i.push(this.parser.assignTexture(t,"clearcoatNormalMap",n.clearcoatNormalTexture)),n.clearcoatNormalTexture.scale!==void 0)){const r=n.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new te(r,r)}return Promise.all(i)}}class Hv{constructor(e){this.parser=e,this.name=it.KHR_MATERIALS_DISPERSION}getMaterialType(e){return Ut(this.parser,e,this.name)!==null?fn:null}extendMaterialParams(e,t){const n=Ut(this.parser,e,this.name);return n===null||(t.dispersion=n.dispersion!==void 0?n.dispersion:0),Promise.resolve()}}class Wv{constructor(e){this.parser=e,this.name=it.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){return Ut(this.parser,e,this.name)!==null?fn:null}extendMaterialParams(e,t){const n=Ut(this.parser,e,this.name);if(n===null)return Promise.resolve();const i=[];return n.iridescenceFactor!==void 0&&(t.iridescence=n.iridescenceFactor),n.iridescenceTexture!==void 0&&i.push(this.parser.assignTexture(t,"iridescenceMap",n.iridescenceTexture)),n.iridescenceIor!==void 0&&(t.iridescenceIOR=n.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),n.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=n.iridescenceThicknessMinimum),n.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=n.iridescenceThicknessMaximum),n.iridescenceThicknessTexture!==void 0&&i.push(this.parser.assignTexture(t,"iridescenceThicknessMap",n.iridescenceThicknessTexture)),Promise.all(i)}}class Xv{constructor(e){this.parser=e,this.name=it.KHR_MATERIALS_SHEEN}getMaterialType(e){return Ut(this.parser,e,this.name)!==null?fn:null}extendMaterialParams(e,t){const n=Ut(this.parser,e,this.name);if(n===null)return Promise.resolve();const i=[];if(t.sheenColor=new ze(0,0,0),t.sheenRoughness=0,t.sheen=1,n.sheenColorFactor!==void 0){const r=n.sheenColorFactor;t.sheenColor.setRGB(r[0],r[1],r[2],an)}return n.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=n.sheenRoughnessFactor),n.sheenColorTexture!==void 0&&i.push(this.parser.assignTexture(t,"sheenColorMap",n.sheenColorTexture,kt)),n.sheenRoughnessTexture!==void 0&&i.push(this.parser.assignTexture(t,"sheenRoughnessMap",n.sheenRoughnessTexture)),Promise.all(i)}}class qv{constructor(e){this.parser=e,this.name=it.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){return Ut(this.parser,e,this.name)!==null?fn:null}extendMaterialParams(e,t){const n=Ut(this.parser,e,this.name);if(n===null)return Promise.resolve();const i=[];return n.transmissionFactor!==void 0&&(t.transmission=n.transmissionFactor),n.transmissionTexture!==void 0&&i.push(this.parser.assignTexture(t,"transmissionMap",n.transmissionTexture)),Promise.all(i)}}class jv{constructor(e){this.parser=e,this.name=it.KHR_MATERIALS_VOLUME}getMaterialType(e){return Ut(this.parser,e,this.name)!==null?fn:null}extendMaterialParams(e,t){const n=Ut(this.parser,e,this.name);if(n===null)return Promise.resolve();const i=[];t.thickness=n.thicknessFactor!==void 0?n.thicknessFactor:0,n.thicknessTexture!==void 0&&i.push(this.parser.assignTexture(t,"thicknessMap",n.thicknessTexture)),t.attenuationDistance=n.attenuationDistance||1/0;const r=n.attenuationColor||[1,1,1];return t.attenuationColor=new ze().setRGB(r[0],r[1],r[2],an),Promise.all(i)}}class Kv{constructor(e){this.parser=e,this.name=it.KHR_MATERIALS_IOR}getMaterialType(e){return Ut(this.parser,e,this.name)!==null?fn:null}extendMaterialParams(e,t){const n=Ut(this.parser,e,this.name);return n===null||(t.ior=n.ior!==void 0?n.ior:1.5,t.ior===0&&(t.ior=1e3)),Promise.resolve()}}class Yv{constructor(e){this.parser=e,this.name=it.KHR_MATERIALS_SPECULAR}getMaterialType(e){return Ut(this.parser,e,this.name)!==null?fn:null}extendMaterialParams(e,t){const n=Ut(this.parser,e,this.name);if(n===null)return Promise.resolve();const i=[];t.specularIntensity=n.specularFactor!==void 0?n.specularFactor:1,n.specularTexture!==void 0&&i.push(this.parser.assignTexture(t,"specularIntensityMap",n.specularTexture));const r=n.specularColorFactor||[1,1,1];return t.specularColor=new ze().setRGB(r[0],r[1],r[2],an),n.specularColorTexture!==void 0&&i.push(this.parser.assignTexture(t,"specularColorMap",n.specularColorTexture,kt)),Promise.all(i)}}class Jv{constructor(e){this.parser=e,this.name=it.EXT_MATERIALS_BUMP}getMaterialType(e){return Ut(this.parser,e,this.name)!==null?fn:null}extendMaterialParams(e,t){const n=Ut(this.parser,e,this.name);if(n===null)return Promise.resolve();const i=[];return t.bumpScale=n.bumpFactor!==void 0?n.bumpFactor:1,n.bumpTexture!==void 0&&i.push(this.parser.assignTexture(t,"bumpMap",n.bumpTexture)),Promise.all(i)}}class Zv{constructor(e){this.parser=e,this.name=it.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){return Ut(this.parser,e,this.name)!==null?fn:null}extendMaterialParams(e,t){const n=Ut(this.parser,e,this.name);if(n===null)return Promise.resolve();const i=[];return n.anisotropyStrength!==void 0&&(t.anisotropy=n.anisotropyStrength),n.anisotropyRotation!==void 0&&(t.anisotropyRotation=n.anisotropyRotation),n.anisotropyTexture!==void 0&&i.push(this.parser.assignTexture(t,"anisotropyMap",n.anisotropyTexture)),Promise.all(i)}}class Qv{constructor(e){this.parser=e,this.name=it.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const r=i.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,a)}}class $v{constructor(e){this.parser=e,this.name=it.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,i=n.json,r=i.textures[e];if(!r.extensions||!r.extensions[t])return null;const a=r.extensions[t],o=i.images[a.source];let c=n.textureLoader;if(o.uri){const l=n.options.manager.getHandler(o.uri);l!==null&&(c=l)}return n.loadTextureImage(e,a.source,c)}}class e_{constructor(e){this.parser=e,this.name=it.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,i=n.json,r=i.textures[e];if(!r.extensions||!r.extensions[t])return null;const a=r.extensions[t],o=i.images[a.source];let c=n.textureLoader;if(o.uri){const l=n.options.manager.getHandler(o.uri);l!==null&&(c=l)}return n.loadTextureImage(e,a.source,c)}}class zh{constructor(e,t){this.name=t,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],r=this.parser.getDependency("buffer",i.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(o){const c=i.byteOffset||0,l=i.byteLength||0,h=i.count,u=i.byteStride,d=new Uint8Array(o,c,l);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(h,u,d,i.mode,i.filter).then(function(f){return f.buffer}):a.ready.then(function(){const f=new ArrayBuffer(h*u);return a.decodeGltfBuffer(new Uint8Array(f),h,u,d,i.mode,i.filter),f})})}else return null}}class t_{constructor(e){this.name=it.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const l of i.primitives)if(l.mode!==bn.TRIANGLES&&l.mode!==bn.TRIANGLE_STRIP&&l.mode!==bn.TRIANGLE_FAN&&l.mode!==void 0)return null;const a=n.extensions[this.name].attributes,o=[],c={};for(const l in a)o.push(this.parser.getDependency("accessor",a[l]).then(h=>(c[l]=h,c[l])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(l=>{const h=l.pop(),u=h.isGroup?h.children:[h],d=l[0].count,f=[];for(const g of u){const b=new Ye,m=new L,p=new dn,_=new L(1,1,1),y=new sa(g.geometry,g.material,d);for(let v=0;v<d;v++)c.TRANSLATION&&m.fromBufferAttribute(c.TRANSLATION,v),c.ROTATION&&p.fromBufferAttribute(c.ROTATION,v),c.SCALE&&_.fromBufferAttribute(c.SCALE,v),y.setMatrixAt(v,b.compose(m,p,_));for(const v in c)if(v==="_COLOR_0"){const T=c[v];y.instanceColor=new ac(T.array,T.itemSize,T.normalized)}else v!=="TRANSLATION"&&v!=="ROTATION"&&v!=="SCALE"&&g.geometry.setAttribute(v,c[v]);yt.prototype.copy.call(y,g),this.parser.assignFinalMaterial(y),f.push(y)}return h.isGroup?(h.clear(),h.add(...f),h):f[0]}))}}const qu="glTF",Cs=12,Gh={JSON:1313821514,BIN:5130562};class n_{constructor(e){this.name=it.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Cs),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==qu)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-Cs,r=new DataView(e,Cs);let a=0;for(;a<i;){const o=r.getUint32(a,!0);a+=4;const c=r.getUint32(a,!0);if(a+=4,c===Gh.JSON){const l=new Uint8Array(e,Cs+a,o);this.content=n.decode(l)}else if(c===Gh.BIN){const l=Cs+a;this.body=e.slice(l,l+o)}a+=o}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class i_{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=it.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,r=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},c={},l={};for(const h in a){const u=fc[h]||h.toLowerCase();o[u]=a[h]}for(const h in e.attributes){const u=fc[h]||h.toLowerCase();if(a[h]!==void 0){const d=n.accessors[e.attributes[h]],f=ss[d.componentType];l[u]=f.name,c[u]=d.normalized===!0}}return t.getDependency("bufferView",r).then(function(h){return new Promise(function(u,d){i.decodeDracoFile(h,function(f){for(const g in f.attributes){const b=f.attributes[g],m=c[g];m!==void 0&&(b.normalized=m)}u(f)},o,l,an,d)})})}}class s_{constructor(){this.name=it.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class r_{constructor(){this.name=it.KHR_MESH_QUANTIZATION}}class ju extends fs{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i*3+i;for(let a=0;a!==i;a++)t[a]=n[r+a];return t}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=o*2,l=o*3,h=i-t,u=(n-t)/h,d=u*u,f=d*u,g=e*l,b=g-l,m=-2*f+3*d,p=f-d,_=1-m,y=p-d+u;for(let v=0;v!==o;v++){const T=a[b+v+o],E=a[b+v+c]*h,C=a[g+v+o],x=a[g+v]*h;r[v]=_*T+y*E+m*C+p*x}return r}}const a_=new dn;class o_ extends ju{interpolate_(e,t,n,i){const r=super.interpolate_(e,t,n,i);return a_.fromArray(r).normalize().toArray(r),r}}const bn={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ss={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Vh={9728:Rt,9729:Mt,9984:nu,9985:qr,9986:Ls,9987:An},Hh={33071:xn,33648:Qr,10497:_n},oo={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},fc={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},di={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},c_={CUBICSPLINE:void 0,LINEAR:Ws,STEP:Hs},co={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function l_(s){return s.DefaultMaterial===void 0&&(s.DefaultMaterial=new St({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ei})),s.DefaultMaterial}function Ei(s,e,t){for(const n in t.extensions)s[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Un(s,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(s.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function h_(s,e,t){let n=!1,i=!1,r=!1;for(let l=0,h=e.length;l<h;l++){const u=e[l];if(u.POSITION!==void 0&&(n=!0),u.NORMAL!==void 0&&(i=!0),u.COLOR_0!==void 0&&(r=!0),n&&i&&r)break}if(!n&&!i&&!r)return Promise.resolve(s);const a=[],o=[],c=[];for(let l=0,h=e.length;l<h;l++){const u=e[l];if(n){const d=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):s.attributes.position;a.push(d)}if(i){const d=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):s.attributes.normal;o.push(d)}if(r){const d=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):s.attributes.color;c.push(d)}}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(c)]).then(function(l){const h=l[0],u=l[1],d=l[2];return n&&(s.morphAttributes.position=h),i&&(s.morphAttributes.normal=u),r&&(s.morphAttributes.color=d
vendor: 16,730 bytes, line 4145
4145),s.morphTargetsRelative=!0,s})}function u_(s,e){if(s.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)s.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(s.morphTargetInfluences.length===t.length){s.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)s.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function d_(s){let e;const t=s.extensions&&s.extensions[it.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+lo(t.attributes):e=s.indices+":"+lo(s.attributes)+":"+s.mode,s.targets!==void 0)for(let n=0,i=s.targets.length;n<i;n++)e+=":"+lo(s.targets[n]);return e}function lo(s){let e="";const t=Object.keys(s).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+s[t[n]]+";";return e}function pc(s){switch(s){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function f_(s){return s.search(/\.jpe?g($|\?)/i)>0||s.search(/^data\:image\/jpeg/)===0?"image/jpeg":s.search(/\.webp($|\?)/i)>0||s.search(/^data\:image\/webp/)===0?"image/webp":s.search(/\.ktx2($|\?)/i)>0||s.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const p_=new Ye;class m_{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Bv,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=-1,r=!1,a=-1;if(typeof navigator<"u"&&typeof navigator.userAgent<"u"){const o=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(o)===!0;const c=o.match(/Version\/(\d+)/);i=n&&c?parseInt(c[1],10):-1,r=o.indexOf("Firefox")>-1,a=r?o.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&i<17||r&&a<98?this.textureLoader=new Lu(this.options.manager):this.textureLoader=new rm(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Gc(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(a){const o={scene:a[0][i.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:i.asset,parser:n,userData:{}};return Ei(r,o,i),Un(o,i),Promise.all(n._invokeAll(function(c){return c.afterRoot&&c.afterRoot(o)})).then(function(){for(const c of o.scenes)c.updateMatrixWorld();e(o)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,r=t.length;i<r;i++){const a=t[i].joints;for(let o=0,c=a.length;o<c;o++)e[a[o]].isBone=!0}for(let i=0,r=e.length;i<r;i++){const a=e[i];a.mesh!==void 0&&(this._addNodeRef(this.meshCache,a.mesh),a.skin!==void 0&&(n[a.mesh].isSkinnedMesh=!0)),a.camera!==void 0&&this._addNodeRef(this.cameraCache,a.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const i=n.clone(),r=(a,o)=>{const c=this.associations.get(a);c!=null&&this.associations.set(o,c);for(const[l,h]of a.children.entries())r(h,o.children[l])};return r(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const r=e(t[i]);r&&n.push(r)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(r){return r.loadNode&&r.loadNode(t)});break;case"mesh":i=this._invokeOne(function(r){return r.loadMesh&&r.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(r){return r.loadBufferView&&r.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(r){return r.loadMaterial&&r.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(r){return r.loadTexture&&r.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(r){return r.loadAnimation&&r.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(r,a){return n.getDependency(e,a)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[it.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(r,a){n.load(Gs.resolveURL(t.uri,i.path),r,void 0,function(){a(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const i=t.byteLength||0,r=t.byteOffset||0;return n.slice(r,r+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const a=oo[i.type],o=ss[i.componentType],c=i.normalized===!0,l=new o(i.count*a);return Promise.resolve(new Gt(l,a,c))}const r=[];return i.bufferView!==void 0?r.push(this.getDependency("bufferView",i.bufferView)):r.push(null),i.sparse!==void 0&&(r.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(r).then(function(a){const o=a[0],c=oo[i.type],l=ss[i.componentType],h=l.BYTES_PER_ELEMENT,u=h*c,d=i.byteOffset||0,f=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,g=i.normalized===!0;let b,m;if(f&&f!==u){const p=Math.floor(d/f),_="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+p+":"+i.count;let y=t.cache.get(_);y||(b=new l(o,p*f,i.count*f/h),y=new kf(b,f/h),t.cache.add(_,y)),m=new fa(y,c,d%f/h,g)}else o===null?b=new l(i.count*c):b=new l(o,d,i.count*c),m=new Gt(b,c,g);if(i.sparse!==void 0){const p=oo.SCALAR,_=ss[i.sparse.indices.componentType],y=i.sparse.indices.byteOffset||0,v=i.sparse.values.byteOffset||0,T=new _(a[1],y,i.sparse.count*p),E=new l(a[2],v,i.sparse.count*c);o!==null&&(m=new Gt(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let C=0,x=T.length;C<x;C++){const S=T[C];if(m.setX(S,E[C*c]),c>=2&&m.setY(S,E[C*c+1]),c>=3&&m.setZ(S,E[C*c+2]),c>=4&&m.setW(S,E[C*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}m.normalized=g}return m})}loadTexture(e){const t=this.json,n=this.options,r=t.textures[e].source,a=t.images[r];let o=this.textureLoader;if(a.uri){const c=n.manager.getHandler(a.uri);c!==null&&(o=c)}return this.loadTextureImage(e,r,o)}loadTextureImage(e,t,n){const i=this,r=this.json,a=r.textures[e],o=r.images[t],c=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[c])return this.textureCache[c];const l=this.loadImageSource(t,n).then(function(h){h.flipY=!1,h.name=a.name||o.name||"",h.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(h.name=o.uri);const d=(r.samplers||{})[a.sampler]||{};return h.magFilter=Vh[d.magFilter]||Mt,h.minFilter=Vh[d.minFilter]||An,h.wrapS=Hh[d.wrapS]||_n,h.wrapT=Hh[d.wrapT]||_n,h.generateMipmaps=!h.isCompressedTexture&&h.minFilter!==Rt&&h.minFilter!==Mt,i.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[c]=l,l}loadImageSource(e,t){const n=this,i=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const a=i.images[e],o=self.URL||self.webkitURL;let c=a.uri||"",l=!1;if(a.bufferView!==void 0)c=n.getDependency("bufferView",a.bufferView).then(function(u){l=!0;const d=new Blob([u],{type:a.mimeType});return c=o.createObjectURL(d),c});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(c).then(function(u){return new Promise(function(d,f){let g=d;t.isImageBitmapLoader===!0&&(g=function(b){const m=new Nt(b);m.needsUpdate=!0,d(m)}),t.load(Gs.resolveURL(u,r.path),g,void 0,f)})}).then(function(u){return l===!0&&o.revokeObjectURL(c),Un(u,a),u.userData.mimeType=a.mimeType||f_(a.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),u});return this.sourceCache[e]=h,h}assignTexture(e,t,n,i){const r=this;return this.getDependency("texture",n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),r.extensions[it.KHR_TEXTURE_TRANSFORM]){const o=n.extensions!==void 0?n.extensions[it.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const c=r.associations.get(a);a=r.extensions[it.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),r.associations.set(a,c)}}return i!==void 0&&(a.colorSpace=i),e[t]=a,a})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+n.uuid;let c=this.cache.get(o);c||(c=new bu,Rn.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,c.sizeAttenuation=!1,this.cache.add(o,c)),n=c}else if(e.isLine){const o="LineBasicMaterial:"+n.uuid;let c=this.cache.get(o);c||(c=new Uc,Rn.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,this.cache.add(o,c)),n=c}if(i||r||a){let o="ClonedMaterial:"+n.uuid+":";i&&(o+="derivative-tangents:"),r&&(o+="vertex-colors:"),a&&(o+="flat-shading:");let c=this.cache.get(o);c||(c=n.clone(),r&&(c.vertexColors=!0),a&&(c.flatShading=!0),i&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(o,c),this.associations.set(c,this.associations.get(n))),n=c}e.material=n}getMaterialType(){return St}loadMaterial(e){const t=this,n=this.json,i=this.extensions,r=n.materials[e];let a;const o={},c=r.extensions||{},l=[];if(c[it.KHR_MATERIALS_UNLIT]){const u=i[it.KHR_MATERIALS_UNLIT];a=u.getMaterialType(),l.push(u.extendParams(o,r,t))}else{const u=r.pbrMetallicRoughness||{};if(o.color=new ze(1,1,1),o.opacity=1,Array.isArray(u.baseColorFactor)){const d=u.baseColorFactor;o.color.setRGB(d[0],d[1],d[2],an),o.opacity=d[3]}u.baseColorTexture!==void 0&&l.push(t.assignTexture(o,"map",u.baseColorTexture,kt)),o.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,o.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(l.push(t.assignTexture(o,"metalnessMap",u.metallicRoughnessTexture)),l.push(t.assignTexture(o,"roughnessMap",u.metallicRoughnessTexture))),a=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,o)})))}r.doubleSided===!0&&(o.side=Yt);const h=r.alphaMode||co.OPAQUE;if(h===co.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,h===co.MASK&&(o.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&a!==zn&&(l.push(t.assignTexture(o,"normalMap",r.normalTexture)),o.normalScale=new te(1,1),r.normalTexture.scale!==void 0)){const u=r.normalTexture.scale;o.normalScale.set(u,u)}if(r.occlusionTexture!==void 0&&a!==zn&&(l.push(t.assignTexture(o,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&a!==zn){const u=r.emissiveFactor;o.emissive=new ze().setRGB(u[0],u[1],u[2],an)}return r.emissiveTexture!==void 0&&a!==zn&&l.push(t.assignTexture(o,"emissiveMap",r.emissiveTexture,kt)),Promise.all(l).then(function(){const u=new a(o);return r.name&&(u.name=r.name),Un(u,r),t.associations.set(u,{materials:e}),r.extensions&&Ei(i,u,r),u})}createUniqueName(e){const t=ht.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function r(o){return n[it.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,t).then(function(c){return Wh(c,o,t)})}const a=[];for(let o=0,c=e.length;o<c;o++){const l=e[o],h=d_(l),u=i[h];if(u)a.push(u.promise);else{let d;l.extensions&&l.extensions[it.KHR_DRACO_MESH_COMPRESSION]?d=r(l):d=Wh(new xt,l,t),i[h]={primitive:l,promise:d},a.push(d)}}return Promise.all(a)}loadMesh(e){const t=this,n=this.json,i=this.extensions,r=n.meshes[e],a=r.primitives,o=[];for(let c=0,l=a.length;c<l;c++){const h=a[c].material===void 0?l_(this.cache):this.getDependency("material",a[c].material);o.push(h)}return o.push(t.loadGeometries(a)),Promise.all(o).then(function(c){const l=c.slice(0,c.length-1),h=c[c.length-1],u=[];for(let f=0,g=h.length;f<g;f++){const b=h[f],m=a[f];let p;const _=l[f];if(m.mode===bn.TRIANGLES||m.mode===bn.TRIANGLE_STRIP||m.mode===bn.TRIANGLE_FAN||m.mode===void 0)p=r.isSkinnedMesh===!0?new Hf(b,_):new Ke(b,_),p.isSkinnedMesh===!0&&p.normalizeSkinWeights(),m.mode===bn.TRIANGLE_STRIP?p.geometry=kh(p.geometry,lu):m.mode===bn.TRIANGLE_FAN&&(p.geometry=kh(p.geometry,ic));else if(m.mode===bn.LINES)p=new Yf(b,_);else if(m.mode===bn.LINE_STRIP)p=new tr(b,_);else if(m.mode===bn.LINE_LOOP)p=new Jf(b,_);else if(m.mode===bn.POINTS)p=new Zf(b,_);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(p.geometry.morphAttributes).length>0&&u_(p,r),p.name=t.createUniqueName(r.name||"mesh_"+e),Un(p,r),m.extensions&&Ei(i,p,m),t.assignFinalMaterial(p),u.push(p)}for(let f=0,g=u.length;f<g;f++)t.associations.set(u[f],{meshes:e,primitives:f});if(u.length===1)return r.extensions&&Ei(i,u[0],r),u[0];const d=new ut;r.extensions&&Ei(i,d,r),t.associations.set(d,{meshes:e});for(let f=0,g=u.length;f<g;f++)d.add(u[f]);return d})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new $t(Lt.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new ir(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),Un(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let i=0,r=t.joints.length;i<r;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const r=i.pop(),a=i,o=[],c=[];for(let l=0,h=a.length;l<h;l++){const u=a[l];if(u){o.push(u);const d=new Ye;r!==null&&d.fromArray(r.array,l*16),c.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[l])}return new Ic(o,c)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],r=i.name?i.name:"animation_"+e,a=[],o=[],c=[],l=[],h=[];for(let u=0,d=i.channels.length;u<d;u++){const f=i.channels[u],g=i.samplers[f.sampler],b=f.target,m=b.node,p=i.parameters!==void 0?i.parameters[g.input]:g.input,_=i.parameters!==void 0?i.parameters[g.output]:g.output;b.node!==void 0&&(a.push(this.getDependency("node",m)),o.push(this.getDependency("accessor",p)),c.push(this.getDependency("accessor",_)),l.push(g),h.push(b))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(l),Promise.all(h)]).then(function(u){const d=u[0],f=u[1],g=u[2],b=u[3],m=u[4],p=[];for(let y=0,v=d.length;y<v;y++){const T=d[y],E=f[y],C=g[y],x=b[y],S=m[y];if(T===void 0)continue;T.updateMatrix&&T.updateMatrix();const A=n._createAnimationTracks(T,E,C,x,S);if(A)for(let R=0;R<A.length;R++)p.push(A[R])}const _=new qp(r,void 0,p);return Un(_,i),_})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(r){const a=n._getNodeRef(n.meshCache,i.mesh,r);
4145return i.weights!==void 0&&a.traverse(function(o){if(o.isMesh)for(let c=0,l=i.weights.length;c<l;c++)o.morphTargetInfluences[c]=i.weights[c]}),a})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],r=n._loadNodeShallow(e),a=[],o=i.children||[];for(let l=0,h=o.length;l<h;l++)a.push(n.getDependency("node",o[l]));const c=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([r,Promise.all(a),c]).then(function(l){const h=l[0],u=l[1],d=l[2];d!==null&&h.traverse(function(f){f.isSkinnedMesh&&f.bind(d,p_)});for(let f=0,g=u.length;f<g;f++)h.add(u[f]);if(h.userData.pivot!==void 0&&u.length>0){const f=h.userData.pivot,g=u[0];h.pivot=new L().fromArray(f),h.position.x-=f[0],h.position.y-=f[1],h.position.z-=f[2],g.position.set(0,0,0),delete h.userData.pivot}return h})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const r=t.nodes[e],a=r.name?i.createUniqueName(r.name):"",o=[],c=i._invokeOne(function(l){return l.createNodeMesh&&l.createNodeMesh(e)});return c&&o.push(c),r.camera!==void 0&&o.push(i.getDependency("camera",r.camera).then(function(l){return i._getNodeRef(i.cameraCache,r.camera,l)})),i._invokeAll(function(l){return l.createNodeAttachment&&l.createNodeAttachment(e)}).forEach(function(l){o.push(l)}),this.nodeCache[e]=Promise.all(o).then(function(l){let h;if(r.isBone===!0?h=new gu:l.length>1?h=new ut:l.length===1?h=l[0]:h=new yt,h!==l[0])for(let u=0,d=l.length;u<d;u++)h.add(l[u]);if(r.name&&(h.userData.name=r.name,h.name=a),Un(h,r),r.extensions&&Ei(n,h,r),r.matrix!==void 0){const u=new Ye;u.fromArray(r.matrix),h.applyMatrix4(u)}else r.translation!==void 0&&h.position.fromArray(r.translation),r.rotation!==void 0&&h.quaternion.fromArray(r.rotation),r.scale!==void 0&&h.scale.fromArray(r.scale);if(!i.associations.has(h))i.associations.set(h,{});else if(r.mesh!==void 0&&i.meshCache.refs[r.mesh]>1){const u=i.associations.get(h);i.associations.set(h,{...u})}return i.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,r=new ut;n.name&&(r.name=i.createUniqueName(n.name)),Un(r,n),n.extensions&&Ei(t,r,n);const a=n.nodes||[],o=[];for(let c=0,l=a.length;c<l;c++)o.push(i.getDependency("node",a[c]));return Promise.all(o).then(function(c){for(let h=0,u=c.length;h<u;h++){const d=c[h];d.parent!==null?r.add(Uv(d)):r.add(d)}const l=h=>{const u=new Map;for(const[d,f]of i.associations)(d instanceof Rn||d instanceof Nt)&&u.set(d,f);return h.traverse(d=>{const f=i.associations.get(d);f!=null&&u.set(d,f)}),u};return i.associations=l(r),r})}_createAnimationTracks(e,t,n,i,r){const a=[],o=e.name?e.name:e.uuid,c=[];function l(f){f.morphTargetInfluences&&c.push(f.name?f.name:f.uuid)}di[r.path]===di.weights?(l(e),e.isGroup&&e.children.forEach(l)):c.push(o);let h;switch(di[r.path]){case di.weights:h=Qs;break;case di.rotation:h=$s;break;case di.translation:case di.scale:h=oa;break;default:switch(n.itemSize){case 1:h=Qs;break;case 2:case 3:default:h=oa;break}break}const u=i.interpolation!==void 0?c_[i.interpolation]:Ws,d=this._getArrayFromAccessor(n);for(let f=0,g=c.length;f<g;f++){const b=new h(c[f]+"."+di[r.path],t.array,d,u);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(b),a.push(b)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=pc(t.constructor),i=new Float32Array(t.length);for(let r=0,a=t.length;r<a;r++)i[r]=t[r]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const i=this instanceof $s?o_:ju;return new i(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function g_(s,e,t){const n=e.attributes,i=new tn;if(n.POSITION!==void 0){const o=t.json.accessors[n.POSITION],c=o.min,l=o.max;if(c!==void 0&&l!==void 0){if(i.set(new L(c[0],c[1],c[2]),new L(l[0],l[1],l[2])),o.normalized){const h=pc(ss[o.componentType]);i.min.multiplyScalar(h),i.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const r=e.targets;if(r!==void 0){const o=new L,c=new L;for(let l=0,h=r.length;l<h;l++){const u=r[l];if(u.POSITION!==void 0){const d=t.json.accessors[u.POSITION],f=d.min,g=d.max;if(f!==void 0&&g!==void 0){if(c.setX(Math.max(Math.abs(f[0]),Math.abs(g[0]))),c.setY(Math.max(Math.abs(f[1]),Math.abs(g[1]))),c.setZ(Math.max(Math.abs(f[2]),Math.abs(g[2]))),d.normalized){const b=pc(ss[d.componentType]);c.multiplyScalar(b)}o.max(c)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}
vendor: 764 bytes, line 4145
4145i.expandByVector(o)}s.boundingBox=i;const a=new Cn;i.getCenter(a.center),a.radius=i.min.distanceTo(i.max)/2,s.boundingSphere=a}function Wh(s,e,t){const n=e.attributes,i=[];function r(a,o){return t.getDependency("accessor",a).then(function(c){s.setAttribute(o,c)})}for(const a in n){const o=fc[a]||a.toLowerCase();o in s.attributes||i.push(r(n[a],o))}if(e.indices!==void 0&&!s.index){const a=t.getDependency("accessor",e.indices).then(function(o){s.setIndex(o)});i.push(a)}return nt.workingColorSpace!==an&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${nt.workingColorSpace}" not supported.`),Un(s,e),g_(s,e,t),Promise.all(i).then(function(){return e.targets!==void 0?h_(s,e.targets,t):s})}var b_=function(){var s=
vendor: 9,464 bytes, line 4145
4145"b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq:VZkdbk:XYi5ud9:du8Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCabaOad2fhXaAcethQaxaDfhiaOaeaoaeao6E9RhLalcl4cifcd4hKazcj;cbfaAfhYcbh8AazcjdfhEaHh3incbh5dnawTmbaxa8Acd4fRbbh5kcbh8Eazcj;cbfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcj;cbfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcj;cbfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaK6mva8FaKfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasa8Acd4fRbbgociGPlbedrbkaATmdaza8Afh8Fazcj;cbfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeaza8Afhaazcj;cbfhhcbhoceh8EaYh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaLaocefgofmbka8FaQfh8FcdhoaacdfhaahaQfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8Eaza8AfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaYhainazcj;cbfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3a8Aclfg8Aad6mbkaXazcjdfaAad2z:jjjjb8AazazcjdfaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb"
4145,e=
vendor: 13,770 bytes, line 4145
4145"b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:W9Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:JBl8Aud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fhOaPaDfhAasaeaH9RaHasfae6EgCcsfgocl4cifcd4hXavcj;cbfaoc9WGgQcetfhLavcj;cbfaQci2fhKavcj;cbfaQfhYcbh8Aaoc;ab6hEincbh3dnawTmbaPa8Acd4fRbbh3kcbh5avcj;cbfh8Eindndndndna3a5cet4ciGgoc9:fPdebdkaxaA9RaQ6mwdnaQTmbavcj;cbfa5aQ2faAaQ;8qbbkaAaCfhAxdkaQTmeavcj;cbfa5aQ2fcbaQ;8kbxekaxaA9RaX6moaoclVcbawEhraAaXfhocbhidnaEmbaxao9Rc;Gb6mbcbhlina8EalfhidndndndndndnaAalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaiaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaiczfaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaicafaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaQ0meaihlaxao9Rc;Fb0mbkkdnaiaQ9pmbaici4hlinaxao9RcK6mwa8EaifhqdndndndndndnaAaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spkbbahaoclffagRb:q:W:cjbfhoxikaqaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spkbbahaocwffagRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbahaocdffagRb:q:W:cjbfhokalcdfhlaiczfgiaQ6mbkkaohAaoTmoka8EaQfh8Ea5cefg5cl9hmbkdndndndnawTmbaza8Acd4fRbbglciGPlbedwbkaQTmdavcjdfa8Afhlava8Afpbdbh8Jcbhoinalavcj;cbfaofpblbg8KaYaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaLaofpblbg8NaKaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLg8Fcep9Ta8Fpxeeeeeeeeeeeeeeeegap9op9Hp9rg8Fa8Jp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ma8PpmwDKYqk8AExm35Ps8E8Fg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ka8LpmwDKYqk8AExm35Ps8E8Fg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ugap9Abbbaladfglaaa8Fa8Fpmlvorlvorlvorlvorp9Ugap9Abbbaladfglaaa8Fa8FpmwDqkwDqkwDqkwDqkp9Ugap9Abbbaladfglaaa8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9AbbbaladfhlaoczfgoaQ6mbxikkaQTmeavcjdfa8Afhlava8Afpbdbh8Jcbhoinalavcj;cbfaofpblbg8KaYaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaLaofpblbg8NaKaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLg8Fcep:nea8Fpxebebebebebebebebgap9op:bep9rg8Fa8Jp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ma8PpmwDKYqk8AExm35Ps8E8Fg8Fcep:nea8Faap9op:bep9rg8Fp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLg8Fcep:nea8Faap9op:bep9rg8Fp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ka8LpmwDKYqk8AExm35Ps8E8Fg8Fcep:nea8Faap9op:bep9rg8Fp:oegap9Abbbaladfglaaa8Fa8Fpmlvorlvorlvorlvorp:oegap9Abbbaladfglaaa8Fa8FpmwDqkwDqkwDqkwDqkp:oegap9Abbbaladfglaaa8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9AbbbaladfhlaoczfgoaQ6mbxdkkaQTmbcbhocbalcl4gl9Rc8FGhiavcjdfa8Afhrava8Afpbdbhainaravcj;cbfaofpblbg8JaYaofpblbg8KpmbzeHdOiAlCvXoQrLg8LaLaofpblbg8MaKaofpblbg8NpmbzeHdOiAlCvXoQrLgypmbezHdiOAlvCXorQLg8Faip:Rea8Falp:Tep9qg8Faap9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8LaypmwDKYqk8AExm35Ps8E8Fg8Faip:Rea8Falp:Tep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8Ja8KpmwKDYq8AkEx3m5P8Es8Fg8Ja8Ma8NpmwKDYq8AkEx3m5P8Es8Fg8KpmbezHdiOAlvCXorQLg8Faip:Rea8Falp:Tep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8Ja8KpmwDKYqk8AExm35Ps8E8Fg8Faip:Rea8Falp:Tep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9AbbbaradfhraoczfgoaQ6mbkka8Aclfg8Aad6mbkdnaCad2goTmbaOavcjdfao;8qbbkdnammbavavcjdfaCcufad2fad;8qbbkaCaHfhHc9:hoaAhPaAmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb"
vendor: 2,930 bytes, line 4145
4145,t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var i=WebAssembly.validate(t)?o(e):o(s),r,a=WebAssembly.instantiate(i,{}).then(function(p){r=p.instance,r.exports.__wasm_call_ctors()});function o(p){for(var _=new Uint8Array(p.length),y=0;y<p.length;++y){var v=p.charCodeAt(y);_[y]=v>96?v-97:v>64?v-39:v+4}for(var T=0,y=0;y<p.length;++y)_[T++]=_[y]<60?n[_[y]]:(_[y]-60)*64+_[++y];return _.buffer.slice(0,T)}function c(p,_,y,v,T,E,C){var x=p.exports.sbrk,S=v+3&-4,A=x(S*T),R=x(E.length),D=new Uint8Array(p.exports.memory.buffer);D.set(E,R);var F=_(A,v,T,R,E.length);if(F==0&&C&&C(A,S,T),y.set(D.subarray(A,A+v*T)),x(A-x(0)),F!=0)throw new Error("Malformed buffer data: "+F)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},h={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],d=0;function f(p){var _={object:new Worker(p),pending:0,requests:{}};return _.object.onmessage=function(y){var v=y.data;_.pending-=v.count,_.requests[v.id][v.action](v.value),delete _.requests[v.id]},_}function g(p){for(var _="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(i)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+m.name+";"+c.toString()+m.toString(),y=new Blob([_],{type:"text/javascript"}),v=URL.createObjectURL(y),T=u.length;T<p;++T)u[T]=f(v);for(var T=p;T<u.length;++T)u[T].object.postMessage({});u.length=p,URL.revokeObjectURL(v)}function b(p,_,y,v,T){for(var E=u[0],C=1;C<u.length;++C)u[C].pending<E.pending&&(E=u[C]);return new Promise(function(x,S){var A=new Uint8Array(y),R=++d;E.pending+=p,E.requests[R]={resolve:x,reject:S},E.object.postMessage({id:R,count:p,size:_,source:A,mode:v,filter:T},[A.buffer])})}function m(p){var _=p.data;self.ready.then(function(y){if(!_.id)return self.close();try{var v=new Uint8Array(_.count*_.size);c(y,y.exports[_.mode],v,_.count,_.size,_.source,y.exports[_.filter]),self.postMessage({id:_.id,count:_.count,action:"resolve",value:v},[v.buffer])}catch(T){self.postMessage({id:_.id,count:_.count,action:"reject",value:T})}})}return{ready:a,supported:!0,useWorkers:function(p){g(p)},decodeVertexBuffer:function(p,_,y,v,T){c(r,r.exports.meshopt_decodeVertexBuffer,p,_,y,v,r.exports[l[T]])},decodeIndexBuffer:function(p,_,y,v){c(r,r.exports.meshopt_decodeIndexBuffer,p,_,y,v)},decodeIndexSequence:function(p,_,y,v){c(r,r.exports.meshopt_decodeIndexSequence,p,_,y,v)}
4145,decodeGltfBuffer:function(p,_,y,v,T,E){c(r,r.exports[h[T]],p,_,y,v,r.exports[l[E]])},decodeGltfBufferAsync:function(p,_,y,v,T){return u.length>0?b(p,_,y,h[v],l[T]):a.then(function(){var E=new Uint8Array(p*_);return c(r,r.exports[h[v]],E,p,_,y,r.exports[l[T]]),E})}}}();async function Ku(s,e){const t=new Ov(e);t.setMeshoptDecoder(b_);const{scene:n}=await t.loadAsync(s);return n.traverse(i=>{if(!(i instanceof Ke))return;const r=i.geometry;for(const[a,o]of Object.entries(r.attributes)){if(!(o instanceof fa)&&o.array instanceof Float32Array&&!o.normalized)continue;const{count:c,itemSize:l}=o,h=new Float32Array(c*l);for(let u=0;u<c;u++)for(let d=0;d<l;d++)h[u*l+d]=o.getComponent(u,d);r.setAttribute(a,new Gt(h,l))}}),n}async function x_(s){const e=await Ku("/models/car-concept.glb",s);e.rotation.y=Math.PI,e.updateMatrixWorld(!0);const t=new tn().setFromObject(e,!0),n=t.getCenter(new L);e.position.set(-n.x,-t.min.y,-n.z),e.updateMatrixWorld(!0);const i=new ut,r=new Map,a=new Set;e.traverse(l=>{if(!(l instanceof Ke)||Array.isArray(l.material))return;let h=l;for(;h&&!/^Wheel(Front|Rear)[LR]$/.test(h.name);)h=h.parent;const u=h?h.name+(/BrakePad/.test(l.name)?":caliper":""):"",d=h?h.getWorldPosition(new L):new L,f=`${u}|${l.material.uuid}`;let g=r.get(f);g||(g={geometries:[],material:l.material,pivot:d,wheel:u},r.set(f,g));const b=l.geometry.clone();b.index||b.setIndex(Array.from({length:b.getAttribute("position").count},(m,p)=>p)),b.applyMatrix4(l.matrixWorld),b.translate(-d.x,-d.y,-d.z),h&&b.applyQuaternion(Lv(h.matrixWorld));for(const m of Object.keys(b.attributes))["position","normal","uv","uv1"].includes(m)||b.deleteAttribute(m);for(const m of["uv","uv1"])b.hasAttribute(m)||b.setAttribute(m,new rt(new Float32Array(b.getAttribute("position").count*2),2));g.geometries.push(b),a.add(l.geometry)});const o=new Map;for(const{geometries:l,material:h,pivot:u,wheel:d}of r.values()){const f=Wu(l);if(l.forEach(b=>b.dispose()),!f)continue;h instanceof fn&&(h.name==="Glass"&&(h.transmission=0,h.transparent=!0,h.opacity=.25,h.color.set("#546570"),h.roughness=.08,h.envMapIntensity=.45,h.depthWrite=!1,h.forceSinglePass=!0),h.iridescence=0);const g=new Ke(f,h);if(d){let b=o.get(d);b||(b=new ut,b.name=d.endsWith(":caliper")?"brake-caliper":"wheel",b.position.copy(u),o.set(d,b),i.add(b)),b.add(g)}else i.add(g)}for(const l of o.values()){const h=new tn().setFromObject(l,!0);l.userData.radius=h.getSize(new L).y/2}a.forEach(l=>l.dispose());const c=t.getSize(new L);return i.userData.nominalWidth=c.x,i.userData.nominalLength=c.z,i}function v_(s,e){const t=s.clone(!0),n=new Map;return t.traverse(i=>{if(!(i instanceof Ke))return;i.castShadow=!0,i.receiveShadow=!0,i.userData.sharedGeometry=!0;const r=a=>{let o=n.get(a);return o||(o=a.clone(),n.set(a,o),o instanceof St&&o.name.startsWith("Paint")&&(o.color.set(e),o.roughness=.28,o.metalness=.65),o instanceof St&&o.name==="License"&&(o.map=null,o.emissiveMap=null,o.emissive.set(0),o.color.set("#d6d8d5")),o)};i.material=Array.isArray(i.material)?i.material.map(r):r(i.material)}),t}function la(s){const e=new Set;s.traverse(t=>{if(t instanceof Ke)for(const n of Array.isArray(t.material)?t.material:[t.material])for(const i of Object.values(n))i instanceof Nt&&e.add(i)});for(const t of e)t.dispose(),typeof ImageBitmap<"u"&&t.image instanceof ImageBitmap&&t.image.close();$i(s)}const ho="/scene3d/";class __{constructor(){le(this,"asphalt");le(this,"ground");le(this,"sky");le(this,"fir");le(this,"shrub");le(this,"firFar");le(this,"textures",new Set);le(this,"disposed",!1);le(this,"failures",0)}async load(e){const t=async(a,o=!1)=>{const c=await new Lu(e).loadAsync(ho+a);
4145return c.colorSpace=o?kt:Jn,c.wrapS=c.wrapT=_n,this.disposed?c.dispose():this.textures.add(c),c},n=async a=>{const[o,c,l]=await Promise.all([t(`${a}-diff.jpg`,!0),t(`${a}-nor_gl.jpg`),t(`${a}-arm.jpg`)]);return{color:o,normal:c,arm:l}},i=async a=>{const o=await Ku(ho+a,e);o.updateMatrixWorld(!0);const c=new tn().setFromObject(o,!0),l=c.getCenter(new L);if(o.position.sub(new L(l.x,c.min.y,l.z)),o.updateMatrixWorld(!0),o.userData.height=c.getSize(new L).y,o.traverse(h=>{if(h instanceof Ke)for(const u of Array.isArray(h.material)?h.material:[h.material])u instanceof St&&(u.side=Yt,u.roughness=1,u.metalness=0)}),this.disposed)throw la(o),new Error("View disposed");return o},r=await Promise.allSettled([n("asphalt").then(a=>{for(const o of Object.values(a))o.repeat.setScalar(1);this.asphalt=a}),n("ground").then(a=>{this.ground=a}),new Dv(e).loadAsync(ho+"day.hdr").then(a=>{a.mapping=Us,this.sky=a}),i("fir.glb").then(a=>{this.fir=a}),i("fir-far.glb").then(a=>{this.firFar=a}),Promise.all([i("shrub.glb").then(a=>(this.shrub=a,a)),t("shrub-alpha.jpg")]).then(([a,o])=>{o.flipY=!1,a.traverse(c=>{if(c instanceof Ke)for(const l of Array.isArray(c.material)?c.material:[c.material])l instanceof St&&(l.alphaMap=o,l.alphaTest=.15,l.alphaToCoverage=!0,l.transparent=!1)})})]);this.failures=r.filter(a=>a.status==="rejected").length,this.disposed&&this.dispose()}dispose(){var e;this.disposed=!0,this.textures.forEach(t=>t.dispose()),this.textures.clear(),(e=this.sky)==null||e.dispose();for(const t of[this.fir,this.shrub,this.firFar])t&&la(t);this.fir=this.shrub=this.firFar=void 0}}function M_(s){const{data:e,width:t,height:n}=s.image;if(!e)return new L(-.65,.7,-.45).normalize();let i=-1/0,r=0,a=0;const o=s.type===Ct?Ns.fromHalfFloat:h=>h;for(let h=0;h<t*n;h++){const u=o(e[h*4])*.2126+o(e[h*4+1])*.7152+o(e[h*4+2])*.0722,d=Math.floor(h/t);d>n/2||u<=i||(i=u,r=h%t,a=d)}const c=((r+.5)/t-.5)*Math.PI*2,l=(.5-(a+.5)/n)*Math.PI;return new L(Math.cos(c)*Math.cos(l),Math.sin(l),Math.sin(c)*Math.cos(l)).normalize()}function Yu(s,e){const t=s.matrixWorldAutoUpdate;t&&s.updateMatrixWorld(),s.matrixWorldAutoUpdate=!1;try{return e()}finally{s.matrixWorldAutoUpdate=t}}class y_{constructor(e){le(this,"cube");le(this,"camera");le(this,"filtered");le(this,"pmrem");le(this,"last",new L(1/0,1/0,1/0));this.renderer=e,this.cube=new Xc(128,{type:e.extensions.has("EXT_color_buffer_float")?Ct:Jt}),this.camera=new Fu(.25,2e3,this.cube),this.pmrem=new ca(e)}invalidate(){this.last.setScalar(1/0)}update(e,t,n,i,r=!0,a){var d,f;if(!r){e.environment=((d=this.filtered)==null?void 0:d.texture)??i;return}if(this.filtered&&t.distanceTo(this.last)<64){e.environment=this.filtered.texture;return}const o=n.map(g=>g.visible),c=this.renderer.shadowMap.autoUpdate,l=e.environment,h=e.backgroundIntensity,u=e.background;a&&(e.background=a),e.backgroundIntensity=1,e.environment=i,n.forEach(g=>{g.visible=!1}),this.renderer.shadowMap.autoUpdate=!1;try{this.camera.position.copy(t).add(new L(0,1.6,0)),Yu(e,()=>this.camera.update(this.renderer,e));const g=this.pmrem.fromCubemap(this.cube.texture);(f=this.filtered)==null||f.dispose(),this.filtered=g,this.last.copy(t),e.environment=g.texture}catch(g){throw e.environment=l,g}finally{e.background=u,e.backgroundIntensity=h,n.forEach((g,b)=>{g.visible=o[b]}),this.renderer.shadowMap.autoUpdate=c}}dispose(){var e;(e=this.filtered)==null||e.dispose(),this.cube.dispose(),this.pmrem.dispose()}}class Xh{constructor(e){le(this,"minimumHeight",1/0);le(this,"cells",new Map);le(this,"large",[]);e.updateMatrixWorld(!0),e.traverse(t=>{if(!(t instanceof Ke)||!t.visible)return;const n=t.geometry.getAttribute("position"),i=t.geometry.index;if(!n)return;const r=(i==null?void 0:i.count)??n.count;for(let a=0;a+2<r;a+=3){const o=[0,1,2].map(p=>new L().fromBufferAttribute(n,i?i.getX(a+p):a+p).applyMatrix4(t.matrixWorld)),[c,l,h]=o,u=(l.z-h.z)*(c.x-h.x)+(h.x-l.x)*(c.z-h.z);if(!Number.isFinite(u)||Math.abs(u)<1e-10)continue;this.minimumHeight=Math.min(this.minimumHeight,c.y,l.y,h.y);const d={a:c,b:l,c:h,inverse:1/u,road:!!t.name},f=Math.floor(Math.min(c.x,l.x,h.x)/32),g=Math.floor(Math.max(c.x,l.x,h.x)/32),b=Math.floor(Math.min(c.z,l.z,h.z)/32),m=Math.floor(Math.max(c.z,l.z,h.z)/32);if((g-f+1)*(m-b+1)>4096){this.large.push(d);continue}for(let p=f;p<=g;p++)for(let _=b;_<=m;_++){const y=`${p},${_}`,v=this.cells.get(y);
4145v?v.push(d):this.cells.set(y,[d])}}})}overlapsDisk(e,t,n){var c;const i=new Set,r=n*n,a=(l,h)=>{const u=h.x-l.x,d=h.z-l.z,f=u*u+d*d,g=f?Math.max(0,Math.min(1,((e-l.x)*u+(t-l.z)*d)/f)):0;return(e-l.x-g*u)**2+(t-l.z-g*d)**2},o=l=>{if(i.has(l))return!1;i.add(l);const{a:h,b:u,c:d,inverse:f}=l,g=((u.z-d.z)*(e-d.x)+(d.x-u.x)*(t-d.z))*f,b=((d.z-h.z)*(e-d.x)+(h.x-d.x)*(t-d.z))*f;return g>=-1e-8&&b>=-1e-8&&g+b<=1+1e-8||Math.min(a(h,u),a(u,d),a(d,h))<=r+1e-8};for(let l=Math.floor((e-n)/32);l<=Math.floor((e+n)/32);l++)for(let h=Math.floor((t-n)/32);h<=Math.floor((t+n)/32);h++)if((c=this.cells.get(`${l},${h}`))!=null&&c.some(o))return!0;return this.large.some(o)}heightAt(e,t,n=!1){let i;const r=a=>{for(const{a:o,b:c,c:l,inverse:h,road:u}of a){if(n&&!u)continue;const d=((c.z-l.z)*(e-l.x)+(l.x-c.x)*(t-l.z))*h,f=((l.z-o.z)*(e-l.x)+(o.x-l.x)*(t-l.z))*h;if(d<-1e-8||f<-1e-8||d+f>1.00000001)continue;const g=d*o.y+f*c.y+(1-d-f)*l.y;g<=1e4&&(i===void 0||g>i)&&(i=g)}};return r(this.cells.get(`${Math.floor(e/32)},${Math.floor(t/32)}`)??[]),r(this.large),i}}function S_(s,e){const t=h=>{const u=[0];for(let f=1;f<h.length;f++)u.push(u[f-1]+Math.hypot(h[f].x-h[f-1].x,h[f].y-h[f-1].y));const d=u[u.length-1]||1;return{points:h,stations:u.map(f=>f/d),cursor:0}},n=[t(s),t(e)],i=[...new Set(n.flatMap(h=>h.stations))].sort((h,u)=>h-u),r=[],a=[],o=[];if(s.length<2||e.length<2)return new xt;for(const h of i)for(const u of n){for(;u.cursor<u.points.length-2&&u.stations[u.cursor+1]<h;)u.cursor++;const d=u.cursor,f=u.points[d],g=u.points[d+1],b=u.stations[d+1]-u.stations[d],m=b>0?Lt.clamp((h-u.stations[d])/b,0,1):0,p=Lt.lerp(f.x,g.x,m)/po,_=Lt.lerp(f.y,g.y,m)/po;r.push(p,Lt.lerp(f.z??0,g.z??0,m)+.01,_),a.push(p/4,_/4)}const c=(h,u,d)=>{const f=(r[u*3+2]-r[h*3+2])*(r[d*3]-r[h*3])-(r[u*3]-r[h*3])*(r[d*3+2]-r[h*3+2]);Math.abs(f)>1e-10&&o.push(h,f>0?u:d,f>0?d:u)};for(let h=1;h<i.length;h++){const u=h*2;c(u-2,u,u-1),c(u-1,u,u+1)}const l=new xt;return l.setAttribute("position",new rt(r,3)),l.setAttribute("uv",new rt(a,2)),l.setIndex(o),l.computeVertexNormals(),l}function qh(s){const e=new St({color:s,roughness:.93,metalness:0,side:Yt,transparent:!0,depthWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-2}),t=new dt,n={value:new te(1,1)};return e.onBeforeRender=i=>{i.getCurrentViewport(t),n.value.set(Math.max(1,t.z),Math.max(1,t.w))},e.onBeforeCompile=i=>{i.uniforms.paintViewport=n,i.vertexShader=`
4146      attribute vec3 paintCenter;
4147      attribute float paintSide;
4148      attribute vec3 paintTangent;
4149      uniform vec2 paintViewport;
4150      varying vec2 vPaintProfile;
4151      varying vec2 vPaintWorld;
4152    `+i.vertexShader,i.vertexShader=i.vertexShader.replace("#include <project_vertex>",`
4153      #include <project_vertex>
4154      vec4 centerClip = projectionMatrix * modelViewMatrix * vec4(paintCenter, 1.0);
4155      vec4 tangentClip = projectionMatrix * modelViewMatrix * vec4(paintCenter + paintTangent, 1.0);
4156      vec2 tangentPixels = (tangentClip.xy * centerClip.w - centerClip.xy * tangentClip.w) * paintViewport;
4157      vec2 normalPixels = vec2(-tangentPixels.y, tangentPixels.x) / max(length(tangentPixels), 0.000001);
4158      vec2 deltaPixels = (gl_Position.xy / gl_Position.w - centerClip.xy / centerClip.w) * paintViewport * 0.5;
4159      float signedHalfPixels = dot(deltaPixels, normalPixels);
4160      float halfPixels = abs(signedHalfPixels);
4161      // Extrude perpendicular to the SCREEN line, not along the projected road
4162      // width: those directions diverge strongly on distant, near-horizontal lanes.
4163      gl_Position.xy += normalPixels * sign(signedHalfPixels) * 2.0 / paintViewport * gl_Position.w;
4164      // Undo perspective interpolation in the fragment shader. Coverage is a
4165      // screen-pixel quantity; perspective-correct normalized edge coordinates
4166      // otherwise change the profile across the two triangles of a long strip.
4167      vPaintProfile = vec2(paintSide * (halfPixels + 1.0), halfPixels) * gl_Position.w;
4168      vPaintWorld = position.xz;
4169    `),i.fragmentShader=`
4170      varying vec2 vPaintProfile;
4171      varying vec2 vPaintWorld;
4172      float paintHash(vec2 p) { return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }
4173      float paintNoise(vec2 p) {
4174        vec2 i = floor(p), f = fract(p); f = f * f * (3.0 - 2.0 * f);
4175        return mix(mix(paintHash(i), paintHash(i + vec2(1, 0)), f.x),
4176                   mix(paintHash(i + vec2(0, 1)), paintHash(i + vec2(1, 1)), f.x), f.y);
4177      }
4178    `+i.fragmentShader,i.fragmentShader=i.fragmentShader.replace("#include <color_fragment>",`
4179      #include <color_fragment>
4180      vec2 profile = vPaintProfile * gl_FragCoord.w;
4181      float radius = 0.85;
4182      float coverage = smoothstep(-radius, radius, profile.y - profile.x) - smoothstep(-radius, radius, -profile.y - profile.x);
4183      diffuseColor.a *= coverage;
4184      // Low-contrast aggregate and broad wear, faded out before they alias.
4185      vec2 grainUV = vPaintWorld * 35.0;
4186      float grainFilter = 1.0 - smoothstep(0.25, 1.0, max(fwidth(grainUV.x), fwidth(grainUV.y)));
4187      float grain = mix(0.5, paintNoise(grainUV), grainFilter);
4188      vec2 wearUV = vPaintWorld * 0.6;
4189      float wearFilter = 1.0 - smoothstep(0.25, 1.0, max(fwidth(wearUV.x), fwidth(wearUV.y)));
4190      float wear = mix(0.5, paintNoise(wearUV), wearFilter);
4191      diffuseColor.rgb *= (0.93 + 0.07 * grain) * (0.96 + 0.04 * wear);
4192    `)},e.customProgramCacheKey=()=>"road-paint-coverage-v5",e}const mt=s=>s/po,us=s=>new L(mt(s.x),s.z??0,mt(s.y));function T_(s,e=0){const t=s.map(o=>new te(mt(o.x),mt(o.y))),n=Ai.triangulateShape(t,[]),i=[],r=[];for(const o of n){const[c,l,h]=o;for(const u of[c,h,l]){const d=s[u];i.push(mt(d.x),(d.z??0)+e,mt(d.y)),r.push(mt(d.x)/4,mt(d.y)/4)}}const a=new xt;return a.setAttribute("position",new rt(i,3)),a.setAttribute("uv",new rt(r,2)),a.computeVertexNormals(),a}function jh(s,e,t=0,n=0){const i=[],r=[],a=[],o=[];let l=0;for(let u=1;u<s.length;u++){const d=us(s[u-1]),f=us(s[u]),g=d.distanceTo(f);if(g<1e-6)continue;const b=f.clone().sub(d).divideScalar(g),m=new L(-b.z,0,b.x).normalize().multiplyScalar(e/2);for(let p=0;p<g;){const _=t>0?(l+p)%(t+n):0,y=t<=0||_<t,v=Math.min(g,p+8,p+(t>0?(y?t:t+n)-_:g));if(y){const T=d.clone().addScaledVector(b,p),E=d.clone().addScaledVector(b,v);T.y+=.025,E.y+=.025;for(const[C,x]of[[T,1],[E,1],[T,-1],[E,1],[E,-1],[T,-1]]){const S=C.clone().addScaledVector(m,x);i.push(S.x,S.y,S.z),r.push(C.x,C.y,C.z),a.push(x),o.push(b.x,b.y,b.z)}}p=Math.max(v,p+1e-6)}l+=g}const h=new xt;return h.setAttribute("position",new rt(i,3)),h.setAttribute("paintCenter",new rt(r,3)),h.setAttribute("paintSide",new rt(a,1)),h.setAttribute("paintTangent",new rt(o,3)),h.computeVertexNormals(),h}function E_(){const e=new Uint8Array(262144);let t=413;for(let i=0;i<256*256;i++){t=Math.imul(t,1664525)+1013904223>>>0;const r=90+(t>>>25);e.set([r,r,r,255],i*4)}const n=new bi(e,256,256);return n.wrapS=n.wrapT=_n,n.magFilter=Mt,n.minFilter=An,n.generateMipmaps=!0,n.needsUpdate=!0,n}function w_(s,e,t,n){var h,u,d,f,g;const i=new ut,r=b=>
4192s.getShape(b),a=s.getSplineBoundaryIds(),o=new St({polygonOffset:!0,polygonOffsetFactor:0,polygonOffsetUnits:-1,color:"#33363b",map:t,bumpMap:t,bumpScale:.008,roughness:.94,side:Yt});n&&(o.color.set("#a9abad"),o.map=n.color,o.bumpMap=null,o.normalMap=n.normal,o.normalScale.setScalar(.65),o.roughnessMap=n.arm,o.aoMap=n.arm,o.aoMapIntensity=.7,o.onBeforeCompile=b=>{b.fragmentShader=b.fragmentShader.replace("#include <map_fragment>",`
4193        #include <map_fragment>
4194        #ifdef USE_MAP
4195          float aggregate = dot(sampledDiffuseColor.rgb, vec3(0.2126, 0.7152, 0.0722));
4196          aggregate = max(0.008, (aggregate - 0.06) * 1.8 + 0.06);
4197          diffuseColor.rgb = diffuse * aggregate;
4198        #endif
4199      `)},o.customProgramCacheKey=()=>"aggregate-road-v1");const c=qh("#d9d5cb"),l=qh("#d7ad50");for(const b of e)if(b.props.opacity!==0){if(b.type==="lane"){const m=Jh(b,r,a);if(!m||m.left.length<2||m.right.length<2)continue;const p=new Ke(S_(m.left,m.right),o);p.name=b.id,p.receiveShadow=!0,i.add(p)}else if(b.type==="crosswalk"){const m=b.props,p=m.endX-m.startX,_=m.endY-m.startY,y=Math.hypot(p,_);if(!y)continue;const v=Lt.degToRad(b.rotation??0),T=(m.startX+m.endX)/2,E=(m.startY+m.endY)/2,C=(x,S)=>({x:b.x+T+(x-T)*Math.cos(v)-(S-E)*Math.sin(v),y:b.y+E+(x-T)*Math.sin(v)+(S-E)*Math.cos(v)});for(const x of ad(y,m.stripeWidth,m.stripeWidth+m.stripeSpacing)){const S=m.startX+p/y*x,A=m.startY+_/y*x,R=-_/y*m.crosswalkWidth/2,D=p/y*m.crosswalkWidth/2;i.add(new Ke(jh([C(S+R,A+D),C(S-R,A-D)],mt(m.stripeWidth)),c))}}else if(b.type==="polygon"){const m=(b.props.pointIds??[]).map(v=>s.getShape(v)).filter(v=>!!v).map(v=>({x:v.x,y:v.y,z:v.props.z??0}));if(m.length<3)continue;const p=/building/.test(`${(h=b.props.attributes)==null?void 0:h.type} ${(u=b.props.attributes)==null?void 0:u.subtype}`),_=new St({color:p?"#b2aea4":Zh(b.props.color==="default"?"grey-500":b.props.color),roughness:.9,side:Yt}),y=new Ke(T_(m,p?Math.max(1,Number((d=b.props.attributes)==null?void 0:d.height)||6):-.01),_);if(y.receiveShadow=!0,y.castShadow=p,i.add(y),p){const v=Math.max(1,Number((f=b.props.attributes)==null?void 0:f.height)||6),T=[];for(let x=0;x<m.length;x++){const S=us(m[x]),A=us(m[(x+1)%m.length]),R=A.clone().add(new L(0,v,0)),D=S.clone().add(new L(0,v,0));for(const F of[S,A,R,S,R,D])T.push(F.x,F.y,F.z)}const E=new xt;E.setAttribute("position",new rt(T,3)),E.computeVertexNormals();const C=new Ke(E,_);C.castShadow=C.receiveShadow=!0,i.add(C)}}else if(b.type==="traffic_light"){const m=new ut,p=new St({color:"#20252a",roughness:.7}),_=new Ke(new js(.065,.085,3.2,12),p);_.position.y=1.6,m.add(_);const y=new Ke(new ni(.42,1.12,.3),p);y.position.y=3.25,m.add(y);for(const[v,T,E]of[[0,"red","#f22919"],[1,"yellow","#ffc928"],[2,"green","#28d680"]]){const C=b.props.activeLight,x=C===T||C==="all"||C==="red-yellow"&&T!=="green",S=new St({color:x?E:"#172222",emissive:x?E:"#000000",emissiveIntensity:2,roughness:.3}),A=new Ke(new Zs(.135,16,12),S);A.scale.z=.35,A.position.set(0,3.6-v*.35,-.16),m.add(A)}m.position.set(mt(b.x),0,mt(b.y)),m.rotation.y=-Lt.degToRad(b.rotation??0),m.traverse(v=>{v instanceof Ke&&(v.castShadow=!0)}),i.add(m)}else if(b.type==="linestring"&&!b.props.isPath){const m=od(b.id,!1,r,a.has(b.id)?"spline":"polyline"),p=String(((g=b.props.attributes)==null?void 0:g.subtype)??"solid"),_=/dash|broken/.test(p);if(/virtual|none/.test(p))continue;const y=new Ke(jh(m,Math.max(.1,mt(b.props.strokeWidth??2)),_?mt(b.props.dashLength??50):0,_?mt(b.props.gapLength??50):0),/yellow|orange/.test(b.props.color??"")?l:c);y.receiveShadow=!0,i.add(y)}}return i.userData.materials=[o,c,l],i}function A_(s,e){return s.id===e.id&&s.kind===e.kind&&s.x===e.x&&s.y===e.y&&s.h===e.h&&s.color===e.color&&s.opacity===e.opacity&&s.width===e.width&&s.height===e.height&&(s.pathPoints===e.pathPoints||!!s.pathPoints&&!!e.pathPoints&&s.pathPoints.length===e.pathPoints.length&&s.pathPoints.every((t,n)=>t.x===e.pathPoints[n].x&&t.y===e.pathPoints[n].y))}class R_{constructor(){le(this,"root",new ut);le(this,"previous",[]);le(this,"roads");le(this,"geometries",new Map);le(this,"batches",new Map);le(this,"paths",new ut);this.root.name="recording-ghosts",this.root.userData.excludeAO=!0,this.root.add(this.paths)}geometry(e){let t=this.geometries.get(e);if(!t){if(e==="vehicle"){const n=new zc;n.moveTo(-.5,.12);for(const[i,r]of[[.5,.12],[.5,.72],[.23,.82],[.08,1.4],[-.24,1.4],[-.36,.82],[-.5,.72]])n.lineTo(i,r);n.closePath(),t=new pa(n,{depth:1,bevelEnabled:!1,steps:1}),t.translate(0,0,-.5).rotateY(Math.PI/2)}else t=new Oc(.22,1.25,3,8),t.translate(0,.845,0);this.geometries.set(e,t)}return t}update(e,t){if(t===this.roads&&e.length===this.previous.length&&e.every((r,a)=>A_(r,this.previous[a])))return;this.previous=e,this.roads=t;const n=new Map;for(const r of e){if(r.kind==="path-line"||r.opacity<=0)continue;const a=`${r.kind}:${r.color??Wr.textActive}:${r.opacity}`,o=n.get(a);o?o.push(r):n.set(a,[r])}for(const[r,a]of this.batches)n.has(r)||(this.root.remove(a),a.dispose(),a.material.dispose(),this.batches.delete(r));const i=new yt;for(const[r,a]of n){let o=this.batches.get(r);if(!o||o.instanceMatrix.count<a.length){o&&(this.root.remove(o),o.dispose(),o.material.dispose());const c=a[0];o=new sa(this.geometry(c.kind),new zn({color:c.color??Wr.textActive,opacity:c.op
4199acity,transparent:!0,depthWrite:!1,toneMapped:!1}),2**Math.ceil(Math.log2(Math.max(1,a.length)))),o.name="ghost-stamps",this.batches.set(r,o),this.root.add(o)}o.count=a.length,a.forEach((c,l)=>{const h=mt(c.x),u=mt(c.y);i.position.set(h,(t.heightAt(h,u,!0)??0)+.025,u),i.rotation.set(0,-Lt.degToRad(c.h),0),i.scale.set(c.kind==="vehicle"?Math.max(.05,mt(c.width??30)):1,1,c.kind==="vehicle"?Math.max(.05,mt(c.height??56)):1),i.updateMatrix(),o.setMatrixAt(l,i.matrix)}),o.instanceMatrix.needsUpdate=!0,o.computeBoundingSphere()}this.clearPaths();for(const r of e){if(r.kind!=="path-line"||!r.pathPoints||r.pathPoints.length<2||r.opacity<=0)continue;const a=r.pathPoints.map(o=>{const c=mt(o.x),l=mt(o.y);return new L(c,(t.heightAt(c,l,!0)??0)+.045,l)});this.paths.add(new tr(new xt().setFromPoints(a),new Uc({color:r.color??Wr.textActive,opacity:r.opacity,transparent:!0,depthWrite:!1,toneMapped:!1})))}this.root.userData.stampCount=[...n.values()].reduce((r,a)=>r+a.length,0)}clearPaths(){for(const e of this.paths.children){const t=e;t.geometry.dispose(),t.material.dispose()}this.paths.clear()}dispose(){this.clearPaths();for(const e of this.batches.values())e.dispose(),e.material.dispose();for(const e of this.geometries.values())e.dispose();this.batches.clear(),this.geometries.clear(),this.root.clear(),this.previous=[],this.roads=void 0}}const Kh={neutral:Ma.trajectoryNeutral,decel:Ma.trajectoryDecel,accel:Ma.trajectoryAccel};function C_(s){return s.mode==="speed"?`speed:${s.minMps}:${s.maxMps}`:`accel:${s.scaleMps2}`}class P_{constructor(){le(this,"root",new ut);le(this,"entries",new Map);le(this,"previous");le(this,"previousRoads");le(this,"previousColorSettings");this.root.userData.excludeAO=!0}update(e,t,n=cd){if(e===this.previous&&t===this.previousRoads&&n===this.previousColorSettings)return;this.previous=e,this.previousRoads=t,this.previousColorSettings=n;const i=new Set;for(const r of e){const a=r.dots.filter((x,S,A)=>Number.isFinite(x.x)&&Number.isFinite(x.y)&&(!S||Math.hypot(x.x-A[S-1].x,x.y-A[S-1].y)>1e-7));if(a.length<2)continue;i.add(r.actorId);let o=this.entries.get(r.actorId);if(!o){const x=new zn({vertexColors:!0,transparent:!0,depthWrite:!1,side:Yt,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2,toneMapped:!1,fog:!1}),S=new Ke(new xt,x);S.renderOrder=1,this.root.add(S),o={mesh:S,capacity:0,sections:new Map,colors:new Map},this.entries.set(r.actorId,o)}const c=o.mesh.geometry;if(o.capacity<a.length){o.capacity=2**Math.ceil(Math.log2(a.length)),c.dispose(),c.setAttribute("position",new Gt(new Float32Array(o.capacity*6),3).setUsage(rc)),c.setAttribute("color",new Gt(new Float32Array(o.capacity*8),4).setUsage(rc));const x=[];for(let S=0;S<o.capacity-1;S++){const A=S*2;x.push(A,A+1,A+2,A+1,A+3,A+2)}c.setIndex(x)}const l=c.getAttribute("position"),h=c.getAttribute("color"),u=Math.max(.01,r.widthM??ld)/2,d=a[0],f=a[a.length-1],g=f.x-d.x,b=f.y-d.y,m=g*g+b*b,p=o.roads===t&&o.width===u,_=new Map,y=hd(n,{accelScale:r.accelScale,speedRange:r.speedRange}),v=C_(y);o.specKey!==v&&o.colors.clear();const T=new Map;let E=!1,C=!1;for(let x=0;x<a.length;x++){const S=a[x],A=a[Math.max(0,x-1)],R=a[Math.min(a.length-1,x+1)];let D=p?o.sections.get(S.t):void 0;if(!D||D.x!==S.x||D.y!==S.y||D.beforeX!==A.x||D.beforeY!==A.y||D.afterX!==R.x||D.afterY!==R.y){let G=S.x-A.x,j=S.y-A.y,Y=R.x-S.x,ne=R.y-S.y;x===0&&(G=Y,j=ne),x===a.length-1&&(Y=G,ne=j);const oe=Math.hypot(G,j)||1,ce=Math.hypot(Y,ne)||1;G/=oe,j/=oe,Y/=ce,ne/=ce;let Ee=-j-ne,je=G+Y,Ve=Math.hypot(Ee,je);Ve<1e-7&&(Ee=-j,je=G,Ve=1),Ee/=Ve,je/=Ve;const k=Math.min(u*2,u/Math.max(.5,Ee*-ne+je*Y)),ee=[];for(let Q=0;Q<2;Q++){const Se=Q===0?-1:1,Le=mt(S.x)+Se*Ee*k,Ie=mt(S.y)+Se*je*k,st=t.heightAt(Le,Ie,!0)??t.heightAt(mt(S.x),mt(S.y),!0)??0;ee.push(Le,st+.035,Ie)}D={x:S.x,y:S.y,beforeX:A.x,beforeY:A.y,afterX:R.x,afterY:R.y,vertices:ee}}_.set(S.t,D);const F=m>1e-12?Lt.clamp(((S.x-d.x)*g+(S.y-d.y)*b)/m,0,1):0,O=fd*(1-(1-pd)*F),I=y.mode==="speed"?S.v:S.a;let B=o.colors.get(I)??T.get(I);B||(B=new ze(ud(S,y,Kh,dd))),T.set(I,B);for(let G=0;G<2;G++){const j=x*2+G,Y=G*3,ne=Math.fround(D.vertices[Y]),oe=Math.fround(D.vertices[Y+1]),ce=Math.fround(D.vertices[Y+2]);(l.getX(j)!==ne||l.getY(j)!==oe||l.getZ(j)!==ce)&&(l.setXYZ(j,ne,oe,ce),E=!0);const Ee=Math.fround(B.r),je=Math.fround(B.g),Ve=Math.fround(B.b),k=Math.fround(O);(h.getX(j)!==Ee||h.getY(j)!==je||h.getZ(j)!==Ve||h.getW(j)!==k)&&(h.setXYZW(j,Ee,je,Ve,k),C=!0)}}o.sections=_,o.roads=t,o.width=u,o.colors=T,o.specKey=v,E&&(l.needsUpdate=!0),C&&(h.needsUpdate=!0),c.setDrawRange(0,(a.length-1)*6),(E||!c.boundingBox||c.userData.pointCount!==a.length)&&(c.boundingBox=new tn().setFromArray(l.array.subarray(0,a.length*6)),c.boundingSphere=c.boundingBox.getBoundingSphere(new Cn),c.userData.pointCount=a.length),o.mesh.userData.trajectory={actorId:r.actorId,source:r.dotSource??"replay",firstT:d.t,lastT:f.t,points:a.length,widthM:u*2,neutral:Kh.neutral,colorMode:y.mode}}for(const[r,a]of this.entries)i.has(r)||(a.mesh.geometry.dispose(),a.mesh.material.dispose(),this.root.remove(a.mesh),this.entries.delete(r))}dispose(){for(const e of this.entries.values())e.mesh.geometry.dispose(),e.mesh.material.dispose();this.entries.clear(),this.root.clear(),this.previous=void 0,this.previousRoads=void 0,this.previousColorSettings=void 0}}function D_(s,e){const t=s.slice(1).map((n,i)=>{const r=s[i],a=n.clone().sub(r);a.y=0;const o=new L(-a.z,0,a.x).normalize(),c=e[Math.round((i+.5)/(s.length-1)*(e.length-1))];return c&&o.dot(r.clone().add(n).multiplyScalar(.5).sub(c))<0&&o.negate(),o});return s.map((n,i)=>{let r=i-1,a=i;for(;r>=0&&t[r].lengthSq()<1e-12;)r--;for(;a<t.length&&t[a].lengthSq()<1e-12;)a++;const o=t[r]??t[a]??new L,c=t[a]??o,l=o.clone().add(c).normalize();return l.lengthSq()<1e-12?o.clone():l.multiplyScalar(1/Math.max(.25,l.dot(o)))})}function L_(s,e,t){const n=new ut,i=[],r=o=>e.heightAt(o.x,o.z)===void 0,a=(...o)=>
4199o.forEach(c=>i.push(c.x,c.y,c.z));for(const o of s.getCurrentPageShapes()){if(o.type!=="lane"||o.props.opacity===0)continue;const c=Jh(o,l=>s.getShape(l),s.getSplineBoundaryIds());if(c)for(const[l,h]of[[c.left,c.right],[c.right,c.left]]){if(l.length<2||!h.length)continue;const u=l.map(us),d=D_(u,h.map(us)),f=u.map((m,p)=>m.clone().addScaledVector(d[p],.04).add(new L(0,.005,0))),g=u.map((m,p)=>m.clone().addScaledVector(d[p],1.44).add(new L(0,.005,0))),b=u.map((m,p)=>m.clone().addScaledVector(d[p],2));for(let m=1;m<u.length;m++){const p=u[m-1],_=u[m];if(p.distanceTo(t)>450&&_.distanceTo(t)>450)continue;const y=p.distanceTo(_);if(y<1e-6)continue;const v=Math.max(1,Math.ceil(y/4));for(let T=0;T<v;T++){const E=T/v,C=(T+1)/v,x=b[m-1].clone().lerp(b[m],E),S=b[m-1].clone().lerp(b[m],C);if(!r(x)||!r(S)||!r(x.clone().lerp(S,.5)))continue;const A=f[m-1].clone().lerp(f[m],E),R=f[m-1].clone().lerp(f[m],C),D=g[m-1].clone().lerp(g[m],E),F=g[m-1].clone().lerp(g[m],C);a(A,R,D,R,F,D)}}}}if(i.length){const o=new xt;o.setAttribute("position",new rt(i,3)),o.computeVertexNormals();const c=new St({color:"#777a70",roughness:1,side:Yt}),l=new Ke(o,c);l.receiveShadow=!0,n.add(l)}return n}const hn=(s,e,t=0)=>{let n=Math.imul(s|0,374761393)^Math.imul(e|0,668265263)^t;return n=Math.imul(n^n>>>13,1274126177),((n^n>>>16)>>>0)/4294967296},N_=(s,e)=>{const t=Math.floor(s/5),n=Math.floor(e/5),i=o=>o*o*(3-2*o),r=i(s/5-t),a=i(e/5-n);return Lt.lerp(Lt.lerp(hn(t,n,113),hn(t+1,n,113),r),Lt.lerp(hn(t,n+1,113),hn(t+1,n+1,113),r),a)};function I_(s,e,t,n){const i=[],r=Math.floor(s/20),a=Math.floor(e/20);for(let o=r-18;o<=r+18;o++)for(let c=a-18;c<=a+18;c++){if(hn(o,c,73)>Math.pow(N_(o,c),2)*.9+.12)continue;const l=o*20+hn(o,c)*20,h=c*20+hn(o,c,17)*20,u=3.5+hn(o,c,91)*5.5;n(l,h,u)||i.push({x:l,z:h,height:u,rotation:hn(o,c,31)*Math.PI*2})}return i.sort((o,c)=>Math.hypot(o.x-s,o.z-e)-Math.hypot(c.x-s,c.z-e)).slice(0,t)}class F_{constructor(){le(this,"root",new ut);le(this,"vegetation",new ut);le(this,"key","");le(this,"batches",new Map);le(this,"roadside",new ut);le(this,"roadsideFocus",new L(1/0,1/0,1/0));le(this,"sourceKey","");le(this,"footprintRadii",new WeakMap);le(this,"enabled",!0);le(this,"limit",100);this.root.userData.excludeAO=!0,this.root.add(this.vegetation)}footprintRadius(e){let t=this.footprintRadii.get(e);if(t===void 0){e.updateMatrixWorld(!0);const n=new tn().setFromObject(e,!0);t=n.isEmpty()?0:Math.hypot(Math.max(Math.abs(n.min.x),Math.abs(n.max.x)),Math.max(Math.abs(n.min.z),Math.abs(n.max.z)))/(e.userData.height||3),this.footprintRadii.set(e,t)}return t}invalidate(){this.key="",this.roadsideFocus.setScalar(1/0)}update(e,t,n,i,r=0){var b,m;this.vegetation.position.y=r;const a=`${Math.floor(e.x/32)},${Math.floor(e.z/32)},${this.enabled},${this.limit},${!!n.fir}`;if(this.key===a||(this.key=a,this.root.visible=this.enabled,!this.enabled)||(this.roadsideFocus.distanceTo(e)>200&&(this.root.remove(this.roadside),this.disposeGroup(this.roadside),this.roadside=L_(i,t,e),this.root.add(this.roadside),this.roadsideFocus.copy(e)),!n.fir))return;const o=Math.max(this.footprintRadius(n.fir),this.footprintRadius(n.firFar??n.fir)),c=n.shrub?this.footprintRadius(n.shrub)*1.5:0,l=(p,_,y)=>t.overlapsDisk(p,_,Math.max(o*y*1.12,c)+1.75),h=I_(e.x,e.z,this.limit,l),u=`${n.fir.uuid}|${(b=n.firFar)==null?void 0:b.uuid}|${(m=n.shrub)==null?void 0:m.uuid}|${this.limit}`;if(u!==this.sourceKey){for(const p of this.batches.values())for(const _ of p)this.vegetation.remove(_),this.disposeGroup(_);this.batches.clear(),this.sourceKey=u}const d=(p,_,y,v)=>{const T=`${p.uuid}|${_}|${v}`;let E=this.batches.get(T);E||(E=[],p.updateMatrixWorld(!0),p.traverse(R=>{if(!(R instanceof Ke))return;const D=R.geometry.clone().applyMatrix4(R.matrixWorld),F=Array.isArray(R.material)?R.material.map(I=>I.clone()):R.material.clone(),O=new sa(D,F,this.limit);O.instanceMatrix.setUsage(rc),O.castShadow=v,O.receiveShadow=!0,E.push(O),this.vegetation.add(O)}),this.batches.set(T,E));const C=new Ye,x=new dn,S=new L,A=new L;for(const R of E)R.count=y.length,R.visible=y.length>0,y.forEach((D,F)=>{const O=D.height/(p.userData.height||3);x.setFromAxisAngle(yt.DEFAULT_UP,D.rotation);
4199const I=.8+hn(Math.floor(D.x),Math.floor(D.z),47)*.32;C.compose(A.set(D.x,0,D.z),x,S.set(O*I,O,O*I)),R.setMatrixAt(F,C);const B=.78+hn(Math.floor(D.x),Math.floor(D.z),157)*.2;R.setColorAt(F,new ze().setRGB(B*.94,B,B*.9))}),R.instanceMatrix.needsUpdate=!0,R.instanceColor&&(R.instanceColor.needsUpdate=!0),R.computeBoundingSphere()},f=h.filter(p=>Math.hypot(p.x-e.x,p.z-e.z)<80),g=h.filter(p=>Math.hypot(p.x-e.x,p.z-e.z)>=80);if(d(n.fir,!1,f,!0),d(n.firFar??n.fir,!1,g,!1),n.shrub){const p=f.flatMap(_=>{const y=hn(Math.floor(_.x),Math.floor(_.z),211)*Math.PI*2,v=_.x+Math.cos(y)*6,T=_.z+Math.sin(y)*6,E=.4+hn(Math.floor(v),Math.floor(T),307)*.7;return t.overlapsDisk(v,T,this.footprintRadius(n.shrub)*E*1.12+1.75)?[]:[{x:v,z:T,height:E,rotation:y}]});d(n.shrub,!0,p,!1)}}disposeGroup(e){e.traverse(t=>{t instanceof sa&&t.dispose()}),$i(e)}dispose(){this.disposeGroup(this.root),this.root.clear(),this.batches.clear()}}const Ri={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:`
4200
4201		varying vec2 vUv;
4202
4203		void main() {
4204
4205			vUv = uv;
4206			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4207
4208		}`,fragmentShader:`
4209
4210		uniform float opacity;
4211
4212		uniform sampler2D tDiffuse;
4213
4214		varying vec2 vUv;
4215
4216		void main() {
4217
4218			vec4 texel = texture2D( tDiffuse, vUv );
4219			gl_FragColor = opacity * texel;
4220
4221
4222		}`};class vi{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const U_=new ir(-1,1,1,-1,0,1);class O_ extends xt{constructor(){super(),this.setAttribute("position",new rt([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new rt([0,2,0,0,2,0],2))}}const B_=new O_;class sr{constructor(e){this._mesh=new Ke(B_,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,U_)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class k_ extends vi{constructor(e,t="tDiffuse"){super(),this.textureID=t,this.uniforms=null,this.material=null,e instanceof Tt?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=sn.clone(e.uniforms),this.material=new Tt({name:e.name!==void 0?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this._fsQuad=new sr(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this._fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this._fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this._fsQuad.render(e))}dispose(){this.material.dispose(),this._fsQuad.dispose()}}class Yh extends vi{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const i=e.getContext(),r=e.state;r.buffers.color.setMask(!1),r.buffers.depth.setMask(!1),r.buffers.color.setLocked(!0),r.buffers.depth.setLocked(!0);let a,o;this.inverse?(a=0,o=1):(a=1,o=0),r.buffers.stencil.setTest(!0),r.buffers.stencil.setOp(i.REPLACE,i.REPLACE,i.REPLACE),r.buffers.stencil.setFunc(i.ALWAYS,a,4294967295),r.buffers.stencil.setClear(o),r.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),r.buffers.color.setLocked(!1),r.buffers.depth.setLocked(!1),r.buffers.color.setMask(!0),r.buffers.depth.setMask(!0),r.buffers.stencil.setLocked(!1),r.buffers.stencil.setFunc(i.EQUAL,1,4294967295),r.buffers.stencil.setOp(i.KEEP,i.KEEP,i.KEEP),r.buffers.stencil.setLocked(!0)}}class z_ extends vi{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class G_{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),t===void 0){const n=e.getSize(new te);this._width=n.width,this._height=n.height,t=new zt(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:Ct}),t.texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new k_(Ri),this.copyPass.material.blending=Xt,this.timer=new om}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);t!==-1&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}
vendor: 4,416 bytes, lines 4222-4267
4222render(e){this.timer.update(),e===void 0&&(e=this.timer.getDelta());const t=this.renderer.getRenderTarget();let n=!1;for(let i=0,r=this.passes.length;i<r;i++){const a=this.passes[i];if(a.enabled!==!1){if(a.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(i),a.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),a.needsSwap){if(n){const o=this.renderer.getContext(),c=this.renderer.state.buffers.stencil;c.setFunc(o.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),c.setFunc(o.EQUAL,1,4294967295)}this.swapBuffers()}Yh!==void 0&&(a instanceof Yh?n=!0:a instanceof z_&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(e===void 0){const t=this.renderer.getSize(new te);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,e=this.renderTarget1.clone(),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(n,i),this.renderTarget2.setSize(n,i);for(let r=0;r<this.passes.length;r++)this.passes[r].setSize(n,i)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}class V_ extends vi{constructor(e,t,n=null,i=null,r=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=i,this.clearAlpha=r,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this.isRenderPass=!0,this._oldClearColor=new ze}render(e,t,n){const i=e.autoClear;e.autoClear=!1;let r,a;this.overrideMaterial!==null&&(a=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor!==null&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor,e.getClearAlpha())),this.clearAlpha!==null&&(r=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),this.clearDepth==!0&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),this.clear===!0&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor!==null&&e.setClearColor(this._oldClearColor),this.clearAlpha!==null&&e.setClearAlpha(r),this.overrideMaterial!==null&&(this.scene.overrideMaterial=a),e.autoClear=i}}const Br={defines:{PERSPECTIVE_CAMERA:1,SAMPLES:16,NORMAL_VECTOR_TYPE:1,DEPTH_SWIZZLING:"x",SCREEN_SPACE_RADIUS:0,SCREEN_SPACE_RADIUS_SCALE:100,SCENE_CLIP_BOX:0},uniforms:{tNormal:{value:null},tDepth:{value:null},tNoise:{value:null},resolution:{value:new te},cameraNear:{value:null},cameraFar:{value:null},cameraProjectionMatrix:{value:new Ye},cameraProjectionMatrixInverse:{value:new Ye},cameraWorldMatrix:{value:new Ye},radius:{value:.25},distanceExponent:{value:1},thickness:{value:1},distanceFallOff:{value:1},scale:{value:1},sceneBoxMin:{value:new L(-1,-1,-1)},sceneBoxMax:{value:new L(1,1,1)}},vertexShader:`
4223
4224		varying vec2 vUv;
4225
4226		void main() {
4227			vUv = uv;
4228			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4229		}`,fragmentShader:`
4230		varying vec2 vUv;
4231		uniform highp sampler2D tNormal;
4232		uniform highp sampler2D tDepth;
4233		uniform sampler2D tNoise;
4234		uniform vec2 resolution;
4235		uniform float cameraNear;
4236		uniform float cameraFar;
4237		uniform mat4 cameraProjectionMatrix;
4238		uniform mat4 cameraProjectionMatrixInverse;
4239		uniform mat4 cameraWorldMatrix;
4240		uniform float radius;
4241		uniform float distanceExponent;
4242		uniform float thickness;
4243		uniform float distanceFallOff;
4244		uniform float scale;
4245		#if SCENE_CLIP_BOX == 1
4246			uniform vec3 sceneBoxMin;
4247			uniform vec3 sceneBoxMax;
4248		#endif
4249
4250		#include <common>
4251		#include <packing>
4252
4253		#ifndef FRAGMENT_OUTPUT
4254		#define FRAGMENT_OUTPUT vec4(vec3(ao), 1.)
4255		#endif
4256
4257		vec3 getViewPosition( const in vec2 screenPosition, const in float depth ) {
4258			#ifdef USE_REVERSED_DEPTH_BUFFER
4259				vec4 clipSpacePosition = vec4( vec2( screenPosition ) * 2.0 - 1.0, depth, 1.0 );
4260			#else
4261				vec4 clipSpacePosition = vec4( vec3( screenPosition, depth ) * 2.0 - 1.0, 1.0 );
4262			#endif
4263			vec4 viewSpacePosition = cameraProjectionMatrixInverse * clipSpacePosition;
4264			return viewSpacePosition.xyz / viewSpacePosition.w;
4265		}
4266
4267		float getDepth(const vec2 uv) {
4268			return textureLod(tDepth, uv.xy, 0.0).DEPTH_SWIZZLING;
4269		}
4270
4271		float fetchDepth(const ivec2 uv) {
4272			return texelFetch(tDepth, uv.xy, 0).DEPTH_SWIZZLING;
4273		}
4274
4275		float getViewZ(const in float depth) {
4276			#if PERSPECTIVE_CAMERA == 1
4277				return perspectiveDepthToViewZ(depth, cameraNear, cameraFar);
4278			#else
4279				return orthographicDepthToViewZ(depth, cameraNear, cameraFar);
4280			#endif
4281		}
4282
4283		vec3 computeNormalFromDepth(const vec2 uv) {
4284			vec2 size = vec2(textureSize(tDepth, 0));
4285			ivec2 p = ivec2(uv * size);
4286			float c0 = fetchDepth(p);
4287			float l2 = fetchDepth(p - ivec2(2, 0));
4288			float l1 = fetchDepth(p - ivec2(1, 0));
4289			float r1 = fetchDepth(p + ivec2(1, 0));
4290			float r2 = fetchDepth(p + ivec2(2, 0));
4291			float b2 = fetchDepth(p - ivec2(0, 2));
4292			float b1 = fetchDepth(p - ivec2(0, 1));
4293			float t1 = fetchDepth(p + ivec2(0, 1));
4294			float t2 = fetchDepth(p + ivec2(0, 2));
4295			float dl = abs((2.0 * l1 - l2) - c0);
4296			float dr = abs((2.0 * r1 - r2) - c0);
4297			float db = abs((2.0 * b1 - b2) - c0);
4298			float dt = abs((2.0 * t1 - t2) - c0);
4299			vec3 ce = getViewPosition(uv, c0).xyz;
4300			vec3 dpdx = (dl < dr) ? ce - getViewPosition((uv - vec2(1.0 / size.x, 0.0)), l1).xyz : -ce + getViewPosition((uv + vec2(1.0 / size.x, 0.0)), r1).xyz;
4301			vec3 dpdy = (db < dt) ? ce - getViewPosition((uv - vec2(0.0, 1.0 / size.y)), b1).xyz : -ce + getViewPosition((uv + vec2(0.0, 1.0 / size.y)), t1).xyz;
4302			return normalize(cross(dpdx, dpdy));
4303		}
4304
4305		vec3 getViewNormal(const vec2 uv) {
4306			#if NORMAL_VECTOR_TYPE == 2
4307				return normalize(textureLod(tNormal, uv, 0.).rgb);
4308			#elif NORMAL_VECTOR_TYPE == 1
4309				return unpackRGBToNormal(textureLod(tNormal, uv, 0.).rgb);
4310			#else
4311				return computeNormalFromDepth(uv);
4312			#endif
4313		}
4314
4315		vec3 getSceneUvAndDepth(vec3 sampleViewPos) {
4316			vec4 sampleClipPos = cameraProjectionMatrix * vec4(sampleViewPos, 1.);
4317			vec2 sampleUv = sampleClipPos.xy / sampleClipPos.w * 0.5 + 0.5;
4318			float sampleSceneDepth = getDepth(sampleUv);
4319			return vec3(sampleUv, sampleSceneDepth);
4320		}
4321
4322		void main() {
4323			float depth = getDepth(vUv.xy);
4324
4325			#ifdef USE_REVERSED_DEPTH_BUFFER
4326				if (depth <= 0.0) {
4327					discard;
4328					return;
4329				}
4330			#else
4331				if (depth >= 1.0) {
4332					discard;
4333					return;
4334				}
4335			#endif
4336			
4337			vec3 viewPos = getViewPosition(vUv, depth);
4338			vec3 viewNormal = getViewNormal(vUv);
4339
4340			float radiusToUse = radius;
4341			float distanceFalloffToUse = thickness;
4342			#if SCREEN_SPACE_RADIUS == 1
4343				float radiusScale = getViewPosition(vec2(0.5 + float(SCREEN_SPACE_RADIUS_SCALE) / resolution.x, 0.0), depth).x;
4344				radiusToUse *= radiusScale;
4345				distanceFalloffToUse *= radiusScale;
4346			#endif
4347
4348			#if SCENE_CLIP_BOX == 1
4349				vec3 worldPos = (cameraWorldMatrix * vec4(viewPos, 1.0)).xyz;
4350				float boxDistance = length(max(vec3(0.0), max(sceneBoxMin - worldPos, worldPos - sceneBoxMax)));
4351				if (boxDistance > radiusToUse) {
4352					discard;
4353					return;
4354				}
4355			#endif
4356
4357			vec2 noiseResolution = vec2(textureSize(tNoise, 0));
4358			vec2 noiseUv = vUv * resolution / noiseResolution;
4359			vec4 noiseTexel = textureLod(tNoise, noiseUv, 0.0);
4360			vec3 randomVec = noiseTexel.xyz * 2.0 - 1.0;
4361			vec3 tangent = normalize(vec3(randomVec.xy, 0.));
4362			vec3 bitangent = vec3(-tangent.y, tangent.x, 0.);
4363			mat3 kernelMatrix = mat3(tangent, bitangent, vec3(0., 0., 1.));
4364
4365			const int DIRECTIONS = SAMPLES < 30 ? 3 : 5;
4366			const int STEPS = (SAMPLES + DIRECTIONS - 1) / DIRECTIONS;
4367			float ao = 0.0;
4368			for (int i = 0; i < DIRECTIONS; ++i) {
4369
4370				float angle = float(i) / float(DIRECTIONS) * PI;
4371				vec4 sampleDir = vec4(cos(angle), sin(angle), 0., 0.5 + 0.5 * noiseTexel.w);
4372				sampleDir.xyz = normalize(kernelMatrix * sampleDir.xyz);
4373
4374				vec3 viewDir = normalize(-viewPos.xyz);
4375				vec3 sliceBitangent = normalize(cross(sampleDir.xyz, viewDir));
4376				vec3 sliceTangent = cross(sliceBitangent, viewDir);
4377				vec3 normalInSlice = normalize(viewNormal - sliceBitangent * dot(viewNormal, sliceBitangent));
4378
4379				vec3 tangentToNormalInSlice = cross(normalInSlice, sliceBitangent);
4380				vec2 cosHorizons = vec2(dot(viewDir, tangentToNormalInSlice), dot(viewDir, -tangentToNormalInSlice));
4381
4382				for (int j = 0; j < STEPS; ++j) {
4383					vec3 sampleViewOffset = sampleDir.xyz * radiusToUse * sampleDir.w * pow(float(j + 1) / float(STEPS), distanceExponent);
4384
4385					vec3 sampleSceneUvDepth = getSceneUvAndDepth(viewPos + sampleViewOffset);
4386					vec3 sampleSceneViewPos = getViewPosition(sampleSceneUvDepth.xy, sampleSceneUvDepth.z);
4387					vec3 viewDelta = sampleSceneViewPos - viewPos;
4388					if (abs(viewDelta.z) < thickness) {
4389						float sampleCosHorizon = dot(viewDir, normalize(viewDelta));
4390						cosHorizons.x += max(0., (sampleCosHorizon - cosHorizons.x) * mix(1., 2. / float(j + 2), distanceFallOff));
4391					}
4392
4393					sampleSceneUvDepth = getSceneUvAndDepth(viewPos - sampleViewOffset);
4394					sampleSceneViewPos = getViewPosition(sampleSceneUvDepth.xy, sampleSceneUvDepth.z);
4395					viewDelta = sampleSceneViewPos - viewPos;
4396					if (abs(viewDelta.z) < thickness) {
4397						float sampleCosHorizon = dot(viewDir, normalize(viewDelta));
4398						cosHorizons.y += max(0., (sampleCosHorizon - cosHorizons.y) * mix(1., 2. / float(j + 2), distanceFallOff));
4399					}
4400				}
4401
4402				vec2 sinHorizons = sqrt(1. - cosHorizons * cosHorizons);
4403				float nx = dot(normalInSlice, sliceTangent);
4404				float ny = dot(normalInSlice, viewDir);
4405				float nxb = 1. / 2. * (acos(cosHorizons.y) - acos(cosHorizons.x) + sinHorizons.x * cosHorizons.x - sinHorizons.y * cosHorizons.y);
4406				float nyb = 1. / 2. * (2. - cosHorizons.x * cosHorizons.x - cosHorizons.y * cosHorizons.y);
4407				float occlusion = nx * nxb + ny * nyb;
4408				ao += occlusion;
4409			}
4410
4411			ao = clamp(ao / float(DIRECTIONS), 0., 1.);
4412		#if SCENE_CLIP_BOX == 1
4413			ao = mix(ao, 1., smoothstep(0., radiusToUse, boxDistance));
4414		#endif
4415			ao = pow(ao, scale);
4416
4417			gl_FragColor = FRAGMENT_OUTPUT;
4418		}`},kr={defines:{PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},cameraNear:{value:null},cameraFar:{value:null}},vertexShader:`
4419		varying vec2 vUv;
4420
4421		void main() {
4422			vUv = uv;
4423			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4424		}`,fragmentShader:`
4425		uniform sampler2D tDepth;
4426		uniform float cameraNear;
4427		uniform float cameraFar;
4428		varying vec2 vUv;
4429
4430		#include <packing>
4431
4432		float getLinearDepth( const in vec2 screenPosition ) {
4433			#if PERSPECTIVE_CAMERA == 1
4434				float fragCoordZ = texture2D( tDepth, screenPosition ).x;
4435				float viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );
4436				return viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );
4437			#else
4438				return texture2D( tDepth, screenPosition ).x;
4439			#endif
4440		}
4441
4442		void main() {
4443			float depth = getLinearDepth( vUv );
4444			gl_FragColor = vec4( vec3( 1.0 - depth ), 1.0 );
4445
4446		}`},uo={uniforms:{tDiffuse:{value:null},intensity:{value:1}},vertexShader:`
4447		varying vec2 vUv;
4448
4449		void main() {
4450			vUv = uv;
4451			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4452		}`,fragmentShader:`
4453		uniform float intensity;
4454		uniform sampler2D tDiffuse;
4455		varying vec2 vUv;
4456
4457		void main() {
4458			vec4 texel = texture2D( tDiffuse, vUv );
4459			gl_FragColor = vec4(mix(vec3(1.), texel.rgb, intensity), texel.a);
4460		}`};function H_(s=5){const e=Math.floor(s)%2===0?Math.floor(s)+1:Math.floor(s),t=W_(e),n=t.length,i=new Uint8Array(n*4);for(let a=0;a<n;++a){const o=t[a],c=2*Math.PI*o/n,l=new L(Math.cos(c),Math.sin(c),0).normalize();i[a*4]=(l.x*.5+.5)*255,i[a*4+1]=(l.y*.5+.5)*255,i[a*4+2]=127,i[a*4+3]=255}const r=new bi(i,e,e);return r.wrapS=_n,r.wrapT=_n,r.needsUpdate=!0,r}function W_(s){const e=Math.floor(s)%2===0?Math.floor(s)+1:Math.floor(s),t=e*e,n=Array(t).fill(0);let i=Math.floor(e/2),r=e-1;for(let a=1;a<=t;){if(i===-1&&r===e?(r=e-2,i=0):(r===e&&(r=0),i<0&&(i=e-1)),n[i*e+r]!==0){r-=2,i++;continue}else n[i*e+r]=a++;r++,i--}return n}const zr={defines:{SAMPLES:16,SAMPLE_VECTORS:Ju(16,2,1),NORMAL_VECTOR_TYPE:1,DEPTH_VALUE_SOURCE:0},uniforms:{tDiffuse:{value:null},tNormal:{value:null},tDepth:{value:null},tNoise:{value:null},resolution:{value:new te},cameraProjectionMatrixInverse:{value:new Ye},lumaPhi:{value:5},depthPhi:{value:5},normalPhi:{value:5},radius:{value:4},index:{value:0}},vertexShader:`
4461
4462		varying vec2 vUv;
4463
4464		void main() {
4465			vUv = uv;
4466			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4467		}`,fragmentShader:`
4468
4469		varying vec2 vUv;
4470
4471		uniform sampler2D tDiffuse;
4472		uniform sampler2D tNormal;
4473		uniform sampler2D tDepth;
4474		uniform sampler2D tNoise;
4475		uniform vec2 resolution;
4476		uniform mat4 cameraProjectionMatrixInverse;
4477		uniform float lumaPhi;
4478		uniform float depthPhi;
4479		uniform float normalPhi;
4480		uniform float radius;
4481		uniform int index;
4482
4483		#include <common>
4484		#include <packing>
4485
4486		#ifndef SAMPLE_LUMINANCE
4487		#define SAMPLE_LUMINANCE dot(vec3(0.2125, 0.7154, 0.0721), a)
4488		#endif
4489
4490		#ifndef FRAGMENT_OUTPUT
4491		#define FRAGMENT_OUTPUT vec4(denoised, 1.)
4492		#endif
4493
4494		float getLuminance(const in vec3 a) {
4495			return SAMPLE_LUMINANCE;
4496		}
4497
4498		const vec3 poissonDisk[SAMPLES] = SAMPLE_VECTORS;
4499
4500		vec3 getViewPosition( const in vec2 screenPosition, const in float depth ) {
4501			#ifdef USE_REVERSED_DEPTH_BUFFER
4502				vec4 clipSpacePosition = vec4( vec2( screenPosition ) * 2.0 - 1.0, depth, 1.0 );
4503			#else
4504				vec4 clipSpacePosition = vec4( vec3( screenPosition, depth ) * 2.0 - 1.0, 1.0 );
4505			#endif
4506			vec4 viewSpacePosition = cameraProjectionMatrixInverse * clipSpacePosition;
4507			return viewSpacePosition.xyz / viewSpacePosition.w;
4508		}
4509
4510		float getDepth(const vec2 uv) {
4511		#if DEPTH_VALUE_SOURCE == 1
4512			return textureLod(tDepth, uv.xy, 0.0).a;
4513		#else
4514			return textureLod(tDepth, uv.xy, 0.0).r;
4515		#endif
4516		}
4517
4518		float fetchDepth(const ivec2 uv) {
4519			#if DEPTH_VALUE_SOURCE == 1
4520				return texelFetch(tDepth, uv.xy, 0).a;
4521			#else
4522				return texelFetch(tDepth, uv.xy, 0).r;
4523			#endif
4524		}
4525
4526		vec3 computeNormalFromDepth(const vec2 uv) {
4527			vec2 size = vec2(textureSize(tDepth, 0));
4528			ivec2 p = ivec2(uv * size);
4529			float c0 = fetchDepth(p);
4530			float l2 = fetchDepth(p - ivec2(2, 0));
4531			float l1 = fetchDepth(p - ivec2(1, 0));
4532			float r1 = fetchDepth(p + ivec2(1, 0));
4533			float r2 = fetchDepth(p + ivec2(2, 0));
4534			float b2 = fetchDepth(p - ivec2(0, 2));
4535			float b1 = fetchDepth(p - ivec2(0, 1));
4536			float t1 = fetchDepth(p + ivec2(0, 1));
4537			float t2 = fetchDepth(p + ivec2(0, 2));
4538			float dl = abs((2.0 * l1 - l2) - c0);
4539			float dr = abs((2.0 * r1 - r2) - c0);
4540			float db = abs((2.0 * b1 - b2) - c0);
4541			float dt = abs((2.0 * t1 - t2) - c0);
4542			vec3 ce = getViewPosition(uv, c0).xyz;
4543			vec3 dpdx = (dl < dr) ?  ce - getViewPosition((uv - vec2(1.0 / size.x, 0.0)), l1).xyz
4544									: -ce + getViewPosition((uv + vec2(1.0 / size.x, 0.0)), r1).xyz;
4545			vec3 dpdy = (db < dt) ?  ce - getViewPosition((uv - vec2(0.0, 1.0 / size.y)), b1).xyz
4546									: -ce + getViewPosition((uv + vec2(0.0, 1.0 / size.y)), t1).xyz;
4547			return normalize(cross(dpdx, dpdy));
4548		}
4549
4550		vec3 getViewNormal(const vec2 uv) {
4551		#if NORMAL_VECTOR_TYPE == 2
4552			return normalize(textureLod(tNormal, uv, 0.).rgb);
4553		#elif NORMAL_VECTOR_TYPE == 1
4554			return unpackRGBToNormal(textureLod(tNormal, uv, 0.).rgb);
4555		#else
4556			return computeNormalFromDepth(uv);
4557		#endif
4558		}
4559
4560		void denoiseSample(in vec3 center, in vec3 viewNormal, in vec3 viewPos, in vec2 sampleUv, inout vec3 denoised, inout float totalWeight) {
4561			vec4 sampleTexel = textureLod(tDiffuse, sampleUv, 0.0);
4562			float sampleDepth = getDepth(sampleUv);
4563			vec3 sampleNormal = getViewNormal(sampleUv);
4564			vec3 neighborColor = sampleTexel.rgb;
4565			vec3 viewPosSample = getViewPosition(sampleUv, sampleDepth);
4566
4567			float normalDiff = dot(viewNormal, sampleNormal);
4568			float normalSimilarity = pow(max(normalDiff, 0.), normalPhi);
4569			float lumaDiff = abs(getLuminance(neighborColor) - getLuminance(center));
4570			float lumaSimilarity = max(1.0 - lumaDiff / lumaPhi, 0.0);
4571			float depthDiff = abs(dot(viewPos - viewPosSample, viewNormal));
4572			float depthSimilarity = max(1. - depthDiff / depthPhi, 0.);
4573			float w = lumaSimilarity * depthSimilarity * normalSimilarity;
4574
4575			denoised += w * neighborColor;
4576			totalWeight += w;
4577		}
4578
4579		void main() {
4580			float depth = getDepth(vUv.xy);
4581			vec3 viewNormal = getViewNormal(vUv);
4582			if (depth == 1. || dot(viewNormal, viewNormal) == 0.) {
4583				discard;
4584				return;
4585			}
4586			vec4 texel = textureLod(tDiffuse, vUv, 0.0);
4587			vec3 center = texel.rgb;
4588			vec3 viewPos = getViewPosition(vUv, depth);
4589
4590			vec2 noiseResolution = vec2(textureSize(tNoise, 0));
4591			vec2 noiseUv = vUv * resolution / noiseResolution;
4592			vec4 noiseTexel = textureLod(tNoise, noiseUv, 0.0);
4593      		vec2 noiseVec = vec2(sin(noiseTexel[index % 4] * 2. * PI), cos(noiseTexel[index % 4] * 2. * PI));
4594    		mat2 rotationMatrix = mat2(noiseVec.x, -noiseVec.y, noiseVec.x, noiseVec.y);
4595
4596			float totalWeight = 1.0;
4597			vec3 denoised = texel.rgb;
4598			for (int i = 0; i < SAMPLES; i++) {
4599				vec3 sampleDir = poissonDisk[i];
4600				vec2 offset = rotationMatrix * (sampleDir.xy * (1. + sampleDir.z * (radius - 1.)) / resolution);
4601				vec2 sampleUv = vUv + offset;
4602				denoiseSample(center, viewNormal, viewPos, sampleUv, denoised, totalWeight);
4603			}
4604
4605			if (totalWeight > 0.) {
4606				denoised /= totalWeight;
4607			}
4608			gl_FragColor = FRAGMENT_OUTPUT;
4609		}`};function Ju(s,e,t){const n=X_(s,e,t);let i="vec3[SAMPLES](";for(let r=0;r<s;r++){const a=n[r];i+=`vec3(${a.x}, ${a.y}, ${a.z})${r<s-1?",":")"}`}return i}function X_(s,e,t){const n=[];for(let i=0;i<s;i++){const r=2*Math.PI*e*i/s,a=Math.pow(i/(s-1),t);n.push(new L(Math.cos(r),Math.sin(r),a))}return n}class q_{constructor(e=Math){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1
4609],[0,-1,-1]],this.grad4=[[0,1,1,1],[0,1,1,-1],[0,1,-1,1],[0,1,-1,-1],[0,-1,1,1],[0,-1,1,-1],[0,-1,-1,1],[0,-1,-1,-1],[1,0,1,1],[1,0,1,-1],[1,0,-1,1],[1,0,-1,-1],[-1,0,1,1],[-1,0,1,-1],[-1,0,-1,1],[-1,0,-1,-1],[1,1,0,1],[1,1,0,-1],[1,-1,0,1],[1,-1,0,-1],[-1,1,0,1],[-1,1,0,-1],[-1,-1,0,1],[-1,-1,0,-1],[1,1,1,0],[1,1,-1,0],[1,-1,1,0],[1,-1,-1,0],[-1,1,1,0],[-1,1,-1,0],[-1,-1,1,0],[-1,-1,-1,0]],this.p=[];for(let t=0;t<256;t++)this.p[t]=Math.floor(e.random()*256);this.perm=[];for(let t=0;t<512;t++)this.perm[t]=this.p[t&255];this.simplex=[[0,1,2,3],[0,1,3,2],[0,0,0,0],[0,2,3,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,3,0],[0,2,1,3],[0,0,0,0],[0,3,1,2],[0,3,2,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,3,2,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,0,3],[0,0,0,0],[1,3,0,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,3,0,1],[2,3,1,0],[1,0,2,3],[1,0,3,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,3,1],[0,0,0,0],[2,1,3,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,1,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,0,1,2],[3,0,2,1],[0,0,0,0],[3,1,2,0],[2,1,0,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,1,0,2],[0,0,0,0],[3,2,0,1],[3,2,1,0]]}noise(e,t){let n,i,r;const a=.5*(Math.sqrt(3)-1),o=(e+t)*a,c=Math.floor(e+o),l=Math.floor(t+o),h=(3-Math.sqrt(3))/6,u=(c+l)*h,d=c-u,f=l-u,g=e-d,b=t-f;let m,p;g>b?(m=1,p=0):(m=0,p=1);const _=g-m+h,y=b-p+h,v=g-1+2*h,T=b-1+2*h,E=c&255,C=l&255,x=this.perm[E+this.perm[C]]%12,S=this.perm[E+m+this.perm[C+p]]%12,A=this.perm[E+1+this.perm[C+1]]%12;let R=.5-g*g-b*b;R<0?n=0:(R*=R,n=R*R*this._dot(this.grad3[x],g,b));let D=.5-_*_-y*y;D<0?i=0:(D*=D,i=D*D*this._dot(this.grad3[S],_,y));let F=.5-v*v-T*T;return F<0?r=0:(F*=F,r=F*F*this._dot(this.grad3[A],v,T)),70*(n+i+r)}noise3d(e,t,n){let i,r,a,o;const l=(e+t+n)*.3333333333333333,h=Math.floor(e+l),u=Math.floor(t+l),d=Math.floor(n+l),f=1/6,g=(h+u+d)*f,b=h-g,m=u-g,p=d-g,_=e-b,y=t-m,v=n-p;let T,E,C,x,S,A;_>=y?y>=v?(T=1,E=0,C=0,x=1,S=1,A=0):_>=v?(T=1,E=0,C=0,x=1,S=0,A=1):(T=0,E=0,C=1,x=1,S=0,A=1):y<v?(T=0,E=0,C=1,x=0,S=1,A=1):_<v?(T=0,E=1,C=0,x=0,S=1,A=1):(T=0,E=1,C=0,x=1,S=1,A=0);const R=_-T+f,D=y-E+f,F=v-C+f,O=_-x+2*f,I=y-S+2*f,B=v-A+2*f,G=_-1+3*f,j=y-1+3*f,Y=v-1+3*f,ne=h&255,oe=u&255,ce=d&255,Ee=this.perm[ne+this.perm[oe+this.perm[ce]]]%12,je=this.perm[ne+T+this.perm[oe+E+this.perm[ce+C]]]%12,Ve=this.perm[ne+x+this.perm[oe+S+this.perm[ce+A]]]%12,k=this.perm[ne+1+this.perm[oe+1+this.perm[ce+1]]]%12;let ee=.6-_*_-y*y-v*v;ee<0?i=0:(ee*=ee,i=ee*ee*this._dot3(this.grad3[Ee],_,y,v));let Q=.6-R*R-D*D-F*F;Q<0?r=0:(Q*=Q,r=Q*Q*this._dot3(this.grad3[je],R,D,F));let Se=.6-O*O-I*I-B*B;Se<0?a=0:(Se*=Se,a=Se*Se*this._dot3(this.grad3[Ve],O,I,B));let Le=.6-G*G-j*j-Y*Y;return Le<0?o=0:(Le*=Le,o=Le*Le*this._dot3(this.grad3[k],G,j,Y)),32*(i+r+a+o)}noise4d(e,t,n,i){const r=this.grad4,a=this.simplex,o=this.perm,c=(Math.sqrt(5)-1)/4,l=(5-Math.sqrt(5))/20;let h,u,d,f,g;const b=(e+t+n+i)*c,m=Math.floor(e+b),p=Math.floor(t+b),_=Math.floor(n+b),y=Math.floor(i+b),v=(m+p+_+y)*l,T=m-v,E=p-v,C=_-v,x=y-v,S=e-T,A=t-E,R=n-C,D=i-x,F=S>A?32:0,O=S>R?16:0,I=A>R?8:0,B=S>D?4:0,G=A>D?2:0,j=R>D?1:0,Y=F+O+I+B+G+j,ne=a[Y][0]>=3?1:0,oe=a[Y][1]>=3?1:0,ce=a[Y][2]>=3?1:0,Ee=a[Y][3]>=3?1:0,je=a[Y][0]>=2?1:0,Ve=a[Y][1]>=2?1:0,k=a[Y][2]>=2?1:0,ee=a[Y][3]>=2?1:0,Q=a[Y][0]>=1?1:0,Se=a[Y][1]>=1?1:0,Le=a[Y][2]>=1?1:0,Ie=a[Y][3]>=1?1:0,st=S-ne+l,He=A-oe+l,ie=R-ce+l,ae=D-Ee+l,re=S-je+2*l,be=A-Ve+2*l,pe=R-k+2*l,ke=D-ee+2*l,Ae=S-Q+3*l,Ge=A-Se+3*l,Xe=R-Le+3*l,N=D-Ie+3*l,ot=S-1+4*l,$e=A-1+4*l,P=R-1+4*l,M=D-1+4*l,V=m&255,H=p&255,K=_&255,he=y&255,ue=o[V+o[H+o[K+o[he]]]]%32,J=o[V+ne+o[H+oe+o[K+ce+o[he+Ee]]]]%32,Z=o[V+je+o[H+Ve+o[K+k+o[he+ee]]]]%32,me=o[V+Q+o[H+Se+o[K+Le+o[he+Ie]]]]%32,Ne=o[V+1+o[H+1+o[K+1+o[he+1]]]]%32;let fe=.6-S*S-A*A-R*R-D*D;fe<0?h=0:(fe*=fe,h=fe*fe*this._dot4(r[ue],S,A,R,D));let de=.6-st*st-He*He-ie*ie-ae*ae;de<0?u=0:(de*=de,u=de*de*this._dot4(r[J],st,He,ie,ae));let Pe=.6-re*re-be*be-pe*pe-ke*ke;Pe<0?d=0:(Pe*=Pe,d=Pe*Pe*this._dot4(r[Z],re,be,pe,ke));let Oe=.6-Ae*Ae-Ge*Ge-Xe*Xe-N*N;Oe<0?f=0:(Oe*=Oe,f=Oe*Oe*this._dot4(r[me],Ae,Ge,Xe,N));let qe=.6-ot*ot-$e*$e-P*P-M*M;return qe<0?g=0:(qe*=qe,g=qe*qe*this._dot4(r[Ne],ot,$e,P,M)),27*(h+u+d+f+g)}_dot(e,t,n){return e[0]*t+e[1]*n}_dot3(e,t,n,i){return e[0]*t+e[1]*n+e[2]*i}_dot4(e,t,n,i,r){return e[0]*t+e[1]*n+e[2]*i+e[3]*r}}class On extends vi{constructor(e,t,n=512,i=512,r,a,o){super(),this.width=n,this.height=i,this.clear=!0,this.camera=t,this.scene=e,this.output=0,this._renderGBuffer=!0,this._visibilityCache=[],this.blendIntensity=1,this.pdRings=2,this.pdRadiusExponent=2,this.pdSamples=16,this.gtaoNoiseTexture=H_(),this.pdNoiseTexture=this._generateNoise(),this.gtaoRenderTarget=new zt(this.width,this.height,{type:Ct}),this.pdRenderTarget=this.gtaoRenderTarget.clone(),this.gtaoMaterial=new Tt({defines:Object.assign({},Br.defines),uniforms:sn.clone(Br.uniforms),vertexShader:Br.vertexShader,fragmentShader:Br.fragmentShader,blending:Xt,depthTest:!1,depthWrite:!1}),this.gtaoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.gtaoMaterial.uniforms.tNoise.value=this.gtaoNoiseTexture,this.gtaoMaterial.uniforms.resolution.value.set(this.width,this.height),this.gtaoMaterial.uniforms.cameraNear.value=this.camera.near,this.gtaoMaterial.uniforms.cameraFar.value=this.camera.far,this.normalMaterial=new Up,this.normalMaterial.blending=Xt,this.pd
4609Material=new Tt({defines:Object.assign({},zr.defines),uniforms:sn.clone(zr.uniforms),vertexShader:zr.vertexShader,fragmentShader:zr.fragmentShader,depthTest:!1,depthWrite:!1}),this.pdMaterial.uniforms.tDiffuse.value=this.gtaoRenderTarget.texture,this.pdMaterial.uniforms.tNoise.value=this.pdNoiseTexture,this.pdMaterial.uniforms.resolution.value.set(this.width,this.height),this.pdMaterial.uniforms.lumaPhi.value=10,this.pdMaterial.uniforms.depthPhi.value=2,this.pdMaterial.uniforms.normalPhi.value=3,this.pdMaterial.uniforms.radius.value=8,this.depthRenderMaterial=new Tt({defines:Object.assign({},kr.defines),uniforms:sn.clone(kr.uniforms),vertexShader:kr.vertexShader,fragmentShader:kr.fragmentShader,blending:Xt}),this.depthRenderMaterial.uniforms.cameraNear.value=this.camera.near,this.depthRenderMaterial.uniforms.cameraFar.value=this.camera.far,this.copyMaterial=new Tt({uniforms:sn.clone(Ri.uniforms),vertexShader:Ri.vertexShader,fragmentShader:Ri.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blendSrc:vo,blendDst:Ds,blendEquation:Tn,blendSrcAlpha:xo,blendDstAlpha:Ds,blendEquationAlpha:Tn}),this.blendMaterial=new Tt({uniforms:sn.clone(uo.uniforms),vertexShader:uo.vertexShader,fragmentShader:uo.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blending:$h,blendSrc:vo,blendDst:Ds,blendEquation:Tn,blendSrcAlpha:xo,blendDstAlpha:Ds,blendEquationAlpha:Tn}),this._fsQuad=new sr(null),this._originalClearColor=new ze,this.setGBuffer(r?r.depthTexture:void 0,r?r.normalTexture:void 0),a!==void 0&&this.updateGtaoMaterial(a),o!==void 0&&this.updatePdMaterial(o)}setSize(e,t){this.width=e,this.height=t,this.gtaoRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.pdRenderTarget.setSize(e,t),this.gtaoMaterial.uniforms.resolution.value.set(e,t),this.gtaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.gtaoMaterial.uniforms.cameraProjectionMatrixInverse.value.copy(this.camera.projectionMatrixInverse),this.pdMaterial.uniforms.resolution.value.set(e,t),this.pdMaterial.uniforms.cameraProjectionMatrixInverse.value.copy(this.camera.projectionMatrixInverse)}dispose(){this.gtaoNoiseTexture.dispose(),this.pdNoiseTexture.dispose(),this.normalRenderTarget.dispose(),this.gtaoRenderTarget.dispose(),this.pdRenderTarget.dispose(),this.normalMaterial.dispose(),this.pdMaterial.dispose(),this.copyMaterial.dispose(),this.depthRenderMaterial.dispose(),this._fsQuad.dispose()}get gtaoMap(){return this.pdRenderTarget.texture}setGBuffer(e,t){e!==void 0?(this.depthTexture=e,this.normalTexture=t,this._renderGBuffer=!1):(this.depthTexture=new Di,this.depthTexture.format=pi,this.depthTexture.type=os,this.normalRenderTarget=new zt(this.width,this.height,{minFilter:Rt,magFilter:Rt,type:Ct,depthTexture:this.depthTexture}),this.normalTexture=this.normalRenderTarget.texture,this._renderGBuffer=!0);const n=this.normalTexture?1:0,i=this.depthTexture===this.normalTexture?"w":"x";this.gtaoMaterial.defines.NORMAL_VECTOR_TYPE=n,this.gtaoMaterial.defines.DEPTH_SWIZZLING=i,this.gtaoMaterial.uniforms.tNormal.value=this.normalTexture,this.gtaoMaterial.uniforms.tDepth.value=this.depthTexture,this.pdMaterial.defines.NORMAL_VECTOR_TYPE=n,this.pdMaterial.defines.DEPTH_SWIZZLING=i,this.pdMaterial.uniforms.tNormal.value=this.normalTexture,this.pdMaterial.uniforms.tDepth.value=this.depthTexture,this.depthRenderMaterial.uniforms.tDepth.value=this.normalRenderTarget.depthTexture}setSceneClipBox(e){e?(this.gtaoMaterial.needsUpdate=this.gtaoMaterial.defines.SCENE_CLIP_BOX!==1,this.gtaoMaterial.defines.SCENE_CLIP_BOX=1,this.gtaoMaterial.uniforms.sceneBoxMin.value.copy(e.min),this.gtaoMaterial.uniforms.sceneBoxMax.value.copy(e.max)):(this.gtaoMaterial.needsUpdate=this.gtaoMaterial.defines.SCENE_CLIP_BOX===0,this.gtaoMaterial.defines.SCENE_CLIP_BOX=0)}updateGtaoMaterial(e){e.radius!==void 0&&(this.gtaoMaterial.uniforms.radius.value=e.radius),e.distanceExponent!==void 0&&(this.gtaoMaterial.uniforms.distanceExponent.value=e.distanceExponent),e.thickness!==void 0&&(this.gtaoMaterial.uniforms.thickness.value=e.thickness),e.distanceFallOff!==void 0&&(this.gtaoMaterial.uniforms.distanceFallOff.value=e.distanceFallOff,this.gtaoMaterial.needsUpdate=!0),e.scale!==void 0&&(this.gtaoMaterial.uniforms.scale.value=e.scale),e.samples!==void 0&&e.samples!==this.gtaoMaterial.defines.SAMPLES&&(this.gtaoMaterial.defines.SAMPLES=e.samples,this.gtaoMaterial.needsUpdate=!0),e.screenSpaceRadius!==void 0&&(e.screenSpaceRadius?1:0)!==this.gtaoMaterial.defines.SCREEN_SPACE_RADIUS&&(this.gtaoMaterial.defines.SCREEN_SPACE_RADIUS=e.screenSpaceRadius?1:0,this.gtaoMaterial.needsUpdate=!0)}updatePdMaterial(e){let t=!1;e.lumaPhi!==void 0&&(this.pdMaterial.uniforms.lumaPhi.value=e.lumaPhi),e.depthPhi!==void 0&&(this.pdMaterial.uniforms.depthPhi.value=e.depthPhi),e.normalPhi!==void 0&&(this.pdMaterial.uniforms.normalPhi.value=e.normalPhi),e.radius!==void 0&&e.radius!==this.radius&&(this.pdMaterial.uniforms.radius.value=e.radiu
4609s),e.radiusExponent!==void 0&&e.radiusExponent!==this.pdRadiusExponent&&(this.pdRadiusExponent=e.radiusExponent,t=!0),e.rings!==void 0&&e.rings!==this.pdRings&&(this.pdRings=e.rings,t=!0),e.samples!==void 0&&e.samples!==this.pdSamples&&(this.pdSamples=e.samples,t=!0),t&&(this.pdMaterial.defines.SAMPLES=this.pdSamples,this.pdMaterial.defines.SAMPLE_VECTORS=Ju(this.pdSamples,this.pdRings,this.pdRadiusExponent),this.pdMaterial.needsUpdate=!0)}render(e,t,n){switch(this._renderGBuffer&&(this._overrideVisibility(),this._renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this._restoreVisibility()),this.gtaoMaterial.uniforms.cameraNear.value=this.camera.near,this.gtaoMaterial.uniforms.cameraFar.value=this.camera.far,this.gtaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.gtaoMaterial.uniforms.cameraProjectionMatrixInverse.value.copy(this.camera.projectionMatrixInverse),this.gtaoMaterial.uniforms.cameraWorldMatrix.value.copy(this.camera.matrixWorld),this._renderPass(e,this.gtaoMaterial,this.gtaoRenderTarget,16777215,1),this.pdMaterial.uniforms.cameraProjectionMatrixInverse.value.copy(this.camera.projectionMatrixInverse),this._renderPass(e,this.pdMaterial,this.pdRenderTarget,16777215,1),this.output){case On.OUTPUT.Off:break;case On.OUTPUT.Diffuse:this.copyMaterial.uniforms.tDiffuse.value=n.texture,this.copyMaterial.blending=Xt,this._renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case On.OUTPUT.AO:this.copyMaterial.uniforms.tDiffuse.value=this.gtaoRenderTarget.texture,this.copyMaterial.blending=Xt,this._renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case On.OUTPUT.Denoise:this.copyMaterial.uniforms.tDiffuse.value=this.pdRenderTarget.texture,this.copyMaterial.blending=Xt,this._renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case On.OUTPUT.Depth:this.depthRenderMaterial.uniforms.cameraNear.value=this.camera.near,this.depthRenderMaterial.uniforms.cameraFar.value=this.camera.far,this._renderPass(e,this.depthRenderMaterial,this.renderToScreen?null:t);break;case On.OUTPUT.Normal:this.copyMaterial.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.copyMaterial.blending=Xt,this._renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case On.OUTPUT.Default:this.copyMaterial.uniforms.tDiffuse.value=n.texture,this.copyMaterial.blending=Xt,this._renderPass(e,this.copyMaterial,this.renderToScreen?null:t),this.blendMaterial.uniforms.intensity.value=this.blendIntensity,this.blendMaterial.uniforms.tDiffuse.value=this.pdRenderTarget.texture,this._renderPass(e,this.blendMaterial,this.renderToScreen?null:t);break;default:console.warn("THREE.GTAOPass: Unknown output type.")}}_renderPass(e,t,n,i,r){e.getClearColor(this._originalClearColor);const a=e.getClearAlpha(),o=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,i!=null&&(e.setClearColor(i),e.setClearAlpha(r||0),e.clear()),this._fsQuad.material=t,this._fsQuad.render(e),e.autoClear=o,e.setClearColor(this._originalClearColor),e.setClearAlpha(a)}_renderOverride(e,t,n,i,r){e.getClearColor(this._originalClearColor);const a=e.getClearAlpha(),o=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,i=t.clearColor||i,r=t.clearAlpha||r,i!=null&&(e.setClearColor(i),e.setClearAlpha(r||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=o,e.setClearColor(this._originalClearColor),e.setClearAlpha(a)}_overrideVisibility(){const e=this.scene,t=this._visibilityCache;e.traverse(function(n){(n.isPoints||n.isLine||n.isLine2)&&n.visible&&(n.visible=!1,t.push(n))})}_restoreVisibility(){const e=this._visibilityCache;for(let t=0;t<e.length;t++)e[t].visible=!0;e.length=0}_generateNoise(e=64){const t=new q_,n=e*e*4,i=new Uint8Array(n);for(let a=0;a<e;a++)for(let o=0;o<e;o++){const c=a,l=o;i[(a*e+o)*4]=(t.noise(c,l)*.5+.5)*255,i[(a*e+o)*4+1]=(t.noise(c+e,l)*.5+.5)*255,i[(a*e+o)*4+2]=(t.noise(c,l+e)*.5+.5)*255,i[(a*e+o)*4+3]=(t.noise(c+e,l+e)*.5+.5)*255}const r=new bi(i,e,e,un,Jt);return r.wrapS=_n,r.wrapT=_n,r.needsUpdate=!0,r}}On.OUTPUT={Off:-1,Default:0,Diffuse:1,Depth:2,Normal:3,AO:4,Denoise:5};const j_={uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new ze(0)},defaultOpacity:{value:0}},vertexShader:`
4610
4611		varying vec2 vUv;
4612
4613		void main() {
4614
4615			vUv = uv;
4616
4617			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4618
4619		}`,fragmentShader:`
4620
4621		uniform sampler2D tDiffuse;
4622		uniform vec3 defaultColor;
4623		uniform float defaultOpacity;
4624		uniform float luminosityThreshold;
4625		uniform float smoothWidth;
4626
4627		varying vec2 vUv;
4628
4629		void main() {
4630
4631			vec4 texel = texture2D( tDiffuse, vUv );
4632
4633			float v = luminance( texel.xyz );
4634
4635			vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );
4636
4637			float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );
4638
4639			gl_FragColor = mix( outputColor, texel, alpha );
4640
4641		}`};class ds extends vi{constructor(e,t=1,n,i){super(),this.strength=t,this.radius=n,this.threshold=i,this.resolution=e!==void 0?new te(e.x,e.y):new te(256,256),this.clearColor=new ze(0,0,0),this.needsSwap=!1,this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let r=Math.round(this.resolution.x/2),a=Math.round(this.resolution.y/2);this.renderTargetBright=new zt(r,a,{type:Ct}),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let h=0;h<this.nMips;h++){const u=new zt(r,a,{type:Ct});u.texture.name="UnrealBloomPass.h"+h,u.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(u);const d=new zt(r,a,{type:Ct});d.texture.name="UnrealBloomPass.v"+h,d.texture.generateMipmaps=!1,this.renderTargetsVertical.push(d),r=Math.round(r/2),a=Math.round(a/2)}const o=j_;this.highPassUniforms=sn.clone(o.uniforms),this.highPassUniforms.luminosityThreshold.value=i,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new Tt({uniforms:this.highPassUniforms,vertexShader:o.vertexShader,fragmentShader:o.fragmentShader}),this.separableBlurMaterials=[];const c=[6,10,14,18,22];r=Math.round(this.resolution.x/2),a=Math.round(this.resolution.y/2);for(let h=0;h<this.nMips;h++)this.separableBlurMaterials.push(this._getSeparableBlurMaterial(c[h])),this.separableBlurMaterials[h].uniforms.invSize.value=new te(1/r,1/a),r=Math.round(r/2),a=Math.round(a/2);this.compositeMaterial=this._getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=t,this.compositeMaterial.uniforms.bloomRadius.value=.1;const l=[1,.8,.6,.4,.2];this.compositeMaterial.uniforms.bloomFactors.value=l,this.bloomTintColors=[new L(1,1,1),new L(1,1,1),new L(1,1,1),new L(1,1,1),new L(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,this.copyUniforms=sn.clone(Ri.uniforms),this.blendMaterial=new Tt({uniforms:this.copyUniforms,vertexShader:Ri.vertexShader,fragmentShader:Ri.fragmentShader,premultipliedAlpha:!0,blending:mo,depthTest:!1,depthWrite:!1,transparent:!0}),this._oldClearColor=new ze,this._oldClearAlpha=1,this._basic=new zn,this._fsQuad=new sr(null)}dispose(){for(let e=0;e<this.renderTargetsHorizontal.length;e++)this.renderTargetsHorizontal[e].dispose();for(let e=0;e<this.renderTargetsVertical.length;e++)this.renderTargetsVertical[e].dispose();this.renderTargetBright.dispose();for(let e=0;e<this.separableBlurMaterials.length;e++)this.separableBlurMaterials[e].dispose();this.compositeMaterial.dispose(),this.blendMaterial.dispose(),this._basic.dispose(),this._fsQuad.dispose()}setSize(e,t){let n=Math.round(e/2),i=Math.round(t/2);this.renderTargetBright.setSize(n,i);for(let r=0;r<this.nMips;r++)this.renderTargetsHorizontal[r].setSize(n,i),this.renderTargetsVertical[r].setSize(n,i),this.separableBlurMaterials[r].uniforms.invSize.value=new te(1/n,1/i),n=Math.round(n/2),i=Math.round(i/2)}render(e,t,n,i,r){e.getClearColor(this._oldClearColor),this._oldClearAlpha=e.getClearAlpha();const a=e.autoClear;e.autoClear=!1,e.setClearColor(this.clearColor,0),r&&e.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this._fsQuad.material=this._basic,this._basic.map=n.texture,e.setRenderTarget(null),e.clear(),this._fsQuad.render(e)),this.highPassUniforms.tDiffuse.value=n.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this._fsQuad.material=this.materialHighPassFilter,e.setRenderTarget(this.renderTargetBright),e.clear(),this._fsQuad.render(e);let o=this.renderTargetBright;for(let c=0;c<this.nMips;c++)this._fsQuad.material=this.separableBlurMaterials[c],this.separableBlurMaterials[c].uniforms.colorTexture.value=o.texture,this.separableBlurMaterials[c].uniforms.direction.value=ds.BlurDirectionX,e.setRenderTarget(this.renderTargetsHorizontal[c]),e.clear(),this._fsQuad.render(e),this.separableBlurMaterials[c].uniforms.colorTexture.value=this.renderTargetsHorizontal[c].texture,this.separableBlurMaterials[c].uniforms.direction.value=ds.BlurDirectionY,e.setRenderTarget(this.renderTargetsVertical[c]),e.clear(),this._fsQuad.render(e),o=this.renderTargetsVertical[c];this._fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,e.setRenderTarget(this.renderTargetsHorizontal[0]),e.clear(),this._fsQuad.render(e),this._fsQuad.material=this.blendMaterial,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,r&&e.state.buffers.stencil.setTest(!0),this.renderToScreen?(e.setRenderTarget(null),this._fsQuad.render(e)):(e.setRenderTarget(n),this._fsQuad.render(e)),e.setClearColor(this._oldClearColor,this._oldClearAlpha),e.autoClear=a}_getSeparableBlurMaterial(e){const t=[],n=e/3;for(let i=0;i<e;i++)t.push(.39894*Math.exp(-.5*i*i/(n*n))/n);return new Tt({defines:{KERNEL_RADIUS:e},uniforms:{colorTexture:{value:null},invSize:{value:new te(.5,.5)},direction:{value:new te(.5,.5)},gaussianCoefficients:{value:t}},vertexShader:`
4642
4643				varying vec2 vUv;
4644
4645				void main() {
4646
4647					vUv = uv;
4648					gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4649
4650				}`,fragmentShader:`
4651
4652				#include <common>
4653
4654				varying vec2 vUv;
4655
4656				uniform sampler2D colorTexture;
4657				uniform vec2 invSize;
4658				uniform vec2 direction;
4659				uniform float gaussianCoefficients[KERNEL_RADIUS];
4660
4661				void main() {
4662
4663					float weightSum = gaussianCoefficients[0];
4664					vec3 diffuseSum = texture2D( colorTexture, vUv ).rgb * weightSum;
4665
4666					for ( int i = 1; i < KERNEL_RADIUS; i ++ ) {
4667
4668						float x = float( i );
4669						float w = gaussianCoefficients[i];
4670						vec2 uvOffset = direction * invSize * x;
4671						vec3 sample1 = texture2D( colorTexture, vUv + uvOffset ).rgb;
4672						vec3 sample2 = texture2D( colorTexture, vUv - uvOffset ).rgb;
4673						diffuseSum += ( sample1 + sample2 ) * w;
4674
4675					}
4676
4677					gl_FragColor = vec4( diffuseSum, 1.0 );
4678
4679				}`})}_getCompositeMaterial(e){return new Tt({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:`
4680
4681				varying vec2 vUv;
4682
4683				void main() {
4684
4685					vUv = uv;
4686					gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4687
4688				}`,fragmentShader:`
4689
4690				varying vec2 vUv;
4691
4692				uniform sampler2D blurTexture1;
4693				uniform sampler2D blurTexture2;
4694				uniform sampler2D blurTexture3;
4695				uniform sampler2D blurTexture4;
4696				uniform sampler2D blurTexture5;
4697				uniform float bloomStrength;
4698				uniform float bloomRadius;
4699				uniform float bloomFactors[NUM_MIPS];
4700				uniform vec3 bloomTintColors[NUM_MIPS];
4701
4702				float lerpBloomFactor( const in float factor ) {
4703
4704					float mirrorFactor = 1.2 - factor;
4705					return mix( factor, mirrorFactor, bloomRadius );
4706
4707				}
4708
4709				void main() {
4710
4711					// 3.0 for backwards compatibility with previous alpha-based intensity
4712					vec3 bloom = 3.0 * bloomStrength * (
4713						lerpBloomFactor( bloomFactors[ 0 ] ) * bloomTintColors[ 0 ] * texture2D( blurTexture1, vUv ).rgb +
4714						lerpBloomFactor( bloomFactors[ 1 ] ) * bloomTintColors[ 1 ] * texture2D( blurTexture2, vUv ).rgb +
4715						lerpBloomFactor( bloomFactors[ 2 ] ) * bloomTintColors[ 2 ] * texture2D( blurTexture3, vUv ).rgb +
4716						lerpBloomFactor( bloomFactors[ 3 ] ) * bloomTintColors[ 3 ] * texture2D( blurTexture4, vUv ).rgb +
4717						lerpBloomFactor( bloomFactors[ 4 ] ) * bloomTintColors[ 4 ] * texture2D( blurTexture5, vUv ).rgb
4718					);
4719
4720					float bloomAlpha = max( bloom.r, max( bloom.g, bloom.b ) );
4721					gl_FragColor = vec4( bloom, bloomAlpha );
4722
4723				}`})}}ds.BlurDirectionX=new te(1,0);ds.BlurDirectionY=new te(0,1);const Gr={defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new te(1/1024,1/512)}},vertexShader:`
4724
4725		uniform vec2 resolution;
4726
4727		varying vec2 vUv;
4728		varying vec4 vOffset[ 3 ];
4729
4730		void SMAAEdgeDetectionVS( vec2 texcoord ) {
4731			vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0,  1.0 ); // WebGL port note: Changed sign in W component
4732			vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4(  1.0, 0.0, 0.0, -1.0 ); // WebGL port note: Changed sign in W component
4733			vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0,  2.0 ); // WebGL port note: Changed sign in W component
4734		}
4735
4736		void main() {
4737
4738			vUv = uv;
4739
4740			SMAAEdgeDetectionVS( vUv );
4741
4742			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4743
4744		}`,fragmentShader:`
4745
4746		uniform sampler2D tDiffuse;
4747
4748		varying vec2 vUv;
4749		varying vec4 vOffset[ 3 ];
4750
4751		vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {
4752			vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );
4753
4754			// Calculate color deltas:
4755			vec4 delta;
4756			vec3 C = texture2D( colorTex, texcoord ).rgb;
4757
4758			vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;
4759			vec3 t = abs( C - Cleft );
4760			delta.x = max( max( t.r, t.g ), t.b );
4761
4762			vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;
4763			t = abs( C - Ctop );
4764			delta.y = max( max( t.r, t.g ), t.b );
4765
4766			// We do the usual threshold:
4767			vec2 edges = step( threshold, delta.xy );
4768
4769			// Then discard if there is no edge:
4770			if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )
4771				discard;
4772
4773			// Calculate right and bottom deltas:
4774			vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;
4775			t = abs( C - Cright );
4776			delta.z = max( max( t.r, t.g ), t.b );
4777
4778			vec3 Cbottom  = texture2D( colorTex, offset[1].zw ).rgb;
4779			t = abs( C - Cbottom );
4780			delta.w = max( max( t.r, t.g ), t.b );
4781
4782			// Calculate the maximum delta in the direct neighborhood:
4783			float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );
4784
4785			// Calculate left-left and top-top deltas:
4786			vec3 Cleftleft  = texture2D( colorTex, offset[2].xy ).rgb;
4787			t = abs( C - Cleftleft );
4788			delta.z = max( max( t.r, t.g ), t.b );
4789
4790			vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;
4791			t = abs( C - Ctoptop );
4792			delta.w = max( max( t.r, t.g ), t.b );
4793
4794			// Calculate the final maximum delta:
4795			maxDelta = max( max( maxDelta, delta.z ), delta.w );
4796
4797			// Local contrast adaptation in action:
4798			edges.xy *= step( 0.5 * maxDelta, delta.xy );
4799
4800			return vec4( edges, 0.0, 0.0 );
4801		}
4802
4803		void main() {
4804
4805			gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );
4806
4807		}`},Vr={defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new te(1/1024,1/512)}},vertexShader:`
4808
4809		uniform vec2 resolution;
4810
4811		varying vec2 vUv;
4812		varying vec4 vOffset[ 3 ];
4813		varying vec2 vPixcoord;
4814
4815		void SMAABlendingWeightCalculationVS( vec2 texcoord ) {
4816			vPixcoord = texcoord / resolution;
4817
4818			// We will use these offsets for the searches later on (see @PSEUDO_GATHER4):
4819			vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 ); // WebGL port note: Changed sign in Y and W components
4820			vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 ); // WebGL port note: Changed sign in Y and W components
4821
4822			// And these for the searches, they indicate the ends of the loops:
4823			vOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );
4824
4825		}
4826
4827		void main() {
4828
4829			vUv = uv;
4830
4831			SMAABlendingWeightCalculationVS( vUv );
4832
4833			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4834
4835		}`,fragmentShader:`
4836
4837		#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )
4838
4839		uniform sampler2D tDiffuse;
4840		uniform sampler2D tArea;
4841		uniform sampler2D tSearch;
4842		uniform vec2 resolution;
4843
4844		varying vec2 vUv;
4845		varying vec4 vOffset[3];
4846		varying vec2 vPixcoord;
4847
4848		#if __VERSION__ == 100
4849		vec2 round( vec2 x ) {
4850			return sign( x ) * floor( abs( x ) + 0.5 );
4851		}
4852		#endif
4853
4854		float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {
4855			// Not required if searchTex accesses are set to point:
4856			// float2 SEARCH_TEX_PIXEL_SIZE = 1.0 / float2(66.0, 33.0);
4857			// e = float2(bias, 0.0) + 0.5 * SEARCH_TEX_PIXEL_SIZE +
4858			//     e * float2(scale, 1.0) * float2(64.0, 32.0) * SEARCH_TEX_PIXEL_SIZE;
4859			e.r = bias + e.r * scale;
4860			return 255.0 * texture2D( searchTex, e, 0.0 ).r;
4861		}
4862
4863		float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {
4864			/**
4865				* @PSEUDO_GATHER4
4866				* This texcoord has been offset by (-0.25, -0.125) in the vertex shader to
4867				* sample between edge, thus fetching four edges in a row.
4868				* Sampling with different offsets in each direction allows to disambiguate
4869				* which edges are active from the four fetched ones.
4870				*/
4871			vec2 e = vec2( 0.0, 1.0 );
4872
4873			for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) { // WebGL port note: Changed while to for
4874				e = texture2D( edgesTex, texcoord, 0.0 ).rg;
4875				texcoord -= vec2( 2.0, 0.0 ) * resolution;
4876				if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;
4877			}
4878
4879			// We correct the previous (-0.25, -0.125) offset we applied:
4880			texcoord.x += 0.25 * resolution.x;
4881
4882			// The searches are bias by 1, so adjust the coords accordingly:
4883			texcoord.x += resolution.x;
4884
4885			// Disambiguate the length added by the last step:
4886			texcoord.x += 2.0 * resolution.x; // Undo last step
4887			texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);
4888
4889			return texcoord.x;
4890		}
4891
4892		float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {
4893			vec2 e = vec2( 0.0, 1.0 );
4894
4895			for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) { // WebGL port note: Changed while to for
4896				e = texture2D( edgesTex, texcoord, 0.0 ).rg;
4897				texcoord += vec2( 2.0, 0.0 ) * resolution;
4898				if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;
4899			}
4900
4901			texcoord.x -= 0.25 * resolution.x;
4902			texcoord.x -= resolution.x;
4903			texcoord.x -= 2.0 * resolution.x;
4904			texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );
4905
4906			return texcoord.x;
4907		}
4908
4909		float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {
4910			vec2 e = vec2( 1.0, 0.0 );
4911
4912			for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) { // WebGL port note: Changed while to for
4913				e = texture2D( edgesTex, texcoord, 0.0 ).rg;
4914				texcoord += vec2( 0.0, 2.0 ) * resolution; // WebGL port note: Changed sign
4915				if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;
4916			}
4917
4918			texcoord.y -= 0.25 * resolution.y; // WebGL port note: Changed sign
4919			texcoord.y -= resolution.y; // WebGL port note: Changed sign
4920			texcoord.y -= 2.0 * resolution.y; // WebGL port note: Changed sign
4921			texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 ); // WebGL port note: Changed sign
4922
4923			return texcoord.y;
4924		}
4925
4926		float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {
4927			vec2 e = vec2( 1.0, 0.0 );
4928
4929			for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) { // WebGL port note: Changed while to for
4930				e = texture2D( edgesTex, texcoord, 0.0 ).rg;
4931				texcoord -= vec2( 0.0, 2.0 ) * resolution; // WebGL port note: Changed sign
4932				if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;
4933			}
4934
4935			texcoord.y += 0.25 * resolution.y; // WebGL port note: Changed sign
4936			texcoord.y += resolution.y; // WebGL port note: Changed sign
4937			texcoord.y += 2.0 * resolution.y; // WebGL port note: Changed sign
4938			texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 ); // WebGL port note: Changed sign
4939
4940			return texcoord.y;
4941		}
4942
4943		vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {
4944			// Rounding prevents precision errors of bilinear filtering:
4945			vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e
49451, e2 ) ) + dist;
4946
4947			// We do a scale and bias for mapping to texel space:
4948			texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );
4949
4950			// Move to proper place, according to the subpixel offset:
4951			texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;
4952
4953			return texture2D( areaTex, texcoord, 0.0 ).rg;
4954		}
4955
4956		vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {
4957			vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );
4958
4959			vec2 e = texture2D( edgesTex, texcoord ).rg;
4960
4961			if ( e.g > 0.0 ) { // Edge at north
4962				vec2 d;
4963
4964				// Find the distance to the left:
4965				vec2 coords;
4966				coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );
4967				coords.y = offset[ 1 ].y; // offset[1].y = texcoord.y - 0.25 * resolution.y (@CROSSING_OFFSET)
4968				d.x = coords.x;
4969
4970				// Now fetch the left crossing edges, two at a time using bilinear
4971				// filtering. Sampling at -0.25 (see @CROSSING_OFFSET) enables to
4972				// discern what value each edge has:
4973				float e1 = texture2D( edgesTex, coords, 0.0 ).r;
4974
4975				// Find the distance to the right:
4976				coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );
4977				d.y = coords.x;
4978
4979				// We want the distances to be in pixel units (doing this here allow to
4980				// better interleave arithmetic and memory accesses):
4981				d = d / resolution.x - pixcoord.x;
4982
4983				// SMAAArea below needs a sqrt, as the areas texture is compressed
4984				// quadratically:
4985				vec2 sqrt_d = sqrt( abs( d ) );
4986
4987				// Fetch the right crossing edges:
4988				coords.y -= 1.0 * resolution.y; // WebGL port note: Added
4989				float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;
4990
4991				// Ok, we know how this pattern looks like, now it is time for getting
4992				// the actual area:
4993				weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );
4994			}
4995
4996			if ( e.r > 0.0 ) { // Edge at west
4997				vec2 d;
4998
4999				// Find the distance to the top:
5000				vec2 coords;
5001
5002				coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );
5003				coords.x = offset[ 0 ].x; // offset[1].x = texcoord.x - 0.25 * resolution.x;
5004				d.x = coords.y;
5005
5006				// Fetch the top crossing edges:
5007				float e1 = texture2D( edgesTex, coords, 0.0 ).g;
5008
5009				// Find the distance to the bottom:
5010				coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );
5011				d.y = coords.y;
5012
5013				// We want the distances to be in pixel units:
5014				d = d / resolution.y - pixcoord.y;
5015
5016				// SMAAArea below needs a sqrt, as the areas texture is compressed
5017				// quadratically:
5018				vec2 sqrt_d = sqrt( abs( d ) );
5019
5020				// Fetch the bottom crossing edges:
5021				coords.y -= 1.0 * resolution.y; // WebGL port note: Added
5022				float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;
5023
5024				// Get the area for this direction:
5025				weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );
5026			}
5027
5028			return weights;
5029		}
5030
5031		void main() {
5032
5033			gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );
5034
5035		}`},fo={uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new te(1/1024,1/512)}},vertexShader:`
5036
5037		uniform vec2 resolution;
5038
5039		varying vec2 vUv;
5040		varying vec4 vOffset[ 2 ];
5041
5042		void SMAANeighborhoodBlendingVS( vec2 texcoord ) {
5043			vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 ); // WebGL port note: Changed sign in W component
5044			vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 ); // WebGL port note: Changed sign in W component
5045		}
5046
5047		void main() {
5048
5049			vUv = uv;
5050
5051			SMAANeighborhoodBlendingVS( vUv );
5052
5053			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
5054
5055		}`,fragmentShader:`
5056
5057		uniform sampler2D tDiffuse;
5058		uniform sampler2D tColor;
5059		uniform vec2 resolution;
5060
5061		varying vec2 vUv;
5062		varying vec4 vOffset[ 2 ];
5063
5064		vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {
5065			// Fetch the blending weights for current pixel:
5066			vec4 a;
5067			a.xz = texture2D( blendTex, texcoord ).xz;
5068			a.y = texture2D( blendTex, offset[ 1 ].zw ).g;
5069			a.w = texture2D( blendTex, offset[ 1 ].xy ).a;
5070
5071			// Is there any blending weight with a value greater than 0.0?
5072			if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {
5073				return texture2D( colorTex, texcoord, 0.0 );
5074			} else {
5075				// Up to 4 lines can be crossing a pixel (one through each edge). We
5076				// favor blending by choosing the line with the maximum weight for each
5077				// direction:
5078				vec2 offset;
5079				offset.x = a.a > a.b ? a.a : -a.b; // left vs. right
5080				offset.y = a.g > a.r ? -a.g : a.r; // top vs. bottom // WebGL port note: Changed signs
5081
5082				// Then we go in the direction that has the maximum weight:
5083				if ( abs( offset.x ) > abs( offset.y )) { // horizontal vs. vertical
5084					offset.y = 0.0;
5085				} else {
5086					offset.x = 0.0;
5087				}
5088
5089				// Fetch the opposite color and lerp by hand:
5090				vec4 C = texture2D( colorTex, texcoord, 0.0 );
5091				texcoord += sign( offset ) * resolution;
5092				vec4 Cop = texture2D( colorTex, texcoord, 0.0 );
5093				float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );
5094
5095				// WebGL port note: Added gamma correction
5096				C.xyz = pow(C.xyz, vec3(2.2));
5097				Cop.xyz = pow(Cop.xyz, vec3(2.2));
5098				vec4 mixed = mix(C, Cop, s);
5099				mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));
5100
5101				return mixed;
5102			}
5103		}
5104
5105		void main() {
5106
5107			gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );
5108
5109		}`};class K_ extends vi{constructor(){super(),this._edgesRT=new zt(1,1,{depthBuffer:!1,type:Ct}),this._edgesRT.texture.name="SMAAPass.edges",this._weightsRT=new zt(1,1,{depthBuffer:!1,type:Ct}),this._weightsRT.texture.name="SMAAPass.weights";const e=this,t=new Image;t.src=this._getAreaTexture(),t.onload=function(){e._areaTexture.needsUpdate=!0},this._areaTexture=new Nt,this._areaTexture.name="SMAAPass.area",this._areaTexture.image=t,this._areaTexture.minFilter=Mt,this._areaTexture.generateMipmaps=!1,this._areaTexture.flipY=!1;const n=new Image;n.src=this._getSearchTexture(),n.onload=function(){e._searchTexture.needsUpdate=!0},this._searchTexture=new Nt,this._searchTexture.name="SMAAPass.search",this._searchTexture.image=n,this._searchTexture.magFilter=Rt,this._searchTexture.minFilter=Rt,this._searchTexture.generateMipmaps=!1,this._searchTexture.flipY=!1,this._uniformsEdges=sn.clone(Gr.uniforms),this._materialEdges=new Tt({defines:Object.assign({},Gr.defines),uniforms:this._uniformsEdges,vertexShader:Gr.vertexShader,fragmentShader:Gr.fragmentShader}),this._uniformsWeights=sn.clone(Vr.uniforms),this._uniformsWeights.tDiffuse.value=this._edgesRT.texture,this._uniformsWeights.tArea.value=this._areaTexture,this._uniformsWeights.tSearch.value=this._searchTexture,this._materialWeights=new Tt({defines:Object.assign({},Vr.defines),uniforms:this._uniformsWeights,vertexShader:Vr.vertexShader,fragmentShader:Vr.fragmentShader}),this._uniformsBlend=sn.clone(fo.uniforms),this._uniformsBlend.tDiffuse.value=this._weightsRT.texture,this._materialBlend=new Tt({uniforms:this._uniformsBlend,vertexShader:fo.vertexShader,fragmentShader:fo.fragmentShader}),this._fsQuad=new sr(null)}render(e,t,n){this._uniformsEdges.tDiffuse.value=n.texture,this._fsQuad.material=this._materialEdges,e.setRenderTarget(this._edgesRT),this.clear&&e.clear(),this._fsQuad.render(e),this._fsQuad.material=this._materialWeights,e.setRenderTarget(this._weightsRT),this.clear&&e.clear(),this._fsQuad.render(e),this._uniformsBlend.tColor.value=n.texture,this._fsQuad.material=this._materialBlend,this.renderToScreen?(e.setRenderTarget(null),this._fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this._fsQuad.render(e))}setSize(e,t){this._edgesRT.setSize(e,t),this._weightsRT.setSize(e,t),this._materialEdges.uniforms.resolution.value.set(1/e,1/t),this._materialWeights.uniforms.resolution.value.set(1/e,1/t),this._materialBlend.uniforms.resolution.value.set(1/e,1/t)}dispose(){this._edgesRT.dispose(),this._weightsRT.dispose(),this._areaTexture.dispose(),this._searchTexture.dispose(),this._materialEdges.dispose(),this._materialWeights.dispose(),this._materialBlend.dispose(),this._fsQuad.dispose()}_getAreaTexture
vendor: 44,306 bytes, line 5109
5109(){return"data:image/png;base64,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"}
5109_getSearchTexture(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}}const Hr={name:"OutputShader",uniforms:{tDiffuse:{value:null},toneMappingExposure:{value:1}},vertexShader:`
5110		precision highp float;
5111
5112		uniform mat4 modelViewMatrix;
5113		uniform mat4 projectionMatrix;
5114
5115		attribute vec3 position;
5116		attribute vec2 uv;
5117
5118		varying vec2 vUv;
5119
5120		void main() {
5121
5122			vUv = uv;
5123			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
5124
5125		}`,fragmentShader:`
5126
5127		precision highp float;
5128
5129		uniform sampler2D tDiffuse;
5130
5131		#include <tonemapping_pars_fragment>
5132		#include <colorspace_pars_fragment>
5133
5134		varying vec2 vUv;
5135
5136		void main() {
5137
5138			gl_FragColor = texture2D( tDiffuse, vUv );
5139
5140			// tone mapping
5141
5142			#ifdef LINEAR_TONE_MAPPING
5143
5144				gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
5145
5146			#elif defined( REINHARD_TONE_MAPPING )
5147
5148				gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
5149
5150			#elif defined( CINEON_TONE_MAPPING )
5151
5152				gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );
5153
5154			#elif defined( ACES_FILMIC_TONE_MAPPING )
5155
5156				gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
5157
5158			#elif defined( AGX_TONE_MAPPING )
5159
5160				gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );
5161
5162			#elif defined( NEUTRAL_TONE_MAPPING )
5163
5164				gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
5165
5166			#elif defined( CUSTOM_TONE_MAPPING )
5167
5168				gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
5169
5170			#endif
5171
5172			// color space
5173
5174			#ifdef SRGB_TRANSFER
5175
5176				gl_FragColor = sRGBTransferOETF( gl_FragColor );
5177
5178			#endif
5179
5180		}`};class Y_ extends vi{constructor(){super(),this.isOutputPass=!0,this.uniforms=sn.clone(Hr.uniforms),this.material=new Cu({name:Hr.name,uniforms:this.uniforms,vertexShader:Hr.vertexShader,fragmentShader:Hr.fragmentShader}),this._fsQuad=new sr(this.material),this._outputColorSpace=null,this._toneMapping=null}render(e,t,n){this.uniforms.tDiffuse.value=n.texture,this.uniforms.toneMappingExposure.value=e.toneMappingExposure,(this._outputColorSpace!==e.outputColorSpace||this._toneMapping!==e.toneMapping)&&(this._outputColorSpace=e.outputColorSpace,this._toneMapping=e.toneMapping,this.material.defines={},nt.getTransfer(this._outputColorSpace)===ct&&(this.material.defines.SRGB_TRANSFER=""),this._toneMapping===gc?this.material.defines.LINEAR_TONE_MAPPING="":this._toneMapping===bc?this.material.defines.REINHARD_TONE_MAPPING="":this._toneMapping===xc?this.material.defines.CINEON_TONE_MAPPING="":this._toneMapping===vc?this.material.defines.ACES_FILMIC_TONE_MAPPING="":this._toneMapping===ua?this.material.defines.AGX_TONE_MAPPING="":this._toneMapping===Mc?this.material.defines.NEUTRAL_TONE_MAPPING="":this._toneMapping===_c&&(this.material.defines.CUSTOM_TONE_MAPPING=""),this.material.needsUpdate=!0),this.renderToScreen===!0?(e.setRenderTarget(null),this._fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this._fsQuad.render(e))}dispose(){this.material.dispose(),this._fsQuad.dispose()}}class J_{constructor(e,t,n){le(this,"composer");le(this,"ao");le(this,"bloom");le(this,"renderPass");le(this,"output");le(this,"antialias");le(this,"supported");le(this,"viewportSize",new te);le(this,"quality","high");this.renderer=e,this.scene=t,this.camera=n,this.supported=e.extensions.has("EXT_color_buffer_float");const i=new zt(1,1,{type:this.supported?Ct:Jt,samples:0});this.composer=new G_(e,i),this.renderPass=new V_(t,n),this.ao=new On(t,n,1,1),this.ao.updateGtaoMaterial({radius:.65,thickness:1,distanceExponent:1.5,distanceFallOff:1,scale:1,samples:12}),this.ao.updatePdMaterial({radius:3,samples:8,rings:2});const r=this.ao.render.bind(this.ao);this.ao.render=(a,o,c,l,h)=>{const u=[];this.scene.traverse(f=>{f.visible&&(f.userData.excludeAO||f instanceof Ke&&!Array.isArray(f.material)&&f.material.transparent)&&(u.push(f),f.visible=!1)});const d=a.shadowMap.autoUpdate;a.shadowMap.autoUpdate=!1;try{r(a,o,c,l,h)}finally{u.forEach(f=>{f.visible=!0}),a.shadowMap.autoUpdate=d}},this.ao.blendIntensity=.65,this.bloom=new ds(new te(1,1),.08,.2,2.5),this.antialias=new K_,this.output=new Y_;for(const a of[this.renderPass,this.ao,this.bloom,this.antialias,this.output])this.composer.addPass(a)}resize(e,t){this.composer.setPixelRatio(this.renderer.getPixelRatio()),this.composer.setSize(e,t);
5180const n=this.quality==="ultra"?1:.5,i=this.renderer.getPixelRatio();this.ao.setSize(Math.max(1,Math.round(e*i*n)),Math.max(1,Math.round(t*i*n)))}render(){this.renderer.getSize(this.viewportSize),this.renderer.setRenderTarget(null),this.renderer.setViewport(0,0,this.viewportSize.x,this.viewportSize.y),this.renderer.setScissor(0,0,this.viewportSize.x,this.viewportSize.y),this.renderer.setScissorTest(!1);for(const e of[this.composer.renderTarget1,this.composer.renderTarget2])e.viewport.set(0,0,e.width,e.height),e.scissor.set(0,0,e.width,e.height),e.scissorTest=!1;Yu(this.scene,()=>{this.quality==="low"||!this.supported?this.renderer.render(this.scene,this.camera):this.composer.render()})}dispose(){for(const e of[this.renderPass,this.ao,this.bloom,this.antialias,this.output])e.dispose();this.ao.gtaoMaterial.dispose(),this.ao.blendMaterial.dispose(),this.composer.dispose()}}function Z_(){const s=document.createElement("canvas");s.width=1024,s.height=512;const e=s.getContext("2d"),t=e.createImageData(s.width,s.height),n=o=>(o=Math.max(0,Math.min(1,o)),o*o*(3-2*o)),i=(o,c)=>{const l=Math.sin(o*127.1+c*311.7)*43758.5453;return l-Math.floor(l)},r=(o,c)=>{const l=Math.floor(o),h=Math.floor(c),u=n(o-l),d=n(c-h);return Lt.lerp(Lt.lerp(i(l,h),i(l+1,h),u),Lt.lerp(i(l,h+1),i(l+1,h+1),u),d)};for(let o=0;o<s.height;o++){const c=Math.max(0,1-o/256),l=Math.pow(Math.min(1,c/.22),.45);for(let h=0;h<s.width;h++){const u=h/s.width*Math.PI*2,d=Math.cos(u)*7+20,f=Math.sin(u)*7+o*.075,g=r(d,f)*.6+r(d*2,f*2)*.27+r(d*4,f*4)*.13,b=n((g-.58)/.19)*n(c/.12)*(1-n((c-.55)/.3))*.82,m=(o*s.width+h)*4,p=[Lt.lerp(172,25,l),Lt.lerp(220,105,l),Lt.lerp(239,195,l)];for(let _=0;_<3;_++)t.data[m+_]=Lt.lerp(p[_],245,b);t.data[m+3]=255}}e.putImageData(t,0,0);const a=new Qf(s);return a.colorSpace=kt,a.mapping=Us,a}class xa extends Ke{constructor(){const e=xa.SkyShader,t=new Tt({name:e.name,uniforms:sn.clone(e.uniforms),vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,side:en,depthWrite:!1});super(new ni(1,1,1),t),this.isSky=!0}}xa.SkyShader={name:"SkyShader",uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new L},up:{value:new L(0,1,0)},cloudScale:{value:2e-4},cloudSpeed:{value:1e-4},cloudCoverage:{value:.4},cloudDensity:{value:.4},cloudElevation:{value:.5},showSunDisc:{value:1},time:{value:0}},vertexShader:`
5181		uniform vec3 sunPosition;
5182		uniform float rayleigh;
5183		uniform float turbidity;
5184		uniform float mieCoefficient;
5185		uniform vec3 up;
5186
5187		varying vec3 vWorldPosition;
5188		varying vec3 vSunDirection;
5189		varying float vSunfade;
5190		varying vec3 vBetaR;
5191		varying vec3 vBetaM;
5192		varying float vSunE;
5193
5194		// constants for atmospheric scattering
5195		const float e = 2.71828182845904523536028747135266249775724709369995957;
5196		const float pi = 3.141592653589793238462643383279502884197169;
5197
5198		// wavelength of used primaries, according to preetham
5199		const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );
5200		// this pre-calculation replaces older TotalRayleigh(vec3 lambda) function:
5201		// (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn))
5202		const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );
5203
5204		// mie stuff
5205		// K coefficient for the primaries
5206		const float v = 4.0;
5207		const vec3 K = vec3( 0.686, 0.678, 0.666 );
5208		// MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K
5209		const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );
5210
5211		// earth shadow hack
5212		// cutoffAngle = pi / 1.95;
5213		const float cutoffAngle = 1.6110731556870734;
5214		const float steepness = 1.5;
5215		const float EE = 1000.0;
5216
5217		float sunIntensity( float zenithAngleCos ) {
5218			zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );
5219			return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );
5220		}
5221
5222		vec3 totalMie( float T ) {
5223			float c = ( 0.2 * T ) * 10E-18;
5224			return 0.434 * c * MieConst;
5225		}
5226
5227		void main() {
5228
5229			vec4 worldPosition = modelMatrix * vec4( position, 1.0 );
5230			vWorldPosition = worldPosition.xyz;
5231
5232			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
5233			gl_Position.z = gl_Position.w; // set z to camera.far
5234
5235			vSunDirection = normalize( sunPosition );
5236
5237			vSunE = sunIntensity( dot( vSunDirection, up ) );
5238
5239			vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );
5240
5241			float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );
5242
5243			// extinction (absorption + out scattering)
5244			// rayleigh coefficients
5245			vBetaR = totalRayleigh * rayleighCoefficient;
5246
5247			// mie coefficients
5248			vBetaM = totalMie( turbidity ) * mieCoefficient;
5249
5250		}`,fragmentShader:`
5251		varying vec3 vWorldPosition;
5252		varying vec3 vSunDirection;
5253		varying vec3 vBetaR;
5254		varying vec3 vBetaM;
5255		varying float vSunE;
5256
5257		uniform float mieDirectionalG;
5258		uniform vec3 up;
5259		uniform float cloudScale;
5260		uniform float cloudSpeed;
5261		uniform float cloudCoverage;
5262		uniform float cloudDensity;
5263		uniform float cloudElevation;
5264		uniform float showSunDisc;
5265		uniform float time;
5266
5267		// Cloud noise functions
5268		float hash( vec2 p ) {
5269			return fract( sin( dot( p, vec2( 127.1, 311.7 ) ) ) * 43758.5453123 );
5270		}
5271
5272		float noise( vec2 p ) {
5273			vec2 i = floor( p );
5274			vec2 f = fract( p );
5275			f = f * f * ( 3.0 - 2.0 * f );
5276			float a = hash( i );
5277			float b = hash( i + vec2( 1.0, 0.0 ) );
5278			float c = hash( i + vec2( 0.0, 1.0 ) );
5279			float d = hash( i + vec2( 1.0, 1.0 ) );
5280			return mix( mix( a, b, f.x ), mix( c, d, f.x ), f.y );
5281		}
5282
5283		float fbm( vec2 p ) {
5284			float value = 0.0;
5285			float amplitude = 0.5;
5286			for ( int i = 0; i < 5; i ++ ) {
5287				value += amplitude * noise( p );
5288				p *= 2.0;
5289				amplitude *= 0.5;
5290			}
5291			return value;
5292		}
5293
5294		// constants for atmospheric scattering
5295		const float pi = 3.141592653589793238462643383279502884197169;
5296
5297		const float n = 1.0003; // refractive index of air
5298		const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius)
5299
5300		// optical length at zenith for molecules
5301		const float rayleighZenithLength = 8.4E3;
5302		const float mieZenithLength = 1.25E3;
5303		// 66 arc seconds -> degrees, and the cosine of that
5304		const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;
5305
5306		// 3.0 / ( 16.0 * pi )
5307		const float THREE_OVER_SIXTEENPI = 0.05968310365946075;
5308		// 1.0 / ( 4.0 * pi )
5309		const float ONE_OVER_FOURPI = 0.07957747154594767;
5310
5311		float rayleighPhase( float cosTheta ) {
5312			return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );
5313		}
5314
5315		float hgPhase( float cosTheta, float g ) {
5316			float g2 = pow( g, 2.0 );
5317			float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );
5318			return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );
5319		}
5320
5321		void main() {
5322
5323			vec3 direction = normalize( vWorldPosition - cameraPosition );
5324
5325			// optical length
5326			// cutoff angle at 90 to avoid singularity in next formula.
5327			float zenithAngle = acos( max( 0.0, dot( up, direction ) ) );
5328			float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );
5329			float sR = rayleighZenithLength * inverse;
5330			float sM = mieZenithLength * inverse;
5331
5332			// combined extinction factor
5333			vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );
5334
5335			// in scattering
5336			float cosTheta = dot( direction, vSunDirection );
5337
5338			float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );
5339			vec3 betaRTheta = vBetaR * rPhase;
5340
5341			float mPhase = hgPhase( cosTheta, mieDirectionalG );
5342			vec3 betaMTheta = vBetaM * mPhase;
5343
5344			vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );
5345			Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) );
5346
5347			// nightsky
5348			float theta = acos( direction.y ); // elevation --> y-axis, [-pi/2, pi/2]
5349			float phi = atan( direction.z, direction.x ); // azimuth --> x-axis [-pi/2, pi/2]
5350			vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );
5351			vec3 L0 = vec3( 0.1 ) * Fex;
5352
5353			// composition + solar disc
5354			float sundisc = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta ) * showSunDisc;
5355			L0 += ( vSunE * 19000.0 * Fex ) * sundisc;
5356
5357			vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );
5358
5359			// Clouds
5360			if ( direction.y > 0.0 && cloudCoverage > 0.0 ) {
5361
5362				// Project to cloud plane (higher elevation = clouds appear lower/closer)
5363				float elevation = mix( 1.0, 0.1, cloudElevation );
5364				vec2 cloudUV = direction.xz / ( direction.y * elevation );
5365				cloudUV *= cloudScale;
5366				cloudUV += time * cloudSpeed;
5367
5368				// Multi-octave noise for fluffy clouds
5369				float cloudNoise = fbm( cloudUV * 1000.0 );
5370				cloudNoise += 0.5 * fbm( cloudUV * 2000.0 + 3.7 );
5371				cloudNoise = cloudNoise * 0.5 + 0.5;
5372
5373				// Apply coverage threshold
5374				float cloudMask = smoothstep( 1.0 - cloudCoverage, 1.0 - cloudCoverage + 0.3, cloudNoise );
5375
5376				// Fade clouds near horizon (adjusted by elevation)
5377				float horizonFade = smoothstep( 0.0, 0.1 + 0.2 * cloudElevation, direction.y );
5378				cloudMask *= horizonFade;
5379
5380				// Cloud lighting based on sun position
5381				float sunInfluence = dot( direction, vSunDirection ) * 0.5 + 0.5;
5382				float daylight = max( 0.0, vSunDirection.y * 2.0 );
5383
5384				// Base cloud color affected by atmosphere
5385				vec3 atmosphereColor = Lin * 0.04;
5386				vec3 cloudColor = mix( vec3( 0.3 ), vec3( 1.0 ), daylight );
5387				cloudColor = mix( cloudColor, atmosphereColor + vec3( 1.0 ), sunInfluence * 0.5 );
5388				cloudColor *= vSunE * 0.00002;
5389
5390				// Blend clouds with sky
5391				texColor = mix( texColor, cloudColor, cloudMask * cloudDensity );
5392
5393			}
5394
5395			gl_FragColor = vec4( texColor, 1.0 );
5396
5397			#include <tonemapping_fragment>
5398			#include <colorspace_fragment>
5399
5400		}`};class Q_{constructor(e,t,n,i,r=()=>{},a=()=>new Map,o=()=>{},c=()=>{}){le(this,"renderer");le(this,"scene",new Nl);le(this,"camera",new $t(48,1,.08,2e4));le(this,"controls");le(this,"sun",new Iu("#fff2d5",3.5));le(this,"sky",new xa);le(this,"daySky",Z_());le(this,"ground");le(this,"asphalt",E_());le(this,"environment");le(this,"outdoor",new __);le(this,"scenery",new F_);le(this,"trajectory",new P_);le(this,"ghosts",new R_);le(this,"unsubscribeGhosts");le(this,"unsubscribeTrajectory");le(this,"unsubscribeTrajectoryColor");le(this,"reflection");le(this,"post");le(this,"lighting","day");le(this,"roads",new ut);le(this,"staticShapes",[]);le(this,"actors",new Map);le(this,"dirty",!0);le(this,"unsubscribe");le(this,"unsubscribeTemplates");le(this,"resizeObserver");le(this,"mode","follow");le(this,"targetId","");le(this,"actorKey","");le(this,"disposed",!1);le(this,"framed",!1);le(this,"bottomInset",0);le(this,"surfaces",new Xh(new ut));le(this,"lastFocus");le(this,"lastMotionAt",-1/0);le(this,"reflectionTimer");le(this,"contextLost");le(this,"frame",0);le(this,"needsRender",!0);le(this,"detailedCar",null);le(this,"preparations",[]);le(this,"assetManager",new Du);le(this,"completionNotified",!1);le(this,"previewRendered",!1);le(this,"assetsSettled",!1);this.host=e,this.editor=t,this.onActors=n,this.onReady=r,this.readSpatialPoses=a,this.onPreviewReady=c,this.renderer=new pv({antialias:!0,powerPreference:"high-performance"}),this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,1.5)),this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=Qh,this.renderer.toneMapping=ua,this.renderer.toneMappingExposure=1.05,this.renderer.domElement.setAttribute("aria-label","3D scene"),e.appendChild(this.renderer.domElement),this.contextLost=b=>{b.preventDefault(),this.disposed=!0,this.renderer.setAnimationLoop(null),i("3D was interrupted. Switch to 2D, then try again.")},this.renderer.domElement.addEventListener("webglcontextlost",this.contextLost),this.controls=new xv(this.camera,this.renderer.domElement),this.controls.addEventListener("change",()=>{this.needsRender=!0}),this.controls.enableDamping=!0,this.controls.minDistance=2,this.controls.maxDistance=1e4,this.controls.maxPolarAngle=Math.PI/2-.015,this.scene.fog=new Nc("#b8cad5",.0012),this.sky.scale.setScalar(15e3),this.sky.material.uniforms.turbidity.value=3,this.sky.material.uniforms.rayleigh.value=1.5,this.scene.add(this.sky),this.scene.add(new $p("#c8e4ff","#69684c",.5)),this.sun.castShadow=!0,this.sun.shadow.mapSize.set(2048,2048),this.sun.shadow.camera.near=1,this.sun.shadow.camera.far=260,Object.assign(this.sun.shadow.camera,{left:-60,right:60,top:60,bottom:-60}),this.sun.shadow.normalBias=.025,this.sun.shadow.bias=-8e-5,this.scene.add(this.sun,this.sun.target),this.scene.environmentIntensity=.8,this.ground=new Ke(new nr(3e4,3e4,128,128),new St({color:"#648347",roughness:1})),this.ground.rotation.x=-Math.PI/2,this.ground.position.y=-.035,this.ground.receiveShadow=!0,this.scene.add(this.ground,this.roads,this.scener
5400y.root,this.trajectory.root,this.ghosts.root),this.post=new J_(this.renderer,this.scene,this.camera),this.reflection=new y_(this.renderer),this.setLighting("day"),this.unsubscribe=t.addShapeListener(()=>{this.dirty=!0}),this.unsubscribeGhosts=cl.subscribe(()=>{this.needsRender=!0}),this.unsubscribeTrajectory=ll.subscribe(()=>{this.needsRender=!0}),this.unsubscribeTrajectoryColor=hl.subscribe(()=>{this.needsRender=!0}),this.unsubscribeTemplates=md(()=>{this.dirty=!0}),this.resizeObserver=new ResizeObserver(()=>this.resize()),this.resizeObserver.observe(e),this.resize(),this.sync(),this.fit();const l=this.renderer.compileAsync(this.scene,this.camera).then(()=>{this.disposed||this.renderer.setAnimationLoop(()=>this.render())}).catch(()=>{this.disposed||i("Unable to prepare 3D. Switch to 2D and try again.")});this.preparations.push(l);let h=!1,u=!1;const d=()=>{this.disposed||o(h?u?"Preparing 3D frame…":"Loading 3D environment…":"Loading 3D models…")};d();const f=x_(this.assetManager).then(b=>{if(this.disposed){la(b);return}b.traverse(m=>{m instanceof Ke&&(m.castShadow=!0,m.receiveShadow=!0)}),this.detailedCar=b,this.host.dataset.vehicleQuality="detailed",this.dirty=!0}).catch(b=>{console.warn("Detailed vehicle unavailable; using procedural vehicles",b),this.host.dataset.vehicleQuality="fallback"}).finally(()=>{h=!0,d()}),g=f.then(()=>this.disposed?void 0:this.outdoor.load(this.assetManager)).then(()=>{if(!this.disposed){for(const b of[this.outdoor.asphalt,this.outdoor.ground])if(b)for(const m of Object.values(b))m.anisotropy=Math.min(16,this.renderer.capabilities.getMaxAnisotropy());if(this.outdoor.ground){const b=this.outdoor.ground;for(const p of Object.values(b))p.repeat.setScalar(5e3);const m=this.ground.material;m.color.set("#86bc70"),m.map=b.color,m.normalMap=b.normal,m.normalScale.setScalar(.7),m.roughnessMap=b.arm,m.aoMap=b.arm,m.aoMapIntensity=.7,mv(m)}this.staticShapes=[],this.dirty=!0,this.scenery.invalidate(),this.reflection.invalidate(),this.setLighting(this.lighting),this.host.dataset.environment=this.outdoor.failures?"partial":"ready"}}).finally(()=>{u=!0,d()});Promise.allSettled([f,g]).then(()=>{this.disposed||(this.assetsSettled=!0,this.dirty=!0,this.needsRender=!0)})}setCamera(e,t=this.targetId){var n;if(this.needsRender=!0,this.mode=e,e!=="bev"&&this.camera.up.set(0,1,0),this.targetId=t,this.controls.enabled=e==="orbit"||!this.actors.size,e==="orbit"){const i=(n=this.actors.get(t))==null?void 0:n.model;i&&this.controls.target.copy(i.position)}}setLighting(e){var c,l;if(this.disposed)return;this.needsRender=!0,this.lighting=e;const t=e==="sunset",n=!t&&this.outdoor.sky?M_(this.outdoor.sky):new L(-.65,t?.15:.7,-.45).normalize();this.sky.material.uniforms.sunPosition.value.copy(n),this.sun.userData.direction=n,this.sun.color.set(t?"#ffba7a":"#fff2d5"),this.sun.intensity=t?2.5:3,this.sky.visible=t,this.scene.background=t?null:this.daySky,this.scene.backgroundIntensity=t?1:1.25,this.scene.fog.color.set(t?"#b8cad5":"#b2d7e7");const i=new ca(this.renderer),r=new Nl,a=this.sky.clone();a.visible=!0,r.add(a);const o=!t&&this.outdoor.sky?i.fromEquirectangular(this.outdoor.sky):i.fromScene(r,.04,.1,2e4);(c=this.environment)==null||c.dispose(),this.environment=o,this.scene.environment=o.texture,(l=this.reflection)==null||l.invalidate(),i.dispose()}setQuality(e){this.disposed||(this.post.quality=e,this.reflection.invalidate(),this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,e==="ultra"?2:e==="high"?1.5:1)),this.scenery.limit=e==="ultra"?150:e==="high"?100:30,this.resize(),this.needsRender=!0)}setScenery(e){this.disposed||(this.scenery.enabled=e,this.reflection.invalidate(),this.needsRender=!0)}setZoom(e){this.camera.zoom=Math.max(.25,Math.min(4,e)),this.camera.updateProjectionMatrix(),this.needsRender=!0}fit(){this.needsRender=!0;const e=new tn;for(const{model:r}of this.actors.values())r.visible&&e.expandByObject(r);e.isEmpty()&&e.setFromObject(this.roads);const t=e.isEmpty()?new L:e.getCenter(new L),n=e.isEmpty()?20:e.getSize(new L).length(),i=Math.max(18,n/(2*Math.tan(Lt.degToRad(this.camera.fov/2)))/Math.min(this.camera.aspect,1));this.camera.position.copy(t).add(new L(.65,.5,.8).normalize().multiplyScalar(i)),this.controls.target.copy(t),this.camera.lookAt(t),this.controls.update(),this.framed=!e.isEmpty()}setBottomInset(e){this.bottomInset=Math.max(0,e),this.resize()}resize(){var i;if(this.disposed)return;const{clientWidth:e,clientHeight:t}=this.host;if(!e||!t)return;this.renderer.setSize(e,t),(i=this.post)==null||i.resize(e,t);const n=Math.max(t*.15,t-this.bottomInset-(this.bottomInset>0?6:0));this.camera.setViewOffset(e,n,0,0,e,t),this.camera.updateProjectionMatrix(),this.needsRender=!0}sync(){var c,l,h,u,d;const e=this.editor.getCurrentPageShapes(),t=this.readSpatialPoses(),n=e.filter(f=>["lane","linestring","point","crosswalk","polygon","traffic_light"].includes(f.type));if(n.length!==this.staticShapes.length||n.some((f,g)=>f!==this.staticShapes[g])){this.scene.remove(this.roads),$i(this.roads),(c=this.roads.userData.materials)==null||c.forEac
5400h(f=>f.dispose()),this.roads=w_(this.editor,e,this.asphalt,this.outdoor.asphalt),this.scene.add(this.roads),this.roads.updateMatrixWorld(!0),this.surfaces=new Xh(this.roads),this.staticShapes=n,this.scenery.invalidate(),this.reflection.invalidate();for(const f of this.actors.values())f.shape=void 0}const i=new Set,r=[];for(const f of e){if(f.type!=="vehicle")continue;i.add(f.id);const g=`${gd(f.props.templateId??"")?"pedestrian":f.props.templateId??""} ${((l=f.props.attributes)==null?void 0:l.subtype)??""}`.toLowerCase(),b=Zh(f.props.color??"blue"),m=this.detailedCar&&!/pedestrian|bus|truck|bicycle|motorcycle|amr|robovac|golf/.test(g),p=`${g}|${b}|${f.props.w}|${f.props.h}|${!!m}`;let _=this.actors.get(f.id);if((_==null?void 0:_.signature)!==p){_&&(this.scene.remove(_.model),$i(_.model));const v=m?v_(this.detailedCar,b):Fv(b,g),T=Math.max(.1,mt(f.props.w??30)),E=Math.max(.1,mt(f.props.h??75));/pedestrian/.test(g)?v.scale.setScalar(1):v.scale.set(T/v.userData.nominalWidth,Math.min(1.7,Math.max(.65,T/1.83)),E/v.userData.nominalLength),v.name=f.id,_={model:v,signature:p},this.actors.set(f.id,_),this.scene.add(v)}const{model:y}=_;if(_.shape!==f){const v=y.position.clone();y.position.set(mt(f.x),0,mt(f.y));const T=t.get(f.id);if(y.position.y=Number.isFinite(T==null?void 0:T.z)?T.z:this.surfaces.heightAt(y.position.x,y.position.z,!0)??0,/pedestrian/.test(g)&&Iv(y,T==null?void 0:T.time,T==null?void 0:T.speed),y.rotation.set(-((T==null?void 0:T.pitch)??0),-Lt.degToRad(f.rotation??0),-((T==null?void 0:T.roll)??0),"YXZ"),_.shape){const E=v.distanceTo(y.position),C=new L(0,0,-1).applyQuaternion(y.quaternion),x=y.position.clone().sub(v).dot(C)>=0?-1:1;for(const S of y.children)S.name==="wheel"&&(S.rotation.x+=x*E/((S.userData.radius??.35)*y.scale.y))}y.visible=f.props.opacity!==0,_.shape=f}r.push({id:f.id,name:f.props.__oscName||((h=f.props.attributes)==null?void 0:h.name)||`Actor ${r.length+1}`})}for(const[f,g]of this.actors)i.has(f)||(this.scene.remove(g.model),$i(g.model),this.actors.delete(f));let a=Number.isFinite(this.surfaces.minimumHeight)?this.surfaces.minimumHeight:0;for(const{model:f}of this.actors.values())f.visible&&(a=Math.min(a,f.position.y));this.ground.position.y=a-.035;const o=JSON.stringify(r);o!==this.actorKey&&(this.actorKey=o,i.has(this.targetId)||(this.targetId=this.editor.getSelectedShapeIds().find(f=>i.has(f))??((u=r.find(f=>/ego/i.test(f.name)))==null?void 0:u.id)??((d=r[0])==null?void 0:d.id)??""),this.onActors(r)),!this.framed&&(this.actors.size||this.roads.children.length)&&this.fit(),this.controls.enabled=this.mode==="orbit"||!this.actors.size,this.dirty=!1}render(){var n;if(this.disposed||document.hidden||(this.dirty&&(this.sync(),this.needsRender=!0),this.controls.enabled&&this.controls.update(),!this.needsRender))return;this.needsRender=!1,this.trajectory.update(ll.get(),this.surfaces,hl.get()),this.ghosts.update(cl.get(),this.surfaces);const e=(n=this.actors.get(this.targetId))==null?void 0:n.model;this.mode!=="orbit"&&(e!=null&&e.visible)&&this.controls.target.copy(gv(this.camera,e,this.mode));const t=e&&this.mode!=="orbit"?e.position:this.controls.target;this.sun.target.position.copy(t),this.sun.position.copy(t).addScaledVector(this.sun.userData.direction,120),this.ground.position.x=Math.floor(this.camera.position.x/150)*150,this.ground.position.z=Math.floor(this.camera.position.z/150)*150,this.scenery.update(t,this.surfaces,this.outdoor,this.editor,this.ground.position.y),this.lastFocus&&t.distanceToSquared(this.lastFocus)>1e-4&&(this.lastMotionAt=performance.now(),clearTimeout(this.reflectionTimer),this.reflectionTimer=setTimeout(()=>{this.disposed||(this.needsRender=!0)},450)),this.lastFocus?this.lastFocus.copy(t):this.lastFocus=t.clone(),this.post.quality==="ultra"&&this.environment&&this.outdoor.sky?this.reflection.update(this.scene,t,[this.ghosts.root,...[...this.actors.values()].map(i=>i.model)],this.environment.texture,performance.now()-this.lastMotionAt>=400,this.lighting==="day"?this.outdoor.sky:void 0):this.environment&&(this.scene.environment=this.environment.texture),this.post.render(),this.host.dataset.rendered="true",this.previewRendered||(this.previewRendered=!0,this.onPreviewReady()),!this.completionNotified&&this.assetsSettled&&(this.completionNotified=!0,this.onReady())}dispose(){this.disposed=!0,this.assetManager.abort(),this.outdoor.dispose(),clearTimeout(this.reflectionTimer),this.renderer.setAnimationLoop(null),this.unsubscribe(),this.unsubscribeTemplates(),this.unsubscribeTrajectory(),this.unsubscribeTrajectoryColor(),this.unsubscribeGhosts(),this.resizeObserver.disconnect(),this.controls.dispose(),this.renderer.domElement.removeEventListener("webglcontextlost",this.contextLost),this.renderer.domElement.remove(),Promise.allSettled(this.preparations).then(()=>{var e,t;
5400this.trajectory.dispose(),this.ghosts.dispose(),this.scenery.dispose(),this.post.dispose(),this.reflection.dispose(),$i(this.scene),this.outdoor.dispose(),(e=this.roads.userData.materials)==null||e.forEach(n=>n.dispose()),this.asphalt.dispose(),this.daySky.dispose(),this.detailedCar&&la(this.detailedCar),(t=this.environment)==null||t.dispose(),this.sun.shadow.dispose(),this.renderer.dispose(),this.renderer.forceContextLoss()})}}function $_(s){const e=new Map,t=s==null?void 0:s.getPlaybackEngine();if(!t||!(s!=null&&s.isPreviewActive()))return e;const n=t.source.getStateAt(t.currentT);for(const i of t.source.getRecording().actors){if(!i.shapeId)continue;const r=n[i.id];if(!r)continue;const a=r.custom;e.set(i.shapeId,{time:t.currentT,speed:r.v,z:typeof(a==null?void 0:a.z)=="number"&&Number.isFinite(a.z)?a.z:void 0,pitch:typeof(a==null?void 0:a.pitch)=="number"&&Number.isFinite(a.pitch)?a.pitch:void 0,roll:typeof(a==null?void 0:a.roll)=="number"&&Number.isFinite(a.roll)?a.roll:void 0})}return e}function nM({bottomOffset:s,onExit:e,menuHost:t,showZoom:n}){var Ve;const i=bd(),r=xd(),a=Et.useRef(r);a.current=r;const o=Et.useRef(null),c=Et.useRef(null),[l,h]=Et.useState(1),u=Et.useRef(1),d=k=>{var Q;const ee=Math.max(.25,Math.min(4,u.current+k*.1));u.current=ee,(Q=c.current)==null||Q.setZoom(ee),h(ee)},[f,g]=Et.useState(""),[b,m]=Et.useState(!1),[p,_]=Et.useState(!1),[y,v]=Et.useState("Preparing 3D…"),[T,E]=Et.useState([]),[C,x]=Et.useState("follow"),[S,A]=Et.useState(()=>i.getSelectedShapeIds().find(k=>{var ee;return((ee=i.getShape(k))==null?void 0:ee.type)==="vehicle"})??""),[R,D]=Et.useState("high"),[F,O]=Et.useState(!0),[I,B]=Et.useState("day");Et.useEffect(()=>{if(!o.current)return;m(!1),_(!1),g("");const k=requestAnimationFrame(()=>{if(o.current)try{const ee=()=>{var Q;return $_((Q=a.current)==null?void 0:Q.controller)};c.current=new Q_(o.current,i,E,g,()=>m(!0),ee,v,()=>_(!0)),c.current.setBottomInset(s)}catch(ee){console.error("3D renderer initialization failed",ee),g("Unable to start 3D. Enable hardware acceleration and try again.")}});return()=>{var ee;cancelAnimationFrame(k),(ee=c.current)==null||ee.dispose(),c.current=null}},[i]),Et.useEffect(()=>{var k;(k=c.current)==null||k.setBottomInset(s)},[s,b]);const G=r!=null&&r.isScenarioMode?r.cameraControls:void 0,j=T.some(k=>k.id===S)?S:((Ve=T.find(k=>/ego/i.test(k.name))??T[0])==null?void 0:Ve.id)??"",Y=G!=null&&G.followEntity?(r==null?void 0:r.registry.shapeIdOf(G.followEntity))??"":"",ne=G?Y?G.perspective:"orbit":C,oe=G?Y:j;Et.useEffect(()=>{var k;(k=c.current)==null||k.setCamera(ne,oe)},[ne,oe,b]);const ce=(G==null?void 0:G.fitRequest)??0,Ee=Et.useRef(ce);Et.useEffect(()=>{var k,ee,Q;ce!==Ee.current&&(Ee.current=ce,(k=c.current)==null||k.setCamera("orbit"),(ee=c.current)==null||ee.setZoom(1),u.current=1,h(1),(Q=c.current)==null||Q.fit())},[ce]),Et.useEffect(()=>{var k;(k=c.current)==null||k.setLighting(I)},[I]),Et.useEffect(()=>{var k;(k=c.current)==null||k.setQuality(R)},[R]),Et.useEffect(()=>{var k;(k=c.current)==null||k.setScenery(F)},[F]);const je={...Object.fromEntries(Object.entries(Wr).map(([k,ee])=>[`--scene-${k}`,ee])),"--scene-shadow":vd};return wt.jsxs("section",{style:je,className:"scene3d","data-ready":b,"data-preview-ready":p,"aria-busy":!b&&!f,"aria-label":"3D view","data-testid":"scene-3d",tabIndex:0,onPointerDown:k=>{k.target instanceof HTMLCanvasElement&&k.currentTarget.focus()},onKeyDown:k=>{k.currentTarget.contains(k.target)&&(k.key!=="Tab"&&k.stopPropagation(),k.key==="Escape"&&e())},children:[wt.jsx("div",{className:"scene3d-renderer",ref:o,"data-testid":"scene-3d-renderer"}),!b&&!f&&wt.jsx(_d,{surface:!p,message:y}),f&&wt.jsxs("div",{className:"scene3d-error",role:"alert",children:[wt.jsx("p",{children:f}),wt.jsx("button",{onClick:e,children:"Back to 2D"})]}),n&&p&&!f&&wt.jsx(Md,{bottomOffset:s,zoom:l,min:.25,max:4,onStep:d}),t&&!f&&yd.createPortal(wt.jsxs("div",{className:"scene3d-controls","aria-label":"3D settings",style:je,children:[!G&&wt.jsxs(wt.Fragment,{children:[wt.jsxs("label",{children:["Camera",wt.jsx(bs,{ariaLabel:"Camera",testId:"scene3d-camera",value:C,onChange:k=>x(k),options:[{value:"orbit",label:"Free"},{value:"follow",label:"Follow",disabled:!T.length},{value:"bev",label:"BEV",disabled:!T.length},{value:"driver",label:"Driver",disabled:!T.length}]})]}),C!=="orbit"&&T.length>0&&wt.jsxs("label",{children:["Target",wt.jsx(bs,{ariaLabel:"Target",testId:"scene3d-target",value:j,onChange:A,options:T.map(k=>({value:k.id,label:k.name}))})]}),wt.jsx("button",{className:"scene3d-fit",onClick:()=>{var k,ee,Q;x("orbit"),(k=c.current)==null||k.setCamera("orbit"),(ee=c.current)==null||ee.setZoom(1),u.current=1,h(1),(Q=c.current)==null||Q.fit()},children:"Fit scene"})]}),wt.jsxs("details",{children:[wt.jsx("summary",{children:"Rendering"}
5400),wt.jsxs("label",{children:["Lighting",wt.jsx(bs,{ariaLabel:"Lighting",testId:"scene3d-lighting",value:I,onChange:k=>B(k),options:[{value:"day",label:"Day"},{value:"sunset",label:"Sunset"}]})]}),wt.jsxs("label",{children:["Quality",wt.jsx(bs,{ariaLabel:"Quality",testId:"scene3d-quality",value:R,onChange:k=>D(k),options:[{value:"ultra",label:"Ultra"},{value:"high",label:"High"},{value:"low",label:"Low"}]})]}),wt.jsxs("label",{children:["Scenery",wt.jsx(bs,{ariaLabel:"Scenery",testId:"scene3d-scenery",value:F?"nature":"none",onChange:k=>O(k==="nature"),options:[{value:"nature",label:"On"},{value:"none",label:"Off"}]})]})]})]}),t)]})}export{nM as default};

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.