@abi-software/scaffoldvuer 1.13.0-beta.1 → 1.13.0-beta.2

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.
@@ -31804,7 +31804,7 @@ const D4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31804
31804
  /* 2 */
31805
31805
  /***/
31806
31806
  (o) => {
31807
- o.exports = /* @__PURE__ */ JSON.parse('{"name":"zincjs","version":"1.16.0","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}');
31807
+ o.exports = /* @__PURE__ */ JSON.parse('{"name":"zincjs","version":"1.16.1","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}');
31808
31808
  },
31809
31809
  /* 3 */
31810
31810
  /***/
@@ -33090,7 +33090,7 @@ const D4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
33090
33090
  g = h ? new l(f, 0.015, h.getStyle()) : new l(f, 0.015), g.fontFace = "Asap", g.fontWeight = 700, g.material.map.generateMipmaps = !1, g.material.sizeAttenuation = !1, g.center.x = -0.05, g.center.y = 0, this.getPosition = () => g ? [g.position.x, g.position.y, g.position.z] : [0, 0, 0], this.setPosition = (p, u, y) => {
33091
33091
  g && g.position.set(p, u, y);
33092
33092
  }, this.setColour = (p) => {
33093
- g.color = p.getStyle();
33093
+ console.log(g), p && (g.color = p.getStyle());
33094
33094
  }, this.setScale = (p) => {
33095
33095
  g && 0 < p && g.scale.set(p, p, 1);
33096
33096
  }, this.dispose = () => {
@@ -33621,6 +33621,12 @@ const D4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
33621
33621
  }
33622
33622
  this.region && (this.region.pickableUpdateRequired = !0);
33623
33623
  }
33624
+ }, this.setColourHex = function(v) {
33625
+ this._lod._material.color.setHex(v), this._lod._secondaryMaterial && this._lod._secondaryMaterial.color.setHex(v);
33626
+ for (var m = 0; m < u.length; m++) u[m] && u[m].setColour(this._lod._material.color);
33627
+ }, this.setColour = (v) => {
33628
+ this._lod.setColour(v);
33629
+ for (var m = 0; m < u.length; m++) u[m] && u[m].setColour(this._lod._material.color);
33624
33630
  }, this.setSize = (v) => {
33625
33631
  this.morph && this.morph.material && (this.morph.material.size = v, this.morph.material.needsUpdate = !0);
33626
33632
  }, this.setSizeAttenuation = (v) => {
@@ -3179,9 +3179,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3179
3179
  `),s=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP"," vec4 texelGlossiness = texture2D( glossinessMap, vUv );"," // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture"," glossinessFactor *= texelGlossiness.a;","#endif"].join(`
3180
3180
  `),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor;"].join(`
3181
3181
  `),l={specular:{value:new Le().setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=l,this.onBeforeCompile=function(u){for(const c in l)u.uniforms[c]=l[c];u.fragmentShader=u.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",i).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",s).replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return l.specular.value},set:function(u){l.specular.value=u}},specularMap:{get:function(){return l.specularMap.value},set:function(u){l.specularMap.value=u,u?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return l.glossiness.value},set:function(u){l.glossiness.value=u}},glossinessMap:{get:function(){return l.glossinessMap.value},set:function(u){l.glossinessMap.value=u,u?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class GB{constructor(){this.name=nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return cf}extendParams(e,t,i){const r=t.extensions[this.name];e.color=new Le(1,1,1),e.opacity=1;const s=[];if(Array.isArray(r.diffuseFactor)){const o=r.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(r.diffuseTexture!==void 0&&s.push(i.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new Le(0,0,0),e.glossiness=r.glossinessFactor!==void 0?r.glossinessFactor:1,e.specular=new Le(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),r.specularGlossinessTexture!==void 0){const o=r.specularGlossinessTexture;s.push(i.assignTexture(e,"glossinessMap",o)),s.push(i.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){const t=new cf(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=er,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class HB{constructor(){this.name=nt.KHR_MESH_QUANTIZATION}}class Mo extends ii{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r*3+r;for(let o=0;o!==r;o++)t[o]=i[s+o];return t}}Mo.prototype.beforeStart_=Mo.prototype.copySampleValue_,Mo.prototype.afterEnd_=Mo.prototype.copySampleValue_,Mo.prototype.interpolate_=function(n,e,t,i){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=o*2,u=o*3,c=i-e,f=(t-e)/c,h=f*f,p=h*f,v=n*u,m=v-u,d=-2*p+3*h,b=p-h,y=1-d,g=b-h+f;for(let w=0;w!==o;w++){const A=s[m+w+o],S=s[m+w+l]*c,M=s[v+w+o],F=s[v+w]*c;r[w]=y*A+g*S+d*M+b*F}return r};const Ii={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},Na={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ix={9728:wt,9729:vt,9984:Xo,9985:Rl,9986:Yo,9987:xi},rx={33071:zt,33648:Es,10497:Qi},sx={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},uf={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},yr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},WB={CUBICSPLINE:void 0,LINEAR:Ir,STEP:Rs},df={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ox(n,e){return typeof n!="string"||n===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(n)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(n)||/^data:.*,.*$/i.test(n)||/^blob:.*$/i.test(n)?n:e+n)}function jB(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Zr({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Ji})),n.DefaultMaterial}function Ba(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function rs(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function $B(n,e,t){let i=!1,r=!1;for(let l=0,u=e.length;l<u;l++){const c=e[l];if(c.POSITION!==void 0&&(i=!0),c.NORMAL!==void 0&&(r=!0),i&&r)break}if(!i&&!r)return Promise.resolve(n);const s=[],o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];if(i){const f=c.POSITION!==void 0?t.getDependency("accessor",c.POSITION):n.attributes.position;s.push(f)}if(r){const f=c.NORMAL!==void 0?t.getDependency("accessor",c.NORMAL):n.attributes.normal;o.push(f)}}return Promise.all([Promise.all(s),Promise.all(o)]).then(function(l){const u=l[0],c=l[1];return i&&(n.morphAttributes.position=u),r&&(n.morphAttributes.normal=c),n.morphTargetsRelative=!0,n})}function ZB(n,e){if(n.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)n.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(n.morphTargetInfluences.length===t.length){n.morphTargetDictionary={};for(let i=0,r=t.length;i<r;i++)n.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function XB(n){const e=n.extensions&&n.extensions[nt.KHR_DRACO_MESH_COMPRESSION];let t;return e?t="draco:"+e.bufferView+":"+e.indices+":"+ax(e.attributes):t=n.indices+":"+ax(n.attributes)+":"+n.mode,t}function ax(n){let e="";const t=Object.keys(n).sort();for(let i=0,r=t.length;i<r;i++)e+=t[i]+":"+n[t[i]]+";";return e}function hf(n){switch(n){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.")}}class YB{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new FB,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.textureCache={},this.nodeNamesUsed={},typeof createImageBitmap<"u"&&/Firefox/.test(navigator.userAgent)===!1?this.textureLoader=new $h(this.options.manager):this.textureLoader=new Dh(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new vn(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const l={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};Ba(s,l,r),rs(l,r),Promise.all(i._invokeAll(function(u){return u.afterRoot&&u.afterRoot(l)})).then(function(){e(l)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r<s;r++){const o=t[r].joints;for(let l=0,u=o.length;l<u;l++)e[o[l]].isBone=!0}for(let r=0,s=e.length;r<s;r++){const o=e[r];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(i[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;const r=i.clone();return r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const r=e(t[i]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let r=0;r<t.length;r++){const s=e(t[r]);s&&i.push(s)}return i}getDependency(e,t){const i=e+":"+t;let r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this.loadAnimation(t);break;case"camera":r=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(i,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(s,o){return i.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[nt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,o){i.load(ox(t.uri,r.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){const r=t.byteLength||0,s=t.byteOffset||0;return i.slice(s,s+r)})}loadAccessor(e){const t=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0)return Promise.resolve(null);const s=[];return r.bufferView!==void 0?s.push(this.getDependency("bufferView",r.bufferView)):s.push(null),r.sparse!==void 0&&(s.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(s).then(function(o){const l=o[0],u=sx[r.type],c=Na[r.componentType],f=c.BYTES_PER_ELEMENT,h=f*u,p=r.byteOffset||0,v=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,m=r.normalized===!0;let d,b;if(v&&v!==h){const y=Math.floor(p/v),g="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+y+":"+r.count;let w=t.cache.get(g);w||(d=new c(l,y*v,r.count*v/f),w=new dr(d,v/f),t.cache.add(g,w)),b=new Fi(w,u,p%v/f,m)}else l===null?d=new c(r.count*u):d=new c(l,p,r.count*u),b=new Ze(d,u,m);if(r.sparse!==void 0){const y=sx.SCALAR,g=Na[r.sparse.indices.componentType],w=r.sparse.indices.byteOffset||0,A=r.sparse.values.byteOffset||0,S=new g(o[1],w,r.sparse.count*y),M=new c(o[2],A,r.sparse.count*u);l!==null&&(b=new Ze(b.array.slice(),b.itemSize,b.normalized));for(let F=0,R=S.length;F<R;F++){const T=S[F];if(b.setX(T,M[F*u]),u>=2&&b.setY(T,M[F*u+1]),u>=3&&b.setZ(T,M[F*u+2]),u>=4&&b.setW(T,M[F*u+3]),u>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,i=this.options,r=t.textures[e],s=t.images[r.source];let o=this.textureLoader;if(s.uri){const l=i.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,i){const r=this,s=this.json,o=this.options,l=s.textures[e],u=(t.uri||t.bufferView)+":"+l.sampler;if(this.textureCache[u])return this.textureCache[u];const c=self.URL||self.webkitURL;let f=t.uri||"",h=!1,p=!0;const v=f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||v)&&(p=!1),t.bufferView!==void 0)f=r.getDependency("bufferView",t.bufferView).then(function(d){if(t.mimeType==="image/png"){const y=new DataView(d,25,1).getUint8(0,!1);p=y===6||y===4||y===3}h=!0;const b=new Blob([d],{type:t.mimeType});return f=c.createObjectURL(b),f});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const m=Promise.resolve(f).then(function(d){return new Promise(function(b,y){let g=b;i.isImageBitmapLoader===!0&&(g=function(w){const A=new Mt(w);A.needsUpdate=!0,b(A)}),i.load(ox(d,o.path),g,void 0,y)})}).then(function(d){h===!0&&c.revokeObjectURL(f),d.flipY=!1,l.name&&(d.name=l.name),p||(d.format=Mi);const y=(s.samplers||{})[l.sampler]||{};return d.magFilter=ix[y.magFilter]||vt,d.minFilter=ix[y.minFilter]||xi,d.wrapS=rx[y.wrapS]||Qi,d.wrapT=rx[y.wrapT]||Qi,r.associations.set(d,{type:"textures",index:e}),d}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",f),null});return this.textureCache[u]=m,m}assignTexture(e,t,i){const r=this;return this.getDependency("texture",i.index).then(function(s){if(i.texCoord!==void 0&&i.texCoord!=0&&!(t==="aoMap"&&i.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),r.extensions[nt.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[nt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=r.associations.get(s);s=r.extensions[nt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),r.associations.set(s,l)}}e[t]=s})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0,l=Object.keys(t.morphAttributes).length>0,u=l&&t.morphAttributes.normal!==void 0;if(e.isPoints){const c="PointsMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new hr,Ft.prototype.copy.call(f,i),f.color.copy(i.color),f.map=i.map,f.sizeAttenuation=!1,this.cache.add(c,f)),i=f}else if(e.isLine){const c="LineBasicMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new Vt,Ft.prototype.copy.call(f,i),f.color.copy(i.color),this.cache.add(c,f)),i=f}if(r||s||o||l){let c="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),r&&(c+="vertex-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:"),l&&(c+="morph-targets:"),u&&(c+="morph-normals:");let f=this.cache.get(c);f||(f=i.clone(),s&&(f.vertexColors=!0),o&&(f.flatShading=!0),l&&(f.morphTargets=!0),u&&(f.morphNormals=!0),r&&(f.vertexTangents=!0,f.normalScale&&(f.normalScale.y*=-1),f.clearcoatNormalScale&&(f.clearcoatNormalScale.y*=-1)),this.cache.add(c,f),this.associations.set(f,this.associations.get(i))),i=f}i.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=i}getMaterialType(){return Zr}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const l={},u=s.extensions||{},c=[];if(u[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const h=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else if(u[nt.KHR_MATERIALS_UNLIT]){const h=r[nt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else{const h=s.pbrMetallicRoughness||{};if(l.color=new Le(1,1,1),l.opacity=1,Array.isArray(h.baseColorFactor)){const p=h.baseColorFactor;l.color.fromArray(p),l.opacity=p[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(l,"map",h.baseColorTexture)),l.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,l.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(l,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(l,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,l)})))}s.doubleSided===!0&&(l.side=Ki);const f=s.alphaMode||df.OPAQUE;return f===df.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,f===df.MASK&&(l.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==cn&&(c.push(t.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new Ae(1,-1),s.normalTexture.scale!==void 0&&l.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==cn&&(c.push(t.assignTexture(l,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(l.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==cn&&(l.emissive=new Le().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==cn&&c.push(t.assignTexture(l,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===cf?h=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):h=new o(l),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Br),h.emissiveMap&&(h.emissiveMap.encoding=Br),rs(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&Ba(r,h,s),h})}createUniqueName(e){const t=et.sanitizeNodeName(e||"");let i=t;for(let r=1;this.nodeNamesUsed[i];++r)i=t+"_"+r;return this.nodeNamesUsed[i]=!0,i}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(l){return i[nt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(l,t).then(function(u){return cx(u,l,t)})}const o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l],f=XB(c),h=r[f];if(h)o.push(h.promise);else{let p;c.extensions&&c.extensions[nt.KHR_DRACO_MESH_COMPRESSION]?p=s(c):p=cx(new ke,c,t),r[f]={primitive:c,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,i=this.json,r=this.extensions,s=i.meshes[e],o=s.primitives,l=[];for(let u=0,c=o.length;u<c;u++){const f=o[u].material===void 0?jB(this.cache):this.getDependency("material",o[u].material);l.push(f)}return l.push(t.loadGeometries(o)),Promise.all(l).then(function(u){const c=u.slice(0,u.length-1),f=u[u.length-1],h=[];for(let v=0,m=f.length;v<m;v++){const d=f[v],b=o[v];let y;const g=c[v];if(b.mode===Ii.TRIANGLES||b.mode===Ii.TRIANGLE_STRIP||b.mode===Ii.TRIANGLE_FAN||b.mode===void 0)y=s.isSkinnedMesh===!0?new ga(d,g):new St(d,g),y.isSkinnedMesh===!0&&!y.geometry.attributes.skinWeight.normalized&&y.normalizeSkinWeights(),b.mode===Ii.TRIANGLE_STRIP?y.geometry=ux(y.geometry,fv):b.mode===Ii.TRIANGLE_FAN&&(y.geometry=ux(y.geometry,Ad));else if(b.mode===Ii.LINES)y=new rn(d,g);else if(b.mode===Ii.LINE_STRIP)y=new ei(d,g);else if(b.mode===Ii.LINE_LOOP)y=new fc(d,g);else if(b.mode===Ii.POINTS)y=new eo(d,g);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+b.mode);Object.keys(y.geometry.morphAttributes).length>0&&ZB(y,s),y.name=t.createUniqueName(s.name||"mesh_"+e),rs(y,s),b.extensions&&Ba(r,y,b),t.assignFinalMaterial(y),h.push(y)}if(h.length===1)return h[0];const p=new Qn;for(let v=0,m=h.length;v<m;v++)p.add(h[v]);return p})}loadCamera(e){let t;const i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new Dt(Rd.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new vo(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),rs(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i={joints:t.joints};return t.inverseBindMatrices===void 0?Promise.resolve(i):this.getDependency("accessor",t.inverseBindMatrices).then(function(r){return i.inverseBindMatrices=r,i})}loadAnimation(e){const i=this.json.animations[e],r=[],s=[],o=[],l=[],u=[];for(let c=0,f=i.channels.length;c<f;c++){const h=i.channels[c],p=i.samplers[h.sampler],v=h.target,m=v.node!==void 0?v.node:v.id,d=i.parameters!==void 0?i.parameters[p.input]:p.input,b=i.parameters!==void 0?i.parameters[p.output]:p.output;r.push(this.getDependency("node",m)),s.push(this.getDependency("accessor",d)),o.push(this.getDependency("accessor",b)),l.push(p),u.push(v)}return Promise.all([Promise.all(r),Promise.all(s),Promise.all(o),Promise.all(l),Promise.all(u)]).then(function(c){const f=c[0],h=c[1],p=c[2],v=c[3],m=c[4],d=[];for(let y=0,g=f.length;y<g;y++){const w=f[y],A=h[y],S=p[y],M=v[y],F=m[y];if(w===void 0)continue;w.updateMatrix(),w.matrixAutoUpdate=!0;let R;switch(yr[F.path]){case yr.weights:R=po;break;case yr.rotation:R=Yr;break;case yr.position:case yr.scale:default:R=mo;break}const T=w.name?w.name:w.uuid,P=M.interpolation!==void 0?WB[M.interpolation]:Ir,_=[];yr[F.path]===yr.weights?w.traverse(function(C){C.isMesh===!0&&C.morphTargetInfluences&&_.push(C.name?C.name:C.uuid)}):_.push(T);let E=S.array;if(S.normalized){const C=hf(E.constructor),L=new Float32Array(E.length);for(let I=0,x=E.length;I<x;I++)L[I]=E[I]*C;E=L}for(let C=0,L=_.length;C<L;C++){const I=new R(_[C]+"."+yr[F.path],A.array,E,P);M.interpolation==="CUBICSPLINE"&&(I.createInterpolant=function(O){return new Mo(this.times,this.values,this.getValueSize()/3,O)},I.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),d.push(I)}}const b=i.name?i.name:"animation_"+e;return new go(b,void 0,d)})}createNodeMesh(e){const t=this.json,i=this,r=t.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(s){const o=i._getNodeRef(i.meshCache,r.mesh,s);return r.weights!==void 0&&o.traverse(function(l){if(l.isMesh)for(let u=0,c=r.weights.length;u<c;u++)l.morphTargetInfluences[u]=r.weights[u]}),o})}loadNode(e){const t=this.json,i=this.extensions,r=this,s=t.nodes[e],o=s.name?r.createUniqueName(s.name):"";return function(){const l=[],u=r._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return u&&l.push(u),s.camera!==void 0&&l.push(r.getDependency("camera",s.camera).then(function(c){return r._getNodeRef(r.cameraCache,s.camera,c)})),r._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){l.push(c)}),Promise.all(l)}().then(function(l){let u;if(s.isBone===!0?u=new va:l.length>1?u=new Qn:l.length===1?u=l[0]:u=new Xe,u!==l[0])for(let c=0,f=l.length;c<f;c++)u.add(l[c]);if(s.name&&(u.userData.name=s.name,u.name=o),rs(u,s),s.extensions&&Ba(i,u,s),s.matrix!==void 0){const c=new Oe;c.fromArray(s.matrix),u.applyMatrix4(c)}else s.translation!==void 0&&u.position.fromArray(s.translation),s.rotation!==void 0&&u.quaternion.fromArray(s.rotation),s.scale!==void 0&&u.scale.fromArray(s.scale);return r.associations.set(u,{type:"nodes",index:e}),u})}loadScene(e){const t=this.json,i=this.extensions,r=this.json.scenes[e],s=this,o=new Qn;r.name&&(o.name=s.createUniqueName(r.name)),rs(o,r),r.extensions&&Ba(i,o,r);const l=r.nodes||[],u=[];for(let c=0,f=l.length;c<f;c++)u.push(lx(l[c],o,t,s));return Promise.all(u).then(function(){return o})}}function lx(n,e,t,i){const r=t.nodes[n];return i.getDependency("node",n).then(function(s){if(r.skin===void 0)return s;let o;return i.getDependency("skin",r.skin).then(function(l){o=l;const u=[];for(let c=0,f=o.joints.length;c<f;c++)u.push(i.getDependency("node",o.joints[c]));return Promise.all(u)}).then(function(l){return s.traverse(function(u){if(!u.isMesh)return;const c=[],f=[];for(let h=0,p=l.length;h<p;h++){const v=l[h];if(v){c.push(v);const m=new Oe;o.inverseBindMatrices!==void 0&&m.fromArray(o.inverseBindMatrices.array,h*16),f.push(m)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',o.joints[h])}u.bind(new ya(c,f),u.matrixWorld)}),s})}).then(function(s){e.add(s);const o=[];if(r.children){const l=r.children;for(let u=0,c=l.length;u<c;u++){const f=l[u];o.push(lx(f,s,t,i))}}return Promise.all(o)})}function JB(n,e,t){const i=e.attributes,r=new ln;if(i.POSITION!==void 0){const l=t.json.accessors[i.POSITION],u=l.min,c=l.max;if(u!==void 0&&c!==void 0){if(r.set(new Q(u[0],u[1],u[2]),new Q(c[0],c[1],c[2])),l.normalized){const f=hf(Na[l.componentType]);r.min.multiplyScalar(f),r.max.multiplyScalar(f)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const l=new Q,u=new Q;for(let c=0,f=s.length;c<f;c++){const h=s[c];if(h.POSITION!==void 0){const p=t.json.accessors[h.POSITION],v=p.min,m=p.max;if(v!==void 0&&m!==void 0){if(u.setX(Math.max(Math.abs(v[0]),Math.abs(m[0]))),u.setY(Math.max(Math.abs(v[1]),Math.abs(m[1]))),u.setZ(Math.max(Math.abs(v[2]),Math.abs(m[2]))),p.normalized){const d=hf(Na[p.componentType]);u.multiplyScalar(d)}l.max(u)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(l)}n.boundingBox=r;const o=new Si;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,n.boundingSphere=o}function cx(n,e,t){const i=e.attributes,r=[];function s(o,l){return t.getDependency("accessor",o).then(function(u){n.setAttribute(l,u)})}for(const o in i){const l=uf[o]||o.toLowerCase();l in n.attributes||r.push(s(i[o],l))}if(e.indices!==void 0&&!n.index){const o=t.getDependency("accessor",e.indices).then(function(l){n.setIndex(l)});r.push(o)}return rs(n,e),JB(n,e,t),Promise.all(r).then(function(){return e.targets!==void 0?$B(n,e.targets,t):n})}function ux(n,e){let t=n.getIndex();if(t===null){const o=[],l=n.getAttribute("position");if(l!==void 0){for(let u=0;u<l.count;u++)o.push(u);n.setIndex(o),t=n.getIndex()}else return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const i=t.count-2,r=[];if(e===Ad)for(let o=1;o<=i;o++)r.push(t.getX(0)),r.push(t.getX(o)),r.push(t.getX(o+1));else for(let o=0;o<i;o++)o%2===0?(r.push(t.getX(o)),r.push(t.getX(o+1)),r.push(t.getX(o+2))):(r.push(t.getX(o+2)),r.push(t.getX(o+1)),r.push(t.getX(o)));r.length/3!==i&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=n.clone();return s.setIndex(r),s}const KB=xl(Object.freeze(Object.defineProperty({__proto__:null,GLTFLoader:RB},Symbol.toStringTag,{value:"Module"})));var ff={exports:{}},dx;function qB(){return dx||(dx=1,function(n){function e(c){var f={};function h(v){if(f[v])return f[v].exports;var m=f[v]={i:v,l:!1,exports:{}};return c[v].call(m.exports,m,m.exports,h),m.l=!0,m.exports}h.m=c,h.c=f,h.i=function(v){return v},h.d=function(v,m,d){h.o(v,m)||Object.defineProperty(v,m,{configurable:!1,enumerable:!0,get:d})},h.r=function(v){Object.defineProperty(v,"__esModule",{value:!0})},h.n=function(v){var m=v&&v.__esModule?function(){return v.default}:function(){return v};return h.d(m,"a",m),m},h.o=function(v,m){return Object.prototype.hasOwnProperty.call(v,m)},h.p="/",h.oe=function(v){throw console.error(v),v};var p=h(h.s=ENTRY_MODULE);return p.default||p}var t="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+t+").*?\\)";function r(c){return(c+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(c){return!isNaN(1*c)}function o(c,f,h){var p={};p[h]=[];var v=f.toString(),m=v.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!m)return p;for(var d=m[1],b=new RegExp("(\\\\n|\\W)"+r(d)+i,"g"),y;y=b.exec(v);)y[3]!=="dll-reference"&&p[h].push(y[3]);for(b=new RegExp("\\("+r(d)+'\\("(dll-reference\\s('+t+'))"\\)\\)'+i,"g");y=b.exec(v);)c[y[2]]||(p[h].push(y[1]),c[y[2]]=__webpack_require__(y[1]).m),p[y[2]]=p[y[2]]||[],p[y[2]].push(y[4]);for(var g=Object.keys(p),w=0;w<g.length;w++)for(var A=0;A<p[g[w]].length;A++)s(p[g[w]][A])&&(p[g[w]][A]=1*p[g[w]][A]);return p}function l(c){var f=Object.keys(c);return f.reduce(function(h,p){return h||c[p].length>0},!1)}function u(c,f){for(var h={main:[f]},p={main:[]},v={main:{}};l(h);)for(var m=Object.keys(h),d=0;d<m.length;d++){var b=m[d],y=h[b],g=y.pop();if(v[b]=v[b]||{},!(v[b][g]||!c[b][g])){v[b][g]=!0,p[b]=p[b]||[],p[b].push(g);for(var w=o(c,c[b][g],b),A=Object.keys(w),S=0;S<A.length;S++)h[A[S]]=h[A[S]]||[],h[A[S]]=h[A[S]].concat(w[A[S]])}}return p}n.exports=function(c,f){f=f||{};var h={main:__webpack_modules__},p=f.all?{main:Object.keys(h.main)}:u(h,c),v="";Object.keys(p).filter(function(g){return g!=="main"}).forEach(function(g){for(var w=0;p[g][w];)w++;p[g].push(w),h[g][w]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",v=v+"var "+g+" = ("+e.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+p[g].map(function(A){return""+JSON.stringify(A)+": "+h[g][A].toString()}).join(",")+`});
