ednl-liftstatus-web-components
Version:
The EDNL LiftStatus web components
6 lines • 1.22 MB
JavaScript
import{g as e,f as t,r as i,a as n,h as o,H as r,c as s}from"./p-3d8601fe.js";
/**
* @license
* Copyright 2010-2023 Three.js Authors
* SPDX-License-Identifier: MIT
*/const a="151";const c=0;const l=1;const d=2;const h=1;const f=2;const p=3;const u=0;const m=1;const v=2;const _=0;const E=1;const g=2;const w=3;const y=4;const A=5;const S=100;const b=101;const T=102;const R=103;const L=104;const C=200;const O=201;const k=202;const N=203;const M=204;const D=205;const I=206;const F=207;const x=208;const P=209;const U=210;const V=0;const B=1;const H=2;const G=3;const W=4;const j=5;const z=6;const K=7;const X=0;const Y=1;const Z=2;const $=0;const q=1;const J=2;const Q=3;const ee=4;const te=5;const ie=300;const ne=301;const oe=302;const re=303;const se=304;const ae=306;const ce=1e3;const le=1001;const de=1002;const he=1003;const fe=1004;const pe=1005;const ue=1006;const me=1007;const ve=1008;const _e=1009;const Ee=1010;const ge=1011;const we=1012;const ye=1013;const Ae=1014;const Se=1015;const be=1016;const Te=1017;const Re=1018;const Le=1020;const Ce=1021;const Oe=1023;const ke=1024;const Ne=1025;const Me=1026;const De=1027;const Ie=1028;const Fe=1029;const xe=1030;const Pe=1031;const Ue=1033;const Ve=33776;const Be=33777;const He=33778;const Ge=33779;const We=35840;const je=35841;const ze=35842;const Ke=35843;const Xe=36196;const Ye=37492;const Ze=37496;const $e=37808;const qe=37809;const Je=37810;const Qe=37811;const et=37812;const tt=37813;const it=37814;const nt=37815;const ot=37816;const rt=37817;const st=37818;const at=37819;const ct=37820;const lt=37821;const dt=36492;const ht=36283;const ft=36284;const pt=36285;const ut=36286;const mt=2300;const vt=2301;const _t=2302;const Et=2400;const gt=2401;const wt=2402;const yt=2500;const At=3e3;const St=3001;const bt=3200;const Tt=3201;const Rt=0;const Lt=1;const Ct="srgb";const Ot="srgb-linear";const kt="display-p3";const Nt=7680;const Mt=519;const Dt=35044;const It="300 es";const Ft=1035;class xt{addEventListener(e,t){if(this._listeners===undefined)this._listeners={};const i=this._listeners;if(i[e]===undefined){i[e]=[]}if(i[e].indexOf(t)===-1){i[e].push(t)}}hasEventListener(e,t){if(this._listeners===undefined)return false;const i=this._listeners;return i[e]!==undefined&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===undefined)return;const i=this._listeners;const n=i[e];if(n!==undefined){const e=n.indexOf(t);if(e!==-1){n.splice(e,1)}}}dispatchEvent(e){if(this._listeners===undefined)return;const t=this._listeners;const i=t[e.type];if(i!==undefined){e.target=this;const t=i.slice(0);for(let i=0,n=t.length;i<n;i++){t[i].call(this,e)}e.target=null}}}const Pt=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Ut=1234567;const Vt=Math.PI/180;const Bt=180/Math.PI;function Ht(){const e=Math.random()*4294967295|0;const t=Math.random()*4294967295|0;const i=Math.random()*4294967295|0;const n=Math.random()*4294967295|0;const o=Pt[e&255]+Pt[e>>8&255]+Pt[e>>16&255]+Pt[e>>24&255]+"-"+Pt[t&255]+Pt[t>>8&255]+"-"+Pt[t>>16&15|64]+Pt[t>>24&255]+"-"+Pt[i&63|128]+Pt[i>>8&255]+"-"+Pt[i>>16&255]+Pt[i>>24&255]+Pt[n&255]+Pt[n>>8&255]+Pt[n>>16&255]+Pt[n>>24&255];return o.toLowerCase()}function Gt(e,t,i){return Math.max(t,Math.min(i,e))}function Wt(e,t){return(e%t+t)%t}function jt(e,t,i,n,o){return n+(e-t)*(o-n)/(i-t)}function zt(e,t,i){if(e!==t){return(i-e)/(t-e)}else{return 0}}function Kt(e,t,i){return(1-i)*e+i*t}function Xt(e,t,i,n){return Kt(e,t,1-Math.exp(-i*n))}function Yt(e,t=1){return t-Math.abs(Wt(e,t*2)-t)}function Zt(e,t,i){if(e<=t)return 0;if(e>=i)return 1;e=(e-t)/(i-t);return e*e*(3-2*e)}function $t(e,t,i){if(e<=t)return 0;if(e>=i)return 1;e=(e-t)/(i-t);return e*e*e*(e*(e*6-15)+10)}function qt(e,t){return e+Math.floor(Math.random()*(t-e+1))}function Jt(e,t){return e+Math.random()*(t-e)}function Qt(e){return e*(.5-Math.random())}function ei(e){if(e!==undefined)Ut=e;let t=Ut+=1831565813;t=Math.imul(t^t>>>15,t|1);t^=t+Math.imul(t^t>>>7,t|61);return((t^t>>>14)>>>0)/4294967296}function ti(e){return e*Vt}function ii(e){return e*Bt}function ni(e){return(e&e-1)===0&&e!==0}function oi(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function ri(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function si(e,t,i,n,o){const r=Math.cos;const s=Math.sin;const a=r(i/2);const c=s(i/2);const l=r((t+n)/2);const d=s((t+n)/2);const h=r((t-n)/2);const f=s((t-n)/2);const p=r((n-t)/2);const u=s((n-t)/2);switch(o){case"XYX":e.set(a*d,c*h,c*f,a*l);break;case"YZY":e.set(c*f,a*d,c*h,a*l);break;case"ZXZ":e.set(c*h,c*f,a*d,a*l);break;case"XZX":e.set(a*d,c*u,c*p,a*l);break;case"YXY":e.set(c*p,a*d,c*u,a*l);break;case"ZYZ":e.set(c*u,c*p,a*d,a*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+o)}}function ai(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function ci(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw new Error("Invalid component type.")}}const li={DEG2RAD:Vt,RAD2DEG:Bt,generateUUID:Ht,clamp:Gt,euclideanModulo:Wt,mapLinear:jt,inverseLerp:zt,lerp:Kt,damp:Xt,pingpong:Yt,smoothstep:Zt,smootherstep:$t,randInt:qt,randFloat:Jt,randFloatSpread:Qt,seededRandom:ei,degToRad:ti,radToDeg:ii,isPowerOfTwo:ni,ceilPowerOfTwo:oi,floorPowerOfTwo:ri,setQuaternionFromProperEuler:si,normalize:ci,denormalize:ai};class di{constructor(e=0,t=0){di.prototype.isVector2=true;this.x=e;this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){this.x=e;this.y=t;return this}setScalar(e){this.x=e;this.y=e;return this}setX(e){this.x=e;return this}setY(e){this.y=e;return this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){this.x=e.x;this.y=e.y;return this}add(e){this.x+=e.x;this.y+=e.y;return this}addScalar(e){this.x+=e;this.y+=e;return this}addVectors(e,t){this.x=e.x+t.x;this.y=e.y+t.y;return this}addScaledVector(e,t){this.x+=e.x*t;this.y+=e.y*t;return this}sub(e){this.x-=e.x;this.y-=e.y;return this}subScalar(e){this.x-=e;this.y-=e;return this}subVectors(e,t){this.x=e.x-t.x;this.y=e.y-t.y;return this}multiply(e){this.x*=e.x;this.y*=e.y;return this}multiplyScalar(e){this.x*=e;this.y*=e;return this}divide(e){this.x/=e.x;this.y/=e.y;return this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y;const n=e.elements;this.x=n[0]*t+n[3]*i+n[6];this.y=n[1]*t+n[4]*i+n[7];return this}min(e){this.x=Math.min(this.x,e.x);this.y=Math.min(this.y,e.y);return this}max(e){this.x=Math.max(this.x,e.x);this.y=Math.max(this.y,e.y);return this}clamp(e,t){this.x=Math.max(e.x,Math.min(t.x,this.x));this.y=Math.max(e.y,Math.min(t.y,this.y));return this}clampScalar(e,t){this.x=Math.max(e,Math.min(t,this.x));this.y=Math.max(e,Math.min(t,this.y));return this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this}roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);return this}negate(){this.x=-this.x;this.y=-this.y;return this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){const e=Math.atan2(-this.y,-this.x)+Math.PI;return e}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Gt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){this.x+=(e.x-this.x)*t;this.y+=(e.y-this.y)*t;return this}lerpVectors(e,t,i){this.x=e.x+(t.x-e.x)*i;this.y=e.y+(t.y-e.y)*i;return this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){this.x=e[t];this.y=e[t+1];return this}toArray(e=[],t=0){e[t]=this.x;e[t+1]=this.y;return e}fromBufferAttribute(e,t){this.x=e.getX(t);this.y=e.getY(t);return this}rotateAround(e,t){const i=Math.cos(t),n=Math.sin(t);const o=this.x-e.x;const r=this.y-e.y;this.x=o*i-r*n+e.x;this.y=o*n+r*i+e.y;return this}random(){this.x=Math.random();this.y=Math.random();return this}*[Symbol.iterator](){yield this.x;yield this.y}}class hi{constructor(){hi.prototype.isMatrix3=true;this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,i,n,o,r,s,a,c){const l=this.elements;l[0]=e;l[1]=n;l[2]=s;l[3]=t;l[4]=o;l[5]=a;l[6]=i;l[7]=r;l[8]=c;return this}identity(){this.set(1,0,0,0,1,0,0,0,1);return this}copy(e){const t=this.elements;const i=e.elements;t[0]=i[0];t[1]=i[1];t[2]=i[2];t[3]=i[3];t[4]=i[4];t[5]=i[5];t[6]=i[6];t[7]=i[7];t[8]=i[8];return this}extractBasis(e,t,i){e.setFromMatrix3Column(this,0);t.setFromMatrix3Column(this,1);i.setFromMatrix3Column(this,2);return this}setFromMatrix4(e){const t=e.elements;this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]);return this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements;const n=t.elements;const o=this.elements;const r=i[0],s=i[3],a=i[6];const c=i[1],l=i[4],d=i[7];const h=i[2],f=i[5],p=i[8];const u=n[0],m=n[3],v=n[6];const _=n[1],E=n[4],g=n[7];const w=n[2],y=n[5],A=n[8];o[0]=r*u+s*_+a*w;o[3]=r*m+s*E+a*y;o[6]=r*v+s*g+a*A;o[1]=c*u+l*_+d*w;o[4]=c*m+l*E+d*y;o[7]=c*v+l*g+d*A;o[2]=h*u+f*_+p*w;o[5]=h*m+f*E+p*y;o[8]=h*v+f*g+p*A;return this}multiplyScalar(e){const t=this.elements;t[0]*=e;t[3]*=e;t[6]*=e;t[1]*=e;t[4]*=e;t[7]*=e;t[2]*=e;t[5]*=e;t[8]*=e;return this}determinant(){const e=this.elements;const t=e[0],i=e[1],n=e[2],o=e[3],r=e[4],s=e[5],a=e[6],c=e[7],l=e[8];return t*r*l-t*s*c-i*o*l+i*s*a+n*o*c-n*r*a}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],o=e[3],r=e[4],s=e[5],a=e[6],c=e[7],l=e[8],d=l*r-s*c,h=s*a-l*o,f=c*o-r*a,p=t*d+i*h+n*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const u=1/p;e[0]=d*u;e[1]=(n*c-l*i)*u;e[2]=(s*i-n*r)*u;e[3]=h*u;e[4]=(l*t-n*a)*u;e[5]=(n*o-s*t)*u;e[6]=f*u;e[7]=(i*a-c*t)*u;e[8]=(r*t-i*o)*u;return this}transpose(){let e;const t=this.elements;e=t[1];t[1]=t[3];t[3]=e;e=t[2];t[2]=t[6];t[6]=e;e=t[5];t[5]=t[7];t[7]=e;return this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;e[0]=t[0];e[1]=t[3];e[2]=t[6];e[3]=t[1];e[4]=t[4];e[5]=t[7];e[6]=t[2];e[7]=t[5];e[8]=t[8];return this}setUvTransform(e,t,i,n,o,r,s){const a=Math.cos(o);const c=Math.sin(o);this.set(i*a,i*c,-i*(a*r+c*s)+r+e,-n*c,n*a,-n*(-c*r+a*s)+s+t,0,0,1);return this}scale(e,t){this.premultiply(fi.makeScale(e,t));return this}rotate(e){this.premultiply(fi.makeRotation(-e));return this}translate(e,t){this.premultiply(fi.makeTranslation(e,t));return this}makeTranslation(e,t){this.set(1,0,e,0,1,t,0,0,1);return this}makeRotation(e){const t=Math.cos(e);const i=Math.sin(e);this.set(t,-i,0,i,t,0,0,0,1);return this}makeScale(e,t){this.set(e,0,0,0,t,0,0,0,1);return this}equals(e){const t=this.elements;const i=e.elements;for(let e=0;e<9;e++){if(t[e]!==i[e])return false}return true}fromArray(e,t=0){for(let i=0;i<9;i++){this.elements[i]=e[i+t]}return this}toArray(e=[],t=0){const i=this.elements;e[t]=i[0];e[t+1]=i[1];e[t+2]=i[2];e[t+3]=i[3];e[t+4]=i[4];e[t+5]=i[5];e[t+6]=i[6];e[t+7]=i[7];e[t+8]=i[8];return e}clone(){return(new this.constructor).fromArray(this.elements)}}const fi=new hi;function pi(e){for(let t=e.length-1;t>=0;--t){if(e[t]>=65535)return true}return false}function ui(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function mi(e){return e<.04045?e*.0773993808:Math.pow(e*.9478672986+.0521327014,2.4)}function vi(e){return e<.0031308?e*12.92:1.055*Math.pow(e,.41666)-.055}const _i=(new hi).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]);const Ei=(new hi).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);function gi(e){return e.convertSRGBToLinear().applyMatrix3(Ei)}function wi(e){return e.applyMatrix3(_i).convertLinearToSRGB()}const yi={[Ot]:e=>e,[Ct]:e=>e.convertSRGBToLinear(),[kt]:gi};const Ai={[Ot]:e=>e,[Ct]:e=>e.convertLinearToSRGB(),[kt]:wi};const Si={enabled:false,get legacyMode(){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150.");return!this.enabled},set legacyMode(e){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150.");this.enabled=!e},get workingColorSpace(){return Ot},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,i){if(this.enabled===false||t===i||!t||!i){return e}const n=yi[t];const o=Ai[i];if(n===undefined||o===undefined){throw new Error(`Unsupported color space conversion, "${t}" to "${i}".`)}return o(n(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)}};let bi;class Ti{static getDataURL(e){if(/^data:/i.test(e.src)){return e.src}if(typeof HTMLCanvasElement==="undefined"){return e.src}let t;if(e instanceof HTMLCanvasElement){t=e}else{if(bi===undefined)bi=ui("canvas");bi.width=e.width;bi.height=e.height;const i=bi.getContext("2d");if(e instanceof ImageData){i.putImageData(e,0,0)}else{i.drawImage(e,0,0,e.width,e.height)}t=bi}if(t.width>2048||t.height>2048){console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e);return t.toDataURL("image/jpeg",.6)}else{return t.toDataURL("image/png")}}static sRGBToLinear(e){if(typeof HTMLImageElement!=="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!=="undefined"&&e instanceof HTMLCanvasElement||typeof ImageBitmap!=="undefined"&&e instanceof ImageBitmap){const t=ui("canvas");t.width=e.width;t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const n=i.getImageData(0,0,e.width,e.height);const o=n.data;for(let e=0;e<o.length;e++){o[e]=mi(o[e]/255)*255}i.putImageData(n,0,0);return t}else if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++){if(t instanceof Uint8Array||t instanceof Uint8ClampedArray){t[e]=Math.floor(mi(t[e]/255)*255)}else{t[e]=mi(t[e])}}return{data:t,width:e.width,height:e.height}}else{console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.");return e}}}class Ri{constructor(e=null){this.isSource=true;this.uuid=Ht();this.data=e;this.version=0}set needsUpdate(e){if(e===true)this.version++}toJSON(e){const t=e===undefined||typeof e==="string";if(!t&&e.images[this.uuid]!==undefined){return e.images[this.uuid]}const i={uuid:this.uuid,url:""};const n=this.data;if(n!==null){let e;if(Array.isArray(n)){e=[];for(let t=0,i=n.length;t<i;t++){if(n[t].isDataTexture){e.push(Li(n[t].image))}else{e.push(Li(n[t]))}}}else{e=Li(n)}i.url=e}if(!t){e.images[this.uuid]=i}return i}}function Li(e){if(typeof HTMLImageElement!=="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!=="undefined"&&e instanceof HTMLCanvasElement||typeof ImageBitmap!=="undefined"&&e instanceof ImageBitmap){return Ti.getDataURL(e)}else{if(e.data){return{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}}else{console.warn("THREE.Texture: Unable to serialize Texture.");return{}}}}let Ci=0;class Oi extends xt{constructor(e=Oi.DEFAULT_IMAGE,t=Oi.DEFAULT_MAPPING,i=le,n=le,o=ue,r=ve,s=Oe,a=_e,c=Oi.DEFAULT_ANISOTROPY,l=At){super();this.isTexture=true;Object.defineProperty(this,"id",{value:Ci++});this.uuid=Ht();this.name="";this.source=new Ri(e);this.mipmaps=[];this.mapping=t;this.channel=0;this.wrapS=i;this.wrapT=n;this.magFilter=o;this.minFilter=r;this.anisotropy=c;this.format=s;this.internalFormat=null;this.type=a;this.offset=new di(0,0);this.repeat=new di(1,1);this.center=new di(0,0);this.rotation=0;this.matrixAutoUpdate=true;this.matrix=new hi;this.generateMipmaps=true;this.premultiplyAlpha=false;this.flipY=true;this.unpackAlignment=4;this.encoding=l;this.userData={};this.version=0;this.onUpdate=null;this.isRenderTargetTexture=false;this.needsPMREMUpdate=false}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name;this.source=e.source;this.mipmaps=e.mipmaps.slice(0);this.mapping=e.mapping;this.channel=e.channel;this.wrapS=e.wrapS;this.wrapT=e.wrapT;this.magFilter=e.magFilter;this.minFilter=e.minFilter;this.anisotropy=e.anisotropy;this.format=e.format;this.internalFormat=e.internalFormat;this.type=e.type;this.offset.copy(e.offset);this.repeat.copy(e.repeat);this.center.copy(e.center);this.rotation=e.rotation;this.matrixAutoUpdate=e.matrixAutoUpdate;this.matrix.copy(e.matrix);this.generateMipmaps=e.generateMipmaps;this.premultiplyAlpha=e.premultiplyAlpha;this.flipY=e.flipY;this.unpackAlignment=e.unpackAlignment;this.encoding=e.encoding;this.userData=JSON.parse(JSON.stringify(e.userData));this.needsUpdate=true;return this}toJSON(e){const t=e===undefined||typeof e==="string";if(!t&&e.textures[this.uuid]!==undefined){return e.textures[this.uuid]}const i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(Object.keys(this.userData).length>0)i.userData=this.userData;if(!t){e.textures[this.uuid]=i}return i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ie)return e;e.applyMatrix3(this.matrix);if(e.x<0||e.x>1){switch(this.wrapS){case ce:e.x=e.x-Math.floor(e.x);break;case le:e.x=e.x<0?0:1;break;case de:if(Math.abs(Math.floor(e.x)%2)===1){e.x=Math.ceil(e.x)-e.x}else{e.x=e.x-Math.floor(e.x)}break}}if(e.y<0||e.y>1){switch(this.wrapT){case ce:e.y=e.y-Math.floor(e.y);break;case le:e.y=e.y<0?0:1;break;case de:if(Math.abs(Math.floor(e.y)%2)===1){e.y=Math.ceil(e.y)-e.y}else{e.y=e.y-Math.floor(e.y)}break}}if(this.flipY){e.y=1-e.y}return e}set needsUpdate(e){if(e===true){this.version++;this.source.needsUpdate=true}}}Oi.DEFAULT_IMAGE=null;Oi.DEFAULT_MAPPING=ie;Oi.DEFAULT_ANISOTROPY=1;class ki{constructor(e=0,t=0,i=0,n=1){ki.prototype.isVector4=true;this.x=e;this.y=t;this.z=i;this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){this.x=e;this.y=t;this.z=i;this.w=n;return this}setScalar(e){this.x=e;this.y=e;this.z=e;this.w=e;return this}setX(e){this.x=e;return this}setY(e){this.y=e;return this}setZ(e){this.z=e;return this}setW(e){this.w=e;return this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){this.x=e.x;this.y=e.y;this.z=e.z;this.w=e.w!==undefined?e.w:1;return this}add(e){this.x+=e.x;this.y+=e.y;this.z+=e.z;this.w+=e.w;return this}addScalar(e){this.x+=e;this.y+=e;this.z+=e;this.w+=e;return this}addVectors(e,t){this.x=e.x+t.x;this.y=e.y+t.y;this.z=e.z+t.z;this.w=e.w+t.w;return this}addScaledVector(e,t){this.x+=e.x*t;this.y+=e.y*t;this.z+=e.z*t;this.w+=e.w*t;return this}sub(e){this.x-=e.x;this.y-=e.y;this.z-=e.z;this.w-=e.w;return this}subScalar(e){this.x-=e;this.y-=e;this.z-=e;this.w-=e;return this}subVectors(e,t){this.x=e.x-t.x;this.y=e.y-t.y;this.z=e.z-t.z;this.w=e.w-t.w;return this}multiply(e){this.x*=e.x;this.y*=e.y;this.z*=e.z;this.w*=e.w;return this}multiplyScalar(e){this.x*=e;this.y*=e;this.z*=e;this.w*=e;return this}applyMatrix4(e){const t=this.x,i=this.y,n=this.z,o=this.w;const r=e.elements;this.x=r[0]*t+r[4]*i+r[8]*n+r[12]*o;this.y=r[1]*t+r[5]*i+r[9]*n+r[13]*o;this.z=r[2]*t+r[6]*i+r[10]*n+r[14]*o;this.w=r[3]*t+r[7]*i+r[11]*n+r[15]*o;return this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);if(t<1e-4){this.x=1;this.y=0;this.z=0}else{this.x=e.x/t;this.y=e.y/t;this.z=e.z/t}return this}setAxisAngleFromRotationMatrix(e){let t,i,n,o;const r=.01,s=.1,a=e.elements,c=a[0],l=a[4],d=a[8],h=a[1],f=a[5],p=a[9],u=a[2],m=a[6],v=a[10];if(Math.abs(l-h)<r&&Math.abs(d-u)<r&&Math.abs(p-m)<r){if(Math.abs(l+h)<s&&Math.abs(d+u)<s&&Math.abs(p+m)<s&&Math.abs(c+f+v-3)<s){this.set(1,0,0,0);return this}t=Math.PI;const e=(c+1)/2;const a=(f+1)/2;const _=(v+1)/2;const E=(l+h)/4;const g=(d+u)/4;const w=(p+m)/4;if(e>a&&e>_){if(e<r){i=0;n=.707106781;o=.707106781}else{i=Math.sqrt(e);n=E/i;o=g/i}}else if(a>_){if(a<r){i=.707106781;n=0;o=.707106781}else{n=Math.sqrt(a);i=E/n;o=w/n}}else{if(_<r){i=.707106781;n=.707106781;o=0}else{o=Math.sqrt(_);i=g/o;n=w/o}}this.set(i,n,o,t);return this}let _=Math.sqrt((m-p)*(m-p)+(d-u)*(d-u)+(h-l)*(h-l));if(Math.abs(_)<.001)_=1;this.x=(m-p)/_;this.y=(d-u)/_;this.z=(h-l)/_;this.w=Math.acos((c+f+v-1)/2);return this}min(e){this.x=Math.min(this.x,e.x);this.y=Math.min(this.y,e.y);this.z=Math.min(this.z,e.z);this.w=Math.min(this.w,e.w);return this}max(e){this.x=Math.max(this.x,e.x);this.y=Math.max(this.y,e.y);this.z=Math.max(this.z,e.z);this.w=Math.max(this.w,e.w);return this}clamp(e,t){this.x=Math.max(e.x,Math.min(t.x,this.x));this.y=Math.max(e.y,Math.min(t.y,this.y));this.z=Math.max(e.z,Math.min(t.z,this.z));this.w=Math.max(e.w,Math.min(t.w,this.w));return this}clampScalar(e,t){this.x=Math.max(e,Math.min(t,this.x));this.y=Math.max(e,Math.min(t,this.y));this.z=Math.max(e,Math.min(t,this.z));this.w=Math.max(e,Math.min(t,this.w));return this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this}roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z);this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w);return this}negate(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){this.x+=(e.x-this.x)*t;this.y+=(e.y-this.y)*t;this.z+=(e.z-this.z)*t;this.w+=(e.w-this.w)*t;return this}lerpVectors(e,t,i){this.x=e.x+(t.x-e.x)*i;this.y=e.y+(t.y-e.y)*i;this.z=e.z+(t.z-e.z)*i;this.w=e.w+(t.w-e.w)*i;return this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){this.x=e[t];this.y=e[t+1];this.z=e[t+2];this.w=e[t+3];return this}toArray(e=[],t=0){e[t]=this.x;e[t+1]=this.y;e[t+2]=this.z;e[t+3]=this.w;return e}fromBufferAttribute(e,t){this.x=e.getX(t);this.y=e.getY(t);this.z=e.getZ(t);this.w=e.getW(t);return this}random(){this.x=Math.random();this.y=Math.random();this.z=Math.random();this.w=Math.random();return this}*[Symbol.iterator](){yield this.x;yield this.y;yield this.z;yield this.w}}class Ni extends xt{constructor(e=1,t=1,i={}){super();this.isWebGLRenderTarget=true;this.width=e;this.height=t;this.depth=1;this.scissor=new ki(0,0,e,t);this.scissorTest=false;this.viewport=new ki(0,0,e,t);const n={width:e,height:t,depth:1};this.texture=new Oi(n,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding);this.texture.isRenderTargetTexture=true;this.texture.flipY=false;this.texture.generateMipmaps=i.generateMipmaps!==undefined?i.generateMipmaps:false;this.texture.internalFormat=i.internalFormat!==undefined?i.internalFormat:null;this.texture.minFilter=i.minFilter!==undefined?i.minFilter:ue;this.depthBuffer=i.depthBuffer!==undefined?i.depthBuffer:true;this.stencilBuffer=i.stencilBuffer!==undefined?i.stencilBuffer:false;this.depthTexture=i.depthTexture!==undefined?i.depthTexture:null;this.samples=i.samples!==undefined?i.samples:0}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e;this.height=t;this.depth=i;this.texture.image.width=e;this.texture.image.height=t;this.texture.image.depth=i;this.dispose()}this.viewport.set(0,0,e,t);this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width;this.height=e.height;this.depth=e.depth;this.viewport.copy(e.viewport);this.texture=e.texture.clone();this.texture.isRenderTargetTexture=true;const t=Object.assign({},e.texture.image);this.texture.source=new Ri(t);this.depthBuffer=e.depthBuffer;this.stencilBuffer=e.stencilBuffer;if(e.depthTexture!==null)this.depthTexture=e.depthTexture.clone();this.samples=e.samples;return this}dispose(){this.dispatchEvent({type:"dispose"})}}class Mi extends Oi{constructor(e=null,t=1,i=1,n=1){super(null);this.isDataArrayTexture=true;this.image={data:e,width:t,height:i,depth:n};this.magFilter=he;this.minFilter=he;this.wrapR=le;this.generateMipmaps=false;this.flipY=false;this.unpackAlignment=1}}class Di extends Oi{constructor(e=null,t=1,i=1,n=1){super(null);this.isData3DTexture=true;this.image={data:e,width:t,height:i,depth:n};this.magFilter=he;this.minFilter=he;this.wrapR=le;this.generateMipmaps=false;this.flipY=false;this.unpackAlignment=1}}class Ii{constructor(e=0,t=0,i=0,n=1){this.isQuaternion=true;this._x=e;this._y=t;this._z=i;this._w=n}static slerpFlat(e,t,i,n,o,r,s){let a=i[n+0],c=i[n+1],l=i[n+2],d=i[n+3];const h=o[r+0],f=o[r+1],p=o[r+2],u=o[r+3];if(s===0){e[t+0]=a;e[t+1]=c;e[t+2]=l;e[t+3]=d;return}if(s===1){e[t+0]=h;e[t+1]=f;e[t+2]=p;e[t+3]=u;return}if(d!==u||a!==h||c!==f||l!==p){let e=1-s;const t=a*h+c*f+l*p+d*u,i=t>=0?1:-1,n=1-t*t;if(n>Number.EPSILON){const o=Math.sqrt(n),r=Math.atan2(o,t*i);e=Math.sin(e*r)/o;s=Math.sin(s*r)/o}const o=s*i;a=a*e+h*o;c=c*e+f*o;l=l*e+p*o;d=d*e+u*o;if(e===1-s){const e=1/Math.sqrt(a*a+c*c+l*l+d*d);a*=e;c*=e;l*=e;d*=e}}e[t]=a;e[t+1]=c;e[t+2]=l;e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,n,o,r){const s=i[n];const a=i[n+1];const c=i[n+2];const l=i[n+3];const d=o[r];const h=o[r+1];const f=o[r+2];const p=o[r+3];e[t]=s*p+l*d+a*f-c*h;e[t+1]=a*p+l*h+c*d-s*f;e[t+2]=c*p+l*f+s*h-a*d;e[t+3]=l*p-s*d-a*h-c*f;return e}get x(){return this._x}set x(e){this._x=e;this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e;this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e;this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e;this._onChangeCallback()}set(e,t,i,n){this._x=e;this._y=t;this._z=i;this._w=n;this._onChangeCallback();return this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){this._x=e.x;this._y=e.y;this._z=e.z;this._w=e.w;this._onChangeCallback();return this}setFromEuler(e,t){const i=e._x,n=e._y,o=e._z,r=e._order;const s=Math.cos;const a=Math.sin;const c=s(i/2);const l=s(n/2);const d=s(o/2);const h=a(i/2);const f=a(n/2);const p=a(o/2);switch(r){case"XYZ":this._x=h*l*d+c*f*p;this._y=c*f*d-h*l*p;this._z=c*l*p+h*f*d;this._w=c*l*d-h*f*p;break;case"YXZ":this._x=h*l*d+c*f*p;this._y=c*f*d-h*l*p;this._z=c*l*p-h*f*d;this._w=c*l*d+h*f*p;break;case"ZXY":this._x=h*l*d-c*f*p;this._y=c*f*d+h*l*p;this._z=c*l*p+h*f*d;this._w=c*l*d-h*f*p;break;case"ZYX":this._x=h*l*d-c*f*p;this._y=c*f*d+h*l*p;this._z=c*l*p-h*f*d;this._w=c*l*d+h*f*p;break;case"YZX":this._x=h*l*d+c*f*p;this._y=c*f*d+h*l*p;this._z=c*l*p-h*f*d;this._w=c*l*d-h*f*p;break;case"XZY":this._x=h*l*d-c*f*p;this._y=c*f*d-h*l*p;this._z=c*l*p+h*f*d;this._w=c*l*d+h*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+r)}if(t!==false)this._onChangeCallback();return this}setFromAxisAngle(e,t){const i=t/2,n=Math.sin(i);this._x=e.x*n;this._y=e.y*n;this._z=e.z*n;this._w=Math.cos(i);this._onChangeCallback();return this}setFromRotationMatrix(e){const t=e.elements,i=t[0],n=t[4],o=t[8],r=t[1],s=t[5],a=t[9],c=t[2],l=t[6],d=t[10],h=i+s+d;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e;this._x=(l-a)*e;this._y=(o-c)*e;this._z=(r-n)*e}else if(i>s&&i>d){const e=2*Math.sqrt(1+i-s-d);this._w=(l-a)/e;this._x=.25*e;this._y=(n+r)/e;this._z=(o+c)/e}else if(s>d){const e=2*Math.sqrt(1+s-i-d);this._w=(o-c)/e;this._x=(n+r)/e;this._y=.25*e;this._z=(a+l)/e}else{const e=2*Math.sqrt(1+d-i-s);this._w=(r-n)/e;this._x=(o+c)/e;this._y=(a+l)/e;this._z=.25*e}this._onChangeCallback();return this}setFromUnitVectors(e,t){let i=e.dot(t)+1;if(i<Number.EPSILON){i=0;if(Math.abs(e.x)>Math.abs(e.z)){this._x=-e.y;this._y=e.x;this._z=0;this._w=i}else{this._x=0;this._y=-e.z;this._z=e.y;this._w=i}}else{this._x=e.y*t.z-e.z*t.y;this._y=e.z*t.x-e.x*t.z;this._z=e.x*t.y-e.y*t.x;this._w=i}return this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Gt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const n=Math.min(1,t/i);this.slerp(e,n);return this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){this._x*=-1;this._y*=-1;this._z*=-1;this._onChangeCallback();return this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();if(e===0){this._x=0;this._y=0;this._z=0;this._w=1}else{e=1/e;this._x=this._x*e;this._y=this._y*e;this._z=this._z*e;this._w=this._w*e}this._onChangeCallback();return this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,n=e._y,o=e._z,r=e._w;const s=t._x,a=t._y,c=t._z,l=t._w;this._x=i*l+r*s+n*c-o*a;this._y=n*l+r*a+o*s-i*c;this._z=o*l+r*c+i*a-n*s;this._w=r*l-i*s-n*a-o*c;this._onChangeCallback();return this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,n=this._y,o=this._z,r=this._w;let s=r*e._w+i*e._x+n*e._y+o*e._z;if(s<0){this._w=-e._w;this._x=-e._x;this._y=-e._y;this._z=-e._z;s=-s}else{this.copy(e)}if(s>=1){this._w=r;this._x=i;this._y=n;this._z=o;return this}const a=1-s*s;if(a<=Number.EPSILON){const e=1-t;this._w=e*r+t*this._w;this._x=e*i+t*this._x;this._y=e*n+t*this._y;this._z=e*o+t*this._z;this.normalize();this._onChangeCallback();return this}const c=Math.sqrt(a);const l=Math.atan2(c,s);const d=Math.sin((1-t)*l)/c,h=Math.sin(t*l)/c;this._w=r*d+this._w*h;this._x=i*d+this._x*h;this._y=n*d+this._y*h;this._z=o*d+this._z*h;this._onChangeCallback();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=Math.random();const t=Math.sqrt(1-e);const i=Math.sqrt(e);const n=2*Math.PI*Math.random();const o=2*Math.PI*Math.random();return this.set(t*Math.cos(n),i*Math.sin(o),i*Math.cos(o),t*Math.sin(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){this._x=e[t];this._y=e[t+1];this._z=e[t+2];this._w=e[t+3];this._onChangeCallback();return this}toArray(e=[],t=0){e[t]=this._x;e[t+1]=this._y;e[t+2]=this._z;e[t+3]=this._w;return e}fromBufferAttribute(e,t){this._x=e.getX(t);this._y=e.getY(t);this._z=e.getZ(t);this._w=e.getW(t);return this}toJSON(){return this.toArray()}_onChange(e){this._onChangeCallback=e;return this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x;yield this._y;yield this._z;yield this._w}}class Fi{constructor(e=0,t=0,i=0){Fi.prototype.isVector3=true;this.x=e;this.y=t;this.z=i}set(e,t,i){if(i===undefined)i=this.z;this.x=e;this.y=t;this.z=i;return this}setScalar(e){this.x=e;this.y=e;this.z=e;return this}setX(e){this.x=e;return this}setY(e){this.y=e;return this}setZ(e){this.z=e;return this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){this.x=e.x;this.y=e.y;this.z=e.z;return this}add(e){this.x+=e.x;this.y+=e.y;this.z+=e.z;return this}addScalar(e){this.x+=e;this.y+=e;this.z+=e;return this}addVectors(e,t){this.x=e.x+t.x;this.y=e.y+t.y;this.z=e.z+t.z;return this}addScaledVector(e,t){this.x+=e.x*t;this.y+=e.y*t;this.z+=e.z*t;return this}sub(e){this.x-=e.x;this.y-=e.y;this.z-=e.z;return this}subScalar(e){this.x-=e;this.y-=e;this.z-=e;return this}subVectors(e,t){this.x=e.x-t.x;this.y=e.y-t.y;this.z=e.z-t.z;return this}multiply(e){this.x*=e.x;this.y*=e.y;this.z*=e.z;return this}multiplyScalar(e){this.x*=e;this.y*=e;this.z*=e;return this}multiplyVectors(e,t){this.x=e.x*t.x;this.y=e.y*t.y;this.z=e.z*t.z;return this}applyEuler(e){return this.applyQuaternion(Pi.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Pi.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,n=this.z;const o=e.elements;this.x=o[0]*t+o[3]*i+o[6]*n;this.y=o[1]*t+o[4]*i+o[7]*n;this.z=o[2]*t+o[5]*i+o[8]*n;return this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,n=this.z;const o=e.elements;const r=1/(o[3]*t+o[7]*i+o[11]*n+o[15]);this.x=(o[0]*t+o[4]*i+o[8]*n+o[12])*r;this.y=(o[1]*t+o[5]*i+o[9]*n+o[13])*r;this.z=(o[2]*t+o[6]*i+o[10]*n+o[14])*r;return this}applyQuaternion(e){const t=this.x,i=this.y,n=this.z;const o=e.x,r=e.y,s=e.z,a=e.w;const c=a*t+r*n-s*i;const l=a*i+s*t-o*n;const d=a*n+o*i-r*t;const h=-o*t-r*i-s*n;this.x=c*a+h*-o+l*-s-d*-r;this.y=l*a+h*-r+d*-o-c*-s;this.z=d*a+h*-s+c*-r-l*-o;return this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,n=this.z;const o=e.elements;this.x=o[0]*t+o[4]*i+o[8]*n;this.y=o[1]*t+o[5]*i+o[9]*n;this.z=o[2]*t+o[6]*i+o[10]*n;return this.normalize()}divide(e){this.x/=e.x;this.y/=e.y;this.z/=e.z;return this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){this.x=Math.min(this.x,e.x);this.y=Math.min(this.y,e.y);this.z=Math.min(this.z,e.z);return this}max(e){this.x=Math.max(this.x,e.x);this.y=Math.max(this.y,e.y);this.z=Math.max(this.z,e.z);return this}clamp(e,t){this.x=Math.max(e.x,Math.min(t.x,this.x));this.y=Math.max(e.y,Math.min(t.y,this.y));this.z=Math.max(e.z,Math.min(t.z,this.z));return this}clampScalar(e,t){this.x=Math.max(e,Math.min(t,this.x));this.y=Math.max(e,Math.min(t,this.y));this.z=Math.max(e,Math.min(t,this.z));return this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this}roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z);return this}negate(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){this.x+=(e.x-this.x)*t;this.y+=(e.y-this.y)*t;this.z+=(e.z-this.z)*t;return this}lerpVectors(e,t,i){this.x=e.x+(t.x-e.x)*i;this.y=e.y+(t.y-e.y)*i;this.z=e.z+(t.z-e.z)*i;return this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,n=e.y,o=e.z;const r=t.x,s=t.y,a=t.z;this.x=n*a-o*s;this.y=o*r-i*a;this.z=i*s-n*r;return this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){xi.copy(this).projectOnVector(e);return this.sub(xi)}reflect(e){return this.sub(xi.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Gt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const n=Math.sin(t)*e;this.x=n*Math.sin(i);this.y=Math.cos(t)*e;this.z=n*Math.cos(i);return this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){this.x=e*Math.sin(t);this.y=i;this.z=e*Math.cos(t);return this}setFromMatrixPosition(e){const t=e.elements;this.x=t[12];this.y=t[13];this.z=t[14];return this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length();const i=this.setFromMatrixColumn(e,1).length();const n=this.setFromMatrixColumn(e,2).length();this.x=t;this.y=i;this.z=n;return this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){this.x=e._x;this.y=e._y;this.z=e._z;return this}setFromColor(e){this.x=e.r;this.y=e.g;this.z=e.b;return this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){this.x=e[t];this.y=e[t+1];this.z=e[t+2];return this}toArray(e=[],t=0){e[t]=this.x;e[t+1]=this.y;e[t+2]=this.z;return e}fromBufferAttribute(e,t){this.x=e.getX(t);this.y=e.getY(t);this.z=e.getZ(t);return this}random(){this.x=Math.random();this.y=Math.random();this.z=Math.random();return this}randomDirection(){const e=(Math.random()-.5)*2;const t=Math.random()*Math.PI*2;const i=Math.sqrt(1-e**2);this.x=i*Math.cos(t);this.y=i*Math.sin(t);this.z=e;return this}*[Symbol.iterator](){yield this.x;yield this.y;yield this.z}}const xi=new Fi;const Pi=new Ii;class Ui{constructor(e=new Fi(+Infinity,+Infinity,+Infinity),t=new Fi(-Infinity,-Infinity,-Infinity)){this.isBox3=true;this.min=e;this.max=t}set(e,t){this.min.copy(e);this.max.copy(t);return this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3){this.expandByPoint(Bi.fromArray(e,t))}return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++){this.expandByPoint(Bi.fromBufferAttribute(e,t))}return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++){this.expandByPoint(e[t])}return this}setFromCenterAndSize(e,t){const i=Bi.copy(t).multiplyScalar(.5);this.min.copy(e).sub(i);this.max.copy(e).add(i);return this}setFromObject(e,t=false){this.makeEmpty();return this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.min.copy(e.min);this.max.copy(e.max);return this}makeEmpty(){this.min.x=this.min.y=this.min.z=+Infinity;this.max.x=this.max.y=this.max.z=-Infinity;return this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){this.min.min(e);this.max.max(e);return this}expandByVector(e){this.min.sub(e);this.max.add(e);return this}expandByScalar(e){this.min.addScalar(-e);this.max.addScalar(e);return this}expandByObject(e,t=false){e.updateWorldMatrix(false,false);if(e.boundingBox!==undefined){if(e.boundingBox===null){e.computeBoundingBox()}Hi.copy(e.boundingBox);Hi.applyMatrix4(e.matrixWorld);this.union(Hi)}else{const i=e.geometry;if(i!==undefined){if(t&&i.attributes!==undefined&&i.attributes.position!==undefined){const t=i.attributes.position;for(let i=0,n=t.count;i<n;i++){Bi.fromBufferAttribute(t,i).applyMatrix4(e.matrixWorld);this.expandByPoint(Bi)}}else{if(i.boundingBox===null){i.computeBoundingBox()}Hi.copy(i.boundingBox);Hi.applyMatrix4(e.matrixWorld);this.union(Hi)}}}const i=e.children;for(let e=0,n=i.length;e<n;e++){this.expandByObject(i[e],t)}return this}containsPoint(e){return e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z?false:true}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z?false:true}intersectsSphere(e){this.clampPoint(e.center,Bi);return Bi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;if(e.normal.x>0){t=e.normal.x*this.min.x;i=e.normal.x*this.max.x}else{t=e.normal.x*this.max.x;i=e.normal.x*this.min.x}if(e.normal.y>0){t+=e.normal.y*this.min.y;i+=e.normal.y*this.max.y}else{t+=e.normal.y*this.max.y;i+=e.normal.y*this.min.y}if(e.normal.z>0){t+=e.normal.z*this.min.z;i+=e.normal.z*this.max.z}else{t+=e.normal.z*this.max.z;i+=e.normal.z*this.min.z}return t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty()){return false}this.getCenter(Yi);Zi.subVectors(this.max,Yi);Gi.subVectors(e.a,Yi);Wi.subVectors(e.b,Yi);ji.subVectors(e.c,Yi);zi.subVectors(Wi,Gi);Ki.subVectors(ji,Wi);Xi.subVectors(Gi,ji);let t=[0,-zi.z,zi.y,0,-Ki.z,Ki.y,0,-Xi.z,Xi.y,zi.z,0,-zi.x,Ki.z,0,-Ki.x,Xi.z,0,-Xi.x,-zi.y,zi.x,0,-Ki.y,Ki.x,0,-Xi.y,Xi.x,0];if(!Ji(t,Gi,Wi,ji,Zi)){return false}t=[1,0,0,0,1,0,0,0,1];if(!Ji(t,Gi,Wi,ji,Zi)){return false}$i.crossVectors(zi,Ki);t=[$i.x,$i.y,$i.z];return Ji(t,Gi,Wi,ji,Zi)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Bi).distanceTo(e)}getBoundingSphere(e){if(this.isEmpty()){e.makeEmpty()}else{this.getCenter(e.center);e.radius=this.getSize(Bi).length()*.5}return e}intersect(e){this.min.max(e.min);this.max.min(e.max);if(this.isEmpty())this.makeEmpty();return this}union(e){this.min.min(e.min);this.max.max(e.max);return this}applyMatrix4(e){if(this.isEmpty())return this;Vi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e);Vi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e);Vi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e);Vi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e);Vi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e);Vi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e);Vi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e);Vi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e);this.setFromPoints(Vi);return this}translate(e){this.min.add(e);this.max.add(e);return this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Vi=[new Fi,new Fi,new Fi,new Fi,new Fi,new Fi,new Fi,new Fi];const Bi=new Fi;const Hi=new Ui;const Gi=new Fi;const Wi=new Fi;const ji=new Fi;const zi=new Fi;const Ki=new Fi;const Xi=new Fi;const Yi=new Fi;const Zi=new Fi;const $i=new Fi;const qi=new Fi;function Ji(e,t,i,n,o){for(let r=0,s=e.length-3;r<=s;r+=3){qi.fromArray(e,r);const s=o.x*Math.abs(qi.x)+o.y*Math.abs(qi.y)+o.z*Math.abs(qi.z);const a=t.dot(qi);const c=i.dot(qi);const l=n.dot(qi);if(Math.max(-Math.max(a,c,l),Math.min(a,c,l))>s){return false}}return true}const Qi=new Ui;const en=new Fi;const tn=new Fi;class nn{constructor(e=new Fi,t=-1){this.center=e;this.radius=t}set(e,t){this.center.copy(e);this.radius=t;return this}setFromPoints(e,t){const i=this.center;if(t!==undefined){i.copy(t)}else{Qi.setFromPoints(e).getCenter(i)}let n=0;for(let t=0,o=e.length;t<o;t++){n=Math.max(n,i.distanceToSquared(e[t]))}this.radius=Math.sqrt(n);return this}copy(e){this.center.copy(e.center);this.radius=e.radius;return this}isEmpty(){return this.radius<0}makeEmpty(){this.center.set(0,0,0);this.radius=-1;return this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);t.copy(e);if(i>this.radius*this.radius){t.sub(this.center).normalize();t.multiplyScalar(this.radius).add(this.center)}return t}getBoundingBox(e){if(this.isEmpty()){e.makeEmpty();return e}e.set(this.center,this.center);e.expandByScalar(this.radius);return e}applyMatrix4(e){this.center.applyMatrix4(e);this.radius=this.radius*e.getMaxScaleOnAxis();return this}translate(e){this.center.add(e);return this}expandByPoint(e){if(this.isEmpty()){this.center.copy(e);this.radius=0;return this}en.subVectors(e,this.center);const t=en.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t);const i=(e-this.radius)*.5;this.center.addScaledVector(en,i/e);this.radius+=i}return this}union(e){if(e.isEmpty()){return this}if(this.isEmpty()){this.copy(e);return this}if(this.center.equals(e.center)===true){this.radius=Math.max(this.radius,e.radius)}else{tn.subVectors(e.center,this.center).setLength(e.radius);this.expandByPoint(en.copy(e.center).add(tn));this.expandByPoint(en.copy(e.center).sub(tn))}return this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const on=new Fi;const rn=new Fi;const sn=new Fi;const an=new Fi;const cn=new Fi;const ln=new Fi;const dn=new Fi;class hn{constructor(e=new Fi,t=new Fi(0,0,-1)){this.origin=e;this.direction=t}set(e,t){this.origin.copy(e);this.direction.copy(t);return this}copy(e){this.origin.copy(e.origin);this.direction.copy(e.direction);return this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){this.direction.copy(e).sub(this.origin).normalize();return this}recast(e){this.origin.copy(this.at(e,on));return this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);if(i<0){return t.copy(this.origin)}return t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=on.subVectors(e,this.origin).dot(this.direction);if(t<0){return this.origin.distanceToSquared(e)}on.copy(this.origin).addScaledVector(this.direction,t);return on.distanceToSquared(e)}distanceSqToSegment(e,t,i,n){rn.copy(e).add(t).multiplyScalar(.5);sn.copy(t).sub(e).normalize();an.copy(this.origin).sub(rn);const o=e.distanceTo(t)*.5;const r=-this.direction.dot(sn);const s=an.dot(this.direction);const a=-an.dot(sn);const c=an.lengthSq();const l=Math.abs(1