three-low-poly 0.9.20 → 0.9.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +6 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +39 -0
- package/dist/index.es.js +1186 -1150
- package/dist/index.es.js.map +1 -1
- package/dist/index.iife.js +8 -8
- package/dist/index.iife.js.map +1 -1
- package/dist/index.umd.js +8 -8
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var _t=Object.defineProperty;var Lt=(t,e,o)=>e in t?_t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var v=(t,e,o)=>Lt(t,typeof e!="symbol"?e+"":e,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("three");function zt(t,e,o,s){const i=t.position.clone(),r=i.clone().add(t.getWorldDirection(new n.Vector3).multiplyScalar(-e));let a=null;function c(l){a===null&&(a=l);const m=(l-a)/o;if(m>=1){t.position.copy(r),s&&s();return}t.position.lerpVectors(i,r,m),requestAnimationFrame(c)}requestAnimationFrame(c)}function kt(t,e,o,s){const i=e.length-1;let r=null;function a(c){r===null&&(r=c);const u=(c-r)/o;if(u>=1){t.position.copy(e[e.length-1]),s&&s();return}const m=u*i,h=Math.floor(m),d=m-h,f=e[h],p=e[h+1];t.position.lerpVectors(f,p,d),t.lookAt(p),requestAnimationFrame(a)}requestAnimationFrame(a)}function Dt(t,e,o,s,i){let r=null;function a(c){r||(r=c);const u=(c-r)/s;if(u>=1){i&&i();return}const m=u*Math.PI*2,h=e.x+o*Math.cos(m),d=e.z+o*Math.sin(m);t.position.set(h,t.position.y,d),t.lookAt(e),requestAnimationFrame(a)}requestAnimationFrame(a)}function qt(t,e,o,s,i,r){let a=null,c=0;function l(u){a===null&&(a=u);const m=u-a,h=s/i,d=m%h/h,f=Math.sin(d*Math.PI*2)*Math.PI/6,p=e.x+o*Math.sin(f),M=e.z+o*Math.cos(f);if(t.position.set(p,t.position.y,M),t.lookAt(e),m>=(c+1)*h&&c++,c>=i){r&&r();return}requestAnimationFrame(l)}requestAnimationFrame(l)}function Ht(t,e,o,s,i,r,a){let c=null;function l(u){c===null&&(c=u);const h=(u-c)/r;if(h>=1){a&&a();return}const d=h*Math.PI*2*i,f=e.x+o*Math.cos(d),p=e.z+o*Math.sin(d),M=e.y+s*h;t.position.set(f,M,p),t.lookAt(e),requestAnimationFrame(l)}requestAnimationFrame(l)}function Yt(t,e,o,s){const i=t.position.clone();let r=null;function a(c){if(r===null&&(r=c),(c-r)/o>=1){t.position.copy(i),s&&s();return}const m=new n.Vector3((Math.random()-.5)*e,(Math.random()-.5)*e,(Math.random()-.5)*e);t.position.copy(i).add(m),requestAnimationFrame(a)}requestAnimationFrame(a)}function Xt(t,e,o,s,i,r){const a=t.fov;t.fov=o,t.updateProjectionMatrix();let c=null;function l(u){c===null&&(c=u);const h=(u-c)/i;if(h>=1){t.fov=s,t.updateProjectionMatrix(),t.lookAt(e),t.fov=a,t.updateProjectionMatrix(),r&&r();return}t.fov=n.MathUtils.lerp(o,s,h),t.updateProjectionMatrix(),t.lookAt(e),requestAnimationFrame(l)}requestAnimationFrame(l)}class Zt{constructor(e){v(this,"speed");v(this,"maxIntensity");v(this,"minIntensity");v(this,"material");const{speed:o=2,maxIntensity:s=.8,minIntensity:i=.2}=e;this.speed=o,this.maxIntensity=s,this.minIntensity=i,this.material=e.material}update(e=0){this.material.emissiveIntensity=this.minIntensity+Math.abs(Math.sin(e*this.speed))*(this.maxIntensity-this.minIntensity)}}function k(t=0,e=1){return Math.random()*(e-t)+t}function jt(t=0,e=1){return Math.floor(Math.random()*(e-t+1))+t}function J(t=.5,e=0,o=1){return e+(o-e)*Math.pow(Math.random(),t)}function $(t=.5,e=0,o=1){return e+(o-e)*Math.pow(1-Math.random(),t)}class Qt{constructor({light:e,minIntensity:o=.8,maxIntensity:s=1.2,x:i=0,y:r=0,z:a=0,jitterX:c=.02,jitterY:l=0,jitterZ:u=.02}={}){v(this,"light");v(this,"minIntensity");v(this,"maxIntensity");v(this,"x");v(this,"y");v(this,"z");v(this,"jitterX");v(this,"jitterY");v(this,"jitterZ");this.light=e,this.minIntensity=o,this.maxIntensity=s,this.x=i,this.y=r,this.z=a,this.jitterX=c,this.jitterY=l,this.jitterZ=u}update(){this.light&&(this.light.intensity=k(this.minIntensity,this.maxIntensity),this.light.position.x=Math.random()*this.jitterX-this.jitterX/2+this.x,this.light.position.y=Math.random()*this.jitterY-this.jitterY/2+this.y,this.light.position.z=Math.random()*this.jitterZ-this.jitterZ/2+this.z)}}function ee(t,e,o){const s=e+Math.random()*(o-e);return setTimeout(t,s)}function Kt(t,e,o){let s;function i(){const r=e+Math.random()*(o-e);s=setTimeout(()=>{t(),i()},r)}return i(),()=>clearTimeout(s)}class Wt{constructor({light:e,minIntensity:o=15,maxIntensity:s=20,minDuration:i=50,maxDuration:r=250}={}){v(this,"light");v(this,"minIntensity");v(this,"maxIntensity");v(this,"minDuration");v(this,"maxDuration");this.light=e,this.minIntensity=o,this.maxIntensity=s,this.minDuration=i,this.maxDuration=r}triggerLightning(){this.light&&(this.light.intensity=k(this.minIntensity,this.maxIntensity)),ee(()=>{this.light&&(this.light.intensity=0)},this.minDuration,this.maxDuration)}update(){Math.random()>.98&&this.triggerLightning()}}const R={UP:new n.Vector3(0,1,0),DOWN:new n.Vector3(0,-1,0),LEFT:new n.Vector3(-1,0,0),RIGHT:new n.Vector3(1,0,0),FORWARD:new n.Vector3(0,0,1),BACKWARD:new n.Vector3(0,0,-1)},O={LINEAR:(t,e)=>1-t/e,QUADRATIC:(t,e)=>Math.pow(1-t/e,2),SQUARE_ROOT:(t,e)=>Math.pow(1-t/e,.5),LOGARITHMIC:(t,e)=>Math.log(1+(e-t))/Math.log(1+e),SINE:(t,e)=>Math.cos(t/e*Math.PI/2),EXPONENTIAL:(t,e)=>Math.exp(-t/e),CUBIC:(t,e)=>Math.pow(1-t/e,3),GAUSSIAN:(t,e)=>Math.exp(-Math.pow(t,2)/(2*Math.pow(e/3,2))),INVERSE:(t,e)=>e/(e+t),SMOOTHSTEP:(t,e)=>{const o=Math.max(0,Math.min(1,1-t/e));return o*o*(3-2*o)}},Jt=(t,e,o,s,i=R.UP,r=O.LINEAR)=>{const a=t.attributes.position;for(let c=0;c<a.count;c++){const l=new n.Vector3;l.fromBufferAttribute(a,c);const u=l.distanceTo(e);if(u<o){const h=r(u,o)*s;l.add(i.clone().multiplyScalar(h)),a.setXYZ(c,l.x,l.y,l.z)}}a.needsUpdate=!0},$t=(t,e,o,s,i,r=R.UP,a=O.LINEAR)=>{const c=t.attributes.position;for(let l=0;l<c.count;l++){const u=new n.Vector3;u.fromBufferAttribute(c,l);const m=u.distanceTo(e);if(m<o){const d=a(m,o)*i,f=u.dot(r.normalize()),p=s-f;u.add(r.clone().multiplyScalar(p*d)),c.setXYZ(l,u.x,u.y,u.z)}}c.needsUpdate=!0},eo=(t,e,o,s,i=R.UP,r=O.LINEAR)=>{const a=t.attributes.position;for(let c=0;c<a.count;c++){const l=new n.Vector3;l.fromBufferAttribute(a,c);const u=l.distanceTo(e);if(u<o){const m=r(u,o),h=s*m,d=i.clone().normalize();l.x+=n.MathUtils.randFloatSpread(h)*d.x,l.y+=n.MathUtils.randFloatSpread(h)*d.y,l.z+=n.MathUtils.randFloatSpread(h)*d.z,a.setXYZ(c,l.x,l.y,l.z)}}a.needsUpdate=!0},to=(t,e,o,s)=>{const i=t.attributes.position,r=new n.Vector3;for(let a=0;a<i.count;a++){const c=new n.Vector3;if(c.fromBufferAttribute(i,a),c.distanceTo(e)<o){let u=new n.Vector3,m=0;for(let h=0;h<i.count;h++)r.fromBufferAttribute(i,h),r.distanceTo(c)<o&&(u.add(r),m++);m>0&&(u.divideScalar(m),c.lerp(u,s),i.setXYZ(a,c.x,c.y,c.z))}}i.needsUpdate=!0},oo=(t,e,o,s,i=!1,r=O.LINEAR)=>{const a=t.attributes.position;for(let c=0;c<a.count;c++){const l=new n.Vector3;l.fromBufferAttribute(a,c);const u=l.distanceTo(e);if(u<o){const h=r(u,o)*s*(i?-1:1),d=l.clone().sub(e).normalize();l.add(d.multiplyScalar(h)),a.setXYZ(c,l.x,l.y,l.z)}}a.needsUpdate=!0},no=(t,e,o,s,i=R.UP,r=O.LINEAR)=>{const a=t.attributes.position,c=new n.Quaternion;for(let l=0;l<a.count;l++){const u=new n.Vector3;u.fromBufferAttribute(a,l);const m=u.distanceTo(e);if(m<o){const d=r(m,o)*s;c.setFromAxisAngle(i,d),u.sub(e).applyQuaternion(c).add(e),a.setXYZ(l,u.x,u.y,u.z)}}a.needsUpdate=!0},D={X:new n.Vector3(1,0,0),Y:new n.Vector3(0,1,0),Z:new n.Vector3(0,0,1),XY:new n.Vector3(1,1,0).normalize(),XZ:new n.Vector3(1,0,1).normalize(),YZ:new n.Vector3(0,1,1).normalize(),XYZ:new n.Vector3(1,1,1).normalize()};var E=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom",t.FRONT="front",t.BACK="back",t))(E||{});const C={CADMIUM_RED:15073318,CARDINAL_RED:12981270,CHERRY_RED:14165028,CRIMSON:12986408,ALIZARIN_CRIMSON:11674146,DARK_RED:9109504,RUST:12731693,CORAL_ORANGE:16734003,TANGERINE:16733440,ORANGE_PEEL:16737792,CADMIUM_ORANGE:16744228,ORANGE:16753920,AMBER:16755200,CADMIUM_YELLOW:16766720,GOLD:16766720,YELLOW:16776960,LIME_GREEN:10798080,SPRING_GREEN:8965205,MOSS_GREEN:8956467,FERN_GREEN:4950843,FOREST_GREEN:2263842,SAP_GREEN:5274922,OLIVE_DRAB:5597999,VIRIDIAN_GREEN:43115,MINT_GREEN:8965290,AQUAMARINE:65450,PHTHALO_BLUE:3977,AETHER_BLUE:3447003,SKY_BLUE:8965375,CERULEAN_BLUE:6139362,AZURE:30719,OCEAN_BLUE:30654,ROYAL_BLUE:5592575,MIDNIGHT_BLUE:51,ULTRAMARINE_BLUE:4149685,COBALT_VIOLET:6950317,DEEP_VIOLET:11141375,CORAL_PINK:16724838,VIVID_MAGENTA:16720639,MAGENTA:16711935,HOT_PINK:16711850,PINK_SHERBET:16751052,SOFT_PINK:16762823,BURNT_SIENNA:15299665,BURNT_UMBER:9057060,SIENNA:9132587,SADDLE_BROWN:9127187,COFFEE_BROWN:6045747,DARK_UMBER:4929057,RAW_UMBER:8545860,YELLOW_OCHRE:12951919,RAW_SIENNA:13808780,TAUPE:9141627,ONYX:197379,CARBON:3026478,CHARCOAL:3355443,SLATE_GRAY:4210752,ASH_GRAY:4473924,GRAPHITE:5263440,STEEL_GRAY:5592405,DIM_GRAY:6908265,IRON:7829367,GRAY:8421504,STONE:8947848,SILVER:11184810,LIGHT_GRAY:13421772,PALE_GRAY:15658734,WHITE_SMOKE:16119285,TITANIUM_WHITE:16777215},te=t=>1-Math.cos(t*Math.PI/2),oe=t=>Math.sin(t*Math.PI/2),ne=t=>-.5*(Math.cos(Math.PI*t)-1),re=t=>t*t,se=t=>1-Math.pow(1-t,2),ae=t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,ie=t=>t*t*t,ce=t=>1-Math.pow(1-t,3),le=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,ue=t=>t*t*t*t,me=t=>1-Math.pow(1-t,4),he=t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,de=t=>t*t*t*t*t,fe=t=>1-Math.pow(1-t,5),pe=t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,Me=t=>t===0?0:Math.pow(2,10*t-10),ye=t=>t===1?1:1-Math.pow(2,-10*t),we=t=>t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,xe=t=>1-Math.sqrt(1-Math.pow(t,2)),ve=t=>Math.sqrt(1-Math.pow(t-1,2)),ge=t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,Se=t=>t,Ge=t=>t*t*(3-2*t),Ae=t=>1-Math.pow(1-t,.3),be=t=>Math.pow(t,.3),Ee=t=>Math.log(Math.max(.01,t))/Math.log(2),Ie=t=>Math.sqrt(t),Be=t=>1-t,Te=t=>Math.exp(-Math.pow(t-.5,2)/(2*.5)),ro={SINE_EASE_IN:te,SINE_EASE_OUT:oe,SINE_EASE_IN_OUT:ne,QUADRATIC_EASE_IN:re,QUADRATIC_EASE_OUT:se,QUADRATIC_EASE_IN_OUT:ae,CUBIC_EASE_IN:ie,CUBIC_EASE_OUT:ce,CUBIC_EASE_IN_OUT:le,QUARTIC_EASE_IN:ue,QUARTIC_EASE_OUT:me,QUARTIC_EASE_IN_OUT:he,QUINTIC_EASE_IN:de,QUINTIC_EASE_OUT:fe,QUINTIC_EASE_IN_OUT:pe,EXPONENTIAL_EASE_IN:Me,EXPONENTIAL_EASE_OUT:ye,EXPONENTIAL_EASE_IN_OUT:we,CIRCULAR_EASE_IN:xe,CIRCULAR_EASE_OUT:ve,CIRCULAR_EASE_IN_OUT:ge,LINEAR:Se,SMOOTHSTEP:Ge,CONCAVE:Ae,CONVEX:be,LOGARITHMIC:Ee,SQUARE_ROOT:Ie,INVERSE:Be,GAUSSIAN:Te},Pe=(t,e,o,s,i)=>{const r=Math.max(0,Math.min(1,t)),a=1-r;return a*a*a*e+3*a*a*r*o+3*a*r*r*s+r*r*r*i},Ce=(t,e=1)=>{const o=Math.max(.001,e);return(1-Math.exp(-o*t))/(1-Math.exp(-o))},Ve=(t,e=1,o=1)=>{const s=Math.max(0,Math.min(1,t));return e*Math.pow(s,o)},Re=(t,e=1,o=1)=>{const s=Math.max(.001,Math.min(1,t));return e*Math.log(o*s+1)},Oe=(t,e=1,o=0,s=0)=>{const i=Math.max(0,Math.min(1,t));return e*i*i+o*i+s},Ne=(t,e,o,s)=>{const i=Math.max(0,Math.min(1,t)),r=1-i;return r*r*e+2*r*i*o+i*i*s},Ue=(t,e=10)=>{const o=Math.max(0,Math.min(1,t));return 1/(1+Math.exp(-e*(o-.5)))},so=t=>Math.sin(t*Math.PI*.5),P={CUBIC:Pe,DAMPED:Ce,EXPONENTIAL:Ve,LOGARITHMIC:Re,PARABOLIC:Oe,QUADRATIC:Ne,SIGMOID:Ue,SINUSOIDAL:so};class ao extends n.InstancedMesh{constructor(o={}){const{count:s=20,width:i=1.5,height:r=3,depth:a=1.5,geometry:c=new n.SphereGeometry(.1,6,6),material:l=new n.MeshStandardMaterial({color:16777215,transparent:!0,opacity:.6,roughness:.3,metalness:.3})}=o;super(c,l,s);v(this,"bubblePositions",[]);v(this,"velocities",[]);v(this,"width");v(this,"height");v(this,"depth");this.height=r,this.width=i,this.depth=a;for(let u=0;u<this.count;u++){const m=new n.Vector3((Math.random()-.5)*i,Math.random()*(r-1)+.5,(Math.random()-.5)*a);this.bubblePositions.push(m),this.velocities.push(.01+Math.random()*.02),this.updateInstanceMatrix(u)}}updateInstanceMatrix(o){const s=this.bubblePositions[o],i=new n.Matrix4().setPosition(s);this.setMatrixAt(o,i),this.instanceMatrix.needsUpdate=!0}update(){for(let o=0;o<this.count;o++){const s=this.bubblePositions[o];s.y+=this.velocities[o],s.y>this.height&&(s.x=(Math.random()-.5)*this.width,s.y=0,s.z=(Math.random()-.5)*this.depth),this.updateInstanceMatrix(o)}}}class Fe extends n.BufferGeometry{constructor(e=.1){super();const o=[],s=[],i=[[0,1],[.5,.75],[.75,.25],[.5,-.5],[0,-1],[-.5,-.5],[-.75,.25],[-.5,.75]];for(let a=0;a<i.length;a++){const[c,l]=i[a];o.push(c*e,l*e,0)}for(let a=1;a<i.length-1;a++)s.push(0,a,a+1);s.push(0,i.length-1,1);const r=new n.Float32BufferAttribute(o,3);this.setAttribute("position",r),this.setIndex(s),this.computeVertexNormals()}}class io extends n.InstancedMesh{constructor(o={}){const{count:s=200,width:i=20,height:r=10,depth:a=20,geometry:c=new Fe,material:l=new n.MeshStandardMaterial({color:8956467,metalness:.1,roughness:.8,flatShading:!0,side:n.DoubleSide})}=o;super(c,l,s);v(this,"dummyMatrix");v(this,"velocities");v(this,"width");v(this,"height");v(this,"depth");this.dummyMatrix=new n.Matrix4,this.velocities=[],this.width=i,this.height=r,this.depth=a;for(let u=0;u<s;u++){const m=(Math.random()-.5)*i,h=Math.random()*(r-1)+.5,d=(Math.random()-.5)*a,f=(Math.random()-.5)*Math.PI,p=(Math.random()-.5)*Math.PI,M=(Math.random()-.5)*Math.PI;this.dummyMatrix.makeRotationFromEuler(new n.Euler(f,p,M)),this.dummyMatrix.setPosition(m,h,d),this.setMatrixAt(u,this.dummyMatrix);const y=new n.Vector3((Math.random()-.5)*.01,-.005,(Math.random()-.5)*.01);this.velocities.push(y)}this.instanceMatrix.needsUpdate=!0}update(){for(let o=0;o<this.count;o++){const s=new n.Matrix4;this.getMatrixAt(o,s);const i=new n.Vector3;i.setFromMatrixPosition(s);const r=this.velocities[o];i.add(r),i.y<0&&(i.set((Math.random()-.5)*this.width,Math.random()*(this.height-1)+.5,(Math.random()-.5)*this.depth),r.set((Math.random()-.5)*.01,-.005,(Math.random()-.5)*.01)),s.setPosition(i),this.setMatrixAt(o,s)}this.instanceMatrix.needsUpdate=!0}}const g=(t,e)=>{const o=t[0].index!==null,s=new Set(Object.keys(t[0].attributes)),i=new Set(Object.keys(t[0].morphAttributes)),r={},a={},c=t[0].morphTargetsRelative,l=new n.BufferGeometry;let u=0;if(t.forEach((m,h)=>{let d=0;if(o!==(m.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let f in m.attributes){if(!s.has(f))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+f+'" attribute exists among all geometries, or in none of them.'),null;r[f]===void 0&&(r[f]=[]),r[f].push(m.attributes[f]),d++}if(d!==s.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(c!==m.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let f in m.morphAttributes){if(!i.has(f))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;a[f]===void 0&&(a[f]=[]),a[f].push(m.morphAttributes[f])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(m.userData),e){let f;if(m.index)f=m.index.count;else if(m.attributes.position!==void 0)f=m.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;l.addGroup(u,f,h),u+=f}}),o){let m=0;const h=[];t.forEach(d=>{const f=d.index;for(let p=0;p<f.count;++p)h.push(f.getX(p)+m);m+=d.attributes.position.count}),l.setIndex(h)}for(let m in r){const h=W(r[m]);if(!h)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+m+" attribute."),null;l.setAttribute(m,h)}for(let m in a){const h=a[m][0].length;if(h===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[m]=[];for(let d=0;d<h;++d){const f=[];for(let M=0;M<a[m].length;++M)f.push(a[m][M][d]);const p=W(f);if(!p)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+m+" morphAttribute."),null;l.morphAttributes[m].push(p)}}return l},W=t=>{let e,o,s,i=0;if(t.forEach(r=>{if(e===void 0&&(e=r.array.constructor),e!==r.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(o===void 0&&(o=r.itemSize),o!==r.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(s===void 0&&(s=r.normalized),s!==r.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;i+=r.array.length}),e&&o){const r=new e(i);let a=0;return t.forEach(c=>{r.set(c.array,a),a+=c.array.length}),new n.BufferAttribute(r,o,s)}};function co(t,e=1e-4){e=Math.max(e,Number.EPSILON);const o={},s=t.getIndex(),i=t.getAttribute("position"),r=s?s.count:i.count;let a=0;const c=Object.keys(t.attributes),l={},u={},m=[],h=["getX","getY","getZ","getW"];for(let M=0,y=c.length;M<y;M++){const x=c[M];l[x]=[];const w=t.morphAttributes[x];w&&(u[x]=new Array(w.length).fill(0).map(()=>[]))}const d=Math.log10(1/e),f=Math.pow(10,d);for(let M=0;M<r;M++){const y=s?s.getX(M):M;let x="";for(let w=0,I=c.length;w<I;w++){const S=c[w],G=t.getAttribute(S),A=G.itemSize;for(let B=0;B<A;B++)x+=`${~~(G[h[B]](y)*f)},`}if(x in o)m.push(o[x]);else{for(let w=0,I=c.length;w<I;w++){const S=c[w],G=t.getAttribute(S),A=t.morphAttributes[S],B=G.itemSize,T=l[S],q=u[S];for(let N=0;N<B;N++){const U=h[N];if(T.push(G[U](y)),A)for(let b=0,Ft=A.length;b<Ft;b++)q[b].push(A[b][U](y))}}o[x]=a,m.push(a),a++}}const p=t.clone();for(let M=0,y=c.length;M<y;M++){const x=c[M],w=t.getAttribute(x),I=new w.array.constructor(l[x]),S=new n.BufferAttribute(I,w.itemSize,w.normalized);if(p.setAttribute(x,S),x in u)for(let G=0;G<u[x].length;G++){const A=t.morphAttributes[x][G],B=new A.array.constructor(u[x][G]),T=new n.BufferAttribute(B,A.itemSize,A.normalized);p.morphAttributes[x][G]=T}}return p.setIndex(m),p}class lo extends n.BufferGeometry{constructor(e=(i,r,a)=>a.set(i,r,Math.cos(i)*Math.sin(r)),o=8,s=8){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:o,stacks:s};const i=[],r=[],a=[],c=[],l=1e-5,u=new n.Vector3,m=new n.Vector3,h=new n.Vector3,d=new n.Vector3,f=new n.Vector3,p=o+1;for(let M=0;M<=s;M++){const y=M/s;for(let x=0;x<=o;x++){const w=x/o;e(w,y,m),r.push(m.x,m.y,m.z),w-l>=0?(e(w-l,y,h),d.subVectors(m,h)):(e(w+l,y,h),d.subVectors(h,m)),y-l>=0?(e(w,y-l,h),f.subVectors(m,h)):(e(w,y+l,h),f.subVectors(h,m)),u.crossVectors(d,f).normalize(),a.push(u.x,u.y,u.z),c.push(w,y)}}for(let M=0;M<s;M++)for(let y=0;y<o;y++){const x=M*p+y,w=M*p+y+1,I=(M+1)*p+y+1,S=(M+1)*p+y;i.push(x,w,S),i.push(w,I,S)}this.setIndex(i),this.setAttribute("position",new n.Float32BufferAttribute(r,3)),this.setAttribute("normal",new n.Float32BufferAttribute(a,3)),this.setAttribute("uv",new n.Float32BufferAttribute(c,2))}}class Y extends n.BufferGeometry{constructor(e=1,o=1.5,s=.5,i=.05,r=.05){super();const a=e,c=o,l=s,u=i,m=r,h=[0,0,0,a,0,0,a,c,0,0,c,0,a,0,-l,0,0,-l,0,c,-l,a,c,-l,0,0,-l,0,0,0,0,c,0,0,c,-l,a,0,-u,u,0,-u,u,c,-u,a,c,-u,u,0,-l+u,a,0,-l+u,a,c,-l+u,u,c,-l+u,u,0,-u,u,0,-l+u,u,c,-l+u,u,c,-u,0,c,0,a,c,0,a,c,-u,u,c,-u,0,c,-l,u,c,-l+u,a,c,-l+u,a,c,-l,0,c,0,u,c,-u,u,c,-l+u,0,c,-l,0,0,0,u,0,-u,a,0,-u,a,0,0,0,0,-l,a,0,-l,a,0,-l+u,u,0,-l+u,0,0,0,0,0,-l,u,0,-l+u,u,0,-u,a,0,0,a,0,-u,a,c,-u,a,c,0,a,0,-l,a,c,-l,a,c,-l+u,a,0,-l+u],d=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0],f=e/(e*2+s),p=(e+s)/(e*2+s),M=[p,0,1,0,1,1,p,1,0,0,f,0,f,1,0,1,f,0,p,0,p,1,f,1,1,0,p,0,p,1,1,1,f,0,0,0,0,1,f,1,p,0,f,0,f,1,p,1,p,0,1,0,1,1,p,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1],y=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23,24,25,26,24,26,27,28,29,30,28,30,31,32,33,34,32,34,35,36,37,38,36,38,39,40,41,42,40,42,43,44,45,46,44,46,47,48,49,50,48,50,51,52,53,54,52,54,55],x=new Float32Array(h),w=new Float32Array(d),I=new Float32Array(M),S=new Uint16Array(y),G=new n.BufferGeometry;G.setAttribute("position",new n.BufferAttribute(x,3)),G.setAttribute("normal",new n.BufferAttribute(w,3)),G.setAttribute("uv",new n.BufferAttribute(I,2)),G.setIndex(new n.BufferAttribute(S,1));const A=new n.BoxGeometry(e-u-m,c-m*2,l-u*2);A.translate((e-u-m)/2+u,c/2,-l/2),this.copy(g([G,A],!0))}}function _e({scaleXMin:t=.4,scaleXMax:e=.7,scaleYMin:o=.3,scaleYMax:s=.95,scaleZMin:i=.1,scaleZMax:r=.5}={}){return new n.Vector3(k(t,e),J(.25,o,s),$(.8,i,r))}function X({coverMaterial:t,pagesMaterial:e,scales:o}){const s=new Y,i=new n.InstancedMesh(s,[t,e],o.length),r=new n.Matrix4;let a=0;for(let c=0;c<o.length;c++){const l=o[c],u=new n.Matrix4;u.makeScale(l.x,l.y,l.z),r.identity(),r.multiply(u),r.setPosition(.01+Math.random()*.1,0,a+l.z*.5),i.setMatrixAt(c,r),a+=l.z*.5}return i}function uo({coverMaterial:t,pagesMaterial:e,count:o=10,scaleXMin:s=.4,scaleXMax:i=.7,scaleYMin:r=.3,scaleYMax:a=.95,scaleZMin:c=.1,scaleZMax:l=.5}){const u=Array.from({length:o},()=>_e({scaleXMin:s,scaleXMax:i,scaleYMin:r,scaleYMax:a,scaleZMin:c,scaleZMax:l}));return X({coverMaterial:t,pagesMaterial:e,scales:u})}function mo({coverMaterial:t,pagesMaterial:e,length:o=10,scaleXMin:s=.4,scaleXMax:i=.7,scaleYMin:r=.3,scaleYMax:a=.95,scaleZMin:c=.1,scaleZMax:l=.5}){const u=[];let m=o;for(;m>0;){const h=_e({scaleXMin:s,scaleXMax:i,scaleYMin:r,scaleYMax:a,scaleZMin:c,scaleZMax:l});h.z=Math.min(h.z,m),u.push(h),m-=h.z}return X({coverMaterial:t,pagesMaterial:e,scales:u})}class ho extends n.BufferGeometry{constructor(e=2,o=.3,s=.6,i=5,r=5,a=Math.PI/4){super();const c=[],l=[];for(let f=0;f<i;f++){const p=f*o,M=p+o,y=f*s,x=y+s;c.push(-e/2,p,y,e/2,p,y,e/2,M,y,-e/2,M,y,-e/2,M,y,e/2,M,y,e/2,M,x,-e/2,M,x);const w=f*8;l.push(w,w+1,w+2,w,w+2,w+3),l.push(w+4,w+5,w+6,w+4,w+6,w+7)}const u=i*o,m=i*s,h=e*2;c.push(-h/2,u,m,h/2,u,m,h/2,u,m+s,-h/2,u,m+s);const d=i*8;l.push(d,d+1,d+2,d,d+2,d+3);for(let f=0;f<2;f++){const p=f===0?1:-1;for(let M=0;M<r;M++){const y=u+M*o,x=y+o,w=p*(h/4),I=m+s,S=M*s*Math.cos(a),G=M*s*Math.sin(a),A=w+p*S-e/2*Math.cos(a),B=w+p*S+e/2*Math.cos(a),T=I+G,q=A+p*s*Math.cos(a),N=B+p*s*Math.cos(a),U=T+s*Math.sin(a);c.push(A,y,T,B,y,T,B,x,T,A,x,T,A,x,T,B,x,T,N,x,U,q,x,U);const b=d+4+f*r*8+M*8;l.push(b,b+1,b+2,b,b+2,b+3),l.push(b+4,b+5,b+6,b+4,b+6,b+7)}}this.setIndex(l),this.setAttribute("position",new n.Float32BufferAttribute(c,3)),this.computeVertexNormals()}}class Le extends n.BufferGeometry{constructor({width:e=5,height:o=3,depth:s=5,wallThickness:i=.05}={}){super();const r=e,a=o,c=s,l=i,u=[0,0,0,r,0,0,r,a,0,0,a,0,0,0,c,0,0,0,0,a,0,0,a,c,0,0,c,r,0,c,r,0,0,0,0,0,-l,-l,c,r,-l,c,r,0,c,0,0,c,r,-l,c,r,-l,-l,r,0,0,r,0,c,-l,-l,c,0,0,c,0,a,c,-l,a,c,r,0,0,r,-l,-l,r,a,-l,r,a,0,-l,a,c,0,a,c,0,a,0,-l,a,-l,0,a,0,r,a,0,r,a,-l,-l,a,-l,-l,-l,-l,r,-l,-l,r,-l,c,-l,-l,c,-l,-l,-l,-l,-l,c,-l,a,c,-l,a,-l,r,-l,-l,-l,-l,-l,-l,a,-l,r,a,-l],m=[0,1,3,1,2,3,4,5,7,5,6,7,8,9,11,9,10,11,12,13,15,13,14,15,16,17,19,17,18,19,20,21,23,21,22,23,24,25,27,25,26,27,28,29,31,29,30,31,32,33,35,33,34,35,36,37,39,37,38,39,40,41,43,41,42,43,44,45,47,45,46,47],h=[0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1],d=[.5,0,1,0,1,1,.5,1,0,0,.5,0,.5,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,l/r,0,l/r,0,0,1,0,1,l/r,0,l/r,0,0,l/r,0,l/r,1,0,1,1-l/r,0,1,0,1,1,1-l/r,1,0,0,l/r,0,l/r,1,0,1,0,1-l/r,1,1-l/r,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1],f=new Float32Array(u),p=new Float32Array(h),M=new Float32Array(d);this.setAttribute("position",new n.BufferAttribute(f,3)),this.setAttribute("normal",new n.BufferAttribute(p,3)),this.setAttribute("uv",new n.BufferAttribute(M,2)),this.setIndex(m),this.addGroup(0,12,0),this.addGroup(12,6,1),this.addGroup(18,54,2)}}class fo extends n.BufferGeometry{constructor(e=2,o=.3,s=.5,i=5,r=2){super();const a=[],c=[];for(let h=0;h<i;h++){const d=h*o,f=d+o,p=h*s,M=p+s;a.push(-e/2,d,p,e/2,d,p,e/2,f,p,-e/2,f,p,-e/2,f,p,e/2,f,p,e/2,f,M,-e/2,f,M);const y=h*8;c.push(y,y+1,y+2,y,y+2,y+3),c.push(y+4,y+5,y+6,y+4,y+6,y+7)}const l=i*o,u=i*s;a.push(-e/2,l,u,e/2,l,u,e/2,l,u+r,-e/2,l,u+r);const m=i*8;c.push(m,m+1,m+2,m,m+2,m+3);for(let h=0;h<i;h++){const d=l+h*o,f=d+o,p=-e/2-h*s,M=p-s;a.push(p,d,u+r,p,d,u+r-e,p,f,u+r-e,p,f,u+r,p,f,u+r,p,f,u+r-e,M,f,u+r-e,M,f,u+r);const y=m+4+h*8;c.push(y,y+1,y+2,y,y+2,y+3),c.push(y+4,y+5,y+6,y+4,y+6,y+7)}this.setIndex(c),this.setAttribute("position",new n.Float32BufferAttribute(a,3)),this.computeVertexNormals()}}class po extends n.BufferGeometry{constructor(e=1,o=.4,s=.2,i=20,r=2,a=Math.PI/8){super();const c=[],l=[];let u=0;for(let m=0;m<i;m++){const h=r*Math.cos(u),d=r*Math.sin(u),f=m*s,p=f+s;c.push(h-e/2*Math.cos(u),f,d-e/2*Math.sin(u),h+e/2*Math.cos(u),f,d+e/2*Math.sin(u),h+e/2*Math.cos(u),p,d+e/2*Math.sin(u),h-e/2*Math.cos(u),p,d-e/2*Math.sin(u)),c.push(h-e/2*Math.cos(u),p,d-e/2*Math.sin(u),h+e/2*Math.cos(u),p,d+e/2*Math.sin(u),h+e/2*Math.cos(u)-o*Math.sin(u),p,d+e/2*Math.sin(u)+o*Math.cos(u),h-e/2*Math.cos(u)-o*Math.sin(u),p,d-e/2*Math.sin(u)+o*Math.cos(u));const M=m*8;l.push(M,M+1,M+2,M,M+2,M+3),l.push(M+4,M+5,M+6,M+4,M+6,M+7),u+=a}this.setIndex(l),this.setAttribute("position",new n.Float32BufferAttribute(c,3)),this.computeVertexNormals()}}class Mo extends n.BufferGeometry{constructor(e=2,o=.3,s=.5,i=10){super();const r=[],a=[];for(let c=0;c<i;c++){const l=c*o,u=l+o,m=c*s,h=m+s;r.push(-e/2,l,m,e/2,l,m,e/2,u,m,-e/2,u,m,-e/2,u,m,e/2,u,m,e/2,u,h,-e/2,u,h);const d=c*8;a.push(d,d+1,d+2,d,d+2,d+3),a.push(d+4,d+6,d+5,d+4,d+7,d+6)}this.setIndex(a),this.setAttribute("position",new n.Float32BufferAttribute(r,3)),this.computeVertexNormals()}}class ze extends n.BufferGeometry{constructor(){super();const e=[new n.Vector2(0,0),new n.Vector2(1.2,0),new n.Vector2(1.5,1.5),new n.Vector2(1,3),new n.Vector2(.6,3.5),new n.Vector2(.5,3.5)],o=new n.LatheGeometry(e,10),s=new n.CylinderGeometry(.6,.5,.3,10);s.translate(0,3.5,0),this.copy(g([o,s],!0))}}function Z(t,e,o,s,i){const r=(s-e)/(o-t);return t+(i-e)/r}function ke(t,e,o,s,i){const r=(s-e)/(o-t);return e+r*(i-t)}const yo={calculateXFromSlopeIntercept:Z,calculateYFromSlopeIntercept:ke};class De extends n.BufferGeometry{constructor(){super();const e=[new n.Vector2(0,0),new n.Vector2(.8,0),new n.Vector2(1,1.5),new n.Vector2(.5,2.2),new n.Vector2(.6,2.5),new n.Vector2(.5,2.5)],o=new n.LatheGeometry(e,10),s=new n.CylinderGeometry(.55,.45,.2,10);s.translate(0,2.5,0);const i=[new n.Vector2(0,0),new n.Vector2(.8,0),new n.Vector2(Z(.8,0,1,1.5,1),1),new n.Vector2(0,1)],r=new n.LatheGeometry(i,10);r.translate(0,.1,0),r.scale(.9,.9,.9),this.copy(g([o,s,r],!0))}}class qe extends n.BufferGeometry{constructor({radius:e=.5,neckRadius:o=.2,height:s=3,neckHeight:i=1,segments:r=16}={}){super();const a=s-i,c=new n.CylinderGeometry(e,e,a,r);c.translate(0,a/2,0);const l=.3,u=new n.CylinderGeometry(o,e,l,r);u.translate(0,a+l/2,0);const m=new n.CylinderGeometry(o,o,i,r);m.translate(0,a+l+i/2,0),this.copy(g([c,u,m],!1))}}class He extends n.BufferGeometry{constructor(e=.4,o=1.2,s=.2){super();const i=o*.6,r=new n.BoxGeometry(e/2,i,s);r.translate(0,i/2,0);const a=e*1.5,c=new n.BoxGeometry(a,e/4,s);c.translate(0,i*.75,0),this.copy(g([r,c],!1)),this.computeVertexNormals()}}class Ye extends n.BufferGeometry{constructor(){super();const e=new n.BoxGeometry(5,1,5);e.translate(0,.5,0);const o=new n.BoxGeometry(4,3,4);o.translate(0,2.5,0);const s=[[-1.8,2.3,-2.2],[1.8,2.3,-2.2],[-1.8,2.3,2.2],[1.8,2.3,2.2]],i=[];s.forEach(u=>{const m=new n.CylinderGeometry(.2,.2,3.5,16);m.translate(u[0],u[1],u[2]),i.push(m)});const r=new n.ConeGeometry(3.5,2,4);r.rotateY(Math.PI/4),r.translate(0,5,0);const a=new n.Shape;a.moveTo(-1,0),a.lineTo(-1,2),a.absarc(0,2,1,Math.PI,0,!0),a.lineTo(1,0);const c={depth:.5,bevelEnabled:!1},l=new n.ExtrudeGeometry(a,c);l.translate(0,.5,1.7),l.setIndex([...Array(l.attributes.position.count).keys()]),this.copy(g([e,g([o,...i],!1),r,l],!0)),this.computeVertexNormals()}}class Xe extends n.BufferGeometry{constructor(e=1.75,o=.75){super();const s=e*.05,i=e*.15,r=e*.15,a=e*.75;let c=0;const l=new n.BoxGeometry(o,s,o);l.translate(0,c+s/2,0),c+=s;const u=new n.BoxGeometry(o*.8,i,o*.8);u.translate(0,c+i/2,0),c+=i;const m=new n.BoxGeometry(o*.6,r,o*.6);m.translate(0,c+r/2,0),c+=r;const h=new n.BoxGeometry(o*.4,a,o*.4);h.translate(0,c+a/2,0),c+=a;const d=new n.ConeGeometry(o*.4/Math.sqrt(2),.1,4,1,!1,Math.PI/4);d.translate(0,c+.1/2,0),this.copy(g([l,u,m,h,d],!1)),this.computeVertexNormals()}}class Ze extends n.BufferGeometry{constructor(e=.6,o=1,s=.2,i=.6){super();const r=o-i/2,a=new n.BoxGeometry(e,r,s);a.translate(0,r/2,0);const c=new n.CylinderGeometry(i/2,i/2,s,16,1,!1,0,Math.PI);c.rotateY(Math.PI/2),c.rotateX(Math.PI/2),c.translate(0,r,0),this.copy(g([a,c],!1)),this.computeVertexNormals()}}class je extends n.BufferGeometry{constructor(e=.5,o=.8,s=.15){super();const i=new n.BoxGeometry(e,o,s);i.translate(0,o/2,0),this.copy(i)}}class Qe extends n.BufferGeometry{constructor({height:e=2.25}={}){super();const o=new n.BoxGeometry(1.2,.5,1.2);o.translate(0,.25,0);const s=new n.BoxGeometry(1,e,1);s.translate(0,.5+e/2,0);const i=new n.BoxGeometry(1.4,.3,1.4);i.translate(0,.5+e+.15,0),this.copy(g([o,s,i],!1))}}class j extends n.BufferGeometry{constructor({barHeight:e=2,barRadius:o=.05,spikeHeight:s=.3,spikeRadius:i=.075,spikeScaleZ:r=1,radialSegments:a=8}={}){super();const c=new n.CylinderGeometry(o,o,e,a);c.translate(0,e/2,0);const l=new n.ConeGeometry(i,s,a);l.translate(0,e+s/2,0),l.scale(1,1,r),this.copy(g([c,l],!1))}}class Ke extends n.BufferGeometry{constructor({count:e=20,spacing:o=.4,barHeight:s=2,barRadius:i=.05,spikeHeight:r=.3,spikeRadius:a=.075,spikeScaleZ:c=1,railHeight:l=.1,railDepth:u=.05,railOffset:m=0,radialSegments:h=8}={}){super();const d=[],f=new j({barHeight:s,barRadius:i,spikeHeight:r,spikeRadius:a,spikeScaleZ:c,radialSegments:h}),p=new n.BoxGeometry(e*o,l,u);for(let x=0;x<e;x++){const w=f.clone();w.translate(x*o,0,0),d.push(w)}const M=p.clone();M.translate(o*(e-1)/2,s-m-l/2,0),d.push(M);const y=p.clone();y.translate(o*(e-1)/2,l/2,0),d.push(y),this.copy(g(d))}}class We extends n.BufferGeometry{constructor({width:e=5,height:o=8,depth:s=1,shelves:i=4,frameThickness:r=.1,open:a=!1}={}){super();const c=o,l=e,u=s,m=new n.BoxGeometry(r,c,u),h=new n.BoxGeometry(l-2*r,r,u),d=m.clone();d.translate(-l/2+r/2,c/2,0);const f=m.clone();f.translate(l/2-r/2,c/2,0);const p=h.clone();p.translate(0,c-r/2,0);const M=h.clone();M.translate(0,r/2,0);const y=new n.BoxGeometry(l,c,r);y.translate(0,c/2,-u/2+r/2);const x=[],w=(c-r)/(i+1);for(let I=1;I<=i;I++){const S=h.clone();S.translate(0,r/2+I*w,0),x.push(S)}this.copy(g([d,f,p,M,...a?[]:[y],...x],!1))}}class Je extends n.BufferGeometry{constructor(){super();const e=new n.BoxGeometry(5,.3,3);e.translate(0,3.15,0);const o=[new n.Vector2(.2,0),new n.Vector2(.25,.5),new n.Vector2(.15,1.5),new n.Vector2(.3,3)],s=new n.LatheGeometry(o,32),r=g([[2.1,0,1.1],[-2.1,0,1.1],[2.1,0,-1.1],[-2.1,0,-1.1]].map(a=>{const c=s.clone();return c.translate(a[0],a[1],a[2]),c}));this.copy(g([e,r],!0))}}class Q extends lo{constructor({height:e=.25,radius:o=.05,segmentsU:s=16,segmentsV:i=16}={}){super((r,a,c)=>{const l=r*Math.PI*2,u=Math.sin(a*Math.PI),m=o*u*Math.cos(l),h=a*e,d=o*u*Math.sin(l);c.set(m,h,-d)},s,i)}}class $e extends n.BufferGeometry{constructor({radiusTop:e=.2,radiusBottom:o=.2,height:s=1,flameHeight:i=.25,flameRadius:r=.05,segments:a=16}={}){super();const c=new n.CylinderGeometry(e,o,s,a);c.translate(0,s/2,0);const l=new Q({segmentsU:a,segmentsV:a,height:i,radius:r});l.translate(0,s,0),this.copy(g([c,l],!0))}}class wo extends n.BufferGeometry{constructor(e=1,o=2,s=.5,i=Math.PI/4){super();const r=o*Math.tan(i),a=e,c=o,l=s,u=[0,0,0,a,0,0,a+r,c,0,r,c,0,a,0,-l,0,0,-l,r,c,-l,a+r,c,-l,0,0,-l,0,0,0,r,c,0,r,c,-l,a,0,0,a,0,-l,a+r,c,-l,a+r,c,0,r,c,0,a+r,c,0,a+r,c,-l,r,c,-l,0,0,-l,a,0,-l,a,0,0,0,0,0],m=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0],h=[0,1,2,2,3,0,4,5,6,6,7,4,8,9,10,10,11,8,12,13,14,14,15,12,16,17,18,18,19,16,20,21,22,22,23,20],d=new Float32Array([0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1]),f=new Float32Array(u),p=new Float32Array(m),M=new Float32Array(d),y=new Uint16Array(h);this.setAttribute("position",new n.BufferAttribute(f,3)),this.setAttribute("normal",new n.BufferAttribute(p,3)),this.setAttribute("uv",new n.BufferAttribute(M,2)),this.setIndex(new n.BufferAttribute(y,1)),this.center()}}class et extends n.BufferGeometry{constructor(){super();const e=[],o=[];for(let s=0;s<5;s++){const i=.8+Math.random()*.4,r=.8+Math.random()*.4,a=.8+Math.random()*.4,c=Math.random()*Math.PI,l=Math.random()*Math.PI,u=Math.random()*Math.PI,m=(Math.random()-.5)*4,h=0,d=(Math.random()-.5)*4,f=new n.DodecahedronGeometry(1,0);f.scale(i,r,a),f.rotateX(c),f.rotateY(l),f.rotateZ(u),f.translate(m,h,d),e.push(f);const p=new n.DodecahedronGeometry(1,0);p.scale(i*.9,r*.5,a*.9),p.rotateX(c),p.rotateY(l),p.rotateZ(u),p.translate(m,h+.3,d),o.push(p)}this.copy(g([g(e),g(o)],!0))}}function tt(t,e=D.XYZ,o=.5,s=2){t.deleteAttribute("uv"),t.deleteAttribute("normal"),t=co(t),t.computeVertexNormals();const i=t.getAttribute("position");for(let r=0;r<i.count;r++){const a=new n.Vector3().fromBufferAttribute(i,r),c=Math.random()*(s-o)+o,l=e.clone().multiplyScalar(c);a.add(l),i.setXYZ(r,a.x,a.y,a.z)}return i.needsUpdate=!0,t.computeVertexNormals(),t}class ot extends n.BufferGeometry{constructor(e=1,o=4,s=4){super();const i=new n.SphereGeometry(e,o,s);this.copy(tt(i,D.XYZ,.5,1)),this.computeVertexNormals(),this.center()}}class nt extends n.BufferGeometry{constructor(){super();const e=[];for(let o=0;o<5;o++){const s=new n.DodecahedronGeometry(1,0);s.scale(.8+Math.random()*.4,.8+Math.random()*.4,.8+Math.random()*.4),s.rotateX(Math.random()*Math.PI),s.rotateY(Math.random()*Math.PI),s.rotateZ(Math.random()*Math.PI),s.translate((Math.random()-.5)*4,0,(Math.random()-.5)*4),e.push(s)}this.copy(g(e))}}class rt extends n.BufferGeometry{constructor(e=.1,o=.1,s=.4,i=8){super();const r=new n.CylinderGeometry(e*.6,o*.6,s,i);r.translate(0,0,0);const a=new n.SphereGeometry(e,i,i),c=a.clone(),l=a.clone(),u=a.clone(),m=a.clone();c.translate(0,s/2+e*.6,-e*.6),l.translate(0,s/2+e*.6,e*.6),u.translate(0,-s/2-o*.6,-o*.6),m.translate(0,-s/2-o*.6,o*.6),this.copy(g([r,c,l,u,m],!1))}}class st extends n.BufferGeometry{constructor({flaskRadius:e=1,neckRadius:o=.3,height:s=2.5,neckHeight:i=1,radialSegments:r=16}={}){super();const a=[new n.Vector2(0,0),new n.Vector2(e*.875,0),new n.Vector2(e,.1),new n.Vector2(o,s),new n.Vector2(o,s+i),new n.Vector2(o*1.1,s+i+.3)],c=new n.LatheGeometry(a,r);this.copy(g([c],!1))}}const xo=(t,e)=>t/(1-Math.cos(e)),K=(t,e)=>t/(2*Math.sin(e)),at=(t,e)=>t*(1-Math.cos(e)),vo=(t,e)=>2*t*Math.sin(e),H=(t,e)=>{const o=2*e;return Math.asin(o/(2*t))},go=(t,e,o)=>({x:t*Math.sin(o)*Math.cos(e),y:t*Math.sin(o)*Math.sin(e),z:t*Math.cos(o)}),So=(t,e,o)=>{const s=Math.sqrt(t*t+e*e+o*o),i=Math.atan2(e,t),r=Math.acos(o/s);return{radius:s,theta:i,phi:r}};function it(t,e,o,s=0,i=0,r=32){const a=s?H(t,s):0,c=i?Math.PI-H(t,i):Math.PI,l=[];for(let u=0;u<=r;u++){const m=c-(c-a)/r*u,h=t*Math.sin(m),d=e*Math.cos(m)+o;l.push(new n.Vector2(h,d))}return[...l]}class ct extends n.BufferGeometry{constructor(){super();const e=[...it(1,1,.5,.2,0,32),new n.Vector2(.2,3)],o=new n.LatheGeometry(e,32);this.copy(o)}}class lt extends n.BufferGeometry{constructor(){super();const e=[new n.Vector2(1,0),new n.Vector2(1.2,.5),new n.Vector2(1.4,1.5),new n.Vector2(1.3,1.8),new n.Vector2(.8,1.8)],o=new n.LatheGeometry(e,12),s=new n.CircleGeometry(1,12);s.rotateX(-Math.PI/2),s.translate(0,0,0),this.copy(g([o,s],!1))}}class ut extends n.BufferGeometry{constructor({radius:e=.3,height:o=.4,count:s=3,thickness:i=.03,radialSegments:r=16}={}){super();const a=new n.TorusGeometry(e,i,8,r);a.rotateX(Math.PI/2),a.translate(0,o,0);const c=new n.CylinderGeometry(i*.6,i*.6,o,r),l=[];for(let u=0;u<s;u++){const m=u/s*Math.PI*2,h=c.clone();h.translate(Math.cos(m)*e,o/2,Math.sin(m)*e),l.push(h)}this.copy(g([a,...l],!1))}}class mt extends n.BufferGeometry{constructor(){super();const e=new n.CylinderGeometry(.5,.6,.3,16);e.translate(0,.15,0);const o=new n.CylinderGeometry(.15,.15,2,12,1,!0);o.translate(0,1.3,0);const s=new n.SphereGeometry(.3,16,16);s.translate(0,2.4,0),this.copy(g([e,g([o,s])],!0))}}class z extends n.BufferGeometry{constructor(e=.2,o=.2,s=3,i=32,r=!0){super();const a=new n.CylinderGeometry(e,o,s,i,1,r),c=new n.SphereGeometry(o,i,i/2,0,Math.PI*2,Math.PI/2,Math.PI/2);c.translate(0,-(s/2),0),this.copy(g([a,c],!1))}}class ht extends n.BufferGeometry{constructor({radius:e=3,height:o=.6,widthSegments:s=64,heightSegments:i=16,phiStart:r=0,phiLength:a=Math.PI*2}={}){super(),this.copy(new n.SphereGeometry(e,s,i,r,a,0,Math.PI/2)),this.scale(1,o/e,1)}}class dt extends n.BufferGeometry{constructor({radius:e=K(5,Math.PI/10),widthSegments:o=64,heightSegments:s=32,phiStart:i=0,phiLength:r=Math.PI*2,thetaLength:a=Math.PI/10}={}){super(),this.copy(new n.SphereGeometry(e,o,s,i,r,0,a));const c=at(e,a);this.translate(0,-e+c,0)}}class ft extends n.BufferGeometry{constructor({trunkRadiusTop:e=.25,trunkRadiusBottom:o=.4,trunkHeight:s=2.5,trunkSegments:i=14,leafSize:r=.8,leafCount:a=6,leafDetail:c=0,leafSpreadRadius:l=1.5}={}){super();const u=new n.CylinderGeometry(e,o,s,i);u.translate(0,s/2,0);const m=[];for(let h=0;h<a;h++){const d=new n.DodecahedronGeometry(r,c);d.translate((Math.random()-.5)*l,(Math.random()-.5)*r+s,(Math.random()-.5)*l),m.push(d)}this.copy(g([u.toNonIndexed(),g(m,!1)],!0)),this.computeVertexNormals()}}class Go extends n.Mesh{constructor({width:e=5,height:o=3,depth:s=5,wallThickness:i=.05,interiorColor:r=C.WHITE_SMOKE,floorColor:a=C.RAW_SIENNA,exteriorColor:c=C.GRAY}={}){super(new Le({width:e,height:o,depth:s,wallThickness:i}),[new n.MeshStandardMaterial({color:r}),new n.MeshStandardMaterial({color:a}),new n.MeshStandardMaterial({color:c})])}}const pt={uniforms:{time:{value:0}},vertexShader:`
|
|
1
|
+
"use strict";var _t=Object.defineProperty;var Lt=(t,e,o)=>e in t?_t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var v=(t,e,o)=>Lt(t,typeof e!="symbol"?e+"":e,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("three");function zt(t,e,o,s){const i=t.position.clone(),r=i.clone().add(t.getWorldDirection(new n.Vector3).multiplyScalar(-e));let a=null;function c(l){a===null&&(a=l);const m=(l-a)/o;if(m>=1){t.position.copy(r),s&&s();return}t.position.lerpVectors(i,r,m),requestAnimationFrame(c)}requestAnimationFrame(c)}function kt(t,e,o,s){const i=e.length-1;let r=null;function a(c){r===null&&(r=c);const u=(c-r)/o;if(u>=1){t.position.copy(e[e.length-1]),s&&s();return}const m=u*i,h=Math.floor(m),d=m-h,f=e[h],p=e[h+1];t.position.lerpVectors(f,p,d),t.lookAt(p),requestAnimationFrame(a)}requestAnimationFrame(a)}function Dt(t,e,o,s,i){let r=null;function a(c){r||(r=c);const u=(c-r)/s;if(u>=1){i&&i();return}const m=u*Math.PI*2,h=e.x+o*Math.cos(m),d=e.z+o*Math.sin(m);t.position.set(h,t.position.y,d),t.lookAt(e),requestAnimationFrame(a)}requestAnimationFrame(a)}function qt(t,e,o,s,i,r){let a=null,c=0;function l(u){a===null&&(a=u);const m=u-a,h=s/i,d=m%h/h,f=Math.sin(d*Math.PI*2)*Math.PI/6,p=e.x+o*Math.sin(f),M=e.z+o*Math.cos(f);if(t.position.set(p,t.position.y,M),t.lookAt(e),m>=(c+1)*h&&c++,c>=i){r&&r();return}requestAnimationFrame(l)}requestAnimationFrame(l)}function Ht(t,e,o,s,i,r,a){let c=null;function l(u){c===null&&(c=u);const h=(u-c)/r;if(h>=1){a&&a();return}const d=h*Math.PI*2*i,f=e.x+o*Math.cos(d),p=e.z+o*Math.sin(d),M=e.y+s*h;t.position.set(f,M,p),t.lookAt(e),requestAnimationFrame(l)}requestAnimationFrame(l)}function Yt(t,e,o,s){const i=t.position.clone();let r=null;function a(c){if(r===null&&(r=c),(c-r)/o>=1){t.position.copy(i),s&&s();return}const m=new n.Vector3((Math.random()-.5)*e,(Math.random()-.5)*e,(Math.random()-.5)*e);t.position.copy(i).add(m),requestAnimationFrame(a)}requestAnimationFrame(a)}function Xt(t,e,o,s,i,r){const a=t.fov;t.fov=o,t.updateProjectionMatrix();let c=null;function l(u){c===null&&(c=u);const h=(u-c)/i;if(h>=1){t.fov=s,t.updateProjectionMatrix(),t.lookAt(e),t.fov=a,t.updateProjectionMatrix(),r&&r();return}t.fov=n.MathUtils.lerp(o,s,h),t.updateProjectionMatrix(),t.lookAt(e),requestAnimationFrame(l)}requestAnimationFrame(l)}class Zt{constructor(e){v(this,"speed");v(this,"maxIntensity");v(this,"minIntensity");v(this,"material");const{speed:o=2,maxIntensity:s=.8,minIntensity:i=.2}=e;this.speed=o,this.maxIntensity=s,this.minIntensity=i,this.material=e.material}update(e=0){this.material.emissiveIntensity=this.minIntensity+Math.abs(Math.sin(e*this.speed))*(this.maxIntensity-this.minIntensity)}}function k(t=0,e=1){return Math.random()*(e-t)+t}function jt(t=0,e=1){return Math.floor(Math.random()*(e-t+1))+t}function J(t=.5,e=0,o=1){return e+(o-e)*Math.pow(Math.random(),t)}function $(t=.5,e=0,o=1){return e+(o-e)*Math.pow(1-Math.random(),t)}class Qt{constructor({light:e,minIntensity:o=.8,maxIntensity:s=1.2,x:i=0,y:r=0,z:a=0,jitterX:c=.02,jitterY:l=0,jitterZ:u=.02}={}){v(this,"light");v(this,"minIntensity");v(this,"maxIntensity");v(this,"x");v(this,"y");v(this,"z");v(this,"jitterX");v(this,"jitterY");v(this,"jitterZ");this.light=e,this.minIntensity=o,this.maxIntensity=s,this.x=i,this.y=r,this.z=a,this.jitterX=c,this.jitterY=l,this.jitterZ=u}update(){this.light&&(this.light.intensity=k(this.minIntensity,this.maxIntensity),this.light.position.x=Math.random()*this.jitterX-this.jitterX/2+this.x,this.light.position.y=Math.random()*this.jitterY-this.jitterY/2+this.y,this.light.position.z=Math.random()*this.jitterZ-this.jitterZ/2+this.z)}}function ee(t,e,o){const s=e+Math.random()*(o-e);return setTimeout(t,s)}function Kt(t,e,o){let s;function i(){const r=e+Math.random()*(o-e);s=setTimeout(()=>{t(),i()},r)}return i(),()=>clearTimeout(s)}class Wt{constructor({light:e,minIntensity:o=15,maxIntensity:s=20,minDuration:i=50,maxDuration:r=250}={}){v(this,"light");v(this,"minIntensity");v(this,"maxIntensity");v(this,"minDuration");v(this,"maxDuration");this.light=e,this.minIntensity=o,this.maxIntensity=s,this.minDuration=i,this.maxDuration=r}triggerLightning(){this.light&&(this.light.intensity=k(this.minIntensity,this.maxIntensity)),ee(()=>{this.light&&(this.light.intensity=0)},this.minDuration,this.maxDuration)}update(){Math.random()>.98&&this.triggerLightning()}}const R={UP:new n.Vector3(0,1,0),DOWN:new n.Vector3(0,-1,0),LEFT:new n.Vector3(-1,0,0),RIGHT:new n.Vector3(1,0,0),FORWARD:new n.Vector3(0,0,1),BACKWARD:new n.Vector3(0,0,-1)},O={LINEAR:(t,e)=>1-t/e,QUADRATIC:(t,e)=>Math.pow(1-t/e,2),SQUARE_ROOT:(t,e)=>Math.pow(1-t/e,.5),LOGARITHMIC:(t,e)=>Math.log(1+(e-t))/Math.log(1+e),SINE:(t,e)=>Math.cos(t/e*Math.PI/2),EXPONENTIAL:(t,e)=>Math.exp(-t/e),CUBIC:(t,e)=>Math.pow(1-t/e,3),GAUSSIAN:(t,e)=>Math.exp(-Math.pow(t,2)/(2*Math.pow(e/3,2))),INVERSE:(t,e)=>e/(e+t),SMOOTHSTEP:(t,e)=>{const o=Math.max(0,Math.min(1,1-t/e));return o*o*(3-2*o)}},Jt=(t,e,o,s,i=R.UP,r=O.LINEAR)=>{const a=t.attributes.position;for(let c=0;c<a.count;c++){const l=new n.Vector3;l.fromBufferAttribute(a,c);const u=l.distanceTo(e);if(u<o){const h=r(u,o)*s;l.add(i.clone().multiplyScalar(h)),a.setXYZ(c,l.x,l.y,l.z)}}a.needsUpdate=!0},$t=(t,e,o,s,i,r=R.UP,a=O.LINEAR)=>{const c=t.attributes.position;for(let l=0;l<c.count;l++){const u=new n.Vector3;u.fromBufferAttribute(c,l);const m=u.distanceTo(e);if(m<o){const d=a(m,o)*i,f=u.dot(r.normalize()),p=s-f;u.add(r.clone().multiplyScalar(p*d)),c.setXYZ(l,u.x,u.y,u.z)}}c.needsUpdate=!0},eo=(t,e,o,s,i=R.UP,r=O.LINEAR)=>{const a=t.attributes.position;for(let c=0;c<a.count;c++){const l=new n.Vector3;l.fromBufferAttribute(a,c);const u=l.distanceTo(e);if(u<o){const m=r(u,o),h=s*m,d=i.clone().normalize();l.x+=n.MathUtils.randFloatSpread(h)*d.x,l.y+=n.MathUtils.randFloatSpread(h)*d.y,l.z+=n.MathUtils.randFloatSpread(h)*d.z,a.setXYZ(c,l.x,l.y,l.z)}}a.needsUpdate=!0},to=(t,e,o,s)=>{const i=t.attributes.position,r=new n.Vector3;for(let a=0;a<i.count;a++){const c=new n.Vector3;if(c.fromBufferAttribute(i,a),c.distanceTo(e)<o){let u=new n.Vector3,m=0;for(let h=0;h<i.count;h++)r.fromBufferAttribute(i,h),r.distanceTo(c)<o&&(u.add(r),m++);m>0&&(u.divideScalar(m),c.lerp(u,s),i.setXYZ(a,c.x,c.y,c.z))}}i.needsUpdate=!0},oo=(t,e,o,s,i=!1,r=O.LINEAR)=>{const a=t.attributes.position;for(let c=0;c<a.count;c++){const l=new n.Vector3;l.fromBufferAttribute(a,c);const u=l.distanceTo(e);if(u<o){const h=r(u,o)*s*(i?-1:1),d=l.clone().sub(e).normalize();l.add(d.multiplyScalar(h)),a.setXYZ(c,l.x,l.y,l.z)}}a.needsUpdate=!0},no=(t,e,o,s,i=R.UP,r=O.LINEAR)=>{const a=t.attributes.position,c=new n.Quaternion;for(let l=0;l<a.count;l++){const u=new n.Vector3;u.fromBufferAttribute(a,l);const m=u.distanceTo(e);if(m<o){const d=r(m,o)*s;c.setFromAxisAngle(i,d),u.sub(e).applyQuaternion(c).add(e),a.setXYZ(l,u.x,u.y,u.z)}}a.needsUpdate=!0},D={X:new n.Vector3(1,0,0),Y:new n.Vector3(0,1,0),Z:new n.Vector3(0,0,1),XY:new n.Vector3(1,1,0).normalize(),XZ:new n.Vector3(1,0,1).normalize(),YZ:new n.Vector3(0,1,1).normalize(),XYZ:new n.Vector3(1,1,1).normalize()};var E=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom",t.FRONT="front",t.BACK="back",t))(E||{});const C={CADMIUM_RED:15073318,CARDINAL_RED:12981270,CHERRY_RED:14165028,CRIMSON:12986408,ALIZARIN_CRIMSON:11674146,DARK_RED:9109504,RUST:12731693,CORAL_ORANGE:16734003,TANGERINE:16733440,ORANGE_PEEL:16737792,CADMIUM_ORANGE:16744228,ORANGE:16753920,AMBER:16755200,CADMIUM_YELLOW:16766720,GOLD:16766720,YELLOW:16776960,LIME_GREEN:10798080,SPRING_GREEN:8965205,MOSS_GREEN:8956467,FERN_GREEN:4950843,FOREST_GREEN:2263842,SAP_GREEN:5274922,OLIVE_DRAB:5597999,VIRIDIAN_GREEN:43115,MINT_GREEN:8965290,AQUAMARINE:65450,PHTHALO_BLUE:3977,AETHER_BLUE:3447003,SKY_BLUE:8965375,CERULEAN_BLUE:6139362,AZURE:30719,OCEAN_BLUE:30654,ROYAL_BLUE:5592575,MIDNIGHT_BLUE:51,ULTRAMARINE_BLUE:4149685,COBALT_VIOLET:6950317,DEEP_VIOLET:11141375,CORAL_PINK:16724838,VIVID_MAGENTA:16720639,MAGENTA:16711935,HOT_PINK:16711850,PINK_SHERBET:16751052,SOFT_PINK:16762823,BURNT_SIENNA:15299665,BURNT_UMBER:9057060,SIENNA:9132587,SADDLE_BROWN:9127187,COFFEE_BROWN:6045747,DARK_UMBER:4929057,RAW_UMBER:8545860,YELLOW_OCHRE:12951919,RAW_SIENNA:13808780,TAUPE:9141627,ONYX:197379,CARBON:3026478,CHARCOAL:3355443,SLATE_GRAY:4210752,ASH_GRAY:4473924,GRAPHITE:5263440,STEEL_GRAY:5592405,DIM_GRAY:6908265,IRON:7829367,GRAY:8421504,STONE:8947848,SILVER:11184810,LIGHT_GRAY:13421772,PALE_GRAY:15658734,WHITE_SMOKE:16119285,TITANIUM_WHITE:16777215},te=t=>1-Math.cos(t*Math.PI/2),oe=t=>Math.sin(t*Math.PI/2),ne=t=>-.5*(Math.cos(Math.PI*t)-1),re=t=>t*t,se=t=>1-Math.pow(1-t,2),ae=t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,ie=t=>t*t*t,ce=t=>1-Math.pow(1-t,3),le=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,ue=t=>t*t*t*t,me=t=>1-Math.pow(1-t,4),he=t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,de=t=>t*t*t*t*t,fe=t=>1-Math.pow(1-t,5),pe=t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,Me=t=>t===0?0:Math.pow(2,10*t-10),ye=t=>t===1?1:1-Math.pow(2,-10*t),we=t=>t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,xe=t=>1-Math.sqrt(1-Math.pow(t,2)),ve=t=>Math.sqrt(1-Math.pow(t-1,2)),ge=t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,Se=t=>t,Ge=t=>t*t*(3-2*t),Ae=t=>1-Math.pow(1-t,.3),be=t=>Math.pow(t,.3),Ie=t=>Math.log(Math.max(.01,t))/Math.log(2),Ee=t=>Math.sqrt(t),Te=t=>1-t,Be=t=>Math.exp(-Math.pow(t-.5,2)/(2*.5)),ro={SINE_EASE_IN:te,SINE_EASE_OUT:oe,SINE_EASE_IN_OUT:ne,QUADRATIC_EASE_IN:re,QUADRATIC_EASE_OUT:se,QUADRATIC_EASE_IN_OUT:ae,CUBIC_EASE_IN:ie,CUBIC_EASE_OUT:ce,CUBIC_EASE_IN_OUT:le,QUARTIC_EASE_IN:ue,QUARTIC_EASE_OUT:me,QUARTIC_EASE_IN_OUT:he,QUINTIC_EASE_IN:de,QUINTIC_EASE_OUT:fe,QUINTIC_EASE_IN_OUT:pe,EXPONENTIAL_EASE_IN:Me,EXPONENTIAL_EASE_OUT:ye,EXPONENTIAL_EASE_IN_OUT:we,CIRCULAR_EASE_IN:xe,CIRCULAR_EASE_OUT:ve,CIRCULAR_EASE_IN_OUT:ge,LINEAR:Se,SMOOTHSTEP:Ge,CONCAVE:Ae,CONVEX:be,LOGARITHMIC:Ie,SQUARE_ROOT:Ee,INVERSE:Te,GAUSSIAN:Be},Pe=(t,e,o,s,i)=>{const r=Math.max(0,Math.min(1,t)),a=1-r;return a*a*a*e+3*a*a*r*o+3*a*r*r*s+r*r*r*i},Ce=(t,e=1)=>{const o=Math.max(.001,e);return(1-Math.exp(-o*t))/(1-Math.exp(-o))},Ve=(t,e=1,o=1)=>{const s=Math.max(0,Math.min(1,t));return e*Math.pow(s,o)},Re=(t,e=1,o=1)=>{const s=Math.max(.001,Math.min(1,t));return e*Math.log(o*s+1)},Oe=(t,e=1,o=0,s=0)=>{const i=Math.max(0,Math.min(1,t));return e*i*i+o*i+s},Ne=(t,e,o,s)=>{const i=Math.max(0,Math.min(1,t)),r=1-i;return r*r*e+2*r*i*o+i*i*s},Ue=(t,e=10)=>{const o=Math.max(0,Math.min(1,t));return 1/(1+Math.exp(-e*(o-.5)))},so=t=>Math.sin(t*Math.PI*.5),P={CUBIC:Pe,DAMPED:Ce,EXPONENTIAL:Ve,LOGARITHMIC:Re,PARABOLIC:Oe,QUADRATIC:Ne,SIGMOID:Ue,SINUSOIDAL:so};class ao extends n.InstancedMesh{constructor(o={}){const{count:s=20,width:i=1.5,height:r=3,depth:a=1.5,geometry:c=new n.SphereGeometry(.1,6,6),material:l=new n.MeshStandardMaterial({color:16777215,transparent:!0,opacity:.6,roughness:.3,metalness:.3})}=o;super(c,l,s);v(this,"bubblePositions",[]);v(this,"velocities",[]);v(this,"width");v(this,"height");v(this,"depth");this.height=r,this.width=i,this.depth=a;for(let u=0;u<this.count;u++){const m=new n.Vector3((Math.random()-.5)*i,Math.random()*(r-1)+.5,(Math.random()-.5)*a);this.bubblePositions.push(m),this.velocities.push(.01+Math.random()*.02),this.updateInstanceMatrix(u)}}updateInstanceMatrix(o){const s=this.bubblePositions[o],i=new n.Matrix4().setPosition(s);this.setMatrixAt(o,i),this.instanceMatrix.needsUpdate=!0}update(){for(let o=0;o<this.count;o++){const s=this.bubblePositions[o];s.y+=this.velocities[o],s.y>this.height&&(s.x=(Math.random()-.5)*this.width,s.y=0,s.z=(Math.random()-.5)*this.depth),this.updateInstanceMatrix(o)}}}class Fe extends n.BufferGeometry{constructor(e=.1){super();const o=[],s=[],i=[[0,1],[.5,.75],[.75,.25],[.5,-.5],[0,-1],[-.5,-.5],[-.75,.25],[-.5,.75]];for(let a=0;a<i.length;a++){const[c,l]=i[a];o.push(c*e,l*e,0)}for(let a=1;a<i.length-1;a++)s.push(0,a,a+1);s.push(0,i.length-1,1);const r=new n.Float32BufferAttribute(o,3);this.setAttribute("position",r),this.setIndex(s),this.computeVertexNormals()}}class io extends n.InstancedMesh{constructor(o={}){const{count:s=200,width:i=20,height:r=10,depth:a=20,geometry:c=new Fe,material:l=new n.MeshStandardMaterial({color:8956467,metalness:.1,roughness:.8,flatShading:!0,side:n.DoubleSide})}=o;super(c,l,s);v(this,"dummyMatrix");v(this,"velocities");v(this,"width");v(this,"height");v(this,"depth");this.dummyMatrix=new n.Matrix4,this.velocities=[],this.width=i,this.height=r,this.depth=a;for(let u=0;u<s;u++){const m=(Math.random()-.5)*i,h=Math.random()*(r-1)+.5,d=(Math.random()-.5)*a,f=(Math.random()-.5)*Math.PI,p=(Math.random()-.5)*Math.PI,M=(Math.random()-.5)*Math.PI;this.dummyMatrix.makeRotationFromEuler(new n.Euler(f,p,M)),this.dummyMatrix.setPosition(m,h,d),this.setMatrixAt(u,this.dummyMatrix);const y=new n.Vector3((Math.random()-.5)*.01,-.005,(Math.random()-.5)*.01);this.velocities.push(y)}this.instanceMatrix.needsUpdate=!0}update(){for(let o=0;o<this.count;o++){const s=new n.Matrix4;this.getMatrixAt(o,s);const i=new n.Vector3;i.setFromMatrixPosition(s);const r=this.velocities[o];i.add(r),i.y<0&&(i.set((Math.random()-.5)*this.width,Math.random()*(this.height-1)+.5,(Math.random()-.5)*this.depth),r.set((Math.random()-.5)*.01,-.005,(Math.random()-.5)*.01)),s.setPosition(i),this.setMatrixAt(o,s)}this.instanceMatrix.needsUpdate=!0}}const g=(t,e)=>{const o=t[0].index!==null,s=new Set(Object.keys(t[0].attributes)),i=new Set(Object.keys(t[0].morphAttributes)),r={},a={},c=t[0].morphTargetsRelative,l=new n.BufferGeometry;let u=0;if(t.forEach((m,h)=>{let d=0;if(o!==(m.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let f in m.attributes){if(!s.has(f))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+f+'" attribute exists among all geometries, or in none of them.'),null;r[f]===void 0&&(r[f]=[]),r[f].push(m.attributes[f]),d++}if(d!==s.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(c!==m.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let f in m.morphAttributes){if(!i.has(f))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;a[f]===void 0&&(a[f]=[]),a[f].push(m.morphAttributes[f])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(m.userData),e){let f;if(m.index)f=m.index.count;else if(m.attributes.position!==void 0)f=m.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;l.addGroup(u,f,h),u+=f}}),o){let m=0;const h=[];t.forEach(d=>{const f=d.index;for(let p=0;p<f.count;++p)h.push(f.getX(p)+m);m+=d.attributes.position.count}),l.setIndex(h)}for(let m in r){const h=W(r[m]);if(!h)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+m+" attribute."),null;l.setAttribute(m,h)}for(let m in a){const h=a[m][0].length;if(h===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[m]=[];for(let d=0;d<h;++d){const f=[];for(let M=0;M<a[m].length;++M)f.push(a[m][M][d]);const p=W(f);if(!p)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+m+" morphAttribute."),null;l.morphAttributes[m].push(p)}}return l},W=t=>{let e,o,s,i=0;if(t.forEach(r=>{if(e===void 0&&(e=r.array.constructor),e!==r.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(o===void 0&&(o=r.itemSize),o!==r.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(s===void 0&&(s=r.normalized),s!==r.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;i+=r.array.length}),e&&o){const r=new e(i);let a=0;return t.forEach(c=>{r.set(c.array,a),a+=c.array.length}),new n.BufferAttribute(r,o,s)}};function co(t,e=1e-4){e=Math.max(e,Number.EPSILON);const o={},s=t.getIndex(),i=t.getAttribute("position"),r=s?s.count:i.count;let a=0;const c=Object.keys(t.attributes),l={},u={},m=[],h=["getX","getY","getZ","getW"];for(let M=0,y=c.length;M<y;M++){const x=c[M];l[x]=[];const w=t.morphAttributes[x];w&&(u[x]=new Array(w.length).fill(0).map(()=>[]))}const d=Math.log10(1/e),f=Math.pow(10,d);for(let M=0;M<r;M++){const y=s?s.getX(M):M;let x="";for(let w=0,A=c.length;w<A;w++){const S=c[w],G=t.getAttribute(S),b=G.itemSize;for(let T=0;T<b;T++)x+=`${~~(G[h[T]](y)*f)},`}if(x in o)m.push(o[x]);else{for(let w=0,A=c.length;w<A;w++){const S=c[w],G=t.getAttribute(S),b=t.morphAttributes[S],T=G.itemSize,B=l[S],q=u[S];for(let N=0;N<T;N++){const U=h[N];if(B.push(G[U](y)),b)for(let I=0,Ft=b.length;I<Ft;I++)q[I].push(b[I][U](y))}}o[x]=a,m.push(a),a++}}const p=t.clone();for(let M=0,y=c.length;M<y;M++){const x=c[M],w=t.getAttribute(x),A=new w.array.constructor(l[x]),S=new n.BufferAttribute(A,w.itemSize,w.normalized);if(p.setAttribute(x,S),x in u)for(let G=0;G<u[x].length;G++){const b=t.morphAttributes[x][G],T=new b.array.constructor(u[x][G]),B=new n.BufferAttribute(T,b.itemSize,b.normalized);p.morphAttributes[x][G]=B}}return p.setIndex(m),p}class lo extends n.BufferGeometry{constructor(e=(i,r,a)=>a.set(i,r,Math.cos(i)*Math.sin(r)),o=8,s=8){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:o,stacks:s};const i=[],r=[],a=[],c=[],l=1e-5,u=new n.Vector3,m=new n.Vector3,h=new n.Vector3,d=new n.Vector3,f=new n.Vector3,p=o+1;for(let M=0;M<=s;M++){const y=M/s;for(let x=0;x<=o;x++){const w=x/o;e(w,y,m),r.push(m.x,m.y,m.z),w-l>=0?(e(w-l,y,h),d.subVectors(m,h)):(e(w+l,y,h),d.subVectors(h,m)),y-l>=0?(e(w,y-l,h),f.subVectors(m,h)):(e(w,y+l,h),f.subVectors(h,m)),u.crossVectors(d,f).normalize(),a.push(u.x,u.y,u.z),c.push(w,y)}}for(let M=0;M<s;M++)for(let y=0;y<o;y++){const x=M*p+y,w=M*p+y+1,A=(M+1)*p+y+1,S=(M+1)*p+y;i.push(x,w,S),i.push(w,A,S)}this.setIndex(i),this.setAttribute("position",new n.Float32BufferAttribute(r,3)),this.setAttribute("normal",new n.Float32BufferAttribute(a,3)),this.setAttribute("uv",new n.Float32BufferAttribute(c,2))}}class Y extends n.BufferGeometry{constructor(e=1,o=1.5,s=.5,i=.05,r=.05){super();const a=e,c=o,l=s,u=i,m=r,h=[0,0,0,a,0,0,a,c,0,0,c,0,a,0,-l,0,0,-l,0,c,-l,a,c,-l,0,0,-l,0,0,0,0,c,0,0,c,-l,a,0,-u,u,0,-u,u,c,-u,a,c,-u,u,0,-l+u,a,0,-l+u,a,c,-l+u,u,c,-l+u,u,0,-u,u,0,-l+u,u,c,-l+u,u,c,-u,0,c,0,a,c,0,a,c,-u,u,c,-u,0,c,-l,u,c,-l+u,a,c,-l+u,a,c,-l,0,c,0,u,c,-u,u,c,-l+u,0,c,-l,0,0,0,u,0,-u,a,0,-u,a,0,0,0,0,-l,a,0,-l,a,0,-l+u,u,0,-l+u,0,0,0,0,0,-l,u,0,-l+u,u,0,-u,a,0,0,a,0,-u,a,c,-u,a,c,0,a,0,-l,a,c,-l,a,c,-l+u,a,0,-l+u],d=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0],f=e/(e*2+s),p=(e+s)/(e*2+s),M=[p,0,1,0,1,1,p,1,0,0,f,0,f,1,0,1,f,0,p,0,p,1,f,1,1,0,p,0,p,1,1,1,f,0,0,0,0,1,f,1,p,0,f,0,f,1,p,1,p,0,1,0,1,1,p,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1],y=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23,24,25,26,24,26,27,28,29,30,28,30,31,32,33,34,32,34,35,36,37,38,36,38,39,40,41,42,40,42,43,44,45,46,44,46,47,48,49,50,48,50,51,52,53,54,52,54,55],x=new Float32Array(h),w=new Float32Array(d),A=new Float32Array(M),S=new Uint16Array(y),G=new n.BufferGeometry;G.setAttribute("position",new n.BufferAttribute(x,3)),G.setAttribute("normal",new n.BufferAttribute(w,3)),G.setAttribute("uv",new n.BufferAttribute(A,2)),G.setIndex(new n.BufferAttribute(S,1));const b=new n.BoxGeometry(e-u-m,c-m*2,l-u*2);b.translate((e-u-m)/2+u,c/2,-l/2),this.copy(g([G,b],!0))}}function _e({scaleXMin:t=.4,scaleXMax:e=.7,scaleYMin:o=.3,scaleYMax:s=.95,scaleZMin:i=.1,scaleZMax:r=.5}={}){return new n.Vector3(k(t,e),J(.25,o,s),$(.8,i,r))}function X({coverMaterial:t,pagesMaterial:e,scales:o}){const s=new Y,i=new n.InstancedMesh(s,[t,e],o.length),r=new n.Matrix4;let a=0;for(let c=0;c<o.length;c++){const l=o[c],u=new n.Matrix4;u.makeScale(l.x,l.y,l.z),r.identity(),r.multiply(u),r.setPosition(.01+Math.random()*.1,0,a+l.z*.5),i.setMatrixAt(c,r),a+=l.z*.5}return i}function uo({coverMaterial:t,pagesMaterial:e,count:o=10,scaleXMin:s=.4,scaleXMax:i=.7,scaleYMin:r=.3,scaleYMax:a=.95,scaleZMin:c=.1,scaleZMax:l=.5}){const u=Array.from({length:o},()=>_e({scaleXMin:s,scaleXMax:i,scaleYMin:r,scaleYMax:a,scaleZMin:c,scaleZMax:l}));return X({coverMaterial:t,pagesMaterial:e,scales:u})}function mo({coverMaterial:t,pagesMaterial:e,length:o=10,scaleXMin:s=.4,scaleXMax:i=.7,scaleYMin:r=.3,scaleYMax:a=.95,scaleZMin:c=.1,scaleZMax:l=.5}){const u=[];let m=o;for(;m>0;){const h=_e({scaleXMin:s,scaleXMax:i,scaleYMin:r,scaleYMax:a,scaleZMin:c,scaleZMax:l});h.z=Math.min(h.z,m),u.push(h),m-=h.z}return X({coverMaterial:t,pagesMaterial:e,scales:u})}function ho(t){const{width:e,depth:o,height:s,radius:i,gap:r,material:a}=t,c=a||new n.MeshStandardMaterial({color:9127187}),l=i*3/2+r,u=Math.sqrt(3)*i+r,m=Math.floor(e/l),h=Math.floor(o/u),d=m*h,f=new n.Shape;for(let w=0;w<6;w++){const A=Math.PI/3*w,S=Math.cos(A)*i,G=Math.sin(A)*i;w===0?f.moveTo(S,G):f.lineTo(S,G)}f.closePath();const p=new n.ExtrudeGeometry(f,{depth:s,bevelEnabled:!1});p.rotateX(-Math.PI/2);const M=new n.InstancedMesh(p,c,d),y=new n.Object3D;let x=0;for(let w=0;w<m;w++)for(let A=0;A<h;A++){const S=w*l,G=A*u+w%2*(u/2),b=S-m*l/2+l/2,T=G-h*u/2+u/2;y.position.set(b,0,T),y.updateMatrix(),M.setMatrixAt(x++,y.matrix)}return M.instanceMatrix.needsUpdate=!0,M}class fo extends n.BufferGeometry{constructor(e=2,o=.3,s=.6,i=5,r=5,a=Math.PI/4){super();const c=[],l=[];for(let f=0;f<i;f++){const p=f*o,M=p+o,y=f*s,x=y+s;c.push(-e/2,p,y,e/2,p,y,e/2,M,y,-e/2,M,y,-e/2,M,y,e/2,M,y,e/2,M,x,-e/2,M,x);const w=f*8;l.push(w,w+1,w+2,w,w+2,w+3),l.push(w+4,w+5,w+6,w+4,w+6,w+7)}const u=i*o,m=i*s,h=e*2;c.push(-h/2,u,m,h/2,u,m,h/2,u,m+s,-h/2,u,m+s);const d=i*8;l.push(d,d+1,d+2,d,d+2,d+3);for(let f=0;f<2;f++){const p=f===0?1:-1;for(let M=0;M<r;M++){const y=u+M*o,x=y+o,w=p*(h/4),A=m+s,S=M*s*Math.cos(a),G=M*s*Math.sin(a),b=w+p*S-e/2*Math.cos(a),T=w+p*S+e/2*Math.cos(a),B=A+G,q=b+p*s*Math.cos(a),N=T+p*s*Math.cos(a),U=B+s*Math.sin(a);c.push(b,y,B,T,y,B,T,x,B,b,x,B,b,x,B,T,x,B,N,x,U,q,x,U);const I=d+4+f*r*8+M*8;l.push(I,I+1,I+2,I,I+2,I+3),l.push(I+4,I+5,I+6,I+4,I+6,I+7)}}this.setIndex(l),this.setAttribute("position",new n.Float32BufferAttribute(c,3)),this.computeVertexNormals()}}class Le extends n.BufferGeometry{constructor({width:e=5,height:o=3,depth:s=5,wallThickness:i=.05}={}){super();const r=e,a=o,c=s,l=i,u=[0,0,0,r,0,0,r,a,0,0,a,0,0,0,c,0,0,0,0,a,0,0,a,c,0,0,c,r,0,c,r,0,0,0,0,0,-l,-l,c,r,-l,c,r,0,c,0,0,c,r,-l,c,r,-l,-l,r,0,0,r,0,c,-l,-l,c,0,0,c,0,a,c,-l,a,c,r,0,0,r,-l,-l,r,a,-l,r,a,0,-l,a,c,0,a,c,0,a,0,-l,a,-l,0,a,0,r,a,0,r,a,-l,-l,a,-l,-l,-l,-l,r,-l,-l,r,-l,c,-l,-l,c,-l,-l,-l,-l,-l,c,-l,a,c,-l,a,-l,r,-l,-l,-l,-l,-l,-l,a,-l,r,a,-l],m=[0,1,3,1,2,3,4,5,7,5,6,7,8,9,11,9,10,11,12,13,15,13,14,15,16,17,19,17,18,19,20,21,23,21,22,23,24,25,27,25,26,27,28,29,31,29,30,31,32,33,35,33,34,35,36,37,39,37,38,39,40,41,43,41,42,43,44,45,47,45,46,47],h=[0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1],d=[.5,0,1,0,1,1,.5,1,0,0,.5,0,.5,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,l/r,0,l/r,0,0,1,0,1,l/r,0,l/r,0,0,l/r,0,l/r,1,0,1,1-l/r,0,1,0,1,1,1-l/r,1,0,0,l/r,0,l/r,1,0,1,0,1-l/r,1,1-l/r,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1],f=new Float32Array(u),p=new Float32Array(h),M=new Float32Array(d);this.setAttribute("position",new n.BufferAttribute(f,3)),this.setAttribute("normal",new n.BufferAttribute(p,3)),this.setAttribute("uv",new n.BufferAttribute(M,2)),this.setIndex(m),this.addGroup(0,12,0),this.addGroup(12,6,1),this.addGroup(18,54,2)}}class po extends n.BufferGeometry{constructor(e=2,o=.3,s=.5,i=5,r=2){super();const a=[],c=[];for(let h=0;h<i;h++){const d=h*o,f=d+o,p=h*s,M=p+s;a.push(-e/2,d,p,e/2,d,p,e/2,f,p,-e/2,f,p,-e/2,f,p,e/2,f,p,e/2,f,M,-e/2,f,M);const y=h*8;c.push(y,y+1,y+2,y,y+2,y+3),c.push(y+4,y+5,y+6,y+4,y+6,y+7)}const l=i*o,u=i*s;a.push(-e/2,l,u,e/2,l,u,e/2,l,u+r,-e/2,l,u+r);const m=i*8;c.push(m,m+1,m+2,m,m+2,m+3);for(let h=0;h<i;h++){const d=l+h*o,f=d+o,p=-e/2-h*s,M=p-s;a.push(p,d,u+r,p,d,u+r-e,p,f,u+r-e,p,f,u+r,p,f,u+r,p,f,u+r-e,M,f,u+r-e,M,f,u+r);const y=m+4+h*8;c.push(y,y+1,y+2,y,y+2,y+3),c.push(y+4,y+5,y+6,y+4,y+6,y+7)}this.setIndex(c),this.setAttribute("position",new n.Float32BufferAttribute(a,3)),this.computeVertexNormals()}}class Mo extends n.BufferGeometry{constructor(e=1,o=.4,s=.2,i=20,r=2,a=Math.PI/8){super();const c=[],l=[];let u=0;for(let m=0;m<i;m++){const h=r*Math.cos(u),d=r*Math.sin(u),f=m*s,p=f+s;c.push(h-e/2*Math.cos(u),f,d-e/2*Math.sin(u),h+e/2*Math.cos(u),f,d+e/2*Math.sin(u),h+e/2*Math.cos(u),p,d+e/2*Math.sin(u),h-e/2*Math.cos(u),p,d-e/2*Math.sin(u)),c.push(h-e/2*Math.cos(u),p,d-e/2*Math.sin(u),h+e/2*Math.cos(u),p,d+e/2*Math.sin(u),h+e/2*Math.cos(u)-o*Math.sin(u),p,d+e/2*Math.sin(u)+o*Math.cos(u),h-e/2*Math.cos(u)-o*Math.sin(u),p,d-e/2*Math.sin(u)+o*Math.cos(u));const M=m*8;l.push(M,M+1,M+2,M,M+2,M+3),l.push(M+4,M+5,M+6,M+4,M+6,M+7),u+=a}this.setIndex(l),this.setAttribute("position",new n.Float32BufferAttribute(c,3)),this.computeVertexNormals()}}class yo extends n.BufferGeometry{constructor(e=2,o=.3,s=.5,i=10){super();const r=[],a=[];for(let c=0;c<i;c++){const l=c*o,u=l+o,m=c*s,h=m+s;r.push(-e/2,l,m,e/2,l,m,e/2,u,m,-e/2,u,m,-e/2,u,m,e/2,u,m,e/2,u,h,-e/2,u,h);const d=c*8;a.push(d,d+1,d+2,d,d+2,d+3),a.push(d+4,d+6,d+5,d+4,d+7,d+6)}this.setIndex(a),this.setAttribute("position",new n.Float32BufferAttribute(r,3)),this.computeVertexNormals()}}class ze extends n.BufferGeometry{constructor(){super();const e=[new n.Vector2(0,0),new n.Vector2(1.2,0),new n.Vector2(1.5,1.5),new n.Vector2(1,3),new n.Vector2(.6,3.5),new n.Vector2(.5,3.5)],o=new n.LatheGeometry(e,10),s=new n.CylinderGeometry(.6,.5,.3,10);s.translate(0,3.5,0),this.copy(g([o,s],!0))}}function Z(t,e,o,s,i){const r=(s-e)/(o-t);return t+(i-e)/r}function ke(t,e,o,s,i){const r=(s-e)/(o-t);return e+r*(i-t)}const wo={calculateXFromSlopeIntercept:Z,calculateYFromSlopeIntercept:ke};class De extends n.BufferGeometry{constructor(){super();const e=[new n.Vector2(0,0),new n.Vector2(.8,0),new n.Vector2(1,1.5),new n.Vector2(.5,2.2),new n.Vector2(.6,2.5),new n.Vector2(.5,2.5)],o=new n.LatheGeometry(e,10),s=new n.CylinderGeometry(.55,.45,.2,10);s.translate(0,2.5,0);const i=[new n.Vector2(0,0),new n.Vector2(.8,0),new n.Vector2(Z(.8,0,1,1.5,1),1),new n.Vector2(0,1)],r=new n.LatheGeometry(i,10);r.translate(0,.1,0),r.scale(.9,.9,.9),this.copy(g([o,s,r],!0))}}class qe extends n.BufferGeometry{constructor({radius:e=.5,neckRadius:o=.2,height:s=3,neckHeight:i=1,segments:r=16}={}){super();const a=s-i,c=new n.CylinderGeometry(e,e,a,r);c.translate(0,a/2,0);const l=.3,u=new n.CylinderGeometry(o,e,l,r);u.translate(0,a+l/2,0);const m=new n.CylinderGeometry(o,o,i,r);m.translate(0,a+l+i/2,0),this.copy(g([c,u,m],!1))}}class He extends n.BufferGeometry{constructor(e=.4,o=1.2,s=.2){super();const i=o*.6,r=new n.BoxGeometry(e/2,i,s);r.translate(0,i/2,0);const a=e*1.5,c=new n.BoxGeometry(a,e/4,s);c.translate(0,i*.75,0),this.copy(g([r,c],!1)),this.computeVertexNormals()}}class Ye extends n.BufferGeometry{constructor(){super();const e=new n.BoxGeometry(5,1,5);e.translate(0,.5,0);const o=new n.BoxGeometry(4,3,4);o.translate(0,2.5,0);const s=[[-1.8,2.3,-2.2],[1.8,2.3,-2.2],[-1.8,2.3,2.2],[1.8,2.3,2.2]],i=[];s.forEach(u=>{const m=new n.CylinderGeometry(.2,.2,3.5,16);m.translate(u[0],u[1],u[2]),i.push(m)});const r=new n.ConeGeometry(3.5,2,4);r.rotateY(Math.PI/4),r.translate(0,5,0);const a=new n.Shape;a.moveTo(-1,0),a.lineTo(-1,2),a.absarc(0,2,1,Math.PI,0,!0),a.lineTo(1,0);const c={depth:.5,bevelEnabled:!1},l=new n.ExtrudeGeometry(a,c);l.translate(0,.5,1.7),l.setIndex([...Array(l.attributes.position.count).keys()]),this.copy(g([e,g([o,...i],!1),r,l],!0)),this.computeVertexNormals()}}class Xe extends n.BufferGeometry{constructor(e=1.75,o=.75){super();const s=e*.05,i=e*.15,r=e*.15,a=e*.75;let c=0;const l=new n.BoxGeometry(o,s,o);l.translate(0,c+s/2,0),c+=s;const u=new n.BoxGeometry(o*.8,i,o*.8);u.translate(0,c+i/2,0),c+=i;const m=new n.BoxGeometry(o*.6,r,o*.6);m.translate(0,c+r/2,0),c+=r;const h=new n.BoxGeometry(o*.4,a,o*.4);h.translate(0,c+a/2,0),c+=a;const d=new n.ConeGeometry(o*.4/Math.sqrt(2),.1,4,1,!1,Math.PI/4);d.translate(0,c+.1/2,0),this.copy(g([l,u,m,h,d],!1)),this.computeVertexNormals()}}class Ze extends n.BufferGeometry{constructor(e=.6,o=1,s=.2,i=.6){super();const r=o-i/2,a=new n.BoxGeometry(e,r,s);a.translate(0,r/2,0);const c=new n.CylinderGeometry(i/2,i/2,s,16,1,!1,0,Math.PI);c.rotateY(Math.PI/2),c.rotateX(Math.PI/2),c.translate(0,r,0),this.copy(g([a,c],!1)),this.computeVertexNormals()}}class je extends n.BufferGeometry{constructor(e=.5,o=.8,s=.15){super();const i=new n.BoxGeometry(e,o,s);i.translate(0,o/2,0),this.copy(i)}}class Qe extends n.BufferGeometry{constructor({height:e=2.25}={}){super();const o=new n.BoxGeometry(1.2,.5,1.2);o.translate(0,.25,0);const s=new n.BoxGeometry(1,e,1);s.translate(0,.5+e/2,0);const i=new n.BoxGeometry(1.4,.3,1.4);i.translate(0,.5+e+.15,0),this.copy(g([o,s,i],!1))}}class j extends n.BufferGeometry{constructor({barHeight:e=2,barRadius:o=.05,spikeHeight:s=.3,spikeRadius:i=.075,spikeScaleZ:r=1,radialSegments:a=8}={}){super();const c=new n.CylinderGeometry(o,o,e,a);c.translate(0,e/2,0);const l=new n.ConeGeometry(i,s,a);l.translate(0,e+s/2,0),l.scale(1,1,r),this.copy(g([c,l],!1))}}class Ke extends n.BufferGeometry{constructor({count:e=20,spacing:o=.4,barHeight:s=2,barRadius:i=.05,spikeHeight:r=.3,spikeRadius:a=.075,spikeScaleZ:c=1,railHeight:l=.1,railDepth:u=.05,railOffset:m=0,radialSegments:h=8}={}){super();const d=[],f=new j({barHeight:s,barRadius:i,spikeHeight:r,spikeRadius:a,spikeScaleZ:c,radialSegments:h}),p=new n.BoxGeometry(e*o,l,u);for(let x=0;x<e;x++){const w=f.clone();w.translate(x*o,0,0),d.push(w)}const M=p.clone();M.translate(o*(e-1)/2,s-m-l/2,0),d.push(M);const y=p.clone();y.translate(o*(e-1)/2,l/2,0),d.push(y),this.copy(g(d))}}class We extends n.BufferGeometry{constructor({width:e=5,height:o=8,depth:s=1,shelves:i=4,frameThickness:r=.1,open:a=!1}={}){super();const c=o,l=e,u=s,m=new n.BoxGeometry(r,c,u),h=new n.BoxGeometry(l-2*r,r,u),d=m.clone();d.translate(-l/2+r/2,c/2,0);const f=m.clone();f.translate(l/2-r/2,c/2,0);const p=h.clone();p.translate(0,c-r/2,0);const M=h.clone();M.translate(0,r/2,0);const y=new n.BoxGeometry(l,c,r);y.translate(0,c/2,-u/2+r/2);const x=[],w=(c-r)/(i+1);for(let A=1;A<=i;A++){const S=h.clone();S.translate(0,r/2+A*w,0),x.push(S)}this.copy(g([d,f,p,M,...a?[]:[y],...x],!1))}}class Je extends n.BufferGeometry{constructor(){super();const e=new n.BoxGeometry(5,.3,3);e.translate(0,3.15,0);const o=[new n.Vector2(.2,0),new n.Vector2(.25,.5),new n.Vector2(.15,1.5),new n.Vector2(.3,3)],s=new n.LatheGeometry(o,32),r=g([[2.1,0,1.1],[-2.1,0,1.1],[2.1,0,-1.1],[-2.1,0,-1.1]].map(a=>{const c=s.clone();return c.translate(a[0],a[1],a[2]),c}));this.copy(g([e,r],!0))}}class Q extends lo{constructor({height:e=.25,radius:o=.05,segmentsU:s=16,segmentsV:i=16}={}){super((r,a,c)=>{const l=r*Math.PI*2,u=Math.sin(a*Math.PI),m=o*u*Math.cos(l),h=a*e,d=o*u*Math.sin(l);c.set(m,h,-d)},s,i)}}class $e extends n.BufferGeometry{constructor({radiusTop:e=.2,radiusBottom:o=.2,height:s=1,flameHeight:i=.25,flameRadius:r=.05,segments:a=16}={}){super();const c=new n.CylinderGeometry(e,o,s,a);c.translate(0,s/2,0);const l=new Q({segmentsU:a,segmentsV:a,height:i,radius:r});l.translate(0,s,0),this.copy(g([c,l],!0))}}class xo extends n.BufferGeometry{constructor(e=1,o=2,s=.5,i=Math.PI/4){super();const r=o*Math.tan(i),a=e,c=o,l=s,u=[0,0,0,a,0,0,a+r,c,0,r,c,0,a,0,-l,0,0,-l,r,c,-l,a+r,c,-l,0,0,-l,0,0,0,r,c,0,r,c,-l,a,0,0,a,0,-l,a+r,c,-l,a+r,c,0,r,c,0,a+r,c,0,a+r,c,-l,r,c,-l,0,0,-l,a,0,-l,a,0,0,0,0,0],m=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0],h=[0,1,2,2,3,0,4,5,6,6,7,4,8,9,10,10,11,8,12,13,14,14,15,12,16,17,18,18,19,16,20,21,22,22,23,20],d=new Float32Array([0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1]),f=new Float32Array(u),p=new Float32Array(m),M=new Float32Array(d),y=new Uint16Array(h);this.setAttribute("position",new n.BufferAttribute(f,3)),this.setAttribute("normal",new n.BufferAttribute(p,3)),this.setAttribute("uv",new n.BufferAttribute(M,2)),this.setIndex(new n.BufferAttribute(y,1)),this.center()}}class et extends n.BufferGeometry{constructor(){super();const e=[],o=[];for(let s=0;s<5;s++){const i=.8+Math.random()*.4,r=.8+Math.random()*.4,a=.8+Math.random()*.4,c=Math.random()*Math.PI,l=Math.random()*Math.PI,u=Math.random()*Math.PI,m=(Math.random()-.5)*4,h=0,d=(Math.random()-.5)*4,f=new n.DodecahedronGeometry(1,0);f.scale(i,r,a),f.rotateX(c),f.rotateY(l),f.rotateZ(u),f.translate(m,h,d),e.push(f);const p=new n.DodecahedronGeometry(1,0);p.scale(i*.9,r*.5,a*.9),p.rotateX(c),p.rotateY(l),p.rotateZ(u),p.translate(m,h+.3,d),o.push(p)}this.copy(g([g(e),g(o)],!0))}}function tt(t,e=D.XYZ,o=.5,s=2){t.deleteAttribute("uv"),t.deleteAttribute("normal"),t=co(t),t.computeVertexNormals();const i=t.getAttribute("position");for(let r=0;r<i.count;r++){const a=new n.Vector3().fromBufferAttribute(i,r),c=Math.random()*(s-o)+o,l=e.clone().multiplyScalar(c);a.add(l),i.setXYZ(r,a.x,a.y,a.z)}return i.needsUpdate=!0,t.computeVertexNormals(),t}class ot extends n.BufferGeometry{constructor(e=1,o=4,s=4){super();const i=new n.SphereGeometry(e,o,s);this.copy(tt(i,D.XYZ,.5,1)),this.computeVertexNormals(),this.center()}}class nt extends n.BufferGeometry{constructor(){super();const e=[];for(let o=0;o<5;o++){const s=new n.DodecahedronGeometry(1,0);s.scale(.8+Math.random()*.4,.8+Math.random()*.4,.8+Math.random()*.4),s.rotateX(Math.random()*Math.PI),s.rotateY(Math.random()*Math.PI),s.rotateZ(Math.random()*Math.PI),s.translate((Math.random()-.5)*4,0,(Math.random()-.5)*4),e.push(s)}this.copy(g(e))}}class rt extends n.BufferGeometry{constructor(e=.1,o=.1,s=.4,i=8){super();const r=new n.CylinderGeometry(e*.6,o*.6,s,i);r.translate(0,0,0);const a=new n.SphereGeometry(e,i,i),c=a.clone(),l=a.clone(),u=a.clone(),m=a.clone();c.translate(0,s/2+e*.6,-e*.6),l.translate(0,s/2+e*.6,e*.6),u.translate(0,-s/2-o*.6,-o*.6),m.translate(0,-s/2-o*.6,o*.6),this.copy(g([r,c,l,u,m],!1))}}class st extends n.BufferGeometry{constructor({flaskRadius:e=1,neckRadius:o=.3,height:s=2.5,neckHeight:i=1,radialSegments:r=16}={}){super();const a=[new n.Vector2(0,0),new n.Vector2(e*.875,0),new n.Vector2(e,.1),new n.Vector2(o,s),new n.Vector2(o,s+i),new n.Vector2(o*1.1,s+i+.3)],c=new n.LatheGeometry(a,r);this.copy(g([c],!1))}}const vo=(t,e)=>t/(1-Math.cos(e)),K=(t,e)=>t/(2*Math.sin(e)),at=(t,e)=>t*(1-Math.cos(e)),go=(t,e)=>2*t*Math.sin(e),H=(t,e)=>{const o=2*e;return Math.asin(o/(2*t))},So=(t,e,o)=>({x:t*Math.sin(o)*Math.cos(e),y:t*Math.sin(o)*Math.sin(e),z:t*Math.cos(o)}),Go=(t,e,o)=>{const s=Math.sqrt(t*t+e*e+o*o),i=Math.atan2(e,t),r=Math.acos(o/s);return{radius:s,theta:i,phi:r}};function it(t,e,o,s=0,i=0,r=32){const a=s?H(t,s):0,c=i?Math.PI-H(t,i):Math.PI,l=[];for(let u=0;u<=r;u++){const m=c-(c-a)/r*u,h=t*Math.sin(m),d=e*Math.cos(m)+o;l.push(new n.Vector2(h,d))}return[...l]}class ct extends n.BufferGeometry{constructor(){super();const e=[...it(1,1,.5,.2,0,32),new n.Vector2(.2,3)],o=new n.LatheGeometry(e,32);this.copy(o)}}class lt extends n.BufferGeometry{constructor(){super();const e=[new n.Vector2(1,0),new n.Vector2(1.2,.5),new n.Vector2(1.4,1.5),new n.Vector2(1.3,1.8),new n.Vector2(.8,1.8)],o=new n.LatheGeometry(e,12),s=new n.CircleGeometry(1,12);s.rotateX(-Math.PI/2),s.translate(0,0,0),this.copy(g([o,s],!1))}}class ut extends n.BufferGeometry{constructor({radius:e=.3,height:o=.4,count:s=3,thickness:i=.03,radialSegments:r=16}={}){super();const a=new n.TorusGeometry(e,i,8,r);a.rotateX(Math.PI/2),a.translate(0,o,0);const c=new n.CylinderGeometry(i*.6,i*.6,o,r),l=[];for(let u=0;u<s;u++){const m=u/s*Math.PI*2,h=c.clone();h.translate(Math.cos(m)*e,o/2,Math.sin(m)*e),l.push(h)}this.copy(g([a,...l],!1))}}class mt extends n.BufferGeometry{constructor(){super();const e=new n.CylinderGeometry(.5,.6,.3,16);e.translate(0,.15,0);const o=new n.CylinderGeometry(.15,.15,2,12,1,!0);o.translate(0,1.3,0);const s=new n.SphereGeometry(.3,16,16);s.translate(0,2.4,0),this.copy(g([e,g([o,s])],!0))}}class z extends n.BufferGeometry{constructor(e=.2,o=.2,s=3,i=32,r=!0){super();const a=new n.CylinderGeometry(e,o,s,i,1,r),c=new n.SphereGeometry(o,i,i/2,0,Math.PI*2,Math.PI/2,Math.PI/2);c.translate(0,-(s/2),0),this.copy(g([a,c],!1))}}class ht extends n.BufferGeometry{constructor({radius:e=3,height:o=.6,widthSegments:s=64,heightSegments:i=16,phiStart:r=0,phiLength:a=Math.PI*2}={}){super(),this.copy(new n.SphereGeometry(e,s,i,r,a,0,Math.PI/2)),this.scale(1,o/e,1)}}class dt extends n.BufferGeometry{constructor({radius:e=K(5,Math.PI/10),widthSegments:o=64,heightSegments:s=32,phiStart:i=0,phiLength:r=Math.PI*2,thetaLength:a=Math.PI/10}={}){super(),this.copy(new n.SphereGeometry(e,o,s,i,r,0,a));const c=at(e,a);this.translate(0,-e+c,0)}}class ft extends n.BufferGeometry{constructor({trunkRadiusTop:e=.25,trunkRadiusBottom:o=.4,trunkHeight:s=2.5,trunkSegments:i=14,leafSize:r=.8,leafCount:a=6,leafDetail:c=0,leafSpreadRadius:l=1.5}={}){super();const u=new n.CylinderGeometry(e,o,s,i);u.translate(0,s/2,0);const m=[];for(let h=0;h<a;h++){const d=new n.DodecahedronGeometry(r,c);d.translate((Math.random()-.5)*l,(Math.random()-.5)*r+s,(Math.random()-.5)*l),m.push(d)}this.copy(g([u.toNonIndexed(),g(m,!1)],!0)),this.computeVertexNormals()}}class Ao extends n.Mesh{constructor({width:e=5,height:o=3,depth:s=5,wallThickness:i=.05,interiorColor:r=C.WHITE_SMOKE,floorColor:a=C.RAW_SIENNA,exteriorColor:c=C.GRAY}={}){super(new Le({width:e,height:o,depth:s,wallThickness:i}),[new n.MeshStandardMaterial({color:r}),new n.MeshStandardMaterial({color:a}),new n.MeshStandardMaterial({color:c})])}}const pt={uniforms:{time:{value:0}},vertexShader:`
|
|
2
2
|
varying vec3 vNormal;
|
|
3
3
|
varying vec3 vPosition;
|
|
4
4
|
void main() {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
color *= 0.8 + 0.2 * n; // Modulate color by noise
|
|
36
36
|
gl_FragColor = vec4(color, 1.0);
|
|
37
37
|
}
|
|
38
|
-
`};class Ao extends n.Mesh{constructor(){super(new n.SphereGeometry(5,32,32),new n.ShaderMaterial(pt))}}class bo extends n.Mesh{constructor({width:e=1,height:o=1.5,depth:s=.5,coverThickness:i=.05,pageIndent:r=.05,coverColor:a=C.DARK_RED,pageColor:c=C.TITANIUM_WHITE}={}){super(new Y(e,o,s,i,r),[new n.MeshStandardMaterial({color:a,metalness:.1,roughness:.7,flatShading:!0}),new n.MeshStandardMaterial({color:c,flatShading:!0})])}}class Eo extends n.Mesh{constructor(){super(new ze,[new n.MeshStandardMaterial({color:8965290,transparent:!0,depthWrite:!1,opacity:.4,roughness:.1,metalness:.5}),new n.MeshStandardMaterial({color:9127187,roughness:1})])}}class Io extends n.Mesh{constructor(){super(new De,[new n.MeshStandardMaterial({color:8965375,transparent:!0,depthWrite:!1,opacity:.5,roughness:.1,metalness:.3}),new n.MeshStandardMaterial({color:9127187,roughness:1}),new n.MeshStandardMaterial({color:C.PINK_SHERBET,transparent:!0,depthWrite:!1,opacity:.5})])}}class Bo extends n.Mesh{constructor(){super(new qe,new n.MeshPhysicalMaterial({color:5597999,roughness:.1,transmission:.9,thickness:.2,metalness:0,clearcoat:1,clearcoatRoughness:.1}))}}class To extends n.Mesh{constructor({width:e=.4,height:o=1.2,depth:s=.2}={}){super(new He(e,o,s),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class Po extends n.Mesh{constructor(){super(new Ye,[new n.MeshStandardMaterial({color:8421504,flatShading:!0}),new n.MeshStandardMaterial({color:6908265,flatShading:!0}),new n.MeshStandardMaterial({color:5263440,flatShading:!0}),new n.MeshStandardMaterial({color:4210752,flatShading:!0})])}}class Co extends n.Mesh{constructor({totalHeight:e=1.75,baseWidth:o=.75}={}){super(new Xe(e,o),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class Vo extends n.Mesh{constructor(e=.6,o=1,s=.2,i=.6){super(new Ze(e,o,s,i),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class Ro extends n.Mesh{constructor(e=.5,o=.8,s=.15){super(new je(e,o,s),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class Oo extends n.Mesh{constructor({height:e=2.25}={}){super(new Qe({height:e}),new n.MeshStandardMaterial({color:9141627,flatShading:!0}))}}class No extends n.Mesh{constructor({barHeight:e=2,barRadius:o=.05,spikeHeight:s=.3,spikeRadius:i=.075,spikeScaleZ:r=1,radialSegments:a=8}={}){super(new j({barHeight:e,barRadius:o,spikeHeight:s,spikeRadius:i,spikeScaleZ:r,radialSegments:a}),new n.MeshStandardMaterial({color:3355443,metalness:.8,roughness:.4}))}}class Uo extends n.Mesh{constructor({count:e=20,spacing:o=.4,barHeight:s=2,barRadius:i=.05,spikeHeight:r=.3,spikeRadius:a=.075,spikeScaleZ:c=1,railHeight:l=.1,railDepth:u=.05,railOffset:m=0,radialSegments:h=8}={}){super(new Ke({count:e,spacing:o,barHeight:s,barRadius:i,spikeHeight:r,spikeRadius:a,spikeScaleZ:c,railHeight:l,railDepth:u,railOffset:m,radialSegments:h}),new n.MeshStandardMaterial({color:3355443,metalness:.8,roughness:.4}))}}class Fo extends n.Mesh{constructor({width:e=5,height:o=8,depth:s=1,shelves:i=4,frameThickness:r=.1,open:a=!1}={}){super(new We({width:e,height:o,depth:s,shelves:i,frameThickness:r,open:a}),new n.MeshStandardMaterial({color:9127187}))}}class _o extends n.Mesh{constructor(){super(new Je,[new n.MeshStandardMaterial({color:9132587}),new n.MeshStandardMaterial({color:4929057})])}}class Lo extends n.Mesh{constructor({radiusTop:e=.2,radiusBottom:o=.2,height:s=1,flameHeight:i=.25,flameRadius:r=.05,segments:a=16}={}){super(new $e({radiusTop:e,radiusBottom:o,height:s,flameHeight:i,flameRadius:r,segments:a}),[new n.MeshStandardMaterial({color:16777215}),new n.MeshStandardMaterial({color:16766720,emissive:16753920,emissiveIntensity:.35})])}}class zo extends n.Mesh{constructor({height:e=.25,radius:o=.05,segmentsU:s=16,segmentsV:i=16}={}){super(new Q({segmentsU:s,segmentsV:i,height:e,radius:o}),new n.MeshStandardMaterial({color:16766720,emissive:16753920,emissiveIntensity:.35}))}}class ko extends n.Group{constructor(e=1.3,o=.5){super();const s=new n.CylinderGeometry(o,o,.2,16),i=new n.MeshStandardMaterial({color:9127187,flatShading:!0}),r=new n.Mesh(s,i);r.position.set(0,0,0),this.add(r);const a=new n.CylinderGeometry(o*.9,o*.9,e),c=new n.MeshStandardMaterial({color:16766720,flatShading:!0,transparent:!0,opacity:.6}),l=new n.Mesh(a,c);l.position.set(0,e/2+.1,0),this.add(l);const u=new n.ConeGeometry(o*1.1,.5,8),m=new n.MeshStandardMaterial({color:9127187,flatShading:!0}),h=new n.Mesh(u,m);h.position.set(0,e+.35,0),this.add(h);const d=new n.TorusGeometry(o*.8,.05,8,16),f=new n.MeshStandardMaterial({color:9127187,flatShading:!0}),p=new n.Mesh(d,f);p.position.set(0,e+.85,0),this.add(p);const M=new n.PointLight(16755200,1.5,15);M.position.set(0,e/2+.1,0),M.castShadow=!0,this.add(M)}}class Do extends n.Mesh{constructor(){super(new et,[new n.MeshStandardMaterial({color:8421504,flatShading:!0}),new n.MeshStandardMaterial({color:4950843,flatShading:!0,opacity:.8,transparent:!0})])}}class qo extends n.Mesh{constructor(e=1,o=4,s=4){super(new ot(e,o,s),new n.MeshStandardMaterial({color:8421504,flatShading:!0}))}}class Ho extends n.Mesh{constructor(){super(new nt,new n.MeshStandardMaterial({color:8421504,flatShading:!0}))}}class Yo extends n.Group{constructor(){super();const e=new n.CylinderGeometry(.3,.4,.1,16),o=new n.MeshStandardMaterial({color:3355443,roughness:.6,metalness:.3}),s=new n.Mesh(e,o);s.position.y=.05;const i=new n.CylinderGeometry(.1,.1,.7,16),r=new n.MeshStandardMaterial({color:5592405,roughness:.5,metalness:.4}),a=new n.Mesh(i,r);a.position.y=.4;const c=new n.ConeGeometry(.075,.2,16),l=new n.MeshStandardMaterial({color:16733440,emissive:16733440,emissiveIntensity:.6,transparent:!0,opacity:.8}),u=new n.Mesh(c,l);u.position.y=.8,this.add(s,a,u)}}class Xo extends n.Group{constructor(){super();const e=new n.BoxGeometry(3,4,.1),o=new n.MeshStandardMaterial({color:3026478,roughness:.8,metalness:.6}),s=new n.BoxGeometry(.2,.5,.2),i=new n.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7}),r=new n.CylinderGeometry(.3,.3,.1,16),a=new n.MeshStandardMaterial({color:5592405,roughness:.7,metalness:.5}),c=new n.Mesh(e,o);for(let y=-1;y<=1;y++){const x=new n.Mesh(s,i);x.position.set(y,1.5,.1),c.add(x)}const l=new n.Mesh(r,a);l.rotation.x=Math.PI/2,l.position.set(0,.5,.15),c.add(l);const u=new n.SphereGeometry(.15,8,8),m=new n.MeshStandardMaterial({color:16711680,emissive:16711680,emissiveIntensity:.5}),h=new n.Mesh(u,m);h.position.set(0,-1,.1),c.add(h),this.add(c);let d=.015,f=.8,p=.2;function M(){requestAnimationFrame(M);const y=p+Math.abs(Math.sin(Date.now()*d))*(f-p);h.material.emissiveIntensity=y}M()}}class Zo extends n.Mesh{constructor({flaskRadius:e=1,neckRadius:o=.3,height:s=2.5,neckHeight:i=1,radialSegments:r=16}={}){super(new st({flaskRadius:e,neckRadius:o,height:s,neckHeight:i,radialSegments:r}),new n.MeshPhysicalMaterial({color:8965375,transparent:!0,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,side:n.DoubleSide}))}}class jo extends n.Mesh{constructor(){super(new ct,new n.MeshPhysicalMaterial({color:8965375,transparent:!0,depthWrite:!1,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,side:n.DoubleSide}))}}class Qo extends n.Group{constructor(){super();const e=new n.BoxGeometry(2,3,.1),o=new n.MeshStandardMaterial({color:3355443,roughness:.8,metalness:.5}),s=new n.Mesh(e,o),i=new n.CylinderGeometry(.1,.1,.2,8),r=new n.CylinderGeometry(.05,.05,1,8),a=new n.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7});for(let c=-.5;c<=.5;c+=.5){const l=new n.Mesh(i,a);l.position.set(c,1,.1);const u=new n.Mesh(r,a);u.position.y=.5,l.add(u),this.add(l)}this.add(s)}}class Ko extends n.Group{constructor(){super();const e=new n.BoxGeometry(1,.2,.5),o=new n.MeshStandardMaterial({color:4473924,roughness:.6,metalness:.3}),s=new n.Mesh(e,o);s.position.y=.1;const i=new n.BoxGeometry(.2,1,.2),r=new n.Mesh(i,o);r.position.set(0,.6,-.2);const a=new n.CylinderGeometry(.1,.1,.4,8),c=new n.MeshStandardMaterial({color:3355443,roughness:.5,metalness:.6}),l=new n.Mesh(a,c);l.position.set(0,1.1,-.35),l.rotation.x=-Math.PI/4;const u=new n.BoxGeometry(.6,.1,.6),m=new n.MeshStandardMaterial({color:5592405,roughness:.8,metalness:.2}),h=new n.Mesh(u,m);h.position.set(0,.6,0),this.add(s,r,l,h)}}class Wo extends n.Group{constructor(){super();const e=new lt,o=new n.CylinderGeometry(.2,.3,1.5,8);o.translate(0,.75,0);const s=new n.MeshStandardMaterial({color:6045747,roughness:1,metalness:0,side:n.DoubleSide}),i=new n.MeshStandardMaterial({color:9132587,roughness:.8,metalness:.1}),r=new n.Mesh(e,s);r.castShadow=!0;const a=new n.Mesh(o,i);a.castShadow=!0,a.position.set(.3,1.3,0),a.rotation.z=Math.PI/4,this.add(r,a)}}class Jo extends n.Mesh{constructor({width:o=3,height:s=4,depth:i=.1}={}){super();v(this,"geometry");v(this,"material");this.geometry=new n.BoxGeometry(o,s,i),this.material=new n.MeshStandardMaterial({color:3026478,roughness:.8,metalness:.6})}}class $o extends n.Mesh{constructor({radius:o=.15,color:s=16762823,emissive:i=16711680,emissiveIntensity:r=.5}={}){super();v(this,"geometry");v(this,"material");this.geometry=new n.SphereGeometry(o,8,8),this.material=new n.MeshStandardMaterial({color:s,emissive:i,emissiveIntensity:r})}}class en extends n.Group{constructor(){super();const e=100,o=.05,s=new n.CatmullRomCurve3(Array.from({length:e},(u,m)=>{const h=m*.2;return new n.Vector3(Math.cos(h)*.4,m*o,Math.sin(h)*.4)})),i=new n.TubeGeometry(s,200,.1,8,!1),r=new n.MeshStandardMaterial({color:8965375,transparent:!0,opacity:.3,roughness:.1,metalness:.2,emissive:8965375}),a=new n.Mesh(i,r);this.add(a);function c(){r.emissiveIntensity=.2+Math.sin(Date.now()*.005)*.1}function l(){requestAnimationFrame(l),c()}l()}}class tn extends n.Mesh{constructor({radius:e=.3,height:o=.4,count:s=3,thickness:i=.03,radialSegments:r=16}={}){super(new ut({radius:e,height:o,count:s,thickness:i,radialSegments:r}),new n.MeshStandardMaterial({color:8947848,roughness:.7,metalness:.3}))}}class on extends n.Mesh{constructor(){super(new mt,[new n.MeshStandardMaterial({color:3355443,roughness:.6,metalness:.5}),new n.MeshStandardMaterial({color:16737792,roughness:.5,metalness:.8,side:n.DoubleSide})])}}class nn extends n.Mesh{constructor(e=.2,o=.2,s=3,i=32){super(new z(e,o,s,i),new n.MeshPhysicalMaterial({color:8965375,transparent:!0,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,depthWrite:!1,side:n.DoubleSide}))}}class rn extends n.Group{constructor(e=3,o=[65450,16711850,11141375]){super();const s=new n.BoxGeometry(3,.2,1),i=new n.MeshStandardMaterial({color:9127187,roughness:.7,metalness:.3}),r=new n.Mesh(s,i);r.position.y=.5,r.castShadow=!0;const a=new z(.1,.1,1,16),c=new n.MeshStandardMaterial({color:11184810,transparent:!0,opacity:.4,roughness:.1,metalness:.5,depthWrite:!1,side:n.DoubleSide});for(let l=0;l<e;l++){const u=new n.Mesh(a,c),m=(l-(e-1)/2)*.8;u.position.set(m,1,0),u.castShadow=!0;const h=new z(.099,.099,.5,16,!1),d=o[l%o.length],f=new n.MeshStandardMaterial({color:d,emissive:d,emissiveIntensity:.5,transparent:!0,opacity:.6}),p=new n.Mesh(h,f);p.position.set(0,-.25,0),u.add(p),r.add(u)}this.add(r)}}class Mt extends n.Shape{constructor(e=5,o=.5,s=1){super();const i=Math.PI*2/e,r=i/2,a=i/4;this.moveTo(Math.cos(0)*s,-Math.sin(0)*s);for(let c=1;c<=e;++c){let l=Math.cos(i*c-a*3)*(o/Math.cos(a)),u=-Math.sin(i*c-a*3)*(o/Math.cos(a)),m=Math.cos(i*c-r)*o,h=-Math.sin(i*c-r)*o;this.quadraticCurveTo(l,u,m,h),l=Math.cos(i*c-a)*(o/Math.cos(a)),u=-Math.sin(i*c-a)*(o/Math.cos(a)),m=Math.cos(i*c)*s,h=-Math.sin(i*c)*s,this.quadraticCurveTo(l,u,m,h)}this.closePath()}}class sn extends n.Mesh{constructor(e=5,o=.5,s=1,i=.25){super();const r=new Mt(e,o,s),a=new n.ExtrudeGeometry(r,{depth:i,bevelEnabled:i>0,bevelThickness:0,bevelSize:0}),c=new n.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});a.center(),this.geometry=a,this.material=c}}class yt extends n.Shape{constructor(e=5,o=.5,s=1,i=5,r=.25){super();const a=Math.PI*2/e,c=a/4;this.moveTo(Math.cos(0)*s,-Math.sin(0)*s);for(let l=1;l<=e;++l)this.lineTo(Math.cos(a*l-c*3)*o,-Math.sin(a*l-c*3)*o),this.lineTo(Math.cos(a*l-c*2)*o,-Math.sin(a*l-c*2)*o),this.lineTo(Math.cos(a*l-c)*s,-Math.sin(a*l-c)*s),this.lineTo(Math.cos(a*l)*s,-Math.sin(a*l)*s);if(this.closePath(),r>0&&i>2){const l=new n.Path,u=Math.PI*2/i;l.moveTo(Math.cos(0)*r,-Math.sin(0)*r);for(let m=1;m<i;++m)l.lineTo(Math.cos(u*m)*r,-Math.sin(u*m)*r);l.lineTo(Math.cos(0)*r,-Math.sin(0)*r),this.holes.push(l)}}}class an extends n.Mesh{constructor(e=5,o=.5,s=1,i=5,r=.25,a=.25){super();const c=new yt(e,o,s,i,r),l=new n.ExtrudeGeometry(c,{depth:a,bevelEnabled:a>0,bevelThickness:0,bevelSize:0}),u=new n.MeshStandardMaterial({color:11184810,metalness:.8,roughness:.2});l.center(),this.geometry=l,this.material=u}}class wt extends n.Shape{constructor(e=1,o=2.1,s=1.4,i=1.6){super(),this.moveTo(0,s*e/3),this.bezierCurveTo(-o*.375*e,s*e,-o*e,s*e/3,0,-i*e),this.bezierCurveTo(o*e,s*e/3,o*.375*e,s*e,0,s*e/3)}}class cn extends n.Mesh{constructor(e=1,o=1,s=1,i=10,r=.25){super();const a=new wt(e,o,s,i),c=new n.ExtrudeGeometry(a,{depth:r,bevelEnabled:r>0,bevelThickness:0,bevelSize:0}),l=new n.MeshStandardMaterial({color:12986408,emissive:12981270,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});c.center(),this.geometry=c,this.material=l}}class xt extends n.Shape{constructor(e=5,o=.5,s=1){super();const i=Math.PI*2/e,r=i/2;this.moveTo(Math.cos(0)*s,Math.sin(0)*s);for(let a=1;a<=e;++a)this.lineTo(Math.cos(i*a-r)*o,Math.sin(i*a-r)*o),this.lineTo(Math.cos(i*a)*s,Math.sin(i*a)*s);this.closePath()}}class ln extends n.Mesh{constructor(e=5,o=.5,s=1,i=.25){super();const r=new xt(e,o,s),a=new n.ExtrudeGeometry(r,{depth:i,bevelEnabled:i>0,bevelThickness:0,bevelSize:0}),c=new n.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});a.center(),this.geometry=a,this.material=c}}class un extends n.Mesh{constructor(){super(new rt,new n.MeshStandardMaterial({color:16777215}))}}class mn extends n.Mesh{constructor({trunkRadiusTop:e=.25,trunkRadiusBottom:o=.4,trunkHeight:s=2.5,trunkSegments:i=14,trunkColor:r=9127187,leafSize:a=.8,leafCount:c=6,leafDetail:l=0,leafSpreadRadius:u=1.5,leafColor:m=2263842}={}){super(new ft({trunkRadiusTop:e,trunkRadiusBottom:o,trunkHeight:s,trunkSegments:i,leafSize:a,leafCount:c,leafDetail:l,leafSpreadRadius:u}),[new n.MeshStandardMaterial({color:r,roughness:.9,metalness:0,flatShading:!0}),new n.MeshStandardMaterial({color:m,roughness:.8,metalness:0,flatShading:!0})])}}class hn extends n.Mesh{constructor({radius:e=3,height:o=.6,widthSegments:s=64,heightSegments:i=16,phiStart:r=0,phiLength:a=Math.PI*2}={}){super(new ht({radius:e,height:o,widthSegments:s,heightSegments:i,phiStart:r,phiLength:a}),new n.MeshStandardMaterial({color:65280,flatShading:!0}))}}class dn extends n.Mesh{constructor({radius:e=K(5,Math.PI/10),widthSegments:o=64,heightSegments:s=32,phiStart:i=0,phiLength:r=Math.PI*2,thetaLength:a=Math.PI/10}={}){super(new dt({radius:e,widthSegments:o,heightSegments:s,phiStart:i,phiLength:r,thetaLength:a}),new n.MeshStandardMaterial({color:65280,flatShading:!0}))}}function fn(t,{time:e=0,waveFrequency:o=.2,waveAmplitude:s=.5}={}){t.onBeforeCompile=i=>{i.uniforms.time={value:e},i.uniforms.waveFrequency={value:o},i.uniforms.waveAmplitude={value:s},i.vertexShader=`
|
|
38
|
+
`};class bo extends n.Mesh{constructor(){super(new n.SphereGeometry(5,32,32),new n.ShaderMaterial(pt))}}class Io extends n.Mesh{constructor({width:e=1,height:o=1.5,depth:s=.5,coverThickness:i=.05,pageIndent:r=.05,coverColor:a=C.DARK_RED,pageColor:c=C.TITANIUM_WHITE}={}){super(new Y(e,o,s,i,r),[new n.MeshStandardMaterial({color:a,metalness:.1,roughness:.7,flatShading:!0}),new n.MeshStandardMaterial({color:c,flatShading:!0})])}}class Eo extends n.Mesh{constructor(){super(new ze,[new n.MeshStandardMaterial({color:8965290,transparent:!0,depthWrite:!1,opacity:.4,roughness:.1,metalness:.5}),new n.MeshStandardMaterial({color:9127187,roughness:1})])}}class To extends n.Mesh{constructor(){super(new De,[new n.MeshStandardMaterial({color:8965375,transparent:!0,depthWrite:!1,opacity:.5,roughness:.1,metalness:.3}),new n.MeshStandardMaterial({color:9127187,roughness:1}),new n.MeshStandardMaterial({color:C.PINK_SHERBET,transparent:!0,depthWrite:!1,opacity:.5})])}}class Bo extends n.Mesh{constructor(){super(new qe,new n.MeshPhysicalMaterial({color:5597999,roughness:.1,transmission:.9,thickness:.2,metalness:0,clearcoat:1,clearcoatRoughness:.1}))}}class Po extends n.Mesh{constructor({width:e=.4,height:o=1.2,depth:s=.2}={}){super(new He(e,o,s),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class Co extends n.Mesh{constructor(){super(new Ye,[new n.MeshStandardMaterial({color:8421504,flatShading:!0}),new n.MeshStandardMaterial({color:6908265,flatShading:!0}),new n.MeshStandardMaterial({color:5263440,flatShading:!0}),new n.MeshStandardMaterial({color:4210752,flatShading:!0})])}}class Vo extends n.Mesh{constructor({totalHeight:e=1.75,baseWidth:o=.75}={}){super(new Xe(e,o),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class Ro extends n.Mesh{constructor(e=.6,o=1,s=.2,i=.6){super(new Ze(e,o,s,i),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class Oo extends n.Mesh{constructor(e=.5,o=.8,s=.15){super(new je(e,o,s),new n.MeshStandardMaterial({color:7829367,roughness:.8}))}}class No extends n.Mesh{constructor({height:e=2.25}={}){super(new Qe({height:e}),new n.MeshStandardMaterial({color:9141627,flatShading:!0}))}}class Uo extends n.Mesh{constructor({barHeight:e=2,barRadius:o=.05,spikeHeight:s=.3,spikeRadius:i=.075,spikeScaleZ:r=1,radialSegments:a=8}={}){super(new j({barHeight:e,barRadius:o,spikeHeight:s,spikeRadius:i,spikeScaleZ:r,radialSegments:a}),new n.MeshStandardMaterial({color:3355443,metalness:.8,roughness:.4}))}}class Fo extends n.Mesh{constructor({count:e=20,spacing:o=.4,barHeight:s=2,barRadius:i=.05,spikeHeight:r=.3,spikeRadius:a=.075,spikeScaleZ:c=1,railHeight:l=.1,railDepth:u=.05,railOffset:m=0,radialSegments:h=8}={}){super(new Ke({count:e,spacing:o,barHeight:s,barRadius:i,spikeHeight:r,spikeRadius:a,spikeScaleZ:c,railHeight:l,railDepth:u,railOffset:m,radialSegments:h}),new n.MeshStandardMaterial({color:3355443,metalness:.8,roughness:.4}))}}class _o extends n.Mesh{constructor({width:e=5,height:o=8,depth:s=1,shelves:i=4,frameThickness:r=.1,open:a=!1}={}){super(new We({width:e,height:o,depth:s,shelves:i,frameThickness:r,open:a}),new n.MeshStandardMaterial({color:9127187}))}}class Lo extends n.Mesh{constructor(){super(new Je,[new n.MeshStandardMaterial({color:9132587}),new n.MeshStandardMaterial({color:4929057})])}}class zo extends n.Mesh{constructor({radiusTop:e=.2,radiusBottom:o=.2,height:s=1,flameHeight:i=.25,flameRadius:r=.05,segments:a=16}={}){super(new $e({radiusTop:e,radiusBottom:o,height:s,flameHeight:i,flameRadius:r,segments:a}),[new n.MeshStandardMaterial({color:16777215}),new n.MeshStandardMaterial({color:16766720,emissive:16753920,emissiveIntensity:.35})])}}class ko extends n.Mesh{constructor({height:e=.25,radius:o=.05,segmentsU:s=16,segmentsV:i=16}={}){super(new Q({segmentsU:s,segmentsV:i,height:e,radius:o}),new n.MeshStandardMaterial({color:16766720,emissive:16753920,emissiveIntensity:.35}))}}class Do extends n.Group{constructor(e=1.3,o=.5){super();const s=new n.CylinderGeometry(o,o,.2,16),i=new n.MeshStandardMaterial({color:9127187,flatShading:!0}),r=new n.Mesh(s,i);r.position.set(0,0,0),this.add(r);const a=new n.CylinderGeometry(o*.9,o*.9,e),c=new n.MeshStandardMaterial({color:16766720,flatShading:!0,transparent:!0,opacity:.6}),l=new n.Mesh(a,c);l.position.set(0,e/2+.1,0),this.add(l);const u=new n.ConeGeometry(o*1.1,.5,8),m=new n.MeshStandardMaterial({color:9127187,flatShading:!0}),h=new n.Mesh(u,m);h.position.set(0,e+.35,0),this.add(h);const d=new n.TorusGeometry(o*.8,.05,8,16),f=new n.MeshStandardMaterial({color:9127187,flatShading:!0}),p=new n.Mesh(d,f);p.position.set(0,e+.85,0),this.add(p);const M=new n.PointLight(16755200,1.5,15);M.position.set(0,e/2+.1,0),M.castShadow=!0,this.add(M)}}class qo extends n.Mesh{constructor(){super(new et,[new n.MeshStandardMaterial({color:8421504,flatShading:!0}),new n.MeshStandardMaterial({color:4950843,flatShading:!0,opacity:.8,transparent:!0})])}}class Ho extends n.Mesh{constructor(e=1,o=4,s=4){super(new ot(e,o,s),new n.MeshStandardMaterial({color:8421504,flatShading:!0}))}}class Yo extends n.Mesh{constructor(){super(new nt,new n.MeshStandardMaterial({color:8421504,flatShading:!0}))}}class Xo extends n.Group{constructor(){super();const e=new n.CylinderGeometry(.3,.4,.1,16),o=new n.MeshStandardMaterial({color:3355443,roughness:.6,metalness:.3}),s=new n.Mesh(e,o);s.position.y=.05;const i=new n.CylinderGeometry(.1,.1,.7,16),r=new n.MeshStandardMaterial({color:5592405,roughness:.5,metalness:.4}),a=new n.Mesh(i,r);a.position.y=.4;const c=new n.ConeGeometry(.075,.2,16),l=new n.MeshStandardMaterial({color:16733440,emissive:16733440,emissiveIntensity:.6,transparent:!0,opacity:.8}),u=new n.Mesh(c,l);u.position.y=.8,this.add(s,a,u)}}class Zo extends n.Group{constructor(){super();const e=new n.BoxGeometry(3,4,.1),o=new n.MeshStandardMaterial({color:3026478,roughness:.8,metalness:.6}),s=new n.BoxGeometry(.2,.5,.2),i=new n.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7}),r=new n.CylinderGeometry(.3,.3,.1,16),a=new n.MeshStandardMaterial({color:5592405,roughness:.7,metalness:.5}),c=new n.Mesh(e,o);for(let y=-1;y<=1;y++){const x=new n.Mesh(s,i);x.position.set(y,1.5,.1),c.add(x)}const l=new n.Mesh(r,a);l.rotation.x=Math.PI/2,l.position.set(0,.5,.15),c.add(l);const u=new n.SphereGeometry(.15,8,8),m=new n.MeshStandardMaterial({color:16711680,emissive:16711680,emissiveIntensity:.5}),h=new n.Mesh(u,m);h.position.set(0,-1,.1),c.add(h),this.add(c);let d=.015,f=.8,p=.2;function M(){requestAnimationFrame(M);const y=p+Math.abs(Math.sin(Date.now()*d))*(f-p);h.material.emissiveIntensity=y}M()}}class jo extends n.Mesh{constructor({flaskRadius:e=1,neckRadius:o=.3,height:s=2.5,neckHeight:i=1,radialSegments:r=16}={}){super(new st({flaskRadius:e,neckRadius:o,height:s,neckHeight:i,radialSegments:r}),new n.MeshPhysicalMaterial({color:8965375,transparent:!0,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,side:n.DoubleSide}))}}class Qo extends n.Mesh{constructor(){super(new ct,new n.MeshPhysicalMaterial({color:8965375,transparent:!0,depthWrite:!1,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,side:n.DoubleSide}))}}class Ko extends n.Group{constructor(){super();const e=new n.BoxGeometry(2,3,.1),o=new n.MeshStandardMaterial({color:3355443,roughness:.8,metalness:.5}),s=new n.Mesh(e,o),i=new n.CylinderGeometry(.1,.1,.2,8),r=new n.CylinderGeometry(.05,.05,1,8),a=new n.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7});for(let c=-.5;c<=.5;c+=.5){const l=new n.Mesh(i,a);l.position.set(c,1,.1);const u=new n.Mesh(r,a);u.position.y=.5,l.add(u),this.add(l)}this.add(s)}}class Wo extends n.Group{constructor(){super();const e=new n.BoxGeometry(1,.2,.5),o=new n.MeshStandardMaterial({color:4473924,roughness:.6,metalness:.3}),s=new n.Mesh(e,o);s.position.y=.1;const i=new n.BoxGeometry(.2,1,.2),r=new n.Mesh(i,o);r.position.set(0,.6,-.2);const a=new n.CylinderGeometry(.1,.1,.4,8),c=new n.MeshStandardMaterial({color:3355443,roughness:.5,metalness:.6}),l=new n.Mesh(a,c);l.position.set(0,1.1,-.35),l.rotation.x=-Math.PI/4;const u=new n.BoxGeometry(.6,.1,.6),m=new n.MeshStandardMaterial({color:5592405,roughness:.8,metalness:.2}),h=new n.Mesh(u,m);h.position.set(0,.6,0),this.add(s,r,l,h)}}class Jo extends n.Group{constructor(){super();const e=new lt,o=new n.CylinderGeometry(.2,.3,1.5,8);o.translate(0,.75,0);const s=new n.MeshStandardMaterial({color:6045747,roughness:1,metalness:0,side:n.DoubleSide}),i=new n.MeshStandardMaterial({color:9132587,roughness:.8,metalness:.1}),r=new n.Mesh(e,s);r.castShadow=!0;const a=new n.Mesh(o,i);a.castShadow=!0,a.position.set(.3,1.3,0),a.rotation.z=Math.PI/4,this.add(r,a)}}class $o extends n.Mesh{constructor({width:o=3,height:s=4,depth:i=.1}={}){super();v(this,"geometry");v(this,"material");this.geometry=new n.BoxGeometry(o,s,i),this.material=new n.MeshStandardMaterial({color:3026478,roughness:.8,metalness:.6})}}class en extends n.Mesh{constructor({radius:o=.15,color:s=16762823,emissive:i=16711680,emissiveIntensity:r=.5}={}){super();v(this,"geometry");v(this,"material");this.geometry=new n.SphereGeometry(o,8,8),this.material=new n.MeshStandardMaterial({color:s,emissive:i,emissiveIntensity:r})}}class tn extends n.Group{constructor(){super();const e=100,o=.05,s=new n.CatmullRomCurve3(Array.from({length:e},(u,m)=>{const h=m*.2;return new n.Vector3(Math.cos(h)*.4,m*o,Math.sin(h)*.4)})),i=new n.TubeGeometry(s,200,.1,8,!1),r=new n.MeshStandardMaterial({color:8965375,transparent:!0,opacity:.3,roughness:.1,metalness:.2,emissive:8965375}),a=new n.Mesh(i,r);this.add(a);function c(){r.emissiveIntensity=.2+Math.sin(Date.now()*.005)*.1}function l(){requestAnimationFrame(l),c()}l()}}class on extends n.Mesh{constructor({radius:e=.3,height:o=.4,count:s=3,thickness:i=.03,radialSegments:r=16}={}){super(new ut({radius:e,height:o,count:s,thickness:i,radialSegments:r}),new n.MeshStandardMaterial({color:8947848,roughness:.7,metalness:.3}))}}class nn extends n.Mesh{constructor(){super(new mt,[new n.MeshStandardMaterial({color:3355443,roughness:.6,metalness:.5}),new n.MeshStandardMaterial({color:16737792,roughness:.5,metalness:.8,side:n.DoubleSide})])}}class rn extends n.Mesh{constructor(e=.2,o=.2,s=3,i=32){super(new z(e,o,s,i),new n.MeshPhysicalMaterial({color:8965375,transparent:!0,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,depthWrite:!1,side:n.DoubleSide}))}}class sn extends n.Group{constructor(e=3,o=[65450,16711850,11141375]){super();const s=new n.BoxGeometry(3,.2,1),i=new n.MeshStandardMaterial({color:9127187,roughness:.7,metalness:.3}),r=new n.Mesh(s,i);r.position.y=.5,r.castShadow=!0;const a=new z(.1,.1,1,16),c=new n.MeshStandardMaterial({color:11184810,transparent:!0,opacity:.4,roughness:.1,metalness:.5,depthWrite:!1,side:n.DoubleSide});for(let l=0;l<e;l++){const u=new n.Mesh(a,c),m=(l-(e-1)/2)*.8;u.position.set(m,1,0),u.castShadow=!0;const h=new z(.099,.099,.5,16,!1),d=o[l%o.length],f=new n.MeshStandardMaterial({color:d,emissive:d,emissiveIntensity:.5,transparent:!0,opacity:.6}),p=new n.Mesh(h,f);p.position.set(0,-.25,0),u.add(p),r.add(u)}this.add(r)}}class Mt extends n.Shape{constructor(e=5,o=.5,s=1){super();const i=Math.PI*2/e,r=i/2,a=i/4;this.moveTo(Math.cos(0)*s,-Math.sin(0)*s);for(let c=1;c<=e;++c){let l=Math.cos(i*c-a*3)*(o/Math.cos(a)),u=-Math.sin(i*c-a*3)*(o/Math.cos(a)),m=Math.cos(i*c-r)*o,h=-Math.sin(i*c-r)*o;this.quadraticCurveTo(l,u,m,h),l=Math.cos(i*c-a)*(o/Math.cos(a)),u=-Math.sin(i*c-a)*(o/Math.cos(a)),m=Math.cos(i*c)*s,h=-Math.sin(i*c)*s,this.quadraticCurveTo(l,u,m,h)}this.closePath()}}class an extends n.Mesh{constructor(e=5,o=.5,s=1,i=.25){super();const r=new Mt(e,o,s),a=new n.ExtrudeGeometry(r,{depth:i,bevelEnabled:i>0,bevelThickness:0,bevelSize:0}),c=new n.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});a.center(),this.geometry=a,this.material=c}}class yt extends n.Shape{constructor(e=5,o=.5,s=1,i=5,r=.25){super();const a=Math.PI*2/e,c=a/4;this.moveTo(Math.cos(0)*s,-Math.sin(0)*s);for(let l=1;l<=e;++l)this.lineTo(Math.cos(a*l-c*3)*o,-Math.sin(a*l-c*3)*o),this.lineTo(Math.cos(a*l-c*2)*o,-Math.sin(a*l-c*2)*o),this.lineTo(Math.cos(a*l-c)*s,-Math.sin(a*l-c)*s),this.lineTo(Math.cos(a*l)*s,-Math.sin(a*l)*s);if(this.closePath(),r>0&&i>2){const l=new n.Path,u=Math.PI*2/i;l.moveTo(Math.cos(0)*r,-Math.sin(0)*r);for(let m=1;m<i;++m)l.lineTo(Math.cos(u*m)*r,-Math.sin(u*m)*r);l.lineTo(Math.cos(0)*r,-Math.sin(0)*r),this.holes.push(l)}}}class cn extends n.Mesh{constructor(e=5,o=.5,s=1,i=5,r=.25,a=.25){super();const c=new yt(e,o,s,i,r),l=new n.ExtrudeGeometry(c,{depth:a,bevelEnabled:a>0,bevelThickness:0,bevelSize:0}),u=new n.MeshStandardMaterial({color:11184810,metalness:.8,roughness:.2});l.center(),this.geometry=l,this.material=u}}class wt extends n.Shape{constructor(e=1,o=2.1,s=1.4,i=1.6){super(),this.moveTo(0,s*e/3),this.bezierCurveTo(-o*.375*e,s*e,-o*e,s*e/3,0,-i*e),this.bezierCurveTo(o*e,s*e/3,o*.375*e,s*e,0,s*e/3)}}class ln extends n.Mesh{constructor(e=1,o=1,s=1,i=10,r=.25){super();const a=new wt(e,o,s,i),c=new n.ExtrudeGeometry(a,{depth:r,bevelEnabled:r>0,bevelThickness:0,bevelSize:0}),l=new n.MeshStandardMaterial({color:12986408,emissive:12981270,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});c.center(),this.geometry=c,this.material=l}}class xt extends n.Shape{constructor(e=5,o=.5,s=1){super();const i=Math.PI*2/e,r=i/2;this.moveTo(Math.cos(0)*s,Math.sin(0)*s);for(let a=1;a<=e;++a)this.lineTo(Math.cos(i*a-r)*o,Math.sin(i*a-r)*o),this.lineTo(Math.cos(i*a)*s,Math.sin(i*a)*s);this.closePath()}}class un extends n.Mesh{constructor(e=5,o=.5,s=1,i=.25){super();const r=new xt(e,o,s),a=new n.ExtrudeGeometry(r,{depth:i,bevelEnabled:i>0,bevelThickness:0,bevelSize:0}),c=new n.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});a.center(),this.geometry=a,this.material=c}}class mn extends n.Mesh{constructor(){super(new rt,new n.MeshStandardMaterial({color:16777215}))}}class hn extends n.Mesh{constructor({trunkRadiusTop:e=.25,trunkRadiusBottom:o=.4,trunkHeight:s=2.5,trunkSegments:i=14,trunkColor:r=9127187,leafSize:a=.8,leafCount:c=6,leafDetail:l=0,leafSpreadRadius:u=1.5,leafColor:m=2263842}={}){super(new ft({trunkRadiusTop:e,trunkRadiusBottom:o,trunkHeight:s,trunkSegments:i,leafSize:a,leafCount:c,leafDetail:l,leafSpreadRadius:u}),[new n.MeshStandardMaterial({color:r,roughness:.9,metalness:0,flatShading:!0}),new n.MeshStandardMaterial({color:m,roughness:.8,metalness:0,flatShading:!0})])}}class dn extends n.Mesh{constructor({radius:e=3,height:o=.6,widthSegments:s=64,heightSegments:i=16,phiStart:r=0,phiLength:a=Math.PI*2}={}){super(new ht({radius:e,height:o,widthSegments:s,heightSegments:i,phiStart:r,phiLength:a}),new n.MeshStandardMaterial({color:65280,flatShading:!0}))}}class fn extends n.Mesh{constructor({radius:e=K(5,Math.PI/10),widthSegments:o=64,heightSegments:s=32,phiStart:i=0,phiLength:r=Math.PI*2,thetaLength:a=Math.PI/10}={}){super(new dt({radius:e,widthSegments:o,heightSegments:s,phiStart:i,phiLength:r,thetaLength:a}),new n.MeshStandardMaterial({color:65280,flatShading:!0}))}}function pn(t,{time:e=0,waveFrequency:o=.2,waveAmplitude:s=.5}={}){t.onBeforeCompile=i=>{i.uniforms.time={value:e},i.uniforms.waveFrequency={value:o},i.uniforms.waveAmplitude={value:s},i.vertexShader=`
|
|
39
39
|
uniform float time;
|
|
40
40
|
uniform float waveFrequency;
|
|
41
41
|
uniform float waveAmplitude;
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}
|
|
52
52
|
`+i.vertexShader,i.vertexShader=i.vertexShader.replace("#include <begin_vertex>",`
|
|
53
53
|
vec3 transformed = waterDisplacement(position, normal);
|
|
54
|
-
`),t.userData.shader=i}}function
|
|
54
|
+
`),t.userData.shader=i}}function Mn(t,e){t.userData.shader&&(t.userData.shader.uniforms.time.value+=e)}function yn(t,{time:e=0,intensity:o=1,axis:s=D.XYZ,scale:i=10}={}){t.onBeforeCompile=r=>{r.uniforms.time={value:e},r.uniforms.axis={value:s},r.uniforms.intensity={value:o},r.uniforms.scale={value:i},r.vertexShader=`
|
|
55
55
|
uniform float time;
|
|
56
56
|
uniform vec3 axis;
|
|
57
57
|
uniform float intensity;
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
float n = noise(transformed * scale + time);
|
|
88
88
|
transformed += normalize(axis) * n * intensity;
|
|
89
89
|
vec3 transformedNormal = normal;
|
|
90
|
-
`),t.userData.shader=r}}function
|
|
90
|
+
`),t.userData.shader=r}}function wn(t,e){t.userData.shader&&(t.userData.shader.uniforms.time.value+=e)}const F={uniforms:{turbidity:{value:10},rayleigh:{value:2},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new n.Vector3().setFromSphericalCoords(1,n.MathUtils.degToRad(90),n.MathUtils.degToRad(180))},up:{value:new n.Vector3(0,1,0)}},vertexShader:`
|
|
91
91
|
uniform vec3 sunPosition;
|
|
92
92
|
uniform float rayleigh;
|
|
93
93
|
uniform float turbidity;
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
float y = normalize(vPosition).y * 0.5 + 0.5; // Normalizing y to range 0 to 1
|
|
253
253
|
gl_FragColor = vec4(mix(bottomColor, topColor, y), 1.0);
|
|
254
254
|
}
|
|
255
|
-
`},
|
|
255
|
+
`},xn={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:`
|
|
256
256
|
varying vec2 vUv;
|
|
257
257
|
void main() {
|
|
258
258
|
vUv = uv;
|
|
@@ -283,5 +283,5 @@
|
|
|
283
283
|
float h = normalize(vWorldPosition + offset).y;
|
|
284
284
|
gl_FragColor = vec4(mix(bottomColor, topColor, max(pow(max(h, 0.0), exponent), 0.0)), 1.0);
|
|
285
285
|
}
|
|
286
|
-
`};class xn extends n.Mesh{constructor(){super();v(this,"geometry");v(this,"material");this.geometry=new n.BoxGeometry(1,1,1),this.material=new n.ShaderMaterial({uniforms:F.uniforms,vertexShader:F.vertexShader,fragmentShader:F.fragmentShader,depthWrite:!1,side:n.BackSide}),this.scale.setScalar(45e4);const o=n.MathUtils.degToRad(89),s=n.MathUtils.degToRad(180),i=new n.Vector3().setFromSphericalCoords(1,o,s);this.material.uniforms.sunPosition.value=i}sunPosition(o,s){const i=new n.Vector3;i.setFromSphericalCoords(1,o,s),this.material.uniforms.sunPosition.value=i}}class vn extends n.Mesh{constructor(o=1e3){super();v(this,"geometry");v(this,"material");this.geometry=new n.BoxGeometry(o,o,o),this.material=new n.ShaderMaterial({uniforms:_.uniforms,vertexShader:_.vertexShader,fragmentShader:_.fragmentShader,side:n.BackSide})}}class gn extends n.Mesh{constructor(o=1e3){super();v(this,"geometry");v(this,"material");this.geometry=new n.SphereGeometry(o,32,15),this.material=new n.ShaderMaterial({vertexShader:L.vertexShader,fragmentShader:L.fragmentShader,uniforms:L.uniforms,side:n.BackSide})}}const Sn=t=>{const e=new Uint8Array(4*t*t);for(let s=0;s<t*t;s++){const i=s*4,r=(s%t^Math.floor(s/t))&1?255:0;e[i]=r,e[i+1]=r,e[i+2]=r,e[i+3]=255}const o=new n.DataTexture(e,t,t,n.RGBAFormat,n.UnsignedByteType);return o.wrapS=n.RepeatWrapping,o.wrapT=n.RepeatWrapping,o.minFilter=n.NearestFilter,o.needsUpdate=!0,o};function Gn(t,e){if(t.length===0)throw new Error("No objects provided for alignment.");const o=new n.Box3,s=new n.Vector3,i=t.map(a=>(o.setFromObject(a),a.getWorldPosition(s),{object:a,boundingBox:o.clone(),worldPosition:s.clone()})),r=i.reduce((a,{boundingBox:c})=>{switch(e){case E.LEFT:return Math.min(a,c.min.x);case E.RIGHT:return Math.max(a,c.max.x);case E.BOTTOM:return Math.min(a,c.min.y);case E.TOP:return Math.max(a,c.max.y);case E.BACK:return Math.min(a,c.min.z);case E.FRONT:return Math.max(a,c.max.z);default:throw new Error(`Unsupported side type: ${e}`)}},e===E.RIGHT||e===E.TOP||e===E.FRONT?-1/0:1/0);i.forEach(({object:a,boundingBox:c})=>{switch(e){case E.LEFT:a.position.x+=r-c.min.x;break;case E.RIGHT:a.position.x+=r-c.max.x;break;case E.BOTTOM:a.position.y+=r-c.min.y;break;case E.TOP:a.position.y+=r-c.max.y;break;case E.BACK:a.position.z+=r-c.min.z;break;case E.FRONT:a.position.z+=r-c.max.z;break}})}function An(t,e=R.RIGHT,o=0){const s=e.clone().normalize();let i=new n.Vector3;const r=new n.Box3;t.forEach(a=>{r.setFromObject(a);const l=new n.Vector3(r.max.x-r.min.x,r.max.y-r.min.y,r.max.z-r.min.z).dot(s),u=new n.Vector3;r.getCenter(u);const m=s.clone().multiplyScalar(l/2);a.position.copy(i.clone().add(m).sub(u).add(a.position)),i.add(s.clone().multiplyScalar(l+o))})}function bn(t,e,o=new n.Vector3(0,0,0)){const s=new n.Box3().setFromObject(t);if(s.isEmpty())console.warn("The object has no geometry or is not visible.");else{const i=s.min,r=new n.Vector3((i.x+s.max.x)/2,i.y,(i.z+s.max.z)/2),a=e.clone().sub(r).add(o);t.position.add(a)}}function En(t,e){const o=new n.Box3().setFromBufferAttribute(new n.Float32BufferAttribute(t.attributes.position.array,3));if(o.isEmpty())console.warn("The geometry is empty or invalid.");else{const s=o.min.y;t.translate(0,e-s,0)}}function In(t,e,o=new n.Vector3(0,0,0)){const s=new n.Box3().setFromObject(t);if(s.isEmpty())console.warn("The InstancedMesh has no geometry or is not visible.");else{const i=s.min.y,r=new n.Vector3(0,e.y-i,0).add(o);t.position.add(r)}}function Bn(t,e,o,s=new n.Vector3(0,0,0)){const i=new n.Box3().setFromObject(t);if(i.isEmpty())console.warn("The instanced mesh has invalid geometry.");else{const r=i.min.y,a=new n.Matrix4;t.getMatrixAt(o,a);const c=new n.Vector3,l=new n.Quaternion,u=new n.Vector3;a.decompose(c,l,u),c.y=e.y-r+s.y,a.compose(c,l,u),t.setMatrixAt(o,a),t.instanceMatrix.needsUpdate=!0}}function vt(t,e=new n.Vector3(0,0,0),o=new n.Vector3(0,0,0)){const i=new n.Box3().setFromObject(t).getCenter(new n.Vector3),r=new n.Vector3().addVectors(e,o),a=new n.Vector3().subVectors(r,i);t.position.add(a)}function gt(t,e=new n.Vector3(0,0,0),o=new n.Vector3(0,0,0)){const i=new n.Box3().setFromObject(t).getCenter(new n.Vector3),r=new n.Vector3().addVectors(e,o);t.translateX(r.x-i.x),t.translateY(r.y-i.y),t.translateZ(r.z-i.z),t.updateMatrixWorld(!0)}function St(t,e=new n.Vector3(0,0,0),o=new n.Vector3(0,0,0)){t.geometry.computeBoundingBox();const s=t.geometry.boundingBox;if(s){const i=s.getCenter(new n.Vector3),r=new n.Vector3().addVectors(e,o),a=new n.Vector3().subVectors(r,i);t.geometry.translate(a.x,a.y,a.z)}}const Tn={object:vt,objectGeometry:gt,meshGeometry:St};function Pn(t){const e=parseInt(t.slice(1),16);return[e>>16&255,e>>8&255,e&255]}function Cn(t){const[e,o,s]=V(t);return At(e,o,s)}function V(t){const e=t>>16&255,o=t>>8&255,s=t&255;return[e,o,s]}function Vn(t,e,o){e/=100,o/=100;function s(l,u,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?l+(u-l)*6*m:m<1/2?u:m<2/3?l+(u-l)*(2/3-m)*6:l}let i,r,a;if(e===0)i=r=a=o;else{const l=o<.5?o*(1+e):o+e-o*e,u=2*o-l;i=s(u,l,t/360+1/3),r=s(u,l,t/360),a=s(u,l,t/360-1/3)}const c=l=>Math.round(l*255);return[c(i),c(r),c(a)]}function Gt(t,e,o){e/=100,o/=100;const s=a=>(a+t/30)%12,i=e*Math.min(o,1-o),r=a=>o-i*Math.max(-1,Math.min(s(a)-3,Math.min(9-s(a),1)));return[r(0)*255,r(8)*255,r(4)*255]}function Rn(t,e,o){return[t/255,e/255,o/255]}function On(t,e,o){return t=Math.round(t),e=Math.round(e),o=Math.round(o),(t<<16)+(e<<8)+o}function At(t,e,o){t/=255,e/=255,o/=255;const s=Math.max(t,e,o),i=Math.min(t,e,o),r=s-i;let a=0,c=0;const l=(s+i)/2;r!==0&&(s===t?a=((e-o)/r+(e<o?6:0))*60:s===e?a=((o-t)/r+2)*60:s===o&&(a=((t-e)/r+4)*60)),r!==0&&(c=r/(1-Math.abs(2*l-1))),a=Math.round(a),c=Math.round(c*100);const u=Math.round(l*100);return[a,c,u]}function bt(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function Et(t,e){return Math.abs(t[0]-e[0])+Math.abs(t[1]-e[1])+Math.abs(t[2]-e[2])}function Nn(t,e){const o=V(t);let s=null,i=1/0;for(const r of e){const a=V(r),c=bt(o,a);c<i&&(i=c,s=r)}return s}function Un(t,e){const o=V(t);let s=null,i=1/0;for(const r of e){const a=V(r),c=Et(o,a);c<i&&(i=c,s=r)}return s}function Fn(t){const e=(t+Math.floor(-30+Math.random()*61))%360,o=Math.floor(60+Math.random()*21),s=Math.floor(50+Math.random()*21);return Gt(e,o,s)}function _n(t,e,o){return Math.max(0,Math.min(1,(t-e)/(o-e)))}function Ln(t,e,o,s,i,r=20,a=0,c=1){const l=[];for(let u=0;u<=r;u++){const m=u/r,h=t(_n(m,a,c)),d=e+h*(o-e),f=s+m*(i-s);l.push(new n.Vector2(d,f))}return l}const It=(t,e,o,s,i=24)=>{let r=[];for(let a=0;a<=i;a++){const c=a/i,l=P.CUBIC(c,t.x,e.x,o.x,s.x),u=P.CUBIC(c,t.y,e.y,o.y,s.y);r.push(new n.Vector2(l,u))}return r},Bt=(t,e,o,s=24)=>{let i=[];for(let r=0;r<=s;r++){const a=r/s,c=P.DAMPED(a,o)*(e.x-t.x)+t.x,l=t.y+a*(e.y-t.y);i.push(new n.Vector2(c,l))}return i},Tt=(t,e,o,s,i=24)=>{let r=[];for(let a=0;a<=i;a++){const c=a/i,l=P.EXPONENTIAL(c,o,s)*(e.x-t.x)+t.x,u=t.y+c*(e.y-t.y);r.push(new n.Vector2(l,u))}return r},Pt=(t,e,o,s,i=24)=>{let r=[];for(let a=0;a<=i;a++){const c=a/i,l=P.LOGARITHMIC(c,o,s)*(e.x-t.x)+t.x,u=t.y+c*(e.y-t.y);r.push(new n.Vector2(l,u))}return r},Ct=(t,e,o,s,i,r=24)=>{let a=[];for(let c=0;c<=r;c++){const l=c/r,u=o*l*l+s*l+i+t.x,m=t.y+l*(e.y-t.y);a.push(new n.Vector2(u,m))}return a},Vt=(t,e,o,s=24)=>{let i=[];for(let r=0;r<=s;r++){const a=r/s,c=P.QUADRATIC(a,t.x,e.x,o.x),l=P.QUADRATIC(a,t.y,e.y,o.y);i.push(new n.Vector2(c,l))}return i},Rt=(t,e,o,s=24)=>{let i=[];for(let r=0;r<=s;r++){const a=r/s,c=P.SIGMOID(a,o)*(e.x-t.x)+t.x,l=t.y+a*(e.y-t.y);i.push(new n.Vector2(c,l))}return i},zn={createCubicCurvePoints:It,createDampedCurvePoints:Bt,createExponentialCurvePoints:Tt,createLogarithmicCurvePoints:Pt,createParabolicCurvePoints:Ct,createQuadraticCurvePoints:Vt,createSigmoidCurvePoints:Rt};function kn(t,e,o,s,i,r=[0,0],a=[1,0],c=[0,1],l=[1,1]){const u=i||Ot(t,e,o);return[{pos:t,norm:u,uv:r},{pos:e,norm:u,uv:a},{pos:s,norm:u,uv:l},{pos:t,norm:u,uv:r},{pos:s,norm:u,uv:l},{pos:o,norm:u,uv:c}]}function Ot(t,e,o){const s=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],i=[o[0]-t[0],o[1]-t[1],o[2]-t[2]],r=[s[1]*i[2]-s[2]*i[1],s[2]*i[0]-s[0]*i[2],s[0]*i[1]-s[1]*i[0]],a=Math.sqrt(r[0]**2+r[1]**2+r[2]**2);return r.map(c=>c/a)}function Dn(t,e){return t.map(([o,s,i])=>{switch(e){case"x":return[s,i];case"y":return[o,i];case"z":return[o,s];default:throw new Error(`Invalid axis: ${e}`)}})}function Nt(t){const[e,o,s]=t,i=Math.abs(e),r=Math.abs(o),a=Math.abs(s);return i>=r&&i>=a?[s>0?s:-s,o]:r>=i&&r>=a?[e,s>0?s:-s]:[e,o]}function qn(t){return t.map(e=>Nt(e))}function Hn(t){return t.map(([e,o,s])=>{const i=Math.atan2(s,e),r=Math.acos(o/Math.sqrt(e**2+o**2+s**2)),a=i/(2*Math.PI)+.5,c=1-r/Math.PI;return[a,c]})}function Yn(t){return t.map(([e,o,s])=>[Math.atan2(s,e)/(2*Math.PI)+.5,o])}function Xn(t){return t.map(([e,o,s])=>{const i=Math.sqrt(e**2+s**2);return[Math.atan2(s,e)/(2*Math.PI)+.5,i]})}function Ut(t,e,o,s,i){return[(t[0]-e)/(o-e),(t[1]-s)/(i-s)]}function Zn(t,e,o){const[s,i]=e,[r,a]=o;return t.map(c=>Ut(c,s,r,i,a))}function jn(t){const e=Math.min(...t.map(r=>r[0])),o=Math.max(...t.map(r=>r[0])),s=Math.min(...t.map(r=>r[1])),i=Math.max(...t.map(r=>r[1]));return{minBounds:[e,s],maxBounds:[o,i]}}exports.AtmosphericSkybox=xn;exports.Axis=D;exports.BifurcatedStaircaseGeometry=ho;exports.Bone=un;exports.BoneGeometry=rt;exports.Book=bo;exports.BookGeometry=Y;exports.Bookshelf=Fo;exports.BookshelfGeometry=We;exports.BoxSide=E;exports.BubblingEffect=ao;exports.BunsenBurner=Yo;exports.Burst=sn;exports.BurstShape=Mt;exports.Candle=Lo;exports.CandleGeometry=$e;exports.Center=Tn;exports.ColorPalette=C;exports.CrossHeadstone=To;exports.CrossHeadstoneGeometry=He;exports.DaySkybox=vn;exports.Desk=_o;exports.DeskGeometry=Je;exports.Diorama=Go;exports.DioramaGeometry=Le;exports.Direction=R;exports.Easing=ro;exports.ElectricPanel=Xo;exports.EllipticLeafGeometry=Fe;exports.EmissivePulseAnimation=Zt;exports.ErlenmeyerFlask=Zo;exports.ErlenmeyerFlaskGeometry=st;exports.Falloff=O;exports.Flame=zo;exports.FlameGeometry=Q;exports.FlorenceFlask=jo;exports.FlorenceFlaskGeometry=ct;exports.Gear=an;exports.GearShape=yt;exports.Heart=cn;exports.HeartShape=wt;exports.Hill=hn;exports.HillGeometry=ht;exports.Jar=Eo;exports.JarGeometry=ze;exports.LShapedStaircaseGeometry=fo;exports.Lantern=ko;exports.LeafEffect=io;exports.LeverPanel=Qo;exports.LightFlickerAnimation=Qt;exports.LightningAnimation=Wt;exports.LineEquations=yo;exports.Mausoleum=Po;exports.MausoleumGeometry=Ye;exports.Microscope=Ko;exports.Moon=Ao;exports.MortarAndPestle=Wo;exports.MortarGeometry=lt;exports.MossyRocks=Do;exports.MossyRocksGeometry=et;exports.Mound=dn;exports.MoundGeometry=dt;exports.NightSkybox=gn;exports.ObeliskHeadstone=Co;exports.ObeliskHeadstoneGeometry=Xe;exports.Panel=Jo;exports.PanelLight=$o;exports.ParallelogramBoxGeometry=wo;exports.ParametricCurve=P;exports.ParametricCurveUtils=zn;exports.PotionBottle=Io;exports.PotionBottleGeometry=De;exports.Rock=qo;exports.RockGeometry=ot;exports.Rocks=Ho;exports.RocksGeometry=nt;exports.RoundedHeadstone=Vo;exports.RoundedHeadstoneGeometry=Ze;exports.SpiralStaircaseGeometry=po;exports.SpiralTube=en;exports.SquareHeadstone=Ro;exports.SquareHeadstoneGeometry=je;exports.StaircaseGeometry=Mo;exports.Stand=tn;exports.StandGeometry=ut;exports.Star=ln;exports.StarShape=xt;exports.StoneFencePost=Oo;exports.StoneFencePostGeometry=Qe;exports.TeslaCoil=on;exports.TeslaCoilGeometry=mt;exports.TestTube=nn;exports.TestTubeGeometry=z;exports.TestTubeRack=rn;exports.Tree=mn;exports.TreeGeometry=ft;exports.WineBottle=Bo;exports.WineBottleGeometry=qe;exports.WroughtIronBar=No;exports.WroughtIronBarGeometry=j;exports.WroughtIronFence=Uo;exports.WroughtIronFenceGeometry=Ke;exports.addNoiseDisplacement=Mn;exports.addWaterDisplacement=fn;exports.alignBufferGeometryToSurface=En;exports.alignInstancedMeshIndexToSurface=Bn;exports.alignInstancedMeshToSurface=In;exports.alignObjectToSurface=bn;exports.alignToEdge=Gn;exports.alignToRow=An;exports.appendSphericalCurve=it;exports.atmosphericShader=F;exports.calculateChannelDifference=Et;exports.calculateDistance=bt;exports.calculateNormal=Ot;exports.calculateUVBounds=jn;exports.calculateXFromSlopeIntercept=Z;exports.calculateYFromSlopeIntercept=ke;exports.cameraDollyAnimation=zt;exports.cameraFlythroughAnimation=kt;exports.cameraOrbitAnimation=Dt;exports.cameraPendulumAnimation=qt;exports.cameraSpiralAscensionAnimation=Ht;exports.cameraWobbleAnimation=Yt;exports.cameraZoomInAnimation=Xt;exports.capHeightFromRadius=at;exports.capWidthFromRadius=vo;exports.cartesianToSpherical=So;exports.centerMeshGeometry=St;exports.centerObject=vt;exports.centerObjectGeometry=gt;exports.checkerboardTexture=Sn;exports.circularEaseIn=xe;exports.circularEaseInOut=ge;exports.circularEaseOut=ve;exports.concave=Ae;exports.convex=be;exports.createCubicCurvePoints=It;exports.createDampedCurvePoints=Bt;exports.createExponentialCurvePoints=Tt;exports.createLogarithmicCurvePoints=Pt;exports.createParabolicCurvePoints=Ct;exports.createQuad=kn;exports.createQuadraticCurvePoints=Vt;exports.createSigmoidCurvePoints=Rt;exports.cubicCurve=Pe;exports.cubicEaseIn=ie;exports.cubicEaseInOut=le;exports.cubicEaseOut=ce;exports.cubicUVMapping=Nt;exports.cubicUVMappingBatch=qn;exports.cylindricalUVMapping=Yn;exports.dampedCurve=Ce;exports.daySkyShader=_;exports.displacementBrush=Jt;exports.exponentialCurve=Ve;exports.exponentialEaseIn=Me;exports.exponentialEaseInOut=we;exports.exponentialEaseOut=ye;exports.fadeShader=wn;exports.findClosestColor=Nn;exports.findClosestColorChannelWise=Un;exports.flattenBrush=$t;exports.gaussian=Te;exports.getAnalogousColors=Fn;exports.hexToHsl=Cn;exports.hexToRgb=V;exports.hslToHex=Vn;exports.hslToRgb=Gt;exports.interpolateCurve=Ln;exports.inverse=Be;exports.linear=Se;exports.logarithmic=Ee;exports.logarithmicCurve=Re;exports.logarithmicRandomMax=J;exports.logarithmicRandomMin=$;exports.moonShader=pt;exports.nightSkyShader=L;exports.noiseBrush=eo;exports.normalizeRgb=Rn;exports.normalizeUV=Ut;exports.normalizeUVBatch=Zn;exports.parabolicCurve=Oe;exports.parseHexCode=Pn;exports.planarUVMapping=Dn;exports.polarUVMapping=Xn;exports.quadraticCurve=Ne;exports.quadraticEaseIn=re;exports.quadraticEaseInOut=ae;exports.quadraticEaseOut=se;exports.quarticEaseIn=ue;exports.quarticEaseInOut=he;exports.quarticEaseOut=me;exports.quinticEaseIn=de;exports.quinticEaseInOut=pe;exports.quinticEaseOut=fe;exports.radiusFromCapHeight=xo;exports.radiusFromCapWidth=K;exports.randomFloat=k;exports.randomInteger=jt;exports.randomTransformVertices=tt;exports.rgbToHex=On;exports.rgbToHsl=At;exports.rowOfBooksByCount=uo;exports.rowOfBooksByLength=mo;exports.rowOfBooksByScales=X;exports.setRandomInterval=Kt;exports.setRandomTimeout=ee;exports.sigmoidCurve=Ue;exports.sineEaseIn=te;exports.sineEaseInOut=ne;exports.sineEaseOut=oe;exports.smoothBrush=to;exports.smoothstep=Ge;exports.sphericalToCartesian=go;exports.sphericalUVMapping=Hn;exports.spikeBrush=oo;exports.squareRoot=Ie;exports.thetaLengthForRadius=H;exports.twistBrush=no;exports.updateNoiseDisplacementTime=yn;exports.updateWaterDisplacementTime=pn;
|
|
286
|
+
`};class vn extends n.Mesh{constructor(){super();v(this,"geometry");v(this,"material");this.geometry=new n.BoxGeometry(1,1,1),this.material=new n.ShaderMaterial({uniforms:F.uniforms,vertexShader:F.vertexShader,fragmentShader:F.fragmentShader,depthWrite:!1,side:n.BackSide}),this.scale.setScalar(45e4);const o=n.MathUtils.degToRad(89),s=n.MathUtils.degToRad(180),i=new n.Vector3().setFromSphericalCoords(1,o,s);this.material.uniforms.sunPosition.value=i}sunPosition(o,s){const i=new n.Vector3;i.setFromSphericalCoords(1,o,s),this.material.uniforms.sunPosition.value=i}}class gn extends n.Mesh{constructor(o=1e3){super();v(this,"geometry");v(this,"material");this.geometry=new n.BoxGeometry(o,o,o),this.material=new n.ShaderMaterial({uniforms:_.uniforms,vertexShader:_.vertexShader,fragmentShader:_.fragmentShader,side:n.BackSide})}}class Sn extends n.Mesh{constructor(o=1e3){super();v(this,"geometry");v(this,"material");this.geometry=new n.SphereGeometry(o,32,15),this.material=new n.ShaderMaterial({vertexShader:L.vertexShader,fragmentShader:L.fragmentShader,uniforms:L.uniforms,side:n.BackSide})}}const Gn=t=>{const e=new Uint8Array(4*t*t);for(let s=0;s<t*t;s++){const i=s*4,r=(s%t^Math.floor(s/t))&1?255:0;e[i]=r,e[i+1]=r,e[i+2]=r,e[i+3]=255}const o=new n.DataTexture(e,t,t,n.RGBAFormat,n.UnsignedByteType);return o.wrapS=n.RepeatWrapping,o.wrapT=n.RepeatWrapping,o.minFilter=n.NearestFilter,o.needsUpdate=!0,o};function An(t,e){if(t.length===0)throw new Error("No objects provided for alignment.");const o=new n.Box3,s=new n.Vector3,i=t.map(a=>(o.setFromObject(a),a.getWorldPosition(s),{object:a,boundingBox:o.clone(),worldPosition:s.clone()})),r=i.reduce((a,{boundingBox:c})=>{switch(e){case E.LEFT:return Math.min(a,c.min.x);case E.RIGHT:return Math.max(a,c.max.x);case E.BOTTOM:return Math.min(a,c.min.y);case E.TOP:return Math.max(a,c.max.y);case E.BACK:return Math.min(a,c.min.z);case E.FRONT:return Math.max(a,c.max.z);default:throw new Error(`Unsupported side type: ${e}`)}},e===E.RIGHT||e===E.TOP||e===E.FRONT?-1/0:1/0);i.forEach(({object:a,boundingBox:c})=>{switch(e){case E.LEFT:a.position.x+=r-c.min.x;break;case E.RIGHT:a.position.x+=r-c.max.x;break;case E.BOTTOM:a.position.y+=r-c.min.y;break;case E.TOP:a.position.y+=r-c.max.y;break;case E.BACK:a.position.z+=r-c.min.z;break;case E.FRONT:a.position.z+=r-c.max.z;break}})}function bn(t,e=R.RIGHT,o=0){const s=e.clone().normalize();let i=new n.Vector3;const r=new n.Box3;t.forEach(a=>{r.setFromObject(a);const l=new n.Vector3(r.max.x-r.min.x,r.max.y-r.min.y,r.max.z-r.min.z).dot(s),u=new n.Vector3;r.getCenter(u);const m=s.clone().multiplyScalar(l/2);a.position.copy(i.clone().add(m).sub(u).add(a.position)),i.add(s.clone().multiplyScalar(l+o))})}function In(t,e,o=new n.Vector3(0,0,0)){const s=new n.Box3().setFromObject(t);if(s.isEmpty())console.warn("The object has no geometry or is not visible.");else{const i=s.min,r=new n.Vector3((i.x+s.max.x)/2,i.y,(i.z+s.max.z)/2);t.localToWorld(r);const a=e.clone().sub(r).add(o),c=t.worldToLocal(a.clone());t.position.add(c)}}function En(t,e){const o=new n.Box3().setFromBufferAttribute(new n.Float32BufferAttribute(t.attributes.position.array,3));if(o.isEmpty())console.warn("The geometry is empty or invalid.");else{const s=o.min.y;t.translate(0,e-s,0)}}function Tn(t,e,o=new n.Vector3(0,0,0)){const s=new n.Box3().setFromObject(t);if(s.isEmpty())console.warn("The InstancedMesh has no geometry or is not visible.");else{const i=s.min.y,r=new n.Vector3(0,e.y-i,0).add(o),a=t.worldToLocal(r.clone());t.position.add(a)}}function Bn(t,e,o,s=new n.Vector3(0,0,0)){const i=new n.Box3().setFromObject(t);if(i.isEmpty())console.warn("The instanced mesh has invalid geometry.");else{const r=i.min.y,a=new n.Matrix4;t.getMatrixAt(o,a);const c=new n.Vector3,l=new n.Quaternion,u=new n.Vector3;a.decompose(c,l,u);const m=t.worldToLocal(e.clone());c.y=m.y-r+s.y,a.compose(c,l,u),t.setMatrixAt(o,a),t.instanceMatrix.needsUpdate=!0}}function vt(t,e=new n.Vector3(0,0,0),o=new n.Vector3(0,0,0)){const i=new n.Box3().setFromObject(t).getCenter(new n.Vector3),r=new n.Vector3().addVectors(e,o),a=new n.Vector3().subVectors(r,i);t.position.add(a)}function gt(t,e=new n.Vector3(0,0,0),o=new n.Vector3(0,0,0)){const i=new n.Box3().setFromObject(t).getCenter(new n.Vector3),r=new n.Vector3().addVectors(e,o);t.translateX(r.x-i.x),t.translateY(r.y-i.y),t.translateZ(r.z-i.z),t.updateMatrixWorld(!0)}function St(t,e=new n.Vector3(0,0,0),o=new n.Vector3(0,0,0)){t.geometry.computeBoundingBox();const s=t.geometry.boundingBox;if(s){const i=s.getCenter(new n.Vector3),r=new n.Vector3().addVectors(e,o),a=new n.Vector3().subVectors(r,i);t.geometry.translate(a.x,a.y,a.z)}}const Pn={object:vt,objectGeometry:gt,meshGeometry:St};function Cn(t){const e=parseInt(t.slice(1),16);return[e>>16&255,e>>8&255,e&255]}function Vn(t){const[e,o,s]=V(t);return At(e,o,s)}function V(t){const e=t>>16&255,o=t>>8&255,s=t&255;return[e,o,s]}function Rn(t,e,o){e/=100,o/=100;function s(l,u,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?l+(u-l)*6*m:m<1/2?u:m<2/3?l+(u-l)*(2/3-m)*6:l}let i,r,a;if(e===0)i=r=a=o;else{const l=o<.5?o*(1+e):o+e-o*e,u=2*o-l;i=s(u,l,t/360+1/3),r=s(u,l,t/360),a=s(u,l,t/360-1/3)}const c=l=>Math.round(l*255);return[c(i),c(r),c(a)]}function Gt(t,e,o){e/=100,o/=100;const s=a=>(a+t/30)%12,i=e*Math.min(o,1-o),r=a=>o-i*Math.max(-1,Math.min(s(a)-3,Math.min(9-s(a),1)));return[r(0)*255,r(8)*255,r(4)*255]}function On(t,e,o){return[t/255,e/255,o/255]}function Nn(t,e,o){return t=Math.round(t),e=Math.round(e),o=Math.round(o),(t<<16)+(e<<8)+o}function At(t,e,o){t/=255,e/=255,o/=255;const s=Math.max(t,e,o),i=Math.min(t,e,o),r=s-i;let a=0,c=0;const l=(s+i)/2;r!==0&&(s===t?a=((e-o)/r+(e<o?6:0))*60:s===e?a=((o-t)/r+2)*60:s===o&&(a=((t-e)/r+4)*60)),r!==0&&(c=r/(1-Math.abs(2*l-1))),a=Math.round(a),c=Math.round(c*100);const u=Math.round(l*100);return[a,c,u]}function bt(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function It(t,e){return Math.abs(t[0]-e[0])+Math.abs(t[1]-e[1])+Math.abs(t[2]-e[2])}function Un(t,e){const o=V(t);let s=null,i=1/0;for(const r of e){const a=V(r),c=bt(o,a);c<i&&(i=c,s=r)}return s}function Fn(t,e){const o=V(t);let s=null,i=1/0;for(const r of e){const a=V(r),c=It(o,a);c<i&&(i=c,s=r)}return s}function _n(t){const e=(t+Math.floor(-30+Math.random()*61))%360,o=Math.floor(60+Math.random()*21),s=Math.floor(50+Math.random()*21);return Gt(e,o,s)}function Ln(t,e){if(!e.geometry.isBufferGeometry)throw new Error("Mesh must have a BufferGeometry.");const s=e.geometry.getAttribute("position"),i=new n.Vector3,r=new n.Vector3;let a=1/0;for(let c=0;c<s.count;c++){r.fromBufferAttribute(s,c);const l=r.distanceTo(t);l<a&&(a=l,i.copy(r))}return e.localToWorld(i),i}function zn(t,e,o){return Math.max(0,Math.min(1,(t-e)/(o-e)))}function kn(t,e,o,s,i,r=20,a=0,c=1){const l=[];for(let u=0;u<=r;u++){const m=u/r,h=t(zn(m,a,c)),d=e+h*(o-e),f=s+m*(i-s);l.push(new n.Vector2(d,f))}return l}const Et=(t,e,o,s,i=24)=>{let r=[];for(let a=0;a<=i;a++){const c=a/i,l=P.CUBIC(c,t.x,e.x,o.x,s.x),u=P.CUBIC(c,t.y,e.y,o.y,s.y);r.push(new n.Vector2(l,u))}return r},Tt=(t,e,o,s=24)=>{let i=[];for(let r=0;r<=s;r++){const a=r/s,c=P.DAMPED(a,o)*(e.x-t.x)+t.x,l=t.y+a*(e.y-t.y);i.push(new n.Vector2(c,l))}return i},Bt=(t,e,o,s,i=24)=>{let r=[];for(let a=0;a<=i;a++){const c=a/i,l=P.EXPONENTIAL(c,o,s)*(e.x-t.x)+t.x,u=t.y+c*(e.y-t.y);r.push(new n.Vector2(l,u))}return r},Pt=(t,e,o,s,i=24)=>{let r=[];for(let a=0;a<=i;a++){const c=a/i,l=P.LOGARITHMIC(c,o,s)*(e.x-t.x)+t.x,u=t.y+c*(e.y-t.y);r.push(new n.Vector2(l,u))}return r},Ct=(t,e,o,s,i,r=24)=>{let a=[];for(let c=0;c<=r;c++){const l=c/r,u=o*l*l+s*l+i+t.x,m=t.y+l*(e.y-t.y);a.push(new n.Vector2(u,m))}return a},Vt=(t,e,o,s=24)=>{let i=[];for(let r=0;r<=s;r++){const a=r/s,c=P.QUADRATIC(a,t.x,e.x,o.x),l=P.QUADRATIC(a,t.y,e.y,o.y);i.push(new n.Vector2(c,l))}return i},Rt=(t,e,o,s=24)=>{let i=[];for(let r=0;r<=s;r++){const a=r/s,c=P.SIGMOID(a,o)*(e.x-t.x)+t.x,l=t.y+a*(e.y-t.y);i.push(new n.Vector2(c,l))}return i},Dn={createCubicCurvePoints:Et,createDampedCurvePoints:Tt,createExponentialCurvePoints:Bt,createLogarithmicCurvePoints:Pt,createParabolicCurvePoints:Ct,createQuadraticCurvePoints:Vt,createSigmoidCurvePoints:Rt};function qn(t,e,o,s,i,r=[0,0],a=[1,0],c=[0,1],l=[1,1]){const u=i||Ot(t,e,o);return[{pos:t,norm:u,uv:r},{pos:e,norm:u,uv:a},{pos:s,norm:u,uv:l},{pos:t,norm:u,uv:r},{pos:s,norm:u,uv:l},{pos:o,norm:u,uv:c}]}function Ot(t,e,o){const s=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],i=[o[0]-t[0],o[1]-t[1],o[2]-t[2]],r=[s[1]*i[2]-s[2]*i[1],s[2]*i[0]-s[0]*i[2],s[0]*i[1]-s[1]*i[0]],a=Math.sqrt(r[0]**2+r[1]**2+r[2]**2);return r.map(c=>c/a)}function Hn(t,e){return t.map(([o,s,i])=>{switch(e){case"x":return[s,i];case"y":return[o,i];case"z":return[o,s];default:throw new Error(`Invalid axis: ${e}`)}})}function Nt(t){const[e,o,s]=t,i=Math.abs(e),r=Math.abs(o),a=Math.abs(s);return i>=r&&i>=a?[s>0?s:-s,o]:r>=i&&r>=a?[e,s>0?s:-s]:[e,o]}function Yn(t){return t.map(e=>Nt(e))}function Xn(t){return t.map(([e,o,s])=>{const i=Math.atan2(s,e),r=Math.acos(o/Math.sqrt(e**2+o**2+s**2)),a=i/(2*Math.PI)+.5,c=1-r/Math.PI;return[a,c]})}function Zn(t){return t.map(([e,o,s])=>[Math.atan2(s,e)/(2*Math.PI)+.5,o])}function jn(t){return t.map(([e,o,s])=>{const i=Math.sqrt(e**2+s**2);return[Math.atan2(s,e)/(2*Math.PI)+.5,i]})}function Ut(t,e,o,s,i){return[(t[0]-e)/(o-e),(t[1]-s)/(i-s)]}function Qn(t,e,o){const[s,i]=e,[r,a]=o;return t.map(c=>Ut(c,s,r,i,a))}function Kn(t){const e=Math.min(...t.map(r=>r[0])),o=Math.max(...t.map(r=>r[0])),s=Math.min(...t.map(r=>r[1])),i=Math.max(...t.map(r=>r[1]));return{minBounds:[e,s],maxBounds:[o,i]}}exports.AtmosphericSkybox=vn;exports.Axis=D;exports.BifurcatedStaircaseGeometry=fo;exports.Bone=mn;exports.BoneGeometry=rt;exports.Book=Io;exports.BookGeometry=Y;exports.Bookshelf=_o;exports.BookshelfGeometry=We;exports.BoxSide=E;exports.BubblingEffect=ao;exports.BunsenBurner=Xo;exports.Burst=an;exports.BurstShape=Mt;exports.Candle=zo;exports.CandleGeometry=$e;exports.Center=Pn;exports.ColorPalette=C;exports.CrossHeadstone=Po;exports.CrossHeadstoneGeometry=He;exports.DaySkybox=gn;exports.Desk=Lo;exports.DeskGeometry=Je;exports.Diorama=Ao;exports.DioramaGeometry=Le;exports.Direction=R;exports.Easing=ro;exports.ElectricPanel=Zo;exports.EllipticLeafGeometry=Fe;exports.EmissivePulseAnimation=Zt;exports.ErlenmeyerFlask=jo;exports.ErlenmeyerFlaskGeometry=st;exports.Falloff=O;exports.Flame=ko;exports.FlameGeometry=Q;exports.FlorenceFlask=Qo;exports.FlorenceFlaskGeometry=ct;exports.Gear=cn;exports.GearShape=yt;exports.Heart=ln;exports.HeartShape=wt;exports.Hill=dn;exports.HillGeometry=ht;exports.Jar=Eo;exports.JarGeometry=ze;exports.LShapedStaircaseGeometry=po;exports.Lantern=Do;exports.LeafEffect=io;exports.LeverPanel=Ko;exports.LightFlickerAnimation=Qt;exports.LightningAnimation=Wt;exports.LineEquations=wo;exports.Mausoleum=Co;exports.MausoleumGeometry=Ye;exports.Microscope=Wo;exports.Moon=bo;exports.MortarAndPestle=Jo;exports.MortarGeometry=lt;exports.MossyRocks=qo;exports.MossyRocksGeometry=et;exports.Mound=fn;exports.MoundGeometry=dt;exports.NightSkybox=Sn;exports.ObeliskHeadstone=Vo;exports.ObeliskHeadstoneGeometry=Xe;exports.Panel=$o;exports.PanelLight=en;exports.ParallelogramBoxGeometry=xo;exports.ParametricCurve=P;exports.ParametricCurveUtils=Dn;exports.PotionBottle=To;exports.PotionBottleGeometry=De;exports.Rock=Ho;exports.RockGeometry=ot;exports.Rocks=Yo;exports.RocksGeometry=nt;exports.RoundedHeadstone=Ro;exports.RoundedHeadstoneGeometry=Ze;exports.SpiralStaircaseGeometry=Mo;exports.SpiralTube=tn;exports.SquareHeadstone=Oo;exports.SquareHeadstoneGeometry=je;exports.StaircaseGeometry=yo;exports.Stand=on;exports.StandGeometry=ut;exports.Star=un;exports.StarShape=xt;exports.StoneFencePost=No;exports.StoneFencePostGeometry=Qe;exports.TeslaCoil=nn;exports.TeslaCoilGeometry=mt;exports.TestTube=rn;exports.TestTubeGeometry=z;exports.TestTubeRack=sn;exports.Tree=hn;exports.TreeGeometry=ft;exports.WineBottle=Bo;exports.WineBottleGeometry=qe;exports.WroughtIronBar=Uo;exports.WroughtIronBarGeometry=j;exports.WroughtIronFence=Fo;exports.WroughtIronFenceGeometry=Ke;exports.addNoiseDisplacement=yn;exports.addWaterDisplacement=pn;exports.alignBufferGeometryToSurface=En;exports.alignInstancedMeshIndexToSurface=Bn;exports.alignInstancedMeshToSurface=Tn;exports.alignObjectToSurface=In;exports.alignToEdge=An;exports.alignToRow=bn;exports.appendSphericalCurve=it;exports.atmosphericShader=F;exports.calculateChannelDifference=It;exports.calculateDistance=bt;exports.calculateNormal=Ot;exports.calculateUVBounds=Kn;exports.calculateXFromSlopeIntercept=Z;exports.calculateYFromSlopeIntercept=ke;exports.cameraDollyAnimation=zt;exports.cameraFlythroughAnimation=kt;exports.cameraOrbitAnimation=Dt;exports.cameraPendulumAnimation=qt;exports.cameraSpiralAscensionAnimation=Ht;exports.cameraWobbleAnimation=Yt;exports.cameraZoomInAnimation=Xt;exports.capHeightFromRadius=at;exports.capWidthFromRadius=go;exports.cartesianToSpherical=Go;exports.centerMeshGeometry=St;exports.centerObject=vt;exports.centerObjectGeometry=gt;exports.checkerboardTexture=Gn;exports.circularEaseIn=xe;exports.circularEaseInOut=ge;exports.circularEaseOut=ve;exports.concave=Ae;exports.convex=be;exports.createCubicCurvePoints=Et;exports.createDampedCurvePoints=Tt;exports.createExponentialCurvePoints=Bt;exports.createHexagonalTile=ho;exports.createLogarithmicCurvePoints=Pt;exports.createParabolicCurvePoints=Ct;exports.createQuad=qn;exports.createQuadraticCurvePoints=Vt;exports.createSigmoidCurvePoints=Rt;exports.cubicCurve=Pe;exports.cubicEaseIn=ie;exports.cubicEaseInOut=le;exports.cubicEaseOut=ce;exports.cubicUVMapping=Nt;exports.cubicUVMappingBatch=Yn;exports.cylindricalUVMapping=Zn;exports.dampedCurve=Ce;exports.daySkyShader=_;exports.displacementBrush=Jt;exports.exponentialCurve=Ve;exports.exponentialEaseIn=Me;exports.exponentialEaseInOut=we;exports.exponentialEaseOut=ye;exports.fadeShader=xn;exports.findClosestColor=Un;exports.findClosestColorChannelWise=Fn;exports.findClosestPoint=Ln;exports.flattenBrush=$t;exports.gaussian=Be;exports.getAnalogousColors=_n;exports.hexToHsl=Vn;exports.hexToRgb=V;exports.hslToHex=Rn;exports.hslToRgb=Gt;exports.interpolateCurve=kn;exports.inverse=Te;exports.linear=Se;exports.logarithmic=Ie;exports.logarithmicCurve=Re;exports.logarithmicRandomMax=J;exports.logarithmicRandomMin=$;exports.moonShader=pt;exports.nightSkyShader=L;exports.noiseBrush=eo;exports.normalizeRgb=On;exports.normalizeUV=Ut;exports.normalizeUVBatch=Qn;exports.parabolicCurve=Oe;exports.parseHexCode=Cn;exports.planarUVMapping=Hn;exports.polarUVMapping=jn;exports.quadraticCurve=Ne;exports.quadraticEaseIn=re;exports.quadraticEaseInOut=ae;exports.quadraticEaseOut=se;exports.quarticEaseIn=ue;exports.quarticEaseInOut=he;exports.quarticEaseOut=me;exports.quinticEaseIn=de;exports.quinticEaseInOut=pe;exports.quinticEaseOut=fe;exports.radiusFromCapHeight=vo;exports.radiusFromCapWidth=K;exports.randomFloat=k;exports.randomInteger=jt;exports.randomTransformVertices=tt;exports.rgbToHex=Nn;exports.rgbToHsl=At;exports.rowOfBooksByCount=uo;exports.rowOfBooksByLength=mo;exports.rowOfBooksByScales=X;exports.setRandomInterval=Kt;exports.setRandomTimeout=ee;exports.sigmoidCurve=Ue;exports.sineEaseIn=te;exports.sineEaseInOut=ne;exports.sineEaseOut=oe;exports.smoothBrush=to;exports.smoothstep=Ge;exports.sphericalToCartesian=So;exports.sphericalUVMapping=Xn;exports.spikeBrush=oo;exports.squareRoot=Ee;exports.thetaLengthForRadius=H;exports.twistBrush=no;exports.updateNoiseDisplacementTime=wn;exports.updateWaterDisplacementTime=Mn;
|
|
287
287
|
//# sourceMappingURL=index.cjs.js.map
|