3182
- `}),v=v+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+p.main.map(function(g){return""+JSON.stringify(g)+": "+h.main[g].toString()}).join(",")+"}))(self);";var m=new window.Blob([v],{type:"text/javascript"});if(f.bare)return m;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=d.createObjectURL(m),y=new window.Worker(b);return y.objectURL=b,y}}(ff)),ff.exports}function QB(n){var e=this.constructor;return this.then(function(t){return e.resolve(n()).then(function(){return t})},function(t){return e.resolve(n()).then(function(){return e.reject(t)})})}function eD(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(n);if(r.length===0)return t([]);var s=r.length;function o(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(h){o(u,h)},function(h){r[u]={status:"rejected",reason:h},--s===0&&t(r)});return}}r[u]={status:"fulfilled",value:c},--s===0&&t(r)}for(var l=0;l<r.length;l++)o(l,r[l])})}function hx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}hx.prototype=Error.prototype;function tD(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(n);if(r.length===0)return i();for(var s=[],o=0;o<r.length;o++)try{e.resolve(r[o]).then(t).catch(function(l){s.push(l),s.length===r.length&&i(new hx(s,"All promises were rejected"))})}catch(l){i(l)}})}var nD=setTimeout;function fx(n){return!!(n&&typeof n.length<"u")}function iD(){}function rD(n,e){return function(){n.apply(e,arguments)}}function pt(n){if(!(this instanceof pt))throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],mx(n,this)}function px(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,pt._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?pf:Da)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Da(e.promise,r);return}pf(e.promise,i)})}function pf(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof pt){n._state=3,n._value=e,mf(n);return}else if(typeof t=="function"){mx(rD(t,e),n);return}}n._state=1,n._value=e,mf(n)}catch(i){Da(n,i)}}function Da(n,e){n._state=2,n._value=e,mf(n)}function mf(n){n._state===2&&n._deferreds.length===0&&pt._immediateFn(function(){n._handled||pt._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)px(n,n._deferreds[e]);n._deferreds=null}function sD(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function mx(n,e){var t=!1;try{n(function(i){t||(t=!0,pf(e,i))},function(i){t||(t=!0,Da(e,i))})}catch(i){if(t)return;t=!0,Da(e,i)}}pt.prototype.catch=function(n){return this.then(null,n)},pt.prototype.then=function(n,e){var t=new this.constructor(iD);return px(this,new sD(n,e,t)),t},pt.prototype.finally=QB,pt.all=function(n){return new pt(function(e,t){if(!fx(n))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(n);if(i.length===0)return e([]);var r=i.length;function s(l,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var c=u.then;if(typeof c=="function"){c.call(u,function(f){s(l,f)},t);return}}i[l]=u,--r===0&&e(i)}catch(f){t(f)}}for(var o=0;o<i.length;o++)s(o,i[o])})},pt.any=tD,pt.allSettled=eD,pt.resolve=function(n){return n&&typeof n=="object"&&n.constructor===pt?n:new pt(function(e){e(n)})},pt.reject=function(n){return new pt(function(e,t){t(n)})},pt.race=function(n){return new pt(function(e,t){if(!fx(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)pt.resolve(n[i]).then(e,t)})},pt._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){nD(n,0)},pt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const oD=xl(Object.freeze(Object.defineProperty({__proto__:null,default:pt},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(Xi,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,h=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(51).GeometryCSG,this.GlyphsetCSG=u(57).GlyphsetCSG,this.Viewport=u(44).Viewport,this.CameraControls=u(44).CameraControls,this.SmoothCameraTransition=u(44).SmoothCameraTransition,this.RayCaster=u(44).RayCaster,this.CameraAutoTumble=u(44).CameraAutoTumble,this.StereoEffect=u(44).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new h},o=>{o.exports=QL()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.16.0","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,h=(v,m,d)=>{var b=f(v,d),y=!1;1>d.opacity&&(y=!0);var g;if(b._video===void 0){var w=d.localTimeEnabled||d.localMorphColour;m?(g=m,g.morphTargets=w,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,morphNormals:d.localTimeEnabled,transparent:y,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,morphNormals:d.localTimeEnabled,vertexColors:c.VertexColors,transparent:y,opacity:d.opacity,side:c.DoubleSide}),d.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var A=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:y,opacity:d.opacity,map:A,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},p=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(v,m,d)=>{if(!(this.morph&&this.morph.geometry&&v!=null)){var b=h(v,m,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var v=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,d=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(v.x-m.x,v.y-m.y);this.geometry.faceVertexUvs[0]=[];for(var y=0;y<this.geometry.faces.length;y++){var g=this.geometry.vertices[this.geometry.faces[y].a],w=this.geometry.vertices[this.geometry.faces[y].b],A=this.geometry.vertices[this.geometry.faces[y].c];geometry.faceVertexUvs[0].push([new c.Vector2((g.x+d.x)/b.x,(g.y+d.y)/b.y),new c.Vector2((w.x+d.x)/b.x,(w.y+d.y)/b.y),new c.Vector2((A.x+d.x)/b.x,(A.y+d.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=v=>{this.morph.material.wireframe=v},this.editVertices=function(v,m){if(v&&v.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>m)return;var y=3*m;v.forEach(g=>{b.array[y++]=g[0],b.array[y++]=g[1],b.array[y++]=g[2]}),b.needsUpdate=!0,d.geometry.computeBoundingBox(),d.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=hB},(o,l,u)=>{function c(T){throw new TypeError('"'+T+'" is read-only')}var f=u(4),h=u(6).Geometry,p=u(7).default;function v(T){var P=T,_=u(0).modelPrefix;return _&&(_[_.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(T)||(P=_+T)),P}function m(T,P){var _=(C,L)=>{try{var I=new URL(C,L).href;if(C&&2>C.split("?").length){var x=L.split("?");x.length===2&&(I=I+"?"+x[1])}return I}catch{console.error("There is an issue creating the url link with: ".concat(C,"."))}};if(!Array.isArray(T))return _(T,P);var E=[];return T.forEach(C=>{E.push(_(C,P))}),E}function d(T,P,_,E,C){var L=T.morphTargetInfluences,I=void 0;T.geometry&&(I=T.geometry.morphAttributes);var x=!1;if(L&&I&&I.position){E.set(0,0,0),C.set(0,0,0);for(var O=0;O<L.length;O++)0<L[O]&&(x=!0,_.setFromArray(I.position[O].array),E.add(_.min.multiplyScalar(L[O])),C.add(_.max.multiplyScalar(L[O])));x&&P.set(E,C)}x||P.setFromBufferAttribute(T.geometry.attributes.position),T.updateWorldMatrix(!0,!0),P.applyMatrix4(T.matrixWorld)}function b(T,P,_,E){var C=new XMLHttpRequest;C.open("GET",v(T),!0),C.onreadystatechange=()=>{C.readyState==4&&(C.status==200?_(C.responseText,P):E(T))},C.send(null)}function y(T,P,_){function E(O,B){I[B]=O,L++,L==C&&P(I)}for(var C=T.length,L=0,I=[],x=0;x<C;x++)b(T[x],x,E,_)}l.getColorsRGB=(T,P)=>{var _=Math.floor(P/3),E=P%3,C=0;E==0?C=T[_].r:E==1?C=T[_].g:E==2&&(C=T[_].b);var L=new f.Color(C);return[L.r,L.g,L.b]},l.updateMorphColorAttribute=function(T,P){if(P&&T&&T.morphAttributes&&T.morphAttributes.color){var _=T.morphAttributes.color,E=P.morphTargetInfluences,C=E.length;T.deleteAttribute("morphColor0"),T.deleteAttribute("morphColor1");for(var L=0,I=[],x=0;1>L||x<C;x++)0<E[x]&&(L++,I.push([x,E[x]]));I.length==2?(T.setAttribute("morphColor0",_[I[0][0]]),T.setAttribute("morphColor1",_[I[1][0]])):I.length==1&&(T.setAttribute("morphColor0",_[I[0][0]]),T.setAttribute("morphColor1",_[I[0][0]]))}},l.toBufferGeometry=(T,P)=>{var _;return T instanceof h?(P.localTimeEnabled&&!T.morphNormalsReady&&(T.morphNormals==null||T.morphNormals.length==0)&&T.computeMorphNormals(),_=T.toIndexedBufferGeometry(),P.localMorphColour&&g(T,_)):T instanceof f.BufferGeometry&&(_=T.clone()),_.colorsNeedUpdate=!0,_.computeBoundingBox(),_.computeBoundingSphere(),T._video&&(_._video=T._video),_},l.copyMorphColorsToBufferGeometry=(T,P)=>{if(T&&T.morphColors&&0<T.morphColors.length){for(var _=[],E=T.morphColors,C=u(5).getColorsRGB,L=0,I=E.length;L<I;L++){for(var x=E[L],O=[],B=0;B<T.faces.length;B++){var D=T.faces[B],k=C(x.colors,D.a);O.push(k[0],k[1],k[2]),k=C(x.colors,D.b),O.push(k[0],k[1],k[2]),k=C(x.colors,D.c),O.push(k[0],k[1],k[2])}var V=new f.Float32BufferAttribute(3*(3*T.faces.length),3);V.name=x.name,_.push(V.copyArray(O))}P.morphAttributes.color=_}};var g=(T,P)=>{if(T&&T.morphColors&&0<T.morphColors.length){for(var _=[],E=T.morphColors,C=u(5).getColorsRGB,L=0,I=E.length;L<I;L++){for(var x,O=E[L],B=[],D=0;D<3*O.colors.length;D++)x=C(O.colors,D),B.push(x[0],x[1],x[2]);var k=new f.Float32BufferAttribute(B,3);k.name=O.name,_.push(k)}P.morphAttributes.color=_}};function w(T){for(var P,_,E,C,L=-1,I=0,x=0;x<T.length;++x){if(C=T[x],P===void 0&&(P=C.array.constructor),P!==C.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(_===void 0&&(_=C.itemSize),_!==C.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(E===void 0&&(E=C.normalized),E!==C.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(L===-1&&(L=C.gpuType),L!==C.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;I+=C.count*_}for(var O,B=new P(I),D=new f.BufferAttribute(B,_,E),k=0,V=0;V<T.length;++V){if(O=T[V],O.isInterleavedBufferAttribute)for(var G=k/_,J=0,j=O.count;J<j;J++)for(var te,ee=0;ee<_;ee++)te=O.getComponent(J,ee),D.setComponent(J+G,ee,te);else B.set(O.array,k);k+=O.count*_}return L!==void 0&&(D.gpuType=L),D}l.mergeGeometries=function(T){for(var P=1<arguments.length&&arguments[1]!==void 0&&arguments[1],_=T[0].index!==null,E=new Set(Object.keys(T[0].attributes)),C=new Set(Object.keys(T[0].morphAttributes)),L={},I={},x=T[0].morphTargetsRelative,O=new f.BufferGeometry,B=0,D=0;D<T.length;++D){var k=T[D],V=0;if(_!==(k.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(var G in k.attributes){if(!E.has(G))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+'. All geometries must have compatible attributes; make sure "'+G+'" attribute exists among all geometries, or in none of them.'),null;L[G]===void 0&&(L[G]=[]),L[G].push(k.attributes[G]),V++}if(V!==E.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". Make sure all geometries have the same number of attributes."),null;if(x!==k.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(var J in k.morphAttributes){if(!C.has(J))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". .morphAttributes must be consistent throughout all geometries."),null;I[J]===void 0&&(I[J]=[]),I[J].push(k.morphAttributes[J])}if(P){var j=void 0;if(_)j=k.index.count;else if(k.attributes.position!==void 0)j=k.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". The geometry must have either an index or a position attribute"),null;O.addGroup(B,j,D),B+=j}}if(_){for(var te,ee=0,ae=[],H=0;H<T.length;++H){te=T[H].index;for(var Z=0;Z<te.count;++Z)ae.push(te.getX(Z)+ee);ee+=T[H].attributes.position.count}O.setIndex(ae)}for(var $ in L){var se=w(L[$]);if(!se)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+$+" attribute."),null;O.setAttribute($,se)}for(var z in I){var W=I[z][0].length;if(W===0)break;O.morphAttributes=O.morphAttributes||{},O.morphAttributes[z]=[];for(var q,le=0;le<W;++le){q=[];for(var oe=0;oe<I[z].length;++oe)q.push(I[z][oe][le]);var U=w(q);if(!U)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+z+" morphAttribute."),null;O.morphAttributes[z].push(U)}}return O},l.mergeVertices=function(T){var P=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;P=Math.max(P,Number.EPSILON);for(var _,E={},C=T.getIndex(),L=T.getAttribute("position"),I=C?C.count:L.count,x=0,O=Object.keys(T.attributes),B={},D={},me=[],k=["getX","getY","getZ","getW"],V=0,G=O.length;V<G;V++){_=O[V],B[_]=[];var J=T.morphAttributes[_];J&&(D[_]=Array(J.length).fill().map(()=>[]))}for(var j=Math.log10(1/P),te=Math.pow(10,j),V=0;V<I;V++){for(var ee=C?C.getX(V):V,ae="",H=0,G=O.length;H<G;H++)for(var _=O[H],Z=T.getAttribute(_),$=Z.itemSize,se=0;se<$;se++)ae+="".concat(~~(Z[k[se]](ee)*te),",");if(ae in E)me.push(E[ae]);else{for(var H=0,G=O.length;H<G;H++)for(var z,_=O[H],Z=T.getAttribute(_),J=T.morphAttributes[_],$=Z.itemSize,W=B[_],q=D[_],se=0;se<$;se++)if(z=k[se],W.push(Z[z](ee)),J)for(var le=0,oe=J.length;le<oe;le++)q[le].push(J[le][z](ee));E[ae]=x,me.push(x),x++}}for(var U=T.clone(),V=0,G=O.length;V<G;V++){var Z,_=O[V],N=T.getAttribute(_),X=new N.array.constructor(B[_]);if(N.isInterleavedBufferAttribute?Z=new f.BufferAttribute(X,N.itemSize,N.itemSize):(Z=T.getAttribute(_).clone(),Z.setArray(X)),U.setAttribute(_,Z),_ in D)for(var Y,H=0;H<D[_].length;H++)Y=T.morphAttributes[_][H].clone(),Y.setArray(new Y.array.constructor(D[_][H])),U.morphAttributes[_][H]=Y}var ie=Uint8Array;me.length>=Math.pow(2,8)&&(ie=Uint16Array),me.length>=Math.pow(2,16)&&(ie=Uint32Array);var ue=new ie(me),me=null;return C===null?me=new f.BufferAttribute(ue,1):(me=T.getIndex().clone(),me.setArray(ue)),U.setIndex(me),U};function A(T){if(T.isMeshPhongMaterial){var P=new f.MeshToonMaterial({color:T.color.clone(),morphTargets:T.morphTargets,morphNormals:T.morphNormals,vertexColors:T.vertexColors,transparent:T.transparent,opacity:T.opacity,side:T.side});return T.map&&(P.map=T.map),P}return T}function S(T,P){if(P&&T>=P.length){var _=new f.BufferGeometry,E=new Float32Array(3*T),C=0;return P.forEach(L=>{E[C++]=L[0],E[C++]=L[1],E[C++]=L[2]}),_.setAttribute("position",new f.BufferAttribute(E,3)),_.setDrawRange(0,P.length),_}}function M(){var T=new Image;T.src=u(8);var P=new f.Texture;return P.image=T,P.needsUpdate=!0,P}function F(T,P,_,E,C,L){var I=new p(T,P,_,E,C,L);return I.fontFace=E,I.fontSize=C,I.fontWeight=L,I.material.map.generateMipmaps=!1,I.material.map.anisotropy=4,I.material.sizeAttenuation=!1,I.material.alphaTest=.5,I.material.transparent=!0,I.material.depthWrite=!1,I.material.depthTest=!1,I.center.set(.5,-1.2),I.renderOrder=1e4,I}function R(T,P,_){if(_){var E=T||"",C=P||"",L=_.lastIndexOf("/");if(-1<L){var I=void 0,x=void 0;if(I=_.substring(0,L),x=_.substring(L+1),(I==="*"||I==="**"||I.toLowerCase()===E.toLowerCase())&&(x==="*"||x==="**"||x.toLowerCase()===C.toLowerCase()))return!0}else if(E.toLowerCase()===_.toLowerCase()||C.toLowerCase()===_.toLowerCase())return!0}return!1}l.getBoundingBox=d,l.createNewURL=m,l.createBufferGeometry=S,l.getCircularTexture=M,l.resolveURL=v,l.loadExternalFile=b,l.loadExternalFiles=y,l.PhongToToon=A,l.createNewSpriteText=F,l.isRegionGroup=R},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,h=new c.Object3D,p=new c.Vector3,v=new c.Vector3;function m(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}m.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:m,isGeometry:!0,applyMatrix4:function(g){for(var w,A=new c.Matrix3().getNormalMatrix(g),S=0,M=this.vertices.length;S<M;S++)w=this.vertices[S],w.applyMatrix4(g);for(var F,R=0,T=this.faces.length;R<T;R++){F=this.faces[R],F.normal.applyMatrix3(A).normalize();for(var P=0,_=F.vertexNormals.length;P<_;P++)F.vertexNormals[P].applyMatrix3(A).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(g){return f.makeRotationX(g),this.applyMatrix4(f),this},rotateY:function(g){return f.makeRotationY(g),this.applyMatrix4(f),this},rotateZ:function(g){return f.makeRotationZ(g),this.applyMatrix4(f),this},translate:function(g,w,A){return f.makeTranslation(g,w,A),this.applyMatrix4(f),this},scale:function(g,w,A){return f.makeScale(g,w,A),this.applyMatrix4(f),this},lookAt:function(g){return h.lookAt(g),h.updateMatrix(),this.applyMatrix4(h.matrix),this},fromBufferGeometry:function(g){function w(G,J,j,te){var ee=T===void 0?[]:[A.colors[G].clone(),A.colors[J].clone(),A.colors[j].clone()],ae=R===void 0?[]:[new c.Vector3().fromBufferAttribute(R,G),new c.Vector3().fromBufferAttribute(R,J),new c.Vector3().fromBufferAttribute(R,j)],H=new b(G,J,j,ae,ee,te);A.faces.push(H),P!==void 0&&A.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(P,G),new c.Vector2().fromBufferAttribute(P,J),new c.Vector2().fromBufferAttribute(P,j)]),_!==void 0&&A.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(_,G),new c.Vector2().fromBufferAttribute(_,J),new c.Vector2().fromBufferAttribute(_,j)])}var A=this,S=g.index===null?void 0:g.index,M=g.attributes;if(M.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var F=M.position,R=M.normal,T=M.color,P=M.uv,_=M.uv2;_!==void 0&&(this.faceVertexUvs[1]=[]);for(var E=0;E<F.count;E++)A.vertices.push(new c.Vector3().fromBufferAttribute(F,E)),T!==void 0&&A.colors.push(new c.Color().fromBufferAttribute(T,E));var C=g.groups;if(0<C.length)for(var L=0;L<C.length;L++)for(var I=C[L],x=I.start,O=I.count,B=x,D=x+O;B<D;B+=3)S===void 0?w(B,B+1,B+2,I.materialIndex):w(S.getX(B),S.getX(B+1),S.getX(B+2),I.materialIndex);else if(S!==void 0)for(var k=0;k<S.count;k+=3)w(S.getX(k),S.getX(k+1),S.getX(k+2));else for(var V=0;V<F.count;V+=3)w(V,V+1,V+2);return this.computeFaceNormals(),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(p).negate(),this.translate(p.x,p.y,p.z),this},normalize:function(){this.computeBoundingSphere();var g=this.boundingSphere.center,w=this.boundingSphere.radius,A=w===0?1:1/w,S=new c.Matrix4;return S.set(A,0,0,-A*g.x,0,A,0,-A*g.y,0,0,A,-A*g.z,0,0,0,1),this.applyMatrix4(S),this},computeFaceNormals:function(){for(var g=new c.Vector3,w=new c.Vector3,A=0,S=this.faces.length;A<S;A++){var M=this.faces[A],F=this.vertices[M.a],R=this.vertices[M.b],T=this.vertices[M.c];g.subVectors(T,R),w.subVectors(F,R),g.cross(w),g.normalize(),M.normal.copy(g)}},computeVertexNormals:function(){for(var g=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],w=Array(this.vertices.length),A=0,S=this.vertices.length;A<S;A++)w[A]=new c.Vector3;if(g)for(var M=new c.Vector3,F=new c.Vector3,R=0,T=this.faces.length;R<T;R++){var P=this.faces[R],_=this.vertices[P.a],E=this.vertices[P.b],C=this.vertices[P.c];M.subVectors(C,E),F.subVectors(_,E),M.cross(F),w[P.a].add(M),w[P.b].add(M),w[P.c].add(M)}else{this.computeFaceNormals();for(var L,I=0,x=this.faces.length;I<x;I++)L=this.faces[I],w[L.a].add(L.normal),w[L.b].add(L.normal),w[L.c].add(L.normal)}for(var O=0,B=this.vertices.length;O<B;O++)w[O].normalize();for(var D=0,k=this.faces.length;D<k;D++){var V=this.faces[D],G=V.vertexNormals;G.length===3?(G[0].copy(w[V.a]),G[1].copy(w[V.b]),G[2].copy(w[V.c])):(G[0]=w[V.a].clone(),G[1]=w[V.b].clone(),G[2]=w[V.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),w},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var g=0,w=this.faces.length;g<w;g++){var A=this.faces[g],S=A.vertexNormals;S.length===3?(S[0].copy(A.normal),S[1].copy(A.normal),S[2].copy(A.normal)):(S[0]=A.normal.clone(),S[1]=A.normal.clone(),S[2]=A.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,w=0,A=this.faces.length;w<A;w++){g=this.faces[w],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var S=0,M=g.vertexNormals.length;S<M;S++)g.__originalVertexNormals[S]?g.__originalVertexNormals[S].copy(g.vertexNormals[S]):g.__originalVertexNormals[S]=g.vertexNormals[S].clone()}var F=new m;F.faces=this.faces;for(var R=0,T=this.morphTargets.length;R<T;R++){if(!this.morphNormals[R]){this.morphNormals[R]={},this.morphNormals[R].faceNormals=[],this.morphNormals[R].vertexNormals=[];for(var P=this.morphNormals[R].faceNormals,_=this.morphNormals[R].vertexNormals,E=0,C=this.faces.length;E<C;E++){var L=new c.Vector3,I={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};P.push(L),_.push(I)}}var x=this.morphNormals[R];F.vertices=this.morphTargets[R].vertices,F.computeFaceNormals();var O=F.computeVertexNormals();if(O&&0<O.length){this.morphTargets[R].normals=Array(this.vertices.length);for(var B=0;B<O.length;B++)this.morphTargets[R].normals[B]=O[B].clone()}for(var D=0,k=this.faces.length;D<k;D++){var V=this.faces[D],G=x.faceNormals[D],J=x.vertexNormals[D];G.copy(V.normal),J.a.copy(V.vertexNormals[0]),J.b.copy(V.vertexNormals[1]),J.c.copy(V.vertexNormals[2])}}for(var j,te=0,ee=this.faces.length;te<ee;te++)j=this.faces[te],j.normal=j.__originalFaceNormal,j.vertexNormals=j.__originalVertexNormals;this.morphNormalsReady=!0},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new c.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeMorph:function(g,w){var A=this.morphTargets.length,S=this.morphTargets,M=g.morphTargets,F=this.morphColors.length,R=this.morphColors,T=g.morphColors;if(0<A&&A==M.length)for(var P=0,_=S.length;P<_;P++){for(var E=S[P],C=M[P],L=0,I=C.vertices.length;L<I;L++){var x=C.vertices[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),E.vertices.push(O)}if(E.normals&&C.normals)for(var B=0;B<C.normals.length;B+=3)v.set(C.normals2[B],C.normals2[B+1],C.normals2[B+2]),w!==void 0&&v.applyMatrix4(w),E.normals.push(v.x,v.y,v.z)}if(0<F&&F==T.length)for(var D=0,k=R.length;D<k;D++)for(var V=R[D],G=T[D],J=0,j=G.colors;J<j;J++)V.colors.push(G.colors[J].clone())},merge:function(g,w){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!(g&&g.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",g);var S,M=this.vertices.length,F=this.vertices,R=g.vertices,T=g.normals,P=this.faces,_=g.faces,E=this.colors,C=g.colors;w!==void 0&&(S=new c.Matrix3().getNormalMatrix(w));for(var L=0,I=R.length;L<I;L++){var x=R[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),F.push(O)}for(var B=0;B<T.length;B+=3)v.set(T[B],T[B+1],T[B+2]),w!==void 0&&v.applyMatrix4(w),this.normals.push(v.x,v.y,v.z);for(var D=0,k=C.length;D<k;D++)typeof C[D]=="number"?E.push(C[D]):E.push(C[D].clone());for(var V=0,G=_.length;V<G;V++){var J=_[V],j=void 0,te=void 0,ee=J.vertexNormals,ae=J.vertexColors,H=new b(J.a+M,J.b+M,J.c+M);H.normal.copy(J.normal),S!==void 0&&H.normal.applyMatrix3(S).normalize();for(var Z=0,$=ee.length;Z<$;Z++)j=ee[Z].clone(),S!==void 0&&j.applyMatrix3(S).normalize(),H.vertexNormals.push(j);H.color.copy(J.color);for(var se=0,z=ae.length;se<z;se++)te=ae[se],H.vertexColors.push(te.clone());H.materialIndex=J.materialIndex+A,P.push(H)}for(var W,q=0,le=g.faceVertexUvs.length;q<le;q++){W=g.faceVertexUvs[q],this.faceVertexUvs[q]===void 0&&(this.faceVertexUvs[q]=[]);for(var oe=0,U=W.length;oe<U;oe++){for(var N=W[oe],X=[],Y=0,ie=N.length;Y<ie;Y++)X.push(N[Y].clone());this.faceVertexUvs[q].push(X)}}this.mergeMorph(g,w)},mergeMesh:function(g){return g&&g.isMesh?(g.matrixAutoUpdate&&g.updateMatrix(),void this.merge(g.geometry,g.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",g)},mergeVertices:function(){for(var g=0<arguments.length&&arguments[0]!==void 0?arguments[0]:4,w={},A=[],S=[],M=Math.pow(10,g),F=0,R=this.vertices.length;F<R;F++){var T=this.vertices[F],P=Math.round(T.x*M)+"_"+Math.round(T.y*M)+"_"+Math.round(T.z*M);w[P]===void 0?(w[P]=F,A.push(this.vertices[F]),S[F]=A.length-1):S[F]=S[w[P]]}for(var _,E=[],C=0,L=this.faces.length;C<L;C++){_=this.faces[C],_.a=S[_.a],_.b=S[_.b],_.c=S[_.c];for(var I=[_.a,_.b,_.c],x=0;3>x;x++)if(I[x]===I[(x+1)%3]){E.push(C);break}}for(var O,B=E.length-1;0<=B;B--){O=E[B],this.faces.splice(O,1);for(var D=0,k=this.faceVertexUvs.length;D<k;D++)this.faceVertexUvs[D].splice(O,1)}var V=this.vertices.length-A.length;return this.vertices=A,V},setFromPoints:function(g){this.vertices=[];for(var w,A=0,S=g.length;A<S;A++)w=g[A],this.vertices.push(new c.Vector3(w.x,w.y,w.z||0));return this},sortFacesByMaterialIndex:function(){for(var g=this.faces,w=g.length,A=0;A<w;A++)g[A]._id=A;g.sort(function(_,E){return _.materialIndex-E.materialIndex});var S,M,F=this.faceVertexUvs[0],R=this.faceVertexUvs[1];F&&F.length===w&&(S=[]),R&&R.length===w&&(M=[]);for(var T,P=0;P<w;P++)T=g[P]._id,S&&S.push(F[T]),M&&M.push(R[T]);S&&(this.faceVertexUvs[0]=S),M&&(this.faceVertexUvs[1]=M)},toJSON:function(){function g(z,W,q){return q?z|1<<W:z&~(1<<W)}function w(z){var W=z.x.toString()+z.y.toString()+z.z.toString();return L[W]===void 0&&(L[W]=C.length/3,C.push(z.x,z.y,z.z)),L[W]}function A(z){var W=z.r.toString()+z.g.toString()+z.b.toString();return x[W]===void 0&&(x[W]=I.length,I.push(z.getHex())),x[W]}function S(z){var W=z.x.toString()+z.y.toString();return B[W]===void 0&&(B[W]=O.length/2,O.push(z.x,z.y)),B[W]}var M={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(M.uuid=this.uuid,M.type=this.type,this.name!==""&&(M.name=this.name),this.parameters!==void 0){var F=this.parameters;for(var R in F)F[R]!==void 0&&(M[R]=F[R]);return M}for(var T,P=[],_=0;_<this.vertices.length;_++)T=this.vertices[_],P.push(T.x,T.y,T.z);for(var E=[],C=[],L={},I=[],x={},O=[],B={},D=0;D<this.faces.length;D++){var k=this.faces[D],V=!0,G=!1,J=this.faceVertexUvs[0][D]!==void 0,j=0<k.normal.length(),te=0<k.vertexNormals.length,ee=k.color.r!==1||k.color.g!==1||k.color.b!==1,ae=0<k.vertexColors.length,H=0;if(H=g(H,0,0),H=g(H,1,V),H=g(H,2,G),H=g(H,3,J),H=g(H,4,j),H=g(H,5,te),H=g(H,6,ee),H=g(H,7,ae),E.push(H),E.push(k.a,k.b,k.c),E.push(k.materialIndex),J){var Z=this.faceVertexUvs[0][D];E.push(S(Z[0]),S(Z[1]),S(Z[2]))}if(j&&E.push(w(k.normal)),te){var $=k.vertexNormals;E.push(w($[0]),w($[1]),w($[2]))}if(ee&&E.push(A(k.color)),ae){var se=k.vertexColors;E.push(A(se[0]),A(se[1]),A(se[2]))}}return M.data={},M.data.vertices=P,M.data.normals=C,0<I.length&&(M.data.colors=I),0<O.length&&(M.data.uvs=[O]),M.data.faces=E,M},clone:function(){return new m().copy(this)},copy:function(g){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=g.name;for(var w=g.vertices,A=0,S=w.length;A<S;A++)this.vertices.push(w[A].clone());for(var M=g.colors,F=0,R=M.length;F<R;F++)this.colors.push(M[F].clone());for(var T=g.faces,P=0,_=T.length;P<_;P++)this.faces.push(T[P].clone());for(var E,C=0,L=g.faceVertexUvs.length;C<L;C++){E=g.faceVertexUvs[C],this.faceVertexUvs[C]===void 0&&(this.faceVertexUvs[C]=[]);for(var I=0,x=E.length;I<x;I++){for(var O,B=E[I],D=[],k=0,V=B.length;k<V;k++)O=B[k],D.push(O.clone());this.faceVertexUvs[C].push(D)}}for(var G,J=g.morphTargets,j=0,te=J.length;j<te;j++){if(G={},G.name=J[j].name,J[j].vertices!==void 0){G.vertices=[];for(var ee=0,ae=J[j].vertices.length;ee<ae;ee++)G.vertices.push(J[j].vertices[ee].clone())}if(J[j].normals!==void 0){G.normals=[];for(var H=0,Z=J[j].normals.length;H<Z;H++)G.normals.push(J[j].normals[H].clone())}this.morphTargets.push(G)}for(var $,se=g.morphNormals,z=0,W=se.length;z<W;z++){if($={},se[z].vertexNormals!==void 0){$.vertexNormals=[];for(var q=0,le=se[z].vertexNormals.length;q<le;q++){var oe=se[z].vertexNormals[q],U={};U.a=oe.a.clone(),U.b=oe.b.clone(),U.c=oe.c.clone(),$.vertexNormals.push(U)}}if(se[z].faceNormals!==void 0){$.faceNormals=[];for(var N=0,X=se[z].faceNormals.length;N<X;N++)$.faceNormals.push(se[z].faceNormals[N].clone())}this.morphNormals.push($)}for(var Y=g.skinWeights,ie=0,ue=Y.length;ie<ue;ie++)this.skinWeights.push(Y[ie].clone());for(var me=g.skinIndices,be=0,ce=me.length;be<ce;be++)this.skinIndices.push(me[be].clone());for(var ge=g.lineDistances,re=0,he=ge.length;re<he;re++)this.lineDistances.push(ge[re]);var ve=g.boundingBox;ve!==null&&(this.boundingBox=ve.clone());var Ee=g.boundingSphere;return Ee!==null&&(this.boundingSphere=Ee.clone()),this.elementsNeedUpdate=g.elementsNeedUpdate,this.verticesNeedUpdate=g.verticesNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.lineDistancesNeedUpdate=g.lineDistancesNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,this},computeGroups(){var y,g,w=[],A=void 0,S=this.faces;for(g=0;g<S.length;g++){var M=S[g];M.materialIndex!==A&&(A=M.materialIndex,y!==void 0&&(y.count=3*g-y.start,w.push(y)),y={start:3*g,materialIndex:A})}return y!==void 0&&(y.count=3*g-y.start,w.push(y)),w},toBufferGeometry:function(){var g=new d().fromGeometry(this),w=new c.BufferGeometry,A=new Float32Array(3*g.vertices.length);if(w.setAttribute("position",new c.BufferAttribute(A,3).copyVector3sArray(g.vertices)),0<g.normals.length){var S=new Float32Array(3*g.normals.length);w.setAttribute("normal",new c.BufferAttribute(S,3).copyVector3sArray(g.normals))}if(0<g.colors.length){var M=new Float32Array(3*g.colors.length);w.setAttribute("color",new c.BufferAttribute(M,3).copyColorsArray(g.colors))}if(0<g.uvs.length){var F=new Float32Array(2*g.uvs.length);w.setAttribute("uv",new c.BufferAttribute(F,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var R=new Float32Array(2*g.uvs2.length);w.setAttribute("uv2",new c.BufferAttribute(R,2).copyVector2sArray(g.uvs2))}for(var T in w.groups=g.groups,g.morphTargets){for(var P=[],_=g.morphTargets[T],E=0,C=_.length;E<C;E++){var L=_[E],I=new c.Float32BufferAttribute(3*L.data.length,3);I.name=L.name,P.push(I.copyVector3sArray(L.data))}w.morphAttributes[T]=P}if(0<g.skinIndices.length){var x=new c.Float32BufferAttribute(4*g.skinIndices.length,4);w.setAttribute("skinIndex",x.copyVector4sArray(g.skinIndices))}if(0<g.skinWeights.length){var O=new c.Float32BufferAttribute(4*g.skinWeights.length,4);w.setAttribute("skinWeight",O.copyVector4sArray(g.skinWeights))}return g.boundingSphere!==null&&(w.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(w.boundingBox=g.boundingBox.clone()),w},toIndexedBufferGeometry:function(){var g=new c.BufferGeometry,w=new Float32Array(3*this.vertices.length);if(g.setAttribute("position",new c.BufferAttribute(w,3).copyVector3sArray(this.vertices)),0<this.normals.length){var A=new Float32Array(this.normals.length),S=new c.BufferAttribute(A,3).copyArray(this.normals);g.setAttribute("normal",S)}if(0<this.uvs.length&&0<this.uvs[0].length){var M=new Float32Array(2*this.uvs[0].length);g.setAttribute("uv",new c.BufferAttribute(M,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var F=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(F,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var R=[],T=0;T<this.colors.length;T++)R.push(new c.Color(this.colors[T]));var P=new Float32Array(3*R.length);g.setAttribute("color",new c.BufferAttribute(P,3).copyColorsArray(R))}else{for(var _=new Float32Array(3*this.vertices.length),E=0;E<3*this.vertices.length;E++)_[E]=1;g.setAttribute("color",new c.BufferAttribute(_,3))}if(0<this.faces.length){for(var C=[],L=[],I=0;I<this.faces.length;I++){L.push(this.faces[I].a,this.faces[I].b,this.faces[I].c);var x=this.faces[I].vertexColors;if(x.length===3)C.push(x[0],x[1],x[2]);else{var O=this.faces[I].color;C.push(O,O,O)}}g.setIndex(L),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],D=[],k=0,V=this.morphTargets.length;k<V;k++){var G=this.morphTargets[k],J=new c.Float32BufferAttribute(3*G.vertices.length,3);if(J.name=G.name,B.push(J.copyVector3sArray(G.vertices)),G.normals){var j=new c.Float32BufferAttribute(3*G.normals.length,3);j.name=G.name,D.push(j.copyVector3sArray(G.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=D}if(0<this.skinIndices.length){var te=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",te.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var ee=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",ee.copyVector4sArray(this.skinWeights))}return this.boundingSphere!==null&&(g.boundingSphere=this.boundingSphere.clone()),this.boundingBox!==null&&(g.boundingBox=this.boundingBox.clone()),g},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(g){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(g)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),m.createBufferGeometryFromObject=function(y){var g=new c.BufferGeometry,w=y.geometry;if(y.isPoints||y.isLine){var A=new c.Float32BufferAttribute(3*w.vertices.length,3),S=new c.Float32BufferAttribute(3*w.colors.length,3);if(g.setAttribute("position",A.copyVector3sArray(w.vertices)),g.setAttribute("color",S.copyColorsArray(w.colors)),w.lineDistances&&w.lineDistances.length===w.vertices.length){var M=new c.Float32BufferAttribute(w.lineDistances.length,1);g.setAttribute("lineDistance",M.copyArray(w.lineDistances))}w.boundingSphere!==null&&(g.boundingSphere=w.boundingSphere.clone()),w.boundingBox!==null&&(g.boundingBox=w.boundingBox.clone())}else y.isMesh&&(g=w.toBufferGeometry());return g};class d{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(g){var w,A,S=[],M=void 0,F=g.faces;for(A=0;A<F.length;A++){var R=F[A];R.materialIndex!==M&&(M=R.materialIndex,w!==void 0&&(w.count=3*A-w.start,S.push(w)),w={start:3*A,materialIndex:M})}w!==void 0&&(w.count=3*A-w.start,S.push(w)),this.groups=S}fromGeometry(g){var w,A=g.faces,S=g.vertices,M=g.faceVertexUvs,F=M[0]&&0<M[0].length,R=M[1]&&0<M[1].length,T=g.morphTargets,P=T.length;if(0<P){w=[];for(var _=0;_<P;_++)w[_]={name:T[_].name,data:[]};this.morphTargets.position=w}var E,C=g.morphNormals,L=C.length;if(0<L){E=[];for(var I=0;I<L;I++)E[I]={name:C[I].name,data:[]};this.morphTargets.normal=E}var x=g.skinIndices,O=g.skinWeights,B=x.length===S.length,D=O.length===S.length;0<S.length&&A.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var k,V=0;V<A.length;V++){k=A[V],this.vertices.push(S[k.a],S[k.b],S[k.c]);var G=k.vertexNormals;if(G.length===3)this.normals.push(G[0],G[1],G[2]);else{var J=k.normal;this.normals.push(J,J,J)}var j=k.vertexColors;if(j.length===3)this.colors.push(j[0],j[1],j[2]);else{var te=k.color;this.colors.push(te,te,te)}if(F===!0){var ee=M[0][V];ee===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",V),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(ee[0],ee[1],ee[2])}if(R===!0){var ae=M[1][V];ae===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",V),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(ae[0],ae[1],ae[2])}for(var H,Z=0;Z<P;Z++)H=T[Z].vertices,w[Z].data.push(H[k.a],H[k.b],H[k.c]);for(var $,se=0;se<L;se++)$=C[se].vertexNormals[V],E[se].data.push($.a,$.b,$.c);B&&this.skinIndices.push(x[k.a],x[k.b],x[k.c]),D&&this.skinWeights.push(O[k.a],O[k.b],O[k.c])}return this.computeGroups(g),this.verticesNeedUpdate=g.verticesNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),this}}class b{constructor(g,w,A,S,M){var F=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=w,this.c=A,this.normal=S&&S.isVector3?S:new c.Vector3,this.vertexNormals=Array.isArray(S)?S:[],this.color=M&&M.isColor?M:new c.Color,this.vertexColors=Array.isArray(M)?M:[],this.materialIndex=F}clone(){return new this.constructor().copy(this)}copy(g){this.a=g.a,this.b=g.b,this.c=g.c,this.normal.copy(g.normal),this.color.copy(g.color),this.materialIndex=g.materialIndex;for(var w=0,A=g.vertexNormals.length;w<A;w++)this.vertexNormals[w]=g.vertexNormals[w].clone();for(var S=0,M=g.vertexColors.length;S<M;S++)this.vertexColors[S]=g.vertexColors[S].clone();return this}}},o=>{o.exports=CB},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(`
3182
+ `}),v=v+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+p.main.map(function(g){return""+JSON.stringify(g)+": "+h.main[g].toString()}).join(",")+"}))(self);";var m=new window.Blob([v],{type:"text/javascript"});if(f.bare)return m;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=d.createObjectURL(m),y=new window.Worker(b);return y.objectURL=b,y}}(ff)),ff.exports}function QB(n){var e=this.constructor;return this.then(function(t){return e.resolve(n()).then(function(){return t})},function(t){return e.resolve(n()).then(function(){return e.reject(t)})})}function eD(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(n);if(r.length===0)return t([]);var s=r.length;function o(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(h){o(u,h)},function(h){r[u]={status:"rejected",reason:h},--s===0&&t(r)});return}}r[u]={status:"fulfilled",value:c},--s===0&&t(r)}for(var l=0;l<r.length;l++)o(l,r[l])})}function hx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}hx.prototype=Error.prototype;function tD(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(n);if(r.length===0)return i();for(var s=[],o=0;o<r.length;o++)try{e.resolve(r[o]).then(t).catch(function(l){s.push(l),s.length===r.length&&i(new hx(s,"All promises were rejected"))})}catch(l){i(l)}})}var nD=setTimeout;function fx(n){return!!(n&&typeof n.length<"u")}function iD(){}function rD(n,e){return function(){n.apply(e,arguments)}}function pt(n){if(!(this instanceof pt))throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],mx(n,this)}function px(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,pt._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?pf:Da)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Da(e.promise,r);return}pf(e.promise,i)})}function pf(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof pt){n._state=3,n._value=e,mf(n);return}else if(typeof t=="function"){mx(rD(t,e),n);return}}n._state=1,n._value=e,mf(n)}catch(i){Da(n,i)}}function Da(n,e){n._state=2,n._value=e,mf(n)}function mf(n){n._state===2&&n._deferreds.length===0&&pt._immediateFn(function(){n._handled||pt._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)px(n,n._deferreds[e]);n._deferreds=null}function sD(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function mx(n,e){var t=!1;try{n(function(i){t||(t=!0,pf(e,i))},function(i){t||(t=!0,Da(e,i))})}catch(i){if(t)return;t=!0,Da(e,i)}}pt.prototype.catch=function(n){return this.then(null,n)},pt.prototype.then=function(n,e){var t=new this.constructor(iD);return px(this,new sD(n,e,t)),t},pt.prototype.finally=QB,pt.all=function(n){return new pt(function(e,t){if(!fx(n))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(n);if(i.length===0)return e([]);var r=i.length;function s(l,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var c=u.then;if(typeof c=="function"){c.call(u,function(f){s(l,f)},t);return}}i[l]=u,--r===0&&e(i)}catch(f){t(f)}}for(var o=0;o<i.length;o++)s(o,i[o])})},pt.any=tD,pt.allSettled=eD,pt.resolve=function(n){return n&&typeof n=="object"&&n.constructor===pt?n:new pt(function(e){e(n)})},pt.reject=function(n){return new pt(function(e,t){t(n)})},pt.race=function(n){return new pt(function(e,t){if(!fx(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)pt.resolve(n[i]).then(e,t)})},pt._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){nD(n,0)},pt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const oD=xl(Object.freeze(Object.defineProperty({__proto__:null,default:pt},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(Xi,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,h=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(51).GeometryCSG,this.GlyphsetCSG=u(57).GlyphsetCSG,this.Viewport=u(44).Viewport,this.CameraControls=u(44).CameraControls,this.SmoothCameraTransition=u(44).SmoothCameraTransition,this.RayCaster=u(44).RayCaster,this.CameraAutoTumble=u(44).CameraAutoTumble,this.StereoEffect=u(44).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new h},o=>{o.exports=QL()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.16.1","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,h=(v,m,d)=>{var b=f(v,d),y=!1;1>d.opacity&&(y=!0);var g;if(b._video===void 0){var w=d.localTimeEnabled||d.localMorphColour;m?(g=m,g.morphTargets=w,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,morphNormals:d.localTimeEnabled,transparent:y,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,morphNormals:d.localTimeEnabled,vertexColors:c.VertexColors,transparent:y,opacity:d.opacity,side:c.DoubleSide}),d.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var A=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:y,opacity:d.opacity,map:A,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},p=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(v,m,d)=>{if(!(this.morph&&this.morph.geometry&&v!=null)){var b=h(v,m,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var v=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,d=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(v.x-m.x,v.y-m.y);this.geometry.faceVertexUvs[0]=[];for(var y=0;y<this.geometry.faces.length;y++){var g=this.geometry.vertices[this.geometry.faces[y].a],w=this.geometry.vertices[this.geometry.faces[y].b],A=this.geometry.vertices[this.geometry.faces[y].c];geometry.faceVertexUvs[0].push([new c.Vector2((g.x+d.x)/b.x,(g.y+d.y)/b.y),new c.Vector2((w.x+d.x)/b.x,(w.y+d.y)/b.y),new c.Vector2((A.x+d.x)/b.x,(A.y+d.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=v=>{this.morph.material.wireframe=v},this.editVertices=function(v,m){if(v&&v.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>m)return;var y=3*m;v.forEach(g=>{b.array[y++]=g[0],b.array[y++]=g[1],b.array[y++]=g[2]}),b.needsUpdate=!0,d.geometry.computeBoundingBox(),d.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=hB},(o,l,u)=>{function c(T){throw new TypeError('"'+T+'" is read-only')}var f=u(4),h=u(6).Geometry,p=u(7).default;function v(T){var P=T,_=u(0).modelPrefix;return _&&(_[_.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(T)||(P=_+T)),P}function m(T,P){var _=(C,L)=>{try{var I=new URL(C,L).href;if(C&&2>C.split("?").length){var x=L.split("?");x.length===2&&(I=I+"?"+x[1])}return I}catch{console.error("There is an issue creating the url link with: ".concat(C,"."))}};if(!Array.isArray(T))return _(T,P);var E=[];return T.forEach(C=>{E.push(_(C,P))}),E}function d(T,P,_,E,C){var L=T.morphTargetInfluences,I=void 0;T.geometry&&(I=T.geometry.morphAttributes);var x=!1;if(L&&I&&I.position){E.set(0,0,0),C.set(0,0,0);for(var O=0;O<L.length;O++)0<L[O]&&(x=!0,_.setFromArray(I.position[O].array),E.add(_.min.multiplyScalar(L[O])),C.add(_.max.multiplyScalar(L[O])));x&&P.set(E,C)}x||P.setFromBufferAttribute(T.geometry.attributes.position),T.updateWorldMatrix(!0,!0),P.applyMatrix4(T.matrixWorld)}function b(T,P,_,E){var C=new XMLHttpRequest;C.open("GET",v(T),!0),C.onreadystatechange=()=>{C.readyState==4&&(C.status==200?_(C.responseText,P):E(T))},C.send(null)}function y(T,P,_){function E(O,B){I[B]=O,L++,L==C&&P(I)}for(var C=T.length,L=0,I=[],x=0;x<C;x++)b(T[x],x,E,_)}l.getColorsRGB=(T,P)=>{var _=Math.floor(P/3),E=P%3,C=0;E==0?C=T[_].r:E==1?C=T[_].g:E==2&&(C=T[_].b);var L=new f.Color(C);return[L.r,L.g,L.b]},l.updateMorphColorAttribute=function(T,P){if(P&&T&&T.morphAttributes&&T.morphAttributes.color){var _=T.morphAttributes.color,E=P.morphTargetInfluences,C=E.length;T.deleteAttribute("morphColor0"),T.deleteAttribute("morphColor1");for(var L=0,I=[],x=0;1>L||x<C;x++)0<E[x]&&(L++,I.push([x,E[x]]));I.length==2?(T.setAttribute("morphColor0",_[I[0][0]]),T.setAttribute("morphColor1",_[I[1][0]])):I.length==1&&(T.setAttribute("morphColor0",_[I[0][0]]),T.setAttribute("morphColor1",_[I[0][0]]))}},l.toBufferGeometry=(T,P)=>{var _;return T instanceof h?(P.localTimeEnabled&&!T.morphNormalsReady&&(T.morphNormals==null||T.morphNormals.length==0)&&T.computeMorphNormals(),_=T.toIndexedBufferGeometry(),P.localMorphColour&&g(T,_)):T instanceof f.BufferGeometry&&(_=T.clone()),_.colorsNeedUpdate=!0,_.computeBoundingBox(),_.computeBoundingSphere(),T._video&&(_._video=T._video),_},l.copyMorphColorsToBufferGeometry=(T,P)=>{if(T&&T.morphColors&&0<T.morphColors.length){for(var _=[],E=T.morphColors,C=u(5).getColorsRGB,L=0,I=E.length;L<I;L++){for(var x=E[L],O=[],B=0;B<T.faces.length;B++){var D=T.faces[B],k=C(x.colors,D.a);O.push(k[0],k[1],k[2]),k=C(x.colors,D.b),O.push(k[0],k[1],k[2]),k=C(x.colors,D.c),O.push(k[0],k[1],k[2])}var V=new f.Float32BufferAttribute(3*(3*T.faces.length),3);V.name=x.name,_.push(V.copyArray(O))}P.morphAttributes.color=_}};var g=(T,P)=>{if(T&&T.morphColors&&0<T.morphColors.length){for(var _=[],E=T.morphColors,C=u(5).getColorsRGB,L=0,I=E.length;L<I;L++){for(var x,O=E[L],B=[],D=0;D<3*O.colors.length;D++)x=C(O.colors,D),B.push(x[0],x[1],x[2]);var k=new f.Float32BufferAttribute(B,3);k.name=O.name,_.push(k)}P.morphAttributes.color=_}};function w(T){for(var P,_,E,C,L=-1,I=0,x=0;x<T.length;++x){if(C=T[x],P===void 0&&(P=C.array.constructor),P!==C.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(_===void 0&&(_=C.itemSize),_!==C.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(E===void 0&&(E=C.normalized),E!==C.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(L===-1&&(L=C.gpuType),L!==C.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;I+=C.count*_}for(var O,B=new P(I),D=new f.BufferAttribute(B,_,E),k=0,V=0;V<T.length;++V){if(O=T[V],O.isInterleavedBufferAttribute)for(var G=k/_,J=0,j=O.count;J<j;J++)for(var te,ee=0;ee<_;ee++)te=O.getComponent(J,ee),D.setComponent(J+G,ee,te);else B.set(O.array,k);k+=O.count*_}return L!==void 0&&(D.gpuType=L),D}l.mergeGeometries=function(T){for(var P=1<arguments.length&&arguments[1]!==void 0&&arguments[1],_=T[0].index!==null,E=new Set(Object.keys(T[0].attributes)),C=new Set(Object.keys(T[0].morphAttributes)),L={},I={},x=T[0].morphTargetsRelative,O=new f.BufferGeometry,B=0,D=0;D<T.length;++D){var k=T[D],V=0;if(_!==(k.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(var G in k.attributes){if(!E.has(G))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+'. All geometries must have compatible attributes; make sure "'+G+'" attribute exists among all geometries, or in none of them.'),null;L[G]===void 0&&(L[G]=[]),L[G].push(k.attributes[G]),V++}if(V!==E.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". Make sure all geometries have the same number of attributes."),null;if(x!==k.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(var J in k.morphAttributes){if(!C.has(J))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". .morphAttributes must be consistent throughout all geometries."),null;I[J]===void 0&&(I[J]=[]),I[J].push(k.morphAttributes[J])}if(P){var j=void 0;if(_)j=k.index.count;else if(k.attributes.position!==void 0)j=k.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". The geometry must have either an index or a position attribute"),null;O.addGroup(B,j,D),B+=j}}if(_){for(var te,ee=0,ae=[],H=0;H<T.length;++H){te=T[H].index;for(var Z=0;Z<te.count;++Z)ae.push(te.getX(Z)+ee);ee+=T[H].attributes.position.count}O.setIndex(ae)}for(var $ in L){var se=w(L[$]);if(!se)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+$+" attribute."),null;O.setAttribute($,se)}for(var z in I){var W=I[z][0].length;if(W===0)break;O.morphAttributes=O.morphAttributes||{},O.morphAttributes[z]=[];for(var q,le=0;le<W;++le){q=[];for(var oe=0;oe<I[z].length;++oe)q.push(I[z][oe][le]);var U=w(q);if(!U)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+z+" morphAttribute."),null;O.morphAttributes[z].push(U)}}return O},l.mergeVertices=function(T){var P=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;P=Math.max(P,Number.EPSILON);for(var _,E={},C=T.getIndex(),L=T.getAttribute("position"),I=C?C.count:L.count,x=0,O=Object.keys(T.attributes),B={},D={},me=[],k=["getX","getY","getZ","getW"],V=0,G=O.length;V<G;V++){_=O[V],B[_]=[];var J=T.morphAttributes[_];J&&(D[_]=Array(J.length).fill().map(()=>[]))}for(var j=Math.log10(1/P),te=Math.pow(10,j),V=0;V<I;V++){for(var ee=C?C.getX(V):V,ae="",H=0,G=O.length;H<G;H++)for(var _=O[H],Z=T.getAttribute(_),$=Z.itemSize,se=0;se<$;se++)ae+="".concat(~~(Z[k[se]](ee)*te),",");if(ae in E)me.push(E[ae]);else{for(var H=0,G=O.length;H<G;H++)for(var z,_=O[H],Z=T.getAttribute(_),J=T.morphAttributes[_],$=Z.itemSize,W=B[_],q=D[_],se=0;se<$;se++)if(z=k[se],W.push(Z[z](ee)),J)for(var le=0,oe=J.length;le<oe;le++)q[le].push(J[le][z](ee));E[ae]=x,me.push(x),x++}}for(var U=T.clone(),V=0,G=O.length;V<G;V++){var Z,_=O[V],N=T.getAttribute(_),X=new N.array.constructor(B[_]);if(N.isInterleavedBufferAttribute?Z=new f.BufferAttribute(X,N.itemSize,N.itemSize):(Z=T.getAttribute(_).clone(),Z.setArray(X)),U.setAttribute(_,Z),_ in D)for(var Y,H=0;H<D[_].length;H++)Y=T.morphAttributes[_][H].clone(),Y.setArray(new Y.array.constructor(D[_][H])),U.morphAttributes[_][H]=Y}var ie=Uint8Array;me.length>=Math.pow(2,8)&&(ie=Uint16Array),me.length>=Math.pow(2,16)&&(ie=Uint32Array);var ue=new ie(me),me=null;return C===null?me=new f.BufferAttribute(ue,1):(me=T.getIndex().clone(),me.setArray(ue)),U.setIndex(me),U};function A(T){if(T.isMeshPhongMaterial){var P=new f.MeshToonMaterial({color:T.color.clone(),morphTargets:T.morphTargets,morphNormals:T.morphNormals,vertexColors:T.vertexColors,transparent:T.transparent,opacity:T.opacity,side:T.side});return T.map&&(P.map=T.map),P}return T}function S(T,P){if(P&&T>=P.length){var _=new f.BufferGeometry,E=new Float32Array(3*T),C=0;return P.forEach(L=>{E[C++]=L[0],E[C++]=L[1],E[C++]=L[2]}),_.setAttribute("position",new f.BufferAttribute(E,3)),_.setDrawRange(0,P.length),_}}function M(){var T=new Image;T.src=u(8);var P=new f.Texture;return P.image=T,P.needsUpdate=!0,P}function F(T,P,_,E,C,L){var I=new p(T,P,_,E,C,L);return I.fontFace=E,I.fontSize=C,I.fontWeight=L,I.material.map.generateMipmaps=!1,I.material.map.anisotropy=4,I.material.sizeAttenuation=!1,I.material.alphaTest=.5,I.material.transparent=!0,I.material.depthWrite=!1,I.material.depthTest=!1,I.center.set(.5,-1.2),I.renderOrder=1e4,I}function R(T,P,_){if(_){var E=T||"",C=P||"",L=_.lastIndexOf("/");if(-1<L){var I=void 0,x=void 0;if(I=_.substring(0,L),x=_.substring(L+1),(I==="*"||I==="**"||I.toLowerCase()===E.toLowerCase())&&(x==="*"||x==="**"||x.toLowerCase()===C.toLowerCase()))return!0}else if(E.toLowerCase()===_.toLowerCase()||C.toLowerCase()===_.toLowerCase())return!0}return!1}l.getBoundingBox=d,l.createNewURL=m,l.createBufferGeometry=S,l.getCircularTexture=M,l.resolveURL=v,l.loadExternalFile=b,l.loadExternalFiles=y,l.PhongToToon=A,l.createNewSpriteText=F,l.isRegionGroup=R},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,h=new c.Object3D,p=new c.Vector3,v=new c.Vector3;function m(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}m.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:m,isGeometry:!0,applyMatrix4:function(g){for(var w,A=new c.Matrix3().getNormalMatrix(g),S=0,M=this.vertices.length;S<M;S++)w=this.vertices[S],w.applyMatrix4(g);for(var F,R=0,T=this.faces.length;R<T;R++){F=this.faces[R],F.normal.applyMatrix3(A).normalize();for(var P=0,_=F.vertexNormals.length;P<_;P++)F.vertexNormals[P].applyMatrix3(A).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(g){return f.makeRotationX(g),this.applyMatrix4(f),this},rotateY:function(g){return f.makeRotationY(g),this.applyMatrix4(f),this},rotateZ:function(g){return f.makeRotationZ(g),this.applyMatrix4(f),this},translate:function(g,w,A){return f.makeTranslation(g,w,A),this.applyMatrix4(f),this},scale:function(g,w,A){return f.makeScale(g,w,A),this.applyMatrix4(f),this},lookAt:function(g){return h.lookAt(g),h.updateMatrix(),this.applyMatrix4(h.matrix),this},fromBufferGeometry:function(g){function w(G,J,j,te){var ee=T===void 0?[]:[A.colors[G].clone(),A.colors[J].clone(),A.colors[j].clone()],ae=R===void 0?[]:[new c.Vector3().fromBufferAttribute(R,G),new c.Vector3().fromBufferAttribute(R,J),new c.Vector3().fromBufferAttribute(R,j)],H=new b(G,J,j,ae,ee,te);A.faces.push(H),P!==void 0&&A.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(P,G),new c.Vector2().fromBufferAttribute(P,J),new c.Vector2().fromBufferAttribute(P,j)]),_!==void 0&&A.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(_,G),new c.Vector2().fromBufferAttribute(_,J),new c.Vector2().fromBufferAttribute(_,j)])}var A=this,S=g.index===null?void 0:g.index,M=g.attributes;if(M.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var F=M.position,R=M.normal,T=M.color,P=M.uv,_=M.uv2;_!==void 0&&(this.faceVertexUvs[1]=[]);for(var E=0;E<F.count;E++)A.vertices.push(new c.Vector3().fromBufferAttribute(F,E)),T!==void 0&&A.colors.push(new c.Color().fromBufferAttribute(T,E));var C=g.groups;if(0<C.length)for(var L=0;L<C.length;L++)for(var I=C[L],x=I.start,O=I.count,B=x,D=x+O;B<D;B+=3)S===void 0?w(B,B+1,B+2,I.materialIndex):w(S.getX(B),S.getX(B+1),S.getX(B+2),I.materialIndex);else if(S!==void 0)for(var k=0;k<S.count;k+=3)w(S.getX(k),S.getX(k+1),S.getX(k+2));else for(var V=0;V<F.count;V+=3)w(V,V+1,V+2);return this.computeFaceNormals(),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(p).negate(),this.translate(p.x,p.y,p.z),this},normalize:function(){this.computeBoundingSphere();var g=this.boundingSphere.center,w=this.boundingSphere.radius,A=w===0?1:1/w,S=new c.Matrix4;return S.set(A,0,0,-A*g.x,0,A,0,-A*g.y,0,0,A,-A*g.z,0,0,0,1),this.applyMatrix4(S),this},computeFaceNormals:function(){for(var g=new c.Vector3,w=new c.Vector3,A=0,S=this.faces.length;A<S;A++){var M=this.faces[A],F=this.vertices[M.a],R=this.vertices[M.b],T=this.vertices[M.c];g.subVectors(T,R),w.subVectors(F,R),g.cross(w),g.normalize(),M.normal.copy(g)}},computeVertexNormals:function(){for(var g=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],w=Array(this.vertices.length),A=0,S=this.vertices.length;A<S;A++)w[A]=new c.Vector3;if(g)for(var M=new c.Vector3,F=new c.Vector3,R=0,T=this.faces.length;R<T;R++){var P=this.faces[R],_=this.vertices[P.a],E=this.vertices[P.b],C=this.vertices[P.c];M.subVectors(C,E),F.subVectors(_,E),M.cross(F),w[P.a].add(M),w[P.b].add(M),w[P.c].add(M)}else{this.computeFaceNormals();for(var L,I=0,x=this.faces.length;I<x;I++)L=this.faces[I],w[L.a].add(L.normal),w[L.b].add(L.normal),w[L.c].add(L.normal)}for(var O=0,B=this.vertices.length;O<B;O++)w[O].normalize();for(var D=0,k=this.faces.length;D<k;D++){var V=this.faces[D],G=V.vertexNormals;G.length===3?(G[0].copy(w[V.a]),G[1].copy(w[V.b]),G[2].copy(w[V.c])):(G[0]=w[V.a].clone(),G[1]=w[V.b].clone(),G[2]=w[V.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),w},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var g=0,w=this.faces.length;g<w;g++){var A=this.faces[g],S=A.vertexNormals;S.length===3?(S[0].copy(A.normal),S[1].copy(A.normal),S[2].copy(A.normal)):(S[0]=A.normal.clone(),S[1]=A.normal.clone(),S[2]=A.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,w=0,A=this.faces.length;w<A;w++){g=this.faces[w],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var S=0,M=g.vertexNormals.length;S<M;S++)g.__originalVertexNormals[S]?g.__originalVertexNormals[S].copy(g.vertexNormals[S]):g.__originalVertexNormals[S]=g.vertexNormals[S].clone()}var F=new m;F.faces=this.faces;for(var R=0,T=this.morphTargets.length;R<T;R++){if(!this.morphNormals[R]){this.morphNormals[R]={},this.morphNormals[R].faceNormals=[],this.morphNormals[R].vertexNormals=[];for(var P=this.morphNormals[R].faceNormals,_=this.morphNormals[R].vertexNormals,E=0,C=this.faces.length;E<C;E++){var L=new c.Vector3,I={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};P.push(L),_.push(I)}}var x=this.morphNormals[R];F.vertices=this.morphTargets[R].vertices,F.computeFaceNormals();var O=F.computeVertexNormals();if(O&&0<O.length){this.morphTargets[R].normals=Array(this.vertices.length);for(var B=0;B<O.length;B++)this.morphTargets[R].normals[B]=O[B].clone()}for(var D=0,k=this.faces.length;D<k;D++){var V=this.faces[D],G=x.faceNormals[D],J=x.vertexNormals[D];G.copy(V.normal),J.a.copy(V.vertexNormals[0]),J.b.copy(V.vertexNormals[1]),J.c.copy(V.vertexNormals[2])}}for(var j,te=0,ee=this.faces.length;te<ee;te++)j=this.faces[te],j.normal=j.__originalFaceNormal,j.vertexNormals=j.__originalVertexNormals;this.morphNormalsReady=!0},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new c.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeMorph:function(g,w){var A=this.morphTargets.length,S=this.morphTargets,M=g.morphTargets,F=this.morphColors.length,R=this.morphColors,T=g.morphColors;if(0<A&&A==M.length)for(var P=0,_=S.length;P<_;P++){for(var E=S[P],C=M[P],L=0,I=C.vertices.length;L<I;L++){var x=C.vertices[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),E.vertices.push(O)}if(E.normals&&C.normals)for(var B=0;B<C.normals.length;B+=3)v.set(C.normals2[B],C.normals2[B+1],C.normals2[B+2]),w!==void 0&&v.applyMatrix4(w),E.normals.push(v.x,v.y,v.z)}if(0<F&&F==T.length)for(var D=0,k=R.length;D<k;D++)for(var V=R[D],G=T[D],J=0,j=G.colors;J<j;J++)V.colors.push(G.colors[J].clone())},merge:function(g,w){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!(g&&g.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",g);var S,M=this.vertices.length,F=this.vertices,R=g.vertices,T=g.normals,P=this.faces,_=g.faces,E=this.colors,C=g.colors;w!==void 0&&(S=new c.Matrix3().getNormalMatrix(w));for(var L=0,I=R.length;L<I;L++){var x=R[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),F.push(O)}for(var B=0;B<T.length;B+=3)v.set(T[B],T[B+1],T[B+2]),w!==void 0&&v.applyMatrix4(w),this.normals.push(v.x,v.y,v.z);for(var D=0,k=C.length;D<k;D++)typeof C[D]=="number"?E.push(C[D]):E.push(C[D].clone());for(var V=0,G=_.length;V<G;V++){var J=_[V],j=void 0,te=void 0,ee=J.vertexNormals,ae=J.vertexColors,H=new b(J.a+M,J.b+M,J.c+M);H.normal.copy(J.normal),S!==void 0&&H.normal.applyMatrix3(S).normalize();for(var Z=0,$=ee.length;Z<$;Z++)j=ee[Z].clone(),S!==void 0&&j.applyMatrix3(S).normalize(),H.vertexNormals.push(j);H.color.copy(J.color);for(var se=0,z=ae.length;se<z;se++)te=ae[se],H.vertexColors.push(te.clone());H.materialIndex=J.materialIndex+A,P.push(H)}for(var W,q=0,le=g.faceVertexUvs.length;q<le;q++){W=g.faceVertexUvs[q],this.faceVertexUvs[q]===void 0&&(this.faceVertexUvs[q]=[]);for(var oe=0,U=W.length;oe<U;oe++){for(var N=W[oe],X=[],Y=0,ie=N.length;Y<ie;Y++)X.push(N[Y].clone());this.faceVertexUvs[q].push(X)}}this.mergeMorph(g,w)},mergeMesh:function(g){return g&&g.isMesh?(g.matrixAutoUpdate&&g.updateMatrix(),void this.merge(g.geometry,g.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",g)},mergeVertices:function(){for(var g=0<arguments.length&&arguments[0]!==void 0?arguments[0]:4,w={},A=[],S=[],M=Math.pow(10,g),F=0,R=this.vertices.length;F<R;F++){var T=this.vertices[F],P=Math.round(T.x*M)+"_"+Math.round(T.y*M)+"_"+Math.round(T.z*M);w[P]===void 0?(w[P]=F,A.push(this.vertices[F]),S[F]=A.length-1):S[F]=S[w[P]]}for(var _,E=[],C=0,L=this.faces.length;C<L;C++){_=this.faces[C],_.a=S[_.a],_.b=S[_.b],_.c=S[_.c];for(var I=[_.a,_.b,_.c],x=0;3>x;x++)if(I[x]===I[(x+1)%3]){E.push(C);break}}for(var O,B=E.length-1;0<=B;B--){O=E[B],this.faces.splice(O,1);for(var D=0,k=this.faceVertexUvs.length;D<k;D++)this.faceVertexUvs[D].splice(O,1)}var V=this.vertices.length-A.length;return this.vertices=A,V},setFromPoints:function(g){this.vertices=[];for(var w,A=0,S=g.length;A<S;A++)w=g[A],this.vertices.push(new c.Vector3(w.x,w.y,w.z||0));return this},sortFacesByMaterialIndex:function(){for(var g=this.faces,w=g.length,A=0;A<w;A++)g[A]._id=A;g.sort(function(_,E){return _.materialIndex-E.materialIndex});var S,M,F=this.faceVertexUvs[0],R=this.faceVertexUvs[1];F&&F.length===w&&(S=[]),R&&R.length===w&&(M=[]);for(var T,P=0;P<w;P++)T=g[P]._id,S&&S.push(F[T]),M&&M.push(R[T]);S&&(this.faceVertexUvs[0]=S),M&&(this.faceVertexUvs[1]=M)},toJSON:function(){function g(z,W,q){return q?z|1<<W:z&~(1<<W)}function w(z){var W=z.x.toString()+z.y.toString()+z.z.toString();return L[W]===void 0&&(L[W]=C.length/3,C.push(z.x,z.y,z.z)),L[W]}function A(z){var W=z.r.toString()+z.g.toString()+z.b.toString();return x[W]===void 0&&(x[W]=I.length,I.push(z.getHex())),x[W]}function S(z){var W=z.x.toString()+z.y.toString();return B[W]===void 0&&(B[W]=O.length/2,O.push(z.x,z.y)),B[W]}var M={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(M.uuid=this.uuid,M.type=this.type,this.name!==""&&(M.name=this.name),this.parameters!==void 0){var F=this.parameters;for(var R in F)F[R]!==void 0&&(M[R]=F[R]);return M}for(var T,P=[],_=0;_<this.vertices.length;_++)T=this.vertices[_],P.push(T.x,T.y,T.z);for(var E=[],C=[],L={},I=[],x={},O=[],B={},D=0;D<this.faces.length;D++){var k=this.faces[D],V=!0,G=!1,J=this.faceVertexUvs[0][D]!==void 0,j=0<k.normal.length(),te=0<k.vertexNormals.length,ee=k.color.r!==1||k.color.g!==1||k.color.b!==1,ae=0<k.vertexColors.length,H=0;if(H=g(H,0,0),H=g(H,1,V),H=g(H,2,G),H=g(H,3,J),H=g(H,4,j),H=g(H,5,te),H=g(H,6,ee),H=g(H,7,ae),E.push(H),E.push(k.a,k.b,k.c),E.push(k.materialIndex),J){var Z=this.faceVertexUvs[0][D];E.push(S(Z[0]),S(Z[1]),S(Z[2]))}if(j&&E.push(w(k.normal)),te){var $=k.vertexNormals;E.push(w($[0]),w($[1]),w($[2]))}if(ee&&E.push(A(k.color)),ae){var se=k.vertexColors;E.push(A(se[0]),A(se[1]),A(se[2]))}}return M.data={},M.data.vertices=P,M.data.normals=C,0<I.length&&(M.data.colors=I),0<O.length&&(M.data.uvs=[O]),M.data.faces=E,M},clone:function(){return new m().copy(this)},copy:function(g){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=g.name;for(var w=g.vertices,A=0,S=w.length;A<S;A++)this.vertices.push(w[A].clone());for(var M=g.colors,F=0,R=M.length;F<R;F++)this.colors.push(M[F].clone());for(var T=g.faces,P=0,_=T.length;P<_;P++)this.faces.push(T[P].clone());for(var E,C=0,L=g.faceVertexUvs.length;C<L;C++){E=g.faceVertexUvs[C],this.faceVertexUvs[C]===void 0&&(this.faceVertexUvs[C]=[]);for(var I=0,x=E.length;I<x;I++){for(var O,B=E[I],D=[],k=0,V=B.length;k<V;k++)O=B[k],D.push(O.clone());this.faceVertexUvs[C].push(D)}}for(var G,J=g.morphTargets,j=0,te=J.length;j<te;j++){if(G={},G.name=J[j].name,J[j].vertices!==void 0){G.vertices=[];for(var ee=0,ae=J[j].vertices.length;ee<ae;ee++)G.vertices.push(J[j].vertices[ee].clone())}if(J[j].normals!==void 0){G.normals=[];for(var H=0,Z=J[j].normals.length;H<Z;H++)G.normals.push(J[j].normals[H].clone())}this.morphTargets.push(G)}for(var $,se=g.morphNormals,z=0,W=se.length;z<W;z++){if($={},se[z].vertexNormals!==void 0){$.vertexNormals=[];for(var q=0,le=se[z].vertexNormals.length;q<le;q++){var oe=se[z].vertexNormals[q],U={};U.a=oe.a.clone(),U.b=oe.b.clone(),U.c=oe.c.clone(),$.vertexNormals.push(U)}}if(se[z].faceNormals!==void 0){$.faceNormals=[];for(var N=0,X=se[z].faceNormals.length;N<X;N++)$.faceNormals.push(se[z].faceNormals[N].clone())}this.morphNormals.push($)}for(var Y=g.skinWeights,ie=0,ue=Y.length;ie<ue;ie++)this.skinWeights.push(Y[ie].clone());for(var me=g.skinIndices,be=0,ce=me.length;be<ce;be++)this.skinIndices.push(me[be].clone());for(var ge=g.lineDistances,re=0,he=ge.length;re<he;re++)this.lineDistances.push(ge[re]);var ve=g.boundingBox;ve!==null&&(this.boundingBox=ve.clone());var Ee=g.boundingSphere;return Ee!==null&&(this.boundingSphere=Ee.clone()),this.elementsNeedUpdate=g.elementsNeedUpdate,this.verticesNeedUpdate=g.verticesNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.lineDistancesNeedUpdate=g.lineDistancesNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,this},computeGroups(){var y,g,w=[],A=void 0,S=this.faces;for(g=0;g<S.length;g++){var M=S[g];M.materialIndex!==A&&(A=M.materialIndex,y!==void 0&&(y.count=3*g-y.start,w.push(y)),y={start:3*g,materialIndex:A})}return y!==void 0&&(y.count=3*g-y.start,w.push(y)),w},toBufferGeometry:function(){var g=new d().fromGeometry(this),w=new c.BufferGeometry,A=new Float32Array(3*g.vertices.length);if(w.setAttribute("position",new c.BufferAttribute(A,3).copyVector3sArray(g.vertices)),0<g.normals.length){var S=new Float32Array(3*g.normals.length);w.setAttribute("normal",new c.BufferAttribute(S,3).copyVector3sArray(g.normals))}if(0<g.colors.length){var M=new Float32Array(3*g.colors.length);w.setAttribute("color",new c.BufferAttribute(M,3).copyColorsArray(g.colors))}if(0<g.uvs.length){var F=new Float32Array(2*g.uvs.length);w.setAttribute("uv",new c.BufferAttribute(F,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var R=new Float32Array(2*g.uvs2.length);w.setAttribute("uv2",new c.BufferAttribute(R,2).copyVector2sArray(g.uvs2))}for(var T in w.groups=g.groups,g.morphTargets){for(var P=[],_=g.morphTargets[T],E=0,C=_.length;E<C;E++){var L=_[E],I=new c.Float32BufferAttribute(3*L.data.length,3);I.name=L.name,P.push(I.copyVector3sArray(L.data))}w.morphAttributes[T]=P}if(0<g.skinIndices.length){var x=new c.Float32BufferAttribute(4*g.skinIndices.length,4);w.setAttribute("skinIndex",x.copyVector4sArray(g.skinIndices))}if(0<g.skinWeights.length){var O=new c.Float32BufferAttribute(4*g.skinWeights.length,4);w.setAttribute("skinWeight",O.copyVector4sArray(g.skinWeights))}return g.boundingSphere!==null&&(w.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(w.boundingBox=g.boundingBox.clone()),w},toIndexedBufferGeometry:function(){var g=new c.BufferGeometry,w=new Float32Array(3*this.vertices.length);if(g.setAttribute("position",new c.BufferAttribute(w,3).copyVector3sArray(this.vertices)),0<this.normals.length){var A=new Float32Array(this.normals.length),S=new c.BufferAttribute(A,3).copyArray(this.normals);g.setAttribute("normal",S)}if(0<this.uvs.length&&0<this.uvs[0].length){var M=new Float32Array(2*this.uvs[0].length);g.setAttribute("uv",new c.BufferAttribute(M,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var F=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(F,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var R=[],T=0;T<this.colors.length;T++)R.push(new c.Color(this.colors[T]));var P=new Float32Array(3*R.length);g.setAttribute("color",new c.BufferAttribute(P,3).copyColorsArray(R))}else{for(var _=new Float32Array(3*this.vertices.length),E=0;E<3*this.vertices.length;E++)_[E]=1;g.setAttribute("color",new c.BufferAttribute(_,3))}if(0<this.faces.length){for(var C=[],L=[],I=0;I<this.faces.length;I++){L.push(this.faces[I].a,this.faces[I].b,this.faces[I].c);var x=this.faces[I].vertexColors;if(x.length===3)C.push(x[0],x[1],x[2]);else{var O=this.faces[I].color;C.push(O,O,O)}}g.setIndex(L),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],D=[],k=0,V=this.morphTargets.length;k<V;k++){var G=this.morphTargets[k],J=new c.Float32BufferAttribute(3*G.vertices.length,3);if(J.name=G.name,B.push(J.copyVector3sArray(G.vertices)),G.normals){var j=new c.Float32BufferAttribute(3*G.normals.length,3);j.name=G.name,D.push(j.copyVector3sArray(G.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=D}if(0<this.skinIndices.length){var te=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",te.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var ee=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",ee.copyVector4sArray(this.skinWeights))}return this.boundingSphere!==null&&(g.boundingSphere=this.boundingSphere.clone()),this.boundingBox!==null&&(g.boundingBox=this.boundingBox.clone()),g},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(g){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(g)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),m.createBufferGeometryFromObject=function(y){var g=new c.BufferGeometry,w=y.geometry;if(y.isPoints||y.isLine){var A=new c.Float32BufferAttribute(3*w.vertices.length,3),S=new c.Float32BufferAttribute(3*w.colors.length,3);if(g.setAttribute("position",A.copyVector3sArray(w.vertices)),g.setAttribute("color",S.copyColorsArray(w.colors)),w.lineDistances&&w.lineDistances.length===w.vertices.length){var M=new c.Float32BufferAttribute(w.lineDistances.length,1);g.setAttribute("lineDistance",M.copyArray(w.lineDistances))}w.boundingSphere!==null&&(g.boundingSphere=w.boundingSphere.clone()),w.boundingBox!==null&&(g.boundingBox=w.boundingBox.clone())}else y.isMesh&&(g=w.toBufferGeometry());return g};class d{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(g){var w,A,S=[],M=void 0,F=g.faces;for(A=0;A<F.length;A++){var R=F[A];R.materialIndex!==M&&(M=R.materialIndex,w!==void 0&&(w.count=3*A-w.start,S.push(w)),w={start:3*A,materialIndex:M})}w!==void 0&&(w.count=3*A-w.start,S.push(w)),this.groups=S}fromGeometry(g){var w,A=g.faces,S=g.vertices,M=g.faceVertexUvs,F=M[0]&&0<M[0].length,R=M[1]&&0<M[1].length,T=g.morphTargets,P=T.length;if(0<P){w=[];for(var _=0;_<P;_++)w[_]={name:T[_].name,data:[]};this.morphTargets.position=w}var E,C=g.morphNormals,L=C.length;if(0<L){E=[];for(var I=0;I<L;I++)E[I]={name:C[I].name,data:[]};this.morphTargets.normal=E}var x=g.skinIndices,O=g.skinWeights,B=x.length===S.length,D=O.length===S.length;0<S.length&&A.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var k,V=0;V<A.length;V++){k=A[V],this.vertices.push(S[k.a],S[k.b],S[k.c]);var G=k.vertexNormals;if(G.length===3)this.normals.push(G[0],G[1],G[2]);else{var J=k.normal;this.normals.push(J,J,J)}var j=k.vertexColors;if(j.length===3)this.colors.push(j[0],j[1],j[2]);else{var te=k.color;this.colors.push(te,te,te)}if(F===!0){var ee=M[0][V];ee===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",V),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(ee[0],ee[1],ee[2])}if(R===!0){var ae=M[1][V];ae===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",V),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(ae[0],ae[1],ae[2])}for(var H,Z=0;Z<P;Z++)H=T[Z].vertices,w[Z].data.push(H[k.a],H[k.b],H[k.c]);for(var $,se=0;se<L;se++)$=C[se].vertexNormals[V],E[se].data.push($.a,$.b,$.c);B&&this.skinIndices.push(x[k.a],x[k.b],x[k.c]),D&&this.skinWeights.push(O[k.a],O[k.b],O[k.c])}return this.computeGroups(g),this.verticesNeedUpdate=g.verticesNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),this}}class b{constructor(g,w,A,S,M){var F=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=w,this.c=A,this.normal=S&&S.isVector3?S:new c.Vector3,this.vertexNormals=Array.isArray(S)?S:[],this.color=M&&M.isColor?M:new c.Color,this.vertexColors=Array.isArray(M)?M:[],this.materialIndex=F}clone(){return new this.constructor().copy(this)}copy(g){this.a=g.a,this.b=g.b,this.c=g.c,this.normal.copy(g.normal),this.color.copy(g.color),this.materialIndex=g.materialIndex;for(var w=0,A=g.vertexNormals.length;w<A;w++)this.vertexNormals[w]=g.vertexNormals[w].clone();for(var S=0,M=g.vertexColors.length;S<M;S++)this.vertexColors[S]=g.vertexColors[S].clone();return this}}},o=>{o.exports=CB},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(`
3183
3183
  `)),u.vertexShader=u.vertexShader.replace("#include <color_vertex>",["vColor.xyz = color.xyz;","#ifdef USE_MORPHTARGETS","vColor = morphColor0 * morphTargetInfluences[ 0 ];","vColor += morphColor1 * morphTargetInfluences[ 1 ];","#endif"].join(`
