PageSourceSearch

https://gogethired.io/_next/static/chunks/9713.c8a624d6a50e08f4.js

js gogethired.io collected 2026-10-02 01:58:48 UTC 146,447 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9713],{13473:(e,t,r)=>{r.d(t,{Z:()=>n});var s=r(60043);let i=new WeakMap;class n extends s.aHM{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,r,i){let n=new s.Y9S(this.manager);n.setPath(this.path),n.setResponseType("arraybuffer"),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(e,e=>{this.parse(e,t,i)},r,i)}parse(e,t,r=()=>{}){this.decodeDracoFile(e,t,null,null,s.er$,r).catch(r)}decodeDracoFile(e,t,r,i,n=s.Zr2,a=()=>{}){let o={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!r,vertexColorSpace:n};return this.decodeGeometry(e,o).then(t).catch(a)}decodeGeometry(e,t){let r,s=JSON.stringify(t);if(i.has(e)){let t=i.get(e);if(t.key===s)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(n,a).then(s=>(r=s,new Promise((s,i)=>{r._callbacks[n]={resolve:s,reject:i},r.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{r&&n&&this._releaseTask(r,n)}),i.set(e,{key:s,promise:o}),o}_createGeometry(e){let t=new s.LoY;e.index&&t.setIndex(new s.THS(e.index.array,1));for(let r=0;r<e.attributes.length;r++){let i=e.attributes[r],n=i.name,a=i.array,o=i.itemSize,l=new s.THS(a,o);"color"===n&&(this._assignVertexColorSpace(l,i.vertexColorSpace),l.normalized=a instanceof Float32Array==!1),t.setAttribute(n,l)}return t}_assignVertexColorSpace(e,t){if(t!==s.er$)return;let r=new s.Q1f;for(let t=0,i=e.count;t<i;t++)r.fromBufferAttribute(e,t),s.ppV.colorSpaceToWorking(r,s.er$),e.setXYZ(t,r.r,r.g,r.b)}_loadLibrary(e,t){let r=new s.Y9S(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),r.setWithCredentials(this.withCredentials),new Promise((t,s)=>{r.load(e,t,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(t=>{let r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let s=a.toString(),i=["/* draco decoder */",r,"\n/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){let r=t.data;switch(r.type){case"decode":e._callbacks[r.id].resolve(r);break;case"error":e._callbacks[r.id].reject(r);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+r.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,""!==this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),this}}function a(){let e,t;onmessage=function(r){let s=r.data;switch(s.type){case"init":e=s.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case"decode":let i=s.buffer,n=s.taskConfig;t.then(e=>{let t=e.draco,r=new t.Decoder;try{let e=function(e,t,r,s){var i,n,a;let o,l,h,c,u,d,p=s.attributeIDs,m=s.attributeTypes,f=t.GetEncodedGeometryType(r);if(f===e.TRIANGULAR_MESH)u=new e.Mesh,d=t.DecodeArrayToMesh(r,r.byteLength,u);else if(f===e.POINT_CLOUD)u=new e.PointCloud,d=t.DecodeArrayToPointCloud(r,r.byteLength,u);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!d.ok()||0===u.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+d.error_msg());let g={index:null,attributes:[]};for(let r in p){let i,n,a=self[m[r]];if(s.useUniqueIDs)n=p[r],i=t.GetAttributeByUniqueId(u,n);else{if(-1===(n=t.GetAttributeId(u,e[p[r]])))continue;i=t.GetAttribute(u,n)}
1let o=function(e,t,r,s,i,n){let a=n.num_components(),o=r.num_points()*a,l=o*i.BYTES_PER_ELEMENT,h=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(r,n,h,l,c);let u=new i(e.HEAPF32.buffer,c,o).slice();return e._free(c),{name:s,array:u,itemSize:a}}(e,t,u,r,a,i);"color"===r&&(o.vertexColorSpace=s.vertexColorSpace),g.attributes.push(o)}return f===e.TRIANGULAR_MESH&&(i=e,n=t,a=u,o=3*a.num_faces(),l=4*o,h=i._malloc(l),n.GetTrianglesUInt32Array(a,l,h),c=new Uint32Array(i.HEAPF32.buffer,h,o).slice(),i._free(h),g.index={array:c,itemSize:1}),e.destroy(u),g}(t,r,new Int8Array(i),n),a=e.attributes.map(e=>e.array.buffer);e.index&&a.push(e.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:e},a)}catch(e){console.error(e),self.postMessage({type:"error",id:s.id,error:e.message})}finally{t.destroy(r)}})}}}},50846:(e,t,r)=>{r.d(t,{B:()=>n});var s=r(60043);function i(e,t){if(t===s.RJ4)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==s.rYR&&t!==s.O49)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],s=e.getAttribute("position");if(void 0===s)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<s.count;e++)t.push(e);e.setIndex(t),r=e.getIndex()}let i=r.count-2,n=[];if(t===s.rYR)for(let e=1;e<=i;e++)n.push(r.getX(0)),n.push(r.getX(e)),n.push(r.getX(e+1));else for(let e=0;e<i;e++)e%2==0?(n.push(r.getX(e)),n.push(r.getX(e+1)),n.push(r.getX(e+2))):(n.push(r.getX(e+2)),n.push(r.getX(e+1)),n.push(r.getX(e)));n.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let a=e.clone();return a.setIndex(n),a.clearGroups(),a}}class n extends s.aHM{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new u(e)}),this.register(function(e){return new d(e)}),this.register(function(e){return new x(e)}),this.register(function(e){return new w(e)}),this.register(function(e){return new E(e)}),this.register(function(e){return new m(e)}),this.register(function(e){return new f(e)}),this.register(function(e){return new g(e)}),this.register(function(e){return new v(e)}),this.register(function(e){return new c(e)}),this.register(function(e){return new y(e)}),this.register(function(e){return new p(e)}),this.register(function(e){return new T(e)}),this.register(function(e){return new b(e)}),this.register(function(e){return new l(e)}),this.register(function(e){return new _(e)}),this.register(function(e){return new R(e)})}load(e,t,r,i){let n,a=this;if(""!==this.resourcePath)n=this.resourcePath;else if(""!==this.path){let t=s.r6x.extractUrlBase(e);n=s.r6x.resolveURL(t,this.path)}else n=s.r6x.extractUrlBase(e);this.manager.itemStart(e);let o=function(t){i?i(t):console.error(t),a.manager.itemError(e),a.manager.itemEnd(e)},l=new s.Y9S(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(r){try{a.parse(r,n,function(r){t(r),a.manager.itemEnd(e)},o)}catch(e){o(e)}},r,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return -1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return -1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,r,s){let i,n={},a={},l=new TextDecoder;if("string"==typeof e)i=JSON.parse(e);else if(e instanceof ArrayBuffer)if(l.decode(new Uint8Array(e,0,4))===S){try{n[o.KHR_BINARY_GLTF]=new I(e)}catch(e){s&&s(e);return}i=JSON.parse(n[o.KHR_BINARY_GLTF].content)}else i=JSON.parse(l.decode(e));else i=e;if(void 0===i.asset||i.asset.version[0]<2){s&&s(Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new K(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){let t=this.pluginCallbacks[e](c);t.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[t.name]=t,n[t.name]=!0}if(i.extensionsUsed)for(let e=0;e<i.extensionsUsed.length;++e){let t=i.extensionsUsed[e],r=i.extensionsRequired||[];switch(t){case o.KHR_MATERIALS_UNLIT:n[t]=new h;break;case o.KHR_DRACO_MESH_COMPRESSION:n[t]=new P(i,this.dracoLoader);break;case o.KHR_TEXTURE_TRANSFORM:n[t]=new A;break;
1case o.KHR_MESH_QUANTIZATION:n[t]=new k;break;default:r.indexOf(t)>=0&&void 0===a[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}c.setExtensions(n),c.setPlugins(a),c.parse(r,s)}parseAsync(e,t){let r=this;return new Promise(function(s,i){r.parse(e,t,s,i)})}}function a(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let o={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class l{constructor(e){this.parser=e,this.name=o.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,s=t.length;r<s;r++){let s=t[r];s.extensions&&s.extensions[this.name]&&void 0!==s.extensions[this.name].light&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){let t,r=this.parser,i="light:"+e,n=r.cache.get(i);if(n)return n;let a=r.json,o=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e],l=new s.Q1f(0xffffff);void 0!==o.color&&l.setRGB(o.color[0],o.color[1],o.color[2],s.Zr2);let h=void 0!==o.range?o.range:0;switch(o.type){case"directional":(t=new s.ZyN(l)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new s.HiM(l)).distance=h;break;case"spot":(t=new s.nCl(l)).distance=h,o.spot=o.spot||{},o.spot.innerConeAngle=void 0!==o.spot.innerConeAngle?o.spot.innerConeAngle:0,o.spot.outerConeAngle=void 0!==o.spot.outerConeAngle?o.spot.outerConeAngle:Math.PI/4,t.angle=o.spot.outerConeAngle,t.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return t.position.set(0,0,0),W(t,o),void 0!==o.intensity&&(t.intensity=o.intensity),t.name=r.createUniqueName(o.name||"light_"+e),n=Promise.resolve(t),r.cache.add(i,n),n}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){let t=this,r=this.parser,s=r.json.nodes[e],i=(s.extensions&&s.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then(function(e){return r._getNodeRef(t.cache,i,e)})}}class h{constructor(){this.name=o.KHR_MATERIALS_UNLIT}getMaterialType(){return s.V9B}extendParams(e,t,r){let i=[];e.color=new s.Q1f(1,1,1),e.opacity=1;let n=t.pbrMetallicRoughness;if(n){if(Array.isArray(n.baseColorFactor)){let t=n.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],s.Zr2),e.opacity=t[3]}void 0!==n.baseColorTexture&&i.push(r.assignTexture(e,"map",n.baseColorTexture,s.er$))}return Promise.all(i)}}class c{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let s=r.extensions[this.name].emissiveStrength;return void 0!==s&&(t.emissiveIntensity=s),Promise.resolve()}}class u{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.uSd:null}extendMaterialParams(e,t){let r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=[],a=i.extensions[this.name];if(void 0!==a.clearcoatFactor&&(t.clearcoat=a.clearcoatFactor),void 0!==a.clearcoatTexture&&n.push(r.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),void 0!==a.clearcoatRoughnessFactor&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),void 0!==a.clearcoatRoughnessTexture&&n.push(r.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),void 0!==a.clearcoatNormalTexture&&(n.push(r.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),void 0!==a.clearcoatNormalTexture.scale)){let e=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new s.I9Y(e,e)}return Promise.all(n)}}class d{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_DISPERSION}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.uSd:null}extendMaterialParams(e,t){let r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let s=r.extensions[this.name];return t.dispersion=void 0!==s.dispersion?s.dispersion:0,Promise.resolve()}}class p{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.uSd:null}extendMaterialParams(e,t){let r=this.parser,s=r.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let i=[],n=s.extensions[this.name];return void 0!==n.iridescenceFactor&&(t.iridescence=n.iridescenceFactor),void 0!==n.iridescenceTexture&&i.push(r.assignTexture(t,"iridescenceMap",n.iridescenceTexture)),void 0!==n.iridescenceIor&&(t.iridescenceIOR=n.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==n.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=n.iridescenceThicknessMinimum),void 0!==n.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=n.iridescenceThicknessMaximum),void 0!==n.iridescenceThicknessTexture&&i.push(r.assignTexture(t,"iridescenceThicknessMap",n.iridescenceThicknessTexture)),Promise.all(i)}}class m{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_SHEEN}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.uSd:null}extendMaterialParams(e,t){let r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=[];t.sheenColor=new s.Q1f(0,0,0),t.sheenRoughness=0,t.sheen=1;let a=i.extensions[this.name];if(void 0!==a.sheenColorFactor){let e=a.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],s.Zr2)}return void 0!==a.sheenRoughnessFactor&&(t.sheenRoughness=a.sheenRoughnessFactor),void 0!==a.sheenColorTexture&&n.push(r.assignTexture(t,"sheenColorMap",a.sheenColorTexture,s.er$)),void 0!==a.sheenRoughnessTexture&&n.push(r.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(n)}}class f{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.uSd:null}extendMaterialParams(e,t){let r=this.parser,s=r.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let i=[],n=s.extensions[this.name];return void 0!==n.transmissionFactor&&(t.transmission=n.transmissionFactor),void 0!==n.transmissionTexture&&i.push(r.assignTexture(t,"transmissionMap",n.transmissionTexture)),Promise.all(i)}}class g{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_VOLUME}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.uSd:null}extendMaterialParams(e,t){let r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=[],a=i.extensions[this.name];t.thickness=void 0!==a.thicknessFactor?a.thicknessFactor:0,void 0!==a.thicknessTexture&&n.push(r.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||1/0;let o=a.attenuationColor||[1,1,1];return t.attenuationColor=new s.Q1f().setRGB(o[0],o[1],o[2],s.Zr2),Promise.all(n)}}class v{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_IOR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.uSd:null}extendMaterialParams(e,t){let r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let s=r.extensions[this.name];return t.ior=void 0!==s.ior?s.ior:1.5,Promise.resolve()}}class y{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_SPECULAR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.uSd:null}extendMaterialParams(e,t){let r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=[],a=i.extensions[this.name];t.specularIntensity=void 0!==a.specularFactor?a.specularFactor:1,void 0!==a.specularTexture&&n.push(r.assignTexture(t,"specularIntensityMap",a.specularTexture));let o=a.specularColorFactor||[1,1,1];return t.specularColor=new s.Q1f().setRGB(o[0],o[1],o[2],s.Zr2),void 0!==a.specularColorTexture&&n.push(r.assignTexture(t,"specularColorMap",a.specularColorTexture,s.er$)),Promise.all(n)}}class b{constructor(e){this.parser=e,this.name=o.EXT_MATERIALS_BUMP}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.uSd:null}extendMaterialParams(e,t){let r=this.parser,s=r.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let i=[],n=s.extensions[this.name];return t.bumpScale=void 0!==n.bumpFactor?n.bumpFactor:1,void 0!==n.bumpTexture&&i.push(r.assignTexture(t,"bumpMap",n.bumpTexture)),Promise.all(i)}}class T{constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?s.uSd:null}extendMaterialParams(e,t){let r=this.parser,s=r.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let i=[],n=s.extensions[this.name];return void 0!==n.anisotropyStrength&&(t.anisotropy=n.anisotropyStrength),void 0!==n.anisotropyRotation&&(t.anisotropyRotation=n.anisotropyRotation),void 0!==n.anisotropyTexture&&i.push(r.assignTexture(t,"anisotropyMap",n.anisotropyTexture)),Promise.all(i)}}class x{constructor(e){this.parser=e,this.name=o.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,r=t.json,s=r.textures[e];if(!s.extensions||!s.extensions[this.name])return null;let i=s.extensions[this.name],n=t.options.ktx2Loader;if(!n)if(!(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,i.source,n)}}class w{constructor(e){this.parser=e,this.name=o.EXT_TEXTURE_WEBP}loadTexture(e){let t=this.name,r=this.parser,s=r.json,i=s.textures[e];if(!i.extensions||!i.extensions[t])return null;let n=i.extensions[t],a=s.images[n.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return r.loadTextureImage(e,n.source,o)}}class E{constructor(e){this.parser=e,this.name=o.EXT_TEXTURE_AVIF}loadTexture(e){let t=this.name,r=this.parser,s=r.json,i=s.textures[e];if(!i.extensions||!i.extensions[t])return null;let n=i.extensions[t],a=s.images[n.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return r.loadTextureImage(e,n.source,o)}}class _{constructor(e){this.name=o.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,r=t.bufferViews[e];if(!r.extensions||!r.extensions[this.name])return null;{let e=r.extensions[this.name],s=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported)if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return s.then(function(t){let r=e.byteOffset||0,s=e.byteLength||0,n=e.count,a=e.byteStride,o=new Uint8Array(t,r,s);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(n,a,o,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(n*a);return i.decodeGltfBuffer(new Uint8Array(t),n,a,o,e.mode,e.filter),t})})}}}class R{constructor(e){this.name=o.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;for(let e of t.meshes[r.mesh].primitives)if(e.mode!==N.TRIANGLES&&e.mode!==N.TRIANGLE_STRIP&&e.mode!==N.TRIANGLE_FAN&&void 0!==e.mode)return null;let i=r.extensions[this.name].attributes,n=[],a={};for(let e in i)n.push(this.parser.getDependency("accessor",i[e]).then(t=>(a[e]=t,a[e])));return n.length<1?null:(n.push(this.parser.createNodeMesh(e)),Promise.all(n).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],i=e[0].count,n=[];for(let e of r){let t=new s.kn4,r=new s.Pq0,o=new s.PTz,l=new s.Pq0(1,1,1),h=new s.ZLX(e.geometry,e.material,i);for(let e=0;e<i;e++)a.TRANSLATION&&r.fromBufferAttribute(a.TRANSLATION,e),a.ROTATION&&o.fromBufferAttribute(a.ROTATION,e),a.SCALE&&l.fromBufferAttribute(a.SCALE,e),h.setMatrixAt(e,t.compose(r,o,l));for(let t in a)if("_COLOR_0"===t){let e=a[t];h.instanceColor=new s.uWO(e.array,e.itemSize,e.normalized)}else"TRANSLATION"!==t&&"ROTATION"!==t&&"SCALE"!==t&&e.geometry.setAttribute(t,a[t]);s.B69.prototype.copy.call(h,e),this.parser.assignFinalMaterial(h),n.push(h)}return t.isGroup?(t.clear(),t.add(...n),t):n[0]}))}}let S="glTF";class I{constructor(e){this.name=o.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==S)throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw Error("THREE.GLTFLoader: Legacy binary file detected.");const s=this.header.length-12,i=new DataView(e,12);let n=0;for(;n<s;){const t=i.getUint32(n,!0);n+=4;const s=i.getUint32(n,!0);if(n+=4,0x4e4f534a===s){const s=new Uint8Array(e,12+n,t);this.content=r.decode(s)}else if(5130562===s){const r=12+n;this.body=e.slice(r,r+t)}n+=t}if(null===this.content)throw Error("THREE.GLTFLoader: JSON content not found.")}}class P{constructor(e,t){if(!t)throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=o.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let r=this.json,i=this.dracoLoader,n=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},l={},h={};for(let e in a)o[H[e]||e.toLowerCase()]=a[e];for(let t in e.attributes){let s=H[t]||t.toLowerCase();if(void 0!==a[t]){let i=r.accessors[e.attributes[t]],n=O[i.componentType];h[s]=n.name,l[s]=!0===i.normalized}}return t.getDependency("bufferView",n).then(function(e){return new Promise(function(t,r){i.decodeDracoFile(e,function(e){for(let t in e.attributes){let r=e.attributes[t],s=l[t];void 0!==s&&(r.normalized=s)}t(e)},o,h,s.Zr2,r)})})}}class A{constructor(){this.name=o.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(void 0===t.texCoord||t.texCoord===e.channel)&&void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.texCoord&&(e.channel=t.texCoord),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}
1class k{constructor(){this.name=o.KHR_MESH_QUANTIZATION}}class M extends s.lGw{constructor(e,t,r,s){super(e,t,r,s)}copySampleValue_(e){let t=this.resultBuffer,r=this.sampleValues,s=this.valueSize,i=e*s*3+s;for(let e=0;e!==s;e++)t[e]=r[i+e];return t}interpolate_(e,t,r,s){let i=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=2*a,l=3*a,h=s-t,c=(r-t)/h,u=c*c,d=u*c,p=e*l,m=p-l,f=-2*d+3*u,g=d-u,v=1-f,y=g-u+c;for(let e=0;e!==a;e++){let t=n[m+e+a],r=n[m+e+o]*h,s=n[p+e+a],l=n[p+e]*h;i[e]=v*t+y*r+f*s+g*l}return i}}let L=new s.PTz;class D extends M{interpolate_(e,t,r,s){let i=super.interpolate_(e,t,r,s);return L.fromArray(i).normalize().toArray(i),i}}let N={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},O={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},C={9728:s.hxR,9729:s.k6q,9984:s.pHI,9985:s.kRr,9986:s.Cfg,9987:s.$_I},F={33071:s.ghU,33648:s.kTW,10497:s.GJx},U={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},H={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},j={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},B={CUBICSPLINE:void 0,LINEAR:s.PJ3,STEP:s.ljd};function G(e,t,r){for(let s in r.extensions)void 0===e[s]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[s]=r.extensions[s])}function W(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function z(e){let t="",r=Object.keys(e).sort();for(let s=0,i=r.length;s<i;s++)t+=r[s]+":"+e[r[s]]+";";return t}function V(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}let X=new s.kn4;class K{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new a,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=-1,n=!1,o=-1;if("undefined"!=typeof navigator){const e=navigator.userAgent;r=!0===/^((?!chrome|android).)*safari/i.test(e);const t=e.match(/Version\/(\d+)/);i=r&&t?parseInt(t[1],10):-1,o=(n=e.indexOf("Firefox")>-1)?e.match(/Firefox\/([0-9]+)\./)[1]:-1}"undefined"==typeof createImageBitmap||r&&i<17||n&&o<98?this.textureLoader=new s.Tap(this.options.manager):this.textureLoader=new s.Kzg(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new s.Y9S(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let r=this,s=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(t){let n={scene:t[0][s.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:s.asset,parser:r,userData:{}};return G(i,n,s),W(n,s),Promise.all(r._invokeAll(function(e){return e.afterRoot&&e.afterRoot(n)})).then(function(){for(let e of n.scenes)e.updateMatrixWorld();e(n)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,s=t.length;r<s;r++){let s=t[r].joints;for(let t=0,r=s.length;t<r;t++)e[s[t]].isBone=!0}for(let t=0,s=e.length;t<s;t++){let s=e[t];void 0!==s.mesh&&(this._addNodeRef(this.meshCache,s.mesh),void 0!==s.skin&&(r[s.mesh].isSkinnedMesh=!0)),void 0!==s.camera&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,r){if(e.refs[t]<=1)return r;let s=r.clone(),i=(e,t)=>{let r=this.associations.get(e);for(let[s,n]of(null!=r&&this.associations.set(t,r),e.children.entries()))i(n,t.children[s])};return i(r,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r<t.length;r++){let s=e(t[r]);if(s)return s}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let r=[];for(let s=0;s<t.length;s++){let i=e(t[s]);i&&r.push(i)}return r}getDependency(e,t){let r=e+":"+t,s=this.cache.get(r);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this._invokeOne(function(e){return e.loadNode&&e.loadNode(t)});break;case"mesh":s=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:if(!(s=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)})))throw Error("Unknown type: "+e)}this.cache.add(r,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){let r=this;t=Promise.all((this.json[e+("mesh"===e?"es":"s")]||[]).map(function(t,s){return r.getDependency(e,s)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],r=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");
1if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[o.KHR_BINARY_GLTF].body);let i=this.options;return new Promise(function(e,n){r.load(s.r6x.resolveURL(t.uri,i.path),e,void 0,function(){n(Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(e){let r=t.byteLength||0,s=t.byteOffset||0;return e.slice(s,s+r)})}loadAccessor(e){let t=this,r=this.json,i=this.json.accessors[e];if(void 0===i.bufferView&&void 0===i.sparse){let e=U[i.type],t=O[i.componentType],r=!0===i.normalized,n=new t(i.count*e);return Promise.resolve(new s.THS(n,e,r))}let n=[];return void 0!==i.bufferView?n.push(this.getDependency("bufferView",i.bufferView)):n.push(null),void 0!==i.sparse&&(n.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(n).then(function(e){let n,a,o=e[0],l=U[i.type],h=O[i.componentType],c=h.BYTES_PER_ELEMENT,u=c*l,d=i.byteOffset||0,p=void 0!==i.bufferView?r.bufferViews[i.bufferView].byteStride:void 0,m=!0===i.normalized;if(p&&p!==u){let e=Math.floor(d/p),r="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+e+":"+i.count,u=t.cache.get(r);u||(n=new h(o,e*p,i.count*p/c),u=new s.eB$(n,p/c),t.cache.add(r,u)),a=new s.eHs(u,l,d%p/c,m)}else n=null===o?new h(i.count*l):new h(o,d,i.count*l),a=new s.THS(n,l,m);if(void 0!==i.sparse){let t=U.SCALAR,r=O[i.sparse.indices.componentType],n=i.sparse.indices.byteOffset||0,c=i.sparse.values.byteOffset||0,u=new r(e[1],n,i.sparse.count*t),d=new h(e[2],c,i.sparse.count*l);null!==o&&(a=new s.THS(a.array.slice(),a.itemSize,a.normalized)),a.normalized=!1;for(let e=0,t=u.length;e<t;e++){let t=u[e];if(a.setX(t,d[e*l]),l>=2&&a.setY(t,d[e*l+1]),l>=3&&a.setZ(t,d[e*l+2]),l>=4&&a.setW(t,d[e*l+3]),l>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}a.normalized=m}return a})}loadTexture(e){let t=this.json,r=this.options,s=t.textures[e].source,i=t.images[s],n=this.textureLoader;if(i.uri){let e=r.manager.getHandler(i.uri);null!==e&&(n=e)}return this.loadTextureImage(e,s,n)}loadTextureImage(e,t,r){let i=this,n=this.json,a=n.textures[e],o=n.images[t],l=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let h=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=a.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);let r=(n.samplers||{})[a.sampler]||{};return t.magFilter=C[r.magFilter]||s.k6q,t.minFilter=C[r.minFilter]||s.$_I,t.wrapS=F[r.wrapS]||s.GJx,t.wrapT=F[r.wrapT]||s.GJx,t.generateMipmaps=!t.isCompressedTexture&&t.minFilter!==s.hxR&&t.minFilter!==s.k6q,i.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[l]=h,h}loadImageSource(e,t){let r=this.json,i=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let n=r.images[e],a=self.URL||self.webkitURL,o=n.uri||"",l=!1;if(void 0!==n.bufferView)o=this.getDependency("bufferView",n.bufferView).then(function(e){l=!0;let t=new Blob([e],{type:n.mimeType});return o=a.createObjectURL(t)});else if(void 0===n.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let h=Promise.resolve(o).then(function(e){return new Promise(function(r,n){let a=r;!0===t.isImageBitmapLoader&&(a=function(e){let t=new s.gPd(e);t.needsUpdate=!0,r(t)}),t.load(s.r6x.resolveURL(e,i.path),a,void 0,n)})}).then(function(e){var t;return!0===l&&a.revokeObjectURL(o),W(e,n),e.userData.mimeType=n.mimeType||((t=n.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":t.search(/\.ktx2($|\?)/i)>0||0===t.search(/^data\:image\/ktx2/)?"image/ktx2":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e});return this.sourceCache[e]=h,h}assignTexture(e,t,r,s){let i=this;return this.getDependency("texture",r.index).then(function(n){if(!n)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((n=n.clone()).channel=r.texCoord),i.extensions[o.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[o.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=i.associations.get(n);n=i.extensions[o.KHR_TEXTURE_TRANSFORM].extendTexture(n,e),i.associations.set(n,t)}}
1return void 0!==s&&(n.colorSpace=s),e[t]=n,n})}assignFinalMaterial(e){let t=e.geometry,r=e.material,i=void 0===t.attributes.tangent,n=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new s.BH$,s.imn.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){let e="LineBasicMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new s.mrM,s.imn.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(i||n||a){let e="ClonedMaterial:"+r.uuid+":";i&&(e+="derivative-tangents:"),n&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),n&&(t.vertexColors=!0),a&&(t.flatShading=!0),i&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return s._4j}loadMaterial(e){let t,r=this,i=this.json,n=this.extensions,a=i.materials[e],l={},h=a.extensions||{},c=[];if(h[o.KHR_MATERIALS_UNLIT]){let e=n[o.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),c.push(e.extendParams(l,a,r))}else{let i=a.pbrMetallicRoughness||{};if(l.color=new s.Q1f(1,1,1),l.opacity=1,Array.isArray(i.baseColorFactor)){let e=i.baseColorFactor;l.color.setRGB(e[0],e[1],e[2],s.Zr2),l.opacity=e[3]}void 0!==i.baseColorTexture&&c.push(r.assignTexture(l,"map",i.baseColorTexture,s.er$)),l.metalness=void 0!==i.metallicFactor?i.metallicFactor:1,l.roughness=void 0!==i.roughnessFactor?i.roughnessFactor:1,void 0!==i.metallicRoughnessTexture&&(c.push(r.assignTexture(l,"metalnessMap",i.metallicRoughnessTexture)),c.push(r.assignTexture(l,"roughnessMap",i.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,l)})))}!0===a.doubleSided&&(l.side=s.$EB);let u=a.alphaMode||"OPAQUE";if("BLEND"===u?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,"MASK"===u&&(l.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==s.V9B&&(c.push(r.assignTexture(l,"normalMap",a.normalTexture)),l.normalScale=new s.I9Y(1,1),void 0!==a.normalTexture.scale)){let e=a.normalTexture.scale;l.normalScale.set(e,e)}if(void 0!==a.occlusionTexture&&t!==s.V9B&&(c.push(r.assignTexture(l,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(l.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==s.V9B){let e=a.emissiveFactor;l.emissive=new s.Q1f().setRGB(e[0],e[1],e[2],s.Zr2)}return void 0!==a.emissiveTexture&&t!==s.V9B&&c.push(r.assignTexture(l,"emissiveMap",a.emissiveTexture,s.er$)),Promise.all(c).then(function(){let s=new t(l);return a.name&&(s.name=a.name),W(s,a),r.associations.set(s,{materials:e}),a.extensions&&G(n,s,a),s})}createUniqueName(e){let t=s.Nwf.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,r=this.extensions,i=this.primitiveCache,n=[];for(let a=0,l=e.length;a<l;a++){let l=e[a],h=function(e){let t,r=e.extensions&&e.extensions[o.KHR_DRACO_MESH_COMPRESSION];if(t=r?"draco:"+r.bufferView+":"+r.indices+":"+z(r.attributes):e.indices+":"+z(e.attributes)+":"+e.mode,void 0!==e.targets)for(let r=0,s=e.targets.length;r<s;r++)t+=":"+z(e.targets[r]);return t}(l),c=i[h];if(c)n.push(c.promise);else{let e;e=l.extensions&&l.extensions[o.KHR_DRACO_MESH_COMPRESSION]?function(e){return r[o.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(r){return Y(r,e,t)})}(l):Y(new s.LoY,l,t),i[h]={primitive:l,promise:e},n.push(e)}}return Promise.all(n)}loadMesh(e){let t=this,r=this.json,n=this.extensions,a=r.meshes[e],o=a.primitives,l=[];for(let e=0,t=o.length;e<t;e++){var h;let t=void 0===o[e].material?(void 0===(h=this.cache).DefaultMaterial&&(h.DefaultMaterial=new s._4j({color:0xffffff,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:s.hB5})),h.DefaultMaterial):this.getDependency("material",o[e].material);l.push(t)}return l.push(t.loadGeometries(o)),Promise.all(l).then(function(r){let l=r.slice(0,r.length-1),h=r[r.length-1],c=[];for(let r=0,u=h.length;r<u;r++){let u,d=h[r],p=o[r],m=l[r];if(p.mode===N.TRIANGLES||p.mode===N.TRIANGLE_STRIP||p.mode===N.TRIANGLE_FAN||void 0===p.mode)!0===(u=!0===a.isSkinnedMesh?new s.I46(d,m):new s.eaF(d,m)).isSkinnedMesh&&u.normalizeSkinWeights(),p.mode===N.TRIANGLE_STRIP?u.geometry=i(u.geometry,s.O49):p.mode===N.TRIANGLE_FAN&&(u.geometry=i(u.geometry,s.rYR));else if(p.mode===N.LINES)u=new s.DXC(d,m);else if(p.mode===N.LINE_STRIP)u=new s.N1A(d,m);else if(p.mode===N.LINE_LOOP)u=new s.FCc(d,m);else if(p.mode===N.POINTS)u=new s.ONl(d,m);else throw Error("THREE.GLTFLoader: Primitive mode unsupported: "+p.mode);Object.keys(u.geometry.morphAttributes).length>0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,s=t.weights.length;r<s;r++)e.morphTargetInfluences[r]=t.weights[r];if(t.extras&&Array.isArray(t.extras.targetNames)){let r=t.extras.targetNames;if(e.morphTargetInfluences.length===r.length){e.morphTargetDictionary={};for(let t=0,s=r.length;t<s;t++)e.morphTargetDictionary[r[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}(u,a),u.name=t.createUniqueName(a.name||"mesh_"+e),W(u,a),p.extensions&&G(n,u,p),t.assignFinalMaterial(u),c.push(u)}for(let r=0,s=c.length;r<s;r++)t.associations.set(c[r],{meshes:e,primitives:r});if(1===c.length)return a.extensions&&G(n,c[0],a),c[0];let u=new s.YJl;a.extensions&&G(n,u,a),t.associations.set(u,{meshes:e});for(let e=0,t=c.length;e<t;e++)u.add(c[e]);return u})}loadCamera(e){let t,r=this.json.cameras[e],i=r[r.type];return i?("perspective"===r.type?t=new s.ubm(s.cj9.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):"orthographic"===r.type&&(t=new s.qUd(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),r.name&&(t.name=this.createUniqueName(r.name)),W(t,r),Promise.resolve(t)):void console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){let t=this.json.skins[e],r=[];for(let e=0,s=t.joints.length;e<s;e++)r.push(this._loadNodeShallow(t.joints[e]));return void 0!==t.inverseBindMatrices?r.push(this.getDependency("accessor",t.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(e){let r=e.pop(),i=[],n=[];for(let a=0,o=e.length;a<o;a++){let o=e[a];if(o){i.push(o);let e=new s.kn4;null!==r&&e.fromArray(r.array,16*a),n.push(e)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new s.EAD(i,n)})}loadAnimation(e){let t=this.json,r=this,i=t.animations[e],n=i.name?i.name:"animation_"+e,a=[],o=[],l=[],h=[],c=[];for(let e=0,t=i.channels.length;e<t;
1e++){let t=i.channels[e],r=i.samplers[t.sampler],s=t.target,n=s.node,u=void 0!==i.parameters?i.parameters[r.input]:r.input,d=void 0!==i.parameters?i.parameters[r.output]:r.output;void 0!==s.node&&(a.push(this.getDependency("node",n)),o.push(this.getDependency("accessor",u)),l.push(this.getDependency("accessor",d)),h.push(r),c.push(s))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(l),Promise.all(h),Promise.all(c)]).then(function(e){let t=e[0],a=e[1],o=e[2],l=e[3],h=e[4],c=[];for(let e=0,s=t.length;e<s;e++){let s=t[e],i=a[e],n=o[e],u=l[e],d=h[e];if(void 0===s)continue;s.updateMatrix&&s.updateMatrix();let p=r._createAnimationTracks(s,i,n,u,d);if(p)for(let e=0;e<p.length;e++)c.push(p[e])}let u=new s.tz3(n,void 0,c);return W(u,i),u})}createNodeMesh(e){let t=this.json,r=this,s=t.nodes[e];return void 0===s.mesh?null:r.getDependency("mesh",s.mesh).then(function(e){let t=r._getNodeRef(r.meshCache,s.mesh,e);return void 0!==s.weights&&t.traverse(function(e){if(e.isMesh)for(let t=0,r=s.weights.length;t<r;t++)e.morphTargetInfluences[t]=s.weights[t]}),t})}loadNode(e){let t=this.json.nodes[e],r=this._loadNodeShallow(e),s=[],i=t.children||[];for(let e=0,t=i.length;e<t;e++)s.push(this.getDependency("node",i[e]));let n=void 0===t.skin?Promise.resolve(null):this.getDependency("skin",t.skin);return Promise.all([r,Promise.all(s),n]).then(function(e){let t=e[0],r=e[1],s=e[2];null!==s&&t.traverse(function(e){e.isSkinnedMesh&&e.bind(s,X)});for(let e=0,s=r.length;e<s;e++)t.add(r[e]);return t})}_loadNodeShallow(e){let t=this.json,r=this.extensions,i=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];let n=t.nodes[e],a=n.name?i.createUniqueName(n.name):"",o=[],l=i._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return l&&o.push(l),void 0!==n.camera&&o.push(i.getDependency("camera",n.camera).then(function(e){return i._getNodeRef(i.cameraCache,n.camera,e)})),i._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){o.push(e)}),this.nodeCache[e]=Promise.all(o).then(function(t){let o;if((o=!0===n.isBone?new s.$Kf:t.length>1?new s.YJl:1===t.length?t[0]:new s.B69)!==t[0])for(let e=0,r=t.length;e<r;e++)o.add(t[e]);if(n.name&&(o.userData.name=n.name,o.name=a),W(o,n),n.extensions&&G(r,o,n),void 0!==n.matrix){let e=new s.kn4;e.fromArray(n.matrix),o.applyMatrix4(e)}else void 0!==n.translation&&o.position.fromArray(n.translation),void 0!==n.rotation&&o.quaternion.fromArray(n.rotation),void 0!==n.scale&&o.scale.fromArray(n.scale);if(i.associations.has(o)){if(void 0!==n.mesh&&i.meshCache.refs[n.mesh]>1){let e=i.associations.get(o);i.associations.set(o,{...e})}}else i.associations.set(o,{});return i.associations.get(o).nodes=e,o}),this.nodeCache[e]}loadScene(e){let t=this.extensions,r=this.json.scenes[e],i=this,n=new s.YJl;r.name&&(n.name=i.createUniqueName(r.name)),W(n,r),r.extensions&&G(t,n,r);let a=r.nodes||[],o=[];for(let e=0,t=a.length;e<t;e++)o.push(i.getDependency("node",a[e]));return Promise.all(o).then(function(e){for(let t=0,r=e.length;t<r;t++)n.add(e[t]);return i.associations=(e=>{let t=new Map;for(let[e,r]of i.associations)(e instanceof s.imn||e instanceof s.gPd)&&t.set(e,r);return e.traverse(e=>{let r=i.associations.get(e);null!=r&&t.set(e,r)}),t})(n),n})}_createAnimationTracks(e,t,r,i,n){let a,o=[],l=e.name?e.name:e.uuid,h=[];switch(j[n.path]===j.weights?e.traverse(function(e){e.morphTargetInfluences&&h.push(e.name?e.name:e.uuid)}):h.push(l),j[n.path]){case j.weights:a=s.Hit;break;case j.rotation:a=s.MBL;break;case j.translation:case j.scale:a=s.RiT;break;default:a=1===r.itemSize?s.Hit:s.RiT}let c=void 0!==i.interpolation?B[i.interpolation]:s.PJ3,u=this._getArrayFromAccessor(r);for(let e=0,r=h.length;e<r;e++){let r=new a(h[e]+"."+j[n.path],t.array,u,c);"CUBICSPLINE"===i.interpolation&&this._createCubicSplineTrackInterpolant(r),o.push(r)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let e=V(t.constructor),r=new Float32Array(t.length);for(let s=0,i=t.length;s<i;s++)r[s]=t[s]*e;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof s.MBL?D:M)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Y(e,t,r){let i=t.attributes,n=[];for(let t in i){let s=H[t]||t.toLowerCase();s in e.attributes||n.push(function(t,s){return r.getDependency("accessor",t).then(function(t){e.setAttribute(s,t)})}(i[t],s))}if(void 0!==t.indices&&!e.index){let s=r.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)});n.push(s)}return s.ppV.workingColorSpace!==s.Zr2&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Convert
1ing vertex colors from "srgb-linear" to "${s.ppV.workingColorSpace}" not supported.`),W(e,t),!function(e,t,r){let i=t.attributes,n=new s.NRn;if(void 0===i.POSITION)return;{let e=r.json.accessors[i.POSITION],t=e.min,a=e.max;if(void 0===t||void 0===a)return console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(n.set(new s.Pq0(t[0],t[1],t[2]),new s.Pq0(a[0],a[1],a[2])),e.normalized){let t=V(O[e.componentType]);n.min.multiplyScalar(t),n.max.multiplyScalar(t)}}let a=t.targets;if(void 0!==a){let e=new s.Pq0,t=new s.Pq0;for(let s=0,i=a.length;s<i;s++){let i=a[s];if(void 0!==i.POSITION){let s=r.json.accessors[i.POSITION],n=s.min,a=s.max;if(void 0!==n&&void 0!==a){if(t.setX(Math.max(Math.abs(n[0]),Math.abs(a[0]))),t.setY(Math.max(Math.abs(n[1]),Math.abs(a[1]))),t.setZ(Math.max(Math.abs(n[2]),Math.abs(a[2]))),s.normalized){let e=V(O[s.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(e)}e.boundingBox=n;let o=new s.iyt;n.getCenter(o.center),o.radius=n.min.distanceTo(n.max)/2,e.boundingSphere=o}(e,t,r),Promise.all(n).then(function(){return void 0!==t.targets?function(e,t,r){let s=!1,i=!1,n=!1;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(void 0!==r.POSITION&&(s=!0),void 0!==r.NORMAL&&(i=!0),void 0!==r.COLOR_0&&(n=!0),s&&i&&n)break}if(!s&&!i&&!n)return Promise.resolve(e);let a=[],o=[],l=[];for(let h=0,c=t.length;h<c;h++){let c=t[h];if(s){let t=void 0!==c.POSITION?r.getDependency("accessor",c.POSITION):e.attributes.position;a.push(t)}if(i){let t=void 0!==c.NORMAL?r.getDependency("accessor",c.NORMAL):e.attributes.normal;o.push(t)}if(n){let t=void 0!==c.COLOR_0?r.getDependency("accessor",c.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(l)]).then(function(t){let r=t[0],a=t[1],o=t[2];return s&&(e.morphAttributes.position=r),i&&(e.morphAttributes.normal=a),n&&(e.morphAttributes.color=o),e.morphTargetsRelative=!0,e})}(e,t.targets,r):e})}},53167:(e,t,r)=>{r.d(t,{l:()=>i});var s=r(60043);class i extends s.Z58{constructor(){super();const e=new s.iNn;e.deleteAttribute("uv");const t=new s._4j({side:s.hsX}),r=new s._4j,i=new s.HiM(0xffffff,900,28,2);i.position.set(.418,16.199,.3),this.add(i);const a=new s.eaF(e,t);a.position.set(-.757,13.219,.717),a.scale.set(31.713,28.305,28.591),this.add(a);const o=new s.ZLX(e,r,6),l=new s.B69;l.position.set(-10.906,2.009,1.846),l.rotation.set(0,-.195,0),l.scale.set(2.328,7.905,4.651),l.updateMatrix(),o.setMatrixAt(0,l.matrix),l.position.set(-5.607,-.754,-.758),l.rotation.set(0,.994,0),l.scale.set(1.97,1.534,3.955),l.updateMatrix(),o.setMatrixAt(1,l.matrix),l.position.set(6.167,.857,7.803),l.rotation.set(0,.561,0),l.scale.set(3.927,6.285,3.687),l.updateMatrix(),o.setMatrixAt(2,l.matrix),l.position.set(-2.017,.018,6.124),l.rotation.set(0,.333,0),l.scale.set(2.002,4.566,2.064),l.updateMatrix(),o.setMatrixAt(3,l.matrix),l.position.set(2.291,-.756,-2.621),l.rotation.set(0,-.286,0),l.scale.set(1.546,1.552,1.496),l.updateMatrix(),o.setMatrixAt(4,l.matrix),l.position.set(-2.193,-.369,-5.547),l.rotation.set(0,.516,0),l.scale.set(3.875,3.487,2.986),l.updateMatrix(),o.setMatrixAt(5,l.matrix),this.add(o);const h=new s.eaF(e,n(50));h.position.set(-16.116,14.37,8.208),h.scale.set(.1,2.428,2.739),this.add(h);const c=new s.eaF(e,n(50));c.position.set(-16.109,18.021,-8.207),c.scale.set(.1,2.425,2.751),this.add(c);const u=new s.eaF(e,n(17));u.position.set(14.904,12.198,-1.832),u.scale.set(.15,4.265,6.331),this.add(u);const d=new s.eaF(e,n(43));d.position.set(-.462,8.89,14.52),d.scale.set(4.38,5.441,.088),this.add(d);const p=new s.eaF(e,n(20));p.position.set(3.235,11.486,-12.541),p.scale.set(2.5,2,.1),this.add(p);const m=new s.eaF(e,n(100));m.position.set(0,20,0),m.scale.set(1,.1,1),this.add(m)}dispose(){let e=new Set;for(let t of(this.traverse(t=>{t.isMesh&&(e.add(t.geometry),e.add(t.material))}),e))t.dispose()}}function n(e){return new s.G_z({color:0,emissive:0xffffff,emissiveIntensity:e})}},59488:(e,t,r)=>{e.exports=r.p+"static/media/playback-worklet.546a1fdc.js"},59669:(e,t,r)=>{let s,i,n;r.d(t,{j:()=>T});var a=r(60043);let o=[0,0,0,0],l=new a.Pq0,h=new a.Pq0,c=new a.Pq0,u=new a.Pq0;new a.Zcv,new a.RlV,new a.O9p;let d=new a.PTz,p=new a.PTz,m=new a.kn4,f=new a.kn4;new a.Pq0;let g=new a.Pq0(0,0,1),v=new a.Pq0(1,0,0),y=new a.Pq0(0,1,0),b=new a.Pq0(0,0,1);class T{constructor(e=null){this.opt=Object.assign({warmupMs:2e3,sensitivityFactor:1,movementFactor:1,isExcludes:!0,isPivots:!0,isLimits:!0,helperBoneColor1:0xff0000,helperBoneColor2:0xf7c5cc,helperLinkColor1:0xff0000,helperLinkColor2:255,helperExcludesColor:0xaaaaff},e||{}),this.scene=null,this.armature=null,this.config=[],this.data=[],this.dict={}
1,this.objectsUpdate=[],this.helpers={isActive:!1,isShowAll:!1,points:{bones:[],pivots:[],object:null},lines:{bones:[],object:null},excludes:{bones:[],deltaLocals:[],radii:[],objects:[]}},this.running=!1,this.timerMs=0}getOptionValue(e){return this.opt[e]}setOptionValue(e,t){this.opt[e]=t,this.helpers.isActive&&this.showHelpers()}getBoneNames(){return this.data.map(e=>e.name)}getValue(e,t){let r;if(null===this.scene)throw Error("Dynamic bones has not been setup yet.");if(!this.dict.hasOwnProperty(e))throw Error("Dynamic bone '"+e+"' not found.");let s=this.dict[e];if("type"===t)r=s.type;else if("stiffness"===t)r=s.k.every(e=>e===s.k[0])?s.k[0]:[...s.k];else if("damping"===t)r=s.c.every(e=>e===s.c[0])?s.c[0]:[...s.c];else if("external"===t)r=s.ext<1?s.ext:null;else if("limits"===t)r=s.limits?.map(e=>null===e?null:[...e]);else if("deltaLocal"===t)r=s.dl?[...s.dl]:null;else if("excludes"===t)r=s.excludes?[...s.excludes.map(e=>{let t={bone:e.bone.name.slice(),radius:e.radius};return e.deltaLocal&&(t.deltaLocal=[...e.deltaLocal]),t})]:null;else if("deltaWorld"===t)r=s.dw?[...s.dw]:null;else if("pivot"===t)r=s.pivot;else if("helper"===t)r=s.helper;else throw Error("Unsupported property '"+t+"'.");return r}setValue(e,t,r){if(null===this.scene)throw Error("Dynamic bones has not been setup yet.");if(!this.dict.hasOwnProperty(e))throw Error("Dynamic bone '"+e+"' not found.");let s=this.dict[e];if("type"===t){if(!r)throw Error("Parameter 'type' not set.");if("string"!=typeof r)throw Error("Type must be a string.");switch(r){case"point":s.isPoint=!0,s.isX=!0,s.isY=!0,s.isZ=!0,s.isT=!1;break;case"link":s.isPoint=!1,s.isX=!0,s.isY=!1,s.isZ=!0,s.isT=!1;break;case"mix1":s.isPoint=!1,s.isX=!0,s.isY=!0,s.isZ=!0,s.isT=!1;break;case"mix2":s.isPoint=!1,s.isX=!0,s.isY=!1,s.isZ=!0,s.isT=!0;break;case"full":s.isPoint=!1,s.isX=!0,s.isY=!0,s.isZ=!0,s.isT=!0;break;default:throw Error("Unknown type'"+r+"'.")}s.type=r.slice()}else if("stiffness"===t){if(!r)throw Error("Parameter 'stiffness' not set.");if(!Number.isNaN(r)&&r>=0)s.k=[,,,,].fill(r);else if(Array.isArray(r)&&4===r.length&&r.every(e=>e>=0))s.k=[...r];else throw Error("Stiffness must be a non-negative number or an array of four non-negative numbers.")}else if("damping"===t){if(!r)throw Error("Parameter 'damping' not set.");if(!Number.isNaN(r)&&r>=0)s.c=[,,,,].fill(r);else if(Array.isArray(r)&&4===r.length&&r.every(e=>e>=0))s.c=[...r];else throw Error("Damping must be a non-negative number or an array of four non-negative numbers.")}else if("external"===t)if(null==r)s.ext=1;else if(!Number.isNaN(r)&&r>=0&&r<=1)s.ext=r;else throw Error("External (if set) must be a number between [0,1].");else if("limits"===t)if(null==r)s.limits=null;else{if(!Array.isArray(r)||4!==r.length)throw Error("Limits (if set) must null, or an array of four arrays.");if(!r.every(e=>null===e||Array.isArray(e)&&2===e.length&&(null===e[0]||!Number.isNaN(e[0]))&&(null===e[1]||!Number.isNaN(e))))throw Error("Limit values must be null or numbers.");s.limits=[r[0]?[...r[0]]:null,r[1]?[...r[1]]:null,r[2]?[...r[2]]:null,r[3]?[...r[3]]:null]}else if("excludes"===t){if(null==r)s.excludes=null;else{if(!Array.isArray(r))throw Error("Excludes (if set) must null, or an array.");s.excludes=[],r.forEach((e,t)=>{if(!e.bone)throw Error("Bone not specified in #"+t+" exclude.");if("string"!=typeof e.bone||0===e.bone.length)throw Error("Bone name must be a non-empty string in #"+t+" exclude.");let r=this.armature.getObjectByName(e.bone);if(!r)throw Error("Bone '"+e.bone+"' not found in #"+t+" exclude.");if(Number.isNaN(e.radius)&&e.radius>=0)throw Error("Radius must be a non-negative number in #"+t+" exclude.");let i={bone:r,radius:e.radius,radiusSq:e.radius*e.radius,deltaLocal:null};if(e.deltaLocal){if(!Array.isArray(e.deltaLocal)||3!==e.deltaLocal.length||e.deltaLocal.some(e=>Number.isNaN(e)))throw Error("deltaLocal must be an array of three numbers in #"+t+" exclude.");i.deltaLocal=[...e.deltaLocal]}s.excludes.push(i)})}this.showHelpers()}else if("helper"===t){if(null==r)s.helper=null;else{if(!1!==r&&!0!==r)throw Error("Helper, if set, must be false or true.");s.helper=r}this.showHelpers()}else if("pivot"===t)if(null==r)s.pivot=null;else{if(!1!==r&&!0!==r)throw Error("Pivot, if set, must be false or true.");if(!0===r&&0===s.type)throw Error("Point type bone can't be a pivot.");s.pivot=r}else if("deltaLocal"===t)if(null==r)s.dl=null;else{if(!Array.isArray(r)||3!==r.length)throw Error("deltaLocal, is set, must be an array of three numbers.");if(!r.every(e=>!Number.isNaN(e)))throw Error("deltaLocal values must be numbers.");s.dl=[...r]}else if("deltaWorld"===t)if(null==r)s.dw=null;else{if(!Array.isArray(r)||3!==r.length)throw Error("deltaWorld, is set, must be an array of three values.");if(!r.every(e=>!Number.isNaN(e)))throw Error("deltaWorld values must be numbers.");s.dw=[...r]}else throw Error("Unsupported property "+t)}getConfig(){return this.data.map(e=>{let t={bone:e.name.slice()};return["type","stiffness","damping","external","deltaLocal","deltaWorld","limits","excludes","pivot","helper"].forEach(r=>{(s=this.getValue(e.name,r))&&(t[r]=s)}),t})}sortBones(){if(null===this.scene)throw Error("Dynamic bones has not been setup yet.");let e=0,t=new WeakMap;this.armature.traverse(r=>{!t.has(r)&&(t.set(r,e),e++)}),this.data.sort((e,r)=>
1t.get(e.bone)-t.get(r.bone)),this.data.forEach(e=>{(s=this.dict[e.boneParent.name])&&(s.children||(s.children=[]),s.children.push(e))}),this.objectsUpdate=[];let r=new WeakSet,i=e=>e.parent?.isBone?[e,...i(e.parent)]:[e],n=e=>{i(e).forEach(e=>{r.has(e)||(this.objectsUpdate.push(e),r.add(e))})};this.data.forEach(e=>{n(e.bone),e.excludes&&e.excludes.forEach(e=>{n(e.bone)})}),this.objectsUpdate.sort((e,r)=>t.get(e)-t.get(r))}setup(e,t,r){this.dispose();let s=(e,t)=>{if(!e)throw this.dispose(),Error(t)};s(e?.isScene,"First parameter must be Scene."),this.scene=e,s(t?.isObject3D,"Second parameter must be the armature Object3D."),this.armature=t,s(Array.isArray(r),"Third parameter must be an array of bone configs."),this.config=r,this.config.forEach((e,t)=>{let r="Config item #"+t+": ";s(e.bone,r+"Bone not specified.");let i=e.bone;s("string"==typeof i&&i.length>0,r+"Bone name must be a non-empty string.");let n=this.armature.getObjectByName(i);s(n,r+"Bone '"+i+"' not found."),s(n.parent?.isBone,r+"Bone must have a parent bone."),s(this.data.every(e=>e.bone!==n),r+"Bone '"+i+"' already exists."),n.updateMatrixWorld(!0);let a={name:i,bone:n,boneParent:n.parent,vBasis:n.position.clone(),vWorld:n.parent.getWorldPosition(l).clone(),qBasis:n.parent.quaternion.clone(),l:n.position.length(),p:[0,0,0,0],v:[0,0,0,0],a:[0,0,0,0],ev:[0,0,0,0],ea:[0,0,0,0]};a.boneParent.matrixWorld.decompose(l,d,c),l.copy(g).applyQuaternion(d).setY(0).normalize(),d.premultiply(
1p.setFromUnitVectors(g,l).invert()).normalize(),a.qWorldInverseYaw=d.clone().normalize(),this.data.push(a),this.dict[i]=a;try{this.setValue(i,"type",e.type),this.setValue(i,"stiffness",e.stiffness),this.setValue(i,"damping",e.damping),this.setValue(i,"external",e.external),this.setValue(i,"limits",e.limits),this.setValue(i,"excludes",e.excludes),this.setValue(i,"deltaLocal",e.deltaLocal),this.setValue(i,"deltaWorld",e.deltaWorld),this.setValue(i,"pivot",e.pivot),this.setValue(i,"helper",e.helper)}catch(e){s(!1,r+e)}}),this.sortBones(),this.start()}update(e){let t,r,a,T,x;if(this.running){for(this.timerMs+=e,e>1e3&&(this.timerMs=0),e/=1e3,t=0,a=this.objectsUpdate.length;t<a;t++)(x=this.objectsUpdate[t]).updateMatrix(),null===x.parent?x.matrixWorld.copy(x.matrix):x.matrixWorld.multiplyMatrices(x.parent.matrixWorld,x.matrix),x.matrixWorldNeedsUpdate=!1;for(t=0,a=this.data.length;t<a;t++){if(x=this.data[t],l.copy(x.vWorld),m.copy(x.boneParent.matrixWorld),f.copy(m).invert(),x.vWorld.setFromMatrixPosition(m),l.applyMatrix4(f),l.length()>.5&&(console.info("Info: Unrealistic jump of "+l.length().toFixed(2)+" meters."),l.setLength(.5)),l.applyQuaternion(x.bone.quaternion),o[0]=l.x,o[1]=l.y,o[2]=-l.z,o[3]=l.length()/3,x.children)for(r=0,T=x.children.length;r<T;r++)s=x.children[r],o[0]-=s.v[0]*e/3,o[1]-=s.v[1]*e/3,o[2]+=s.v[2]*e/3,o[3]-=s.v[3]*e/3;if(s=this.opt.sensitivityFactor,o[0]*=x.ext*s,o[1]*=x.ext*s,o[2]*=x.ext*s,o[3]*=x.ext*s,x.isX&&(s=o[0]/e,x.ea[0]=(s-x.ev[0])/e,x.ev[0]=s,x.a[0]=-x.k[0]*x.p[0]-x.c[0]*x.v[0]-x.ea[0],x.p[0]+=x.v[0]*e+x.a[0]*e*e/2+o[0],s=x.v[0]+x.a[0]*e/2,s=-x.k[0]*x.p[0]-x.c[0]*s-x.ea[0],x.v[0]=x.v[0]+(s+x.a[0])*e/2),x.isY&&(s=o[1]/e,x.ea[1]=(s-x.ev[1])/e,x.ev[1]=s,x.a[1]=-x.k[1]*x.p[1]-x.c[1]*x.v[1]-x.ea[1],x.p[1]+=x.v[1]*e+x.a[1]*e*e/2+o[1],s=x.v[1]+x.a[1]*e/2,s=-x.k[1]*x.p[1]-x.c[1]*s-x.ea[1],x.v[1]=x.v[1]+(s+x.a[1])*e/2),x.isZ&&(s=o[2]/e,x.ea[2]=(s-x.ev[2])/e,x.ev[2]=s,x.a[2]=-x.k[2]*x.p[2]-x.c[2]*x.v[2]-x.ea[2],x.p[2]+=x.v[2]*e+x.a[2]*e*e/2+o[2],s=x.v[2]+x.a[2]*e/2,s=-x.k[2]*x.p[2]-x.c[2]*s-x.ea[2],x.v[2]=x.v[2]+(s+x.a[2])*e/2),x.isT&&(s=o[3]/e,x.ea[3]=(s-x.ev[3])/e,x.ev[3]=s,x.a[3]=-x.k[3]*x.p[3]-x.c[3]*x.v[3]-x.ea[3],x.p[3]+=x.v[3]*e+x.a[3]*e*e/2+o[3],s=x.v[3]+x.a[3]*e/2,s=-x.k[3]*x.p[3]-x.c[3]*s-x.ea[3],x.v[3]=x.v[3]+(s+x.a[3])*e/2),this.timerMs<this.opt.warmupMs&&(x.v[0]*=1e-4,x.p[0]*=1e-4,x.v[1]*=1e-4,x.p[1]*=1e-4,x.v[2]*=1e-4,x.p[2]*=1e-4,x.v[3]*=1e-4,x.p[3]*=1e-4),o[0]=x.p[0],o[1]=x.p[1],o[2]=x.p[2],o[3]=x.p[3],s=this.opt.movementFactor,o[0]*=s,o[1]*=s,o[2]*=s,o[3]*=s,x.dl&&(s=x.dl,o[0]+=s[0],o[1]+=s[1],o[2]+=s[2]),x.dw&&(s=x.dw,l.set(x.vBasis.x+o[0],x.vBasis.y+o[1],x.vBasis.z+o[2]),l.applyMatrix4(m),l.x+=s[0],l.y+=s[1],l.z+=s[2],l.applyMatrix4(f),o[0]+=l.x-x.vBasis.x,o[1]+=l.y-x.vBasis.y,o[2]+=l.z-x.vBasis.z),x.limits&&this.opt.isLimits&&((s=x.limits)[0]&&(null!==s[0][0]&&o[0]<s[0][0]&&(o[0]=s[0][0]),null!==s[0][1]&&o[0]>s[0][1]&&(o[0]=s[0][1])),s[1]&&(null!==s[1][0]&&o[1]<s[1][0]&&(o[1]=s[1][0]),null!==s[1][1]&&o[1]>s[1][1]&&(o[1]=s[1][1])),s[2]&&(null!==s[2][0]&&o[2]<s[2][0]&&(o[2]=s[2][0]),null!==s[2][1]&&o[2]>s[2][1]&&(o[2]=s[2][1])),s[3]&&(null!==s[3][0]&&o[3]<s[3][0]&&(o[3]=s[3][0]),null!==s[3][1]&&o[3]>s[3][1]&&(o[3]=s[3][1]))),x.isPoint)x.bone.position.set(x.vBasis.x+o[0],x.vBasis.y+o[1],x.vBasis.z-o[2]);else if(x.boneParent.quaternion.copy(x.qBasis),x.pivot&&this.opt.isPivots&&(x.boneParent.updateWorldMatrix(!1,!1),x.boneParent.matrixWorld.decompose(l,d,c),l.copy(g).applyQuaternion(d).setY(0).normalize(),d.premultiply(
1p.setFromUnitVectors(g,l).invert()).normalize(),x.boneParent.quaternion.multiply(d.invert()),x.boneParent.quaternion.multiply(x.qWorldInverseYaw)),x.isZ&&(s=Math.atan(o[0]/x.l),d.setFromAxisAngle(b,-s),x.boneParent.quaternion.multiply(d)),x.isY&&(s=x.l/3,s*=Math.tanh(o[1]/s),x.bone.position.setLength(x.l+s)),x.isX&&(s=Math.atan(o[2]/x.l),d.setFromAxisAngle(v,-s),x.boneParent.quaternion.multiply(d)),x.isT&&(s=1.5*Math.tanh(1.5*o[3]),d.setFromAxisAngle(y,-s),x.boneParent.quaternion.multiply(d)),x.boneParent.updateWorldMatrix(!1,!0),x.excludes&&this.opt.isExcludes)for(r=0,T=x.excludes.length;r<T;r++){if(s=x.excludes[r],c.set(0,0,0),s.deltaLocal&&(c.x+=s.deltaLocal[0],c.y+=s.deltaLocal[1],c.z+=s.deltaLocal[2]),c.applyMatrix4(s.bone.matrixWorld),f.copy(x.boneParent.matrixWorld).invert(),c.applyMatrix4(f),l.copy(x.bone.position),!(l.distanceToSquared(c)>=s.radiusSq))n=l.length(),!((i=c.length())>s.radius+n)&&(i<Math.abs(s.radius-n)||(i=(i*i+n*n-s.radiusSq)/(2*i),c.normalize(),u.copy(c).multiplyScalar(i),i=Math.sqrt(n*n-i*i),l.subVectors(l,u).projectOnPlane(c).normalize().multiplyScalar(i),h.subVectors(x.vBasis,u).projectOnPlane(c).normalize(),(n=h.dot(l))<0&&(n=Math.sqrt(i*i-n*n),h.multiplyScalar(n),l.add(h)),l.add(u).normalize(),c.copy(x.bone.position).normalize(),d.setFromUnitVectors(c,l),x.boneParent.quaternion.premultiply(d),x.boneParent.updateWorldMatrix(!1,!0)))}}this.helpers.isActive&&this.updateHelpers()}}showHelpers(e){if(this.hideHelpers(),this.helpers.isShowAll=void 0===e?this.helpers.isShowAll:!0===e,s=this.helpers,this.data.forEach(e=>{(this.helpers.isShowAll||!0===e.helper)&&(s.points.bones.push(e.bone),s.points.pivots.push(e.pivot),0!==e.type&&s.lines.bones.push(e.bone),e.excludes&&e.excludes.forEach(e=>{let t=!1;for(let r=0;r<s.excludes.bones.length;r++)if(s.excludes.bones[r]===e.bone&&s.excludes.radii[r]===e.radius&&(null!==s.excludes.deltaLocals[r]||null===e.deltaLocal)&&(null===s.excludes.deltaLocals[r]||null!==e.deltaLocal)&&!(null!==s.excludes.deltaLocals[r]&&s.excludes.deltaLocals[r].some((t,r)=>t!==e.deltaLocal[r]))){t=!0;break}t||(s.excludes.bones.push(e.bone),s.excludes.radii.push(e.radius),s.excludes.deltaLocals.push(e.deltaLocal?[...e.deltaLocal]:null),s.excludes.objects.push(null))}))}),s=this.helpers.excludes,this.opt.isExcludes&&s.bones.length&&s.bones.forEach((e,t)=>{let r=new a.Gu$(s.radii[t],6,6),i=new a.V9B({depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0,wireframe:!0,color:this.opt.helperExcludesColor});s.objects[t]=new a.eaF(r,i),s.objects[t].renderOrder=997,e.add(s.objects[t]),s.deltaLocals[t]&&s.objects[t].position.set(s.deltaLocals[t][0],s.deltaLocals[t][1],s.deltaLocals[t][2])}),(s=this.helpers.points).bones.length){this.helpers.isActive=!0;let e=new a.LoY,t=s.bones.map(e=>[0,0,0]).flat();e.setAttribute("position",new a.qtW(t,3));let r=new a.Q1f(this.opt.helperBoneColor1),i=new a.Q1f(this.opt.helperBoneColor2),n=s.pivots.map(e=>e&&this.opt.isPivots?[i.r,i.g,i.b]:[r.r,r.g,r.b]).flat();e.setAttribute("color",new a.qtW(n,3));let o=new a.BH$({depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0,size:.2,vertexColors:!0});s.object=new a.ONl(e,o),s.object.renderOrder=998,s.object.matrix=this.armature.matrixWorld,s.object.matrixAutoUpdate=!1,this.scene.add(s.object)}if((s=this.helpers.lines).bones.length){let e=new a.LoY,t=s.bones.map(e=>[0,0,0,0,0,0]).flat();e.setAttribute("position",new a.qtW(t,3));let r=new a.Q1f(this.opt.helperLinkColor1),i=new a.Q1f(this.opt.helperLinkColor2),n=s.bones.map(e=>[r.r,r.g,r.b,i.r,i.g,i.b]).flat();e.setAttribute("color",new a.qtW(n,3));let o=new a.mrM({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});s.object=new a.DXC(e,o),s.object.renderOrder=999,s.object.matrix=this.armature.matrixWorld,s.object.matrixAutoUpdate=!1,this.scene.add(s.object)}}updateHelpers(){if((s=this.helpers.points).bones.length){f.copy(this.armature.matrixWorld).invert();let e=s.object.geometry.getAttribute("position");for(let t=0,r=s.bones.length;t<r;t++)m.multiplyMatrices(f,s.bones[t].matrixWorld),l.setFromMatrixPosition(m),e.setXYZ(t,l.x,l.y,l.z);e.needsUpdate=!0,s.object.updateMatrixWorld()}if((s=this.helpers.lines).bones.length){f.copy(this.armature.matrixWorld).invert();let e=s.object.geometry.getAttribute("position");for(let t=0,r=0,i=s.bones.length;t<i;t++,r+=2)m.multiplyMatrices(f,s.bones[t].matrixWorld),l.setFromMatrixPosition(m),e.setXYZ(r,l.x,l.y,l.z),m.multiplyMatrices(f,s.bones[t].parent.matrixWorld),l.setFromMatrixPosition(m),e.setXYZ(r+1,l.x,l.y,l.z);e.needsUpdate=!0,s.object.updateMatrixWorld()}}
1hideHelpers(){[this.helpers.points,this.helpers.lines].forEach(e=>{e.bones=[],e.object&&(this.scene.remove(e.object),e.object.geometry.dispose(),e.object.material.dispose(),e.object=null)}),(s=this.helpers.excludes).objects.forEach((e,t)=>{e&&(s.bones[t].remove(e),e.geometry.dispose(),e.material.dispose())}),s.bones=[],s.deltaLocals=[],s.radii=[],s.objects=[],this.helpers.isActive=!1}start(){this.data.length&&(this.running=!0,this.timerMs=0,this.showHelpers())}stop(){this.running=!1,this.hideHelpers();for(let e=0,t=this.data.length;e<t;e++){let t=this.data[e];t.bone.position.copy(t.vBasis),t.boneParent.quaternion.copy(t.qBasis)}}dispose(){this.stop(),this.scene=null,this.armature=null,this.config=[],this.data=[],this.dict={},this.objectsUpdate=[],this.timerMs=0}}},63074:(e,t,r)=>{let s,i,n;r.d(t,{w:()=>F});var a=r(60043),o=Uint8Array,l=Uint16Array,h=Int32Array,c=new o([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),u=new o([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),d=new o([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),p=function(e,t){for(var r=new l(31),s=0;s<31;++s)r[s]=t+=1<<e[s-1];for(var i=new h(r[30]),s=1;s<30;++s)for(var n=r[s];n<r[s+1];++n)i[n]=n-r[s]<<5|s;return{b:r,r:i}},m=p(c,2),f=m.b,g=m.r;f[28]=258,g[258]=28;var v=p(u,0),y=v.b;v.r;for(var b=new l(32768),T=0;T<32768;++T){var x=(43690&T)>>1|(21845&T)<<1;x=(61680&(x=(52428&x)>>2|(13107&x)<<2))>>4|(3855&x)<<4,b[T]=((65280&x)>>8|(255&x)<<8)>>1}for(var w=function(e,t,r){for(var s,i=e.length,n=0,a=new l(t);n<i;++n)e[n]&&++a[e[n]-1];var o=new l(t);for(n=1;n<t;++n)o[n]=o[n-1]+a[n-1]<<1;if(r){s=new l(1<<t);var h=15-t;for(n=0;n<i;++n)if(e[n])for(var c=n<<4|e[n],u=t-e[n],d=o[e[n]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)s[b[d]>>h]=c}else for(n=0,s=new l(i);n<i;++n)e[n]&&(s[n]=b[o[e[n]-1]++]>>15-e[n]);return s},E=new o(288),T=0;T<144;++T)E[T]=8;for(var T=144;T<256;++T)E[T]=9;for(var T=256;T<280;++T)E[T]=7;for(var T=280;T<288;++T)E[T]=8;for(var _=new o(32),T=0;T<32;++T)_[T]=5;var R=w(E,9,1),S=w(_,5,1),I=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},P=function(e,t,r){var s=t/8|0;return(e[s]|e[s+1]<<8)>>(7&t)&r},A=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)}
1,k=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],M=function(e,t,r){var s=Error(t||k[e]);if(s.code=e,Error.captureStackTrace&&Error.captureStackTrace(s,M),!r)throw s;return s},L=function(e,t,r,s){var i,n,a,l=e.length,h=s?s.length:0;if(!l||t.f&&!t.l)return r||new o(0);var p=!r,m=p||2!=t.i,g=t.i;p&&(r=new o(3*l));var v=function(e){var t=r.length;if(e>t){var s=new o(Math.max(2*t,e));s.set(r),r=s}},b=t.f||0,T=t.p||0,x=t.b||0,E=t.l,_=t.d,k=t.m,L=t.n,D=8*l;do{if(!E){b=P(e,T,1);var N=P(e,T+1,3);if(T+=3,N)if(1==N)E=R,_=S,k=9,L=5;else if(2==N){var O=P(e,T,31)+257,C=P(e,T+10,15)+4,F=O+P(e,T+5,31)+1;T+=14;for(var U=new o(F),H=new o(19),j=0;j<C;++j)H[d[j]]=P(e,T+3*j,7);T+=3*C;for(var B=I(H),G=(1<<B)-1,W=w(H,B,1),j=0;j<F;){var z=W[P(e,T,G)];T+=15&z;var V=z>>4;if(V<16)U[j++]=V;else{var X=0,K=0;for(16==V?(K=3+P(e,T,3),T+=2,X=U[j-1]):17==V?(K=3+P(e,T,7),T+=3):18==V&&(K=11+P(e,T,127),T+=7);K--;)U[j++]=X}}var Y=U.subarray(0,O),q=U.subarray(O);k=I(Y),L=I(q),E=w(Y,k,1),_=w(q,L,1)}else M(1);else{var V=((T+7)/8|0)+4,Z=e[V-4]|e[V-3]<<8,$=V+Z;if($>l){g&&M(0);break}m&&v(x+Z),r.set(e.subarray(V,$),x),t.b=x+=Z,t.p=T=8*$,t.f=b;continue}if(T>D){g&&M(0);break}}m&&v(x+131072);for(var Q=(1<<k)-1,J=(1<<L)-1,ee=T;;ee=T){var X=E[A(e,T)&Q],et=X>>4;if((T+=15&X)>D){g&&M(0);break}if(X||M(2),et<256)r[x++]=et;else if(256==et){ee=T,E=null;break}else{var er=et-254;if(et>264){var j=et-257,es=c[j];er=P(e,T,(1<<es)-1)+f[j],T+=es}var ei=_[A(e,T)&J],en=ei>>4;ei||M(3),T+=15&ei;var q=y[en];if(en>3){var es=u[en];q+=A(e,T)&(1<<es)-1,T+=es}if(T>D){g&&M(0);break}m&&v(x+131072);var ea=x+er;if(x<q){var eo=h-q,el=Math.min(q,ea);for(eo+x<0&&M(3);x<el;++x)r[x]=s[eo+x]}for(;x<ea;++x)r[x]=r[x-q]}}t.l=E,t.p=ee,t.b=x,t.f=b,E&&(b=1,t.m=k,t.d=_,t.n=L)}while(!b);return x!=r.length&&p?(i=r,(n=0)<0&&(n=0),(null==(a=x)||a>i.length)&&(a=i.length),new o(i.subarray(n,a))):r.subarray(0,x)},D=new o(0),N="undefined"!=typeof TextDecoder&&new TextDecoder;try{N.decode(D,{stream:!0})}catch(e){}function O(e,t,r){let s=r.length-e-1;if(t>=r[s])return s-1;if(t<=r[e])return e;let i=e,n=s,a=Math.floor((i+n)/2);for(;t<r[a]||t>=r[a+1];)t<r[a]?n=a:i=a,a=Math.floor((i+n)/2);return a}"function"==typeof queueMicrotask&&queueMicrotask;class C extends a.Ipv{constructor(e,t,r,s,i){super();const n=t?t.length-1:0,o=r?r.length:0;this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=s||0,this.endKnot=i||n;for(let e=0;e<o;++e){const t=r[e];this.controlPoints[e]=new a.IUQ(t.x,t.y,t.z,t.w)}}getPoint(e,t=new a.Pq0){let r=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),s=function(e,t,r,s){let i=O(e,s,t),n=function(e,t,r,s){let i=[],n=[],a=[];i[0]=1;for(let o=1;o<=r;++o){n[o]=t-s[e+1-o],a[o]=s[e+o]-t;let r=0;for(let e=0;e<o;++e){let t=a[e+1],s=n[o-e],l=i[e]/(t+s);i[e]=r+t*l,r=s*l}i[o]=r}return i}(i,s,e,t),o=new a.IUQ(0,0,0,0);for(let t=0;t<=e;++t){let s=r[i-e+t],a=n[t],l=s.w*a;o.x+=s.x*l,o.y+=s.y*l,o.z+=s.z*l,o.w+=s.w*a}return o}(this.degree,this.knots,this.controlPoints,r);return 1!==s.w&&s.divideScalar(s.w),t.set(s.x,s.y,s.z)}getTangent(e,t=new a.Pq0){var r,s,i;let n=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),o=(r=this.degree,s=this.knots,i=this.controlPoints,function(e){let t=e.length,r=[],s=[];for(let i=0;i<t;++i){let t=e[i];r[i]=new a.Pq0(t.x,t.y,t.z),s[i]=t.w}let i=[];for(let e=0;e<t;++e){let t=r[e].clone();for(let r=1;r<=e;++r)t.sub(i[e-r].clone().multiplyScalar(function(e,t){let r=1;for(let t=2;t<=e;++t)r*=t;let s=1;for(let e=2;e<=t;++e)s*=e;for(let r=2;r<=e-t;++r)s*=r;return r/s}(e,r)*s[r]));i[e]=t.divideScalar(s[0])}return i}(function(e,t,r,s,i){let n=1<e?1:e,o=[],l=O(e,s,t),h=function(e,t,r,s,i){let n=[];for(let e=0;e<=r;++e)n[e]=0;let a=[];for(let e=0;e<=s;++e)a[e]=n.slice(0);let o=[];for(let e=0;e<=r;++e)o[e]=n.slice(0);o[0][0]=1;let l=n.slice(0),h=n.slice(0);for(let s=1;s<=r;++s){l[s]=t-i[e+1-s],h[s]=i[e+s]-t;let r=0;for(let e=0;e<s;++e){let t=h[e+1],i=l[s-e];o[s][e]=t+i;let n=o[e][s-1]/o[s][e];o[e][s]=r+t*n,r=i*n}o[s][s]=r}for(let e=0;e<=r;++e)a[0][e]=o[e][r];for(let e=0;e<=r;++e){let t=0,i=1,l=[];for(let e=0;e<=r;++e)l[e]=n.slice(0);l[0][0]=1;for(let n=1;n<=s;++n){let s=0,h=e-n,c=r-n;e>=n&&(l[i][0]=l[t][0]/o[c+1][h],s=l[i][0]*o[h][c]);let u=h>=-1?1:-h,d=e-1<=c?n-1:r-e;for(let e=u;e<=d;++e)l[i][e]=(l[t][e]-l[t][e-1])/o[c+1][h+e],s+=l[i][e]*o[h+e][c];e<=c&&(l[i][n]=-l[t][n-1]/o[c+1][e],s+=l[i][n]*o[e][c]),a[n][e]=s;let p=t;t=i,i=p}}let c=r;for(let e=1;e<=s;++e){for(let t=0;t<=r;++t)a[e][t]*=c;c*=r-e}return a}(l,s,e,n,t),c=[];for(let e=0;e<r.length;++e){let t=r[e].clone(),s=t.w;t.x*=s,t.y*=s,t.z*=s,c[e]=t}for(let t=0;t<=n;++t){let r=c[l-e].clone().multiplyScalar(h[t][0]);for(let s=1;s<=e;++s)r.add(c[l-e+s].clone().multiplyScalar(h[t][s]));o[t]=r}for(let e=n+1;e<=2;++e)o[e]=new a.IUQ(0,0,0);return o}(r,s,i,n,1)));return t.copy(o[1]).normalize(),t}toJSON(){let e=super.toJSON();return e.degree=this.degree,e.knots=[...this.knots],e.controlPoints=this.controlPoints.map(e=>e.toArray()),e.startKnot=this.startKnot,e.endKnot=this.endKnot,e}fromJSON(e){return super.fromJSON(e),this.degree=e.degree,this.knots=[...e.knots],this.controlPoints=e.controlPoints.map(e=>new a.IUQ(e[0],e[1],e[2],e[3])),this.startKnot=e.startKnot,this.endKnot=e.endKnot,this}}class F extends a.aHM{constructor(e){super(e)}load(e,t,r,s){let i=this,n=""===i.path?a.r6x.extractUrlBase(e):i.path,o=new a.Y9S(this.manager);o.setPath(i.path),o.setResponseType("arraybuffer"),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,function(r){try{t(i.parse(r,n))}catch(t){s?s(t):console.error(t),i.manager.itemError(e)}},r,s)}parse(e,t){var r;let i;if(i="Kaydara FBX Binary  \0",(r=e).byteLength>=i.length&&i===ee(r,0,i.length))s=new G().parse(e);else{let t=ee(e);
1if(!function(e){let t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],r=0;for(let s=0;s<t.length;++s)if(function(t){let s=e[0];return e=e.slice(r+1),r++,s}(0)===t[s])return!1;return!0}(t))throw Error("THREE.FBXLoader: Unknown format.");if(7e3>V(t))throw Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+V(t));s=new B().parse(t)}return new U(new a.Tap(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),this.manager).parse(s)}}class U{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){i=this.parseConnections();let e=this.parseImages(),t=this.parseTextures(e),r=this.parseMaterials(t),s=this.parseDeformers(),a=new H().parse(s);return this.parseScene(s,a,r),n}parseConnections(){let e=new Map;return"Connections"in s&&s.Connections.connections.forEach(function(t){let r=t[0],s=t[1],i=t[2];e.has(r)||e.set(r,{parents:[],children:[]}),e.get(r).parents.push({ID:s,relationship:i}),e.has(s)||e.set(s,{parents:[],children:[]}),e.get(s).children.push({ID:r,relationship:i})}),e}parseImages(){let e={},t={};if("Video"in s.Objects){let r=s.Objects.Video;for(let s in r){let i=r[s];if(e[parseInt(s)]=i.RelativeFilename||i.Filename,"Content"in i){let e=i.Content instanceof ArrayBuffer&&i.Content.byteLength>0,n="string"==typeof i.Content&&""!==i.Content;if(e||n){let e=this.parseImage(r[s]);t[i.RelativeFilename||i.Filename]=e}}}}for(let r in e){let s=e[r];void 0!==t[s]?e[r]=t[s]:e[r]=e[r].split("\\").pop()}return e}parseImage(e){let t,r=e.Content,s=e.RelativeFilename||e.Filename,i=s.slice(s.lastIndexOf(".")+1).toLowerCase();switch(i){case"bmp":t="image/bmp";break;case"jpg":case"jpeg":t="image/jpeg";break;case"png":t="image/png";break;case"tif":t="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",s),t="image/tga";break;case"webp":t="image/webp";break;default:console.warn('FBXLoader: Image type "'+i+'" is not supported.');return}if("string"==typeof r)return"data:"+t+";base64,"+r;{let e=new Uint8Array(r);return window.URL.createObjectURL(new Blob([e],{type:t}))}}parseTextures(e){let t=new Map;if("Texture"in s.Objects){let r=s.Objects.Texture;for(let s in r){let i=this.parseTexture(r[s],e);t.set(parseInt(s),i)}}return t}parseTexture(e,t){let r=this.loadTexture(e,t);r.ID=e.id,r.name=e.attrName;let s=e.WrapModeU,i=e.WrapModeV,n=void 0!==s?s.value:0,o=void 0!==i?i.value:0;if(r.wrapS=0===n?a.GJx:a.ghU,r.wrapT=0===o?a.GJx:a.ghU,"Scaling"in e){let t=e.Scaling.value;r.repeat.x=t[0],r.repeat.y=t[1]}if("Translation"in e){let t=e.Translation.value;r.offset.x=t[0],r.offset.y=t[1]}return r}loadTexture(e,t){let r,s=e.FileName.split(".").pop().toLowerCase(),n=this.manager.getHandler(`.${s}`);null===n&&(n=this.textureLoader);let o=n.path;o||n.setPath(this.textureLoader.path);let l=i.get(e.id).children;if(void 0!==l&&l.length>0&&void 0!==t[l[0].ID]&&(0===(r=t[l[0].ID]).indexOf("blob:")||0===r.indexOf("data:"))&&n.setPath(void 0),void 0===r)return console.warn("FBXLoader: Undefined filename, creating placeholder texture."),new a.gPd;let h=n.load(r);return n.setPath(o),h}parseMaterials(e){let t=new Map;if("Material"in s.Objects){let r=s.Objects.Material;for(let s in r){let i=this.parseMaterial(r[s],e);null!==i&&t.set(parseInt(s),i)}}return t}parseMaterial(e,t){let r,s=e.id,n=e.attrName,o=e.ShadingModel;if("object"==typeof o&&(o=o.value),!i.has(s))return null;let l=this.parseParameters(e,t,s);switch(o.toLowerCase()){case"phong":r=new a.tXL;break;case"lambert":r=new a.G_z;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',o),r=new a.tXL}return r.setValues(l),r.name=n,r}parseParameters(e,t,r){let s={};e.BumpFactor&&(s.bumpScale=e.BumpFactor.value),e.Diffuse?s.color=a.ppV.colorSpaceToWorking(new a.Q1f().fromArray(e.Diffuse.value),a.er$):e.DiffuseColor&&("Color"===e.DiffuseColor.type||"ColorRGB"===e.DiffuseColor.type)&&(s.color=a.ppV.colorSpaceToWorking(new a.Q1f().fromArray(e.DiffuseColor.value),a.er$)),e.DisplacementFactor&&(s.displacementScale=e.DisplacementFactor.value),e.Emissive?s.emissive=a.ppV.colorSpaceToWorking(new a.Q1f().fromArray(e.Emissive.value),a.er$):e.EmissiveColor&&("Color"===e.EmissiveColor.type||"ColorRGB"===e.EmissiveColor.type)&&(s.emissive=a.ppV.colorSpaceToWorking(new a.Q1f().fromArray(e.EmissiveColor.value),a.er$)),e.EmissiveFactor&&(s.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),s.opacity=1-(e.TransparencyFactor?parseFloat(e.TransparencyFactor.value):0),(1===s.opacity||0===s.opacity)&&(s.op
1acity=e.Opacity?parseFloat(e.Opacity.value):null,null===s.opacity&&(s.opacity=1-(e.TransparentColor?parseFloat(e.TransparentColor.value[0]):0))),s.opacity<1&&(s.transparent=!0),e.ReflectionFactor&&(s.reflectivity=e.ReflectionFactor.value),e.Shininess&&(s.shininess=e.Shininess.value),e.Specular?s.specular=a.ppV.colorSpaceToWorking(new a.Q1f().fromArray(e.Specular.value),a.er$):e.SpecularColor&&"Color"===e.SpecularColor.type&&(s.specular=a.ppV.colorSpaceToWorking(new a.Q1f().fromArray(e.SpecularColor.value),a.er$));let n=this;return i.get(r).children.forEach(function(e){let r=e.relationship;switch(r){case"Bump":s.bumpMap=n.getTexture(t,e.ID);break;case"Maya|TEX_ao_map":s.aoMap=n.getTexture(t,e.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":s.map=n.getTexture(t,e.ID),void 0!==s.map&&(s.map.colorSpace=a.er$);break;case"DisplacementColor":s.displacementMap=n.getTexture(t,e.ID);break;case"EmissiveColor":s.emissiveMap=n.getTexture(t,e.ID),void 0!==s.emissiveMap&&(s.emissiveMap.colorSpace=a.er$);break;case"NormalMap":case"Maya|TEX_normal_map":s.normalMap=n.getTexture(t,e.ID);break;case"ReflectionColor":s.envMap=n.getTexture(t,e.ID),void 0!==s.envMap&&(s.envMap.mapping=a.wfO,s.envMap.colorSpace
1=a.er$);break;case"SpecularColor":s.specularMap=n.getTexture(t,e.ID),void 0!==s.specularMap&&(s.specularMap.colorSpace=a.er$);break;case"TransparentColor":case"TransparencyFactor":s.alphaMap=n.getTexture(t,e.ID),s.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",r)}}),s}getTexture(e,t){return"LayeredTexture"in s.Objects&&t in s.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=i.get(t).children[0].ID),e.get(t)}parseDeformers(){let e={},t={};if("Deformer"in s.Objects){let r=s.Objects.Deformer;for(let s in r){let n=r[s],a=i.get(parseInt(s));if("Skin"===n.attrType){let t=this.parseSkeleton(a,r);t.ID=s,a.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),t.geometryID=a.parents[0].ID,e[s]=t}else if("BlendShape"===n.attrType){let e={id:s};e.rawTargets=this.parseMorphTargets(a,r),e.id=s,a.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[s]=e}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){let r=[];return e.children.forEach(function(e){let s=t[e.ID];if("Cluster"!==s.attrType)return;let i={ID:e.ID,indices:[],weights:[],transformLink:new a.kn4().fromArray(s.TransformLink.a)};"Indexes"in s&&(i.indices=s.Indexes.a,i.weights=s.Weights.a),r.push(i)}),{rawBones:r,bones:[]}}parseMorphTargets(e,t){let r=[];for(let s=0;s<e.children.length;s++){let n=e.children[s],a=t[n.ID],o={name:a.attrName,initialWeight:a.DeformPercent,id:a.id,fullWeights:a.FullWeights.a};if("BlendShapeChannel"!==a.attrType)return;o.geoID=i.get(parseInt(n.ID)).children.filter(function(e){return void 0===e.relationship})[0].ID,r.push(o)}return r}parseScene(e,t,r){n=new a.YJl;let o=this.parseModels(e.skeletons,t,r),l=s.Objects.Model,h=this;o.forEach(function(e){let t=l[e.ID];h.setLookAtProperties(e,t),i.get(e.ID).parents.forEach(function(t){let r=o.get(t.ID);void 0!==r&&r.add(e)}),null===e.parent&&n.add(e)}),this.bindSkeleton(e.skeletons,t,o),this.addGlobalSceneSettings(),n.traverse(function(e){if(e.userData.transformData){e.parent&&(e.userData.transformData.parentMatrix=e.parent.matrix,e.userData.transformData.parentMatrixWorld=e.parent.matrixWorld);let t=$(e.userData.transformData);e.applyMatrix4(t),e.updateWorldMatrix()}});let c=new j().parse();1===n.children.length&&n.children[0].isGroup&&(n.children[0].animations=c,n=n.children[0]),n.animations=c}parseModels(e,t,r){let n=new Map,o=s.Objects.Model;for(let s in o){let l=parseInt(s),h=o[s],c=i.get(l),u=this.buildSkeleton(c,e,l,h.attrName);if(!u){switch(h.attrType){case"Camera":u=this.createCamera(c);break;case"Light":u=this.createLight(c);break;case"Mesh":u=this.createMesh(c,t,r);break;case"NurbsCurve":u=this.createCurve(c,t);break;case"LimbNode":case"Root":u=new a.$Kf;break;default:u=new a.YJl}u.name=h.attrName?a.Nwf.sanitizeNodeName(h.attrName):"",u.userData.originalName=h.attrName,u.ID=l}this.getTransformData(u,h),n.set(l,u)}return n}buildSkeleton(e,t,r,s){let i=null;return e.parents.forEach(function(e){for(let n in t){let o=t[n];o.rawBones.forEach(function(t,n){if(t.ID===e.ID){let e=i;(i=new a.$Kf).matrixWorld.copy(t.transformLink),i.name=s?a.Nwf.sanitizeNodeName(s):"",i.userData.originalName=s,i.ID=r,o.bones[n]=i,null!==e&&i.add(e)}})}}),i}createCamera(e){let t,r;if(e.children.forEach(function(e){let t=s.Objects.NodeAttribute[e.ID];void 0!==t&&(r=t)}),void 0===r)t=new a.B69;else{let e=0;void 0!==r.CameraProjectionType&&1===r.CameraProjectionType.value&&(e=1);let s=1;void 0!==r.NearPlane&&(s=r.NearPlane.value/1e3);let i=1e3;void 0!==r.FarPlane&&(i=r.FarPlane.value/1e3);let n=window.innerWidth,o=window.innerHeight;void 0!==r.AspectWidth&&void 0!==r.AspectHeight&&(n=r.AspectWidth.value,o=r.AspectHeight.value);let l=n/o,h=45;void 0!==r.FieldOfView&&(h=r.FieldOfView.value);let c=r.FocalLength?r.FocalLength.value:null;switch(e){case 0:t=new a.ubm(h,l,s,i),null!==c&&t.setFocalLength(c);break;
1case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),t=new a.B69;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+e+"."),t=new a.B69}}return t}createLight(e){let t,r;if(e.children.forEach(function(e){let t=s.Objects.NodeAttribute[e.ID];void 0!==t&&(r=t)}),void 0===r)t=new a.B69;else{let e;e=void 0===r.LightType?0:r.LightType.value;let s=0xffffff;void 0!==r.Color&&(s=a.ppV.colorSpaceToWorking(new a.Q1f().fromArray(r.Color.value),a.er$));let i=void 0===r.Intensity?1:r.Intensity.value/100;void 0!==r.CastLightOnObject&&0===r.CastLightOnObject.value&&(i=0);let n=0;switch(void 0!==r.FarAttenuationEnd&&(n=void 0!==r.EnableFarAttenuation&&0===r.EnableFarAttenuation.value?0:r.FarAttenuationEnd.value),e){case 0:t=new a.HiM(s,i,n,1);break;case 1:t=new a.ZyN(s,i);break;case 2:let o=Math.PI/3;void 0!==r.InnerAngle&&(o=a.cj9.degToRad(r.InnerAngle.value));let l=0;void 0!==r.OuterAngle&&(l=Math.max(l=a.cj9.degToRad(r.OuterAngle.value),1)),t=new a.nCl(s,i,n,o,l,1);break;default:console.warn("THREE.FBXLoader: Unknown light type "+r.LightType.value+", defaulting to a PointLight."),t=new a.HiM(s,i)}void 0!==r.CastShadows&&1===r.CastShadows.value&&(t.castShadow=!0)}return t}createMesh(e,t,r){let s,i=null,n=null,o=[];if(e.children.forEach(function(e){t.has(e.ID)&&(i=t.get(e.ID)),r.has(e.ID)&&o.push(r.get(e.ID))}),o.length>1?n=o:o.length>0?n=o[0]:(n=new a.tXL({name:a.aHM.DEFAULT_MATERIAL_NAME,color:0xcccccc}),o.push(n)),"color"in i.attributes&&o.forEach(function(e){e.vertexColors=!0}),i.groups.length>0){let e=!1;for(let t=0,r=i.groups.length;t<r;t++){let r=i.groups[t];(r.materialIndex<0||r.materialIndex>=o.length)&&(r.materialIndex=o.length,e=!0)}if(e){let e=new a.tXL;o.push(e)}}return i.FBX_Deformer?(s=new a.I46(i,n)).normalizeSkinWeights():s=new a.eaF(i,n),s}createCurve(e,t){let r=e.children.reduce(function(e,r){return t.has(r.ID)&&(e=t.get(r.ID)),e},null),s=new a.mrM({name:a.aHM.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new a.N1A(r,s)}getTransformData(e,t){let r={};"InheritType"in t&&(r.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?r.eulerOrder=Q(t.RotationOrder.value):r.eulerOrder=Q(0),"Lcl_Translation"in t&&(r.translation=t.Lcl_Translation.value),"PreRotation"in t&&(r.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(r.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(r.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(r.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(r.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(r.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(r.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(r.rotationPivot=t.RotationPivot.value),e.userData.transformData=r}setLookAtProperties(e,t){"LookAtProperty"in t&&i.get(e.ID).children.forEach(function(t){if("LookAtProperty"===t.relationship){let r=s.Objects.Model[t.ID];if("Lcl_Translation"in r){let t=r.Lcl_Translation.value;void 0!==e.target?(e.target.position.fromArray(t),n.add(e.target)):e.lookAt(new a.Pq0().fromArray(t))}}})}bindSkeleton(e,t,r){let s=this.parsePoseNodes();for(let n in e){let o=e[n];i.get(parseInt(o.ID)).parents.forEach(function(e){if(t.has(e.ID)){let t=e.ID;i.get(t).parents.forEach(function(e){r.has(e.ID)&&r.get(e.ID).bind(new a.EAD(o.bones),s[e.ID])})}})}}parsePoseNodes(){let e={};if("Pose"in s.Objects){let t=s.Objects.Pose;for(let r in t)if("BindPose"===t[r].attrType&&t[r].NbPoseNodes>0){let s=t[r].PoseNode;Array.isArray(s)?s.forEach(function(t){e[t.Node]=new a.kn4().fromArray(t.Matrix.a)}):e[s.Node]=new a.kn4().fromArray(s.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in s){if("AmbientColor"in s.GlobalSettings){let e=s.GlobalSettings.AmbientColor.value,t=e[0],r=e[1],i=e[2];if(0!==t||0!==r||0!==i){let e=new a.Q1f().setRGB(t,r,i,a.er$);n.add(new a.$p8(e,1))}}"UnitScaleFactor"in s.GlobalSettings&&(n.userData.unitScaleFactor=s.GlobalSettings.UnitScaleFactor.value)}}}class H{constructor(){this.negativeMaterialIndices=!1}parse(e){let t=new Map;if("Geometry"in s.Objects){let r=s.Objects.Geometry;for(let s in r){let n=i.get(parseInt(s)),a=this.parseGeometry(n,r[s],e);t.set(parseInt(s),a)}}return!0===this.negativeMaterialIndices&&console.warn("THREE.FBXLoader: The FBX file contains invali
1d (negative) material indices. The asset might not render as expected."),t}parseGeometry(e,t,r){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,r);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,r){let i=r.skeletons,n=[],a=e.parents.map(function(e){return s.Objects.Model[e.ID]});if(0===a.length)return;let o=e.children.reduce(function(e,t){return void 0!==i[t.ID]&&(e=i[t.ID]),e},null);e.children.forEach(function(e){void 0!==r.morphTargets[e.ID]&&n.push(r.morphTargets[e.ID])});let l=a[0],h={};"RotationOrder"in l&&(h.eulerOrder=Q(l.RotationOrder.value)),"InheritType"in l&&(h.inheritType=parseInt(l.InheritType.value)),"GeometricTranslation"in l&&(h.translation=l.GeometricTranslation.value),"GeometricRotation"in l&&(h.rotation=l.GeometricRotation.value),"GeometricScaling"in l&&(h.scale=l.GeometricScaling.value);let c=$(h);return this.genGeometry(t,o,n,c)}genGeometry(e,t,r,s){let i=new a.LoY;e.attrName&&(i.name=e.attrName);let n=this.parseGeoNode(e,t),o=this.genBuffers(n),l=new a.qtW(o.vertex,3);if(l.applyMatrix4(s),i.setAttribute("position",l),o.colors.length>0&&i.setAttribute("color",new a.qtW(o.colors,3)),t&&(i.setAttribute("skinIndex",new a.A$4(o.weightsIndices,4)),i.setAttribute("skinWeight",new a.qtW(o.vertexWeights,4)),i.FBX_Deformer=t),o.normal.length>0){let e=new a.dwI().getNormalMatrix(s),t=new a.qtW(o.normal,3);t.applyNormalMatrix(e),i.setAttribute("normal",t)}
1if(o.uvs.forEach(function(e,t){let r=0===t?"uv":`uv${t}`;i.setAttribute(r,new a.qtW(o.uvs[t],2))}),n.material&&"AllSame"!==n.material.mappingType){let e=o.materialIndex[0],t=0;if(o.materialIndex.forEach(function(r,s){r!==e&&(i.addGroup(t,s-t,e),e=r,t=s)}),i.groups.length>0){let t=i.groups[i.groups.length-1],r=t.start+t.count;r!==o.materialIndex.length&&i.addGroup(r,o.materialIndex.length-r,e)}0===i.groups.length&&i.addGroup(0,o.materialIndex.length,o.materialIndex[0])}return this.addMorphTargets(i,e,r,s),i}parseGeoNode(e,t){let r={};if(r.vertexPositions=void 0!==e.Vertices?e.Vertices.a:[],r.vertexIndices=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],e.LayerElementColor&&e.LayerElementColor[0].Colors&&(r.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(r.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(r.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){r.uv=[];let t=0;for(;e.LayerElementUV[t];)e.LayerElementUV[t].UV&&r.uv.push(this.parseUVs(e.LayerElementUV[t])),t++}return r.weightTable={},null!==t&&(r.skeleton=t,t.rawBones.forEach(function(e,t){e.indices.forEach(function(s,i){void 0===r.weightTable[s]&&(r.weightTable[s]=[]),r.weightTable[s].push({id:t,weight:e.weights[i]})})})),r}genBuffers(e){let t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},r=0,s=0,i=!1,n=[],a=[],o=[],l=[],h=[],c=[],u=this;return e.vertexIndices.forEach(function(d,p){let m,f=!1;d<0&&(d^=-1,f=!0);let g=[],v=[];if(n.push(3*d,3*d+1,3*d+2),e.color){let t=Y(p,r,d,e.color);o.push(t[0],t[1],t[2])}if(e.skeleton){if(void 0!==e.weightTable[d]&&e.weightTable[d].forEach(function(e){v.push(e.weight),g.push(e.id)}),v.length>4){i||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),i=!0);let e=[0,0,0,0],t=[0,0,0,0];v.forEach(function(r,s){let i=r,n=g[s];t.forEach(function(t,r,s){if(i>t){s[r]=i,i=t;let a=e[r];e[r]=n,n=a}})}),g=e,v=t}for(;v.length<4;)v.push(0),g.push(0);for(let e=0;e<4;++e)h.push(v[e]),c.push(g[e])}if(e.normal){let t=Y(p,r,d,e.normal);a.push(t[0],t[1],t[2])}e.material&&"AllSame"!==e.material.mappingType&&(m=Y(p,r,d,e.material)[0])<0&&(u.negativeMaterialIndices=!0,m=0),e.uv&&e.uv.forEach(function(e,t){let s=Y(p,r,d,e);void 0===l[t]&&(l[t]=[]),l[t].push(s[0]),l[t].push(s[1])}),s++,f&&(u.genFace(t,e,n,m,a,o,l,h,c,s),r++,s=0,n=[],a=[],o=[],l=[],h=[],c=[])}),t}getNormalNewell(e){let t=new a.Pq0(0,0,0);for(let r=0;r<e.length;r++){let s=e[r],i=e[(r+1)%e.length];t.x+=(s.y-i.y)*(s.z+i.z),t.y+=(s.z-i.z)*(s.x+i.x),t.z+=(s.x-i.x)*(s.y+i.y)}return t.normalize(),t}getNormalTangentAndBitangent(e){let t=this.getNormalNewell(e),r=(Math.abs(t.z)>.5?new a.Pq0(0,1,0):new a.Pq0(0,0,1)).cross(t).normalize(),s=t.clone().cross(r).normalize();return{normal:t,tangent:r,bitangent:s}}flattenVertex(e,t,r){return new a.I9Y(e.dot(t),e.dot(r))}genFace(e,t,r,s,i,n,o,l,h,c){let u;if(c>3){let e=[],s=t.baseVertexPositions||t.vertexPositions;for(let t=0;t<r.length;t+=3)e.push(new a.Pq0(s[r[t]],s[r[t+1]],s[r[t+2]]));let{tangent:i,bitangent:n}=this.getNormalTangentAndBitangent(e),o=[];for(let t of e)o.push(this.flattenVertex(t,i,n));u=a.xJ6.triangulateShape(o,[])}else u=[[0,1,2]];for(let[a,c,d]of u)e.vertex.push(t.vertexPositions[r[3*a]]),e.vertex.push(t.vertexPositions[r[3*a+1]]),e.vertex.push(t.vertexPositions[r[3*a+2]]),e.vertex.push(t.vertexPositions[r[3*c]]),e.vertex.push(t.vertexPositions[r[3*c+1]]),e.vertex.push(t.vertexPositions[r[3*c+2]]),e.vertex.push(t.vertexPositions[r[3*d]]),e.vertex.push(t.vertexPositions[r[3*d+1]]),e.vertex.push(t.vertexPositions[r[3*d+2]]),t.skeleton&&(e.vertexWeights.push(l[4*a]),e.vertexWeights.push(l[4*a+1]),e.vertexWeights.push(l[4*a+2]),e.vertexWeights.push(l[4*a+3]),e.vertexWeights.push(l[4*c]),e.vertexWeights.push(l[4*c+1]),e.vertexWeights.push(l[4*c+2]),e.vertexWeights.push(l[4*c+3]),e.vertexWeights.push(l[4*d]),e.vertexWeights.push(l[4*d+1]),e.vertexWeights.push(l[4*d+2]),e.vertexWeights.push(l[4*d+3]),e.weightsIndices.push(h[4*a]),e.weightsIndices.push(h[4*a+1]),e.weightsIndices.push(h[4*a+2]),e.weightsIndices.push(h[4*a+3]),e.weightsIndices.push(h[4*c]),e.weightsIndices.push(h[4*c+1]),e.weightsIndices.push(h[4*c+2]),e.weightsIndices.push(h[4*c+3]),e.
1weightsIndices.push(h[4*d]),e.weightsIndices.push(h[4*d+1]),e.weightsIndices.push(h[4*d+2]),e.weightsIndices.push(h[4*d+3])),t.color&&(e.colors.push(n[3*a]),e.colors.push(n[3*a+1]),e.colors.push(n[3*a+2]),e.colors.push(n[3*c]),e.colors.push(n[3*c+1]),e.colors.push(n[3*c+2]),e.colors.push(n[3*d]),e.colors.push(n[3*d+1]),e.colors.push(n[3*d+2])),t.material&&"AllSame"!==t.material.mappingType&&(e.materialIndex.push(s),e.materialIndex.push(s),e.materialIndex.push(s)),t.normal&&(e.normal.push(i[3*a]),e.normal.push(i[3*a+1]),e.normal.push(i[3*a+2]),e.normal.push(i[3*c]),e.normal.push(i[3*c+1]),e.normal.push(i[3*c+2]),e.normal.push(i[3*d]),e.normal.push(i[3*d+1]),e.normal.push(i[3*d+2])),t.uv&&t.uv.forEach(function(t,r){void 0===e.uvs[r]&&(e.uvs[r]=[]),e.uvs[r].push(o[r][2*a]),e.uvs[r].push(o[r][2*a+1]),e.uvs[r].push(o[r][2*c]),e.uvs[r].push(o[r][2*c+1]),e.uvs[r].push(o[r][2*d]),e.uvs[r].push(o[r][2*d+1])})}addMorphTargets(e,t,r,i){if(0===r.length)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];let n=this;r.forEach(function(r){r.rawTargets.forEach(function(r){let a=s.Objects.Geometry[r.geoID];void 0!==a&&n.genMorphGeometry(e,t,a,i,r.name)})})}genMorphGeometry(e,t,r,s,i){let n=void 0!==t.Vertices?t.Vertices.a:[],o=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],l=void 0!==r.Vertices?r.Vertices.a:[],h=void 0!==r.Indexes?r.Indexes.a:[],c=new Float32Array(3*e.attributes.position.count);for(let e=0;e<h.length;e++){let t=3*h[e];c[t]=l[3*e],c[t+1]=l[3*e+1],c[t+2]=l[3*e+2]}let u=this.genBuffers({vertexIndices:o,vertexPositions:c,baseVertexPositions:n}),d=new a.qtW(u.vertex,3);d.name=i||r.attrName,d.applyMatrix4(s),e.morphAttributes.position.push(d)}parseNormals(e){let t=e.MappingInformationType,r=e.ReferenceInformationType,s=e.Normals.a,i=[];return"IndexToDirect"===r&&("NormalIndex"in e?i=e.NormalIndex.a:"NormalsIndex"in e&&(i=e.NormalsIndex.a)),{dataSize:3,buffer:s,indices:i,mappingType:t,referenceType:r}}parseUVs(e){let t=e.MappingInformationType,r=e.ReferenceInformationType,s=e.UV.a,i=[];return"IndexToDirect"===r&&(i=e.UVIndex.a),{dataSize:2,buffer:s,indices:i,mappingType:t,referenceType:r}}parseVertexColors(e){let t=e.MappingInformationType,r=e.ReferenceInformationType,s=e.Colors.a,i=[];"IndexToDirect"===r&&(i=e.ColorIndex.a);for(let e=0,t=new a.Q1f;e<s.length;e+=4)t.fromArray(s,e),a.ppV.colorSpaceToWorking(t,a.er$),t.toArray(s,e);return{dataSize:4,buffer:s,indices:i,mappingType:t,referenceType:r}}parseMaterialIndices(e){let t=e.MappingInformationType,r=e.ReferenceInformationType;if("NoMappingInformation"===t)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:r};let s=e.Materials.a,i=[];for(let e=0;e<s.length;++e)i.push(e);return{dataSize:1,buffer:s,indices:i,mappingType:t,referenceType:r}}parseNurbsGeometry(e){let t,r,s=parseInt(e.Order);if(isNaN(s))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new a.LoY;let i=s-1,n=e.KnotVector.a,o=[],l=e.Points.a;for(let e=0,t=l.length;e<t;e+=4)o.push(new a.IUQ().fromArray(l,e));if("Closed"===e.Form)o.push(o[0]);else if("Periodic"===e.Form){t=i,r=n.length-1-t;for(let e=0;e<i;++e)o.push(o[e])}let h=new C(i,n,o,t,r).getPoints(12*o.length);return new a.LoY().setFromPoints(h)}}class j{parse(){let e=[],t=this.parseClips();if(void 0!==t)for(let r in t){let s=t[r],i=this.addClip(s);e.push(i)}return e}parseClips(){if(void 0===s.Objects.AnimationCurve)return;let e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);let t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){let e=s.Objects.AnimationCurveNode,t=new Map;for(let r in e){let s=e[r];if(null!==s.attrName.match(/S|R|T|DeformPercent/)){let e={id:s.id,attr:s.attrName,curves:{}};t.set(e.id,e)}}return t}parseAnimationCurves(e){let t=s.Objects.AnimationCurve;for(let r in t){let s={id:t[r].id,times:t[r].KeyTime.a.map(X),values:t[r].KeyValueFloat.a},n=i.get(s.id);if(void 0!==n){let t=n.parents[0].ID,r=n.parents[0].relationship;r.match(/X/)?e.get(t).curves.x=s:r.match(/Y/)?e.get(t).curves.y=s:r.match(/Z/)?e.get(t).curves.z=s:r.match(/DeformPercent/)&&e.has(t)&&(e.get(t).curves.morph=s)}}}parseAnimationLayers(e){let t=s.Objects.AnimationLayer,r=new Map;for(let o in t){let t=[],l=i.get(parseInt(o));
1void 0!==l&&(l.children.forEach(function(r,o){if(e.has(r.ID)){let l=e.get(r.ID);if(void 0!==l.curves.x||void 0!==l.curves.y||void 0!==l.curves.z){if(void 0===t[o]){let e=i.get(r.ID).parents.filter(function(e){return void 0!==e.relationship})[0].ID;if(void 0!==e){let i=s.Objects.Model[e.toString()];if(void 0===i)return void console.warn("THREE.FBXLoader: Encountered a unused curve.",r);let l={modelName:i.attrName?a.Nwf.sanitizeNodeName(i.attrName):"",ID:i.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};n.traverse(function(e){e.ID===i.id&&(l.transform=e.matrix,e.userData.transformData&&(l.eulerOrder=e.userData.transformData.eulerOrder))}),l.transform||(l.transform=new a.kn4),"PreRotation"in i&&(l.preRotation=i.PreRotation.value),"PostRotation"in i&&(l.postRotation=i.PostRotation.value),t[o]=l}}t[o]&&(t[o][l.attr]=l)}else if(void 0!==l.curves.morph){if(void 0===t[o]){let e=i.get(r.ID).parents.filter(function(e){return void 0!==e.relationship})[0].ID,n=i.get(e).parents[0].ID,l=i.get(n).parents[0].ID,h=i.get(l).parents[0].ID,c=s.Objects.Model[h],u={modelName:c.attrName?a.Nwf.sanitizeNodeName(c.attrName):"",morphName:s.Objects.Deformer[e].attrName};t[o]=u}t[o][l.attr]=l}}}),r.set(parseInt(o),t))}return r}parseAnimStacks(e){let t=s.Objects.AnimationStack,r={};for(let s in t){let n=i.get(parseInt(s)).children;n.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");let a=e.get(n[0].ID);r[s]={name:t[s].attrName,layer:a}}return r}addClip(e){let t=[],r=this;return e.layer.forEach(function(e){t=t.concat(r.generateTracks(e))}),new a.tz3(e.name,-1,t)}generateTracks(e){let t=[],r=new a.Pq0,s=new a.Pq0;if(e.transform&&e.transform.decompose(r,new a.PTz,s),r=r.toArray(),s=s.toArray(),void 0!==e.T&&Object.keys(e.T.curves).length>0){let s=this.generateVectorTrack(e.modelName,e.T.curves,r,"position");void 0!==s&&t.push(s)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){let r=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);void 0!==r&&t.push(r)}if(void 0!==e.S&&Object.keys(e.S.curves).length>0){let r=this.generateVectorTrack(e.modelName,e.S.curves,s,"scale");void 0!==r&&t.push(r)}if(void 0!==e.DeformPercent){let r=this.generateMorphTrack(e);void 0!==r&&t.push(r)}return t}generateVectorTrack(e,t,r,s){let i=this.getTimesForAllAxes(t),n=this.getKeyframeTrackValues(i,t,r);return new a.RiT(e+"."+s,i,n)}generateRotationTrack(e,t,r,s,i){let n,o;
1if(void 0!==t.x&&void 0!==t.y&&void 0!==t.z){let e=this.interpolateRotations(t.x,t.y,t.z,i);n=e[0],o=e[1]}let l=Q(0);void 0!==r&&((r=r.map(a.cj9.degToRad)).push(l),r=new a.O9p().fromArray(r),r=new a.PTz().setFromEuler(r)),void 0!==s&&((s=s.map(a.cj9.degToRad)).push(l),s=new a.O9p().fromArray(s),s=new a.PTz().setFromEuler(s).invert());let h=new a.PTz,c=new a.O9p,u=[];if(!o||!n)return new a.MBL(e+".quaternion",[0],[0]);for(let e=0;e<o.length;e+=3)c.set(o[e],o[e+1],o[e+2],i),h.setFromEuler(c),void 0!==r&&h.premultiply(r),void 0!==s&&h.multiply(s),e>2&&0>new a.PTz().fromArray(u,(e-3)/3*4).dot(h)&&h.set(-h.x,-h.y,-h.z,-h.w),h.toArray(u,e/3*4);return new a.MBL(e+".quaternion",n,u)}generateMorphTrack(e){let t=e.DeformPercent.curves.morph,r=t.values.map(function(e){return e/100}),s=n.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new a.Hit(e.modelName+".morphTargetInfluences["+s+"]",t.times,r)}getTimesForAllAxes(e){let t=[];if(void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),(t=t.sort(function(e,t){return e-t})).length>1){let e=1,r=t[0];for(let s=1;s<t.length;s++){let i=t[s];i!==r&&(t[e]=i,r=i,e++)}t=t.slice(0,e)}return t}getKeyframeTrackValues(e,t,r){let s=[],i=-1,n=-1,a=-1;return e.forEach(function(e){if(t.x&&(i=t.x.times.indexOf(e)),t.y&&(n=t.y.times.indexOf(e)),t.z&&(a=t.z.times.indexOf(e)),-1!==i){let e=t.x.values[i];s.push(e),r[0]=e}else s.push(r[0]);if(-1!==n){let e=t.y.values[n];s.push(e),r[1]=e}else s.push(r[1]);if(-1!==a){let e=t.z.values[a];s.push(e),r[2]=e}else s.push(r[2])}),s}interpolateRotations(e,t,r,s){let i=[],n=[];i.push(e.times[0]),n.push(a.cj9.degToRad(e.values[0])),n.push(a.cj9.degToRad(t.values[0])),n.push(a.cj9.degToRad(r.values[0]));for(let o=1;o<e.values.length;o++){let l=[e.values[o-1],t.values[o-1],r.values[o-1]];if(isNaN(l[0])||isNaN(l[1])||isNaN(l[2]))continue;let h=l.map(a.cj9.degToRad),c=[e.values[o],t.values[o],r.values[o]];if(isNaN(c[0])||isNaN(c[1])||isNaN(c[2]))continue;let u=c.map(a.cj9.degToRad),d=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],p=[Math.abs(d[0]),Math.abs(d[1]),Math.abs(d[2])];if(p[0]>=180||p[1]>=180||p[2]>=180){let t=Math.max(...p)/180,r=new a.O9p(...h,s),l=new a.O9p(...u,s),c=new a.PTz().setFromEuler(r),d=new a.PTz().setFromEuler(l);c.dot(d)&&d.set(-d.x,-d.y,-d.z,-d.w);let m=e.times[o-1],f=e.times[o]-m,g=new a.PTz,v=new a.O9p;for(let e=0;e<1;e+=1/t)g.copy(c.clone().slerp(d.clone(),e)),i.push(m+e*f),v.setFromQuaternion(g,s),n.push(v.x),n.push(v.y),n.push(v.z)}else i.push(e.times[o]),n.push(a.cj9.degToRad(e.values[o])),n.push(a.cj9.degToRad(t.values[o])),n.push(a.cj9.degToRad(r.values[o]))}return[i,n]}}class B{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new z,this.nodeStack=[],this.currentProp=[],this.currentPropName="";let t=this,r=e.split(/[\r\n]+/);return r.forEach(function(e,s){let i=e.match(/^[\s\t]*;/),n=e.match(/^[\s\t]*$/);if(i||n)return;let a=e.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),o=e.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=e.match("^\\t{"+(t.currentIndent-1)+"}}");a?t.parseNodeBegin(e,a):o?t.parseNodeProperty(e,o,r[++s]):l?t.popStack():e.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(e)}),this.allNodes}parseNodeBegin(e,t){let r=t[1].trim().replace(/^"/,"").replace(/"$/,""),s=t[2].split(",").map(function(e){return e.trim().replace(/^"/,"").replace(/"$/,"")}),i={name:r},n=this.parseNodeAttr(s),a=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(r,i):r in a?("PoseNode"===r?a.PoseNode.push(i):void 0!==a[r].id&&(a[r]={},a[r][a[r].id]=a[r]),""!==n.id&&(a[r][n.id]=i)):"number"==typeof n.id?(a[r]={},a[r][n.id]=i):"Properties70"!==r&&("PoseNode"===r?a[r]=[i]:a[r]=i),"number"==typeof n.id&&(i.id=n.id),""!==n.name&&(i.attrName=n.name),""!==n.type&&(i.attrType=n.type),this.pushStack(i)}parseNodeAttr(e){let t=e[0];""!==e[0]&&isNaN(t=parseInt(e[0]))&&(t=e[0]);let r="",s="";return e.length>1&&(r=e[1].replace(/^(\w+)::/,""),s=e[2]),{id:t,name:r,type:s}}parseNodeProperty(e,t,r){let s=t[1].replace(/^"/,"").replace(/"$/,"").trim(),i=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===s&&","===i&&(i=r.replace(/"/g,"").replace(/,$/,"").trim());let n=this.getCurrentNode();if("Properties70"===n.name)return void this.parseNodeSpecialProperty(e,s,i);if("C"===s){let e=i.split(",").slice(1),t=parseInt(e[0]),r=parseInt(e[1]),a=i.split(",").slice(3);a=a.map(function(e){return e.trim().replace(/^"/,"")}),s="connections",function(e,t){for(let r=0,s=e.length,i=t.length;r<i;r++,s++)e[s]=t[r]}(i=[t,r],a),void 0===n[s]&&(n[s]=[])}"Node"===s&&(n.id=i),s in n&&Array.isArray(n[s])?n[s].push(i):"a"!==s?
1n[s]=i:n.a=i,this.setCurrentProp(n,s),"a"===s&&","!==i.slice(-1)&&(n.a=J(i))}parseNodePropertyContinued(e){let t=this.getCurrentNode();t.a+=e,","!==e.slice(-1)&&(t.a=J(t.a))}parseNodeSpecialProperty(e,t,r){let s=r.split('",').map(function(e){return e.trim().replace(/^\"/,"").replace(/\s/,"_")}),i=s[0],n=s[1],a=s[2],o=s[3],l=s[4];switch(n){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=J(l)}this.getPrevNode()[i]={type:n,type2:a,flag:o,value:l},this.setCurrentProp(this.getPrevNode(),i)}}class G{parse(e){let t=new W(e);t.skip(23);let r=t.getUint32();if(r<6400)throw Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+r);let s=new z;for(;!this.endOfContent(t);){let e=this.parseNode(t,r);null!==e&&s.add(e.name,e)}return s}endOfContent(e){return e.size()%16==0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){let r={},s=t>=7500?e.getUint64():e.getUint32(),i=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();let n=e.getUint8(),a=e.getString(n);if(0===s)return null;let o=[];for(let t=0;t<i;t++)o.push(this.parseProperty(e));let l=o.length>0?o[0]:"",h=o.length>1?o[1]:"",c=o.length>2?o[2]:"";for(r.singleProperty=1===i&&e.getOffset()===s;s>e.getOffset();){let s=this.parseNode(e,t);null!==s&&this.parseSubNode(a,r,s)}return r.propertyList=o,"number"==typeof l&&(r.id=l),""!==h&&(r.attrName=h),""!==c&&(r.attrType=c),""!==a&&(r.name=a),r}parseSubNode(e,t,r){if(!0===r.singleProperty){let e=r.propertyList[0];Array.isArray(e)?(t[r.name]=r,r.a=e):t[r.name]=e}else if("Connections"===e&&"C"===r.name){let e=[];r.propertyList.forEach(function(t,r){0!==r&&e.push(t)}),void 0===t.connections&&(t.connections=[]),t.connections.push(e)}else if("Properties70"===r.name)Object.keys(r).forEach(function(e){t[e]=r[e]});else if("Properties70"===e&&"P"===r.name){let e,s=r.propertyList[0],i=r.propertyList[1],n=r.propertyList[2],a=r.propertyList[3];0===s.indexOf("Lcl ")&&(s=s.replace("Lcl ","Lcl_")),0===i.indexOf("Lcl ")&&(i=i.replace("Lcl ","Lcl_")),e="Color"===i||"ColorRGB"===i||"Vector"===i||"Vector3D"===i||0===i.indexOf("Lcl_")?[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:r.propertyList[4],t[s]={type:i,type2:n,flag:a,value:e}}else void 0===t[r.name]?"number"==typeof r.id?(t[r.name]={},t[r.name][r.id]=r):t[r.name]=r:"PoseNode"===r.name?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(r)):void 0===t[r.name][r.id]&&(t[r.name][r.id]=r)}parseProperty(e){let t,r=e.getString(1);switch(r){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return t=e.getUint32(),e.getArrayBuffer(t);case"S":return t=e.getUint32(),e.getString(t);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var s,i;let n=e.getUint32(),a=e.getUint32(),o=e.getUint32();if(0===a)switch(r){case"b":case"c":return e.getBooleanArray(n);case"d":return e.getFloat64Array(n);case"f":return e.getFloat32Array(n);case"i":return e.getInt32Array(n);case"l":return e.getInt64Array(n)}let l=new W(L((s=new Uint8Array(e.getArrayBuffer(o))).subarray((i=void 0,((15&s[0])!=8||s[0]>>4>7||(s[0]<<8|s[1])%31)&&M(6,"invalid zlib data"),(s[1]>>5&1)==+!i&&M(6,"invalid zlib data: "+(32&s[1]?"need":"unexpected")+" dictionary"),(s[1]>>3&4)+2),-4),{i:2},void 0,void 0).buffer);switch(r){case"b":case"c":return l.getBooleanArray(n);case"d":return l.getFloat64Array(n);case"f":return l.getFloat32Array(n);case"i":return l.getInt32Array(n);case"l":return l.getInt64Array(n)}break;default:throw Error("THREE.FBXLoader: Unknown property type "+r)}}}class W{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return(1&this.getUint8())==1}getBooleanArray(e){let t=[];for(let r=0;r<e;r++)t.push(this.getBoolean());return t}getUint8(){let e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){let e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){let e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){let t=[];for(let r=0;r<e;r++)t.push(this.getInt32());return t}getUint32(){let e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return(this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),0x80000000&t)?(t=~t,0xffffffff==(e=~e)&&(t=t+1|0),-(0x100000000*t+(e=e+1|0))):0x100000000*t+e}getInt64Array(e){let t=[];for(let r=0;r<e;r++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),0x100000000*t+e}getFloat32(){let e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){let t=[];for(let r=0;r<e;r++)t.push(this.getFloat32());return t}getFloat64(){let e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){let t=[];for(let r=0;r<e;r++)t.push(this.getFloat64());return t}getArrayBuffer(e){let t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){let t=this.offset,r=new Uint8Array(this.dv.buffer,t,e);this.skip(e);let s=r.indexOf(0);return s>=0&&(r=new Uint8Array(this.dv.buffer,t,s)),this._textDecoder.decode(r)}}class z{add(e,t){this[e]=t}}function V(e){let t=e.match(/FBXVersion: (\d+)/);if(t)return parseInt(t[1]);throw Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function X(e){return e/46186158e3}let K=[];function Y(e,t,r,s){let i;switch(s.mappingType){case"ByPolygonVertex":i=e;break;case"ByPolygon":i=t;break;
1case"ByVertice":i=r;break;case"AllSame":i=s.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+s.mappingType)}"IndexToDirect"===s.referenceType&&(i=s.indices[i]);let n=i*s.dataSize,a=n+s.dataSize;var o=K,l=s.buffer,h=n,c=a;for(let e=h,t=0;e<c;e++,t++)o[t]=l[e];return o}let q=new a.O9p,Z=new a.Pq0;function $(e){let t=new a.kn4,r=new a.kn4,s=new a.kn4,i=new a.kn4,n=new a.kn4,o=new a.kn4,l=new a.kn4,h=new a.kn4,c=new a.kn4,u=new a.kn4,d=new a.kn4,p=new a.kn4,m=e.inheritType?e.inheritType:0;e.translation&&t.setPosition(Z.fromArray(e.translation));let f=Q(0);if(e.preRotation){let t=e.preRotation.map(a.cj9.degToRad);t.push(f),r.makeRotationFromEuler(q.fromArray(t))}if(e.rotation){let t=e.rotation.map(a.cj9.degToRad);t.push(e.eulerOrder||f),s.makeRotationFromEuler(q.fromArray(t))}if(e.postRotation){let t=e.postRotation.map(a.cj9.degToRad);t.push(f),i.makeRotationFromEuler(q.fromArray(t)),i.invert()}e.scale&&n.scale(Z.fromArray(e.scale)),e.scalingOffset&&l.setPosition(Z.fromArray(e.scalingOffset)),e.scalingPivot&&o.setPosition(Z.fromArray(e.scalingPivot)),e.rotationOffset&&h.setPosition(Z.fromArray(e.rotationOffset)),e.rotationPivot&&c.setPosition(Z.fromArray(e.rotationPivot)),e.parentMatrixWorld&&(d.copy(e.parentMatrix),u.copy(e.parentMatrixWorld));let g=r.clone().multiply(s).multiply(i),v=new a.kn4;v.extractRotation(u);let y=new a.kn4;y.copyPosition(u);let b=y.clone().invert().multiply(u),T=v.clone().invert().multiply(b),x=new a.kn4;if(0===m)x.copy(v).multiply(g).multiply(T).multiply(n);else if(1===m)x.copy(v).multiply(T).multiply(g).multiply(n);else{let e=new a.kn4().scale(new a.Pq0().setFromMatrixScale(d)).clone().invert(),t=T.clone().multiply(e);x.copy(v).multiply(g).multiply(t).multiply(n)}let w=c.clone().invert(),E=o.clone().invert(),_=t.clone().multiply(h).multiply(c).multiply(r).multiply(s).multiply(i).multiply(w).multiply(l).multiply(o).multiply(n).multiply(E),R=new a.kn4().copyPosition(_),S=u.clone().multiply(R);return p.copyPosition(S),(_=p.clone().multiply(x)).premultiply(u.invert()),_}function Q(e){let t=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===(e=e||0)?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),t[0]):t[e]}function J(e){return e.split(",").map(function(e){return parseFloat(e)})}function ee(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=e.byteLength),new TextDecoder().decode(new Uint8Array(e,t,r))}},80671:(e,t,r)=>{r.d(t,{U:()=>s});class s{constructor(){this.rules={A:["[A] =aa"," [ARE] =aa RR"," [AR]O=aa RR","[AR]#=E RR"," ^[AS]#=E SS","[A]WA=aa","[AW]=aa"," :[ANY]=E nn I","[A]^+#=E","#:[ALLY]=aa nn I"," [AL]#=aa nn","[AGAIN]=aa kk E nn","#:[AG]E=I kk","[A]^+:#=aa",":[A]^+ =E","[A]^%=E"," [ARR]=aa RR","[ARR]=aa RR"," :[AR] =aa RR","[AR] =E","[AR]=aa RR","[AIR]=E RR","[AI]=E","[AY]=E","[AU]=aa","#:[AL] =aa nn","#:[ALS] =aa nn SS","[ALK]=aa kk","[AL]^=aa nn"," :[ABLE]=E PP aa nn","[ABLE]=aa PP aa nn","[ANG]+=E nn kk","[A]=aa"],B:[" [BE]^#=PP I","[BEING]=PP I I nn"," [BOTH] =PP O TH"," [BUS]#=PP I SS","[BUIL]=PP I nn","[B]=PP"],C:[" [CH]^=kk","^E[CH]=kk","[CH]=CH"," S[CI]#=SS aa","[CI]A=SS","[CI]O=SS","[CI]EN=SS","[C]+=SS","[CK]=kk","[COM]%=kk aa PP","[C]=kk"],D:["#:[DED] =DD I DD",".E[D] =DD","#^:E[D] =DD"," [DE]^#=DD I"," [DO] =DD U"," [DOES]=DD aa SS"," [DOING]=DD U I nn"," [DOW]=DD aa","[DU]A=kk U","[D]=DD"],E:["#:[E] =","'^:[E] ="," :[E] =I","#[ED] =DD","#:[E]D =","[EV]ER=E FF","[E]^%=I","[ERI]#=I RR I","[ERI]=E RR I","#:[ER]#=E","[ER]#=E RR","[ER]=E"," [EVEN]=I FF E nn","#:[E]W=","@[EW]=U","[EW]=I U","[E]O=I","#:&[ES] =I SS","#:[E]S =","#:[ELY] =nn I","#:[EMENT]=PP E nn DD","[EFUL]=FF U nn","[EE]=I","[EARN]=E nn"," [EAR]^=E","[EAD]=E DD","#:[EA] =I aa","[EA]SU=E","[EA]=I","[EIGH]=E","[EI]=I"," [EYE]=aa","[EY]=I","[EU]=I U","[E]=E"],F:["[FUL]=FF U nn","[F]=FF"],G:["[GIV]=kk I FF"," [G]I^=kk","[GE]T=kk E","SU[GGES]=kk kk E SS","[GG]=kk"," B#[G]=kk","[G]+=kk","[GREAT]=kk RR E DD","#[GH]=","[G]=kk"],H:[" [HAV]=I aa FF"," [HERE]=I I RR"," [HOUR]=aa EE","[HOW]=I aa","[H]#=I","[H]="],I:[" [IN]=I nn"," [I] =aa","[IN]D=aa nn","[IER]=I E","#:R[IED] =I DD","[IED] =aa DD","[IEN]=I E nn","[IE]T=aa E"," :[I]%=aa","[I]%=I","[IE]=I","[I]^+:#=I","[IR]#=aa RR","[IZ]%=aa SS","[IS]%=aa SS","[I]D%=aa","+^[I]^+=I","[I]T%=aa","#^:[I]^+=I","[I]^+=aa","[IR]=E","[IGH]=aa","[ILD]=aa nn DD","[IGN] =aa nn","[IGN]^=aa nn","[IGN]%=aa nn","[IQUE]=I kk","[I]=I"],J:["[J]=kk"],K:[" [K]N=","[K]=kk"],L:["[LO]C#=nn O","L[L]=","#^:[L]%=aa nn","[LEAD]=nn I DD","[L]=nn"],M:["[MOV]=PP U FF","[M]=PP"],N:["E[NG]+=nn kk","[NG]R=nn kk","[NG]#=nn kk","[NGL]%=nn kk aa nn","[NG]=nn","[NK]=nn kk"," [NOW] =nn aa","[N]=nn"],O:["[OF] =aa FF","[OROUGH
1]=E O","#:[OR] =E","#:[ORS] =E SS","[OR]=aa RR"," [ONE]=FF aa nn","[OW]=O"," [OVER]=O FF E","[OV]=aa FF","[O]^%=O","[O]^EN=O","[O]^I#=O","[OL]D=O nn","[OUGHT]=aa DD","[OUGH]=aa FF"," [OU]=aa","H[OU]S#=aa","[OUS]=aa SS","[OUR]=aa RR","[OULD]=U DD","^[OU]^L=aa","[OUP]=U OO","[OU]=aa","[OY]=O","[OING]=O I nn","[OI]=O","[OOR]=aa RR","[OOK]=U kk","[OOD]=U DD","[OO]=U","[O]E=O","[O] =O","[OA]=O"," [ONLY]=O nn nn I"," [ONCE]=FF aa nn SS","[ON'T]=O nn DD","C[O]N=aa","[O]NG=aa"," ^:[O]N=aa","I[ON]=aa nn","#:[ON] =aa nn","#^[ON]=aa nn","[O]ST =O","[OF]^=aa FF","[OTHER]=aa TH E","[OSS] =aa SS","#^:[OM]=aa PP","[O]=aa"],P:["[PH]=FF","[PEOP]=PP I PP","[POW]=PP aa","[PUT] =PP U DD","[P]=PP"],Q:["[QUAR]=kk FF aa RR","[QU]=kk FF","[Q]=kk"],R:[" [RE]^#=RR I","[R]=RR"],S:["[SH]=SS","#[SION]=SS aa nn","[SOME]=SS aa PP","#[SUR]#=SS E","[SUR]#=SS E","#[SU]#=SS U","#[SSU]#=SS U","#[SED] =SS DD","#[S]#=SS","[SAID]=SS E DD","^[SION]=SS aa nn","[S]S=",".[S] =SS","#:.E[S] =SS","#^:##[S] =SS","#^:#[S] =SS","U[S] =SS"," :#[S] =SS"," [SCH]=SS kk","[S]C+=","#[SM]=SS PP","#[SN]'=SS aa nn","[S]=SS"],T:[" [THE] =TH aa","[TO] =DD U","[THAT] =TH aa DD"," [THIS] =TH I SS"," [THEY]=TH E"," [THERE]=TH E RR","[THER]=TH E","[THEIR]=TH E RR"," [THAN] =TH aa nn"," [THEM] =TH E PP","[THESE] =TH I SS"," [THEN]=TH E nn","[THROUGH]=TH RR U","[THOSE]=TH O SS","[THOUGH] =TH O"," [THUS]=TH aa SS","[TH]=TH","#:[TED] =DD I DD","S[TI]#N=CH","[TI]O=SS","[TI]A=SS","[TIEN]=SS aa nn","[TUR]#=CH E","[TU]A=CH U"," [TWO]=DD U","[T]=DD"],U:[" [UN]I=I U nn"," [UN]=aa nn"," [UPON]=aa PP aa nn","@[UR]#=U RR","[UR]#=I U RR","[UR]=E","[U]^ =aa","[U]^^=aa","[UY]=aa"," G[U]#=","G[U]%=","G[U]#=FF","#N[U]=I U","@[U]=I","[U]=I U"],V:["[VIEW]=FF I U","[V]=FF"],W:[" [WERE]=FF E","[WA]S=FF aa","[WA]T=FF aa","[WHERE]=FF E RR","[WHAT]=FF aa DD","[WHOL]=I O nn","[WHO]=I U","[WH]=FF","[WAR]=FF aa RR","[WOR]^=FF E","[WR]=RR","[W]=FF"],X:[" [X]=SS","[X]=kk SS"],Y:["[YOUNG]=I aa nn"," [YOU]=I U"," [YES]=I E SS"," [Y]=I","#^:[Y] =I","#^:[Y]I=I"," :[Y] =aa"," :[Y]#=aa"," :[Y]^+:#=I"," :[Y]^#=I","[Y]=I"],Z:["[Z]=SS"]};const e={"#":"[AEIOUY]+",".":"[BDVGJLMNRWZ]","%":"(?:ER|E|ES|ED|ING|ELY)","&":"(?:[SCGZXJ]|CH|SH)","@":"(?:[TSRDLZNJ]|TH|CH|SH)","^":"[BCDFGHJKLMNPQRSTVWXZ]","+":"[EIY]",":":"[BCDFGHJKLMNPQRSTVWXZ]*"," ":"\\b"};Object.keys(this.rules).forEach(t=>{this.rules[t]=this.rules[t].map(t=>{let r=t.indexOf("["),s=t.indexOf("]"),i=t.indexOf("="),n=t.substring(0,r),a=t.substring(r+1,s),o=t.substring(s+1,i),l=t.substring(i+1),h={regex:"",move:0,visemes:[]},c="";c+=[...n].map(t=>e[t]||t).join("");let u=[...a];return u[0]=u[0].toLowerCase(),c+=u.join(""),h.move=u.length,h.regex=new RegExp(c+=[...o].map(t=>e[t]||t).join("")),l.length&&l.split(" ").forEach(e=>{h.visemes.push(e)}),h})}),this.visemeDurations={aa:.95,E:.9,I:.92,O:.96,U:.95,PP:1.08,SS:1.23,TH:1,DD:1.05,FF:1,kk:1.21,nn:.88,RR:.88,DD:1.05,sil:1},this.specialDurations={" ":1,",":3,"-":.5,"'":.5},this.digits=["oh","one","two","three","four","five","six","seven","eight","nine"],this.ones=["","one","two","three","four","five","six","seven","eight","nine"],this.tens=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"],this.teens=["ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],this.decades={20:"twenties",30:"thirties",40:"forties",50:"fifties",60:"sixties",70:"seventies",80:"eighties",90:"nineties"},this.ordinals={1:"first",2:"second",3:"third",4:"fourth",5:"fifth",6:"sixth",7:"seventh",8:"eighth",9:"ninth",10:"tenth",11:"eleventh",12:"twelfth",13:"thirteenth",14:"fourteenth",15:"fifteenth",16:"sixteenth",17:"seventeeth",18:"eighteenth",19:"nineteenth",20:"twentieth",30:"thirtieth",40:"fortieth",50:"fiftieth",60:"sixtieth",70:"seventieth",80:"eightieth",90:"ninetieth"},this.symbols={"%":"percent","€":"euros","&":"and","+":"plus",$:"dollars"},this.symbolsReg=/[%€&\+\$]/g}convert_digit_by_digit(e){e=String(e).split("");let t="";for(let r=0;r<e.length;r++)t+=this.digits[e[r]]+" ";return t.substring(0,t.length-1)}convert_sets_of_two(e){let t=String(e).substring(0,2),r=String(e).substring(2,4),s=this.convert_tens(t);return s+(" "+this.convert_tens(r))}convert_millions(e){return e>=1e6?this.convert_millions(Math.floor(e/1e6))+" million "+this.convert_thousands(e%1e6):this.convert_thousands(e)}convert_thousands(e){return e>=1e3?this.convert_hundreds(Math.floor(e/1e3))+" thousand "+this.convert_hundreds(e%1e3):this.convert_hundreds(e)}convert_hundreds(e){return e>99?this.ones[Math.floor(e/100)]+" hundred "+this.convert_tens(e%100):this.convert_tens(e)}convert_tens(e){return e<10?(0!=Number(e)&&e.toString().startsWith("0")?"oh ":"")+this.ones[Number(e)]:e>=10&&e<20?this.teens[e-10]:(this.tens[Math.floor(e/10)]+" "+this.ones[e%10]).trim()}convertNumberToWords(e,t=!1){let r=parseFloat(e);
1if("0"==e)return"zero";if(e<0)return" minus "+this.convertNumberToWords(Math.abs(e).toString(),t).trim();if(r&&!Number.isInteger(r)){let e=r.toString().split(".");return this.convertNumberToWords(e[0],t).trim()+" point "+this.convert_digit_by_digit(e[1]).trim()}if(e.toString().startsWith("0"))return this.convert_digit_by_digit(e).trim();if(!t&&(e<1e3&&e>99&&e%100!=0||e>1e4&&e<1e6))return this.convert_digit_by_digit(e).trim();else if(!t&&(e>1e3&&e<2e3||e>2009&&e<3e3))return e%100!=0?this.convert_sets_of_two(e).trim():this.convert_tens(e.toString().substring(0,2)).trim()+" hundred";else return this.convert_millions(e).trim()}convertDecade(e){let t=parseInt(e),r=!isNaN(t)&&2===e.length,s=!isNaN(t)&&e.length>2&&t>0&&t<=3e3,i=s&&t%1e3==0?Math.floor(t/1e3):null,n=s&&!i?Math.floor(t/100):null,a=r||s?10*Math.floor(t%100/10):null,o=[];return i?o.push(this.convertNumberToWords(i).trim(),"thousands"):(n&&o.push(this.convertNumberToWords(n).trim()),a?o.push(this.decades[a]||this.convertNumberToWords(a).trim()+"s"):n?o.push("hundreds"):o.push(e)),o.join(" ")}convertOrdinal(e){if(this.ordinals.hasOwnProperty(e))return this.ordinals[e];let t=Math.floor(e/100),r=10*Math.floor(e%100/10),s=e%10,i=[];return t&&(i.push(this.convertNumberToWords(t).trim()),r||s?i.push("hundred"):i.push("hundredth")),r&&(s?i.push(this.convertNumberToWords(r).trim()):i.push(this.ordinals[r])),s&&i.push(this.ordinals[s]),i.join(" ")}preProcessText(e){let t=e.replace('/[#_*":;]/g',"");return t=t.replace(this.symbolsReg,e=>" "+this.symbols[e]+" "),/\d/.test(t)&&(t=(t=(t=(t=t.replace(/\b(\d{2,4})[''']?\s?[sS](?=\s|[.,!?;:]|$)/g,(e,t)=>{let r=this.convertDecade(t);return r===t?e:r})).replace(/\b(\d+)\s*(st|nd|rd|th)(?=\s|[.,!?;:]|$)/gi,(e,t)=>this.convertOrdinal(Number(t)))).replace(/\b(\w*?)(\d+)([A-Za-z]+)\b/g,(e,t,r,s)=>{let i=this.convertNumberToWords(r);return`${t}${i} ${s}`}).replace(/\b([A-Za-z]+)(\d+)(\w*?)\b/g,(e,t,r,s)=>{let i=this.convertNumberToWords(r);return`${t} ${i}${s}`})).replace(/-?(?:\d{1,3}(?:,\d{3})+|\d+)(\.\d+)?/g,(e,t)=>{let r=e,s=!1;return/,/.test(r)&&(r=r.replace(/,/g,""),s=!0),t&&(s=!0),this.convertNumberToWords(r,s)})),t=t.replace(/(\D)\1\1+/g,"$1$1").replaceAll("  "," ").normalize("NFD").replace(/[\u0300-\u036f]/g,"").normalize("NFC").trim()}wordsToVisemes(e){let t={words:e.toUpperCase(),visemes:[],times:[],durations:[],i:0},r=0,s=[...t.words];for(;t.i<s.length;){let e=s[t.i],i=this.rules[e];if(i)for(let s=0;s<i.length;s++){let n=i[s];if((t.words.substring(0,t.i)+e.toLowerCase()+t.words.substring(t.i+1)).match(n.regex)){n.visemes.forEach(e=>{if(t.visemes.length&&t.visemes[t.visemes.length-1]===e){let s=.7*(this.visemeDurations[e]||1);t.durations[t.durations.length-1]+=s,r+=s}else{let s=this.visemeDurations[e]||1;t.visemes.push(e),t.times.push(r),t.durations.push(s),r+=s}}),t.i+=n.move;break}}else t.i++,r+=this.specialDurations[e]||0}return t}}},81328:(e,t,r)=>{r.d(t,{A:()=>i});var s=function(){var e=0,t=document.createElement("div");function r(e){return t.appendChild(e.dom),e}function i(r){for(var s=0;s<t.children.length;s++)t.children[s].style.display=s===r?"block":"none";e=r}t.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",t.addEventListener("click",function(r){r.preventDefault(),i(++e%t.children.length)},!1);var n=(performance||Date).now(),a=n,o=0,l=r(new s.Panel("FPS","#0ff","#002")),h=r(new s.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=r(new s.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:t,addPanel:r,showPanel:i,begin:function(){n=(performance||Date).now()},end:function(){o++;var e=(performance||Date).now();if(h.update(e-n,200),e>=a+1e3&&(l.update(1e3*o/(e-a),100),a=e,o=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){n=this.end()},domElement:t,setMode:i}};s.Panel=function(e,t,r){var s=1/0,i=0,n=Math.round,a=n(window.devicePixelRatio||1),o=80*a,l=48*a,h=3*a,c=2*a,u=3*a,d=15*a,p=74*a,m=30*a,f=document.createElement("canvas");f.width=o,f.height=l,f.style.cssText="width:80px;height:48px";var g=f.getContext("2d");return g.font="bold "+9*a+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=r,g.fillRect(0,0,o,l),g.fillStyle=t,g.fillText(e,h,c),g.fillRect(u,d,p,m),g.fillStyle=r,g.globalAlpha=.9,g.fillRect(u,d,p,m),{dom:f,update:function(l,v){s=Math.min(s,l),i=Math.max(i,l),g.fillStyle=r,g.globalAlpha=1,g.fillRect(0,0,o,d),g.fillStyle=t,g.fillText(n(l)+" "+e+" ("+n(s)+"-"+n(i)+")",h,c),g.drawImage(f,u+a,d,p-a,m,u,d,p-a,m),g.fillRect(u+p-a,d,a,m),g.fillStyle=r,g.globalAlpha=.9,g.fillRect(u+p-a,d,a,n((1-l/v)*m))}}};let i=s},83670:(e,t,r)=>{r.d(t,{N:()=>d});var s=r(60043);let i={type:"change"},n={type:"start"},a={type:"end"},o=new s.RlV,l=new s.Zcv,h=Math.cos(70*s.cj9.DEG2RAD),c=new s.Pq0,u=2*Math.PI;class d extends s.H2z{constructor(e,t=null){super(e,t),this.state=-1,this.target=new s.Pq0,this.cursor=new s.Pq0,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LE
1FT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:s.kBv.ROTATE,MIDDLE:s.kBv.DOLLY,RIGHT:s.kBv.PAN},this.touches={ONE:s.wtR.ROTATE,TWO:s.wtR.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new s.Pq0,this._lastQuaternion=new s.PTz,this._lastTargetPosition=new s.Pq0,this._quat=new s.PTz().setFromUnitVectors(e.up,new s.Pq0(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new s.YHV,this._sphericalDelta=new s.YHV,this._scale=1,this._panOffset=new s.Pq0,this._rotateStart=new s.I9Y,this._rotateEnd=new s.I9Y,this._rotateDelta=new s.I9Y,this._panStart=new s.I9Y,this._panEnd=new s.I9Y,this._panDelta=new s.I9Y,this._dollyStart=new s.I9Y,this._dollyEnd=new s.I9Y,this._dollyDelta=new s.I9Y,this._dollyDirection=new s.Pq0,this._mouse=new s.I9Y,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=m.bind(this),this._onPointerDown=p.bind(this),this._onPointerUp=f.bind(this),this._onContextMenu=w.bind(this),this._onMouseWheel=y.bind(this),this._onKeyDown=b.bind(this),this._onTouchStart=T.bind(this),this._onTouchMove=x.bind(this),this._onMouseDown=g.bind(this),this._onMouseMove=v.bind(this),this._interceptControlDown=E.bind(this),this._interceptControlUp=_.bind(this),null!==this.domElement&&this.connect(this.domElement),this.update()}connect(e){super.connect(e),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){null!==this._domElementKeyEvents&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(i),this.update(),this.state=-1}update(e=null){let t=this.object.position;c.copy(t).sub(this.target),c.applyQuaternion(this._quat),this._spherical.setFromVector3(c),this.autoRotate&&-1===this.state&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let r=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(r)&&isFinite(n)&&(r<-Math.PI?r+=u:r>Math.PI&&(r-=u),n<-Math.PI?n+=u:n>Math.PI&&(n-=u),r<=n?this._spherical.theta=Math.max(r,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(r+n)/2?Math.max(r,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),!0===this.enableDamping?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let a=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radiu
1s=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),a=e!=this._spherical.radius}if(c.setFromSpherical(this._spherical),c.applyQuaternion(this._quatInverse),t.copy(this.target).add(c),this.object.lookAt(this.target),!0===this.enableDamping?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=c.length();e=this._clampDistance(t*this._scale);let r=t-e;this.object.position.addScaledVector(this._dollyDirection,r),this.object.updateMatrixWorld(),a=!!r}else if(this.object.isOrthographicCamera){let t=new s.Pq0(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let r=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),a=r!==this.object.zoom;let i=new s.Pq0(this._mouse.x,this._mouse.y,0);i.unproject(this.object),this.object.position.sub(i).add(t),this.object.updateMatrixWorld(),e=c.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;null!==e&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(o.origin.copy(this.object.position),o.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(o.direction))<h?this.object.lookAt(this.target):(l.setFromNormalAndCoplanarPoint(this.object.up,this.target),o.intersectPlane(l,this.target))))}else if(this.object.isOrthographicCamera){let e=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),e!==this.object.zoom&&(this.object.updateProjectionMatrix(),a=!0)}return this._scale=1,this._performCursorZoom=!1,!!(a||this._lastPosition.distanceToSquared(this.object.position)>1e-6||8*(1-this._lastQuaternion.dot(this.object.quaternion))>1e-6||this._lastTargetPosition.distanceToSquared(this.target)>1e-6)&&(this.dispatchEvent(i),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0)}_getAutoRotationAngle(e){return null!==e?u/60*this.autoRotateSpeed*e:u/60/60*this.autoRotateSpeed}_getZoomScale(e){let t=Math.abs(.01*e);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){c.setFromMatrixColumn(t,0),c.multiplyScalar(-e),this._panOffset.add(c)}_panUp(e,t){!0===this.screenSpacePanning?c.setFromMatrixColumn(t,1):(c.setFromMatrixColumn(t,0),c.crossVectors(this.object.up,c)),c.multiplyScalar(e),this._panOffset.add(c)}_pan(e,t){let r=this.domElement;if(this.object.isPerspectiveCamera){let s=this.object.position;c.copy(s).sub(this.target);let i=c.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/r.clientHeight,this.object.matrix),this._panUp(2*t*i/r.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/r.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/r.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let r=this.domElement.getBoundingClientRect(),s=e-r.left,i=t-r.top,n=r.width,a=r.height;this._mouse.x=s/n*2-1,this._mouse.y=-(i/a*2)+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(u*this._rotateDelta.x/t.clientHeight),this._rotateUp(u*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(u*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-u*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(u*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-u*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(1===this._pointers.length)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),r=.5*(e.pageX+t.x),s=.5*(e.pageY+t.y);this._rotateStart.set(r,s)}}_handleTouchStartPan(e){if(1===this._pointers.length)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),r=.5*(e.pageX+t.x),s=.5*(e.pageY+t.y);this._panStart.set(r,s)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),r=e.pageX-t.x,s=e.pageY-t.y,i=Math.sqrt(r*r+s*s);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(1==this._pointers.length)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),r=.5*(e.pageX+t.x),s=.5*(e.pageY+t.y);this._rotateEnd.set(r,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(u*this._rotateDelta.x/t.clientHeight),this._rotateUp(u*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(1===this._pointers.length)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),r=.5*(e.pageX+t.x),s=.5*(e.pageY+t.y);this._panEnd.set(r,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),r=e.pageX-t.x,s=e.pageY-t.y,i=Math.sqrt(r*r+s*s);this._dollyEnd.set(0,i),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let n=(e.pageX+t.x)*.5,a=(e.pageY+t.y)*.5;this._updateZoomParameters(n,a)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return void this._pointers.splice(t,1)}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];void 0===t&&(t=new s.I9Y,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){let t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){let t=e.deltaMode,r={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:r.deltaY*=16;break;case 2:r.deltaY*=100}return e.ctrlKey&&!this._controlActive&&(r.deltaY*=10),r}}function p(e){!1===this.enabled||(0===this._pointers.length&&(this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),this._isTrackingPointer(e)||(this._addPointer(e),"touch"===e.pointerType?this._onTouchStart(e):this._onMouseDown(e)))}function m(e){!1!==this.enabled&&("touch"===e.pointerType?this._onTouchMove(e):this._onMouseMove(e))}function f(e){switch(this._removePointer(e),this._pointers.length){case 0:this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(a),this.state=-1;break;case 1:let t=this._pointers[0],r=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:r.x,pageY:r.y})}}function g(e){let t;switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case s.kBv.DOLLY:if(!1===this.enableZoom)return;this._handleMouseDownDolly(e),this.state=1;break;case s.kBv.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===this.enablePan)return;this._handleMouseDownPan(e),this.state=2}else{if(!1===this.enableRotate)return;this._handleMouseDownRotate(e),this.state=0}break;case s.kBv.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===this.enableRotate)return;this._handleMouseDownRotate(e),this.state=0}else{if(!1===this.enablePan)return;this._handleMouseDownPan(e),this.state=2}break;default:this.state=-1}-1!==this.state&&this.dispatchEvent(n)}function v(e){switch(this.state){case 0:if(!1===this.enableRotate)return;this._handleMouseMoveRotate(e);break;case 1:if(!1===this.enableZoom)return;this._handleMouseMoveDolly(e);break;case 2:if(!1===this.enablePan)return;this._handleMouseMovePan(e)}}function y(e){!1!==this.enabled&&!1!==this.enableZoom&&-1===this.state&&(e.preventDefault(),this.dispatchEvent(n),this._handleMouseWheel(this._customWheelEvent(e)),this.dispatchEvent(a))}function b(e){!1!==this.enabled&&this._handleKeyDown(e)}function T(e){switch(this._trackPointer(e),this._pointers.length){case 1:switch(this.touches.ONE){case s.wtR.ROTATE:if(!1===this.enableRotate)return;this._handleTouchStartRotate(e),this.state=3;break;case s.wtR.PAN:if(!1===this.enablePan)return;this._handleTouchStartPan(e),this.state=4;break;default:this.state=-1}break;case 2:switch(this.touches.TWO){case s.wtR.DOLLY_PAN:if(!1===this.enableZoom&&!1===this.enablePan)return;this._handleTouchStartDollyPan(e),this.state=5;break;case s.wtR.DOLLY_ROTATE:if(!1===this.enableZoom&&!1===this.enableRotate)return;this._handleTouchStartDollyRotate(e),this.state=6;break;default:this.state=-1}break;default:this.state=-1}-1!==this.state&&this.dispatchEvent(n)}function x(e){switch(this._trackPointer(e),this.state){case 3:if(!1===this.enableRotate)return;this._handleTouchMoveRotate(e),this.update();break;case 4:if(!1===this.enablePan)return;this._handleTouchMovePan(e),this.update();break;case 5:if(!1===this.enableZoom&&!1===this.enablePan)return;this._handleTouchMoveDollyPan(e),this.update();break;case 6:if(!1===this.enableZoom&&!1===this.enableRotate)return;this._handleTouchMoveDollyRotate(e),this.update();break;default:this.state=-1}}function w(e){!1!==this.enabled&&e.preventDefault()}
1function E(e){"Control"===e.key&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function _(e){"Control"===e.key&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.