PageSourceSearch

https://newmode.ai/assets/PerspectiveTunnel-Dg2W7QtL.js

js newmode.ai collected 2026-10-05 12:18:45 UTC 806,736 bytes, 3,728 lines download raw bytes

vendor: 7,599 bytes, lines 1-5
1import{r as ke,z as _x,A as vx,o as zt}from"./chunk-LFPYN7LY-XMI0Pofr.js";/**
2 * @license
3 * Copyright 2010-2023 Three.js Authors
4 * SPDX-License-Identifier: MIT
5 */const ou="160",yx={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},xx={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},$0=0,kf=1,e_=2,Sx=3,t_=0,au=1,pa=2,Mi=3,ar=0,Bn=1,Bi=2,Mx=2,or=0,ps=1,Hf=2,Vf=3,Gf=4,n_=5,Rr=100,i_=101,r_=102,Wf=103,Xf=104,s_=200,o_=201,a_=202,l_=203,$c=204,eu=205,c_=206,u_=207,h_=208,f_=209,d_=210,p_=211,m_=212,g_=213,__=214,v_=0,y_=1,x_=2,xa=3,S_=4,M_=5,E_=6,w_=7,Ha=0,T_=1,A_=2,zi=0,b_=1,C_=2,R_=3,Ld=4,P_=5,L_=6,qf="attached",I_="detached",lu=300,lr=301,Ur=302,Sa=303,Ma=304,Ao=306,Ea=1e3,Pn=1001,wa=1002,$t=1003,tu=1004,Ex=1004,ma=1005,wx=1005,en=1006,Id=1007,Tx=1007,Or=1008,Ax=1008,ki=1009,D_=1010,N_=1011,cu=1012,Dd=1013,rr=1014,wi=1015,xo=1016,Nd=1017,Ud=1018,Ir=1020,U_=1021,Fn=1023,O_=1024,F_=1025,Dr=1026,ys=1027,B_=1028,Od=1029,z_=1030,Fd=1031,Bd=1033,Xc=33776,qc=33777,Yc=33778,Zc=33779,Yf=35840,Zf=35841,Jf=35842,jf=35843,zd=36196,Kf=37492,Qf=37496,$f=37808,ed=37809,td=37810,nd=37811,id=37812,rd=37813,sd=37814,od=37815,ad=37816,ld=37817,cd=37818,ud=37819,hd=37820,fd=37821,Jc=36492,dd=36494,pd=36495,k_=36283,md=36284,gd=36285,_d=36286,H_=2200,V_=2201,G_=2202,Ta=2300,Aa=2301,jc=2302,us=2400,hs=2401,ba=2402,uu=2500,kd=2501,bx=0,Cx=1,Rx=2,Hd=3e3,Nr=3001,W_=3200,X_=3201,Br=0,q_=1,ni="",an="srgb",Vi="srgb-linear",hu="display-p3",Va="display-p3-linear",Ca="linear",Nt="srgb",Ra="rec709",Pa="p3",Px=0,as=7680,Lx=7681,Ix=7682,Dx=7683,Nx=34055,Ux=34056,Ox=5386,Fx=512,Bx=513,zx=514,kx=515,Hx=516,Vx=517,Gx=518,vd=519,Y_=512,Z_=513,J_=514,Vd=515,j_=516,K_=517,Q_=518,$_=519,La=35044,Wx=35048,Xx=35040,qx=35045,Yx=35049,Zx=35041,Jx=35046,jx=35050,Kx=35042,Qx="100",yd="300 es",nu=1035,Ti=2e3,So=2001;class ur{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){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let s=0,l=i.length;s<l;s++)i[s].call(this,e);e.target=null}}}const bn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let $m=1234567;const ms=Math.PI/180,Mo=180/Math.PI;function ii(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(bn[r&255]+bn[r>>8&255]+bn[r>>16&255]+bn[r>>24&255]+"-"+bn[e&255]+bn[e>>8&255]+"-"+bn[e>>16&15|64]+bn[e>>24&255]+"-"+bn[t&63|128]+bn[t>>8&255]+"-"+bn[t>>16&255]+bn[t>>24&255]+bn[n&255]+bn[n>>8&255]+bn[n>>16&255]+bn[n>>24&255]).toLowerCase()}function qt(r,e,t){return Math.max(e,Math.min(t,r))}function Gd(r,e){return(r%e+e)%e}function $x(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function eS(r,e,t){return r!==e?(t-r)/(e-r):0}function ga(r,e,t){return(1-t)*r+t*e}function tS(r,e,t,n){return ga(r,e,1-Math.exp(-t*n))}function nS(r,e=1){return e-Math.abs(Gd(r,e*2)-e)}function iS(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function rS(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function sS(r,e){return r+Math.floor(Math.random()*(e-r+1))}function oS(r,e){return r+Math.random()*(e-r)}function aS(r){return r*(.5-Math.random())}function lS(r){r!==void 0&&($m=r);let e=$m+=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 cS(r){return r*ms}function uS(r){return r*Mo}function xd(r){return(r&r-1)===0&&r!==0}function hS(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function iu(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function fS(r,e,t,n,i){const s=Math.cos,l=Math.sin,c=s(t/2),u=l(t/2),h=s((e+n)/2),f=l((e+n)/2),p=s((e-n)/2),m=l((e-n)/2),g=s((n-e)/2),y=l((n-e)/2);switch(i){case"XYX":r.set(c*f,u*p,u*m,c*h);break;case"YZY":r.set(u*m,c*f,u*p,c*h);break;case"ZXZ":r.set(u*p,u*m,c*f,c*h);break;case"XZX":r.set(c*f,u*y,u*g,c*h);break;case"YXY":r.set(u*g,c*f,u*y,c*h);break;case"ZYZ":r.set(u*y,u*g,c*f,c*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function qn(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function ft(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const dS={DEG2RAD:ms,RAD2DEG:Mo,generateUUID:ii,clamp:qt,euclideanModulo:Gd,mapLinear:$x,inverseLerp:eS,lerp:ga,damp:tS,pingpong:nS,smoothstep:iS,smootherstep:rS,randInt:sS,randFloat:oS,randFloatSpread:aS,seededRandom:lS,degToRad:cS,radToDeg:uS,isPowerOfTwo:xd,ceilPowerOfTwo:hS,floorPowerOfTwo:iu,setQuaternionFromProperEuler:fS,normalize:ft,denormalize:qn};class fe{constructor(e=0,t=0){fe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){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: 25,095 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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(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(qt(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),s=this.x-e.x,l=this.y-e.y;return this.x=s*n-l*i+e.x,this.y=s*i+l*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class gt{constructor(e,t,n,i,s,l,c,u,h){gt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,l,c,u,h)}set(e,t,n,i,s,l,c,u,h){const f=this.elements;return f[0]=e,f[1]=i,f[2]=c,f[3]=t,f[4]=s,f[5]=u,f[6]=n,f[7]=l,f[8]=h,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,s=this.elements,l=n[0],c=n[3],u=n[6],h=n[1],f=n[4],p=n[7],m=n[2],g=n[5],y=n[8],M=i[0],x=i[3],v=i[6],w=i[1],E=i[4],A=i[7],N=i[2],R=i[5],L=i[8];return s[0]=l*M+c*w+u*N,s[3]=l*x+c*E+u*R,s[6]=l*v+c*A+u*L,s[1]=h*M+f*w+p*N,s[4]=h*x+f*E+p*R,s[7]=h*v+f*A+p*L,s[2]=m*M+g*w+y*N,s[5]=m*x+g*E+y*R,s[8]=m*v+g*A+y*L,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],s=e[3],l=e[4],c=e[5],u=e[6],h=e[7],f=e[8];return t*l*f-t*c*h-n*s*f+n*c*u+i*s*h-i*l*u}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],l=e[4],c=e[5],u=e[6],h=e[7],f=e[8],p=f*l-c*h,m=c*u-f*s,g=h*s-l*u,y=t*p+n*m+i*g;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const M=1/y;return e[0]=p*M,e[1]=(i*h-f*n)*M,e[2]=(c*n-i*l)*M,e[3]=m*M,e[4]=(f*t-i*u)*M,e[5]=(i*s-c*t)*M,e[6]=g*M,e[7]=(n*u-h*t)*M,e[8]=(l*t-n*s)*M,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,s,l,c){const u=Math.cos(s),h=Math.sin(s);return this.set(n*u,n*h,-n*(u*l+h*c)+l+e,-i*h,i*u,-i*(-h*l+u*c)+c+t,0,0,1),this}scale(e,t){return this.premultiply(Hh.makeScale(e,t)),this}rotate(e){return this.premultiply(Hh.makeRotation(-e)),this}translate(e,t){return this.premultiply(Hh.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)}}const Hh=new gt;function ev(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}const pS={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function fo(r,e){return new pS[r](e)}function Ia(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function tv(){const r=Ia("canvas");return r.style.display="block",r}const eg={};function _a(r){r in eg||(eg[r]=!0,console.warn(r))}const tg=new gt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),ng=new gt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Jl={[Vi]:{transfer:Ca,primaries:Ra,toReference:r=>r,fromReference:r=>r},[an]:{transfer:Nt,primaries:Ra,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[Va]:{transfer:Ca,primaries:Pa,toReference:r=>r.applyMatrix3(ng),fromReference:r=>r.applyMatrix3(tg)},[hu]:{transfer:Nt,primaries:Pa,toReference:r=>r.convertSRGBToLinear().applyMatrix3(ng),fromReference:r=>r.applyMatrix3(tg).convertLinearToSRGB()}},mS=new Set([Vi,Va]),Rt={enabled:!0,_workingColorSpace:Vi,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!mS.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;const n=Jl[e].toReference,i=Jl[t].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return Jl[r].primaries},getTransfer:function(r){return r===ni?Ca:Jl[r].transfer}};function yo(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Vh(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let Hs;class Wd{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Hs===void 0&&(Hs=Ia("canvas")),Hs.width=e.width,Hs.height=e.height;const n=Hs.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Hs}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Ia("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),s=i.data;for(let l=0;l<s.length;l++)s[l]=yo(s[l]/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(yo(t[n]/255)*255):t[n]=yo(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let gS=0;class fs{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:gS++}),this.uuid=ii(),this.data=e,this.version=0}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 s;if(Array.isArray(i)){s=[];for(let l=0,c=i.length;l<c;l++)i[l].isDataTexture?s.push(Gh(i[l].image)):s.push(Gh(i[l]))}else s=Gh(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function Gh(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?Wd.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let _S=0;class tn extends ur{constructor(e=tn.DEFAULT_IMAGE,t=tn.DEFAULT_MAPPING,n=Pn,i=Pn,s=en,l=Or,c=Fn,u=ki,h=tn.DEFAULT_ANISOTROPY,f=ni){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:_S++}),this.uuid=ii(),this.name="",this.source=new fs(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=l,this.anisotropy=h,this.format=c,this.internalFormat=null,this.type=u,this.offset=new fe(0,0),this.repeat=new fe(1,1),this.center=new fe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new gt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,typeof f=="string"?this.colorSpace=f:(_a("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=f===Nr?an:ni),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}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.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==lu)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ea:e.x=e.x-Math.floor(e.x);break;case Pn:e.x=e.x<0?0:1;break;case wa: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 Ea:e.y=e.y-Math.floor(e.y);break;case Pn:e.y=e.y<0?0:1;break;case wa: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)}get encoding(){return _a("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===an?Nr:Hd}set encoding(e){_a("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Nr?an:ni}}tn.DEFAULT_IMAGE=null;tn.DEFAULT_MAPPING=lu;tn.DEFAULT_ANISOTROPY=1;class Pt{constructor(e=0,t=0,n=0,i=1){Pt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=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,s=this.w,l=e.elements;return this.x=l[0]*t+l[4]*n+l[8]*i+l[12]*s,this.y=l[1]*t+l[5]*n+l[9]*i+l[13]*s,this.z=l[2]*t+l[6]*n+l[10]*i+l[14]*s,this.w=l[3]*t+l[7]*n+l[11]*i+l[15]*s,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,s;const u=e.elements,h=u[0],f=u[4],p=u[8],m=u[1],g=u[5],y=u[9],M=u[2],x=u[6],v=u[10];if(Math.abs(f-m)<.01&&Math.abs(p-M)<.01&&Math.abs(y-x)<.01){if(Math.abs(f+m)<.1&&Math.abs(p+M)<.1&&Math.abs(y+x)<.1&&Math.abs(h+g+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const E=(h+1)/2,A=(g+1)/2,N=(v+1)/2,R=(f+m)/4,L=(p+M)/4,z=(y+x)/4;return E>A&&E>N?E<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(E),i=R/n,s=L/n):A>N?A<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(A),n=R/i,s=z/i):N<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(N),n=L/s,i=z/s),this.set(n,i,s,t),this}let w=Math.sqrt((x-y)*(x-y)+(p-M)*(p-M)+(m-f)*(m-f));return Math.abs(w)<.001&&(w=1),this.x=(x-y)/w,this.y=(p-M)/w,this.z=(m-f)/w,this.w=Math.acos((h+g+v-1)/2),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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class nv extends ur{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Pt(0,0,e,t),this.scissorTest=!1,this.viewport=new Pt(0,0,e,t);const i={width:e,height:t,depth:1};n.encoding!==void 0&&(_a("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===Nr?an:ni),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:en,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},n),this.texture=new tn(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps,this.texture.internalFormat=n.internalFormat,this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}setSize(e,t,n=1){(this.width!==e||this.height!==t||this.depth!==n)&&(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,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.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new fs(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ai extends nv{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class fu extends tn{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=$t,this.minFilter=$t,this.wrapR=Pn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class vS extends Ai{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new fu(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class Xd extends tn{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=$t,this.minFilter=$t,this.wrapR=Pn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class yS extends Ai{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new Xd(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class xS extends Ai{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let l=0;l<n;l++)this.texture[l]=s.clone(),this.texture[l].isRenderTargetTexture=!0}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,s=this.texture.length;i<s;i++)this.texture[i].image.width=e,this.texture[i].image.height=t,this.texture[i].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}copy(e){this.dispose(),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.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.texture.length=0;for(let t=0,n=e.texture.length;t<n;t++)this.texture[t]=e.texture[t].clone(),this.texture[t].isRenderTargetTexture=!0;return this}}class Yn{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,s,l,c){let u=n[i+0],h=n[i+1],f=n[i+2],p=n[i+3];const m=s[l+0],g=s[l+1],y=s[l+2],M=s[l+3];if(c===0){e[t+0]=u,e[t+1]=h,e[t+2]=f,e[t+3]=p;return}if(c===1){e[t+0]=m,e[t+1]=g,e[t+2]=y,e[t+3]=M;return}if(p!==M||u!==m||h!==g||f!==y){let x=1-c;const v=u*m+h*g+f*y+p*M,w=v>=0?1:-1,E=1-v*v;if(E>Number.EPSILON){const N=Math.sqrt(E),R=Math.atan2(N,v*w);x=Math.sin(x*R)/N,c=Math.sin(c*R)/N}const A=c*w;if(u=u*x+m*A,h=h*x+g*A,f=f*x+y*A,p=p*x+M*A,x===1-c){const N=1/Math.sqrt(u*u+h*h+f*f+p*p);u*=N,h*=N,f*=N,p*=N}}e[t]=u,e[t+1]=h,e[t+2]=f,e[t+3]=p}static multiplyQuaternionsFlat(e,t,n,i,s,l){const c=n[i],u=n[i+1],h=n[i+2],f=n[i+3],p=s[l],m=s[l+1],g=s[l+2],y=s[l+3];return e[t]=c*y+f*p+u*g-h*m,e[t+1]=u*y+f*m+h*p-c*g,e[t+2]=h*y+f*g+c*m-u*p,e[t+3]=f*y-c*p-u*m-h*g,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,s=e._z,l=e._order,c=Math.cos,u=Math.sin,h=c(n/2),f=c(i/2),p=c(s/2),m=u(n/2),g=u(i/2),y=u(s/2);switch(l){case"XYZ":this._x=m*f*p+h*g*y,this._y=h*g*p-m*f*y,this._z=h*f*y+m*g*p,this._w=h*f*p-m*g*y;break;case"YXZ":this._x=m*f*p+h*g*y,this._y=h*g*p-m*f*y,this._z=h*f*y-m*g*p,this._w=h*f*p+m*g*y;break;case"ZXY":this._x=m*f*p-h*g*y,this._y=h*g*p+m*f*y,this._z=h*f*y+m*g*p,this._w=h*f*p-m*g*y;break;case"ZYX":this._x=m*f*p-h*g*y,this._y=h*g*p+m*f*y,this._z=h*f*y-m*g*p,this._w=h*f*p+m*g*y;break;case"YZX":this._x=m*f*p+h*g*y,this._y=h*g*p+m*f*y,this._z=h*f*y-m*g*p,this._w=h*f*p-m*g*y;break;case"XZY":this._x=m*f*p-h*g*y,this._y=h*g*p-m*f*y,this._z=h*f*y+m*g*p,this._w=h*f*p+m*g*y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}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],s=t[8],l=t[1],c=t[5],u=t[9],h=t[2],f=t[6],p=t[10],m=n+c+p;if(m>0){const g=.5/Math.sqrt(m+1);this._w=.25/g,this._x=(f-u)*g,this._y=(s-h)*g,this._z=(l-i)*g}else if(n>c&&n>p){const g=2*Math.sqrt(1+n-c-p);
vendor: 4,140 bytes, line 5
5this._w=(f-u)/g,this._x=.25*g,this._y=(i+l)/g,this._z=(s+h)/g}else if(c>p){const g=2*Math.sqrt(1+c-n-p);this._w=(s-h)/g,this._x=(i+l)/g,this._y=.25*g,this._z=(u+f)/g}else{const g=2*Math.sqrt(1+p-n-c);this._w=(l-i)/g,this._x=(s+h)/g,this._y=(u+f)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(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(qt(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,s=e._z,l=e._w,c=t._x,u=t._y,h=t._z,f=t._w;return this._x=n*f+l*c+i*h-s*u,this._y=i*f+l*u+s*c-n*h,this._z=s*f+l*h+n*u-i*c,this._w=l*f-n*c-i*u-s*h,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,s=this._z,l=this._w;let c=l*e._w+n*e._x+i*e._y+s*e._z;if(c<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,c=-c):this.copy(e),c>=1)return this._w=l,this._x=n,this._y=i,this._z=s,this;const u=1-c*c;if(u<=Number.EPSILON){const g=1-t;return this._w=g*l+t*this._w,this._x=g*n+t*this._x,this._y=g*i+t*this._y,this._z=g*s+t*this._z,this.normalize(),this}const h=Math.sqrt(u),f=Math.atan2(h,c),p=Math.sin((1-t)*f)/h,m=Math.sin(t*f)/h;return this._w=l*p+this._w*m,this._x=n*p+this._x*m,this._y=i*p+this._y*m,this._z=s*p+this._z*m,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(i),n*Math.sin(s),n*Math.cos(s),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class U{constructor(e=0,t=0,n=0){U.prototype.isVector3=!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("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){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}
vendor: 38,574 bytes, line 5
5sub(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(ig.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ig.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,l=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*l,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*l,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*l,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,l=e.y,c=e.z,u=e.w,h=2*(l*i-c*n),f=2*(c*t-s*i),p=2*(s*n-l*t);return this.x=t+u*h+l*p-c*f,this.y=n+u*f+c*h-s*p,this.z=i+u*p+s*f-l*h,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,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(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,s=e.z,l=t.x,c=t.y,u=t.z;return this.x=i*u-s*c,this.y=s*l-n*u,this.z=n*c-i*l,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 Wh.copy(this).projectOnVector(e),this.sub(Wh)}reflect(e){return this.sub(Wh.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(qt(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()-.5)*2,t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Wh=new U,ig=new Yn;class zn{constructor(e=new U(1/0,1/0,1/0),t=new U(-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(vi.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(vi.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=vi.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 s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let l=0,c=s.count;l<c;l++)e.isMesh===!0?e.getVertexPosition(l,vi):vi.fromBufferAttribute(s,l),vi.applyMatrix4(e.matrixWorld),this.expandByPoint(vi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),jl.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),jl.copy(n.boundingBox)),jl.applyMatrix4(e.matrixWorld),this.union(jl)}const i=e.children;for(let s=0,l=i.length;s<l;s++)this.expandByObject(i[s],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,vi),vi.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(Qo),Kl.subVectors(this.max,Qo),Vs.subVectors(e.a,Qo),Gs.subVectors(e.b,Qo),Ws.subVectors(e.c,Qo),xr.subVectors(Gs,Vs),Sr.subVectors(Ws,Gs),Kr.subVectors(Vs,Ws);let t=[0,-xr.z,xr.y,0,-Sr.z,Sr.y,0,-Kr.z,Kr.y,xr.z,0,-xr.x,Sr.z,0,-Sr.x,Kr.z,0,-Kr.x,-xr.y,xr.x,0,-Sr.y,Sr.x,0,-Kr.y,Kr.x,0];return!Xh(t,Vs,Gs,Ws,Kl)||(t=[1,0,0,0,1,0,0,0,1],!Xh(t,Vs,Gs,Ws,Kl))?!1:(Ql.crossVectors(xr,Sr),t=[Ql.x,Ql.y,Ql.z],Xh(t,Vs,Gs,Ws,Kl))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,vi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(vi).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:(Ki[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ki[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ki[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ki[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ki[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ki[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ki[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ki[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ki),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)}}const Ki=[new U,new U,new U,new U,new U,new U,new U,new U],vi=new U,jl=new zn,Vs=new U,Gs=new U,Ws=new U,xr=new U,Sr=new U,Kr=new U,Qo=new U,Kl=new U,Ql=new U,Qr=new U;function Xh(r,e,t,n,i){for(let s=0,l=r.length-3;s<=l;s+=3){Qr.fromArray(r,s);const c=i.x*Math.abs(Qr.x)+i.y*Math.abs(Qr.y)+i.z*Math.abs(Qr.z),u=e.dot(Qr),h=t.dot(Qr),f=n.dot(Qr);if(Math.max(-Math.max(u,h,f),Math.min(u,h,f))>c)return!1}return!0}const SS=new zn,$o=new U,qh=new U;class Ln{constructor(e=new U,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):SS.setFromPoints(e).getCenter(n);let i=0;for(let s=0,l=e.length;s<l;s++)i=Math.max(i,n.distanceToSquared(e[s]));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;$o.subVectors(e,this.center);const t=$o.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector($o,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):(qh.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint($o.copy(e.center).add(qh)),this.expandByPoint($o.copy(e.center).sub(qh))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Qi=new U,Yh=new U,$l=new U,Mr=new U,Zh=new U,ec=new U,Jh=new U;class bo{constructor(e=new U,t=new U(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,Qi)),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=Qi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Qi.copy(this.origin).addScaledVector(this.direction,t),Qi.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){Yh.copy(e).add(t).multiplyScalar(.5),$l.copy(t).sub(e).normalize(),Mr.copy(this.origin).sub(Yh);const s=e.distanceTo(t)*.5,l=-this.direction.dot($l),c=Mr.dot(this.direction),u=-Mr.dot($l),h=Mr.lengthSq(),f=Math.abs(1-l*l);let p,m,g,y;if(f>0)if(p=l*u-c,m=l*c-u,y=s*f,p>=0)if(m>=-y)if(m<=y){const M=1/f;p*=M,m*=M,g=p*(p+l*m+2*c)+m*(l*p+m+2*u)+h}else m=s,p=Math.max(0,-(l*m+c)),g=-p*p+m*(m+2*u)+h;else m=-s,p=Math.max(0,-(l*m+c)),g=-p*p+m*(m+2*u)+h;else m<=-y?(p=Math.max(0,-(-l*s+c)),m=p>0?-s:Math.min(Math.max(-s,-u),s),g=-p*p+m*(m+2*u)+h):m<=y?(p=0,m=Math.min(Math.max(-s,-u),s),g=m*(m+2*u)+h):(p=Math.max(0,-(l*s+c)),m=p>0?s:Math.min(Math.max(-s,-u),s),g=-p*p+m*(m+2*u)+h);else m=l>0?-s:s,p=Math.max(0,-(l*m+c)),g=-p*p+m*(m+2*u)+h;return n&&n.copy(this.origin).addScaledVector(this.direction,p),i&&i.copy(Yh).addScaledVector($l,m),g}intersectSphere(e,t){Qi.subVectors(e.center,this.origin);const n=Qi.dot(this.direction),i=Qi.dot(Qi)-n*n,s=e.radius*e.radius;if(i>s)return null;const l=Math.sqrt(s-i),c=n-l,u=n+l;return u<0?null:c<0?this.at(u,t):this.at(c,t)}intersectsSphere(e){return 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,s,l,c,u;const h=1/this.direction.x,f=1/this.direction.y,p=1/this.direction.z,m=this.origin;return h>=0?(n=(e.min.x-m.x)*h,i=(e.max.x-m.x)*h):(n=(e.max.x-m.x)*h,i=(e.min.x-m.x)*h),f>=0?(s=(e.min.y-m.y)*f,l=(e.max.y-m.y)*f):(s=(e.max.y-m.y)*f,l=(e.min.y-m.y)*f),n>l||s>i||((s>n||isNaN(n))&&(n=s),(l<i||isNaN(i))&&(i=l),p>=0?(c=(e.min.z-m.z)*p,u=(e.max.z-m.z)*p):(c=(e.max.z-m.z)*p,u=(e.min.z-m.z)*p),n>u||c>i)||((c>n||n!==n)&&(n=c),(u<i||i!==i)&&(i=u),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Qi)!==null}intersectTriangle(e,t,n,i,s){Zh.subVectors(t,e),ec.subVectors(n,e),Jh.crossVectors(Zh,ec);let l=this.direction.dot(Jh),c;if(l>0){if(i)return null;c=1}else if(l<0)c=-1,l=-l;else return null;Mr.subVectors(this.origin,e);const u=c*this.direction.dot(ec.crossVectors(Mr,ec));if(u<0)return null;const h=c*this.direction.dot(Zh.cross(Mr));if(h<0||u+h>l)return null;const f=-c*Mr.dot(Jh);return f<0?null:this.at(f/l,s)}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 tt{constructor(e,t,n,i,s,l,c,u,h,f,p,m,g,y,M,x){tt.prototype.isMatrix4=!0,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,s,l,c,u,h,f,p,m,g,y,M,x)}set(e,t,n,i,s,l,c,u,h,f,p,m,g,y,M,x){const v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=i,v[1]=s,v[5]=l,v[9]=c,v[13]=u,v[2]=h,v[6]=f,v[10]=p,v[14]=m,v[3]=g,v[7]=y,v[11]=M,v[15]=x,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 tt().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 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){const t=this.elements,n=e.elements,i=1/Xs.setFromMatrixColumn(e,0).length(),s=1/Xs.setFromMatrixColumn(e,1).length(),l=1/Xs.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]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*l,t[9]=n[9]*l,t[10]=n[10]*l,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,s=e.z,l=Math.cos(n),c=Math.sin(n),u=Math.cos(i),h=Math.sin(i),f=Math.cos(s),p=Math.sin(s);if(e.order==="XYZ"){const m=l*f,g=l*p,y=c*f,M=c*p;t[0]=u*f,t[4]=-u*p,t[8]=h,t[1]=g+y*h,t[5]=m-M*h,t[9]=-c*u,t[2]=M-m*h,t[6]=y+g*h,t[10]=l*u}else if(e.order==="YXZ"){const m=u*f,g=u*p,y=h*f,M=h*p;t[0]=m+M*c,t[4]=y*c-g,t[8]=l*h,t[1]=l*p,t[5]=l*f,t[9]=-c,t[2]=g*c-y,t[6]=M+m*c,t[10]=l*u}else if(e.order==="ZXY"){const m=u*f,g=u*p,y=h*f,M=h*p;t[0]=m-M*c,t[4]=-l*p,t[8]=y+g*c,t[1]=g+y*c,t[5]=l*f,t[9]=M-m*c,t[2]=-l*h,t[6]=c,t[10]=l*u}else if(e.order==="ZYX"){const m=l*f,g=l*p,y=c*f,M=c*p;t[0]=u*f,t[4]=y*h-g,t[8]=m*h+M,t[1]=u*p,t[5]=M*h+m,t[9]=g*h-y,t[2]=-h,t[6]=c*u,t[10]=l*u}else if(e.order==="YZX"){const m=l*u,g=l*h,y=c*u,M=c*h;t[0]=u*f,t[4]=M-m*p,t[8]=y*p+g,t[1]=p,t[5]=l*f,t[9]=-c*f,t[2]=-h*f,t[6]=g*p+y,t[10]=m-M*p}else if(e.order==="XZY"){const m=l*u,g=l*h,y=c*u,M=c*h;t[0]=u*f,t[4]=-p,t[8]=h*f,t[1]=m*p+M,t[5]=l*f,t[9]=g*p-y,t[2]=y*p-g,t[6]=c*f,t[10]=M*p+m}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(MS,e,ES)}lookAt(e,t,n){const i=this.elements;return ei.subVectors(e,t),ei.lengthSq()===0&&(ei.z=1),ei.normalize(),Er.crossVectors(n,ei),Er.lengthSq()===0&&(Math.abs(n.z)===1?ei.x+=1e-4:ei.z+=1e-4,ei.normalize(),Er.crossVectors(n,ei)),Er.normalize(),tc.crossVectors(ei,Er),i[0]=Er.x,i[4]=tc.x,i[8]=ei.x,i[1]=Er.y,i[5]=tc.y,i[9]=ei.y,i[2]=Er.z,i[6]=tc.z,i[10]=ei.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,s=this.elements,l=n[0],c=n[4],u=n[8],h=n[12],f=n[1],p=n[5],m=n[9],g=n[13],y=n[2],M=n[6],x=n[10],v=n[14],w=n[3],E=n[7],A=n[11],N=n[15],R=i[0],L=i[4],z=i[8],b=i[12],P=i[1],B=i[5],Q=i[9],ce=i[13],V=i[2],J=i[6],ee=i[10],le=i[14],F=i[3],H=i[7],W=i[11],Y=i[15];return s[0]=l*R+c*P+u*V+h*F,s[4]=l*L+c*B+u*J+h*H,s[8]=l*z+c*Q+u*ee+h*W,s[12]=l*b+c*ce+u*le+h*Y,s[1]=f*R+p*P+m*V+g*F,s[5]=f*L+p*B+m*J+g*H,s[9]=f*z+p*Q+m*ee+g*W,s[13]=f*b+p*ce+m*le+g*Y,s[2]=y*R+M*P+x*V+v*F,s[6]=y*L+M*B+x*J+v*H,s[10]=y*z+M*Q+x*ee+v*W,s[14]=y*b+M*ce+x*le+v*Y,s[3]=w*R+E*P+A*V+N*F,s[7]=w*L+E*B+A*J+N*H,s[11]=w*z+E*Q+A*ee+N*W,s[15]=w*b+E*ce+A*le+N*Y,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],s=e[12],l=e[1],c=e[5],u=e[9],h=e[13],f=e[2],p=e[6],m=e[10],g=e[14],y=e[3],M=e[7],x=e[11],v=e[15];return y*(+s*u*p-i*h*p-s*c*m+n*h*m+i*c*g-n*u*g)+M*(+t*u*g-t*h*m+s*l*m-i*l*g+i*h*f-s*u*f)+x*(+t*h*p-t*c*g-s*l*p+n*l*g+s*c*f-n*h*f)+v*(-i*c*f-t*u*p+t*c*m+i*l*p-n*l*m+n*u*f)}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],s=e[3],l=e[4],c=e[5],u=e[6],h=e[7],f=e[8],p=e[9],m=e[10],g=e[11],y=e[12],M=e[13],x=e[14],v=e[15],w=p*x*h-M*m*h+M*u*g-c*x*g-p*u*v+c*m*v,E=y*m*h-f*x*h-y*u*g+l*x*g+f*u*v-l*m*v,A=f*M*h-y*p*h+y*c*g-l*M*g-f*c*v+l*p*v,N=y*p*u-f*M*u-y*c*m+l*M*m+f*c*x-l*p*x,R=t*w+n*E+i*A+s*N;if(R===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const L=1/R;return e[0]=w*L,e[1]=(M*m*s-p*x*s-M*i*g+n*x*g+p*i*v-n*m*v)*L,e[2]=(c*x*s-M*u*s+M*i*h-n*x*h-c*i*v+n*u*v)*L,e[3]=(p*u*s-c*m*s-p*i*h+n*m*h+c*i*g-n*u*g)*L,e[4]=E*L,e[5]=(f*x*s-y*m*s+y*i*g-t*x*g-f*i*v+t*m*v)*L,e[6]=(y*u*s-l*x*s-y*i*h+t*x*h+l*i*v-t*u*v)*L,e[7]=(l*m*s-f*u*s+f*i*h-t*m*h-l*i*g+t*u*g)*L,e[8]=A*L,e[9]=(y*p*s-f*M*s-y*n*g+t*M*g+f*n*v-t*p*v)*L,e[10]=(l*M*s-y*c*s+y*n*h-t*M*h-l*n*v+t*c*v)*L,e[11]=(f*c*s-l*p*s-f*n*h+t*p*h+l*n*g-t*c*g)*L,e[12]=N*L,e[13]=(f*M*i-y*p*i+y*n*m-t*M*m-f*n*x+t*p*x)*L,e[14]=(y*c*i-l*M*i-y*n*u+t*M*u+l*n*x-t*c*x)*L,e[15]=(l*p*i-f*c*i+f*n*u-t*p*u-l*n*m+t*c*m)*L,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,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),s=1-n,l=e.x,c=e.y,u=e.z,h=s*l,f=s*c;return this.set(h*l+n,h*c-i*u,h*u+i*c,0,h*c+i*u,f*c+n,f*u-i*l,0,h*u-i*c,f*u+i*l,s*u*u+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,s,l){return this.set(1,n,s,0,e,1,l,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,l=t._y,c=t._z,u=t._w,h=s+s,f=l+l,p=c+c,m=s*h,g=s*f,y=s*p,M=l*f,x=l*p,v=c*p,w=u*h,E=u*f,A=u*p,N=n.x,R=n.y,L=n.z;return i[0]=(1-(M+v))*N,i[1]=(g+A)*N,i[2]=(y-E)*N,i[3]=0,i[4]=(g-A)*R,i[5]=(1-(m+v))*R,i[6]=(x+w)*R,i[7]=0,i[8]=(y+E)*L,i[9]=(x-w)*L,i[10]=(1-(m+M))*L,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;let s=Xs.set(i[0],i[1],i[2]).length();const l=Xs.set(i[4],i[5],i[6]).length(),c=Xs.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],yi.copy(this);const h=1/s,f=1/l,p=1/c;return yi.elements[0]*=h,yi.elements[1]*=h,yi.elements[2]*=h,yi.elements[4]*=f,yi.elements[5]*=f,yi.elements[6]*=f,yi.elements[8]*=p,yi.elements[9]*=p,yi.elements[10]*=p,t.setFromRotationMatrix(yi),n.x=s,n.y=l,n.z=c,this}makePerspective(e,t,n,i,s,l,c=Ti){const u=this.elements,h=2*s/(t-e),f=2*s/(n-i),p=(t+e)/(t-e),m=(n+i)/(n-i);let g,y;if(c===Ti)g=-(l+s)/(l-s),y=-2*l*s/(l-s);else if(c===So)g=-l/(l-s),y=-l*s/(l-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return u[0]=h,u[4]=0,u[8]=p,u[12]=0,u[1]=0,u[5]=f,u[9]=m,u[13]=0,u[2]=0,u[6]=0,u[10]=g,u[14]=y,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(e,t,n,i,s,l,c=Ti){const u=this.elements,h=1/(t-e),f=1/(n-i),p=1/(l-s),m=(t+e)*h,g=(n+i)*f;let y,M;if(c===Ti)y=(l+s)*p,M=-2*p;else if(c===So)y=s*p,M=-1*p;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return u[0]=2*h,u[4]=0,u[8]=0,u[12]=-m,u[1]=0,u[5]=2*f,u[9]=0,u[13]=-g,u[2]=0,u[6]=0,u[10]=M,u[14]=-y,u[3]=0,u[7]=0,u[11]=0,u[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}}const Xs=new U,yi=new tt,MS=new U(0,0,0),ES=new U(1,1,1),Er=new U,tc=new U,ei=new U,rg=new tt,sg=new Yn;class Ga{constructor(e=0,t=0,n=0,i=Ga.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,s=i[0],l=i[4],c=i[8],u=i[1],h=i[5],f=i[9],p=i[2],m=i[6],g=i[10];switch(t){case"XYZ":this._y=Math.asin(qt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-f,g),this._z=Math.atan2(-l,s)):(this._x=Math.atan2(m,h),this._z=0);break;case"YXZ":this._x=Math.asin(-qt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(c,g),this._z=Math.atan2(u,h)):(this._y=Math.atan2(-p,s),this._z=0);break;case"ZXY":this._x=Math.asin(qt(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-p,g),this._z=Math.atan2(-l,h)):(this._y=0,this._z=Math.atan2(u,s));break;case"ZYX":this._y=Math.asin(-qt(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(m,g),this._z=Math.atan2(u,s)):(this._x=0,this._z=Math.atan2(-l,h));break;case"YZX":this._z=Math.asin(qt(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-f,h),this._y=Math.atan2(-p,s)):(this._x=0,this._y=Math.atan2(c,g));break;case"XZY":this._z=Math.asin(-qt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(m,h),this._y=Math.atan2(c,s)):(this._x=Math.atan2(-f,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return rg.makeRotationFromQuaternion(e),this.setFromRotationMatrix(rg,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sg.setFromEuler(this),this.setFromQuaternion(sg,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}}Ga.DEFAULT_ORDER="XYZ";class gs{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 wS=0;const og=new U,qs=new Yn,$i=new tt,nc=new U,ea=new U,TS=new U,AS=new Yn,ag=new U(1,0,0),lg=new U(0,1,0),cg=new U(0,0,1),bS={type:"added"},CS={type:"removed"};class At extends ur{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:wS++}),this.uuid=ii(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=At.DEFAULT_UP.clone();const e=new U,t=new Ga,n=new Yn,i=new U(1,1,1);function s(){n.setFromEuler(t,!1)}function l(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(l),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 tt},normalMatrix:{value:new gt}}),this.matrix=new tt,this.matrixWorld=new tt,this.matrixAutoUpdate=At.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=At.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new gs,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}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 qs.setFromAxisAngle(e,t),this.quaternion.multiply(qs),this}rotateOnWorldAxis(e,t){return qs.setFromAxisAngle(e,t),this.quaternion.premultiply(qs),this}rotateX(e){return this.rotateOnAxis(ag,e)}rotateY(e){return this.rotateOnAxis(lg,e)}rotateZ(e){return this.rotateOnAxis(cg,e)}translateOnAxis(e,t){return og.copy(e).applyQuaternion(this.quaternion),this.position.add(og.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(ag,e)}translateY(e){return this.translateOnAxis(lg,e)}translateZ(e){return this.translateOnAxis(cg,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4($i.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?nc.copy(e):nc.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),ea.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?$i.lookAt(ea,nc,this.up):$i.lookAt(nc,ea,this.up),this.quaternion.setFromRotationMatrix($i),i&&($i.extractRotation(i.matrixWorld),qs.setFromRotationMatrix($i),this.quaternion.premultiply(qs.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(bS)):console.error("THREE.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(CS)),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),$i.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),$i.multiply(e.parent.matrixWorld)),e.applyMatrix4($i),this.add(e),e.updateWorldMatrix(!1,!0),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 l=this.children[n].getObjectByProperty(e,t);if(l!==void 0)return l}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].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(ea,e,TS),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ea,AS,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),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(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++){const s=t[n];(s.matrixWorldAutoUpdate===!0||e===!0)&&s.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const i=this.children;for(let s=0,l=i.length;s<l;s++){const c=i[s];c.matrixWorldAutoUpdate===!0&&c.updateWorldMatrix(!1,!0)}}}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.6,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),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(c=>({boxInitialized:c.boxInitialized,boxMin:c.box.min.toArray(),boxMax:c.box.max.toArray(),sphereInitialized:c.sphereInitialized,sphereRadius:c.sphere.radius,sphereCenter:c.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(c,u){return c[u.uuid]===void 0&&(c[u.uuid]=u.toJSON(e)),u.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=s(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const u=c.shapes;if(Array.isArray(u))for(let h=0,f=u.length;h<f;h++){const p=u[h];s(e.shapes,p)}else s(e.shapes,u)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const c=[];for(let u=0,h=this.material.length;u<h;u++)c.push(s(e.materials,this.material[u]));i.material=c}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let c=0;c<this.children.length;c++)i.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let c=0;c<this.animations.length;c++){const u=this.animations[c];i.animations.push(s(e.animations,u))}}if(t){const c=l(e.geometries),u=l(e.materials),h=l(e.textures),f=l(e.images),p=l(e.shapes),m=l(e.skeletons),g=l(e.animations),y=l(e.nodes);c.length>0&&(n.geometries=c),u.length>0&&(n.materials=u),h.length>0&&(n.textures=h),f.length>0&&(n.images=f),p.length>0&&(n.shapes=p),m.length>0&&(n.skeletons=m),g.length>0&&(n.animations=g),y.length>0&&(n.nodes=y)}return n.object=i,n;function l(c){const u=[];for(const h in c){const f=c[h];delete f.metadata,u.push(f)}return u}}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.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.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}}At.DEFAULT_UP=new U(0,1,0);At.DEFAULT_MATRIX_AUTO_UPDATE=!0;At.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;
vendor: 12,908 bytes, line 5
5const xi=new U,er=new U,jh=new U,tr=new U,Ys=new U,Zs=new U,ug=new U,Kh=new U,Qh=new U,$h=new U;let ic=!1;class Xn{constructor(e=new U,t=new U,n=new U){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),xi.subVectors(e,t),i.cross(xi);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){xi.subVectors(i,t),er.subVectors(n,t),jh.subVectors(e,t);const l=xi.dot(xi),c=xi.dot(er),u=xi.dot(jh),h=er.dot(er),f=er.dot(jh),p=l*h-c*c;if(p===0)return s.set(0,0,0),null;const m=1/p,g=(h*u-c*f)*m,y=(l*f-c*u)*m;return s.set(1-g-y,y,g)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,tr)===null?!1:tr.x>=0&&tr.y>=0&&tr.x+tr.y<=1}static getUV(e,t,n,i,s,l,c,u){return ic===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),ic=!0),this.getInterpolation(e,t,n,i,s,l,c,u)}static getInterpolation(e,t,n,i,s,l,c,u){return this.getBarycoord(e,t,n,i,tr)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(s,tr.x),u.addScaledVector(l,tr.y),u.addScaledVector(c,tr.z),u)}static isFrontFacing(e,t,n,i){return xi.subVectors(n,t),er.subVectors(e,t),xi.cross(er).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 xi.subVectors(this.c,this.b),er.subVectors(this.a,this.b),xi.cross(er).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Xn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Xn.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return ic===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),ic=!0),Xn.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}getInterpolation(e,t,n,i,s){return Xn.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return Xn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Xn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let l,c;Ys.subVectors(i,n),Zs.subVectors(s,n),Kh.subVectors(e,n);const u=Ys.dot(Kh),h=Zs.dot(Kh);if(u<=0&&h<=0)return t.copy(n);Qh.subVectors(e,i);const f=Ys.dot(Qh),p=Zs.dot(Qh);if(f>=0&&p<=f)return t.copy(i);const m=u*p-f*h;if(m<=0&&u>=0&&f<=0)return l=u/(u-f),t.copy(n).addScaledVector(Ys,l);$h.subVectors(e,s);const g=Ys.dot($h),y=Zs.dot($h);if(y>=0&&g<=y)return t.copy(s);const M=g*h-u*y;if(M<=0&&h>=0&&y<=0)return c=h/(h-y),t.copy(n).addScaledVector(Zs,c);const x=f*y-g*p;if(x<=0&&p-f>=0&&g-y>=0)return ug.subVectors(s,i),c=(p-f)/(p-f+(g-y)),t.copy(i).addScaledVector(ug,c);const v=1/(x+M+m);return l=M*v,c=m*v,t.copy(n).addScaledVector(Ys,l).addScaledVector(Zs,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const iv={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},wr={h:0,s:0,l:0},rc={h:0,s:0,l:0};function ef(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class Ie{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=an){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Rt.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=Rt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Rt.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=Rt.workingColorSpace){if(e=Gd(e,1),t=qt(t,0,1),n=qt(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,l=2*n-s;this.r=ef(l,s,e+1/3),this.g=ef(l,s,e),this.b=ef(l,s,e-1/3)}return Rt.toWorkingColorSpace(this,i),this}setStyle(e,t=an){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const l=i[1],c=i[2];switch(l){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],l=s.length;if(l===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=an){const n=iv[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.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=yo(e.r),this.g=yo(e.g),this.b=yo(e.b),this}copyLinearToSRGB(e){return this.r=Vh(e.r),this.g=Vh(e.g),this.b=Vh(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=an){return Rt.fromWorkingColorSpace(Cn.copy(this),e),Math.round(qt(Cn.r*255,0,255))*65536+Math.round(qt(Cn.g*255,0,255))*256+Math.round(qt(Cn.b*255,0,255))}getHexString(e=an){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Rt.workingColorSpace){Rt.fromWorkingColorSpace(Cn.copy(this),t);const n=Cn.r,i=Cn.g,s=Cn.b,l=Math.max(n,i,s),c=Math.min(n,i,s);let u,h;const f=(c+l)/2;if(c===l)u=0,h=0;else{const p=l-c;switch(h=f<=.5?p/(l+c):p/(2-l-c),l){case n:u=(i-s)/p+(i<s?6:0);break;case i:u=(s-n)/p+2;break;case s:u=(n-i)/p+4;break}u/=6}return e.h=u,e.s=h,e.l=f,e}getRGB(e,t=Rt.workingColorSpace){return Rt.fromWorkingColorSpace(Cn.copy(this),t),e.r=Cn.r,e.g=Cn.g,e.b=Cn.b,e}getStyle(e=an){Rt.fromWorkingColorSpace(Cn.copy(this),e);const t=Cn.r,n=Cn.g,i=Cn.b;return e!==an?`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(wr),this.setHSL(wr.h+e,wr.s+t,wr.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}lerpColors(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(wr),e.getHSL(rc);const n=ga(wr.h,rc.h,t),i=ga(wr.s,rc.s,t),s=ga(wr.l,rc.l,t);return this.setHSL(n,i,s),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,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[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 Cn=new Ie;Ie.NAMES=iv;let RS=0;class In extends ur{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:RS++}),this.uuid=ii(),this.name="",this.type="Material",this.blending=ps,this.side=ar,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=$c,this.blendDst=eu,this.blendEquation=Rr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ie(0,0,0),this.blendAlpha=0,this.depthFunc=xa,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=vd,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=as,this.stencilZFail=as,this.stencilZPass=as,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}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){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};
vendor: 19,918 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&&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.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.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!==ps&&(n.blending=this.blending),this.side!==ar&&(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!==$c&&(n.blendSrc=this.blendSrc),this.blendDst!==eu&&(n.blendDst=this.blendDst),this.blendEquation!==Rr&&(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!==xa&&(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!==vd&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==as&&(n.stencilFail=this.stencilFail),this.stencilZFail!==as&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==as&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){const l=[];for(const c in s){const u=s[c];delete u.metadata,l.push(u)}return l}if(t){const s=i(e.textures),l=i(e.images);s.length>0&&(n.textures=s),l.length>0&&(n.images=l)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.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++}}class zr extends In{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ie(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Ha,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.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 ir=PS();function PS(){const r=new ArrayBuffer(4),e=new Float32Array(r),t=new Uint32Array(r),n=new Uint32Array(512),i=new Uint32Array(512);for(let u=0;u<256;++u){const h=u-127;h<-27?(n[u]=0,n[u|256]=32768,i[u]=24,i[u|256]=24):h<-14?(n[u]=1024>>-h-14,n[u|256]=1024>>-h-14|32768,i[u]=-h-1,i[u|256]=-h-1):h<=15?(n[u]=h+15<<10,n[u|256]=h+15<<10|32768,i[u]=13,i[u|256]=13):h<128?(n[u]=31744,n[u|256]=64512,i[u]=24,i[u|256]=24):(n[u]=31744,n[u|256]=64512,i[u]=13,i[u|256]=13)}const s=new Uint32Array(2048),l=new Uint32Array(64),c=new Uint32Array(64);for(let u=1;u<1024;++u){let h=u<<13,f=0;for(;(h&8388608)===0;)h<<=1,f-=8388608;h&=-8388609,f+=947912704,s[u]=h|f}for(let u=1024;u<2048;++u)s[u]=939524096+(u-1024<<13);for(let u=1;u<31;++u)l[u]=u<<23;l[31]=1199570944,l[32]=2147483648;for(let u=33;u<63;++u)l[u]=2147483648+(u-32<<23);l[63]=3347054592;for(let u=1;u<64;++u)u!==32&&(c[u]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:l,offsetTable:c}}function Wn(r){Math.abs(r)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),r=qt(r,-65504,65504),ir.floatView[0]=r;const e=ir.uint32View[0],t=e>>23&511;return ir.baseTable[t]+((e&8388607)>>ir.shiftTable[t])}function ha(r){const e=r>>10;return ir.uint32View[0]=ir.mantissaTable[ir.offsetTable[e]+(r&1023)]+ir.exponentTable[e],ir.floatView[0]}const LS={toHalfFloat:Wn,fromHalfFloat:ha},sn=new U,sc=new fe;class bt{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=La,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=wi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}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,s=this.itemSize;i<s;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++)sc.fromBufferAttribute(this,t),sc.applyMatrix3(e),this.setXY(t,sc.x,sc.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)sn.fromBufferAttribute(this,t),sn.applyMatrix3(e),this.setXYZ(t,sn.x,sn.y,sn.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)sn.fromBufferAttribute(this,t),sn.applyMatrix4(e),this.setXYZ(t,sn.x,sn.y,sn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)sn.fromBufferAttribute(this,t),sn.applyNormalMatrix(e),this.setXYZ(t,sn.x,sn.y,sn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)sn.fromBufferAttribute(this,t),sn.transformDirection(e),this.setXYZ(t,sn.x,sn.y,sn.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=qn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=ft(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=qn(t,this.array)),t}setX(e,t){return this.normalized&&(t=ft(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=qn(t,this.array)),t}setY(e,t){return this.normalized&&(t=ft(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=qn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=ft(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=qn(t,this.array)),t}setW(e,t){return this.normalized&&(t=ft(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=ft(t,this.array),n=ft(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=ft(t,this.array),n=ft(n,this.array),i=ft(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=ft(t,this.array),n=ft(n,this.array),i=ft(i,this.array),s=ft(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,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!==La&&(e.usage=this.usage),e}}class IS extends bt{constructor(e,t,n){super(new Int8Array(e),t,n)}}class DS extends bt{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class NS extends bt{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class US extends bt{constructor(e,t,n){super(new Int16Array(e),t,n)}}class qd extends bt{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class OS extends bt{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Yd extends bt{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class FS extends bt{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=ha(this.array[e*this.itemSize]);return this.normalized&&(t=qn(t,this.array)),t}setX(e,t){return this.normalized&&(t=ft(t,this.array)),this.array[e*this.itemSize]=Wn(t),this}getY(e){let t=ha(this.array[e*this.itemSize+1]);return this.normalized&&(t=qn(t,this.array)),t}setY(e,t){return this.normalized&&(t=ft(t,this.array)),this.array[e*this.itemSize+1]=Wn(t),this}getZ(e){let t=ha(this.array[e*this.itemSize+2]);return this.normalized&&(t=qn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=ft(t,this.array)),this.array[e*this.itemSize+2]=Wn(t),this}getW(e){let t=ha(this.array[e*this.itemSize+3]);return this.normalized&&(t=qn(t,this.array)),t}setW(e,t){return this.normalized&&(t=ft(t,this.array)),this.array[e*this.itemSize+3]=Wn(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=ft(t,this.array),n=ft(n,this.array)),this.array[e+0]=Wn(t),this.array[e+1]=Wn(n),this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=ft(t,this.array),n=ft(n,this.array),i=ft(i,this.array)),this.array[e+0]=Wn(t),this.array[e+1]=Wn(n),this.array[e+2]=Wn(i),this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=ft(t,this.array),n=ft(n,this.array),i=ft(i,this.array),s=ft(s,this.array)),this.array[e+0]=Wn(t),this.array[e+1]=Wn(n),this.array[e+2]=Wn(i),this.array[e+3]=Wn(s),this}}class Be extends bt{constructor(e,t,n){super(new Float32Array(e),t,n)}}class BS extends bt{constructor(e,t,n){super(new Float64Array(e),t,n)}}let zS=0;const mi=new tt,tf=new At,Js=new U,ti=new zn,ta=new zn,_n=new U;class dt extends ur{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:zS++}),this.uuid=ii(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(ev(e)?Yd:qd)(e,1):this.index=e,this}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 s=new gt().getNormalMatrix(e);n.applyNormalMatrix(s),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}applyQuaternion(e){return mi.makeRotationFromQuaternion(e),this.applyMatrix4(mi),this}rotateX(e){return mi.makeRotationX(e),this.applyMatrix4(mi),this}rotateY(e){return mi.makeRotationY(e),this.applyMatrix4(mi),this}rotateZ(e){return mi.makeRotationZ(e),this.applyMatrix4(mi),this}translate(e,t,n){return mi.makeTranslation(e,t,n),this.applyMatrix4(mi),this}scale(e,t,n){return mi.makeScale(e,t,n),this.applyMatrix4(mi),this}lookAt(e){return tf.lookAt(e),tf.updateMatrix(),this.applyMatrix4(tf.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Js).negate(),this.translate(Js.x,Js.y,Js.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const s=e[n];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Be(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new zn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "fal
5se".',this),this.boundingBox.set(new U(-1/0,-1/0,-1/0),new U(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 s=t[n];ti.setFromBufferAttribute(s),this.morphTargetsRelative?(_n.addVectors(this.boundingBox.min,ti.min),this.boundingBox.expandByPoint(_n),_n.addVectors(this.boundingBox.max,ti.max),this.boundingBox.expandByPoint(_n)):(this.boundingBox.expandByPoint(ti.min),this.boundingBox.expandByPoint(ti.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ln);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "fal
5se".',this),this.boundingSphere.set(new U,1/0);return}if(e){const n=this.boundingSphere.center;if(ti.setFromBufferAttribute(e),t)for(let s=0,l=t.length;s<l;s++){const c=t[s];ta.setFromBufferAttribute(c),this.morphTargetsRelative?(_n.addVectors(ti.min,ta.min),ti.expandByPoint(_n),_n.addVectors(ti.max,ta.max),ti.expandByPoint(_n)):(ti.expandByPoint(ta.min),ti.expandByPoint(ta.max))}ti.getCenter(n);let i=0;for(let s=0,l=e.count;s<l;s++)_n.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(_n));if(t)for(let s=0,l=t.length;s<l;s++){const c=t[s],u=this.morphTargetsRelative;for(let h=0,f=c.count;h<f;h++)_n.fromBufferAttribute(c,h),u&&(Js.fromBufferAttribute(e,h),_n.add(Js)),i=Math.max(i,n.distanceToSquared(_n))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=e.array,i=t.position.array,s=t.normal.array,l=t.uv.array,c=i.length/3;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new bt(new Float32Array(4*c),4));const u=this.getAttribute("tangent").array,h=[],f=[];for(let P=0;P<c;P++)h[P]=new U,f[P]=new U;const p=new U,m=new U,g=new U,y=new fe,M=new fe,x=new fe,v=new U,w=new U;function E(P,B,Q){p.fromArray(i,P*3),m.fromArray(i,B*3),g.fromArray(i,Q*3),y.fromArray(l,P*2),M.fromArray(l,B*2),x.fromArray(l,Q*2),m.sub(p),g.sub(p),M.sub(y),x.sub(y);const ce=1/(M.x*x.y-x.x*M.y);isFinite(ce)&&(v.copy(m).multiplyScalar(x.y).addScaledVector(g,-M.y).multiplyScalar(ce),w.copy(g).multiplyScalar(M.x).addScaledVector(m,-x.x).multiplyScalar(ce),h[P].add(v),h[B].add(v),h[Q].add(v),f[P].add(w),f[B].add(w),f[Q].add(w))}let A=this.groups;A.length===0&&(A=[{start:0,count:n.length}]);for(let P=0,B=A.length;P<B;++P){const Q=A[P],ce=Q.start,V=Q.count;for(let J=ce,ee=ce+V;J<ee;J+=3)E(n[J+0],n[J+1],n[J+2])}const N=new U,R=new U,L=new U,z=new U;function b(P){L.fromArray(s,P*3),z.copy(L);const B=h[P];N.copy(B),N.sub(L.multiplyScalar(L.dot(B))).normalize(),R.crossVectors(z,B);const ce=R.dot(f[P])<0?-1:1;u[P*4]=N.x,u[P*4+1]=N.y,u[P*4+2]=N.z,u[P*4+3]=ce}for(let P=0,B=A.length;P<B;++P){const Q=A[P],ce=Q.start,V=Q.count;for(let J=ce,ee=ce+V;J<ee;J+=3)b(n[J+0]),b(n[J+1]),b(n[J+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new bt(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let m=0,g=n.count;m<g;m++)n.setXYZ(m,0,0,0);const i=new U,s=new U,l=new U,c=new U,u=new U,h=new U,f=new U,p=new U;if(e)for(let m=0,g=e.count;m<g;m+=3){const y=e.getX(m+0),M=e.getX(m+1),x=e.getX(m+2);i.fromBufferAttribute(t,y),s.fromBufferAttribute(t,M),l.fromBufferAttribute(t,x),f.subVectors(l,s),p.subVectors(i,s),f.cross(p),c.fromBufferAttribute(n,y),u.fromBufferAttribute(n,M),h.fromBufferAttribute(n,x),c.add(f),u.add(f),h.add(f),n.setXYZ(y,c.x,c.y,c.z),n.setXYZ(M,u.x,u.y,u.z),n.setXYZ(x,h.x,h.y,h.z)}else for(let m=0,g=t.count;m<g;m+=3)i.fromBufferAttribute(t,m+0),s.fromBufferAttribute(t,m+1),l.fromBufferAttribute(t,m+2),f.subVectors(l,s),p.subVectors(i,s),f.cross(p),n.setXYZ(m+0,f.x,f.y,f.z),n.setXYZ(m+1,f.x,f.y,f.z),n.setXYZ(m+2,f.x,f.y,f.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)_n.fromBufferAttribute(e,t),_n.normalize(),e.setXYZ(t,_n.x,_n.y,_n.z)}toNonIndexed(){function e(c,u){const h=c.array,f=c.itemSize,p=c.normalized,m=new h.constructor(u.length*f);let g=0,y=0;for(let M=0,x=u.length;M<x;M++){c.isInterleavedBufferAttribute?g=u[M]*c.data.stride+c.offset:g=u[M]*f;for(let v=0;v<f;v++)m[y++]=h[g++]}return new bt(m,f,p)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new dt,n=this.index.array,i=this.attributes;for(const c in i){const u=i[c],h=e(u,n);t.setAttribute(c,h)}const s=this.morphAttributes;for(const c in s){const u=[],h=s[c];for(let f=0,p=h.length;f<p;f++){const m=h[f],g=e(m,n);u.push(g)}t.morphAttributes[c]=u}t.morphTargetsRelative=this.morphTargetsRelative;const l=this.groups;for(let c=0,u=l.length;c<u;c++){const h=l[c];t.addGroup(h.start,h.count,h.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
vendor: 26,201 bytes, lines 5-98
5if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const u=this.parameters;for(const h in u)u[h]!==void 0&&(e[h]=u[h]);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 u in n){const h=n[u];e.data.attributes[u]=h.toJSON(e.data)}const i={};let s=!1;for(const u in this.morphAttributes){const h=this.morphAttributes[u],f=[];for(let p=0,m=h.length;p<m;p++){const g=h[p];f.push(g.toJSON(e.data))}f.length>0&&(i[u]=f,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),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(t));const i=e.attributes;for(const h in i){const f=i[h];this.setAttribute(h,f.clone(t))}const s=e.morphAttributes;for(const h in s){const f=[],p=s[h];for(let m=0,g=p.length;m<g;m++)f.push(p[m].clone(t));this.morphAttributes[h]=f}this.morphTargetsRelative=e.morphTargetsRelative;const l=e.groups;for(let h=0,f=l.length;h<f;h++){const p=l[h];this.addGroup(p.start,p.count,p.materialIndex)}const c=e.boundingBox;c!==null&&(this.boundingBox=c.clone());const u=e.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const hg=new tt,$r=new bo,oc=new Ln,fg=new U,js=new U,Ks=new U,Qs=new U,nf=new U,ac=new U,lc=new fe,cc=new fe,uc=new fe,dg=new U,pg=new U,mg=new U,hc=new U,fc=new U;class ln extends At{constructor(e=new dt,t=new zr){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,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 s=0,l=i.length;s<l;s++){const c=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=s}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,l=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const c=this.morphTargetInfluences;if(s&&c){ac.set(0,0,0);for(let u=0,h=s.length;u<h;u++){const f=c[u],p=s[u];f!==0&&(nf.fromBufferAttribute(p,e),l?ac.addScaledVector(nf,f):ac.addScaledVector(nf.sub(t),f))}t.add(ac)}return t}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),oc.copy(n.boundingSphere),oc.applyMatrix4(s),$r.copy(e.ray).recast(e.near),!(oc.containsPoint($r.origin)===!1&&($r.intersectSphere(oc,fg)===null||$r.origin.distanceToSquared(fg)>(e.far-e.near)**2))&&(hg.copy(s).invert(),$r.copy(e.ray).applyMatrix4(hg),!(n.boundingBox!==null&&$r.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,$r)))}_computeIntersections(e,t,n){let i;const s=this.geometry,l=this.material,c=s.index,u=s.attributes.position,h=s.attributes.uv,f=s.attributes.uv1,p=s.attributes.normal,m=s.groups,g=s.drawRange;if(c!==null)if(Array.isArray(l))for(let y=0,M=m.length;y<M;y++){const x=m[y],v=l[x.materialIndex],w=Math.max(x.start,g.start),E=Math.min(c.count,Math.min(x.start+x.count,g.start+g.count));for(let A=w,N=E;A<N;A+=3){const R=c.getX(A),L=c.getX(A+1),z=c.getX(A+2);i=dc(this,v,e,n,h,f,p,R,L,z),i&&(i.faceIndex=Math.floor(A/3),i.face.materialIndex=x.materialIndex,t.push(i))}}else{const y=Math.max(0,g.start),M=Math.min(c.count,g.start+g.count);for(let x=y,v=M;x<v;x+=3){const w=c.getX(x),E=c.getX(x+1),A=c.getX(x+2);i=dc(this,l,e,n,h,f,p,w,E,A),i&&(i.faceIndex=Math.floor(x/3),t.push(i))}}else if(u!==void 0)if(Array.isArray(l))for(let y=0,M=m.length;y<M;y++){const x=m[y],v=l[x.materialIndex],w=Math.max(x.start,g.start),E=Math.min(u.count,Math.min(x.start+x.count,g.start+g.count));for(let A=w,N=E;A<N;A+=3){const R=A,L=A+1,z=A+2;i=dc(this,v,e,n,h,f,p,R,L,z),i&&(i.faceIndex=Math.floor(A/3),i.face.materialIndex=x.materialIndex,t.push(i))}}else{const y=Math.max(0,g.start),M=Math.min(u.count,g.start+g.count);for(let x=y,v=M;x<v;x+=3){const w=x,E=x+1,A=x+2;i=dc(this,l,e,n,h,f,p,w,E,A),i&&(i.faceIndex=Math.floor(x/3),t.push(i))}}}}function kS(r,e,t,n,i,s,l,c){let u;if(e.side===Bn?u=n.intersectTriangle(l,s,i,!0,c):u=n.intersectTriangle(i,s,l,e.side===ar,c),u===null)return null;fc.copy(c),fc.applyMatrix4(r.matrixWorld);const h=t.ray.origin.distanceTo(fc);return h<t.near||h>t.far?null:{distance:h,point:fc.clone(),object:r}}function dc(r,e,t,n,i,s,l,c,u,h){r.getVertexPosition(c,js),r.getVertexPosition(u,Ks),r.getVertexPosition(h,Qs);const f=kS(r,e,t,n,js,Ks,Qs,hc);if(f){i&&(lc.fromBufferAttribute(i,c),cc.fromBufferAttribute(i,u),uc.fromBufferAttribute(i,h),f.uv=Xn.getInterpolation(hc,js,Ks,Qs,lc,cc,uc,new fe)),s&&(lc.fromBufferAttribute(s,c),cc.fromBufferAttribute(s,u),uc.fromBufferAttribute(s,h),f.uv1=Xn.getInterpolation(hc,js,Ks,Qs,lc,cc,uc,new fe),f.uv2=f.uv1),l&&(dg.fromBufferAttribute(l,c),pg.fromBufferAttribute(l,u),mg.fromBufferAttribute(l,h),f.normal=Xn.getInterpolation(hc,js,Ks,Qs,dg,pg,mg,new U),f.normal.dot(n.direction)>0&&f.normal.multiplyScalar(-1));const p={a:c,b:u,c:h,normal:new U,materialIndex:0};Xn.getNormal(js,Ks,Qs,p.normal),f.face=p}return f}class Ms extends dt{constructor(e=1,t=1,n=1,i=1,s=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:l};const c=this;i=Math.floor(i),s=Math.floor(s),l=Math.floor(l);const u=[],h=[],f=[],p=[];let m=0,g=0;y("z","y","x",-1,-1,n,t,e,l,s,0),y("z","y","x",1,-1,n,t,-e,l,s,1),y("x","z","y",1,1,e,n,t,i,l,2),y("x","z","y",1,-1,e,n,-t,i,l,3),y("x","y","z",1,-1,e,t,n,i,s,4),y("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(u),this.setAttribute("position",new Be(h,3)),this.setAttribute("normal",new Be(f,3)),this.setAttribute("uv",new Be(p,2));function y(M,x,v,w,E,A,N,R,L,z,b){const P=A/L,B=N/z,Q=A/2,ce=N/2,V=R/2,J=L+1,ee=z+1;let le=0,F=0;const H=new U;for(let W=0;W<ee;W++){const Y=W*B-ce;for(let oe=0;oe<J;oe++){const j=oe*P-Q;H[M]=j*w,H[x]=Y*E,H[v]=V,h.push(H.x,H.y,H.z),H[M]=0,H[x]=0,H[v]=R>0?1:-1,f.push(H.x,H.y,H.z),p.push(oe/L),p.push(1-W/z),le+=1}}for(let W=0;W<z;W++)for(let Y=0;Y<L;Y++){const oe=m+Y+J*W,j=m+Y+J*(W+1),ae=m+(Y+1)+J*(W+1),xe=m+(Y+1)+J*W;u.push(oe,j,xe),u.push(j,ae,xe),F+=6}c.addGroup(g,F,b),g+=F,m+=le}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ms(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Eo(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function On(r){const e={};for(let t=0;t<r.length;t++){const n=Eo(r[t]);for(const i in n)e[i]=n[i]}return e}function HS(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function rv(r){return r.getRenderTarget()===null?r.outputColorSpace:Rt.workingColorSpace}const sv={clone:Eo,merge:On};var VS=`void main() {
6	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
7}`,GS=`void main() {
8	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
9}`;class Gi extends In{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=VS,this.fragmentShader=GS,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!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=Eo(e.uniforms),this.uniformsGroups=HS(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}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const l=this.uniforms[i].value;l&&l.isTexture?t.uniforms[i]={type:"t",value:l.toJSON(e).uuid}:l&&l.isColor?t.uniforms[i]={type:"c",value:l.getHex()}:l&&l.isVector2?t.uniforms[i]={type:"v2",value:l.toArray()}:l&&l.isVector3?t.uniforms[i]={type:"v3",value:l.toArray()}:l&&l.isVector4?t.uniforms[i]={type:"v4",value:l.toArray()}:l&&l.isMatrix3?t.uniforms[i]={type:"m3",value:l.toArray()}:l&&l.isMatrix4?t.uniforms[i]={type:"m4",value:l.toArray()}:t.uniforms[i]={value:l}}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}}class Wa extends At{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new tt,this.projectionMatrix=new tt,this.projectionMatrixInverse=new tt,this.coordinateSystem=Ti}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.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class vn extends Wa{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=Mo*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ms*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Mo*2*Math.atan(Math.tan(ms*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,l){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=s,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(ms*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i;const l=this.view;if(this.view!==null&&this.view.enabled){const u=l.fullWidth,h=l.fullHeight;s+=l.offsetX*i/u,t-=l.offsetY*n/h,i*=l.width/u,n*=l.height/h}const c=this.filmOffset;c!==0&&(s+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far,this.coordinateSystem),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}}const $s=-90,eo=1;class ov extends At{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new vn($s,eo,e,t);i.layers=this.layers,this.add(i);const s=new vn($s,eo,e,t);s.layers=this.layers,this.add(s);const l=new vn($s,eo,e,t);l.layers=this.layers,this.add(l);const c=new vn($s,eo,e,t);c.layers=this.layers,this.add(c);const u=new vn($s,eo,e,t);u.layers=this.layers,this.add(u);const h=new vn($s,eo,e,t);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,s,l,c,u]=t;for(const h of t)this.remove(h);if(e===Ti)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),l.up.set(0,0,1),l.lookAt(0,-1,0),c.up.set(0,1,0),c.lookAt(0,0,1),u.up.set(0,1,0),u.lookAt(0,0,-1);else if(e===So)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),l.up.set(0,0,-1),l.lookAt(0,-1,0),c.up.set(0,-1,0),c.lookAt(0,0,1),u.up.set(0,-1,0),u.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const h of t)this.add(h),h.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[s,l,c,u,h,f]=this.children,p=e.getRenderTarget(),m=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),y=e.xr.enabled;e.xr.enabled=!1;const M=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,s),e.setRenderTarget(n,1,i),e.render(t,l),e.setRenderTarget(n,2,i),e.render(t,c),e.setRenderTarget(n,3,i),e.render(t,u),e.setRenderTarget(n,4,i),e.render(t,h),n.texture.generateMipmaps=M,e.setRenderTarget(n,5,i),e.render(t,f),e.setRenderTarget(p,m,g),e.xr.enabled=y,n.texture.needsPMREMUpdate=!0}}class Xa extends tn{constructor(e,t,n,i,s,l,c,u,h,f){e=e!==void 0?e:[],t=t!==void 0?t:lr,super(e,t,n,i,s,l,c,u,h,f),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class av extends Ai{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},i=[n,n,n,n,n,n];t.encoding!==void 0&&(_a("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===Nr?an:ni),this.texture=new Xa(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:en}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:`
10
11				varying vec3 vWorldDirection;
12
13				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
14
15					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
16
17				}
18
19				void main() {
20
21					vWorldDirection = transformDirection( position, modelMatrix );
22
23					#include <begin_vertex>
24					#include <project_vertex>
25
26				}
27			`,fragmentShader:`
28
29				uniform sampler2D tEquirect;
30
31				varying vec3 vWorldDirection;
32
33				#include <common>
34
35				void main() {
36
37					vec3 direction = normalize( vWorldDirection );
38
39					vec2 sampleUV = equirectUv( direction );
40
41					gl_FragColor = texture2D( tEquirect, sampleUV );
42
43				}
44			`},i=new Ms(5,5,5),s=new Gi({name:"CubemapFromEquirect",uniforms:Eo(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Bn,blending:or});s.uniforms.tEquirect.value=t;const l=new ln(i,s),c=t.minFilter;return t.minFilter===Or&&(t.minFilter=en),new ov(1,10,this).update(e,l),t.minFilter=c,l.geometry.dispose(),l.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let l=0;l<6;l++)e.setRenderTarget(this,l),e.clear(t,n,i);e.setRenderTarget(s)}}const rf=new U,WS=new U,XS=new gt;class Cr{constructor(e=new U(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=rf.subVectors(n,t).cross(WS.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){const n=e.delta(rf),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}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||XS.getNormalMatrix(e),i=this.coplanarPoint(rf).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),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 es=new Ln,pc=new U;class qa{constructor(e=new Cr,t=new Cr,n=new Cr,i=new Cr,s=new Cr,l=new Cr){this.planes=[e,t,n,i,s,l]}set(e,t,n,i,s,l){const c=this.planes;return c[0].copy(e),c[1].copy(t),c[2].copy(n),c[3].copy(i),c[4].copy(s),c[5].copy(l),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=Ti){const n=this.planes,i=e.elements,s=i[0],l=i[1],c=i[2],u=i[3],h=i[4],f=i[5],p=i[6],m=i[7],g=i[8],y=i[9],M=i[10],x=i[11],v=i[12],w=i[13],E=i[14],A=i[15];if(n[0].setComponents(u-s,m-h,x-g,A-v).normalize(),n[1].setComponents(u+s,m+h,x+g,A+v).normalize(),n[2].setComponents(u+l,m+f,x+y,A+w).normalize(),n[3].setComponents(u-l,m-f,x-y,A-w).normalize(),n[4].setComponents(u-c,m-p,x-M,A-E).normalize(),t===Ti)n[5].setComponents(u+c,m+p,x+M,A+E).normalize();else if(t===So)n[5].setComponents(c,p,M,E).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(),es.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),es.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(es)}intersectsSprite(e){return es.center.set(0,0,0),es.radius=.7071067811865476,es.applyMatrix4(e.matrixWorld),this.intersectsSphere(es)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].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(pc.x=i.normal.x>0?e.max.x:e.min.x,pc.y=i.normal.y>0?e.max.y:e.min.y,pc.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(pc)<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)}}function lv(){let r=null,e=!1,t=null,n=null;function i(s,l){t(s,l),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function qS(r,e){const t=e.isWebGL2,n=new WeakMap;function i(h,f){const p=h.array,m=h.usage,g=p.byteLength,y=r.createBuffer();r.bindBuffer(f,y),r.bufferData(f,p,m),h.onUploadCallback();let M;if(p instanceof Float32Array)M=r.FLOAT;else if(p instanceof Uint16Array)if(h.isFloat16BufferAttribute)if(t)M=r.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else M=r.UNSIGNED_SHORT;else if(p instanceof Int16Array)M=r.SHORT;else if(p instanceof Uint32Array)M=r.UNSIGNED_INT;else if(p instanceof Int32Array)M=r.INT;else if(p instanceof Int8Array)M=r.BYTE;else if(p instanceof Uint8Array)M=r.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)M=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:y,type:M,bytesPerElement:p.BYTES_PER_ELEMENT,version:h.version,size:g}}function s(h,f,p){const m=f.array,g=f._updateRange,y=f.updateRanges;if(r.bindBuffer(p,h),g.count===-1&&y.length===0&&r.bufferSubData(p,0,m),y.length!==0){for(let M=0,x=y.length;M<x;M++){const v=y[M];t?r.bufferSubData(p,v.start*m.BYTES_PER_ELEMENT,m,v.start,v.count):r.bufferSubData(p,v.start*m.BYTES_PER_ELEMENT,m.subarray(v.start,v.start+v.count))}f.clearUpdateRanges()}g.count!==-1&&(t?r.bufferSubData(p,g.offset*m.BYTES_PER_ELEMENT,m,g.offset,g.count):r.bufferSubData(p,g.offset*m.BYTES_PER_ELEMENT,m.subarray(g.offset,g.offset+g.count)),g.count=-1),f.onUploadCallback()}function l(h){return h.isInterleavedBufferAttribute&&(h=h.data),n.get(h)}function c(h){h.isInterleavedBufferAttribute&&(h=h.data);const f=n.get(h);f&&(r.deleteBuffer(f.buffer),n.delete(h))}function u(h,f){if(h.isGLBufferAttribute){const m=n.get(h);(!m||m.version<h.version)&&n.set(h,{buffer:h.buffer,type:h.type,bytesPerElement:h.elementSize,version:h.version});return}h.isInterleavedBufferAttribute&&(h=h.data);const p=n.get(h);if(p===void 0)n.set(h,i(h,f));else if(p.version<h.version){if(p.size!==h.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.");s(p.buffer,h,f),p.version=h.version}}return{get:l,remove:c,update:u}}class Ya extends dt{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const s=e/2,l=t/2,c=Math.floor(n),u=Math.floor(i),h=c+1,f=u+1,p=e/c,m=t/u,g=[],y=[],M=[],x=[];for(let v=0;v<f;v++){const w=v*m-l;for(let E=0;E<h;E++){const A=E*p-s;y.push(A,-w,0),M.push(0,0,1),x.push(E/c),x.push(1-v/u)}}for(let v=0;v<u;v++)for(let w=0;w<c;w++){const E=w+h*v,A=w+h*(v+1),N=w+1+h*(v+1),R=w+1+h*v;g.push(E,A,R),g.push(A,N,R)}this.setIndex(g),this.setAttribute("position",new Be(y,3)),this.setAttribute("normal",new Be(M,3)),this.setAttribute("uv",new Be(x,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ya(e.width,e.height,e.widthSegments,e.heightSegments)}}var YS=`#ifdef USE_ALPHAHASH
45	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
46#endif`,ZS=`#ifdef USE_ALPHAHASH
47	const float ALPHA_HASH_SCALE = 0.05;
48	float hash2D( vec2 value ) {
49		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
50	}
51	float hash3D( vec3 value ) {
52		return hash2D( vec2( hash2D( value.xy ), value.z ) );
53	}
54	float getAlphaHashThreshold( vec3 position ) {
55		float maxDeriv = max(
56			length( dFdx( position.xyz ) ),
57			length( dFdy( position.xyz ) )
58		);
59		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
60		vec2 pixScales = vec2(
61			exp2( floor( log2( pixScale ) ) ),
62			exp2( ceil( log2( pixScale ) ) )
63		);
64		vec2 alpha = vec2(
65			hash3D( floor( pixScales.x * position.xyz ) ),
66			hash3D( floor( pixScales.y * position.xyz ) )
67		);
68		float lerpFactor = fract( log2( pixScale ) );
69		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
70		float a = min( lerpFactor, 1.0 - lerpFactor );
71		vec3 cases = vec3(
72			x * x / ( 2.0 * a * ( 1.0 - a ) ),
73			( x - 0.5 * a ) / ( 1.0 - a ),
74			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
75		);
76		float threshold = ( x < ( 1.0 - a ) )
77			? ( ( x < a ) ? cases.x : cases.y )
78			: cases.z;
79		return clamp( threshold , 1.0e-6, 1.0 );
80	}
81#endif`,JS=`#ifdef USE_ALPHAMAP
82	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
83#endif`,jS=`#ifdef USE_ALPHAMAP
84	uniform sampler2D alphaMap;
85#endif`,KS=`#ifdef USE_ALPHATEST
86	if ( diffuseColor.a < alphaTest ) discard;
87#endif`,QS=`#ifdef USE_ALPHATEST
88	uniform float alphaTest;
89#endif`,$S=`#ifdef USE_AOMAP
90	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
91	reflectedLight.indirectDiffuse *= ambientOcclusion;
92	#if defined( USE_CLEARCOAT ) 
93		clearcoatSpecularIndirect *= ambientOcclusion;
94	#endif
95	#if defined( USE_SHEEN ) 
96		sheenSpecularIndirect *= ambientOcclusion;
97	#endif
98	#if defined( USE_ENVMAP ) && defined( STANDARD )
99		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
100		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
101	#endif
102#endif`,eM=`#ifdef USE_AOMAP
103	uniform sampler2D aoMap;
104	uniform float aoMapIntensity;
105#endif`,tM=`#ifdef USE_BATCHING
106	attribute float batchId;
107	uniform highp sampler2D batchingTexture;
108	mat4 getBatchingMatrix( const in float i ) {
109		int size = textureSize( batchingTexture, 0 ).x;
110		int j = int( i ) * 4;
111		int x = j % size;
112		int y = j / size;
113		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
114		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
115		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
116		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
117		return mat4( v1, v2, v3, v4 );
118	}
119#endif`,nM=`#ifdef USE_BATCHING
120	mat4 batchingMatrix = getBatchingMatrix( batchId );
121#endif`,iM=`vec3 transformed = vec3( position );
122#ifdef USE_ALPHAHASH
123	vPosition = vec3( position );
124#endif`,rM=`vec3 objectNormal = vec3( normal );
125#ifdef USE_TANGENT
126	vec3 objectTangent = vec3( tangent.xyz );
127#endif`,sM=`float G_BlinnPhong_Implicit( ) {
128	return 0.25;
129}
130float D_BlinnPhong( const in float shininess, const in float dotNH ) {
131	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
132}
133vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
134	vec3 halfDir = normalize( lightDir + viewDir );
135	float dotNH = saturate( dot( normal, halfDir ) );
136	float dotVH = saturate( dot( viewDir, halfDir ) );
137	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
138	float G = G_BlinnPhong_Implicit( );
139	float D = D_BlinnPhong( shininess, dotNH );
140	return F * ( G * D );
141} // validated`,oM=`#ifdef USE_IRIDESCENCE
142	const mat3 XYZ_TO_REC709 = mat3(
143		 3.2404542, -0.9692660,  0.0556434,
144		-1.5371385,  1.8760108, -0.2040259,
145		-0.4985314,  0.0415560,  1.0572252
146	);
147	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
148		vec3 sqrtF0 = sqrt( fresnel0 );
149		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
150	}
151	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
152		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
153	}
154	float IorToFresnel0( float transmittedIor, float incidentIor ) {
155		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
156	}
157	vec3 evalSensitivity( float OPD, vec3 shift ) {
158		float phase = 2.0 * PI * OPD * 1.0e-9;
159		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
160		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
161		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
162		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
163		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 ) );
164		xyz /= 1.0685e-7;
165		vec3 rgb = XYZ_TO_REC709 * xyz;
166		return rgb;
167	}
168	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
169		vec3 I;
170		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
171		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
172		float cosTheta2Sq = 1.0 - sinTheta2Sq;
173		if ( cosTheta2Sq < 0.0 ) {
174			return vec3( 1.0 );
175		}
176		float cosTheta2 = sqrt( cosTheta2Sq );
177		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
178		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
179		float T121 = 1.0 - R12;
180		float phi12 = 0.0;
181		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
182		float phi21 = PI - phi12;
183		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
184		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
185		vec3 phi23 = vec3( 0.0 );
186		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
187		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
188		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
189		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
190		vec3 phi = vec3( phi21 ) + phi23;
191		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
192		vec3 r123 = sqrt( R123 );
193		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
194		vec3 C0 = R12 + Rs;
195		I = C0;
196		vec3 Cm = Rs - T121;
197		for ( int m = 1; m <= 2; ++ m ) {
198			Cm *= r123;
199			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
200			I += Cm * Sm;
201		}
202		return max( I, vec3( 0.0 ) );
203	}
204#endif`,aM=`#ifdef USE_BUMPMAP
205	uniform sampler2D bumpMap;
206	uniform float bumpScale;
207	vec2 dHdxy_fwd() {
208		vec2 dSTdx = dFdx( vBumpMapUv );
209		vec2 dSTdy = dFdy( vBumpMapUv );
210		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
211		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
212		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
213		return vec2( dBx, dBy );
214	}
215	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
216		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
217		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
218		vec3 vN = surf_norm;
219		vec3 R1 = cross( vSigmaY, vN );
220		vec3 R2 = cross( vN, vSigmaX );
221		float fDet = dot( vSigmaX, R1 ) * faceDirection;
222		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
223		return normalize( abs( fDet ) * surf_norm - vGrad );
224	}
225#endif`,lM=`#if NUM_CLIPPING_PLANES > 0
226	vec4 plane;
227	#pragma unroll_loop_start
228	for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
229		plane = clippingPlanes[ i ];
230		if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
231	}
232	#pragma unroll_loop_end
233	#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
234		bool clipped = true;
235		#pragma unroll_loop_start
236		for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
237			plane = clippingPlanes[ i ];
238			clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
239		}
240		#pragma unroll_loop_end
241		if ( clipped ) discard;
242	#endif
243#endif`,cM=`#if NUM_CLIPPING_PLANES > 0
244	varying vec3 vClipPosition;
245	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
246#endif`,uM=`#if NUM_CLIPPING_PLANES > 0
247	varying vec3 vClipPosition;
248#endif`,hM=`#if NUM_CLIPPING_PLANES > 0
249	vClipPosition = - mvPosition.xyz;
250#endif`,fM=`#if defined( USE_COLOR_ALPHA )
251	diffuseColor *= vColor;
252#elif defined( USE_COLOR )
253	diffuseColor.rgb *= vColor;
254#endif`,dM=`#if defined( USE_COLOR_ALPHA )
255	varying vec4 vColor;
256#elif defined( USE_COLOR )
257	varying vec3 vColor;
258#endif`,pM=`#if defined( USE_COLOR_ALPHA )
259	varying vec4 vColor;
260#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
261	varying vec3 vColor;
262#endif`,mM=`#if defined( USE_COLOR_ALPHA )
263	vColor = vec4( 1.0 );
264#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
265	vColor = vec3( 1.0 );
266#endif
267#ifdef USE_COLOR
268	vColor *= color;
269#endif
270#ifdef USE_INSTANCING_COLOR
271	vColor.xyz *= instanceColor.xyz;
272#endif`,gM=`#define PI 3.141592653589793
273#define PI2 6.283185307179586
274#define PI_HALF 1.5707963267948966
275#define RECIPROCAL_PI 0.3183098861837907
276#define RECIPROCAL_PI2 0.15915494309189535
277#define EPSILON 1e-6
278#ifndef saturate
279#define saturate( a ) clamp( a, 0.0, 1.0 )
280#endif
281#define whiteComplement( a ) ( 1.0 - saturate( a ) )
282float pow2( const in float x ) { return x*x; }
283vec3 pow2( const in vec3 x ) { return x*x; }
284float pow3( const in float x ) { return x*x*x; }
285float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
286float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
287float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
288highp float rand( const in vec2 uv ) {
289	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
290	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
291	return fract( sin( sn ) * c );
292}
293#ifdef HIGH_PRECISION
294	float precisionSafeLength( vec3 v ) { return length( v ); }
295#else
296	float precisionSafeLength( vec3 v ) {
297		float maxComponent = max3( abs( v ) );
298		return length( v / maxComponent ) * maxComponent;
299	}
300#endif
301struct IncidentLight {
302	vec3 color;
303	vec3 direction;
304	bool visible;
305};
306struct ReflectedLight {
307	vec3 directDiffuse;
308	vec3 directSpecular;
309	vec3 indirectDiffuse;
310	vec3 indirectSpecular;
311};
312#ifdef USE_ALPHAHASH
313	varying vec3 vPosition;
314#endif
315vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
316	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
317}
318vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
319	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
320}
321mat3 transposeMat3( const in mat3 m ) {
322	mat3 tmp;
323	tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
324	tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
325	tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
326	return tmp;
327}
328float luminance( const in vec3 rgb ) {
329	const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );
330	return dot( weights, rgb );
331}
332bool isPerspectiveMatrix( mat4 m ) {
333	return m[ 2 ][ 3 ] == - 1.0;
334}
335vec2 equirectUv( in vec3 dir ) {
336	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
337	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
338	return vec2( u, v );
339}
340vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
341	return RECIPROCAL_PI * diffuseColor;
342}
343vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
344	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
345	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
346}
347float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
348	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
349	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
350} // validated`,_M=`#ifdef ENVMAP_TYPE_CUBE_UV
351	#define cubeUV_minMipLevel 4.0
352	#define cubeUV_minTileSize 16.0
353	float getFace( vec3 direction ) {
354		vec3 absDirection = abs( direction );
355		float face = - 1.0;
356		if ( absDirection.x > absDirection.z ) {
357			if ( absDirection.x > absDirection.y )
358				face = direction.x > 0.0 ? 0.0 : 3.0;
359			else
360				face = direction.y > 0.0 ? 1.0 : 4.0;
361		} else {
362			if ( absDirection.z > absDirection.y )
363				face = direction.z > 0.0 ? 2.0 : 5.0;
364			else
365				face = direction.y > 0.0 ? 1.0 : 4.0;
366		}
367		return face;
368	}
369	vec2 getUV( vec3 direction, float face ) {
370		vec2 uv;
371		if ( face == 0.0 ) {
372			uv = vec2( direction.z, direction.y ) / abs( direction.x );
373		} else if ( face == 1.0 ) {
374			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
375		} else if ( face == 2.0 ) {
376			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
377		} else if ( face == 3.0 ) {
378			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
379		} else if ( face == 4.0 ) {
380			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
381		} else {
382			uv = vec2( direction.x, direction.y ) / abs( direction.z );
383		}
384		return 0.5 * ( uv + 1.0 );
385	}
386	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
387		float face = getFace( direction );
388		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
389		mipInt = max( mipInt, cubeUV_minMipLevel );
390		float faceSize = exp2( mipInt );
391		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
392		if ( face > 2.0 ) {
393			uv.y += faceSize;
394			face -= 3.0;
395		}
396		uv.x += face * faceSize;
397		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
398		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
399		uv.x *= CUBEUV_TEXEL_WIDTH;
400		uv.y *= CUBEUV_TEXEL_HEIGHT;
401		#ifdef texture2DGradEXT
402			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
403		#else
404			return texture2D( envMap, uv ).rgb;
405		#endif
406	}
407	#define cubeUV_r0 1.0
408	#define cubeUV_m0 - 2.0
409	#define cubeUV_r1 0.8
410	#define cubeUV_m1 - 1.0
411	#define cubeUV_r4 0.4
412	#define cubeUV_m4 2.0
413	#define cubeUV_r5 0.305
414	#define cubeUV_m5 3.0
415	#define cubeUV_r6 0.21
416	#define cubeUV_m6 4.0
417	float roughnessToMip( float roughness ) {
418		float mip = 0.0;
419		if ( roughness >= cubeUV_r1 ) {
420			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
421		} else if ( roughness >= cubeUV_r4 ) {
422			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
423		} else if ( roughness >= cubeUV_r5 ) {
424			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
425		} else if ( roughness >= cubeUV_r6 ) {
426			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
427		} else {
428			mip = - 2.0 * log2( 1.16 * roughness );		}
429		return mip;
430	}
431	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
432		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
433		float mipF = fract( mip );
434		float mipInt = floor( mip );
435		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
436		if ( mipF == 0.0 ) {
437			return vec4( color0, 1.0 );
438		} else {
439			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
440			return vec4( mix( color0, color1, mipF ), 1.0 );
441		}
442	}
443#endif`,vM=`vec3 transformedNormal = objectNormal;
444#ifdef USE_TANGENT
445	vec3 transformedTangent = objectTangent;
446#endif
447#ifdef USE_BATCHING
448	mat3 bm = mat3( batchingMatrix );
449	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
450	transformedNormal = bm * transformedNormal;
451	#ifdef USE_TANGENT
452		transformedTangent = bm * transformedTangent;
453	#endif
454#endif
455#ifdef USE_INSTANCING
456	mat3 im = mat3( instanceMatrix );
457	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
458	transformedNormal = im * transformedNormal;
459	#ifdef USE_TANGENT
460		transformedTangent = im * transformedTangent;
461	#endif
462#endif
463transformedNormal = normalMatrix * transformedNormal;
464#ifdef FLIP_SIDED
465	transformedNormal = - transformedNormal;
466#endif
467#ifdef USE_TANGENT
468	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
469	#ifdef FLIP_SIDED
470		transformedTangent = - transformedTangent;
471	#endif
472#endif`,yM=`#ifdef USE_DISPLACEMENTMAP
473	uniform sampler2D displacementMap;
474	uniform float displacementScale;
475	uniform float displacementBias;
476#endif`,xM=`#ifdef USE_DISPLACEMENTMAP
477	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
477placementBias );
478#endif`,SM=`#ifdef USE_EMISSIVEMAP
479	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
480	totalEmissiveRadiance *= emissiveColor.rgb;
481#endif`,MM=`#ifdef USE_EMISSIVEMAP
482	uniform sampler2D emissiveMap;
483#endif`,EM="gl_FragColor = linearToOutputTexel( gl_FragColor );",wM=`
484const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(
485	vec3( 0.8224621, 0.177538, 0.0 ),
486	vec3( 0.0331941, 0.9668058, 0.0 ),
487	vec3( 0.0170827, 0.0723974, 0.9105199 )
488);
489const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(
490	vec3( 1.2249401, - 0.2249404, 0.0 ),
491	vec3( - 0.0420569, 1.0420571, 0.0 ),
492	vec3( - 0.0196376, - 0.0786361, 1.0982735 )
493);
494vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {
495	return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );
496}
497vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {
498	return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );
499}
500vec4 LinearTransferOETF( in vec4 value ) {
501	return value;
502}
503vec4 sRGBTransferOETF( in vec4 value ) {
504	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 );
505}
506vec4 LinearToLinear( in vec4 value ) {
507	return value;
508}
509vec4 LinearTosRGB( in vec4 value ) {
510	return sRGBTransferOETF( value );
511}`,TM=`#ifdef USE_ENVMAP
512	#ifdef ENV_WORLDPOS
513		vec3 cameraToFrag;
514		if ( isOrthographic ) {
515			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
516		} else {
517			cameraToFrag = normalize( vWorldPosition - cameraPosition );
518		}
519		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
520		#ifdef ENVMAP_MODE_REFLECTION
521			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
522		#else
523			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
524		#endif
525	#else
526		vec3 reflectVec = vReflect;
527	#endif
528	#ifdef ENVMAP_TYPE_CUBE
529		vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
530	#else
531		vec4 envColor = vec4( 0.0 );
532	#endif
533	#ifdef ENVMAP_BLENDING_MULTIPLY
534		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
535	#elif defined( ENVMAP_BLENDING_MIX )
536		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
537	#elif defined( ENVMAP_BLENDING_ADD )
538		outgoingLight += envColor.xyz * specularStrength * reflectivity;
539	#endif
540#endif`,AM=`#ifdef USE_ENVMAP
541	uniform float envMapIntensity;
542	uniform float flipEnvMap;
543	#ifdef ENVMAP_TYPE_CUBE
544		uniform samplerCube envMap;
545	#else
546		uniform sampler2D envMap;
547	#endif
548	
549#endif`,bM=`#ifdef USE_ENVMAP
550	uniform float reflectivity;
551	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
552		#define ENV_WORLDPOS
553	#endif
554	#ifdef ENV_WORLDPOS
555		varying vec3 vWorldPosition;
556		uniform float refractionRatio;
557	#else
558		varying vec3 vReflect;
559	#endif
560#endif`,CM=`#ifdef USE_ENVMAP
561	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
562		#define ENV_WORLDPOS
563	#endif
564	#ifdef ENV_WORLDPOS
565		
566		varying vec3 vWorldPosition;
567	#else
568		varying vec3 vReflect;
569		uniform float refractionRatio;
570	#endif
571#endif`,RM=`#ifdef USE_ENVMAP
572	#ifdef ENV_WORLDPOS
573		vWorldPosition = worldPosition.xyz;
574	#else
575		vec3 cameraToVertex;
576		if ( isOrthographic ) {
577			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
578		} else {
579			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
580		}
581		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
582		#ifdef ENVMAP_MODE_REFLECTION
583			vReflect = reflect( cameraToVertex, worldNormal );
584		#else
585			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
586		#endif
587	#endif
588#endif`,PM=`#ifdef USE_FOG
589	vFogDepth = - mvPosition.z;
590#endif`,LM=`#ifdef USE_FOG
591	varying float vFogDepth;
592#endif`,IM=`#ifdef USE_FOG
593	#ifdef FOG_EXP2
594		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
595	#else
596		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
597	#endif
598	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
599#endif`,DM=`#ifdef USE_FOG
600	uniform vec3 fogColor;
601	varying float vFogDepth;
602	#ifdef FOG_EXP2
603		uniform float fogDensity;
604	#else
605		uniform float fogNear;
606		uniform float fogFar;
607	#endif
608#endif`,NM=`#ifdef USE_GRADIENTMAP
609	uniform sampler2D gradientMap;
610#endif
611vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
612	float dotNL = dot( normal, lightDirection );
613	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
614	#ifdef USE_GRADIENTMAP
615		return vec3( texture2D( gradientMap, coord ).r );
616	#else
617		vec2 fw = fwidth( coord ) * 0.5;
618		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
619	#endif
620}`,UM=`#ifdef USE_LIGHTMAP
621	vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
622	vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
623	reflectedLight.indirectDiffuse += lightMapIrradiance;
624#endif`,OM=`#ifdef USE_LIGHTMAP
625	uniform sampler2D lightMap;
626	uniform float lightMapIntensity;
627#endif`,FM=`LambertMaterial material;
628material.diffuseColor = diffuseColor.rgb;
629material.specularStrength = specularStrength;`,BM=`varying vec3 vViewPosition;
630struct LambertMaterial {
631	vec3 diffuseColor;
632	float specularStrength;
633};
634void 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 ) {
635	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
636	vec3 irradiance = dotNL * directLight.color;
637	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
638}
639void 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 ) {
640	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
641}
642#define RE_Direct				RE_Direct_Lambert
643#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,zM=`uniform bool receiveShadow;
644uniform vec3 ambientLightColor;
645#if defined( USE_LIGHT_PROBES )
646	uniform vec3 lightProbe[ 9 ];
647#endif
648vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
649	float x = normal.x, y = normal.y, z = normal.z;
650	vec3 result = shCoefficients[ 0 ] * 0.886227;
651	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
652	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
653	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
654	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
655	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
656	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
657	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
658	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
659	return result;
660}
661vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
662	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
663	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
664	return irradiance;
665}
666vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
667	vec3 irradiance = ambientLightColor;
668	return irradiance;
669}
670float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
671	#if defined ( LEGACY_LIGHTS )
672		if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
673			return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );
674		}
675		return 1.0;
676	#else
677		float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
678		if ( cutoffDistance > 0.0 ) {
679			distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
680		}
681		return distanceFalloff;
682	#endif
683}
684float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
685	return smoothstep( coneCosine, penumbraCosine, angleCosine );
686}
687#if NUM_DIR_LIGHTS > 0
688	struct DirectionalLight {
689		vec3 direction;
690		vec3 color;
691	};
692	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
693	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
694		light.color = directionalLight.color;
695		light.direction = directionalLight.direction;
696		light.visible = true;
697	}
698#endif
699#if NUM_POINT_LIGHTS > 0
700	struct PointLight {
701		vec3 position;
702		vec3 color;
703		float distance;
704		float decay;
705	};
706	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
707	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
708		vec3 lVector = pointLight.position - geometryPosition;
709		light.direction = normalize( lVector );
710		float lightDistance = length( lVector );
711		light.color = pointLight.color;
712		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
713		light.visible = ( light.color != vec3( 0.0 ) );
714	}
715#endif
716#if NUM_SPOT_LIGHTS > 0
717	struct SpotLight {
718		vec3 position;
719		vec3 direction;
720		vec3 color;
721		float distance;
722		float decay;
723		float coneCos;
724		float penumbraCos;
725	};
726	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
727	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
728		vec3 lVector = spotLight.position - geometryPosition;
729		light.direction = normalize( lVector );
730		float angleCos = dot( light.direction, spotLight.direction );
731		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
732		if ( spotAttenuation > 0.0 ) {
733			float lightDistance = length( lVector );
734			light.color = spotLight.color * spotAttenuation;
735			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
736			light.visible = ( light.color != vec3( 0.0 ) );
737		} else {
738			light.color = vec3( 0.0 );
739			light.visible = false;
740		}
741	}
742#endif
743#if NUM_RECT_AREA_LIGHTS > 0
744	struct RectAreaLight {
745		vec3 color;
746		vec3 position;
747		vec3 halfWidth;
748		vec3 halfHeight;
749	};
750	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
751	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
752#endif
753#if NUM_HEMI_LIGHTS > 0
754	struct HemisphereLight {
755		vec3 direction;
756		vec3 skyColor;
757		vec3 groundColor;
758	};
759	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
760	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
761		float dotNL = dot( normal, hemiLight.direction );
762		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
763		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
764		return irradiance;
765	}
766#endif`,kM=`#ifdef USE_ENVMAP
767	vec3 getIBLIrradiance( const in vec3 normal ) {
768		#ifdef ENVMAP_TYPE_CUBE_UV
769			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
770			vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );
771			return PI * envMapColor.rgb * envMapIntensity;
772		#else
773			return vec3( 0.0 );
774		#endif
775	}
776	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
777		#ifdef ENVMAP_TYPE_CUBE_UV
778			vec3 reflectVec = reflect( - viewDir, normal );
779			reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
780			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
781			vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );
782			return envMapColor.rgb * envMapIntensity;
783		#else
784			return vec3( 0.0 );
785		#endif
786	}
787	#ifdef USE_ANISOTROPY
788		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
789			#ifdef ENVMAP_TYPE_CUBE_UV
790				vec3 bentNormal = cross( bitangent, viewDir );
791				bentNormal = normalize( cross( bentNormal, bitangent ) );
792				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
793				return getIBLRadiance( viewDir, bentNormal, roughness );
794			#else
795				return vec3( 0.0 );
796			#endif
797		}
798	#endif
799#endif`,HM=`ToonMaterial material;
800material.diffuseColor = diffuseColor.rgb;`,VM=`varying vec3 vViewPosition;
801struct ToonMaterial {
802	vec3 diffuseColor;
803};
804void 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 ) {
805	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
806	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
807}
808void 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 ) {
809	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
810}
811#define RE_Direct				RE_Direct_Toon
812#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,GM=`BlinnPhongMaterial material;
813material.diffuseColor = diffuseColor.rgb;
814material.specularColor = specular;
815material.specularShininess = shininess;
816material.specularStrength = specularStrength;`,WM=`varying vec3 vViewPosition;
817struct BlinnPhongMaterial {
818	vec3 diffuseColor;
819	vec3 specularColor;
820	float specularShininess;
821	float specularStrength;
822};
823void 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 ) {
824	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
825	vec3 irradiance = dotNL * directLight.color;
826	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
827	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
828}
829void 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 ) {
830	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
831}
832#define RE_Direct				RE_Direct_BlinnPhong
833#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,XM=`PhysicalMaterial material;
834material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
835vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
836float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
837material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
838material.roughness = min( material.roughness, 1.0 );
839#ifdef IOR
840	material.ior = ior;
841	#ifdef USE_SPECULAR
842		float specularIntensityFactor = specularIntensity;
843		vec3 specularColorFactor = specularColor;
844		#ifdef USE_SPECULAR_COLORMAP
845			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
846		#endif
847		#ifdef USE_SPECULAR_INTENSITYMAP
848			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
849		#endif
850		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
851	#else
852		float specularIntensityFactor = 1.0;
853		vec3 specularColorFactor = vec3( 1.0 );
854		material.specularF90 = 1.0;
855	#endif
856	material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
857#else
858	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
859	material.specularF90 = 1.0;
860#endif
861#ifdef USE_CLEARCOAT
862	material.clearcoat = clearcoat;
863	material.clearcoatRoughness = clearcoatRoughness;
864	material.clearcoatF0 = vec3( 0.04 );
865	material.clearcoatF90 = 1.0;
866	#ifdef USE_CLEARCOATMAP
867		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
868	#endif
869	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
870		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
871	#endif
872	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
873	material.clearcoatRoughness += geometryRoughness;
874	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
875#endif
876#ifdef USE_IRIDESCENCE
877	material.iridescence = iridescence;
878	material.iridescenceIOR = iridescenceIOR;
879	#ifdef USE_IRIDESCENCEMAP
880		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
881	#endif
882	#ifdef USE_IRIDESCENCE_THICKNESSMAP
883		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
884	#else
885		material.iridescenceThickness = iridescenceThicknessMaximum;
886	#endif
887#endif
888#ifdef USE_SHEEN
889	material.sheenColor = sheenColor;
890	#ifdef USE_SHEEN_COLORMAP
891		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
892	#endif
893	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
894	#ifdef USE_SHEEN_ROUGHNESSMAP
895		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
896	#endif
897#endif
898#ifdef USE_ANISOTROPY
899	#ifdef USE_ANISOTROPYMAP
900		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
901		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
902		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
903	#else
904		vec2 anisotropyV = anisotropyVector;
905	#endif
906	material.anisotropy = length( anisotropyV );
907	if( material.anisotropy == 0.0 ) {
908		anisotropyV = vec2( 1.0, 0.0 );
909	} else {
910		anisotropyV /= material.anisotropy;
911		material.anisotropy = saturate( material.anisotropy );
912	}
913	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
914	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
915	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
916#endif`,qM=`struct PhysicalMaterial {
917	vec3 diffuseColor;
918	float roughness;
919	vec3 specularColor;
920	float specularF90
vendor: 14,563 bytes, lines 920-1216
920;
921	#ifdef USE_CLEARCOAT
922		float clearcoat;
923		float clearcoatRoughness;
924		vec3 clearcoatF0;
925		float clearcoatF90;
926	#endif
927	#ifdef USE_IRIDESCENCE
928		float iridescence;
929		float iridescenceIOR;
930		float iridescenceThickness;
931		vec3 iridescenceFresnel;
932		vec3 iridescenceF0;
933	#endif
934	#ifdef USE_SHEEN
935		vec3 sheenColor;
936		float sheenRoughness;
937	#endif
938	#ifdef IOR
939		float ior;
940	#endif
941	#ifdef USE_TRANSMISSION
942		float transmission;
943		float transmissionAlpha;
944		float thickness;
945		float attenuationDistance;
946		vec3 attenuationColor;
947	#endif
948	#ifdef USE_ANISOTROPY
949		float anisotropy;
950		float alphaT;
951		vec3 anisotropyT;
952		vec3 anisotropyB;
953	#endif
954};
955vec3 clearcoatSpecularDirect = vec3( 0.0 );
956vec3 clearcoatSpecularIndirect = vec3( 0.0 );
957vec3 sheenSpecularDirect = vec3( 0.0 );
958vec3 sheenSpecularIndirect = vec3(0.0 );
959vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
960    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
961    float x2 = x * x;
962    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
963    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
964}
965float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
966	float a2 = pow2( alpha );
967	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
968	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
969	return 0.5 / max( gv + gl, EPSILON );
970}
971float D_GGX( const in float alpha, const in float dotNH ) {
972	float a2 = pow2( alpha );
973	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
974	return RECIPROCAL_PI * a2 / pow2( denom );
975}
976#ifdef USE_ANISOTROPY
977	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 ) {
978		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
979		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
980		float v = 0.5 / ( gv + gl );
981		return saturate(v);
982	}
983	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
984		float a2 = alphaT * alphaB;
985		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
986		highp float v2 = dot( v, v );
987		float w2 = a2 / v2;
988		return RECIPROCAL_PI * a2 * pow2 ( w2 );
989	}
990#endif
991#ifdef USE_CLEARCOAT
992	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
993		vec3 f0 = material.clearcoatF0;
994		float f90 = material.clearcoatF90;
995		float roughness = material.clearcoatRoughness;
996		float alpha = pow2( roughness );
997		vec3 halfDir = normalize( lightDir + viewDir );
998		float dotNL = saturate( dot( normal, lightDir ) );
999		float dotNV = saturate( dot( normal, viewDir ) );
1000		float dotNH = saturate( dot( normal, halfDir ) );
1001		float dotVH = saturate( dot( viewDir, halfDir ) );
1002		vec3 F = F_Schlick( f0, f90, dotVH );
1003		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1004		float D = D_GGX( alpha, dotNH );
1005		return F * ( V * D );
1006	}
1007#endif
1008vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1009	vec3 f0 = material.specularColor;
1010	float f90 = material.specularF90;
1011	float roughness = material.roughness;
1012	float alpha = pow2( roughness );
1013	vec3 halfDir = normalize( lightDir + viewDir );
1014	float dotNL = saturate( dot( normal, lightDir ) );
1015	float dotNV = saturate( dot( normal, viewDir ) );
1016	float dotNH = saturate( dot( normal, halfDir ) );
1017	float dotVH = saturate( dot( viewDir, halfDir ) );
1018	vec3 F = F_Schlick( f0, f90, dotVH );
1019	#ifdef USE_IRIDESCENCE
1020		F = mix( F, material.iridescenceFresnel, material.iridescence );
1021	#endif
1022	#ifdef USE_ANISOTROPY
1023		float dotTL = dot( material.anisotropyT, lightDir );
1024		float dotTV = dot( material.anisotropyT, viewDir );
1025		float dotTH = dot( material.anisotropyT, halfDir );
1026		float dotBL = dot( material.anisotropyB, lightDir );
1027		float dotBV = dot( material.anisotropyB, viewDir );
1028		float dotBH = dot( material.anisotropyB, halfDir );
1029		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
1030		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
1031	#else
1032		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1033		float D = D_GGX( alpha, dotNH );
1034	#endif
1035	return F * ( V * D );
1036}
1037vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
1038	const float LUT_SIZE = 64.0;
1039	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
1040	const float LUT_BIAS = 0.5 / LUT_SIZE;
1041	float dotNV = saturate( dot( N, V ) );
1042	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
1043	uv = uv * LUT_SCALE + LUT_BIAS;
1044	return uv;
1045}
1046float LTC_ClippedSphereFormFactor( const in vec3 f ) {
1047	float l = length( f );
1048	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
1049}
1050vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
1051	float x = dot( v1, v2 );
1052	float y = abs( x );
1053	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
1054	float b = 3.4175940 + ( 4.1616724 + y ) * y;
1055	float v = a / b;
1056	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
1057	return cross( v1, v2 ) * theta_sintheta;
1058}
1059vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
1060	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
1061	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
1062	vec3 lightNormal = cross( v1, v2 );
1063	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
1064	vec3 T1, T2;
1065	T1 = normalize( V - N * dot( V, N ) );
1066	T2 = - cross( N, T1 );
1067	mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
1068	vec3 coords[ 4 ];
1069	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
1070	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
1071	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
1072	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
1073	coords[ 0 ] = normalize( coords[ 0 ] );
1074	coords[ 1 ] = normalize( coords[ 1 ] );
1075	coords[ 2 ] = normalize( coords[ 2 ] );
1076	coords[ 3 ] = normalize( coords[ 3 ] );
1077	vec3 vectorFormFactor = vec3( 0.0 );
1078	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
1079	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
1080	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
1081	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
1082	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
1083	return vec3( result );
1084}
1085#if defined( USE_SHEEN )
1086float D_Charlie( float roughness, float dotNH ) {
1087	float alpha = pow2( roughness );
1088	float invAlpha = 1.0 / alpha;
1089	float cos2h = dotNH * dotNH;
1090	float sin2h = max( 1.0 - cos2h, 0.0078125 );
1091	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
1092}
1093float V_Neubelt( float dotNV, float dotNL ) {
1094	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
1095}
1096vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
1097	vec3 halfDir = normalize( lightDir + viewDir );
1098	float dotNL = saturate( dot( normal, lightDir ) );
1099	float dotNV = saturate( dot( normal, viewDir ) );
1100	float dotNH = saturate( dot( normal, halfDir ) );
1101	float D = D_Charlie( sheenRoughness, dotNH );
1102	float V = V_Neubelt( dotNV, dotNL );
1103	return sheenColor * ( D * V );
1104}
1105#endif
1106float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1107	float dotNV = saturate( dot( normal, viewDir ) );
1108	float r2 = roughness * roughness;
1109	float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
1110	float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
1111	float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
1112	return saturate( DG * RECIPROCAL_PI );
1113}
1114vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1115	float dotNV = saturate( dot( normal, viewDir ) );
1116	const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
1117	const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
1118	vec4 r = roughness * c0 + c1;
1119	float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
1120	vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
1121	return fab;
1122}
1123vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
1124	vec2 fab = DFGApprox( normal, viewDir, roughness );
1125	return specularColor * fab.x + specularF90 * fab.y;
1126}
1127#ifdef USE_IRIDESCENCE
1128void 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 ) {
1129#else
1130void 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 ) {
1131#endif
1132	vec2 fab = DFGApprox( normal, viewDir, roughness );
1133	#ifdef USE_IRIDESCENCE
1134		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
1135	#else
1136		vec3 Fr = specularColor;
1137	#endif
1138	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
1139	float Ess = fab.x + fab.y;
1140	float Ems = 1.0 - Ess;
1141	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
1142	singleScatter += FssEss;
1143	multiScatter += Fms * Ems;
1144}
1145#if NUM_RECT_AREA_LIGHTS > 0
1146	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 ) {
1147		vec3 normal = geometryNormal;
1148		vec3 viewDir = geometryViewDir;
1149		vec3 position = geometryPosition;
1150		vec3 lightPos = rectAreaLight.position;
1151		vec3 halfWidth = rectAreaLight.halfWidth;
1152		vec3 halfHeight = rectAreaLight.halfHeight;
1153		vec3 lightColor = rectAreaLight.color;
1154		float roughness = material.roughness;
1155		vec3 rectCoords[ 4 ];
1156		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
1157		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
1158		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
1159		vec2 uv = LTC_Uv( normal, viewDir, roughness );
1160		vec4 t1 = texture2D( ltc_1, uv );
1161		vec4 t2 = texture2D( ltc_2, uv );
1162		mat3 mInv = mat3(
1163			vec3( t1.x, 0, t1.y ),
1164			vec3(    0, 1,    0 ),
1165			vec3( t1.z, 0, t1.w )
1166		);
1167		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
1168		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
1169		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
1170	}
1171#endif
1172void 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 ) {
1173	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
1174	vec3 irradiance = dotNL * directLight.color;
1175	#ifdef USE_CLEARCOAT
1176		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
1177		vec3 ccIrradiance = dotNLcc * directLight.color;
1178		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
1179	#endif
1180	#ifdef USE_SHEEN
1181		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
1182	#endif
1183	reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );
1184	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1185}
1186void 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 ) {
1187	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1188}
1189void 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) {
1190	#ifdef USE_CLEARCOAT
1191		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
1192	#endif
1193	#ifdef USE_SHEEN
1194		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1195	#endif
1196	vec3 singleScattering = vec3( 0.0 );
1197	vec3 multiScattering = vec3( 0.0 );
1198	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
1199	#ifdef USE_IRIDESCENCE
1200		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
1201	#else
1202		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
1203	#endif
1204	vec3 totalScattering = singleScattering + multiScattering;
1205	vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
1206	reflectedLight.indirectSpecular += radiance * singleScattering;
1207	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
1208	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
1209}
1210#define RE_Direct				RE_Direct_Physical
1211#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
1212#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
1213#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
1214float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1215	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1216}`,
1216YM=`
1217vec3 geometryPosition = - vViewPosition;
1218vec3 geometryNormal = normal;
1219vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
1220vec3 geometryClearcoatNormal = vec3( 0.0 );
1221#ifdef USE_CLEARCOAT
1222	geometryClearcoatNormal = clearcoatNormal;
1223#endif
1224#ifdef USE_IRIDESCENCE
1225	float dotNVi = saturate( dot( normal, geometryViewDir ) );
1226	if ( material.iridescenceThickness == 0.0 ) {
1227		material.iridescence = 0.0;
1228	} else {
1229		material.iridescence = saturate( material.iridescence );
1230	}
1231	if ( material.iridescence > 0.0 ) {
1232		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
1233		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
1234	}
1235#endif
1236IncidentLight directLight;
1237#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
1238	PointLight pointLight;
1239	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
1240	PointLightShadow pointLightShadow;
1241	#endif
1242	#pragma unroll_loop_start
1243	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
1244		pointLight = pointLights[ i ];
1245		getPointLightInfo( pointLight, geometryPosition, directLight );
1246		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
1247		pointLightShadow = pointLightShadows[ i ];
1248		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
1249		#endif
1250		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1251	}
1252	#pragma unroll_loop_end
1253#endif
1254#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
1255	SpotLight spotLight;
1256	vec4 spotColor;
1257	vec3 spotLightCoord;
1258	bool inSpotLightMap;
1259	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
1260	SpotLightShadow spotLightShadow;
1261	#endif
1262	#pragma unroll_loop_start
1263	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
1264		spotLight = spotLights[ i ];
1265		getSpotLightInfo( spotLight, geometryPosition, directLight );
1266		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1267		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
1268		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1269		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
1270		#else
1271		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1272		#endif
1273		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
1274			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
1275			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
1276			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
1277			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
1278		#endif
1279		#undef SPOT_LIGHT_MAP_INDEX
1280		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1281		spotLightShadow = spotLightShadows[ i ];
1282		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
1283		#endif
1284		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1285	}
1286	#pragma unroll_loop_end
1287#endif
1288#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
1289	DirectionalLight directionalLight;
1290	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
1291	DirectionalLightShadow directionalLightShadow;
1292	#endif
1293	#pragma unroll_loop_start
1294	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
1295		directionalLight = directionalLights[ i ];
1296		getDirectionalLightInfo( directionalLight, directLight );
1297		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
1298		directionalLightShadow = directionalLightShadows[ i ];
1299		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
1300		#endif
1301		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1302	}
1303	#pragma unroll_loop_end
1304#endif
1305#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
1306	RectAreaLight rectAreaLight;
1307	#pragma unroll_loop_start
1308	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
1309		rectAreaLight = rectAreaLights[ i ];
1310		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1311	}
1312	#pragma unroll_loop_end
1313#endif
1314#if defined( RE_IndirectDiffuse )
1315	vec3 iblIrradiance = vec3( 0.0 );
1316	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
1317	#if defined( USE_LIGHT_PROBES )
1318		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
1319	#endif
1320	#if ( NUM_HEMI_LIGHTS > 0 )
1321		#pragma unroll_loop_start
1322		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
1323			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
1324		}
1325		#pragma unroll_loop_end
1326	#endif
1327#endif
1328#if defined( RE_IndirectSpecular )
1329	vec3 radiance = vec3( 0.0 );
1330	vec3 clearcoatRadiance = vec3( 0.0 );
1331#endif`,ZM=`#if defined( RE_IndirectDiffuse )
1332	#ifdef USE_LIGHTMAP
1333		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1334		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
1335		irradiance += lightMapIrradiance;
1336	#endif
1337	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
1338		iblIrradiance += getIBLIrradiance( geometryNormal );
1339	#endif
1340#endif
1341#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
1342	#ifdef USE_ANISOTROPY
1343		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
1344	#else
1345		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
1346	#endif
1347	#ifdef USE_CLEARCOAT
1348		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1349	#endif
1350#endif`,JM=`#if defined( RE_IndirectDiffuse )
1351	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1352#endif
1353#if defined( RE_IndirectSpecular )
1354	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1355#endif`,jM=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
1356	gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1357#endif`,KM=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
1358	uniform float logDepthBufFC;
1359	varying float vFragDepth;
1360	varying float vIsPerspective;
1361#endif`,QM=`#ifdef USE_LOGDEPTHBUF
1362	#ifdef USE_LOGDEPTHBUF_EXT
1363		varying float vFragDepth;
1364		varying float vIsPerspective;
1365	#else
1366		uniform float logDepthBufFC;
1367	#endif
1368#endif`,$M=`#ifdef USE_LOGDEPTHBUF
1369	#ifdef USE_LOGDEPTHBUF_EXT
1370		vFragDepth = 1.0 + gl_Position.w;
1371		vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1372	#else
1373		if ( isPerspectiveMatrix( projectionMatrix ) ) {
1374			gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
1375			gl_Position.z *= gl_Position.w;
1376		}
1377	#endif
1378#endif`,eE=`#ifdef USE_MAP
1379	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1380	#ifdef DECODE_VIDEO_TEXTURE
1381		sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
1382	
1383	#endif
1384	diffuseColor *= sampledDiffuseColor;
1385#endif`,tE=`#ifdef USE_MAP
1386	uniform sampler2D map;
1387#endif`,nE=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1388	#if defined( USE_POINTS_UV )
1389		vec2 uv = vUv;
1390	#else
1391		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
1392	#endif
1393#endif
1394#ifdef USE_MAP
1395	diffuseColor *= texture2D( map, uv );
1396#endif
1397#ifdef USE_ALPHAMAP
1398	diffuseColor.a *= texture2D( alphaMap, uv ).g;
1399#endif`,iE=`#if defined( USE_POINTS_UV )
1400	varying vec2 vUv;
1401#else
1402	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1403		uniform mat3 uvTransform;
1404	#endif
1405#endif
1406#ifdef USE_MAP
1407	uniform sampler2D map;
1408#endif
1409#ifdef USE_ALPHAMAP
1410	uniform sampler2D alphaMap;
1411#endif`,rE=`float metalnessFactor = metalness;
1412#ifdef USE_METALNESSMAP
1413	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1414	metalnessFactor *= texelMetalness.b;
1415#endif`,sE=`#ifdef USE_METALNESSMAP
1416	uniform sampler2D metalnessMap;
1417#endif`,oE=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )
1418	vColor *= morphTargetBaseInfluence;
1419	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1420		#if defined( USE_COLOR_ALPHA )
1421			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
1422		#elif defined( USE_COLOR )
1423			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1424		#endif
1425	}
1426#endif`,aE=`#ifdef USE_MORPHNORMALS
1427	objectNormal *= morphTargetBaseInfluence;
1428	#ifdef MORPHTARGETS_TEXTURE
1429		for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1430			if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
1431		}
1432	#else
1433		objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
1434		objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
1435		objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
1436		objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
1437	#endif
1438#endif`,lE=`#ifdef USE_MORPHTARGETS
1439	uniform float morphTargetBaseInfluence;
1440	#ifdef MORPHTARGETS_TEXTURE
1441		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1442		uniform sampler2DArray morphTargetsTexture;
1443		uniform ivec2 morphTargetsTextureSize;
1444		vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
1445			int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
1446			int y = texelIndex / morphTargetsTextureSize.x;
1447			int x = texelIndex - y * morphTargetsTextureSize.x;
1448			ivec3 morphUV = ivec3( x, y, morphTargetIndex );
1449			return texelFetch( morphTargetsTexture, morphUV, 0 );
1450		}
1451	#else
1452		#ifndef USE_MORPHNORMALS
1453			uniform float morphTargetInfluences[ 8 ];
1454		#else
1455			uniform float morphTargetInfluences[ 4 ];
1456		#endif
1457	#endif
1458#endif`,cE=`#ifdef USE_MORPHTARGETS
1459	transformed *= morphTargetBaseInfluence;
1460	#ifdef MORPHTARGETS_TEXTURE
1461		for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1462			if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
1463		}
1464	#else
1465		transformed += morphTarget0 * morphTargetInfluences[ 0 ];
1466		transformed += morphTarget1 * morphTargetInfluences[ 1 ];
1467		transformed += morphTarget2 * morphTargetInfluences[ 2 ];
1468		transformed += morphTarget3 * morphTargetInfluences[ 3 ];
1469		#ifndef USE_MORPHNORMALS
1470			transformed += morphTarget4 * morphTargetInfluences[ 4 ];
1471			transformed += morphTarget5 * morphTargetInfluences[ 5 ];
1472			transformed += morphTarget6 * morphTargetInfluences[ 6 ];
1473			transformed += morphTarget7 * morphTargetInfluences[ 7 ];
1474		#endif
1475	#endif
1476#endif`,uE=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1477#ifdef FLAT_SHADED
1478	vec3 fdx = dFdx( vViewPosition );
1479	vec3 fdy = dFdy( vViewPosition );
1480	vec3 normal = normalize( cross( fdx, fdy ) );
1481#else
1482	vec3 normal = normalize( vNormal );
1483	#ifdef DOUBLE_SIDED
1484		normal *= faceDirection;
1485	#endif
1486#endif
1487#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
1488	#ifdef USE_TANGENT
1489		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1490	#else
1491		mat3 tbn = getTangentFrame( - vViewPosition, normal,
1492		#if defined( USE_NORMALMAP )
1493			vNormalMapUv
1494		#elif defined( USE_CLEARCOAT_NORMALMAP )
1495			vClearcoatNormalMapUv
1496		#else
1497			vUv
1498		#endif
1499		);
1500	#endif
1501	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
1502		tbn[0] *= faceDirection;
1503		tbn[1] *= faceDirection;
1504	#endif
1505#endif
1506#ifdef USE_CLEARCOAT_NORMALMAP
1507	#ifdef USE_TANGENT
1508		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1509	#else
1510		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
1511	#endif
1512	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
1513		tbn2[0] *= faceDirection;
1514		tbn2[1] *= faceDirection;
1515	#endif
1516#endif
1517vec3 nonPerturbedNormal = normal;`,hE=`#ifdef USE_NORMALMAP_OBJECTSPACE
1518	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1519	#ifdef FLIP_SIDED
1520		normal = - normal;
1521	#endif
1522	#ifdef DOUBLE_SIDED
1523		normal = normal * faceDirection;
1524	#endif
1525	normal = normalize( normalMatrix * normal );
1526#elif defined( USE_NORMALMAP_TANGENTSPACE )
1527	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1528	mapN.xy *= normalScale;
1529	normal = normalize( tbn * mapN );
1530#elif defined( USE_BUMPMAP )
1531	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1532#endif`,fE=`#ifndef FLAT_SHADED
1533	varying vec3 vNormal;
1534	#ifdef USE_TANGENT
1535		varying vec3 vTangent;
1536		varying vec3 vBitangent;
1537	#endif
1538#endif`,dE=`#ifndef FLAT_SHADED
1539	varying vec3 vNormal;
1540	#ifdef USE_TANGENT
1541		varying vec3 vTangent;
1542		varying vec3 vBitangent;
1543	#endif
1544#endif`,pE=`#ifndef FLAT_SHADED
1545	vNormal = normalize( transformedNormal );
1546	#ifdef USE_TANGENT
1547		vTangent = normalize( transformedTangent );
1548		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
1549	#endif
1550#endif`,mE=`#ifdef USE_NORMALMAP
1551	uniform sampler2D normalMap;
1552	uniform vec2 normalScale;
1553#endif
1554#ifdef USE_NORMALMAP_OBJECTSPACE
1555	uniform mat3 normalMatrix;
1556#endif
1557#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
1558	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
1559		vec3 q0 = dFdx( eye_pos.xyz );
1560		vec3 q1 = dFdy( eye_pos.xyz );
1561		vec2 st0 = dFdx( uv.st );
1562		vec2 st1 = dFdy( uv.st );
1563		vec3 N = surf_norm;
1564		vec3 q1perp = cross( q1, N );
1565		vec3 q0perp = cross( N, q0 );
1566		vec3 T = q1perp * st0.x + q0perp * st1.x;
1567		vec3 B = q1perp * st0.y + q0perp * st1.y;
1568		float det = max( dot( T, T ), dot( B, B ) );
1569		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1570		return mat3( T * scale, B * scale, N );
1571	}
1572#endif`,gE=`#ifdef USE_CLEARCOAT
1573	vec3 clearcoatNormal = nonPerturbedNormal;
1574#endif`,_E=`#ifdef USE_CLEARCOAT_NORMALMAP
1575	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1576	clearcoatMapN.xy *= clearcoatNormalScale;
1577	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1578#endif`,vE=`#ifdef USE_CLEARCOATMAP
1579	uniform sampler2D clearcoatMap;
1580#endif
1581#ifdef USE_CLEARCOAT_NORMALMAP
1582	uniform sampler2D clearcoatNormalMap;
1583	uniform vec2 clearcoatNormalScale;
1584#endif
1585#ifdef USE_CLEARCOAT_ROUGHNESSMAP
1586	uniform sampler2D clearcoatRoughnessMap;
1587#endif`,yE=`#ifdef USE_IRIDESCENCEMAP
1588	uniform sampler2D iridescenceMap;
1589#endif
1590#ifdef USE_IRIDESCENCE_THICKNESSMAP
1591	uniform sampler2D iridescenceThicknessMap;
1592#endif`,xE=`#ifdef OPAQUE
1593diffuseColor.a = 1.0;
1594#endif
1595#ifdef USE_TRANSMISSION
1596diffuseColor.a *= material.transmissionAlpha;
1597#endif
1598gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,SE=`vec3 packNormalToRGB( const in vec3 normal ) {
1599	return normalize( normal ) * 0.5 + 0.5;
1600}
1601vec3 unpackRGBToNormal( const in vec3 rgb ) {
1602	return 2.0 * rgb.xyz - 1.0;
1603}
1604const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;
1605const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
1606const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
1607const float ShiftRight8 = 1. / 256.;
1608vec4 packDepthToRGBA( const in float v ) {
1609	vec4 r = vec4( fract( v * PackFactors ), v );
1610	r.yzw -= r.xyz * ShiftRight8;	return r * PackUpscale;
1611}
1612float unpackRGBAToDepth( const in vec4 v ) {
1613	return dot( v, UnpackFactors );
1614}
1615vec2 packDepthToRG( in highp float v ) {
1616	return packDepthToRGBA( v ).yx;
1617}
1618float unpackRGToDepth( const in highp vec2 v ) {
1619	return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );
1620}
1621vec4 pack2HalfToRGBA( vec2 v ) {
1622	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
1623	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
1624}
1625vec2 unpackRGBATo2Half( vec4 v ) {
1626	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
1627}
1628float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
1629	return ( viewZ + near ) / ( near - far );
1630}
1631float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
1632	return depth * ( near - far ) - near;
1633}
1634float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
1635	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
1636}
1637float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
1638	return ( near * far ) / ( ( far - near ) * depth - far );
1639}`,ME=`#ifdef PREMULTIPLIED_ALPHA
1640	gl_FragColor.rgb *= gl_FragColor.a;
1641#endif`,EE=`vec4 mvPosition = vec4( transformed, 1.0 );
1642#ifdef USE_BATCHING
1643	mvPosition = batchingMatrix * mvPosition;
1644#endif
1645#ifdef USE_INSTANCING
1646	mvPosition = instanceMatrix * mvPosition;
1647#endif
1648mvPosition = modelViewMatrix * mvPosition;
1649gl_Position = projectionMatrix * mvPosition;`,wE=`#ifdef DITHERING
1650	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
1651#endif`,TE=`#ifdef DITHERING
1652	vec3 dithering( vec3 color ) {
1653		float grid_position = rand( gl_FragCoord.xy );
1654		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
1655		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
1656		return color + dither_shift_RGB;
1657	}
1658#endif`,AE=`float roughnessFactor = roughness;
1659#ifdef USE_ROUGHNESSMAP
1660	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
1661	roughnessFactor *= texelRoughness.g;
1662#endif`,bE=`#ifdef USE_ROUGHNESSMAP
1663	uniform sampler2D roughnessMap;
1664#endif`,CE=`#if NUM_SPOT_LIGHT_COORDS > 0
1665	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1666#endif
1667#if NUM_SPOT_LIGHT_MAPS > 0
1668	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
1669#endif
1670#ifdef USE_SHADOWMAP
1671	#if NUM_DIR_LIGHT_SHADOWS > 0
1672		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1673		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1674		struct DirectionalLightShadow {
1675			float shadowBias;
1676			float shadowNormalBias;
1677			float shadowRadius;
1678			vec2 shadowMapSize;
1679		};
1680		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1681	#endif
1682	#if NUM_SPOT_LIGHT_SHADOWS > 0
1683		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
1684		struct SpotLightShadow {
1685			float shadowBias;
1686			float shadowNormalBias;
1687			float shadowRadius;
1688			vec2 shadowMapSize;
1689		};
1690		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1691	#endif
1692	#if NUM_POINT_LIGHT_SHADOWS > 0
1693		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
1694		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1695		struct PointLightShadow {
1696			float shadowBias;
1697			float shadowNormalBias;
1698			float shadowRadius;
1699			vec2 shadowMapSize;
1700			float shadowCameraNear;
1701			float shadowCameraFar;
1702		};
1703		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1704	#endif
1705	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
1706		return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
1707	}
1708	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
1709		return unpackRGBATo2Half( texture2D( shadow, uv ) );
1710	}
1711	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
1712		float occlusion = 1.0;
1713		vec2 distribution = texture2DDistribution( shadow, uv );
1714		float hard_shadow = step( compare , distribution.x );
1715		if (hard_shadow != 1.0 ) {
1716			float distance = compare - distribution.x ;
1717			float variance = max( 0.00000, distribution.y * distribution.y );
1718			float softness_probability = variance / (variance + distance * distance );			softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );			occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
1719		}
1720		return occlusion;
1721	}
1722	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1723		float shadow = 1.0;
1724		shadowCoord.xyz /= shadowCoord.w;
1725		shadowCoord.z += shadowBias;
1726		bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1727		bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1728		if ( frustumTest ) {
1729		#if defined( SHADOWMAP_TYPE_PCF )
1730			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
1731			float dx0 = - texelSize.x * shadowRadius;
1732			float dy0 = - texelSize.y * shadowRadius;
1733			float dx1 = + texelSize.x * shadowRadius;
1734			float dy1 = + texelSize.y * shadowRadius;
1735			float dx2 = dx0 / 2.0;
1736			float dy2 = dy0 / 2.0;
1737			float dx3 = dx1 / 2.0;
1738			float dy3 = dy1 / 2.0;
1739			shadow = (
1740				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
1741				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
1742				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
1743				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
1744				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
1745				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
1746				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
1747				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
1748				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
1749				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
1750				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
1751				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
1752				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
1753				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
1754				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
1755				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
1756				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
1757			) * ( 1.0 / 17.0 );
1758		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
1759			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
1760			float dx = texelSize.x;
1761			float dy = texelSize.y;
1762			vec2 uv = shadowCoord.xy;
1763			vec2 f = fract( uv * shadowMapSize + 0.5 );
1764			uv -= f * texelSize;
1765			shadow = (
1766				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
1767				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
1768				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
1769				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
1770				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
1771					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
1772					 f.x ) +
1773				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
1774					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
1775					 f.x ) +
1776				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
1777					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
1778					 f.y ) +
1779				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
1780					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
1781					 f.y ) +
1782				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
1783						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
1784						  f.x ),
1785					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
1786						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
1787						  f.x ),
1788					 f.y )
1789			) * ( 1.0 / 9.0 );
1790		#elif defined( SHADOWMAP_TYPE_VSM )
1791			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
1792		#else
1793			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
1794		#endif
1795		}
1796		return shadow;
1797	}
1798	vec2 cubeToUV( vec3 v, float texelSizeY ) {
1799		vec3 absV = abs( v );
1800		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
1801		absV *= scaleToCube;
1802		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
1803		vec2 planar = v.xy;
1804		float almostATexel = 1.5 * texelSizeY;
1805		float almostOne = 1.0 - almostATexel;
1806		if ( absV.z >= almostOne ) {
1807			if ( v.z > 0.0 )
1808				planar.x = 4.0 - v.x;
1809		} else if ( absV.x >= almostOne ) {
1810			float signX = sign( v.x );
1811			planar.x = v.z * signX + 2.0 * signX;
1812		} else if ( absV.y >= almostOne ) {
1813			float signY = sign( v.y );
1814			planar.x = v.x + 2.0 * signY + 2.0;
1815			planar.y = v.z * signY - 2.0;
1816		}
1817		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
1818	}
1819	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
1820		vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
1821		vec3 lightToPosition = shadowCoord.xyz;
1822		float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );		dp += shadowBias;
1823		vec3 bd3D = normalize( lightToPosition );
1824		#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
1825			vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
1826			return (
1827				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
1828				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
1829				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
1830				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
1831				texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
1832				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
1833				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
1834				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
1835				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
1836			) * ( 1.0 / 9.0 );
1837		#else
1838			return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
1839		#endif
1840	}
1841#endif`,RE=`#if NUM_SPOT_LIGHT_COORDS > 0
1842	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
1843	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1844#endif
1845#ifdef USE_SHADOWMAP
1846	#if NUM_DIR_LIGHT_SHADOWS > 0
1847		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
1848		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1849		struct DirectionalLightShadow {
1850			float shadowBias;
1851			float shadowNormalBias;
1852			float shadowRadius;
1853			vec2 shadowMapSize;
1854		};
1855		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1856	#endif
1857	#if NUM_SPOT_LIGHT_SHADOWS > 0
1858		struct SpotLightShadow {
1859			float shadowBias;
1860			float shadowNormalBias;
1861			float shadowRadius;
1862			vec2 shadowMapSize;
1863		};
1864		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1865	#endif
1866	#if NUM_POINT_LIGHT_SHADOWS > 0
1867		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
1868		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1869		struct PointLightShadow {
1870			float shadowBias;
1871			float shadowNormalBias;
1872			float shadowRadius;
1873			vec2 shadowMapSize;
1874			float shadowCameraNear;
1875			float shadowCameraFar;
1876		};
1877		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1878	#endif
1879#endif`,PE=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
1880	vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
1881	vec4 shadowWorldPosition;
1882#endif
1883#if defined( USE_SHADOWMAP )
1884	#if NUM_DIR_LIGHT_SHADOWS > 0
1885		#pragma unroll_loop_start
1886		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
1887			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
1888			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
1889		}
1890		#pragma unroll_loop_end
1891	#endif
1892	#if NUM_POINT_LIGHT_SHADOWS > 0
1893		#pragma unroll_loop_start
1894		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
1895			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
1896			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
1897		}
1898		#pragma unroll_loop_end
1899	#endif
1900#endif
1901#if NUM_SPOT_LIGHT_COORDS > 0
1902	#pragma unroll_loop_start
1903	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
1904		shadowWorldPosition = worldPosition;
1905		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1906			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
1907		#endif
1908		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
1909	}
1910	#pragma unroll_loop_end
1911#endif`,LE=`float getShadowMask() {
1912	float shadow = 1.0;
1913	#ifdef USE_SHADOWMAP
1914	#if NUM_DIR_LIGHT_SHADOWS > 0
1915	DirectionalLightShadow directionalLight;
1916	#pragma unroll_loop_start
1917	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
1918		directionalLight = directionalLightShadows[ i ];
1919		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
1920	}
1921	#pragma unroll_loop_end
1922	#endif
1923	#if NUM_SPOT_LIGHT_SHADOWS > 0
1924	SpotLightShadow spotLight;
1925	#pragma unroll_loop_start
1926	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
1927		spotLight = spotLightShadows[ i ];
1928		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
1929	}
1930	#pragma unroll_loop_end
1931	#endif
1932	#if NUM_POINT_LIGHT_SHADOWS > 0
1933	PointLightShadow pointLight;
1934	#pragma unroll_loop_start
1935	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
1936		pointLight = pointLightShadows[ i ];
1937		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
1938	}
1939	#pragma unroll_loop_end
1940	#endif
1941	#endif
1942	return shadow;
1943}`,IE=`#ifdef USE_SKINNING
1944	mat4 boneMatX = getBoneMatrix( skinIndex.x );
1945	mat4 boneMatY = getBoneMatrix( skinIndex.y );
1946	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
1947	mat4 boneMatW = getBoneMatrix( skinIndex.w );
1948#endif`,DE=`#ifdef USE_SKINNING
1949	uniform mat4 bindMatrix;
1950	uniform mat4 bindMatrixInverse;
1951	uniform highp sampler2D boneTexture;
1952	mat4 getBoneMatrix( const in float i ) {
1953		int size = textureSize( boneTexture, 0 ).x;
1954		int j = int( i ) * 4;
1955		int x = j % size;
1956		int y = j / size;
1957		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
1958		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
1959		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
1960		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
1961		return mat4( v1, v2, v3, v4 );
1962	}
1963#endif`,NE=`#ifdef USE_SKINNING
1964	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
1965	vec4 skinned = vec4( 0.0 );
1966	skinned += boneMatX * skinVertex * skinWeight.x;
1967	skinned += boneMatY * skinVertex * skinWeight.y;
1968	skinned += boneMatZ * skinVertex * skinWeight.z;
1969	skinned += boneMatW * skinVertex * skinWeight.w;
1970	transformed = ( bindMatrixInverse * skinned ).xyz;
1971#endif`,UE=`#ifdef USE_SKINNING
1972	mat4 skinMatrix = mat4( 0.0 );
1973	skinMatrix += skinWeight.x * boneMatX;
1974	skinMatrix += skinWeight.y * boneMatY;
1975	skinMatrix += skinWeight.z * boneMatZ;
1976	skinMatrix += skinWeight.w * boneMatW;
1977	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
1978	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
1979	#ifdef USE_TANGENT
1980		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
1981	#endif
1982#endif`,OE=`float specularStrength;
1983#ifdef USE_SPECULARMAP
1984	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
1985	specularStrength = texelSpecular.r;
1986#else
1987	specularStrength = 1.0;
1988#endif`,FE=`#ifdef USE_SPECULARMAP
1989	uniform sampler2D specularMap;
1990#endif`,BE=`#if defined( TONE_MAPPING )
1991	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
1992#endif`,zE=`#ifndef saturate
1993#define saturate( a ) clamp( a, 0.0, 1.0 )
1994#endif
1995uniform float toneMappingExposure;
1996vec3 LinearToneMapping( vec3 color ) {
1997	return saturate( toneMappingExposure * color );
1998}
1999vec3 ReinhardToneMapping( vec3 color ) {
2000	color *= toneMappingExposure;
2001	return saturate( color / ( vec3( 1.0 ) + color ) );
2002}
2003vec3 OptimizedCineonToneMapping( vec3 color ) {
2004	color *= toneMappingExposure;
2005	color = max( vec3( 0.0 ), color - 0.004 );
2006	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
2007}
2008vec3 RRTAndODTFit( vec3 v ) {
2009	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
2010	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
2011	return a / b;
2012}
2013vec3 ACESFilmicToneMapping( vec3 color ) {
2014	const mat3 ACESInputMat = mat3(
2015		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
2016		vec3( 0.04823, 0.01566, 0.83777 )
2017	);
2018	const mat3 ACESOutputMat = mat3(
2019		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
2020		vec3( -0.07367, -0.00605,  1.07602 )
2021	);
2022	color *= toneMappingExposure / 0.6;
2023	color = ACESInputMat * color;
2024	color = RRTAndODTFit( color );
2025	color = ACESOutputMat * color;
2026	return saturate( color );
2027}
2028const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
2029	vec3( 1.6605, - 0.1246, - 0.0182 ),
2030	vec3( - 0.5876, 1.1329, - 0.1006 ),
2031	vec3( - 0.0728, - 0.0083, 1.1187 )
2032);
2033const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
2034	vec3( 0.6274, 0.0691, 0.0164 ),
2035	vec3( 0.3293, 0.9195, 0.0880 ),
2036	vec3( 0.0433, 0.0113, 0.8956 )
2037);
2038vec3 agxDefaultContrastApprox( vec3 x ) {
2039	vec3 x2 = x * x;
2040	vec3 x4 = x2 * x2;
2041	return + 15.5 * x4 * x2
2042		- 40.14 * x4 * x
2043		+ 31.96 * x4
2044		- 6.868 * x2 * x
2045		+ 0.4298 * x2
2046		+ 0.1191 * x
2047		- 0.00232;
2048}
2049vec3 AgXToneMapping( vec3 color ) {
2050	const mat3 AgXInsetMatrix = mat3(
2051		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
2052		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
2053		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
2054	);
2055	const mat3 AgXOutsetMatrix = mat3(
2056		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
2057		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
2058		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
2059	);
2060	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
2061	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
2062	color *= toneMappingExposure;
2063	color = AgXInsetMatrix * color;
2064	color = max( color, 1e-10 );	color = log2( color );
2065	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
2066	color = clamp( color, 0.0, 1.0 );
2067	color = agxDefaultContrastApprox( color );
2068	color = AgXOutsetMatrix * color;
2069	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
2070	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
2071	return color;
2072}
2073vec3 CustomToneMapping( vec3 color ) { return color; }`,kE=`#ifdef USE_TRANSMISSION
2074	material.transmission = transmission;
2075	material.transmissionAlpha = 1.0;
2076	material.thickness = thickness;
2077	material.attenuationDistance = attenuationDistance;
2078	material.attenuationColor = attenuationColor;
2079	#ifdef USE_TRANSMISSIONMAP
2080		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
2081	#endif
2082	#ifdef USE_THICKNESSMAP
2083		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
2084	#endif
2085	vec3 pos = vWorldPosition;
2086	vec3 v = normalize( cameraPosition - pos );
2087	vec3 n = inverseTransformDirection( normal, viewMatrix );
2088	vec4 transmitted = getIBLVolumeRefraction(
2089		n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
2090		pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,
2091		material.attenuationColor, material.attenuationDistance );
2092	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2093	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2094#endif`,HE=`#ifdef USE_TRANSMISSION
2095	uniform float transmission;
2096	uniform float thickness;
2097	uniform float attenuationDistance;
2098	uniform vec3 attenuationColor;
2099	#ifdef USE_TRANSMISSIONMAP
2100		uniform sampler2D transmissionMap;
2101	#endif
2102	#ifdef USE_THICKNESSMAP
2103		uniform sampler2D thicknessMap;
2104	#endif
2105	uniform vec2 transmissionSamplerSize;
2106	uniform sampler2D transmissionSamplerMap;
2107	uniform mat4 modelMatrix;
2108	uniform mat4 projectionMatrix;
2109	varying vec3 vWorldPosition;
2110	float w0( float a ) {
2111		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
2112	}
2113	float w1( float a ) {
2114		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
2115	}
2116	float w2( float a ){
2117		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
2118	}
2119	float w3( float a ) {
2120		return ( 1.0 / 6.0 ) * ( a * a * a );
2121	}
2122	float g0( float a ) {
2123		return w0( a ) + w1( a );
2124	}
2125	float g1( float a ) {
2126		return w2( a ) + w3( a );
2127	}
2128	float h0( float a ) {
2129		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
2130	}
2131	float h1( float a ) {
2132		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
2133	}
2134	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
2135		uv = uv * texelSize.zw + 0.5;
2136		vec2 iuv = floor( uv );
2137		vec2 fuv = fract( uv );
2138		float g0x = g0( fuv.x );
2139		float g1x = g1( fuv.x );
2140		float h0x = h0( fuv.x );
2141		float h1x = h1( fuv.x );
2142		float h0y = h0( fuv.y );
2143		float h1y = h1( fuv.y );
2144		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2145		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2146		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2147		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2148		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
2149			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
2150	}
2151	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
2152		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
2153		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
2154		vec2 fLodSizeInv = 1.0 / fLodSize;
2155		vec2 cLodSizeInv = 1.0 / cLodSize;
2156		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
2157		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
2158		return mix( fSample, cSample, fract( lod ) );
2159	}
2160	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
2161		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
2162		vec3 modelScale;
2163		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
2164		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
2165		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
2166		return normalize( refractionVector ) * thickness * modelScale;
2167	}
2168	float applyIorToRoughness( const in float roughness, const in float ior ) {
2169		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
2170	}
2171	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
2172		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
2173		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
2174	}
2175	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
2176		if ( isinf( attenuationDistance ) ) {
2177			return vec3( 1.0 );
2178		} else {
2179			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
2180			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
2181		}
2182	}
2183	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
2184		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
2185		const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,
2186		const in vec3 attenuationColor, const in float attenuationDistance ) {
2187		vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
2188		vec3 refractedRayExit = position + transmissionRay;
2189		vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2190		vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2191		refractionCoords += 1.0;
2192		refractionCoords /= 2.0;
2193		vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
2194		vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
2195		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
2196		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
2197		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2198		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2199	}
2200#endif`,VE=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2201	varying vec2 vUv;
2202#endif
2203#ifdef USE_MAP
2204	varying vec2 vMapUv;
2205#endif
2206#ifdef USE_ALPHAMAP
2207	varying vec2 vAlphaMapUv;
2208#endif
2209#ifdef USE_LIGHTMAP
2210	varying vec2 vLightMapUv;
2211#endif
2212#ifdef USE_AOMAP
2213	varying vec2 vAoMapUv;
2214#endif
2215#ifdef USE_BUMPMAP
2216	varying vec2 vBumpMapUv;
2217#endif
2218#ifdef USE_NORMALMAP
2219	varying vec2 vNormalMapUv;
2220#endif
2221#ifdef USE_EMISSIVEMAP
2222	varying vec2 vEmissiveMapUv;
2223#endif
2224#ifdef USE_METALNESSMAP
2225	varying vec2 vMetalnessMapUv;
2226#endif
2227#ifdef USE_ROUGHNESSMAP
2228	varying vec2 vRoughnessMapUv;
2229#endif
2230#ifdef USE_ANISOTROPYMAP
2231	varying vec2 vAnisotropyMapUv;
2232#endif
2233#ifdef USE_CLEARCOATMAP
2234	varying vec2 vClearcoatMapUv;
2235#endif
2236#ifdef USE_CLEARCOAT_NORMALMAP
2237	varying vec2 vClearcoatNormalMapUv;
2238#endif
2239#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2240	varying vec2 vClearcoatRoughnessMapUv;
2241#endif
2242#ifdef USE_IRIDESCENCEMAP
2243	varying vec2 vIridescenceMapUv;
2244#endif
2245#ifdef USE_IRIDESCENCE_THICKNESSMAP
2246	varying vec2 vIridescenceThicknessMapUv;
2247#endif
2248#ifdef USE_SHEEN_COLORMAP
2249	varying vec2 vSheenColorMapUv;
2250#endif
2251#ifdef USE_SHEEN_ROUGHNESSMAP
2252	varying vec2 vSheenRoughnessMapUv;
2253#endif
2254#ifdef USE_SPECULARMAP
2255	varying vec2 vSpecularMapUv;
2256#endif
2257#ifdef USE_SPECULAR_COLORMAP
2258	varying vec2 vSpecularColorMapUv;
2259#endif
2260#ifdef USE_SPECULAR_INTENSITYMAP
2261	varying vec2 vSpecularIntensityMapUv;
2262#endif
2263#ifdef USE_TRANSMISSIONMAP
2264	uniform mat3 transmissionMapTransform;
2265	varying vec2 vTransmissionMapUv;
2266#endif
2267#ifdef USE_THICKNESSMAP
2268	uniform mat3 thicknessMapTransform;
2269	varying vec2 vThicknessMapUv;
2270#endif`,GE=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2271	varying vec2 vUv;
2272#endif
2273#ifdef USE_MAP
2274	uniform mat3 mapTransform;
2275	varying vec2 vMapUv;
2276#endif
2277#ifdef USE_ALPHAMAP
2278	uniform mat3 alphaMapTransform;
2279	varying vec2 vAlphaMapUv;
2280#endif
2281#ifdef USE_LIGHTMAP
2282	uniform mat3 lightMapTransform;
2283	varying vec2 vLightMapUv;
2284#endif
2285#ifdef USE_AOMAP
2286	uniform mat3 aoMapTransform;
2287	varying vec2 vAoMapUv;
2288#endif
2289#ifdef USE_BUMPMAP
2290	uniform mat3 bumpMapTransform;
2291	varying vec2 vBumpMapUv;
2292#endif
2293#ifdef USE_NORMALMAP
2294	uniform mat3 normalMapTransform;
2295	varying vec2 vNormalMapUv;
2296#endif
2297#ifdef USE_DISPLACEMENTMAP
2298	uniform mat3 displacementMapTransform;
2299	varying vec2 vDisplacementMapUv;
2300#endif
2301#ifdef USE_EMISSIVEMAP
2302	uniform mat3 emissiveMapTransform;
2303	varying vec2 vEmissiveMapUv;
2304#endif
2305#ifdef USE_METALNESSMAP
2306	uniform mat3 metalnessMapTransform;
2307	varying vec2 vMetalnessMapUv;
2308#endif
2309#ifdef USE_ROUGHNESSMAP
2310	uniform mat3 roughnessMapTransform;
2311	varying vec2 vRoughnessMapUv;
2312#endif
2313#ifdef USE_ANISOTROPYMAP
2314	uniform mat3 anisotropyMapTransform;
2315	varying vec2 vAnisotropyMapUv;
2316#endif
2317#ifdef USE_CLEARCOATMAP
2318	uniform mat3 clearcoatMapTransform;
2319	varying vec2 vClearcoatMapUv;
2320#endif
2321#ifdef USE_CLEARCOAT_NORMALMAP
2322	uniform mat3 clearcoatNormalMapTransform;
2323	varying vec2 vClearcoatNormalMapUv;
2324#endif
2325#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2326	uniform mat3 clearcoatRoughnessMapTransform;
2327	varying vec2 vClearcoatRoughnessMapUv;
2328#endif
2329#ifdef USE_SHEEN_COLORMAP
2330	uniform mat3 sheenColorMapTransform;
2331	varying vec2 vSheenColorMapUv;
2332#endif
2333#ifdef USE_SHEEN_ROUGHNESSMAP
2334	uniform mat3 sheenRoughnessMapTransform;
2335	varying vec2 vSheenRoughnessMapUv;
2336#endif
2337#ifdef USE_IRIDESCENCEMAP
2338	uniform mat3 iridescenceMapTransform;
2339	varying vec2 vIridescenceMapUv;
2340#endif
2341#ifdef USE_IRIDESCENCE_THICKNESSMAP
2342	uniform mat3 iridescenceThicknessMapTransform;
2343	varying vec2 vIridescenceThicknessMapUv;
2344#endif
2345#ifdef USE_SPECULARMAP
2346	uniform mat3 specularMapTransform;
2347	varying vec2 vSpecularMapUv;
2348#endif
2349#ifdef USE_SPECULAR_COLORMAP
2350	uniform mat3 specularColorMapTransform;
2351	varying vec2 vSpecularColorMapUv;
2352#endif
2353#ifdef USE_SPECULAR_INTENSITYMAP
2354	uniform mat3 specularIntensityMapTransform;
2355	varying vec2 vSpecularIntensityMapUv;
2356#endif
2357#ifdef USE_TRANSMISSIONMAP
2358	uniform mat3 transmissionMapTransform;
2359	varying vec2 vTransmissionMapUv;
2360#endif
2361#ifdef USE_THICKNESSMAP
2362	uniform mat3 thicknessMapTransform;
2363	varying vec2 vThicknessMapUv;
2364#endif`,WE=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2365	vUv = vec3( uv, 1 ).xy;
2366#endif
2367#ifdef USE_MAP
2368	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
2369#endif
2370#ifdef USE_ALPHAMAP
2371	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
2372#endif
2373#ifdef USE_LIGHTMAP
2374	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
2375#endif
2376#ifdef USE_AOMAP
2377	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
2378#endif
2379#ifdef USE_BUMPMAP
2380	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
2381#endif
2382#ifdef USE_NORMALMAP
2383	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
2384#endif
2385#ifdef USE_DISPLACEMENTMAP
2386	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
2387#endif
2388#ifdef USE_EMISSIVEMAP
2389	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
2390#endif
2391#ifdef USE_METALNESSMAP
2392	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
2393#endif
2394#ifdef USE_ROUGHNESSMAP
2395	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
2396#endif
2397#ifdef USE_ANISOTROPYMAP
2398	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
2399#endif
2400#ifdef USE_CLEARCOATMAP
2401	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
2402#endif
2403#ifdef USE_CLEARCOAT_NORMALMAP
2404	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
2405#endif
2406#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2407	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
2408#endif
2409#ifdef USE_IRIDESCENCEMAP
2410	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
2411#endif
2412#ifdef USE_IRIDESCENCE_THICKNESSMAP
2413	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
2414#endif
2415#ifdef USE_SHEEN_COLORMAP
2416	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
2417#endif
2418#ifdef USE_SHEEN_ROUGHNESSMAP
2419	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
2420#endif
2421#ifdef USE_SPECULARMAP
2422	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
2423#endif
2424#ifdef USE_SPECULAR_COLORMAP
2425	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
2426#endif
2427#ifdef USE_SPECULAR_INTENSITYMAP
2428	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
2429#endif
2430#ifdef USE_TRANSMISSIONMAP
2431	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
2432#endif
2433#ifdef USE_THICKNESSMAP
2434	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2435#endif`,XE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2436	vec4 worldPosition = vec4( transformed, 1.0 );
2437	#ifdef USE_BATCHING
2438		worldPosition = batchingMatrix * worldPosition;
2439	#endif
2440	#ifdef USE_INSTANCING
2441		worldPosition = instanceMatrix * worldPosition;
2442	#endif
2443	worldPosition = modelMatrix * worldPosition;
2444#endif`;const qE=`varying vec2 vUv;
2445uniform mat3 uvTransform;
2446void main() {
2447	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2448	gl_Position = vec4( position.xy, 1.0, 1.0 );
2449}`,YE=`uniform sampler2D t2D;
2450uniform float backgroundIntensity;
2451varying vec2 vUv;
2452void main() {
2453	vec4 texColor = texture2D( t2D, vUv );
2454	#ifdef DECODE_VIDEO_TEXTURE
2455		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 );
2456	#endif
2457	texColor.rgb *= backgroundIntensity;
2458	gl_FragColor = texColor;
2459	#include <tonemapping_fragment>
2460	#include <colorspace_fragment>
2461}`,ZE=`varying vec3 vWorldDirection;
2462#include <common>
2463void main() {
2464	vWorldDirection = transformDirection( position, modelMatrix );
2465	#include <begin_vertex>
2466	#include <project_vertex>
2467	gl_Position.z = gl_Position.w;
2468}`,JE=`#ifdef ENVMAP_TYPE_CUBE
2469	uniform samplerCube envMap;
2470#elif defined( ENVMAP_TYPE_CUBE_UV )
2471	uniform sampler2D envMap;
2472#endif
2473uniform float flipEnvMap;
2474uniform float backgroundBlurriness;
2475uniform float backgroundIntensity;
2476varying vec3 vWorldDirection;
2477#include <cube_uv_reflection_fragment>
2478void main() {
2479	#ifdef ENVMAP_TYPE_CUBE
2480		vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
2481	#elif defined( ENVMAP_TYPE_CUBE_UV )
2482		vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );
2483	#else
2484		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
2485	#endif
2486	texColor.rgb *= backgroundIntensity;
2487	gl_FragColor = texColor;
2488	#include <tonemapping_fragment>
2489	#include <colorspace_fragment>
2490}`,jE=`varying vec3 vWorldDirection;
2491#include <common>
2492void main() {
2493	vWorldDirection = transformDirection( position, modelMatrix );
2494	#include <begin_vertex>
2495	#include <project_vertex>
2496	gl_Position.z = gl_Position.w;
2497}`,KE=`uniform samplerCube tCube;
2498uniform float tFlip;
2499uniform float opacity;
2500varying vec3 vWorldDirection;
2501void main() {
2502	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
2503	gl_FragColor = texColor;
2504	gl_FragColor.a *= opacity;
2505	#include <tonemapping_fragment>
2506	#include <colorspace_fragment>
2507}`,QE=`#include <common>
2508#include <batching_pars_vertex>
2509#include <uv_pars_vertex>
2510#include <displacementmap_pars_vertex>
2511#include <morphtarget_pars_vertex>
2512#include <skinning_pars_vertex>
2513#include <logdepthbuf_pars_vertex>
2514#include <clipping_planes_pars_vertex>
2515varying vec2 vHighPrecisionZW;
2516void main() {
2517	#include <uv_vertex>
2518	#include <batching_vertex>
2519	#include <skinbase_vertex>
2520	#ifdef USE_DISPLACEMENTMAP
2521		#include <beginnormal_vertex>
2522		#include <morphnormal_vertex>
2523		#include <skinnormal_vertex>
2524	#endif
2525	#include <begin_vertex>
2526	#include <morphtarget_vertex>
2527	#include <skinning_vertex>
2528	#include <displacementmap_vertex>
2529	#include <project_vertex>
2530	#include <logdepthbuf_vertex>
2531	#include <clipping_planes_vertex>
2532	vHighPrecisionZW = gl_Position.zw;
2533}`,$E=`#if DEPTH_PACKING == 3200
2534	uniform float opacity;
2535#endif
2536#include <common>
2537#include <packing>
2538#include <uv_pars_fragment>
2539#include <map_pars_fragment>
2540#include <alphamap_pars_fragment>
2541#include <alphatest_pars_fragment>
2542#include <alphahash_pars_fragment>
2543#include <logdepthbuf_pars_fragment>
2544#include <clipping_planes_pars_fragment>
2545varying vec2 vHighPrecisionZW;
2546void main() {
2547	#include <clipping_planes_fragment>
2548	vec4 diffuseColor = vec4( 1.0 );
2549	#if DEPTH_PACKING == 3200
2550		diffuseColor.a = opacity;
2551	#endif
2552	#include <map_fragment>
2553	#include <alphamap_fragment>
2554	#include <alphatest_fragment>
2555	#include <alphahash_fragment>
2556	#include <logdepthbuf_fragment>
2557	float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
2558	#if DEPTH_PACKING == 3200
2559		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
2560	#elif DEPTH_PACKING == 3201
2561		gl_FragColor = packDepthToRGBA( fragCoordZ );
2562	#endif
2563}`,ew=`#define DISTANCE
2564varying vec3 vWorldPosition;
2565#include <common>
2566#include <batching_pars_vertex>
2567#include <uv_pars_vertex>
2568#include <displacementmap_pars_vertex>
2569#include <morphtarget_pars_vertex>
2570#include <skinning_pars_vertex>
2571#include <clipping_planes_pars_vertex>
2572void main() {
2573	#include <uv_vertex>
2574	#include <batching_vertex>
2575	#include <skinbase_vertex>
2576	#ifdef USE_DISPLACEMENTMAP
2577		#include <beginnormal_vertex>
2578		#include <morphnormal_vertex>
2579		#include <skinnormal_vertex>
2580	#endif
2581	#include <begin_vertex>
2582	#include <morphtarget_vertex>
2583	#include <skinning_vertex>
2584	#include <displacementmap_vertex>
2585	#include <project_vertex>
2586	#include <worldpos_vertex>
2587	#include <clipping_planes_vertex>
2588	vWorldPosition = worldPosition.xyz;
2589}`,tw=`#define DISTANCE
2590uniform vec3 referencePosition;
2591uniform float nearDistance;
2592uniform float farDistance;
2593varying vec3 vWorldPosition;
2594#include <common>
2595#include <packing>
2596#include <uv_pars_fragment>
2597#include <map_pars_fragment>
2598#include <alphamap_pars_fragment>
2599#include <alphatest_pars_fragment>
2600#include <alphahash_pars_fragment>
2601#include <clipping_planes_pars_fragment>
2602void main () {
2603	#include <clipping_planes_fragment>
2604	vec4 diffuseColor = vec4( 1.0 );
2605	#include <map_fragment>
2606	#include <alphamap_fragment>
2607	#include <alphatest_fragment>
2608	#include <alphahash_fragment>
2609	float dist = length( vWorldPosition - referencePosition );
2610	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
2611	dist = saturate( dist );
2612	gl_FragColor = packDepthToRGBA( dist );
2613}`,nw=`varying vec3 vWorldDirection;
2614#include <common>
2615void main() {
2616	vWorldDirection = transformDirection( position, modelMatrix );
2617	#include <begin_vertex>
2618	#include <project_vertex>
2619}`,iw=`uniform sampler2D tEquirect;
2620varying vec3 vWorldDirection;
2621#include <common>
2622void main() {
2623	vec3 direction = normalize( vWorldDirection );
2624	vec2 sampleUV = equirectUv( direction );
2625	gl_FragColor = texture2D( tEquirect, sampleUV );
2626	#include <tonemapping_fragment>
2627	#include <colorspace_fragment>
2628}`,rw=`uniform float scale;
2629attribute float lineDistance;
2630varying float vLineDistance;
2631#include <common>
2632#include <uv_pars_vertex>
2633#include <color_pars_vertex>
2634#include <fog_pars_vertex>
2635#include <morphtarget_pars_vertex>
2636#include <logdepthbuf_pars_vertex>
2637#include <clipping_planes_pars_vertex>
2638void main() {
2639	vLineDistance = scale * lineDistance;
2640	#include <uv_vertex>
2641	#include <color_vertex>
2642	#include <morphcolor_vertex>
2643	#include <begin_vertex>
2644	#include <morphtarget_vertex>
2645	#include <project_vertex>
2646	#include <logdepthbuf_vertex>
2647	#include <clipping_planes_vertex>
2648	#include <fog_vertex>
2649}`,sw=`uniform vec3 diffuse;
2650uniform float opacity;
2651uniform float dashSize;
2652uniform float totalSize;
2653varying float vLineDistance;
2654#include <common>
2655#include <color_pars_fragment>
2656#include <uv_pars_fragment>
2657#include <map_pars_fragment>
2658#include <fog_pars_fragment>
2659#include <logdepthbuf_pars_fragment>
2660#include <clipping_planes_pars_fragment>
2661void main() {
2662	#include <clipping_planes_fragment>
2663	if ( mod( vLineDistance, totalSize ) > dashSize ) {
2664		discard;
2665	}
2666	vec3 outgoingLight = vec3( 0.0 );
2667	vec4 diffuseColor = vec4( diffuse, opacity );
2668	#include <logdepthbuf_fragment>
2669	#include <map_fragment>
2670	#include <color_fragment>
2671	outgoingLight = diffuseColor.rgb;
2672	#include <opaque_fragment>
2673	#include <tonemapping_fragment>
2674	#include <colorspace_fragment>
2675	#include <fog_fragment>
2676	#include <premultiplied_alpha_fragment>
2677}`,ow=`#include <common>
2678#include <batching_pars_vertex>
2679#include <uv_pars_vertex>
2680#include <envmap_pars_vertex>
2681#include <color_pars_vertex>
2682#include <fog_pars_vertex>
2683#include <morphtarget_pars_vertex>
2684#include <skinning_pars_vertex>
2685#include <logdepthbuf_pars_vertex>
2686#include <clipping_planes_pars_vertex>
2687void main() {
2688	#include <uv_vertex>
2689	#include <color_vertex>
2690	#include <morphcolor_vertex>
2691	#include <batching_vertex>
2692	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
2693		#include <beginnormal_vertex>
2694		#include <morphnormal_vertex>
2695		#include <skinbase_vertex>
2696		#include <skinnormal_vertex>
2697		#include <defaultnormal_vertex>
2698	#endif
2699	#include <begin_vertex>
2700	#include <morphtarget_vertex>
2701	#include <skinning_vertex>
2702	#include <project_vertex>
2703	#include <logdepthbuf_vertex>
2704	#include <clipping_planes_vertex>
2705	#include <worldpos_vertex>
2706	#include <envmap_vertex>
2707	#include <fog_vertex>
2708}`,aw=`uniform vec3 diffuse;
2709uniform float opacity;
2710#ifndef FLAT_SHADED
2711	varying vec3 vNormal;
2712#endif
2713#include <common>
2714#include <dithering_pars_fragment>
2715#include <color_pars_fragment>
2716#include <uv_pars_fragment>
2717#include <map_pars_fragment>
2718#include <alphamap_pars_fragment>
2719#include <alphatest_pars_fragment>
2720#include <alphahash_pars_fragment>
2721#include <aomap_pars_fragment>
2722#include <lightmap_pars_fragment>
2723#include <envmap_common_pars_fragment>
2724#include <envmap_pars_fragment>
2725#include <fog_pars_fragment>
2726#include <specularmap_pars_fragment>
2727#include <logdepthbuf_pars_fragment>
2728#include <clipping_planes_pars_fragment>
2729void main() {
2730	#include <clipping_planes_fragment>
2731	vec4 diffuseColor = vec4( diffuse, opacity );
2732	#include <logdepthbuf_fragment>
2733	#include <map_fragment>
2734	#include <color_fragment>
2735	#include <alphamap_fragment>
2736	#include <alphatest_fragment>
2737	#include <alphahash_fragment>
2738	#include <specularmap_fragment>
2739	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
2740	#ifdef USE_LIGHTMAP
2741		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
2742		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
2743	#else
2744		reflectedLight.indirectDiffuse += vec3( 1.0 );
2745	#endif
2746	#include <aomap_fragment>
2747	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
2748	vec3 outgoingLight = reflectedLight.indirectDiffuse;
2749	#include <envmap_fragment>
2750	#include <opaque_fragment>
2751	#include <tonemapping_fragment>
2752	#include <colorspace_fragment>
2753	#include <fog_fragment>
2754	#include <premultiplied_alpha_fragment>
2755	#include <dithering_fragment>
2756}`,lw=`#define LAMBERT
2757varying vec3 vViewPosition;
2758#include <common>
2759#include <batching_pars_vertex>
2760#include <uv_pars_vertex>
2761#include <displacementmap_pars_vertex>
2762#include <envmap_pars_vertex>
2763#include <color_pars_vertex>
2764#include <fog_pars_vertex>
2765#include <normal_pars_vertex>
2766#include <morphtarget_pars_vertex>
2767#include <skinning_pars_vertex>
2768#include <shadowmap_pars_vertex>
2769#include <logdepthbuf_pars_vertex>
2770#include <clipping_planes_pars_vertex>
2771void main() {
2772	#include <uv_vertex>
2773	#include <color_vertex>
2774	#include <morphcolor_vertex>
2775	#include <batching_vertex>
2776	#include <beginnormal_vertex>
2777	#include <morphnormal_vertex>
2778	#include <skinbase_vertex>
2779	#include <skinnormal_vertex>
2780	#include <defaultnormal_vertex>
2781	#include <normal_vertex>
2782	#include <begin_vertex>
2783	#include <morphtarget_vertex>
2784	#include <skinning_vertex>
2785	#include <displacementmap_vertex>
2786	#include <project_vertex>
2787	#include <logdepthbuf_vertex>
2788	#include <clipping_planes_vertex>
2789	vViewPosition = - mvPosition.xyz;
2790	#include <worldpos_vertex>
2791	#include <envmap_vertex>
2792	#include <shadowmap_vertex>
2793	#include <fog_vertex>
2794}`,cw=`#define LAMBERT
2795uniform vec3 diffuse;
2796uniform vec3 emissive;
2797uniform float opacity;
2798#include <common>
2799#include <packing>
2800#include <dithering_pars_fragment>
2801#include <color_pars_fragment>
2802#include <uv_pars_fragment>
2803#include <map_pars_fragment>
2804#include <alphamap_pars_fragment>
2805#include <alphatest_pars_fragment>
2806#include <alphahash_pars_fragment>
2807#include <aomap_pars_fragment>
2808#include <lightmap_pars_fragment>
2809#include <emissivemap_pars_fragment>
2810#include <envmap_common_pars_fragment>
2811#include <envmap_pars_fragment>
2812#include <fog_pars_fragment>
2813#include <bsdfs>
2814#include <lights_pars_begin>
2815#include <normal_pars_fragment>
2816#include <lights_lambert_pars_fragment>
2817#include <shadowmap_pars_fragment>
2818#include <bumpmap_pars_fragment>
2819#include <normalmap_pars_fragment>
2820#include <specularmap_pars_fragment>
2821#include <logdepthbuf_pars_fragment>
2822#include <clipping_planes_pars_fragment>
2823void main() {
2824	#include <clipping_planes_fragment>
2825	vec4 diffuseColor = vec4( diffuse, opacity );
2826	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
2827	vec3 totalEmissiveRadiance = emissive;
2828	#include <logdepthbuf_fragment>
2829	#include <map_fragment>
2830	#include <color_fragment>
2831	#include <alphamap_fragment>
2832	#include <alphatest_fragment>
2833	#include <alphahash_fragment>
2834	#include <specularmap_fragment>
2835	#include <normal_fragment_begin>
2836	#include <normal_fragment_maps>
2837	#include <emissivemap_fragment>
2838	#include <lights_lambert_fragment>
2839	#include <lights_fragment_begin>
2840	#include <lights_fragment_maps>
2841	#include <lights_fragment_end>
2842	#include <aomap_fragment>
2843	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
2844	#include <envmap_fragment>
2845	#include <opaque_fragment>
2846	#include <tonemapping_fragment>
2847	#include <colorspace_fragment>
2848	#include <fog_fragment>
2849	#include <premultiplied_alpha_fragment>
2850	#include <dithering_fragment>
2851}`,uw=`#define MATCAP
2852varying vec3 vViewPosition;
2853#include <common>
2854#include <batching_pars_vertex>
2855#include <uv_pars_vertex>
2856#include <color_pars_vertex>
2857#include <displacementmap_pars_vertex>
2858#include <fog_pars_vertex>
2859#include <normal_pars_vertex>
2860#include <morphtarget_pars_vertex>
2861#include <skinning_pars_vertex>
2862#include <logdepthbuf_pars_vertex>
2863#include <clipping_planes_pars_vertex>
2864void main() {
2865	#include <uv_vertex>
2866	#include <color_vertex>
2867	#include <morphcolor_vertex>
2868	#include <batching_vertex>
2869	#include <beginnormal_vertex>
2870	#include <morphnormal_vertex>
2871	#include <skinbase_vertex>
2872	#include <skinnormal_vertex>
2873	#include <defaultnormal_vertex>
2874	#include <normal_vertex>
2875	#include <begin_vertex>
2876	#include <morphtarget_vertex>
2877	#include <skinning_vertex>
2878	#include <displacementmap_vertex>
2879	#include <project_vertex>
2880	#include <logdepthbuf_vertex>
2881	#include <clipping_planes_vertex>
2882	#include <fog_vertex>
2883	vViewPosition = - mvPosition.xyz;
2884}`,hw=`#define MATCAP
2885uniform vec3 diffuse;
2886uniform float opacity;
2887uniform sampler2D matcap;
2888varying vec3 vViewPosition;
2889#include <common>
2890#include <dithering_pars_fragment>
2891#include <color_pars_fragment>
2892#include <uv_pars_fragment>
2893#include <map_pars_fragment>
2894#include <alphamap_pars_fragment>
2895#include <alphatest_pars_fragment>
2896#include <alphahash_pars_fragment>
2897#include <fog_pars_fragment>
2898#include <normal_pars_fragment>
2899#include <bumpmap_pars_fragment>
2900#include <normalmap_pars_fragment>
2901#include <logdepthbuf_pars_fragment>
2902#include <clipping_planes_pars_fragment>
2903void main() {
2904	#include <clipping_planes_fragment>
2905	vec4 diffuseColor = vec4( diffuse, opacity );
2906	#include <logdepthbuf_fragment>
2907	#include <map_fragment>
2908	#include <color_fragment>
2909	#include <alphamap_fragment>
2910	#include <alphatest_fragment>
2911	#include <alphahash_fragment>
2912	#include <normal_fragment_begin>
2913	#include <normal_fragment_maps>
2914	vec3 viewDir = normalize( vViewPosition );
2915	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
2916	vec3 y = cross( viewDir, 
2916x );
2917	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
2918	#ifdef USE_MATCAP
2919		vec4 matcapColor = texture2D( matcap, uv );
2920	#else
2921		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
2922	#endif
2923	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
2924	#include <opaque_fragment>
2925	#include <tonemapping_fragment>
2926	#include <colorspace_fragment>
2927	#include <fog_fragment>
2928	#include <premultiplied_alpha_fragment>
2929	#include <dithering_fragment>
2930}`,fw=`#define NORMAL
2931#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
2932	varying vec3 vViewPosition;
2933#endif
2934#include <common>
2935#include <batching_pars_vertex>
2936#include <uv_pars_vertex>
2937#include <displacementmap_pars_vertex>
2938#include <normal_pars_vertex>
2939#include <morphtarget_pars_vertex>
2940#include <skinning_pars_vertex>
2941#include <logdepthbuf_pars_vertex>
2942#include <clipping_planes_pars_vertex>
2943void main() {
2944	#include <uv_vertex>
2945	#include <batching_vertex>
2946	#include <beginnormal_vertex>
2947	#include <morphnormal_vertex>
2948	#include <skinbase_vertex>
2949	#include <skinnormal_vertex>
2950	#include <defaultnormal_vertex>
2951	#include <normal_vertex>
2952	#include <begin_vertex>
2953	#include <morphtarget_vertex>
2954	#include <skinning_vertex>
2955	#include <displacementmap_vertex>
2956	#include <project_vertex>
2957	#include <logdepthbuf_vertex>
2958	#include <clipping_planes_vertex>
2959#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
2960	vViewPosition = - mvPosition.xyz;
2961#endif
2962}`,dw=`#define NORMAL
2963uniform float opacity;
2964#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
2965	varying vec3 vViewPosition;
2966#endif
2967#include <packing>
2968#include <uv_pars_fragment>
2969#include <normal_pars_fragment>
2970#include <bumpmap_pars_fragment>
2971#include <normalmap_pars_fragment>
2972#include <logdepthbuf_pars_fragment>
2973#include <clipping_planes_pars_fragment>
2974void main() {
2975	#include <clipping_planes_fragment>
2976	#include <logdepthbuf_fragment>
2977	#include <normal_fragment_begin>
2978	#include <normal_fragment_maps>
2979	gl_FragColor = vec4( packNormalToRGB( normal ), opacity );
2980	#ifdef OPAQUE
2981		gl_FragColor.a = 1.0;
2982	#endif
2983}`,pw=`#define PHONG
2984varying vec3 vViewPosition;
2985#include <common>
2986#include <batching_pars_vertex>
2987#include <uv_pars_vertex>
2988#include <displacementmap_pars_vertex>
2989#include <envmap_pars_vertex>
2990#include <color_pars_vertex>
2991#include <fog_pars_vertex>
2992#include <normal_pars_vertex>
2993#include <morphtarget_pars_vertex>
2994#include <skinning_pars_vertex>
2995#include <shadowmap_pars_vertex>
2996#include <logdepthbuf_pars_vertex>
2997#include <clipping_planes_pars_vertex>
2998void main() {
2999	#include <uv_vertex>
3000	#include <color_vertex>
3001	#include <morphcolor_vertex>
3002	#include <batching_vertex>
3003	#include <beginnormal_vertex>
3004	#include <morphnormal_vertex>
3005	#include <skinbase_vertex>
3006	#include <skinnormal_vertex>
3007	#include <defaultnormal_vertex>
3008	#include <normal_vertex>
3009	#include <begin_vertex>
3010	#include <morphtarget_vertex>
3011	#include <skinning_vertex>
3012	#include <displacementmap_vertex>
3013	#include <project_vertex>
3014	#include <logdepthbuf_vertex>
3015	#include <clipping_planes_vertex>
3016	vViewPosition = - mvPosition.xyz;
3017	#include <worldpos_vertex>
3018	#include <envmap_vertex>
3019	#include <shadowmap_vertex>
3020	#include <fog_vertex>
3021}`,mw=`#define PHONG
3022uniform vec3 diffuse;
3023uniform vec3 emissive;
3024uniform vec3 specular;
3025uniform float shininess;
3026uniform float opacity;
3027#include <common>
3028#include <packing>
3029#include <dithering_pars_fragment>
3030#include <color_pars_fragment>
3031#include <uv_pars_fragment>
3032#include <map_pars_fragment>
3033#include <alphamap_pars_fragment>
3034#include <alphatest_pars_fragment>
3035#include <alphahash_pars_fragment>
3036#include <aomap_pars_fragment>
3037#include <lightmap_pars_fragment>
3038#include <emissivemap_pars_fragment>
3039#include <envmap_common_pars_fragment>
3040#include <envmap_pars_fragment>
3041#include <fog_pars_fragment>
3042#include <bsdfs>
3043#include <lights_pars_begin>
3044#include <normal_pars_fragment>
3045#include <lights_phong_pars_fragment>
3046#include <shadowmap_pars_fragment>
3047#include <bumpmap_pars_fragment>
3048#include <normalmap_pars_fragment>
3049#include <specularmap_pars_fragment>
3050#include <logdepthbuf_pars_fragment>
3051#include <clipping_planes_pars_fragment>
3052void main() {
3053	#include <clipping_planes_fragment>
3054	vec4 diffuseColor = vec4( diffuse, opacity );
3055	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3056	vec3 totalEmissiveRadiance = emissive;
3057	#include <logdepthbuf_fragment>
3058	#include <map_fragment>
3059	#include <color_fragment>
3060	#include <alphamap_fragment>
3061	#include <alphatest_fragment>
3062	#include <alphahash_fragment>
3063	#include <specularmap_fragment>
3064	#include <normal_fragment_begin>
3065	#include <normal_fragment_maps>
3066	#include <emissivemap_fragment>
3067	#include <lights_phong_fragment>
3068	#include <lights_fragment_begin>
3069	#include <lights_fragment_maps>
3070	#include <lights_fragment_end>
3071	#include <aomap_fragment>
3072	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
3073	#include <envmap_fragment>
3074	#include <opaque_fragment>
3075	#include <tonemapping_fragment>
3076	#include <colorspace_fragment>
3077	#include <fog_fragment>
3078	#include <premultiplied_alpha_fragment>
3079	#include <dithering_fragment>
3080}`,gw=`#define STANDARD
3081varying vec3 vViewPosition;
3082#ifdef USE_TRANSMISSION
3083	varying vec3 vWorldPosition;
3084#endif
3085#include <common>
3086#include <batching_pars_vertex>
3087#include <uv_pars_vertex>
3088#include <displacementmap_pars_vertex>
3089#include <color_pars_vertex>
3090#include <fog_pars_vertex>
3091#include <normal_pars_vertex>
3092#include <morphtarget_pars_vertex>
3093#include <skinning_pars_vertex>
3094#include <shadowmap_pars_vertex>
3095#include <logdepthbuf_pars_vertex>
3096#include <clipping_planes_pars_vertex>
3097void main() {
3098	#include <uv_vertex>
3099	#include <color_vertex>
3100	#include <morphcolor_vertex>
3101	#include <batching_vertex>
3102	#include <beginnormal_vertex>
3103	#include <morphnormal_vertex>
3104	#include <skinbase_vertex>
3105	#include <skinnormal_vertex>
3106	#include <defaultnormal_vertex>
3107	#include <normal_vertex>
3108	#include <begin_vertex>
3109	#include <morphtarget_vertex>
3110	#include <skinning_vertex>
3111	#include <displacementmap_vertex>
3112	#include <project_vertex>
3113	#include <logdepthbuf_vertex>
3114	#include <clipping_planes_vertex>
3115	vViewPosition = - mvPosition.xyz;
3116	#include <worldpos_vertex>
3117	#include <shadowmap_vertex>
3118	#include <fog_vertex>
3119#ifdef USE_TRANSMISSION
3120	vWorldPosition = worldPosition.xyz;
3121#endif
3122}`,_w=`#define STANDARD
3123#ifdef PHYSICAL
3124	#define IOR
3125	#define USE_SPECULAR
3126#endif
3127uniform vec3 diffuse;
3128uniform vec3 emissive;
3129uniform float roughness;
3130uniform float metalness;
3131uniform float opacity;
3132#ifdef IOR
3133	uniform float ior;
3134#endif
3135#ifdef USE_SPECULAR
3136	uniform float specularIntensity;
3137	uniform vec3 specularColor;
3138	#ifdef USE_SPECULAR_COLORMAP
3139		uniform sampler2D specularColorMap;
3140	#endif
3141	#ifdef USE_SPECULAR_INTENSITYMAP
3142		uniform sampler2D specularIntensityMap;
3143	#endif
3144#endif
3145#ifdef USE_CLEARCOAT
3146	uniform float clearcoat;
3147	uniform float clearcoatRoughness;
3148#endif
3149#ifdef USE_IRIDESCENCE
3150	uniform float iridescence;
3151	uniform float iridescenceIOR;
3152	uniform float iridescenceThicknessMinimum;
3153	uniform float iridescenceThicknessMaximum;
3154#endif
3155#ifdef USE_SHEEN
3156	uniform vec3 sheenColor;
3157	uniform float sheenRoughness;
3158	#ifdef USE_SHEEN_COLORMAP
3159		uniform sampler2D sheenColorMap;
3160	#endif
3161	#ifdef USE_SHEEN_ROUGHNESSMAP
3162		uniform sampler2D sheenRoughnessMap;
3163	#endif
3164#endif
3165#ifdef USE_ANISOTROPY
3166	uniform vec2 anisotropyVector;
3167	#ifdef USE_ANISOTROPYMAP
3168		uniform sampler2D anisotropyMap;
3169	#endif
3170#endif
3171varying vec3 vViewPosition;
3172#include <common>
3173#include <packing>
3174#include <dithering_pars_fragment>
3175#include <color_pars_fragment>
3176#include <uv_pars_fragment>
3177#include <map_pars_fragment>
3178#include <alphamap_pars_fragment>
3179#include <alphatest_pars_fragment>
3180#include <alphahash_pars_fragment>
3181#include <aomap_pars_fragment>
3182#include <lightmap_pars_fragment>
3183#include <emissivemap_pars_fragment>
3184#include <iridescence_fragment>
3185#include <cube_uv_reflection_fragment>
3186#include <envmap_common_pars_fragment>
3187#include <envmap_physical_pars_fragment>
3188#include <fog_pars_fragment>
3189#include <lights_pars_begin>
3190#include <normal_pars_fragment>
3191#include <lights_physical_pars_fragment>
3192#include <transmission_pars_fragment>
3193#include <shadowmap_pars_fragment>
3194#include <bumpmap_pars_fragment>
3195#include <normalmap_pars_fragment>
3196#include <clearcoat_pars_fragment>
3197#include <iridescence_pars_fragment>
3198#include <roughnessmap_pars_fragment>
3199#include <metalnessmap_pars_fragment>
3200#include <logdepthbuf_pars_fragment>
3201#include <clipping_planes_pars_fragment>
3202void main() {
3203	#include <clipping_planes_fragment>
3204	vec4 diffuseColor = vec4( diffuse, opacity );
3205	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3206	vec3 totalEmissiveRadiance = emissive;
3207	#include <logdepthbuf_fragment>
3208	#include <map_fragment>
3209	#include <color_fragment>
3210	#include <alphamap_fragment>
3211	#include <alphatest_fragment>
3212	#include <alphahash_fragment>
3213	#include <roughnessmap_fragment>
3214	#include <metalnessmap_fragment>
3215	#include <normal_fragment_begin>
3216	#include <normal_fragment_maps>
3217	#include <clearcoat_normal_fragment_begin>
3218	#include <clearcoat_normal_fragment_maps>
3219	#include <emissivemap_fragment>
3220	#include <lights_physical_fragment>
3221	#include <lights_fragment_begin>
3222	#include <lights_fragment_maps>
3223	#include <lights_fragment_end>
3224	#include <aomap_fragment>
3225	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
3226	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
3227	#include <transmission_fragment>
3228	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
3229	#ifdef USE_SHEEN
3230		float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
3231		outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
3232	#endif
3233	#ifdef USE_CLEARCOAT
3234		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
3235		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
3236		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
3237	#endif
3238	#include <opaque_fragment>
3239	#include <tonemapping_fragment>
3240	#include <colorspace_fragment>
3241	#include <fog_fragment>
3242	#include <premultiplied_alpha_fragment>
3243	#include <dithering_fragment>
3244}`,vw=`#define TOON
3245varying vec3 vViewPosition;
3246#include <common>
3247#include <batching_pars_vertex>
3248#include <uv_pars_vertex>
3249#include <displacementmap_pars_vertex>
3250#include <color_pars_vertex>
3251#include <fog_pars_vertex>
3252#include <normal_pars_vertex>
3253#include <morphtarget_pars_vertex>
3254#include <skinning_pars_vertex>
3255#include <shadowmap_pars_vertex>
3256#include <logdepthbuf_pars_vertex>
3257#include <clipping_planes_pars_vertex>
3258void main() {
3259	#include <uv_vertex>
3260	#include <color_vertex>
3261	#include <morphcolor_vertex>
3262	#include <batching_vertex>
3263	#include <beginnormal_vertex>
3264	#include <morphnormal_vertex>
3265	#include <skinbase_vertex>
3266	#include <skinnormal_vertex>
3267	#include <defaultnormal_vertex>
3268	#include <normal_vertex>
3269	#include <begin_vertex>
3270	#include <morphtarget_vertex>
3271	#include <skinning_vertex>
3272	#include <displacementmap_vertex>
3273	#include <project_vertex>
3274	#include <logdepthbuf_vertex>
3275	#include <clipping_planes_vertex>
3276	vViewPosition = - mvPosition.xyz;
3277	#include <worldpos_vertex>
3278	#include <shadowmap_vertex>
3279	#include <fog_vertex>
3280}
3280`,yw=`#define TOON
3281uniform vec3 diffuse;
3282uniform vec3 emissive;
3283uniform float opacity;
3284#include <common>
3285#include <packing>
3286#include <dithering_pars_fragment>
3287#include <color_pars_fragment>
3288#include <uv_pars_fragment>
3289#include <map_pars_fragment>
3290#include <alphamap_pars_fragment>
3291#include <alphatest_pars_fragment>
3292#include <alphahash_pars_fragment>
3293#include <aomap_pars_fragment>
3294#include <lightmap_pars_fragment>
3295#include <emissivemap_pars_fragment>
3296#include <gradientmap_pars_fragment>
3297#include <fog_pars_fragment>
3298#include <bsdfs>
3299#include <lights_pars_begin>
3300#include <normal_pars_fragment>
3301#include <lights_toon_pars_fragment>
3302#include <shadowmap_pars_fragment>
3303#include <bumpmap_pars_fragment>
3304#include <normalmap_pars_fragment>
3305#include <logdepthbuf_pars_fragment>
3306#include <clipping_planes_pars_fragment>
3307void main() {
3308	#include <clipping_planes_fragment>
3309	vec4 diffuseColor = vec4( diffuse, opacity );
3310	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3311	vec3 totalEmissiveRadiance = emissive;
3312	#include <logdepthbuf_fragment>
3313	#include <map_fragment>
3314	#include <color_fragment>
3315	#include <alphamap_fragment>
3316	#include <alphatest_fragment>
3317	#include <alphahash_fragment>
3318	#include <normal_fragment_begin>
3319	#include <normal_fragment_maps>
3320	#include <emissivemap_fragment>
3321	#include <lights_toon_fragment>
3322	#include <lights_fragment_begin>
3323	#include <lights_fragment_maps>
3324	#include <lights_fragment_end>
3325	#include <aomap_fragment>
3326	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3327	#include <opaque_fragment>
3328	#include <tonemapping_fragment>
3329	#include <colorspace_fragment>
3330	#include <fog_fragment>
3331	#include <premultiplied_alpha_fragment>
3332	#include <dithering_fragment>
3333}`,xw=`uniform float size;
3334uniform float scale;
3335#include <common>
3336#include <color_pars_vertex>
3337#include <fog_pars_vertex>
3338#include <morphtarget_pars_vertex>
3339#include <logdepthbuf_pars_vertex>
3340#include <clipping_planes_pars_vertex>
3341#ifdef USE_POINTS_UV
3342	varying vec2 vUv;
3343	uniform mat3 uvTransform;
3344#endif
3345void main() {
3346	#ifdef USE_POINTS_UV
3347		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
3348	#endif
3349	#include <color_vertex>
3350	#include <morphcolor_vertex>
3351	#include <begin_vertex>
3352	#include <morphtarget_vertex>
3353	#include <project_vertex>
3354	gl_PointSize = size;
3355	#ifdef USE_SIZEATTENUATION
3356		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3357		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
3358	#endif
3359	#include <logdepthbuf_vertex>
3360	#include <clipping_planes_vertex>
3361	#include <worldpos_vertex>
3362	#include <fog_vertex>
3363}`,Sw=`uniform vec3 diffuse;
3364uniform float opacity;
3365#include <common>
3366#include <color_pars_fragment>
3367#include <map_particle_pars_fragment>
3368#include <alphatest_pars_fragment>
3369#include <alphahash_pars_fragment>
3370#include <fog_pars_fragment>
3371#include <logdepthbuf_pars_fragment>
3372#include <clipping_planes_pars_fragment>
3373void main() {
3374	#include <clipping_planes_fragment>
3375	vec3 outgoingLight = vec3( 0.0 );
3376	vec4 diffuseColor = vec4( diffuse, opacity );
3377	#include <logdepthbuf_fragment>
3378	#include <map_particle_fragment>
3379	#include <color_fragment>
3380	#include <alphatest_fragment>
3381	#include <alphahash_fragment>
3382	outgoingLight = diffuseColor.rgb;
3383	#include <opaque_fragment>
3384	#include <tonemapping_fragment>
3385	#include <colorspace_fragment>
3386	#include <fog_fragment>
3387	#include <premultiplied_alpha_fragment>
3388}`,Mw=`#include <common>
3389#include <batching_pars_vertex>
3390#include <fog_pars_vertex>
3391#include <morphtarget_pars_vertex>
3392#include <skinning_pars_vertex>
3393#include <logdepthbuf_pars_vertex>
3394#include <shadowmap_pars_vertex>
3395void main() {
3396	#include <batching_vertex>
3397	#include <beginnormal_vertex>
3398	#include <morphnormal_vertex>
3399	#include <skinbase_vertex>
3400	#include <skinnormal_vertex>
3401	#include <defaultnormal_vertex>
3402	#include <begin_vertex>
3403	#include <morphtarget_vertex>
3404	#include <skinning_vertex>
3405	#include <project_vertex>
3406	#include <logdepthbuf_vertex>
3407	#include <worldpos_vertex>
3408	#include <shadowmap_vertex>
3409	#include <fog_vertex>
3410}`,Ew=`uniform vec3 color;
3411uniform float opacity;
3412#include <common>
3413#include <packing>
3414#include <fog_pars_fragment>
3415#include <bsdfs>
3416#include <lights_pars_begin>
3417#include <logdepthbuf_pars_fragment>
3418#include <shadowmap_pars_fragment>
3419#include <shadowmask_pars_fragment>
3420void main() {
3421	#include <logdepthbuf_fragment>
3422	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
3423	#include <tonemapping_fragment>
3424	#include <colorspace_fragment>
3425	#include <fog_fragment>
3426}`,ww=`uniform float rotation;
3427uniform vec2 center;
3428#include <common>
3429#include <uv_pars_vertex>
3430#include <fog_pars_vertex>
3431#include <logdepthbuf_pars_vertex>
3432#include <clipping_planes_pars_vertex>
3433void main() {
3434	#include <uv_vertex>
3435	vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
3436	vec2 scale;
3437	scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
3438	scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
3439	#ifndef USE_SIZEATTENUATION
3440		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3441		if ( isPerspective ) scale *= - mvPosition.z;
3442	#endif
3443	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
3444	vec2 rotatedPosition;
3445	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
3446	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
3447	mvPosition.xy += rotatedPosition;
3448	gl_Position = projectionMatrix * mvPosition;
3449	#include <logdepthbuf_vertex>
3450	#include <clipping_planes_vertex>
3451	#include <fog_vertex>
3452}`,Tw=`uniform vec3 diffuse;
3453uniform float opacity;
3454#include <common>
3455#include <uv_pars_fragment>
3456#include <map_pars_fragment>
3457#include <alphamap_pars_fragment>
3458#include <alphatest_pars_fragment>
3459#include <alphahash_pars_fragment>
3460#include <fog_pars_fragment>
3461#include <logdepthbuf_pars_fragment>
3462#include <clipping_planes_pars_fragment>
3463void main() {
3464	#include <clipping_planes_fragment>
3465	vec3 outgoingLight = vec3( 0.0 );
3466	vec4 diffuseColor = vec4( diffuse, opacity );
3467	#include <logdepthbuf_fragment>
3468	#include <map_fragment>
3469	#include <alphamap_fragment>
3470	#include <alphatest_fragment>
3471	#include <alphahash_fragment>
3472	outgoingLight = diffuseColor.rgb;
3473	#include <opaque_fragment>
3474	#include <tonemapping_fragment>
3475	#include <colorspace_fragment>
3476	#include <fog_fragment>
3477}`,ht={alphahash_fragment:YS,alphahash_pars_fragment:ZS,alphamap_fragment:JS,alphamap_pars_fragment:jS,alphatest_fragment:KS,alphatest_pars_fragment:QS,aomap_fragment:$S,aomap_pars_fragment:eM,batching_pars_vertex:tM,batching_vertex:nM,begin_vertex:iM,beginnormal_vertex:rM,bsdfs:sM,iridescence_fragment:oM,bumpmap_pars_fragment:aM,clipping_planes_fragment:lM,clipping_planes_pars_fragment:cM,clipping_planes_pars_vertex:uM,clipping_planes_vertex:hM,color_fragment:fM,color_pars_fragment:dM,color_pars_vertex:pM,color_vertex:mM,common:gM,cube_uv_reflection_fragment:_M,defaultnormal_vertex:vM,displacementmap_pars_vertex:yM,displacementmap_vertex:xM,emissivemap_fragment:SM,emissivemap_pars_fragment:MM,colorspace_fragment:EM,colorspace_pars_fragment:wM,envmap_fragment:TM,envmap_common_pars_fragment:AM,envmap_pars_fragment:bM,envmap_pars_vertex:CM,envmap_physical_pars_fragment:kM,envmap_vertex:RM,fog_vertex:PM,fog_pars_vertex:LM,fog_fragment:IM,fog_pars_fragment:DM,gradientmap_pars_fragment:NM,lightmap_fragment:UM,lightmap_pars_fragment:OM,lights_lambert_fragment:FM,lights_lambert_pars_fragment:BM,lights_pars_begin:zM,lights_toon_fragment:HM,lights_toon_pars_fragment:VM,lights_phong_fragment:GM,lights_phong_pars_fragment:WM,lights_physical_fragment:XM,lights_physical_pars_fragment:qM,lights_fragment_begin:YM,lights_fragment_maps:ZM,lights_fragment_end:JM,logdepthbuf_fragment:jM,logdepthbuf_pars_fragment:KM,logdepthbuf_pars_vertex:QM,logdepthbuf_vertex:$M,map_fragment:eE,map_pars_fragment:tE,map_particle_fragment:nE,map_particle_pars_fragment:iE,metalnessmap_fragment:rE,metalnessmap_pars_fragment:sE,morphcolor_vertex:oE,morphnormal_vertex:aE,morphtarget_pars_vertex:lE,morphtarget_vertex:cE,normal_fragment_begin:uE,normal_fragment_maps:hE,normal_pars_fragment:fE,normal_pars_vertex:dE,normal_vertex:pE,normalmap_pars_fragment:mE,clearcoat_normal_fragment_begin:gE,clearcoat_normal_fragment_maps:_E,clearcoat_pars_fragment:vE,iridescence_pars_fragment:yE,op
vendor: 5,345 bytes, line 3477
3477aque_fragment:xE,packing:SE,premultiplied_alpha_fragment:ME,project_vertex:EE,dithering_fragment:wE,dithering_pars_fragment:TE,roughnessmap_fragment:AE,roughnessmap_pars_fragment:bE,shadowmap_pars_fragment:CE,shadowmap_pars_vertex:RE,shadowmap_vertex:PE,shadowmask_pars_fragment:LE,skinbase_vertex:IE,skinning_pars_vertex:DE,skinning_vertex:NE,skinnormal_vertex:UE,specularmap_fragment:OE,specularmap_pars_fragment:FE,tonemapping_fragment:BE,tonemapping_pars_fragment:zE,transmission_fragment:kE,transmission_pars_fragment:HE,uv_pars_fragment:VE,uv_pars_vertex:GE,uv_vertex:WE,worldpos_vertex:XE,background_vert:qE,background_frag:YE,backgroundCube_vert:ZE,backgroundCube_frag:JE,cube_vert:jE,cube_frag:KE,depth_vert:QE,depth_frag:$E,distanceRGBA_vert:ew,distanceRGBA_frag:tw,equirect_vert:nw,equirect_frag:iw,linedashed_vert:rw,linedashed_frag:sw,meshbasic_vert:ow,meshbasic_frag:aw,meshlambert_vert:lw,meshlambert_frag:cw,meshmatcap_vert:uw,meshmatcap_frag:hw,meshnormal_vert:fw,meshnormal_frag:dw,meshphong_vert:pw,meshphong_frag:mw,meshphysical_vert:gw,meshphysical_frag:_w,meshtoon_vert:vw,meshtoon_frag:yw,points_vert:xw,points_frag:Sw,shadow_vert:Mw,shadow_frag:Ew,sprite_vert:ww,sprite_frag:Tw},Me={common:{diffuse:{value:new Ie(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new gt},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new gt}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new gt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new gt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new gt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new gt},normalScale:{value:new fe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new gt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new gt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new gt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new gt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ie(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ie(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0},uvTransform:{value:new gt}},sprite:{diffuse:{value:new Ie(16777215)},opacity:{value:1},center:{value:new fe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new gt},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0}}},Ei={basic:{uniforms:On([Me.common,Me.specularmap,Me.envmap,Me.aomap,Me.lightmap,Me.fog]),vertexShader:ht.meshbasic_vert,fragmentShader:ht.meshbasic_frag},lambert:{uniforms:On([Me.common,Me.specularmap,Me.envmap,Me.aomap,Me.lightmap,Me.emissivemap,Me.bumpmap,Me.normalmap,Me.displacementmap,Me.fog,Me.lights,{emissive:{value:new Ie(0)}}]),vertexShader:ht.meshlambert_vert,fragmentShader:ht.meshlambert_frag},phong:{uniforms:On([Me.common,Me.specularmap,Me.envmap,Me.aomap,Me.lightmap,Me.emissivemap,Me.bumpmap,Me.normalmap,Me.displacementmap,Me.fog,Me.lights,{emissive:{value:new Ie(0)},specular:{value:new Ie(1118481)},shininess:{value:30}}]),vertexShader:ht.meshphong_vert,fragmentShader:ht.meshphong_frag},standard:{uniforms:On([Me.common,Me.envmap,Me.aomap,Me.lightmap,Me.emissivemap,Me.bumpmap,Me.normalmap,Me.displacementmap,Me.roughnessmap,Me.metalnessmap,Me.fog,Me.lights,{emissive:{value:new Ie(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ht.meshphysical_vert,fragmentShader:ht.meshphysical_frag},toon:{uniforms:On([Me.common,Me.aomap,Me.lightmap,Me.emissivemap,Me.bumpmap,Me.normalmap,Me.displacementmap,Me.gradientmap,Me.fog,Me.lights,{emissive:{value:new Ie(0)}}]),vertexShader:ht.meshtoon_vert,fragmentShader:ht.meshtoon_frag},matcap:{uniforms:On([Me.common,Me.bumpmap,Me.normalmap,Me.displacementmap,Me.fog,{matc
vendor: 8,074 bytes, line 3477
3477ap:{value:null}}]),vertexShader:ht.meshmatcap_vert,fragmentShader:ht.meshmatcap_frag},points:{uniforms:On([Me.points,Me.fog]),vertexShader:ht.points_vert,fragmentShader:ht.points_frag},dashed:{uniforms:On([Me.common,Me.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ht.linedashed_vert,fragmentShader:ht.linedashed_frag},depth:{uniforms:On([Me.common,Me.displacementmap]),vertexShader:ht.depth_vert,fragmentShader:ht.depth_frag},normal:{uniforms:On([Me.common,Me.bumpmap,Me.normalmap,Me.displacementmap,{opacity:{value:1}}]),vertexShader:ht.meshnormal_vert,fragmentShader:ht.meshnormal_frag},sprite:{uniforms:On([Me.sprite,Me.fog]),vertexShader:ht.sprite_vert,fragmentShader:ht.sprite_frag},background:{uniforms:{uvTransform:{value:new gt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ht.background_vert,fragmentShader:ht.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:ht.backgroundCube_vert,fragmentShader:ht.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ht.cube_vert,fragmentShader:ht.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ht.equirect_vert,fragmentShader:ht.equirect_frag},distanceRGBA:{uniforms:On([Me.common,Me.displacementmap,{referencePosition:{value:new U},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ht.distanceRGBA_vert,fragmentShader:ht.distanceRGBA_frag},shadow:{uniforms:On([Me.lights,Me.fog,{color:{value:new Ie(0)},opacity:{value:1}}]),vertexShader:ht.shadow_vert,fragmentShader:ht.shadow_frag}};Ei.physical={uniforms:On([Ei.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new gt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new gt},clearcoatNormalScale:{value:new fe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new gt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new gt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new gt},sheen:{value:0},sheenColor:{value:new Ie(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new gt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new gt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new gt},transmissionSamplerSize:{value:new fe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new gt},attenuationDistance:{value:0},attenuationColor:{value:new Ie(0)},specularColor:{value:new Ie(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new gt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new gt},anisotropyVector:{value:new fe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new gt}}]),vertexShader:ht.meshphysical_vert,fragmentShader:ht.meshphysical_frag};const mc={r:0,b:0,g:0};function Aw(r,e,t,n,i,s,l){const c=new Ie(0);let u=s===!0?0:1,h,f,p=null,m=0,g=null;function y(x,v){let w=!1,E=v.isScene===!0?v.background:null;E&&E.isTexture&&(E=(v.backgroundBlurriness>0?t:e).get(E)),E===null?M(c,u):E&&E.isColor&&(M(E,1),w=!0);const A=r.xr.getEnvironmentBlendMode();A==="additive"?n.buffers.color.setClear(0,0,0,1,l):A==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,l),(r.autoClear||w)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),E&&(E.isCubeTexture||E.mapping===Ao)?(f===void 0&&(f=new ln(new Ms(1,1,1),new Gi({name:"BackgroundCubeMaterial",uniforms:Eo(Ei.backgroundCube.uniforms),vertexShader:Ei.backgroundCube.vertexShader,fragmentShader:Ei.backgroundCube.fragmentShader,side:Bn,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(N,R,L){this.matrixWorld.copyPosition(L.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(f)),f.material.uniforms.envMap.value=E,f.material.uniforms.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,f.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,f.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,f.material.toneMapped=Rt.getTransfer(E.colorSpace)!==Nt,(p!==E||m!==E.version||g!==r.toneMapping)&&(f.material.needsUpdate=!0,p=E,m=E.version,g=r.toneMapping),f.layers.enableAll(),x.unshift(f,f.geometry,f.material,0,0,null)):E&&E.isTexture&&(h===void 0&&(h=new ln(new Ya(2,2),new Gi({name:"BackgroundMaterial",uniforms:Eo(Ei.background.uniforms),vertexShader:Ei.background.vertexShader,fragmentShader:Ei.background.fragmentShader,side:ar,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(h)),h.material.uniforms.t2D.value=E,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.toneMapped=Rt.getTransfer(E.colorSpace)!==Nt,E.matrixAutoUpdate===!0&&E.updateMatrix(),h.material.uniforms.uvTransform.value.copy(E.matrix),(p!==E||m!==E.version||g!==r.toneMapping)&&(h.material.needsUpdate=!0,p=E,m=E.version,g=r.toneMapping),h.layers.enableAll(),x.unshift(h,h.geometry,h.material,0,0,null))}function M(x,v){x.getRGB(mc,rv(r)),n.buffers.color.setClear(mc.r,mc.g,mc.b,v,l)}return{getClearColor:function(){return c},setClearColor:function(x,v=1){c.set(x),u=v,M(c,u)},getClearAlpha:function(){return u},setClearAlpha:function(x){u=x,M(c,u)},render:y}}function bw(r,e,t,n){const i=r.getParameter(r.MAX_VERTEX_ATTRIBS),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),l=n.isWebGL2||s!==null,c={},u=x(null);let h=u,f=!1;function p(V,J,ee,le,F){let H=!1;if(l){const W=M(le,ee,J);h!==W&&(h=W,g(h.object)),H=v(V,le,ee,F),H&&w(V,le,ee,F)}else{const W=J.wireframe===!0;(h.geometry!==le.id||h.program!==ee.id||h.wireframe!==W)&&(h.geometry=le.id,h.program=ee.id,h.wireframe=W,H=!0)}F!==null&&t.update(F,r.ELEMENT_ARRAY_BUFFER),(H||f)&&(f=!1,z(V,J,ee,le),F!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(F).buffer))}function m(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function g(V){return n.isWebGL2?r.bindVertexArray(V):s.bindVertexArrayOES(V)}function y(V){return n.isWebGL2?r.deleteVertexArray(V):s.deleteVertexArrayOES(V)}function M(V,J,ee){const le=ee.wireframe===!0;let F=c[V.id];F===void 0&&(F={},c[V.id]=F);let H=F[J.id];H===void 0&&(H={},F[J.id]=H);let W=H[le];return W===void 0&&(W=x(m()),H[le]=W),W}function x(V){const J=[],ee=[],le=[];for(let F=0;F<i;F++)J[F]=0,ee[F]=0,le[F]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:J,enabledAttributes:ee,attributeDivisors:le,object:V,attributes:{},index:null}}function v(V,J,ee,le){const F=h.attributes,H=J.attributes;let W=0;const Y=ee.getAttributes();for(const oe in Y)if(Y[oe].location>=0){const ae=F[oe];let xe=H[oe];if(xe===void 0&&(oe==="instanceMatrix"&&V.instanceMatrix&&(xe=V.instanceMatrix),oe==="instanceColor"&&V.instanceColor&&(xe=V.instanceColor)),ae===void 0||ae.attribute!==xe||xe&&ae.data!==xe.data)return!0;W++}return h.attributesNum!==W||h.index!==le}function w(V,J,ee,le){const F={},H=J.attributes;let W=0;const Y=ee.getAttributes();for(const oe in Y)if(Y[oe].location>=0){let ae=H[oe];ae===void 0&&(oe==="instanceMatrix"&&V.instanceMatrix&&(ae=V.instanceMatrix),oe==="instanceColor"&&V.instanceColor&&(ae=V.instanceColor));const xe={};xe.attribute=ae,ae&&ae.data&&(xe.data=ae.data),F[oe]=xe,W++}h.attributes=F,h.attributesNum=W,h.index=le}function E(){const V=h.newAttributes;for(let J=0,ee=V.length;J<ee;J++)V[J]=0}function A(V){N(V,0)}function N(V,J){const ee=h.newAttributes,le=h.enabledAttributes,F=h.attributeDivisors;ee[V]=1,le[V]===0&&(r.enableVertexAttribArray(V),le[V]=1),F[V]!==J&&((n.isWebG
3477L2?r:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](V,J),F[V]=J)}function R(){const V=h.newAttributes,J=h.enabledAttributes;for(let ee=0,le=J.length;ee<le;ee++)J[ee]!==V[ee]&&(r.disableVertexAttribArray(ee),J[ee]=0)}function L(V,J,ee,le,F,H,W){W===!0?r.vertexAttribIPointer(V,J,ee,F,H):r.vertexAttribPointer(V,J,ee,le,F,H)}function z(V,J,ee,le){if(n.isWebGL2===!1&&(V.isInstancedMesh||le.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;E();const F=le.attributes,H=ee.getAttributes(),W=J.defaultAttributeValues;for(const Y in H){const oe=H[Y];if(oe.location>=0){let j=F[Y];if(j===void 0&&(Y==="instanceMatrix"&&V.instanceMatrix&&(j=V.instanceMatrix),Y==="instanceColor"&&V.instanceColor&&(j=V.instanceColor)),j!==void 0){const ae=j.normalized,xe=j.itemSize,Te=t.get(j);if(Te===void 0)continue;const Ee=Te.buffer,et=Te.type,nt=Te.bytesPerElement,Fe=n.isWebGL2===!0&&(et===r.INT||et===r.UNSIGNED_INT||j.gpuType===Dd);if(j.isInterleavedBufferAttribute){const Xe=j.data,k=Xe.stride,_e=j.offset;if(Xe.isInstancedInterleavedBuffer){for(let he=0;he<oe.locationSize;he++)N(oe.location+he,Xe.meshPerAttribute);V.isInstancedMesh!==!0&&le._maxInstanceCount===void 0&&(le._maxInstanceCount=Xe.meshPerAttribute*Xe.count)}else for(let he=0;he<oe.locationSize;he++)A(oe.location+he);r.bindBuffer(r.ARRAY_BUFFER,Ee);for(let he=0;he<oe.locationSize;he++)L(oe.location+he,xe/oe.locationSize,et,ae,k*nt,(_e+xe/oe.locationSize*he)*nt,Fe)}else{if(j.isInstancedBufferAttribute){for(let Xe=0;Xe<oe.locationSize;Xe++)N(oe.location+Xe,j.meshPerAttribute);V.isInstancedMesh!==!0&&le._maxInstanceCount===void 0&&(le._maxInstanceCount=j.meshPerAttribute*j.count)}else for(let Xe=0;Xe<oe.locationSize;Xe++)A(oe.location+Xe);r.bindBuffer(r.ARRAY_BUFFER,Ee);for(let Xe=0;Xe<oe.locationSize;Xe++)L(oe.location+Xe,xe/oe.locationSize,et,ae,xe*nt,xe/oe.locationSize*Xe*nt,Fe)}}else if(W!==void 0){const ae=W[Y];if(ae!==void 0)switch(ae.length){case 2:r.vertexAttrib2fv(oe.location,ae);break;case 3:r.vertexAttrib3fv(oe.location,ae);break;case 4:r.vertexAttrib4fv(oe.location,ae);break;default:r.vertexAttrib1fv(oe.location,ae)}}}}R()}function b(){Q();for(const V in c){const J=c[V];for(const ee in J){const le=J[ee];for(const F in le)y(le[F].object),delete le[F];delete J[ee]}delete c[V]}}function P(V){if(c[V.id]===void 0)return;const J=c[V.id];for(const ee in J){const le=J[ee];for(const F in le)y(le[F].object),delete le[F];delete J[ee]}delete c[V.id]}function B(V){for(const J in c){const ee=c[J];if(ee[V.id]===void 0)continue;const le=ee[V.id];for(const F in le)y(le[F].object),delete le[F];delete ee[V.id]}}function Q(){ce(),f=!0,h!==u&&(h=u,g(h.object))}function ce(){u.geometry=null,u.program=null,u.wireframe=!1}return{setup:p,reset:Q,resetDefaultState:ce,dispose:b,releaseStatesOfGeometry:P,releaseStatesOfProgram:B,initAttributes:E,enableAttribute:A,disableUnusedAttributes:R}}function Cw(r,e,t,n){const i=n.isWebGL2;let s;function l(f){s=f}function c(f,p){r.drawArrays(s,f,p),t.update(p,s,1)}function u(f,p,m){if(m===0)return;let g,y;if(i)g=r,y="drawArraysInstanced";else if(g=e.get("ANGLE_instanced_arrays"),y="drawArraysInstancedANGLE",g===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}g[y](s,f,p,m),t.update(p,s,m)}function h(f,p,m){if(m===0)return;const g=e.get("WEBGL_multi_draw");if(g===null)for(let y=0;y<m;y++)this.render(f[y],p[y]);else{g.multiDrawArraysWEBGL(s,f,0,p,0,m);let y=0;for(let M=0;M<m;M++)y+=p[M];t.update(y,s,1)}}this.setMode=l,this.render=c,this.renderInstances=u,this.renderMultiDraw=h}function Rw(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){const L=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(L.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(L){if(L==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";L="mediump"}return L==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const l=typeof WebGL2RenderingContext<"u"&&r.constructor.name==="WebGL2RenderingContext";let c=t.precision!==void 0?t.precision:"highp";const u=s(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=l||e.has("WEBGL_draw_buffers"),f=t.logarithmicDepthBuffer===!0,p=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),m=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=r.getParameter(r.MAX_TEXTURE_SIZE),y=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),M=r.getParameter(r.MAX_VERTEX_ATTRIBS),x=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),v=r.getParameter(r.MAX_VARYING_VECTORS),w=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),E=m>0,A=l||e.has("OES_texture_float"),N=E&&A,R=l?r.getParameter(r.MAX_SAMPLES):0;return{isWebGL2:l,drawBuffers:h,getMaxAnisotropy:i,getMaxPrecision:s,precision:c,logarithmicDepthBuffer:f,maxTextures:p,maxVertexTextures:m,maxTextureSize:g,maxCubemapSize:y,maxAttributes:M,maxVertexUniforms:x,maxVaryings:v,maxFragmentUniforms:w,vertexTextures:E,floatFragmentTextures:A,floatVertexTextures:N,maxSamples:R}}function Pw(r){const e=this;let t=null,n=0,i=!1,s=!1;const l=new Cr,c=new gt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(p,m){const g=p.length!==0||m||n!==0||i;return i=m,n=p.length,g},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(p,m){t=f(p,m,0)},this.setState=function(p,m,g){const y=p.clippingPlanes,M=p.clipIntersection,x=p.clipShadows,v=r.get(p);if(!i||y===null||y.length===0||s&&!x)s?f(null):h();else{const w=s?0:n,E=w*4;let A=v.clippingState||null;u.value=A,A=f(y,m,E,g);for(let N=0;N!==E;++N)A[N]=t[N];v.clippingState=A,this.numIntersection=M?this.numPlanes:0,this.numPlanes+=w}};function h(){u.value!==t&&(u.value=t,u.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function f(p,m,g,y){const M=p!==null?p.length:0;let x=null;if(M!==0){if(x=u.value,y!==!0||x===null){const v=g+M*4,w=m.matrixWorldInverse;c.getNormalMatrix(w),(x===null||x.length<v)&&(x=new Float32Array(v));for(let E=0,A=g;E!==M;++E,A+=4)l.copy(p[E]).applyMatrix4(w,c),l.normal.toArray(x,A),x[A+3]=l.constant}u.value=x,u.needsUpdate=!0}return e.numPlanes=M,e.numIntersection=0,x}}function Lw(r){let e=new WeakMap;function t(l,c){return c===Sa?l.mapping=lr:c===Ma&&(l.mapping=Ur),l}function n(l){if(l&&l.isTexture){const c=l.mapping;if(c===Sa||c===Ma)if(e.has(l)){const u=e.get(l).texture;return t(u,l.mapping)}else{const u=l.image;if(u&&u.height>0){const h=new av(u.height/2);return h.fromEquirectangularTexture(r,l),e.set(l,h),l.addEventListener("dispose",i),t(h.texture,l.mapping)}else return null}}return l}function i(l){const c=l.target;c.removeEventListener("dispose",i);const u=e.get(c);u!==void 0&&(e.delete(c),u.dispose())}
vendor: 10,171 bytes, lines 3477-3552
3477function s(){e=new WeakMap}return{get:n,dispose:s}}class Za extends Wa{constructor(e=-1,t=1,n=1,i=-1,s=.1,l=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=s,this.far=l,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,s,l){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=s,this.view.height=l,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 s=n-e,l=n+e,c=i+t,u=i-t;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=h*this.view.offsetX,l=s+h*this.view.width,c-=f*this.view.offsetY,u=c-f*this.view.height}this.projectionMatrix.makeOrthographic(s,l,c,u,this.near,this.far,this.coordinateSystem),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}}const po=4,gg=[.125,.215,.35,.446,.526,.582],cs=20,sf=new Za,_g=new Ie;let of=null,af=0,lf=0;const ls=(1+Math.sqrt(5))/2,to=1/ls,vg=[new U(1,1,1),new U(-1,1,1),new U(1,1,-1),new U(-1,1,-1),new U(0,ls,to),new U(0,ls,-to),new U(to,0,ls),new U(-to,0,ls),new U(ls,to,0),new U(-ls,to,0)];class Sd{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){of=this._renderer.getRenderTarget(),af=this._renderer.getActiveCubeFace(),lf=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Sg(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=xg(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.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._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(of,af,lf),e.scissorTest=!1,gc(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===lr||e.mapping===Ur?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),of=this._renderer.getRenderTarget(),af=this._renderer.getActiveCubeFace(),lf=this._renderer.getActiveMipmapLevel();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:en,minFilter:en,generateMipmaps:!1,type:xo,format:Fn,colorSpace:Vi,depthBuffer:!1},i=yg(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=yg(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Iw(s)),this._blurMaterial=Dw(s,e,t)}return i}_compileMaterial(e){const t=new ln(this._lodPlanes[0],e);this._renderer.compile(t,sf)}_sceneToCubeUV(e,t,n,i){const c=new vn(90,1,t,n),u=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],f=this._renderer,p=f.autoClear,m=f.toneMapping;f.getClearColor(_g),f.toneMapping=zi,f.autoClear=!1;const g=new zr({name:"PMREM.Background",side:Bn,depthWrite:!1,depthTest:!1}),y=new ln(new Ms,g);let M=!1;const x=e.background;x?x.isColor&&(g.color.copy(x),e.background=null,M=!0):(g.color.copy(_g),M=!0);for(let v=0;v<6;v++){const w=v%3;w===0?(c.up.set(0,u[v],0),c.lookAt(h[v],0,0)):w===1?(c.up.set(0,0,u[v]),c.lookAt(0,h[v],0)):(c.up.set(0,u[v],0),c.lookAt(0,0,h[v]));const E=this._cubeSize;gc(i,w*E,v>2?E:0,E,E),f.setRenderTarget(i),M&&f.render(y,c),f.render(e,c)}y.geometry.dispose(),y.material.dispose(),f.toneMapping=m,f.autoClear=p,e.background=x}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===lr||e.mapping===Ur;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=Sg()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=xg());const s=i?this._cubemapMaterial:this._equirectMaterial,l=new ln(this._lodPlanes[0],s),c=s.uniforms;c.envMap.value=e;const u=this._cubeSize;gc(t,0,0,3*u,2*u),n.setRenderTarget(t),n.render(l,sf)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){const s=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),l=vg[(i-1)%vg.length];this._blur(e,i-1,i,s,l)}t.autoClear=n}_blur(e,t,n,i,s){const l=this._pingPongRenderTarget;this._halfBlur(e,l,t,n,i,"latitudinal",s),this._halfBlur(l,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,l,c){const u=this._renderer,h=this._blurMaterial;l!=="latitudinal"&&l!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const f=3,p=new ln(this._lodPlanes[i],h),m=h.uniforms,g=this._sizeLods[n]-1,y=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*cs-1),M=s/y,x=isFinite(s)?1+Math.floor(f*M):cs;x>cs&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${cs}`);const v=[];let w=0;for(let L=0;L<cs;++L){const z=L/M,b=Math.exp(-z*z/2);v.push(b),L===0?w+=b:L<x&&(w+=2*b)}for(let L=0;L<v.length;L++)v[L]=v[L]/w;m.envMap.value=e.texture,m.samples.value=x,m.weights.value=v,m.latitudinal.value=l==="latitudinal",c&&(m.poleAxis.value=c);const{_lodMax:E}=this;m.dTheta.value=y,m.mipInt.value=E-n;const A=this._sizeLods[i],N=3*A*(i>E-po?i-E+po:0),R=4*(this._cubeSize-A);gc(t,N,R,3*A,2*A),u.setRenderTarget(t),u.render(p,sf)}}function Iw(r){const e=[],t=[],n=[];let i=r;const s=r-po+1+gg.length;for(let l=0;l<s;l++){const c=Math.pow(2,i);t.push(c);let u=1/c;l>r-po?u=gg[l-r+po-1]:l===0&&(u=0),n.push(u);const h=1/(c-2),f=-h,p=1+h,m=[f,f,p,f,p,p,f,f,p,p,f,p],g=6,y=6,M=3,x=2,v=1,w=new Float32Array(M*y*g),E=new Float32Array(x*y*g),A=new Float32Array(v*y*g);for(let R=0;R<g;R++){const L=R%3*2/3-1,z=R>2?0:-1,b=[L,z,0,L+2/3,z,0,L+2/3,z+1,0,L,z,0,L+2/3,z+1,0,L,z+1,0];w.set(b,M*y*R),E.set(m,x*y*R);const P=[R,R,R,R,R,R];A.set(P,v*y*R)}const N=new dt;N.setAttribute("position",new bt(w,M)),N.setAttribute("uv",new bt(E,x)),N.setAttribute("faceIndex",new bt(A,v)),e.push(N),i>po&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function yg(r,e,t){const n=new Ai(r,e,t);return n.texture.mapping=Ao,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function gc(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function Dw(r,e,t){const n=new Float32Array(cs),i=new U(0,1,0);return new Gi({name:"SphericalGaussianBlur",defines:{n:cs,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Zd(),fragmentShader:`
3478
3479			precision mediump float;
3480			precision mediump int;
3481
3482			varying vec3 vOutputDirection;
3483
3484			uniform sampler2D envMap;
3485			uniform int samples;
3486			uniform float weights[ n ];
3487			uniform bool latitudinal;
3488			uniform float dTheta;
3489			uniform float mipInt;
3490			uniform vec3 poleAxis;
3491
3492			#define ENVMAP_TYPE_CUBE_UV
3493			#include <cube_uv_reflection_fragment>
3494
3495			vec3 getSample( float theta, vec3 axis ) {
3496
3497				float cosTheta = cos( theta );
3498				// Rodrigues' axis-angle rotation
3499				vec3 sampleDirection = vOutputDirection * cosTheta
3500					+ cross( axis, vOutputDirection ) * sin( theta )
3501					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
3502
3503				return bilinearCubeUV( envMap, sampleDirection, mipInt );
3504
3505			}
3506
3507			void main() {
3508
3509				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
3510
3511				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
3512
3513					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
3514
3515				}
3516
3517				axis = normalize( axis );
3518
3519				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
3520				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
3521
3522				for ( int i = 1; i < n; i++ ) {
3523
3524					if ( i >= samples ) {
3525
3526						break;
3527
3528					}
3529
3530					float theta = dTheta * float( i );
3531					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
3532					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
3533
3534				}
3535
3536			}
3537		`,blending:or,depthTest:!1,depthWrite:!1})}function xg(){return new Gi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Zd(),fragmentShader:`
3538
3539			precision mediump float;
3540			precision mediump int;
3541
3542			varying vec3 vOutputDirection;
3543
3544			uniform sampler2D envMap;
3545
3546			#include <common>
3547
3548			void main() {
3549
3550				vec3 outputDirection = normalize( vOutputDirection );
3551				vec2 uv = equirectUv( outputDirection );
3552
3553				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
3554
3555			}
3556		`,blending:or,depthTest:!1,depthWrite:!1})}function Sg(){return new Gi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Zd(),fragmentShader:`
3557
3558			precision mediump float;
3559			precision mediump int;
3560
3561			uniform float flipEnvMap;
3562
3563			varying vec3 vOutputDirection;
3564
3565			uniform samplerCube envMap;
3566
3567			void main() {
3568
3569				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
3570
3571			}
3572		`,blending:or,depthTest:!1,depthWrite:!1})}function Zd(){return`
3573
3574		precision mediump float;
3575		precision mediump int;
3576
3577		attribute float faceIndex;
3578
3579		varying vec3 vOutputDirection;
3580
3581		// RH coordinate system; PMREM face-indexing convention
3582		vec3 getDirection( vec2 uv, float face ) {
3583
3584			uv = 2.0 * uv - 1.0;
3585
3586			vec3 direction = vec3( uv, 1.0 );
3587
3588			if ( face == 0.0 ) {
3589
3590				direction = direction.zyx; // ( 1, v, u ) pos x
3591
3592			} else if ( face == 1.0 ) {
3593
3594				direction = direction.xzy;
3595				direction.xz *= -1.0; // ( -u, 1, -v ) pos y
3596
3597			} else if ( face == 2.0 ) {
3598
3599				direction.x *= -1.0; // ( -u, v, 1 ) pos z
3600
3601			} else if ( face == 3.0 ) {
3602
3603				direction = direction.zyx;
3604				direction.xz *= -1.0; // ( -1, v, -u ) neg x
3605
3606			} else if ( face == 4.0 ) {
3607
3608				direction = direction.xzy;
3609				direction.xy *= -1.0; // ( -u, -1, v ) neg y
3610
3611			} else if ( face == 5.0 ) {
3612
3613				direction.z *= -1.0; // ( u, v, -1 ) neg z
3614
3615			}
3616
3617			return direction;
3618
3619		}
3620
3621		void main() {
3622
3623			vOutputDirection = getDirection( uv, faceIndex );
3624			gl_Position = vec4( position, 1.0 );
3625
3626		}
3627	`}function Nw(r){let e=new WeakMap,t=null;function n(c){if(c&&c.isTexture){const u=c.mapping,h=u===Sa||u===Ma,f=u===lr||u===Ur;if(h||f)if(c.isRenderTargetTexture&&c.needsPMREMUpdate===!0){c.needsPMREMUpdate=!1;let p=e.get(c);return t===null&&(t=new Sd(r)),p=h?t.fromEquirectangular(c,p):t.fromCubemap(c,p),e.set(c,p),p.texture}else{if(e.has(c))return e.get(c).texture;{const p=c.image;if(h&&p&&p.height>0||f&&p&&i(p)){t===null&&(t=new Sd(r));const m=h?t.fromEquirectangular(c):t.fromCubemap(c);return e.set(c,m),c.addEventListener("dispose",s),m.texture}else return null}}}return c}function i(c){let u=0;const h=6;for(let f=0;f<h;f++)c[f]!==void 0&&u++;return u===h}function s(c){const u=c.target;u.removeEventListener("dispose",s);const h=e.get(u);h!==void 0&&(e.delete(u),h.dispose())}function l(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:l}}function Uw(r){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(n){n.isWebGL2?(t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance")):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(n){const i=t(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function Ow(r,e,t,n){const i={},s=new WeakMap;function l(p){const m=p.target;m.index!==null&&e.remove(m.index);for(const y in m.attributes)e.remove(m.attributes[y]);for(const y in m.morphAttributes){const M=m.morphAttributes[y];for(let x=0,v=M.length;x<v;x++)e.remove(M[x])}m.removeEventListener("dispose",l),delete i[m.id];const g=s.get(m);g&&(e.remove(g),s.delete(m)),n.releaseStatesOfGeometry(m),m.isInstancedBufferGeometry===!0&&delete m._maxInstanceCount,t.memory.geometries--}function c(p,m){return i[m.id]===!0||(m.addEventListener("dispose",l),i[m.id]=!0,t.memory.geometries++),m}function u(p){const m=p.attributes;for(const y in m)e.update(m[y],r.ARRAY_BUFFER);const g=p.morphAttributes;for(const y in g){const M=g[y];for(let x=0,v=M.length;x<v;x++)e.update(M[x],r.ARRAY_BUFFER)}}function h(p){const m=[],g=p.index,y=p.attributes.position;let M=0;if(g!==null){const w=g.array;
3627M=g.version;for(let E=0,A=w.length;E<A;E+=3){const N=w[E+0],R=w[E+1],L=w[E+2];m.push(N,R,R,L,L,N)}}else if(y!==void 0){const w=y.array;M=y.version;for(let E=0,A=w.length/3-1;E<A;E+=3){const N=E+0,R=E+1,L=E+2;m.push(N,R,R,L,L,N)}}else return;const x=new(ev(m)?Yd:qd)(m,1);x.version=M;const v=s.get(p);v&&e.remove(v),s.set(p,x)}function f(p){const m=s.get(p);if(m){const g=p.index;g!==null&&m.version<g.version&&h(p)}else h(p);return s.get(p)}return{get:c,update:u,getWireframeAttribute:f}}function Fw(r,e,t,n){const i=n.isWebGL2;let s;function l(g){s=g}let c,u;function h(g){c=g.type,u=g.bytesPerElement}function f(g,y){r.drawElements(s,y,c,g*u),t.update(y,s,1)}function p(g,y,M){if(M===0)return;let x,v;if(i)x=r,v="drawElementsInstanced";else if(x=e.get("ANGLE_instanced_arrays"),v="drawElementsInstancedANGLE",x===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}x[v](s,y,c,g*u,M),t.update(y,s,M)}function m(g,y,M){if(M===0)return;const x=e.get("WEBGL_multi_draw");if(x===null)for(let v=0;v<M;v++)this.render(g[v]/u,y[v]);else{x.multiDrawElementsWEBGL(s,y,0,c,g,0,M);let v=0;for(let w=0;w<M;w++)v+=y[w];t.update(v,s,1)}}this.setMode=l,this.setIndex=h,this.render=f,this.renderInstances=p,this.renderMultiDraw=m}function Bw(r){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,l,c){switch(t.calls++,l){case r.TRIANGLES:t.triangles+=c*(s/3);break;case r.LINES:t.lines+=c*(s/2);break;case r.LINE_STRIP:t.lines+=c*(s-1);break;case r.LINE_LOOP:t.lines+=c*s;break;case r.POINTS:t.points+=c*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",l);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 zw(r,e){return r[0]-e[0]}function kw(r,e){return Math.abs(e[1])-Math.abs(r[1])}function Hw(r,e,t){const n={},i=new Float32Array(8),s=new WeakMap,l=new Pt,c=[];for(let h=0;h<8;h++)c[h]=[h,0];function u(h,f,p){const m=h.morphTargetInfluences;if(e.isWebGL2===!0){const g=f.morphAttributes.position||f.morphAttributes.normal||f.morphAttributes.color,y=g!==void 0?g.length:0;let M=s.get(f);if(M===void 0||M.count!==y){let V=function(){Q.dispose(),s.delete(f),f.removeEventListener("dispose",V)};M!==void 0&&M.texture.dispose();const w=f.morphAttributes.position!==void 0,E=f.morphAttributes.normal!==void 0,A=f.morphAttributes.color!==void 0,N=f.morphAttributes.position||[],R=f.morphAttributes.normal||[],L=f.morphAttributes.color||[];let z=0;w===!0&&(z=1),E===!0&&(z=2),A===!0&&(z=3);let b=f.attributes.position.count*z,P=1;b>e.maxTextureSize&&(P=Math.ceil(b/e.maxTextureSize),b=e.maxTextureSize);const B=new Float32Array(b*P*4*y),Q=new fu(B,b,P,y);Q.type=wi,Q.needsUpdate=!0;const ce=z*4;for(let J=0;J<y;J++){const ee=N[J],le=R[J],F=L[J],H=b*P*4*J;for(let W=0;W<ee.count;W++){const Y=W*ce;w===!0&&(l.fromBufferAttribute(ee,W),B[H+Y+0]=l.x,B[H+Y+1]=l.y,B[H+Y+2]=l.z,B[H+Y+3]=0),E===!0&&(l.fromBufferAttribute(le,W),B[H+Y+4]=l.x,B[H+Y+5]=l.y,B[H+Y+6]=l.z,B[H+Y+7]=0),A===!0&&(l.fromBufferAttribute(F,W),B[H+Y+8]=l.x,B[H+Y+9]=l.y,B[H+Y+10]=l.z,B[H+Y+11]=F.itemSize===4?l.w:1)}}M={count:y,texture:Q,size:new fe(b,P)},s.set(f,M),f.addEventListener("dispose",V)}let x=0;for(let w=0;w<m.length;w++)x+=m[w];const v=f.morphTargetsRelative?1:1-x;p.getUniforms().setValue(r,"morphTargetBaseInfluence",v),p.getUniforms().setValue(r,"morphTargetInfluences",m),p.getUniforms().setValue(r,"morphTargetsTexture",M.texture,t),p.getUniforms().setValue(r,"morphTargetsTextureSize",M.size)}else{const g=m===void 0?0:m.length;let y=n[f.id];if(y===void 0||y.length!==g){y=[];for(let E=0;E<g;E++)y[E]=[E,0];n[f.id]=y}for(let E=0;E<g;E++){const A=y[E];A[0]=E,A[1]=m[E]}y.sort(kw);for(let E=0;E<8;E++)E<g&&y[E][1]?(c[E][0]=y[E][0],c[E][1]=y[E][1]):(c[E][0]=Number.MAX_SAFE_INTEGER,c[E][1]=0);c.sort(zw);const M=f.morphAttributes.position,x=f.morphAttributes.normal;let v=0;for(let E=0;E<8;E++){const A=c[E],N=A[0],R=A[1];N!==Number.MAX_SAFE_INTEGER&&R?(M&&f.getAttribute("morphTarget"+E)!==M[N]&&f.setAttribute("morphTarget"+E,M[N]),x&&f.getAttribute("morphNormal"+E)!==x[N]&&f.setAttribute("morphNormal"+E,x[N]),i[E]=R,v+=R):(M&&f.hasAttribute("morphTarget"+E)===!0&&f.deleteAttribute("morphTarget"+E),x&&f.hasAttribute("morphNormal"+E)===!0&&f.deleteAttribute("morphNormal"+E),i[E]=0)}const w=f.morphTargetsRelative?1:1-v;p.getUniforms().setValue(r,"morphTargetBaseInfluence",w),p.getUniforms().setValue(r,"morphTargetInfluences",i)}}return{update:u}}function Vw(r,e,t,n){let i=new WeakMap;function s(u){const h=n.render.frame,f=u.geometry,p=e.get(u,f);if(i.get(p)!==h&&(e.update(p),i.set(p,h)),u.isInstancedMesh&&(u.hasEventListener("dispose",c)===!1&&u.addEventListener("dispose",c),i.get(u)!==h&&(t.update(u.instanceMatrix,r.ARRAY_BUFFER),u.instanceColor!==null&&t.update(u.instanceColor,r.ARRAY_BUFFER),i.set(u,h))),u.isSkinnedMesh){const m=u.skeleton;
vendor: 15,994 bytes, lines 3627-3645
3627i.get(m)!==h&&(m.update(),i.set(m,h))}return p}function l(){i=new WeakMap}function c(u){const h=u.target;h.removeEventListener("dispose",c),t.remove(h.instanceMatrix),h.instanceColor!==null&&t.remove(h.instanceColor)}return{update:s,dispose:l}}class Jd extends tn{constructor(e,t,n,i,s,l,c,u,h,f){if(f=f!==void 0?f:Dr,f!==Dr&&f!==ys)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&f===Dr&&(n=rr),n===void 0&&f===ys&&(n=Ir),super(null,i,s,l,c,u,f,n,h),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=c!==void 0?c:$t,this.minFilter=u!==void 0?u:$t,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}const cv=new tn,uv=new Jd(1,1);uv.compareFunction=Vd;const hv=new fu,fv=new Xd,dv=new Xa,Mg=[],Eg=[],wg=new Float32Array(16),Tg=new Float32Array(9),Ag=new Float32Array(4);function Co(r,e,t){const n=r[0];if(n<=0||n>0)return r;const i=e*t;let s=Mg[i];if(s===void 0&&(s=new Float32Array(i),Mg[i]=s),e!==0){n.toArray(s,0);for(let l=1,c=0;l!==e;++l)c+=t,r[l].toArray(s,c)}return s}function cn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function un(r,e){for(let t=0,n=e.length;t<n;t++)r[t]=e[t]}function du(r,e){let t=Eg[e];t===void 0&&(t=new Int32Array(e),Eg[e]=t);for(let n=0;n!==e;++n)t[n]=r.allocateTextureUnit();return t}function Gw(r,e){const t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function Ww(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(cn(t,e))return;r.uniform2fv(this.addr,e),un(t,e)}}function Xw(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.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)&&(r.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(cn(t,e))return;r.uniform3fv(this.addr,e),un(t,e)}}function qw(r,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)&&(r.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(cn(t,e))return;r.uniform4fv(this.addr,e),un(t,e)}}function Yw(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(cn(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),un(t,e)}else{if(cn(t,n))return;Ag.set(n),r.uniformMatrix2fv(this.addr,!1,Ag),un(t,n)}}function Zw(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(cn(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),un(t,e)}else{if(cn(t,n))return;Tg.set(n),r.uniformMatrix3fv(this.addr,!1,Tg),un(t,n)}}function Jw(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(cn(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),un(t,e)}else{if(cn(t,n))return;wg.set(n),r.uniformMatrix4fv(this.addr,!1,wg),un(t,n)}}function jw(r,e){const t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function Kw(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(cn(t,e))return;r.uniform2iv(this.addr,e),un(t,e)}}function Qw(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(cn(t,e))return;r.uniform3iv(this.addr,e),un(t,e)}}function $w(r,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)&&(r.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(cn(t,e))return;r.uniform4iv(this.addr,e),un(t,e)}}function e1(r,e){const t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function t1(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(cn(t,e))return;r.uniform2uiv(this.addr,e),un(t,e)}}function n1(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(cn(t,e))return;r.uniform3uiv(this.addr,e),un(t,e)}}function i1(r,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)&&(r.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(cn(t,e))return;r.uniform4uiv(this.addr,e),un(t,e)}}function r1(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);const s=this.type===r.SAMPLER_2D_SHADOW?uv:cv;t.setTexture2D(e||s,i)}function s1(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||fv,i)}function o1(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||dv,i)}function a1(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||hv,i)}function l1(r){switch(r){case 5126:return Gw;case 35664:return Ww;case 35665:return Xw;case 35666:return qw;case 35674:return Yw;case 35675:return Zw;case 35676:return Jw;case 5124:case 35670:return jw;case 35667:case 35671:return Kw;case 35668:case 35672:return Qw;case 35669:case 35673:return $w;case 5125:return e1;case 36294:return t1;case 36295:return n1;case 36296:return i1;case 35678:case 36198:case 36298:case 36306:case 35682:return r1;case 35679:case 36299:case 36307:return s1;case 35680:case 36300:case 36308:case 36293:return o1;case 36289:case 36303:case 36311:case 36292:return a1}}function c1(r,e){r.uniform1fv(this.addr,e)}function u1(r,e){const t=Co(e,this.size,2);r.uniform2fv(this.addr,t)}function h1(r,e){const t=Co(e,this.size,3);r.uniform3fv(this.addr,t)}function f1(r,e){const t=Co(e,this.size,4);r.uniform4fv(this.addr,t)}function d1(r,e){const t=Co(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function p1(r,e){const t=Co(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function m1(r,e){const t=Co(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function g1(r,e){r.uniform1iv(this.addr,e)}function _1(r,e){r.uniform2iv(this.addr,e)}function v1(r,e){r.uniform3iv(this.addr,e)}function y1(r,e){r.uniform4iv(this.addr,e)}function x1(r,e){r.uniform1uiv(this.addr,e)}function S1(r,e){r.uniform2uiv(this.addr,e)}function M1(r,e){r.uniform3uiv(this.addr,e)}function E1(r,e){r.uniform4uiv(this.addr,e)}function w1(r,e,t){const n=this.cache,i=e.length,s=du(t,i);cn(n,s)||(r.uniform1iv(this.addr,s),un(n,s));for(let l=0;l!==i;++l)t.setTexture2D(e[l]||cv,s[l])}function T1(r,e,t){const n=this.cache,i=e.length,s=du(t,i);cn(n,s)||(r.uniform1iv(this.addr,s),un(n,s));for(let l=0;l!==i;++l)t.setTexture3D(e[l]||fv,s[l])}function A1(r,e,t){const n=this.cache,i=e.length,s=du(t,i);cn(n,s)||(r.uniform1iv(this.addr,s),un(n,s));for(let l=0;l!==i;++l)t.setTextureCube(e[l]||dv,s[l])}function b1(r,e,t){const n=this.cache,i=e.length,s=du(t,i);cn(n,s)||(r.uniform1iv(this.addr,s),un(n,s));for(let l=0;l!==i;++l)t.setTexture2DArray(e[l]||hv,s[l])}function C1(r){switch(r){case 5126:return c1;case 35664:return u1;case 35665:return h1;case 35666:return f1;case 35674:return d1;case 35675:return p1;case 35676:return m1;case 5124:case 35670:return g1;case 35667:case 35671:return _1;case 35668:case 35672:return v1;case 35669:case 35673:return y1;case 5125:return x1;case 36294:return S1;case 36295:return M1;case 36296:return E1;case 35678:case 36198:case 36298:case 36306:case 35682:return w1;case 35679:case 36299:case 36307:return T1;case 35680:case 36300:case 36308:case 36293:return A1;case 36289:case 36303:case 36311:case 36292:return b1}}class R1{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=l1(t.type)}}class P1{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=C1(t.type)}}class L1{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let s=0,l=i.length;s!==l;++s){const c=i[s];c.setValue(e,t[c.id],n)}}}const cf=/(\w+)(\])?(\[|\.)?/g;function bg(r,e){r.seq.push(e),r.map[e.id]=e}function I1(r,e,t){const n=r.name,i=n.length;for(cf.lastIndex=0;;){const s=cf.exec(n),l=cf.lastIndex;let c=s[1];const u=s[2]==="]",h=s[3];if(u&&(c=c|0),h===void 0||h==="["&&l+2===i){bg(t,h===void 0?new R1(c,r,e):new P1(c,r,e));break}else{let p=t.map[c];p===void 0&&(p=new L1(c),bg(t,p)),t=p}}}class Kc{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const s=e.getActiveUniform(t,i),l=e.getUniformLocation(t,s.name);I1(s,l,this)}}setValue(e,t,n,i){const s=this.map[t];s!==void 0&&s.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 s=0,l=t.length;s!==l;++s){const c=t[s],u=n[c.id];u.needsUpdate!==!1&&c.setValue(e,u.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,s=e.length;i!==s;++i){const l=e[i];l.id in t&&n.push(l)}return n}}function Cg(r,e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}const D1=37297;let N1=0;function U1(r,e){const t=r.split(`
3628`),n=[],i=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let l=i;l<s;l++){const c=l+1;n.push(`${c===e?">":" "} ${c}: ${t[l]}`)}return n.join(`
3629`)}function O1(r){const e=Rt.getPrimaries(Rt.workingColorSpace),t=Rt.getPrimaries(r);let n;switch(e===t?n="":e===Pa&&t===Ra?n="LinearDisplayP3ToLinearSRGB":e===Ra&&t===Pa&&(n="LinearSRGBToLinearDisplayP3"),r){case Vi:case Va:return[n,"LinearTransferOETF"];case an:case hu:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[n,"LinearTransferOETF"]}}function Rg(r,e,t){const n=r.getShaderParameter(e,r.COMPILE_STATUS),i=r.getShaderInfoLog(e).trim();if(n&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const l=parseInt(s[1]);return t.toUpperCase()+`
3630
3631`+i+`
3632
3633`+U1(r.getShaderSource(e),l)}else return i}function F1(r,e){const t=O1(e);return`vec4 ${r}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function B1(r,e){let t;switch(e){case b_:t="Linear";break;case C_:t="Reinhard";break;case R_:t="OptimizedCineon";break;case Ld:t="ACESFilmic";break;case L_:t="AgX";break;case P_:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function z1(r){return[r.extensionDerivatives||r.envMapCubeUVHeight||r.bumpMap||r.normalMapTangentSpace||r.clearcoatNormalMap||r.flatShading||r.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(r.extensionFragDepth||r.logarithmicDepthBuffer)&&r.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",r.extensionDrawBuffers&&r.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(r.extensionShaderTextureLOD||r.envMap||r.transmission)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(mo).join(`
3634`)}function k1(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":""].filter(mo).join(`
3635`)}function H1(r){const e=[];for(const t in r){const n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
3636`)}function V1(r,e){const t={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const s=r.getActiveAttrib(e,i),l=s.name;let c=1;s.type===r.FLOAT_MAT2&&(c=2),s.type===r.FLOAT_MAT3&&(c=3),s.type===r.FLOAT_MAT4&&(c=4),t[l]={type:s.type,location:r.getAttribLocation(e,l),locationSize:c}}return t}function mo(r){return r!==""}function Pg(r,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return r.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 Lg(r,e){return r.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const G1=/^[ \t]*#include +<([\w\d./]+)>/gm;function Md(r){return r.replace(G1,X1)}const W1=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function X1(r,e){let t=ht[e];if(t===void 0){const n=W1.get(e);if(n!==void 0)t=ht[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return Md(t)}const q1=/#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 Ig(r){return r.replace(q1,Y1)}function Y1(r,e,t,n){let i="";for(let s=parseInt(e);s<parseInt(t);s++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function Dg(r){let e="precision "+r.precision+` float;
3637precision `+r.precision+" int;";return r.precision==="highp"?e+=`
3638#define HIGH_PRECISION`:r.precision==="mediump"?e+=`
3639#define MEDIUM_PRECISION`:r.precision==="lowp"&&(e+=`
3640#define LOW_PRECISION`),e}function Z1(r){let e="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===au?e="SHADOWMAP_TYPE_PCF":r.shadowMapType===pa?e="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===Mi&&(e="SHADOWMAP_TYPE_VSM"),e}function J1(r){let e="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case lr:case Ur:e="ENVMAP_TYPE_CUBE";break;case Ao:e="ENVMAP_TYPE_CUBE_UV";break}return e}function j1(r){let e="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case Ur:e="ENVMAP_MODE_REFRACTION";break}return e}function K1(r){let e="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case Ha:e="ENVMAP_BLENDING_MULTIPLY";break;case T_:e="ENVMAP_BLENDING_MIX";break;case A_:e="ENVMAP_BLENDING_ADD";break}return e}function Q1(r){const e=r.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),112)),texelHeight:n,maxMip:t}}function $1(r,e,t,n){const i=r.getContext(),s=t.defines;let l=t.vertexShader,c=t.fragmentShader;const u=Z1(t),h=J1(t),f=j1(t),p=K1(t),m=Q1(t),g=t.isWebGL2?"":z1(t),y=k1(t),M=H1(s),x=i.createProgram();let v,w,E=t.glslVersion?"#version "+t.glslVersion+`
3641`:"";t.isRawShaderMaterial?(v=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,M].filter(mo).join(`
3642`),v.length>0&&(v+=`
3643`),w=[g,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,M].filter(mo).join(`
3644`),w.length>0&&(w+=`
3645`)):(v=[Dg(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,M,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",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 "+f:"",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_IR
3645IDESCENCEMAP":"",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.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&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+u:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","	attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","	attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","	attribute vec2 uv1;","#endif","#ifdef USE_UV2","	attribute vec2 uv2;","#endif","#ifdef USE_UV3","	attribute vec2 uv3;","#endif","#ifdef USE_TANGENT","	attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","	attribute vec4 color;","#elif defined( USE_COLOR )","	attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","	attribute vec3 morphTarget0;","	attribute vec3 morphTarget1;","	attribute vec3 morphTarget2;","	attribute vec3 morphTarget3;","	#ifdef USE_MORPHNORMALS","		attribute vec3 morphNormal0;","		attribute vec3 morphNormal1;","		attribute vec3 morphNormal2;","		attribute vec3 morphNormal3;","	#else","		attribute vec3 morphTarget4;","		attribute vec3 morphTarget5;","		attribute vec3 morphTarget6;","		attribute vec3 morphTarget7;","	#endif","#endif","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif",`
3646`].filter(mo).join(`
3647`),w=[g,Dg(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,M,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.envMap?"#define "+f:"",t.envMap?"#define "+p:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.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.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.iridescence?"#define USE_IR
3647IDESCENCE":"",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?"#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 "+u:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==zi?"#define TONE_MAPPING":"",t.toneMapping!==zi?ht.tonemapping_pars_fragment:"",t.toneMapping!==zi?B1("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",ht.colorspace_pars_fragment,F1("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
3648`].filter(mo).join(`
3649`)),l=Md(l),l=Pg(l,t),l=Lg(l,t),c=Md(c),c=Pg(c,t),c=Lg(c,t),l=Ig(l),c=Ig(c),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(E=`#version 300 es
3650`,v=[y,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(`
3651`)+`
3652`+v,w=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===yd?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===yd?"":"#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(`
3653`)+`
3654`+w);const A=E+v+l,N=E+w+c,R=Cg(i,i.VERTEX_SHADER,A),L=Cg(i,i.FRAGMENT_SHADER,N);i.attachShader(x,R),i.attachShader(x,L),t.index0AttributeName!==void 0?i.bindAttribLocation(x,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(x,0,"position"),i.linkProgram(x);function z(Q){if(r.debug.checkShaderErrors){const ce=i.getProgramInfoLog(x).trim(),V=i.getShaderInfoLog(R).trim(),J=i.getShaderInfoLog(L).trim();let ee=!0,le=!0;if(i.getProgramParameter(x,i.LINK_STATUS)===!1)if(ee=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(i,x,R,L);else{const F=Rg(i,R,"vertex"),H=Rg(i,L,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(x,i.VALIDATE_STATUS)+`
3655
3656Program Info Log: `+ce+`
3657`+F+`
3658`+H)}else ce!==""?console.warn("THREE.WebGLProgram: Program Info Log:",ce):(V===""||J==="")&&(le=!1);le&&(Q.diagnostics={runnable:ee,programLog:ce,vertexShader:{log:V,prefix:v},fragmentShader:{log:J,prefix:w}})}i.deleteShader(R),i.deleteShader(L),b=new Kc(i,x),P=V1(i,x)}let b;this.getUniforms=function(){return b===void 0&&z(this),b};let P;this.getAttributes=function(){return P===void 0&&z(this),P};let B=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return B===!1&&(B=i.getProgramParameter(x,D1)),B},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(x),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=N1++,this.cacheKey=e,this.usedTimes=1,this.program=x,this.vertexShader=R,this.fragmentShader=L,this}let eT=0;class tT{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),l=this._getShaderCacheForMaterial(e);return l.has(i)===!1&&(l.add(i),i.usedTimes++),l.has(s)===!1&&(l.add(s),s.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}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){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 nT(e),t.set(e,n)),n}}class nT{constructor(e){this.id=eT++,this.code=e,this.usedTimes=0}}function iT(r,e,t,n,i,s,l){const c=new gs,u=new tT,h=[],f=i.isWebG
vendor: 6,264 bytes, line 3658
3658L2,p=i.logarithmicDepthBuffer,m=i.vertexTextures;let g=i.precision;const y={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function M(b){return b===0?"uv":`uv${b}`}function x(b,P,B,Q,ce){const V=Q.fog,J=ce.geometry,ee=b.isMeshStandardMaterial?Q.environment:null,le=(b.isMeshStandardMaterial?t:e).get(b.envMap||ee),F=le&&le.mapping===Ao?le.image.height:null,H=y[b.type];b.precision!==null&&(g=i.getMaxPrecision(b.precision),g!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",g,"instead."));const W=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,Y=W!==void 0?W.length:0;let oe=0;J.morphAttributes.position!==void 0&&(oe=1),J.morphAttributes.normal!==void 0&&(oe=2),J.morphAttributes.color!==void 0&&(oe=3);let j,ae,xe,Te;if(H){const hn=Ei[H];j=hn.vertexShader,ae=hn.fragmentShader}else j=b.vertexShader,ae=b.fragmentShader,u.update(b),xe=u.getVertexShaderID(b),Te=u.getFragmentShaderID(b);const Ee=r.getRenderTarget(),et=ce.isInstancedMesh===!0,nt=ce.isBatchedMesh===!0,Fe=!!b.map,Xe=!!b.matcap,k=!!le,_e=!!b.aoMap,he=!!b.lightMap,ve=!!b.bumpMap,ue=!!b.normalMap,We=!!b.displacementMap,Pe=!!b.emissiveMap,I=!!b.metalnessMap,C=!!b.roughnessMap,K=b.anisotropy>0,ge=b.clearcoat>0,pe=b.iridescence>0,de=b.sheen>0,ze=b.transmission>0,we=K&&!!b.anisotropyMap,De=ge&&!!b.clearcoatMap,Je=ge&&!!b.clearcoatNormalMap,at=ge&&!!b.clearcoatRoughnessMap,me=pe&&!!b.iridescenceMap,xt=pe&&!!b.iridescenceThicknessMap,_t=de&&!!b.sheenColorMap,rt=de&&!!b.sheenRoughnessMap,qe=!!b.specularMap,Oe=!!b.specularColorMap,ut=!!b.specularIntensityMap,Mt=ze&&!!b.transmissionMap,Ft=ze&&!!b.thicknessMap,pt=!!b.gradientMap,Se=!!b.alphaMap,G=b.alphaTest>0,Ae=!!b.alphaHash,be=!!b.extensions,Ke=!!J.attributes.uv1,Ye=!!J.attributes.uv2,Lt=!!J.attributes.uv3;let Ct=zi;return b.toneMapped&&(Ee===null||Ee.isXRRenderTarget===!0)&&(Ct=r.toneMapping),{isWebGL2:f,shaderID:H,shaderType:b.type,shaderName:b.name,vertexShader:j,fragmentShader:ae,defines:b.defines,customVertexShaderID:xe,customFragmentShaderID:Te,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:g,batching:nt,instancing:et,instancingColor:et&&ce.instanceColor!==null,supportsVertexTextures:m,outputColorSpace:Ee===null?r.outputColorSpace:Ee.isXRRenderTarget===!0?Ee.texture.colorSpace:Vi,map:Fe,matcap:Xe,envMap:k,envMapMode:k&&le.mapping,envMapCubeUVHeight:F,aoMap:_e,lightMap:he,bumpMap:ve,normalMap:ue,displacementMap:m&&We,emissiveMap:Pe,normalMapObjectSpace:ue&&b.normalMapType===q_,normalMapTangentSpace:ue&&b.normalMapType===Br,metalnessMap:I,roughnessMap:C,anisotropy:K,anisotropyMap:we,clearcoat:ge,clearcoatMap:De,clearcoatNormalMap:Je,clearcoatRoughnessMap:at,iridescence:pe,iridescenceMap:me,iridescenceThicknessMap:xt,sheen:de,sheenColorMap:_t,sheenRoughnessMap:rt,specularMap:qe,specularColorMap:Oe,specularIntensityMap:ut,transmission:ze,transmissionMap:Mt,thicknessMap:Ft,gradientMap:pt,opaque:b.transparent===!1&&b.blending===ps,alphaMap:Se,alphaTest:G,alphaHash:Ae,combine:b.combine,mapUv:Fe&&M(b.map.channel),aoMapUv:_e&&M(b.aoMap.channel),lightMapUv:he&&M(b.lightMap.channel),bumpMapUv:ve&&M(b.bumpMap.channel),normalMapUv:ue&&M(b.normalMap.channel),displacementMapUv:We&&M(b.displacementMap.channel),emissiveMapUv:Pe&&M(b.emissiveMap.channel),metalnessMapUv:I&&M(b.metalnessMap.channel),roughnessMapUv:C&&M(b.roughnessMap.channel),anisotropyMapUv:we&&M(b.anisotropyMap.channel),clearcoatMapUv:De&&M(b.clearcoatMap.channel),clearcoatNormalMapUv:Je&&M(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:at&&M(b.clearcoatRoughnessMap.channel),iridescenceMapUv:me&&M(b.iridescenceMap.channel),iridescenceThicknessMapUv:xt&&M(b.iridescenceThicknessMap.channel),sheenColorMapUv:_t&&M(b.sheenColorMap.channel),sheenRoughnessMapUv:rt&&M(b.sheenRoughnessMap.channel),specularMapUv:qe&&M(b.specularMap.channel),specularColorMapUv:Oe&&M(b.specularColorMap.channel),specularIntensityMapUv:ut&&M(b.specularIntensityMap.channel),transmissionMapUv:Mt&&M(b.transmissionMap.channel),thicknessMapUv:Ft&&M(b.thicknessMap.channel),alphaMapUv:Se&&M(b.alphaMap.channel),vertexTangents:!!J.attributes.tangent&&(ue||K),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,vertexUv1s:Ke,vertexUv2s:Ye,vertexUv3s:Lt,pointsUvs:ce.isPoints===!0&&!!J.attributes.uv&&(Fe||Se),fog:!!V,useFog:b.fog===!0,fogExp2:V&&V.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:p,skinning:ce.isSkinnedMesh===!0,morphTargets:J.morphAttributes.position!==void 0,morphNormals:J.morphAttributes.normal!==void 0,morphColors:J.morphAttributes.color!==void 0,morphTargetsCount:Y,morphTextureStride:oe,numDirLights:P.directional.length,numPointLights:P.point.length,numSpotLights:P.spot.length,numSpotLightMaps:P.spotLightMap.length,numRectAreaLights:P.rectArea.length,numHemiLights:P.hemi.length,numDirLightShadows:P.directionalShadowMap.length,numPointLightShadows:P.pointShadowMap.length,numSpotLightShadows:P.spotShadowMap.length,numSpotLightShadowsWithMaps:P.numSpotLightShadowsWithMaps,numLightProbes:P.numLightProbes,numClippingPlanes:l.numPlanes,numClipIntersection:l.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&B.length>0,shadowMapType:r.shadowMap.type,toneMapping:Ct,useLegacyLights:r._useLegacyLights,decodeVideoTexture:Fe&&b.map.isVideoTexture===!0&&Rt.getTransfer(b.map.colorSpace)===Nt,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Bi,flipSided:b.side===Bn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionDerivatives:be&&b.extensions.derivatives===!0,extensionFragDepth:be&&b.extensions.fragDepth===!0,extensionDrawBuffers:be&&b.extensions.drawBuffers===!0,extensionShaderTextureLOD:be&&b.extensions.shaderTextureLOD===!0,extensionCl
vendor: 2,497 bytes, line 3658
3658ipCullDistance:be&&b.extensions.clipCullDistance&&n.has("WEBGL_clip_cull_distance"),rendererExtensionFragDepth:f||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:f||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:f||n.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()}}function v(b){const P=[];if(b.shaderID?P.push(b.shaderID):(P.push(b.customVertexShaderID),P.push(b.customFragmentShaderID)),b.defines!==void 0)for(const B in b.defines)P.push(B),P.push(b.defines[B]);return b.isRawShaderMaterial===!1&&(w(P,b),E(P,b),P.push(r.outputColorSpace)),P.push(b.customProgramCacheKey),P.join()}function w(b,P){b.push(P.precision),b.push(P.outputColorSpace),b.push(P.envMapMode),b.push(P.envMapCubeUVHeight),b.push(P.mapUv),b.push(P.alphaMapUv),b.push(P.lightMapUv),b.push(P.aoMapUv),b.push(P.bumpMapUv),b.push(P.normalMapUv),b.push(P.displacementMapUv),b.push(P.emissiveMapUv),b.push(P.metalnessMapUv),b.push(P.roughnessMapUv),b.push(P.anisotropyMapUv),b.push(P.clearcoatMapUv),b.push(P.clearcoatNormalMapUv),b.push(P.clearcoatRoughnessMapUv),b.push(P.iridescenceMapUv),b.push(P.iridescenceThicknessMapUv),b.push(P.sheenColorMapUv),b.push(P.sheenRoughnessMapUv),b.push(P.specularMapUv),b.push(P.specularColorMapUv),b.push(P.specularIntensityMapUv),b.push(P.transmissionMapUv),b.push(P.thicknessMapUv),b.push(P.combine),b.push(P.fogExp2),b.push(P.sizeAttenuation),b.push(P.morphTargetsCount),b.push(P.morphAttributeCount),b.push(P.numDirLights),b.push(P.numPointLights),b.push(P.numSpotLights),b.push(P.numSpotLightMaps),b.push(P.numHemiLights),b.push(P.numRectAreaLights),b.push(P.numDirLightShadows),b.push(P.numPointLightShadows),b.push(P.numSpotLightShadows),b.push(P.numSpotLightShadowsWithMaps),b.push(P.numLightProbes),b.push(P.shadowMapType),b.push(P.toneMapping),b.push(P.numClippingPlanes),b.push(P.numClipIntersection),b.push(P.depthPacking)}function E(b,P){c.disableAll(),P.isWebGL2&&c.enable(0),P.supportsVertexTextures&&c.enable(1),P.instancing&&c.enable(2),P.instancingColor&&c.enable(3),P.matcap&&c.enable(4),P.envMap&&c.enable(5),P.normalMapObjectSpace&&c.enable(6),P.normalMapTangentSpace&&c.enable(7),P.clearcoat&&c.enable(8),P.iridescence&&c.enable(9),P.alphaTest&&c.enable(10),P.vertexColors&&c.enable(11),P.vertexAlphas&&c.enable(12),P.vertexUv1s&&c.enable(13),P.vertexUv2s&&c.enable(14),P.vertexUv3s&&c.enable(15),P.vertexTangents&&c.enable(16),P.anisotropy&&
vendor: 6,407 bytes, line 3658
3658c.enable(17),P.alphaHash&&c.enable(18),P.batching&&c.enable(19),b.push(c.mask),c.disableAll(),P.fog&&c.enable(0),P.useFog&&c.enable(1),P.flatShading&&c.enable(2),P.logarithmicDepthBuffer&&c.enable(3),P.skinning&&c.enable(4),P.morphTargets&&c.enable(5),P.morphNormals&&c.enable(6),P.morphColors&&c.enable(7),P.premultipliedAlpha&&c.enable(8),P.shadowMapEnabled&&c.enable(9),P.useLegacyLights&&c.enable(10),P.doubleSided&&c.enable(11),P.flipSided&&c.enable(12),P.useDepthPacking&&c.enable(13),P.dithering&&c.enable(14),P.transmission&&c.enable(15),P.sheen&&c.enable(16),P.opaque&&c.enable(17),P.pointsUvs&&c.enable(18),P.decodeVideoTexture&&c.enable(19),b.push(c.mask)}function A(b){const P=y[b.type];let B;if(P){const Q=Ei[P];B=sv.clone(Q.uniforms)}else B=b.uniforms;return B}function N(b,P){let B;for(let Q=0,ce=h.length;Q<ce;Q++){const V=h[Q];if(V.cacheKey===P){B=V,++B.usedTimes;break}}return B===void 0&&(B=new $1(r,P,b,s),h.push(B)),B}function R(b){if(--b.usedTimes===0){const P=h.indexOf(b);h[P]=h[h.length-1],h.pop(),b.destroy()}}function L(b){u.remove(b)}function z(){u.dispose()}return{getParameters:x,getProgramCacheKey:v,getUniforms:A,acquireProgram:N,releaseProgram:R,releaseShaderCache:L,programs:h,dispose:z}}function rT(){let r=new WeakMap;function e(s){let l=r.get(s);return l===void 0&&(l={},r.set(s,l)),l}function t(s){r.delete(s)}function n(s,l,c){r.get(s)[l]=c}function i(){r=new WeakMap}return{get:e,remove:t,update:n,dispose:i}}function sT(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function Ng(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function Ug(){const r=[];let e=0;const t=[],n=[],i=[];function s(){e=0,t.length=0,n.length=0,i.length=0}function l(p,m,g,y,M,x){let v=r[e];return v===void 0?(v={id:p.id,object:p,geometry:m,material:g,groupOrder:y,renderOrder:p.renderOrder,z:M,group:x},r[e]=v):(v.id=p.id,v.object=p,v.geometry=m,v.material=g,v.groupOrder=y,v.renderOrder=p.renderOrder,v.z=M,v.group=x),e++,v}function c(p,m,g,y,M,x){const v=l(p,m,g,y,M,x);g.transmission>0?n.push(v):g.transparent===!0?i.push(v):t.push(v)}function u(p,m,g,y,M,x){const v=l(p,m,g,y,M,x);g.transmission>0?n.unshift(v):g.transparent===!0?i.unshift(v):t.unshift(v)}function h(p,m){t.length>1&&t.sort(p||sT),n.length>1&&n.sort(m||Ng),i.length>1&&i.sort(m||Ng)}function f(){for(let p=e,m=r.length;p<m;p++){const g=r[p];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:s,push:c,unshift:u,finish:f,sort:h}}function oT(){let r=new WeakMap;function e(n,i){const s=r.get(n);let l;return s===void 0?(l=new Ug,r.set(n,[l])):i>=s.length?(l=new Ug,s.push(l)):l=s[i],l}function t(){r=new WeakMap}return{get:e,dispose:t}}function aT(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new U,color:new Ie};break;case"SpotLight":t={position:new U,direction:new U,color:new Ie,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new U,color:new Ie,distance:0,decay:0};break;case"HemisphereLight":t={direction:new U,skyColor:new Ie,groundColor:new Ie};break;case"RectAreaLight":t={color:new Ie,position:new U,halfWidth:new U,halfHeight:new U};break}return r[e.id]=t,t}}}function lT(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new fe,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let cT=0;function uT(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function hT(r,e){const t=new aT,n=lT(),i={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 f=0;f<9;f++)i.probe.push(new U);const s=new U,l=new tt,c=new tt;function u(f,p){let m=0,g=0,y=0;for(let Q=0;Q<9;Q++)i.probe[Q].set(0,0,0);let M=0,x=0,v=0,w=0,E=0,A=0,N=0,R=0,L=0,z=0,b=0;f.sort(uT);const P=p===!0?Math.PI:1;for(let Q=0,ce=f.length;Q<ce;Q++){const V=f[Q],J=V.color,ee=V.intensity,le=V.distance,F=V.shadow&&V.shadow.map?V.shadow.map.texture:null;if(V.isAmbientLight)m+=J.r*ee*P,g+=J.g*ee*P,y+=J.b*ee*P;else if(V.isLightProbe){for(let H=0;H<9;H++)i.probe[H].addScaledVector(V.sh.coefficients[H],ee);b++}else if(V.isDirectionalLight){const H=t.get(V);if(H.color.copy(V.color).multiplyScalar(V.intensity*P),V.castShadow){const W=V.shadow,Y=n.get(V);Y.shadowBias=W.bias,Y.shadowNormalBias=W.normalBias,Y.shadowRadius=W.radius,Y.shadowMapSize=W.mapSize,i.directionalShadow[M]=Y,i.directionalShadowMap[M]=F,i.directionalShadowMatrix[M]=V.shadow.matrix,A++}i.directional[M]=H,M++}else if(V.isSpotLight){const H=t.get(V);H.position.setFromMatrixPosition(V.matrixWorld),H.color.copy(J).multiplyScalar(ee*P),H.distance=le,H.coneCos=Math.cos(V.angle),H.penumbraCos=Math.cos(V.angle*(1-V.penumbra)),H.decay=V.decay,i.spot[v]=H;const W=V.shadow;if(V.map&&(i.spotLightMap[L]=V.map,L++,W.updateMatrices(V),V.castShadow&&z++),i.spotLightMatrix[v]=W.matrix,V.castShadow){const Y=n.get(V);Y.shadowBias=W.bias,Y.shadowNormalBias=W.normalBias,Y.shadowRadius=W.radius,Y.shadowMapSize=W.mapSize,i.spotShadow[v]=Y,i.spotShadowMap[v]=F,R++}v++}else if(V.isRectAreaLight){const H=t.get(V);H.color.copy(J).multiplyScalar(ee),H.halfWidth.set(V.width*.5,0,0),H.halfHeight.set(0,V.height*.5,0),i.rectArea[w]=H,w++}else if(V.isPointLight){const H=t.get(V);if(H.color.copy(V.color).multiplyScalar(V.intensity*P),H.distance=V.distance,H.decay=V.decay,V.c
3658astShadow){const W=V.shadow,Y=n.get(V);Y.shadowBias=W.bias,Y.shadowNormalBias=W.normalBias,Y.shadowRadius=W.radius,Y.shadowMapSize=W.mapSize,Y.shadowCameraNear=W.camera.near,Y.shadowCameraFar=W.camera.far,i.pointShadow[x]=Y,i.pointShadowMap[x]=F,i.pointShadowMatrix[x]=V.shadow.matrix,N++}i.point[x]=H,x++}else if(V.isHemisphereLight){const H=t.get(V);H.skyColor.copy(V.color).multiplyScalar(ee*P),H.groundColor.copy(V.groundColor).multiplyScalar(ee*P),i.hemi[E]=H,E++}}w>0&&(e.isWebGL2?r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Me.LTC_FLOAT_1,i.rectAreaLTC2=Me.LTC_FLOAT_2):(i.rectAreaLTC1=Me.LTC_HALF_1,i.rectAreaLTC2=Me.LTC_HALF_2):r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Me.LTC_FLOAT_1,i.rectAreaLTC2=Me.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=Me.LTC_HALF_1,i.rectAreaLTC2=Me.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=m,i.ambient[1]=g,i.ambient[2]=y;const B=i.hash;(B.directionalLength!==M||B.pointLength!==x||B.spotLength!==v||B.rectAreaLength!==w||B.hemiLength!==E||B.numDirectionalShadows!==A||B.numPointShadows!==N||B.numSpotShadows!==R||B.numSpotMaps!==L||B.numLightProbes!==b)&&(i.directional.length=M,i.spot.length=v,i.rectArea.length=w,i.point.length=x,i.hemi.length=E,i.directionalShadow.length=A,i.directionalShadowMap.length=A,i.pointShadow.length=N,i.pointShadowMap.length=N,i.spotShadow.length=R,i.spotShadowMap.length=R,i.directionalShadowMatrix.length=A,i.pointShadowMatrix.length=N,i.spotLightMatrix.length=R+L-z,i.spotLightMap.length=L,i.numSpotLightShadowsWithMaps=z,i.numLightProbes=b,B.directionalLength=M,B.pointLength=x,B.spotLength=v,B.rectAreaLength=w,B.hemiLength=E,B.numDirectionalShadows=A,B.numPointShadows=N,B.numSpotShadows=R,B.numSpotMaps=L,B.numLightProbes=b,i.version=cT++)}function h(f,p){let m=0,g=0,y=0,M=0,x=0;const v=p.matrixWorldInverse;for(let w=0,E=f.length;w<E;w++){const A=f[w];if(A.isDirectionalLight){const N=i.directional[m];N.direction.setFromMatrixPosition(A.matrixWorld),s.setFromMatrixPosition(A.target.matrixWorld),N.direction.sub(s),N.direction.transformDirection(v),m++}else if(A.isSpotLight){const N=i.spot[y];N.position.setFromMatrixPosition(A.matrixWorld),N.position.applyMatrix4(v),N.direction.setFromMatrixPosition(A.matrixWorld),s.setFromMatrixPosition(A.target.matrixWorld),N.direction.sub(s),N.direction.transformDirection(v),y++}else if(A.isRectAreaLight){const N=i.rectArea[M];N.position.setFromMatrixPosition(A.matrixWorld),N.position.applyMatrix4(v),c.identity(),l.copy(A.matrixWorld),l.premultiply(v),c.extractRotation(l),N.halfWidth.set(A.width*.5,0,0),N.halfHeight.set(0,A.height*.5,0),N.halfWidth.applyMatrix4(c),N.halfHeight.applyMatrix4(c),M++}else if(A.isPointLight){const N=i.point[g];N.position.setFromMatrixPosition(A.matrixWorld),N.position.applyMatrix4(v),g++}else if(A.isHemisphereLight){const N=i.hemi[x];N.direction.setFromMatrixPosition(A.matrixWorld),N.direction.transformDirection(v),x++}}}return{setup:u,setupView:h,state:i}}function Og(r,e){const t=new hT(r,e),n=[],i=[];function s(){n.length=0,i.length=0}function l(p){n.push(p)}function c(p){i.push(p)}function u(p){t.setup(n,p)}function h(p){t.setupView(n,p)}return{init:s,state:{lightsArray:n,shadowsArray:i,lights:t},setupLights:u,setupLightsView:h,pushLight:l,pushShadow:c}}function fT(r,e){let t=new WeakMap;function n(s,l=0){const c=t.get(s);let u;return c===void 0?(u=new Og(r,e),t.set(s,[u])):l>=c.length?(u=new Og(r,e),c.push(u)):u=c[l],u}function i(){t=new WeakMap}return{get:n,dispose:i}}class jd extends In{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=W_,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 Kd extends In{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}}const dT=`void main() {
3659	gl_Position = vec4( position, 1.0 );
3660}`,pT=`uniform sampler2D shadow_pass;
3661uniform vec2 resolution;
3662uniform float radius;
3663#include <packing>
3664void main() {
3665	const float samples = float( VSM_SAMPLES );
3666	float mean = 0.0;
3667	float squared_mean = 0.0;
3668	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
3669	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
3670	for ( float i = 0.0; i < samples; i ++ ) {
3671		float uvOffset = uvStart + i * uvStride;
3672		#ifdef HORIZONTAL_PASS
3673			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
3674			mean += distribution.x;
3675			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
3676		#else
3677			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
3678			mean += depth;
3679			squared_mean += depth * depth;
3680		#endif
3681	}
3682	mean = mean / samples;
3683	squared_mean = squared_mean / samples;
3684	float std_dev = sqrt( squared_mean - mean * mean );
3685	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3686}`;function mT(r,e,t){let n=new qa;const i=new fe,s=new fe,l=new Pt,c=new jd({depthPacking:X_}),u=new Kd,h={},f=t.maxTextureSize,p={[ar]:Bn,[Bn]:ar,[Bi]:Bi},m=new Gi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new fe},radius:{value:4}},vertexShader:dT,fragmentShader:pT}),g=m.clone();g.defines.HORIZONTAL_PASS=1;const y=new dt;y.setAttribute("position",new bt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const M=new ln(y,m),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=au;let v=this.type;this.render=function(R,L,z){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||R.length===0)return;const b=r.getRenderTarget(),P=r.getActiveCubeFace(),B=r.getActiveMipmapLevel(),Q=r.state;Q.setBlending(or),Q.buffers.color.setClear(1,1,1,1),Q.buffers.depth.setTest(!0),Q.setScissorTest(!1);const ce=v!==Mi&&this.type===Mi,V=v===Mi&&this.type!==Mi;for(let J=0,ee=R.length;J<ee;J++){const le=R[J],F=le.shadow;if(F===void 0){console.warn("THREE.WebGLShadowMap:",le,"has no shadow.");continue}if(F.autoUpdate===!1&&F.needsUpdate===!1)continue;i.copy(F.mapSize);const H=F.getFrameExtents();if(i.multiply(H),s.copy(F.mapSize),(i.x>f||i.y>f)&&(i.x>f&&(s.x=Math.floor(f/H.x),i.x=s.x*H.x,F.mapSize.x=s.x),i.y>f&&(s.y=Math.floor(f/H.y),i.y=s.y*H.y,F.mapSize.y=s.y)),F.map===null||ce===!0||V===!0){const Y=this.type!==Mi?{minFilter:$t,magFilter:$t}:{};F.map!==null&&F.map.dispose(),F.map=new Ai(i.x,i.y,Y),F.map.texture.name=le.name+".shadowMap",F.camera.updateProjectionMatrix()}r.setRenderTarget(F.map),r.clear();const W=F.getViewportCount();for(let Y=0;Y<W;Y++){const oe=F.getViewport(Y);l.set(s.x*oe.x,s.y*oe.y,s.x*oe.z,s.y*oe.w),Q.viewport(l),F.updateMatrices(le,Y),n=F.getFrustum(),A(L,z,F.camera,le,this.type)}F.isPointLightShadow!==!0&&this.type===Mi&&w(F,z),F.needsUpdate=!1}v=this.type,x.needsUpdate=!1,r.setRenderTarget(b,P,B)};function w(R,L){const z=e.update(M);m.defines.VSM_SAMPLES!==R.blurSamples&&(m.defines.VSM_SAMPLES=R.blurSamples,g.defines.VSM_SAMPLES=R.blurSamples,m.needsUpdate=!0,g.needsUpdate=!0),R.mapPass===null&&(R.mapPass=new Ai(i.x,i.y)),m.uniforms.shadow_pass.value=R.map.texture,m.uniforms.resolution.value=R.mapSize,m.uniforms.radius.value=R.radius,r.setRenderTarget(R.mapPass),r.clear(),r.renderBufferDirect(L,null,z,m,M,null),g.uniforms.shadow_pass.value=R.mapPass.texture,g.uniforms.resolution.value=R.mapSize,g.uniforms.radius.value=R.radius,r.setRenderTarget(R.map),r.clear(),r.renderBufferDirect(L,null,z,g,M,null)}function E(R,L,z,b){let P=null;const B=z.isPointLight===!0?R.customDistanceMaterial:R.customDepthMaterial;if(B!==void 0)P=B;else if(P=z.isPointLight===!0?u:c,r.localClippingEnabled&&L.clipShadows===!0&&Array.isArray(L.clippingPlanes)&&L.clippingPlanes.length!==0||L.displacementMap&&L.displacementScale!==0||L.alphaMap&&L.alphaTest>0||L.map&&L.alphaTest>0){const Q=P.uuid,ce=L.uuid;let V=h[Q];V===void 0&&(V={},h[Q]=V);let J=V[ce];J===void 0&&(J=P.clone(),V[ce]=J,L.addEventListener("dispose",N)),P=J}if(P.visible=L.visible,P.wireframe=L.wireframe,b===Mi?P.side=L.shadowSide!==null?L.shadowSide:L.side:P.side=L.shadowSide!==null?L.shadowSide:p[L.side],P.alphaMap=L.alphaMap,P.alphaTest=L.alphaTest,P.map=L.map,P.clipSh
vendor: 4,307 bytes, line 3686
3686adows=L.clipShadows,P.clippingPlanes=L.clippingPlanes,P.clipIntersection=L.clipIntersection,P.displacementMap=L.displacementMap,P.displacementScale=L.displacementScale,P.displacementBias=L.displacementBias,P.wireframeLinewidth=L.wireframeLinewidth,P.linewidth=L.linewidth,z.isPointLight===!0&&P.isMeshDistanceMaterial===!0){const Q=r.properties.get(P);Q.light=z}return P}function A(R,L,z,b,P){if(R.visible===!1)return;if(R.layers.test(L.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&P===Mi)&&(!R.frustumCulled||n.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(z.matrixWorldInverse,R.matrixWorld);const ce=e.update(R),V=R.material;if(Array.isArray(V)){const J=ce.groups;for(let ee=0,le=J.length;ee<le;ee++){const F=J[ee],H=V[F.materialIndex];if(H&&H.visible){const W=E(R,H,b,P);R.onBeforeShadow(r,R,L,z,ce,W,F),r.renderBufferDirect(z,null,ce,W,R,F),R.onAfterShadow(r,R,L,z,ce,W,F)}}}else if(V.visible){const J=E(R,V,b,P);R.onBeforeShadow(r,R,L,z,ce,J,null),r.renderBufferDirect(z,null,ce,J,R,null),R.onAfterShadow(r,R,L,z,ce,J,null)}}const Q=R.children;for(let ce=0,V=Q.length;ce<V;ce++)A(Q[ce],L,z,b,P)}function N(R){R.target.removeEventListener("dispose",N);for(const z in h){const b=h[z],P=R.target.uuid;P in b&&(b[P].dispose(),delete b[P])}}}function gT(r,e,t){const n=t.isWebGL2;function i(){let G=!1;const Ae=new Pt;let be=null;const Ke=new Pt(0,0,0,0);return{setMask:function(Ye){be!==Ye&&!G&&(r.colorMask(Ye,Ye,Ye,Ye),be=Ye)},setLocked:function(Ye){G=Ye},setClear:function(Ye,Lt,Ct,Yt,hn){hn===!0&&(Ye*=Yt,Lt*=Yt,Ct*=Yt),Ae.set(Ye,Lt,Ct,Yt),Ke.equals(Ae)===!1&&(r.clearColor(Ye,Lt,Ct,Yt),Ke.copy(Ae))},reset:function(){G=!1,be=null,Ke.set(-1,0,0,0)}}}function s(){let G=!1,Ae=null,be=null,Ke=null;return{setTest:function(Ye){Ye?nt(r.DEPTH_TEST):Fe(r.DEPTH_TEST)},setMask:function(Ye){Ae!==Ye&&!G&&(r.depthMask(Ye),Ae=Ye)},setFunc:function(Ye){if(be!==Ye){switch(Ye){case v_:r.depthFunc(r.NEVER);break;case y_:r.depthFunc(r.ALWAYS);break;case x_:r.depthFunc(r.LESS);break;case xa:r.depthFunc(r.LEQUAL);break;case S_:r.depthFunc(r.EQUAL);break;case M_:r.depthFunc(r.GEQUAL);break;case E_:r.depthFunc(r.GREATER);break;case w_:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}be=Ye}},setLocked:function(Ye){G=Ye},setClear:function(Ye){Ke!==Ye&&(r.clearDepth(Ye),Ke=Ye)},reset:function(){G=!1,Ae=null,be=null,Ke=null}}}function l(){let G=!1,Ae=null,be=null,Ke=null,Ye=null,Lt=null,Ct=null,Yt=null,hn=null;return{setTest:function(It){G||(It?nt(r.STENCIL_TEST):Fe(r.STENCIL_TEST))},setMask:function(It){Ae!==It&&!G&&(r.stencilMask(It),Ae=It)},setFunc:function(It,yn,ri){(be!==It||Ke!==yn||Ye!==ri)&&(r.stencilFunc(It,yn,ri),be=It,Ke=yn,Ye=ri)},setOp:function(It,yn,ri){(Lt!==It||Ct!==yn||Yt!==ri)&&(r.stencilOp(It,yn,ri),Lt=It,Ct=yn,Yt=ri)},setLocked:function(It){G=It},setClear:function(It){hn!==It&&(r.clearStencil(It),hn=It)},reset:function(){G=!1,Ae=null,be=null,Ke=null,Ye=null,Lt=null,Ct=null,Yt=null,hn=null}}}const c=new i,u=new s,h=new l,f=new WeakMap,p=new WeakMap;let m={},g={},y=new WeakMap,M=[],x=null,v=!1,w=null,E=null,A=null,N=null,R=null,L=null,z=null,b=new Ie(0,0,0),P=0,B=!1,Q=null,ce=null,V=null,J=null,ee=null;const le=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let F=!1,H=0;const W=r.getParameter(r.VERSION);W.indexOf("WebGL")!==-1?(H=parseFloat(/^WebGL (\d)/.exec(W)[1]),F=H>=1):W.indexOf("OpenGL ES")!==-1&&(H=parseFloat(/^OpenGL ES (\d)/.exec(W)[1]),F=H>=2);let Y=null,oe={};const j=r.getParameter(r.SCISSOR_BOX),ae=r.getParameter(r.VIEWPORT),xe=new Pt().fromArray(j),Te=new Pt().fromArray(ae);function Ee(G,Ae,be,Ke){const Ye=new Uint8Array(4),Lt=r.createTexture();r.bindTexture(G,Lt),r.texParameteri(G,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(G,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Ct=0;Ct<be;Ct++)n&&(G===r.TEXTURE_3D||G===r.TEXTURE_2D_ARRAY)?r.texImage3D(Ae,0,r.RGBA,1,1,Ke,0,r.RGBA,r.UNSIGNED_BYTE,Ye):r.texImage2D(Ae+Ct,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,Ye);return Lt}const et={};et[r.TEXTURE_2D]=Ee(r.TEXTURE_2D,r.TEXTURE_2D,1),et[r.TEXTURE_CUBE_MAP]=Ee(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),n&&(et[r.TEXTURE_2D_ARRAY]=Ee(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),et[r.TEXTURE_3D]=Ee(r.TEXTURE_3D,r.TEXTURE_3D,1,1)),c.setClear(0,0,0,1),u.setClear(1),h.setClear(0),nt(r.DEPTH_TEST),u.setFu
vendor: 4,807 bytes, line 3686
3686nc(xa),Pe(!1),I(kf),nt(r.CULL_FACE),ue(or);function nt(G){m[G]!==!0&&(r.enable(G),m[G]=!0)}function Fe(G){m[G]!==!1&&(r.disable(G),m[G]=!1)}function Xe(G,Ae){return g[G]!==Ae?(r.bindFramebuffer(G,Ae),g[G]=Ae,n&&(G===r.DRAW_FRAMEBUFFER&&(g[r.FRAMEBUFFER]=Ae),G===r.FRAMEBUFFER&&(g[r.DRAW_FRAMEBUFFER]=Ae)),!0):!1}function k(G,Ae){let be=M,Ke=!1;if(G)if(be=y.get(Ae),be===void 0&&(be=[],y.set(Ae,be)),G.isWebGLMultipleRenderTargets){const Ye=G.texture;if(be.length!==Ye.length||be[0]!==r.COLOR_ATTACHMENT0){for(let Lt=0,Ct=Ye.length;Lt<Ct;Lt++)be[Lt]=r.COLOR_ATTACHMENT0+Lt;be.length=Ye.length,Ke=!0}}else be[0]!==r.COLOR_ATTACHMENT0&&(be[0]=r.COLOR_ATTACHMENT0,Ke=!0);else be[0]!==r.BACK&&(be[0]=r.BACK,Ke=!0);Ke&&(t.isWebGL2?r.drawBuffers(be):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(be))}function _e(G){return x!==G?(r.useProgram(G),x=G,!0):!1}const he={[Rr]:r.FUNC_ADD,[i_]:r.FUNC_SUBTRACT,[r_]:r.FUNC_REVERSE_SUBTRACT};if(n)he[Wf]=r.MIN,he[Xf]=r.MAX;else{const G=e.get("EXT_blend_minmax");G!==null&&(he[Wf]=G.MIN_EXT,he[Xf]=G.MAX_EXT)}const ve={[s_]:r.ZERO,[o_]:r.ONE,[a_]:r.SRC_COLOR,[$c]:r.SRC_ALPHA,[d_]:r.SRC_ALPHA_SATURATE,[h_]:r.DST_COLOR,[c_]:r.DST_ALPHA,[l_]:r.ONE_MINUS_SRC_COLOR,[eu]:r.ONE_MINUS_SRC_ALPHA,[f_]:r.ONE_MINUS_DST_COLOR,[u_]:r.ONE_MINUS_DST_ALPHA,[p_]:r.CONSTANT_COLOR,[m_]:r.ONE_MINUS_CONSTANT_COLOR,[g_]:r.CONSTANT_ALPHA,[__]:r.ONE_MINUS_CONSTANT_ALPHA};function ue(G,Ae,be,Ke,Ye,Lt,Ct,Yt,hn,It){if(G===or){v===!0&&(Fe(r.BLEND),v=!1);return}if(v===!1&&(nt(r.BLEND),v=!0),G!==n_){if(G!==w||It!==B){if((E!==Rr||R!==Rr)&&(r.blendEquation(r.FUNC_ADD),E=Rr,R=Rr),It)switch(G){case ps:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Hf:r.blendFunc(r.ONE,r.ONE);break;case Vf:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Gf:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",G);break}else switch(G){case ps:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Hf:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case Vf:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Gf:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",G);break}A=null,N=null,L=null,z=null,b.set(0,0,0),P=0,w=G,B=It}return}Ye=Ye||Ae,Lt=Lt||be,Ct=Ct||Ke,(Ae!==E||Ye!==R)&&(r.blendEquationSeparate(he[Ae],he[Ye]),E=Ae,R=Ye),(be!==A||Ke!==N||Lt!==L||Ct!==z)&&(r.blendFuncSeparate(ve[be],ve[Ke],ve[Lt],ve[Ct]),A=be,N=Ke,L=Lt,z=Ct),(Yt.equals(b)===!1||hn!==P)&&(r.blendColor(Yt.r,Yt.g,Yt.b,hn),b.copy(Yt),P=hn),w=G,B=!1}function We(G,Ae){G.side===Bi?Fe(r.CULL_FACE):nt(r.CULL_FACE);let be=G.side===Bn;Ae&&(be=!be),Pe(be),G.blending===ps&&G.transparent===!1?ue(or):ue(G.blending,G.blendEquation,G.blendSrc,G.blendDst,G.blendEquationAlpha,G.blendSrcAlpha,G.blendDstAlpha,G.blendColor,G.blendAlpha,G.premultipliedAlpha),u.setFunc(G.depthFunc),u.setTest(G.depthTest),u.setMask(G.depthWrite),c.setMask(G.colorWrite);const Ke=G.stencilWrite;h.setTest(Ke),Ke&&(h.setMask(G.stencilWriteMask),h.setFunc(G.stencilFunc,G.stencilRef,G.stencilFuncMask),h.setOp(G.stencilFail,G.stencilZFail,G.stencilZPass)),K(G.polygonOffset,G.polygonOffsetFactor,G.polygonOffsetUnits),G.alphaToCoverage===!0?nt(r.SAMPLE_ALPHA_TO_COVERAGE):Fe(r.SAMPLE_ALPHA_TO_COVERAGE)}function Pe(G){Q!==G&&(G?r.frontFace(r.CW):r.frontFace(r.CCW),Q=G)}function I(G){G!==$0?(nt(r.CULL_FACE),G!==ce&&(G===kf?r.cullFace(r.BACK):G===e_?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):Fe(r.CULL_FACE),ce=G}function C(G){G!==V&&(F&&r.lineWidth(G),V=G)}function K(G,Ae,be){G?(nt(r.POLYGON_OFFSET_FILL),(J!==Ae||ee!==be)&&(r.polygonOffset(Ae,be),J=Ae,ee=be)):Fe(r.POLYGON_OFFSET_FILL)}function ge(G){G?nt(r.SCISSOR_TEST):Fe(r.SCISSOR_TEST)}function pe(G){G===void 0&&(G=r.TEXTURE0+le-1),Y!==G&&(r.activeTexture(G),Y=G)}function de(G,Ae,be){be===void 0&&(Y===null?be=r.TEXTURE0+le-1:be=Y);let Ke=oe[be];Ke===void 0&&(Ke={type:void 0,texture:void 0},oe[be]=Ke),(Ke.type!==G||Ke.texture!==Ae)&&(Y!==be&&(r.activeTexture(be),Y=be),r.bindTexture(G,Ae||et[G]),Ke.type=G,Ke.texture=Ae)}function ze(){const G=oe[Y];G!==void 0&&G.type!==void 0&&(r.bindTexture(G.type,null),G.type=void 0,G.texture=void 0)}function we(){try{r.compressedTexImage2D.apply(r,arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function De(){try{r.compressedTexImage3D.apply(r,arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Je(){try{r.texSubImage2D.apply(r,arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function at(){try{r.texSubImage3D.apply(r,arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function me(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(G){console.error("THREE.WebGLState:",G)}}
3686function xt(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function _t(){try{r.texStorage2D.apply(r,arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function rt(){try{r.texStorage3D.apply(r,arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function qe(){try{r.texImage2D.apply(r,arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Oe(){try{r.texImage3D.apply(r,arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function ut(G){xe.equals(G)===!1&&(r.scissor(G.x,G.y,G.z,G.w),xe.copy(G))}function Mt(G){Te.equals(G)===!1&&(r.viewport(G.x,G.y,G.z,G.w),Te.copy(G))}function Ft(G,Ae){let be=p.get(Ae);be===void 0&&(be=new WeakMap,p.set(Ae,be));let Ke=be.get(G);Ke===void 0&&(Ke=r.getUniformBlockIndex(Ae,G.name),be.set(G,Ke))}function pt(G,Ae){const Ke=p.get(Ae).get(G);f.get(Ae)!==Ke&&(r.uniformBlockBinding(Ae,Ke,G.__bindingPointIndex),f.set(Ae,Ke))}function Se(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),n===!0&&(r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null)),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),m={},Y=null,oe={},g={},y=new WeakMap,M=[],x=null,v=!1,w=null,E=null,A=null,N=null,R=null,L=null,z=null,b=new Ie(0,0,0),P=0,B=!1,Q=null,ce=null,V=null,J=null,ee=null,xe.set(0,0,r.canvas.width,r.canvas.height),Te.set(0,0,r.canvas.width,r.canvas.height),c.reset(),u.reset(),h.reset()}return{buffers:{color:c,depth:u,stencil:h},enable:nt,disable:Fe,bindFramebuffer:Xe,drawBuffers:k,useProgram:_e,setBlending:ue,setMaterial:We,setFlipSided:Pe,setCullFace:I,setLineWidth:C,setPolygonOffset:K,setScissorTest:ge,activeTexture:pe,bindTexture:de,unbindTexture:ze,compressedTexImage2D:we,compressedTexImage3D:De,texImage2D:qe,texImage3D:Oe,updateUBOMapping:Ft,uniformBlockBinding:pt,texStorage2D:_t,texStorage3D:rt,texSubImage2D:Je,texSubImage3D:at,compressedTexSubImage2D:me,compressedTexSubImage3D:xt,scissor:ut,viewport:Mt,reset:Se}}function _T(r,e,t,n,i,s,l){const c=i.isWebGL2,u=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,h=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let p;const m=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(I,C){return g?new OffscreenCanvas(I,C):Ia("canvas")}function M(I,C,K,ge){let pe=1;if((I.width>ge||I.height>ge)&&(pe=ge/Math.max(I.width,I.height)),pe<1||C===!0)if(typeof HTMLImageElement<"u"&&I instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&I instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&I instanceof ImageBitmap){const de=C?iu:Math.floor,ze=de(pe*I.width),we=de(pe*I.height);p===void 0&&(p=y(ze,we));const De=K?y(ze,we):p;return De.width=ze,De.height=we,De.getContext("2d").drawImage(I,0,0,ze,we),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+I.width+"x"+I.height+") to ("+ze+"x"+we+")."),De}else return"data"in I&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+I.width+"x"+I.height+")."),I;return I}function x(I){return xd(I.width)&&xd(I.height)}function v(I){return c?!1:I.wrapS!==Pn||I.wrapT!==Pn||I.minFilter!==$t&&I.minFilter!==en}function w(I,C){return I.generateMipmaps&&C&&I.minFilter!==$t&&I.minFilter!==en}function E(I){r.generateMipmap(I)}function A(I,C,K,ge,pe=!1){if(c===!1)return C;if(I!==null){if(r[I]!==void 0)return r[I];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+I+"'")}let de=C;
3686if(C===r.RED&&(K===r.FLOAT&&(de=r.R32F),K===r.HALF_FLOAT&&(de=r.R16F),K===r.UNSIGNED_BYTE&&(de=r.R8)),C===r.RED_INTEGER&&(K===r.UNSIGNED_BYTE&&(de=r.R8UI),K===r.UNSIGNED_SHORT&&(de=r.R16UI),K===r.UNSIGNED_INT&&(de=r.R32UI),K===r.BYTE&&(de=r.R8I),K===r.SHORT&&(de=r.R16I),K===r.INT&&(de=r.R32I)),C===r.RG&&(K===r.FLOAT&&(de=r.RG32F),K===r.HALF_FLOAT&&(de=r.RG16F),K===r.UNSIGNED_BYTE&&(de=r.RG8)),C===r.RGBA){const ze=pe?Ca:Rt.getTransfer(ge);K===r.FLOAT&&(de=r.RGBA32F),K===r.HALF_FLOAT&&(de=r.RGBA16F),K===r.UNSIGNED_BYTE&&(de=ze===Nt?r.SRGB8_ALPHA8:r.RGBA8),K===r.UNSIGNED_SHORT_4_4_4_4&&(de=r.RGBA4),K===r.UNSIGNED_SHORT_5_5_5_1&&(de=r.RGB5_A1)}return(de===r.R16F||de===r.R32F||de===r.RG16F||de===r.RG32F||de===r.RGBA16F||de===r.RGBA32F)&&e.get("EXT_color_buffer_float"),de}function N(I,C,K){return w(I,K)===!0||I.isFramebufferTexture&&I.minFilter!==$t&&I.minFilter!==en?Math.log2(Math.max(C.width,C.height))+1:I.mipmaps!==void 0&&I.mipmaps.length>0?I.mipmaps.length:I.isCompressedTexture&&Array.isArray(I.image)?C.mipmaps.length:1}function R(I){return I===$t||I===tu||I===ma?r.NEAREST:r.LINEAR}function L(I){const C=I.target;C.removeEventListener("dispose",L),b(C),C.isVideoTexture&&f.delete(C)}function z(I){const C=I.target;C.removeEventListener("dispose",z),B(C)}function b(I){const C=n.get(I);if(C.__webglInit===void 0)return;const K=I.source,ge=m.get(K);if(ge){const pe=ge[C.__cacheKey];pe.usedTimes--,pe.usedTimes===0&&P(I),Object.keys(ge).length===0&&m.delete(K)}n.remove(I)}function P(I){const C=n.get(I);r.deleteTexture(C.__webglTexture);const K=I.source,ge=m.get(K);delete ge[C.__cacheKey],l.memory.textures--}function B(I){const C=I.texture,K=n.get(I),ge=n.get(C);if(ge.__webglTexture!==void 0&&(r.deleteTexture(ge.__webglTexture),l.memory.textures--),I.depthTexture&&I.depthTexture.dispose(),I.isWebGLCubeRenderTarget)for(let pe=0;pe<6;pe++){if(Array.isArray(K.__webglFramebuffer[pe]))for(let de=0;de<K.__webglFramebuffer[pe].length;de++)r.deleteFramebuffer(K.__webglFramebuffer[pe][de]);else r.deleteFramebuffer(K.__webglFramebuffer[pe]);K.__webglDepthbuffer&&r.deleteRenderbuffer(K.__webglDepthbuffer[pe])}else{if(Array.isArray(K.__webglFramebuffer))for(let pe=0;pe<K.__webglFramebuffer.length;pe++)r.deleteFramebuffer(K.__webglFramebuffer[pe]);else r.deleteFramebuffer(K.__webglFramebuffer);if(K.__webglDepthbuffer&&r.deleteRenderbuffer(K.__webglDepthbuffer),K.__webglMultisampledFramebuffer&&r.deleteFramebuffer(K.__webglMultisampledFramebuffer),K.__webglColorRenderbuffer)for(let pe=0;pe<K.__webglColorRenderbuffer.length;pe++)K.__webglColorRenderbuffer[pe]&&r.deleteRenderbuffer(K.__webglColorRenderbuffer[pe]);K.__webglDepthRenderbuffer&&r.deleteRenderbuffer(K.__webglDepthRenderbuffer)}if(I.isWebGLMultipleRenderTargets)for(let pe=0,de=C.length;pe<de;pe++){const ze=n.get(C[pe]);ze.__webglTexture&&(r.deleteTexture(ze.__webglTexture),l.memory.textures--),n.remove(C[pe])}n.remove(C),n.remove(I)}let Q=0;function ce(){Q=0}function V(){const I=Q;return I>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+I+" texture units while this GPU supports only "+i.maxTextures),Q+=1,I}function J(I){const C=[];return C.push(I.wrapS),C.push(I.wrapT),C.push(I.wrapR||0),C.push(I.magFilter),C.push(I.minFilter),C.push(I.anisotropy),C.push(I.internalFormat),C.push(I.format),C.push(I.type),C.push(I.generateMipmaps),C.push(I.premultiplyAlpha),C.push(I.flipY),C.push(I.unpackAlignment),C.push(I.colorSpace),C.join()}function ee(I,C){const K=n.get(I);if(I.isVideoTexture&&We(I),I.isRenderTargetTexture===!1&&I.version>0&&K.__version!==I.version){const ge=I.image;if(ge===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ge.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{xe(K,I,C);return}}t.bindTexture(r.TEXTURE_2D,K.__webglTexture,r.TEXTURE0+C)}function le(I,C){const K=n.get(I);if(I.version>0&&K.__version!==I.version){xe(K,I,C);return}t.bindTexture(r.TEXTURE_2D_ARRAY,K.__webglTexture,r.TEXTURE0+C)}function F(I,C){const K=n.get(I);if(I.version>0&&K.__version!==I.version){xe(K,I,C);return}t.bindTexture(r.TEXTURE_3D,K.__webglTexture,r.TEXTURE0+C)}function H(I,C){const K=n.get(I);if(I.version>0&&K.__version!==I.version){Te(K,I,C);return}t.bindTexture(r.TEXTURE_CUBE_MAP,K.__webglTexture,r.TEXTURE0+C)}const W={[Ea]:r.REPEAT,[Pn]:r.CLAMP_TO_EDGE,[wa]:r.MIRRORED_REPEAT},Y={[$t]:r.NEAREST,[tu]:r.NEAREST_MIPMAP_NEAREST,[ma]:r.NEAREST_MIPMAP_LINEAR,[en]:r.LINEAR,[Id]:r.LINEAR_MIPMAP_NEAREST,[Or]:r.LINEAR_MIPMAP_LINEAR},oe={[Y_]:r.NEVER,[$_]:r.ALWAYS,[Z_]:r.LESS,[Vd]:r.LEQUAL,[J_]:r.EQUAL,[Q_]:r.GEQUAL,[j_]:r.GREATER,[K_]:r.NOTEQUAL};function j(I,C,K){if(K?(r.texParameteri(I,r.TEXTURE_WRAP_S,W[C.wrapS]),r.texParameteri(I,r.TEXTURE_WRAP_T,W[C.wrapT]),(I===r.TEXTURE_3D||I===r.TEXTURE_2D_ARRAY)&&r.texParameteri(I,r.TEXTURE_WRAP_R,W[C.wrapR]),r.texParameteri(I,r.TEXTURE_MAG_FILTER,Y[C.magFilter]),r.texParameteri(I,r.TEXTURE_MIN_FILTER,Y[C.minFilter])):(r.texParameteri(I,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(I,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(I===r.TEXTURE_3D||I===r.TEXTURE_2D_ARRAY)&&r.texParameteri(I,r.TEXTURE_WRAP_R,r.CLAMP_TO_EDGE),(C.wrapS!==Pn||C.wrapT!==Pn)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(I,r.TEXTURE_MAG_FILTER,R(C.magFilter)),r.texParameteri(I,r.TEXTURE_MIN_FILTER,R(C.minFilter)),C.minFilter!==$t&&C.minFilter!==en&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),C.compareFunction&&(r.texParameteri(I,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(I,r.TEXTURE_COMPARE_FUNC,oe[C.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ge=e.get("EXT_texture_filter_anisotropic");if(C.magFilter===$t||C.minFilter!==ma&&C.minFilter!==Or||C.type===wi&&e.has("OES_texture_float_linear")===!1||c===!1&&C.type===xo&&e.has("OES_texture_half_float_linear")===!1)return;(C.anisotropy>1||n.get(C).__currentAnisotropy)&&(r.texParameterf(I,ge.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(C.anisotropy,i.getMaxAnisotropy())),n.get(C).__currentAnisotropy=C.anisotropy)}}function ae(I,C){let K=!1;I.__webglInit===void 0&&(I.__webglInit=!0,C.addEventListener("dispose",L));const ge=C.source;let pe=m.get(ge);pe===void 0&&(pe={},m.set(ge,pe));const de=J(C);if(de!==I.__cacheKey){pe[de]===void 0&&(pe[de]={texture:r.createTexture(),usedTimes:0},l.memory.textures++,K=!0),pe[de].usedTimes++;const ze=pe[I.__cacheKey];ze!==void 0&&(pe[I.__cacheKey].usedTimes--,ze.usedTimes===0&&P(C)),I.__cacheKey=de,I.__webglTexture=pe[de].texture}return K}function xe(I,C,K){let ge=r.TEXTURE_2D;(C.isDataArrayTexture||C.isCompressedArrayTexture)&&(ge=r.TEXTURE_2D_ARRAY),C.isData3DTexture&&(ge=r.TEXTURE_3D);const pe=ae(I,C),de=C.source;t.bindTexture(ge,I.__webglTexture,r.TEXTURE0+K);const ze=n.get(de);if(de.version!==ze.__version||pe===!0){t.activeTexture(r.TEXTURE0+K);
3686const we=Rt.getPrimaries(Rt.workingColorSpace),De=C.colorSpace===ni?null:Rt.getPrimaries(C.colorSpace),Je=C.colorSpace===ni||we===De?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,C.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,C.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Je);const at=v(C)&&x(C.image)===!1;let me=M(C.image,at,!1,i.maxTextureSize);me=Pe(C,me);const xt=x(me)||c,_t=s.convert(C.format,C.colorSpace);let rt=s.convert(C.type),qe=A(C.internalFormat,_t,rt,C.colorSpace,C.isVideoTexture);j(ge,C,xt);let Oe;const ut=C.mipmaps,Mt=c&&C.isVideoTexture!==!0&&qe!==zd,Ft=ze.__version===void 0||pe===!0,pt=N(C,me,xt);if(C.isDepthTexture)qe=r.DEPTH_COMPONENT,c?C.type===wi?qe=r.DEPTH_COMPONENT32F:C.type===rr?qe=r.DEPTH_COMPONENT24:C.type===Ir?qe=r.DEPTH24_STENCIL8:qe=r.DEPTH_COMPONENT16:C.type===wi&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),C.format===Dr&&qe===r.DEPTH_COMPONENT&&C.type!==cu&&C.type!==rr&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),C.type=rr,rt=s.convert(C.type)),C.format===ys&&qe===r.DEPTH_COMPONENT&&(qe=r.DEPTH_STENCIL,C.type!==Ir&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),C.type=Ir,rt=s.convert(C.type))),Ft&&(Mt?t.texStorage2D(r.TEXTURE_2D,1,qe,me.width,me.height):t.texImage2D(r.TEXTURE_2D,0,qe,me.width,me.height,0,_t,rt,null));else if(C.isDataTexture)if(ut.length>0&&xt){Mt&&Ft&&t.texStorage2D(r.TEXTURE_2D,pt,qe,ut[0].width,ut[0].height);for(let Se=0,G=ut.length;Se<G;Se++)Oe=ut[Se],Mt?t.texSubImage2D(r.TEXTURE_2D,Se,0,0,Oe.width,Oe.height,_t,rt,Oe.data):t.texImage2D(r.TEXTURE_2D,Se,qe,Oe.width,Oe.height,0,_t,rt,Oe.data);C.generateMipmaps=!1}else Mt?(Ft&&t.texStorage2D(r.TEXTURE_2D,pt,qe,me.width,me.height),t.texSubImage2D(r.TEXTURE_2D,0,0,0,me.width,me.height,_t,rt,me.data)):t.texImage2D(r.TEXTURE_2D,0,qe,me.width,me.height,0,_t,rt,me.data);else if(C.isCompressedTexture)if(C.isCompressedArrayTexture){Mt&&Ft&&t.texStorage3D(r.TEXTURE_2D_ARRAY,pt,qe,ut[0].width,ut[0].height,me.depth);for(let Se=0,G=ut.length;Se<G;Se++)Oe=ut[Se],C.format!==Fn?_t!==null?Mt?t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,Se,0,0,0,Oe.width,Oe.height,me.depth,_t,Oe.data,0,0):t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,Se,qe,Oe.width,Oe.height,me.depth,0,Oe.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Mt?t.texSubImage3D(r.TEXTURE_2D_ARRAY,Se,0,0,0,Oe.width,Oe.height,me.depth,_t,rt,Oe.data):t.texImage3D(r.TEXTURE_2D_ARRAY,Se,qe,Oe.width,Oe.height,me.depth,0,_t,rt,Oe.data)}else{Mt&&Ft&&t.texStorage2D(r.TEXTURE_2D,pt,qe,ut[0].width,ut[0].height);for(let Se=0,G=ut.length;Se<G;Se++)Oe=ut[Se],C.format!==Fn?_t!==null?Mt?t.compressedTexSubImage2D(r.TEXTURE_2D,Se,0,0,Oe.width,Oe.height,_t,Oe.data):t.compressedTexImage2D(r.TEXTURE_2D,Se,qe,Oe.width,Oe.height,0,Oe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Mt?t.texSubImage2D(r.TEXTURE_2D,Se,0,0,Oe.width,Oe.height,_t,rt,Oe.data):t.texImage2D(r.TEXTURE_2D,Se,qe,Oe.width,Oe.height,0,_t,rt,Oe.data)}else if(C.isDataArrayTexture)Mt?(Ft&&t.texStorage3D(r.TEXTURE_2D_ARRAY,pt,qe,me.width,me.height,me.depth),t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,me.width,me.height,me.depth,_t,rt,me.data)):t.texImage3D(r.TEXTURE_2D_ARRAY,0,qe,me.width,me.height,me.depth,0,_t,rt,me.data);else if(C.isData3DTexture)Mt?(Ft&&t.texStorage3D(r.TEXTURE_3D,pt,qe,me.width,me.height,me.depth),t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,me.width,me.height,me.depth,_t,rt,me.data)):t.texImage3D(r.TEXTURE_3D,0,qe,me.width,me.height,me.depth,0,_t,rt,me.data);else if(C.isFramebufferTexture){if(Ft)if(Mt)t.texStorage2D(r.TEXTURE_2D,pt,qe,me.width,me.height);else{let Se=me.width,G=me.height;for(let Ae=0;Ae<pt;Ae++)t.texImage2D(r.TEXTURE_2D,Ae,qe,Se,G,0,_t,rt,null),Se>>=1,G>>=1}}else if(ut.length>0&&xt){Mt&&Ft&&t.texStorage2D(r.TEXTURE_2D,pt,qe,ut[0].width,ut[0].height);for(let Se=0,G=ut.length;Se<G;Se++)Oe=ut[Se],Mt?t.texSubImage2D(r.TEXTURE_2D,Se,0,0,_t,rt,Oe):t.texImage2D(r.TEXTURE_2D,Se,qe,_t,rt,Oe);C.generateMipmaps=!1}else Mt?(Ft&&t.texStorage2D(r.TEXTURE_2D,pt,qe,me.width,me.height),t.texSubImage2D(r.TEXTURE_2D,0,0,0,_t,rt,me)):t.texImage2D(r.TEXTURE_2D,0,qe,_t,rt,me);w(C,xt)&&E(ge),ze.__version=de.version,C.onUpdate&&C.onUpdate(C)}I.__version=C.version}function Te(I,C,K){if(C.image.length!==6)return;const ge=ae(I,C),pe=C.source;t.bindTexture(r.TEXTURE_CUBE_MAP,I.__webglTexture,r.TEXTURE0+K);const de=n.get(pe);if(pe.version!==de.__version||ge===!0){t.activeTexture(r.TEXTURE0+K);
3686const ze=Rt.getPrimaries(Rt.workingColorSpace),we=C.colorSpace===ni?null:Rt.getPrimaries(C.colorSpace),De=C.colorSpace===ni||ze===we?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,C.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,C.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,De);const Je=C.isCompressedTexture||C.image[0].isCompressedTexture,at=C.image[0]&&C.image[0].isDataTexture,me=[];for(let Se=0;Se<6;Se++)!Je&&!at?me[Se]=M(C.image[Se],!1,!0,i.maxCubemapSize):me[Se]=at?C.image[Se].image:C.image[Se],me[Se]=Pe(C,me[Se]);const xt=me[0],_t=x(xt)||c,rt=s.convert(C.format,C.colorSpace),qe=s.convert(C.type),Oe=A(C.internalFormat,rt,qe,C.colorSpace),ut=c&&C.isVideoTexture!==!0,Mt=de.__version===void 0||ge===!0;let Ft=N(C,xt,_t);j(r.TEXTURE_CUBE_MAP,C,_t);let pt;if(Je){ut&&Mt&&t.texStorage2D(r.TEXTURE_CUBE_MAP,Ft,Oe,xt.width,xt.height);for(let Se=0;Se<6;Se++){pt=me[Se].mipmaps;for(let G=0;G<pt.length;G++){const Ae=pt[G];C.format!==Fn?rt!==null?ut?t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,G,0,0,Ae.width,Ae.height,rt,Ae.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,G,Oe,Ae.width,Ae.height,0,Ae.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):ut?t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,G,0,0,Ae.width,Ae.height,rt,qe,Ae.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,G,Oe,Ae.width,Ae.height,0,rt,qe,Ae.data)}}}else{pt=C.mipmaps,ut&&Mt&&(pt.length>0&&Ft++,t.texStorage2D(r.TEXTURE_CUBE_MAP,Ft,Oe,me[0].width,me[0].height));for(let Se=0;Se<6;Se++)if(at){ut?t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,0,0,me[Se].width,me[Se].height,rt,qe,me[Se].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,Oe,me[Se].width,me[Se].height,0,rt,qe,me[Se].data);for(let G=0;G<pt.length;G++){const be=pt[G].image[Se].image;ut?t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,G+1,0,0,be.width,be.height,rt,qe,be.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,G+1,Oe,be.width,be.height,0,rt,qe,be.data)}}else{ut?t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,0,0,rt,qe,me[Se]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,Oe,rt,qe,me[Se]);for(let G=0;G<pt.length;G++){const Ae=pt[G];ut?t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,G+1,0,0,rt,qe,Ae.image[Se]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,G+1,Oe,rt,qe,Ae.image[Se])}}}w(C,_t)&&E(r.TEXTURE_CUBE_MAP),de.__version=pe.version,C.onUpdate&&C.onUpdate(C)}I.__version=C.version}function Ee(I,C,K,ge,pe,de){const ze=s.convert(K.format,K.colorSpace),we=s.convert(K.type),De=A(K.internalFormat,ze,we,K.colorSpace);if(!n.get(C).__hasExternalTextures){const at=Math.max(1,C.width>>de),me=Math.max(1,C.height>>de);pe===r.TEXTURE_3D||pe===r.TEXTURE_2D_ARRAY?t.texImage3D(pe,de,De,at,me,C.depth,0,ze,we,null):t.texImage2D(pe,de,De,at,me,0,ze,we,null)}t.bindFramebuffer(r.FRAMEBUFFER,I),ue(C)?u.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,ge,pe,n.get(K).__webglTexture,0,ve(C)):(pe===r.TEXTURE_2D||pe>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&pe<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,ge,pe,n.get(K).__webglTexture,de),t.bindFramebuffer(r.FRAMEBUFFER,null)}function et(I,C,K){if(r.bindRenderbuffer(r.RENDERBUFFER,I),C.depthBuffer&&!C.stencilBuffer){let ge=c===!0?r.DEPTH_COMPONENT24:r.DEPTH_COMPONENT16;if(K||ue(C)){const pe=C.depthTexture;pe&&pe.isDepthTexture&&(pe.type===wi?ge=r.DEPTH_COMPONENT32F:pe.type===rr&&(ge=r.DEPTH_COMPONENT24));const de=ve(C);ue(C)?u.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,de,ge,C.width,C.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,de,ge,C.width,C.height)}else r.renderbufferStorage(r.RENDERBUFFER,ge,C.width,C.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,I)}else if(C.depthBuffer&&C.stencilBuffer){const ge=ve(C);K&&ue(C)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,ge,r.DEPTH24_STENCIL8,C.width,C.height):ue(C)?u.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ge,r.DEPTH24_STENCIL8,C.width,C.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,C.width,C.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,I)}
3686else{const ge=C.isWebGLMultipleRenderTargets===!0?C.texture:[C.texture];for(let pe=0;pe<ge.length;pe++){const de=ge[pe],ze=s.convert(de.format,de.colorSpace),we=s.convert(de.type),De=A(de.internalFormat,ze,we,de.colorSpace),Je=ve(C);K&&ue(C)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Je,De,C.width,C.height):ue(C)?u.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Je,De,C.width,C.height):r.renderbufferStorage(r.RENDERBUFFER,De,C.width,C.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function nt(I,C){if(C&&C.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,I),!(C.depthTexture&&C.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(C.depthTexture).__webglTexture||C.depthTexture.image.width!==C.width||C.depthTexture.image.height!==C.height)&&(C.depthTexture.image.width=C.width,C.depthTexture.image.height=C.height,C.depthTexture.needsUpdate=!0),ee(C.depthTexture,0);const ge=n.get(C.depthTexture).__webglTexture,pe=ve(C);if(C.depthTexture.format===Dr)ue(C)?u.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,ge,0,pe):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,ge,0);else if(C.depthTexture.format===ys)ue(C)?u.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,ge,0,pe):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,ge,0);else throw new Error("Unknown depthTexture format")}function Fe(I){const C=n.get(I),K=I.isWebGLCubeRenderTarget===!0;if(I.depthTexture&&!C.__autoAllocateDepthBuffer){if(K)throw new Error("target.depthTexture not supported in Cube render targets");nt(C.__webglFramebuffer,I)}else if(K){C.__webglDepthbuffer=[];for(let ge=0;ge<6;ge++)t.bindFramebuffer(r.FRAMEBUFFER,C.__webglFramebuffer[ge]),C.__webglDepthbuffer[ge]=r.createRenderbuffer(),et(C.__webglDepthbuffer[ge],I,!1)}else t.bindFramebuffer(r.FRAMEBUFFER,C.__webglFramebuffer),C.__webglDepthbuffer=r.createRenderbuffer(),et(C.__webglDepthbuffer,I,!1);t.bindFramebuffer(r.FRAMEBUFFER,null)}function Xe(I,C,K){const ge=n.get(I);C!==void 0&&Ee(ge.__webglFramebuffer,I,I.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),K!==void 0&&Fe(I)}function k(I){const C=I.texture,K=n.get(I),ge=n.get(C);I.addEventListener("dispose",z),I.isWebGLMultipleRenderTargets!==!0&&(ge.__webglTexture===void 0&&(ge.__webglTexture=r.createTexture()),ge.__version=C.version,l.memory.textures++);const pe=I.isWebGLCubeRenderTarget===!0,de=I.isWebGLMultipleRenderTargets===!0,ze=x(I)||c;if(pe){K.__webglFramebuffer=[];for(let we=0;we<6;we++)if(c&&C.mipmaps&&C.mipmaps.length>0){K.__webglFramebuffer[we]=[];for(let De=0;De<C.mipmaps.length;De++)K.__webglFramebuffer[we][De]=r.createFramebuffer()}else K.__webglFramebuffer[we]=r.createFramebuffer()}else{if(c&&C.mipmaps&&C.mipmaps.length>0){K.__webglFramebuffer=[];for(let we=0;we<C.mipmaps.length;we++)K.__webglFramebuffer[we]=r.createFramebuffer()}else K.__webglFramebuffer=r.createFramebuffer();if(de)if(i.drawBuffers){const we=I.texture;for(let De=0,Je=we.length;De<Je;De++){const at=n.get(we[De]);at.__webglTexture===void 0&&(at.__webglTexture=r.createTexture(),l.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(c&&I.samples>0&&ue(I)===!1){const we=de?C:[C];K.__webglMultisampledFramebuffer=r.createFramebuffer(),K.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,K.__webglMultisampledFramebuffer);for(let De=0;De<we.length;De++){const Je=we[De];K.__webglColorRenderbuffer[De]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,K.__webglColorRenderbuffer[De]);const at=s.convert(Je.format,Je.colorSpace),me=s.convert(Je.type),xt=A(Je.internalFormat,at,me,Je.colorSpace,I.isXRRenderTarget===!0),_t=ve(I);r.renderbufferStorageMultisample(r.RENDERBUFFER,_t,xt,I.width,I.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+De,r.RENDERBUFFER,K.__webglColorRenderbuffer[De])}r.bindRenderbuffer(r.RENDERBUFFER,null),I.depthBuffer&&(K.__webglDepthRenderbuffer=r.createRenderbuffer(),et(K.__webglDepthRenderbuffer,I,
3686!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(pe){t.bindTexture(r.TEXTURE_CUBE_MAP,ge.__webglTexture),j(r.TEXTURE_CUBE_MAP,C,ze);for(let we=0;we<6;we++)if(c&&C.mipmaps&&C.mipmaps.length>0)for(let De=0;De<C.mipmaps.length;De++)Ee(K.__webglFramebuffer[we][De],I,C,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+we,De);else Ee(K.__webglFramebuffer[we],I,C,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+we,0);w(C,ze)&&E(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(de){const we=I.texture;for(let De=0,Je=we.length;De<Je;De++){const at=we[De],me=n.get(at);t.bindTexture(r.TEXTURE_2D,me.__webglTexture),j(r.TEXTURE_2D,at,ze),Ee(K.__webglFramebuffer,I,at,r.COLOR_ATTACHMENT0+De,r.TEXTURE_2D,0),w(at,ze)&&E(r.TEXTURE_2D)}t.unbindTexture()}else{let we=r.TEXTURE_2D;if((I.isWebGL3DRenderTarget||I.isWebGLArrayRenderTarget)&&(c?we=I.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(we,ge.__webglTexture),j(we,C,ze),c&&C.mipmaps&&C.mipmaps.length>0)for(let De=0;De<C.mipmaps.length;De++)Ee(K.__webglFramebuffer[De],I,C,r.COLOR_ATTACHMENT0,we,De);else Ee(K.__webglFramebuffer,I,C,r.COLOR_ATTACHMENT0,we,0);w(C,ze)&&E(we),t.unbindTexture()}I.depthBuffer&&Fe(I)}function _e(I){const C=x(I)||c,K=I.isWebGLMultipleRenderTargets===!0?I.texture:[I.texture];for(let ge=0,pe=K.length;ge<pe;ge++){const de=K[ge];if(w(de,C)){const ze=I.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,we=n.get(de).__webglTexture;t.bindTexture(ze,we),E(ze),t.unbindTexture()}}}function he(I){if(c&&I.samples>0&&ue(I)===!1){const C=I.isWebGLMultipleRenderTargets?I.texture:[I.texture],K=I.width,ge=I.height;let pe=r.COLOR_BUFFER_BIT;const de=[],ze=I.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,we=n.get(I),De=I.isWebGLMultipleRenderTargets===!0;if(De)for(let Je=0;Je<C.length;Je++)t.bindFramebuffer(r.FRAMEBUFFER,we.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Je,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,we.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Je,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,we.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,we.__webglFramebuffer);for(let Je=0;Je<C.length;Je++){de.push(r.COLOR_ATTACHMENT0+Je),I.depthBuffer&&de.push(ze);const at=we.__ignoreDepthValues!==void 0?we.__ignoreDepthValues:!1;if(at===!1&&(I.depthBuffer&&(pe|=r.DEPTH_BUFFER_BIT),I.stencilBuffer&&(pe|=r.STENCIL_BUFFER_BIT)),De&&r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,we.__webglColorRenderbuffer[Je]),at===!0&&(r.invali
3686dateFramebuffer(r.READ_FRAMEBUFFER,[ze]),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[ze])),De){const me=n.get(C[Je]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,me,0)}r.blitFramebuffer(0,0,K,ge,0,0,K,ge,pe,r.NEAREST),h&&r.invalidateFramebuffer(r.READ_FRAMEBUFFER,de)}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),De)for(let Je=0;Je<C.length;Je++){t.bindFramebuffer(r.FRAMEBUFFER,we.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Je,r.RENDERBUFFER,we.__webglColorRenderbuffer[Je]);const at=n.get(C[Je]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,we.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Je,r.TEXTURE_2D,at,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,we.__webglMultisampledFramebuffer)}}function ve(I){return Math.min(i.maxSamples,I.samples)}function ue(I){const C=n.get(I);return c&&I.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&C.__useRenderToTexture!==!1}function We(I){const C=l.render.frame;f.get(I)!==C&&(f.set(I,C),I.update())}function Pe(I,C){const K=I.colorSpace,ge=I.format,pe=I.type;return I.isCompressedTexture===!0||I.isVideoTexture===!0||I.format===nu||K!==Vi&&K!==ni&&(Rt.getTransfer(K)===Nt?c===!1?e.has("EXT_sRGB")===!0&&ge===Fn?(I.format=nu,I.minFilter=en,I.generateMipmaps=!1):C=Wd.sRGBToLinear(C):(ge!==Fn||pe!==ki)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",K)),C}this.allocateTextureUnit=V,this.resetTextureUnits=ce,this.setTexture2D=ee,this.setTexture2DArray=le,this.setTexture3D=F,this.setTextureCube=H,this.rebindTextures=Xe,this.setupRenderTarget=k,this.updateRenderTargetMipmap=_e,this.updateMultisampleRenderTarget=he,this.setupDepthRenderbuffer=Fe,this.setupFrameBufferTexture=Ee,this.useMultisampledRTT=ue}function pv(r,e,t){const n=t.isWebGL2;function i(s,l=ni){let c;const u=Rt.getTransfer(l);if(s===ki)return r.UNSIGNED_BYTE;if(s===Nd)return r.UNSIGNED_SHORT_4_4_4_4;if(s===Ud)return r.UNSIGNED_SHORT_5_5_5_1;if(s===D_)return r.BYTE;if(s===N_)return r.SHORT;if(s===cu)return r.UNSIGNED_SHORT;if(s===Dd)return r.INT;if(s===rr)return r.UNSIGNED_INT;if(s===wi)return r.FLOAT;if(s===xo)return n?r.HALF_FLOAT:(c=e.get("OES_texture_half_float"),c!==null?c.HALF_FLOAT_OES:null);if(s===U_)return r.ALPHA;if(s===Fn)return r.RGBA;if(s===O_)return r.LUMINANCE;if(s===F_)return r.LUMINANCE_ALPHA;if(s===Dr)return r.DEPTH_COMPONENT;if(s===ys)return r.DEPTH_STENCIL;if(s===nu)return c=e.get("EXT_sRGB"),c!==null?c.SRGB_ALPHA_EXT:null;if(s===B_)return r.RED;if(s===Od)return r.RED_INTEGER;if(s===z_)return r.RG;if(s===Fd)return r.RG_INTEGER;if(s===Bd)return r.RGBA_INTEGER;if(s===Xc||s===qc||s===Yc||s===Zc)if(u===Nt)if(c=e.get("WEBGL_compressed_texture_s3tc_srgb"),c!==null){if(s===Xc)return c.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===qc)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===Yc)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===Zc)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(c=e.get("WEBGL_compressed_texture_s3tc"),c!==null){if(s===Xc)return c.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===qc)return c.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Yc)return c.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Zc)return c.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Yf||s===Zf||s===Jf||s===jf)if(c=e.get("WEBGL_compressed_texture_pvrtc"),c!==null){if(s===Yf)return c.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Zf)return c.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===Jf)return c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===jf)return c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===zd)return c=e.get("WEBGL_compressed_texture_etc1"),c!==null?c.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===Kf||s===Qf)if(c=e.get("WEBGL_compressed_texture_etc"),c!==null){if(s===Kf)return u===Nt?c.COMPRESSED_SRGB8_ETC2:c.COMPRESSED_RGB8_ETC2;if(s===Qf)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:c.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===$f||s===ed||s===td||s===nd||s===id||s===rd||s===sd||s===od||s===ad||s===ld||s===cd||s===ud||s===hd||s===fd)if(c=e.get("WEBGL_compressed_texture_astc"),c!==null){if(s===$f)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:c.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===ed)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:c.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===td)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:c.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===nd)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:c.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===id)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:c.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===rd)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:c.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===sd)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:c.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===od)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:c.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===ad)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:c.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===ld)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:c.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===cd)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:c.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===ud)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:c.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===hd)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:c.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===fd)return u===Nt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:c.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Jc||s===dd||s===pd)if(c=e.get("EXT_texture_compression_bptc"),c!==null){if(s===Jc)return u===Nt?c.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:c.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===dd)return c.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===pd)return c.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===k_||s===md||s===gd||s===_d)if(c=e.get("EXT_texture_compression_rgtc"),c!==null){if(s===Jc)return c.COMPRESSED_RED_RGT
vendor: 20,474 bytes, line 3686
3686C1_EXT;if(s===md)return c.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===gd)return c.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===_d)return c.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===Ir?n?r.UNSIGNED_INT_24_8:(c=e.get("WEBGL_depth_texture"),c!==null?c.UNSIGNED_INT_24_8_WEBGL:null):r[s]!==void 0?r[s]:null}return{convert:i}}class mv extends vn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class go extends At{constructor(){super(),this.isGroup=!0,this.type="Group"}}const vT={type:"move"};class uf{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new go,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 go,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new U,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new U),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new go,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new U,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new U),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,s=null,l=null;const c=this._targetRay,u=this._grip,h=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(h&&e.hand){l=!0;for(const M of e.hand.values()){const x=t.getJointPose(M,n),v=this._getHandJoint(h,M);x!==null&&(v.matrix.fromArray(x.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=x.radius),v.visible=x!==null}const f=h.joints["index-finger-tip"],p=h.joints["thumb-tip"],m=f.position.distanceTo(p.position),g=.02,y=.005;h.inputState.pinching&&m>g+y?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!h.inputState.pinching&&m<=g-y&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));c!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(c.matrix.fromArray(i.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,i.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(i.linearVelocity)):c.hasLinearVelocity=!1,i.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(i.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(vT)))}return c!==null&&(c.visible=i!==null),u!==null&&(u.visible=s!==null),h!==null&&(h.visible=l!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new go;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class yT extends ur{constructor(e,t){super();const n=this;let i=null,s=1,l=null,c="local-floor",u=1,h=null,f=null,p=null,m=null,g=null,y=null;const M=t.getContextAttributes();let x=null,v=null;const w=[],E=[],A=new fe;let N=null;const R=new vn;R.layers.enable(1),R.viewport=new Pt;const L=new vn;L.layers.enable(2),L.viewport=new Pt;const z=[R,L],b=new mv;b.layers.enable(1),b.layers.enable(2);let P=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(j){let ae=w[j];return ae===void 0&&(ae=new uf,w[j]=ae),ae.getTargetRaySpace()},this.getControllerGrip=function(j){let ae=w[j];return ae===void 0&&(ae=new uf,w[j]=ae),ae.getGripSpace()},this.getHand=function(j){let ae=w[j];return ae===void 0&&(ae=new uf,w[j]=ae),ae.getHandSpace()};function Q(j){const ae=E.indexOf(j.inputSource);if(ae===-1)return;const xe=w[ae];xe!==void 0&&(xe.update(j.inputSource,j.frame,h||l),xe.dispatchEvent({type:j.type,data:j.inputSource}))}function ce(){i.removeEventListener("select",Q),i.removeEventListener("selectstart",Q),i.removeEventListener("selectend",Q),i.removeEventListener("squeeze",Q),i.removeEventListener("squeezestart",Q),i.removeEventListener("squeezeend",Q),i.removeEventListener("end",ce),i.removeEventListener("inputsourceschange",V);for(let j=0;j<w.length;j++){const ae=E[j];ae!==null&&(E[j]=null,w[j].disconnect(ae))}P=null,B=null,e.setRenderTarget(x),g=null,m=null,p=null,i=null,v=null,oe.stop(),n.isPresenting=!1,e.setPixelRatio(N),e.setSize(A.width,A.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(j){s=j,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(j){c=j,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return h||l},this.setReferenceSpace=function(j){h=j},this.getBaseLayer=function(){return m!==null?m:g},this.getBinding=function(){return p},this.getFrame=function(){return y},this.getSession=function(){return i},this.setSession=async function(j){if(i=j,i!==null){if(x=e.getRenderTarget(),i.addEventListener("select",Q),i.addEventListener("selectstart",Q),i.addEventListener("selectend",Q),i.addEventListener("squeeze",Q),i.addEventListener("squeezestart",Q),i.addEventListener("squeezeend",Q),i.addEventListener("end",ce),i.addEventListener("inputsourceschange",V),M.xrCompatible!==!0&&await t.makeXRCompatible(),N=e.getPixelRatio(),e.getSize(A),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const ae={antialias:i.renderState.layers===void 0?M.antialias:!0,alpha:!0,depth:M.depth,stencil:M.stencil,framebufferScaleFactor:s};g=new XRWebGLLayer(i,t,ae),i.updateRenderState({baseLayer:g}),e.setPixelRatio(1),e.setSize(g.framebufferWidth,g.framebufferHeight,!1),v=new Ai(g.framebufferWidth,g.framebufferHeight,{format:Fn,type:ki,colorSpace:e.outputColorSpace,stencilBuffer:M.stencil})}else{let ae=null,xe=null,Te=null;M.depth&&(Te=M.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ae=M.stencil?ys:Dr,xe=M.stencil?Ir:rr);const Ee={colorFormat:t.RGBA8,depthFormat:Te,scaleFactor:s};p=new XRWebGLBinding(i,t),m=p.createProjectionLayer(Ee),i.updateRenderState({layers:[m]}),e.setPixelRatio(1),e.setSize(m.textureWidth,m.textureHeight,!1),v=new Ai(m.textureWidth,m.textureHeight,{format:Fn,type:ki,depthTexture:new Jd(m.textureWidth,m.textureHeight,xe,void 0,void 0,void 0,void 0,void 0,void 0,ae),stencilBuffer:M.stencil,colorSpace:e.outputColorSpace,samples:M.antialias?4:0});const et=e.properties.get(v);et.__ignoreDepthValues=m.ignoreDepthValues}v.isXRRenderTarget=!0,this.setFoveation(u),h=null,l=await i.requestReferenceSpace(c),oe.setContext(i),oe.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function V(j){for(let ae=0;ae<j.removed.length;ae++){const xe=j.removed[ae],Te=E.indexOf(xe);Te>=0&&(E[Te]=null,w[Te].disconnect(xe))}for(let ae=0;ae<j.added.length;ae++){const xe=j.added[ae];let Te=E.indexOf(xe);if(Te===-1){for(let et=0;et<w.length;et++)if(et>=E.length){E.push(xe),Te=et;break}else if(E[et]===null){E[et]=xe,Te=et;break}if(Te===-1)break}const Ee=w[Te];Ee&&Ee.connect(xe)}}const J=new U,ee=new U;function le(j,ae,xe){J.setFromMatrixPosition(ae.matrixWorld),ee.setFromMatrixPosition(xe.matrixWorld);const Te=J.distanceTo(ee),Ee=ae.projectionMatrix.elements,et=xe.projectionMatrix.elements,nt=Ee[14]/(Ee[10]-1),Fe=Ee[14]/(Ee[10]+1),Xe=(Ee[9]+1)/Ee[5],k=(Ee[9]-1)/Ee[5],_e=(Ee[8]-1)/Ee[0],he=(et[8]+1)/et[0],ve=nt*_e,ue=nt*he,We=Te/(-_e+he),Pe=We*-_e;ae.matrixWorld.decompose(j.position,j.quaternion,j.scale),j.translateX(Pe),j.translateZ(We),j.matrixWorld.compose(j.position,j.quaternion,j.scale),j.matrixWorldInverse.copy(j.matrixWorld).invert();const I=nt+We,C=Fe+We,K=ve-Pe,ge=ue+(Te-Pe),pe=Xe*Fe/C*I,de=k*Fe/C*I;j.projectionMatrix.makePerspective(K,ge,pe,de,I,C),j.projectionMatrixInverse.copy(j.projectionMatrix).invert()}function F(j,ae){ae===null?j.matrixWorld.copy(j.matrix):j.matrixWorld.multiplyMatrices(ae.matrixWorld,j.matrix),j.matrixWorldInverse.copy(j.matrixWorld).invert()}this.updateCamera=function(j){if(i===null)return;b.near=L.near=R.near=j.near,b.far=L.far=R.far=j.far,(P!==b.near||B!==b.far)&&(i.updateRenderState({depthNear:b.near,depthFar:b.far}),P=b.near,B=b.far);const ae=j.parent,xe=b.cameras;F(b,ae);for(let Te=0;Te<xe.length;Te++)F(xe[Te],ae);xe.length===2?le(b,R,L):b.projectionMatrix.copy(R.projectionMatrix),H(j,b,ae)};function H(j,ae,xe){xe===null?j.matrix.copy(ae.matrixWorld):(j.matrix.copy(xe.matrixWorld),j.matrix.invert(),j.matrix.multiply(ae.matrixWorld)),j.matrix.decompose(j.position,j.quaternion,j.scale),j.updateMatrixWorld(!0),j.projectionMatrix.copy(ae.projectionMatrix),j.projectionMatrixInverse.copy(ae.projectionMatrixInverse),j.isPerspectiveCamera&&(j.fov=Mo*2*Math.atan(1/j.projectionMatrix.elements[5]),j.zoom=1)}this.getCamera=function(){return b},this.getFoveation=function(){if(!(m===null&&g===null))return u},this.setFoveation=function(j){u=j,m!==null&&(m.fixedFoveation=j),g!==null&&g.fixedFoveation!==void 0&&(g.fixedFoveation=j)};let W=null;function Y(j,ae){if(f=ae.getViewerPose(h||l),y=ae,f!==null){const xe=f.views;g!==null&&(e.setRenderTargetFramebuffer(v,g.framebuffer),e.setRenderTarget(v));let Te=!1;xe.length!==b.cameras.length&&(b.cameras.length=0,Te=!0);for(let Ee=0;Ee<xe.length;Ee++){const et=xe[Ee];let nt=null;if(g!==null)nt=g.getViewport(et);else{const Xe=p.getViewSubImage(m,et);nt=Xe.viewport,Ee===0&&(e.setRenderTargetTextures(v,Xe.colorTexture,m.ignoreDepthValues?void 0:Xe.depthStencilTexture),e.setRenderTarget(v))}let Fe=z[Ee];Fe===void 0&&(Fe=new vn,Fe.layers.enable(Ee),Fe.viewport=new Pt,z[Ee]=Fe),Fe.matrix.fromArray(et.transform.matrix),Fe.matrix.decompose(Fe.position,Fe.quaternion,Fe.scale),Fe.projectionMatrix.fromArray(et.projectionMatrix),Fe.projectionMatrixInverse.copy(Fe.projectionMatrix).invert(),Fe.viewport.set(nt.x,nt.y,nt.width,nt.height),Ee===0&&(b.matrix.copy(Fe.matrix),b.matrix.decompose(b.position,b.quaternion,b.scale)),Te===!0&&b.cameras.push(Fe)}}for(let xe=0;xe<w.length;xe++){const Te=E[xe],Ee=w[xe];Te!==null&&Ee!==void 0&&Ee.update(Te,ae,h||l)}W&&W(j,ae),ae.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ae}),y=null}const oe=new lv;oe.setAnimationLoop(Y),this.setAnimationLoop=function(j){W=j},this.dispose=function(){}}}function xT(r,e){function t(x,v){x.matrixAutoUpdate===!0&&x.updateMatrix(),v.value.copy(x.matrix)}function n(x,v){v.color.getRGB(x.fogColor.value,rv(r)),v.isFog?(x.fogNear.value=v.near,x.fogFar.value=v.far):v.isFogExp2&&(x.fogDensity.value=v.density)}function i(x,v,w,E,A){v.isMeshBasicMaterial||v.isMeshLambertMaterial?s(x,v):v.isMeshToonMaterial?(s(x,v),p(x,v)):v.isMeshPhongMaterial?(s(x,v),f(x,v)):v.isMeshStandardMaterial?(s(x,v),m(x,v),v.isMeshPhysicalMaterial&&g(x,v,A)):v.isMeshMatcapMaterial?(s(x,v),y(x,v)):v.isMeshDepthMaterial?s(x,v):v.isMeshDistanceMaterial?(s(x,v),M(x,v)):v.isMeshNormalMaterial?s(x,v):v.isLineBasicMaterial?(l(x,v),v.isLineDashedMaterial&&c(x,v)):v.isPointsMaterial?u(x,v,w,E):v.isSpriteMaterial?h(x,v):v.isShadowMaterial?(x.color.value.copy(v.color),x.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function s(x,v){x.opacity.value=v.opacity,v.color&&x.diffuse.value.copy(v.color),v.emissive&&x.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(x.map.value=v.map,t(v.map,x.mapTransform)),v.alphaMap&&(x.alphaMap.value=v.alphaMap,t(v.alphaMap,x.alphaMapTransform)),v.bumpMap&&(x.bumpMap.value=v.bumpMap,t(v.bumpMap,x.bumpMapTransform),x.bumpScale.value=v.bumpScale,v.side===Bn&&(x.bumpScale.value*=-1)),v.normalMap&&(x.normalMap.value=v.normalMap,t(v.normalMap,x.normalMapTransform),x.normalScale.value.copy(v.normalScale),v.side===Bn&&x.normalScale.value.negate()),v.displacementMap&&(x.displacementMap.value=v.displacementMap,t(v.displacementMap,x.displacementMapTransform),x.displacementScale.value=v.displacementScale,x.displacementBias.value=v.displacementBias),v.emissiveMap&&(x.emissiveMap.value=v.emissiveMap,t(v.emissiveMap,x.emissiveMapTransform)),v.specularMap&&(x.specularMap.value=v.specularMap,t(v.specularMap,x.specularMapTransform)),v.alphaTest>0&&(x.alphaTest.value=v.alphaTest);const w=e.get(v).envMap;if(w&&(x.envMap.value=w,x.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=v.reflectivity,x.ior.value=v.ior,x.refractionRatio.value=v.refractionRatio),v.lightMap){x.lightMap.value=v.lightMap;const E=r._useLegacyLights===!0?Math.PI:1;x.lightMapIntensity.value=v.lightMapIntensity*E,t(v.lightMap,x.lightMapTransform)}v.aoMap&&(x.aoMap.value=v.aoMap,x.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,x.aoMapTransform))}function l(x,v){x.diffuse.value.copy(v.color),x.opacity.value=v.opacity,v.map&&(x.map.value=v.map,t(v.map,x.mapTransform))}function c(x,v){x.dashSize.value=v.dashSize,x.totalSize.value=v.dashSize+v.gapSize,x.scale.value=v.scale}function u(x,v,w,E){x.diffuse.value.copy(v.color),x.opacity.value=v.opacity,x.size.value=v.size*w,x.scale.value=E*.5,v.map&&(x.map.value=v.map,t(v.map,x.uvTransform)),v.alphaMap&&(x.alphaMap.value=v.alphaMap,t(v.alphaMap,x.alphaMapTransform)),v.alphaTest>0&&(x.alphaTest.value=v.alphaTest)}function h(x,v){x.diffuse.value.copy(v.color),x.opacity.value=v.opacity,x.rotation.value=v.rotation,v.map&&(x.map.value=v.map,t(v.map,x.mapTransform)),v.alphaMap&&(x.alphaMap.value=v.alphaMap,t(v.alphaMap,x.alphaMapTransform)),v.alphaTest>0&&(x.alphaTest.value=v.alphaTest)}function f(x,v){x.specular.value.copy(v.specular),x.shininess.value=Math.max(v.shininess,1e-4)}function p(x,v){v.gradientMap&&(x.gradientMap.value=v.gradientMap)}function m(x,v){x.metalness.value=v.metalness,v.metalnessMap&&(x.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,x.metalnessMapTransform)),x.roughness.value=v.roughness,v.roughnessMap&&(x.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,x.roughnessMapTransform)),e.get(v).envMap&&(x.envMapIntensity.value=v.envMapIntensity)}function g(x,v,w){x.ior.value=v.ior,v.sheen>0&&(x.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),x.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(x.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,x.sheenColorMapTransform)),v.sheenRoughnessMap&&(x.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,x.sheenRoughnessMapTransform))),v.clearcoat>0&&(x.clearcoat.value=v.clearcoat,x.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(x.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,x.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(x.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===Bn&&x.clearcoatNormalScale.value.negate())),v.iridescence>0&&(x.iridescence.value=v.iridescence,x.iridescenceIOR.value=v.iridescenceIOR,x.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(x.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,x.iridescenceMapTransform)),v.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),v.transmission>0&&(x.transmission.value=v.transmission,x.transmissionSamplerMap.value=w.texture,x.transmissionSamplerSize.value.set(w.width,w.height),v.transmissionMap&&(x.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,x.transmissionMapTransform)),x.thickness.value=v.thickness,v.thicknessMap&&(x.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=v.attenuationDistance,x.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(x.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(x.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=v.specularIntensity,x.specularColor.value.copy(v.specularColor),v.specularColorMap&&(x.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,x.specularColorMapTransform)),v.specularIntensityMap&&(x.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,x.specularIntensityMapTransform))}function y(x,v){v.matcap&&(x.matcap.value=v.matcap)}function M(x,v){const w=e.get(v).light;x.referencePosition.value.setFromMatrixPosition(w.matrixWorld),x.nearDistance.value=w.shadow.camera.near,x.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function ST(r,e,t,n){let i={},s={},l=[];const c=t.isWebGL2?r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS):0;function u(w,E){const A=E.program;n.uniformBlockBinding(w,A)}function h(w,E){let A=i[w.id];A===void 0&&(y(w),A=f(w),i[w.id]=A,w.addEventListener("dispose",x));const N=E.program;n.updateUBOMapping(w,N);const R=e.render.frame;s[w.id]!==R&&(m(w),s[w.id]=R)}function f(w){const E=p();w.__bindingPointIndex=E;const A=r.createBuffer(),N=w.__size,R=w.usage;return r.bindBuffer(r.UNIFORM_BUFFER,A),r.bufferData(r.UNIFORM_BUFFER,N,R),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,E,A),A}function p(){for(let w=0;w<c;w++)if(l.indexOf(w)===-1)return l.push(w),w;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function m(w){const E=i[w.id],A=w.uniforms,N=w.__cache;r.bindBuffer(r.UNIFORM_BUFFER,E);for(let R=0,L=A.length;R<L;R++){const z=Array.isArray(A[R])?A[R]:[A[R]];for(let b=0,P=z.length;b<P;b++){const B=z[b];if(g(B,R,b,N)===!0){const Q=B.__offset,ce=Array.isArray(B.value)?B.value:[B.value];let V=0;for(let J=0;J<ce.length;J++){const ee=ce[J],le=M(ee);typeof ee=="number"||typeof ee=="boolean"?(B.__data[0]=ee,r.bufferSubData(r.UNIFORM_BUFFER,Q+V,B.__data)):ee.isMatrix3?(B.__data[0]=ee.elements[0],B.__data[1]=ee.elements[1],B.__data[2]=ee.elements[2],B.__data[3]=0,B.__data[4]=ee.elements[3],B.__data[5]=ee.elements[4],B.__data[6]=ee.elements[5],B.__data[7]=0,B.__data[8]=ee.elements[6],B.__data[9]=ee.elements[7],B.__data[10]=ee.elements[8],B.__data[11]=0):(ee.toArray(B.__data,V),V+=le.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,Q,B.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function g(w,E,A,N){const R=w.value,L=E+"_"+A;if(N[L]===void 0)return typeof R=="number"||typeof R=="boolean"?N[L]=R:N[L]=R.clone(),!0;{const z=N[L];if(typeof R=="number"||typeof R=="boolean"){if(z!==R)return N[L]=R,!0}else if(z.equals(R)===!1)return z.copy(R),!0}return!1}function y(w){const E=w.uniforms;let A=0;const N=16;for(let L=0,z=E.length;L<z;L++){const b=Array.isArray(E[L])?E[L]:[E[L]];for(let P=0,B=b.length;P<B;P++){const Q=b[P],ce=Array.isArray(Q.value)?Q.value:[Q.value];for(let V=0,J=ce.length;V<J;V++){const ee=ce[V],le=M(ee),F=A%N;F!==0&&N-F<le.boundary&&(A+=N-F),Q.__data=new Float32Array(le.storage/Float32Array.BYTES_PER_ELEMENT),Q.__offset=A,A+=le.storage}}}const R=A%N;return R>0&&(A+=N-R),w.__size=A,w.__cache={},this}function M(w){const E={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(E.boundary=4,E.storage=4):w.isVector2?(E.boundary=8,E.storage=8):w.isVector3||w.isColor?(E.boundary=16,E.storage=12):w.isVector4?(E.boundary=16,E.storage=16):w.isMatrix3?(E.boundary=48,E.storage=48):w.isMatrix4?(E.boundary=64,E.storage=64):w.isTexture?c
3686onsole.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),E}function x(w){const E=w.target;E.removeEventListener("dispose",x);const A=l.indexOf(E.__bindingPointIndex);l.splice(A,1),r.deleteBuffer(i[E.id]),delete i[E.id],delete s[E.id]}function v(){for(const w in i)r.deleteBuffer(i[w]);l=[],i={},s={}}return{bind:u,update:h,dispose:v}}class Qd{constructor(e={}){const{canvas:t=tv(),context:n=null,depth:i=!0,stencil:s=!0,alpha:l=!1,antialias:c=!1,premultipliedAlpha:u=!0,preserveDrawingBuffer:h=!1,powerPreference:f="default",failIfMajorPerformanceCaveat:p=!1}=e;this.isWebGLRenderer=!0;let m;n!==null?m=n.getContextAttributes().alpha:m=l;const g=new Uint32Array(4),y=new Int32Array(4);let M=null,x=null;const v=[],w=[];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._outputColorSpace=an,this._useLegacyLights=!1,this.toneMapping=zi,this.toneMappingExposure=1;const E=this;let A=!1,N=0,R=0,L=null,z=-1,b=null;const P=new Pt,B=new Pt;let Q=null;const ce=new Ie(0);let V=0,J=t.width,ee=t.height,le=1,F=null,H=null;const W=new Pt(0,0,J,ee),Y=new Pt(0,0,J,ee);let oe=!1;const j=new qa;let ae=!1,xe=!1,Te=null;const Ee=new tt,et=new fe,nt=new U,Fe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Xe(){return L===null?le:1}let k=n;function _e(D,Z){for(let ne=0;ne<D.length;ne++){const ie=D[ne],te=t.getContext(ie,Z);if(te!==null)return te}return null}try{const D={alpha:!0,depth:i,stencil:s,antialias:c,premultipliedAlpha:u,preserveDrawingBuffer:h,powerPreference:f,failIfMajorPerformanceCaveat:p};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${ou}`),t.addEventListener("webglcontextlost",Se,!1),t.addEventListener("webglcontextrestored",G,!1),t.addEventListener("webglcontextcreationerror",Ae,!1),k===null){const Z=["webgl2","webgl","experimental-webgl"];if(E.isWebGL1Renderer===!0&&Z.shift(),k=_e(Z,D),k===null)throw _e(Z)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext<"u"&&k instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),k.getShaderPrecisionFormat===void 0&&(k.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(D){throw console.error("THREE.WebGLRenderer: "+D.message),D}let he,ve,ue,We,Pe,I,C,K,ge,pe,de,ze,we,De,Je,at,me,xt,_t,rt,qe,Oe,ut,Mt;function Ft(){he=new Uw(k),ve=new Rw(k,he,e),he.init(ve),Oe=new pv(k,he,ve),ue=new gT(k,he,ve),We=new Bw(k),Pe=new rT,I=new _T(k,he,ue,Pe,ve,Oe,We),C=new Lw(E),K=new Nw(E),ge=new qS(k,ve),ut=new bw(k,he,ge,ve),pe=new Ow(k,ge,We,ut),de=new Vw(k,pe,ge,We),_t=new Hw(k,ve,I),at=new Pw(Pe),ze=new iT(E,C,K,he,ve,ut,at),we=new xT(E,Pe),De=new oT,Je=new fT(he,ve),xt=new Aw(E,C,K,ue,de,m,u),me=new mT(E,de,ve),Mt=new ST(k,We,ve,ue),rt=new Cw(k,he,We,ve),qe=new Fw(k,he,We,ve),We.programs=ze.programs,E.capabilities=ve,E.extensions=he,E.properties=Pe,E.renderLists=De,E.shadowMap=me,E.state=ue,E.info=We}Ft();const pt=new yT(E,k);this.xr=pt,this.getContext=function(){return k},this.getContextAttributes=function(){return k.getContextAttributes()},this.forceContextLoss=function(){const D=he.get("WEBGL_lose_context");D&&D.loseContext()},this.forceContextRestore=function(){const D=he.get("WEBGL_lose_context");D&&D.restoreContext()},this.getPixelRatio=function(){return le},this.setPixelRatio=function(D){D!==void 0&&(le=D,this.setSize(J,ee,!1))},this.getSize=function(D){return D.set(J,ee)},this.setSize=function(D,Z,ne=!0){if(pt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}J=D,ee=Z,t.width=Math.floor(D*le),t.height=Math.floor(Z*le),ne===!0&&(t.style.width=D+"px",t.style.height=Z+"px"),this.setViewport(0,0,D,Z)},this.getDrawingBufferSize=function(D){return D.set(J*le,ee*le).floor()},this.setDrawingBufferSize=function(D,Z,ne){J=D,ee=Z,le=ne,t.width=Math.floor(D*ne),t.height=Math.floor(Z*ne),this.setViewport(0,0,D,Z)},this.getCurrentViewport=function(D){return D.copy(P)},this.getViewport=function(D){return D.copy(W)},this.setViewport=function(D,Z,ne,ie){D.isVector4?W.set(D.x,D.y,D.z,D.w):W.set(D,Z,ne,ie),ue.viewport(P.copy(W).multiplyScalar(le).floor())}
vendor: 7,436 bytes, line 3686
3686,this.getScissor=function(D){return D.copy(Y)},this.setScissor=function(D,Z,ne,ie){D.isVector4?Y.set(D.x,D.y,D.z,D.w):Y.set(D,Z,ne,ie),ue.scissor(B.copy(Y).multiplyScalar(le).floor())},this.getScissorTest=function(){return oe},this.setScissorTest=function(D){ue.setScissorTest(oe=D)},this.setOpaqueSort=function(D){F=D},this.setTransparentSort=function(D){H=D},this.getClearColor=function(D){return D.copy(xt.getClearColor())},this.setClearColor=function(){xt.setClearColor.apply(xt,arguments)},this.getClearAlpha=function(){return xt.getClearAlpha()},this.setClearAlpha=function(){xt.setClearAlpha.apply(xt,arguments)},this.clear=function(D=!0,Z=!0,ne=!0){let ie=0;if(D){let te=!1;if(L!==null){const Le=L.texture.format;te=Le===Bd||Le===Fd||Le===Od}if(te){const Le=L.texture.type,Ve=Le===ki||Le===rr||Le===cu||Le===Ir||Le===Nd||Le===Ud,je=xt.getClearColor(),Qe=xt.getClearAlpha(),st=je.r,it=je.g,ot=je.b;Ve?(g[0]=st,g[1]=it,g[2]=ot,g[3]=Qe,k.clearBufferuiv(k.COLOR,0,g)):(y[0]=st,y[1]=it,y[2]=ot,y[3]=Qe,k.clearBufferiv(k.COLOR,0,y))}else ie|=k.COLOR_BUFFER_BIT}Z&&(ie|=k.DEPTH_BUFFER_BIT),ne&&(ie|=k.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),k.clear(ie)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Se,!1),t.removeEventListener("webglcontextrestored",G,!1),t.removeEventListener("webglcontextcreationerror",Ae,!1),De.dispose(),Je.dispose(),Pe.dispose(),C.dispose(),K.dispose(),de.dispose(),ut.dispose(),Mt.dispose(),ze.dispose(),pt.dispose(),pt.removeEventListener("sessionstart",hn),pt.removeEventListener("sessionend",It),Te&&(Te.dispose(),Te=null),yn.stop()};function Se(D){D.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),A=!0}function G(){console.log("THREE.WebGLRenderer: Context Restored."),A=!1;const D=We.autoReset,Z=me.enabled,ne=me.autoUpdate,ie=me.needsUpdate,te=me.type;Ft(),We.autoReset=D,me.enabled=Z,me.autoUpdate=ne,me.needsUpdate=ie,me.type=te}function Ae(D){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",D.statusMessage)}function be(D){const Z=D.target;Z.removeEventListener("dispose",be),Ke(Z)}function Ke(D){Ye(D),Pe.remove(D)}function Ye(D){const Z=Pe.get(D).programs;Z!==void 0&&(Z.forEach(function(ne){ze.releaseProgram(ne)}),D.isShaderMaterial&&ze.releaseShaderCache(D))}this.renderBufferDirect=function(D,Z,ne,ie,te,Le){Z===null&&(Z=Fe);const Ve=te.isMesh&&te.matrixWorld.determinant()<0,je=Nu(D,Z,ne,ie,te);ue.setMaterial(ie,Ve);let Qe=ne.index,st=1;if(ie.wireframe===!0){if(Qe=pe.getWireframeAttribute(ne),Qe===void 0)return;st=2}const it=ne.drawRange,ot=ne.attributes.position;let kt=it.start*st,xn=(it.start+it.count)*st;Le!==null&&(kt=Math.max(kt,Le.start*st),xn=Math.min(xn,(Le.start+Le.count)*st)),Qe!==null?(kt=Math.max(kt,0),xn=Math.min(xn,Qe.count)):ot!=null&&(kt=Math.max(kt,0),xn=Math.min(xn,ot.count));const Ut=xn-kt;if(Ut<0||Ut===1/0)return;ut.setup(te,ie,je,ne,Qe);let fn,$e=rt;if(Qe!==null&&(fn=ge.get(Qe),$e=qe,$e.setIndex(fn)),te.isMesh)ie.wireframe===!0?(ue.setLineWidth(ie.wireframeLinewidth*Xe()),$e.setMode(k.LINES)):$e.setMode(k.TRIANGLES);else if(te.isLine){let Ne=ie.linewidth;Ne===void 0&&(Ne=1),ue.setLineWidth(Ne*Xe()),te.isLineSegments?$e.setMode(k.LINES):te.isLineLoop?$e.setMode(k.LINE_LOOP):$e.setMode(k.LINE_STRIP)}else te.isPoints?$e.setMode(k.POINTS):te.isSprite&&$e.setMode(k.TRIANGLES);if(te.isBatchedMesh)$e.renderMultiDraw(te._multiDrawStarts,te._multiDrawCounts,te._multiDrawCount);else if(te.isInstancedMesh)$e.renderInstances(kt,Ut,te.count);else if(ne.isInstancedBufferGeometry){const Ne=ne._maxInstanceCount!==void 0?ne._maxInstanceCount:1/0,si=Math.min(ne.instanceCount,Ne);$e.renderInstances(kt,Ut,si)}else $e.render(kt,Ut)};function Lt(D,Z,ne){D.transparent===!0&&D.side===Bi&&D.forceSinglePass===!1?(D.side=Bn,D.needsUpdate=!0,As(D,Z,ne),D.side=ar,D.needsUpdate=!0,As(D,Z,ne),D.side=Bi):As(D,Z,ne)}this.compile=function(D,Z,ne=null){ne===null&&(ne=D),x=Je.get(ne),x.init(),w.push(x),ne.traverseVisible(function(te){te.isLight&&te.layers.test(Z.layers)&&(x.pushLight(te),te.castShadow&&x.pushShadow(te))}),D!==ne&&D.traverseVisible(function(te){te.isLight&&te.layers.test(Z.layers)&&(x.pushLight(te),te.castShadow&&x.pushShadow(te))}),x.setupLights(E._useLegacyLights);const ie=new Set;return D.traverse(function(te){const Le=te.material;if(Le)if(Array.isArray(Le))for(let Ve=0;Ve<Le.length;Ve++){const je=Le[Ve];Lt(je,ne,te),ie.add(je)}else Lt(Le,ne,te),ie.add(Le)}),w.pop(),x=null,ie},this.compileAsync=function(D,Z,ne=null){const ie=this.compile(D,Z,ne);return new Promise(te=>{function Le(){if(ie.forEach(function(Ve){Pe.get(Ve).currentProgram.isReady()&&ie.delete(Ve)}),ie.size===0){te(D);return}setTimeout(Le,10)}he.get("KHR_parallel_shader_compile")!==null?Le():setTimeout(Le,10)})};let Ct=null;function Yt(D){Ct&&Ct(D)}function hn(){yn.stop()}function It(){yn.start()}const yn=new lv;yn.setAnimationLoop(Yt),typeof self<"u"&&yn.setContext(self),this.setAnimationLoop=function(D){Ct=D,pt.setAnimationLoop(D),D===null?yn.stop():yn.start()},pt.addEventListener("sessionstart",hn),pt.addEventListener("sessionend",It),this.render=function(D,Z){if(Z!==void 0&&Z.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(A===!0)return;D.matrixWorldAutoUpdate===!0&&D.updateMatrixWorld(),Z.parent===null&&Z.matrixWorldAutoUpdate===!0&&Z.updateMatrixWorld(),pt.enabled===!0&&pt.isPresenting===!0&&(pt.cameraAutoUpdate===!0&&pt.updateCamera(Z),Z=pt.getCamera()),D.isScene===!0&&D.onBeforeRender(E,D,Z,L),x=Je.get(D,w.length),x.init(),w.push(x),Ee.multiplyMatrices(Z.projectionMatrix,Z.matrixWorldInverse),j.setFromProjectionMatrix(Ee),xe=this.localClippingEnabled,ae=at.init(this.clippingPlanes,xe),M=De.get(D,v.length),M.init(),v.push(M),ri(D,Z,0,E.sortObjects),M.finish(),E.sortObjects===!0&&M.sort(F,H),this.info.render.frame++,ae===!0&&at.beginShadows();const ne=x.state.shadowsArray;if(me.render(ne,D,Z),ae===!0&&at.endShadows(),this.info.autoReset===!0&&this.info.reset(),xt.render(M,D),x.setupLights(E._useLegacyLights),Z.isArrayCamera){const ie=Z.cameras;for(let te=0,Le=ie.length;te<Le;te++){const Ve=ie[te];Lo(M,D,Ve,Ve.viewport)}}else Lo(M,D,Z);L!==null&&(I.updateMultisampleRenderTarget(L),I.updateRenderTargetMipmap(L)),D.isScene===!0&&D.onAfterRender(E,D,Z),ut.resetDefaultState(),z=-1,b=null,w.pop(),w.length>0?x=w[w.length-1]:x=null,v.pop(),v.length>0?M=v[v.length-1]:M=null};function ri(D,Z,ne,ie){if(D.visible===!1)return;if(D.layers.test(Z.layers)){if(D.isGroup)ne=D.renderOrder;else if(D.isLOD)D.autoUpdate===!0&&D.update(Z);else if(D.isLight)x.pushLight(D),D.castShadow&&x.pushShadow(D);else if(D.isSprite){if(!D.frustumCulled||j.intersectsSprite(D)){ie&&nt.setFromMatrixPosition(D.matrixWorld).applyMatrix4(Ee);const Ve=de.update(D),je=D.material;je.visible&&M.push(D,Ve,je,ne,nt.z,null)}}else if((D.isMesh||D.isLine||D.isPoints)&&(!D.frustumCulled||j.intersectsObject(D))){const Ve=de.update(D),je=D.material;if(ie&&(D.boundingSphere!==void 0?(D.boundingSphere===null&&D.computeBoundingSphere(),nt.copy(D.boundingSphere.center)):(Ve.boundingSphere===null&&Ve.computeBoundingSphere(),nt.copy(Ve.boundingSphere.center)),nt.applyMatrix4(D.matrixWorld).applyMatrix4(Ee)),Array.isArray(je)){const Qe=Ve.groups;for(let st=0,it=Qe.length;
3686st<it;st++){const ot=Qe[st],kt=je[ot.materialIndex];kt&&kt.visible&&M.push(D,Ve,kt,ne,nt.z,ot)}}else je.visible&&M.push(D,Ve,je,ne,nt.z,null)}}const Le=D.children;for(let Ve=0,je=Le.length;Ve<je;Ve++)ri(Le[Ve],Z,ne,ie)}function Lo(D,Z,ne,ie){const te=D.opaque,Le=D.transmissive,Ve=D.transparent;x.setupLightsView(ne),ae===!0&&at.setGlobalState(E.clippingPlanes,ne),Le.length>0&&Io(te,Le,Z,ne),ie&&ue.viewport(P.copy(ie)),te.length>0&&Ts(te,Z,ne),Le.length>0&&Ts(Le,Z,ne),Ve.length>0&&Ts(Ve,Z,ne),ue.buffers.depth.setTest(!0),ue.buffers.depth.setMask(!0),ue.buffers.color.setMask(!0),ue.setPolygonOffset(!1)}function Io(D,Z,ne,ie){if((ne.isScene===!0?ne.overrideMaterial:null)!==null)return;const Le=ve.isWebGL2;Te===null&&(Te=new Ai(1,1,{generateMipmaps:!0,type:he.has("EXT_color_buffer_half_float")?xo:ki,minFilter:Or,samples:Le?4:0})),E.getDrawingBufferSize(et),Le?Te.setSize(et.x,et.y):Te.setSize(iu(et.x),iu(et.y));const Ve=E.getRenderTarget();E.setRenderTarget(Te),E.getClearColor(ce),V=E.getClearAlpha(),V<1&&E.setClearColor(16777215,.5),E.clear();const je=E.toneMapping;E.toneMapping=zi,Ts(D,ne,ie),I.updateMultisampleRenderTarget(Te),I.updateRenderTargetMipmap(Te);let Qe=!1;for(let st=0,it=Z.length;st<it;st++){const ot=Z[st],kt=ot.object,xn=ot.geometry,Ut=ot.material,fn=ot.group;if(Ut.side===Bi&&kt.layers.test(ie.layers)){const $e=Ut.side;Ut.side=Bn,Ut.needsUpdate=!0,hr(kt,ne,ie,xn,Ut,fn),Ut.side=$e,Ut.needsUpdate=!0,Qe=!0}}Qe===!0&&(I.updateMultisampleRenderTarget(Te),I.updateRenderTargetMipmap(Te)),E.setRenderTarget(Ve),E.setClearColor(ce,V),E.toneMapping=je}function Ts(D,Z,ne){const ie=Z.isScene===!0?Z.overrideMaterial:null;for(let te=0,Le=D.length;te<Le;te++){const Ve=D[te],je=Ve.object,Qe=Ve.geometry,st=ie===null?Ve.material:ie,it=Ve.group;je.layers.test(ne.layers)&&hr(je,Z,ne,Qe,st,it)}}function hr(D,Z,ne,ie,te,Le){D.onBeforeRender(E,Z,ne,ie,te,Le),D.modelViewMatrix.multiplyMatrices(ne.matrixWorldInverse,D.matrixWorld),D.normalMatrix.getNormalMatrix(D.modelViewMatrix),te.onBeforeRender(E,Z,ne,ie,D,Le),te.transparent===!0&&te.side===Bi&&te.forceSinglePass===!1?(te.side=Bn,te.needsUpdate=!0,E.renderBufferDirect(ne,Z,ie,te,D,Le),te.side=ar,te.needsUpdate=!0,E.renderBufferDirect(ne,Z,ie,te,D,Le),te.side=Bi):E.renderBufferDirect(ne,Z,ie,te,D,Le),D.onAfterRender(E,Z,ne,ie,te,Le)}function As(D,Z,ne){Z.isScene!==!0&&(Z=Fe);const ie=Pe.get(D),te=x.state.lights,Le=x.state.shadowsArray,Ve=te.state.version,je=ze.getParameters(D,te.state,Le,Z,ne),Qe=ze.getProgramCacheKey(je);let st=ie.programs;ie.environment=D.isMeshStandardMaterial?Z.environment:null,ie.fog=Z.fog,ie.envMap=(D.isMeshStandardMaterial?K:C).get(D.envMap||ie.environment),st===void 0&&(D.addEventListener("dispose",be),st=new Map,ie.programs=st);let it=st.get(Qe);if(it!==void 0){if(ie.currentProgram===it&&ie.lightsStateVersion===Ve)return tl(D,je),it}else je.uniforms=ze.getUniforms(D),D.onBuild(ne,je,E),D.onBeforeCompile(je,E),it=ze.acquireProgram(je,Qe),st.set(Qe,it),ie.uniforms=je.uniforms;const ot=ie.uniforms;return(!D.isShaderMaterial&&!D.isRawShaderMaterial||D.clipping===!0)&&(ot.clippingPlanes=at.uniform),tl(D,je),ie.needsLights=Ou(D),ie.lightsStateVersion=Ve,ie.needsLights&&(ot.ambientLightColor.value=te.state.ambient,ot.lightProbe.value=te.state.probe,ot.directionalLights.value=te.state.directional,ot.directionalLightShadows.value=te.state.directionalShadow,ot.spotLights.value=te.state.spot,ot.spotLightShadows.value=te.state.spotShadow,ot.rectAreaLights.value=te.state.rectArea,ot.ltc_1.value=te.state.rectAreaLTC1,ot.ltc_2.value=te.state.rectAreaLTC2,ot.pointLights.value=te.state.point,ot.pointLightShadows.value=te.state.pointShadow,ot.hemisphereLights.value=te.state.hemi,ot.directionalShadowMap.value=te.state.directionalShadowMap,ot.directionalShadowMatrix.value=te.state.directionalShadowMatrix,ot.spotShadowMap.value=te.state.spotShadowMap,ot.spotLightMatrix.value=te.state.spotLightMatrix,ot.spotLightMap.value=te.state.spotLightMap,ot.pointShadowMap.value=te.state.pointShadowMap,ot.pointShadowMatrix.value=te.state.pointShadowMatrix),ie.currentProgram=it,ie.uniformsList=null,it}function el(D){if(D.uniformsList===null){const Z=D.currentProgram.getUniforms();D.uniformsList=Kc.seqWithValue(Z.seq,D.uniforms)}return D.uniformsList}function tl(D,Z){const ne=Pe.get(D);
vendor: 5,864 bytes, line 3686
3686ne.outputColorSpace=Z.outputColorSpace,ne.batching=Z.batching,ne.instancing=Z.instancing,ne.instancingColor=Z.instancingColor,ne.skinning=Z.skinning,ne.morphTargets=Z.morphTargets,ne.morphNormals=Z.morphNormals,ne.morphColors=Z.morphColors,ne.morphTargetsCount=Z.morphTargetsCount,ne.numClippingPlanes=Z.numClippingPlanes,ne.numIntersection=Z.numClipIntersection,ne.vertexAlphas=Z.vertexAlphas,ne.vertexTangents=Z.vertexTangents,ne.toneMapping=Z.toneMapping}function Nu(D,Z,ne,ie,te){Z.isScene!==!0&&(Z=Fe),I.resetTextureUnits();const Le=Z.fog,Ve=ie.isMeshStandardMaterial?Z.environment:null,je=L===null?E.outputColorSpace:L.isXRRenderTarget===!0?L.texture.colorSpace:Vi,Qe=(ie.isMeshStandardMaterial?K:C).get(ie.envMap||Ve),st=ie.vertexColors===!0&&!!ne.attributes.color&&ne.attributes.color.itemSize===4,it=!!ne.attributes.tangent&&(!!ie.normalMap||ie.anisotropy>0),ot=!!ne.morphAttributes.position,kt=!!ne.morphAttributes.normal,xn=!!ne.morphAttributes.color;let Ut=zi;ie.toneMapped&&(L===null||L.isXRRenderTarget===!0)&&(Ut=E.toneMapping);const fn=ne.morphAttributes.position||ne.morphAttributes.normal||ne.morphAttributes.color,$e=fn!==void 0?fn.length:0,Ne=Pe.get(ie),si=x.state.lights;if(ae===!0&&(xe===!0||D!==b)){const Sn=D===b&&ie.id===z;at.setState(ie,D,Sn)}let vt=!1;ie.version===Ne.__version?(Ne.needsLights&&Ne.lightsStateVersion!==si.state.version||Ne.outputColorSpace!==je||te.isBatchedMesh&&Ne.batching===!1||!te.isBatchedMesh&&Ne.batching===!0||te.isInstancedMesh&&Ne.instancing===!1||!te.isInstancedMesh&&Ne.instancing===!0||te.isSkinnedMesh&&Ne.skinning===!1||!te.isSkinnedMesh&&Ne.skinning===!0||te.isInstancedMesh&&Ne.instancingColor===!0&&te.instanceColor===null||te.isInstancedMesh&&Ne.instancingColor===!1&&te.instanceColor!==null||Ne.envMap!==Qe||ie.fog===!0&&Ne.fog!==Le||Ne.numClippingPlanes!==void 0&&(Ne.numClippingPlanes!==at.numPlanes||Ne.numIntersection!==at.numIntersection)||Ne.vertexAlphas!==st||Ne.vertexTangents!==it||Ne.morphTargets!==ot||Ne.morphNormals!==kt||Ne.morphColors!==xn||Ne.toneMapping!==Ut||ve.isWebGL2===!0&&Ne.morphTargetsCount!==$e)&&(vt=!0):(vt=!0,Ne.__version=ie.version);let Gt=Ne.currentProgram;vt===!0&&(Gt=As(ie,Z,te));let Ri=!1,oi=!1,dn=!1;const Zt=Gt.getUniforms(),Pi=Ne.uniforms;if(ue.useProgram(Gt.program)&&(Ri=!0,oi=!0,dn=!0),ie.id!==z&&(z=ie.id,oi=!0),Ri||b!==D){Zt.setValue(k,"projectionMatrix",D.projectionMatrix),Zt.setValue(k,"viewMatrix",D.matrixWorldInverse);const Sn=Zt.map.cameraPosition;Sn!==void 0&&Sn.setValue(k,nt.setFromMatrixPosition(D.matrixWorld)),ve.logarithmicDepthBuffer&&Zt.setValue(k,"logDepthBufFC",2/(Math.log(D.far+1)/Math.LN2)),(ie.isMeshPhongMaterial||ie.isMeshToonMaterial||ie.isMeshLambertMaterial||ie.isMeshBasicMaterial||ie.isMeshStandardMaterial||ie.isShaderMaterial)&&Zt.setValue(k,"isOrthographic",D.isOrthographicCamera===!0),b!==D&&(b=D,oi=!0,dn=!0)}if(te.isSkinnedMesh){Zt.setOptional(k,te,"bindMatrix"),Zt.setOptional(k,te,"bindMatrixInverse");const Sn=te.skeleton;Sn&&(ve.floatVertexTextures?(Sn.boneTexture===null&&Sn.computeBoneTexture(),Zt.setValue(k,"boneTexture",Sn.boneTexture,I)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}te.isBatchedMesh&&(Zt.setOptional(k,te,"batchingTexture"),Zt.setValue(k,"batchingTexture",te._matricesTexture,I));const bs=ne.morphAttributes;if((bs.position!==void 0||bs.normal!==void 0||bs.color!==void 0&&ve.isWebGL2===!0)&&_t.update(te,ne,Gt),(oi||Ne.receiveShadow!==te.receiveShadow)&&(Ne.receiveShadow=te.receiveShadow,Zt.setValue(k,"receiveShadow",te.receiveShadow)),ie.isMeshGouraudMaterial&&ie.envMap!==null&&(Pi.envMap.value=Qe,Pi.flipEnvMap.value=Qe.isCubeTexture&&Qe.isRenderTargetTexture===!1?-1:1),oi&&(Zt.setValue(k,"toneMappingExposure",E.toneMappingExposure),Ne.needsLights&&Uu(Pi,dn),Le&&ie.fog===!0&&we.refreshFogUniforms(Pi,Le),we.refreshMaterialUniforms(Pi,ie,le,ee,Te),Kc.upload(k,el(Ne),Pi,I)),ie.isShaderMaterial&&ie.uniformsNeedUpdate===!0&&(Kc.upload(k,el(Ne),Pi,I),ie.uniformsNeedUpdate=!1),ie.isSpriteMaterial&&Zt.setValue(k,"center",te.center),Zt.setValue(k,"modelViewMatrix",te.modelViewMatrix),Zt.setValue(k,"normalMatrix",te.normalMatrix),Zt.setValue(k,"modelMatrix",te.matrixWorld),ie.isShaderMaterial||ie.isRawShaderMaterial){const Sn=ie.uniformsGroups;for(let Cs=0,Jn=Sn.length;Cs<Jn;Cs++)if(ve.isWebGL2){const nl=Sn[Cs];Mt.update(nl,Gt),Mt.bind(nl,Gt)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return Gt}function Uu(D,Z){D.ambientLightColor.needsUpdate=Z,D.lightProbe.needsUpdate=Z,D.directionalLights.needsUpdate=Z,D.directionalLightShadows.needsUpdate=Z,D.pointLights.needsUpdate=Z,D.pointLightShadows.needsUpdate=Z,D.spotLights.needsUpdate=Z,D.spotLightShadows.needsUpdate=Z,D.rectAreaLights.needsUpdate=Z,D.hemisphereLights.needsUpdate=Z}function Ou(D){return D.isMeshLambertMaterial||D.isMeshToonMaterial||D.isMeshPhongMaterial||D.isMeshStandardMaterial||D.isShadowMaterial||D.isShaderMaterial&&D.lights===!0}this.getActiveCubeFace=function(){return N},this.getActiveMipmapLevel=function(){return R},this.getRenderTarget=function(){return L},this.setRenderTargetTextures=function(D,Z,ne){Pe.get(D.texture).__webglTexture=Z,Pe.get(D.depthTexture).__webglTexture=ne;const ie=Pe.get(D);ie.__hasExternalTextures=!0,ie.__hasExternalTextures&&(ie.__autoAllocateDepthBuffer=ne===void 0,ie.__autoAllocateDepthBuffer||he.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),ie.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(D,Z){const ne=Pe.get(D);ne.__webglFramebuffer=Z,ne.__useDefaultFramebuffer=Z===void 0},this.setRenderTarget=function(D,Z=0,ne=0){L=D,N=Z,R=ne;let ie=!0,te=null,Le=!1,Ve=!1;
3686if(D){const Qe=Pe.get(D);Qe.__useDefaultFramebuffer!==void 0?(ue.bindFramebuffer(k.FRAMEBUFFER,null),ie=!1):Qe.__webglFramebuffer===void 0?I.setupRenderTarget(D):Qe.__hasExternalTextures&&I.rebindTextures(D,Pe.get(D.texture).__webglTexture,Pe.get(D.depthTexture).__webglTexture);const st=D.texture;(st.isData3DTexture||st.isDataArrayTexture||st.isCompressedArrayTexture)&&(Ve=!0);const it=Pe.get(D).__webglFramebuffer;D.isWebGLCubeRenderTarget?(Array.isArray(it[Z])?te=it[Z][ne]:te=it[Z],Le=!0):ve.isWebGL2&&D.samples>0&&I.useMultisampledRTT(D)===!1?te=Pe.get(D).__webglMultisampledFramebuffer:Array.isArray(it)?te=it[ne]:te=it,P.copy(D.viewport),B.copy(D.scissor),Q=D.scissorTest}else P.copy(W).multiplyScalar(le).floor(),B.copy(Y).multiplyScalar(le).floor(),Q=oe;if(ue.bindFramebuffer(k.FRAMEBUFFER,te)&&ve.drawBuffers&&ie&&ue.drawBuffers(D,te),ue.viewport(P),ue.scissor(B),ue.setScissorTest(Q),Le){const Qe=Pe.get(D.texture);k.framebufferTexture2D(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,k.TEXTURE_CUBE_MAP_POSITIVE_X+Z,Qe.__webglTexture,ne)}else if(Ve){const Qe=Pe.get(D.texture),st=Z||0;k.framebufferTextureLayer(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,Qe.__webglTexture,ne||0,st)}z=-1},this.readRenderTargetPixels=function(D,Z,ne,ie,te,Le,Ve){if(!(D&&D.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let je=Pe.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Ve!==void 0&&(je=je[Ve]),je){ue.bindFramebuffer(k.FRAMEBUFFER,je);try{const Qe=D.texture,st=Qe.format,it=Qe.type;if(st!==Fn&&Oe.convert(st)!==k.getParameter(k.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ot=it===xo&&(he.has("EXT_color_buffer_half_float")||ve.isWebGL2&&he.has("EXT_color_buffer_float"));if(it!==ki&&Oe.convert(it)!==k.getParameter(k.IMPLEMENTATION_COLOR_READ_TYPE)&&!(it===wi&&(ve.isWebGL2||he.has("OES_texture_float")||he.has("WEBGL_color_buffer_float")))&&!ot){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Z>=0&&Z<=D.width-ie&&ne>=0&&ne<=D.height-te&&k.readPixels(Z,ne,ie,te,Oe.convert(st),Oe.convert(it),Le)}finally{const Qe=L!==null?Pe.get(L).__webglFramebuffer:null;ue.bindFramebuffer(k.FRAMEBUFFER,Qe)}}},this.copyFramebufferToTexture=function(D,Z,ne=0){const ie=Math.pow(2,-ne),te=Math.floor(Z.image.width*ie),Le=Math.floor(Z.image.height*ie);I.setTexture2D(Z,0),k.copyTexSubImage2D(k.TEXTURE_2D,ne,0,0,D.x,D.y,te,Le),ue.unbindTexture()},this.copyTextureToTexture=function(D,Z,ne,ie=0){const te=Z.image.width,Le=Z.image.height,Ve=Oe.convert(ne.format),je=Oe.convert(ne.type);I.setTexture2D(ne,0),k.pixelStorei(k.UNPACK_FLIP_Y_WEBGL,ne.flipY),k.pixelStorei(k.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ne.premultiplyAlpha),k.pixelStorei(k.UNPACK_ALIGNMENT,ne.unpackAlignment),Z.isDataTexture?k.texSubImage2D(k.TEXTURE_2D,ie,D.x,D.y,te,Le,Ve,je,Z.image.data):Z.isCompressedTexture?k.compressedTexSubImage2D(k.TEXTURE_2D,ie,D.x,D.y,Z.mipmaps[0].width,Z.mipmaps[0].height,Ve,Z.mipmaps[0].data):k.texSubImage2D(k.TEXTURE_2D,ie,D.x,D.y,Ve,je,Z.image),ie===0&&ne.generateMipmaps&&k.generateMipmap(k.TEXTURE_2D),ue.unbindTexture()},this.copyTextureToTexture3D=function(D,Z,ne,ie,te=0){if(E.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Le=D.max.x-D.min.x+1,Ve=D.max.y-D.min.y+1,je=D.max.z-D.min.z+1,Qe=Oe.convert(ie.format),st=Oe.convert(ie.type);let it;if(ie.isData3DTexture)I.setTexture3D(ie,0),it=k.TEXTURE_3D;else if(ie.isDataArrayTexture||ie.isCompressedArrayTexture)I.setTexture2DArray(ie,0),it=k.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}k.pixelStorei(k.UNPACK_FLIP_Y_WEBGL,ie.flipY),k.pixelStorei(k.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ie.premultiplyAlpha),k.pixelStorei(k.UNPACK_ALIGNMENT,ie.unpackAlignment);const ot=k.getParameter(k.UNPACK_ROW_LENGTH),kt=k.getParameter(k.UNPACK_IMAGE_HEIGHT),xn=k.getParameter(k.UNPACK_SKIP_PIXELS),Ut=k.getParameter(k.UNPACK_SKIP_ROWS),fn=k.getParameter(k.UNPACK_SKIP_IMAGES),$e=ne.isCompressedTexture?ne.mipmaps[te]:ne.image;k.pixelStorei(k.UNPACK_ROW_LENGTH,$e.width),k.pixelStorei(k.UNPACK_IMAGE_HEIGHT,$e.height),k.pixelStorei(k.UNPACK_SKIP_PIXELS,D.min.x),k.pixelStorei(k.UNPACK_SKIP_ROWS,D.min.y),k.pixelStorei(k.UNPACK_SKIP_IMAGES,D.min.z),ne.isDataTexture||ne.isData3DTexture?k.texSubImage3D(it,te,Z.x,Z.y,Z.z,Le,Ve,je,Qe,st,$e.data):ne.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),k.compressedTexSubImage3D(it,te,Z.x,Z.y,Z.z,Le,Ve,je,Qe,$e.data)):k.texSubImage3D(it,te,Z.x,Z.y,Z.z,Le,Ve,je,Qe,st,$e),k.pixelStorei(k.UNPACK_ROW_LENGTH,ot),k.pixelStorei(k.UNPACK_IMAGE_HEIGHT,kt),k.pixelStorei(k.UNPACK_SKIP_PIXELS,xn),k.pixelStorei(k.UNPACK_SKIP_ROWS,Ut),k.pixelStorei(k.UNPACK_SKIP_IMAGES,fn),te===0&&ie.generateMipmaps&&k.generateMipmap(it),ue.unbindTexture()},this.initTexture=function(D){D.isCubeTexture?I.setTextureCube(D,0):D.isData3DTexture?I.setTexture3D(D,0):D.isDataArrayTexture||D.isCompressedArrayTexture?I.setTexture2DArray(D,0
vendor: 46,323 bytes, line 3686
3686):I.setTexture2D(D,0),ue.unbindTexture()},this.resetState=function(){N=0,R=0,L=null,ue.reset(),ut.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ti}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===hu?"display-p3":"srgb",t.unpackColorSpace=Rt.workingColorSpace===Va?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===an?Nr:Hd}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Nr?an:Vi}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class gv extends Qd{}gv.prototype.isWebGL1Renderer=!0;class pu{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ie(e),this.density=t}clone(){return new pu(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class mu{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new Ie(e),this.near=t,this.far=n}clone(){return new mu(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class $d extends At{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,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,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}}class gu{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=La,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=ii()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}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,s=this.stride;i<s;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=ii()),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=ii()),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 Un=new U;class xs{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++)Un.fromBufferAttribute(this,t),Un.applyMatrix4(e),this.setXYZ(t,Un.x,Un.y,Un.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Un.fromBufferAttribute(this,t),Un.applyNormalMatrix(e),this.setXYZ(t,Un.x,Un.y,Un.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Un.fromBufferAttribute(this,t),Un.transformDirection(e),this.setXYZ(t,Un.x,Un.y,Un.z);return this}setX(e,t){return this.normalized&&(t=ft(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=ft(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=ft(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=ft(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=qn(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=qn(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=qn(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=qn(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=ft(t,this.array),n=ft(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=ft(t,this.array),n=ft(n,this.array),i=ft(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,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=ft(t,this.array),n=ft(n,this.array),i=ft(i,this.array),s=ft(s,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]=s,this}clone(e){if(e===void 0){console.log("THREE.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 s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new bt(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 xs(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.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 s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}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}}}class ep extends In{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Ie(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!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.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let no;const na=new U,io=new U,ro=new U,so=new fe,ia=new fe,_v=new tt,_c=new U,ra=new U,vc=new U,Fg=new fe,hf=new fe,Bg=new fe;class vv extends At{constructor(e=new ep){if(super(),this.isSprite=!0,this.type="Sprite",no===void 0){no=new dt;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new gu(t,5);no.setIndex([0,1,2,0,2,3]),no.setAttribute("position",new xs(n,3,0,!1)),no.setAttribute("uv",new xs(n,2,3,!1))}this.geometry=no,this.material=e,this.center=new fe(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),io.setFromMatrixScale(this.matrixWorld),_v.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),ro.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&io.multiplyScalar(-ro.z);const n=this.material.rotation;let i,s;n!==0&&(s=Math.cos(n),i=Math.sin(n));const l=this.center;yc(_c.set(-.5,-.5,0),ro,l,io,i,s),yc(ra.set(.5,-.5,0),ro,l,io,i,s),yc(vc.set(.5,.5,0),ro,l,io,i,s),Fg.set(0,0),hf.set(1,0),Bg.set(1,1);let c=e.ray.intersectTriangle(_c,ra,vc,!1,na);if(c===null&&(yc(ra.set(-.5,.5,0),ro,l,io,i,s),hf.set(0,1),c=e.ray.intersectTriangle(_c,vc,ra,!1,na),c===null))return;const u=e.ray.origin.distanceTo(na);u<e.near||u>e.far||t.push({distance:u,point:na.clone(),uv:Xn.getInterpolation(na,_c,ra,vc,Fg,hf,Bg,new fe),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function yc(r,e,t,n,i,s){so.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(ia.x=s*so.x-i*so.y,ia.y=i*so.x+s*so.y):ia.copy(so),r.copy(e),r.x+=ia.x,r.y+=ia.y,r.applyMatrix4(_v)}const xc=new U,zg=new U;class yv extends At{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n<i;n++){const s=t[n];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const i=this.levels;let s;for(s=0;s<i.length&&!(t<i[s].distance);s++);return i.splice(s,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i;n++){let s=t[n].distance;if(t[n].object.visible&&(s-=s*t[n].hysteresis),e<s)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){xc.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(xc);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){xc.setFromMatrixPosition(e.matrixWorld),zg.setFromMatrixPosition(this.matrixWorld);const n=xc.distanceTo(zg)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i<s;i++){let l=t[i].distance;if(t[i].object.visible&&(l-=l*t[i].hysteresis),n>=l)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<s;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let i=0,s=n.length;i<s;i++){const l=n[i];t.object.levels.push({object:l.object.uuid,distance:l.distance,hysteresis:l.hysteresis})}return t}}const kg=new U,Hg=new Pt,Vg=new Pt,MT=new U,Gg=new tt,Sc=new U,ff=new Ln,Wg=new tt,df=new bo;class xv extends ln{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=qf,this.bindMatrix=new tt,this.bindMatrixInverse=new tt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new zn),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Sc),this.boundingBox.expandByPoint(Sc)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Ln),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Sc),this.boundingSphere.expandByPoint(Sc)}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(),ff.copy(this.boundingSphere),ff.applyMatrix4(i),e.ray.intersectsSphere(ff)!==!1&&(Wg.copy(i).invert(),df.copy(e.ray).applyMatrix4(Wg),!(this.boundingBox!==null&&df.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,df)))}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 Pt,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===qf?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===I_?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;Hg.fromBufferAttribute(i.attributes.skinIndex,e),Vg.fromBufferAttribute(i.attributes.skinWeight,e),kg.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const l=Vg.getComponent(s);if(l!==0){const c=Hg.getComponent(s);Gg.multiplyMatrices(n.bones[c].matrixWorld,n.boneInverses[c]),t.addScaledVector(MT.copy(kg).applyMatrix4(Gg),l)}}return t.applyMatrix4(this.bindMatrixInverse)}boneTransform(e,t){return console.warn("THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151."),this.applyBoneTransform(e,t)}}class tp extends At{constructor(){super(),this.isBone=!0,this.type="Bone"}}class _s extends tn{constructor(e=null,t=1,n=1,i,s,l,c,u,h=$t,f=$t,p,m){super(null,l,c,u,h,f,i,s,p,m),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Xg=new tt,ET=new tt;class _u{constructor(e=[],t=[]){this.uuid=ii(),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){console.warn("THREE.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 tt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new tt;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 s=0,l=e.length;s<l;s++){const c=e[s]?e[s].matrixWorld:ET;Xg.multiplyMatrices(c,t[s]),Xg.toArray(n,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new _u(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 _s(t,e,e,Fn,wi);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 s=e.bones[n];let l=t[s];l===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),l=new tp),this.bones.push(l),this.boneInverses.push(new tt().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,s=t.length;i<s;i++){const l=t[i];e.bones.push(l.uuid);const c=n[i];e.boneInverses.push(c.toArray())}return e}}class wo extends bt{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 oo=new tt,qg=new tt,Mc=[],Yg=new zn,wT=new tt,sa=new ln,oa=new Ln;class Sv extends ln{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new wo(new Float32Array(n*16),16),this.instanceColor=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<n;i++)this.setMatrixAt(i,wT)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new zn),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,oo),Yg.copy(e.boundingBox).applyMatrix4(oo),this.boundingBox.union(Yg)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Ln),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,oo),oa.copy(e.boundingSphere).applyMatrix4(oo),this.boundingSphere.union(oa)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),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){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const n=this.matrixWorld,i=this.count;if(sa.geometry=this.geometry,sa.material=this.material,sa.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),oa.copy(this.boundingSphere),oa.applyMatrix4(n),e.ray.intersectsSphere(oa)!==!1))for(let s=0;s<i;s++){this.getMatrixAt(s,oo),qg.multiplyMatrices(n,oo),sa.matrixWorld=qg,sa.raycast(e,Mc);for(let l=0,c=Mc.length;l<c;l++){const u=Mc[l];u.instanceId=s,u.object=this,t.push(u)}Mc.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new wo(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}function TT(r,e){return r.z-e.z}function AT(r,e){return e.z-r.z}class bT{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t){const n=this.pool,i=this.list;this.index>=n.length&&n.push({start:-1,count:-1,z:-1});const s=n[this.index];i.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=t}reset(){this.list.length=0,this.index=0}}const ao="batchId",Tr=new tt,Zg=new tt,CT=new tt,Jg=new tt,pf=new qa,Ec=new zn,ts=new Ln,aa=new U,mf=new bT,Rn=new ln,wc=[];function RT(r,e,t=0){const n=e.itemSize;if(r.isInterleavedBufferAttribute||r.array.constructor!==e.array.constructor){const i=r.count;for(let s=0;s<i;s++)for(let l=0;l<n;l++)e.setComponent(s+t,l,r.getComponent(s,l))}else e.array.set(r.array,t*n);e.needsUpdate=!0}class Mv extends ln{get maxGeometryCount(){return this._maxGeometryCount}constructor(e,t,n=t*2,i){super(new dt,i),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._drawRanges=[],this._reservedRanges=[],this._visibility=[],this._active=[],this._bounds=[],this._maxGeometryCount=e,this._maxVertexCount=t,this._maxIndexCount=n,this._geometryInitialized=!1,this._geometryCount=0,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._visibilityChanged=!0,this._matricesTexture=null,this._initMatricesTexture()}_initMatricesTexture(){let e=Math.sqrt(this._maxGeometryCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4),n=new _s(t,e,e,Fn,wi);this._matricesTexture=n}_initializeGeometry(e){const t=this.geometry,n=this._maxVertexCount,i=this._maxGeometryCount,s=this._maxIndexCount;if(this._geometryInitialized===!1){for(const c in e.attributes){const u=e.getAttribute(c),{array:h,itemSize:f,normalized:p}=u,m=new h.constructor(n*f),g=new u.constructor(m,f,p);g.setUsage(u.usage),t.setAttribute(c,g)}if(e.getIndex()!==null){const c=n>65536?new Uint32Array(s):new Uint16Array(s);t.setIndex(new bt(c,1))}const l=i>65536?new Uint32Array(n):new Uint16Array(n);t.setAttribute(ao,new bt(l,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(ao))throw new Error(`BatchedMesh: Geometry cannot use attribute "${ao}"`);const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(n===ao)continue;if(!e.hasAttribute(n))throw new Error(`BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const i=e.getAttribute(n),s=t.getAttribute(n);if(i.itemSize!==s.itemSize||i.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new zn);const e=this._geometryCount,t=this.boundingBox,n=this._active;t.makeEmpty();for(let i=0;i<e;i++)n[i]!==!1&&(this.getMatrixAt(i,Tr),this.getBoundingBoxAt(i,Ec).applyMatrix4(Tr),t.union(Ec))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ln);const e=this._geometryCount,t=this.boundingSphere,n=this._active;t.makeEmpty();for(let i=0;i<e;i++)n[i]!==!1&&(this.getMatrixAt(i,Tr),this.getBoundingSphereAt(i,ts).applyMatrix4(Tr),t.union(ts))}addGeometry(e,t=-1,n=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._geometryCount>=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const i={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const l=this._reservedRanges,c=this._drawRanges,u=this._bounds;this._geometryCount!==0&&(s=l[l.length-1]),t===-1?i.vertexCount=e.getAttribute("position").count:i.vertexCount=t,s===null?i.vertexStart=0:i.vertexStart=s.vertexStart+s.vertexCount;const h=e.getIndex(),f=h!==null;if(f&&(n===-1?i.indexCount=h.count:i.indexCount=n,s===null?i.indexStart=0:i.indexStart=s.indexStart+s.indexCount),i.indexStart!==-1&&i.indexStart+i.indexCount>this._maxIndexCount||i.vertexStart+i.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const p=this._visibility,m=this._active,g=this._matricesTexture,y=this._matricesTexture.image.data;p.push(!0),m.push(!0);const M=this._geometryCount;this._geometryCount++,CT.toArray(y,M*16),g.needsUpdate=!0,l.push(i),c.push({start:f?i.indexStart:i.vertexStart,count:-1}),u.push({boxInitialized:!1,box:new zn,sphereInitialized:!1,sphere:new Ln});const x=this.geometry.getAttribute(ao);for(let v=0;v<i.vertexCount;v++)x.setX(i.vertexStart+v,M);return x.needsUpdate=!0,this.setGeometryAt(M,e),M}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,i=n.getIndex()!==null,s=n.getIndex(),l=t.getIndex(),c=this._reservedRanges[e];if(i&&l.count>c.indexCount||t.attributes.position.count>c.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const u=c.vertexStart,h=c.vertexCount;for(const g in n.attributes){if(g===ao)continue;const y=t.getAttribute(g),M=n.getAttribute(g);RT(y,M,u);const x=y.itemSize;for(let v=y.count,w=h;v<w;v++){const E=u+v;for(let A=0;A<x;A++)M.setComponent(E,A,0)}M.needsUpdate=!0}if(i){const g=c.indexStart;for(let y=0;y<l.count;y++)s.setX(g+y,u+l.getX(y));for(let y=l.count,M=c.indexCount;y<M;y++)s.setX(g+y,u);s.needsUpdate=!0}const f=this._bounds[e];t.boundingBox!==null?(f.box.copy(t.boundingBox),f.boxInitialized=!0):f.boxInitialized=!1,t.boundingSphere!==null?(f.sphere.copy(t.boundingSphere),f.sphereInitialized=!0):f.sphereInitialized=!1;const p=this._drawRanges[e],m=t.getAttribute("position");return p.count=i?l.count:m.count,this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._active;return e>=t.length||t[e]===!1?this:(t[e]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(e,t){if(this._active[e]===!1)return this;const i=this._bounds[e],s=i.box,l=this.geometry;if(i.boxInitialized===!1){s.makeEmpty();const c=l.index,u=l.attributes.position,h=this._drawRanges[e];for(let f=h.start,p=h.start+h.count;f<p;f++){let m=f;c&&(m=c.getX(m)),s.expandByPoint(aa.fromBufferAttribute(u,m))}i.boxInitialized=!0}return t.copy(s),t}getBoundingSphereAt(e,t){if(this._active[e]===!1)return this;const i=this._bounds[e],s=i.sphere,l=this.geometry;if(i.sphereInitialized===!1){s.makeEmpty(),this.getBoundingBoxAt(e,Ec),Ec.getCenter(s.center);const c=l.index,u=l.attributes.position,h=this._drawRanges[e];let f=0;for(let p=h.start,m=h.start+h.count;p<m;p++){let g=p;c&&(g=c.getX(g)),aa.fromBufferAttribute(u,g),f=Math.max(f,s.center.distanceToSquared(aa))}s.radius=Math.sqrt(f),i.sphereInitialized=!0}return t.copy(s),t}setMatrixAt(e,t){const n=this._active,i=this._matricesTexture,s=this._matricesTexture.image.data,l=this._geometryCount;return e>=l||n[e]===!1?this:(t.toArray(s,e*16),i.needsUpdate=!0,this)}getMatrixAt(e,t){const n=this._active,i=this._matricesTexture.image.data,s=this._geometryCount;return e>=s||n[e]===!1?null:t.fromArray(i,e*16)}setVisibleAt(e,t){const n=this._visibility,i=this._active,s=this._geometryCount;return e>=s||i[e]===!1||n[e]===t?this:(n[e]=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._visibility,n=this._active,i=this._geometryCount;return e>=i||n[e]===!1?!1:t[e]}raycast(e,t){const n=this._visibility,i=this._active,s=this._drawRanges,l=this._geometryCount,c=this.matrixWorld,u=this.geometry;Rn.material=this.material,Rn.geometry.index=u.index,Rn.geometry.attributes=u.attributes,Rn.geometry.boundingBox===null&&(Rn.geometry.boundingBox=new zn),Rn.geometry.boundingSphere===null&&(Rn.geometry.boundingSphere=new Ln);for(let h=0;h<l;h++){if(!n[h]||!i[h])continue;const f=s[h];Rn.geometry.setDrawRange(f.start,f.count),this.getMatrixAt(h,Rn.matrixWorld).premultiply(c),this.getBoundingBoxAt(h,Rn.geometry.boundingBox),this.getBoundingSphereAt(h,Rn.geometry.boundingSphere),Rn.raycast(e,wc);for(let p=0,m=wc.length;p<m;p++){const g=wc[p];g.object=this,g.batchId=h,t.push(g)}wc.length=0}Rn.material=null,Rn.geometry.index=null,Rn.geometry.attributes={},Rn.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._drawRanges=e._drawRanges.map(t=>({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._visibility=e._visibility.slice(),this._active=e._active.slice(),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxGeometryCount=e._maxGeometryCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(e,t,n,i,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const l=i.getIndex(),c=l===null?1:l.array.BYTES_PER_ELEMENT,u=this._visibility,h=this._multiDrawStarts,f=this._multiDrawCounts,p=this._drawRanges,m=this.perObjectFrustumCulled;m&&(Jg.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),pf.setFromProjectionMatrix(Jg,e.isWebGPURenderer?So:Ti));let g=0;if(this.sortObjects){Zg.copy(this.matrixWorld).invert(),aa.setFromMatrixPosition(n.matrixWorld).applyMatrix4(Zg);for(let x=0,v=u.length;x<v;x++)if(u[x]){this.getMatrixAt(x,Tr),this.getBoundingSphereAt(x,ts).applyMatrix4(Tr);let w=!1;if(m&&(w=!pf.intersectsSphere(ts)),!w){const E=aa.distanceTo(ts.center);mf.push(p[x],E)}}const y=mf.list,M=this.customSort;M===null?y.sort(s.transparent?AT:TT):M.call(this,y,n);for(let x=0,v=y.length;x<v;x++){const w=y[x];h[g]=w.start*c,f[g]=w.count,g++}mf.reset()}else for(let y=0,M=u.length;y<M;y++)if(u[y]){let x=!1;if(m&&(this.getMatrixAt(y,Tr),this.getBoundingSphereAt(y,ts).applyMatrix4(Tr),x=!pf.intersectsSphere(ts)),!x){const v=p[y];h[g]=v.start*c,f[g]=v.count,g++}}this._multiDrawCount=g,this._visibilityChanged=!1}onBeforeShadow(e,t,n,i,s,l){this.onBeforeRender(e,null,i,s,l)}}class kn extends In{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ie(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 jg=new U,Kg=new U,Qg=new tt,gf=new bo,Tc=new Ln;class Fr extends At{constructor(e=new dt,t=new kn){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,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,s=t.count;i<s;i++)jg.fromBufferAttribute(t,i-1),Kg.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=jg.distanceTo(Kg);e.setAttribute("lineDistance",new Be(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,l=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Tc.copy(n.boundingSphere),Tc.applyMatrix4(i),Tc.radius+=s,e.ray.intersectsSphere(Tc)===!1)return;Qg.copy(i).invert(),gf.copy(e.ray).applyMatrix4(Qg);const c=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=c*c,h=new U,f=new U,p=new U,m=new U,g=this.isLineSegments?2:1,y=n.index,x=n.attributes.position;if(y!==null){const v=Math.max(0,l.start),w=Math.min(y.count,l.start+l.count);for(let E=v,A=w-1;E<A;E+=g){const N=y.getX(E),R=y.getX(E+1);if(h.fromBufferAttribute(x,N),f.fromBufferAttribute(x,R),gf.distanceSqToSegment(h,f,m,p)>u)continue;m.applyMatrix4(this.matrixWorld);const z=e.ray.origin.distanceTo(m);z<e.near||z>e.far||t.push({distance:z,point:p.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,l.start),w=Math.min(x.count,l.start+l.count);for(let E=v,A=w-1;E<A;E+=g){if(h.fromBufferAttribute(x,E),f.fromBufferAttribute(x,E+1),gf.distanceSqToSegment(h,f,m,p)>u)continue;m.applyMatrix4(this.matrixWorld);const R=e.ray.origin.distanceTo(m);R<e.near||R>e.far||t.push({distance:R,point:p.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object: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 s=0,l=i.length;s<l;s++){const c=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=s}}}}}const $g=new U,e0=new U;class Wi extends Fr{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,s=t.count;i<s;i+=2)$g.fromBufferAttribute(t,i),e0.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+$g.distanceTo(e0);e.setAttribute("lineDistance",new Be(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Ev extends Fr{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class np extends In{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ie(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 t0=new tt,Ed=new bo,Ac=new Ln,bc=new U;class wv extends At{constructor(e=new dt,t=new np){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,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,s=e.params.Points.threshold,l=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ac.copy(n.boundingSphere),Ac.applyMatrix4(i),Ac.radius+=s,e.ray.intersectsSphere(Ac)===!1)return;t0.copy(i).invert(),Ed.copy(e.ray).applyMatrix4(t0);const c=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=c*c,h=n.index,p=n.attributes.position;if(h!==null){const m=Math.max(0,l.start),g=Math.min(h.count,l.start+l.count);for(let y=m,M=g;y<M;y++){const x=h.getX(y);bc.fromBufferAttribute(p,x),n0(bc,x,u,i,e,t,this)}}else{const m=Math.max(0,l.start),g=Math.min(p.count,l.start+l.count);for(let y=m,M=g;y<M;y++)bc.fromBufferAttribute(p,y),n0(bc,y,u,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 s=0,l=i.length;s<l;s++){const c=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=s}}}}}function n0(r,e,t,n,i,s,l){const c=Ed.distanceSqToPoint(r);if(c<t){const u=new U;Ed.closestPointToPoint(r,u),u.applyMatrix4(n);const h=i.ray.origin.distanceTo(u);if(h<i.near||h>i.far)return;s.push({distance:h,distanceToRay:Math.sqrt(c),point:u,index:e,face:null,object:l})}}class PT extends tn{constructor(e,t,n,i,s,l,c,u,h){super(e,t,n,i,s,l,c,u,h),this.isVideoTexture=!0,this.minFilter=l!==void 0?l:en,this.magFilter=s!==void 0?s:en,this.generateMipmaps=!1;const f=this;function p(){f.needsUpdate=!0,e.requestVideoFrameCallback(p)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(p)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class LT extends tn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=$t,this.minFilter=$t,this.generateMipmaps=!1,this.needsUpdate=!0}}class vu extends tn{constructor(e,t,n,i,s,l,c,u,h,f,p,m){super(null,l,c,u,h,f,i,s,p,m),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class IT extends vu{constructor(e,t,n,i,s,l){super(e,t,n,s,l),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Pn}}class DT extends vu{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,lr),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class NT extends tn{constructor(e,t,n,i,s,l,c,u,h){super(e,t,n,i,s,l,c,u,h),this.isCanvasTexture=!0,this.needsUpdate=!0}}class bi{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}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),s=0;t.push(0);for(let l=1;l<=e;l++)n=this.getPoint(l/e),s+=n.distanceTo(i),t.push(s),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let i=0;const s=n.length;let l;t?l=t:l=e*n[s-1];let c=0,u=s-1,h;for(;c<=u;)if(i=Math.floor(c+(u-c)/2),h=n[i]-l,h<0)c=i+1;else if(h>0)u=i-1;else{u=i;break}if(i=u,n[i]===l)return i/(s-1);const f=n[i],m=n[i+1]-f,g=(l-f)/m;return(i+g)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const l=this.getPoint(i),c=this.getPoint(s),u=t||(l.isVector2?new fe:new U);return u.copy(c).sub(l).normalize(),u}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new U,i=[],s=[],l=[],c=new U,u=new tt;for(let g=0;g<=e;g++){const y=g/e;i[g]=this.getTangentAt(y,new U)}s[0]=new U,l[0]=new U;let h=Number.MAX_VALUE;const f=Math.abs(i[0].x),p=Math.abs(i[0].y),m=Math.abs(i[0].z);f<=h&&(h=f,n.set(1,0,0)),p<=h&&(h=p,n.set(0,1,0)),m<=h&&n.set(0,0,1),c.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],c),l[0].crossVectors(i[0],s[0]);for(let g=1;g<=e;g++){if(s[g]=s[g-1].clone(),l[g]=l[g-1].clone(),c.crossVectors(i[g-1],i[g]),c.length()>Number.EPSILON){c.normalize();const y=Math.acos(qt(i[g-1].dot(i[g]),-1,1));s[g].applyMatrix4(u.makeRotationAxis(c,y))}l[g].crossVectors(i[g],s[g])}if(t===!0){let g=Math.acos(qt(s[0].dot(s[e]),-1,1));g/=e,i[0].dot(c.crossVectors(s[0],s[e]))>0&&(g=-g);for(let y=1;y<=e;y++)s[y].applyMatrix4(u.makeRotationAxis(i[y],g*y)),l[y].crossVectors(i[y],s[y])}return{tangents:i,normals:s,binormals:l}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class yu extends bi{constructor(e=0,t=0,n=1,i=1,s=0,l=Math.PI*2,c=!1,u=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=l,this.aClockwise=c,this.aRotation=u}getPoint(e,t){const n=t||new fe,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const l=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=i;for(;s>i;)s-=i;s<Number.EPSILON&&(l?s=0:s=i),this.aClockwise===!0&&!l&&(s===i?s=-i:s=s-i);const c=this.aStartAngle+e*s;let u=this.aX+this.xRadius*Math.cos(c),h=this.aY+this.yRadius*Math.sin(c);if(this.aRotation!==0){const f=Math.cos(this.aRotation),p=Math.sin(this.aRotation),m=u-this.aX,g=h-this.aY;u=m*f-g*p+this.aX,h=m*p+g*f+this.aY}return n.set(u,h)}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 Tv extends yu{constructor(e,t,n,i,s,l){super(e,t,n,n,i,s,l),this.isArcCurve=!0,this.type="ArcCurve"}}function ip(){let r=0,e=0,t=0,n=0;function i(s,l,c,u){r=s,e=c,t=-3*s+3*l-2*c-u,n=2*s-2*l+c+u}return{initCatmullRom:function(s,l,c,u,h){i(l,c,h*(c-s),h*(u-l))},initNonuniformCatmullRom:function(s,l,c,u,h,f,p){let m=(l-s)/h-(c-s)/(h+f)+(c-l)/f,g=(c-l)/f-(u-l)/(f+p)+(u-c)/p;m*=f,g*=f,i(l,c,m,g)},calc:function(s){const l=s*s,c=l*s;return r+e*s+t*l+n*c}}}const Cc=new U,_f=new ip,vf=new ip,yf=new ip;class Av extends bi{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 U){const n=t,i=this.points,s=i.length,l=(s-(this.closed?0:1))*e;let c=Math.floor(l),u=l-c;this.closed?c+=c>0?0:(Math.floor(Math.abs(c)/s)+1)*s:u===0&&c===s-1&&(c=s-2,u=1);let h,f;this.closed||c>0?h=i[(c-1)%s]:(Cc.subVectors(i[0],i[1]).add(i[0]),h=Cc);const p=i[c%s],m=i[(c+1)%s];if(this.closed||c+2<s?f=i[(c+2)%s]:(Cc.subVectors(i[s-1],i[s-2]).add(i[s-1]),f=Cc),this.curveType==="centripetal"||this.curveType==="chordal"){const g=this.curveType==="chordal"?.5:.25;let y=Math.pow(h.distanceToSquared(p),g),M=Math.pow(p.distanceToSquared(m),g),x=Math.pow(m.distanceToSquared(f),g);M<1e-4&&(M=1),y<1e-4&&(y=M),x<1e-4&&(x=M),_f.initNonuniformCatmullRom(h.x,p.x,m.x,f.x,y,M,x),vf.initNonuniformCatmullRom(h.y,p.y,m.y,f.y,y,M,x),yf.initNonuniformCatmullRom(h.z,p.z,m.z,f.z,y,M,x)}else this.curveType==="catmullrom"&&(_f.initCatmullRom(h.x,p.x,m.x,f.x,this.tension),vf.initCatmullRom(h.y,p.y,m.y,f.y,this.tension),yf.initCatmullRom(h.z,p.z,m.z,f.z,this.tension));return n.set(_f.calc(u),vf.calc(u),yf.calc(u)),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 U().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function i0(r,e,t,n,i){const s=(n-e)*.5,l=(i-t)*.5,c=r*r,u=r*c;return(2*t-2*n+s+l)*u+(-3*t+3*n-2*s-l)*c+s*r+t}function UT(r,e){const t=1-r;return t*t*e}function OT(r,e){return 2*(1-r)*r*e}function FT(r,e){return r*r*e}function va(r,e,t,n){return UT(r,e)+OT(r,t)+FT(r,n)}function BT(r,e){const t=1-r;return t*t*t*e}function zT(r,e){const t=1-r;return 3*t*t*r*e}function kT(r,e){return 3*(1-r)*r*r*e}function HT(r,e){return r*r*r*e}function ya(r,e,t,n,i){return BT(r,e)+zT(r,t)+kT(r,n)+HT(r,i)}class rp extends bi{constructor(e=new fe,t=new fe,n=new fe,i=new fe){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new fe){const n=t,i=this.v0,s=this.v1,l=this.v2,c=this.v3;return n.set(ya(e,i.x,s.x,l.x,c.x),ya(e,i.y,s.y,l.y,c.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 bv extends bi{constructor(e=new U,t=new U,n=new U,i=new U){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new U){const n=t,i=this.v0,s=this.v1,l=this.v2,c=this.v3;return n.set(ya(e,i.x,s.x,l.x,c.x),ya(e,i.y,s.y,l.y,c.y),ya(e,i.z,s.z,l.z,c.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 sp extends bi{constructor(e=new fe,t=new fe){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new fe){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 fe){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 Cv extends bi{constructor(e=new U,t=new U){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}
vendor: 4,079 bytes, line 3686
3686getPoint(e,t=new U){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 U){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 op extends bi{constructor(e=new fe,t=new fe,n=new fe){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new fe){const n=t,i=this.v0,s=this.v1,l=this.v2;return n.set(va(e,i.x,s.x,l.x),va(e,i.y,s.y,l.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 ap extends bi{constructor(e=new U,t=new U,n=new U){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new U){const n=t,i=this.v0,s=this.v1,l=this.v2;return n.set(va(e,i.x,s.x,l.x),va(e,i.y,s.y,l.y),va(e,i.z,s.z,l.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 lp extends bi{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new fe){const n=t,i=this.points,s=(i.length-1)*e,l=Math.floor(s),c=s-l,u=i[l===0?l:l-1],h=i[l],f=i[l>i.length-2?i.length-1:l+1],p=i[l>i.length-3?i.length-1:l+2];return n.set(i0(c,u.x,h.x,f.x,p.x),i0(c,u.y,h.y,f.y,p.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 fe().fromArray(i))}return this}}var ru=Object.freeze({__proto__:null,ArcCurve:Tv,CatmullRomCurve3:Av,CubicBezierCurve:rp,CubicBezierCurve3:bv,EllipseCurve:yu,LineCurve:sp,LineCurve3:Cv,QuadraticBezierCurve:op,QuadraticBezierCurve3:ap,SplineCurve:lp});class Rv extends bi{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 ru[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),i=this.getCurveLengths();let s=0;for(;s<i.length;){if(i[s]>=n){const l=i[s]-n,c=this.curves[s],u=c.getLength(),h=u===0?0:1-l/u;return c.getPointAt(h,t)}s++}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,s=this.curves;i<s.length;i++){const l=s[i],c=l.isEllipseCurve?e*2:l.isLineCurve||l.isLineCurve3?1:l.isSplineCurve?e*l.points.length:e,u=l.getPoints(c);for(let h=0;h<u.length;h++){const f=u[h];n&&n.equals(f)||(t.push(f),n=f)}}return this.autoClose&&t.length>
vendor: 6,416 bytes, line 3686
36861&&!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 ru[i.type]().fromJSON(i))}return this}}class Da extends Rv{constructor(e){super(),this.type="Path",this.currentPoint=new fe,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 sp(this.currentPoint.clone(),new fe(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,i){const s=new op(this.currentPoint.clone(),new fe(e,t),new fe(n,i));return this.curves.push(s),this.currentPoint.set(n,i),this}bezierCurveTo(e,t,n,i,s,l){const c=new rp(this.currentPoint.clone(),new fe(e,t),new fe(n,i),new fe(s,l));return this.curves.push(c),this.currentPoint.set(s,l),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new lp(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,i,s,l){const c=this.currentPoint.x,u=this.currentPoint.y;return this.absarc(e+c,t+u,n,i,s,l),this}absarc(e,t,n,i,s,l){return this.absellipse(e,t,n,n,i,s,l),this}ellipse(e,t,n,i,s,l,c,u){const h=this.currentPoint.x,f=this.currentPoint.y;return this.absellipse(e+h,t+f,n,i,s,l,c,u),this}absellipse(e,t,n,i,s,l,c,u){const h=new yu(e,t,n,i,s,l,c,u);if(this.curves.length>0){const p=h.getPoint(0);p.equals(this.currentPoint)||this.lineTo(p.x,p.y)}this.curves.push(h);const f=h.getPoint(1);return this.currentPoint.copy(f),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 Ja extends dt{constructor(e=[new fe(0,-.5),new fe(.5,0),new fe(0,.5)],t=12,n=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=qt(i,0,Math.PI*2);const s=[],l=[],c=[],u=[],h=[],f=1/t,p=new U,m=new fe,g=new U,y=new U,M=new U;let x=0,v=0;for(let w=0;w<=e.length-1;w++)switch(w){case 0:x=e[w+1].x-e[w].x,v=e[w+1].y-e[w].y,g.x=v*1,g.y=-x,g.z=v*0,M.copy(g),g.normalize(),u.push(g.x,g.y,g.z);break;case e.length-1:u.push(M.x,M.y,M.z);break;default:x=e[w+1].x-e[w].x,v=e[w+1].y-e[w].y,g.x=v*1,g.y=-x,g.z=v*0,y.copy(g),g.x+=M.x,g.y+=M.y,g.z+=M.z,g.normalize(),u.push(g.x,g.y,g.z),M.copy(y)}for(let w=0;w<=t;w++){const E=n+w*f*i,A=Math.sin(E),N=Math.cos(E);for(let R=0;R<=e.length-1;R++){p.x=e[R].x*A,p.y=e[R].y,p.z=e[R].x*N,l.push(p.x,p.y,p.z),m.x=w/t,m.y=R/(e.length-1),c.push(m.x,m.y);const L=u[3*R+0]*A,z=u[3*R+1],b=u[3*R+0]*N;h.push(L,z,b)}}for(let w=0;w<t;w++)for(let E=0;E<e.length-1;E++){const A=E+w*e.length,N=A,R=A+e.length,L=A+e.length+1,z=A+1;s.push(N,R,z),s.push(L,z,R)}this.setIndex(s),this.setAttribute("position",new Be(l,3)),this.setAttribute("uv",new Be(c,2)),this.setAttribute("normal",new Be(h,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ja(e.points,e.segments,e.phiStart,e.phiLength)}}class xu extends Ja{constructor(e=1,t=1,n=4,i=8){const s=new Da;s.absarc(0,-t/2,e,Math.PI*1.5,0),s.absarc(0,t/2,e,0,Math.PI*.5),super(s.getPoints(n),i),this.type="CapsuleGeometry",this.parameters={radius:e,length:t,capSegments:n,radialSegments:i}}static fromJSON(e){return new xu(e.radius,e.length,e.capSegments,e.radialSegments)}}class Su extends dt{constructor(e=1,t=32,n=0,i=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);const s=[],l=[],c=[],u=[],h=new U,f=new fe;l.push(0,0,0),c.push(0,0,1),u.push(.5,.5);for(let p=0,m=3;p<=t;p++,m+=3){const g=n+p/t*i;h.x=e*Math.cos(g),h.y=e*Math.sin(g),l.push(h.x,h.y,h.z),c.push(0,0,1),f.x=(l[m]/e+1)/2,f.y=(l[m+1]/e+1)/2,u.push(f.x,f.y)}for(let p=1;p<=t;p++)s.push(p,p+1,0);this.setIndex(s),this.setAttribute("position",new Be(l,3)),this.setAttribute("normal",new Be(c,3)),this.setAttribute("uv",new Be(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Su(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Ro extends dt{constructor(e=1,t=1,n=1,i=32,s=1,l=!1,c=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:l,thetaStart:c,thetaLength:u};const h=this;i=Math.floor(i),s=Math.floor(s);const f=[],p=[],m=[],g=[];let y=0;const M=[],x=n/2;let v=0;w(),l===!1&&(e>0&&E(!0),t>0&&E(!1)),this.setIndex(f),this.setAttribute("position",new Be(p,3)),this.setAttribute("normal",new Be(m,3)),this.setAttribute("uv",new Be(g,2));function w(){const A=new U,N=new U;let R=0;const L=(t-e)/n;for(let z=0;z<=s;z++){const b=[],P=z/s,B=P*(t-e)+e;for(let Q=0;Q<=i;Q++){const ce=Q/i,V=ce*u+c,J=Math.sin(V),ee=Math.cos(V);N.x=B*J,N.y=-P*n+x,N.z=B*ee,p.push(N.x,N.y,N.z),A.set(J,L,ee).normalize(),m.push(A.x,A.y,A.z),g.push(ce,1-P),b.push(y++)}M.push(b)}for(let z=0;z<i;z++)for(let b=0;b<s;b++){const P=M[b][z],B=M[b+1][z],Q=M[b+1][z+1],ce=M[b][z+1];f.push(P,B,ce),f.push(B,Q,ce),R+=6}h.addGroup(v,R,0),v+=R}function E(A){const N=y,R=new fe,L=new U;let z=0;const b=A===!0?e:t,P=A===!0?1:-1;for(let Q=1;Q<=i;Q++)p.push(0,x*P,0),m.push(0,P,0),g.push(.5,.5),y++;const B=y;for(let Q=0;Q<=i;Q++){const V=Q/i*u+c,J=Math.cos(V),ee=Math.sin(V);L.x=b*ee,L.y=x*P,L.z=b*J,p.push(L.x,L.y,L.z),m.push(0,P,0),R.x=J*.5+.5,R.y=ee*.5*P+.5,g.push(R.x,R.y),y++}for(let Q=0;Q<i;Q++){const ce=N+Q,V=B+Q;A===!0?f.push(V,V+1,ce):f.push(V+1,V,ce),z+=3}h.addGroup(v,z,A===!0?1:2),v+=z}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ro(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Mu extends Ro{constructor(e=1,t=1,n=32,i=1,s=!1,l=0,c=Math.PI*2){super(0,e,t,n,i,s,l,c),this.type="C
3686oneGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:s,thetaStart:l,thetaLength:c}}static fromJSON(e){return new Mu(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class kr extends dt{constructor(e=[],t=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const s=[],l=[];c(i),h(n),f(),this.setAttribute("position",new Be(s,3)),this.setAttribute("normal",new Be(s.slice(),3)),this.setAttribute("uv",new Be(l,2)),i===0?this.computeVertexNormals():this.normalizeNormals();function c(w){const E=new U,A=new U,N=new U;for(let R=0;R<t.length;R+=3)g(t[R+0],E),g(t[R+1],A),g(t[R+2],N),u(E,A,N,w)}function u(w,E,A,N){const R=N+1,L=[];for(let z=0;z<=R;z++){L[z]=[];const b=w.clone().lerp(A,z/R),P=E.clone().lerp(A,z/R),B=R-z;for(let Q=0;Q<=B;Q++)Q===0&&z===R?L[z][Q]=b:L[z][Q]=b.clone().lerp(P,Q/B)}for(let z=0;z<R;z++)for(let b=0;b<2*(R-z)-1;b++){const P=Math.floor(b/2);b%2===0?(m(L[z][P+1]),m(L[z+1][P]),m(L[z][P])):(m(L[z][P+1]),m(L[z+1][P+1]),m(L[z+1][P]))}}function h(w){const E=new U;for(let A=0;A<s.length;A+=3)E.x=s[A+0],E.y=s[A+1],E.z=s[A+2],E.normalize().multiplyScalar(w),s[A+0]=E.x,s[A+1]=E.y,s[A+2]=E.z}function f(){const w=new U;for(let E=0;E<s.length;E+=3){w.x=s[E+0],w.y=s[E+1],w.z=s[E+2];const A=x(w)/2/Math.PI+.5,N=v(w)/Math.PI+.5;l.push(A,1-N)}y(),p()}function p(){for(let w=0;w<l.length;w+=6){const E=l[w+0],A=l[w+2],N=l[w+4],R=Math.max(E,A,N),L=Math.min(E,A,N);R>.9&&L<.1&&(E<.2&&(l[w+0]+=1),A<.2&&(l[w+2]+=1),N<.2&&(l[w+4]+=1))}}function m(w){s.push(w.x,w.y,w.z)}function g(w,E){const A=w*3;E.x=e[A+0],E.y=e[A+1],E.z=e[A+2]}function y(){const w=new U,E=new U,A=new U,N=new U,R=new fe,L=new fe,z=new fe;for(let b=0,P=0;b<s.length;b+=9,P+=6){w.set(s[b+0],s[b+1],s[b+2]),E.set(s[b+3],s[b+4],s[b+5]),A.set(s[b+6],s[b+7],s[b+8]),R.set(l[P+0],l[P+1]),L.set(l[P+2],l[P+3]),z.set(l[P+4],l[P+5]),N.copy(w).add(E).add(A).divideScalar(3);const B=x(N);M(R,P+0,w,B),M(L,P+2,E,B),M(z,P+4,A,B)}}function M(w,E,A,N){N<0&&w.x===1&&(l[E]=w.x-1),A.x===0&&A.z===0&&(l[E]=N/2/Math.PI+.5)}function x(w){return Math.atan2(w.z,-w.x)}function v(w){return Math.atan2(-w.y,Math.sqrt(w.x*w.x+w.z*w.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new kr(e.vertices,e.indices,e.radius,e.details)}}class Eu extends kr{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=1/n,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],l=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,
vendor: 107,340 bytes, line 3686
368619,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,l,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Eu(e.radius,e.detail)}}const Rc=new U,Pc=new U,xf=new U,Lc=new Xn;class Pv extends dt{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const i=Math.pow(10,4),s=Math.cos(ms*t),l=e.getIndex(),c=e.getAttribute("position"),u=l?l.count:c.count,h=[0,0,0],f=["a","b","c"],p=new Array(3),m={},g=[];for(let y=0;y<u;y+=3){l?(h[0]=l.getX(y),h[1]=l.getX(y+1),h[2]=l.getX(y+2)):(h[0]=y,h[1]=y+1,h[2]=y+2);const{a:M,b:x,c:v}=Lc;if(M.fromBufferAttribute(c,h[0]),x.fromBufferAttribute(c,h[1]),v.fromBufferAttribute(c,h[2]),Lc.getNormal(xf),p[0]=`${Math.round(M.x*i)},${Math.round(M.y*i)},${Math.round(M.z*i)}`,p[1]=`${Math.round(x.x*i)},${Math.round(x.y*i)},${Math.round(x.z*i)}`,p[2]=`${Math.round(v.x*i)},${Math.round(v.y*i)},${Math.round(v.z*i)}`,!(p[0]===p[1]||p[1]===p[2]||p[2]===p[0]))for(let w=0;w<3;w++){const E=(w+1)%3,A=p[w],N=p[E],R=Lc[f[w]],L=Lc[f[E]],z=`${A}_${N}`,b=`${N}_${A}`;b in m&&m[b]?(xf.dot(m[b].normal)<=s&&(g.push(R.x,R.y,R.z),g.push(L.x,L.y,L.z)),m[b]=null):z in m||(m[z]={index0:h[w],index1:h[E],normal:xf.clone()})}}for(const y in m)if(m[y]){const{index0:M,index1:x}=m[y];Rc.fromBufferAttribute(c,M),Pc.fromBufferAttribute(c,x),g.push(Rc.x,Rc.y,Rc.z),g.push(Pc.x,Pc.y,Pc.z)}this.setAttribute("position",new Be(g,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class vs extends Da{constructor(e){super(e),this.uuid=ii(),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 Da().fromJSON(i))}return this}}const VT={triangulate:function(r,e,t=2){const n=e&&e.length,i=n?e[0]*t:r.length;let s=Lv(r,0,i,t,!0);const l=[];if(!s||s.next===s.prev)return l;let c,u,h,f,p,m,g;if(n&&(s=YT(r,e,s,t)),r.length>80*t){c=h=r[0],u=f=r[1];for(let y=t;y<i;y+=t)p=r[y],m=r[y+1],p<c&&(c=p),m<u&&(u=m),p>h&&(h=p),m>f&&(f=m);g=Math.max(h-c,f-u),g=g!==0?32767/g:0}return Na(s,l,t,c,u,g,0),l}};function Lv(r,e,t,n,i){let s,l;if(i===rA(r,e,t,n)>0)for(s=e;s<t;s+=n)l=r0(s,r[s],r[s+1],l);else for(s=t-n;s>=e;s-=n)l=r0(s,r[s],r[s+1],l);return l&&wu(l,l.next)&&(Oa(l),l=l.next),l}function Ss(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(wu(t,t.next)||Vt(t.prev,t,t.next)===0)){if(Oa(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function Na(r,e,t,n,i,s,l){if(!r)return;!l&&s&&QT(r,n,i,s);let c=r,u,h;for(;r.prev!==r.next;){if(u=r.prev,h=r.next,s?WT(r,n,i,s):GT(r)){e.push(u.i/t|0),e.push(r.i/t|0),e.push(h.i/t|0),Oa(r),r=h.next,c=h.next;continue}if(r=h,r===c){l?l===1?(r=XT(Ss(r),e,t),Na(r,e,t,n,i,s,2)):l===2&&qT(r,e,t,n,i,s):Na(Ss(r),e,t,n,i,s,1);break}}}function GT(r){const e=r.prev,t=r,n=r.next;if(Vt(e,t,n)>=0)return!1;const i=e.x,s=t.x,l=n.x,c=e.y,u=t.y,h=n.y,f=i<s?i<l?i:l:s<l?s:l,p=c<u?c<h?c:h:u<h?u:h,m=i>s?i>l?i:l:s>l?s:l,g=c>u?c>h?c:h:u>h?u:h;let y=n.next;for(;y!==e;){if(y.x>=f&&y.x<=m&&y.y>=p&&y.y<=g&&_o(i,c,s,u,l,h,y.x,y.y)&&Vt(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function WT(r,e,t,n){const i=r.prev,s=r,l=r.next;if(Vt(i,s,l)>=0)return!1;const c=i.x,u=s.x,h=l.x,f=i.y,p=s.y,m=l.y,g=c<u?c<h?c:h:u<h?u:h,y=f<p?f<m?f:m:p<m?p:m,M=c>u?c>h?c:h:u>h?u:h,x=f>p?f>m?f:m:p>m?p:m,v=wd(g,y,e,t,n),w=wd(M,x,e,t,n);let E=r.prevZ,A=r.nextZ;for(;E&&E.z>=v&&A&&A.z<=w;){if(E.x>=g&&E.x<=M&&E.y>=y&&E.y<=x&&E!==i&&E!==l&&_o(c,f,u,p,h,m,E.x,E.y)&&Vt(E.prev,E,E.next)>=0||(E=E.prevZ,A.x>=g&&A.x<=M&&A.y>=y&&A.y<=x&&A!==i&&A!==l&&_o(c,f,u,p,h,m,A.x,A.y)&&Vt(A.prev,A,A.next)>=0))return!1;A=A.nextZ}for(;E&&E.z>=v;){if(E.x>=g&&E.x<=M&&E.y>=y&&E.y<=x&&E!==i&&E!==l&&_o(c,f,u,p,h,m,E.x,E.y)&&Vt(E.prev,E,E.next)>=0)return!1;E=E.prevZ}for(;A&&A.z<=w;){if(A.x>=g&&A.x<=M&&A.y>=y&&A.y<=x&&A!==i&&A!==l&&_o(c,f,u,p,h,m,A.x,A.y)&&Vt(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function XT(r,e,t){let n=r;do{const i=n.prev,s=n.next.next;!wu(i,s)&&Iv(i,n,n.next,s)&&Ua(i,s)&&Ua(s,i)&&(e.push(i.i/t|0),e.push(n.i/t|0),e.push(s.i/t|0),Oa(n),Oa(n.next),n=r=s),n=n.next}while(n!==r);return Ss(n)}function qT(r,e,t,n,i,s){let l=r;do{let c=l.next.next;for(;c!==l.prev;){if(l.i!==c.i&&tA(l,c)){let u=Dv(l,c);l=Ss(l,l.next),u=Ss(u,u.next),Na(l,e,t,n,i,s,0),Na(u,e,t,n,i,s,0);return}c=c.next}l=l.next}while(l!==r)}function YT(r,e,t,n){const i=[];let s,l,c,u,h;for(s=0,l=e.length;s<l;s++)c=e[s]*n,u=s<l-1?e[s+1]*n:r.length,h=Lv(r,c,u,n,!1),h===h.next&&(h.steiner=!0),i.push(eA(h));for(i.sort(ZT),s=0;s<i.length;s++)t=JT(i[s],t);return t}function ZT(r,e){return r.x-e.x}function JT(r,e){const t=jT(r,e);if(!t)return e;const n=Dv(t,r);return Ss(n,n.next),Ss(t,t.next)}function jT(r,e){let t=e,n=-1/0,i;const s=r.x,l=r.y;do{if(l<=t.y&&l>=t.next.y&&t.next.y!==t.y){const m=t.x+(l-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(m<=s&&m>n&&(n=m,i=t.x<t.next.x?t:t.next,m===s))return i}t=t.next}while(t!==e);if(!i)return null;const c=i,u=i.x,h=i.y;let f=1/0,p;t=i;do s>=t.x&&t.x>=u&&s!==t.x&&_o(l<h?s:n,l,u,h,l<h?n:s,l,t.x,t.y)&&(p=Math.abs(l-t.y)/(s-t.x),Ua(t,r)&&(p<f||p===f&&(t.x>i.x||t.x===i.x&&KT(i,t)))&&(i=t,f=p)),t=t.next;while(t!==c);return i}function KT(r,e){return Vt(r.prev,r,e.prev)<0&&Vt(e.next,r,r.next)<0}function QT(r,e,t,n){let i=r;do i.z===0&&(i.z=wd(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,$T(i)}function $T(r){let e,t,n,i,s,l,c,u,h=1;do{for(t=r,r=null,s=null,l=0;t;){for(l++,n=t,c=0,e=0;e<h&&(c++,n=n.nextZ,!!n);e++);for(u=h;c>0||u>0&&n;)c!==0&&(u===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,c--):(i=n,n=n.nextZ,u--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,h*=2}while(l>1);return r}function wd(r,e,t,n,i){return r=(r-t)*i|0,e=(e-n)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function eA(r){let e=r,t=r;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==r);return t}function _o(r,e,t,n,i,s,l,c){return(i-l)*(e-c)>=(r-l)*(s-c)&&(r-l)*(n-c)>=(t-l)*(e-c)&&(t-l)*(s-c)>=(i-l)*(n-c)}function tA(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!nA(r,e)&&(Ua(r,e)&&Ua(e,r)&&iA(r,e)&&(Vt(r.prev,r,e.prev)||Vt(r,e.prev,e))||wu(r,e)&&Vt(r.prev,r,r.next)>0&&Vt(e.prev,e,e.next)>0)}function Vt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function wu(r,e){return r.x===e.x&&r.y===e.y}function Iv(r,e,t,n){const i=Dc(Vt(r,e,t)),s=Dc(Vt(r,e,n)),l=Dc(Vt(t,n,r)),c=Dc(Vt(t,n,e));return!!(i!==s&&l!==c||i===0&&Ic(r,t,e)||s===0&&Ic(r,n,e)||l===0&&Ic(t,r,n)||c===0&&Ic(t,e,n))}function Ic(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function Dc(r){return r>0?1:r<0?-1:0}function nA(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Iv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function Ua(r,e){return Vt(r.prev,r,r.next)<0?Vt(r,e,r.next)>=0&&Vt(r,r.prev,e)>=0:Vt(r,e,r.prev)<0||Vt(r,r.next,e)<0}function iA(r,e){let t=r,n=!1;const i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Dv(r,e){const t=new Td(r.i,r.x,r.y),n=new Td(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function r0(r,e,t,n){const i=new Td(r,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 Oa(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Td(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function rA(r,e,t,n){let i=0;for(let s=e,l=t-n;s<t;s+=n)i+=(r[l]-r[s])*(r[s+1]+r[l+1]),l=s;return i}class Hi{static area(e){const t=e.length;let n=0;for(let i=t-1,s=0;s<t;i=s++)n+=e[i].x*e[s].y-e[s].x*e[i].y;return n*.5}static isClockWise(e){return Hi.area(e)<0}static triangulateShape(e,t){const n=[],i=[],s=[];s0(e),o0(n,e);let l=e.length;t.forEach(s0);for(let u=0;u<t.length;u++)i.push(l),l+=t[u].length,o0(n,t[u]);const c=VT.triangulate(n,i);for(let u=0;u<c.length;u+=3)s.push(c.slice(u,u+3));return s}}function s0(r){const e=r.length;e>2&&r[e-1].equals(r[0])&&r.pop()}function o0(r,e){for(let t=0;t<e.length;t++)r.push(e[t].x),r.push(e[t].y)}class Tu extends dt{constructor(e=new vs([new fe(.5,.5),new fe(-.5,.5),new fe(-.5,-.5),new fe(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,i=[],s=[];for(let c=0,u=e.length;c<u;c++){const h=e[c];l(h)}this.setAttribute("position",new Be(i,3)),this.setAttribute("uv",new Be(s,2)),this.computeVertexNormals();function l(c){const u=[],h=t.curveSegments!==void 0?t.curveSegments:12,f=t.steps!==void 0?t.steps:1,p=t.depth!==void 0?t.depth:1;let m=t.bevelEnabled!==void 0?t.bevelEnabled:!0,g=t.bevelThickness!==void 0?t.bevelThickness:.2,y=t.bevelSize!==void 0?t.bevelSize:g-.1,M=t.bevelOffset!==void 0?t.bevelOffset:0,x=t.bevelSegments!==void 0?t.bevelSegments:3;const v=t.extrudePath,w=t.UVGenerator!==void 0?t.UVGenerator:sA;let E,A=!1,N,R,L,z;v&&(E=v.getSpacedPoints(f),A=!0,m=!1,N=v.computeFrenetFrames(f,!1),R=new U,L=new U,z=new U),m||(x=0,g=0,y=0,M=0);const b=c.extractPoints(h);let P=b.shape;const B=b.holes;if(!Hi.isClockWise(P)){P=P.reverse();for(let k=0,_e=B.length;k<_e;k++){const he=B[k];Hi.isClockWise(he)&&(B[k]=he.reverse())}}const ce=Hi.triangulateShape(P,B),V=P;for(let k=0,_e=B.length;k<_e;k++){const he=B[k];P=P.concat(he)}function J(k,_e,he){return _e||console.error("THREE.ExtrudeGeometry: vec does not exist"),k.clone().addScaledVector(_e,he)}const ee=P.length,le=ce.length;function F(k,_e,he){let ve,ue,We;const Pe=k.x-_e.x,I=k.y-_e.y,C=he.x-k.x,K=he.y-k.y,ge=Pe*Pe+I*I,pe=Pe*K-I*C;if(Math.abs(pe)>Number.EPSILON){const de=Math.sqrt(ge),ze=Math.sqrt(C*C+K*K),we=_e.x-I/de,De=_e.y+Pe/de,Je=he.x-K/ze,at=he.y+C/ze,me=((Je-we)*K-(at-De)*C)/(Pe*K-I*C);ve=we+Pe*me-k.x,ue=De+I*me-k.y;const xt=ve*ve+ue*ue;if(xt<=2)return new fe(ve,ue);We=Math.sqrt(xt/2)}else{let de=!1;Pe>Number.EPSILON?C>Number.EPSILON&&(de=!0):Pe<-Number.EPSILON?C<-Number.EPSILON&&(de=!0):Math.sign(I)===Math.sign(K)&&(de=!0),de?(ve=-I,ue=Pe,We=Math.sqrt(ge)):(ve=Pe,ue=I,We=Math.sqrt(ge/2))}return new fe(ve/We,ue/We)}const H=[];for(let k=0,_e=V.length,he=_e-1,ve=k+1;k<_e;k++,he++,ve++)he===_e&&(he=0),ve===_e&&(ve=0),H[k]=F(V[k],V[he],V[ve]);const W=[];let Y,oe=H.concat();for(let k=0,_e=B.length;k<_e;k++){const he=B[k];Y=[];for(let ve=0,ue=he.length,We=ue-1,Pe=ve+1;ve<ue;ve++,We++,Pe++)We===ue&&(We=0),Pe===ue&&(Pe=0),Y[ve]=F(he[ve],he[We],he[Pe]);W.push(Y),oe=oe.concat(Y)}for(let k=0;k<x;k++){const _e=k/x,he=g*Math.cos(_e*Math.PI/2),ve=y*Math.sin(_e*Math.PI/2)+M;for(let ue=0,We=V.length;ue<We;ue++){const Pe=J(V[ue],H[ue],ve);Ee(Pe.x,Pe.y,-he)}for(let ue=0,We=B.length;ue<We;ue++){const Pe=B[ue];Y=W[ue];for(let I=0,C=Pe.length;I<C;I++){const K=J(Pe[I],Y[I],ve);Ee(K.x,K.y,-he)}}}const j=y+M;for(let k=0;k<ee;k++){const _e=m?J(P[k],oe[k],j):P[k];A?(L.copy(N.normals[0]).multiplyScalar(_e.x),R.copy(N.binormals[0]).multiplyScalar(_e.y),z.copy(E[0]).add(L).add(R),Ee(z.x,z.y,z.z)):Ee(_e.x,_e.y,0)}for(let k=1;k<=f;k++)for(let _e=0;_e<ee;_e++){const he=m?J(P[_e],oe[_e],j):P[_e];A?(L.copy(N.normals[k]).multiplyScalar(he.x),R.copy(N.binormals[k]).multiplyScalar(he.y),z.copy(E[k]).add(L).add(R),Ee(z.x,z.y,z.z)):Ee(he.x,he.y,p/f*k)}for(let k=x-1;k>=0;k--){const _e=k/x,he=g*Math.cos(_e*Math.PI/2),ve=y*Math.sin(_e*Math.PI/2)+M;for(let ue=0,We=V.length;ue<We;ue++){const Pe=J(V[ue],H[ue],ve);Ee(Pe.x,Pe.y,p+he)}for(let ue=0,We=B.length;ue<We;ue++){const Pe=B[ue];Y=W[ue];for(let I=0,C=Pe.length;I<C;I++){const K=J(Pe[I],Y[I],ve);A?Ee(K.x,K.y+E[f-1].y,E[f-1].x+he):Ee(K.x,K.y,p+he)}}}ae(),xe();function ae(){const k=i.length/3;if(m){let _e=0,he=ee*_e;for(let ve=0;ve<le;ve++){const ue=ce[ve];et(ue[2]+he,ue[1]+he,ue[0]+he)}_e=f+x*2,he=ee*_e;for(let ve=0;ve<le;ve++){const ue=ce[ve];et(ue[0]+he,ue[1]+he,ue[2]+he)}}else{for(let _e=0;_e<le;_e++){const he=ce[_e];et(he[2],he[1],he[0])}for(let _e=0;_e<le;_e++){const he=ce[_e];et(he[0]+ee*f,he[1]+ee*f,he[2]+ee*f)}}n.addGroup(k,i.length/3-k,0)}function xe(){const k=i.length/3;let _e=0;Te(V,_e),_e+=V.length;for(let he=0,ve=B.length;he<ve;he++){const ue=B[he];Te(ue,_e),_e+=ue.length}n.addGroup(k,i.length/3-k,1)}function Te(k,_e){let he=k.length;for(;--he>=0;){const ve=he;let ue=he-1;ue<0&&(ue=k.length-1);for(let We=0,Pe=f+x*2;We<Pe;We++){const I=ee*We,C=ee*(We+1),K=_e+ve+I,ge=_e+ue+I,pe=_e+ue+C,de=_e+ve+C;nt(K,ge,pe,de)}}}function Ee(k,_e,he){u.push(k),u.push(_e),u.push(he)}function et(k,_e,he){Fe(k),Fe(_e),Fe(he);const ve=i.length/3,ue=w.generateTopUV(n,i,ve-3,ve-2,ve-1);Xe(ue[0]),Xe(ue[1]),Xe(ue[2])}function nt(k,_e,he,ve){Fe(k),Fe(_e),Fe(ve),Fe(_e),Fe(he),Fe(ve);const ue=i.length/3,We=w.generateSideWallUV(n,i,ue-6,ue-3,ue-2,ue-1);Xe(We[0]),Xe(We[1]),Xe(We[3]),Xe(We[1]),Xe(We[2]),Xe(We[3])}function Fe(k){i.push(u[k*3+0]),i.push(u[k*3+1]),i.push(u[k*3+2])}function Xe(k){s.push(k.x),s.push(k.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 oA(t,n,e)}static fromJSON(e,t){const n=[];for(let s=0,l=e.shapes.length;s<l;s++){const c=t[e.shapes[s]];n.push(c)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new ru[i.type]().fromJSON(i)),new Tu(n,e.options)}}const sA={generateTopUV:function(r,e,t,n,i){const s=e[t*3],l=e[t*3+1],c=e[n*3],u=e[n*3+1],h=e[i*3],f=e[i*3+1];return[new fe(s,l),new fe(c,u),new fe(h,f)]},generateSideWallUV:function(r,e,t,n,i,s){const l=e[t*3],c=e[t*3+1],u=e[t*3+2],h=e[n*3],f=e[n*3+1],p=e[n*3+2],m=e[i*3],g=e[i*3+1],y=e[i*3+2],M=e[s*3],x=e[s*3+1],v=e[s*3+2];return Math.abs(c-f)<Math.abs(l-h)?[new fe(l,1-u),new fe(h,1-p),new fe(m,1-y),new fe(M,1-v)]:[new fe(c,1-u),new fe(f,1-p),new fe(g,1-y),new fe(x,1-v)]}};function oA(r,e,t){if(t.shapes=[],Array.isArray(r))for(let n=0,i=r.length;n<i;n++){const s=r[n];t.shapes.push(s.uuid)}else t.shapes.push(r.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class Au extends kr{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(i,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Au(e.radius,e.detail)}}class ja extends kr{constructor(e=1,t=0){const n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(n,i,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ja(e.radius,e.detail)}}class bu extends dt{constructor(e=.5,t=1,n=32,i=1,s=0,l=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:s,thetaLength:l},n=Math.max(3,n),i=Math.max(1,i);const c=[],u=[],h=[],f=[];let p=e;const m=(t-e)/i,g=new U,y=new fe;for(let M=0;M<=i;M++){for(let x=0;x<=n;x++){const v=s+x/n*l;g.x=p*Math.cos(v),g.y=p*Math.sin(v),u.push(g.x,g.y,g.z),h.push(0,0,1),y.x=(g.x/t+1)/2,y.y=(g.y/t+1)/2,f.push(y.x,y.y)}p+=m}for(let M=0;M<i;M++){const x=M*(n+1);for(let v=0;v<n;v++){const w=v+x,E=w,A=w+n+1,N=w+n+2,R=w+1;c.push(E,A,R),c.push(A,N,R)}}this.setIndex(c),this.setAttribute("position",new Be(u,3)),this.setAttribute("normal",new Be(h,3)),this.setAttribute("uv",new Be(f,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new bu(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Cu extends dt{constructor(e=new vs([new fe(0,.5),new fe(-.5,-.5),new fe(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],i=[],s=[],l=[];let c=0,u=0;if(Array.isArray(e)===!1)h(e);else for(let f=0;f<e.length;f++)h(e[f]),this.addGroup(c,u,f),c+=u,u=0;this.setIndex(n),this.setAttribute("position",new Be(i,3)),this.setAttribute("normal",new Be(s,3)),this.setAttribute("uv",new Be(l,2));function h(f){const p=i.length/3,m=f.extractPoints(t);let g=m.shape;const y=m.holes;Hi.isClockWise(g)===!1&&(g=g.reverse());for(let x=0,v=y.length;x<v;x++){const w=y[x];Hi.isClockWise(w)===!0&&(y[x]=w.reverse())}const M=Hi.triangulateShape(g,y);for(let x=0,v=y.length;x<v;x++){const w=y[x];g=g.concat(w)}for(let x=0,v=g.length;x<v;x++){const w=g[x];i.push(w.x,w.y,0),s.push(0,0,1),l.push(w.x,w.y)}for(let x=0,v=M.length;x<v;x++){const w=M[x],E=w[0]+p,A=w[1]+p,N=w[2]+p;n.push(E,A,N),u+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return aA(t,e)}static fromJSON(e,t){const n=[];for(let i=0,s=e.shapes.length;i<s;i++){const l=t[e.shapes[i]];n.push(l)}return new Cu(n,e.curveSegments)}}function aA(r,e){if(e.shapes=[],Array.isArray(r))for(let t=0,n=r.length;t<n;t++){const i=r[t];e.shapes.push(i.uuid)}else e.shapes.push(r.uuid);return e}class Ka extends dt{constructor(e=1,t=32,n=16,i=0,s=Math.PI*2,l=0,c=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:s,thetaStart:l,thetaLength:c},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const u=Math.min(l+c,Math.PI);let h=0;const f=[],p=new U,m=new U,g=[],y=[],M=[],x=[];for(let v=0;v<=n;v++){const w=[],E=v/n;let A=0;v===0&&l===0?A=.5/t:v===n&&u===Math.PI&&(A=-.5/t);for(let N=0;N<=t;N++){const R=N/t;p.x=-e*Math.cos(i+R*s)*Math.sin(l+E*c),p.y=e*Math.cos(l+E*c),p.z=e*Math.sin(i+R*s)*Math.sin(l+E*c),y.push(p.x,p.y,p.z),m.copy(p).normalize(),M.push(m.x,m.y,m.z),x.push(R+A,1-E),w.push(h++)}f.push(w)}for(let v=0;v<n;v++)for(let w=0;w<t;w++){const E=f[v][w+1],A=f[v][w],N=f[v+1][w],R=f[v+1][w+1];(v!==0||l>0)&&g.push(E,A,R),(v!==n-1||u<Math.PI)&&g.push(A,N,R)}this.setIndex(g),this.setAttribute("position",new Be(y,3)),this.setAttribute("normal",new Be(M,3)),this.setAttribute("uv",new Be(x,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ka(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Ru extends kr{constructor(e=1,t=0){const n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];super(n,i,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Ru(e.radius,e.detail)}}class Pu extends dt{constructor(e=1,t=.4,n=12,i=48,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:s},n=Math.floor(n),i=Math.floor(i);const l=[],c=[],u=[],h=[],f=new U,p=new U,m=new U;for(let g=0;g<=n;g++)for(let y=0;y<=i;y++){const M=y/i*s,x=g/n*Math.PI*2;p.x=(e+t*Math.cos(x))*Math.cos(M),p.y=(e+t*Math.cos(x))*Math.sin(M),p.z=t*Math.sin(x),c.push(p.x,p.y,p.z),f.x=e*Math.cos(M),f.y=e*Math.sin(M),m.subVectors(p,f).normalize(),u.push(m.x,m.y,m.z),h.push(y/i),h.push(g/n)}for(let g=1;g<=n;g++)for(let y=1;y<=i;y++){const M=(i+1)*g+y-1,x=(i+1)*(g-1)+y-1,v=(i+1)*(g-1)+y,w=(i+1)*g+y;l.push(M,x,w),l.push(x,v,w)}this.setIndex(l),this.setAttribute("position",new Be(c,3)),this.setAttribute("normal",new Be(u,3)),this.setAttribute("uv",new Be(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Pu(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Lu extends dt{constructor(e=1,t=.4,n=64,i=8,s=2,l=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:s,q:l},n=Math.floor(n),i=Math.floor(i);const c=[],u=[],h=[],f=[],p=new U,m=new U,g=new U,y=new U,M=new U,x=new U,v=new U;for(let E=0;E<=n;++E){const A=E/n*s*Math.PI*2;w(A,s,l,e,g),w(A+.01,s,l,e,y),x.subVectors(y,g),v.addVectors(y,g),M.crossVectors(x,v),v.crossVectors(M,x),M.normalize(),v.normalize();for(let N=0;N<=i;++N){const R=N/i*Math.PI*2,L=-t*Math.cos(R),z=t*Math.sin(R);p.x=g.x+(L*v.x+z*M.x),p.y=g.y+(L*v.y+z*M.y),p.z=g.z+(L*v.z+z*M.z),u.push(p.x,p.y,p.z),m.subVectors(p,g).normalize(),h.push(m.x,m.y,m.z),f.push(E/n),f.push(N/i)}}for(let E=1;E<=n;E++)for(let A=1;A<=i;A++){const N=(i+1)*(E-1)+(A-1),R=(i+1)*E+(A-1),L=(i+1)*E+A,z=(i+1)*(E-1)+A;c.push(N,R,z),c.push(R,L,z)}this.setIndex(c),this.setAttribute("position",new Be(u,3)),this.setAttribute("normal",new Be(h,3)),this.setAttribute("uv",new Be(f,2));function w(E,A,N,R,L){const z=Math.cos(E),b=Math.sin(E),P=N/A*E,B=Math.cos(P);L.x=R*(2+B)*.5*z,L.y=R*(2+B)*b*.5,L.z=R*Math.sin(P)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Lu(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Iu extends dt{constructor(e=new ap(new U(-1,-1,0),new U(-1,1,0),new U(1,1,0)),t=64,n=1,i=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:s};const l=e.computeFrenetFrames(t,s);this.tangents=l.tangents,this.normals=l.normals,this.binormals=l.binormals;const c=new U,u=new U,h=new fe;let f=new U;const p=[],m=[],g=[],y=[];M(),this.setIndex(y),this.setAttribute("position",new Be(p,3)),this.setAttribute("normal",new Be(m,3)),this.setAttribute("uv",new Be(g,2));function M(){for(let E=0;E<t;E++)x(E);x(s===!1?t:0),w(),v()}function x(E){f=e.getPointAt(E/t,f);const A=l.normals[E],N=l.binormals[E];for(let R=0;R<=i;R++){const L=R/i*Math.PI*2,z=Math.sin(L),b=-Math.cos(L);u.x=b*A.x+z*N.x,u.y=b*A.y+z*N.y,u.z=b*A.z+z*N.z,u.normalize(),m.push(u.x,u.y,u.z),c.x=f.x+n*u.x,c.y=f.y+n*u.y,c.z=f.z+n*u.z,p.push(c.x,c.y,c.z)}}function v(){for(let E=1;E<=t;E++)for(let A=1;A<=i;A++){const N=(i+1)*(E-1)+(A-1),R=(i+1)*E+(A-1),L=(i+1)*E+A,z=(i+1)*(E-1)+A;y.push(N,R,z),y.push(R,L,z)}}function w(){for(let E=0;E<=t;E++)for(let A=0;A<=i;A++)h.x=E/t,h.y=A/i,g.push(h.x,h.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Iu(new ru[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Nv extends dt{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,i=new U,s=new U;if(e.index!==null){const l=e.attributes.position,c=e.index;let u=e.groups;u.length===0&&(u=[{start:0,count:c.count,materialIndex:0}]);for(let h=0,f=u.length;h<f;++h){const p=u[h],m=p.start,g=p.count;for(let y=m,M=m+g;y<M;y+=3)for(let x=0;x<3;x++){const v=c.getX(y+x),w=c.getX(y+(x+1)%3);i.fromBufferAttribute(l,v),s.fromBufferAttribute(l,w),a0(i,s,n)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}}else{const l=e.attributes.position;for(let c=0,u=l.count/3;c<u;c++)for(let h=0;h<3;h++){const f=3*c+h,p=3*c+(h+1)%3;i.fromBufferAttribute(l,f),s.fromBufferAttribute(l,p),a0(i,s,n)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new Be(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function a0(r,e,t){const n=`${r.x},${r.y},${r.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${r.x},${r.y},${r.z}`;return t.has(n)===!0||t.has(i)===!0?!1:(t.add(n),t.add(i),!0)}var l0=Object.freeze({__proto__:null,BoxGeometry:Ms,CapsuleGeometry:xu,CircleGeometry:Su,ConeGeometry:Mu,CylinderGeometry:Ro,DodecahedronGeometry:Eu,EdgesGeometry:Pv,ExtrudeGeometry:Tu,IcosahedronGeometry:Au,LatheGeometry:Ja,OctahedronGeometry:ja,PlaneGeometry:Ya,PolyhedronGeometry:kr,RingGeometry:bu,ShapeGeometry:Cu,SphereGeometry:Ka,TetrahedronGeometry:Ru,TorusGeometry:Pu,TorusKnotGeometry:Lu,TubeGeometry:Iu,WireframeGeometry:Nv});class Uv extends In{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Ie(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class Ov extends Gi{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class cp extends In{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ie(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 Ie(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(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.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 Fv extends cp{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 fe(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return qt(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 Ie(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 Ie(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ie(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=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 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.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 Bv extends In{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ie(16777215),this.specular=new Ie(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ie(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Ha,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,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.flatShading=e.flatShading,this.fog=e.fog,this}}class zv extends In{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ie(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ie(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,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.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class kv extends In{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new fe(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 Hv extends In{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ie(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ie(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Ha,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(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.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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,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.flatShading=e.flatShading,this.fog=e.fog,this}}class Vv extends In{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ie(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Br,this.normalScale=new fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,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.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Gv extends kn{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function ds(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function Wv(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function Xv(r){function e(i,s){return r[i]-r[s]}const t=r.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function Ad(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,l=0;l!==n;++s){const c=t[s]*e;for(let u=0;u!==e;++u)i[l++]=r[c+u]}return i}function up(r,e,t,n){let i=1,s=r[0];for(;s!==void 0&&s[n]===void 0;)s=r[i++];if(s===void 0)return;let l=s[n];if(l!==void 0)if(Array.isArray(l))do l=s[n],l!==void 0&&(e.push(s.time),t.push.apply(t,l)),s=r[i++];while(s!==void 0);else if(l.toArray!==void 0)do l=s[n],l!==void 0&&(e.push(s.time),l.toArray(t,t.length)),s=r[i++];while(s!==void 0);else do l=s[n],l!==void 0&&(e.push(s.time),t.push(l)),s=r[i++];while(s!==void 0)}function lA(r,e,t,n,i=30){const s=r.clone();s.name=e;const l=[];for(let u=0;u<s.tracks.length;++u){const h=s.tracks[u],f=h.getValueSize(),p=[],m=[];for(let g=0;g<h.times.length;++g){const y=h.times[g]*i;if(!(y<t||y>=n)){p.push(h.times[g]);for(let M=0;M<f;++M)m.push(h.values[g*f+M])}}p.length!==0&&(h.times=ds(p,h.times.constructor),h.values=ds(m,h.values.constructor),l.push(h))}s.tracks=l;let c=1/0;for(let u=0;u<s.tracks.length;++u)c>s.tracks[u].times[0]&&(c=s.tracks[u].times[0]);for(let u=0;u<s.tracks.length;++u)s.tracks[u].shift(-1*c);return s.resetDuration(),s}function cA(r,e=0,t=r,n=30){n<=0&&(n=30);const i=t.tracks.length,s=e/n;for(let l=0;l<i;++l){const c=t.tracks[l],u=c.ValueTypeName;if(u==="bool"||u==="string")continue;const h=r.tracks.find(function(v){return v.name===c.name&&v.ValueTypeName===u});if(h===void 0)continue;let f=0;const p=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=p/3);let m=0;const g=h.getValueSize();h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(m=g/3);const y=c.times.length-1;let M;if(s<=c.times[0]){const v=f,w=p-f;M=c.values.slice(v,w)}else if(s>=c.times[y]){const v=y*p+f,w=v+p-f;M=c.values.slice(v,w)}else{const v=c.createInterpolant(),w=f,E=p-f;v.evaluate(s),M=v.resultBuffer.slice(w,E)}u==="quaternion"&&new Yn().fromArray(M).normalize().conjugate().toArray(M);const x=h.times.length;for(let v=0;v<x;++v){const w=v*g+m;if(u==="quaternion")Yn.multiplyQuaternionsFlat(h.values,w,M,0,h.values,w);else{const E=g-m*2;for(let A=0;A<E;++A)h.values[w+A]-=M[A]}}}return r.blendMode=kd,r}const uA={convertArray:ds,isTypedArray:Wv,getKeyframeOrder:Xv,sortedArray:Ad,flattenJSON:up,subclip:lA,makeClipAdditive:cA};class Qa{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],s=t[n-1];e:{t:{let l;n:{i:if(!(e<i)){for(let c=n+2;;){if(i===void 0){if(e<s)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===c)break;if(s=i,i=t[++n],e<i)break t}l=t.length;break n}if(!(e>=s)){const c=t[1];e<c&&(n=2,s=c);for(let u=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===u)break;if(i=s,s=t[--n-1],e>=s)break t}l=n,n=0;break n}break e}for(;n<l;){const c=n+l>>>1;e<t[c]?l=c:n=c+1}if(i=t[n],s=t[n-1],s===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,s,i)}return this.interpolate_(n,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i;for(let l=0;l!==i;++l)t[l]=n[s+l];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class qv extends Qa{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:us,endingEnd:us}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,l=e+1,c=i[s],u=i[l];if(c===void 0)switch(this.getSettings_().endingStart){case hs:s=e,c=2*t-n;break;case ba:s=i.length-2,c=t+i[s]-i[s+1];break;default:s=e,c=n}if(u===void 0)switch(this.getSettings_().endingEnd){case hs:l=e,u=2*n-t;break;case ba:l=1,u=n+i[1]-i[0];break;default:l=e-1,u=t}const h=(n-t)*.5,f=this.valueSize;this._weightPrev=h/(t-c),this._weightNext=h/(u-n),this._offsetPrev=s*f,this._offsetNext=l*f}interpolate_(e,t,n,i){const s=this.resultBuffer,l=this.sampleValues,c=this.valueSize,u=e*c,h=u-c,f=this._offsetPrev,p=this._offsetNext,m=this._weightPrev,g=this._weightNext,y=(n-t)/(i-t),M=y*y,x=M*y,v=-m*x+2*m*M-m*y,w=(1+m)*x+(-1.5-2*m)*M+(-.5+m)*y+1,E=(-1-g)*x+(1.5+g)*M+.5*y,A=g*x-g*M;for(let N=0;N!==c;++N)s[N]=v*l[f+N]+w*l[h+N]+E*l[u+N]+A*l[p+N];return s}}class hp extends Qa{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,l=this.sampleValues,c=this.valueSize,u=e*c,h=u-c,f=(n-t)/(i-t),p=1-f;for(let m=0;m!==c;++m)s[m]=l[h+m]*p+l[u+m]*f;return s}}class Yv extends Qa{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Ci{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=ds(t,this.TimeBufferType),this.values=ds(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:ds(e.times,Array),values:ds(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new Yv(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new hp(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new qv(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Ta:t=this.InterpolantFactoryMethodDiscrete;break;case Aa:t=this.InterpolantFactoryMethodLinear;break;case jc:t=this.InterpolantFactoryMethodSmooth;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 console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Ta;case this.InterpolantFactoryMethodLinear:return Aa;case this.InterpolantFactoryMethodSmooth:return jc}}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 s=0,l=i-1;for(;s!==i&&n[s]<e;)++s;for(;l!==-1&&n[l]>t;)--l;if(++l,s!==0||l!==i){s>=l&&(l=Math.max(l,1),s=l-1);const c=this.getValueSize();this.times=n.slice(s,l),this.values=this.values.slice(s*c,l*c)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let c=0;c!==s;c++){const u=n[c];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,c,u),e=!1;break}if(l!==null&&l>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,c,u,l),e=!1;break}l=u}if(i!==void 0&&Wv(i))for(let c=0,u=i.length;c!==u;++c){const h=i[c];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,c,h),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===jc,s=e.length-1;let l=1;for(let c=1;c<s;++c){let u=!1;const h=e[c],f=e[c+1];if(h!==f&&(c!==1||h!==e[0]))if(i)u=!0;else{const p=c*n,m=p-n,g=p+n;for(let y=0;y!==n;++y){const M=t[p+y];if(M!==t[m+y]||M!==t[g+y]){u=!0;break}}}if(u){if(c!==l){e[l]=e[c];const p=c*n,m=l*n;for(let g=0;g!==n;++g)t[m+g]=t[p+g]}++l}}if(s>0){e[l]=e[s];for(let c=s*n,u=l*n,h=0;h!==n;++h)t[u+h]=t[c+h];++l}return l!==e.length?(this.times=e.slice(0,l),this.values=t.slice(0,l*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}}Ci.prototype.TimeBufferType=Float32Array;Ci.prototype.ValueBufferType=Float32Array;Ci.prototype.DefaultInterpolation=Aa;class Es extends Ci{}Es.prototype.ValueTypeName="bool";Es.prototype.ValueBufferType=Array;Es.prototype.DefaultInterpolation=Ta;Es.prototype.InterpolantFactoryMethodLinear=void 0;Es.prototype.InterpolantFactoryMethodSmooth=void 0;class fp extends Ci{}fp.prototype.ValueTypeName="color";class Fa extends Ci{}Fa.prototype.ValueTypeName="number";class Zv extends Qa{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,l=this.sampleValues,c=this.valueSize,u=(n-t)/(i-t);let h=e*c;for(let f=h+c;h!==f;h+=4)Yn.slerpFlat(s,0,l,h-c,l,h,u);return s}}class Po extends Ci{InterpolantFactoryMethodLinear(e){return new Zv(this.times,this.values,this.getValueSize(),e)}}Po.prototype.ValueTypeName="quaternion";Po.prototype.DefaultInterpolation=Aa;Po.prototype.InterpolantFactoryMethodSmooth=void 0;class ws extends Ci{}ws.prototype.ValueTypeName="string";ws.prototype.ValueBufferType=Array;ws.prototype.DefaultInterpolation=Ta;ws.prototype.InterpolantFactoryMethodLinear=void 0;ws.prototype.InterpolantFactoryMethodSmooth=void 0;class Ba extends Ci{}Ba.prototype.ValueTypeName="vector";class za{constructor(e,t=-1,n,i=uu){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=ii(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let l=0,c=n.length;l!==c;++l)t.push(fA(n[l]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,l=n.length;s!==l;++s)t.push(Ci.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,l=[];for(let c=0;c<s;c++){let u=[],h=[];u.push((c+s-1)%s,c,(c+1)%s),h.push(0,1,0);const f=Xv(u);u=Ad(u,1,f),h=Ad(h,1,f),!i&&u[0]===0&&(u.push(s),h.push(h[0])),l.push(new Fa(".morphTargetInfluences["+t[c].name+"]",u,h).scale(1/n))}return new this(e,-1,l)}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={},s=/^([\w-]*?)([\d]+)$/;for(let c=0,u=e.length;c<u;c++){const h=e[c],f=h.name.match(s);if(f&&f.length>1){const p=f[1];let m=i[p];m||(i[p]=m=[]),m.push(h)}}const l=[];for(const c in i)l.push(this.CreateFromMorphTargetSequence(c,i[c],t,n));return l}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(p,m,g,y,M){if(g.length!==0){const x=[],v=[];up(g,x,v,y),x.length!==0&&M.push(new p(m,x,v))}},i=[],s=e.name||"default",l=e.fps||30,c=e.blendMode;let u=e.length||-1;const h=e.hierarchy||[];for(let p=0;p<h.length;p++){const m=h[p].keys;if(!(!m||m.length===0))if(m[0].morphTargets){const g={};let y;for(y=0;y<m.length;y++)if(m[y].morphTargets)for(let M=0;M<m[y].morphTargets.length;M++)g[m[y].morphTargets[M]]=-1;for(const M in g){const x=[],v=[];for(let w=0;w!==m[y].morphTargets.length;++w){const E=m[y];x.push(E.time),v.push(E.morphTarget===M?1:0)}i.push(new Fa(".morphTargetInfluence["+M+"]",x,v))}u=g.length*l}else{const g=".bones["+t[p].name+"]";n(Ba,g+".position",m,"pos",i),n(Po,g+".quaternion",m,"rot",i),n(Ba,g+".scale",m,"scl",i)}}return i.length===0?null:new this(s,u,i,c)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const s=this.tracks[n];t=Math.max(t,s.times[s.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 t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function hA(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Fa;case"vector":case"vector2":case"vector3":case"vector4":return Ba;case"color":return fp;case"quaternion":return Po;case"bool":case"boolean":return Es;case"string":return ws}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+r)}function fA(r){if(r.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=hA(r.type);if(r.times===void 0){const t=[],n=[];up(r.keys,t,n,"value"),r.times=t,r.values=n}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)}const sr={enabled:!1,files:{},add:function(r,e){this.enabled!==!1&&(this.files[r]=e)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}};class dp{constructor(e,t,n){const i=this;let s=!1,l=0,c=0,u;const h=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(f){c++,s===!1&&i.onStart!==void 0&&i.onStart(f,l,c),s=!0},this.itemEnd=function(f){l++,i.onProgress!==void 0&&i.onProgress(f,l,c),l===c&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(f){i.onError!==void 0&&i.onError(f)},this.resolveURL=function(f){return u?u(f):f},this.setURLModifier=function(f){return u=f,this},this.addHandler=function(f,p){return h.push(f,p),this},this.removeHandler=function(f){const p=h.indexOf(f);return p!==-1&&h.splice(p,2),this},this.getHandler=function(f){for(let p=0,m=h.length;p<m;p+=2){const g=h[p],y=h[p+1];if(g.global&&(g.lastIndex=0),g.test(f))return y}return null}}}const Jv=new dp;class Zn{constructor(e){this.manager=e!==void 0?e:Jv,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,s){n.load(e,i,t,s)})}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}}Zn.DEFAULT_MATERIAL_NAME="__DEFAULT";const nr={};class dA extends Error{constructor(e,t){super(e),this.response=t}}class cr extends Zn{constructor(e){super(e)}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=sr.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(nr[e]!==void 0){nr[e].push({onLoad:t,onProgress:n,onError:i});return}nr[e]=[],nr[e].push({onLoad:t,onProgress:n,onError:i});const l=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),c=this.mimeType,u=this.responseType;fetch(l).then(h=>{if(h.status===200||h.status===0){if(h.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||h.body===void 0||h.body.getReader===void 0)return h;const f=nr[e],p=h.body.getReader(),m=h.headers.get("Content-Length")||h.headers.get("X-File-Size"),g=m?parseInt(m):0,y=g!==0;let M=0;const x=new ReadableStream({start(v){w();function w(){p.read().then(({done:E,value:A})=>{if(E)v.close();else{M+=A.byteLength;const N=new ProgressEvent("progress",{lengthComputable:y,loaded:M,total:g});for(let R=0,L=f.length;R<L;R++){const z=f[R];z.onProgress&&z.onProgress(N)}v.enqueue(A),w()}})}}});return new Response(x)}else throw new dA(`fetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}).then(h=>{switch(u){case"arraybuffer":return h.arrayBuffer();case"blob":return h.blob();case"document":return h.text().then(f=>new DOMParser().parseFromString(f,c));case"json":return h.json();default:if(c===void 0)return h.text();{const p=/charset="?([^;"\s]*)"?/i.exec(c),m=p&&p[1]?p[1].toLowerCase():void 0,g=new TextDecoder(m);return h.arrayBuffer().then(y=>g.decode(y))}}}).then(h=>{sr.add(e,h);const f=nr[e];delete nr[e];for(let p=0,m=f.length;p<m;p++){const g=f[p];g.onLoad&&g.onLoad(h)}}).catch(h=>{const f=nr[e];if(f===void 0)throw this.manager.itemError(e),h;delete nr[e];for(let p=0,m=f.length;p<m;p++){const g=f[p];g.onError&&g.onError(h)}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}}class pA extends Zn{constructor(e){super(e)}load(e,t,n,i){const s=this,l=new cr(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{t(s.parse(JSON.parse(c)))}catch(u){i?i(u):console.error(u),s.manager.itemError(e)}},n,i)}parse(e){const t=[];for(let n=0;n<e.length;n++){const i=za.parse(e[n]);t.push(i)}return t}}class mA extends Zn{constructor(e){super(e)}load(e,t,n,i){const s=this,l=[],c=new vu,u=new cr(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(s.withCredentials);let h=0;function f(p){u.load(e[p],function(m){const g=s.parse(m,!0);l[p]={width:g.width,height:g.height,format:g.format,mipmaps:g.mipmaps},h+=1,h===6&&(g.mipmapCount===1&&(c.minFilter=en),c.image=l,c.format=g.format,c.needsUpdate=!0,t&&t(c))},n,i)}if(Array.isArray(e))for(let p=0,m=e.length;p<m;++p)f(p);else u.load(e,function(p){const m=s.parse(p,!0);if(m.isCubemap){const g=m.mipmaps.length/m.mipmapCount;for(let y=0;y<g;y++){l[y]={mipmaps:[]};for(let M=0;M<m.mipmapCount;M++)l[y].mipmaps.push(m.mipmaps[y*m.mipmapCount+M]),l[y].format=m.format,l[y].width=m.width,l[y].height=m.height}c.image=l}else c.image.width=m.width,c.image.height=m.height,c.mipmaps=m.mipmaps;m.mipmapCount===1&&(c.minFilter=en),c.format=m.format,c.needsUpdate=!0,t&&t(c)},n,i);return c}}class ka extends Zn{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,l=sr.get(e);if(l!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(l),s.manager.itemEnd(e)},0),l;const c=Ia("img");function u(){f(),sr.add(e,this),t&&t(this),s.manager.itemEnd(e)}function h(p){f(),i&&i(p),s.manager.itemError(e),s.manager.itemEnd(e)}function f(){c.removeEventListener("load",u,!1),c.removeEventListener("error",h,!1)}return c.addEventListener("load",u,!1),c.addEventListener("error",h,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(c.crossOrigin=this.crossOrigin),s.manager.itemStart(e),c.src=e,c}}class gA extends Zn{constructor(e){super(e)}load(e,t,n,i){const s=new Xa;s.colorSpace=an;const l=new ka(this.manager);l.setCrossOrigin(this.crossOrigin),l.setPath(this.path);let c=0;function u(h){l.load(e[h],function(f){s.images[h]=f,c++,c===6&&(s.needsUpdate=!0,t&&t(s))},void 0,i)}for(let h=0;h<e.length;++h)u(h);return s}}class _A extends Zn{constructor(e){super(e)}load(e,t,n,i){const s=this,l=new _s,c=new cr(this.manager);return c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(s.withCredentials),c.load(e,function(u){let h;try{h=s.parse(u)}catch(f){if(i!==void 0)i(f);else{console.error(f);return}}h.image!==void 0?l.image=h.image:h.data!==void 0&&(l.image.width=h.width,l.image.height=h.height,l.image.data=h.data),l.wrapS=h.wrapS!==void 0?h.wrapS:Pn,l.wrapT=h.wrapT!==void 0?h.wrapT:Pn,l.magFilter=h.magFilter!==void 0?h.magFilter:en,l.minFilter=h.minFilter!==void 0?h.minFilter:en,l.anisotropy=h.anisotropy!==void 0?h.anisotropy:1,h.colorSpace!==void 0?l.colorSpace=h.colorSpace:h.encoding!==void 0&&(l.encoding=h.encoding),h.flipY!==void 0&&(l.flipY=h.flipY),h.format!==void 0&&(l.format=h.format),h.type!==void 0&&(l.type=h.type),h.mipmaps!==void 0&&(l.mipmaps=h.mipmaps,l.minFilter=Or),h.mipmapCount===1&&(l.minFilter=en),h.generateMipmaps!==void 0&&(l.generateMipmaps=h.generateMipmaps),l.needsUpdate=!0,t&&t(l,h)},n,i),l}}class vA extends Zn{constructor(e){super(e)}load(e,t,n,i){const s=new tn,l=new ka(this.manager);return l.setCrossOrigin(this.crossOrigin),l.setPath(this.path),l.load(e,function(c){s.image=c,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}}class Hr extends At{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ie(e),this.intensity=t}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,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}class jv extends Hr{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(At.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ie(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const Sf=new tt,c0=new U,u0=new U;class pp{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new fe(512,512),this.map=null,this.mapPass=null,this.matrix=new tt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new qa,this._frameExtents=new fe(1,1),this._viewportCount=1,this._viewports=[new Pt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;c0.setFromMatrixPosition(e.matrixWorld),t.position.copy(c0),u0.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(u0),t.updateMatrixWorld(),Sf.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Sf),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Sf)}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.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return 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}}class yA extends pp{constructor(){super(new vn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=Mo*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(n!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=n,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Kv extends Hr{constructor(e,t,n=0,i=Math.PI/3,s=0,l=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(At.DEFAULT_UP),this.updateMatrix(),this.target=new At,this.distance=n,this.angle=i,this.penumbra=s,this.decay=l,this.map=null,this.shadow=new yA}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}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.shadow=e.shadow.clone(),this}}const h0=new tt,la=new U,Mf=new U;class xA extends pp{constructor(){super(new vn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new fe(4,2),this._viewportCount=6,this._viewports=[new Pt(2,1,1,1),new Pt(0,1,1,1),new Pt(3,1,1,1),new Pt(1,1,1,1),new Pt(3,0,1,1),new Pt(1,0,1,1)],this._cubeDirections=[new U(1,0,0),new U(-1,0,0),new U(0,0,1),new U(0,0,-1),new U(0,1,0),new U(0,-1,0)],this._cubeUps=[new U(0,1,0),new U(0,1,0),new U(0,1,0),new U(0,1,0),new U(0,0,1),new U(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),la.setFromMatrixPosition(e.matrixWorld),n.position.copy(la),Mf.copy(n.position),Mf.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Mf),n.updateMatrixWorld(),i.makeTranslation(-la.x,-la.y,-la.z),h0.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(h0)}}class Qv extends Hr{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 xA}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}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}}class SA extends pp{constructor(){super(new Za(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class $v extends Hr{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(At.DEFAULT_UP),this.updateMatrix(),this.target=new At,this.shadow=new SA}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class ey extends Hr{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class ty extends Hr{constructor(e,t,n=10,i=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class ny{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new U)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,i=e.y,s=e.z,l=this.coefficients;return t.copy(l[0]).multiplyScalar(.282095),t.addScaledVector(l[1],.488603*i),t.addScaledVector(l[2],.488603*s),t.addScaledVector(l[3],.488603*n),t.addScaledVector(l[4],1.092548*(n*i)),t.addScaledVector(l[5],1.092548*(i*s)),t.addScaledVector(l[6],.315392*(3*s*s-1)),t.addScaledVector(l[7],1.092548*(n*s)),t.addScaledVector(l[8],.546274*(n*n-i*i)),t}getIrradianceAt(e,t){const n=e.x,i=e.y,s=e.z,l=this.coefficients;return t.copy(l[0]).multiplyScalar(.886227),t.addScaledVector(l[1],2*.511664*i),t.addScaledVector(l[2],2*.511664*s),t.addScaledVector(l[3],2*.511664*n),t.addScaledVector(l[4],2*.429043*n*i),t.addScaledVector(l[5],2*.429043*i*s),t.addScaledVector(l[6],.743125*s*s-.247708),t.addScaledVector(l[7],2*.429043*n*s),t.addScaledVector(l[8],.429043*(n*n-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(e,t+i*3);return this}toArray(e=[],t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(e,t+i*3);return e}static getBasisAt(e,t){const n=e.x,i=e.y,s=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*s,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*n*s,t[8]=.546274*(n*n-i*i)}}class iy extends Hr{constructor(e=new ny,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class Du extends Zn{constructor(e){super(e),this.textures={}}load(e,t,n,i){const s=this,l=new cr(s.manager);l.setPath(s.path),l.setRequestHeader(s.requestHeader),l.setWithCredentials(s.withCredentials),l.load(e,function(c){try{t(s.parse(JSON.parse(c)))}catch(u){i?i(u):console.error(u),s.manager.itemError(e)}},n,i)}parse(e){const t=this.textures;function n(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const i=Du.createMaterialFromType(e.type);if(e.uuid!==void 0&&(i.uuid=e.uuid),e.name!==void 0&&(i.name=e.name),e.color!==void 0&&i.color!==void 0&&i.color.setHex(e.color),e.roughness!==void 0&&(i.roughness=e.roughness),e.metalness!==void 0&&(i.metalness=e.metalness),e.sheen!==void 0&&(i.sheen=e.sheen),e.sheenColor!==void 0&&(i.sheenColor=new Ie().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(i.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&i.emissive!==void 0&&i.emissive.setHex(e.emissive),e.specular!==void 0&&i.specular!==void 0&&i.specular.setHex(e.specular),e.specularIntensity!==void 0&&(i.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&i.specularColor!==void 0&&i.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(i.shininess=e.shininess),e.clearcoat!==void 0&&(i.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=e.clearcoatRoughness),e.iridescence!==void 0&&(i.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(i.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(i.transmission=e.transmission),e.thickness!==void 0&&(i.thickness=e.thickness),e.attenuationDistance!==void 0&&(i.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&i.attenuationColor!==void 0&&i.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(i.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(i.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(i.fog=e.fog),e.flatShading!==void 0&&(i.flatShading=e.flatShading),e.blending!==void 0&&(i.blending=e.blending),e.combine!==void 0&&(i.combine=e.combine),e.side!==void 0&&(i.side=e.side),e.shadowSide!==void 0&&(i.shadowSide=e.shadowSide),e.opacity!==void 0&&(i.opacity=e.opacity),e.transparent!==void 0&&(i.transparent=e.transparent),e.alphaTest!==void 0&&(i.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(i.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(i.depthFunc=e.depthFunc),e.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(i.blendSrc=e.blendSrc),e.blendDst!==void 0&&(i.blendDst=e.blendDst),e.blendEquation!==void 0&&(i.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(i.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(i.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(i.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&i.blendColor!==void 0&&i.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(i.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(i.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(i.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(i.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(i.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(i.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(i.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(i.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(i.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(i.rotation=e.rotation),e.linewidth!==void 0&&(i.linewidth=e.linewidth),e.dashSize!==void 0&&(i.dashSize=e.dashSize),e.gapSize!==void 0&&(i.gapSize=e.gapSize),e.scale!==void 0&&(i.scale=e.scale),e.polygonOffset!==void 0&&(i.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(i.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(i.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(i.dithering=e.dithering),e.alphaToCoverage!==void 0&&(i.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(i.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(i.forceSinglePass=e.forceSinglePass),e.visible!==void 0&&(i.visible=e.visible),e.toneMapped!==void 0&&(i.toneMapped=e.toneMapped),e.userData!==void 0&&(i.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?i.vertexColors=e.vertexColors>0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const l=e.uniforms[s];switch(i.uniforms[s]={},l.type){case"t":i.uniforms[s].value=n(l.value);break;case"c":i.uniforms[s].value=new Ie().setHex(l.value);break;case"v2":i.uniforms[s].value=new fe().fromArray(l.value);break;case"v3":i.uniforms[s].value=new U().fromArray(l.value);break;case"v4":i.uniforms[s].value=new Pt().fromArray(l.value);break;case"m3":i.uniforms[s].value=new gt().fromArray(l.value);break;case"m4":i.uniforms[s].value=new tt().fromArray(l.value);break;default:i.uniforms[s].value=l.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new fe().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new fe().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:Uv,SpriteMaterial:ep,RawShaderMaterial:Ov,ShaderMaterial:Gi,PointsMaterial:np,MeshPhysicalMaterial:Fv,MeshStandardMaterial:cp,MeshPhongMaterial:Bv,MeshToonMaterial:zv,MeshNormalMaterial:kv,MeshLambertMaterial:Hv,MeshDepthMaterial:jd,MeshDistanceMaterial:Kd,MeshBasicMaterial:zr,MeshMatcapMaterial:Vv,LineDashedMaterial:Gv,LineBasicMaterial:kn,Material:In};return new t[e]}}class bd{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{return t}}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)}}class ry extends dt{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class sy extends Zn{constructor(e){super(e)}load(e,t,n,i){const s=this,l=new cr(s.manager);l.setPath(s.path),l.setRequestHeader(s.requestHeader),l.setWithCredentials(s.withCredentials),l.load(e,function(c){try{t(s.parse(JSON.parse(c)))}catch(u){i?i(u):console.error(u),s.manager.itemError(e)}},n,i)}parse(e){const t={},n={};function i(g,y){if(t[y]!==void 0)return t[y];const x=g.interleavedBuffers[y],v=s(g,x.buffer),w=fo(x.type,v),E=new gu(w,x.stride);return E.uuid=x.uuid,t[y]=E,E}function s(g,y){if(n[y]!==void 0)return n[y];const x=g.arrayBuffers[y],v=new Uint32Array(x).buffer;return n[y]=v,v}const l=e.isInstancedBufferGeometry?new ry:new dt,c=e.data.index;if(c!==void 0){const g=fo(c.type,c.array);l.setIndex(new bt(g,1))}const u=e.data.attributes;for(const g in u){const y=u[g];let M;if(y.isInterleavedBufferAttribute){const x=i(e.data,y.data);M=new xs(x,y.itemSize,y.offset,y.normalized)}else{const x=fo(y.type,y.array),v=y.isInstancedBufferAttribute?wo:bt;M=new v(x,y.itemSize,y.normalized)}y.name!==void 0&&(M.name=y.name),y.usage!==void 0&&M.setUsage(y.usage),l.setAttribute(g,M)}const h=e.data.morphAttributes;if(h)for(const g in h){const y=h[g],M=[];for(let x=0,v=y.length;x<v;x++){const w=y[x];let E;if(w.isInterleavedBufferAttribute){const A=i(e.data,w.data);E=new xs(A,w.itemSize,w.offset,w.normalized)}else{const A=fo(w.type,w.array);E=new bt(A,w.itemSize,w.normalized)}w.name!==void 0&&(E.name=w.name),M.push(E)}l.morphAttributes[g]=M}e.data.morphTargetsRelative&&(l.morphTargetsRelative=!0);const p=e.data.groups||e.data.drawcalls||e.data.offsets;if(p!==void 0)for(let g=0,y=p.length;g!==y;++g){const M=p[g];l.addGroup(M.start,M.count,M.materialIndex)}const m=e.data.boundingSphere;if(m!==void 0){const g=new U;m.center!==void 0&&g.fromArray(m.center),l.boundingSphere=new Ln(g,m.radius)}return e.name&&(l.name=e.name),e.userData&&(l.userData=e.userData),l}}class MA extends Zn{constructor(e){super(e)}load(e,t,n,i){const s=this,l=this.path===""?bd.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||l;const c=new cr(this.manager);c.setPath(this.path),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(e,function(u){let h=null;try{h=JSON.parse(u)}catch(p){i!==void 0&&i(p),console.error("THREE:ObjectLoader: Can't parse "+e+".",p.message);return}const f=h.metadata;if(f===void 0||f.type===void 0||f.type.toLowerCase()==="geometry"){i!==void 0&&i(new Error("THREE.ObjectLoader: Can't load "+e)),console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(h,t)},n,i)}async loadAsync(e,t){const n=this,i=this.path===""?bd.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;const s=new cr(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const l=await s.loadAsync(e,t),c=JSON.parse(l),u=c.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await n.parseAsync(c)}parse(e,t){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,i),l=this.parseImages(e.images,function(){t!==void 0&&t(h)}),c=this.parseTextures(e.textures,l),u=this.parseMaterials(e.materials,c),h=this.parseObject(e.object,s,u,c,n),f=this.parseSkeletons(e.skeletons,h);if(this.bindSkeletons(h,f),t!==void 0){let p=!1;for(const m in l)if(l[m].data instanceof HTMLImageElement){p=!0;break}p===!1&&t(h)}return h}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,n),s=await this.parseImagesAsync(e.images),l=this.parseTextures(e.textures,s),c=this.parseMaterials(e.materials,l),u=this.parseObject(e.object,i,c,l,t),h=this.parseSkeletons(e.skeletons,u);return this.bindSkeletons(u,h),u}parseShapes(e){const t={};if(e!==void 0)for(let n=0,i=e.length;n<i;n++){const s=new vs().fromJSON(e[n]);t[s.uuid]=s}return t}parseSkeletons(e,t){const n={},i={};if(t.traverse(function(s){s.isBone&&(i[s.uuid]=s)}),e!==void 0)for(let s=0,l=e.length;s<l;s++){const c=new _u().fromJSON(e[s],i);n[c.uuid]=c}return n}parseGeometries(e,t){const n={};if(e!==void 0){const i=new sy;for(let s=0,l=e.length;s<l;s++){let c;const u=e[s];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":c=i.parse(u);break;default:u.type in l0?c=l0[u.type].fromJSON(u,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${u.type}"`)}c.uuid=u.uuid,u.name!==void 0&&(c.name=u.name),u.userData!==void 0&&(c.userData=u.userData),n[u.uuid]=c}}return n}parseMaterials(e,t){const n={},i={};if(e!==void 0){const s=new Du;s.setTextures(t);for(let l=0,c=e.length;l<c;l++){const u=e[l];n[u.uuid]===void 0&&(n[u.uuid]=s.parse(u)),i[u.uuid]=n[u.uuid]}}return i}parseAnimations(e){const t={};if(e!==void 0)for(let n=0;n<e.length;n++){const i=e[n],s=za.parse(i);t[s.uuid]=s}return t}parseImages(e,t){const n=this,i={};let s;function l(u){return n.manager.itemStart(u),s.load(u,function(){n.manager.itemEnd(u)},void 0,function(){n.manager.itemError(u),n.manager.itemEnd(u)})}function c(u){if(typeof u=="string"){const h=u,f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h)?h:n.resourcePath+h;return l(f)}else return u.data?{data:fo(u.type,u.data),width:u.width,height:u.height}:null}if(e!==void 0&&e.length>0){const u=new dp(t);s=new ka(u),s.setCrossOrigin(this.crossOrigin);for(let h=0,f=e.length;h<f;h++){const p=e[h],m=p.url;if(Array.isArray(m)){const g=[];for(let y=0,M=m.length;y<M;y++){const x=m[y],v=c(x);v!==null&&(v instanceof HTMLImageElement?g.push(v):g.push(new _s(v.data,v.width,v.height)))}i[p.uuid]=new fs(g)}else{const g=c(p.url);i[p.uuid]=new fs(g)}}}return i}async parseImagesAsync(e){const t=this,n={};let i;async function s(l){if(typeof l=="string"){const c=l,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:t.resourcePath+c;return await i.loadAsync(u)}else return l.data?{data:fo(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){i=new ka(this.manager),i.setCrossOrigin(this.crossOrigin);for(let l=0,c=e.length;l<c;l++){const u=e[l],h=u.url;if(Array.isArray(h)){const f=[];for(let p=0,m=h.length;p<m;p++){const g=h[p],y=await s(g);y!==null&&(y instanceof HTMLImageElement?f.push(y):f.push(new _s(y.data,y.width,y.height)))}n[u.uuid]=new fs(f)}else{const f=await s(u.url);n[u.uuid]=new fs(f)}}}return n}parseTextures(e,t){function n(s,l){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),l[s])}const i={};if(e!==void 0)for(let s=0,l=e.length;s<l;s++){const c=e[s];c.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',c.uuid),t[c.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",c.image);const u=t[c.image],h=u.data;let f;Array.isArray(h)?(f=new Xa,h.length===6&&(f.needsUpdate=!0)):(h&&h.data?f=new _s:f=new tn,h&&(f.needsUpdate=!0)),f.source=u,f.uuid=c.uuid,c.name!==void 0&&(f.name=c.name),c.mapping!==void 0&&(f.mapping=n(c.mapping,EA)),c.channel!==void 0&&(f.channel=c.channel),c.offset!==void 0&&f.offset.fromArray(c.offset),c.repeat!==void 0&&f.repeat.fromArray(c.repeat),c.center!==void 0&&f.center.fromArray(c.center),c.rotation!==void 0&&(f.rotation=c.rotation),c.wrap!==void 0&&(f.wrapS=n(c.wrap[0],f0),f.wrapT=n(c.wrap[1],f0)),c.format!==void 0&&(f.format=c.format),c.internalFormat!==void 0&&(f.internalFormat=c.internalFormat),c.type!==void 0&&(f.type=c.type),c.colorSpace!==void 0&&(f.colorSpace=c.colorSpace),c.encoding!==void 0&&(f.encoding=c.encoding),c.minFilter!==void 0&&(f.minFilter=n(c.minFilter,d0)),c.magFilter!==void 0&&(f.magFilter=n(c.magFilter,d0)),c.anisotropy!==void 0&&(f.anisotropy=c.anisotropy),c.flipY!==void 0&&(f.flipY=c.flipY),c.generateMipmaps!==void 0&&(f.generateMipmaps=c.generateMipmaps),c.premultiplyAlpha!==void 0&&(f.premultiplyAlpha=c.premultiplyAlpha),c.unpackAlignment!==void 0&&(f.unpackAlignment=c.unpackAlignment),c.compareFunction!==void 0&&(f.compareFunction=c.compareFunction),c.userData!==void 0&&(f.userData=c.userData),i[c.uuid]=f}return i}parseObject(e,t,n,i,s){let l;function c(m){return t[m]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",m),t[m]}function u(m){if(m!==void 0){if(Array.isArray(m)){const g=[];for(let y=0,M=m.length;y<M;y++){const x=m[y];n[x]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",x),g.push(n[x])}return g}return n[m]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",m),n[m]}}function h(m){return i[m]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",m),i[m]}let f,p;switch(e.type){case"Scene":l=new $d,e.background!==void 0&&(Number.isInteger(e.background)?l.background=new Ie(e.background):l.background=h(e.background)),e.environment!==void 0&&(l.environment=h(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?l.fog=new mu(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(l.fog=new pu(e.fog.color,e.fog.density)),e.fog.name!==""&&(l.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(l.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(l.backgroundIntensity=e.backgroundIntensity);break;case"PerspectiveCamera":l=new vn(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(l.focus=e.focus),e.zoom!==void 0&&(l.zoom=e.zoom),e.filmGauge!==void 0&&(l.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(l.filmOffset=e.filmOffset),e.view!==void 0&&(l.view=Object.assign({},e.view));break;case"OrthographicCamera":l=new Za(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(l.zoom=e.zoom),e.view!==void 0&&(l.view=Object.assign({},e.view));break;case"AmbientLight":l=new ey(e.color,e.intensity);break;case"DirectionalLight":l=new $v(e.color,e.intensity);break;case"PointLight":l=new Qv(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":l=new ty(e.color,e.intensity,e.width,e.height);break;case"SpotLight":l=new Kv(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":l=new jv(e.color,e.groundColor,e.intensity);break;case"LightProbe":l=new iy().fromJSON(e);break;case"SkinnedMesh":f=c(e.geometry),p=u(e.material),l=new xv(f,p),e.bindMode!==void 0&&(l.bindMode=e.bindMode),e.bindMatrix!==void 0&&l.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(l.skeleton=e.skeleton);break;case"Mesh":f=c(e.geometry),p=u(e.material),l=new ln(f,p);break;case"InstancedMesh":f=c(e.geometry),p=u(e.material);const m=e.count,g=e.instanceMatrix,y=e.instanceColor;l=new Sv(f,p,m),l.instanceMatrix=new wo(new Float32Array(g.array),16),y!==void 0&&(l.instanceColor=new wo(new Float32Array(y.array),y.itemSize));break;case"BatchedMesh":f=c(e.geometry),p=u(e.material),l=new Mv(e.maxGeometryCount,e.maxVertexCount,e.maxIndexCount,p),l.geometry=f,l.perObjectFrustumCulled=e.perObjectFrustumCulled,l.sortObjects=e.sortObjects,l._drawRanges=e.drawRanges,l._reservedRanges=e.reservedRanges,l._visibility=e.visibility,l._active=e.active,l._bounds=e.bounds.map(M=>{const x=new zn;x.min.fromArray(M.boxMin),x.max.fromArray(M.boxMax);const v=new Ln;return v.radius=M.sphereRadius,v.center.fromArray(M.sphereCenter),{boxInitialized:M.boxInitialized,box:x,sphereInitialized:M.sphereInitialized,sphere:v}}),l._maxGeometryCount=e.maxGeometryCount,l._maxVertexCount=e.maxVertexCount,l._maxIndexCount=e.maxIndexCount,l._geometryInitialized=e.geometryInitialized,l._geometryCount=e.geometryCount,l._matricesTexture=h(e.matricesTexture.uuid);break;case"LOD":l=new yv;break;case"Line":l=new Fr(c(e.geometry),u(e.material));break;case"LineLoop":l=new Ev(c(e.geometry),u(e.material));break;case"LineSegments":l=new Wi(c(e.geometry),u(e.material));break;case"PointCloud":case"Points":l=new wv(c(e.geometry),u(e.material));break;case"Sprite":l=new vv(u(e.material));break;case"Group":l=new go;break;case"Bone":l=new tp;break;default:l=new At}if(l.uuid=e.uuid,e.name!==void 0&&(l.name=e.name),e.matrix!==void 0?(l.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(l.matrixAutoUpdate=e.matrixAutoUpdate),l.matrixAutoUpdate&&l.matrix.decompose(l.position,l.quaternion,l.scale)):(e.position!==void 0&&l.position.fromArray(e.position),e.rotation!==void 0&&l.rotation.fromArray(e.rotation),e.quaternion!==void 0&&l.quaternion.fromArray(e.quaternion),e.scale!==void 0&&l.scale.fromArray(e.scale)),e.up!==void 0&&l.up.fromArray(e.up),e.castShadow!==void 0&&(l.castShadow=e.castShadow),e.receiveShadow!==void 0&&(l.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(l.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(l.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(l.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&l.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(l.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(l.visible=e.visible),e.frustumCulled!==void 0&&(l.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(l.renderOrder=e.renderOrder),e.userData!==void 0&&(l.userData=e.userData),e.layers!==void 0&&(l.layers.mask=e.layers),e.children!==void 0){const m=e.children;for(let g=0;g<m.length;g++)l.add(this.parseObject(m[g],t,n,i,s))}if(e.animations!==void 0){const m=e.animations;for(let g=0;g<m.length;g++){const y=m[g];l.animations.push(s[y])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(l.autoUpdate=e.autoUpdate);const m=e.levels;for(let g=0;g<m.length;g++){const y=m[g],M=l.getObjectByProperty("uuid",y.object);M!==void 0&&l.addLevel(M,y.distance,y.hysteresis)}}return l}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(n){if(n.isSkinnedMesh===!0&&n.skeleton!==void 0){const i=t[n.skeleton];i===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",n.skeleton):n.bind(i,n.bindMatrix)}})}}const EA={UVMapping:lu,CubeReflectionMapping:lr,CubeRefractionMapping:Ur,EquirectangularReflectionMapping:Sa,EquirectangularRefractionMapping:Ma,CubeUVReflectionMapping:Ao},f0={RepeatWrapping:Ea,ClampToEdgeWrapping:Pn,MirroredRepeatWrapping:wa},d0={NearestFilter:$t,NearestMipmapNearestFilter:tu,NearestMipmapLinearFilter:ma,LinearFilter:en,LinearMipmapNearestFilter:Id,LinearMipmapLinearFilter:Or};class wA extends Zn{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}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 s=this,l=sr.get(e);if(l!==void 0){if(s.manager.itemStart(e),l.then){l.then(h=>{t&&t(h),s.manager.itemEnd(e)}).catch(h=>{i&&i(h)});return}return setTimeout(function(){t&&t(l),s.manager.itemEnd(e)},0),l}const c={};c.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",c.headers=this.requestHeader;const u=fetch(e,c).then(function(h){return h.blob()}).then(function(h){return createImageBitmap(h,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(h){return sr.add(e,h),t&&t(h),s.manager.itemEnd(e),h}).catch(function(h){i&&i(h),sr.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});sr.add(e,u),s.manager.itemStart(e)}}let Nc;class mp{static getContext(){return Nc===void 0&&(Nc=new(window.AudioContext||window.webkitAudioContext)),Nc}static setContext(e){Nc=e}}class TA extends Zn{constructor(e){super(e)}load(e,t,n,i){const s=this,l=new cr(this.manager);l.setResponseType("arraybuffer"),l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){try{const h=u.slice(0);mp.getContext().decodeAudioData(h,function(p){t(p)}).catch(c)}catch(h){c(h)}},n,i);function c(u){i?i(u):console.error(u),s.manager.itemError(e)}}}const p0=new tt,m0=new tt,ns=new tt;class AA{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new vn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new vn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,ns.copy(e.projectionMatrix);const i=t.eyeSep/2,s=i*t.near/t.focus,l=t.near*Math.tan(ms*t.fov*.5)/t.zoom;let c,u;m0.elements[12]=-i,p0.elements[12]=i,c=-l*t.aspect+s,u=l*t.aspect+s,ns.elements[0]=2*t.near/(u-c),ns.elements[8]=(u+c)/(u-c),this.cameraL.projectionMatrix.copy(ns),c=-l*t.aspect-s,u=l*t.aspect-s,ns.elements[0]=2*t.near/(u-c),ns.elements[8]=(u+c)/(u-c),this.cameraR.projectionMatrix.copy(ns)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(m0),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(p0)}}class gp{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=g0(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=g0();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function g0(){return(typeof performance>"u"?Date:performance).now()}const is=new U,_0=new Yn,bA=new U,rs=new U;class CA extends At{constructor(){super(),this.type="AudioListener",this.context=mp.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new gp}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(is,_0,bA),rs.set(0,0,-1).applyQuaternion(_0),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(is.x,i),t.positionY.linearRampToValueAtTime(is.y,i),t.positionZ.linearRampToValueAtTime(is.z,i),t.forwardX.linearRampToValueAtTime(rs.x,i),t.forwardY.linearRampToValueAtTime(rs.y,i),t.forwardZ.linearRampToValueAtTime(rs.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(is.x,is.y,is.z),t.setOrientation(rs.x,rs.y,rs.z,n.x,n.y,n.z)}}class oy extends At{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const ss=new U,v0=new Yn,RA=new U,os=new U;class PA extends oy{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){super.connect(),this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(ss,v0,RA),os.set(0,0,1).applyQuaternion(v0);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(ss.x,n),t.positionY.linearRampToValueAtTime(ss.y,n),t.positionZ.linearRampToValueAtTime(ss.z,n),t.orientationX.linearRampToValueAtTime(os.x,n),t.orientationY.linearRampToValueAtTime(os.y,n),t.orientationZ.linearRampToValueAtTime(os.z,n)}else t.setPosition(ss.x,ss.y,ss.z),t.setOrientation(os.x,os.y,os.z)}}class LA{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class ay{constructor(e,t,n){this.binding=e,this.valueSize=n;let i,s,l;switch(t){case"quaternion":i=this._slerp,s=this._slerpAdditive,l=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":i=this._select,s=this._select,l=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:i=this._lerp,s=this._lerpAdditive,l=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=s,this._setIdentity=l,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,i=this.valueSize,s=e*i+i;let l=this.cumulativeWeight;if(l===0){for(let c=0;c!==i;++c)n[s+c]=n[c];l=t}else{l+=t;const c=t/l;this._mixBufferRegion(n,s,0,c,i)}this.cumulativeWeight=l}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,i=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,i=e*t+t,s=this.cumulativeWeight,l=this.cumulativeWeightAdditive,c=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const u=t*this._origIndex;this._mixBufferRegion(n,i,u,1-s,t)}l>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let u=t,h=t+t;u!==h;++u)if(n[u]!==n[u+t]){c.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,l=i;s!==l;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,i,s){if(i>=.5)for(let l=0;l!==s;++l)e[t+l]=e[n+l]}_slerp(e,t,n,i){Yn.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){const l=this._workIndex*s;Yn.multiplyQuaternionsFlat(e,l,e,t,e,n),Yn.slerpFlat(e,t,e,t,e,l,i)}_lerp(e,t,n,i,s){const l=1-i;for(let c=0;c!==s;++c){const u=t+c;e[u]=e[u]*l+e[n+c]*i}}_lerpAdditive(e,t,n,i,s){for(let l=0;l!==s;++l){const c=t+l;e[c]=e[c]+e[n+l]*i}}}const _p="\\[\\]\\.:\\/",IA=new RegExp("["+_p+"]","g"),vp="[^"+_p+"]",DA="[^"+_p.replace("\\.","")+"]",NA=/((?:WC+[\/:])*)/.source.replace("WC",vp),UA=/(WCOD+)?/.source.replace("WCOD",DA),OA=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",vp),FA=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",vp),BA=new RegExp("^"+NA+UA+OA+FA+"$"),zA=["material","materials","bones","map"];class kA{constructor(e,t,n){const i=n||St.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_,s=n.length;i!==s;++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 St{constructor(e,t,n){this.path=t,this.parsedPath=n||St.parseTrackName(t),this.node=St.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 St.Composite(e,t,n):new St(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(IA,"")}static parseTrackName(e){const t=BA.exec(e);if(t===null)throw new Error("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 s=n.nodeName.substring(i+1);zA.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+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(s){for(let l=0;l<s.length;l++){const c=s[l];if(c.name===t||c.uuid===t)return c;const u=n(c.children);if(u)return u}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,s=n.length;i!==s;++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,s=n.length;i!==s;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++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 s=t.propertyIndex;if(e||(e=St.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let h=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as no
3686de does not have a material.",this);return}if(!e.material.materials){console.error("THREE.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){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let f=0;f<e.length;f++)if(e[f].name===h){h=f;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.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){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(h!==void 0){if(e[h]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[h]}}const l=e[i];if(l===void 0){const h=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+i+" but it wasn't found.",e);return}let c=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?c=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(c=this.Versioning.MatrixWorldNeedsUpdate);let u=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}u=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=s}else l.fromArray!==void 0&&l.toArray!==void 0?(u=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(u=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=i;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}St.Composite=kA;St.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};St.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};St.prototype.GetterByBindingType=[St.prototype._getValue_direct,St.prototype._getValue_array,St.prototype._getValue_arrayElement,St.prototype._getValue_toArray];St.prototype.SetterByBindingTypeAndVersioning=[[St.prototype._setValue_direct,St.prototype._setValue_direct_setNeedsUpdate,St.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[St.prototype._setValue_array,St.prototype._setValue_array_setNeedsUpdate,St.prototype._setValue_array_setMatrixWorldNeedsUpdate],[St.prototype._setValue_arrayElement,St.prototype._setValue_arrayElement_setNeedsUpdate,St.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[St.prototype._setValue_fromArray,St.prototype._setValue_fromArray_setNeedsUpdate,St.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class HA{constructor(){this.isAnimationObjectGroup=!0,this.uuid=ii(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,i=arguments.length;n!==i;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,i=this._parsedPaths,s=this._bindings,l=s.length;let c,u=e.length,h=this.nCachedObjects_;for(let f=0,p=arguments.length;f!==p;++f){const m=arguments[f],g=m.uuid;let y=t[g];if(y===void 0){y=u++,t[g]=y,e.push(m);for(let M=0,x=l;M!==x;++M)s[M].push(new St(m,n[M],i[M]))}else if(y<h){c=e[y];const M=--h,x=e[M];t[x.uuid]=y,e[y]=x,t[g]=M,e[M]=m;for(let v=0,w=l;v!==w;++v){const E=s[v],A=E[M];let N=E[y];E[y]=A,N===void 0&&(N=new St(m,n[v],i[v])),E[M]=N}}else e[y]!==c&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastru
3686cture when reloading scenes.")}this.nCachedObjects_=h}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let s=this.nCachedObjects_;for(let l=0,c=arguments.length;l!==c;++l){const u=arguments[l],h=u.uuid,f=t[h];if(f!==void 0&&f>=s){const p=s++,m=e[p];t[m.uuid]=f,e[f]=m,t[h]=p,e[p]=u;for(let g=0,y=i;g!==y;++g){const M=n[g],x=M[p],v=M[f];M[f]=x,M[p]=v}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let s=this.nCachedObjects_,l=e.length;for(let c=0,u=arguments.length;c!==u;++c){const h=arguments[c],f=h.uuid,p=t[f];if(p!==void 0)if(delete t[f],p<s){const m=--s,g=e[m],y=--l,M=e[y];t[g.uuid]=p,e[p]=g,t[M.uuid]=m,e[m]=M,e.pop();for(let x=0,v=i;x!==v;++x){const w=n[x],E=w[m],A=w[y];w[p]=E,w[m]=A,w.pop()}}else{const m=--l,g=e[m];m>0&&(t[g.uuid]=p),e[p]=g,e.pop();for(let y=0,M=i;y!==M;++y){const x=n[y];x[p]=x[m],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const s=this._bindings;if(i!==void 0)return s[i];const l=this._paths,c=this._parsedPaths,u=this._objects,h=u.length,f=this.nCachedObjects_,p=new Array(h);i=s.length,n[e]=i,l.push(e),c.push(t),s.push(p);for(let m=f,g=u.length;m!==g;++m){const y=u[m];p[m]=new St(y,e,t)}return p}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const i=this._paths,s=this._parsedPaths,l=this._bindings,c=l.length-1,u=l[c],h=e[c];t[h]=n,l[n]=u,l.pop(),s[n]=s[c],s.pop(),i[n]=i[c],i.pop()}}}class ly{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const s=t.tracks,l=s.length,c=new Array(l),u={endingStart:us,endingEnd:us};for(let h=0;h!==l;++h){const f=s[h].createInterpolant(null);c[h]=f,f.settings=u}this._interpolantSettings=u,this._interpolants=c,this._propertyBindings=new Array(l),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=V_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const i=this._clip.duration,s=e._clip.duration,l=s/i,c=i/s;e.warp(1,l,t),this.warp(c,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const i=this._mixer,s=i.time,l=this.timeScale;let c=this._timeScaleInterpolant;c===null&&(c=i._lendControlInterpolant(),this._timeScaleInterpolant=c);const u=c.parameterPositions,h=c.sampleValues;return u[0]=s,u[1]=s+n,h[0]=e/l,h[1]=t/l,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const u=(e-s)*n;u<0||n===0?t=0:(this._startTime=null,t=n*u)}t*=this._updateTimeScale(e);const l=this._updateTime(t),c=this._updateWeight(e);if(c>0){const u=this._interpolants,h=this._propertyBindings;switch(this.blendMode){case kd:for(let f=0,p=u.length;f!==p;++f)u[f].evaluate(l),h[f].accumulateAdditive(c);break;case uu:default:for(let f=0,p=u.length;f!==p;++f)u[f].evaluate(l),h[f].accumulate(i,c)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,s=this._loopCount;const l=n===G_;if(e===0)return s===-1?i:l&&(s&1)===1?t-i:i;if(n===H_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,l)):this._setEndings(this.repetitions===0,!0,l)),i>=t||i<0){const c=Math.floor(i/t);i-=t*c,s+=Math.abs(c);const u=this.repetitions-s;if(u<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(u===1){const h=e<0;this._setEndings(h,!h,l)}else this._setEndings(!1,!1,l);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:c})}}else this.time=i;if(l&&(s&1)===1)return t-i}return i}
vendor: 8,751 bytes, line 3686
3686_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=hs,i.endingEnd=hs):(e?i.endingStart=this.zeroSlopeAtStart?hs:us:i.endingStart=ba,t?i.endingEnd=this.zeroSlopeAtEnd?hs:us:i.endingEnd=ba)}_scheduleFading(e,t,n){const i=this._mixer,s=i.time;let l=this._weightInterpolant;l===null&&(l=i._lendControlInterpolant(),this._weightInterpolant=l);const c=l.parameterPositions,u=l.sampleValues;return c[0]=s,u[0]=t,c[1]=s+e,u[1]=n,this}}const VA=new Float32Array(1);class GA extends ur{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,l=e._propertyBindings,c=e._interpolants,u=n.uuid,h=this._bindingsByRootAndName;let f=h[u];f===void 0&&(f={},h[u]=f);for(let p=0;p!==s;++p){const m=i[p],g=m.name;let y=f[g];if(y!==void 0)++y.referenceCount,l[p]=y;else{if(y=l[p],y!==void 0){y._cacheIndex===null&&(++y.referenceCount,this._addInactiveBinding(y,u,g));continue}const M=t&&t._propertyBindings[p].binding.parsedPath;y=new ay(St.create(n,g,M),m.ValueTypeName,m.getValueSize()),++y.referenceCount,this._addInactiveBinding(y,u,g),l[p]=y}c[p].resultBuffer=y.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){const i=this._actions,s=this._actionsByClip;let l=s[t];if(l===void 0)l={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=l;else{const c=l.knownActions;e._byClipCacheIndex=c.length,c.push(e)}e._cacheIndex=i.length,i.push(e),l.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,l=this._actionsByClip,c=l[s],u=c.knownActions,h=u[u.length-1],f=e._byClipCacheIndex;h._byClipCacheIndex=f,u[f]=h,u.pop(),e._byClipCacheIndex=null;const p=c.actionByRoot,m=(e._localRoot||this._root).uuid;delete p[m],u.length===0&&delete l[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=n,t[n]=s}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=n,t[n]=s}_addInactiveBinding(e,t,n){const i=this._bindingsByRootAndName,s=this._bindings;let l=i[t];l===void 0&&(l={},i[t]=l),l[n]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,i=n.rootNode.uuid,s=n.path,l=this._bindingsByRootAndName,c=l[i],u=t[t.length-1],h=e._cacheIndex;u._cacheIndex=h,t[h]=u,t.pop(),delete c[s],Object.keys(c).length===0&&delete l[i]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=n,t[n]=s}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=n,t[n]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new hp(new Float32Array(2),new Float32Array(2),1,VA),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,s=t[i];e.__cacheIndex=i,t[i]=e,s.__cacheIndex=n,t[n]=s}clipAction(e,t,n){const i=t||this._root,s=i.uuid;let l=typeof e=="string"?za.findByName(i,e):e;const c=l!==null?l.uuid:e,u=this._actionsByClip[c];let h=null;if(n===void 0&&(l!==null?n=l.blendMode:n=uu),u!==void 0){const p=u.actionByRoot[s];if(p!==void 0&&p.blendMode===n)return p;h=u.knownActions[0],l===null&&(l=h._clip)}if(l===null)return null;const f=new ly(this,l,t,n);return this._bindAction(f,h),this._addInactiveAction(f,c,s),f}existingAction(e,t){const n=t||this._root,i=n.uuid,s=typeof e=="string"?za.findByName(n,e):e,l=s?s.uuid:e,c=this._actionsByClip[l];return c!==void 0&&c.actionByRoot[i]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),l=this._accuIndex^=1;for(let h=0;h!==n;++h)t[h]._update(i,e,s,l);const c=this._bindings,u=this._nActiveBindings;for(let h=0;h!==u;++h)c[h].apply(l);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,i=this._actionsByClip,s=i[n];if(s!==void 0){const l=s.knownActions;for(let c=0,u=l.length;c!==u;++c){const h=l[c];this._deactivateAction(h);const f=h._cacheIndex,p=t[t.length-1];h._cacheIndex=null,h._byClipCacheIndex=null,p._cacheIndex=f,t[f]=p,t.pop(),this._removeInactiveBindingsForAction(h)}delete i[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const l in n){const c=n[l].actionByRoot,u=c[t];u!==void 0&&(this._deactivateAction(u),this._removeInactiveAction(u))}const i=this._bindingsByRootAndName,s=i[t];if(s!==void 0)for(const l in s){const c=s[l];c.restoreOriginalState(),this._removeInactiveBinding(c)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class yp{constructor(e){this.value=e}clone(){return new yp(this.value.clone===void 0?this.value:this.value.clone())}}let WA=0;class XA extends ur{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:WA++}),this.name="",this.usage=La,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let n=0,i=t.length;n<i;n++){const s=Array.isArray(t[n])?t[n]:[t[n]];for(let l=0;l<s.length;l++)this.uniforms.push(s[l].clone())}return this}clone(){return new this.constructor().copy(this)}}class qA extends gu{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class YA{constructor(e,t,n,i,s){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=i,this.count=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}class cy{constructor(e,t,n=0,i=1/0){this.ray=new bo(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new gs,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: 
3686Unsupported camera type: "+t.type)}intersectObject(e,t=!0,n=[]){return Cd(e,this,n,t),n.sort(y0),n}intersectObjects(e,t=!0,n=[]){for(let i=0,s=e.length;i<s;i++)Cd(e[i],this,n,t);return n.sort(y0),n}}function y0(r,e){return r.distance-e.distance}function Cd(r,e,t,n){if(r.layers.test(e.layers)&&r.raycast(e,t),n===!0){const i=r.children;for(let s=0,l=i.length;s<l;s++)Cd(i[s],e,t,!0)}}class ZA{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}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=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),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(qt(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class JA{constructor(e=1,t=0,n=0){return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return new this.constructor().copy(this)}}const x0=new fe;class jA{constructor(e=new fe(1/0,1/0),t=new fe(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),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=x0.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}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=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(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}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}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}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))}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)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,x0).distanceTo(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}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)}}const S0=new U,Uc=new U;class KA{constructor(e=new U,t=new U){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){S0.subVectors(e,this.start),Uc.subVectors(this.end,this.start);const n=Uc.dot(Uc);let s=Uc.dot(S0)/n;return t&&(s=qt(s,0,1)),s}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const M0=new U;class QA extends At{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new dt,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let l=0,c=1,u=32;l<u;l++,c++){const h=l/u*Math.PI*2,f=c/u*Math.PI*2;i.push(Math.cos(h),Math.sin(h),1,Math.cos(f),Math.sin(f),1)}n.setAttribute("position",new Be(i,3));const s=new kn({fog:!1,toneMapped:!1});this.cone=new Wi(n,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),M0.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(M0),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}
vendor: 18,642 bytes, line 3686
3686const Ar=new U,Oc=new tt,Ef=new tt;class $A extends Wi{constructor(e){const t=uy(e),n=new dt,i=[],s=[],l=new Ie(0,0,1),c=new Ie(0,1,0);for(let h=0;h<t.length;h++){const f=t[h];f.parent&&f.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),s.push(l.r,l.g,l.b),s.push(c.r,c.g,c.b))}n.setAttribute("position",new Be(i,3)),n.setAttribute("color",new Be(s,3));const u=new kn({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,u),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,i=n.getAttribute("position");Ef.copy(this.root.matrixWorld).invert();for(let s=0,l=0;s<t.length;s++){const c=t[s];c.parent&&c.parent.isBone&&(Oc.multiplyMatrices(Ef,c.matrixWorld),Ar.setFromMatrixPosition(Oc),i.setXYZ(l,Ar.x,Ar.y,Ar.z),Oc.multiplyMatrices(Ef,c.parent.matrixWorld),Ar.setFromMatrixPosition(Oc),i.setXYZ(l+1,Ar.x,Ar.y,Ar.z),l+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function uy(r){const e=[];r.isBone===!0&&e.push(r);for(let t=0;t<r.children.length;t++)e.push.apply(e,uy(r.children[t]));return e}class eb extends ln{constructor(e,t,n){const i=new Ka(t,4,2),s=new zr({wireframe:!0,fog:!1,toneMapped:!1});super(i,s),this.light=e,this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const tb=new U,E0=new Ie,w0=new Ie;class nb extends At{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const i=new ja(t);i.rotateY(Math.PI*.5),this.material=new zr({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=i.getAttribute("position"),l=new Float32Array(s.count*3);i.setAttribute("color",new bt(l,3)),this.add(new ln(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");E0.copy(this.light.color),w0.copy(this.light.groundColor);for(let n=0,i=t.count;n<i;n++){const s=n<i/2?E0:w0;t.setXYZ(n,s.r,s.g,s.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(tb.setFromMatrixPosition(this.light.matrixWorld).negate())}}class ib extends Wi{constructor(e=10,t=10,n=4473924,i=8947848){n=new Ie(n),i=new Ie(i);const s=t/2,l=e/t,c=e/2,u=[],h=[];for(let m=0,g=0,y=-c;m<=t;m++,y+=l){u.push(-c,0,y,c,0,y),u.push(y,0,-c,y,0,c);const M=m===s?n:i;M.toArray(h,g),g+=3,M.toArray(h,g),g+=3,M.toArray(h,g),g+=3,M.toArray(h,g),g+=3}const f=new dt;f.setAttribute("position",new Be(u,3)),f.setAttribute("color",new Be(h,3));const p=new kn({vertexColors:!0,toneMapped:!1});super(f,p),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class rb extends Wi{constructor(e=10,t=16,n=8,i=64,s=4473924,l=8947848){s=new Ie(s),l=new Ie(l);const c=[],u=[];if(t>1)for(let p=0;p<t;p++){const m=p/t*(Math.PI*2),g=Math.sin(m)*e,y=Math.cos(m)*e;c.push(0,0,0),c.push(g,0,y);const M=p&1?s:l;u.push(M.r,M.g,M.b),u.push(M.r,M.g,M.b)}for(let p=0;p<n;p++){const m=p&1?s:l,g=e-e/n*p;for(let y=0;y<i;y++){let M=y/i*(Math.PI*2),x=Math.sin(M)*g,v=Math.cos(M)*g;c.push(x,0,v),u.push(m.r,m.g,m.b),M=(y+1)/i*(Math.PI*2),x=Math.sin(M)*g,v=Math.cos(M)*g,c.push(x,0,v),u.push(m.r,m.g,m.b)}}const h=new dt;h.setAttribute("position",new Be(c,3)),h.setAttribute("color",new Be(u,3));const f=new kn({vertexColors:!0,toneMapped:!1});super(h,f),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const T0=new U,Fc=new U,A0=new U;class sb extends At{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",t===void 0&&(t=1);let i=new dt;i.setAttribute("position",new Be([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new kn({fog:!1,toneMapped:!1});this.lightPlane=new Fr(i,s),this.add(this.lightPlane),i=new dt,i.setAttribute("position",new Be([0,0,0,0,0,1],3)),this.targetLine=new Fr(i,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),T0.setFromMatrixPosition(this.light.matrixWorld),Fc.setFromMatrixPosition(this.light.target.matrixWorld),A0.subVectors(Fc,T0),this.lightPlane.lookAt(Fc),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Fc),this.targetLine.scale.z=A0.length()}}const Bc=new U,Xt=new Wa;class ob extends Wi{constructor(e){const t=new dt,n=new kn({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],s=[],l={};c("n1","n2"),c("n2","n4"),c("n4","n3"),c("n3","n1"),c("f1","f2"),c("f2","f4"),c("f4","f3"),c("f3","f1"),c("n1","f1"),c("n2","f2"),c("n3","f3"),c("n4","f4"),c("p","n1"),c("p","n2"),c("p","n3"),c("p","n4"),c("u1","u2"),c("u2","u3"),c("u3","u1"),c("c","t"),c("p","c"),c("cn1","cn2"),c("cn3","cn4"),c("cf1","cf2"),c("cf3","cf4");function c(y,M){u(y),u(M)}function u(y){i.push(0,0,0),s.push(0,0,0),l[y]===void 0&&(l[y]=[]),l[y].push(i.length/3-1)}t.setAttribute("position",new Be(i,3)),t.setAttribute("color",new Be(s,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=l,this.update();const h=new Ie(16755200),f=new Ie(16711680),p=new Ie(43775),m=new Ie(16777215),g=new Ie(3355443);this.setColors(h,f,p,m,g)}setColors(e,t,n,i,s){const c=this.geometry.getAttribute("color");c.setXYZ(0,e.r,e.g,e.b),c.setXYZ(1,e.r,e.g,e.b),c.setXYZ(2,e.r,e.g,e.b),c.setXYZ(3,e.r,e.g,e.b),c.setXYZ(4,e.r,e.g,e.b),c.setXYZ(5,e.r,e.g,e.b),c.setXYZ(6,e.r,e.g,e.b),c.setXYZ(7,e.r,e.g,e.b),c.setXYZ(8,e.r,e.g,e.b),c.setXYZ(9,e.r,e.g,e.b),c.setXYZ(10,e.r,e.g,e.b),c.setXYZ(11,e.r,e.g,e.b),c.setXYZ(12,e.r,e.g,e.b),c.setXYZ(13,e.r,e.g,e.b),c.setXYZ(14,e.r,e.g,e.b),c.setXYZ(15,e.r,e.g,e.b),c.setXYZ(16,e.r,e.g,e.b),c.setXYZ(17,e.r,e.g,e.b),c.setXYZ(18,e.r,e.g,e.b),c.setXYZ(19,e.r,e.g,e.b),c.setXYZ(20,e.r,e.g,e.b),c.setXYZ(21,e.r,e.g,e.b),c.setXYZ(22,e.r,e.g,e.b),c.setXYZ(23,e.r,e.g,e.b),c.setXYZ(24,t.r,t.g,t.b),c.setXYZ(25,t.r,t.g,t.b),c.setXYZ(26,t.r,t.g,t.b),c.setXYZ(27,t.r,t.g,t.b),c.setXYZ(28,t.r,t.g,t.b),c.setXYZ(29,t.r,t.g,t.b),c.setXYZ(30,t.r,t.g,t.b),c.setXYZ(31,t.r,t.g,t.b),c.setXYZ(32,n.r,n.g,n.b),c.setXYZ(33,n.r,n.g,n.b),c.setXYZ(34,n.r,n.g,n.b),c.setXYZ(35,n.r,n.g,n.b),c.setXYZ(36,n.r,n.g,n.b),c.setXYZ(37,n.r,n.g,n.b),c.setXYZ(38,i.r,i.g,i.b),c.setXYZ(39,i.r,i.g,i.b),c.setXYZ(40,s.r,s.g,s.b),c.setXYZ(41,s.r,s.g,s.b),c.setXYZ(42,s.r,s.g,s.b),c.setXYZ(43,s.r,s.g,s.b),c.setXYZ(44,s.r,s.g,s.b),c.setXYZ(45,s.r,s.g,s.b),c.setXYZ(46,s.r,s.g,s.b),c.setXYZ(47,s.r,s.g,s.b),c.setXYZ(48,s.r,s.g,s.b),c.setXYZ(49,s.r,s.g,s.b),c.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap,n=1,i=1;Xt.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),jt("c",t,e,Xt,0,0,-1),jt("t",t,e,Xt,0,0,1),jt("n1",t,e,Xt,-n,-i,-1),jt("n2",t,e,Xt,n,-i,-1),jt("n3",t,e,Xt,-n,i,-1),jt("n4",t,e,Xt,n,i,-1),jt("f1",t,e,Xt,-n,-i,1),jt("f2",t,e,Xt,n,-i,1),jt("f3",t,e,Xt,-n,i,1),jt("f4",t,e,Xt,n,i,1),jt("u1",t,e,Xt,n*.7,i*1.1,-1),jt("u2",t,e,Xt,-n*.7,i*1.1,-1),jt("u3",t,e,Xt,0,i*2,-1),jt("cf1",t,e,Xt,-n,0,1),jt("cf2",t,e,Xt,n,0,1),jt("cf3",t,e,Xt,0,-i,1),jt("cf4",t,e,Xt,0,i,1),jt("cn1",t,e,Xt,-n,0,-1),jt("cn2",t,e,Xt,n,0,-1),jt("cn3",t,e,Xt,0,-i,-1),jt("cn4",t,e,Xt,0,i,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function jt(r,e,t,n,i,s,l){Bc.set(i,s,l).unproject(n);const c=e[r];if(c!==void 0){const u=t.getAttribute("position");for(let h=0,f=c.length;h<f;h++)u.setXYZ(c[h],Bc.x,Bc.y,Bc.z)}}const zc=new zn;class ab extends Wi{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),s=new dt;s.setIndex(new bt(n,1)),s.setAttribute("position",new bt(i,3)),super(s,new kn({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&zc.setFromObject(this.object),zc.isEmpty())return;const t=zc.min,n=zc.max,i=this.geometry.attributes.position,s=i.array;s[0]=n.x,s[1]=n.y,s[2]=n.z,s[3]=t.x,s[4]=n.y,s[5]=n.z,s[6]=t.x,s[7]=t.y,s[8]=n.z,s[9]=n.x,s[10]=t.y,s[11]=n.z,s[12]=n.x,s[13]=n.y,s[14]=t.z,s[15]=t.x,s[16]=n.y,s[17]=t.z,s[18]=t.x,s[19]=t.y,s[20]=t.z,s[21]=n.x,s[22]=t.y,s[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class lb extends Wi{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new dt;s.setIndex(new bt(n,1)),s.setAttribute("position",new Be(i,3)),super(s,new kn({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class cb extends Fr{constructor(e,t=1,n=16776960){const i=n,s=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],l=new dt;l.setAttribute("position",new Be(s,3)),l.computeBoundingSphere(),super(l,new kn({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const c=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],u=new dt;u.setAttribute("position",new Be(c,3)),u.computeBoundingSphere(),this.add(new ln(u,new zr({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const b0=new U;let kc,wf;class ub extends At{constructor(e=new U(0,0,1),t=new U(0,0,0),n=1,i=16776960,s=n*.2,l=s*.2){super(),this.type="ArrowHelper",kc===void 0&&(kc=new dt,kc.setAttribute("position",new Be([0,0,0,0,1,0],3)),wf=new Ro(0,.5,1,5,1),wf.translate(0,-.5,0)),this.position.copy(t),this.line=new Fr(kc,new kn({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new ln(wf,new zr({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,s,l)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{b0.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(b0,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class hb extends Wi{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new dt;i.setAttribute("position",new Be(t,3)),i.setAttribute("color",new Be(n,3));const s=new kn({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,n){const i=new Ie,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(n),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class fb{constructor(){this.type="ShapePath",this.color=new Ie,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Da,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,s,l){return this.currentPath.bezierCurveTo(e,t,n,i,s,l),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(v){const w=[];for(let E=0,A=v.length;E<A;E++){const N=v[E],R=new vs;R.curves=N.curves,w.push(R)}return w}function n(v,w){const E=w.length;let A=!1;for(let N=E-1,R=0;R<E;N=R++){let L=w[N],z=w[R],b=z.x-L.x,P=z.y-L.y;if(Math.abs(P)>Number.EPSILON){if(P<0&&(L=w[R],b=-b,z=w[N],P=-P),v.y<L.y||v.y>z.y)continue;if(v.y===L.y){if(v.x===L.x)return!0}else{const B=P*(v.x-L.x)-b*(v.y-L.y);if(B===0)return!0;if(B<0)continue;A=!A}}else{if(v.y!==L.y)continue;if(z.x<=v.x&&v.x<=L.x||L.x<=v.x&&v.x<=z.x)return!0}}return A}const i=Hi.isClockWise,s=this.subPaths;if(s.length===0)return[];let l,c,u;const h=[];if(s.length===1)return c=s[0],u=new vs,u.curves=c.curves,h.push(u),h;let f=!i(s[0].getPoints());f=e?!f:f;const p=[],m=[];let g=[],y=0,M;m[y]=void 0,g[y]=[];for(let v=0,w=s.length;v<w;v++)c=s[v],M=c.getPoints(),l=i(M),l=e?!l:l,l?(!f&&m[y]&&y++,m[y]={s:new vs,p:M},m[y].s.curves=c.curves,f&&y++,g[y]=[]):g[y].push({h:c,p:M[0]});if(!m[0])return t(s);if(m.length>1){let v=!1,w=0;for(let E=0,A=m.length;E<A;E++)p[E]=[];for(let E=0,A=m.length;E<A;E++){const N=g[E];for(let R=0;R<N.length;R++){const L=N[R];let z=!0;for(let b=0;b<m.length;b++)n(L.p,m[b].p)&&(E!==b&&w++,z?(z=!1,p[b].push(L)):v=!0);z&&p[E].push(L)}}w>0&&v===!1&&(g=p)}let x;for(let v=0,w=m.length;v<w;v++){u=m[v].s,h.push(u),x=g[v];for(let E=0,A=x.length;E<A;E++)u.holes.push(x[E].h)}return h}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:ou}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=ou);const db=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Ld,AddEquation:Rr,AddOperation:A_,AdditiveAnimationBlendMode:kd,AdditiveBlending:Hf,AgXToneMapping:L_,AlphaFormat:U_,AlwaysCompare:$_,AlwaysDepth:y_,AlwaysStencilFunc:vd,AmbientLight:ey,AnimationAction:ly,AnimationClip:za,AnimationLoader:pA,AnimationMixer:GA,AnimationObjectGroup:HA,AnimationUtils:uA,ArcCurve:Tv,ArrayCamera:mv,ArrowHelper:ub,AttachedBindMode:qf,Audio:oy,AudioAnalyser:LA,AudioContext:mp,AudioListener:CA,AudioLoader:TA,AxesHelper:hb,BackSide:Bn,BasicDepthPacking:W_,BasicShadowMap:t_,BatchedMesh:Mv,Bone:tp,BooleanKeyframeTrack:Es,Box2:jA,Box3:zn,Box3Helper:lb,BoxGeometry:Ms,BoxHelper:ab,BufferAttribute:bt,BufferGeometry:dt,BufferGeometryLoader:sy,ByteType:D_,Cache:sr,Camera:Wa,CameraHelper:ob,CanvasTexture:NT,CapsuleGeometry:xu,CatmullRomCurve3:Av,CineonToneMapping:R_,CircleGeometry:Su,ClampToEdgeWrapping:Pn,Clock:gp,Color:Ie,ColorKeyframeTrack:fp,ColorManagement:Rt,CompressedArrayTexture:IT,CompressedCubeTexture:DT,CompressedTexture:vu,CompressedTextureLoader:mA,ConeGeometry:Mu,ConstantAlphaFactor:g_,ConstantColorFactor:p_,CubeCamera:ov,CubeReflectionMapping:lr,CubeRefractionMapping:Ur,CubeTexture:Xa,CubeTextureLoader:gA,CubeUVReflectionMapping:Ao,CubicBezierCurve:rp,CubicBezierCurve3:bv,CubicInterpolant:qv,CullFaceBack:kf,CullFaceFront:e_,CullFaceFrontBack:Sx,CullFaceNone:$0,Curve:bi,CurvePath:Rv,CustomBlending:n_,CustomToneMapping:P_,CylinderGeometry:Ro,Cylindrical:JA,Data3DTexture:Xd,DataArrayTexture:fu,DataTexture:_s,DataTextureLoader:_A,DataUtils:LS,DecrementStencilOp:Dx,DecrementWrapStencilOp:Ux,DefaultLoadingManager:Jv,DepthFormat:Dr,DepthStencilFormat:ys,DepthTexture:Jd,DetachedBindMode:I_,DirectionalLight:$v,DirectionalLightHelper:sb,DiscreteInterpolant:Yv,DisplayP3ColorSpace:hu,DodecahedronGeometry:Eu,DoubleSide:Bi,DstAlphaFactor:c_,DstColorFactor:h_,DynamicCopyUsage:jx,DynamicDrawUsage:Wx,DynamicReadUsage:Yx,EdgesGeometry:Pv,EllipseCurve:yu,EqualCompare:J_,EqualDepth:S_,EqualStencilFunc:zx,EquirectangularReflectionMapping:Sa,EquirectangularRefractionMapping:Ma,Euler:Ga,EventDispatcher:ur,ExtrudeGeometry:Tu,FileLoader:cr,Float16BufferAttribute:FS,Float32BufferAttribute:Be,Float64BufferAttribute:BS,FloatType:wi,Fog:mu,FogExp2:pu,FramebufferTexture:LT,FrontSide:ar,Frustum:qa,GLBufferAttribute:YA,GLSL1:Qx,GLSL3:yd,GreaterCompare:j_,GreaterDepth:E_,GreaterEqualCompare:Q_,GreaterEqualDepth:M_,GreaterEqualStencilFunc:Gx,GreaterStencilFunc:Hx,GridHelper:ib,Group:go,HalfFloatType:xo,HemisphereLight:jv,HemisphereLightHelper:nb,IcosahedronGeometry:Au,ImageBitmapLoader:wA,ImageLoader:ka,ImageUtils:Wd,IncrementStencilOp:Ix,IncrementWrapStencilOp:Nx,InstancedBufferAttribute:wo,InstancedBufferGeometry:ry,InstancedInterleavedBuffer:qA,InstancedMesh:Sv,Int16BufferAttribute:US,Int32BufferAttribute:OS,Int8BufferAttribute:IS,IntType:Dd,InterleavedBuffer:gu,InterleavedBufferAttribute:xs,Interpolant:Qa,InterpolateDiscrete:Ta,InterpolateLinear:Aa,InterpolateSmooth:jc,InvertStencilOp:Ox,KeepStencilOp:as,KeyframeTrack:Ci,LOD:yv,LatheGeometry:Ja,Layers:gs,LessCompare:Z_,LessDepth:x_,LessEqualCompare:Vd,LessEqualDepth:xa,LessEqualStencilFunc:kx,LessStencilFunc:Bx,Light:Hr,LightProbe:iy,Line:Fr,Line3:KA,LineBasicMaterial:kn,LineCurve:sp,LineCurve3:Cv,LineDashedMaterial:Gv,LineLoop:Ev,LineSegments:Wi,LinearDisplayP3ColorSpace:Va,LinearEncoding:Hd,LinearFilter:en,LinearInterpolant:hp,LinearMipMapLinearFilter:Ax,LinearMipMapNearestFilter:Tx,LinearMipmapLinearFilter:Or,LinearMipmapNearestFilter:Id,LinearSRGBColorSpace:Vi,LinearToneMapping:b_,LinearTransfer:Ca,Loader:Zn,LoaderUtils:bd,LoadingManager:dp,LoopOnce:H_,LoopPingPong:G_,LoopRepeat:V_,LuminanceAlphaFormat:F_,LuminanceFormat:O_,MOUSE:yx,Material:In,MaterialLoader:Du,MathUtils:dS,Matrix3:gt,Matrix4:tt,MaxEquation:Xf,Mesh:ln,MeshBasicMaterial:zr,MeshDepthMaterial:jd,MeshDistanceMaterial:Kd,MeshLambertMaterial:Hv,Me
3686shMatcapMaterial:Vv,MeshNormalMaterial:kv,MeshPhongMaterial:Bv,MeshPhysicalMaterial:Fv,MeshStandardMaterial:cp,MeshToonMaterial:zv,MinEquation:Wf,MirroredRepeatWrapping:wa,MixOperation:T_,MultiplyBlending:Gf,MultiplyOperation:Ha,NearestFilter:$t,NearestMipMapLinearFilter:wx,NearestMipMapNearestFilter:Ex,NearestMipmapLinearFilter:ma,NearestMipmapNearestFilter:tu,NeverCompare:Y_,NeverDepth:v_,NeverStencilFunc:Fx,NoBlending:or,NoColorSpace:ni,NoToneMapping:zi,NormalAnimationBlendMode:uu,NormalBlending:ps,NotEqualCompare:K_,NotEqualDepth:w_,NotEqualStencilFunc:Vx,NumberKeyframeTrack:Fa,Object3D:At,ObjectLoader:MA,ObjectSpaceNormalMap:q_,OctahedronGeometry:ja,OneFactor:o_,OneMinusConstantAlphaFactor:__,OneMinusConstantColorFactor:m_,OneMinusDstAlphaFactor:u_,OneMinusDstColorFactor:f_,OneMinusSrcAlphaFactor:eu,OneMinusSrcColorFactor:l_,OrthographicCamera:Za,P3Primaries:Pa,PCFShadowMap:au,PCFSoftShadowMap:pa,PMREMGenerator:Sd,Path:Da,PerspectiveCamera:vn,Plane:Cr,PlaneGeometry:Ya,PlaneHelper:cb,PointLight:Qv,PointLightHelper:eb,Points:wv,PointsMaterial:np,PolarGridHelper:rb,PolyhedronGeometry:kr,PositionalAudio:PA,PropertyBinding:St,PropertyMixer:ay,QuadraticBezierCurve:op,QuadraticBezierCurve3:ap,Quaternion:Yn,QuaternionKeyframeTrack:Po,QuaternionLinearInterpolant:Zv,RED_GREEN_RGTC2_Format:gd,RED_RGTC1_Format:k_,REVISION:ou,RGBADepthPacking:X_,RGBAFormat:Fn,RGBAIntegerFormat:Bd,RGBA_ASTC_10x10_Format:ud,RGBA_ASTC_10x5_Format:ad,RGBA_ASTC_10x6_Format:ld,RGBA_ASTC_10x8_Format:cd,RGBA_ASTC_12x10_Format:hd,RGBA_ASTC_12x12_Format:fd,RGBA_ASTC_4x4_Format:$f,RGBA_ASTC_5x4_Format:ed,RGBA_ASTC_5x5_Format:td,RGBA_ASTC_6x5_Format:nd,RGBA_ASTC_6x6_Format:id,RGBA_ASTC_8x5_Format:rd,RGBA_ASTC_8x6_Format:sd,RGBA_ASTC_8x8_Format:od,RGBA_BPTC_Format:Jc,RGBA_ETC2_EAC_Format:Qf,RGBA_PVRTC_2BPPV1_Format:jf,RGBA_PVRTC_4BPPV1_Format:Jf,RGBA_S3TC_DXT1_Format:qc,RGBA_S3TC_DXT3_Format:Yc,RGBA_S3TC_DXT5_Format:Zc,RGB_BPTC_SIGNED_Format:dd,RGB_BPTC_UNSIGNED_Format:pd,RGB_ETC1_Format:zd,RGB_ETC2_Format:Kf,RGB_PVRTC_2BPPV1_Format:Zf,RGB_PVRTC_4BPPV1_Format:Yf,RGB_S3TC_DXT1_Format:Xc,RGFormat:z_,RGIntegerFormat:Fd,RawShaderMaterial:Ov,Ray:bo,Raycaster:cy,Rec709Primaries:Ra,RectAreaLight:ty,RedFormat:B_,RedIntegerFormat:Od,ReinhardToneMapping:C_,RenderTarget:nv,RepeatWrapping:Ea,ReplaceStencilOp:Lx,ReverseSubtractEquation:r_,RingGeometry:bu,SIGNED_RED_GREEN_RGTC2_Format:_d,SIGNED_RED_RGTC1_Format:md,SRGBColorSpace:an,SRGBTransfer:Nt,Scene:$d,ShaderChunk:ht,ShaderLib:Ei,ShaderMaterial:Gi,ShadowMaterial:Uv,Shape:vs,ShapeGeometry:Cu,ShapePath:fb,ShapeUtils:Hi,ShortType:N_,Skeleton:_u,SkeletonHelper:$A,SkinnedMesh:xv,Source:fs,Sphere:Ln,SphereGeometry:Ka,Spherical:ZA,SphericalHarmonics3:ny,SplineCurve:lp,SpotLight:Kv,SpotLightHelper:QA,Sprite:vv,SpriteMaterial:ep,SrcAlphaFactor:$c,SrcAlphaSaturateFactor:d_,SrcColorFactor:a_,StaticCopyUsage:Jx,StaticDrawUsage:La,StaticReadUsage:qx,StereoCamera:AA,StreamCopyUsage:Kx,StreamDrawUsage:Xx,StreamReadUsage:Zx,StringKeyframeTrack:ws,SubtractEquation:i_,SubtractiveBlending:Vf,TOUCH:xx,TangentSpaceNormalMap:Br,TetrahedronGeometry:Ru,Texture:tn,TextureLoader:vA,TorusGeometry:Pu,TorusKnotGeometry:Lu,Triangle:Xn,TriangleFanDrawMode:Rx,TriangleStripDrawMode:Cx,TrianglesDrawMode:bx,TubeGeometry:Iu,TwoPassDoubleSide:Mx,UVMapping:lu,Uint16BufferAttribute:qd,Uint32BufferAttribute:Yd,Uint8BufferAttribute:DS,Uint8ClampedBufferAttribute:NS,Uniform:yp,UniformsGroup:XA,UniformsLib:Me,UniformsUtils:sv,UnsignedByteType:ki,UnsignedInt248Type:Ir,UnsignedIntType:rr,UnsignedShort4444Type:Nd,UnsignedShort5551Type:Ud,UnsignedShortType:cu,VSMShadowMap:Mi,Vector2:fe,Vector3:U,Vector4:Pt,VectorKeyframeTrack:Ba,VideoTexture:PT,WebGL1Renderer:gv,WebGL3DRenderTarget:yS,WebGLArrayRenderTarget:vS,WebGLCoordinateSystem:Ti,WebGLCubeRenderTarget:av,WebGLMultipleRenderTargets:xS,WebGLRenderTarget:Ai,WebGLRenderer:Qd,WebGLUtils:pv,WebGPUCoordinateSystem:So,WireframeGeometry:Nv,WrapAroundEnding:ba,ZeroCurvatureEnding:us,ZeroFactor:s_,ZeroSlopeEnding:hs,ZeroStencilOp:Px,_SRGBAFormat:nu,createCanvasElement:tv,sRGBEncoding:Nr},Symbol.toStringTag,{value:"Module"}));var Tf={exports:{}},br={};/**
3687 * @license React
3688 * react-reconciler-constants.production.min.js
3689 *
3690 * Copyright (c) Facebook, Inc. and its affiliates.
3691 *
3692 * This source code is licensed under the MIT license found in the
3693 * LICENSE file in the root directory of this source tree.
3694 */var C0;function pb(){return C0||(C0=1,br.ConcurrentRoot=1,br.ContinuousEventPriority=4,br.DefaultEventPriority=16,br.DiscreteEventPriority=1,br.IdleEventPriority=536870912,br.LegacyRoot=0),br}var R0;
vendor: 12,405 bytes, lines 3694-3711
3694function mb(){return R0||(R0=1,Tf.exports=pb()),Tf.exports}var vo=mb();function gb(r){let e;const t=new Set,n=(h,f)=>{const p=typeof h=="function"?h(e):h;if(p!==e){const m=e;e=f?p:Object.assign({},e,p),t.forEach(g=>g(e,m))}},i=()=>e,s=(h,f=i,p=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let m=f(e);function g(){const y=f(e);if(!p(m,y)){const M=m;h(m=y,M)}}return t.add(g),()=>t.delete(g)},u={setState:n,getState:i,subscribe:(h,f,p)=>f||p?s(h,f,p):(t.add(h),()=>t.delete(h)),destroy:()=>t.clear()};return e=r(n,i,u),u}const _b=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),P0=_b?ke.useEffect:ke.useLayoutEffect;function vb(r){const e=typeof r=="function"?gb(r):r,t=(n=e.getState,i=Object.is)=>{const[,s]=ke.useReducer(x=>x+1,0),l=e.getState(),c=ke.useRef(l),u=ke.useRef(n),h=ke.useRef(i),f=ke.useRef(!1),p=ke.useRef();p.current===void 0&&(p.current=n(l));let m,g=!1;(c.current!==l||u.current!==n||h.current!==i||f.current)&&(m=n(l),g=!i(p.current,m)),P0(()=>{g&&(p.current=m),c.current=l,u.current=n,h.current=i,f.current=!1});const y=ke.useRef(l);P0(()=>{const x=()=>{try{const w=e.getState(),E=u.current(w);h.current(p.current,E)||(c.current=w,p.current=E,s())}catch{f.current=!0,s()}},v=e.subscribe(x);return e.getState()!==y.current&&x(),v},[]);const M=g?m:p.current;return ke.useDebugValue(M),M};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const n=[t,e];return{next(){const i=n.length<=0;return{value:n.shift(),done:i}}}},t}var Af={exports:{}},bf={exports:{}},Cf={};/**
3695 * @license React
3696 * scheduler.production.min.js
3697 *
3698 * Copyright (c) Facebook, Inc. and its affiliates.
3699 *
3700 * This source code is licensed under the MIT license found in the
3701 * LICENSE file in the root directory of this source tree.
3702 */var L0;function yb(){return L0||(L0=1,(function(r){function e(F,H){var W=F.length;F.push(H);e:for(;0<W;){var Y=W-1>>>1,oe=F[Y];if(0<i(oe,H))F[Y]=H,F[W]=oe,W=Y;else break e}}function t(F){return F.length===0?null:F[0]}function n(F){if(F.length===0)return null;var H=F[0],W=F.pop();if(W!==H){F[0]=W;e:for(var Y=0,oe=F.length,j=oe>>>1;Y<j;){var ae=2*(Y+1)-1,xe=F[ae],Te=ae+1,Ee=F[Te];if(0>i(xe,W))Te<oe&&0>i(Ee,xe)?(F[Y]=Ee,F[Te]=W,Y=Te):(F[Y]=xe,F[ae]=W,Y=ae);else if(Te<oe&&0>i(Ee,W))F[Y]=Ee,F[Te]=W,Y=Te;else break e}}return H}function i(F,H){var W=F.sortIndex-H.sortIndex;return W!==0?W:F.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;r.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();r.unstable_now=function(){return l.now()-c}}var u=[],h=[],f=1,p=null,m=3,g=!1,y=!1,M=!1,x=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(F){for(var H=t(h);H!==null;){if(H.callback===null)n(h);else if(H.startTime<=F)n(h),H.sortIndex=H.expirationTime,e(u,H);else break;H=t(h)}}function A(F){if(M=!1,E(F),!y)if(t(u)!==null)y=!0,ee(N);else{var H=t(h);H!==null&&le(A,H.startTime-F)}}function N(F,H){y=!1,M&&(M=!1,v(z),z=-1),g=!0;var W=m;try{for(E(H),p=t(u);p!==null&&(!(p.expirationTime>H)||F&&!B());){var Y=p.callback;if(typeof Y=="function"){p.callback=null,m=p.priorityLevel;var oe=Y(p.expirationTime<=H);H=r.unstable_now(),typeof oe=="function"?p.callback=oe:p===t(u)&&n(u),E(H)}else n(u);p=t(u)}if(p!==null)var j=!0;else{var ae=t(h);ae!==null&&le(A,ae.startTime-H),j=!1}return j}finally{p=null,m=W,g=!1}}var R=!1,L=null,z=-1,b=5,P=-1;function B(){return!(r.unstable_now()-P<b)}function Q(){if(L!==null){var F=r.unstable_now();P=F;var H=!0;try{H=L(!0,F)}finally{H?ce():(R=!1,L=null)}}else R=!1}var ce;if(typeof w=="function")ce=function(){w(Q)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,J=V.port2;V.port1.onmessage=Q,ce=function(){J.postMessage(null)}}else ce=function(){x(Q,0)};function ee(F){L=F,R||(R=!0,ce())}function le(F,H){z=x(function(){F(r.unstable_now())},H)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(F){F.callback=null},r.unstable_continueExecution=function(){y||g||(y=!0,ee(N))},r.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<F?Math.floor(1e3/F):5},r.unstable_getCurrentPriorityLevel=function(){return m},r.unstable_getFirstCallbackNode=function(){return t(u)},r.unstable_next=function(F){switch(m){case 1:case 2:case 3:var H=3;break;default:H=m}var W=m;m=H;try{return F()}finally{m=W}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(F,H){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var W=m;m=F;try{return H()}finally{m=W}},r.unstable_scheduleCallback=function(F,H,W){var Y=r.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?Y+W:Y):W=Y,F){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=W+oe,F={id:f++,callback:H,priorityLevel:F,startTime:W,expirationTime:oe,sortIndex:-1},W>Y?(F.sortIndex=W,e(h,F),t(u)===null&&F===t(h)&&(M?(v(z),z=-1):M=!0,le(A,W-Y))):(F.sortIndex=oe,e(u,F),y||g||(y=!0,ee(N))),F},r.unstable_shouldYield=B,r.unstable_wrapCallback=function(F){var H=m;return function(){var W=m;m=H;try{return F.apply(this,arguments)}finally{m=W}}}})(Cf)),Cf}var I0;function xb(){return I0||(I0=1,bf.exports=yb()),bf.exports}/**
3703 * @license React
3704 * react-reconciler.production.min.js
3705 *
3706 * Copyright (c) Facebook, Inc. and its affiliates.
3707 *
3708 * This source code is licensed under the MIT license found in the
3709 * LICENSE file in the root directory of this source tree.
3710 */var Rf,D0;function Sb(){return D0||(D0=1,Rf=function(e){var t={},n=_x(),i=xb(),s=Object.assign;function l(o){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),h=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),y=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),N=Symbol.iterator;function R(o){return o===null||typeof o!="object"?null:(o=N&&o[N]||o["@@iterator"],typeof o=="function"?o:null)}function L(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case f:return"Fragment";case h:return"Portal";case m:return"Profiler";case p:return"StrictMode";case x:return"Suspense";case v:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case y:return(o.displayName||"Context")+".Consumer";case g:return(o._context.displayName||"Context")+".Provider";case M:var a=o.render;return o=o.displayName,o||(o=a.displayName||a.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case w:return a=o.displayName||null,a!==null?a:L(o.type)||"Memo";case E:a=o._payload,o=o._init;try{return L(o(a))}catch{}}return null}function z(o){var a=o.type;switch(o.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=a.render,o=o.displayName||o.name||"",a.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return L(a);case 8:return a===p?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function b(o){var a=o,d=o;if(o.alternate)for(;a.return;)a=a.return;else{o=a;do a=o,(a.flags&4098)!==0&&(d=a.return),o=a.return;while(o)}return a.tag===3?d:null}function P(o){if(b(o)!==o)throw Error(l(188))}function B(o){var a=o.alternate;if(!a){if(a=b(o),a===null)throw Error(l(188));return a!==o?null:o}for(var d=o,_=a;;){var S=d.return;if(S===null)break;var T=S.alternate;if(T===null){if(_=S.return,_!==null){d=_;continue}break}if(S.child===T.child){for(T=S.child;T;){if(T===d)return P(S),o;if(T===_)return P(S),a;T=T.sibling}throw Error(l(188))}if(d.return!==_.return)d=S,_=T;else{for(var O=!1,X=S.child;X;){if(X===d){O=!0,d=S,_=T;break}if(X===_){O=!0,_=S,d=T;break}X=X.sibling}if(!O){for(X=T.child;X;){if(X===d){O=!0,d=T,_=S;break}if(X===_){O=!0,_=T,d=S;break}X=X.sibling}if(!O)throw Error(l(189))}}if(d.alternate!==_)throw Error(l(190))}if(d.tag!==3)throw Error(l(188));return d.stateNode.current===d?o:a}function Q(o){return o=B(o),o!==null?ce(o):null}function ce(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var a=ce(o);if(a!==null)return a;o=o.sibling}return null}function V(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){if(o.tag!==4){var a=V(o);if(a!==null)return a}o=o.sibling}return null}var J=Array.isArray,ee=e.getPublicInstance,le=e.getRootHostContext,F=e.getChildHostContext,H=e.prepareForCommit,W=e.resetAfterCommit,Y=e.createInstance,oe=e.appendInitialChild,j=e.finalizeInitialChildren,ae=e.prepareUpdate,xe=e.shouldSetTextContent,Te=e.createTextInstance,Ee=e.scheduleTimeout,et=e.cancelTimeout,nt=e.noTimeout,Fe=e.isPrimaryRenderer,Xe=e.supportsMutation,k=e.supportsPersistence,_e=e.supportsHydration,he=e.getInstanceFromNode,ve=e.preparePortalMount,ue=e.getCurrentEventPriority,We=e.detachDeletedInstance,Pe=e.supportsMicrotasks,I=e.scheduleMicrotask,C=e.supportsTestSelectors,K=e.findFiberRoot,ge=e.getBoundingRect,pe=e.getTextContent,de=e.isHiddenSubtree,ze=e.matchAccessibilityRole,we=e.setFocusIfFocusable,De=e.setupIntersectionObserver,Je=e.appendChild,at=e.appendChildToContainer,me=e.commitTextUpdate,xt=e.commitMount,_t=e.commitUpdate,rt=e.insertBefore,qe=e.insertInContainerBefore,Oe=e.removeChild,ut=e.removeChildFromContainer,Mt=e.resetTextContent,Ft=e.hideInstance,pt=e.hideTextInstance,Se=e.unhideInstance,G=e.unhideTextInstance,Ae=e.clearContainer,be=e.cloneInstance,Ke=e.createContainerChildSet,Ye=e.appendChildToContainerChildSet,Lt=e.finalizeContainerChildren,Ct=e.replaceContainerChildren,Yt=e.cloneHiddenInstance,hn=e.cloneHiddenTextInstance,It=e.canHydrateInstance,yn=e.canHydrateTextInstance,ri=e.canHydrateSuspenseInstance,Lo=e.isSuspenseInstancePending,Io=e.isSuspenseInstanceFallback,Ts=e.registerSuspenseInstanceRetry,hr=e.getNextHydratableSibling,As=e.getFirstHydratableChild,el=e.getFirstHydratableChildWithinContainer,tl=e.getFirstHydratableChildWithinSuspenseInstance,Nu=e.hydrateInstance,Uu=e.hydrateTextInstance,Ou=e.hydrateSuspenseInstance,D=e.getNextHydratableInstanceAfterSuspenseInstance,Z=e.commitHydratedContainer,ne=e.commitHydratedSuspenseInstance,ie=e.clearSuspenseBoundary,te=e.clearSuspenseBoundaryFromContainer,Le=e.shouldDeleteUnhydratedTailInstances,Ve=e.didNotMatchHydratedContainerTextInstance,je=e.didNotMatchHydratedTextInstance,Qe;function st(o){if(Qe===void 0)try{throw Error()}catch(d){var a=d.stack.trim().match(/\n( *(at )?)/);Qe=a&&a[1]||""}return`
3711`+Qe+o}var it=!1;function ot(o,a){if(!o||it)return"";it=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(ye){var _=ye}Reflect.construct(o,[],a)}else{try{a.call()}catch(ye){_=ye}o.call(a.prototype)}else{try{throw Error()}catch(ye){_=ye}o()}}
vendor: 5,147 bytes, lines 3711-3714
3711catch(ye){if(ye&&_&&typeof ye.stack=="string"){for(var S=ye.stack.split(`
3712`),T=_.stack.split(`
3713`),O=S.length-1,X=T.length-1;1<=O&&0<=X&&S[O]!==T[X];)X--;for(;1<=O&&0<=X;O--,X--)if(S[O]!==T[X]){if(O!==1||X!==1)do if(O--,X--,0>X||S[O]!==T[X]){var se=`
3714`+S[O].replace(" at new "," at ");return o.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",o.displayName)),se}while(1<=O&&0<=X);break}}}finally{it=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?st(o):""}var kt=Object.prototype.hasOwnProperty,xn=[],Ut=-1;function fn(o){return{current:o}}function $e(o){0>Ut||(o.current=xn[Ut],xn[Ut]=null,Ut--)}function Ne(o,a){Ut++,xn[Ut]=o.current,o.current=a}var si={},vt=fn(si),Gt=fn(!1),Ri=si;function oi(o,a){var d=o.type.contextTypes;if(!d)return si;var _=o.stateNode;if(_&&_.__reactInternalMemoizedUnmaskedChildContext===a)return _.__reactInternalMemoizedMaskedChildContext;var S={},T;for(T in d)S[T]=a[T];return _&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=a,o.__reactInternalMemoizedMaskedChildContext=S),S}function dn(o){return o=o.childContextTypes,o!=null}function Zt(){$e(Gt),$e(vt)}function Pi(o,a,d){if(vt.current!==si)throw Error(l(168));Ne(vt,a),Ne(Gt,d)}function bs(o,a,d){var _=o.stateNode;if(a=a.childContextTypes,typeof _.getChildContext!="function")return d;_=_.getChildContext();for(var S in _)if(!(S in a))throw Error(l(108,z(o)||"Unknown",S));return s({},d,_)}function Sn(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||si,Ri=vt.current,Ne(vt,o),Ne(Gt,Gt.current),!0}function Cs(o,a,d){var _=o.stateNode;if(!_)throw Error(l(169));d?(o=bs(o,a,Ri),_.__reactInternalMemoizedMergedChildContext=o,$e(Gt),$e(vt),Ne(vt,o)):$e(Gt),Ne(Gt,d)}var Jn=Math.clz32?Math.clz32:Cy,nl=Math.log,by=Math.LN2;function Cy(o){return o>>>=0,o===0?32:31-(nl(o)/by|0)|0}var il=64,rl=4194304;function Do(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function sl(o,a){var d=o.pendingLanes;if(d===0)return 0;var _=0,S=o.suspendedLanes,T=o.pingedLanes,O=d&268435455;if(O!==0){var X=O&~S;X!==0?_=Do(X):(T&=O,T!==0&&(_=Do(T)))}else O=d&~S,O!==0?_=Do(O):T!==0&&(_=Do(T));if(_===0)return 0;if(a!==0&&a!==_&&(a&S)===0&&(S=_&-_,T=a&-a,S>=T||S===16&&(T&4194240)!==0))return a;if((_&4)!==0&&(_|=d&16),a=o.entangledLanes,a!==0)for(o=o.entanglements,a&=_;0<a;)d=31-Jn(a),S=1<<d,_|=o[d],a&=~S;return _}function Ry(o,a){switch(o){case 1:case 2:case 4:return a+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Py(o,a){for(var d=o.suspendedLanes,_=o.pingedLanes,S=o.expirationTimes,T=o.pendingLanes;0<T;){var O=31-Jn(T),X=1<<O,se=S[O];se===-1?((X&d)===0||(X&_)!==0)&&(S[O]=Ry(X,a)):se<=a&&(o.expiredLanes|=X),T&=~X}}function Fu(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Bu(o){for(var a=[],d=0;31>d;d++)a.push(o);return a}function No(o,a,d){o.pendingLanes|=a,a!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,a=31-Jn(a),o[a]=d}function Ly(o,a){var d=o.pendingLanes&~a;o.pendingLanes=a,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=a,o.mutableReadLanes&=a,o.entangledLanes&=a,a=o.entanglements;var _=o.eventTimes;for(o=o.expirationTimes;0<d;){var S=31-Jn(d),T=1<<S;a[S]=0,_[S]=-1,o[S]=-1,d&=~T}}function zu(o,a){var d=o.entangledLanes|=a;for(o=o.entanglements;d;){var _=31-Jn(d),S=1<<_;S&a|o[_]&a&&(o[_]|=a),d&=~S}}var Et=0;function Mp(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var ku=i.unstable_scheduleCallback,Ep=i.unstable_cancelCallback,Iy=i.unstable_shouldYield,Dy=i.unstable_requestPaint,pn=i.unstable_now,Hu=i.unstable_ImmediatePriority,Ny=i.unstable_UserBlockingPriority,Vu=i.unstable_NormalPriority,Uy=i.unstable_IdlePriority,ol=null,Li=null;function Oy(o){if(Li&&typeof Li.onCommitFiberRoot=="function")try{Li.onCommitFiberRoot(ol,o,void 0,(o.current.flags&128)===128)}catch{}}function Fy(o,a){return o===a&&(o!==0||1/o===1/a)||o!==o&&a!==a}var Ii=typeof Object.is=="function"?Object.is:Fy,Xi=null,al=!1,Gu=!1;function wp(o){Xi===null?Xi=[o]:Xi.push(o)}function By(o){al=!0,wp(o)}function Di(){if(!Gu&&Xi!==null){Gu=!0;var o=0,a=Et;try{var d=Xi;for(Et=1;o<d.length;o++){var _=d[o];do _=_(!0);while(_!==null)}Xi=null,al=!1}catch(S){throw Xi!==null&&(Xi=Xi.slice(o+1)),ku(Hu,Di),S}finally{Et=a,Gu=!1}}return null}var zy=c.ReactCurrentBatchConfig;function ll(o,a){if(Ii(o,a))return!0;
vendor: 21,596 bytes, line 3714
3714if(typeof o!="object"||o===null||typeof a!="object"||a===null)return!1;var d=Object.keys(o),_=Object.keys(a);if(d.length!==_.length)return!1;for(_=0;_<d.length;_++){var S=d[_];if(!kt.call(a,S)||!Ii(o[S],a[S]))return!1}return!0}function ky(o){switch(o.tag){case 5:return st(o.type);case 16:return st("Lazy");case 13:return st("Suspense");case 19:return st("SuspenseList");case 0:case 2:case 15:return o=ot(o.type,!1),o;case 11:return o=ot(o.type.render,!1),o;case 1:return o=ot(o.type,!0),o;default:return""}}function gi(o,a){if(o&&o.defaultProps){a=s({},a),o=o.defaultProps;for(var d in o)a[d]===void 0&&(a[d]=o[d]);return a}return a}var cl=fn(null),ul=null,Rs=null,Wu=null;function Xu(){Wu=Rs=ul=null}function Tp(o,a,d){Fe?(Ne(cl,a._currentValue),a._currentValue=d):(Ne(cl,a._currentValue2),a._currentValue2=d)}function qu(o){var a=cl.current;$e(cl),Fe?o._currentValue=a:o._currentValue2=a}function Yu(o,a,d){for(;o!==null;){var _=o.alternate;if((o.childLanes&a)!==a?(o.childLanes|=a,_!==null&&(_.childLanes|=a)):_!==null&&(_.childLanes&a)!==a&&(_.childLanes|=a),o===d)break;o=o.return}}function Ps(o,a){ul=o,Wu=Rs=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&a)!==0&&(Qn=!0),o.firstContext=null)}function ai(o){var a=Fe?o._currentValue:o._currentValue2;if(Wu!==o)if(o={context:o,memoizedValue:a,next:null},Rs===null){if(ul===null)throw Error(l(308));Rs=o,ul.dependencies={lanes:0,firstContext:o}}else Rs=Rs.next=o;return a}var Ni=null,fr=!1;function Zu(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ap(o,a){o=o.updateQueue,a.updateQueue===o&&(a.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function qi(o,a){return{eventTime:o,lane:a,tag:0,payload:null,callback:null,next:null}}function dr(o,a){var d=o.updateQueue;d!==null&&(d=d.shared,nn!==null&&(o.mode&1)!==0&&(yt&2)===0?(o=d.interleaved,o===null?(a.next=a,Ni===null?Ni=[d]:Ni.push(d)):(a.next=o.next,o.next=a),d.interleaved=a):(o=d.pending,o===null?a.next=a:(a.next=o.next,o.next=a),d.pending=a))}function hl(o,a,d){if(a=a.updateQueue,a!==null&&(a=a.shared,(d&4194240)!==0)){var _=a.lanes;_&=o.pendingLanes,d|=_,a.lanes=d,zu(o,d)}}function bp(o,a){var d=o.updateQueue,_=o.alternate;if(_!==null&&(_=_.updateQueue,d===_)){var S=null,T=null;if(d=d.firstBaseUpdate,d!==null){do{var O={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};T===null?S=T=O:T=T.next=O,d=d.next}while(d!==null);T===null?S=T=a:T=T.next=a}else S=T=a;d={baseState:_.baseState,firstBaseUpdate:S,lastBaseUpdate:T,shared:_.shared,effects:_.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=a:o.next=a,d.lastBaseUpdate=a}function fl(o,a,d,_){var S=o.updateQueue;fr=!1;var T=S.firstBaseUpdate,O=S.lastBaseUpdate,X=S.shared.pending;if(X!==null){S.shared.pending=null;var se=X,ye=se.next;se.next=null,O===null?T=ye:O.next=ye,O=se;var Ue=o.alternate;Ue!==null&&(Ue=Ue.updateQueue,X=Ue.lastBaseUpdate,X!==O&&(X===null?Ue.firstBaseUpdate=ye:X.next=ye,Ue.lastBaseUpdate=se))}if(T!==null){var lt=S.baseState;O=0,Ue=ye=se=null,X=T;do{var Ze=X.lane,Dt=X.eventTime;if((_&Ze)===Ze){Ue!==null&&(Ue=Ue.next={eventTime:Dt,lane:0,tag:X.tag,payload:X.payload,callback:X.callback,next:null});e:{var Ge=o,An=X;switch(Ze=a,Dt=d,An.tag){case 1:if(Ge=An.payload,typeof Ge=="function"){lt=Ge.call(Dt,lt,Ze);break e}lt=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=An.payload,Ze=typeof Ge=="function"?Ge.call(Dt,lt,Ze):Ge,Ze==null)break e;lt=s({},lt,Ze);break e;case 2:fr=!0}}X.callback!==null&&X.lane!==0&&(o.flags|=64,Ze=S.effects,Ze===null?S.effects=[X]:Ze.push(X))}else Dt={eventTime:Dt,lane:Ze,tag:X.tag,payload:X.payload,callback:X.callback,next:null},Ue===null?(ye=Ue=Dt,se=lt):Ue=Ue.next=Dt,O|=Ze;if(X=X.next,X===null){if(X=S.shared.pending,X===null)break;Ze=X,X=Ze.next,Ze.next=null,S.lastBaseUpdate=Ze,S.shared.pending=null}}while(!0);if(Ue===null&&(se=lt),S.baseState=se,S.firstBaseUpdate=ye,S.lastBaseUpdate=Ue,a=S.shared.interleaved,a!==null){S=a;do O|=S.lane,S=S.next;while(S!==a)}else T===null&&(S.shared.lanes=0);zs|=O,o.lanes=O,o.memoizedState=lt}}function Cp(o,a,d){if(o=a.effects,a.effects=null,o!==null)for(a=0;a<o.length;a++){var _=o[a],S=_.callback;if(S!==null){if(_.callback=null,_=d,typeof S!="function")throw Error(l(191,S));S.call(_)}}}var Rp=new n.Component().refs;function Ju(o,a,d,_){a=o.memoizedState,d=d(_,a),d=d==null?a:s({},a,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var dl={isMounted:function(o){return(o=o._reactInternals)?b(o)===o:!1},enqueueSetState:function(o,a,d){o=o._reactInternals;var _=Nn(),S=gr(o),T=qi(_,S);T.payload=a,d!=null&&(T.callback=d),dr(o,T),a=fi(o,S,_),a!==null&&hl(a,o,S)},enqueueReplaceState:function(o,a,d){o=o._reactInternals;var _=Nn(),S=gr(o),T=qi(_,S);T.tag=1,T.payload=a,d!=null&&(T.callback=d),dr(o,T),a=fi(o,S,_),a!==null&&hl(a,o,S)},enqueueForceUpdate:function(o,a){o=o._reactInternals;var d=Nn(),_=gr(o),S=qi(d,_);S.tag=2,a!=null&&(S.callback=a),dr(o,S),a=fi(o,_,d),a!==null&&hl(a,o,_)}};function Pp(o,a,d,_,S,T,O){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(_,T,O):a.prototype&&a.prototype.isPureReactComponent?!ll(d,_)||!ll(S,T):!0}function Lp(o,a,d){var _=!1,S=si,T=a.contextType;return typeof T=="object"&&T!==null?T=ai(T):(S=dn(a)?Ri:vt.current,_=a.contextTypes,T=(_=_!=null)?oi(o,S):si),a=new a(d,T),o.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=dl,o.stateNode=a,a._reactInternals=o,_&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=S,o.__reactInternalMemoizedMaskedChildContext=T),a}function Ip(o,a,d,_){o=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(d,_),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(d,_),a.state!==o&&dl.enqueueReplaceState(a,a.state,null)}function ju(o,a,d,_){var S=o.stateNode;S.props=d,S.state=o.memoizedState,S.refs=Rp,Zu(o);var T=a.contextType;typeof T=="object"&&T!==null?S.context=ai(T):(T=dn(a)?Ri:vt.current,S.context=oi(o,T)),S.state=o.memoizedState,T=a.getDerivedStateFromProps,typeof T=="function"&&(Ju(o,a,T,d),S.state=o.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(a=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),a!==S.state&&dl.enqueueReplaceState(S,S.state,null),fl(o,d,S,_),S.state=o.memoizedState),typeof S.componentDidMount=="function"&&(o.flags|=4194308)}var Ls=[],Is=0,pl=null,ml=0,li=[],ci=0,Vr=null,Yi=1,Zi="";function Gr(o,a){Ls[Is++]=ml,Ls[Is++]=pl,pl=o,ml=a}function Dp(o,a,d){li[ci++]=Yi,li[ci++]=Zi,li[ci++]=Vr,Vr=o;var _=Yi;o=Zi;var S=32-Jn(_)-1;_&=~(1<<S),d+=1;var T=32-Jn(a)+S;if(30<T){var O=S-S%5;T=(_&(1<<O)-1).toString(32),_>>=O,S-=O,Yi=1<<32-Jn(a)+S|d<<S|_,Zi=T+o}else Yi=1<<T|d<<S|_,Zi=o}function Ku(o){o.return!==null&&(Gr(o,1),Dp(o,1,0))}function Qu(o){for(;o===pl;)pl=Ls[--Is],Ls[Is]=null,ml=Ls[--Is],Ls[Is]=null;for(;o===Vr;)Vr=li[--ci],li[ci]=null,Zi=li[--ci],li[ci]=null,Yi=li[--ci],li[ci]=null}var jn=null,Kn=null,Bt=!1,Uo=!1,_i=null;function Np(o,a){var d=di(5,null,null,0);d.elementType="DELETED",d.stateNode=a,d.return=o,a=o.deletions,a===null?(o.deletions=[d],o.flags|=16):a.push(d)}function Up(o,a){switch(o.tag){case 5:return a=It(a,o.type,o.pendingProps),a!==null?(o.stateNode=a,jn=o,Kn=As(a),!0):!1;case 6:return a=yn(a,o.pendingProps),a!==null?(o.stateNode=a,jn=o,Kn=null,!0):!1;case 13:if(a=ri(a),a!==null){var d=Vr!==null?{id:Yi,overflow:Zi}:null;return o.memoizedState={dehydrated:a,treeContext:d,retryLane:1073741824},d=di(18,null,null,0),d.stateNode=a,d.return=o,o.child=d,jn=o,Kn=null,!0}return!1;default:return!1}}function $u(o){return(o.mode&1)!==0&&(o.flags&128)===0}function eh(o){if(Bt){var a=Kn;if(a){var d=a;if(!Up(o,a)){if($u(o))throw Error(l(418));a=hr(d);var _=jn;a&&Up(o,a)?Np(_,d):(o.flags=o.flags&-4097|2,Bt=!1,jn=o)}}else{if($u(o))throw Error(l(418));o.flags=o.flags&-4097|2,Bt=!1,jn=o}}}function Op(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;jn=o}function Oo(o){if(!_e||o!==jn)return!1;if(!Bt)return Op(o),Bt=!0,!1;if(o.tag!==3&&(o.tag!==5||Le(o.type)&&!xe(o.type,o.memoizedProps))){var a=Kn;if(a){if($u(o)){for(o=Kn;o;)o=hr(o);throw Error(l(418))}for(;a;)Np(o,a),a=hr(a)}}if(Op(o),o.tag===13){if(!_e)throw Error(l(316));if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(l(317));Kn=D(o)}else Kn=jn?hr(o.stateNode):null;return!0}function Ds(){_e&&(Kn=jn=null,Uo=Bt=!1)}function th(o){_i===null?_i=[o]:_i.push(o)}function Fo(o,a,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(l(309));var _=d.stateNode}if(!_)throw Error(l(147,o));var S=_,T=""+o;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===T?a.ref:(a=function(O){var X=S.refs;X===Rp&&(X=S.refs={}),O===null?delete X[T]:X[T]=O},a._stringRef=T,a)}if(typeof o!="string")throw Error(l(284));if(!d._owner)throw Error(l(290,o))}return o}function gl(o,a){throw o=Object.prototype.toString.call(a),Error(l(31,o==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":o))}function Fp(o){var a=o._init;return a(o._payload)}function Bp(o){function a($,q){if(o){var re=$.deletions;re===null?($.deletions=[q],$.flags|=16):re.push(q)}}function d($,q){if(!o)return null;for(;q!==null;)a($,q),q=q.sibling;return null}function _($,q){for($=new Map;q!==null;)q.key!==null?$.set(q.key,q):$.set(q.index,q),q=q.sibling;return $}function S($,q){return $=vr($,q),$.index=0,$.sibling=null,$}function T($,q,re){return $.index=re,o?(re=$.alternate,re!==null?(re=re.index,re<q?($.flags|=2,q):re):($.flags|=2,q)):($.flags|=1048576,q)}function O($){return o&&$.alternate===null&&($.flags|=2),$}function X($,q,re,Re){return q===null||q.tag!==6?(q=Bh(re,$.mode,Re),q.return=$,q):(q=S(q,re),q.return=$,q)}function se($,q,re,Re){var He=re.type;return He===f?Ue($,q,re.props.children,Re,re.key):q!==null&&(q.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===E&&Fp(He)===q.type)?(Re=S(q,re.props),Re.ref=Fo($,q,re),Re.return=$,Re):(Re=Yl(re.type,re.key,re.props,null,$.mode,Re),Re.ref=Fo($,q,re),Re.return=$,Re)}function ye($,q,re,Re){return q===null||q.tag!==4||q.stateNode.containerInfo!==re.containerInfo||q.stateNode.implementation!==re.implementation?(q=zh(re,$.mode,Re),q.return=$,q):(q=S(q,re.children||[]),q.return=$,q)}function Ue($,q,re,Re,He){return q===null||q.tag!==7?(q=jr(re,$.mode,Re,He),q.return=$,q):(q=S(q,re),q.return=$,q)}function lt($,q,re){if(typeof q=="string"&&q!==""||typeof q=="number")return q=Bh(""+q,$.mode,re),q.return=$,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case u:return re=Yl(q.type,q.key,q.props,null,$.mode,re),re.ref=Fo($,null,q),re.return=$,re;case h:return q=zh(q,$.mode,re),q.return=$,q;case E:var Re=q._init;return lt($,Re(q._payload),re)}if(J(q)||R(q))return q=jr(q,$.mode,re,null),q.return=$,q;gl($,q)}return null}function Ze($,q,re,Re){var He=q!==null?q.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return He!==null?null:X($,q,""+re,Re);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case u:return re.key===He?se($,q,re,Re):null;case h:return re.key===He?ye($,q,re,Re):null;case E:return He=re._init,Ze($,q,He(re._payload),Re)}if(J(re)||R(re))return He!==null?null:Ue($,q,re,Re,null);gl($,re)}return null}function Dt($,q,re,Re,He){if(typeof Re=="string"&&Re!==""||typeof Re=="number")return $=$.get(re)||null,X(q,$,""+Re,He);if(typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case u:return $=$.get(Re.key===null?re:Re.key)||null,se(q,$,Re,He);case h:return $=$.get(Re.key===null?re:Re.key)||null,ye(q,$,Re,He);case E:var mt=Re._init;return Dt($,q,re,mt(Re._payload),He)}if(J(Re)||R(Re))return $=$.get(re)||null,Ue(q,$,Re,He,null);gl(q,Re)}return null}function Ge($,q,re,Re){for(var He=null,mt=null,ct=q,wt=q=0,gn=null;ct!==null&&wt<re.length;wt++){ct.index>wt?(gn=ct,ct=null):gn=ct.sibling;var Tt=Ze($,ct,re[wt],Re);if(Tt===null){ct===null&&(ct=gn);break}o&&ct&&Tt.alternate===null&&a($,ct),q=T(Tt,q,wt),mt===null?He=Tt:mt.sibling=Tt,mt=Tt,ct=gn}if(wt===re.length)return d($,ct),Bt&&Gr($,wt),He;if(ct===null){for(;wt<re.length;wt++)ct=lt($,re[wt],Re),ct!==null&&(q=T(ct,q,wt),mt===null?He=ct:mt.sibling=ct,mt=ct);return Bt&&Gr($,wt),He}for(ct=_($,ct);wt<re.length;wt++)gn=Dt(ct,$,wt,re[wt],Re),gn!==null&&(o&&gn.alternate!==null&&ct.delete(gn.key===null?wt:gn.key),q=T(gn,q,wt),mt===null?He=gn:mt.sibling=gn,mt=gn);return o&&ct.forEach(function(yr){return a($,yr)}),Bt&&Gr($,wt),He}function An($,q,re,Re){var He=R(re);if(typeof He!="function")throw Error(l(150));if(re=He.call(re),re==null)throw Error(l(151));for(var mt=He=null,ct=q,wt=q=0,gn=null,Tt=re.next();ct!==null&&!Tt.done;wt++,Tt=re.next()){ct.index>wt?(gn=ct,ct=null):gn=ct.sibling;var yr=Ze($,ct,Tt.value,Re);if(yr===null){ct===null&&(ct=gn);break}o&&ct&&yr.alternate===null&&a($,ct),q=T(yr,q,wt),mt===null?He=yr:mt.sibling=yr,mt=yr,ct=gn}if(Tt.done)return d($,ct),Bt&&Gr($,wt),He;if(ct===null){for(;!Tt.done;wt++,Tt=re.next())Tt=lt($,Tt.value,Re),Tt!==null&&(q=T(Tt,q,wt),mt===null?He=Tt:mt.sibling=Tt,mt=Tt);return Bt&&Gr($,wt),He}for(ct=_($,ct);!Tt.done;wt++,Tt=re.next())Tt=Dt(ct,$,wt,Tt.value,Re),Tt!==null&&(o&&Tt.alternate!==null&&ct.delete(Tt.key===null?wt:Tt.key),q=T(Tt,q,wt),mt===null?He=Tt:mt.sibling=Tt,mt=Tt);return o&&ct.forEach(function(gx){return a($,gx)}),Bt&&Gr($,wt),He}function pi($,q,re,Re){if(typeof re=="object"&&re!==null&&re.type===f&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case u:e:{for(var He=re.key,mt=q;mt!==null;){if(mt.key===He){if(He=re.type,He===f){if(mt.tag===7){d($,mt.sibling),q=S(mt,re.props.children),q.return=$,$=q;break e}}else if(mt.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===E&&Fp(He)===mt.type){d($,mt.sibling),q=S(mt,re.props),q.ref=Fo($,mt,re),q.return=$,$=q;break e}d($,mt);break}else a($,mt);mt=mt.sibling}re.type===f?(q=jr(re.props.children,$.mode,Re,re.key),q.return=$,$=q):(Re=Yl(re.type,re.key,re.props,null,$.mode,Re),Re.ref=Fo($,q,re),Re.return=$,$=Re)}return O($);case h:e:{for(mt=re.key;q!==null;){if(q.key===mt)if(q.tag===4&&q.stateNode.containerInfo===re.containerInfo&&q.stateNode.implementation===re.implementation){d($,q.sibling),q=S(q,re.children||[]),q.return=$,$=q;break e}else{d($,q);break}else a($,q);q=q.sibling}q=zh(re,$.mode,Re),q.return=$,$=q}return O($);case E:return mt=re._init,pi($,q,mt(re._payload),Re)}if(J(re))return Ge($,q,re,Re);if(R(re))return An($,q,re,Re);gl($,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,q!==null&&q.tag===6?(d($,q.sibling),q=S(q,re),q.return=$,$=q):(d($,q),q=Bh(re,$.mode,Re),q.return=$,$=q),O($)):d($,q)}return pi}var Ns=Bp(!0),zp=Bp(!1),Bo={},ui=fn(Bo),zo=fn(Bo),Us=fn(Bo);function Ui(o){if(o===Bo)throw Error(l(174));return o}function nh(o,a){Ne(Us,a),Ne(zo,o),Ne(ui,Bo),o=le(a),$e(ui),Ne(ui,o)}function Os(){$e(ui),$e(zo),$e(Us)}function kp(o){var a=Ui(Us.current),d=Ui(ui.current);a=F(d,o.type,a),d!==a&&(Ne(zo,o),Ne(ui,a))}function ih(o){zo.current===o&&($e(ui),$e(zo))}var Ht=fn(0);function _l(o){for(var a=o;a!==null;){if(a.tag===13){var d=a.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||Lo(d)||Io(d)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var rh=[];function sh(){for(var o=0;o<rh.length;o++){var a=rh[o];Fe?a._workInProgressVersionPrimary=null:a._workInProgressVersionSecondary=null}rh.length=0}var vl=c.ReactCurrentDispatcher,hi=c.ReactCurrentBatchConfig,Fs=0,Wt=null,En=null,mn=null,yl=!1,ko=!1,Ho=0,Hy=0;function wn(){throw Error(l(321))}function oh(o,a){if(a===null)return!1;for(var d=0;d<a.length&&d<o.length;d++)if(!Ii(o[d],a[d]))return!1;return!0}function ah(o,a,d,_,S,T){if(Fs=T,Wt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,vl.current=o===null||o.memoizedState===null?Xy:qy,o=d(_,S),ko){T=0;do{if(ko=!1,Ho=0,25<=T)throw Error(l(301));T+=1,mn=En=null,a.updateQueue=null,vl.current=Yy,o=d(_,S)}while(ko)}if(vl.current=wl,a=En!==null&&En.next!==null,Fs=0,mn=En=Wt=null,yl=!1,a)throw Error(l(300));return o}function lh(){var o=Ho!==0;return Ho=0,o}function Ji(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mn===null?Wt.memoizedState=mn=o:mn=mn.next=o,mn}function Oi(){if(En===null){var o=Wt.alternate;o=o!==null?o.memoizedState:null}else o=En.next;var a=mn===null?Wt.memoizedState:mn.next;if(a!==null)mn=a,En=o;else{if(o===null)throw Error(l(310));En=o,o={memoizedState:En.memoizedState,baseState:En.baseState,baseQueue:En.baseQueue,queue:En.queue,next:null},mn===null?Wt.memoizedState=mn=o:mn=mn.next=o}return mn}function Wr(o,a){return typeof a=="function"?a(o):a}function xl(o){var a=Oi(),d=a.queue;if(d===null)throw Error(l(311));d.lastRenderedReducer=o;var _=En,S=_.baseQueue,T=d.pending;if(T!==null){if(S!==null){var O=S.next;S.next=T.next,T.next=O}_.baseQueue=S=T,d.pending=null}if(S!==null){T=S.next,_=_.baseState;var X=O=null,se=null,ye=T;do{var Ue=ye.lane;if((Fs&Ue)===Ue)se!==null&&(se=se.next={lane:0,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null}),_=ye.hasEagerState?ye.eagerState:o(_,ye.action);else{var lt={lane:Ue,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};se===null?(X=se=lt,O=_):se=se.next=lt,Wt.lanes|=Ue,zs|=Ue}ye=ye.next}while(ye!==null&&ye!==T);se===null?O=_:se.next=X,Ii(_,a.memoizedState)||(Qn=!0),a.memoizedState=_,a.baseState=O,a.baseQueue=se,d.lastRenderedState=_}if(o=d.interleaved,o!==null){S=o;do T=S.lane,Wt.lanes|=T,zs|=T,S=S.next;while(S!==o)}else S===null&&(d.lanes=0);return[a.memoizedState,d.dispatch]}function Sl(o){var a=Oi(),d=a.queue;if(d===null)throw Error(l(311));d.lastRenderedReducer=o;var _=d.dispatch,S=d.pending,T=a.memoizedState;if(S!==null){d.pending=null;var O=S=S.next;do T=o(T,O.action),O=O.next;while(O!==S);Ii(T,a.memoizedState)||(Qn=!0),a.memoizedState=T,a.baseQueue===null&&(a.baseState=T),d.lastRenderedState=T}return[T,_]}function Hp(){}function Vp(o,a){var d=Wt,_=Oi(),S=a(),T=!Ii(_.memoizedState,S);if(T&&(_.memoizedState=S,Qn=!0),_=_.queue,Go(Xp.bind(null,d,_,o),[o]),_.getSnapshot!==a||T||mn!==null&&mn.memoizedState.tag&1){if(d.flags|=2048,Vo(9,Wp.bind(null,d,_,S,a),void 0,null),nn===null)throw Error(l(349));(Fs&30)!==0||Gp(d,a,S)}return S}function Gp(o,a,d){o.flags|=16384,o={getSnapshot:a,value:d},a=Wt.updateQueue,a===null?(a={lastEffect:null,stores:null},Wt.updateQueue=a,a.stores=[o]):(d=a.stores,d===null?a.stores=[o]:d.push(o))}function Wp(o,a,d,_){a.value=d,a.getSnapshot=_,qp(a)&&fi(o,1,-1)}function Xp(o,a,d){return d(function(){qp(a)&&fi(o,1,-1)})}function qp(o){var a=o.getSnapshot;o=o.value;try{var d=a();return!Ii(o,d)}catch{return!0}}function ch(o){var a=Ji();return typeof o=="function"&&(o=o()),a.memoizedState=a.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:o},a.queue=o,o=o.dispatch=Wy.bind(null,Wt,o),[a.memoizedState,o]}function Vo(o,a,d,_){return o={tag:o,create:a,destroy:d,deps:_,next:null},a=Wt.updateQueue,a===null?(a={lastEffect:null,stores:null},Wt.updateQueue=a,a.lastEffect=o.next=o):(d=a.lastEffect,d===null?a.lastEffect=o.next=o:(_=d.next,d.next=o,o.next=_,a.lastEffect=o)),o}function Yp(){return Oi().memoizedState}function Ml(o,a,d,_){var S=Ji();Wt.flags|=o,S.memoizedState=Vo(1|a,d,void 0,_===void 0?null:_)}function El(o,a,d,_){var S=Oi();_=_===void 0?null:_;var T=void 0;if(En!==null){var O=En.memoizedState;if(T=O.destroy,_!==null&&oh(_,O.deps)){S.memoizedState=Vo(a,d,T,_);return}}Wt.flags|=o,S.memoizedState=Vo(1|a,d,T,_)}function uh(o,a){return Ml(8390656,8,o,a)}function Go(o,a){return El(2048,8,o,a)}function Zp(o,a){return El(4,2,o,a)}function Jp(o,a){return El(4,4,o,a)}function jp(o,a){if(typeof a=="function")return o=o(),a(o),function(){a(null)};if(a!=null)return o=o(),a.current=o,function(){a.current=null}}function Kp(o,a,d){return d=d!=null?d.concat([o]):null,El(4,4,jp.bind(null,a,o),d)}function hh(){}function Qp(o,a){var d=Oi();a=a===void 0?null:a;var _=d.memoizedState;return _!==null&&a!==null&&oh(a,_[1])?_[0]:(d.memoizedState=[o,a],o)}function $p(o,a){var d=Oi();a=a===void 0?null:a;var _=d.memoizedState;return _!==null&&a!==null&&oh(a,_[1])?_[0]:(o=o(),d.memoizedState=[o,a],o)}function Vy(o,a){var d=Et;Et=d!==0&&4>d?d:4,o(!0);var _=hi.transition;hi.transition={};try{o(!1),a()}finally{Et=d,hi.transition=_}}function em(){return Oi().memoizedState}function Gy(o,a,d){var _=gr(o);d={lane:_,action:d,hasEagerState:!1,eagerState:null,next:null},tm(o)?nm(a,d):(im(o,a,d),d=Nn(),o=fi(o,_,d),o!==null&&rm(o,a,_))}function Wy(o,a,d){var _=gr(o),S={lane:_,action:d,hasEagerState:!1,eagerState:null,next:null};if(tm(o))nm(a,S);else{im(o,a,S);var T=o.alternate;if(o.lanes===0&&(T===null||T.lanes===0)&&(T=a.lastRenderedReducer,T!==null))try{var O=a.lastRenderedState,X=T(O,d);if(S.hasEagerState=!0,S.eagerState=X,Ii(X,O))return}catch{}finally{}d=Nn(),o=fi(o,_,d),o!==null&&rm(o,a,_)}}function tm(o){var a=o.alternate;return o===Wt||a!==null&&a===Wt}
3714function nm(o,a){ko=yl=!0;var d=o.pending;d===null?a.next=a:(a.next=d.next,d.next=a),o.pending=a}function im(o,a,d){nn!==null&&(o.mode&1)!==0&&(yt&2)===0?(o=a.interleaved,o===null?(d.next=d,Ni===null?Ni=[a]:Ni.push(a)):(d.next=o.next,o.next=d),a.interleaved=d):(o=a.pending,o===null?d.next=d:(d.next=o.next,o.next=d),a.pending=d)}function rm(o,a,d){if((d&4194240)!==0){var _=a.lanes;_&=o.pendingLanes,d|=_,a.lanes=d,zu(o,d)}}var wl={readContext:ai,useCallback:wn,useContext:wn,useEffect:wn,useImperativeHandle:wn,useInsertionEffect:wn,useLayoutEffect:wn,useMemo:wn,useReducer:wn,useRef:wn,useState:wn,useDebugValue:wn,useDeferredValue:wn,useTransition:wn,useMutableSource:wn,useSyncExternalStore:wn,useId:wn,unstable_isNewReconciler:!1},Xy={readContext:ai,useCallback:function(o,a){return Ji().memoizedState=[o,a===void 0?null:a],o},useContext:ai,useEffect:uh,useImperativeHandle:function(o,a,d){return d=d!=null?d.concat([o]):null,Ml(4194308,4,jp.bind(null,a,o),d)},useLayoutEffect:function(o,a){return Ml(4194308,4,o,a)},useInsertionEffect:function(o,a){return Ml(4,2,o,a)},useMemo:function(o,a){var d=Ji();return a=a===void 0?null:a,o=o(),d.memoizedState=[o,a],o},useReducer:function(o,a,d){var _=Ji();return a=d!==void 0?d(a):a,_.memoizedState=_.baseState=a,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:a},_.queue=o,o=o.dispatch=Gy.bind(null,Wt,o),[_.memoizedState,o]}
vendor: 7,396 bytes, lines 3714-3716
3714,useRef:function(o){var a=Ji();return o={current:o},a.memoizedState=o},useState:ch,useDebugValue:hh,useDeferredValue:function(o){var a=ch(o),d=a[0],_=a[1];return uh(function(){var S=hi.transition;hi.transition={};try{_(o)}finally{hi.transition=S}},[o]),d},useTransition:function(){var o=ch(!1),a=o[0];return o=Vy.bind(null,o[1]),Ji().memoizedState=o,[a,o]},useMutableSource:function(){},useSyncExternalStore:function(o,a,d){var _=Wt,S=Ji();if(Bt){if(d===void 0)throw Error(l(407));d=d()}else{if(d=a(),nn===null)throw Error(l(349));(Fs&30)!==0||Gp(_,a,d)}S.memoizedState=d;var T={value:d,getSnapshot:a};return S.queue=T,uh(Xp.bind(null,_,T,o),[o]),_.flags|=2048,Vo(9,Wp.bind(null,_,T,d,a),void 0,null),d},useId:function(){var o=Ji(),a=nn.identifierPrefix;if(Bt){var d=Zi,_=Yi;d=(_&~(1<<32-Jn(_)-1)).toString(32)+d,a=":"+a+"R"+d,d=Ho++,0<d&&(a+="H"+d.toString(32)),a+=":"}else d=Hy++,a=":"+a+"r"+d.toString(32)+":";return o.memoizedState=a},unstable_isNewReconciler:!1},qy={readContext:ai,useCallback:Qp,useContext:ai,useEffect:Go,useImperativeHandle:Kp,useInsertionEffect:Zp,useLayoutEffect:Jp,useMemo:$p,useReducer:xl,useRef:Yp,useState:function(){return xl(Wr)},useDebugValue:hh,useDeferredValue:function(o){var a=xl(Wr),d=a[0],_=a[1];return Go(function(){var S=hi.transition;hi.transition={};try{_(o)}finally{hi.transition=S}},[o]),d},useTransition:function(){var o=xl(Wr)[0],a=Oi().memoizedState;return[o,a]},useMutableSource:Hp,useSyncExternalStore:Vp,useId:em,unstable_isNewReconciler:!1},Yy={readContext:ai,useCallback:Qp,useContext:ai,useEffect:Go,useImperativeHandle:Kp,useInsertionEffect:Zp,useLayoutEffect:Jp,useMemo:$p,useReducer:Sl,useRef:Yp,useState:function(){return Sl(Wr)},useDebugValue:hh,useDeferredValue:function(o){var a=Sl(Wr),d=a[0],_=a[1];return Go(function(){var S=hi.transition;hi.transition={};try{_(o)}finally{hi.transition=S}},[o]),d},useTransition:function(){var o=Sl(Wr)[0],a=Oi().memoizedState;return[o,a]},useMutableSource:Hp,useSyncExternalStore:Vp,useId:em,unstable_isNewReconciler:!1};function fh(o,a){try{var d="",_=a;do d+=ky(_),_=_.return;while(_);var S=d}catch(T){S=`
3715Error generating stack: `+T.message+`
3716`+T.stack}return{value:o,source:a,stack:S}}function dh(o,a){try{console.error(a.value)}catch(d){setTimeout(function(){throw d})}}var Zy=typeof WeakMap=="function"?WeakMap:Map;function sm(o,a,d){d=qi(-1,d),d.tag=3,d.payload={element:null};var _=a.value;return d.callback=function(){kl||(kl=!0,Lh=_),dh(o,a)},d}function om(o,a,d){d=qi(-1,d),d.tag=3;var _=o.type.getDerivedStateFromError;if(typeof _=="function"){var S=a.value;d.payload=function(){return _(S)},d.callback=function(){dh(o,a)}}var T=o.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(d.callback=function(){dh(o,a),typeof _!="function"&&(pr===null?pr=new Set([this]):pr.add(this));var O=a.stack;this.componentDidCatch(a.value,{componentStack:O!==null?O:""})}),d}function am(o,a,d){var _=o.pingCache;if(_===null){_=o.pingCache=new Zy;var S=new Set;_.set(a,S)}else S=_.get(a),S===void 0&&(S=new Set,_.set(a,S));S.has(d)||(S.add(d),o=lx.bind(null,o,a,d),a.then(o,o))}function lm(o){do{var a;if((a=o.tag===13)&&(a=o.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return o;o=o.return}while(o!==null);return null}function cm(o,a,d,_,S){return(o.mode&1)===0?(o===a?o.flags|=65536:(o.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(a=qi(-1,1),a.tag=2,dr(d,a))),d.lanes|=1),o):(o.flags|=65536,o.lanes=S,o)}function Fi(o){o.flags|=4}function um(o,a){if(o!==null&&o.child===a.child)return!0;if((a.flags&16)!==0)return!1;for(o=a.child;o!==null;){if((o.flags&12854)!==0||(o.subtreeFlags&12854)!==0)return!1;o=o.sibling}return!0}var Wo,Xo,Tl,Al;if(Xe)Wo=function(o,a){for(var d=a.child;d!==null;){if(d.tag===5||d.tag===6)oe(o,d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===a)break;for(;d.sibling===null;){if(d.return===null||d.return===a)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Xo=function(){},Tl=function(o,a,d,_,S){if(o=o.memoizedProps,o!==_){var T=a.stateNode,O=Ui(ui.current);d=ae(T,d,o,_,S,O),(a.updateQueue=d)&&Fi(a)}},Al=function(o,a,d,_){d!==_&&Fi(a)};else if(k){Wo=function(o,a,d,_){for(var S=a.child;S!==null;){if(S.tag===5){var T=S.stateNode;d&&_&&(T=Yt(T,S.type,S.memoizedProps,S)),oe(o,T)}else if(S.tag===6)T=S.stateNode,d&&_&&(T=hn(T,S.memoizedProps,S)),oe(o,T);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)T=S.child,T!==null&&(T.return=S),Wo(o,S,!0,!0);else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===a)break;for(;S.sibling===null;){if(S.return===null||S.return===a)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};var hm=function(o,a,d,_){for(var S=a.child;S!==null;){if(S.tag===5){var T=S.stateNode;d&&_&&(T=Yt(T,S.type,S.memoizedProps,S)),Ye(o,T)}else if(S.tag===6)T=S.stateNode,d&&_&&(T=hn(T,S.memoizedProps,S)),Ye(o,T);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)T=S.child,T!==null&&(T.return=S),hm(o,S,!0,!0);else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===a)break;for(;S.sibling===null;){if(S.return===null||S.return===a)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};Xo=function(o,a){var d=a.stateNode;if(!um(o,a)){o=d.containerInfo;var _=Ke(o);hm(_,a,!1,!1),d.pendingChildren=_,Fi(a),Lt(o,_)}},Tl=function(o,a,d,_,S){var T=o.stateNode,O=o.memoizedProps;if((o=um(o,a))&&O===_)a.stateNode=T;else{var X=a.stateNode,se=Ui(ui.current),ye=null;O!==_&&(ye=ae(X,d,O,_,S,se)),o&&ye===null?a.stateNode=T:(T=be(T,ye,d,O,_,a,o,X),j(T,d,_,S,se)&&Fi(a),a.stateNode=T,o?Fi(a):Wo(T,a,!1,!1))}},Al=function(o,a,d,_){d!==_?(o=Ui(Us.current),d=Ui(ui.current),a.stateNode=Te(_,o,d,a),Fi(a)):a.stateNode=o.stateNode}}else Xo=function(){},Tl=function(){},Al=function(){};function qo(o,a){if(!Bt)switch(o.tailMode){case"hidden":a=o.tail;for(var d=null;a!==null;)a.alternate!==null&&(d=a),a=a.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var _=null;d!==null;)d.alternate!==null&&(_=d),d=d.sibling;_===null?a||o.tail===null?o.tail=null:o.tail.sibling=null:_.sibling=null}}function Tn(o){var a=o.alternate!==null&&o.alternate.child===o.child,d=0,_=0;if(a)for(var S=o.child;S!==null;)d|=S.lanes|S.childLanes,_|=S.subtreeFlags&14680064,_|=S.flags&14680064,S.return=o,S=S.sibling;else for(S=o.child;S!==null;)d|=S.lanes|S.childLanes,_|=S.subtreeFlags,_|=S.flags,S.return=o,S=S.sibling;return o.subtreeFlags|=_,o.childLanes=d,a}function Jy(o,a,d){var _=a.pendingProps;switch(Qu(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tn(a),null;case 1:return dn(a.type)&&Zt(),Tn(a),null;case 3:return _=a.stateNode,Os(),$e(Gt),$e(vt),sh(),_.pendingContext&&(_.context=_.pendingContext,_.pendingContext=null),(o===null||o.child===null)&&(Oo(a)?Fi(a):o===null||o.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,_i!==null&&(Nh(_i),_i=null))),Xo(o,a),Tn(a),null;case 5:ih(a),d=Ui(Us.current);var S=a.type;if(o!==null&&a.stateNode!=null)Tl(o,a,S,_,d),o.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!_){if(a.stateNode===null)throw Error(l(166));return Tn(a),null}if(o=Ui(ui.current),Oo(a)){if(!_e)throw Error(l(175));o=Nu(a.stateNode,a.type,a.memoizedProps,d,o,a,!Uo),a.updateQueue=o,o!==null&&Fi(a)}else{var T=Y(S,_,d,o,a);Wo(T,a,!1,!1),a.stateNode=T,j(T,S,_,d,o)&&Fi(a)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}
3716return Tn(a),null;case 6:if(o&&a.stateNode!=null)Al(o,a,o.memoizedProps,_);else{if(typeof _!="string"&&a.stateNode===null)throw Error(l(166));if(o=Ui(Us.current),d=Ui(ui.current),Oo(a)){if(!_e)throw Error(l(176));if(o=a.stateNode,_=a.memoizedProps,(d=Uu(o,_,a,!Uo))&&(S=jn,S!==null))switch(T=(S.mode&1)!==0,S.tag){case 3:Ve(S.stateNode.containerInfo,o,_,T);break;case 5:je(S.type,S.memoizedProps,S.stateNode,o,_,T)}d&&Fi(a)}else a.stateNode=Te(_,o,d,a)}return Tn(a),null;case 13:if($e(Ht),_=a.memoizedState,Bt&&Kn!==null&&(a.mode&1)!==0&&(a.flags&128)===0){for(o=Kn;o;)o=hr(o);return Ds(),a.flags|=98560,a}if(_!==null&&_.dehydrated!==null){if(_=Oo(a),o===null){if(!_)throw Error(l(318));if(!_e)throw Error(l(344));if(o=a.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(l(317));Ou(o,a)}else Ds(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;return Tn(a),null}return _i!==null&&(Nh(_i),_i=null),(a.flags&128)!==0?(a.lanes=d,a):(_=_!==null,d=!1,o===null?Oo(a):d=o.memoizedState!==null,_&&!d&&(a.child.flags|=8192,(a.mode&1)!==0&&(o===null||(Ht.current&1)!==0?on===0&&(on=3):Oh())),a.updateQueue!==null&&(a.flags|=4),Tn(a),null);case 4:return Os(),Xo(o,a),o===null&&ve(a.stateNode.containerInfo),Tn(a),null;case 10:return qu(a.type._context),Tn(a),null;case 17:return dn(a.type)&&Zt(),Tn(a),null;case 19:if($e(Ht),S=a.memoizedState,S===null)return Tn(a),null;if(_=(a.flags&128)!==0,T=S.rendering,T===null)if(_)qo(S,!1);else{if(on!==0||o!==null&&(o.flags&128)!==0)for(o=a.child;o!==null;){if(T=_l(o),T!==null){for(a.flags|=128,qo(S,!1),o=T.updateQueue,o!==null&&(a.updateQueue=o,a.flags|=4),a.subtreeFlags=0,o=d,_=a.child;_!==null;)d=_,S=o,d.flags&=14680066,T=d.alternate,T===null?(d.childLanes=0,d.lanes=S,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=T.childLanes,d.lanes=T.lanes,d.child=T.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=T.memoizedProps,d.memoizedState=T.memoizedState,d.updateQueue=T.updateQueue,d.type=T.type,S=T.dependencies,d.dependencies=S===null?null:{lanes:S.lanes,firstContext:S.firstContext}),_=_.sibling;return Ne(Ht,Ht.current&1|2),a.child}o=o.sibling}S.tail!==null&&pn()>Ph&&(a.flags|=128,_=!0,qo(S,!1),a.lanes=4194304)}else{if(!_)if(o=_l(T),o!==null){if(a.flags|=128,_=!0,o=o.updateQueue,o!==null&&(a.updateQueue=o,a.flags|=4),qo(S,!0),S.tail===null&&S.tailMode==="hidden"&&!T.alternate&&!Bt)return Tn(a),null}else 2*pn()-S.renderingStartTime>Ph&&d!==1073741824&&(a.flags|=128,_=!0,qo(S,!1),a.lanes=4194304);S.isBackwards?(T.sibling=a.child,a.child=T):(o=S.last,o!==null?o.sibling=T:a.child=T,S.last=T)}return S.tail!==null?(a=S.tail,S.rendering=a,S.tail=a.sibling,S.renderingStartTime=pn(),a.sibling=null,o=Ht.current,Ne(Ht,_?o&1|2:o&1),a):(Tn(a),null);case 22:case 23:return Uh(),_=a.memoizedState!==null,o!==null&&o.memoizedState!==null!==_&&(a.flags|=8192),_&&(a.mode&1)!==0?($n&1073741824)!==0&&(Tn(a),Xe&&a.subtreeFlags&6&&(a.flags|=8192)):Tn(a),null;case 24:return null;case 25:return null}throw Error(l(156,a.tag))}var jy=c.ReactCurrentOwner,Qn=!1;function Dn(o,a,d,_){a.child=o===null?zp(a,null,d,_):Ns(a,o.child,d,_)}function fm(o,a,d,_,S){d=d.render;var T=a.ref;return Ps(a,S),_=ah(o,a,d,_,T,S),d=lh(),o!==null&&!Qn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~S,ji(o,a,S)
3716):(Bt&&d&&Ku(a),a.flags|=1,Dn(o,a,_,S),a.child)}function dm(o,a,d,_,S){if(o===null){var T=d.type;return typeof T=="function"&&!Fh(T)&&T.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(a.tag=15,a.type=T,pm(o,a,T,_,S)):(o=Yl(d.type,null,_,a,a.mode,S),o.ref=a.ref,o.return=a,a.child=o)}if(T=o.child,(o.lanes&S)===0){var O=T.memoizedProps;if(d=d.compare,d=d!==null?d:ll,d(O,_)&&o.ref===a.ref)return ji(o,a,S)}return a.flags|=1,o=vr(T,_),o.ref=a.ref,o.return=a,a.child=o}function pm(o,a,d,_,S){if(o!==null&&ll(o.memoizedProps,_)&&o.ref===a.ref)if(Qn=!1,(o.lanes&S)!==0)(o.flags&131072)!==0&&(Qn=!0);else return a.lanes=o.lanes,ji(o,a,S);return ph(o,a,d,_,S)}function mm(o,a,d){var _=a.pendingProps,S=_.children,T=o!==null?o.memoizedState:null;if(_.mode==="hidden")if((a.mode&1)===0)a.memoizedState={baseLanes:0,cachePool:null},Ne(Bs,$n),$n|=d;else if((d&1073741824)!==0)a.memoizedState={baseLanes:0,cachePool:null},_=T!==null?T.baseLanes:d,Ne(Bs,$n),$n|=_;else return o=T!==null?T.baseLanes|d:d,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:o,cachePool:null},a.updateQueue=null,Ne(Bs,$n),$n|=o,null;else T!==null?(_=T.baseLanes|d,a.memoizedState=null):_=d,Ne(Bs,$n),$n|=_;return Dn(o,a,S,d),a.child}function gm(o,a){var d=a.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(a.flags|=512,a.flags|=2097152)}function ph(o,a,d,_,S){var T=dn(d)?Ri:vt.current;return T=oi(a,T),Ps(a,S),d=ah(o,a,d,_,T,S),_=lh(),o!==null&&!Qn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~S,ji(o,a,S)
vendor: 5,310 bytes, line 3716
3716):(Bt&&_&&Ku(a),a.flags|=1,Dn(o,a,d,S),a.child)}function _m(o,a,d,_,S){if(dn(d)){var T=!0;Sn(a)}else T=!1;if(Ps(a,S),a.stateNode===null)o!==null&&(o.alternate=null,a.alternate=null,a.flags|=2),Lp(a,d,_),ju(a,d,_,S),_=!0;else if(o===null){var O=a.stateNode,X=a.memoizedProps;O.props=X;var se=O.context,ye=d.contextType;typeof ye=="object"&&ye!==null?ye=ai(ye):(ye=dn(d)?Ri:vt.current,ye=oi(a,ye));var Ue=d.getDerivedStateFromProps,lt=typeof Ue=="function"||typeof O.getSnapshotBeforeUpdate=="function";lt||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(X!==_||se!==ye)&&Ip(a,O,_,ye),fr=!1;var Ze=a.memoizedState;O.state=Ze,fl(a,_,O,S),se=a.memoizedState,X!==_||Ze!==se||Gt.current||fr?(typeof Ue=="function"&&(Ju(a,d,Ue,_),se=a.memoizedState),(X=fr||Pp(a,d,X,_,Ze,se,ye))?(lt||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(a.flags|=4194308)):(typeof O.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=_,a.memoizedState=se),O.props=_,O.state=se,O.context=ye,_=X):(typeof O.componentDidMount=="function"&&(a.flags|=4194308),_=!1)}else{O=a.stateNode,Ap(o,a),X=a.memoizedProps,ye=a.type===a.elementType?X:gi(a.type,X),O.props=ye,lt=a.pendingProps,Ze=O.context,se=d.contextType,typeof se=="object"&&se!==null?se=ai(se):(se=dn(d)?Ri:vt.current,se=oi(a,se));var Dt=d.getDerivedStateFromProps;(Ue=typeof Dt=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(X!==lt||Ze!==se)&&Ip(a,O,_,se),fr=!1,Ze=a.memoizedState,O.state=Ze,fl(a,_,O,S);var Ge=a.memoizedState;X!==lt||Ze!==Ge||Gt.current||fr?(typeof Dt=="function"&&(Ju(a,d,Dt,_),Ge=a.memoizedState),(ye=fr||Pp(a,d,ye,_,Ze,Ge,se)||!1)?(Ue||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(_,Ge,se),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(_,Ge,se)),typeof O.componentDidUpdate=="function"&&(a.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof O.componentDidUpdate!="function"||X===o.memoizedProps&&Ze===o.memoizedState||(a.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||X===o.memoizedProps&&Ze===o.memoizedState||(a.flags|=1024),a.memoizedProps=_,a.memoizedState=Ge),O.props=_,O.state=Ge,O.context=se,_=ye):(typeof O.componentDidUpdate!="function"||X===o.memoizedProps&&Ze===o.memoizedState||(a.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||X===o.memoizedProps&&Ze===o.memoizedState||(a.flags|=1024),_=!1)}return mh(o,a,d,_,T,S)}function mh(o,a,d,_,S,T){gm(o,a);var O=(a.flags&128)!==0;if(!_&&!O)return S&&Cs(a,d,!1),ji(o,a,T);_=a.stateNode,jy.current=a;var X=O&&typeof d.getDerivedStateFromError!="function"?null:_.render();return a.flags|=1,o!==null&&O?(a.child=Ns(a,o.child,null,T),a.child=Ns(a,null,X,T)):Dn(o,a,X,T),a.memoizedState=_.state,S&&Cs(a,d,!0),a.child}function vm(o){var a=o.stateNode;a.pendingContext?Pi(o,a.pendingContext,a.pendingContext!==a.context):a.context&&Pi(o,a.context,!1),nh(o,a.containerInfo)}function ym(o,a,d,_,S){return Ds(),th(S),a.flags|=256,Dn(o,a,d,_),a.child}var bl={dehydrated:null,treeContext:null,retryLane:0};function Cl(o){return{baseLanes:o,cachePool:null}}function xm(o,a,d){var _=a.pendingProps,S=Ht.current,T=!1,O=(a.flags&128)!==0,X;if((X=O)||(X=o!==null&&o.memoizedState===null?!1:(S&2)!==0),X?(T=!0,a.flags&=-129):(o===null||o.memoizedState!==null)&&(S|=1),Ne(Ht,S&1),o===null)return eh(a),o=a.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((a.mode&1)===0?a.lanes=1:Io(o)?a.lanes=8:a.lanes=1073741824,null):(S=_.children,o=_.fallback,T?(_=a.mode,T=a.child,S={mode:"hidden",children:S},(_&1)===0&&T!==null?(T.childLanes=0,T.pendingProps=S):T=Zl(S,_,0,null),o=jr(o,_,d,null),T.return=a,o.return=a,T.sibling=o,a.child=T,a.child.memoizedState=Cl(d),a.memoizedState=bl,o):gh(a,S));if(S=o.memoizedState,S!==null){if(X=S.dehydrated,X!==null){if(O)return a.flags&256?(a.flags&=-257,Rl(o,a,d,Error(l(422)))):a.memoizedState!==null?(a.child=o.child,a.flags|=128,null):(T=_.fallback,S=a.mode,_=Zl({mode:"visible",children:_.children},S,0,null),T=jr(T,S,d,null),T.flags|=2,_.return=a,T.return=a,_.sibling=T,a.child=_,(a.mode&1)!==0&&Ns(a,o.child,null,d),a.child.memoizedState=Cl(d),a.memoizedState=bl,T);if((a.mode&1)===0)a=Rl(o,a,d,null);else if(Io(X))a=Rl(o,a,d,Error(l(419)));else if(_=(d&o.childLanes)!==0,Qn||_){if(_=nn,_!==null){switch(d&-d){case 4:T=2;break;case 16:T=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:T=32;break;case 536870912:T=268435456;break;default:T=0}_=(T&(_.suspendedLanes|d))!==0?0:T,_!==0&&_!==S.retryLane&&(S.retryLane=_,fi(o,_,-1))}Oh(),a=Rl(o,a,d,Error(l(421)))}else Lo(X)?(a.flags|=128,a.child=o.child,a=cx.bind(null,o),Ts(X,a),a=null):(d=S.treeContext,_e&&(Kn=tl(X),jn=a,Bt=!0,_i=null,U
3716o=!1,d!==null&&(li[ci++]=Yi,li[ci++]=Zi,li[ci++]=Vr,Yi=d.id,Zi=d.overflow,Vr=a)),a=gh(a,a.pendingProps.children),a.flags|=4096);return a}return T?(_=Mm(o,a,_.children,_.fallback,d),T=a.child,S=o.child.memoizedState,T.memoizedState=S===null?Cl(d):{baseLanes:S.baseLanes|d,cachePool:null},T.childLanes=o.childLanes&~d,a.memoizedState=bl,_):(d=Sm(o,a,_.children,d),a.memoizedState=null,d)}return T?(_=Mm(o,a,_.children,_.fallback,d),T=a.child,S=o.child.memoizedState,T.memoizedState=S===null?Cl(d):{baseLanes:S.baseLanes|d,cachePool:null},T.childLanes=o.childLanes&~d,a.memoizedState=bl,_):(d=Sm(o,a,_.children,d),a.memoizedState=null,d)}function gh(o,a){return a=Zl({mode:"visible",children:a},o.mode,0,null),a.return=o,o.child=a}function Sm(o,a,d,_){var S=o.child;return o=S.sibling,d=vr(S,{mode:"visible",children:d}),(a.mode&1)===0&&(d.lanes=_),d.return=a,d.sibling=null,o!==null&&(_=a.deletions,_===null?(a.deletions=[o],a.flags|=16):_.push(o)),a.child=d}function Mm(o,a,d,_,S){var T=a.mode;o=o.child;var O=o.sibling,X={mode:"hidden",children:d};return(T&1)===0&&a.child!==o?(d=a.child,d.childLanes=0,d.pendingProps=X,a.deletions=null):(d=vr(o,X),d.subtreeFlags=o.subtreeFlags&14680064),O!==null?_=vr(O,_):(_=jr(_,T,S,null),_.flags|=2),_.return=a,d.return=a,d.sibling=_,a.
vendor: 5,004 bytes, line 3716
3716child=d,_}function Rl(o,a,d,_){return _!==null&&th(_),Ns(a,o.child,null,d),o=gh(a,a.pendingProps.children),o.flags|=2,a.memoizedState=null,o}function Em(o,a,d){o.lanes|=a;var _=o.alternate;_!==null&&(_.lanes|=a),Yu(o.return,a,d)}function _h(o,a,d,_,S){var T=o.memoizedState;T===null?o.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:_,tail:d,tailMode:S}:(T.isBackwards=a,T.rendering=null,T.renderingStartTime=0,T.last=_,T.tail=d,T.tailMode=S)}function wm(o,a,d){var _=a.pendingProps,S=_.revealOrder,T=_.tail;if(Dn(o,a,_.children,d),_=Ht.current,(_&2)!==0)_=_&1|2,a.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=a.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&Em(o,d,a);else if(o.tag===19)Em(o,d,a);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}_&=1}if(Ne(Ht,_),(a.mode&1)===0)a.memoizedState=null;else switch(S){case"forwards":for(d=a.child,S=null;d!==null;)o=d.alternate,o!==null&&_l(o)===null&&(S=d),d=d.sibling;d=S,d===null?(S=a.child,a.child=null):(S=d.sibling,d.sibling=null),_h(a,!1,S,d,T);break;case"backwards":for(d=null,S=a.child,a.child=null;S!==null;){if(o=S.alternate,o!==null&&_l(o)===null){a.child=S;break}o=S.sibling,S.sibling=d,d=S,S=o}_h(a,!0,d,null,T);break;case"together":_h(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function ji(o,a,d){if(o!==null&&(a.dependencies=o.dependencies),zs|=a.lanes,(d&a.childLanes)===0)return null;if(o!==null&&a.child!==o.child)throw Error(l(153));if(a.child!==null){for(o=a.child,d=vr(o,o.pendingProps),a.child=d,d.return=a;o.sibling!==null;)o=o.sibling,d=d.sibling=vr(o,o.pendingProps),d.return=a;d.sibling=null}return a.child}function Ky(o,a,d){switch(a.tag){case 3:vm(a),Ds();break;case 5:kp(a);break;case 1:dn(a.type)&&Sn(a);break;case 4:nh(a,a.stateNode.containerInfo);break;case 10:Tp(a,a.type._context,a.memoizedProps.value);break;case 13:var _=a.memoizedState;if(_!==null)return _.dehydrated!==null?(Ne(Ht,Ht.current&1),a.flags|=128,null):(d&a.child.childLanes)!==0?xm(o,a,d):(Ne(Ht,Ht.current&1),o=ji(o,a,d),o!==null?o.sibling:null);Ne(Ht,Ht.current&1);break;case 19:if(_=(d&a.childLanes)!==0,(o.flags&128)!==0){if(_)return wm(o,a,d);a.flags|=128}var S=a.memoizedState;if(S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),Ne(Ht,Ht.current),_)break;return null;case 22:case 23:return a.lanes=0,mm(o,a,d)}return ji(o,a,d)}function Qy(o,a){switch(Qu(a),a.tag){case 1:return dn(a.type)&&Zt(),o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 3:return Os(),$e(Gt),$e(vt),sh(),o=a.flags,(o&65536)!==0&&(o&128)===0?(a.flags=o&-65537|128,a):null;case 5:return ih(a),null;case 13:if($e(Ht),o=a.memoizedState,o!==null&&o.dehydrated!==null){if(a.alternate===null)throw Error(l(340));Ds()}return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 19:return $e(Ht),null;case 4:return Os(),null;case 10:return qu(a.type._context),null;case 22:case 23:return Uh(),null;case 24:return null;default:return null}}var Pl=!1,Xr=!1,$y=typeof WeakSet=="function"?WeakSet:Set,Ce=null;function Ll(o,a){var d=o.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(_){Gn(o,a,_)}else d.current=null}function vh(o,a,d){try{d()}catch(_){Gn(o,a,_)}}var Tm=!1;function ex(o,a){for(H(o.containerInfo),Ce=a;Ce!==null;)if(o=Ce,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,Ce=a;else for(;Ce!==null;){o=Ce;try{var d=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(d!==null){var _=d.memoizedProps,S=d.memoizedState,T=o.stateNode,O=T.getSnapshotBeforeUpdate(o.elementType===o.type?_:gi(o.type,_),S);T.__reactInternalSnapshotBeforeUpdate=O}break;case 3:Xe&&Ae(o.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(X){Gn(o,o.return,X)}if(a=o.sibling,a!==null){a.return=o.return,Ce=a;break}Ce=o.return}return d=Tm,Tm=!1,d}function qr(o,a,d){var _=a.updateQueue;if(_=_!==null?_.lastEffect:null,_!==null){var S=_=_.next;do{if((S.tag&o)===o){var T=S.destroy;S.destroy=void 0,T!==void 0&&vh(a,d,T)}S=S.next}while(S!==_)}}function Yo(o,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var d=a=a.next;do{if((d.tag&o)===o){var _=d.create;d.destroy=_()}d=d.next}while(d!==a)}}function yh(o){var a=o.ref;if(a!==null){var d=o.stateNode;switch(o.tag){case 5:o=ee(d);break;default:o=d}typeof a=="function"?a(o):a.current=o}}function Am(o,a,d){if(Li&&typeof Li.onCommitFiberUnmount=="function")try{Li.onCommitFiberUnmount(ol,a)}catch{}switch(a.tag){case 0:case 11:case 14:case 15:if(o=a.updateQueue,o!==null&&(o=o.lastEffect,o!==null)){var _=o=o.next;do{var S=_,T=S.destroy;S=S.tag,T!==void 0&&((S&2)!==0||(S&4)!==0)&&vh(a,d,T),_=_.next}while(_!==o)}break;case 1:if(Ll(a,d),o=a.stateNode,typeof o.componentWillUnmount=="function")try{o.props=a.memoizedProps,o.state=a.memoizedState,o.componentWillUnmount()}catch(O){Gn(a,d,O)}break;case 5:Ll(a,d);break;
vendor: 12,460 bytes, line 3716
3716case 4:Xe?Im(o,a,d):k&&k&&(a=a.stateNode.containerInfo,d=Ke(a),Ct(a,d))}}function bm(o,a,d){for(var _=a;;)if(Am(o,_,d),_.child===null||Xe&&_.tag===4){if(_===a)break;for(;_.sibling===null;){if(_.return===null||_.return===a)return;_=_.return}_.sibling.return=_.return,_=_.sibling}else _.child.return=_,_=_.child}function Cm(o){var a=o.alternate;a!==null&&(o.alternate=null,Cm(a)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(a=o.stateNode,a!==null&&We(a)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Rm(o){return o.tag===5||o.tag===3||o.tag===4}function Pm(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Rm(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Lm(o){if(Xe){e:{for(var a=o.return;a!==null;){if(Rm(a))break e;a=a.return}throw Error(l(160))}var d=a;switch(d.tag){case 5:a=d.stateNode,d.flags&32&&(Mt(a),d.flags&=-33),d=Pm(o),Sh(o,d,a);break;case 3:case 4:a=d.stateNode.containerInfo,d=Pm(o),xh(o,d,a);break;default:throw Error(l(161))}}}function xh(o,a,d){var _=o.tag;if(_===5||_===6)o=o.stateNode,a?qe(d,o,a):at(d,o);else if(_!==4&&(o=o.child,o!==null))for(xh(o,a,d),o=o.sibling;o!==null;)xh(o,a,d),o=o.sibling}function Sh(o,a,d){var _=o.tag;if(_===5||_===6)o=o.stateNode,a?rt(d,o,a):Je(d,o);else if(_!==4&&(o=o.child,o!==null))for(Sh(o,a,d),o=o.sibling;o!==null;)Sh(o,a,d),o=o.sibling}function Im(o,a,d){for(var _=a,S=!1,T,O;;){if(!S){S=_.return;e:for(;;){if(S===null)throw Error(l(160));switch(T=S.stateNode,S.tag){case 5:O=!1;break e;case 3:T=T.containerInfo,O=!0;break e;case 4:T=T.containerInfo,O=!0;break e}S=S.return}S=!0}if(_.tag===5||_.tag===6)bm(o,_,d),O?ut(T,_.stateNode):Oe(T,_.stateNode);else if(_.tag===18)O?te(T,_.stateNode):ie(T,_.stateNode);else if(_.tag===4){if(_.child!==null){T=_.stateNode.containerInfo,O=!0,_.child.return=_,_=_.child;continue}}else if(Am(o,_,d),_.child!==null){_.child.return=_,_=_.child;continue}if(_===a)break;for(;_.sibling===null;){if(_.return===null||_.return===a)return;_=_.return,_.tag===4&&(S=!1)}_.sibling.return=_.return,_=_.sibling}}function Mh(o,a){if(Xe){switch(a.tag){case 0:case 11:case 14:case 15:qr(3,a,a.return),Yo(3,a),qr(5,a,a.return);return;case 1:return;case 5:var d=a.stateNode;if(d!=null){var _=a.memoizedProps;o=o!==null?o.memoizedProps:_;var S=a.type,T=a.updateQueue;a.updateQueue=null,T!==null&&_t(d,T,S,o,_,a)}return;case 6:if(a.stateNode===null)throw Error(l(162));d=a.memoizedProps,me(a.stateNode,o!==null?o.memoizedProps:d,d);return;case 3:_e&&o!==null&&o.memoizedState.isDehydrated&&Z(a.stateNode.containerInfo);return;case 12:return;case 13:Il(a);return;case 19:Il(a);return;case 17:return}throw Error(l(163))}switch(a.tag){case 0:case 11:case 14:case 15:qr(3,a,a.return),Yo(3,a),qr(5,a,a.return);return;case 12:return;case 13:Il(a);return;case 19:Il(a);return;case 3:_e&&o!==null&&o.memoizedState.isDehydrated&&Z(a.stateNode.containerInfo);break;case 22:case 23:return}e:if(k){switch(a.tag){case 1:case 5:case 6:break e;case 3:case 4:a=a.stateNode,Ct(a.containerInfo,a.pendingChildren);break e}throw Error(l(163))}}function Il(o){var a=o.updateQueue;if(a!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new $y),a.forEach(function(_){var S=ux.bind(null,o,_);d.has(_)||(d.add(_),_.then(S,S))})}}function tx(o,a){for(Ce=a;Ce!==null;){a=Ce;var d=a.deletions;if(d!==null)for(var _=0;_<d.length;_++){var S=d[_];try{var T=o;Xe?Im(T,S,a):bm(T,S,a);var O=S.alternate;O!==null&&(O.return=null),S.return=null}catch(He){Gn(S,a,He)}}if(d=a.child,(a.subtreeFlags&12854)!==0&&d!==null)d.return=a,Ce=d;else for(;Ce!==null;){a=Ce;try{var X=a.flags;if(X&32&&Xe&&Mt(a.stateNode),X&512){var se=a.alternate;if(se!==null){var ye=se.ref;ye!==null&&(typeof ye=="function"?ye(null):ye.current=null)}}if(X&8192)switch(a.tag){case 13:if(a.memoizedState!==null){var Ue=a.alternate;(Ue===null||Ue.memoizedState===null)&&(Rh=pn())}break;case 22:var lt=a.memoizedState!==null,Ze=a.alternate,Dt=Ze!==null&&Ze.memoizedState!==null;if(d=a,Xe){e:if(_=d,S=lt,T=null,Xe)for(var Ge=_;;){if(Ge.tag===5){if(T===null){T=Ge;var An=Ge.stateNode;S?Ft(An):Se(Ge.stateNode,Ge.memoizedProps)}}else if(Ge.tag===6){if(T===null){var pi=Ge.stateNode;S?pt(pi):G(pi,Ge.memoizedProps)}}else if((Ge.tag!==22&&Ge.tag!==23||Ge.memoizedState===null||Ge===_)&&Ge.child!==null){Ge.child.return=Ge,Ge=Ge.child;continue}if(Ge===_)break;for(;Ge.sibling===null;){if(Ge.return===null||Ge.return===_)break e;T===Ge&&(T=null),Ge=Ge.return}T===Ge&&(T=null),Ge.sibling.return=Ge.return,Ge=Ge.sibling}}if(lt&&!Dt&&(d.mode&1)!==0){Ce=d;for(var $=d.child;$!==null;){for(d=Ce=$;Ce!==null;){_=Ce;var q=_.child;switch(_.tag){case 0:case 11:case 14:case 15:qr(4,_,_.return);break;case 1:Ll(_,_.return);var re=_.stateNode;if(typeof re.componentWillUnmount=="function"){var Re=_.return;try{re.props=_.memoizedProps,re.state=_.memoizedState,re.componentWillUnmount()}catch(He){Gn(_,Re,He)}}break;case 5:Ll(_,_.return);break;case 22:if(_.memoizedState!==null){Um(d);continue}}q!==null?(q.return=_,Ce=q):Um(d)}$=$.sibling}}}switch(X&4102){case 2:Lm(a),a.flags&=-3;break;case 6:Lm(a),a.flags&=-3,Mh(a.alternate,a);break;case 4096:a.flags&=-4097;break;case 4100:a.flags&=-4097,Mh(a.alternate,a);break;case 4:Mh(a.alternate,a)}}catch(He){Gn(a,a.return,He)}if(d=a.sibling,d!==null){d.return=a.return,Ce=d;break}Ce=a.return}}}function nx(o,a,d){Ce=o,Dm(o)}function Dm(o,a,d){for(var _=(o.mode&1)!==0;Ce!==null;){var S=Ce,T=S.child;if(S.tag===22&&_){var O=S.memoizedState!==null||Pl;if(!O){var X=S.alternate,se=X!==null&&X.memoizedState!==null||Xr;X=Pl;var ye=Xr;if(Pl=O,(Xr=se)&&!ye)for(Ce=S;Ce!==null;)O=Ce,se=O.child,O.tag===22&&O.memoizedState!==null?Om(S):se!==null?(se.return=O,Ce=se):Om(S);for(;T!==null;)Ce=T,Dm(T),T=T.sibling;Ce=S,Pl=X,Xr=ye}Nm(o)}else(S.subtreeFlags&8772)!==0&&T!==null?(T.return=S,Ce=T):Nm(o)}}function Nm(o){for(;Ce!==null;){var a=Ce;if((a.flags&8772)!==0){var d=a.alternate;try{if((a.flags&8772)!==0)switch(a.tag){case 0:case 11:case 15:Xr||Yo(5,a);break;case 1:var _=a.stateNode;if(a.flags&4&&!Xr)if(d===null)_.componentDidMount();else{var S=a.elementType===a.type?d.memoizedProps:gi(a.type,d.memoizedProps);_.componentDidUpdate(S,d.memoizedState,_.__reactInternalSnapshotBeforeUpdate)}var T=a.updateQueue;T!==null&&Cp(a,T,_);break;case 3:var O=a.updateQueue;if(O!==null){if(d=null,a.child!==null)switch(a.child.tag){case 5:d=ee(a.child.stateNode);break;case 1:d=a.child.stateNode}Cp(a,O,d)}break;case 5:var X=a.stateNode;d===null&&a.flags&4&&xt(X,a.type,a.memoizedProps,a);break;case 6:break;case 4:break;case 12:break;case 13:if(_e&&a.memoizedState===null){var se=a.alternate;if(se!==null){var ye=se.memoizedState;if(ye!==null){var Ue=ye.dehydrated;Ue!==null&&ne(Ue)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(l(163))}Xr||a.flags&512&&yh(a)}catch(lt){Gn(a,a.return,lt)}}if(a===o){Ce=null;break}if(d=a.sibling,d!==null){d.return=a.return,Ce=d;break}Ce=a.return}}function Um(o){for(;Ce!==null;){var a=Ce;if(a===o){Ce=null;break}var d=a.sibling;if(d!==null){d.return=a.return,Ce=d;break}Ce=a.return}}function Om(o){for(;Ce!==null;){var a=Ce;try{switch(a.tag){case 0:case 11:case 15:var d=a.return;try{Yo(4,a)}catch(se){Gn(a,d,se)}break;case 1:var _=a.stateNode;if(typeof _.componentDidMount=="function"){var S=a.return;try{_.componentDidMount()}catch(se){Gn(a,S,se)}}var T=a.return;try{yh(a)}catch(se){Gn(a,T,se)}break;case 5:var O=a.return;try{yh(a)}catch(se){Gn(a,O,se)}}}catch(se){Gn(a,a.return,se)}if(a===o){Ce=null;break}var X=a.sibling;if(X!==null){X.return=a.return,Ce=X;break}Ce=a.return}}var Dl=0,Nl=1,Ul=2,Ol=3,Fl=4;if(typeof Symbol=="function"&&Symbol.for){var Zo=Symbol.for;Dl=Zo("selector.component"),Nl=Zo("selector.has_pseudo_class"),Ul=Zo("selector.role"),Ol=Zo("selector.test_id"),Fl=Zo("selector.text")}function Eh(o){var a=he(o);if(a!=null){if(typeof a.memoizedProps["data-testname"]!="string")throw Error(l(364));return a}if(o=K(o),o===null)throw Error(l(362));return o.stateNode.current}function wh(o,a){switch(a.$$typeof){case Dl:if(o.type===a.value)return!0;break;case Nl:e:{a=a.value,o=[o,0];for(var d=0;d<o.length;){var _=o[d++],S=o[d++],T=a[S];if(_.tag!==5||!de(_)){for(;T!=null&&wh(_,T);)S++,T=a[S];if(S===a.length){a=!0;break e}else for(_=_.child;_!==null;)o.push(_,S),_=_.sibling}}a=!1}return a;case Ul:if(o.tag===5&&ze(o.stateNode,a.value))return!0;break;case Fl:if((o.tag===5||o.tag===6)&&(o=pe(o),o!==null&&0<=o.indexOf(a.value)))return!0;break;case Ol:if(o.tag===5&&(o=o.memoizedProps["data-testname"],typeof o=="string"&&o.toLowerCase()===a.value.toLowerCase()))return!0;break;default:throw Error(l(365))}return!1}function Th(o){switch(o.$$typeof){case Dl:return"<"+(L(o.value)||"Unknown")+">";case Nl:return":has("+(Th(o)||"")+")";case Ul:return'[role="'+o.value+'"]';case Fl:return'"'+o.value+'"';case Ol:return'[data-testname="'+o.value+'"]';default:throw Error(l(365))}}function Fm(o,a){var d=[];o=[o,0];for(var _=0;_<o.length;){var S=o[_++],T=o[_++],O=a[T];if(S.tag!==5||!de(S)){for(;O!=null&&wh(S,O);)T++,O=a[T];if(T===a.length)d.push(S);else for(S=S.child;S!==null;)o.push(S,T),S=S.sibling}}return d}function Ah(o,a){if(!C)throw Error(l(363));o=Eh(o),o=Fm(o,a),a=[],o=Array.from(o);for(var d=0;d<o.length;){var _=o[d++];if(_.tag===5)de(_)||a.push(_.stateNode);else for(_=_.child;_!==null;)o.push(_),_=_.sibling}return a}var ix=Math.ceil,Bl=c.ReactCurrentDispatcher,bh=c.ReactCurrentOwner,Jt=c.ReactCurrentBatchConfig,yt=0,nn=null,rn=null,Mn=0,$n=0,Bs=fn(0),on=0,Jo=null,zs=0,zl=0,Ch=0,jo=null,Hn=null,Rh=0,Ph=1/0;function ks(){Ph=pn()+500}var kl=!1,Lh=null,pr=null,Hl=!1,mr=null,Vl=0,Ko=0,Ih=null,Gl=-1,Wl=0;function Nn(){return(yt&6)!==0?pn():Gl!==-1?Gl:Gl=pn()}function gr(o){return(o.mode&1)===0?1:(yt&2)!==0&&Mn!==0?Mn&-Mn:zy.transition!==null?(Wl===0&&(o=il,il<<=1,(il&4194240)===0&&(il=64),Wl=o),Wl):(o=Et,o!==0?o:ue())}function fi(o,a,d){if(50<Ko)throw Ko=0,Ih=null,Error(l(185));var _=Xl(o,a);return _===null?null:(No(_,a,d),((yt&2)===0||_!==nn)&&(_===nn&&((yt&2)===0&&(zl|=a),on===4&&_r(_,Mn)),Vn(_,d),a===1&&yt===0&&(o.mode&1)===0&&(ks(),al&&Di())),_)}function Xl(o,a){o.lanes|=a;var d=o.alternate;for(d!==null&&(d.lanes|=a),d=o,o=o.return;o!==null;)o.childLanes|=a,d=o.alternate,d!==null&&(d.childLanes|=a),d=o,o=o.return;return d.tag===3?d.stateNode:null}function Vn(o,a){var d=o.callbackNode;Py(o,a);var _=sl(o,o===nn?Mn:0);if(_===0)d!==null&&Ep(d),o.callbackNode=null,o.callbackPriority=0;else if(a=_&-_,o.callbackPriority!==a){if(d!=null&&Ep(d),a===1)o.tag===0?By(zm.bind(null,o)):wp(zm.bind(null,o)),Pe?I(function(){yt===0&&Di()}):ku(Hu,Di),d=null;else{switch(Mp(_)){case 1:d=Hu;break;case 4:d=Ny;break;case 16:d=Vu;break;case 536870912:d=Uy;break;default:d=Vu}d=Zm(d,Bm.bind(null,o))}o.callbackPriority=a,o.callbackNode=d}}function Bm(o,a){if(Gl=-1,Wl=0,(yt&6)!==0)throw Error(l(327));var d=o.callbackNode;if(Jr()&&o.callbackNode!==d)return null;var _=sl(o,o===nn?Mn:0);if(_===0)return null;if((_&30)!==0||(_&o.expiredLanes)!==0||a)a=ql(o,_);else{a=_;var S=yt;yt|=2;var T=Vm();(nn!==o||Mn!==a)&&(ks(),Yr(o,a));do try{ox();break}catch(X){Hm(o,X)}while(!0);Xu(),Bl.current=T,yt=S,rn!==null?a=0:(nn=null,Mn=0,a=on)}if(a!==0){if(a===2&&(S=Fu(o),S!==0&&(_=S,a=Dh(o,S))),a===1)throw d=Jo,Yr(o,0),_r(o,_),Vn(o,pn()),d;if(a===6)_r(o,_);else{if(S=o.current.alternate,(_&30)===0&&!rx(S)&&(a=ql(o,_),a===2&&(T=Fu(o),T!==0&&(_=T,a=Dh(o,T))),a===1))throw d=Jo,Yr(o,0),_r(o,_),Vn(o,pn()),d;switch(o.finishedWork=S,o.finishedLanes=_,a){case 0:case 1:throw Error(l(345));case 2:Zr(o,Hn);break;case 3:if(_r(o,_),(_&130023424)===_&&(a=Rh+500-pn(),10<a)){if(sl(o,0)!==0)break;if(S=o.suspendedLanes,(S&_)!==_){Nn(),o.pingedLanes|=o.suspendedLanes&S;break}o.timeoutHandle=Ee(Zr.bind(null,o,Hn),a);break}Zr(o,Hn);break;case 4:if(_r(o,_),(_&4194240)===_)break;for(a=o.eventTimes,S=-1;0<_;){var O=31-Jn(_);T=1<<O,O=a[O],O>S&&(S=O),_&=~T}if(_=S,_=pn()-_,_=(120>_?120:480>_?480:1080>_?1080:1920>_?1920:3e3>_?3e3:4320>_?4320:1960*ix(_/1960))-_,10<_){o.timeoutHandle=Ee(Zr.bind(null,o,Hn),_);break}Zr(o,Hn);break;case 5:Zr(o,Hn);break;default:throw Error(l(329))}}}return Vn(o,pn()),o.callbackNode===d?Bm.bind(null,o):null}function Dh(o,a){var d=jo;return o.current.memoizedState.isDehydrated&&(Yr(o,a).flags|=256),o=ql(o,a),o!==2&&(
vendor: 9,612 bytes, line 3716
3716a=Hn,Hn=d,a!==null&&Nh(a)),o}function Nh(o){Hn===null?Hn=o:Hn.push.apply(Hn,o)}function rx(o){for(var a=o;;){if(a.flags&16384){var d=a.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var _=0;_<d.length;_++){var S=d[_],T=S.getSnapshot;S=S.value;try{if(!Ii(T(),S))return!1}catch{return!1}}}if(d=a.child,a.subtreeFlags&16384&&d!==null)d.return=a,a=d;else{if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function _r(o,a){for(a&=~Ch,a&=~zl,o.suspendedLanes|=a,o.pingedLanes&=~a,o=o.expirationTimes;0<a;){var d=31-Jn(a),_=1<<d;o[d]=-1,a&=~_}}function zm(o){if((yt&6)!==0)throw Error(l(327));Jr();var a=sl(o,0);if((a&1)===0)return Vn(o,pn()),null;var d=ql(o,a);if(o.tag!==0&&d===2){var _=Fu(o);_!==0&&(a=_,d=Dh(o,_))}if(d===1)throw d=Jo,Yr(o,0),_r(o,a),Vn(o,pn()),d;if(d===6)throw Error(l(345));return o.finishedWork=o.current.alternate,o.finishedLanes=a,Zr(o,Hn),Vn(o,pn()),null}function km(o){mr!==null&&mr.tag===0&&(yt&6)===0&&Jr();var a=yt;yt|=1;var d=Jt.transition,_=Et;try{if(Jt.transition=null,Et=1,o)return o()}finally{Et=_,Jt.transition=d,yt=a,(yt&6)===0&&Di()}}function Uh(){$n=Bs.current,$e(Bs)}function Yr(o,a){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==nt&&(o.timeoutHandle=nt,et(d)),rn!==null)for(d=rn.return;d!==null;){var _=d;switch(Qu(_),_.tag){case 1:_=_.type.childContextTypes,_!=null&&Zt();break;case 3:Os(),$e(Gt),$e(vt),sh();break;case 5:ih(_);break;case 4:Os();break;case 13:$e(Ht);break;case 19:$e(Ht);break;case 10:qu(_.type._context);break;case 22:case 23:Uh()}d=d.return}if(nn=o,rn=o=vr(o.current,null),Mn=$n=a,on=0,Jo=null,Ch=zl=zs=0,Hn=jo=null,Ni!==null){for(a=0;a<Ni.length;a++)if(d=Ni[a],_=d.interleaved,_!==null){d.interleaved=null;var S=_.next,T=d.pending;if(T!==null){var O=T.next;T.next=S,_.next=O}d.pending=_}Ni=null}return o}function Hm(o,a){do{var d=rn;try{if(Xu(),vl.current=wl,yl){for(var _=Wt.memoizedState;_!==null;){var S=_.queue;S!==null&&(S.pending=null),_=_.next}yl=!1}if(Fs=0,mn=En=Wt=null,ko=!1,Ho=0,bh.current=null,d===null||d.return===null){on=1,Jo=a,rn=null;break}e:{var T=o,O=d.return,X=d,se=a;if(a=Mn,X.flags|=32768,se!==null&&typeof se=="object"&&typeof se.then=="function"){var ye=se,Ue=X,lt=Ue.tag;if((Ue.mode&1)===0&&(lt===0||lt===11||lt===15)){var Ze=Ue.alternate;Ze?(Ue.updateQueue=Ze.updateQueue,Ue.memoizedState=Ze.memoizedState,Ue.lanes=Ze.lanes):(Ue.updateQueue=null,Ue.memoizedState=null)}var Dt=lm(O);if(Dt!==null){Dt.flags&=-257,cm(Dt,O,X,T,a),Dt.mode&1&&am(T,ye,a),a=Dt,se=ye;var Ge=a.updateQueue;if(Ge===null){var An=new Set;An.add(se),a.updateQueue=An}else Ge.add(se);break e}else{if((a&1)===0){am(T,ye,a),Oh();break e}se=Error(l(426))}}else if(Bt&&X.mode&1){var pi=lm(O);if(pi!==null){(pi.flags&65536)===0&&(pi.flags|=256),cm(pi,O,X,T,a),th(se);break e}}T=se,on!==4&&(on=2),jo===null?jo=[T]:jo.push(T),se=fh(se,X),X=O;do{switch(X.tag){case 3:X.flags|=65536,a&=-a,X.lanes|=a;var $=sm(X,se,a);bp(X,$);break e;case 1:T=se;var q=X.type,re=X.stateNode;if((X.flags&128)===0&&(typeof q.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(pr===null||!pr.has(re)))){X.flags|=65536,a&=-a,X.lanes|=a;var Re=om(X,T,a);bp(X,Re);break e}}X=X.return}while(X!==null)}Wm(d)}catch(He){a=He,rn===d&&d!==null&&(rn=d=d.return);continue}break}while(!0)}function Vm(){var o=Bl.current;return Bl.current=wl,o===null?wl:o}function Oh(){(on===0||on===3||on===2)&&(on=4),nn===null||(zs&268435455)===0&&(zl&268435455)===0||_r(nn,Mn)}function ql(o,a){var d=yt;yt|=2;var _=Vm();nn===o&&Mn===a||Yr(o,a);do try{sx();break}catch(S){Hm(o,S)}while(!0);if(Xu(),yt=d,Bl.current=_,rn!==null)throw Error(l(261));return nn=null,Mn=0,on}function sx(){for(;rn!==null;)Gm(rn)}function ox(){for(;rn!==null&&!Iy();)Gm(rn)}function Gm(o){var a=Ym(o.alternate,o,$n);o.memoizedProps=o.pendingProps,a===null?Wm(o):rn=a,bh.current=null}function Wm(o){var a=o;do{var d=a.alternate;if(o=a.return,(a.flags&32768)===0){if(d=Jy(d,a,$n),d!==null){rn=d;return}}else{if(d=Qy(d,a),d!==null){d.flags&=32767,rn=d;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{on=6,rn=null;return}}if(a=a.sibling,a!==null){rn=a;return}rn=a=o}while(a!==null);on===0&&(on=5)}function Zr(o,a){var d=Et,_=Jt.transition;try{Jt.transition=null,Et=1,ax(o,a,d)}finally{Jt.transition=_,Et=d}return null}function ax(o,a,d){do Jr();while(mr!==null);if((yt&6)!==0)throw Error(l(327));var _=o.finishedWork,S=o.finishedLanes;if(_===null)return null;if(o.finishedWork=null,o.finishedLanes=0,_===o.current)throw Error(l(177));o.callbackNode=null,o.callbackPriority=0;var T=_.lanes|_.childLanes;if(Ly(o,T),o===nn&&(rn=nn=null,Mn=0),(_.subtreeFlags&2064)===0&&(_.flags&2064)===0||Hl||(Hl=!0,Zm(Vu,function(){return Jr(),null})),T=(_.flags&15990)!==0,(_.subtreeFlags&15990)!==0||T){T=Jt.transition,Jt.transition=null;var O=Et;Et=1;var X=yt;yt|=4,bh.current=null,ex(o,_),tx(o,_),W(o.containerInfo),o.current=_,nx(_),Dy(),yt=X,Et=O,Jt.transition=T}else o.current=_;if(Hl&&(Hl=!1,mr=o,Vl=S),T=o.pendingLanes,T===0&&(pr=null),Oy(_.stateNode),Vn(o,pn()),a!==null)for(d=o.onRecoverableError,_=0;_<a.length;_++)d(a[_]);if(kl)throw kl=!1,o=Lh,Lh=null,o;return(Vl&1)!==0&&o.tag!==0&&Jr(),T=o.pendingLanes,(T&1)!==0?o===Ih?Ko++:(Ko=0,Ih=o):Ko=0,Di(),null}function Jr(){if(mr!==null){var o=Mp(Vl),a=Jt.transition,d=Et;try{if(Jt.transition=null,Et=16>o?16:o,mr===null)var _=!1;else{if(o=mr,mr=null,Vl=0,(yt&6)!==0)throw Error(l(331));var S=yt;for(yt|=4,Ce=o.current;Ce!==null;){var T=Ce,O=T.child;if((Ce.flags&16)!==0){var X=T.deletions;if(X!==null){for(var se=0;se<X.length;se++){var ye=X[se];for(Ce=ye;Ce!==null;){var Ue=Ce;switch(Ue.tag){case 0:case 11:case 15:qr(8,Ue,T)}var lt=Ue.child;if(lt!==null)lt.return=Ue,Ce=lt;else for(;Ce!==null;){Ue=Ce;var Ze=Ue.sibling,Dt=Ue.return;if(Cm(Ue),Ue===ye){Ce=null;break}if(Ze!==null){Ze.return=Dt,Ce=Ze;break}Ce=Dt}}}var Ge=T.alternate;if(Ge!==null){var An=Ge.child;if(An!==null){Ge.child=null;do{var pi=An.sibling;An.sibling=null,An=pi}while(An!==null)}}Ce=T}}if((T.subtreeFlags&2064)!==0&&O!==null)O.return=T,Ce=O;else e:for(;Ce!==null;){if(T=Ce,(T.flags&2048)!==0)switch(T.tag){case 0:case 11:case 15:qr(9,T,T.return)}var $=T.sibling;if($!==null){$.return=T.return,Ce=$;break e}Ce=T.return}}var q=o.current;for(Ce=q;Ce!==null;){O=Ce;var re=O.child;if((O.subtreeFlags&2064)!==0&&re!==null)re.return=O,Ce=re;else e:for(O=q;Ce!==null;){if(X=Ce,(X.flags&2048)!==0)try{switch(X.tag){case 0:case 11:case 15:Yo(9,X)}}catch(He){Gn(X,X.return,He)}if(X===O){Ce=null;break e}var Re=X.sibling;if(Re!==null){Re.return=X.return,Ce=Re;break e}Ce=X.return}}if(yt=S,Di(),Li&&typeof Li.onPostCommitFiberRoot=="function")try{Li.onPostCommitFiberRoot(ol,o)}catch{}_=!0}return _}finally{Et=d,Jt.transition=a}}return!1}function Xm(o,a,d){a=fh(d,a),a=sm(o,a,1),dr(o,a),a=Nn(),o=Xl(o,1),o!==null&&(No(o,1,a),Vn(o,a))}function Gn(o,a,d){if(o.tag===3)Xm(o,o,d);else for(;a!==null;){if(a.tag===3){Xm(a,o,d);break}else if(a.tag===1){var _=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof _.componentDidCatch=="function"&&(pr===null||!pr.has(_))){o=fh(d,o),o=om(a,o,1),dr(a,o),o=Nn(),a=Xl(a,1),a!==null&&(No(a,1,o),Vn(a,o));break}}a=a.return}}function lx(o,a,d){var _=o.pingCache;_!==null&&_.delete(a),a=Nn(),o.pingedLanes|=o.suspendedLanes&d,nn===o&&(Mn&d)===d&&(on===4||on===3&&(Mn&130023424)===Mn&&500>pn()-Rh?Yr(o,0):Ch|=d),Vn(o,a)}function qm(o,a){a===0&&((o.mode&1)===0?a=1:(a=rl,rl<<=1,(rl&130023424)===0&&(rl=4194304)));var d=Nn();o=Xl(o,a),o!==null&&(No(o,a,d),Vn(o,d))}function cx(o){var a=o.memoizedState,d=0;a!==null&&(d=a.retryLane),qm(o,d)}function ux(o,a){var d=0;switch(o.tag){case 13:var _=o.stateNode,S=o.memoizedState;S!==null&&(d=S.retryLane);break;case 19:_=o.stateNode;break;default:throw Error(l(314))}_!==null&&_.delete(a),qm(o,d)}var Ym;Ym=function(o,a,d){if(o!==null)if(o.memoizedProps!==a.pendingProps||Gt.current)Qn=!0;else{if((o.lanes&d)===0&&(a.flags&128)===0)return Qn=!1,Ky(o,a,d);Qn=(o.flags&131072)!==0}else Qn=!1,Bt&&(a.flags&1048576)!==0&&Dp(a,ml,a.index);switch(a.lanes=0,a.tag){case 2:var _=a.type;o!==null&&(o.alternate=null,a.alternate=null,a.flags|=2),o=a.pendingProps;var S=oi(a,vt.current);Ps(a,d),S=ah(null,a,_,o,S,d);var T=lh();return a.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,dn(_)?(T=!0,Sn(a)):T=!1,a.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,Zu(a),S.updater=dl,a.stateNode=S,S._reactInternals=a,ju(a,_,o,d),a=mh(null,a,_,!0,T,d)):(a.tag=0,Bt&&T&&Ku(a),Dn(null,a,S,d),a=a.child),a;case 16:_=a.elementType;e:{switch(o!==null&&(o.alternate=null,a.alternate=null,a.flags|=2),o=a.pendingProps,S=_._init,_=S(_._payload),a.type=_,S=a.tag=fx(_),o=gi(_,o),S){case 0:a=ph(null,a,_,o,d);break e;case 1:a=_m(null,a,_,o,d);break e;case 11:a=fm(null,a,_,o,d);break e;case 14:a=dm(null,a,_,gi(_.type,o),d);break e}throw Error(l(306,_,""))}return a;case 0:return _=a.type,S=a.pendingProps,S=a.elementType===_?S:gi(_,S),ph(o,a,_,S,d);case 1:return _=a.type,S=a.pendingProps,S=a.elementType===_?S:gi(_,S),_m(o,a,_,S,d);case 3:e:{if(vm(a),o===null)throw Error(l(387));_=a.pendingProps,T=a.memoizedState,S=T.element,Ap(o,a),fl(a,_,null,d);var O=a.memoizedState;if(_=O.element,_e&&T.isDehydrated)if(T={element:_,isDehydrated:!1,cache:O.cache,transitions:O.transitions},a.updateQueue.baseState=T,a.memoizedState=T,a.flags&256){S=Error(l(423)),a=ym(o,a,_,d,S);break e}else if(_!==S){S=Error(l(424)),a=ym(o,a,_,d,S);break e}else for(_e&&(Kn=el(a.stateNode.containerInfo),jn=a,Bt=!0,_i=null,U
vendor: 23,301 bytes, lines 3716-3728
3716o=!1),d=zp(a,null,_,d),a.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Ds(),_===S){a=ji(o,a,d);break e}Dn(o,a,_,d)}a=a.child}return a;case 5:return kp(a),o===null&&eh(a),_=a.type,S=a.pendingProps,T=o!==null?o.memoizedProps:null,O=S.children,xe(_,S)?O=null:T!==null&&xe(_,T)&&(a.flags|=32),gm(o,a),Dn(o,a,O,d),a.child;case 6:return o===null&&eh(a),null;case 13:return xm(o,a,d);case 4:return nh(a,a.stateNode.containerInfo),_=a.pendingProps,o===null?a.child=Ns(a,null,_,d):Dn(o,a,_,d),a.child;case 11:return _=a.type,S=a.pendingProps,S=a.elementType===_?S:gi(_,S),fm(o,a,_,S,d);case 7:return Dn(o,a,a.pendingProps,d),a.child;case 8:return Dn(o,a,a.pendingProps.children,d),a.child;case 12:return Dn(o,a,a.pendingProps.children,d),a.child;case 10:e:{if(_=a.type._context,S=a.pendingProps,T=a.memoizedProps,O=S.value,Tp(a,_,O),T!==null)if(Ii(T.value,O)){if(T.children===S.children&&!Gt.current){a=ji(o,a,d);break e}}else for(T=a.child,T!==null&&(T.return=a);T!==null;){var X=T.dependencies;if(X!==null){O=T.child;for(var se=X.firstContext;se!==null;){if(se.context===_){if(T.tag===1){se=qi(-1,d&-d),se.tag=2;var ye=T.updateQueue;if(ye!==null){ye=ye.shared;var Ue=ye.pending;Ue===null?se.next=se:(se.next=Ue.next,Ue.next=se),ye.pending=se}}T.lanes|=d,se=T.alternate,se!==null&&(se.lanes|=d),Yu(T.return,d,a),X.lanes|=d;break}se=se.next}}else if(T.tag===10)O=T.type===a.type?null:T.child;else if(T.tag===18){if(O=T.return,O===null)throw Error(l(341));O.lanes|=d,X=O.alternate,X!==null&&(X.lanes|=d),Yu(O,d,a),O=T.sibling}else O=T.child;if(O!==null)O.return=T;else for(O=T;O!==null;){if(O===a){O=null;break}if(T=O.sibling,T!==null){T.return=O.return,O=T;break}O=O.return}T=O}Dn(o,a,S.children,d),a=a.child}return a;case 9:return S=a.type,_=a.pendingProps.children,Ps(a,d),S=ai(S),_=_(S),a.flags|=1,Dn(o,a,_,d),a.child;case 14:return _=a.type,S=gi(_,a.pendingProps),S=gi(_.type,S),dm(o,a,_,S,d);case 15:return pm(o,a,a.type,a.pendingProps,d);case 17:return _=a.type,S=a.pendingProps,S=a.elementType===_?S:gi(_,S),o!==null&&(o.alternate=null,a.alternate=null,a.flags|=2),a.tag=1,dn(_)?(o=!0,Sn(a)):o=!1,Ps(a,d),Lp(a,_,S),ju(a,_,S,d),mh(null,a,_,!0,o,d);case 19:return wm(o,a,d);case 22:return mm(o,a,d)}throw Error(l(156,a.tag))};function Zm(o,a){return ku(o,a)}function hx(o,a,d,_){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=_,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function di(o,a,d,_){return new hx(o,a,d,_)}function Fh(o){return o=o.prototype,!(!o||!o.isReactComponent)}function fx(o){if(typeof o=="function")return Fh(o)?1:0;if(o!=null){if(o=o.$$typeof,o===M)return 11;if(o===w)return 14}return 2}function vr(o,a){var d=o.alternate;return d===null?(d=di(o.tag,a,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=a,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&14680064,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,a=o.dependencies,d.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function Yl(o,a,d,_,S,T){var O=2;if(_=o,typeof o=="function")Fh(o)&&(O=1);else if(typeof o=="string")O=5;else e:switch(o){case f:return jr(d.children,S,T,a);case p:O=8,S|=8;break;case m:return o=di(12,d,a,S|2),o.elementType=m,o.lanes=T,o;case x:return o=di(13,d,a,S),o.elementType=x,o.lanes=T,o;case v:return o=di(19,d,a,S),o.elementType=v,o.lanes=T,o;case A:return Zl(d,S,T,a);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case g:O=10;break e;case y:O=9;break e;case M:O=11;break e;case w:O=14;break e;case E:O=16,_=null;break e}throw Error(l(130,o==null?o:typeof o,""))}return a=di(O,d,a,S),a.elementType=o,a.type=_,a.lanes=T,a}function jr(o,a,d,_){return o=di(7,o,_,a),o.lanes=d,o}function Zl(o,a,d,_){return o=di(22,o,_,a),o.elementType=A,o.lanes=d,o.stateNode={},o}function Bh(o,a,d){return o=di(6,o,null,a),o.lanes=d,o}function zh(o,a,d){return a=di(4,o.children!==null?o.children:[],o.key,a),a.lanes=d,a.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},a}function dx(o,a,d,_,S){this.tag=a,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=nt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bu(0),this.expirationTimes=Bu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bu(0),this.identifierPrefix=_,this.onRecoverableError=S,_e&&(this.mutableSourceEagerHydrationData=null)}function Jm(o,a,d,_,S,T,O,X,se){return o=new dx(o,a,d,X,se),a===1?(a=1,T===!0&&(a|=8)):a=0,T=di(3,null,null,a),o.current=T,T.stateNode=o,T.memoizedState={element:_,isDehydrated:d,cache:null,transitions:null},Zu(T),o}function jm(o){if(!o)return si;o=o._reactInternals;e:{if(b(o)!==o||o.tag!==1)throw Error(l(170));var a=o;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(dn(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(l(171))}if(o.tag===1){var d=o.type;if(dn(d))return bs(o,d,a)}return a}function Km(o){var a=o._reactInternals;if(a===void 0)throw typeof o.render=="function"?Error(l(188)):(o=Object.keys(o).join(","),Error(l(268,o)));return o=Q(a),o===null?null:o.stateNode}function Qm(o,a){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<a?d:a}}function kh(o,a){Qm(o,a),(o=o.alternate)&&Qm(o,a)}function px(o){return o=Q(o),o===null?null:o.stateNode}function mx(){return null}return t.attemptContinuousHydration=function(o){if(o.tag===13){var a=Nn();fi(o,134217728,a),kh(o,134217728)}},t.attemptHydrationAtCurrentPriority=function(o){if(o.tag===13){var a=Nn(),d=gr(o);fi(o,d,a),kh(o,d)}},t.attemptSynchronousHydration=function(o){switch(o.tag){case 3:var a=o.stateNode;if(a.current.memoizedState.isDehydrated){var d=Do(a.pendingLanes);d!==0&&(zu(a,d|1),Vn(a,pn()),(yt&6)===0&&(ks(),Di()))}break;case 13:var _=Nn();km(function(){return fi(o,1,_)}),kh(o,1)}},t.batchedUpdates=function(o,a){var d=yt;yt|=1;try{return o(a)}finally{yt=d,yt===0&&(ks(),al&&Di())}},t.createComponentSelector=function(o){return{$$typeof:Dl,value:o}},t.createContainer=function(o,a,d,_,S,T,O){return Jm(o,a,!1,null,d,_,S,T,O)},t.createHasPseudoClassSelector=function(o){return{$$typeof:Nl,value:o}},t.createHydrationContainer=function(o,a,d,_,S,T,O,X,se){return o=Jm(d,_,!0,o,S,T,O,X,se),o.context=jm(null),d=o.current,_=Nn(),S=gr(d),T=qi(_,S),T.callback=a??null,dr(d,T),o.current.lanes=S,No(o,S,_),Vn(o,_),o},t.createPortal=function(o,a,d){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:_==null?null:""+_,children:o,containerInfo:a,implementation:d}},t.createRoleSelector=function(o){return{$$typeof:Ul,value:o}},t.createTestNameSelector=function(o){return{$$typeof:Ol,value:o}},t.createTextSelector=function(o){return{$$typeof:Fl,value:o}},t.deferredUpdates=function(o){var a=Et,d=Jt.transition;try{return Jt.transition=null,Et=16,o()}finally{Et=a,Jt.transition=d}},t.discreteUpdates=function(o,a,d,_,S){var T=Et,O=Jt.transition;try{return Jt.transition=null,Et=1,o(a,d,_,S)}finally{Et=T,Jt.transition=O,yt===0&&ks()}},t.findAllNodes=Ah,t.findBoundingRects=function(o,a){if(!C)throw Error(l(363));a=Ah(o,a),o=[];for(var d=0;d<a.length;d++)o.push(ge(a[d]));for(a=o.length-1;0<a;a--){d=o[a];for(var _=d.x,S=_+d.width,T=d.y,O=T+d.height,X=a-1;0<=X;X--)if(a!==X){var se=o[X],ye=se.x,Ue=ye+se.width,lt=se.y,Ze=lt+se.height;if(_>=ye&&T>=lt&&S<=Ue&&O<=Ze){o.splice(a,1);break}else if(_!==ye||d.width!==se.width||Ze<T||lt>O){if(!(T!==lt||d.height!==se.height||Ue<_||ye>S)){ye>_&&(se.width+=ye-_,se.x=_),Ue<S&&(se.width=S-ye),o.splice(a,1);break}}else{lt>T&&(se.height+=lt-T,se.y=T),Ze<O&&(se.height=O-lt),o.splice(a,1);break}}}return o},t.findHostInstance=Km,t.findHostInstanceWithNoPortals=function(o){return o=B(o),o=o!==null?V(o):null,o===null?null:o.stateNode},t.findHostInstanceWithWarning=function(o){return Km(o)},t.flushControlled=function(o){var a=yt;yt|=1;var d=Jt.transition,_=Et;try{Jt.transition=null,Et=1,o()}finally{Et=_,Jt.transition=d,yt=a,yt===0&&(ks(),Di())}},t.flushPassiveEffects=Jr,t.flushSync=km,t.focusWithin=function(o,a){if(!C)throw Error(l(363));for(o=Eh(o),a=Fm(o,a),a=Array.from(a),o=0;o<a.length;){var d=a[o++];if(!de(d)){if(d.tag===5&&we(d.stateNode))return!0;for(d=d.child;d!==null;)a.push(d),d=d.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Et},t.getFindAllNodesFailureDescription=function(o,a){if(!C)throw Error(l(363));var d=0,_=[];o=[Eh(o),0];for(var S=0;S<o.length;){var T=o[S++],O=o[S++],X=a[O];if((T.tag!==5||!de(T))&&(wh(T,X)&&(_.push(Th(X)),O++,O>d&&(d=O)),O<a.length))for(T=T.child;T!==null;)o.push(T,O),T=T.sibling}if(d<a.length){for(o=[];d<a.length;d++)o.push(Th(a[d]));return`findAllNodes was able to match part of the selector:
3717  `+(_.join(" > ")+`
3718
3719No matching component was found for:
3720  `)+o.join(" > ")}return null},t.getPublicRootInstance=function(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return ee(o.child.stateNode);default:return o.child.stateNode}},t.injectIntoDevTools=function(o){if(o={bundleType:o.bundleType,version:o.version,rendererPackageName:o.rendererPackageName,rendererConfig:o.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:c.ReactCurrentDispatcher,findHostInstanceByFiber:px,findFiberByHostInstance:o.findFiberByHostInstance||mx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")o=!1;else{var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled||!a.supportsFiber)o=!0;else{try{ol=a.inject(o),Li=a}catch{}o=!!a.checkDCE}}return o},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(o,a,d,_){if(!C)throw Error(l(363));o=Ah(o,a);var S=De(o,d,_).disconnect;return{disconnect:function(){S()}}},t.registerMutableSourceForHydration=function(o,a){var d=a._getVersion;d=d(a._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[a,d]:o.mutableSourceEagerHydrationData.push(a,d)},t.runWithPriority=function(o,a){var d=Et;try{return Et=o,a()}finally{Et=d}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(o,a,d,_){var S=a.current,T=Nn(),O=gr(S);return d=jm(d),a.context===null?a.context=d:a.pendingContext=d,a=qi(T,O),a.payload={element:o},_=_===void 0?null:_,_!==null&&(a.callback=_),dr(S,a),o=fi(S,O,T),o!==null&&hl(o,S,O),O},t}),Rf}var N0;function Mb(){return N0||(N0=1,Af.exports=Sb()),Af.exports}var Eb=Mb();const wb=vx(Eb);var Pf={exports:{}},Lf={};/**
3721 * @license React
3722 * scheduler.production.min.js
3723 *
3724 * Copyright (c) Facebook, Inc. and its affiliates.
3725 *
3726 * This source code is licensed under the MIT license found in the
3727 * LICENSE file in the root directory of this source tree.
3728 */var U0;function Tb(){return U0||(U0=1,(function(r){function e(F,H){var W=F.length;F.push(H);e:for(;0<W;){var Y=W-1>>>1,oe=F[Y];if(0<i(oe,H))F[Y]=H,F[W]=oe,W=Y;else break e}}function t(F){return F.length===0?null:F[0]}function n(F){if(F.length===0)return null;var H=F[0],W=F.pop();if(W!==H){F[0]=W;e:for(var Y=0,oe=F.length,j=oe>>>1;Y<j;){var ae=2*(Y+1)-1,xe=F[ae],Te=ae+1,Ee=F[Te];if(0>i(xe,W))Te<oe&&0>i(Ee,xe)?(F[Y]=Ee,F[Te]=W,Y=Te):(F[Y]=xe,F[ae]=W,Y=ae);else if(Te<oe&&0>i(Ee,W))F[Y]=Ee,F[Te]=W,Y=Te;else break e}}return H}function i(F,H){var W=F.sortIndex-H.sortIndex;return W!==0?W:F.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;r.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();r.unstable_now=function(){return l.now()-c}}var u=[],h=[],f=1,p=null,m=3,g=!1,y=!1,M=!1,x=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(F){for(var H=t(h);H!==null;){if(H.callback===null)n(h);else if(H.startTime<=F)n(h),H.sortIndex=H.expirationTime,e(u,H);else break;H=t(h)}}function A(F){if(M=!1,E(F),!y)if(t(u)!==null)y=!0,ee(N);else{var H=t(h);H!==null&&le(A,H.startTime-F)}}function N(F,H){y=!1,M&&(M=!1,v(z),z=-1),g=!0;var W=m;try{for(E(H),p=t(u);p!==null&&(!(p.expirationTime>H)||F&&!B());){var Y=p.callback;if(typeof Y=="function"){p.callback=null,m=p.priorityLevel;var oe=Y(p.expirationTime<=H);H=r.unstable_now(),typeof oe=="function"?p.callback=oe:p===t(u)&&n(u),E(H)}else n(u);p=t(u)}if(p!==null)var j=!0;else{var ae=t(h);ae!==null&&le(A,ae.startTime-H),j=!1}return j}finally{p=null,m=W,g=!1}}var R=!1,L=null,z=-1,b=5,P=-1;function B(){return!(r.unstable_now()-P<b)}function Q(){if(L!==null){var F=r.unstable_now();P=F;var H=!0;try{H=L(!0,F)}finally{H?ce():(R=!1,L=null)}}else R=!1}var ce;if(typeof w=="function")ce=function(){w(Q)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,J=V.port2;V.port1.onmessage=Q,ce=function(){J.postMessage(null)}}else ce=function(){x(Q,0)};function ee(F){L=F,R||(R=!0,ce())}function le(F,H){z=x(function(){F(r.unstable_now())},H)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(F){F.callback=null},r.unstable_continueExecution=function(){y||g||(y=!0,ee(N))},r.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<F?Math.floor(1e3/F):5},r.unstable_getCurrentPriorityLevel=function(){return m},r.unstable_getFirstCallbackNode=function(){return t(u)},r.unstable_next=function(F){switch(m){case 1:case 2:case 3:var H=3;break;default:H=m}var W=m;m=H;try{return F()}finally{m=W}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(F,H){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var W=m;m=F;try{return H()}finally{m=W}},r.unstable_scheduleCallback=function(F,H,W){var Y=r.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?Y+W:Y):W=Y,F){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=W+oe,F={id:f++,callback:H,priorityLevel:F,startTime:W,expirationTime:oe,sortIndex:-1},W>Y?(F.sortIndex=W,e(h,F),t(u)===null&&F===t(h)&&(M?(v(z),z=-1):M=!0,le(A,W-Y))):(F.sortIndex=oe,e(u,F),y||g||(y=!0,ee(N))),F},r.unstable_shouldYield=B,r.unstable_wrapCallback=function(F){var H=m;return function(){var W=m;m=H;try{return F.apply(this,arguments)}finally{m=W}}}})(Lf)),Lf}var O0;function Ab(){return O0||(O0=1,Pf.exports=Tb()),Pf.exports}var F0=Ab();const xp={},bb=r=>void Object.assign(xp,r);function Cb(r,e){function t(f,{args:p=[],attach:m,...g},y){let M=`${f[0].toUpperCase()}${f.slice(1)}`,x;if(f==="primitive"){if(g.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const v=g.object;x=uo(v,{type:f,root:y,attach:m,primitive:!0})}else{const v=xp[M];if(!v)throw new Error(`R3F: ${M} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(p))throw new Error("R3F: The args prop must be an array!");x=uo(new v(...p),{type:f,root:y,attach:m,memoizedProps:{args:p}})}return x.__r3f.attach===void 0&&(x.isBufferGeometry?x.__r3f.attach="geometry":x.isMaterial&&(x.__r3f.attach="material")),M!=="inject"&&Nf(x,g),x}function n(f,p){let m=!1;if(p){var g,y;(g=p.__r3f)!=null&&g.attach?Df(f,p,p.__r3f.attach):p.isObject3D&&f.isObject3D&&(f.add(p),m=!0),m||(y=f.__r3f)==null||y.objects.push(p),p.__r3f||uo(p,{}),p.__r3f.parent=f,Pd(p),ho(p)}}function i(f,p,m){let g=!1;if(p){var y,M;if((y=p.__r3f)!=null&&y.attach)Df(f,p,p.__r3f.attach);else if(p.isObject3D&&f.isObject3D){p.parent=f,p.dispatchEvent({type:"added"}),f.dispatchEvent({type:"childadded",child:p});const x=f.children.filter(w=>w!==p),v=x.indexOf(m);f.children=[...x.slice(0,v),p,...x.slice(v)],g=!0}g||(M=f.__r3f)==null||M.objects.push(p),p.__r3f||uo(p,{}),p.__r3f.parent=f,Pd(p),ho(p)}}function s(f,p,m=!1){f&&[...f].forEach(g=>l(p,g,m))}function l(f,p,m){if(p){var g,y,M;if(p.__r3f&&(p.__r3f.parent=null),(g=f.__r3f)!=null&&g.objects&&(f.__r3f.objects=f.__r3f.objects.filter(A=>A!==p)),(y=p.__r3f)!=null&&y.attach)V0(f,p,p.__r3f.attach);else if(p.isObject3D&&f.isObject3D){var x;f.remove(p),(x=p.__r3f)!=null&&x.root&&Ub(Qc(p),p)}const w=(M=p.__r3f)==null?void 0:M.primitive,E=!w&&(m===void 0?p.dispose!==null:m);if(!w){var v;s((v=p.__r3f)==null?void 0:v.objects,p,E),s(p.children,p,E)}if(delete p.__r3f,E&&p.dispose&&p.type!=="Scene"){const A=()=>{try{p.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?F0.unstable_scheduleCallback(F0.unstable_IdlePriority,A):A()}ho(f)}}function c(f,p,m,g){var y;const M=(y=f.__r3f)==null?void 0:y.parent;if(!M)return;const x=t(p,m,f.__r3f.root);if(f.children){for(const v of f.children)v.__r3f&&n(x,v);f.children=f.children.filter(v=>!v.__r3f)}f.__r3f.objects.forEach(v=>n(x,v)),f.__r3f.objects=[],f.__r3f.autoRemovedBeforeAppend||l(M,f),x.parent&&(x.__r3f.autoRemovedBeforeAppend=!0),n(M,x),x.raycast&&x.__r3f.eventCount&&Qc(x).getState().internal.interaction.push(x),[g,g.alternate].forEach(v=>{v!==null&&(v.stateNode=x,v.ref&&(typeof v.ref=="function"?v.ref(x):v.ref.current=x))})}const u=()=>{};return{reconciler:wb({createInstance:t,removeChild:l,appendChild:n,appendInitialChild:n,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(f,p)=>{if(!p)return;const m=f.getState().scene;m.__r3f&&(m.__r3f.root=f,n(m,p))},removeChildFromContainer:(f,p)=>{p&&l(f.getState().scene,p)},insertInContainerBefore:(f,p,m)=>{if(!p||!m)return;const g=f.getState().scene;g.__r3f&&i(g,p,m)},getRootHostContext:()=>null,getChildHostContext:f=>f,finalizeInitialChildren(f){var p;return!!((p=f==null?void 0:f.__r3f)!=null?p:{}).handlers},prepareUpdate(f,p,m,g){var y;if(((y=f==null?void 0:f.__r3f)!=null?y:{}).primitive&&g.object&&g.object!==f)return[!0];{const{args:x=[],children:v,...w}=g,{args:E=[],children:A,...N}=m;if(!Array.isArray(x))throw new Error("R3F: the args prop must be an array!");if(x.some((L,z)=>L!==E[z]))return[!0];const R=_y(f,w,N,!0);return R.changes.length?[!1,R]:null}},commitUpdate(f,[p,m],g,y,M,x){p?c(f,g,M,x):Nf(f,m)},commitMount(f,p,m,g){var y;const M=(y=f.__r3f)!=null?y:{};f.raycast&&M.handlers&&M.eventCount&&Qc(f).getState().internal.interaction.push(f)},getPublicInstance:f=>f,prepareForCommit:()=>null,preparePortalMount:f=>uo(f.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(f){var p;const{attach:m,parent:g}=(p=f.__r3f)!=null?p:{};m&&g&&V0(g,f,m),f.isObject3D&&(f.visible=!1),ho(f)},unhideInstance(f,p){var m;const{attach:g,parent:y}=(m=f.__r3f)!=null?m:{};g&&y&&Df(y,f,g),(f.isObject3D&&p.visible==null||p.visible)&&(f.visible=!0),ho(f)},createTextInstance:u,hideTextInstance:u,unhideTextInstance:u,getCurrentEventPriority:()=>e?e():vo.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Ot.fun(performance.now)?performance.now:Ot.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Ot.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Ot.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Nf}}var B0,z0;const If=r=>"colorSpace"in r||"outputColorSpace"in r,hy=()=>{var r;return(r=xp.ColorManagement)!=null?r:null},fy=r=>r&&r.isOrthographicCamera,Rb=r=>r&&r.hasOwnProperty("current"),$a=typeof window<"u"&&((B0=window.document)!=null&&B0.createElement||((z0=window.navigator)==null?void 0:z0.product)==="ReactNative")?ke.useLayoutEffect:ke.useEffect;function dy(r){const e=ke.useRef(r);return $a(()=>void(e.current=r),[r]),e}function Pb({set:r}){return $a(()=>(r(new Promise(()=>null)),()=>r(!1)),[r]),null}class py extends ke.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}py.getDerivedStateFromError=()=>({error:!0});const my="__default",k0=new Map,Lb=r=>r&&!!r.memoized&&!!r.changes;function gy(r){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(r)?Math.min(Math.max(r[0],t),r[1]):r}const ca=r=>{var e;return(e=r.__r3f)==null?void 0:e.root.getState()};function Qc(r){let e=r.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const Ot={obj:r=>r===Object(r)&&!Ot.arr(r)&&typeof r!="function",fun:r=>typeof r=="function",str:r=>typeof r=="string",num:r=>typeof r=="number",boo:r=>typeof r=="boolean",und:r=>r===void 0,arr:r=>Array.isArray(r),equ(r,e,{arrays:t="shallow",objects:n="reference",strict:i=!0}={}){if(typeof r!=typeof e||!!r!=!!e)return!1;if(Ot.str(r)||Ot.num(r)||Ot.boo(r))return r===e;const s=Ot.obj(r);if(s&&n==="reference")return r===e;const l=Ot.arr(r);if(l&&t==="reference")return r===e;if((l||s)&&r===e)return!0;let c;for(c in r)if(!(c in e))return!1;if(s&&t==="shallow"&&n==="shallow"){for(c in i?e:r)if(!Ot.equ(r[c],e[c],{strict:i,objects:"reference"}))return!1}else for(c in i?e:r)if(r[c]!==e[c])return!1;if(Ot.und(c)){if(l&&r.length===0&&e.length===0||s&&Object.keys(r).length===0&&Object.keys(e).length===0)return!0;if(r!==e)return!1}return!0}};function Ib(r){r.dispose&&r.type!=="Scene"&&r.dispose();for(const e in r)e.dispose==null||e.dispose(),delete r[e]}function uo(r,e){const t=r;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},r}function Rd(r,e){let t=r;if(e.includes("-")){const n=e.split("-"),i=n.pop();return t=n.reduce((s,l)=>s[l],r),{target:t,key:i}}else return{target:t,key:e}}const H0=/-\d+$/;function Df(r,e,t){if(Ot.str(t)){if(H0.test(t)){const s=t.replace(H0,""),{target:l,key:c}=Rd(r,s);Array.isArray(l[c])||(l[c]=[])}const{target:n,key:i}=Rd(r,t);e.__r3f.previousAttach=n[i],n[i]=e}else e.__r3f.previousAttach=t(r,e)}function V0(r,e,t){var n,i;if(Ot.str(t)){const{target:s,key:l}=Rd(r,t),c=e.__r3f.previousAttach;c===void 0?delete s[l]:s[l]=c}else(n=e.__r3f)==null||n.previousAttach==null||n.previousAttach(r,e);(i=e.__r3f)==null||delete i.previousAttach}function _y(r,{children:e,key:t,ref:n,...i},{children:s,key:l,ref:c,...u}={},h=!1){const f=r.__r3f,p=Object.entries(i),m=[];
3728if(h){const y=Object.keys(u);for(let M=0;M<y.length;M++)i.hasOwnProperty(y[M])||p.unshift([y[M],my+"remove"])}p.forEach(([y,M])=>{var x;if((x=r.__r3f)!=null&&x.primitive&&y==="object"||Ot.equ(M,u[y]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(y))return m.push([y,M,!0,[]]);let v=[];y.includes("-")&&(v=y.split("-")),m.push([y,M,!1,v]);for(const w in i){const E=i[w];w.startsWith(`${y}-`)&&m.push([w,E,!1,w.split("-")])}});const g={...i};return f!=null&&f.memoizedProps&&f!=null&&f.memoizedProps.args&&(g.args=f.memoizedProps.args),f!=null&&f.memoizedProps&&f!=null&&f.memoizedProps.attach&&(g.attach=f.memoizedProps.attach),{memoized:g,changes:m}}function Nf(r,e){var t;const n=r.__r3f,i=n==null?void 0:n.root,s=i==null||i.getState==null?void 0:i.getState(),{memoized:l,changes:c}=Lb(e)?e:_y(r,e),u=n==null?void 0:n.eventCount;r.__r3f&&(r.__r3f.memoizedProps=l);for(let m=0;m<c.length;m++){let[g,y,M,x]=c[m];if(If(r)){const A="srgb",N="srgb-linear";g==="encoding"?(g="colorSpace",y=y===3001?A:N):g==="outputEncoding"&&(g="outputColorSpace",y=y===3001?A:N)}let v=r,w=v[g];if(x.length&&(w=x.reduce((E,A)=>E[A],r),!(w&&w.set))){const[E,...A]=x.reverse();v=A.reverse().reduce((N,R)=>N[R],r),g=E}if(y===my+"remove")if(v.constructor){let E=k0.get(v.constructor);E||(E=new v.constructor,k0.set(v.constructor,E)),y=E[g]}else y=0;if(M&&n)y?n.handlers[g]=y:delete n.handlers[g],n.eventCount=Object.keys(n.handlers).length;else if(w&&w.set&&(w.copy||w instanceof gs)){if(Array.isArray(y))w.fromArray?w.fromArray(y):w.set(...y);else if(w.copy&&y&&y.constructor&&w.constructor===y.constructor)w.copy(y);else if(y!==void 0){var h;const E=(h=w)==null?void 0:h.isColor;!E&&w.setScalar?w.setScalar(y):w instanceof gs&&y instanceof gs?w.mask=y.mask:w.set(y),!hy()&&s&&!s.linear&&E&&w.convertSRGBToLinear()}}else{var f;if(v[g]=y,(f=v[g])!=null&&f.isTexture&&v[g].format===Fn&&v[g].type===ki&&s){const E=v[g];
vendor: 13,395 bytes, line 3728
3728If(E)&&If(s.gl)?E.colorSpace=s.gl.outputColorSpace:E.encoding=s.gl.outputEncoding}}ho(r)}if(n&&n.parent&&r.raycast&&u!==n.eventCount){const m=Qc(r).getState().internal,g=m.interaction.indexOf(r);g>-1&&m.interaction.splice(g,1),n.eventCount&&m.interaction.push(r)}return!(c.length===1&&c[0][0]==="onUpdate")&&c.length&&(t=r.__r3f)!=null&&t.parent&&Pd(r),r}function ho(r){var e,t;const n=(e=r.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();n&&n.internal.frames===0&&n.invalidate()}function Pd(r){r.onUpdate==null||r.onUpdate(r)}function Db(r,e){r.manual||(fy(r)?(r.left=e.width/-2,r.right=e.width/2,r.top=e.height/2,r.bottom=e.height/-2):r.aspect=e.width/e.height,r.updateProjectionMatrix(),r.updateMatrixWorld())}function Hc(r){return(r.eventObject||r.object).uuid+"/"+r.index+r.instanceId}function Nb(){var r;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return vo.DefaultEventPriority;switch((r=e.event)==null?void 0:r.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return vo.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return vo.ContinuousEventPriority;default:return vo.DefaultEventPriority}}function vy(r,e,t,n){const i=t.get(e);i&&(t.delete(e),t.size===0&&(r.delete(n),i.target.releasePointerCapture(n)))}function Ub(r,e){const{internal:t}=r.getState();t.interaction=t.interaction.filter(n=>n!==e),t.initialHits=t.initialHits.filter(n=>n!==e),t.hovered.forEach((n,i)=>{(n.eventObject===e||n.object===e)&&t.hovered.delete(i)}),t.capturedMap.forEach((n,i)=>{vy(t.capturedMap,e,n,i)})}function Ob(r){function e(u){const{internal:h}=r.getState(),f=u.offsetX-h.initialClick[0],p=u.offsetY-h.initialClick[1];return Math.round(Math.sqrt(f*f+p*p))}function t(u){return u.filter(h=>["Move","Over","Enter","Out","Leave"].some(f=>{var p;return(p=h.__r3f)==null?void 0:p.handlers["onPointer"+f]}))}function n(u,h){const f=r.getState(),p=new Set,m=[],g=h?h(f.internal.interaction):f.internal.interaction;for(let v=0;v<g.length;v++){const w=ca(g[v]);w&&(w.raycaster.camera=void 0)}f.previousRoot||f.events.compute==null||f.events.compute(u,f);function y(v){const w=ca(v);if(!w||!w.events.enabled||w.raycaster.camera===null)return[];if(w.raycaster.camera===void 0){var E;w.events.compute==null||w.events.compute(u,w,(E=w.previousRoot)==null?void 0:E.getState()),w.raycaster.camera===void 0&&(w.raycaster.camera=null)}return w.raycaster.camera?w.raycaster.intersectObject(v,!0):[]}let M=g.flatMap(y).sort((v,w)=>{const E=ca(v.object),A=ca(w.object);return!E||!A?v.distance-w.distance:A.events.priority-E.events.priority||v.distance-w.distance}).filter(v=>{const w=Hc(v);return p.has(w)?!1:(p.add(w),!0)});f.events.filter&&(M=f.events.filter(M,f));for(const v of M){let w=v.object;for(;w;){var x;(x=w.__r3f)!=null&&x.eventCount&&m.push({...v,eventObject:w}),w=w.parent}}if("pointerId"in u&&f.internal.capturedMap.has(u.pointerId))for(let v of f.internal.capturedMap.get(u.pointerId).values())p.has(Hc(v.intersection))||m.push(v.intersection);return m}function i(u,h,f,p){const m=r.getState();if(u.length){const g={stopped:!1};for(const y of u){const M=ca(y.object)||m,{raycaster:x,pointer:v,camera:w,internal:E}=M,A=new U(v.x,v.y,0).unproject(w),N=P=>{var B,Q;return(B=(Q=E.capturedMap.get(P))==null?void 0:Q.has(y.eventObject))!=null?B:!1},R=P=>{const B={intersection:y,target:h.target};E.capturedMap.has(P)?E.capturedMap.get(P).set(y.eventObject,B):E.capturedMap.set(P,new Map([[y.eventObject,B]])),h.target.setPointerCapture(P)},L=P=>{const B=E.capturedMap.get(P);B&&vy(E.capturedMap,y.eventObject,B,P)};let z={};for(let P in h){let B=h[P];typeof B!="function"&&(z[P]=B)}let b={...y,...z,pointer:v,intersections:u,stopped:g.stopped,delta:f,unprojectedPoint:A,ray:x.ray,camera:w,stopPropagation(){const P="pointerId"in h&&E.capturedMap.get(h.pointerId);if((!P||P.has(y.eventObject))&&(b.stopped=g.stopped=!0,E.hovered.size&&Array.from(E.hovered.values()).find(B=>B.eventObject===y.eventObject))){const B=u.slice(0,u.indexOf(y));s([...B,y])}},target:{hasPointerCapture:N,setPointerCapture:R,releasePointerCapture:L},currentTarget:{hasPointerCapture:N,setPointerCapture:R,releasePointerCapture:L},nativeEvent:h};if(p(b),g.stopped===!0)break}}return u}function s(u){const{internal:h}=r.getState();for(const f of h.hovered.values())if(!u.length||!u.find(p=>p.object===f.object&&p.index===f.index&&p.instanceId===f.instanceId)){const m=f.eventObject.__r3f,g=m==null?void 0:m.handlers;if(h.hovered.delete(Hc(f)),m!=null&&m.eventCount){const y={...f,intersections:u};g.onPointerOut==null||g.onPointerOut(y),g.onPointerLeave==null||g.onPointerLeave(y)}}}function l(u,h){for(let f=0;f<h.length;f++){const p=h[f].__r3f;p==null||p.handlers.onPointerMissed==null||p.handlers.onPointerMissed(u)}}function c(u){switch(u){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return h=>{const{internal:f}=r.getState();"pointerId"in h&&f.capturedMap.has(h.pointerId)&&requestAnimationFrame(()=>{f.capturedMap.has(h.pointerId)&&(f.capturedMap.delete(h.pointerId),s([]))})}}return function(f){const{onPointerMissed:p,internal:m}=r.getState();m.lastEvent.current=f;const g=u==="onPointerMove",y=u==="onClick"||u==="onContextMenu"||u==="onDoubleClick",x=n(f,g?t:void 0),v=y?e(f):0;u==="onPointerDown"&&(m.initialClick=[f.offsetX,f.offsetY],m.initialHits=x.map(E=>E.eventObject)),y&&!x.length&&v<=2&&(l(f,m.interaction),p&&p(f)),g&&s(x);function w(E){const A=E.eventObject,N=A.__r3f,R=N==null?void 0:N.handlers;if(N!=null&&N.eventCount)if(g){if(R.onPointerOver||R.onPointerEnter||R.onPointerOut||R.onPointerLeave){const L=Hc(E),z=m.hovered.get(L);z?z.stopped&&E.stopPropagation():(m.hovered.set(L,E),R.onPointerOver==null||R.onPointerOver(E),R.onPointerEnter==null||R.onPointerEnter(E))}R.onPointerMove==null||R.onPointerMove(E)}else{const L=R[u];L?(!y||m.initialHits.includes(A))&&(l(f,m.interaction.filter(z=>!m.initialHits.includes(z))),L(E)):y&&m.initialHits.includes(A)&&l(f,m.interaction.filter(z=>!m.initialHits.includes(z)))}}i(x,f,v,w)}}return{handlePointer:c}}const yy=r=>!!(r!=null&&r.render),xy=ke.createContext(null),Fb=(r,e)=>{const t=vb((c,u)=>{const h=new U,f=new U,p=new U;function m(v=u().camera,w=f,E=u().size){const{width:A,height:N,top:R,left:L}=E,z=A/N;w.isVector3?p.copy(w):p.set(...w);const b=v.getWorldPosition(h).distanceTo(p);if(fy(v))return{width:A/v.zoom,height:N/v.zoom,top:R,left:L,factor:1,distance:b,aspect:z};{const P=v.fov*Math.PI/180,B=2*Math.tan(P/2)*b,Q=B*(A/N);return{width:Q,height:B,top:R,left:L,factor:A/Q,distance:b,aspect:z}}}let g;const y=v=>c(w=>({performance:{...w.performance,current:v}})),M=new fe;return{set:c,get:u,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(v=1)=>r(u(),v),advance:(v,w)=>e(v,w,u()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new gp,pointer:M,mouse:M,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const v=u();g&&clearTimeout(g),v.performance.current!==v.performance.min&&y(v.performance.min),g=setTimeout(()=>y(u().performance.max),v.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:m},setEvents:v=>c(w=>({...w,events:{...w.events,...v}})),setSize:(v,w,E,A,N)=>{const R=u().camera,L={width:v,height:w,top:A||0,left:N||0,updateStyle:E};c(z=>({size:L,viewport:{...z.viewport,...m(R,f,L)}}))},setDpr:v=>c(w=>{const E=gy(v);return{viewport:{...w.viewport,dpr:E,initialDpr:w.viewport.initialDpr||E}}}),setFrameloop:(v="always")=>{const w=u().clock;w.stop(),w.elapsedTime=0,v!=="never"&&(w.start(),w.elapsedTime=0),c(()=>({frameloop:v}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:ke.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(v,w,E)=>{const A=u().internal;return A.priority=A.priority+(w>0?1:0),A.subscribers.push({ref:v,priority:w,store:E}),A.subscribers=A.subscribers.sort((N,R)=>N.priority-R.priority),()=>{const N=u().internal;N!=null&&N.subscribers&&(N.priority=N.priority-(w>0?1:0),N.subscribers=N.subscribers.filter(R=>R.ref!==v))}}}}}),n=t.getState();let i=n.size,s=n.viewport.dpr,l=n.camera;return t.subscribe(()=>{const{camera:c,size:u,viewport:h,gl:f,set:p}=t.getState();if(u.width!==i.width||u.height!==i.height||h.dpr!==s){var m;i=u,s=h.dpr,Db(c,u),f.setPixelRatio(h.dpr);const g=(m=u.updateStyle)!=null?m:typeof HTMLCanvasElement<"u"&&f.domElement instanceof HTMLCanvasElement;f.setSize(u.width,u.height,g)}c!==l&&(l=c,p(g=>({viewport:{...g.viewport,...g.viewport.getCurrentViewport(c)}})))}),t.subscribe(c=>r(c)),t};let Vc,Bb=new Set,zb=new Set,kb=new Set;function Uf(r,e){if(r.size)for(const{callback:t}of r.values())t(e)}function ua(r,e){switch(r){case"before":return Uf(Bb,e);case"after":return Uf(zb,e);case"tail":return Uf(kb,e)}}let Of,Ff;function Bf(r,e,t){let n=e.clock.getDelta();for(e.frameloop==="never"&&typeof r=="number"&&(n=r-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=r),Of=e.internal.subscribers,Vc=0;Vc<Of.length;Vc++)Ff=Of[Vc],Ff.ref.current(Ff.store.getState(),n,t);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}function Hb(r){let e=!1,t=!1,n,i,s;function l(h){i=requestAnimationFrame(l),e=!0,n=0,ua("before",h),t=!0;for(const p of r.values()){var f;s=p.store.getState(),s.internal.active&&(s.frameloop==="always"||s.internal.frames>0)&&!((f=s.gl.xr)!=null&&f.isPresenting)&&(n+=Bf(h,s))}if(t=!1,ua("after",h),n===0)return ua("tail",h),e=!1,cancelAnimationFrame(i)}function c(h,f=1){var p;if(!h)return r.forEach(m=>c(m.store.getState(),f));(p=h.gl.xr)!=null&&p.isPresenting||!h.internal.active||h.frameloop==="never"||(f>1?h.internal.frames=Math.min(60,h.internal.frames+f):t?h.internal.frames=2:h.internal.frames=1,e||(e=!0,requestAnimationFrame(l)))}function u(h,f=!0,p,m){if(f&&ua("before",h),p)Bf(h,p,m);else for(const g of r.values())Bf(h,g.store.getState());f&&ua("after",h)}return{loop:l,invalidate:c,advance:u}}function Vb(){const r=ke.useContext(xy);if(!r)throw new Error("R3F: Hooks can only be used within the Canvas component!");return r}function Gb(r,e=0){const t=Vb(),n=t.getState().internal.subscribe,i=dy(r);return $a(()=>n(i,e,t),[e,n,t]),null}const To=new Map,{invalidate:G0,advance:W0}=Hb(To),{reconciler:su,applyProps:lo}=Cb(To,Nb),co={objects:"shallow",strict:!1},Wb=(r,e)=>{const t=typeof r=="function"?r(e):r;return yy(t)?t:new Qd({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...r})};function Xb(r,e){const t=typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement;if(e){const{width:n,height:i,top:s,left:l,updateStyle:c=t}=e;return{width:n,height:i,top:s,left:l,updateStyle:c}}else if(typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement&&r.parentElement){const{width:n,height:i,top:s,left:l}=r.parentElement.getBoundingClientRect();return{width:n,height:i,top:s,left:l,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas)return{width:r.width,height:r.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function qb(r){const e=To.get(r),t=e==null?void 0:e.fiber,n=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,s=n||Fb(G0,W0),l=t||su.createContainer(s,vo.ConcurrentRoot,null,!1,null,"",i,null);e||To.set(r,{fiber:l,store:s});let c,u=!1,h;return{configure(f={}){let{gl:p,size:m,scene:g,events:y,onCreated:M,shadows:x=!1,linear:v=!1,flat:w=!1,legacy:E=!1,orthographic:A=!1,frameloop:N="always",dpr:R=[1,2],performance:L,raycaster:z,camera:b,onPointerMissed:P}=f,B=s.getState(),Q=B.gl;B.gl||B.set({gl:Q=Wb(p,r)});let ce=B.raycaster;ce||B.set({raycaster:ce=new cy});const{params:V,...J}=z||{};if(Ot.equ(J,ce,co)||lo(ce,{...J}),Ot.equ(V,ce.params,co)||lo(ce,{params:{...ce.params,...V}}),!B.camera||B.camera===h&&!Ot.equ(h,b,co)){h=b;const W=b instanceof Wa,Y=W?b:A?new Za(0,0,0,0,.1,1e3):new vn(75,0,.1,1e3);W||(Y.position.z=5,b&&(lo(Y,b),("aspect"in b||"left"in b||"right"in b||"bottom"in b||"top"in b)&&(Y.manual=!0,Y.updateProjectionMatrix())),!B.camera&&!(b!=null&&b.rotation)&&Y.lookAt(0,0,0)),B.set({camera:Y}),ce.camera=Y}if(!B.scene){let W;g!=null&&g.isScene?W=g:(W=new $d,g&&lo(W,g)),B.set({scene:uo(W)})}if(!B.xr){var ee;const W=(j,ae)=>{const xe=s.getState();xe.frameloop!=="never"&&W0(j,!0,xe,ae)},Y=()=>{const j=s.getState();j.gl.xr.enabled=j.gl.xr.isPresenting,j.gl.xr.setAnimationLoop(j.gl.xr.isPresenting?W:null),j.gl.xr.isPresenting||G0(j)},oe={connect(){const j=s.getState().gl;j.xr.addEventListener("sessionstart",Y),j.xr.addEventListener("sessionend",Y)},disconnect(){const j=s.getState().gl;j.xr.removeEventListener("sessionstart",Y),j.xr.removeEventListener("sessionend",Y)}};typeof((ee=Q.xr)==null?void 0:ee.addEventListener)=="function"&&oe.connect(),B.set({xr:oe})}if(Q.shadowMap){const W=Q.shadowMap.enabled,Y=Q.shadowMap.type;if(Q.shadowMap.enabled=!!x,Ot.boo(x))Q.shadowMap.type=pa;else if(Ot.str(x)){var le;const oe={basic:t_,percentage:au,soft:pa,variance:Mi}
3728;Q.shadowMap.type=(le=oe[x])!=null?le:pa}else Ot.obj(x)&&Object.assign(Q.shadowMap,x);(W!==Q.shadowMap.enabled||Y!==Q.shadowMap.type)&&(Q.shadowMap.needsUpdate=!0)}const F=hy();F&&("enabled"in F?F.enabled=!E:"legacyMode"in F&&(F.legacyMode=E)),u||lo(Q,{outputEncoding:v?3e3:3001,toneMapping:w?zi:Ld}),B.legacy!==E&&B.set(()=>({legacy:E})),B.linear!==v&&B.set(()=>({linear:v})),B.flat!==w&&B.set(()=>({flat:w})),p&&!Ot.fun(p)&&!yy(p)&&!Ot.equ(p,Q,co)&&lo(Q,p),y&&!B.events.handlers&&B.set({events:y(s)});const H=Xb(r,m);return Ot.equ(H,B.size,co)||B.setSize(H.width,H.height,H.updateStyle,H.top,H.left),R&&B.viewport.dpr!==gy(R)&&B.setDpr(R),B.frameloop!==N&&B.setFrameloop(N),B.onPointerMissed||B.set({onPointerMissed:P}),L&&!Ot.equ(L,B.performance,co)&&B.set(W=>({performance:{...W.performance,...L}})),c=M,u=!0,this},render(f){return u||this.configure(),su.updateContainer(zt.jsx(Yb,{store:s,children:f,onCreated:c,rootElement:r}),l,null,()=>{}),s},unmount(){Sy(r)}}}function Yb({store:r,children:e,onCreated:t,rootElement:n}){return $a(()=>{const i=r.getState();i.set(s=>({internal:{...s.internal,active:!0}})),t&&t(i),r.getState().events.connected||i.events.connect==null||i.events.connect(n)},[]),zt.jsx(xy.Provider,{value:r,children:e})}function Sy(r,e){const t=To.get(r),n=t==null?void 0:t.fiber;if(n){const i=t==null?void 0:t.store.getState();i&&(i.internal.active=!1),su.updateContainer(null,n,null,()=>{i&&setTimeout(()=>{try{var s,l,c,u;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(l=s.renderLists)==null||l.dispose==null||l.dispose(),(c=i.gl)==null||c.forceContextLoss==null||c.forceContextLoss(),(u=i.gl)!=null&&u.xr&&i.xr.disconnect(),Ib(i),To.delete(r)}catch{}},500)})}}su.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:ke.version});const zf={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function Zb(r){const{handlePointer:e}=Ob(r);return{priority:1,enabled:!0,compute(t,n,i){n.pointer.set(t.offsetX/n.size.width*2-1,-(t.offsetY/n.size.height)*2+1),n.raycaster.setFromCamera(n.pointer,n.camera)},connected:void 0,handlers:Object.keys(zf).reduce((t,n)=>({...t,[n]:e(n)}),{}),update:()=>{var t;const{events:n,internal:i}=r.getState();(t=i.lastEvent)!=null&&t.current&&n.handlers&&n.handlers.onPointerMove(i.lastEvent.current)},connect:t=>{var n;const{set:i,events:s}=r.getState();s.disconnect==null||s.disconnect(),i(l=>({events:{...l.events,connected:t}})),Object.entries((n=s.handlers)!=null?n:[]).forEach(([l,c])=>{const[u,h]=zf[l];t.addEventListener(u,c,{passive:h})})},disconnect:()=>{const{set:t,events:n}=r.getState();if(n.connected){var i;Object.entries((i=n.handlers)!=null?i:[]).forEach(([s,l])=>{if(n&&n.connected instanceof HTMLElement){const[c]=zf[s];n.connected.removeEventListener(c,l)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}function X0(r,e){let t;return(...n)=>{window.clearTimeout(t),t=window.setTimeout(()=>r(...n),e)}}function Jb({debounce:r,scroll:e,polyfill:t,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){const i=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,l]=ke.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=ke.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),u=r?typeof r=="number"?r:r.scroll:null,h=r?typeof r=="number"?r:r.resize:null,f=ke.useRef(!1);ke.useEffect(()=>(f.current=!0,()=>void(f.current=!1)));const[p,m,g]=ke.useMemo(()=>{const v=()=>{if(!c.current.element)return;const{left:w,top:E,width:A,height:N,bottom:R,right:L,x:z,y:b}=c.current.element.getBoundingClientRect(),P={left:w,top:E,width:A,height:N,bottom:R,right:L,x:z,y:b};
3728c.current.element instanceof HTMLElement&&n&&(P.height=c.current.element.offsetHeight,P.width=c.current.element.offsetWidth),Object.freeze(P),f.current&&!$b(c.current.lastBounds,P)&&l(c.current.lastBounds=P)};return[v,h?X0(v,h):v,u?X0(v,u):v]},[l,n,u,h]);function y(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(v=>v.removeEventListener("scroll",g,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null),c.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",c.current.orientationHandler))}function M(){c.current.element&&(c.current.resizeObserver=new i(g),c.current.resizeObserver.observe(c.current.element),e&&c.current.scrollContainers&&c.current.scrollContainers.forEach(v=>v.addEventListener("scroll",g,{capture:!0,passive:!0})),c.current.orientationHandler=()=>{g()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",c.current.orientationHandler))}const x=v=>{!v||v===c.current.element||(y(),c.current.element=v,c.current.scrollContainers=My(v),M())};return Kb(g,!!e),jb(m),ke.useEffect(()=>{y(),M()},[e,g,m]),ke.useEffect(()=>y,[]),[x,s,p]}function jb(r){ke.useEffect(()=>{const e=r;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[r])}function Kb(r,e){ke.useEffect(()=>{if(e){const t=r;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[r,e])}function My(r){const e=[];if(!r||r===document.body)return e;const{overflow:t,overflowX:n,overflowY:i}=window.getComputedStyle(r);return[t,n,i].some(s=>s==="auto"||s==="scroll")&&e.push(r),[...e,...My(r.parentElement)]}const Qb=["x","y","top","bottom","left","right","width","height"],$b=(r,e)=>Qb.every(t=>r[t]===e[t]);var eC=Object.defineProperty,tC=Object.defineProperties,nC=Object.getOwnPropertyDescriptors,q0=Object.getOwnPropertySymbols,iC=Object.prototype.hasOwnProperty,rC=Object.prototype.propertyIsEnumerable,Y0=(r,e,t)=>e in r?eC(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Z0=(r,e)=>{for(var t in e||(e={}))iC.call(e,t)&&Y0(r,t,e[t]);if(q0)for(var t of q0(e))rC.call(e,t)&&Y0(r,t,e[t]);return r},sC=(r,e)=>tC(r,nC(e)),J0,j0;typeof window<"u"&&((J0=window.document)!=null&&J0.createElement||((j0=window.navigator)==null?void 0:j0.product)==="ReactNative")?ke.useLayoutEffect:ke.useEffect;function Ey(r,e,t){if(!r)return;if(t(r)===!0)return r;let n=r.child;for(;n;){const i=Ey(n,e,t);if(i)return i;n=n.sibling}}function wy(r){try{return Object.defineProperties(r,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return r}}const K0=console.error;console.error=function(){const r=[...arguments].join("");if(r!=null&&r.startsWith("Warning:")&&r.includes("useContext")){console.error=K0;return}return K0.apply(this,arguments)};const Sp=wy(ke.createContext(null));class Ty extends ke.Component{render(){return ke.createElement(Sp.Provider,{value:this._reactInternals},this.props.children)}}function oC(){const r=ke.useContext(Sp);if(r===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=ke.useId();return ke.useMemo(()=>{for(const n of[r,r==null?void 0:r.alternate]){if(!n)continue;const i=Ey(n,!1,s=>{let l=s.memoizedState;for(;l;){if(l.memoizedState===e)return!0;l=l.next}});if(i)return i}},[r,e])}function aC(){const r=oC(),[e]=ke.useState(()=>new Map);e.clear();let t=r;for(;t;){if(t.type&&typeof t.type=="object"){const i=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;i&&i!==Sp&&!e.has(i)&&e.set(i,ke.useContext(wy(i)))}t=t.return}return e}function lC(){const r=aC();return ke.useMemo(()=>Array.from(r.keys()).reduce((e,t)=>
3728n=>ke.createElement(e,null,ke.createElement(t.Provider,sC(Z0({},n),{value:r.get(t)}))),e=>ke.createElement(Ty,Z0({},e))),[r])}const cC=ke.forwardRef(function({children:e,fallback:t,resize:n,style:i,gl:s,events:l=Zb,eventSource:c,eventPrefix:u,shadows:h,linear:f,flat:p,legacy:m,orthographic:g,frameloop:y,dpr:M,performance:x,raycaster:v,camera:w,scene:E,onPointerMissed:A,onCreated:N,...R},L){ke.useMemo(()=>bb(db),[]);const z=lC(),[b,P]=Jb({scroll:!0,debounce:{scroll:50,resize:0},...n}),B=ke.useRef(null),Q=ke.useRef(null);ke.useImperativeHandle(L,()=>B.current);const ce=dy(A),[V,J]=ke.useState(!1),[ee,le]=ke.useState(!1);if(V)throw V;if(ee)throw ee;const F=ke.useRef(null);$a(()=>{const W=B.current;P.width>0&&P.height>0&&W&&(F.current||(F.current=qb(W)),F.current.configure({gl:s,events:l,shadows:h,linear:f,flat:p,legacy:m,orthographic:g,frameloop:y,dpr:M,performance:x,raycaster:v,camera:w,scene:E,size:P,onPointerMissed:(...Y)=>ce.current==null?void 0:ce.current(...Y),onCreated:Y=>{Y.events.connect==null||Y.events.connect(c?Rb(c)?c.current:c:Q.current),u&&Y.setEvents({compute:(oe,j)=>{const ae=oe[u+"X"],xe=oe[u+"Y"];j.pointer.set(ae/j.size.width*2-1,-(xe/j.size.height)*2+1),j.raycaster.setFromCamera(j.pointer,j.camera)}}),N==null||N(Y)}}),F.current.render(zt.jsx(z,{children:zt.jsx(py,{set:le,children:zt.jsx(ke.Suspense,{fallback:zt.jsx(Pb,{set:J}),children:e??null})})})))}),ke.useEffect(()=>{const W=B.current;if(W)return()=>Sy(W)},[]);const H=c?"none":"auto";return zt.jsx("div",{ref:Q,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:H,...i},...R,children:zt.jsx("div",{ref:b,style:{width:"100%",height:"100%"},children:zt.jsx("canvas",{ref:B,style:{display:"block"},children:t})})})}),uC=ke.forwardRef(function(e,t){return zt.jsx(Ty,{children:zt.jsx(cC,{...e,ref:t})})}),hC=()=>{try{const r=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(r.getContext("webgl")||r.getContext("experimental-webgl")))}catch{return!1}}
3728,Si=20,Kt=8,Qt=5,Pr=16,fa=8,da=5,Ay=.55,Gc=Kt*Ay,Wc=Qt*Ay,Lr=Si/Pr,fC=Pr*4+(fa+1)*2+(da+1)*2+4,dC=6,pC=fC*Pr*dC;function Q0(r,e){let t=0;const n=(s,l,c,u,h,f)=>{r[t++]=s,r[t++]=l,r[t++]=c,r[t++]=u,r[t++]=h,r[t++]=f};for(let s=1;s<=Pr;s++){const l=(s*Lr+e)%Si;if(l<.5)continue;const c=1-l/Si*.92;n(-Kt*c,-Qt*c,-l,Kt*c,-Qt*c,-l),n(-Kt*c,Qt*c,-l,Kt*c,Qt*c,-l),n(-Kt*c,-Qt*c,-l,-Kt*c,Qt*c,-l),n(Kt*c,-Qt*c,-l,Kt*c,Qt*c,-l)}for(let s=0;s<=fa;s++){const l=-Kt+s*(Kt*2)/fa;let c=0,u=0,h=0,f=!1;for(let p=1;p<=Pr;p++){const m=(p*Lr+e)%Si;if(m<.5){f=!1;continue}const g=1-m/Si*.92;f&&n(c*h,-Qt*h,-u,l*g,-Qt*g,-m),c=l,u=m,h=g,f=!0}}for(let s=0;s<=fa;s++){const l=-Kt+s*(Kt*2)/fa;let c=0,u=0,h=0,f=!1;for(let p=1;p<=Pr;p++){const m=(p*Lr+e)%Si;if(m<.5){f=!1;continue}const g=1-m/Si*.92;f&&n(c*h,Qt*h,-u,l*g,Qt*g,-m),c=l,u=m,h=g,f=!0}}for(let s=0;s<=da;s++){const l=-Qt+s*(Qt*2)/da;let c=0,u=0,h=0,f=!1;for(let p=1;p<=Pr;p++){const m=(p*Lr+e)%Si;if(m<.5){f=!1;continue}const g=1-m/Si*.92;f&&n(-Kt*h,c*h,-u,-Kt*g,l*g,-m),c=l,u=m,h=g,f=!0}}for(let s=0;s<=da;s++){const l=-Qt+s*(Qt*2)/da;let c=0,u=0,h=0,f=!1;for(let p=1;p<=Pr;p++){const m=(p*Lr+e)%Si;if(m<.5){f=!1;continue}const g=1-m/Si*.92;f&&n(Kt*h,c*h,-u,Kt*g,l*g,-m),c=l,u=m,h=g,f=!0}}const i=[[-Kt,-Qt,-Gc,-Wc],[Kt,-Qt,Gc,-Wc],[-Kt,Qt,-Gc,Wc],[Kt,Qt,Gc,Wc]];for(const[s,l,c,u]of i)n(s,l,0,c,u,0);return t}const mC=()=>{const r=ke.useRef(null),e=ke.useRef(null),{geometry:t,positionBuf:n}=ke.useMemo(()=>{const i=new Float32Array(pC),s=Q0(i,0),l=new dt;return l.setAttribute("position",new bt(i.slice(0,s),3)),{geometry:l,positionBuf:i}},[]);return ke.useEffect(()=>()=>t.dispose(),[t]),Gb(i=>{r.current&&(r.current.rotation.z=Math.sin(i.clock.elapsedTime*.15)*.005);const l=(i.clock.elapsedTime*-.8%Lr+Lr)%Lr,c=Q0(n,l),u=t.getAttribute("position");u.array!==n||u.count!==c/3?t.setAttribute("position",new bt(n.slice(0,c),3)):u.needsUpdate=!0,t.setDrawRange(0,c/3)}),zt.jsx("group",{ref:r,children:zt.jsx("lineSegments",{ref:e,geometry:t,children:zt.jsx("lineBasicMaterial",{color:"#6b7280",transparent:!0,opacity:.3})})})},gC=()=>zt.jsx("div",{className:"absolute inset-0 z-0 overflow-hidden flex items-center justify-center",children:zt.jsx("div",{className:"relative w-full h-full max-w-7xl flex items-center justify-center",children:zt.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-20",children:zt.jsx("div",{className:"w-[80%] h-[80%] border border-muted-foreground/30",style:{perspective:"1000px",transformStyle:"preserve-3d"},children:[...Array(8)].map((r,e)=>zt.jsx("div",{className:"absolute border border-muted-foreground/20",style:{inset:`${e*8}%`,transform:`translateZ(${-e*50}px)`}},e))})})})}),vC=()=>{const[r,e]=ke.useState(null),t=ke.useRef(null);return ke.useEffect(()=>{e(hC())},[]),ke.useEffect(()=>{var s;const n=(s=t.current)==null?void 0:s.domElement;if(!n)return;const i=l=>{l.preventDefault(),console.warn("WebGL context lost")};return n.addEventListener("webglcontextlost",i),()=>{n.removeEventListener("webglcontextlost",i)}}),r===null?null:r?zt.jsx("div",{className:"absolute inset-0 z-0 overflow-hidden flex items-center justify-center",children:zt.jsx("div",{className:"max-w-7xl w-full h-full",children:zt.jsx(uC,{camera:{position:[0,0,8],fov:50},gl:{antialias:!0,alpha:!0},style:{background:"transparent"},onCreated:({gl:n})=>{t.current=n},children:zt.jsx(mC,{})})})}):zt.jsx(gC,{})};export{vC 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.