3184
- `))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,h=u(5).resolveURL,p=0,v=function(){return"pr"+p++},m=function(){this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new c.Group,this._lod=new(u(11)).LOD(this),this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.inbuildTime=0,this.mixer=void 0,this.animationGroup=void 0,this.duration=6e3,this.clipAction=void 0,this.userData={},this.videoHandler=void 0,this.marker=void 0,this.markerNumber=void 0,this.markerUpdateRequired=!0,this.closestVertexIndex=-1,this.boundingBoxUpdateRequired=!0,this.cachedBoundingBox=new c.Box3,this.anatomicalId=void 0,this.region=void 0,this.animationClip=void 0,this.markerMode="inherited",this.uuid=v(),this._v1=new c.Vector3,this._v2=new c.Vector3,this._b1=new c.Box3,this.center=new c.Vector3,this.radius=0,this.visible=!0,this.drawRange=-1,this.origColour=void 0,this.origVertexColors=!1,this.isPickable=!0};m.prototype.setDuration=function(d){this.duration=d,this.clipAction&&this.clipAction.setDuration(this.duration)},m.prototype.getDuration=function(){return this.duration},m.prototype.setRegion=function(d){this.region=d},m.prototype.getRegion=function(){return this.region},m.prototype.getMorph=function(){var d=this._lod.getCurrentMorph();return d||this.morph},m.prototype.getGroup=function(){return this.group},m.prototype.setMorph=function(d){this.morph=d,this.group.add(this.morph);var b=this._lod.calculateDistance("far");this._lod.addLevel(d,b),this._lod.setMaterial(d.material)},m.prototype.checkTransparentMesh=function(){},m.prototype.setMesh=function(d,b,y){this.animationGroup=new c.AnimationObjectGroup(d),this.mixer=new c.AnimationMixer(this.animationGroup);var g=d.geometry;if(this.geometry=d.geometry,this.clipAction=void 0,g&&g.morphAttributes){var w=g.morphAttributes.position;w||(w=g.morphAttributes.color?g.morphAttributes.color:g.morphAttributes.normal),w&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(w,10,!0),this.animationClip&&this.animationClip[0]!=null&&(this.clipAction=this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration),this.clipAction.loop=c.loopOnce,this.clipAction.clampWhenFinished=!0,this.clipAction.play()))}this.timeEnabled=b,this.morphColour=y,d.userData=this,d.matrixAutoUpdate=!1,this.setMorph(d),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(g.setAttribute("morphTarget0",g.getAttribute("position")),g.setAttribute("morphTarget1",g.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},m.prototype.setIsPickable=function(d){this.isPickable!==d&&(this.isPickable=d,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAnatomicalId=function(d){this.anatomicalId=d},m.prototype.setName=function(d){this.groupName=d,this._lod.setName(d)},m.prototype.getCurrentTime=function(){if(this.clipAction){var d=this.clipAction.time/this.clipAction._clip.duration;return this.duration*d}return this.inbuildTime},m.prototype.setMorphTime=function(d){var b=!1;if(this.clipAction){var y=d/this.duration,g=this.clipAction._clip.duration,w=y*g;w!=this.clipAction.time&&(this.clipAction.time=w,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var A=d;A=d>this.duration?this.duration:0>d?0:d,A!=this.inbuildTime&&(this.inbuildTime=A,b=!0)}b&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},m.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},m.prototype.getVisibility=function(){return this.visible},m.prototype.setVisibility=function(d){d!==this.visible&&(this.visible=d,this.group.visible=d,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAlpha=function(d){var b=this._lod._material,y=!1;1>d&&(y=!0),b.opacity=d,b.transparent=y,this.checkTransparentMesh()},m.prototype.setFrustumCulled=function(d){this._lod.setFrustumCulled(d)},m.prototype.setVertexColors=function(d){this._lod.setVertexColors(d)},m.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},m.prototype.setColour=function(d){this._lod.setColour(d)},m.prototype.setGreyScale=function(d){if(d){if(!this.origColour&&this._lod._material)return this.origColour=this._lod._material.color,this.origVertexColors=this._lod._material.vertexColors,this._lod.setVertexColors(!1),this._lod.setColour(new c.Color().setHex(12303291)),!0}else if(this.origColour)return this._lod.setColour(this.origColour),this._lod.setVertexColors(this.origVertexColors),this.origColour=void 0,!0;return!1},m.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},m.prototype.setColourHex=function(d){this._lod._material.color.setHex(d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(d)},m.prototype.setEmissiveRGB=function(d){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...d)},m.prototype.setMaterial=function(d){this._lod.setMaterial(d)},m.prototype.getClosestVertexIndex=function(){var d=-1,b=this.getMorph();if(b&&b.geoemtry){var y=b.geometry.attributes.position;if(this._b1.setFromBufferAttribute(y),this._b1.getCenter(this._v1),y)for(var g=-1,w=0,A=0;A<y.count;A++)this._v2.fromArray(y.array,3*A),w=this._v2.distanceTo(this._v1),g==-1?g=w:g>w&&(g=w,d=A)}return d},m.prototype.getClosestVertex=function(d){var b=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var y=this.getMorph();if(y&&y.geometry&&0<=this.closestVertexIndex){var g=y.morphTargetInfluences,w=y.geometry.morphAttributes;if(g&&w&&w.position){for(var A=!1,S=0;S<g.length;S++)0<g[S]&&(A=!0,this._v1.fromArray(w.position[S].array,3*this.closestVertexIndex),b.add(this._v1.multiplyScalar(g[S])));if(A)return d?b.applyMatrix4(y.matrixWorld):b}else return b.fromArray(y.geometry.attributes.position.array,3*this.closestVertexIndex),d?b.applyMatrix4(y.matrixWorld):b}return this.getBoundingBox(),b.copy(this.center),d?b.applyMatrix4(this.morph.matrixWorld):b},m.prototype.getBoundingBox=function(){if(this.visible){var d=this._lod.getCurrentMorph();if(d&&d.visible)return this.boundingBoxUpdateRequired&&(u(5).getBoundingBox(d,this.cachedBoundingBox,this._b1,this._v1,this._v2),this.cachedBoundingBox.getCenter(this.center),this.radius=this.center.distanceTo(this.cachedBoundingBox.max),this.boundingBoxUpdateRequired=!1),this.cachedBoundingBox}},m.prototype.dispose=function(){this._lod.dispose(),this.animationGroup=void 0,this.mixer=void 0,this.morph=void 0,this.group=void 0,this.clipAction=void 0,this.groupName=void 0},m.prototype.markerIsRequired=function(d){return!!(this.visible&&(this.markerMode==="on"||d&&d.displayMarkers&&this.markerMode==="inherited"))},m.prototype.updateMarker=function(d,b){if(d==!1&&this.markerIsRequired(b)){var y=b.ndcToBeUpdated;if(this.groupName){if(this.marker||(this.marker=new(u(14)).Marker(this),this.markerUpdateRequired=!0),this.markerUpdateRequired){var g=this.getClosestVertex(!1);g&&(this.marker.setPosition(g.x,g.y,g.z),this.markerUpdateRequired=!1)}this.marker.isEnabled()||(b.markersList&&!(this.marker.uuid in b.markersList)&&(y=!0,b.markersList[this.marker.uuid]=this.marker),this.marker.enable(),this.group.add(this.marker.morph)),this.marker.setNumber(this.markerNumber),this.markerImgURL?this.marker.loadUserSprite(this.markerImgURL):this.marker.setDefaultSprite(),b&&b.camera&&(y||b.markerCluster.markerUpdateRequired)&&(this.marker.updateNDC(b.camera.cameraObject),b.markerCluster.markerUpdateRequired=!0)}}else this.marker&&this.marker.isEnabled()&&(this.marker.disable(),this.group.remove(this.marker.morph),b.markersList&&this.marker.uuid in b.markersList&&(b.markerCluster.markerUpdateRequired=!0,delete b.markersList[this.marker.uuid])),this.markerUpdateRequired=!0},m.prototype.processMarkerVisual=function(d,b){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(d,b)},m.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},m.prototype.setRenderOrder=function(d){this._lod.setRenderOrder(d)},m.prototype.getClosestVertexDOMElementCoords=function(d){if(d&&d.camera){var b=!0,y=this.getClosestVertex(!0);return y.project(d.camera),y.z=Math.min(Math.max(y.z,0),1),(1<y.x||-1>y.x||1<y.y||-1>y.y)&&(b=!1),d.getZincCameraControls().getRelativeCoordsFromNDC(y.x,y.y,y),{position:y,inView:b}}},m.prototype.setMarkerMode=function(d,b){d!==this.markerMode&&(this.markerMode=d==="on"||d==="off"?d:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),b&&(this.markerNumber=b.number,this.markerImgURL=b.imgURL)},m.prototype.render=function(d,b,y,g){if(this.visible&&!(this.timeEnabled&&b)&&this._lod.update(y,this.center),b==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(d);else{var w=this.inbuildTime+d;w>this.duration&&(w-=this.duration),this.inbuildTime=w}this.visible&&d!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},m.prototype.addLOD=function(d,b,y,g,w){this._lod.addLevelFromURL(d,b,y,g,w)},m.prototype.addVertices=function(d){var b=this.getMorph(),y=void 0;if(!b)y=f(500,d),this.drawRange=d.length;else if(-1<this.drawRange){var g=b.geometry.getAttribute("position");d.forEach(w=>{g.setXYZ(this.drawRange,w[0],w[1],w[2]),++this.drawRange}),g.needsUpdate=!0,b.geometry.setDrawRange(0,this.drawRange),b.geometry.computeBoundingBox(),b.geometry.computeBoundingSphere(),y=b.geoemtry,this.boundingBoxUpdateRequired=!0}return y},m.prototype.setPosition=function(d,b,y){var g=this.getGroup();g&&(g.position.set(d,b,y),g.updateMatrix(),this.boundingBoxUpdateRequired=!0)},m.prototype.loadAdditionalSources=function(d){d.load(h(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))},m.prototype.setScaleAll=function(d){var b=this.getGroup();b&&(b.scale.set(d,d,d),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=m},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,h=u(5).toBufferGeometry,p=function(v){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=v,this.addLevel=(d,b)=>{if(d){var y,g=Math.abs(b);for(y=0;y<this.levels.length&&!(g<this.levels[y].distance);y++);this.levels.splice(y,0,{distance:g,morph:d,loaded:!0,loading:!1,url:""}),d.renderOrder=this._renderOrder}},this.levelLoaded=(d,b)=>{if(d){for(var y=Math.abs(b),g=0;g<this.levels.length;g++)if(y===this.levels[g].distance){this._parent.group.add(d),this.levels[g].morph=d,this.levels[g].loaded=!0,this.levels[g].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(d,b,y,g,w)=>{this._loader=d;var A,S=this.calculateDistance(b);for(A=0;A<this.levels.length&&!(S<this.levels[A].distance);A++);this.levels.splice(A,0,{distance:S,morph:void 0,loaded:!1,loading:!1,url:y,index:g}),w&&this.loadLevel(A)},this.loadLevel=d=>{var b=this.levels[d];return b.morph||b.loaded||b.loading||(b.loading=!0,this._loader.load(b.url,this.lodLoader(b.distance),void 0,void 0,{index:b.index})),b.morph===void 0},this.calculateDistance=function(d){this._parent.getBoundingBox();var b=this._parent.radius,y=0;return d==="far"?y=4.5*b:d==="medium"?y=2.5*b:d=="close"&&(y=0),y},this.containsLevels=()=>!!(this.levels&&1<this.levels.length),this.checkTransparentMesh=()=>{var d=this.levels[this._currentLevel];this._material&&(this._material.transparent?(!this._secondaryMaterial&&(this._secondaryMaterial=this._material.clone(),this._secondaryMaterial.side=c.FrontSide),this._secondaryMaterial.opacity=this._material.opacity,this._secondaryMaterial.emissive&&this._secondaryMaterial.emissive.copy(this._material.emissive),this._secondaryMaterial.needsUpdate=!0,!d.secondaryMesh&&(d.secondaryMesh=new c.Mesh(d.morph.geometry,this._secondaryMaterial),d.secondaryMesh.renderOrder=d.morph.renderOrder+1,d.secondaryMesh.userData=d.morph.userData,d.secondaryMesh.name=d.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!d.secondaryMesh.parent&&(d.morph.add(d.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(d.secondaryMesh))):(d.secondaryMesh&&(d.morph.remove(d.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(d.secondaryMesh),this._parent.animationGroup.remove(d.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&d.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var d=this.levels[this._currentLevel];return d&&d.morph?d.morph:this._parent.morph},this.lodLoader=function(d){return b=>{var y=this._material,g={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},w=h(b,g),A=void 0;this._parent.isGeometry?A=new c.Mesh(w,y):this._parent.isLines&&(A=new(u(12)).LineSegments(w,y)),A.userData=this._parent,A.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(A,d)}},this.updateMorphColorAttribute=d=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(d){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(y=>{y.morph&&y.morph.geometry&&f(y.morph.geometry,y.morph)})},this.setColour=d=>{this._material.color=d,this._secondaryMaterial&&(this._secondaryMaterial.color=d),m()},this.setFrustumCulled=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=d),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=d)})},this.setMaterial=d=>{d&&(!this._material||this._material.id!==d.id)&&(this._material=d,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=d.clone(),this._secondaryMaterial.side=c.FrontSide,this._secondaryMaterial.transparent=!0,this.levels.forEach(b=>{b.morph&&(b.morph.material=this._material,b.morph.geometry&&(b.morph.geometry.colorsNeedUpdate=!0)),b.secondaryMesh&&(b.secondaryMesh.material=this._secondaryMaterial)}))},this.setName=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=d),b.secondaryMesh&&(b.secondaryMesh.name=d)})},this.setRenderOrder=d=>{this._renderOrder=d,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=d),b.secondaryMesh&&(b.secondaryMesh.renderOrder=d)})},this.setVertexColors=d=>{this._material.vertexColors=d,m(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=d)},this.update=(d,b)=>{var y=this.levels;if(1<y.length){var g,w,A=d.cameraObject.position.distanceTo(b),S=-1,M=-1;for(g=0,w=y.length;g<w&&A>=y[g].distance;g++)y[g].morph?(-1<S&&y[S].morph&&(y[S].morph.visible=!1),S=g,y[g].morph.visible=!0,M=-1):M=g;for(-1<M&&this.loadLevel(M);g<w;g++)y[g].morph&&(-1<S?y[g].morph.visible=!1:(y[g].morph.visible=!0,S=g));this._currentLevel!=S&&(this._currentLevel=S,this.checkTransparentMesh())}},this.toggleMarker=(d,b)=>{this.levels.forEach(y=>{y.morph&&(b?y.morph.add(d):y.morph.remove(d))})};var m=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&(d.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>v});var c=u(13),f=u(4),h=new f.Vector3,p=new f.Vector3;class v extends c.Line{constructor(d,b){super(d,b),this.type="LineSegments"}computeLineDistances(){var d=this.geometry;if(!d.isBufferGeometry)d.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(d.index===null){for(var b=d.attributes.position,y=[],g=0,w=b.count;g<w;g+=2)h.fromBufferAttribute(b,g),p.fromBufferAttribute(b,g+1),y[g]=g==0?0:y[g-1],y[g+1]=y[g]+h.distanceTo(p);d.setAttribute("lineDistance",new f.Float32BufferAttribute(y,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}v.prototype.isLineSegments=!0},(o,l,u)=>{u.r(l),u.d(l,{Line:()=>w});var c=u(4),f=new c.Vector3,h=new c.Vector3,p=new c.Matrix4,v=new c.Ray,m=new c.Sphere,d=new c.Vector3,b=new c.Vector3,y=new c.Vector3,g=new c.Vector3;class w extends c.Object3D{constructor(){var M=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,F=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=M,this.material=F,this.updateMorphTargets()}copy(M){return super.copy(M),this.material=M.material,this.geometry=M.geometry,this}computeLineDistances(){var M=this.geometry;if(!M.isBufferGeometry)M.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(M.index===null){for(var F=M.attributes.position,R=[0],T=1,P=F.count;T<P;T++)f.fromBufferAttribute(F,T-1),h.fromBufferAttribute(F,T),R[T]=R[T-1],R[T]+=f.distanceTo(h);M.setAttribute("lineDistance",new c.Float32BufferAttribute(R,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(M,F){var R=this.geometry,T=this.matrixWorld,P=M.params.Line.threshold,_=R.drawRange,E=R.morphAttributes.position;if(R.boundingSphere===null&&R.computeBoundingSphere(),m.copy(R.boundingSphere),m.applyMatrix4(T),m.radius+=P,M.ray.intersectsSphere(m)!==!1){p.copy(T).invert(),v.copy(M.ray).applyMatrix4(p);var C=P/((this.scale.x+this.scale.y+this.scale.z)/3),L=C*C,I=new c.Vector3,x=new c.Vector3,O=new c.Vector3,B=new c.Vector3,D=this.isLineSegments?2:1;if(R.isBufferGeometry){var k=R.index,V=R.attributes,G=V.position;if(k!==null)for(var J=Math.max(0,_.start),j=Math.min(k.count,_.start+_.count),te=J;te<j-1;te+=D){var ee=k.getX(te),ae=k.getX(te+1);A(I,x,this,G,E,ee,ae);var H=v.distanceSqToSegment(I,x,B,O);if(!(H>L)){B.applyMatrix4(this.matrixWorld);var Z=M.ray.origin.distanceTo(B);Z<M.near||Z>M.far||F.push({distance:Z,point:O.clone().applyMatrix4(this.matrixWorld),index:te,face:null,faceIndex:null,object:this})}}else for(var $=Math.max(0,_.start),se=Math.min(G.count,_.start+_.count),z=$;z<se-1;z+=D){A(I,x,this,G,E,z,z+1);var W=v.distanceSqToSegment(I,x,B,O);if(!(W>L)){B.applyMatrix4(this.matrixWorld);var q=M.ray.origin.distanceTo(B);q<M.near||q>M.far||F.push({distance:q,point:O.clone().applyMatrix4(this.matrixWorld),index:z,face:null,faceIndex:null,object:this})}}}else R.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var M=this.geometry;if(M.isBufferGeometry){var F=M.morphAttributes,R=Object.keys(F);if(0<R.length){var T=F[R[0]];if(T!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var P,_=0,E=T.length;_<E;_++)P=T[_].name||_+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[P]=_}}}else{var C=M.morphTargets;C!==void 0&&0<C.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function A(S,M,F,R,T,P,_){S.fromBufferAttribute(R,P),M.fromBufferAttribute(R,_);var E=F.morphTargetInfluences;if(F.material.morphTargets&&T&&E){d.set(0,0,0),b.set(0,0,0);for(var C=0,L=T.length;C<L;C++){var I=E[C],x=T[C];I!==0&&(y.fromBufferAttribute(x,P),g.fromBufferAttribute(x,_),d.addScaledVector(y.sub(S),I),b.addScaledVector(g.sub(M),I))}S.add(d),M.add(b)}}w.prototype.isLine=!0},(o,l,u)=>{var c=u(4),f=new Image(128,128);f.src=u(15);var h=new c.Texture;h.image=f,h.needsUpdate=!0;var p=[.02,.03,1],v=new c.SpriteMaterial({map:h,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),m=u(5).createNewSpriteText,d=function(b){u(10).ZincObject.call(this),this.texture=h;var y=void 0,g=void 0,w=void 0,A=void 0,S=void 0,M=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var F=!1;this.ndc=new c.Vector3;var R=void 0,T=void 0,P=()=>{y=new c.Sprite(v),y.center.set(.5,0),this.morph.add(y),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,y.scale.set(p[0],p[1],p[2]),y.userData=this};this.updateVisual=(_,E)=>{var C=1,L=0;_!==E&&(L=1-(this.ndc.z-_)/(E-_),C=.6+.4*L),this.setSpriteSize(C)},this.updateNDC=_=>(this.ndc.copy(this.morph.position),this.ndc.project(_),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(_,E,C)=>{this.morph.position.set(_,E,C)},this.setSpriteSize=_=>{y.scale.set(.015,.02,1),y.scale.multiplyScalar(_)},this.setUserSprite=()=>{A&&(this.morph.add(A),M&&(this.morph.remove(y),T&&this.morph.remove(T),M=!1))},this.setImageForUserSprite=(_,E)=>{A&&(this.morph.remove(A),A=void 0),g&&g.dispose(),w&&w.dispose(),g=new c.Texture,g.image=_,g.needsUpdate=!0,w=new c.SpriteMaterial({map:g,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),E||(E=[.05,.05,1]),A=new c.Sprite(w),A.center.set(.5,0),A.scale.set(E[0],E[1],E[2]),A.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{M||(M=!0,this.morph.add(y),A&&this.morph.remove(A),T&&this.morph.add(T))},this.loadUserSprite=(_,E)=>{if(_)if(_!==S){S=_;var C=new Image(128,128);C.crossOrigin="anonymous",C.onload=()=>{this.setImageForUserSprite(C,E)},C.src=_}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),y&&(y.clear(),y=void 0),T&&(T.material.map.dispose(),T.material.dispose(),T=void 0)},this.isEnabled=()=>F,this.setNumber=_=>{(!_||R!=_)&&T&&(this.morph.remove(T),T.material.map.dispose(),T.material.dispose(),T=void 0),!T&&_&&(T=m(_,.012,"black","Asap",120,700),this.morph.add(T)),R=_},this.getNumber=()=>R||1,this.setVisibility=function(_){_!==this.visible&&(this.visible=_,this.group.visible=_,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{F=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{F=!1,this.morph.visible=!1,this.visible=!1},P()};d.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=d},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="},(o,l,u)=>{var c=u(4),f=function(h,p,v,m){u(10).ZincObject.call(this);var d;p&&(d=p.clone(),d.vertexColors=c.FaceColors),this.id=v;var b=void 0,y=void 0;this.isGlyph=!0;var g=[0,0,0];this.fromMesh=w=>!!(w&&w.isMesh)&&(this.morph=w.clone(),this.morph.userData=this,this.group.add(this.morph),!0),h&&d&&this.fromMesh(new c.Mesh(h,d)),this.getGlyphset=function(){return m},this.setLabel=w=>{w&&(typeof w=="string"||w instanceof String)&&(y=w,this.morph&&(this.morph.name=w))},this.showLabel=w=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),y&&(typeof y=="string"||y instanceof String)&&(b=new(u(17)).Label(y,w),b.setPosition(g[0],g[1],g[2]),this.group.add(b.getSprite()))},this.hideLabel=()=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0)},this.getLabel=()=>y,this.getMesh=()=>this.morph,this.setTransformation=(w,A,S,M)=>{this.morph&&(this.morph.matrix.elements[0]=A[0],this.morph.matrix.elements[1]=A[1],this.morph.matrix.elements[2]=A[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=S[0],this.morph.matrix.elements[5]=S[1],this.morph.matrix.elements[6]=S[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=M[0],this.morph.matrix.elements[9]=M[1],this.morph.matrix.elements[10]=M[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=w[0],this.morph.matrix.elements[13]=w[1],this.morph.matrix.elements[14]=w[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),g=[...w],b&&b.setPosition(w[0],w[1],w[2])},this.setColour=w=>{b&&b.setColour(w),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry&&(this.geometry.colorsNeedUpdate=!0)},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};f.prototype=Object.create(u(10).ZincObject.prototype),l.Glyph=f},(o,l,u)=>{var c=u(7).default;l.Label=function(f,h){var p=f,v=void 0;v=h?new c(p,.015,h.getStyle()):new c(p,.015),v.fontFace="Asap",v.fontWeight=700,v.material.map.generateMipmaps=!1,v.material.sizeAttenuation=!1,v.center.x=-.05,v.center.y=0,this.getPosition=()=>v?[v.position.x,v.position.y,v.position.z]:[0,0,0],this.setPosition=(m,d,b)=>{v&&v.position.set(m,d,b)},this.setColour=m=>{v.color=m.getStyle()},this.setScale=m=>{v&&0<m&&v.scale.set(m,m,1)},this.dispose=()=>{},this.getSprite=()=>v,this.getString=()=>p}},(o,l,u)=>{var c=u(4),f=u(19).JSONLoader,h=function(){u(10).ZincObject.call(this);var p=[],v=void 0,m=void 0,d=void 0,b=void 0,y=void 0,g=void 0,w=void 0,A=0,S=0,M=[0,0,0],F=[0,0,0],R=[0,0,0],T="NONE";this.ready=!1;var P=!1,_=!1;this.isGlyphset=!0;var E=new c.Matrix4,C=new c.Color,L=new c.Color,I=new c.Box3,x=new c.Box3,O=new c.Box3,B=[],D=[],k=[],V=[],G=[],J=[],j=[];this.globalScale=1;for(var te=0;8>te;te++)new c.Vector3;this.load=(z,W,q,le,oe)=>{v=z.axis1,m=z.axis2,d=z.axis3,b=z.positions,y=z.scale,g=z.colors,w=z.label,P=z.metadata.MorphColours,_=z.metadata.MorphVertices,A=z.metadata.number_of_time_steps,T=z.metadata.repeat_mode,S=z.metadata.number_of_vertices,T=="AXES_2D"||T=="MIRROR"?S*=2:T=="AXES_3D"&&(S*=3),M=z.metadata.base_size,F=z.metadata.offset,R=z.metadata.scale_factors;var U=new f;this.geometry=new c.BufferGeometry;var N=new c.InstancedMesh(this.geometry,void 0,S);if(this.setMorph(N),le){var X=U.parse(W);se(q,oe)(X.geometry,X.materials),X.geometry.dispose()}else U.crossOrigin="Anonymous",U.load(W,se(q,oe))};var ee=(z,W,q,le,oe,U)=>{if(T=="NONE"||T=="MIRROR"){for(var N,X=[0,0,0],Y=[0,0,0],ie=[0,0,0],ue=[0,0,0],me=[0,0,0],be=[0,0,0],ce=[0,0,0],ge=[0,0,0],re=[0,0,0],he=0;3>he;he++)N=0>oe[he]?-1:1,X[he]=(N*M[he]+oe[he]*R[he])*this.globalScale;for(var he=0;3>he;he++)Y[he]=W[he]*X[0],ie[he]=q[he]*X[1],ue[he]=le[he]*X[2],me[he]=z[he]+F[0]*Y[he]+F[1]*ie[he]+F[2]*ue[he],T=="MIRROR"&&(be[he]=-Y[he],ce[he]=-ie[he],ge[he]=-ue[he],re[he]=me[he],0>oe[0]&&(me[he]-=Y[he],re[he]-=be[he]));0>ue[0]*(Y[1]*ie[2]-Y[2]*ie[1])+ue[1]*(Y[2]*ie[0]-Y[0]*ie[2])+ue[2]*(Y[0]*ie[1]-Y[1]*ie[0])&&(ue[0]=-ue[0],ue[1]=-ue[1],ue[2]=-ue[2]),U[0]=[me,Y,ie,ue],T=="MIRROR"&&(0>ge[0]*(be[1]*ce[2]-be[2]*ce[1])+ge[1]*(be[2]*ce[0]-be[0]*ce[2])+ge[2]*(be[0]*ce[1]-be[1]*ce[0])&&(ge[0]=-ge[0],ge[1]=-ge[1],ge[2]=-ge[2]),U[1]=[re,be,ce,ge])}else if(T=="AXES_2D"||T=="AXES_3D"){for(var N,ve=[0,0,0],Ee=[0,0,0],he=0;3>he;he++)N=0>oe[he]?-1:1,ve[he]=(N*M[0]+oe[he]*R[0])*this.globalScale;for(var he=0;3>he;he++)Ee[he]=z[he]+F[0]*ve[0]*W[he]+F[1]*ve[1]*q[he]+F[2]*ve[2]*le[he];for(var _e=glyph_repeat_mode=="AXES_2D"?2:3,Ne=0;Ne<_e;Ne++){var Je=void 0,ze=void 0,st=oe[Ne],Ce=[0,0,0],je=[0,0,0],He=[0,0,0];Ne==0?(Je=W,ze=q):Ne==1?(Je=q,ze=glyph_repeat_mode=="AXES_2D"?W:le):(Je=le,ze=W);var Pt=(M[0]+st*R[0])*this.globalScale;Ce[0]=Je[0]*Pt,Ce[1]=Je[1]*Pt,Ce[2]=Je[2]*Pt,He[0]=Ce[1]*ze[2]-ze[1]*Ce[2],He[1]=Ce[2]*ze[0]-ze[2]*Ce[0],He[2]=Ce[0]*ze[1]-Ce[1]*ze[0];var It=Math.sqrt(He[0]*He[0]+He[1]*He[1]+He[2]*He[2]);if(0<It){var mt=(M[2]+st*R[2])*this.globalScale/It;T=="AXES_2D"&&0<Ne&&(mt*=-1),He[0]*=mt,He[1]*=mt,He[2]*=mt}if(je[0]=He[1]*Ce[2]-Ce[1]*He[2],je[1]=He[2]*Ce[0]-Ce[2]*He[0],je[2]=He[0]*Ce[1]-He[1]*Ce[0],It=Math.sqrt(je[0]*je[0]+je[1]*je[1]+je[2]*je[2]),0<It){var bt=(M[1]+st*R[1])*this.globalScale/It;je[0]*=bt,je[1]*=bt,je[2]*=bt}U[Ne]=[Ee,Ce,je,He]}}return U},ae=(z,W,q,le,oe)=>{var U=1;T=="AXES_2D"||T=="MIRROR"?U=2:T=="AXES_3D"&&(U=3);var N=z.length/3,X=0;j.length=U;for(var Y=0;Y<N;Y++){var ie=3*Y,ue=[z[ie],z[ie+1],z[ie+2]],me=[W[ie],W[ie+1],W[ie+2]],be=[q[ie],q[ie+1],q[ie+2]],ce=[le[ie],le[ie+1],le[ie+2]],ge=[oe[ie],oe[ie+1],oe[ie+2]],re=ee(ue,me,be,ce,ge,j);if(re.length==U)for(var he=0;he<U;he++){E.elements[0]=re[he][1][0],E.elements[1]=re[he][1][1],E.elements[2]=re[he][1][2],E.elements[3]=0,E.elements[4]=re[he][2][0],E.elements[5]=re[he][2][1],E.elements[6]=re[he][2][2],E.elements[7]=0,E.elements[8]=re[he][3][0],E.elements[9]=re[he][3][1],E.elements[10]=re[he][3][2],E.elements[11]=0,E.elements[12]=re[he][0][0],E.elements[13]=re[he][0][1],E.elements[14]=re[he][0][2],E.elements[15]=1,this.morph.setMatrixAt(X,E);var ve=p[X];ve&&ve.setTransformation(re[he][0],re[he][1],re[he][2],re[he][3]),X++}}this.morph.instanceMatrix.needsUpdate=!0},H=z=>{var W=1;T=="AXES_2D"||T=="MIRROR"?W=2:T=="AXES_3D"&&(W=3);for(var q,le=z.length,oe=0,U=0;U<le;U++){q=z[U];for(var N=0;N<W;N++){C.setHex(q),this.morph.setColorAt(oe,C);var X=p[oe];X&&X.setColour(C),oe++}}this.morph.instanceColor.needsUpdate=!0},Z=()=>{var z=B,W=D,q=k,le=V,oe=G,U=J,N=this.inbuildTime/this.duration*(A-1),X=Math.floor(N),Y=1-(N-X),ie=Math.ceil(N);if(_){var ue=b[X.toString()],me=b[ie.toString()],be=v[X.toString()],ce=v[ie.toString()],ge=m[X.toString()],re=m[ie.toString()],he=d[X.toString()],ve=d[ie.toString()],Ee=y[X.toString()],_e=y[ie.toString()];B.length=ue.length,D.length=ue.length,k.length=ue.length,V.length=ue.length,G.length=ue.length;for(var Ne=0;Ne<ue.length;Ne++)z[Ne]=Y*ue[Ne]+(1-Y)*me[Ne],W[Ne]=Y*be[Ne]+(1-Y)*ce[Ne],q[Ne]=Y*ge[Ne]+(1-Y)*re[Ne],le[Ne]=Y*he[Ne]+(1-Y)*ve[Ne],oe[Ne]=Y*Ee[Ne]+(1-Y)*_e[Ne]}else z=b[0],W=v[0],q=m[0],le=d[0],oe=y[0];if(ae(z,W,q,le,oe),this.boundingBoxUpdateRequired=!0,g!=null){if(P){var Je=g[X.toString()],ze=g[ie.toString()];U.length=Je.length;for(var st=0;st<Je.length;st++)C.setHex(Je[st]),L.setHex(ze[st]),C.setRGB(C.r*Y+L.r*(1-Y),C.g*Y+L.g*(1-Y),C.b*Y+L.b*(1-Y)),U[st]=C.getHex()}else U=g[0];H(U)}};this.showLabel=()=>{for(var z=0;z<p.length;z++)p[z].showLabel(this.morph.material?this.morph.material.color:void 0)},this.hideLabel=()=>{for(var z=0;z<p.length;z++)p[z].hideLabel()};var $=z=>{for(var W=0;W<S;W++){var q=new(u(16)).Glyph(void 0,void 0,W,this),le=w?w[W]:void 0;le=le||this.groupName,le&&q.setLabel(le),0<A&&q.setFrustumCulled(!1),p[W]=q,this.morph.add(q.getGroup())}z&&this.showLabel(),ae(b[0],v[0],m[0],d[0],y[0]),g!=null&&H(g[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};this.addCustomGlyph=z=>{z.isGlyph&&p.push(z),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(z,W)=>{if(z.isMesh){var q=new(u(16)).Glyph(void 0,void 0,W,this);return q.fromMesh(z),p.push(q),this.morph.add(q.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,q}},this.forEachGlyph=z=>{for(var W=0;W<p.length;W++)z(p[W])};var se=(z,W)=>(q,le)=>{var oe=q.toBufferGeometry();this.geometry.copy(oe),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),oe.dispose(),le&&le[0]&&(this.morph.material=le[0]),$(W),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),q.dispose(),z!=null&&typeof z=="function"&&z(this)};this.getClosestVertexIndex=function(){var z=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var W,q=b[0],le=q.length/3,oe=-1,U=0,N=0;N<le;N++)W=3*N,this._v2.set(q[W],q[W+1],q[W+2]),U=this._v1.distanceTo(this._v2),(oe==-1||oe>U)&&(oe=U,z=N)}return z},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var z=new c.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,E),z.setFromMatrixPosition(E),z}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){I.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var z=0;z<S;z++)this.morph.getMatrixAt(z,E),x.copy(I).applyMatrix4(E),z==0?O.copy(x):O.union(x);if(O)this.cachedBoundingBox.copy(O),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=z=>{this.inbuildTime=z>this.duration?this.duration:0>z?0:z,(P||_)&&(Z(),_&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<A)&&(P||_)),this.getCurrentTime=()=>this.inbuildTime,this.setScaleAll=function(z){this.globalScale=z,Z()},this.dispose=()=>{for(var z=p.length-1;0<=z;z--)p[z].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),v=void 0,m=void 0,d=void 0,b=void 0,y=void 0,g=void 0,this.ready=!1,this.groupName=void 0},this.render=(z,W,q)=>{if(W==!0){var le=this.inbuildTime+z;le>this.duration&&(le-=this.duration),this.inbuildTime=le,(P||_)&&Z()}this.updateMarker(W,q)}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=h},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>M});var c=u(4),f=u(20).Loader,h=c.LoaderUtils,p=c.AnimationClip,v=c.Vector3,m=c.Vector4,d=c.Color,b=c.Vector2,y=u(6).Face3,g=u(6).Geometry,w=c.FileLoader,A=c.DefaultLoadingManager,S=u(21).VideoHandler;function M(F){typeof F=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),F=void 0),this.manager=F===void 0?A:F,this.withCredentials=!1,this.paramsString=""}Object.assign(M.prototype,{load:function(R,T,P,_){var E=this,C=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:h.extractUrlBase(R),L=new w(this.manager);R.split("?"),this.paramsString=R.length===2?paramsStrings[1]:"",L.setWithCredentials(this.withCredentials),L.load(R,function(I){var x;try{x=JSON.parse(I)}catch{if(console.error("The loader has encountered an error while parsing the content of a resource."),_)return void _({responseURL:R})}var O=x.metadata;if(O!==void 0){var B=O.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+R+" should be loaded with THREE.ObjectLoader instead.")}if(E&&E.parse)try{var D=E.parse(x,C);T(D.geometry,D.materials)}catch(k){if(console.error("The loader has encountered aon loading the geometry"),console.error(k),_)return void _({responseURL:R})}},P,_)},setTexturePath:function(R){this.texturePath=R},parse:function(){function F(_,E){function C(he,ve){return he&1<<ve}var L,I,x,O,B,D,k,V,G,J,j,te,ee,ae,H,Z,$,se,z,W,q,le,oe,U,N,X,Y,ie=_.faces,ue=_.vertices,me=_.normals,be=_.colors,ce=_.scale,ge=0;if(_.uvs!==void 0){for(L=0;L<_.uvs.length;L++)_.uvs[L].length&&ge++;for(L=0;L<ge;L++)E.faceVertexUvs[L]=[]}for(O=0,B=ue.length;O<B;)se=new v,se.x=ue[O++]*ce,se.y=ue[O++]*ce,se.z=ue[O++]*ce,E.vertices.push(se);if(O=0,B=ie.length,_.uvs)for(L=0;L<_.uvs.length;L++){E.uvs[L]=[];for(var re=0;re<_.uvs[L].length;re++)E.uvs[L][re]=_.uvs[L][re]}if(me)for(L=0;L<me.length;L++)E.normals[L]=me[L];if(be)for(L=0;L<be.length;L++)E.colors[L]=be[L];for(;O<B;)if(J=ie[O++],j=C(J,0),te=C(J,1),ee=C(J,3),ae=C(J,4),H=C(J,5),Z=C(J,6),$=C(J,7),j){if(W=new y,W.a=ie[O],W.b=ie[O+1],W.c=ie[O+3],q=new y,q.a=ie[O+1],q.b=ie[O+2],q.c=ie[O+3],O+=4,te&&(G=ie[O++],W.materialIndex=G,q.materialIndex=G),x=E.faces.length,ee)for(L=0;L<ge;L++)for(U=_.uvs[L],E.faceVertexUvs[L][x]=[],E.faceVertexUvs[L][x+1]=[],I=0;4>I;I++)V=ie[O++],X=U[2*V],Y=U[2*V+1],N=new b(X,Y),I!==2&&E.faceVertexUvs[L][x].push(N),I!==0&&E.faceVertexUvs[L][x+1].push(N);if(ae&&(k=3*ie[O++],W.normal.set(me[k++],me[k++],me[k]),q.normal.copy(W.normal)),H)for(L=0;4>L;L++)k=3*ie[O++],oe=new v(me[k++],me[k++],me[k]),L!==2&&W.vertexNormals.push(oe),L!==0&&q.vertexNormals.push(oe);if(Z&&(D=ie[O++],le=be[D],W.color.setHex(le),q.color.setHex(le)),$)for(L=0;4>L;L++)D=ie[O++],le=be[D],L!==2&&W.vertexColors.push(new d(le)),L!==0&&q.vertexColors.push(new d(le));E.faces.push(W),E.faces.push(q)}else{if(z=new y,z.a=ie[O++],z.b=ie[O++],z.c=ie[O++],te&&(G=ie[O++],z.materialIndex=G),x=E.faces.length,ee)for(L=0;L<ge;L++)for(U=_.uvs[L],E.faceVertexUvs[L][x]=[],I=0;3>I;I++)V=ie[O++],X=U[2*V],Y=U[2*V+1],N=new b(X,Y),E.faceVertexUvs[L][x].push(N);if(ae&&(k=3*ie[O++],z.normal.set(me[k++],me[k++],me[k])),H)for(L=0;3>L;L++)k=3*ie[O++],oe=new v(me[k++],me[k++],me[k]),z.vertexNormals.push(oe);if(Z&&(D=ie[O++],z.color.setHex(be[D])),$)for(L=0;3>L;L++)D=ie[O++],z.vertexColors.push(new d(be[D]));E.faces.push(z)}}function R(_,E){var C=_.influencesPerVertex===void 0?2:_.influencesPerVertex;if(_.skinWeights)for(var L=0,I=_.skinWeights.length;L<I;L+=C){var x=_.skinWeights[L],O=1<C?_.skinWeights[L+1]:0,B=2<C?_.skinWeights[L+2]:0,D=3<C?_.skinWeights[L+3]:0;E.skinWeights.push(new m(x,O,B,D))}if(_.skinIndices)for(var L=0,I=_.skinIndices.length;L<I;L+=C){var k=_.skinIndices[L],V=1<C?_.skinIndices[L+1]:0,G=2<C?_.skinIndices[L+2]:0,J=3<C?_.skinIndices[L+3]:0;E.skinIndices.push(new m(k,V,G,J))}E.bones=_.bones,E.bones&&0<E.bones.length&&(E.skinWeights.length!==E.skinIndices.length||E.skinIndices.length!==E.vertices.length)&&console.warn("When skinning, number of vertices ("+E.vertices.length+"), skinIndices ("+E.skinIndices.length+"), and skinWeights ("+E.skinWeights.length+") should match.")}function T(_,E){var C=_.scale;if(_.morphTargets!==void 0)for(var L=0,I=_.morphTargets.length;L<I;L++){E.morphTargets[L]={},E.morphTargets[L].name=_.morphTargets[L].name,E.morphTargets[L].vertices=[];for(var x,O=E.morphTargets[L].vertices,B=_.morphTargets[L].vertices,D=0,k=B.length;D<k;D+=3)x=new v,x.x=B[D]*C,x.y=B[D+1]*C,x.z=B[D+2]*C,O.push(x)}if(_.morphNormals!==void 0){for(var L=0,I=_.morphNormals.length;L<I;L++)if(E.morphTargets[L]){E.morphTargets[L].normals=[];for(var V,G=E.morphTargets[L].normals,J=_.morphNormals[L].normals,D=0,k=J.length;D<k;D+=3)V=new v,V.x=J[D],V.y=J[D+1],V.z=J[D+2],G.push(V);E.morphNormalsReady=!0}}if(_.morphColors!==void 0){var L,I,j,te,ee,ae,H;for(L=0,I=_.morphColors.length;L<I;L++)for(E.morphColors[L]={},E.morphColors[L].name=_.morphColors[L].name,E.morphColors[L].colors=[],ee=E.morphColors[L].colors,ae=_.morphColors[L].colors,j=0,te=ae.length;j<te;j+=3)H=new c.Color(16755200),H.setRGB(ae[j],ae[j+1],ae[j+2]),ee.push(H)}}function P(_,E){var C=[],L=[];_.animation!==void 0&&L.push(_.animation),_.animations!==void 0&&(_.animations.length?L=L.concat(_.animations):L.push(_.animations));for(var I,x=0;x<L.length;x++)I=p.parseAnimation(L[x],E.bones),I&&C.push(I);if(E.morphTargets){var O=p.CreateClipsFromMorphTargetSequences(E.morphTargets,10);C=C.concat(O)}0<C.length&&(E.animations=C)}return function(_,E){_.data!==void 0&&(_=_.data),_.scale=_.scale===void 0?1:1/_.scale;var C=new g;if(C.morphColors=[],F(_,C),R(_,C),T(_,C),P(_,C),C.computeFaceNormals(),C.computeBoundingSphere(),_.materials===void 0||_.materials.length===0)return{geometry:C};var L=f.prototype.initMaterials(_.materials,E,"Anonymous");if(_.materials[0].video){var I=E+_.materials[0].video;this.paramsString&&(I+="?".concat(this.paramsString));var x=new S(I);C._video=x}return L&&0<L.length&&(L[0].side=_.materials[0].singleSided?c.FrontSide:_.materials[0].flipSided?c.BackSide:c.DoubleSide,_.materials[0].specularCoef&&(L[0].shininess=Math.floor(_.materials[0].specularCoef/3))),{geometry:C,materials:L}}}()})},(o,l,u)=>{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(p,v){this.handlers.push(p,v)},get:function(p){for(var v=this.handlers,m=0,d=v.length;m<d;m+=2){var b=v[m],y=v[m+1];if(b.test(p))return y}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(p,v,m){for(var d=[],b=0;b<p.length;++b)d[b]=this.createMaterial(p[b],v,m);return d},createMaterial:function(){var h={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},p=new c.Color,v=new c.TextureLoader,m=new c.MaterialLoader;return function(d,b,y){function g(F,R,T,P,_){var E,C=b+F,L=f.Handlers.get(C);L===null?(v.setCrossOrigin(y),E=v.load(C)):E=L.load(C),R!==void 0&&(E.repeat.fromArray(R),R[0]!==1&&(E.wrapS=c.RepeatWrapping),R[1]!==1&&(E.wrapT=c.RepeatWrapping)),T!==void 0&&E.offset.fromArray(T),P!==void 0&&(P[0]==="repeat"&&(E.wrapS=c.RepeatWrapping),P[0]==="mirror"&&(E.wrapS=c.MirroredRepeatWrapping),P[1]==="repeat"&&(E.wrapT=c.RepeatWrapping),P[1]==="mirror"&&(E.wrapT=c.MirroredRepeatWrapping)),_!==void 0&&(E.anisotropy=_);var I=c.MathUtils.generateUUID();return w[I]=E,I}var w={},A={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var S in d){var M=d[S];switch(S){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":A.name=M;break;case"blending":A.blending=h[M];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",S,"is no longer supported.");break;case"colorDiffuse":A.color=p.fromArray(M).getHex();break;case"colorSpecular":A.specular=p.fromArray(M).getHex();break;case"colorEmissive":A.emissive=p.fromArray(M).getHex();break;case"specularCoef":A.shininess=M;break;case"shading":M.toLowerCase()==="basic"&&(A.type="MeshBasicMaterial"),M.toLowerCase()==="phong"&&(A.type="MeshPhongMaterial"),M.toLowerCase()==="standard"&&(A.type="MeshStandardMaterial");break;case"mapDiffuse":A.map=g(M,d.mapDiffuseRepeat,d.mapDiffuseOffset,d.mapDiffuseWrap,d.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":A.emissiveMap=g(M,d.mapEmissiveRepeat,d.mapEmissiveOffset,d.mapEmissiveWrap,d.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":A.lightMap=g(M,d.mapLightRepeat,d.mapLightOffset,d.mapLightWrap,d.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":A.aoMap=g(M,d.mapAORepeat,d.mapAOOffset,d.mapAOWrap,d.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":A.bumpMap=g(M,d.mapBumpRepeat,d.mapBumpOffset,d.mapBumpWrap,d.mapBumpAnisotropy);break;case"mapBumpScale":A.bumpScale=M;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":A.normalMap=g(M,d.mapNormalRepeat,d.mapNormalOffset,d.mapNormalWrap,d.mapNormalAnisotropy);break;case"mapNormalFactor":A.normalScale=M;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":A.specularMap=g(M,d.mapSpecularRepeat,d.mapSpecularOffset,d.mapSpecularWrap,d.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":A.metalnessMap=g(M,d.mapMetalnessRepeat,d.mapMetalnessOffset,d.mapMetalnessWrap,d.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":A.roughnessMap=g(M,d.mapRoughnessRepeat,d.mapRoughnessOffset,d.mapRoughnessWrap,d.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":A.alphaMap=g(M,d.mapAlphaRepeat,d.mapAlphaOffset,d.mapAlphaWrap,d.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":A.side=c.BackSide;break;case"doubleSided":A.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),A.opacity=M;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":A[S]=M;break;case"vertexColors":M===!0&&(A.vertexColors=c.VertexColors),M==="face"&&(A.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",S,M)}}return A.type==="MeshBasicMaterial"&&delete A.emissive,A.type!=="MeshPhongMaterial"&&delete A.specular,1>A.opacity&&(A.transparent=!0),m.setTextures(w),m.parse(A)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var h=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(p,v){var m=p/v*h.video.duration;h.video.currentTime=m},this.getVideoDuration=function(){return h.video.duration},this.createCanvasVideoTexture=function(){return h.videoTexture=new c.VideoTexture(h.video),h.videoTexture.minFilter=c.LinearFilter,h.videoTexture.magFilter=c.LinearFilter,h.videoTexture.format=c.RGBFormat,h.video.currentTime=0,h.videoTexture},this.getCurrentTime=function(p){return h.video?p*(h.video.currentTime/h.video.duration):0},this.isReadyToPlay=function(){return!!(h.video&&3<=h.video.readyState)},function(){document&&(h.video=document.createElement("video"),h.video.crossOrigin="anonymous",h.video.src=f,h.video.load(),h.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,h=u(5).toBufferGeometry,p=u(5).getCircularTexture,v=u(17).Label,m=function(){u(10).ZincObject.call(this),this.isPointset=!0;var d=[];this.createMesh=(y,g,w)=>{if(y&&g){var A=h(y,w),S=p();g.map=S;var M=new f(A,g);this.setMesh(M,w.localTimeEnabled,w.localMorphColour)}};var b=(y,g,w,A)=>{if(w){var S=new c.Color(A),M=new v(w,S);M.setPosition(g[0],g[1],g[2]);var F=M.getSprite();F.material.sizeAttenuation=!1,F.material.alphaTest=.5,F.material.transparent=!0,F.material.depthWrite=!1,F.material.depthTest=!1,this.group.add(F),d[y]=M}};this.addPoints=(y,g,w)=>{if(y&&0<y.length){var A=this.drawRange-1,S=this.addVertices(y),M=this.getMorph();if(!M){var F=new c.PointsMaterial({alphaTest:.5,size:10,color:w,sizeAttenuation:!1});S.colorsNeedUpdate=!0,this.createMesh(S,F,{localTimeEnabled:!1,localMorphColour:!1})}var R=A+y.length,T=0;if(Array.isArray(g)&&g.length===y.length||typeof g=="string")for(A;A+T<R;){var P=typeof g=="string"?g:g[T];b(T,y[T],P,w),T++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setSize=y=>{this.morph&&this.morph.material&&(this.morph.material.size=y,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=y=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=y,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(y){if(0<=y&&this.drawRange>y){var g=this.getMorph().geometry.getAttribute("position");return[g.getX(y),g.getY(y),g.getZ(y)]}},this.editVertices=function(y,g){if(y&&y.length){var w=this.getMorph(),A=g+y.length-1;if(!w||0>g||A>=this.drawRange)return;var S=w.geometry.getAttribute("position"),M=g;y.forEach(F=>{var R=d[M];R&&R.setPosition(F[0],F[1],F[2]),S.setXYZ(M++,F[0],F[1],F[2])}),S.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(y,g,w,A)=>{this.morph&&w&&(this.morph.sizePerPixel=w.pixelHeight),m.prototype.render.call(this,y,g,w,A)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=m},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,h=new c.Ray,p=new c.Sphere,v=new c.Vector3,m=new c.Vector3,d=new c.Vector3;class b extends c.Object3D{constructor(){var A=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,S=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.PointsMaterial;super(),this.type="Points",this.geometry=A,this.material=S,this.sizePerPixel=1,this.updateMorphTargets()}copy(A){return super.copy(A),this.material=A.material,this.geometry=A.geometry,this}raycast(A,S){var M=this.geometry,F=this.matrixWorld,R=A.params.Points.threshold,T=M.drawRange;if(M.boundingSphere===null&&M.computeBoundingSphere(),p.copy(M.boundingSphere),p.applyMatrix4(F),p.radius+=R,A.ray.intersectsSphere(p)!==!1){f.copy(F).invert(),h.copy(A.ray).applyMatrix4(f);var P=R/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,_=P*P;if(M.isBufferGeometry){var E=M.index,C=M.attributes,L=C.position,I=M.morphAttributes.position;if(E!==null)for(var x,O=Math.max(0,T.start),B=Math.min(E.count,T.start+T.count),D=O;D<B;D++)x=E.getX(D),g(this,L,I,x),y(v,x,_,F,A,S,this);else for(var k=Math.max(0,T.start),V=Math.min(L.count,T.start+T.count),G=k;G<V;G++)g(this,L,I,G),y(v,G,_,F,A,S,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var A=this.geometry;if(A.isBufferGeometry){var S=A.morphAttributes,M=Object.keys(S);if(0<M.length){var F=S[M[0]];if(F!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var R,T=0,P=F.length;T<P;T++)R=F[T].name||T+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[R]=T}}}else{var _=A.morphTargets;_!==void 0&&0<_.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function y(w,A,S,M,F,R,T){var P=h.distanceSqToPoint(w);if(P<S){var _=new c.Vector3;h.closestPointToPoint(w,_),_.applyMatrix4(M);var E=F.ray.origin.distanceTo(_);if(E<F.near||E>F.far)return;R.push({distance:E,distanceToRay:Math.sqrt(P),point:_,index:A,face:null,object:T})}}function g(w,A,S,M){v.fromBufferAttribute(A,M);var F=w.morphTargetInfluences;if(w.material.morphTargets&&S&&F){m.set(0,0,0);for(var R=0,T=S.length;R<T;R++){var P=F[R],_=S[R];P!==0&&(d.fromBufferAttribute(_,M),m.addScaledVector(d.sub(v),P))}v.add(m)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,h=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(p,v,m)=>{if(p&&v){var d=f(p,m);m.localMorphColour&&d.morphAttributes.color&&(v.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(d,v);this.setMesh(b,m.localTimeEnabled,m.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addLines=(p,v)=>{if(p&&0<p.length){var m=this.addVertices(p),d=this.getMorph();if(!d){var b=new c.LineBasicMaterial({color:v});m.colorsNeedUpdate=!0,this.createLineSegment(m,b,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Lines=h},(o,l,u)=>{function c(v,m,d,b,y,g,w){try{var A=v[g](w),S=A.value}catch(M){return void d(M)}A.done?m(S):Promise.resolve(S).then(b,y)}function f(v){return function(){var m=this,d=arguments;return new Promise(function(b,y){function g(S){c(A,b,y,g,w,"next",S)}function w(S){c(A,b,y,g,w,"throw",S)}var A=v.apply(m,d);g(void 0)})}}var h=u(4),p=function(){var v=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var m=f(function*(d){var b=1,y=1,g=0;if(d&&d.length){v.isLoading=!0;var w=new Image;w.crossOrigin="Anonymous";for(var A,S=document.createElement("canvas"),M=0,F=Array(d.length),R=0;R<d.length;R++)A=yield v.imageToUint8Array(v,w,d[R],S),A&&A.array&&(b=A.width,y=A.height,F[g]=A.array,M+=F[g].length,g++);var T=new Uint8Array(M);M=0,F.forEach(P=>{T.set(P,M),M+=P.length}),v.impl=new h.DataTexture2DArray(T,b,y,g),v.size={width:b,height:y,depth:g},v.isLoading=!1,v.impl.needsUpdate=!0}});return function(){return m.apply(this,arguments)}}(),this.getMaterial=m=>{if(this.impl){var d;if(!m)d=new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide});else if(m.vs&&m.fs){var b=!0;"transparent"in m&&(b=m.transparent);var y=h.FrontSide;m.side&&(y=m.side),d=new h.ShaderMaterial({transparent:b,uniforms:m.uniforms,vertexShader:m.vs,fragmentShader:m.fs,side:y}),m.glslVersion&&(d.glslVersion=m.glslVersion)}if(d)return d.needsUpdate=!0,d}}};p.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=p},(o,l,u)=>{function c(v,m,d,b,y,g,w){try{var A=v[g](w),S=A.value}catch(M){return void d(M)}A.done?m(S):Promise.resolve(S).then(b,y)}function f(v){return function(){var m=this,d=arguments;return new Promise(function(b,y){function g(S){c(A,b,y,g,w,"next",S)}function w(S){c(A,b,y,g,w,"throw",S)}var A=v.apply(m,d);g(void 0)})}}var h=u(4),p=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};p.prototype.loadImage=function(v,m){return new Promise((d,b)=>{v.onload=()=>d(v),v.onerror=b,v.src=m})},p.prototype.imageToUint8Array=function(){var v=f(function*(m,d,b,y){yield m.loadImage(d,b),y.width=d.width,y.height=d.height;var g=y.getContext("2d");return g.drawImage(d,0,0),{array:new Uint8Array(g.getImageData(0,0,y.width,y.height).data.buffer),width:y.width,height:y.height}});return function(){return v.apply(this,arguments)}}(),p.prototype.loadFromImages=function(){var v=f(function*(){});return function(){return v.apply(this,arguments)}}(),p.prototype.isReady=function(){return!(!this.impl||this.isLoading)},p.prototype.getMaterial=function(){if(this.impl)return new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide})},l.Texture=p},(o,l,u)=>{function c(y,g){var w=Object.keys(y);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(y);g&&(A=A.filter(function(S){return Object.getOwnPropertyDescriptor(y,S).enumerable})),w.push.apply(w,A)}return w}function f(y){for(var g,w=1;w<arguments.length;w++)g=arguments[w]==null?{}:arguments[w],w%2?c(Object(g),!0).forEach(function(A){h(y,A,g[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):c(Object(g)).forEach(function(A){Object.defineProperty(y,A,Object.getOwnPropertyDescriptor(g,A))});return y}function h(y,g,w){return(g=p(g))in y?Object.defineProperty(y,g,{value:w,enumerable:!0,configurable:!0,writable:!0}):y[g]=w,y}function p(y){var g=v(y,"string");return typeof g=="symbol"?g:g+""}function v(y,g){if(typeof y!="object"||!y)return y;var w=y[Symbol.toPrimitive];if(w!==void 0){var A=w.call(y,g||"default");if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(y)}var m=u(4),d=u(28),b=function(y){u(29).TexturePrimitive.call(this,y),this.isTextureSlides=!0;var g=[],w={};this.morph=new m.Group,this.group=this.morph,this.morph.userData=this;var A=void 0,S=!0;this.createSlides=R=>{R.forEach(T=>this.createSlide(T))};var M=(R,T)=>{var P=R.material,_=P.uniforms;switch(R.rotation.x=0,R.rotation.y=0,R.rotation.z=0,R.position.x=0,R.position.y=0,R.position.z=0,T.direction){case"x":var E=-Math.PI/2;R.rotation.y=E,_.direction.value=1,_.slide.value.set(T.value,0,0),R.position.x=T.value;break;case"y":R.rotation.x=Math.PI/2,_.direction.value=2,_.slide.value.set(0,T.value,0),R.position.y=T.value;break;case"z":_.direction.value=3,_.slide.value.set(0,0,T.value),R.position.z=T.value;break}P.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=R=>{R&&R.id&&R.id in w&&w[R.id]&&M(w[R.id],R)},this.createSlide=R=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&R&&R.direction&&R.value!==void 0){var T=new m.PlaneGeometry(1,1);T.translate(.5,.5,0);var P=d.getUniforms();P.diffuse.value=this.texture.impl,P.depth.value=this.texture.size.depth,P.flipY.value=S;var _={fs:d.fs,vs:d.vs,uniforms:P,glslVersion:d.glslVersion,side:m.DoubleSide,transparent:!1},E=this.texture.getMaterial(_);E.needsUpdate=!0;var C=new m.Mesh(T,E);C.name=this.groupName,C.userData=this;var L={value:R.value,direction:R.direction,id:C.id};return g.push(L),M(C,L),w[C.id]=C,this.morph.add(C),this.boundingBoxUpdateRequired=!0,L}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=R=>{for(var T=0;T<g.length;T++)if(R===g[T].id)return f({},g[T])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=R=>{R&&this.removeSlideWithId(R.id)},this.removeSlideWithId=R=>{if(this.morph&&R in w&&w[R]){if(this.morph.getObjectById(R)){var T=w[R];this.morph.remove(T),T.clear(),T.geometry&&T.geometry.dispose(),T.material&&T.material.dispose(),this.boundingBoxUpdateRequired=!0}var P=g.findIndex(_=>_.id===R);-1<P&&g.splice(P,1)}},this.dispose=()=>{this.morph.children.forEach(R=>{R.geometry&&R.geometry.dispose(),R.material&&R.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var F=(R,T,P)=>{if(T)switch(T.direction.value){case 1:P.copy(T.slide.value),R.expandByPoint(P),P.setY(1),P.setZ(1),R.expandByPoint(P);break;case 2:P.copy(T.slide.value),R.expandByPoint(P),P.setX(1),P.setZ(1),R.expandByPoint(P);break;case 3:P.copy(T.slide.value),R.expandByPoint(P),P.setX(1),P.setY(1),R.expandByPoint(P);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var R=new m.Vector3(0,0,0);this.morph.children.forEach(T=>{F(this.cachedBoundingBox,T.material.uniforms,R)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(R,T,P)=>{var _=new m.Matrix4;_.set(R[0],R[1],R[2],0,R[3],R[4],R[5],0,R[6],R[7],R[8],0,0,0,0,0);var E=new m.Quaternion().setFromRotationMatrix(_);this.morph.position.set(...T),this.morph.quaternion.copy(E),this.morph.scale.set(...P),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.setRenderOrder=R=>{this.morph.renderOrder=R},this.initialise=(R,T)=>{if(R){var P=R.locations;P&&0<P.length&&(this.applyTransformation(P[0].orientation,P[0].position,P[0].scale),"flipY"in P[0]&&(S=P[0].flipY)),this.createSlides(R.settings.slides),T!=null&&typeof T=="function"&&T(this)}},this.showEdges=R=>{if(A)A.material.color=R;else{var T=new m.BoxGeometry(1,1,1);T.translate(.5,.5,.5);var P=new m.EdgesGeometry(T);A=new m.LineSegments(P,new m.LineBasicMaterial({color:R})),this.group.add(A)}A.visible=!0},this.hideEdges=()=>{A&&(A.visible=!1)}};b.prototype=Object.create(u(29).TexturePrimitive.prototype),b.prototype.constructor=b,l.TextureSlides=b},(o,l,u)=>{var c=u(4),f=c.GLSL3,h=`
3184
+ `))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,h=u(5).resolveURL,p=0,v=function(){return"pr"+p++},m=function(){this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new c.Group,this._lod=new(u(11)).LOD(this),this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.inbuildTime=0,this.mixer=void 0,this.animationGroup=void 0,this.duration=6e3,this.clipAction=void 0,this.userData={},this.videoHandler=void 0,this.marker=void 0,this.markerNumber=void 0,this.markerUpdateRequired=!0,this.closestVertexIndex=-1,this.boundingBoxUpdateRequired=!0,this.cachedBoundingBox=new c.Box3,this.anatomicalId=void 0,this.region=void 0,this.animationClip=void 0,this.markerMode="inherited",this.uuid=v(),this._v1=new c.Vector3,this._v2=new c.Vector3,this._b1=new c.Box3,this.center=new c.Vector3,this.radius=0,this.visible=!0,this.drawRange=-1,this.origColour=void 0,this.origVertexColors=!1,this.isPickable=!0};m.prototype.setDuration=function(d){this.duration=d,this.clipAction&&this.clipAction.setDuration(this.duration)},m.prototype.getDuration=function(){return this.duration},m.prototype.setRegion=function(d){this.region=d},m.prototype.getRegion=function(){return this.region},m.prototype.getMorph=function(){var d=this._lod.getCurrentMorph();return d||this.morph},m.prototype.getGroup=function(){return this.group},m.prototype.setMorph=function(d){this.morph=d,this.group.add(this.morph);var b=this._lod.calculateDistance("far");this._lod.addLevel(d,b),this._lod.setMaterial(d.material)},m.prototype.checkTransparentMesh=function(){},m.prototype.setMesh=function(d,b,y){this.animationGroup=new c.AnimationObjectGroup(d),this.mixer=new c.AnimationMixer(this.animationGroup);var g=d.geometry;if(this.geometry=d.geometry,this.clipAction=void 0,g&&g.morphAttributes){var w=g.morphAttributes.position;w||(w=g.morphAttributes.color?g.morphAttributes.color:g.morphAttributes.normal),w&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(w,10,!0),this.animationClip&&this.animationClip[0]!=null&&(this.clipAction=this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration),this.clipAction.loop=c.loopOnce,this.clipAction.clampWhenFinished=!0,this.clipAction.play()))}this.timeEnabled=b,this.morphColour=y,d.userData=this,d.matrixAutoUpdate=!1,this.setMorph(d),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(g.setAttribute("morphTarget0",g.getAttribute("position")),g.setAttribute("morphTarget1",g.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},m.prototype.setIsPickable=function(d){this.isPickable!==d&&(this.isPickable=d,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAnatomicalId=function(d){this.anatomicalId=d},m.prototype.setName=function(d){this.groupName=d,this._lod.setName(d)},m.prototype.getCurrentTime=function(){if(this.clipAction){var d=this.clipAction.time/this.clipAction._clip.duration;return this.duration*d}return this.inbuildTime},m.prototype.setMorphTime=function(d){var b=!1;if(this.clipAction){var y=d/this.duration,g=this.clipAction._clip.duration,w=y*g;w!=this.clipAction.time&&(this.clipAction.time=w,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var A=d;A=d>this.duration?this.duration:0>d?0:d,A!=this.inbuildTime&&(this.inbuildTime=A,b=!0)}b&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},m.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},m.prototype.getVisibility=function(){return this.visible},m.prototype.setVisibility=function(d){d!==this.visible&&(this.visible=d,this.group.visible=d,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAlpha=function(d){var b=this._lod._material,y=!1;1>d&&(y=!0),b.opacity=d,b.transparent=y,this.checkTransparentMesh()},m.prototype.setFrustumCulled=function(d){this._lod.setFrustumCulled(d)},m.prototype.setVertexColors=function(d){this._lod.setVertexColors(d)},m.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},m.prototype.setColour=function(d){this._lod.setColour(d)},m.prototype.setGreyScale=function(d){if(d){if(!this.origColour&&this._lod._material)return this.origColour=this._lod._material.color,this.origVertexColors=this._lod._material.vertexColors,this._lod.setVertexColors(!1),this._lod.setColour(new c.Color().setHex(12303291)),!0}else if(this.origColour)return this._lod.setColour(this.origColour),this._lod.setVertexColors(this.origVertexColors),this.origColour=void 0,!0;return!1},m.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},m.prototype.setColourHex=function(d){this._lod._material.color.setHex(d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(d)},m.prototype.setEmissiveRGB=function(d){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...d)},m.prototype.setMaterial=function(d){this._lod.setMaterial(d)},m.prototype.getClosestVertexIndex=function(){var d=-1,b=this.getMorph();if(b&&b.geoemtry){var y=b.geometry.attributes.position;if(this._b1.setFromBufferAttribute(y),this._b1.getCenter(this._v1),y)for(var g=-1,w=0,A=0;A<y.count;A++)this._v2.fromArray(y.array,3*A),w=this._v2.distanceTo(this._v1),g==-1?g=w:g>w&&(g=w,d=A)}return d},m.prototype.getClosestVertex=function(d){var b=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var y=this.getMorph();if(y&&y.geometry&&0<=this.closestVertexIndex){var g=y.morphTargetInfluences,w=y.geometry.morphAttributes;if(g&&w&&w.position){for(var A=!1,S=0;S<g.length;S++)0<g[S]&&(A=!0,this._v1.fromArray(w.position[S].array,3*this.closestVertexIndex),b.add(this._v1.multiplyScalar(g[S])));if(A)return d?b.applyMatrix4(y.matrixWorld):b}else return b.fromArray(y.geometry.attributes.position.array,3*this.closestVertexIndex),d?b.applyMatrix4(y.matrixWorld):b}return this.getBoundingBox(),b.copy(this.center),d?b.applyMatrix4(this.morph.matrixWorld):b},m.prototype.getBoundingBox=function(){if(this.visible){var d=this._lod.getCurrentMorph();if(d&&d.visible)return this.boundingBoxUpdateRequired&&(u(5).getBoundingBox(d,this.cachedBoundingBox,this._b1,this._v1,this._v2),this.cachedBoundingBox.getCenter(this.center),this.radius=this.center.distanceTo(this.cachedBoundingBox.max),this.boundingBoxUpdateRequired=!1),this.cachedBoundingBox}},m.prototype.dispose=function(){this._lod.dispose(),this.animationGroup=void 0,this.mixer=void 0,this.morph=void 0,this.group=void 0,this.clipAction=void 0,this.groupName=void 0},m.prototype.markerIsRequired=function(d){return!!(this.visible&&(this.markerMode==="on"||d&&d.displayMarkers&&this.markerMode==="inherited"))},m.prototype.updateMarker=function(d,b){if(d==!1&&this.markerIsRequired(b)){var y=b.ndcToBeUpdated;if(this.groupName){if(this.marker||(this.marker=new(u(14)).Marker(this),this.markerUpdateRequired=!0),this.markerUpdateRequired){var g=this.getClosestVertex(!1);g&&(this.marker.setPosition(g.x,g.y,g.z),this.markerUpdateRequired=!1)}this.marker.isEnabled()||(b.markersList&&!(this.marker.uuid in b.markersList)&&(y=!0,b.markersList[this.marker.uuid]=this.marker),this.marker.enable(),this.group.add(this.marker.morph)),this.marker.setNumber(this.markerNumber),this.markerImgURL?this.marker.loadUserSprite(this.markerImgURL):this.marker.setDefaultSprite(),b&&b.camera&&(y||b.markerCluster.markerUpdateRequired)&&(this.marker.updateNDC(b.camera.cameraObject),b.markerCluster.markerUpdateRequired=!0)}}else this.marker&&this.marker.isEnabled()&&(this.marker.disable(),this.group.remove(this.marker.morph),b.markersList&&this.marker.uuid in b.markersList&&(b.markerCluster.markerUpdateRequired=!0,delete b.markersList[this.marker.uuid])),this.markerUpdateRequired=!0},m.prototype.processMarkerVisual=function(d,b){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(d,b)},m.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},m.prototype.setRenderOrder=function(d){this._lod.setRenderOrder(d)},m.prototype.getClosestVertexDOMElementCoords=function(d){if(d&&d.camera){var b=!0,y=this.getClosestVertex(!0);return y.project(d.camera),y.z=Math.min(Math.max(y.z,0),1),(1<y.x||-1>y.x||1<y.y||-1>y.y)&&(b=!1),d.getZincCameraControls().getRelativeCoordsFromNDC(y.x,y.y,y),{position:y,inView:b}}},m.prototype.setMarkerMode=function(d,b){d!==this.markerMode&&(this.markerMode=d==="on"||d==="off"?d:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),b&&(this.markerNumber=b.number,this.markerImgURL=b.imgURL)},m.prototype.render=function(d,b,y,g){if(this.visible&&!(this.timeEnabled&&b)&&this._lod.update(y,this.center),b==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(d);else{var w=this.inbuildTime+d;w>this.duration&&(w-=this.duration),this.inbuildTime=w}this.visible&&d!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},m.prototype.addLOD=function(d,b,y,g,w){this._lod.addLevelFromURL(d,b,y,g,w)},m.prototype.addVertices=function(d){var b=this.getMorph(),y=void 0;if(!b)y=f(500,d),this.drawRange=d.length;else if(-1<this.drawRange){var g=b.geometry.getAttribute("position");d.forEach(w=>{g.setXYZ(this.drawRange,w[0],w[1],w[2]),++this.drawRange}),g.needsUpdate=!0,b.geometry.setDrawRange(0,this.drawRange),b.geometry.computeBoundingBox(),b.geometry.computeBoundingSphere(),y=b.geoemtry,this.boundingBoxUpdateRequired=!0}return y},m.prototype.setPosition=function(d,b,y){var g=this.getGroup();g&&(g.position.set(d,b,y),g.updateMatrix(),this.boundingBoxUpdateRequired=!0)},m.prototype.loadAdditionalSources=function(d){d.load(h(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))},m.prototype.setScaleAll=function(d){var b=this.getGroup();b&&(b.scale.set(d,d,d),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=m},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,h=u(5).toBufferGeometry,p=function(v){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=v,this.addLevel=(d,b)=>{if(d){var y,g=Math.abs(b);for(y=0;y<this.levels.length&&!(g<this.levels[y].distance);y++);this.levels.splice(y,0,{distance:g,morph:d,loaded:!0,loading:!1,url:""}),d.renderOrder=this._renderOrder}},this.levelLoaded=(d,b)=>{if(d){for(var y=Math.abs(b),g=0;g<this.levels.length;g++)if(y===this.levels[g].distance){this._parent.group.add(d),this.levels[g].morph=d,this.levels[g].loaded=!0,this.levels[g].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(d,b,y,g,w)=>{this._loader=d;var A,S=this.calculateDistance(b);for(A=0;A<this.levels.length&&!(S<this.levels[A].distance);A++);this.levels.splice(A,0,{distance:S,morph:void 0,loaded:!1,loading:!1,url:y,index:g}),w&&this.loadLevel(A)},this.loadLevel=d=>{var b=this.levels[d];return b.morph||b.loaded||b.loading||(b.loading=!0,this._loader.load(b.url,this.lodLoader(b.distance),void 0,void 0,{index:b.index})),b.morph===void 0},this.calculateDistance=function(d){this._parent.getBoundingBox();var b=this._parent.radius,y=0;return d==="far"?y=4.5*b:d==="medium"?y=2.5*b:d=="close"&&(y=0),y},this.containsLevels=()=>!!(this.levels&&1<this.levels.length),this.checkTransparentMesh=()=>{var d=this.levels[this._currentLevel];this._material&&(this._material.transparent?(!this._secondaryMaterial&&(this._secondaryMaterial=this._material.clone(),this._secondaryMaterial.side=c.FrontSide),this._secondaryMaterial.opacity=this._material.opacity,this._secondaryMaterial.emissive&&this._secondaryMaterial.emissive.copy(this._material.emissive),this._secondaryMaterial.needsUpdate=!0,!d.secondaryMesh&&(d.secondaryMesh=new c.Mesh(d.morph.geometry,this._secondaryMaterial),d.secondaryMesh.renderOrder=d.morph.renderOrder+1,d.secondaryMesh.userData=d.morph.userData,d.secondaryMesh.name=d.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!d.secondaryMesh.parent&&(d.morph.add(d.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(d.secondaryMesh))):(d.secondaryMesh&&(d.morph.remove(d.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(d.secondaryMesh),this._parent.animationGroup.remove(d.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&d.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var d=this.levels[this._currentLevel];return d&&d.morph?d.morph:this._parent.morph},this.lodLoader=function(d){return b=>{var y=this._material,g={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},w=h(b,g),A=void 0;this._parent.isGeometry?A=new c.Mesh(w,y):this._parent.isLines&&(A=new(u(12)).LineSegments(w,y)),A.userData=this._parent,A.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(A,d)}},this.updateMorphColorAttribute=d=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(d){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(y=>{y.morph&&y.morph.geometry&&f(y.morph.geometry,y.morph)})},this.setColour=d=>{this._material.color=d,this._secondaryMaterial&&(this._secondaryMaterial.color=d),m()},this.setFrustumCulled=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=d),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=d)})},this.setMaterial=d=>{d&&(!this._material||this._material.id!==d.id)&&(this._material=d,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=d.clone(),this._secondaryMaterial.side=c.FrontSide,this._secondaryMaterial.transparent=!0,this.levels.forEach(b=>{b.morph&&(b.morph.material=this._material,b.morph.geometry&&(b.morph.geometry.colorsNeedUpdate=!0)),b.secondaryMesh&&(b.secondaryMesh.material=this._secondaryMaterial)}))},this.setName=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=d),b.secondaryMesh&&(b.secondaryMesh.name=d)})},this.setRenderOrder=d=>{this._renderOrder=d,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=d),b.secondaryMesh&&(b.secondaryMesh.renderOrder=d)})},this.setVertexColors=d=>{this._material.vertexColors=d,m(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=d)},this.update=(d,b)=>{var y=this.levels;if(1<y.length){var g,w,A=d.cameraObject.position.distanceTo(b),S=-1,M=-1;for(g=0,w=y.length;g<w&&A>=y[g].distance;g++)y[g].morph?(-1<S&&y[S].morph&&(y[S].morph.visible=!1),S=g,y[g].morph.visible=!0,M=-1):M=g;for(-1<M&&this.loadLevel(M);g<w;g++)y[g].morph&&(-1<S?y[g].morph.visible=!1:(y[g].morph.visible=!0,S=g));this._currentLevel!=S&&(this._currentLevel=S,this.checkTransparentMesh())}},this.toggleMarker=(d,b)=>{this.levels.forEach(y=>{y.morph&&(b?y.morph.add(d):y.morph.remove(d))})};var m=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&(d.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>v});var c=u(13),f=u(4),h=new f.Vector3,p=new f.Vector3;class v extends c.Line{constructor(d,b){super(d,b),this.type="LineSegments"}computeLineDistances(){var d=this.geometry;if(!d.isBufferGeometry)d.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(d.index===null){for(var b=d.attributes.position,y=[],g=0,w=b.count;g<w;g+=2)h.fromBufferAttribute(b,g),p.fromBufferAttribute(b,g+1),y[g]=g==0?0:y[g-1],y[g+1]=y[g]+h.distanceTo(p);d.setAttribute("lineDistance",new f.Float32BufferAttribute(y,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}v.prototype.isLineSegments=!0},(o,l,u)=>{u.r(l),u.d(l,{Line:()=>w});var c=u(4),f=new c.Vector3,h=new c.Vector3,p=new c.Matrix4,v=new c.Ray,m=new c.Sphere,d=new c.Vector3,b=new c.Vector3,y=new c.Vector3,g=new c.Vector3;class w extends c.Object3D{constructor(){var M=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,F=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=M,this.material=F,this.updateMorphTargets()}copy(M){return super.copy(M),this.material=M.material,this.geometry=M.geometry,this}computeLineDistances(){var M=this.geometry;if(!M.isBufferGeometry)M.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(M.index===null){for(var F=M.attributes.position,R=[0],T=1,P=F.count;T<P;T++)f.fromBufferAttribute(F,T-1),h.fromBufferAttribute(F,T),R[T]=R[T-1],R[T]+=f.distanceTo(h);M.setAttribute("lineDistance",new c.Float32BufferAttribute(R,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(M,F){var R=this.geometry,T=this.matrixWorld,P=M.params.Line.threshold,_=R.drawRange,E=R.morphAttributes.position;if(R.boundingSphere===null&&R.computeBoundingSphere(),m.copy(R.boundingSphere),m.applyMatrix4(T),m.radius+=P,M.ray.intersectsSphere(m)!==!1){p.copy(T).invert(),v.copy(M.ray).applyMatrix4(p);var C=P/((this.scale.x+this.scale.y+this.scale.z)/3),L=C*C,I=new c.Vector3,x=new c.Vector3,O=new c.Vector3,B=new c.Vector3,D=this.isLineSegments?2:1;if(R.isBufferGeometry){var k=R.index,V=R.attributes,G=V.position;if(k!==null)for(var J=Math.max(0,_.start),j=Math.min(k.count,_.start+_.count),te=J;te<j-1;te+=D){var ee=k.getX(te),ae=k.getX(te+1);A(I,x,this,G,E,ee,ae);var H=v.distanceSqToSegment(I,x,B,O);if(!(H>L)){B.applyMatrix4(this.matrixWorld);var Z=M.ray.origin.distanceTo(B);Z<M.near||Z>M.far||F.push({distance:Z,point:O.clone().applyMatrix4(this.matrixWorld),index:te,face:null,faceIndex:null,object:this})}}else for(var $=Math.max(0,_.start),se=Math.min(G.count,_.start+_.count),z=$;z<se-1;z+=D){A(I,x,this,G,E,z,z+1);var W=v.distanceSqToSegment(I,x,B,O);if(!(W>L)){B.applyMatrix4(this.matrixWorld);var q=M.ray.origin.distanceTo(B);q<M.near||q>M.far||F.push({distance:q,point:O.clone().applyMatrix4(this.matrixWorld),index:z,face:null,faceIndex:null,object:this})}}}else R.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var M=this.geometry;if(M.isBufferGeometry){var F=M.morphAttributes,R=Object.keys(F);if(0<R.length){var T=F[R[0]];if(T!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var P,_=0,E=T.length;_<E;_++)P=T[_].name||_+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[P]=_}}}else{var C=M.morphTargets;C!==void 0&&0<C.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function A(S,M,F,R,T,P,_){S.fromBufferAttribute(R,P),M.fromBufferAttribute(R,_);var E=F.morphTargetInfluences;if(F.material.morphTargets&&T&&E){d.set(0,0,0),b.set(0,0,0);for(var C=0,L=T.length;C<L;C++){var I=E[C],x=T[C];I!==0&&(y.fromBufferAttribute(x,P),g.fromBufferAttribute(x,_),d.addScaledVector(y.sub(S),I),b.addScaledVector(g.sub(M),I))}S.add(d),M.add(b)}}w.prototype.isLine=!0},(o,l,u)=>{var c=u(4),f=new Image(128,128);f.src=u(15);var h=new c.Texture;h.image=f,h.needsUpdate=!0;var p=[.02,.03,1],v=new c.SpriteMaterial({map:h,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),m=u(5).createNewSpriteText,d=function(b){u(10).ZincObject.call(this),this.texture=h;var y=void 0,g=void 0,w=void 0,A=void 0,S=void 0,M=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var F=!1;this.ndc=new c.Vector3;var R=void 0,T=void 0,P=()=>{y=new c.Sprite(v),y.center.set(.5,0),this.morph.add(y),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,y.scale.set(p[0],p[1],p[2]),y.userData=this};this.updateVisual=(_,E)=>{var C=1,L=0;_!==E&&(L=1-(this.ndc.z-_)/(E-_),C=.6+.4*L),this.setSpriteSize(C)},this.updateNDC=_=>(this.ndc.copy(this.morph.position),this.ndc.project(_),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(_,E,C)=>{this.morph.position.set(_,E,C)},this.setSpriteSize=_=>{y.scale.set(.015,.02,1),y.scale.multiplyScalar(_)},this.setUserSprite=()=>{A&&(this.morph.add(A),M&&(this.morph.remove(y),T&&this.morph.remove(T),M=!1))},this.setImageForUserSprite=(_,E)=>{A&&(this.morph.remove(A),A=void 0),g&&g.dispose(),w&&w.dispose(),g=new c.Texture,g.image=_,g.needsUpdate=!0,w=new c.SpriteMaterial({map:g,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),E||(E=[.05,.05,1]),A=new c.Sprite(w),A.center.set(.5,0),A.scale.set(E[0],E[1],E[2]),A.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{M||(M=!0,this.morph.add(y),A&&this.morph.remove(A),T&&this.morph.add(T))},this.loadUserSprite=(_,E)=>{if(_)if(_!==S){S=_;var C=new Image(128,128);C.crossOrigin="anonymous",C.onload=()=>{this.setImageForUserSprite(C,E)},C.src=_}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),y&&(y.clear(),y=void 0),T&&(T.material.map.dispose(),T.material.dispose(),T=void 0)},this.isEnabled=()=>F,this.setNumber=_=>{(!_||R!=_)&&T&&(this.morph.remove(T),T.material.map.dispose(),T.material.dispose(),T=void 0),!T&&_&&(T=m(_,.012,"black","Asap",120,700),this.morph.add(T)),R=_},this.getNumber=()=>R||1,this.setVisibility=function(_){_!==this.visible&&(this.visible=_,this.group.visible=_,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{F=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{F=!1,this.morph.visible=!1,this.visible=!1},P()};d.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=d},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="},(o,l,u)=>{var c=u(4),f=function(h,p,v,m){u(10).ZincObject.call(this);var d;p&&(d=p.clone(),d.vertexColors=c.FaceColors),this.id=v;var b=void 0,y=void 0;this.isGlyph=!0;var g=[0,0,0];this.fromMesh=w=>!!(w&&w.isMesh)&&(this.morph=w.clone(),this.morph.userData=this,this.group.add(this.morph),!0),h&&d&&this.fromMesh(new c.Mesh(h,d)),this.getGlyphset=function(){return m},this.setLabel=w=>{w&&(typeof w=="string"||w instanceof String)&&(y=w,this.morph&&(this.morph.name=w))},this.showLabel=w=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),y&&(typeof y=="string"||y instanceof String)&&(b=new(u(17)).Label(y,w),b.setPosition(g[0],g[1],g[2]),this.group.add(b.getSprite()))},this.hideLabel=()=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0)},this.getLabel=()=>y,this.getMesh=()=>this.morph,this.setTransformation=(w,A,S,M)=>{this.morph&&(this.morph.matrix.elements[0]=A[0],this.morph.matrix.elements[1]=A[1],this.morph.matrix.elements[2]=A[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=S[0],this.morph.matrix.elements[5]=S[1],this.morph.matrix.elements[6]=S[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=M[0],this.morph.matrix.elements[9]=M[1],this.morph.matrix.elements[10]=M[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=w[0],this.morph.matrix.elements[13]=w[1],this.morph.matrix.elements[14]=w[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),g=[...w],b&&b.setPosition(w[0],w[1],w[2])},this.setColour=w=>{b&&b.setColour(w),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry&&(this.geometry.colorsNeedUpdate=!0)},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};f.prototype=Object.create(u(10).ZincObject.prototype),l.Glyph=f},(o,l,u)=>{var c=u(7).default;l.Label=function(f,h){var p=f,v=void 0;v=h?new c(p,.015,h.getStyle()):new c(p,.015),v.fontFace="Asap",v.fontWeight=700,v.material.map.generateMipmaps=!1,v.material.sizeAttenuation=!1,v.center.x=-.05,v.center.y=0,this.getPosition=()=>v?[v.position.x,v.position.y,v.position.z]:[0,0,0],this.setPosition=(m,d,b)=>{v&&v.position.set(m,d,b)},this.setColour=m=>{console.log(v),m&&(v.color=m.getStyle())},this.setScale=m=>{v&&0<m&&v.scale.set(m,m,1)},this.dispose=()=>{},this.getSprite=()=>v,this.getString=()=>p}},(o,l,u)=>{var c=u(4),f=u(19).JSONLoader,h=function(){u(10).ZincObject.call(this);var p=[],v=void 0,m=void 0,d=void 0,b=void 0,y=void 0,g=void 0,w=void 0,A=0,S=0,M=[0,0,0],F=[0,0,0],R=[0,0,0],T="NONE";this.ready=!1;var P=!1,_=!1;this.isGlyphset=!0;var E=new c.Matrix4,C=new c.Color,L=new c.Color,I=new c.Box3,x=new c.Box3,O=new c.Box3,B=[],D=[],k=[],V=[],G=[],J=[],j=[];this.globalScale=1;for(var te=0;8>te;te++)new c.Vector3;this.load=(z,W,q,le,oe)=>{v=z.axis1,m=z.axis2,d=z.axis3,b=z.positions,y=z.scale,g=z.colors,w=z.label,P=z.metadata.MorphColours,_=z.metadata.MorphVertices,A=z.metadata.number_of_time_steps,T=z.metadata.repeat_mode,S=z.metadata.number_of_vertices,T=="AXES_2D"||T=="MIRROR"?S*=2:T=="AXES_3D"&&(S*=3),M=z.metadata.base_size,F=z.metadata.offset,R=z.metadata.scale_factors;var U=new f;this.geometry=new c.BufferGeometry;var N=new c.InstancedMesh(this.geometry,void 0,S);if(this.setMorph(N),le){var X=U.parse(W);se(q,oe)(X.geometry,X.materials),X.geometry.dispose()}else U.crossOrigin="Anonymous",U.load(W,se(q,oe))};var ee=(z,W,q,le,oe,U)=>{if(T=="NONE"||T=="MIRROR"){for(var N,X=[0,0,0],Y=[0,0,0],ie=[0,0,0],ue=[0,0,0],me=[0,0,0],be=[0,0,0],ce=[0,0,0],ge=[0,0,0],re=[0,0,0],he=0;3>he;he++)N=0>oe[he]?-1:1,X[he]=(N*M[he]+oe[he]*R[he])*this.globalScale;for(var he=0;3>he;he++)Y[he]=W[he]*X[0],ie[he]=q[he]*X[1],ue[he]=le[he]*X[2],me[he]=z[he]+F[0]*Y[he]+F[1]*ie[he]+F[2]*ue[he],T=="MIRROR"&&(be[he]=-Y[he],ce[he]=-ie[he],ge[he]=-ue[he],re[he]=me[he],0>oe[0]&&(me[he]-=Y[he],re[he]-=be[he]));0>ue[0]*(Y[1]*ie[2]-Y[2]*ie[1])+ue[1]*(Y[2]*ie[0]-Y[0]*ie[2])+ue[2]*(Y[0]*ie[1]-Y[1]*ie[0])&&(ue[0]=-ue[0],ue[1]=-ue[1],ue[2]=-ue[2]),U[0]=[me,Y,ie,ue],T=="MIRROR"&&(0>ge[0]*(be[1]*ce[2]-be[2]*ce[1])+ge[1]*(be[2]*ce[0]-be[0]*ce[2])+ge[2]*(be[0]*ce[1]-be[1]*ce[0])&&(ge[0]=-ge[0],ge[1]=-ge[1],ge[2]=-ge[2]),U[1]=[re,be,ce,ge])}else if(T=="AXES_2D"||T=="AXES_3D"){for(var N,ve=[0,0,0],Ee=[0,0,0],he=0;3>he;he++)N=0>oe[he]?-1:1,ve[he]=(N*M[0]+oe[he]*R[0])*this.globalScale;for(var he=0;3>he;he++)Ee[he]=z[he]+F[0]*ve[0]*W[he]+F[1]*ve[1]*q[he]+F[2]*ve[2]*le[he];for(var _e=glyph_repeat_mode=="AXES_2D"?2:3,Ne=0;Ne<_e;Ne++){var Je=void 0,ze=void 0,st=oe[Ne],Ce=[0,0,0],je=[0,0,0],He=[0,0,0];Ne==0?(Je=W,ze=q):Ne==1?(Je=q,ze=glyph_repeat_mode=="AXES_2D"?W:le):(Je=le,ze=W);var Pt=(M[0]+st*R[0])*this.globalScale;Ce[0]=Je[0]*Pt,Ce[1]=Je[1]*Pt,Ce[2]=Je[2]*Pt,He[0]=Ce[1]*ze[2]-ze[1]*Ce[2],He[1]=Ce[2]*ze[0]-ze[2]*Ce[0],He[2]=Ce[0]*ze[1]-Ce[1]*ze[0];var It=Math.sqrt(He[0]*He[0]+He[1]*He[1]+He[2]*He[2]);if(0<It){var mt=(M[2]+st*R[2])*this.globalScale/It;T=="AXES_2D"&&0<Ne&&(mt*=-1),He[0]*=mt,He[1]*=mt,He[2]*=mt}if(je[0]=He[1]*Ce[2]-Ce[1]*He[2],je[1]=He[2]*Ce[0]-Ce[2]*He[0],je[2]=He[0]*Ce[1]-He[1]*Ce[0],It=Math.sqrt(je[0]*je[0]+je[1]*je[1]+je[2]*je[2]),0<It){var bt=(M[1]+st*R[1])*this.globalScale/It;je[0]*=bt,je[1]*=bt,je[2]*=bt}U[Ne]=[Ee,Ce,je,He]}}return U},ae=(z,W,q,le,oe)=>{var U=1;T=="AXES_2D"||T=="MIRROR"?U=2:T=="AXES_3D"&&(U=3);var N=z.length/3,X=0;j.length=U;for(var Y=0;Y<N;Y++){var ie=3*Y,ue=[z[ie],z[ie+1],z[ie+2]],me=[W[ie],W[ie+1],W[ie+2]],be=[q[ie],q[ie+1],q[ie+2]],ce=[le[ie],le[ie+1],le[ie+2]],ge=[oe[ie],oe[ie+1],oe[ie+2]],re=ee(ue,me,be,ce,ge,j);if(re.length==U)for(var he=0;he<U;he++){E.elements[0]=re[he][1][0],E.elements[1]=re[he][1][1],E.elements[2]=re[he][1][2],E.elements[3]=0,E.elements[4]=re[he][2][0],E.elements[5]=re[he][2][1],E.elements[6]=re[he][2][2],E.elements[7]=0,E.elements[8]=re[he][3][0],E.elements[9]=re[he][3][1],E.elements[10]=re[he][3][2],E.elements[11]=0,E.elements[12]=re[he][0][0],E.elements[13]=re[he][0][1],E.elements[14]=re[he][0][2],E.elements[15]=1,this.morph.setMatrixAt(X,E);var ve=p[X];ve&&ve.setTransformation(re[he][0],re[he][1],re[he][2],re[he][3]),X++}}this.morph.instanceMatrix.needsUpdate=!0},H=z=>{var W=1;T=="AXES_2D"||T=="MIRROR"?W=2:T=="AXES_3D"&&(W=3);for(var q,le=z.length,oe=0,U=0;U<le;U++){q=z[U];for(var N=0;N<W;N++){C.setHex(q),this.morph.setColorAt(oe,C);var X=p[oe];X&&X.setColour(C),oe++}}this.morph.instanceColor.needsUpdate=!0},Z=()=>{var z=B,W=D,q=k,le=V,oe=G,U=J,N=this.inbuildTime/this.duration*(A-1),X=Math.floor(N),Y=1-(N-X),ie=Math.ceil(N);if(_){var ue=b[X.toString()],me=b[ie.toString()],be=v[X.toString()],ce=v[ie.toString()],ge=m[X.toString()],re=m[ie.toString()],he=d[X.toString()],ve=d[ie.toString()],Ee=y[X.toString()],_e=y[ie.toString()];B.length=ue.length,D.length=ue.length,k.length=ue.length,V.length=ue.length,G.length=ue.length;for(var Ne=0;Ne<ue.length;Ne++)z[Ne]=Y*ue[Ne]+(1-Y)*me[Ne],W[Ne]=Y*be[Ne]+(1-Y)*ce[Ne],q[Ne]=Y*ge[Ne]+(1-Y)*re[Ne],le[Ne]=Y*he[Ne]+(1-Y)*ve[Ne],oe[Ne]=Y*Ee[Ne]+(1-Y)*_e[Ne]}else z=b[0],W=v[0],q=m[0],le=d[0],oe=y[0];if(ae(z,W,q,le,oe),this.boundingBoxUpdateRequired=!0,g!=null){if(P){var Je=g[X.toString()],ze=g[ie.toString()];U.length=Je.length;for(var st=0;st<Je.length;st++)C.setHex(Je[st]),L.setHex(ze[st]),C.setRGB(C.r*Y+L.r*(1-Y),C.g*Y+L.g*(1-Y),C.b*Y+L.b*(1-Y)),U[st]=C.getHex()}else U=g[0];H(U)}};this.showLabel=()=>{for(var z=0;z<p.length;z++)p[z].showLabel(this.morph.material?this.morph.material.color:void 0)},this.hideLabel=()=>{for(var z=0;z<p.length;z++)p[z].hideLabel()};var $=z=>{for(var W=0;W<S;W++){var q=new(u(16)).Glyph(void 0,void 0,W,this),le=w?w[W]:void 0;le=le||this.groupName,le&&q.setLabel(le),0<A&&q.setFrustumCulled(!1),p[W]=q,this.morph.add(q.getGroup())}z&&this.showLabel(),ae(b[0],v[0],m[0],d[0],y[0]),g!=null&&H(g[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};this.addCustomGlyph=z=>{z.isGlyph&&p.push(z),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(z,W)=>{if(z.isMesh){var q=new(u(16)).Glyph(void 0,void 0,W,this);return q.fromMesh(z),p.push(q),this.morph.add(q.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,q}},this.forEachGlyph=z=>{for(var W=0;W<p.length;W++)z(p[W])};var se=(z,W)=>(q,le)=>{var oe=q.toBufferGeometry();this.geometry.copy(oe),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),oe.dispose(),le&&le[0]&&(this.morph.material=le[0]),$(W),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),q.dispose(),z!=null&&typeof z=="function"&&z(this)};this.getClosestVertexIndex=function(){var z=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var W,q=b[0],le=q.length/3,oe=-1,U=0,N=0;N<le;N++)W=3*N,this._v2.set(q[W],q[W+1],q[W+2]),U=this._v1.distanceTo(this._v2),(oe==-1||oe>U)&&(oe=U,z=N)}return z},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var z=new c.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,E),z.setFromMatrixPosition(E),z}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){I.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var z=0;z<S;z++)this.morph.getMatrixAt(z,E),x.copy(I).applyMatrix4(E),z==0?O.copy(x):O.union(x);if(O)this.cachedBoundingBox.copy(O),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=z=>{this.inbuildTime=z>this.duration?this.duration:0>z?0:z,(P||_)&&(Z(),_&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<A)&&(P||_)),this.getCurrentTime=()=>this.inbuildTime,this.setScaleAll=function(z){this.globalScale=z,Z()},this.dispose=()=>{for(var z=p.length-1;0<=z;z--)p[z].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),v=void 0,m=void 0,d=void 0,b=void 0,y=void 0,g=void 0,this.ready=!1,this.groupName=void 0},this.render=(z,W,q)=>{if(W==!0){var le=this.inbuildTime+z;le>this.duration&&(le-=this.duration),this.inbuildTime=le,(P||_)&&Z()}this.updateMarker(W,q)}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=h},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>M});var c=u(4),f=u(20).Loader,h=c.LoaderUtils,p=c.AnimationClip,v=c.Vector3,m=c.Vector4,d=c.Color,b=c.Vector2,y=u(6).Face3,g=u(6).Geometry,w=c.FileLoader,A=c.DefaultLoadingManager,S=u(21).VideoHandler;function M(F){typeof F=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),F=void 0),this.manager=F===void 0?A:F,this.withCredentials=!1,this.paramsString=""}Object.assign(M.prototype,{load:function(R,T,P,_){var E=this,C=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:h.extractUrlBase(R),L=new w(this.manager);R.split("?"),this.paramsString=R.length===2?paramsStrings[1]:"",L.setWithCredentials(this.withCredentials),L.load(R,function(I){var x;try{x=JSON.parse(I)}catch{if(console.error("The loader has encountered an error while parsing the content of a resource."),_)return void _({responseURL:R})}var O=x.metadata;if(O!==void 0){var B=O.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+R+" should be loaded with THREE.ObjectLoader instead.")}if(E&&E.parse)try{var D=E.parse(x,C);T(D.geometry,D.materials)}catch(k){if(console.error("The loader has encountered aon loading the geometry"),console.error(k),_)return void _({responseURL:R})}},P,_)},setTexturePath:function(R){this.texturePath=R},parse:function(){function F(_,E){function C(he,ve){return he&1<<ve}var L,I,x,O,B,D,k,V,G,J,j,te,ee,ae,H,Z,$,se,z,W,q,le,oe,U,N,X,Y,ie=_.faces,ue=_.vertices,me=_.normals,be=_.colors,ce=_.scale,ge=0;if(_.uvs!==void 0){for(L=0;L<_.uvs.length;L++)_.uvs[L].length&&ge++;for(L=0;L<ge;L++)E.faceVertexUvs[L]=[]}for(O=0,B=ue.length;O<B;)se=new v,se.x=ue[O++]*ce,se.y=ue[O++]*ce,se.z=ue[O++]*ce,E.vertices.push(se);if(O=0,B=ie.length,_.uvs)for(L=0;L<_.uvs.length;L++){E.uvs[L]=[];for(var re=0;re<_.uvs[L].length;re++)E.uvs[L][re]=_.uvs[L][re]}if(me)for(L=0;L<me.length;L++)E.normals[L]=me[L];if(be)for(L=0;L<be.length;L++)E.colors[L]=be[L];for(;O<B;)if(J=ie[O++],j=C(J,0),te=C(J,1),ee=C(J,3),ae=C(J,4),H=C(J,5),Z=C(J,6),$=C(J,7),j){if(W=new y,W.a=ie[O],W.b=ie[O+1],W.c=ie[O+3],q=new y,q.a=ie[O+1],q.b=ie[O+2],q.c=ie[O+3],O+=4,te&&(G=ie[O++],W.materialIndex=G,q.materialIndex=G),x=E.faces.length,ee)for(L=0;L<ge;L++)for(U=_.uvs[L],E.faceVertexUvs[L][x]=[],E.faceVertexUvs[L][x+1]=[],I=0;4>I;I++)V=ie[O++],X=U[2*V],Y=U[2*V+1],N=new b(X,Y),I!==2&&E.faceVertexUvs[L][x].push(N),I!==0&&E.faceVertexUvs[L][x+1].push(N);if(ae&&(k=3*ie[O++],W.normal.set(me[k++],me[k++],me[k]),q.normal.copy(W.normal)),H)for(L=0;4>L;L++)k=3*ie[O++],oe=new v(me[k++],me[k++],me[k]),L!==2&&W.vertexNormals.push(oe),L!==0&&q.vertexNormals.push(oe);if(Z&&(D=ie[O++],le=be[D],W.color.setHex(le),q.color.setHex(le)),$)for(L=0;4>L;L++)D=ie[O++],le=be[D],L!==2&&W.vertexColors.push(new d(le)),L!==0&&q.vertexColors.push(new d(le));E.faces.push(W),E.faces.push(q)}else{if(z=new y,z.a=ie[O++],z.b=ie[O++],z.c=ie[O++],te&&(G=ie[O++],z.materialIndex=G),x=E.faces.length,ee)for(L=0;L<ge;L++)for(U=_.uvs[L],E.faceVertexUvs[L][x]=[],I=0;3>I;I++)V=ie[O++],X=U[2*V],Y=U[2*V+1],N=new b(X,Y),E.faceVertexUvs[L][x].push(N);if(ae&&(k=3*ie[O++],z.normal.set(me[k++],me[k++],me[k])),H)for(L=0;3>L;L++)k=3*ie[O++],oe=new v(me[k++],me[k++],me[k]),z.vertexNormals.push(oe);if(Z&&(D=ie[O++],z.color.setHex(be[D])),$)for(L=0;3>L;L++)D=ie[O++],z.vertexColors.push(new d(be[D]));E.faces.push(z)}}function R(_,E){var C=_.influencesPerVertex===void 0?2:_.influencesPerVertex;if(_.skinWeights)for(var L=0,I=_.skinWeights.length;L<I;L+=C){var x=_.skinWeights[L],O=1<C?_.skinWeights[L+1]:0,B=2<C?_.skinWeights[L+2]:0,D=3<C?_.skinWeights[L+3]:0;E.skinWeights.push(new m(x,O,B,D))}if(_.skinIndices)for(var L=0,I=_.skinIndices.length;L<I;L+=C){var k=_.skinIndices[L],V=1<C?_.skinIndices[L+1]:0,G=2<C?_.skinIndices[L+2]:0,J=3<C?_.skinIndices[L+3]:0;E.skinIndices.push(new m(k,V,G,J))}E.bones=_.bones,E.bones&&0<E.bones.length&&(E.skinWeights.length!==E.skinIndices.length||E.skinIndices.length!==E.vertices.length)&&console.warn("When skinning, number of vertices ("+E.vertices.length+"), skinIndices ("+E.skinIndices.length+"), and skinWeights ("+E.skinWeights.length+") should match.")}function T(_,E){var C=_.scale;if(_.morphTargets!==void 0)for(var L=0,I=_.morphTargets.length;L<I;L++){E.morphTargets[L]={},E.morphTargets[L].name=_.morphTargets[L].name,E.morphTargets[L].vertices=[];for(var x,O=E.morphTargets[L].vertices,B=_.morphTargets[L].vertices,D=0,k=B.length;D<k;D+=3)x=new v,x.x=B[D]*C,x.y=B[D+1]*C,x.z=B[D+2]*C,O.push(x)}if(_.morphNormals!==void 0){for(var L=0,I=_.morphNormals.length;L<I;L++)if(E.morphTargets[L]){E.morphTargets[L].normals=[];for(var V,G=E.morphTargets[L].normals,J=_.morphNormals[L].normals,D=0,k=J.length;D<k;D+=3)V=new v,V.x=J[D],V.y=J[D+1],V.z=J[D+2],G.push(V);E.morphNormalsReady=!0}}if(_.morphColors!==void 0){var L,I,j,te,ee,ae,H;for(L=0,I=_.morphColors.length;L<I;L++)for(E.morphColors[L]={},E.morphColors[L].name=_.morphColors[L].name,E.morphColors[L].colors=[],ee=E.morphColors[L].colors,ae=_.morphColors[L].colors,j=0,te=ae.length;j<te;j+=3)H=new c.Color(16755200),H.setRGB(ae[j],ae[j+1],ae[j+2]),ee.push(H)}}function P(_,E){var C=[],L=[];_.animation!==void 0&&L.push(_.animation),_.animations!==void 0&&(_.animations.length?L=L.concat(_.animations):L.push(_.animations));for(var I,x=0;x<L.length;x++)I=p.parseAnimation(L[x],E.bones),I&&C.push(I);if(E.morphTargets){var O=p.CreateClipsFromMorphTargetSequences(E.morphTargets,10);C=C.concat(O)}0<C.length&&(E.animations=C)}return function(_,E){_.data!==void 0&&(_=_.data),_.scale=_.scale===void 0?1:1/_.scale;var C=new g;if(C.morphColors=[],F(_,C),R(_,C),T(_,C),P(_,C),C.computeFaceNormals(),C.computeBoundingSphere(),_.materials===void 0||_.materials.length===0)return{geometry:C};var L=f.prototype.initMaterials(_.materials,E,"Anonymous");if(_.materials[0].video){var I=E+_.materials[0].video;this.paramsString&&(I+="?".concat(this.paramsString));var x=new S(I);C._video=x}return L&&0<L.length&&(L[0].side=_.materials[0].singleSided?c.FrontSide:_.materials[0].flipSided?c.BackSide:c.DoubleSide,_.materials[0].specularCoef&&(L[0].shininess=Math.floor(_.materials[0].specularCoef/3))),{geometry:C,materials:L}}}()})},(o,l,u)=>{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(p,v){this.handlers.push(p,v)},get:function(p){for(var v=this.handlers,m=0,d=v.length;m<d;m+=2){var b=v[m],y=v[m+1];if(b.test(p))return y}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(p,v,m){for(var d=[],b=0;b<p.length;++b)d[b]=this.createMaterial(p[b],v,m);return d},createMaterial:function(){var h={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},p=new c.Color,v=new c.TextureLoader,m=new c.MaterialLoader;return function(d,b,y){function g(F,R,T,P,_){var E,C=b+F,L=f.Handlers.get(C);L===null?(v.setCrossOrigin(y),E=v.load(C)):E=L.load(C),R!==void 0&&(E.repeat.fromArray(R),R[0]!==1&&(E.wrapS=c.RepeatWrapping),R[1]!==1&&(E.wrapT=c.RepeatWrapping)),T!==void 0&&E.offset.fromArray(T),P!==void 0&&(P[0]==="repeat"&&(E.wrapS=c.RepeatWrapping),P[0]==="mirror"&&(E.wrapS=c.MirroredRepeatWrapping),P[1]==="repeat"&&(E.wrapT=c.RepeatWrapping),P[1]==="mirror"&&(E.wrapT=c.MirroredRepeatWrapping)),_!==void 0&&(E.anisotropy=_);var I=c.MathUtils.generateUUID();return w[I]=E,I}var w={},A={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var S in d){var M=d[S];switch(S){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":A.name=M;break;case"blending":A.blending=h[M];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",S,"is no longer supported.");break;case"colorDiffuse":A.color=p.fromArray(M).getHex();break;case"colorSpecular":A.specular=p.fromArray(M).getHex();break;case"colorEmissive":A.emissive=p.fromArray(M).getHex();break;case"specularCoef":A.shininess=M;break;case"shading":M.toLowerCase()==="basic"&&(A.type="MeshBasicMaterial"),M.toLowerCase()==="phong"&&(A.type="MeshPhongMaterial"),M.toLowerCase()==="standard"&&(A.type="MeshStandardMaterial");break;case"mapDiffuse":A.map=g(M,d.mapDiffuseRepeat,d.mapDiffuseOffset,d.mapDiffuseWrap,d.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":A.emissiveMap=g(M,d.mapEmissiveRepeat,d.mapEmissiveOffset,d.mapEmissiveWrap,d.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":A.lightMap=g(M,d.mapLightRepeat,d.mapLightOffset,d.mapLightWrap,d.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":A.aoMap=g(M,d.mapAORepeat,d.mapAOOffset,d.mapAOWrap,d.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":A.bumpMap=g(M,d.mapBumpRepeat,d.mapBumpOffset,d.mapBumpWrap,d.mapBumpAnisotropy);break;case"mapBumpScale":A.bumpScale=M;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":A.normalMap=g(M,d.mapNormalRepeat,d.mapNormalOffset,d.mapNormalWrap,d.mapNormalAnisotropy);break;case"mapNormalFactor":A.normalScale=M;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":A.specularMap=g(M,d.mapSpecularRepeat,d.mapSpecularOffset,d.mapSpecularWrap,d.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":A.metalnessMap=g(M,d.mapMetalnessRepeat,d.mapMetalnessOffset,d.mapMetalnessWrap,d.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":A.roughnessMap=g(M,d.mapRoughnessRepeat,d.mapRoughnessOffset,d.mapRoughnessWrap,d.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":A.alphaMap=g(M,d.mapAlphaRepeat,d.mapAlphaOffset,d.mapAlphaWrap,d.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":A.side=c.BackSide;break;case"doubleSided":A.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),A.opacity=M;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":A[S]=M;break;case"vertexColors":M===!0&&(A.vertexColors=c.VertexColors),M==="face"&&(A.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",S,M)}}return A.type==="MeshBasicMaterial"&&delete A.emissive,A.type!=="MeshPhongMaterial"&&delete A.specular,1>A.opacity&&(A.transparent=!0),m.setTextures(w),m.parse(A)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var h=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(p,v){var m=p/v*h.video.duration;h.video.currentTime=m},this.getVideoDuration=function(){return h.video.duration},this.createCanvasVideoTexture=function(){return h.videoTexture=new c.VideoTexture(h.video),h.videoTexture.minFilter=c.LinearFilter,h.videoTexture.magFilter=c.LinearFilter,h.videoTexture.format=c.RGBFormat,h.video.currentTime=0,h.videoTexture},this.getCurrentTime=function(p){return h.video?p*(h.video.currentTime/h.video.duration):0},this.isReadyToPlay=function(){return!!(h.video&&3<=h.video.readyState)},function(){document&&(h.video=document.createElement("video"),h.video.crossOrigin="anonymous",h.video.src=f,h.video.load(),h.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,h=u(5).toBufferGeometry,p=u(5).getCircularTexture,v=u(17).Label,m=function(){u(10).ZincObject.call(this),this.isPointset=!0;var d=[];this.createMesh=(y,g,w)=>{if(y&&g){var A=h(y,w),S=p();g.map=S;var M=new f(A,g);this.setMesh(M,w.localTimeEnabled,w.localMorphColour)}};var b=(y,g,w,A)=>{if(w){var S=new c.Color(A),M=new v(w,S);M.setPosition(g[0],g[1],g[2]);var F=M.getSprite();F.material.sizeAttenuation=!1,F.material.alphaTest=.5,F.material.transparent=!0,F.material.depthWrite=!1,F.material.depthTest=!1,this.group.add(F),d[y]=M}};this.addPoints=(y,g,w)=>{if(y&&0<y.length){var A=this.drawRange-1,S=this.addVertices(y),M=this.getMorph();if(!M){var F=new c.PointsMaterial({alphaTest:.5,size:10,color:w,sizeAttenuation:!1});S.colorsNeedUpdate=!0,this.createMesh(S,F,{localTimeEnabled:!1,localMorphColour:!1})}var R=A+y.length,T=0;if(Array.isArray(g)&&g.length===y.length||typeof g=="string")for(A;A+T<R;){var P=typeof g=="string"?g:g[T];b(T,y[T],P,w),T++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setColourHex=function(y){this._lod._material.color.setHex(y),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(y);for(var g=0;g<d.length;g++)d[g]&&d[g].setColour(this._lod._material.color)},this.setColour=y=>{this._lod.setColour(y);for(var g=0;g<d.length;g++)d[g]&&d[g].setColour(this._lod._material.color)},this.setSize=y=>{this.morph&&this.morph.material&&(this.morph.material.size=y,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=y=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=y,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(y){if(0<=y&&this.drawRange>y){var g=this.getMorph().geometry.getAttribute("position");return[g.getX(y),g.getY(y),g.getZ(y)]}},this.editVertices=function(y,g){if(y&&y.length){var w=this.getMorph(),A=g+y.length-1;if(!w||0>g||A>=this.drawRange)return;var S=w.geometry.getAttribute("position"),M=g;y.forEach(F=>{var R=d[M];R&&R.setPosition(F[0],F[1],F[2]),S.setXYZ(M++,F[0],F[1],F[2])}),S.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(y,g,w,A)=>{this.morph&&w&&(this.morph.sizePerPixel=w.pixelHeight),m.prototype.render.call(this,y,g,w,A)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=m},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,h=new c.Ray,p=new c.Sphere,v=new c.Vector3,m=new c.Vector3,d=new c.Vector3;class b extends c.Object3D{constructor(){var A=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,S=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.PointsMaterial;super(),this.type="Points",this.geometry=A,this.material=S,this.sizePerPixel=1,this.updateMorphTargets()}copy(A){return super.copy(A),this.material=A.material,this.geometry=A.geometry,this}raycast(A,S){var M=this.geometry,F=this.matrixWorld,R=A.params.Points.threshold,T=M.drawRange;if(M.boundingSphere===null&&M.computeBoundingSphere(),p.copy(M.boundingSphere),p.applyMatrix4(F),p.radius+=R,A.ray.intersectsSphere(p)!==!1){f.copy(F).invert(),h.copy(A.ray).applyMatrix4(f);var P=R/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,_=P*P;if(M.isBufferGeometry){var E=M.index,C=M.attributes,L=C.position,I=M.morphAttributes.position;if(E!==null)for(var x,O=Math.max(0,T.start),B=Math.min(E.count,T.start+T.count),D=O;D<B;D++)x=E.getX(D),g(this,L,I,x),y(v,x,_,F,A,S,this);else for(var k=Math.max(0,T.start),V=Math.min(L.count,T.start+T.count),G=k;G<V;G++)g(this,L,I,G),y(v,G,_,F,A,S,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var A=this.geometry;if(A.isBufferGeometry){var S=A.morphAttributes,M=Object.keys(S);if(0<M.length){var F=S[M[0]];if(F!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var R,T=0,P=F.length;T<P;T++)R=F[T].name||T+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[R]=T}}}else{var _=A.morphTargets;_!==void 0&&0<_.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function y(w,A,S,M,F,R,T){var P=h.distanceSqToPoint(w);if(P<S){var _=new c.Vector3;h.closestPointToPoint(w,_),_.applyMatrix4(M);var E=F.ray.origin.distanceTo(_);if(E<F.near||E>F.far)return;R.push({distance:E,distanceToRay:Math.sqrt(P),point:_,index:A,face:null,object:T})}}function g(w,A,S,M){v.fromBufferAttribute(A,M);var F=w.morphTargetInfluences;if(w.material.morphTargets&&S&&F){m.set(0,0,0);for(var R=0,T=S.length;R<T;R++){var P=F[R],_=S[R];P!==0&&(d.fromBufferAttribute(_,M),m.addScaledVector(d.sub(v),P))}v.add(m)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,h=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(p,v,m)=>{if(p&&v){var d=f(p,m);m.localMorphColour&&d.morphAttributes.color&&(v.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(d,v);this.setMesh(b,m.localTimeEnabled,m.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addLines=(p,v)=>{if(p&&0<p.length){var m=this.addVertices(p),d=this.getMorph();if(!d){var b=new c.LineBasicMaterial({color:v});m.colorsNeedUpdate=!0,this.createLineSegment(m,b,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Lines=h},(o,l,u)=>{function c(v,m,d,b,y,g,w){try{var A=v[g](w),S=A.value}catch(M){return void d(M)}A.done?m(S):Promise.resolve(S).then(b,y)}function f(v){return function(){var m=this,d=arguments;return new Promise(function(b,y){function g(S){c(A,b,y,g,w,"next",S)}function w(S){c(A,b,y,g,w,"throw",S)}var A=v.apply(m,d);g(void 0)})}}var h=u(4),p=function(){var v=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var m=f(function*(d){var b=1,y=1,g=0;if(d&&d.length){v.isLoading=!0;var w=new Image;w.crossOrigin="Anonymous";for(var A,S=document.createElement("canvas"),M=0,F=Array(d.length),R=0;R<d.length;R++)A=yield v.imageToUint8Array(v,w,d[R],S),A&&A.array&&(b=A.width,y=A.height,F[g]=A.array,M+=F[g].length,g++);var T=new Uint8Array(M);M=0,F.forEach(P=>{T.set(P,M),M+=P.length}),v.impl=new h.DataTexture2DArray(T,b,y,g),v.size={width:b,height:y,depth:g},v.isLoading=!1,v.impl.needsUpdate=!0}});return function(){return m.apply(this,arguments)}}(),this.getMaterial=m=>{if(this.impl){var d;if(!m)d=new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide});else if(m.vs&&m.fs){var b=!0;"transparent"in m&&(b=m.transparent);var y=h.FrontSide;m.side&&(y=m.side),d=new h.ShaderMaterial({transparent:b,uniforms:m.uniforms,vertexShader:m.vs,fragmentShader:m.fs,side:y}),m.glslVersion&&(d.glslVersion=m.glslVersion)}if(d)return d.needsUpdate=!0,d}}};p.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=p},(o,l,u)=>{function c(v,m,d,b,y,g,w){try{var A=v[g](w),S=A.value}catch(M){return void d(M)}A.done?m(S):Promise.resolve(S).then(b,y)}function f(v){return function(){var m=this,d=arguments;return new Promise(function(b,y){function g(S){c(A,b,y,g,w,"next",S)}function w(S){c(A,b,y,g,w,"throw",S)}var A=v.apply(m,d);g(void 0)})}}var h=u(4),p=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};p.prototype.loadImage=function(v,m){return new Promise((d,b)=>{v.onload=()=>d(v),v.onerror=b,v.src=m})},p.prototype.imageToUint8Array=function(){var v=f(function*(m,d,b,y){yield m.loadImage(d,b),y.width=d.width,y.height=d.height;var g=y.getContext("2d");return g.drawImage(d,0,0),{array:new Uint8Array(g.getImageData(0,0,y.width,y.height).data.buffer),width:y.width,height:y.height}});return function(){return v.apply(this,arguments)}}(),p.prototype.loadFromImages=function(){var v=f(function*(){});return function(){return v.apply(this,arguments)}}(),p.prototype.isReady=function(){return!(!this.impl||this.isLoading)},p.prototype.getMaterial=function(){if(this.impl)return new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide})},l.Texture=p},(o,l,u)=>{function c(y,g){var w=Object.keys(y);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(y);g&&(A=A.filter(function(S){return Object.getOwnPropertyDescriptor(y,S).enumerable})),w.push.apply(w,A)}return w}function f(y){for(var g,w=1;w<arguments.length;w++)g=arguments[w]==null?{}:arguments[w],w%2?c(Object(g),!0).forEach(function(A){h(y,A,g[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):c(Object(g)).forEach(function(A){Object.defineProperty(y,A,Object.getOwnPropertyDescriptor(g,A))});return y}function h(y,g,w){return(g=p(g))in y?Object.defineProperty(y,g,{value:w,enumerable:!0,configurable:!0,writable:!0}):y[g]=w,y}function p(y){var g=v(y,"string");return typeof g=="symbol"?g:g+""}function v(y,g){if(typeof y!="object"||!y)return y;var w=y[Symbol.toPrimitive];if(w!==void 0){var A=w.call(y,g||"default");if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(y)}var m=u(4),d=u(28),b=function(y){u(29).TexturePrimitive.call(this,y),this.isTextureSlides=!0;var g=[],w={};this.morph=new m.Group,this.group=this.morph,this.morph.userData=this;var A=void 0,S=!0;this.createSlides=R=>{R.forEach(T=>this.createSlide(T))};var M=(R,T)=>{var P=R.material,_=P.uniforms;switch(R.rotation.x=0,R.rotation.y=0,R.rotation.z=0,R.position.x=0,R.position.y=0,R.position.z=0,T.direction){case"x":var E=-Math.PI/2;R.rotation.y=E,_.direction.value=1,_.slide.value.set(T.value,0,0),R.position.x=T.value;break;case"y":R.rotation.x=Math.PI/2,_.direction.value=2,_.slide.value.set(0,T.value,0),R.position.y=T.value;break;case"z":_.direction.value=3,_.slide.value.set(0,0,T.value),R.position.z=T.value;break}P.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=R=>{R&&R.id&&R.id in w&&w[R.id]&&M(w[R.id],R)},this.createSlide=R=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&R&&R.direction&&R.value!==void 0){var T=new m.PlaneGeometry(1,1);T.translate(.5,.5,0);var P=d.getUniforms();P.diffuse.value=this.texture.impl,P.depth.value=this.texture.size.depth,P.flipY.value=S;var _={fs:d.fs,vs:d.vs,uniforms:P,glslVersion:d.glslVersion,side:m.DoubleSide,transparent:!1},E=this.texture.getMaterial(_);E.needsUpdate=!0;var C=new m.Mesh(T,E);C.name=this.groupName,C.userData=this;var L={value:R.value,direction:R.direction,id:C.id};return g.push(L),M(C,L),w[C.id]=C,this.morph.add(C),this.boundingBoxUpdateRequired=!0,L}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=R=>{for(var T=0;T<g.length;T++)if(R===g[T].id)return f({},g[T])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=R=>{R&&this.removeSlideWithId(R.id)},this.removeSlideWithId=R=>{if(this.morph&&R in w&&w[R]){if(this.morph.getObjectById(R)){var T=w[R];this.morph.remove(T),T.clear(),T.geometry&&T.geometry.dispose(),T.material&&T.material.dispose(),this.boundingBoxUpdateRequired=!0}var P=g.findIndex(_=>_.id===R);-1<P&&g.splice(P,1)}},this.dispose=()=>{this.morph.children.forEach(R=>{R.geometry&&R.geometry.dispose(),R.material&&R.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var F=(R,T,P)=>{if(T)switch(T.direction.value){case 1:P.copy(T.slide.value),R.expandByPoint(P),P.setY(1),P.setZ(1),R.expandByPoint(P);break;case 2:P.copy(T.slide.value),R.expandByPoint(P),P.setX(1),P.setZ(1),R.expandByPoint(P);break;case 3:P.copy(T.slide.value),R.expandByPoint(P),P.setX(1),P.setY(1),R.expandByPoint(P);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var R=new m.Vector3(0,0,0);this.morph.children.forEach(T=>{F(this.cachedBoundingBox,T.material.uniforms,R)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(R,T,P)=>{var _=new m.Matrix4;_.set(R[0],R[1],R[2],0,R[3],R[4],R[5],0,R[6],R[7],R[8],0,0,0,0,0);var E=new m.Quaternion().setFromRotationMatrix(_);this.morph.position.set(...T),this.morph.quaternion.copy(E),this.morph.scale.set(...P),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.setRenderOrder=R=>{this.morph.renderOrder=R},this.initialise=(R,T)=>{if(R){var P=R.locations;P&&0<P.length&&(this.applyTransformation(P[0].orientation,P[0].position,P[0].scale),"flipY"in P[0]&&(S=P[0].flipY)),this.createSlides(R.settings.slides),T!=null&&typeof T=="function"&&T(this)}},this.showEdges=R=>{if(A)A.material.color=R;else{var T=new m.BoxGeometry(1,1,1);T.translate(.5,.5,.5);var P=new m.EdgesGeometry(T);A=new m.LineSegments(P,new m.LineBasicMaterial({color:R})),this.group.add(A)}A.visible=!0},this.hideEdges=()=>{A&&(A.visible=!1)}};b.prototype=Object.create(u(29).TexturePrimitive.prototype),b.prototype.constructor=b,l.TextureSlides=b},(o,l,u)=>{var c=u(4),f=c.GLSL3,h=`
3185
3185
  precision highp float;
3186
3186
  precision highp int;
3187
3187
  precision highp sampler2DArray;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/scaffoldvuer",
3
- "version": "1.13.0-beta.1",
3
+ "version": "1.13.0-beta.2",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -53,7 +53,7 @@
53
53
  "unplugin-vue-components": "^0.26.0",
54
54
  "vue": "^3.4.21",
55
55
  "vue-router": "^4.2.5",
56
- "zincjs": "^1.16.0"
56
+ "zincjs": "^1.16.1"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@babel/eslint-parser": "^7.28.0",