1import{r as R,s as Ou,o as SS,a as kd,R as $p,b as U,t as MS,_ as No}from"./index.23d4ff98.js";import{i as ES,a as TS}from"./borderless.e8e9e031.js";/** 2 * @license 3 * Copyright 2010-2022 Three.js Authors 4 * SPDX-License-Identifier: MIT 5 */const of="137",AS={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},RS={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Lx=0,Nh=1,Ix=2,CS=3,PS=0,jp=1,qp=2,Co=3,Es=0,Zt=1,Ts=2,Xp=1,LS=2,si=0,Oo=1,kh=2,Uh=3,Hh=4,Dx=5,ps=100,Ox=101,Fx=102,Gh=103,Vh=104,Bx=200,zx=201,Nx=202,kx=203,Yp=204,Jp=205,Ux=206,Hx=207,Gx=208,Vx=209,Wx=210,$x=0,jx=1,qx=2,Gu=3,Xx=4,Yx=5,Jx=6,Zx=7,Pl=0,Kx=1,Qx=2,Fr=0,e_=1,t_=2,n_=3,Zp=4,r_=5,af=300,$i=301,Bs=302,ko=303,ul=304,ra=306,Ll=307,fl=1e3,bn=1001,dl=1002,Kt=1003,Vu=1004,IS=1004,Wu=1005,DS=1005,Pt=1006,Kp=1007,OS=1007,zs=1008,FS=1008,oi=1009,i_=1010,s_=1011,Uo=1012,o_=1013,rl=1014,Yn=1015,fr=1016,a_=1017,l_=1018,xs=1020,c_=1021,u_=1022,wn=1023,f_=1024,d_=1025,Ni=1026,As=1027,h_=1028,p_=1029,m_=1030,g_=1031,y_=1033,Fu=33776,Bu=33777,zu=33778,Nu=33779,Wh=35840,$h=35841,jh=35842,qh=35843,v_=36196,Xh=37492,Yh=37496,Jh=37808,Zh=37809,Kh=37810,Qh=37811,ep=37812,tp=37813,np=37814,rp=37815,ip=37816,sp=37817,op=37818,ap=37819,lp=37820,cp=37821,up=36492,x_=2200,__=2201,b_=2202,hl=2300,pl=2301,ku=2302,ms=2400,gs=2401,ml=2402,lf=2500,Qp=2501,w_=0,BS=1,zS=2,Kn=3e3,Rt=3001,S_=3200,M_=3201,Ns=0,E_=1,NS=0,Uu=7680,kS=7681,US=7682,HS=7683,GS=34055,VS=34056,WS=5386,$S=512,jS=513,qS=514,XS=515,YS=516,JS=517,ZS=518,T_=519,Ho=35044,Go=35048,KS=35040,QS=35045,eM=35049,tM=35041,nM=35046,rM=35050,iM=35042,sM="100",fp="300 es",$u=1035;class ji{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,o=i.length;s<o;s++)i[s].call(this,e);e.target=null}}}const xn=[];for(let r=0;r<256;r++)xn[r]=(r<16?"0":"")+r.toString(16);let kc=1234567;const _s=Math.PI/180,gl=180/Math.PI;function Jn(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(xn[r&255]+xn[r>>8&255]+xn[r>>16&255]+xn[r>>24&255]+"-"+xn[e&255]+xn[e>>8&255]+"-"+xn[e>>16&15|64]+xn[e>>24&255]+"-"+xn[t&63|128]+xn[t>>8&255]+"-"+xn[t>>16&255]+xn[t>>24&255]+xn[n&255]+xn[n>>8&255]+xn[n>>16&255]+xn[n>>24&255]).toUpperCase()}function _n(r,e,t){return Math.max(e,Math.min(t,r))}function em(r,e){return(r%e+e)%e}function oM(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function aM(r,e,t){return r!==e?(t-r)/(e-r):0}function il(r,e,t){return(1-t)*r+t*e}function lM(r,e,t,n){return il(r,e,1-Math.exp(-t*n))}function cM(r,e=1){return e-Math.abs(em(r,e*2)-e)}function uM(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function fM(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function dM(r,e){return r+Math.floor(Math.random()*(e-r+1))}function hM(r,e){return r+Math.random()*(e-r)}function pM(r){return r*(.5-Math.random())}function mM(r){return r!==void 0&&(kc=r%2147483647),kc=kc*16807%2147483647,(kc-1)/2147483646}function gM(r){return r*_s}function yM(r){return r*gl}function dp(r){return(r&r-1)===0&&r!==0}function A_(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function R_(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function vM(r,e,t,n,i){const s=Math.cos,o=Math.sin,a=s(t/2),u=o(t/2),f=s((e+n)/2),p=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),g=s((n-e)/2),y=o((n-e)/2);switch(i){case"XYX":r.set(a*p,u*h,u*d,a*f);break;case"YZY":r.set(u*d,a*p,u*h,a*f);break;case"ZXZ":r.set(u*h,u*d,a*p,a*f);break;case"XZX":r.set(a*p,u*y,u*g,a*f);break;case"YXY":r.set(u*g,a*p,u*y,a*f);break;case"ZYZ":r.set(u*y,u*g,a*p,a*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var R0=Object.freeze({__proto__:null,DEG2RAD:_s,RAD2DEG:gl,generateUUID:Jn,clamp:_n,euclideanModulo:em,mapLinear:oM,inverseLerp:aM,lerp:il,damp:lM,pingpong:cM,smoothstep:uM,smootherstep:fM,randInt:dM,randFloat:h
vendor: 5,562 bytes, line 5
5M,randFloatSpread:pM,seededRandom:mM,degToRad:gM,radToDeg:yM,isPowerOfTwo:dp,ceilPowerOfTwo:A_,floorPowerOfTwo:R_,setQuaternionFromProperEuler:vM});class de{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){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,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),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,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}de.prototype.isVector2=!0;class un{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,u,f){const p=this.elements;return p[0]=e,p[1]=i,p[2]=a,p[3]=t,p[4]=s,p[5]=u,p[6]=n,p[7]=o,p[8]=f,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,o=n[0],a=n[3],u=n[6],f=n[1],p=n[4],h=n[7],d=n[2],g=n[5],y=n[8],_=i[0],w=i[3],x=i[6],v=i[1],E=i[4],M=i[7],A=i[2],C=i[5],L=i[8];return s[0]=o*_+a*v+u*A,s[3]=o*w+a*E+u*C,s[6]=o*x+a*M+u*L,s[1]=f*_+p*v+h*A,s[4]=f*w+p*E+h*C,s[7]=f*x+p*M+h*L,s[2]=d*_+g*v+y*A,s[5]=d*w+g*E+y*C,s[8]=d*x+g*M+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],o=e[4],a=e[5],u=e[6],f=e[7],p=e[8];return t*o*p-t*a*f-n*s*p+n*a*u+i*s*f-i*o*u}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],u=e[6],f=e[7],p=e[8],h=p*o-a*f,d=a*u-p*s,g=f*s-o*u,y=t*h+n*d+i*g;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/y;
5return e[0]=h*_,e[1]=(i*f-p*n)*_,e[2]=(a*n-i*o)*_,e[3]=d*_,e[4]=(p*t-i*u)*_,e[5]=(i*s-a*t)*_,e[6]=g*_,e[7]=(n*u-f*t)*_,e[8]=(o*t-n*s)*_,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,o,a){const u=Math.cos(s),f=Math.sin(s);return this.set(n*u,n*f,-n*(u*o+f*a)+o+e,-i*f,i*u,-i*(-f*o+u*a)+a+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],u=i[1],f=i[4],p=i[7];return i[0]=t*s+n*u,i[3]=t*o+n*f,i[6]=t*a+n*p,i[1]=-n*s+t*u,i[4]=-n*o+t*f,i[7]=-n*a+t*p,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],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)}}un.prototype.isMatrix3=!0;function C_(r){for(let e=r.length-1;e>=0;--e)if(r[e]>65535)return!0;return!1}const xM={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Po(r,e){return new xM[r](e)}function yl(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}const P_={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},yr={h:0,s:0,l:0},Uc={h:0,s:0,l:0};function Ud(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}function Fo(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}
5function Hd(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}class Ae{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=em(e,1),t=_n(t,0,1),n=_n(n,0,1),t===0)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=Ud(s,i,e+1/3),this.g=Ud(s,i,e),this.b=Ud(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i;const s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const a=parseFloat(i[1])/360,u=parseInt(i[2],10)/100,f=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,u,f)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=P_[e.toLowerCase()];return t!==void 0?this.setHex(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=Fo(e.r),this.g=Fo(e.g),this.b=Fo(e.b),this}copyLinearToSRGB(e){return this.r=Hd(e.r),this.g=Hd(e.g),this.b=Hd(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){const t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i);let a,u;const f=(o+s)/2;if(o===s)a=0,u=0;else{const p=s-o;switch(u=f<=.5?p/(s+o):p/(2-s-o),s){case t:a=(n-i)/p+(n<i?6:0);break;case n:a=(i-t)/p+2;break;case i:a=(t-n)/p+4;break}a/=6}return e.h=a,e.s=u,e.l=f,e}getStyle(){return"rgb("+(this.r*255|0)+","+(this.g*255|0)+","+(this.b*255|0)+")"}offsetHSL(e,t,n){return this.getHSL(yr),yr.h+=e,yr.s+=t,yr.l+=n,this.setHSL(yr.h,yr.s,yr.l),this}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(yr),e.getHSL(Uc);const n=il(yr.h,Uc.h,t),i=il(yr.s,Uc.s,t),s=il(yr.l,Uc.l,t);return this.setHSL(n,i,s),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),e.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}Ae.NAMES=P_;Ae.prototype.isColor=!0;Ae.prototype.r=1;Ae.prototype.g=1;Ae.prototype.b=1;let io;class qi{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{io===void 0&&(io=yl("canvas")),io.width=e.width,io.height=e.height;const n=io.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=io}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!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap){const t=yl("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 o=0;o<s.length;o++)s[o]=Fo(s[o]/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(Fo(t[n]/255)*255):t[n]=Fo(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 _M=0;class nn extends ji{constructor(e=nn.DEFAULT_IMAGE,t=nn.DEFAULT_MAPPING,n=bn,i=bn,s=Pt,o=zs,a=wn,u=oi,f=1,p=Kn){super(),Object.defineProperty(this,"id",{value:_M++}),this.uuid=Jn(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=f,this.format=a,this.internalFormat=null,this.type=u,this.offset=new de(0,0),this.repeat=new de(1,1),this.center=new de(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new un,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=p,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}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.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,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.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),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.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.t
5ype,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){const i=this.image;if(i.uuid===void 0&&(i.uuid=Jn()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o<a;o++)i[o].isDataTexture?s.push(Gd(i[o].image)):s.push(Gd(i[o]))}else s=Gd(i);e.images[i.uuid]={uuid:i.uuid,url:s}}n.image=i.uuid}return JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==af)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case fl:e.x=e.x-Math.floor(e.x);break;case bn:e.x=e.x<0?0:1;break;case dl: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 fl:e.y=e.y-Math.floor(e.y);break;case bn:e.y=e.y<0?0:1;break;case dl: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++}}nn.DEFAULT_IMAGE=void 0;nn.DEFAULT_MAPPING=af;nn.prototype.isTexture=!0;function Gd(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?qi.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}class Mt{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("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,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(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,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(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,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[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,f=u[0],p=u[4],h=u[8],d=u[1],g=u[5],y=u[9],_=u[2],w=u[6],x=u[10];if(Math.abs(p-d)<.01&&Math.abs(h-_)<.01&&Math.abs(y-w)<.01){if(Math.abs(p+d)<.1&&Math.abs(h+_)<.1&&Math.abs(y+w)<.1&&Math.abs(f+g+x-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const E=(f+1)/2,M=(g+1)/2,A=(x+1)/2,C=(p+d)/4,L=(h+_)/4,D=(y+w)/4;return E>M&&E>A?E<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(E),i=C/n,s=L/n):M>A?M<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(M),n=C/i,s=D/i):A<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(A),n=L/s,i=D/s),this.set(n,i,s,t),this}let v=Math.sqrt((w-y)*(w-y)+(h-_)*(h-_)+(d-p)*(d-p));return Math.abs(v)<.001&&(v=1),this.x=(w-y)/v,this.y=(h-_)/v,this.z=(d-p)/v,this.w=Math.acos((f+g+x-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}
vendor: 12,096 bytes, line 5
5round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(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,n){return n!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),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}}Mt.prototype.isVector4=!0;class Zn extends ji{constructor(e,t,n={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new Mt(0,0,e,t),this.scissorTest=!1,this.viewport=new Mt(0,0,e,t),this.texture=new nn(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.internalFormat=n.internalFormat!==void 0?n.internalFormat:null,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Pt,this.depthBuffer=n.depthBuffer!==void 0?n.depthBuffer:!0,this.stencilBuffer=n.stencilBuffer!==void 0?n.stencilBuffer:!1,this.depthTexture=n.depthTexture!==void 0?n.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}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){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image=Object.assign({},e.texture.image),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}Zn.prototype.isWebGLRenderTarget=!0;class L_ extends Zn{constructor(e,t,n){super(e,t);const i=this.texture;this.texture=[];for(let s=0;s<n;s++)this.texture[s]=i.clone()}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()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this.texture.length=0;for(let t=0,n=e.texture.length;t<n;t++)this.texture[t]=e.texture[t].clone();return this}}L_.prototype.isWebGLMultipleRenderTargets=!0;class cf extends Zn{constructor(e,t,n={}){super(e,t,n),this.samples=4,this.ignoreDepthForMultisampleCopy=n.ignoreDepth!==void 0?n.ignoreDepth:!0,this.useRenderToTexture=n.useRenderToTexture!==void 0?n.useRenderToTexture:!1,this.useRenderbuffer=this.useRenderToTexture===!1}copy(e){return super.copy.call(this,e),this.samples=e.samples,this.useRenderToTexture=e.useRenderToTexture,this.useRenderbuffer=e.useRenderbuffer,this}}cf.prototype.isWebGLMultisampleRenderTarget=!0;class Sn{constructor(e=0,t=0,n=0,i=1){this._x=e,this._y=t,this._z=n,this._w=i}static slerp(e,t,n,i){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(e,t,i)}static slerpFlat(e,t,n,i,s,o,a){let u=n[i+0],f=n[i+1],p=n[i+2],h=n[i+3];const d=s[o+0],g=s[o+1],y=s[o+2],_=s[o+3];if(a===0){e[t+0]=u,e[t+1]=f,e[t+2]=p,e[t+3]=h;return}if(a===1){e[t+0]=d,e[t+1]=g,e[t+2]=y,e[t+3]=_;return}if(h!==_||u!==d||f!==g||p!==y){let w=1-a;const x=u*d+f*g+p*y+h*_,v=x>=0?1:-1,E=1-x*x;if(E>Number.EPSILON){const A=Math.sqrt(E),C=Math.atan2(A,x*v);w=Math.sin(w*C)/A,a=Math.sin(a*C)/A}const M=a*v;if(u=u*w+d*M,f=f*w+g*M,p=p*w+y*M,h=h*w+_*M,w===1-a){const A=1/Math.sqrt(u*u+f*f+p*p+h*h);u*=A,f*=A,p*=A,h*=A}}e[t]=u,e[t+1]=f,e[t+2]=p,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){const a=n[i],u=n[i+1],f=n[i+2],p=n[i+3],h=s[o],d=s[o+1],g=s[o+2],y=s[o+3];return e[t]=a*y+p*h+u*g-f*d,e[t+1]=u*y+p*d+f*h-a*g,e[t+2]=f*y+p*g+a*d-u*h,e[t+3]=p*y-a*h-u*d-f*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){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,u=Math.sin,f=a(n/2),p=a(i/2),h=a(s/2),d=u(n/2),g=u(i/2),y=u(s/2);switch(o){case"XYZ":this._x=d*p*h+f*g*y,this._y=f*g*h-d*p*y,this._z=f*p*y+d*g*h,this._w=f*p*h-d*g*y;break;case"YXZ":this._x=d*p*h+f*g*y,this._y=f*g*h-d*p*y,this._z=f*p*y-d*g*h,this._w=f*p*h+d*g*y;break;case"ZXY":this._x=d*p*h-f*g*y,this._y=f*g*h+d*p*y,this._z=f*p*y+d*g*h,this._w=f*p*h-d*g*y;break;case"ZYX":this._x=d*p*h-f*g*y,this._y=f*g*h+d*p*y,this._z=f*p*y-d*g*h,this._w=f*p*h+d*g*y;break;case"YZX":this._x=d*p*h+f*g*y,this._y=f*g*h+d*p*y,this._z=f*p*y-d*g*h,this._w=f*p*h-d*g*y;break;case"XZY":this._x=d*p*h-f*g*y,this._y=f*g*h-d*p*y,this._z=f*p*y+d*g*h,this._w=f*p*h+d*g*y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&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],o=t[1],a=t[5],u=t[9],f=t[2],p=t[6],h=t[10],d=n+a+h;if(d>0){const g=.5/Math.sqrt(d+1);this._w=.25/g,this._x=(p-u)*g,this._y=(s-f)*g,this._z=(o-i)*g}else if(n>a&&n>h){const g=2*Math.sqrt(1+n-a-h);this._w=(p-u)/g,this._x=.25*g,this._y=(i+o)/g,this._z=(s+f)/g}else if(a>h){const g=2*Math.sqrt(1+a-n-h);this._w=(s-f)/g,this._x=(i+o)/g,this._y=.25*g,this._z=(u+p)/g}else{const g=2*Math.sqrt(1+h-n-a);this._w=(o-i)/g,this._x=(s+f)/g,this._y=(u+p)/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(_n(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,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,u=t._y,f=t._z,p=t._w;return this._x=n*p+o*a+i*f-s*u,this._y=i*p+o*u+s*a-n*f,this._z=s*p+o*f+n*u-i*a,this._w=o*p-n*a-i*u-s*f,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,o=this._w;let a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;const u=1-a*a;if(u<=Number.EPSILON){const g=1-t;return this._w=g*o+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._onChangeCallback(),this}const f=Math.sqrt(u),p=Math.atan2(f,a),h=Math.sin((1-t)*p)/f,d=Math.sin(t*p)/f;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,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}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}Sn.prototype.isQuaternion=!0;class F{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.
vendor: 23,964 bytes, line 5
5y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(C0.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(C0.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,o=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])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,u=e.w,f=u*t+o*i-a*n,p=u*n+a*t-s*i,h=u*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=f*u+d*-s+p*-a-h*-o,this.y=p*u+d*-o+h*-s-f*-a,this.z=h*u+d*-a+f*-o-p*-s,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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,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,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,u=t.z;return this.x=i*u-s*a,this.y=s*o-n*u,this.z=n*a-i*o,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 Vd.copy(this).projectOnVector(e),this.sub(Vd)}reflect(e){return this.sub(Vd.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(_n(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)}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,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),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}}F.prototype.isVector3=!0;const Vd=new F,C0=new Sn;class er{constructor(e=new F(1/0,1/0,1/0),t=new F(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let u=0,f=e.length;u<f;u+=3){const p=e[u],h=e[u+1],d=e[u+2];p<t&&(t=p),h<n&&(n=h),d<i&&(i=d),p>s&&(s=p),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let u=0,f=e.count;u<f;u++){const p=e.getX(u),h=e.getY(u),d=e.getZ(u);p<t&&(t=p),h<n&&(n=h),d<i&&(i=d),p>s&&(s=p),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),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=is.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)if(t&&n.attributes!=null&&n.attributes.position!==void 0){const s=n.attributes.position;for(let o=0,a=s.count;o<a;o++)is.fromBufferAttribute(s,o).applyMatrix4(e.matrixWorld),this.expandByPoint(is)}else n.boundingBox===null&&n.computeBoundingBox(),Wd.copy(n.boundingBox),Wd.applyMatrix4(e.matrixWorld),this.union(Wd);const i=e.children;for(let s=0,o=i.length;s<o;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,is),is.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(ka),Hc.subVectors(this.max,ka),so.subVectors(e.a,ka),oo.subVectors(e.b,ka),ao.subVectors(e.c,ka),Ai.subVectors(oo,so),Ri.subVectors(ao,oo),ss.subVectors(so,ao);let t=[0,-Ai.z,Ai.y,0,-Ri.z,Ri.y,0,-ss.z,ss.y,Ai.z,0,-Ai.x,Ri.z,0,-Ri.x,ss.z,0,-ss.x,-Ai.y,Ai.x,0,-Ri.y,Ri.x,0,-ss.y,ss.x,0];return!$d(t,so,oo,ao,Hc)||(t=[1,0,0,0,1,0,0,0,1],!$d(t,so,oo,ao,Hc))?!1:(Gc.crossVectors(Ai,Ri),t=[Gc.x,Gc.y,Gc.z],$d(t,so,oo,ao,Hc))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return is.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(is).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:(Jr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Jr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Jr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Jr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Jr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Jr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Jr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Jr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Jr),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)}}er.prototype.isBox3=!0;const Jr=[new F,new F,new F,new F,new F,new F,new F,new F],is=new F,Wd=new er,so=new F,oo=new F,ao=new F,Ai=new F,Ri=new F,ss=new F,ka=new F,Hc=new F,Gc=new F,os=new F;function $d(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){os.fromArray(r,s);const a=i.x*Math.abs(os.x)+i.y*Math.abs(os.y)+i.z*Math.abs(os.z),u=e.dot(os),f=t.dot(os),p=n.dot(os);if(Math.max(-Math.max(u,f,p),Math.min(u,f,p))>a)return!1}return!0}const bM=new er,P0=new F,Vc=new F,jd=new F;class Xi{constructor(e=new F,t=-1){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):bM.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;s<o;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){jd.subVectors(e,this.center);const t=jd.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(jd.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return this.center.equals(e.center)===!0?Vc.set(0,0,1).multiplyScalar(e.radius):Vc.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(P0.copy(e.center).add(Vc)),this.expandByPoint(P0.copy(e.center).sub(Vc)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Zr=new F,qd=new F,Wc=new F,Ci=new F,Xd=new F,$c=new F,Yd=new F;class Yi{constructor(e=new F,t=new F(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Zr)),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.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Zr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Zr.copy(this.direction).multiplyScalar(t).add(this.origin),Zr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){qd.copy(e).add(t).multiplyScalar(.5),Wc.copy(t).sub(e).normalize(),Ci.copy(this.origin).sub(qd);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Wc),a=Ci.dot(this.direction),u=-Ci.dot(Wc),f=Ci.lengthSq(),p=Math.abs(1-o*o);let h,d,g,y;if(p>0)if(h=o*u-a,d=o*a-u,y=s*p,h>=0)if(d>=-y)if(d<=y){const _=1/p;h*=_,d*=_,g=h*(h+o*d+2*a)+d*(o*h+d+2*u)+f}else d=s,h=Math.max(0,-(o*d+a)),g=-h*h+d*(d+2*u)+f;else d=-s,h=Math.max(0,-(o*d+a)),g=-h*h+d*(d+2*u)+f;else d<=-y?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-u),s),g=-h*h+d*(d+2*u)+f):d<=y?(h=0,d=Math.min(Math.max(-s,-u),s),g=d*(d+2*u)+f):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-u),s),g=-h*h+d*(d+2*u)+f);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),g=-h*h+d*(d+2*u)+f;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Wc).multiplyScalar(d).add(qd),g}intersectSphere(e,t){Zr.subVectors(e.center,this.origin);const n=Zr.dot(this.direction),i=Zr.dot(Zr)-n*n,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),a=n-o,u=n+o;return a<0&&u<0?null:a<0?this.at(u,t):this.at(a,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,o,a,u;const f=1/this.direction.x,p=1/this.direction.y,h=1/this.direction.z,d=this.origin;return f>=0?(n=(e.min.x-d.x)*f,i=(e.max.x-d.x)*f):(n=(e.max.x-d.x)*f,i=(e.min.x-d.x)*f),p>=0?(s=(e.min.y-d.y)*p,o=(e.max.y-d.y)*p):(s=(e.max.y-d.y)*p,o=(e.min.y-d.y)*p),n>o||s>i||((s>n||n!==n)&&(n=s),(o<i||i!==i)&&(i=o),h>=0?(a=(e.min.z-d.z)*h,u=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,u=(e.min.z-d.z)*h),n>u||a>i)||((a>n||n!==n)&&(n=a),(u<i||i!==i)&&(i=u),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Zr)!==null}intersectTriangle(e,t,n,i,s){Xd.subVectors(t,e),$c.subVectors(n,e),Yd.crossVectors(Xd,$c);let o=this.direction.dot(Yd),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Ci.subVectors(this.origin,e);const u=a*this.direction.dot($c.crossVectors(Ci,$c));if(u<0)return null;const f=a*this.direction.dot(Xd.cross(Ci));if(f<0||u+f>o)return null;const p=-a*Ci.dot(Yd);return p<0?null:this.at(p/o,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 ke{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,u,f,p,h,d,g,y,_,w){const x=this.elements;return x[0]=e,x[4]=t,x[8]=n,x[12]=i,x[1]=s,x[5]=o,x[9]=a,x[13]=u,x[2]=f,x[6]=p,x[10]=h,x[14]=d,x[3]=g,x[7]=y,x[11]=_,x[15]=w,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 ke().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/lo.setFromMatrixColumn(e,0).length(),s=1/lo.setFromMatrixColumn(e,1).length(),o=1/lo.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]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),u=Math.cos(i),f=Math.sin(i),p=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const d=o*p,g=o*h,y=a*p,_=a*h;t[0]=u*p,t[4]=-u*h,t[8]=f,t[1]=g+y*f,t[5]=d-_*f,t[9]=-a*u,t[2]=_-d*f,t[6]=y+g*f,t[10]=o*u}else if(e.order==="YXZ"){const d=u*p,g=u*h,y=f*p,_=f*h;t[0]=d+_*a,t[4]=y*a-g,t[8]=o*f,t[1]=o*h,t[5]=o*p,t[9]=-a,t[2]=g*a-y,t[6]=_+d*a,t[10]=o*u}else if(e.order==="ZXY"){const d=u*p,g=u*h,y=f*p,_=f*h;t[0]=d-_*a,t[4]=-o*h,t[8]=y+g*a,t[1]=g+y*a,t[5]=o*p,t[9]=_-d*a,t[2]=-o*f,t[6]=a,t[10]=o*u}else if(e.order==="ZYX"){const d=o*p,g=o*h,y=a*p,_=a*h;t[0]=u*p,t[4]=y*f-g,t[8]=d*f+_,t[1]=u*h,t[5]=_*f+d,t[9]=g*f-y,t[2]=-f,t[6]=a*u,t[10]=o*u}else if(e.order==="YZX"){const d=o*u,g=o*f,y=a*u,_=a*f;t[0]=u*p,t[4]=_-d*h,t[8]=y*h+g,t[1]=h,t[5]=o*p,t[9]=-a*p,t[2]=-f*p,t[6]=g*h+y,t[10]=d-_*h}else if(e.order==="XZY"){const d=o*u,g=o*f,y=a*u,_=a*f;t[0]=u*p,t[4]=-h,t[8]=f*p,t[1]=d*h+_,t[5]=o*p,t[9]=g*h-y,t[2]=y*h-g,t[6]=a*p,t[10]=_*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(wM,e,SM)}lookAt(e,t,n){const i=this.elements;return qn.subVectors(e,t),qn.lengthSq()===0&&(qn.z=1),qn.normalize(),Pi.crossVectors(n,qn),Pi.lengthSq()===0&&(Math.abs(n.z)===1?qn.x+=1e-4:qn.z+=1e-4,qn.normalize(),Pi.crossVectors(n,qn)),Pi.normalize(),jc.crossVectors(qn,Pi),i[0]=Pi.x,i[4]=jc.x,i[8]=qn.x,i[1]=Pi.y,i[5]=jc.y,i[9]=qn.y,i[2]=Pi.z,i[6]=jc.z,i[10]=qn.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],u=n[8],f=n[12],p=n[1],h=n[5],d=n[9],g=n[13],y=n[2],_=n[6],w=n[10],x=n[14],v=n[3],E=n[7],M=n[11],A=n[15],C=i[0],L=i[4],D=i[8],k=i[12],B=i[1],T=i[5],O=i[9],H=i[13],W=i[2],V=i[6],j=i[10],Z=i[14],ne=i[3],ge=i[7],Y=i[11],ee=i[15];return s[0]=o*C+a*B+u*W+f*ne,s[4]=o*L+a*T+u*V+f*ge,s[8]=o*D+a*O+u*j+f*Y,s[12]=o*k+a*H+u*Z+f*ee,s[1]=p*C+h*B+d*W+g*ne,s[5]=p*L+h*T+d*V+g*ge,s[9]=p*D+h*O+d*j+g*Y,s[13]=p*k+h*H+d*Z+g*ee,s[2]=y*C+_*B+w*W+x*ne,s[6]=y*L+_*T+w*V+x*ge,s[10]=y*D+_*O+w*j+x*Y,s[14]=y*k+_*H+w*Z+x*ee,s[3]=v*C+E*B+M*W+A*ne,s[7]=v*L+E*T+M*V+A*ge,s[11]=v*D+E*O+M*j+A*Y,s[15]=v*k+E*H+M*Z+A*ee,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],o=e[1],a=e[5],u=e[9],f=e[13],p=e[2],h=e[6],d=e[10],g=e[14],y=e[3],_=e[7],w=e[11],x=e[15];return y*(+s*u*h-i*f*h-s*a*d+n*f*d+i*a*g-n*u*g)+_*(+t*u*g-t*f*d+s*o*d-i*o*g+i*f*p-s*u*p)+w*(+t*f*h-t*a*g-s*o*h+n*o*g+s*a*p-n*f*p)+x*(-i*a*p-t*u*h+t*a*d+i*o*h-n*o*d+n*u*p)}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],o=e[4],a=e[5],u=e[6],f=e[7],p=e[8],h=e[9],d=e[10],g=e[11],y=e[12],_=e[13],w=e[14],x=e[15],v=h*w*f-_*d*f+_*u*g-a*w*g-h*u*x+a*d*x,E=y*d*f-p*w*f-y*u*g+o*w*g+p*u*x-o*d*x,M=p*_*f-y*h*f+y*a*g-o*_*g-p*a*x+o*h*x,A=y*h*u-p*_*u-y*a*d+o*_*d+p*a*w-o*h*w,C=t*v+n*E+i*M+s*A;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const L=1/C;return e[0]=v*L,e[1]=(_*d*s-h*w*s-_*i*g+n*w*g+h*i*x-n*d*x)*L,e[2]=(a*w*s-_*u*s+_*i*f-n*w*f-a*i*x+n*u*x)*L,e[3]=(h*u*s-a*d*s-h*i*f+n*d*f+a*i*g-n*u*g)*L,e[4]=E*L,e[5]=(p*w*s-y*d*s+y*i*g-t*w*g-p*i*x+t*d*x)*L,e[6]=(y*u*s-o*w*s-y*i*f+t*w*f+o*i*x-t*u*x)*L,e[7]=(o*d*s-p*u*s+p*i*f-t*d*f-o*i*g+t*u*g)*L,e[8]=M*L,e[9]=(y*h*s-p*_*s-y*n*g+t*_*g+p*n*x-t*h*x)*L,e[10]=(o*_*s-y*a*s+y*n*f-t*_*f-o*n*x+t*a*x)*L,e[11]=(p*a*s-o*h*s-p*n*f+t*h*f+o*n*g-t*a*g)*L,e[12]=A*L,e[13]=(p*_*i-y*h*i+y*n*d-t*_*d-p*n*w+t*h*w)*L,e[14]=(y*a*i-o*_*i-y*n*u+t*_*u+o*n*w-t*a*w)*L,e[15]=(o*h*i-p*a*i+p*n*u-t*h*u-o*n*d+t*a*d)*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 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,o=e.x,a=e.y,u=e.z,f=s*o,p=s*a;return this.set(f*o+n,f*a-i*u,f*u+i*a,0,f*a+i*u,p*a+n,p*u-i*o,0,f*u-i*a,p*u+i*o,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,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,o=t._y,a=t._z,u=t._w,f=s+s,p=o+o,h=a+a,d=s*f,g=s*p,y=s*h,_=o*p,w=o*h,x=a*h,v=u*f,E=u*p,M=u*h,A=n.x,C=n.y,L=n.z;
vendor: 4,787 bytes, line 5
5return i[0]=(1-(_+x))*A,i[1]=(g+M)*A,i[2]=(y-E)*A,i[3]=0,i[4]=(g-M)*C,i[5]=(1-(d+x))*C,i[6]=(w+v)*C,i[7]=0,i[8]=(y+E)*L,i[9]=(w-v)*L,i[10]=(1-(d+_))*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=lo.set(i[0],i[1],i[2]).length();const o=lo.set(i[4],i[5],i[6]).length(),a=lo.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],vr.copy(this);const f=1/s,p=1/o,h=1/a;return vr.elements[0]*=f,vr.elements[1]*=f,vr.elements[2]*=f,vr.elements[4]*=p,vr.elements[5]*=p,vr.elements[6]*=p,vr.elements[8]*=h,vr.elements[9]*=h,vr.elements[10]*=h,t.setFromRotationMatrix(vr),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,u=2*s/(t-e),f=2*s/(n-i),p=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),g=-2*o*s/(o-s);return a[0]=u,a[4]=0,a[8]=p,a[12]=0,a[1]=0,a[5]=f,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=g,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){const a=this.elements,u=1/(t-e),f=1/(n-i),p=1/(o-s),h=(t+e)*u,d=(n+i)*f,g=(o+s)*p;return a[0]=2*u,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*f,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*p,a[14]=-g,a[3]=0,a[7]=0,a[11]=0,a[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}}ke.prototype.isMatrix4=!0;const lo=new F,vr=new ke,wM=new F(0,0,0),SM=new F(1,1,1),Pi=new F,jc=new F,qn=new F,L0=new ke,I0=new Sn;class ks{constructor(e=0,t=0,n=0,i=ks.DefaultOrder){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],o=i[4],a=i[8],u=i[1],f=i[5],p=i[9],h=i[2],d=i[6],g=i[10];switch(t){case"XYZ":this._y=Math.asin(_n(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-p,g),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,f),this._z=0);break;case"YXZ":this._x=Math.asin(-_n(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(a,g),this._z=Math.atan2(u,f)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(_n(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,g),this._z=Math.atan2(-o,f)):(this._y=0,this._z=Math.atan2(u,s));break;case"ZYX":this._y=Math.asin(-_n(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,g),this._z=Math.atan2(u,s)):(this._x=0,this._z=Math.atan2(-o,f));break;case"YZX":this._z=Math.asin(_n(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-p,f),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,g));break;case"XZY":this._z=Math.asin(-_n(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,f),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-p,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 L0.makeRotationFromQuaternion(e),this.setFromRotationMatrix(L0,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return I0.setFromEuler(this),this.setFromQuaternion(I0,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}toVector3(e){return e?e.set(this._x,this._y,this._z):new F(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}ks.prototype.isEuler=!0;ks.DefaultOrder="XYZ";ks.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class bs{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}
vendor: 29,107 bytes, line 5
5isEnabled(e){return(this.mask&(1<<e|0))!==0}}let MM=0;const D0=new F,co=new Sn,Kr=new ke,qc=new F,Ua=new F,EM=new F,TM=new Sn,O0=new F(1,0,0),F0=new F(0,1,0),B0=new F(0,0,1),AM={type:"added"},z0={type:"removed"};class ct extends ji{constructor(){super(),Object.defineProperty(this,"id",{value:MM++}),this.uuid=Jn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ct.DefaultUp.clone();const e=new F,t=new ks,n=new Sn,i=new F(1,1,1);function s(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(o),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 ke},normalMatrix:{value:new un}}),this.matrix=new ke,this.matrixWorld=new ke,this.matrixAutoUpdate=ct.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new bs,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}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 co.setFromAxisAngle(e,t),this.quaternion.multiply(co),this}rotateOnWorldAxis(e,t){return co.setFromAxisAngle(e,t),this.quaternion.premultiply(co),this}rotateX(e){return this.rotateOnAxis(O0,e)}rotateY(e){return this.rotateOnAxis(F0,e)}rotateZ(e){return this.rotateOnAxis(B0,e)}translateOnAxis(e,t){return D0.copy(e).applyQuaternion(this.quaternion),this.position.add(D0.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(O0,e)}translateY(e){return this.translateOnAxis(F0,e)}translateZ(e){return this.translateOnAxis(B0,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(Kr.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?qc.copy(e):qc.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Ua.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Kr.lookAt(Ua,qc,this.up):Kr.lookAt(qc,Ua,this.up),this.quaternion.setFromRotationMatrix(Kr),i&&(Kr.extractRotation(i.matrixWorld),co.setFromRotationMatrix(Kr),this.quaternion.premultiply(co.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(AM)):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(z0)),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(z0)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),Kr.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Kr.multiply(e.parent.matrixWorld)),e.applyMatrix4(Kr),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 o=this.children[n].getObjectByProperty(e,t);if(o!==void 0)return o}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ua,e,EM),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ua,TM,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++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&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,o=i.length;s<o;s++)i[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},n.metadata={version:4.5,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),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.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()));function s(a,u){return a[u.uuid]===void 0&&(a[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&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const u=a.shapes;if(Array.isArray(u))for(let f=0,p=u.length;f<p;f++){const h=u[f];s(e.shapes,h)}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 a=[];for(let u=0,f=this.material.length;u<f;u++)a.push(s(e.materials,this.material[u]));i.material=a}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){const u=this.animations[a];i.animations.push(s(e.animations,u))}}if(t){const a=o(e.geometries),u=o(e.materials),f=o(e.textures),p=o(e.images),h=o(e.shapes),d=o(e.skeletons),g=o(e.animations);a.length>0&&(n.geometries=a),u.length>0&&(n.materials=u),f.length>0&&(n.textures=f),p.length>0&&(n.images=p),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),g.length>0&&(n.animations=g)}return n.object=i,n;function o(a){const u=[];for(const f in a){const p=a[f];delete p.metadata,u.push(p)}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.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.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}}ct.DefaultUp=new F(0,1,0);ct.DefaultMatrixAutoUpdate=!0;ct.prototype.isObject3D=!0;const xr=new F,Qr=new F,Jd=new F,ei=new F,uo=new F,fo=new F,N0=new F,Zd=new F,Kd=new F,Qd=new F;class en{constructor(e=new F,t=new F,n=new F){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),xr.subVectors(e,t),i.cross(xr);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){xr.subVectors(i,t),Qr.subVectors(n,t),Jd.subVectors(e,t);const o=xr.dot(xr),a=xr.dot(Qr),u=xr.dot(Jd),f=Qr.dot(Qr),p=Qr.dot(Jd),h=o*f-a*a;if(h===0)return s.set(-2,-1,-1);const d=1/h,g=(f*u-a*p)*d,y=(o*p-a*u)*d;return s.set(1-g-y,y,g)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,ei),ei.x>=0&&ei.y>=0&&ei.x+ei.y<=1}static getUV(e,t,n,i,s,o,a,u){return this.getBarycoord(e,t,n,i,ei),u.set(0,0),u.addScaledVector(s,ei.x),u.addScaledVector(o,ei.y),u.addScaledVector(a,ei.z),u}static isFrontFacing(e,t,n,i){return xr.subVectors(n,t),Qr.subVectors(e,t),xr.cross(Qr).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 xr.subVectors(this.c,this.b),Qr.subVectors(this.a,this.b),xr.cross(Qr).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return en.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return en.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return en.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return en.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return en.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 o,a;uo.subVectors(i,n),fo.subVectors(s,n),Zd.subVectors(e,n);const u=uo.dot(Zd),f=fo.dot(Zd);if(u<=0&&f<=0)return t.copy(n);Kd.subVectors(e,i);const p=uo.dot(Kd),h=fo.dot(Kd);if(p>=0&&h<=p)return t.copy(i);const d=u*h-p*f;if(d<=0&&u>=0&&p<=0)return o=u/(u-p),t.copy(n).addScaledVector(uo,o);Qd.subVectors(e,s);const g=uo.dot(Qd),y=fo.dot(Qd);if(y>=0&&g<=y)return t.copy(s);const _=g*f-u*y;if(_<=0&&f>=0&&y<=0)return a=f/(f-y),t.copy(n).addScaledVector(fo,a);const w=p*y-g*h;if(w<=0&&h-p>=0&&g-y>=0)return N0.subVectors(s,i),a=(h-p)/(h-p+(g-y)),t.copy(i).addScaledVector(N0,a);const x=1/(w+_+d);return o=_*x,a=d*x,t.copy(n).addScaledVector(uo,o).addScaledVector(fo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let RM=0;class pn extends ji{constructor(){super(),Object.defineProperty(this,"id",{value:RM++}),this.uuid=Jn(),this.name="",this.type="Material",this.fog=!0,this.blending=Oo,this.side=Es,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Yp,this.blendDst=Jp,this.blendEquation=ps,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Gu,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=T_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Uu,this.stencilZFail=Uu,this.stencilZPass=Uu,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(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: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Xp;continue}const i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");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.5,type:"Material",generator:"Material.toJSON"}};n.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.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&&(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!==Oo&&(n.blending=this.blending),this.side!==Es&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&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&&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.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),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=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){const o=[];for(const a in s){const u=s[a];delete u.metadata,o.push(u)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,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.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.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,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++}}pn.prototype.isMaterial=!0;class pi extends pn{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new Ae(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=Pl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",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}}pi.prototype.isMeshBasicMaterial=!0;const Bt=new F,Xc=new de;class pt{constructor(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n===!0,this.usage=Ho,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}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}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}copyColorsArray(e){const t=this.array;let n=0;for(let i=0,s=e.length;i<s;i++){let o=e[i];o===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),o=new Ae),t[n++]=o.r,t[n++]=o.g,t[n++]=o.b}return this}copyVector2sArray(e){const t=this.array;let n=0;for(let i=0,s=e.length;i<s;i++){let o=e[i];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new de),t[n++]=o.x,t[n++]=o.y}return this}copyVector3sArray(e){const t=this.array;let n=0;for(let i=0,s=e.length;i<s;i++){let o=e[i];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),o=new F),t[n++]=o.x,t[n++]=o.y,t[n++]=o.z}return this}copyVector4sArray(e){const t=this.array;let n=0;for(let i=0,s=e.length;i<s;i++){let o=e[i];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),o=new Mt),t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n++]=o.w}return this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Xc.fromBufferAttribute(this,t),Xc.applyMatrix3(e),this.setXY(t,Xc.x,Xc.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Bt.fromBufferAttribute(this,t),Bt.applyMatrix3(e),this.setXYZ(t,Bt.x,Bt.y,Bt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Bt.x=this.getX(t),Bt.y=this.getY(t),Bt.z=this.getZ(t),Bt.applyMatrix4(e),this.setXYZ(t,Bt.x,Bt.y,Bt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Bt.x=this.getX(t),Bt.y=this.getY(t),Bt.z=this.getZ(t),Bt.applyNormalMatrix(e),this.setXYZ(t,Bt.x,Bt.y,Bt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Bt.x=this.getX(t),Bt.y=this.getY(t),Bt.z=this.getZ(t),Bt.transformDirection(e),this.setXYZ(t,Bt.x,Bt.y,Bt.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,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.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.prototype.slice.call(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Ho&&(e.usage=this.usage),(this.updateRange.offset!==0||this.updateRange.count!==-1)&&(e.updateRange=this.updateRange),e}}pt.prototype.isBufferAttribute=!0;class I_ extends pt{constructor(e,t,n){super(new Int8Array(e),t,n)}}class D_ extends pt{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class O_ extends pt{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class F_ extends pt{constructor(e,t,n){super(new Int16Array(e),t,n)}}class uf extends pt{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class B_ extends pt{constructor(e,t,n){super(new Int32Array(e),t,n)}}class ff extends pt{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class z_ extends pt{constructor(e,t,n){super(new Uint16Array(e),t,n)}}z_.prototype.isFloat16BufferAttribute=!0;class ze extends pt{constructor(e,t,n){super(new Float32Array(e),t,n)}}class N_ extends pt{constructor(e,t,n){super(new Float64Array(e),t,n)}}let CM=0;const cr=new ke,eh=new ct,ho=new F,Xn=new er,Ha=new er,dn=new F;class Je extends ji{constructor(){super(),Object.defineProperty(this,"id",{value:CM++}),this.uuid=Jn(),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(C_(e)?ff:uf)(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 un().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 cr.makeRotationFromQuaternion(e),this.applyMatrix4(cr),this}rotateX(e){return cr.makeRotationX(e),this.applyMatrix4(cr),this}rotateY(e){return cr.makeRotationY(e),this.applyMatrix4(cr),this}rotateZ(e){return cr.makeRotationZ(e),this.applyMatrix4(cr),this}translate(e,t,n){return cr.makeTranslation(e,t,n),this.applyMatrix4(cr),this}scale(e,t,n){return cr.makeScale(e,t,n),this.applyMatrix4(cr),this}lookAt(e){return eh.lookAt(e),eh.updateMatrix(),this.applyMatrix4(eh.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ho).negate(),this.translate(ho.x,ho.y,ho.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 ze(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new er);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 F(-1/0,-1/0,-1/0),new F(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];Xn.setFromBufferAttribute(s),this.morphTargetsRelative?(dn.addVectors(this.boundingBox.min,Xn.min),this.boundingBox.expandByPoint(dn),dn.addVectors(this.boundingBox.max,Xn.max),this.boundingBox.expandByPoint(dn)):(this.boundingBox.expandByPoint(Xn.min),this.boundingBox.expandByPoint(Xn.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 Xi);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 F,1/0);return}if(e){const n=this.boundingSphere.center;if(Xn.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const a=t[s];Ha.setFromBufferAttribute(a),this.morphTargetsRelative?(dn.addVectors(Xn.min,Ha.min),Xn.expandByPoint(dn),dn.addVectors(Xn.max,Ha.max),Xn.expandByPoint(dn)):(Xn.expandByPoint(Ha.min),Xn.expandByPoint(Ha.max))}Xn.getCenter(n);let i=0;for(let s=0,o=e.count;s<o;s++)dn.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(dn));if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s],u=this.morphTargetsRelative;for(let f=0,p=a.count;f<p;f++)dn.fromBufferAttribute(a,f),u&&(ho.fromBufferAttribute(e,f),dn.add(ho)),i=Math.max(i,n.distanceToSquared(dn))}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,o=t.uv.array,a=i.length/3;t.tangent===void 0&&this.setAttribute("tangent",new pt(new Float32Array(4*a),4));const u=t.tangent.array,f=[],p=[];for(let B=0;B<a;B++)f[B]=new F,p[B]=new F;const h=new F,d=new F,g=new F,y=new de,_=new de,w=new de,x=new F,v=new F;function E(B,T,O){h.fromArray(i,B*3),d.fromArray(i,T*3),g.fromArray(i,O*3),y.fromArray(o,B*2),_.fromArray(o,T*2),w.fromArray(o,O*2),d.sub(h),g.sub(h),_.sub(y),w.sub(y);const H=1/(_.x*w.y-w.x*_.y);!isFinite(H)||(x.copy(d).multiplyScalar(w.y).addScaledVector(g,-_.y).multiplyScalar(H),v.copy(g).multiplyScalar(_.x).addScaledVector(d,-w.x).multiplyScalar(H),f[B].add(x),f[T].add(x),f[O].add(x),p[B].add(v),p[T].add(v),p[O].add(v))}let M=this.groups;M.length===0&&(M=[{start:0,count:n.length}]);for(let B=0,T=M.length;B<T;++B){const O=M[B],H=O.start,W=O.count;for(let V=H,j=H+W;V<j;V+=3)E(n[V+0],n[V+1],n[V+2])}const A=new F,C=new F,L=new F,D=new F;function k(B){L.fromArray(s,B*3),D.copy(L);const T=f[B];A.copy(T),A.sub(L.multiplyScalar(L.dot(T))).normalize(),C.crossVectors(D,T);const H=C.dot(p[B])<0?-1:1;u[B*4]=A.x,u[B*4+1]=A.y,u[B*4+2]=A.z,u[B*4+3]=H}for(let B=0,T=M.length;B<T;++B){const O=M[B],H=O.start,W=O.count;for(let V=H,j=H+W;V<j;V+=3)k(n[V+0]),k(n[V+1]),k(n[V+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 pt(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,g=n.count;d<g;d++)n.setXYZ(d,0,0,0);const i=new F,s=new F,o=new F,a=new F,u=new F,f=new F,p=new F,h=new F;if(e)for(let d=0,g=e.count;d<g;d+=3){const y=e.getX(d+0),_=e.getX(d+1),w=e.getX(d+2);i.fromBufferAttribute(t,y),s.fromBufferAttribute(t,_),o.fromBufferAttribute(t,w),p.subVectors(o,s),h.subVectors(i,s),p.cross(h),a.fromBufferAttribute(n,y),u.fromBufferAttribute(n,_),f.fromBufferAttribute(n,w),a.add(p),u.add(p),f.add(p),n.setXYZ(y,a.x,a.y,a.z),n.setXYZ(_,u.x,u.y,u.z),n.setXYZ(w,f.x,f.y,f.z)}else for(let d=0,g=t.count;d<g;d+=3)i.fromBufferAttribute(t,d+0),s.fromBufferAttribute(t,d+1),o.fromBufferAttribute(t,d+2),p.subVectors(o,s),h.subVectors(i,s),p.cross(h),n.setXYZ(d+0,p.x,p.y,p.z),n.setXYZ(d+1,p.x,p.y,p.z),n.setXYZ(d+2,p.x,p.y,p.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(e,t){if(!(e&&e.isBufferGeometry)){console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);return}t===void 0&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const i in n){if(e.attributes[i]===void 0)continue;const o=n[i].array,a=e.attributes[i],u=a.array,f=a.itemSize*t,p=Math.min(u.length,o.length-f);for(let h=0,d=f;h<p;h++,d++)o[d]=u[h]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)dn.fromBufferAttribute(e,t),dn.normalize(),e.setXYZ(t,dn.x,dn.y,dn.z)}toNonIndexed(){function e(a,u){const f=a.array,p=a.itemSize,h=a.normalized,d=new f.constructor(u.length*p);let g=0,y=0;for(let _=0,w=u.length;_<w;_++){a.isInterleavedBufferAttribute?g=u[_]*a.data.stride+a.offset:g=u[_]*p;for(let x=0;x<p;x++)d[y++]=f[g++]}return new pt(d,p,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Je,n=this.index.array,i=this.attributes;for(const a in i){const u=i[a],f=e(u,n);t.setAttribute(a,f)}const s=this.morphAttributes;for(const a in s){const u=[],f=s[a];for(let p=0,h=f.length;p<h;p++){const d=f[p],g=e(d,n);u.push(g)}t.morphAttributes[a]=u}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,u=o.length;a<u;a++){const f=o[a];t.addGroup(f.start,f.count,f.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
vendor: 11,383 bytes, lines 5-9
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 f in u)u[f]!==void 0&&(e[f]=u[f]);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 f=n[u];e.data.attributes[u]=f.toJSON(e.data)}const i={};let s=!1;for(const u in this.morphAttributes){const f=this.morphAttributes[u],p=[];for(let h=0,d=f.length;h<d;h++){const g=f[h];p.push(g.toJSON(e.data))}p.length>0&&(i[u]=p,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.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 f in i){const p=i[f];this.setAttribute(f,p.clone(t))}const s=e.morphAttributes;for(const f in s){const p=[],h=s[f];for(let d=0,g=h.length;d<g;d++)p.push(h[d].clone(t));this.morphAttributes[f]=p}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let f=0,p=o.length;f<p;f++){const h=o[f];this.addGroup(h.start,h.count,h.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.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,e.parameters!==void 0&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}Je.prototype.isBufferGeometry=!0;const k0=new ke,po=new Yi,th=new Xi,Li=new F,Ii=new F,Di=new F,nh=new F,rh=new F,ih=new F,Yc=new F,Jc=new F,Zc=new F,Kc=new de,Qc=new de,eu=new de,sh=new F,tu=new F;class on extends ct{constructor(e=new Je,t=new pi){super(),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.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,o=i.length;s<o;s++){const a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),th.copy(n.boundingSphere),th.applyMatrix4(s),e.ray.intersectsSphere(th)===!1)||(k0.copy(s).invert(),po.copy(e.ray).applyMatrix4(k0),n.boundingBox!==null&&po.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){const a=n.index,u=n.attributes.position,f=n.morphAttributes.position,p=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,g=n.groups,y=n.drawRange;if(a!==null)if(Array.isArray(i))for(let _=0,w=g.length;_<w;_++){const x=g[_],v=i[x.materialIndex],E=Math.max(x.start,y.start),M=Math.min(a.count,Math.min(x.start+x.count,y.start+y.count));for(let A=E,C=M;A<C;A+=3){const L=a.getX(A),D=a.getX(A+1),k=a.getX(A+2);o=nu(this,v,e,po,u,f,p,h,d,L,D,k),o&&(o.faceIndex=Math.floor(A/3),o.face.materialIndex=x.materialIndex,t.push(o))}}else{const _=Math.max(0,y.start),w=Math.min(a.count,y.start+y.count);for(let x=_,v=w;x<v;x+=3){const E=a.getX(x),M=a.getX(x+1),A=a.getX(x+2);o=nu(this,i,e,po,u,f,p,h,d,E,M,A),o&&(o.faceIndex=Math.floor(x/3),t.push(o))}}else if(u!==void 0)if(Array.isArray(i))for(let _=0,w=g.length;_<w;_++){const x=g[_],v=i[x.materialIndex],E=Math.max(x.start,y.start),M=Math.min(u.count,Math.min(x.start+x.count,y.start+y.count));for(let A=E,C=M;A<C;A+=3){const L=A,D=A+1,k=A+2;o=nu(this,v,e,po,u,f,p,h,d,L,D,k),o&&(o.faceIndex=Math.floor(A/3),o.face.materialIndex=x.materialIndex,t.push(o))}}else{const _=Math.max(0,y.start),w=Math.min(u.count,y.start+y.count);for(let x=_,v=w;x<v;x+=3){const E=x,M=x+1,A=x+2;o=nu(this,i,e,po,u,f,p,h,d,E,M,A),o&&(o.faceIndex=Math.floor(x/3),t.push(o))}}}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}on.prototype.isMesh=!0;function PM(r,e,t,n,i,s,o,a){let u;if(e.side===Zt?u=n.intersectTriangle(o,s,i,!0,a):u=n.intersectTriangle(i,s,o,e.side!==Ts,a),u===null)return null;tu.copy(a),tu.applyMatrix4(r.matrixWorld);const f=t.ray.origin.distanceTo(tu);return f<t.near||f>t.far?null:{distance:f,point:tu.clone(),object:r}}function nu(r,e,t,n,i,s,o,a,u,f,p,h){Li.fromBufferAttribute(i,f),Ii.fromBufferAttribute(i,p),Di.fromBufferAttribute(i,h);const d=r.morphTargetInfluences;if(s&&d){Yc.set(0,0,0),Jc.set(0,0,0),Zc.set(0,0,0);for(let y=0,_=s.length;y<_;y++){const w=d[y],x=s[y];w!==0&&(nh.fromBufferAttribute(x,f),rh.fromBufferAttribute(x,p),ih.fromBufferAttribute(x,h),o?(Yc.addScaledVector(nh,w),Jc.addScaledVector(rh,w),Zc.addScaledVector(ih,w)):(Yc.addScaledVector(nh.sub(Li),w),Jc.addScaledVector(rh.sub(Ii),w),Zc.addScaledVector(ih.sub(Di),w)))}Li.add(Yc),Ii.add(Jc),Di.add(Zc)}r.isSkinnedMesh&&(r.boneTransform(f,Li),r.boneTransform(p,Ii),r.boneTransform(h,Di));const g=PM(r,e,t,n,Li,Ii,Di,sh);if(g){a&&(Kc.fromBufferAttribute(a,f),Qc.fromBufferAttribute(a,p),eu.fromBufferAttribute(a,h),g.uv=en.getUV(sh,Li,Ii,Di,Kc,Qc,eu,new de)),u&&(Kc.fromBufferAttribute(u,f),Qc.fromBufferAttribute(u,p),eu.fromBufferAttribute(u,h),g.uv2=en.getUV(sh,Li,Ii,Di,Kc,Qc,eu,new de));const y={a:f,b:p,c:h,normal:new F,materialIndex:0};en.getNormal(Li,Ii,Di,y.normal),g.face=y}return g}class li extends Je{constructor(e=1,t=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};const a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const u=[],f=[],p=[],h=[];let d=0,g=0;y("z","y","x",-1,-1,n,t,e,o,s,0),y("z","y","x",1,-1,n,t,-e,o,s,1),y("x","z","y",1,1,e,n,t,i,o,2),y("x","z","y",1,-1,e,n,-t,i,o,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 ze(f,3)),this.setAttribute("normal",new ze(p,3)),this.setAttribute("uv",new ze(h,2));function y(_,w,x,v,E,M,A,C,L,D,k){const B=M/L,T=A/D,O=M/2,H=A/2,W=C/2,V=L+1,j=D+1;let Z=0,ne=0;const ge=new F;for(let Y=0;Y<j;Y++){const ee=Y*T-H;for(let ue=0;ue<V;ue++){const ye=ue*B-O;ge[_]=ye*v,ge[w]=ee*E,ge[x]=W,f.push(ge.x,ge.y,ge.z),ge[_]=0,ge[w]=0,ge[x]=C>0?1:-1,p.push(ge.x,ge.y,ge.z),h.push(ue/L),h.push(1-Y/D),Z+=1}}for(let Y=0;Y<D;Y++)for(let ee=0;ee<L;ee++){const ue=d+ee+V*Y,ye=d+ee+V*(Y+1),xe=d+(ee+1)+V*(Y+1),re=d+(ee+1)+V*Y;u.push(ue,ye,re),u.push(ye,xe,re),ne+=6}a.addGroup(g,ne,k),g+=ne,d+=Z}}static fromJSON(e){return new li(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Vo(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)?e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function Tn(r){const e={};for(let t=0;t<r.length;t++){const n=Vo(r[t]);for(const i in n)e[i]=n[i]}return e}const k_={clone:Vo,merge:Tn};var LM=`void main() { 6 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 7}`,IM=`void main() { 8 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 9}`;class ci extends pn{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=LM,this.fragmentShader=IM,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&(e.attributes!==void 0&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Vo(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,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 o=this.uniforms[i].value;o&&o.isTexture?t.uniforms[i]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[i]={type:"m4",value:o.toArray()}:t.uniforms[i]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;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}}ci.prototype.isShaderMaterial=!0;class Rs extends ct{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new ke,this.projectionMatrix=new ke,this.projectionMatrixInverse=new ke}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}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)}}Rs.prototype.isCamera=!0;class Qt extends Rs{constructor(e=50,t=1,n=.1,i=2e3){super(),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=gl*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(_s*.5*this.fov);return .5*this.getFilmHeight()/e}
9getEffectiveFOV(){return gl*2*Math.atan(Math.tan(_s*.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,o){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=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(_s*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const u=o.fullWidth,f=o.fullHeight;s+=o.offsetX*i/u,t-=o.offsetY*n/f,i*=o.width/u,n*=o.height/f}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),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}}Qt.prototype.isPerspectiveCamera=!0;const mo=90,go=1;class df extends ct{constructor(e,t,n){if(super(),this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;const i=new Qt(mo,go,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new F(1,0,0)),this.add(i);const s=new Qt(mo,go,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new F(-1,0,0)),this.add(s);const o=new Qt(mo,go,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new F(0,1,0)),this.add(o);const a=new Qt(mo,go,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new F(0,-1,0)),this.add(a);const u=new Qt(mo,go,e,t);u.layers=this.layers,u.up.set(0,-1,0),u.lookAt(new F(0,0,1)),this.add(u);const f=new Qt(mo,go,e,t);f.layers=this.layers,f.up.set(0,-1,0),f.lookAt(new F(0,0,-1)),this.add(f)}update(e,t){this.parent===null&&this.updateMatrixWorld();const n=this.renderTarget,[i,s,o,a,u,f]=this.children,p=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;const d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,u),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,f),e.setRenderTarget(h),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}class ia extends nn{constructor(e,t,n,i,s,o,a,u,f,p){e=e!==void 0?e:[],t=t!==void 0?t:$i,super(e,t,n,i,s,o,a,u,f,p),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}ia.prototype.isCubeTexture=!0;class Il extends Zn{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),super(e,e,t),t=t||{},this.texture=new ia(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Pt}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=wn,this.texture.encoding=t.encoding,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 li(5,5,5),s=new ci({name:"CubemapFromEquirect",uniforms:Vo(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Zt,blending:si});s.uniforms.tEquirect.value=t;const o=new on(i,s),a=t.minFilter;return t.minFilter===zs&&(t.minFilter=Pt),new df(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}}
vendor: 9,109 bytes, lines 44-114
44Il.prototype.isWebGLCubeRenderTarget=!0;const oh=new F,DM=new F,OM=new un;class Or{constructor(e=new F(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,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=oh.subVectors(n,t).cross(DM.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(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const n=e.delta(oh),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(n).multiplyScalar(s).add(e.start)}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||OM.getNormalMatrix(e),i=this.coplanarPoint(oh).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)}}Or.prototype.isPlane=!0;const yo=new Xi,ru=new F;class Dl{constructor(e=new Or,t=new Or,n=new Or,i=new Or,s=new Or,o=new Or){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],u=n[4],f=n[5],p=n[6],h=n[7],d=n[8],g=n[9],y=n[10],_=n[11],w=n[12],x=n[13],v=n[14],E=n[15];return t[0].setComponents(a-i,h-u,_-d,E-w).normalize(),t[1].setComponents(a+i,h+u,_+d,E+w).normalize(),t[2].setComponents(a+s,h+f,_+g,E+x).normalize(),t[3].setComponents(a-s,h-f,_-g,E-x).normalize(),t[4].setComponents(a-o,h-p,_-y,E-v).normalize(),t[5].setComponents(a+o,h+p,_+y,E+v).normalize(),this}intersectsObject(e){const t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),yo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(yo)}intersectsSprite(e){return yo.center.set(0,0,0),yo.radius=.7071067811865476,yo.applyMatrix4(e.matrixWorld),this.intersectsSphere(yo)}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(ru.x=i.normal.x>0?e.max.x:e.min.x,ru.y=i.normal.y>0?e.max.y:e.min.y,ru.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(ru)<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 U_(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),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 FM(r,e){const t=e.isWebGL2,n=new WeakMap;function i(f,p){const h=f.array,d=f.usage,g=r.createBuffer();r.bindBuffer(p,g),r.bufferData(p,h,d),f.onUploadCallback();let y=5126;return h instanceof Float32Array?y=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?f.isFloat16BufferAttribute?t?y=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):y=5123:h instanceof Int16Array?y=5122:h instanceof Uint32Array?y=5125:h instanceof Int32Array?y=5124:h instanceof Int8Array?y=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(y=5121),{buffer:g,type:y,bytesPerElement:h.BYTES_PER_ELEMENT,version:f.version}}function s(f,p,h){const d=p.array,g=p.updateRange;r.bindBuffer(h,f),g.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,g.offset*d.BYTES_PER_ELEMENT,d,g.offset,g.count):r.bufferSubData(h,g.offset*d.BYTES_PER_ELEMENT,d.subarray(g.offset,g.offset+g.count)),g.count=-1)}function o(f){return f.isInterleavedBufferAttribute&&(f=f.data),n.get(f)}function a(f){f.isInterleavedBufferAttribute&&(f=f.data);const p=n.get(f);p&&(r.deleteBuffer(p.buffer),n.delete(f))}function u(f,p){if(f.isGLBufferAttribute){const d=n.get(f);(!d||d.version<f.version)&&n.set(f,{buffer:f.buffer,type:f.type,bytesPerElement:f.elementSize,version:f.version});return}f.isInterleavedBufferAttribute&&(f=f.data);const h=n.get(f);h===void 0?n.set(f,i(f,p)):h.version<f.version&&(s(h.buffer,f,p),h.version=f.version)}return{get:o,remove:a,update:u}}class Cs extends Je{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,o=t/2,a=Math.floor(n),u=Math.floor(i),f=a+1,p=u+1,h=e/a,d=t/u,g=[],y=[],_=[],w=[];for(let x=0;x<p;x++){const v=x*d-o;for(let E=0;E<f;E++){const M=E*h-s;y.push(M,-v,0),_.push(0,0,1),w.push(E/a),w.push(1-x/u)}}for(let x=0;x<u;x++)for(let v=0;v<a;v++){const E=v+f*x,M=v+f*(x+1),A=v+1+f*(x+1),C=v+1+f*x;g.push(E,M,C),g.push(M,A,C)}this.setIndex(g),this.setAttribute("position",new ze(y,3)),this.setAttribute("normal",new ze(_,3)),this.setAttribute("uv",new ze(w,2))}static fromJSON(e){return new Cs(e.width,e.height,e.widthSegments,e.heightSegments)}}var BM=`#ifdef USE_ALPHAMAP 45 diffuseColor.a *= texture2D( alphaMap, vUv ).g; 46#endif`,zM=`#ifdef USE_ALPHAMAP 47 uniform sampler2D alphaMap; 48#endif`,NM=`#ifdef USE_ALPHATEST 49 if ( diffuseColor.a < alphaTest ) discard; 50#endif`,kM=`#ifdef USE_ALPHATEST 51 uniform float alphaTest; 52#endif`,UM=`#ifdef USE_AOMAP 53 float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0; 54 reflectedLight.indirectDiffuse *= ambientOcclusion; 55 #if defined( USE_ENVMAP ) && defined( STANDARD ) 56 float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); 57 reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); 58 #endif 59#endif`,HM=`#ifdef USE_AOMAP 60 uniform sampler2D aoMap; 61 uniform float aoMapIntensity; 62#endif`,GM="vec3 transformed = vec3( position );",VM=`vec3 objectNormal = vec3( normal ); 63#ifdef USE_TANGENT 64 vec3 objectTangent = vec3( tangent.xyz ); 65#endif`,WM=`vec3 BRDF_Lambert( const in vec3 diffuseColor ) { 66 return RECIPROCAL_PI * diffuseColor; 67} 68vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 69 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 70 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 71} 72float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { 73 float a2 = pow2( alpha ); 74 float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); 75 float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); 76 return 0.5 / max( gv + gl, EPSILON ); 77} 78float D_GGX( const in float alpha, const in float dotNH ) { 79 float a2 = pow2( alpha ); 80 float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; 81 return RECIPROCAL_PI * a2 / pow2( denom ); 82} 83vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) { 84 float alpha = pow2( roughness ); 85 vec3 halfDir = normalize( lightDir + viewDir ); 86 float dotNL = saturate( dot( normal, lightDir ) ); 87 float dotNV = saturate( dot( normal, viewDir ) ); 88 float dotNH = saturate( dot( normal, halfDir ) ); 89 float dotVH = saturate( dot( viewDir, halfDir ) ); 90 vec3 F = F_Schlick( f0, f90, dotVH ); 91 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 92 float D = D_GGX( alpha, dotNH ); 93 return F * ( V * D ); 94} 95vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { 96 const float LUT_SIZE = 64.0; 97 const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; 98 const float LUT_BIAS = 0.5 / LUT_SIZE; 99 float dotNV = saturate( dot( N, V ) ); 100 vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); 101 uv = uv * LUT_SCALE + LUT_BIAS; 102 return uv; 103} 104float LTC_ClippedSphereFormFactor( const in vec3 f ) { 105 float l = length( f ); 106 return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); 107} 108vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { 109 float x = dot( v1, v2 ); 110 float y = abs( x ); 111 float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; 112 float b = 3.4175940 + ( 4.1616724 + y ) * y; 113 float v = a / b; 114 float theta_sintheta = ( x >
114 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; 115 return cross( v1, v2 ) * theta_sintheta; 116} 117vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { 118 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; 119 vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; 120 vec3 lightNormal = cross( v1, v2 ); 121 if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); 122 vec3 T1, T2; 123 T1 = normalize( V - N * dot( V, N ) ); 124 T2 = - cross( N, T1 ); 125 mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); 126 vec3 coords[ 4 ]; 127 coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); 128 coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); 129 coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); 130 coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); 131 coords[ 0 ] = normalize( coords[ 0 ] ); 132 coords[ 1 ] = normalize( coords[ 1 ] ); 133 coords[ 2 ] = normalize( coords[ 2 ] ); 134 coords[ 3 ] = normalize( coords[ 3 ] ); 135 vec3 vectorFormFactor = vec3( 0.0 ); 136 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); 137 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); 138 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); 139 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); 140 float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); 141 return vec3( result ); 142} 143float G_BlinnPhong_Implicit( ) { 144 return 0.25; 145} 146float D_BlinnPhong( const in float shininess, const in float dotNH ) { 147 return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); 148} 149vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { 150 vec3 halfDir = normalize( lightDir + viewDir ); 151 float dotNH = saturate( dot( normal, halfDir ) ); 152 float dotVH = saturate( dot( viewDir, halfDir ) ); 153 vec3 F = F_Schlick( specularColor, 1.0, dotVH ); 154 float G = G_BlinnPhong_Implicit( ); 155 float D = D_BlinnPhong( shininess, dotNH ); 156 return F * ( G * D ); 157} 158#if defined( USE_SHEEN ) 159float D_Charlie( float roughness, float dotNH ) { 160 float alpha = pow2( roughness ); 161 float invAlpha = 1.0 / alpha; 162 float cos2h = dotNH * dotNH; 163 float sin2h = max( 1.0 - cos2h, 0.0078125 ); 164 return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); 165} 166float V_Neubelt( float dotNV, float dotNL ) { 167 return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); 168} 169vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { 170 vec3 halfDir = normalize( lightDir + viewDir ); 171 float dotNL = saturate( dot( normal, lightDir ) ); 172 float dotNV = saturate( dot( normal, viewDir ) ); 173 float dotNH = saturate( dot( normal, halfDir ) ); 174 float D = D_Charlie( sheenRoughness, dotNH ); 175 float V = V_Neubelt( dotNV, dotNL ); 176 return sheenColor * ( D * V ); 177} 178#endif`,$M=`#ifdef USE_BUMPMAP 179 uniform sampler2D bumpMap; 180 uniform float bumpScale; 181 vec2 dHdxy_fwd() { 182 vec2 dSTdx = dFdx( vUv ); 183 vec2 dSTdy = dFdy( vUv ); 184 float Hll = bumpScale * texture2D( bumpMap, vUv ).x; 185 float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; 186 float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; 187 return vec2( dBx, dBy ); 188 } 189 vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { 190 vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); 191 vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); 192 vec3 vN = surf_norm; 193 vec3 R1 = cross( vSigmaY, vN ); 194 vec3 R2 = cross( vN, vSigmaX ); 195 float fDet = dot( vSigmaX, R1 ) * faceDirection; 196 vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); 197 return normalize( abs( fDet ) * surf_norm - vGrad ); 198 } 199#endif`,jM=`#if NUM_CLIPPING_PLANES > 0 200 vec4 plane; 201 #pragma unroll_loop_start 202 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 203 plane = clippingPlanes[ i ]; 204 if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; 205 } 206 #pragma unroll_loop_end 207 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 208 bool clipped = true; 209 #pragma unroll_loop_start 210 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 211 plane = clippingPlanes[ i ]; 212 clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; 213 } 214 #pragma unroll_loop_end 215 if ( clipped ) discard; 216 #endif 217#endif`,qM=`#if NUM_CLIPPING_PLANES > 0 218 varying vec3 vClipPosition; 219 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 220#endif`,XM=`#if NUM_CLIPPING_PLANES > 0 221 varying vec3 vClipPosition; 222#endif`,YM=`#if NUM_CLIPPING_PLANES > 0 223 vClipPosition = - mvPosition.xyz; 224#endif`,JM=`#if defined( USE_COLOR_ALPHA ) 225 diffuseColor *= vColor; 226#elif defined( USE_COLOR ) 227 diffuseColor.rgb *= vColor; 228#endif`,ZM=`#if defined( USE_COLOR_ALPHA ) 229 varying vec4 vColor; 230#elif defined( USE_COLOR ) 231 varying vec3 vColor; 232#endif`,KM=`#if defined( USE_COLOR_ALPHA ) 233 varying vec4 vColor; 234#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) 235 varying vec3 vColor; 236#endif`,QM=`#if defined( USE_COLOR_ALPHA ) 237 vColor = vec4( 1.0 ); 238#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) 239 vColor = vec3( 1.0 ); 240#endif 241#ifdef USE_COLOR 242 vColor *= color; 243#endif 244#ifdef USE_INSTANCING_COLOR 245 vColor.xyz *= instanceColor.xyz; 246#endif`,eE=`#define PI 3.141592653589793 247#define PI2 6.283185307179586 248#define PI_HALF 1.5707963267948966 249#define RECIPROCAL_PI 0.3183098861837907 250#define RECIPROCAL_PI2 0.15915494309189535 251#define EPSILON 1e-6 252#ifndef saturate 253#define saturate( a ) clamp( a, 0.0, 1.0 ) 254#endif 255#define whiteComplement( a ) ( 1.0 - saturate( a ) ) 256float pow2( const in float x ) { return x*x; } 257float pow3( const in float x ) { return x*x*x; } 258float pow4( const in float x ) { float x2 = x*x; return x2*x2; } 259float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } 260float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } 261highp float rand( const in vec2 uv ) { 262 const highp float a = 12.9898, b = 78.233, c = 43758.5453; 263 highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); 264 return fract( sin( sn ) * c ); 265} 266#ifdef HIGH_PRECISION 267 float precisionSafeLength( vec3 v ) { return length( v ); } 268#else 269 float precisionSafeLength( vec3 v ) { 270 float maxComponent = max3( abs( v ) ); 271 return length( v / maxComponent ) * maxComponent; 272 } 273#endif 274struct IncidentLight { 275 vec3 color; 276 vec3 direction; 277 bool visible; 278}; 279struct ReflectedLight { 280 vec3 directDiffuse; 281 vec3 directSpecular; 282 vec3 indirectDiffuse; 283 vec3 indirectSpecular; 284}; 285struct GeometricContext { 286 vec3 position; 287 vec3 normal; 288 vec3 viewDir; 289#ifdef USE_CLEARCOAT 290 vec3 clearcoatNormal; 291#endif 292}; 293vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 294 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 295} 296vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { 297 return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); 298} 299mat3 transposeMat3( const in mat3 m ) { 300 mat3 tmp; 301 tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); 302 tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); 303 tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); 304 return tmp; 305} 306float linearToRelativeLuminance( const in vec3 color ) { 307 vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); 308 return dot( weights, color.rgb ); 309} 310bool isPerspectiveMatrix( mat4 m ) { 311 return m[ 2 ][ 3 ] == - 1.0; 312} 313vec2 equirectUv( in vec3 dir ) { 314 float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; 315 float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; 316 return vec2( u, v ); 317}`,tE=`#ifdef ENVMAP_TYPE_CUBE_UV 318 #define cubeUV_maxMipLevel 8.0 319 #define cubeUV_minMipLevel 4.0 320 #define cubeUV_maxTileSize 256.0 321 #define cubeUV_minTileSize 16.0 322 float getFace( vec3 direction ) { 323 vec3 absDirection = abs( direction ); 324 float face = - 1.0; 325 if ( absDirection.x > absDirection.z ) { 326 if ( absDirection.x > absDirection.y ) 327 face = direction.x > 0.0 ? 0.0 : 3.0; 328 else 329 face = direction.y > 0.0 ? 1.0 : 4.0; 330 } else { 331 if ( absDirection.z > absDirection.y ) 332 face = direction.z > 0.0 ? 2.0 : 5.0; 333 else 334 face = direction.y > 0.0 ? 1.0 : 4.0; 335 } 336 return face; 337 } 338 vec2 getUV( vec3 direction, float face ) { 339 vec2 uv; 340 if ( face == 0.0 ) { 341 uv = vec2( direction.z, direction.y ) / abs( direction.x ); 342 } else if ( face == 1.0 ) { 343 uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); 344 } else if ( face == 2.0 ) { 345 uv = vec2( - direction.x, direction.y ) / abs( direction.z ); 346 } else if ( face == 3.0 ) { 347 uv = vec2( - direction.z, direction.y ) / abs( direction.x ); 348 } else if ( face == 4.0 ) { 349 uv = vec2( - direction.x, direction.z ) / abs( direction.y ); 350 } else { 351 uv = vec2( direction.x, direction.y ) / abs( direction.z ); 352 } 353 return 0.5 * ( uv + 1.0 ); 354 } 355 vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { 356 float face = getFace( direction ); 357 float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); 358 mipInt = max( mipInt, cubeUV_minMipLevel ); 359 float faceSize = exp2( mipInt ); 360 float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); 361 vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ) + 0.5; 362 if ( face > 2.0 ) { 363 uv.y += faceSize; 364 face -= 3.0; 365 } 366 uv.x += face * faceSize; 367 if ( mipInt < cubeUV_maxMipLevel ) { 368 uv.y += 2.0 * cubeUV_maxTileSize; 369 } 370 uv.y += filterInt * 2.0 * cubeUV_minTileSize; 371 uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); 372 uv *= texelSize; 373 return texture2D( envMap, uv ).rgb; 374 } 375 #define r0 1.0 376 #define v0 0.339 377 #define m0 - 2.0 378 #define r1 0.8 379 #define v1 0.276 380 #define m1 - 1.0 381 #define r4 0.4 382 #define v4 0.046 383 #define m4 2.0 384 #define r5 0.305 385 #define v5 0.016 386 #define m5 3.0 387 #define r6 0.21 388 #define v6 0.0038 389 #define m6 4.0 390 float roughnessToMip( float roughness ) { 391 float mip = 0.0; 392 if ( roughness >= r1 ) { 393 mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; 394 } else if ( roughness >= r4 ) { 395 mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; 396 } else if ( roughness >= r5 ) { 397 mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; 398 } else if ( roughness >= r6 ) { 399 mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; 400 } else { 401 mip = - 2.0 * log2( 1.16 * roughness ); } 402 return mip; 403 } 404 vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { 405 float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); 406 float mipF = fract( mip ); 407 float mipInt = floor( mip ); 408 vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); 409 if ( mipF == 0.0 ) { 410 return vec4( color0, 1.0 ); 411 } else { 412 vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); 413 return vec4( mix( color0, color1, mipF ), 1.0 ); 414 } 415 } 416#endif`,nE=`vec3 transformedNormal = objectNormal; 417#ifdef USE_INSTANCING 418 mat3 m = mat3( instanceMatrix ); 419 transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); 420 transformedNormal = m * transformedNormal; 421#endif 422transformedNormal = normalMatrix * transformedNormal; 423#ifdef FLIP_SIDED 424 transformedNormal = - transformedNormal; 425#endif 426#ifdef USE_TANGENT 427 vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; 428 #ifdef FLIP_SIDED 429 transformedTangent = - transformedTangent; 430 #endif 431#endif`,rE=`#ifdef USE_DISPLACEMENTMAP 432 uniform sampler2D displacementMap; 433 uniform float displacementScale; 434 uniform float displacementBias; 435#endif`,iE=`#ifdef USE_DISPLACEMENTMAP 436 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + dis
436placementBias ); 437#endif`,sE=`#ifdef USE_EMISSIVEMAP 438 vec4 emissiveColor = texture2D( emissiveMap, vUv ); 439 totalEmissiveRadiance *= emissiveColor.rgb; 440#endif`,oE=`#ifdef USE_EMISSIVEMAP 441 uniform sampler2D emissiveMap; 442#endif`,aE="gl_FragColor = linearToOutputTexel( gl_FragColor );",lE=`vec4 LinearToLinear( in vec4 value ) { 443 return value; 444} 445vec4 LinearTosRGB( in vec4 value ) { 446 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 ); 447}`,cE=`#ifdef USE_ENVMAP 448 #ifdef ENV_WORLDPOS 449 vec3 cameraToFrag; 450 if ( isOrthographic ) { 451 cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 452 } else { 453 cameraToFrag = normalize( vWorldPosition - cameraPosition ); 454 } 455 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 456 #ifdef ENVMAP_MODE_REFLECTION 457 vec3 reflectVec = reflect( cameraToFrag, worldNormal ); 458 #else 459 vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); 460 #endif 461 #else 462 vec3 reflectVec = vReflect; 463 #endif 464 #ifdef ENVMAP_TYPE_CUBE 465 vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); 466 #elif defined( ENVMAP_TYPE_CUBE_UV ) 467 vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); 468 #else 469 vec4 envColor = vec4( 0.0 ); 470 #endif 471 #ifdef ENVMAP_BLENDING_MULTIPLY 472 outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); 473 #elif defined( ENVMAP_BLENDING_MIX ) 474 outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); 475 #elif defined( ENVMAP_BLENDING_ADD ) 476 outgoingLight += envColor.xyz * specularStrength * reflectivity; 477 #endif 478#endif`,uE=`#ifdef USE_ENVMAP 479 uniform float envMapIntensity; 480 uniform float flipEnvMap; 481 #ifdef ENVMAP_TYPE_CUBE 482 uniform samplerCube envMap; 483 #else 484 uniform sampler2D envMap; 485 #endif 486 487#endif`,fE=`#ifdef USE_ENVMAP 488 uniform float reflectivity; 489 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) 490 #define ENV_WORLDPOS 491 #endif 492 #ifdef ENV_WORLDPOS 493 varying vec3 vWorldPosition; 494 uniform float refractionRatio; 495 #else 496 varying vec3 vReflect; 497 #endif 498#endif`,dE=`#ifdef USE_ENVMAP 499 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) 500 #define ENV_WORLDPOS 501 #endif 502 #ifdef ENV_WORLDPOS 503 504 varying vec3 vWorldPosition; 505 #else 506 varying vec3 vReflect; 507 uniform float refractionRatio; 508 #endif 509#endif`,hE=`#ifdef USE_ENVMAP 510 #ifdef ENV_WORLDPOS 511 vWorldPosition = worldPosition.xyz; 512 #else 513 vec3 cameraToVertex; 514 if ( isOrthographic ) { 515 cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 516 } else {
517 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); 518 } 519 vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 520 #ifdef ENVMAP_MODE_REFLECTION 521 vReflect = reflect( cameraToVertex, worldNormal ); 522 #else 523 vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); 524 #endif 525 #endif 526#endif`,pE=`#ifdef USE_FOG 527 vFogDepth = - mvPosition.z; 528#endif`,mE=`#ifdef USE_FOG 529 varying float vFogDepth; 530#endif`,gE=`#ifdef USE_FOG 531 #ifdef FOG_EXP2 532 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); 533 #else 534 float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); 535 #endif 536 gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); 537#endif`,yE=`#ifdef USE_FOG 538 uniform vec3 fogColor; 539 varying float vFogDepth; 540 #ifdef FOG_EXP2 541 uniform float fogDensity; 542 #else 543 uniform float fogNear; 544 uniform float fogFar; 545 #endif 546#endif`,vE=`#ifdef USE_GRADIENTMAP 547 uniform sampler2D gradientMap; 548#endif 549vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 550 float dotNL = dot( normal, lightDirection ); 551 vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); 552 #ifdef USE_GRADIENTMAP 553 return vec3( texture2D( gradientMap, coord ).r ); 554 #else 555 return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); 556 #endif 557}`,xE=`#ifdef USE_LIGHTMAP 558 vec4 lightMapTexel = texture2D( lightMap, vUv2 ); 559 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 560 #ifndef PHYSICALLY_CORRECT_LIGHTS 561 lightMapIrradiance *= PI; 562 #endif 563 reflectedLight.indirectDiffuse += lightMapIrradiance; 564#endif`,_E=`#ifdef USE_LIGHTMAP 565 uniform sampler2D lightMap; 566 uniform float lightMapIntensity; 567#endif`,bE=`vec3 diffuse = vec3( 1.0 ); 568GeometricContext geometry; 569geometry.position = mvPosition.xyz; 570geometry.normal = normalize( transformedNormal ); 571geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); 572GeometricContext backGeometry; 573backGeometry.position = geometry.position; 574backGeometry.normal = -geometry.normal; 575backGeometry.viewDir = geometry.viewDir; 576vLightFront = vec3( 0.0 ); 577vIndirectFront = vec3( 0.0 ); 578#ifdef DOUBLE_SIDED 579 vLightBack = vec3( 0.0 ); 580 vIndirectBack = vec3( 0.0 ); 581#endif 582IncidentLight directLight; 583float dotNL; 584vec3 directLightColor_Diffuse; 585vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); 586vIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal ); 587#ifdef DOUBLE_SIDED 588 vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); 589 vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal ); 590#endif 591#if NUM_POINT_LIGHTS > 0 592 #pragma unroll_loop_start 593 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 594 getPointLightInfo( pointLights[ i ], geometry, directLight ); 595 dotNL = dot( geometry.normal, directLight.direction ); 596 directLightColor_Diffuse = directLight.color; 597 vLightFront += saturate( dotNL ) * directLightColor_Diffuse; 598 #ifdef DOUBLE_SIDED 599 vLightBack += saturate( - dotNL ) * directLightColor_Diffuse; 600 #endif 601 } 602 #pragma unroll_loop_end 603#endif 604#if NUM_SPOT_LIGHTS > 0 605 #pragma unroll_loop_start 606 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 607 getSpotLightInfo( spotLights[ i ], geometry, directLight ); 608 dotNL = dot( geometry.normal, directLight.direction ); 609 directLightColor_Diffuse = directLight.color; 610 vLightFront += saturate( dotNL ) * directLightColor_Diffuse; 611 #ifdef DOUBLE_SIDED 612 vLightBack += saturate( - dotNL ) * directLightColor_Diffuse; 613 #endif 614 } 615 #pragma unroll_loop_end 616#endif 617#if NUM_DIR_LIGHTS > 0 618 #pragma unroll_loop_start 619 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 620 getDirectionalLightInfo( directionalLights[ i ], geometry, directLight ); 621 dotNL = dot( geometry.normal, directLight.direction ); 622 directLightColor_Diffuse = directLight.color; 623 vLightFront += saturate( dotNL ) * directLightColor_Diffuse; 624 #ifdef DOUBLE_SIDED 625 vLightBack += saturate( - dotNL ) * directLightColor_Diffuse; 626 #endif 627 } 628 #pragma unroll_loop_end 629#endif 630#if NUM_HEMI_LIGHTS > 0 631 #pragma unroll_loop_start 632 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 633 vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal ); 634 #ifdef DOUBLE_SIDED 635 vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal ); 636 #endif 637 } 638 #pragma unroll_loop_end 639#endif`,wE=`uniform bool receiveShadow; 640uniform vec3 ambientLightColor; 641uniform vec3 lightProbe[ 9 ]; 642vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { 643 float x = normal.x, y = normal.y, z = normal.z; 644 vec3 result = shCoefficients[ 0 ] * 0.886227; 645 result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; 646 result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; 647 result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; 648 result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; 649 result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; 650 result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); 651 result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; 652 result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); 653 return result; 654} 655vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { 656 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 657 vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); 658 return irradiance; 659} 660vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { 661 vec3 irradiance = ambientLightColor; 662 return irradiance; 663} 664float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { 665 #if defined ( PHYSICALLY_CORRECT_LIGHTS ) 666 float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); 667 if ( cutoffDistance > 0.0 ) { 668 distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); 669 } 670 return distanceFalloff; 671 #else 672 if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { 673 return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); 674 } 675 return 1.0; 676 #endif 677} 678float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { 679 return smoothstep( coneCosine, penumbraCosine, angleCosine ); 680} 681#if NUM_DIR_LIGHTS > 0 682 struct DirectionalLight { 683 vec3 direction; 684 vec3 color; 685 }; 686 uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; 687 void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) { 688 light.color = directionalLight.color; 689 light.direction = directionalLight.direction; 690 light.visible = true; 691 } 692#endif 693#if NUM_POINT_LIGHTS > 0 694 struct PointLight { 695 vec3 position; 696 vec3 color; 697 float distance; 698 float decay; 699 }; 700 uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; 701 void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) { 702 vec3 lVector = pointLight.position - geometry.position; 703 light.direction = normalize( lVector ); 704 float lightDistance = length( lVector ); 705 light.color = pointLight.color; 706 light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); 707 light.visible = ( light.color != vec3( 0.0 ) ); 708 } 709#endif
710#if NUM_SPOT_LIGHTS > 0 711 struct SpotLight { 712 vec3 position; 713 vec3 direction; 714 vec3 color; 715 float distance; 716 float decay; 717 float coneCos; 718 float penumbraCos; 719 }; 720 uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; 721 void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) { 722 vec3 lVector = spotLight.position - geometry.position; 723 light.direction = normalize( lVector ); 724 float angleCos = dot( light.direction, spotLight.direction ); 725 float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); 726 if ( spotAttenuation > 0.0 ) { 727 float lightDistance = length( lVector ); 728 light.color = spotLight.color * spotAttenuation; 729 light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); 730 light.visible = ( light.color != vec3( 0.0 ) ); 731 } else { 732 light.color = vec3( 0.0 ); 733 light.visible = false; 734 } 735 } 736#endif 737#if NUM_RECT_AREA_LIGHTS > 0 738 struct RectAreaLight { 739 vec3 color; 740 vec3 position; 741 vec3 halfWidth; 742 vec3 halfHeight; 743 }; 744 uniform sampler2D ltc_1; uniform sampler2D ltc_2; 745 uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; 746#endif 747#if NUM_HEMI_LIGHTS > 0 748 struct HemisphereLight { 749 vec3 direction; 750 vec3 skyColor; 751 vec3 groundColor; 752 }; 753 uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; 754 vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { 755 float dotNL = dot( normal, hemiLight.direction ); 756 float hemiDiffuseWeight = 0.5 * dotNL + 0.5; 757 vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); 758 return irradiance; 759 } 760#endif`,SE=`#if defined( USE_ENVMAP ) 761 #ifdef ENVMAP_MODE_REFRACTION 762 uniform float refractionRatio; 763 #endif 764 vec3 getIBLIrradiance( const in vec3 normal ) { 765 #if defined( ENVMAP_TYPE_CUBE_UV ) 766 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 767 vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); 768 return PI * envMapColor.rgb * envMapIntensity; 769 #else 770 return vec3( 0.0 ); 771 #endif 772 } 773 vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { 774 #if defined( ENVMAP_TYPE_CUBE_UV ) 775 vec3 reflectVec; 776 #ifdef ENVMAP_MODE_REFLECTION 777 reflectVec = reflect( - viewDir, normal ); 778 reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); 779 #else 780 reflectVec = refract( - viewDir, normal, refractionRatio ); 781 #endif 782 reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); 783 vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); 784 return envMapColor.rgb * envMapIntensity; 785 #else 786 return vec3( 0.0 ); 787 #endif 788 } 789#endif`,ME=`ToonMaterial material; 790material.diffuseColor = diffuseColor.rgb;`,EE=`varying vec3 vViewPosition; 791struct ToonMaterial { 792 vec3 diffuseColor; 793}; 794void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 795 vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; 796 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 797} 798void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 799 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 800} 801#define RE_Direct RE_Direct_Toon 802#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon 803#define Material_LightProbeLOD( material ) (0)`,TE=`BlinnPhongMaterial material; 804material.diffuseColor = diffuseColor.rgb; 805material.specularColor = specular; 806material.specularShininess = shininess; 807material.specularStrength = specularStrength;`,AE=`varying vec3 vViewPosition; 808struct BlinnPhongMaterial { 809 vec3 diffuseColor; 810 vec3 specularColor; 811 float specularShininess; 812 float specularStrength; 813}; 814void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
815 float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); 816 vec3 irradiance = dotNL * directLight.color; 817 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 818 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength; 819} 820void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { 821 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 822} 823#define RE_Direct RE_Direct_BlinnPhong 824#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong 825#define Material_LightProbeLOD( material ) (0)`,RE=`PhysicalMaterial material; 826material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); 827vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); 828float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); 829material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; 830material.roughness = min( material.roughness, 1.0 ); 831#ifdef IOR 832 #ifdef SPECULAR 833 float specularIntensityFactor = specularIntensity; 834 vec3 specularColorFactor = specularColor; 835 #ifdef USE_SPECULARINTENSITYMAP 836 specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; 837 #endif 838 #ifdef USE_SPECULARCOLORMAP 839 specularColorFactor *= texture2D( specularColorMap, vUv ).rgb; 840 #endif 841 material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); 842 #else 843 float specularIntensityFactor = 1.0; 844 vec3 specularColorFactor = vec3( 1.0 ); 845 material.specularF90 = 1.0; 846 #endif 847 material.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); 848#else 849 material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); 850 material.specularF90 = 1.0; 851#endif 852#ifdef USE_CLEARCOAT 853 material.clearcoat = clearcoat; 854 material.clearcoatRoughness = clearcoatRoughness; 855 material.clearcoatF0 = vec3( 0.04 ); 856 material.clearcoatF90 = 1.0; 857 #ifdef USE_CLEARCOATMAP 858 material.clearcoat *= texture2D( clearcoatMap, vUv ).x; 859 #endif 860 #ifdef USE_CLEARCOAT_ROUGHNESSMAP 861 material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; 862 #endif 863 material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); 864 material.clearcoatRoughness += geometryRoughness; 865 material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); 866#endif 867#ifdef USE_SHEEN 868 material.sheenColor = sheenColor; 869 #ifdef USE_SHEENCOLORMAP 870 material.sheenColor *= texture2D( sheenColorMap, vUv ).rgb; 871 #endif 872 material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); 873 #ifdef USE_SHEENROUGHNESSMAP 874 material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a; 875 #endif 876#endif`,CE=`struct PhysicalMaterial { 877 vec3 diffuseColor; 878 float roughness; 879 vec3 specularColor; 880 float specularF90; 881 #ifdef USE_CLEARCOAT 882 float clearcoat; 883 float clearcoatRoughness; 884 vec3 clearcoatF0; 885 float clearcoatF90; 886 #endif 887 #ifdef USE_SHEEN 888 vec3 sheenColor; 889 float sheenRoughness; 890 #endif 891}; 892vec3 clearcoatSpecular = vec3( 0.0 ); 893vec3 sheenSpecular = vec3( 0.0 ); 894float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness) { 895 float dotNV = saturate( dot( normal, viewDir ) ); 896 float r2 = roughness * roughness; 897 float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; 898 float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; 899 float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); 900 return saturate( DG * RECIPROCAL_PI ); 901} 902vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 903 float dotNV = saturate( dot( normal, viewDir ) ); 904 const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); 905 const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); 906 vec4 r = roughness * c0 + c1; 907 float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; 908 vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; 909 return fab; 910} 911vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
912 vec2 fab = DFGApprox( normal, viewDir, roughness ); 913 return specularColor * fab.x + specularF90 * fab.y; 914} 915void 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 ) { 916 vec2 fab = DFGApprox( normal, viewDir, roughness ); 917 vec3 FssEss = specularColor * fab.x + specularF90 * fab.y; 918 float Ess = fab.x + fab.y; 919 float Ems = 1.0 - Ess; 920 vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); 921 singleScatter += FssEss; 922 multiScatter += Fms * Ems; 923} 924#if NUM_RECT_AREA_LIGHTS > 0 925 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 926 vec3 normal = geometry.normal; 927 vec3 viewDir = geometry.viewDir; 928 vec3 position = geometry.position; 929 vec3 lightPos = rectAreaLight.position; 930 vec3 halfWidth = rectAreaLight.halfWidth; 931 vec3 halfHeight = rectAreaLight.halfHeight; 932 vec3 lightColor = rectAreaLight.color; 933 float roughness = material.roughness; 934 vec3 rectCoords[ 4 ]; 935 rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; 936 rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; 937 rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; 938 vec2 uv = LTC_Uv( normal, viewDir, roughness ); 939 vec4 t1 = texture2D( ltc_1, uv ); 940 vec4 t2 = texture2D( ltc_2, uv ); 941 mat3 mInv = mat3( 942 vec3( t1.x, 0, t1.y ), 943 vec3( 0, 1, 0 ), 944 vec3( t1.z, 0, t1.w ) 945 ); 946 vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); 947 reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); 948 reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); 949 } 950#endif 951void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 952 float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); 953 vec3 irradiance = dotNL * directLight.color; 954 #ifdef USE_CLEARCOAT 955 float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); 956 vec3 ccIrradiance = dotNLcc * directLight.color; 957 clearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 958 #endif 959 #ifdef USE_SHEEN 960 sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness ); 961 #endif 962 reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness ); 963 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 964} 965void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 966 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 967} 968void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { 969 #ifdef USE_CLEARCOAT 970 clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 971 #endif 972 #ifdef USE_SHEEN 973 sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness ); 974 #endif 975 vec3 singleScattering = vec3( 0.0 ); 976 vec3 multiScattering = vec3( 0.0 ); 977 vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; 978 computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); 979 vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); 980 reflectedLight.indirectSpecular += radiance * singleScattering; 981 reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; 982 reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; 983} 984#define RE_Direct RE_Direct_Physical 985#define RE_Direct_RectArea RE_Direct_RectArea_Physical 986#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical 987#define RE_IndirectSpecular RE_IndirectSpecular_Physical
988float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { 989 return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); 990}`,PE=` 991GeometricContext geometry; 992geometry.position = - vViewPosition; 993geometry.normal = normal; 994geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); 995#ifdef USE_CLEARCOAT 996 geometry.clearcoatNormal = clearcoatNormal; 997#endif 998IncidentLight directLight; 999#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) 1000 PointLight pointLight; 1001 #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 1002 PointLightShadow pointLightShadow; 1003 #endif 1004 #pragma unroll_loop_start 1005 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 1006 pointLight = pointLights[ i ]; 1007 getPointLightInfo( pointLight, geometry, directLight ); 1008 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) 1009 pointLightShadow = pointLightShadows[ i ]; 1010 directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; 1011 #endif 1012 RE_Direct( directLight, geometry, material, reflectedLight ); 1013 } 1014 #pragma unroll_loop_end 1015#endif 1016#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) 1017 SpotLight spotLight; 1018 #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 1019 SpotLightShadow spotLightShadow; 1020 #endif 1021 #pragma unroll_loop_start 1022 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 1023 spotLight = spotLights[ i ]; 1024 getSpotLightInfo( spotLight, geometry, directLight ); 1025 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1026 spotLightShadow = spotLightShadows[ i ]; 1027 directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; 1028 #endif 1029 RE_Direct( directLight, geometry, material, reflectedLight ); 1030 } 1031 #pragma unroll_loop_end 1032#endif 1033#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) 1034 DirectionalLight directionalLight; 1035 #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 1036 DirectionalLightShadow directionalLightShadow; 1037 #endif 1038 #pragma unroll_loop_start 1039 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 1040 directionalLight = directionalLights[ i ]; 1041 getDirectionalLightInfo( directionalLight, geometry, directLight ); 1042 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) 1043 directionalLightShadow = directionalLightShadows[ i ]; 1044 directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1045 #endif 1046 RE_Direct( directLight, geometry, material, reflectedLight ); 1047 } 1048 #pragma unroll_loop_end 1049#endif 1050#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) 1051 RectAreaLight rectAreaLight; 1052 #pragma unroll_loop_start 1053 for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { 1054 rectAreaLight = rectAreaLights[ i ]; 1055 RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); 1056 } 1057 #pragma unroll_loop_end 1058#endif 1059#if defined( RE_IndirectDiffuse ) 1060 vec3 iblIrradiance = vec3( 0.0 ); 1061 vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); 1062 irradiance += getLightProbeIrradiance( lightProbe, geometry.normal ); 1063 #if ( NUM_HEMI_LIGHTS > 0 ) 1064 #pragma unroll_loop_start 1065 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 1066 irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal ); 1067 } 1068 #pragma unroll_loop_end 1069 #endif 1070#endif 1071#if defined( RE_IndirectSpecular ) 1072 vec3 radiance = vec3( 0.0 ); 1073 vec3 clearcoatRadiance = vec3( 0.0 ); 1074#endif`,LE=`#if defined( RE_IndirectDiffuse ) 1075 #ifdef USE_LIGHTMAP 1076 vec4 lightMapTexel = texture2D( lightMap, vUv2 ); 1077 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 1078 #ifndef PHYSICALLY_CORRECT_LIGHTS 1079 lightMapIrradiance *= PI; 1080 #endif 1081 irradiance += lightMapIrradiance; 1082 #endif 1083 #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) 1084 iblIrradiance += getIBLIrradiance( geometry.normal ); 1085 #endif 1086#endif 1087#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) 1088 radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness ); 1089 #ifdef USE_CLEARCOAT 1090 clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness ); 1091 #endif 1092#endif`,IE=`#if defined( RE_IndirectDiffuse ) 1093 RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); 1094#endif 1095#if defined( RE_IndirectSpecular ) 1096 RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); 1097#endif`,DE=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) 1098 gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 1099#endif`,OE=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) 1100 uniform float logDepthBufFC; 1101 varying float vFragDepth; 1102 varying float vIsPerspective; 1103#endif`,FE=`#ifdef USE_LOGDEPTHBUF 1104 #ifdef USE_LOGDEPTHBUF_EXT 1105 varying float vFragDepth; 1106 varying float vIsPerspective; 1107 #else 1108 uniform float logDepthBufFC; 1109 #endif 1110#endif`,BE=`#ifdef USE_LOGDEPTHBUF 1111 #ifdef USE_LOGDEPTHBUF_EXT 1112 vFragDepth = 1.0 + gl_Position.w; 1113 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 1114 #else 1115 if ( isPerspectiveMatrix( projectionMatrix ) ) { 1116 gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; 1117 gl_Position.z *= gl_Position.w; 1118 } 1119 #endif 1120#endif`,zE=`#ifdef USE_MAP 1121 vec4 sampledDiffuseColor = texture2D( map, vUv ); 1122 #ifdef DECODE_VIDEO_TEXTURE 1123 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 ); 1124 #endif 1125 diffuseColor *= sampledDiffuseColor; 1126#endif`,NE=`#ifdef USE_MAP 1127 uniform sampler2D map; 1128#endif`,kE=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1129 vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; 1130#endif 1131#ifdef USE_MAP 1132 diffuseColor *= texture2D( map, uv ); 1133#endif 1134#ifdef USE_ALPHAMAP 1135 diffuseColor.a *= texture2D( alphaMap, uv ).g; 1136#endif`,UE=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1137 uniform mat3 uvTransform; 1138#endif 1139#ifdef USE_MAP 1140 uniform sampler2D map; 1141#endif 1142#ifdef USE_ALPHAMAP 1143 uniform sampler2D alphaMap; 1144#endif`,HE=`float metalnessFactor = metalness; 1145#ifdef USE_METALNESSMAP 1146 vec4 texelMetalness = texture2D( metalnessMap, vUv ); 1147 metalnessFactor *= texelMetalness.b; 1148#endif`,GE=`#ifdef USE_METALNESSMAP 1149 uniform sampler2D metalnessMap; 1150#endif`,VE=`#ifdef USE_MORPHNORMALS 1151 objectNormal *= morphTargetBaseInfluence; 1152 #ifdef MORPHTARGETS_TEXTURE 1153 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1154 if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ]; 1155 } 1156 #else 1157 objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; 1158 objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; 1159 objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; 1160 objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; 1161 #endif 1162#endif`,WE=`#ifdef USE_MORPHTARGETS 1163 uniform float morphTargetBaseInfluence; 1164 #ifdef MORPHTARGETS_TEXTURE 1165 uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1166 uniform sampler2DArray morphTargetsTexture; 1167 uniform vec2 morphTargetsTextureSize; 1168 vec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) { 1169 float texelIndex = float( vertexIndex * stride + offset ); 1170 float y = floor( texelIndex / morphTargetsTextureSize.x ); 1171 float x = texelIndex - y * morphTargetsTextureSize.x; 1172 vec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex ); 1173 return texture( morphTargetsTexture, morphUV ).xyz; 1174 } 1175 #else 1176 #ifndef USE_MORPHNORMALS 1177 uniform float morphTargetInfluences[ 8 ]; 1178 #else 1179 uniform float morphTargetInfluences[ 4 ]; 1180 #endif 1181 #endif 1182#endif`,$E=`#ifdef USE_MORPHTARGETS 1183 transformed *= morphTargetBaseInfluence; 1184 #ifdef MORPHTARGETS_TEXTURE 1185 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1186 #ifndef USE_MORPHNORMALS 1187 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ]; 1188 #else 1189 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ]; 1190 #endif 1191 } 1192 #else 1193 transformed += morphTarget0 * morphTargetInfluences[ 0 ]; 1194 transformed += morphTarget1 * morphTargetInfluences[ 1 ]; 1195 transformed += morphTarget2 * morphTargetInfluences[ 2 ]; 1196 transformed += morphTarget3 * morphTargetInfluences[ 3 ]; 1197 #ifndef USE_MORPHNORMALS 1198 transformed += morphTarget4 * morphTargetInfluences[ 4 ]; 1199 transformed += morphTarget5 * morphTargetInfluences[ 5 ]; 1200 transformed += morphTarget6 * morphTargetInfluences[ 6 ]; 1201 transformed += morphTarget7 * morphTargetInfluences[ 7 ]; 1202 #endif 1203 #endif 1204#endif`,jE=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; 1205#ifdef FLAT_SHADED 1206 vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); 1207 vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); 1208 vec3 normal = normalize( cross( fdx, fdy ) ); 1209#else 1210 vec3 normal = normalize( vNormal ); 1211 #ifdef DOUBLE_SIDED 1212 normal = normal * faceDirection; 1213 #endif 1214 #ifdef USE_TANGENT 1215 vec3 tangent = normalize( vTangent ); 1216 vec3 bitangent = normalize( vBitangent ); 1217 #ifdef DOUBLE_SIDED 1218 tangent = tangent * faceDirection; 1219 bitangent = bitangent * faceDirection; 1220 #endif 1221 #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) 1222 mat3 vTBN = mat3( tangent, bitangent, normal ); 1223 #endif 1224 #endif 1225#endif 1226vec3 geometryNormal = normal;`,qE=`#ifdef OBJECTSPACE_NORMALMAP 1227 normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; 1228 #ifdef FLIP_SIDED 1229 normal = - normal; 1230 #endif 1231 #ifdef DOUBLE_SIDED 1232 normal = normal * faceDirection; 1233 #endif 1234 normal = normalize( normalMatrix * normal ); 1235#elif defined( TANGENTSPACE_NORMALMAP ) 1236 vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; 1237 mapN.xy *= normalScale; 1238 #ifdef USE_TANGENT 1239 normal = normalize( vTBN * mapN ); 1240 #else
1241 normal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection ); 1242 #endif 1243#elif defined( USE_BUMPMAP ) 1244 normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); 1245#endif`,XE=`#ifndef FLAT_SHADED 1246 varying vec3 vNormal; 1247 #ifdef USE_TANGENT 1248 varying vec3 vTangent; 1249 varying vec3 vBitangent; 1250 #endif 1251#endif`,YE=`#ifndef FLAT_SHADED 1252 varying vec3 vNormal; 1253 #ifdef USE_TANGENT 1254 varying vec3 vTangent; 1255 varying vec3 vBitangent; 1256 #endif 1257#endif`,JE=`#ifndef FLAT_SHADED 1258 vNormal = normalize( transformedNormal ); 1259 #ifdef USE_TANGENT 1260 vTangent = normalize( transformedTangent ); 1261 vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); 1262 #endif 1263#endif`,ZE=`#ifdef USE_NORMALMAP 1264 uniform sampler2D normalMap; 1265 uniform vec2 normalScale; 1266#endif 1267#ifdef OBJECTSPACE_NORMALMAP 1268 uniform mat3 normalMatrix; 1269#endif 1270#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) 1271 vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { 1272 vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); 1273 vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); 1274 vec2 st0 = dFdx( vUv.st ); 1275 vec2 st1 = dFdy( vUv.st ); 1276 vec3 N = surf_norm; 1277 vec3 q1perp = cross( q1, N ); 1278 vec3 q0perp = cross( N, q0 ); 1279 vec3 T = q1perp * st0.x + q0perp * st1.x; 1280 vec3 B = q1perp * st0.y + q0perp * st1.y; 1281 float det = max( dot( T, T ), dot( B, B ) ); 1282 float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); 1283 return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); 1284 } 1285#endif`,KE=`#ifdef USE_CLEARCOAT 1286 vec3 clearcoatNormal = geometryNormal; 1287#endif`,QE=`#ifdef USE_CLEARCOAT_NORMALMAP 1288 vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; 1289 clearcoatMapN.xy *= clearcoatNormalScale; 1290 #ifdef USE_TANGENT 1291 clearcoatNormal = normalize( vTBN * clearcoatMapN ); 1292 #else 1293 clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); 1294 #endif 1295#endif`,eT=`#ifdef USE_CLEARCOATMAP 1296 uniform sampler2D clearcoatMap; 1297#endif 1298#ifdef USE_CLEARCOAT_ROUGHNESSMAP 1299 uniform sampler2D clearcoatRoughnessMap; 1300#endif 1301#ifdef USE_CLEARCOAT_NORMALMAP 1302 uniform sampler2D clearcoatNormalMap; 1303 uniform vec2 clearcoatNormalScale; 1304#endif`,tT=`#ifdef OPAQUE 1305diffuseColor.a = 1.0; 1306#endif 1307#ifdef USE_TRANSMISSION 1308diffuseColor.a *= transmissionAlpha + 0.1; 1309#endif 1310gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,nT=`vec3 packNormalToRGB( const in vec3 normal ) { 1311 return normalize( normal ) * 0.5 + 0.5; 1312} 1313vec3 unpackRGBToNormal( const in vec3 rgb ) { 1314 return 2.0 * rgb.xyz - 1.0; 1315} 1316const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; 1317const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); 1318const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); 1319const float ShiftRight8 = 1. / 256.; 1320vec4 packDepthToRGBA( const in float v ) { 1321 vec4 r = vec4( fract( v * PackFactors ), v ); 1322 r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; 1323} 1324float unpackRGBAToDepth( const in vec4 v ) { 1325 return dot( v, UnpackFactors ); 1326} 1327vec4 pack2HalfToRGBA( vec2 v ) { 1328 vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); 1329 return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); 1330} 1331vec2 unpackRGBATo2Half( vec4 v ) { 1332 return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); 1333} 1334float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { 1335 return ( viewZ + near ) / ( near - far ); 1336} 1337float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { 1338 return linearClipZ * ( near - far ) - near; 1339} 1340float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { 1341 return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); 1342} 1343float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { 1344 return ( near * far ) / ( ( far - near ) * invClipZ - far ); 1345}`,rT=`#ifdef PREMULTIPLIED_ALPHA 1346 gl_FragColor.rgb *= gl_FragColor.a; 1347#endif`,iT=`vec4 mvPosition = vec4( transformed, 1.0 ); 1348#ifdef USE_INSTANCING 1349 mvPosition = instanceMatrix * mvPosition; 1350#endif 1351mvPosition = modelViewMatrix * mvPosition; 1352gl_Position = projectionMatrix * mvPosition;`,sT=`#ifdef DITHERING 1353 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 1354#endif`,oT=`#ifdef DITHERING 1355 vec3 dithering( vec3 color ) { 1356 float grid_position = rand( gl_FragCoord.xy ); 1357 vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); 1358 dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); 1359 return color + dither_shift_RGB; 1360 } 1361#endif`,aT=`float roughnessFactor = roughness; 1362#ifdef USE_ROUGHNESSMAP 1363 vec4 texelRoughness = texture2D( roughnessMap, vUv ); 1364 roughnessFactor *= texelRoughness.g; 1365#endif`,lT=`#ifdef USE_ROUGHNESSMAP 1366 uniform sampler2D roughnessMap; 1367#endif`,cT
vendor: 8,456 bytes, lines 1367-1541
1367=`#ifdef USE_SHADOWMAP 1368 #if NUM_DIR_LIGHT_SHADOWS > 0 1369 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1370 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1371 struct DirectionalLightShadow { 1372 float shadowBias; 1373 float shadowNormalBias; 1374 float shadowRadius; 1375 vec2 shadowMapSize; 1376 }; 1377 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1378 #endif 1379 #if NUM_SPOT_LIGHT_SHADOWS > 0 1380 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1381 varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; 1382 struct SpotLightShadow { 1383 float shadowBias; 1384 float shadowNormalBias; 1385 float shadowRadius; 1386 vec2 shadowMapSize; 1387 }; 1388 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1389 #endif 1390 #if NUM_POINT_LIGHT_SHADOWS > 0 1391 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1392 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1393 struct PointLightShadow { 1394 float shadowBias; 1395 float shadowNormalBias; 1396 float shadowRadius; 1397 vec2 shadowMapSize; 1398 float shadowCameraNear; 1399 float shadowCameraFar; 1400 }; 1401 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1402 #endif 1403 float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { 1404 return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); 1405 } 1406 vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { 1407 return unpackRGBATo2Half( texture2D( shadow, uv ) ); 1408 } 1409 float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ 1410 float occlusion = 1.0; 1411 vec2 distribution = texture2DDistribution( shadow, uv ); 1412 float hard_shadow = step( compare , distribution.x ); 1413 if (hard_shadow != 1.0 ) { 1414 float distance = compare - distribution.x ; 1415 float variance = max( 0.00000, distribution.y * distribution.y ); 1416 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 ); 1417 } 1418 return occlusion; 1419 } 1420 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1421 float shadow = 1.0; 1422 shadowCoord.xyz /= shadowCoord.w; 1423 shadowCoord.z += shadowBias; 1424 bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); 1425 bool inFrustum = all( inFrustumVec ); 1426 bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); 1427 bool frustumTest = all( frustumTestVec ); 1428 if ( frustumTest ) { 1429 #if defined( SHADOWMAP_TYPE_PCF ) 1430 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1431 float dx0 = - texelSize.x * shadowRadius; 1432 float dy0 = - texelSize.y * shadowRadius; 1433 float dx1 = + texelSize.x * shadowRadius; 1434 float dy1 = + texelSize.y * shadowRadius; 1435 float dx2 = dx0 / 2.0; 1436 float dy2 = dy0 / 2.0; 1437 float dx3 = dx1 / 2.0; 1438 float dy3 = dy1 / 2.0; 1439 shadow = ( 1440 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + 1441 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + 1442 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + 1443 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + 1444 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + 1445 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + 1446 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + 1447 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + 1448 texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + 1449 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + 1450 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + 1451 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + 1452 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + 1453 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + 1454 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + 1455 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + 1456 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) 1457 ) * ( 1.0 / 17.0 ); 1458 #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) 1459 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1460 float dx = texelSize.x; 1461 float dy = texelSize.y; 1462 vec2 uv = shadowCoord.xy; 1463 vec2 f = fract( uv * shadowMapSize + 0.5 ); 1464 uv -= f * texelSize; 1465 shadow = ( 1466 texture2DCompare( shadowMap, uv, shadowCoord.z ) + 1467 texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + 1468 texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + 1469 texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + 1470 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), 1471 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), 1472 f.x ) + 1473 mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), 1474 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), 1475 f.x ) + 1476 mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), 1477 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), 1478 f.y ) + 1479 mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), 1480 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), 1481 f.y ) + 1482 mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), 1483 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), 1484 f.x ), 1485 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), 1486 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), 1487 f.x ), 1488 f.y ) 1489 ) * ( 1.0 / 9.0 ); 1490 #elif defined( SHADOWMAP_TYPE_VSM ) 1491 shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); 1492 #else 1493 shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); 1494 #endif 1495 } 1496 return shadow; 1497 } 1498 vec2 cubeToUV( vec3 v, float texelSizeY ) { 1499 vec3 absV = abs( v ); 1500 float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); 1501 absV *= scaleToCube; 1502 v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); 1503 vec2 planar = v.xy; 1504 float almostATexel = 1.5 * texelSizeY; 1505 float almostOne = 1.0 - almostATexel; 1506 if ( absV.z >= almostOne ) { 1507 if ( v.z > 0.0 ) 1508 planar.x = 4.0 - v.x; 1509 } else if ( absV.x >= almostOne ) { 1510 float signX = sign( v.x ); 1511 planar.x = v.z * signX + 2.0 * signX; 1512 } else if ( absV.y >= almostOne ) { 1513 float signY = sign( v.y ); 1514 planar.x = v.x + 2.0 * signY + 2.0; 1515 planar.y = v.z * signY - 2.0; 1516 } 1517 return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); 1518 } 1519 float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 1520 vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); 1521 vec3 lightToPosition = shadowCoord.xyz; 1522 float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; 1523 vec3 bd3D = normalize( lightToPosition ); 1524 #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) 1525 vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; 1526 return ( 1527 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + 1528 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + 1529 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + 1530 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + 1531 texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + 1532 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + 1533 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + 1534 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + 1535 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) 1536 ) * ( 1.0 / 9.0 ); 1537 #else 1538 return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); 1539 #endif 1540 } 1541#endif`,
1541uT=`#ifdef USE_SHADOWMAP 1542 #if NUM_DIR_LIGHT_SHADOWS > 0 1543 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; 1544 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1545 struct DirectionalLightShadow { 1546 float shadowBias; 1547 float shadowNormalBias; 1548 float shadowRadius; 1549 vec2 shadowMapSize; 1550 }; 1551 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1552 #endif 1553 #if NUM_SPOT_LIGHT_SHADOWS > 0 1554 uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; 1555 varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; 1556 struct SpotLightShadow { 1557 float shadowBias; 1558 float shadowNormalBias; 1559 float shadowRadius; 1560 vec2 shadowMapSize; 1561 }; 1562 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1563 #endif 1564 #if NUM_POINT_LIGHT_SHADOWS > 0 1565 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; 1566 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1567 struct PointLightShadow { 1568 float shadowBias; 1569 float shadowNormalBias; 1570 float shadowRadius; 1571 vec2 shadowMapSize; 1572 float shadowCameraNear; 1573 float shadowCameraFar; 1574 }; 1575 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1576 #endif 1577#endif`,fT=`#ifdef USE_SHADOWMAP 1578 #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 1579 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 1580 vec4 shadowWorldPosition; 1581 #endif 1582 #if NUM_DIR_LIGHT_SHADOWS > 0 1583 #pragma unroll_loop_start 1584 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 1585 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); 1586 vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; 1587 } 1588 #pragma unroll_loop_end 1589 #endif 1590 #if NUM_SPOT_LIGHT_SHADOWS > 0 1591 #pragma unroll_loop_start 1592 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 1593 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); 1594 vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; 1595 } 1596 #pragma unroll_loop_end 1597 #endif 1598 #if NUM_POINT_LIGHT_SHADOWS > 0 1599 #pragma unroll_loop_start 1600 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 1601 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); 1602 vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; 1603 } 1604 #pragma unroll_loop_end 1605 #endif 1606#endif`,dT=`float getShadowMask() { 1607 float shadow = 1.0; 1608 #ifdef USE_SHADOWMAP 1609 #if NUM_DIR_LIGHT_SHADOWS > 0 1610 DirectionalLightShadow directionalLight; 1611 #pragma unroll_loop_start 1612 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 1613 directionalLight = directionalLightShadows[ i ]; 1614 shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1615 } 1616 #pragma unroll_loop_end 1617 #endif 1618 #if NUM_SPOT_LIGHT_SHADOWS > 0 1619 SpotLightShadow spotLight; 1620 #pragma unroll_loop_start 1621 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 1622 spotLight = spotLightShadows[ i ]; 1623 shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; 1624 } 1625 #pragma unroll_loop_end 1626 #endif 1627 #if NUM_POINT_LIGHT_SHADOWS > 0 1628 PointLightShadow pointLight; 1629 #pragma unroll_loop_start 1630 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 1631 pointLight = pointLightShadows[ i ]; 1632 shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; 1633 } 1634 #pragma unroll_loop_end 1635 #endif 1636 #endif 1637 return shadow; 1638}`,hT=`#ifdef USE_SKINNING 1639 mat4 boneMatX = getBoneMatrix( skinIndex.x ); 1640 mat4 boneMatY = getBoneMatrix( skinIndex.y ); 1641 mat4 boneMatZ = getBoneMatrix( skinIndex.z ); 1642 mat4 boneMatW = getBoneMatrix( skinIndex.w ); 1643#endif`,pT=`#ifdef USE_SKINNING 1644 uniform mat4 bindMatrix; 1645 uniform mat4 bindMatrixInverse; 1646 #ifdef BONE_TEXTURE 1647 uniform highp sampler2D boneTexture; 1648 uniform int boneTextureSize; 1649 mat4 getBoneMatrix( const in float i ) { 1650 float j = i * 4.0; 1651 float x = mod( j, float( boneTextureSize ) ); 1652 float y = floor( j / float( boneTextureSize ) ); 1653 float dx = 1.0 / float( boneTextureSize ); 1654 float dy = 1.0 / float( boneTextureSize ); 1655 y = dy * ( y + 0.5 ); 1656 vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); 1657 vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); 1658 vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); 1659 vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); 1660 mat4 bone = mat4( v1, v2, v3, v4 ); 1661 return bone; 1662 } 1663 #else 1664 uniform mat4 boneMatrices[ MAX_BONES ]; 1665 mat4 getBoneMatrix( const in float i ) { 1666 mat4 bone = boneMatrices[ int(i) ]; 1667 return bone; 1668 } 1669 #endif 1670#endif`,mT=`#ifdef USE_SKINNING 1671 vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); 1672 vec4 skinned = vec4( 0.0 ); 1673 skinned += boneMatX * skinVertex * skinWeight.x; 1674 skinned += boneMatY * skinVertex * skinWeight.y; 1675 skinned += boneMatZ * skinVertex * skinWeight.z; 1676 skinned += boneMatW * skinVertex * skinWeight.w; 1677 transformed = ( bindMatrixInverse * skinned ).xyz; 1678#endif`,gT=`#ifdef USE_SKINNING 1679 mat4 skinMatrix = mat4( 0.0 ); 1680 skinMatrix += skinWeight.x * boneMatX; 1681 skinMatrix += skinWeight.y * boneMatY; 1682 skinMatrix += skinWeight.z * boneMatZ; 1683 skinMatrix += skinWeight.w * boneMatW; 1684 skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; 1685 objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; 1686 #ifdef USE_TANGENT 1687 objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; 1688 #endif 1689#endif`,yT=`float specularStrength; 1690#ifdef USE_SPECULARMAP 1691 vec4 texelSpecular = texture2D( specularMap, vUv ); 1692 specularStrength = texelSpecular.r; 1693#else 1694 specularStrength = 1.0; 1695#endif`,vT=`#ifdef USE_SPECULARMAP 1696 uniform sampler2D specularMap; 1697#endif`,xT=`#if defined( TONE_MAPPING ) 1698 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 1699#endif`,_T=`#ifndef saturate 1700#define saturate( a ) clamp( a, 0.0, 1.0 ) 1701#endif 1702uniform float toneMappingExposure; 1703vec3 LinearToneMapping( vec3 color ) { 1704 return toneMappingExposure * color; 1705} 1706vec3 ReinhardToneMapping( vec3 color ) { 1707 color *= toneMappingExposure; 1708 return saturate( color / ( vec3( 1.0 ) + color ) ); 1709} 1710vec3 OptimizedCineonToneMapping( vec3 color ) { 1711 color *= toneMappingExposure; 1712 color = max( vec3( 0.0 ), color - 0.004 ); 1713 return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); 1714} 1715vec3 RRTAndODTFit( vec3 v ) { 1716 vec3 a = v * ( v + 0.0245786 ) - 0.000090537; 1717 vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; 1718 return a / b; 1719} 1720vec3 ACESFilmicToneMapping( vec3 color ) { 1721 const mat3 ACESInputMat = mat3( 1722 vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), 1723 vec3( 0.04823, 0.01566, 0.83777 ) 1724 ); 1725 const mat3 ACESOutputMat = mat3( 1726 vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), 1727 vec3( -0.07367, -0.00605, 1.07602 ) 1728 ); 1729 color *= toneMappingExposure / 0.6; 1730 color = ACESInputMat * color; 1731 color = RRTAndODTFit( color ); 1732 color = ACESOutputMat * color; 1733 return saturate( color ); 1734} 1735vec3 CustomToneMapping( vec3 color ) { return color; }`,bT=`#ifdef USE_TRANSMISSION 1736 float transmissionAlpha = 1.0; 1737 float transmissionFactor = transmission; 1738 float thicknessFactor = thickness; 1739 #ifdef USE_TRANSMISSIONMAP 1740 transmissionFactor *= texture2D( transmissionMap, vUv ).r; 1741 #endif 1742 #ifdef USE_THICKNESSMAP 1743 thicknessFactor *= texture2D( thicknessMap, vUv ).g;
1744 #endif 1745 vec3 pos = vWorldPosition; 1746 vec3 v = normalize( cameraPosition - pos ); 1747 vec3 n = inverseTransformDirection( normal, viewMatrix ); 1748 vec4 transmission = getIBLVolumeRefraction( 1749 n, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90, 1750 pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, 1751 attenuationColor, attenuationDistance ); 1752 totalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor ); 1753 transmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor ); 1754#endif`,wT=`#ifdef USE_TRANSMISSION 1755 uniform float transmission; 1756 uniform float thickness; 1757 uniform float attenuationDistance; 1758 uniform vec3 attenuationColor; 1759 #ifdef USE_TRANSMISSIONMAP 1760 uniform sampler2D transmissionMap; 1761 #endif 1762 #ifdef USE_THICKNESSMAP 1763 uniform sampler2D thicknessMap; 1764 #endif 1765 uniform vec2 transmissionSamplerSize; 1766 uniform sampler2D transmissionSamplerMap; 1767 uniform mat4 modelMatrix; 1768 uniform mat4 projectionMatrix; 1769 varying vec3 vWorldPosition; 1770 vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { 1771 vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); 1772 vec3 modelScale; 1773 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 1774 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 1775 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 1776 return normalize( refractionVector ) * thickness * modelScale; 1777 } 1778 float applyIorToRoughness( const in float roughness, const in float ior ) { 1779 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 1780 } 1781 vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { 1782 float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 1783 #ifdef TEXTURE_LOD_EXT 1784 return texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod ); 1785 #else 1786 return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod ); 1787 #endif 1788 } 1789 vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { 1790 if ( attenuationDistance == 0.0 ) { 1791 return radiance; 1792 } else { 1793 vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; 1794 vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance * radiance; 1795 } 1796 } 1797 vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, 1798 const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, 1799 const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, 1800 const in vec3 attenuationColor, const in float attenuationDistance ) { 1801 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 1802 vec3 refractedRayExit = position + transmissionRay; 1803 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 1804 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 1805 refractionCoords += 1.0; 1806 refractionCoords /= 2.0; 1807 vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); 1808 vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance ); 1809 vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); 1810 return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a ); 1811 } 1812#endif`,ST=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) 1813 varying vec2 vUv; 1814#endif`,MT=`#ifdef USE_UV 1815 #ifdef UVS_VERTEX_ONLY 1816 vec2 vUv; 1817 #else 1818 varying vec2 vUv; 1819 #endif 1820 uniform mat3 uvTransform; 1821#endif`,ET=`#ifdef USE_UV 1822 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 1823#endif`,TT=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) 1824 varying vec2 vUv2; 1825#endif`,AT=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) 1826 attribute vec2 uv2; 1827 varying vec2 vUv2; 1828 uniform mat3 uv2Transform; 1829#endif`,RT=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) 1830 vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; 1831#endif`,CT=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) 1832 vec4 worldPosition = vec4( transformed, 1.0 ); 1833 #ifdef USE_INSTANCING 1834 worldPosition = instanceMatrix * worldPosition; 1835 #endif 1836 worldPosition = modelMatrix * worldPosition; 1837#endif`;const PT=`varying vec2 vUv; 1838uniform mat3 uvTransform; 1839void main() { 1840 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 1841 gl_Position = vec4( position.xy, 1.0, 1.0 ); 1842}`,LT=`uniform sampler2D t2D; 1843varying vec2 vUv; 1844void main() { 1845 gl_FragColor = texture2D( t2D, vUv ); 1846 #include <tonemapping_fragment> 1847 #include <encodings_fragment> 1848}`,IT=`varying vec3 vWorldDirection; 1849#include <common> 1850void main() { 1851 vWorldDirection = transformDirection( position, modelMatrix ); 1852 #include <begin_vertex> 1853 #include <project_vertex> 1854 gl_Position.z = gl_Position.w; 1855}`,DT=`#include <envmap_common_pars_fragment> 1856uniform float opacity; 1857varying vec3 vWorldDirection; 1858#include <cube_uv_reflection_fragment> 1859void main() { 1860 vec3 vReflect = vWorldDirection; 1861 #include <envmap_fragment> 1862 gl_FragColor = envColor; 1863 gl_FragColor.a *= opacity; 1864 #include <tonemapping_fragment> 1865 #include <encodings_fragment> 1866}`,OT=`#include <common> 1867#include <uv_pars_vertex> 1868#include <displacementmap_pars_vertex> 1869#include <morphtarget_pars_vertex> 1870#include <skinning_pars_vertex> 1871#include <logdepthbuf_pars_vertex> 1872#include <clipping_planes_pars_vertex> 1873varying vec2 vHighPrecisionZW; 1874void main() { 1875 #include <uv_vertex> 1876 #include <skinbase_vertex> 1877 #ifdef USE_DISPLACEMENTMAP 1878 #include <beginnormal_vertex> 1879 #include <morphnormal_vertex> 1880 #include <skinnormal_vertex> 1881 #endif 1882 #include <begin_vertex> 1883 #include <morphtarget_vertex> 1884 #include <skinning_vertex> 1885 #include <displacementmap_vertex> 1886 #include <project_vertex> 1887 #include <logdepthbuf_vertex> 1888 #include <clipping_planes_vertex> 1889 vHighPrecisionZW = gl_Position.zw; 1890}`,FT=`#if DEPTH_PACKING == 3200 1891 uniform float opacity; 1892#endif 1893#include <common> 1894#include <packing> 1895#include <uv_pars_fragment> 1896#include <map_pars_fragment> 1897#include <alphamap_pars_fragment> 1898#include <alphatest_pars_fragment> 1899#include <logdepthbuf_pars_fragment> 1900#include <clipping_planes_pars_fragment> 1901varying vec2 vHighPrecisionZW; 1902void main() { 1903 #include <clipping_planes_fragment> 1904 vec4 diffuseColor = vec4( 1.0 ); 1905 #if DEPTH_PACKING == 3200 1906 diffuseColor.a = opacity; 1907 #endif 1908 #include <map_fragment> 1909 #include <alphamap_fragment> 1910 #include <alphatest_fragment> 1911 #include <logdepthbuf_fragment> 1912 float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; 1913 #if DEPTH_PACKING == 3200 1914 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); 1915 #elif DEPTH_PACKING == 3201 1916 gl_FragColor = packDepthToRGBA( fragCoordZ ); 1917 #endif 1918}`,BT=`#define DISTANCE 1919varying vec3 vWorldPosition; 1920#include <common> 1921#include <uv_pars_vertex> 1922#include <displacementmap_pars_vertex> 1923#include <morphtarget_pars_vertex> 1924#include <skinning_pars_vertex> 1925#include <clipping_planes_pars_vertex> 1926void main() { 1927 #include <uv_vertex> 1928 #include <skinbase_vertex> 1929 #ifdef USE_DISPLACEMENTMAP 1930 #include <beginnormal_vertex> 1931 #include <morphnormal_vertex> 1932 #include <skinnormal_vertex> 1933 #endif 1934 #include <begin_vertex> 1935 #include <morphtarget_vertex> 1936 #include <skinning_vertex> 1937 #include <displacementmap_vertex> 1938 #include <project_vertex> 1939 #include <worldpos_vertex> 1940 #include <clipping_planes_vertex> 1941 vWorldPosition = worldPosition.xyz; 1942}`,zT=`#define DISTANCE 1943uniform vec3 referencePosition; 1944uniform float nearDistance; 1945uniform float farDistance; 1946varying vec3 vWorldPosition; 1947#include <common> 1948#include <packing> 1949#include <uv_pars_fragment> 1950#include <map_pars_fragment> 1951#include <alphamap_pars_fragment> 1952#include <alphatest_pars_fragment> 1953#include <clipping_planes_pars_fragment> 1954void main () { 1955 #include <clipping_planes_fragment> 1956 vec4 diffuseColor = vec4( 1.0 ); 1957 #include <map_fragment> 1958 #include <alphamap_fragment> 1959 #include <alphatest_fragment> 1960 float dist = length( vWorldPosition - referencePosition ); 1961 dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); 1962 dist = saturate( dist ); 1963 gl_FragColor = packDepthToRGBA( dist ); 1964}`,NT=`varying vec3 vWorldDirection; 1965#include <common> 1966void main() { 1967 vWorldDirection = transformDirection( position, modelMatrix ); 1968 #include <begin_vertex> 1969 #include <project_vertex> 1970}`,kT=`uniform sampler2D tEquirect; 1971varying vec3 vWorldDirection; 1972#include <common> 1973void main() { 1974 vec3 direction = normalize( vWorldDirection ); 1975 vec2 sampleUV = equirectUv( direction ); 1976 gl_FragColor = texture2D( tEquirect, sampleUV ); 1977 #include <tonemapping_fragment> 1978 #include <encodings_fragment> 1979}`,UT=`uniform float scale; 1980attribute float lineDistance; 1981varying float vLineDistance; 1982#include <common> 1983#include <color_pars_vertex> 1984#include <fog_pars_vertex> 1985#include <morphtarget_pars_vertex> 1986#include <logdepthbuf_pars_vertex> 1987#include <clipping_planes_pars_vertex> 1988void main() { 1989 vLineDistance = scale * lineDistance; 1990 #include <color_vertex> 1991 #include <begin_vertex> 1992 #include <morphtarget_vertex> 1993 #include <project_vertex> 1994 #include <logdepthbuf_vertex> 1995 #include <clipping_planes_vertex> 1996 #include <fog_vertex> 1997}
1997`,HT=`uniform vec3 diffuse; 1998uniform float opacity; 1999uniform float dashSize; 2000uniform float totalSize; 2001varying float vLineDistance; 2002#include <common> 2003#include <color_pars_fragment> 2004#include <fog_pars_fragment> 2005#include <logdepthbuf_pars_fragment> 2006#include <clipping_planes_pars_fragment> 2007void main() { 2008 #include <clipping_planes_fragment> 2009 if ( mod( vLineDistance, totalSize ) > dashSize ) { 2010 discard; 2011 } 2012 vec3 outgoingLight = vec3( 0.0 ); 2013 vec4 diffuseColor = vec4( diffuse, opacity ); 2014 #include <logdepthbuf_fragment> 2015 #include <color_fragment> 2016 outgoingLight = diffuseColor.rgb; 2017 #include <output_fragment> 2018 #include <tonemapping_fragment> 2019 #include <encodings_fragment> 2020 #include <fog_fragment> 2021 #include <premultiplied_alpha_fragment> 2022}`,GT=`#include <common> 2023#include <uv_pars_vertex> 2024#include <uv2_pars_vertex> 2025#include <envmap_pars_vertex> 2026#include <color_pars_vertex> 2027#include <fog_pars_vertex> 2028#include <morphtarget_pars_vertex> 2029#include <skinning_pars_vertex> 2030#include <logdepthbuf_pars_vertex> 2031#include <clipping_planes_pars_vertex> 2032void main() { 2033 #include <uv_vertex> 2034 #include <uv2_vertex> 2035 #include <color_vertex> 2036 #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) 2037 #include <beginnormal_vertex> 2038 #include <morphnormal_vertex> 2039 #include <skinbase_vertex> 2040 #include <skinnormal_vertex> 2041 #include <defaultnormal_vertex> 2042 #endif 2043 #include <begin_vertex> 2044 #include <morphtarget_vertex> 2045 #include <skinning_vertex> 2046 #include <project_vertex> 2047 #include <logdepthbuf_vertex> 2048 #include <clipping_planes_vertex> 2049 #include <worldpos_vertex> 2050 #include <envmap_vertex> 2051 #include <fog_vertex> 2052}`,VT=`uniform vec3 diffuse; 2053uniform float opacity; 2054#ifndef FLAT_SHADED 2055 varying vec3 vNormal; 2056#endif 2057#include <common> 2058#include <dithering_pars_fragment> 2059#include <color_pars_fragment> 2060#include <uv_pars_fragment> 2061#include <uv2_pars_fragment> 2062#include <map_pars_fragment> 2063#include <alphamap_pars_fragment> 2064#include <alphatest_pars_fragment> 2065#include <aomap_pars_fragment> 2066#include <lightmap_pars_fragment> 2067#include <envmap_common_pars_fragment> 2068#include <envmap_pars_fragment> 2069#include <cube_uv_reflection_fragment> 2070#include <fog_pars_fragment> 2071#include <specularmap_pars_fragment> 2072#include <logdepthbuf_pars_fragment> 2073#include <clipping_planes_pars_fragment> 2074void main() { 2075 #include <clipping_planes_fragment> 2076 vec4 diffuseColor = vec4( diffuse, opacity ); 2077 #include <logdepthbuf_fragment> 2078 #include <map_fragment> 2079 #include <color_fragment> 2080 #include <alphamap_fragment> 2081 #include <alphatest_fragment> 2082 #include <specularmap_fragment> 2083 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2084 #ifdef USE_LIGHTMAP 2085 vec4 lightMapTexel= texture2D( lightMap, vUv2 ); 2086 reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity; 2087 #else 2088 reflectedLight.indirectDiffuse += vec3( 1.0 ); 2089 #endif 2090 #include <aomap_fragment> 2091 reflectedLight.indirectDiffuse *= diffuseColor.rgb; 2092 vec3 outgoingLight = reflectedLight.indirectDiffuse; 2093 #include <envmap_fragment> 2094 #include <output_fragment> 2095 #include <tonemapping_fragment> 2096 #include <encodings_fragment> 2097 #include <fog_fragment> 2098 #include <premultiplied_alpha_fragment> 2099 #include <dithering_fragment> 2100}`,WT=`#define LAMBERT 2101varying vec3 vLightFront; 2102varying vec3 vIndirectFront; 2103#ifdef DOUBLE_SIDED 2104 varying vec3 vLightBack; 2105 varying vec3 vIndirectBack; 2106#endif 2107#include <common> 2108#include <uv_pars_vertex> 2109#include <uv2_pars_vertex> 2110#include <envmap_pars_vertex> 2111#include <bsdfs> 2112#include <lights_pars_begin> 2113#include <color_pars_vertex> 2114#include <fog_pars_vertex> 2115#include <morphtarget_pars_vertex> 2116#include <skinning_pars_vertex> 2117#include <shadowmap_pars_vertex> 2118#include <logdepthbuf_pars_vertex> 2119#include <clipping_planes_pars_vertex> 2120void main() { 2121 #include <uv_vertex> 2122 #include <uv2_vertex> 2123 #include <color_vertex> 2124 #include <beginnormal_vertex> 2125 #include <morphnormal_vertex> 2126 #include <skinbase_vertex> 2127 #include <skinnormal_vertex> 2128 #include <defaultnormal_vertex> 2129 #include <begin_vertex> 2130 #include <morphtarget_vertex> 2131 #include <skinning_vertex> 2132 #include <project_vertex> 2133 #include <logdepthbuf_vertex> 2134 #include <clipping_planes_vertex> 2135 #include <worldpos_vertex> 2136 #include <envmap_vertex> 2137 #include <lights_lambert_vertex> 2138 #include <shadowmap_vertex> 2139 #include <fog_vertex> 2140}`,$T=`uniform vec3 diffuse; 2141uniform vec3 emissive; 2142uniform float opacity; 2143varying vec3 vLightFront; 2144varying vec3 vIndirectFront; 2145#ifdef DOUBLE_SIDED 2146 varying vec3 vLightBack; 2147 varying vec3 vIndirectBack; 2148#endif 2149#include <common> 2150#include <packing> 2151#include <dithering_pars_fragment> 2152#include <color_pars_fragment> 2153#include <uv_pars_fragment> 2154#include <uv2_pars_fragment> 2155#include <map_pars_fragment> 2156#include <alphamap_pars_fragment> 2157#include <alphatest_pars_fragment> 2158#include <aomap_pars_fragment> 2159#include <lightmap_pars_fragment> 2160#include <emissivemap_pars_fragment> 2161#include <envmap_common_pars_fragment> 2162#include <envmap_pars_fragment> 2163#include <cube_uv_reflection_fragment> 2164#include <bsdfs> 2165#include <lights_pars_begin> 2166#include <fog_pars_fragment> 2167#include <shadowmap_pars_fragment> 2168#include <shadowmask_pars_fragment> 2169#include <specularmap_pars_fragment> 2170#include <logdepthbuf_pars_fragment> 2171#include <clipping_planes_pars_fragment> 2172void main() { 2173 #include <clipping_planes_fragment> 2174 vec4 diffuseColor = vec4( diffuse, opacity ); 2175 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2176 vec3 totalEmissiveRadiance = emissive; 2177 #include <logdepthbuf_fragment> 2178 #include <map_fragment> 2179 #include <color_fragment> 2180 #include <alphamap_fragment> 2181 #include <alphatest_fragment> 2182 #include <specularmap_fragment> 2183 #include <emissivemap_fragment> 2184 #ifdef DOUBLE_SIDED 2185 reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; 2186 #else 2187 reflectedLight.indirectDiffuse += vIndirectFront; 2188 #endif 2189 #include <lightmap_fragment> 2190 reflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb ); 2191 #ifdef DOUBLE_SIDED 2192 reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; 2193 #else 2194 reflectedLight.directDiffuse = vLightFront; 2195 #endif 2196 reflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask(); 2197 #include <aomap_fragment> 2198 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 2199 #include <envmap_fragment> 2200 #include <output_fragment> 2201 #include <tonemapping_fragment> 2202 #include <encodings_fragment> 2203 #include <fog_fragment> 2204 #include <premultiplied_alpha_fragment> 2205 #include <dithering_fragment> 2206}`,jT=`#define MATCAP 2207varying vec3 vViewPosition; 2208#include <common> 2209#include <uv_pars_vertex> 2210#include <color_pars_vertex> 2211#include <displacementmap_pars_vertex> 2212#include <fog_pars_vertex> 2213#include <normal_pars_vertex> 2214#include <morphtarget_pars_vertex> 2215#include <skinning_pars_vertex> 2216#include <logdepthbuf_pars_vertex> 2217#include <clipping_planes_pars_vertex> 2218void main() { 2219 #include <uv_vertex> 2220 #include <color_vertex> 2221 #include <beginnormal_vertex> 2222 #include <morphnormal_vertex> 2223 #include <skinbase_vertex> 2224 #include <skinnormal_vertex> 2225 #include <defaultnormal_vertex> 2226 #include <normal_vertex> 2227 #include <begin_vertex> 2228 #include <morphtarget_vertex> 2229 #include <skinning_vertex> 2230 #include <displacementmap_vertex> 2231 #include <project_vertex> 2232 #include <logdepthbuf_vertex> 2233 #include <clipping_planes_vertex> 2234 #include <fog_vertex> 2235 vViewPosition = - mvPosition.xyz; 2236}`,qT=`#define MATCAP 2237uniform vec3 diffuse; 2238uniform float opacity; 2239uniform sampler2D matcap; 2240varying vec3 vViewPosition; 2241#include <common> 2242#include <dithering_pars_fragment> 2243#include <color_pars_fragment> 2244#include <uv_pars_fragment> 2245#include <map_pars_fragment> 2246#include <alphamap_pars_fragment> 2247#include <alphatest_pars_fragment> 2248#include <fog_pars_fragment> 2249#include <normal_pars_fragment> 2250#include <bumpmap_pars_fragment> 2251#include <normalmap_pars_fragment> 2252#include <logdepthbuf_pars_fragment> 2253#include <clipping_planes_pars_fragment> 2254void main() { 2255 #include <clipping_planes_fragment> 2256 vec4 diffuseColor = vec4( diffuse, opacity ); 2257 #include <logdepthbuf_fragment> 2258 #include <map_fragment> 2259 #include <color_fragment> 2260 #include <alphamap_fragment> 2261 #include <alphatest_fragment> 2262 #include <normal_fragment_begin> 2263 #include <normal_fragment_maps> 2264 vec3 viewDir = normalize( vViewPosition ); 2265 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 2266 vec3 y = cross( viewDir, x ); 2267 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; 2268 #ifdef USE_MATCAP
2269 vec4 matcapColor = texture2D( matcap, uv ); 2270 #else 2271 vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); 2272 #endif 2273 vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; 2274 #include <output_fragment> 2275 #include <tonemapping_fragment> 2276 #include <encodings_fragment> 2277 #include <fog_fragment> 2278 #include <premultiplied_alpha_fragment> 2279 #include <dithering_fragment> 2280}`,XT=`#define NORMAL 2281#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) 2282 varying vec3 vViewPosition; 2283#endif 2284#include <common> 2285#include <uv_pars_vertex> 2286#include <displacementmap_pars_vertex> 2287#include <normal_pars_vertex> 2288#include <morphtarget_pars_vertex> 2289#include <skinning_pars_vertex> 2290#include <logdepthbuf_pars_vertex> 2291#include <clipping_planes_pars_vertex> 2292void main() { 2293 #include <uv_vertex> 2294 #include <beginnormal_vertex> 2295 #include <morphnormal_vertex> 2296 #include <skinbase_vertex> 2297 #include <skinnormal_vertex> 2298 #include <defaultnormal_vertex> 2299 #include <normal_vertex> 2300 #include <begin_vertex> 2301 #include <morphtarget_vertex> 2302 #include <skinning_vertex> 2303 #include <displacementmap_vertex> 2304 #include <project_vertex> 2305 #include <logdepthbuf_vertex> 2306 #include <clipping_planes_vertex> 2307#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) 2308 vViewPosition = - mvPosition.xyz; 2309#endif 2310}`,YT=`#define NORMAL 2311uniform float opacity; 2312#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) 2313 varying vec3 vViewPosition; 2314#endif 2315#include <packing> 2316#include <uv_pars_fragment> 2317#include <normal_pars_fragment> 2318#include <bumpmap_pars_fragment> 2319#include <normalmap_pars_fragment> 2320#include <logdepthbuf_pars_fragment> 2321#include <clipping_planes_pars_fragment> 2322void main() { 2323 #include <clipping_planes_fragment> 2324 #include <logdepthbuf_fragment> 2325 #include <normal_fragment_begin> 2326 #include <normal_fragment_maps> 2327 gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); 2328 #ifdef OPAQUE 2329 gl_FragColor.a = 1.0; 2330 #endif 2331}`,JT=`#define PHONG 2332varying vec3 vViewPosition; 2333#include <common> 2334#include <uv_pars_vertex> 2335#include <uv2_pars_vertex> 2336#include <displacementmap_pars_vertex> 2337#include <envmap_pars_vertex> 2338#include <color_pars_vertex> 2339#include <fog_pars_vertex> 2340#include <normal_pars_vertex> 2341#include <morphtarget_pars_vertex> 2342#include <skinning_pars_vertex> 2343#include <shadowmap_pars_vertex> 2344#include <logdepthbuf_pars_vertex> 2345#include <clipping_planes_pars_vertex> 2346void main() { 2347 #include <uv_vertex> 2348 #include <uv2_vertex> 2349 #include <color_vertex> 2350 #include <beginnormal_vertex> 2351 #include <morphnormal_vertex> 2352 #include <skinbase_vertex> 2353 #include <skinnormal_vertex> 2354 #include <defaultnormal_vertex> 2355 #include <normal_vertex> 2356 #include <begin_vertex> 2357 #include <morphtarget_vertex> 2358 #include <skinning_vertex> 2359 #include <displacementmap_vertex> 2360 #include <project_vertex> 2361 #include <logdepthbuf_vertex> 2362 #include <clipping_planes_vertex> 2363 vViewPosition = - mvPosition.xyz; 2364 #include <worldpos_vertex> 2365 #include <envmap_vertex> 2366 #include <shadowmap_vertex> 2367 #include <fog_vertex> 2368}`,ZT=`#define PHONG 2369uniform vec3 diffuse; 2370uniform vec3 emissive; 2371uniform vec3 specular; 2372uniform float shininess; 2373uniform float opacity; 2374#include <common> 2375#include <packing> 2376#include <dithering_pars_fragment> 2377#include <color_pars_fragment> 2378#include <uv_pars_fragment> 2379#include <uv2_pars_fragment> 2380#include <map_pars_fragment> 2381#include <alphamap_pars_fragment> 2382#include <alphatest_pars_fragment> 2383#include <aomap_pars_fragment> 2384#include <lightmap_pars_fragment> 2385#include <emissivemap_pars_fragment> 2386#include <envmap_common_pars_fragment> 2387#include <envmap_pars_fragment> 2388#include <cube_uv_reflection_fragment> 2389#include <fog_pars_fragment> 2390#include <bsdfs> 2391#include <lights_pars_begin> 2392#include <normal_pars_fragment> 2393#include <lights_phong_pars_fragment> 2394#include <shadowmap_pars_fragment> 2395#include <bumpmap_pars_fragment> 2396#include <normalmap_pars_fragment> 2397#include <specularmap_pars_fragment> 2398#include <logdepthbuf_pars_fragment> 2399#include <clipping_planes_pars_fragment> 2400void main() { 2401 #include <clipping_planes_fragment> 2402 vec4 diffuseColor = vec4( diffuse, opacity ); 2403 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2404 vec3 totalEmissiveRadiance = emissive; 2405 #include <logdepthbuf_fragment> 2406 #include <map_fragment> 2407 #include <color_fragment> 2408 #include <alphamap_fragment> 2409 #include <alphatest_fragment> 2410 #include <specularmap_fragment> 2411 #include <normal_fragment_begin> 2412 #include <normal_fragment_maps> 2413 #include <emissivemap_fragment> 2414 #include <lights_phong_fragment> 2415 #include <lights_fragment_begin> 2416 #include <lights_fragment_maps> 2417 #include <lights_fragment_end> 2418 #include <aomap_fragment> 2419 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; 2420 #include <envmap_fragment> 2421 #include <output_fragment> 2422 #include <tonemapping_fragment> 2423 #include <encodings_fragment> 2424 #include <fog_fragment> 2425 #include <premultiplied_alpha_fragment> 2426 #include <dithering_fragment> 2427}`,KT=`#define STANDARD 2428varying vec3 vViewPosition; 2429#ifdef USE_TRANSMISSION 2430 varying vec3 vWorldPosition; 2431#endif 2432#include <common> 2433#include <uv_pars_vertex> 2434#include <uv2_pars_vertex> 2435#include <displacementmap_pars_vertex> 2436#include <color_pars_vertex> 2437#include <fog_pars_vertex> 2438#include <normal_pars_vertex> 2439#include <morphtarget_pars_vertex> 2440#include <skinning_pars_vertex> 2441#include <shadowmap_pars_vertex> 2442#include <logdepthbuf_pars_vertex> 2443#include <clipping_planes_pars_vertex> 2444void main() { 2445 #include <uv_vertex> 2446 #include <uv2_vertex> 2447 #include <color_vertex> 2448 #include <beginnormal_vertex> 2449 #include <morphnormal_vertex> 2450 #include <skinbase_vertex> 2451 #include <skinnormal_vertex> 2452 #include <defaultnormal_vertex> 2453 #include <normal_vertex> 2454 #include <begin_vertex> 2455 #include <morphtarget_vertex> 2456 #include <skinning_vertex> 2457 #include <displacementmap_vertex> 2458 #include <project_vertex> 2459 #include <logdepthbuf_vertex> 2460 #include <clipping_planes_vertex> 2461 vViewPosition = - mvPosition.xyz; 2462 #include <worldpos_vertex> 2463 #include <shadowmap_vertex> 2464 #include <fog_vertex> 2465#ifdef USE_TRANSMISSION 2466 vWorldPosition = worldPosition.xyz; 2467#endif 2468}`,QT=`#define STANDARD 2469#ifdef PHYSICAL 2470 #define IOR 2471 #define SPECULAR 2472#endif 2473uniform vec3 diffuse; 2474uniform vec3 emissive; 2475uniform float roughness; 2476uniform float metalness; 2477uniform float opacity; 2478#ifdef IOR 2479 uniform float ior; 2480#endif 2481#ifdef SPECULAR 2482 uniform float specularIntensity; 2483 uniform vec3 specularColor; 2484 #ifdef USE_SPECULARINTENSITYMAP 2485 uniform sampler2D specularIntensityMap; 2486 #endif 2487 #ifdef USE_SPECULARCOLORMAP 2488 uniform sampler2D specularColorMap; 2489 #endif 2490#endif 2491#ifdef USE_CLEARCOAT 2492 uniform float clearcoat; 2493 uniform float clearcoatRoughness; 2494#endif 2495#ifdef USE_SHEEN 2496 uniform vec3 sheenColor; 2497 uniform float sheenRoughness; 2498 #ifdef USE_SHEENCOLORMAP 2499 uniform sampler2D sheenColorMap; 2500 #endif 2501 #ifdef USE_SHEENROUGHNESSMAP 2502 uniform sampler2D sheenRoughnessMap; 2503 #endif 2504#endif 2505varying vec3 vViewPosition; 2506#include <common> 2507#include <packing> 2508#include <dithering_pars_fragment> 2509#include <color_pars_fragment> 2510#include <uv_pars_fragment> 2511#include <uv2_pars_fragment> 2512#include <map_pars_fragment> 2513#include <alphamap_pars_fragment> 2514#include <alphatest_pars_fragment> 2515#include <aomap_pars_fragment> 2516#include <lightmap_pars_fragment> 2517#include <emissivemap_pars_fragment> 2518#include <bsdfs> 2519#include <cube_uv_reflection_fragment> 2520#include <envmap_common_pars_fragment> 2521#include <envmap_physical_pars_fragment> 2522#include <fog_pars_fragment> 2523#include <lights_pars_begin> 2524#include <normal_pars_fragment> 2525#include <lights_physical_pars_fragment> 2526#include <transmission_pars_fragment> 2527#include <shadowmap_pars_fragment> 2528#include <bumpmap_pars_fragment> 2529#include <normalmap_pars_fragment> 2530#include <clearcoat_pars_fragment> 2531#include <roughnessmap_pars_fragment> 2532#include <metalnessmap_pars_fragment> 2533#include <logdepthbuf_pars_fragment> 2534#include <clipping_planes_pars_fragment> 2535void main() { 2536 #include <clipping_planes_fragment> 2537 vec4 diffuseColor = vec4( diffuse, opacity ); 2538 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2539 vec3 totalEmissiveRadiance = emissive; 2540 #include <logdepthbuf_fragment> 2541 #include <map_fragment> 2542 #include <color_fragment> 2543 #include <alphamap_fragment> 2544 #include <alphatest_fragment> 2545 #include <roughnessmap_fragment> 2546 #include <metalnessmap_fragment> 2547 #include <normal_fragment_begin> 2548 #include <normal_fragment_maps> 2549 #include <clearcoat_normal_fragment_begin> 2550 #include <clearcoat_normal_fragment_maps> 2551 #include <emissivemap_fragment> 2552 #include <lights_physical_fragment> 2553 #include <lights_fragment_begin> 2554 #include <lights_fragment_maps> 2555 #include <lights_fragment_end> 2556 #include <aomap_fragment> 2557 vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; 2558 vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; 2559 #include <transmission_fragment> 2560 vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; 2561 #ifdef USE_SHEEN 2562 float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); 2563 outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular; 2564 #endif 2565 #ifdef USE_CLEARCOAT
2566 float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); 2567 vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); 2568 outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat; 2569 #endif 2570 #include <output_fragment> 2571 #include <tonemapping_fragment> 2572 #include <encodings_fragment> 2573 #include <fog_fragment> 2574 #include <premultiplied_alpha_fragment> 2575 #include <dithering_fragment> 2576}`,eA=`#define TOON 2577varying vec3 vViewPosition; 2578#include <common> 2579#include <uv_pars_vertex> 2580#include <uv2_pars_vertex> 2581#include <displacementmap_pars_vertex> 2582#include <color_pars_vertex> 2583#include <fog_pars_vertex> 2584#include <normal_pars_vertex> 2585#include <morphtarget_pars_vertex> 2586#include <skinning_pars_vertex> 2587#include <shadowmap_pars_vertex> 2588#include <logdepthbuf_pars_vertex> 2589#include <clipping_planes_pars_vertex> 2590void main() { 2591 #include <uv_vertex> 2592 #include <uv2_vertex> 2593 #include <color_vertex> 2594 #include <beginnormal_vertex> 2595 #include <morphnormal_vertex> 2596 #include <skinbase_vertex> 2597 #include <skinnormal_vertex> 2598 #include <defaultnormal_vertex> 2599 #include <normal_vertex> 2600 #include <begin_vertex> 2601 #include <morphtarget_vertex> 2602 #include <skinning_vertex> 2603 #include <displacementmap_vertex> 2604 #include <project_vertex> 2605 #include <logdepthbuf_vertex> 2606 #include <clipping_planes_vertex> 2607 vViewPosition = - mvPosition.xyz; 2608 #include <worldpos_vertex> 2609 #include <shadowmap_vertex> 2610 #include <fog_vertex> 2611}`,tA=`#define TOON 2612uniform vec3 diffuse; 2613uniform vec3 emissive; 2614uniform float opacity; 2615#include <common> 2616#include <packing> 2617#include <dithering_pars_fragment> 2618#include <color_pars_fragment> 2619#include <uv_pars_fragment> 2620#include <uv2_pars_fragment> 2621#include <map_pars_fragment> 2622#include <alphamap_pars_fragment> 2623#include <alphatest_pars_fragment> 2624#include <aomap_pars_fragment> 2625#include <lightmap_pars_fragment> 2626#include <emissivemap_pars_fragment> 2627#include <gradientmap_pars_fragment> 2628#include <fog_pars_fragment> 2629#include <bsdfs> 2630#include <lights_pars_begin> 2631#include <normal_pars_fragment> 2632#include <lights_toon_pars_fragment> 2633#include <shadowmap_pars_fragment> 2634#include <bumpmap_pars_fragment> 2635#include <normalmap_pars_fragment> 2636#include <logdepthbuf_pars_fragment> 2637#include <clipping_planes_pars_fragment> 2638void main() { 2639 #include <clipping_planes_fragment> 2640 vec4 diffuseColor = vec4( diffuse, opacity ); 2641 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2642 vec3 totalEmissiveRadiance = emissive; 2643 #include <logdepthbuf_fragment> 2644 #include <map_fragment> 2645 #include <color_fragment> 2646 #include <alphamap_fragment> 2647 #include <alphatest_fragment> 2648 #include <normal_fragment_begin> 2649 #include <normal_fragment_maps> 2650 #include <emissivemap_fragment> 2651 #include <lights_toon_fragment> 2652 #include <lights_fragment_begin> 2653 #include <lights_fragment_maps> 2654 #include <lights_fragment_end> 2655 #include <aomap_fragment> 2656 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 2657 #include <output_fragment> 2658 #include <tonemapping_fragment> 2659 #include <encodings_fragment> 2660 #include <fog_fragment> 2661 #include <premultiplied_alpha_fragment> 2662 #include <dithering_fragment> 2663}`,nA=`uniform float size; 2664uniform float scale; 2665#include <common> 2666#include <color_pars_vertex> 2667#include <fog_pars_vertex> 2668#include <morphtarget_pars_vertex> 2669#include <logdepthbuf_pars_vertex> 2670#include <clipping_planes_pars_vertex> 2671void main() { 2672 #include <color_vertex> 2673 #include <begin_vertex> 2674 #include <morphtarget_vertex> 2675 #include <project_vertex> 2676 gl_PointSize = size; 2677 #ifdef USE_SIZEATTENUATION 2678 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 2679 if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); 2680 #endif 2681 #include <logdepthbuf_vertex> 2682 #include <clipping_planes_vertex> 2683 #include <worldpos_vertex> 2684 #include <fog_vertex> 2685}`,rA=`uniform vec3 diffuse; 2686uniform float opacity; 2687#include <common> 2688#include <color_pars_fragment> 2689#include <map_particle_pars_fragment> 2690#include <alphatest_pars_fragment> 2691#include <fog_pars_fragment> 2692#include <logdepthbuf_pars_fragment> 2693#include <clipping_planes_pars_fragment> 2694void main() { 2695 #include <clipping_planes_fragment> 2696 vec3 outgoingLight = vec3( 0.0 ); 2697 vec4 diffuseColor = vec4( diffuse, opacity ); 2698 #include <logdepthbuf_fragment> 2699 #include <map_particle_fragment> 2700 #include <color_fragment> 2701 #include <alphatest_fragment> 2702 outgoingLight = diffuseColor.rgb; 2703 #include <output_fragment> 2704 #include <tonemapping_fragment> 2705 #include <encodings_fragment> 2706 #include <fog_fragment> 2707 #include <premultiplied_alpha_fragment> 2708}`,iA=`#include <common> 2709#include <fog_pars_vertex> 2710#include <morphtarget_pars_vertex> 2711#include <skinning_pars_vertex> 2712#include <shadowmap_pars_vertex> 2713void main() { 2714 #include <beginnormal_vertex> 2715 #include <morphnormal_vertex> 2716 #include <skinbase_vertex> 2717 #include <skinnormal_vertex> 2718 #include <defaultnormal_vertex> 2719 #include <begin_vertex> 2720 #include <morphtarget_vertex> 2721 #include <skinning_vertex> 2722 #include <project_vertex> 2723 #include <worldpos_vertex> 2724 #include <shadowmap_vertex> 2725 #include <fog_vertex> 2726}`,sA=`uniform vec3 color; 2727uniform float opacity; 2728#include <common> 2729#include <packing> 2730#include <fog_pars_fragment> 2731#include <bsdfs> 2732#include <lights_pars_begin> 2733#include <shadowmap_pars_fragment> 2734#include <shadowmask_pars_fragment> 2735void main() { 2736 gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); 2737 #include <tonemapping_fragment> 2738 #include <encodings_fragment> 2739 #include <fog_fragment> 2740}`,oA=`uniform float rotation; 2741uniform vec2 center; 2742#include <common> 2743#include <uv_pars_vertex> 2744#include <fog_pars_vertex> 2745#include <logdepthbuf_pars_vertex> 2746#include <clipping_planes_pars_vertex> 2747void main() { 2748 #include <uv_vertex> 2749 vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); 2750 vec2 scale; 2751 scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); 2752 scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); 2753 #ifndef USE_SIZEATTENUATION 2754 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 2755 if ( isPerspective ) scale *= - mvPosition.z; 2756 #endif 2757 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 2758 vec2 rotatedPosition; 2759 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 2760 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 2761 mvPosition.xy += rotatedPosition; 2762 gl_Position = projectionMatrix * mvPosition; 2763 #include <logdepthbuf_vertex> 2764 #include <clipping_planes_vertex> 2765 #include <fog_vertex> 2766}`,aA=`uniform vec3 diffuse; 2767uniform float opacity; 2768#include <common> 2769#include <uv_pars_fragment> 2770#include <map_pars_fragment> 2771#include <alphamap_pars_fragment> 2772#include <alphatest_pars_fragment> 2773#include <fog_pars_fragment> 2774#include <logdepthbuf_pars_fragment> 2775#include <clipping_planes_pars_fragment> 2776void main() { 2777 #include <clipping_planes_fragment> 2778 vec3 outgoingLight = vec3( 0.0 ); 2779 vec4 diffuseColor = vec4( diffuse, opacity ); 2780 #include <logdepthbuf_fragment> 2781 #include <map_fragment> 2782 #include <alphamap_fragment> 2783 #include <alphatest_fragment> 2784 outgoingLight = diffuseColor.rgb; 2785 #include <output_fragment> 2786 #include <tonemapping_fragment> 2787 #include <encodings_fragment> 2788 #include <fog_fragment> 2789}`,at={alphamap_fragment:BM,alphamap_pars_fragment:zM,alphatest_fragment:NM,alph
vendor: 6,591 bytes, line 2789
2789atest_pars_fragment:kM,aomap_fragment:UM,aomap_pars_fragment:HM,begin_vertex:GM,beginnormal_vertex:VM,bsdfs:WM,bumpmap_pars_fragment:$M,clipping_planes_fragment:jM,clipping_planes_pars_fragment:qM,clipping_planes_pars_vertex:XM,clipping_planes_vertex:YM,color_fragment:JM,color_pars_fragment:ZM,color_pars_vertex:KM,color_vertex:QM,common:eE,cube_uv_reflection_fragment:tE,defaultnormal_vertex:nE,displacementmap_pars_vertex:rE,displacementmap_vertex:iE,emissivemap_fragment:sE,emissivemap_pars_fragment:oE,encodings_fragment:aE,encodings_pars_fragment:lE,envmap_fragment:cE,envmap_common_pars_fragment:uE,envmap_pars_fragment:fE,envmap_pars_vertex:dE,envmap_physical_pars_fragment:SE,envmap_vertex:hE,fog_vertex:pE,fog_pars_vertex:mE,fog_fragment:gE,fog_pars_fragment:yE,gradientmap_pars_fragment:vE,lightmap_fragment:xE,lightmap_pars_fragment:_E,lights_lambert_vertex:bE,lights_pars_begin:wE,lights_toon_fragment:ME,lights_toon_pars_fragment:EE,lights_phong_fragment:TE,lights_phong_pars_fragment:AE,lights_physical_fragment:RE,lights_physical_pars_fragment:CE,lights_fragment_begin:PE,lights_fragment_maps:LE,lights_fragment_end:IE,logdepthbuf_fragment:DE,logdepthbuf_pars_fragment:OE,logdepthbuf_pars_vertex:FE,logdepthbuf_vertex:BE,map_fragment:zE,map_pars_fragment:NE,map_particle_fragment:kE,map_particle_pars_fragment:UE,metalnessmap_fragment:HE,metalnessmap_pars_fragment:GE,morphnormal_vertex:VE,morphtarget_pars_vertex:WE,morphtarget_vertex:$E,normal_fragment_begin:jE,normal_fragment_maps:qE,normal_pars_fragment:XE,normal_pars_vertex:YE,normal_vertex:JE,normalmap_pars_fragment:ZE,clearcoat_normal_fragment_begin:KE,clearcoat_normal_fragment_maps:QE,clearcoat_pars_fragment:eT,output_fragment:tT,packing:nT,premultiplied_alpha_fragment:rT,project_vertex:iT,dithering_fragment:sT,dithering_pars_fragment:oT,roughnessmap_fragment:aT,roughnessmap_pars_fragment:lT,shadowmap_pars_fragment:cT,shadowmap_pars_vertex:uT,shadowmap_vertex:fT,shadowmask_pars_fragment:dT,skinbase_vertex:hT,skinning_pars_vertex:pT,skinning_vertex:mT,skinnormal_vertex:gT,specularmap_fragment:yT,specularmap_pars_fragment:vT,tonemapping_fragment:xT,tonemapping_pars_fragment:_T,transmission_fragment:bT,transmission_pars_fragment:wT,uv_pars_fragment:ST,uv_pars_vertex:MT,uv_vertex:ET,uv2_pars_fragment:TT,uv2_pars_vertex:AT,uv2_vertex:RT,worldpos_vertex:CT,background_vert:PT,background_frag:LT,cube_vert:IT,cube_frag:DT,depth_vert:OT,depth_frag:FT,distanceRGBA_vert:BT,distanceRGBA_frag:zT,equirect_vert:NT,equirect_frag:kT,linedashed_vert:UT,linedashed_frag:HT,meshbasic_vert:GT,meshbasic_frag:VT,meshlambert_vert:WT,meshlambert_frag:$T,meshmatcap_vert:jT,meshmatcap_frag:qT,meshnormal_vert:XT,meshnormal_frag:YT,meshphong_vert:JT,meshphong_frag:ZT,meshphysical_vert:KT,meshphysical_frag:QT,meshtoon_vert:eA,meshtoon_frag:tA,points_vert:nA,points_frag:rA,shadow_vert:iA,shadow_frag:sA,sprite_vert:oA,sprite_frag:aA},Se={common:{diffuse:{value:new Ae(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new un},uv2Transform:{value:new un},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new de(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ae(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ae(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new un}},sprite:{diffuse:{value:new Ae(16777215)},opacity:{value:1},center:{value:new de(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new un}}},_r={basic:{uniforms:Tn([Se.common,Se.specularmap,Se.envmap,Se.aomap,Se.lightmap,Se.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Tn([Se.common,Se.specularmap,Se.envmap,Se.aomap,Se.lightmap,Se.emissivemap,Se.fog,Se.lights,{emissive:{value:new Ae(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Tn([Se.common,Se.specularmap,Se.envmap,Se.aomap,Se.lightmap,Se.emissivemap,Se.bumpmap,Se.normalmap,Se.displacementmap,Se.fog,Se.lights,{emissive:{value:new Ae(0)},specular:{value:new Ae(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Tn([Se.common,Se.envmap,Se.aomap,Se.lightmap,Se.emissivemap,Se.bumpmap,Se.normalmap,Se.displacementmap,Se.roughnessmap,Se.metalnessmap,Se.fog,Se.lights,{emissive:{value:new Ae(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Tn([Se.common,Se.aomap,Se.lightmap,Se.emissivemap,Se.bumpmap,Se.normalmap,Se.displacementmap,Se.gradientmap,Se.fog,Se.lights,{emissive:{value:new Ae(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Tn([Se.common,Se.bumpmap,Se.normalmap,Se.displacementmap,Se.fog,{matc
vendor: 2,361 bytes, line 2789
2789ap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Tn([Se.points,Se.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Tn([Se.common,Se.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Tn([Se.common,Se.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Tn([Se.common,Se.bumpmap,Se.normalmap,Se.displacementmap,{opacity:{value:1}}]),vertexShader:at.meshnormal_vert,fragmentShader:at.meshnormal_frag},sprite:{uniforms:Tn([Se.sprite,Se.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new un},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Tn([Se.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Tn([Se.common,Se.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Tn([Se.lights,Se.fog,{color:{value:new Ae(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};_r.physical={uniforms:Tn([_r.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new de(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new Ae(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new de},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Ae(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Ae(1,1,1)},specularColorMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function lA(r,e,t,n,i,s){const o=new Ae(0);let a=i===!0?0:1,u,f,p=null,h=0,d=null;function g(_,w){let x=!1,v=w.isScene===!0?w.background:null;
2789v&&v.isTexture&&(v=e.get(v));const E=r.xr,M=E.getSession&&E.getSession();M&&M.environmentBlendMode==="additive"&&(v=null),v===null?y(o,a):v&&v.isColor&&(y(v,1),x=!0),(r.autoClear||x)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),v&&(v.isCubeTexture||v.mapping===ra)?(f===void 0&&(f=new on(new li(1,1,1),new ci({name:"BackgroundCubeMaterial",uniforms:Vo(_r.cube.uniforms),vertexShader:_r.cube.vertexShader,fragmentShader:_r.cube.fragmentShader,side:Zt,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(A,C,L){this.matrixWorld.copyPosition(L.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(f)),f.material.uniforms.envMap.value=v,f.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,(p!==v||h!==v.version||d!==r.toneMapping)&&(f.material.needsUpdate=!0,p=v,h=v.version,d=r.toneMapping),_.unshift(f,f.geometry,f.material,0,0,null)):v&&v.isTexture&&(u===void 0&&(u=new on(new Cs(2,2),new ci({name:"BackgroundMaterial",uniforms:Vo(_r.background.uniforms),vertexShader:_r.background.vertexShader,fragmentShader:_r.background.fragmentShader,side:Es,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(u)),u.material.uniforms.t2D.value=v,v.matrixAutoUpdate===!0&&v.updateMatrix(),u.material.uniforms.uvTransform.value.copy(v.matrix),(p!==v||h!==v.version||d!==r.toneMapping)&&(u.material.needsUpdate=!0,p=v,h=v.version,d=r.toneMapping),_.unshift(u,u.geometry,u.material,0,0,null))}function y(_,w){t.buffers.color.setClear(_.r,_.g,_.b,w,s)}return{getClearColor:function(){return o},setClearColor:function(_,w=1){o.set(_),a=w,y(o,a)},getClearAlpha:function(){return a},setClearAlpha:function(_){a=_,y(o,a)},render:g}}function cA(r,e,t,n){const i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},u=_(null);let f=u;function p(H,W,V,j,Z){let ne=!1;if(o){const ge=y(j,V,W);f!==ge&&(f=ge,d(f.object)),ne=w(j,Z),ne&&x(j,Z)}else{const ge=W.wireframe===!0;(f.geometry!==j.id||f.program!==V.id||f.wireframe!==ge)&&(f.geometry=j.id,f.program=V.id,f.wireframe=ge,ne=!0)}H.isInstancedMesh===!0&&(ne=!0),Z!==null&&t.update(Z,34963),ne&&(L(H,W,V,j),Z!==null&&r.bindBuffer(34963,t.get(Z).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(H){return n.isWebGL2?r.bindVertexArray(H):s.bindVertexArrayOES(H)}function g(H){return n.isWebGL2?r.deleteVertexArray(H):s.deleteVertexArrayOES(H)}function y(H,W,V){const j=V.wireframe===!0;let Z=a[H.id];Z===void 0&&(Z={},a[H.id]=Z);let ne=Z[W.id];ne===void 0&&(ne={},Z[W.id]=ne);let ge=ne[j];return ge===void 0&&(ge=_(h()),ne[j]=ge),ge}function _(H){const W=[],V=[],j=[];for(let Z=0;Z<i;Z++)W[Z]=0,V[Z]=0,j[Z]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:W,enabledAttributes:V,attributeDivisors:j,object:H,attributes:{},index:null}}function w(H,W){const V=f.attributes,j=H.attributes;let Z=0;for(const ne in j){const ge=V[ne],Y=j[ne];if(ge===void 0||ge.attribute!==Y||ge.data!==Y.data)return!0;Z++}return f.attributesNum!==Z||f.index!==W}function x(H,W){const V={},j=H.attributes;let Z=0;for(const ne in j){const ge=j[ne],Y={};Y.attribute=ge,ge.data&&(Y.data=ge.data),V[ne]=Y,Z++}f.attributes=V,f.attributesNum=Z,f.index=W}function v(){const H=f.newAttributes;for(let W=0,V=H.length;W<V;W++)H[W]=0}function E(H){M(H,0)}function M(H,W){const V=f.newAttributes,j=f.enabledAttributes,Z=f.attributeDivisors;V[H]=1,j[H]===0&&(r.enableVertexAttribArray(H),j[H]=1),Z[H]!==W&&((n.isWebGL2?r:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](H,W),Z[H]=W)}function A(){const H=f.newAttributes,W=f.enabledAttributes;for(let V=0,j=W.length;V<j;V++)W[V]!==H[V]&&(r.disableVertexAttribArray(V),W[V]=0)}function C(H,W,V,j,Z,ne){n.isWebGL2===!0&&(V===5124||V===5125)?r.vertexAttribIPointer(H,W,V,Z,ne):r.vertexAttribPointer(H,W,V,j,Z,ne)}
vendor: 5,450 bytes, line 2789
2789function L(H,W,V,j){if(n.isWebGL2===!1&&(H.isInstancedMesh||j.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;v();const Z=j.attributes,ne=V.getAttributes(),ge=W.defaultAttributeValues;for(const Y in ne){const ee=ne[Y];if(ee.location>=0){let ue=Z[Y];if(ue===void 0&&(Y==="instanceMatrix"&&H.instanceMatrix&&(ue=H.instanceMatrix),Y==="instanceColor"&&H.instanceColor&&(ue=H.instanceColor)),ue!==void 0){const ye=ue.normalized,xe=ue.itemSize,re=t.get(ue);if(re===void 0)continue;const Xe=re.buffer,Le=re.type,Be=re.bytesPerElement;if(ue.isInterleavedBufferAttribute){const Me=ue.data,et=Me.stride,Ve=ue.offset;if(Me&&Me.isInstancedInterleavedBuffer){for(let le=0;le<ee.locationSize;le++)M(ee.location+le,Me.meshPerAttribute);H.isInstancedMesh!==!0&&j._maxInstanceCount===void 0&&(j._maxInstanceCount=Me.meshPerAttribute*Me.count)}else for(let le=0;le<ee.locationSize;le++)E(ee.location+le);r.bindBuffer(34962,Xe);for(let le=0;le<ee.locationSize;le++)C(ee.location+le,xe/ee.locationSize,Le,ye,et*Be,(Ve+xe/ee.locationSize*le)*Be)}else{if(ue.isInstancedBufferAttribute){for(let Me=0;Me<ee.locationSize;Me++)M(ee.location+Me,ue.meshPerAttribute);H.isInstancedMesh!==!0&&j._maxInstanceCount===void 0&&(j._maxInstanceCount=ue.meshPerAttribute*ue.count)}else for(let Me=0;Me<ee.locationSize;Me++)E(ee.location+Me);r.bindBuffer(34962,Xe);for(let Me=0;Me<ee.locationSize;Me++)C(ee.location+Me,xe/ee.locationSize,Le,ye,xe*Be,xe/ee.locationSize*Me*Be)}}else if(ge!==void 0){const ye=ge[Y];if(ye!==void 0)switch(ye.length){case 2:r.vertexAttrib2fv(ee.location,ye);break;case 3:r.vertexAttrib3fv(ee.location,ye);break;case 4:r.vertexAttrib4fv(ee.location,ye);break;default:r.vertexAttrib1fv(ee.location,ye)}}}}A()}function D(){T();for(const H in a){const W=a[H];for(const V in W){const j=W[V];for(const Z in j)g(j[Z].object),delete j[Z];delete W[V]}delete a[H]}}function k(H){if(a[H.id]===void 0)return;const W=a[H.id];for(const V in W){const j=W[V];for(const Z in j)g(j[Z].object),delete j[Z];delete W[V]}delete a[H.id]}function B(H){for(const W in a){const V=a[W];if(V[H.id]===void 0)continue;const j=V[H.id];for(const Z in j)g(j[Z].object),delete j[Z];delete V[H.id]}}function T(){O(),f!==u&&(f=u,d(f.object))}function O(){u.geometry=null,u.program=null,u.wireframe=!1}return{setup:p,reset:T,resetDefaultState:O,dispose:D,releaseStatesOfGeometry:k,releaseStatesOfProgram:B,initAttributes:v,enableAttribute:E,disableUnusedAttributes:A}}function uA(r,e,t,n){const i=n.isWebGL2;let s;function o(f){s=f}function a(f,p){r.drawArrays(s,f,p),t.update(p,s,1)}function u(f,p,h){if(h===0)return;let d,g;if(i)d=r,g="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),g="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[g](s,f,p,h),t.update(p,s,h)}this.setMode=o,this.render=a,this.renderInstances=u}function fA(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(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";L="mediump"}return L==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext;let a=t.precision!==void 0?t.precision:"highp";const u=s(a);u!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",u,"instead."),a=u);const f=o||e.has("WEBGL_draw_buffers"),p=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),g=r.getParameter(3379),y=r.getParameter(34076),_=r.getParameter(34921),w=r.getParameter(36347),x=r.getParameter(36348),v=r.getParameter(36349),E=d>0,M=o||e.has("OES_texture_float"),A=E&&M,C=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:f,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:p,maxTextures:h,maxVertexTextures:d,maxTextureSize:g,maxCubemapSize:y,maxAttributes:_,maxVertexUniforms:w,maxVaryings:x,maxFragmentUniforms:v,vertexTextures:E,floatFragmentTextures:M,floatVertexTextures:A,maxSamples:C}}function dA(r){const e=this;let t=null,n=0,i=!1,s=!1;const o=new Or,a=new un,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,g){const y=h.length!==0||d||n!==0||i;return i=d,t=p(h,g,0),n=h.length,y},this.beginShadows=function(){s=!0,p(null)},this.endShadows=function(){s=!1,f()},this.setState=function(h,d,g){const y=h.clippingPlanes,_=h.clipIntersection,w=h.clipShadows,x=r.get(h);if(!i||y===null||y.length===0||s&&!w)s?p(null):f();else{const v=s?0:n,E=v*4;let M=x.clippingState||null;u.value=M,M=p(y,d,E,g);for(let A=0;A!==E;++A)M[A]=t[A];x.clippingState=M,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=v}};function f(){u.value!==t&&(u.value=t,u.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function p(h,d,g,y){const _=h!==null?h.length:0;let w=null;if(_!==0){if(w=u.value,y!==!0||w===null){const x=g+_*4,v=d.matrixWorldInverse;a.getNormalMatrix(v),(w===null||w.length<x)&&(w=new Float32Array(x)
2789);for(let E=0,M=g;E!==_;++E,M+=4)o.copy(h[E]).applyMatrix4(v,a),o.normal.toArray(w,M),w[M+3]=o.constant}u.value=w,u.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,w}}function hA(r){let e=new WeakMap;function t(o,a){return a===ko?o.mapping=$i:a===ul&&(o.mapping=Bs),o}function n(o){if(o&&o.isTexture&&o.isRenderTargetTexture===!1){const a=o.mapping;if(a===ko||a===ul)if(e.has(o)){const u=e.get(o).texture;return t(u,o.mapping)}else{const u=o.image;if(u&&u.height>0){const f=new Il(u.height/2);return f.fromEquirectangularTexture(r,o),e.set(o,f),o.addEventListener("dispose",i),t(f.texture,o.mapping)}else return null}}return o}function i(o){const a=o.target;a.removeEventListener("dispose",i);const u=e.get(a);u!==void 0&&(e.delete(a),u.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}class Ji extends Rs{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super(),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=o,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,o){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=o,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,o=n+e,a=i+t,u=i-t;if(this.view!==null&&this.view.enabled){const f=(this.right-this.left)/this.view.fullWidth/this.zoom,p=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=f*this.view.offsetX,o=s+f*this.view.width,a-=p*this.view.offsetY,u=a-p*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,u,this.near,this.far),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}}Ji.prototype.isOrthographicCamera=!0;class sa extends ci{constructor(e){super(e),this.type="RawShaderMaterial"}}sa.prototype.isRawShaderMaterial=!0;const Bo=4,ki=8,Dr=Math.pow(2,ki),H_=[.125,.215,.35,.446,.526,.582],G_=ki-Bo+1+H_.length,vo=20,ah=new Ji,{_lodPlanes:Ga,_sizeLods:U0,_sigmas:iu}=pA(),H0=new Ae;let lh=null;const ds=(1+Math.sqrt(5))/2,xo=1/ds,G0=[new F(1,1,1),new F(-1,1,1),new F(1,1,-1),new F(-1,1,-1),new F(0,ds,xo),new F(0,ds,-xo),new F(xo,0,ds),new F(-xo,0,ds),new F(ds,xo,0),new F(-ds,xo,0)];class hp{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=mA(vo),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){lh=this._renderer.getRenderTarget();const s=this._allocateTargets();return 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._cubemapShader===null&&(this._cubemapShader=$0(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=W0(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e<Ga.length;e++)Ga[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(lh),e.scissorTest=!1,su(e,0,0,e.width,e.height)}_fromTexture(e,t){lh=this._renderer.getRenderTarget();const n=t||this._allocateTargets(e);return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(e){const t={magFilter:Pt,minFilter:Pt,generateMipmaps:!1,type:fr,format:wn,encoding:Kn,depthBuffer:!1},n=V0(t);return n.depthBuffer=!e,this._pingPongRenderTarget===null&&(this._pingPongRenderTarget=V0(t)),n}_compileMaterial(e){const t=new on(Ga[0],e);this._renderer.compile(t,ah)}_sceneToCubeUV(e,t,n,i){const a=new Qt(90,1,t,n),u=[1,-1,1,1,1,1],f=[1,1,1,-1,-1,-1],p=this._renderer,h=p.autoClear,d=p.toneMapping;p.getClearColor(H0),p.toneMapping=Fr,p.autoClear=!1;
2789const g=new pi({name:"PMREM.Background",side:Zt,depthWrite:!1,depthTest:!1}),y=new on(new li,g);let _=!1;const w=e.background;w?w.isColor&&(g.color.copy(w),e.background=null,_=!0):(g.color.copy(H0),_=!0);for(let x=0;x<6;x++){const v=x%3;v===0?(a.up.set(0,u[x],0),a.lookAt(f[x],0,0)):v===1?(a.up.set(0,0,u[x]),a.lookAt(0,f[x],0)):(a.up.set(0,u[x],0),a.lookAt(0,0,f[x])),su(i,v*Dr,x>2?Dr:0,Dr,Dr),p.setRenderTarget(i),_&&p.render(y,a),p.render(e,a)}y.geometry.dispose(),y.material.dispose(),p.toneMapping=d,p.autoClear=h,e.background=w}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===$i||e.mapping===Bs;i?(this._cubemapShader===null&&(this._cubemapShader=$0()),this._cubemapShader.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectShader===null&&(this._equirectShader=W0());const s=i?this._cubemapShader:this._equirectShader,o=new on(Ga[0],s),a=s.uniforms;a.envMap.value=e,i||a.texelSize.value.set(1/e.image.width,1/e.image.height),su(t,0,0,3*Dr,2*Dr),n.setRenderTarget(t),n.render(o,ah)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;i<G_;i++){const s=Math.sqrt(iu[i]*iu[i]-iu[i-1]*iu[i-1]),o=G0[(i-1)%G0.length];this._blur(e,i-1,i,s,o)}t.autoClear=n}_blur(e,t,n,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,i,"latitudinal",s),this._halfBlur(o,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,o,a){const u=this._renderer,f=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const p=3,h=new on(Ga[i],f),d=f.uniforms,g=U0[n]-1,y=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*vo-1),_=s/y,w=isFinite(s)?1+Math.floor(p*_):vo;w>vo&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${w} samples when the maximum is set to ${vo}`);const x=[];let v=0;for(let C=0;C<vo;++C){const L=C/_,D=Math.exp(-L*L/2);x.push(D),C===0?v+=D:C<w&&(v+=2*D)}for(let C=0;C<x.length;C++)x[C]=x[C]/v;d.envMap.value=e.texture,d.samples.value=w,d.weights.value=x,d.latitudinal.value=o==="latitudinal",a&&(d.poleAxis.value=a),d.dTheta.value=y,d.mipInt.value=ki-n;const E=U0[i],M=3*Math.max(0,Dr-2*E),A=(i===0?0:2*Dr)+2*E*(i>ki-Bo?i-ki+Bo:0);su(t,M,A,3*E,2*E),u.setRenderTarget(t),u.render(h,ah)}}function pA(){const r=[],e=[],t=[];let n=ki;for(let i=0;i<G_;i++){const s=Math.pow(2,n);e.push(s);let o=1/s;i>ki-Bo?o=H_[i-ki+Bo-1]:i===0&&(o=0),t.push(o);const a=1/(s-1),u=-a/2,f=1+a/2,p=[u,u,f,u,f,f,u,u,f,f,u,f],h=6,d=6,g=3,y=2,_=1,w=new Float32Array(g*d*h),x=new Float32Array(y*d*h),v=new Float32Array(_*d*h);for(let M=0;M<h;M++){const A=M%3*2/3-1,C=M>2?0:-1,L=[A,C,0,A+2/3,C,0,A+2/3,C+1,0,A,C,0,A+2/3,C+1,0,A,C+1,0];w.set(L,g*d*M),x.set(p,y*d*M);const D=[M,M,M,M,M,M];v.set(D,_*d*M)}const E=new Je;E.setAttribute("position",new pt(w,g)),E.setAttribute("uv",new pt(x,y)),E.setAttribute("faceIndex",new pt(v,_)),r.push(E),n>Bo&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function V0(r){const e=new Zn(3*Dr,3*Dr,r);return e.texture.mapping=ra,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function su(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function mA(r){const e=new Float32Array(r),t=new F(0,1,0);return new sa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t}},vertexShader:tm(),fragmentShader:` 2790 2791 precision mediump float; 2792 precision mediump int; 2793 2794 varying vec3 vOutputDirection; 2795 2796 uniform sampler2D envMap; 2797 uniform int samples; 2798 uniform float weights[ n ]; 2799 uniform bool latitudinal; 2800 uniform float dTheta; 2801 uniform float mipInt; 2802 uniform vec3 poleAxis; 2803 2804 #define ENVMAP_TYPE_CUBE_UV 2805 #include <cube_uv_reflection_fragment> 2806 2807 vec3 getSample( float theta, vec3 axis ) { 2808 2809 float cosTheta = cos( theta ); 2810 // Rodrigues' axis-angle rotation 2811 vec3 sampleDirection = vOutputDirection * cosTheta 2812 + cross( axis, vOutputDirection ) * sin( theta ) 2813 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 2814 2815 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 2816 2817 } 2818 2819 void main() { 2820 2821 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 2822 2823 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 2824 2825 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 2826 2827 } 2828 2829 axis = normalize( axis ); 2830 2831 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 2832 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 2833 2834 for ( int i = 1; i < n; i++ ) { 2835 2836 if ( i >= samples ) { 2837 2838 break; 2839 2840 } 2841 2842 float theta = dTheta * float( i ); 2843 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 2844 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 2845 2846 } 2847 2848 } 2849 `,blending:si,depthTest:!1,depthWrite:!1})}function W0(){const r=new de(1,1);return new sa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r}},vertexShader:tm(),fragmentShader:` 2850 2851 precision mediump float; 2852 precision mediump int; 2853 2854 varying vec3 vOutputDirection; 2855 2856 uniform sampler2D envMap; 2857 uniform vec2 texelSize; 2858 2859 #include <common> 2860 2861 void main() { 2862 2863 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 2864 2865 vec3 outputDirection = normalize( vOutputDirection ); 2866 vec2 uv = equirectUv( outputDirection ); 2867 2868 vec2 f = fract( uv / texelSize - 0.5 ); 2869 uv -= f * texelSize; 2870 vec3 tl = texture2D ( envMap, uv ).rgb; 2871 uv.x += texelSize.x; 2872 vec3 tr = texture2D ( envMap, uv ).rgb; 2873 uv.y += texelSize.y; 2874 vec3 br = texture2D ( envMap, uv ).rgb; 2875 uv.x -= texelSize.x; 2876 vec3 bl = texture2D ( envMap, uv ).rgb; 2877 2878 vec3 tm = mix( tl, tr, f.x ); 2879 vec3 bm = mix( bl, br, f.x ); 2880 gl_FragColor.rgb = mix( tm, bm, f.y ); 2881 2882 } 2883 `,blending:si,depthTest:!1,depthWrite:!1})}function $0(){return new sa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:tm(),fragmentShader:` 2884 2885 precision mediump float; 2886 precision mediump int; 2887 2888 uniform float flipEnvMap; 2889 2890 varying vec3 vOutputDirection; 2891 2892 uniform samplerCube envMap; 2893 2894 void main() { 2895 2896 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 2897 2898 } 2899 `,blending:si,depthTest:!1,depthWrite:!1})}function tm(){return` 2900 2901 precision mediump float; 2902 precision mediump int; 2903 2904 attribute vec3 position; 2905 attribute vec2 uv; 2906 attribute float faceIndex; 2907 2908 varying vec3 vOutputDirection; 2909 2910 // RH coordinate system; PMREM face-indexing convention 2911 vec3 getDirection( vec2 uv, float face ) { 2912 2913 uv = 2.0 * uv - 1.0; 2914 2915 vec3 direction = vec3( uv, 1.0 ); 2916 2917 if ( face == 0.0 ) { 2918 2919 direction = direction.zyx; // ( 1, v, u ) pos x 2920 2921 } else if ( face == 1.0 ) { 2922 2923 direction = direction.xzy; 2924 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 2925 2926 } else if ( face == 2.0 ) { 2927 2928 direction.x *= -1.0; // ( -u, v, 1 ) pos z 2929 2930 } else if ( face == 3.0 ) { 2931 2932 direction = direction.zyx; 2933 direction.xz *= -1.0; // ( -1, v, -u ) neg x 2934 2935 } else if ( face == 4.0 ) { 2936 2937 direction = direction.xzy; 2938 direction.xy *= -1.0; // ( -u, -1, v ) neg y 2939 2940 } else if ( face == 5.0 ) { 2941 2942 direction.z *= -1.0; // ( u, v, -1 ) neg z 2943 2944 } 2945 2946 return direction; 2947 2948 } 2949 2950 void main() { 2951 2952 vOutputDirection = getDirection( uv, faceIndex ); 2953 gl_Position = vec4( position, 1.0 ); 2954 2955 } 2956 `}function gA(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture){const u=a.mapping,f=u===ko||u===ul,p=u===$i||u===Bs;if(f||p)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let h=e.get(a);return t===null&&(t=new hp(r)),h=f?t.fromEquirectangular(a,h):t.fromCubemap(a,h),e.set(a,h),h.texture}else{if(e.has(a))return e.get(a).texture;{const h=a.image;if(f&&h&&h.height>0||p&&h&&i(h)){t===null&&(t=new hp(r));const d=f?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,d),a.addEventListener("dispose",s),d.texture}else return null}}}return a}function i(a){let u=0;const f=6;for(let p=0;p<f;p++)a[p]!==void 0&&u++;return u===f}function s(a){const u=a.target;u.removeEventListener("dispose",s);const f=e.get(u);f!==void 0&&(e.delete(u),f.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:o}}function yA(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_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 vA(r,e,t,n){const i={},s=new WeakMap;function o(h){const d=h.target;d.index!==null&&e.remove(d.index);for(const y in d.attributes)e.remove(d.attributes[y]);d.removeEventListener("dispose",o),delete i[d.id];const g=s.get(d);
vendor: 12,598 bytes, line 2956
2956g&&(e.remove(g),s.delete(d)),n.releaseStatesOfGeometry(d),d.isInstancedBufferGeometry===!0&&delete d._maxInstanceCount,t.memory.geometries--}function a(h,d){return i[d.id]===!0||(d.addEventListener("dispose",o),i[d.id]=!0,t.memory.geometries++),d}function u(h){const d=h.attributes;for(const y in d)e.update(d[y],34962);const g=h.morphAttributes;for(const y in g){const _=g[y];for(let w=0,x=_.length;w<x;w++)e.update(_[w],34962)}}function f(h){const d=[],g=h.index,y=h.attributes.position;let _=0;if(g!==null){const v=g.array;_=g.version;for(let E=0,M=v.length;E<M;E+=3){const A=v[E+0],C=v[E+1],L=v[E+2];d.push(A,C,C,L,L,A)}}else{const v=y.array;_=y.version;for(let E=0,M=v.length/3-1;E<M;E+=3){const A=E+0,C=E+1,L=E+2;d.push(A,C,C,L,L,A)}}const w=new(C_(d)?ff:uf)(d,1);w.version=_;const x=s.get(h);x&&e.remove(x),s.set(h,w)}function p(h){const d=s.get(h);if(d){const g=h.index;g!==null&&d.version<g.version&&f(h)}else f(h);return s.get(h)}return{get:a,update:u,getWireframeAttribute:p}}function xA(r,e,t,n){const i=n.isWebGL2;let s;function o(d){s=d}let a,u;function f(d){a=d.type,u=d.bytesPerElement}function p(d,g){r.drawElements(s,g,a,d*u),t.update(g,s,1)}function h(d,g,y){if(y===0)return;let _,w;if(i)_=r,w="drawElementsInstanced";else if(_=e.get("ANGLE_instanced_arrays"),w="drawElementsInstancedANGLE",_===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}_[w](s,g,a,d*u,y),t.update(g,s,y)}this.setMode=o,this.setIndex=f,this.render=p,this.renderInstances=h}function _A(r){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,a){switch(t.calls++,o){case 4:t.triangles+=a*(s/3);break;case 1:t.lines+=a*(s/2);break;case 3:t.lines+=a*(s-1);break;case 2:t.lines+=a*s;break;case 0:t.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){t.frame++,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}}class hf extends nn{constructor(e=null,t=1,n=1,i=1){super(null),this.image={data:e,width:t,height:n,depth:i},this.magFilter=Kt,this.minFilter=Kt,this.wrapR=bn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}hf.prototype.isDataTexture2DArray=!0;function bA(r,e){return r[0]-e[0]}function wA(r,e){return Math.abs(e[1])-Math.abs(r[1])}function j0(r,e){let t=1;const n=e.isInterleavedBufferAttribute?e.data.array:e.array;n instanceof Int8Array?t=127:n instanceof Int16Array?t=32767:n instanceof Int32Array?t=2147483647:console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ",n),r.divideScalar(t)}function SA(r,e,t){const n={},i=new Float32Array(8),s=new WeakMap,o=new F,a=[];for(let f=0;f<8;f++)a[f]=[f,0];function u(f,p,h,d){const g=f.morphTargetInfluences;if(e.isWebGL2===!0){const y=p.morphAttributes.position.length;let _=s.get(p);if(_===void 0||_.count!==y){let O=function(){B.dispose(),s.delete(p),p.removeEventListener("dispose",O)};_!==void 0&&_.texture.dispose();const v=p.morphAttributes.normal!==void 0,E=p.morphAttributes.position,M=p.morphAttributes.normal||[],A=p.attributes.position.count,C=v===!0?2:1;let L=A*C,D=1;L>e.maxTextureSize&&(D=Math.ceil(L/e.maxTextureSize),L=e.maxTextureSize);const k=new Float32Array(L*D*4*y),B=new hf(k,L,D,y);B.format=wn,B.type=Yn,B.needsUpdate=!0;const T=C*4;for(let H=0;H<y;H++){const W=E[H],V=M[H],j=L*D*4*H;for(let Z=0;Z<W.count;Z++){o.fromBufferAttribute(W,Z),W.normalized===!0&&j0(o,W);const ne=Z*T;k[j+ne+0]=o.x,k[j+ne+1]=o.y,k[j+ne+2]=o.z,k[j+ne+3]=0,v===!0&&(o.fromBufferAttribute(V,Z),V.normalized===!0&&j0(o,V),k[j+ne+4]=o.x,k[j+ne+5]=o.y,k[j+ne+6]=o.z,k[j+ne+7]=0)}}_={count:y,texture:B,size:new de(L,D)},s.set(p,_),p.addEventListener("dispose",O)}let w=0;for(let v=0;v<g.length;v++)w+=g[v];const x=p.morphTargetsRelative?1:1-w;d.getUniforms().setValue(r,"morphTargetBaseInfluence",x),d.getUniforms().setValue(r,"morphTargetInfluences",g),d.getUniforms().setValue(r,"morphTargetsTexture",_.texture,t),d.getUniforms().setValue(r,"morphTargetsTextureSize",_.size)}else{const y=g===void 0?0:g.length;let _=n[p.id];if(_===void 0||_.length!==y){_=[];for(let M=0;M<y;M++)_[M]=[M,0];n[p.id]=_}for(let M=0;M<y;M++){const A=_[M];A[0]=M,A[1]=g[M]}_.sort(wA);for(let M=0;M<8;M++)M<y&&_[M][1]?(a[M][0]=_[M][0],a[M][1]=_[M][1]):(a[M][0]=Number.MAX_SAFE_INTEGER,a[M][1]=0);a.sort(bA);const w=p.morphAttributes.position,x=p.morphAttributes.normal;let v=0;for(let M=0;M<8;M++){const A=a[M],C=A[0],L=A[1];C!==Number.MAX_SAFE_INTEGER&&L?(w&&p.getAttribute("morphTarget"+M)!==w[C]&&p.setAttribute("morphTarget"+M,w[C]),x&&p.getAttribute("morphNormal"+M)!==x[C]&&p.setAttribute("morphNormal"+M,x[C]),i[M]=L,v+=L):(w&&p.hasAttribute("morphTarget"+M)===!0&&p.deleteAttribute("morphTarget"+M),x&&p.hasAttribute("morphNormal"+M)===!0&&p.deleteAttribute("morphNormal"+M),i[M]=0)}const E=p.morphTargetsRelative?1:1-v;d.getUniforms().setValue(r,"morphTargetBaseInfluence",E),d.getUniforms().setValue(r,"morphTargetInfluences",i)}}return{update:u}}function MA(r,e,t,n){let i=new WeakMap;function s(u){const f=n.render.frame,p=u.geometry,h=e.get(u,p);return i.get(h)!==f&&(e.update(h),i.set(h,f)),u.isInstancedMesh&&(u.hasEventListener("dispose",a)===!1&&u.addEventListener("dispose",a),t.update(u.instanceMatrix,34962),u.instanceColor!==null&&t.update(u.instanceColor,34962)),h}function o(){i=new WeakMap}function a(u){const f=u.target;f.removeEventListener("dispose",a),t.remove(f.instanceMatrix),f.instanceColor!==null&&t.remove(f.instanceColor)}return{update:s,dispose:o}}class nm extends nn{constructor(e=null,t=1,n=1,i=1){super(null),this.image={data:e,width:t,height:n,depth:i},this.magFilter=Kt,this.minFilter=Kt,this.wrapR=bn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}nm.prototype.isDataTexture3D=!0;const V_=new nn,W_=new hf,$_=new nm,j_=new ia,q0=[],X0=[],Y0=new Float32Array(16),J0=new Float32Array(9),Z0=new Float32Array(4);function oa(r,e,t){const n=r[0];if(n<=0||n>0)return r;const i=e*t;let s=q0[i];if(s===void 0&&(s=new Float32Array(i),q0[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Fn(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 Rn(r,e){for(let t=0,n=e.length;t<n;t++)r[t]=e[t]}function pf(r,e){let t=X0[e];t===void 0&&(t=new Int32Array(e),X0[e]=t);for(let n=0;n!==e;++n)t[n]=r.allocateTextureUnit();return t}function EA(r,e){const t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function TA(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(Fn(t,e))return;r.uniform2fv(this.addr,e),Rn(t,e)}}function AA(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(Fn(t,e))return;r.uniform3fv(this.addr,e),Rn(t,e)}}function RA(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(Fn(t,e))return;r.uniform4fv(this.addr,e),Rn(t,e)}}function CA(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Fn(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),Rn(t,e)}else{if(Fn(t,n))return;Z0.set(n),r.uniformMatrix2fv(this.addr,!1,Z0),Rn(t,n)}}function PA(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Fn(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),Rn(t,e)}else{if(Fn(t,n))return;J0.set(n),r.uniformMatrix3fv(this.addr,!1,J0),Rn(t,n)}}function LA(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Fn(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),Rn(t,e)}else{if(Fn(t,n))return;Y0.set(n),r.uniformMatrix4fv(this.addr,!1,Y0),Rn(t,n)}}function IA(r,e){const t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function DA(r,e){const t=this.cache;Fn(t,e)||(r.uniform2iv(this.addr,e),Rn(t,e))}function OA(r,e){const t=this.cache;Fn(t,e)||(r.uniform3iv(this.addr,e),Rn(t,e))}function FA(r,e){const t=this.cache;Fn(t,e)||(r.uniform4iv(this.addr,e),Rn(t,e))}function BA(r,e){const t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function zA(r,e){const t=this.cache;Fn(t,e)||(r.uniform2uiv(this.addr,e),Rn(t,e))}function NA(r,e){const t=this.cache;Fn(t,e)||(r.uniform3uiv(this.addr,e),Rn(t,e))}function kA(r,e){const t=this.cache;Fn(t,e)||(r.uniform4uiv(this.addr,e),Rn(t,e))}function UA(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.safeSetTexture2D(e||V_,i)}function HA(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||$_,i)}function GA(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.safeSetTextureCube(e||j_,i)}function VA(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||W_,i)}function WA(r){switch(r){case 5126:return EA;case 35664:return TA;case 35665:return AA;case 35666:return RA;case 35674:return CA;case 35675:return PA;case 35676:return LA;case 5124:case 35670:return IA;case 35667:case 35671:return DA;case 35668:case 35672:return OA;case 35669:case 35673:return FA;case 5125:return BA;case 36294:return zA;case 36295:return NA;case 36296:return kA;case 35678:case 36198:case 36298:case 36306:case 35682:return UA;case 35679:case 36299:case 36307:return HA;case 35680:case 36300:case 36308:case 36293:return GA;case 36289:case 36303:case 36311:case 36292:return VA}}function $A(r,e){r.uniform1fv(this.addr,e)}function jA(r,e){const t=oa(e,this.size,2);r.uniform2fv(this.addr,t)}function qA(r,e){const t=oa(e,this.size,3);r.uniform3fv(this.addr,t)}function XA(r,e){const t=oa(e,this.size,4);r.uniform4fv(this.addr,t)}function YA(r,e){const t=oa(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function JA(r,e){const t=oa(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function ZA(r,e){const t=oa(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function KA(r,e){r.uniform1iv(this.addr,e)}function QA(r,e){r.uniform2iv(this.addr,e)}function eR(r,e){r.uniform3iv(this.addr,e)}function tR(r,e){r.uniform4iv(this.addr,e)}function nR(r,e){r.uniform1uiv(this.addr,e)}function rR(r,e){r.uniform2uiv(this.addr,e)}function iR(r,e){r.uniform3uiv(this.addr,e)}function sR(r,e){r.uniform4uiv(this.addr,e)}function oR(r,e,t){const n=e.length,i=pf(t,n);r.uniform1iv(this.addr,i);for(let s=0;s!==n;++s)t.safeSetTexture2D(e[s]||V_,i[s])}function aR(r,e,t){const n=e.length,i=pf(t,n);r.uniform1iv(this.addr,i);for(let s=0;s!==n;++s)t.setTexture3D(e[s]||$_,i[s])}function lR(r,e,t){const n=e.length,i=pf(t,n);r.uniform1iv(this.addr,i);for(let s=0;s!==n;++s)t.safeSetTextureCube(e[s]||j_,i[s])}function cR(r,e,t){const n=e.length,i=pf(t,n);r.uniform1iv(this.addr,i);for(let s=0;s!==n;++s)t.setTexture2DArray(e[s]||W_,i[s])}function uR(r){switch(r){case 5126:return $A;case 35664:return jA;case 35665:return qA;case 35666:return XA;case 35674:return YA;case 35675:return JA;case 35676:return ZA;case 5124:case 35670:return KA;case 35667:case 35671:return QA;case 35668:case 35672:return eR;case 35669:case 35673:return tR;case 5125:return nR;case 36294:return rR;case 36295:return iR;case 36296:return sR;case 35678:case 36198:case 36298:case 36306:case 35682:return oR;case 35679:case 36299:case 36307:return aR;case 35680:case 36300:case 36308:case 36293:return lR;case 36289:case 36303:case 36311:case 36292:return cR}}function fR(r,e,t){this.id=r,this.addr=t,this.cache=[],this.setValue=WA(e.type)}function q_(r,e,t){this.id=r,this.addr=t,this.cache=[],this.size=e.size,this.setValue=uR(e.type)}q_.prototype.updateCache=function(r){const e=this.cache;r instanceof Float32Array&&e.length!==r.length&&(this.cache=new Float32Array(r.length)),Rn(e,r)};function X_(r){this.id=r,this.seq=[],this.map={}}X_.prototype.setValue=function(r,e,t){const n=this.seq;for(let i=0,s=n.length;i!==s;++i){const o=n[i];o.setValue(r,e[o.id],t)}};const ch=/(\w+)(\])?(\[|\.)?/g;function K0(r,e){r.seq.push(e),r.map[e.id]=e}function dR(r,e,t){const n=r.name,i=n.length;for(ch.lastIndex=0;;){const s=ch.exec(n),o=ch.lastIndex;let a=s[1];const u=s[2]==="]",f=s[3];if(u&&(a=a|0),f===void 0||f==="["&&o+2===i){K0(t,f===void 0?new fR(a,r,e):new q_(a,r,e));break}else{let h=t.map[a];h===void 0&&(h=new X_(a),K0(t,h)),t=h}}}function Ui(r,e){this.seq=[],this.map={};
2956const t=r.getProgramParameter(e,35718);for(let n=0;n<t;++n){const i=r.getActiveUniform(e,n),s=r.getUniformLocation(e,i.name);dR(i,s,this)}}Ui.prototype.setValue=function(r,e,t,n){const i=this.map[e];i!==void 0&&i.setValue(r,t,n)};Ui.prototype.setOptional=function(r,e,t){const n=e[t];n!==void 0&&this.setValue(r,t,n)};Ui.upload=function(r,e,t,n){for(let i=0,s=e.length;i!==s;++i){const o=e[i],a=t[o.id];a.needsUpdate!==!1&&o.setValue(r,a.value,n)}};Ui.seqWithValue=function(r,e){const t=[];for(let n=0,i=r.length;n!==i;++n){const s=r[n];s.id in e&&t.push(s)}return t};function Q0(r,e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}let hR=0;function pR(r){const e=r.split(` 2957`);for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join(` 2958`)}function mR(r){switch(r){case Kn:return["Linear","( value )"];case Rt:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",r),["Linear","( value )"]}}function ey(r,e,t){const n=r.getShaderParameter(e,35713),i=r.getShaderInfoLog(e).trim();return n&&i===""?"":t.toUpperCase()+` 2959 2960`+i+` 2961 2962`+pR(r.getShaderSource(e))}function gR(r,e){const t=mR(e);return"vec4 "+r+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function yR(r,e){let t;switch(e){case e_:t="Linear";break;case t_:t="Reinhard";break;case n_:t="OptimizedCineon";break;case Zp:t="ACESFilmic";break;case r_:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function vR(r){return[r.extensionDerivatives||r.envMapCubeUV||r.bumpMap||r.tangentSpaceNormalMap||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(Qa).join(` 2963`)}function xR(r){const e=[];for(const t in r){const n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` 2964`)}function _R(r,e){const t={},n=r.getProgramParameter(e,35721);for(let i=0;i<n;i++){const s=r.getActiveAttrib(e,i),o=s.name;let a=1;s.type===35674&&(a=2),s.type===35675&&(a=3),s.type===35676&&(a=4),t[o]={type:s.type,location:r.getAttribLocation(e,o),locationSize:a}}return t}function Qa(r){return r!==""}function ty(r,e){return r.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).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/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function ny(r,e){return r.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const bR=/^[ \t]*#include +<([\w\d./]+)>/gm;function pp(r){return r.replace(bR,wR)}function wR(r,e){const t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return pp(t)}const SR=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,MR=/#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 ry(r){return r.replace(MR,Y_).replace(SR,ER)}function ER(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Y_(r,e,t,n)}function Y_(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 iy(r){let e="precision "+r.precision+` float; 2965precision `+r.precision+" int;";return r.precision==="highp"?e+=` 2966#define HIGH_PRECISION`:r.precision==="mediump"?e+=` 2967#define MEDIUM_PRECISION`:r.precision==="lowp"&&(e+=` 2968#define LOW_PRECISION`),e}function TR(r){let e="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===jp?e="SHADOWMAP_TYPE_PCF":r.shadowMapType===qp?e="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===Co&&(e="SHADOWMAP_TYPE_VSM"),e}function AR(r){let e="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case $i:case Bs:e="ENVMAP_TYPE_CUBE";break;case ra:case Ll:e="ENVMAP_TYPE_CUBE_UV";break}return e}function RR(r){let e="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case Bs:case Ll:e="ENVMAP_MODE_REFRACTION";break}return e}function CR(r){let e="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case Pl:e="ENVMAP_BLENDING_MULTIPLY";break;case Kx:e="ENVMAP_BLENDING_MIX";break;case Qx:e="ENVMAP_BLENDING_ADD";break}return e}function PR(r,e,t,n){const i=r.getContext(),s=t.defines;let o=t.vertexShader,a=t.fragmentShader;const u=TR(t),f=AR(t),p=RR(t),h=CR(t),d=t.isWebGL2?"":vR(t),g=xR(s),y=i.createProgram();let _,w,x=t.glslVersion?"#version "+t.glslVersion+` 2969`:"";t.isRawShaderMaterial?(_=[g].filter(Qa).join(` 2970`),_.length>0&&(_+=` 2971`),w=[d,g].filter(Qa).join(` 2972`),w.length>0&&(w+=` 2973`)):(_=[iy(t),"#define SHADER_NAME "+t.shaderName,g,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define MAX_BONES "+t.maxBones,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 "+p:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargets&&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.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_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",` 2974`].filter(Qa).join(` 2975`),w=[d,iy(t),"#define SHADER_NAME "+t.shaderName,g,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 "+f:"",t.envMap?"#define "+p:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",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.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Fr?"#define TONE_MAPPING":"",t.toneMapping!==Fr?at.tonemapping_pars_fragment:"",t.toneMapping!==Fr?yR("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.transparent?"":"#define OPAQUE",at.encodings_pars_fragment,gR("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` 2976`].filter(Qa).join(` 2977`)),o=pp(o),o=ty(o,t),o=ny(o,t),a=pp(a),a=ty(a,t),a=ny(a,t),o=ry(o),a=ry(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(x=`#version 300 es 2978`,_=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` 2979`)+` 2980`+_,w=["#define varying in",t.glslVersion===fp?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===fp?"":"#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(` 2981`)+` 2982`+w);
2982const v=x+_+o,E=x+w+a,M=Q0(i,35633,v),A=Q0(i,35632,E);if(i.attachShader(y,M),i.attachShader(y,A),t.index0AttributeName!==void 0?i.bindAttribLocation(y,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(y,0,"position"),i.linkProgram(y),r.debug.checkShaderErrors){const D=i.getProgramInfoLog(y).trim(),k=i.getShaderInfoLog(M).trim(),B=i.getShaderInfoLog(A).trim();let T=!0,O=!0;if(i.getProgramParameter(y,35714)===!1){T=!1;const H=ey(i,M,"vertex"),W=ey(i,A,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(y,35715)+` 2983 2984Program Info Log: `+D+` 2985`+H+` 2986`+W)}else D!==""?console.warn("THREE.WebGLProgram: Program Info Log:",D):(k===""||B==="")&&(O=!1);O&&(this.diagnostics={runnable:T,programLog:D,vertexShader:{log:k,prefix:_},fragmentShader:{log:B,prefix:w}})}i.deleteShader(M),i.deleteShader(A);let C;this.getUniforms=function(){return C===void 0&&(C=new Ui(i,y)),C};let L;return this.getAttributes=function(){return L===void 0&&(L=_R(i,y)),L},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(y),this.program=void 0},this.name=t.shaderName,this.id=hR++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=M,this.fragmentShader=A,this}let LR=0;class IR{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),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.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);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;return t.has(e)===!1&&t.set(e,new Set),t.get(e)}_getShaderStage(e){const t=this.shaderCache;if(t.has(e)===!1){const n=new DR;t.set(e,n)}return t.get(e)}}class DR{constructor(){this.id=LR++,this.usedTimes=0}}function OR(r,e,t,n,i,s,o){const a=new bs,u=new IR,f=[],p=i.isWebGL2,h=i.logarithmicDepthBuffer,d=i.floatVertexTextures,g=i.maxVertexUniforms,y=i.vertexTextures;let _=i.precision;const w={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 x(T){const H=T.skeleton.bones;if(d)return 1024;{const V=Math.floor((g-20)/4),j=Math.min(V,H.length);return j<H.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+H.length+" bones. This GPU supports "+j+"."),0):j}}function v(T,O,H,W,V){const j=W.fog,Z=T.isMeshStandardMaterial?W.environment:null,ne=(T.isMeshStandardMaterial?t:e).get(T.envMap||Z),ge=w[T.type],Y=V.isSkinnedMesh?x(V):0;T.precision!==null&&(_=i.getMaxPrecision(T.precision),_!==T.precision&&console.warn("THREE.WebGLProgram.getParameters:",T.precision,"not supported, using",_,"instead."));let ee,ue,ye,xe;if(ge){const Me=_r[ge];ee=Me.vertexShader,ue=Me.fragmentShader}else ee=T.vertexShader,ue=T.fragmentShader,u.update(T),ye=u.getVertexShaderID(T),xe=u.getFragmentShaderID(T);const re=r.getRenderTarget(),Xe=T.alphaTest>0,Le=T.clearcoat>0;return{isWebGL2:p,shaderID:ge,shaderName:T.type,vertexShader:ee,fragmentShader:ue,defines:T.defines,customVertexShaderID:ye,customFragmentShaderID:xe,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:_,instancing:V.isInstancedMesh===!0,instancingColor:V.isInstancedMesh===!0&&V.instanceColor!==null,supportsVertexTextures:y,outputEncoding:re===null?r.outputEncoding:re.isXRRenderTarget===!0?re.texture.encoding:Kn,map:!!T.map,matcap:!!T.matcap,envMap:!!ne,envMapMode:ne&&ne.mapping,envMapCubeUV:!!ne&&(ne.mapping===ra||ne.mapping===Ll),lightMap:!!T.lightMap,aoMap:!!T.aoMap,emissiveMap:!!T.emissiveMap,bumpMap:!!T.bumpMap,normalMap:!!T.normalMap,objectSpaceNormalMap:T.normalMapType===E_,tangentSpaceNormalMap:T.normalMapType===Ns,decodeVideoTexture:!!T.map&&T.map.isVideoTexture===!0&&T.map.encoding===Rt,clearcoat:Le,clearcoatMap:Le&&!!T.clearcoatMap,clearcoatRoughnessMap:Le&&!!T.clearcoatRoughnessMap,clearcoatNormalMap:Le&&!!T.clearcoatNormalMap,displacementMap:!!T.displacementMap,roughnessMap:!!T.roughnessMap,metalnessMap:!!T.metalnessMap,specularMap:!!T.specularMap,specularIntensityMap:!!T.specularIntensityMap,specularColorMap:!!T.specularColorMap,transparent:T.transparent,alphaMap:!!T.alphaMap,alphaTest:Xe,gradientMap:!!T.gradientMap,sheen:T.sheen>0,sheenColorMap:!!T.sheenColorMap,sheenRoughnessMap:!!T.sheenRoughnessMap,transmission:T.transmission>0,transmissionMap:!!T.transmissionMap,thicknessMap:!!T.thicknessMap,combine:T.combine,vertexTangents:!!T.normalMap&&!!V.geometry&&!!V.geometry.attributes.tangent,vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!V.geometry&&!!V.geometry.attributes.color&&V.geometry.attributes.color.itemSize===4,vertexUvs:!!T.map||!!T.bumpMap||!!T.normalMap||!!T.specularMap||!!T.alphaMap||!!T.emissiveMap||!!T.roughnessMap||!!T.metalnessMap||!!T.clearcoatMap||!!T.clearcoatRoughnessMap||!!T.clearcoatNormalMap||!!T.displacementMap||!!T.transmissionMap||!!T.thicknessMap||!!T.specularIntensityMap||!!T.specularColorMap||!!T.sheenColorMap||!!T.sheenRoughnessMap,uvsVertexOnly:!(!!T.map||!!T.bumpMap||!!T.normalMap||!!T.specularMap||!!T.alphaMap||!!T.emissiveMap||!!T.roughnessMap||!!T.metalnessMap||!!T.clearcoatNormalMap||T.transmission>0||!!T.transmissionMap||!!T.thicknessMap||!!T.specularIntensityMap||!!T.specularColorMap||T.sheen>0||!!T.sheenColorMap||!!T.sheenRoughnessMap)&&!!T.displacementMap,fog:!!j,useFog:T.fog,fogExp2:j&&j.isFogExp2,flatShading:!!T.flatShading,sizeAttenuation:T.sizeAttenuation,logarithmicDepthBuffer:h,skinning:V.isSkinnedMesh===!0&&Y>0,maxBones:Y,useVertexTexture:d,morphTargets:!!V.geometry&&!!V.geometry.morphAttributes.position,morphNormals:!!V.geometry&&!!V.geometry.morphAttributes.normal,morphTargetsCount:!!V.geometry&&!!V.geometry.morphAttributes.position?V.geometry.morphAttributes.position.length:0,numDirLights:O.directional.length,numPointLights:O.point.length,numSpotLights:O.spot.length,numRectAreaLights:O.rectArea.length,numHemiLights:O.hemi.length,numDirLightShadows:O.directionalShadowMap.length,numPointLightShadows:O.pointShadowMap.length,numSpotLightShadows:O.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:T.dithering,shadowMapEnabled:r.shadowMap.enabled&&H.length>0,shadowMapType:r.shadowMap.type,toneMapping:T.toneMapped?r.toneMapping:Fr,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===Ts,flipSided:T.side===Zt,depthPacking:T.depthPacking!==void 0?T.depthPacking:!1,index0AttributeName:T.index0AttributeName,extensionDerivatives:T.extensions&&T.extensions.derivatives,extensionFragDepth:T.extensions&&T.extensions.fragDepth,extensionDrawBuffers:T.extensions&&T.extensions.drawBuffers,extensionShaderTextureLOD:T.extensions&&T.extensions.shaderTextureLOD,rendererExtensionFragDepth:
vendor: 13,013 bytes, lines 2986-2992
2986p||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:p||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:p||n.has("EXT_shader_texture_lod"),customProgramCacheKey:T.customProgramCacheKey()}}function E(T){const O=[];if(T.shaderID?O.push(T.shaderID):(O.push(T.customVertexShaderID),O.push(T.customFragmentShaderID)),T.defines!==void 0)for(const H in T.defines)O.push(H),O.push(T.defines[H]);return T.isRawShaderMaterial===!1&&(M(O,T),A(O,T),O.push(r.outputEncoding)),O.push(T.customProgramCacheKey),O.join()}function M(T,O){T.push(O.precision),T.push(O.outputEncoding),T.push(O.envMapMode),T.push(O.combine),T.push(O.vertexUvs),T.push(O.fogExp2),T.push(O.sizeAttenuation),T.push(O.maxBones),T.push(O.morphTargetsCount),T.push(O.numDirLights),T.push(O.numPointLights),T.push(O.numSpotLights),T.push(O.numHemiLights),T.push(O.numRectAreaLights),T.push(O.numDirLightShadows),T.push(O.numPointLightShadows),T.push(O.numSpotLightShadows),T.push(O.shadowMapType),T.push(O.toneMapping),T.push(O.numClippingPlanes),T.push(O.numClipIntersection)}function A(T,O){a.disableAll(),O.isWebGL2&&a.enable(0),O.supportsVertexTextures&&a.enable(1),O.instancing&&a.enable(2),O.instancingColor&&a.enable(3),O.map&&a.enable(4),O.matcap&&a.enable(5),O.envMap&&a.enable(6),O.envMapCubeUV&&a.enable(7),O.lightMap&&a.enable(8),O.aoMap&&a.enable(9),O.emissiveMap&&a.enable(10),O.bumpMap&&a.enable(11),O.normalMap&&a.enable(12),O.objectSpaceNormalMap&&a.enable(13),O.tangentSpaceNormalMap&&a.enable(14),O.clearcoat&&a.enable(15),O.clearcoatMap&&a.enable(16),O.clearcoatRoughnessMap&&a.enable(17),O.clearcoatNormalMap&&a.enable(18),O.displacementMap&&a.enable(19),O.specularMap&&a.enable(20),O.roughnessMap&&a.enable(21),O.metalnessMap&&a.enable(22),O.gradientMap&&a.enable(23),O.alphaMap&&a.enable(24),O.alphaTest&&a.enable(25),O.vertexColors&&a.enable(26),O.vertexAlphas&&a.enable(27),O.vertexUvs&&a.enable(28),O.vertexTangents&&a.enable(29),O.uvsVertexOnly&&a.enable(30),O.fog&&a.enable(31),T.push(a.mask),a.disableAll(),O.useFog&&a.enable(0),O.flatShading&&a.enable(1),O.logarithmicDepthBuffer&&a.enable(2),O.skinning&&a.enable(3),O.useVertexTexture&&a.enable(4),O.morphTargets&&a.enable(5),O.morphNormals&&a.enable(6),O.premultipliedAlpha&&a.enable(7),O.shadowMapEnabled&&a.enable(8),O.physicallyCorrectLights&&a.enable(9),O.doubleSided&&a.enable(10),O.flipSided&&a.enable(11),O.depthPacking&&a.enable(12),O.dithering&&a.enable(13),O.specularIntensityMap&&a.enable(14),O.specularColorMap&&a.enable(15),O.transmission&&a.enable(16),O.transmissionMap&&a.enable(17),O.thicknessMap&&a.enable(18),O.sheen&&a.enable(19),O.sheenColorMap&&a.enable(20),O.sheenRoughnessMap&&a.enable(21),O.decodeVideoTexture&&a.enable(22),O.transparent&&a.enable(23),T.push(a.mask)}function C(T){const O=w[T.type];let H;if(O){const W=_r[O];H=k_.clone(W.uniforms)}else H=T.uniforms;return H}function L(T,O){let H;for(let W=0,V=f.length;W<V;W++){const j=f[W];if(j.cacheKey===O){H=j,++H.usedTimes;break}}return H===void 0&&(H=new PR(r,O,T,s),f.push(H)),H}function D(T){if(--T.usedTimes===0){const O=f.indexOf(T);f[O]=f[f.length-1],f.pop(),T.destroy()}}function k(T){u.remove(T)}function B(){u.dispose()}return{getParameters:v,getProgramCacheKey:E,getUniforms:C,acquireProgram:L,releaseProgram:D,releaseShaderCache:k,programs:f,dispose:B}}function FR(){let r=new WeakMap;function e(s){let o=r.get(s);return o===void 0&&(o={},r.set(s,o)),o}function t(s){r.delete(s)}function n(s,o,a){r.get(s)[o]=a}function i(){r=new WeakMap}return{get:e,remove:t,update:n,dispose:i}}function BR(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 sy(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 oy(){const r=[];let e=0;const t=[],n=[],i=[];function s(){e=0,t.length=0,n.length=0,i.length=0}function o(h,d,g,y,_,w){let x=r[e];return x===void 0?(x={id:h.id,object:h,geometry:d,material:g,groupOrder:y,renderOrder:h.renderOrder,z:_,group:w},r[e]=x):(x.id=h.id,x.object=h,x.geometry=d,x.material=g,x.groupOrder=y,x.renderOrder=h.renderOrder,x.z=_,x.group=w),e++,x}function a(h,d,g,y,_,w){const x=o(h,d,g,y,_,w);g.transmission>0?n.push(x):g.transparent===!0?i.push(x):t.push(x)}function u(h,d,g,y,_,w){const x=o(h,d,g,y,_,w);g.transmission>0?n.unshift(x):g.transparent===!0?i.unshift(x):t.unshift(x)}function f(h,d){t.length>1&&t.sort(h||BR),n.length>1&&n.sort(d||sy),i.length>1&&i.sort(d||sy)}function p(){for(let h=e,d=r.length;h<d;h++){const g=r[h];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:a,unshift:u,finish:p,sort:f}}function zR(){let r=new WeakMap;function e(n,i){let s;return r.has(n)===!1?(s=new oy,r.set(n,[s])):i>=r.get(n).length?(s=new oy,r.get(n).push(s)):s=r.get(n)[i],s}function t(){r=new WeakMap}return{get:e,dispose:t}}function NR(){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 F,color:new Ae};break;case"SpotLight":t={position:new F,direction:new F,color:new Ae,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new Ae,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new Ae,groundColor:new Ae};break;case"RectAreaLight":t={color:new Ae,position:new F,halfWidth:new F,halfHeight:new F};break}return r[e.id]=t,t}}}function kR(){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 de};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let UR=0;function HR(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function GR(r,e){const t=new NR,n=kR(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let p=0;p<9;p++)i.probe.push(new F);const s=new F,o=new ke,a=new ke;function u(p,h){let d=0,g=0,y=0;for(let k=0;k<9;k++)i.probe[k].set(0,0,0);let _=0,w=0,x=0,v=0,E=0,M=0,A=0,C=0;p.sort(HR);const L=h!==!0?Math.PI:1;for(let k=0,B=p.length;k<B;k++){const T=p[k],O=T.color,H=T.intensity,W=T.distance,V=T.shadow&&T.shadow.map?T.shadow.map.texture:null;if(T.isAmbientLight)d+=O.r*H*L,g+=O.g*H*L,y+=O.b*H*L;else if(T.isLightProbe)for(let j=0;j<9;j++)i.probe[j].addScaledVector(T.sh.coefficients[j],H);else if(T.isDirectionalLight){const j=t.get(T);if(j.color.copy(T.color).multiplyScalar(T.intensity*L),T.castShadow){const Z=T.shadow,ne=n.get(T);ne.shadowBias=Z.bias,ne.shadowNormalBias=Z.normalBias,ne.shadowRadius=Z.radius,ne.shadowMapSize=Z.mapSize,i.directionalShadow[_]=ne,i.directionalShadowMap[_]=V,i.directionalShadowMatrix[_]=T.shadow.matrix,M++}i.directional[_]=j,_++}else if(T.isSpotLight){const j=t.get(T);if(j.position.setFromMatrixPosition(T.matrixWorld),j.color.copy(O).multiplyScalar(H*L),j.distance=W,j.coneCos=Math.cos(T.angle),j.penumbraCos=Math.cos(T.angle*(1-T.penumbra)),j.decay=T.decay,T.castShadow){const Z=T.shadow,ne=n.get(T);ne.shadowBias=Z.bias,ne.shadowNormalBias=Z.normalBias,ne.shadowRadius=Z.radius,ne.shadowMapSize=Z.mapSize,i.spotShadow[x]=ne,i.spotShadowMap[x]=V,i.spotShadowMatrix[x]=T.shadow.matrix,C++}i.spot[x]=j,x++}else if(T.isRectAreaLight){const j=t.get(T);j.color.copy(O).multiplyScalar(H),j.halfWidth.set(T.width*.5,0,0),j.halfHeight.set(0,T.height*.5,0),i.rectArea[v]=j,v++}else if(T.isPointLight){const j=t.get(T);if(j.color.copy(T.color).multiplyScalar(T.intensity*L),j.distance=T.distance,j.decay=T.decay,T.castShadow){const Z=T.shadow,ne=n.get(T);ne.shadowBias=Z.bias,ne.shadowNormalBias=Z.normalBias,ne.shadowRadius=Z.radius,ne.shadowMapSize=Z.mapSize,ne.shadowCameraNear=Z.camera.near,ne.shadowCameraFar=Z.camera.far,i.pointShadow[w]=ne,i.pointShadowMap[w]=V,i.pointShadowMatrix[w]=T.shadow.matrix,A++}i.point[w]=j,w++}else if(T.isHemisphereLight){const j=t.get(T);j.skyColor.copy(T.color).multiplyScalar(H*L),j.groundColor.copy(T.groundColor).multiplyScalar(H*L),i.hemi[E]=j,E++}}v>0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Se.LTC_FLOAT_1,i.rectAreaLTC2=Se.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=Se.LTC_HALF_1,i.rectAreaLTC2=Se.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=d,i.ambient[1]=g,i.ambient[2]=y;const D=i.hash;(D.directionalLength!==_||D.pointLength!==w||D.spotLength!==x||D.rectAreaLength!==v||D.hemiLength!==E||D.numDirectionalShadows!==M||D.numPointShadows!==A||D.numSpotShadows!==C)&&(i.directional.length=_,i.spot.length=x,i.rectArea.length=v,i.point.length=w,i.hemi.length=E,i.directionalShadow.length=M,i.directionalShadowMap.length=M,i.pointShadow.length=A,i.pointShadowMap.length=A,i.spotShadow.length=C,i.spotShadowMap.length=C,i.directionalShadowMatrix.length=M,i.pointShadowMatrix.length=A,i.spotShadowMatrix.length=C,D.directionalLength=_,D.pointLength=w,D.spotLength=x,D.rectAreaLength=v,D.hemiLength=E,D.numDirectionalShadows=M,D.numPointShadows=A,D.numSpotShadows=C,i.version=UR++)}function f(p,h){let d=0,g=0,y=0,_=0,w=0;const x=h.matrixWorldInverse;for(let v=0,E=p.length;v<E;v++){const M=p[v];if(M.isDirectionalLight){const A=i.directional[d];A.direction.setFromMatrixPosition(M.matrixWorld),s.setFromMatrixPosition(M.target.matrixWorld),A.direction.sub(s),A.direction.transformDirection(x),d++}else if(M.isSpotLight){const A=i.spot[y];A.position.setFromMatrixPosition(M.matrixWorld),A.position.applyMatrix4(x),A.direction.setFromMatrixPosition(M.matrixWorld),s.setFromMatrixPosition(M.target.matrixWorld),A.direction.sub(s),A.direction.transformDirection(x),y++}else if(M.isRectAreaLight){const A=i.rectArea[_];A.position.setFromMatrixPosition(M.matrixWorld),A.position.applyMatrix4(x),a.identity(),o.copy(M.matrixWorld),o.premultiply(x),a.extractRotation(o),A.halfWidth.set(M.width*.5,0,0),A.halfHeight.set(0,M.height*.5,0),A.halfWidth.applyMatrix4(a),A.halfHeight.applyMatrix4(a),_++}else if(M.isPointLight){const A=i.point[g];A.position.setFromMatrixPosition(M.matrixWorld),A.position.applyMatrix4(x),g++}else if(M.isHemisphereLight){const A=i.hemi[w];A.direction.setFromMatrixPosition(M.matrixWorld),A.direction.transformDirection(x),A.direction.normalize(),w++}}}return{setup:u,setupView:f,state:i}}function ay(r,e){const t=new GR(r,e),n=[],i=[];function s(){n.length=0,i.length=0}function o(h){n.push(h)}function a(h){i.push(h)}function u(h){t.setup(n,h)}function f(h){t.setupView(n,h)}return{init:s,state:{lightsArray:n,shadowsArray:i,lights:t},setupLights:u,setupLightsView:f,pushLight:o,pushShadow:a}}function VR(r,e){let t=new WeakMap;function n(s,o=0){let a;return t.has(s)===!1?(a=new ay(r,e),t.set(s,[a])):o>=t.get(s).length?(a=new ay(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}class mf extends pn{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=S_,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}mf.prototype.isMeshDepthMaterial=!0;class gf extends pn{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new F,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}gf.prototype.isMeshDistanceMaterial=!0;const WR=`void main() { 2987 gl_Position = vec4( position, 1.0 ); 2988}`,$R=`uniform sampler2D shadow_pass; 2989uniform vec2 resolution; 2990uniform float radius; 2991#include <packing> 2992void main() {
2993 const float samples = float( VSM_SAMPLES ); 2994 float mean = 0.0; 2995 float squared_mean = 0.0; 2996 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 2997 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 2998 for ( float i = 0.0; i < samples; i ++ ) { 2999 float uvOffset = uvStart + i * uvStride; 3000 #ifdef HORIZONTAL_PASS 3001 vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); 3002 mean += distribution.x; 3003 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 3004 #else 3005 float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); 3006 mean += depth; 3007 squared_mean += depth * depth; 3008 #endif 3009 } 3010 mean = mean / samples; 3011 squared_mean = squared_mean / samples; 3012 float std_dev = sqrt( squared_mean - mean * mean ); 3013 gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); 3014}`;function J_(r,e,t){let n=new Dl;const i=new de,s=new de,o=new Mt,a=new mf({depthPacking:M_}),u=new gf,f={},p=t.maxTextureSize,h={0:Zt,1:Es,2:Ts},d=new ci({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new de},radius:{value:4}},vertexShader:WR,fragmentShader:$R}),g=d.clone();g.defines.HORIZONTAL_PASS=1;const y=new Je;y.setAttribute("position",new pt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new on(y,d),w=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=jp,this.render=function(M,A,C){if(w.enabled===!1||w.autoUpdate===!1&&w.needsUpdate===!1||M.length===0)return;const L=r.getRenderTarget(),D=r.getActiveCubeFace(),k=r.getActiveMipmapLevel(),B=r.state;B.setBlending(si),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);for(let T=0,O=M.length;T<O;T++){const H=M[T],W=H.shadow;if(W===void 0){console.warn("THREE.WebGLShadowMap:",H,"has no shadow.");continue}if(W.autoUpdate===!1&&W.needsUpdate===!1)continue;i.copy(W.mapSize);const V=W.getFrameExtents();if(i.multiply(V),s.copy(W.mapSize),(i.x>p||i.y>p)&&(i.x>p&&(s.x=Math.floor(p/V.x),i.x=s.x*V.x,W.mapSize.x=s.x),i.y>p&&(s.y=Math.floor(p/V.y),i.y=s.y*V.y,W.mapSize.y=s.y)),W.map===null&&!W.isPointLightShadow&&this.type===Co){const Z={minFilter:Pt,magFilter:Pt,format:wn};W.map=new Zn(i.x,i.y,Z),W.map.texture.name=H.name+".shadowMap",W.mapPass=new Zn(i.x,i.y,Z),W.camera.updateProjectionMatrix()}if(W.map===null){const Z={minFilter:Kt,magFilter:Kt,format:wn};W.map=new Zn(i.x,i.y,Z),W.map.texture.name=H.name+".shadowMap",W.camera.updateProjectionMatrix()}r.setRenderTarget(W.map),r.clear();const j=W.getViewportCount();for(let Z=0;Z<j;Z++){const ne=W.getViewport(Z);o.set(s.x*ne.x,s.y*ne.y,s.x*ne.z,s.y*ne.w),B.viewport(o),W.updateMatrices(H,Z),n=W.getFrustum(),E(A,C,W.camera,H,this.type)}!W.isPointLightShadow&&this.type===Co&&x(W,C),W.needsUpdate=!1}w.needsUpdate=!1,r.setRenderTarget(L,D,k)};function x(M,A){const C=e.update(_);d.defines.VSM_SAMPLES!==M.blurSamples&&(d.defines.VSM_SAMPLES=M.blurSamples,g.defines.VSM_SAMPLES=M.blurSamples,d.needsUpdate=!0,g.needsUpdate=!0),d.uniforms.shadow_pass.value=M.map.texture,d.uniforms.resolution.value=M.mapSize,d.uniforms.radius.value=M.radius,r.setRenderTarget(M.mapPass),r.clear(),r.renderBufferDirect(A,null,C,d,_,null),g.uniforms.shadow_pass.value=M.mapPass.texture,g.uniforms.resolution.value=M.mapSize,g.uniforms.radius.value=M.radius,r.setRenderTarget(M.map),r.clear(),r.renderBufferDirect(A,null,C,g,_,null)}function v(M,A,C,L,D,k,B){let T=null;const O=L.isPointLight===!0?M.customDistanceMaterial:M.customDepthMaterial;if(O!==void 0?T=O:T=L.isPointLight===!0?u:a,r.localClippingEnabled&&C.clipShadows===!0&&C.clippingPlanes.length!==0||C.displacementMap&&C.displacementScale!==0||C.alphaMap&&C.alphaTest>0){const H=T.uuid,W=C.uuid;let V=f[H];V===void 0&&(V={},f[H]=V);let j=V[W];j===void 0&&(j=T.clone(),V[W]=j),T=j}return T.visible=C.visible,T.wireframe=C.wireframe,B===Co?T.side=C.shadowSide!==null?C.shadowSide:C.side:T.side=C.shadowSide!==null?C.shadowSide:h[C.side],T.alphaMap=C.alphaMap,T.alphaTest=C.alphaTest,T.clipShadows=C.clipShadows,T.clippingPlanes=C.clippingPlanes,T.clipIntersection=C.clipIntersection,T.displacementMap=C.displacementMap,T.displacementScale=C.displacementScale,T.displacementBias=C.displacementBias,T.wireframeLinewidth=C.wireframeLinewidth,T.linewidth=C.linewidth,L.isPointLight===!0&&T.isMeshDistanceMaterial===!0&&(T.referencePosition.setFromMatrixPosition(L.matrixWorld),T.nearDistance=D,T.farDistance=k),T}function E(M,A,C,L,D){if(M.visible===!1)return;
3014if(M.layers.test(A.layers)&&(M.isMesh||M.isLine||M.isPoints)&&(M.castShadow||M.receiveShadow&&D===Co)&&(!M.frustumCulled||n.intersectsObject(M))){M.modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,M.matrixWorld);const T=e.update(M),O=M.material;if(Array.isArray(O)){const H=T.groups;for(let W=0,V=H.length;W<V;W++){const j=H[W],Z=O[j.materialIndex];if(Z&&Z.visible){const ne=v(M,T,Z,L,C.near,C.far,D);r.renderBufferDirect(C,null,T,ne,M,j)}}}else if(O.visible){const H=v(M,T,O,L,C.near,C.far,D);r.renderBufferDirect(C,null,T,H,M,null)}}const B=M.children;for(let T=0,O=B.length;T<O;T++)E(B[T],A,C,L,D)}}function jR(r,e,t){const n=t.isWebGL2;function i(){let q=!1;const De=new Mt;let Re=null;const We=new Mt(0,0,0,0);return{setMask:function(ce){Re!==ce&&!q&&(r.colorMask(ce,ce,ce,ce),Re=ce)},setLocked:function(ce){q=ce},setClear:function(ce,Ue,lt,Lt,Pn){Pn===!0&&(ce*=Lt,Ue*=Lt,lt*=Lt),De.set(ce,Ue,lt,Lt),We.equals(De)===!1&&(r.clearColor(ce,Ue,lt,Lt),We.copy(De))},reset:function(){q=!1,Re=null,We.set(-1,0,0,0)}}}function s(){let q=!1,De=null,Re=null,We=null;return{setTest:function(ce){ce?re(2929):Xe(2929)},setMask:function(ce){De!==ce&&!q&&(r.depthMask(ce),De=ce)},setFunc:function(ce){if(Re!==ce){if(ce)switch(ce){case $x:r.depthFunc(512);break;case jx:r.depthFunc(519);break;case qx:r.depthFunc(513);break;case Gu:r.depthFunc(515);break;case Xx:r.depthFunc(514);break;case Yx:r.depthFunc(518);break;case Jx:r.depthFunc(516);break;case Zx:r.depthFunc(517);break;default:r.depthFunc(515)}else r.depthFunc(515);Re=ce}},setLocked:function(ce){q=ce},setClear:function(ce){We!==ce&&(r.clearDepth(ce),We=ce)},reset:function(){q=!1,De=null,Re=null,We=null}}}function o(){let q=!1,De=null,Re=null,We=null,ce=null,Ue=null,lt=null,Lt=null,Pn=null;return{setTest:function(kt){q||(kt?re(2960):Xe(2960))},setMask:function(kt){De!==kt&&!q&&(r.stencilMask(kt),De=kt)},setFunc:function(kt,tr,pr){(Re!==kt||We!==tr||ce!==pr)&&(r.stencilFunc(kt,tr,pr),Re=kt,We=tr,ce=pr)},setOp:function(kt,tr,pr){(Ue!==kt||lt!==tr||Lt!==pr)&&(r.stencilOp(kt,tr,pr),Ue=kt,lt=tr,Lt=pr)},setLocked:function(kt){q=kt},setClear:function(kt){Pn!==kt&&(r.clearStencil(kt),Pn=kt)},reset:function(){q=!1,De=null,Re=null,We=null,ce=null,Ue=null,lt=null,Lt=null,Pn=null}}}const a=new i,u=new s,f=new o;let p={},h={},d=new WeakMap,g=[],y=null,_=!1,w=null,x=null,v=null,E=null,M=null,A=null,C=null,L=!1,D=null,k=null,B=null,T=null,O=null;const H=r.getParameter(35661);let W=!1,V=0;const j=r.getParameter(7938);j.indexOf("WebGL")!==-1?(V=parseFloat(/^WebGL (\d)/.exec(j)[1]),W=V>=1):j.indexOf("OpenGL ES")!==-1&&(V=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),W=V>=2);let Z=null,ne={};const ge=r.getParameter(3088),Y=r.getParameter(2978),ee=new Mt().fromArray(ge),ue=new Mt().fromArray(Y);function ye(q,De,Re){const We=new Uint8Array(4),ce=r.createTexture();r.bindTexture(q,ce),r.texParameteri(q,10241,9728),r.texParameteri(q,10240,9728);for(let Ue=0;Ue<Re;Ue++)r.texImage2D(De+Ue,0,6408,1,1,0,6408,5121,We);return ce}const xe={};xe[3553]=ye(3553,3553,1),xe[34067]=ye(34067,34069,6),a.setClear(0,0,0,1),u.setClear(1),f.setClear(0),re(2929),u.setFunc(Gu),he(!1),Ee(Nh),re(2884),le(si);function re(q){p[q]!==!0&&(r.enable(q),p[q]=!0)}function Xe(q){p[q]!==!1&&(r.disable(q),p[q]=!1)}function Le(q,De){return h[q]!==De?(r.bindFramebuffer(q,De),h[q]=De,n&&(q===36009&&(h[36160]=De),q===36160&&(h[36009]=De)),!0):!1}function Be(q,De){let Re=g,We=!1;if(q)if(Re=d.get(De),Re===void 0&&(Re=[],d.set(De,Re)),q.isWebGLMultipleRenderTargets){const ce=q.texture;if(Re.length!==ce.length||Re[0]!==36064){for(let Ue=0,lt=ce.length;Ue<lt;Ue++)Re[Ue]=36064+Ue;Re.length=ce.length,We=!0}}else Re[0]!==36064&&(Re[0]=36064,We=!0);else Re[0]!==1029&&(Re[0]=1029,We=!0);We&&(t.isWebGL2?r.drawBuffers(Re):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(Re))}function Me(q){return y!==q?(r.useProgram(q),y=q,!0):!1}const et={[ps]:32774,[Ox]:32778,[Fx]:32779};if(n)et[Gh]=32775,et[Vh]=32776;else{const q=e.get("EXT_blend_minmax");q!==null&&(et[Gh]=q.MIN_EXT,et[Vh]=q.MAX_EXT)}const Ve={[Bx]:0,[zx]:1,[Nx]:768,[Yp]:770,[Wx]:776,[Gx]:774,[Ux]:772,[kx]:769,[Jp]:771,[Vx]:775,[Hx]:773};function le(q,De,Re,We,ce,Ue,lt,Lt){if(q===si){_===!0&&(Xe(3042),_=!1);return}if(_===!1&&(re(3042),_=!0),q!==Dx){if(q!==w||Lt!==L){if((x!==ps||M!==ps)&&(r.blendEquation(32774),x=ps,M=ps),Lt)switch(q){case Oo:r.blendFuncSeparate(1,771,1,771);break;case kh:r.blendFunc(1,1);break;case Uh:r.blendFuncSeparate(0,769,0,1);break;case Hh:r.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",q);break}else switch(q){case Oo:r.blendFuncSeparate(770,771,1,771);break;case kh:r.blendFunc(770,1);break;case Uh:r.blendFuncSeparate(0,769,0,1);break;case Hh:r.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",q);break}v=null,E=null,A=null,C=null,w=q,L=Lt}return}ce=ce||De,Ue=Ue||Re,lt=lt||We,(De!==x||ce!==M)&&(r.blendEquationSeparate(et[De],et[ce]),x=De,M=ce),(Re!==v||We!==E||Ue!==A||lt!==C)&&(r.blendFuncSeparate(Ve[Re],Ve[We],Ve[Ue],Ve[lt]),v=Re,E=We,A=Ue,C=lt),w=q,L=null}function me(q,De){q.side===Ts?Xe(2884):re(2884);let Re=q.side===Zt;De&&(Re=!Re),he(Re),q.blending===Oo&&q.transparent===!1?le(si):le(q.blending,q.blendEquation,q.blendSrc,q.blendDst,q.blendEquationAlpha,q.blendSrcAlpha,q.blendDstAlpha,q.premultipliedAlpha),u.setFu
3014nc(q.depthFunc),u.setTest(q.depthTest),u.setMask(q.depthWrite),a.setMask(q.colorWrite);const We=q.stencilWrite;f.setTest(We),We&&(f.setMask(q.stencilWriteMask),f.setFunc(q.stencilFunc,q.stencilRef,q.stencilFuncMask),f.setOp(q.stencilFail,q.stencilZFail,q.stencilZPass)),je(q.polygonOffset,q.polygonOffsetFactor,q.polygonOffsetUnits),q.alphaToCoverage===!0?re(32926):Xe(32926)}function he(q){D!==q&&(q?r.frontFace(2304):r.frontFace(2305),D=q)}function Ee(q){q!==Lx?(re(2884),q!==k&&(q===Nh?r.cullFace(1029):q===Ix?r.cullFace(1028):r.cullFace(1032))):Xe(2884),k=q}function ve(q){q!==B&&(W&&r.lineWidth(q),B=q)}function je(q,De,Re){q?(re(32823),(T!==De||O!==Re)&&(r.polygonOffset(De,Re),T=De,O=Re)):Xe(32823)}function Ye(q){q?re(3089):Xe(3089)}function st(q){q===void 0&&(q=33984+H-1),Z!==q&&(r.activeTexture(q),Z=q)}function xt(q,De){Z===null&&st();let Re=ne[Z];Re===void 0&&(Re={type:void 0,texture:void 0},ne[Z]=Re),(Re.type!==q||Re.texture!==De)&&(r.bindTexture(q,De||xe[q]),Re.type=q,Re.texture=De)}function mt(){const q=ne[Z];q!==void 0&&q.type!==void 0&&(r.bindTexture(q.type,null),q.type=void 0,q.texture=void 0)}function G(){try{r.compressedTexImage2D.apply(r,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function I(){try{r.texSubImage2D.apply(r,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function J(){try{r.texSubImage3D.apply(r,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function pe(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function Te(){try{r.texStorage2D.apply(r,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function ie(){try{r.texStorage3D.apply(r,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function Ne(){try{r.texImage2D.apply(r,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function Ie(){try{r.texImage3D.apply(r,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function we(q){ee.equals(q)===!1&&(r.scissor(q.x,q.y,q.z,q.w),ee.copy(q))}function be(q){ue.equals(q)===!1&&(r.viewport(q.x,q.y,q.z,q.w),ue.copy(q))}function Ze(){r.disable(3042),r.disable(2884),r.disable(2929),r.disable(32823),r.disable(3089),r.disable(2960),r.disable(32926),r.blendEquation(32774),r.blendFunc(1,0),r.blendFuncSeparate(1,0,1,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(513),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(519,0,4294967295),r.stencilOp(7680,7680,7680),r.clearStencil(0),r.cullFace(1029),r.frontFace(2305),r.polygonOffset(0,0),r.activeTexture(33984),r.bindFramebuffer(36160,null),n===!0&&(r.bindFramebuffer(36009,null),r.bindFramebuffer(36008,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),p={},Z=null,ne={},h={},d=new WeakMap,g=[],y=null,_=!1,w=null,x=null,v=null,E=null,M=null,A=null,C=null,L=!1,D=null,k=null,B=null,T=null,O=null,ee.set(0,0,r.canvas.width,r.canvas.height),ue.set(0,0,r.canvas.width,r.canvas.height),a.reset(),u.reset(),f.reset()}return{buffers:{color:a,depth:u,stencil:f},enable:re,disable:Xe,bindFramebuffer:Le,drawBuffers:Be,useProgram:Me,setBlending:le,setMaterial:me,setFlipSided:he,setCullFace:Ee,setLineWidth:ve,setPolygonOffset:je,setScissorTest:Ye,activeTexture:st,bindTexture:xt,unbindTexture:mt,compressedTexImage2D:G,texImage2D:Ne,texImage3D:Ie,texStorage2D:Te,texStorage3D:ie,texSubImage2D:I,texSubImage3D:J,compressedTexSubImage2D:pe,scissor:we,viewport:be,reset:Ze}}function qR(r,e,t,n,i,s,o){const a=i.isWebGL2,u=i.maxTextures,f=i.maxCubemapSize,p=i.maxTextureSize,h=i.maxSamples,g=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):void 0,y=new WeakMap;let _,w=!1;try{w=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function x(G,I){return w?new OffscreenCanvas(G,I):yl("canvas")}function v(G,I,J,pe){let Te=1;if((G.width>pe||G.height>pe)&&(Te=pe/Math.max(G.width,G.height)),Te<1||I===!0)if(typeof HTMLImageElement!="undefined"&&G instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&G instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&G instanceof ImageBitmap){const ie=I?R_:Math.floor,Ne=ie(Te*G.width),Ie=ie(Te*G.height);_===void 0&&(_=x(Ne,Ie));const we=J?x(Ne,Ie):_;return we.width=Ne,we.height=Ie,we.getContext("2d").drawImage(G,0,0,Ne,Ie),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+G.width+"x"+G.height+") to ("+Ne+"x"+Ie+")."),we}else return"data"in G&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+G.width+"x"+G.height+")."),G;return G}function E(G){return dp(G.width)&&dp(G.height)}function M(G){return a?!1:G.wrapS!==bn||G.wrapT!==bn||G.minFilter!==Kt&&G.minFilter!==Pt}function A(G,I){return G.generateMipmaps&&I&&G.minFilter!==Kt&&G.minFilter!==Pt}function C(G){r.generateMipmap(G)}function L(G,I,J,pe,Te=!1){if(a===!1)return I;if(G!==null){if(r[G]!==void 0)return r[G];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+G+"'")}let ie=I;return I===6403&&(J===5126&&(ie=33326),J===5131&&(ie=33325),J===5121&&(ie=33321)),I===33319&&(J===5126&&(ie=33328),J===5131&&(ie=33327),J===5121&&(ie=33323)),I===6408&&(J===5126&&(ie=34836),J===5131&&(ie=34842),J===5121&&(ie=pe===Rt&&Te===!1?35907:32856),J===32819&&(ie=32854),J===32820&&(ie=32855)),(ie===33325||ie===33326||ie===33327||ie===33328||ie===34842||ie===34836)&&e.get("EXT_color_buffer_float"),ie}function D(G,I,J){return A(G,J)===!0||G.isFramebufferTexture&&G.minFilter!==Kt&&G.minFilter!==Pt?Math.log2(Math.max(I.width,I.height))+1:G.mipmaps!==void 0&&G.mipmaps.length>0?G.mipmaps.length:G.isCompressedTexture&&Array.isArray(G.image)?I.mipmaps.length:1}function k(G){return G===Kt||G===Vu||G===Wu?9728:9729}function B(G){const I=G.target;I.removeEventListener("dispose",B),O(I),I.isVideoTexture&&y.delete(I),o.memory.textures--}function T(G){const I=G.target;I.removeEventListener("dispose",T),H(I)}function O(G){const I=n.get(G);I.__webglInit!==void 0&&(r.deleteTexture(I.__webglTexture),n.remove(G))}function H(G){const I=G.texture,J=n.get(G),pe=n.get(I);if(!!G){if(pe.__webglTexture!==void 0&&(r.deleteTexture(pe.__webglTexture),o.memory.textures--),G.depthTexture&&G.depthTexture.dispose(),G.isWebGLCubeRen
3014derTarget)for(let Te=0;Te<6;Te++)r.deleteFramebuffer(J.__webglFramebuffer[Te]),J.__webglDepthbuffer&&r.deleteRenderbuffer(J.__webglDepthbuffer[Te]);else r.deleteFramebuffer(J.__webglFramebuffer),J.__webglDepthbuffer&&r.deleteRenderbuffer(J.__webglDepthbuffer),J.__webglMultisampledFramebuffer&&r.deleteFramebuffer(J.__webglMultisampledFramebuffer),J.__webglColorRenderbuffer&&r.deleteRenderbuffer(J.__webglColorRenderbuffer),J.__webglDepthRenderbuffer&&r.deleteRenderbuffer(J.__webglDepthRenderbuffer);if(G.isWebGLMultipleRenderTargets)for(let Te=0,ie=I.length;Te<ie;Te++){const Ne=n.get(I[Te]);Ne.__webglTexture&&(r.deleteTexture(Ne.__webglTexture),o.memory.textures--),n.remove(I[Te])}n.remove(I),n.remove(G)}}let W=0;function V(){W=0}function j(){const G=W;return G>=u&&console.warn("THREE.WebGLTextures: Trying to use "+G+" texture units while this GPU supports only "+u),W+=1,G}function Z(G,I){const J=n.get(G);if(G.isVideoTexture&&ve(G),G.version>0&&J.__version!==G.version){const pe=G.image;if(pe===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(pe.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{re(J,G,I);return}}t.activeTexture(33984+I),t.bindTexture(3553,J.__webglTexture)}function ne(G,I){const J=n.get(G);if(G.version>0&&J.__version!==G.version){re(J,G,I);return}t.activeTexture(33984+I),t.bindTexture(35866,J.__webglTexture)}function ge(G,I){const J=n.get(G);if(G.version>0&&J.__version!==G.version){re(J,G,I);return}t.activeTexture(33984+I),t.bindTexture(32879,J.__webglTexture)}function Y(G,I){const J=n.get(G);if(G.version>0&&J.__version!==G.version){Xe(J,G,I);return}t.activeTexture(33984+I),t.bindTexture(34067,J.__webglTexture)}const ee={[fl]:10497,[bn]:33071,[dl]:33648},ue={[Kt]:9728,[Vu]:9984,[Wu]:9986,[Pt]:9729,[Kp]:9985,[zs]:9987};function ye(G,I,J){if(J?(r.texParameteri(G,10242,ee[I.wrapS]),r.texParameteri(G,10243,ee[I.wrapT]),(G===32879||G===35866)&&r.texParameteri(G,32882,ee[I.wrapR]),r.texParameteri(G,10240,ue[I.magFilter]),r.texParameteri(G,10241,ue[I.minFilter])):(r.texParameteri(G,10242,33071),r.texParameteri(G,10243,33071),(G===32879||G===35866)&&r.texParameteri(G,32882,33071),(I.wrapS!==bn||I.wrapT!==bn)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(G,10240,k(I.magFilter)),r.texParameteri(G,10241,k(I.minFilter)),I.minFilter!==Kt&&I.minFilter!==Pt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const pe=e.get("EXT_texture_filter_anisotropic");if(I.type===Yn&&e.has("OES_texture_float_linear")===!1||a===!1&&I.type===fr&&e.has("OES_texture_half_float_linear")===!1)return;(I.anisotropy>1||n.get(I).__currentAnisotropy)&&(r.texParameterf(G,pe.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,i.getMaxAnisotropy())),n.get(I).__currentAnisotropy=I.anisotropy)}}function xe(G,I){G.__webglInit===void 0&&(G.__webglInit=!0,I.addEventListener("dispose",B),G.__webglTexture=r.createTexture(),o.memory.textures++)}function re(G,I,J){let pe=3553;I.isDataTexture2DArray&&(pe=35866),I.isDataTexture3D&&(pe=32879),xe(G,I),t.activeTexture(33984+J),t.bindTexture(pe,G.__webglTexture),r.pixelStorei(37440,I.flipY),r.pixelStorei(37441,I.premultiplyAlpha),r.pixelStorei(3317,I.unpackAlignment),r.pixelStorei(37443,0);const Te=M(I)&&E(I.image)===!1;let ie=v(I.image,Te,!1,p);ie=je(I,ie);const Ne=E(ie)||a,Ie=s.convert(I.format,I.encoding);let we=s.convert(I.type),be=L(I.internalFormat,Ie,we,I.encoding,I.isVideoTexture);ye(pe,I,Ne);let Ze;const q=I.mipmaps,De=a&&I.isVideoTexture!==!0,Re=G.__version===void 0,We=D(I,ie,Ne);if(I.isDepthTexture)be=6402,a?I.type===Yn?be=36012:I.type===rl?be=33190:I.type===xs?be=35056:be=33189:I.type===Yn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),I.format===Ni&&be===6402&&I.type!==Uo&&I.type!==rl&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),I.type=Uo,we=s.convert(
3014I.type)),I.format===As&&be===6402&&(be=34041,I.type!==xs&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),I.type=xs,we=s.convert(I.type))),De&&Re?t.texStorage2D(3553,1,be,ie.width,ie.height):t.texImage2D(3553,0,be,ie.width,ie.height,0,Ie,we,null);else if(I.isDataTexture)if(q.length>0&&Ne){De&&Re&&t.texStorage2D(3553,We,be,q[0].width,q[0].height);for(let ce=0,Ue=q.length;ce<Ue;ce++)Ze=q[ce],De?t.texSubImage2D(3553,0,0,0,Ze.width,Ze.height,Ie,we,Ze.data):t.texImage2D(3553,ce,be,Ze.width,Ze.height,0,Ie,we,Ze.data);I.generateMipmaps=!1}else De?(Re&&t.texStorage2D(3553,We,be,ie.width,ie.height),t.texSubImage2D(3553,0,0,0,ie.width,ie.height,Ie,we,ie.data)):t.texImage2D(3553,0,be,ie.width,ie.height,0,Ie,we,ie.data);else if(I.isCompressedTexture){De&&Re&&t.texStorage2D(3553,We,be,q[0].width,q[0].height);for(let ce=0,Ue=q.length;ce<Ue;ce++)Ze=q[ce],I.format!==wn?Ie!==null?De?t.compressedTexSubImage2D(3553,ce,0,0,Ze.width,Ze.height,Ie,Ze.data):t.compressedTexImage2D(3553,ce,be,Ze.width,Ze.height,0,Ze.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):De?t.texSubImage2D(3553,ce,0,0,Ze.width,Ze.height,Ie,we,Ze.data):t.texImage2D(3553,ce,be,Ze.width,Ze.height,0,Ie,we,Ze.data)}else if(I.isDataTexture2DArray)De?(Re&&t.texStorage3D(35866,We,be,ie.width,ie.height,ie.depth),t.texSubImage3D(35866,0,0,0,0,ie.width,ie.height,ie.depth,Ie,we,ie.data)):t.texImage3D(35866,0,be,ie.width,ie.height,ie.depth,0,Ie,we,ie.data);else if(I.isDataTexture3D)De?(Re&&t.texStorage3D(32879,We,be,ie.width,ie.height,ie.depth),t.texSubImage3D(32879,0,0,0,0,ie.width,ie.height,ie.depth,Ie,we,ie.data)):t.texImage3D(32879,0,be,ie.width,ie.height,ie.depth,0,Ie,we,ie.data);else if(I.isFramebufferTexture)De&&Re?t.texStorage2D(3553,We,be,ie.width,ie.height):t.texImage2D(3553,0,be,ie.width,ie.height,0,Ie,we,null);else if(q.length>0&&Ne){De&&Re&&t.texStorage2D(3553,We,be,q[0].width,q[0].height);for(let ce=0,Ue=q.length;ce<Ue;ce++)Ze=q[ce],De?t.texSubImage2D(3553,ce,0,0,Ie,we,Ze):t.texImage2D(3553,ce,be,Ie,we,Ze);I.generateMipmaps=!1}else De?(Re&&t.texStorage2D(3553,We,be,ie.width,ie.height),t.texSubImage2D(3553,0,0,0,Ie,we,ie)):t.texImage2D(3553,0,be,Ie,we,ie);A(I,Ne)&&C(pe),G.__version=I.version,I.onUpdate&&I.onUpdate(I)}function Xe(G,I,J){if(I.image.length!==6)return;xe(G,I),t.activeTexture(33984+J),t.bindTexture(34067,G.__webglTexture),r.pixelStorei(37440,I.flipY),r.pixelStorei(37441,I.premultiplyAlpha),r.pixelStorei(3317,I.unpackAlignment),r.pixelStorei(37443,0);const pe=I&&(I.isCompressedTexture||I.image[0].isCompressedTexture),Te=I.image[0]&&I.image[0].isDataTexture,ie=[];for(let ce=0;ce<6;ce++)!pe&&!Te?ie[ce]=v(I.image[ce],!1,!0,f):ie[ce]=Te?I.image[ce].image:I.image[ce],ie[ce]=je(I,ie[ce]);const Ne=ie[0],Ie=E(Ne)||a,we=s.convert(I.format,I.encoding),be=s.convert(I.type),Ze=L(I.internalFormat,we,be,I.encoding),q=a&&I.isVideoTexture!==!0,De=G.__version===void 0;let Re=D(I,Ne,Ie);ye(34067,I,Ie);let We;if(pe){q&&De&&t.texStorage2D(34067,Re,Ze,Ne.width,Ne.height);for(let ce=0;ce<6;ce++){We=ie[ce].mipmaps;for(let Ue=0;Ue<We.length;Ue++){const lt=We[Ue];I.format!==wn?we!==null?q?t.compressedTexSubImage2D(34069+ce,Ue,0,0,lt.width,lt.height,we,lt.data):t.compressedTexImage2D(34069+ce,Ue,Ze,lt.width,lt.height,0,lt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):q?t.texSubImage2D(34069+ce,Ue,0,0,lt.width,lt.height,we,be,lt.data):t.texImage2D(34069+ce,Ue,Ze,lt.width,lt.height,0,we,be,lt.data)}}}else{We=I.mipmaps,q&&De&&(We.length>0&&Re++,t.texStorage2D(34067,Re,Ze,ie[0].width,ie[0].height));for(let ce=0;ce<6;ce++)if(Te){q?t.texSubImage2D(34069+ce,0,0,0,ie[ce].width,ie[ce].height,we,be,ie[ce].data):t.texImage2D(34069+ce,0,Ze,ie[ce].width,ie[ce].height,0,we,be,ie[ce].data);for(let Ue=0;Ue<We.length;Ue++){const Lt=We[Ue].image[ce].image;q?t.texSubImage2D(34069+ce,Ue+1,0,0,Lt.width,Lt.height,we,be,Lt.data):t.texImage2D(34069+ce,Ue+1,Ze,Lt.width,Lt.height,0,we,be,Lt.data)}}else{q?t.texSubImage2D(34069+ce,0,0,0,we,be,ie[ce]):t.texImage2D(34069+ce,0,Ze,we,be,ie[ce]);for(let Ue=0;Ue<We.length;Ue++){const lt=We[Ue];q?t.texSubImage2D(34069+ce,Ue+1,0,0,we,be,lt.image[ce]):t.texImage2D(34069+ce,Ue+1,Ze,we,be,lt.image[ce])}}}A(I,Ie)&&C(34067),G.__version=I.version,I.onUpdate&&I.onUpdate(I)}function Le(G,I,J,pe,Te){const ie=s.convert(J.format,J.encoding),Ne=s.convert(J.type),Ie=L(J.internalFormat,ie,Ne,J.encoding);n.get(I).__hasExternalTextures||(Te===32879||Te===35866?t.texImage3D(Te,0,Ie,I.width,I.height,I.depth,0,ie,Ne,null):t.texImage2D(Te,0,Ie,I.width,I.height,0,ie,Ne,null)),t.bindFramebuffer(36160,G),I.useRenderToTexture?g.framebufferTexture2DMultisampleEXT(36160,pe,Te,n.get(J).__webglTexture,0,Ee(I)):r.framebufferTexture2D(36160,pe,Te,n.get(J).__webglTexture,0),t.bindFramebuffer(36160,null)}function Be(G,I,J){if(r.bindRenderbuffer(36161,G),I.depthBuffer&&!I.stencilBuffer){let pe=33189;if(J||I.useRenderToTexture){const Te=I.depthTexture;Te&&Te.isDepthTexture&&(Te.type===Yn?pe=36012:Te.type===rl&&(pe=33190)
3014);const ie=Ee(I);I.useRenderToTexture?g.renderbufferStorageMultisampleEXT(36161,ie,pe,I.width,I.height):r.renderbufferStorageMultisample(36161,ie,pe,I.width,I.height)}else r.renderbufferStorage(36161,pe,I.width,I.height);r.framebufferRenderbuffer(36160,36096,36161,G)}else if(I.depthBuffer&&I.stencilBuffer){const pe=Ee(I);J&&I.useRenderbuffer?r.renderbufferStorageMultisample(36161,pe,35056,I.width,I.height):I.useRenderToTexture?g.renderbufferStorageMultisampleEXT(36161,pe,35056,I.width,I.height):r.renderbufferStorage(36161,34041,I.width,I.height),r.framebufferRenderbuffer(36160,33306,36161,G)}else{const pe=I.isWebGLMultipleRenderTargets===!0?I.texture[0]:I.texture,Te=s.convert(pe.format,pe.encoding),ie=s.convert(pe.type),Ne=L(pe.internalFormat,Te,ie,pe.encoding),Ie=Ee(I);J&&I.useRenderbuffer?r.renderbufferStorageMultisample(36161,Ie,Ne,I.width,I.height):I.useRenderToTexture?g.renderbufferStorageMultisampleEXT(36161,Ie,Ne,I.width,I.height):r.renderbufferStorage(36161,Ne,I.width,I.height)}r.bindRenderbuffer(36161,null)}function Me(G,I){if(I&&I.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,G),!(I.depthTexture&&I.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(I.depthTexture).__webglTexture||I.depthTexture.image.width!==I.width||I.depthTexture.image.height!==I.height)&&(I.depthTexture.image.width=I.width,I.depthTexture.image.height=I.height,I.depthTexture.needsUpdate=!0),Z(I.depthTexture,0);const pe=n.get(I.depthTexture).__webglTexture,Te=Ee(I);if(I.depthTexture.format===Ni)I.useRenderToTexture?g.framebufferTexture2DMultisampleEXT(36160,36096,3553,pe,0,Te):r.framebufferTexture2D(36160,36096,3553,pe,0);else if(I.depthTexture.format===As)I.useRenderToTexture?g.framebufferTexture2DMultisampleEXT(36160,33306,3553,pe,0,Te):r.framebufferTexture2D(36160,33306,3553,pe,0);else throw new Error("Unknown depthTexture format")}function et(G){const I=n.get(G),J=G.isWebGLCubeRenderTarget===!0;if(G.depthTexture&&!I.__autoAllocateDepthBuffer){if(J)throw new Error("target.depthTexture not supported in Cube render targets");Me(I.__webglFramebuffer,G)}else if(J){I.__webglDepthbuffer=[];for(let pe=0;pe<6;pe++)t.bindFramebuffer(36160,I.__webglFramebuffer[pe]),I.__webglDepthbuffer[pe]=r.createRenderbuffer(),Be(I.__webglDepthbuffer[pe],G,!1)}else t.bindFramebuffer(36160,I.__webglFramebuffer),I.__webglDepthbuffer=r.createRenderbuffer(),Be(I.__webglDepthbuffer,G,!1);t.bindFramebuffer(36160,null)}function Ve(G,I,J){const pe=n.get(G);I!==void 0&&Le(pe.__webglFramebuffer,G,G.texture,36064,3553),J!==void 0&&et(G)}function le(G){const I=G.texture,J=n.get(G),pe=n.get(I);G.addEventListener("dispose",T),G.isWebGLMultipleRenderTargets!==!0&&(pe.__webglTexture===void 0&&(pe.__webglTexture=r.createTexture()),pe.__version=I.version,o.memory.textures++);const Te=G.isWebGLCubeRenderTarget===!0,ie=G.isWebGLMultipleRenderTargets===!0,Ne=I.isDataTexture3D||I.isDataTexture2DArray,Ie=E(G)||a;if(Te){J.__webglFramebuffer=[];for(let we=0;we<6;we++)J.__webglFramebuffer[we]=r.createFramebuffer()}else if(J.__webglFramebuffer=r.createFramebuffer(),ie)if(i.drawBuffers){const we=G.texture;for(let be=0,Ze=we.length;be<Ze;be++){const q=n.get(we[be]);q.__webglTexture===void 0&&(q.__webglTexture=r.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(G.useRenderbuffer)if(a){J.__webglMultisampledFramebuffer=r.createFramebuffer(),J.__webglColorRenderbuffer=r.createRenderbuffer(),r.bindRenderbuffer(36161,J.__webglColorRenderbuffer);const we=s.convert(I.format,I.encoding),be=s.convert(I.type),Ze=L(I.internalFormat,we,be,I.encoding),q=Ee(G);r.renderbufferStorageMultisample(36161,q,Ze,G.width,G.height),t.bindFramebuffer(36160,J.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(36160,36064,36161,J.__webglColorRenderbuffer),r.bindRenderbuffer(36161,null),G.depthBuffer&&(J.__webglDepthRenderbuffer=r.createRenderbuffer(),Be(J.__webglDepthRenderbuffer,G,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(Te){t.bindTexture(34067,pe.__webglTexture),ye(34067,I,Ie);for(let we=0;we<6;we++)Le(J.__webglFramebuffer[we],G,I,36064,34069+we);A(I,Ie)&&C(34067),t.unbindTexture()}else if(ie){const we=G.texture;for(let be=0,Ze=we.length;be<Ze;be++){const q=we[be],De=n.get(q);t.bindTexture(3553,De.__webglTexture),ye(3553,q,Ie),Le(J.__webglFramebuffer,G,q,36064+be,3553),A(q,Ie)&&C(3553)}t.unbindTexture()}else{let we=3553;Ne&&(a?we=I.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(we,pe.__webglTexture),ye(we,I,Ie),Le(J.__webglFramebuffer,G,I,36064,we),A(I,Ie)&&C(we),t.unbindTexture()}G.depthBuffer&&et(G)}function me(G){const I=E(G)||a,J=G.isWebGLMultipleRenderTargets===!0?G.texture:[G.texture];for(let pe=0,Te=J.length;pe<Te;pe++){const ie=J[pe];
3014if(A(ie,I)){const Ne=G.isWebGLCubeRenderTarget?34067:3553,Ie=n.get(ie).__webglTexture;t.bindTexture(Ne,Ie),C(Ne),t.unbindTexture()}}}function he(G){if(G.useRenderbuffer)if(a){const I=G.width,J=G.height;let pe=16384;const Te=[36064],ie=G.stencilBuffer?33306:36096;G.depthBuffer&&Te.push(ie),G.ignoreDepthForMultisampleCopy||(G.depthBuffer&&(pe|=256),G.stencilBuffer&&(pe|=1024));const Ne=n.get(G);t.bindFramebuffer(36008,Ne.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,Ne.__webglFramebuffer),G.ignoreDepthForMultisampleCopy&&(r.invalidateFramebuffer(36008,[ie]),r.invalidateFramebuffer(36009,[ie])),r.blitFramebuffer(0,0,I,J,0,0,I,J,pe,9728),r.invalidateFramebuffer(36008,Te),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,Ne.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function Ee(G){return a&&(G.useRenderbuffer||G.useRenderToTexture)?Math.min(h,G.samples):0}function ve(G){const I=o.render.frame;y.get(G)!==I&&(y.set(G,I),G.update())}function je(G,I){const J=G.encoding,pe=G.format,Te=G.type;return G.isCompressedTexture===!0||G.isVideoTexture===!0||G.format===$u||J!==Kn&&(J===Rt?a===!1?e.has("EXT_sRGB")===!0&&pe===wn?(G.format=$u,G.minFilter=Pt,G.generateMipmaps=!1):I=qi.sRGBToLinear(I):(pe!==wn||Te!==oi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",J)),I}let Ye=!1,st=!1;function xt(G,I){G&&G.isWebGLRenderTarget&&(Ye===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),Ye=!0),G=G.texture),Z(G,I)}function mt(G,I){G&&G.isWebGLCubeRenderTarget&&(st===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),st=!0),G=G.texture),Y(G,I)}this.allocateTextureUnit=j,this.resetTextureUnits=V,this.setTexture2D=Z,this.setTexture2DArray=ne,this.setTexture3D=ge,this.setTextureCube=Y,this.rebindTextures=Ve,this.setupRenderTarget=le,this.updateRenderTargetMipmap=me,this.updateMultisampleRenderTarget=he,this.setupDepthRenderbuffer=et,this.setupFrameBufferTexture=Le,this.safeSetTexture2D=xt,this.safeSetTextureCube=mt}function Z_(r,e,t){const n=t.isWebGL2;function i(s,o=null){let a;if(s===oi)return 5121;if(s===a_)return 32819;if(s===l_)return 32820;if(s===i_)return 5120;if(s===s_)return 5122;if(s===Uo)return 5123;if(s===o_)return 5124;if(s===rl)return 5125;if(s===Yn)return 5126;if(s===fr)return n?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===c_)return 6406;if(s===wn)return 6408;if(s===f_)return 6409;if(s===d_)return 6410;if(s===Ni)return 6402;if(s===As)return 34041;if(s===h_)return 6403;if(s===u_)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(s===$u)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===p_)return 36244;if(s===m_)return 33319;if(s===g_)return 33320;if(s===y_)return 36249;if(s===Fu||s===Bu||s===zu||s===Nu)if(o===Rt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===Fu)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===Bu)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===zu)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===Nu)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===Fu)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Bu)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===zu)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Nu)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Wh||s===$h||s===jh||s===qh)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===Wh)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===$h)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===jh)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===qh)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===v_)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===Xh||s===Yh)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===Xh)return o===Rt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===Yh)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===Jh||s===Zh||s===Kh||s===Qh||s===ep||s===tp||s===np||s===rp||s===ip||s===sp||s===op||s===ap||s===lp||s===cp)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===Jh)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Zh)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===Kh)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===Qh)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===ep)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===tp)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===np)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===rp)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===ip)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===sp)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===op)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===ap)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===lp)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===cp)return o===Rt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;
3014if(s===up)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===up)return o===Rt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(s===xs)return n?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:i}}class rm extends Qt{constructor(e=[]){super(),this.cameras=e}}rm.prototype.isArrayCamera=!0;class ys extends ct{constructor(){super(),this.type="Group"}}ys.prototype.isGroup=!0;const XR={type:"move"};class uh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ys,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 ys,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ys,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),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}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,o=null;const a=this._targetRay,u=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(a!==null&&(i=t.getPose(e.targetRaySpace,n),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(XR))),f&&e.hand){o=!0;for(const _ of e.hand.values()){const w=t.getJointPose(_,n);if(f.joints[_.jointName]===void 0){const v=new ys;v.matrixAutoUpdate=!1,v.visible=!1,f.joints[_.jointName]=v,f.add(v)}const x=f.joints[_.jointName];w!==null&&(x.matrix.fromArray(w.transform.matrix),x.matrix.decompose(x.position,x.rotation,x.scale),x.jointRadius=w.radius),x.visible=w!==null}const p=f.joints["index-finger-tip"],h=f.joints["thumb-tip"],d=p.position.distanceTo(h.position),g=.02,y=.005;f.inputState.pinching&&d>g+y?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&d<=g-y&&(f.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),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));return a!==null&&(a.visible=i!==null),u!==null&&(u.visible=s!==null),f!==null&&(f.visible=o!==null),this}}class ju extends nn{constructor(e,t,n,i,s,o,a,u,f,p){if(p=p!==void 0?p:Ni,p!==Ni&&p!==As)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&p===Ni&&(n=Uo),n===void 0&&p===As&&(n=xs),super(null,i,s,o,a,u,p,n,f),this.image={width:e,height:t},this.magFilter=a!==void 0?a:Kt,this.minFilter=u!==void 0?u:Kt,this.flipY=!1,this.generateMipmaps=!1}}ju.prototype.isDepthTexture=!0;class YR extends ji{constructor(e,t){super();const n=this;let i=null,s=1,o=null,a="local-floor";const u=e.extensions.has("WEBGL_multisampled_render_to_texture");let f=null,p=null,h=null,d=null,g=!1,y=null;const _=t.getContextAttributes();let w=null,x=null;const v=[],E=new Map,M=new Qt;M.layers.enable(1),M.viewport=new Mt;const A=new Qt;A.layers.enable(2),A.viewport=new Mt;const C=[M,A],L=new rm;L.layers.enable(1),L.layers.enable(2);let D=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let ee=v[Y];return ee===void 0&&(ee=new uh,v[Y]=ee),ee.getTargetRaySpace()},this.getControllerGrip=function(Y){let ee=v[Y];return ee===void 0&&(ee=new uh,v[Y]=ee),ee.getGripSpace()},this.getHand=function(Y){let ee=v[Y];return ee===void 0&&(ee=new uh,v[Y]=ee),ee.getHandSpace()};function B(Y){const ee=E.get(Y.inputSource);ee&&ee.dispatchEvent({type:Y.type,data:Y.inputSource})}
3014function T(){E.forEach(function(Y,ee){Y.disconnect(ee)}),E.clear(),D=null,k=null,e.setRenderTarget(w),d=null,h=null,p=null,i=null,x=null,ge.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){s=Y,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){a=Y,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getBaseLayer=function(){return h!==null?h:d},this.getBinding=function(){return p},this.getFrame=function(){return y},this.getSession=function(){return i},this.setSession=async function(Y){if(i=Y,i!==null){if(w=e.getRenderTarget(),i.addEventListener("select",B),i.addEventListener("selectstart",B),i.addEventListener("selectend",B),i.addEventListener("squeeze",B),i.addEventListener("squeezestart",B),i.addEventListener("squeezeend",B),i.addEventListener("end",T),i.addEventListener("inputsourceschange",O),_.xrCompatible!==!0&&await t.makeXRCompatible(),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const ee={antialias:i.renderState.layers===void 0?_.antialias:!0,alpha:_.alpha,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(i,t,ee),i.updateRenderState({baseLayer:d}),x=new Zn(d.framebufferWidth,d.framebufferHeight,{format:wn,type:oi,encoding:e.outputEncoding})}else{g=_.antialias;let ee=null,ue=null,ye=null;_.depth&&(ye=_.stencil?35056:33190,ee=_.stencil?As:Ni,ue=_.stencil?xs:Uo);const xe={colorFormat:e.outputEncoding===Rt?35907:32856,depthFormat:ye,scaleFactor:s};p=new XRWebGLBinding(i,t),h=p.createProjectionLayer(xe),i.updateRenderState({layers:[h]}),g?x=new cf(h.textureWidth,h.textureHeight,{format:wn,type:oi,depthTexture:new ju(h.textureWidth,h.textureHeight,ue,void 0,void 0,void 0,void 0,void 0,void 0,ee),stencilBuffer:_.stencil,ignoreDepth:h.ignoreDepthValues,useRenderToTexture:u,encoding:e.outputEncoding}):x=new Zn(h.textureWidth,h.textureHeight,{format:wn,type:oi,depthTexture:new ju(h.textureWidth,h.textureHeight,ue,void 0,void 0,void 0,void 0,void 0,void 0,ee),stencilBuffer:_.stencil,ignoreDepth:h.ignoreDepthValues,encoding:e.outputEncoding})}x.isXRRenderTarget=!0,this.setFoveation(1),o=await i.requestReferenceSpace(a),ge.setContext(i),ge.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function O(Y){const ee=i.inputSources;for(let ue=0;ue<v.length;ue++)E.set(ee[ue],v[ue]);for(let ue=0;ue<Y.removed.length;ue++){const ye=Y.removed[ue],xe=E.get(ye);xe&&(xe.dispatchEvent({type:"disconnected",data:ye}),E.delete(ye))}for(let ue=0;ue<Y.added.length;ue++){const ye=Y.added[ue],xe=E.get(ye);xe&&xe.dispatchEvent({type:"connected",data:ye})}}const H=new F,W=new F;function V(Y,ee,ue){H.setFromMatrixPosition(ee.matrixWorld),W.setFromMatrixPosition(ue.matrixWorld);const ye=H.distanceTo(W),xe=ee.projectionMatrix.elements,re=ue.projectionMatrix.elements,Xe=xe[14]/(xe[10]-1),Le=xe[14]/(xe[10]+1),Be=(xe[9]+1)/xe[5],Me=(xe[9]-1)/xe[5],et=(xe[8]-1)/xe[0],Ve=(re[8]+1)/re[0],le=Xe*et,me=Xe*Ve,he=ye/(-et+Ve),Ee=he*-et;ee.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(Ee),Y.translateZ(he),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert();const ve=Xe+he,je=Le+he,Ye=le-Ee,st=me+(ye-Ee),xt=Be*Le/je*ve,mt=Me*Le/je*ve;Y.projectionMatrix.makePerspective(Ye,st,xt,mt,ve,je)}function j(Y,ee){ee===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(ee.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(i===null)return;L.near=A.near=M.near=Y.near,L.far=A.far=M.far=Y.far,(D!==L.near||k!==L.far)&&(i.updateRenderState({depthNear:L.near,depthFar:L.far}),D=L.near,k=L.far);const ee=Y.parent,ue=L.cameras;j(L,ee);for(let xe=0;xe<ue.length;xe++)j(ue[xe],ee);L.matrixWorld.decompose(L.position,L.quaternion,L.scale),Y.position.copy(L.position),Y.quaternion.copy(L.quaternion),Y.scale.copy(L.scale),Y.matrix.copy(L.matrix
vendor: 4,155 bytes, line 3014
3014),Y.matrixWorld.copy(L.matrixWorld);const ye=Y.children;for(let xe=0,re=ye.length;xe<re;xe++)ye[xe].updateMatrixWorld(!0);ue.length===2?V(L,M,A):L.projectionMatrix.copy(M.projectionMatrix)},this.getCamera=function(){return L},this.getFoveation=function(){if(h!==null)return h.fixedFoveation;if(d!==null)return d.fixedFoveation},this.setFoveation=function(Y){h!==null&&(h.fixedFoveation=Y),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=Y)};let Z=null;function ne(Y,ee){if(f=ee.getViewerPose(o),y=ee,f!==null){const ye=f.views;d!==null&&(e.setRenderTargetFramebuffer(x,d.framebuffer),e.setRenderTarget(x));let xe=!1;ye.length!==L.cameras.length&&(L.cameras.length=0,xe=!0);for(let re=0;re<ye.length;re++){const Xe=ye[re];let Le=null;if(d!==null)Le=d.getViewport(Xe);else{const Me=p.getViewSubImage(h,Xe);Le=Me.viewport,re===0&&(e.setRenderTargetTextures(x,Me.colorTexture,h.ignoreDepthValues?void 0:Me.depthStencilTexture),e.setRenderTarget(x))}const Be=C[re];Be.matrix.fromArray(Xe.transform.matrix),Be.projectionMatrix.fromArray(Xe.projectionMatrix),Be.viewport.set(Le.x,Le.y,Le.width,Le.height),re===0&&L.matrix.copy(Be.matrix),xe===!0&&L.cameras.push(Be)}}const ue=i.inputSources;for(let ye=0;ye<v.length;ye++){const xe=v[ye],re=ue[ye];xe.update(re,ee,o)}Z&&Z(Y,ee),y=null}const ge=new U_;ge.setAnimationLoop(ne),this.setAnimationLoop=function(Y){Z=Y},this.dispose=function(){}}}function JR(r){function e(x,v){x.fogColor.value.copy(v.color),v.isFog?(x.fogNear.value=v.near,x.fogFar.value=v.far):v.isFogExp2&&(x.fogDensity.value=v.density)}function t(x,v,E,M,A){v.isMeshBasicMaterial?n(x,v):v.isMeshLambertMaterial?(n(x,v),u(x,v)):v.isMeshToonMaterial?(n(x,v),p(x,v)):v.isMeshPhongMaterial?(n(x,v),f(x,v)):v.isMeshStandardMaterial?(n(x,v),v.isMeshPhysicalMaterial?d(x,v,A):h(x,v)):v.isMeshMatcapMaterial?(n(x,v),g(x,v)):v.isMeshDepthMaterial?(n(x,v),y(x,v)):v.isMeshDistanceMaterial?(n(x,v),_(x,v)):v.isMeshNormalMaterial?(n(x,v),w(x,v)):v.isLineBasicMaterial?(i(x,v),v.isLineDashedMaterial&&s(x,v)):v.isPointsMaterial?o(x,v,E,M):v.isSpriteMaterial?a(x,v):v.isShadowMaterial?(x.color.value.copy(v.color),x.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function n(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),v.alphaMap&&(x.alphaMap.value=v.alphaMap),v.specularMap&&(x.specularMap.value=v.specularMap),v.alphaTest>0&&(x.alphaTest.value=v.alphaTest);const E=r.get(v).envMap;E&&(x.envMap.value=E,x.flipEnvMap.value=E.isCubeTexture&&E.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,x.lightMapIntensity.value=v.lightMapIntensity),v.aoMap&&(x.aoMap.value=v.aoMap,x.aoMapIntensity.value=v.aoMapIntensity);let M;v.map?M=v.map:v.specularMap?M=v.specularMap:v.displacementMap?M=v.displacementMap:v.normalMap?M=v.normalMap:v.bumpMap?M=v.bumpMap:v.roughnessMap?M=v.roughnessMap:v.metalnessMap?M=v.metalnessMap:v.alphaMap?M=v.alphaMap:v.emissiveMap?M=v.emissiveMap:v.clearcoatMap?M=v.clearcoatMap:v.clearcoatNormalMap?M=v.clearcoatNormalMap:v.clearcoatRoughnessMap?M=v.clearcoatRoughnessMap:v.specularIntensityMap?M=v.specularIntensityMap:v.specularColorMap?M=v.specularColorMap:v.transmissionMap?M=v.transmissionMap:v.thicknessMap?M=v.thicknessMap:v.sheenColorMap?M=v.sheenColorMap:v.sheenRoughnessMap&&(M=v.sheenRoughnessMap),M!==void 0&&(M.isWebGLRenderTarget&&(M=M.texture),M.matrixAutoUpdate===!0&&M.updateMatrix(),x.uvTransform.value.copy(M.matrix));let A;v.aoMap?A=v.aoMap:v.lightMap&&(A=v.lightMap),A!==void 0&&(A.isWebGLRenderTarget&&(A=A.texture),A.matrixAutoUpdate===!0&&A.updateMatrix(),x.uv2Transform.value.copy(A.matrix))}function i(x,v){x.diffuse.value.copy(v.color),x.opacity.value=v.opacity}function s(x,v){x.dashSize.value=v.dashSize,x.totalSize.value=v.dashSize+v.gapSize,x.scale.value=v.scale}function o(x,v,E,M){x.diffuse.value.copy(v.color),x.opacity.value=v.opacity,x.size.value=v.size*E,x.scale.value=M*.5,v.map&&(x.map.value=v.map),v.alphaMap&&(x.alph
3014aMap.value=v.alphaMap),v.alphaTest>0&&(x.alphaTest.value=v.alphaTest);let A;v.map?A=v.map:v.alphaMap&&(A=v.alphaMap),A!==void 0&&(A.matrixAutoUpdate===!0&&A.updateMatrix(),x.uvTransform.value.copy(A.matrix))}function a(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),v.alphaMap&&(x.alphaMap.value=v.alphaMap),v.alphaTest>0&&(x.alphaTest.value=v.alphaTest);let E;v.map?E=v.map:v.alphaMap&&(E=v.alphaMap),E!==void 0&&(E.matrixAutoUpdate===!0&&E.updateMatrix(),x.uvTransform.value.copy(E.matrix))}function u(x,v){v.emissiveMap&&(x.emissiveMap.value=v.emissiveMap)}function f(x,v){x.specular.value.copy(v.specular),x.shininess.value=Math.max(v.shininess,1e-4),v.emissiveMap&&(x.emissiveMap.value=v.emissiveMap),v.bumpMap&&(x.bumpMap.value=v.bumpMap,x.bumpScale.value=v.bumpScale,v.side===Zt&&(x.bumpScale.value*=-1)),v.normalMap&&(x.normalMap.value=v.normalMap,x.normalScale.value.copy(v.normalScale),v.side===Zt&&x.normalScale.value.negate()),v.displacementMap&&(x.displacementMap.value=v.displacementMap,x.displacementScale.value=v.displacementScale,x.displacementBias.value=v.displacementBias)}function p(x,v){v.gradientMap&&(x.gradientMap.value=v.gradientMap),v.emissiveMap&&(x.emissiveMap.value=v.emissiveMap),v.bumpMap&&(x.bumpMap.value=v.bumpMap,x.bumpScale.value=v.bumpScale,v.side===Zt&&(x.bumpScale.value*=-1)),v.normalMap&&(x.normalMap.value=v.normalMap,x.normalScale.value.copy(v.normalScale),v.side===Zt&&x.normalScale.value.negate()),v.displacementMap&&(x.displacementMap.value=v.displacementMap,x.displacementScale.value=v.displacementScale,x.displacementBias.value=v.displacementBias)}function h(x,v){x.roughness.value=v.roughness,x.metalness.value=v.metalness,v.roughnessMap&&(x.roughnessMap.value=v.roughnessMap),v.metalnessMap&&(x.metalnessMap.value=v.metalnessMap),v.emissiveMap&&(x.emissiveMap.value=v.emissiveMap),v.bumpMap&&(x.bumpMap.value=v.bumpMap,x.bumpScale.value=v.bumpScale,v.side===Zt&&(x.bumpScale.value*=-1)),v.normalMap&&(x.normalMap.value=v.normalMap,x.normalScale.value.copy(v.normalScale),v.side===Zt&&x.normalScale.value.negate()),v.displacementMap&&(x.displacementMap.value=v.displacementMap,x.displacementScale.value=v.displacementScale,x.displacementBias.value=v.displacementBias),r.get(v).envMap&&(x.envMapIntensity.value=v.envMapIntensity)}function d(x,v,E){h(x,v),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),v.sheenRoughnessMap&&(x.sheenRoughnessMap.value=v.sheenRoughnessMap)),v.clearcoat>0&&(x.clearcoat.value=v.clearcoat,x.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(x.clearcoatMap.value=v.clearcoatMap),v.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap),v.clearcoatNormalMap&&(x.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),x.clearcoatNormalMap.value=v.clearcoatNormalMap,v.side===Zt&&x.clearcoatNormalScale.value.negate())),v.transmission>0&&(x.transmission.value=v.transmission,x.transmissionSamplerMap.value=E.texture,x.transmissionSamplerSize.value.set(E.width,E.height),v.transmissionMap&&(x.transmissionMap.value=v.transmissionMap),x.thickness.value=v.thickness,v.thicknessMap&&(x.thicknessMap.value=v.thicknessMap),x.attenuationDistance.value=v.attenuationDistance,x.attenuationColor.value.copy(v.attenuationColor)),x.specularIntensity.value=v.specularIntensity,x.specularColor.value.copy(v.specularColor),v.specularIntensityMap&&(x.specularIntensityMap.value=v.specularIntensityMap),v.specularColorMap&&(x.specularColorMap.value=v.specularColorMap)}function g(x,v){v.matcap&&(x.matcap.value=v.matcap),v.bumpMap&&(x.bumpMap.value=v.bumpMap,x.bumpScale.value=v.bumpScale,v.side===Zt&&(x.bumpScale.value*=-1)),v.normalMap&&(x.normalMap.value=v.normalMap,x.normalScale.value.copy(v.normalScale),v.side===Zt&&x.normalScale.value.negate()),v.displacementMap&&(x.displacementMap.value=v.displacementMap,x.displacementScale.value=v.displacementScale,x.displacementBias.value=v.displacementBias)}function y(x,v){v.displacementMap&&(x.displacementMap.value=v.displacementMap,x.displacementScale.value=v.displacementScale,x.displacementBias.value=v.displacementBias)}function _(x,v){v.displacementMap&&(x.displacementMap.value=v.displacementMap,x.displacementScale.value=v.displacementScale,x.displacementBias.value=v.displacementBias),x.referencePosition.value.copy(v.referencePosition),x.nearDistance.value=v.nearDistance,x.farDistance.value=v.farDistance}function w(x,v){v.bumpMap&&(x.bumpMap.value=v.bumpMap,x.bumpScale.value=v.bumpScale,v.side===Zt&&(x.bumpScale.value*=-1)),v.normalMap&&(x.normalMap.value=v.normalMap,x.normalScale.value.copy(v.normalScale),v.side===Zt&&x.normalScale.value.negate()),v.displacementMap&&(x.displacementMap.value=v.displacementMap,x.displacementScale.value=v.displacementScale,x.displacementBias.value=v.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function ZR(){const r=yl("canvas");return r.style.display="block",r}function St(r={}){const e=r.canvas!==void 0?r.canvas:ZR(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,u=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,f=r.powerPreference!==void 0?r.powerPreference:"default",p=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1;let h=null,d=null;const g=[],y=[];
vendor: 16,478 bytes, line 3014
3014this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=Kn,this.physicallyCorrectLights=!1,this.toneMapping=Fr,this.toneMappingExposure=1;const _=this;let w=!1,x=0,v=0,E=null,M=-1,A=null;const C=new Mt,L=new Mt;let D=null,k=e.width,B=e.height,T=1,O=null,H=null;const W=new Mt(0,0,k,B),V=new Mt(0,0,k,B);let j=!1;const Z=new Dl;let ne=!1,ge=!1,Y=null;const ee=new ke,ue=new F,ye={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function xe(){return E===null?T:1}let re=t;function Xe(z,Q){for(let se=0;se<z.length;se++){const te=z[se],fe=e.getContext(te,Q);if(fe!==null)return fe}return null}try{const z={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:a,preserveDrawingBuffer:u,powerPreference:f,failIfMajorPerformanceCaveat:p};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${of}`),e.addEventListener("webglcontextlost",Ze,!1),e.addEventListener("webglcontextrestored",q,!1),re===null){const Q=["webgl2","webgl","experimental-webgl"];if(_.isWebGL1Renderer===!0&&Q.shift(),re=Xe(Q,z),re===null)throw Xe(Q)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}re.getShaderPrecisionFormat===void 0&&(re.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(z){throw console.error("THREE.WebGLRenderer: "+z.message),z}let Le,Be,Me,et,Ve,le,me,he,Ee,ve,je,Ye,st,xt,mt,G,I,J,pe,Te,ie,Ne,Ie;function we(){Le=new yA(re),Be=new fA(re,Le,r),Le.init(Be),Ne=new Z_(re,Le,Be),Me=new jR(re,Le,Be),et=new _A,Ve=new FR,le=new qR(re,Le,Me,Ve,Be,Ne,et),me=new hA(_),he=new gA(_),Ee=new FM(re,Be),Ie=new cA(re,Le,Ee,Be),ve=new vA(re,Ee,et,Ie),je=new MA(re,ve,Ee,et),pe=new SA(re,Be,le),G=new dA(Ve),Ye=new OR(_,me,he,Le,Be,Ie,G),st=new JR(Ve),xt=new zR,mt=new VR(Le,Be),J=new lA(_,me,Me,je,n,a),I=new J_(_,je,Be),Te=new uA(re,Le,et,Be),ie=new xA(re,Le,et,Be),et.programs=Ye.programs,_.capabilities=Be,_.extensions=Le,_.properties=Ve,_.renderLists=xt,_.shadowMap=I,_.state=Me,_.info=et}we();const be=new YR(_,re);this.xr=be,this.getContext=function(){return re},this.getContextAttributes=function(){return re.getContextAttributes()},this.forceContextLoss=function(){const z=Le.get("WEBGL_lose_context");z&&z.loseContext()},this.forceContextRestore=function(){const z=Le.get("WEBGL_lose_context");z&&z.restoreContext()},this.getPixelRatio=function(){return T},this.setPixelRatio=function(z){z!==void 0&&(T=z,this.setSize(k,B,!1))},this.getSize=function(z){return z.set(k,B)},this.setSize=function(z,Q,se){if(be.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}k=z,B=Q,e.width=Math.floor(z*T),e.height=Math.floor(Q*T),se!==!1&&(e.style.width=z+"px",e.style.height=Q+"px"),this.setViewport(0,0,z,Q)},this.getDrawingBufferSize=function(z){return z.set(k*T,B*T).floor()},this.setDrawingBufferSize=function(z,Q,se){k=z,B=Q,T=se,e.width=Math.floor(z*se),e.height=Math.floor(Q*se),this.setViewport(0,0,z,Q)},this.getCurrentViewport=function(z){return z.copy(C)},this.getViewport=function(z){return z.copy(W)},this.setViewport=function(z,Q,se,te){z.isVector4?W.set(z.x,z.y,z.z,z.w):W.set(z,Q,se,te),Me.viewport(C.copy(W).multiplyScalar(T).floor())},this.getScissor=function(z){return z.copy(V)},this.setScissor=function(z,Q,se,te){z.isVector4?V.set(z.x,z.y,z.z,z.w):V.set(z,Q,se,te),Me.scissor(L.copy(V).multiplyScalar(T).floor())},this.getScissorTest=function(){return j},this.setScissorTest=function(z){Me.setScissorTest(j=z)},this.setOpaqueSort=function(z){O=z},this.setTransparentSort=function(z){H=z},this.getClearColor=function(z){return z.copy(J.getClearColor())},this.setClearColor=function(){J.setClearColor.apply(J,arguments)},this.getClearAlpha=function(){return J.getClearAlpha()},this.setClearAlpha=function(){J.setClearAlpha.apply(J,arguments)},this.clear=function(z,Q,se){let te=0;(z===void 0||z)&&(te|=16384),(Q===void 0||Q)&&(te|=256),(se===void 0||se)&&(te|=1024),re.clear(te)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Ze,!1),e.removeEventListener("webglcontextrestored",q,!1),xt.dispose(),mt.dispose(),Ve.dispose(),me.dispose(),he.dispose(),je.dispose(),Ie.dispose(),Ye.dispose(),be.dispose(),be.removeEventListener("sessionstart",lt),be.removeEventListener("sessionend",Lt),Y&&(Y.dispose(),Y=null),Pn.stop()};function Ze(z){z.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),w=!0}function q(){console.log("THREE.WebGLRenderer: Context Restored."),w=!1;const z=et.autoReset,Q=I.enabled,se=I.autoUpdate,te=I.needsUpdate,fe=I.type;we(),et.autoReset=z,I.enabled=Q,I.autoUpdate=se,I.needsUpdate=te,I.type=fe}function De(z){const Q=z.target;Q.removeEventListener("dispose",De),Re(Q)}function Re(z){We(z),Ve.remove(z)}function We(z){const Q=Ve.get(z).programs;Q!==void 0&&(Q.forEach(function(se){Ye.releaseProgram(se)}),z.isShaderMaterial&&Ye.releaseShaderCache(z))}this.renderBufferDirect=function(z,Q,se,te,fe,Qe){Q===null&&(Q=ye);const tt=fe.isMesh&&fe.matrixWorld.determinant()<0,ot=Nf(z,Q,se,te,fe);Me.setMaterial(te,tt);let it=se.index;const _t=se.attributes.position;if(it===null){if(_t===void 0||_t.count===0)return}else if(it.count===0)return;let ut=1;te.wireframe===!0&&(it=ve.getWireframeAttribute(se),ut=2),Ie.setup(fe,te,ot,se,it);let dt,It=Te;it!==null&&(dt=Ee.get(it),It=ie,It.setIndex(dt));const $n=it!==null?it.count:_t.count,Tr=se.drawRange.start*ut,ft=se.drawRange.count*ut,zn=Qe!==null?Qe.start*ut:0,Dt=Qe!==null?Qe.count*ut:1/0,an=Math.max(Tr,zn),bt=Math.min($n,Tr+ft,zn+Dt)-1,gt=Math.max(0,bt-an+1);if(gt!==0){if(fe.isMesh)te.wireframe===!0?(Me.setLineWidth(te.wireframeLinewidth*xe()),It.setMode(1)):It.setMode(4);else if(fe.isLine){let fn=te.linewidth;fn===void 0&&(fn=1),Me.setLineWidth(fn*xe()),fe.isLineSegments?It.setMode(1):fe.isLineLoop?It.setMode(2):It.setMode(3)}else fe.isPoints?It.setMode(0):fe.isSprite&&It.setMode(4);if(fe.isInstancedMesh)It.renderInstances(an,gt,fe.count);else if(se.isInstancedBufferGeometry){const fn=Math.min(se.instanceCount,se._maxInstanceCount);It.renderInstances(an,gt,fn)}else It.render(an,gt)}},this.compile=function(z,Q){d=mt.get(z),d.init(),y.push(d),z.traverseVisible(function(se){se.isLight&&se.layers.test(Q.layers)&&(d.pushLight(se),se.castShadow&&d.pushShadow(se))}),d.setupLights(_.physicallyCorrectLights),z.traverse(function(se){const te=se.material;if(te)if(Array.isArray(te))for(let fe=0;fe<te.length;fe++){const Qe=te[fe];Ws(Qe,z,se)}else Ws(te,z,se)}),y.pop(),d=null};let ce=null;function Ue(z){ce&&ce(z)}function lt(){Pn.stop()}function Lt(){Pn.start()}const Pn=new U_;Pn.setAnimationLoop(Ue),typeof window!="undefined"&&Pn.setContext(window),this.setAnimationLoop=function(z){ce=z,be.setAnimationLoop(z),z===null?Pn.stop():Pn.start()},be.addEventListener("sessionstart",lt),be.addEventListener("sessionend",Lt),this.render=function(z,Q){if(Q!==void 0&&Q.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;z.autoUpdate===!0&&z.updateMatrixWorld(),Q.parent===null&&Q.updateMatrixWorld(),be.enabled===!0&&be.isPresenting===!0&&(be.cameraAutoUpdate===!0&&be.updateCamera(Q),Q=be.getCamera()),z.isScene===!0&&z.onBeforeRender(_,z,Q,E),d=mt.get(z,y.length),d.init(),y.push(d),ee.multiplyMatrices(Q.projectionMatrix,Q.matrixWorldInverse),Z.setFromProjectionMatrix(ee),ge=this.localClippingEnabled,ne=G.init(this.clippingPlanes,ge,Q),h=xt.get(z,g.length),h.init(),g.push(h),kt(z,Q,0,_.sortObjects),h.finish(),_.sortObjects===!0&&h.sort(O,H),ne===!0&&G.beginShadows();const se=d.state.shadowsArray;if(I.render(se,z,Q),ne===!0&&G.endShadows(),this.info.autoReset===!0&&this.info.reset(),J.render(h,z),d.setupLights(_.physicallyCorrectLights),Q.isArrayCamera){const te=Q.cameras;for(let fe=0,Qe=te.length;fe<Qe;fe++){const tt=te[fe];tr(h,z,tt,tt.viewport)}}else tr(h,z,Q);E!==null&&(le.updateMultisampleRenderTarget(E),le.updateRenderTargetMipmap(E)),z.isScene===!0&&z.onAfterRender(_,z,Q),Me.buffers.depth.setTest(!0),Me.buffers.depth.setMask(!0),Me.buffers.color.setMask(!0),Me.setPolygonOffset(!1),Ie.resetDefaultState(),M=-1,A=null,y.pop(),y.length>0?d=y[y.length-1]:d=null,g.pop(),g.length>0?h=g[g.length-1]:h=null};function kt(z,Q,se,te){if(z.visible===!1)return;if(z.layers.test(Q.layers)){if(z.isGroup)se=z.renderOrder;else if(z.isLOD)z.autoUpdate===!0&&z.update(Q);else if(z.isLight)d.pushLight(z),z.castShadow&&d.pushShadow(z);else if(z.isSprite){if(!z.frustumCulled||Z.intersectsSprite(z)){te&&ue.setFromMatrixPosition(z.matrixWorld).applyMatrix4(ee);const tt=je.update(z),ot=z.material;ot.visible&&h.push(z,tt,ot,se,ue.z,null)}}else if((z.isMesh||z.isLine||z.isPoints)&&(z.isSkinnedMesh&&z.skeleton.frame!==et.render.frame&&(z.skeleton.update(),z.skeleton.frame=et.render.frame),!z.frustumCulled||Z.intersectsObject(z))){te&&ue.setFromMatrixPosition(z.matrixWorld).applyMatrix4(ee);const tt=je.update(z),ot=z.material;if(Array.isArray(ot)){const it=tt.groups;for(let _t=0,ut=it.length;_t<ut;_t++){const dt=it[_t],It=ot[dt.materialIndex];It&&It.visible&&h.push(z,tt,It,se,ue.z,dt)}}else ot.visible&&h.push(z,tt,ot,se,ue.z,null)}}const Qe=z.children;for(let tt=0,ot=Qe.length;tt<ot;tt++)kt(Qe[tt],Q,se,te)}function tr(z,Q,se,te){const fe=z.opaque,Qe=z.transmissive,tt=z.transparent;d.setupLightsView(se),Qe.length>0&&pr(fe,Q,se),te&&Me.viewport(C.copy(te)),fe.length>0&&gi(fe,Q,se),Qe.length>0&&gi(Qe,Q,se),tt.length>0&&gi(tt,Q,se)}function pr(z,Q,se){if(Y===null){const tt=o===!0&&Be.isWebGL2===!0?cf:Zn;Y=new tt(1024,1024,{generateMipmaps:!0,type:Ne.convert(fr)!==null?fr:oi,minFilter:zs,magFilter:Kt,wrapS:bn,wrapT:bn,useRenderToTexture:Le.has("WEBGL_multisampled_render_to_texture")})}const te=_.getRenderTarget();_.setRenderTarget(Y),_.clear();const fe=_.toneMapping;_.toneMapping=Fr,gi(z,Q,se),_.toneMapping=fe,le.updateMultisampleRenderTarget(Y),le.updateRenderTargetMipmap(Y),_.setRenderTarget(te)}function gi(z,Q,se){const te=Q.isScene===!0?Q.overrideMaterial:null;for(let fe=0,Qe=z.length;fe<Qe;fe++){const tt=z[fe],ot=tt.object,it=tt.geometry,_t=te===null?tt.material:te,ut=tt.group;ot.layers.test(se.layers)&&zf(ot,Q,se,it,_t,ut)}}function zf(z,Q,se,te,fe,Qe){z.onBeforeRender(_,Q,se,te,fe,Qe),z.modelViewMatrix.multiplyMatrices(se.matrixWorldInverse,z.matrixWorld),z.normalMatrix.getNormalMatrix(z.modelViewMatrix),fe.onBeforeRender(_,Q,se,te,z,Qe),fe.transparent===!0&&fe.side===Ts?(fe.side=Zt,fe.needsUpdate=!0,_.renderBufferDirect(se,Q,te,fe,z,Qe),fe.side=Es,fe.needsUpdate=!0,_.renderBufferDirect(se,Q,te,fe,z,Qe),fe.side=Ts):_.renderBufferDirect(se,Q,te,fe,z,Qe),z.onAfterRender(_,Q,se,te,fe,Qe)}function Ws(z,Q,se){Q.isScene!==!0&&(Q=ye);const te=Ve.get(z),fe=d.state.lights,Qe=d.state.shadowsArray,tt=fe.state.version,ot=Ye.getParameters(z,fe.state,Qe,Q,se),it=Ye.getProgramCacheKey(ot);let _t=te.programs;te.environment=z.isMeshStandardMaterial?Q.environment:null,te.fog=Q.fog,te.envMap=(z.isMeshStandardMaterial?he:me).get(z.envMap||te.environment),_t===void 0&&(z.addEventListener("dispose",De),_t=new Map,te.programs=_t);let ut=_t.get(it);if(ut!==void 0){if(te.currentProgram===ut&&te.lightsStateVersion===tt)return ma(z,ot),ut}else ot.uniforms=Ye.getUniforms(z),z.onBuild(se,ot,_),z.onBeforeCompile(ot,_),ut=Ye.acquireProgram(ot,it),_t.set(it,ut),te.uniforms=ot.uniforms;const dt=te.uniforms;(!z.isShaderMaterial&&!z.isRawShaderMaterial||z.clipping===!0)&&(dt.clippingPlanes=G.uniform),ma(z,ot),te.needsLights=Xl(z),te.lightsStateVersion=tt,te.needsLights&&(dt.ambientLightColor.value=fe.state.ambient,dt.lightProbe.value=fe.state.probe,dt.directionalLights.value=fe.state.directional,dt.directionalLightShadows.value=fe.state.directionalShadow,dt.spotLights.value=fe.state.spot,dt.spotLightShadows.value=fe.state.spotShadow,dt.rectAreaLights.value=fe.state.rectArea,dt.ltc_1.value=fe.state.rectAreaLTC1,dt.ltc_2.value=fe.state.rectAreaLTC2,dt.pointLights.value=fe.state.point,dt.pointLightShadows.value=fe.state.pointShadow,dt.hemisphereLights.value=fe.state.hemi,dt.directionalShadowMap.value=fe.state.directionalShadowMap,dt.directionalShadowMatrix.value=fe.state.directionalShadowMatrix,dt.spotShadowMap.value=fe.state.spotShadowMap,dt.spotShadowMatrix.value=fe.state.spotShadowMatrix,dt.pointShadowMap.value=fe.state.pointShadowMap,dt.pointShadowMatrix.value=fe.state.pointShadowMatrix);const It=ut.getUniforms(),$n=Ui.seqWithValue(It.seq,dt);return te.currentProgram=ut,te.uniformsList=$n,ut}function ma(z,Q){const se=Ve.get(z);se.outputEncoding=Q.outputEncoding,se.instancing=Q.instancing,se.skinning=Q.skinning,se.morphTargets=Q.morphTargets,se.morphNormals=Q.morphNormals,se.morphTargetsCount=Q.morphTargetsCount,se.numClippingPlanes=Q.numClippingPlanes,se.numIntersection=Q.numClipIntersection,se.vertexAlphas=Q.vertexAlphas,se.vertexTangents=Q.vertexTangents,se.toneMapping=Q.toneMapping}function Nf(z,Q,se,te,fe){Q.isScene!==!0&&(Q=ye),le.resetTextureUnits();const Qe=Q.fog,tt=te.isMeshStandardMaterial?Q.environment:null,ot=E===null?_.outputEncoding:E.isXRRenderTarget===!0?E.texture.encoding:Kn,it=(te.isMeshStandardMaterial?he:me).get(te.envMap||tt),_t=te.vertexColors===!0&&!!se.attributes.color&&se.attributes.color.itemSize===4,ut=!!te.normalMap&&!!se.attributes.tangent,dt=!!se.morphAttributes.position,It=!!se.morphAttributes.normal,$n=se.morphAttributes.position?se.morphAttributes.position.length:0,Tr=te.toneMapped?_.toneMapping:Fr,ft=Ve.get(te),zn=d.state.lights;if(ne===!0&&(ge===!0||z!==A)){const ln=z===A&&te.id===M;G.setState(te,z,ln)}let Dt=!1;te.version===ft.__version?(ft.needsLights&&ft.lightsStateVersion!==zn.state.version||ft.outputEncoding!==ot||fe.isInstancedMesh&&ft.instancing===!1||!fe.isInstancedMesh&&ft.instancing===!0||fe.isSkinnedMesh&&ft.skinning===!1||!fe.isSkinnedMesh&&ft.skinning===!0||ft.envMap!==it||te.fog&&ft.fog!==Qe||ft.numClippingPlanes!==void 0&&(ft.numClippingPlanes!==G.numPlanes||ft.numIntersection!==G.numIntersection)||ft.vertexAlphas!==_t||ft.vertexTangents!==ut||ft.morphTargets!==dt||ft.morphNormals!==It||ft.toneMapping!==Tr||Be.isWebGL2===!0&&ft.morphTargetsCount!==$n)&&(Dt=!0):(Dt=!0,ft.__version=te.version);let an=ft.currentProgram;Dt===!0&&(an=Ws(te,Q,fe));let bt=!1,gt=!1,fn=!1;const yt=an.getUniforms(),rn=ft.uniforms;if(Me.useProgram(an.program)&&(bt=!0,gt=!0,fn=!0),te.id!==M&&(M=te.id,gt=!0),bt||A!==z){if(yt.setValue(re,"projectionMatrix",z.projectionMatrix),Be.logarithmicDepthBuffer&&yt.setValue(re,"logDepthBufFC",2/(Math.log(z.far+1)/Math.LN2)),A!==z&&(A=z,gt=!0,fn=!0),te.isShaderMaterial||te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshStandardMaterial||te.envMap){const ln=yt.map.cameraPosition;ln!==void 0&&ln.setValue(re,ue.setFromMatrixPosition(z.matrixWorld))}(te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshLambertMaterial||te.isMeshBasicMaterial||te.isMeshStandardMaterial||te.isShaderMaterial)&&yt.setValue(re,"isOrthographic",z.isOrthographicCamera===!0),(te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshLambertMaterial||te.isMeshBasicMaterial||te.isMeshStandardMaterial||te.isShaderMaterial||te.isShadowMaterial||fe.isSkinnedMesh)&&yt.setValue(re,"viewMatrix",z.matrixWorldInverse)}if(fe.isSkinnedMesh){yt.setOptional(re,fe,"bindMatrix"),yt.setOptional(re,fe,"bindMatrixInverse");const ln=fe.skeleton;ln&&(Be.floatVertexTextures?(ln.boneTexture===null&&ln.computeBoneTexture(),yt.setValue(re,"boneTexture",ln.boneTexture,le),yt.setValue(re,"boneTextureSize",ln.boneTextureSize)):yt.setOptional(re,ln,"boneMatrices"))}return!!se&&(se.morphAttributes.position!==void 0||se.morphAttributes.normal!==void 0)&&pe.update(fe,se,te,an),(gt||ft.receiveShadow!==fe.receiveShadow)&&(ft.receiveShadow=fe.receiveShadow,yt.setValue(re,"receiveShadow",fe.receiveShadow)),gt&&(yt.setValue(re,"toneMappingExposure",_.toneMappingExposure),ft.needsLights&&ql(rn,fn),Qe&&te.fog&&st.refreshFogUniforms(rn,Qe),st.refreshMaterialUniforms(rn,te,T,B,Y),Ui.upload(re,ft.uniformsList,rn,le)),te.isShaderMaterial&&te.uniformsNeedUpdate===!0&&(Ui.upload(re,ft.uniformsList,rn,le),te.uniformsNeedUpdate=!1),te.isSpriteMaterial&&yt.setValue(re,"center",fe.center),yt.setValue(re,"modelViewMatrix",fe.modelViewMatrix),yt.setValue(re,"normalMatrix",fe.
3014normalMatrix),yt.setValue(re,"modelMatrix",fe.matrixWorld),an}function ql(z,Q){z.ambientLightColor.needsUpdate=Q,z.lightProbe.needsUpdate=Q,z.directionalLights.needsUpdate=Q,z.directionalLightShadows.needsUpdate=Q,z.pointLights.needsUpdate=Q,z.pointLightShadows.needsUpdate=Q,z.spotLights.needsUpdate=Q,z.spotLightShadows.needsUpdate=Q,z.rectAreaLights.needsUpdate=Q,z.hemisphereLights.needsUpdate=Q}function Xl(z){return z.isMeshLambertMaterial||z.isMeshToonMaterial||z.isMeshPhongMaterial||z.isMeshStandardMaterial||z.isShadowMaterial||z.isShaderMaterial&&z.lights===!0}this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return v},this.getRenderTarget=function(){return E},this.setRenderTargetTextures=function(z,Q,se){Ve.get(z.texture).__webglTexture=Q,Ve.get(z.depthTexture).__webglTexture=se;const te=Ve.get(z);te.__hasExternalTextures=!0,te.__hasExternalTextures&&(te.__autoAllocateDepthBuffer=se===void 0,te.__autoAllocateDepthBuffer||z.useRenderToTexture&&(console.warn("render-to-texture extension was disabled because an external texture was provided"),z.useRenderToTexture=!1,z.useRenderbuffer=!0))},this.setRenderTargetFramebuffer=function(z,Q){const se=Ve.get(z);se.__webglFramebuffer=Q,se.__useDefaultFramebuffer=Q===void 0},this.setRenderTarget=function(z,Q=0,se=0){E=z,x=Q,v=se;let te=!0;if(z){const it=Ve.get(z);it.__useDefaultFramebuffer!==void 0?(Me.bindFramebuffer(36160,null),te=!1):it.__webglFramebuffer===void 0?le.setupRenderTarget(z):it.__hasExternalTextures&&le.rebindTextures(z,Ve.get(z.texture).__webglTexture,Ve.get(z.depthTexture).__webglTexture)}let fe=null,Qe=!1,tt=!1;if(z){const it=z.texture;(it.isDataTexture3D||it.isDataTexture2DArray)&&(tt=!0);const _t=Ve.get(z).__webglFramebuffer;z.isWebGLCubeRenderTarget?(fe=_t[Q],Qe=!0):z.useRenderbuffer?fe=Ve.get(z).__webglMultisampledFramebuffer:fe=_t,C.copy(z.viewport),L.copy(z.scissor),D=z.scissorTest}else C.copy(W).multiplyScalar(T).floor(),L.copy(V).multiplyScalar(T).floor(),D=j;if(Me.bindFramebuffer(36160,fe)&&Be.drawBuffers&&te&&Me.drawBuffers(z,fe),Me.viewport(C),Me.scissor(L),Me.setScissorTest(D),Qe){const it=Ve.get(z.texture);re.framebufferTexture2D(36160,36064,34069+Q,it.__webglTexture,se)}else if(tt){const it=Ve.get(z.texture),_t=Q||0;re.framebufferTextureLayer(36160,36064,it.__webglTexture,se||0,_t)}M=-1},this.readRenderTargetPixels=function(z,Q,se,te,fe,Qe,tt){if(!(z&&z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ot=Ve.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&tt!==void 0&&(ot=ot[tt]),ot){Me.bindFramebuffer(36160,ot);try{const it=z.texture,_t=it.format,ut=it.type;if(_t!==wn&&Ne.convert(_t)!==re.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const dt=ut===fr&&(Le.has("EXT_color_buffer_half_float")||Be.isWebGL2&&Le.has("EXT_color_buffer_float"));if(ut!==oi&&Ne.convert(ut)!==re.getParameter(35738)&&!(ut===Yn&&(Be.isWebGL2||Le.has("OES_texture_float")||Le.has("WEBGL_color_buffer_float")))&&!dt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}re.checkFramebufferStatus(36160)===36053?Q>=0&&Q<=z.width-te&&se>=0&&se<=z.height-fe&&re.readPixels(Q,se,te,fe,Ne.convert(_t),Ne.convert(ut),Qe):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const it=E!==null?Ve.get(E).__webglFramebuffer:null;Me.bindFramebuffer(36160,it)}}},this.copyFramebufferToTexture=function(z,Q,se=0){if(Q.isFramebufferTexture!==!0){console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");return}const te=Math.pow(2,-se),fe=Math.floor(Q.image.width*te),Qe=Math.floor(Q.image.height*te);le.setTexture2D(Q,0),re.copyTexSubImage2D(3553,se,0,0,z.x,z.y,fe,Qe),Me.unbindTexture()},this.copyTextureToTexture=function(z,Q,se,te=0){const fe=Q.image.width,Qe=Q.image.height,tt=Ne.convert(se.format),ot=Ne.convert(se.type);le.setTexture2D(se,0),re.pixelStorei(37440,se.flipY),re.pixelStorei(37441,se.premultiplyAlpha),re.pixelStorei(3317,se.unpackAlignment),Q.isDataTexture?re.texSubImage2D(3553,te,z.x,z.y,fe,Qe,tt,ot,Q.image.data):Q.isCompressedTexture?re.compressedTexSubImage2D(3553,te,z.x,z.y,Q.mipmaps[0].width,Q.mipmaps[0].height,tt,Q.mipmaps[0].data):re.texSubImage2D(3553,te,z.x,z.y,tt,ot,Q.image),te===0&&se.generateMipmaps&&re.generateMipmap(3553),Me.unbindTexture()},this.copyTextureToTexture3D=function(z,Q,se,te,fe=0){if(_.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}
3014const Qe=z.max.x-z.min.x+1,tt=z.max.y-z.min.y+1,ot=z.max.z-z.min.z+1,it=Ne.convert(te.format),_t=Ne.convert(te.type);let ut;if(te.isDataTexture3D)le.setTexture3D(te,0),ut=32879;else if(te.isDataTexture2DArray)le.setTexture2DArray(te,0),ut=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}re.pixelStorei(37440,te.flipY),re.pixelStorei(37441,te.premultiplyAlpha),re.pixelStorei(3317,te.unpackAlignment);const dt=re.getParameter(3314),It=re.getParameter(32878),$n=re.getParameter(3316),Tr=re.getParameter(3315),ft=re.getParameter(32877),zn=se.isCompressedTexture?se.mipmaps[0]:se.image;re.pixelStorei(3314,zn.width),re.pixelStorei(32878,zn.height),re.pixelStorei(3316,z.min.x),re.pixelStorei(3315,z.min.y),re.pixelStorei(32877,z.min.z),se.isDataTexture||se.isDataTexture3D?re.texSubImage3D(ut,fe,Q.x,Q.y,Q.z,Qe,tt,ot,it,_t,zn.data):se.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),re.compressedTexSubImage3D(ut,fe,Q.x,Q.y,Q.z,Qe,tt,ot,it,zn.data)):re.texSubImage3D(ut,fe,Q.x,Q.y,Q.z,Qe,tt,ot,it,_t,zn),re.pixelStorei(3314,dt),re.pixelStorei(32878,It),re.pixelStorei(3316,$n),re.pixelStorei(3315,Tr),re.pixelStorei(32877,ft),fe===0&&te.generateMipmaps&&re.generateMipmap(ut),Me.unbindTexture()},this.initTexture=function(z){le.setTexture2D(z,0),Me.unbindTexture()},this.resetState=function(){x=0,v=0,E=null,Me.reset(),Ie.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}St.prototype.isWebGLRenderer=!0;class K_ extends St{}K_.prototype.isWebGL1Renderer=!0;class Ol{constructor(e,t=25e-5){this.name="",this.color=new Ae(e),this.density=t}clone(){return new Ol(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}Ol.prototype.isFogExp2=!0;class Fl{constructor(e,t=1,n=1e3){this.name="",this.color=new Ae(e),this.near=t,this.far=n}clone(){return new Fl(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}Fl.prototype.isFog=!0;class aa extends ct{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__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()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}aa.prototype.isScene=!0;class Us{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Ho,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Jn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}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=Jn()),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=Jn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}Us.prototype.isInterleavedBuffer=!0;const Yt=new F;class Hi{constructor(e,t,n,i=!1){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i===!0}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++)Yt.x=this.getX(t),Yt.y=this.getY(t),Yt.z=this.getZ(t),Yt.applyM
3014atrix4(e),this.setXYZ(t,Yt.x,Yt.y,Yt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Yt.x=this.getX(t),Yt.y=this.getY(t),Yt.z=this.getZ(t),Yt.applyNormalMatrix(e),this.setXYZ(t,Yt.x,Yt.y,Yt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Yt.x=this.getX(t),Yt.y=this.getY(t),Yt.z=this.getZ(t),Yt.transformDirection(e),this.setXYZ(t,Yt.x,Yt.y,Yt.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,n){return e=e*this.data.stride+this.offset,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.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.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 interlaved buffer attribute will deinterleave 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 pt(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 Hi(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave 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}}}Hi.prototype.isInterleavedBufferAttribute=!0;class yf extends pn{constructor(e){super(),this.type="SpriteMaterial",this.color=new Ae(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!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}}yf.prototype.isSpriteMaterial=!0;let _o;const Va=new F,bo=new F,wo=new F,So=new de,Wa=new de,Q_=new ke,ou=new F,$a=new F,au=new F,ly=new de,fh=new de,cy=new de;class vf extends ct{constructor(e){if(super(),this.type="Sprite",_o===void 0){_o=new Je;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 Us(t,5);_o.setIndex([0,1,2,0,2,3]),_o.setAttribute("position",new Hi(n,3,0,!1)),_o.setAttribute("uv",new Hi(n,2,3,!1))}this.geometry=_o,this.material=e!==void 0?e:new yf,this.center=new de(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),bo.setFromMatrixScale(this.matrixWorld),Q_.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),wo.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&bo.multiplyScalar(-wo.z);const n=this.material.rotation;let i,s;n!==0&&(s=Math.cos(n),i=Math.sin(n));const o=this.center;lu(ou.set(-.5,-.5,0),wo,o,bo,i,s),lu($a.set(.5,-.5,0),wo,o,bo,i,s),lu(au.set(.5,.5,0),wo,o,bo,i,s),ly.set(0,0),fh.set(1,0),cy.set(1,1);let a=e.ray.intersectTriangle(ou,$a,au,!1,Va);if(a===null&&(lu($a.set(-.5,.5,0),wo,o,bo,i,s),fh.set(0,1),a=e.ray.intersectTriangle(ou,au,$a,!1,Va),a===null))return;const u=e.ray.origin.distanceTo(Va);u<e.near||u>e.far||t.push({distance:u,point:Va.clone(),uv:en.getUV(Va,ou,$a,au,ly,fh,cy,new de),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}vf.prototype.isSprite=!0;function lu(r,e,t,n,i,s){So.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Wa.x=s*So.x-i*So.y,Wa.y=i*So.x+s*So.y):Wa.copy(So),r.copy(e),r.x+=Wa.x,r.y+=Wa.y,r.applyM
vendor: 1,025 bytes, line 3014
3014atrix4(Q_)}const cu=new F,uy=new F;class eb extends ct{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)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const n=this.levels;let i;for(i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,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&&!(e<t[n].distance);n++);return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){cu.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(cu);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){cu.setFromMatrixPosition(e.matrixWorld),uy.setFromMatrixPosition(this.matrixWorld);
3014const n=cu.distanceTo(uy)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i<s&&n>=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;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 o=n[i];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}const fy=new F,dy=new Mt,hy=new Mt,KR=new F,py=new ke;class xf extends on{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new ke,this.bindMatrixInverse=new ke}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,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 Mt,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(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==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const n=this.skeleton,i=this.geometry;dy.fromBufferAttribute(i.attributes.skinIndex,e),hy.fromBufferAttribute(i.attributes.skinWeight,e),fy.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=hy.getComponent(s);if(o!==0){const a=dy.getComponent(s);py.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),t.addScaledVector(KR.copy(fy).applyMatrix4(py),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}xf.prototype.isSkinnedMesh=!0;class _f extends ct{constructor(){super(),this.type="Bone"}}_f.prototype.isBone=!0;class ws extends nn{constructor(e=null,t=1,n=1,i,s,o,a,u,f=Kt,p=Kt,h,d){super(null,o,a,u,f,p,i,s,h,d),this.image={data:e,width:t,height:n},this.magFilter=f,this.minFilter=p,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}ws.prototype.isDataTexture=!0;const my=new ke,QR=new ke;class bf{constructor(e=[],t=[]){this.uuid=Jn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,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 ke)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new ke;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,o=e.length;s<o;s++){const a=e[s]?e[s].matrixWorld:QR;my.multiplyMatrices(a,t[s]),my.toArray(n,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new bf(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=A_(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new ws(t,e,e,wn,Yn);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this.boneTextureSize=e,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 o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",
3014s),o=new _f),this.bones.push(o),this.boneInverses.push(new ke().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,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 o=t[i];e.bones.push(o.uuid);const a=n[i];e.boneInverses.push(a.toArray())}return e}}class Ps extends pt{constructor(e,t,n,i=1){typeof n=="number"&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,n),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}}Ps.prototype.isInstancedBufferAttribute=!0;const gy=new ke,yy=new ke,uu=[],ja=new on;class im extends on{constructor(e,t,n){super(e,t),this.instanceMatrix=new Ps(new Float32Array(n*16),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,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(ja.geometry=this.geometry,ja.material=this.material,ja.material!==void 0)for(let s=0;s<i;s++){this.getMatrixAt(s,gy),yy.multiplyMatrices(n,gy),ja.matrixWorld=yy,ja.raycast(e,uu);for(let o=0,a=uu.length;o<a;o++){const u=uu[o];u.instanceId=s,u.object=this,t.push(u)}uu.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Ps(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"})}}im.prototype.isInstancedMesh=!0;class mn extends pn{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Ae(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}mn.prototype.isLineBasicMaterial=!0;const vy=new F,xy=new F,_y=new ke,dh=new Yi,fu=new Xi;class ui extends ct{constructor(e=new Je,t=new mn){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,s=t.count;i<s;i++)vy.fromBufferAttribute(t,i-1),xy.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=vy.distanceTo(xy);e.setAttribute("lineDistance",new ze(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),fu.copy(n.boundingSphere),fu.applyMatrix4(i),fu.radius+=s,e.ray.intersectsSphere(fu)===!1)return;_y.copy(i).invert(),dh.copy(e.ray).applyMatrix4(_y);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=a*a,f=new F,p=new F,h=new F,d=new F,g=this.isLineSegments?2:1;if(n.isBufferGeometry){const y=n.index,w=n.attributes.position;if(y!==null){const x=Math.max(0,o.start),v=Math.min(y.count,o.start+o.count);for(let E=x,M=v-1;E<M;E+=g){const A=y.getX(E),C=y.getX(E+1);if(f.fromBufferAttribute(w,A),p.fromBufferAttribute(w,C),dh.distanceSqToSegment(f,p,d,h)>u)continue;d.applyMatrix4(this.matrixWorld);const D=e.ray.origin.distanceTo(d);D<e.near||D>e.far||t.push({distance:D,point:h.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this})}}else{const x=Math.max(0,o.start),v=Math.min(w.count,o.start+o.count);for(let E=x,M=v-1;E<M;E+=g){if(f.fromBufferAttribute(w,E),p.fromBufferAttribute(w,E+1),dh.distanceSqToSegment(f,p,d,h)>u)continue;d.applyMatrix4(this.matrixWorld);const C=e.ray.origin.distanceTo(d);C<e.near||C>e.far||t.push({distance:C,point:h.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.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,o=i.length;s<o;s++){const a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}ui.prototype.isLine=!0;const by=new F,wy=new F;class Wn extends ui{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,s=t.count;i<s;i+=2)by.fromBufferAttribute(t,i),wy.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+by.distanceTo(wy);e.setAttribute("lineDistance",new ze(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() n
3014o longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}Wn.prototype.isLineSegments=!0;class sm extends ui{constructor(e,t){super(e,t),this.type="LineLoop"}}sm.prototype.isLineLoop=!0;class Hs extends pn{constructor(e){super(),this.type="PointsMaterial",this.color=new Ae(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!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}}Hs.prototype.isPointsMaterial=!0;const Sy=new ke,mp=new Yi,du=new Xi,hu=new F;class Bl extends ct{constructor(e=new Je,t=new Hs){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),du.copy(n.boundingSphere),du.applyMatrix4(i),du.radius+=s,e.ray.intersectsSphere(du)===!1)return;Sy.copy(i).invert(),mp.copy(e.ray).applyMatrix4(Sy);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=a*a;if(n.isBufferGeometry){const f=n.index,h=n.attributes.position;if(f!==null){const d=Math.max(0,o.start),g=Math.min(f.count,o.start+o.count);for(let y=d,_=g;y<_;y++){const w=f.getX(y);hu.fromBufferAttribute(h,w),My(hu,w,u,i,e,t,this)}}else{const d=Math.max(0,o.start),g=Math.min(h.count,o.start+o.count);for(let y=d,_=g;y<_;y++)hu.fromBufferAttribute(h,y),My(hu,y,u,i,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.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,o=i.length;s<o;s++){const a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Bl.prototype.isPoints=!0;function My(r,e,t,n,i,s,o){const a=mp.distanceSqToPoint(r);if(a<t){const u=new F;mp.closestPointToPoint(r,u),u.applyMatrix4(n);const f=i.ray.origin.distanceTo(u);if(f<i.near||f>i.far)return;s.push({distance:f,distanceToRay:Math.sqrt(a),point:u,index:e,face:null,object:o})}}class tb extends nn{constructor(e,t,n,i,s,o,a,u,f){super(e,t,n,i,s,o,a,u,f),this.minFilter=o!==void 0?o:Pt,this.magFilter=s!==void 0?s:Pt,this.generateMipmaps=!1;const p=this;function h(){p.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}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)}}tb.prototype.isVideoTexture=!0;class nb extends nn{constructor(e,t,n){super({width:e,height:t}),this.format=n,this.magFilter=Kt,this.minFilter=Kt,this.generateMipmaps=!1,this.needsUpdate=!0}}nb.prototype.isFramebufferTexture=!0;class om extends nn{constructor(e,t,n,i,s,o,a,u,f,p,h,d){super(null,o,a,u,f,p,i,s,h,d),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}om.prototype.isCompressedTexture=!0;class rb extends nn{constructor(e,t,n,i,s,o,a,u,f){super(e,t,n,i,s,o,a,u,f),this.needsUpdate=!0}}rb.prototype.isCanvasTexture=!0;class Wo extends Je{constructor(e=1,t=8,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=[],o=[],a=[],u=[],f=new F,p=new de;o.push(0,0,0),a.push(0,0,1),u.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){const g=n+h/t*i;f.x=e*Math.cos(g),f.y=e*Math.sin(g),o.push(f.x,f.y,f.z),a.push(0,0,1),p.x=(o[d]/e+1)/2,p.y=(o[d+1]/e+1)/2,u.push(p.x,p.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ze(o,3)),this.setAttribute("normal",new ze(a,3)),this.setAttribute("uv",new ze(u,2))}static fromJSON(e){return new Wo(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Gi extends Je{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiu
vendor: 1,535 bytes, line 3014
3014sTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:u};const f=this;i=Math.floor(i),s=Math.floor(s);const p=[],h=[],d=[],g=[];let y=0;const _=[],w=n/2;let x=0;v(),o===!1&&(e>0&&E(!0),t>0&&E(!1)),this.setIndex(p),this.setAttribute("position",new ze(h,3)),this.setAttribute("normal",new ze(d,3)),this.setAttribute("uv",new ze(g,2));function v(){const M=new F,A=new F;let C=0;const L=(t-e)/n;for(let D=0;D<=s;D++){const k=[],B=D/s,T=B*(t-e)+e;for(let O=0;O<=i;O++){const H=O/i,W=H*u+a,V=Math.sin(W),j=Math.cos(W);A.x=T*V,A.y=-B*n+w,A.z=T*j,h.push(A.x,A.y,A.z),M.set(V,L,j).normalize(),d.push(M.x,M.y,M.z),g.push(H,1-B),k.push(y++)}_.push(k)}for(let D=0;D<i;D++)for(let k=0;k<s;k++){const B=_[k][D],T=_[k+1][D],O=_[k+1][D+1],H=_[k][D+1];p.push(B,T,H),p.push(T,O,H),C+=6}f.addGroup(x,C,0),x+=C}function E(M){const A=y,C=new de,L=new F;let D=0;const k=M===!0?e:t,B=M===!0?1:-1;for(let O=1;O<=i;O++)h.push(0,w*B,0),d.push(0,B,0),g.push(.5,.5),y++;const T=y;for(let O=0;O<=i;O++){const W=O/i*u+a,V=Math.cos(W),j=Math.sin(W);L.x=k*j,L.y=w*B,L.z=k*V,h.push(L.x,L.y,L.z),d.push(0,B,0),C.x=V*.5+.5,C.y=j*.5*B+.5,g.push(C.x,C.y),y++}for(let O=0;O<i;O++){const H=A+O,W=T+O;M===!0?p.push(W,W+1,H):p.push(W+1,W,H),D+=3}f.addGroup(x,D,M===!0?1:2),x+=D}}static fromJSON(e){return new Gi(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class $o extends Gi{constructor(e=1,t=1,n=8,i=1,s=!1,o=0,a=Math.PI*2){super(0,e,t,n,i,s,o,a),this.type="C
3014oneGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:s,thetaStart:o,thetaLength:a}}static fromJSON(e){return new $o(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Nr extends Je{constructor(e=[],t=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const s=[],o=[];a(i),f(n),p(),this.setAttribute("position",new ze(s,3)),this.setAttribute("normal",new ze(s.slice(),3)),this.setAttribute("uv",new ze(o,2)),i===0?this.computeVertexNormals():this.normalizeNormals();function a(v){const E=new F,M=new F,A=new F;for(let C=0;C<t.length;C+=3)g(t[C+0],E),g(t[C+1],M),g(t[C+2],A),u(E,M,A,v)}function u(v,E,M,A){const C=A+1,L=[];for(let D=0;D<=C;D++){L[D]=[];const k=v.clone().lerp(M,D/C),B=E.clone().lerp(M,D/C),T=C-D;for(let O=0;O<=T;O++)O===0&&D===C?L[D][O]=k:L[D][O]=k.clone().lerp(B,O/T)}for(let D=0;D<C;D++)for(let k=0;k<2*(C-D)-1;k++){const B=Math.floor(k/2);k%2===0?(d(L[D][B+1]),d(L[D+1][B]),d(L[D][B])):(d(L[D][B+1]),d(L[D+1][B+1]),d(L[D+1][B]))}}function f(v){const E=new F;for(let M=0;M<s.length;M+=3)E.x=s[M+0],E.y=s[M+1],E.z=s[M+2],E.normalize().multiplyScalar(v),s[M+0]=E.x,s[M+1]=E.y,s[M+2]=E.z}function p(){const v=new F;for(let E=0;E<s.length;E+=3){v.x=s[E+0],v.y=s[E+1],v.z=s[E+2];const M=w(v)/2/Math.PI+.5,A=x(v)/Math.PI+.5;o.push(M,1-A)}y(),h()}function h(){for(let v=0;v<o.length;v+=6){const E=o[v+0],M=o[v+2],A=o[v+4],C=Math.max(E,M,A),L=Math.min(E,M,A);C>.9&&L<.1&&(E<.2&&(o[v+0]+=1),M<.2&&(o[v+2]+=1),A<.2&&(o[v+4]+=1))}}function d(v){s.push(v.x,v.y,v.z)}function g(v,E){const M=v*3;E.x=e[M+0],E.y=e[M+1],E.z=e[M+2]}function y(){const v=new F,E=new F,M=new F,A=new F,C=new de,L=new de,D=new de;for(let k=0,B=0;k<s.length;k+=9,B+=6){v.set(s[k+0],s[k+1],s[k+2]),E.set(s[k+3],s[k+4],s[k+5]),M.set(s[k+6],s[k+7],s[k+8]),C.set(o[B+0],o[B+1]),L.set(o[B+2],o[B+3]),D.set(o[B+4],o[B+5]),A.copy(v).add(E).add(M).divideScalar(3);const T=w(A);_(C,B+0,v,T),_(L,B+2,E,T),_(D,B+4,M,T)}}function _(v,E,M,A){A<0&&v.x===1&&(o[E]=v.x-1),M.x===0&&M.z===0&&(o[E]=A/2/Math.PI+.5)}function w(v){return Math.atan2(v.z,-v.x)}function x(v){return Math.atan2(-v.y,Math.sqrt(v.x*v.x+v.z*v.z))}}static fromJSON(e){return new Nr(e.vertices,e.indices,e.radius,e.details)}}class jo extends Nr{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],o=[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: 4,432 bytes, line 3014
301419,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new jo(e.radius,e.detail)}}const pu=new F,mu=new F,hh=new F,gu=new en;class am extends Je{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(_s*t),o=e.getIndex(),a=e.getAttribute("position"),u=o?o.count:a.count,f=[0,0,0],p=["a","b","c"],h=new Array(3),d={},g=[];for(let y=0;y<u;y+=3){o?(f[0]=o.getX(y),f[1]=o.getX(y+1),f[2]=o.getX(y+2)):(f[0]=y,f[1]=y+1,f[2]=y+2);const{a:_,b:w,c:x}=gu;if(_.fromBufferAttribute(a,f[0]),w.fromBufferAttribute(a,f[1]),x.fromBufferAttribute(a,f[2]),gu.getNormal(hh),h[0]=`${Math.round(_.x*i)},${Math.round(_.y*i)},${Math.round(_.z*i)}`,h[1]=`${Math.round(w.x*i)},${Math.round(w.y*i)},${Math.round(w.z*i)}`,h[2]=`${Math.round(x.x*i)},${Math.round(x.y*i)},${Math.round(x.z*i)}`,!(h[0]===h[1]||h[1]===h[2]||h[2]===h[0]))for(let v=0;v<3;v++){const E=(v+1)%3,M=h[v],A=h[E],C=gu[p[v]],L=gu[p[E]],D=`${M}_${A}`,k=`${A}_${M}`;k in d&&d[k]?(hh.dot(d[k].normal)<=s&&(g.push(C.x,C.y,C.z),g.push(L.x,L.y,L.z)),d[k]=null):D in d||(d[D]={index0:f[v],index1:f[E],normal:hh.clone()})}}for(const y in d)if(d[y]){const{index0:_,index1:w}=d[y];pu.fromBufferAttribute(a,_),mu.fromBufferAttribute(a,w),g.push(pu.x,pu.y,pu.z),g.push(mu.x,mu.y,mu.z)}this.setAttribute("position",new ze(g,3))}}}class Qn{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 o=1;o<=e;o++)n=this.getPoint(o/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 o;t?o=t:o=e*n[s-1];let a=0,u=s-1,f;for(;a<=u;)if(i=Math.floor(a+(u-a)/2),f=n[i]-o,f<0)a=i+1;else if(f>0)u=i-1;else{u=i;break}if(i=u,n[i]===o)return i/(s-1);const p=n[i],d=n[i+1]-p,g=(o-p)/d;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 o=this.getPoint(i),a=this.getPoint(s),u=t||(o.isVector2?new de:new F);return u.copy(a).sub(o).normalize(),u}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new F,i=[],s=[],o=[],a=new F,u=new ke;for(let g=0;g<=e;g++){const y=g/e;i[g]=this.getTangentAt(y,new F)}s[0]=new F,o[0]=new F;let f=Number.MAX_VALUE;const p=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);p<=f&&(f=p,n.set(1,0,0)),h<=f&&(f=h,n.set(0,1,0)),d<=f&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let g=1;g<=e;g++){if(s[g]=s[g-1].clone(),o[g]=o[g-1].clone(),a.crossVectors(i[g-1],i[g]),a.length()>Number.EPSILON){a.normalize();const y=Math.acos(_n(i[g-1].dot(i[g]),-1,1));s[g].applyMatrix4(u.makeRotationAxis(a,y))}o[g].crossVectors(i[g],s[g])}if(t===!0){let g=Math.acos(_n(s[0].dot(s[e]),-1,1));g/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(g=-g);for(let y=1;y<=e;y++)s[y].applyMatrix4(u.makeRotationAxis(i[y],g*y)),o[y].crossVectors(i[y],s[y])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class zl extends Qn{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,u=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=u}getPoint(e,t){const n=t||new de,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=i;for(;s>i;)s-=i;
vendor: 10,005 bytes, line 3014
3014s<Number.EPSILON&&(o?s=0:s=i),this.aClockwise===!0&&!o&&(s===i?s=-i:s=s-i);const a=this.aStartAngle+e*s;let u=this.aX+this.xRadius*Math.cos(a),f=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const p=Math.cos(this.aRotation),h=Math.sin(this.aRotation),d=u-this.aX,g=f-this.aY;u=d*p-g*h+this.aX,f=d*h+g*p+this.aY}return n.set(u,f)}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}}zl.prototype.isEllipseCurve=!0;class lm extends zl{constructor(e,t,n,i,s,o){super(e,t,n,n,i,s,o),this.type="ArcCurve"}}lm.prototype.isArcCurve=!0;function cm(){let r=0,e=0,t=0,n=0;function i(s,o,a,u){r=s,e=a,t=-3*s+3*o-2*a-u,n=2*s-2*o+a+u}return{initCatmullRom:function(s,o,a,u,f){i(o,a,f*(a-s),f*(u-o))},initNonuniformCatmullRom:function(s,o,a,u,f,p,h){let d=(o-s)/f-(a-s)/(f+p)+(a-o)/p,g=(a-o)/p-(u-o)/(p+h)+(u-a)/h;d*=p,g*=p,i(o,a,d,g)},calc:function(s){const o=s*s,a=o*s;return r+e*s+t*o+n*a}}}const yu=new F,ph=new cm,mh=new cm,gh=new cm;class um extends Qn{constructor(e=[],t=!1,n="centripetal",i=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e,t=new F){const n=t,i=this.points,s=i.length,o=(s-(this.closed?0:1))*e;let a=Math.floor(o),u=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:u===0&&a===s-1&&(a=s-2,u=1);let f,p;this.closed||a>0?f=i[(a-1)%s]:(yu.subVectors(i[0],i[1]).add(i[0]),f=yu);const h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2<s?p=i[(a+2)%s]:(yu.subVectors(i[s-1],i[s-2]).add(i[s-1]),p=yu),this.curveType==="centripetal"||this.curveType==="chordal"){const g=this.curveType==="chordal"?.5:.25;let y=Math.pow(f.distanceToSquared(h),g),_=Math.pow(h.distanceToSquared(d),g),w=Math.pow(d.distanceToSquared(p),g);_<1e-4&&(_=1),y<1e-4&&(y=_),w<1e-4&&(w=_),ph.initNonuniformCatmullRom(f.x,h.x,d.x,p.x,y,_,w),mh.initNonuniformCatmullRom(f.y,h.y,d.y,p.y,y,_,w),gh.initNonuniformCatmullRom(f.z,h.z,d.z,p.z,y,_,w)}else this.curveType==="catmullrom"&&(ph.initCatmullRom(f.x,h.x,d.x,p.x,this.tension),mh.initCatmullRom(f.y,h.y,d.y,p.y,this.tension),gh.initCatmullRom(f.z,h.z,d.z,p.z,this.tension));return n.set(ph.calc(u),mh.calc(u),gh.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 F().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}um.prototype.isCatmullRomCurve3=!0;function Ey(r,e,t,n,i){const s=(n-e)*.5,o=(i-t)*.5,a=r*r,u=r*a;return(2*t-2*n+s+o)*u+(-3*t+3*n-2*s-o)*a+s*r+t}function eC(r,e){const t=1-r;return t*t*e}function tC(r,e){return 2*(1-r)*r*e}function nC(r,e){return r*r*e}function sl(r,e,t,n){return eC(r,e)+tC(r,t)+nC(r,n)}function rC(r,e){const t=1-r;return t*t*t*e}function iC(r,e){const t=1-r;return 3*t*t*r*e}function sC(r,e){return 3*(1-r)*r*r*e}function oC(r,e){return r*r*r*e}function ol(r,e,t,n,i){return rC(r,e)+iC(r,t)+sC(r,n)+oC(r,i)}class wf extends Qn{constructor(e=new de,t=new de,n=new de,i=new de){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new de){const n=t,i=this.v0,s=this.v1,o=this.v2,a=this.v3;return n.set(ol(e,i.x,s.x,o.x,a.x),ol(e,i.y,s.y,o.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.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}}wf.prototype.isCubicBezierCurve=!0;class fm extends Qn{constructor(e=new F,t=new F,n=new F,i=new F){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new F){const n=t,i=this.v0,s=this.v1,o=this.v2,a=this.v3;return n.set(ol(e,i.x,s.x,o.x,a.x),ol(e,i.y,s.y,o.y,a.y),ol(e,i.z,s.z,o.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.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}}fm.prototype.isCubicBezierCurve3=!0;class Nl extends Qn{constructor(e=new de,t=new de){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new de){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){const n=t||new de;return n.copy(this.v2).sub(this.v1).normalize(),n}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}}Nl.prototype.isLineCurve=!0;class ib extends Qn{constructor(e=new F,t=new F){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new F){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)}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 Sf extends Qn{constructor(e=new de,t=new de,n=new de){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new de){const n=t,i=this.v0,s=this.v1,o=this.v2;return n.set(sl(e,i.x,s.x,o.x),sl(e,i.y,s.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}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}}Sf.prototype.isQuadraticBezierCurve=!0;class Mf extends Qn{constructor(e=new F,t=new F,n=new F){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new F){const n=t,i=this.v0,s=this.v1,o=this.v2;return n.set(sl(e,i.x,s.x,o.x),sl(e,i.y,s.y,o.y),sl(e,i.z,s.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}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}}Mf.prototype.isQuadraticBezierCurve3=!0;class Ef extends Qn{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new de){const n=t,i=this.points,s=(i.length-1)*e,o=Math.floor(s),a=s-o,u=i[o===0?o:o-1],f=i[o],p=i[o>i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(Ey(a,u.x,f.x,p.x,h.x),Ey(a,u.y,f.y,p.y,h.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 de().fromArray(i))}return this}}Ef.prototype.isSplineCurve=!0;var dm=Object.freeze({__proto__:null,ArcCurve:lm,CatmullRomCurve3:um,CubicBezierCurve:wf,CubicBezierCurve3:fm,EllipseCurve:zl,LineCurve:Nl,LineCurve3:ib,QuadraticBezierCurve:Sf,QuadraticBezierCurve3:Mf,SplineCurve:Ef});class sb extends Qn{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);e.equals(t)||this.curves.push(new Nl(t,e))}getPoint(e,t){const n=e*this.getLength(),i=this.getCurveLengths();let s=0;for(;s<i.length;){if(i[s]>=n){const o=i[s]-n,a=this.curves[s],u=a.getLength(),f=u===0?0:1-o/u;return a.getPointAt(f,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 o=s[i],a=o&&o.isEllipseCurve?e*2:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,u=o.getPoints(a);for(let f=0;f<u.length;f++){const p=u[f];n&&n.equals(p)||(t.push(p),n=p)}}return this.autoClose&&t.length>
30141&&!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 dm[i.type]().fromJSON(i))}return this}}class vl extends sb{constructor(e){super(),this.type="Path",this.currentPoint=new de,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 Nl(this.currentPoint.clone(),new de(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,i){const s=new Sf(this.currentPoint.clone(),new de(e,t),new de(n,i));return this.curves.push(s),this.currentPoint.set(n,i),this}bezierCurveTo(e,t,n,i,s,o){const a=new wf(this.currentPoint.clone(),new de(e,t),new de(n,i),new de(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new Ef(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,i,s,o){const a=this.currentPoint.x,u=this.currentPoint.y;return this.absarc(e+a,t+u,n,i,s,o),this}absarc(e,t,n,i,s,o){return this.absellipse(e,t,n,n,i,s,o),this}ellipse(e,t,n,i,s,o,a,u){const f=this.currentPoint.x,p=this.currentPoint.y;return this.absellipse(e+f,t+p,n,i,s,o,a,u),this}absellipse(e,t,n,i,s,o,a,u){const f=new zl(e,t,n,i,s,o,a,u);if(this.curves.length>0){const h=f.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(f);const p=f.getPoint(1);return this.currentPoint.copy(p),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 Br extends vl{constructor(e){super(e),this.uuid=Jn(),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 vl().fromJSON(i))}return this}}const aC={triangulate:function(r,e,t=2){const n=e&&e.length,i=n?e[0]*t:r.length;let s=ob(r,0,i,t,!0);const o=[];if(!s||s.next===s.prev)return o;let a,u,f,p,h,d,g;if(n&&(s=dC(r,e,s,t)),r.length>80*t){a=f=r[0],u=p=r[1];for(let y=t;y<i;y+=t)h=r[y],d=r[y+1],h<a&&(a=h),d<u&&(u=d),h>f&&(f=h),d>p&&(p=d);g=Math.max(f-a,p-u),g=g!==0?1/g:0}return xl(s,o,t,a,u,g),o}};function ob(r,e,t,n,i){let s,o;if(i===SC(r,e,t,n)>0)for(s=e;s<t;s+=n)o=Ty(s,r[s],r[s+1],o);else for(s=t-n;s>=e;s-=n)o=Ty(s,r[s],r[s+1],o);return o&&Tf(o,o.next)&&(bl(o),o=o.next),o}function Vi(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(Tf(t,t.next)||Vt(t.prev,t,t.next)===0)){if(bl(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function xl(r,e,t,n,i,s,o){if(!r)return;!o&&s&&yC(r,n,i,s);let a=r,u,f;for(;r.prev!==r.next;){if(u=r.prev,f=r.next,s?cC(r,n,i,s):lC(r)){e.push(u.i/t),e.push(r.i/t),e.push(f.i/t),bl(r),r=f.next,a=f.next;continue}if(r=f,r===a){o?o===1?(r=uC(Vi(r),e,t),xl(r,e,t,n,i,s,2)):o===2&&fC(r,e,t,n,i,s):xl(Vi(r),e,t,n,i,s,1);break}}}function lC(r){const e=r.prev,t=r,n=r.next;if(Vt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Lo(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Vt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function cC(r,e,t,n){const i=r.prev,s=r,o=r.next;if(Vt(i,s,o)>=0)return!1;const a=i.x<s.x?i.x<o.x?i.x:o.x:s.x<o.x?s.x:o.x,u=i.y<s.y?i.y<o.y?i.y:o.y:s.y<o.y?s.y:o.y,f=i.x>s.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,p=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=gp(a,u,e,t,n),d=gp(f,p,e,t,n);let g=r.prevZ,y=r.nextZ;for(;g&&g.z>=h&&y&&y.z<=d;){if(g!==r.prev&&g!==r.next&&Lo(i.x,i.y,s.x,s.y,o.x,o.y,g.x,g.y)&&Vt(g.prev,g,g.next)>=0||(g=g.prevZ,y!==r.prev&&y!==r.next&&Lo(i.x,i.y,s.x,s.y,o.x,o.y,y.x,y.y)&&Vt(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;g&&g.z>=h;){if(g!==r.prev&&g!==r.next&&Lo(i.x,i.y,s.x,s.y,o.x,o.y,g.x,g.y)&&Vt(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;y&&y.z<=d;){if(y!==r.prev&&y!==r.next&&Lo(i.x,i.y,s.x,s.y,o.x,o.y,y.x,y.y)&&Vt(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function uC(r,e,t){let n=r;do{const i=n.prev,s=n.next.next;!Tf(i,s)&&ab(i,n,n.next,s)&&_l(i,s)&&_l(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),bl(n),bl(n.next),n=r=s),n=n.next}while(n!==r);return Vi(n)}function fC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&_C(o,a)){let u=lb(o,a);o=Vi(o,o.next),u=Vi(u,u.next),xl(o,e,t,n,i,s),xl(u,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function dC(r,e,t,n){const i=[];let s,o,a,u,f;for(s=0,o=e.length;s<o;s++)a=e[s]*n,u=s<o-1?e[s+1]*n:r.length,f=ob(r,a,u,n,!1),f===f.next&&(f.steiner=!0),i.push(xC(f));for(i.sort(hC),s=0;s<i.length;s++)pC(i[s],t),t=Vi(t,t.next);return t}function hC(r,e){return r.x-e.x}function pC(r,e){if(e=mC(r,e),e){const t=lb(e,r);Vi(e,e.next),Vi(t,t.next)}}function mC(r,e){let t=e;const n=r.x,i=r.y;let s=-1/0,o;do{if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){const d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>
3014s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==e);if(!o)return null;if(n===s)return o;const a=o,u=o.x,f=o.y;let p=1/0,h;t=o;do n>=t.x&&t.x>=u&&n!==t.x&&Lo(i<f?n:s,i,u,f,i<f?s:n,i,t.x,t.y)&&(h=Math.abs(i-t.y)/(n-t.x),_l(t,r)&&(h<p||h===p&&(t.x>o.x||t.x===o.x&&gC(o,t)))&&(o=t,p=h)),t=t.next;while(t!==a);return o}function gC(r,e){return Vt(r.prev,r,e.prev)<0&&Vt(e.next,r,r.next)<0}function yC(r,e,t,n){let i=r;do i.z===null&&(i.z=gp(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,vC(i)}function vC(r){let e,t,n,i,s,o,a,u,f=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e<f&&(a++,n=n.nextZ,!!n);e++);for(u=f;a>0||u>0&&n;)a!==0&&(u===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,u--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,f*=2}while(o>1);return r}function gp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,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 xC(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 Lo(r,e,t,n,i,s,o,a){return(i-o)*(e-a)-(r-o)*(s-a)>=0&&(r-o)*(n-a)-(t-o)*(e-a)>
vendor: 17,993 bytes, line 3014
3014=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function _C(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!bC(r,e)&&(_l(r,e)&&_l(e,r)&&wC(r,e)&&(Vt(r.prev,r,e.prev)||Vt(r,e.prev,e))||Tf(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 Tf(r,e){return r.x===e.x&&r.y===e.y}function ab(r,e,t,n){const i=xu(Vt(r,e,t)),s=xu(Vt(r,e,n)),o=xu(Vt(t,n,r)),a=xu(Vt(t,n,e));return!!(i!==s&&o!==a||i===0&&vu(r,t,e)||s===0&&vu(r,n,e)||o===0&&vu(t,r,n)||a===0&&vu(t,e,n))}function vu(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 xu(r){return r>0?1:r<0?-1:0}function bC(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&&ab(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function _l(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 wC(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 lb(r,e){const t=new yp(r.i,r.x,r.y),n=new yp(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 Ty(r,e,t,n){const i=new yp(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 bl(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 yp(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function SC(r,e,t,n){let i=0;for(let s=e,o=t-n;s<t;s+=n)i+=(r[o]-r[s])*(r[s+1]+r[o+1]),o=s;return i}class zr{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 zr.area(e)<0}static triangulateShape(e,t){const n=[],i=[],s=[];Ay(e),Ry(n,e);let o=e.length;t.forEach(Ay);for(let u=0;u<t.length;u++)i.push(o),o+=t[u].length,Ry(n,t[u]);const a=aC.triangulate(n,i);for(let u=0;u<a.length;u+=3)s.push(a.slice(u,u+3));return s}}function Ay(r){const e=r.length;e>2&&r[e-1].equals(r[0])&&r.pop()}function Ry(r,e){for(let t=0;t<e.length;t++)r.push(e[t].x),r.push(e[t].y)}class kr extends Je{constructor(e=new Br([new de(.5,.5),new de(-.5,.5),new de(-.5,-.5),new de(.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 a=0,u=e.length;a<u;a++){const f=e[a];o(f)}this.setAttribute("position",new ze(i,3)),this.setAttribute("uv",new ze(s,2)),this.computeVertexNormals();function o(a){const u=[],f=t.curveSegments!==void 0?t.curveSegments:12,p=t.steps!==void 0?t.steps:1;let h=t.depth!==void 0?t.depth:1,d=t.bevelEnabled!==void 0?t.bevelEnabled:!0,g=t.bevelThickness!==void 0?t.bevelThickness:.2,y=t.bevelSize!==void 0?t.bevelSize:g-.1,_=t.bevelOffset!==void 0?t.bevelOffset:0,w=t.bevelSegments!==void 0?t.bevelSegments:3;const x=t.extrudePath,v=t.UVGenerator!==void 0?t.UVGenerator:MC;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),h=t.amount);let E,M=!1,A,C,L,D;x&&(E=x.getSpacedPoints(p),M=!0,d=!1,A=x.computeFrenetFrames(p,!1),C=new F,L=new F,D=new F),d||(w=0,g=0,y=0,_=0);const k=a.extractPoints(f);let B=k.shape;const T=k.holes;if(!zr.isClockWise(B)){B=B.reverse();for(let le=0,me=T.length;le<me;le++){const he=T[le];zr.isClockWise(he)&&(T[le]=he.reverse())}}const H=zr.triangulateShape(B,T),W=B;for(let le=0,me=T.length;le<me;le++){const he=T[le];B=B.concat(he)}function V(le,me,he){return me||console.error("THREE.ExtrudeGeometry: vec does not exist"),me.clone().multiplyScalar(he).add(le)}const j=B.length,Z=H.length;function ne(le,me,he){let Ee,ve,je;const Ye=le.x-me.x,st=le.y-me.y,xt=he.x-le.x,mt=he.y-le.y,G=Ye*Ye+st*st,I=Ye*mt-st*xt;if(Math.abs(I)>Number.EPSILON){const J=Math.sqrt(G),pe=Math.sqrt(xt*xt+mt*mt),Te=me.x-st/J,ie=me.y+Ye/J,Ne=he.x-mt/pe,Ie=he.y+xt/pe,we=((Ne-Te)*mt-(Ie-ie)*xt)/(Ye*mt-st*xt);Ee=Te+Ye*we-le.x,ve=ie+st*we-le.y;const be=Ee*Ee+ve*ve;if(be<=2)return new de(Ee,ve);je=Math.sqrt(be/2)}else{let J=!1;Ye>Number.EPSILON?xt>Number.EPSILON&&(J=!0):Ye<-Number.EPSILON?xt<-Number.EPSILON&&(J=!0):Math.sign(st)===Math.sign(mt)&&(J=!0),J?(Ee=-st,ve=Ye,je=Math.sqrt(G)):(Ee=Ye,ve=st,je=Math.sqrt(G/2))}return new de(Ee/je,ve/je)}const ge=[];for(let le=0,me=W.length,he=me-1,Ee=le+1;le<me;le++,he++,Ee++)he===me&&(he=0),Ee===me&&(Ee=0),ge[le]=ne(W[le],W[he],W[Ee]);const Y=[];let ee,ue=ge.concat();for(let le=0,me=T.length;le<me;le++){const he=T[le];ee=[];for(let Ee=0,ve=he.length,je=ve-1,Ye=Ee+1;Ee<ve;Ee++,je++,Ye++)je===ve&&(je=0),Ye===ve&&(Ye=0),ee[Ee]=ne(he[Ee],he[je],he[Ye]);Y.push(ee),ue=ue.concat(ee)}for(let le=0;le<w;le++){const me=le/w,he=g*Math.cos(me*Math.PI/2),Ee=y*Math.sin(me*Math.PI/2)+_;for(let ve=0,je=W.length;ve<je;ve++){const Ye=V(W[ve],ge[ve],Ee);Le(Ye.x,Ye.y,-he)}for(let ve=0,je=T.length;ve<je;ve++){const Ye=T[ve];ee=Y[ve];for(let st=0,xt=Ye.length;st<xt;st++){const mt=V(Ye[st],ee[st],Ee);Le(mt.x,mt.y,-he)}}}const ye=y+_;for(let le=0;le<j;le++){const me=d?V(B[le],ue[le],ye):B[le];M?(L.copy(A.normals[0]).multiplyScalar(me.x),C.copy(A.binormals[0]).multiplyScalar(me.y),D.copy(E[0]).add(L).add(C),Le(D.x,D.y,D.z)):Le(me.x,me.y,0)}for(let le=1;le<=p;le++)for(let me=0;me<j;me++){const he=d?V(B[me],ue[me],ye):B[me];M?(L.copy(A.normals[le]).multiplyScalar(he.x),C.copy(A.binormals[le]).multiplyScalar(he.y),D.copy(E[le]).add(L).add(C),Le(D.x,D.y,D.z)):Le(he.x,he.y,h/p*le)}for(let le=w-1;le>=0;le--){const me=le/w,he=g*Math.cos(me*Math.PI/2),Ee=y*Math.sin(me*Math.PI/2)+_;for(let ve=0,je=W.length;ve<je;ve++){const Ye=V(W[ve],ge[ve],Ee);Le(Ye.x,Ye.y,h+he)}for(let ve=0,je=T.length;ve<je;ve++){const Ye=T[ve];ee=Y[ve];for(let st=0,xt=Ye.length;st<xt;st++){const mt=V(Ye[st],ee[st],Ee);M?Le(mt.x,mt.y+E[p-1].y,E[p-1].x+he):Le(mt.x,mt.y,h+he)}}}xe(),re();function xe(){const le=i.length/3;if(d){let me=0,he=j*me;for(let Ee=0;Ee<Z;Ee++){const ve=H[Ee];Be(ve[2]+he,ve[1]+he,ve[0]+he)}me=p+w*2,he=j*me;for(let Ee=0;Ee<Z;Ee++){const ve=H[Ee];Be(ve[0]+he,ve[1]+he,ve[2]+he)}}else{for(let me=0;me<Z;me++){const he=H[me];Be(he[2],he[1],he[0])}for(let me=0;me<Z;me++){const he=H[me];Be(he[0]+j*p,he[1]+j*p,he[2]+j*p)}}n.addGroup(le,i.length/3-le,0)}function re(){const le=i.length/3;let me=0;Xe(W,me),me+=W.length;for(let he=0,Ee=T.length;he<Ee;he++){const ve=T[he];Xe(ve,me),me+=ve.length}n.addGroup(le,i.length/3-le,1)}function Xe(le,me){let he=le.length;for(;--he>=0;){const Ee=he;let ve=he-1;ve<0&&(ve=le.length-1);for(let je=0,Ye=p+w*2;je<Ye;je++){const st=j*je,xt=j*(je+1),mt=me+Ee+st,G=me+ve+st,I=me+ve+xt,J=me+Ee+xt;Me(mt,G,I,J)}}}function Le(le,me,he){u.push(le),u.push(me),u.push(he)}function Be(le,me,he){et(le),et(me),et(he);const Ee=i.length/3,ve=v.generateTopUV(n,i,Ee-3,Ee-2,Ee-1);Ve(ve[0]),Ve(ve[1]),Ve(ve[2])}function Me(le,me,he,Ee){et(le),et(me),et(Ee),et(me),et(he),et(Ee);const ve=i.length/3,je=v.generateSideWallUV(n,i,ve-6,ve-3,ve-2,ve-1);Ve(je[0]),Ve(je[1]),Ve(je[3]),Ve(je[1]),Ve(je[2]),Ve(je[3])}function et(le){i.push(u[le*3+0]),i.push(u[le*3+1]),i.push(u[le*3+2])}function Ve(le){s.push(le.x),s.push(le.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return EC(t,n,e)}static fromJSON(e,t){const n=[];for(let s=0,o=e.shapes.length;s<o;s++){const a=t[e.shapes[s]];n.push(a)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new dm[i.type]().fromJSON(i)),new kr(n,e.options)}}const MC={generateTopUV:function(r,e,t,n,i){const s=e[t*3],o=e[t*3+1],a=e[n*3],u=e[n*3+1],f=e[i*3],p=e[i*3+1];return[new de(s,o),new de(a,u),new de(f,p)]},generateSideWallUV:function(r,e,t,n,i,s){const o=e[t*3],a=e[t*3+1],u=e[t*3+2],f=e[n*3],p=e[n*3+1],h=e[n*3+2],d=e[i*3],g=e[i*3+1],y=e[i*3+2],_=e[s*3],w=e[s*3+1],x=e[s*3+2];return Math.abs(a-p)<Math.abs(o-f)?[new de(o,1-u),new de(f,1-h),new de(d,1-y),new de(_,1-x)]:[new de(a,1-u),new de(p,1-h),new de(g,1-y),new de(w,1-x)]}};function EC(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 e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class qo extends Nr{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 qo(e.radius,e.detail)}}class Xo extends Je{constructor(e=[new de(0,.5),new de(.5,0),new de(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=_n(i,0,Math.PI*2);const s=[],o=[],a=[],u=[],f=[],p=1/t,h=new F,d=new de,g=new F,y=new F,_=new F;let w=0,x=0;for(let v=0;v<=e.length-1;v++)switch(v){case 0:w=e[v+1].x-e[v].x,x=e[v+1].y-e[v].y,g.x=x*1,g.y=-w,g.z=x*0,_.copy(g),g.normalize(),u.push(g.x,g.y,g.z);break;case e.length-1:u.push(_.x,_.y,_.z);break;default:w=e[v+1].x-e[v].x,x=e[v+1].y-e[v].y,g.x=x*1,g.y=-w,g.z=x*0,y.copy(g),g.x+=_.x,g.y+=_.y,g.z+=_.z,g.normalize(),u.push(g.x,g.y,g.z),_.copy(y)}for(let v=0;v<=t;v++){const E=n+v*p*i,M=Math.sin(E),A=Math.cos(E);for(let C=0;C<=e.length-1;C++){h.x=e[C].x*M,h.y=e[C].y,h.z=e[C].x*A,o.push(h.x,h.y,h.z),d.x=v/t,d.y=C/(e.length-1),a.push(d.x,d.y);const L=u[3*C+0]*M,D=u[3*C+1],k=u[3*C+0]*A;f.push(L,D,k)}}for(let v=0;v<t;v++)for(let E=0;E<e.length-1;E++){const M=E+v*e.length,A=M,C=M+e.length,L=M+e.length+1,D=M+1;s.push(A,C,D),s.push(L,D,C)}this.setIndex(s),this.setAttribute("position",new ze(o,3)),this.setAttribute("uv",new ze(a,2)),this.setAttribute("normal",new ze(f,3))}static fromJSON(e){return new Xo(e.points,e.segments,e.phiStart,e.phiLength)}}class Ls extends Nr{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 Ls(e.radius,e.detail)}}class Yo extends Je{constructor(e=.5,t=1,n=8,i=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:s,thetaLength:o},n=Math.max(3,n),i=Math.max(1,i);const a=[],u=[],f=[],p=[];let h=e;const d=(t-e)/i,g=new F,y=new de;for(let _=0;_<=i;_++){for(let w=0;w<=n;w++){const x=s+w/n*o;g.x=h*Math.cos(x),g.y=h*Math.sin(x),u.push(g.x,g.y,g.z),f.push(0,0,1),y.x=(g.x/t+1)/2,y.y=(g.y/t+1)/2,p.push(y.x,y.y)}h+=d}for(let _=0;_<i;_++){const w=_*(n+1);for(let x=0;x<n;x++){const v=x+w,E=v,M=v+n+1,A=v+n+2,C=v+1;a.push(E,M,C),a.push(M,A,C)}}this.setIndex(a),this.setAttribute("position",new ze(u,3)),this.setAttribute("normal",new ze(f,3)),this.setAttribute("uv",new ze(p,2))}static fromJSON(e){return new Yo(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Is extends Je{constructor(e=new Br([new de(0,.5),new de(-.5,-.5),new de(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],i=[],s=[],o=[];let a=0,u=0;if(Array.isArray(e)===!1)f(e);else for(let p=0;p<e.length;p++)f(e[p]),this.addGroup(a,u,p),a+=u,u=0;this.setIndex(n),this.setAttribute("position",new ze(i,3)),this.setAttribute("normal",new ze(s,3)),this.setAttribute("uv",new ze(o,2));function f(p){const h=i.length/3,d=p.extractPoints(t);let g=d.shape;const y=d.holes;zr.isClockWise(g)===!1&&(g=g.reverse());for(let w=0,x=y.length;w<x;w++){const v=y[w];zr.isClockWise(v)===!0&&(y[w]=v.reverse())}const _=zr.triangulateShape(g,y);for(let w=0,x=y.length;w<x;w++){const v=y[w];g=g.concat(v)}for(let w=0,x=g.length;w<x;w++){const v=g[w];i.push(v.x,v.y,0),s.push(0,0,1),o.push(v.x,v.y)}for(let w=0,x=_.length;w<x;w++){const v=_[w],E=v[0]+h,M=v[1]+h,A=v[2]+h;n.push(E,M,A),u+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return TC(t,e)}static fromJSON(e,t){const n=[];for(let i=0,s=e.shapes.length;i<s;i++){const o=t[e.shapes[i]];n.push(o)}return new Is(n,e.curveSegments)}}function TC(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 Ds extends Je{constructor(e=1,t=32,n=16,i=0,s=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:s,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const u=Math.min(o+a,Math.PI);let f=0;const p=[],h=new F,d=new F,g=[],y=[],_=[],w=[];for(let x=0;x<=n;x++){const v=[],E=x/n;let M=0;x==0&&o==0?M=.5/t:x==n&&u==Math.PI&&(M=-.5/t);for(let A=0;A<=t;A++){const C=A/t;h.x=-e*Math.cos(i+C*s)*Math.sin(o+E*a),h.y=e*Math.cos(o+E*a),h.z=e*Math.sin(i+C*s)*Math.sin(o+E*a),y.push(h.x,h.y,h.z),d.copy(h).normalize(),_.push(d.x,d.y,d.z),w.push(C+M,1-E),v.push(f++)}p.push(v)}for(let x=0;x<n;x++)for(let v=0;v<t;v++){const E=p[x][v+1],M=p[x][v],A=p[x+1][v],C=p[x+1][v+1];(x!==0||o>0)&&g.push(E,M,C),(x!==n-1||u<Math.PI)&&g.push(M,A,C)}this.setIndex(g),this.setAttribute("position",new ze(y,3)),this.setAttribute("normal",new ze(_,3)),this.setAttribute("uv",new ze(w,2))}static fromJSON(e){return new Ds(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Jo extends Nr{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 Jo(e.radius,e.detail)}}class Zo extends Je{constructor(e=1,t=.4,n=8,i=6,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 o=[],a=[],u=[],f=[],p=new F,h=new F,d=new F;for(let g=0;g<=n;g++)for(let y=0;y<=i;y++){const _=y/i*s,w=g/n*Math.PI*2;h.x=(e+t*Math.cos(w))*Math.cos(_),h.y=(e+t*Math.cos(w))*Math.sin(_),h.z=t*Math.sin(w),a.push(h.x,h.y,h.z),p.x=e*Math.cos(_),p.y=e*Math.sin(_),d.subVectors(h,p).normalize(),u.push(d.x,d.y,d.z),f.push(y/i),f.push(g/n)}for(let g=1;g<=n;g++)for(let y=1;y<=i;y++){const _=(i+1)*g+y-1,w=(i+1)*(g-1)+y-1,x=(i+1)*(g-1)+y,v=(i+1)*g+y;o.push(_,w,v),o.push(w,x,v)}this.setIndex(o),this.setAttribute("position",new ze(a,3)),this.setAttribute("normal",new ze(u,3)),this.setAttribute("uv",new ze(f,2))}static fromJSON(e){return new Zo(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Ko extends Je{constructor(e=1,t=.4,n=64,i=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:s,q:o},n=Math.floor(n),i=Math.floor(i);const a=[],u=[],f=[],p=[],h=new F,d=new F,g=new F,y=new F,_=new F,w=new F,x=new F;for(let E=0;E<=n;++E){const M=E/n*s*Math.PI*2;v(M,s,o,e,g),v(M+.01,s,o,e,y),w.subVectors(y,g),x.addVectors(y,g),_.crossVectors(w,x),x.crossVectors(_,w),_.normalize(),x.normalize();for(let A=0;A<=i;++A){const C=A/i*Math.PI*2,L=-t*Math.cos(C),D=t*Math.sin(C);h.x=g.x+(L*x.x+D*_.x),h.y=g.y+(L*x.y+D*_.y),h.z=g.z+(L*x.z+D*_.z),u.push(h.x,h.y,h.z),d.subVectors(h,g).normalize(),f.push(d.x,d.y,d.z),p.push(E/n),p.push(A/i)}}for(let E=1;E<=n;E++)for(let M=1;M<=i;M++){const A=(i+1)*(E-1)+(M-1),C=(i+1)*E+(M-1),L=(i+1)*E+M,D=(i+1)*(E-1)+M;a.push(A,C,D),a.push(C,L,D)}this.setIndex(a),this.setAttribute("position",new ze(u,3)),this.setAttribute("normal",new ze(f,3)),this.setAttribute("uv",new ze(p,2));function v(E,M,A,C,L){const D=Math.cos(E),k=Math.sin(E),B=A/M*E,T=Math.cos(B);L.x=C*(2+T)*.5*D,L.y=C*(2+T)*k*.5,L.z=C*Math.sin(B)*.5}}static fromJSON(e){return new Ko(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Qo extends Je{constructor(e=new Mf(new F(-1,-1,0),new F(-1,1,0),new F(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 o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new F,u=new F,f=new de;let p=new F;const h=[],d=[],g=[],y=[];_(),this.setIndex(y),this.setAttribute("position",new ze(h,3)),this.setAttribute("normal",new ze(d,3)),this.setAttribute("uv",new ze(g,2));function _(){for(let E=0;E<t;E++)w(E);w(s===!1?t:0),v(),x()}function w(E){p=e.getPointAt(E/t,p);const M=o.normals[E],A=o.binormals[E];for(let C=0;C<=i;C++){const L=C/i*Math.PI*2,D=Math.sin(L),k=-Math.cos(L);u.x=k*M.x+D*A.x,u.y=k*M.y+D*A.y,u.z=k*M.z+D*A.z,u.normalize(),d.push(u.x,u.y,u.z),a.x=p.x+n*u.x,a.y=p.y+n*u.y,a.z=p.z+n*u.z,h.push(a.x,a.y,a.z)}}function x(){for(let E=1;E<=t;E++)for(let M=1;M<=i;M++){const A=(i+1)*(E-1)+(M-1),C=(i+1)*E+(M-1),L=(i+1)*E+M,D=(i+1)*(E-1)+M;y.push(A,C,D),y.push(C,L,D)}}function v(){for(let E=0;E<=t;E++)for(let M=0;M<=i;M++)f.x=E/t,f.y=M/i,g.push(f.x,f.y)}}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Qo(new dm[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class hm extends Je{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,i=new F,s=new F;if(e.index!==null){const o=e.attributes.position,a=e.index;let u=e.groups;u.length===0&&(u=[{start:0,count:a.count,materialIndex:0}]);for(let f=0,p=u.length;f<p;++f){const h=u[f],d=h.start,g=h.count;for(let y=d,_=d+g;y<_;y+=3)for(let w=0;w<3;w++){const x=a.getX(y+w),v=a.getX(y+(w+1)%3);i.fromBufferAttribute(o,x),s.fromBufferAttribute(o,v),Cy(i,s,n)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}}else{const o=e.attributes.position;for(let a=0,u=o.count/3;a<u;a++)for(let f=0;f<3;f++){const p=3*a+f,h=3*a+(f+1)%3;i.fromBufferAttribute(o,p),s.fromBufferAttribute(o,h),Cy(i,s,n)===!0&&(t.push(i.x,i.y,i.z),t.pu
vendor: 11,380 bytes, line 3014
3014sh(s.x,s.y,s.z))}}this.setAttribute("position",new ze(t,3))}}}function Cy(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,i),!0)}var Py=Object.freeze({__proto__:null,BoxGeometry:li,BoxBufferGeometry:li,CircleGeometry:Wo,CircleBufferGeometry:Wo,ConeGeometry:$o,ConeBufferGeometry:$o,CylinderGeometry:Gi,CylinderBufferGeometry:Gi,DodecahedronGeometry:jo,DodecahedronBufferGeometry:jo,EdgesGeometry:am,ExtrudeGeometry:kr,ExtrudeBufferGeometry:kr,IcosahedronGeometry:qo,IcosahedronBufferGeometry:qo,LatheGeometry:Xo,LatheBufferGeometry:Xo,OctahedronGeometry:Ls,OctahedronBufferGeometry:Ls,PlaneGeometry:Cs,PlaneBufferGeometry:Cs,PolyhedronGeometry:Nr,PolyhedronBufferGeometry:Nr,RingGeometry:Yo,RingBufferGeometry:Yo,ShapeGeometry:Is,ShapeBufferGeometry:Is,SphereGeometry:Ds,SphereBufferGeometry:Ds,TetrahedronGeometry:Jo,TetrahedronBufferGeometry:Jo,TorusGeometry:Zo,TorusBufferGeometry:Zo,TorusKnotGeometry:Ko,TorusKnotBufferGeometry:Ko,TubeGeometry:Qo,TubeBufferGeometry:Qo,WireframeGeometry:hm});class pm extends pn{constructor(e){super(),this.type="ShadowMaterial",this.color=new Ae(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}pm.prototype.isShadowMaterial=!0;class Af extends pn{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ae(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 Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ns,this.normalScale=new de(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.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,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.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}Af.prototype.isMeshStandardMaterial=!0;class mm extends Af{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new de(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return _n(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.sheenColor=new Ae(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Ae(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ae(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=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.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.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}}mm.prototype.isMeshPhysicalMaterial=!0;class gm extends pn{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Ae(16777215),this.specular=new Ae(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ns,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Pl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,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}}gm.prototype.isMeshPhongMaterial=!0;class ym extends pn{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ae(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ns,this.normalScale=new de(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.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}}ym.prototype.isMeshToonMaterial=!0;class vm extends pn{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ns,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!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}}vm.prototype.isMeshNormalMaterial=!0;class xm extends pn{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Ae(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Pl,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",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.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}}xm.prototype.isMeshLambertMaterial=!0;class _m extends pn{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ae(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ns,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,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}}
3014_m.prototype.isMeshMatcapMaterial=!0;class bm extends mn{constructor(e){super(),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}}bm.prototype.isLineDashedMaterial=!0;var AC=Object.freeze({__proto__:null,ShadowMaterial:pm,SpriteMaterial:yf,RawShaderMaterial:sa,ShaderMaterial:ci,PointsMaterial:Hs,MeshPhysicalMaterial:mm,MeshStandardMaterial:Af,MeshPhongMaterial:gm,MeshToonMaterial:ym,MeshNormalMaterial:vm,MeshLambertMaterial:xm,MeshDepthMaterial:mf,MeshDistanceMaterial:gf,MeshBasicMaterial:pi,MeshMatcapMaterial:_m,LineDashedMaterial:bm,LineBasicMaterial:mn,Material:pn});const Nt={arraySlice:function(r,e,t){return Nt.isTypedArray(r)?new r.constructor(r.subarray(e,t!==void 0?t:r.length)):r.slice(e,t)},convertArray:function(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)},isTypedArray:function(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)},getKeyframeOrder:function(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},sortedArray:function(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,o=0;o!==n;++s){const a=t[s]*e;for(let u=0;u!==e;++u)i[o++]=r[a+u]}return i},flattenJSON:function(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 o=s[n];if(o!==void 0)if(Array.isArray(o))do o=s[n],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=r[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[n],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=r[i++];while(s!==void 0);else do o=s[n],o!==void 0&&(e.push(s.time),t.push(o)),s=r[i++];while(s!==void 0)},subclip:function(r,e,t,n,i=30){const s=r.clone();s.name=e;const o=[];for(let u=0;u<s.tracks.length;++u){const f=s.tracks[u],p=f.getValueSize(),h=[],d=[];for(let g=0;g<f.times.length;++g){const y=f.times[g]*i;if(!(y<t||y>=n)){h.push(f.times[g]);for(let _=0;_<p;++_)d.push(f.values[g*p+_])}}h.length!==0&&(f.times=Nt.convertArray(h,f.times.constructor),f.values=Nt.convertArray(d,f.values.constructor),o.push(f))}s.tracks=o;let a=1/0;for(let u=0;u<s.tracks.length;++u)a>s.tracks[u].times[0]&&(a=s.tracks[u].times[0]);for(let u=0;u<s.tracks.length;++u)s.tracks[u].shift(-1*a);return s.resetDuration(),s},makeClipAdditive:function(r,e=0,t=r,n=30){n<=0&&(n=30);const i=t.tracks.length,s=e/n;for(let o=0;o<i;++o){const a=t.tracks[o],u=a.ValueTypeName;if(u==="bool"||u==="string")continue;const f=r.tracks.find(function(x){return x.name===a.name&&x.ValueTypeName===u});if(f===void 0)continue;let p=0;const h=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=h/3);let d=0;const g=f.getValueSize();f.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(d=g/3);const y=a.times.length-1;let _;if(s<=a.times[0]){const x=p,v=h-p;_=Nt.arraySlice(a.values,x,v)}else if(s>=a.times[y]){const x=y*h+p,v=x+h-p;_=Nt.arraySlice(a.values,x,v)}else{const x=a.createInterpolant(),v=p,E=h-p;x.evaluate(s),_=Nt.arraySlice(x.resultBuffer,v,E)}u==="quaternion"&&new Sn().fromArray(_).normalize().conjugate().toArray(_);const w=f.times.length;for(let x=0;x<w;++x){const v=x*g+d;if(u==="quaternion")Sn.multiplyQuaternionsFlat(f.values,v,_,0,f.values,v);else{const E=g-d*2;for(let M=0;M<E;++M)f.values[v+M]-=_[M]}}}return r.blendMode=Qp,r}};class fi{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 o;n:{r:if(!(e<i)){for(let a=n+2;;){if(i===void 0){if(e<s)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,s)}if(n===a)break;if(s=i,i=t[++n],e<i)break t}o=t.length;break n}if(!(e>=s)){const a=t[1];e<a&&(n=2,s=a);for(let u=n-2;;){if(s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(n===u)break;if(i=s,s=t[--n-1],e>=s)break t}o=n,n=0;break n}break e}for(;n<o;){const a=n+o>>>1;e<t[a]?o=a:n=a+1}if(i=t[n],s=t[n-1],s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,i);
vendor: 37,004 bytes, line 3014
3014if(i===void 0)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,s,e)}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 o=0;o!==i;++o)t[o]=n[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}fi.prototype.beforeStart_=fi.prototype.copySampleValue_;fi.prototype.afterEnd_=fi.prototype.copySampleValue_;class cb extends fi{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:ms,endingEnd:ms}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,o=e+1,a=i[s],u=i[o];if(a===void 0)switch(this.getSettings_().endingStart){case gs:s=e,a=2*t-n;break;case ml:s=i.length-2,a=t+i[s]-i[s+1];break;default:s=e,a=n}if(u===void 0)switch(this.getSettings_().endingEnd){case gs:o=e,u=2*n-t;break;case ml:o=1,u=n+i[1]-i[0];break;default:o=e-1,u=t}const f=(n-t)*.5,p=this.valueSize;this._weightPrev=f/(t-a),this._weightNext=f/(u-n),this._offsetPrev=s*p,this._offsetNext=o*p}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,u=e*a,f=u-a,p=this._offsetPrev,h=this._offsetNext,d=this._weightPrev,g=this._weightNext,y=(n-t)/(i-t),_=y*y,w=_*y,x=-d*w+2*d*_-d*y,v=(1+d)*w+(-1.5-2*d)*_+(-.5+d)*y+1,E=(-1-g)*w+(1.5+g)*_+.5*y,M=g*w-g*_;for(let A=0;A!==a;++A)s[A]=x*o[p+A]+v*o[f+A]+E*o[u+A]+M*o[h+A];return s}}class wm extends fi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,u=e*a,f=u-a,p=(n-t)/(i-t),h=1-p;for(let d=0;d!==a;++d)s[d]=o[f+d]*h+o[u+d]*p;return s}}class ub extends fi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Mr{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=Nt.convertArray(t,this.TimeBufferType),this.values=Nt.convertArray(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:Nt.convertArray(e.times,Array),values:Nt.convertArray(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new ub(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new wm(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new cb(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case hl:t=this.InterpolantFactoryMethodDiscrete;break;case pl:t=this.InterpolantFactoryMethodLinear;break;case ku: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 hl;case this.InterpolantFactoryMethodLinear:return pl;case this.InterpolantFactoryMethodSmooth:return ku}}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,o=i-1;for(;s!==i&&n[s]<e;)++s;for(;o!==-1&&n[o]>t;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=Nt.arraySlice(n,s,o),this.values=Nt.arraySlice(this.values,s*a,o*a)}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 o=null;for(let a=0;a!==s;a++){const u=n[a];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,u),e=!1;break}if(o!==null&&o>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,u,o),e=!1;break}o=u}if(i!==void 0&&Nt.isTypedArray(i))for(let a=0,u=i.length;a!==u;++a){const f=i[a];if(isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,f),e=!1;break}}return e}optimize(){const e=Nt.arraySlice(this.times),t=Nt.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===ku,s=e.length-1;let o=1;for(let a=1;a<s;++a){let u=!1;const f=e[a],p=e[a+1];if(f!==p&&(a!==1||f!==e[0]))if(i)u=!0;else{const h=a*n,d=h-n,g=h+n;for(let y=0;y!==n;++y){const _=t[h+y];if(_!==t[d+y]||_!==t[g+y]){u=!0;break}}}if(u){if(a!==o){e[o]=e[a];const h=a*n,d=o*n;for(let g=0;g!==n;++g)t[d+g]=t[h+g]}++o}}if(s>0){e[o]=e[s];for(let a=s*n,u=o*n,f=0;f!==n;++f)t[u+f]=t[a+f];++o}return o!==e.length?(this.times=Nt.arraySlice(e,0,o),this.values=Nt.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){const e=Nt.arraySlice(this.times,0),t=Nt.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Mr.prototype.TimeBufferType=Float32Array;Mr.prototype.ValueBufferType=Float32Array;Mr.prototype.DefaultInterpolation=pl;class Gs extends Mr{}Gs.prototype.ValueTypeName="bool";Gs.prototype.ValueBufferType=Array;Gs.prototype.DefaultInterpolation=hl;Gs.prototype.InterpolantFactoryMethodLinear=void 0;Gs.prototype.InterpolantFactoryMethodSmooth=void 0;class Sm extends Mr{}Sm.prototype.ValueTypeName="color";class wl extends Mr{}wl.prototype.ValueTypeName="number";class fb extends fi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,u=(n-t)/(i-t);let f=e*a;for(let p=f+a;f!==p;f+=4)Sn.slerpFlat(s,0,o,f-a,o,f,u);return s}}class la extends Mr{InterpolantFactoryMethodLinear(e){return new fb(this.times,this.values,this.getValueSize(),e)}}la.prototype.ValueTypeName="quaternion";la.prototype.DefaultInterpolation=pl;la.prototype.InterpolantFactoryMethodSmooth=void 0;class Vs extends Mr{}Vs.prototype.ValueTypeName="string";Vs.prototype.ValueBufferType=Array;Vs.prototype.DefaultInterpolation=hl;Vs.prototype.InterpolantFactoryMethodLinear=void 0;Vs.prototype.InterpolantFactoryMethodSmooth=void 0;class Sl extends Mr{}Sl.prototype.ValueTypeName="vector";class Ml{constructor(e,t=-1,n,i=lf){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Jn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(CC(n[o]).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,o=n.length;s!==o;++s)t.push(Mr.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,o=[];for(let a=0;a<s;a++){let u=[],f=[];u.push((a+s-1)%s,a,(a+1)%s),f.push(0,1,0);const p=Nt.getKeyframeOrder(u);u=Nt.sortedArray(u,1,p),f=Nt.sortedArray(f,1,p),!i&&u[0]===0&&(u.push(s),f.push(f[0])),o.push(new wl(".morphTargetInfluences["+t[a].name+"]",u,f).scale(1/n))}return new this(e,-1,o)}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 a=0,u=e.length;a<u;a++){const f=e[a],p=f.name.match(s);if(p&&p.length>1){const h=p[1];let d=i[h];d||(i[h]=d=[]),d.push(f)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(h,d,g,y,_){if(g.length!==0){const w=[],x=[];Nt.flattenJSON(g,w,x,y),w.length!==0&&_.push(new h(d,w,x))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let u=e.length||-1;const f=e.hierarchy||[];for(let h=0;h<f.length;h++){const d=f[h].keys;if(!(!d||d.length===0))if(d[0].morphTargets){const g={};let y;for(y=0;y<d.length;y++)if(d[y].morphTargets)for(let _=0;_<d[y].morphTargets.length;_++)g[d[y].morphTargets[_]]=-1;for(const _ in g){const w=[],x=[];for(let v=0;v!==d[y].morphTargets.length;++v){const E=d[y];w.push(E.time),x.push(E.morphTarget===_?1:0)}i.push(new wl(".morphTargetInfluence["+_+"]",w,x))}u=g.length*(o||1)}else{const g=".bones["+t[h].name+"]";n(Sl,g+".position",d,"pos",i),n(la,g+".quaternion",d,"rot",i),n(Sl,g+".scale",d,"scl",i)}}return i.length===0?null:new this(s,u,i,a)}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 RC(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return wl;case"vector":case"vector2":case"vector3":case"vector4":return Sl;case"color":return Sm;case"quaternion":return la;case"bool":case"boolean":return Gs;case"string":return Vs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+r)}function CC(r){if(r.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=RC(r.type);if(r.times===void 0){const t=[],n=[];Nt.flattenJSON(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 Os={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 Mm{constructor(e,t,n){const i=this;let s=!1,o=0,a=0,u;const f=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(p){a++,s===!1&&i.onStart!==void 0&&i.onStart(p,o,a),s=!0},this.itemEnd=function(p){o++,i.onProgress!==void 0&&i.onProgress(p,o,a),o===a&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(p){i.onError!==void 0&&i.onError(p)},this.resolveURL=function(p){return u?u(p):p},this.setURLModifier=function(p){return u=p,this},this.addHandler=function(p,h){return f.push(p,h),this},this.removeHandler=function(p){const h=f.indexOf(p);return h!==-1&&f.splice(h,2),this},this.getHandler=function(p){for(let h=0,d=f.length;h<d;h+=2){const g=f[h],y=f[h+1];if(g.global&&(g.lastIndex=0),g.test(p))return y}return null}}}const Io=new Mm;class Bn{constructor(e){this.manager=e!==void 0?e:Io,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}}const ti={};class Ur extends Bn{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=Os.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(ti[e]!==void 0){ti[e].push({onLoad:t,onProgress:n,onError:i});return}ti[e]=[],ti[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,u=this.responseType;fetch(o).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream=="undefined"||f.body.getReader===void 0)return f;const p=ti[e],h=f.body.getReader(),d=f.headers.get("Content-Length"),g=d?parseInt(d):0,y=g!==0;let _=0;const w=new ReadableStream({start(x){v();function v(){h.read().then(({done:E,value:M})=>{if(E)x.close();else{_+=M.byteLength;const A=new ProgressEvent("progress",{lengthComputable:y,loaded:_,total:g});for(let C=0,L=p.length;C<L;C++){const D=p[C];D.onProgress&&D.onProgress(A)}x.enqueue(M),v()}})}}});return new Response(w)}else throw Error(`fetch for "${f.url}" responded with ${f.status}: ${f.statusText}`)}).then(f=>{switch(u){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(p=>new DOMParser().parseFromString(p,a));case"json":return f.json();default:if(a===void 0)return f.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),d=h&&h[1]?h[1].toLowerCase():void 0,g=new TextDecoder(d);return f.arrayBuffer().then(y=>g.decode(y))}}}).then(f=>{Os.add(e,f);const p=ti[e];delete ti[e];for(let h=0,d=p.length;h<d;h++){const g=p[h];g.onLoad&&g.onLoad(f)}}).catch(f=>{const p=ti[e];if(p===void 0)throw this.manager.itemError(e),f;delete ti[e];for(let h=0,d=p.length;h<d;h++){const g=p[h];g.onError&&g.onError(f)}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 PC extends Bn{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new Ur(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}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=Ml.parse(e[n]);t.push(i)}return t}}class LC extends Bn{constructor(e){super(e)}load(e,t,n,i){const s=this,o=[],a=new om,u=new Ur(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(s.withCredentials);let f=0;function p(h){u.load(e[h],function(d){const g=s.parse(d,!0);o[h]={width:g.width,height:g.height,format:g.format,mipmaps:g.mipmaps},f+=1,f===6&&(g.mipmapCount===1&&(a.minFilter=Pt),a.image=o,a.format=g.format,a.needsUpdate=!0,t&&t(a))},n,i)}if(Array.isArray(e))for(let h=0,d=e.length;h<d;++h)p(h);else u.load(e,function(h){const d=s.parse(h,!0);if(d.isCubemap){const g=d.mipmaps.length/d.mipmapCount;for(let y=0;y<g;y++){o[y]={mipmaps:[]};for(let _=0;_<d.mipmapCount;_++)o[y].mipmaps.push(d.mipmaps[y*d.mipmapCount+_]),o[y].format=d.format,o[y].width=d.width,o[y].height=d.height}a.image=o}else a.image.width=d.width,a.image.height=d.height,a.mipmaps=d.mipmaps;d.mipmapCount===1&&(a.minFilter=Pt),a.format=d.format,a.needsUpdate=!0,t&&t(a)},n,i);return a}}class El extends Bn{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,o=Os.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a=yl("img");function u(){p(),Os.add(e,this),t&&t(this),s.manager.itemEnd(e)}function f(h){p(),i&&i(h),s.manager.itemError(e),s.manager.itemEnd(e)}function p(){a.removeEventListener("load",u,!1),a.removeEventListener("error",f,!1)}return a.addEventListener("load",u,!1),a.addEventListener("error",f,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}}class Em extends Bn{constructor(e){super(e)}load(e,t,n,i){const s=new ia,o=new El(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function u(f){o.load(e[f],function(p){s.images[f]=p,a++,a===6&&(s.needsUpdate=!0,t&&t(s))},void 0,i)}for(let f=0;f<e.length;++f)u(f);return s}}class Tm extends Bn{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new ws,a=new Ur(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(s.withCredentials),a.load(e,function(u){const f=s.parse(u);!f||(f.image!==void 0?o.image=f.image:f.data!==void 0&&(o.image.width=f.width,o.image.height=f.height,o.image.data=f.data),o.wrapS=f.wrapS!==void 0?f.wrapS:bn,o.wrapT=f.wrapT!==void 0?f.wrapT:bn,o.magFilter=f.magFilter!==void 0?f.magFilter:Pt,o.minFilter=f.minFilter!==void 0?f.minFilter:Pt,o.anisotropy=f.anisotropy!==void 0?f.anisotropy:1,f.encoding!==void 0&&(o.encoding=f.encoding),f.flipY!==void 0&&(o.flipY=f.flipY),f.format!==void 0&&(o.format=f.format),f.type!==void 0&&(o.type=f.type),f.mipmaps!==void 0&&(o.mipmaps=f.mipmaps,o.minFilter=zs),f.mipmapCount===1&&(o.minFilter=Pt),f.generateMipmaps!==void 0&&(o.generateMipmaps=f.generateMipmaps),o.needsUpdate=!0,t&&t(o,f))},n,i),o}}class db extends Bn{constructor(e){super(e)}load(e,t,n,i){const s=new nn,o=new El(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){s.image=a,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}}class wr extends ct{constructor(e,t=1){super(),this.type="Light",this.color=new Ae(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),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}}wr.prototype.isLight=!0;class Am extends wr{constructor(e,t,n){super(e,n),this.type="HemisphereLight",this.position.copy(ct.DefaultUp),this.updateMatrix(),this.groundColor=new Ae(t)}copy(e){return wr.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}Am.prototype.isHemisphereLight=!0;const Ly=new ke,Iy=new F,Dy=new F;class Rm{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new de(512,512),this.map=null,this.mapPass=null,this.matrix=new ke,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Dl,this._frameExtents=new de(1,1),this._viewportCount=1,this._viewports=[new Mt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;Iy.setFromMatrixPosition(e.matrixWorld),t.position.copy(Iy),Dy.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Dy),t.updateMatrixWorld(),Ly.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ly),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)}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 hb extends Rm{constructor(){super(new Qt(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,n=gl*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}}hb.prototype.isSpotLightShadow=!0;class Cm extends wr{constructor(e,t,n=0,i=Math.PI/3,s=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(ct.DefaultUp),this.updateMatrix(),this.target=new ct,this.distance=n,this.angle=i,this.penumbra=s,this.decay=o,this.shadow=new hb}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),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}}Cm.prototype.isSpotLight=!0;const Oy=new ke,qa=new F,yh=new F;class pb extends Rm{constructor(){super(new Qt(90,1,.5,500)),this._frameExtents=new de(4,2),this._viewportCount=6,this._viewports=[new Mt(2,1,1,1),new Mt(0,1,1,1),new Mt(3,1,1,1),new Mt(1,1,1,1),new Mt(3,0,1,1),new Mt(1,0,1,1)],this._cubeDirections=[new F(1,0,0),new F(-1,0,0),new F(0,0,1),new F(0,0,-1),new F(0,1,0),new F(0,-1,0)],this._cubeUps=[new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,0,1),new F(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()),qa.setFromMatrixPosition(e.matrixWorld),n.position.copy(qa),yh.copy(n.position),yh.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(yh),n.updateMatrixWorld(),i.makeTranslation(-qa.x,-qa.y,-qa.z),Oy.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Oy)}}pb.prototype.isPointLightShadow=!0;class Pm extends wr{constructor(e,t,n=0,i=1){super(e,t),this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new pb}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}Pm.prototype.isPointLight=!0;class mb extends Rm{constructor(){super(new Ji(-5,5,5,-5,.5,500))}}mb.prototype.isDirectionalLightShadow=!0;class Lm extends wr{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(ct.DefaultUp),this.updateMatrix(),this.target=new ct,this.shadow=new mb}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Lm.prototype.isDirectionalLight=!0;class Im extends wr{constructor(e,t){super(e,t),this.type="AmbientLight"}}Im.prototype.isAmbientLight=!0;class Dm extends wr{constructor(e,t,n=10,i=10){super(e,t),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}}Dm.prototype.isRectAreaLight=!0;class Om{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new F)}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,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*i),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*n),t.addScaledVector(o[4],1.092548*(n*i)),t.addScaledVector(o[5],1.092548*(i*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(n*s)),t.addScaledVector(o[8],.546274*(n*n-i*i)),t}getIrradianceAt(e,t){const n=e.x,i=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*i),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*n),t.addScaledVector(o[4],2*.429043*n*i),t.addScaledVector(o[5],2*.429043*i*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*n*s),t.addScaledVector(o[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)}}Om.prototype.isSphericalHarmonics3=!0;class kl extends wr{constructor(e=new Om,t=1){super(void 0,t),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}}kl.prototype.isLightProbe=!0;class gb extends Bn{constructor(e){super(e),this.textures={}}load(e,t,n,i){const s=this,o=new Ur(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}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=new AC[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 Ae().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.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.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.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),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.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!==1&&(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.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 o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new Ae().setHex(o.value);break;case"v2":i.uniforms[s].value=new de().fromArray(o.value);break;case"v3":i.uniforms[s].value=new F().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Mt().fromArray(o.value);break;case"m3":i.uniforms[s].value=new un().fromArray(o.value);break;case"m4":i.uniforms[s].value=new ke().fromArray(o.value);break;default:i.uniforms[s].value=o.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.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),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 de().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 de().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),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}}class qu{static decodeText(e){if(typeof TextDecoder!="undefined")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.substr(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 Fm extends Je{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}Fm.prototype.isInstancedBufferGeometry=!0;class yb extends Bn{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new Ur(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}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 w=g.interleavedBuffers[y],x=s(g,w.buffer),v=Po(w.type,x),E=new Us(v,w.stride);return E.uuid=w.uuid,t[y]=E,E}function s(g,y){if(n[y]!==void 0)return n[y];const w=g.arrayBuffers[y],x=new Uint32Array(w).buffer;return n[y]=x,x}const o=e.isInstancedBufferGeometry?new Fm:new Je,a=e.data.index;if(a!==void 0){const g=Po(a.type,a.array);o.setIndex(new pt(g,1))}const u=e.data.attributes;for(const g in u){const y=u[g];let _;if(y.isInterleavedBufferAttribute){const w=i(e.data,y.data);_=new Hi(w,y.itemSize,y.offset,y.normalized)}else{const w=Po(y.type,y.array),x=y.isInstancedBufferAttribute?Ps:pt;_=new x(w,y.itemSize,y.normalized)}y.name!==void 0&&(_.name=y.name),y.usage!==void 0&&_.setUsage(y.usage),y.updateRange!==void 0&&(_.updateRange.offset=y.updateRange.offset,_.updateRange.count=y.updateRange.count),o.setAttribute(g,_)}const f=e.data.morphAttributes;if(f)for(const g in f){const y=f[g],_=[];for(let w=0,x=y.length;w<x;w++){const v=y[w];let E;if(v.isInterleavedBufferAttribute){const M=i(e.data,v.data);E=new Hi(M,v.itemSize,v.offset,v.normalized)}else{const M=Po(v.type,v.array);E=new pt(M,v.itemSize,v.normalized)}v.name!==void 0&&(E.name=v.name),_.push(E)}o.morphAttributes[g]=_}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const h=e.data.groups||e.data.drawcalls||e.data.offsets;if(h!==void 0)for(let g=0,y=h.length;g!==y;++g){const _=h[g];o.addGroup(_.start,_.count,_.materialIndex)}const d=e.data.boundingSphere;if(d!==void 0){const g=new F;d.center!==void 0&&g.fromArray(d.center),o.boundingSphere=new Xi(g,d.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class IC extends Bn{constructor(e){super(e)}load(e,t,n,i){const s=this,o=this.path===""?qu.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const a=new Ur(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(u){let f=null;try{f=JSON.parse(u)}catch(h){i!==void 0&&i(h),console.error("THREE:ObjectLoader: Can't parse "+e+".",h.message);return}const p=f.metadata;if(p===void 0||p.type===void 0||p.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(f,t)},n,i)}async loadAsync(e,t){const n=this,i=this.path===""?qu.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;const s=new Ur(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),a=JSON.parse(o),u=a.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(a)}parse(e,t){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,i),o=this.parseImages(e.images,function(){t!==void 0&&t(f)}),a=this.parseTextures(e.textures,o),u=this.parseMaterials(e.materials,a),f=this.parseObject(e.object,s,u,a,n),p=this.parseSkeletons(e.skeletons,f);
3014if(this.bindSkeletons(f,p),t!==void 0){let h=!1;for(const d in o)if(o[d]instanceof HTMLImageElement){h=!0;break}h===!1&&t(f)}return f}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),o=this.parseTextures(e.textures,s),a=this.parseMaterials(e.materials,o),u=this.parseObject(e.object,i,a,o,t),f=this.parseSkeletons(e.skeletons,u);return this.bindSkeletons(u,f),u}parseShapes(e){const t={};if(e!==void 0)for(let n=0,i=e.length;n<i;n++){const s=new Br().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,o=e.length;s<o;s++){const a=new bf().fromJSON(e[s],i);n[a.uuid]=a}return n}parseGeometries(e,t){const n={};if(e!==void 0){const i=new yb;for(let s=0,o=e.length;s<o;s++){let a;const u=e[s];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":a=i.parse(u);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:u.type in Py?a=Py[u.type].fromJSON(u,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${u.type}"`)}a.uuid=u.uuid,u.name!==void 0&&(a.name=u.name),a.isBufferGeometry===!0&&u.userData!==void 0&&(a.userData=u.userData),n[u.uuid]=a}}return n}parseMaterials(e,t){const n={},i={};if(e!==void 0){const s=new gb;s.setTextures(t);for(let o=0,a=e.length;o<a;o++){const u=e[o];if(u.type==="MultiMaterial"){const f=[];for(let p=0;p<u.materials.length;p++){const h=u.materials[p];n[h.uuid]===void 0&&(n[h.uuid]=s.parse(h)),f.push(n[h.uuid])}i[u.uuid]=f}else 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=Ml.parse(i);t[s.uuid]=s}return t}parseImages(e,t){const n=this,i={};let s;function o(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 a(u){if(typeof u=="string"){const f=u,p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(f)?f:n.resourcePath+f;return o(p)}else return u.data?{data:Po(u.type,u.data),width:u.width,height:u.height}:null}if(e!==void 0&&e.length>0){const u=new Mm(t);s=new El(u),s.setCrossOrigin(this.crossOrigin);for(let f=0,p=e.length;f<p;f++){const h=e[f],d=h.url;if(Array.isArray(d)){i[h.uuid]=[];for(let g=0,y=d.length;g<y;g++){const _=d[g],w=a(_);w!==null&&(w instanceof HTMLImageElement?i[h.uuid].push(w):i[h.uuid].push(new ws(w.data,w.width,w.height)))}}else{const g=a(h.url);g!==null&&(i[h.uuid]=g)}}}return i}async parseImagesAsync(e){const t=this,n={};let i;async function s(o){if(typeof o=="string"){const a=o,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await i.loadAsync(u)}else return o.data?{data:Po(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){i=new El(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o<a;o++){const u=e[o],f=u.url;if(Array.isArray(f)){n[u.uuid]=[];for(let p=0,h=f.length;p<h;p++){const d=f[p],g=await s(d);g!==null&&(g instanceof HTMLImageElement?n[u.uuid].push(g):n[u.uuid].push(new ws(g.data,g.width,g.height)))}}else{const p=await s(u.url);p!==null&&(n[u.uuid]=p)}}}return n}parseTextures(e,t){function n(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const i={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=e[s];a.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),t[a.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",a.image);let u;const f=t[a.image];Array.isArray(f)?(u=new ia(f),f.length===6&&(u.needsUpdate=!0)):(f&&f.data?u=new ws(f.data,f.width,f.height):u=new nn(f),f&&(u.needsUpdate=!0)),u.uuid=a.uuid,a.name!==void 0&&(u.name=a.name),a.mapping!==void 0&&(u.mapping=n(a.mapping,DC)),a.offset!==void 0&&u.offset.fromArray(a.offset),a.repeat!==void 0&&u.repeat.fromArray(a.repeat),a.center!==void 0&&u.center.fromArray(a.center),a.rotation!==void 0&&(u.rotation=a.rotation),a.wrap!==void 0&&(u.wrapS=n(a.wrap[0],Fy),u.wrapT=n(a.wrap[1],Fy)),a.format!==void 0&&(u.format=a.format),a.type!==void 0&&(u.type=a.type),a.encoding!==void 0&&(u.encoding=a.encoding),a.minFilter!==void 0&&(u.minFilter=n(a.minFilter,By)),a.magFilter!==void 0&&(u.magFilter=n(a.magFilter,By)),a.anisotropy!==void 0&&(u.anisotropy=a.anisotropy),a.flipY!==void 0&&(u.flipY=a.flipY),a.premultiplyAlpha!==void 0&&(u.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(u.unpackAlignment=a.unpackAlignment),a.userData!==void 0&&(u.userData=a.userData),i[a.uuid]=u}return i}parseObject(e,t,n,i,s){let o;function a(d){return t[d]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",d),t[d]}function u(d){if(d!==void 0){if(Array.isArray(d)){const g=[];for(let y=0,_=d.length;y<_;y++){const w=d[y];n[w]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",w),g.push(n[w])}return g}return n[d]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",d),n[d]}}function f(d){return i[d]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",d),i[d]}let p,h;switch(e.type){case"Scene":o=new aa,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new Ae(e.background):o.background=f(e.background)),e.environment!==void 0&&(o.environment=f(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new Fl(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new Ol(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new Qt(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;
3014case"OrthographicCamera":o=new Ji(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new Im(e.color,e.intensity);break;case"DirectionalLight":o=new Lm(e.color,e.intensity);break;case"PointLight":o=new Pm(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new Dm(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new Cm(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new Am(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new kl().fromJSON(e);break;case"SkinnedMesh":p=a(e.geometry),h=u(e.material),o=new xf(p,h),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":p=a(e.geometry),h=u(e.material),o=new on(p,h);break;case"InstancedMesh":p=a(e.geometry),h=u(e.material);const d=e.count,g=e.instanceMatrix,y=e.instanceColor;o=new im(p,h,d),o.instanceMatrix=new Ps(new Float32Array(g.array),16),y!==void 0&&(o.instanceColor=new Ps(new Float32Array(y.array),y.itemSize));break;case"LOD":o=new eb;break;case"Line":o=new ui(a(e.geometry),u(e.material));break;case"LineLoop":o=new sm(a(e.geometry),u(e.material));break;case"LineSegments":o=new Wn(a(e.geometry),u(e.material));break;case"PointCloud":case"Points":o=new Bl(a(e.geometry),u(e.material));break;case"Sprite":o=new vf(u(e.material));break;case"Group":o=new ys;break;case"Bone":o=new _f;break;default:o=new ct}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const d=e.children;for(let g=0;g<d.length;g++)o.add(this.parseObject(d[g],t,n,i,s))}if(e.animations!==void 0){const d=e.animations;for(let g=0;g<d.length;g++){const y=d[g];o.animations.push(s[y])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const d=e.levels;for(let g=0;g<d.length;g++){const y=d[g],_=o.getObjectByProperty("uuid",y.object);_!==void 0&&o.addLevel(_,y.distance)}}return o}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)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const DC={UVMapping:af,CubeReflectionMapping:$i,CubeRefractionMapping:Bs,EquirectangularReflectionMapping:ko,EquirectangularRefractionMapping:ul,CubeUVReflectionMapping:ra,CubeUVRefractionMapping:Ll},Fy={RepeatWrapping:fl,ClampToEdgeWrapping:bn,MirroredRepeatWrapping:dl},By={NearestFilter:Kt,NearestMipmapNearestFilter:Vu,NearestMipmapLinearFilter:Wu,LinearFilter:Pt,LinearMipmapNearestFilter:Kp,LinearMipmapLinearFilter:zs};class vb extends Bn{constructor(e){super(e),typeof createImageBitmap=="undefined"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch=="undefined"&&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,o=Os.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){Os.add(e,u),t&&t(u),s.manager.itemEnd(e)}).catch(function(u){i&&i(u),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}vb.prototype.isImageBitmapLoader=!0;let _u;
3014const Bm={getContext:function(){return _u===void 0&&(_u=new(window.AudioContext||window.webkitAudioContext)),_u},setContext:function(r){_u=r}};class xb extends Bn{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new Ur(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{const u=a.slice(0);Bm.getContext().decodeAudioData(u,function(p){t(p)})}catch(u){i?i(u):console.error(u),s.manager.itemError(e)}},n,i)}}class _b extends kl{constructor(e,t,n=1){super(void 0,n);const i=new Ae().set(e),s=new Ae().set(t),o=new F(i.r,i.g,i.b),a=new F(s.r,s.g,s.b),u=Math.sqrt(Math.PI),f=u*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(u),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(f)}}_b.prototype.isHemisphereLightProbe=!0;class bb extends kl{constructor(e,t=1){super(void 0,t);const n=new Ae().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}bb.prototype.isAmbientLightProbe=!0;const zy=new ke,Ny=new ke,as=new ke;class OC{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Qt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Qt,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,as.copy(e.projectionMatrix);const i=t.eyeSep/2,s=i*t.near/t.focus,o=t.near*Math.tan(_s*t.fov*.5)/t.zoom;let a,u;Ny.elements[12]=-i,zy.elements[12]=i,a=-o*t.aspect+s,u=o*t.aspect+s,as.elements[0]=2*t.near/(u-a),as.elements[8]=(u+a)/(u-a),this.cameraL.projectionMatrix.copy(as),a=-o*t.aspect-s,u=o*t.aspect-s,as.elements[0]=2*t.near/(u-a),as.elements[8]=(u+a)/(u-a),this.cameraR.projectionMatrix.copy(as)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ny),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(zy)}}class zm{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=ky(),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=ky();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function ky(){return(typeof performance=="undefined"?Date:performance).now()}const ls=new F,Uy=new Sn,FC=new F,cs=new F;class BC extends ct{constructor(){super(),this.type="AudioListener",this.context=Bm.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new zm}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(ls,Uy,FC),cs.set(0,0,-1).applyQuaternion(Uy),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(ls.x,i),t.positionY.linearRampToValueAtTime(ls.y,i),t.positionZ.linearRampToValueAtTime(ls.z,i),t.forwardX.linearRampToValueAtTime(cs.x,i),t.forwardY.linearRampToValueAtTime(cs.y,i),t.forwardZ.linearRampToValueAtTime(cs.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(ls.x,ls.y,ls.z),t.setOrientation(cs.x,cs.y,cs.z,n.x,n.y,n.z)}}class Nm extends ct{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
vendor: 37,567 bytes, line 3014
3014=!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.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.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 us=new F,Hy=new Sn,zC=new F,fs=new F;class NC extends Nm{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(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(us,Hy,zC),fs.set(0,0,1).applyQuaternion(Hy);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(us.x,n),t.positionY.linearRampToValueAtTime(us.y,n),t.positionZ.linearRampToValueAtTime(us.z,n),t.orientationX.linearRampToValueAtTime(fs.x,n),t.orientationY.linearRampToValueAtTime(fs.y,n),t.orientationZ.linearRampToValueAtTime(fs.z,n)}else t.setPosition(us.x,us.y,us.z),t.setOrientation(fs.x,fs.y,fs.z)}}class wb{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 Sb{constructor(e,t,n){this.binding=e,this.valueSize=n;let i,s,o;switch(t){case"quaternion":i=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":i=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:i=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=s,this._setIdentity=o,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 o=this.cumulativeWeight;if(o===0){for(let a=0;a!==i;++a)n[s+a]=n[a];o=t}else{o+=t;const a=t/o;this._mixBufferRegion(n,s,0,a,i)}this.cumulativeWeight=o}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,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const u=t*this._origIndex;this._mixBufferRegion(n,i,u,1-s,t)}o>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let u=t,f=t+t;u!==f;++u)if(n[u]!==n[u+t]){a.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,o=i;s!==o;++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 o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Sn.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){const o=this._workIndex*s;Sn.multiplyQuaternionsFlat(e,o,e,t,e,n),Sn.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){const o=1-i;for(let a=0;a!==s;++a){const u=t+a;e[u]=e[u]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[n+o]*i}}}const km="\\[\\]\\.:\\/",kC=new RegExp("["+km+"]","g"),Um="[^"+km+"]",UC="[^"+km.replace("\\.","")+"]",HC=/((?:WC+[\/:])*)/.source.replace("WC",Um),GC=/(WCOD+)?/.source.replace("WCOD",UC),VC=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Um),WC=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Um),$C=new RegExp("^"+HC+GC+VC+WC+"$"),jC=["material","materials","bones"];class qC{constructor(e,t,n){const i=n||vt.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 vt{constructor(e,t,n){this.path=t,this.parsedPath=n||vt.parseTrackName(t),this.node=vt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new vt.Composite(e,t,n):new vt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(kC,"")}static parseTrackName(e){const t=$C.exec(e);if(!t)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);jC.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||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 o=0;o<s.length;o++){const a=s[o];if(a.name===t||a.uuid===t)return a;const u=n(a.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=vt.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(n){let f=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node 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 p=0;p<e.length;p++)if(e[p].name===f){f=p;break}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(f!==void 0){if(e[f]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[f]}}const o=e[i];if(o===void 0){const f=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+f+"."+i+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=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.isBufferGeometry){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])}else{console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);return}}u=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(u=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(u=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}vt.Composite=qC;vt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};vt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};vt.prototype.GetterByBindingType=[vt.prototype._getValue_direct,vt.prototype._getValue_array,vt.prototype._getValue_arrayElement,vt.prototype._getValue_toArray];vt.prototype.SetterByBindingTypeAndVersioning=[[vt.prototype._setValue_direct,vt.prototype._setValue_direct_setNeedsUpdate,vt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[vt.prototype._setValue_array,vt.prototype._setValue_array_setNeedsUpdate,vt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[vt.prototype._setValue_arrayElement,vt.prototype._setValue_arrayElement_setNeedsUpdate,vt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[vt.prototype._setValue_fromArray,vt.prototype._setValue_fromArray_setNeedsUpdate,vt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Mb{constructor(){this.uuid=Jn(),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,o=s.length;let a,u=e.length,f=this.nCachedObjects_;for(let p=0,h=arguments.length;p!==h;++p){const d=arguments[p],g=d.uuid;let y=t[g];if(y===void 0){y=u++,t[g]=y,e.push(d);for(let _=0,w=o;_!==w;++_)s[_].push(new vt(d,n[_],i[_]))}else if(y<f){a=e[y];const _=--f,w=e[_];t[w.uuid]=y,e[y]=w,t[g]=_,e[_]=d;for(let x=0,v=o;x!==v;++x){const E=s[x],M=E[_];let A=E[y];E[y]=M,A===void 0&&(A=new vt(d,n[x],i[x])),E[_]=A}}else e[y]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=f}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let s=this.nCachedObjects_;for(let o=0,a=arguments.length;o!==a;++o){const u=arguments[o],f=u.uuid,p=t[f];if(p!==void 0&&p>=s){const h=s++,d=e[h];t[d.uuid]=p,e[p]=d,t[f]=h,e[h]=u;for(let g=0,y=i;g!==y;++g){const _=n[g],w=_[h],x=_[p];_[p]=w,_[h]=x}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,u=arguments.length;a!==u;++a){const f=arguments[a],p=f.uuid,h=t[p];if(h!==void 0)if(delete t[p],h<s){const d=--s,g=e[d],y=--o,_=e[y];t[g.uuid]=h,e[h]=g,t[_.uuid]=d,e[d]=_,e.pop();for(let w=0,x=i;w!==x;++w){const v=n[w],E=v[d],M=v[y];v[h]=E,v[d]=M,v.pop()}}else{const d=--o,g=e[d];d>0&&(t[g.uuid]=h),e[h]=g,e.pop();for(let y=0,_=i;y!==_;++y){const w=n[y];w[h]=w[d],w.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 o=this._paths,a=this._parsedPaths,u=this._objects,f=u.length,p=this.nCachedObjects_,h=new Array(f);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=p,g=u.length;d!==g;++d){const y=u[d];h[d]=new vt(y,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,u=o[a],f=e[a];t[f]=n,o[n]=u,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}}Mb.prototype.isAnimationObjectGroup=!0;class XC{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const s=t.tracks,o=s.length,a=new Array(o),u={endingStart:ms,endingEnd:ms};for(let f=0;f!==o;++f){const p=s[f].createInterpolant(null);a[f]=p,p.settings=u}this._interpolantSettings=u,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=__,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,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,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,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const u=a.parameterPositions,f=a.sampleValues;return u[0]=s,u[1]=s+n,f[0]=e/o,f[1]=t/o,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;if(u<0||n===0)return;this._startTime=null,t=n*u}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const u=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case Qp:for(let p=0,h=u.length;p!==h;++p)u[p].evaluate(o),f[p].accumulateAdditive(a);break;case lf:default:for(let p=0,h=u.length;p!==h;++p)u[p].evaluate(o),f[p].accumulate(i,a)}}}_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;n!==null&&(t*=n.evaluate(e)[0],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 o=n===b_;if(e===0)return s===-1?i:o&&(s&1)===1?t-i:i;if(n===x_){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,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);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 f=e<0;this._setEndings(f,!f,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)===1)return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=gs,i.endingEnd=gs):(e?i.endingStart=this.zeroSlopeAtStart?gs:ms:i.endingStart=ml,t?i.endingEnd=this.zeroSlopeAtEnd?gs:ms:i.endingEnd=ml)}_scheduleFading(e,t,n){const i=this._mixer,s=i.time;let o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,u=o.sampleValues;return a[0]=s,u[0]=t,a[1]=s+e,u[1]=n,this}}class Eb extends ji{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,o=e._propertyBindings,a=e._interpolants,u=n.uuid,f=this._bindingsByRootAndName;let p=f[u];p===void 0&&(p={},f[u]=p);for(let h=0;h!==s;++h){const d=i[h],g=d.name;let y=p[g];if(y!==void 0)++y.referenceCount,o[h]=y;else{if(y=o[h],y!==void 0){y._cacheIndex===null&&(++y.referenceCount,this._addInactiveBinding(y,u,g));continue}const _=t&&t._propertyBindings[h].binding.parsedPath;y=new Sb(vt.create(n,g,_),d.ValueTypeName,d.getValueSize()),++y.referenceCount,this._addInactiveBinding(y,u,g),o[h]=y}a[h].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 o=s[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{const a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=i.length,i.push(e),o.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,o=this._actionsByClip,a=o[s],u=a.knownActions,f=u[u.length-1],p=e._byClipCacheIndex;f._byClipCacheIndex=p,u[p]=f,u.pop(),e._byClipCacheIndex=null;const h=a.actionByRoot,d=(e._localRoot||this._root).uuid;delete h[d],u.length===0&&delete o[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 o=i[t];o===void 0&&(o={},i[t]=o),o[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,o=this._bindingsByRootAndName,a=o[i],u=t[t.length-1],f=e._cacheIndex;u._cacheIndex=f,t[f]=u,t.pop(),delete a[s],Object.keys(a).length===0&&delete o[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 wm(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),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 o=typeof e=="string"?Ml.findByName(i,e):e;const a=o!==null?o.uuid:e,u=this._actionsByClip[a];let f=null;if(n===void 0&&(o!==null?n=o.blendMode:n=lf),u!==void 0){const h=u.actionByRoot[s];if(h!==void 0&&h.blendMode===n)return h;f=u.knownActions[0],o===null&&(o=f._clip)}if(o===null)return null;const p=new XC(this,o,t,n);return this._bindAction(p,f),this._addInactiveAction(p,a,s),p}existingAction(e,t){const n=t||this._root,i=n.uuid,s=typeof e=="string"?Ml.findByName(n,e):e,o=s?s.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.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),o=this._accuIndex^=1;for(let f=0;f!==n;++f)t[f]._update(i,e,s,o);const a=this._bindings,u=this._nActiveBindings;for(let f=0;f!==u;++f)a[f].apply(o);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 o=s.knownActions;for(let a=0,u=o.length;a!==u;++a){const f=o[a];this._deactivateAction(f);const p=f._cacheIndex,h=t[t.length-1];f._cacheIndex=null,f._byClipCacheIndex=null,h._cacheIndex=p,t[p]=h,t.pop(),this._removeInactiveBindingsForAction(f)}delete i[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const o in n){const a=n[o].actionByRoot,u=a[t];u!==void 0&&(this._deactivateAction(u),this._removeInactiveAction(u))}const i=this._bindingsByRootAndName,s=i[t];if(s!==void 0)for(const o in s){const a=s[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}Eb.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class Rf{constructor(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new Rf(this.value.clone===void 0?this.value:this.value.clone())}}class Tb extends Us{constructor(e,t,n=1){super(e,t),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}}Tb.prototype.isInstancedInterleavedBuffer=!0;class Ab{constructor(e,t,n,i,s){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}}Ab.prototype.isGLBufferAttribute=!0;class Rb{constructor(e,t,n=0,i=1/0){this.ray=new Yi(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new bs,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){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&&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: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,n=[]){return vp(e,this,n,t),n.sort(Gy),n}intersectObjects(e,t=!0,n=[]){for(let i=0,s=e.length;i<s;i++)vp(e[i],this,n,t);return n.sort(Gy),n}}function Gy(r,e){return r.distance-e.distance}function vp(r,e,t,n){if(r.layers.test(e.layers)&&r.raycast(e,t),n===!0){const i=r.children;for(let s=0,o=i.length;s<o;s++)vp(i[s],e,t,!0)}}class YC{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(_n(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class JC{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 Vy=new de;class ca{constructor(e=new de(1/0,1/0),t=new de(-1/0,-1/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=Vy.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 Vy.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),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)}}ca.prototype.isBox2=!0;const Wy=new F,bu=new F;class Cb{constructor(e=new F,t=new F){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){Wy.subVectors(e,this.start),bu.subVectors(this.end,this.start);const n=bu.dot(bu);let s=bu.dot(Wy)/n;return t&&(s=_n(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 $y=new F;class ZC extends ct{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new Je,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 o=0,a=1,u=32;o<u;o++,a++){const f=o/u*Math.PI*2,p=a/u*Math.PI*2;i.push(Math.cos(f),Math.sin(f),1,Math.cos(p),Math.sin(p),1)}n.setAttribute("position",new ze(i,3));const s=new mn({fog:!1,toneMapped:!1});this.cone=new Wn(n,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),$y.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt($y),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Oi=new F,wu=new ke,vh=new ke;class Pb extends Wn{constructor(e){const t=Lb(e),n=new Je,i=[],s=[],o=new Ae(0,0,1),a=new Ae(0,1,0);for(let f=0;f<t.length;f++){const p=t[f];p.parent&&p.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),s.push(o.r,o.g,o.b),s.push(a.r,a.g,a.b))}n.setAttribute("position",new ze(i,3)),n.setAttribute("color",new ze(s,3));const u=new mn({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,u),this.type="SkeletonHelper",this.isSkeletonHelper=!0,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");vh.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const a=t[s];a.parent&&a.parent.isBone&&(wu.multiplyMatrices(vh,a.matrixWorld),Oi.setFromMatrixPosition(wu),i.setXYZ(o,Oi.x,Oi.y,Oi.z),wu.multiplyMatrices(vh,a.parent.matrixWorld),Oi.setFromMatrixPosition(wu),i.setXYZ(o+1,Oi.x,O
3014i.y,Oi.z),o+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}function Lb(r){const e=[];r&&r.isBone&&e.push(r);for(let t=0;t<r.children.length;t++)e.push.apply(e,Lb(r.children[t]));return e}class KC extends on{constructor(e,t,n){const i=new Ds(t,4,2),s=new pi({wireframe:!0,fog:!1,toneMapped:!1});super(i,s),this.light=e,this.light.updateMatrixWorld(),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.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const QC=new F,jy=new Ae,qy=new Ae;class e2 extends ct{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;const i=new Ls(t);i.rotateY(Math.PI*.5),this.material=new pi({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=i.getAttribute("position"),o=new Float32Array(s.count*3);i.setAttribute("color",new pt(o,3)),this.add(new on(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");jy.copy(this.light.color),qy.copy(this.light.groundColor);for(let n=0,i=t.count;n<i;n++){const s=n<i/2?jy:qy;t.setXYZ(n,s.r,s.g,s.b)}t.needsUpdate=!0}e.lookAt(QC.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Ib extends Wn{constructor(e=10,t=10,n=4473924,i=8947848){n=new Ae(n),i=new Ae(i);const s=t/2,o=e/t,a=e/2,u=[],f=[];for(let d=0,g=0,y=-a;d<=t;d++,y+=o){u.push(-a,0,y,a,0,y),u.push(y,0,-a,y,0,a);const _=d===s?n:i;_.toArray(f,g),g+=3,_.toArray(f,g),g+=3,_.toArray(f,g),g+=3,_.toArray(f,g),g+=3}const p=new Je;p.setAttribute("position",new ze(u,3)),p.setAttribute("color",new ze(f,3));const h=new mn({vertexColors:!0,toneMapped:!1});super(p,h),this.type="GridHelper"}}class t2 extends Wn{constructor(e=10,t=16,n=8,i=64,s=4473924,o=8947848){s=new Ae(s),o=new Ae(o);const a=[],u=[];for(let h=0;h<=t;h++){const d=h/t*(Math.PI*2),g=Math.sin(d)*e,y=Math.cos(d)*e;a.push(0,0,0),a.push(g,0,y);const _=h&1?s:o;u.push(_.r,_.g,_.b),u.push(_.r,_.g,_.b)}for(let h=0;h<=n;h++){const d=h&1?s:o,g=e-e/n*h;for(let y=0;y<i;y++){let _=y/i*(Math.PI*2),w=Math.sin(_)*g,x=Math.cos(_)*g;a.push(w,0,x),u.push(d.r,d.g,d.b),_=(y+1)/i*(Math.PI*2),w=Math.sin(_)*g,x=Math.cos(_)*g,a.push(w,0,x),u.push(d.r,d.g,d.b)}}const f=new Je;f.setAttribute("position",new ze(a,3)),f.setAttribute("color",new ze(u,3));const p=new mn({vertexColors:!0,toneMapped:!1});super(f,p),this.type="PolarGridHelper"}}const Xy=new F,Su=new F,Yy=new F;class n2 extends ct{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,t===void 0&&(t=1);let i=new Je;i.setAttribute("position",new ze([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new mn({fog:!1,toneMapped:!1});this.lightPlane=new ui(i,s),this.add(this.lightPlane),i=new Je,i.setAttribute("position",new ze([0,0,0,0,0,1],3)),this.targetLine=new ui(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(){Xy.setFromMatrixPosition(this.light.matrixWorld),Su.setFromMatrixPosition(this.light.target.matrixWorld),Yy.subVectors(Su,Xy),this.lightPlane.lookAt(Su),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(Su),this.targetLine.scale.z=Yy.length()}}const Mu=new F,$t=new Rs;class r2 extends Wn{constructor(e){const t=new Je,n=new mn({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],s=[],o={},a=new Ae(16755200),u=new Ae(16711680),f=new Ae(43775),p=new Ae(16777215),h=new Ae(3355443);d("n1","n2",a),d("n2","n4",a),d("n4","n3",a),d("n3","n1",a),d("f1","f2",a),d("f2","f4",a),d("f4","f3",a),d("f3","f1",a),d("n1","f1",a),d("n2","f2",a),d("n3","f3",a),d("n4","f4",a),d("p","n1",u),d("p","n2",u),d("p","n3",u),d("p","n4",u),d("u1","u2",f),d("u2","u3",f),d("u3","u1",f),d("c","t",p),d("p","c",h),d("cn1","cn2",h),d("cn3","cn4",h),d("cf1","cf2",h),d("cf3","cf4",h);function d(y,_,w){g(y,w),g(_,w)}function g(y,_){i.push(0,0,0),s.push(_.r,_.g,_.b),o[y]===void 0&&(o[y]=[]),o[y].push(i.length/3-1)}
vendor: 4,825 bytes, line 3014
3014t.setAttribute("position",new ze(i,3)),t.setAttribute("color",new ze(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=o,this.update()}update(){const e=this.geometry,t=this.pointMap,n=1,i=1;$t.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Jt("c",t,e,$t,0,0,-1),Jt("t",t,e,$t,0,0,1),Jt("n1",t,e,$t,-n,-i,-1),Jt("n2",t,e,$t,n,-i,-1),Jt("n3",t,e,$t,-n,i,-1),Jt("n4",t,e,$t,n,i,-1),Jt("f1",t,e,$t,-n,-i,1),Jt("f2",t,e,$t,n,-i,1),Jt("f3",t,e,$t,-n,i,1),Jt("f4",t,e,$t,n,i,1),Jt("u1",t,e,$t,n*.7,i*1.1,-1),Jt("u2",t,e,$t,-n*.7,i*1.1,-1),Jt("u3",t,e,$t,0,i*2,-1),Jt("cf1",t,e,$t,-n,0,1),Jt("cf2",t,e,$t,n,0,1),Jt("cf3",t,e,$t,0,-i,1),Jt("cf4",t,e,$t,0,i,1),Jt("cn1",t,e,$t,-n,0,-1),Jt("cn2",t,e,$t,n,0,-1),Jt("cn3",t,e,$t,0,-i,-1),Jt("cn4",t,e,$t,0,i,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Jt(r,e,t,n,i,s,o){Mu.set(i,s,o).unproject(n);const a=e[r];if(a!==void 0){const u=t.getAttribute("position");for(let f=0,p=a.length;f<p;f++)u.setXYZ(a[f],Mu.x,Mu.y,Mu.z)}}const Eu=new er;class Db extends Wn{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(8*3),s=new Je;s.setIndex(new pt(n,1)),s.setAttribute("position",new pt(i,3)),super(s,new mn({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&&Eu.setFromObject(this.object),Eu.isEmpty())return;const t=Eu.min,n=Eu.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){return Wn.prototype.copy.call(this,e),this.object=e.object,this}}class i2 extends Wn{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 Je;s.setIndex(new pt(n,1)),s.setAttribute("position",new ze(i,3)),super(s,new mn({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))}}class s2 extends ui{constructor(e,t=1,n=16776960){const i=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,0,1,0,0,0],o=new Je;o.setAttribute("position",new ze(s,3)),o.computeBoundingSphere(),super(o,new mn({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const a=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],u=new Je;u.setAttribute("position",new ze(a,3)),u.computeBoundingSphere(),this.add(new on(u,new pi({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?Zt:Es,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const Jy=new F;let Tu,xh;class o2 extends ct{constructor(e=new F(0,0,1),t=new F(0,0,0),n=1,i=16776960,s=n*.2,o=s*.2){super(),this.type="ArrowHelper",Tu===void 0&&(Tu=new Je,Tu.setAttribute("position",new ze([0,0,0,0,1,0],3)),xh=new Gi(0,.5,1,5,1),xh.translate(0,-.5,0)),this.position.copy(t),this.line=new ui(Tu,new mn({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new on(xh,new pi({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,s,o)}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{Jy.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Jy,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}}class Ob extends Wn{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 Je;i.setAttribute("position",new ze(t,3)),i.setAttribute("color",new ze(n,3));const s=new mn({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}
3014setColors(e,t,n){const i=new Ae,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 a2{constructor(){this.type="ShapePath",this.color=new Ae,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new vl,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,o){return this.currentPath.bezierCurveTo(e,t,n,i,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function n(v){const E=[];for(let M=0,A=v.length;M<A;M++){const C=v[M],L=new Br;L.curves=C.curves,E.push(L)}return E}function i(v,E){const M=E.length;let A=!1;for(let C=M-1,L=0;L<M;C=L++){let D=E[C],k=E[L],B=k.x-D.x,T=k.y-D.y;if(Math.abs(T)>Number.EPSILON){if(T<0&&(D=E[L],B=-B,k=E[C],T=-T),v.y<D.y||v.y>k.y)continue;if(v.y===D.y){if(v.x===D.x)return!0}else{const O=T*(v.x-D.x)-B*(v.y-D.y);if(O===0)return!0;if(O<0)continue;A=!A}}else{if(v.y!==D.y)continue;if(k.x<=v.x&&v.x<=D.x||D.x<=v.x&&v.x<=k.x)return!0}}return A}const s=zr.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,u,f;const p=[];if(o.length===1)return u=o[0],f=new Br,f.curves=u.curves,p.push(f),p;let h=!s(o[0].getPoints());h=e?!h:h;const d=[],g=[];let y=[],_=0,w;g[_]=void 0,y[_]=[];for(let v=0,E=o.length;v<E;v++)u=o[v],w=u.getPoints(),a=s(w),a=e?!a:a,a?(!h&&g[_]&&_++,g[_]={s:new Br,p:w},g[_].s.curves=u.curves,h&&_++,y[_]=[]):y[_].push({h:u,p:w[0]});if(!g[0])return n(o);if(g.length>1){let v=!1;const E=[];for(let M=0,A=g.length;M<A;M++)d[M]=[];for(let M=0,A=g.length;M<A;M++){const C=y[M];for(let L=0;L<C.length;L++){const D=C[L];let k=!0;for(let B=0;B<g.length;B++)i(D.p,g[B].p)&&(M!==B&&E.push({froms:M,tos:B,hole:L}),k?(k=!1,d[B].push(D)):v=!0);k&&d[M].push(D)}}E.length>0&&(v||(y=d))}let x;for(let v=0,E=g.length;v<E;v++){f=g[v].s,p.push(f),x=y[v];for(let M=0,A=x.length;M<A;M++)f.holes.push(x[M].h)}return p}}const Fb=new Float32Array(1),l2=new Int32Array(Fb.buffer);class el{static toHalfFloat(e){e>65504&&(console.warn("THREE.DataUtils.toHalfFloat(): value exceeds 65504."),e=65504),Fb[0]=e;const t=l2[0];let n=t>>16&32768,i=t>>12&2047;const s=t>>23&255;return s<103?n:s>142?(n|=31744,n|=(s==255?0:1)&&t&8388607,n):s<113?(i|=2048,n|=(i>>114-s)+(i>>113-s&1),n):(n|=s-112<<10|i>>1,n+=i&1,n)}}const c2=0,u2=1,f2=0,d2=1,h2=2;function p2(r){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),r}function m2(r=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),r.isMultiMaterial=!0,r.materials=r,r.clone=function(){return r.slice()},r}function g2(r,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Bl(r,e)}function y2(r){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new vf(r)}function v2(r,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Bl(r,e)}function x2(r){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Hs(r)}function _2(r){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Hs(r)}function b2(r){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Hs(r)}function w2(r,e,t){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new F(r,e,t)}function S2(r,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new pt(r,e).setUsage(Go)}function M2(r,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new I_(r,e)}function E2(r,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new D_(r,e)}function T2(r,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new O_(r,e)}function A2(r,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new F_(r,e)}function R2(r,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new uf(r,e)}function C2(r,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new B_(r,e)}function P2(r,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new ff(r,e)}function L2(r,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new ze(r,e)}function I2(r,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new N_(r,e)}Qn.create=function(r,e){return console.log("THREE.Curve.create() has been deprecated"),r.prototype=Object.create(Qn.prototype),r.prototype.constructor=r,r.prototype.getPoint=e,r};vl.prototype.fromPoints=function(r){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(r)};function D2(r){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Ob(r)}function O2(r,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Db(r,e)}function F2(r,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Wn(new am(r.geometry),new mn({color:e!==void 0?e:16777215}))}Ib.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};Pb.prototype.update=function(){console.error("THREE.SkeletonHelper: update(
3014) no longer needs to be called.")};function B2(r,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Wn(new hm(r.geometry),new mn({color:e!==void 0?e:16777215}))}Bn.prototype.extractUrlBase=function(r){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),qu.extractUrlBase(r)};Bn.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}};function z2(r){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Ur(r)}function N2(r){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Tm(r)}ca.prototype.center=function(r){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(r)};ca.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()};ca.prototype.isIntersectionBox=function(r){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(r)};ca.prototype.size=function(r){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(r)};er.prototype.center=function(r){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(r)};er.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()};er.prototype.isIntersectionBox=function(r){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(r)};er.prototype.isIntersectionSphere=function(r){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(r)};er.prototype.size=function(r){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(r)};Xi.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()};Dl.prototype.setFromMatrix=function(r){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(r)};Cb.prototype.center=function(r){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(r)};un.prototype.flattenToArrayOffset=function(r,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(r,e)};un.prototype.multiplyVector3=function(r){return console.warn("THREE.Matrix3: .multiplyVector3(
3014) has been removed. Use vector.applyMatrix3( matrix ) instead."),r.applyMatrix3(this)};un.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")};un.prototype.applyToBufferAttribute=function(r){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),r.applyMatrix3(this)};un.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")};un.prototype.getInverse=function(r){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(r).invert()};ke.prototype.extractPosition=function(r){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(r)};ke.prototype.flattenToArrayOffset=function(r,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(r,e)};ke.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new F().setFromMatrixColumn(this,3)};ke.prototype.setRotationFromQuaternion=function(r){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(r)};ke.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")};ke.prototype.multiplyVector3=function(r){return console.warn("THREE.Matrix4: .multiplyVector3(
3014) has been removed. Use vector.applyMatrix4( matrix ) instead."),r.applyMatrix4(this)};ke.prototype.multiplyVector4=function(r){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),r.applyMatrix4(this)};ke.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")};ke.prototype.rotateAxis=function(r){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),r.transformDirection(this)};ke.prototype.crossVector=function(r){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),r.applyMatrix4(this)};ke.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")};ke.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")};ke.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")};ke.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")};ke.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")};ke.prototype.applyToBufferAttribute=function(r){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),r.applyMatrix4(this)};ke.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")};ke.prototype.makeFrustum=function(r,e,t,n,i,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(r,e,n,t,i,s)};ke.prototype.getInverse=function(r){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(r).invert()};Or.prototype.isIntersectionLine=function(r){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(r)};Sn.prototype.multiplyVector3=function(r){return console.warn("THREE.Quaternion: .multiplyVector3(
3014) has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),r.applyQuaternion(this)};Sn.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()};Yi.prototype.isIntersectionBox=function(r){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(r)};Yi.prototype.isIntersectionPlane=function(r){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(r)};Yi.prototype.isIntersectionSphere=function(r){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(r)};en.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()};en.prototype.barycoordFromPoint=function(r,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(r,e)};en.prototype.midpoint=function(r){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(r)};en.prototypenormal=function(r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(r)};en.prototype.plane=function(r){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(r)};en.barycoordFromPoint=function(r,e,t,n,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),en.getBarycoord(r,e,t,n,i)};en.normal=function(r,e,t,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),en.getNormal(r,e,t,n)};Br.prototype.extractAllPoints=function(r){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(r)};Br.prototype.extrude=function(r){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new kr(this,r)};Br.prototype.makeGeometry=function(r){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Is(this,r)};de.prototype.fromAttribute=function(r,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(r,e,t)};de.prototype.distanceToManhattan=function(r){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(r)};de.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};F.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")};F.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")};F.prototype.getPositionFromMatrix=function(r){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(r)};F.prototype.getScaleFromMatrix=function(r){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(r)};F.prototype.getColumnFromMatrix=function(r,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,r)};F.prototype.applyProjection=function(r){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(r)};F.prototype.fromAttribute=function(r,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(r,e,t)};F.prototype.distanceToManhattan=function(r){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(r)};F.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};Mt.prototype.fromAttribute=function(r,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(r,e,t)};Mt.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};ct.prototype.getChildByName=function(r){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(r)};ct.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")};ct.prototype.translate=function(r,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,r)};ct.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")};
3014ct.prototype.applyMatrix=function(r){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(r)};Object.defineProperties(ct.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(r){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=r}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}});on.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")};Object.defineProperties(on.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),w_},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}});xf.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")};Qt.prototype.setLens=function(r,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(r)};Object.defineProperties(wr.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(r){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=r}},shadowCameraLeft:{set:function(r){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=r}},shadowCameraRight:{set:function(r){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=r}},shadowCameraTop:{set:function(r){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=r}},shadowCameraBottom:{set:function(r){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=r}},shadowCameraNear:{set:function(r){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=r}},shadowCameraFar:{set:function(r){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=r}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(r){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=r}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(r){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=r}},shadowMapHeight:{set:function(r){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=r}}});Object.defineProperties(pt.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Go},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Go)}}});pt.prototype.setDynamic=function(r){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(r===!0?Go:Ho),this};pt.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},pt.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};Je.prototype.addIndex=function(r){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(r)};Je.prototype.addAttribute=function(r,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),!(e&&e.isBufferAttribute)&&!(e&&e.isInterleavedBufferAttribute)?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(r,new pt(arguments[1],arguments[2]))):r==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(r,e)};Je.prototype.addDrawCall=function(r,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(r,e)};Je.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()};Je.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")};Je.prototype.removeAttribute=function(r){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(r)};
3014Je.prototype.applyMatrix=function(r){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(r)};Object.defineProperties(Je.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}});Us.prototype.setDynamic=function(r){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(r===!0?Go:Ho),this};Us.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};kr.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")};kr.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")};kr.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")};aa.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")};Rf.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this};Object.defineProperties(pn.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")}
3014,set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Ae}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(r){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=r===Xp}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(r){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=r}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}});Object.defineProperties(ci.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(r){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=r}}});St.prototype.clearTarget=function(r,e,t,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(r),this.clear(e,t,n)};St.prototype.animate=function(r){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(r)};St.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()};St.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()};St.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision};St.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()};St.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")};St.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")};St.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")};St.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")};St.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")};St.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")};St.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures};St.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_
3014instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")};St.prototype.enableScissorTest=function(r){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(r)};St.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};St.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};St.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};St.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};St.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")};St.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")};St.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")};St.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")};St.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")};St.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()};Object.defineProperties(St.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(r){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=r}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(r){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=r}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(r){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=r===!0?Rt:Kn}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}},gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});Object.defineProperties(J_.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}});function k2(r,e,t){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRen
3014derTarget( size, options )."),new Il(r,t)}Object.defineProperties(Zn.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(r){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=r}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(r){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=r}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(r){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=r}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(r){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=r}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(r){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=r}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(r){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=r}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(r){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=r}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(r){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=r}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(r){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=r}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(r){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=r}}});Nm.prototype.load=function(r){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return new xb().load(r,function(n){e.setBuffer(n)}),this};wb.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()};df.prototype.updateCubeMap=function(r,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update(
3014)."),this.update(r,e)};df.prototype.clear=function(r,e,t,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(r,e,t,n)};qi.crossOrigin=void 0;qi.loadTexture=function(r,e,t,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const i=new db;i.setCrossOrigin(this.crossOrigin);const s=i.load(r,t,void 0,n);return e&&(s.mapping=e),s};qi.loadTextureCube=function(r,e,t,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const i=new Em;i.setCrossOrigin(this.crossOrigin);const s=i.load(r,t,void 0,n);return e&&(s.mapping=e),s};qi.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")};qi.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};function U2(){console.error("THREE.CanvasRenderer has been removed")}function H2(){console.error("THREE.JSONLoader has been removed.")}const G2={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function V2(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}function W2(){return console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),new Je}function $2(){return console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),new Je}function j2(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function q2(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function X2(){console.error("THREE.ImmediateRenderObject has been removed.")}typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:of}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=of);var Y2=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Zp,AddEquation:ps,AddOperation:Qx,AdditiveAnimationBlendMode:Qp,AdditiveBlending:kh,AlphaFormat:c_,AlwaysDepth:jx,AlwaysStencilFunc:T_,AmbientLight:Im,AmbientLightProbe:bb,AnimationClip:Ml,AnimationLoader:PC,AnimationMixer:Eb,AnimationObjectGroup:Mb,AnimationUtils:Nt,ArcCurve:lm,ArrayCamera:rm,ArrowHelper:o2,Audio:Nm,AudioAnalyser:wb,AudioContext:Bm,AudioListener:BC,AudioLoader:xb,AxesHelper:Ob,AxisHelper:D2,BackSide:Zt,BasicDepthPacking:S_,BasicShadowMap:PS,BinaryTextureLoader:N2,Bone:_f,BooleanKeyframeTrack:Gs,BoundingBoxHelper:O2,Box2:ca,Box3:er,Box3Helper:i2,BoxBufferGeometry:li,BoxGeometry:li,BoxHelper:Db,BufferAttribute:pt,BufferGeometry:Je,BufferGeometryLoader:yb,ByteType:i_,Cache:Os,Camera:Rs,CameraHelper:r2,CanvasRenderer:U2,CanvasTexture:rb,CatmullRomCurve3:um,CineonToneMapping:n_,CircleBufferGeometry:Wo,CircleGeometry:Wo,ClampToEdgeWrapping:bn,Clock:zm,Color:Ae,ColorKeyframeTrack:Sm,CompressedTexture:om,CompressedTextureLoader:LC,ConeBufferGeometry:$o,ConeGeometry:$o,CubeCamera:df,CubeReflectionMapping:$i,CubeRefractionMapping:Bs,CubeTexture:ia,CubeTextureLoader:Em,CubeUVReflectionMapping:ra,CubeUVRefractionMapping:Ll,CubicBezierCurve:wf,CubicBezierCurve3:fm,CubicInterpolant:cb,CullFaceBack:Nh,CullFaceFront:Ix,CullFaceFrontBack:CS,CullFaceNone:Lx,Curve:Qn,CurvePath:sb,CustomBlending:Dx,CustomToneMapping:r_,CylinderBufferGeometry:Gi,CylinderGeometry:Gi,Cylindrical:JC,DataTexture:ws,DataTexture2DArray:hf,DataTexture3D:nm,DataTextureLoader:Tm,DataUtils:el,DecrementStencilOp:HS,DecrementWrapStencilOp:VS,DefaultLoadingManager:Io,DepthFormat:Ni,DepthStencilFormat:As,DepthTexture:ju,DirectionalLight:Lm,DirectionalLightHelper:n2,DiscreteInterpolant:ub,DodecahedronBufferGeometry:jo,DodecahedronGeometry:jo,DoubleSide:Ts,DstAlphaFactor:Ux,DstColorFactor:Gx,DynamicBufferAttribute:S2,DynamicCopyUsage:rM,DynamicDrawUsage:Go,DynamicReadUsage:eM,EdgesGeometry:am,EdgesHelper:F2,EllipseCurve:zl,EqualDepth:Xx,EqualStencilFunc:qS,EquirectangularReflectionMapping:ko,EquirectangularRefractionMapping:ul,Euler:ks,EventDispatcher:ji,ExtrudeBufferGeometry:kr,ExtrudeGeometry:kr,FaceColors:d2,FileLoader:Ur,FlatShading:Xp,Float16BufferAttribute:z_,Float32Attribute:L2,Float32BufferAttribute:ze,Float64Attribute:I2,Float64BufferAttribute:N_,FloatType:Yn,Fog:Fl,FogExp2:Ol,Font:q2,FontLoader:j2,FramebufferTexture:nb,FrontSide:Es,Frustum:Dl,GLBufferAttribute:Ab,GLSL1:sM,GLSL3:fp,GreaterDepth:Jx,GreaterEqualDepth:Yx,GreaterEqualStencilFunc:ZS,GreaterStencilFunc:YS,GridHelper:Ib,Group:ys,HalfFloatType:fr,HemisphereLight:Am,HemisphereLightHelper:e2,HemisphereLightProbe:_b,IcosahedronBufferGeometry:qo,IcosahedronGeometry:qo,ImageBitmapLoader:vb,ImageLoader:El,ImageUtils:qi,ImmediateRenderObject:X2,IncrementStencilOp:US,IncrementWrapStencilOp:GS,InstancedBufferAttribute:Ps,InstancedBufferGeometry:Fm,InstancedInterleavedBuffer:Tb,InstancedMesh:im,Int16Attribute:A2,Int16BufferAttribute:F_,Int32Attribute:C2,Int32BufferAttribute:B_,Int8Attribute:M2,Int8BufferAttribute:I_,IntType:
3014o_,InterleavedBuffer:Us,InterleavedBufferAttribute:Hi,Interpolant:fi,InterpolateDiscrete:hl,InterpolateLinear:pl,InterpolateSmooth:ku,InvertStencilOp:WS,JSONLoader:H2,KeepStencilOp:Uu,KeyframeTrack:Mr,LOD:eb,LatheBufferGeometry:Xo,LatheGeometry:Xo,Layers:bs,LensFlare:V2,LessDepth:qx,LessEqualDepth:Gu,LessEqualStencilFunc:XS,LessStencilFunc:jS,Light:wr,LightProbe:kl,Line:ui,Line3:Cb,LineBasicMaterial:mn,LineCurve:Nl,LineCurve3:ib,LineDashedMaterial:bm,LineLoop:sm,LinePieces:u2,LineSegments:Wn,LineStrip:c2,LinearEncoding:Kn,LinearFilter:Pt,LinearInterpolant:wm,LinearMipMapLinearFilter:FS,LinearMipMapNearestFilter:OS,LinearMipmapLinearFilter:zs,LinearMipmapNearestFilter:Kp,LinearToneMapping:e_,Loader:Bn,LoaderUtils:qu,LoadingManager:Mm,LoopOnce:x_,LoopPingPong:b_,LoopRepeat:__,LuminanceAlphaFormat:d_,LuminanceFormat:f_,MOUSE:AS,Material:pn,MaterialLoader:gb,Math:R0,MathUtils:R0,Matrix3:un,Matrix4:ke,MaxEquation:Vh,Mesh:on,MeshBasicMaterial:pi,MeshDepthMaterial:mf,MeshDistanceMaterial:gf,MeshFaceMaterial:p2,MeshLambertMaterial:xm,MeshMatcapMaterial:_m,MeshNormalMaterial:vm,MeshPhongMaterial:gm,MeshPhysicalMaterial:mm,MeshStandardMaterial:Af,MeshToonMaterial:ym,MinEquation:Gh,MirroredRepeatWrapping:dl,MixOperation:Kx,MultiMaterial:m2,MultiplyBlending:Hh,MultiplyOperation:Pl,NearestFilter:Kt,NearestMipMapLinearFilter:DS,NearestMipMapNearestFilter:IS,NearestMipmapLinearFilter:Wu,NearestMipmapNearestFilter:Vu,NeverDepth:$x,NeverStencilFunc:$S,NoBlending:si,NoColors:f2,NoToneMapping:Fr,NormalAnimationBlendMode:lf,NormalBlending:Oo,NotEqualDepth:Zx,NotEqualStencilFunc:JS,NumberKeyframeTrack:wl,Object3D:ct,ObjectLoader:IC,ObjectSpaceNormalMap:E_,OctahedronBufferGeometry:Ls,OctahedronGeometry:Ls,OneFactor:zx,OneMinusDstAlphaFactor:Hx,OneMinusDstColorFactor:Vx,OneMinusSrcAlphaFactor:Jp,OneMinusSrcColorFactor:kx,OrthographicCamera:Ji,PCFShadowMap:jp,PCFSoftShadowMap:qp,PMREMGenerator:hp,ParametricGeometry:W2,Particle:y2,ParticleBasicMaterial:_2,ParticleSystem:v2,ParticleSystemMaterial:b2,Path:vl,PerspectiveCamera:Qt,Plane:Or,PlaneBufferGeometry:Cs,PlaneGeometry:Cs,PlaneHelper:s2,PointCloud:g2,PointCloudMaterial:x2,PointLight:Pm,PointLightHelper:KC,Points:Bl,PointsMaterial:Hs,PolarGridHelper:t2,PolyhedronBufferGeometry:Nr,PolyhedronGeometry:Nr,PositionalAudio:NC,PropertyBinding:vt,PropertyMixer:Sb,QuadraticBezierCurve:Sf,QuadraticBezierCurve3:Mf,Quaternion:Sn,QuaternionKeyframeTrack:la,QuaternionLinearInterpolant:fb,REVISION:of,RGBADepthPacking:M_,RGBAFormat:wn,RGBAIntegerFormat:y_,RGBA_ASTC_10x10_Format:ap,RGBA_ASTC_10x5_Format:ip,RGBA_ASTC_10x6_Format:sp,RGBA_ASTC_10x8_Format:op,RGBA_ASTC_12x10_Format:lp,RGBA_ASTC_12x12_Format:cp,RGBA_ASTC_4x4_Format:Jh,RGBA_ASTC_5x4_Format:Zh,RGBA_ASTC_5x5_Format:Kh,RGBA_ASTC_6x5_Format:Qh,RGBA_ASTC_6x6_Format:ep,RGBA_ASTC_8x5_Format:tp,RGBA_ASTC_8x6_Format:np,RGBA_ASTC_8x8_Format:rp,RGBA_BPTC_Format:up,RGBA_ETC2_EAC_Format:Yh,RGBA_PVRTC_2BPPV1_Format:qh,RGBA_PVRTC_4BPPV1_Format:jh,RGBA_S3TC_DXT1_Format:Bu,RGBA_S3TC_DXT3_Format:zu,RGBA_S3TC_DXT5_Format:Nu,RGBFormat:u_,RGB_ETC1_Format:v_,RGB_ETC2_Format:Xh,RGB_PVRTC_2BPPV1_Format:$h,RGB_PVRTC_4BPPV1_Format:Wh,RGB_S3TC_DXT1_Format:Fu,RGFormat:m_,RGIntegerFormat:g_,RawShaderMaterial:sa,Ray:Yi,Raycaster:Rb,RectAreaLight:Dm,RedFormat:h_,RedIntegerFormat:p_,ReinhardToneMapping:t_,RepeatWrapping:fl,ReplaceStencilOp:kS,ReverseSubtractEquation:Fx,RingBufferGeometry:Yo,RingGeometry:Yo,Scene:aa,SceneUtils:G2,
vendor: 4,168 bytes, lines 3014-3021
3014ShaderChunk:at,ShaderLib:_r,ShaderMaterial:ci,ShadowMaterial:pm,Shape:Br,ShapeBufferGeometry:Is,ShapeGeometry:Is,ShapePath:a2,ShapeUtils:zr,ShortType:s_,Skeleton:bf,SkeletonHelper:Pb,SkinnedMesh:xf,SmoothShading:LS,Sphere:Xi,SphereBufferGeometry:Ds,SphereGeometry:Ds,Spherical:YC,SphericalHarmonics3:Om,SplineCurve:Ef,SpotLight:Cm,SpotLightHelper:ZC,Sprite:vf,SpriteMaterial:yf,SrcAlphaFactor:Yp,SrcAlphaSaturateFactor:Wx,SrcColorFactor:Nx,StaticCopyUsage:nM,StaticDrawUsage:Ho,StaticReadUsage:QS,StereoCamera:OC,StreamCopyUsage:iM,StreamDrawUsage:KS,StreamReadUsage:tM,StringKeyframeTrack:Vs,SubtractEquation:Ox,SubtractiveBlending:Uh,TOUCH:RS,TangentSpaceNormalMap:Ns,TetrahedronBufferGeometry:Jo,TetrahedronGeometry:Jo,TextGeometry:$2,Texture:nn,TextureLoader:db,TorusBufferGeometry:Zo,TorusGeometry:Zo,TorusKnotBufferGeometry:Ko,TorusKnotGeometry:Ko,Triangle:en,TriangleFanDrawMode:zS,TriangleStripDrawMode:BS,TrianglesDrawMode:w_,TubeBufferGeometry:Qo,TubeGeometry:Qo,UVMapping:af,Uint16Attribute:R2,Uint16BufferAttribute:uf,Uint32Attribute:P2,Uint32BufferAttribute:ff,Uint8Attribute:E2,Uint8BufferAttribute:D_,Uint8ClampedAttribute:T2,Uint8ClampedBufferAttribute:O_,Uniform:Rf,UniformsLib:Se,UniformsUtils:k_,UnsignedByteType:oi,UnsignedInt248Type:xs,UnsignedIntType:rl,UnsignedShort4444Type:a_,UnsignedShort5551Type:l_,UnsignedShortType:Uo,VSMShadowMap:Co,Vector2:de,Vector3:F,Vector4:Mt,VectorKeyframeTrack:Sl,Vertex:w2,VertexColors:h2,VideoTexture:tb,WebGL1Renderer:K_,WebGLCubeRenderTarget:Il,WebGLMultipleRenderTargets:L_,WebGLMultisampleRenderTarget:cf,WebGLRenderTarget:Zn,WebGLRenderTargetCube:k2,WebGLRenderer:St,WebGLUtils:Z_,WireframeGeometry:hm,WireframeHelper:B2,WrapAroundEnding:ml,XHRLoader:z2,ZeroCurvatureEnding:ms,ZeroFactor:Bx,ZeroSlopeEnding:gs,ZeroStencilOp:NS,_SRGBAFormat:$u,sRGBEncoding:Rt},Symbol.toStringTag,{value:"Module"}));function J2(r){let e;const t=new Set,n=(f,p)=>{const h=typeof f=="function"?f(e):f;if(h!==e){const d=e;e=p?h:Object.assign({},e,h),t.forEach(g=>g(e,d))}},i=()=>e,s=(f,p=i,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=p(e);function g(){const y=p(e);if(!h(d,y)){const _=d;f(d=y,_)}}return t.add(g),()=>t.delete(g)},u={setState:n,getState:i,subscribe:(f,p,h)=>p||h?s(f,p,h):(t.add(f),()=>t.delete(f)),destroy:()=>t.clear()};return e=r(n,i,u),u}const Z2=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Zy=Z2?R.exports.useEffect:R.exports.useLayoutEffect;function K2(r){const e=typeof r=="function"?J2(r):r,t=(n=e.getState,i=Object.is)=>{const[,s]=R.exports.useReducer(w=>w+1,0),o=e.getState(),a=R.exports.useRef(o),u=R.exports.useRef(n),f=R.exports.useRef(i),p=R.exports.useRef(!1),h=R.exports.useRef();h.current===void 0&&(h.current=n(o));let d,g=!1;(a.current!==o||u.current!==n||f.current!==i||p.current)&&(d=n(o),g=!i(h.current,d)),Zy(()=>{g&&(h.current=d),a.current=o,u.current=n,f.current=i,p.current=!1});const y=R.exports.useRef(o);Zy(()=>{const w=()=>{try{const v=e.getState(),E=u.current(v);f.current(h.current,E)||(a.current=v,h.current=E,s())}catch{p.current=!0,s()}},x=e.subscribe(w);return e.getState()!==y.current&&w(),x},[]);const _=g?d:h.current;return R.exports.useDebugValue(_),_};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 Bb={exports:{}},zb={exports:{}};/** @license React v0.26.2 3015 * react-reconciler.production.min.js 3016 * 3017 * Copyright (c) Facebook, Inc. and its affiliates. 3018 * 3019 * This source code is licensed under the MIT license found in the 3020 * LICENSE file in the root directory of this source tree. 3021 */(function(r){r.exports=function(t){var n={},i=SS,s=R.exports,o=Ou.exports;function a(l){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+l,m=1;m<arguments.length;m++)c+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
vendor: 23,598 bytes, lines 3021-3025
3021var u=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,f=60103,p=60106,h=60107,d=60108,g=60114,y=60109,_=60110,w=60112,x=60113,v=60120,E=60115,M=60116,A=60121,C=60129,L=60130,D=60131;if(typeof Symbol=="function"&&Symbol.for){var k=Symbol.for;f=k("react.element"),p=k("react.portal"),h=k("react.fragment"),d=k("react.strict_mode"),g=k("react.profiler"),y=k("react.provider"),_=k("react.context"),w=k("react.forward_ref"),x=k("react.suspense"),v=k("react.suspense_list"),E=k("react.memo"),M=k("react.lazy"),A=k("react.block"),k("react.scope"),C=k("react.debug_trace_mode"),L=k("react.offscreen"),D=k("react.legacy_hidden")}var B=typeof Symbol=="function"&&Symbol.iterator;function T(l){return l===null||typeof l!="object"?null:(l=B&&l[B]||l["@@iterator"],typeof l=="function"?l:null)}function O(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case h:return"Fragment";case p:return"Portal";case g:return"Profiler";case d:return"StrictMode";case x:return"Suspense";case v:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case _:return(l.displayName||"Context")+".Consumer";case y:return(l._context.displayName||"Context")+".Provider";case w:var c=l.render;return c=c.displayName||c.name||"",l.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case E:return O(l.type);case A:return O(l._render);case M:c=l._payload,l=l._init;try{return O(l(c))}catch{}}return null}function H(l){var c=l,m=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,(c.flags&1026)!==0&&(m=c.return),l=c.return;while(l)}return c.tag===3?m:null}function W(l){if(H(l)!==l)throw Error(a(188))}function V(l){var c=l.alternate;if(!c){if(c=H(l),c===null)throw Error(a(188));return c!==l?null:l}for(var m=l,b=c;;){var S=m.return;if(S===null)break;var P=S.alternate;if(P===null){if(b=S.return,b!==null){m=b;continue}break}if(S.child===P.child){for(P=S.child;P;){if(P===m)return W(S),l;if(P===b)return W(S),c;P=P.sibling}throw Error(a(188))}if(m.return!==b.return)m=S,b=P;else{for(var N=!1,$=S.child;$;){if($===m){N=!0,m=S,b=P;break}if($===b){N=!0,b=S,m=P;break}$=$.sibling}if(!N){for($=P.child;$;){if($===m){N=!0,m=P,b=S;break}if($===b){N=!0,b=P,m=S;break}$=$.sibling}if(!N)throw Error(a(189))}}if(m.alternate!==b)throw Error(a(190))}if(m.tag!==3)throw Error(a(188));return m.stateNode.current===m?l:c}function j(l){if(l=V(l),!l)return null;for(var c=l;;){if(c.tag===5||c.tag===6)return c;if(c.child)c.child.return=c,c=c.child;else{if(c===l)break;for(;!c.sibling;){if(!c.return||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}}return null}function Z(l){if(l=V(l),!l)return null;for(var c=l;;){if(c.tag===5||c.tag===6)return c;if(c.child&&c.tag!==4)c.child.return=c,c=c.child;else{if(c===l)break;for(;!c.sibling;){if(!c.return||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}}return null}function ne(l,c){for(var m=l.alternate;c!==null;){if(c===l||c===m)return!0;c=c.return}return!1}var ge=t.getPublicInstance,Y=t.getRootHostContext,ee=t.getChildHostContext,ue=t.prepareForCommit,ye=t.resetAfterCommit,xe=t.createInstance,re=t.appendInitialChild,Xe=t.finalizeInitialChildren,Le=t.prepareUpdate,Be=t.shouldSetTextContent,Me=t.createTextInstance,et=t.scheduleTimeout,Ve=t.cancelTimeout,le=t.noTimeout,me=t.isPrimaryRenderer,he=t.supportsMutation,Ee=t.supportsPersistence,ve=t.supportsHydration,je=t.getInstanceFromNode,Ye=t.makeOpaqueHydratingObject,st=t.makeClientId,xt=t.beforeActiveInstanceBlur,mt=t.afterActiveInstanceBlur,G=t.preparePortalMount,I=t.supportsTestSelectors,J=t.findFiberRoot,pe=t.getBoundingRect,Te=t.getTextContent,ie=t.isHiddenSubtree,Ne=t.matchAccessibilityRole,Ie=t.setFocusIfFocusable,we=t.setupIntersectionObserver,be=t.appendChild,Ze=t.appendChildToContainer,q=t.commitTextUpdate,De=t.commitMount,Re=t.commitUpdate,We=t.insertBefore,ce=t.insertInContainerBefore,Ue=t.removeChild,lt=t.removeChildFromContainer,Lt=t.resetTextContent,Pn=t.hideInstance,kt=t.hideTextInstance,tr=t.unhideInstance,pr=t.unhideTextInstance,gi=t.clearContainer,zf=t.cloneInstance,Ws=t.createContainerChildSet,ma=t.appendChildToContainerChildSet,Nf=t.finalizeContainerChildren,ql=t.replaceContainerChildren,Xl=t.cloneHiddenInstance,z=t.cloneHiddenTextInstance,Q=t.canHydrateInstance,se=t.canHydrateTextInstance,te=t.isSuspenseInstancePending,fe=t.isSuspenseInstanceFallback,Qe=t.getNextHydratableSibling,tt=t.getFirstHydratableChild,ot=t.hydrateInstance,it=t.hydrateTextInstance,_t=t.getNextHydratableInstanceAfterSuspenseInstance,ut=t.commitHydratedContainer,dt=t.commitHydratedSuspenseInstance,It;function $n(l){if(It===void 0)try{throw Error()}catch(m){var c=m.stack.trim().match(/\n( *(at )?)/);It=c&&c[1]||""}return` 3022`+It+l}var Tr=!1;function ft(l,c){if(!l||Tr)return"";Tr=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(oe){var b=oe}Reflect.construct(l,[],c)}else{try{c.call()}catch(oe){b=oe}l.call(c.prototype)}else{try{throw Error()}catch(oe){b=oe}l()}}catch(oe){if(oe&&b&&typeof oe.stack=="string"){for(var S=oe.stack.split(` 3023`),P=b.stack.split(` 3024`),N=S.length-1,$=P.length-1;1<=N&&0<=$&&S[N]!==P[$];)$--;for(;1<=N&&0<=$;N--,$--)if(S[N]!==P[$]){if(N!==1||$!==1)do if(N--,$--,0>$||S[N]!==P[$])return` 3025`+S[N].replace(" at new "," at ");while(1<=N&&0<=$);break}}}finally{Tr=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?$n(l):""}var zn=[],Dt=-1;function an(l){return{current:l}}function bt(l){0>Dt||(l.current=zn[Dt],zn[Dt]=null,Dt--)}function gt(l,c){Dt++,zn[Dt]=l.current,l.current=c}var fn={},yt=an(fn),rn=an(!1),ln=fn;function $s(l,c){var m=l.type.contextTypes;if(!m)return fn;var b=l.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===c)return b.__reactInternalMemoizedMaskedChildContext;var S={},P;for(P in m)S[P]=c[P];return b&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=c,l.__reactInternalMemoizedMaskedChildContext=S),S}function Nn(l){return l=l.childContextTypes,l!=null}function Yl(){bt(rn),bt(yt)}function ig(l,c,m){if(yt.current!==fn)throw Error(a(168));gt(yt,c),gt(rn,m)}function sg(l,c,m){var b=l.stateNode;if(l=c.childContextTypes,typeof b.getChildContext!="function")return m;b=b.getChildContext();for(var S in b)if(!(S in l))throw Error(a(108,O(c)||"Unknown",S));return i({},m,b)}function Jl(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||fn,ln=yt.current,gt(yt,l),gt(rn,rn.current),!0}function og(l,c,m){var b=l.stateNode;if(!b)throw Error(a(169));m?(l=sg(l,c,ln),b.__reactInternalMemoizedMergedChildContext=l,bt(rn),bt(yt),gt(yt,l)):bt(rn),gt(rn,m)}var kf=null,Zi=null,O1=o.unstable_now;O1();var Zl=0,Ot=8;function Ki(l){if((1&l)!==0)return Ot=15,1;if((2&l)!==0)return Ot=14,2;if((4&l)!==0)return Ot=13,4;var c=24&l;return c!==0?(Ot=12,c):(l&32)!==0?(Ot=11,32):(c=192&l,c!==0?(Ot=10,c):(l&256)!==0?(Ot=9,256):(c=3584&l,c!==0?(Ot=8,c):(l&4096)!==0?(Ot=7,4096):(c=4186112&l,c!==0?(Ot=6,c):(c=62914560&l,c!==0?(Ot=5,c):l&67108864?(Ot=4,67108864):(l&134217728)!==0?(Ot=3,134217728):(c=805306368&l,c!==0?(Ot=2,c):(1073741824&l)!==0?(Ot=1,1073741824):(Ot=8,l))))))}function F1(l){switch(l){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function B1(l){switch(l){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(a(358,l))}}function ga(l,c){var m=l.pendingLanes;if(m===0)return Ot=0;var b=0,S=0,P=l.expiredLanes,N=l.suspendedLanes,$=l.pingedLanes;if(P!==0)b=P,S=Ot=15;else if(P=m&134217727,P!==0){var oe=P&~N;oe!==0?(b=Ki(oe),S=Ot):($&=P,$!==0&&(b=Ki($),S=Ot))}else P=m&~N,P!==0?(b=Ki(P),S=Ot):$!==0&&(b=Ki($),S=Ot);if(b===0)return 0;if(b=31-yi(b),b=m&((0>b?0:1<<b)<<1)-1,c!==0&&c!==b&&(c&N)===0){if(Ki(c),S<=Ot)return c;Ot=S}if(c=l.entangledLanes,c!==0)for(l=l.entanglements,c&=b;0<c;)m=31-yi(c),S=1<<m,b|=l[m],c&=~S;return b}function ag(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function Kl(l,c){switch(l){case 15:return 1;case 14:return 2;case 12:return l=js(24&~c),l===0?Kl(10,c):l;case 10:return l=js(192&~c),l===0?Kl(8,c):l;case 8:return l=js(3584&~c),l===0&&(l=js(4186112&~c),l===0&&(l=512)),l;case 2:return c=js(805306368&~c),c===0&&(c=268435456),c}throw Error(a(358,l))}function js(l){return l&-l}function Uf(l){for(var c=[],m=0;31>m;m++)c.push(l);return c}function Ql(l,c,m){l.pendingLanes|=c;var b=c-1;l.suspendedLanes&=b,l.pingedLanes&=b,l=l.eventTimes,c=31-yi(c),l[c]=m}var yi=Math.clz32?Math.clz32:k1,z1=Math.log,N1=Math.LN2;function k1(l){return l===0?32:31-(z1(l)/N1|0)|0}var U1=o.unstable_runWithPriority,Hf=o.unstable_scheduleCallback,Gf=o.unstable_cancelCallback,H1=o.unstable_shouldYield,lg=o.unstable_requestPaint,Vf=o.unstable_now,G1=o.unstable_getCurrentPriorityLevel,ec=o.unstable_ImmediatePriority,cg=o.unstable_UserBlockingPriority,ug=o.unstable_NormalPriority,fg=o.unstable_LowPriority,dg=o.unstable_IdlePriority,Wf={},V1=lg!==void 0?lg:function(){},Gr=null,tc=null,$f=!1,hg=Vf(),gn=1e4>hg?Vf:function(){return Vf()-hg};function qs(){switch(G1()){case ec:return 99;case cg:return 98;case ug:return 97;case fg:return 96;case dg:return 95;default:throw Error(a(332))}}function pg(l){switch(l){case 99:return ec;case 98:return cg;case 97:return ug;case 96:return fg;case 95:return dg;default:throw Error(a(332))}}function Vr(l,c){return l=pg(l),U1(l,c)}function ya(l,c,m){return l=pg(l),Hf(l,c,m)}function nr(){if(tc!==null){var l=tc;tc=null,Gf(l)}mg()}function mg(){if(!$f&&Gr!==null){$f=!0;var l=0;try{var c=Gr;Vr(99,function(){for(;l<c.length;l++){var m=c[l];do m=m(!0);while(m!==null)}}),Gr=null}catch(m){throw Gr!==null&&(Gr=Gr.slice(l+1)),Hf(ec,nr),m}finally{$f=!1}}}var W1=u.ReactCurrentBatchConfig;function $1(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var rr=typeof Object.is=="function"?Object.is:$1,j1=Object.prototype.hasOwnProperty;function nc(l,c){if(rr(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var m=Object.keys(l),b=Object.keys(c);if(m.length!==b.length)return!1;for(b=0;b<m.length;b++)if(!j1.call(c,m[b])||!rr(l[m[b]],c[m[b]]))return!1;return!0}function q1(l){switch(l.tag){case 5:return $n(l.type);case 16:return $n("Lazy");case 13:return $n("Suspense");case 19:return $n("SuspenseList");case 0:case 2:case 15:return l=ft(l.type,!1),l;case 11:return l=ft(l.type.render,!1),l;case 22:return l=ft(l.type._render,!1),l;case 1:return l=ft(l.type,!0),l;default:return""}}function mr(l,c){if(l&&l.defaultProps){c=i({},c),l=l.defaultProps;for(var m in l)c[m]===void 0&&(c[m]=l[m]);return c}return c}var rc=an(null),ic=null,Xs=null,sc=null;function jf(){sc=Xs=ic=null}function gg(l,c){l=l.type._context,me?(gt(rc,l._currentValue),l._currentValue=c):(gt(rc,l._currentValue2),l._currentValue2=c)}function qf(l){var c=rc.current;bt(rc),l=l.type._context,me?l._currentValue=c:l._currentValue2=c}function yg(l,c){for(;l!==null;){var m=l.alternate;if((l.childLanes&c)===c){if(m===null||(m.childLanes&c)===c)break;m.childLanes|=c}else l.childLanes|=c,m!==null&&(m.childLanes|=c);l=l.return}}function Ys(l,c){ic=l,sc=Xs=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&c)!==0&&(gr=!0),l.firstContext=null)}function ir(l,c){if(sc!==l&&c!==!1&&c!==0)if((typeof c!="number"||c===1073741823)&&(sc=l,c=1073741823),c={context:l,observedBits:c,next:null},Xs===null){if(ic===null)throw Error(a(308));Xs=c,ic.dependencies={lanes:0,firstContext:c,responders:null}}else Xs=Xs.next=c;return me?l._currentValue:l._currentValue2}var vi=!1;function Xf(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function vg(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function xi(l,c){return{eventTime:l,lane:c,tag:0,payload:null,callback:null,next:null}}function _i(l,c){if(l=l.updateQueue,l!==null){l=l.shared;var m=l.pending;m===null?c.next=c:(c.next=m.next,m.next=c),l.pending=c}}function xg(l,c){var m=l.updateQueue,b=l.alternate;if(b!==null&&(b=b.updateQueue,m===b)){var S=null,P=null;if(m=m.firstBaseUpdate,m!==null){do{var N={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};P===null?S=P=N:P=P.next=N,m=m.next}while(m!==null);P===null?S=P=c:P=P.next=c}else S=P=c;m={baseState:b.baseState,firstBaseUpdate:S,lastBaseUpdate:P,shared:b.shared,effects:b.effects},l.updateQueue=m;return}l=m.lastBaseUpdate,l===null?m.firstBaseUpdate=c:l.next=c,m.lastBaseUpdate=c}function va(l,c,m,b){var S=l.updateQueue;vi=!1;var P=S.firstBaseUpdate,N=S.lastBaseUpdate,$=S.shared.pending;if($!==null){S.shared.pending=null;var oe=$,_e=oe.next;oe.next=null,N===null?P=_e:N.next=_e,N=oe;var He=l.alternate;if(He!==null){He=He.updateQueue;var nt=He.lastBaseUpdate;nt!==N&&(nt===null?He.firstBaseUpdate=_e:nt.next=_e,He.lastBaseUpdate=oe)}}if(P!==null){nt=S.baseState,N=0,He=_e=oe=null;do{$=P.lane;var Pe=P.eventTime;if((b&$)===$){He!==null&&(He=He.next={eventTime:Pe,lane:0,tag:P.tag,payload:P.payload,callback:P.callback,next:null});e:{var At=l,Ut=P;switch($=c,Pe=m,Ut.tag){case 1:if(At=Ut.payload,typeof At=="function"){nt=At.call(Pe,nt,$);break e}nt=At;break e;case 3:At.flags=At.flags&-4097|64;case 0:if(At=Ut.payload,$=typeof At=="function"?At.call(Pe,nt,$):At,$==null)break e;nt=i({},nt,$);break e;case 2:vi=!0}}P.callback!==null&&(l.flags|=32,$=S.effects,$===null?S.effects=[P]:$.push(P))}else Pe={eventTime:Pe,lane:$,tag:P.tag,payload:P.payload,callback:P.callback,next:null},He===null?(_e=He=Pe,oe=nt):He=He.next=Pe,N|=$;if(P=P.next,P===null){if($=S.shared.pending,$===null)break;P=$.next,$.next=null,S.lastBaseUpdate=$,S.shared.pending=null}}while(1);He===null&&(oe=nt),S.baseState=oe,S.firstBaseUpdate=_e,S.lastBaseUpdate=He,Ia|=N,l.lanes=N,l.memoizedState=nt}}function _g(l,c,m){if(l=c.effects,c.effects=null,l!==null)for(c=0;c<l.length;c++){var b=l[c],S=b.callback;if(S!==null){if(b.callback=null,b=m,typeof S!="function")throw Error(a(191,S));S.call(b)}}}var bg=new s.Component().refs;function oc(l,c,m,b){c=l.memoizedState,m=m(b,c),m=m==null?c:i({},c,m),l.memoizedState=m,l.lanes===0&&(l.updateQueue.baseState=m)}var ac={isMounted:function(l){return(l=l._reactInternals)?H(l)===l:!1},enqueueSetState:function(l,c,m){l=l._reactInternals;var b=Hn(),S=Si(l),P=xi(b,S);P.payload=c,m!=null&&(P.callback=m),_i(l,P),Xr(l,S,b)},enqueueReplaceState:function(l,c,m){l=l._reactInternals;var b=Hn(),S=Si(l),P=xi(b,S);P.tag=1,P.payload=c,m!=null&&(P.callback=m),_i(l,P),Xr(l,S,b)},enqueueForceUpdate:function(l,c){l=l._reactInternals;var m=Hn(),b=Si(l),S=xi(m,b);S.tag=2,c!=null&&(S.callback=c),_i(l,S),Xr(l,b,m)}};function wg(l,c,m,b,S,P,N){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(b,P,N):c.prototype&&c.prototype.isPureReactComponent?!nc(m,b)||!nc(S,P):!0}function Sg(l,c,m){var b=!1,S=fn,P=c.contextType;return typeof P=="object"&&P!==null?P=ir(P):(S=Nn(c)?ln:yt.current,b=c.contextTypes,P=(b=b!=null)?$s(l,S):fn),c=new c(m,P),l.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=ac,l.stateNode=c,c._reactInternals=l,b&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=S,l.__reactInternalMemoizedMaskedChildContext=P),c}function Mg(l,c,m,b){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(m,b),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(m,b),c.state!==l&&ac.enqueueReplaceState(c,c.state,null)}function Yf(l,c,m,b){var S=l.stateNode;S.props=m,S.state=l.memoizedState,S.refs=bg,Xf(l);var P=c.contextType;typeof P=="object"&&P!==null?S.context=ir(P):(P=Nn(c)?ln:yt.current,S.context=$s(l,P)),va(l,m,S,b),S.state=l.memoizedState,P=c.getDerivedStateFromProps,typeof P=="function"&&(oc(l,c,P,m),S.state=l.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(c=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),c!==S.state&&ac.enqueueReplaceState(S,S.state,null),va(l,m,S,b),S.state=l.memoizedState),typeof S.componentDidMount=="function"&&(l.flags|=4)}var lc=Array.isArray;function xa(l,c,m){if(l=m.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(a(309));var b=m.stateNode}if(!b)throw Error(a(147,l));var S=""+l;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===S?c.ref:(c=function(P){var N=b.refs;N===bg&&(N=b.refs={}),P===null?delete N[S]:N[S]=P},c._stringRef=S,c)}if(typeof l!="string")throw Error(a(284));if(!m._owner)throw Error(a(290,l))}return l}function cc(l,c){if(l.type!=="textarea")throw Error(a(31,Object.prototype.toString.call(c)==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":c))}function Eg(l){function c(K,X){if(l){var ae=K.lastEffect;ae!==null?(ae.nextEffect=X,K.lastEffect=X):K.firstEffect=K.lastEffect=X,X.nextEffect=null,X.flags=8}}function m(K,X){if(!l)return null;for(;X!==null;)c(K,X),X=X.sibling;return null}function b(K,X){for(K=new Map;X!==null;)X.key!==null?K.set(X.key,X):K.set(X.index,X),X=X.sibling;return K}function S(K,X){return K=Ei(K,X),K.index=0,K.sibling=null,K}function P(K,X,ae){return K.index=ae,l?(ae=K.alternate,ae!==null?(ae=ae.index,ae<X?(K.flags=2,X):ae):(K.flags=2,X)):X}function N(K){return l&&K.alternate===null&&(K.flags=2),K}function $(K,X,ae,Ce){return X===null||X.tag!==6?(X=zd(ae,K.mode,Ce),X.return=K,X):(X=S(X,ae),X.return=K,X)}function oe(K,X,ae,Ce){return X!==null&&X.elementType===ae.type?(Ce=S(X,ae.props),Ce.ref=xa(K,X,ae),Ce.return=K,Ce):(Ce=zc(ae.type,ae.key,ae.props,null,K.mode,Ce),Ce.ref=xa(K,X,ae),Ce.return=K,Ce)}function _e(K,X,ae,Ce){return X===null||X.tag!==4||X.stateNode.containerInfo!==ae.containerInfo||X.stateNode.implementation!==ae.implementation?(X=Nd(ae,K.mode,Ce),X.return=K,X):(X=S(X,ae.children||[]),X.return=K,X)}function He(K,X,ae,Ce,Ge){return X===null||X.tag!==7?(X=ro(ae,K.mode,Ce,Ge),X.return=K,X):(X=S(X,ae),X.return=K,X)}function nt(K,X,ae){if(typeof X=="string"||typeof X=="number")return X=zd(""+X,K.mode,ae),X.return=K,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case f:return ae=zc(X.type,X.key,X.props,null,K.mode,ae),ae.ref=xa(K,null,X),ae.return=K,ae;case p:return X=Nd(X,K.mode,ae),X.return=K,X}if(lc(X)||T(X))return X=ro(X,K.mode,ae,null),X.return=K,X;cc(K,X)}return null}function Pe(K,X,ae,Ce){var Ge=X!==null?X.key:null;if(typeof ae=="string"||typeof ae=="number")return Ge!==null?null:$(K,X,""+ae,Ce);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case f:return ae.key===Ge?ae.type===h?He(K,X,ae.props.children,Ce,Ge):oe(K,X,ae,Ce):null;case p:return ae.key===Ge?_e(K,X,ae,Ce):null}if(lc(ae)||T(ae))return Ge!==null?null:He(K,X,ae,Ce,null);cc(K,ae)}return null}function At(K,X,ae,Ce,Ge){if(typeof Ce=="string"||typeof Ce=="number")return K=K.get(ae)||null,$(X,K,""+Ce,Ge);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case f:return K=K.get(Ce.key===null?ae:Ce.key)||null,Ce.type===h?He(X,K,Ce.props.children,Ge,Ce.key):oe(X,K,Ce,Ge);case p:return K=K.get(Ce.key===null?ae:Ce.key)||null,_e(X,K,Ce,Ge)}if(lc(Ce)||T(Ce))return K=K.get(ae)||null,He(X,K,Ce,Ge,null);cc(X,Ce)}return null}function Ut(K,X,ae,Ce){for(var Ge=null,Ft=null,rt=X,wt=X=0,sn=null;rt!==null&&wt<ae.length;wt++){rt.index>wt?(sn=rt,rt=null):sn=rt.sibling;var ht=Pe(K,rt,ae[wt],Ce);if(ht===null){rt===null&&(rt=sn);break}l&&rt&&ht.alternate===null&&c(K,rt),X=P(ht,X,wt),Ft===null?Ge=ht:Ft.sibling=ht,Ft=ht,rt=sn}if(wt===ae.length)return m(K,rt),Ge;if(rt===null){for(;wt<ae.length;wt++)rt=nt(K,ae[wt],Ce),rt!==null&&(X=P(rt,X,wt),Ft===null?Ge=rt:Ft.sibling=rt,Ft=rt);return Ge}for(rt=b(K,rt);wt<ae.length;wt++)sn=At(rt,K,wt,ae[wt],Ce),sn!==null&&(l&&sn.alternate!==null&&rt.delete(sn.key===null?wt:sn.key),X=P(sn,X,wt),Ft===null?Ge=sn:Ft.sibling=sn,Ft=sn);return l&&rt.forEach(function(Ti){return c(K,Ti)}),Ge}function lr(K,X,ae,Ce){var Ge=T(ae);if(typeof Ge!="function")throw Error(a(150));if(ae=Ge.call(ae),ae==null)throw Error(a(151));for(var Ft=Ge=null,rt=X,wt=X=0,sn=null,ht=ae.next();rt!==null&&!ht.done;wt++,ht=ae.next()){rt.index>wt?(sn=rt,rt=null):sn=rt.sibling;var Ti=Pe(K,rt,ht.value,Ce);if(Ti===null){rt===null&&(rt=sn);break}l&&rt&&Ti.alternate===null&&c(K,rt),X=P(Ti,X,wt),Ft===null?Ge=Ti:Ft.sibling=Ti,Ft=Ti,rt=sn}if(ht.done)return m(K,rt),Ge;if(rt===null){for(;!ht.done;wt++,ht=ae.next())ht=nt(K,ht.value,Ce),ht!==null&&(X=P(ht,X,wt),Ft===null?Ge=ht:Ft.sibling=ht,Ft=ht);return Ge}for(rt=b(K,rt);!ht.done;wt++,ht=ae.next())ht=At(rt,K,wt,ht.value,Ce),ht!==null&&(l&&ht.alternate!==null&&rt.delete(ht.key===null?wt:ht.key),X=P(ht,X,wt),Ft===null?Ge=ht:Ft.sibling=ht,Ft=ht);return l&&rt.forEach(function(wS){return c(K,wS)}),Ge}return function(K,X,ae,Ce){var Ge=typeof ae=="object"&&ae!==null&&ae.type===h&&ae.key===null;Ge&&(ae=ae.props.children);var Ft=typeof ae=="object"&&ae!==null;if(Ft)switch(ae.$$typeof){case f:e:{for(Ft=ae.key,Ge=X;Ge!==null;){if(Ge.key===Ft){switch(Ge.tag){case 7:if(ae.type===h){m(K,Ge.sibling),X=S(Ge,ae.props.children),X.return=K,K=X;break e}break;default:if(Ge.elementType===ae.type){m(K,Ge.sibling),X=S(Ge,ae.props),X.ref=xa(K,Ge,ae),X.return=K,K=X;break e}}m(K,Ge);break}else c(K,Ge);Ge=Ge.sibling}ae.type===h?(X=ro(ae.props.children,K.mode,Ce,ae.key),X.return=K,K=X):(Ce=zc(ae.type,ae.key,ae.props,null,K.mode,Ce),Ce.ref=xa(K,X,ae),Ce.return=K,K=Ce)}return N(K);case p:e:{for(Ge=ae.key;X!==null;){if(X.key===Ge)if(X.tag===4&&X.stateNode.containerInfo===ae.containerInfo&&X.stateNode.implementation===ae.implementation){m(K,X.sibling),X=S(X,ae.children||[]),X.return=K,K=X;break e}else{m(K,X);break}else c(K,X);X=X.sibling}X=Nd(ae,K.mode,Ce),X.return=K,K=X}return N(K)}if(typeof ae=="string"||typeof ae=="number")return ae=""+ae,X!==null&&X.tag===6?(m(K,X.sibling),X=S(X,ae),X.return=K,K=X):(m(K,X),X=zd(ae,K.mode,Ce),X.return=K,K=X),N(K);if(lc(ae))return Ut(K,X,ae,Ce);if(T(ae))return lr(K,X,ae,Ce);if(Ft&&cc(K,ae),typeof ae=="undefined"&&!Ge)switch(K.tag){case 1:case 22:case 0:case 11:case 15:throw Error(a(152,O(K.type)||"Component"))}return m(K,X)}}var uc=Eg(!0),Tg=Eg(!1),_a={},sr=an(_a),ba=an(_a),Js=an(_a);function Ar(l){if(l===_a)throw Error(a(174));return l}function Jf(l,c){gt(Js,c),gt(ba,l),gt(sr,_a),l=Y(c),bt(sr),gt(sr,l)}function Zs(){bt(sr),bt(ba),bt(Js)}function Ag(l){var c=Ar(Js.current),m=Ar(sr.current);c=ee(m,l.type,c),m!==c&&(gt(ba,l),gt(sr,c))}function Zf(l){ba.current===l&&(bt(sr),bt(ba))}var Wt=an(0);function fc(l){for(var c=l;c!==null;){if(c.tag===13){var m=c.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||te(m)||fe(m)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&64)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Wr=null,Qi=null,Rr=!1;function Rg(l,c){var m=ar(5,null,null,0);m.elementType="DELETED",m.type="DELETED",m.stateNode=c,m.return=l,m.flags=8,l.lastEffect!==null?(l.lastEffect.nextEffect=m,l.lastEffect=m):l.firstEffect=l.lastEffect=m}
3025function Cg(l,c){switch(l.tag){case 5:return c=Q(c,l.type,l.pendingProps),c!==null?(l.stateNode=c,!0):!1;case 6:return c=se(c,l.pendingProps),c!==null?(l.stateNode=c,!0):!1;case 13:return!1;default:return!1}}function Kf(l){if(Rr){var c=Qi;if(c){var m=c;if(!Cg(l,c)){if(c=Qe(m),!c||!Cg(l,c)){l.flags=l.flags&-1025|2,Rr=!1,Wr=l;return}Rg(Wr,m)}Wr=l,Qi=tt(c)}else l.flags=l.flags&-1025|2,Rr=!1,Wr=l}}function Pg(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Wr=l}function dc(l){if(!ve||l!==Wr)return!1;if(!Rr)return Pg(l),Rr=!0,!1;var c=l.type;if(l.tag!==5||c!=="head"&&c!=="body"&&!Be(c,l.memoizedProps))for(c=Qi;c;)Rg(l,c),c=Qe(c);if(Pg(l),l.tag===13){if(!ve)throw Error(a(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(a(317));Qi=_t(l)}else Qi=Wr?Qe(l.stateNode):null;return!0}function Qf(){ve&&(Qi=Wr=null,Rr=!1)}var Ks=[];function ed(){for(var l=0;l<Ks.length;l++){var c=Ks[l];me?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}Ks.length=0}var wa=u.ReactCurrentDispatcher,or=u.ReactCurrentBatchConfig,Sa=0,Xt=null,Mn=null,yn=null,hc=!1,Ma=!1;function kn(){throw Error(a(321))}
vendor: 17,560 bytes, line 3025
3025function td(l,c){if(c===null)return!1;for(var m=0;m<c.length&&m<l.length;m++)if(!rr(l[m],c[m]))return!1;return!0}function nd(l,c,m,b,S,P){if(Sa=P,Xt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,wa.current=l===null||l.memoizedState===null?Y1:J1,l=m(b,S),Ma){P=0;do{if(Ma=!1,!(25>P))throw Error(a(301));P+=1,yn=Mn=null,c.updateQueue=null,wa.current=Z1,l=m(b,S)}while(Ma)}if(wa.current=yc,c=Mn!==null&&Mn.next!==null,Sa=0,yn=Mn=Xt=null,hc=!1,c)throw Error(a(300));return l}function es(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yn===null?Xt.memoizedState=yn=l:yn=yn.next=l,yn}function ts(){if(Mn===null){var l=Xt.alternate;l=l!==null?l.memoizedState:null}else l=Mn.next;var c=yn===null?Xt.memoizedState:yn.next;if(c!==null)yn=c,Mn=l;else{if(l===null)throw Error(a(310));Mn=l,l={memoizedState:Mn.memoizedState,baseState:Mn.baseState,baseQueue:Mn.baseQueue,queue:Mn.queue,next:null},yn===null?Xt.memoizedState=yn=l:yn=yn.next=l}return yn}function Cr(l,c){return typeof c=="function"?c(l):c}function Ea(l){var c=ts(),m=c.queue;if(m===null)throw Error(a(311));m.lastRenderedReducer=l;var b=Mn,S=b.baseQueue,P=m.pending;if(P!==null){if(S!==null){var N=S.next;S.next=P.next,P.next=N}b.baseQueue=S=P,m.pending=null}if(S!==null){S=S.next,b=b.baseState;var $=N=P=null,oe=S;do{var _e=oe.lane;if((Sa&_e)===_e)$!==null&&($=$.next={lane:0,action:oe.action,eagerReducer:oe.eagerReducer,eagerState:oe.eagerState,next:null}),b=oe.eagerReducer===l?oe.eagerState:l(b,oe.action);else{var He={lane:_e,action:oe.action,eagerReducer:oe.eagerReducer,eagerState:oe.eagerState,next:null};$===null?(N=$=He,P=b):$=$.next=He,Xt.lanes|=_e,Ia|=_e}oe=oe.next}while(oe!==null&&oe!==S);$===null?P=b:$.next=N,rr(b,c.memoizedState)||(gr=!0),c.memoizedState=b,c.baseState=P,c.baseQueue=$,m.lastRenderedState=b}return[c.memoizedState,m.dispatch]}function Ta(l){var c=ts(),m=c.queue;if(m===null)throw Error(a(311));m.lastRenderedReducer=l;var b=m.dispatch,S=m.pending,P=c.memoizedState;if(S!==null){m.pending=null;var N=S=S.next;do P=l(P,N.action),N=N.next;while(N!==S);rr(P,c.memoizedState)||(gr=!0),c.memoizedState=P,c.baseQueue===null&&(c.baseState=P),m.lastRenderedState=P}return[P,b]}function Lg(l,c,m){var b=c._getVersion;b=b(c._source);var S=me?c._workInProgressVersionPrimary:c._workInProgressVersionSecondary;if(S!==null?l=S===b:(l=l.mutableReadLanes,(l=(Sa&l)===l)&&(me?c._workInProgressVersionPrimary=b:c._workInProgressVersionSecondary=b,Ks.push(c))),l)return m(c._source);throw Ks.push(c),Error(a(350))}function Ig(l,c,m,b){var S=Ln;if(S===null)throw Error(a(349));var P=c._getVersion,N=P(c._source),$=wa.current,oe=$.useState(function(){return Lg(S,c,m)}),_e=oe[1],He=oe[0];oe=yn;var nt=l.memoizedState,Pe=nt.refs,At=Pe.getSnapshot,Ut=nt.source;nt=nt.subscribe;var lr=Xt;return l.memoizedState={refs:Pe,source:c,subscribe:b},$.useEffect(function(){Pe.getSnapshot=m,Pe.setSnapshot=_e;var K=P(c._source);if(!rr(N,K)){K=m(c._source),rr(He,K)||(_e(K),K=Si(lr),S.mutableReadLanes|=K&S.pendingLanes),K=S.mutableReadLanes,S.entangledLanes|=K;for(var X=S.entanglements,ae=K;0<ae;){var Ce=31-yi(ae),Ge=1<<Ce;X[Ce]|=K,ae&=~Ge}}},[m,c,b]),$.useEffect(function(){return b(c._source,function(){var K=Pe.getSnapshot,X=Pe.setSnapshot;try{X(K(c._source));var ae=Si(lr);S.mutableReadLanes|=ae&S.pendingLanes}catch(Ce){X(function(){throw Ce})}})},[c,b]),rr(At,m)&&rr(Ut,c)&&rr(nt,b)||(l={pending:null,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:He},l.dispatch=_e=od.bind(null,Xt,l),oe.queue=l,oe.baseQueue=null,He=Lg(S,c,m),oe.memoizedState=oe.baseState=He),He}function Dg(l,c,m){var b=ts();return Ig(b,l,c,m)}function Aa(l){var c=es();return typeof l=="function"&&(l=l()),c.memoizedState=c.baseState=l,l=c.queue={pending:null,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:l},l=l.dispatch=od.bind(null,Xt,l),[c.memoizedState,l]}function pc(l,c,m,b){return l={tag:l,create:c,destroy:m,deps:b,next:null},c=Xt.updateQueue,c===null?(c={lastEffect:null},Xt.updateQueue=c,c.lastEffect=l.next=l):(m=c.lastEffect,m===null?c.lastEffect=l.next=l:(b=m.next,m.next=l,l.next=b,c.lastEffect=l)),l}function Og(l){var c=es();return l={current:l},c.memoizedState=l}function mc(){return ts().memoizedState}function rd(l,c,m,b){var S=es();Xt.flags|=l,S.memoizedState=pc(1|c,m,void 0,b===void 0?null:b)}function id(l,c,m,b){var S=ts();b=b===void 0?null:b;var P=void 0;if(Mn!==null){var N=Mn.memoizedState;if(P=N.destroy,b!==null&&td(b,N.deps)){pc(c,m,P,b);return}}Xt.flags|=l,S.memoizedState=pc(1|c,m,P,b)}function Fg(l,c){return rd(516,4,l,c)}function gc(l,c){return id(516,4,l,c)}function Bg(l,c){return id(4,2,l,c)}function zg(l,c){if(typeof c=="function")return l=l(),c(l),function(){c(null)};if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function Ng(l,c,m){return m=m!=null?m.concat([l]):null,id(4,2,zg.bind(null,c,l),m)}function sd(){}function kg(l,c){var m=ts();c=c===void 0?null:c;var b=m.memoizedState;return b!==null&&c!==null&&td(c,b[1])?b[0]:(m.memoizedState=[l,c],l)}function Ug(l,c){var m=ts();c=c===void 0?null:c;var b=m.memoizedState;return b!==null&&c!==null&&td(c,b[1])?b[0]:(l=l(),m.memoizedState=[l,c],l)}function X1(l,c){var m=qs();Vr(98>m?98:m,function(){l(!0)}),Vr(97<m?97:m,function(){var b=or.transition;or.transition=1;try{l(!1),c()}finally{or.transition=b}})}function od(l,c,m){var b=Hn(),S=Si(l),P={lane:S,action:m,eagerReducer:null,eagerState:null,next:null},N=c.pending;if(N===null?P.next=P:(P.next=N.next,N.next=P),c.pending=P,N=l.alternate,l===Xt||N!==null&&N===Xt)Ma=hc=!0;else{if(l.lanes===0&&(N===null||N.lanes===0)&&(N=c.lastRenderedReducer,N!==null))try{var $=c.lastRenderedState,oe=N($,m);if(P.eagerReducer=N,P.eagerState=oe,rr(oe,$))return}catch{}finally{}Xr(l,S,b)}}var yc={readContext:ir,useCallback:kn,useContext:kn,useEffect:kn,useImperativeHandle:kn,useLayoutEffect:kn,useMemo:kn,useReducer:kn,useRef:kn,useState:kn,useDebugValue:kn,useDeferredValue:kn,useTransition:kn,useMutableSource:kn,useOpaqueIdentifier:kn,unstable_isNewReconciler:!1},Y1={readContext:ir,useCallback:function(l,c){return es().memoizedState=[l,c===void 0?null:c],l},useContext:ir,useEffect:Fg,useImperativeHandle:function(l,c,m){return m=m!=null?m.concat([l]):null,rd(4,2,zg.bind(null,c,l),m)},useLayoutEffect:function(l,c){return rd(4,2,l,c)},useMemo:function(l,c){var m=es();return c=c===void 0?null:c,l=l(),m.memoizedState=[l,c],l},useReducer:function(l,c,m){var b=es();return c=m!==void 0?m(c):c,b.memoizedState=b.baseState=c,l=b.queue={pending:null,dispatch:null,lastRenderedReducer:l,lastRenderedState:c},l=l.dispatch=od.bind(null,Xt,l),[b.memoizedState,l]},useRef:Og,useState:Aa,useDebugValue:sd,useDeferredValue:function(l){var c=Aa(l),m=c[0],b=c[1];return Fg(function(){var S=or.transition;or.transition=1;try{b(l)}finally{or.transition=S}},[l]),m},useTransition:function(){var l=Aa(!1),c=l[0];return l=X1.bind(null,l[1]),Og(l),[l,c]},useMutableSource:function(l,c,m){var b=es();return b.memoizedState={refs:{getSnapshot:c,setSnapshot:null},source:l,subscribe:m},Ig(b,l,c,m)},useOpaqueIdentifier:function(){if(Rr){var l=!1,c=Ye(function(){throw l||(l=!0,m(st())),Error(a(355))}),m=Aa(c)[1];return(Xt.mode&2)===0&&(Xt.flags|=516,pc(5,function(){m(st())},void 0,null)),c}return c=st(),Aa(c),c},unstable_isNewReconciler:!1},J1={readContext:ir,useCallback:kg,useContext:ir,useEffect:gc,useImperativeHandle:Ng,useLayoutEffect:Bg,useMemo:Ug,useReducer:Ea,useRef:mc,useState:function(){return Ea(Cr)},useDebugValue:sd,useDeferredValue:function(l){var c=Ea(Cr),m=c[0],b=c[1];return gc(function(){var S=or.transition;or.transition=1;try{b(l)}finally{or.transition=S}},[l]),m},useTransition:function(){var l=Ea(Cr)[0];return[mc().current,l]},useMutableSource:Dg,useOpaqueIdentifier:function(){return Ea(Cr)[0]},unstable_isNewReconciler:!1},Z1={readContext:ir,useCallback:kg,useContext:ir,useEffect:gc,useImperativeHandle:Ng,useLayoutEffect:Bg,useMemo:Ug,useReducer:Ta,useRef:mc,useState:function(){return Ta(Cr)},useDebugValue:sd,useDeferredValue:function(l){var c=Ta(Cr),m=c[0],b=c[1];return gc(function(){var S=or.transition;or.transition=1;try{b(l)}finally{or.transition=S}},[l]),m},useTransition:function(){var l=Ta(Cr)[0];return[mc().current,l]},useMutableSource:Dg,useOpaqueIdentifier:function(){return Ta(Cr)[0]},unstable_isNewReconciler:!1},K1=u.ReactCurrentOwner,gr=!1;function Un(l,c,m,b){c.child=l===null?Tg(c,null,m,b):uc(c,l.child,m,b)}function Hg(l,c,m,b,S){m=m.render;var P=c.ref;return Ys(c,S),b=nd(l,c,m,b,P,S),l!==null&&!gr?(c.updateQueue=l.updateQueue,c.flags&=-517,l.lanes&=~S,$r(l,c,S)):(c.flags|=1,Un(l,c,b,S),c.child)}function Gg(l,c,m,b,S,P){if(l===null){var N=m.type;return typeof N=="function"&&!Fd(N)&&N.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(c.tag=15,c.type=N,Vg(l,c,N,b,S,P)):(l=zc(m.type,null,b,c,c.mode,P),l.ref=c.ref,l.return=c,c.child=l)}return N=l.child,(S&P)===0&&(S=N.memoizedProps,m=m.compare,m=m!==null?m:nc,m(S,b)&&l.ref===c.ref)?$r(l,c,P):(c.flags|=1,l=Ei(N,b),l.ref=c.ref,l.return=c,c.child=l)}function Vg(l,c,m,b,S,P){if(l!==null&&nc(l.memoizedProps,b)&&l.ref===c.ref)if(gr=!1,(P&S)!==0)(l.flags&16384)!==0&&(gr=!0);else return c.lanes=l.lanes,$r(l,c,P);return ld(l,c,m,b,P)}function ad(l,c,m){var b=c.pendingProps,S=b.children,P=l!==null?l.memoizedState:null;if(b.mode==="hidden"||b.mode==="unstable-defer-without-hiding")if((c.mode&4)===0)c.memoizedState={baseLanes:0},Oc(c,m);else if((m&1073741824)!==0)c.memoizedState={baseLanes:0},Oc(c,P!==null?P.baseLanes:m);else return l=P!==null?P.baseLanes|m:m,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:l},Oc(c,l),null;else P!==null?(b=P.baseLanes|m,c.memoizedState=null):b=m,Oc(c,b);return Un(l,c,S,m),c.child}function Wg(l,c){var m=c.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(c.flags|=128)}function ld(l,c,m,b,S){var P=Nn(m)?ln:yt.current;return P=$s(c,P),Ys(c,S),m=nd(l,c,m,b,P,S),l!==null&&!gr?(c.updateQueue=l.updateQueue,c.flags&=-517,l.lanes&=~S,$r(l,c,S)):(c.flags|=1,Un(l,c,m,S),c.child)}function $g(l,c,m,b,S){if(Nn(m)){var P=!0;Jl(c)}else P=!1;if(Ys(c,S),c.stateNode===null)l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2),Sg(c,m,b),Yf(c,m,b,S),b=!0;else if(l===null){var N=c.stateNode,$=c.memoizedProps;N.props=$;var oe=N.context,_e=m.contextType;typeof _e=="object"&&_e!==null?_e=ir(_e):(_e=Nn(m)?ln:yt.current,_e=$s(c,_e));var He=m.getDerivedStateFromProps,nt=typeof He=="function"||typeof N.getSnapshotBeforeUpdate=="function";nt||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||($!==b||oe!==_e)&&Mg(c,N,b,_e),vi=!1;var Pe=c.memoizedState;N.state=Pe,va(c,b,N,S),oe=c.memoizedState,$!==b||Pe!==oe||rn.current||vi?(typeof He=="function"&&(oc(c,m,He,b),oe=c.memoizedState),($=vi||wg(c,m,$,b,Pe,oe,_e))?(nt||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(c.flags|=4)):(typeof N.componentDidMount=="function"&&(c.flags|=4),c.memoizedProps=b,c.memoizedState=oe),N.props=b,N.state=oe,N.context=_e,b=$):(typeof N.componentDidMount=="function"&&(c.flags|=4),b=!1)}else{N=c.stateNode,vg(l,c),$=c.memoizedProps,_e=c.type===c.elementType?$:mr(c.type,$),N.props=_e,nt=c.pendingProps,Pe=N.context,oe=m.contextType,typeof oe=="object"&&oe!==null?oe=ir(oe):(oe=Nn(m)?ln:yt.current,oe=$s(c,oe));var At=m.getDerivedStateFromProps;(He=typeof At=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||($!==nt||Pe!==oe)&&Mg(c,N,b,oe),vi=!1,Pe=c.memoizedState,N.state=Pe,va(c,b,N,S);var Ut=c.memoizedState;$!==nt||Pe!==Ut||rn.current||vi?(typeof At=="function"&&(oc(c,m,At,b),Ut=c.memoizedState),(_e=vi||wg(c,m,_e,b,Pe,Ut,oe))?(He||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(b,Ut,oe),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(b,Ut,oe)),typeof N.componentDidUpdate=="function"&&(c.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(c.flags|=256)):(typeof N.componentDidUpdate!="function"||$===l.memoizedProps&&Pe===l.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||$===l.memoizedProps&&Pe===l.memoizedState||(c.flags|=256),c.memoizedProps=b,c.memoizedState=Ut),N.props=b,N.state=Ut,N.context=oe,b=_e):(typeof N.componentDidUpdate!="function"||$===l.memoizedProps&&Pe===l.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||$===l.memoizedProps&&Pe===l.memoizedState||(c.flags|=256),b=!1)}return cd(l,c,m,b,P,S)}function cd(l,c,m,b,S,P){Wg(l,c);var N=(c.flags&64)!==0;if(!b&&!N)return S&&og(c,m,!1),$r(l,c,P);b=c.stateNode,K1.current=c;var $=N&&typeof m.getDerivedStateFromError!="function"?null:b.render();return c.flags|=1,l!==null&&N?(c.child=uc(c,l.child,null,P),c.child=uc(c,null,$,P)):Un(l,c,$,P),c.memoizedState=b.state,S&&og(c,m,!0),c.child}function jg(l){var c=l.stateNode;c.pendingContext?ig(l,c.pendingContext,c.pendingContext!==c.context):c.context&&ig(l,c.context,!1),Jf(l,c.containerInfo)}var vc={dehydrated:null,retryLane:0};function qg(l,c,m){var b=c.pendingProps,S=Wt.current,P=!1,N;return(N=(c.flags&64)!==0)||(N=l!==null&&l.memoizedState===null?!1:(S&2)!==0),N?(P=!0,c.flags&=-65):l!==null&&l.memoizedState===null||b.fallback===void 0||b.unstable_avoidThisFallback===!0||(S|=1),gt(Wt,S&1),l===null?(b.fallback!==void 0&&Kf(c),l=b.children,S=b.fallback,P?(l=Xg(c,l,S,m),c.child.memoizedState={baseLanes:m},c.memoizedState=vc,l):typeof b.unstable_expectedLoadTime=="number"?(l=Xg(c,l,S,m),c.child.memoizedState={baseLanes:m},c.memoizedState=vc,c.lanes=33554432,l):(m=Bd({mode:"visible",children:l},c.mode,m,null),m.return=c,c.child=m)):l.memoizedState!==null?P?(b=Jg(l,c,b.children,b.fallback,m),P=c.child,S=l.child.memoizedState,P.memoizedState=S===null?{baseLanes:m}:{baseLanes:S.baseLanes|m},P.childLanes=l.childLanes&~m,c.memoizedState=vc,b):(m=Yg(l,c,b.children,m),c.memoizedState=null,m):P?(b=Jg(l,c,b.children,b.fallback,m),P=c.child,S=l.child.memoizedState,P.memoizedState=S===null?{baseLanes:m}:{baseLanes:S.baseLanes|m},P.childLanes=l.childLanes&~m,c.memoizedState=vc,b):(m=Yg(l,c,b.children,m),c.memoizedState=null,m)}function Xg(l,c,m,b){var S=l.mode,P=l.child;return c={mode:"hidden",children:c},(S&2)===0&&P!==null?(P.childLanes=0,P.pendingProps=c):P=Bd(c,S,0,null),m=ro(m,S,b,null),P.return=l,m.return=l,P.sibling=m,l.child=P,m}function Yg(l,c,m,b){var S=l.child;return l=S.sibling,m=Ei(S,{mode:"visible",children:m}),(c.mode&2)===0&&(m.lanes=b),m.return=c,m.sibling=null,l!==null&&(l.nextEffect=null,l.flags=8,c.firstEffect=c.lastEffect=l),c.child=m}function Jg(l,c,m,b,S){var P=c.mode,N=l.child;l=N.sibling;var $={mode:"hidden",children:m};return(P&2)===0&&c.child!==N?(m=c.child,m.childLanes=0,m.pendingProps=$,N=m.lastEffect,N!==null?(c.firstEffect=m.firstEffect,c.lastEffect=N,N.nextEffect=null):c.firstEffect=c.lastEffect=null):m=Ei(N,$),l!==null?b=Ei(l,b):(b=ro(b,P,S,null),b.flags|=2),b.return=c,m.return=c,m.sibling=b,c.child=m,b}function Zg(l,c){l.lanes|=c;var m=l.alternate;m!==null&&(m.lanes|=c),yg(l.return,c)}function ud(l,c,m,b,S,P){var N=l.memoizedState;N===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:b,tail:m,tailMode:S,lastEffect:P}:(N.isBackwards=c,N.rendering=null,N.renderingStartTime=0,N.last=b,N.tail=m,N.tailMode=S,N.lastEffect=P)}function Kg(l,c,m){var b=c.pendingProps,S=b.revealOrder,P=b.tail;if(Un(l,c,b.children,m),b=Wt.current,(b&2)!==0)b=b&1|2,c.flags|=64;else{if(l!==null&&(l.flags&64)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Zg(l,m);else if(l.tag===19)Zg(l,m);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}b&=1}if(gt(Wt,b),(c.mode&2)===0)c.memoizedState=null;else switch(S){case"forwards":for(m=c.child,S=null;m!==null;)l=m.alternate,l!==null&&fc(l)===null&&(S=m),m=m.sibling;m=S,m===null?(S=c.child,c.child=null):(S=m.sibling,m.sibling=null),ud(c,!1,S,m,P,c.lastEffect);break;case"backwards":for(m=null,S=c.child,c.child=null;S!==null;){if(l=S.alternate,l!==null&&fc(l)===null){c.child=S;break}l=S.sibling,S.sibling=m,m=S,S=l}ud(c,!0,m,null,P,c.lastEffect);break;case"together":ud(c,!1,null,null,void 0,c.lastEffect);break;default:c.memoizedState=null}return c.child}function $r(l,c,m){if(l!==null&&(c.dependencies=l.dependencies),Ia|=c.lanes,(m&c.childLanes)!==0){if(l!==null&&c.child!==l.child)throw Error(a(153));if(c.child!==null){for(l=c.child,m=Ei(l,l.pendingProps),c.child=m,m.return=c;l.sibling!==null;)l=l.sibling,m=m.sibling=Ei(l,l.pendingProps),m.return=c;m.sibling=null}return c.child}return null}function Pr(l){l.flags|=4}var Ra,Ca,xc,_c;if(he)Ra=function(l,c){for(var m=c.child;m!==null;){if(m.tag===5||m.tag===6)re(l,m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===c)break;for(;m.sibling===null;){if(m.return===null||m.return===c)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},Ca=function(){},xc=function(l,c,m,b,S){if(l=l.memoizedProps,l!==b){var P=c.stateNode,N=Ar(sr.current);m=Le(P,m,l,b,S,N),(c.updateQueue=m)&&Pr(c)}},_c=function(l,c,m,b){m!==b&&Pr(c)};else if(Ee){Ra=function(l,c,m,b){for(var S=c.child;S!==null;){if(S.tag===5){var P=S.stateNode;
3025m&&b&&(P=Xl(P,S.type,S.memoizedProps,S)),re(l,P)}else if(S.tag===6)P=S.stateNode,m&&b&&(P=z(P,S.memoizedProps,S)),re(l,P);else if(S.tag!==4){if(S.tag===13&&(S.flags&4)!==0&&(P=S.memoizedState!==null)){var N=S.child;if(N!==null&&(N.child!==null&&(N.child.return=N,Ra(l,N,!0,P)),P=N.sibling,P!==null)){P.return=S,S=P;continue}}if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===c)break;for(;S.sibling===null;){if(S.return===null||S.return===c)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};var Qg=function(l,c,m,b){for(var S=c.child;S!==null;){if(S.tag===5){var P=S.stateNode;m&&b&&(P=Xl(P,S.type,S.memoizedProps,S)),ma(l,P)}else if(S.tag===6)P=S.stateNode,m&&b&&(P=z(P,S.memoizedProps,S)),ma(l,P);else if(S.tag!==4){if(S.tag===13&&(S.flags&4)!==0&&(P=S.memoizedState!==null)){var N=S.child;if(N!==null&&(N.child!==null&&(N.child.return=N,Qg(l,N,!0,P)),P=N.sibling,P!==null)){P.return=S,S=P;continue}}if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===c)break;for(;S.sibling===null;){if(S.return===null||S.return===c)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};Ca=function(l){var c=l.stateNode;if(l.firstEffect!==null){var m=c.containerInfo,b=Ws(m);Qg(b,l,!1,!1),c.pendingChildren=b,Pr(l),Nf(m,b)}},xc=function(l,c,m,b,S){var P=l.stateNode,N=l.memoizedProps;if((l=c.firstEffect===null)&&N===b)c.stateNode=P;else{var $=c.stateNode,oe=Ar(sr.current),_e=null;N!==b&&(_e=Le($,m,N,b,S,oe)),l&&_e===null?c.stateNode=P:(P=zf(P,_e,m,N,b,c,l,$),Xe(P,m,b,S,oe)&&Pr(c),c.stateNode=P,l?Pr(c):Ra(P,c,!1,!1))}},_c=function(l,c,m,b){m!==b?(l=Ar(Js.current),m=Ar(sr.current),c.stateNode=Me(b,l,m,c),Pr(c)):c.stateNode=l.stateNode}}else Ca=function(){},xc=function(){},_c=function(){};function Pa(l,c){if(!Rr)switch(l.tailMode){case"hidden":c=l.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?l.tail=null:m.sibling=null;break;case"collapsed":m=l.tail;for(var b=null;m!==null;)m.alternate!==null&&(b=m),m=m.sibling;b===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:b.sibling=null}}function Q1(l,c,m){var b=c.pendingProps;switch(c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return Nn(c.type)&&Yl(),null;case 3:return Zs(),bt(rn),bt(yt),ed(),b=c.stateNode,b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),(l===null||l.child===null)&&(dc(c)?Pr(c):b.hydrate||(c.flags|=256)),Ca(c),null;case 5:Zf(c);var S=Ar(Js.current);if(m=c.type,l!==null&&c.stateNode!=null)xc(l,c,m,b,S),l.ref!==c.ref&&(c.flags|=128);else{if(!b){if(c.stateNode===null)throw Error(a(166));return null}if(l=Ar(sr.current),dc(c)){if(!ve)throw Error(a(175));l=ot(c.stateNode,c.type,c.memoizedProps,S,l,c),c.updateQueue=l,l!==null&&Pr(c)}else{var P=xe(m,b,S,l,c);Ra(P,c,!1,!1),c.stateNode=P,Xe(P,m,b,S,l)&&Pr(c)}c.ref!==null&&(c.flags|=128)}return null;case 6:if(l&&c.stateNode!=null)_c(l,c,l.memoizedProps,b);else{if(typeof b!="string"&&c.stateNode===null)throw Error(a(166));if(l=Ar(Js.current),S=Ar(sr.current),dc(c)){if(!ve)throw Error(a(176));it(c.stateNode,c.memoizedProps,c)&&Pr(c)}else c.stateNode=Me(b,l,S,c)}return null;case 13:return bt(Wt),b=c.memoizedState,(c.flags&64)!==0?(c.lanes=m,c):(b=b!==null,S=!1,l===null?c.memoizedProps.fallback!==void 0&&dc(c):S=l.memoizedState!==null,b&&!S&&(c.mode&2)!==0&&(l===null&&c.memoizedProps.unstable_avoidThisFallback!==!0||(Wt.current&1)!==0?vn===0&&(vn=3):((vn===0||vn===3)&&(vn=4),Ln===null||(Ia&134217727)===0&&(eo&134217727)===0||to(Ln,En))),Ee&&b&&(c.flags|=4),he&&(b||S)&&(c.flags|=4),null);case 4:return Zs(),Ca(c),l===null&&G(c.stateNode.containerInfo),null;case 10:return qf(c),null;case 17:return Nn(c.type)&&Yl(),null;
vendor: 4,899 bytes, lines 3025-3027
3025case 19:if(bt(Wt),b=c.memoizedState,b===null)return null;if(S=(c.flags&64)!==0,P=b.rendering,P===null)if(S)Pa(b,!1);else{if(vn!==0||l!==null&&(l.flags&64)!==0)for(l=c.child;l!==null;){if(P=fc(l),P!==null){for(c.flags|=64,Pa(b,!1),l=P.updateQueue,l!==null&&(c.updateQueue=l,c.flags|=4),b.lastEffect===null&&(c.firstEffect=null),c.lastEffect=b.lastEffect,l=m,b=c.child;b!==null;)S=b,m=l,S.flags&=2,S.nextEffect=null,S.firstEffect=null,S.lastEffect=null,P=S.alternate,P===null?(S.childLanes=0,S.lanes=m,S.child=null,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null):(S.childLanes=P.childLanes,S.lanes=P.lanes,S.child=P.child,S.memoizedProps=P.memoizedProps,S.memoizedState=P.memoizedState,S.updateQueue=P.updateQueue,S.type=P.type,m=P.dependencies,S.dependencies=m===null?null:{lanes:m.lanes,firstContext:m.firstContext}),b=b.sibling;return gt(Wt,Wt.current&1|2),c.child}l=l.sibling}b.tail!==null&&gn()>Td&&(c.flags|=64,S=!0,Pa(b,!1),c.lanes=33554432)}else{if(!S)if(l=fc(P),l!==null){if(c.flags|=64,S=!0,l=l.updateQueue,l!==null&&(c.updateQueue=l,c.flags|=4),Pa(b,!0),b.tail===null&&b.tailMode==="hidden"&&!P.alternate&&!Rr)return c=c.lastEffect=b.lastEffect,c!==null&&(c.nextEffect=null),null}else 2*gn()-b.renderingStartTime>Td&&m!==1073741824&&(c.flags|=64,S=!0,Pa(b,!1),c.lanes=33554432);b.isBackwards?(P.sibling=c.child,c.child=P):(l=b.last,l!==null?l.sibling=P:c.child=P,b.last=P)}return b.tail!==null?(l=b.tail,b.rendering=l,b.tail=l.sibling,b.lastEffect=c.lastEffect,b.renderingStartTime=gn(),l.sibling=null,c=Wt.current,gt(Wt,S?c&1|2:c&1),l):null;case 23:case 24:return Id(),l!==null&&l.memoizedState!==null!=(c.memoizedState!==null)&&b.mode!=="unstable-defer-without-hiding"&&(c.flags|=4),null}throw Error(a(156,c.tag))}function eS(l){switch(l.tag){case 1:Nn(l.type)&&Yl();var c=l.flags;return c&4096?(l.flags=c&-4097|64,l):null;case 3:if(Zs(),bt(rn),bt(yt),ed(),c=l.flags,(c&64)!==0)throw Error(a(285));return l.flags=c&-4097|64,l;case 5:return Zf(l),null;case 13:return bt(Wt),c=l.flags,c&4096?(l.flags=c&-4097|64,l):null;case 19:return bt(Wt),null;case 4:return Zs(),null;case 10:return qf(l),null;case 23:case 24:return Id(),null;default:return null}}function fd(l,c){try{var m="",b=c;do m+=q1(b),b=b.return;while(b);var S=m}catch(P){S=` 3026Error generating stack: `+P.message+` 3027`+P.stack}return{value:l,source:c,stack:S}}function dd(l,c){try{console.error(c.value)}catch(m){setTimeout(function(){throw m})}}var tS=typeof WeakMap=="function"?WeakMap:Map;function e0(l,c,m){m=xi(-1,m),m.tag=3,m.payload={element:null};var b=c.value;return m.callback=function(){Pc||(Pc=!0,Ad=b),dd(l,c)},m}function t0(l,c,m){m=xi(-1,m),m.tag=3;var b=l.type.getDerivedStateFromError;if(typeof b=="function"){var S=c.value;m.payload=function(){return dd(l,c),b(S)}}var P=l.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(m.callback=function(){typeof b!="function"&&(Lr===null?Lr=new Set([this]):Lr.add(this),dd(l,c));var N=c.stack;this.componentDidCatch(c.value,{componentStack:N!==null?N:""})}),m}var nS=typeof WeakSet=="function"?WeakSet:Set;function n0(l){var c=l.ref;if(c!==null)if(typeof c=="function")try{c(null)}catch(m){Mi(l,m)}else c.current=null}function rS(l,c){switch(c.tag){case 0:case 11:case 15:case 22:return;case 1:if(c.flags&256&&l!==null){var m=l.memoizedProps,b=l.memoizedState;l=c.stateNode,c=l.getSnapshotBeforeUpdate(c.elementType===c.type?m:mr(c.type,m),b),l.__reactInternalSnapshotBeforeUpdate=c}return;case 3:he&&c.flags&256&&gi(c.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(a(163))}function r0(l,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var m=c=c.next;do{if((m.tag&l)===l){var b=m.destroy;m.destroy=void 0,b!==void 0&&b()}m=m.next}while(m!==c)}}function iS(l,c,m){switch(m.tag){case 0:case 11:case 15:case 22:if(c=m.updateQueue,c=c!==null?c.lastEffect:null,c!==null){l=c=c.next;do{if((l.tag&3)===3){var b=l.create;l.destroy=b()}l=l.next}while(l!==c)}if(c=m.updateQueue,c=c!==null?c.lastEffect:null,c!==null){l=c=c.next;do{var S=l;b=S.next,S=S.tag,(S&4)!==0&&(S&1)!==0&&(_0(m,l),hS(m,l)),l=b}while(l!==c)}return;case 1:l=m.stateNode,m.flags&4&&(c===null?l.componentDidMount():(b=m.elementType===m.type?c.memoizedProps:mr(m.type,c.memoizedProps),l.componentDidUpdate(b,c.memoizedState,l.__reactInternalSnapshotBeforeUpdate))),c=m.updateQueue,c!==null&&_g(m,c,l);return;case 3:if(c=m.updateQueue,c!==null){if(l=null,m.child!==null)switch(m.child.tag){case 5:l=ge(m.child.stateNode);break;case 1:l=m.child.stateNode}_g(m,c,l)}return;case 5:l=m.stateNode,c===null&&m.flags&4&&De(l,m.type,m.memoizedProps,m);return;case 6:return;case 4:return;case 12:return;case 13:ve&&m.memoizedState===null&&(m=m.alternate,m!==null&&(m=m.memoizedState,m!==null&&(m=m.dehydrated,m!==null&&dt(m))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(a(163))}
3027function i0(l,c){if(he)for(var m=l;;){if(m.tag===5){var b=m.stateNode;c?Pn(b):tr(m.stateNode,m.memoizedProps)}else if(m.tag===6)b=m.stateNode,c?kt(b):pr(b,m.memoizedProps);else if((m.tag!==23&&m.tag!==24||m.memoizedState===null||m===l)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===l)break;for(;m.sibling===null;){if(m.return===null||m.return===l)return;m=m.return}m.sibling.return=m.return,m=m.sibling}}function s0(l,c){if(Zi&&typeof Zi.onCommitFiberUnmount=="function")try{Zi.onCommitFiberUnmount(kf,c)}catch{}switch(c.tag){case 0:case 11:case 14:case 15:case 22:if(l=c.updateQueue,l!==null&&(l=l.lastEffect,l!==null)){var m=l=l.next;do{var b=m,S=b.destroy;if(b=b.tag,S!==void 0)if((b&4)!==0)_0(c,m);else{b=c;try{S()}catch(P){Mi(b,P)}}m=m.next}while(m!==l)}break;case 1:if(n0(c),l=c.stateNode,typeof l.componentWillUnmount=="function")try{l.props=c.memoizedProps,l.state=c.memoizedState,l.componentWillUnmount()}catch(P){Mi(c,P)}break;case 5:n0(c);break;case 4:he?u0(l,c):Ee&&Ee&&(c=c.stateNode.containerInfo,l=Ws(c),ql(c,l))}}function o0(l,c){for(var m=c;;)if(s0(l,m),m.child===null||he&&m.tag===4){if(m===c)break;for(;m.sibling===null;){if(m.return===null||m.return===c)return;m=m.return}m.sibling.return=m.return,m=m.sibling}else m.child.return=m,m=m.child}function a0(l){l.alternate=null,l.child=null,l.dependencies=null,l.firstEffect=null,l.lastEffect=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.return=null,l.updateQueue=null}function l0(l){return l.tag===5||l.tag===3||l.tag===4}function c0(l){if(he){e:{for(var c=l.return;c!==null;){if(l0(c))break e;c=c.return}throw Error(a(160))}var m=c;switch(c=m.stateNode,m.tag){case 5:var b=!1;break;case 3:c=c.containerInfo,b=!0;break;case 4:c=c.containerInfo,b=!0;break;default:throw Error(a(161))}m.flags&16&&(Lt(c),m.flags&=-17);e:t:for(m=l;;){for(;m.sibling===null;){if(m.return===null||l0(m.return)){m=null;break e}m=m.return}for(m.sibling.return=m.return,m=m.sibling;m.tag!==5&&m.tag!==6&&m.tag!==18;){if(m.flags&2||m.child===null||m.tag===4)continue t;m.child.return=m,m=m.child}if(!(m.flags&2)){m=m.stateNode;break e}}b?hd(l,m,c):pd(l,m,c)}}function hd(l,c,m){var b=l.tag,S=b===5||b===6;if(S)l=S?l.stateNode:l.stateNode.instance,c?ce(m,l,c):Ze(m,l);else if(b!==4&&(l=l.child,l!==null))for(hd(l,c,m),l=l.sibling;l!==null;)hd(l,c,m),l=l.sibling}function pd(l,c,m){var b=l.tag,S=b===5||b===6;if(S)l=S?l.stateNode:l.stateNode.instance,c?We(m,l,c):be(m,l);else if(b!==4&&(l=l.child,l!==null))for(pd(l,c,m),l=l.sibling;l!==null;)pd(l,c,m),l=l.sibling}function u0(l,c){for(var m=c,b=!1,S,P;;){if(!b){b=m.return;e:for(;;){if(b===null)throw Error(a(160));switch(S=b.stateNode,b.tag){case 5:P=!1;break e;case 3:S=S.containerInfo,P=!0;break e;case 4:S=S.containerInfo,P=!0;break e}b=b.return}b=!0}if(m.tag===5||m.tag===6)o0(l,m),P?lt(S,m.stateNode):Ue(S,m.stateNode);else if(m.tag===4){if(m.child!==null){S=m.stateNode.containerInfo,P=!0,m.child.return=m,m=m.child;continue}}else if(s0(l,m),m.child!==null){m.child.return=m,m=m.child;continue}if(m===c)break;for(;m.sibling===null;){if(m.return===null||m.return===c)return;m=m.return,m.tag===4&&(b=!1)}m.sibling.return=m.return,m=m.sibling}}function md(l,c){if(he){switch(c.tag){case 0:case 11:case 14:case 15:case 22:r0(3,c);return;case 1:return;case 5:var m=c.stateNode;if(m!=null){var b=c.memoizedProps;l=l!==null?l.memoizedProps:b;var S=c.type,P=c.updateQueue;c.updateQueue=null,P!==null&&Re(m,P,S,l,b,c)}return;case 6:if(c.stateNode===null)throw Error(a(162));m=c.memoizedProps,q(c.stateNode,l!==null?l.memoizedProps:m,m);return;case 3:ve&&(c=c.stateNode,c.hydrate&&(c.hydrate=!1,ut(c.containerInfo)));return;case 12:return;case 13:f0(c),bc(c);return;case 19:bc(c);return;case 17:return;case 23:case 24:i0(c,c.memoizedState!==null);return}throw Error(a(163))}switch(c.tag){case 0:case 11:case 14:case 15:case 22:r0(3,c);return;case 12:return;case 13:f0(c),bc(c);return;case 19:bc(c);return;case 3:ve&&(m=c.stateNode,m.hydrate&&(m.hydrate=!1,ut(m.containerInfo)));break;case 23:case 24:return}e:if(Ee){switch(c.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:c=c.stateNode,ql(c.containerInfo,c.pendingChildren);break e}throw Error(a(163))}}function f0(l){l.memoizedState!==null&&(Ed=gn(),he&&i0(l.child,!0))}function bc(l){var c=l.updateQueue;if(c!==null){l.updateQueue=null;var m=l.stateNode;
vendor: 17,332 bytes, lines 3027-3029
3027m===null&&(m=l.stateNode=new nS),c.forEach(function(b){var S=gS.bind(null,l,b);m.has(b)||(m.add(b),b.then(S,S))})}}function sS(l,c){return l!==null&&(l=l.memoizedState,l===null||l.dehydrated!==null)?(c=c.memoizedState,c!==null&&c.dehydrated===null):!1}var wc=0,Sc=1,Mc=2,Ec=3,Tc=4;if(typeof Symbol=="function"&&Symbol.for){var La=Symbol.for;wc=La("selector.component"),Sc=La("selector.has_pseudo_class"),Mc=La("selector.role"),Ec=La("selector.test_id"),Tc=La("selector.text")}function gd(l){var c=je(l);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(a(364));return c}if(l=J(l),l===null)throw Error(a(362));return l.stateNode.current}function yd(l,c){switch(c.$$typeof){case wc:if(l.type===c.value)return!0;break;case Sc:e:{c=c.value,l=[l,0];for(var m=0;m<l.length;){var b=l[m++],S=l[m++],P=c[S];if(b.tag!==5||!ie(b)){for(;P!=null&&yd(b,P);)S++,P=c[S];if(S===c.length){c=!0;break e}else for(b=b.child;b!==null;)l.push(b,S),b=b.sibling}}c=!1}return c;case Mc:if(l.tag===5&&Ne(l.stateNode,c.value))return!0;break;case Tc:if((l.tag===5||l.tag===6)&&(l=Te(l),l!==null&&0<=l.indexOf(c.value)))return!0;break;case Ec:if(l.tag===5&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===c.value.toLowerCase()))return!0;break;default:throw Error(a(365,c))}return!1}function vd(l){switch(l.$$typeof){case wc:return"<"+(O(l.value)||"Unknown")+">";case Sc:return":has("+(vd(l)||"")+")";case Mc:return'[role="'+l.value+'"]';case Tc:return'"'+l.value+'"';case Ec:return'[data-testname="'+l.value+'"]';default:throw Error(a(365,l))}}function d0(l,c){var m=[];l=[l,0];for(var b=0;b<l.length;){var S=l[b++],P=l[b++],N=c[P];if(S.tag!==5||!ie(S)){for(;N!=null&&yd(S,N);)P++,N=c[P];if(P===c.length)m.push(S);else for(S=S.child;S!==null;)l.push(S,P),S=S.sibling}}return m}function xd(l,c){if(!I)throw Error(a(363));l=gd(l),l=d0(l,c),c=[],l=Array.from(l);for(var m=0;m<l.length;){var b=l[m++];if(b.tag===5)ie(b)||c.push(b.stateNode);else for(b=b.child;b!==null;)l.push(b),b=b.sibling}return c}var Ac=null;function oS(l){if(Ac===null)try{var c=("require"+Math.random()).slice(0,7);Ac=(r&&r[c]).call(r,"timers").setImmediate}catch{Ac=function(b){var S=new MessageChannel;S.port1.onmessage=b,S.port2.postMessage(void 0)}}return Ac(l)}var aS=Math.ceil,Rc=u.ReactCurrentDispatcher,_d=u.ReactCurrentOwner,bd=u.IsSomeRendererActing,qe=0,Ln=null,cn=null,En=0,ns=0,wd=an(0),vn=0,Cc=null,Qs=0,Ia=0,eo=0,Sd=0,Md=null,Ed=0,Td=1/0;function bi(){Td=gn()+500}var Oe=null,Pc=!1,Ad=null,Lr=null,wi=!1,Da=null,Oa=90,Rd=[],Cd=[],jr=null,Fa=0,Pd=null,Lc=-1,qr=0,Ic=0,Ba=null,za=!1;function Hn(){return(qe&48)!==0?gn():Lc!==-1?Lc:Lc=gn()}function Si(l){if(l=l.mode,(l&2)===0)return 1;if((l&4)===0)return qs()===99?1:2;if(qr===0&&(qr=Qs),W1.transition!==0){Ic!==0&&(Ic=Md!==null?Md.pendingLanes:0),l=qr;var c=4186112&~Ic;return c&=-c,c===0&&(l=4186112&~l,c=l&-l,c===0&&(c=8192)),c}return l=qs(),(qe&4)!==0&&l===98?l=Kl(12,qr):(l=F1(l),l=Kl(l,qr)),l}function Xr(l,c,m){if(50<Fa)throw Fa=0,Pd=null,Error(a(185));if(l=Dc(l,c),l===null)return null;Ql(l,c,m),l===Ln&&(eo|=c,vn===4&&to(l,En));var b=qs();c===1?(qe&8)!==0&&(qe&48)===0?Ld(l):(jn(l,m),qe===0&&(bi(),nr())):((qe&4)===0||b!==98&&b!==99||(jr===null?jr=new Set([l]):jr.add(l)),jn(l,m)),Md=l}function Dc(l,c){l.lanes|=c;var m=l.alternate;for(m!==null&&(m.lanes|=c),m=l,l=l.return;l!==null;)l.childLanes|=c,m=l.alternate,m!==null&&(m.childLanes|=c),m=l,l=l.return;return m.tag===3?m.stateNode:null}function jn(l,c){for(var m=l.callbackNode,b=l.suspendedLanes,S=l.pingedLanes,P=l.expirationTimes,N=l.pendingLanes;0<N;){var $=31-yi(N),oe=1<<$,_e=P[$];if(_e===-1){if((oe&b)===0||(oe&S)!==0){_e=c,Ki(oe);var He=Ot;P[$]=10<=He?_e+250:6<=He?_e+5e3:-1}}else _e<=c&&(l.expiredLanes|=oe);N&=~oe}if(b=ga(l,l===Ln?En:0),c=Ot,b===0)m!==null&&(m!==Wf&&Gf(m),l.callbackNode=null,l.callbackPriority=0);else{if(m!==null){if(l.callbackPriority===c)return;m!==Wf&&Gf(m)}c===15?(m=Ld.bind(null,l),Gr===null?(Gr=[m],tc=Hf(ec,mg)):Gr.push(m),m=Wf):c===14?m=ya(99,Ld.bind(null,l)):(m=B1(c),m=ya(m,h0.bind(null,l))),l.callbackPriority=c,l.callbackNode=m}}function h0(l){if(Lc=-1,Ic=qr=0,(qe&48)!==0)throw Error(a(327));var c=l.callbackNode;if(Yr()&&l.callbackNode!==c)return null;var m=ga(l,l===Ln?En:0);if(m===0)return null;var b=m,S=qe;qe|=16;var P=y0();(Ln!==l||En!==b)&&(bi(),no(l,b));do try{uS();break}catch($){g0(l,$)}while(1);if(jf(),Rc.current=P,qe=S,cn!==null?b=0:(Ln=null,En=0,b=vn),(Qs&eo)!==0)no(l,0);else if(b!==0){if(b===2&&(qe|=64,l.hydrate&&(l.hydrate=!1,gi(l.containerInfo)),m=ag(l),m!==0&&(b=Na(l,m))),b===1)throw c=Cc,no(l,0),to(l,m),jn(l,gn()),c;switch(l.finishedWork=l.current.alternate,l.finishedLanes=m,b){case 0:case 1:throw Error(a(345));case 2:rs(l);break;case 3:if(to(l,m),(m&62914560)===m&&(b=Ed+500-gn(),10<b)){if(ga(l,0)!==0)break;if(S=l.suspendedLanes,(S&m)!==m){Hn(),l.pingedLanes|=l.suspendedLanes&S;break}l.timeoutHandle=et(rs.bind(null,l),b);break}rs(l);break;case 4:if(to(l,m),(m&4186112)===m)break;for(b=l.eventTimes,S=-1;0<m;){var N=31-yi(m);P=1<<N,N=b[N],N>S&&(S=N),m&=~P}if(m=S,m=gn()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*aS(m/1960))-m,10<m){l.timeoutHandle=et(rs.bind(null,l),m);break}rs(l);break;case 5:rs(l);break;default:throw Error(a(329))}}return jn(l,gn()),l.callbackNode===c?h0.bind(null,l):null}function to(l,c){for(c&=~Sd,c&=~eo,l.suspendedLanes|=c,l.pingedLanes&=~c,l=l.expirationTimes;0<c;){var m=31-yi(c),b=1<<m;l[m]=-1,c&=~b}}function Ld(l){if((qe&48)!==0)throw Error(a(327));if(Yr(),l===Ln&&(l.expiredLanes&En)!==0){var c=En,m=Na(l,c);(Qs&eo)!==0&&(c=ga(l,c),m=Na(l,c))}else c=ga(l,0),m=Na(l,c);if(l.tag!==0&&m===2&&(qe|=64,l.hydrate&&(l.hydrate=!1,gi(l.containerInfo)),c=ag(l),c!==0&&(m=Na(l,c))),m===1)throw m=Cc,no(l,0),to(l,c),jn(l,gn()),m;return l.finishedWork=l.current.alternate,l.finishedLanes=c,rs(l),jn(l,gn()),null}function lS(){if(jr!==null){var l=jr;jr=null,l.forEach(function(c){c.expiredLanes|=24&c.pendingLanes,jn(c,gn())})}nr()}function p0(l,c){var m=qe;qe|=1;try{return l(c)}finally{qe=m,qe===0&&(bi(),nr())}}function m0(l,c){var m=qe;if((m&48)!==0)return l(c);qe|=1;try{if(l)return Vr(99,l.bind(null,c))}finally{qe=m,nr()}}function Oc(l,c){gt(wd,ns),ns|=c,Qs|=c}function Id(){ns=wd.current,bt(wd)}function no(l,c){l.finishedWork=null,l.finishedLanes=0;var m=l.timeoutHandle;if(m!==le&&(l.timeoutHandle=le,Ve(m)),cn!==null)for(m=cn.return;m!==null;){var b=m;switch(b.tag){case 1:b=b.type.childContextTypes,b!=null&&Yl();break;case 3:Zs(),bt(rn),bt(yt),ed();break;case 5:Zf(b);break;case 4:Zs();break;case 13:bt(Wt);break;case 19:bt(Wt);break;case 10:qf(b);break;case 23:case 24:Id()}m=m.return}Ln=l,cn=Ei(l.current,null),En=ns=Qs=c,vn=0,Cc=null,Sd=eo=Ia=0}function g0(l,c){do{var m=cn;try{if(jf(),wa.current=yc,hc){for(var b=Xt.memoizedState;b!==null;){var S=b.queue;S!==null&&(S.pending=null),b=b.next}hc=!1}if(Sa=0,yn=Mn=Xt=null,Ma=!1,_d.current=null,m===null||m.return===null){vn=1,Cc=c,cn=null;break}e:{var P=l,N=m.return,$=m,oe=c;if(c=En,$.flags|=2048,$.firstEffect=$.lastEffect=null,oe!==null&&typeof oe=="object"&&typeof oe.then=="function"){var _e=oe;if(($.mode&2)===0){var He=$.alternate;He?($.updateQueue=He.updateQueue,$.memoizedState=He.memoizedState,$.lanes=He.lanes):($.updateQueue=null,$.memoizedState=null)}var nt=(Wt.current&1)!==0,Pe=N;do{var At;if(At=Pe.tag===13){var Ut=Pe.memoizedState;if(Ut!==null)At=Ut.dehydrated!==null;else{var lr=Pe.memoizedProps;At=lr.fallback===void 0?!1:lr.unstable_avoidThisFallback!==!0?!0:!nt}}if(At){var K=Pe.updateQueue;if(K===null){var X=new Set;X.add(_e),Pe.updateQueue=X}else K.add(_e);if((Pe.mode&2)===0){if(Pe.flags|=64,$.flags|=16384,$.flags&=-2981,$.tag===1)if($.alternate===null)$.tag=17;else{var ae=xi(-1,1);ae.tag=2,_i($,ae)}$.lanes|=1;break e}oe=void 0,$=c;var Ce=P.pingCache;if(Ce===null?(Ce=P.pingCache=new tS,oe=new Set,Ce.set(_e,oe)):(oe=Ce.get(_e),oe===void 0&&(oe=new Set,Ce.set(_e,oe))),!oe.has($)){oe.add($);var Ge=mS.bind(null,P,_e,$);_e.then(Ge,Ge)}Pe.flags|=4096,Pe.lanes=c;break e}Pe=Pe.return}while(Pe!==null);oe=Error((O($.type)||"A React component")+` suspended while rendering, but no fallback UI was specified. 3028 3029Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}vn!==5&&(vn=2),oe=fd(oe,$),Pe=N;do{switch(Pe.tag){case 3:P=oe,Pe.flags|=4096,c&=-c,Pe.lanes|=c;var Ft=e0(Pe,P,c);xg(Pe,Ft);break e;case 1:P=oe;var rt=Pe.type,wt=Pe.stateNode;if((Pe.flags&64)===0&&(typeof rt.getDerivedStateFromError=="function"||wt!==null&&typeof wt.componentDidCatch=="function"&&(Lr===null||!Lr.has(wt)))){Pe.flags|=4096,c&=-c,Pe.lanes|=c;var sn=t0(Pe,P,c);xg(Pe,sn);break e}}Pe=Pe.return}while(Pe!==null)}x0(m)}catch(ht){c=ht,cn===m&&m!==null&&(cn=m=m.return);continue}break}while(1)}function y0(){var l=Rc.current;return Rc.current=yc,l===null?yc:l}function Na(l,c){var m=qe;qe|=16;var b=y0();Ln===l&&En===c||no(l,c);do try{cS();break}catch(S){g0(l,S)}while(1);if(jf(),qe=m,Rc.current=b,cn!==null)throw Error(a(261));return Ln=null,En=0,vn}function cS(){for(;cn!==null;)v0(cn)}function uS(){for(;cn!==null&&!H1();)v0(cn)}function v0(l){var c=w0(l.alternate,l,ns);l.memoizedProps=l.pendingProps,c===null?x0(l):cn=c,_d.current=null}function x0(l){var c=l;do{var m=c.alternate;if(l=c.return,(c.flags&2048)===0){if(m=Q1(m,c,ns),m!==null){cn=m;return}if(m=c,m.tag!==24&&m.tag!==23||m.memoizedState===null||(ns&1073741824)!==0||(m.mode&4)===0){for(var b=0,S=m.child;S!==null;)b|=S.lanes|S.childLanes,S=S.sibling;m.childLanes=b}l!==null&&(l.flags&2048)===0&&(l.firstEffect===null&&(l.firstEffect=c.firstEffect),c.lastEffect!==null&&(l.lastEffect!==null&&(l.lastEffect.nextEffect=c.firstEffect),l.lastEffect=c.lastEffect),1<c.flags&&(l.lastEffect!==null?l.lastEffect.nextEffect=c:l.firstEffect=c,l.lastEffect=c))}else{if(m=eS(c),m!==null){m.flags&=2047,cn=m;return}l!==null&&(l.firstEffect=l.lastEffect=null,l.flags|=2048)}if(c=c.sibling,c!==null){cn=c;return}cn=c=l}while(c!==null);vn===0&&(vn=5)}function rs(l){var c=qs();return Vr(99,fS.bind(null,l,c)),null}function fS(l,c){do Yr();while(Da!==null);if((qe&48)!==0)throw Error(a(327));var m=l.finishedWork;if(m===null)return null;if(l.finishedWork=null,l.finishedLanes=0,m===l.current)throw Error(a(177));l.callbackNode=null;var b=m.lanes|m.childLanes,S=b,P=l.pendingLanes&~S;l.pendingLanes=S,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=S,l.mutableReadLanes&=S,l.entangledLanes&=S,S=l.entanglements;for(var N=l.eventTimes,$=l.expirationTimes;0<P;){var oe=31-yi(P),_e=1<<oe;S[oe]=0,N[oe]=-1,$[oe]=-1,P&=~_e}if(jr!==null&&(b&24)===0&&jr.has(l)&&jr.delete(l),l===Ln&&(cn=Ln=null,En=0),1<m.flags?m.lastEffect!==null?(m.lastEffect.nextEffect=m,b=m.firstEffect):b=m:b=m.firstEffect,b!==null){S=qe,qe|=32,_d.current=null,Ba=ue(l.containerInfo),za=!1,Oe=b;do try{dS()}catch(X){if(Oe===null)throw Error(a(330));Mi(Oe,X),Oe=Oe.nextEffect}while(Oe!==null);Ba=null,Oe=b;do try{for(N=l;Oe!==null;){var He=Oe.flags;if(He&16&&he&&Lt(Oe.stateNode),He&128){var nt=Oe.alternate;if(nt!==null){var Pe=nt.ref;Pe!==null&&(typeof Pe=="function"?Pe(null):Pe.current=null)}}switch(He&1038){case 2:c0(Oe),Oe.flags&=-3;break;case 6:c0(Oe),Oe.flags&=-3,md(Oe.alternate,Oe);break;case 1024:Oe.flags&=-1025;break;case 1028:Oe.flags&=-1025,md(Oe.alternate,Oe);break;case 4:md(Oe.alternate,Oe);break;case 8:$=N,P=Oe,he?u0($,P):o0($,P);var At=P.alternate;a0(P),At!==null&&a0(At)}Oe=Oe.nextEffect}}catch(X){if(Oe===null)throw Error(a(330));Mi(Oe,X),Oe=Oe.nextEffect}while(Oe!==null);za&&mt(),ye(l.containerInfo),l.current=m,Oe=b;do try{for(He=l;Oe!==null;){var Ut=Oe.flags;if(Ut&36&&iS(He,Oe.alternate,Oe),Ut&128){nt=void 0;var lr=Oe.ref;if(lr!==null){var K=Oe.stateNode;switch(Oe.tag){case 5:nt=ge(K);break;default:nt=K}typeof lr=="function"?lr(nt):lr.current=nt}}Oe=Oe.nextEffect}}catch(X){if(Oe===null)throw Error(a(330));Mi(Oe,X),Oe=Oe.nextEffect}while(Oe!==null);Oe=null,V1(),qe=S}else l.current=m;if(wi)wi=!1,Da=l,Oa=c;else for(Oe=b;Oe!==null;)c=Oe.nextEffect,Oe.nextEffect=null,Oe.flags&8&&(Ut=Oe,Ut.sibling=null,Ut.stateNode=null),Oe=c;if(b=l.pendingLanes,b===0&&(Lr=null),b===1?l===Pd?Fa++:(Fa=0,Pd=l):Fa=0,m=m.stateNode,Zi&&typeof Zi.onCommitFiberRoot=="function")try{Zi.onCommitFiberRoot(kf,m,void 0,(m.current.flags&64)===64)}catch{}if(jn(l,gn()),Pc)throw Pc=!1,l=Ad,Ad=null,l;return(qe&8)!==0||nr(),null}function dS(){for(;Oe!==null;){var l=Oe.alternate;za||Ba===null||((Oe.flags&8)!==0?ne(Oe,Ba)&&(za=!0,xt()):Oe.tag===13&&sS(l,Oe)&&ne(Oe,Ba)&&(za=!0,xt()));var c=Oe.flags;(c&256)!==0&&rS(l,Oe),(c&512)===0||wi||(wi=!0,ya(97,function(){return Yr(),null})),Oe=Oe.nextEffect}}function Yr(){if(Oa!==90){var l=97<Oa?97:Oa;return Oa=90,Vr(l,pS)}return!1}function hS(l,c){Rd.push(c,l),wi||(wi=!0,ya(97,function(){return Yr(),null}))}function _0(l,c){Cd.push(c,l),wi||(wi=!0,ya(97,function(){return Yr(),null}))}function pS(){if(Da===null)return!1;var l=Da;if(Da=null,(qe&48)!==0)throw Error(a(331));var c=qe;qe|=32;var m=Cd;Cd=[];for(var b=0;b<m.length;b+=2){var S=m[b],P=m[b+1],N=S.destroy;if(S.destroy=void 0,typeof N=="function")try{N()}catch(oe){if(P===null)throw Error(a(330));Mi(P,oe)}}for(m=Rd,Rd=[],b=0;b<m.length;b+=2){S=m[b],P=m[b+1];try{var $=S.create;S.destroy=$()}catch(oe){if(P===null)throw Error(a(330));Mi(P,oe)}}for($=l.current.firstEffect;$!==null;)l=$.nextEffect,$.nextEffect=null,$.flags&8&&($.sibling=null,$.stateNode=null),$=l;return qe=c,nr(),!0}function b0(l,c,m){c=fd(m,c),c=e0(l,c,1),_i(l,c),c=Hn(),l=Dc(l,1),l!==null&&(Ql(l,1,c),jn(l,c))}function Mi(l,c){if(l.tag===3)b0(l,l,c);else for(var m=l.return;m!==null;){if(m.tag===3){b0(m,l,c);break}else if(m.tag===1){var b=m.stateNode;if(typeof m.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(Lr===null||!Lr.has(b))){l=fd(c,l);var S=t0(m,l,1);if(_i(m,S),S=Hn(),m=Dc(m,1),m!==null)Ql(m,1,S),jn(m,S);else if(typeof b.componentDidCatch=="function"&&(Lr===null||!Lr.has(b)))try{b.componentDidCatch(c,l)}catch{}break}}m=m.return}}function mS(l,c,m){var b=l.pingCache;b!==null&&b.delete(c),c=Hn(),l.pingedLanes|=l.suspendedLanes&m,Ln===l&&(En&m)===m&&(vn===4||vn===3&&(En&62914560)===En&&500>gn()-Ed?no(l,0):Sd|=m),jn(l,c)}function gS(l,c){var m=l.stateNode;m!==null&&m.delete(c),c=0,c===0&&(c=l.mode,(c&2)===0?c=1:(c&4)===0?c=qs()===99?1:2:(qr===0&&(qr=Qs),c=js(62914560&~qr),c===0&&(c=4194304))),m=Hn(),l=Dc(l,c),l!==null&&(Ql(l,c,m),jn(l,m))}var w0;w0=function(l,c,m){var b=c.lanes;if(l!==null)if(l.memoizedProps!==c.pendingProps||rn.current)gr=!0;else if((m&b)!==0)gr=(l.flags&16384)!==0;else{switch(gr=!1,c.tag){case 3:jg(c),Qf();break;case 5:Ag(c);break;case 1:Nn(c.type)&&Jl(c);break;case 4:Jf(c,c.stateNode.containerInfo);break;case 10:gg(c,c.memoizedProps.value);break;case 13:if(c.memoizedState!==null)return(m&c.child.childLanes)!==0?qg(l,c,m):(gt(Wt,Wt.current&1),c=$r(l,c,m),c!==null?c.sibling:null);gt(Wt,Wt.current&1);break;case 19:if(b=(m&c.childLanes)!==0,(l.flags&64)!==0){if(b)return Kg(l,c,m);c.flags|=64}var S=c.memoizedState;if(S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),gt(Wt,Wt.current),b)break;return null;case 23:case 24:return c.lanes=0,ad(l,c,m)}return $r(l,c,m)}else gr=!1;switch(c.lanes=0,c.tag){case 2:if(b=c.type,l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2),l=c.pendingProps,S=$s(c,yt.current),Ys(c,m),S=nd(null,c,b,l,S,m),c.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0){if(c.tag=1,c.memoizedState=null,c.updateQueue=null,Nn(b)){var P=!0;Jl(c)}else P=!1;c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,Xf(c);var N=b.getDerivedStateFromProps;typeof N=="function"&&oc(c,b,N,l),S.updater=ac,c.stateNode=S,S._reactInternals=c,Yf(c,b,l,m),c=cd(null,c,b,!0,P,m)}else c.tag=0,Un(null,c,S,m),c=c.child;return c;case 16:S=c.elementType;e:{switch(l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2),l=c.pendingProps,P=S._init,S=P(S._payload),c.type=S,P=c.tag=vS(S),l=mr(S,l),P){case 0:c=ld(null,c,S,l,m);break e;case 1:c=$g(null,c,S,l,m);break e;case 11:c=Hg(null,c,S,l,m);break e;case 14:c=Gg(null,c,S,mr(S.type,l),b,m);break e}throw Error(a(306,S,""))}return c;case 0:return b=c.type,S=c.pendingProps,S=c.elementType===b?S:mr(b,S),ld(l,c,b,S,m);case 1:return b=c.type,S=c.pendingProps,S=c.elementType===b?S:mr(b,S),$g(l,c,b,S,m);case 3:if(jg(c),b=c.updateQueue,l===null||b===null)throw Error(a(282));if(b=c.pendingProps,S=c.memoizedState,S=S!==null?S.element:null,vg(l,c),va(c,b,null,m),b=c.memoizedState.element,b===S)Qf(),c=$r(l,c,m);else{if(S=c.stateNode,(P=S.hydrate)&&(ve?(Qi=tt(c.stateNode.containerInfo),Wr=c,P=Rr=!0):P=!1),P){if(ve&&(l=S.mutableSourceEagerHydrationData,l!=null))for(S=0;S<l.length;S+=2)P=l[S],N=l[S+1],me?P._workInProgressVersionPrimary=N:P._workInProgressVersionSecondary=N,Ks.push(P);for(m=Tg(c,null,b,m),c.child=m;m;)m.flags=m.flags&-3|1024,m=m.sibling}else Un(l,c,b,m),Qf();c=c.child}return c;case 5:return Ag(c),l===null&&Kf(c),b=c.type,S=c.pendingProps,P=l!==null?l.memoizedProps:null,N=S.children,Be(b,S)?N=null:P!==null&&Be(b,P)&&(c.flags|=16),Wg(l,c),Un(l,c,N,m),c.child;case 6:return l===null&&Kf(c),null;case 13:return qg(l,c,m);case 4:return Jf(c,c.stateNode.containerInfo),b=c.pendingProps,l===null?c.child=uc(c,null,b,m):Un(l,c,b,m),c.child;case 11:return b=c.type,S=c.pendingProps,S=c.elementType===b?S:mr(b,S),Hg(l,c,b,S,m);case 7:return Un(l,c,c.pendingProps,m),c.child;
3029case 8:return Un(l,c,c.pendingProps.children,m),c.child;case 12:return Un(l,c,c.pendingProps.children,m),c.child;case 10:e:{if(b=c.type._context,S=c.pendingProps,N=c.memoizedProps,P=S.value,gg(c,P),N!==null){var $=N.value;if(P=rr($,P)?0:(typeof b._calculateChangedBits=="function"?b._calculateChangedBits($,P):1073741823)|0,P===0){if(N.children===S.children&&!rn.current){c=$r(l,c,m);break e}}else for($=c.child,$!==null&&($.return=c);$!==null;){var oe=$.dependencies;if(oe!==null){N=$.child;for(var _e=oe.firstContext;_e!==null;){if(_e.context===b&&(_e.observedBits&P)!==0){$.tag===1&&(_e=xi(-1,m&-m),_e.tag=2,_i($,_e)),$.lanes|=m,_e=$.alternate,_e!==null&&(_e.lanes|=m),yg($.return,m),oe.lanes|=m;break}_e=_e.next}}else N=$.tag===10&&$.type===c.type?null:$.child;if(N!==null)N.return=$;else for(N=$;N!==null;){if(N===c){N=null;break}if($=N.sibling,$!==null){$.return=N.return,N=$;break}N=N.return}$=N}}Un(l,c,S.children,m),c=c.child}return c;case 9:return S=c.type,P=c.pendingProps,b=P.children,Ys(c,m),S=ir(S,P.unstable_observedBits),b=b(S),c.flags|=1,Un(l,c,b,m),c.child;case 14:return S=c.type,P=mr(S,c.pendingProps),P=mr(S.type,P),Gg(l,c,S,P,b,m);case 15:return Vg(l,c,c.type,c.pendingProps,b,m);case 17:return b=c.type,S=c.pendingProps,S=c.elementType===b?S:mr(b,S),l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2),c.tag=1,Nn(b)?(l=!0,Jl(c)):l=!1,Ys(c,m),Sg(c,b,S),Yf(c,b,S,m),cd(null,c,b,!0,l,m);case 19:return Kg(l,c,m);case 23:return ad(l,c,m);case 24:return ad(l,c,m)}throw Error(a(156,c.tag))};var Fc={current:!1},Dd=o.unstable_flushAllWithoutAsserting,S0=typeof Dd=="function";function Od(){if(Dd!==void 0)return Dd();for(var l=!1;Yr();)l=!0;return l}function M0(l){try{Od(),oS(function(){Od()?M0(l):l()})}catch(c){l(c)}}var Bc=0,E0=!1;function yS(l,c,m,b){this.tag=l,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function ar(l,c,m,b){return new yS(l,c,m,b)}function Fd(l){return l=l.prototype,!(!l||!l.isReactComponent)}function vS(l){if(typeof l=="function")return Fd(l)?1:0;if(l!=null){if(l=l.$$typeof,l===w)return 11;if(l===E)return 14}return 2}function Ei(l,c){var m=l.alternate;return m===null?(m=ar(l.tag,c,l.key,l.mode),m.elementType=l.elementType,m.type=l.type,m.stateNode=l.stateNode,m.alternate=l,l.alternate=m):(m.pendingProps=c,m.type=l.type,m.flags=0,m.nextEffect=null,m.firstEffect=null,m.lastEffect=null),m.childLanes=l.childLanes,m.lanes=l.lanes,m.child=l.child,m.memoizedProps=l.memoizedProps,m.memoizedState=l.memoizedState,m.updateQueue=l.updateQueue,c=l.dependencies,m.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},m.sibling=l.sibling,m.index=l.index,m.ref=l.ref,m}function zc(l,c,m,b,S,P){var N=2;if(b=l,typeof l=="function")Fd(l)&&(N=1);else if(typeof l=="string")N=5;else e:switch(l){case h:return ro(m.children,S,P,c);case C:N=8,S|=16;break;case d:N=8,S|=1;break;case g:return l=ar(12,m,c,S|8),l.elementType=g,l.type=g,l.lanes=P,l;case x:return l=ar(13,m,c,S),l.type=x,l.elementType=x,l.lanes=P,l;case v:return l=ar(19,m,c,S),l.elementType=v,l.lanes=P,l;case L:return Bd(m,S,P,c);case D:return l=ar(24,m,c,S),l.elementType=D,l.lanes=P,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case y:N=10;break e;case _:N=9;break e;case w:N=11;break e;case E:N=14;break e;case M:N=16,b=null;break e;case A:N=22;break e}throw Error(a(130,l==null?l:typeof l,""))}return c=ar(N,m,c,S),c.elementType=l,c.type=b,c.lanes=P,c}function ro(l,c,m,b){return l=ar(7,l,b,c),l.lanes=m,l}function Bd(l,c,m,b){return l=ar(23,l,b,c),l.elementType=L,l.lanes=m,l}function zd(l,c,m){return l=ar(6,l,null,c),l.lanes=m,l}function Nd(l,c,m){return c=ar(4,l.children!==null?l.children:[],l.key,c),c.lanes=m,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}function xS(l,c,m){this.tag=c,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=le,this.pendingContext=this.context=null,this.hydrate=m,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Uf(0),this.expirationTimes=Uf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uf(0),ve&&(this.mutableSourceEagerHydrationData=null)}function T0(l){var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(a(188)):Error(a(268,Object.keys(l)));return l=j(c),l===null?null:l.stateNode}
3029function A0(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var m=l.retryLane;l.retryLane=m!==0&&m<c?m:c}}function Nc(l,c){A0(l,c),(l=l.alternate)&&A0(l,c)}function _S(l){return l=j(l),l===null?null:l.stateNode}function bS(){return null}return n.IsThisRendererActing=Fc,n.act=function(l){function c(){Bc--,bd.current=m,Fc.current=b}E0===!1&&(E0=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected.")),Bc++;var m=bd.current,b=Fc.current;bd.current=!0,Fc.current=!0;try{var S=p0(l)}catch(P){throw c(),P}if(S!==null&&typeof S=="object"&&typeof S.then=="function")return{then:function(P,N){S.then(function(){1<Bc||S0===!0&&m===!0?(c(),P()):M0(function($){c(),$?N($):P()})},function($){c(),N($)})}};try{Bc!==1||S0!==!1&&m!==!1||Od(),c()}catch(P){throw c(),P}return{then:function(P){P()}}},n.attemptContinuousHydration=function(l){if(l.tag===13){var c=Hn();Xr(l,67108864,c),Nc(l,67108864)}},n.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13){var c=Hn(),m=Si(l);Xr(l,m,c),Nc(l,m)}},n.attemptSynchronousHydration=function(l){switch(l.tag){case 3:var c=l.stateNode;if(c.hydrate){var m=Ki(c.pendingLanes);c.expiredLanes|=m&c.pendingLanes,jn(c,gn()),(qe&48)===0&&(bi(),nr())}break;case 13:var b=Hn();m0(function(){return Xr(l,1,b)}),Nc(l,4)}},n.attemptUserBlockingHydration=function(l){if(l.tag===13){var c=Hn();Xr(l,4,c),Nc(l,4)}},n.batchedEventUpdates=function(l,c){var m=qe;qe|=2;try{return l(c)}finally{qe=m,qe===0&&(bi(),nr())}},n.batchedUpdates=p0,n.createComponentSelector=function(l){return{$$typeof:wc,value:l}},n.createContainer=function(l,c,m){return l=new xS(l,c,m),c=ar(3,null,null,c===2?7:c===1?3:0),l.current=c,c.stateNode=l,Xf(c),l},n.createHasPsuedoClassSelector=function(l){return{$$typeof:Sc,value:l}},n.createPortal=function(l,c,m){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:p,key:b==null?null:""+b,children:l,containerInfo:c,implementation:m}},n.createRoleSelector=function(l){return{$$typeof:Mc,value:l}},n.createTestNameSelector=function(l){return{$$typeof:Ec,value:l}},n.createTextSelector=function(l){return{$$typeof:Tc,value:l}},n.deferredUpdates=function(l){return Vr(97,l)},n.discreteUpdates=function(l,c,m,b,S){var P=qe;qe|=4;try{return Vr(98,l.bind(null,c,m,b,S))}finally{qe=P,qe===0&&(bi(),nr())}},n.findAllNodes=xd,n.findBoundingRects=function(l,c){if(!I)throw Error(a(363));c=xd(l,c),l=[];for(var m=0;m<c.length;m++)l.push(pe(c[m]));for(c=l.length-1;0<c;c--){m=l[c];for(var b=m.x,S=b+m.width,P=m.y,N=P+m.height,$=c-1;0<=$;$--)if(c!==$){var oe=l[$],_e=oe.x,He=_e+oe.width,nt=oe.y,Pe=nt+oe.height;if(b>=_e&&P>=nt&&S<=He&&N<=Pe){l.splice(c,1);break}else if(b!==_e||m.width!==oe.width||Pe<P||nt>N){if(!(P!==nt||m.height!==oe.height||He<b||_e>S)){_e>b&&(oe.width+=_e-b,oe.x=b),He<S&&(oe.width=S-_e),l.splice(c,1);break}}else{nt>P&&(oe.height+=nt-P,oe.y=P),Pe<N&&(oe.height=N-nt),l.splice(c,1);break}}}return l},n.findHostInstance=T0,n.findHostInstanceWithNoPortals=function(l){return l=Z(l),l===null?null:l.tag===20?l.stateNode.instance:l.stateNode},n.findHostInstanceWithWarning=function(l){return T0(l)},n.flushControlled=function(l){var c=qe;qe|=1;try{Vr(99,l)}finally{qe=c,qe===0&&(bi(),nr())}},n.flushDiscreteUpdates=function(){(qe&49)===0&&(lS(),Yr())},n.flushPassiveEffects=Yr,n.flushSync=m0,n.focusWithin=function(l,c){if(!I)throw Error(a(363));for(l=gd(l),c=d0(l,c),c=Array.from(c),l=0;l<c.length;){var m=c[l++];if(!ie(m)){if(m.tag===5&&Ie(m.stateNode))return!0;for(m=m.child;m!==null;)c.push(m),m=m.sibling}}return!1},n.getCurrentUpdateLanePriority=function(){return Zl},n.getFindAllNodesFailureDescription=function(l,c){if(!I)throw Error(a(363));var m=0,b=[];l=[gd(l),0];for(var S=0;S<l.length;){var P=l[S++],N=l[S++],$=c[N];if((P.tag!==5||!ie(P))&&(yd(P,$)&&(b.push(vd($)),N++,N>m&&(m=N)),N<c.length))for(P=P.child;P!==null;)l.push(P,N),P=P.sibling}if(m<c.length){for(l=[];m<c.length;m++)l.push(vd(c[m]));return`findAllNodes was able to match part of the selector: 3030 `+(b.join(" > ")+` 3031 3032No matching component was found for: 3033 `)+l.join(" > ")}return null},n.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return ge(l.child.stateNode);default:return l.child.stateNode}},n.injectIntoDevTools=function(l){if(l={bundleType:l.bundleType,version:l.version,rendererPackageName:l.rendererPackageName,rendererConfig:l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:_S,findFiberByHostInstance:l.findFiberByHostInstance||bS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined")l=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!c.isDisabled&&c.supportsFiber)try{kf=c.inject(l),Zi=c}catch{}l=!0}return l},n.observeVisibleRects=function(l,c,m,b){if(!I)throw Error(a(363));l=xd(l,c);var S=we(l,m,b).disconnect;return{disconnect:function(){S()}}},n.registerMutableSourceForHydration=function(l,c){var m=c._getVersion;m=m(c._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[c,m]:l.mutableSourceEagerHydrationData.push(c,m)},n.runWithPriority=function(l,c){var m=Zl;try{return Zl=l,c()}finally{Zl=m}},n.shouldSuspend=function(){return!1},n.unbatchedUpdates=function(l,c){var m=qe;qe&=-2,qe|=8;try{return l(c)}finally{qe=m,qe===0&&(bi(),nr())}},n.updateContainer=function(l,c,m,b){var S=c.current,P=Hn(),N=Si(S);e:if(m){m=m._reactInternals;t:{if(H(m)!==m||m.tag!==1)throw Error(a(170));var $=m;do{switch($.tag){case 3:$=$.stateNode.context;break t;case 1:if(Nn($.type)){$=$.stateNode.__reactInternalMemoizedMergedChildContext;break t}}$=$.return}while($!==null);throw Error(a(171))}if(m.tag===1){var oe=m.type;if(Nn(oe)){m=sg(m,oe,$);break e}}m=$}else m=fn;return c.context===null?c.context=m:c.pendingContext=m,c=xi(P,N),c.payload={element:l},b=b===void 0?null:b,b!==null&&(c.callback=b),_i(S,c),Xr(S,N,P),N},n}})(zb);Bb.exports=zb.exports;var Q2=Bb.exports,Hm=function r(e,t){if(e===t)return!0;
3033if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!r(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!r(e[o],t[o]))return!1}return!0}return e!==e&&t!==t};const Cf=[];function Nb(r,e,t,n=0,i=!1){for(const o of e)if(Hm(t,o.args)){if(i)return;if(o.error)throw o.error;if(o.response)return o.response;throw o.promise}const s={args:t,promise:r(...t).then(o=>s.response=o!=null?o:!0).catch(o=>s.error=o!=null?o:"unknown error").then(()=>{n>0&&setTimeout(()=>{const o=e.indexOf(s);o!==-1&&e.splice(o,1)},n)})};if(e.push(s),!i)throw s.promise}function e3(r,...e){if(e===void 0||e.length===0)r.splice(0,r.length);else{const t=r.find(n=>Hm(e,n.args));if(t){const n=r.indexOf(t);n!==-1&&r.splice(n,1)}}}function di(r,...e){return Nb(r,Cf,e,di.lifespan)}di.lifespan=0;di.clear=(...r)=>e3(Cf,...r);di.preload=(r,...e)=>void Nb(r,Cf,e,di.lifespan,!0);di.peek=(...r)=>{var e;return(e=Cf.find(t=>Hm(r,t.args)))==null?void 0:e.response};function t3(r){return function(e){r.forEach(function(t){typeof t=="function"?t(e):t!=null&&(t.current=e)})}}function xp(r,e,t){var n,i,s,o,a;e==null&&(e=100);function u(){var p=Date.now()-o;p<e&&p>=0?n=setTimeout(u,e-p):(n=null,t||(a=r.apply(s,i),s=i=null))}var f=function(){s=this,i=arguments,o=Date.now();var p=t&&!n;return n||(n=setTimeout(u,e)),p&&(a=r.apply(s,i),s=i=null),a};return f.clear=function(){n&&(clearTimeout(n),n=null)},f.flush=function(){n&&(a=r.apply(s,i),s=i=null,clearTimeout(n),n=null)},f}xp.debounce=xp;var Ky=xp;function n3(r){let{debounce:e,scroll:t,polyfill:n,offsetSize:i}=r===void 0?{debounce:0,scroll:!1,offsetSize:!1}:r;const s=n||(typeof window=="undefined"?class{}:window.ResizeObserver);if(!s)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[o,a]=R.exports.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),u=R.exports.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),f=e?typeof e=="number"?e:e.scroll:null,p=e?typeof e=="number"?e:e.resize:null,h=R.exports.useRef(!1);R.exports.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[d,g,y]=R.exports.useMemo(()=>{const v=()=>{if(!u.current.element)return;const{left:E,top:M,width:A,height:C,bottom:L,right:D,x:k,y:B}=u.current.element.getBoundingClientRect(),T={left:E,top:M,width:A,height:C,bottom:L,right:D,x:k,y:B};u.current.element instanceof HTMLElement&&i&&(T.height=u.current.element.offsetHeight,T.width=u.current.element.offsetWidth),Object.freeze(T),h.current&&!o3(u.current.lastBounds,T)&&a(u.current.lastBounds=T)};return[v,p?Ky(v,p):v,f?Ky(v,f):v]},[a,i,f,p]);function _(){u.current.scrollContainers&&(u.current.scrollContainers.forEach(v=>v.removeEventListener("scroll",y,!0)),u.current.scrollContainers=null),u.current.resizeObserver&&(u.current.resizeObserver.disconnect(),u.current.resizeObserver=null)}function w(){!u.current.element||(u.current.resizeObserver=new s(y),u.current.resizeObserver.observe(u.current.element),t&&u.current.scrollContainers&&u.current.scrollContainers.forEach(v=>v.addEventListener("scroll",y,{capture:!0,passive:!0})))}const x=v=>{!v||v===u.current.element||(_(),u.current.element=v,u.current.scrollContainers=kb(v),w())};return i3(y,Boolean(t)),r3(g),R.exports.useEffect(()=>{_(),w()},[t,y,g]),R.exports.useEffect(()=>_,[]),[x,o,d]}function r3(r){R.exports.useEffect(()=>{const e=r;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[r])}function i3(r,e){R.exports.useEffect(()=>{if(e){const t=r;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[r,e])}function kb(r){const e=[];
3033if(!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,...kb(r.parentElement)]}const s3=["x","y","top","bottom","left","right","width","height"],o3=(r,e)=>s3.every(t=>r[t]===e[t]),Ct={obj:r=>r===Object(r)&&!Ct.arr(r)&&typeof r!="function",fun:r=>typeof r=="function",str:r=>typeof r=="string",num:r=>typeof r=="number",und:r=>r===void 0,arr:r=>Array.isArray(r),equ(r,e){if(typeof r!=typeof e||!!r!=!!e)return!1;if(Ct.str(r)||Ct.num(r)||Ct.obj(r))return r===e;if(Ct.arr(r)&&r==e)return!0;let t;for(t in r)if(!(t in e))return!1;for(t in e)if(r[t]!==e[t])return!1;return Ct.und(t)?r===e:!0}};function _h(r){return(r.eventObject||r.object).uuid+"/"+r.index+r.instanceId}function Ub(r,e,t,n){const i=t.get(e);i&&(t.delete(e),t.size===0&&(r.delete(n),i.target.releasePointerCapture(n)))}function a3(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)=>{Ub(t.capturedMap,e,n,i)})}function l3(r){const e=new F;function t(h){var d,g,y,_;const w=r.getState(),{raycaster:x,mouse:v,camera:E,size:M}=w,A=x.computeOffsets==null?void 0:x.computeOffsets(h,w),C=(d=A==null?void 0:A.offsetX)!=null?d:h.offsetX,L=(g=A==null?void 0:A.offsetY)!=null?g:h.offsetY,D=(y=A==null?void 0:A.width)!=null?y:M.width,k=(_=A==null?void 0:A.height)!=null?_:M.height;v.set(C/D*2-1,-(L/k)*2+1),x.setFromCamera(v,E)}function n(h){const{internal:d}=r.getState(),g=h.offsetX-d.initialClick[0],y=h.offsetY-d.initialClick[1];return Math.round(Math.sqrt(g*g+y*y))}function i(h){return h.filter(d=>["Move","Over","Enter","Out","Leave"].some(g=>{var y;return(y=d.__r3f)==null?void 0:y.handlers["onPointer"+g]}))}function s(h){const d=r.getState(),{raycaster:g,internal:y}=d;if(!g.enabled)return[];const _=new Set,w=[],x=h?h(y.interaction):y.interaction;let v=g.intersectObjects(x,!0).filter(M=>{const A=_h(M);return _.has(A)?!1:(_.add(A),!0)});g.filter&&(v=g.filter(v,d));for(const M of v){let A=M.object;for(;A;){var E;(E=A.__r3f)!=null&&E.eventCount&&w.push({...M,eventObject:A}),A=A.parent}}return w}function o(h,d){const{internal:g}=r.getState();if("pointerId"in d&&g.capturedMap.has(d.pointerId))for(let y of g.capturedMap.get(d.pointerId).values())h.push(y.intersection);return h}function a(h,d,g,y){const{raycaster:_,mouse:w,camera:x,internal:v}=r.getState();if(h.length){const E=e.set(w.x,w.y,0).unproject(x),M={stopped:!1};for(const A of h){const C=T=>{var O,H;return(O=(H=v.capturedMap.get(T))==null?void 0:H.has(A.eventObject))!=null?O:!1},L=T=>{const O={intersection:A,target:d.target};v.capturedMap.has(T)?v.capturedMap.get(T).set(A.eventObject,O):v.capturedMap.set(T,new Map([[A.eventObject,O]])),d.target.setPointerCapture(T)},D=T=>{const O=v.capturedMap.get(T);O&&Ub(v.capturedMap,A.eventObject,O,T)};let k={};for(let T in d){let O=d[T];typeof O!="function"&&(k[T]=O)}let B={...A,...k,spaceX:w.x,spaceY:w.y,intersections:h,stopped:M.stopped,delta:g,unprojectedPoint:E,ray:_.ray,camera:x,stopPropagation:()=>{const T="pointerId"in d&&v.capturedMap.get(d.pointerId);if((!T||T.has(A.eventObject))&&(B.stopped=M.stopped=!0,v.hovered.size&&Array.from(v.hovered.values()).find(O=>O.eventObject===A.eventObject))){const O=h.slice(0,h.indexOf(A));u([...O,A])}},target:{hasPointerCapture:C,setPointerCapture:L,releasePointerCapture:D},currentTarget:{hasPointerCapture:C,setPointerCapture:L,releasePointerCapture:D},sourceEvent:d,nativeEvent:d};if(y(B),M.stopped===!0)break}}return h}function u(h){const{internal:d}=r.getState();Array.from(d.hovered.values()).forEach(g=>{if(!h.length||!h.find(y=>y.object===g.object&&y.index===g.index&&y.instanceId===g.instanceId)){const _=g.eventObject.__r3f,w=_==null?void 0:_.handlers;if(d.hovered.delete(_h(g)),_!=null&&_.eventCount){const x={...g,intersections:h||[]};w.onPointerOut==null||w.onPointerOut(x),w.onPointerLeave==null||w.onPointerLeave(x)}}})}const f=h=>{switch(h){case"onPointerLeave":case"onPointerCancel":return()=>u([]);case"onLostPointerCapture":return d=>{const{internal:g}=r.getState();"pointerId"in d&&!g.capturedMap.has(d.pointerId)&&(g.capturedMap.delete(
3033d.pointerId),u([]))}}return d=>{const{onPointerMissed:g,internal:y}=r.getState();t(d),y.lastEvent.current=d;const _=h==="onPointerMove",w=h==="onClick"||h==="onContextMenu"||h==="onDoubleClick",v=o(s(_?i:void 0),d),E=w?n(d):0;h==="onPointerDown"&&(y.initialClick=[d.offsetX,d.offsetY],y.initialHits=v.map(M=>M.eventObject)),w&&!v.length&&E<=2&&(p(d,y.interaction),g&&g(d)),_&&u(v),a(v,d,E,M=>{const A=M.eventObject,C=A.__r3f,L=C==null?void 0:C.handlers;if(!!(C!=null&&C.eventCount))if(_){if(L.onPointerOver||L.onPointerEnter||L.onPointerOut||L.onPointerLeave){const D=_h(M),k=y.hovered.get(D);k?k.stopped&&M.stopPropagation():(y.hovered.set(D,M),L.onPointerOver==null||L.onPointerOver(M),L.onPointerEnter==null||L.onPointerEnter(M))}L.onPointerMove==null||L.onPointerMove(M)}else{const D=L[h];D?(!w||y.initialHits.includes(A))&&(p(d,y.interaction.filter(k=>!y.initialHits.includes(k))),D(M)):w&&y.initialHits.includes(A)&&p(d,y.interaction.filter(k=>!y.initialHits.includes(k)))}})}};function p(h,d){d.forEach(g=>{var y;return(y=g.__r3f)==null||y.handlers.onPointerMissed==null?void 0:y.handlers.onPointerMissed(h)})}return{handlePointer:f}}const c3=r=>r&&!!r.memoized&&!!r.changes,Xu=r=>r&&!!r.getState,bh=(r,e)=>{var t,n;return{root:Xu(r)?r:(t=(n=r.__r3f)==null?void 0:n.root)!=null?t:e.__r3f.root,container:Xu(r)?r.getState().scene:r}},Qy="__default",u3={};let f3={};function d3(r,e){return!!(Ct.arr(r)&&Ct.equ(r,e)||r===e)}function Ro(r,e){const t=r;return(e!=null&&e.primitive||!t.__r3f)&&(t.__r3f={root:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e}),r}function h3(r){function e(d,{children:g,key:y,ref:_,...w},{children:x,key:v,ref:E,...M}={},A=!1){var C;const L=(C=d==null?void 0:d.__r3f)!=null?C:{},D=Object.entries(w),k=[];if(A){const T=Object.keys(M);for(let O=0;O<T.length;O++)w.hasOwnProperty(T[O])||D.unshift([T[O],Qy+"remove"])}D.forEach(([T,O])=>{var H;if((H=d.__r3f)!=null&&H.primitive&&T==="object"||d3(O,M[T]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(T))return k.push([T,O,!0,[]]);let W=[];T.includes("-")&&(W=T.split("-")),k.push([T,O,!1,W])});const B={...w};return L.memoizedProps&&L.memoizedProps.args&&(B.args=L.memoizedProps.args),L.memoizedProps&&L.memoizedProps.attach&&(B.attach=L.memoizedProps.attach),{accumulative:A,memoized:B,changes:k}}function t(d,g){var y,_,w;const x=(y=d==null?void 0:d.__r3f)!=null?y:{},v=x.root,E=(_=v==null||v.getState==null?void 0:v.getState())!=null?_:{},{memoized:M,changes:A}=c3(g)?g:e(d,g),C=x.eventCount;if(d.__r3f&&(d.__r3f.memoizedProps=M),A.forEach(([L,D,k,B])=>{var T;let O=d,H=O[L];if(B.length&&(H=B.reduce((V,j)=>V[j],d),!(H&&H.set))){const[V,...j]=B.reverse();O=j.reverse().reduce((Z,ne)=>Z[ne],d),L=V}if(D===Qy+"remove")if(H&&H.constructor)D=new H.constructor(M.args);else if(O.constructor){const V=new O.constructor(O.__r3f.memoizedProps.args);D=V[H],V.dispose&&V.dispose()}else D=0;const W=(E==null||(T=E.gl)==null?void 0:T.outputEncoding)===Kn;if(k)D?x.handlers[L]=D:delete x.handlers[L],x.eventCount=Object.keys(x.handlers).length;else if(H&&H.set&&(H.copy||H instanceof bs)){if(Array.isArray(D))H.fromArray?H.fromArray(D):H.set(...D);else if(H.copy&&D&&D.constructor&&H.constructor.name===D.constructor.name)H.copy(D);else if(D!==void 0){const V=H instanceof Ae;!V&&H.setScalar?H.setScalar(D):H instanceof bs&&D instanceof bs?H.mask=D.mask:H.set(D),!W&&V&&H.convertSRGBToLinear()}}else O[L]=D,!W&&O[L]instanceof nn&&(O[L].encoding=Rt);n(d)}),x.parent&&E.internal&&d.raycast&&C!==x.eventCount){const L=E.internal.interaction.indexOf(d);L>-1&&E.internal.interaction.splice(L,1),x.eventCount&&E.internal.interaction.push(d)}return A.length&&(w=d.__r3f)!=null&&w.parent&&i(d),d}function n(d){var g,y;const _=(g=d.__r3f)==null||(y=g.root)==null||y.getState==null?void 0:y.getState();
3033_&&_.internal.frames===0&&_.invalidate()}function i(d){d.onUpdate==null||d.onUpdate(d)}function s(d,{args:g=[],...y},_,w,x){let v=`${d[0].toUpperCase()}${d.slice(1)}`,E;if(!Xu(_)&&x){const M=A=>A.return?M(A.return):A.stateNode&&A.stateNode.containerInfo;_=M(x)}if(!_||!Xu(_))throw`No valid root for ${v}!`;if(d==="primitive"){if(y.object===void 0)throw"Primitives without 'object' are invalid!";const M=y.object;E=Ro(M,{root:_,primitive:!0})}else{const M=f3[v]||Y2[v];if(!M)throw`${v} is not part of the THREE namespace! Did you forget to extend? See: https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#using-3rd-party-objects-declaratively`;if(!Array.isArray(g))throw"The args prop must be an array!";E=Ro(new M(...g),{root:_,memoizedProps:{args:g.length===0?null:g}})}return"attachFns"in y||(v.endsWith("Geometry")?y={attach:"geometry",...y}:v.endsWith("Material")&&(y={attach:"material",...y})),t(E,y),E}function o(d,g){let y=!1;if(g){if(g.attachArray)Ct.arr(d[g.attachArray])||(d[g.attachArray]=[]),d[g.attachArray].push(g);else if(g.attachObject)Ct.obj(d[g.attachObject[0]])||(d[g.attachObject[0]]={}),d[g.attachObject[0]][g.attachObject[1]]=g;else if(g.attach&&!Ct.fun(g.attach))d[g.attach]=g;else if(Ct.arr(g.attachFns)){const[_]=g.attachFns;Ct.str(_)&&Ct.fun(d[_])?d[_](g):Ct.fun(_)&&_(g,d)}else g.isObject3D&&d.isObject3D&&(d.add(g),y=!0);y||d.__r3f.objects.push(g),g.__r3f||Ro(g,{}),g.__r3f.parent=d,i(g),n(g)}}function a(d,g,y){let _=!1;if(g){if(g.attachArray){const w=d[g.attachArray];Ct.arr(w)||(d[g.attachArray]=[]),w.splice(w.indexOf(y),0,g)}else{if(g.attachObject||g.attach&&!Ct.fun(g.attach))return o(d,g);if(g.isObject3D&&d.isObject3D){g.parent=d,g.dispatchEvent({type:"added"});const w=d.children.filter(v=>v!==g),x=w.indexOf(y);d.children=[...w.slice(0,x),g,...w.slice(x)],_=!0}}_||d.__r3f.objects.push(g),g.__r3f||Ro(g,{}),g.__r3f.parent=d,i(g),n(g)}}function u(d,g,y=!1){d&&[...d].forEach(_=>f(g,_,y))}function f(d,g,y){if(g){var _,w;if(g.__r3f&&(g.__r3f.parent=null),(_=d.__r3f)!=null&&_.objects&&(d.__r3f.objects=d.__r3f.objects.filter(A=>A!==g)),g.attachArray)d[g.attachArray]=d[g.attachArray].filter(A=>A!==g);else if(g.attachObject)delete d[g.attachObject[0]][g.attachObject[1]];else if(g.attach&&!Ct.fun(g.attach)&&d[g.attach]===g)d[g.attach]=null;else if(Ct.arr(g.attachFns)){const[,A]=g.attachFns;Ct.str(A)&&Ct.fun(d[A])?d[A](g):Ct.fun(A)&&A(g,d)}else if(g.isObject3D&&d.isObject3D){var x;d.remove(g),(x=g.__r3f)!=null&&x.root&&a3(g.__r3f.root,g)}const E=(w=g.__r3f)==null?void 0:w.primitive,M=y===void 0?g.dispose!==null&&!E:y;if(!E){var v;u((v=g.__r3f)==null?void 0:v.objects,g,M),u(g.children,g,M)}g.__r3f&&(delete g.__r3f.root,delete g.__r3f.objects,delete g.__r3f.handlers,delete g.__r3f.memoizedProps,E||delete g.__r3f),M&&g.dispose&&g.type!=="Scene"&&Ou.exports.unstable_runWithPriority(Ou.exports.unstable_IdlePriority,()=>{try{g.dispose()}catch{}}),n(d)}}function p(d,g,y,_){var w;const x=(w=d.__r3f)==null?void 0:w.parent;if(!x)return;const v=s(g,y,d.__r3f.root);g!=="primitive"&&d.children&&(d.children.forEach(E=>o(v,E)),d.children=[]),d.__r3f.objects.forEach(E=>o(v,E)),d.__r3f.objects=[],f(x,d),o(x,v),v.raycast&&v.__r3f.eventCount&&v.__r3f.root.getState().internal.interaction.push(v),[_,_.alternate].forEach(E=>{E!==null&&(E.stateNode=v,E.ref&&(typeof E.ref=="function"?E.ref(v):E.ref.current=v))})}return{reconciler:Q2({now:Ou.exports.unstable_now,createInstance:s,removeChild:f,appendChild:o,appendInitialChild:o,insertBefore:a,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,scheduleTimeout:Ct.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Ct.fun(clearTimeout)?clearTimeout:void 0,setTimeout:Ct.fun(setTimeout)?setTimeout:void 0,clearTimeout:Ct.fun(clearTimeout)?clearTimeout:void 0,noTimeout:-1,appendChildToContainer:(d,g)=>{const{container:y,root:_}=bh(d,g);y.__r3f.root=_,o(y,g)},removeChildFromContainer:(d,g)=>f(bh(d,g).container,g),insertInContainerBefore:(d,g,y)=>a(bh(d,g).container,g,y),prepareUpdate(d,g,y,_){if(d.__r3f.primitive&&_.object&&_.object!==d)return[!0];{const{args:w=[],children:x,...v}=_,{args:E=[],children:M,...A}=y;if(!Array.isArray(w))throw"The args prop must be an array!";if(w.some((L,D)=>L!==E[D]))return[!0];const C=e(d,v,A,!0);if(C.changes.length)return[!1,C];if(d.attach&&typeof d.attach!="function"){const D=d.__r3f.parent;D&&D[d.attach]!==d&&o(D,d)}return null}},commitUpdate(d,[g,y],_,w,x,v){g?p(d,_,x,v):t(d,y)},hideInstance(d){d.isObject3D&&(d.visible=!1,n(d))},unhideInstance(d,g){(d.isObject3D&&g.visible==null||g.visible)&&(d.visible=!0,n(d))},hideTextInstance(){throw new Error("Text is not allowed in the R3F tree.")},getPublicInstance(d){return d},getRootHostContext(d){return u3},getChildHostContext(d){return d},createTextInstance(){},finalizeInitialChildren(d){var g;return!!((g=d==null?void 0:d.__r3f)!=null?g:{}).handlers},commitMount(d){var g;const y=(g=d==null?void 0:d.__r3f)!=null?g:{};d.raycast&&y.handlers&&y.eventCount&&d.__r3f.root.getState().internal.interaction.push(d)},shouldDeprioritizeSubtree(){return!1},prepareForCommit(){return null},preparePortalMount(d){Ro(d)},resetAfterCommit(){},shouldSetTextContent(){return!1},clearContainer(){return!1}}),applyProps:t}}const p3=r=>!!(r!=null&&r.render),ev=r=>r&&r.isOrthographicCamera;function _p(r){return Array.isArray(r)?Math.min(Math.max(r[0],window.devicePixelRatio),r[1]):r}const Hb=R.exports.createContext(null),m3=(r,e,t,n)=>{const{gl:i,size:s,shadows:o=!1,linear:a=!1,flat:u=!1,vr:f=!1,orthographic:p=!1,frameloop:h="always",dpr:d=1,performance:g,clock:y=new zm,raycaster:_,camera:w,onPointerMissed:x}=n;o&&(i.shadowMap.enabled=!0,typeof o=="object"?Object.assign(i.shadowMap,o):i.shadowMap.type=qp),a&&(i.outputEncoding=Kn),u&&(i.toneMapping=Fr),h==="never"&&(y.stop(),y.elapsedTime=0);const v=K2((C,L)=>{const D=new Rb,{params:k,...B}=_||{};r(D,{enabled:!0,...B,params:{...D.params,...k}});const T=w instanceof Rs,O=T?w:p?new Ji(0,0,0,0,.1,1e3):new Qt(75,0,.1,1e3);T||(O.position.z=5,w&&r(O,w),w!=null&&w.rotation||O.lookAt(0,0,0));const H=_p(d),W=new F,V=new F,j=new F;function Z(Y=L().camera,ee=V,ue=L().size){const{width:ye,height:xe}=ue,re=ye/xe;ee instanceof F?j.copy(ee):j.set(...ee);const Xe=Y.getWorldPosition(W).distanceTo(j);if(ev(Y))return{width:ye/Y.zoom,height:xe/Y.zoom,factor:1,distance:Xe,aspect:re};{const Le=Y.fov*Math.PI/180,Be=2*Math.tan(Le/2)*Xe,Me=Be*(ye/xe);return{width:Me,height:Be,factor:ye/Me,distance:Xe,aspect:re}}}let ne;const ge=Y=>C(ee=>({performance:{...ee.performance,current:Y}}));return{gl:i,set:C,get:L,invalidate:()=>e(L()),advance:(Y,ee)=>t(Y,ee,L()),linear:a,flat:u,scene:Ro(new aa),camera:O,controls:null,raycaster:D,clock:y,mouse:new de,vr:f,frameloop:h,onPointerMissed:x,performance:{current:1,min:.5,max:1,debounce:200,...g,regress:()=>{const Y=L();ne&&clearTimeout(ne),Y.performance.current!==Y.performance.min&&ge(Y.performance.min),ne=setTimeout(()=>ge(L().performance.max),Y.performance.debounce)}}
3033,size:{width:0,height:0},viewport:{initialDpr:H,dpr:H,width:0,height:0,aspect:0,distance:0,factor:0,getCurrentViewport:Z},setSize:(Y,ee)=>{const ue={width:Y,height:ee};C(ye=>({size:ue,viewport:{...ye.viewport,...Z(O,V,ue)}}))},setDpr:Y=>C(ee=>({viewport:{...ee.viewport,dpr:_p(Y)}})),setFrameloop:(Y="always")=>C(()=>({frameloop:Y})),events:{connected:!1},internal:{active:!1,priority:0,frames:0,lastProps:n,lastEvent:R.exports.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(Y,ee=0)=>(C(({internal:ue})=>({internal:{...ue,priority:ue.priority+(ee>0?1:0),subscribers:[...ue.subscribers,{ref:Y,priority:ee}].sort((ye,xe)=>ye.priority-xe.priority)}})),()=>{C(({internal:ue})=>({internal:{...ue,priority:ue.priority-(ee>0?1:0),subscribers:ue.subscribers.filter(ye=>ye.ref!==Y)}}))})}}}),E=v.getState();let M=E.size,A=E.viewport.dpr;return v.subscribe(()=>{const{camera:C,size:L,viewport:D,internal:k}=v.getState();(L!==M||D.dpr!==A)&&(!C.manual&&!(k.lastProps.camera instanceof Rs)&&(ev(C)?(C.left=L.width/-2,C.right=L.width/2,C.top=L.height/2,C.bottom=L.height/-2):C.aspect=L.width/L.height,C.updateProjectionMatrix(),C.updateMatrixWorld()),i.setPixelRatio(D.dpr),i.setSize(L.width,L.height),M=L,A=D.dpr)}),s&&E.setSize(s.width,s.height),v.subscribe(C=>e(C)),v};let zi,tv=[],nv=[],g3=[];function Xa(r,e){for(zi=0;zi<r.length;zi++)r[zi](e)}function wh(r,e){let t=e.clock.getDelta();for(e.frameloop==="never"&&typeof r=="number"&&(t=r-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=r),zi=0;zi<e.internal.subscribers.length;zi++)e.internal.subscribers[zi].ref.current(e,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 y3(r){let e=!1,t;function n(o){if(e=!0,t=0,Xa(tv,o),r.forEach(a=>{const u=a.store.getState();u.internal.active&&(u.frameloop==="always"||u.internal.frames>0)&&(t+=wh(o,u))}),Xa(nv,o),t>0)return requestAnimationFrame(n);Xa(g3,o),e=!1}function i(o){if(!o)return r.forEach(a=>i(a.store.getState()));o.vr||!o.internal.active||o.frameloop==="never"||(o.internal.frames=Math.min(60,o.internal.frames+1),e||(e=!0,requestAnimationFrame(n)))}function s(o,a=!0,u){a&&Xa(tv,o),u?wh(o,u):r.forEach(f=>wh(o,f.store.getState())),a&&Xa(nv,o)}return{loop:n,invalidate:i,advance:s}}function v3(r){const{handlePointer:e}=l3(r),t={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]};return{connected:!1,handlers:Object.keys(t).reduce((n,i)=>({...n,[i]:e(i)}),{}),connect:n=>{var i;const{set:s,events:o}=r.getState();o.disconnect==null||o.disconnect(),s(a=>({events:{...a.events,connected:n}})),Object.entries((i=o==null?void 0:o.handlers)!=null?i:[]).forEach(([a,u])=>{const[f,p]=t[a];n.addEventListener(f,u,{passive:p})})},disconnect:()=>{const{set:n,events:i}=r.getState();if(i.connected){var s;Object.entries((s=i.handlers)!=null?s:[]).forEach(([o,a])=>{if(i&&i.connected instanceof HTMLElement){const[u]=t[o];i.connected.removeEventListener(u,a)}}),n(o=>({events:{...o.events,connected:!1}}))}}}}const bp=typeof window!="undefined"?R.exports.useLayoutEffect:R.exports.useEffect;function x3({set:r}){return bp(()=>(r(new Promise(()=>null)),()=>r(!1)),[]),null}class Gb extends R.exports.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}Gb.getDerivedStateFromError=()=>({error:!0});const _3=R.exports.forwardRef(function({children:e,fallback:t,tabIndex:n,resize:i,id:s,style:o,className:a,events:u,...f},p){const h=w3(f.onPointerMissed),[d,{width:g,height:y}]=n3({scroll:!0,debounce:{scroll:50,resize:0},...i}),_=R.exports.useRef(null),[w,x]=R.exports.useState(!1),[v,E]=R.exports.useState(!1);if(w)throw w;if(v)throw v;return bp(()=>{g>0&&y>0&&E3(R.exports.createElement(Gb,{set:E},R.exports.createElement(R.exports.Suspense,{fallback:R.exports.createElement(x3,{set:x})},e)),_.current,{...f,size:{width:g,height:y},onPointerMissed:h,events:u||v3})},[g,y,e,h]),bp(()=>{const M=_.current;return()=>qb(M)},[]),R.exports.createElement("div",{ref:d,id:s,className:a,tabIndex:n,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",...o}},R.exports.createElement("canvas",{ref:t3([_,p]),style:{display:"block"}},t))});function Vb(){const r=R.exports.useContext(Hb);if(!r)throw"R3F hooks can only be used within the Canvas component!";return r}function ri(r=t=>t,e){return Vb()(r,e)}function Wb(r,e=0){const t=Vb().getState().internal.subscribe,n=R.exports.useRef(r);return R.exports.useLayoutEffect(()=>void(n.current=r),[r]),R.exports.useLayoutEffect(()=>t(n,e),[e,t]),null}function b3(r){const e={nodes:{},materials:{}};return r&&r.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function $b(r,e){return function(t,...n){const i=new t;return r&&r(i),Promise.all(n.map(s=>new Promise((o,a)=>i.load(s,u=>{u.scene&&Object.assign(u,b3(u.scene)),o(u)},e,u=>a(`Could not load ${s}: ${u.message}`)))))}}function w3(r){const e=R.exports.useRef(r);return R.exports.useLayoutEffect(()=>void(e.current=r),[r]),(...t)=>e.current==null?void 0:e.current(...t)}function Gm(r,e,t,n){const i=Array.isArray(e)?e:[e],s=di($b(t,n),r,...i);
3033return Array.isArray(e)?s:s[0]}Gm.preload=function(r,e,t){const n=Array.isArray(e)?e:[e];return di.preload($b(t),r,...n)};Gm.clear=function(r,e){const t=Array.isArray(e)?e:[e];return di.clear(r,...t)};const Tl=new Map,rv=["legacy","blocking","concurrent"],{invalidate:S3,advance:iv}=y3(Tl),{reconciler:ea,applyProps:jb}=h3(),M3=(r,e)=>{const t=typeof r=="function"?r(e):r;if(p3(t))return t;const n=new St({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...r});return n.outputEncoding=Rt,n.toneMapping=Zp,r&&jb(n,r),n};function E3(r,e,{gl:t,size:n,mode:i=rv[1],events:s,onCreated:o,...a}={}){var u;if(!n){var f,p,h,d;n={width:(f=(p=e.parentElement)==null?void 0:p.clientWidth)!=null?f:0,height:(h=(d=e.parentElement)==null?void 0:d.clientHeight)!=null?h:0}}let g=Tl.get(e),y=g==null?void 0:g.fiber,_=g==null?void 0:g.store,w=(u=_)==null?void 0:u.getState();if(y&&w&&(a.dpr!==void 0&&!Ct.equ(w.viewport.dpr,_p(a.dpr))&&w.setDpr(a.dpr),(w.size.width!==n.width||w.size.height!==n.height)&&w.setSize(n.width,n.height),w.frameloop!==a.frameloop&&w.setFrameloop(a.frameloop),a.linear!==w.internal.lastProps.linear&&(qb(e),y=void 0)),!y){const x=M3(t,e);a.vr&&(x.xr.enabled=!0,x.setAnimationLoop(E=>iv(E,!0))),_=m3(jb,S3,iv,{gl:x,size:n,...a});const v=_.getState();y=ea.createContainer(_,rv.indexOf(i),!1,null),Tl.set(e,{fiber:y,store:_}),s&&v.set({events:s(_)})}if(_&&y)return ea.updateContainer(R.exports.createElement(T3,{store:_,element:r,onCreated:o,target:e}),y,null,()=>{}),_;throw"Error creating root!"}function T3({store:r,element:e,onCreated:t,target:n}){return R.exports.useEffect(()=>{const i=r.getState();i.set(s=>({internal:{...s.internal,active:!0}})),i.events.connect==null||i.events.connect(n),t&&t(i)},[]),R.exports.createElement(Hb.Provider,{value:r},e)}function qb(r,e){const t=Tl.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),ea.updateContainer(null,n,null,()=>{i&&setTimeout(()=>{var s,o,a;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),A3(i),Tl.delete(r),e&&e(r)},500)})}}function A3(r){r.dispose&&r.type!=="Scene"&&r.dispose();for(const e in r)e.dispose==null||e.dispose(),delete r[e]}ea.act;function R3(r,e){return ea.createPortal(r,e,null,null)}ea.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:"17.0.2"});function jt(){return jt=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},jt.apply(null,arguments)}const Ul=new F,Vm=new F,C3=new F;function P3(r,e,t){const n=Ul.setFromMatrixPosition(r.matrixWorld);n.project(e);const i=t.width/2,s=t.height/2;return[n.x*i+i,-(n.y*s)+s]}function L3(r,e){const t=Ul.setFromMatrixPosition(r.matrixWorld),n=Vm.setFromMatrixPosition(e.matrixWorld),i=t.sub(n),s=e.getWorldDirection(C3);return i.angleTo(s)>Math.PI/2}function I3(r,e,t,n){const i=Ul.setFromMatrixPosition(r.matrixWorld),s=i.clone();s.project(e),t.setFromCamera(s,e);const o=t.intersectObjects(n,!0);if(o.length){const a=o[0].distance;return i.distanceTo(t.ray.origin)<a}return!0}function D3(r,e){if(e instanceof Ji)return e.zoom;if(e instanceof Qt){const t=Ul.setFromMatrixPosition(r.matrixWorld),n=Vm.setFromMatrixPosition(e.matrixWorld),i=e.fov*Math.PI/180,s=t.distanceTo(n),o=2*Math.tan(i/2)*s;return 1/o}else return 1}function O3(r,e,t){if(e instanceof Qt||e instanceof Ji){const n=Ul.setFromMatrixPosition(r.matrixWorld),i=Vm.setFromMatrixPosition(e.matrixWorld),s=n.distanceTo(i),o=(t[1]-t[0])/(e.far-e.near),a=t[1]-o*e.far;return Math.round(o*s+a)}}const wp=r=>Math.abs(r)<1e-10?0:r;function Xb(r,e,t=""){let n="matrix3d(";for(let i=0;i!==16;i++)n+=wp(e[i]*r.elements[i])+(i!==15?",":")");return t+n}const F3=(r=>e=>Xb(e,r))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),B3=(r=>(e,t)=>Xb(e,r(t),"translate(-50%,-50%)"))(r=>[1/r,1/r,1/r,1,-1/r,-1/r,-1/r,-1,1/r,1/r,1/r,1,1,1,1,1]),z3=R.exports.forwardRef(({children:r,eps:e=.001,style:t,className:n,prepend:i,center:s,fullscreen:o,portal:a,distanceFactor:u,sprite:f=!1,transform:p=!1,occlude:h,onOcclude:d,zIndexRange:g=[16777271,0],calculatePosition:y=P3,as:_="div",wrapperClass:w,pointerEvents:x="auto",...v},E)=>{var M;const A=ri(({gl:Y})=>Y),C=ri(({camera:Y})=>Y),L=ri(({scene:Y})=>Y),D=ri(({size:Y})=>Y),k=ri(({raycaster:Y})=>Y),[B]=R.exports.useState(()=>document.createElement(_)),T=R.exports.useRef(null),O=R.exports.useRef(0),H=R.exports.useRef([0,0]),W=R.exports.useRef(null),V=R.exports.useRef(null),j=(M=a==null?void 0:a.current)!==null&&M!==void 0?M:A.domElement.parentNode;R.exports.useEffect(()=>{if(T.current){if(L.updateMatrixWorld(),p)B.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const Y=y(T.current,C,D);B.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${Y[0]}px,${Y[1]}px,0);transform-origin:0 0;`}
3033return j&&(i?j.prepend(B):j.appendChild(B)),()=>{j&&j.removeChild(B),kd.exports.unmountComponentAtNode(B)}}},[j,p]),R.exports.useLayoutEffect(()=>{w&&(B.className=w)},[w]);const Z=R.exports.useMemo(()=>p?{position:"absolute",top:0,left:0,width:D.width,height:D.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-D.height/2,left:-D.width/2,width:D.width,height:D.height},...t},[t,s,o,D,p]),ne=R.exports.useMemo(()=>({position:"absolute",pointerEvents:x}),[x]);R.exports.useLayoutEffect(()=>{p?kd.exports.render(R.exports.createElement("div",{ref:W,style:Z},R.exports.createElement("div",{ref:V,style:ne},R.exports.createElement("div",{ref:E,className:n,style:t,children:r}))),B):kd.exports.render(R.exports.createElement("div",{ref:E,style:Z,className:n,children:r}),B)});const ge=R.exports.useRef(!0);return Wb(()=>{if(T.current){C.updateMatrixWorld(),T.current.updateWorldMatrix(!0,!1);const Y=p?H.current:y(T.current,C,D);if(p||Math.abs(O.current-C.zoom)>e||Math.abs(H.current[0]-Y[0])>e||Math.abs(H.current[1]-Y[1])>e){const ee=L3(T.current,C);let ue=!1;typeof h=="boolean"?h===!0&&(ue=[L]):Array.isArray(h)&&(ue=h.map(xe=>xe.current));const ye=ge.current;if(ue){const xe=I3(T.current,C,k,ue);ge.current=xe&&!ee}else ge.current=!ee;if(ye!==ge.current&&(d?d(!ge.current):B.style.display=ge.current?"block":"none"),B.style.zIndex=`${O3(T.current,C,g)}`,p){const[xe,re]=[D.width/2,D.height/2],Xe=C.projectionMatrix.elements[5]*re,{isOrthographicCamera:Le,top:Be,left:Me,bottom:et,right:Ve}=C,le=F3(C.matrixWorldInverse),me=Le?`scale(${Xe})translate(${wp(-(Ve+Me)/2)}px,${wp((Be+et)/2)}px)`:`translateZ(${Xe}px)`;let he=T.current.matrixWorld;f&&(he=C.matrixWorldInverse.clone().transpose().copyPosition(he).scale(T.current.scale),he.elements[3]=he.elements[7]=he.elements[11]=0,he.elements[15]=1),B.style.width=D.width+"px",B.style.height=D.height+"px",B.style.perspective=Le?"":`${Xe}px`,W.current&&V.current&&(W.current.style.transform=`${me}${le}translate(${xe}px,${re}px)`,V.current.style.transform=B3(he,1/((u||10)/400)))}else{const xe=u===void 0?1:D3(T.current,C)*u;B.style.transform=`translate3d(${Y[0]}px,${Y[1]}px,0) scale(${xe})`}H.current=Y,O.current=C.zoom}}}),R.exports.createElement("group",jt({},v,{ref:T}))});function N3(r){let e;const t=new Set,n=(f,p)=>{const h=typeof f=="function"?f(e):f;if(h!==e){const d=e;e=p?h:Object.assign({},e,h),t.forEach(g=>g(e,d))}},i=()=>e,s=(f,p=i,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=p(e);function g(){const y=p(e);if(!h(d,y)){const _=d;f(d=y,_)}}return t.add(g),()=>t.delete(g)},u={setState:n,getState:i,subscribe:(f,p,h)=>p||h?s(f,p,h):(t.add(f),()=>t.delete(f)),destroy:()=>t.clear()};return e=r(n,i,u),u}const k3=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),sv=k3?R.exports.useEffect:R.exports.useLayoutEffect;function U3(r){const e=typeof r=="function"?N3(r):r,t=(n=e.getState,i=Object.is)=>{const[,s]=R.exports.useReducer(w=>w+1,0),o=e.getState(),a=R.exports.useRef(o),u=R.exports.useRef(n),f=R.exports.useRef(i),p=R.exports.useRef(!1),h=R.exports.useRef();h.current===void 0&&(h.current=n(o));let d,g=!1;(a.current!==o||u.current!==n||f.current!==i||p.current)&&(d=n(o),g=!i(h.current,d)),sv(()=>{g&&(h.current=d),a.current=o,u.current=n,f.current=i,p.current=!1});const y=R.exports.useRef(o);sv(()=>{const w=()=>{try{const v=e.getState(),E=u.current(v);f.current(h.current,E)||(a.current=v,h.current=E,s())}catch{p.current=!0,s()}},x=e.subscribe(w);return e.getState()!==y.current&&w(),x},[]);const _=g?d:h.current;return R.exports.useDebugValue(_),_};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}let Ya=0;const H3=U3(r=>(Io.onStart=(e,t,n)=>{r({active:!0,item:e,loaded:t,total:n,progress:(t-Ya)/(n-Ya)*100})},Io.onLoad=()=>{r({active:!1})},Io.onError=e=>r(t=>({errors:[...t.errors,e]})),Io.onProgress=(e,t,n)=>{t===n&&(Ya=n),r({active:!0,item:e,loaded:t,total:n,progress:(t-Ya)/(n-Ya)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0}));function G3(r,e,t){return Math.max(e,Math.min(r,t))}const An={toVector(r,e){return r===void 0&&(r=e),Array.isArray(r)?r:[r,r]},add(r,e){return[r[0]+e[0],r[1]+e[1]]},sub(r,e){return[r[0]-e[0],r[1]-e[1]]},addTo(r,e){r[0]+=e[0],r[1]+=e[1]},subTo(r,e){r[0]-=e[0],r[1]-=e[1]}};function ov(r,e,t){return e===0||Math.abs(e)===1/0?Math.pow(r,t*5):r*e*t/(e+t*r)}function av(r,e,t,n=.15){return n===0?G3(r,e,t):r<e?-ov(e-r,t-e,n)+e:r>t?+ov(r-t,t-e,n)+t:r}function V3(r,[e,t],[n,i]){const[[s,o],[a,u]]=r;return[av(e,s,o,n),av(t,a,u,i)]}function Gn(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function lv(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function tn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
vendor: 8,140 bytes, line 3033
3033e%2?lv(Object(t),!0).forEach(function(n){Gn(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):lv(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}const Yb={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function cv(r){return r?r[0].toUpperCase()+r.slice(1):""}function W3(r,e="",t=!1){const n=Yb[r],i=n&&n[e]||e;return"on"+cv(r)+cv(i)+(t?"Capture":"")}const $3=["gotpointercapture","lostpointercapture"];function j3(r){let e=r.substring(2).toLowerCase();const t=!!~e.indexOf("passive");t&&(e=e.replace("passive",""));const n=$3.includes(e)?"capturecapture":"capture",i=!!~e.indexOf(n);return i&&(e=e.replace("capture","")),{device:e,capture:i,passive:t}}function q3(r,e=""){const t=Yb[r],n=t&&t[e]||e;return r+n}function Pf(r){return"touches"in r}function Jb(r){return Pf(r)?"touch":"pointerType"in r?r.pointerType:"mouse"}function X3(r){return Array.from(r.touches).filter(e=>{var t,n;return e.target===r.currentTarget||((t=r.currentTarget)===null||t===void 0||(n=t.contains)===null||n===void 0?void 0:n.call(t,e.target))})}function Y3(r){return r.type==="touchend"||r.type==="touchcancel"?r.changedTouches:r.targetTouches}function Zb(r){return Pf(r)?Y3(r)[0]:r}function J3(r){return X3(r).map(e=>e.identifier)}function Sh(r){const e=Zb(r);return Pf(r)?e.identifier:e.pointerId}function uv(r){const e=Zb(r);return[e.clientX,e.clientY]}function Z3(r){const e={};if("buttons"in r&&(e.buttons=r.buttons),"shiftKey"in r){const{shiftKey:t,altKey:n,metaKey:i,ctrlKey:s}=r;Object.assign(e,{shiftKey:t,altKey:n,metaKey:i,ctrlKey:s})}return e}function Yu(r,...e){return typeof r=="function"?r(...e):r}function K3(){}function Q3(...r){return r.length===0?K3:r.length===1?r[0]:function(){let e;for(const t of r)e=t.apply(this,arguments)||e;return e}}function fv(r,e){return Object.assign({},e,r||{})}const eP=32;class tP{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:i}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=i,e.axis=void 0,e.memo=void 0,e.elapsedTime=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?Yu(n.from,t):t.offset,t.offset=t.lastOffset),t.startTime=t.timeStamp=e.timeStamp}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:i}=this;t.args=this.args;let s=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,i.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,i.locked=!!document.pointerLockElement,Object.assign(i,Z3(e)),i.down=i.pressed=i.buttons%2===1||i.touches>0,s=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const C=t._delta.map(Math.abs);An.addTo(t._distance,C)}this.axisIntent&&this.axisIntent(e);const[o,a]=t._movement,[u,f]=n.threshold,{_step:p,values:h}=t;if(n.hasCustomTransform?(p[0]===!1&&(p[0]=Math.abs(o)>=u&&h[0]),p[1]===!1&&(p[1]=Math.abs(a)>=f&&h[1])):(p[0]===!1&&(p[0]=Math.abs(o)>=u&&Math.sign(o)*u),p[1]===!1&&(p[1]=Math.abs(a)>=f&&Math.sign(a)*f)),t.intentional=p[0]!==!1||p[1]!==!1,!t.intentional)return;const d=[0,0];if(n.hasCustomTransform){const[C,L]=h;d[0]=p[0]!==!1?C-p[0]:0,d[1]=p[1]!==!1?L-p[1]:0}else d[0]=p[0]!==!1?o-p[0]:0,d[1]=p[1]!==!1?a-p[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const g=t.offset,y=t._active&&!t._blocked||t.active;y&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=i[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=Yu(n.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[_,w]=t.offset,[[x,v],[E,M]]=t._bounds;t.overflow=[_<x?-1:_>v?1:0,w<E?-1:w>M?1:0],t._movementBound[0]=t.overflow[0]?t._movementBound[0]===!1?t._movement[0]:t._movementBound[0]:!1,t._movementBound[1]=t.overflow[1]?t._movementBound[1]===!1?t._movement[1]:t._movementBound[1]:!1;const A=t._active?n.rubberband||[0,0]:[0,0];if(t.offset=V3(t._bounds,t.offset,A),t.delta=An.sub(t.offset,g),this.computeMovement(),y&&(!t.last||s>eP)){t.delta=An.sub(t.offset,g);const C=t.delta.map(Math.abs);An.addTo(t.distance,C),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&s>0&&(t.velocity=[C[0]/s,C[1]/s])}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const i=this.handler(tn(tn(tn({},t),e),{},{[this.aliasKey]:e.values}));i!==void 0&&(e.memo=i)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function nP([r,e],t){const n=Math.abs(r),i=Math.abs(e);if(n>i&&n>t)return"x";if(i>n&&i>t)return"y"}class rP extends tP{constructor(...e){super(...e),Gn(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=An.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=An.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const i=typeof n.axisThreshold=="object"?n.axisThreshold[Jb(e)]:n.axisThreshold;t.axis=nP(t._movement,i)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const iP=r=>r,dv=.15,Kb={enabled(r=!0){return r},preventDefault(r=!1){return r},triggerAllEvents(r=!1){return r},rubberband(r=0){switch(r){case!0:return[dv,dv];case!1:return[0,0];default:return An.toVector(r)}},from(r){if(typeof r=="function")return r;if(r!=null)return An.toVector(r)},transform(r,e,t){const n=r||t.shared.transform;return this.hasCustomTransform=!!n,n||iP},threshold(r){return An.toVector(r,0)}},sP=0,Hl=tn(tn({},Kb),{},{axis(r,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(r=sP){return r},bounds(r={}){if(typeof r=="function")return s=>Hl.bounds(r(s));if("current"in r)return()=>r.current;if(typeof HTMLElement=="function"&&r instanceof HTMLElement)return r;const{left:e=-1/0,right:t=1/0,top:n=-1/0,bottom:i=1/0}=r;return[[e,t],[n,i]]}}),Au=10,hv={ArrowRight:(r=1)=>[Au*r,0],ArrowLeft:(r=1)=>[-Au*r,0],ArrowUp:(r=1)=>[0,-Au*r],ArrowDown:(r=1)=>[0,Au*r]};class oP extends rP{constructor(...e){super(...e),Gn(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),i={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=Hl.bounds(i)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>
3033{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;e.buttons!=null&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):t.pointerButtons!==-1&&t.pointerButtons!==e.buttons)||(this.ctrl.setEventIds(e),t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!n._pointerActive&&(this.start(e),this.setupPointer(e),n._pointerId=Sh(e),n._pointerActive=!0,this.computeValues(uv(e)),this.computeInitial(),t.preventScrollAxis&&Jb(e)!=="mouse"?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e)))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive||t.type===e.type&&e.timeStamp===t.timeStamp)return;const i=Sh(e);if(t._pointerId!==void 0&&i!==t._pointerId)return;const s=uv(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=An.sub(s,t._values),this.computeValues(s)),An.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(n.preventScrollAxis&&!t._preventScroll)if(t.axis)if(t.axis===n.preventScrollAxis||n.preventScrollAxis==="xy"){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const i=Sh(e);if(t._pointerId!==void 0&&i!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[s,o]=t._distance;if(t.tap=s<=n.tapsThreshold&&o<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[a,u]=t.direction,[f,p]=t.velocity,[h,d]=t.movement,[g,y]=n.swipe.velocity,[_,w]=n.swipe.distance,x=n.swipe.duration;t.elapsedTime<x&&(Math.abs(f)>g&&Math.abs(h)>_&&(t.swipe[0]=a),Math.abs(p)>y&&Math.abs(d)>w&&(t.swipe[1]=u))}this.emit()}pointerClick(e){this.state.tap||(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){aP(e),this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1}),this.eventStore.add(this.sharedConfig.window,"touch","end",this.clean.bind(this)),this.eventStore.add(this.sharedConfig.window,"touch","cancel",this.clean.bind(this)),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=hv[e.key];if(t){const n=this.state,i=e.shiftKey?10:e.altKey?.1:1;n._delta=t(i),this.start(e),n._keyboardActive=!0,An.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in hv&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this)),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function aP(r){"persist"in r&&typeof r.persist=="function"&&r.persist()}const Gl=typeof window!="undefined"&&window.document&&window.document.createElement;function lP(){return Gl&&"ontouchstart"in window}function pv(){return lP()||Gl&&window.navigator.maxTouchPoints>1}function cP(){return Gl&&"onpointerdown"in window}function uP(){return Gl&&"exitPointerLock"in window.document}function fP(){try{return"constructor"in GestureEvent}catch{return!1}}const ur={isBrowser:Gl,gesture:fP(),touch:pv(),touchscreen:pv(),pointer:cP(),pointerLock:uP()},dP=250,hP=180,pP=.5,mP=50,gP=250,mv={mouse:0,touch:0,pen:8},yP=tn(tn({},Hl),{},{device(r,e,{pointer:{touch:t=!1,lock:n=!1,mouse:i=!1}={}}){return this.pointerLock=n&&ur.pointerLock,ur.touch&&t?"touch":this.pointerLock?"mouse":ur.pointer&&!i?"pointer":ur.touch?"touch":"mouse"},preventScrollAxis(r,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&r?dP:void 0,!(!ur.touchscreen||t===!1))return r||(t!==void 0?"y":void 0)},pointerCapture(r,e,{pointer:{capture:t=!0,buttons:n=1}={}}){return this.pointerButtons=n,!this.pointerLock&&this.device==="pointer"&&t},threshold(r,e,{filterTaps:t=!1,tapsThreshold:n=3,axis:i=void 0}){const s=An.toVector(r,t?n:i?1:0);return this.filterTaps=t,this.tapsThreshold=n,s},swipe({velocity:r=pP,distance:e=mP,duration:t=gP}={}){return{velocity:this.transform(An.toVector(r)),distance:this.transform(An.toVector(e)),duration:t}},delay(r=0){switch(r){case!0:return hP;case!1:return 0;default:return r}},axisThreshold(r){return r?tn(tn({},mv),r):mv}});tn(tn({},Kb),{},{device(r,e,{shared:t,pointer:{touch:n=!1}={}}){if(t.target&&!ur.touch&&ur.gesture)return"gesture";if(ur.touch&&n)return"touch";if(ur.touchscreen){if(ur.pointer)return"pointer";if(ur.touch)return"touch"}},bounds(r,e,{scaleBounds:t={},angleBounds:n={}}){const i=o=>{const a=fv(Yu(t,o),{min:-1/0,max:1/0});return[a.min,a.max]},s=o=>{const a=fv(Yu(n,o),{min:-1/0,max:1/0});return[a.min,a.max]};return typeof t!="function"&&typeof n!="function"?[i(),s()]:o=>[i(o),s(o)]},threshold(r,e,t){return this.lockDirection=t.axis==="lock",An.toVector(r,this.lockDirection?[.1,3]:0)},modifierKey(r){return r===void 0?"ctrlKey":r}});tn(tn({},Hl),{},{mouseOnly:(r=!0)=>r});tn(tn({},Hl),{},{mouseOnly:(r=!0)=>r});const Qb=new Map,Sp=new Map;function vP(r){Qb.set(r.key,r.engine),Sp.set(r.key,r.resolver)}const xP={key:"drag",engine:oP,resolver:yP};function _P(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function bP(r,e){if(r==null)return{};var t=_P(r,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(r,n)||(t[n]=r[n]))}return t}const wP={target(r){if(r)return()=>"current"in r?r.current:r},enabled(r=!0){return r},window(r=ur.isBrowser?window:void 0){return r},eventOptions({passive:r=!0,capture:e=!1}={}){return{passive:r,capture:e}},transform(r){return r}},SP=["target","eventOptions","window","enabled","transform"];function Hu(r={},e){const t={};for(const[n,i]of Object.entries(e))switch(typeof i){case"function":t[n]=i.call(t,r[n],n,r);break;case"object":t[n]=Hu(r[n],i);break;case"boolean":i&&(t[n]=r[n]);break}return t}function MP(r,e){const t=r,{target:n,eventOptions:i,window:s,enabled:o,transform:a}=t,u=bP(t,SP),f={shared:Hu({target:n,eventOptions:i,window:s,enabled:o,transform:a},wP)};if(e){const p=Sp.get(e);f[e]=Hu(tn({shared:f.shared},u),p)}else for(const p in u){const h=Sp.get(p);h&&(f[p]=Hu(tn({shared:f.shared},u[p]),h))}return f}class ew{constructor(e){Gn(this,"_listeners",[]),this._ctrl=e}add(e,t,n,i,s){const o=q3(t,n),a=tn(tn({},this._ctrl.config.shared.eventOptions),s);e.addEventListener(o,i,a),this._listeners.push(()=>e.removeEventListener(o,i,a))}
3033clean(){this._listeners.forEach(e=>e()),this._listeners=[]}}class EP{constructor(){Gn(this,"_timeouts",new Map)}add(e,t,n=140,...i){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...i))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class TP{constructor(e){Gn(this,"gestures",new Set),Gn(this,"_targetEventStore",new ew(this)),Gn(this,"gestureEventStores",{}),Gn(this,"gestureTimeoutStores",{}),Gn(this,"handlers",{}),Gn(this,"config",{}),Gn(this,"pointerIds",new Set),Gn(this,"touchIds",new Set),Gn(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),AP(this,e)}setEventIds(e){Pf(e)?this.touchIds=new Set(J3(e)):"pointerId"in e&&(e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId))}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=MP(e,t)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n=t.eventOptions,i={};let s;if(t.target&&(s=t.target(),!s))return;const o=RP(i,n,!!s);if(t.enabled){for(const a of this.gestures)if(this.config[a].enabled){const u=Qb.get(a);new u(this,e,a).bind(o)}for(const a in this.nativeHandlers)o(a,"",u=>this.nativeHandlers[a](tn(tn({},this.state.shared),{},{event:u,args:e})),void 0,!0)}for(const a in i)i[a]=Q3(...i[a]);if(!s)return i;for(const a in i){const{device:u,capture:f,passive:p}=j3(a);
3033this._targetEventStore.add(s,u,"",i[a],{capture:f,passive:p})}}}function Mo(r,e){r.gestures.add(e),r.gestureEventStores[e]=new ew(r),r.gestureTimeoutStores[e]=new EP}function AP(r,e){e.drag&&Mo(r,"drag"),e.wheel&&Mo(r,"wheel"),e.scroll&&Mo(r,"scroll"),e.move&&Mo(r,"move"),e.pinch&&Mo(r,"pinch"),e.hover&&Mo(r,"hover")}const RP=(r,e,t)=>(n,i,s,o={},a=!1)=>{var u,f;const p=(u=o.capture)!==null&&u!==void 0?u:e.capture,h=(f=o.passive)!==null&&f!==void 0?f:e.passive;let d=a?n:W3(n,i,p);t&&h&&(d+="Passive"),r[d]=r[d]||[],r[d].push(s)};class CP extends Tm{constructor(e){super(e),this.type=fr}parse(e){const a=function(E,M){switch(E){case 1:console.error("THREE.RGBELoader Read Error: "+(M||""));break;case 2:console.error("THREE.RGBELoader Write Error: "+(M||""));break;case 3:console.error("THREE.RGBELoader Bad File Format: "+(M||""));break;default:case 4:console.error("THREE.RGBELoader: Error: "+(M||""))}return-1},h=` 3034`,d=function(E,M,A){M=M||1024;let L=E.pos,D=-1,k=0,B="",T=String.fromCharCode.apply(null,new Uint16Array(E.subarray(L,L+128)));for(;0>(D=T.indexOf(h))&&k<M&&L<E.byteLength;)B+=T,k+=T.length,L+=128,T+=String.fromCharCode.apply(null,new Uint16Array(E.subarray(L,L+128)));return-1<D?(A!==!1&&(E.pos+=k+D+1),B+T.slice(0,D)):!1},g=function(E){const M=/^#\?(\S+)/,A=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,C=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,L=/^\s*FORMAT=(\S+)\s*$/,D=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,k={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let B,T;if(E.pos>=E.byteLength||!(B=d(E)))return a(1,"no header found");if(!(T=B.match(M)))return a(3,"bad initial token");
3034for(k.valid|=1,k.programtype=T[1],k.string+=B+` 3035`;B=d(E),B!==!1;){if(k.string+=B+` 3036`,B.charAt(0)==="#"){k.comments+=B+` 3037`;continue}if((T=B.match(A))&&(k.gamma=parseFloat(T[1])),(T=B.match(C))&&(k.exposure=parseFloat(T[1])),(T=B.match(L))&&(k.valid|=2,k.format=T[1]),(T=B.match(D))&&(k.valid|=4,k.height=parseInt(T[1],10),k.width=parseInt(T[2],10)),k.valid&2&&k.valid&4)break}return k.valid&2?k.valid&4?k:a(3,"missing image size specifier"):a(3,"missing format specifier")},y=function(E,M,A){const C=M;if(C<8||C>32767||E[0]!==2||E[1]!==2||E[2]&128)return new Uint8Array(E);if(C!==(E[2]<<8|E[3]))return a(3,"wrong scanline width");const L=new Uint8Array(4*M*A);if(!L.length)return a(4,"unable to allocate buffer space");let D=0,k=0;const B=4*C,T=new Uint8Array(4),O=new Uint8Array(B);let H=A;for(;H>0&&k<E.byteLength;){if(k+4>E.byteLength)return a(1);if(T[0]=E[k++],T[1]=E[k++],T[2]=E[k++],T[3]=E[k++],T[0]!=2||T[1]!=2||(T[2]<<8|T[3])!=C)return a(3,"bad rgbe scanline format");let W=0,V;for(;W<B&&k<E.byteLength;){V=E[k++];const Z=V>128;if(Z&&(V-=128),V===0||W+V>B)return a(3,"bad scanline data");if(Z){const ne=E[k++];for(let ge=0;ge<V;ge++)O[W++]=ne}else O.set(E.subarray(k,k+V),W),W+=V,k+=V}const j=C;for(let Z=0;Z<j;Z++){let ne=0;L[D]=O[Z+ne],ne+=C,L[D+1]=O[Z+ne],ne+=C,L[D+2]=O[Z+ne],ne+=C,L[D+3]=O[Z+ne],D+=4}H--}return L},_=function(E,M,A,C){const L=E[M+3],D=Math.pow(2,L-128)/255;A[C+0]=E[M+0]*D,A[C+1]=E[M+1]*D,A[C+2]=E[M+2]*D,A[C+3]=1},w=function(E,M,A,C){const L=E[M+3],D=Math.pow(2,L-128)/255;A[C+0]=el.toHalfFloat(Math.min(E[M+0]*D,65504)),A[C+1]=el.toHalfFloat(Math.min(E[M+1]*D,65504)),A[C+2]=el.toHalfFloat(Math.min(E[M+2]*D,65504)),A[C+3]=el.toHalfFloat(1)},x=new Uint8Array(e);x.pos=0;const v=g(x);if(v!==-1){const E=v.width,M=v.height,A=y(x.subarray(x.pos),E,M);if(A!==-1){let C,L,D,k;switch(this.type){case Yn:k=A.length/4;const B=new Float32Array(k*4);for(let O=0;O<k;O++)_(A,O*4,B,O*4);C=B,D=Yn;break;case fr:k=A.length/4;const T=new Uint16Array(k*4);for(let O=0;O<k;O++)w(A,O*4,T,O*4);C=T,D=fr;break;default:console.error("THREE.RGBELoader: unsupported type: ",this.type);break}return{width:E,height:M,data:C,header:v.string,gamma:v.gamma,exposure:v.exposure,format:L,type:D}}}return null}setDataType(e){return this.type=e,this}load(e,t,n,i){function s(o,a){switch(o.type){case Yn:o.encoding=Kn,o.minFilter=Pt,o.magFilter=Pt,o.generateMipmaps=!1,o.flipY=!0;break;case fr:o.encoding=Kn,o.minFilter=Pt,o.magFilter=Pt,o.generateMipmaps=!1,o.flipY=!0;break}t&&t(o,a)}return super.load(e,s,n,i)}}function Mh(r,e,t,n){return new(t||(t=Promise))(function(i,s){function o(f){try{u(n.next(f))}catch(p){s(p)}}function a(f){try{u(n.throw(f))}catch(p){s(p)}}function u(f){var p;f.done?i(f.value):(p=f.value,p instanceof t?p:new t(function(h){h(p)})).then(o,a)}u((n=n.apply(r,e||[])).next())})}const PP=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function gv(r){return r=r.toLowerCase().replace(/^angle ?\((.+)\)*$/,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"")}const tw=typeof window=="undefined",Bi=(()=>
3037{if(tw)return;const{userAgent:r,platform:e,maxTouchPoints:t}=window.navigator,n=/(iphone|ipod|ipad)/i.test(r),i=e==="iPad"||e==="MacIntel"&&t>0&&!window.MSStream;return{isIpad:i,isMobile:/android/i.test(r)||n||i,isSafari12:/Version\/12.+Safari/.test(r)}})();function LP(r,e,t){if(!t)return[e];const n=function(f){const p=` 3038 precision highp float; 3039 attribute vec3 aPosition; 3040 varying float vvv; 3041 void main() { 3042 vvv = 0.31622776601683794; 3043 gl_Position = vec4(aPosition, 1.0); 3044 } 3045 `,h=` 3046 precision highp float; 3047 varying float vvv; 3048 void main() { 3049 vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv; 3050 enc = fract(enc); 3051 enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); 3052 gl_FragColor = enc; 3053 } 3054 `,d=f.createShader(35633),g=f.createShader(35632),y=f.createProgram();if(!(g&&d&&y))return;f.shaderSource(d,p),f.shaderSource(g,h),f.compileShader(d),f.compileShader(g),f.attachShader(y,d),f.attachShader(y,g),f.linkProgram(y),f.detachShader(y,d),f.detachShader(y,g),f.deleteShader(d),f.deleteShader(g),f.useProgram(y);const _=f.createBuffer();f.bindBuffer(34962,_),f.bufferData(34962,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const w=f.getAttribLocation(y,"aPosition");f.vertexAttribPointer(w,3,5126,!1,0,0),f.enableVertexAttribArray(w),f.clearColor(1,1,1,1),f.clear(16384),f.viewport(0,0,1,1),f.drawArrays(4,0,3);const x=new Uint8Array(4);return f.readPixels(0,0,1,1,6408,5121,x),f.deleteProgram(y),f.deleteBuffer(_),x.join("")}(r),i="801621810",s="8016218135",o="80162181161",a=Bi!=null&&Bi.isIpad?[["a7",o,12],["a8",s,15],["a8x",s,15],["a9",s,15],["a9x",s,15],["a10",s,15],["a10x",s,15],["a12",i,15],["a12x",i,15],["a12z",i,15],["a14",i,15],["m1",i,15]]:[["a7",o,12],["a8",s,12],["a9",s,15],["a10",s,15],["a11",i,15],["a12",i,15],["a13",i,15],["a14",i,15]];let u;return n==="80162181255"?u=a.filter(([,,f])=>f>=14):(u=a.filter(([,f])=>f===n),u.length||(u=a)),u.map(([f])=>`apple ${f} gpu`)}const Eh=[],yv=[];function IP(r,e){if(r===e)return 0;const t=r;r.length>e.length&&(r=e,e=t);let n=r.length,i=e.length;for(;n>0&&r.charCodeAt(~-n)===e.charCodeAt(~-i);)n--,i--;let s,o=0;for(;o<n&&r.charCodeAt(o)===e.charCodeAt(o);)o++;if(n-=o,i-=o,n===0)return i;let a,u,f=0,p=0,h=0;for(;p<n;)yv[p]=r.charCodeAt(o+p),Eh[p]=++p;for(;h<i;)for(s=e.charCodeAt(o+h),a=h++,f=h,p=0;p<n;p++)u=s===yv[p]?a:a+1,a=Eh[p],f=Eh[p]=a>f?u>f?f+1:u:u>a?a+1:u;return f}function DP(r){return r!=null}class vv extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}const OP=({mobileTiers:r=[0,15,30,60],desktopTiers:e=[0,15,30,60],override:t={},glContext:n,failIfMajorPerformanceCaveat:i=!1,benchmarksURL:s="https://unpkg.com/[email protected]/dist/benchmarks"}={})=>Mh(void 0,void 0,void 0,function*(){const o={};if(tw)return{tier:0,type:"SSR"};const{isIpad:a=!!(Bi!=null&&Bi.isIpad),isMobile:u=!!(Bi!=null&&Bi.isMobile),screenSize:f=window.screen,loadBenchmarks:p=A=>Mh(void 0,void 0,void 0,function*(){const C=yield fetch(`${s}/${A}`).then(L=>L.json());if(parseInt(C.shift().split(".")[0],10)<4)throw new vv("Detect GPU benchmark data is out of date. Please update to version 4x");return C})}=t;let{renderer:h}=t;const d=(A,C,L,D,k)=>({device:k,fps:D,gpu:L,isMobile:u,tier:A,type:C});let g,y="";if(h)h=gv(h),g=[h];else{const A=n||function(L,D=!1){const k={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:D,powerPreference:"high-performance",stencil:!1};L&&delete k.powerPreference;const B=window.document.createElement("canvas"),T=B.getContext("webgl",k)||B.getContext("experimental-webgl",k);return T!=null?T:void 0}(Bi==null?void 0:Bi.isSafari12,i);if(!A)return d(0,"WEBGL_UNSUPPORTED");const C=A.getExtension("WEBGL_debug_renderer_info");if(C&&(h=A.getParameter(C.UNMASKED_RENDERER_WEBGL)),!h)return d(1,"FALLBACK");y=h,h=gv(h),g=function(L,D,k){return D==="apple gpu"?LP(L,D,k):[D]}(A,h,u)}const _=(yield Promise.all(g.map(A=>Mh(void 0,void 0,void 0,function*(){var C;const L=(ue=>{const ye=u?["adreno","apple","mali-t","mali","nvidia","powervr"]:["intel","apple","amd","radeon","nvidia","geforce"];for(const xe of ye)if(ue.includes(xe))return xe})(A);if(!L)return;const D=`${u?"m":"d"}-${L}${a?"-ipad":""}.json`,k=o[D]=(C=o[D])!==null&&C!==void 0?C:p(D);let B;try{B=yield k}catch(ue){if(ue instanceof vv)throw ue;return}const T=function(ue){var ye;const xe=(ue=ue.replace(/\([^)]+\)/,"")).match(/\d+/)||ue.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return(ye=xe==null?void 0:xe.join("").replace(/\W|amd/g,""))!==null&&ye!==void 0?ye:""}(A);let O=B.filter(([,ue])=>ue===T);O.length||(O=B.filter(([ue])=>ue.includes(A)));const H=O.length;if(H===0)return;let W,[V,,,j]=H>1?O.map(ue=>[ue,IP(A,ue[0])]).sort(([,ue],[,ye])=>ue-ye)[0][0]:O[0],Z=Number.MAX_VALUE;const{devicePixelRatio:ne}=window,ge=f.width*ne*f.height*ne;for(const ue of j){const[ye,xe]=ue,re=ye*xe,Xe=Math.abs(ge-re);Xe<Z&&(Z=Xe,W=ue)}if(!W)return;const[,,Y,ee]=W;return[Z,Y,V,ee]})))).filter(DP).sort(([A=Number.MAX_VALUE,C],[L=Number.MAX_VALUE,D])=>A===L?C-D:A-L);if(!_.length){const A=PP.find(C=>h.includes(C));return A?d(0,"BLOCKLISTED",A):d(1,"FALLBACK",`${h} (${y})`)}const[,w,x,v]=_[0];if(w===-1)return d(0,"BLOCKLISTED",x,w,v);const E=u?r:e;let M=0;for(let A=0;A<E.length;A++)w>=E[A]&&(M=A);return d(M,"BENCHMARK",x,w,v)}),Th={sunset:"venice/venice_sunset_1k.hdr",dawn:"kiara/kiara_1_dawn_1k.hdr",night:"dikhololo/dikhololo_night_1k.hdr",warehouse:"empty-wharehouse/empty_warehouse_01_1k.hdr",forest:"forrest-slope/forest_slope_1k.hdr",apartment:"lebombo/lebombo_1k.hdr",studio:"studio-small-3/studio_small_03_1k.hdr",city:"potsdamer-platz/potsdamer_platz_1k.hdr",park:"rooitou/rooitou_park_1k.hdr",lobby:"st-fagans/st_fagans_interior_1k.hdr"},FP="https://market-assets.fra1.cdn.digitaloceanspaces.com/market-assets/hdris/",BP=r=>r.current&&r.current.isScene,Wm=r=>BP(r)?r.current:r;function zP(r){return r.map?R.exports.createElement(nw,r):r.children?R.exports.createElement(NP,r):R.exports.createElement(kP,r)}function nw({scene:r,background:e=!1,map:t}){const n=ri(i=>i.scene);return R.exports.useLayoutEffect(()=>{if(t){const i=Wm(r||n),s=i.background,o=i.environment;return e!=="only"&&(i.environment=t),e&&(i.background=t),()=>{e!=="only"&&(i.environment=o),e&&(i.background=s)}}},[r,t]),null}function NP({children:r,near:e=1,far:t=1e3,resolution:n=256,frames:i=1,background:s=!1,scene:o,files:a,path:u,preset:f=void 0,extensions:p}){const h=ri(x=>x.gl),d=ri(x=>x.scene),g=R.exports.useRef(null),[y]=R.exports.useState(()=>new aa),_=R.exports.useMemo(()=>{const x=new Il(n);return x.texture.type=fr,x},[n]);R.exports.useLayoutEffect(()=>{i===1&&g.current.update(h,y);const x=Wm(o||d),v=x.background,E=x.environment;return s!=="only"&&(x.environment=_.texture),s&&(x.background=_.texture),()=>{s!=="only"&&(x.environment=E),s&&(x.background=v)}},[r,o]);let w=1;return Wb(()=>{(i===1/0||w<i)&&(g.current.update(h,y),w++)}),R.exports.createElement(R.exports.Fragment,null,R3(R.exports.createElement(R.exports.Fragment,null,r,R.exports.createElement("cubeCamera",{ref:g,args:[e,t,_]}),(a||f)&&R.exports.createElement(nw,{background:!0,files:a,preset:f,path:u,extensions:p,scene:y})),y))}function kP({background:r=!1,files:e=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"],path:t="",preset:n=void 0,scene:i,extensions:s}){if(n){if(!(n in Th))throw new Error("Preset must be one of: "+Object.keys(Th).join(", "));e=Th[n],t=FP}const o=ri(h=>h.scene),a=Array.isArray(e),f=Gm(a?Em:CP,a?[e]:e,h=>{h.setPath(t),h.setDataType==null||h.setDataType(Yn),s&&s(h)}),p=a?f[0]:f;return p.mapping=a?$i:ko,R.exports.useLayoutEffect(()=>{const h=Wm(i||o),d=h.background,g=h.environment;return r!=="only"&&(h.environment=p),r&&(h.background=p),()=>{r!=="only"&&(h.environment=g),r&&(h.background=d)}},[p,r,i]),null}var rw={exports:{}},UP="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",HP=UP,GP=HP;function iw(){}function sw(){}sw.resetWarningCache=iw;var VP=function(){function r(n,i,s,o,a,u){if(u!==GP){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function e(){return r}var t={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:e,element:r,elementType:r,instanceOf:e,node:r,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:sw,resetWarningCache:iw};return t.PropTypes=t,t};rw.exports=VP();var zt=rw.exports;function ow(...r){return e=>r.forEach(t=>function(n,i){typeof n=="function"?n(i):n!=null&&(n.current=i)}(t,e))}function Lf(...r){return R.exports.useCallback(ow(...r),r)}const ua=R.exports.forwardRef((r,e)=>{const{children:t,...n}=r;return R.exports.Children.toArray(t).some(xv)?R.exports.createElement(R.exports.Fragment,null,R.exports.Children.map(t,i=>xv(i)?R.exports.createElement(Mp,jt({},n,{ref:e}),i.props.children):i)):R.exports.createElement(Mp,jt({},n,{ref:e}),t)});ua.displayName="Slot";const Mp=R.exports.forwardRef((r,e)=>{const{children:t,...n}=r;return R.exports.isValidElement(t)?R.exports.cloneElement(t,{...WP(n,t.props),ref:ow(e,t.ref)}):R.exports.Children.count(t)>1?R.exports.Children.only(null):null});Mp.displayName="SlotClone";const aw=({children:r})=>R.exports.createElement(R.exports.Fragment,null,r);function xv(r){return R.exports.isValidElement(r)&&r.type===aw}function WP(r,e){const t={...e};for(const n in e){const i=r[n],s=e[n];/^on[A-Z]/.test(n)?t[n]=(...o)=>{s==null||s(...o),i==null||i(...o)}:n==="style"?t[n]={...i,...s}
3054:n==="className"&&(t[n]=[i,s].filter(Boolean).join(" "))}return{...r,...t}}const $P=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce((r,e)=>({...r,[e]:R.exports.forwardRef((t,n)=>{const{asChild:i,...s}=t,o=i?ua:e;return R.exports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),R.exports.createElement(o,jt({},s,{ref:n}))})}),{}),Al=Boolean(globalThis==null?void 0:globalThis.document)?R.exports.useLayoutEffect:()=>{},jP=R.exports.forwardRef((r,e)=>{var t,n;const{containerRef:i,style:s,...o}=r,a=(t=i==null?void 0:i.current)!==null&&t!==void 0?t:globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,[,u]=R.exports.useState({});return Al(()=>{u({})},[]),a?$p.createPortal(R.exports.createElement($P.div,jt({"data-radix-portal":""},o,{ref:e,style:a===document.body?{position:"absolute",top:0,left:0,zIndex:2147483647,...s}:void 0})),a):null}),qP=jP;var _v=Object.prototype.hasOwnProperty;function Rl(r,e){var t,n;if(r===e)return!0;if(r&&e&&(t=r.constructor)===e.constructor){if(t===Date)return r.getTime()===e.getTime();if(t===RegExp)return r.toString()===e.toString();if(t===Array){if((n=r.length)===e.length)for(;n--&&Rl(r[n],e[n]););return n===-1}if(!t||typeof r=="object"){n=0;for(t in r)if(_v.call(r,t)&&++n&&!_v.call(e,t)||!(t in e)||!Rl(r[t],e[t]))return!1;return Object.keys(e).length===n}}return r!==r&&e!==e}function Vl(r,e){if(Object.is(r,e))return!0;if(typeof r!="object"||r===null||typeof e!="object"||e===null)return!1;const t=Object.keys(r);if(t.length!==Object.keys(e).length)return!1;for(let n=0;n<t.length;n++)if(!Object.prototype.hasOwnProperty.call(e,t[n])||!Object.is(r[t[n]],e[t[n]]))return!1;return!0}var If=function(e,t,n,i){this.name=e,this.fn=t,this.args=n,this.modifiers=i};If.prototype._test=function(e){var t=this.fn;try{zo(this.modifiers.slice(),t,this)(e)}catch{t=function(){return!1}}try{return zo(this.modifiers.slice(),t,this)(e)}catch{return!1}};If.prototype._check=function(e){try{zo(this.modifiers.slice(),this.fn,this)(e)}catch{if(zo(this.modifiers.slice(),function(n){return n},this)(!1))return}if(!zo(this.modifiers.slice(),this.fn,this)(e))throw null};If.prototype._testAsync=function(e){var t=this;return new Promise(function(n,i){cw(t.modifiers.slice(),t.fn,t)(e).then(function(s){s?n(e):i(null)}).catch(function(s){return i(s)})})};function lw(r,e){return e===void 0&&(e="simple"),typeof r=="object"?r[e]:r}function zo(r,e,t){if(r.length){var n=r.shift(),i=zo(r,e,t);return n.perform(i,t)}else return lw(e)}function cw(r,e,t){if(r.length){var n=r.shift(),i=cw(r,e,t);return n.performAsync(i,t)}else return function(s){return Promise.resolve(lw(e,"async")(s))}}var XP=function(e,t,n){this.name=e,this.perform=t,this.performAsync=n},$m=function(r){function e(t,n,i,s){for(var o=[],a=arguments.length-4;a-- >0;)o[a]=arguments[a+4];r.call(this,o),r.captureStackTrace&&r.captureStackTrace(this,e),this.rule=t,this.value=n,this.cause=i,this.target=s}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e}(Error),Hr=function(e,t){e===void 0&&(e=[]),t===void 0&&(t=[]),this.chain=e,this.nextRuleModifiers=t};Hr.prototype._applyRule=function(e,t){var n=this;return function(){for(var i=[],s=arguments.length;s--;)i[s]=arguments[s];return n.chain.push(new If(t,e.apply(n,i),i,n.nextRuleModifiers)),n.nextRuleModifiers=[],n}};Hr.prototype._applyModifier=function(e,t){return this.nextRuleModifiers.push(new XP(t,e.simple,e.async)),this};Hr.prototype._clone=function(){return new Hr(this.chain.slice(),this.nextRuleModifiers.slice())};Hr.prototype.test=function(e){return this.chain.every(function(t){return t._test(e)})};Hr.prototype.testAll=function(e){var t=[];return this.chain.forEach(function(n){try{n._check(e)}catch(i){t.push(new $m(n,e,i))}}),t};Hr.prototype.check=function(e){this.chain.forEach(function(t){try{t._check(e)}catch(n){throw new $m(t,e,n)}})};Hr.prototype.testAsync=function(e){var t=this;return new Promise(function(n,i){uw(e,t.chain.slice(),n,i)})};function uw(r,e,t,n){if(e.length){var i=e.shift();i._testAsync(r).then(function(){uw(r,e,t,n)},function(s){n(new $m(i,r,s))})}else t(r)}var bv=function(r,e){return e&&typeof r=="string"&&r.trim().length===0?!0:r==null};function YP(r,e){return e===void 0&&(e=!1),{simple:function(t){return bv(t,e)||r.check(t)===void 0},async:function(t){return bv(t,e)||r.testAsync(t)}}}function Vn(){return typeof Proxy!="undefined"?fw(new Hr):Ep(new Hr)}var Cl={};Vn.extend=function(r){Object.assign(Cl,r)};Vn.clearCustomRules=function(){Cl={}};function fw(r){return new Proxy(r,{get:function(t,n){if(n in t)return t[n];var i=fw(r._clone());if(n in Ju)return i._applyModifier(Ju[n],n);if(n in Cl)return i._applyRule(Cl[n],n);if(n in Tp)return i._applyRule(Tp[n],n)}})}
3054function Ep(r){var e=function(i,s){return Object.keys(i).forEach(function(o){s[o]=function(){for(var a=[],u=arguments.length;u--;)a[u]=arguments[u];var f=Ep(s._clone()),p=f._applyRule(i[o],o).apply(void 0,a);return p}}),s},t=e(Tp,r),n=e(Cl,t);return Object.keys(Ju).forEach(function(i){Object.defineProperty(n,i,{get:function(){var s=Ep(n._clone());return s._applyModifier(Ju[i],i)}})}),n}var Ju={not:{simple:function(r){return function(e){return!r(e)}},async:function(r){return function(e){return Promise.resolve(r(e)).then(function(t){return!t}).catch(function(){return!0})}}},some:{simple:function(r){return function(e){return Ru(e).some(function(t){try{return r(t)}catch{return!1}})}},async:function(r){return function(e){return Promise.all(Ru(e).map(function(t){try{return r(t).catch(function(){return!1})}catch{return!1}})).then(function(t){return t.some(Boolean)})}}},every:{simple:function(r){return function(e){return e!==!1&&Ru(e).every(r)}},async:function(r){return function(e){return Promise.all(Ru(e).map(r)).then(function(t){return t.every(Boolean)})}}},strict:{simple:function(r,e){return function(t){return wv(e)&&t&&typeof t=="object"?Object.keys(e.args[0]).length===Object.keys(t).length&&r(t):r(t)}},async:function(r,e){return function(t){return Promise.resolve(r(t)).then(function(n){return wv(e)&&t&&typeof t=="object"?Object.keys(e.args[0]).length===Object.keys(t).length&&n:n}).catch(function(){return!1})}}}};function wv(r){return r&&r.name==="schema"&&r.args.length>0&&typeof r.args[0]=="object"}function Ru(r){return typeof r=="string"?r.split(""):r}var Tp={equal:function(r){return function(e){return e==r}},exact:function(r){return function(e){return e===r}},number:function(r){return r===void 0&&(r=!0),function(e){return typeof e=="number"&&(r||isFinite(e))}},integer:function(){return function(r){var e=Number.isInteger||JP;return e(r)}},numeric:function(){return function(r){return!isNaN(parseFloat(r))&&isFinite(r)}},string:function(){return Eo("string")},boolean:function(){return Eo("boolean")},undefined:function(){return Eo("undefined")},null:function(){return Eo("null")},array:function(){return Eo("array")},object:function(){return Eo("object")},instanceOf:function(r){return function(e){return e instanceof r}},pattern:function(r){return function(e){return r.test(e)}},lowercase:function(){return function(r){return typeof r=="boolean"||r===r.toLowerCase()&&r.trim()!==""}},uppercase:function(){return function(r){return r===r.toUpperCase()&&r.trim()!==""}},vowel:function(){return function(r){return/^[aeiou]+$/i.test(r)}},consonant:function(){return function(r){return/^(?=[^aeiou])([a-z]+)$/i.test(r)}},first:function(r){return function(e){return e[0]==r}},last:function(r){return function(e){return e[e.length-1]==r}},empty:function(){return function(r){return r.length===0}},length:function(r,e){return function(t){return t.length>=r&&t.length<=(e||r)}},minLength:function(r){return function(e){return e.length>=r}},maxLength:function(r){return function(e){return e.length<=r}},negative:function(){return function(r){return r<0}},positive:function(){return function(r){return r>=0}},between:function(r,e){return function(t){return t>=r&&t<=e}},range:function(r,e){return function(t){return t>=r&&t<=e}},lessThan:function(r){return function(e){return e<r}},lessThanOrEqual:function(r){return function(e){return e<=r}},greaterThan:function(r){return function(e){return e>r}},greaterThanOrEqual:function(r){return function(e){return e>=r}},even:function(){return function(r){return r%2===0}},odd:function(){return function(r){return r%2!==0}},includes:function(r){return function(e){return~e.indexOf(r)}},schema:function(r){return ZP(r)},passesAnyOf:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return function(t){return r.some(function(n){return n.test(t)})}},optional:YP};function Eo(r){return function(e){return Array.isArray(e)&&r==="array"||e===null&&r==="null"||typeof e===r}}function JP(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}function ZP(r){return{simple:function(e){var t=[];if(Object.keys(r).forEach(function(n){var i=r[n];try{i.check((e||{})[n])}catch(s){s.target=n,t.push(s)}}),t.length>0)throw t;return!0},async:function(e){var t=[],n=Object.keys(r).map(function(i){var s=r[i];return s.testAsync((e||{})[i]).catch(function(o){o.target=i,t.push(o)})});return Promise.all(n).then(function(){if(t.length>0)throw t;return!0})}}}var Et="colors",In="sizes",Fe="space",KP={gap:Fe,gridGap:Fe,columnGap:Fe,gridColumnGap:Fe,rowGap:Fe,gridRowGap:Fe,inset:Fe,insetBlock:Fe,insetBlockEnd:Fe,insetBlockStart:Fe,insetInline:Fe,insetInlineEnd:Fe,insetInlineStart:Fe,margin:Fe,marginTop:Fe,marginRight:Fe,marginBottom:Fe,marginLeft:Fe,marginBlock:Fe,marginBlockEnd:Fe,marginBlockStart:Fe,marginInline:Fe,marginInlineEnd:Fe,marginInlineStart:Fe,padding:Fe,paddingTop:Fe,paddingRight:Fe,paddingBottom:Fe,paddingLeft:Fe,paddingBlock:Fe,paddingBlockEnd:Fe,paddingBlockStart:Fe,paddingInline:Fe,paddingInlineEnd:Fe,paddingInlineStart:Fe,top:Fe,right:Fe,bottom:Fe,left:Fe,scrollMargin:Fe,scrollMarginTop:Fe,scrollMarginRight:Fe,scrollMarginBottom:Fe,scrollMarginLeft:Fe,scrollMarginX:Fe,scrollMarginY:Fe,scrollMarginBlock:Fe,scrollMarginBlockEnd:Fe,scrollMarginBlockStart:Fe,scrollMarginInline:Fe,scrollMarginInlineEnd:Fe,scrollMarginInlineStart:Fe,scrollPadding:Fe,scrollPaddingTop:Fe,scrollPaddingRight:Fe,scrollPaddingBottom:Fe,scrollPaddingLeft:Fe,scrollPaddingX:Fe,scrollPaddingY:Fe,scrollPaddingBlock:Fe,scrollPaddingBlockEnd:Fe,scrollPaddingBlockStart:Fe,scrollPaddingInline:Fe,scrollPaddingInlineEnd:Fe,scrollPaddingInlineStart:Fe,fontSize:"fontSizes",background:Et,backgroundColor:Et,backgroundImage:Et,borderImage:Et,border:Et,borderBlock:Et,borderBlockEnd:Et,borderBlockStart:Et,borderBottom:Et,borderBottomColor:Et,borderColor:Et,borderInline:Et,borderInlineEnd:Et,borderInlineStart:Et,borderLeft:Et,borderLeftColor:Et,borderRight:Et,borderRightColor:Et,borderTop:Et,borderTopColor:Et,caretColor:Et,color:Et,columnRuleColor:Et,fill:Et,outline:Et,outlineColor:Et,stroke:Et,textDecorationColor:Et,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:In,minBlockSize:In,maxBlockSize:In,inlineSize:In,minInlineSize:In,maxInlineSize:In,width:In,minWidth:In,maxWidth:In,height:In,minHeight:In,maxHeight:In,flexBasis:In,gridTemplateColumns:In,gridTemplateRows:In,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},QP=(r,e)=>typeof e=="function"?{"()":Function.prototype.toString.call(e)}:e,fa=()=>{const r=Object.create(null);return(e,t,...n)=>{const i=(s=>
vendor: 12,053 bytes, line 3054
3054JSON.stringify(s,QP))(e);return i in r?r[i]:r[i]=t(e,...n)}},Ss=Symbol.for("sxs.internal"),jm=(r,e)=>Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)),Sv=r=>{for(const e in r)return!0;return!1},{hasOwnProperty:eL}=Object.prototype,Ap=r=>r.includes("-")?r:r.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),tL=/\s+(?![^()]*\))/,To=r=>e=>r(...typeof e=="string"?String(e).split(tL):[e]),Mv={appearance:r=>({WebkitAppearance:r,appearance:r}),backfaceVisibility:r=>({WebkitBackfaceVisibility:r,backfaceVisibility:r}),backdropFilter:r=>({WebkitBackdropFilter:r,backdropFilter:r}),backgroundClip:r=>({WebkitBackgroundClip:r,backgroundClip:r}),boxDecorationBreak:r=>({WebkitBoxDecorationBreak:r,boxDecorationBreak:r}),clipPath:r=>({WebkitClipPath:r,clipPath:r}),content:r=>({content:r.includes('"')||r.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(r)?r:`"${r}"`}),hyphens:r=>({WebkitHyphens:r,hyphens:r}),maskImage:r=>({WebkitMaskImage:r,maskImage:r}),maskSize:r=>({WebkitMaskSize:r,maskSize:r}),tabSize:r=>({MozTabSize:r,tabSize:r}),textSizeAdjust:r=>({WebkitTextSizeAdjust:r,textSizeAdjust:r}),userSelect:r=>({WebkitUserSelect:r,userSelect:r}),marginBlock:To((r,e)=>({marginBlockStart:r,marginBlockEnd:e||r})),marginInline:To((r,e)=>({marginInlineStart:r,marginInlineEnd:e||r})),maxSize:To((r,e)=>({maxBlockSize:r,maxInlineSize:e||r})),minSize:To((r,e)=>({minBlockSize:r,minInlineSize:e||r})),paddingBlock:To((r,e)=>({paddingBlockStart:r,paddingBlockEnd:e||r})),paddingInline:To((r,e)=>({paddingInlineStart:r,paddingInlineEnd:e||r}))},Ah=/([\d.]+)([^]*)/,nL=(r,e)=>r.length?r.reduce((t,n)=>(t.push(...e.map(i=>i.includes("&")?i.replace(/&/g,/[ +>|~]/.test(n)&&/&.*&/.test(i)?`:is(${n})`:n):n+" "+i)),t),[]):e,rL=(r,e)=>r in iL&&typeof e=="string"?e.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(t,n,i,s)=>n+(i==="stretch"?`-moz-available${s};${Ap(r)}:${n}-webkit-fill-available`:`-moz-fit-content${s};${Ap(r)}:${n}fit-content`)+s):String(e),iL={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},hi=r=>r?r+"-":"",dw=(r,e,t)=>r.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(n,i,s,o,a)=>o=="$"==!!s?n:(i||o=="--"?"calc(":"")+"var(--"+(o==="$"?hi(e)+(a.includes("$")?"":hi(t))+a.replace(/\$/g,"-"):a)+")"+(i||o=="--"?"*"+(i||"")+(s||"1")+")":"")),sL=/\s*,\s*(?![^()]*\))/,oL=Object.prototype.toString,Do=(r,e,t,n,i)=>{let s,o,a;const u=(f,p,h)=>{let d,g;const y=_=>{for(d in _){const v=d.charCodeAt(0)===64,E=v&&Array.isArray(_[d])?_[d]:[_[d]];for(g of E){const M=/[A-Z]/.test(x=d)?x:x.replace(/-[^]/g,C=>C[1].toUpperCase()),A=typeof g=="object"&&g&&g.toString===oL&&(!n.utils[M]||!p.length);if(M in n.utils&&!A){const C=n.utils[M];if(C!==o){o=C,y(C(g)),o=null;continue}}else if(M in Mv){const C=Mv[M];if(C!==a){a=C,y(C(g)),a=null;continue}}if(v&&(w=d.slice(1)in n.media?"@media "+n.media[d.slice(1)]:d,d=w.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(C,L,D,k,B,T)=>{const O=Ah.test(L),H=.0625*(O?-1:1),[W,V]=O?[k,L]:[L,k];return"("+(D[0]==="="?"":D[0]===">"===O?"max-":"min-")+W+":"+(D[0]!=="="&&D.length===1?V.replace(Ah,(j,Z,ne)=>Number(Z)+H*(D===">"?1:-1)+ne):V)+(B?") and ("+(B[0]===">"?"min-":"max-")+W+":"+(B.length===1?T.replace(Ah,(j,Z,ne)=>Number(Z)+H*(B===">"?-1:1)+ne):T):"")+")"})),A){const C=v?h.concat(d):[...h],L=v?[...p]:nL(p,d.split(sL));s!==void 0&&i(Ev(...s)),s=void 0,u(g,L,C)}else s===void 0&&(s=[[],p,h]),d=v||d.charCodeAt(0)!==36?d:`--${hi(n.prefix)}${d.slice(1).replace(/\$/g,"-")}`,g=A?g:typeof g=="number"?g&&M in aL?String(g)+"px":String(g):dw(rL(M,g==null?"":g),n.prefix,n.themeMap[M]),s[0].push(`${v?`${d} `:`${Ap(d)}:`}${g}`)}}var w,x};y(f),s!==void 0&&i(Ev(...s)),s=void 0};u(r,e,t)},Ev=(r,e,t)=>`${t.map(n=>`${n}{`).join("")}${e.length?`${e.join(",")}{`:""}${r.join(";")}${e.length?"}":""}${Array(t.length?t.length+1:0).join("}")}`,aL={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},Tv=r=>String.fromCharCode(r+(r>25?39:97)),Ms=r=>(e=>{let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Tv(t%52)+n;return Tv(t%52)+n})(((e,t)=>{let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e})(5381,JSON.stringify(r))>>>0),tl=["themed","global","styled","onevar","resonevar","allvar","inline"],lL=r=>{if(r.href&&!r.href.startsWith(location.origin))return!1;try{return r.cssRules,!0}catch{return!1}},cL=r=>{let e;const t=()=>{if(e){const{rules:o,sheet:a}=e;if(!a.deleteRule){for(;Object(Object(a.cssRules)[0]).type===3;)a.cssRules.splice(0,1);a.cssRules=[]}for(const u in o)delete o[u]}const n=Object(r).styleSheets||[];for(const o of n)if(lL(o)){for(let a=0,u=o.cssRules;u[a];++a){const f=Object(u[a]);if(f.type!==1)continue;const p=Object(u[a+1]);if(p.type!==4)continue;++a;const{cssText:h}=f;if(!h.startsWith("--sxs"))continue;const d=h.slice(14,-3).trim().split(/\s+/),g=tl[d[0]];g&&(e||(e={sheet:o,reset:t,rules:{}}),e.rules[g]={group:p,index:a,cache:new Set(d)})}if(e)break}if(!e){const o=(a,u)=>({type:u,cssRules:[],insertRule(f,p){this.cssRules.splice(p,0,o(f,{import:3,undefined:1}[(f.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return a==="@media{}"?`@media{${[].map.call(this.cssRules,f=>f.cssText).join("")}}`:a}});e={sheet:r?(r.head||r).appendChild(document.createElement("style")).sheet:o("","text/css"),rules:{},reset:t,toString(){const{cssRules:a}=e.sheet;return[].map.call(a,(u,f)=>{const{cssText:p}=u;let h="";if(p.startsWith("--sxs"))return"";if(a[f-1]&&(h=a[f-1].cssText).startsWith("--sxs")){if(!u.cssRules.length)return"";for(const d in e.rules)if(e.rules[d].group===u)return`--sxs{--sxs:${[...e.rules[d].cache].join(" ")}}${p}`;return u.cssRules.length?`${h}${p}`:""}return p}).join("")}}}const{sheet:i,rules:s}=e;for(let o=tl.length-1;o>=0;--o){const a=tl[o];if(!s[a]){const u=tl[o+1],f=s[u]?s[u].index:i.cssRules.length;i.insertRule("@media{}",f),i.insertRule(`--sxs{--sxs:${o}}`,f),s[a]={group:i.cssRules[f+1],index:f,cache:new Set([o])}}uL(s[a])}};return t(),e},uL=r=>{const e=r.group;let t=e.cssRules.length;r.apply=n=>{try{e.insertRule(n,t),++t}catch{}}},Ja=Symbol(),fL=fa(),Av=(r,e)=>fL(r,()=>(...t)=>{let n={type:null,composers:new Set};for(const i of t)if(i!=null)if(i[Ss]){n.type==null&&(n.type=i[Ss].type);for(const s of i[Ss].composers)n.composers.add(s)}else i.constructor!==Object||i.$$typeof?n.type==null&&(n.type=i):n.composers.add(dL(i,r));return n.type==null&&(n.type="span"),n.composers.size||n.composers.add(["PJLV",{},[],[],{},[]]),hL(r,n,e)}),dL=({variants:r,compoundVariants:e,defaultVariants:t,...n},i)=>{const s=`${hi(i.prefix)}c-${Ms(n)}`,o=[],a=[],u=Object.create(null),f=[];for(const d in t)u[d]=String(t[d]);if(typeof r=="object"&&r)for(const d in r){p=u,h=d,eL.call(p,h)||(u[d]="undefined");const g=r[d];for(const y in g){const _={[d]:String(y)};String(y)==="undefined"&&f.push(d);const w=g[y],x=[_,w,!Sv(w)];o.push(x)}}var p,h;if(typeof e=="object"&&e)for(const d of e){let{css:g,...y}=d;g=typeof g=="object"&&g||{};for(const w in y)y[w]=String(y[w]);const _=[y,g,!Sv(g)];a.push(_)}return[s,n,o,a,u,f]},hL=(r,e,t)=>{const[n,i,s,o]=pL(e.composers),a=typeof e.type=="function"||e.type.$$typeof?(h=>{function d(){for(let g=0;g<d[Ja].length;g++){const[y,_]=d[Ja][g];h.rules[y].apply(_)}return d[Ja]=[],null}return d[Ja]=[],d.rules={},tl.forEach(g=>d.rules[g]={apply:y=>d[Ja].push([g,y])}),d})(t):null,u=(a||t).rules,f=`.${n}${i.length>1?`:where(.${i.slice(1).join(".")})`:""}`,p=h=>{h=typeof h=="object"&&h||mL;const{css:d,...g}=h,y={};for(const x in s)if(delete g[x],x in h){let v=h[x];typeof v=="object"&&v?y[x]={"@initial":s[x],...v}:(v=String(v),y[x]=v!=="undefined"||o.has(x)?v:s[x])}else y[x]=s[x];const _=new Set([...i]);for(const[x,v,E,M]of e.composers){t.rules.styled.cache.has(x)||(t.rules.styled.cache.add(x),Do(v,[`.${x}`],[],r,L=>{u.styled.apply(L)}));const A=Rv(E,y,r.media),C=Rv(M,y,r.media,!0);for(const L of A)if(L!==void 0)for(const[D,k,B]of L){const T=`${x}-${Ms(k)}-${D}`;_.add(T);const O=(B?t.rules.resonevar:t.rules.onevar).cache,H=B?u.resonevar:u.onevar;O.has(T)||(O.add(T),Do(k,[`.${T}`],[],r,W=>{H.apply(W)}))}for(const L of C)if(L!==void 0)for(const[D,k]of L){const B=`${x}-${Ms(k)}-${D}`;_.add(B),t.rules.allvar.cache.has(B)||(t.rules.allvar.cache.add(B),Do(k,[`.${B}`],[],r,T=>{u.allvar.apply(T)}))}}if(typeof d=="object"&&d){const x=`${n}-i${Ms(d)}-css`;_.add(x),t.rules.inline.cache.has(x)||(t.rules.inline.cache.add(x),Do(d,[`.${x}`],[],r,v=>{u.inline.apply(v)}))}for(const x of String(h.className||"").trim().split(/\s+/))x&&_.add(x);const w=g.className=[..._].join(" ");return{type:e.type,className:w,selector:f,props:g,toString:()=>w,deferredInjector:a}};return jm(p,{className:n,selector:f,[Ss]:e,toString:()=>(t.rules.styled.cache.has(n)||p(),n)})},pL=r=>{let e="";const t=[],n={},i=[];for(const[s,,,,o,a]of r){e===""&&(e=s),t.push(s),i.push(...a);for(const u in o){const f=o[u];(n[u]===void 0||f!=="undefined"||a.includes(f))&&(n[u]=f)}}return[e,t,n,new Set(i)]},Rv=(r,e,t,n)=>{const i=[];e:for(let[s,o,a]of r){if(a)continue;let u,f=0,p=!1;for(u in s){const h=s[u];let d=e[u];if(d!==h){if(typeof d!="object"||!d)continue e;{let g,y,_=0;for(const w in d){if(h===String(d[w])){if(w!=="@initial"){const x=w.slice(1);(y=y||[]).push(x in t?t[x]:w.replace(/^@media ?/,"")),p=!0}f+=_,g=!0}++_}if(y&&y.length&&(o={["@media "+y.join(", ")]:o}),!g)continue e}}}(i[f]=i[f]||[]).push([n?"cv":`${u}-${s[u]}`,o,p])}return i},mL={},gL=fa(),yL=(r,e)=>gL(r,()=>(...t)=>{const n=()=>{for(let i of t){i=typeof i=="object"&&i||{};let s=Ms(i);if(!e.rules.global.cache.has(s)){if(e.rules.global.cache.add(s),"@import"in i){let o=[].indexOf.call(e.sheet.cssRules,e.rules.themed.group)-1;for(let a of[].concat(i["@import"]))a=a.includes('"')||a.includes("'")?a:`"${a}"`,e.sheet.insertRule(`@import ${a};`,o++);delete i["@import"]}
3054Do(i,[],[],r,o=>{e.rules.global.apply(o)})}}return""};return jm(n,{toString:n})}),vL=fa(),xL=(r,e)=>vL(r,()=>t=>{const n=`${hi(r.prefix)}k-${Ms(t)}`,i=()=>{if(!e.rules.global.cache.has(n)){e.rules.global.cache.add(n);const s=[];Do(t,[],[],r,a=>s.push(a));const o=`@keyframes ${n}{${s.join("")}}`;e.rules.global.apply(o)}return n};return jm(i,{get name(){return i()},toString:i})}),_L=class{constructor(r,e,t,n){this.token=r==null?"":String(r),this.value=e==null?"":String(e),this.scale=t==null?"":String(t),this.prefix=n==null?"":String(n)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+hi(this.prefix)+hi(this.scale)+this.token}toString(){return this.computedValue}},bL=fa(),wL=(r,e)=>bL(r,()=>(t,n)=>{n=typeof t=="object"&&t||Object(n);const i=`.${t=(t=typeof t=="string"?t:"")||`${hi(r.prefix)}t-${Ms(n)}`}`,s={},o=[];for(const u in n){s[u]={};for(const f in n[u]){const p=`--${hi(r.prefix)}${u}-${f}`,h=dw(String(n[u][f]),r.prefix,u);s[u][f]=new _L(f,h,u,r.prefix),o.push(`${p}:${h}`)}}const a=()=>{if(o.length&&!e.rules.themed.cache.has(t)){e.rules.themed.cache.add(t);const u=`${n===r.theme?":root,":""}.${t}{${o.join(";")}}`;e.rules.themed.apply(u)}return t};return{...s,get className(){return a()},selector:i,toString:a}}),SL=fa(),ML=fa(),EL=r=>{const e=(t=>{let n=!1;const i=SL(t,s=>{n=!0;const o="prefix"in(s=typeof s=="object"&&s||{})?String(s.prefix):"",a=typeof s.media=="object"&&s.media||{},u=typeof s.root=="object"?s.root||null:globalThis.document||null,f=typeof s.theme=="object"&&s.theme||{},p={prefix:o,media:a,theme:f,themeMap:typeof s.themeMap=="object"&&s.themeMap||{...KP},utils:typeof s.utils=="object"&&s.utils||{}},h=cL(u),d={css:Av(p,h),globalCss:yL(p,h),keyframes:xL(p,h),createTheme:wL(p,h),reset(){h.reset(),d.theme.toString()},theme:{},sheet:h,config:p,prefix:o,getCssText:h.toString,toString:h.toString};return String(d.theme=d.createTheme(f)),d});return n||i.reset(),i})(r);return e.styled=(({config:t,sheet:n})=>ML(t,()=>{const i=Av(t,n);return(...s)=>{const o=i(...s),a=o[Ss].type,u=U.forwardRef((f,p)=>{const h=f&&f.as||a,{props:d,deferredInjector:g}=o(f);return delete d.as,d.ref=p,g?U.createElement(U.Fragment,null,U.createElement(h,d),U.createElement(g,null)):U.createElement(h,d)});return u.className=o.className,u.displayName=`Styled.${a.displayName||a.name||a}`,u.selector=o.selector,u.toString=()=>o.selector,u[Ss]=o[Ss],u}}))(e),e};function TL(r,e={},t,n){const i=U.useMemo(()=>new TP(r),[]);if(i.applyHandlers(r,n),i.applyConfig(e,t),U.useEffect(i.effect.bind(i)),U.useEffect(()=>i.clean.bind(i),[]),e.target===void 0)return i.bind.bind(i)}function AL(r,e={}){return vP(xP),TL({drag:r},e,"drag")}const RL=MS["useId".toString()]||(()=>{});let CL=0;function PL(r){const[e,t]=R.exports.useState(RL());return Al(()=>{r||t(n=>n!=null?n:String(CL++))},[r]),r||(e?`radix-${e}`:"")}const LL=["a","button","div","h2","h3","img","li","nav","p","span","svg","ul"].reduce((r,e)=>({...r,[e]:R.exports.forwardRef((t,n)=>{const{asChild:i,...s}=t,o=i?ua:e;return R.exports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),t.as&&console.error(IL),R.exports.createElement(o,jt({},s,{ref:n}))})}),{}),IL="Warning: The `as` prop has been removed in favour of `asChild`. For details, see https://radix-ui.com/docs/primitives/overview/styling#changing-the-rendered-element",DL=R.exports.forwardRef((r,e)=>R.exports.createElement(LL.span,jt({},r,{ref:e,style:{...r.style,position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}}))),OL=DL,hw=["a","button","div","h2","h3","img","li","nav","p","span","svg","ul"].reduce((r,e)=>({...r,[e]:R.exports.forwardRef((t,n)=>{const{asChild:i,...s}=t,o=i?ua:e;return R.exports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),t.as&&console.error(FL),R.exports.createElement(o,jt({},s,{ref:n}))})}),{}),FL="Warning: The `as` prop has been removed in favour of `asChild`. For details, see https://radix-ui.com/docs/primitives/overview/styling#changing-the-rendered-element",BL=R.exports.forwardRef((r,e)=>{var t,n;const{containerRef:i,style:s,...o}=r,a=(t=i==null?void 0:i.current)!==null&&t!==void 0?t:globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,[,u]=R.exports.useState({});return Al(()=>{u({})},[]),a?$p.createPortal(R.exports.createElement(hw.div,jt({"data-radix-portal":""},o,{ref:e,style:a===document.body?{position:"absolute",top:0,left:0,zIndex:2147483647,...s}:void 0})),a):null}),zL=["a","button","div","h2","h3","img","li","nav","p","span","svg","ul"].reduce((r,e)=>
3054({...r,[e]:R.exports.forwardRef((t,n)=>{const{asChild:i,...s}=t,o=i?ua:e;return R.exports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),t.as&&console.error(NL),R.exports.createElement(o,jt({},s,{ref:n}))})}),{}),NL="Warning: The `as` prop has been removed in favour of `asChild`. For details, see https://radix-ui.com/docs/primitives/overview/styling#changing-the-rendered-element",kL=R.exports.forwardRef((r,e)=>{const{children:t,width:n=10,height:i=5,...s}=r;return R.exports.createElement(zL.svg,jt({},s,{ref:e,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),r.asChild?t:R.exports.createElement("polygon",{points:"0,0 30,0 15,10"}))}),UL=kL,pw=["a","button","div","h2","h3","img","li","nav","p","span","svg","ul"].reduce((r,e)=>({...r,[e]:R.exports.forwardRef((t,n)=>{const{asChild:i,...s}=t,o=i?ua:e;return R.exports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),t.as&&console.error(HL),R.exports.createElement(o,jt({},s,{ref:n}))})}),{}),HL="Warning: The `as` prop has been removed in favour of `asChild`. For details, see https://radix-ui.com/docs/primitives/overview/styling#changing-the-rendered-element";function Cv(r){const[e,t]=R.exports.useState(void 0);return R.exports.useEffect(()=>{if(r){const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const u=s.borderBoxSize,f=Array.isArray(u)?u[0]:u;o=f.inlineSize,a=f.blockSize}else{const u=r.getBoundingClientRect();o=u.width,a=u.height}t({width:o,height:a})});return n.observe(r,{box:"border-box"}),()=>{t(void 0),n.unobserve(r)}}},[r]),e}function GL(r,e){const t=hs.get(r);return t===void 0?(hs.set(r,{rect:{},callbacks:[e]}),hs.size===1&&(Rp=requestAnimationFrame(mw))):(t.callbacks.push(e),e(r.getBoundingClientRect())),()=>{const n=hs.get(r);if(n===void 0)return;const i=n.callbacks.indexOf(e);i>-1&&n.callbacks.splice(i,1),n.callbacks.length===0&&(hs.delete(r),hs.size===0&&cancelAnimationFrame(Rp))}}let Rp;const hs=new Map;function mw(){const r=[];hs.forEach((e,t)=>{const n=t.getBoundingClientRect();var i,s;i=e.rect,s=n,(i.width!==s.width||i.height!==s.height||i.top!==s.top||i.right!==s.right||i.bottom!==s.bottom||i.left!==s.left)&&(e.rect=n,r.push(e))}),r.forEach(e=>{e.callbacks.forEach(t=>t(e.rect))}),Rp=requestAnimationFrame(mw)}function gw(r){const[e,t]=R.exports.useState();return R.exports.useEffect(()=>{if(r){const n=GL(r,t);return()=>{t(void 0),n()}}},[r]),e}function yw(r,e=[]){let t=[];const n=()=>{const i=t.map(s=>R.exports.createContext(s));return function(s){const o=(s==null?void 0:s[r])||i;return R.exports.useMemo(()=>({[`__scope${r}`]:{...s,[r]:o}}),[s,o])}};return n.scopeName=r,[function(i,s){const o=R.exports.createContext(s),a=t.length;function u(f){const{scope:p,children:h,...d}=f,g=(p==null?void 0:p[r][a])||o,y=R.exports.useMemo(()=>d,Object.values(d));return R.exports.createElement(g.Provider,{value:y},h)}return t=[...t,s],u.displayName=i+"Provider",[u,function(f,p){const h=(p==null?void 0:p[r][a])||o,d=R.exports.useContext(h);if(d)return d;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}]},VL(n,...e)]}function VL(...r){const e=r[0];if(r.length===1)return e;const t=()=>{const n=r.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(i){const s=n.reduce((o,{useScope:a,scopeName:u})=>({...o,...a(i)[`__scope${u}`]}),{});return R.exports.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return t.scopeName=e.scopeName,t}function WL({anchorRect:r,popperSize:e,arrowSize:t,arrowOffset:n=0,side:i,sideOffset:s=0,align:o,alignOffset:a=0,shouldAvoidCollisions:u=!0,collisionBoundariesRect:f,collisionTolerance:p=0}){if(!r||!e||!f)return{popperStyles:$L,arrowStyles:Rh};const h=function(L,D,k=0,B=0,T){const O=T?T.height:0,H=Pv(D,L,"x"),W=Pv(D,L,"y"),V=W.before-k-O,j=W.after+k+O,Z=H.before-k-O,ne=H.after+k+O;return{top:{start:{x:H.start+B,y:V},center:{x:H.center,y:V},end:{x:H.end-B,y:V}},right:{start:{x:ne,y:W.start+B},center:{x:ne,y:W.center},end:{x:ne,y:W.end-B}},bottom:{start:{x:H.start+B,y:j},center:{x:H.center,y:j},end:{x:H.end-B,y:j}},left:{start:{x:Z,y:W.start+B},center:{x:Z,y:W.center},end:{x:Z,y:W.end-B}}}}(e,r,s,a,t),d=h[i][o];if(u===!1){const L=Lv(d);let D=Rh;return t&&(D=Dv({popperSize:e,arrowSize:t,arrowOffset:n,side:i,align:o})),{popperStyles:{...L,"--radix-popper-transform-origin":Iv(e,i,o,n,t)},arrowStyles:D,placedSide:i,placedAlign:o}}const g=DOMRect.fromRect({...e,...d}),y=(_=f,w=p,DOMRect.fromRect({width:_.width-2*w,height:_.height-2*w,x:_.left+w,y:_.top+w}));var _,w;const x=Fv(g,y),v=h[Ov(i)][o],E=function(L,D,k){const B=Ov(L);return D[L]&&!k[B]?B:L}(i,x,Fv(DOMRect.fromRect({...e,...v}),y)),M=function(L,D,k,B,T){const O=k==="top"||k==="bottom",H=O?"left":"top",W=O?"right":"bottom",V=O?"width":"height",j=D[V]>L[V];return(B==="start"||B==="center")&&(T[H]&&j||T[W]&&!j)?"end":(B==="end"||B==="center")&&(T[W]&&j||T[H]&&!j)?"start":B}(e,r,i,o,x),A=Lv(h[E][M]);let C=Rh;return t&&(C=Dv({popperSize:e,arrowSize:t,arrowOffset:n,side:E,align:M})),{popperStyles:{...A,"--radix-popper-transform-origin":Iv(e,E,M,n,t)},arrowStyles:C,placedSide:E,placedAlign:M}}function Pv(r,e,t){const n=r[t==="x"?"left":"top"],i=t==="x"?"width":"height",s=r[i],o=e[i];return{before:n-o,start:n,center:n+(s-o)/2,end:n+s-o,after:n+s}}function Lv(r){return{position:"absolute",top:0,left:0,minWidth:"max-content",willChange:"transform",transform:`translate3d(${Math.round(r.x+window.scrollX)}px, ${Math.round(r.y+window.scrollY)}
3054px, 0)`}}function Iv(r,e,t,n,i){const s=e==="top"||e==="bottom",o=i?i.width:0,a=i?i.height:0,u=o/2+n;let f="",p="";return s?(f={start:`${u}px`,center:"center",end:r.width-u+"px"}[t],p=e==="top"?`${r.height+a}px`:-a+"px"):(f=e==="left"?`${r.width+a}px`:-a+"px",p={start:`${u}px`,center:"center",end:r.height-u+"px"}[t]),`${f} ${p}`}const $L={position:"fixed",top:0,left:0,opacity:0,transform:"translate3d(0, -200%, 0)"},Rh={position:"absolute",opacity:0};function Dv({popperSize:r,arrowSize:e,arrowOffset:t,side:n,align:i}){const s=(r.width-e.width)/2,o=(r.height-e.width)/2,a={top:0,right:90,bottom:180,left:-90}[n],u=Math.max(e.width,e.height),f={width:`${u}px`,height:`${u}px`,transform:`rotate(${a}deg)`,willChange:"transform",position:"absolute",[n]:"100%",direction:jL(n,i)};return n!=="top"&&n!=="bottom"||(i==="start"&&(f.left=`${t}px`),i==="center"&&(f.left=`${s}px`),i==="end"&&(f.right=`${t}px`)),n!=="left"&&n!=="right"||(i==="start"&&(f.top=`${t}px`),i==="center"&&(f.top=`${o}px`),i==="end"&&(f.bottom=`${t}px`)),f}function jL(r,e){return(r!=="top"&&r!=="right"||e!=="end")&&(r!=="bottom"&&r!=="left"||e==="end")?"ltr":"rtl"}function Ov(r){return{top:"bottom",right:"left",bottom:"top",left:"right"}[r]}function Fv(r,e){return{top:r.top<e.top,right:r.right>e.right,bottom:r.bottom>e.bottom,left:r.left<e.left}}const[vw,xw]=yw("Popper"),[qL,_w]=vw("Popper"),XL=r=>{const{__scopePopper:e,children:t}=r,[n,i]=R.exports.useState(null);return R.exports.createElement(qL,{scope:e,anchor:n,onAnchorChange:i},t)},YL=R.exports.forwardRef((r,e)=>{const{__scopePopper:t,virtualRef:n,...i}=r,s=_w("PopperAnchor",t),o=R.exports.useRef(null),a=Lf(e,o);return R.exports.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:R.exports.createElement(pw.div,jt({},i,{ref:a}))}),[JL,ZL]=vw("PopperContent"),KL=R.exports.forwardRef((r,e)=>{const{__scopePopper:t,side:n="bottom",sideOffset:i,align:s="center",alignOffset:o,collisionTolerance:a,avoidCollisions:u=!0,...f}=r,p=_w("PopperContent",t),[h,d]=R.exports.useState(),g=gw(p.anchor),[y,_]=R.exports.useState(null),w=Cv(y),[x,v]=R.exports.useState(null),E=Cv(x),M=Lf(e,O=>_(O)),A=function(){const[O,H]=R.exports.useState(void 0);return R.exports.useEffect(()=>{let W;function V(){H({width:window.innerWidth,height:window.innerHeight})}function j(){window.clearTimeout(W),W=window.setTimeout(V,100)}return V(),window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[]),O}(),C=A?DOMRect.fromRect({...A,x:0,y:0}):void 0,{popperStyles:L,arrowStyles:D,placedSide:k,placedAlign:B}=WL({anchorRect:g,popperSize:w,arrowSize:E,arrowOffset:h,side:n,sideOffset:i,align:s,alignOffset:o,shouldAvoidCollisions:u,collisionBoundariesRect:C,collisionTolerance:a}),T=k!==void 0;return R.exports.createElement("div",{style:L,"data-radix-popper-content-wrapper":""},R.exports.createElement(JL,{scope:t,arrowStyles:D,onArrowChange:v,onArrowOffsetChange:d},R.exports.createElement(pw.div,jt({"data-side":k,"data-align":B},f,{style:{...f.style,animation:T?void 0:"none"},ref:M}))))}),QL=R.exports.forwardRef(function(r,e){const{__scopePopper:t,offset:n,...i}=r,s=ZL("PopperArrow",t),{onArrowOffsetChange:o}=s;return R.exports.useEffect(()=>o(n),[o,n]),R.exports.createElement("span",{style:{...s.arrowStyles,pointerEvents:"none"}},R.exports.createElement("span",{ref:s.onArrowChange,style:{display:"inline-block",verticalAlign:"top",pointerEvents:"auto"}},R.exports.createElement(UL,jt({},i,{ref:e,style:{...i.style,display:"block"}}))))}),eI=XL,tI=YL,nI=KL,rI=QL,bw=r=>{const{present:e,children:t}=r,n=function(o){const[a,u]=R.exports.useState(),f=R.exports.useRef({}),p=R.exports.useRef(o),h=R.exports.useRef("none"),d=o?"mounted":"unmounted",[g,y]=function(_,w){return R.exports.useReducer((x,v)=>{const E=w[x][v];return E!=null?E:x},_)}(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return R.exports.useEffect(()=>{const _=Cu(f.current);h.current=g==="mounted"?_:"none"},[g]),Al(()=>{const _=f.current,w=p.current;if(w!==o){const x=h.current,v=Cu(_);o?y("MOUNT"):v==="none"||(_==null?void 0:_.display)==="none"?y("UNMOUNT"):y(w&&x!==v?"ANIMATION_OUT":"UNMOUNT"),p.current=o}},[o,y]),Al(()=>{if(a){const _=x=>{const v=Cu(f.current).includes(x.animationName);x.target===a&&v&&y("ANIMATION_END")},w=x=>{x.target===a&&(h.current=Cu(f.current))};return a.addEventListener("animationstart",w),a.addEventListener("animationcancel",_),a.addEventListener("animationend",_),()=>{a.removeEventListener("animationstart",w),a.removeEventListener("animationcancel",_),a.removeEventListener("animationend",_)}}},[a,y]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:R.exports.useCallback(_=>{_&&(f.current=getComputedStyle(_)),u(_)},[])}}(e),i=typeof t=="function"?t({present:n.isPresent}):R.exports.Children.only(t),s=Lf(n.ref,i.ref);return typeof t=="function"||n.isPresent?R.exports.cloneElement(i,{ref:s}):null};function Cu(r){return(r==null?void 0:r.animationName)||"none"}bw.displayName="Presence";function Bv(r){const e=R.exports.useRef(r);return R.exports.useEffect(()=>{e.current=r},[r]),e.current}function Cp(r){const e=R.exports.useRef(r);return R.exports.useEffect(()=>{e.current=r}),R.exports.useMemo(()=>(...t)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...t)},[])}function iI(r){const e=Cp(r);R.exports.useEffect(()=>{const t=n=>{n.key==="Escape"&&e(n)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e])}function sI({prop:r,defaultProp:e,onChange:t=()=>{}}){const[n,i]=function({defaultProp:u,onChange:f}){const p=R.exports.useState(u),[h]=p,d=R.exports.useRef(h),g=Cp(f);return R.exports.useEffect(()=>{d.current!==h&&(g(h),d.current=h)},[h,d,g]),p}({defaultProp:e,onChange:t}),s=r!==void 0,o=s?r:n,a=Cp(t);return[o,R.exports.useCallback(u=>{if(s){const f=u,p=typeof u=="function"?f(r):u;p!==r&&a(p)}else i(u)},[s,r,i,a])]}function Ao(r,e,{checkForDefaultPrevented:t=!0}={}){return function(n){if(r==null||r(n),t===!1||!n.defaultPrevented)return e==null?void 0:e(n)}}const[ww,cN]=yw("Tooltip",[xw]),Df=xw(),oI=700,[uN,aI]=ww("TooltipProvider",{isOpenDelayed:!0,delayDuration:oI,onOpen:()=>{},onClose:()=>{}}),[lI,Of]=ww("Tooltip"),cI=r=>{const{__scopeTooltip:e,children:t,open:n,defaultOpen:i=!1,onOpenChange:s,delayDuration:o}=r,a=aI("Tooltip",e),u=Df(e),[f,p]=R.exports.useState(null),h=PL(),d=R.exports.useRef(0),g=
3054o!=null?o:a.delayDuration,y=R.exports.useRef(!1),{onOpen:_,onClose:w}=a,[x=!1,v]=sI({prop:n,defaultProp:i,onChange:C=>{C&&(document.dispatchEvent(new CustomEvent("tooltip.open")),_()),s==null||s(C)}}),E=R.exports.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),M=R.exports.useCallback(()=>{window.clearTimeout(d.current),y.current=!1,v(!0)},[v]),A=R.exports.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>{y.current=!0,v(!0)},g)},[g,v]);return R.exports.useEffect(()=>()=>window.clearTimeout(d.current),[]),R.exports.createElement(eI,u,R.exports.createElement(lI,{scope:e,contentId:h,open:x,stateAttribute:E,trigger:f,onTriggerChange:p,onTriggerEnter:R.exports.useCallback(()=>{a.isOpenDelayed?A():M()},[a.isOpenDelayed,A,M]),onOpen:R.exports.useCallback(M,[M]),onClose:R.exports.useCallback(()=>{window.clearTimeout(d.current),v(!1),w()},[v,w])},t))},uI=R.exports.forwardRef((r,e)=>{const{__scopeTooltip:t,...n}=r,i=Of("TooltipTrigger",t),s=Df(t),o=Lf(e,i.onTriggerChange),a=R.exports.useRef(!1),u=R.exports.useCallback(()=>a.current=!1,[]);return R.exports.useEffect(()=>()=>document.removeEventListener("mouseup",u),[u]),R.exports.createElement(tI,jt({asChild:!0},s),R.exports.createElement(hw.button,jt({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},n,{ref:o,onMouseEnter:Ao(r.onMouseEnter,i.onTriggerEnter),onMouseLeave:Ao(r.onMouseLeave,i.onClose),onMouseDown:Ao(r.onMouseDown,()=>{i.onClose(),a.current=!0,document.addEventListener("mouseup",u,{once:!0})}),onFocus:Ao(r.onFocus,()=>{a.current||i.onOpen()}),onBlur:Ao(r.onBlur,i.onClose),onClick:Ao(r.onClick,i.onClose)})))}),fI=R.exports.forwardRef((r,e)=>{const{forceMount:t,...n}=r,i=Of("TooltipContent",r.__scopeTooltip);return R.exports.createElement(bw,{present:t||i.open},R.exports.createElement(dI,jt({ref:e},n)))}),dI=R.exports.forwardRef((r,e)=>{const{__scopeTooltip:t,children:n,"aria-label":i,portalled:s=!0,...o}=r,a=Of("TooltipContent",t),u=Df(t),f=s?BL:R.exports.Fragment,{onClose:p}=a;return iI(()=>p()),R.exports.useEffect(()=>(document.addEventListener("tooltip.open",p),()=>document.removeEventListener("tooltip.open",p)),[p]),R.exports.createElement(f,null,R.exports.createElement(pI,{__scopeTooltip:t}),R.exports.createElement(nI,jt({"data-state":a.stateAttribute},u,o,{ref:e,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),R.exports.createElement(aw,null,n),R.exports.createElement(OL,{id:a.contentId,role:"tooltip"},i||n)))}),hI=R.exports.forwardRef((r,e)=>{const{__scopeTooltip:t,...n}=r,i=Df(t);return R.exports.createElement(rI,jt({},i,n,{ref:e}))});function pI(r){const{__scopeTooltip:e}=r,t=Of("CheckTriggerMoved",e),n=gw(t.trigger),i=n==null?void 0:n.left,s=Bv(i),o=n==null?void 0:n.top,a=Bv(o),u=t.onClose;return R.exports.useEffect(()=>{(s!==void 0&&s!==i||a!==void 0&&a!==o)&&u()},[u,s,a,i,o]),null}const mI=cI,gI=uI,yI=fI,vI=hI;function xI(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function Tt(r,e){if(r==null)return{};var t=xI(r,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(r,n)||(t[n]=r[n]))}return t}let Gt;(function(r){r[r.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",r[r.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",r[r.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",r[r.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",r[r.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",r[r.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",r[r.THEME_ERROR=6]="THEME_ERROR",r[r.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",r[r.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",r[r.EMPTY_KEY=9]="EMPTY_KEY"})(Gt||(Gt={}));const _I={[Gt.UNSUPPORTED_INPUT]:(r,e)=>[`An input with type \`${r}\` input was found at path \`${e}\` but it's not supported yet.`],[Gt.NO_COMPONENT_FOR_TYPE]:(r,e)=>[`Type \`${r}\` found at path \`${e}\` can't be displayed in panel because no component supports it yet.`],[Gt.UNKNOWN_INPUT]:(r,e)=>[`input at path \`${r}\` is not recognized.`,e],[Gt.DUPLICATE_KEYS]:(r,e,t)=>[`Key \`${r}\` of path \`${e}\` already exists at path \`${t}\`. Even nested keys need to be unique. Rename one of the keys.`],[Gt.ALREADY_REGISTERED_TYPE]:r=>[`Type ${r} has already been registered. You can't register a component with the same type.`],[Gt.CLIPBOARD_ERROR]:r=>
3054["Error copying the value",r],[Gt.THEME_ERROR]:(r,e)=>[`Error accessing the theme \`${r}.${e}\` value.`],[Gt.PATH_DOESNT_EXIST]:r=>[`Error getting the value at path \`${r}\`. There is probably an error in your \`render\` function.`],[Gt.PATH_DOESNT_EXIST]:r=>[`Error accessing the value at path \`${r}\``],[Gt.INPUT_TYPE_OVERRIDE]:(r,e,t)=>[`Input at path \`${r}\` already exists with type: \`${e}\`. Its type cannot be overridden with type \`${t}\`.`],[Gt.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function Sw(r,e,...t){const[n,...i]=_I[e](...t);console[r]("LEVA: "+n,...i)}const ii=Sw.bind(null,"warn"),bI=Sw.bind(null,"log"),wI=["value"],SI=["schema"],MI=["value"],Mw=[],Fs={};function zv(r){let{value:e}=r,t=Tt(r,wI);for(let n of Mw){const i=n(e,t);if(i)return i}}function mi(r,e){let{schema:t}=e,n=Tt(e,SI);if(r in Fs){ii(Gt.ALREADY_REGISTERED_TYPE,r);return}Mw.push((i,s)=>t(i,s)&&r),Fs[r]=n}function Ch(r,e,t,n){const{normalize:i}=Fs[r];if(i)return i(e,t,n);if(typeof e!="object"||!("value"in e))return{value:e};const{value:s}=e,o=Tt(e,MI);return{value:s,settings:o}}function EI(r,e,t,n,i,s){const{sanitize:o}=Fs[r];return o?o(e,t,n,i,s):e}function Nv(r,e,t){const{format:n}=Fs[r];return n?n(e,t):e}function TI(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function kv(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ke(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kv(Object(t),!0).forEach(function(n){TI(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):kv(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}const Wi=(r,e,t)=>r>t?t:r<e?e:r,AI=r=>{if(r===""||typeof r=="number")return r;try{const e=Fi(r);if(!isNaN(e))return e}catch{}return parseFloat(r)},RI=Math.log(10);function Uv(r){let e=Math.abs(+String(r).replace(".",""));if(e===0)return .01;for(;e!==0&&e%10===0;)e/=10;const t=Math.floor(Math.log(e)/RI)+1,n=Math.floor(Math.log10(Math.abs(r))),i=Math.pow(10,n-t);return Math.max(i,.001)}const Zu=(r,e,t)=>t===e?0:(Wi(r,e,t)-e)/(t-e),Ku=(r,e,t)=>r*(t-e)+e,CI=()=>"_"+Math.random().toString(36).substr(2,9),Hv=/\(([0-9+\-*/^ .]+)\)/,Gv=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,Vv=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,Wv=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,$v=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,jv=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function Fi(r){if(isNaN(Number(r)))if(Hv.test(r)){const e=r.replace(Hv,(t,n)=>String(Fi(n)));return Fi(e)}else if(Gv.test(r)){const e=r.replace(Gv,(t,n,i)=>String(Math.pow(Number(n),Number(i))));return Fi(e)}else if(Vv.test(r)){const e=r.replace(Vv,(t,n,i)=>String(Number(n)*Number(i)));return Fi(e)}else if(Wv.test(r)){const e=r.replace(Wv,(t,n,i)=>{if(i!=0)return String(Number(n)/Number(i));throw new Error("Division by zero")});return Fi(e)}else if($v.test(r)){const e=r.replace($v,(t,n,i)=>String(Number(n)+Number(i)));return Fi(e)}else if(jv.test(r)){const e=r.replace(jv,(t,n,i)=>String(Number(n)-Number(i)));return Fi(e)}else return Number(r);return Number(r)}function PI(r,e){return e.reduce((t,n)=>(!!r&&r.hasOwnProperty(n)&&(t[n]=r[n]),t),{})}function LI(r,e){const t=Ke({},r);return e.forEach(n=>n in r&&delete t[n]),t}function II(r,e){return r.reduce((t,n,i)=>Object.assign(t,{[e[i]]:n}),{})}let br;(function(r){r.BUTTON="BUTTON",r.BUTTON_GROUP="BUTTON_GROUP",r.MONITOR="MONITOR",r.FOLDER="FOLDER"})(br||(br={}));let Sr;(function(r){r.SELECT="SELECT",r.IMAGE="IMAGE",r.NUMBER="NUMBER",r.COLOR="COLOR",r.STRING="STRING",r.BOOLEAN="BOOLEAN",r.INTERVAL="INTERVAL",r.VECTOR3D="VECTOR3D",r.VECTOR2D="VECTOR2D"})(Sr||(Sr={}));const DI=["type","__customInput"],OI=["render","label","optional","disabled","hint","onChange","onEditStart","onEditEnd","transient"],FI=["type"];function Ew(r,e,t={},n){var i,s;if(typeof r!="object"||Array.isArray(r))return{type:n,input:r,options:Ke({key:e,label:e,optional:!1,disabled:!1},t)};if("__customInput"in r){const{type:E,__customInput:M}=r,A=Tt(r,DI);return Ew(M,e,A,E)}const{render:o,label:a,optional:u,disabled:f,hint:p,onChange:h,onEditStart:d,onEditEnd:g,transient:y}
3054=r,_=Tt(r,OI),w=Ke({render:o,key:e,label:a!=null?a:e,hint:p,transient:y!=null?y:!!h,onEditStart:d,onEditEnd:g,disabled:f,optional:u},t);let{type:x}=_,v=Tt(_,FI);return x=n!=null?n:x,x in br?{type:x,input:v,options:w}:{type:x,input:v,options:Ke(Ke({},w),{},{onChange:h,optional:(i=w.optional)!==null&&i!==void 0?i:!1,disabled:(s=w.disabled)!==null&&s!==void 0?s:!1})}}function BI(r,e,t,n){const i=Ew(r,e),{type:s,input:o,options:a}=i;if(s)return s in br?i:{type:s,input:Ch(s,o,t,n),options:a};let u=zv(o);return u?{type:u,input:Ch(u,o,t,n),options:a}:(u=zv({value:o}),u?{type:u,input:Ch(u,{value:o},t,n),options:a}:!1)}function qv(r,e,t,n,i){const{value:s,type:o,settings:a}=r;r.value=Tw({type:o,value:s,settings:a},e,t,n),r.fromPanel=i}const Xv=function(e,t,n){this.type="LEVA_ERROR",this.message="LEVA: "+e,this.previousValue=t,this.error=n};function Tw({type:r,value:e,settings:t},n,i,s){const o=r!=="SELECT"&&typeof n=="function"?n(e):n;let a;try{a=EI(r,o,t,e,i,s)}catch(u){throw new Xv(`The value \`${n}\` did not result in a correct value.`,e,u)}if(Rl(a,e))throw new Xv(`The value \`${n}\` did not result in a value update, which remained the same: \`${e}\`. 3055 You can ignore this warning if this is the intended behavior.`,e);return a}const Aw=(r,e,t=!1)=>{let n=0;return function(){const i=arguments,s=t&&!n,o=()=>r.apply(this,i);window.clearTimeout(n),n=window.setTimeout(o,e),s&&o()}},Rw=r=>r.shiftKey?5:r.altKey?1/5:1,zI=["value"],NI=["min","max"],kI=r=>typeof r=="number"||typeof r=="string"&&!isNaN(parseFloat(r)),Cw=(r,{min:e=-1/0,max:t=1/0,suffix:n})=>{const i=parseFloat(r);if(r===""||isNaN(i))throw Error("Invalid number");const s=Wi(i,e,t);return n?s+n:s},UI=(r,{pad:e=0,suffix:t})=>{const n=parseFloat(r).toFixed(e);return t?n+t:n},Pw=r=>{let{value:e}=r,t=Tt(r,zI);const{min:n=-1/0,max:i=1/0}=t,s=Tt(t,NI),o=Wi(parseFloat(e),n,i);let a;if(!Number.isFinite(e)){const h=String(e).match(/[A-Z]+/i);h&&(a=h[0])}let u=t.step;u||(Number.isFinite(n)?Number.isFinite(i)?u=+(Math.abs(i-n)/100).toPrecision(1):u=+(Math.abs(o-n)/100).toPrecision(1):Number.isFinite(i)&&(u=+(Math.abs(i-o)/100).toPrecision(1)));const f=u?Uv(u)*10:Uv(o);u=u||f/10;const p=Math.round(Wi(Math.log10(1/f),0,2));return{value:a?o+a:o,settings:Ke({initialValue:o,step:u,pad:p,min:n,max:i,suffix:a},s)}},Lw=(r,{step:e,initialValue:t})=>{const n=Math.round((r-t)/e);return t+n*e};var Iw=Object.freeze({__proto__:null,schema:kI,sanitize:Cw,format:UI,normalize:Pw,sanitizeStep:Lw});function qt(){return qt=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},qt.apply(this,arguments)}const Dw=R.exports.createContext({});function Cn(){return R.exports.useContext(Dw)}const qm=R.exports.createContext(null),Ow=R.exports.createContext(null),Fw=R.exports.createContext(null);function Ff(){return R.exports.useContext(Ow)}function HI(){return R.exports.useContext(Fw)}const Bw=()=>({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function Pu(r,e){const[t,n]=r.split(" "),i={};return t!=="none"&&(i.boxShadow=`${e.inset?"inset ":""}0 0 0 $borderWidths${[e.key]} $colors${t!=="default"&&t||e.borderColor}`),n&&(i.backgroundColor=n),i}const Za={$inputStyle:()=>r=>Pu(r,{key:"$input",borderColor:"$highlight1",inset:!0}
3055),$focusStyle:()=>r=>Pu(r,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>r=>Pu(r,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>r=>Pu(r,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:$e,css:fN,createTheme:GI,globalCss:VI,keyframes:dN}=EL({prefix:"leva",theme:Bw(),utils:Ke(Ke({},Za),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:r=>({"&:focus":Za.$focusStyle()(r)}),$focusWithin:r=>({"&:focus-within":Za.$focusStyle()(r)}),$hover:r=>({"&:hover":Za.$hoverStyle()(r)}),$active:r=>({"&:active":Za.$activeStyle()(r)})})}),WI=VI({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function $I(r){const e=Bw();if(!r)return{theme:e,className:""};Object.keys(r).forEach(n=>{Object.assign(e[n],r[n])});const t=GI(e);return{theme:e,className:t.className}}function ai(r,e){const{theme:t}=R.exports.useContext(qm);if(!(r in t)||!(e in t[r]))return ii(Gt.THEME_ERROR,r,e),"";let n=e;for(;;){let i=t[r][n];if(typeof i=="string"&&i.charAt(0)==="$")n=i.substr(1);else return i}}const zw=$e("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),Nw=$e("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${zw}`]:{paddingLeft:0}}),jI=$e(Nw,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),qI=$e("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),XI=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],YI=["onUpdate"];function Xm(r){let{innerLabel:e,value:t,onUpdate:n,onChange:i,onKeyDown:s,type:o,id:a,inputType:u="text",rows:f=0}=r,p=Tt(r,XI);const{id:h,emitOnEditStart:d,emitOnEditEnd:g,disabled:y}=Cn(),_=a||h,w=R.exports.useRef(null),x=f>0,v=x?"textarea":"input",E=R.exports.useCallback(C=>L=>{const D=L.currentTarget.value;C(D)},[]);U.useEffect(()=>{const C=w.current,L=E(D=>{n(D),g()});return C==null||C.addEventListener("blur",L),()=>C==null?void 0:C.removeEventListener("blur",L)},[E,n,g]);const M=R.exports.useCallback(C=>{C.key==="Enter"&&E(n)(C)},[E,n]),A=Object.assign({as:v},x?{rows:f}:{},p);return U.createElement(qI,{textArea:x},e&&typeof e=="string"?U.createElement(Nw,null,e):e,U.createElement(zw,qt({levaType:o,ref:w,id:_,type:u,autoComplete:"off",spellCheck:"false",value:t,onChange:E(i),onFocus:()=>d(),onKeyPress:M,onKeyDown:s,disabled:y},A)))}function JI(r){let{onUpdate:e}=r,t=Tt(r,YI);const n=R.exports.useCallback(s=>e(AI(s)),[e]),i=R.exports.useCallback(s=>{const o=s.key==="ArrowUp"?1:s.key==="ArrowDown"?-1:0;if(o){s.preventDefault();const a=s.altKey?.1:s.shiftKey?10:1;e(u=>parseFloat(u)+o*a)}},[e]);return U.createElement(Xm,qt({},t,{onUpdate:n,onKeyDown:i,type:"number"}))}const Qu=$e("div",{}),Pp=$e("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]}),ZI=$e("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${Pp}::after`]:{opacity:.6},[`${Qu}:hover > & + ${Pp}::after`]:{opacity:.6},[`${Qu}:hover > & > svg`]:{opacity:1}}),kw=$e("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250m
3055s"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${Qu}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),Uw=$e("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${kw} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},"&:hover,&:focus-within":{color:"$highlight3"}}),Hw=$e(Uw,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),KI=$e("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),QI=$e("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),eD=$e("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none"}}}}),Yv=$e("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),Gw=$e("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),tD=$e("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),nD=$e(vI,{fill:"$toolTipBackground"});function Ym({children:r}){const{className:e}=R.exports.useContext(qm);return U.createElement(qP,{className:e},r)}const rD=["align"];function iD(){const{id:r,disable:e,disabled:t}=Cn();return U.createElement(U.Fragment,null,U.createElement(QI,{id:r+"__disable",type:"checkbox",checked:!t,onChange:()=>e(!t)}),U.createElement("label",{htmlFor:r+"__disable"}))}function sD(r){const{id:e,optional:t,hint:n}=Cn(),i=r.htmlFor||(e?{htmlFor:e}:null),s=!n&&typeof r.children=="string"?{title:r.children}:null;return U.createElement(U.Fragment,null,t&&U.createElement(iD,null),n!==void 0?U.createElement(mI,null,U.createElement(gI,{asChild:!0},U.createElement(Yv,qt({},i,r))),U.createElement(yI,{side:"top",sideOffset:2},U.createElement(tD,null,n,U.createElement(nD,null)))):U.createElement(Yv,qt({},i,s,r)))}function Er(r){let{align:e}=r,t=Tt(r,rD);const{value:n,label:i,key:s}=Cn(),{hideCopyButton:o}=HI(),a=!o&&s!==void 0,[u,f]=R.exports.useState(!1),p=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[s]:n!=null?n:""})),f(!0)}catch{ii(Gt.CLIPBOARD_ERROR,{[s]:n})}};return U.createElement(KI,{align:e,onPointerLeave:()=>f(!1)},U.createElement(sD,t),a&&U.createElement("div",{title:`Click to copy ${typeof i=="string"?i:s} value`},u?U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},U.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),U.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):U.createElement("svg",{onClick:p,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},U.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),U.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const oD=["toggled"],aD=$e("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function Jm(r){let{toggled:e}=r,t=Tt(r,oD);return U.createElement(aD,qt({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${e?0:-90}deg)`}},t),U.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const lD=["input"];
3055function hr(r){let{input:e}=r,t=Tt(r,lD);return e?U.createElement(Hw,t):U.createElement(Uw,t)}function Vw({value:r,type:e,settings:t,setValue:n}){const[i,s]=R.exports.useState(Nv(e,r,t)),o=R.exports.useRef(r),a=R.exports.useRef(t);a.current=t;const u=R.exports.useCallback(p=>s(Nv(e,p,a.current)),[e]),f=R.exports.useCallback(p=>{try{n(p)}catch(h){const{type:d,previousValue:g}=h;if(d!=="LEVA_ERROR")throw h;u(g)}},[u,n]);return R.exports.useEffect(()=>{Rl(r,o.current)||u(r),o.current=r},[r,u]),{displayValue:i,onChange:s,onUpdate:f}}function Wl(r,e){const{emitOnEditStart:t,emitOnEditEnd:n}=Cn();return AL(i=>{i.first&&(document.body.classList.add("leva__panel__dragged"),t==null||t());const s=r(i);return i.last&&(document.body.classList.remove("leva__panel__dragged"),n==null||n()),s},e)}function cD(r){const e=R.exports.useRef(null),t=R.exports.useRef(null),n=R.exports.useRef(!1);return R.exports.useEffect(()=>{const i=Aw(()=>{e.current.width=e.current.offsetWidth*window.devicePixelRatio,e.current.height=e.current.offsetHeight*window.devicePixelRatio,r(e.current,t.current)},250);return window.addEventListener("resize",i),n.current||(i(),n.current=!0),()=>window.removeEventListener("resize",i)},[r]),R.exports.useEffect(()=>{t.current=e.current.getContext("2d")},[]),[e,t]}function Ww(){const r=R.exports.useRef(null),e=R.exports.useRef({x:0,y:0}),t=R.exports.useCallback(n=>{Object.assign(e.current,n),r.current&&(r.current.style.transform=`translate3d(${e.current.x}px, ${e.current.y}px, 0)`)},[]);return[r,t]}const uD=["__refCount"],Ph=(r,e)=>{if(!r[e])return null;const t=r[e];return Tt(t,uD)};function fD(r){const e=Ff(),[t,n]=R.exports.useState(Ph(e.getData(),r)),i=R.exports.useCallback(f=>e.setValueAtPath(r,f,!0),[r,e]),s=R.exports.useCallback(f=>e.setSettingsAtPath(r,f),[r,e]),o=R.exports.useCallback(f=>e.disableInputAtPath(r,f),[r,e]),a=R.exports.useCallback(()=>e.emitOnEditStart(r),[r,e]),u=R.exports.useCallback(()=>e.emitOnEditEnd(r),[r,e]);return R.exports.useEffect(()=>{n(Ph(e.getData(),r));const f=e.useStore.subscribe(p=>Ph(p.data,r),n,{equalityFn:Vl});return()=>f()},[e,r]),[t,{set:i,setSettings:s,disable:o,storeId:e.storeId,emitOnEditStart:a,emitOnEditEnd:u}]}const dD=$e("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),$w=$e("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),Lp=$e("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),jw=$e("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),qw=$e("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function hD({value:r,min:e,max:t,onDrag:n,step:i,initialValue:s}){const o=R.exports.useRef(null),a=R.exports.useRef(null),u=R.exports.useRef(0),f=ai("sizes","scrubberWidth"),p=Wl(({event:d,first:g,xy:[y],movement:[_],memo:w})=>{if(g){const{width:v,left:E}=o.current.getBoundingClientRect();u.current=v-parseFloat(f),w=(d==null?void 0:d.target)===a.current?r:Ku((y-E)/v,e,t)}const x=w+Ku(_/u.current,0,t-e);return n(Lw(x,{step:i,initialValue:s})),w}),h=Zu(r,e,t);return U.createElement(jw,qt({ref:o},p()),U.createElement($w,null,U.createElement(qw,{style:{left:0,right:`${(1-h)*100}%`}})),U.createElement(Lp,{ref:a,style:{left:`calc(${h} * (100% - ${f}))`}}))}const pD=U.memo(({label:r,onUpdate:e,step:t,innerLabelTrim:n})=>{const[i,s]=R.exports.useState(!1),o=Wl(({active:a,delta:[u],event:f,memo:p=0})=>(s(a),p+=u/2,Math.abs(p)>=1&&(e(h=>parseFloat(h)+Math.floor(p)*t*Rw(f)),p=0),p));return U.createElement(jI,qt({dragging:i,title:r.length>1?r:""},o()),r.slice(0,n))});
3055function Xw({label:r,id:e,displayValue:t,onUpdate:n,onChange:i,settings:s,innerLabelTrim:o=1}){const a=o>0&&U.createElement(pD,{label:r,step:s.step,onUpdate:n,innerLabelTrim:o});return U.createElement(JI,{id:e,value:String(t),onUpdate:n,onChange:i,innerLabel:a})}function mD(){const r=Cn(),{label:e,value:t,onUpdate:n,settings:i,id:s}=r,{min:o,max:a}=i,u=a!==1/0&&o!==-1/0;return U.createElement(hr,{input:!0},U.createElement(Er,null,e),U.createElement(dD,{hasRange:u},u&&U.createElement(hD,qt({value:parseFloat(t),onDrag:n},i)),U.createElement(Xw,qt({},r,{id:s,label:"value",innerLabelTrim:u?0:1}))))}const{sanitizeStep:gD}=Iw,yD=Tt(Iw,["sanitizeStep"]);var vD=Ke({component:mD},yD);const xD=(r,e)=>Vn().schema({options:Vn().passesAnyOf(Vn().object(),Vn().array())}).test(e),_D=(r,{values:e})=>{if(e.indexOf(r)<0)throw Error("Selected value doesn't match Select options");return r},bD=(r,{values:e})=>e.indexOf(r),wD=r=>{let{value:e,options:t}=r,n,i;return Array.isArray(t)?(i=t,n=t.map(s=>String(s))):(i=Object.values(t),n=Object.keys(t)),"value"in r?i.includes(e)||(n.unshift(String(e)),i.unshift(e)):e=i[0],Object.values(t).includes(e)||(t[String(e)]=e),{value:e,settings:{keys:n,values:i}}};var SD=Object.freeze({__proto__:null,schema:xD,sanitize:_D,format:bD,normalize:wD});const MD=$e("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),Ip=$e("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}
3055),ED=$e("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${Ip}:focus + &`]:{$focusStyle:""},[`${Ip}:hover + &`]:{$hoverStyle:""}});function TD({displayValue:r,value:e,onUpdate:t,id:n,settings:i,disabled:s}){const{keys:o,values:a}=i,u=R.exports.useRef();return e===a[r]&&(u.current=o[r]),U.createElement(MD,null,U.createElement(Ip,{id:n,value:r,onChange:f=>t(a[Number(f.currentTarget.value)]),disabled:s},o.map((f,p)=>U.createElement("option",{key:f,value:p},f))),U.createElement(ED,null,u.current),U.createElement(Jm,{toggled:!0}))}function AD(){const{label:r,value:e,displayValue:t,onUpdate:n,id:i,disabled:s,settings:o}=Cn();return U.createElement(hr,{input:!0},U.createElement(Er,null,r),U.createElement(TD,{id:i,value:e,displayValue:t,onUpdate:n,settings:o,disabled:s}))}var RD=Ke({component:AD},SD);const CD=r=>Vn().string().test(r),PD=r=>{if(typeof r!="string")throw Error("Invalid string");return r},LD=({value:r,editable:e=!0,rows:t=!1})=>({value:r,settings:{editable:e,rows:typeof t=="number"?t:t?5:0}});var ID=Object.freeze({__proto__:null,schema:CD,sanitize:PD,normalize:LD});const DD=["displayValue","onUpdate","onChange","editable"],OD=$e("div",{whiteSpace:"pre-wrap"});function FD(r){let{displayValue:e,onUpdate:t,onChange:n,editable:i=!0}=r,s=Tt(r,DD);return i?U.createElement(Xm,qt({value:e,onUpdate:t,onChange:n},s)):U.createElement(OD,null,e)}function BD(){const{label:r,settings:e,displayValue:t,onUpdate:n,onChange:i}=Cn();return U.createElement(hr,{input:!0},U.createElement(Er,null,r),U.createElement(FD,qt({displayValue:t,onUpdate:n,onChange:i},e)))}var zD=Ke({component:BD},ID);const ND=r=>Vn().boolean().test(r),kD=r=>{if(typeof r!="boolean")throw Error("Invalid boolean");return r};var UD=Object.freeze({__proto__:null,schema:ND,sanitize:kD});const HD=$e("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function GD({value:r,onUpdate:e,id:t,disabled:n}){return U.createElement(HD,null,U.createElement("input",{id:t,type:"checkbox",checked:r,onChange:i=>e(i.currentTarget.checked),disabled:n}),U.createElement("label",{htmlFor:t},U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},U.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function VD(){const{label:r,value:e,onUpdate:t,disabled:n,id:i}=Cn();return U.createElement(hr,{input:!0},U.createElement(Er,null,r),U.createElement(GD,{value:e,onUpdate:t,id:i,disabled:n}))}var WD=Ke({component:VD},UD);const $D=["locked"];function jD({value:r,id:e,valueKey:t,settings:n,onUpdate:i,innerLabelTrim:s}){const o=R.exports.useRef(r[t]);o.current=r[t];const a=R.exports.useCallback(f=>i({[t]:Tw({type:"NUMBER",value:o.current,settings:n},f)}),[i,n,t]),u=Vw({type:"NUMBER",value:r[t],settings:n,setValue:a});return U.createElement(Xw,{id:e,label:t,value:r[t],displayValue:u.displayValue,onUpdate:u.onUpdate,onChange:u.onChange,settings:n,innerLabelTrim:s})}const qD=$e("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function XD(r){let{locked:e}=r,t=Tt(r,$D);return U.createElement("svg",qt({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e?U.createElement("path",{d:"M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):U.createElement("path",{d:"M9 3.63601C9 2.76044 9.24207 2.11211 9.64154 1.68623C10.0366 1.26502 10.6432 1 11.5014 1C12.4485 1 13.0839 1.30552 13.4722 1.80636C13.8031 2.23312 14 2.84313 14 3.63325H15C15 2.68242 14.7626 1.83856 14.2625 1.19361C13.6389 0.38943 12.6743 0 11.5014 0C10.4294 0 9.53523 0.337871 8.91218 1.0021C8.29351 1.66167 8 2.58135 8 3.63601V6H1C0.447715 6 0 6.44772 0 7V13C0 13.5523 0.447715 14 1 14H10C10.5523 14 11 13.5523 11 13V7C11 6.44772 10.5523 6 10 6H9V3.63601ZM1 7H10V13H1V7Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function Zm({value:r,onUpdate:e,settings:t,innerLabelTrim:n}){const{id:i,setSettings:s}=Cn(),{lock:o,locked:a}=t;return U.createElement(qD,{withLock:o},o&&U.createElement(XD,{locked:a,onClick:()=>s({locked:!a})}),Object.keys(r).map((u,f)=>
3055U.createElement(jD,{id:f===0?i:`${i}.${u}`,key:u,valueKey:u,value:r,settings:t[u],onUpdate:e,innerLabelTrim:n})))}const Yw=(r,e)=>{const t={};let n=0,i=1/0;Object.entries(r).forEach(([s,o])=>{t[s]=Pw(Ke({value:o},e[s])).settings,n=Math.max(n,t[s].step),i=Math.min(i,t[s].pad)});for(let s in t){const{step:o,min:a,max:u}=e[s]||{};!isFinite(o)&&(!isFinite(a)||!isFinite(u))&&(t[s].step=n,t[s].pad=i)}return t},YD=["lock"],JD=["value"];function ZD(r){const e=Vn().array().length(r).every.number(),t=n=>{if(!n||typeof n!="object")return!1;const i=Object.values(n);return i.length===r&&i.every(s=>isFinite(s))};return n=>e.test(n)||t(n)}function KD(r){return Array.isArray(r)?"array":"object"}function al(r,e,t){return KD(r)===e?r:e==="array"?Object.values(r):II(r,t)}const QD=(r,e,t)=>{const n=al(r,"object",e.keys);for(let o in n)n[o]=Cw(n[o],e[o]);const i=Object.keys(n);let s={};if(i.length===e.keys.length)s=n;else{const o=al(t,"object",e.keys);if(i.length===1&&e.locked){const a=i[0],u=n[a],f=o[a],p=f!==0?u/f:1;for(let h in o)h===a?s[a]=u:s[h]=o[h]*p}else s=Ke(Ke({},o),n)}return al(s,e.format,e.keys)},eO=(r,e)=>al(r,"object",e.keys),tO=r=>!!r&&("step"in r||"min"in r||"max"in r);function nO(r,e,t=[]){const{lock:n=!1}=e,i=Tt(e,YD),s=Array.isArray(r)?"array":"object",o=s==="object"?Object.keys(r):t,a=al(r,"object",o),u=tO(i)?o.reduce((p,h)=>Object.assign(p,{[h]:i}),{}):i,f=Yw(a,u);return{value:s==="array"?r:a,settings:Ke(Ke({},f),{},{format:s,keys:o,lock:n,locked:!1})}}function Jw(r){return{schema:ZD(r.length),normalize:e=>{let{value:t}=e,n=Tt(e,JD);return nO(t,n,r)},format:(e,t)=>eO(e,t),sanitize:(e,t,n)=>QD(e,t,n)}}var rO={grad:.9,turn:360,rad:360/(2*Math.PI)},ni=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},hn=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*r)/t+0},dr=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),r>t?t:r>e?r:e},Zw=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},Jv=function(r){return{r:dr(r.r,0,255),g:dr(r.g,0,255),b:dr(r.b,0,255),a:dr(r.a)}},Lh=function(r){return{r:hn(r.r),g:hn(r.g),b:hn(r.b),a:hn(r.a,3)}},iO=/^#([0-9a-f]{3,8})$/i,Lu=function(r){var e=r.toString(16);return e.length<2?"0"+e:e},Kw=function(r){var e=r.r,t=r.g,n=r.b,i=r.a,s=Math.max(e,t,n),o=s-Math.min(e,t,n),a=o?s===e?(t-n)/o:s===t?2+(n-e)/o:4+(e-t)/o:0;return{h:60*(a<0?a+6:a),s:s?o/s*100:0,v:s/255*100,a:i}},Qw=function(r){var e=r.h,t=r.s,n=r.v,i=r.a;e=e/360*6,t/=100,n/=100;var s=Math.floor(e),o=n*(1-t),a=n*(1-(e-s)*t),u=n*(1-(1-e+s)*t),f=s%6;return{r:255*[n,a,o,o,u,n][f],g:255*[u,n,n,a,o,o][f],b:255*[o,o,u,n,n,a][f],a:i}},Zv=function(r){return{h:Zw(r.h),s:dr(r.s,0,100),l:dr(r.l,0,100),a:dr(r.a)}},Kv=function(r){return{h:hn(r.h),s:hn(r.s),l:hn(r.l),a:hn(r.a,3)}},Qv=function(r){return Qw((t=(e=r).s,{h:e.h,s:(t*=((n=e.l)<50?n:100-n)/100)>0?2*t/(n+t)*100:0,v:n+t,a:e.a}));var e,t,n},ll=function(r){return{h:(e=Kw(r)).h,s:(i=(200-(t=e.s))*(n=e.v)/100)>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,t,n,i},sO=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,oO=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,aO=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lO=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Dp={string:[[function(r){var e=iO.exec(r);return e?(r=e[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?hn(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?hn(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var e=aO.exec(r)||lO.exec(r);return e?e[2]!==e[4]||e[4]!==e[6]?null:Jv({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(r){var e=sO.exec(r)||oO.exec(r);if(!e)return null;var t,n,i=Zv({h:(t=e[1],n=e[2],n===void 0&&(n="deg"),Number(t)*(rO[n]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return Qv(i)},"hsl"]],object:[[function(r){var e=r.r,t=r.g,n=r.b,i=r.a,s=i===void 0?1:i;return ni(e)&&ni(t)&&ni(n)?Jv({r:Number(e),g:Number(t),b:Number(n),a:Number(s)}):null},"rgb"],[function(r){var e=r.h,t=r.s,n=r.l,i=r.a,s=i===void 0?1:i;if(!ni(e)||!ni(t)||!ni(n))return null;var o=Zv({h:Number(e),s:Number(t),l:Number(n),a:Number(s)});return Qv(o)},"hsl"],[function(r){var e=r.h,t=r.s,n=r.v,i=r.a,s=i===void 0?1:i;if(!ni(e)||!ni(t)||!ni(n))return null;var o=function(a){return{h:Zw(a.h),s:dr(a.s,0,100),v:dr(a.v,0,100),a:dr(a.a)}}({h:Number(e),s:Number(t),v:Number(n),a:Number(s)});return Qw(o)},"hsv"]]},ex=function(r,e){for(var t=0;t<e.length;t++){var n=e[t][0](r);if(n)return[n,e[t][1]]}return[null,void 0]},e1=function(r){return typeof r=="string"?ex(r.trim(),Dp.string):typeof r=="object"&&r!==null?ex(r,Dp.object):[null,void 0]},cO=function(r){return e1(r)[1]},Ih=function(r,e){var t=ll(r);return{h:t.h,s:dr(t.s+100*e,0,100),l:t.l,a:t.a}},Dh=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},tx=function(r,e){var t=ll(r);return{h:t.h,s:t.s,l:dr(t.l+100*e,0,100),a:t.a}},Op=function(){function r(e){this.parsed=e1(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return this.parsed!==null},r.prototype.brightness=function(){return hn(Dh(this.rgba),2)},r.prototype.isDark=function(){return Dh(this.rgba)<.5},r.prototype.isLight=function(){return Dh(this.rgba)>=.5},r.prototype.toHex=function(){return e=Lh(this.rgba),t=e.r,n=e.g,i=e.b,o=(s=e.a)<1?Lu(hn(255*s)):"","#"+Lu(t)+Lu(n)+Lu(i)+o;var e,t,n,i,s,o},r.prototype.toRgb=function(){return Lh(this.rgba)},r.prototype.toRgbString=function(){return e=Lh(this.rgba),t=e.r,n=e.g,i=e.b,(s=e.a)<1?"rgba("+t+", "+n+", "+i+", "+s+")":"rgb("+t+", "+n+", "+i+")";var e,t,n,i,s},r.prototype.toHsl=function(){return Kv(ll(this.rgba))},r.prototype.toHslString=function(){return e=Kv(ll(this.rgba)),t=e.h,n=e.s,i=e.l,(s=e.a)<1?"hsla("+t+", "+n+"%, "+i+"%, "+s+")":"hsl("+t+", "+n+"%, "+i+"%)";var e,t,n,i,s},r.prototype.toHsv=function(){return e=Kw(this.rgba),{h:hn(e.h),s:hn(e.s),v:hn(e.v),a:hn(e.a,3)};var e},r.prototype.invert=function(){return Dn({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},r.prototype.saturate=function(e){return e===void 0&&(e=.1),Dn(Ih(this.rgba,e))},r.prototype.desaturate=function(e){return e===void 0&&(e=.1),Dn(Ih(this.rgba,-e))},r.prototype.grayscale=function(){return Dn(Ih(this.rgba,-1))},r.prototype.lighten=function(e){return e===void 0&&(e=.1),Dn(tx(this.rgba,e))},r.prototype.darken=function(e){return e===void 0&&(e=.1),Dn(tx(this.rgba,-e))},r.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},r.prototype.alpha=function(e){return typeof e=="number"?Dn({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):hn(this.rgba.a,3);var t},r.prototype.hue=function(e){var t=ll(this.rgba);return typeof e=="number"?Dn({h:e,s:t.s,l:t.l,a:t.a}):hn(t.h)},r.prototype.isEqual=function(e){return this.toHex()===Dn(e).toHex()},r}(),Dn=function(r){return r instanceof Op?r:new Op(r)},nx=[],uO=function(r){r.forEach(function(e){nx.indexOf(e)<0&&(e(Op,Dp),nx.push(e))})};function fO(r,e){var t={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",s
3055andybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var i in t)n[t[i]]=i;var s={};r.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,u,f=n[this.toHex()];if(f)return f;if(o!=null&&o.closest){var p=this.toRgb(),h=1/0,d="black";if(!s.length)for(var g in t)s[g]=new r(t[g]).toRgb();for(var y in t){var _=(a=p,u=s[y],Math.pow(a.r-u.r,2)+Math.pow(a.g-u.g,2)+Math.pow(a.b-u.b,2));_<h&&(h=_,d=y)}return d}},e.string.push([function(o){var a=o.toLowerCase(),u=a==="transparent"?"#0000":t[a];return u?new r(u).toRgb():null},"name"])}function da(){return(da=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r}).apply(this,arguments)}function Km(r,e){if(r==null)return{};var t,n,i={},s=Object.keys(r);for(n=0;n<s.length;n++)e.indexOf(t=s[n])>=0||(i[t]=r[t]);return i}function Fp(r){var e=R.exports.useRef(r),t=R.exports.useRef(function(n){e.current&&e.current(n)});return e.current=r,t.current}var ta=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),r>t?t:r<e?e:r},cl=function(r){return"touches"in r},Bp=function(r){return r&&r.ownerDocument.defaultView||self},rx=function(r,e,t){var n=r.getBoundingClientRect(),i=cl(e)?function(s,o){for(var a=0;a<s.length;a++)if(s[a].identifier===o)return s[a];return s[0]}(e.touches,t):e;return{left:ta((i.pageX-(n.left+Bp(r).pageXOffset))/n.width),top:ta((i.pageY-(n.top+Bp(r).pageYOffset))/n.height)}},ix=function(r){!cl(r)&&r.preventDefault()},Qm=U.memo(function(r){var e=r.onMove,t=r.onKey,n=Km(r,["onMove","onKey"]),i=R.exports.useRef(null),s=Fp(e),o=Fp(t),a=R.exports.useRef(null),u=R.exports.useRef(!1),f=R.exports.useMemo(function(){var g=function(w){ix(w),(cl(w)?w.touches.length>0:w.buttons>0)&&i.current?s(rx(i.current,w,a.current)):_(!1)},y=function(){return _(!1)};function _(w){var x=u.current,v=Bp(i.current),E=w?v.addEventListener:v.removeEventListener;E(x?"touchmove":"mousemove",g),E(x?"touchend":"mouseup",y)}return[function(w){var x=w.nativeEvent,v=i.current;if(v&&(ix(x),!function(M,A){return A&&!cl(M)}
vendor: 4,482 bytes, line 3055
3055(x,u.current)&&v)){if(cl(x)){u.current=!0;var E=x.changedTouches||[];E.length&&(a.current=E[0].identifier)}v.focus(),s(rx(v,x,a.current)),_(!0)}},function(w){var x=w.which||w.keyCode;x<37||x>40||(w.preventDefault(),o({left:x===39?.05:x===37?-.05:0,top:x===40?.05:x===38?-.05:0}))},_]},[o,s]),p=f[0],h=f[1],d=f[2];return R.exports.useEffect(function(){return d},[d]),U.createElement("div",da({},n,{onTouchStart:p,onMouseDown:p,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),$l=function(r){return r.filter(Boolean).join(" ")},eg=function(r){var e=r.color,t=r.left,n=r.top,i=n===void 0?.5:n,s=$l(["react-colorful__pointer",r.className]);return U.createElement("div",{className:s,style:{top:100*i+"%",left:100*t+"%"}},U.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},On=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*r)/t},t1=function(r){var e=r.s,t=r.v,n=r.a,i=(200-e)*t/100;return{h:On(r.h),s:On(i>0&&i<200?e*t/100/(i<=100?i:200-i)*100:0),l:On(i/2),a:On(n,2)}},zp=function(r){var e=t1(r);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},Oh=function(r){var e=t1(r);return"hsla("+e.h+", "+e.s+"%, "+e.l+"%, "+e.a+")"},n1=function(r){var e=r.h,t=r.s,n=r.v,i=r.a;e=e/360*6,t/=100,n/=100;var s=Math.floor(e),o=n*(1-t),a=n*(1-(e-s)*t),u=n*(1-(1-e+s)*t),f=s%6;return{r:On(255*[n,a,o,o,u,n][f]),g:On(255*[u,n,n,a,o,o][f]),b:On(255*[o,o,u,n,n,a][f]),a:On(i,2)}},r1=function(r){var e=r.r,t=r.g,n=r.b,i=r.a,s=Math.max(e,t,n),o=s-Math.min(e,t,n),a=o?s===e?(t-n)/o:s===t?2+(n-e)/o:4+(e-t)/o:0;return{h:On(60*(a<0?a+6:a)),s:On(s?o/s*100:0),v:On(s/255*100),a:i}},i1=U.memo(function(r){var e=r.hue,t=r.onChange,n=$l(["react-colorful__hue",r.className]);return U.createElement("div",{className:n},U.createElement(Qm,{onMove:function(i){t({h:360*i.left})},onKey:function(i){t({h:ta(e+360*i.left,0,360)})},"aria-label":"Hue","aria-valuetext":On(e)},U.createElement(eg,{className:"react-colorful__hue-pointer",left:e/360,color:zp({h:e,s:100,v:100,a:1})})))}),s1=U.memo(function(r){var e=r.hsva,t=r.onChange,n={backgroundColor:zp({h:e.h,s:100,v:100,a:1})};return U.createElement("div",{className:"react-colorful__saturation",style:n},U.createElement(Qm,{onMove:function(i){t({s:100*i.left,v:100-100*i.top})},onKey:function(i){t({s:ta(e.s+100*i.left,0,100),v:ta(e.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+On(e.s)+"%, Brightness "+On(e.v)+"%"},U.createElement(eg,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:zp(e)})))}),tg=function(r,e){if(r===e)return!0;for(var t in r)if(r[t]!==e[t])return!1;return!0};function o1(r,e,t){var n=Fp(t),i=R.exports.useState(function(){return r.toHsva(e)}),s=i[0],o=i[1],a=R.exports.useRef({color:e,hsva:s});R.exports.useEffect(function(){if(!r.equal(e,a.current.color)){var f=r.toHsva(e);a.current={hsva:f,color:e},o(f)}},[e,r]),R.exports.useEffect(function(){var f;tg(s,a.current.hsva)||r.equal(f=r.fromHsva(s),a.current.color)||(a.current={hsva:s,color:f},n(f))},[s,r,n]);var u=R.exports.useCallback(function(f){o(function(p){return Object.assign({},p,f)})},[]);return[s,u]}var dO=typeof window!="undefined"?R.exports.useLayoutEffect:R.exports.useEffect,hO=function(){return typeof __webpack_nonce__!="undefined"?__webpack_nonce__:void 0},sx=new Map,a1=function(r){dO(function(){var e=r.current?r.current.ownerDocument:document;if(e!==void 0&&!sx.has(e)){var t=e.createElement("style");t.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;
3055left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,sx.set(e,t);var n=hO();n&&t.setAttribute("nonce",n),e.head.appendChild(t)}},[])},pO=function(r){var e=r.className,t=r.colorModel,n=r.color,i=n===void 0?t.defaultColor:n,s=r.onChange,o=Km(r,["className","colorModel","color","onChange"]),a=R.exports.useRef(null);a1(a);var u=o1(t,i,s),f=u[0],p=u[1],h=$l(["react-colorful",e]);return U.createElement("div",da({},o,{ref:a,className:h}),U.createElement(s1,{hsva:f,onChange:p}),U.createElement(i1,{hue:f.h,onChange:p,className:"react-colorful__last-control"}))},mO=function(r){var e=r.className,t=r.hsva,n=r.onChange,i={backgroundImage:"linear-gradient(90deg, "+Oh(Object.assign({},t,{a:0}))+", "+Oh(Object.assign({},t,{a:1}))+")"},s=$l(["react-colorful__alpha",e]);return U.createElement("div",{className:s},U.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),U.createElement(Qm,{onMove:function(o){n({a:o.left})},onKey:function(o){n({a:ta(t.a+o.left)})},"aria-label":"Alpha","aria-valuetext":On(100*t.a)+"%"},U.createElement(eg,{className:"react-colorful__alpha-pointer",left:t.a,color:Oh(t)})))},gO=function(r){var e=r.className,t=r.colorModel,n=r.color,i=n===void 0?t.defaultColor:n,s=r.onChange,o=Km(r,["className","colorModel","color","onChange"]),a=R.exports.useRef(null);a1(a);var u=o1(t,i,s),f=u[0],p=u[1],h=$l(["react-colorful",e]);return U.createElement("div",da({},o,{ref:a,className:h}),U.createElement(s1,{hsva:f,onChange:p}),U.createElement(i1,{hue:f.h,onChange:p}),U.createElement(mO,{hsva:f,onChange:p,className:"react-colorful__last-control"}))},yO={defaultColor:{r:0,g:0,b:0,a:1},toHsva:r1,fromHsva:n1,equal:tg},vO=function(r){return U.createElement(gO,da({},r,{colorModel:yO}))},xO={defaultColor:{r:0,g:0,b:0},toHsva:function(r){return r1({r:r.r,g:r.g,b:r.b,a:1})},fromHsva:function(r){return{r:(e=n1(r)).r,g:e.g,b:e.b};var e},equal:tg},_O=function(r){return U.createElement(pO,da({},r,{colorModel:xO}))};function ha(r,e,t,n){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(p){try{f(n.next(p))}catch(h){o(h)}}function u(p){try{f(n.throw(p))}catch(h){o(h)}}function f(p){p.done?s(p.value):i(p.value).then(a,u)}f((n=n.apply(r,e||[])).next())})}function pa(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(f){return function(p){return u([f,p])}}function u(f){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(s=f[0]&2?i.return:f[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,f[1])).done)return s;switch(i=0,s&&(f=[f[0]&2,s.value]),f[0]){case 0:case 1:s=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,i=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!s||f[1]>s[0]&&f[1]<s[3])){t.label=f[1];break}if(f[0]===6&&t.label<s[1]){t.label=s[1],s=f;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(f);break}s[2]&&t.ops.pop(),t.trys.pop();continue}f=e.call(r,t)}catch(p){f=[6,p],i=0}finally{n=s=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function bO(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s}function wO(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(bO(arguments[e]));return r}var SO=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function jl(r,e){var t=MO(r);if(typeof t.path!="string"){var n=r.webkitRelativePath;Object.defineProperty(t,"path",{value:typeof e=="string"?e:typeof n=="string"&&n.length>
30550?n:r.name,writable:!1,configurable:!1,enumerable:!0})}return t}function MO(r){var e=r.name,t=e&&e.lastIndexOf(".")!==-1;if(t&&!r.type){var n=e.split(".").pop().toLowerCase(),i=SO.get(n);i&&Object.defineProperty(r,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return r}var EO=[".DS_Store","Thumbs.db"];function TO(r){return ha(this,void 0,void 0,function(){return pa(this,function(e){return ef(r)&&AO(r)?[2,LO(r.dataTransfer,r.type)]:RO(r)?[2,CO(r)]:Array.isArray(r)&&r.every(function(t){return"getFile"in t&&typeof t.getFile=="function"})?[2,PO(r)]:[2,[]]})})}function AO(r){return ef(r.dataTransfer)}function RO(r){return ef(r)&&ef(r.target)}function ef(r){return typeof r=="object"&&r!==null}function CO(r){return Np(r.target.files).map(function(e){return jl(e)})}function PO(r){return ha(this,void 0,void 0,function(){var e;return pa(this,function(t){switch(t.label){case 0:return[4,Promise.all(r.map(function(n){return n.getFile()}))];case 1:return e=t.sent(),[2,e.map(function(n){return jl(n)})]}})})}function LO(r,e){return ha(this,void 0,void 0,function(){var t,n;return pa(this,function(i){switch(i.label){case 0:return r===null?[2,[]]:r.items?(t=Np(r.items).filter(function(s){return s.kind==="file"}),e!=="drop"?[2,t]:[4,Promise.all(t.map(IO))]):[3,2];case 1:return n=i.sent(),[2,ox(l1(n))];case 2:return[2,ox(Np(r.files).map(function(s){return jl(s)}))]}})})}function ox(r){return r.filter(function(e){return EO.indexOf(e.name)===-1})}function Np(r){if(r===null)return[];for(var e=[],t=0;t<r.length;t++){var n=r[t];e.push(n)}return e}function IO(r){if(typeof r.webkitGetAsEntry!="function")return ax(r);var e=r.webkitGetAsEntry();return e&&e.isDirectory?c1(e):ax(r)}function l1(r){return r.reduce(function(e,t){return wO(e,Array.isArray(t)?l1(t):[t])},[])}function ax(r){var e=r.getAsFile();if(!e)return Promise.reject(r+" is not a File");var t=jl(e);return Promise.resolve(t)}function DO(r){return ha(this,void 0,void 0,function(){return pa(this,function(e){return[2,r.isDirectory?c1(r):OO(r)]})})}function c1(r){var e=r.createReader();return new Promise(function(t,n){var i=[];function s(){var o=this;e.readEntries(function(a){return ha(o,void 0,void 0,function(){var u,f,p;return pa(this,function(h){switch(h.label){case 0:if(a.length)return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return u=h.sent(),t(u),[3,4];case 3:return f=h.sent(),n(f),[3,4];case 4:return[3,6];case 5:p=Promise.all(a.map(DO)),i.push(p),s(),h.label=6;case 6:return[2]}})})},function(a){n(a)})}s()})}function OO(r){return ha(this,void 0,void 0,function(){return pa(this,function(e){return[2,new Promise(function(t,n){r.file(function(i){var s=jl(i,r.fullPath);t(s)},function(i){n(i)})})]})})}var FO=function(r,e){if(r&&e){var t=Array.isArray(e)?e:e.split(","),n=r.name||"",i=(r.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return t.some(function(o){var a=o.trim().toLowerCase();return a.charAt(0)==="."?n.toLowerCase().endsWith(a):a.endsWith("/*")?s===a.replace(/\/.*$/,""):i===a})}return!0};function lx(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function cx(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lx(Object(t),!0).forEach(function(n){u1(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):lx(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function u1(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ux(r,e){return kO(r)||NO(r,e)||zO(r,e)||BO()}function BO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 3056In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zO(r,e){if(!!r){if(typeof r=="string")return fx(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);
3056if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return fx(r,e)}}function fx(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function NO(r,e){var t=r==null?null:typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n=[],i=!0,s=!1,o,a;try{for(t=t.call(r);!(i=(o=t.next()).done)&&(n.push(o.value),!(e&&n.length===e));i=!0);}catch(u){s=!0,a=u}finally{try{!i&&t.return!=null&&t.return()}finally{if(s)throw a}}return n}}function kO(r){if(Array.isArray(r))return r}var UO="file-invalid-type",HO="file-too-large",GO="file-too-small",VO="too-many-files",WO=function(e){e=Array.isArray(e)&&e.length===1?e[0]:e;var t=Array.isArray(e)?"one of ".concat(e.join(", ")):e;return{code:UO,message:"File type must be ".concat(t)}},dx=function(e){return{code:HO,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},hx=function(e){return{code:GO,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},$O={code:VO,message:"Too many files"};function f1(r,e){var t=r.type==="application/x-moz-file"||FO(r,e);return[t,t?null:WO(e)]}function d1(r,e,t){if(Ka(r.size))if(Ka(e)&&Ka(t)){if(r.size>t)return[!1,dx(t)];if(r.size<e)return[!1,hx(e)]}else{if(Ka(e)&&r.size<e)return[!1,hx(e)];if(Ka(t)&&r.size>t)return[!1,dx(t)]}return[!0,null]}function Ka(r){return r!=null}function jO(r){var e=r.files,t=r.accept,n=r.minSize,i=r.maxSize,s=r.multiple,o=r.maxFiles;return!s&&e.length>1||s&&o>=1&&e.length>o?!1:e.every(function(a){var u=f1(a,t),f=ux(u,1),p=f[0],h=d1(a,n,i),d=ux(h,1),g=d[0];return p&&g})}function tf(r){return typeof r.isPropagationStopped=="function"?r.isPropagationStopped():typeof r.cancelBubble!="undefined"?r.cancelBubble:!1}function Iu(r){return r.dataTransfer?Array.prototype.some.call(r.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!r.target&&!!r.target.files}function px(r){r.preventDefault()}function qO(r){return r.indexOf("MSIE")!==-1||r.indexOf("Trident/")!==-1}function XO(r){return r.indexOf("Edge/")!==-1}function YO(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return qO(r)||XO(r)}function Ir(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(n){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return e.some(function(a){return!tf(n)&&a&&a.apply(void 0,[n].concat(s)),tf(n)})}}function JO(){return"showOpenFilePicker"in window}function ZO(r){return r=typeof r=="string"?r.split(","):r,[{description:"everything",accept:Array.isArray(r)?r.filter(function(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}).reduce(function(e,t){return cx(cx({},e),{},u1({},t,[]))},{}):{}}]}function KO(r){return r instanceof DOMException&&(r.name==="AbortError"||r.code===r.ABORT_ERR)}function QO(r){return r instanceof DOMException&&(r.name==="SecurityError"||r.code===r.SECURITY_ERR)}var eF=["children"],tF=["open"],nF=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],rF=["refKey","onChange","onClick"];function iF(r){return aF(r)||oF(r)||h1(r)||sF()}function sF(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 3057In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oF(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function aF(r){if(Array.isArray(r))return kp(r)}function Fh(r,e){return uF(r)||cF(r,e)||h1(r,e)||lF()}function lF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 3058In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h1(r,e){if(!!r){if(typeof r=="string")return kp(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return kp(r,e)}}function kp(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function cF(r,e){var t=r==null?null:typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n=[],i=!0,s=!1,o,a;try{for(t=t.call(r);!(i=(o=t.next()).done)&&(n.push(o.value),!(e&&n.length===e));i=!0);}catch(u){s=!0,a=u}finally{try{!i&&t.return!=null&&t.return()}finally{if(s)throw a}}return n}}function uF(r){if(Array.isArray(r))return r}function mx(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ht(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
3058e%2?mx(Object(t),!0).forEach(function(n){Up(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):mx(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Up(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function nf(r,e){if(r==null)return{};var t=fF(r,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(r,n)||(t[n]=r[n]))}return t}function fF(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}var ng=R.exports.forwardRef(function(r,e){var t=r.children,n=nf(r,eF),i=m1(n),s=i.open,o=nf(i,tF);return R.exports.useImperativeHandle(e,function(){return{open:s}},[s]),U.createElement(R.exports.Fragment,null,t(Ht(Ht({},o),{},{open:s})))});ng.displayName="Dropzone";var p1={disabled:!1,getFilesFromEvent:TO,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};ng.defaultProps=p1;ng.propTypes={children:zt.func,accept:zt.oneOfType([zt.string,zt.arrayOf(zt.string)]),multiple:zt.bool,preventDropOnDocument:zt.bool,noClick:zt.bool,noKeyboard:zt.bool,noDrag:zt.bool,noDragEventsBubbling:zt.bool,minSize:zt.number,maxSize:zt.number,maxFiles:zt.number,disabled:zt.bool,getFilesFromEvent:zt.func,onFileDialogCancel:zt.func,onFileDialogOpen:zt.func,useFsAccessApi:zt.bool,onDragEnter:zt.func,onDragLeave:zt.func,onDragOver:zt.func,onDrop:zt.func,onDropAccepted:zt.func,onDropRejected:zt.func,validator:zt.func};var Hp={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function m1(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=Ht(Ht({},p1),r),t=e.accept,n=e.disabled,i=e.getFilesFromEvent,s=e.maxSize,o=e.minSize,a=e.multiple,u=e.maxFiles,f=e.onDragEnter,p=e.onDragLeave,h=e.onDragOver,d=e.onDrop,g=e.onDropAccepted,y=e.onDropRejected,_=e.onFileDialogCancel,w=e.onFileDialogOpen,x=e.useFsAccessApi,v=e.preventDropOnDocument,E=e.noClick,M=e.noKeyboard,A=e.noDrag,C=e.noDragEventsBubbling,L=e.validator,D=R.exports.useMemo(function(){return typeof w=="function"?w:gx},[w]),k=R.exports.useMemo(function(){return typeof _=="function"?_:gx},[_]),B=R.exports.useRef(null),T=R.exports.useRef(null),O=R.exports.useReducer(dF,Hp),H=Fh(O,2),W=H[0],V=H[1],j=W.isFocused,Z=W.isFileDialogActive,ne=W.draggedFiles,ge=R.exports.useRef(typeof window!="undefined"&&window.isSecureContext&&x&&JO()),Y=function(){!ge.current&&Z&&setTimeout(function(){if(T.current){var J=T.current.files;J.length||(V({type:"closeDialog"}),k())}},300)};R.exports.useEffect(function(){return window.addEventListener("focus",Y,!1),function(){window.removeEventListener("focus",Y,!1)}},[T,Z,k,ge]);var ee=R.exports.useRef([]),ue=function(J){B.current&&B.current.contains(J.target)||(J.preventDefault(),ee.current=[])};R.exports.useEffect(function(){return v&&(document.addEventListener("dragover",px,!1),document.addEventListener("drop",ue,!1)),function(){v&&(document.removeEventListener("dragover",px),document.removeEventListener("drop",ue))}},[B,v]);var ye=R.exports.useCallback(function(I){I.preventDefault(),I.persist(),ve(I),ee.current=[].concat(iF(ee.current),[I.target]),Iu(I)&&Promise.resolve(i(I)).then(function(J){tf(I)&&!C||(V({draggedFiles:J,isDragActive:!0,type:"setDraggedFiles"}),f&&f(I))})},[i,f,C]),xe=R.exports.useCallback(function(I){I.preventDefault(),I.persist(),ve(I);var J=Iu(I);if(J&&I.dataTransfer)try{I.dataTransfer.dropEffect="copy"}catch{}return J&&h&&h(I),!1},[h,C]),re=R.exports.useCallback(function(I){I.preventDefault(),I.persist(),ve(I);var J=ee.current.filter(function(Te){return B.current&&B.current.contains(Te)}),pe=J.indexOf(I.target);pe!==-1&&J.splice(pe,1),ee.current=J,!(J.length>0)&&(V({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),Iu(I)&&p&&p(I))},[B,p,C]),Xe=R.exports.useCallback(function(I,J){var pe=[],Te=[];I.forEach(function(ie){var Ne=f1(ie,t),Ie=Fh(Ne,2),we=Ie[0],be=Ie[1],Ze=d1(ie,o,s),q=Fh(Ze,2),De=q[0],Re=q[1],We=L?L(ie):null;if(we&&De&&!We)pe.push(ie);else{var ce=[be,Re];We&&(ce=ce.concat(We)),Te.push({file:ie,errors:ce.filter(function(Ue){return Ue})})}}),(!a&&pe.length>1||a&&u>=1&&pe.length>u)&&(pe.forEach(function(ie){Te.push({file:ie,errors:[$O]})}),pe.splice(0)),V({acceptedFiles:pe,fileRejections:Te,type:"setFiles"}),d&&d(pe,Te,J),Te.length>0&&y&&y(Te,J),pe.length>0&&g&&g(pe,J)},[V,a,t,o,s,u,d,g,y,L]),Le=R.exports.useCallback(function(I){I.preventDefault(),I.persist(),ve(I),ee.current=[],Iu(I)&&Promise.resolve(i(I)).then(function(J){tf(I)&&!C||Xe(J,I)}),V({type:"reset"})},[i,Xe,C]),Be=R.exports.useCallback(function(){if(ge.current){V({type:"openDialog"}),D();var I={multiple:a,types:ZO(t)};window.showOpenFilePicker(I).then(function(J){return i(J)}).then(function(J){Xe(J,null),V({type:"closeDialog"})}).catch(function(J){KO(J)?(k(J),V({type:"closeDialog"})):QO(J)&&(ge.current=!1,T.current&&(T.current.value=null,T.current.click()))});return}T.current&&(V({type:"openDialog"}),D(),T.current.value=null,T.current.click())}
3058,[V,D,k,x,Xe,t,a]),Me=R.exports.useCallback(function(I){!B.current||!B.current.isEqualNode(I.target)||(I.key===" "||I.key==="Enter"||I.keyCode===32||I.keyCode===13)&&(I.preventDefault(),Be())},[B,Be]),et=R.exports.useCallback(function(){V({type:"focus"})},[]),Ve=R.exports.useCallback(function(){V({type:"blur"})},[]),le=R.exports.useCallback(function(){E||(YO()?setTimeout(Be,0):Be())},[E,Be]),me=function(J){return n?null:J},he=function(J){return M?null:me(J)},Ee=function(J){return A?null:me(J)},ve=function(J){C&&J.stopPropagation()},je=R.exports.useMemo(function(){return function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},J=I.refKey,pe=J===void 0?"ref":J,Te=I.role,ie=I.onKeyDown,Ne=I.onFocus,Ie=I.onBlur,we=I.onClick,be=I.onDragEnter,Ze=I.onDragOver,q=I.onDragLeave,De=I.onDrop,Re=nf(I,nF);return Ht(Ht(Up({onKeyDown:he(Ir(ie,Me)),onFocus:he(Ir(Ne,et)),onBlur:he(Ir(Ie,Ve)),onClick:me(Ir(we,le)),onDragEnter:Ee(Ir(be,ye)),onDragOver:Ee(Ir(Ze,xe)),onDragLeave:Ee(Ir(q,re)),onDrop:Ee(Ir(De,Le)),role:typeof Te=="string"&&Te!==""?Te:"button"},pe,B),!n&&!M?{tabIndex:0}:{}),Re)}},[B,Me,et,Ve,le,ye,xe,re,Le,M,A,n]),Ye=R.exports.useCallback(function(I){I.stopPropagation()},[]),st=R.exports.useMemo(function(){return function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},J=I.refKey,pe=J===void 0?"ref":J,Te=I.onChange,ie=I.onClick,Ne=nf(I,rF),Ie=Up({accept:t,multiple:a,type:"file",style:{display:"none"},onChange:me(Ir(Te,Le)),onClick:me(Ir(ie,Ye)),autoComplete:"off",tabIndex:-1},pe,T);return Ht(Ht({},Ie),Ne)}},[T,t,a,Le,n]),xt=ne.length,mt=xt>0&&jO({files:ne,accept:t,minSize:o,maxSize:s,multiple:a,maxFiles:u}),G=xt>0&&!mt;return Ht(Ht({},W),{},{isDragAccept:mt,isDragReject:G,isFocused:j&&!n,getRootProps:je,getInputProps:st,rootRef:B,inputRef:T,open:me(Be)})}function dF(r,e){switch(e.type){case"focus":return Ht(Ht({},r),{},{isFocused:!0});case"blur":return Ht(Ht({},r),{},{isFocused:!1});case"openDialog":return Ht(Ht({},Hp),{},{isFileDialogActive:!0});case"closeDialog":return Ht(Ht({},r),{},{isFileDialogActive:!1});case"setDraggedFiles":var t=e.isDragActive,n=e.draggedFiles;return Ht(Ht({},r),{},{draggedFiles:n,isDragActive:t});case"setFiles":return Ht(Ht({},r),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return Ht({},Hp);default:return r}}function gx(){}function hF(r){let e;const t=new Set,n=(f,p)=>{const h=typeof f=="function"?f(e):f;if(h!==e){const d=e;e=p?h:Object.assign({},e,h),t.forEach(g=>g(e,d))}},i=()=>e,s=(f,p=i,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=p(e);function g(){const y=p(e);if(!h(d,y)){const _=d;f(d=y,_)}}return t.add(g),()=>t.delete(g)},u={setState:n,getState:i,subscribe:(f,p,h)=>p||h?s(f,p,h):(t.add(f),()=>t.delete(f)),destroy:()=>t.clear()};return e=r(n,i,u),u}const pF=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),yx=pF?R.exports.useEffect:R.exports.useLayoutEffect;function mF(r){const e=typeof r=="function"?hF(r):r,t=(n=e.getState,i=Object.is)=>{const[,s]=R.exports.useReducer(w=>w+1,0),o=e.getState(),a=R.exports.useRef(o),u=R.exports.useRef(n),f=R.exports.useRef(i),p=R.exports.useRef(!1),h=R.exports.useRef();h.current===void 0&&(h.current=n(o));let d,g=!1;(a.current!==o||u.current!==n||f.current!==i||p.current)&&(d=n(o),g=!i(h.current,d)),yx(()=>{g&&(h.current=d),a.current=o,u.current=n,f.current=i,p.current=!1});const y=R.exports.useRef(o);yx(()=>{const w=()=>{try{const v=e.getState(),E=u.current(v);f.current(h.current,E)||(a.current=v,h.current=E,s())}catch{p.current=!0,s()}},x=e.subscribe(w);return e.getState()!==y.current&&w(),x},[]);const _=g?d:h.current;return R.exports.useDebugValue(_),_};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}const gF=r=>(e,t,n)=>{const i=n.subscribe;return n.subscribe=(o,a,u)=>{let f=o;
3058if(a){const p=(u==null?void 0:u.equalityFn)||Object.is;let h=o(n.getState());f=d=>{const g=o(d);if(!p(h,g)){const y=h;a(h=g,y)}},u!=null&&u.fireImmediately&&a(h,h)}return i(f)},r(e,t,n)};/*! 3059 * isobject <https://github.com/jonschlinkert/isobject> 3060 * 3061 * Copyright (c) 2014-2017, Jon Schlinkert. 3062 * Released under the MIT License. 3063 */var yF=function(e){return e!=null&&typeof e=="object"&&Array.isArray(e)===!1};/*! 3064 * is-plain-object <https://github.com/jonschlinkert/is-plain-object> 3065 * 3066 * Copyright (c) 2014-2017, Jon Schlinkert. 3067 * Released under the MIT License. 3068 */var vF=yF;function vx(r){return vF(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}var g1=function(e){var t,n;return!(vx(e)===!1||(t=e.constructor,typeof t!="function")||(n=t.prototype,vx(n)===!1)||n.hasOwnProperty("isPrototypeOf")===!1)};/*! 3069 * is-extendable <https://github.com/jonschlinkert/is-extendable> 3070 * 3071 * Copyright (c) 2015-2017, Jon Schlinkert. 3072 * Released under the MIT License. 3073 */var xF=g1,rg=function(e){return xF(e)||typeof e=="function"||Array.isArray(e)};/*! 3074 * for-in <https://github.com/jonschlinkert/for-in> 3075 * 3076 * Copyright (c) 2014-2017, Jon Schlinkert. 3077 * Released under the MIT License. 3078 */var _F=function(e,t,n){for(var i in e)if(t.call(n,e[i],i,e)===!1)break},bF=rg,wF=_F;function y1(r,e){for(var t=arguments.length,n=0;++n<t;){var i=arguments[n];Gp(i)&&wF(i,SF,r)}return r}function SF(r,e){if(!!MF(e)){var t=this[e];Gp(r)&&Gp(t)?y1(t,r):this[e]=r}}function Gp(r){return bF(r)&&!Array.isArray(r)}function MF(r){return r!=="__proto__"&&r!=="constructor"&&r!=="prototype"}var EF=y1;/*! 3079 * get-value <https://github.com/jonschlinkert/get-value> 3080 * 3081 * Copyright (c) 2014-2015, Jon Schlinkert. 3082 * Licensed under the MIT License. 3083 */var TF=function(r,e,t,n,i){if(!AF(r)||!e)return r;if(e=Du(e),t&&(e+="."+Du(t)),n&&(e+="."+Du(n)),i&&(e+="."+Du(i)),e in r)return r[e];for(var s=e.split("."),o=s.length,a=-1;r&&++a<o;){for(var u=s[a];u[u.length-1]==="\\";)u=u.slice(0,-1)+"."+s[++a];r=r[u]}return r};function AF(r){return r!==null&&(typeof r=="object"||typeof r=="function")}function Du(r){return r?Array.isArray(r)?r.join("."):r:""}/*! 3084 * assign-symbols <https://github.com/jonschlinkert/assign-symbols> 3085 * 3086 * Copyright (c) 2015, Jon Schlinkert. 3087 * Licensed under the MIT License. 3088 */var RF=function(r,e){if(r===null||typeof r=="undefined")throw new TypeError("expected first argument to be an object.");if(typeof e=="undefined"||typeof Symbol=="undefined"||typeof Object.getOwnPropertySymbols!="function")return r;for(var t=Object.prototype.propertyIsEnumerable,n=Object(r),i=arguments.length,s=0;++s<i;)for(var o=Object(arguments[s]),a=Object.getOwnPropertySymbols(o),u=0;u<a.length;u++){var f=a[u];t.call(o,f)&&(n[f]=o[f])}return n},CF=rg,PF=RF,LF=Object.assign||function(r){if(r===null||typeof r=="undefined")throw new TypeError("Cannot convert undefined or null to object");xx(r)||(r={});for(var e=1;e<arguments.length;e++){var t=arguments[e];DF(t)&&(t=OF(t)),xx(t)&&(IF(r,t),PF(r,t))}return r};function IF(r,e){for(var t in e)FF(e,t)&&(r[t]=e[t])}function DF(r){return r&&typeof r=="string"}function OF(r){var e={};for(var t in r)e[t]=r[t];return e}function xx(r){return r&&typeof r=="object"||CF(r)}function FF(r,e){return Object.prototype.hasOwnProperty.call(r,e)}/*! 3089 * split-string <https://github.com/jonschlinkert/split-string> 3090 * 3091 * Copyright (c) 2015-2017, Jon Schlinkert. 3092 * Released under the MIT License. 3093 */var BF=LF,zF=function(r,e,t){if(typeof r!="string")throw new TypeError("expected a string");typeof e=="function"&&(t=e,e=null),typeof e=="string"&&(e={sep:e});var n=BF({sep:"."},e),i=n.quotes||['"',"'","`"],s;n.brackets===!0?s={"<":">","(":")","[":"]","{":"}"}:n.brackets&&(s=n.brackets);var o=[],a=[],u=[""],f=n.sep,p=r.length,h=-1,d;function g(){if(s&&a.length)return s[a[a.length-1]]}for(;++h<p;){var y=r[h],_=r[h+1],w={val:y,idx:h,arr:u,str:r};if(o.push(w),y==="\\"){w.val=kF(n,r,h)===!0?y+_:_,w.escaped=!0,typeof t=="function"&&t(w),u[u.length-1]+=w.val,h++;continue}if(s&&s[y]){a.push(y);var x=g(),v=h+1;if(r.indexOf(x,v+1)!==-1)for(;a.length&&v<p;){var E=r[++v];if(E==="\\"){E++;continue}if(i.indexOf(E)!==-1){v=Vp(r,E,v+1);continue}if(x=g(),a.length&&r.indexOf(x,v+1)===-1)break;if(s[E]){a.push(E);continue}x===E&&a.pop()}if(d=v,d===-1){u[u.length-1]+=y;continue}y=r.slice(h,d+1),w.val=y,w.idx=h=d}if(i.indexOf(y)!==-1){if(d=Vp(r,y,h+1),d===-1){u[u.length-1]+=y;continue}NF(y,n)===!0?y=r.slice(h,d+1):y=r.slice(h+1,d),w.val=y,w.idx=h=d}if(typeof t=="function"&&(t(w,o),y=w.val,h=w.idx),w.val===f&&w.split!==!1){u.push("");continue}u[u.length-1]+=w.val}return u};function Vp(r,e,t,n){var i=r.indexOf(e,t);return r.charAt(i-1)==="\\"?Vp(r,e,i+1):i}function NF(r,e){return e.keepDoubleQuotes===!0&&r==='"'||e.keepSingleQuotes===!0&&r==="'"?!0:e.keepQuotes}function kF(r,e,t){return typeof r.keepEscaping=="function"?r.keepEscaping(e,t):r.keepEscaping===!0||e[t+1]==="\\"}/*! 3094 * is-extendable <https://github.com/jonschlinkert/is-extendable> 3095 * 3096 * Copyright (c) 2015, Jon Schlinkert.
3097 * Licensed under the MIT License. 3098 */var UF=function(e){return typeof e!="undefined"&&e!==null&&(typeof e=="object"||typeof e=="function")},_x=UF,HF=function(e){_x(e)||(e={});for(var t=arguments.length,n=1;n<t;n++){var i=arguments[n];_x(i)&&GF(e,i)}return e};function GF(r,e){for(var t in e)VF(e,t)&&(r[t]=e[t])}function VF(r,e){return Object.prototype.hasOwnProperty.call(r,e)}/*! 3099 * is-extendable <https://github.com/jonschlinkert/is-extendable> 3100 * 3101 * Copyright (c) 2015, Jon Schlinkert. 3102 * Licensed under the MIT License. 3103 */var WF=function(e){return typeof e!="undefined"&&e!==null&&(typeof e=="object"||typeof e=="function")};/*! 3104 * set-value <https://github.com/jonschlinkert/set-value> 3105 * 3106 * Copyright (c) 2014-2015, 2017, Jon Schlinkert. 3107 * Released under the MIT License. 3108 */var $F=zF,jF=HF,bx=g1,wx=WF,qF=function(r,e,t){if(!wx(r)||(Array.isArray(e)&&(e=[].concat.apply([],e).join(".")),typeof e!="string"))return r;for(var n=$F(e,{sep:".",brackets:!0}).filter(XF),i=n.length,s=-1,o=r;++s<i;){var a=n[s];if(s!==i-1){wx(o[a])||(o[a]={}),o=o[a];continue}bx(o[a])&&bx(t)?o[a]=jF({},o[a],t):o[a]=t}return r};function XF(r){return r!=="__proto__"&&r!=="constructor"&&r!=="prototype"}var Bh=rg,Sx=EF,YF=TF,Mx=qF,JF=function(e,t,n){if(!Bh(e))throw new TypeError("expected an object");if(typeof t!="string"||n==null)return Sx.apply(null,arguments);if(typeof n=="string")return Mx(e,t,n),e;var i=YF(e,t);return Bh(n)&&Bh(i)&&(n=Sx({},i,n)),Mx(e,t,n),e};const v1=(...r)=>r.filter(Boolean).join(".");function ZF(r){const e=r.split(".");return[e.pop(),e.join(".")||void 0]}function KF(r,e){return Object.entries(PI(r,e)).reduce((t,[,{value:n,disabled:i,key:s}])=>(t[s]=i?void 0:n,t),{})}function QF(r,e){const t=R.exports.useRef();return(e?Rl:Vl)(r,t.current)||(t.current=r),t.current}function x1(r,e){return R.exports.useMemo(r,QF(e,!0))}function eB(r){const e=R.exports.useRef(null),t=R.exports.useRef(null),n=R.exports.useRef(!0);return R.exports.useLayoutEffect(()=>{r||(e.current.style.height="0px",e.current.style.overflow="hidden")},[]),R.exports.useEffect(()=>{if(n.current){n.current=!1;return}let i;const s=e.current,o=()=>{r&&(s.style.removeProperty("height"),s.style.removeProperty("overflow"),t.current.scrollIntoView({behavior:"smooth",block:"nearest"}))};s.addEventListener("transitionend",o,{once:!0});const{height:a}=t.current.getBoundingClientRect();return s.style.height=a+"px",r||(s.style.overflow="hidden",i=window.setTimeout(()=>s.style.height="0px",50)),()=>{s.removeEventListener("transitionend",o),clearTimeout(i)}},[r]),{wrapperRef:e,contentRef:t}}const tB=r=>{const[e,t]=R.exports.useState(r.getVisiblePaths());return R.exports.useEffect(()=>{t(r.getVisiblePaths());const n=r.useStore.subscribe(r.getVisiblePaths,t,{equalityFn:Vl});return()=>n()},[r]),e};function nB(r,e,t){return r.useStore(i=>{const s=Ke(Ke({},t),i.data);return KF(s,e)},Vl)}function _1(r=3){const e=R.exports.useRef(null),t=R.exports.useRef(null),[n,i]=R.exports.useState(!1),s=R.exports.useCallback(()=>i(!0),[]),o=R.exports.useCallback(()=>i(!1),[]);return R.exports.useLayoutEffect(()=>{if(n){const{bottom:a,top:u,left:f}=e.current.getBoundingClientRect(),{height:p}=t.current.getBoundingClientRect(),h=a+p>window.innerHeight-40?"up":"down";t.current.style.position="fixed",t.current.style.zIndex="10000",t.current.style.left=f+"px",h==="down"?t.current.style.top=a+r+"px":t.current.style.bottom=window.innerHeight-u+r+"px"}},[r,n]),{popinRef:e,wrapperRef:t,shown:n,show:s,hide:o}}uO([fO]);const rB={rgb:"toRgb",hsl:"toHsl",hsv:"toHsv",hex:"toHex"};Vn.extend({color:()=>r=>Dn(r).isValid()});const iB=r=>Vn().color().test(r);function b1(r,{format:e,hasAlpha:t,isString:n}){const i=rB[e]+(n&&e!=="hex"?"String":""),s=r[i]();return typeof s=="object"&&!t?LI(s,["a"]):s}const w1=(r,e)=>{const t=Dn(r);if(!t.isValid())throw Error("Invalid color");return b1(t,e)},sB=(r,e)=>b1(Dn(r),Ke(Ke({},e),{},{isString:!0,format:"hex"})),oB=({value:r})=>{const e=cO(r),t=e==="name"?"hex":e,n=typeof r=="object"?"a"in r:e==="hex"&&r.length===8||/^(rgba)|(hsla)|(hsva)/.test(r),i={format:t,hasAlpha:n,isString:typeof r=="string"};return{value:w1(r,i),settings:i}};var aB=Object.freeze({__proto__:null,schema:iB,sanitize:w1,format:sB,normalize:oB});const lB=$e("div",{position:"relative",boxSizing:"border-box",borderRadius:"$sm",overflow:"hidden",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",backgroundColor:"#fff",backgroundImage:`url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')`,$inputStyle:"",$hover:"",zIndex:1,variants:{active:{true:{$inputStyle:"$accent1"}}},"&::before":{content:'""',position:"absolute",top:0,bottom:0,right:0,left:0,backgroundColor:"currentColor",zIndex:1}}),cB=$e("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto",columnGap:"$colGap",alignItems:"center"}),uB=$e("div",{width:"$colorPickerWidth",height:"$colorPickerHeight",".react-colorful":{width:"100%",height:"100%",boxShadow:"$level2",cursor:"crosshair"},".react-colorful__saturation":{borderRadius:"$sm $sm 0 0"},".react-colorful__alpha, .react-colorful__hue":{height:10},".react-colorful__last-control":{borderRadius:"0 0 $sm $sm"},".react-colorful__pointer":{height:12,width:12}}
3108);function Ex(r,e){return e!=="rgb"?Dn(r).toRgb():r}function fB({value:r,displayValue:e,settings:t,onUpdate:n}){const{emitOnEditStart:i,emitOnEditEnd:s}=Cn(),{format:o,hasAlpha:a}=t,{popinRef:u,wrapperRef:f,shown:p,show:h,hide:d}=_1(),g=R.exports.useRef(0),[y,_]=R.exports.useState(()=>Ex(r,o)),w=a?vO:_O,x=()=>{_(Ex(r,o)),h(),i()},v=()=>{d(),s(),window.clearTimeout(g.current)},E=()=>{g.current=window.setTimeout(v,500)};return R.exports.useEffect(()=>()=>window.clearTimeout(g.current),[]),U.createElement(U.Fragment,null,U.createElement(lB,{ref:u,active:p,onClick:()=>x(),style:{color:e}}),p&&U.createElement(Ym,null,U.createElement(Gw,{onPointerUp:v}),U.createElement(uB,{ref:f,onMouseEnter:()=>window.clearTimeout(g.current),onMouseLeave:M=>M.buttons===0&&E()},U.createElement(w,{color:y,onChange:n}))))}function dB(){const{value:r,displayValue:e,label:t,onChange:n,onUpdate:i,settings:s}=Cn();return U.createElement(hr,{input:!0},U.createElement(Er,null,t),U.createElement(cB,null,U.createElement(fB,{value:r,displayValue:e,onChange:n,onUpdate:i,settings:s}),U.createElement(Xm,{value:e,onChange:n,onUpdate:i})))}var hB=Ke({component:dB},aB);function pB(){const{label:r,displayValue:e,onUpdate:t,settings:n}=Cn();return U.createElement(hr,{input:!0},U.createElement(Er,null,r),U.createElement(Zm,{value:e,settings:n,onUpdate:t}))}var mB=Ke({component:pB},Jw(["x","y","z"]));const gB=$e("div",{$flexCenter:"",position:"relative",backgroundColor:"$elevation3",borderRadius:"$sm",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",touchAction:"none",$draggable:"",$hover:"","&:active":{cursor:"none"},"&::after":{content:'""',backgroundColor:"$accent2",height:4,width:4,borderRadius:2}}),yB=$e("div",{$flexCenter:"",width:"$joystickWidth",height:"$joystickHeight",borderRadius:"$sm",boxShadow:"$level2",position:"fixed",zIndex:1e4,overflow:"hidden",$draggable:"",transform:"translate(-50%, -50%)",variants:{isOutOfBounds:{true:{backgroundColor:"$elevation1"},false:{backgroundColor:"$elevation3"}}},"> div":{position:"absolute",$flexCenter:"",borderStyle:"solid",borderWidth:1,borderColor:"$highlight1",backgroundColor:"$elevation3",width:"80%",height:"80%","&::after,&::before":{content:'""',position:"absolute",zindex:10,backgroundColor:"$highlight1"},"&::before":{width:"100%",height:1},"&::after":{height:"100%",width:1}},"> span":{position:"relative",zindex:100,width:10,height:10,backgroundColor:"$accent2",borderRadius:"50%"}});function vB({value:r,settings:e,onUpdate:t}){const n=R.exports.useRef(),i=R.exports.useRef(0),s=R.exports.useRef(0),o=R.exports.useRef(1),[a,u]=R.exports.useState(!1),[f,p]=R.exports.useState(!1),[h,d]=Ww(),g=R.exports.useRef(null),y=R.exports.useRef(null);R.exports.useLayoutEffect(()=>{if(a){const{top:O,left:H,width:W,height:V}=g.current.getBoundingClientRect();y.current.style.left=H+W/2+"px",y.current.style.top=O+V/2+"px"}},[a]);const{keys:[_,w],joystick:x}=e,v=x==="invertY"?1:-1,{[_]:{step:E},[w]:{step:M}}=e,A=ai("sizes","joystickWidth"),C=ai("sizes","joystickHeight"),L=parseFloat(A)*.8/2,D=parseFloat(C)*.8/2,k=R.exports.useCallback(()=>{n.current||(p(!0),i.current&&d({x:i.current*L}),s.current&&d({y:s.current*-D}),n.current=window.setInterval(()=>{t(O=>{const H=E*i.current*o.current,W=v*M*s.current*o.current;return Array.isArray(O)?{[_]:O[0]+H,[w]:O[1]+W}:{[_]:O[_]+H,[w]:O[w]+W}})},16))},[L,D,t,d,E,M,_,w,v]),B=R.exports.useCallback(()=>{window.clearTimeout(n.current),n.current=void 0,p(!1)},[]);R.exports.useEffect(()=>{function O(H){o.current=Rw(H)}return window.addEventListener("keydown",O),window.addEventListener("keyup",O),()=>{window.clearTimeout(n.current),window.removeEventListener("keydown",O),window.removeEventListener("keyup",O)}},[]);const T=Wl(({first:O,active:H,delta:[W,V],movement:[j,Z]})=>{O&&u(!0);const ne=Wi(j,-L,L),ge=Wi(Z,-D,D);i.current=Math.abs(j)>Math.abs(ne)?Math.sign(j-ne):0,s.current=Math.abs(Z)>Math.abs(ge)?Math.sign(ge-Z):0;let Y=r[_],ee=r[w];H?(i.current||(Y+=W*E*o.current,d({x:ne})),s.current||(ee-=v*V*M*o.current,d({y:ge})),i.current||s.current?k():B(),t({[_]:Y,[w]:ee})):(u(!1),i.current=0,s.current=0,d({x:0,y:0}),B())});return U.createElement(gB,qt({ref:g},T()),a&&U.createElement(Ym,null,U.createElement(yB,{ref:y,isOutOfBounds:f},U.createElement("div",null),U.createElement("span",{ref:h}))))}const xB=$e("div",{display:"grid",columnGap:"$colGap",variants:{withJoystick:{true:{gridTemplateColumns:"$sizes$rowHeight auto"},false:{gridTemplateColumns:"auto"}}}});function _B(){const{label:r,displayValue:e,onUpdate:t,settings:n}=Cn();return U.createElement(hr,{input:!0},U.createElement(Er,null,r),U.createElement(xB,{withJoystick:!!n.joystick},n.joystick&&U.createElement(vB,{value:e,settings:n,onUpdate:t}),U.createElement(Zm,{value:e,settings:n,onUpdate:t})))}const bB=["joystick"],S1=Jw(["x","y"]),wB=r=>{let{joystick:e=!0}=r,t=Tt(r,bB);const{value:n,settings:i}=S1.normalize(t);return{value:n,settings:Ke(Ke({},i),{},{joystick:e})}};var SB=Ke(Ke({component:_B},S1),{},{normalize:wB});const MB=r=>{if(r!==void 0){if(r instanceof File)try{return URL.createObjectURL(r)}catch{return}if(typeof r=="string"&&r.indexOf("blob:")===0)return r;throw Error("Invalid image format [undefined | blob |\xA0File].")}},EB=(r,e)=>typeof e=="object"&&"image"in e,TB=({image:r})=>({value:r});var AB=Object.freeze({__proto__:null,sanitize:MB,schema:EB,normalize:TB});const RB=$e("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto 20px",columnGap:"$colGap",alignItems:"center"}),CB=$e("div",{$flexCenter:"",overflow:"hidden",height:"$rowHeight",background:"$elevation3",textAlign:"center",color:"inherit",borderRadius:"$sm",outline:"none",userSelect:"none",cursor:"pointer",$inputStyle:"",$hover:"",$focusWithin:"",$active:"$accent1 $elevation1",variants:{isDragAccept:{true:{$inputStyle:"$accent1",backgroundColor:"$elevation1"}}}}),PB=$e("div",{boxSizing:"border-box",borderRadius:"$sm",height:"$rowHeight",width:"$rowHeight",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center",variants:{hasImage:{true:{cursor:"pointer",$hover:"",$active:""}}}}),LB=$e("div",{$flexCenter:"",width:"$imagePreviewWidth",height:"$imagePreviewHeight",borderRadius:"$sm",boxShadow:"$level2",pointerEvents:"none",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center"}
3108),IB=$e("div",{fontSize:"0.8em",height:"100%",padding:"$rowGap $md"}),DB=$e("div",{$flexCenter:"",top:"0",right:"0",marginRight:"$sm",height:"100%",cursor:"pointer",variants:{disabled:{true:{color:"$elevation3",cursor:"default"}}},"&::after,&::before":{content:'""',position:"absolute",height:2,width:10,borderRadius:1,backgroundColor:"currentColor"},"&::after":{transform:"rotate(45deg)"},"&::before":{transform:"rotate(-45deg)"}});function OB(){const{label:r,value:e,onUpdate:t,disabled:n}=Cn(),{popinRef:i,wrapperRef:s,shown:o,show:a,hide:u}=_1(),f=R.exports.useCallback(y=>{y.length&&t(y[0])},[t]),p=R.exports.useCallback(y=>{y.stopPropagation(),t(void 0)},[t]),{getRootProps:h,getInputProps:d,isDragAccept:g}=m1({maxFiles:1,accept:"image/*",onDrop:f,disabled:n});return U.createElement(hr,{input:!0},U.createElement(Er,null,r),U.createElement(RB,null,U.createElement(PB,{ref:i,hasImage:!!e,onPointerDown:()=>!!e&&a(),onPointerUp:u,style:{backgroundImage:e?`url(${e})`:"none"}}),o&&!!e&&U.createElement(Ym,null,U.createElement(Gw,{onPointerUp:u,style:{cursor:"pointer"}}),U.createElement(LB,{ref:s,style:{backgroundImage:`url(${e})`}})),U.createElement(CB,h({isDragAccept:g}),U.createElement("input",d()),U.createElement(IB,null,g?"drop image":"click or drop")),U.createElement(DB,{onClick:p,disabled:!e})))}var FB=Ke({component:OB},AB);const Tx=Vn().number(),BB=(r,e)=>Vn().array().length(2).every.number().test(r)&&Vn().schema({min:Tx,max:Tx}).test(e),Wp=r=>({min:r[0],max:r[1]}),M1=(r,{bounds:[e,t]},n)=>{const i={min:n[0],max:n[1]},{min:s,max:o}=Ke(Ke({},i),r);return[Wi(Number(s),e,Math.max(e,o)),Wi(Number(o),Math.min(t,s),t)]},zB=({value:r,min:e,max:t})=>{const n={min:e,max:t},i=Yw(Wp(r),{min:n,max:n}),s=[e,t],o=Ke(Ke({},i),{},{bounds:s});return{value:M1(Wp(r),o,r),settings:o}};var NB=Object.freeze({__proto__:null,schema:BB,format:Wp,sanitize:M1,normalize:zB});const kB=["value","bounds","onDrag"],UB=["bounds"],HB=$e("div",{display:"grid",columnGap:"$colGap",gridTemplateColumns:"auto calc($sizes$numberInputMinWidth * 2 + $space$rowGap)"});function GB(r){let{value:e,bounds:[t,n],onDrag:i}=r,s=Tt(r,kB);const o=R.exports.useRef(null),a=R.exports.useRef(null),u=R.exports.useRef(null),f=R.exports.useRef(0),p=ai("sizes","scrubberWidth"),h=Wl(({event:y,first:_,xy:[w],movement:[x],memo:v={}})=>{if(_){const{width:M,left:A}=o.current.getBoundingClientRect();f.current=M-parseFloat(p);const C=(y==null?void 0:y.target)===a.current||(y==null?void 0:y.target)===u.current;v.pos=Ku((w-A)/M,t,n);const L=Math.abs(v.pos-e.min)-Math.abs(v.pos-e.max);v.key=L<0||L===0&&v.pos<=e.min?"min":"max",C&&(v.pos=e[v.key])}const E=v.pos+Ku(x/f.current,0,n-t);return i({[v.key]:gD(E,s[v.key])}),v}),d=`calc(${Zu(e.min,t,n)} * (100% - ${p} - 8px) + 4px)`,g=`calc(${1-Zu(e.max,t,n)} * (100% - ${p} - 8px) + 4px)`;return U.createElement(jw,qt({ref:o},h()),U.createElement($w,null,U.createElement(qw,{style:{left:d,right:g}})),U.createElement(Lp,{position:"left",ref:a,style:{left:d}}),U.createElement(Lp,{position:"right",ref:u,style:{right:g}}))}function VB(){const{label:r,displayValue:e,onUpdate:t,settings:n}=Cn(),i=Tt(n,UB);return U.createElement(U.Fragment,null,U.createElement(hr,{input:!0},U.createElement(Er,null,r),U.createElement(HB,null,U.createElement(GB,qt({value:e},n,{onDrag:t})),U.createElement(Zm,{value:e,settings:i,onUpdate:t,innerLabelTrim:0}))))}var WB=Ke({component:VB},NB);const $B=()=>{const r=new Map;return{on:(e,t)=>{let n=r.get(e);n===void 0&&(n=new Set,r.set(e,n)),n.add(t)},off:(e,t)=>{const n=r.get(e);n!==void 0&&(n.delete(t),n.size===0&&r.delete(e))},emit:(e,...t)=>{const n=r.get(e);if(n!==void 0)for(const i of n)i(...t)}}},jB=["type","value"],qB=["onChange","transient","onEditStart","onEditEnd"],XB=function(){const e=mF(gF(()=>({data:{}}))),t=$B();this.storeId=CI(),this.useStore=e;const n={},i=new Set;this.getVisiblePaths=()=>{const o=this.getData(),a=Object.keys(o),u=[];Object.entries(n).forEach(([p,h])=>{h.render&&a.some(d=>d.indexOf(p)===0)&&!h.render(this.get)&&u.push(p+".")});const f=[];return i.forEach(p=>{p in o&&o[p].__refCount>0&&u.every(h=>p.indexOf(h)===-1)&&(!o[p].render||o[p].render(this.get))&&f.push(p)}),f},this.setOrderedPaths=o=>{o.forEach(a=>i.add(a))},this.orderPaths=o=>(this.setOrderedPaths(o),o),this.disposePaths=o=>{e.setState(a=>{const u=a.data;return o.forEach(f=>{if(f in u){const p=u[f];p.__refCount--,p.__refCount===0&&p.type in br&&delete u[f]}}),{data:u}})},this.dispose=()=>{e.setState(()=>({data:{}}))},this.getFolderSettings=o=>n[o]||{},this.getData=()=>e.getState().data,this.addData=(o,a)=>{e.setState(u=>{const f=u.data;
3108return Object.entries(o).forEach(([p,h])=>{let d=f[p];if(d){const{type:g,value:y}=h,_=Tt(h,jB);g!==d.type?ii(Gt.INPUT_TYPE_OVERRIDE,g):((d.__refCount===0||a)&&Object.assign(d,_),d.__refCount++)}else f[p]=Ke(Ke({},h),{},{__refCount:1})}),{data:f}})},this.setValueAtPath=(o,a,u)=>{e.setState(f=>{const p=f.data;return qv(p[o],a,o,this,u),{data:p}})},this.setSettingsAtPath=(o,a)=>{e.setState(u=>{const f=u.data;return f[o].settings=Ke(Ke({},f[o].settings),a),{data:f}})},this.disableInputAtPath=(o,a)=>{e.setState(u=>{const f=u.data;return f[o].disabled=a,{data:f}})},this.set=(o,a)=>{e.setState(u=>{const f=u.data;return Object.entries(o).forEach(([p,h])=>{try{qv(f[p],h,void 0,void 0,a)}catch{}}),{data:f}})},this.getInput=o=>{try{return this.getData()[o]}catch{ii(Gt.PATH_DOESNT_EXIST,o)}},this.get=o=>{var a;return(a=this.getInput(o))===null||a===void 0?void 0:a.value},this.emitOnEditStart=o=>{t.emit(`onEditStart:${o}`,this.get(o),o,Ke(Ke({},this.getInput(o)),{},{get:this.get}))},this.emitOnEditEnd=o=>{t.emit(`onEditEnd:${o}`,this.get(o),o,Ke(Ke({},this.getInput(o)),{},{get:this.get}))},this.subscribeToEditStart=(o,a)=>{const u=`onEditStart:${o}`;return t.on(u,a),()=>t.off(u,a)},this.subscribeToEditEnd=(o,a)=>{const u=`onEditEnd:${o}`;return t.on(u,a),()=>t.off(u,a)};const s=(o,a,u)=>{const f={};return Object.entries(o).forEach(([p,h])=>{if(p==="")return ii(Gt.EMPTY_KEY);let d=v1(a,p);if(h.type===br.FOLDER){const g=s(h.schema,d,u);Object.assign(f,g),d in n||(n[d]=h.settings)}else if(p in u)ii(Gt.DUPLICATE_KEYS,p,d,u[p].path);else{const g=BI(h,p,d,f);if(g){const{type:y,options:_,input:w}=g,{onChange:x,transient:v,onEditStart:E,onEditEnd:M}=_,A=Tt(_,qB);f[d]=Ke(Ke(Ke({type:y},A),w),{},{fromPanel:!0}),u[p]={path:d,onChange:x,transient:v,onEditStart:E,onEditEnd:M}}else ii(Gt.UNKNOWN_INPUT,d,h)}}),f};this.getDataFromSchema=o=>{const a={};return[s(o,"",a),a]}},E1=new XB,YB={collapsed:!1};function JB(r,e){return{type:br.FOLDER,schema:r,settings:Ke(Ke({},YB),e)}}const ZB=r=>"__levaInput"in r,KB=(r,e)=>{const t={},n=e?e.toLowerCase():null;return r.forEach(i=>{const[s,o]=ZF(i);(!n||s.toLowerCase().indexOf(n)>-1)&&JF(t,o,{[s]:{__levaInput:!0,path:i}})}),t};function QB({toggle:r,toggled:e,name:t}){return U.createElement(ZI,{onClick:()=>r()},U.createElement(Jm,{toggled:e}),U.createElement("div",null,t))}const ez=["type","label","path","valueKey","value","settings","setValue","disabled"];function tz(r){let{type:e,label:t,path:n,valueKey:i,value:s,settings:o,setValue:a,disabled:u}=r,f=Tt(r,ez);const{displayValue:p,onChange:h,onUpdate:d}=Vw({type:e,value:s,settings:o,setValue:a}),g=Fs[e].component;return g?U.createElement(Dw.Provider,{value:Ke({key:i,path:n,id:""+n,label:t,displayValue:p,value:s,onChange:h,onUpdate:d,settings:o,setValue:a,disabled:u},f)},U.createElement(eD,{disabled:u},U.createElement(g,null))):(ii(Gt.NO_COMPONENT_FOR_TYPE,e,n),null)}const nz=$e("button",{display:"block",$reset:"",fontWeight:"$button",height:"$rowHeight",borderStyle:"none",borderRadius:"$sm",backgroundColor:"$elevation1",color:"$highlight1","&:not(:disabled)":{color:"$highlight3",backgroundColor:"$accent2",cursor:"pointer",$hover:"$accent3",$active:"$accent3 $accent1",$focus:""}});function rz({onClick:r,settings:e,label:t}){const n=Ff();return U.createElement(hr,null,U.createElement(nz,{disabled:e.disabled,onClick:()=>r(n.get)},t))}const iz=$e("div",{$flex:"",justifyContent:"flex-end",gap:"$colGap"}),sz=$e("button",{$reset:"",cursor:"pointer",borderRadius:"$xs","&:hover":{backgroundColor:"$elevation3"}}),oz=({label:r,opts:e})=>{let t=typeof r=="string"&&r.trim()===""?null:r,n=e;
3108return typeof e.opts=="object"&&(n.label!==void 0&&(t=e.label),n=e.opts),{label:t,opts:n}};function az(r){const{label:e,opts:t}=oz(r),n=Ff();return U.createElement(hr,{input:!!e},e&&U.createElement(Er,null,e),U.createElement(iz,null,Object.entries(t).map(([i,s])=>U.createElement(sz,{key:i,onClick:()=>s(n.get)},i))))}const lz=$e("canvas",{height:"$monitorHeight",width:"100%",display:"block",borderRadius:"$sm"}),T1=100;function cz(r,e){r.push(e),r.length>T1&&r.shift()}const uz=R.exports.forwardRef(function({initialValue:r},e){const t=ai("colors","highlight3"),n=ai("colors","elevation2"),i=ai("colors","highlight1"),[s,o]=R.exports.useMemo(()=>[Dn(i).alpha(.4).toRgbString(),Dn(i).alpha(.1).toRgbString()],[i]),a=R.exports.useRef([r]),u=R.exports.useRef(r),f=R.exports.useRef(r),p=R.exports.useRef(),h=R.exports.useCallback((y,_)=>{if(!y)return;const{width:w,height:x}=y,v=new Path2D,E=w/T1,M=x*.05;for(let L=0;L<a.current.length;L++){const D=Zu(a.current[L],u.current,f.current),k=E*L,B=x-D*(x-M*2)-M;v.lineTo(k,B)}_.clearRect(0,0,w,x);const A=new Path2D(v);A.lineTo(E*(a.current.length+1),x),A.lineTo(0,x),A.lineTo(0,0);const C=_.createLinearGradient(0,0,0,x);C.addColorStop(0,s),C.addColorStop(1,o),_.fillStyle=C,_.fill(A),_.strokeStyle=n,_.lineJoin="round",_.lineWidth=14,_.stroke(v),_.strokeStyle=t,_.lineWidth=2,_.stroke(v)},[t,n,s,o]),[d,g]=cD(h);return R.exports.useImperativeHandle(e,()=>({frame:y=>{(u.current===void 0||y<u.current)&&(u.current=y),(f.current===void 0||y>f.current)&&(f.current=y),cz(a.current,y),p.current=requestAnimationFrame(()=>h(d.current,g.current))}}),[d,g,h]),R.exports.useEffect(()=>()=>cancelAnimationFrame(p.current),[]),U.createElement(lz,{ref:d})}),Ax=r=>Number.isFinite(r)?r.toPrecision(2):r.toString(),fz=R.exports.forwardRef(function({initialValue:r},e){const[t,n]=R.exports.useState(Ax(r));return R.exports.useImperativeHandle(e,()=>({frame:i=>n(Ax(i))}),[]),U.createElement("div",null,t)});function Rx(r){return typeof r=="function"?r():r.current}function dz({label:r,objectOrFn:e,settings:t}){const n=R.exports.useRef(),i=R.exports.useRef(Rx(e));return R.exports.useEffect(()=>{const s=window.setInterval(()=>{var o;document.hidden||(o=n.current)===null||o===void 0||o.frame(Rx(e))},t.interval);return()=>window.clearInterval(s)},[e,t.interval]),U.createElement(hr,{input:!0},U.createElement(Er,{align:"top"},r),t.graph?U.createElement(uz,{ref:n,initialValue:i.current}):U.createElement(fz,{ref:n,initialValue:i.current}))}const hz=["type","label","key"],pz={[br.BUTTON]:rz,[br.BUTTON_GROUP]:az,[br.MONITOR]:dz},mz=U.memo(({path:r})=>{const[e,{set:t,setSettings:n,disable:i,storeId:s,emitOnEditStart:o,emitOnEditEnd:a}]=fD(r);if(!e)return null;const{type:u,label:f,key:p}=e,h=Tt(e,hz);if(u in br){const d=pz[u];return U.createElement(d,qt({label:f,path:r},h))}return u in Fs?U.createElement(tz,qt({key:s+r,type:u,label:f,storeId:s,path:r,valueKey:p,setValue:t,setSettings:n,disable:i,emitOnEditStart:o,emitOnEditEnd:a},h)):(bI(Gt.UNSUPPORTED_INPUT,u,r),null)}),gz=({name:r,path:e,tree:t})=>{const n=Ff(),i=v1(e,r),{collapsed:s,color:o}=n.getFolderSettings(i),[a,u]=R.exports.useState(!s),f=R.exports.useRef(null),p=ai("colors","folderWidgetColor"),h=ai("colors","folderTextColor");return R.exports.useLayoutEffect(()=>{f.current.style.setProperty("--leva-colors-folderWidgetColor",o||p),f.current.style.setProperty("--leva-colors-folderTextColor",o||h)},[o,p,h]),U.createElement(Qu,{ref:f},U.createElement(QB,{name:r,toggled:a,toggle:()=>u(d=>!d)}),U.createElement(A1,{parent:i,tree:t,toggled:a}))},A1=U.memo(({isRoot:r=!1,fill:e=!1,flat:t=!1,parent:n,tree:i,toggled:s})=>{const{wrapperRef:o,contentRef:a}=eB(s);return U.createElement(Pp,{ref:o,isRoot:r,fill:e,flat:t},U.createElement(kw,{ref:a,isRoot:r,toggled:s},Object.entries(i).map(([u,f])=>ZB(f)?U.createElement(mz,{key:f.path,valueKey:f.valueKey,path:f.path}):U.createElement(gz,{key:u,name:u,path:n,tree:f}))))}),yz=$e("div",{position:"relative",fontFamily:"$mono",fontSize:"$root",color:"$rootText",backgroundColor:"$elevation1",variants:{fill:{false:{position:"fixed",top:"10px",right:"10px",zIndex:1e3,width:"$rootWidth"},true:{position:"relative",width:"100%"}},flat:{false:{borderRadius:"$lg",boxShadow:"$level1"}},oneLineLabels:{true:{[`${Hw}`]:{gridTemplateColumns:"auto",gridAutoColumns:"minmax(max-content, 1fr)",gridAutoRows:"minmax($sizes$rowHeight), auto)",rowGap:0,columnGap:0,marginTop:"$rowGap"}}},hideTitleBar:{true:{$$titleBarHeight:"0px"},false:{$$titleBarHeight:"$sizes$titleBarHeight"}}},"&,*,*:after,*:before":{boxSizing:"border-box"},"*::selection":{backgroundColor:"$accent2"}}),R1=40,rf=$e("i",{$flexCenter:"",width:R1,userSelect:"none",cursor:"pointer","> svg":{fill:"$highlight1",transition:"transform 350ms ease, fill 250ms ease"},"&:hover > svg":{fill:"$highlight3"},variants:{active:{true:{"> svg":{fill:"$highlight2"}}}}}),vz=$e("div",{display:"flex",alignItems:"stretch",justifyContent:"space-between",height:"$titleBarHeight",variants:{mode:{drag:{cursor:"grab"}}}}),xz=$e("div",{$flex:"",position:"relative",width:"100%",overflow:"hidden",transition:"height 250ms ease",color:"$highlight3",paddingLeft:"$md",[`> ${rf}`]:{height:30},variants:{toggled:{true:{height:30},false:{height:0}}}}),_z=$e("input",{$reset:"",flex:1,position:"relative",height:30,width:"100%",backgroundColor:"transparent",fontSize:"10px",borderRadius:"$root","&:focus":{},"&::placeholder":{color:"$highlight2"}}),bz=$e("div",{touchAction:"none",$flexCenter:"",flex:1,"> svg":{fill:"$highlight1"},color:"$highlight1",variants:{drag:{true:{$draggable:"","> svg":{transition:"fill 250ms ease"},"&:hover":{color:"$highlight3"},"&:hover > svg":{fill:"$highlight3"}}},filterEnabled:{false:{paddingRight:R1}}}}),wz=U.forwardRef(({setFilter:r,toggle:e},t)=>{const[n,i]=R.exports.useState(""),s=R.exports.useMemo(()=>Aw(r,250),[r]),o=()=>{r(""),i("")},a=u=>{const f=u.currentTarget.value;e(!0),i(f)};return R.exports.useEffect(()=>{s(n)},[n,s]),U.createElement(U.Fragment,null,U.createElement(_z,{ref:t,value:n,placeholder:"[Open filter with CMD+SHIFT+L]",onPointerDown:u=>u.stopPropagation(),onChange:a}),U.createElement(rf,{onClick:()=>o(),style:{visibility:n?"visible":"hidden"}},U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"14",width:"14",viewBox:"0 0 20 20",fill:"currentColor"},U.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))))});function Sz({setFilter:r,onDrag:e,toggle:t,toggled:n,title:i,drag:s,filterEnabled:o}){const[a,u]=R.exports.useState(!1),f=R.exports.useRef(null);R.exports.useEffect(()=>{var h,d;a?(h=f.current)===null||h===void 0||h.focus():(d=f.current)===null||d===void 0||d.blur()},[a]);const p=Wl(({offset:[h,d]})=>e({x:h,y:d}),{filterTaps:!0});return R.exports.useEffect(()=>{const h=d=>{d.key==="L"&&d.shiftKey&&d.metaKey&&u(g=>!g)};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[]),U.createElement(U.Fragment,null,U.createElement(vz,{mode:s?"drag":void 0},U.createElement(rf,{active:!n,onClick:()=>t()},U.createElement(Jm,{toggled:n,width:12,height:8})),U.createElement(bz,qt({},s?p():{},{drag:s,filterEnabled:o}),i===void 0&&s?U.createElement("svg",{width:"20",height:"10",viewBox:"0 0 28 14",xmlns:"http://www.w3.org/2000/svg"},U.createElement("circle",{cx:"2",cy:"2",r:"2"}),U.createElement("circle",{cx:"14",cy:"2",r:"2"}),U.createElement("circle",{cx:"26",cy:"2",r:"2"}),U.createElement("circle",{cx:"2",cy:"12",r:"2"}),U.createElement("circle",{cx:"14",cy:"12",r:"2"}),U.createElement("circle",{cx:"26",cy:"12",r:"2"})):i),o&&U.createElement(rf,{active:a,onClick:()=>u(h=>!h)},U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20",viewBox:"0 0 20 20"}
3108,U.createElement("path",{d:"M9 9a2 2 0 114 0 2 2 0 01-4 0z"}),U.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a4 4 0 00-3.446 6.032l-2.261 2.26a1 1 0 101.414 1.415l2.261-2.261A4 4 0 1011 5z",clipRule:"evenodd"})))),U.createElement(xz,{toggled:a},U.createElement(wz,{ref:f,setFilter:r,toggle:t})))}const Mz=["store","hidden","theme","collapsed"];function Ez(r){let{store:e,hidden:t=!1,theme:n,collapsed:i=!1}=r,s=Tt(r,Mz);const o=x1(()=>$I(n),[n]),[a,u]=R.exports.useState(!i),f=typeof i=="object"?!i.collapsed:a,p=R.exports.useMemo(()=>typeof i=="object"?h=>{typeof h=="function"?i.onChange(!h(!i.collapsed)):i.onChange(!h)}:u,[i]);return!e||t?null:U.createElement(qm.Provider,{value:o},U.createElement(Tz,qt({store:e},s,{toggled:f,setToggle:p,rootClass:o.className})))}const Tz=U.memo(({store:r,rootClass:e,fill:t=!1,flat:n=!1,neverHide:i=!1,oneLineLabels:s=!1,titleBar:o={title:void 0,drag:!0,filter:!0},hideCopyButton:a=!1,toggled:u,setToggle:f})=>{var p,h;const d=tB(r),[g,y]=R.exports.useState(""),_=R.exports.useMemo(()=>KB(d,g),[d,g]),[w,x]=Ww(),v=i||d.length>0,E=typeof o=="object"&&o.title||void 0,M=typeof o=="object"&&(p=o.drag)!==null&&p!==void 0?p:!0,A=typeof o=="object"&&(h=o.filter)!==null&&h!==void 0?h:!0;return WI(),U.createElement(Fw.Provider,{value:{hideCopyButton:a}},U.createElement(yz,{ref:w,className:e,fill:t,flat:n,oneLineLabels:s,hideTitleBar:!o,style:{display:v?"block":"none"}},o&&U.createElement(Sz,{onDrag:x,setFilter:y,toggle:C=>f(L=>C!=null?C:!L),toggled:u,title:E,drag:M,filterEnabled:A}),v&&U.createElement(Ow.Provider,{value:r},U.createElement(A1,{isRoot:!0,fill:t,flat:n,tree:_,toggled:u}))))}),Az=["isRoot"];let sf=!1,vs=null;function C1(r){let{isRoot:e=!1}=r,t=Tt(r,Az);return R.exports.useEffect(()=>(sf=!0,!e&&vs&&(vs.remove(),vs=null),()=>{e||(sf=!1)}),[e]),U.createElement(Ez,qt({store:E1},t))}function Rz(r){R.exports.useEffect(()=>{r&&!sf&&(vs||(vs=document.getElementById("leva__root")||Object.assign(document.createElement("div"),{id:"leva__root"}),document.body&&(document.body.appendChild(vs),$p.render(U.createElement(C1,{isRoot:!0}),vs))),sf=!0)},[r])}function Cz(r,e,t,n,i){let s,o,a,u,f;return typeof r=="string"?(o=r,s=e,Array.isArray(t)?f=t:t&&("store"in t?(u=t,f=n):(a=t,Array.isArray(n)?f=n:(u=n,f=i)))):(s=r,Array.isArray(e)?f=e:(u=e,f=t)),{schema:s,folderName:o,folderSettings:a,hookSettings:u,deps:f||[]}}function hN(r,e,t,n,i){const{folderName:s,schema:o,folderSettings:a,hookSettings:u,deps:f}=Cz(r,e,t,n,i),p=typeof o=="function",h=R.exports.useRef(!1),d=R.exports.useRef(!0),g=x1(()=>{h.current=!0;const B=typeof o=="function"?o():o;return s?{[s]:JB(B,a)}:B},f),y=!(u!=null&&u.store);Rz(y);const[_]=R.exports.useState(()=>(u==null?void 0:u.store)||E1),[w,x]=R.exports.useMemo(()=>_.getDataFromSchema(g),[_,g]),[v,E,M,A,C]=R.exports.useMemo(()=>{const B=[],T=[],O={},H={},W={};return Object.values(x).forEach(({path:V,onChange:j,onEditStart:Z,onEditEnd:ne,transient:ge})=>{B.push(V),j?(O[V]=j,ge||T.push(V)):T.push(V),Z&&(H[V]=Z),ne&&(W[V]=ne)}),[B,T,O,H,W]},[x]),L=R.exports.useMemo(()=>_.orderPaths(v),[v,_]),D=nB(_,E,w),k=R.exports.useCallback(B=>{const T=Object.entries(B).reduce((O,[H,W])=>Object.assign(O,{[x[H].path]:W}),{});_.set(T,!1)},[_,x]);return R.exports.useEffect(()=>{const B=!d.current&&h.current;return _.addData(w,B),d.current=!1,h.current=!1,()=>_.disposePaths(L)},[_,L,w]),R.exports.useEffect(()=>{const B=[];return Object.entries(M).forEach(([T,O])=>{O(_.get(T),T,Ke({initial:!0,get:_.get},_.getInput(T)));const H=_.useStore.subscribe(W=>{const V=W.data[T];return[V.disabled?void 0:V.value,V]},([W,V])=>O(W,T,Ke({initial:!1,get:_.get},V)),{equalityFn:Vl});B.push(H)}),()=>B.forEach(T=>T())},[_,M]),R.exports.useEffect(()=>{const B=[];return Object.entries(A).forEach(([T,O])=>B.push(_.subscribeToEditStart(T,O))),Object.entries(C).forEach(([T,O])=>B.push(_.subscribeToEditEnd(T,O))),()=>B.forEach(T=>T())},[A,C,_]),p?[D,k]:D}mi(Sr.SELECT,RD);mi(Sr.IMAGE,FB);mi(Sr.NUMBER,vD);mi(Sr.COLOR,hB);mi(Sr.STRING,zD);mi(Sr.BOOLEAN,WD);mi(Sr.INTERVAL,WB);mi(Sr.VECTOR3D,mB);mi(Sr.VECTOR2D,SB);const Cx=r=>{let e;const t=new Set,n=(u,f)=>{const p=typeof u=="function"?u(e):u;if(p!==e){const h=e;e=f?p:Object.assign({},e,p),t.forEach(d=>d(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:u=>(t.add(u),()=>t.delete(u)),destroy:()=>t.clear()};return e=r(n,i,a),a},Pz=r=>r?Cx(r):Cx;var P1={exports:{}},L1={},I1={exports:{}},D1={};/** 3109 * @license React 3110 * use-sync-external-store-shim.production.min.js 3111 * 3112 * Copyright (c) Facebook, Inc. and its affiliates. 3113 * 3114 * This source code is licensed under the MIT license found in the 3115 * LICENSE file in the root directory of this source tree. 3116 */var na=R.exports;function Lz(r,e){return r===e&&(r!==0||1/r===1/e)||r!==r&&e!==e}var Iz=typeof Object.is=="function"?Object.is:Lz,Dz=na.useState,Oz=na.useEffect,Fz=na.useLayoutEffect,Bz=na.useDebugValue;function zz(r,e){var t=e(),n=Dz({inst:{value:t,getSnapshot:e}}),i=n[0].inst,s=n[1];return Fz(function(){i.value=t,i.getSnapshot=e,zh(i)&&s({inst:i})},[r,t,e]),Oz(function(){return zh(i)&&s({inst:i}),r(function(){zh(i)&&s({inst:i})})},[r]),Bz(t),t}function zh(r){var e=r.getSnapshot;r=r.value;try{var t=e();return!Iz(r,t)}catch{return!0}}function Nz(r,e){return e()}var kz=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?Nz:zz;D1.useSyncExternalStore=na.useSyncExternalStore!==void 0?na.useSyncExternalStore:kz;I1.exports=D1;/** 3117 * @license React 3118 * use-sync-external-store-shim/with-selector.production.min.js 3119 * 3120 * Copyright (c) Facebook, Inc. and its affiliates. 3121 * 3122 * This source code is licensed under the MIT license found in the 3123 * LICENSE file in the root directory of this source tree. 3124 */var Bf=R.exports,Uz=I1.exports;function Hz(r,e){return r===e&&(r!==0||1/r===1/e)||r!==r&&e!==e}var Gz=typeof Object.is=="function"?Object.is:Hz,Vz=Uz.useSyncExternalStore,Wz=Bf.useRef,$z=Bf.useEffect,jz=Bf.useMemo,qz=Bf.useDebugValue;L1.useSyncExternalStoreWithSelector=function(r,e,t,n,i){var s=Wz(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=jz(function(){function u(g){if(!f){if(f=!0,p=g,g=n(g),i!==void 0&&o.hasValue){var y=o.value;if(i(y,g))return h=y}return h=g}if(y=h,Gz(p,g))return y;var _=n(g);return i!==void 0&&i(y,_)?y:(p=g,h=_)}var f=!1,p,h,d=t===void 0?null:t;return[function(){return u(e())},d===null?void 0:function(){return u(d())}]},[e,t,n,i]);var a=Vz(r,s[0],s[1]);return $z(function(){o.hasValue=!0,o.value=a},[a]),qz(a),a};P1.exports=L1;function Xz(r,e=r.getState,t){const n=P1.exports.useSyncExternalStoreWithSelector(r.subscribe,r.getState,r.getServerState||r.getState,e,t);return R.exports.useDebugValue(n),n}const Px=r=>{const e=typeof r=="function"?Pz(r):r,t=(n,i)=>Xz(e,n,i);return Object.assign(t,e),t},Yz=r=>r?Px(r):Px;var Jz=Yz;const nl=Jz(r=>({activeSection:null,previousSection:null,loaded:!1,setLoaded:()=>r(e=>({loaded:!0})),setActiveSection:e=>r(t=>({activeSection:e})),setPreviousSection:e=>r(t=>({previousSection:e}))})),Zz=R.exports.lazy(async()=>{const r=await OP();return!(navigator.vendor.match(/apple/i)&&!navigator.userAgent.match(/crios/i)&&!navigator.userAgent.match(/fxios/i)&&!navigator.userAgent.match(/Opera|OPT\//))&&r.tier>2?No(()=>
3124import("./headset.a44834df.js"),["assets/headset.a44834df.js","assets/index.23d4ff98.js","assets/borderless.e8e9e031.js","assets/borderless.5e52e804.css","assets/index.7c875725.js","assets/Drifter.7a0642b1.js","assets/Vimeo.5fb1645e.js","assets/ScrollTrigger.46001a58.js","assets/useGLTF.03450470.js","assets/useAnimations.57dcec21.js"]):No(()=>import("./headset-mobile.3f29ebe9.js"),["assets/headset-mobile.3f29ebe9.js","assets/index.23d4ff98.js","assets/borderless.e8e9e031.js","assets/borderless.5e52e804.css","assets/index.7c875725.js","assets/Drifter.7a0642b1.js","assets/Vimeo.5fb1645e.js","assets/ScrollTrigger.46001a58.js","assets/useGLTF.03450470.js","assets/useAnimations.57dcec21.js"])}),Kz=()=>{const r=R.exports.useRef(),[e,t]=R.exports.useState(null),n=R.exports.useRef(0),[i,s]=R.exports.useState("ENTER"),[o,a]=R.exports.useState(0),[u,f]=R.exports.useState(1),[p,h]=R.exports.useState([0,0,0]),[d,g]=R.exports.useState([1,1,1]),[y,_]=R.exports.useState([0,0,0]),[w,x]=R.exports.useState(!0),[v,E]=R.exports.useState(0),[M,A]=R.exports.useState(0),[C,L]=R.exports.useState(null),[D,k]=R.exports.useState(null),[B,T]=R.exports.useState(!1),[O,H]=R.exports.useState(!1),W=R.exports.useMemo(()=>w?U.createElement(R.exports.Suspense,null,U.createElement(Zz,{ref:r,mode:i,videoMaterial:e,progress:n,from:o,to:u,position:p,rotation:y,scale:d,override:v,pointlightIntensity:.3,pointlight1Position:C,pointlight2Position:D,isHero:!0,playedIntro:v?!0:B,setPlayedIntro:T,playIntro:O})):U.createElement(U.Fragment,null),[i,e,n,o,u,w,p,d,y,O]);return R.exports.useEffect(()=>{n.current=0},[i]),R.exports.useEffect(()=>{w||(n.current=0)},[w]),R.exports.useEffect(()=>{const V=()=>{H(!0),BorderlessB2B.eventful.off("play intro",V)};BorderlessB2B.eventful.on("play intro",V)},[]),{Headset:W,headsetRef:r,headsetActions:{setMode:s,setVideoMaterial:t,progress:n,setFrom:a,setTo:f,setMounted:x,setPosition:h,setRotation:_,setScale:g,setOverride:E,setPlayedIntro:T,setPointLightIntensity:A,setPointLight1Position:L,setPointLight2Position:k}}},Qz=()=>{const{active:r,progress:e,loaded:t,total:n}=H3(),i=nl(s=>s.setLoaded);return R.exports.useEffect(()=>{BorderlessB2B.eventful.emit("webgl load",{percentage:e/100})},[e,t,n]),R.exports.useEffect(()=>()=>{BorderlessB2B.eventful.emit("webgl load",{percentage:1}),i(!0)},[]),U.createElement(z3,{center:!0},Math.round(e),"%")},eN=R.exports.lazy(()=>No(()=>import("./index.d8e89b03.js"),["assets/index.d8e89b03.js","assets/index.23d4ff98.js","assets/borderless.e8e9e031.js","assets/borderless.5e52e804.css","assets/index.7c875725.js","assets/Drifter.7a0642b1.js","assets/Vimeo.5fb1645e.js","assets/ScrollTrigger.46001a58.js"])),tN=R.exports.lazy(()=>No(()=>import("./index.a0b33b9f.js"),["assets/index.a0b33b9f.js","assets/index.23d4ff98.js","assets/borderless.e8e9e031.js","assets/borderless.5e52e804.css","assets/index.7c875725.js","assets/Drifter.7a0642b1.js","assets/Vimeo.5fb1645e.js","assets/ScrollTrigger.46001a58.js"])),nN=R.exports.lazy(()=>No(()=>import("./index.0bd87f4f.js"),["assets/index.0bd87f4f.js","assets/index.23d4ff98.js","assets/borderless.e8e9e031.js","assets/borderless.5e52e804.css","assets/index.7c875725.js","assets/Drifter.7a0642b1.js","assets/Vimeo.5fb1645e.js","assets/ScrollTrigger.46001a58.js","assets/Galaxy_Tab_S6.d55d6e77.js","assets/useGLTF.03450470.js","assets/headset.a44834df.js","assets/useAnimations.57dcec21.js"])),rN=R.exports.lazy(()=>No(()=>import("./index.09f778a3.js"),["assets/index.09f778a3.js","assets/index.1ca1e77e.css","assets/index.23d4ff98.js","assets/borderless.e8e9e031.js","assets/borderless.5e52e804.css","assets/index.7c875725.js","assets/Drifter.7a0642b1.js","assets/Vimeo.5fb1645e.js","assets/ScrollTrigger.46001a58.js","assets/Galaxy_Tab_S6.d55d6e77.js","assets/useGLTF.03450470.js"])),iN=r=>{let e=r.debug;const{Headset:t,headsetRef:n,headsetActions:i}=Kz(),s=nl(y=>y.loaded),o=nl(y=>y.activeSection),a=nl(y=>y.setActiveSection),u=nl(y=>y.setPreviousSection),f=y=>{a(y)};R.exports.useEffect(()=>{u(o)},[o]),R.exports.useEffect(()=>{console.log(s),s&&!e&&(i.setMode("ENTER"),i.setMounted(!0),i.setOverride(0),i.setPosition([0,0,0]),i.setRotation([0,0,0]),i.setScale(1),BorderlessB2B.eventful.emit("WebGL Loaded")),s&&e&&(i.setPlayedIntro(!0),BorderlessB2B.eventful.emit("WebGL Loaded"))},[s]),R.exports.useEffect(()=>{BorderlessB2B.eventful.on("section-active",f),BorderlessB2B.eventful.once("destroy",()=>{console.log("destroy WebGL Scene"),i.setMode(null),i.setMounted(!1),i.setOverride(null),BorderlessB2B.eventful.off("section-active",f),Router.resume()})},[]);const p=R.exports.useMemo(()=>U.createElement(eN,{headsetRef:n,headsetActions:i}),[]),h=R.exports.useMemo(()=>U.createElement(tN,{headsetRef:n,headsetActions:i}),[]),d=R.exports.useMemo(()=>U.createElement(nN,{headsetRef:n,headsetActions:i}),[]),g=R.exports.useMemo(()=>U.createElement(rN,{headsetRef:n,headsetActions:i}),[]);return U.createElement(U.Fragment,null,t,p,h,d,g)},sN=({sections:r,debug:e})=>U.createElement(U.Fragment,null,U.createElement("div",{style:{height:"100%",width:"100%"}},U.createElement(_3,{gl:{antialias:!0,alpha:!0},camera:{position:[0,0,0,0,.1],fov:!ES()&&!TS()?25:40,near:.01,far:75}},U.createElement(R.exports.Suspense,{fallback:U.createElement(Qz,null)},U.createElement(zP,{files:"/textures/StudioLighting.hdr"}),U.createElement(iN,{sections:r,debug:e})))),U.createElement(C1,{hidden:!e}));var pN=Object.freeze(Object.defineProperty({__proto__:null,default:sN},Symbol.toStringTag,{value:"Module"}));
3124export{fi as $,ui as A,pt as B,Ae as C,Ts as D,sm as E,Ur as F,Bl as G,ys as H,vb as I,Qt as J,R0 as K,x_ as L,pi as M,pl as N,Ji as O,zt as P,Sn as Q,wn as R,Cm as S,db as T,Ml as U,tb as V,_f as W,ct as X,ke as Y,bf as Z,zS as _,nl as a,Kt as a0,Vu as a1,Kp as a2,Wu as a3,bn as a4,dl as a5,hl as a6,Es as a7,nn as a8,BS as a9,Sl as aa,la as ab,wl as ac,er as ad,F as ae,Xi as af,Gm as ag,Eb as ah,z3 as ai,gm as aj,OP as ak,pN as al,hN as b,Wb as c,Bn as d,qu as e,Pm as f,Lm as g,mm as h,de as i,Ns as j,Us as k,Hi as l,Pt as m,zs as n,fl as o,Hs as p,pn as q,mn as r,Rt as s,Af as t,ri as u,vt as v,Je as w,xf as x,on as y,Wn as z};
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.