@jdultra/threedtiles 9.2.10 → 9.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see threedtiles.min.js.LICENSE.txt */
2
- !function(A,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("three")):"function"==typeof define&&define.amd?define(["three"],e):"object"==typeof exports?exports.threedtiles=e(require("three")):A.threedtiles=e(A.THREE)}(this,(A=>(()=>{var e={649:(A,e,t)=>{const s=t(180),i=t(31),r=t(839);A.exports={Heap:s,Queue:i,LinkedHashMap:r}},180:A=>{A.exports=class{constructor(A,e){if(this._data=[],this._comparator=function(A,e){return A>=e},null!=A){if(!Array.isArray(A))throw Error("Constructor expects data to be an array");this._data=A}if(null!=e){if("function"!=typeof e)throw Error("Constructor expects comparator to be a function");this._comparator=e}}peek(){return this.size()<1?null:this._data[0]}pop(){if(this.size()<1)return null;const A=this._data[0];return this.swap(this.size()-1,0),this._data.pop(),this.heapifyDown(0),A}replaceTop(A){if(this.size()<1)return null;const e=this._data[0];return this._data[0]=A,this.heapifyDown(0),e}push(A){this._data.push(A),this.heapifyUp(this._data.length-1)}size(){return this._data.length}swap(A,e){const t=this._data[A];this._data[A]=this._data[e],this._data[e]=t}heapifyUp(A){if(0===A)return;const e=Math.floor((A-1)/2);this._comparator(this._data[A],this._data[e])||(this.swap(A,e),this.heapifyUp(e))}heapifyDown(A){const e=2*A+1,t=2*A+2;if(e>=this._data.length)return;const s=t<this._data.length&&!this._comparator(this._data[t],this._data[e])?t:e;this._comparator(this._data[A],this._data[s])&&(this.swap(A,s),this.heapifyDown(s))}}},839:A=>{A.exports=class{constructor(){this._data=new Map,this._link=new Map,this._head=void 0,this._tail=void 0}put(A,e,t=!1){this.has(A)?this._data.set(A,e):(this._data.set(A,e),this._link.set(A,{previous:void 0,next:void 0}),null==this._head?(this._head=A,this._tail=A):t?(this._link.get(this._head).previous=A,this._link.get(A).next=this._head,this._head=A):(this._link.get(this._tail).next=A,this._link.get(A).previous=this._tail,this._tail=A))}head(){return{key:this._head,value:this.get(this._head),next:()=>this.next(this._head),previous:()=>null}}tail(){return{key:this._tail,value:this.get(this._tail),next:()=>null,previous:()=>this.previous(this._tail)}}get(A){return this._data.get(A)}previousKey(A){const e=this._link.get(A);return null!=e?e.previous:void 0}previousValue(A){return this.get(this.previousKey(A))}previous(A){const e=this.previousKey(A);return{key:e,value:this.get(e),next:()=>this.next(e),previous:()=>this.previous(e)}}nextKey(A){const e=this._link.get(A);return null!=e?e.next:void 0}nextValue(A){return this.get(this.nextKey(A))}next(A){const e=this.nextKey(A);return{key:e,value:this.get(e),next:()=>this.next(e),previous:()=>this.previous(e)}}remove(A){const e=this._data.get(A);if(null!=e)if(1===this.size())this.reset();else{if(A===this._head){const A=this._link.get(this._head);this._link.get(A.next).previous=null,this._head=A.next}else if(A===this._tail){const A=this._link.get(this._tail);this._link.get(A.previous).next=null,this._tail=A.previous}else{const e=this._link.get(A),t=this._link.get(e.previous),s=this._link.get(e.next);t.next=e.next,s.previous=e.previous}this._link.delete(A),this._data.delete(A)}return e}has(A){return this._data.has(A)}size(){return this._data.size}reset(){this._data.clear(),this._link.clear(),this._head=void 0,this._tail=void 0}keys(){return this._data.keys()}values(){return this._data.values()}entries(){return this._data.entries()}toArray(A="orderByInsert"){if("orderByInsert"!==A){const A=[];let e=this._head;for(;null!=e;)A.push({key:e,value:this.get(e)}),e=this.nextKey(e);return A}return Array.from(this.keys()).map((A=>({key:A,value:this.get(A)})))}}},31:A=>{A.exports=class{constructor(A,e){if(this._data=[],this._head=0,this._cap=null,null!=A){if(!Array.isArray(A))throw Error("Constructor expects data to be an array");this._data=A}if(null!=e){if("number"!=typeof e)throw Error("Constructor expects capacity to be a number");this._cap=e}}enqueue(A){return!(null!=this._cap&&this.size()>=this._cap)&&(this._data.push(A),!0)}dequeue(){if(0===this.size())return null;const A=this._data[this._head];return this._head+=1,2*this._head>=this._data.length&&(this._data=this._data.slice(this._head),this._head=0),A}peek(A=!1){return this.size()>0?A?this._data[this._data.length-1]:this._data[this._head]:null}size(){return this._data.length-this._head}updateCapacity(A){this._cap=A}reset(){this._data=[],this._head=0}forEach(A){for(let e=this._head;e<this._data.length;e+=1)A(this._data[e],e-this._head)}toArray(){return this._data.slice(this._head)}}},975:A=>{"use strict";function e(A){if("string"!=typeof A)throw new TypeError("Path must be a string. Received "+JSON.stringify(A))}function t(A,e){for(var t,s="",i=0,r=-1,o=0,n=0;n<=A.length;++n){if(n<A.length)t=A.charCodeAt(n);else{if(47===t)break;t=47}if(47===t){if(r===n-1||1===o);else if(r!==n-1&&2===o){if(s.length<2||2!==i||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2))if(s.length>2){var a=s.lastIndexOf("/");if(a!==s.length-1){-1===a?(s="",i=0):i=(s=s.slice(0,a)).length-1-s.lastIndexOf("/"),r=n,o=0;continue}}else if(2===s.length||1===s.length){s="",i=0,r=n,o=0;continue}e&&(s.length>0?s+="/..":s="..",i=2)}else s.length>0?s+="/"+A.slice(r+1,n):s=A.slice(r+1,n),i=n-r-1;r=n,o=0}else 46===t&&-1!==o?++o:o=-1}return s}var s={resolve:function(){for(var A,s="",i=!1,r=arguments.length-1;r>=-1&&!i;r--){var o;r>=0?o=arguments[r]:(void 0===A&&(A=process.cwd()),o=A),e(o),0!==o.length&&(s=o+"/"+s,i=47===o.charCodeAt(0))}return s=t(s,!i),i?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(A){if(e(A),0===A.length)return".";var s=47===A.charCodeAt(0),i=47===A.charCodeAt(A.length-1);return 0!==(A=t(A,!s)).length||s||(A="."),A.length>0&&i&&(A+="/"),s?"/"+A:A},isAbsolute:function(A){return e(A),A.length>0&&47===A.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var A,t=0;t<arguments.length;++t){var i=arguments[t];e(i),i.length>0&&(void 0===A?A=i:A+="/"+i)}return void 0===A?".":s.normalize(A)},relative:function(A,t){if(e(A),e(t),A===t)return"";if((A=s.resolve(A))===(t=s.resolve(t)))return"";for(var i=1;i<A.length&&47===A.charCodeAt(i);++i);for(var r=A.length,o=r-i,n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var a=t.length-n,g=o<a?o:a,h=-1,l=0;l<=g;++l){if(l===g){if(a>g){if(47===t.charCodeAt(n+l))return t.slice(n+l+1);if(0===l)return t.slice(n+l)}else o>g&&(47===A.charCodeAt(i+l)?h=l:0===l&&(h=0));break}var c=A.charCodeAt(i+l);if(c!==t.charCodeAt(n+l))break;47===c&&(h=l)}var I="";for(l=i+h+1;l<=r;++l)l!==r&&47!==A.charCodeAt(l)||(0===I.length?I+="..":I+="/..");return I.length>0?I+t.slice(n+h):(n+=h,47===t.charCodeAt(n)&&++n,t.slice(n))},_makeLong:function(A){return A},dirname:function(A){if(e(A),0===A.length)return".";for(var t=A.charCodeAt(0),s=47===t,i=-1,r=!0,o=A.length-1;o>=1;--o)if(47===(t=A.charCodeAt(o))){if(!r){i=o;break}}else r=!1;return-1===i?s?"/":".":s&&1===i?"//":A.slice(0,i)},basename:function(A,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');e(A);var s,i=0,r=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=A.length){if(t.length===A.length&&t===A)return"";var n=t.length-1,a=-1;for(s=A.length-1;s>=0;--s){var g=A.charCodeAt(s);if(47===g){if(!o){i=s+1;break}}else-1===a&&(o=!1,a=s+1),n>=0&&(g===t.charCodeAt(n)?-1==--n&&(r=s):(n=-1,r=a))}return i===r?r=a:-1===r&&(r=A.length),A.slice(i,r)}for(s=A.length-1;s>=0;--s)if(47===A.charCodeAt(s)){if(!o){i=s+1;break}}else-1===r&&(o=!1,r=s+1);return-1===r?"":A.slice(i,r)},extname:function(A){e(A);for(var t=-1,s=0,i=-1,r=!0,o=0,n=A.length-1;n>=0;--n){var a=A.charCodeAt(n);if(47!==a)-1===i&&(r=!1,i=n+1),46===a?-1===t?t=n:1!==o&&(o=1):-1!==t&&(o=-1);else if(!r){s=n+1;break}}return-1===t||-1===i||0===o||1===o&&t===i-1&&t===s+1?"":A.slice(t,i)},format:function(A){if(null===A||"object"!=typeof A)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof A);return function(A,e){var t=e.dir||e.root,s=e.base||(e.name||"")+(e.ext||"");return t?t===e.root?t+s:t+A+s:s}("/",A)},parse:function(A){e(A);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===A.length)return t;var s,i=A.charCodeAt(0),r=47===i;r?(t.root="/",s=1):s=0;for(var o=-1,n=0,a=-1,g=!0,h=A.length-1,l=0;h>=s;--h)if(47!==(i=A.charCodeAt(h)))-1===a&&(g=!1,a=h+1),46===i?-1===o?o=h:1!==l&&(l=1):-1!==o&&(l=-1);else if(!g){n=h+1;break}return-1===o||-1===a||0===l||1===l&&o===a-1&&o===n+1?-1!==a&&(t.base=t.name=0===n&&r?A.slice(1,a):A.slice(n,a)):(0===n&&r?(t.name=A.slice(1,o),t.base=A.slice(1,a)):(t.name=A.slice(n,o),t.base=A.slice(n,a)),t.ext=A.slice(o,a)),n>0?t.dir=A.slice(0,n-1):r&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,A.exports=s},818:e=>{"use strict";e.exports=A}},t={};function s(A){var i=t[A];if(void 0!==i)return i.exports;var r=t[A]={exports:{}};return e[A](r,r.exports,s),r.exports}s.d=(A,e)=>{for(var t in e)s.o(e,t)&&!s.o(A,t)&&Object.defineProperty(A,t,{enumerable:!0,get:e[t]})},s.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),s.r=A=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})};var i={};return(()=>{"use strict";s.r(i),s.d(i,{B3DMDecoder:()=>HA,InstancedOGC3DTile:()=>pe,InstancedTileLoader:()=>ye,OBB:()=>r,OGC3DTile:()=>ge,OcclusionCullingService:()=>t,TileLoader:()=>PA});var A=s(818);Math.PI,Math.PI;function e(A,e,t){return Math.max(e,Math.min(t,A))}class t{constructor(){this.cullMap=[],this.cullMaterial=new A.MeshBasicMaterial({vertexColors:!0}),this.cullMaterial.side=A.FrontSide,this.cullTarget=this.createCullTarget(),this.cullPixels=new Uint8Array(4*this.cullTarget.width*this.cullTarget.height)}setSide(A){this.cullMaterial.side=A}createCullTarget(){const e=new A.WebGLRenderTarget(Math.floor(.05*window.innerWidth),Math.floor(.05*window.innerHeight));return e.texture.format=A.RGBAFormat,e.texture.colorSpace=A.LinearEncoding,e.texture.minFilter=A.NearestFilter,e.texture.magFilter=A.NearestFilter,e.texture.generateMipmaps=!1,e.stencilBuffer=!1,e.depthBuffer=!0,e.depthTexture=new A.DepthTexture,e.depthTexture.format=A.DepthFormat,e.depthTexture.type=A.UnsignedShortType,e}update(A,t,s){let i=t.getRenderTarget(),r=A.overrideMaterial;A.overrideMaterial=this.cullMaterial,t.setRenderTarget(this.cullTarget),t.render(A,s),A.overrideMaterial=r,t.setRenderTarget(i),t.readRenderTargetPixels(this.cullTarget,0,0,this.cullTarget.width,this.cullTarget.height,this.cullPixels),this.cullMap=[];for(let A=0;A<this.cullPixels.length;A+=4){const t=e(this.cullPixels[A],0,255)<<16^e(this.cullPixels[A+1],0,255)<<8^e(this.cullPixels[A+2],0,255)<<0;this.cullMap[t]=!0}}hasID(A){return this.cullMap[A]}}class r{constructor(e){this.center=new A.Vector3(e[0],e[1],e[2]);var t=new A.Vector3(e[3],e[4],e[4]),s=new A.Vector3(e[6],e[7],e[8]),i=new A.Vector3(e[9],e[10],e[11]);this.halfWidth=t.length(),this.halfHeight=s.length(),this.halfDepth=i.length(),t.normalize(),s.normalize(),i.normalize(),this.sphere=new A.Sphere(this.center,Math.sqrt(this.halfWidth*this.halfWidth+this.halfHeight*this.halfHeight+this.halfDepth*this.halfDepth)),this.matrixToOBBCoordinateSystem=new A.Matrix3,this.matrixToOBBCoordinateSystem.set(t.x,t.y,t.z,s.x,s.y,s.z,i.x,i.y,i.z)}inFrustum(A){return A.intersectsSphere(this.sphere)}distanceToPoint(A){let e=A.clone();e.sub(this.center),e.applyMatrix3(this.matrixToOBBCoordinateSystem);let t=Math.max(0,Math.max(-this.halfWidth-e.x,e.x-this.halfWidth)),s=Math.max(0,Math.max(-this.halfHeight-e.y,e.y-this.halfHeight)),i=Math.max(0,Math.max(-this.halfDepth-e.z,e.z-this.halfDepth));return Math.sqrt(t*t+s*s+i*i)}}var o=s(649);function n(e){let t,s,i,r=-1,o=0;for(let A=0;A<e.length;++A){const n=e[A];if(void 0===t&&(t=n.array.constructor),t!==n.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===s&&(s=n.itemSize),s!==n.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===i&&(i=n.normalized),i!==n.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===r&&(r=n.gpuType),r!==n.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;o+=n.count*s}const n=new t(o),a=new A.BufferAttribute(n,s,i);let g=0;for(let A=0;A<e.length;++A){const t=e[A];if(t.isInterleavedBufferAttribute){const A=g/s;for(let e=0,i=t.count;e<i;e++)for(let i=0;i<s;i++){const s=t.getComponent(e,i);a.setComponent(e+A,i,s)}}else n.set(t.array,g);g+=t.count*s}return void 0!==r&&(a.gpuType=r),a}function a(e,t){if(t===A.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===A.TriangleFanDrawMode||t===A.TriangleStripDrawMode){let s=e.getIndex();if(null===s){const A=[],t=e.getAttribute("position");if(void 0===t)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<t.count;e++)A.push(e);e.setIndex(A),s=e.getIndex()}const i=s.count-2,r=[];if(t===A.TriangleFanDrawMode)for(let A=1;A<=i;A++)r.push(s.getX(0)),r.push(s.getX(A)),r.push(s.getX(A+1));else for(let A=0;A<i;A++)A%2==0?(r.push(s.getX(A)),r.push(s.getX(A+1)),r.push(s.getX(A+2))):(r.push(s.getX(A+2)),r.push(s.getX(A+1)),r.push(s.getX(A)));r.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=e.clone();return o.setIndex(r),o.clearGroups(),o}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}class g extends A.Loader{constructor(A){super(A),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(A){return new B(A)})),this.register((function(A){return new y(A)})),this.register((function(A){return new D(A)})),this.register((function(A){return new R(A)})),this.register((function(A){return new d(A)})),this.register((function(A){return new u(A)})),this.register((function(A){return new Q(A)})),this.register((function(A){return new p(A)})),this.register((function(A){return new C(A)})),this.register((function(A){return new f(A)})),this.register((function(A){return new E(A)})),this.register((function(A){return new w(A)})),this.register((function(A){return new m(A)})),this.register((function(A){return new c(A)})),this.register((function(A){return new x(A)})),this.register((function(A){return new S(A)}))}load(e,t,s,i){const r=this;let o;if(""!==this.resourcePath)o=this.resourcePath;else if(""!==this.path){const t=A.LoaderUtils.extractUrlBase(e);o=A.LoaderUtils.resolveURL(t,this.path)}else o=A.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const n=function(A){i?i(A):console.error(A),r.manager.itemError(e),r.manager.itemEnd(e)},a=new A.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(A){try{r.parse(A,o,(function(A){t(A),r.manager.itemEnd(e)}),n)}catch(A){n(A)}}),s,n)}setDRACOLoader(A){return this.dracoLoader=A,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(A){return this.ktx2Loader=A,this}setMeshoptDecoder(A){return this.meshoptDecoder=A,this}register(A){return-1===this.pluginCallbacks.indexOf(A)&&this.pluginCallbacks.push(A),this}unregister(A){return-1!==this.pluginCallbacks.indexOf(A)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(A),1),this}parse(A,e,t,s){let i;const r={},o={},n=new TextDecoder;if("string"==typeof A)i=JSON.parse(A);else if(A instanceof ArrayBuffer){if(n.decode(new Uint8Array(A,0,4))===T){try{r[l.KHR_BINARY_GLTF]=new F(A)}catch(A){return void(s&&s(A))}i=JSON.parse(r[l.KHR_BINARY_GLTF].content)}else i=JSON.parse(n.decode(A))}else i=A;if(void 0===i.asset||i.asset.version[0]<2)return void(s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const a=new sA(i,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});a.fileLoader.setRequestHeader(this.requestHeader);for(let A=0;A<this.pluginCallbacks.length;A++){const e=this.pluginCallbacks[A](a);e.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),o[e.name]=e,r[e.name]=!0}if(i.extensionsUsed)for(let A=0;A<i.extensionsUsed.length;++A){const e=i.extensionsUsed[A],t=i.extensionsRequired||[];switch(e){case l.KHR_MATERIALS_UNLIT:r[e]=new I;break;case l.KHR_DRACO_MESH_COMPRESSION:r[e]=new G(i,this.dracoLoader);break;case l.KHR_TEXTURE_TRANSFORM:r[e]=new b;break;case l.KHR_MESH_QUANTIZATION:r[e]=new k;break;default:t.indexOf(e)>=0&&void 0===o[e]&&console.warn('THREE.GLTFLoader: Unknown extension "'+e+'".')}}a.setExtensions(r),a.setPlugins(o),a.parse(t,s)}parseAsync(A,e){const t=this;return new Promise((function(s,i){t.parse(A,e,s,i)}))}}function h(){let A={};return{get:function(e){return A[e]},add:function(e,t){A[e]=t},remove:function(e){delete A[e]},removeAll:function(){A={}}}}const l={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_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 c{constructor(A){this.parser=A,this.name=l.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const A=this.parser,e=this.parser.json.nodes||[];for(let t=0,s=e.length;t<s;t++){const s=e[t];s.extensions&&s.extensions[this.name]&&void 0!==s.extensions[this.name].light&&A._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,s="light:"+e;let i=t.cache.get(s);if(i)return i;const r=t.json,o=((r.extensions&&r.extensions[this.name]||{}).lights||[])[e];let n;const a=new A.Color(16777215);void 0!==o.color&&a.setRGB(o.color[0],o.color[1],o.color[2],A.LinearSRGBColorSpace);const g=void 0!==o.range?o.range:0;switch(o.type){case"directional":n=new A.DirectionalLight(a),n.target.position.set(0,0,-1),n.add(n.target);break;case"point":n=new A.PointLight(a),n.distance=g;break;case"spot":n=new A.SpotLight(a),n.distance=g,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,n.angle=o.spot.outerConeAngle,n.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,n.target.position.set(0,0,-1),n.add(n.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return n.position.set(0,0,0),n.decay=2,z(n,o),void 0!==o.intensity&&(n.intensity=o.intensity),n.name=t.createUniqueName(o.name||"light_"+e),i=Promise.resolve(n),t.cache.add(s,i),i}getDependency(A,e){if("light"===A)return this._loadLight(e)}createNodeAttachment(A){const e=this,t=this.parser,s=t.json.nodes[A],i=(s.extensions&&s.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then((function(A){return t._getNodeRef(e.cache,i,A)}))}}class I{constructor(){this.name=l.KHR_MATERIALS_UNLIT}getMaterialType(){return A.MeshBasicMaterial}extendParams(e,t,s){const i=[];e.color=new A.Color(1,1,1),e.opacity=1;const r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){const t=r.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],A.LinearSRGBColorSpace),e.opacity=t[3]}void 0!==r.baseColorTexture&&i.push(s.assignTexture(e,"map",r.baseColorTexture,A.SRGBColorSpace))}return Promise.all(i)}}class C{constructor(A){this.parser=A,this.name=l.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(A,e){const t=this.parser.json.materials[A];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const s=t.extensions[this.name].emissiveStrength;return void 0!==s&&(e.emissiveIntensity=s),Promise.resolve()}}class B{constructor(A){this.parser=A,this.name=l.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const r=[],o=i.extensions[this.name];if(void 0!==o.clearcoatFactor&&(t.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&r.push(s.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&r.push(s.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(r.push(s.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){const e=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new A.Vector2(e,e)}return Promise.all(r)}}class E{constructor(A){this.parser=A,this.name=l.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(A,e){const t=this.parser,s=t.json.materials[A];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[],r=s.extensions[this.name];return void 0!==r.iridescenceFactor&&(e.iridescence=r.iridescenceFactor),void 0!==r.iridescenceTexture&&i.push(t.assignTexture(e,"iridescenceMap",r.iridescenceTexture)),void 0!==r.iridescenceIor&&(e.iridescenceIOR=r.iridescenceIor),void 0===e.iridescenceThicknessRange&&(e.iridescenceThicknessRange=[100,400]),void 0!==r.iridescenceThicknessMinimum&&(e.iridescenceThicknessRange[0]=r.iridescenceThicknessMinimum),void 0!==r.iridescenceThicknessMaximum&&(e.iridescenceThicknessRange[1]=r.iridescenceThicknessMaximum),void 0!==r.iridescenceThicknessTexture&&i.push(t.assignTexture(e,"iridescenceThicknessMap",r.iridescenceThicknessTexture)),Promise.all(i)}}class d{constructor(A){this.parser=A,this.name=l.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const r=[];t.sheenColor=new A.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=i.extensions[this.name];if(void 0!==o.sheenColorFactor){const e=o.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],A.LinearSRGBColorSpace)}return void 0!==o.sheenRoughnessFactor&&(t.sheenRoughness=o.sheenRoughnessFactor),void 0!==o.sheenColorTexture&&r.push(s.assignTexture(t,"sheenColorMap",o.sheenColorTexture,A.SRGBColorSpace)),void 0!==o.sheenRoughnessTexture&&r.push(s.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(r)}}class u{constructor(A){this.parser=A,this.name=l.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(A,e){const t=this.parser,s=t.json.materials[A];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[],r=s.extensions[this.name];return void 0!==r.transmissionFactor&&(e.transmission=r.transmissionFactor),void 0!==r.transmissionTexture&&i.push(t.assignTexture(e,"transmissionMap",r.transmissionTexture)),Promise.all(i)}}class Q{constructor(A){this.parser=A,this.name=l.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const r=[],o=i.extensions[this.name];t.thickness=void 0!==o.thicknessFactor?o.thicknessFactor:0,void 0!==o.thicknessTexture&&r.push(s.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const n=o.attenuationColor||[1,1,1];return t.attenuationColor=(new A.Color).setRGB(n[0],n[1],n[2],A.LinearSRGBColorSpace),Promise.all(r)}}class p{constructor(A){this.parser=A,this.name=l.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(A,e){const t=this.parser.json.materials[A];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const s=t.extensions[this.name];return e.ior=void 0!==s.ior?s.ior:1.5,Promise.resolve()}}class f{constructor(A){this.parser=A,this.name=l.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const r=[],o=i.extensions[this.name];t.specularIntensity=void 0!==o.specularFactor?o.specularFactor:1,void 0!==o.specularTexture&&r.push(s.assignTexture(t,"specularIntensityMap",o.specularTexture));const n=o.specularColorFactor||[1,1,1];return t.specularColor=(new A.Color).setRGB(n[0],n[1],n[2],A.LinearSRGBColorSpace),void 0!==o.specularColorTexture&&r.push(s.assignTexture(t,"specularColorMap",o.specularColorTexture,A.SRGBColorSpace)),Promise.all(r)}}class m{constructor(A){this.parser=A,this.name=l.EXT_MATERIALS_BUMP}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(A,e){const t=this.parser,s=t.json.materials[A];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[],r=s.extensions[this.name];return e.bumpScale=void 0!==r.bumpFactor?r.bumpFactor:1,void 0!==r.bumpTexture&&i.push(t.assignTexture(e,"bumpMap",r.bumpTexture)),Promise.all(i)}}class w{constructor(A){this.parser=A,this.name=l.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(A,e){const t=this.parser,s=t.json.materials[A];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[],r=s.extensions[this.name];return void 0!==r.anisotropyStrength&&(e.anisotropy=r.anisotropyStrength),void 0!==r.anisotropyRotation&&(e.anisotropyRotation=r.anisotropyRotation),void 0!==r.anisotropyTexture&&i.push(t.assignTexture(e,"anisotropyMap",r.anisotropyTexture)),Promise.all(i)}}class y{constructor(A){this.parser=A,this.name=l.KHR_TEXTURE_BASISU}loadTexture(A){const e=this.parser,t=e.json,s=t.textures[A];if(!s.extensions||!s.extensions[this.name])return null;const i=s.extensions[this.name],r=e.options.ktx2Loader;if(!r){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(A,i.source,r)}}class D{constructor(A){this.parser=A,this.name=l.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(A){const e=this.name,t=this.parser,s=t.json,i=s.textures[A];if(!i.extensions||!i.extensions[e])return null;const r=i.extensions[e],o=s.images[r.source];let n=t.textureLoader;if(o.uri){const A=t.options.manager.getHandler(o.uri);null!==A&&(n=A)}return this.detectSupport().then((function(i){if(i)return t.loadTextureImage(A,r.source,n);if(s.extensionsRequired&&s.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return t.loadTexture(A)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(A){const e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){A(1===e.height)}}))),this.isSupported}}class R{constructor(A){this.parser=A,this.name=l.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(A){const e=this.name,t=this.parser,s=t.json,i=s.textures[A];if(!i.extensions||!i.extensions[e])return null;const r=i.extensions[e],o=s.images[r.source];let n=t.textureLoader;if(o.uri){const A=t.options.manager.getHandler(o.uri);null!==A&&(n=A)}return this.detectSupport().then((function(i){if(i)return t.loadTextureImage(A,r.source,n);if(s.extensionsRequired&&s.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return t.loadTexture(A)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(A){const e=new Image;e.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",e.onload=e.onerror=function(){A(1===e.height)}}))),this.isSupported}}class x{constructor(A){this.name=l.EXT_MESHOPT_COMPRESSION,this.parser=A}loadBufferView(A){const e=this.parser.json,t=e.bufferViews[A];if(t.extensions&&t.extensions[this.name]){const A=t.extensions[this.name],s=this.parser.getDependency("buffer",A.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then((function(e){const t=A.byteOffset||0,s=A.byteLength||0,r=A.count,o=A.byteStride,n=new Uint8Array(e,t,s);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(r,o,n,A.mode,A.filter).then((function(A){return A.buffer})):i.ready.then((function(){const e=new ArrayBuffer(r*o);return i.decodeGltfBuffer(new Uint8Array(e),r,o,n,A.mode,A.filter),e}))}))}return null}}class S{constructor(A){this.name=l.EXT_MESH_GPU_INSTANCING,this.parser=A}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||void 0===s.mesh)return null;const i=t.meshes[s.mesh];for(const A of i.primitives)if(A.mode!==v.TRIANGLES&&A.mode!==v.TRIANGLE_STRIP&&A.mode!==v.TRIANGLE_FAN&&void 0!==A.mode)return null;const r=s.extensions[this.name].attributes,o=[],n={};for(const A in r)o.push(this.parser.getDependency("accessor",r[A]).then((e=>(n[A]=e,n[A]))));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then((e=>{const t=e.pop(),s=t.isGroup?t.children:[t],i=e[0].count,r=[];for(const e of s){const t=new A.Matrix4,s=new A.Vector3,o=new A.Quaternion,a=new A.Vector3(1,1,1),g=new A.InstancedMesh(e.geometry,e.material,i);for(let A=0;A<i;A++)n.TRANSLATION&&s.fromBufferAttribute(n.TRANSLATION,A),n.ROTATION&&o.fromBufferAttribute(n.ROTATION,A),n.SCALE&&a.fromBufferAttribute(n.SCALE,A),g.setMatrixAt(A,t.compose(s,o,a));for(const t in n)if("_COLOR_0"===t){const e=n[t];g.instanceColor=new A.InstancedBufferAttribute(e.array,e.itemSize,e.normalized)}else"TRANSLATION"!==t&&"ROTATION"!==t&&"SCALE"!==t&&e.geometry.setAttribute(t,n[t]);A.Object3D.prototype.copy.call(g,e),this.parser.assignFinalMaterial(g),r.push(g)}return t.isGroup?(t.clear(),t.add(...r),t):r[0]})))}}const T="glTF",M=1313821514,L=5130562;class F{constructor(A){this.name=l.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(A,0,12),t=new TextDecoder;if(this.header={magic:t.decode(new Uint8Array(A.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==T)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const s=this.header.length-12,i=new DataView(A,12);let r=0;for(;r<s;){const e=i.getUint32(r,!0);r+=4;const s=i.getUint32(r,!0);if(r+=4,s===M){const s=new Uint8Array(A,12+r,e);this.content=t.decode(s)}else if(s===L){const t=12+r;this.body=A.slice(t,t+e)}r+=e}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class G{constructor(A,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=l.KHR_DRACO_MESH_COMPRESSION,this.json=A,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(e,t){const s=this.json,i=this.dracoLoader,r=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,n={},a={},g={};for(const A in o){const e=J[A]||A.toLowerCase();n[e]=o[A]}for(const A in e.attributes){const t=J[A]||A.toLowerCase();if(void 0!==o[A]){const i=s.accessors[e.attributes[A]],r=H[i.componentType];g[t]=r.name,a[t]=!0===i.normalized}}return t.getDependency("bufferView",r).then((function(e){return new Promise((function(t,s){i.decodeDracoFile(e,(function(A){for(const e in A.attributes){const t=A.attributes[e],s=a[e];void 0!==s&&(t.normalized=s)}t(A)}),n,g,A.LinearSRGBColorSpace,s)}))}))}}class b{constructor(){this.name=l.KHR_TEXTURE_TRANSFORM}extendTexture(A,e){return void 0!==e.texCoord&&e.texCoord!==A.channel||void 0!==e.offset||void 0!==e.rotation||void 0!==e.scale?(A=A.clone(),void 0!==e.texCoord&&(A.channel=e.texCoord),void 0!==e.offset&&A.offset.fromArray(e.offset),void 0!==e.rotation&&(A.rotation=e.rotation),void 0!==e.scale&&A.repeat.fromArray(e.scale),A.needsUpdate=!0,A):A}}class k{constructor(){this.name=l.KHR_MESH_QUANTIZATION}}class U extends A.Interpolant{constructor(A,e,t,s){super(A,e,t,s)}copySampleValue_(A){const e=this.resultBuffer,t=this.sampleValues,s=this.valueSize,i=A*s*3+s;for(let A=0;A!==s;A++)e[A]=t[i+A];return e}interpolate_(A,e,t,s){const i=this.resultBuffer,r=this.sampleValues,o=this.valueSize,n=2*o,a=3*o,g=s-e,h=(t-e)/g,l=h*h,c=l*h,I=A*a,C=I-a,B=-2*c+3*l,E=c-l,d=1-B,u=E-l+h;for(let A=0;A!==o;A++){const e=r[C+A+o],t=r[C+A+n]*g,s=r[I+A+o],a=r[I+A]*g;i[A]=d*e+u*t+B*s+E*a}return i}}const _=new A.Quaternion;class N extends U{interpolate_(A,e,t,s){const i=super.interpolate_(A,e,t,s);return _.fromArray(i).normalize().toArray(i),i}}const v={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},H={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},q={9728:A.NearestFilter,9729:A.LinearFilter,9984:A.NearestMipmapNearestFilter,9985:A.LinearMipmapNearestFilter,9986:A.NearestMipmapLinearFilter,9987:A.LinearMipmapLinearFilter},P={33071:A.ClampToEdgeWrapping,33648:A.MirroredRepeatWrapping,10497:A.RepeatWrapping},O={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},J={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"},V={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},K={CUBICSPLINE:void 0,LINEAR:A.InterpolateLinear,STEP:A.InterpolateDiscrete},j="OPAQUE",Y="MASK",W="BLEND";function X(A,e,t){for(const s in t.extensions)void 0===A[s]&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[s]=t.extensions[s])}function z(A,e){void 0!==e.extras&&("object"==typeof e.extras?Object.assign(A.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function Z(A,e){if(A.updateMorphTargets(),void 0!==e.weights)for(let t=0,s=e.weights.length;t<s;t++)A.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(A.morphTargetInfluences.length===t.length){A.morphTargetDictionary={};for(let e=0,s=t.length;e<s;e++)A.morphTargetDictionary[t[e]]=e}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function $(A){let e;const t=A.extensions&&A.extensions[l.KHR_DRACO_MESH_COMPRESSION];if(e=t?"draco:"+t.bufferView+":"+t.indices+":"+AA(t.attributes):A.indices+":"+AA(A.attributes)+":"+A.mode,void 0!==A.targets)for(let t=0,s=A.targets.length;t<s;t++)e+=":"+AA(A.targets[t]);return e}function AA(A){let e="";const t=Object.keys(A).sort();for(let s=0,i=t.length;s<i;s++)e+=t[s]+":"+A[t[s]]+";";return e}function eA(A){switch(A){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}const tA=new A.Matrix4;class sA{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new h,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 s=!1,i=!1,r=-1;"undefined"!=typeof navigator&&(s=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=navigator.userAgent.indexOf("Firefox")>-1,r=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||s||i&&r<98?this.textureLoader=new A.TextureLoader(this.options.manager):this.textureLoader=new A.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new A.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(A){this.extensions=A}setPlugins(A){this.plugins=A}parse(A,e){const t=this,s=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(A){return A._markDefs&&A._markDefs()})),Promise.all(this._invokeAll((function(A){return A.beforeRoot&&A.beforeRoot()}))).then((function(){return Promise.all([t.getDependencies("scene"),t.getDependencies("animation"),t.getDependencies("camera")])})).then((function(e){const r={scene:e[0][s.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:s.asset,parser:t,userData:{}};return X(i,r,s),z(r,s),Promise.all(t._invokeAll((function(A){return A.afterRoot&&A.afterRoot(r)}))).then((function(){A(r)}))})).catch(e)}_markDefs(){const A=this.json.nodes||[],e=this.json.skins||[],t=this.json.meshes||[];for(let t=0,s=e.length;t<s;t++){const s=e[t].joints;for(let e=0,t=s.length;e<t;e++)A[s[e]].isBone=!0}for(let e=0,s=A.length;e<s;e++){const s=A[e];void 0!==s.mesh&&(this._addNodeRef(this.meshCache,s.mesh),void 0!==s.skin&&(t[s.mesh].isSkinnedMesh=!0)),void 0!==s.camera&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(A,e){void 0!==e&&(void 0===A.refs[e]&&(A.refs[e]=A.uses[e]=0),A.refs[e]++)}_getNodeRef(A,e,t){if(A.refs[e]<=1)return t;const s=t.clone(),i=(A,e)=>{const t=this.associations.get(A);null!=t&&this.associations.set(e,t);for(const[t,s]of A.children.entries())i(s,e.children[t])};return i(t,s),s.name+="_instance_"+A.uses[e]++,s}_invokeOne(A){const e=Object.values(this.plugins);e.push(this);for(let t=0;t<e.length;t++){const s=A(e[t]);if(s)return s}return null}_invokeAll(A){const e=Object.values(this.plugins);e.unshift(this);const t=[];for(let s=0;s<e.length;s++){const i=A(e[s]);i&&t.push(i)}return t}getDependency(A,e){const t=A+":"+e;let s=this.cache.get(t);if(!s){switch(A){case"scene":s=this.loadScene(e);break;case"node":s=this._invokeOne((function(A){return A.loadNode&&A.loadNode(e)}));break;case"mesh":s=this._invokeOne((function(A){return A.loadMesh&&A.loadMesh(e)}));break;case"accessor":s=this.loadAccessor(e);break;case"bufferView":s=this._invokeOne((function(A){return A.loadBufferView&&A.loadBufferView(e)}));break;case"buffer":s=this.loadBuffer(e);break;case"material":s=this._invokeOne((function(A){return A.loadMaterial&&A.loadMaterial(e)}));break;case"texture":s=this._invokeOne((function(A){return A.loadTexture&&A.loadTexture(e)}));break;case"skin":s=this.loadSkin(e);break;case"animation":s=this._invokeOne((function(A){return A.loadAnimation&&A.loadAnimation(e)}));break;case"camera":s=this.loadCamera(e);break;default:if(s=this._invokeOne((function(t){return t!=this&&t.getDependency&&t.getDependency(A,e)})),!s)throw new Error("Unknown type: "+A)}this.cache.add(t,s)}return s}getDependencies(A){let e=this.cache.get(A);if(!e){const t=this,s=this.json[A+("mesh"===A?"es":"s")]||[];e=Promise.all(s.map((function(e,s){return t.getDependency(A,s)}))),this.cache.add(A,e)}return e}loadBuffer(e){const t=this.json.buffers[e],s=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[l.KHR_BINARY_GLTF].body);const i=this.options;return new Promise((function(e,r){s.load(A.LoaderUtils.resolveURL(t.uri,i.path),e,void 0,(function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(A){const e=this.json.bufferViews[A];return this.getDependency("buffer",e.buffer).then((function(A){const t=e.byteLength||0,s=e.byteOffset||0;return A.slice(s,s+t)}))}loadAccessor(e){const t=this,s=this.json,i=this.json.accessors[e];if(void 0===i.bufferView&&void 0===i.sparse){const e=O[i.type],t=H[i.componentType],s=!0===i.normalized,r=new t(i.count*e);return Promise.resolve(new A.BufferAttribute(r,e,s))}const r=[];return void 0!==i.bufferView?r.push(this.getDependency("bufferView",i.bufferView)):r.push(null),void 0!==i.sparse&&(r.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(r).then((function(e){const r=e[0],o=O[i.type],n=H[i.componentType],a=n.BYTES_PER_ELEMENT,g=a*o,h=i.byteOffset||0,l=void 0!==i.bufferView?s.bufferViews[i.bufferView].byteStride:void 0,c=!0===i.normalized;let I,C;if(l&&l!==g){const e=Math.floor(h/l),s="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+e+":"+i.count;let g=t.cache.get(s);g||(I=new n(r,e*l,i.count*l/a),g=new A.InterleavedBuffer(I,l/a),t.cache.add(s,g)),C=new A.InterleavedBufferAttribute(g,o,h%l/a,c)}else I=null===r?new n(i.count*o):new n(r,h,i.count*o),C=new A.BufferAttribute(I,o,c);if(void 0!==i.sparse){const t=O.SCALAR,s=H[i.sparse.indices.componentType],a=i.sparse.indices.byteOffset||0,g=i.sparse.values.byteOffset||0,h=new s(e[1],a,i.sparse.count*t),l=new n(e[2],g,i.sparse.count*o);null!==r&&(C=new A.BufferAttribute(C.array.slice(),C.itemSize,C.normalized));for(let A=0,e=h.length;A<e;A++){const e=h[A];if(C.setX(e,l[A*o]),o>=2&&C.setY(e,l[A*o+1]),o>=3&&C.setZ(e,l[A*o+2]),o>=4&&C.setW(e,l[A*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return C}))}loadTexture(A){const e=this.json,t=this.options,s=e.textures[A].source,i=e.images[s];let r=this.textureLoader;if(i.uri){const A=t.manager.getHandler(i.uri);null!==A&&(r=A)}return this.loadTextureImage(A,s,r)}loadTextureImage(e,t,s){const i=this,r=this.json,o=r.textures[e],n=r.images[t],a=(n.uri||n.bufferView)+":"+o.sampler;if(this.textureCache[a])return this.textureCache[a];const g=this.loadImageSource(t,s).then((function(t){t.flipY=!1,t.name=o.name||n.name||"",""===t.name&&"string"==typeof n.uri&&!1===n.uri.startsWith("data:image/")&&(t.name=n.uri);const s=(r.samplers||{})[o.sampler]||{};return t.magFilter=q[s.magFilter]||A.LinearFilter,t.minFilter=q[s.minFilter]||A.LinearMipmapLinearFilter,t.wrapS=P[s.wrapS]||A.RepeatWrapping,t.wrapT=P[s.wrapT]||A.RepeatWrapping,i.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[a]=g,g}loadImageSource(e,t){const s=this,i=this.json,r=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((A=>A.clone()));const o=i.images[e],n=self.URL||self.webkitURL;let a=o.uri||"",g=!1;if(void 0!==o.bufferView)a=s.getDependency("bufferView",o.bufferView).then((function(A){g=!0;const e=new Blob([A],{type:o.mimeType});return a=n.createObjectURL(e),a}));else if(void 0===o.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(a).then((function(e){return new Promise((function(s,i){let o=s;!0===t.isImageBitmapLoader&&(o=function(e){const t=new A.Texture(e);t.needsUpdate=!0,s(t)}),t.load(A.LoaderUtils.resolveURL(e,r.path),o,void 0,i)}))})).then((function(A){var e;return!0===g&&n.revokeObjectURL(a),A.userData.mimeType=o.mimeType||((e=o.uri).search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/)?"image/jpeg":e.search(/\.webp($|\?)/i)>0||0===e.search(/^data\:image\/webp/)?"image/webp":"image/png"),A})).catch((function(A){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),A}));return this.sourceCache[e]=h,h}assignTexture(A,e,t,s){const i=this;return this.getDependency("texture",t.index).then((function(r){if(!r)return null;if(void 0!==t.texCoord&&t.texCoord>0&&((r=r.clone()).channel=t.texCoord),i.extensions[l.KHR_TEXTURE_TRANSFORM]){const A=void 0!==t.extensions?t.extensions[l.KHR_TEXTURE_TRANSFORM]:void 0;if(A){const e=i.associations.get(r);r=i.extensions[l.KHR_TEXTURE_TRANSFORM].extendTexture(r,A),i.associations.set(r,e)}}return void 0!==s&&(r.colorSpace=s),A[e]=r,r}))}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const i=void 0===t.attributes.tangent,r=void 0!==t.attributes.color,o=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+s.uuid;let t=this.cache.get(e);t||(t=new A.PointsMaterial,A.Material.prototype.copy.call(t,s),t.color.copy(s.color),t.map=s.map,t.sizeAttenuation=!1,this.cache.add(e,t)),s=t}else if(e.isLine){const e="LineBasicMaterial:"+s.uuid;let t=this.cache.get(e);t||(t=new A.LineBasicMaterial,A.Material.prototype.copy.call(t,s),t.color.copy(s.color),t.map=s.map,this.cache.add(e,t)),s=t}if(i||r||o){let A="ClonedMaterial:"+s.uuid+":";i&&(A+="derivative-tangents:"),r&&(A+="vertex-colors:"),o&&(A+="flat-shading:");let e=this.cache.get(A);e||(e=s.clone(),r&&(e.vertexColors=!0),o&&(e.flatShading=!0),i&&(e.normalScale&&(e.normalScale.y*=-1),e.clearcoatNormalScale&&(e.clearcoatNormalScale.y*=-1)),this.cache.add(A,e),this.associations.set(e,this.associations.get(s))),s=e}e.material=s}getMaterialType(){return A.MeshStandardMaterial}loadMaterial(e){const t=this,s=this.json,i=this.extensions,r=s.materials[e];let o;const n={},a=[];if((r.extensions||{})[l.KHR_MATERIALS_UNLIT]){const A=i[l.KHR_MATERIALS_UNLIT];o=A.getMaterialType(),a.push(A.extendParams(n,r,t))}else{const s=r.pbrMetallicRoughness||{};if(n.color=new A.Color(1,1,1),n.opacity=1,Array.isArray(s.baseColorFactor)){const e=s.baseColorFactor;n.color.setRGB(e[0],e[1],e[2],A.LinearSRGBColorSpace),n.opacity=e[3]}void 0!==s.baseColorTexture&&a.push(t.assignTexture(n,"map",s.baseColorTexture,A.SRGBColorSpace)),n.metalness=void 0!==s.metallicFactor?s.metallicFactor:1,n.roughness=void 0!==s.roughnessFactor?s.roughnessFactor:1,void 0!==s.metallicRoughnessTexture&&(a.push(t.assignTexture(n,"metalnessMap",s.metallicRoughnessTexture)),a.push(t.assignTexture(n,"roughnessMap",s.metallicRoughnessTexture))),o=this._invokeOne((function(A){return A.getMaterialType&&A.getMaterialType(e)})),a.push(Promise.all(this._invokeAll((function(A){return A.extendMaterialParams&&A.extendMaterialParams(e,n)}))))}!0===r.doubleSided&&(n.side=A.DoubleSide);const g=r.alphaMode||j;if(g===W?(n.transparent=!0,n.depthWrite=!1):(n.transparent=!1,g===Y&&(n.alphaTest=void 0!==r.alphaCutoff?r.alphaCutoff:.5)),void 0!==r.normalTexture&&o!==A.MeshBasicMaterial&&(a.push(t.assignTexture(n,"normalMap",r.normalTexture)),n.normalScale=new A.Vector2(1,1),void 0!==r.normalTexture.scale)){const A=r.normalTexture.scale;n.normalScale.set(A,A)}if(void 0!==r.occlusionTexture&&o!==A.MeshBasicMaterial&&(a.push(t.assignTexture(n,"aoMap",r.occlusionTexture)),void 0!==r.occlusionTexture.strength&&(n.aoMapIntensity=r.occlusionTexture.strength)),void 0!==r.emissiveFactor&&o!==A.MeshBasicMaterial){const e=r.emissiveFactor;n.emissive=(new A.Color).setRGB(e[0],e[1],e[2],A.LinearSRGBColorSpace)}return void 0!==r.emissiveTexture&&o!==A.MeshBasicMaterial&&a.push(t.assignTexture(n,"emissiveMap",r.emissiveTexture,A.SRGBColorSpace)),Promise.all(a).then((function(){const A=new o(n);return r.name&&(A.name=r.name),z(A,r),t.associations.set(A,{materials:e}),r.extensions&&X(i,A,r),A}))}createUniqueName(e){const t=A.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,i=this.primitiveCache;function r(A){return s[l.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(A,t).then((function(e){return iA(e,A,t)}))}const o=[];for(let s=0,n=e.length;s<n;s++){const n=e[s],a=$(n),g=i[a];if(g)o.push(g.promise);else{let e;e=n.extensions&&n.extensions[l.KHR_DRACO_MESH_COMPRESSION]?r(n):iA(new A.BufferGeometry,n,t),i[a]={primitive:n,promise:e},o.push(e)}}return Promise.all(o)}loadMesh(e){const t=this,s=this.json,i=this.extensions,r=s.meshes[e],o=r.primitives,n=[];for(let e=0,t=o.length;e<t;e++){const t=void 0===o[e].material?(void 0===(g=this.cache).DefaultMaterial&&(g.DefaultMaterial=new A.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:A.FrontSide})),g.DefaultMaterial):this.getDependency("material",o[e].material);n.push(t)}var g;return n.push(t.loadGeometries(o)),Promise.all(n).then((function(s){const n=s.slice(0,s.length-1),g=s[s.length-1],h=[];for(let s=0,l=g.length;s<l;s++){const l=g[s],c=o[s];let I;const C=n[s];if(c.mode===v.TRIANGLES||c.mode===v.TRIANGLE_STRIP||c.mode===v.TRIANGLE_FAN||void 0===c.mode)I=!0===r.isSkinnedMesh?new A.SkinnedMesh(l,C):new A.Mesh(l,C),!0===I.isSkinnedMesh&&I.normalizeSkinWeights(),c.mode===v.TRIANGLE_STRIP?I.geometry=a(I.geometry,A.TriangleStripDrawMode):c.mode===v.TRIANGLE_FAN&&(I.geometry=a(I.geometry,A.TriangleFanDrawMode));else if(c.mode===v.LINES)I=new A.LineSegments(l,C);else if(c.mode===v.LINE_STRIP)I=new A.Line(l,C);else if(c.mode===v.LINE_LOOP)I=new A.LineLoop(l,C);else{if(c.mode!==v.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+c.mode);I=new A.Points(l,C)}Object.keys(I.geometry.morphAttributes).length>0&&Z(I,r),I.name=t.createUniqueName(r.name||"mesh_"+e),z(I,r),c.extensions&&X(i,I,c),t.assignFinalMaterial(I),h.push(I)}for(let A=0,s=h.length;A<s;A++)t.associations.set(h[A],{meshes:e,primitives:A});if(1===h.length)return r.extensions&&X(i,h[0],r),h[0];const l=new A.Group;r.extensions&&X(i,l,r),t.associations.set(l,{meshes:e});for(let A=0,e=h.length;A<e;A++)l.add(h[A]);return l}))}loadCamera(e){let t;const s=this.json.cameras[e],i=s[s.type];if(i)return"perspective"===s.type?t=new A.PerspectiveCamera(A.MathUtils.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):"orthographic"===s.type&&(t=new A.OrthographicCamera(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),s.name&&(t.name=this.createUniqueName(s.name)),z(t,s),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],s=[];for(let A=0,e=t.joints.length;A<e;A++)s.push(this._loadNodeShallow(t.joints[A]));return void 0!==t.inverseBindMatrices?s.push(this.getDependency("accessor",t.inverseBindMatrices)):s.push(null),Promise.all(s).then((function(e){const s=e.pop(),i=e,r=[],o=[];for(let e=0,n=i.length;e<n;e++){const n=i[e];if(n){r.push(n);const t=new A.Matrix4;null!==s&&t.fromArray(s.array,16*e),o.push(t)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[e])}return new A.Skeleton(r,o)}))}loadAnimation(e){const t=this.json,s=this,i=t.animations[e],r=i.name?i.name:"animation_"+e,o=[],n=[],a=[],g=[],h=[];for(let A=0,e=i.channels.length;A<e;A++){const e=i.channels[A],t=i.samplers[e.sampler],s=e.target,r=s.node,l=void 0!==i.parameters?i.parameters[t.input]:t.input,c=void 0!==i.parameters?i.parameters[t.output]:t.output;void 0!==s.node&&(o.push(this.getDependency("node",r)),n.push(this.getDependency("accessor",l)),a.push(this.getDependency("accessor",c)),g.push(t),h.push(s))}return Promise.all([Promise.all(o),Promise.all(n),Promise.all(a),Promise.all(g),Promise.all(h)]).then((function(e){const t=e[0],i=e[1],o=e[2],n=e[3],a=e[4],g=[];for(let A=0,e=t.length;A<e;A++){const e=t[A],r=i[A],h=o[A],l=n[A],c=a[A];if(void 0===e)continue;e.updateMatrix&&e.updateMatrix();const I=s._createAnimationTracks(e,r,h,l,c);if(I)for(let A=0;A<I.length;A++)g.push(I[A])}return new A.AnimationClip(r,void 0,g)}))}createNodeMesh(A){const e=this.json,t=this,s=e.nodes[A];return void 0===s.mesh?null:t.getDependency("mesh",s.mesh).then((function(A){const e=t._getNodeRef(t.meshCache,s.mesh,A);return void 0!==s.weights&&e.traverse((function(A){if(A.isMesh)for(let e=0,t=s.weights.length;e<t;e++)A.morphTargetInfluences[e]=s.weights[e]})),e}))}loadNode(A){const e=this,t=this.json.nodes[A],s=e._loadNodeShallow(A),i=[],r=t.children||[];for(let A=0,t=r.length;A<t;A++)i.push(e.getDependency("node",r[A]));const o=void 0===t.skin?Promise.resolve(null):e.getDependency("skin",t.skin);return Promise.all([s,Promise.all(i),o]).then((function(A){const e=A[0],t=A[1],s=A[2];null!==s&&e.traverse((function(A){A.isSkinnedMesh&&A.bind(s,tA)}));for(let A=0,s=t.length;A<s;A++)e.add(t[A]);return e}))}_loadNodeShallow(e){const t=this.json,s=this.extensions,i=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];const r=t.nodes[e],o=r.name?i.createUniqueName(r.name):"",n=[],a=i._invokeOne((function(A){return A.createNodeMesh&&A.createNodeMesh(e)}));return a&&n.push(a),void 0!==r.camera&&n.push(i.getDependency("camera",r.camera).then((function(A){return i._getNodeRef(i.cameraCache,r.camera,A)}))),i._invokeAll((function(A){return A.createNodeAttachment&&A.createNodeAttachment(e)})).forEach((function(A){n.push(A)})),this.nodeCache[e]=Promise.all(n).then((function(t){let n;if(n=!0===r.isBone?new A.Bone:t.length>1?new A.Group:1===t.length?t[0]:new A.Object3D,n!==t[0])for(let A=0,e=t.length;A<e;A++)n.add(t[A]);if(r.name&&(n.userData.name=r.name,n.name=o),z(n,r),r.extensions&&X(s,n,r),void 0!==r.matrix){const e=new A.Matrix4;e.fromArray(r.matrix),n.applyMatrix4(e)}else void 0!==r.translation&&n.position.fromArray(r.translation),void 0!==r.rotation&&n.quaternion.fromArray(r.rotation),void 0!==r.scale&&n.scale.fromArray(r.scale);return i.associations.has(n)||i.associations.set(n,{}),i.associations.get(n).nodes=e,n})),this.nodeCache[e]}loadScene(e){const t=this.extensions,s=this.json.scenes[e],i=this,r=new A.Group;s.name&&(r.name=i.createUniqueName(s.name)),z(r,s),s.extensions&&X(t,r,s);const o=s.nodes||[],n=[];for(let A=0,e=o.length;A<e;A++)n.push(i.getDependency("node",o[A]));return Promise.all(n).then((function(e){for(let A=0,t=e.length;A<t;A++)r.add(e[A]);return i.associations=(e=>{const t=new Map;for(const[e,s]of i.associations)(e instanceof A.Material||e instanceof A.Texture)&&t.set(e,s);return e.traverse((A=>{const e=i.associations.get(A);null!=e&&t.set(A,e)})),t})(r),r}))}_createAnimationTracks(e,t,s,i,r){const o=[],n=e.name?e.name:e.uuid,a=[];let g;switch(V[r.path]===V.weights?e.traverse((function(A){A.morphTargetInfluences&&a.push(A.name?A.name:A.uuid)})):a.push(n),V[r.path]){case V.weights:g=A.NumberKeyframeTrack;break;case V.rotation:g=A.QuaternionKeyframeTrack;break;case V.position:case V.scale:g=A.VectorKeyframeTrack;break;default:if(1===s.itemSize)g=A.NumberKeyframeTrack;else g=A.VectorKeyframeTrack}const h=void 0!==i.interpolation?K[i.interpolation]:A.InterpolateLinear,l=this._getArrayFromAccessor(s);for(let A=0,e=a.length;A<e;A++){const e=new g(a[A]+"."+V[r.path],t.array,l,h);"CUBICSPLINE"===i.interpolation&&this._createCubicSplineTrackInterpolant(e),o.push(e)}return o}_getArrayFromAccessor(A){let e=A.array;if(A.normalized){const A=eA(e.constructor),t=new Float32Array(e.length);for(let s=0,i=e.length;s<i;s++)t[s]=e[s]*A;e=t}return e}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof A.QuaternionKeyframeTrack?N:U)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function iA(e,t,s){const i=t.attributes,r=[];function o(A,t){return s.getDependency("accessor",A).then((function(A){e.setAttribute(t,A)}))}for(const A in i){const t=J[A]||A.toLowerCase();t in e.attributes||r.push(o(i[A],t))}if(void 0!==t.indices&&!e.index){const A=s.getDependency("accessor",t.indices).then((function(A){e.setIndex(A)}));r.push(A)}return A.ColorManagement.workingColorSpace!==A.LinearSRGBColorSpace&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${A.ColorManagement.workingColorSpace}" not supported.`),z(e,t),function(e,t,s){const i=t.attributes,r=new A.Box3;if(void 0===i.POSITION)return;{const e=s.json.accessors[i.POSITION],t=e.min,o=e.max;if(void 0===t||void 0===o)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(r.set(new A.Vector3(t[0],t[1],t[2]),new A.Vector3(o[0],o[1],o[2])),e.normalized){const A=eA(H[e.componentType]);r.min.multiplyScalar(A),r.max.multiplyScalar(A)}}const o=t.targets;if(void 0!==o){const e=new A.Vector3,t=new A.Vector3;for(let A=0,i=o.length;A<i;A++){const i=o[A];if(void 0!==i.POSITION){const A=s.json.accessors[i.POSITION],r=A.min,o=A.max;if(void 0!==r&&void 0!==o){if(t.setX(Math.max(Math.abs(r[0]),Math.abs(o[0]))),t.setY(Math.max(Math.abs(r[1]),Math.abs(o[1]))),t.setZ(Math.max(Math.abs(r[2]),Math.abs(o[2]))),A.normalized){const e=eA(H[A.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(e)}e.boundingBox=r;const n=new A.Sphere;r.getCenter(n.center),n.radius=r.min.distanceTo(r.max)/2,e.boundingSphere=n}(e,t,s),Promise.all(r).then((function(){return void 0!==t.targets?function(A,e,t){let s=!1,i=!1,r=!1;for(let A=0,t=e.length;A<t;A++){const t=e[A];if(void 0!==t.POSITION&&(s=!0),void 0!==t.NORMAL&&(i=!0),void 0!==t.COLOR_0&&(r=!0),s&&i&&r)break}if(!s&&!i&&!r)return Promise.resolve(A);const o=[],n=[],a=[];for(let g=0,h=e.length;g<h;g++){const h=e[g];if(s){const e=void 0!==h.POSITION?t.getDependency("accessor",h.POSITION):A.attributes.position;o.push(e)}if(i){const e=void 0!==h.NORMAL?t.getDependency("accessor",h.NORMAL):A.attributes.normal;n.push(e)}if(r){const e=void 0!==h.COLOR_0?t.getDependency("accessor",h.COLOR_0):A.attributes.color;a.push(e)}}return Promise.all([Promise.all(o),Promise.all(n),Promise.all(a)]).then((function(e){const t=e[0],o=e[1],n=e[2];return s&&(A.morphAttributes.position=t),i&&(A.morphAttributes.normal=o),r&&(A.morphAttributes.color=n),A.morphTargetsRelative=!0,A}))}(e,t.targets,s):e}))}const rA=new WeakMap;class oA extends A.Loader{constructor(A){super(A),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(A){return this.decoderPath=A,this}setDecoderConfig(A){return this.decoderConfig=A,this}setWorkerLimit(A){return this.workerLimit=A,this}load(e,t,s,i){const r=new A.FileLoader(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,(A=>{this.parse(A,t,i)}),s,i)}parse(e,t,s=(()=>{})){this.decodeDracoFile(e,t,null,null,A.SRGBColorSpace).catch(s)}decodeDracoFile(e,t,s,i,r=A.LinearSRGBColorSpace,o=(()=>{})){const n={attributeIDs:s||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!s,vertexColorSpace:r};return this.decodeGeometry(e,n).then(t).catch(o)}decodeGeometry(A,e){const t=JSON.stringify(e);if(rA.has(A)){const e=rA.get(A);if(e.key===t)return e.promise;if(0===A.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s;const i=this.workerNextTaskID++,r=A.byteLength,o=this._getWorker(i,r).then((t=>(s=t,new Promise(((t,r)=>{s._callbacks[i]={resolve:t,reject:r},s.postMessage({type:"decode",id:i,taskConfig:e,buffer:A},[A])}))))).then((A=>this._createGeometry(A.geometry)));return o.catch((()=>!0)).then((()=>{s&&i&&this._releaseTask(s,i)})),rA.set(A,{key:t,promise:o}),o}_createGeometry(e){const t=new A.BufferGeometry;e.index&&t.setIndex(new A.BufferAttribute(e.index.array,1));for(let s=0;s<e.attributes.length;s++){const i=e.attributes[s],r=i.name,o=i.array,n=i.itemSize,a=new A.BufferAttribute(o,n);"color"===r&&(this._assignVertexColorSpace(a,i.vertexColorSpace),a.normalized=o instanceof Float32Array==!1),t.setAttribute(r,a)}return t}_assignVertexColorSpace(e,t){if(t!==A.SRGBColorSpace)return;const s=new A.Color;for(let A=0,t=e.count;A<t;A++)s.fromBufferAttribute(e,A).convertSRGBToLinear(),e.setXYZ(A,s.r,s.g,s.b)}_loadLibrary(e,t){const s=new A.FileLoader(this.manager);return s.setPath(this.decoderPath),s.setResponseType(t),s.setWithCredentials(this.withCredentials),new Promise(((A,t)=>{s.load(e,A,void 0,t)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const A="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,e=[];return A?e.push(this._loadLibrary("draco_decoder.js","text")):(e.push(this._loadLibrary("draco_wasm_wrapper.js","text")),e.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(e).then((e=>{const t=e[0];A||(this.decoderConfig.wasmBinary=e[1]);const s=nA.toString(),i=["/* draco decoder */",t,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending}_getWorker(A,e){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const A=new Worker(this.workerSourceURL);A._callbacks={},A._taskCosts={},A._taskLoad=0,A.postMessage({type:"init",decoderConfig:this.decoderConfig}),A.onmessage=function(e){const t=e.data;switch(t.type){case"decode":A._callbacks[t.id].resolve(t);break;case"error":A._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},this.workerPool.push(A)}else this.workerPool.sort((function(A,e){return A._taskLoad>e._taskLoad?-1:1}));const t=this.workerPool[this.workerPool.length-1];return t._taskCosts[A]=e,t._taskLoad+=e,t}))}_releaseTask(A,e){A._taskLoad-=A._taskCosts[e],delete A._callbacks[e],delete A._taskCosts[e]}debug(){console.log("Task load: ",this.workerPool.map((A=>A._taskLoad)))}dispose(){for(let A=0;A<this.workerPool.length;++A)this.workerPool[A].terminate();return this.workerPool.length=0,""!==this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),this}}function nA(){let A,e;function t(A,e,t,s,i,r){const o=r.num_components(),n=t.num_points()*o,a=n*i.BYTES_PER_ELEMENT,g=function(A,e){switch(e){case Float32Array:return A.DT_FLOAT32;case Int8Array:return A.DT_INT8;case Int16Array:return A.DT_INT16;case Int32Array:return A.DT_INT32;case Uint8Array:return A.DT_UINT8;case Uint16Array:return A.DT_UINT16;case Uint32Array:return A.DT_UINT32}}(A,i),h=A._malloc(a);e.GetAttributeDataArrayForAllPoints(t,r,g,a,h);const l=new i(A.HEAPF32.buffer,h,n).slice();return A._free(h),{name:s,array:l,itemSize:o}}onmessage=function(s){const i=s.data;switch(i.type){case"init":A=i.decoderConfig,e=new Promise((function(e){A.onModuleLoaded=function(A){e({draco:A})},DracoDecoderModule(A)}));break;case"decode":const s=i.buffer,r=i.taskConfig;e.then((A=>{const e=A.draco,o=new e.Decoder;try{const A=function(A,e,s,i){const r=i.attributeIDs,o=i.attributeTypes;let n,a;const g=e.GetEncodedGeometryType(s);if(g===A.TRIANGULAR_MESH)n=new A.Mesh,a=e.DecodeArrayToMesh(s,s.byteLength,n);else{if(g!==A.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");n=new A.PointCloud,a=e.DecodeArrayToPointCloud(s,s.byteLength,n)}if(!a.ok()||0===n.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+a.error_msg());const h={index:null,attributes:[]};for(const s in r){const a=self[o[s]];let g,l;if(i.useUniqueIDs)l=r[s],g=e.GetAttributeByUniqueId(n,l);else{if(l=e.GetAttributeId(n,A[r[s]]),-1===l)continue;g=e.GetAttribute(n,l)}const c=t(A,e,n,s,a,g);"color"===s&&(c.vertexColorSpace=i.vertexColorSpace),h.attributes.push(c)}g===A.TRIANGULAR_MESH&&(h.index=function(A,e,t){const s=t.num_faces(),i=3*s,r=4*i,o=A._malloc(r);e.GetTrianglesUInt32Array(t,r,o);const n=new Uint32Array(A.HEAPF32.buffer,o,i).slice();return A._free(o),{array:n,itemSize:1}}(A,e,n));return A.destroy(n),h}(e,o,new Int8Array(s),r),n=A.attributes.map((A=>A.array.buffer));A.index&&n.push(A.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:A},n)}catch(A){console.error(A),self.postMessage({type:"error",id:i.id,error:A.message})}finally{e.destroy(o)}}))}}}class aA{constructor(A=4){this.pool=A,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(A){if(!this.workers[A]){const e=this.workerCreator();e.addEventListener("message",this._onMessage.bind(this,A)),this.workers[A]=e}}_getIdleWorker(){for(let A=0;A<this.pool;A++)if(!(this.workerStatus&1<<A))return A;return-1}_onMessage(A,e){const t=this.workersResolve[A];if(t&&t(e),this.queue.length){const{resolve:e,msg:t,transfer:s}=this.queue.shift();this.workersResolve[A]=e,this.workers[A].postMessage(t,s)}else this.workerStatus^=1<<A}setWorkerCreator(A){this.workerCreator=A}setWorkerLimit(A){this.pool=A}postMessage(A,e){return new Promise((t=>{const s=this._getIdleWorker();-1!==s?(this._initWorker(s),this.workerStatus|=1<<s,this.workersResolve[s]=t,this.workers[s].postMessage(A,e)):this.queue.push({resolve:t,msg:A,transfer:e})}))}dispose(){this.workers.forEach((A=>A.terminate())),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const gA=2,hA=0,lA=1,cA=10;class IA{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class CA{constructor(A,e,t,s){this._dataView=new DataView(A.buffer,A.byteOffset+e,t),this._littleEndian=s,this._offset=0}_nextUint8(){const A=this._dataView.getUint8(this._offset);return this._offset+=1,A}_nextUint16(){const A=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,A}_nextUint32(){const A=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,A}_nextUint64(){const A=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,A}_nextInt32(){const A=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,A}_skip(A){return this._offset+=A,this}_scan(A,e=0){const t=this._offset;let s=0;for(;this._dataView.getUint8(this._offset)!==e&&s<A;)s++,this._offset++;return s<A&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+t,s)}}new Uint8Array([0]);const BA=[171,75,84,88,32,50,48,187,13,10,26,10];function EA(A){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(A):Buffer.from(A).toString("utf8")}let dA,uA,QA;const pA={env:{emscripten_notify_memory_growth:function(A){QA=new Uint8Array(uA.exports.memory.buffer)}}};class fA{init(){return dA||(dA="undefined"!=typeof fetch?fetch("data:application/wasm;base64,"+mA).then((A=>A.arrayBuffer())).then((A=>WebAssembly.instantiate(A,pA))).then(this._init):WebAssembly.instantiate(Buffer.from(mA,"base64"),pA).then(this._init),dA)}_init(A){uA=A.instance,pA.env.emscripten_notify_memory_growth(0)}decode(A,e=0){if(!uA)throw new Error("ZSTDDecoder: Await .init() before decoding.");const t=A.byteLength,s=uA.exports.malloc(t);QA.set(A,s),e=e||Number(uA.exports.ZSTD_findDecompressedSize(s,t));const i=uA.exports.malloc(e),r=uA.exports.ZSTD_decompress(i,e,s,t),o=QA.slice(i,i+r);return uA.exports.free(s),uA.exports.free(i),o}}const mA="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWN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QCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACA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KQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAe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QFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCm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EEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyA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AAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",wA=new WeakMap;let yA,DA=0;class RA extends A.Loader{constructor(A){super(A),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new aA,this.workerSourceURL="",this.workerConfig=null,"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(A){return this.transcoderPath=A,this}setWorkerLimit(A){return this.workerPool.setWorkerLimit(A),this}async detectSupportAsync(A){return this.workerConfig={astcSupported:await A.hasFeatureAsync("texture-compression-astc"),etc1Supported:await A.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await A.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await A.hasFeatureAsync("texture-compression-bc"),bptcSupported:await A.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await A.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(A){return!0===A.isWebGPURenderer?this.workerConfig={astcSupported:A.hasFeature("texture-compression-astc"),etc1Supported:A.hasFeature("texture-compression-etc1"),etc2Supported:A.hasFeature("texture-compression-etc2"),dxtSupported:A.hasFeature("texture-compression-bc"),bptcSupported:A.hasFeature("texture-compression-bptc"),pvrtcSupported:A.hasFeature("texture-compression-pvrtc")}:(this.workerConfig={astcSupported:A.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:A.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:A.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:A.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:A.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:A.extensions.has("WEBGL_compressed_texture_pvrtc")||A.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},A.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1)),this}init(){if(!this.transcoderPending){const e=new A.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),s=new A.FileLoader(this.manager);s.setPath(this.transcoderPath),s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials);const i=s.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then((([A,e])=>{const t=RA.BasisWorker.toString(),s=["/* constants */","let _EngineFormat = "+JSON.stringify(RA.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(RA.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(RA.BasisFormat),"/* basis_transcoder.js */",A,"/* worker */",t.substring(t.indexOf("{")+1,t.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([s])),this.transcoderBinary=e,this.workerPool.setWorkerCreator((()=>{const A=new Worker(this.workerSourceURL),e=this.transcoderBinary.slice(0);return A.postMessage({type:"init",config:this.workerConfig,transcoderBinary:e},[e]),A}))})),DA>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),DA++}return this.transcoderPending}load(e,t,s,i){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const r=new A.FileLoader(this.manager);r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials),r.load(e,(A=>{if(wA.has(A)){return wA.get(A).promise.then(t).catch(i)}this._createTexture(A).then((A=>t?t(A):null)).catch(i)}),s,i)}_createTextureFrom(e,t){const{faces:s,width:i,height:r,format:o,type:n,error:a,dfdFlags:g}=e;if("error"===n)return Promise.reject(a);let h;if(6===t.faceCount)h=new A.CompressedCubeTexture(s,o,A.UnsignedByteType);else{const e=s[0].mipmaps;h=t.layerCount>1?new A.CompressedArrayTexture(e,i,r,t.layerCount,o,A.UnsignedByteType):new A.CompressedTexture(e,i,r,o,A.UnsignedByteType)}return h.minFilter=1===s[0].mipmaps.length?A.LinearFilter:A.LinearMipmapLinearFilter,h.magFilter=A.LinearFilter,h.generateMipmaps=!1,h.needsUpdate=!0,h.colorSpace=MA(t),h.premultiplyAlpha=!!(1&g),h}async _createTexture(e,t={}){const s=function(A){const e=new Uint8Array(A.buffer,A.byteOffset,BA.length);if(e[0]!==BA[0]||e[1]!==BA[1]||e[2]!==BA[2]||e[3]!==BA[3]||e[4]!==BA[4]||e[5]!==BA[5]||e[6]!==BA[6]||e[7]!==BA[7]||e[8]!==BA[8]||e[9]!==BA[9]||e[10]!==BA[10]||e[11]!==BA[11])throw new Error("Missing KTX 2.0 identifier.");const t=new IA,s=17*Uint32Array.BYTES_PER_ELEMENT,i=new CA(A,BA.length,s,!0);t.vkFormat=i._nextUint32(),t.typeSize=i._nextUint32(),t.pixelWidth=i._nextUint32(),t.pixelHeight=i._nextUint32(),t.pixelDepth=i._nextUint32(),t.layerCount=i._nextUint32(),t.faceCount=i._nextUint32();const r=i._nextUint32();t.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),n=i._nextUint32(),a=i._nextUint32(),g=i._nextUint32(),h=i._nextUint64(),l=i._nextUint64(),c=new CA(A,BA.length+s,3*r*8,!0);for(let e=0;e<r;e++)t.levels.push({levelData:new Uint8Array(A.buffer,A.byteOffset+c._nextUint64(),c._nextUint64()),uncompressedByteLength:c._nextUint64()});const I=new CA(A,o,n,!0),C={vendorId:I._skip(4)._nextUint16(),descriptorType:I._nextUint16(),versionNumber:I._nextUint16(),descriptorBlockSize:I._nextUint16(),colorModel:I._nextUint8(),colorPrimaries:I._nextUint8(),transferFunction:I._nextUint8(),flags:I._nextUint8(),texelBlockDimension:[I._nextUint8(),I._nextUint8(),I._nextUint8(),I._nextUint8()],bytesPlane:[I._nextUint8(),I._nextUint8(),I._nextUint8(),I._nextUint8(),I._nextUint8(),I._nextUint8(),I._nextUint8(),I._nextUint8()],samples:[]},B=(C.descriptorBlockSize/4-6)/4;for(let A=0;A<B;A++){const e={bitOffset:I._nextUint16(),bitLength:I._nextUint8(),channelType:I._nextUint8(),samplePosition:[I._nextUint8(),I._nextUint8(),I._nextUint8(),I._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&e.channelType?(e.sampleLower=I._nextInt32(),e.sampleUpper=I._nextInt32()):(e.sampleLower=I._nextUint32(),e.sampleUpper=I._nextUint32()),C.samples[A]=e}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(C);const E=new CA(A,a,g,!0);for(;E._offset<g;){const A=E._nextUint32(),e=E._scan(A),s=EA(e),i=E._scan(A-e.byteLength);t.keyValue[s]=s.match(/^ktx/i)?EA(i):i,E._offset%4&&E._skip(4-E._offset%4)}if(l<=0)return t;const d=new CA(A,h,l,!0),u=d._nextUint16(),Q=d._nextUint16(),p=d._nextUint32(),f=d._nextUint32(),m=d._nextUint32(),w=d._nextUint32(),y=[];for(let A=0;A<r;A++)y.push({imageFlags:d._nextUint32(),rgbSliceByteOffset:d._nextUint32(),rgbSliceByteLength:d._nextUint32(),alphaSliceByteOffset:d._nextUint32(),alphaSliceByteLength:d._nextUint32()});const D=h+d._offset,R=D+p,x=R+f,S=x+m,T=new Uint8Array(A.buffer,A.byteOffset+D,p),M=new Uint8Array(A.buffer,A.byteOffset+R,f),L=new Uint8Array(A.buffer,A.byteOffset+x,m),F=new Uint8Array(A.buffer,A.byteOffset+S,w);return t.globalData={endpointCount:u,selectorCount:Q,imageDescs:y,endpointsData:T,selectorsData:M,tablesData:L,extendedData:F},t}(new Uint8Array(e));if(0!==s.vkFormat)return async function(e){const{vkFormat:t}=e;if(void 0===SA[t])throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let s;2===e.supercompressionScheme&&(yA||(yA=new Promise((async A=>{const e=new fA;await e.init(),A(e)}))),s=await yA);const i=[];for(let r=0;r<e.levels.length;r++){const o=Math.max(1,e.pixelWidth>>r),n=Math.max(1,e.pixelHeight>>r),a=e.pixelDepth?Math.max(1,e.pixelDepth>>r):0,g=e.levels[r];let h,l;if(0===e.supercompressionScheme)h=g.levelData;else{if(2!==e.supercompressionScheme)throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");h=s.decode(g.levelData,g.uncompressedByteLength)}l=TA[t]===A.FloatType?new Float32Array(h.buffer,h.byteOffset,h.byteLength/Float32Array.BYTES_PER_ELEMENT):TA[t]===A.HalfFloatType?new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT):h,i.push({data:l,width:o,height:n,depth:a})}let r;if(xA.has(SA[t]))r=0===e.pixelDepth?new A.DataTexture(i[0].data,e.pixelWidth,e.pixelHeight):new A.Data3DTexture(i[0].data,e.pixelWidth,e.pixelHeight,e.pixelDepth);else{if(e.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");r=new A.CompressedTexture(i,e.pixelWidth,e.pixelHeight)}return r.mipmaps=i,r.type=TA[t],r.format=SA[t],r.colorSpace=MA(e),r.needsUpdate=!0,Promise.resolve(r)}(s);const i=t,r=this.init().then((()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:i},[e]))).then((A=>this._createTextureFrom(A.data,s)));return wA.set(e,{promise:r}),r}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),DA--,this}}RA.BasisFormat={ETC1S:0,UASTC_4x4:1},RA.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},RA.EngineFormat={RGBAFormat:A.RGBAFormat,RGBA_ASTC_4x4_Format:A.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:A.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:A.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:A.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:A.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:A.RGB_ETC1_Format,RGB_ETC2_Format:A.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:A.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:A.RGB_S3TC_DXT1_Format},RA.BasisWorker=function(){let A,e,t;const s=_EngineFormat,i=_TranscoderFormat,r=_BasisFormat;self.addEventListener("message",(function(o){const l=o.data;switch(l.type){case"init":A=l.config,c=l.transcoderBinary,e=new Promise((A=>{t={wasmBinary:c,onRuntimeInitialized:A},BASIS(t)})).then((()=>{t.initializeBasis(),void 0===t.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")}));break;case"transcode":e.then((()=>{try{const{faces:e,buffers:o,width:c,height:I,hasAlpha:C,format:B,dfdFlags:E}=function(e){const o=new t.KTX2File(new Uint8Array(e));function l(){o.close(),o.delete()}if(!o.isValid())throw l(),new Error("THREE.KTX2Loader:\tInvalid or unsupported .ktx2 file");const c=o.isUASTC()?r.UASTC_4x4:r.ETC1S,I=o.getWidth(),C=o.getHeight(),B=o.getLayers()||1,E=o.getLevels(),d=o.getFaces(),u=o.getHasAlpha(),Q=o.getDFDFlags(),{transcoderFormat:p,engineFormat:f}=function(e,t,o,h){let l,c;const I=e===r.ETC1S?n:a;for(let s=0;s<I.length;s++){const i=I[s];if(A[i.if]&&(i.basisFormat.includes(e)&&!(h&&i.transcoderFormat.length<2)&&(!i.needsPowerOfTwo||g(t)&&g(o))))return l=i.transcoderFormat[h?1:0],c=i.engineFormat[h?1:0],{transcoderFormat:l,engineFormat:c}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),l=i.RGBA32,c=s.RGBAFormat,{transcoderFormat:l,engineFormat:c}}(c,I,C,u);if(!I||!C||!E)throw l(),new Error("THREE.KTX2Loader:\tInvalid texture");if(!o.startTranscoding())throw l(),new Error("THREE.KTX2Loader: .startTranscoding failed");const m=[],w=[];for(let A=0;A<d;A++){const e=[];for(let t=0;t<E;t++){const s=[];let i,r;for(let e=0;e<B;e++){const n=o.getImageLevelInfo(t,e,A);0!==A||0!==t||0!==e||n.origWidth%4==0&&n.origHeight%4==0||console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),E>1?(i=n.origWidth,r=n.origHeight):(i=n.width,r=n.height);const a=new Uint8Array(o.getImageTranscodedSizeInBytes(t,e,0,p));if(!o.transcodeImage(a,t,e,A,p,0,-1,-1))throw l(),new Error("THREE.KTX2Loader: .transcodeImage failed.");s.push(a)}const n=h(s);e.push({data:n,width:i,height:r}),w.push(n.buffer)}m.push({mipmaps:e,width:I,height:C,format:f})}return l(),{faces:m,buffers:w,width:I,height:C,hasAlpha:u,format:f,dfdFlags:Q}}(l.buffer);self.postMessage({type:"transcode",id:l.id,faces:e,width:c,height:I,hasAlpha:C,format:B,dfdFlags:E},o)}catch(A){console.error(A),self.postMessage({type:"error",id:l.id,error:A.message})}}))}var c}));const o=[{if:"astcSupported",basisFormat:[r.UASTC_4x4],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[s.RGBA_ASTC_4x4_Format,s.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[s.RGBA_BPTC_Format,s.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[i.BC1,i.BC3],engineFormat:[s.RGB_S3TC_DXT1_Format,s.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[s.RGB_ETC2_Format,s.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[i.ETC1],engineFormat:[s.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[s.RGB_PVRTC_4BPPV1_Format,s.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],n=o.sort((function(A,e){return A.priorityETC1S-e.priorityETC1S})),a=o.sort((function(A,e){return A.priorityUASTC-e.priorityUASTC}));function g(A){return A<=2||0==(A&A-1)&&0!==A}function h(A){if(1===A.length)return A[0];let e=0;for(let t=0;t<A.length;t++){e+=A[t].byteLength}const t=new Uint8Array(e);let s=0;for(let e=0;e<A.length;e++){const i=A[e];t.set(i,s),s+=i.byteLength}return t}};const xA=new Set([A.RGBAFormat,A.RGFormat,A.RedFormat]),SA={109:A.RGBAFormat,97:A.RGBAFormat,37:A.RGBAFormat,43:A.RGBAFormat,103:A.RGFormat,83:A.RGFormat,16:A.RGFormat,22:A.RGFormat,100:A.RedFormat,76:A.RedFormat,15:A.RedFormat,9:A.RedFormat,166:A.RGBA_ASTC_6x6_Format,165:A.RGBA_ASTC_6x6_Format},TA={109:A.FloatType,97:A.HalfFloatType,37:A.UnsignedByteType,43:A.UnsignedByteType,103:A.FloatType,83:A.HalfFloatType,16:A.UnsignedByteType,22:A.UnsignedByteType,100:A.FloatType,76:A.HalfFloatType,15:A.UnsignedByteType,9:A.UnsignedByteType,166:A.UnsignedByteType,165:A.UnsignedByteType};function MA(e){const t=e.dataFormatDescriptor[0];return t.colorPrimaries===lA?t.transferFunction===gA?A.SRGBColorSpace:A.LinearSRGBColorSpace:t.colorPrimaries===cA?t.transferFunction===gA?A.DisplayP3ColorSpace:A.LinearDisplayP3ColorSpace:(t.colorPrimaries===hA||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${t.colorPrimaries}"`),A.NoColorSpace)}const LA=new TextDecoder;class FA{constructor(A,e,t,s){this.buffer=A,this.binOffset=e+t,this.binLength=s;let i=null;if(0!==t)try{const s=new Uint8Array(A,e,t);i=JSON.parse(LA.decode(s))}catch(A){i={}}else i={};this.header=i}getKeys(){return Object.keys(this.header)}getData(A,e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const i=this.header;if(!(A in i))return null;const r=i[A];if(r instanceof Object){if(Array.isArray(r))return r;{const{buffer:i,binOffset:o,binLength:n}=this,a=r.byteOffset||0,g=r.type||s,h=r.componentType||t;if("type"in r&&s&&r.type!==s)throw new Error("FeatureTable: Specified type does not match expected type.");let l,c;switch(g){case"SCALAR":l=1;break;case"VEC2":l=2;break;case"VEC3":l=3;break;case"VEC4":l=4;break;default:throw new Error('FeatureTable : Feature type not provided for "'.concat(A,'".'))}const I=o+a,C=e*l;switch(h){case"BYTE":c=new Int8Array(i,I,C);break;case"UNSIGNED_BYTE":c=new Uint8Array(i,I,C);break;case"SHORT":c=new Int16Array(i,I,C);break;case"UNSIGNED_SHORT":c=new Uint16Array(i,I,C);break;case"INT":c=new Int32Array(i,I,C);break;case"UNSIGNED_INT":c=new Uint32Array(i,I,C);break;case"FLOAT":c=new Float32Array(i,I,C);break;case"DOUBLE":c=new Float64Array(i,I,C);break;default:throw new Error('FeatureTable : Feature component type not provided for "'.concat(A,'".'))}if(I+C*c.BYTES_PER_ELEMENT>o+n)throw new Error("FeatureTable: Feature data read outside binary body length.");return c}}return r}}class GA extends FA{constructor(A,e,t,s,i){super(A,t,s,i),this.batchSize=e}getData(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return super.getData(A,this.batchSize,e,t)}}function bA(A,e,t){return e=function(A){var e=function(A,e){if("object"!=typeof A||!A)return A;var t=A[Symbol.toPrimitive];if(void 0!==t){var s=t.call(A,e||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(A)}(A,"string");return"symbol"==typeof e?e:String(e)}(e),e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}const kA=new A.Matrix4;kA.set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1);const UA="https://www.gstatic.com/draco/versioned/decoders/1.4.3/",_A="https://storage.googleapis.com/ogc-3d-tiles/basis/",NA="draco-decoders/",vA="ktx2-decoders/";class HA{constructor(e){bA(this,"checkLoaderInitialized",(async()=>new Promise((A=>{const e=setInterval((()=>{this.gltfLoader.dracoLoader&&this.gltfLoader.ktx2Loader&&(clearInterval(e),A())}),10)})))),this.gltfLoader=new g,this.tempMatrix=new A.Matrix4;const t=new oA,s=new RA;async function i(A){return fetch(A,{method:"HEAD"}).then((A=>A.ok)).catch((A=>!1))}i(NA+"draco_decoder.wasm").then((A=>(A?t.setDecoderPath(NA):(console.log("no local draco decoder found in "+NA+", fetching online at "+UA),t.setDecoderPath(UA)),i(vA+"basis_transcoder.wasm")))).then((A=>{A?s.setTranscoderPath(vA).detectSupport(e):(console.log("no local ktx2 decoder found in "+vA+", fetching online at "+_A),s.setTranscoderPath(_A).detectSupport(e))})).then((()=>{this.gltfLoader.setDRACOLoader(t),this.gltfLoader.setKTX2Loader(s)}))}parseB3DM(A,e,t,s){const i=new DataView(A),r=String.fromCharCode(i.getUint8(0))+String.fromCharCode(i.getUint8(1))+String.fromCharCode(i.getUint8(2))+String.fromCharCode(i.getUint8(3));console.assert("b3dm"===r);const o=i.getUint32(8,!0);console.assert(o===A.byteLength);const n=i.getUint32(12,!0),a=i.getUint32(16,!0),g=i.getUint32(20,!0),h=i.getUint32(24,!0),l=new FA(A,28,n,a),c=28+n+a,I=(new GA(A,l.getData("BATCH_LENGTH"),c,g,h),c+g+h),C=new Uint8Array(A,I,o-I).slice().buffer;return new Promise((async(A,i)=>{await this.checkLoaderInitialized(),this.gltfLoader.parse(C,null,(i=>{const r=l.getData("RTC_CENTER");r?(this.tempMatrix.makeTranslation(r[0],r[1],r[2]),i.scene.applyMatrix4(this.tempMatrix)):i.userData.gltfExtensions&&i.userData.gltfExtensions.CESIUM_RTC&&(this.tempMatrix.makeTranslation(i.userData.gltfExtensions.CESIUM_RTC.center[0],i.userData.gltfExtensions.CESIUM_RTC.center[1],i.userData.gltfExtensions.CESIUM_RTC.center[2]),i.scene.applyMatrix4(this.tempMatrix)),t&&i.scene.applyMatrix4(kA),i.scene.asset=i.asset,i.scene.traverse((A=>{A.isMesh&&(s&&A.applyMatrix4(kA),e&&e(A))})),A(i.scene)}),(A=>{console.error(A)}))}))}parseB3DMInstanced(e,t,s,i,r){return this.parseB3DM(e,t,i,r).then((e=>{let t,i=[],r=[];e.updateWorldMatrix(!1,!0),e.traverse((A=>{A.isMesh&&(A.geometry.applyMatrix4(A.matrixWorld),i.push(A.geometry),r.push(A.material))}));let o=function(e){let t=new Set;e.forEach((A=>{for(let e in A.attributes)t.add(e)})),e.forEach((e=>{t.forEach((t=>{if(!e.attributes[t]){const s=function(A){switch(A){case"position":case"normal":case"color":return 3;case"uv":case"uv2":return 2;default:throw new Error("Unknown attribute ".concat(A))}}(t),i=new Float32Array(s*e.getAttribute("position").count).fill(0);e.setAttribute(t,new A.BufferAttribute(i,s))}}))}));let s=function(e,t=!1){const s=null!==e[0].index,i=new Set(Object.keys(e[0].attributes)),r=new Set(Object.keys(e[0].morphAttributes)),o={},a={},g=e[0].morphTargetsRelative,h=new A.BufferGeometry;let l=0;for(let A=0;A<e.length;++A){const n=e[A];let c=0;if(s!==(null!==n.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+A+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const e in n.attributes){if(!i.has(e))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+A+'. All geometries must have compatible attributes; make sure "'+e+'" attribute exists among all geometries, or in none of them.'),null;void 0===o[e]&&(o[e]=[]),o[e].push(n.attributes[e]),c++}if(c!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+A+". Make sure all geometries have the same number of attributes."),null;if(g!==n.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+A+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const e in n.morphAttributes){if(!r.has(e))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+A+". .morphAttributes must be consistent throughout all geometries."),null;void 0===a[e]&&(a[e]=[]),a[e].push(n.morphAttributes[e])}if(t){let e;if(s)e=n.index.count;else{if(void 0===n.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+A+". The geometry must have either an index or a position attribute"),null;e=n.attributes.position.count}h.addGroup(l,e,A),l+=e}}if(s){let A=0;const t=[];for(let s=0;s<e.length;++s){const i=e[s].index;for(let e=0;e<i.count;++e)t.push(i.getX(e)+A);A+=e[s].attributes.position.count}h.setIndex(t)}for(const A in o){const e=n(o[A]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+A+" attribute."),null;h.setAttribute(A,e)}for(const A in a){const e=a[A][0].length;if(0===e)break;h.morphAttributes=h.morphAttributes||{},h.morphAttributes[A]=[];for(let t=0;t<e;++t){const e=[];for(let s=0;s<a[A].length;++s)e.push(a[A][s][t]);const s=n(e);if(!s)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+A+" morphAttribute."),null;h.morphAttributes[A].push(s)}}return h}(e,!0);return s}(i);return t=new A.InstancedMesh(o,r,s),t.baseMatrix=(new A.Matrix4).identity(),t}))}}const qA=new A.Matrix4;qA.set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1);class PA{constructor(A){this.maxCachedItems=100,this.proxy=A.proxy,A&&(this.meshCallback=A.meshCallback,this.pointsCallback=A.pointsCallback,A.maxCachedItems&&(this.maxCachedItems=A.maxCachedItems)),this.gltfLoader=new g;const e=new oA;if(e.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.4.3/"),this.gltfLoader.setDRACOLoader(e),A&&A.renderer){const e=new RA;e.setTranscoderPath("https://storage.googleapis.com/ogc-3d-tiles/basis/").detectSupport(A.renderer),this.gltfLoader.setKTX2Loader(e),this.b3dmDecoder=new HA(A.renderer)}else this.b3dmDecoder=new HA(null);this.cache=new o.LinkedHashMap,this.register={},this.ready=[],this.downloads=[],this.nextReady=[],this.nextDownloads=[],this.init()}init(){const A=this;OA((()=>{A.download()}),10),OA((()=>{const e=Date.now();let t=0;do{t=A.loadBatch()}while(t>0&&Date.now()-e<=0)}),10)}scheduleDownload(A){this.downloads.unshift(A)}download(){if(0!=this.nextDownloads.length||(this.getNextDownloads(),0!=this.nextDownloads.length))for(;this.nextDownloads.length>0;){const A=this.nextDownloads.shift();A&&A.shouldDoDownload()&&A.doDownload()}}meshReceived(A,e,t,s,i,r,o){this.ready.unshift([A,e,t,s,i,r,o])}loadBatch(){if(0==this.nextReady.length&&(this.getNextReady(),0==this.nextReady.length))return 0;const A=this.nextReady.shift();if(!A)return 0;const e=A[0],t=A[1],s=A[2],i=e.get(s);return i&&t[s]&&Object.keys(t[s]).forEach((A=>{const e=t[s][A];e&&(e(i),t[s][A]=null)})),1}getNextDownloads(){let A=Number.MAX_VALUE,e=-1;for(let A=this.downloads.length-1;A>=0;A--)this.downloads[A].shouldDoDownload()?this.downloads[A].distanceFunction||this.nextDownloads.push(this.downloads.splice(A,1)[0]):this.downloads.splice(A,1);if(!(this.nextDownloads.length>0)){for(let t=this.downloads.length-1;t>=0;t--){const s=this.downloads[t].distanceFunction()*this.downloads[t].level;s<A&&(A=s,e=t)}if(e>=0){const A=this.downloads.splice(e,1).pop();this.nextDownloads.push(A);const t=A.getSiblings();for(let A=this.downloads.length-1;A>=0;A--)t.includes(this.downloads[A].uuid)&&this.nextDownloads.push(this.downloads.splice(A,1).pop())}}}getNextReady(){let A=Number.MAX_VALUE,e=-1;for(let A=this.ready.length-1;A>=0;A--)this.ready[A][3]||this.nextReady.push(this.ready.splice(A,1)[0]);if(!(this.nextReady.length>0)){for(let t=this.ready.length-1;t>=0;t--){const s=this.ready[t][3]()*this.ready[t][5];s<A&&(A=s,e=t)}if(e>=0){const A=this.ready.splice(e,1).pop();this.nextReady.push(A);const t=A[4]();for(let A=this.ready.length-1;A>=0;A--)t.includes(this.ready[A][6])&&this.nextready.push(this.ready.splice(A,1).pop())}}}get(A,e,t,s,i,r,o,n,a,g){const h=this,l=JA(t),c=new AbortController;if(A.signal.addEventListener("abort",(()=>{h.register[l]&&0!=Object.keys(h.register[l]).length||c.abort()})),!(t.includes(".b3dm")||t.includes(".json")||t.includes(".gltf")||t.includes(".glb")))return void console.error("the 3DTiles cache can only be used to load B3DM, gltf and json data");h.register[l]||(h.register[l]={}),h.register[l][e]&&console.error(" a tile should only be loaded once"),h.register[l][e]=s;if(h.cache.get(l))this.meshReceived(h.cache,h.register,l,i,r,o,e);else if(1==Object.keys(h.register[l]).length){let s;t.includes(".b3dm")?s=()=>{(h.proxy?()=>fetch(h.proxy,{method:"POST",body:t,signal:c.signal}):()=>fetch(t,{signal:c.signal}))().then((A=>{if(!A.ok)throw console.error("could not load tile with path : "+t),new Error("couldn't load \"".concat(t,'". Request failed with status ').concat(A.status," : ").concat(A.statusText));return A.arrayBuffer()})).then((A=>this.b3dmDecoder.parseB3DM(A,h.meshCallback,n,a))).then((A=>{h.cache.put(l,A),h.checkSize(),this.meshReceived(h.cache,h.register,l,i,r,o,e)})).catch((A=>{console.error(A)}))}:t.includes(".glb")||t.includes(".gltf")?s=()=>{(h.proxy?()=>fetch(h.proxy,{method:"POST",body:t,signal:c.signal}):()=>fetch(t,{signal:c.signal}))().then((A=>{if(!A.ok)throw console.error("could not load tile with path : "+t),new Error("couldn't load \"".concat(t,'". Request failed with status ').concat(A.status," : ").concat(A.statusText));return A.arrayBuffer()})).then((async A=>{await async function(A){return new Promise((e=>{const t=setInterval((()=>{A.dracoLoader&&A.ktx2Loader&&(clearInterval(t),e())}),10)}))}(this.gltfLoader),this.gltfLoader.parse(A,null,(A=>{A.scene.asset=A.asset,n&&A.scene.applyMatrix4(qA),A.scene.traverse((A=>{A.isMesh&&(a&&A.applyMatrix4(qA),h.meshCallback&&h.meshCallback(A,g)),A.isPoints&&h.pointsCallback&&h.pointsCallback(A,g)})),h.cache.put(l,A.scene),h.checkSize(),h.meshReceived(h.cache,h.register,l,i,r,o,e)}))})).catch((A=>{console.error(A)}))}:t.includes(".json")&&(s=()=>{(h.proxy?()=>fetch(h.proxy,{method:"POST",body:t,signal:c.signal}):()=>fetch(t,{signal:c.signal}))().then((A=>{if(!A.ok)throw console.error("could not load tile with path : "+t),new Error("couldn't load \"".concat(t,'". Request failed with status ').concat(A.status," : ").concat(A.statusText));return A.json()})).then((A=>{h.cache.put(l,A),h.checkSize(),h.meshReceived(h.cache,h.register,l)})).catch((A=>{console.error(A)}))}),this.scheduleDownload({shouldDoDownload:()=>!A.signal.aborted&&!!h.register[l]&&Object.keys(h.register[l]).length>0,doDownload:s,distanceFunction:i,getSiblings:r,level:o,uuid:e})}}invalidate(A,e){const t=JA(A);this.register[t]&&delete this.register[t][e]}checkSize(){const A=this;let e=0;for(;A.cache.size()>A.maxCachedItems&&e<A.cache.size();){e++;const t=A.cache.head(),s=A.register[t.key];s&&(Object.keys(s).length>0?(A.cache.remove(t.key),A.cache.put(t.key,t.value)):(A.cache.remove(t.key),delete A.register[t.key],t.value.traverse((A=>{if(A.material)if(A.material.length)for(let e=0;e<A.material.length;++e)A.material[e].dispose();else A.material.dispose();A.geometry&&A.geometry.dispose()}))))}}}function OA(A,e){let t;const s=async()=>{const i=Date.now();try{await A()}catch(A){console.error(A)}finally{const A=Date.now()-i;t=setTimeout(s,A>=e?0:e-A)}};return t=setTimeout(s,e),{clearInterval:()=>clearTimeout(t)}}function JA(A){for(var e=A.split("/"),t=[],s=0,i=0;i<e.length;i++){var r=e[i];"."!==r&&""!==r&&".."!==r?t[s++]=r:".."===r&&s>0&&s--}if(0===s)return"/";var o="";for(i=0;i<s;i++)o+="/"+t[i];return o}var VA,KA=new Uint8Array(16);function jA(){if(!VA&&!(VA="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return VA(KA)}const YA=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const WA=function(A){return"string"==typeof A&&YA.test(A)};for(var XA=[],zA=0;zA<256;++zA)XA.push((zA+256).toString(16).substr(1));const ZA=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(XA[A[e+0]]+XA[A[e+1]]+XA[A[e+2]]+XA[A[e+3]]+"-"+XA[A[e+4]]+XA[A[e+5]]+"-"+XA[A[e+6]]+XA[A[e+7]]+"-"+XA[A[e+8]]+XA[A[e+9]]+"-"+XA[A[e+10]]+XA[A[e+11]]+XA[A[e+12]]+XA[A[e+13]]+XA[A[e+14]]+XA[A[e+15]]).toLowerCase();if(!WA(t))throw TypeError("Stringified UUID is invalid");return t};const $A=function(A,e,t){var s=(A=A||{}).random||(A.rng||jA)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e){t=t||0;for(var i=0;i<16;++i)e[t+i]=s[i];return e}return ZA(s)};var Ae,ee=s(975);const te=new A.Sphere(new A.Vector3(0,0,0),1),se=new A.Vector3(0,0,0),ie=new A.Vector3(0,0,0),re=new A.Vector3(0,1,0),oe=new A.Vector2(1e3,1e3),ne=new A.Quaternion,ae={};class ge extends A.Object3D{constructor(t){super();const s=this;if(this.proxy=t.proxy,this.displayErrors=t.displayErrors,this.displayCopyright=t.displayCopyright,t.queryParams&&(this.queryParams={...t.queryParams}),this.uuid=$A(),t.tileLoader)this.tileLoader=t.tileLoader;else{const e={};e.meshCallback=t.meshCallback?t.meshCallback:(e,t)=>{e.material.wireframe=!1,e.material.side=A.DoubleSide},e.pointsCallback=t.pointsCallback?t.pointsCallback:(A,e)=>{A.material.size=Math.pow(e,.33),A.material.sizeAttenuation=!0},e.proxy=this.proxy,e.renderer=t.renderer,this.tileLoader=new PA(e)}if(this.displayCopyright=!!t.displayCopyright,this.geometricErrorMultiplier=t.geometricErrorMultiplier?t.geometricErrorMultiplier:1,this.renderer=t.renderer,this.meshCallback=t.meshCallback,this.loadOutsideView=t.loadOutsideView,this.cameraOnLoad=t.cameraOnLoad,this.parentTile=t.parentTile,this.occlusionCullingService=t.occlusionCullingService,this.static=t.static,this.occlusionCullingService&&(this.color=new A.Color,this.color.setHex(16777215*Math.random()),this.colorID=e(255*s.color.r,0,255)<<16^e(255*s.color.g,0,255)<<8^e(255*s.color.b,0,255)<<0),this.static&&(this.matrixAutoUpdate=!1),this.childrenTiles=[],this.meshContent,this.tileContent,this.refine,this.rootPath,this.geometricError,this.boundingVolume,this.json,this.materialVisibility=!1,this.inFrustum=!0,this.level=t.level?t.level:0,this.hasMeshContent=!1,this.hasUnloadedJSONContent=!1,this.centerModel=t.centerModel,this.abortController=new AbortController,t.json)s.setup(t),t.onLoadCallback&&t.onLoadCallback(s);else if(t.url){var i=t.url;if(s.queryParams){var o="";for(let A in s.queryParams)s.queryParams.hasOwnProperty(A)&&(o+="&"+A+"="+s.queryParams[A]);i.includes("?")?i+=o:i+="?"+o.substring(1)}(s.proxy?()=>fetch(s.proxy,{method:"POST",body:i,signal:s.abortController.signal}):()=>fetch(i,{signal:s.abortController.signal}))().then((e=>{if(!e.ok)throw new Error("couldn't load \"".concat(t.url,'". Request failed with status ').concat(e.status," : ").concat(e.statusText));e.json().then((e=>{if(s.setup({rootPath:ee.dirname(t.url),json:e}),t.onLoadCallback&&t.onLoadCallback(s),s.centerModel){const e=new A.Sphere;s.boundingVolume instanceof r?e.copy(s.boundingVolume.sphere):s.boundingVolume instanceof A.Sphere&&e.copy(s.boundingVolume),this.json.boundingVolume.region&&(this.transformWGS84ToCartesian(.5*(this.json.boundingVolume.region[0]+this.json.boundingVolume.region[2]),.5*(this.json.boundingVolume.region[1]+this.json.boundingVolume.region[3]),.5*(this.json.boundingVolume.region[4]+this.json.boundingVolume.region[5]),se),ne.setFromUnitVectors(se.normalize(),re.normalize()),s.applyQuaternion(ne)),s.translateX(-e.center.x*s.scale.x),s.translateY(-e.center.y*s.scale.y),s.translateZ(-e.center.z*s.scale.z)}}))})).catch((A=>{s.displayErrors&&he(A)}))}}setup(e){if(e.json.root?(this.json=e.json.root,this.json.refine||(this.json.refine=e.json.refine),this.json.geometricError||(this.json.geometricError=e.json.geometricError),this.json.transform||(this.json.transform=e.json.transform),this.json.boundingVolume||(this.json.boundingVolume=e.json.boundingVolume)):this.json=e.json,this.rootPath=e.json.rootPath?e.json.rootPath:e.rootPath,this.json.refine?this.refine=this.json.refine:this.refine=e.parentRefine,this.json.geometricError?this.geometricError=this.json.geometricError:this.geometricError=e.parentGeometricError,this.json.transform&&!this.centerModel){let e=new A.Matrix4;e.elements=this.json.transform,this.applyMatrix4(e)}if(this.json.boundingVolume)if(this.json.boundingVolume.box)this.boundingVolume=new r(this.json.boundingVolume.box);else if(this.json.boundingVolume.region){const e=this.json.boundingVolume.region;this.transformWGS84ToCartesian(e[0],e[1],e[4],se),this.transformWGS84ToCartesian(e[2],e[3],e[5],ie),se.lerp(ie,.5),this.boundingVolume=new A.Sphere(new A.Vector3(se.x,se.y,se.z),se.distanceTo(ie))}else if(this.json.boundingVolume.sphere){const e=this.json.boundingVolume.sphere;this.boundingVolume=new A.Sphere(new A.Vector3(e[0],e[1],e[2]),e[3])}else this.boundingVolume=e.parentBoundingVolume;else this.boundingVolume=e.parentBoundingVolume;this.json.content&&(this.json.content.uri&&this.json.content.uri.includes("json")||this.json.content.url&&this.json.content.url.includes("json")?this.hasUnloadedJSONContent=!0:this.hasMeshContent=!0,this.load())}assembleURL(A,e){A.endsWith("/")||(A+="/");const t=new URL(A);let s=t.pathname.split("/").filter((A=>""!==A)),i=e.split("/").filter((A=>""!==A));for(let A=1;A<=s.length&&!(A>=i.length);A++){if(s.slice(s.length-A,s.length).join("/")===i.slice(0,A).join("/")){for(let e=0;e<A;e++)s.pop();break}}for(;i.length>0&&".."===i[0];)s.pop(),i.shift();return"".concat(t.protocol,"//").concat(t.host,"/").concat([...s,...i].join("/"))}extractQueryParams(A,e){const t=new URL(A);for(let[A,s]of t.searchParams)e[A]=s;return t.search="",t.toString()}load(){var e=this;if(!e.deleted&&e.json.content){let s;e.json.content.uri?s=e.json.content.uri:e.json.content.url&&(s=e.json.content.url);const i=/^(?:http|https|ftp|tcp|udp):\/\/\S+/;if(i.test(e.rootPath)?i.test(s)||(s=e.assembleURL(e.rootPath,s)):ee.isAbsolute(e.rootPath)&&(s=e.rootPath+ee.sep+s),s=e.extractQueryParams(s,e.queryParams),e.queryParams){var t="";for(let A in e.queryParams)e.queryParams.hasOwnProperty(A)&&(t+="&"+A+"="+e.queryParams[A]);s.includes("?")?s+=t:s+="?"+t.substring(1)}if(s)if(s.includes(".b3dm")||s.includes(".glb")||s.includes(".gltf")){e.contentURL=s;try{e.tileLoader.get(e.abortController,this.uuid,s,(t=>{if(e.deleted)return;t.asset&&t.asset.copyright&&(t.asset.copyright.split(";").forEach((A=>{ae[A]?ae[A]++:ae[A]=1})),e.displayCopyright&&le()),t.traverse((t=>{if((t.isMesh||t.isPoints)&&(t.layers.disable(0),e.static&&(t.matrixAutoUpdate=!1)),t.isMesh&&e.occlusionCullingService){const s=t.geometry.attributes.position,i=[];for(let A=0;A<s.count;A++)i.push(e.color.r,e.color.g,e.color.b);t.geometry.setAttribute("color",new A.Float32BufferAttribute(i,3))}}));Date.now();e.add(t),e.updateWorldMatrix(!1,!0),e.meshContent=t}),e.cameraOnLoad?()=>e.calculateDistanceToCamera(e.cameraOnLoad):()=>0,(()=>e.getSiblings()),e.level,!e.json.boundingVolume.region,!!e.json.boundingVolume.region,e.geometricError)}catch(A){e.displayErrors&&he(A)}}else s.includes(".json")&&e.tileLoader.get(e.abortController,this.uuid,s,(A=>{e.deleted||(e.json.children||(e.json.children=[]),A.rootPath=ee.dirname(s),e.json.children.push(A),delete e.json.content,e.hasUnloadedJSONContent=!1)}))}}dispose(){const A=this;A.meshContent&&A.meshContent.asset&&A.meshContent.asset.copyright&&(A.meshContent.asset.copyright.split(";").forEach((A=>{ae[A]&&ae[A]--})),A.displayCopyright&&le()),A.childrenTiles.forEach((A=>A.dispose())),A.deleted=!0,this.traverse((function(e){e.contentURL&&A.tileLoader.invalidate(e.contentURL,e.uuid),e.abortController&&e.abortController.abort()})),this.parent=null,this.parentTile=null,this.dispatchEvent({type:"removed"})}disposeChildren(){var A=this;A.childrenTiles.forEach((A=>A.dispose())),A.childrenTiles=[],A.children=[],A.meshContent&&A.children.push(A.meshContent)}update(e){const t=new A.Frustum;t.setFromProjectionMatrix((new A.Matrix4).multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse)),this._update(e,t)}_update(A,e){const t=this,s=t.materialVisibility;function i(A){if(t.hasMeshContent&&t.meshContent){if(A<0)return t.inFrustum=!1,void t.changeContentVisibility(!!t.loadOutsideView);if(t.inFrustum=!0,0!=t.childrenTiles.length){if(A>=t.geometricErrorMultiplier*t.geometricError)t.changeContentVisibility(!0);else if(A<t.geometricErrorMultiplier*t.geometricError&&"REPLACE"==t.refine){let A=!0;t.childrenTiles.every((e=>!!e.isReady()||(A=!1,!1))),A&&t.changeContentVisibility(!1)}}else t.changeContentVisibility(!0)}}t.boundingVolume&&t.geometricError&&(t.metric=t.calculateUpdateMetric(A,e)),t.childrenTiles.forEach((t=>t._update(A,e))),i(t.metric),function(e){if(e<0&&t.hasMeshContent)return;if(t.occlusionCullingService&&t.hasMeshContent&&!t.occlusionCullingService.hasID(t.colorID))return;if((!t.hasMeshContent||e<t.geometricErrorMultiplier*t.geometricError&&t.meshContent)&&t.json&&t.json.children&&t.childrenTiles.length!=t.json.children.length)t.json.children.forEach((e=>{if(!e.root&&!e.children&&!e.content)return;let s=new ge({parentTile:t,queryParams:t.queryParams,parentGeometricError:t.geometricError,parentBoundingVolume:t.boundingVolume,parentRefine:t.refine,json:e,rootPath:t.rootPath,geometricErrorMultiplier:t.geometricErrorMultiplier,loadOutsideView:t.loadOutsideView,level:t.level+1,tileLoader:t.tileLoader,cameraOnLoad:A,occlusionCullingService:t.occlusionCullingService,renderer:t.renderer,static:t.static,centerModel:!1,displayErrors:t.displayErrors,displayCopyright:t.displayCopyright});t.childrenTiles.push(s),t.add(s)}))}(t.metric),function(A,e){if(!t.hasMeshContent)return;if(!t.inFrustum)return t.disposeChildren(),void i(A);if(t.occlusionCullingService&&!e&&t.hasMeshContent&&t.meshContent&&t.meshDisplayed&&t.areAllChildrenLoadedAndHidden())return t.disposeChildren(),void i(A);if(A>=t.geometricErrorMultiplier*t.geometricError)t.disposeChildren(),i(A)}(t.metric,s)}areAllChildrenLoadedAndHidden(){let A=!0;const e=this;return this.childrenTiles.every((t=>{if(t.hasMeshContent){if(t.childrenTiles.length>0)return A=!1,!1;if(!t.inFrustum)return!0;if(!t.materialVisibility||t.meshDisplayed)return A=!1,!1;if(e.occlusionCullingService.hasID(t.colorID))return A=!1,!1}else if(!t.areAllChildrenLoadedAndHidden())return A=!1,!1;return!0})),A}isReady(){if(!this.inFrustum)return!0;if(this.hasUnloadedJSONContent)return!1;if(!this.hasMeshContent||!this.meshContent||!this.materialVisibility){if(this.children.length>0){var A=!0;return this.childrenTiles.every((e=>!!e.isReady()||(A=!1,!1))),A}return!1}return!this.hasMeshContent||!!this.meshContent&&(!!this.materialVisibility&&!!this.meshDisplayed)}changeContentVisibility(A){const e=this;e.hasMeshContent&&e.meshContent&&(A?e.meshContent.traverse((A=>{(A.isMesh||A.isPoints)&&A.layers.enable(0)})):e.meshContent.traverse((A=>{(A.isMesh||A.isPoints)&&A.layers.disable(0)}))),e.materialVisibility!=A&&(e.materialVisibility=A,e.meshDisplayed=!0)}calculateUpdateMetric(e,t){if(this.boundingVolume instanceof r){if(te.copy(this.boundingVolume.sphere),te.applyMatrix4(this.matrixWorld),!t.intersectsSphere(te))return-1}else{if(!(this.boundingVolume instanceof A.Sphere))return console.error("unsupported shape"),-1;if(te.copy(this.boundingVolume),te.applyMatrix4(this.matrixWorld),!t.intersectsSphere(te))return-1}const s=Math.max(0,e.position.distanceTo(te.center)-te.radius);if(0==s)return 0;const i=this.matrixWorld.getMaxScaleOnAxis();this.renderer&&this.renderer.getDrawingBufferSize(oe);let o=oe.y,n=e.fov;e.aspect<1&&(n*=e.aspect,o=oe.x);let a=2*Math.tan(.5*n*.017453292519943295)*s;return 16*window.devicePixelRatio*a/(o*i)}getSiblings(){const A=this,e=[];if(!A.parentTile)return e;let t=A.parentTile;for(;!t.hasMeshContent&&t.parentTile;)t=t.parentTile;return t.childrenTiles.forEach((t=>{if(t&&t!=A){for(;!t.hasMeshContent&&t.childrenTiles[0];)t=t.childrenTiles[0];e.push(t)}})),e}calculateDistanceToCamera(e){return this.boundingVolume instanceof r?(te.copy(this.boundingVolume.sphere),te.applyMatrix4(this.matrixWorld)):this.boundingVolume instanceof A.Sphere?(te.copy(this.boundingVolume),te.applyMatrix4(this.matrixWorld)):console.error("unsupported shape"),Math.max(0,e.position.distanceTo(te.center)-te.radius)}setGeometricErrorMultiplier(A){this.geometricErrorMultiplier=A,this.childrenTiles.forEach((e=>e.setGeometricErrorMultiplier(A)))}transformWGS84ToCartesian(A,e,t,s){const i=6378137/Math.sqrt(1-.006694384442042*Math.pow(Math.sin(e),2)),r=Math.cos(e),o=Math.cos(A),n=Math.sin(e),a=i+t,g=a*r*o,h=a*r*Math.sin(A),l=(.993305615557957*i+t)*n;s.set(g,h,l)}}function he(A){var e=document.createElement("div");e.textContent=A,e.style.position="fixed",e.style.top="10px",e.style.left="50%",e.style.transform="translateX(-50%)",e.style.padding="10px",e.style.backgroundColor="#ff8800",e.style.color="#ffffff",e.style.zIndex="9999",document.body.appendChild(e),setTimeout((function(){e.remove()}),8e3)}function le(){Ae||(Ae=document.createElement("div"));var A="";for(let e in ae)ae.hasOwnProperty(e)&&ae[e]>0&&(A+=e+", ");Ae.textContent=A,Ae.style.position="fixed",Ae.style.bottom="20px",Ae.style.left="20px",Ae.style.color="white",Ae.style.textShadow="2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000",Ae.style.padding="10px",Ae.style.backgroundColor="rgba(0, 0, 0, 0.1)",document.body.appendChild(Ae)}const ce=new A.Sphere(new A.Vector3(0,0,0),1),Ie=new A.Vector3(0,0,0),Ce=new A.Vector3(0,0,0),Be=new A.Vector3(0,1,0),Ee=new A.Vector2,de=new A.Quaternion,ue=new A.Matrix4;class Qe extends A.Object3D{constructor(e){super();const t=this;if(e.queryParams&&(this.queryParams={...e.queryParams}),this.uuid=$A(),e.tileLoader?this.tileLoader=e.tileLoader:console.error("an instanced tileset must be provided an InstancedTilesetLoader"),this.master=e.master,this.meshCallback=e.meshCallback,this.loadOutsideView=e.loadOutsideView,this.cameraOnLoad=e.cameraOnLoad,this.parentTile=e.parentTile,this.childrenTiles=[],this.jsonChildren=[],this.meshContent,this.tileContent,this.refinement,this.rootPath,this.geometricError,this.boundingVolume,this.json,this.materialVisibility=!1,this.inFrustum=!0,this.level=e.level?e.level:0,this.hasMeshContent=!1,this.hasUnloadedJSONContent=!1,this.centerModel=e.centerModel,this.deleted=!1,this.abortController=new AbortController,e.json)this.rootPath=e.json.rootPath?e.json.rootPath:e.rootPath,e.json.children&&(this.jsonChildren=e.json.children),t.setup(e),e.onLoadCallback&&e.onLoadCallback(t);else if(e.url){this.loadJson=(s,i)=>{const o=ee.dirname(i);if(t.setup({rootPath:o,json:s}),t.centerModel){const e=new A.Sphere;t.boundingVolume instanceof r?e.copy(t.boundingVolume.sphere):t.boundingVolume instanceof A.Sphere&&e.copy(t.boundingVolume),this.json.boundingVolume.region&&(t.transformWGS84ToCartesian(.5*(t.json.boundingVolume.region[0]+t.json.boundingVolume.region[2]),.5*(t.json.boundingVolume.region[1]+t.json.boundingVolume.region[3]),.5*(t.json.boundingVolume.region[4]+t.json.boundingVolume.region[5]),Ie),de.setFromUnitVectors(Ie.normalize(),Be.normalize()),t.master.applyQuaternion(de),t.master.updateWorldMatrix(!1,!1)),ue.makeTranslation(-e.center.x*t.scale.x,-e.center.y*t.scale.y,-e.center.z*t.scale.z),t.master.matrix.multiply(ue),t.master.matrix.decompose(t.master.position,t.master.quaternion,t.master.scale)}e.onLoadCallback&&e.onLoadCallback(t)};var s=e.url;if(t.queryParams){var i="";for(let A in t.queryParams)t.queryParams.hasOwnProperty(A)&&(i+="&"+A+"="+t.queryParams[A]);s.includes("?")?s+=i:s+="?"+i.substring(1)}t.tileLoader.get(t.abortController,s,t.uuid,t)}}setup(e){if(this.isSetup=!0,e.json.root?(this.json=e.json.root,this.jsonChildren=this.json.children,this.json.refinement||(this.json.refinement=e.json.refinement),this.json.geometricError||(this.json.geometricError=e.json.geometricError),this.json.transform||(this.json.transform=e.json.transform),this.json.boundingVolume||(this.json.boundingVolume=e.json.boundingVolume)):this.json=e.json,this.rootPath=e.json.rootPath?e.json.rootPath:e.rootPath,this.json.refinement?this.refinement=this.json.refinement:this.refinement=e.parentRefinement,this.json.geometricError?this.geometricError=this.json.geometricError:this.geometricError=e.parentGeometricError,this.json.transform&&!this.centerModel){let e=new A.Matrix4;e.elements=this.json.transform,this.master.applyMatrix4(e)}if(this.json.boundingVolume)if(this.json.boundingVolume.box)this.boundingVolume=new r(this.json.boundingVolume.box);else if(this.json.boundingVolume.region){const e=this.json.boundingVolume.region;this.transformWGS84ToCartesian(e[0],e[1],e[4],Ie),this.transformWGS84ToCartesian(e[2],e[3],e[5],Ce),Ie.lerp(Ce,.5),this.boundingVolume=new A.Sphere(new A.Vector3(Ie.x,Ie.y,Ie.z),Ie.distanceTo(Ce))}else if(this.json.boundingVolume.sphere){const e=this.json.boundingVolume.sphere;this.boundingVolume=new A.Sphere(new A.Vector3(e[0],e[1],e[2]),e[3])}else this.boundingVolume=e.parentBoundingVolume;else this.boundingVolume=e.parentBoundingVolume;this.json.content&&(this.json.content.uri&&this.json.content.uri.includes("json")||this.json.content.url&&this.json.content.url.includes("json")?this.hasUnloadedJSONContent=!0:this.hasMeshContent=!0,this.load())}isAbsolutePathOrURL(A){const e=/^(?:http|https|ftp|tcp|udp):\/\/\S+/.test(A),t=A.startsWith("/")&&!A.startsWith("//");return e||t}assembleURL(A,e){A.endsWith("/")||(A+="/");const t=new URL(A);let s=t.pathname.split("/").filter((A=>""!==A)),i=e.split("/").filter((A=>""!==A));for(let A=1;A<=s.length&&!(A>=i.length);A++){if(s.slice(s.length-A,s.length).join("/")===i.slice(0,A).join("/")){for(let e=0;e<A;e++)s.pop();break}}for(;i.length>0&&".."===i[0];)s.pop(),i.shift();return"".concat(t.protocol,"//").concat(t.host,"/").concat([...s,...i].join("/"))}extractQueryParams(A,e){const t=new URL(A);for(let[A,s]of t.searchParams)e[A]=s;return t.search="",t.toString()}load(){var A=this;if(!A.deleted){if(A.json.content){let t;A.json.content.uri?t=A.json.content.uri:A.json.content.url&&(t=A.json.content.url);const s=/^(?:http|https|ftp|tcp|udp):\/\/\S+/;if(s.test(A.rootPath)?s.test(t)||(t=A.assembleURL(A.rootPath,t)):ee.isAbsolute(A.rootPath)&&(t=A.rootPath+ee.sep+t),t=A.extractQueryParams(t,A.queryParams),A.queryParams){var e="";for(let t in A.queryParams)A.queryParams.hasOwnProperty(t)&&(e+="&"+t+"="+A.queryParams[t]);t.includes("?")?t+=e:t+="?"+e.substring(1)}t&&(t.includes(".b3dm")||t.includes(".glb")||t.includes(".gltf")?(A.contentURL=t,A.tileLoader.get(A.abortController,t,A.uuid,A,A.cameraOnLoad?()=>A.calculateDistanceToCamera(A.cameraOnLoad):()=>0,(()=>A.getSiblings()),A.level,!A.json.boundingVolume.region,!!A.json.boundingVolume.region,A.geometricError)):t.includes(".json")&&A.tileLoader.get(A.abortController,t,A.uuid,A))}A.matrixWorldNeedsUpdate=!0,A.updateWorldMatrix(!0,!0)}}loadMesh(A){this.deleted||(this.meshContent=A)}loadJson(A,e){this.deleted||(this.json.children&&(this.jsonChildren=this.json.children),A.rootPath=ee.dirname(e),this.jsonChildren.push(A),this.hasUnloadedJSONContent=!1)}dispose(){const A=this;A.childrenTiles.forEach((A=>A.dispose())),A.deleted=!0,A.abortController&&A.abortController.abort(),this.parent=null,this.parentTile=null,this.dispatchEvent({type:"removed"})}disposeChildren(){this.childrenTiles.forEach((A=>A.dispose())),this.childrenTiles=[]}_update(A,e){const t=this;t.materialVisibility;function s(A){if(t.hasMeshContent&&t.meshContent){if(A<0)return t.inFrustum=!1,void t.changeContentVisibility(!!t.loadOutsideView);if(t.inFrustum=!0,0!=t.childrenTiles.length){if(A>=t.master.geometricErrorMultiplier*t.geometricError)t.changeContentVisibility(!0);else if(A<t.master.geometricErrorMultiplier*t.geometricError){let A=!0;t.childrenTiles.every((e=>!!e.isReady()||(A=!1,!1))),A&&t.changeContentVisibility(!1)}}else t.changeContentVisibility(!0)}}t.boundingVolume&&t.geometricError&&(t.metric=t.calculateUpdateMetric(A,e)),t.childrenTiles.forEach((t=>t._update(A,e))),s(t.metric),function(e){if(e<0&&t.hasMeshContent)return;if((!t.hasMeshContent&&t.rootPath||e<t.master.geometricErrorMultiplier*t.geometricError&&t.meshContent)&&t.json&&t.jsonChildren&&t.childrenTiles.length!=t.jsonChildren.length)t.jsonChildren.forEach((e=>{if(!e.root&&!e.children&&!e.content)return;let s=new Qe({parentTile:t,queryParams:t.queryParams,parentGeometricError:t.geometricError,parentBoundingVolume:t.boundingVolume,parentRefinement:t.refinement,json:e,rootPath:t.rootPath,loadOutsideView:t.loadOutsideView,level:t.level+1,tileLoader:t.tileLoader,cameraOnLoad:A,master:t.master,centerModel:!1});t.childrenTiles.push(s)}))}(t.metric),function(A,e){if(!t.hasMeshContent)return;if(!t.inFrustum)return t.disposeChildren(),void s(A);if(A>=t.master.geometricErrorMultiplier*t.geometricError)t.disposeChildren(),s(A)}(t.metric)}areAllChildrenLoadedAndHidden(){let A=!0;return this.childrenTiles.every((e=>{if(e.hasMeshContent){if(e.childrenTiles.length>0)return A=!1,!1;if(!e.inFrustum)return!0;if(!e.materialVisibility||e.meshesToDisplay!=e.meshesDisplayed)return A=!1,!1}else if(!e.areAllChildrenLoadedAndHidden())return A=!1,!1;return!0})),A}isReady(){if(!this.inFrustum)return!0;if(this.hasUnloadedJSONContent)return!1;if(!this.hasMeshContent||!this.meshContent||!this.materialVisibility){if(this.childrenTiles.length>0){var A=!0;return this.childrenTiles.every((e=>!!e.isReady()||(A=!1,!1))),A}return!1}return!this.hasMeshContent||!!this.meshContent&&!!this.materialVisibility}changeContentVisibility(A){this.materialVisibility=A}calculateUpdateMetric(e,t){if(this.boundingVolume instanceof r){if(ce.copy(this.boundingVolume.sphere),ce.applyMatrix4(this.master.matrixWorld),!t.intersectsSphere(ce))return-1}else{if(!(this.boundingVolume instanceof A.Sphere))return console.error("unsupported shape"),-1;if(ce.copy(this.boundingVolume),ce.applyMatrix4(this.master.matrixWorld),!t.intersectsSphere(ce))return-1}const s=Math.max(0,e.position.distanceTo(ce.center)-ce.radius);if(0==s)return 0;const i=this.master.matrixWorld.getMaxScaleOnAxis();this.master.renderer.getDrawingBufferSize(Ee);let o=Ee.y,n=e.fov;e.aspect<1&&(n*=e.aspect,o=Ee.x);let a=2*Math.tan(.5*n*.017453292519943295)*s;return 16*window.devicePixelRatio*a/(o*i)}getSiblings(){const A=this,e=[];if(!A.parentTile)return e;let t=A.parentTile;for(;!t.hasMeshContent&&t.parentTile;)t=t.parentTile;return t.childrenTiles.forEach((t=>{if(t&&t!=A){for(;!t.hasMeshContent&&t.childrenTiles[0];)t=t.childrenTiles[0];e.push(t)}})),e}calculateDistanceToCamera(e){return this.boundingVolume instanceof r?(ce.copy(this.boundingVolume.sphere),ce.applyMatrix4(this.master.matrixWorld)):this.boundingVolume instanceof A.Sphere?(ce.copy(this.boundingVolume),ce.applyMatrix4(this.master.matrixWorld)):console.error("unsupported shape"),Math.max(0,e.position.distanceTo(ce.center)-ce.radius)}getWorldMatrix(){return this.master.matrixWorld}transformWGS84ToCartesian(A,e,t,s){const i=6378137/Math.sqrt(1-.006694384442042*Math.pow(Math.sin(e),2)),r=Math.cos(e),o=Math.cos(A),n=Math.sin(e),a=i+t,g=a*r*o,h=a*r*Math.sin(A),l=(.993305615557957*i+t)*n;s.set(g,h,l)}}class pe extends A.Object3D{constructor(A){super(),A.master=this,this.renderer=A.renderer,this.geometricErrorMultiplier=A.geometricErrorMultiplier?A.geometricErrorMultiplier:1,this.tileset=new Qe(A),A.static&&(this.matrixAutoUpdate=!1)}update(e,t){if(t)this.tileset._update(e,t);else{const t=new A.Frustum;t.setFromProjectionMatrix((new A.Matrix4).multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse)),this.tileset._update(e,t)}}updateWithFrustum(A,e){this.tileset._update(A,e)}setGeometricErrorMultiplier(A){this.geometricErrorMultiplier=A||1}}class fe{constructor(e){const t=this;t.scene=e,t.instancedTiles=[],t.instancedMesh,t.reuseableMatrix=new A.Matrix4}addInstance(A){const e=this;A.added=!0,A.listOMesh=e.instancedTiles,e.instancedTiles.push(A),e.instancedMesh&&A.loadMesh(e.instancedMesh)}addToScene(){const e=this;e.instancedMesh.setMatrixAt(0,new A.Matrix4),e.instancedMesh.instanceMatrix.needsUpdate=!0,e.instancedMesh.count=1,e.scene.add(e.instancedMesh),e.instancedMesh.onAfterRender=()=>{delete e.instancedMesh.onAfterRender,e.instancedMesh.displayedOnce=!0}}setObject(A){const e=this;e.instancedMesh=A,e.scene.children.includes(A)||this.addToScene();for(let A=0;A<e.instancedTiles.length;A++)e.instancedTiles[A].loadMesh(e.instancedMesh)}update(){const A=this;for(let e=A.instancedTiles.length-1;e>=0;e--)A.instancedTiles[e].deleted&&A.instancedTiles.splice(e,1);if(A.instancedMesh){A.instancedMesh.count=0,A.instancedMesh.instancedTiles=[];for(let e=0;e<A.instancedTiles.length;e++)A.instancedTiles[e].meshContent=A.instancedMesh,A.instancedTiles[e].materialVisibility&&A.instancedTiles[e].meshContent&&(A.instancedMesh.count++,A.reuseableMatrix.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),A.reuseableMatrix.multiply(A.instancedTiles[e].master.matrixWorld),A.reuseableMatrix.multiply(A.instancedMesh.baseMatrix),A.instancedMesh.setMatrixAt(A.instancedMesh.count-1,A.reuseableMatrix),A.instancedMesh.instancedTiles.push(A.instancedTiles[e]));A.instancedMesh.instanceMatrix.needsUpdate=!0,A.instancedMesh.needsUpdate=!0,A.instancedMesh.computeBoundingSphere()}}getCount(){return this.instancedTiles.length}dispose(){const A=this;return!(A.instancedTiles.length>0)&&(!!A.instancedMesh&&(A.scene.remove(A.instancedMesh),A.instancedMesh.traverse((A=>{if(A.dispose&&A.dispose(),A.material)if(A.material.length)for(let e=0;e<A.material.length;++e)A.material[e].dispose();else A.material.dispose();A.geometry&&A.geometry.dispose()})),A.instancedMesh.dispose(),!0))}}class me{constructor(){const A=this;A.count=0,A.json,A.instancedTiles=[]}addInstance(A){this.instancedTiles.push(A),this.json&&A.loadJson(this.json,this.url)}setObject(A,e){const t=this;t.json=A,t.url=e;for(let A=0;A<t.instancedTiles.length;A++)t.instancedTiles[A].loadJson(t.json,t.url)}getCount(){return this.instancedTiles.length}update(){const A=this;for(let e=A.instancedTiles.length-1;e>=0;e--)A.instancedTiles[e].deleted&&A.instancedTiles.splice(e,1)}dispose(){return!(!this.json||0!=this.instancedTiles.length)}}const we=new A.Matrix4;we.set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1);class ye{constructor(A,e){this.maxCachedItems=100,this.maxInstances=1,this.proxy=e.proxy,e&&(this.meshCallback=e.meshCallback,this.pointsCallback=e.pointsCallback,e.maxCachedItems&&(this.maxCachedItems=e.maxCachedItems),e.maxInstances&&(this.maxInstances=e.maxInstances)),this.gltfLoader=new g;const t=new oA;if(t.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.4.3/"),this.gltfLoader.setDRACOLoader(t),e&&e.renderer){const A=new RA;A.setTranscoderPath("https://storage.googleapis.com/ogc-3d-tiles/basis/").detectSupport(e.renderer),this.gltfLoader.setKTX2Loader(A),this.b3dmDecoder=new HA(e.renderer)}else this.b3dmDecoder=new HA(null);this.cache=new o.LinkedHashMap,this.scene=A,this.ready=[],this.downloads=[],this.nextReady=[],this.nextDownloads=[],this.init()}update(){this.cache._data.forEach((A=>{A.update()}))}init(){const A=this;Re((()=>{A.download()}),10),Re((()=>{const e=Date.now();let t=0;do{t=A.loadBatch()}while(t>0&&Date.now()-e<=0)}),10)}download(){const e=this;if(0!=e.nextDownloads.length||(e.getNextDownloads(),0!=e.nextDownloads.length))for(;e.nextDownloads.length>0;){const t=e.nextDownloads.shift();if(t){if(t.path.includes(".b3dm"))(e.proxy?()=>fetch(e.proxy,{method:"POST",body:t.path}):()=>fetch(t.path))().then((A=>{if(!A.ok)throw console.error("could not load tile with path : "+t.path),new Error("couldn't load \"".concat(t.path,'". Request failed with status ').concat(A.status," : ").concat(A.statusText));return A.arrayBuffer()})).then((A=>this.b3dmDecoder.parseB3DMInstanced(A,e.meshCallback,e.maxInstances,t.sceneZupToYup,t.meshZupToYup))).then((A=>{A.frustumCulled=!1,t.tile.setObject(A),e.ready.unshift(t)})).catch((A=>console.error(A)));if(t.path.includes(".glb")||t.path.includes(".gltf"))(e.proxy?()=>fetch(e.proxy,{method:"POST",body:t.path}):()=>fetch(t.path))().then((A=>A.arrayBuffer())).then((async s=>{await De(this.gltfLoader),this.gltfLoader.parse(s,(s=>{let i;s.scene.asset=s.asset,t.sceneZupToYup&&s.scene.applyMatrix4(we),s.scene.traverse((A=>{A.geometricError=t.geometricError,A.isMesh&&(t.meshZupToYup&&A.applyMatrix4(we),e.meshCallback&&e.meshCallback(A,A.geometricError)),A.isPoints&&console.error("instanced point cloud is not supported")})),s.scene.updateWorldMatrix(!1,!0),s.scene.traverse((t=>{t.isMesh&&(i=new A.InstancedMesh(t.geometry,t.material,e.maxInstances),i.baseMatrix=t.matrixWorld)})),e.ready.unshift(t),i?(i.frustumCulled=!1,t.tile.setObject(i)):s.scene.traverse((A=>{A.dispose&&A.dispose(),A.material&&A.material.dispose()}))}))}),(A=>{throw new Error("could not load tile : "+t.path)}));else if(t.path.includes(".json")){(e.proxy?()=>fetch(e.proxy,{method:"POST",body:t.path}):()=>fetch(t.path))().then((A=>{if(!A.ok)throw console.error("could not load tile with path : "+t.path),new Error("couldn't load \"".concat(t.path,'". Request failed with status ').concat(A.status," : ").concat(A.statusText));return A.json()})).then((A=>{t.tile.setObject(A,t.path),e.ready.unshift(t)})).catch((A=>console.error(A)))}}}}loadBatch(){if(0==this.nextReady.length&&(this.getNextReady(),0==this.nextReady.length))return 0;return this.nextReady.shift()?1:0}getNextReady(){let A=Number.MAX_VALUE,e=-1;for(let A=this.ready.length-1;A>=0;A--)this.ready[A].distanceFunction||this.nextReady.push(this.ready.splice(A,1)[0]);if(!(this.nextReady.length>0)){for(let t=this.ready.length-1;t>=0;t--){const s=this.ready[t].distanceFunction()*this.ready[t].level;s<A&&(A=s,e=t)}if(e>=0){const A=this.ready.splice(e,1).pop();this.nextReady.push(A);const t=A.getSiblings();for(let A=this.ready.length-1;A>=0;A--)t.includes(this.ready[A].uuid)&&this.nextready.push(this.ready.splice(A,1).pop())}}}get(A,e,t,s,i,r,o,n,a,g){const h=this,l=function(A){for(var e=A.split("/"),t=[],s=0,i=0;i<e.length;i++){var r=e[i];"."!==r&&""!==r&&".."!==r?t[s++]=r:".."===r&&s>0&&s--}if(0===s)return"/";var o="";for(i=0;i<s;i++)o+="/"+t[i];return o}(e);if(!(e.includes(".b3dm")||e.includes(".json")||e.includes(".glb")||e.includes(".gltf")))return void console.error("the 3DTiles cache can only be used to load B3DM, gltf and json data");const c=h.cache.get(l);if(c)c.addInstance(s);else if(e.includes(".b3dm")||e.includes(".glb")||e.includes(".gltf")){const c=new fe(h.scene);c.addInstance(s),h.cache.put(l,c),h.checkSize();const I=new AbortController;A.signal.addEventListener("abort",(()=>{0==c.getCount()&&I.abort()})),this.downloads.push({abortController:I,tile:c,key:l,path:e,distanceFunction:i,getSiblings:r,level:o,uuid:t,sceneZupToYup:n,meshZupToYup:a,geometricError:g,shouldDoDownload:()=>!0})}else if(e.includes(".json")){const t=new me;t.addInstance(s),h.cache.put(l,t),h.checkSize();const n=new AbortController;A.signal.addEventListener("abort",(()=>{0==t.getCount()&&n.abort()})),this.downloads.push({abortController:n,tile:t,key:l,path:e,distanceFunction:i,getSiblings:r,level:o,shouldDoDownload:()=>!0})}}getNextDownloads(){let A=Number.MAX_VALUE,e=-1;for(let A=this.downloads.length-1;A>=0;A--){const e=this.downloads[A];e.shouldDoDownload()?e.distanceFunction||this.nextDownloads.push(this.downloads.splice(A,1)[0]):this.downloads.splice(A,1)}if(!(this.nextDownloads.length>0)){for(let t=this.downloads.length-1;t>=0;t--){const s=this.downloads[t],i=s.distanceFunction()*s.level;i<A&&(A=i,e=t)}if(e>=0){const A=this.downloads.splice(e,1).pop();this.nextDownloads.push(A);const t=A.getSiblings();for(let A=this.downloads.length-1;A>=0;A--)t.includes(this.downloads[A].uuid)&&this.nextDownloads.push(this.downloads.splice(A,1).pop())}}}checkSize(){const A=this;let e=0;for(;A.cache.size()>A.maxCachedItems&&e<A.cache.size();){e++;const t=A.cache.head();A.cache.remove(t.key),t.value.dispose()||A.cache.put(t.key,t.value)}}}async function De(A){return new Promise((e=>{const t=setInterval((()=>{A.dracoLoader&&A.ktx2Loader&&(clearInterval(t),e())}),10)}))}function Re(A,e){let t;const s=async()=>{const i=Date.now();try{await A()}catch(A){console.error(A)}finally{const A=Date.now()-i;t=setTimeout(s,A>=e?0:e-A)}};return t=setTimeout(s,e),{clearInterval:()=>clearTimeout(t)}}})(),i})()));
2
+ !function(A,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("three")):"function"==typeof define&&define.amd?define(["three"],e):"object"==typeof exports?exports.threedtiles=e(require("three")):A.threedtiles=e(A.THREE)}(this,(A=>(()=>{var e={649:(A,e,t)=>{const s=t(180),i=t(31),r=t(839);A.exports={Heap:s,Queue:i,LinkedHashMap:r}},180:A=>{A.exports=class{constructor(A,e){if(this._data=[],this._comparator=function(A,e){return A>=e},null!=A){if(!Array.isArray(A))throw Error("Constructor expects data to be an array");this._data=A}if(null!=e){if("function"!=typeof e)throw Error("Constructor expects comparator to be a function");this._comparator=e}}peek(){return this.size()<1?null:this._data[0]}pop(){if(this.size()<1)return null;const A=this._data[0];return this.swap(this.size()-1,0),this._data.pop(),this.heapifyDown(0),A}replaceTop(A){if(this.size()<1)return null;const e=this._data[0];return this._data[0]=A,this.heapifyDown(0),e}push(A){this._data.push(A),this.heapifyUp(this._data.length-1)}size(){return this._data.length}swap(A,e){const t=this._data[A];this._data[A]=this._data[e],this._data[e]=t}heapifyUp(A){if(0===A)return;const e=Math.floor((A-1)/2);this._comparator(this._data[A],this._data[e])||(this.swap(A,e),this.heapifyUp(e))}heapifyDown(A){const e=2*A+1,t=2*A+2;if(e>=this._data.length)return;const s=t<this._data.length&&!this._comparator(this._data[t],this._data[e])?t:e;this._comparator(this._data[A],this._data[s])&&(this.swap(A,s),this.heapifyDown(s))}}},839:A=>{A.exports=class{constructor(){this._data=new Map,this._link=new Map,this._head=void 0,this._tail=void 0}put(A,e,t=!1){this.has(A)?this._data.set(A,e):(this._data.set(A,e),this._link.set(A,{previous:void 0,next:void 0}),null==this._head?(this._head=A,this._tail=A):t?(this._link.get(this._head).previous=A,this._link.get(A).next=this._head,this._head=A):(this._link.get(this._tail).next=A,this._link.get(A).previous=this._tail,this._tail=A))}head(){return{key:this._head,value:this.get(this._head),next:()=>this.next(this._head),previous:()=>null}}tail(){return{key:this._tail,value:this.get(this._tail),next:()=>null,previous:()=>this.previous(this._tail)}}get(A){return this._data.get(A)}previousKey(A){const e=this._link.get(A);return null!=e?e.previous:void 0}previousValue(A){return this.get(this.previousKey(A))}previous(A){const e=this.previousKey(A);return{key:e,value:this.get(e),next:()=>this.next(e),previous:()=>this.previous(e)}}nextKey(A){const e=this._link.get(A);return null!=e?e.next:void 0}nextValue(A){return this.get(this.nextKey(A))}next(A){const e=this.nextKey(A);return{key:e,value:this.get(e),next:()=>this.next(e),previous:()=>this.previous(e)}}remove(A){const e=this._data.get(A);if(null!=e)if(1===this.size())this.reset();else{if(A===this._head){const A=this._link.get(this._head);this._link.get(A.next).previous=null,this._head=A.next}else if(A===this._tail){const A=this._link.get(this._tail);this._link.get(A.previous).next=null,this._tail=A.previous}else{const e=this._link.get(A),t=this._link.get(e.previous),s=this._link.get(e.next);t.next=e.next,s.previous=e.previous}this._link.delete(A),this._data.delete(A)}return e}has(A){return this._data.has(A)}size(){return this._data.size}reset(){this._data.clear(),this._link.clear(),this._head=void 0,this._tail=void 0}keys(){return this._data.keys()}values(){return this._data.values()}entries(){return this._data.entries()}toArray(A="orderByInsert"){if("orderByInsert"!==A){const A=[];let e=this._head;for(;null!=e;)A.push({key:e,value:this.get(e)}),e=this.nextKey(e);return A}return Array.from(this.keys()).map((A=>({key:A,value:this.get(A)})))}}},31:A=>{A.exports=class{constructor(A,e){if(this._data=[],this._head=0,this._cap=null,null!=A){if(!Array.isArray(A))throw Error("Constructor expects data to be an array");this._data=A}if(null!=e){if("number"!=typeof e)throw Error("Constructor expects capacity to be a number");this._cap=e}}enqueue(A){return!(null!=this._cap&&this.size()>=this._cap)&&(this._data.push(A),!0)}dequeue(){if(0===this.size())return null;const A=this._data[this._head];return this._head+=1,2*this._head>=this._data.length&&(this._data=this._data.slice(this._head),this._head=0),A}peek(A=!1){return this.size()>0?A?this._data[this._data.length-1]:this._data[this._head]:null}size(){return this._data.length-this._head}updateCapacity(A){this._cap=A}reset(){this._data=[],this._head=0}forEach(A){for(let e=this._head;e<this._data.length;e+=1)A(this._data[e],e-this._head)}toArray(){return this._data.slice(this._head)}}},975:A=>{"use strict";function e(A){if("string"!=typeof A)throw new TypeError("Path must be a string. Received "+JSON.stringify(A))}function t(A,e){for(var t,s="",i=0,r=-1,o=0,n=0;n<=A.length;++n){if(n<A.length)t=A.charCodeAt(n);else{if(47===t)break;t=47}if(47===t){if(r===n-1||1===o);else if(r!==n-1&&2===o){if(s.length<2||2!==i||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2))if(s.length>2){var a=s.lastIndexOf("/");if(a!==s.length-1){-1===a?(s="",i=0):i=(s=s.slice(0,a)).length-1-s.lastIndexOf("/"),r=n,o=0;continue}}else if(2===s.length||1===s.length){s="",i=0,r=n,o=0;continue}e&&(s.length>0?s+="/..":s="..",i=2)}else s.length>0?s+="/"+A.slice(r+1,n):s=A.slice(r+1,n),i=n-r-1;r=n,o=0}else 46===t&&-1!==o?++o:o=-1}return s}var s={resolve:function(){for(var A,s="",i=!1,r=arguments.length-1;r>=-1&&!i;r--){var o;r>=0?o=arguments[r]:(void 0===A&&(A=process.cwd()),o=A),e(o),0!==o.length&&(s=o+"/"+s,i=47===o.charCodeAt(0))}return s=t(s,!i),i?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(A){if(e(A),0===A.length)return".";var s=47===A.charCodeAt(0),i=47===A.charCodeAt(A.length-1);return 0!==(A=t(A,!s)).length||s||(A="."),A.length>0&&i&&(A+="/"),s?"/"+A:A},isAbsolute:function(A){return e(A),A.length>0&&47===A.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var A,t=0;t<arguments.length;++t){var i=arguments[t];e(i),i.length>0&&(void 0===A?A=i:A+="/"+i)}return void 0===A?".":s.normalize(A)},relative:function(A,t){if(e(A),e(t),A===t)return"";if((A=s.resolve(A))===(t=s.resolve(t)))return"";for(var i=1;i<A.length&&47===A.charCodeAt(i);++i);for(var r=A.length,o=r-i,n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var a=t.length-n,g=o<a?o:a,h=-1,l=0;l<=g;++l){if(l===g){if(a>g){if(47===t.charCodeAt(n+l))return t.slice(n+l+1);if(0===l)return t.slice(n+l)}else o>g&&(47===A.charCodeAt(i+l)?h=l:0===l&&(h=0));break}var c=A.charCodeAt(i+l);if(c!==t.charCodeAt(n+l))break;47===c&&(h=l)}var I="";for(l=i+h+1;l<=r;++l)l!==r&&47!==A.charCodeAt(l)||(0===I.length?I+="..":I+="/..");return I.length>0?I+t.slice(n+h):(n+=h,47===t.charCodeAt(n)&&++n,t.slice(n))},_makeLong:function(A){return A},dirname:function(A){if(e(A),0===A.length)return".";for(var t=A.charCodeAt(0),s=47===t,i=-1,r=!0,o=A.length-1;o>=1;--o)if(47===(t=A.charCodeAt(o))){if(!r){i=o;break}}else r=!1;return-1===i?s?"/":".":s&&1===i?"//":A.slice(0,i)},basename:function(A,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');e(A);var s,i=0,r=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=A.length){if(t.length===A.length&&t===A)return"";var n=t.length-1,a=-1;for(s=A.length-1;s>=0;--s){var g=A.charCodeAt(s);if(47===g){if(!o){i=s+1;break}}else-1===a&&(o=!1,a=s+1),n>=0&&(g===t.charCodeAt(n)?-1==--n&&(r=s):(n=-1,r=a))}return i===r?r=a:-1===r&&(r=A.length),A.slice(i,r)}for(s=A.length-1;s>=0;--s)if(47===A.charCodeAt(s)){if(!o){i=s+1;break}}else-1===r&&(o=!1,r=s+1);return-1===r?"":A.slice(i,r)},extname:function(A){e(A);for(var t=-1,s=0,i=-1,r=!0,o=0,n=A.length-1;n>=0;--n){var a=A.charCodeAt(n);if(47!==a)-1===i&&(r=!1,i=n+1),46===a?-1===t?t=n:1!==o&&(o=1):-1!==t&&(o=-1);else if(!r){s=n+1;break}}return-1===t||-1===i||0===o||1===o&&t===i-1&&t===s+1?"":A.slice(t,i)},format:function(A){if(null===A||"object"!=typeof A)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof A);return function(A,e){var t=e.dir||e.root,s=e.base||(e.name||"")+(e.ext||"");return t?t===e.root?t+s:t+A+s:s}("/",A)},parse:function(A){e(A);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===A.length)return t;var s,i=A.charCodeAt(0),r=47===i;r?(t.root="/",s=1):s=0;for(var o=-1,n=0,a=-1,g=!0,h=A.length-1,l=0;h>=s;--h)if(47!==(i=A.charCodeAt(h)))-1===a&&(g=!1,a=h+1),46===i?-1===o?o=h:1!==l&&(l=1):-1!==o&&(l=-1);else if(!g){n=h+1;break}return-1===o||-1===a||0===l||1===l&&o===a-1&&o===n+1?-1!==a&&(t.base=t.name=0===n&&r?A.slice(1,a):A.slice(n,a)):(0===n&&r?(t.name=A.slice(1,o),t.base=A.slice(1,a)):(t.name=A.slice(n,o),t.base=A.slice(n,a)),t.ext=A.slice(o,a)),n>0?t.dir=A.slice(0,n-1):r&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,A.exports=s},818:e=>{"use strict";e.exports=A}},t={};function s(A){var i=t[A];if(void 0!==i)return i.exports;var r=t[A]={exports:{}};return e[A](r,r.exports,s),r.exports}s.d=(A,e)=>{for(var t in e)s.o(e,t)&&!s.o(A,t)&&Object.defineProperty(A,t,{enumerable:!0,get:e[t]})},s.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),s.r=A=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})};var i={};return(()=>{"use strict";s.r(i),s.d(i,{B3DMDecoder:()=>UA,InstancedOGC3DTile:()=>Ee,InstancedTileLoader:()=>fe,OBB:()=>r,OGC3DTile:()=>re,OcclusionCullingService:()=>t,TileLoader:()=>NA});var A=s(818);Math.PI,Math.PI;function e(A,e,t){return Math.max(e,Math.min(t,A))}class t{constructor(){this.cullMap=[],this.cullMaterial=new A.MeshBasicMaterial({vertexColors:!0}),this.cullMaterial.side=A.FrontSide,this.cullTarget=this.createCullTarget(),this.cullPixels=new Uint8Array(4*this.cullTarget.width*this.cullTarget.height)}setSide(A){this.cullMaterial.side=A}createCullTarget(){const e=new A.WebGLRenderTarget(Math.floor(.05*window.innerWidth),Math.floor(.05*window.innerHeight));return e.texture.format=A.RGBAFormat,e.texture.colorSpace=A.LinearEncoding,e.texture.minFilter=A.NearestFilter,e.texture.magFilter=A.NearestFilter,e.texture.generateMipmaps=!1,e.stencilBuffer=!1,e.depthBuffer=!0,e.depthTexture=new A.DepthTexture,e.depthTexture.format=A.DepthFormat,e.depthTexture.type=A.UnsignedShortType,e}update(A,t,s){let i=t.getRenderTarget(),r=A.overrideMaterial;A.overrideMaterial=this.cullMaterial,t.setRenderTarget(this.cullTarget),t.render(A,s),A.overrideMaterial=r,t.setRenderTarget(i),t.readRenderTargetPixels(this.cullTarget,0,0,this.cullTarget.width,this.cullTarget.height,this.cullPixels),this.cullMap=[];for(let A=0;A<this.cullPixels.length;A+=4){const t=e(this.cullPixels[A],0,255)<<16^e(this.cullPixels[A+1],0,255)<<8^e(this.cullPixels[A+2],0,255)<<0;this.cullMap[t]=!0}}hasID(A){return this.cullMap[A]}}class r{constructor(e){this.center=new A.Vector3(e[0],e[1],e[2]);var t=new A.Vector3(e[3],e[4],e[4]),s=new A.Vector3(e[6],e[7],e[8]),i=new A.Vector3(e[9],e[10],e[11]);this.halfWidth=t.length(),this.halfHeight=s.length(),this.halfDepth=i.length(),t.normalize(),s.normalize(),i.normalize(),this.sphere=new A.Sphere(this.center,Math.sqrt(this.halfWidth*this.halfWidth+this.halfHeight*this.halfHeight+this.halfDepth*this.halfDepth)),this.matrixToOBBCoordinateSystem=new A.Matrix3,this.matrixToOBBCoordinateSystem.set(t.x,t.y,t.z,s.x,s.y,s.z,i.x,i.y,i.z)}inFrustum(A){return A.intersectsSphere(this.sphere)}distanceToPoint(A){let e=A.clone();e.sub(this.center),e.applyMatrix3(this.matrixToOBBCoordinateSystem);let t=Math.max(0,Math.max(-this.halfWidth-e.x,e.x-this.halfWidth)),s=Math.max(0,Math.max(-this.halfHeight-e.y,e.y-this.halfHeight)),i=Math.max(0,Math.max(-this.halfDepth-e.z,e.z-this.halfDepth));return Math.sqrt(t*t+s*s+i*i)}}var o=s(649);function n(e,t=!1){const s=null!==e[0].index,i=new Set(Object.keys(e[0].attributes)),r=new Set(Object.keys(e[0].morphAttributes)),o={},n={},g=e[0].morphTargetsRelative,h=new A.BufferGeometry;let l=0;for(let A=0;A<e.length;++A){const a=e[A];let c=0;if(s!==(null!==a.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+A+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const e in a.attributes){if(!i.has(e))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+A+'. All geometries must have compatible attributes; make sure "'+e+'" attribute exists among all geometries, or in none of them.'),null;void 0===o[e]&&(o[e]=[]),o[e].push(a.attributes[e]),c++}if(c!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+A+". Make sure all geometries have the same number of attributes."),null;if(g!==a.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+A+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const e in a.morphAttributes){if(!r.has(e))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+A+". .morphAttributes must be consistent throughout all geometries."),null;void 0===n[e]&&(n[e]=[]),n[e].push(a.morphAttributes[e])}if(t){let e;if(s)e=a.index.count;else{if(void 0===a.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+A+". The geometry must have either an index or a position attribute"),null;e=a.attributes.position.count}h.addGroup(l,e,A),l+=e}}if(s){let A=0;const t=[];for(let s=0;s<e.length;++s){const i=e[s].index;for(let e=0;e<i.count;++e)t.push(i.getX(e)+A);A+=e[s].attributes.position.count}h.setIndex(t)}for(const A in o){const e=a(o[A]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+A+" attribute."),null;h.setAttribute(A,e)}for(const A in n){const e=n[A][0].length;if(0===e)break;h.morphAttributes=h.morphAttributes||{},h.morphAttributes[A]=[];for(let t=0;t<e;++t){const e=[];for(let s=0;s<n[A].length;++s)e.push(n[A][s][t]);const s=a(e);if(!s)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+A+" morphAttribute."),null;h.morphAttributes[A].push(s)}}return h}function a(e){let t,s,i,r=-1,o=0;for(let A=0;A<e.length;++A){const n=e[A];if(n.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(void 0===t&&(t=n.array.constructor),t!==n.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===s&&(s=n.itemSize),s!==n.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===i&&(i=n.normalized),i!==n.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===r&&(r=n.gpuType),r!==n.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;o+=n.array.length}const n=new t(o);let a=0;for(let A=0;A<e.length;++A)n.set(e[A].array,a),a+=e[A].array.length;const g=new A.BufferAttribute(n,s,i);return void 0!==r&&(g.gpuType=r),g}function g(e,t){if(t===A.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===A.TriangleFanDrawMode||t===A.TriangleStripDrawMode){let s=e.getIndex();if(null===s){const A=[],t=e.getAttribute("position");if(void 0===t)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<t.count;e++)A.push(e);e.setIndex(A),s=e.getIndex()}const i=s.count-2,r=[];if(t===A.TriangleFanDrawMode)for(let A=1;A<=i;A++)r.push(s.getX(0)),r.push(s.getX(A)),r.push(s.getX(A+1));else for(let A=0;A<i;A++)A%2==0?(r.push(s.getX(A)),r.push(s.getX(A+1)),r.push(s.getX(A+2))):(r.push(s.getX(A+2)),r.push(s.getX(A+1)),r.push(s.getX(A)));r.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=e.clone();return o.setIndex(r),o.clearGroups(),o}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}class h extends A.Loader{constructor(A){super(A),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(A){return new E(A)})),this.register((function(A){return new y(A)})),this.register((function(A){return new D(A)})),this.register((function(A){return new R(A)})),this.register((function(A){return new u(A)})),this.register((function(A){return new Q(A)})),this.register((function(A){return new f(A)})),this.register((function(A){return new p(A)})),this.register((function(A){return new B(A)})),this.register((function(A){return new m(A)})),this.register((function(A){return new d(A)})),this.register((function(A){return new w(A)})),this.register((function(A){return new I(A)})),this.register((function(A){return new x(A)})),this.register((function(A){return new S(A)}))}load(e,t,s,i){const r=this;let o;o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:A.LoaderUtils.extractUrlBase(e),this.manager.itemStart(e);const n=function(A){i?i(A):console.error(A),r.manager.itemError(e),r.manager.itemEnd(e)},a=new A.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(A){try{r.parse(A,o,(function(A){t(A),r.manager.itemEnd(e)}),n)}catch(A){n(A)}}),s,n)}setDRACOLoader(A){return this.dracoLoader=A,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(A){return this.ktx2Loader=A,this}setMeshoptDecoder(A){return this.meshoptDecoder=A,this}register(A){return-1===this.pluginCallbacks.indexOf(A)&&this.pluginCallbacks.push(A),this}unregister(A){return-1!==this.pluginCallbacks.indexOf(A)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(A),1),this}parse(A,e,t,s){let i;const r={},o={},n=new TextDecoder;if("string"==typeof A)i=JSON.parse(A);else if(A instanceof ArrayBuffer){if(n.decode(new Uint8Array(A,0,4))===T){try{r[c.KHR_BINARY_GLTF]=new F(A)}catch(A){return void(s&&s(A))}i=JSON.parse(r[c.KHR_BINARY_GLTF].content)}else i=JSON.parse(n.decode(A))}else i=A;if(void 0===i.asset||i.asset.version[0]<2)return void(s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const a=new sA(i,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});a.fileLoader.setRequestHeader(this.requestHeader);for(let A=0;A<this.pluginCallbacks.length;A++){const e=this.pluginCallbacks[A](a);o[e.name]=e,r[e.name]=!0}if(i.extensionsUsed)for(let A=0;A<i.extensionsUsed.length;++A){const e=i.extensionsUsed[A],t=i.extensionsRequired||[];switch(e){case c.KHR_MATERIALS_UNLIT:r[e]=new C;break;case c.KHR_DRACO_MESH_COMPRESSION:r[e]=new G(i,this.dracoLoader);break;case c.KHR_TEXTURE_TRANSFORM:r[e]=new b;break;case c.KHR_MESH_QUANTIZATION:r[e]=new k;break;default:t.indexOf(e)>=0&&void 0===o[e]&&console.warn('THREE.GLTFLoader: Unknown extension "'+e+'".')}}a.setExtensions(r),a.setPlugins(o),a.parse(t,s)}parseAsync(A,e){const t=this;return new Promise((function(s,i){t.parse(A,e,s,i)}))}}function l(){let A={};return{get:function(e){return A[e]},add:function(e,t){A[e]=t},remove:function(e){delete A[e]},removeAll:function(){A={}}}}const c={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_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_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 I{constructor(A){this.parser=A,this.name=c.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const A=this.parser,e=this.parser.json.nodes||[];for(let t=0,s=e.length;t<s;t++){const s=e[t];s.extensions&&s.extensions[this.name]&&void 0!==s.extensions[this.name].light&&A._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,s="light:"+e;let i=t.cache.get(s);if(i)return i;const r=t.json,o=((r.extensions&&r.extensions[this.name]||{}).lights||[])[e];let n;const a=new A.Color(16777215);void 0!==o.color&&a.fromArray(o.color);const g=void 0!==o.range?o.range:0;switch(o.type){case"directional":n=new A.DirectionalLight(a),n.target.position.set(0,0,-1),n.add(n.target);break;case"point":n=new A.PointLight(a),n.distance=g;break;case"spot":n=new A.SpotLight(a),n.distance=g,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,n.angle=o.spot.outerConeAngle,n.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,n.target.position.set(0,0,-1),n.add(n.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return n.position.set(0,0,0),n.decay=2,z(n,o),void 0!==o.intensity&&(n.intensity=o.intensity),n.name=t.createUniqueName(o.name||"light_"+e),i=Promise.resolve(n),t.cache.add(s,i),i}getDependency(A,e){if("light"===A)return this._loadLight(e)}createNodeAttachment(A){const e=this,t=this.parser,s=t.json.nodes[A],i=(s.extensions&&s.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then((function(A){return t._getNodeRef(e.cache,i,A)}))}}class C{constructor(){this.name=c.KHR_MATERIALS_UNLIT}getMaterialType(){return A.MeshBasicMaterial}extendParams(e,t,s){const i=[];e.color=new A.Color(1,1,1),e.opacity=1;const r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){const A=r.baseColorFactor;e.color.fromArray(A),e.opacity=A[3]}void 0!==r.baseColorTexture&&i.push(s.assignTexture(e,"map",r.baseColorTexture,A.SRGBColorSpace))}return Promise.all(i)}}class B{constructor(A){this.parser=A,this.name=c.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(A,e){const t=this.parser.json.materials[A];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const s=t.extensions[this.name].emissiveStrength;return void 0!==s&&(e.emissiveIntensity=s),Promise.resolve()}}class E{constructor(A){this.parser=A,this.name=c.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const r=[],o=i.extensions[this.name];if(void 0!==o.clearcoatFactor&&(t.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&r.push(s.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&r.push(s.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(r.push(s.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){const e=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new A.Vector2(e,e)}return Promise.all(r)}}class d{constructor(A){this.parser=A,this.name=c.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(A,e){const t=this.parser,s=t.json.materials[A];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[],r=s.extensions[this.name];return void 0!==r.iridescenceFactor&&(e.iridescence=r.iridescenceFactor),void 0!==r.iridescenceTexture&&i.push(t.assignTexture(e,"iridescenceMap",r.iridescenceTexture)),void 0!==r.iridescenceIor&&(e.iridescenceIOR=r.iridescenceIor),void 0===e.iridescenceThicknessRange&&(e.iridescenceThicknessRange=[100,400]),void 0!==r.iridescenceThicknessMinimum&&(e.iridescenceThicknessRange[0]=r.iridescenceThicknessMinimum),void 0!==r.iridescenceThicknessMaximum&&(e.iridescenceThicknessRange[1]=r.iridescenceThicknessMaximum),void 0!==r.iridescenceThicknessTexture&&i.push(t.assignTexture(e,"iridescenceThicknessMap",r.iridescenceThicknessTexture)),Promise.all(i)}}class u{constructor(A){this.parser=A,this.name=c.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const r=[];t.sheenColor=new A.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=i.extensions[this.name];return void 0!==o.sheenColorFactor&&t.sheenColor.fromArray(o.sheenColorFactor),void 0!==o.sheenRoughnessFactor&&(t.sheenRoughness=o.sheenRoughnessFactor),void 0!==o.sheenColorTexture&&r.push(s.assignTexture(t,"sheenColorMap",o.sheenColorTexture,A.SRGBColorSpace)),void 0!==o.sheenRoughnessTexture&&r.push(s.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(r)}}class Q{constructor(A){this.parser=A,this.name=c.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(A,e){const t=this.parser,s=t.json.materials[A];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[],r=s.extensions[this.name];return void 0!==r.transmissionFactor&&(e.transmission=r.transmissionFactor),void 0!==r.transmissionTexture&&i.push(t.assignTexture(e,"transmissionMap",r.transmissionTexture)),Promise.all(i)}}class f{constructor(A){this.parser=A,this.name=c.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const r=[],o=i.extensions[this.name];t.thickness=void 0!==o.thicknessFactor?o.thicknessFactor:0,void 0!==o.thicknessTexture&&r.push(s.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const n=o.attenuationColor||[1,1,1];return t.attenuationColor=new A.Color(n[0],n[1],n[2]),Promise.all(r)}}class p{constructor(A){this.parser=A,this.name=c.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(A,e){const t=this.parser.json.materials[A];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const s=t.extensions[this.name];return e.ior=void 0!==s.ior?s.ior:1.5,Promise.resolve()}}class m{constructor(A){this.parser=A,this.name=c.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const r=[],o=i.extensions[this.name];t.specularIntensity=void 0!==o.specularFactor?o.specularFactor:1,void 0!==o.specularTexture&&r.push(s.assignTexture(t,"specularIntensityMap",o.specularTexture));const n=o.specularColorFactor||[1,1,1];return t.specularColor=new A.Color(n[0],n[1],n[2]),void 0!==o.specularColorTexture&&r.push(s.assignTexture(t,"specularColorMap",o.specularColorTexture,A.SRGBColorSpace)),Promise.all(r)}}class w{constructor(A){this.parser=A,this.name=c.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?A.MeshPhysicalMaterial:null}extendMaterialParams(A,e){const t=this.parser,s=t.json.materials[A];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[],r=s.extensions[this.name];return void 0!==r.anisotropyStrength&&(e.anisotropy=r.anisotropyStrength),void 0!==r.anisotropyRotation&&(e.anisotropyRotation=r.anisotropyRotation),void 0!==r.anisotropyTexture&&i.push(t.assignTexture(e,"anisotropyMap",r.anisotropyTexture)),Promise.all(i)}}class y{constructor(A){this.parser=A,this.name=c.KHR_TEXTURE_BASISU}loadTexture(A){const e=this.parser,t=e.json,s=t.textures[A];if(!s.extensions||!s.extensions[this.name])return null;const i=s.extensions[this.name],r=e.options.ktx2Loader;if(!r){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(A,i.source,r)}}class D{constructor(A){this.parser=A,this.name=c.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(A){const e=this.name,t=this.parser,s=t.json,i=s.textures[A];if(!i.extensions||!i.extensions[e])return null;const r=i.extensions[e],o=s.images[r.source];let n=t.textureLoader;if(o.uri){const A=t.options.manager.getHandler(o.uri);null!==A&&(n=A)}return this.detectSupport().then((function(i){if(i)return t.loadTextureImage(A,r.source,n);if(s.extensionsRequired&&s.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return t.loadTexture(A)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(A){const e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){A(1===e.height)}}))),this.isSupported}}class R{constructor(A){this.parser=A,this.name=c.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(A){const e=this.name,t=this.parser,s=t.json,i=s.textures[A];if(!i.extensions||!i.extensions[e])return null;const r=i.extensions[e],o=s.images[r.source];let n=t.textureLoader;if(o.uri){const A=t.options.manager.getHandler(o.uri);null!==A&&(n=A)}return this.detectSupport().then((function(i){if(i)return t.loadTextureImage(A,r.source,n);if(s.extensionsRequired&&s.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return t.loadTexture(A)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(A){const e=new Image;e.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",e.onload=e.onerror=function(){A(1===e.height)}}))),this.isSupported}}class x{constructor(A){this.name=c.EXT_MESHOPT_COMPRESSION,this.parser=A}loadBufferView(A){const e=this.parser.json,t=e.bufferViews[A];if(t.extensions&&t.extensions[this.name]){const A=t.extensions[this.name],s=this.parser.getDependency("buffer",A.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then((function(e){const t=A.byteOffset||0,s=A.byteLength||0,r=A.count,o=A.byteStride,n=new Uint8Array(e,t,s);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(r,o,n,A.mode,A.filter).then((function(A){return A.buffer})):i.ready.then((function(){const e=new ArrayBuffer(r*o);return i.decodeGltfBuffer(new Uint8Array(e),r,o,n,A.mode,A.filter),e}))}))}return null}}class S{constructor(A){this.name=c.EXT_MESH_GPU_INSTANCING,this.parser=A}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||void 0===s.mesh)return null;const i=t.meshes[s.mesh];for(const A of i.primitives)if(A.mode!==v.TRIANGLES&&A.mode!==v.TRIANGLE_STRIP&&A.mode!==v.TRIANGLE_FAN&&void 0!==A.mode)return null;const r=s.extensions[this.name].attributes,o=[],n={};for(const A in r)o.push(this.parser.getDependency("accessor",r[A]).then((e=>(n[A]=e,n[A]))));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then((e=>{const t=e.pop(),s=t.isGroup?t.children:[t],i=e[0].count,r=[];for(const e of s){const t=new A.Matrix4,s=new A.Vector3,o=new A.Quaternion,a=new A.Vector3(1,1,1),g=new A.InstancedMesh(e.geometry,e.material,i);for(let A=0;A<i;A++)n.TRANSLATION&&s.fromBufferAttribute(n.TRANSLATION,A),n.ROTATION&&o.fromBufferAttribute(n.ROTATION,A),n.SCALE&&a.fromBufferAttribute(n.SCALE,A),g.setMatrixAt(A,t.compose(s,o,a));for(const A in n)"TRANSLATION"!==A&&"ROTATION"!==A&&"SCALE"!==A&&e.geometry.setAttribute(A,n[A]);A.Object3D.prototype.copy.call(g,e),this.parser.assignFinalMaterial(g),r.push(g)}return t.isGroup?(t.clear(),t.add(...r),t):r[0]})))}}const T="glTF",M=1313821514,L=5130562;class F{constructor(A){this.name=c.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(A,0,12),t=new TextDecoder;if(this.header={magic:t.decode(new Uint8Array(A.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==T)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const s=this.header.length-12,i=new DataView(A,12);let r=0;for(;r<s;){const e=i.getUint32(r,!0);r+=4;const s=i.getUint32(r,!0);if(r+=4,s===M){const s=new Uint8Array(A,12+r,e);this.content=t.decode(s)}else if(s===L){const t=12+r;this.body=A.slice(t,t+e)}r+=e}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class G{constructor(A,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=c.KHR_DRACO_MESH_COMPRESSION,this.json=A,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(A,e){const t=this.json,s=this.dracoLoader,i=A.extensions[this.name].bufferView,r=A.extensions[this.name].attributes,o={},n={},a={};for(const A in r){const e=J[A]||A.toLowerCase();o[e]=r[A]}for(const e in A.attributes){const s=J[e]||e.toLowerCase();if(void 0!==r[e]){const i=t.accessors[A.attributes[e]],r=H[i.componentType];a[s]=r.name,n[s]=!0===i.normalized}}return e.getDependency("bufferView",i).then((function(A){return new Promise((function(e){s.decodeDracoFile(A,(function(A){for(const e in A.attributes){const t=A.attributes[e],s=n[e];void 0!==s&&(t.normalized=s)}e(A)}),o,a)}))}))}}class b{constructor(){this.name=c.KHR_TEXTURE_TRANSFORM}extendTexture(A,e){return void 0!==e.texCoord&&e.texCoord!==A.channel||void 0!==e.offset||void 0!==e.rotation||void 0!==e.scale?(A=A.clone(),void 0!==e.texCoord&&(A.channel=e.texCoord),void 0!==e.offset&&A.offset.fromArray(e.offset),void 0!==e.rotation&&(A.rotation=e.rotation),void 0!==e.scale&&A.repeat.fromArray(e.scale),A.needsUpdate=!0,A):A}}class k{constructor(){this.name=c.KHR_MESH_QUANTIZATION}}class U extends A.Interpolant{constructor(A,e,t,s){super(A,e,t,s)}copySampleValue_(A){const e=this.resultBuffer,t=this.sampleValues,s=this.valueSize,i=A*s*3+s;for(let A=0;A!==s;A++)e[A]=t[i+A];return e}interpolate_(A,e,t,s){const i=this.resultBuffer,r=this.sampleValues,o=this.valueSize,n=2*o,a=3*o,g=s-e,h=(t-e)/g,l=h*h,c=l*h,I=A*a,C=I-a,B=-2*c+3*l,E=c-l,d=1-B,u=E-l+h;for(let A=0;A!==o;A++){const e=r[C+A+o],t=r[C+A+n]*g,s=r[I+A+o],a=r[I+A]*g;i[A]=d*e+u*t+B*s+E*a}return i}}const _=new A.Quaternion;class N extends U{interpolate_(A,e,t,s){const i=super.interpolate_(A,e,t,s);return _.fromArray(i).normalize().toArray(i),i}}const v={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},H={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},q={9728:A.NearestFilter,9729:A.LinearFilter,9984:A.NearestMipmapNearestFilter,9985:A.LinearMipmapNearestFilter,9986:A.NearestMipmapLinearFilter,9987:A.LinearMipmapLinearFilter},P={33071:A.ClampToEdgeWrapping,33648:A.MirroredRepeatWrapping,10497:A.RepeatWrapping},O={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},J={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"},V={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},K={CUBICSPLINE:void 0,LINEAR:A.InterpolateLinear,STEP:A.InterpolateDiscrete},j="OPAQUE",Y="MASK",W="BLEND";function X(A,e,t){for(const s in t.extensions)void 0===A[s]&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[s]=t.extensions[s])}function z(A,e){void 0!==e.extras&&("object"==typeof e.extras?Object.assign(A.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function Z(A,e){if(A.updateMorphTargets(),void 0!==e.weights)for(let t=0,s=e.weights.length;t<s;t++)A.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(A.morphTargetInfluences.length===t.length){A.morphTargetDictionary={};for(let e=0,s=t.length;e<s;e++)A.morphTargetDictionary[t[e]]=e}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function $(A){let e;const t=A.extensions&&A.extensions[c.KHR_DRACO_MESH_COMPRESSION];if(e=t?"draco:"+t.bufferView+":"+t.indices+":"+AA(t.attributes):A.indices+":"+AA(A.attributes)+":"+A.mode,void 0!==A.targets)for(let t=0,s=A.targets.length;t<s;t++)e+=":"+AA(A.targets[t]);return e}function AA(A){let e="";const t=Object.keys(A).sort();for(let s=0,i=t.length;s<i;s++)e+=t[s]+":"+A[t[s]]+";";return e}function eA(A){switch(A){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}const tA=new A.Matrix4;class sA{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new l,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 s=!1,i=!1,r=-1;"undefined"!=typeof navigator&&(s=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=navigator.userAgent.indexOf("Firefox")>-1,r=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||s||i&&r<98?this.textureLoader=new A.TextureLoader(this.options.manager):this.textureLoader=new A.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new A.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(A){this.extensions=A}setPlugins(A){this.plugins=A}parse(A,e){const t=this,s=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(A){return A._markDefs&&A._markDefs()})),Promise.all(this._invokeAll((function(A){return A.beforeRoot&&A.beforeRoot()}))).then((function(){return Promise.all([t.getDependencies("scene"),t.getDependencies("animation"),t.getDependencies("camera")])})).then((function(e){const r={scene:e[0][s.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:s.asset,parser:t,userData:{}};X(i,r,s),z(r,s),Promise.all(t._invokeAll((function(A){return A.afterRoot&&A.afterRoot(r)}))).then((function(){A(r)}))})).catch(e)}_markDefs(){const A=this.json.nodes||[],e=this.json.skins||[],t=this.json.meshes||[];for(let t=0,s=e.length;t<s;t++){const s=e[t].joints;for(let e=0,t=s.length;e<t;e++)A[s[e]].isBone=!0}for(let e=0,s=A.length;e<s;e++){const s=A[e];void 0!==s.mesh&&(this._addNodeRef(this.meshCache,s.mesh),void 0!==s.skin&&(t[s.mesh].isSkinnedMesh=!0)),void 0!==s.camera&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(A,e){void 0!==e&&(void 0===A.refs[e]&&(A.refs[e]=A.uses[e]=0),A.refs[e]++)}_getNodeRef(A,e,t){if(A.refs[e]<=1)return t;const s=t.clone(),i=(A,e)=>{const t=this.associations.get(A);null!=t&&this.associations.set(e,t);for(const[t,s]of A.children.entries())i(s,e.children[t])};return i(t,s),s.name+="_instance_"+A.uses[e]++,s}_invokeOne(A){const e=Object.values(this.plugins);e.push(this);for(let t=0;t<e.length;t++){const s=A(e[t]);if(s)return s}return null}_invokeAll(A){const e=Object.values(this.plugins);e.unshift(this);const t=[];for(let s=0;s<e.length;s++){const i=A(e[s]);i&&t.push(i)}return t}getDependency(A,e){const t=A+":"+e;let s=this.cache.get(t);if(!s){switch(A){case"scene":s=this.loadScene(e);break;case"node":s=this._invokeOne((function(A){return A.loadNode&&A.loadNode(e)}));break;case"mesh":s=this._invokeOne((function(A){return A.loadMesh&&A.loadMesh(e)}));break;case"accessor":s=this.loadAccessor(e);break;case"bufferView":s=this._invokeOne((function(A){return A.loadBufferView&&A.loadBufferView(e)}));break;case"buffer":s=this.loadBuffer(e);break;case"material":s=this._invokeOne((function(A){return A.loadMaterial&&A.loadMaterial(e)}));break;case"texture":s=this._invokeOne((function(A){return A.loadTexture&&A.loadTexture(e)}));break;case"skin":s=this.loadSkin(e);break;case"animation":s=this._invokeOne((function(A){return A.loadAnimation&&A.loadAnimation(e)}));break;case"camera":s=this.loadCamera(e);break;default:if(s=this._invokeOne((function(t){return t!=this&&t.getDependency&&t.getDependency(A,e)})),!s)throw new Error("Unknown type: "+A)}this.cache.add(t,s)}return s}getDependencies(A){let e=this.cache.get(A);if(!e){const t=this,s=this.json[A+("mesh"===A?"es":"s")]||[];e=Promise.all(s.map((function(e,s){return t.getDependency(A,s)}))),this.cache.add(A,e)}return e}loadBuffer(e){const t=this.json.buffers[e],s=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[c.KHR_BINARY_GLTF].body);const i=this.options;return new Promise((function(e,r){s.load(A.LoaderUtils.resolveURL(t.uri,i.path),e,void 0,(function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(A){const e=this.json.bufferViews[A];return this.getDependency("buffer",e.buffer).then((function(A){const t=e.byteLength||0,s=e.byteOffset||0;return A.slice(s,s+t)}))}loadAccessor(e){const t=this,s=this.json,i=this.json.accessors[e];if(void 0===i.bufferView&&void 0===i.sparse){const e=O[i.type],t=H[i.componentType],s=!0===i.normalized,r=new t(i.count*e);return Promise.resolve(new A.BufferAttribute(r,e,s))}const r=[];return void 0!==i.bufferView?r.push(this.getDependency("bufferView",i.bufferView)):r.push(null),void 0!==i.sparse&&(r.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(r).then((function(e){const r=e[0],o=O[i.type],n=H[i.componentType],a=n.BYTES_PER_ELEMENT,g=a*o,h=i.byteOffset||0,l=void 0!==i.bufferView?s.bufferViews[i.bufferView].byteStride:void 0,c=!0===i.normalized;let I,C;if(l&&l!==g){const e=Math.floor(h/l),s="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+e+":"+i.count;let g=t.cache.get(s);g||(I=new n(r,e*l,i.count*l/a),g=new A.InterleavedBuffer(I,l/a),t.cache.add(s,g)),C=new A.InterleavedBufferAttribute(g,o,h%l/a,c)}else I=null===r?new n(i.count*o):new n(r,h,i.count*o),C=new A.BufferAttribute(I,o,c);if(void 0!==i.sparse){const t=O.SCALAR,s=H[i.sparse.indices.componentType],a=i.sparse.indices.byteOffset||0,g=i.sparse.values.byteOffset||0,h=new s(e[1],a,i.sparse.count*t),l=new n(e[2],g,i.sparse.count*o);null!==r&&(C=new A.BufferAttribute(C.array.slice(),C.itemSize,C.normalized));for(let A=0,e=h.length;A<e;A++){const e=h[A];if(C.setX(e,l[A*o]),o>=2&&C.setY(e,l[A*o+1]),o>=3&&C.setZ(e,l[A*o+2]),o>=4&&C.setW(e,l[A*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return C}))}loadTexture(A){const e=this.json,t=this.options,s=e.textures[A].source,i=e.images[s];let r=this.textureLoader;if(i.uri){const A=t.manager.getHandler(i.uri);null!==A&&(r=A)}return this.loadTextureImage(A,s,r)}loadTextureImage(e,t,s){const i=this,r=this.json,o=r.textures[e],n=r.images[t],a=(n.uri||n.bufferView)+":"+o.sampler;if(this.textureCache[a])return this.textureCache[a];const g=this.loadImageSource(t,s).then((function(t){t.flipY=!1,t.name=o.name||n.name||"",""===t.name&&"string"==typeof n.uri&&!1===n.uri.startsWith("data:image/")&&(t.name=n.uri);const s=(r.samplers||{})[o.sampler]||{};return t.magFilter=q[s.magFilter]||A.LinearFilter,t.minFilter=q[s.minFilter]||A.LinearMipmapLinearFilter,t.wrapS=P[s.wrapS]||A.RepeatWrapping,t.wrapT=P[s.wrapT]||A.RepeatWrapping,i.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[a]=g,g}loadImageSource(e,t){const s=this,i=this.json,r=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((A=>A.clone()));const o=i.images[e],n=self.URL||self.webkitURL;let a=o.uri||"",g=!1;if(void 0!==o.bufferView)a=s.getDependency("bufferView",o.bufferView).then((function(A){g=!0;const e=new Blob([A],{type:o.mimeType});return a=n.createObjectURL(e),a}));else if(void 0===o.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(a).then((function(e){return new Promise((function(s,i){let o=s;!0===t.isImageBitmapLoader&&(o=function(e){const t=new A.Texture(e);t.needsUpdate=!0,s(t)}),t.load(A.LoaderUtils.resolveURL(e,r.path),o,void 0,i)}))})).then((function(A){var e;return!0===g&&n.revokeObjectURL(a),A.userData.mimeType=o.mimeType||((e=o.uri).search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/)?"image/jpeg":e.search(/\.webp($|\?)/i)>0||0===e.search(/^data\:image\/webp/)?"image/webp":"image/png"),A})).catch((function(A){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),A}));return this.sourceCache[e]=h,h}assignTexture(A,e,t,s){const i=this;return this.getDependency("texture",t.index).then((function(r){if(!r)return null;if(void 0!==t.texCoord&&t.texCoord>0&&((r=r.clone()).channel=t.texCoord),i.extensions[c.KHR_TEXTURE_TRANSFORM]){const A=void 0!==t.extensions?t.extensions[c.KHR_TEXTURE_TRANSFORM]:void 0;if(A){const e=i.associations.get(r);r=i.extensions[c.KHR_TEXTURE_TRANSFORM].extendTexture(r,A),i.associations.set(r,e)}}return void 0!==s&&(r.colorSpace=s),A[e]=r,r}))}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const i=void 0===t.attributes.tangent,r=void 0!==t.attributes.color,o=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+s.uuid;let t=this.cache.get(e);t||(t=new A.PointsMaterial,A.Material.prototype.copy.call(t,s),t.color.copy(s.color),t.map=s.map,t.sizeAttenuation=!1,this.cache.add(e,t)),s=t}else if(e.isLine){const e="LineBasicMaterial:"+s.uuid;let t=this.cache.get(e);t||(t=new A.LineBasicMaterial,A.Material.prototype.copy.call(t,s),t.color.copy(s.color),t.map=s.map,this.cache.add(e,t)),s=t}if(i||r||o){let A="ClonedMaterial:"+s.uuid+":";i&&(A+="derivative-tangents:"),r&&(A+="vertex-colors:"),o&&(A+="flat-shading:");let e=this.cache.get(A);e||(e=s.clone(),r&&(e.vertexColors=!0),o&&(e.flatShading=!0),i&&(e.normalScale&&(e.normalScale.y*=-1),e.clearcoatNormalScale&&(e.clearcoatNormalScale.y*=-1)),this.cache.add(A,e),this.associations.set(e,this.associations.get(s))),s=e}e.material=s}getMaterialType(){return A.MeshStandardMaterial}loadMaterial(e){const t=this,s=this.json,i=this.extensions,r=s.materials[e];let o;const n={},a=[];if((r.extensions||{})[c.KHR_MATERIALS_UNLIT]){const A=i[c.KHR_MATERIALS_UNLIT];o=A.getMaterialType(),a.push(A.extendParams(n,r,t))}else{const s=r.pbrMetallicRoughness||{};if(n.color=new A.Color(1,1,1),n.opacity=1,Array.isArray(s.baseColorFactor)){const A=s.baseColorFactor;n.color.fromArray(A),n.opacity=A[3]}void 0!==s.baseColorTexture&&a.push(t.assignTexture(n,"map",s.baseColorTexture,A.SRGBColorSpace)),n.metalness=void 0!==s.metallicFactor?s.metallicFactor:1,n.roughness=void 0!==s.roughnessFactor?s.roughnessFactor:1,void 0!==s.metallicRoughnessTexture&&(a.push(t.assignTexture(n,"metalnessMap",s.metallicRoughnessTexture)),a.push(t.assignTexture(n,"roughnessMap",s.metallicRoughnessTexture))),o=this._invokeOne((function(A){return A.getMaterialType&&A.getMaterialType(e)})),a.push(Promise.all(this._invokeAll((function(A){return A.extendMaterialParams&&A.extendMaterialParams(e,n)}))))}!0===r.doubleSided&&(n.side=A.DoubleSide);const g=r.alphaMode||j;if(g===W?(n.transparent=!0,n.depthWrite=!1):(n.transparent=!1,g===Y&&(n.alphaTest=void 0!==r.alphaCutoff?r.alphaCutoff:.5)),void 0!==r.normalTexture&&o!==A.MeshBasicMaterial&&(a.push(t.assignTexture(n,"normalMap",r.normalTexture)),n.normalScale=new A.Vector2(1,1),void 0!==r.normalTexture.scale)){const A=r.normalTexture.scale;n.normalScale.set(A,A)}return void 0!==r.occlusionTexture&&o!==A.MeshBasicMaterial&&(a.push(t.assignTexture(n,"aoMap",r.occlusionTexture)),void 0!==r.occlusionTexture.strength&&(n.aoMapIntensity=r.occlusionTexture.strength)),void 0!==r.emissiveFactor&&o!==A.MeshBasicMaterial&&(n.emissive=(new A.Color).fromArray(r.emissiveFactor)),void 0!==r.emissiveTexture&&o!==A.MeshBasicMaterial&&a.push(t.assignTexture(n,"emissiveMap",r.emissiveTexture,A.SRGBColorSpace)),Promise.all(a).then((function(){const A=new o(n);return r.name&&(A.name=r.name),z(A,r),t.associations.set(A,{materials:e}),r.extensions&&X(i,A,r),A}))}createUniqueName(e){const t=A.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,i=this.primitiveCache;function r(A){return s[c.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(A,t).then((function(e){return iA(e,A,t)}))}const o=[];for(let s=0,n=e.length;s<n;s++){const n=e[s],a=$(n),g=i[a];if(g)o.push(g.promise);else{let e;e=n.extensions&&n.extensions[c.KHR_DRACO_MESH_COMPRESSION]?r(n):iA(new A.BufferGeometry,n,t),i[a]={primitive:n,promise:e},o.push(e)}}return Promise.all(o)}loadMesh(e){const t=this,s=this.json,i=this.extensions,r=s.meshes[e],o=r.primitives,n=[];for(let e=0,t=o.length;e<t;e++){const t=void 0===o[e].material?(void 0===(a=this.cache).DefaultMaterial&&(a.DefaultMaterial=new A.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:A.FrontSide})),a.DefaultMaterial):this.getDependency("material",o[e].material);n.push(t)}var a;return n.push(t.loadGeometries(o)),Promise.all(n).then((function(s){const n=s.slice(0,s.length-1),a=s[s.length-1],h=[];for(let s=0,l=a.length;s<l;s++){const l=a[s],c=o[s];let I;const C=n[s];if(c.mode===v.TRIANGLES||c.mode===v.TRIANGLE_STRIP||c.mode===v.TRIANGLE_FAN||void 0===c.mode)I=!0===r.isSkinnedMesh?new A.SkinnedMesh(l,C):new A.Mesh(l,C),!0===I.isSkinnedMesh&&I.normalizeSkinWeights(),c.mode===v.TRIANGLE_STRIP?I.geometry=g(I.geometry,A.TriangleStripDrawMode):c.mode===v.TRIANGLE_FAN&&(I.geometry=g(I.geometry,A.TriangleFanDrawMode));else if(c.mode===v.LINES)I=new A.LineSegments(l,C);else if(c.mode===v.LINE_STRIP)I=new A.Line(l,C);else if(c.mode===v.LINE_LOOP)I=new A.LineLoop(l,C);else{if(c.mode!==v.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+c.mode);I=new A.Points(l,C)}Object.keys(I.geometry.morphAttributes).length>0&&Z(I,r),I.name=t.createUniqueName(r.name||"mesh_"+e),z(I,r),c.extensions&&X(i,I,c),t.assignFinalMaterial(I),h.push(I)}for(let A=0,s=h.length;A<s;A++)t.associations.set(h[A],{meshes:e,primitives:A});if(1===h.length)return r.extensions&&X(i,h[0],r),h[0];const l=new A.Group;r.extensions&&X(i,l,r),t.associations.set(l,{meshes:e});for(let A=0,e=h.length;A<e;A++)l.add(h[A]);return l}))}loadCamera(e){let t;const s=this.json.cameras[e],i=s[s.type];if(i)return"perspective"===s.type?t=new A.PerspectiveCamera(A.MathUtils.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):"orthographic"===s.type&&(t=new A.OrthographicCamera(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),s.name&&(t.name=this.createUniqueName(s.name)),z(t,s),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],s=[];for(let A=0,e=t.joints.length;A<e;A++)s.push(this._loadNodeShallow(t.joints[A]));return void 0!==t.inverseBindMatrices?s.push(this.getDependency("accessor",t.inverseBindMatrices)):s.push(null),Promise.all(s).then((function(e){const s=e.pop(),i=e,r=[],o=[];for(let e=0,n=i.length;e<n;e++){const n=i[e];if(n){r.push(n);const t=new A.Matrix4;null!==s&&t.fromArray(s.array,16*e),o.push(t)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[e])}return new A.Skeleton(r,o)}))}loadAnimation(e){const t=this.json,s=this,i=t.animations[e],r=i.name?i.name:"animation_"+e,o=[],n=[],a=[],g=[],h=[];for(let A=0,e=i.channels.length;A<e;A++){const e=i.channels[A],t=i.samplers[e.sampler],s=e.target,r=s.node,l=void 0!==i.parameters?i.parameters[t.input]:t.input,c=void 0!==i.parameters?i.parameters[t.output]:t.output;void 0!==s.node&&(o.push(this.getDependency("node",r)),n.push(this.getDependency("accessor",l)),a.push(this.getDependency("accessor",c)),g.push(t),h.push(s))}return Promise.all([Promise.all(o),Promise.all(n),Promise.all(a),Promise.all(g),Promise.all(h)]).then((function(e){const t=e[0],i=e[1],o=e[2],n=e[3],a=e[4],g=[];for(let A=0,e=t.length;A<e;A++){const e=t[A],r=i[A],h=o[A],l=n[A],c=a[A];if(void 0===e)continue;e.updateMatrix&&e.updateMatrix();const I=s._createAnimationTracks(e,r,h,l,c);if(I)for(let A=0;A<I.length;A++)g.push(I[A])}return new A.AnimationClip(r,void 0,g)}))}createNodeMesh(A){const e=this.json,t=this,s=e.nodes[A];return void 0===s.mesh?null:t.getDependency("mesh",s.mesh).then((function(A){const e=t._getNodeRef(t.meshCache,s.mesh,A);return void 0!==s.weights&&e.traverse((function(A){if(A.isMesh)for(let e=0,t=s.weights.length;e<t;e++)A.morphTargetInfluences[e]=s.weights[e]})),e}))}loadNode(A){const e=this,t=this.json.nodes[A],s=e._loadNodeShallow(A),i=[],r=t.children||[];for(let A=0,t=r.length;A<t;A++)i.push(e.getDependency("node",r[A]));const o=void 0===t.skin?Promise.resolve(null):e.getDependency("skin",t.skin);return Promise.all([s,Promise.all(i),o]).then((function(A){const e=A[0],t=A[1],s=A[2];null!==s&&e.traverse((function(A){A.isSkinnedMesh&&A.bind(s,tA)}));for(let A=0,s=t.length;A<s;A++)e.add(t[A]);return e}))}_loadNodeShallow(e){const t=this.json,s=this.extensions,i=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];const r=t.nodes[e],o=r.name?i.createUniqueName(r.name):"",n=[],a=i._invokeOne((function(A){return A.createNodeMesh&&A.createNodeMesh(e)}));return a&&n.push(a),void 0!==r.camera&&n.push(i.getDependency("camera",r.camera).then((function(A){return i._getNodeRef(i.cameraCache,r.camera,A)}))),i._invokeAll((function(A){return A.createNodeAttachment&&A.createNodeAttachment(e)})).forEach((function(A){n.push(A)})),this.nodeCache[e]=Promise.all(n).then((function(t){let n;if(n=!0===r.isBone?new A.Bone:t.length>1?new A.Group:1===t.length?t[0]:new A.Object3D,n!==t[0])for(let A=0,e=t.length;A<e;A++)n.add(t[A]);if(r.name&&(n.userData.name=r.name,n.name=o),z(n,r),r.extensions&&X(s,n,r),void 0!==r.matrix){const e=new A.Matrix4;e.fromArray(r.matrix),n.applyMatrix4(e)}else void 0!==r.translation&&n.position.fromArray(r.translation),void 0!==r.rotation&&n.quaternion.fromArray(r.rotation),void 0!==r.scale&&n.scale.fromArray(r.scale);return i.associations.has(n)||i.associations.set(n,{}),i.associations.get(n).nodes=e,n})),this.nodeCache[e]}loadScene(e){const t=this.extensions,s=this.json.scenes[e],i=this,r=new A.Group;s.name&&(r.name=i.createUniqueName(s.name)),z(r,s),s.extensions&&X(t,r,s);const o=s.nodes||[],n=[];for(let A=0,e=o.length;A<e;A++)n.push(i.getDependency("node",o[A]));return Promise.all(n).then((function(e){for(let A=0,t=e.length;A<t;A++)r.add(e[A]);return i.associations=(e=>{const t=new Map;for(const[e,s]of i.associations)(e instanceof A.Material||e instanceof A.Texture)&&t.set(e,s);return e.traverse((A=>{const e=i.associations.get(A);null!=e&&t.set(A,e)})),t})(r),r}))}_createAnimationTracks(e,t,s,i,r){const o=[],n=e.name?e.name:e.uuid,a=[];let g;switch(V[r.path]===V.weights?e.traverse((function(A){A.morphTargetInfluences&&a.push(A.name?A.name:A.uuid)})):a.push(n),V[r.path]){case V.weights:g=A.NumberKeyframeTrack;break;case V.rotation:g=A.QuaternionKeyframeTrack;break;case V.position:case V.scale:g=A.VectorKeyframeTrack;break;default:if(1===s.itemSize)g=A.NumberKeyframeTrack;else g=A.VectorKeyframeTrack}const h=void 0!==i.interpolation?K[i.interpolation]:A.InterpolateLinear,l=this._getArrayFromAccessor(s);for(let A=0,e=a.length;A<e;A++){const e=new g(a[A]+"."+V[r.path],t.array,l,h);"CUBICSPLINE"===i.interpolation&&this._createCubicSplineTrackInterpolant(e),o.push(e)}return o}_getArrayFromAccessor(A){let e=A.array;if(A.normalized){const A=eA(e.constructor),t=new Float32Array(e.length);for(let s=0,i=e.length;s<i;s++)t[s]=e[s]*A;e=t}return e}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof A.QuaternionKeyframeTrack?N:U)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function iA(e,t,s){const i=t.attributes,r=[];function o(A,t){return s.getDependency("accessor",A).then((function(A){e.setAttribute(t,A)}))}for(const A in i){const t=J[A]||A.toLowerCase();t in e.attributes||r.push(o(i[A],t))}if(void 0!==t.indices&&!e.index){const A=s.getDependency("accessor",t.indices).then((function(A){e.setIndex(A)}));r.push(A)}return z(e,t),function(e,t,s){const i=t.attributes,r=new A.Box3;if(void 0===i.POSITION)return;{const e=s.json.accessors[i.POSITION],t=e.min,o=e.max;if(void 0===t||void 0===o)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(r.set(new A.Vector3(t[0],t[1],t[2]),new A.Vector3(o[0],o[1],o[2])),e.normalized){const A=eA(H[e.componentType]);r.min.multiplyScalar(A),r.max.multiplyScalar(A)}}const o=t.targets;if(void 0!==o){const e=new A.Vector3,t=new A.Vector3;for(let A=0,i=o.length;A<i;A++){const i=o[A];if(void 0!==i.POSITION){const A=s.json.accessors[i.POSITION],r=A.min,o=A.max;if(void 0!==r&&void 0!==o){if(t.setX(Math.max(Math.abs(r[0]),Math.abs(o[0]))),t.setY(Math.max(Math.abs(r[1]),Math.abs(o[1]))),t.setZ(Math.max(Math.abs(r[2]),Math.abs(o[2]))),A.normalized){const e=eA(H[A.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(e)}e.boundingBox=r;const n=new A.Sphere;r.getCenter(n.center),n.radius=r.min.distanceTo(r.max)/2,e.boundingSphere=n}(e,t,s),Promise.all(r).then((function(){return void 0!==t.targets?function(A,e,t){let s=!1,i=!1,r=!1;for(let A=0,t=e.length;A<t;A++){const t=e[A];if(void 0!==t.POSITION&&(s=!0),void 0!==t.NORMAL&&(i=!0),void 0!==t.COLOR_0&&(r=!0),s&&i&&r)break}if(!s&&!i&&!r)return Promise.resolve(A);const o=[],n=[],a=[];for(let g=0,h=e.length;g<h;g++){const h=e[g];if(s){const e=void 0!==h.POSITION?t.getDependency("accessor",h.POSITION):A.attributes.position;o.push(e)}if(i){const e=void 0!==h.NORMAL?t.getDependency("accessor",h.NORMAL):A.attributes.normal;n.push(e)}if(r){const e=void 0!==h.COLOR_0?t.getDependency("accessor",h.COLOR_0):A.attributes.color;a.push(e)}}return Promise.all([Promise.all(o),Promise.all(n),Promise.all(a)]).then((function(e){const t=e[0],o=e[1],n=e[2];return s&&(A.morphAttributes.position=t),i&&(A.morphAttributes.normal=o),r&&(A.morphAttributes.color=n),A.morphTargetsRelative=!0,A}))}(e,t.targets,s):e}))}const rA=new WeakMap;class oA extends A.Loader{constructor(A){super(A),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(A){return this.decoderPath=A,this}setDecoderConfig(A){return this.decoderConfig=A,this}setWorkerLimit(A){return this.workerLimit=A,this}load(e,t,s,i){const r=new A.FileLoader(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,(A=>{this.parse(A,t,i)}),s,i)}parse(e,t,s){this.decodeDracoFile(e,t,null,null,A.SRGBColorSpace).catch(s)}decodeDracoFile(e,t,s,i,r=A.LinearSRGBColorSpace){const o={attributeIDs:s||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!s,vertexColorSpace:r};return this.decodeGeometry(e,o).then(t)}decodeGeometry(A,e){const t=JSON.stringify(e);if(rA.has(A)){const e=rA.get(A);if(e.key===t)return e.promise;if(0===A.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s;const i=this.workerNextTaskID++,r=A.byteLength,o=this._getWorker(i,r).then((t=>(s=t,new Promise(((t,r)=>{s._callbacks[i]={resolve:t,reject:r},s.postMessage({type:"decode",id:i,taskConfig:e,buffer:A},[A])}))))).then((A=>this._createGeometry(A.geometry)));return o.catch((()=>!0)).then((()=>{s&&i&&this._releaseTask(s,i)})),rA.set(A,{key:t,promise:o}),o}_createGeometry(e){const t=new A.BufferGeometry;e.index&&t.setIndex(new A.BufferAttribute(e.index.array,1));for(let s=0;s<e.attributes.length;s++){const i=e.attributes[s],r=i.name,o=i.array,n=i.itemSize,a=new A.BufferAttribute(o,n);"color"===r&&(this._assignVertexColorSpace(a,i.vertexColorSpace),a.normalized=o instanceof Float32Array==!1),t.setAttribute(r,a)}return t}_assignVertexColorSpace(e,t){if(t!==A.SRGBColorSpace)return;const s=new A.Color;for(let A=0,t=e.count;A<t;A++)s.fromBufferAttribute(e,A).convertSRGBToLinear(),e.setXYZ(A,s.r,s.g,s.b)}_loadLibrary(e,t){const s=new A.FileLoader(this.manager);return s.setPath(this.decoderPath),s.setResponseType(t),s.setWithCredentials(this.withCredentials),new Promise(((A,t)=>{s.load(e,A,void 0,t)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const A="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,e=[];return A?e.push(this._loadLibrary("draco_decoder.js","text")):(e.push(this._loadLibrary("draco_wasm_wrapper.js","text")),e.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(e).then((e=>{const t=e[0];A||(this.decoderConfig.wasmBinary=e[1]);const s=nA.toString(),i=["/* draco decoder */",t,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending}_getWorker(A,e){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const A=new Worker(this.workerSourceURL);A._callbacks={},A._taskCosts={},A._taskLoad=0,A.postMessage({type:"init",decoderConfig:this.decoderConfig}),A.onmessage=function(e){const t=e.data;switch(t.type){case"decode":A._callbacks[t.id].resolve(t);break;case"error":A._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},this.workerPool.push(A)}else this.workerPool.sort((function(A,e){return A._taskLoad>e._taskLoad?-1:1}));const t=this.workerPool[this.workerPool.length-1];return t._taskCosts[A]=e,t._taskLoad+=e,t}))}_releaseTask(A,e){A._taskLoad-=A._taskCosts[e],delete A._callbacks[e],delete A._taskCosts[e]}debug(){console.log("Task load: ",this.workerPool.map((A=>A._taskLoad)))}dispose(){for(let A=0;A<this.workerPool.length;++A)this.workerPool[A].terminate();return this.workerPool.length=0,""!==this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),this}}function nA(){let A,e;function t(A,e,t,s,i,r){const o=r.num_components(),n=t.num_points()*o,a=n*i.BYTES_PER_ELEMENT,g=function(A,e){switch(e){case Float32Array:return A.DT_FLOAT32;case Int8Array:return A.DT_INT8;case Int16Array:return A.DT_INT16;case Int32Array:return A.DT_INT32;case Uint8Array:return A.DT_UINT8;case Uint16Array:return A.DT_UINT16;case Uint32Array:return A.DT_UINT32}}(A,i),h=A._malloc(a);e.GetAttributeDataArrayForAllPoints(t,r,g,a,h);const l=new i(A.HEAPF32.buffer,h,n).slice();return A._free(h),{name:s,array:l,itemSize:o}}onmessage=function(s){const i=s.data;switch(i.type){case"init":A=i.decoderConfig,e=new Promise((function(e){A.onModuleLoaded=function(A){e({draco:A})},DracoDecoderModule(A)}));break;case"decode":const s=i.buffer,r=i.taskConfig;e.then((A=>{const e=A.draco,o=new e.Decoder;try{const A=function(A,e,s,i){const r=i.attributeIDs,o=i.attributeTypes;let n,a;const g=e.GetEncodedGeometryType(s);if(g===A.TRIANGULAR_MESH)n=new A.Mesh,a=e.DecodeArrayToMesh(s,s.byteLength,n);else{if(g!==A.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");n=new A.PointCloud,a=e.DecodeArrayToPointCloud(s,s.byteLength,n)}if(!a.ok()||0===n.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+a.error_msg());const h={index:null,attributes:[]};for(const s in r){const a=self[o[s]];let g,l;if(i.useUniqueIDs)l=r[s],g=e.GetAttributeByUniqueId(n,l);else{if(l=e.GetAttributeId(n,A[r[s]]),-1===l)continue;g=e.GetAttribute(n,l)}const c=t(A,e,n,s,a,g);"color"===s&&(c.vertexColorSpace=i.vertexColorSpace),h.attributes.push(c)}g===A.TRIANGULAR_MESH&&(h.index=function(A,e,t){const s=t.num_faces(),i=3*s,r=4*i,o=A._malloc(r);e.GetTrianglesUInt32Array(t,r,o);const n=new Uint32Array(A.HEAPF32.buffer,o,i).slice();return A._free(o),{array:n,itemSize:1}}(A,e,n));return A.destroy(n),h}(e,o,new Int8Array(s),r),n=A.attributes.map((A=>A.array.buffer));A.index&&n.push(A.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:A},n)}catch(A){console.error(A),self.postMessage({type:"error",id:i.id,error:A.message})}finally{e.destroy(o)}}))}}}class aA{constructor(A=4){this.pool=A,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(A){if(!this.workers[A]){const e=this.workerCreator();e.addEventListener("message",this._onMessage.bind(this,A)),this.workers[A]=e}}_getIdleWorker(){for(let A=0;A<this.pool;A++)if(!(this.workerStatus&1<<A))return A;return-1}_onMessage(A,e){const t=this.workersResolve[A];if(t&&t(e),this.queue.length){const{resolve:e,msg:t,transfer:s}=this.queue.shift();this.workersResolve[A]=e,this.workers[A].postMessage(t,s)}else this.workerStatus^=1<<A}setWorkerCreator(A){this.workerCreator=A}setWorkerLimit(A){this.pool=A}postMessage(A,e){return new Promise((t=>{const s=this._getIdleWorker();-1!==s?(this._initWorker(s),this.workerStatus|=1<<s,this.workersResolve[s]=t,this.workers[s].postMessage(A,e)):this.queue.push({resolve:t,msg:A,transfer:e})}))}dispose(){this.workers.forEach((A=>A.terminate())),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}class gA{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class hA{constructor(A,e,t,s){this._dataView=new DataView(A.buffer,A.byteOffset+e,t),this._littleEndian=s,this._offset=0}_nextUint8(){const A=this._dataView.getUint8(this._offset);return this._offset+=1,A}_nextUint16(){const A=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,A}_nextUint32(){const A=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,A}_nextUint64(){const A=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,A}_nextInt32(){const A=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,A}_skip(A){return this._offset+=A,this}_scan(A,e=0){const t=this._offset;let s=0;for(;this._dataView.getUint8(this._offset)!==e&&s<A;)s++,this._offset++;return s<A&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+t,s)}}new Uint8Array([0]);const lA=[171,75,84,88,32,50,48,187,13,10,26,10];function cA(A){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(A):Buffer.from(A).toString("utf8")}let IA,CA,BA;const EA={env:{emscripten_notify_memory_growth:function(A){BA=new Uint8Array(CA.exports.memory.buffer)}}};class dA{init(){return IA||(IA="undefined"!=typeof fetch?fetch("data:application/wasm;base64,"+uA).then((A=>A.arrayBuffer())).then((A=>WebAssembly.instantiate(A,EA))).then(this._init):WebAssembly.instantiate(Buffer.from(uA,"base64"),EA).then(this._init),IA)}_init(A){CA=A.instance,EA.env.emscripten_notify_memory_growth(0)}decode(A,e=0){if(!CA)throw new Error("ZSTDDecoder: Await .init() before decoding.");const t=A.byteLength,s=CA.exports.malloc(t);BA.set(A,s),e=e||Number(CA.exports.ZSTD_findDecompressedSize(s,t));const i=CA.exports.malloc(e),r=CA.exports.ZSTD_decompress(i,e,s,t),o=BA.slice(i,i+r);return CA.exports.free(s),CA.exports.free(i),o}}const uA="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAA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iABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQS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ALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2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AAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCyc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IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAI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BgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",QA=new WeakMap;let fA,pA=0;class mA extends A.Loader{constructor(A){super(A),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new aA,this.workerSourceURL="",this.workerConfig=null,"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(A){return this.transcoderPath=A,this}setWorkerLimit(A){return this.workerPool.setWorkerLimit(A),this}detectSupport(A){return!0===A.isWebGPURenderer?this.workerConfig={astcSupported:A.hasFeature("texture-compression-astc"),etc1Supported:!1,etc2Supported:A.hasFeature("texture-compression-etc2"),dxtSupported:A.hasFeature("texture-compression-bc"),bptcSupported:!1,pvrtcSupported:!1}:(this.workerConfig={astcSupported:A.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:A.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:A.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:A.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:A.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:A.extensions.has("WEBGL_compressed_texture_pvrtc")||A.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},A.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1)),this}init(){if(!this.transcoderPending){const e=new A.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),s=new A.FileLoader(this.manager);s.setPath(this.transcoderPath),s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials);const i=s.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then((([A,e])=>{const t=mA.BasisWorker.toString(),s=["/* constants */","let _EngineFormat = "+JSON.stringify(mA.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(mA.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(mA.BasisFormat),"/* basis_transcoder.js */",A,"/* worker */",t.substring(t.indexOf("{")+1,t.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([s])),this.transcoderBinary=e,this.workerPool.setWorkerCreator((()=>{const A=new Worker(this.workerSourceURL),e=this.transcoderBinary.slice(0);return A.postMessage({type:"init",config:this.workerConfig,transcoderBinary:e},[e]),A}))})),pA>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),pA++}return this.transcoderPending}load(e,t,s,i){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const r=new A.FileLoader(this.manager);r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials),r.load(e,(A=>{if(QA.has(A)){return QA.get(A).promise.then(t).catch(i)}this._createTexture(A).then((A=>t?t(A):null)).catch(i)}),s,i)}_createTextureFrom(e,t){const{faces:s,width:i,height:r,format:o,type:n,error:a,dfdTransferFn:g,dfdFlags:h}=e;if("error"===n)return Promise.reject(a);let l;if(6===t.faceCount)l=new A.CompressedCubeTexture(s,o,A.UnsignedByteType);else{const e=s[0].mipmaps;l=t.layerCount>1?new A.CompressedArrayTexture(e,i,r,t.layerCount,o,A.UnsignedByteType):new A.CompressedTexture(e,i,r,o,A.UnsignedByteType)}return l.minFilter=1===s[0].mipmaps.length?A.LinearFilter:A.LinearMipmapLinearFilter,l.magFilter=A.LinearFilter,l.generateMipmaps=!1,l.needsUpdate=!0,l.colorSpace=2===g?A.SRGBColorSpace:A.NoColorSpace,l.premultiplyAlpha=!!(1&h),l}async _createTexture(A,e={}){const t=function(A){const e=new Uint8Array(A.buffer,A.byteOffset,lA.length);if(e[0]!==lA[0]||e[1]!==lA[1]||e[2]!==lA[2]||e[3]!==lA[3]||e[4]!==lA[4]||e[5]!==lA[5]||e[6]!==lA[6]||e[7]!==lA[7]||e[8]!==lA[8]||e[9]!==lA[9]||e[10]!==lA[10]||e[11]!==lA[11])throw new Error("Missing KTX 2.0 identifier.");const t=new gA,s=17*Uint32Array.BYTES_PER_ELEMENT,i=new hA(A,lA.length,s,!0);t.vkFormat=i._nextUint32(),t.typeSize=i._nextUint32(),t.pixelWidth=i._nextUint32(),t.pixelHeight=i._nextUint32(),t.pixelDepth=i._nextUint32(),t.layerCount=i._nextUint32(),t.faceCount=i._nextUint32();const r=i._nextUint32();t.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),n=i._nextUint32(),a=i._nextUint32(),g=i._nextUint32(),h=i._nextUint64(),l=i._nextUint64(),c=new hA(A,lA.length+s,3*r*8,!0);for(let e=0;e<r;e++)t.levels.push({levelData:new Uint8Array(A.buffer,A.byteOffset+c._nextUint64(),c._nextUint64()),uncompressedByteLength:c._nextUint64()});const I=new hA(A,o,n,!0),C={vendorId:I._skip(4)._nextUint16(),descriptorType:I._nextUint16(),versionNumber:I._nextUint16(),descriptorBlockSize:I._nextUint16(),colorModel:I._nextUint8(),colorPrimaries:I._nextUint8(),transferFunction:I._nextUint8(),flags:I._nextUint8(),texelBlockDimension:[I._nextUint8(),I._nextUint8(),I._nextUint8(),I._nextUint8()],bytesPlane:[I._nextUint8(),I._nextUint8(),I._nextUint8(),I._nextUint8(),I._nextUint8(),I._nextUint8(),I._nextUint8(),I._nextUint8()],samples:[]},B=(C.descriptorBlockSize/4-6)/4;for(let A=0;A<B;A++){const e={bitOffset:I._nextUint16(),bitLength:I._nextUint8(),channelType:I._nextUint8(),samplePosition:[I._nextUint8(),I._nextUint8(),I._nextUint8(),I._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&e.channelType?(e.sampleLower=I._nextInt32(),e.sampleUpper=I._nextInt32()):(e.sampleLower=I._nextUint32(),e.sampleUpper=I._nextUint32()),C.samples[A]=e}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(C);const E=new hA(A,a,g,!0);for(;E._offset<g;){const A=E._nextUint32(),e=E._scan(A),s=cA(e),i=E._scan(A-e.byteLength);t.keyValue[s]=s.match(/^ktx/i)?cA(i):i,E._offset%4&&E._skip(4-E._offset%4)}if(l<=0)return t;const d=new hA(A,h,l,!0),u=d._nextUint16(),Q=d._nextUint16(),f=d._nextUint32(),p=d._nextUint32(),m=d._nextUint32(),w=d._nextUint32(),y=[];for(let A=0;A<r;A++)y.push({imageFlags:d._nextUint32(),rgbSliceByteOffset:d._nextUint32(),rgbSliceByteLength:d._nextUint32(),alphaSliceByteOffset:d._nextUint32(),alphaSliceByteLength:d._nextUint32()});const D=h+d._offset,R=D+f,x=R+p,S=x+m,T=new Uint8Array(A.buffer,A.byteOffset+D,f),M=new Uint8Array(A.buffer,A.byteOffset+R,p),L=new Uint8Array(A.buffer,A.byteOffset+x,m),F=new Uint8Array(A.buffer,A.byteOffset+S,w);return t.globalData={endpointCount:u,selectorCount:Q,imageDescs:y,endpointsData:T,selectorsData:M,tablesData:L,extendedData:F},t}(new Uint8Array(A));if(0!==t.vkFormat){const A=[],e=[];for(let s=0;s<t.levels.length;s++)e.push(RA(t,s).then((function(e){A[s]=e})));await Promise.all(e);const s=A[0];return s.mipmaps=A.map((A=>({data:A.source.data,width:A.source.data.width,height:A.source.data.height,depth:A.source.data.depth}))),s}const s=e,i=this.init().then((()=>this.workerPool.postMessage({type:"transcode",buffer:A,taskConfig:s},[A]))).then((A=>this._createTextureFrom(A.data,t)));return QA.set(A,{promise:i}),i}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),pA--,this}}mA.BasisFormat={ETC1S:0,UASTC_4x4:1},mA.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},mA.EngineFormat={RGBAFormat:A.RGBAFormat,RGBA_ASTC_4x4_Format:A.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:A.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:A.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:A.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:A.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:A.RGB_ETC1_Format,RGB_ETC2_Format:A.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:A.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:A.RGB_S3TC_DXT1_Format},mA.BasisWorker=function(){let A,e,t;const s=_EngineFormat,i=_TranscoderFormat,r=_BasisFormat;self.addEventListener("message",(function(o){const l=o.data;switch(l.type){case"init":A=l.config,c=l.transcoderBinary,e=new Promise((A=>{t={wasmBinary:c,onRuntimeInitialized:A},BASIS(t)})).then((()=>{t.initializeBasis(),void 0===t.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")}));break;case"transcode":e.then((()=>{try{const{faces:e,buffers:o,width:c,height:I,hasAlpha:C,format:B,dfdTransferFn:E,dfdFlags:d}=function(e){const o=new t.KTX2File(new Uint8Array(e));function l(){o.close(),o.delete()}if(!o.isValid())throw l(),new Error("THREE.KTX2Loader:\tInvalid or unsupported .ktx2 file");const c=o.isUASTC()?r.UASTC_4x4:r.ETC1S,I=o.getWidth(),C=o.getHeight(),B=o.getLayers()||1,E=o.getLevels(),d=o.getFaces(),u=o.getHasAlpha(),Q=o.getDFDTransferFunc(),f=o.getDFDFlags(),{transcoderFormat:p,engineFormat:m}=function(e,t,o,h){let l,c;const I=e===r.ETC1S?n:a;for(let s=0;s<I.length;s++){const i=I[s];if(A[i.if]&&(i.basisFormat.includes(e)&&!(h&&i.transcoderFormat.length<2)&&(!i.needsPowerOfTwo||g(t)&&g(o))))return l=i.transcoderFormat[h?1:0],c=i.engineFormat[h?1:0],{transcoderFormat:l,engineFormat:c}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),l=i.RGBA32,c=s.RGBAFormat,{transcoderFormat:l,engineFormat:c}}(c,I,C,u);if(!I||!C||!E)throw l(),new Error("THREE.KTX2Loader:\tInvalid texture");if(!o.startTranscoding())throw l(),new Error("THREE.KTX2Loader: .startTranscoding failed");const w=[],y=[];for(let A=0;A<d;A++){const e=[];for(let t=0;t<E;t++){const s=[];let i,r;for(let e=0;e<B;e++){const n=o.getImageLevelInfo(t,e,A);0!==A||0!==t||0!==e||n.origWidth%4==0&&n.origHeight%4==0||console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),E>1?(i=n.origWidth,r=n.origHeight):(i=n.width,r=n.height);const a=new Uint8Array(o.getImageTranscodedSizeInBytes(t,e,0,p));if(!o.transcodeImage(a,t,e,A,p,0,-1,-1))throw l(),new Error("THREE.KTX2Loader: .transcodeImage failed.");s.push(a)}const n=h(s);e.push({data:n,width:i,height:r}),y.push(n.buffer)}w.push({mipmaps:e,width:I,height:C,format:m})}return l(),{faces:w,buffers:y,width:I,height:C,hasAlpha:u,format:m,dfdTransferFn:Q,dfdFlags:f}}(l.buffer);self.postMessage({type:"transcode",id:l.id,faces:e,width:c,height:I,hasAlpha:C,format:B,dfdTransferFn:E,dfdFlags:d},o)}catch(A){console.error(A),self.postMessage({type:"error",id:l.id,error:A.message})}}))}var c}));const o=[{if:"astcSupported",basisFormat:[r.UASTC_4x4],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[s.RGBA_ASTC_4x4_Format,s.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[s.RGBA_BPTC_Format,s.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[i.BC1,i.BC3],engineFormat:[s.RGB_S3TC_DXT1_Format,s.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[s.RGB_ETC2_Format,s.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[i.ETC1],engineFormat:[s.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[s.RGB_PVRTC_4BPPV1_Format,s.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],n=o.sort((function(A,e){return A.priorityETC1S-e.priorityETC1S})),a=o.sort((function(A,e){return A.priorityUASTC-e.priorityUASTC}));function g(A){return A<=2||0==(A&A-1)&&0!==A}function h(A){if(1===A.length)return A[0];let e=0;for(let t=0;t<A.length;t++){e+=A[t].byteLength}const t=new Uint8Array(e);let s=0;for(let e=0;e<A.length;e++){const i=A[e];t.set(i,s),s+=i.byteLength}return t}};const wA={109:A.RGBAFormat,97:A.RGBAFormat,37:A.RGBAFormat,43:A.RGBAFormat,103:A.RGFormat,83:A.RGFormat,16:A.RGFormat,22:A.RGFormat,100:A.RedFormat,76:A.RedFormat,15:A.RedFormat,9:A.RedFormat},yA={109:A.FloatType,97:A.HalfFloatType,37:A.UnsignedByteType,43:A.UnsignedByteType,103:A.FloatType,83:A.HalfFloatType,16:A.UnsignedByteType,22:A.UnsignedByteType,100:A.FloatType,76:A.HalfFloatType,15:A.UnsignedByteType,9:A.UnsignedByteType},DA={43:A.SRGBColorSpace,22:A.SRGBColorSpace,15:A.SRGBColorSpace};async function RA(e,t=0){const{vkFormat:s}=e,i=Math.max(1,e.pixelWidth>>t),r=Math.max(1,e.pixelHeight>>t),o=Math.max(1,e.pixelDepth>>t);if(void 0===wA[s])throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");const n=e.levels[t];let a,g;if(0===e.supercompressionScheme)a=n.levelData;else{if(2!==e.supercompressionScheme)throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");fA||(fA=new Promise((async A=>{const e=new dA;await e.init(),A(e)}))),a=(await fA).decode(n.levelData,n.uncompressedByteLength)}g=yA[s]===A.FloatType?new Float32Array(a.buffer,a.byteOffset,a.byteLength/Float32Array.BYTES_PER_ELEMENT):yA[s]===A.HalfFloatType?new Uint16Array(a.buffer,a.byteOffset,a.byteLength/Uint16Array.BYTES_PER_ELEMENT):a;const h=0===o?new A.DataTexture(g,i,r):new A.Data3DTexture(g,i,r,o);return h.type=yA[s],h.format=wA[s],h.colorSpace=DA[s]||A.NoColorSpace,h.needsUpdate=!0,Promise.resolve(h)}const xA=new TextDecoder;class SA{constructor(A,e,t,s){this.buffer=A,this.binOffset=e+t,this.binLength=s;let i=null;if(0!==t)try{const s=new Uint8Array(A,e,t);i=JSON.parse(xA.decode(s))}catch(A){i={}}else i={};this.header=i}getKeys(){return Object.keys(this.header)}getData(A,e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const i=this.header;if(!(A in i))return null;const r=i[A];if(r instanceof Object){if(Array.isArray(r))return r;{const{buffer:i,binOffset:o,binLength:n}=this,a=r.byteOffset||0,g=r.type||s,h=r.componentType||t;if("type"in r&&s&&r.type!==s)throw new Error("FeatureTable: Specified type does not match expected type.");let l,c;switch(g){case"SCALAR":l=1;break;case"VEC2":l=2;break;case"VEC3":l=3;break;case"VEC4":l=4;break;default:throw new Error('FeatureTable : Feature type not provided for "'.concat(A,'".'))}const I=o+a,C=e*l;switch(h){case"BYTE":c=new Int8Array(i,I,C);break;case"UNSIGNED_BYTE":c=new Uint8Array(i,I,C);break;case"SHORT":c=new Int16Array(i,I,C);break;case"UNSIGNED_SHORT":c=new Uint16Array(i,I,C);break;case"INT":c=new Int32Array(i,I,C);break;case"UNSIGNED_INT":c=new Uint32Array(i,I,C);break;case"FLOAT":c=new Float32Array(i,I,C);break;case"DOUBLE":c=new Float64Array(i,I,C);break;default:throw new Error('FeatureTable : Feature component type not provided for "'.concat(A,'".'))}if(I+C*c.BYTES_PER_ELEMENT>o+n)throw new Error("FeatureTable: Feature data read outside binary body length.");return c}}return r}}class TA extends SA{constructor(A,e,t,s,i){super(A,t,s,i),this.batchSize=e}getData(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return super.getData(A,this.batchSize,e,t)}}function MA(A,e,t){return e=function(A){var e=function(A,e){if("object"!=typeof A||!A)return A;var t=A[Symbol.toPrimitive];if(void 0!==t){var s=t.call(A,e||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(A)}(A,"string");return"symbol"==typeof e?e:String(e)}(e),e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}const LA=new A.Matrix4;LA.set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1);const FA="https://www.gstatic.com/draco/versioned/decoders/1.4.3/",GA="https://storage.googleapis.com/ogc-3d-tiles/basis/",bA="draco-decoders/",kA="ktx2-decoders/";class UA{constructor(e){MA(this,"checkLoaderInitialized",(async()=>new Promise((A=>{const e=setInterval((()=>{this.gltfLoader.dracoLoader&&this.gltfLoader.ktx2Loader&&(clearInterval(e),A())}),10)})))),this.gltfLoader=new h,this.tempMatrix=new A.Matrix4;const t=new oA,s=new mA;async function i(A){return fetch(A,{method:"HEAD"}).then((A=>A.ok)).catch((A=>!1))}i(bA+"draco_decoder.wasm").then((A=>(A?t.setDecoderPath(bA):(console.log("no local draco decoder found in "+bA+", fetching online at "+FA),t.setDecoderPath(FA)),i(kA+"basis_transcoder.wasm")))).then((A=>{A?s.setTranscoderPath(kA).detectSupport(e):(console.log("no local ktx2 decoder found in "+kA+", fetching online at "+GA),s.setTranscoderPath(GA).detectSupport(e))})).then((()=>{this.gltfLoader.setDRACOLoader(t),this.gltfLoader.setKTX2Loader(s)}))}parseB3DM(A,e,t,s){const i=new DataView(A),r=String.fromCharCode(i.getUint8(0))+String.fromCharCode(i.getUint8(1))+String.fromCharCode(i.getUint8(2))+String.fromCharCode(i.getUint8(3));console.assert("b3dm"===r);const o=i.getUint32(8,!0);console.assert(o===A.byteLength);const n=i.getUint32(12,!0),a=i.getUint32(16,!0),g=i.getUint32(20,!0),h=i.getUint32(24,!0),l=new SA(A,28,n,a),c=28+n+a,I=(new TA(A,l.getData("BATCH_LENGTH"),c,g,h),c+g+h),C=new Uint8Array(A,I,o-I).slice().buffer;return new Promise((async(A,i)=>{await this.checkLoaderInitialized(),this.gltfLoader.parse(C,null,(i=>{const r=l.getData("RTC_CENTER");r?(this.tempMatrix.makeTranslation(r[0],r[1],r[2]),i.scene.applyMatrix4(this.tempMatrix)):i.userData.gltfExtensions&&i.userData.gltfExtensions.CESIUM_RTC&&(this.tempMatrix.makeTranslation(i.userData.gltfExtensions.CESIUM_RTC.center[0],i.userData.gltfExtensions.CESIUM_RTC.center[1],i.userData.gltfExtensions.CESIUM_RTC.center[2]),i.scene.applyMatrix4(this.tempMatrix)),t&&i.scene.applyMatrix4(LA),i.scene.asset=i.asset,i.scene.traverse((A=>{A.isMesh&&(s&&A.applyMatrix4(LA),e&&e(A))})),A(i.scene)}),(A=>{console.error(A)}))}))}parseB3DMInstanced(e,t,s,i,r){return this.parseB3DM(e,t,i,r).then((e=>{let t,i=[],r=[];e.updateWorldMatrix(!1,!0),e.traverse((A=>{A.isMesh&&(A.geometry.applyMatrix4(A.matrixWorld),i.push(A.geometry),r.push(A.material))}));let o=function(e){let t=new Set;e.forEach((A=>{for(let e in A.attributes)t.add(e)})),e.forEach((e=>{t.forEach((t=>{if(!e.attributes[t]){const s=function(A){switch(A){case"position":case"normal":case"color":return 3;case"uv":case"uv2":return 2;default:throw new Error("Unknown attribute ".concat(A))}}(t),i=new Float32Array(s*e.getAttribute("position").count).fill(0);e.setAttribute(t,new A.BufferAttribute(i,s))}}))}));let s=n(e,!0);return s}(i);return t=new A.InstancedMesh(o,r,s),t.baseMatrix=(new A.Matrix4).identity(),t}))}}const _A=new A.Matrix4;_A.set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1);class NA{constructor(A){this.maxCachedItems=100,this.proxy=A.proxy,A&&(this.meshCallback=A.meshCallback,this.pointsCallback=A.pointsCallback,A.maxCachedItems&&(this.maxCachedItems=A.maxCachedItems)),this.gltfLoader=new h;const e=new oA;if(e.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.4.3/"),this.gltfLoader.setDRACOLoader(e),A&&A.renderer){const e=new mA;e.setTranscoderPath("https://storage.googleapis.com/ogc-3d-tiles/basis/").detectSupport(A.renderer),this.gltfLoader.setKTX2Loader(e),this.b3dmDecoder=new UA(A.renderer)}else this.b3dmDecoder=new UA(null);this.cache=new o.LinkedHashMap,this.register={},this.ready=[],this.downloads=[],this.nextReady=[],this.nextDownloads=[],this.init()}init(){const A=this;vA((()=>{A.download()}),10),vA((()=>{const e=Date.now();let t=0;do{t=A.loadBatch()}while(t>0&&Date.now()-e<=0)}),10)}scheduleDownload(A){this.downloads.unshift(A)}download(){if(0!=this.nextDownloads.length||(this.getNextDownloads(),0!=this.nextDownloads.length))for(;this.nextDownloads.length>0;){const A=this.nextDownloads.shift();A&&A.shouldDoDownload()&&A.doDownload()}}meshReceived(A,e,t,s,i,r,o){this.ready.unshift([A,e,t,s,i,r,o])}loadBatch(){if(0==this.nextReady.length&&(this.getNextReady(),0==this.nextReady.length))return 0;const A=this.nextReady.shift();if(!A)return 0;const e=A[0],t=A[1],s=A[2],i=e.get(s);return i&&t[s]&&Object.keys(t[s]).forEach((A=>{const e=t[s][A];e&&(e(i),t[s][A]=null)})),1}getNextDownloads(){let A=Number.MAX_VALUE,e=-1;for(let A=this.downloads.length-1;A>=0;A--)this.downloads[A].shouldDoDownload()?this.downloads[A].distanceFunction||this.nextDownloads.push(this.downloads.splice(A,1)[0]):this.downloads.splice(A,1);if(!(this.nextDownloads.length>0)){for(let t=this.downloads.length-1;t>=0;t--){const s=this.downloads[t].distanceFunction()*this.downloads[t].level;s<A&&(A=s,e=t)}if(e>=0){const A=this.downloads.splice(e,1).pop();this.nextDownloads.push(A);const t=A.getSiblings();for(let A=this.downloads.length-1;A>=0;A--)t.includes(this.downloads[A].uuid)&&this.nextDownloads.push(this.downloads.splice(A,1).pop())}}}getNextReady(){let A=Number.MAX_VALUE,e=-1;for(let A=this.ready.length-1;A>=0;A--)this.ready[A][3]||this.nextReady.push(this.ready.splice(A,1)[0]);if(!(this.nextReady.length>0)){for(let t=this.ready.length-1;t>=0;t--){const s=this.ready[t][3]()*this.ready[t][5];s<A&&(A=s,e=t)}if(e>=0){const A=this.ready.splice(e,1).pop();this.nextReady.push(A);const t=A[4]();for(let A=this.ready.length-1;A>=0;A--)t.includes(this.ready[A][6])&&this.nextready.push(this.ready.splice(A,1).pop())}}}get(A,e,t,s,i,r,o,n,a,g){const h=this,l=HA(t),c=new AbortController;if(A.signal.addEventListener("abort",(()=>{h.register[l]&&0!=Object.keys(h.register[l]).length||c.abort()})),!(t.includes(".b3dm")||t.includes(".json")||t.includes(".gltf")||t.includes(".glb")))return void console.error("the 3DTiles cache can only be used to load B3DM, gltf and json data");h.register[l]||(h.register[l]={}),h.register[l][e]&&console.error(" a tile should only be loaded once"),h.register[l][e]=s;if(h.cache.get(l))this.meshReceived(h.cache,h.register,l,i,r,o,e);else if(1==Object.keys(h.register[l]).length){let s;t.includes(".b3dm")?s=()=>{(h.proxy?()=>fetch(h.proxy,{method:"POST",body:t,signal:c.signal}):()=>fetch(t,{signal:c.signal}))().then((A=>{if(!A.ok)throw console.error("could not load tile with path : "+t),new Error("couldn't load \"".concat(t,'". Request failed with status ').concat(A.status," : ").concat(A.statusText));return A.arrayBuffer()})).then((A=>this.b3dmDecoder.parseB3DM(A,h.meshCallback,n,a))).then((A=>{h.cache.put(l,A),h.checkSize(),this.meshReceived(h.cache,h.register,l,i,r,o,e)})).catch((A=>{console.error(A)}))}:t.includes(".glb")||t.includes(".gltf")?s=()=>{(h.proxy?()=>fetch(h.proxy,{method:"POST",body:t,signal:c.signal}):()=>fetch(t,{signal:c.signal}))().then((A=>{if(!A.ok)throw console.error("could not load tile with path : "+t),new Error("couldn't load \"".concat(t,'". Request failed with status ').concat(A.status," : ").concat(A.statusText));return A.arrayBuffer()})).then((async A=>{await async function(A){return new Promise((e=>{const t=setInterval((()=>{A.dracoLoader&&A.ktx2Loader&&(clearInterval(t),e())}),10)}))}(this.gltfLoader),this.gltfLoader.parse(A,null,(A=>{A.scene.asset=A.asset,n&&A.scene.applyMatrix4(_A),A.scene.traverse((A=>{A.isMesh&&(a&&A.applyMatrix4(_A),h.meshCallback&&h.meshCallback(A,g)),A.isPoints&&h.pointsCallback&&h.pointsCallback(A,g)})),h.cache.put(l,A.scene),h.checkSize(),h.meshReceived(h.cache,h.register,l,i,r,o,e)}))})).catch((A=>{console.error(A)}))}:t.includes(".json")&&(s=()=>{(h.proxy?()=>fetch(h.proxy,{method:"POST",body:t,signal:c.signal}):()=>fetch(t,{signal:c.signal}))().then((A=>{if(!A.ok)throw console.error("could not load tile with path : "+t),new Error("couldn't load \"".concat(t,'". Request failed with status ').concat(A.status," : ").concat(A.statusText));return A.json()})).then((A=>{h.cache.put(l,A),h.checkSize(),h.meshReceived(h.cache,h.register,l)})).catch((A=>{console.error(A)}))}),this.scheduleDownload({shouldDoDownload:()=>!A.signal.aborted&&!!h.register[l]&&Object.keys(h.register[l]).length>0,doDownload:s,distanceFunction:i,getSiblings:r,level:o,uuid:e})}}invalidate(A,e){const t=HA(A);this.register[t]&&delete this.register[t][e]}checkSize(){const A=this;let e=0;for(;A.cache.size()>A.maxCachedItems&&e<A.cache.size();){e++;const t=A.cache.head(),s=A.register[t.key];s&&(Object.keys(s).length>0?(A.cache.remove(t.key),A.cache.put(t.key,t.value)):(A.cache.remove(t.key),delete A.register[t.key],t.value.traverse((A=>{if(A.material)if(A.material.length)for(let e=0;e<A.material.length;++e)A.material[e].dispose();else A.material.dispose();A.geometry&&A.geometry.dispose()}))))}}}function vA(A,e){let t;const s=async()=>{const i=Date.now();try{await A()}catch(A){console.error(A)}finally{const A=Date.now()-i;t=setTimeout(s,A>=e?0:e-A)}};return t=setTimeout(s,e),{clearInterval:()=>clearTimeout(t)}}function HA(A){for(var e=A.split("/"),t=[],s=0,i=0;i<e.length;i++){var r=e[i];"."!==r&&""!==r&&".."!==r?t[s++]=r:".."===r&&s>0&&s--}if(0===s)return"/";var o="";for(i=0;i<s;i++)o+="/"+t[i];return o}var qA,PA=new Uint8Array(16);function OA(){if(!qA&&!(qA="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qA(PA)}const JA=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const VA=function(A){return"string"==typeof A&&JA.test(A)};for(var KA=[],jA=0;jA<256;++jA)KA.push((jA+256).toString(16).substr(1));const YA=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(KA[A[e+0]]+KA[A[e+1]]+KA[A[e+2]]+KA[A[e+3]]+"-"+KA[A[e+4]]+KA[A[e+5]]+"-"+KA[A[e+6]]+KA[A[e+7]]+"-"+KA[A[e+8]]+KA[A[e+9]]+"-"+KA[A[e+10]]+KA[A[e+11]]+KA[A[e+12]]+KA[A[e+13]]+KA[A[e+14]]+KA[A[e+15]]).toLowerCase();if(!VA(t))throw TypeError("Stringified UUID is invalid");return t};const WA=function(A,e,t){var s=(A=A||{}).random||(A.rng||OA)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e){t=t||0;for(var i=0;i<16;++i)e[t+i]=s[i];return e}return YA(s)};var XA,zA=s(975);const ZA=new A.Sphere(new A.Vector3(0,0,0),1),$A=new A.Vector3(0,0,0),Ae=new A.Vector3(0,0,0),ee=new A.Vector3(0,1,0),te=new A.Vector2(1e3,1e3),se=new A.Quaternion,ie={};class re extends A.Object3D{constructor(t){super();const s=this;if(this.proxy=t.proxy,this.displayErrors=t.displayErrors,this.displayCopyright=t.displayCopyright,t.queryParams&&(this.queryParams={...t.queryParams}),this.uuid=WA(),t.tileLoader)this.tileLoader=t.tileLoader;else{const e={};e.meshCallback=t.meshCallback?t.meshCallback:(e,t)=>{e.material.wireframe=!1,e.material.side=A.DoubleSide},e.pointsCallback=t.pointsCallback?t.pointsCallback:(A,e)=>{A.material.size=Math.pow(e,.33),A.material.sizeAttenuation=!0},e.proxy=this.proxy,e.renderer=t.renderer,this.tileLoader=new NA(e)}if(this.displayCopyright=!!t.displayCopyright,this.geometricErrorMultiplier=t.geometricErrorMultiplier?t.geometricErrorMultiplier:1,this.renderer=t.renderer,this.meshCallback=t.meshCallback,this.loadOutsideView=t.loadOutsideView,this.cameraOnLoad=t.cameraOnLoad,this.parentTile=t.parentTile,this.occlusionCullingService=t.occlusionCullingService,this.static=t.static,this.occlusionCullingService&&(this.color=new A.Color,this.color.setHex(16777215*Math.random()),this.colorID=e(255*s.color.r,0,255)<<16^e(255*s.color.g,0,255)<<8^e(255*s.color.b,0,255)<<0),this.static&&(this.matrixAutoUpdate=!1),this.childrenTiles=[],this.meshContent,this.tileContent,this.refine,this.rootPath,this.geometricError,this.boundingVolume,this.json,this.materialVisibility=!1,this.inFrustum=!0,this.level=t.level?t.level:0,this.hasMeshContent=!1,this.hasUnloadedJSONContent=!1,this.centerModel=t.centerModel,this.abortController=new AbortController,t.json)s.setup(t),t.onLoadCallback&&t.onLoadCallback(s);else if(t.url){var i=t.url;if(s.queryParams){var o="";for(let A in s.queryParams)s.queryParams.hasOwnProperty(A)&&(o+="&"+A+"="+s.queryParams[A]);i.includes("?")?i+=o:i+="?"+o.substring(1)}(s.proxy?()=>fetch(s.proxy,{method:"POST",body:i,signal:s.abortController.signal}):()=>fetch(i,{signal:s.abortController.signal}))().then((e=>{if(!e.ok)throw new Error("couldn't load \"".concat(t.url,'". Request failed with status ').concat(e.status," : ").concat(e.statusText));e.json().then((e=>{if(s.setup({rootPath:zA.dirname(t.url),json:e}),t.onLoadCallback&&t.onLoadCallback(s),s.centerModel){const e=new A.Sphere;s.boundingVolume instanceof r?e.copy(s.boundingVolume.sphere):s.boundingVolume instanceof A.Sphere&&e.copy(s.boundingVolume),this.json.boundingVolume.region&&(this.transformWGS84ToCartesian(.5*(this.json.boundingVolume.region[0]+this.json.boundingVolume.region[2]),.5*(this.json.boundingVolume.region[1]+this.json.boundingVolume.region[3]),.5*(this.json.boundingVolume.region[4]+this.json.boundingVolume.region[5]),$A),se.setFromUnitVectors($A.normalize(),ee.normalize()),s.applyQuaternion(se)),s.translateX(-e.center.x*s.scale.x),s.translateY(-e.center.y*s.scale.y),s.translateZ(-e.center.z*s.scale.z)}}))})).catch((A=>{s.displayErrors&&oe(A)}))}}setup(e){if(e.json.root?(this.json=e.json.root,this.json.refine||(this.json.refine=e.json.refine),this.json.geometricError||(this.json.geometricError=e.json.geometricError),this.json.transform||(this.json.transform=e.json.transform),this.json.boundingVolume||(this.json.boundingVolume=e.json.boundingVolume)):this.json=e.json,this.rootPath=e.json.rootPath?e.json.rootPath:e.rootPath,this.json.refine?this.refine=this.json.refine:this.refine=e.parentRefine,this.json.geometricError?this.geometricError=this.json.geometricError:this.geometricError=e.parentGeometricError,this.json.transform&&!this.centerModel){let e=new A.Matrix4;e.elements=this.json.transform,this.applyMatrix4(e)}if(this.json.boundingVolume)if(this.json.boundingVolume.box)this.boundingVolume=new r(this.json.boundingVolume.box);else if(this.json.boundingVolume.region){const e=this.json.boundingVolume.region;this.transformWGS84ToCartesian(e[0],e[1],e[4],$A),this.transformWGS84ToCartesian(e[2],e[3],e[5],Ae),$A.lerp(Ae,.5),this.boundingVolume=new A.Sphere(new A.Vector3($A.x,$A.y,$A.z),$A.distanceTo(Ae))}else if(this.json.boundingVolume.sphere){const e=this.json.boundingVolume.sphere;this.boundingVolume=new A.Sphere(new A.Vector3(e[0],e[1],e[2]),e[3])}else this.boundingVolume=e.parentBoundingVolume;else this.boundingVolume=e.parentBoundingVolume;this.json.content&&(this.json.content.uri&&this.json.content.uri.includes("json")||this.json.content.url&&this.json.content.url.includes("json")?this.hasUnloadedJSONContent=!0:this.hasMeshContent=!0,this.load())}assembleURL(A,e){A.endsWith("/")||(A+="/");const t=new URL(A);let s=t.pathname.split("/").filter((A=>""!==A)),i=e.split("/").filter((A=>""!==A));for(let A=1;A<=s.length&&!(A>=i.length);A++){if(s.slice(s.length-A,s.length).join("/")===i.slice(0,A).join("/")){for(let e=0;e<A;e++)s.pop();break}}for(;i.length>0&&".."===i[0];)s.pop(),i.shift();return"".concat(t.protocol,"//").concat(t.host,"/").concat([...s,...i].join("/"))}extractQueryParams(A,e){const t=new URL(A);for(let[A,s]of t.searchParams)e[A]=s;return t.search="",t.toString()}load(){var e=this;if(!e.deleted&&e.json.content){let s;e.json.content.uri?s=e.json.content.uri:e.json.content.url&&(s=e.json.content.url);const i=/^(?:http|https|ftp|tcp|udp):\/\/\S+/;if(i.test(e.rootPath)?i.test(s)||(s=e.assembleURL(e.rootPath,s)):zA.isAbsolute(e.rootPath)&&(s=e.rootPath+zA.sep+s),s=e.extractQueryParams(s,e.queryParams),e.queryParams){var t="";for(let A in e.queryParams)e.queryParams.hasOwnProperty(A)&&(t+="&"+A+"="+e.queryParams[A]);s.includes("?")?s+=t:s+="?"+t.substring(1)}if(s)if(s.includes(".b3dm")||s.includes(".glb")||s.includes(".gltf")){e.contentURL=s;try{e.tileLoader.get(e.abortController,this.uuid,s,(t=>{if(e.deleted)return;t.asset&&t.asset.copyright&&(t.asset.copyright.split(";").forEach((A=>{ie[A]?ie[A]++:ie[A]=1})),e.displayCopyright&&ne()),t.traverse((t=>{if((t.isMesh||t.isPoints)&&(t.layers.disable(0),e.static&&(t.matrixAutoUpdate=!1)),t.isMesh&&e.occlusionCullingService){const s=t.geometry.attributes.position,i=[];for(let A=0;A<s.count;A++)i.push(e.color.r,e.color.g,e.color.b);t.geometry.setAttribute("color",new A.Float32BufferAttribute(i,3))}}));Date.now();e.add(t),e.updateWorldMatrix(!1,!0),e.meshContent=t}),e.cameraOnLoad?()=>e.calculateDistanceToCamera(e.cameraOnLoad):()=>0,(()=>e.getSiblings()),e.level,!e.json.boundingVolume.region,!!e.json.boundingVolume.region,e.geometricError)}catch(A){e.displayErrors&&oe(A)}}else s.includes(".json")&&e.tileLoader.get(e.abortController,this.uuid,s,(A=>{e.deleted||(e.json.children||(e.json.children=[]),A.rootPath=zA.dirname(s),e.json.children.push(A),delete e.json.content,e.hasUnloadedJSONContent=!1)}))}}dispose(){const A=this;A.meshContent&&A.meshContent.asset&&A.meshContent.asset.copyright&&(A.meshContent.asset.copyright.split(";").forEach((A=>{ie[A]&&ie[A]--})),A.displayCopyright&&ne()),A.childrenTiles.forEach((A=>A.dispose())),A.deleted=!0,this.traverse((function(e){e.contentURL&&A.tileLoader.invalidate(e.contentURL,e.uuid),e.abortController&&e.abortController.abort()})),this.parent=null,this.parentTile=null,this.dispatchEvent({type:"removed"})}disposeChildren(){var A=this;A.childrenTiles.forEach((A=>A.dispose())),A.childrenTiles=[],A.children=[],A.meshContent&&A.children.push(A.meshContent)}update(e){const t=new A.Frustum;t.setFromProjectionMatrix((new A.Matrix4).multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse)),this._update(e,t)}_update(A,e){const t=this,s=t.materialVisibility;function i(A){if(t.hasMeshContent&&t.meshContent){if(A<0)return t.inFrustum=!1,void t.changeContentVisibility(!!t.loadOutsideView);if(t.inFrustum=!0,0!=t.childrenTiles.length){if(A>=t.geometricErrorMultiplier*t.geometricError)t.changeContentVisibility(!0);else if(A<t.geometricErrorMultiplier*t.geometricError&&"REPLACE"==t.refine){let A=!0;t.childrenTiles.every((e=>!!e.isReady()||(A=!1,!1))),A&&t.changeContentVisibility(!1)}}else t.changeContentVisibility(!0)}}t.boundingVolume&&t.geometricError&&(t.metric=t.calculateUpdateMetric(A,e)),t.childrenTiles.forEach((t=>t._update(A,e))),i(t.metric),function(e){if(e<0&&t.hasMeshContent)return;if(t.occlusionCullingService&&t.hasMeshContent&&!t.occlusionCullingService.hasID(t.colorID))return;if((!t.hasMeshContent||e<t.geometricErrorMultiplier*t.geometricError&&t.meshContent)&&t.json&&t.json.children&&t.childrenTiles.length!=t.json.children.length)t.json.children.forEach((e=>{if(!e.root&&!e.children&&!e.content)return;let s=new re({parentTile:t,queryParams:t.queryParams,parentGeometricError:t.geometricError,parentBoundingVolume:t.boundingVolume,parentRefine:t.refine,json:e,rootPath:t.rootPath,geometricErrorMultiplier:t.geometricErrorMultiplier,loadOutsideView:t.loadOutsideView,level:t.level+1,tileLoader:t.tileLoader,cameraOnLoad:A,occlusionCullingService:t.occlusionCullingService,renderer:t.renderer,static:t.static,centerModel:!1,displayErrors:t.displayErrors,displayCopyright:t.displayCopyright});t.childrenTiles.push(s),t.add(s)}))}(t.metric),function(A,e){if(!t.hasMeshContent)return;if(!t.inFrustum)return t.disposeChildren(),void i(A);if(t.occlusionCullingService&&!e&&t.hasMeshContent&&t.meshContent&&t.meshDisplayed&&t.areAllChildrenLoadedAndHidden())return t.disposeChildren(),void i(A);if(A>=t.geometricErrorMultiplier*t.geometricError)t.disposeChildren(),i(A)}(t.metric,s)}areAllChildrenLoadedAndHidden(){let A=!0;const e=this;return this.childrenTiles.every((t=>{if(t.hasMeshContent){if(t.childrenTiles.length>0)return A=!1,!1;if(!t.inFrustum)return!0;if(!t.materialVisibility||t.meshDisplayed)return A=!1,!1;if(e.occlusionCullingService.hasID(t.colorID))return A=!1,!1}else if(!t.areAllChildrenLoadedAndHidden())return A=!1,!1;return!0})),A}isReady(){if(!this.inFrustum)return!0;if(this.hasUnloadedJSONContent)return!1;if(!this.hasMeshContent||!this.meshContent||!this.materialVisibility){if(this.children.length>0){var A=!0;return this.childrenTiles.every((e=>!!e.isReady()||(A=!1,!1))),A}return!1}return!this.hasMeshContent||!!this.meshContent&&(!!this.materialVisibility&&!!this.meshDisplayed)}changeContentVisibility(A){const e=this;e.hasMeshContent&&e.meshContent&&(A?e.meshContent.traverse((A=>{(A.isMesh||A.isPoints)&&A.layers.enable(0)})):e.meshContent.traverse((A=>{(A.isMesh||A.isPoints)&&A.layers.disable(0)}))),e.materialVisibility!=A&&(e.materialVisibility=A,e.meshDisplayed=!0)}calculateUpdateMetric(e,t){if(this.boundingVolume instanceof r){if(ZA.copy(this.boundingVolume.sphere),ZA.applyMatrix4(this.matrixWorld),!t.intersectsSphere(ZA))return-1}else{if(!(this.boundingVolume instanceof A.Sphere))return console.error("unsupported shape"),-1;if(ZA.copy(this.boundingVolume),ZA.applyMatrix4(this.matrixWorld),!t.intersectsSphere(ZA))return-1}const s=Math.max(0,e.position.distanceTo(ZA.center)-ZA.radius);if(0==s)return 0;const i=this.matrixWorld.getMaxScaleOnAxis();this.renderer&&this.renderer.getDrawingBufferSize(te);let o=te.y,n=e.fov;e.aspect<1&&(n*=e.aspect,o=te.x);let a=2*Math.tan(.5*n*.017453292519943295)*s;return 16*window.devicePixelRatio*a/(o*i)}getSiblings(){const A=this,e=[];if(!A.parentTile)return e;let t=A.parentTile;for(;!t.hasMeshContent&&t.parentTile;)t=t.parentTile;return t.childrenTiles.forEach((t=>{if(t&&t!=A){for(;!t.hasMeshContent&&t.childrenTiles[0];)t=t.childrenTiles[0];e.push(t)}})),e}calculateDistanceToCamera(e){return this.boundingVolume instanceof r?(ZA.copy(this.boundingVolume.sphere),ZA.applyMatrix4(this.matrixWorld)):this.boundingVolume instanceof A.Sphere?(ZA.copy(this.boundingVolume),ZA.applyMatrix4(this.matrixWorld)):console.error("unsupported shape"),Math.max(0,e.position.distanceTo(ZA.center)-ZA.radius)}setGeometricErrorMultiplier(A){this.geometricErrorMultiplier=A,this.childrenTiles.forEach((e=>e.setGeometricErrorMultiplier(A)))}transformWGS84ToCartesian(A,e,t,s){const i=6378137/Math.sqrt(1-.006694384442042*Math.pow(Math.sin(e),2)),r=Math.cos(e),o=Math.cos(A),n=Math.sin(e),a=i+t,g=a*r*o,h=a*r*Math.sin(A),l=(.993305615557957*i+t)*n;s.set(g,h,l)}}function oe(A){var e=document.createElement("div");e.textContent=A,e.style.position="fixed",e.style.top="10px",e.style.left="50%",e.style.transform="translateX(-50%)",e.style.padding="10px",e.style.backgroundColor="#ff8800",e.style.color="#ffffff",e.style.zIndex="9999",document.body.appendChild(e),setTimeout((function(){e.remove()}),8e3)}function ne(){XA||(XA=document.createElement("div"));var A="";for(let e in ie)ie.hasOwnProperty(e)&&ie[e]>0&&(A+=e+", ");XA.textContent=A,XA.style.position="fixed",XA.style.bottom="20px",XA.style.left="20px",XA.style.color="white",XA.style.textShadow="2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000",XA.style.padding="10px",XA.style.backgroundColor="rgba(0, 0, 0, 0.1)",document.body.appendChild(XA)}const ae=new A.Sphere(new A.Vector3(0,0,0),1),ge=new A.Vector3(0,0,0),he=new A.Vector3(0,0,0),le=new A.Vector3(0,1,0),ce=new A.Vector2,Ie=new A.Quaternion,Ce=new A.Matrix4;class Be extends A.Object3D{constructor(e){super();const t=this;if(e.queryParams&&(this.queryParams={...e.queryParams}),this.uuid=WA(),e.tileLoader?this.tileLoader=e.tileLoader:console.error("an instanced tileset must be provided an InstancedTilesetLoader"),this.master=e.master,this.meshCallback=e.meshCallback,this.loadOutsideView=e.loadOutsideView,this.cameraOnLoad=e.cameraOnLoad,this.parentTile=e.parentTile,this.childrenTiles=[],this.jsonChildren=[],this.meshContent,this.tileContent,this.refinement,this.rootPath,this.geometricError,this.boundingVolume,this.json,this.materialVisibility=!1,this.inFrustum=!0,this.level=e.level?e.level:0,this.hasMeshContent=!1,this.hasUnloadedJSONContent=!1,this.centerModel=e.centerModel,this.deleted=!1,this.abortController=new AbortController,e.json)this.rootPath=e.json.rootPath?e.json.rootPath:e.rootPath,e.json.children&&(this.jsonChildren=e.json.children),t.setup(e),e.onLoadCallback&&e.onLoadCallback(t);else if(e.url){this.loadJson=(s,i)=>{const o=zA.dirname(i);if(t.setup({rootPath:o,json:s}),t.centerModel){const e=new A.Sphere;t.boundingVolume instanceof r?e.copy(t.boundingVolume.sphere):t.boundingVolume instanceof A.Sphere&&e.copy(t.boundingVolume),this.json.boundingVolume.region&&(t.transformWGS84ToCartesian(.5*(t.json.boundingVolume.region[0]+t.json.boundingVolume.region[2]),.5*(t.json.boundingVolume.region[1]+t.json.boundingVolume.region[3]),.5*(t.json.boundingVolume.region[4]+t.json.boundingVolume.region[5]),ge),Ie.setFromUnitVectors(ge.normalize(),le.normalize()),t.master.applyQuaternion(Ie),t.master.updateWorldMatrix(!1,!1)),Ce.makeTranslation(-e.center.x*t.scale.x,-e.center.y*t.scale.y,-e.center.z*t.scale.z),t.master.matrix.multiply(Ce),t.master.matrix.decompose(t.master.position,t.master.quaternion,t.master.scale)}e.onLoadCallback&&e.onLoadCallback(t)};var s=e.url;if(t.queryParams){var i="";for(let A in t.queryParams)t.queryParams.hasOwnProperty(A)&&(i+="&"+A+"="+t.queryParams[A]);s.includes("?")?s+=i:s+="?"+i.substring(1)}t.tileLoader.get(t.abortController,s,t.uuid,t)}}setup(e){if(this.isSetup=!0,e.json.root?(this.json=e.json.root,this.jsonChildren=this.json.children,this.json.refinement||(this.json.refinement=e.json.refinement),this.json.geometricError||(this.json.geometricError=e.json.geometricError),this.json.transform||(this.json.transform=e.json.transform),this.json.boundingVolume||(this.json.boundingVolume=e.json.boundingVolume)):this.json=e.json,this.rootPath=e.json.rootPath?e.json.rootPath:e.rootPath,this.json.refinement?this.refinement=this.json.refinement:this.refinement=e.parentRefinement,this.json.geometricError?this.geometricError=this.json.geometricError:this.geometricError=e.parentGeometricError,this.json.transform&&!this.centerModel){let e=new A.Matrix4;e.elements=this.json.transform,this.master.applyMatrix4(e)}if(this.json.boundingVolume)if(this.json.boundingVolume.box)this.boundingVolume=new r(this.json.boundingVolume.box);else if(this.json.boundingVolume.region){const e=this.json.boundingVolume.region;this.transformWGS84ToCartesian(e[0],e[1],e[4],ge),this.transformWGS84ToCartesian(e[2],e[3],e[5],he),ge.lerp(he,.5),this.boundingVolume=new A.Sphere(new A.Vector3(ge.x,ge.y,ge.z),ge.distanceTo(he))}else if(this.json.boundingVolume.sphere){const e=this.json.boundingVolume.sphere;this.boundingVolume=new A.Sphere(new A.Vector3(e[0],e[1],e[2]),e[3])}else this.boundingVolume=e.parentBoundingVolume;else this.boundingVolume=e.parentBoundingVolume;this.json.content&&(this.json.content.uri&&this.json.content.uri.includes("json")||this.json.content.url&&this.json.content.url.includes("json")?this.hasUnloadedJSONContent=!0:this.hasMeshContent=!0,this.load())}isAbsolutePathOrURL(A){const e=/^(?:http|https|ftp|tcp|udp):\/\/\S+/.test(A),t=A.startsWith("/")&&!A.startsWith("//");return e||t}assembleURL(A,e){A.endsWith("/")||(A+="/");const t=new URL(A);let s=t.pathname.split("/").filter((A=>""!==A)),i=e.split("/").filter((A=>""!==A));for(let A=1;A<=s.length&&!(A>=i.length);A++){if(s.slice(s.length-A,s.length).join("/")===i.slice(0,A).join("/")){for(let e=0;e<A;e++)s.pop();break}}for(;i.length>0&&".."===i[0];)s.pop(),i.shift();return"".concat(t.protocol,"//").concat(t.host,"/").concat([...s,...i].join("/"))}extractQueryParams(A,e){const t=new URL(A);for(let[A,s]of t.searchParams)e[A]=s;return t.search="",t.toString()}load(){var A=this;if(!A.deleted){if(A.json.content){let t;A.json.content.uri?t=A.json.content.uri:A.json.content.url&&(t=A.json.content.url);const s=/^(?:http|https|ftp|tcp|udp):\/\/\S+/;if(s.test(A.rootPath)?s.test(t)||(t=A.assembleURL(A.rootPath,t)):zA.isAbsolute(A.rootPath)&&(t=A.rootPath+zA.sep+t),t=A.extractQueryParams(t,A.queryParams),A.queryParams){var e="";for(let t in A.queryParams)A.queryParams.hasOwnProperty(t)&&(e+="&"+t+"="+A.queryParams[t]);t.includes("?")?t+=e:t+="?"+e.substring(1)}t&&(t.includes(".b3dm")||t.includes(".glb")||t.includes(".gltf")?(A.contentURL=t,A.tileLoader.get(A.abortController,t,A.uuid,A,A.cameraOnLoad?()=>A.calculateDistanceToCamera(A.cameraOnLoad):()=>0,(()=>A.getSiblings()),A.level,!A.json.boundingVolume.region,!!A.json.boundingVolume.region,A.geometricError)):t.includes(".json")&&A.tileLoader.get(A.abortController,t,A.uuid,A))}A.matrixWorldNeedsUpdate=!0,A.updateWorldMatrix(!0,!0)}}loadMesh(A){this.deleted||(this.meshContent=A)}loadJson(A,e){this.deleted||(this.json.children&&(this.jsonChildren=this.json.children),A.rootPath=zA.dirname(e),this.jsonChildren.push(A),this.hasUnloadedJSONContent=!1)}dispose(){const A=this;A.childrenTiles.forEach((A=>A.dispose())),A.deleted=!0,A.abortController&&A.abortController.abort(),this.parent=null,this.parentTile=null,this.dispatchEvent({type:"removed"})}disposeChildren(){this.childrenTiles.forEach((A=>A.dispose())),this.childrenTiles=[]}_update(A,e){const t=this;t.materialVisibility;function s(A){if(t.hasMeshContent&&t.meshContent){if(A<0)return t.inFrustum=!1,void t.changeContentVisibility(!!t.loadOutsideView);if(t.inFrustum=!0,0!=t.childrenTiles.length){if(A>=t.master.geometricErrorMultiplier*t.geometricError)t.changeContentVisibility(!0);else if(A<t.master.geometricErrorMultiplier*t.geometricError){let A=!0;t.childrenTiles.every((e=>!!e.isReady()||(A=!1,!1))),A&&t.changeContentVisibility(!1)}}else t.changeContentVisibility(!0)}}t.boundingVolume&&t.geometricError&&(t.metric=t.calculateUpdateMetric(A,e)),t.childrenTiles.forEach((t=>t._update(A,e))),s(t.metric),function(e){if(e<0&&t.hasMeshContent)return;if((!t.hasMeshContent&&t.rootPath||e<t.master.geometricErrorMultiplier*t.geometricError&&t.meshContent)&&t.json&&t.jsonChildren&&t.childrenTiles.length!=t.jsonChildren.length)t.jsonChildren.forEach((e=>{if(!e.root&&!e.children&&!e.content)return;let s=new Be({parentTile:t,queryParams:t.queryParams,parentGeometricError:t.geometricError,parentBoundingVolume:t.boundingVolume,parentRefinement:t.refinement,json:e,rootPath:t.rootPath,loadOutsideView:t.loadOutsideView,level:t.level+1,tileLoader:t.tileLoader,cameraOnLoad:A,master:t.master,centerModel:!1});t.childrenTiles.push(s)}))}(t.metric),function(A,e){if(!t.hasMeshContent)return;if(!t.inFrustum)return t.disposeChildren(),void s(A);if(A>=t.master.geometricErrorMultiplier*t.geometricError)t.disposeChildren(),s(A)}(t.metric)}areAllChildrenLoadedAndHidden(){let A=!0;return this.childrenTiles.every((e=>{if(e.hasMeshContent){if(e.childrenTiles.length>0)return A=!1,!1;if(!e.inFrustum)return!0;if(!e.materialVisibility||e.meshesToDisplay!=e.meshesDisplayed)return A=!1,!1}else if(!e.areAllChildrenLoadedAndHidden())return A=!1,!1;return!0})),A}isReady(){if(!this.inFrustum)return!0;if(this.hasUnloadedJSONContent)return!1;if(!this.hasMeshContent||!this.meshContent||!this.materialVisibility){if(this.childrenTiles.length>0){var A=!0;return this.childrenTiles.every((e=>!!e.isReady()||(A=!1,!1))),A}return!1}return!this.hasMeshContent||!!this.meshContent&&!!this.materialVisibility}changeContentVisibility(A){this.materialVisibility=A}calculateUpdateMetric(e,t){if(this.boundingVolume instanceof r){if(ae.copy(this.boundingVolume.sphere),ae.applyMatrix4(this.master.matrixWorld),!t.intersectsSphere(ae))return-1}else{if(!(this.boundingVolume instanceof A.Sphere))return console.error("unsupported shape"),-1;if(ae.copy(this.boundingVolume),ae.applyMatrix4(this.master.matrixWorld),!t.intersectsSphere(ae))return-1}const s=Math.max(0,e.position.distanceTo(ae.center)-ae.radius);if(0==s)return 0;const i=this.master.matrixWorld.getMaxScaleOnAxis();this.master.renderer.getDrawingBufferSize(ce);let o=ce.y,n=e.fov;e.aspect<1&&(n*=e.aspect,o=ce.x);let a=2*Math.tan(.5*n*.017453292519943295)*s;return 16*window.devicePixelRatio*a/(o*i)}getSiblings(){const A=this,e=[];if(!A.parentTile)return e;let t=A.parentTile;for(;!t.hasMeshContent&&t.parentTile;)t=t.parentTile;return t.childrenTiles.forEach((t=>{if(t&&t!=A){for(;!t.hasMeshContent&&t.childrenTiles[0];)t=t.childrenTiles[0];e.push(t)}})),e}calculateDistanceToCamera(e){return this.boundingVolume instanceof r?(ae.copy(this.boundingVolume.sphere),ae.applyMatrix4(this.master.matrixWorld)):this.boundingVolume instanceof A.Sphere?(ae.copy(this.boundingVolume),ae.applyMatrix4(this.master.matrixWorld)):console.error("unsupported shape"),Math.max(0,e.position.distanceTo(ae.center)-ae.radius)}getWorldMatrix(){return this.master.matrixWorld}transformWGS84ToCartesian(A,e,t,s){const i=6378137/Math.sqrt(1-.006694384442042*Math.pow(Math.sin(e),2)),r=Math.cos(e),o=Math.cos(A),n=Math.sin(e),a=i+t,g=a*r*o,h=a*r*Math.sin(A),l=(.993305615557957*i+t)*n;s.set(g,h,l)}}class Ee extends A.Object3D{constructor(A){super(),A.master=this,this.renderer=A.renderer,this.geometricErrorMultiplier=A.geometricErrorMultiplier?A.geometricErrorMultiplier:1,this.tileset=new Be(A),A.static&&(this.matrixAutoUpdate=!1)}update(e,t){if(t)this.tileset._update(e,t);else{const t=new A.Frustum;t.setFromProjectionMatrix((new A.Matrix4).multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse)),this.tileset._update(e,t)}}updateWithFrustum(A,e){this.tileset._update(A,e)}setGeometricErrorMultiplier(A){this.geometricErrorMultiplier=A||1}}class de{constructor(e){const t=this;t.scene=e,t.instancedTiles=[],t.instancedMesh,t.reuseableMatrix=new A.Matrix4}addInstance(A){const e=this;A.added=!0,A.listOMesh=e.instancedTiles,e.instancedTiles.push(A),e.instancedMesh&&A.loadMesh(e.instancedMesh)}addToScene(){const e=this;e.instancedMesh.setMatrixAt(0,new A.Matrix4),e.instancedMesh.instanceMatrix.needsUpdate=!0,e.instancedMesh.count=1,e.scene.add(e.instancedMesh),e.instancedMesh.onAfterRender=()=>{delete e.instancedMesh.onAfterRender,e.instancedMesh.displayedOnce=!0}}setObject(A){const e=this;e.instancedMesh=A,e.scene.children.includes(A)||this.addToScene();for(let A=0;A<e.instancedTiles.length;A++)e.instancedTiles[A].loadMesh(e.instancedMesh)}update(){const A=this;for(let e=A.instancedTiles.length-1;e>=0;e--)A.instancedTiles[e].deleted&&A.instancedTiles.splice(e,1);if(A.instancedMesh){A.instancedMesh.count=0,A.instancedMesh.instancedTiles=[];for(let e=0;e<A.instancedTiles.length;e++)A.instancedTiles[e].meshContent=A.instancedMesh,A.instancedTiles[e].materialVisibility&&A.instancedTiles[e].meshContent&&(A.instancedMesh.count++,A.reuseableMatrix.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),A.reuseableMatrix.multiply(A.instancedTiles[e].master.matrixWorld),A.reuseableMatrix.multiply(A.instancedMesh.baseMatrix),A.instancedMesh.setMatrixAt(A.instancedMesh.count-1,A.reuseableMatrix),A.instancedMesh.instancedTiles.push(A.instancedTiles[e]));A.instancedMesh.instanceMatrix.needsUpdate=!0,A.instancedMesh.needsUpdate=!0,A.instancedMesh.computeBoundingSphere()}}getCount(){return this.instancedTiles.length}dispose(){const A=this;return!(A.instancedTiles.length>0)&&(!!A.instancedMesh&&(A.scene.remove(A.instancedMesh),A.instancedMesh.traverse((A=>{if(A.dispose&&A.dispose(),A.material)if(A.material.length)for(let e=0;e<A.material.length;++e)A.material[e].dispose();else A.material.dispose();A.geometry&&A.geometry.dispose()})),A.instancedMesh.dispose(),!0))}}class ue{constructor(){const A=this;A.count=0,A.json,A.instancedTiles=[]}addInstance(A){this.instancedTiles.push(A),this.json&&A.loadJson(this.json,this.url)}setObject(A,e){const t=this;t.json=A,t.url=e;for(let A=0;A<t.instancedTiles.length;A++)t.instancedTiles[A].loadJson(t.json,t.url)}getCount(){return this.instancedTiles.length}update(){const A=this;for(let e=A.instancedTiles.length-1;e>=0;e--)A.instancedTiles[e].deleted&&A.instancedTiles.splice(e,1)}dispose(){return!(!this.json||0!=this.instancedTiles.length)}}const Qe=new A.Matrix4;Qe.set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1);class fe{constructor(A,e){this.maxCachedItems=100,this.maxInstances=1,this.proxy=e.proxy,e&&(this.meshCallback=e.meshCallback,this.pointsCallback=e.pointsCallback,e.maxCachedItems&&(this.maxCachedItems=e.maxCachedItems),e.maxInstances&&(this.maxInstances=e.maxInstances)),this.gltfLoader=new h;const t=new oA;if(t.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.4.3/"),this.gltfLoader.setDRACOLoader(t),e&&e.renderer){const A=new mA;A.setTranscoderPath("https://storage.googleapis.com/ogc-3d-tiles/basis/").detectSupport(e.renderer),this.gltfLoader.setKTX2Loader(A),this.b3dmDecoder=new UA(e.renderer)}else this.b3dmDecoder=new UA(null);this.cache=new o.LinkedHashMap,this.scene=A,this.ready=[],this.downloads=[],this.nextReady=[],this.nextDownloads=[],this.init()}update(){this.cache._data.forEach((A=>{A.update()}))}init(){const A=this;me((()=>{A.download()}),10),me((()=>{const e=Date.now();let t=0;do{t=A.loadBatch()}while(t>0&&Date.now()-e<=0)}),10)}download(){const e=this;if(0!=e.nextDownloads.length||(e.getNextDownloads(),0!=e.nextDownloads.length))for(;e.nextDownloads.length>0;){const t=e.nextDownloads.shift();if(t){if(t.path.includes(".b3dm"))(e.proxy?()=>fetch(e.proxy,{method:"POST",body:t.path}):()=>fetch(t.path))().then((A=>{if(!A.ok)throw console.error("could not load tile with path : "+t.path),new Error("couldn't load \"".concat(t.path,'". Request failed with status ').concat(A.status," : ").concat(A.statusText));return A.arrayBuffer()})).then((A=>this.b3dmDecoder.parseB3DMInstanced(A,e.meshCallback,e.maxInstances,t.sceneZupToYup,t.meshZupToYup))).then((A=>{A.frustumCulled=!1,t.tile.setObject(A),e.ready.unshift(t)})).catch((A=>console.error(A)));if(t.path.includes(".glb")||t.path.includes(".gltf"))(e.proxy?()=>fetch(e.proxy,{method:"POST",body:t.path}):()=>fetch(t.path))().then((A=>A.arrayBuffer())).then((async s=>{await pe(this.gltfLoader),this.gltfLoader.parse(s,(s=>{let i;s.scene.asset=s.asset,t.sceneZupToYup&&s.scene.applyMatrix4(Qe),s.scene.traverse((A=>{A.geometricError=t.geometricError,A.isMesh&&(t.meshZupToYup&&A.applyMatrix4(Qe),e.meshCallback&&e.meshCallback(A,A.geometricError)),A.isPoints&&console.error("instanced point cloud is not supported")})),s.scene.updateWorldMatrix(!1,!0),s.scene.traverse((t=>{t.isMesh&&(i=new A.InstancedMesh(t.geometry,t.material,e.maxInstances),i.baseMatrix=t.matrixWorld)})),e.ready.unshift(t),i?(i.frustumCulled=!1,t.tile.setObject(i)):s.scene.traverse((A=>{A.dispose&&A.dispose(),A.material&&A.material.dispose()}))}))}),(A=>{throw new Error("could not load tile : "+t.path)}));else if(t.path.includes(".json")){(e.proxy?()=>fetch(e.proxy,{method:"POST",body:t.path}):()=>fetch(t.path))().then((A=>{if(!A.ok)throw console.error("could not load tile with path : "+t.path),new Error("couldn't load \"".concat(t.path,'". Request failed with status ').concat(A.status," : ").concat(A.statusText));return A.json()})).then((A=>{t.tile.setObject(A,t.path),e.ready.unshift(t)})).catch((A=>console.error(A)))}}}}loadBatch(){if(0==this.nextReady.length&&(this.getNextReady(),0==this.nextReady.length))return 0;return this.nextReady.shift()?1:0}getNextReady(){let A=Number.MAX_VALUE,e=-1;for(let A=this.ready.length-1;A>=0;A--)this.ready[A].distanceFunction||this.nextReady.push(this.ready.splice(A,1)[0]);if(!(this.nextReady.length>0)){for(let t=this.ready.length-1;t>=0;t--){const s=this.ready[t].distanceFunction()*this.ready[t].level;s<A&&(A=s,e=t)}if(e>=0){const A=this.ready.splice(e,1).pop();this.nextReady.push(A);const t=A.getSiblings();for(let A=this.ready.length-1;A>=0;A--)t.includes(this.ready[A].uuid)&&this.nextready.push(this.ready.splice(A,1).pop())}}}get(A,e,t,s,i,r,o,n,a,g){const h=this,l=function(A){for(var e=A.split("/"),t=[],s=0,i=0;i<e.length;i++){var r=e[i];"."!==r&&""!==r&&".."!==r?t[s++]=r:".."===r&&s>0&&s--}if(0===s)return"/";var o="";for(i=0;i<s;i++)o+="/"+t[i];return o}(e);if(!(e.includes(".b3dm")||e.includes(".json")||e.includes(".glb")||e.includes(".gltf")))return void console.error("the 3DTiles cache can only be used to load B3DM, gltf and json data");const c=h.cache.get(l);if(c)c.addInstance(s);else if(e.includes(".b3dm")||e.includes(".glb")||e.includes(".gltf")){const c=new de(h.scene);c.addInstance(s),h.cache.put(l,c),h.checkSize();const I=new AbortController;A.signal.addEventListener("abort",(()=>{0==c.getCount()&&I.abort()})),this.downloads.push({abortController:I,tile:c,key:l,path:e,distanceFunction:i,getSiblings:r,level:o,uuid:t,sceneZupToYup:n,meshZupToYup:a,geometricError:g,shouldDoDownload:()=>!0})}else if(e.includes(".json")){const t=new ue;t.addInstance(s),h.cache.put(l,t),h.checkSize();const n=new AbortController;A.signal.addEventListener("abort",(()=>{0==t.getCount()&&n.abort()})),this.downloads.push({abortController:n,tile:t,key:l,path:e,distanceFunction:i,getSiblings:r,level:o,shouldDoDownload:()=>!0})}}getNextDownloads(){let A=Number.MAX_VALUE,e=-1;for(let A=this.downloads.length-1;A>=0;A--){const e=this.downloads[A];e.shouldDoDownload()?e.distanceFunction||this.nextDownloads.push(this.downloads.splice(A,1)[0]):this.downloads.splice(A,1)}if(!(this.nextDownloads.length>0)){for(let t=this.downloads.length-1;t>=0;t--){const s=this.downloads[t],i=s.distanceFunction()*s.level;i<A&&(A=i,e=t)}if(e>=0){const A=this.downloads.splice(e,1).pop();this.nextDownloads.push(A);const t=A.getSiblings();for(let A=this.downloads.length-1;A>=0;A--)t.includes(this.downloads[A].uuid)&&this.nextDownloads.push(this.downloads.splice(A,1).pop())}}}checkSize(){const A=this;let e=0;for(;A.cache.size()>A.maxCachedItems&&e<A.cache.size();){e++;const t=A.cache.head();A.cache.remove(t.key),t.value.dispose()||A.cache.put(t.key,t.value)}}}async function pe(A){return new Promise((e=>{const t=setInterval((()=>{A.dracoLoader&&A.ktx2Loader&&(clearInterval(t),e())}),10)}))}function me(A,e){let t;const s=async()=>{const i=Date.now();try{await A()}catch(A){console.error(A)}finally{const A=Date.now()-i;t=setTimeout(s,A>=e?0:e-A)}};return t=setTimeout(s,e),{clearInterval:()=>clearTimeout(t)}}})(),i})()));
3
3
  //# sourceMappingURL=threedtiles.min.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jdultra/threedtiles",
3
- "version": "9.2.10",
3
+ "version": "9.2.11",
4
4
  "description": "An OGC 3DTiles viewer for Three.js",
5
5
  "main": "dist/threedtiles.min.js",
6
6
  "files": [
@@ -28,7 +28,7 @@
28
28
  "author": "Emeric Beaufays",
29
29
  "license": "MIT",
30
30
  "peerDependencies": {
31
- "three": "0.161.0"
31
+ "three": "0.155.0"
32
32
  },
33
33
  "dependencies": {
34
34
  "js-utils-z": "^1.2.1",