@abi-software/scaffoldvuer 1.8.1-beta.4 → 1.9.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scaffoldvuer.js +17 -11
- package/dist/scaffoldvuer.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/src/App.vue +37 -0
- package/src/components/ScaffoldVuer.vue +24 -12
- package/vite.web-component.js +36 -0
|
@@ -3179,7 +3179,7 @@ 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 Re().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 kB{constructor(){this.name=tt.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 Sf}extendParams(e,t,i){const r=t.extensions[this.name];e.color=new Re(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 Re(0,0,0),e.glossiness=r.glossinessFactor!==void 0?r.glossinessFactor:1,e.specular=new Re(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 Sf(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=ir,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 zB{constructor(){this.name=tt.KHR_MESH_QUANTIZATION}}class Ao 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}}Ao.prototype.beforeStart_=Ao.prototype.copySampleValue_,Ao.prototype.afterEnd_=Ao.prototype.copySampleValue_,Ao.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,d=f*f,p=d*f,y=n*u,m=y-u,h=-2*p+3*d,b=p-d,v=1-h,g=b-d+f;for(let w=0;w!==o;w++){const S=s[m+w+o],T=s[m+w+l]*c,M=s[y+w+o],_=s[y+w]*c;r[w]=v*S+g*T+h*M+b*_}return r};const Di={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},za={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ux={9728:St,9729:gt,9984:Qo,9985:kl,9986:ea,9987:Mi},dx={33071:zt,33648:Os,10497:nr},hx={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},_f={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},wr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},UB={CUBICSPLINE:void 0,LINEAR:Fr,STEP:Bs},Ef={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function fx(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 GB(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Kr({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Qi})),n.DefaultMaterial}function Ua(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 ls(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 HB(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 WB(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 jB(n){const e=n.extensions&&n.extensions[tt.KHR_DRACO_MESH_COMPRESSION];let t;return e?t="draco:"+e.bufferView+":"+e.indices+":"+px(e.attributes):t=n.indices+":"+px(n.attributes)+":"+n.mode,t}function px(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 Tf(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 $B{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new AB,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 af(this.options.manager):this.textureLoader=new Kh(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new bn(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:{}};Ua(s,l,r),ls(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[tt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,o){i.load(fx(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=hx[r.type],c=za[r.componentType],f=c.BYTES_PER_ELEMENT,d=f*u,p=r.byteOffset||0,y=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,m=r.normalized===!0;let h,b;if(y&&y!==d){const v=Math.floor(p/y),g="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+v+":"+r.count;let w=t.cache.get(g);w||(h=new c(l,v*y,r.count*y/f),w=new pr(h,y/f),t.cache.add(g,w)),b=new Oi(w,u,p%y/f,m)}else l===null?h=new c(r.count*u):h=new c(l,p,r.count*u),b=new je(h,u,m);if(r.sparse!==void 0){const v=hx.SCALAR,g=za[r.sparse.indices.componentType],w=r.sparse.indices.byteOffset||0,S=r.sparse.values.byteOffset||0,T=new g(o[1],w,r.sparse.count*v),M=new c(o[2],S,r.sparse.count*u);l!==null&&(b=new je(b.array.slice(),b.itemSize,b.normalized));for(let _=0,C=T.length;_<C;_++){const I=T[_];if(b.setX(I,M[_*u]),u>=2&&b.setY(I,M[_*u+1]),u>=3&&b.setZ(I,M[_*u+2]),u>=4&&b.setW(I,M[_*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||"",d=!1,p=!0;const y=f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||y)&&(p=!1),t.bufferView!==void 0)f=r.getDependency("bufferView",t.bufferView).then(function(h){if(t.mimeType==="image/png"){const v=new DataView(h,25,1).getUint8(0,!1);p=v===6||v===4||v===3}d=!0;const b=new Blob([h],{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(h){return new Promise(function(b,v){let g=b;i.isImageBitmapLoader===!0&&(g=function(w){const S=new _t(w);S.needsUpdate=!0,b(S)}),i.load(fx(h,o.path),g,void 0,v)})}).then(function(h){d===!0&&c.revokeObjectURL(f),h.flipY=!1,l.name&&(h.name=l.name),p||(h.format=_i);const v=(s.samplers||{})[l.sampler]||{};return h.magFilter=ux[v.magFilter]||gt,h.minFilter=ux[v.minFilter]||Mi,h.wrapS=dx[v.wrapS]||nr,h.wrapT=dx[v.wrapT]||nr,r.associations.set(h,{type:"textures",index:e}),h}).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[tt.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[tt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=r.associations.get(s);s=r.extensions[tt.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 mr,It.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 Ft,It.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 Kr}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[tt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const d=r[tt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=d.getMaterialType(),c.push(d.extendParams(l,s,t))}else if(u[tt.KHR_MATERIALS_UNLIT]){const d=r[tt.KHR_MATERIALS_UNLIT];o=d.getMaterialType(),c.push(d.extendParams(l,s,t))}else{const d=s.pbrMetallicRoughness||{};if(l.color=new Re(1,1,1),l.opacity=1,Array.isArray(d.baseColorFactor)){const p=d.baseColorFactor;l.color.fromArray(p),l.opacity=p[3]}d.baseColorTexture!==void 0&&c.push(t.assignTexture(l,"map",d.baseColorTexture)),l.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,l.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(l,"metalnessMap",d.metallicRoughnessTexture)),c.push(t.assignTexture(l,"roughnessMap",d.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=er);const f=s.alphaMode||Ef.OPAQUE;return f===Ef.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,f===Ef.MASK&&(l.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new Se(1,-1),s.normalTexture.scale!==void 0&&l.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(l,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(l.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(l.emissive=new Re().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(l,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let d;return o===Sf?d=r[tt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):d=new o(l),s.name&&(d.name=s.name),d.map&&(d.map.encoding=zr),d.emissiveMap&&(d.emissiveMap.encoding=zr),ls(d,s),t.associations.set(d,{type:"materials",index:e}),s.extensions&&Ua(r,d,s),d})}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[tt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(l,t).then(function(u){return gx(u,l,t)})}const o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l],f=jB(c),d=r[f];if(d)o.push(d.promise);else{let p;c.extensions&&c.extensions[tt.KHR_DRACO_MESH_COMPRESSION]?p=s(c):p=gx(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?GB(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],d=[];for(let y=0,m=f.length;y<m;y++){const h=f[y],b=o[y];let v;const g=c[y];if(b.mode===Di.TRIANGLES||b.mode===Di.TRIANGLE_STRIP||b.mode===Di.TRIANGLE_FAN||b.mode===void 0)v=s.isSkinnedMesh===!0?new wa(h,g):new Tt(h,g),v.isSkinnedMesh===!0&&!v.geometry.attributes.skinWeight.normalized&&v.normalizeSkinWeights(),b.mode===Di.TRIANGLE_STRIP?v.geometry=yx(v.geometry,xy):b.mode===Di.TRIANGLE_FAN&&(v.geometry=yx(v.geometry,Fd));else if(b.mode===Di.LINES)v=new on(h,g);else if(b.mode===Di.LINE_STRIP)v=new ei(h,g);else if(b.mode===Di.LINE_LOOP)v=new Mc(h,g);else if(b.mode===Di.POINTS)v=new oo(h,g);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+b.mode);Object.keys(v.geometry.morphAttributes).length>0&&WB(v,s),v.name=t.createUniqueName(s.name||"mesh_"+e),ls(v,s),b.extensions&&Ua(r,v,b),t.assignFinalMaterial(v),d.push(v)}if(d.length===1)return d[0];const p=new Qn;for(let y=0,m=d.length;y<m;y++)p.add(d[y]);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 Bt(Wd.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new So(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),ls(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 d=i.channels[c],p=i.samplers[d.sampler],y=d.target,m=y.node!==void 0?y.node:y.id,h=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",h)),o.push(this.getDependency("accessor",b)),l.push(p),u.push(y)}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],d=c[1],p=c[2],y=c[3],m=c[4],h=[];for(let v=0,g=f.length;v<g;v++){const w=f[v],S=d[v],T=p[v],M=y[v],_=m[v];if(w===void 0)continue;w.updateMatrix(),w.matrixAutoUpdate=!0;let C;switch(wr[_.path]){case wr.weights:C=xo;break;case wr.rotation:C=Qr;break;case wr.position:case wr.scale:default:C=wo;break}const I=w.name?w.name:w.uuid,E=M.interpolation!==void 0?UB[M.interpolation]:Fr,P=[];wr[_.path]===wr.weights?w.traverse(function(R){R.isMesh===!0&&R.morphTargetInfluences&&P.push(R.name?R.name:R.uuid)}):P.push(I);let A=T.array;if(T.normalized){const R=Tf(A.constructor),L=new Float32Array(A.length);for(let N=0,x=A.length;N<x;N++)L[N]=A[N]*R;A=L}for(let R=0,L=P.length;R<L;R++){const N=new C(P[R]+"."+wr[_.path],S.array,A,E);M.interpolation==="CUBICSPLINE"&&(N.createInterpolant=function(O){return new Ao(this.times,this.values,this.getValueSize()/3,O)},N.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),h.push(N)}}const b=i.name?i.name:"animation_"+e;return new Mo(b,void 0,h)})}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 Ma:l.length>1?u=new Qn:l.length===1?u=l[0]:u=new Ze,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),ls(u,s),s.extensions&&Ua(i,u,s),s.matrix!==void 0){const c=new Ne;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)),ls(o,r),r.extensions&&Ua(i,o,r);const l=r.nodes||[],u=[];for(let c=0,f=l.length;c<f;c++)u.push(mx(l[c],o,t,s));return Promise.all(u).then(function(){return o})}}function mx(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 d=0,p=l.length;d<p;d++){const y=l[d];if(y){c.push(y);const m=new Ne;o.inverseBindMatrices!==void 0&&m.fromArray(o.inverseBindMatrices.array,d*16),f.push(m)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',o.joints[d])}u.bind(new Sa(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(mx(f,s,t,i))}}return Promise.all(o)})}function ZB(n,e,t){const i=e.attributes,r=new un;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=Tf(za[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 d=s[c];if(d.POSITION!==void 0){const p=t.json.accessors[d.POSITION],y=p.min,m=p.max;if(y!==void 0&&m!==void 0){if(u.setX(Math.max(Math.abs(y[0]),Math.abs(m[0]))),u.setY(Math.max(Math.abs(y[1]),Math.abs(m[1]))),u.setZ(Math.max(Math.abs(y[2]),Math.abs(m[2]))),p.normalized){const h=Tf(za[p.componentType]);u.multiplyScalar(h)}l.max(u)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(l)}n.boundingBox=r;const o=new Ti;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,n.boundingSphere=o}function gx(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=_f[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 ls(n,e),ZB(n,e,t),Promise.all(r).then(function(){return e.targets!==void 0?HB(n,e.targets,t):n})}function yx(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===Fd)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 XB=Rl(Object.freeze(Object.defineProperty({__proto__:null,GLTFLoader:CB},Symbol.toStringTag,{value:"Module"})));var Cf={exports:{}},vx;function YB(){return vx||(vx=1,function(n){function e(c){var f={};function d(y){if(f[y])return f[y].exports;var m=f[y]={i:y,l:!1,exports:{}};return c[y].call(m.exports,m,m.exports,d),m.l=!0,m.exports}d.m=c,d.c=f,d.i=function(y){return y},d.d=function(y,m,h){d.o(y,m)||Object.defineProperty(y,m,{configurable:!1,enumerable:!0,get:h})},d.r=function(y){Object.defineProperty(y,"__esModule",{value:!0})},d.n=function(y){var m=y&&y.__esModule?function(){return y.default}:function(){return y};return d.d(m,"a",m),m},d.o=function(y,m){return Object.prototype.hasOwnProperty.call(y,m)},d.p="/",d.oe=function(y){throw console.error(y),y};var p=d(d.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,d){var p={};p[d]=[];var y=f.toString(),m=y.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!m)return p;for(var h=m[1],b=new RegExp("(\\\\n|\\W)"+r(h)+i,"g"),v;v=b.exec(y);)v[3]!=="dll-reference"&&p[d].push(v[3]);for(b=new RegExp("\\("+r(h)+'\\("(dll-reference\\s('+t+'))"\\)\\)'+i,"g");v=b.exec(y);)c[v[2]]||(p[d].push(v[1]),c[v[2]]=__webpack_require__(v[1]).m),p[v[2]]=p[v[2]]||[],p[v[2]].push(v[4]);for(var g=Object.keys(p),w=0;w<g.length;w++)for(var S=0;S<p[g[w]].length;S++)s(p[g[w]][S])&&(p[g[w]][S]=1*p[g[w]][S]);return p}function l(c){var f=Object.keys(c);return f.reduce(function(d,p){return d||c[p].length>0},!1)}function u(c,f){for(var d={main:[f]},p={main:[]},y={main:{}};l(d);)for(var m=Object.keys(d),h=0;h<m.length;h++){var b=m[h],v=d[b],g=v.pop();if(y[b]=y[b]||{},!(y[b][g]||!c[b][g])){y[b][g]=!0,p[b]=p[b]||[],p[b].push(g);for(var w=o(c,c[b][g],b),S=Object.keys(w),T=0;T<S.length;T++)d[S[T]]=d[S[T]]||[],d[S[T]]=d[S[T]].concat(w[S[T]])}}return p}n.exports=function(c,f){f=f||{};var d={main:__webpack_modules__},p=f.all?{main:Object.keys(d.main)}:u(d,c),y="";Object.keys(p).filter(function(g){return g!=="main"}).forEach(function(g){for(var w=0;p[g][w];)w++;p[g].push(w),d[g][w]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",y=y+"var "+g+" = ("+e.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+p[g].map(function(S){return""+JSON.stringify(S)+": "+d[g][S].toString()}).join(",")+`});
|
|
3182
|
-
`}),y=y+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+p.main.map(function(g){return""+JSON.stringify(g)+": "+d.main[g].toString()}).join(",")+"}))(self);";var m=new window.Blob([y],{type:"text/javascript"});if(f.bare)return m;var h=window.URL||window.webkitURL||window.mozURL||window.msURL,b=h.createObjectURL(m),v=new window.Worker(b);return v.objectURL=b,v}}(Cf)),Cf.exports}function JB(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 KB(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(d){o(u,d)},function(d){r[u]={status:"rejected",reason:d},--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 bx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}bx.prototype=Error.prototype;function qB(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 bx(s,"All promises were rejected"))})}catch(l){i(l)}})}var QB=setTimeout;function xx(n){return!!(n&&typeof n.length<"u")}function eF(){}function tF(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 wx(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?Af:Ga)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Ga(e.promise,r);return}Af(e.promise,i)})}function Af(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,Rf(n);return}else if(typeof t=="function"){Mx(tF(t,e),n);return}}n._state=1,n._value=e,Rf(n)}catch(i){Ga(n,i)}}function Ga(n,e){n._state=2,n._value=e,Rf(n)}function Rf(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++)wx(n,n._deferreds[e]);n._deferreds=null}function nF(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,Af(e,i))},function(i){t||(t=!0,Ga(e,i))})}catch(i){if(t)return;t=!0,Ga(e,i)}}pt.prototype.catch=function(n){return this.then(null,n)},pt.prototype.then=function(n,e){var t=new this.constructor(eF);return wx(this,new nF(n,e,t)),t},pt.prototype.finally=JB,pt.all=function(n){return new pt(function(e,t){if(!xx(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=qB,pt.allSettled=KB,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(!xx(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){QB(n,0)},pt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const iF=Rl(Object.freeze(Object.defineProperty({__proto__:null,default:pt},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(Ki,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,d=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(50).GeometryCSG,this.GlyphsetCSG=u(56).GlyphsetCSG,this.Viewport=u(43).Viewport,this.CameraControls=u(43).CameraControls,this.SmoothCameraTransition=u(43).SmoothCameraTransition,this.RayCaster=u(43).RayCaster,this.CameraAutoTumble=u(43).CameraAutoTumble,this.StereoEffect=u(43).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new d},o=>{o.exports=JR()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.12.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,d=(y,m,h)=>{var b=f(y,h),v=!1;1>h.opacity&&(v=!0);var g;if(b._video===void 0){var w=h.localTimeEnabled||h.localMorphColour;m?(g=m,g.morphTargets=w,g.morphNormals=h.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:h.colour,morphTargets:w,morphNormals:h.localTimeEnabled,transparent:v,opacity:h.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:h.colour,morphTargets:w,morphNormals:h.localTimeEnabled,vertexColors:c.VertexColors,transparent:v,opacity:h.opacity,side:c.DoubleSide}),h.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var S=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:h.localTimeEnabled,color:new c.Color(1,1,1),transparent:v,opacity:h.opacity,map:S,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=(y,m,h)=>{if(!(this.morph&&this.morph.geometry&&y!=null)){var b=d(y,m,h);this.setMesh(b,h.localTimeEnabled,h.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var y=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,h=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(y.x-m.x,y.y-m.y);this.geometry.faceVertexUvs[0]=[];for(var v=0;v<this.geometry.faces.length;v++){var g=this.geometry.vertices[this.geometry.faces[v].a],w=this.geometry.vertices[this.geometry.faces[v].b],S=this.geometry.vertices[this.geometry.faces[v].c];geometry.faceVertexUvs[0].push([new c.Vector2((g.x+h.x)/b.x,(g.y+h.y)/b.y),new c.Vector2((w.x+h.x)/b.x,(w.y+h.y)/b.y),new c.Vector2((S.x+h.x)/b.x,(S.y+h.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=y=>{this.morph.material.wireframe=y},this.editVertices=function(y,m){if(y&&y.length){var h=this.getMorph(),b=h.geometry.getAttribute("position");if(!h||0>m)return;var v=3*m;y.forEach(g=>{b.array[v++]=g[0],b.array[v++]=g[1],b.array[v++]=g[2]}),b.needsUpdate=!0,h.geometry.computeBoundingBox(),h.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=cB},(o,l,u)=>{function c(C){throw new TypeError('"'+C+'" is read-only')}var f=u(4),d=u(6).Geometry,p=u(7).default;function y(C){var I=C,E=u(0).modelPrefix;return E&&(E[E.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(C)||(I=E+C)),I}function m(C,I){var E=(A,R)=>{try{var L=new URL(A,R).href;if(A&&2>A.split("?").length){var N=R.split("?");N.length===2&&(L=L+"?"+N[1])}return L}catch{console.error("There is an issue creating the url link with: ".concat(A,"."))}};if(!Array.isArray(C))return E(C,I);var P=[];return C.forEach(A=>{P.push(E(A,I))}),P}function h(C,I,E,P,A){var R=C.morphTargetInfluences,L=void 0;C.geometry&&(L=C.geometry.morphAttributes);var N=!1;if(R&&L&&L.position){P.set(0,0,0),A.set(0,0,0);for(var x=0;x<R.length;x++)0<R[x]&&(N=!0,E.setFromArray(L.position[x].array),P.add(E.min.multiplyScalar(R[x])),A.add(E.max.multiplyScalar(R[x])));N&&I.set(P,A)}N||I.setFromBufferAttribute(C.geometry.attributes.position),C.updateWorldMatrix(!0,!0),I.applyMatrix4(C.matrixWorld)}function b(C,I,E,P){var A=new XMLHttpRequest;A.open("GET",y(C),!0),A.onreadystatechange=()=>{A.readyState==4&&(A.status==200?E(A.responseText,I):P(C))},A.send(null)}function v(C,I,E){function P(x,O){L[O]=x,R++,R==A&&I(L)}for(var A=C.length,R=0,L=[],N=0;N<A;N++)b(C[N],N,P,E)}l.getColorsRGB=(C,I)=>{var E=Math.floor(I/3),P=I%3,A=0;P==0?A=C[E].r:P==1?A=C[E].g:P==2&&(A=C[E].b);var R=new f.Color(A);return[R.r,R.g,R.b]},l.updateMorphColorAttribute=function(C,I){if(I&&C&&C.morphAttributes&&C.morphAttributes.color){var E=C.morphAttributes.color,P=I.morphTargetInfluences,A=P.length;C.deleteAttribute("morphColor0"),C.deleteAttribute("morphColor1");for(var R=0,L=[],N=0;1>R||N<A;N++)0<P[N]&&(R++,L.push([N,P[N]]));L.length==2?(C.setAttribute("morphColor0",E[L[0][0]]),C.setAttribute("morphColor1",E[L[1][0]])):L.length==1&&(C.setAttribute("morphColor0",E[L[0][0]]),C.setAttribute("morphColor1",E[L[0][0]]))}},l.toBufferGeometry=(C,I)=>{var E;return C instanceof d?(I.localTimeEnabled&&!C.morphNormalsReady&&(C.morphNormals==null||C.morphNormals.length==0)&&C.computeMorphNormals(),E=C.toIndexedBufferGeometry(),I.localMorphColour&&g(C,E)):C instanceof f.BufferGeometry&&(E=C.clone()),E.colorsNeedUpdate=!0,E.computeBoundingBox(),E.computeBoundingSphere(),C._video&&(E._video=C._video),E},l.copyMorphColorsToBufferGeometry=(C,I)=>{if(C&&C.morphColors&&0<C.morphColors.length){for(var E=[],P=C.morphColors,A=u(5).getColorsRGB,R=0,L=P.length;R<L;R++){for(var N=P[R],x=[],O=0;O<C.faces.length;O++){var B=C.faces[O],F=A(N.colors,B.a);x.push(F[0],F[1],F[2]),F=A(N.colors,B.b),x.push(F[0],F[1],F[2]),F=A(N.colors,B.c),x.push(F[0],F[1],F[2])}var V=new f.Float32BufferAttribute(3*(3*C.faces.length),3);V.name=N.name,E.push(V.copyArray(x))}I.morphAttributes.color=E}};var g=(C,I)=>{if(C&&C.morphColors&&0<C.morphColors.length){for(var E=[],P=C.morphColors,A=u(5).getColorsRGB,R=0,L=P.length;R<L;R++){for(var N,x=P[R],O=[],B=0;B<3*x.colors.length;B++)N=A(x.colors,B),O.push(N[0],N[1],N[2]);var F=new f.Float32BufferAttribute(O,3);F.name=x.name,E.push(F)}I.morphAttributes.color=E}};l.mergeVertices=function(C){var I=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;I=Math.max(I,Number.EPSILON);for(var E,P={},A=C.getIndex(),R=C.getAttribute("position"),L=A?A.count:R.count,N=0,x=Object.keys(C.attributes),O={},B={},ce=[],F=["getX","getY","getZ","getW"],V=0,k=x.length;V<k;V++){E=x[V],O[E]=[];var G=C.morphAttributes[E];G&&(B[E]=Array(G.length).fill().map(()=>[]))}for(var J=Math.log10(1/I),ne=Math.pow(10,J),V=0;V<L;V++){for(var ae=A?A.getX(V):V,ie="",oe=0,k=x.length;oe<k;oe++)for(var E=x[oe],W=C.getAttribute(E),X=W.itemSize,j=0;j<X;j++)ie+="".concat(~~(W[F[j]](ae)*ne),",");if(ie in P)ce.push(P[ie]);else{for(var oe=0,k=x.length;oe<k;oe++)for(var re,E=x[oe],W=C.getAttribute(E),G=C.morphAttributes[E],X=W.itemSize,z=O[E],H=B[E],j=0;j<X;j++)if(re=F[j],z.push(W[re](ae)),G)for(var K=0,le=G.length;K<le;K++)H[K].push(G[K][re](ae));P[ie]=N,ce.push(N),N++}}for(var se=C.clone(),V=0,k=x.length;V<k;V++){var W,E=x[V],U=C.getAttribute(E),D=new U.array.constructor(O[E]);if(U.isInterleavedBufferAttribute?W=new f.BufferAttribute(D,U.itemSize,U.itemSize):(W=C.getAttribute(E).clone(),W.setArray(D)),se.setAttribute(E,W),E in B)for(var $,oe=0;oe<B[E].length;oe++)$=C.morphAttributes[E][oe].clone(),$.setArray(new $.array.constructor(B[E][oe])),se.morphAttributes[E][oe]=$}var Y=Uint8Array;ce.length>=Math.pow(2,8)&&(Y=Uint16Array),ce.length>=Math.pow(2,16)&&(Y=Uint32Array);var ee=new Y(ce),ce=null;return A===null?ce=new f.BufferAttribute(ee,1):(ce=C.getIndex().clone(),ce.setArray(ee)),se.setIndex(ce),se};function w(C){if(C.isMeshPhongMaterial){var I=new f.MeshToonMaterial({color:C.color.clone(),morphTargets:C.morphTargets,morphNormals:C.morphNormals,vertexColors:C.vertexColors,transparent:C.transparent,opacity:C.opacity,side:C.side});return C.map&&(I.map=C.map),I}return C}function S(C,I){if(I&&C>=I.length){var E=new f.BufferGeometry,P=new Float32Array(3*C),A=0;return I.forEach(R=>{P[A++]=R[0],P[A++]=R[1],P[A++]=R[2]}),E.setAttribute("position",new f.BufferAttribute(P,3)),E.setDrawRange(0,I.length),E}}function T(){var C=new Image;C.src=u(8);var I=new f.Texture;return I.image=C,I.needsUpdate=!0,I}function M(C,I,E,P,A,R){var L=new p(C,I,E,P,A,R);return L.fontFace=P,L.fontSize=A,L.fontWeight=R,L.material.map.generateMipmaps=!1,L.material.map.anisotropy=4,L.material.sizeAttenuation=!1,L.material.alphaTest=.5,L.material.transparent=!0,L.material.depthWrite=!1,L.material.depthTest=!1,L.center.set(.5,-1.2),L.renderOrder=1e4,L}function _(C,I,E){if(E){var P=C||"",A=I||"",R=E.lastIndexOf("/");if(-1<R){var L=void 0,N=void 0;if(L=E.substring(0,R),N=E.substring(R+1),(L==="*"||L==="**"||L.toLowerCase()===P.toLowerCase())&&(N==="*"||N==="**"||N.toLowerCase()===A.toLowerCase()))return!0}else if(P.toLowerCase()===E.toLowerCase()||A.toLowerCase()===E.toLowerCase())return!0}return!1}l.getBoundingBox=h,l.createNewURL=m,l.createBufferGeometry=S,l.getCircularTexture=T,l.resolveURL=y,l.loadExternalFile=b,l.loadExternalFiles=v,l.PhongToToon=w,l.createNewSpriteText=M,l.isRegionGroup=_},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,d=new c.Object3D,p=new c.Vector3,y=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,S=new c.Matrix3().getNormalMatrix(g),T=0,M=this.vertices.length;T<M;T++)w=this.vertices[T],w.applyMatrix4(g);for(var _,C=0,I=this.faces.length;C<I;C++){_=this.faces[C],_.normal.applyMatrix3(S).normalize();for(var E=0,P=_.vertexNormals.length;E<P;E++)_.vertexNormals[E].applyMatrix3(S).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,S){return f.makeTranslation(g,w,S),this.applyMatrix4(f),this},scale:function(g,w,S){return f.makeScale(g,w,S),this.applyMatrix4(f),this},lookAt:function(g){return d.lookAt(g),d.updateMatrix(),this.applyMatrix4(d.matrix),this},fromBufferGeometry:function(g){function w(G,J,ne,ae){var ie=I===void 0?[]:[S.colors[G].clone(),S.colors[J].clone(),S.colors[ne].clone()],oe=C===void 0?[]:[new c.Vector3().fromBufferAttribute(C,G),new c.Vector3().fromBufferAttribute(C,J),new c.Vector3().fromBufferAttribute(C,ne)],W=new b(G,J,ne,oe,ie,ae);S.faces.push(W),E!==void 0&&S.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(E,G),new c.Vector2().fromBufferAttribute(E,J),new c.Vector2().fromBufferAttribute(E,ne)]),P!==void 0&&S.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(P,G),new c.Vector2().fromBufferAttribute(P,J),new c.Vector2().fromBufferAttribute(P,ne)])}var S=this,T=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 _=M.position,C=M.normal,I=M.color,E=M.uv,P=M.uv2;P!==void 0&&(this.faceVertexUvs[1]=[]);for(var A=0;A<_.count;A++)S.vertices.push(new c.Vector3().fromBufferAttribute(_,A)),I!==void 0&&S.colors.push(new c.Color().fromBufferAttribute(I,A));var R=g.groups;if(0<R.length)for(var L=0;L<R.length;L++)for(var N=R[L],x=N.start,O=N.count,B=x,F=x+O;B<F;B+=3)T===void 0?w(B,B+1,B+2,N.materialIndex):w(T.getX(B),T.getX(B+1),T.getX(B+2),N.materialIndex);else if(T!==void 0)for(var V=0;V<T.count;V+=3)w(T.getX(V),T.getX(V+1),T.getX(V+2));else for(var k=0;k<_.count;k+=3)w(k,k+1,k+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,S=w===0?1:1/w,T=new c.Matrix4;return T.set(S,0,0,-S*g.x,0,S,0,-S*g.y,0,0,S,-S*g.z,0,0,0,1),this.applyMatrix4(T),this},computeFaceNormals:function(){for(var g=new c.Vector3,w=new c.Vector3,S=0,T=this.faces.length;S<T;S++){var M=this.faces[S],_=this.vertices[M.a],C=this.vertices[M.b],I=this.vertices[M.c];g.subVectors(I,C),w.subVectors(_,C),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),S=0,T=this.vertices.length;S<T;S++)w[S]=new c.Vector3;if(g)for(var M=new c.Vector3,_=new c.Vector3,C=0,I=this.faces.length;C<I;C++){var E=this.faces[C],P=this.vertices[E.a],A=this.vertices[E.b],R=this.vertices[E.c];M.subVectors(R,A),_.subVectors(P,A),M.cross(_),w[E.a].add(M),w[E.b].add(M),w[E.c].add(M)}else{this.computeFaceNormals();for(var L,N=0,x=this.faces.length;N<x;N++)L=this.faces[N],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 F=0,V=this.faces.length;F<V;F++){var k=this.faces[F],G=k.vertexNormals;G.length===3?(G[0].copy(w[k.a]),G[1].copy(w[k.b]),G[2].copy(w[k.c])):(G[0]=w[k.a].clone(),G[1]=w[k.b].clone(),G[2]=w[k.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 S=this.faces[g],T=S.vertexNormals;T.length===3?(T[0].copy(S.normal),T[1].copy(S.normal),T[2].copy(S.normal)):(T[0]=S.normal.clone(),T[1]=S.normal.clone(),T[2]=S.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,w=0,S=this.faces.length;w<S;w++){g=this.faces[w],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var T=0,M=g.vertexNormals.length;T<M;T++)g.__originalVertexNormals[T]?g.__originalVertexNormals[T].copy(g.vertexNormals[T]):g.__originalVertexNormals[T]=g.vertexNormals[T].clone()}var _=new m;_.faces=this.faces;for(var C=0,I=this.morphTargets.length;C<I;C++){if(!this.morphNormals[C]){this.morphNormals[C]={},this.morphNormals[C].faceNormals=[],this.morphNormals[C].vertexNormals=[];for(var E=this.morphNormals[C].faceNormals,P=this.morphNormals[C].vertexNormals,A=0,R=this.faces.length;A<R;A++){var L=new c.Vector3,N={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};E.push(L),P.push(N)}}var x=this.morphNormals[C];_.vertices=this.morphTargets[C].vertices,_.computeFaceNormals();var O=_.computeVertexNormals();if(O&&0<O.length){this.morphTargets[C].normals=Array(this.vertices.length);for(var B=0;B<O.length;B++)this.morphTargets[C].normals[B]=O[B].clone()}for(var F=0,V=this.faces.length;F<V;F++){var k=this.faces[F],G=x.faceNormals[F],J=x.vertexNormals[F];G.copy(k.normal),J.a.copy(k.vertexNormals[0]),J.b.copy(k.vertexNormals[1]),J.c.copy(k.vertexNormals[2])}}for(var ne,ae=0,ie=this.faces.length;ae<ie;ae++)ne=this.faces[ae],ne.normal=ne.__originalFaceNormal,ne.vertexNormals=ne.__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 S=this.morphTargets.length,T=this.morphTargets,M=g.morphTargets,_=this.morphColors.length,C=this.morphColors,I=g.morphColors;if(0<S&&S==M.length)for(var E=0,P=T.length;E<P;E++){for(var A=T[E],R=M[E],L=0,N=R.vertices.length;L<N;L++){var x=R.vertices[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),A.vertices.push(O)}if(A.normals&&R.normals)for(var B=0;B<R.normals.length;B+=3)y.set(R.normals2[B],R.normals2[B+1],R.normals2[B+2]),w!==void 0&&y.applyMatrix4(w),A.normals.push(y.x,y.y,y.z)}if(0<_&&_==I.length)for(var F=0,V=C.length;F<V;F++)for(var k=C[F],G=I[F],J=0,ne=G.colors;J<ne;J++)k.colors.push(G.colors[J].clone())},merge:function(g,w){var S=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 T,M=this.vertices.length,_=this.vertices,C=g.vertices,I=g.normals,E=this.faces,P=g.faces,A=this.colors,R=g.colors;w!==void 0&&(T=new c.Matrix3().getNormalMatrix(w));for(var L=0,N=C.length;L<N;L++){var x=C[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),_.push(O)}for(var B=0;B<I.length;B+=3)y.set(I[B],I[B+1],I[B+2]),w!==void 0&&y.applyMatrix4(w),this.normals.push(y.x,y.y,y.z);for(var F=0,V=R.length;F<V;F++)typeof R[F]=="number"?A.push(R[F]):A.push(R[F].clone());for(var k=0,G=P.length;k<G;k++){var J=P[k],ne=void 0,ae=void 0,ie=J.vertexNormals,oe=J.vertexColors,W=new b(J.a+M,J.b+M,J.c+M);W.normal.copy(J.normal),T!==void 0&&W.normal.applyMatrix3(T).normalize();for(var X=0,j=ie.length;X<j;X++)ne=ie[X].clone(),T!==void 0&&ne.applyMatrix3(T).normalize(),W.vertexNormals.push(ne);W.color.copy(J.color);for(var re=0,z=oe.length;re<z;re++)ae=oe[re],W.vertexColors.push(ae.clone());W.materialIndex=J.materialIndex+S,E.push(W)}for(var H,K=0,le=g.faceVertexUvs.length;K<le;K++){H=g.faceVertexUvs[K],this.faceVertexUvs[K]===void 0&&(this.faceVertexUvs[K]=[]);for(var se=0,U=H.length;se<U;se++){for(var D=H[se],$=[],Y=0,ee=D.length;Y<ee;Y++)$.push(D[Y].clone());this.faceVertexUvs[K].push($)}}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={},S=[],T=[],M=Math.pow(10,g),_=0,C=this.vertices.length;_<C;_++){var I=this.vertices[_],E=Math.round(I.x*M)+"_"+Math.round(I.y*M)+"_"+Math.round(I.z*M);w[E]===void 0?(w[E]=_,S.push(this.vertices[_]),T[_]=S.length-1):T[_]=T[w[E]]}for(var P,A=[],R=0,L=this.faces.length;R<L;R++){P=this.faces[R],P.a=T[P.a],P.b=T[P.b],P.c=T[P.c];for(var N=[P.a,P.b,P.c],x=0;3>x;x++)if(N[x]===N[(x+1)%3]){A.push(R);break}}for(var O,B=A.length-1;0<=B;B--){O=A[B],this.faces.splice(O,1);for(var F=0,V=this.faceVertexUvs.length;F<V;F++)this.faceVertexUvs[F].splice(O,1)}var k=this.vertices.length-S.length;return this.vertices=S,k},setFromPoints:function(g){this.vertices=[];for(var w,S=0,T=g.length;S<T;S++)w=g[S],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,S=0;S<w;S++)g[S]._id=S;g.sort(function(P,A){return P.materialIndex-A.materialIndex});var T,M,_=this.faceVertexUvs[0],C=this.faceVertexUvs[1];_&&_.length===w&&(T=[]),C&&C.length===w&&(M=[]);for(var I,E=0;E<w;E++)I=g[E]._id,T&&T.push(_[I]),M&&M.push(C[I]);T&&(this.faceVertexUvs[0]=T),M&&(this.faceVertexUvs[1]=M)},toJSON:function(){function g(z,H,K){return K?z|1<<H:z&~(1<<H)}function w(z){var H=z.x.toString()+z.y.toString()+z.z.toString();return L[H]===void 0&&(L[H]=R.length/3,R.push(z.x,z.y,z.z)),L[H]}function S(z){var H=z.r.toString()+z.g.toString()+z.b.toString();return x[H]===void 0&&(x[H]=N.length,N.push(z.getHex())),x[H]}function T(z){var H=z.x.toString()+z.y.toString();return B[H]===void 0&&(B[H]=O.length/2,O.push(z.x,z.y)),B[H]}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 _=this.parameters;for(var C in _)_[C]!==void 0&&(M[C]=_[C]);return M}for(var I,E=[],P=0;P<this.vertices.length;P++)I=this.vertices[P],E.push(I.x,I.y,I.z);for(var A=[],R=[],L={},N=[],x={},O=[],B={},F=0;F<this.faces.length;F++){var V=this.faces[F],k=!0,G=!1,J=this.faceVertexUvs[0][F]!==void 0,ne=0<V.normal.length(),ae=0<V.vertexNormals.length,ie=V.color.r!==1||V.color.g!==1||V.color.b!==1,oe=0<V.vertexColors.length,W=0;if(W=g(W,0,0),W=g(W,1,k),W=g(W,2,G),W=g(W,3,J),W=g(W,4,ne),W=g(W,5,ae),W=g(W,6,ie),W=g(W,7,oe),A.push(W),A.push(V.a,V.b,V.c),A.push(V.materialIndex),J){var X=this.faceVertexUvs[0][F];A.push(T(X[0]),T(X[1]),T(X[2]))}if(ne&&A.push(w(V.normal)),ae){var j=V.vertexNormals;A.push(w(j[0]),w(j[1]),w(j[2]))}if(ie&&A.push(S(V.color)),oe){var re=V.vertexColors;A.push(S(re[0]),S(re[1]),S(re[2]))}}return M.data={},M.data.vertices=E,M.data.normals=R,0<N.length&&(M.data.colors=N),0<O.length&&(M.data.uvs=[O]),M.data.faces=A,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,S=0,T=w.length;S<T;S++)this.vertices.push(w[S].clone());for(var M=g.colors,_=0,C=M.length;_<C;_++)this.colors.push(M[_].clone());for(var I=g.faces,E=0,P=I.length;E<P;E++)this.faces.push(I[E].clone());for(var A,R=0,L=g.faceVertexUvs.length;R<L;R++){A=g.faceVertexUvs[R],this.faceVertexUvs[R]===void 0&&(this.faceVertexUvs[R]=[]);for(var N=0,x=A.length;N<x;N++){for(var O,B=A[N],F=[],V=0,k=B.length;V<k;V++)O=B[V],F.push(O.clone());this.faceVertexUvs[R].push(F)}}for(var G,J=g.morphTargets,ne=0,ae=J.length;ne<ae;ne++){if(G={},G.name=J[ne].name,J[ne].vertices!==void 0){G.vertices=[];for(var ie=0,oe=J[ne].vertices.length;ie<oe;ie++)G.vertices.push(J[ne].vertices[ie].clone())}if(J[ne].normals!==void 0){G.normals=[];for(var W=0,X=J[ne].normals.length;W<X;W++)G.normals.push(J[ne].normals[W].clone())}this.morphTargets.push(G)}for(var j,re=g.morphNormals,z=0,H=re.length;z<H;z++){if(j={},re[z].vertexNormals!==void 0){j.vertexNormals=[];for(var K=0,le=re[z].vertexNormals.length;K<le;K++){var se=re[z].vertexNormals[K],U={};U.a=se.a.clone(),U.b=se.b.clone(),U.c=se.c.clone(),j.vertexNormals.push(U)}}if(re[z].faceNormals!==void 0){j.faceNormals=[];for(var D=0,$=re[z].faceNormals.length;D<$;D++)j.faceNormals.push(re[z].faceNormals[D].clone())}this.morphNormals.push(j)}for(var Y=g.skinWeights,ee=0,ce=Y.length;ee<ce;ee++)this.skinWeights.push(Y[ee].clone());for(var ve=g.skinIndices,be=0,ue=ve.length;be<ue;be++)this.skinIndices.push(ve[be].clone());for(var me=g.lineDistances,te=0,he=me.length;te<he;te++)this.lineDistances.push(me[te]);var ge=g.boundingBox;ge!==null&&(this.boundingBox=ge.clone());var Ce=g.boundingSphere;return Ce!==null&&(this.boundingSphere=Ce.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 v,g,w=[],S=void 0,T=this.faces;for(g=0;g<T.length;g++){var M=T[g];M.materialIndex!==S&&(S=M.materialIndex,v!==void 0&&(v.count=3*g-v.start,w.push(v)),v={start:3*g,materialIndex:S})}return v!==void 0&&(v.count=3*g-v.start,w.push(v)),w},toBufferGeometry:function(){var g=new h().fromGeometry(this),w=new c.BufferGeometry,S=new Float32Array(3*g.vertices.length);if(w.setAttribute("position",new c.BufferAttribute(S,3).copyVector3sArray(g.vertices)),0<g.normals.length){var T=new Float32Array(3*g.normals.length);w.setAttribute("normal",new c.BufferAttribute(T,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 _=new Float32Array(2*g.uvs.length);w.setAttribute("uv",new c.BufferAttribute(_,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var C=new Float32Array(2*g.uvs2.length);w.setAttribute("uv2",new c.BufferAttribute(C,2).copyVector2sArray(g.uvs2))}for(var I in w.groups=g.groups,g.morphTargets){for(var E=[],P=g.morphTargets[I],A=0,R=P.length;A<R;A++){var L=P[A],N=new c.Float32BufferAttribute(3*L.data.length,3);N.name=L.name,E.push(N.copyVector3sArray(L.data))}w.morphAttributes[I]=E}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 S=new Float32Array(this.normals.length),T=new c.BufferAttribute(S,3).copyArray(this.normals);g.setAttribute("normal",T)}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 _=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(_,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var C=[],I=0;I<this.colors.length;I++)C.push(new c.Color(this.colors[I]));var E=new Float32Array(3*C.length);g.setAttribute("color",new c.BufferAttribute(E,3).copyColorsArray(C))}else{for(var P=new Float32Array(3*this.vertices.length),A=0;A<3*this.vertices.length;A++)P[A]=1;g.setAttribute("color",new c.BufferAttribute(P,3))}if(0<this.faces.length){for(var R=[],L=[],N=0;N<this.faces.length;N++){L.push(this.faces[N].a,this.faces[N].b,this.faces[N].c);var x=this.faces[N].vertexColors;if(x.length===3)R.push(x[0],x[1],x[2]);else{var O=this.faces[N].color;R.push(O,O,O)}}g.setIndex(L),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],F=[],V=0,k=this.morphTargets.length;V<k;V++){var G=this.morphTargets[V],J=new c.Float32BufferAttribute(3*G.vertices.length,3);if(J.name=G.name,B.push(J.copyVector3sArray(G.vertices)),G.normals){var ne=new c.Float32BufferAttribute(3*G.normals.length,3);ne.name=G.name,F.push(ne.copyVector3sArray(G.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=F}if(0<this.skinIndices.length){var ae=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",ae.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var ie=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",ie.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(v){var g=new c.BufferGeometry,w=v.geometry;if(v.isPoints||v.isLine){var S=new c.Float32BufferAttribute(3*w.vertices.length,3),T=new c.Float32BufferAttribute(3*w.colors.length,3);if(g.setAttribute("position",S.copyVector3sArray(w.vertices)),g.setAttribute("color",T.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 v.isMesh&&(g=w.toBufferGeometry());return g};class h{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,S,T=[],M=void 0,_=g.faces;for(S=0;S<_.length;S++){var C=_[S];C.materialIndex!==M&&(M=C.materialIndex,w!==void 0&&(w.count=3*S-w.start,T.push(w)),w={start:3*S,materialIndex:M})}w!==void 0&&(w.count=3*S-w.start,T.push(w)),this.groups=T}fromGeometry(g){var w,S=g.faces,T=g.vertices,M=g.faceVertexUvs,_=M[0]&&0<M[0].length,C=M[1]&&0<M[1].length,I=g.morphTargets,E=I.length;if(0<E){w=[];for(var P=0;P<E;P++)w[P]={name:I[P].name,data:[]};this.morphTargets.position=w}var A,R=g.morphNormals,L=R.length;if(0<L){A=[];for(var N=0;N<L;N++)A[N]={name:R[N].name,data:[]};this.morphTargets.normal=A}var x=g.skinIndices,O=g.skinWeights,B=x.length===T.length,F=O.length===T.length;0<T.length&&S.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var V,k=0;k<S.length;k++){V=S[k],this.vertices.push(T[V.a],T[V.b],T[V.c]);var G=V.vertexNormals;if(G.length===3)this.normals.push(G[0],G[1],G[2]);else{var J=V.normal;this.normals.push(J,J,J)}var ne=V.vertexColors;if(ne.length===3)this.colors.push(ne[0],ne[1],ne[2]);else{var ae=V.color;this.colors.push(ae,ae,ae)}if(_===!0){var ie=M[0][k];ie===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",k),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(ie[0],ie[1],ie[2])}if(C===!0){var oe=M[1][k];oe===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",k),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(oe[0],oe[1],oe[2])}for(var W,X=0;X<E;X++)W=I[X].vertices,w[X].data.push(W[V.a],W[V.b],W[V.c]);for(var j,re=0;re<L;re++)j=R[re].vertexNormals[k],A[re].data.push(j.a,j.b,j.c);B&&this.skinIndices.push(x[V.a],x[V.b],x[V.c]),F&&this.skinWeights.push(O[V.a],O[V.b],O[V.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,S,T,M){var _=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=w,this.c=S,this.normal=T&&T.isVector3?T:new c.Vector3,this.vertexNormals=Array.isArray(T)?T:[],this.color=M&&M.isColor?M:new c.Color,this.vertexColors=Array.isArray(M)?M:[],this.materialIndex=_}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,S=g.vertexNormals.length;w<S;w++)this.vertexNormals[w]=g.vertexNormals[w].clone();for(var T=0,M=g.vertexColors.length;T<M;T++)this.vertexColors[T]=g.vertexColors[T].clone();return this}}},o=>{o.exports=EB},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
|
+
`}),y=y+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+p.main.map(function(g){return""+JSON.stringify(g)+": "+d.main[g].toString()}).join(",")+"}))(self);";var m=new window.Blob([y],{type:"text/javascript"});if(f.bare)return m;var h=window.URL||window.webkitURL||window.mozURL||window.msURL,b=h.createObjectURL(m),v=new window.Worker(b);return v.objectURL=b,v}}(Cf)),Cf.exports}function JB(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 KB(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(d){o(u,d)},function(d){r[u]={status:"rejected",reason:d},--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 bx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}bx.prototype=Error.prototype;function qB(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 bx(s,"All promises were rejected"))})}catch(l){i(l)}})}var QB=setTimeout;function xx(n){return!!(n&&typeof n.length<"u")}function eF(){}function tF(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 wx(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?Af:Ga)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Ga(e.promise,r);return}Af(e.promise,i)})}function Af(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,Rf(n);return}else if(typeof t=="function"){Mx(tF(t,e),n);return}}n._state=1,n._value=e,Rf(n)}catch(i){Ga(n,i)}}function Ga(n,e){n._state=2,n._value=e,Rf(n)}function Rf(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++)wx(n,n._deferreds[e]);n._deferreds=null}function nF(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,Af(e,i))},function(i){t||(t=!0,Ga(e,i))})}catch(i){if(t)return;t=!0,Ga(e,i)}}pt.prototype.catch=function(n){return this.then(null,n)},pt.prototype.then=function(n,e){var t=new this.constructor(eF);return wx(this,new nF(n,e,t)),t},pt.prototype.finally=JB,pt.all=function(n){return new pt(function(e,t){if(!xx(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=qB,pt.allSettled=KB,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(!xx(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){QB(n,0)},pt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const iF=Rl(Object.freeze(Object.defineProperty({__proto__:null,default:pt},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(Ki,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,d=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(50).GeometryCSG,this.GlyphsetCSG=u(56).GlyphsetCSG,this.Viewport=u(43).Viewport,this.CameraControls=u(43).CameraControls,this.SmoothCameraTransition=u(43).SmoothCameraTransition,this.RayCaster=u(43).RayCaster,this.CameraAutoTumble=u(43).CameraAutoTumble,this.StereoEffect=u(43).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new d},o=>{o.exports=JR()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.13.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,d=(y,m,h)=>{var b=f(y,h),v=!1;1>h.opacity&&(v=!0);var g;if(b._video===void 0){var w=h.localTimeEnabled||h.localMorphColour;m?(g=m,g.morphTargets=w,g.morphNormals=h.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:h.colour,morphTargets:w,morphNormals:h.localTimeEnabled,transparent:v,opacity:h.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:h.colour,morphTargets:w,morphNormals:h.localTimeEnabled,vertexColors:c.VertexColors,transparent:v,opacity:h.opacity,side:c.DoubleSide}),h.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var S=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:h.localTimeEnabled,color:new c.Color(1,1,1),transparent:v,opacity:h.opacity,map:S,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=(y,m,h)=>{if(!(this.morph&&this.morph.geometry&&y!=null)){var b=d(y,m,h);this.setMesh(b,h.localTimeEnabled,h.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var y=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,h=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(y.x-m.x,y.y-m.y);this.geometry.faceVertexUvs[0]=[];for(var v=0;v<this.geometry.faces.length;v++){var g=this.geometry.vertices[this.geometry.faces[v].a],w=this.geometry.vertices[this.geometry.faces[v].b],S=this.geometry.vertices[this.geometry.faces[v].c];geometry.faceVertexUvs[0].push([new c.Vector2((g.x+h.x)/b.x,(g.y+h.y)/b.y),new c.Vector2((w.x+h.x)/b.x,(w.y+h.y)/b.y),new c.Vector2((S.x+h.x)/b.x,(S.y+h.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=y=>{this.morph.material.wireframe=y},this.editVertices=function(y,m){if(y&&y.length){var h=this.getMorph(),b=h.geometry.getAttribute("position");if(!h||0>m)return;var v=3*m;y.forEach(g=>{b.array[v++]=g[0],b.array[v++]=g[1],b.array[v++]=g[2]}),b.needsUpdate=!0,h.geometry.computeBoundingBox(),h.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=cB},(o,l,u)=>{function c(C){throw new TypeError('"'+C+'" is read-only')}var f=u(4),d=u(6).Geometry,p=u(7).default;function y(C){var I=C,E=u(0).modelPrefix;return E&&(E[E.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(C)||(I=E+C)),I}function m(C,I){var E=(A,R)=>{try{var L=new URL(A,R).href;if(A&&2>A.split("?").length){var N=R.split("?");N.length===2&&(L=L+"?"+N[1])}return L}catch{console.error("There is an issue creating the url link with: ".concat(A,"."))}};if(!Array.isArray(C))return E(C,I);var P=[];return C.forEach(A=>{P.push(E(A,I))}),P}function h(C,I,E,P,A){var R=C.morphTargetInfluences,L=void 0;C.geometry&&(L=C.geometry.morphAttributes);var N=!1;if(R&&L&&L.position){P.set(0,0,0),A.set(0,0,0);for(var x=0;x<R.length;x++)0<R[x]&&(N=!0,E.setFromArray(L.position[x].array),P.add(E.min.multiplyScalar(R[x])),A.add(E.max.multiplyScalar(R[x])));N&&I.set(P,A)}N||I.setFromBufferAttribute(C.geometry.attributes.position),C.updateWorldMatrix(!0,!0),I.applyMatrix4(C.matrixWorld)}function b(C,I,E,P){var A=new XMLHttpRequest;A.open("GET",y(C),!0),A.onreadystatechange=()=>{A.readyState==4&&(A.status==200?E(A.responseText,I):P(C))},A.send(null)}function v(C,I,E){function P(x,O){L[O]=x,R++,R==A&&I(L)}for(var A=C.length,R=0,L=[],N=0;N<A;N++)b(C[N],N,P,E)}l.getColorsRGB=(C,I)=>{var E=Math.floor(I/3),P=I%3,A=0;P==0?A=C[E].r:P==1?A=C[E].g:P==2&&(A=C[E].b);var R=new f.Color(A);return[R.r,R.g,R.b]},l.updateMorphColorAttribute=function(C,I){if(I&&C&&C.morphAttributes&&C.morphAttributes.color){var E=C.morphAttributes.color,P=I.morphTargetInfluences,A=P.length;C.deleteAttribute("morphColor0"),C.deleteAttribute("morphColor1");for(var R=0,L=[],N=0;1>R||N<A;N++)0<P[N]&&(R++,L.push([N,P[N]]));L.length==2?(C.setAttribute("morphColor0",E[L[0][0]]),C.setAttribute("morphColor1",E[L[1][0]])):L.length==1&&(C.setAttribute("morphColor0",E[L[0][0]]),C.setAttribute("morphColor1",E[L[0][0]]))}},l.toBufferGeometry=(C,I)=>{var E;return C instanceof d?(I.localTimeEnabled&&!C.morphNormalsReady&&(C.morphNormals==null||C.morphNormals.length==0)&&C.computeMorphNormals(),E=C.toIndexedBufferGeometry(),I.localMorphColour&&g(C,E)):C instanceof f.BufferGeometry&&(E=C.clone()),E.colorsNeedUpdate=!0,E.computeBoundingBox(),E.computeBoundingSphere(),C._video&&(E._video=C._video),E},l.copyMorphColorsToBufferGeometry=(C,I)=>{if(C&&C.morphColors&&0<C.morphColors.length){for(var E=[],P=C.morphColors,A=u(5).getColorsRGB,R=0,L=P.length;R<L;R++){for(var N=P[R],x=[],O=0;O<C.faces.length;O++){var B=C.faces[O],F=A(N.colors,B.a);x.push(F[0],F[1],F[2]),F=A(N.colors,B.b),x.push(F[0],F[1],F[2]),F=A(N.colors,B.c),x.push(F[0],F[1],F[2])}var V=new f.Float32BufferAttribute(3*(3*C.faces.length),3);V.name=N.name,E.push(V.copyArray(x))}I.morphAttributes.color=E}};var g=(C,I)=>{if(C&&C.morphColors&&0<C.morphColors.length){for(var E=[],P=C.morphColors,A=u(5).getColorsRGB,R=0,L=P.length;R<L;R++){for(var N,x=P[R],O=[],B=0;B<3*x.colors.length;B++)N=A(x.colors,B),O.push(N[0],N[1],N[2]);var F=new f.Float32BufferAttribute(O,3);F.name=x.name,E.push(F)}I.morphAttributes.color=E}};l.mergeVertices=function(C){var I=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;I=Math.max(I,Number.EPSILON);for(var E,P={},A=C.getIndex(),R=C.getAttribute("position"),L=A?A.count:R.count,N=0,x=Object.keys(C.attributes),O={},B={},ce=[],F=["getX","getY","getZ","getW"],V=0,k=x.length;V<k;V++){E=x[V],O[E]=[];var G=C.morphAttributes[E];G&&(B[E]=Array(G.length).fill().map(()=>[]))}for(var J=Math.log10(1/I),ne=Math.pow(10,J),V=0;V<L;V++){for(var ae=A?A.getX(V):V,ie="",oe=0,k=x.length;oe<k;oe++)for(var E=x[oe],W=C.getAttribute(E),X=W.itemSize,j=0;j<X;j++)ie+="".concat(~~(W[F[j]](ae)*ne),",");if(ie in P)ce.push(P[ie]);else{for(var oe=0,k=x.length;oe<k;oe++)for(var re,E=x[oe],W=C.getAttribute(E),G=C.morphAttributes[E],X=W.itemSize,z=O[E],H=B[E],j=0;j<X;j++)if(re=F[j],z.push(W[re](ae)),G)for(var K=0,le=G.length;K<le;K++)H[K].push(G[K][re](ae));P[ie]=N,ce.push(N),N++}}for(var se=C.clone(),V=0,k=x.length;V<k;V++){var W,E=x[V],U=C.getAttribute(E),D=new U.array.constructor(O[E]);if(U.isInterleavedBufferAttribute?W=new f.BufferAttribute(D,U.itemSize,U.itemSize):(W=C.getAttribute(E).clone(),W.setArray(D)),se.setAttribute(E,W),E in B)for(var $,oe=0;oe<B[E].length;oe++)$=C.morphAttributes[E][oe].clone(),$.setArray(new $.array.constructor(B[E][oe])),se.morphAttributes[E][oe]=$}var Y=Uint8Array;ce.length>=Math.pow(2,8)&&(Y=Uint16Array),ce.length>=Math.pow(2,16)&&(Y=Uint32Array);var ee=new Y(ce),ce=null;return A===null?ce=new f.BufferAttribute(ee,1):(ce=C.getIndex().clone(),ce.setArray(ee)),se.setIndex(ce),se};function w(C){if(C.isMeshPhongMaterial){var I=new f.MeshToonMaterial({color:C.color.clone(),morphTargets:C.morphTargets,morphNormals:C.morphNormals,vertexColors:C.vertexColors,transparent:C.transparent,opacity:C.opacity,side:C.side});return C.map&&(I.map=C.map),I}return C}function S(C,I){if(I&&C>=I.length){var E=new f.BufferGeometry,P=new Float32Array(3*C),A=0;return I.forEach(R=>{P[A++]=R[0],P[A++]=R[1],P[A++]=R[2]}),E.setAttribute("position",new f.BufferAttribute(P,3)),E.setDrawRange(0,I.length),E}}function T(){var C=new Image;C.src=u(8);var I=new f.Texture;return I.image=C,I.needsUpdate=!0,I}function M(C,I,E,P,A,R){var L=new p(C,I,E,P,A,R);return L.fontFace=P,L.fontSize=A,L.fontWeight=R,L.material.map.generateMipmaps=!1,L.material.map.anisotropy=4,L.material.sizeAttenuation=!1,L.material.alphaTest=.5,L.material.transparent=!0,L.material.depthWrite=!1,L.material.depthTest=!1,L.center.set(.5,-1.2),L.renderOrder=1e4,L}function _(C,I,E){if(E){var P=C||"",A=I||"",R=E.lastIndexOf("/");if(-1<R){var L=void 0,N=void 0;if(L=E.substring(0,R),N=E.substring(R+1),(L==="*"||L==="**"||L.toLowerCase()===P.toLowerCase())&&(N==="*"||N==="**"||N.toLowerCase()===A.toLowerCase()))return!0}else if(P.toLowerCase()===E.toLowerCase()||A.toLowerCase()===E.toLowerCase())return!0}return!1}l.getBoundingBox=h,l.createNewURL=m,l.createBufferGeometry=S,l.getCircularTexture=T,l.resolveURL=y,l.loadExternalFile=b,l.loadExternalFiles=v,l.PhongToToon=w,l.createNewSpriteText=M,l.isRegionGroup=_},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,d=new c.Object3D,p=new c.Vector3,y=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,S=new c.Matrix3().getNormalMatrix(g),T=0,M=this.vertices.length;T<M;T++)w=this.vertices[T],w.applyMatrix4(g);for(var _,C=0,I=this.faces.length;C<I;C++){_=this.faces[C],_.normal.applyMatrix3(S).normalize();for(var E=0,P=_.vertexNormals.length;E<P;E++)_.vertexNormals[E].applyMatrix3(S).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,S){return f.makeTranslation(g,w,S),this.applyMatrix4(f),this},scale:function(g,w,S){return f.makeScale(g,w,S),this.applyMatrix4(f),this},lookAt:function(g){return d.lookAt(g),d.updateMatrix(),this.applyMatrix4(d.matrix),this},fromBufferGeometry:function(g){function w(G,J,ne,ae){var ie=I===void 0?[]:[S.colors[G].clone(),S.colors[J].clone(),S.colors[ne].clone()],oe=C===void 0?[]:[new c.Vector3().fromBufferAttribute(C,G),new c.Vector3().fromBufferAttribute(C,J),new c.Vector3().fromBufferAttribute(C,ne)],W=new b(G,J,ne,oe,ie,ae);S.faces.push(W),E!==void 0&&S.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(E,G),new c.Vector2().fromBufferAttribute(E,J),new c.Vector2().fromBufferAttribute(E,ne)]),P!==void 0&&S.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(P,G),new c.Vector2().fromBufferAttribute(P,J),new c.Vector2().fromBufferAttribute(P,ne)])}var S=this,T=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 _=M.position,C=M.normal,I=M.color,E=M.uv,P=M.uv2;P!==void 0&&(this.faceVertexUvs[1]=[]);for(var A=0;A<_.count;A++)S.vertices.push(new c.Vector3().fromBufferAttribute(_,A)),I!==void 0&&S.colors.push(new c.Color().fromBufferAttribute(I,A));var R=g.groups;if(0<R.length)for(var L=0;L<R.length;L++)for(var N=R[L],x=N.start,O=N.count,B=x,F=x+O;B<F;B+=3)T===void 0?w(B,B+1,B+2,N.materialIndex):w(T.getX(B),T.getX(B+1),T.getX(B+2),N.materialIndex);else if(T!==void 0)for(var V=0;V<T.count;V+=3)w(T.getX(V),T.getX(V+1),T.getX(V+2));else for(var k=0;k<_.count;k+=3)w(k,k+1,k+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,S=w===0?1:1/w,T=new c.Matrix4;return T.set(S,0,0,-S*g.x,0,S,0,-S*g.y,0,0,S,-S*g.z,0,0,0,1),this.applyMatrix4(T),this},computeFaceNormals:function(){for(var g=new c.Vector3,w=new c.Vector3,S=0,T=this.faces.length;S<T;S++){var M=this.faces[S],_=this.vertices[M.a],C=this.vertices[M.b],I=this.vertices[M.c];g.subVectors(I,C),w.subVectors(_,C),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),S=0,T=this.vertices.length;S<T;S++)w[S]=new c.Vector3;if(g)for(var M=new c.Vector3,_=new c.Vector3,C=0,I=this.faces.length;C<I;C++){var E=this.faces[C],P=this.vertices[E.a],A=this.vertices[E.b],R=this.vertices[E.c];M.subVectors(R,A),_.subVectors(P,A),M.cross(_),w[E.a].add(M),w[E.b].add(M),w[E.c].add(M)}else{this.computeFaceNormals();for(var L,N=0,x=this.faces.length;N<x;N++)L=this.faces[N],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 F=0,V=this.faces.length;F<V;F++){var k=this.faces[F],G=k.vertexNormals;G.length===3?(G[0].copy(w[k.a]),G[1].copy(w[k.b]),G[2].copy(w[k.c])):(G[0]=w[k.a].clone(),G[1]=w[k.b].clone(),G[2]=w[k.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 S=this.faces[g],T=S.vertexNormals;T.length===3?(T[0].copy(S.normal),T[1].copy(S.normal),T[2].copy(S.normal)):(T[0]=S.normal.clone(),T[1]=S.normal.clone(),T[2]=S.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,w=0,S=this.faces.length;w<S;w++){g=this.faces[w],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var T=0,M=g.vertexNormals.length;T<M;T++)g.__originalVertexNormals[T]?g.__originalVertexNormals[T].copy(g.vertexNormals[T]):g.__originalVertexNormals[T]=g.vertexNormals[T].clone()}var _=new m;_.faces=this.faces;for(var C=0,I=this.morphTargets.length;C<I;C++){if(!this.morphNormals[C]){this.morphNormals[C]={},this.morphNormals[C].faceNormals=[],this.morphNormals[C].vertexNormals=[];for(var E=this.morphNormals[C].faceNormals,P=this.morphNormals[C].vertexNormals,A=0,R=this.faces.length;A<R;A++){var L=new c.Vector3,N={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};E.push(L),P.push(N)}}var x=this.morphNormals[C];_.vertices=this.morphTargets[C].vertices,_.computeFaceNormals();var O=_.computeVertexNormals();if(O&&0<O.length){this.morphTargets[C].normals=Array(this.vertices.length);for(var B=0;B<O.length;B++)this.morphTargets[C].normals[B]=O[B].clone()}for(var F=0,V=this.faces.length;F<V;F++){var k=this.faces[F],G=x.faceNormals[F],J=x.vertexNormals[F];G.copy(k.normal),J.a.copy(k.vertexNormals[0]),J.b.copy(k.vertexNormals[1]),J.c.copy(k.vertexNormals[2])}}for(var ne,ae=0,ie=this.faces.length;ae<ie;ae++)ne=this.faces[ae],ne.normal=ne.__originalFaceNormal,ne.vertexNormals=ne.__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 S=this.morphTargets.length,T=this.morphTargets,M=g.morphTargets,_=this.morphColors.length,C=this.morphColors,I=g.morphColors;if(0<S&&S==M.length)for(var E=0,P=T.length;E<P;E++){for(var A=T[E],R=M[E],L=0,N=R.vertices.length;L<N;L++){var x=R.vertices[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),A.vertices.push(O)}if(A.normals&&R.normals)for(var B=0;B<R.normals.length;B+=3)y.set(R.normals2[B],R.normals2[B+1],R.normals2[B+2]),w!==void 0&&y.applyMatrix4(w),A.normals.push(y.x,y.y,y.z)}if(0<_&&_==I.length)for(var F=0,V=C.length;F<V;F++)for(var k=C[F],G=I[F],J=0,ne=G.colors;J<ne;J++)k.colors.push(G.colors[J].clone())},merge:function(g,w){var S=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 T,M=this.vertices.length,_=this.vertices,C=g.vertices,I=g.normals,E=this.faces,P=g.faces,A=this.colors,R=g.colors;w!==void 0&&(T=new c.Matrix3().getNormalMatrix(w));for(var L=0,N=C.length;L<N;L++){var x=C[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),_.push(O)}for(var B=0;B<I.length;B+=3)y.set(I[B],I[B+1],I[B+2]),w!==void 0&&y.applyMatrix4(w),this.normals.push(y.x,y.y,y.z);for(var F=0,V=R.length;F<V;F++)typeof R[F]=="number"?A.push(R[F]):A.push(R[F].clone());for(var k=0,G=P.length;k<G;k++){var J=P[k],ne=void 0,ae=void 0,ie=J.vertexNormals,oe=J.vertexColors,W=new b(J.a+M,J.b+M,J.c+M);W.normal.copy(J.normal),T!==void 0&&W.normal.applyMatrix3(T).normalize();for(var X=0,j=ie.length;X<j;X++)ne=ie[X].clone(),T!==void 0&&ne.applyMatrix3(T).normalize(),W.vertexNormals.push(ne);W.color.copy(J.color);for(var re=0,z=oe.length;re<z;re++)ae=oe[re],W.vertexColors.push(ae.clone());W.materialIndex=J.materialIndex+S,E.push(W)}for(var H,K=0,le=g.faceVertexUvs.length;K<le;K++){H=g.faceVertexUvs[K],this.faceVertexUvs[K]===void 0&&(this.faceVertexUvs[K]=[]);for(var se=0,U=H.length;se<U;se++){for(var D=H[se],$=[],Y=0,ee=D.length;Y<ee;Y++)$.push(D[Y].clone());this.faceVertexUvs[K].push($)}}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={},S=[],T=[],M=Math.pow(10,g),_=0,C=this.vertices.length;_<C;_++){var I=this.vertices[_],E=Math.round(I.x*M)+"_"+Math.round(I.y*M)+"_"+Math.round(I.z*M);w[E]===void 0?(w[E]=_,S.push(this.vertices[_]),T[_]=S.length-1):T[_]=T[w[E]]}for(var P,A=[],R=0,L=this.faces.length;R<L;R++){P=this.faces[R],P.a=T[P.a],P.b=T[P.b],P.c=T[P.c];for(var N=[P.a,P.b,P.c],x=0;3>x;x++)if(N[x]===N[(x+1)%3]){A.push(R);break}}for(var O,B=A.length-1;0<=B;B--){O=A[B],this.faces.splice(O,1);for(var F=0,V=this.faceVertexUvs.length;F<V;F++)this.faceVertexUvs[F].splice(O,1)}var k=this.vertices.length-S.length;return this.vertices=S,k},setFromPoints:function(g){this.vertices=[];for(var w,S=0,T=g.length;S<T;S++)w=g[S],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,S=0;S<w;S++)g[S]._id=S;g.sort(function(P,A){return P.materialIndex-A.materialIndex});var T,M,_=this.faceVertexUvs[0],C=this.faceVertexUvs[1];_&&_.length===w&&(T=[]),C&&C.length===w&&(M=[]);for(var I,E=0;E<w;E++)I=g[E]._id,T&&T.push(_[I]),M&&M.push(C[I]);T&&(this.faceVertexUvs[0]=T),M&&(this.faceVertexUvs[1]=M)},toJSON:function(){function g(z,H,K){return K?z|1<<H:z&~(1<<H)}function w(z){var H=z.x.toString()+z.y.toString()+z.z.toString();return L[H]===void 0&&(L[H]=R.length/3,R.push(z.x,z.y,z.z)),L[H]}function S(z){var H=z.r.toString()+z.g.toString()+z.b.toString();return x[H]===void 0&&(x[H]=N.length,N.push(z.getHex())),x[H]}function T(z){var H=z.x.toString()+z.y.toString();return B[H]===void 0&&(B[H]=O.length/2,O.push(z.x,z.y)),B[H]}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 _=this.parameters;for(var C in _)_[C]!==void 0&&(M[C]=_[C]);return M}for(var I,E=[],P=0;P<this.vertices.length;P++)I=this.vertices[P],E.push(I.x,I.y,I.z);for(var A=[],R=[],L={},N=[],x={},O=[],B={},F=0;F<this.faces.length;F++){var V=this.faces[F],k=!0,G=!1,J=this.faceVertexUvs[0][F]!==void 0,ne=0<V.normal.length(),ae=0<V.vertexNormals.length,ie=V.color.r!==1||V.color.g!==1||V.color.b!==1,oe=0<V.vertexColors.length,W=0;if(W=g(W,0,0),W=g(W,1,k),W=g(W,2,G),W=g(W,3,J),W=g(W,4,ne),W=g(W,5,ae),W=g(W,6,ie),W=g(W,7,oe),A.push(W),A.push(V.a,V.b,V.c),A.push(V.materialIndex),J){var X=this.faceVertexUvs[0][F];A.push(T(X[0]),T(X[1]),T(X[2]))}if(ne&&A.push(w(V.normal)),ae){var j=V.vertexNormals;A.push(w(j[0]),w(j[1]),w(j[2]))}if(ie&&A.push(S(V.color)),oe){var re=V.vertexColors;A.push(S(re[0]),S(re[1]),S(re[2]))}}return M.data={},M.data.vertices=E,M.data.normals=R,0<N.length&&(M.data.colors=N),0<O.length&&(M.data.uvs=[O]),M.data.faces=A,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,S=0,T=w.length;S<T;S++)this.vertices.push(w[S].clone());for(var M=g.colors,_=0,C=M.length;_<C;_++)this.colors.push(M[_].clone());for(var I=g.faces,E=0,P=I.length;E<P;E++)this.faces.push(I[E].clone());for(var A,R=0,L=g.faceVertexUvs.length;R<L;R++){A=g.faceVertexUvs[R],this.faceVertexUvs[R]===void 0&&(this.faceVertexUvs[R]=[]);for(var N=0,x=A.length;N<x;N++){for(var O,B=A[N],F=[],V=0,k=B.length;V<k;V++)O=B[V],F.push(O.clone());this.faceVertexUvs[R].push(F)}}for(var G,J=g.morphTargets,ne=0,ae=J.length;ne<ae;ne++){if(G={},G.name=J[ne].name,J[ne].vertices!==void 0){G.vertices=[];for(var ie=0,oe=J[ne].vertices.length;ie<oe;ie++)G.vertices.push(J[ne].vertices[ie].clone())}if(J[ne].normals!==void 0){G.normals=[];for(var W=0,X=J[ne].normals.length;W<X;W++)G.normals.push(J[ne].normals[W].clone())}this.morphTargets.push(G)}for(var j,re=g.morphNormals,z=0,H=re.length;z<H;z++){if(j={},re[z].vertexNormals!==void 0){j.vertexNormals=[];for(var K=0,le=re[z].vertexNormals.length;K<le;K++){var se=re[z].vertexNormals[K],U={};U.a=se.a.clone(),U.b=se.b.clone(),U.c=se.c.clone(),j.vertexNormals.push(U)}}if(re[z].faceNormals!==void 0){j.faceNormals=[];for(var D=0,$=re[z].faceNormals.length;D<$;D++)j.faceNormals.push(re[z].faceNormals[D].clone())}this.morphNormals.push(j)}for(var Y=g.skinWeights,ee=0,ce=Y.length;ee<ce;ee++)this.skinWeights.push(Y[ee].clone());for(var ve=g.skinIndices,be=0,ue=ve.length;be<ue;be++)this.skinIndices.push(ve[be].clone());for(var me=g.lineDistances,te=0,he=me.length;te<he;te++)this.lineDistances.push(me[te]);var ge=g.boundingBox;ge!==null&&(this.boundingBox=ge.clone());var Ce=g.boundingSphere;return Ce!==null&&(this.boundingSphere=Ce.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 v,g,w=[],S=void 0,T=this.faces;for(g=0;g<T.length;g++){var M=T[g];M.materialIndex!==S&&(S=M.materialIndex,v!==void 0&&(v.count=3*g-v.start,w.push(v)),v={start:3*g,materialIndex:S})}return v!==void 0&&(v.count=3*g-v.start,w.push(v)),w},toBufferGeometry:function(){var g=new h().fromGeometry(this),w=new c.BufferGeometry,S=new Float32Array(3*g.vertices.length);if(w.setAttribute("position",new c.BufferAttribute(S,3).copyVector3sArray(g.vertices)),0<g.normals.length){var T=new Float32Array(3*g.normals.length);w.setAttribute("normal",new c.BufferAttribute(T,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 _=new Float32Array(2*g.uvs.length);w.setAttribute("uv",new c.BufferAttribute(_,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var C=new Float32Array(2*g.uvs2.length);w.setAttribute("uv2",new c.BufferAttribute(C,2).copyVector2sArray(g.uvs2))}for(var I in w.groups=g.groups,g.morphTargets){for(var E=[],P=g.morphTargets[I],A=0,R=P.length;A<R;A++){var L=P[A],N=new c.Float32BufferAttribute(3*L.data.length,3);N.name=L.name,E.push(N.copyVector3sArray(L.data))}w.morphAttributes[I]=E}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 S=new Float32Array(this.normals.length),T=new c.BufferAttribute(S,3).copyArray(this.normals);g.setAttribute("normal",T)}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 _=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(_,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var C=[],I=0;I<this.colors.length;I++)C.push(new c.Color(this.colors[I]));var E=new Float32Array(3*C.length);g.setAttribute("color",new c.BufferAttribute(E,3).copyColorsArray(C))}else{for(var P=new Float32Array(3*this.vertices.length),A=0;A<3*this.vertices.length;A++)P[A]=1;g.setAttribute("color",new c.BufferAttribute(P,3))}if(0<this.faces.length){for(var R=[],L=[],N=0;N<this.faces.length;N++){L.push(this.faces[N].a,this.faces[N].b,this.faces[N].c);var x=this.faces[N].vertexColors;if(x.length===3)R.push(x[0],x[1],x[2]);else{var O=this.faces[N].color;R.push(O,O,O)}}g.setIndex(L),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],F=[],V=0,k=this.morphTargets.length;V<k;V++){var G=this.morphTargets[V],J=new c.Float32BufferAttribute(3*G.vertices.length,3);if(J.name=G.name,B.push(J.copyVector3sArray(G.vertices)),G.normals){var ne=new c.Float32BufferAttribute(3*G.normals.length,3);ne.name=G.name,F.push(ne.copyVector3sArray(G.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=F}if(0<this.skinIndices.length){var ae=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",ae.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var ie=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",ie.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(v){var g=new c.BufferGeometry,w=v.geometry;if(v.isPoints||v.isLine){var S=new c.Float32BufferAttribute(3*w.vertices.length,3),T=new c.Float32BufferAttribute(3*w.colors.length,3);if(g.setAttribute("position",S.copyVector3sArray(w.vertices)),g.setAttribute("color",T.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 v.isMesh&&(g=w.toBufferGeometry());return g};class h{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,S,T=[],M=void 0,_=g.faces;for(S=0;S<_.length;S++){var C=_[S];C.materialIndex!==M&&(M=C.materialIndex,w!==void 0&&(w.count=3*S-w.start,T.push(w)),w={start:3*S,materialIndex:M})}w!==void 0&&(w.count=3*S-w.start,T.push(w)),this.groups=T}fromGeometry(g){var w,S=g.faces,T=g.vertices,M=g.faceVertexUvs,_=M[0]&&0<M[0].length,C=M[1]&&0<M[1].length,I=g.morphTargets,E=I.length;if(0<E){w=[];for(var P=0;P<E;P++)w[P]={name:I[P].name,data:[]};this.morphTargets.position=w}var A,R=g.morphNormals,L=R.length;if(0<L){A=[];for(var N=0;N<L;N++)A[N]={name:R[N].name,data:[]};this.morphTargets.normal=A}var x=g.skinIndices,O=g.skinWeights,B=x.length===T.length,F=O.length===T.length;0<T.length&&S.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var V,k=0;k<S.length;k++){V=S[k],this.vertices.push(T[V.a],T[V.b],T[V.c]);var G=V.vertexNormals;if(G.length===3)this.normals.push(G[0],G[1],G[2]);else{var J=V.normal;this.normals.push(J,J,J)}var ne=V.vertexColors;if(ne.length===3)this.colors.push(ne[0],ne[1],ne[2]);else{var ae=V.color;this.colors.push(ae,ae,ae)}if(_===!0){var ie=M[0][k];ie===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",k),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(ie[0],ie[1],ie[2])}if(C===!0){var oe=M[1][k];oe===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",k),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(oe[0],oe[1],oe[2])}for(var W,X=0;X<E;X++)W=I[X].vertices,w[X].data.push(W[V.a],W[V.b],W[V.c]);for(var j,re=0;re<L;re++)j=R[re].vertexNormals[k],A[re].data.push(j.a,j.b,j.c);B&&this.skinIndices.push(x[V.a],x[V.b],x[V.c]),F&&this.skinWeights.push(O[V.a],O[V.b],O[V.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,S,T,M){var _=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=w,this.c=S,this.normal=T&&T.isVector3?T:new c.Vector3,this.vertexNormals=Array.isArray(T)?T:[],this.color=M&&M.isColor?M:new c.Color,this.vertexColors=Array.isArray(M)?M:[],this.materialIndex=_}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,S=g.vertexNormals.length;w<S;w++)this.vertexNormals[w]=g.vertexNormals[w].clone();for(var T=0,M=g.vertexColors.length;T<M;T++)this.vertexColors[T]=g.vertexColors[T].clone();return this}}},o=>{o.exports=EB},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
3184
|
`))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,d=u(5).resolveURL,p=0,y=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=y(),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};m.prototype.setDuration=function(h){this.duration=h,this.clipAction&&this.clipAction.setDuration(this.duration)},m.prototype.getDuration=function(){return this.duration},m.prototype.setRegion=function(h){this.region=h},m.prototype.getRegion=function(){return this.region},m.prototype.getMorph=function(){var h=this._lod.getCurrentMorph();return h||this.morph},m.prototype.getGroup=function(){return this.group},m.prototype.setMorph=function(h){this.morph=h,this.group.add(this.morph);var b=this._lod.calculateDistance("far");this._lod.addLevel(h,b),this._lod.setMaterial(h.material)},m.prototype.checkTransparentMesh=function(){},m.prototype.setMesh=function(h,b,v){this.animationGroup=new c.AnimationObjectGroup(h),this.mixer=new c.AnimationMixer(this.animationGroup);var g=h.geometry;if(this.geometry=h.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=v,h.userData=this,h.matrixAutoUpdate=!1,this.setMorph(h),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.setName=function(h){this.groupName=h,this._lod.setName(h)},m.prototype.getCurrentTime=function(){if(this.clipAction){var h=this.clipAction.time/this.clipAction._clip.duration;return this.duration*h}return this.inbuildTime},m.prototype.setMorphTime=function(h){var b=!1;if(this.clipAction){var v=h/this.duration,g=this.clipAction._clip.duration,w=v*g;w!=this.clipAction.time&&(this.clipAction.time=w,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var S=h;S=h>this.duration?this.duration:0>h?0:h,S!=this.inbuildTime&&(this.inbuildTime=S,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(h){h!==this.visible&&(this.visible=h,this.group.visible=h,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAlpha=function(h){var b=this._lod._material,v=!1;1>h&&(v=!0),b.opacity=h,b.transparent=v,this.checkTransparentMesh()},m.prototype.setFrustumCulled=function(h){this._lod.setFrustumCulled(h)},m.prototype.setVertexColors=function(h){this._lod.setVertexColors(h)},m.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},m.prototype.setColour=function(h){this._lod.setColour(h)},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(h){this._lod._material.color.setHex(h),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(h)},m.prototype.setEmissiveRGB=function(h){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...h),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...h)},m.prototype.setMaterial=function(h){this._lod.setMaterial(h)},m.prototype.getClosestVertexIndex=function(){var h=-1,b=this.getMorph();if(b&&b.geoemtry){var v=b.geometry.attributes.position;if(this._b1.setFromBufferAttribute(v),this._b1.getCenter(this._v1),v)for(var g=-1,w=0,S=0;S<v.count;S++)this._v2.fromArray(v.array,3*S),w=this._v2.distanceTo(this._v1),g==-1?g=w:g>w&&(g=w,h=S)}return h},m.prototype.getClosestVertex=function(h){var b=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var v=this.getMorph();if(v&&v.geometry&&0<=this.closestVertexIndex){var g=v.morphTargetInfluences,w=v.geometry.morphAttributes;if(g&&w&&w.position){for(var S=!1,T=0;T<g.length;T++)0<g[T]&&(S=!0,this._v1.fromArray(w.position[T].array,3*this.closestVertexIndex),b.add(this._v1.multiplyScalar(g[T])));if(S)return h?b.applyMatrix4(v.matrixWorld):b}else return b.fromArray(v.geometry.attributes.position.array,3*this.closestVertexIndex),h?b.applyMatrix4(v.matrixWorld):b}return this.getBoundingBox(),b.copy(this.center),h?b.applyMatrix4(this.morph.matrixWorld):b},m.prototype.getBoundingBox=function(){if(this.visible){var h=this._lod.getCurrentMorph();if(h&&h.visible)return this.boundingBoxUpdateRequired&&(u(5).getBoundingBox(h,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(h){return!!(this.visible&&(this.markerMode==="on"||h&&h.displayMarkers&&this.markerMode==="inherited"))},m.prototype.updateMarker=function(h,b){if(h==!1&&this.markerIsRequired(b)){var v=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)&&(v=!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&&(v||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(h,b){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(h,b)},m.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},m.prototype.setRenderOrder=function(h){this._lod.setRenderOrder(h)},m.prototype.getClosestVertexDOMElementCoords=function(h){if(h&&h.camera){var b=!0,v=this.getClosestVertex(!0);return v.project(h.camera),v.z=Math.min(Math.max(v.z,0),1),(1<v.x||-1>v.x||1<v.y||-1>v.y)&&(b=!1),h.getZincCameraControls().getRelativeCoordsFromNDC(v.x,v.y,v),{position:v,inView:b}}},m.prototype.setMarkerMode=function(h,b){h!==this.markerMode&&(this.markerMode=h==="on"||h==="off"?h:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),b&&(this.markerNumber=b.number,this.markerImgURL=b.imgURL)},m.prototype.render=function(h,b,v,g){if(this.visible&&!(this.timeEnabled&&b)&&this._lod.update(v,this.center),b==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(h);else{var w=this.inbuildTime+h;w>this.duration&&(w-=this.duration),this.inbuildTime=w}this.visible&&h!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},m.prototype.addLOD=function(h,b,v,g,w){this._lod.addLevelFromURL(h,b,v,g,w)},m.prototype.addVertices=function(h){var b=this.getMorph(),v=void 0;if(!b)v=f(500,h),this.drawRange=h.length;else if(-1<this.drawRange){var g=b.geometry.getAttribute("position");h.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(),v=b.geoemtry,this.boundingBoxUpdateRequired=!0}return v},m.prototype.setPosition=function(h,b,v){var g=this.getGroup();g&&(g.position.set(h,b,v),g.updateMatrix(),this.boundingBoxUpdateRequired=!0)},m.prototype.loadAdditionalSources=function(h){h.load(d(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(h){var b=this.getGroup();b&&(b.scale.set(h,h,h),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=m},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,d=u(5).toBufferGeometry,p=function(y){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=y,this.addLevel=(h,b)=>{if(h){var v,g=Math.abs(b);for(v=0;v<this.levels.length&&!(g<this.levels[v].distance);v++);this.levels.splice(v,0,{distance:g,morph:h,loaded:!0,loading:!1,url:""}),h.renderOrder=this._renderOrder}},this.levelLoaded=(h,b)=>{if(h){for(var v=Math.abs(b),g=0;g<this.levels.length;g++)if(v===this.levels[g].distance){this._parent.group.add(h),this.levels[g].morph=h,this.levels[g].loaded=!0,this.levels[g].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(h,b,v,g,w)=>{this._loader=h;var S,T=this.calculateDistance(b);for(S=0;S<this.levels.length&&!(T<this.levels[S].distance);S++);this.levels.splice(S,0,{distance:T,morph:void 0,loaded:!1,loading:!1,url:v,index:g}),w&&this.loadLevel(S)},this.loadLevel=h=>{var b=this.levels[h];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(h){this._parent.getBoundingBox();var b=this._parent.radius,v=0;return h==="far"?v=4.5*b:h==="medium"?v=2.5*b:h=="close"&&(v=0),v},this.containsLevels=()=>!!(this.levels&&1<this.levels.length),this.checkTransparentMesh=()=>{var h=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,!h.secondaryMesh&&(h.secondaryMesh=new c.Mesh(h.morph.geometry,this._secondaryMaterial),h.secondaryMesh.renderOrder=h.morph.renderOrder+1,h.secondaryMesh.userData=h.morph.userData,h.secondaryMesh.name=h.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!h.secondaryMesh.parent&&(h.morph.add(h.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(h.secondaryMesh))):(h.secondaryMesh&&(h.morph.remove(h.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(h.secondaryMesh),this._parent.animationGroup.remove(h.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(h=>{h.morph&&h.morph.geometry&&h.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var h=this.levels[this._currentLevel];return h&&h.morph?h.morph:this._parent.morph},this.lodLoader=function(h){return b=>{var v=this._material,g={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},w=d(b,g),S=void 0;this._parent.isGeometry?S=new c.Mesh(w,v):this._parent.isLines&&(S=new(u(12)).LineSegments(w,v)),S.userData=this._parent,S.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(S,h)}},this.updateMorphColorAttribute=h=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(h){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(v=>{v.morph&&v.morph.geometry&&f(v.morph.geometry,v.morph)})},this.setColour=h=>{this._material.color=h,this._secondaryMaterial&&(this._secondaryMaterial.color=h),m()},this.setFrustumCulled=h=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=h),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=h)})},this.setMaterial=h=>{h&&(!this._material||this._material.id!==h.id)&&(this._material=h,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=h.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=h=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=h),b.secondaryMesh&&(b.secondaryMesh.name=h)})},this.setRenderOrder=h=>{this._renderOrder=h,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=h),b.secondaryMesh&&(b.secondaryMesh.renderOrder=h)})},this.setVertexColors=h=>{this._material.vertexColors=h,m(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=h)},this.update=(h,b)=>{var v=this.levels;if(1<v.length){var g,w,S=h.cameraObject.position.distanceTo(b),T=-1,M=-1;for(g=0,w=v.length;g<w&&S>=v[g].distance;g++)v[g].morph?(-1<T&&v[T].morph&&(v[T].morph.visible=!1),T=g,v[g].morph.visible=!0,M=-1):M=g;for(-1<M&&this.loadLevel(M);g<w;g++)v[g].morph&&(-1<T?v[g].morph.visible=!1:(v[g].morph.visible=!0,T=g));this._currentLevel!=T&&(this._currentLevel=T,this.checkTransparentMesh())}},this.toggleMarker=(h,b)=>{this.levels.forEach(v=>{v.morph&&(b?v.morph.add(h):v.morph.remove(h))})};var m=()=>{this.levels.forEach(h=>{h.morph&&h.morph.geometry&&(h.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>y});var c=u(13),f=u(4),d=new f.Vector3,p=new f.Vector3;class y extends c.Line{constructor(h,b){super(h,b),this.type="LineSegments"}computeLineDistances(){var h=this.geometry;if(!h.isBufferGeometry)h.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(h.index===null){for(var b=h.attributes.position,v=[],g=0,w=b.count;g<w;g+=2)d.fromBufferAttribute(b,g),p.fromBufferAttribute(b,g+1),v[g]=g==0?0:v[g-1],v[g+1]=v[g]+d.distanceTo(p);h.setAttribute("lineDistance",new f.Float32BufferAttribute(v,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}y.prototype.isLineSegments=!0},(o,l,u)=>{u.r(l),u.d(l,{Line:()=>w});var c=u(4),f=new c.Vector3,d=new c.Vector3,p=new c.Matrix4,y=new c.Ray,m=new c.Sphere,h=new c.Vector3,b=new c.Vector3,v=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,_=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=M,this.material=_,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 _=M.attributes.position,C=[0],I=1,E=_.count;I<E;I++)f.fromBufferAttribute(_,I-1),d.fromBufferAttribute(_,I),C[I]=C[I-1],C[I]+=f.distanceTo(d);M.setAttribute("lineDistance",new c.Float32BufferAttribute(C,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(M,_){var C=this.geometry,I=this.matrixWorld,E=M.params.Line.threshold,P=C.drawRange,A=C.morphAttributes.position;if(C.boundingSphere===null&&C.computeBoundingSphere(),m.copy(C.boundingSphere),m.applyMatrix4(I),m.radius+=E,M.ray.intersectsSphere(m)!==!1){p.copy(I).invert(),y.copy(M.ray).applyMatrix4(p);var R=E/((this.scale.x+this.scale.y+this.scale.z)/3),L=R*R,N=new c.Vector3,x=new c.Vector3,O=new c.Vector3,B=new c.Vector3,F=this.isLineSegments?2:1;if(C.isBufferGeometry){var V=C.index,k=C.attributes,G=k.position;if(V!==null)for(var J=Math.max(0,P.start),ne=Math.min(V.count,P.start+P.count),ae=J;ae<ne-1;ae+=F){var ie=V.getX(ae),oe=V.getX(ae+1);S(N,x,this,G,A,ie,oe);var W=y.distanceSqToSegment(N,x,B,O);if(!(W>L)){B.applyMatrix4(this.matrixWorld);var X=M.ray.origin.distanceTo(B);X<M.near||X>M.far||_.push({distance:X,point:O.clone().applyMatrix4(this.matrixWorld),index:ae,face:null,faceIndex:null,object:this})}}else for(var j=Math.max(0,P.start),re=Math.min(G.count,P.start+P.count),z=j;z<re-1;z+=F){S(N,x,this,G,A,z,z+1);var H=y.distanceSqToSegment(N,x,B,O);if(!(H>L)){B.applyMatrix4(this.matrixWorld);var K=M.ray.origin.distanceTo(B);K<M.near||K>M.far||_.push({distance:K,point:O.clone().applyMatrix4(this.matrixWorld),index:z,face:null,faceIndex:null,object:this})}}}else C.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var M=this.geometry;if(M.isBufferGeometry){var _=M.morphAttributes,C=Object.keys(_);if(0<C.length){var I=_[C[0]];if(I!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var E,P=0,A=I.length;P<A;P++)E=I[P].name||P+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[E]=P}}}else{var R=M.morphTargets;R!==void 0&&0<R.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function S(T,M,_,C,I,E,P){T.fromBufferAttribute(C,E),M.fromBufferAttribute(C,P);var A=_.morphTargetInfluences;if(_.material.morphTargets&&I&&A){h.set(0,0,0),b.set(0,0,0);for(var R=0,L=I.length;R<L;R++){var N=A[R],x=I[R];N!==0&&(v.fromBufferAttribute(x,E),g.fromBufferAttribute(x,P),h.addScaledVector(v.sub(T),N),b.addScaledVector(g.sub(M),N))}T.add(h),M.add(b)}}w.prototype.isLine=!0},(o,l,u)=>{var c=u(4),f=new Image(128,128);f.src=u(15);var d=new c.Texture;d.image=f,d.needsUpdate=!0;var p=[.02,.03,1],y=new c.SpriteMaterial({map:d,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),m=u(5).createNewSpriteText,h=function(b){u(10).ZincObject.call(this),this.texture=d;var v=void 0,g=void 0,w=void 0,S=void 0,T=void 0,M=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var _=!1;this.ndc=new c.Vector3;var C=void 0,I=void 0,E=()=>{v=new c.Sprite(y),v.center.set(.5,0),this.morph.add(v),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,v.scale.set(p[0],p[1],p[2]),v.userData=this};this.updateVisual=(P,A)=>{var R=1,L=0;P!==A&&(L=1-(this.ndc.z-P)/(A-P),R=.6+.4*L),this.setSpriteSize(R)},this.updateNDC=P=>(this.ndc.copy(this.morph.position),this.ndc.project(P),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(P,A,R)=>{this.morph.position.set(P,A,R)},this.setSpriteSize=P=>{v.scale.set(.015,.02,1),v.scale.multiplyScalar(P)},this.setUserSprite=()=>{S&&(this.morph.add(S),M&&(this.morph.remove(v),I&&this.morph.remove(I),M=!1))},this.setImageForUserSprite=(P,A)=>{S&&(this.morph.remove(S),S=void 0),g&&g.dispose(),w&&w.dispose(),g=new c.Texture,g.image=P,g.needsUpdate=!0,w=new c.SpriteMaterial({map:g,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),A||(A=[.05,.05,1]),S=new c.Sprite(w),S.center.set(.5,0),S.scale.set(A[0],A[1],A[2]),S.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{M||(M=!0,this.morph.add(v),S&&this.morph.remove(S),I&&this.morph.add(I))},this.loadUserSprite=(P,A)=>{if(P)if(P!==T){T=P;var R=new Image(128,128);R.crossOrigin="anonymous",R.onload=()=>{this.setImageForUserSprite(R,A)},R.src=P}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),v&&(v.clear(),v=void 0),I&&(I.material.map.dispose(),I.material.dispose(),I=void 0)},this.isEnabled=()=>_,this.setNumber=P=>{(!P||C!=P)&&I&&(this.morph.remove(I),I.material.map.dispose(),I.material.dispose(),I=void 0),!I&&P&&(I=m(P,.012,"black","Asap",120,700),this.morph.add(I)),C=P},this.getNumber=()=>C||1,this.setVisibility=function(P){P!==this.visible&&(this.visible=P,this.group.visible=P,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{_=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{_=!1,this.morph.visible=!1,this.visible=!1},E()};h.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=h},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(d,p,y,m){u(10).ZincObject.call(this);var h;p&&(h=p.clone(),h.vertexColors=c.FaceColors),this.id=y;var b=void 0,v=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),d&&h&&this.fromMesh(new c.Mesh(d,h)),this.getGlyphset=function(){return m},this.setLabel=w=>{w&&(typeof w=="string"||w instanceof String)&&(v=w,this.morph&&(this.morph.name=w))},this.showLabel=w=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),v&&(typeof v=="string"||v instanceof String)&&(b=new(u(17)).Label(v,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=()=>v,this.getMesh=()=>this.morph,this.setTransformation=(w,S,T,M)=>{this.morph&&(this.morph.matrix.elements[0]=S[0],this.morph.matrix.elements[1]=S[1],this.morph.matrix.elements[2]=S[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=T[0],this.morph.matrix.elements[5]=T[1],this.morph.matrix.elements[6]=T[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,d){var p=f,y=void 0;y=d?new c(p,.015,d.getStyle()):new c(p,.015),y.fontFace="Asap",y.fontWeight=700,y.material.map.generateMipmaps=!1,y.material.sizeAttenuation=!1,y.center.x=-.05,y.center.y=0,this.getPosition=()=>y?[y.position.x,y.position.y,y.position.z]:[0,0,0],this.setPosition=(m,h,b)=>{y&&y.position.set(m,h,b)},this.setColour=m=>{y.color=m.getStyle()},this.setScale=m=>{y&&0<m&&y.scale.set(m,m,1)},this.dispose=()=>{},this.getSprite=()=>y,this.getString=()=>p}},(o,l,u)=>{var c=u(4),f=u(19).JSONLoader,d=function(){u(10).ZincObject.call(this);var p=[],y=void 0,m=void 0,h=void 0,b=void 0,v=void 0,g=void 0,w=void 0,S=0,T=0,M=[0,0,0],_=[0,0,0],C=[0,0,0],I="NONE";this.ready=!1;var E=!1,P=!1;this.isGlyphset=!0;var A=new c.Matrix4,R=new c.Color,L=new c.Color,N=new c.Box3,x=new c.Box3,O=new c.Box3,B=[],F=[],V=[],k=[],G=[],J=[],ne=[];this.globalScale=1;for(var ae=0;8>ae;ae++)new c.Vector3;this.load=(z,H,K,le,se)=>{y=z.axis1,m=z.axis2,h=z.axis3,b=z.positions,v=z.scale,g=z.colors,w=z.label,E=z.metadata.MorphColours,P=z.metadata.MorphVertices,S=z.metadata.number_of_time_steps,I=z.metadata.repeat_mode,T=z.metadata.number_of_vertices,I=="AXES_2D"||I=="MIRROR"?T*=2:I=="AXES_3D"&&(T*=3),M=z.metadata.base_size,_=z.metadata.offset,C=z.metadata.scale_factors;var U=new f;this.geometry=new c.BufferGeometry;var D=new c.InstancedMesh(this.geometry,void 0,T);if(this.setMorph(D),le){var $=U.parse(H);re(K,se)($.geometry,$.materials),$.geometry.dispose()}else U.crossOrigin="Anonymous",U.load(H,re(K,se))};var ie=(z,H,K,le,se,U)=>{if(I=="NONE"||I=="MIRROR"){for(var D,$=[0,0,0],Y=[0,0,0],ee=[0,0,0],ce=[0,0,0],ve=[0,0,0],be=[0,0,0],ue=[0,0,0],me=[0,0,0],te=[0,0,0],he=0;3>he;he++)D=0>se[he]?-1:1,$[he]=(D*M[he]+se[he]*C[he])*this.globalScale;for(var he=0;3>he;he++)Y[he]=H[he]*$[0],ee[he]=K[he]*$[1],ce[he]=le[he]*$[2],ve[he]=z[he]+_[0]*Y[he]+_[1]*ee[he]+_[2]*ce[he],I=="MIRROR"&&(be[he]=-Y[he],ue[he]=-ee[he],me[he]=-ce[he],te[he]=ve[he],0>se[0]&&(ve[he]-=Y[he],te[he]-=be[he]));0>ce[0]*(Y[1]*ee[2]-Y[2]*ee[1])+ce[1]*(Y[2]*ee[0]-Y[0]*ee[2])+ce[2]*(Y[0]*ee[1]-Y[1]*ee[0])&&(ce[0]=-ce[0],ce[1]=-ce[1],ce[2]=-ce[2]),U[0]=[ve,Y,ee,ce],I=="MIRROR"&&(0>me[0]*(be[1]*ue[2]-be[2]*ue[1])+me[1]*(be[2]*ue[0]-be[0]*ue[2])+me[2]*(be[0]*ue[1]-be[1]*ue[0])&&(me[0]=-me[0],me[1]=-me[1],me[2]=-me[2]),U[1]=[te,be,ue,me])}else if(I=="AXES_2D"||I=="AXES_3D"){for(var D,ge=[0,0,0],Ce=[0,0,0],he=0;3>he;he++)D=0>se[he]?-1:1,ge[he]=(D*M[0]+se[he]*C[0])*this.globalScale;for(var he=0;3>he;he++)Ce[he]=z[he]+_[0]*ge[0]*H[he]+_[1]*ge[1]*K[he]+_[2]*ge[2]*le[he];for(var Ee=glyph_repeat_mode=="AXES_2D"?2:3,De=0;De<Ee;De++){var Ye=void 0,ze=void 0,st=se[De],Ae=[0,0,0],He=[0,0,0],Ge=[0,0,0];De==0?(Ye=H,ze=K):De==1?(Ye=K,ze=glyph_repeat_mode=="AXES_2D"?H:le):(Ye=le,ze=H);var Ot=(M[0]+st*C[0])*this.globalScale;Ae[0]=Ye[0]*Ot,Ae[1]=Ye[1]*Ot,Ae[2]=Ye[2]*Ot,Ge[0]=Ae[1]*ze[2]-ze[1]*Ae[2],Ge[1]=Ae[2]*ze[0]-ze[2]*Ae[0],Ge[2]=Ae[0]*ze[1]-Ae[1]*ze[0];var Nt=Math.sqrt(Ge[0]*Ge[0]+Ge[1]*Ge[1]+Ge[2]*Ge[2]);if(0<Nt){var mt=(M[2]+st*C[2])*this.globalScale/Nt;I=="AXES_2D"&&0<De&&(mt*=-1),Ge[0]*=mt,Ge[1]*=mt,Ge[2]*=mt}if(He[0]=Ge[1]*Ae[2]-Ae[1]*Ge[2],He[1]=Ge[2]*Ae[0]-Ae[2]*Ge[0],He[2]=Ge[0]*Ae[1]-Ge[1]*Ae[0],Nt=Math.sqrt(He[0]*He[0]+He[1]*He[1]+He[2]*He[2]),0<Nt){var xt=(M[1]+st*C[1])*this.globalScale/Nt;He[0]*=xt,He[1]*=xt,He[2]*=xt}U[De]=[Ce,Ae,He,Ge]}}return U},oe=(z,H,K,le,se)=>{var U=1;I=="AXES_2D"||I=="MIRROR"?U=2:I=="AXES_3D"&&(U=3);var D=z.length/3,$=0;ne.length=U;for(var Y=0;Y<D;Y++){var ee=3*Y,ce=[z[ee],z[ee+1],z[ee+2]],ve=[H[ee],H[ee+1],H[ee+2]],be=[K[ee],K[ee+1],K[ee+2]],ue=[le[ee],le[ee+1],le[ee+2]],me=[se[ee],se[ee+1],se[ee+2]],te=ie(ce,ve,be,ue,me,ne);if(te.length==U)for(var he=0;he<U;he++){A.elements[0]=te[he][1][0],A.elements[1]=te[he][1][1],A.elements[2]=te[he][1][2],A.elements[3]=0,A.elements[4]=te[he][2][0],A.elements[5]=te[he][2][1],A.elements[6]=te[he][2][2],A.elements[7]=0,A.elements[8]=te[he][3][0],A.elements[9]=te[he][3][1],A.elements[10]=te[he][3][2],A.elements[11]=0,A.elements[12]=te[he][0][0],A.elements[13]=te[he][0][1],A.elements[14]=te[he][0][2],A.elements[15]=1,this.morph.setMatrixAt($,A);var ge=p[$];ge&&ge.setTransformation(te[he][0],te[he][1],te[he][2],te[he][3]),$++}}this.morph.instanceMatrix.needsUpdate=!0},W=z=>{var H=1;I=="AXES_2D"||I=="MIRROR"?H=2:I=="AXES_3D"&&(H=3);for(var K,le=z.length,se=0,U=0;U<le;U++){K=z[U];for(var D=0;D<H;D++){R.setHex(K),this.morph.setColorAt(se,R);var $=p[se];$&&$.setColour(R),se++}}this.morph.instanceColor.needsUpdate=!0},X=()=>{var z=B,H=F,K=V,le=k,se=G,U=J,D=this.inbuildTime/this.duration*(S-1),$=Math.floor(D),Y=1-(D-$),ee=Math.ceil(D);if(P){var ce=b[$.toString()],ve=b[ee.toString()],be=y[$.toString()],ue=y[ee.toString()],me=m[$.toString()],te=m[ee.toString()],he=h[$.toString()],ge=h[ee.toString()],Ce=v[$.toString()],Ee=v[ee.toString()];B.length=ce.length,F.length=ce.length,V.length=ce.length,k.length=ce.length,G.length=ce.length;for(var De=0;De<ce.length;De++)z[De]=Y*ce[De]+(1-Y)*ve[De],H[De]=Y*be[De]+(1-Y)*ue[De],K[De]=Y*me[De]+(1-Y)*te[De],le[De]=Y*he[De]+(1-Y)*ge[De],se[De]=Y*Ce[De]+(1-Y)*Ee[De]}else z=b[0],H=y[0],K=m[0],le=h[0],se=v[0];if(oe(z,H,K,le,se),this.boundingBoxUpdateRequired=!0,g!=null){if(E){var Ye=g[$.toString()],ze=g[ee.toString()];U.length=Ye.length;for(var st=0;st<Ye.length;st++)R.setHex(Ye[st]),L.setHex(ze[st]),R.setRGB(R.r*Y+L.r*(1-Y),R.g*Y+L.g*(1-Y),R.b*Y+L.b*(1-Y)),U[st]=R.getHex()}else U=g[0];W(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 j=z=>{for(var H=0;H<T;H++){var K=new(u(16)).Glyph(void 0,void 0,H,this),le=w?w[H]:void 0;le=le||this.groupName,le&&K.setLabel(le),0<S&&K.setFrustumCulled(!1),p[H]=K,this.morph.add(K.getGroup())}z&&this.showLabel(),oe(b[0],y[0],m[0],h[0],v[0]),g!=null&&W(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,H)=>{if(z.isMesh){var K=new(u(16)).Glyph(void 0,void 0,H,this);return K.fromMesh(z),p.push(K),this.morph.add(K.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,K}},this.forEachGlyph=z=>{for(var H=0;H<p.length;H++)z(p[H])};var re=(z,H)=>(K,le)=>{var se=K.toBufferGeometry();this.geometry.copy(se),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),se.dispose(),le&&le[0]&&(this.morph.material=le[0]),j(H),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),K.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 H,K=b[0],le=K.length/3,se=-1,U=0,D=0;D<le;D++)H=3*D,this._v2.set(K[H],K[H+1],K[H+2]),U=this._v1.distanceTo(this._v2),(se==-1||se>U)&&(se=U,z=D)}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,A),z.setFromMatrixPosition(A),z}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){N.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var z=0;z<T;z++)this.morph.getMatrixAt(z,A),x.copy(N).applyMatrix4(A),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,(E||P)&&(X(),P&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<S)&&(E||P)),this.getCurrentTime=()=>this.inbuildTime,this.setScaleAll=function(z){this.globalScale=z,X()},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(),y=void 0,m=void 0,h=void 0,b=void 0,v=void 0,g=void 0,this.ready=!1,this.groupName=void 0},this.render=(z,H,K)=>{if(H==!0){var le=this.inbuildTime+z;le>this.duration&&(le-=this.duration),this.inbuildTime=le,(E||P)&&X()}this.updateMarker(H,K)}};d.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=d},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>M});var c=u(4),f=u(20).Loader,d=c.LoaderUtils,p=c.AnimationClip,y=c.Vector3,m=c.Vector4,h=c.Color,b=c.Vector2,v=u(6).Face3,g=u(6).Geometry,w=c.FileLoader,S=c.DefaultLoadingManager,T=u(21).VideoHandler;function M(_){typeof _=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),_=void 0),this.manager=_===void 0?S:_,this.withCredentials=!1,this.paramsString=""}Object.assign(M.prototype,{load:function(C,I,E,P){var A=this,R=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:d.extractUrlBase(C),L=new w(this.manager);C.split("?"),this.paramsString=C.length===2?paramsStrings[1]:"",L.setWithCredentials(this.withCredentials),L.load(C,function(N){var x;try{x=JSON.parse(N)}catch{if(console.error("The loader has encountered an error while parsing the content of a resource."),P)return void P({responseURL:C})}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: "+C+" should be loaded with THREE.ObjectLoader instead.")}if(A&&A.parse){var F=A.parse(x,R);I(F.geometry,F.materials)}},E,P)},setTexturePath:function(C){this.texturePath=C},parse:function(){function _(P,A){function R(he,ge){return he&1<<ge}var L,N,x,O,B,F,V,k,G,J,ne,ae,ie,oe,W,X,j,re,z,H,K,le,se,U,D,$,Y,ee=P.faces,ce=P.vertices,ve=P.normals,be=P.colors,ue=P.scale,me=0;if(P.uvs!==void 0){for(L=0;L<P.uvs.length;L++)P.uvs[L].length&&me++;for(L=0;L<me;L++)A.faceVertexUvs[L]=[]}for(O=0,B=ce.length;O<B;)re=new y,re.x=ce[O++]*ue,re.y=ce[O++]*ue,re.z=ce[O++]*ue,A.vertices.push(re);if(O=0,B=ee.length,P.uvs)for(L=0;L<P.uvs.length;L++){A.uvs[L]=[];for(var te=0;te<P.uvs[L].length;te++)A.uvs[L][te]=P.uvs[L][te]}if(ve)for(L=0;L<ve.length;L++)A.normals[L]=ve[L];if(be)for(L=0;L<be.length;L++)A.colors[L]=be[L];for(;O<B;)if(J=ee[O++],ne=R(J,0),ae=R(J,1),ie=R(J,3),oe=R(J,4),W=R(J,5),X=R(J,6),j=R(J,7),ne){if(H=new v,H.a=ee[O],H.b=ee[O+1],H.c=ee[O+3],K=new v,K.a=ee[O+1],K.b=ee[O+2],K.c=ee[O+3],O+=4,ae&&(G=ee[O++],H.materialIndex=G,K.materialIndex=G),x=A.faces.length,ie)for(L=0;L<me;L++)for(U=P.uvs[L],A.faceVertexUvs[L][x]=[],A.faceVertexUvs[L][x+1]=[],N=0;4>N;N++)k=ee[O++],$=U[2*k],Y=U[2*k+1],D=new b($,Y),N!==2&&A.faceVertexUvs[L][x].push(D),N!==0&&A.faceVertexUvs[L][x+1].push(D);if(oe&&(V=3*ee[O++],H.normal.set(ve[V++],ve[V++],ve[V]),K.normal.copy(H.normal)),W)for(L=0;4>L;L++)V=3*ee[O++],se=new y(ve[V++],ve[V++],ve[V]),L!==2&&H.vertexNormals.push(se),L!==0&&K.vertexNormals.push(se);if(X&&(F=ee[O++],le=be[F],H.color.setHex(le),K.color.setHex(le)),j)for(L=0;4>L;L++)F=ee[O++],le=be[F],L!==2&&H.vertexColors.push(new h(le)),L!==0&&K.vertexColors.push(new h(le));A.faces.push(H),A.faces.push(K)}else{if(z=new v,z.a=ee[O++],z.b=ee[O++],z.c=ee[O++],ae&&(G=ee[O++],z.materialIndex=G),x=A.faces.length,ie)for(L=0;L<me;L++)for(U=P.uvs[L],A.faceVertexUvs[L][x]=[],N=0;3>N;N++)k=ee[O++],$=U[2*k],Y=U[2*k+1],D=new b($,Y),A.faceVertexUvs[L][x].push(D);if(oe&&(V=3*ee[O++],z.normal.set(ve[V++],ve[V++],ve[V])),W)for(L=0;3>L;L++)V=3*ee[O++],se=new y(ve[V++],ve[V++],ve[V]),z.vertexNormals.push(se);if(X&&(F=ee[O++],z.color.setHex(be[F])),j)for(L=0;3>L;L++)F=ee[O++],z.vertexColors.push(new h(be[F]));A.faces.push(z)}}function C(P,A){var R=P.influencesPerVertex===void 0?2:P.influencesPerVertex;if(P.skinWeights)for(var L=0,N=P.skinWeights.length;L<N;L+=R){var x=P.skinWeights[L],O=1<R?P.skinWeights[L+1]:0,B=2<R?P.skinWeights[L+2]:0,F=3<R?P.skinWeights[L+3]:0;A.skinWeights.push(new m(x,O,B,F))}if(P.skinIndices)for(var L=0,N=P.skinIndices.length;L<N;L+=R){var V=P.skinIndices[L],k=1<R?P.skinIndices[L+1]:0,G=2<R?P.skinIndices[L+2]:0,J=3<R?P.skinIndices[L+3]:0;A.skinIndices.push(new m(V,k,G,J))}A.bones=P.bones,A.bones&&0<A.bones.length&&(A.skinWeights.length!==A.skinIndices.length||A.skinIndices.length!==A.vertices.length)&&console.warn("When skinning, number of vertices ("+A.vertices.length+"), skinIndices ("+A.skinIndices.length+"), and skinWeights ("+A.skinWeights.length+") should match.")}function I(P,A){var R=P.scale;if(P.morphTargets!==void 0)for(var L=0,N=P.morphTargets.length;L<N;L++){A.morphTargets[L]={},A.morphTargets[L].name=P.morphTargets[L].name,A.morphTargets[L].vertices=[];for(var x,O=A.morphTargets[L].vertices,B=P.morphTargets[L].vertices,F=0,V=B.length;F<V;F+=3)x=new y,x.x=B[F]*R,x.y=B[F+1]*R,x.z=B[F+2]*R,O.push(x)}if(P.morphNormals!==void 0){for(var L=0,N=P.morphNormals.length;L<N;L++)if(A.morphTargets[L]){A.morphTargets[L].normals=[];for(var k,G=A.morphTargets[L].normals,J=P.morphNormals[L].normals,F=0,V=J.length;F<V;F+=3)k=new y,k.x=J[F],k.y=J[F+1],k.z=J[F+2],G.push(k);A.morphNormalsReady=!0}}if(P.morphColors!==void 0){var L,N,ne,ae,ie,oe,W;for(L=0,N=P.morphColors.length;L<N;L++)for(A.morphColors[L]={},A.morphColors[L].name=P.morphColors[L].name,A.morphColors[L].colors=[],ie=A.morphColors[L].colors,oe=P.morphColors[L].colors,ne=0,ae=oe.length;ne<ae;ne+=3)W=new c.Color(16755200),W.setRGB(oe[ne],oe[ne+1],oe[ne+2]),ie.push(W)}}function E(P,A){var R=[],L=[];P.animation!==void 0&&L.push(P.animation),P.animations!==void 0&&(P.animations.length?L=L.concat(P.animations):L.push(P.animations));for(var N,x=0;x<L.length;x++)N=p.parseAnimation(L[x],A.bones),N&&R.push(N);if(A.morphTargets){var O=p.CreateClipsFromMorphTargetSequences(A.morphTargets,10);R=R.concat(O)}0<R.length&&(A.animations=R)}return function(P,A){P.data!==void 0&&(P=P.data),P.scale=P.scale===void 0?1:1/P.scale;var R=new g;if(R.morphColors=[],_(P,R),C(P,R),I(P,R),E(P,R),R.computeFaceNormals(),R.computeBoundingSphere(),P.materials===void 0||P.materials.length===0)return{geometry:R};var L=f.prototype.initMaterials(P.materials,A,"Anonymous");if(P.materials[0].video){var N=A+P.materials[0].video;this.paramsString&&(N+="?".concat(this.paramsString));var x=new T(N);R._video=x}return L&&0<L.length&&(L[0].side=P.materials[0].singleSided?c.FrontSide:P.materials[0].flipSided?c.BackSide:c.DoubleSide,P.materials[0].specularCoef&&(L[0].shininess=Math.floor(P.materials[0].specularCoef/3))),{geometry:R,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,y){this.handlers.push(p,y)},get:function(p){for(var y=this.handlers,m=0,h=y.length;m<h;m+=2){var b=y[m],v=y[m+1];if(b.test(p))return v}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(p,y,m){for(var h=[],b=0;b<p.length;++b)h[b]=this.createMaterial(p[b],y,m);return h},createMaterial:function(){var d={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},p=new c.Color,y=new c.TextureLoader,m=new c.MaterialLoader;return function(h,b,v){function g(_,C,I,E,P){var A,R=b+_,L=f.Handlers.get(R);L===null?(y.setCrossOrigin(v),A=y.load(R)):A=L.load(R),C!==void 0&&(A.repeat.fromArray(C),C[0]!==1&&(A.wrapS=c.RepeatWrapping),C[1]!==1&&(A.wrapT=c.RepeatWrapping)),I!==void 0&&A.offset.fromArray(I),E!==void 0&&(E[0]==="repeat"&&(A.wrapS=c.RepeatWrapping),E[0]==="mirror"&&(A.wrapS=c.MirroredRepeatWrapping),E[1]==="repeat"&&(A.wrapT=c.RepeatWrapping),E[1]==="mirror"&&(A.wrapT=c.MirroredRepeatWrapping)),P!==void 0&&(A.anisotropy=P);var N=c.MathUtils.generateUUID();return w[N]=A,N}var w={},S={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var T in h){var M=h[T];switch(T){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":S.name=M;break;case"blending":S.blending=d[M];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",T,"is no longer supported.");break;case"colorDiffuse":S.color=p.fromArray(M).getHex();break;case"colorSpecular":S.specular=p.fromArray(M).getHex();break;case"colorEmissive":S.emissive=p.fromArray(M).getHex();break;case"specularCoef":S.shininess=M;break;case"shading":M.toLowerCase()==="basic"&&(S.type="MeshBasicMaterial"),M.toLowerCase()==="phong"&&(S.type="MeshPhongMaterial"),M.toLowerCase()==="standard"&&(S.type="MeshStandardMaterial");break;case"mapDiffuse":S.map=g(M,h.mapDiffuseRepeat,h.mapDiffuseOffset,h.mapDiffuseWrap,h.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":S.emissiveMap=g(M,h.mapEmissiveRepeat,h.mapEmissiveOffset,h.mapEmissiveWrap,h.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":S.lightMap=g(M,h.mapLightRepeat,h.mapLightOffset,h.mapLightWrap,h.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":S.aoMap=g(M,h.mapAORepeat,h.mapAOOffset,h.mapAOWrap,h.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":S.bumpMap=g(M,h.mapBumpRepeat,h.mapBumpOffset,h.mapBumpWrap,h.mapBumpAnisotropy);break;case"mapBumpScale":S.bumpScale=M;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":S.normalMap=g(M,h.mapNormalRepeat,h.mapNormalOffset,h.mapNormalWrap,h.mapNormalAnisotropy);break;case"mapNormalFactor":S.normalScale=M;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":S.specularMap=g(M,h.mapSpecularRepeat,h.mapSpecularOffset,h.mapSpecularWrap,h.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":S.metalnessMap=g(M,h.mapMetalnessRepeat,h.mapMetalnessOffset,h.mapMetalnessWrap,h.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":S.roughnessMap=g(M,h.mapRoughnessRepeat,h.mapRoughnessOffset,h.mapRoughnessWrap,h.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":S.alphaMap=g(M,h.mapAlphaRepeat,h.mapAlphaOffset,h.mapAlphaWrap,h.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":S.side=c.BackSide;break;case"doubleSided":S.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),S.opacity=M;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":S[T]=M;break;case"vertexColors":M===!0&&(S.vertexColors=c.VertexColors),M==="face"&&(S.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",T,M)}}return S.type==="MeshBasicMaterial"&&delete S.emissive,S.type!=="MeshPhongMaterial"&&delete S.specular,1>S.opacity&&(S.transparent=!0),m.setTextures(w),m.parse(S)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var d=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(p,y){var m=p/y*d.video.duration;d.video.currentTime=m},this.getVideoDuration=function(){return d.video.duration},this.createCanvasVideoTexture=function(){return d.videoTexture=new c.VideoTexture(d.video),d.videoTexture.minFilter=c.LinearFilter,d.videoTexture.magFilter=c.LinearFilter,d.videoTexture.format=c.RGBFormat,d.video.currentTime=0,d.videoTexture},this.getCurrentTime=function(p){return d.video?p*(d.video.currentTime/d.video.duration):0},this.isReadyToPlay=function(){return!!(d.video&&3<=d.video.readyState)},function(){document&&(d.video=document.createElement("video"),d.video.crossOrigin="anonymous",d.video.src=f,d.video.load(),d.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,d=u(5).toBufferGeometry,p=u(5).getCircularTexture,y=u(17).Label,m=function(){u(10).ZincObject.call(this),this.isPointset=!0;var h=[];this.createMesh=(v,g,w)=>{if(v&&g){var S=d(v,w),T=p();g.map=T;var M=new f(S,g);this.setMesh(M,w.localTimeEnabled,w.localMorphColour)}};var b=(v,g,w,S)=>{if(w){var T=new c.Color(S),M=new y(w,T);M.setPosition(g[0],g[1],g[2]);var _=M.getSprite();_.material.sizeAttenuation=!1,_.material.alphaTest=.5,_.material.transparent=!0,_.material.depthWrite=!1,_.material.depthTest=!1,this.group.add(_),h[v]=M}};this.addPoints=(v,g,w)=>{if(v&&0<v.length){var S=this.drawRange-1,T=this.addVertices(v),M=this.getMorph();if(!M){var _=new c.PointsMaterial({alphaTest:.5,size:10,color:w,sizeAttenuation:!1});T.colorsNeedUpdate=!0,this.createMesh(T,_,{localTimeEnabled:!1,localMorphColour:!1})}var C=S+v.length,I=0;if(Array.isArray(g)&&g.length===v.length||typeof g=="string")for(S;S+I<C;){var E=typeof g=="string"?g:g[I];b(I,v[I],E,w),I++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setSize=v=>{this.morph&&this.morph.material&&(this.morph.material.size=v,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=v=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=v,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(v){if(0<=v&&this.drawRange>v){var g=this.getMorph().geometry.getAttribute("position");return[g.getX(v),g.getY(v),g.getZ(v)]}},this.editVertices=function(v,g){if(v&&v.length){var w=this.getMorph(),S=g+v.length-1;if(!w||0>g||S>=this.drawRange)return;var T=w.geometry.getAttribute("position"),M=g;v.forEach(_=>{var C=h[M];C&&C.setPosition(_[0],_[1],_[2]),T.setXYZ(M++,_[0],_[1],_[2])}),T.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(v,g,w,S)=>{this.morph&&w&&(this.morph.sizePerPixel=w.pixelHeight),m.prototype.render.call(this,v,g,w,S)}};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,d=new c.Ray,p=new c.Sphere,y=new c.Vector3,m=new c.Vector3,h=new c.Vector3;class b extends c.Object3D{constructor(){var S=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,T=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.PointsMaterial;super(),this.type="Points",this.geometry=S,this.material=T,this.sizePerPixel=1,this.updateMorphTargets()}copy(S){return super.copy(S),this.material=S.material,this.geometry=S.geometry,this}raycast(S,T){var M=this.geometry,_=this.matrixWorld,C=S.params.Points.threshold,I=M.drawRange;if(M.boundingSphere===null&&M.computeBoundingSphere(),p.copy(M.boundingSphere),p.applyMatrix4(_),p.radius+=C,S.ray.intersectsSphere(p)!==!1){f.copy(_).invert(),d.copy(S.ray).applyMatrix4(f);var E=C/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,P=E*E;if(M.isBufferGeometry){var A=M.index,R=M.attributes,L=R.position,N=M.morphAttributes.position;if(A!==null)for(var x,O=Math.max(0,I.start),B=Math.min(A.count,I.start+I.count),F=O;F<B;F++)x=A.getX(F),g(this,L,N,x),v(y,x,P,_,S,T,this);else for(var V=Math.max(0,I.start),k=Math.min(L.count,I.start+I.count),G=V;G<k;G++)g(this,L,N,G),v(y,G,P,_,S,T,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var S=this.geometry;if(S.isBufferGeometry){var T=S.morphAttributes,M=Object.keys(T);if(0<M.length){var _=T[M[0]];if(_!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var C,I=0,E=_.length;I<E;I++)C=_[I].name||I+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[C]=I}}}else{var P=S.morphTargets;P!==void 0&&0<P.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function v(w,S,T,M,_,C,I){var E=d.distanceSqToPoint(w);if(E<T){var P=new c.Vector3;d.closestPointToPoint(w,P),P.applyMatrix4(M);var A=_.ray.origin.distanceTo(P);if(A<_.near||A>_.far)return;C.push({distance:A,distanceToRay:Math.sqrt(E),point:P,index:S,face:null,object:I})}}function g(w,S,T,M){y.fromBufferAttribute(S,M);var _=w.morphTargetInfluences;if(w.material.morphTargets&&T&&_){m.set(0,0,0);for(var C=0,I=T.length;C<I;C++){var E=_[C],P=T[C];E!==0&&(h.fromBufferAttribute(P,M),m.addScaledVector(h.sub(y),E))}y.add(m)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,d=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(p,y,m)=>{if(p&&y){var h=f(p,m);m.localMorphColour&&h.morphAttributes.color&&(y.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(h,y);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,y)=>{if(p&&0<p.length){var m=this.addVertices(p),h=this.getMorph();if(!h){var b=new c.LineBasicMaterial({color:y});m.colorsNeedUpdate=!0,this.createLineSegment(m,b,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}}};d.prototype=Object.create(u(10).ZincObject.prototype),l.Lines=d},(o,l,u)=>{function c(y,m,h,b,v,g,w){try{var S=y[g](w),T=S.value}catch(M){return void h(M)}S.done?m(T):Promise.resolve(T).then(b,v)}function f(y){return function(){var m=this,h=arguments;return new Promise(function(b,v){function g(T){c(S,b,v,g,w,"next",T)}function w(T){c(S,b,v,g,w,"throw",T)}var S=y.apply(m,h);g(void 0)})}}var d=u(4),p=function(){var y=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var m=f(function*(h){var b=1,v=1,g=0;if(h&&h.length){y.isLoading=!0;var w=new Image;w.crossOrigin="Anonymous";for(var S,T=document.createElement("canvas"),M=0,_=Array(h.length),C=0;C<h.length;C++)S=yield y.imageToUint8Array(y,w,h[C],T),S&&S.array&&(b=S.width,v=S.height,_[g]=S.array,M+=_[g].length,g++);var I=new Uint8Array(M);M=0,_.forEach(E=>{I.set(E,M),M+=E.length}),y.impl=new d.DataTexture2DArray(I,b,v,g),y.size={width:b,height:v,depth:g},y.isLoading=!1,y.impl.needsUpdate=!0}});return function(){return m.apply(this,arguments)}}(),this.getMaterial=m=>{if(this.impl){var h;if(!m)h=new d.MeshBasicMaterial({color:new d.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:d.DoubleSide});else if(m.vs&&m.fs){var b=!0;m.transparent&&(b=m.transparent);var v=d.FrontSide;m.side&&(v=m.side),h=new d.ShaderMaterial({transparent:b,uniforms:m.uniforms,vertexShader:m.vs,fragmentShader:m.fs,side:v}),m.glslVersion&&(h.glslVersion=m.glslVersion)}if(h)return h.needsUpdate=!0,h}}};p.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=p},(o,l,u)=>{function c(y,m,h,b,v,g,w){try{var S=y[g](w),T=S.value}catch(M){return void h(M)}S.done?m(T):Promise.resolve(T).then(b,v)}function f(y){return function(){var m=this,h=arguments;return new Promise(function(b,v){function g(T){c(S,b,v,g,w,"next",T)}function w(T){c(S,b,v,g,w,"throw",T)}var S=y.apply(m,h);g(void 0)})}}var d=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(y,m){return new Promise((h,b)=>{y.onload=()=>h(y),y.onerror=b,y.src=m})},p.prototype.imageToUint8Array=function(){var y=f(function*(m,h,b,v){yield m.loadImage(h,b),v.width=h.width,v.height=h.height;var g=v.getContext("2d");return g.drawImage(h,0,0),{array:new Uint8Array(g.getImageData(0,0,v.width,v.height).data.buffer),width:v.width,height:v.height}});return function(){return y.apply(this,arguments)}}(),p.prototype.loadFromImages=function(){var y=f(function*(){});return function(){return y.apply(this,arguments)}}(),p.prototype.isReady=function(){return!(!this.impl||this.isLoading)},p.prototype.getMaterial=function(){if(this.impl)return new d.MeshBasicMaterial({color:new d.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:d.DoubleSide})},l.Texture=p},(o,l,u)=>{function c(v,g){var w=Object.keys(v);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(v);g&&(S=S.filter(function(T){return Object.getOwnPropertyDescriptor(v,T).enumerable})),w.push.apply(w,S)}return w}function f(v){for(var g,w=1;w<arguments.length;w++)g=arguments[w]==null?{}:arguments[w],w%2?c(Object(g),!0).forEach(function(S){d(v,S,g[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(g)):c(Object(g)).forEach(function(S){Object.defineProperty(v,S,Object.getOwnPropertyDescriptor(g,S))});return v}function d(v,g,w){return g=p(g),g in v?Object.defineProperty(v,g,{value:w,enumerable:!0,configurable:!0,writable:!0}):v[g]=w,v}function p(v){var g=y(v,"string");return typeof g=="symbol"?g:g+""}function y(v,g){if(typeof v!="object"||!v)return v;var w=v[Symbol.toPrimitive];if(w!==void 0){var S=w.call(v,g||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(v)}var m=u(4),h=u(28),b=function(v){u(29).TexturePrimitive.call(this,v),this.isTextureSlides=!0;var g=[],w={};this.morph=new m.Group,this.group=this.morph,this.morph.userData=this;var S=!0;this.createSlides=_=>{_.forEach(C=>this.createSlide(C))};var T=(_,C)=>{var I=_.material,E=I.uniforms;switch(_.rotation.x=0,_.rotation.y=0,_.rotation.z=0,_.position.x=0,_.position.y=0,_.position.z=0,C.direction){case"x":var P=S?-Math.PI/2:Math.PI/2;_.rotation.y=P,E.direction.value=1,E.slide.value.set(C.value,0,0),_.position.x=C.value;break;case"y":_.rotation.x=Math.PI/2,E.direction.value=2,E.slide.value.set(0,C.value,0),_.position.y=C.value;break;case"z":E.direction.value=3,E.slide.value.set(0,0,C.value),_.position.z=C.value;break}I.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=_=>{_&&_.id&&_.id in w&&w[_.id]&&T(w[_.id],_)},this.createSlide=_=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&_&&_.direction&&_.value!==void 0){var C=new m.PlaneGeometry(1,1);C.translate(.5,.5,0);var I=h.getUniforms();I.diffuse.value=this.texture.impl,I.depth.value=this.texture.size.depth,I.flipY.value=S;var E={fs:h.fs,vs:h.vs,uniforms:I,glslVersion:h.glslVersion,side:m.DoubleSide,transparent:!1},P=this.texture.getMaterial(E);P.needsUpdate=!0;var A=new m.Mesh(C,P);A.name=this.groupName,A.userData=this;var R={value:_.value,direction:_.direction,id:A.id};return g.push(R),T(A,R),w[A.id]=A,this.morph.add(A),this.boundingBoxUpdateRequired=!0,R}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=_=>{for(var C=0;C<g.length;C++)if(_===g[C].id)return f({},g[C])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=_=>{_&&this.removeSlideWithId(_.id)},this.removeSlideWithId=_=>{if(this.morph&&_ in w&&w[_]){if(this.morph.getObjectById(_)){var C=w[_];this.morph.remove(C),C.clear(),C.geometry&&C.geometry.dispose(),C.material&&C.material.dispose(),this.boundingBoxUpdateRequired=!0}var I=g.findIndex(E=>E.id===_);-1<I&&g.splice(I,1)}},this.dispose=()=>{this.morph.children.forEach(_=>{_.geometry&&_.geometry.dispose(),_.material&&_.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var M=(_,C,I)=>{switch(C.direction.value){case 1:I.copy(C.slide.value),_.expandByPoint(I),I.setY(1),I.setZ(1),_.expandByPoint(I);break;case 2:I.copy(C.slide.value),_.expandByPoint(I),I.setX(1),I.setZ(1),_.expandByPoint(I);break;case 3:I.copy(C.slide.value),_.expandByPoint(I),I.setX(1),I.setY(1),_.expandByPoint(I);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var _=new m.Vector3(0,0,0);this.morph.children.forEach(C=>{M(this.cachedBoundingBox,C.material.uniforms,_)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(_,C,I)=>{var E=new m.Matrix4;E.set(_[0],_[1],_[2],0,_[3],_[4],_[5],0,_[6],_[7],_[8],0,0,0,0,0);var P=new m.Quaternion().setFromRotationMatrix(E);this.morph.position.set(...C),this.morph.quaternion.copy(P),this.morph.scale.set(...I),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.initialise=(_,C)=>{if(_){var I=_.locations;I&&0<I.length&&(this.applyTransformation(I[0].orientation,I[0].position,I[0].scale),"flipY"in I[0]&&(S=I[0].flipY)),this.createSlides(_.settings.slides),C!=null&&typeof C=="function"&&C(this)}}};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,d=`
|
|
3185
3185
|
precision highp float;
|
|
@@ -3455,4 +3455,4 @@ void main() {
|
|
|
3455
3455
|
state: () => new MyClass()
|
|
3456
3456
|
Found in store "${_.$id}".`),m&&s&&t.hydrate&&t.hydrate(_.$state,m),c=!0,f=!0,_}function DF(n,e,t){let i,r;const s=typeof e=="function";i=n,r=s?t:e;function o(l,u){const c=a.hasInjectionContext();if(l=(process.env.NODE_ENV==="test"&&Ha&&Ha._testing?null:l)||(c?a.inject(PF,null):null),l&&tu(l),process.env.NODE_ENV!=="production"&&!Ha)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
3457
3457
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
3458
|
-
This will fail in production.`);l=Ha,l._s.has(i)||(s?Bf(i,e,r,l):Gx(i,r,l),process.env.NODE_ENV!=="production"&&(o._pinia=l));const f=l._s.get(i);if(process.env.NODE_ENV!=="production"&&u){const d="__hot:"+i,p=s?Bf(d,e,r,l,!0):Gx(d,Cn({},r),l,!0);u._hotUpdate(p),delete l.state.value[d],l._s.delete(d)}if(process.env.NODE_ENV!=="production"&&ja){const d=a.getCurrentInstance();if(d&&d.proxy&&!u){const p=d.proxy,y="_pStores"in p?p._pStores:p._pStores={};y[i]=f}}return f}return o.$id=i,o}function Hx(n,e){return Array.isArray(e)?e.reduce((t,i)=>(t[i]=function(){return n(this.$pinia)[i]},t),{}):Object.keys(e).reduce((t,i)=>(t[i]=function(){const r=n(this.$pinia),s=e[i];return typeof s=="function"?s.call(this,r):r[s]},t),{})}const Wx=DF("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(n){return n.userProfile.token}},actions:{setUserToken(n){this.userProfile.token=n}}}),BF={name:"ScaffoldTooltip",components:{Col:On,CreateTooltipContent:Ja.CreateTooltipContent,ElIconDelete:cl,Icon:ht,Popover:Pl,Row:Jn,Tooltip:Ja.Tooltip},props:{createData:{type:Object,default:{toBeConfirmed:!1,points:[],shape:"",x:0,y:0}},label:{type:String,default:""},annotationDisplay:{type:Boolean,default:!1},annotationFeature:{type:Object,default:{}},offlineAnnotationEnabled:{type:Boolean,default:!1},region:{type:String,default:""},visible:{type:Boolean,default:!1},x:{type:Number,default:200},y:{type:Number,default:200}},inject:["scaffoldUrl"],provide(){return{userApiKey:this.userToken}},data:function(){return{display:!1,annotationEntry:{},ElIconDelete:a.shallowRef(cl)}},computed:{...Hx(Wx,["userToken"]),position:function(){let n=40;return this.region&&(n=55),{left:this.x-40+"px",top:this.y-n+"px"}}},methods:{checkForDisplay:function(){if(this.visible&&this.label&&this.label!==""){if(this.display=!0,this.annotationDisplay){const n=this.region?this.region+"/":"";this.annotationEntry={featureId:n+this.label,resourceId:this.scaffoldUrl,resource:this.scaffoldUrl,feature:this.annotationFeature,offline:this.offlineAnnotationEnabled}}}else this.display=!1,this.annotationEntry={}},hideTriggered:function(){this.$emit("tooltip-hide")}},watch:{label:{handler:function(){this.checkForDisplay()},immediate:!0},visible:{handler:function(){this.checkForDisplay()},immediate:!0},annotationDisplay:{handler:function(){this.checkForDisplay()},immediate:!0}}},FF={class:"tooltip-text"},VF={key:0,class:"tooltip-text"},kF={key:1,class:"delete-container"};function zF(n,e,t,i,r,s){const o=a.resolveComponent("CreateTooltipContent"),l=a.resolveComponent("Tooltip"),u=On,c=Cs,f=Jn,d=Pl;return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(s.position),class:"region-tooltip"},[a.createVNode(d,{ref:"tooltip",visible:t.visible,placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tooltip-popper non-selectable","virtual-triggering":"",onHide:s.hideTriggered},{default:a.withCtx(()=>[a.createElementVNode("div",FF,a.toDisplayString(t.label),1),t.region?(a.openBlock(),a.createElementBlock("div",VF,"Region: "+a.toDisplayString(t.region),1)):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(o,{createData:t.createData,onConfirmCreate:e[0]||(e[0]=p=>n.$emit("confirm-create",p)),onCancelCreate:e[1]||(e[1]=p=>n.$emit("cancel-create"))},null,8,["createData"]),[[a.vShow,t.createData.toBeConfirmed]]),a.withDirectives(a.createVNode(l,{class:"p-tooltip",ref:"annotationTooltip",annotationDisplay:!0,annotationEntry:n.annotationEntry,onAnnotation:e[2]||(e[2]=p=>n.$emit("confirm-comment",p))},null,8,["annotationEntry"]),[[a.vShow,t.annotationDisplay&&!t.createData.toBeConfirmed]]),t.createData.toBeDeleted?(a.openBlock(),a.createElementBlock("div",kF,[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(u,{span:10},{default:a.withCtx(()=>e[5]||(e[5]=[a.createTextVNode("Delete this feature?")])),_:1}),a.createVNode(u,{span:7},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",icon:n.ElIconDelete,onClick:e[3]||(e[3]=p=>n.$emit("confirm-delete"))},{default:a.withCtx(()=>e[6]||(e[6]=[a.createTextVNode(" Delete ")])),_:1},8,["icon"])]),_:1}),a.createVNode(u,{span:6},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",onClick:e[4]||(e[4]=p=>n.$emit("cancel-create"))},{default:a.withCtx(()=>e[7]||(e[7]=[a.createTextVNode(" Dismiss ")])),_:1})]),_:1})]),_:1})])):a.createCommentVNode("",!0)]),_:1},8,["visible","onHide"])],4)}const jx=Bi(BF,[["render",zF],["__scopeId","data-v-4d16262d"]]);/*! js-cookie v3.0.5 | MIT */function nu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)n[i]=t[i]}return n}var UF={read:function(n){return n[0]==='"'&&(n=n.slice(1,-1)),n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(n){return encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Ff(n,e){function t(r,s,o){if(!(typeof document>"u")){o=nu({},e,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var u in o)o[u]&&(l+="; "+u,o[u]!==!0&&(l+="="+o[u].split(";")[0]));return document.cookie=r+"="+n.write(s,r)+l}}function i(r){if(!(typeof document>"u"||arguments.length&&!r)){for(var s=document.cookie?document.cookie.split("; "):[],o={},l=0;l<s.length;l++){var u=s[l].split("="),c=u.slice(1).join("=");try{var f=decodeURIComponent(u[0]);if(o[f]=n.read(c,f),r===f)break}catch{}}return r?o[r]:o}}return Object.create({set:t,get:i,remove:function(r,s){t(r,"",nu({},s,{expires:-1}))},withAttributes:function(r){return Ff(this.converter,nu({},this.attributes,r))},withConverter:function(r){return Ff(nu({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(n)}})}var Vf=Ff(UF,{path:"/"}),oi=function(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},vt=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},Fi,$a,ai,Qt,Sr;const GF=1e4;class HF{constructor(e){Fi.add(this),$a.set(this,void 0),ai.set(this,null),Qt.set(this,null),e.slice(-1)==="/"?oi(this,$a,e.slice(0,-1),"f"):oi(this,$a,e,"f")}get currentUser(){return vt(this,ai,"f")}get currentError(){return vt(this,Qt,"f")}async authenticate(e){oi(this,Qt,null,"f"),oi(this,ai,null,"f");const t=await vt(this,Fi,"m",Sr).call(this,e,"authenticate");return"error"in t?(Vf.remove("annotation-key"),Promise.resolve(vt(this,Qt,"f"))):(Vf.set("annotation-key",t.session,{secure:!0,expires:1}),oi(this,ai,t.data,"f"),Promise.resolve(vt(this,ai,"f")))}async unauthenticate(e){oi(this,Qt,null,"f"),oi(this,ai,null,"f");const t=await vt(this,Fi,"m",Sr).call(this,e,"unauthenticate");return"success"in t?Promise.resolve(t):Promise.resolve(vt(this,Qt,"f"))}async annotatedItemIds(e,t,i,r){const s={resource:t};i!==void 0&&(s.user=i),r!==void 0&&(s.participated=r);const o=await vt(this,Fi,"m",Sr).call(this,e,"items/","GET",s);return"error"in o?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(o)}async drawnFeatures(e,t,i){const r={resource:t};i!==void 0&&(r.items=i);const s=await vt(this,Fi,"m",Sr).call(this,e,"features/","GET",r);return"error"in s?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(s)}async itemAnnotations(e,t,i){const r=await vt(this,Fi,"m",Sr).call(this,e,"annotations/","GET",{resource:t,item:i});return"error"in r?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(r)}async annotation(e,t){const i=await vt(this,Fi,"m",Sr).call(this,e,"annotation/","GET",{annotation:t});return"error"in i?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(i)}async addAnnotation(e,t){if(vt(this,ai,"f")&&vt(this,ai,"f").canUpdate){const i=Object.assign({creator:vt(this,ai,"f"),created:new Date().toISOString()},t),r=await vt(this,Fi,"m",Sr).call(this,e,"annotation/","POST",{data:i});if(!("error"in r))return Promise.resolve(r);oi(this,Qt,r,"f")}else oi(this,Qt,{error:"user cannot add annotation"},"f");return Promise.resolve(vt(this,Qt,"f"))}}$a=new WeakMap,ai=new WeakMap,Qt=new WeakMap,Fi=new WeakSet,Sr=async function(e,t,i="GET",r={}){let s=!0;const o=new AbortController;setTimeout(()=>{s&&(console.log("Annotation server timeout..."),o.abort())},GF);const l={method:i,signal:o.signal};let u=`${vt(this,$a,"f")}/${t}`;const c=Vf.get("annotation-key")||"";if(i==="GET"){const d=[];for(const[p,y]of Object.entries(r))d.push(`${p}=${encodeURIComponent(JSON.stringify(y))}`);d.push(`key=${encodeURIComponent(e)}`),d.push(`session=${encodeURIComponent(c)}`),u+="?"+d.join("&"),l.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(i==="POST"){const d=Object.assign({key:e,session:c},r);l.body=JSON.stringify(d),l.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const f=await fetch(u,l);return s=!1,f.ok?Promise.resolve(await f.json()):(oi(this,Qt,{error:`${f.status} ${f.statusText}`},"f"),Promise.resolve(vt(this,Qt,"f")))};const Za={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},WF=function(n,e,t){this.eventType=n,this.identifiers=e,this.zincObjects=t},jF=function(n,e,t){this.targetedID=[];const i=n,r=e;this.targetEventType=t;const s=this;t===void 0&&(this.targetEventType=Za.ALL),this.getEventType=function(){return t},this.notify=function(o,l,u,c){if(o!==i&&(s.targetEventType===Za.ALL||s.targetEventType===l)){const f=new WF(l,u,c);r(f)}}},$F=function(){const n=[];this.publish=function(e,t,i,r){for(let s=0;s<n.length;s++)n[s].notify(e,t,i,r)},this.subscribe=function(e,t,i){if(typeof t=="function"){const r=new jF(e,t,i);return n.push(r),r}},this.unsubscribe=function(e){for(let t=0;t<n.length;t++)if(e===n[t]){n.splice(t,1);return}}},$x={isWebGLAvailable:function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(n){var e={1:"WebGL",2:"WebGL 2"},t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},i='This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.',r=document.createElement("div");return r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="20px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0",t[n]?i=i.replace("$0","graphics card"):i=i.replace("$0","browser"),i=i.replace("$1",e[n]),r.innerHTML=i,r}},kf={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},xn=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};xn.prototype.setName=function(n){if(n&&this.instanceName!==n){this.instanceName=n;const e=this.onChangedCallbacks.slice();for(let t=0;t<e.length;t++)e[t](this,kf.NAME_CHANGED)}},xn.prototype.settingsChanged=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,kf.SETTINGS_CHANGED)},xn.prototype.exportSettings=function(){const n={};return n.dialog=this.typeName,n.name=this.instanceName,n},xn.prototype.importSettings=function(n){return n.dialog==this.typeName?(this.setName(n.name),!0):!1},xn.prototype.publishChanges=function(n,e,t){for(let i=0;i<this.eventNotifiers.length;i++)this.eventNotifiers[i].publish(this,e,n,t)},xn.prototype.getName=function(){return this.instanceName},xn.prototype.destroy=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,kf.DESTROYED);delete this},xn.prototype.addChangedCallback=function(n){this.onChangedCallbacks.includes(n)==!1&&this.onChangedCallbacks.push(n)},xn.prototype.removeChangedCallback=function(n){const e=this.onChangedCallbacks.indexOf(n);e>-1&&this.onChangedCallbacks.splice(e,1)},xn.prototype.addNotifier=function(n){this.eventNotifiers.push(n)};const iu=(n,e,t)=>{for(let i=0;i<n.length;i++)if(n[i]&&n[i].material&&n[i].material.emissive){let r=n[i].userData;r&&r.isZincObject?r.setEmissiveRGB(e):n[i].material&&n[i].material.emissive&&n[i].material.emissive.setRGB(...e),t&&n[i].material.depthFunc&&(n[i].material.depthFunc=Mr.THREE.LessEqualDepth),n[i].children.forEach(s=>{const o=s.userData;o&&o.isZincObject&&s.material&&s.material.emissive&&s.material.emissive.setRGB(...e)})}},ZF=function(){let n=[],e=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const t=[],i=[],r=this,s=function(u,c){if(u.length==0&&c.length==0)return!1;for(let f=0;f<u.length;f++){let d=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(d=!0);if(!d)return!0}for(let f=0;f<c.length;f++){let d=!1;for(let p=0;p<u.length;p++)c[f]===u[p]&&(d=!0);if(!d)return!0}return!1},o=function(u,c){if(t.length=0,c.length==0)return u;for(let f=0;f<u.length;f++){let d=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(d=!0);d||t.push(u[f])}return t};this.setHighlighted=function(u){const c=[...n];r.resetHighlighted();const f=o(u,e),d=l(f);return iu(d,r.highlightColour,!1),n=f,s(n,c)},this.setSelected=function(u){const c=[...e];r.resetHighlighted(),r.resetSelected();const f=l(u);return iu(f,r.selectColour,!1),e=u,s(e,c)};const l=function(u){i.length=0;for(let c=0;c<u.length;c++)u[c].material&&i.push(u[c]);return i};this.resetHighlighted=function(){const u=l(n);iu(u,r.originalColour,!0),n=[]},this.resetSelected=function(){const u=l(e);iu(u,r.originalColour,!0),e=[]},this.getSelected=function(){return e},this.reset=function(){r.resetSelected(),r.resetHighlighted()}},zf=qc.THREE,XF=function(){const n=document.createElement("div");let e;if(n.style.height="100%",$x.isWebGLAvailable())e=new qc.Renderer(n,window),qc.defaultMaterialColor=16777116,e.initialiseVisualisation(),e.playAnimation=!1;else{const t=$x.getWebGLErrorMessage();n.appendChild(t)}return{Zinc:qc,renderer:e,container:n}},bt=function(){xn.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new ZF,this.selectObjectOnPick=!0,this.zincRenderer=null,this.selectedScreenCoordinates=new zf.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0,this.ignorePreviousSelected=!1};bt.prototype=Object.create(xn.prototype),bt.prototype.getIntersectedObject=function(n){if(n){const e=n.map(i=>{if(i&&i.object&&i.object.userData){if(i.object.userData.isMarker)return 1;if(i.object.name&&i.object.userData.isZincObject)return i.object.name==="_Unnamed"?3:2}return 0});let t=e.indexOf(1);return t>-1||(t=e.indexOf(2),t=t>-1?t:e.indexOf(3)),n[t]}},bt.prototype.getAnnotationsFromObjects=function(n){const e=[];for(var t=0;t<n.length;t++){const i=n[t].userData;let r;if(i){if(i.isGlyph||i.isGlyphset){let s=i;i.isGlyph&&(s=i.getGlyphset()),r=s.userData?s.userData.annotation:void 0,r&&r.data&&(n[t].name&&n[t].name!=""?r.data.id=n[t].name:r.data.id=s.groupName)}else r=i.userData?i.userData.annotation:void 0,r&&r.data&&(r.data.id=n[t].name);r&&(r.data.zincObject=i)}r&&e.push(r)}return e},bt.prototype.setHighlightedByObjects=function(n,e,t,i){const r=this.graphicsHighlight.setHighlighted(n),s=this.objectsToZincObjects(n);if(i){let o=Za.MOVE;r&&(o=Za.HIGHLIGHTED);const l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}return r},bt.prototype.setHighlightedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{s&&s.getMorph()&&r.push(s.getMorph())}),this.setHighlightedByObjects(r,e,t,i)},bt.prototype.setupLiveCoordinates=function(n){if(this.liveUpdatesObjects=n,n&&n.length>0){const e=this.scene.getBoundingBoxOfZincObjects(n);let t=new zf.Vector3;e?(e.getCenter(t),this.selectedCenter==null?this.selectedCenter=t:this.selectedCenter.copy(t)):this.selectedCenter=void 0}else this.selectedCenter=void 0},bt.prototype.objectsToZincObjects=function(n){const e=[];for(let t=0;t<n.length;t++){let i=n[t].userData;if(i)if(i.isGlyph||i.isGlyphset){let r=i;i.isGlyph&&(r=i.getGlyphset()),e.push(r)}else e.push(i)}return e},bt.prototype.setSelectedByObjects=function(n,e,t,i){let r=!1;if(this.selectObjectOnPick?r=this.graphicsHighlight.setSelected(n):r=!0,r||this.ignorePreviousSelected){const s=this.objectsToZincObjects(n);if(this.selectObjectOnPick&&this.setupLiveCoordinates(s),i){const o=Za.SELECTED,l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}}return r},bt.prototype.setSelectedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{if(s){const o=s.getMorph();o&&r.push(o)}}),this.setSelectedByObjects(r,e,t,i)},bt.prototype.findObjectsByGroupName=function(n){return this.scene.findObjectsWithGroupName(n)},bt.prototype.setHighlightedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setHighlightedByObjects(t,void 0,{},e)},bt.prototype.setSelectedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setSelectedByObjects(t,void 0,{},e)},bt.prototype.changeBackgroundColour=function(n){const e=new zf.Color(n);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(e,1)},bt.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},bt.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},bt.prototype.playAnimation=function(n){this.zincRenderer&&(this.zincRenderer.playAnimation=n)},bt.prototype.setPlayRate=function(n){this.zincRenderer&&this.zincRenderer.setPlayRate(n)},bt.prototype.getPlayRate=function(n){return this.zincRenderer?this.zincRenderer.getPlayRate():0},bt.prototype.initialiseRenderer=function(n){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let e=XF();this.Zinc=e.Zinc,this.zincRenderer=e.renderer,this.rendererContainer=e.container}n&&(this.displayArea=n,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},bt.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),xn.prototype.destroy.call(this)};const YF=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},JF=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.timeVarying=!1,this.currentTime=0},Zx=function(n){bt.call(this);const e=this;let t;this.sceneData=new JF;const i=new Array,r=new Array,s=new Array,o=new Array;let l,u;const c=n;this.NDCCameraControl=void 0,e.typeName="Organ Viewer",this.getSceneData=function(){return e.sceneData},this.updateTime=function(E){let P=6e3;e.scene&&(P=e.scene.getDuration());const A=E/100*P;e.sceneData.nerveMapIsActive||e.scene&&e.scene.setMorphsTime(A),e.sceneData.currentTime=E};const f=function(){let E=3e3;e.scene&&(E=e.scene.getDuration());const P=e.zincRenderer.getCurrentTime();for(let A=0;A<i.length;A++)i[A](P);!e.sceneData.nerveMapIsActive&&t&&t.setMorphsTime(P),e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setTime(P/E),e.sceneData.currentTime=P/E*100};this.getCurrentTime=function(){return e.sceneData.currentTime},this.toggleSyncControl=(E,P)=>{let A=this.scene.getZincCameraControls();E?(A.resetView(),this.NDCCameraControl=A.enableSyncControl(),A.setRotationMode(P)):(A.disableSyncControl(),this.NDCCameraControl=void 0,A.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=E=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(E,2)},this.setSyncControlCallback=E=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(E)},this.setSyncControlCenterZoom=(E,P)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(E,P)};const d=function(){if(e.zincRenderer.playAnimation&&e.liveUpdatesObjects&&e.setupLiveCoordinates(e.liveUpdatesObjects),e.selectedCenter){const E=new Mr.THREE.Vector3;E.copy(e.selectedCenter);const P=e.scene.vectorToScreenXY(E);e.selectedScreenCoordinates.x=P.x,e.selectedScreenCoordinates.y=P.y}},p=function(){return function(){f()}},y=function(){return function(){d()}};this.addTimeChangedCallback=function(E){i.push(E)},this.setTexturePos=function(E){e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setSliderPos(E)},this.addSceneChangedCallback=function(E){r.push(E)},this.addOrganPartAddedCallback=function(E){s.push(E)},this.addOrganPartRemovedCallback=function(E){o.push(E)},this.setFinishDownloadCallback=function(E){l=E},this.unsetFinishDownloadCallback=function(){l=void 0},this.setDownloadErrorCallback=function(E){u=E},this.unsetDownloadErrorCallback=function(){u=void 0},this.getNamedObjectsToScreenCoordinates=function(E,P){const A=new Mr.THREE.Vector3;A.setFromMatrixPosition(obj.matrixWorld);const R=width/2,L=height/2;return A.project(P),A.x=A.x*R+R,A.y=-(A.y*L)+L,A};const m=function(E){let P,A;if(E!==void 0){let R=!1;E.object.userData&&E.object.userData.isMarker?(R=!0,A=E.object.userData.parent.getMorph()):A=E.object;try{A.userData.userData.annotation.data.lastActionOnMarker=R}finally{}if(A)if(A.name)P=A.name;else{const L=e.getAnnotationsFromObjects([A]);L&&L[0]&&(P=L[0].data.group)}}return{id:P,object:A}},h=function(){return function(E,P,A){var O;const R=e.getIntersectedObject(E),L=m(R),N={worldCoords:[R?R.point.x:0,R?R.point.y:0,R?R.point.z:0],intersected:R,intersects:E},x={x:P,y:A};if(L.id){N.threeID=(O=L.object)==null?void 0:O.id,L.object.userData.isGlyph?L.object.name?e.setSelectedByObjects([L.object],x,N,!0):e.setSelectedByZincObjects(L.object.userData.getGlyphset(),x,N,!0):e.setSelectedByObjects([L.object],x,N,!0);return}else e.setSelectedByObjects([],x,N,!0)}},b=function(){return function(E,P,A){var O;const R=e.getIntersectedObject(E),L=m(R),N={worldCoords:[R?R.point.x:0,R?R.point.y:0,R?R.point.z:0]},x={x:P,y:A};if(L.id){N.threeID=(O=L.object)==null?void 0:O.id,e.displayArea.style.cursor="pointer",e.setHighlightedByObjects([L.object],x,N,!0);return}else e.displayArea.style.cursor="auto",e.setHighlightedByObjects([],x,N,!0)}},v=function(E,P,A,R){if(R=="all"||R=="geometries"){const L=E.findGeometriesWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}if(R=="all"||R=="glyphsets"){const L=E.findGlyphsetsWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}if(R=="all"||R=="pointsets"){const L=E.findPointsetsWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}if(R=="all"||R=="lines"){const L=E.findLinesWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}};this.changeGeometriesVisibility=function(E,P){v(e.scene,E,P,"geometries")},this.changeGlyphsetsVisibility=function(E,P){v(e.scene,E,P,"glyphsets")},this.changeLinesVisibility=function(E,P){v(e.scene,E,P,"lines")},this.changePointsetsVisibility=function(E,P){v(e.scene,E,P,"pointsets")},this.changeOrganPartsVisibility=function(E,P,A){let R="all";A!==void 0&&(R=A),v(e.scene,E,P,R)},this.changeOrganPartsVisibilityCallback=function(E){return function(P){e.changeOrganPartsVisibility(E,P)}},this.changeBackgroundColour=function(E){const P=new Mr.THREE.Color(E);e.zincRenderer&&e.zincRenderer.getThreeJSRenderer().setClearColor(P,1)};const g=function(E,P,A,R){for(let x=0;x<s.length;x++)s[x](R,e.scene.isTimeVarying());const L=new YF,N=R.region.getFullPath();L.data={species:e.sceneData.currentSpecies,system:E,part:P,group:R.groupName,region:N,uuid:R.uuid,lastActionOnMarker:!1},R.userData.annotation=L},w=function(E,P,A,R){for(let L=0;L<o.length;L++)o[L](R)},S=function(E,P,A){return function(R){g(E,P,A,R)}},T=function(E,P,A){return function(R){w(E,P,A,R)}},M=function(){return function(){e.settingsChanged(),e.sceneData.timeVarying=e.scene.isTimeVarying(),l&&l()}},_=function(){return function(E){if((E==null?void 0:E.type)==="Error"&&u){const P={xhr:E.xhr,type:"download-error"};u(P)}}};this.updateFieldvisibility=function(E,P){for(let A=0;A<E.length;A++)if(P!=A){const R=E[A].PartName;e.changeOrganPartsVisibility(R,!1)}if(P>-1){const A=E[P].PartName;if(e.scene.findGeometriesWithGroupName(A).length>0||e.scene.findGlyphsetsWithGroupName(A).length>0)e.changeOrganPartsVisibility(A,!0);else{const R=getOrganDetails(E[P].SystemName,A);R!=null&&e.scene.loadMetadataURL(c.getOrgansDirectoryPrefix()+"/"+R.meta)}}},this.getAvailableSpecies=function(E,P,A){const R=new Array;R.push("none");const L=Object.keys(organsFileMap);for(index in L){const N=L[index];N!=E&&organsFileMap[N].hasOwnProperty(P)&&organsFileMap[N][P].hasOwnProperty(A)&&R.push(N)}return R},this.getCentreAndSize=function(){const E=new Mr.THREE.Vector3,P=this.scene.getBoundingBox();P.getCenter(E);const A=[E.x,E.y,E.z];P.getSize(E);const R=[E.x,E.y,E.z];return{centre:A,size:R}};const C=function(E,P,A,R){e.sceneData.nerveMapIsActive=!1,e.sceneData.nerveMap=void 0,e.sceneData.metaURL="",e.sceneData.viewURL="",e.sceneData.currentSpecies=E,e.sceneData.currentSystem=P,e.sceneData.currentPart=A,e.sceneData.currentTime=0,e.sceneData.timeVarying=!1;let L="";E&&(L=E+"/"),P&&(L=P+"/"),A&&(L=A),e.sceneData.currentName=L};this.loadOrgansFromURL=function(E,P,A,R,L,N){if(e.zincRenderer&&R&&e.sceneData.metaURL!==E){C(P,A,R);const x=e.sceneData.currentName;let O=e.zincRenderer.getSceneByName(x);O?N&&O.clearAll():O=e.zincRenderer.createScene(x),e.selectObjectOnPick=!0;for(let F=0;F<r.length;F++)r[F](e.sceneData);L&&L!=""?(e.sceneData.viewURL=L,O.loadViewURL(e.sceneData.viewURL)):e.sceneData.viewURL=void 0,e.sceneData.metaURL=E,O.addZincObjectAddedCallbacks(S(A,R,!1)),O.addZincObjectRemovedCallbacks(T(void 0,R,!1)),O.loadMetadataURL(E,_(),M()),e.scene=O,e.zincRenderer.setCurrentScene(O),e.graphicsHighlight.reset();const B=O.getZincCameraControls();B.enableRaycaster(O,h(),b()),B.setMouseButtonAction("AUXILIARY","ZOOM"),B.setMouseButtonAction("SECONDARY","PAN")}},this.loadGLTFFromURL=function(E,P,A){if(e.zincRenderer&&P&&e.sceneData.metaURL!==E){C(void 0,void 0,P);const R=e.sceneData.currentName;let L=e.zincRenderer.getSceneByName(R);L?A&&L.clearAll():L=e.zincRenderer.createScene(R);for(let x=0;x<r.length;x++)r[x](e.sceneData);e.sceneData.viewURL=void 0,e.sceneData.metaURL=E,L.addZincObjectAddedCallbacks(S(void 0,P,!1)),L.addZincObjectRemovedCallbacks(T(void 0,P,!1)),L.loadGLTF(E,void 0,M()),e.scene=L,e.zincRenderer.setCurrentScene(L),e.graphicsHighlight.reset();const N=L.getZincCameraControls();N.enableRaycaster(L,h(),b()),N.setMouseButtonAction("AUXILIARY","ZOOM"),N.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(E){const P=e.graphicsHighlight.getSelected();P&&P[0]&&P[0].userData&&e.scene.alignObjectToCameraView(P[0].userData,E)},this.exportSettings=function(){const E={};return E.name=e.instanceName,e.sceneData.currentSystem&&(E.system=e.sceneData.currentSystem),e.sceneData.currentSpecies&&(E.species=e.sceneData.currentSpecies),e.sceneData.currentPart&&(E.part=e.sceneData.currentPart),E.metaURL=e.sceneData.metaURL,e.sceneData.viewURL&&(E.viewURL=e.sceneData.viewURL),E.dialog="Organ Viewer",E},this.importSettings=function(E){return E&&E.dialog==this.typeName?(e.setName(E.name),E.metaURL!==void 0&&E.metaURL!=""?e.loadOrgansFromURL(E.metaURL,E.species,E.system,E.part,E.viewURL,!0):e.loadOrgans(E.species,E.system,E.part),!0):!1},function(){e.initialiseRenderer(void 0),e.zincRenderer&&(e.zincRenderer.addPreRenderCallbackFunction(p()),e.zincRenderer.addPostRenderCallbackFunction(y()))}()};Zx.prototype=Object.create(bt.prototype);var at=function(){return at=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},at.apply(this,arguments)};function KF(n,e,t,i){function r(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function l(f){try{c(i.next(f))}catch(d){o(d)}}function u(f){try{c(i.throw(f))}catch(d){o(d)}}function c(f){f.done?s(f.value):r(f.value).then(l,u)}c((i=i.apply(n,[])).next())})}function qF(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(c){return function(f){return u([c,f])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(i=1,r&&(s=c[0]&2?r.return:c[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;switch(r=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,r=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(f){c=[6,f],r=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Xe(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Rt(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),r,s=[],o;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}typeof SuppressedError=="function"&&SuppressedError;var QF="ENTRIES",Xx="KEYS",Yx="VALUES",Yt="",Uf=function(){function n(e,t){var i=e._tree,r=Array.from(i.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:i,keys:r}]:[]}return n.prototype.next=function(){var e=this.dive();return this.backtrack(),e},n.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=Po(this._path),t=e.node,i=e.keys;if(Po(i)===Yt)return{done:!1,value:this.result()};var r=t.get(Po(i));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},n.prototype.backtrack=function(){if(this._path.length!==0){var e=Po(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},n.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return Po(t)}).filter(function(e){return e!==Yt}).join("")},n.prototype.value=function(){return Po(this._path).node.get(Yt)},n.prototype.result=function(){switch(this._type){case Yx:return this.value();case Xx:return this.key();default:return[this.key(),this.value()]}},n.prototype[Symbol.iterator]=function(){return this},n}(),Po=function(n){return n[n.length-1]},eV=function(n,e,t){var i=new Map;if(e===void 0)return i;for(var r=e.length+1,s=r+t,o=new Uint8Array(s*r).fill(t+1),l=0;l<r;++l)o[l]=l;for(var u=1;u<s;++u)o[u*r]=u;return Jx(n,e,t,i,o,1,r,""),i},Jx=function(n,e,t,i,r,s,o,l){var u,c,f=s*o;try{e:for(var d=Xe(n.keys()),p=d.next();!p.done;p=d.next()){var y=p.value;if(y===Yt){var m=r[f-1];m<=t&&i.set(l,[n.get(y),m])}else{for(var h=s,b=0;b<y.length;++b,++h){for(var v=y[b],g=o*h,w=g-o,S=r[g],T=Math.max(0,h-t-1),M=Math.min(o-1,h+t),_=T;_<M;++_){var C=v!==e[_],I=r[w+_]+ +C,E=r[w+_+1]+1,P=r[g+_]+1,A=r[g+_+1]=Math.min(I,E,P);A<S&&(S=A)}if(S>t)continue e}Jx(n.get(y),e,t,i,r,h,o,l+y)}}}catch(R){u={error:R}}finally{try{p&&!p.done&&(c=d.return)&&c.call(d)}finally{if(u)throw u.error}}},Gf=function(){function n(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return n.prototype.atPrefix=function(e){var t,i;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var r=Rt(ru(this._tree,e.slice(this._prefix.length)),2),s=r[0],o=r[1];if(s===void 0){var l=Rt(jf(o),2),u=l[0],c=l[1];try{for(var f=Xe(u.keys()),d=f.next();!d.done;d=f.next()){var p=d.value;if(p!==Yt&&p.startsWith(c)){var y=new Map;return y.set(p.slice(c.length),u.get(p)),new n(y,e)}}}catch(m){t={error:m}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(t)throw t.error}}}return new n(s,e)},n.prototype.clear=function(){this._size=void 0,this._tree.clear()},n.prototype.delete=function(e){return this._size=void 0,tV(this._tree,e)},n.prototype.entries=function(){return new Uf(this,QF)},n.prototype.forEach=function(e){var t,i;try{for(var r=Xe(this),s=r.next();!s.done;s=r.next()){var o=Rt(s.value,2),l=o[0],u=o[1];e(l,u,this)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.fuzzyGet=function(e,t){return eV(this._tree,e,t)},n.prototype.get=function(e){var t=Hf(this._tree,e);return t!==void 0?t.get(Yt):void 0},n.prototype.has=function(e){var t=Hf(this._tree,e);return t!==void 0&&t.has(Yt)},n.prototype.keys=function(){return new Uf(this,Xx)},n.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Wf(this._tree,e);return i.set(Yt,t),this},Object.defineProperty(n.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),n.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Wf(this._tree,e);return i.set(Yt,t(i.get(Yt))),this},n.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Wf(this._tree,e),r=i.get(Yt);return r===void 0&&i.set(Yt,r=t()),r},n.prototype.values=function(){return new Uf(this,Yx)},n.prototype[Symbol.iterator]=function(){return this.entries()},n.from=function(e){var t,i,r=new n;try{for(var s=Xe(e),o=s.next();!o.done;o=s.next()){var l=Rt(o.value,2),u=l[0],c=l[1];r.set(u,c)}}catch(f){t={error:f}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},n.fromObject=function(e){return n.from(Object.entries(e))},n}(),ru=function(n,e,t){var i,r;if(t===void 0&&(t=[]),e.length===0||n==null)return[n,t];try{for(var s=Xe(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==Yt&&e.startsWith(l))return t.push([n,l]),ru(n.get(l),e.slice(l.length),t)}}catch(u){i={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return t.push([n,e]),ru(void 0,"",t)},Hf=function(n,e){var t,i;if(e.length===0||n==null)return n;try{for(var r=Xe(n.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;if(o!==Yt&&e.startsWith(o))return Hf(n.get(o),e.slice(o.length))}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},Wf=function(n,e){var t,i,r=e.length;e:for(var s=0;n&&s<r;){try{for(var o=(t=void 0,Xe(n.keys())),l=o.next();!l.done;l=o.next()){var u=l.value;if(u!==Yt&&e[s]===u[0]){for(var c=Math.min(r-s,u.length),f=1;f<c&&e[s+f]===u[f];)++f;var d=n.get(u);if(f===u.length)n=d;else{var p=new Map;p.set(u.slice(f),d),n.set(e.slice(s,s+f),p),n.delete(u),n=p}s+=f;continue e}}}catch(m){t={error:m}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}var y=new Map;return n.set(e.slice(s),y),y}return n},tV=function(n,e){var t=Rt(ru(n,e),2),i=t[0],r=t[1];if(i!==void 0){if(i.delete(Yt),i.size===0)Kx(r);else if(i.size===1){var s=Rt(i.entries().next().value,2),o=s[0],l=s[1];qx(r,o,l)}}},Kx=function(n){if(n.length!==0){var e=Rt(jf(n),2),t=e[0],i=e[1];if(t.delete(i),t.size===0)Kx(n.slice(0,-1));else if(t.size===1){var r=Rt(t.entries().next().value,2),s=r[0],o=r[1];s!==Yt&&qx(n.slice(0,-1),s,o)}}},qx=function(n,e,t){if(n.length!==0){var i=Rt(jf(n),2),r=i[0],s=i[1];r.set(s+e,t),r.delete(s)}},jf=function(n){return n[n.length-1]},Xa,$f="or",Qx="and",nV="and_not",iV=function(){function n(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');var t=e.autoVacuum==null||e.autoVacuum===!0?Kf:e.autoVacuum;this._options=at(at(at({},Xf),e),{autoVacuum:t,searchOptions:at(at({},ew),e.searchOptions||{}),autoSuggestOptions:at(at({},lV),e.autoSuggestOptions||{})}),this._index=new Gf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Jf,this.addFields(this._options.fields)}return n.prototype.add=function(e){var t,i,r,s,o,l,u=this._options,c=u.extractField,f=u.tokenize,d=u.processTerm,p=u.fields,y=u.idField,m=c(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));if(this._idToShortId.has(m))throw new Error("MiniSearch: duplicate ID ".concat(m));var h=this.addDocumentId(m);this.saveStoredFields(h,e);try{for(var b=Xe(p),v=b.next();!v.done;v=b.next()){var g=v.value,w=c(e,g);if(w!=null){var S=f(w.toString(),g),T=this._fieldIds[g],M=new Set(S).size;this.addFieldLength(h,T,this._documentCount-1,M);try{for(var _=(r=void 0,Xe(S)),C=_.next();!C.done;C=_.next()){var I=C.value,E=d(I,g);if(Array.isArray(E))try{for(var P=(o=void 0,Xe(E)),A=P.next();!A.done;A=P.next()){var R=A.value;this.addTerm(T,h,R)}}catch(L){o={error:L}}finally{try{A&&!A.done&&(l=P.return)&&l.call(P)}finally{if(o)throw o.error}}else E&&this.addTerm(T,h,E)}}catch(L){r={error:L}}finally{try{C&&!C.done&&(s=_.return)&&s.call(_)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}},n.prototype.addAll=function(e){var t,i;try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.add(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.addAllAsync=function(e,t){var i=this;t===void 0&&(t={});var r=t.chunkSize,s=r===void 0?10:r,o={chunk:[],promise:Promise.resolve()},l=e.reduce(function(f,d,p){var y=f.chunk,m=f.promise;return y.push(d),(p+1)%s===0?{chunk:[],promise:m.then(function(){return new Promise(function(h){return setTimeout(h,0)})}).then(function(){return i.addAll(y)})}:{chunk:y,promise:m}},o),u=l.chunk,c=l.promise;return c.then(function(){return i.addAll(u)})},n.prototype.remove=function(e){var t,i,r,s,o,l,u=this._options,c=u.tokenize,f=u.processTerm,d=u.extractField,p=u.fields,y=u.idField,m=d(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));var h=this._idToShortId.get(m);if(h==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(m,": it is not in the index"));try{for(var b=Xe(p),v=b.next();!v.done;v=b.next()){var g=v.value,w=d(e,g);if(w!=null){var S=c(w.toString(),g),T=this._fieldIds[g],M=new Set(S).size;this.removeFieldLength(h,T,this._documentCount,M);try{for(var _=(r=void 0,Xe(S)),C=_.next();!C.done;C=_.next()){var I=C.value,E=f(I,g);if(Array.isArray(E))try{for(var P=(o=void 0,Xe(E)),A=P.next();!A.done;A=P.next()){var R=A.value;this.removeTerm(T,h,R)}}catch(L){o={error:L}}finally{try{A&&!A.done&&(l=P.return)&&l.call(P)}finally{if(o)throw o.error}}else E&&this.removeTerm(T,h,E)}}catch(L){r={error:L}}finally{try{C&&!C.done&&(s=_.return)&&s.call(_)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}this._storedFields.delete(h),this._documentIds.delete(h),this._idToShortId.delete(m),this._fieldLength.delete(h),this._documentCount-=1},n.prototype.removeAll=function(e){var t,i;if(e)try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.remove(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Gf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},n.prototype.discard=function(e){var t=this,i=this._idToShortId.get(e);if(i==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(i),this._storedFields.delete(i),(this._fieldLength.get(i)||[]).forEach(function(r,s){t.removeFieldLength(i,s,t._documentCount,r)}),this._fieldLength.delete(i),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},n.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,i=e.minDirtCount,r=e.batchSize,s=e.batchWait;this.conditionalVacuum({batchSize:r,batchWait:s},{minDirtCount:i,minDirtFactor:t})}},n.prototype.discardAll=function(e){var t,i,r=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var s=Xe(e),o=s.next();!o.done;o=s.next()){var l=o.value;this.discard(l)}}catch(u){t={error:u}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=r}this.maybeAutoVacuum()},n.prototype.replace=function(e){var t=this._options,i=t.idField,r=t.extractField,s=r(e,i);this.discard(s),this.add(e)},n.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},n.prototype.conditionalVacuum=function(e,t){var i=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var r=i._enqueuedVacuumConditions;return i._enqueuedVacuumConditions=Jf,i.performVacuuming(e,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},n.prototype.performVacuuming=function(e,t){return KF(this,void 0,void 0,function(){var i,r,s,o,l,u,c,f,d,p,y,m,h,b,v,g,w,S,T,M,_,C,I,E,P;return qF(this,function(A){switch(A.label){case 0:if(i=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];r=e.batchSize||Yf.batchSize,s=e.batchWait||Yf.batchWait,o=1,A.label=1;case 1:A.trys.push([1,7,8,9]),l=Xe(this._index),u=l.next(),A.label=2;case 2:if(u.done)return[3,6];c=Rt(u.value,2),f=c[0],d=c[1];try{for(p=(C=void 0,Xe(d)),y=p.next();!y.done;y=p.next()){m=Rt(y.value,2),h=m[0],b=m[1];try{for(v=(E=void 0,Xe(b)),g=v.next();!g.done;g=v.next())w=Rt(g.value,1),S=w[0],!this._documentIds.has(S)&&(b.size<=1?d.delete(h):b.delete(S))}catch(R){E={error:R}}finally{try{g&&!g.done&&(P=v.return)&&P.call(v)}finally{if(E)throw E.error}}}}catch(R){C={error:R}}finally{try{y&&!y.done&&(I=p.return)&&I.call(p)}finally{if(C)throw C.error}}return this._index.get(f).size===0&&this._index.delete(f),o%r!==0?[3,4]:[4,new Promise(function(R){return setTimeout(R,s)})];case 3:A.sent(),A.label=4;case 4:o+=1,A.label=5;case 5:return u=l.next(),[3,2];case 6:return[3,9];case 7:return T=A.sent(),M={error:T},[3,9];case 8:try{u&&!u.done&&(_=l.return)&&_.call(l)}finally{if(M)throw M.error}return[7];case 9:this._dirtCount-=i,A.label=10;case 10:return[4,null];case 11:return A.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},n.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,i=e.minDirtFactor;return t=t||Kf.minDirtCount,i=i||Kf.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=i},Object.defineProperty(n.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),n.prototype.has=function(e){return this._idToShortId.has(e)},n.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},n.prototype.search=function(e,t){var i,r;t===void 0&&(t={});var s=this.executeQuery(e,t),o=[];try{for(var l=Xe(s),u=l.next();!u.done;u=l.next()){var c=Rt(u.value,2),f=c[0],d=c[1],p=d.score,y=d.terms,m=d.match,h=y.length||1,b={id:this._documentIds.get(f),score:p*h,terms:Object.keys(m),queryTerms:y,match:m};Object.assign(b,this._storedFields.get(f)),(t.filter==null||t.filter(b))&&o.push(b)}}catch(v){i={error:v}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}return e===n.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||o.sort(nw),o},n.prototype.autoSuggest=function(e,t){var i,r,s,o;t===void 0&&(t={}),t=at(at({},this._options.autoSuggestOptions),t);var l=new Map;try{for(var u=Xe(this.search(e,t)),c=u.next();!c.done;c=u.next()){var f=c.value,d=f.score,p=f.terms,y=p.join(" "),m=l.get(y);m!=null?(m.score+=d,m.count+=1):l.set(y,{score:d,terms:p,count:1})}}catch(T){i={error:T}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}var h=[];try{for(var b=Xe(l),v=b.next();!v.done;v=b.next()){var g=Rt(v.value,2),m=g[0],w=g[1],d=w.score,p=w.terms,S=w.count;h.push({suggestion:m,terms:p,score:d/S})}}catch(T){s={error:T}}finally{try{v&&!v.done&&(o=b.return)&&o.call(b)}finally{if(s)throw s.error}}return h.sort(nw),h},Object.defineProperty(n.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),n.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},n.getDefault=function(e){if(Xf.hasOwnProperty(e))return Zf(Xf,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},n.loadJS=function(e,t){var i,r,s,o,l,u,c=e.index,f=e.documentCount,d=e.nextId,p=e.documentIds,y=e.fieldIds,m=e.fieldLength,h=e.averageFieldLength,b=e.storedFields,v=e.dirtCount,g=e.serializationVersion;if(g!==1&&g!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new n(t);w._documentCount=f,w._nextId=d,w._documentIds=su(p),w._idToShortId=new Map,w._fieldIds=y,w._fieldLength=su(m),w._avgFieldLength=h,w._storedFields=su(b),w._dirtCount=v||0,w._index=new Gf;try{for(var S=Xe(w._documentIds),T=S.next();!T.done;T=S.next()){var M=Rt(T.value,2),_=M[0],C=M[1];w._idToShortId.set(C,_)}}catch(F){i={error:F}}finally{try{T&&!T.done&&(r=S.return)&&r.call(S)}finally{if(i)throw i.error}}try{for(var I=Xe(c),E=I.next();!E.done;E=I.next()){var P=Rt(E.value,2),A=P[0],R=P[1],L=new Map;try{for(var N=(l=void 0,Xe(Object.keys(R))),x=N.next();!x.done;x=N.next()){var O=x.value,B=R[O];g===1&&(B=B.ds),L.set(parseInt(O,10),su(B))}}catch(F){l={error:F}}finally{try{x&&!x.done&&(u=N.return)&&u.call(N)}finally{if(l)throw l.error}}w._index.set(A,L)}}catch(F){s={error:F}}finally{try{E&&!E.done&&(o=I.return)&&o.call(I)}finally{if(s)throw s.error}}return w},n.prototype.executeQuery=function(e,t){var i=this;if(t===void 0&&(t={}),e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var r=at(at(at({},t),e),{queries:void 0}),s=e.queries.map(function(b){return i.executeQuery(b,r)});return this.combineResults(s,r.combineWith)}var o=this._options,l=o.tokenize,u=o.processTerm,c=o.searchOptions,f=at(at({tokenize:l,processTerm:u},c),t),d=f.tokenize,p=f.processTerm,y=d(e).flatMap(function(b){return p(b)}).filter(function(b){return!!b}),m=y.map(aV(f)),h=m.map(function(b){return i.executeQuerySpec(b,f)});return this.combineResults(h,f.combineWith)},n.prototype.executeQuerySpec=function(e,t){var i,r,s,o,l=at(at({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce(function(O,B){var F;return at(at({},O),(F={},F[B]=Zf(l.boost,B)||1,F))},{}),c=l.boostDocument,f=l.weights,d=l.maxFuzzy,p=l.bm25,y=at(at({},ew.weights),f),m=y.fuzzy,h=y.prefix,b=this._index.get(e.term),v=this.termResults(e.term,e.term,1,b,u,c,p),g,w;if(e.prefix&&(g=this._index.atPrefix(e.term)),e.fuzzy){var S=e.fuzzy===!0?.2:e.fuzzy,T=S<1?Math.min(d,Math.round(e.term.length*S)):S;T&&(w=this._index.fuzzyGet(e.term,T))}if(g)try{for(var M=Xe(g),_=M.next();!_.done;_=M.next()){var C=Rt(_.value,2),I=C[0],E=C[1],P=I.length-e.term.length;if(P){w==null||w.delete(I);var A=h*I.length/(I.length+.3*P);this.termResults(e.term,I,A,E,u,c,p,v)}}}catch(O){i={error:O}}finally{try{_&&!_.done&&(r=M.return)&&r.call(M)}finally{if(i)throw i.error}}if(w)try{for(var R=Xe(w.keys()),L=R.next();!L.done;L=R.next()){var I=L.value,N=Rt(w.get(I),2),x=N[0],P=N[1];if(P){var A=m*I.length/(I.length+P);this.termResults(e.term,I,A,x,u,c,p,v)}}}catch(O){s={error:O}}finally{try{L&&!L.done&&(o=R.return)&&o.call(R)}finally{if(s)throw s.error}}return v},n.prototype.executeWildcardQuery=function(e){var t,i,r=new Map,s=at(at({},this._options.searchOptions),e);try{for(var o=Xe(this._documentIds),l=o.next();!l.done;l=o.next()){var u=Rt(l.value,2),c=u[0],f=u[1],d=s.boostDocument?s.boostDocument(f,"",this._storedFields.get(c)):1;r.set(c,{score:d,terms:[],match:{}})}}catch(p){t={error:p}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return r},n.prototype.combineResults=function(e,t){if(t===void 0&&(t=$f),e.length===0)return new Map;var i=t.toLowerCase();return e.reduce(rV[i])||new Map},n.prototype.toJSON=function(){var e,t,i,r,s=[];try{for(var o=Xe(this._index),l=o.next();!l.done;l=o.next()){var u=Rt(l.value,2),c=u[0],f=u[1],d={};try{for(var p=(i=void 0,Xe(f)),y=p.next();!y.done;y=p.next()){var m=Rt(y.value,2),h=m[0],b=m[1];d[h]=Object.fromEntries(b)}}catch(v){i={error:v}}finally{try{y&&!y.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}s.push([c,d])}}catch(v){e={error:v}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:s,serializationVersion:2}},n.prototype.termResults=function(e,t,i,r,s,o,l,u){var c,f,d,p,y;if(u===void 0&&(u=new Map),r==null)return u;try{for(var m=Xe(Object.keys(s)),h=m.next();!h.done;h=m.next()){var b=h.value,v=s[b],g=this._fieldIds[b],w=r.get(g);if(w!=null){var S=w.size,T=this._avgFieldLength[g];try{for(var M=(d=void 0,Xe(w.keys())),_=M.next();!_.done;_=M.next()){var C=_.value;if(!this._documentIds.has(C)){this.removeTerm(g,C,t),S-=1;continue}var I=o?o(this._documentIds.get(C),t,this._storedFields.get(C)):1;if(I){var E=w.get(C),P=this._fieldLength.get(C)[g],A=oV(E,S,this._documentCount,P,T,l),R=i*v*I*A,L=u.get(C);if(L){L.score+=R,cV(L.terms,e);var N=Zf(L.match,t);N?N.push(b):L.match[t]=[b]}else u.set(C,{score:R,terms:[e],match:(y={},y[t]=[b],y)})}}}catch(x){d={error:x}}finally{try{_&&!_.done&&(p=M.return)&&p.call(M)}finally{if(d)throw d.error}}}}}catch(x){c={error:x}}finally{try{h&&!h.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}return u},n.prototype.addTerm=function(e,t,i){var r=this._index.fetch(i,iw),s=r.get(e);if(s==null)s=new Map,s.set(t,1),r.set(e,s);else{var o=s.get(t);s.set(t,(o||0)+1)}},n.prototype.removeTerm=function(e,t,i){if(!this._index.has(i)){this.warnDocumentChanged(t,e,i);return}var r=this._index.fetch(i,iw),s=r.get(e);s==null||s.get(t)==null?this.warnDocumentChanged(t,e,i):s.get(t)<=1?s.size<=1?r.delete(e):s.delete(t):s.set(t,s.get(t)-1),this._index.get(i).size===0&&this._index.delete(i)},n.prototype.warnDocumentChanged=function(e,t,i){var r,s;try{for(var o=Xe(Object.keys(this._fieldIds)),l=o.next();!l.done;l=o.next()){var u=l.value;if(this._fieldIds[u]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(i,'" was not present in field "').concat(u,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(c){r={error:c}}finally{try{l&&!l.done&&(s=o.return)&&s.call(o)}finally{if(r)throw r.error}}},n.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},n.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},n.prototype.addFieldLength=function(e,t,i,r){var s=this._fieldLength.get(e);s==null&&this._fieldLength.set(e,s=[]),s[t]=r;var o=this._avgFieldLength[t]||0,l=o*i+r;this._avgFieldLength[t]=l/(i+1)},n.prototype.removeFieldLength=function(e,t,i,r){if(i===1){this._avgFieldLength[t]=0;return}var s=this._avgFieldLength[t]*i-r;this._avgFieldLength[t]=s/(i-1)},n.prototype.saveStoredFields=function(e,t){var i,r,s=this._options,o=s.storeFields,l=s.extractField;if(!(o==null||o.length===0)){var u=this._storedFields.get(e);u==null&&this._storedFields.set(e,u={});try{for(var c=Xe(o),f=c.next();!f.done;f=c.next()){var d=f.value,p=l(t,d);p!==void 0&&(u[d]=p)}}catch(y){i={error:y}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(i)throw i.error}}}},n.wildcard=Symbol("*"),n}(),Zf=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0},rV=(Xa={},Xa[$f]=function(n,e){var t,i;try{for(var r=Xe(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value,l=n.get(o);if(l==null)n.set(o,e.get(o));else{var u=e.get(o),c=u.score,f=u.terms,d=u.match;l.score=l.score+c,l.match=Object.assign(l.match,d),tw(l.terms,f)}}}catch(p){t={error:p}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Xa[Qx]=function(n,e){var t,i,r=new Map;try{for(var s=Xe(e.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,u=n.get(l);if(u!=null){var c=e.get(l),f=c.score,d=c.terms,p=c.match;tw(u.terms,d),r.set(l,{score:u.score+f,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(y){t={error:y}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},Xa[nV]=function(n,e){var t,i;try{for(var r=Xe(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;n.delete(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Xa),sV={k:1.2,b:.7,d:.5},oV=function(n,e,t,i,r,s){var o=s.k,l=s.b,u=s.d,c=Math.log(1+(t-e+.5)/(e+.5));return c*(u+n*(o+1)/(n+o*(1-l+l*i/r)))},aV=function(n){return function(e,t,i){var r=typeof n.fuzzy=="function"?n.fuzzy(e,t,i):n.fuzzy||!1,s=typeof n.prefix=="function"?n.prefix(e,t,i):n.prefix===!0;return{term:e,fuzzy:r,prefix:s}}},Xf={idField:"id",extractField:function(n,e){return n[e]},tokenize:function(n){return n.split(uV)},processTerm:function(n){return n.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[],logger:function(n,e){typeof(console==null?void 0:console[n])=="function"&&console[n](e)},autoVacuum:!0},ew={combineWith:$f,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:sV},lV={combineWith:Qx,prefix:function(n,e,t){return e===t.length-1}},Yf={batchSize:1e3,batchWait:10},Jf={minDirtFactor:.1,minDirtCount:20},Kf=at(at({},Yf),Jf),cV=function(n,e){n.includes(e)||n.push(e)},tw=function(n,e){var t,i;try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;n.includes(o)||n.push(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},nw=function(n,e){var t=n.score,i=e.score;return i-t},iw=function(){return new Map},su=function(n){var e,t,i=new Map;try{for(var r=Xe(Object.keys(n)),s=r.next();!s.done;s=r.next()){var o=s.value;i.set(parseInt(o,10),n[o])}}catch(l){e={error:l}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return i},uV=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;class dV{constructor(){this._searchEngine=new iV({fields:["path","name"],storeFields:["path"],tokenize:(e,t)=>e.split(/[\s/]+/)}),this.idMaps={}}addZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.add(o),this.idMaps[t]={path:s,zincObject:e}}removeZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.remove(o),delete this.idMaps[t]}addRegion(e,t){let i=e.getFullPath(),r=e.getName();i=i.replaceAll('"',""),r=r.replaceAll('"',"");const s={path:i,name:r,id:t};this._searchEngine.add(s),this.idMaps[t]={path:i,zincObject:e}}clearResults(){this._}removeAll(){this._searchEngine.removeAll(),this.idMaps={}}auto_suggest(e){let t=[];e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];t.forEach(o=>{o.id in this.idMaps&&i.push(this.idMaps[o.id].path)});const r=[...new Set(i)],s=[];return r.forEach(o=>s.push({suggestion:'"'+o+'"'})),s}processResults(e,t){const i={regionPath:void 0,label:'Search Results for "'};return Array.isArray(t)?i.label+=",".join(t):i.label+=t,i.label+='"',e.length===1&&(e[0].isRegion?i.regionPath=e[0].getFullPath():e[0].isZincObject&&(i.regionPath=e[0].getRegion().getFullPath(),i.label=e[0].groupName)),i.zincObjects=uF(e),i}search(e){let t;e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];return t.forEach(r=>{r.id in this.idMaps&&i.push(this.idMaps[r.id].zincObject)}),i}searchTerms(e){let t=[];return e.forEach(i=>{const r=this.search(i);t.push(...r)}),t}searchAndProcessResult(e){let t=[];return Array.isArray(e)?t=this.searchTerms(e):t=this.search(e),this.processResults(t,e)}}const hV={name:"ScaffoldVuer",components:{Button:Cs,Col:On,Loading:YR,Option:Rs,Popover:Pl,Row:Jn,Select:As,Slider:En,TabPane:Hg,Tabs:Gg,MapSvgIcon:qf.MapSvgIcon,MapSvgSpriteColor:qf.MapSvgSpriteColor,PrimitiveControls:Dx,ScaffoldTooltip:jx,ElIconWarningFilled:om,ElIconArrowDown:Ru,ElIconArrowLeft:Hi,DrawToolbar:Ja.DrawToolbar,ScaffoldTreeControls:Bx},setup(n){let e=a.inject("$annotator");return e||(e=a.markRaw(new HF(`${n.flatmapAPI}annotator`)),a.provide("$annotator",e)),{annotator:e}},props:{annotationSidebar:{type:Boolean,default:!1},url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},displayWarning:{type:Boolean,default:!0},warningMessage:{type:String,default:"Beta feature - under active development"},displayLatestChanges:{type:Boolean,default:!1},latestChangesMessage:{type:String,default:"New feature - Local search is now available"},displayMarkers:{type:Boolean,default:!1},markerCluster:{type:Boolean,default:!1},markerLabels:{type:Object,default:function(){return{}}},displayMinimap:{type:Boolean,default:!1},format:{type:String,default:"metadata"},minimapSettings:{type:Object,default:function(){return{x_offset:16,y_offset:16,width:128,height:128,align:"top-right"}}},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},state:{type:Object,default:void 0},region:{type:String,default:""},viewURL:{type:String,default:""},render:{type:Boolean,default:!0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"}},provide(){return{flatmapAPI:this.flatmapAPI,scaffoldUrl:this.url,boundingDims:this.boundingDims}},data:function(){return{annotator:void 0,createData:{drawingBox:!1,toBeConfirmed:!1,points:[],shape:"",x:0,y:0,editingIndex:-1,faceIndex:-1,toBeDeleted:!1},currentTime:0,timeVarying:!1,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"sliderPopover"},{value:!1,ref:"regionVisibilityPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"}],inHelp:!1,helpModeActiveIndex:this.helpModeInitialIndex,loading:!1,duration:3e3,drawerOpen:!0,currentBackground:"white",availableBackground:["white","lightskyblue","black"],minimisedSlider:!1,sliderPosition:"",timeMax:100,orginalDuration:"",animateDuration:"6secs",playSpeed:[{value:.1,label:"0.1x"},{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],currentSpeed:1,timeStamps:{},defaultCheckedKeys:[],tData:{label:"",region:"",visible:!1,x:200,y:200,active:!1},fileFormat:"metadata",previousMarkerLabels:a.markRaw({}),viewingMode:"Exploration",viewingModes:{Exploration:"View and explore detailed visualization of 3D scaffolds",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},openMapRef:void 0,backgroundIconRef:void 0,annotationFeature:{},offlineAnnotationEnabled:!1,offlineAnnotations:a.markRaw([]),authorisedUser:void 0,toolbarOptions:["Delete","Edit","Point","LineString"],existDrawnFeatures:a.markRaw([]),activeDrawTool:void 0,activeDrawMode:void 0,boundingDims:{centre:[0,0,0],size:[1,1,1]},lastSelected:a.markRaw({region:"",group:"",isSearch:!1})}},watch:{format:{handler:function(n){this.fileFormat=n},immediate:!0},url:{handler:function(n){(this.state===void 0||this.state.url===void 0)&&this.setURL(n)},immediate:!0},region:{handler:function(n){this.state||this.viewURL||this.setFocusedRegion(n)},immediate:!0},state:{handler:function(n){this.setState(n)},immediate:!0,deep:!0},viewURL:{handler:function(n){this.updateViewURL(n)},immediate:!0},helpMode:function(n,e){n!==e&&this.setHelpMode(n)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},displayMarkers:function(n){this.$module.scene.displayMarkers=n,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(n){this.$module.scene.displayMinimap=n},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(n){this.toggleRendering(n)},markerCluster:{handler:function(n){this.$module.scene.enableMarkerCluster(n)},immediate:!0},markerLabels:function(n){for(const[e,t]of Object.entries(this.previousMarkerLabels))this.setMarkerModeForObjectsWithName(e,t,"off");for(const[e,t]of Object.entries(n))this.setMarkerModeForObjectsWithName(e,t,"on");this.previousMarkerLabels=a.markRaw({...n})}},beforeCreate:function(){this.$module=new Zx,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new dV},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.$refs.scaffoldTreeControls.setModule(this.$module);let n=new $F;n.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(n),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer),this.helpTextWait=[],this.helpTextWait.length=this.hoverVisibilities.length,this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()})},beforeUnmount:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},computed:{...Hx(Wx,["userToken"]),annotationDisplay:function(){return this.viewingMode==="Annotation"&&this.tData.active===!0&&this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"},modeDescription:function(){let n=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.authorisedUser?n[1]:n[0]:n}},methods:{addZincObject:function(n){this.$module.scene&&this.$module.scene.addZincObject(n)},zincObjectAdded:function(n){this.loading=!1,this.$_searchIndex.addZincObject(n,n.uuid),this.timeVarying===!1&&n.isTimeVarying()&&(this.timeVarying=!0),this.$emit("zinc-object-added",n)},removeFromOfflineAnnotation:function(n,e){for(let t=0;t<this.offlineAnnotations.length;t++){const i=this.offlineAnnotations[t];if(i.region===n&&i.group===e){this.offlineAnnotations.splice(t,1);return}}},zincObjectRemoved:function(n){if(this.$module.scene){const e=n.groupName;n.region.findObjectsWithGroupName(e,!1).length===0&&this.$_searchIndex.removeZincObject(n,n.uuid)}},addRegionsToSearchIndex:function(){this.$module.scene.getRootRegion().getChildRegions(!0).forEach(t=>{this.$_searchIndex.addRegion(t,t.uuid)})},backgroundChangeCallback:function(n){this.currentBackground=n,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let n=this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"),e=document.createElement("a");document.body.append(e),this.captureFilename?e.download=this.captureFilename:e.download="screenshot.png",e.href=n,e.click(),e.remove()},captureScreenshot:function(n){this.captureFilename=n,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},addAndEditAnnotations:function(n,e,t,i){const r=Cx(this.annotator,this.userToken,t,n,e,this.url,i);if(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(s=>s.id!==r.item.id)),this.existDrawnFeatures.push(r.feature),this.offlineAnnotationEnabled){r.group=e;let s=n;s.slice(-1)==="/"&&(s=s.slice(0,-1)),r.region=s,this.offlineAnnotations=JSON.parse(sessionStorage.getItem("offline-annotation"))||[],this.offlineAnnotations.push(r),sessionStorage.setItem("offline-annotation",JSON.stringify(this.offlineAnnotations))}this.$emit("userPrimitivesUpdated",{region:n,group:e,zincObject:t})},primitivesUpdated:function(n){if(n.isZincObject&&n.isEditable){const e=n.groupName,t=n.region.getFullPath();this.addAndEditAnnotations(t,e,n,"Position Updated")}},confirmCreate:function(n){if(n){let e;if(n.shape==="Point")e=this.$module.scene.createPoints(n.region,n.group,this.createData.points,n.group,8942);else if(n.shape==="LineString")e=this.$module.scene.createLines(n.region,n.group,[this.createData.points[0],this.createData.points[1]],60962);else if(n.editingIndex>-1&&this._editingZincObject){this._editingZincObject.editVertices([this.createData.points[1]],n.editingIndex);const t=this._editingZincObject.region.getFullPath()+"/",i=this._editingZincObject.groupName;this.addAndEditAnnotations(t,i,this._editingZincObject,"Position Updated")}e&&(this.addAndEditAnnotations(n.region,n.group,e.zincObject,"Create"),e.zincObject.isEditable=!0,this.tData.region=n.region,this.tData.label=n.group,this.changeActiveByName([n.group],n.region,!1))}this.cancelCreate()},cancelCreate:function(){this.createData.points.length=0,this.createData.toBeConfirmed=!1,this._editingZincObject=void 0,this.createData.editingIndex=-1,this.createData.faceIndex=-1,this.tData.visible=!1,this.createData.toBeDeleted=!1,this._tempLine&&(this.$module.scene.removeTemporaryPrimitive(this._tempLine),this._tempLine=void 0),this._tempPoint&&(this.$module.scene.removeTemporaryPrimitive(this._tempPoint),this._tempPoint=void 0),this.annotationSidebar&&this.$emit("annotation-close")},confirmComment:function(n){if(this._editingZincObject){let e=n;this._editingZincObject.isEditable&&(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(t=>t.id!==e.item.id)),this.existDrawnFeatures.push(n.feature)),this.offlineAnnotationEnabled&&(e.group=this._editingZincObject.groupName,e.region=this._editingZincObject.region.getFullPath(),this.offlineAnnotations=JSON.parse(sessionStorage.getItem("offline-annotation"))||[],this.offlineAnnotations.push(e),sessionStorage.setItem("offline-annotation",JSON.stringify(this.offlineAnnotations)))}},confirmDelete:function(){var n;if((n=this._editingZincObject)!=null&&n.isEditable){const e=this._editingZincObject.region.getFullPath()+"/",t=this._editingZincObject.groupName,i=Cx(this.annotator,this.userToken,this._editingZincObject,e,t,this.url,"Deleted");i&&(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(s=>s.id!==i.item.id)),this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject),this.offlineAnnotationEnabled&&(this.offlineAnnotations=JSON.parse(sessionStorage.getItem("offline-annotation"))||[],this.offlineAnnotations=this.offlineAnnotations.filter(s=>s.item.id!==i.item.id),sessionStorage.setItem("offline-annotation",JSON.stringify(this.offlineAnnotations))))}this.cancelCreate()},onTooltipHide:function(){this.createData.toBeConfirmed&&!this.annotationSidebar&&this.cancelCreate()},formatTooltip(n){if(this.timeMax>=1e3&&n){let e=(n%6e4/1e3).toFixed(2)+"s";return(n>6e4?(n/6e4).toFixed(0)+"m ":"")+e}return n?n.toFixed(2)+" ms":"0 ms"},fitWindow:function(){if(this.$module.scene){let n=!1;this._boundingBoxGeo&&(n=this._boundingBoxGeo.getVisibility(),this._boundingBoxGeo.setVisibility(!1)),this.$module.scene.viewAll(),this._boundingBoxGeo&&(lF(this._boundingBoxGeo,this.$module.scene),this._boundingBoxGeo.setVisibility(n))}},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(n){this.currentSpeed=n,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(n){let e=[];return n&&n!=""&&this.$module.scene&&(e=this.$module.scene.findObjectsWithGroupName(n)),e},toggleDrawing:function(n,e){this.createData.toBeDeleted=!1,n==="mode"?(this.cancelCreate(),this.activeDrawMode=e,this.createData.shape="",this.$module.selectObjectOnPick=!0):n==="tool"&&(this.activeDrawTool=e,this.createData.shape=this.activeDrawTool?this.activeDrawTool:"",this.$module.selectObjectOnPick=!1)},toggleDrawingBox:function(){this.createData.drawingBox=!this.createData.drawingBox},viewRegion:function(n){const e=this.$module.scene.getRootRegion(),t=Array.isArray(n)?n:[n],i=Ro(e,t,"",!0);let r=this.$module.scene.getBoundingBoxOfZincObjects(i);if(r){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(r);else{const s=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(r),this.$module.scene.camera.far=this.$module.scene.camera.near+s,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(n){n&&(this.isReady?this.viewRegion(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:n})))},updateViewURL:function(n){if(n)if(this.isReady){const e=new URL(n,this.url);this.$module.scene.loadViewURL(e)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:n}))},createEditTemporaryLines:function(n){const e=n[0].extraData.worldCoords;if(e&&(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.createData.points.length===1)if(this.showRegionTooltipWithAnnotations(n,!0,!1),this.tData.x=50,this.tData.y=200,this._tempLine){const t=this._tempLine.geometry.getAttribute("position");t.setXYZ(1,e[0],e[1],e[2]),t.needsUpdate=!0}else this._tempLine=this.$module.scene.addTemporaryLines([this.createData.points[0],e],65535)},draw:function(n){n&&n.length>0&&n[0].data.group&&n[0].extraData.worldCoords&&(this.createData.shape==="Point"?this.drawPoint(n[0].extraData.worldCoords,n):(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.drawLine(n[0].extraData.worldCoords,n))},drawPoint:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length=0,this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200,this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960))},drawLine:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length===1?(this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200):(this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960),this.createData.points.push(n)))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let n=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,n.enableAutoTumble(),n.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},activateAnnotationMode:function(n,e){if(this.authorisedUser||this.offlineAnnotationEnabled)if(this.createData.toBeDeleted=!1,this.createData.shape!==""||this.createData.editingIndex>-1)n.length>0&&e.identifiers[0].coords&&(this.createData.x=e.identifiers[0].coords.x,this.createData.y=e.identifiers[0].coords.y,this.draw(e.identifiers));else{if(this.activeDrawMode==="Edit"){const t=rF(e);t&&this.activateEditingMode(t.zincObject,t.faceIndex,t.vertexIndex,t.point)}else if(this.activeDrawMode==="Delete"){const t=oF(e);t&&(this.createData.toBeDeleted=!0,this._editingZincObject=t)}this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"?this.showRegionTooltipWithAnnotations(e.identifiers,!0,!1):this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)}else this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)},activateEditingMode:function(n,e,t,i){this._editingZincObject=n,this.createData.faceIndex=e,this.createData.editingIndex=t,this.drawLine(i,void 0)},eventNotifierCallback:function(n){if(!(this.createData.toBeConfirmed||this.createData.toBeDeleted)){const e=[];let t=[];(n.eventType==1||n.eventType==2)&&(n.identifiers.forEach(s=>{if(s){let o=s.data.id?s.data.id:s.data.group;e.push(o)}}),t=n.zincObjects);let i,r;if(n.identifiers.length>0&&n.identifiers[0]&&(i=n.identifiers[0].data.id?n.identifiers[0].data.id:n.identifiers[0].data.group,n.identifiers[0].data.region&&(r=n.identifiers[0].data.region)),n.eventType==1)if(this.viewingMode==="Annotation"){this.tData.label=i,this.tData.region=r;const s=sF(n);if(this._editingZincObject=s,s){const o=this._editingZincObject.region.getFullPath()+"/",l=this._editingZincObject.groupName;this.annotationFeature=Tx(this._editingZincObject,o,l,this.url,"").feature}this.activateAnnotationMode(e,n)}else this.$refs.scaffoldTreeControls&&(e.length>0?(this.$refs.scaffoldTreeControls.updateActiveUI(t),this.updatePrimitiveControls(t)):(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls.removeActive(!1))),n.identifiers.length===1?(this.lastSelected.isSearch=!1,this.lastSelected.region=r,this.lastSelected.group=n.identifiers[0].data.group):n.identifiers.length===0&&(this.lastSelected.isSearch=!1,this.lastSelected.region="",this.lastSelected.group=""),this.$emit("scaffold-selected",n.identifiers);else if(n.eventType==2)this.selectedObjects.length===0&&(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls&&(e.length>0?this.$refs.scaffoldTreeControls.updateHoverUI(t):this.$refs.scaffoldTreeControls.removeHover(!0)),n.identifiers.length>0&&n.identifiers[0]&&n.identifiers[0].coords&&(this.tData.active=!1,(this.viewingMode!=="Annotation"||!this.annotationSidebar)&&(this.tData.visible=!0),this.tData.label=i,this.tData.region=r,this.tData.x=n.identifiers[0].coords.x,this.tData.y=n.identifiers[0].coords.y,this.createEditTemporaryLines(n.identifiers)),this.$emit("scaffold-highlighted",n.identifiers));else if(n.eventType==3&&n.identifiers.length>0&&n.identifiers[0]){if(n.identifiers[0].coords){const s=this.$refs.scaffoldContainer.getBoundingClientRect();this.tData.x=n.identifiers[0].coords.x-s.left,this.tData.y=n.identifiers[0].coords.y-s.top}this.createEditTemporaryLines(n.identifiers)}}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(n){let e=n/this.timeMax*100;e!=this.currentTime&&this.$module.updateTime(e)},updatePrimitiveControls:function(n){this.selectedObjects=n,this.selectedObjects&&this.selectedObjects.length>0?this.$refs.primitiveControls.setObject(this.selectedObjects[0]):this.$refs.primitiveControls.setObject(void 0)},objectSelected:function(n,e){this.updatePrimitiveControls(n),this.$module.setSelectedByZincObjects(n,void 0,{},e)},objectHovered:function(n,e){this.hoveredObjects=n,this.$module.setHighlightedByZincObjects(n,void 0,{},e)},changeActiveByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeActive(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeActiveByNames(r,e,t)}},changeHighlightedByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeHover(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeHoverByNames(r,e,t)}},play:function(n){this.$module.playAnimation(n),this.isPlaying=n},setHelpMode:function(n){const e=this.hoverVisibilities.length,t=e-1,i=this.hoverVisibilities[this.helpModeActiveIndex];if(i){const r=i==null?void 0:i.refs,s=i==null?void 0:i.ref;this.$refs[r||s]||(this.helpModeActiveIndex+=1)}n||(this.helpModeActiveIndex=this.helpModeInitialIndex),n&&this.helpModeActiveIndex>=t&&this.$emit("help-mode-last-item",!0),n&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(r=>{r.value=!0})):n&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1&&setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}),this.showHelpText(this.helpModeActiveIndex,200)},300):(this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}))},displayTooltipOfObjectsCallback:function(n,e,t,i,r){const s=this;return function(){s.$module.zincRenderer.removePostRenderCallbackFunction(s.$_regionTooltipCallback),s.$_regionTooltipCallback=void 0,s.displayTooltipOfObjects(n,e,t,i,r)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(n,e,t,i,r){if(e.length>0){let s=e[0].getClosestVertexDOMElementCoords(this.$module.scene);if(s)return s.inView?(n.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=n,this.tData.x=s.position.x,this.tData.y=s.position.y,this.tData.region=t,this.$_liveCoordinatesUpdated&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),r&&(this.$module.setupLiveCoordinates(e),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),i&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(n,e,t,i,r)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(n,e,t,i,r){return n&&e&&e.length>0&&this.$module.scene?this.displayTooltipOfObjects(n,e,t,i,r):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(n,e,t){if(n&&this.$module.scene){const i=this.$module.scene.getRootRegion(),s=Ro(i,[n],"",!0);let o;return s&&s.length>0&&(o=s[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(n,s,o,e,t)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(n,e,t){if(this.$module.scene){const i=Ex(this.$module.scene,n);if(i&&i.objects.length>0)if(this.annotationSidebar){const s={featureId:(this.tData.region?this.tData.region+"/":"")+this.tData.label,resourceId:this.url,resource:this.url,feature:this.annotationFeature,offline:this.offlineAnnotationEnabled};this.$emit("annotation-open",{annotationEntry:s,createData:this.createData,confirmCreate:this.confirmCreate,cancelCreate:this.cancelCreate,confirmDelete:this.confirmDelete,confirmComment:this.confirmComment});return}else return this.showRegionTooltipWithObjects(i.label,i.objects,i.regionPath,e,t)}return this.hideRegionTooltip(),!1},clearAnnotationFeature:function(){const n=this.getOfflineAnnotations();this.existDrawnFeatures.map(t=>decodeURIComponent(t.id).split("/").pop()).forEach(t=>{const i=this.$module.scene.findObjectsWithGroupName(t,!1);if(i&&i.length){const r=i[0].region.getFullPath()+"/";this.$module.scene.getRootRegion().findChildFromPath(r).removeZincObject(i[0])}}),this.$refs.scaffoldTreeControls.removeRegion("__annotation"),this.offlineAnnotations=n},addAnnotationFeature:async function(){let n;if(this.offlineAnnotationEnabled)this.offlineAnnotations=JSON.parse(sessionStorage.getItem("offline-annotation"))||[],n=this.offlineAnnotations.filter(e=>e.resource===this.url&&e.feature.properties.drawn).map(e=>e.feature);else{n=[];const e=await Ax(this.annotator,this.userToken,this.url);e&&e.features&&(n=[...e.features]);const t=await Ax(this.annotator,this.userToken,encodeURIComponent(this.url));t&&t.features&&(n=[...n,...t.features])}this.existDrawnFeatures=a.markRaw(n),Rx(this.$module.scene,n)},changeViewingMode:function(n){this.$module&&(n&&(this.viewingMode=n),this.clearAnnotationFeature(),this.viewingMode==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(e=>{e.name&&e.email&&e.canUpdate?(this.authorisedUser=e,this.offlineAnnotationEnabled=!1):(this.authorisedUser=void 0,this.offlineAnnotationEnabled=!0),this.addAnnotationFeature(),this.loading=!1})):this.viewingMode==="Exploration"&&(this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.createData.shape=""),this.viewingMode==="Exploration"||this.viewingMode==="Annotation"&&this.createData.shape===""?this.$module.selectObjectOnPick=!0:this.$module.selectObjectOnPick=!1,this.cancelCreate())},hideRegionTooltip:function(){this.$_liveCoordinatesUpdated&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),this.$module.setupLiveCoordinates(void 0)),this.tData.active=!1,this.tData.visible=!1,this.tData.region=void 0},setMarkerModeForObjectsWithName:function(n,e,t){if(n&&this.$module.scene){let i=e;typeof e=="number"&&(i={number:e,imgURL:void 0});const r=this.$module.scene.getRootRegion();Ro(r,[n],"",!0).forEach(l=>l.setMarkerMode(t,i))}},setMarkerModeWithAnnotations:function(n,e){if(this.$module.scene){const t=Ex(this.$module.scene,n);t&&t.objects.length>0&&t.objects.forEach(i=>i.setMarkerMode(e))}},showHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!0,this.$emit("shown-tooltip")},e))},hideHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!1},e))},search:function(n,e){if(this.$_searchIndex){if(n===void 0||n===""||Array.isArray(n)&&n.length===0)return this.lastSelected.region="",this.lastSelected.group="",this.lastSelected.isSearch=!0,this.objectSelected([],!0),!1;{this.lastSelected.region="",this.lastSelected.group=n,this.lastSelected.isSearch=!0;const t=this.$_searchIndex.searchAndProcessResult(n),i=t.zincObjects;if(i.length>0){if(this.objectSelected(i,!0),e)for(let r=0;r<i.length;r++)i[r]&&i[r].groupName&&this.showRegionTooltipWithObjects(t.label,i,t.regionPath,!0,!0);return!0}else this.objectSelected([],!0)}}return!1},fetchSuggestions:function(n){return this.$_searchIndex===void 0?[]:this.$_searchIndex.auto_suggest(n)},updateMinimapScissor:function(){Object.keys(this.minimapSettings).forEach(n=>{this.$module.scene.minimapScissor[n]=this.minimapSettings[n]}),this.$module.scene.minimapScissor.updateRequired=!0},updateSettingsfromScene:function(){this.currentSpeed=1,this.$module.setPlayRate(this.defaultRate),this.orginalDuration=this.$module.scene.getMetadataTag("OriginalDuration"),this.animateDuration=this.$module.scene.getMetadataTag("Duration");let n=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const e in n)this.timeStamps[n[e]]=e;this.timeMax=this.$module.scene.getDuration()},restoreSettings:function(n){if(n){if(n.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(n.viewport);else if(n.viewURL&&n.viewURL!==""){const t=new URL(n.viewURL,this.url);this.$module.scene.loadViewURL(t)}else n.region&&n.region!==""&&this.viewRegion(n.region);n.visibility&&this.$nextTick(()=>{this.$refs.scaffoldTreeControls.setState(n.visibility)}),n.background&&this.backgroundChangeCallback(n.background),n.offlineAnnotations&&sessionStorage.setItem("offline-annotation",n.offlineAnnotations),n.viewingMode&&this.changeViewingMode(n.viewingMode);const e=n.search;e&&e.group&&(e.isSearch?this.search(e.group,!0):this.changeActiveByName(e.group,e.region,!0))}},downloadErrorCallback:function(){return n=>{this.$emit("on-error",n)}},setURLFinishCallback:function(n){return()=>{this.offlineAnnotations.length=0,this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.$emit("on-ready"),this.setMarkers(),this._boundingBoxGeo=this.$module.scene.addBoundingBoxPrimitive("_helper","boundingBox",4251856,.15),this._slides=this.$module.scene.addSlicesPrimitive("_helper",["x-plane","y-plane","z-plane"],[16733525,5635925,5592575],.5);const{centre:e,size:t}=this.$module.getCentreAndSize();this.boundingDims.centre=e,this.boundingDims.size=t,this.$nextTick(()=>this.restoreSettings(n)),this.isReady=!0}},getState:function(){let n={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0,background:this.currentBackground,viewingMode:this.viewingMode};if(this.$refs.scaffoldTreeControls&&(n.visibility=this.$refs.scaffoldTreeControls.getState()),this.$module.scene){let e=this.$module.scene.getZincCameraControls();n.viewport=e.getCurrentViewport()}return this.lastSelected&&this.lastSelected.group&&(n.search={...this.lastSelected}),this.offlineAnnotationEnabled&&(n.offlineAnnotations=sessionStorage.getItem("offline-annotation")),n},setState:function(n){n&&(n.url&&n.url!==this._currentURL?this.setURLAndState(n.url,{fileFormat:n.fileFormat,viewport:n.viewport,visibility:n.visibility,background:n.background,viewingMode:this.viewingMode,search:n.search,offlineAnnotations:n.offlineAnnotations}):(n.background||n.search||n.viewport||n.viewingMode||n.visibility)&&(this.isReady&&this.$module.scene?this.restoreSettings(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:n.background,viewingMode:n.viewingMode,viewport:n.viewport,visibility:n.visibility,search:n.search,offlineAnnotations:n.offlineAnnotations}))))},exportGLTF:function(n){return this.$module.scene.exportGLTF(n)},getOfflineAnnotations:function(){return[...this.offlineAnnotations]},importOfflineAnnotations:function(n){if(this.offlineAnnotationEnabled){n.forEach(t=>{const i=t.group,r=t.region;let s=r.slice(-1)==="/"?r:r+"/";const o=s.slice(0,-1);t.region=o,s=s+i;const l=s;t.item.id=l,t.feature.id=l});const e=n.map(t=>t.feature);Rx(this.$module.scene,e),n.forEach(t=>{this.offlineAnnotations.push({...t})}),sessionStorage.setItem("offline-annotation",JSON.stringify(this.offlineAnnotations))}},setURLAndState:function(n,e){n!=this._currentURL&&(e!=null&&e.format&&(this.fileFormat=e.format),this._currentURL=n,this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.loading=!0,this.timeVarying=!1,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setDownloadErrorCallback(this.downloadErrorCallback()),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:e==null?void 0:e.background,region:this.region,search:e==null?void 0:e.search,viewingMode:e==null?void 0:e.viewingMode,viewURL:this.viewURL,viewport:e==null?void 0:e.viewport,visibility:e==null?void 0:e.visibility,offlineAnnotations:e==null?void 0:e.offlineAnnotations})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(n,"scene",!0):this.$module.loadOrgansFromURL(n,void 0,void 0,"scene",void 0,!0),this.$module&&this.$module.scene&&(this.$module.scene.displayMarkers=this.displayMarkers,this.$module.scene.forcePickableObjectsUpdate=!0,this.$module.scene.displayMinimap=this.displayMinimap,this.updateMinimapScissor()))},setURL:function(n){this.setURLAndState(n,void 0)},drawerToggled:function(n){this.drawerOpen=n,this.adjustLayout()},adjustLayout:function(){if(this.$refs.scaffoldContainer){let n=this.$refs.scaffoldContainer.clientWidth;this.minimisedSlider=n<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""}},toggleRendering:function(n){this.$module.zincRenderer&&(n?this.$module.zincRenderer.animate():this.$module.zincRenderer.stopAnimate())},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const n=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",n)},toggleSyncControl:function(n,e){this.$module.toggleSyncControl(n,e),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){for(const[n,e]of Object.entries(this.markerLabels))this.setMarkerModeForObjectsWithName(n,e,"on")}}},fV={ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},pV={class:"primitive-controls-box"},mV={class:"animation-data"},gV={class:"purple"},yV={class:"animation-data"},vV={class:"purple"},bV={class:"animation-data"},xV={class:"bottom-right-control"},wV={style:{"margin-bottom":"2px"}},MV={key:0,class:"viewing-mode-title"},SV=["onClick"],_V=["onClick"];function EV(n,e,t,i,r,s){const o=a.resolveComponent("map-svg-sprite-color"),l=jx,u=a.resolveComponent("DrawToolbar"),c=om,f=ht,d=Pl,p=Bx,y=Dx,m=a.resolveComponent("map-svg-icon"),h=En,b=Jn,v=Hg,g=Rs,w=As,S=Gg,T=Cs,M=pd;return a.withDirectives((a.openBlock(),a.createElementBlock("div",fV,[a.createVNode(o),a.createVNode(l,{createData:n.createData,label:n.tData.label,region:n.tData.region,visible:n.tData.visible,x:n.tData.x,y:n.tData.y,annotationDisplay:s.annotationDisplay,annotationFeature:n.annotationFeature,offlineAnnotationEnabled:n.offlineAnnotationEnabled,onConfirmCreate:e[0]||(e[0]=_=>s.confirmCreate(_)),onCancelCreate:e[1]||(e[1]=_=>s.cancelCreate()),onConfirmComment:e[2]||(e[2]=_=>s.confirmComment(_)),onConfirmDelete:e[3]||(e[3]=_=>s.confirmDelete()),onTooltipHide:e[4]||(e[4]=_=>s.onTooltipHide())},null,8,["createData","label","region","visible","x","y","annotationDisplay","annotationFeature","offlineAnnotationEnabled"]),a.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:e[5]||(e[5]=a.withKeys((..._)=>s.backgroundChangeCallback&&s.backgroundChangeCallback(..._),["66"]))},null,544),a.withDirectives(a.createElementVNode("div",null,[n.viewingMode==="Annotation"&&(n.authorisedUser||n.offlineAnnotationEnabled)?(a.openBlock(),a.createBlock(u,{key:0,toolbarOptions:n.toolbarOptions,activeDrawTool:n.activeDrawTool,activeDrawMode:n.activeDrawMode,hoverVisibilities:n.hoverVisibilities,onClickToolbar:s.toggleDrawing,onShowTooltip:s.showHelpText,onHideTooltip:s.hideHelpText,ref:"toolbarPopover"},null,8,["toolbarOptions","activeDrawTool","activeDrawMode","hoverVisibilities","onClickToolbar","onShowTooltip","onHideTooltip"])):a.createCommentVNode("",!0),t.displayWarning?(a.openBlock(),a.createBlock(d,{key:1,ref:"warningPopover",visible:n.hoverVisibilities[7].value,content:t.warningMessage,placement:"right",width:"max-content",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[t.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-icon warning-icon",onMouseover:e[6]||(e[6]=_=>s.showHelpText(7)),onMouseout:e[7]||(e[7]=_=>s.hideHelpText(7))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),e[27]||(e[27]=a.createElementVNode("span",{class:"message-text"},"Beta",-1))],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),t.displayLatestChanges?(a.openBlock(),a.createBlock(d,{key:2,visible:n.hoverVisibilities[8].value,content:t.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable",ref:"whatsNewPopover"},{reference:a.withCtx(()=>[t.displayLatestChanges&&t.latestChangesMessage?(a.openBlock(),a.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon",onMouseover:e[8]||(e[8]=_=>s.showHelpText(8)),onMouseout:e[9]||(e[9]=_=>s.hideHelpText(8))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),e[28]||(e[28]=a.createElementVNode("span",{class:"message-text"},"What's new?",-1))],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),a.createVNode(d,{visible:n.hoverVisibilities[6].value,content:"Change region visibility",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"regionVisibilityPopover"},{reference:a.withCtx(()=>[a.createVNode(p,{ref:"scaffoldTreeControls",isReady:n.isReady,"show-colour-picker":t.showColourPicker,onObjectSelected:s.objectSelected,onObjectHovered:s.objectHovered,onDrawerToggled:s.drawerToggled},null,8,["isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),a.createElementVNode("div",pV,[a.createVNode(y,{ref:"primitiveControls",createData:n.createData,onPrimitivesUpdated:s.primitivesUpdated},null,8,["createData","onPrimitivesUpdated"])]),n.timeVarying?(a.openBlock(),a.createBlock(d,{key:3,ref:"sliderPopover",width:"max-content",visible:n.hoverVisibilities[5].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:a.withCtx(()=>[n.timeVarying?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["time-slider-container",[n.minimisedSlider?"minimised":"",n.sliderPosition]])},[a.createVNode(S,{type:"card"},{default:a.withCtx(()=>[a.createVNode(v,{label:"Animate scaffold"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[n.isPlaying?(a.openBlock(),a.createBlock(m,{key:0,icon:"pause",class:"icon-button video-button",onClick:e[10]||(e[10]=_=>s.play(!1))})):(a.openBlock(),a.createBlock(m,{key:1,icon:"play",class:"video-button icon-button",onClick:e[11]||(e[11]=_=>s.play(!0))})),a.createVNode(h,{min:0,max:n.timeMax,"model-value":n.currentTime/100*n.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":s.formatTooltip,marks:n.timeStamps,onInput:e[12]||(e[12]=_=>s.timeChange(_))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),a.createVNode(v,{label:"Animation data"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[a.createElementVNode("div",mV,[e[29]||(e[29]=a.createTextVNode(" Original duration: ")),a.createElementVNode("div",gV,a.toDisplayString(n.orginalDuration),1)]),a.createElementVNode("div",yV,[e[30]||(e[30]=a.createTextVNode(" Animation duration: ")),a.createElementVNode("div",vV,a.toDisplayString(n.animateDuration),1)]),a.createElementVNode("div",bV,[e[31]||(e[31]=a.createTextVNode(" Playback speed ")),a.createVNode(w,{teleported:!0,"model-value":n.currentSpeed,placeholder:"Select",class:"scaffold-select-box speed","popper-class":"scaffold_viewer_dropdown",onChange:e[13]||(e[13]=_=>s.speedChanged(_))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.playSpeed,_=>(a.openBlock(),a.createBlock(g,{key:_.value,label:_.label,value:_.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):a.createCommentVNode("",!0)]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createElementVNode("div",xV,[a.createVNode(d,{visible:n.hoverVisibilities[0].value,content:"Zoom in",width:"max-content",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable",ref:"zoomInPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[14]||(e[14]=_=>s.zoomIn()),onMouseover:e[15]||(e[15]=_=>s.showHelpText(0)),onMouseout:e[16]||(e[16]=_=>s.hideHelpText(0))})]),_:1},8,["visible"]),a.createVNode(d,{visible:n.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable",ref:"zoomOutPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[17]||(e[17]=_=>s.zoomOut()),onMouseover:e[18]||(e[18]=_=>s.showHelpText(1)),onMouseout:e[19]||(e[19]=_=>s.hideHelpText(1))})]),_:1},8,["visible"]),a.createVNode(d,{visible:n.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper non-selectable",ref:"zoomFitPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[20]||(e[20]=_=>s.fitWindow()),onMouseover:e[21]||(e[21]=_=>s.showHelpText(2)),onMouseout:e[22]||(e[22]=_=>s.hideHelpText(2))})]),default:a.withCtx(()=>[e[32]||(e[32]=a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1))]),_:1},8,["visible"])]),n.openMapRef?(a.openBlock(),a.createBlock(d,{key:4,ref:"open-map-popover","virtual-ref":n.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.openMapOptions,_=>(a.openBlock(),a.createBlock(b,{key:_.key},{default:a.withCtx(()=>[a.createVNode(T,{type:"primary",plain:"",onClick:C=>n.$emit("open-map",_.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(_.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(d,{ref:"backgroundPopover","virtual-ref":n.backgroundIconRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable h-auto","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[33]||(e[33]=[a.createTextVNode("Viewing Mode")])),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createElementVNode("div",wV,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.viewingModes,(_,C,I)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:C},[C===n.viewingMode?(a.openBlock(),a.createElementBlock("span",MV,[a.createElementVNode("b",null,a.toDisplayString(C),1)])):(a.openBlock(),a.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:E=>s.changeViewingMode(C)},a.toDisplayString(C),9,SV))],64))),128))]),a.createVNode(b,{class:"viewing-mode-description"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(s.modeDescription),1)]),_:1}),n.viewingMode==="Annotation"&&n.offlineAnnotationEnabled?(a.openBlock(),a.createBlock(b,{key:0,class:"viewing-mode-description"},{default:a.withCtx(()=>e[34]||(e[34]=[a.createTextVNode(" (Offline annotate) ")])),_:1})):a.createCommentVNode("",!0)]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[35]||(e[35]=[a.createTextVNode(" Change background ")])),_:1}),a.createVNode(b,{class:"backgroundChooser"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.availableBackground,_=>(a.openBlock(),a.createElementBlock("div",{key:_,class:a.normalizeClass(["backgroundChoice",_,_==n.currentBackground?"active":""]),onClick:C=>s.backgroundChangeCallback(_)},null,10,_V))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.createElementVNode("div",{class:a.normalizeClass(["settings-group",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createVNode(b,null,{default:a.withCtx(()=>[a.createVNode(d,{visible:n.hoverVisibilities[3].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper right-popper non-selectable",ref:"openMapPopover"},{reference:a.withCtx(()=>[t.enableOpenMapUI&&t.openMapOptions.length>0?(a.openBlock(),a.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[23]||(e[23]=_=>s.showHelpText(3)),onMouseout:e[24]||(e[24]=_=>s.hideHelpText(3))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),a.createVNode(b,null,{default:a.withCtx(()=>[a.createVNode(d,{visible:n.hoverVisibilities[4].value,content:"Change background color",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"settingsPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[25]||(e[25]=_=>s.showHelpText(4)),onMouseout:e[26]||(e[26]=_=>s.hideHelpText(4))},null,512)]),_:1},8,["visible"])]),_:1})],2)],512),[[a.vShow,t.displayUI&&!n.isTransitioning]])])),[[M,n.loading]])}const TV=Bi(hV,[["render",EV],["__scopeId","data-v-0e4573fe"]]);Ht.ScaffoldVuer=TV,Object.defineProperty(Ht,Symbol.toStringTag,{value:"Module"})});
|
|
3458
|
+
This will fail in production.`);l=Ha,l._s.has(i)||(s?Bf(i,e,r,l):Gx(i,r,l),process.env.NODE_ENV!=="production"&&(o._pinia=l));const f=l._s.get(i);if(process.env.NODE_ENV!=="production"&&u){const d="__hot:"+i,p=s?Bf(d,e,r,l,!0):Gx(d,Cn({},r),l,!0);u._hotUpdate(p),delete l.state.value[d],l._s.delete(d)}if(process.env.NODE_ENV!=="production"&&ja){const d=a.getCurrentInstance();if(d&&d.proxy&&!u){const p=d.proxy,y="_pStores"in p?p._pStores:p._pStores={};y[i]=f}}return f}return o.$id=i,o}function Hx(n,e){return Array.isArray(e)?e.reduce((t,i)=>(t[i]=function(){return n(this.$pinia)[i]},t),{}):Object.keys(e).reduce((t,i)=>(t[i]=function(){const r=n(this.$pinia),s=e[i];return typeof s=="function"?s.call(this,r):r[s]},t),{})}const Wx=DF("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(n){return n.userProfile.token}},actions:{setUserToken(n){this.userProfile.token=n}}}),BF={name:"ScaffoldTooltip",components:{Col:On,CreateTooltipContent:Ja.CreateTooltipContent,ElIconDelete:cl,Icon:ht,Popover:Pl,Row:Jn,Tooltip:Ja.Tooltip},props:{createData:{type:Object,default:{toBeConfirmed:!1,points:[],shape:"",x:0,y:0}},label:{type:String,default:""},annotationDisplay:{type:Boolean,default:!1},annotationFeature:{type:Object,default:{}},offlineAnnotationEnabled:{type:Boolean,default:!1},region:{type:String,default:""},visible:{type:Boolean,default:!1},x:{type:Number,default:200},y:{type:Number,default:200}},inject:["scaffoldUrl"],provide(){return{userApiKey:this.userToken}},data:function(){return{display:!1,annotationEntry:{},ElIconDelete:a.shallowRef(cl)}},computed:{...Hx(Wx,["userToken"]),position:function(){let n=40;return this.region&&(n=55),{left:this.x-40+"px",top:this.y-n+"px"}}},methods:{checkForDisplay:function(){if(this.visible&&this.label&&this.label!==""){if(this.display=!0,this.annotationDisplay){const n=this.region?this.region+"/":"";this.annotationEntry={featureId:n+this.label,resourceId:this.scaffoldUrl,resource:this.scaffoldUrl,feature:this.annotationFeature,offline:this.offlineAnnotationEnabled}}}else this.display=!1,this.annotationEntry={}},hideTriggered:function(){this.$emit("tooltip-hide")}},watch:{label:{handler:function(){this.checkForDisplay()},immediate:!0},visible:{handler:function(){this.checkForDisplay()},immediate:!0},annotationDisplay:{handler:function(){this.checkForDisplay()},immediate:!0}}},FF={class:"tooltip-text"},VF={key:0,class:"tooltip-text"},kF={key:1,class:"delete-container"};function zF(n,e,t,i,r,s){const o=a.resolveComponent("CreateTooltipContent"),l=a.resolveComponent("Tooltip"),u=On,c=Cs,f=Jn,d=Pl;return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(s.position),class:"region-tooltip"},[a.createVNode(d,{ref:"tooltip",visible:t.visible,placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tooltip-popper non-selectable","virtual-triggering":"",onHide:s.hideTriggered},{default:a.withCtx(()=>[a.createElementVNode("div",FF,a.toDisplayString(t.label),1),t.region?(a.openBlock(),a.createElementBlock("div",VF,"Region: "+a.toDisplayString(t.region),1)):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(o,{createData:t.createData,onConfirmCreate:e[0]||(e[0]=p=>n.$emit("confirm-create",p)),onCancelCreate:e[1]||(e[1]=p=>n.$emit("cancel-create"))},null,8,["createData"]),[[a.vShow,t.createData.toBeConfirmed]]),a.withDirectives(a.createVNode(l,{class:"p-tooltip",ref:"annotationTooltip",annotationDisplay:!0,annotationEntry:n.annotationEntry,onAnnotation:e[2]||(e[2]=p=>n.$emit("confirm-comment",p))},null,8,["annotationEntry"]),[[a.vShow,t.annotationDisplay&&!t.createData.toBeConfirmed]]),t.createData.toBeDeleted?(a.openBlock(),a.createElementBlock("div",kF,[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(u,{span:10},{default:a.withCtx(()=>e[5]||(e[5]=[a.createTextVNode("Delete this feature?")])),_:1}),a.createVNode(u,{span:7},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",icon:n.ElIconDelete,onClick:e[3]||(e[3]=p=>n.$emit("confirm-delete"))},{default:a.withCtx(()=>e[6]||(e[6]=[a.createTextVNode(" Delete ")])),_:1},8,["icon"])]),_:1}),a.createVNode(u,{span:6},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",onClick:e[4]||(e[4]=p=>n.$emit("cancel-create"))},{default:a.withCtx(()=>e[7]||(e[7]=[a.createTextVNode(" Dismiss ")])),_:1})]),_:1})]),_:1})])):a.createCommentVNode("",!0)]),_:1},8,["visible","onHide"])],4)}const jx=Bi(BF,[["render",zF],["__scopeId","data-v-4d16262d"]]);/*! js-cookie v3.0.5 | MIT */function nu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)n[i]=t[i]}return n}var UF={read:function(n){return n[0]==='"'&&(n=n.slice(1,-1)),n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(n){return encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Ff(n,e){function t(r,s,o){if(!(typeof document>"u")){o=nu({},e,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var u in o)o[u]&&(l+="; "+u,o[u]!==!0&&(l+="="+o[u].split(";")[0]));return document.cookie=r+"="+n.write(s,r)+l}}function i(r){if(!(typeof document>"u"||arguments.length&&!r)){for(var s=document.cookie?document.cookie.split("; "):[],o={},l=0;l<s.length;l++){var u=s[l].split("="),c=u.slice(1).join("=");try{var f=decodeURIComponent(u[0]);if(o[f]=n.read(c,f),r===f)break}catch{}}return r?o[r]:o}}return Object.create({set:t,get:i,remove:function(r,s){t(r,"",nu({},s,{expires:-1}))},withAttributes:function(r){return Ff(this.converter,nu({},this.attributes,r))},withConverter:function(r){return Ff(nu({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(n)}})}var Vf=Ff(UF,{path:"/"}),oi=function(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},vt=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},Fi,$a,ai,Qt,Sr;const GF=1e4;class HF{constructor(e){Fi.add(this),$a.set(this,void 0),ai.set(this,null),Qt.set(this,null),e.slice(-1)==="/"?oi(this,$a,e.slice(0,-1),"f"):oi(this,$a,e,"f")}get currentUser(){return vt(this,ai,"f")}get currentError(){return vt(this,Qt,"f")}async authenticate(e){oi(this,Qt,null,"f"),oi(this,ai,null,"f");const t=await vt(this,Fi,"m",Sr).call(this,e,"authenticate");return"error"in t?(Vf.remove("annotation-key"),Promise.resolve(vt(this,Qt,"f"))):(Vf.set("annotation-key",t.session,{secure:!0,expires:1}),oi(this,ai,t.data,"f"),Promise.resolve(vt(this,ai,"f")))}async unauthenticate(e){oi(this,Qt,null,"f"),oi(this,ai,null,"f");const t=await vt(this,Fi,"m",Sr).call(this,e,"unauthenticate");return"success"in t?Promise.resolve(t):Promise.resolve(vt(this,Qt,"f"))}async annotatedItemIds(e,t,i,r){const s={resource:t};i!==void 0&&(s.user=i),r!==void 0&&(s.participated=r);const o=await vt(this,Fi,"m",Sr).call(this,e,"items/","GET",s);return"error"in o?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(o)}async drawnFeatures(e,t,i){const r={resource:t};i!==void 0&&(r.items=i);const s=await vt(this,Fi,"m",Sr).call(this,e,"features/","GET",r);return"error"in s?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(s)}async itemAnnotations(e,t,i){const r=await vt(this,Fi,"m",Sr).call(this,e,"annotations/","GET",{resource:t,item:i});return"error"in r?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(r)}async annotation(e,t){const i=await vt(this,Fi,"m",Sr).call(this,e,"annotation/","GET",{annotation:t});return"error"in i?Promise.resolve(vt(this,Qt,"f")):Promise.resolve(i)}async addAnnotation(e,t){if(vt(this,ai,"f")&&vt(this,ai,"f").canUpdate){const i=Object.assign({creator:vt(this,ai,"f"),created:new Date().toISOString()},t),r=await vt(this,Fi,"m",Sr).call(this,e,"annotation/","POST",{data:i});if(!("error"in r))return Promise.resolve(r);oi(this,Qt,r,"f")}else oi(this,Qt,{error:"user cannot add annotation"},"f");return Promise.resolve(vt(this,Qt,"f"))}}$a=new WeakMap,ai=new WeakMap,Qt=new WeakMap,Fi=new WeakSet,Sr=async function(e,t,i="GET",r={}){let s=!0;const o=new AbortController;setTimeout(()=>{s&&(console.log("Annotation server timeout..."),o.abort())},GF);const l={method:i,signal:o.signal};let u=`${vt(this,$a,"f")}/${t}`;const c=Vf.get("annotation-key")||"";if(i==="GET"){const d=[];for(const[p,y]of Object.entries(r))d.push(`${p}=${encodeURIComponent(JSON.stringify(y))}`);d.push(`key=${encodeURIComponent(e)}`),d.push(`session=${encodeURIComponent(c)}`),u+="?"+d.join("&"),l.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(i==="POST"){const d=Object.assign({key:e,session:c},r);l.body=JSON.stringify(d),l.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const f=await fetch(u,l);return s=!1,f.ok?Promise.resolve(await f.json()):(oi(this,Qt,{error:`${f.status} ${f.statusText}`},"f"),Promise.resolve(vt(this,Qt,"f")))};const Za={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},WF=function(n,e,t){this.eventType=n,this.identifiers=e,this.zincObjects=t},jF=function(n,e,t){this.targetedID=[];const i=n,r=e;this.targetEventType=t;const s=this;t===void 0&&(this.targetEventType=Za.ALL),this.getEventType=function(){return t},this.notify=function(o,l,u,c){if(o!==i&&(s.targetEventType===Za.ALL||s.targetEventType===l)){const f=new WF(l,u,c);r(f)}}},$F=function(){const n=[];this.publish=function(e,t,i,r){for(let s=0;s<n.length;s++)n[s].notify(e,t,i,r)},this.subscribe=function(e,t,i){if(typeof t=="function"){const r=new jF(e,t,i);return n.push(r),r}},this.unsubscribe=function(e){for(let t=0;t<n.length;t++)if(e===n[t]){n.splice(t,1);return}}},$x={isWebGLAvailable:function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(n){var e={1:"WebGL",2:"WebGL 2"},t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},i='This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.',r=document.createElement("div");return r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="20px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0",t[n]?i=i.replace("$0","graphics card"):i=i.replace("$0","browser"),i=i.replace("$1",e[n]),r.innerHTML=i,r}},kf={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},xn=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};xn.prototype.setName=function(n){if(n&&this.instanceName!==n){this.instanceName=n;const e=this.onChangedCallbacks.slice();for(let t=0;t<e.length;t++)e[t](this,kf.NAME_CHANGED)}},xn.prototype.settingsChanged=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,kf.SETTINGS_CHANGED)},xn.prototype.exportSettings=function(){const n={};return n.dialog=this.typeName,n.name=this.instanceName,n},xn.prototype.importSettings=function(n){return n.dialog==this.typeName?(this.setName(n.name),!0):!1},xn.prototype.publishChanges=function(n,e,t){for(let i=0;i<this.eventNotifiers.length;i++)this.eventNotifiers[i].publish(this,e,n,t)},xn.prototype.getName=function(){return this.instanceName},xn.prototype.destroy=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,kf.DESTROYED);delete this},xn.prototype.addChangedCallback=function(n){this.onChangedCallbacks.includes(n)==!1&&this.onChangedCallbacks.push(n)},xn.prototype.removeChangedCallback=function(n){const e=this.onChangedCallbacks.indexOf(n);e>-1&&this.onChangedCallbacks.splice(e,1)},xn.prototype.addNotifier=function(n){this.eventNotifiers.push(n)};const iu=(n,e,t)=>{for(let i=0;i<n.length;i++)if(n[i]&&n[i].material&&n[i].material.emissive){let r=n[i].userData;r&&r.isZincObject?r.setEmissiveRGB(e):n[i].material&&n[i].material.emissive&&n[i].material.emissive.setRGB(...e),t&&n[i].material.depthFunc&&(n[i].material.depthFunc=Mr.THREE.LessEqualDepth),n[i].children.forEach(s=>{const o=s.userData;o&&o.isZincObject&&s.material&&s.material.emissive&&s.material.emissive.setRGB(...e)})}},ZF=function(){let n=[],e=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const t=[],i=[],r=this,s=function(u,c){if(u.length==0&&c.length==0)return!1;for(let f=0;f<u.length;f++){let d=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(d=!0);if(!d)return!0}for(let f=0;f<c.length;f++){let d=!1;for(let p=0;p<u.length;p++)c[f]===u[p]&&(d=!0);if(!d)return!0}return!1},o=function(u,c){if(t.length=0,c.length==0)return u;for(let f=0;f<u.length;f++){let d=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(d=!0);d||t.push(u[f])}return t};this.setHighlighted=function(u){const c=[...n];r.resetHighlighted();const f=o(u,e),d=l(f);return iu(d,r.highlightColour,!1),n=f,s(n,c)},this.setSelected=function(u){const c=[...e];r.resetHighlighted(),r.resetSelected();const f=l(u);return iu(f,r.selectColour,!1),e=u,s(e,c)};const l=function(u){i.length=0;for(let c=0;c<u.length;c++)u[c].material&&i.push(u[c]);return i};this.resetHighlighted=function(){const u=l(n);iu(u,r.originalColour,!0),n=[]},this.resetSelected=function(){const u=l(e);iu(u,r.originalColour,!0),e=[]},this.getSelected=function(){return e},this.reset=function(){r.resetSelected(),r.resetHighlighted()}},zf=qc.THREE,XF=function(){const n=document.createElement("div");let e;if(n.style.height="100%",$x.isWebGLAvailable())e=new qc.Renderer(n,window),qc.defaultMaterialColor=16777116,e.initialiseVisualisation(),e.playAnimation=!1;else{const t=$x.getWebGLErrorMessage();n.appendChild(t)}return{Zinc:qc,renderer:e,container:n}},bt=function(){xn.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new ZF,this.selectObjectOnPick=!0,this.zincRenderer=null,this.selectedScreenCoordinates=new zf.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0,this.ignorePreviousSelected=!1};bt.prototype=Object.create(xn.prototype),bt.prototype.getIntersectedObject=function(n){if(n){const e=n.map(i=>{if(i&&i.object&&i.object.userData){if(i.object.userData.isMarker)return 1;if(i.object.name&&i.object.userData.isZincObject)return i.object.name==="_Unnamed"?3:2}return 0});let t=e.indexOf(1);return t>-1||(t=e.indexOf(2),t=t>-1?t:e.indexOf(3)),n[t]}},bt.prototype.getAnnotationsFromObjects=function(n){const e=[];for(var t=0;t<n.length;t++){const i=n[t].userData;let r;if(i){if(i.isGlyph||i.isGlyphset){let s=i;i.isGlyph&&(s=i.getGlyphset()),r=s.userData?s.userData.annotation:void 0,r&&r.data&&(n[t].name&&n[t].name!=""?r.data.id=n[t].name:r.data.id=s.groupName)}else r=i.userData?i.userData.annotation:void 0,r&&r.data&&(r.data.id=n[t].name);r&&(r.data.zincObject=i)}r&&e.push(r)}return e},bt.prototype.setHighlightedByObjects=function(n,e,t,i){const r=this.graphicsHighlight.setHighlighted(n),s=this.objectsToZincObjects(n);if(i){let o=Za.MOVE;r&&(o=Za.HIGHLIGHTED);const l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}return r},bt.prototype.setHighlightedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{s&&s.getMorph()&&r.push(s.getMorph())}),this.setHighlightedByObjects(r,e,t,i)},bt.prototype.setupLiveCoordinates=function(n){if(this.liveUpdatesObjects=n,n&&n.length>0){const e=this.scene.getBoundingBoxOfZincObjects(n);let t=new zf.Vector3;e?(e.getCenter(t),this.selectedCenter==null?this.selectedCenter=t:this.selectedCenter.copy(t)):this.selectedCenter=void 0}else this.selectedCenter=void 0},bt.prototype.objectsToZincObjects=function(n){const e=[];for(let t=0;t<n.length;t++){let i=n[t].userData;if(i)if(i.isGlyph||i.isGlyphset){let r=i;i.isGlyph&&(r=i.getGlyphset()),e.push(r)}else e.push(i)}return e},bt.prototype.setSelectedByObjects=function(n,e,t,i){let r=!1;if(this.selectObjectOnPick?r=this.graphicsHighlight.setSelected(n):r=!0,r||this.ignorePreviousSelected){const s=this.objectsToZincObjects(n);if(this.selectObjectOnPick&&this.setupLiveCoordinates(s),i){const o=Za.SELECTED,l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}}return r},bt.prototype.setSelectedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{if(s){const o=s.getMorph();o&&r.push(o)}}),this.setSelectedByObjects(r,e,t,i)},bt.prototype.findObjectsByGroupName=function(n){return this.scene.findObjectsWithGroupName(n)},bt.prototype.setHighlightedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setHighlightedByObjects(t,void 0,{},e)},bt.prototype.setSelectedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setSelectedByObjects(t,void 0,{},e)},bt.prototype.changeBackgroundColour=function(n){const e=new zf.Color(n);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(e,1)},bt.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},bt.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},bt.prototype.playAnimation=function(n){this.zincRenderer&&(this.zincRenderer.playAnimation=n)},bt.prototype.setPlayRate=function(n){this.zincRenderer&&this.zincRenderer.setPlayRate(n)},bt.prototype.getPlayRate=function(n){return this.zincRenderer?this.zincRenderer.getPlayRate():0},bt.prototype.initialiseRenderer=function(n){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let e=XF();this.Zinc=e.Zinc,this.zincRenderer=e.renderer,this.rendererContainer=e.container}n&&(this.displayArea=n,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},bt.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),xn.prototype.destroy.call(this)};const YF=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},JF=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.timeVarying=!1,this.currentTime=0},Zx=function(n){bt.call(this);const e=this;let t;this.sceneData=new JF;const i=new Array,r=new Array,s=new Array,o=new Array;let l,u;const c=n;this.NDCCameraControl=void 0,e.typeName="Organ Viewer",this.getSceneData=function(){return e.sceneData},this.updateTime=function(E){let P=6e3;e.scene&&(P=e.scene.getDuration());const A=E/100*P;e.sceneData.nerveMapIsActive||e.scene&&e.scene.setMorphsTime(A),e.sceneData.currentTime=E};const f=function(){let E=3e3;e.scene&&(E=e.scene.getDuration());const P=e.zincRenderer.getCurrentTime();for(let A=0;A<i.length;A++)i[A](P);!e.sceneData.nerveMapIsActive&&t&&t.setMorphsTime(P),e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setTime(P/E),e.sceneData.currentTime=P/E*100};this.getCurrentTime=function(){return e.sceneData.currentTime},this.toggleSyncControl=(E,P)=>{let A=this.scene.getZincCameraControls();E?(A.resetView(),this.NDCCameraControl=A.enableSyncControl(),A.setRotationMode(P)):(A.disableSyncControl(),this.NDCCameraControl=void 0,A.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=E=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(E,2)},this.setSyncControlCallback=E=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(E)},this.setSyncControlCenterZoom=(E,P)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(E,P)};const d=function(){if(e.zincRenderer.playAnimation&&e.liveUpdatesObjects&&e.setupLiveCoordinates(e.liveUpdatesObjects),e.selectedCenter){const E=new Mr.THREE.Vector3;E.copy(e.selectedCenter);const P=e.scene.vectorToScreenXY(E);e.selectedScreenCoordinates.x=P.x,e.selectedScreenCoordinates.y=P.y}},p=function(){return function(){f()}},y=function(){return function(){d()}};this.addTimeChangedCallback=function(E){i.push(E)},this.setTexturePos=function(E){e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setSliderPos(E)},this.addSceneChangedCallback=function(E){r.push(E)},this.addOrganPartAddedCallback=function(E){s.push(E)},this.addOrganPartRemovedCallback=function(E){o.push(E)},this.setFinishDownloadCallback=function(E){l=E},this.unsetFinishDownloadCallback=function(){l=void 0},this.setDownloadErrorCallback=function(E){u=E},this.unsetDownloadErrorCallback=function(){u=void 0},this.getNamedObjectsToScreenCoordinates=function(E,P){const A=new Mr.THREE.Vector3;A.setFromMatrixPosition(obj.matrixWorld);const R=width/2,L=height/2;return A.project(P),A.x=A.x*R+R,A.y=-(A.y*L)+L,A};const m=function(E){let P,A;if(E!==void 0){let R=!1;E.object.userData&&E.object.userData.isMarker?(R=!0,A=E.object.userData.parent.getMorph()):A=E.object;try{A.userData.userData.annotation.data.lastActionOnMarker=R}finally{}if(A)if(A.name)P=A.name;else{const L=e.getAnnotationsFromObjects([A]);L&&L[0]&&(P=L[0].data.group)}}return{id:P,object:A}},h=function(){return function(E,P,A){var O;const R=e.getIntersectedObject(E),L=m(R),N={worldCoords:[R?R.point.x:0,R?R.point.y:0,R?R.point.z:0],intersected:R,intersects:E},x={x:P,y:A};if(L.id){N.threeID=(O=L.object)==null?void 0:O.id,L.object.userData.isGlyph?L.object.name?e.setSelectedByObjects([L.object],x,N,!0):e.setSelectedByZincObjects(L.object.userData.getGlyphset(),x,N,!0):e.setSelectedByObjects([L.object],x,N,!0);return}else e.setSelectedByObjects([],x,N,!0)}},b=function(){return function(E,P,A){var O;const R=e.getIntersectedObject(E),L=m(R),N={worldCoords:[R?R.point.x:0,R?R.point.y:0,R?R.point.z:0]},x={x:P,y:A};if(L.id){N.threeID=(O=L.object)==null?void 0:O.id,e.displayArea.style.cursor="pointer",e.setHighlightedByObjects([L.object],x,N,!0);return}else e.displayArea.style.cursor="auto",e.setHighlightedByObjects([],x,N,!0)}},v=function(E,P,A,R){if(R=="all"||R=="geometries"){const L=E.findGeometriesWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}if(R=="all"||R=="glyphsets"){const L=E.findGlyphsetsWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}if(R=="all"||R=="pointsets"){const L=E.findPointsetsWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}if(R=="all"||R=="lines"){const L=E.findLinesWithGroupName(P);for(let N=0;N<L.length;N++)L[N].setVisibility(A)}};this.changeGeometriesVisibility=function(E,P){v(e.scene,E,P,"geometries")},this.changeGlyphsetsVisibility=function(E,P){v(e.scene,E,P,"glyphsets")},this.changeLinesVisibility=function(E,P){v(e.scene,E,P,"lines")},this.changePointsetsVisibility=function(E,P){v(e.scene,E,P,"pointsets")},this.changeOrganPartsVisibility=function(E,P,A){let R="all";A!==void 0&&(R=A),v(e.scene,E,P,R)},this.changeOrganPartsVisibilityCallback=function(E){return function(P){e.changeOrganPartsVisibility(E,P)}},this.changeBackgroundColour=function(E){const P=new Mr.THREE.Color(E);e.zincRenderer&&e.zincRenderer.getThreeJSRenderer().setClearColor(P,1)};const g=function(E,P,A,R){for(let x=0;x<s.length;x++)s[x](R,e.scene.isTimeVarying());const L=new YF,N=R.region.getFullPath();L.data={species:e.sceneData.currentSpecies,system:E,part:P,group:R.groupName,region:N,uuid:R.uuid,lastActionOnMarker:!1},R.userData.annotation=L},w=function(E,P,A,R){for(let L=0;L<o.length;L++)o[L](R)},S=function(E,P,A){return function(R){g(E,P,A,R)}},T=function(E,P,A){return function(R){w(E,P,A,R)}},M=function(){return function(){e.settingsChanged(),e.sceneData.timeVarying=e.scene.isTimeVarying(),l&&l()}},_=function(){return function(E){if((E==null?void 0:E.type)==="Error"&&u){const P={xhr:E.xhr,type:"download-error"};u(P)}}};this.updateFieldvisibility=function(E,P){for(let A=0;A<E.length;A++)if(P!=A){const R=E[A].PartName;e.changeOrganPartsVisibility(R,!1)}if(P>-1){const A=E[P].PartName;if(e.scene.findGeometriesWithGroupName(A).length>0||e.scene.findGlyphsetsWithGroupName(A).length>0)e.changeOrganPartsVisibility(A,!0);else{const R=getOrganDetails(E[P].SystemName,A);R!=null&&e.scene.loadMetadataURL(c.getOrgansDirectoryPrefix()+"/"+R.meta)}}},this.getAvailableSpecies=function(E,P,A){const R=new Array;R.push("none");const L=Object.keys(organsFileMap);for(index in L){const N=L[index];N!=E&&organsFileMap[N].hasOwnProperty(P)&&organsFileMap[N][P].hasOwnProperty(A)&&R.push(N)}return R},this.getCentreAndSize=function(){const E=new Mr.THREE.Vector3,P=this.scene.getBoundingBox();P.getCenter(E);const A=[E.x,E.y,E.z];P.getSize(E);const R=[E.x,E.y,E.z];return{centre:A,size:R}};const C=function(E,P,A,R){e.sceneData.nerveMapIsActive=!1,e.sceneData.nerveMap=void 0,e.sceneData.metaURL="",e.sceneData.viewURL="",e.sceneData.currentSpecies=E,e.sceneData.currentSystem=P,e.sceneData.currentPart=A,e.sceneData.currentTime=0,e.sceneData.timeVarying=!1;let L="";E&&(L=E+"/"),P&&(L=P+"/"),A&&(L=A),e.sceneData.currentName=L};this.loadOrgansFromURL=function(E,P,A,R,L,N){if(e.zincRenderer&&R&&e.sceneData.metaURL!==E){C(P,A,R);const x=e.sceneData.currentName;let O=e.zincRenderer.getSceneByName(x);O?N&&O.clearAll():O=e.zincRenderer.createScene(x),e.selectObjectOnPick=!0;for(let F=0;F<r.length;F++)r[F](e.sceneData);L&&L!=""?(e.sceneData.viewURL=L,O.loadViewURL(e.sceneData.viewURL)):e.sceneData.viewURL=void 0,e.sceneData.metaURL=E,O.addZincObjectAddedCallbacks(S(A,R,!1)),O.addZincObjectRemovedCallbacks(T(void 0,R,!1)),O.loadMetadataURL(E,_(),M()),e.scene=O,e.zincRenderer.setCurrentScene(O),e.graphicsHighlight.reset();const B=O.getZincCameraControls();B.enableRaycaster(O,h(),b()),B.setMouseButtonAction("AUXILIARY","ZOOM"),B.setMouseButtonAction("SECONDARY","PAN")}},this.loadGLTFFromURL=function(E,P,A){if(e.zincRenderer&&P&&e.sceneData.metaURL!==E){C(void 0,void 0,P);const R=e.sceneData.currentName;let L=e.zincRenderer.getSceneByName(R);L?A&&L.clearAll():L=e.zincRenderer.createScene(R);for(let x=0;x<r.length;x++)r[x](e.sceneData);e.sceneData.viewURL=void 0,e.sceneData.metaURL=E,L.addZincObjectAddedCallbacks(S(void 0,P,!1)),L.addZincObjectRemovedCallbacks(T(void 0,P,!1)),L.loadGLTF(E,void 0,M()),e.scene=L,e.zincRenderer.setCurrentScene(L),e.graphicsHighlight.reset();const N=L.getZincCameraControls();N.enableRaycaster(L,h(),b()),N.setMouseButtonAction("AUXILIARY","ZOOM"),N.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(E){const P=e.graphicsHighlight.getSelected();P&&P[0]&&P[0].userData&&e.scene.alignObjectToCameraView(P[0].userData,E)},this.exportSettings=function(){const E={};return E.name=e.instanceName,e.sceneData.currentSystem&&(E.system=e.sceneData.currentSystem),e.sceneData.currentSpecies&&(E.species=e.sceneData.currentSpecies),e.sceneData.currentPart&&(E.part=e.sceneData.currentPart),E.metaURL=e.sceneData.metaURL,e.sceneData.viewURL&&(E.viewURL=e.sceneData.viewURL),E.dialog="Organ Viewer",E},this.importSettings=function(E){return E&&E.dialog==this.typeName?(e.setName(E.name),E.metaURL!==void 0&&E.metaURL!=""?e.loadOrgansFromURL(E.metaURL,E.species,E.system,E.part,E.viewURL,!0):e.loadOrgans(E.species,E.system,E.part),!0):!1},function(){e.initialiseRenderer(void 0),e.zincRenderer&&(e.zincRenderer.addPreRenderCallbackFunction(p()),e.zincRenderer.addPostRenderCallbackFunction(y()))}()};Zx.prototype=Object.create(bt.prototype);var at=function(){return at=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},at.apply(this,arguments)};function KF(n,e,t,i){function r(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function l(f){try{c(i.next(f))}catch(d){o(d)}}function u(f){try{c(i.throw(f))}catch(d){o(d)}}function c(f){f.done?s(f.value):r(f.value).then(l,u)}c((i=i.apply(n,[])).next())})}function qF(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(c){return function(f){return u([c,f])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(i=1,r&&(s=c[0]&2?r.return:c[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;switch(r=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,r=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(f){c=[6,f],r=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Xe(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Rt(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),r,s=[],o;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}typeof SuppressedError=="function"&&SuppressedError;var QF="ENTRIES",Xx="KEYS",Yx="VALUES",Yt="",Uf=function(){function n(e,t){var i=e._tree,r=Array.from(i.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:i,keys:r}]:[]}return n.prototype.next=function(){var e=this.dive();return this.backtrack(),e},n.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=Po(this._path),t=e.node,i=e.keys;if(Po(i)===Yt)return{done:!1,value:this.result()};var r=t.get(Po(i));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},n.prototype.backtrack=function(){if(this._path.length!==0){var e=Po(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},n.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return Po(t)}).filter(function(e){return e!==Yt}).join("")},n.prototype.value=function(){return Po(this._path).node.get(Yt)},n.prototype.result=function(){switch(this._type){case Yx:return this.value();case Xx:return this.key();default:return[this.key(),this.value()]}},n.prototype[Symbol.iterator]=function(){return this},n}(),Po=function(n){return n[n.length-1]},eV=function(n,e,t){var i=new Map;if(e===void 0)return i;for(var r=e.length+1,s=r+t,o=new Uint8Array(s*r).fill(t+1),l=0;l<r;++l)o[l]=l;for(var u=1;u<s;++u)o[u*r]=u;return Jx(n,e,t,i,o,1,r,""),i},Jx=function(n,e,t,i,r,s,o,l){var u,c,f=s*o;try{e:for(var d=Xe(n.keys()),p=d.next();!p.done;p=d.next()){var y=p.value;if(y===Yt){var m=r[f-1];m<=t&&i.set(l,[n.get(y),m])}else{for(var h=s,b=0;b<y.length;++b,++h){for(var v=y[b],g=o*h,w=g-o,S=r[g],T=Math.max(0,h-t-1),M=Math.min(o-1,h+t),_=T;_<M;++_){var C=v!==e[_],I=r[w+_]+ +C,E=r[w+_+1]+1,P=r[g+_]+1,A=r[g+_+1]=Math.min(I,E,P);A<S&&(S=A)}if(S>t)continue e}Jx(n.get(y),e,t,i,r,h,o,l+y)}}}catch(R){u={error:R}}finally{try{p&&!p.done&&(c=d.return)&&c.call(d)}finally{if(u)throw u.error}}},Gf=function(){function n(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return n.prototype.atPrefix=function(e){var t,i;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var r=Rt(ru(this._tree,e.slice(this._prefix.length)),2),s=r[0],o=r[1];if(s===void 0){var l=Rt(jf(o),2),u=l[0],c=l[1];try{for(var f=Xe(u.keys()),d=f.next();!d.done;d=f.next()){var p=d.value;if(p!==Yt&&p.startsWith(c)){var y=new Map;return y.set(p.slice(c.length),u.get(p)),new n(y,e)}}}catch(m){t={error:m}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(t)throw t.error}}}return new n(s,e)},n.prototype.clear=function(){this._size=void 0,this._tree.clear()},n.prototype.delete=function(e){return this._size=void 0,tV(this._tree,e)},n.prototype.entries=function(){return new Uf(this,QF)},n.prototype.forEach=function(e){var t,i;try{for(var r=Xe(this),s=r.next();!s.done;s=r.next()){var o=Rt(s.value,2),l=o[0],u=o[1];e(l,u,this)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.fuzzyGet=function(e,t){return eV(this._tree,e,t)},n.prototype.get=function(e){var t=Hf(this._tree,e);return t!==void 0?t.get(Yt):void 0},n.prototype.has=function(e){var t=Hf(this._tree,e);return t!==void 0&&t.has(Yt)},n.prototype.keys=function(){return new Uf(this,Xx)},n.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Wf(this._tree,e);return i.set(Yt,t),this},Object.defineProperty(n.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),n.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Wf(this._tree,e);return i.set(Yt,t(i.get(Yt))),this},n.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Wf(this._tree,e),r=i.get(Yt);return r===void 0&&i.set(Yt,r=t()),r},n.prototype.values=function(){return new Uf(this,Yx)},n.prototype[Symbol.iterator]=function(){return this.entries()},n.from=function(e){var t,i,r=new n;try{for(var s=Xe(e),o=s.next();!o.done;o=s.next()){var l=Rt(o.value,2),u=l[0],c=l[1];r.set(u,c)}}catch(f){t={error:f}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},n.fromObject=function(e){return n.from(Object.entries(e))},n}(),ru=function(n,e,t){var i,r;if(t===void 0&&(t=[]),e.length===0||n==null)return[n,t];try{for(var s=Xe(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==Yt&&e.startsWith(l))return t.push([n,l]),ru(n.get(l),e.slice(l.length),t)}}catch(u){i={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return t.push([n,e]),ru(void 0,"",t)},Hf=function(n,e){var t,i;if(e.length===0||n==null)return n;try{for(var r=Xe(n.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;if(o!==Yt&&e.startsWith(o))return Hf(n.get(o),e.slice(o.length))}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},Wf=function(n,e){var t,i,r=e.length;e:for(var s=0;n&&s<r;){try{for(var o=(t=void 0,Xe(n.keys())),l=o.next();!l.done;l=o.next()){var u=l.value;if(u!==Yt&&e[s]===u[0]){for(var c=Math.min(r-s,u.length),f=1;f<c&&e[s+f]===u[f];)++f;var d=n.get(u);if(f===u.length)n=d;else{var p=new Map;p.set(u.slice(f),d),n.set(e.slice(s,s+f),p),n.delete(u),n=p}s+=f;continue e}}}catch(m){t={error:m}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}var y=new Map;return n.set(e.slice(s),y),y}return n},tV=function(n,e){var t=Rt(ru(n,e),2),i=t[0],r=t[1];if(i!==void 0){if(i.delete(Yt),i.size===0)Kx(r);else if(i.size===1){var s=Rt(i.entries().next().value,2),o=s[0],l=s[1];qx(r,o,l)}}},Kx=function(n){if(n.length!==0){var e=Rt(jf(n),2),t=e[0],i=e[1];if(t.delete(i),t.size===0)Kx(n.slice(0,-1));else if(t.size===1){var r=Rt(t.entries().next().value,2),s=r[0],o=r[1];s!==Yt&&qx(n.slice(0,-1),s,o)}}},qx=function(n,e,t){if(n.length!==0){var i=Rt(jf(n),2),r=i[0],s=i[1];r.set(s+e,t),r.delete(s)}},jf=function(n){return n[n.length-1]},Xa,$f="or",Qx="and",nV="and_not",iV=function(){function n(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');var t=e.autoVacuum==null||e.autoVacuum===!0?Kf:e.autoVacuum;this._options=at(at(at({},Xf),e),{autoVacuum:t,searchOptions:at(at({},ew),e.searchOptions||{}),autoSuggestOptions:at(at({},lV),e.autoSuggestOptions||{})}),this._index=new Gf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Jf,this.addFields(this._options.fields)}return n.prototype.add=function(e){var t,i,r,s,o,l,u=this._options,c=u.extractField,f=u.tokenize,d=u.processTerm,p=u.fields,y=u.idField,m=c(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));if(this._idToShortId.has(m))throw new Error("MiniSearch: duplicate ID ".concat(m));var h=this.addDocumentId(m);this.saveStoredFields(h,e);try{for(var b=Xe(p),v=b.next();!v.done;v=b.next()){var g=v.value,w=c(e,g);if(w!=null){var S=f(w.toString(),g),T=this._fieldIds[g],M=new Set(S).size;this.addFieldLength(h,T,this._documentCount-1,M);try{for(var _=(r=void 0,Xe(S)),C=_.next();!C.done;C=_.next()){var I=C.value,E=d(I,g);if(Array.isArray(E))try{for(var P=(o=void 0,Xe(E)),A=P.next();!A.done;A=P.next()){var R=A.value;this.addTerm(T,h,R)}}catch(L){o={error:L}}finally{try{A&&!A.done&&(l=P.return)&&l.call(P)}finally{if(o)throw o.error}}else E&&this.addTerm(T,h,E)}}catch(L){r={error:L}}finally{try{C&&!C.done&&(s=_.return)&&s.call(_)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}},n.prototype.addAll=function(e){var t,i;try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.add(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.addAllAsync=function(e,t){var i=this;t===void 0&&(t={});var r=t.chunkSize,s=r===void 0?10:r,o={chunk:[],promise:Promise.resolve()},l=e.reduce(function(f,d,p){var y=f.chunk,m=f.promise;return y.push(d),(p+1)%s===0?{chunk:[],promise:m.then(function(){return new Promise(function(h){return setTimeout(h,0)})}).then(function(){return i.addAll(y)})}:{chunk:y,promise:m}},o),u=l.chunk,c=l.promise;return c.then(function(){return i.addAll(u)})},n.prototype.remove=function(e){var t,i,r,s,o,l,u=this._options,c=u.tokenize,f=u.processTerm,d=u.extractField,p=u.fields,y=u.idField,m=d(e,y);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));var h=this._idToShortId.get(m);if(h==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(m,": it is not in the index"));try{for(var b=Xe(p),v=b.next();!v.done;v=b.next()){var g=v.value,w=d(e,g);if(w!=null){var S=c(w.toString(),g),T=this._fieldIds[g],M=new Set(S).size;this.removeFieldLength(h,T,this._documentCount,M);try{for(var _=(r=void 0,Xe(S)),C=_.next();!C.done;C=_.next()){var I=C.value,E=f(I,g);if(Array.isArray(E))try{for(var P=(o=void 0,Xe(E)),A=P.next();!A.done;A=P.next()){var R=A.value;this.removeTerm(T,h,R)}}catch(L){o={error:L}}finally{try{A&&!A.done&&(l=P.return)&&l.call(P)}finally{if(o)throw o.error}}else E&&this.removeTerm(T,h,E)}}catch(L){r={error:L}}finally{try{C&&!C.done&&(s=_.return)&&s.call(_)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{v&&!v.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}this._storedFields.delete(h),this._documentIds.delete(h),this._idToShortId.delete(m),this._fieldLength.delete(h),this._documentCount-=1},n.prototype.removeAll=function(e){var t,i;if(e)try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.remove(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Gf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},n.prototype.discard=function(e){var t=this,i=this._idToShortId.get(e);if(i==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(i),this._storedFields.delete(i),(this._fieldLength.get(i)||[]).forEach(function(r,s){t.removeFieldLength(i,s,t._documentCount,r)}),this._fieldLength.delete(i),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},n.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,i=e.minDirtCount,r=e.batchSize,s=e.batchWait;this.conditionalVacuum({batchSize:r,batchWait:s},{minDirtCount:i,minDirtFactor:t})}},n.prototype.discardAll=function(e){var t,i,r=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var s=Xe(e),o=s.next();!o.done;o=s.next()){var l=o.value;this.discard(l)}}catch(u){t={error:u}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=r}this.maybeAutoVacuum()},n.prototype.replace=function(e){var t=this._options,i=t.idField,r=t.extractField,s=r(e,i);this.discard(s),this.add(e)},n.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},n.prototype.conditionalVacuum=function(e,t){var i=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var r=i._enqueuedVacuumConditions;return i._enqueuedVacuumConditions=Jf,i.performVacuuming(e,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},n.prototype.performVacuuming=function(e,t){return KF(this,void 0,void 0,function(){var i,r,s,o,l,u,c,f,d,p,y,m,h,b,v,g,w,S,T,M,_,C,I,E,P;return qF(this,function(A){switch(A.label){case 0:if(i=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];r=e.batchSize||Yf.batchSize,s=e.batchWait||Yf.batchWait,o=1,A.label=1;case 1:A.trys.push([1,7,8,9]),l=Xe(this._index),u=l.next(),A.label=2;case 2:if(u.done)return[3,6];c=Rt(u.value,2),f=c[0],d=c[1];try{for(p=(C=void 0,Xe(d)),y=p.next();!y.done;y=p.next()){m=Rt(y.value,2),h=m[0],b=m[1];try{for(v=(E=void 0,Xe(b)),g=v.next();!g.done;g=v.next())w=Rt(g.value,1),S=w[0],!this._documentIds.has(S)&&(b.size<=1?d.delete(h):b.delete(S))}catch(R){E={error:R}}finally{try{g&&!g.done&&(P=v.return)&&P.call(v)}finally{if(E)throw E.error}}}}catch(R){C={error:R}}finally{try{y&&!y.done&&(I=p.return)&&I.call(p)}finally{if(C)throw C.error}}return this._index.get(f).size===0&&this._index.delete(f),o%r!==0?[3,4]:[4,new Promise(function(R){return setTimeout(R,s)})];case 3:A.sent(),A.label=4;case 4:o+=1,A.label=5;case 5:return u=l.next(),[3,2];case 6:return[3,9];case 7:return T=A.sent(),M={error:T},[3,9];case 8:try{u&&!u.done&&(_=l.return)&&_.call(l)}finally{if(M)throw M.error}return[7];case 9:this._dirtCount-=i,A.label=10;case 10:return[4,null];case 11:return A.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},n.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,i=e.minDirtFactor;return t=t||Kf.minDirtCount,i=i||Kf.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=i},Object.defineProperty(n.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),n.prototype.has=function(e){return this._idToShortId.has(e)},n.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},n.prototype.search=function(e,t){var i,r;t===void 0&&(t={});var s=this.executeQuery(e,t),o=[];try{for(var l=Xe(s),u=l.next();!u.done;u=l.next()){var c=Rt(u.value,2),f=c[0],d=c[1],p=d.score,y=d.terms,m=d.match,h=y.length||1,b={id:this._documentIds.get(f),score:p*h,terms:Object.keys(m),queryTerms:y,match:m};Object.assign(b,this._storedFields.get(f)),(t.filter==null||t.filter(b))&&o.push(b)}}catch(v){i={error:v}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}return e===n.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||o.sort(nw),o},n.prototype.autoSuggest=function(e,t){var i,r,s,o;t===void 0&&(t={}),t=at(at({},this._options.autoSuggestOptions),t);var l=new Map;try{for(var u=Xe(this.search(e,t)),c=u.next();!c.done;c=u.next()){var f=c.value,d=f.score,p=f.terms,y=p.join(" "),m=l.get(y);m!=null?(m.score+=d,m.count+=1):l.set(y,{score:d,terms:p,count:1})}}catch(T){i={error:T}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}var h=[];try{for(var b=Xe(l),v=b.next();!v.done;v=b.next()){var g=Rt(v.value,2),m=g[0],w=g[1],d=w.score,p=w.terms,S=w.count;h.push({suggestion:m,terms:p,score:d/S})}}catch(T){s={error:T}}finally{try{v&&!v.done&&(o=b.return)&&o.call(b)}finally{if(s)throw s.error}}return h.sort(nw),h},Object.defineProperty(n.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),n.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},n.getDefault=function(e){if(Xf.hasOwnProperty(e))return Zf(Xf,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},n.loadJS=function(e,t){var i,r,s,o,l,u,c=e.index,f=e.documentCount,d=e.nextId,p=e.documentIds,y=e.fieldIds,m=e.fieldLength,h=e.averageFieldLength,b=e.storedFields,v=e.dirtCount,g=e.serializationVersion;if(g!==1&&g!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new n(t);w._documentCount=f,w._nextId=d,w._documentIds=su(p),w._idToShortId=new Map,w._fieldIds=y,w._fieldLength=su(m),w._avgFieldLength=h,w._storedFields=su(b),w._dirtCount=v||0,w._index=new Gf;try{for(var S=Xe(w._documentIds),T=S.next();!T.done;T=S.next()){var M=Rt(T.value,2),_=M[0],C=M[1];w._idToShortId.set(C,_)}}catch(F){i={error:F}}finally{try{T&&!T.done&&(r=S.return)&&r.call(S)}finally{if(i)throw i.error}}try{for(var I=Xe(c),E=I.next();!E.done;E=I.next()){var P=Rt(E.value,2),A=P[0],R=P[1],L=new Map;try{for(var N=(l=void 0,Xe(Object.keys(R))),x=N.next();!x.done;x=N.next()){var O=x.value,B=R[O];g===1&&(B=B.ds),L.set(parseInt(O,10),su(B))}}catch(F){l={error:F}}finally{try{x&&!x.done&&(u=N.return)&&u.call(N)}finally{if(l)throw l.error}}w._index.set(A,L)}}catch(F){s={error:F}}finally{try{E&&!E.done&&(o=I.return)&&o.call(I)}finally{if(s)throw s.error}}return w},n.prototype.executeQuery=function(e,t){var i=this;if(t===void 0&&(t={}),e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var r=at(at(at({},t),e),{queries:void 0}),s=e.queries.map(function(b){return i.executeQuery(b,r)});return this.combineResults(s,r.combineWith)}var o=this._options,l=o.tokenize,u=o.processTerm,c=o.searchOptions,f=at(at({tokenize:l,processTerm:u},c),t),d=f.tokenize,p=f.processTerm,y=d(e).flatMap(function(b){return p(b)}).filter(function(b){return!!b}),m=y.map(aV(f)),h=m.map(function(b){return i.executeQuerySpec(b,f)});return this.combineResults(h,f.combineWith)},n.prototype.executeQuerySpec=function(e,t){var i,r,s,o,l=at(at({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce(function(O,B){var F;return at(at({},O),(F={},F[B]=Zf(l.boost,B)||1,F))},{}),c=l.boostDocument,f=l.weights,d=l.maxFuzzy,p=l.bm25,y=at(at({},ew.weights),f),m=y.fuzzy,h=y.prefix,b=this._index.get(e.term),v=this.termResults(e.term,e.term,1,b,u,c,p),g,w;if(e.prefix&&(g=this._index.atPrefix(e.term)),e.fuzzy){var S=e.fuzzy===!0?.2:e.fuzzy,T=S<1?Math.min(d,Math.round(e.term.length*S)):S;T&&(w=this._index.fuzzyGet(e.term,T))}if(g)try{for(var M=Xe(g),_=M.next();!_.done;_=M.next()){var C=Rt(_.value,2),I=C[0],E=C[1],P=I.length-e.term.length;if(P){w==null||w.delete(I);var A=h*I.length/(I.length+.3*P);this.termResults(e.term,I,A,E,u,c,p,v)}}}catch(O){i={error:O}}finally{try{_&&!_.done&&(r=M.return)&&r.call(M)}finally{if(i)throw i.error}}if(w)try{for(var R=Xe(w.keys()),L=R.next();!L.done;L=R.next()){var I=L.value,N=Rt(w.get(I),2),x=N[0],P=N[1];if(P){var A=m*I.length/(I.length+P);this.termResults(e.term,I,A,x,u,c,p,v)}}}catch(O){s={error:O}}finally{try{L&&!L.done&&(o=R.return)&&o.call(R)}finally{if(s)throw s.error}}return v},n.prototype.executeWildcardQuery=function(e){var t,i,r=new Map,s=at(at({},this._options.searchOptions),e);try{for(var o=Xe(this._documentIds),l=o.next();!l.done;l=o.next()){var u=Rt(l.value,2),c=u[0],f=u[1],d=s.boostDocument?s.boostDocument(f,"",this._storedFields.get(c)):1;r.set(c,{score:d,terms:[],match:{}})}}catch(p){t={error:p}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return r},n.prototype.combineResults=function(e,t){if(t===void 0&&(t=$f),e.length===0)return new Map;var i=t.toLowerCase();return e.reduce(rV[i])||new Map},n.prototype.toJSON=function(){var e,t,i,r,s=[];try{for(var o=Xe(this._index),l=o.next();!l.done;l=o.next()){var u=Rt(l.value,2),c=u[0],f=u[1],d={};try{for(var p=(i=void 0,Xe(f)),y=p.next();!y.done;y=p.next()){var m=Rt(y.value,2),h=m[0],b=m[1];d[h]=Object.fromEntries(b)}}catch(v){i={error:v}}finally{try{y&&!y.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}s.push([c,d])}}catch(v){e={error:v}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:s,serializationVersion:2}},n.prototype.termResults=function(e,t,i,r,s,o,l,u){var c,f,d,p,y;if(u===void 0&&(u=new Map),r==null)return u;try{for(var m=Xe(Object.keys(s)),h=m.next();!h.done;h=m.next()){var b=h.value,v=s[b],g=this._fieldIds[b],w=r.get(g);if(w!=null){var S=w.size,T=this._avgFieldLength[g];try{for(var M=(d=void 0,Xe(w.keys())),_=M.next();!_.done;_=M.next()){var C=_.value;if(!this._documentIds.has(C)){this.removeTerm(g,C,t),S-=1;continue}var I=o?o(this._documentIds.get(C),t,this._storedFields.get(C)):1;if(I){var E=w.get(C),P=this._fieldLength.get(C)[g],A=oV(E,S,this._documentCount,P,T,l),R=i*v*I*A,L=u.get(C);if(L){L.score+=R,cV(L.terms,e);var N=Zf(L.match,t);N?N.push(b):L.match[t]=[b]}else u.set(C,{score:R,terms:[e],match:(y={},y[t]=[b],y)})}}}catch(x){d={error:x}}finally{try{_&&!_.done&&(p=M.return)&&p.call(M)}finally{if(d)throw d.error}}}}}catch(x){c={error:x}}finally{try{h&&!h.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}return u},n.prototype.addTerm=function(e,t,i){var r=this._index.fetch(i,iw),s=r.get(e);if(s==null)s=new Map,s.set(t,1),r.set(e,s);else{var o=s.get(t);s.set(t,(o||0)+1)}},n.prototype.removeTerm=function(e,t,i){if(!this._index.has(i)){this.warnDocumentChanged(t,e,i);return}var r=this._index.fetch(i,iw),s=r.get(e);s==null||s.get(t)==null?this.warnDocumentChanged(t,e,i):s.get(t)<=1?s.size<=1?r.delete(e):s.delete(t):s.set(t,s.get(t)-1),this._index.get(i).size===0&&this._index.delete(i)},n.prototype.warnDocumentChanged=function(e,t,i){var r,s;try{for(var o=Xe(Object.keys(this._fieldIds)),l=o.next();!l.done;l=o.next()){var u=l.value;if(this._fieldIds[u]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(i,'" was not present in field "').concat(u,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(c){r={error:c}}finally{try{l&&!l.done&&(s=o.return)&&s.call(o)}finally{if(r)throw r.error}}},n.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},n.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},n.prototype.addFieldLength=function(e,t,i,r){var s=this._fieldLength.get(e);s==null&&this._fieldLength.set(e,s=[]),s[t]=r;var o=this._avgFieldLength[t]||0,l=o*i+r;this._avgFieldLength[t]=l/(i+1)},n.prototype.removeFieldLength=function(e,t,i,r){if(i===1){this._avgFieldLength[t]=0;return}var s=this._avgFieldLength[t]*i-r;this._avgFieldLength[t]=s/(i-1)},n.prototype.saveStoredFields=function(e,t){var i,r,s=this._options,o=s.storeFields,l=s.extractField;if(!(o==null||o.length===0)){var u=this._storedFields.get(e);u==null&&this._storedFields.set(e,u={});try{for(var c=Xe(o),f=c.next();!f.done;f=c.next()){var d=f.value,p=l(t,d);p!==void 0&&(u[d]=p)}}catch(y){i={error:y}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(i)throw i.error}}}},n.wildcard=Symbol("*"),n}(),Zf=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0},rV=(Xa={},Xa[$f]=function(n,e){var t,i;try{for(var r=Xe(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value,l=n.get(o);if(l==null)n.set(o,e.get(o));else{var u=e.get(o),c=u.score,f=u.terms,d=u.match;l.score=l.score+c,l.match=Object.assign(l.match,d),tw(l.terms,f)}}}catch(p){t={error:p}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Xa[Qx]=function(n,e){var t,i,r=new Map;try{for(var s=Xe(e.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,u=n.get(l);if(u!=null){var c=e.get(l),f=c.score,d=c.terms,p=c.match;tw(u.terms,d),r.set(l,{score:u.score+f,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(y){t={error:y}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},Xa[nV]=function(n,e){var t,i;try{for(var r=Xe(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;n.delete(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},Xa),sV={k:1.2,b:.7,d:.5},oV=function(n,e,t,i,r,s){var o=s.k,l=s.b,u=s.d,c=Math.log(1+(t-e+.5)/(e+.5));return c*(u+n*(o+1)/(n+o*(1-l+l*i/r)))},aV=function(n){return function(e,t,i){var r=typeof n.fuzzy=="function"?n.fuzzy(e,t,i):n.fuzzy||!1,s=typeof n.prefix=="function"?n.prefix(e,t,i):n.prefix===!0;return{term:e,fuzzy:r,prefix:s}}},Xf={idField:"id",extractField:function(n,e){return n[e]},tokenize:function(n){return n.split(uV)},processTerm:function(n){return n.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[],logger:function(n,e){typeof(console==null?void 0:console[n])=="function"&&console[n](e)},autoVacuum:!0},ew={combineWith:$f,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:sV},lV={combineWith:Qx,prefix:function(n,e,t){return e===t.length-1}},Yf={batchSize:1e3,batchWait:10},Jf={minDirtFactor:.1,minDirtCount:20},Kf=at(at({},Yf),Jf),cV=function(n,e){n.includes(e)||n.push(e)},tw=function(n,e){var t,i;try{for(var r=Xe(e),s=r.next();!s.done;s=r.next()){var o=s.value;n.includes(o)||n.push(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},nw=function(n,e){var t=n.score,i=e.score;return i-t},iw=function(){return new Map},su=function(n){var e,t,i=new Map;try{for(var r=Xe(Object.keys(n)),s=r.next();!s.done;s=r.next()){var o=s.value;i.set(parseInt(o,10),n[o])}}catch(l){e={error:l}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return i},uV=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;class dV{constructor(){this._searchEngine=new iV({fields:["path","name"],storeFields:["path"],tokenize:(e,t)=>e.split(/[\s/]+/)}),this.idMaps={}}addZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.add(o),this.idMaps[t]={path:s,zincObject:e}}removeZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.remove(o),delete this.idMaps[t]}addRegion(e,t){let i=e.getFullPath(),r=e.getName();i=i.replaceAll('"',""),r=r.replaceAll('"',"");const s={path:i,name:r,id:t};this._searchEngine.add(s),this.idMaps[t]={path:i,zincObject:e}}clearResults(){this._}removeAll(){this._searchEngine.removeAll(),this.idMaps={}}auto_suggest(e){let t=[];e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];t.forEach(o=>{o.id in this.idMaps&&i.push(this.idMaps[o.id].path)});const r=[...new Set(i)],s=[];return r.forEach(o=>s.push({suggestion:'"'+o+'"'})),s}processResults(e,t){const i={regionPath:void 0,label:'Search Results for "'};return Array.isArray(t)?i.label+=",".join(t):i.label+=t,i.label+='"',e.length===1&&(e[0].isRegion?i.regionPath=e[0].getFullPath():e[0].isZincObject&&(i.regionPath=e[0].getRegion().getFullPath(),i.label=e[0].groupName)),i.zincObjects=uF(e),i}search(e){let t;e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];return t.forEach(r=>{r.id in this.idMaps&&i.push(this.idMaps[r.id].zincObject)}),i}searchTerms(e){let t=[];return e.forEach(i=>{const r=this.search(i);t.push(...r)}),t}searchAndProcessResult(e){let t=[];return Array.isArray(e)?t=this.searchTerms(e):t=this.search(e),this.processResults(t,e)}}const hV={name:"ScaffoldVuer",components:{Button:Cs,Col:On,Loading:YR,Option:Rs,Popover:Pl,Row:Jn,Select:As,Slider:En,TabPane:Hg,Tabs:Gg,MapSvgIcon:qf.MapSvgIcon,MapSvgSpriteColor:qf.MapSvgSpriteColor,PrimitiveControls:Dx,ScaffoldTooltip:jx,ElIconWarningFilled:om,ElIconArrowDown:Ru,ElIconArrowLeft:Hi,DrawToolbar:Ja.DrawToolbar,ScaffoldTreeControls:Bx},setup(n){let e=a.inject("$annotator");return e||(e=a.markRaw(new HF(`${n.flatmapAPI}annotator`)),a.provide("$annotator",e)),{annotator:e}},props:{annotationSidebar:{type:Boolean,default:!1},url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},displayWarning:{type:Boolean,default:!0},warningMessage:{type:String,default:"Beta feature - under active development"},displayLatestChanges:{type:Boolean,default:!1},latestChangesMessage:{type:String,default:"New feature - Local search is now available"},displayMarkers:{type:Boolean,default:!1},markerCluster:{type:Boolean,default:!1},markerLabels:{type:Object,default:function(){return{}}},displayMinimap:{type:Boolean,default:!1},format:{type:String,default:"metadata"},minimapSettings:{type:Object,default:function(){return{x_offset:16,y_offset:16,width:128,height:128,align:"top-right"}}},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},state:{type:Object,default:void 0},region:{type:String,default:""},viewURL:{type:String,default:""},render:{type:Boolean,default:!0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"}},provide(){return{flatmapAPI:this.flatmapAPI,scaffoldUrl:this.url,boundingDims:this.boundingDims}},data:function(){return{annotator:void 0,createData:{drawingBox:!1,toBeConfirmed:!1,points:[],shape:"",x:0,y:0,editingIndex:-1,faceIndex:-1,toBeDeleted:!1},currentTime:0,timeVarying:!1,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"sliderPopover"},{value:!1,ref:"regionVisibilityPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"}],inHelp:!1,helpModeActiveIndex:this.helpModeInitialIndex,loading:!1,duration:3e3,drawerOpen:!0,currentBackground:"white",availableBackground:["white","lightskyblue","black"],minimisedSlider:!1,sliderPosition:"",timeMax:100,orginalDuration:"",animateDuration:"6secs",playSpeed:[{value:.1,label:"0.1x"},{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],currentSpeed:1,timeStamps:{},defaultCheckedKeys:[],tData:{label:"",region:"",visible:!1,x:200,y:200,active:!1},fileFormat:"metadata",previousMarkerLabels:a.markRaw({}),viewingMode:"Exploration",viewingModes:{Exploration:"View and explore detailed visualization of 3D scaffolds",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},openMapRef:void 0,backgroundIconRef:void 0,annotationFeature:{},offlineAnnotationEnabled:!1,offlineAnnotations:a.markRaw([]),authorisedUser:void 0,toolbarOptions:["Delete","Edit","Point","LineString"],existDrawnFeatures:a.markRaw([]),activeDrawTool:void 0,activeDrawMode:void 0,boundingDims:{centre:[0,0,0],size:[1,1,1]},lastSelected:a.markRaw({region:"",group:"",isSearch:!1})}},watch:{format:{handler:function(n){this.fileFormat=n},immediate:!0},url:{handler:function(n){(this.state===void 0||this.state.url===void 0)&&this.setURL(n)},immediate:!0},region:{handler:function(n){this.state||this.viewURL||this.setFocusedRegion(n)},immediate:!0},state:{handler:function(n){this.setState(n)},immediate:!0,deep:!0},viewURL:{handler:function(n){this.updateViewURL(n)},immediate:!0},helpMode:function(n,e){n!==e&&this.setHelpMode(n)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},displayMarkers:function(n){this.$module.scene.displayMarkers=n,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(n){this.$module.scene.displayMinimap=n},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(n){this.toggleRendering(n)},markerCluster:{handler:function(n){this.$module.scene.enableMarkerCluster(n)},immediate:!0},markerLabels:function(n){for(const[e,t]of Object.entries(this.previousMarkerLabels))this.setMarkerModeForObjectsWithName(e,t,"off");for(const[e,t]of Object.entries(n))this.setMarkerModeForObjectsWithName(e,t,"on");this.previousMarkerLabels=a.markRaw({...n})}},beforeCreate:function(){this.$module=new Zx,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new dV},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.$refs.scaffoldTreeControls.setModule(this.$module);let n=new $F;n.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(n),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer),this.helpTextWait=[],this.helpTextWait.length=this.hoverVisibilities.length,this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()})},beforeUnmount:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},computed:{...Hx(Wx,["userToken"]),annotationDisplay:function(){return this.viewingMode==="Annotation"&&this.tData.active===!0&&this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"},modeDescription:function(){let n=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.authorisedUser?n[1]:n[0]:n}},methods:{enableAxisDisplay:function(n,e){this.$module.scene&&this.$module.scene.enableAxisDisplay(n,e)},createAxisDisplay:function(n){this.$module.scene&&this.$module.scene.createAxisDisplay(n)},addZincObject:function(n){this.$module.scene&&this.$module.scene.addZincObject(n)},zincObjectAdded:function(n){this.loading=!1,this.$_searchIndex.addZincObject(n,n.uuid),this.timeVarying===!1&&n.isTimeVarying()&&(this.timeVarying=!0),this.$emit("zinc-object-added",n)},removeFromOfflineAnnotation:function(n,e){for(let t=0;t<this.offlineAnnotations.length;t++){const i=this.offlineAnnotations[t];if(i.region===n&&i.group===e){this.offlineAnnotations.splice(t,1);return}}},zincObjectRemoved:function(n){if(this.$module.scene){const e=n.groupName;n.region.findObjectsWithGroupName(e,!1).length===0&&this.$_searchIndex.removeZincObject(n,n.uuid)}},addRegionsToSearchIndex:function(){this.$module.scene.getRootRegion().getChildRegions(!0).forEach(t=>{this.$_searchIndex.addRegion(t,t.uuid)})},backgroundChangeCallback:function(n){this.currentBackground=n,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let n=this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"),e=document.createElement("a");document.body.append(e),this.captureFilename?e.download=this.captureFilename:e.download="screenshot.png",e.href=n,e.click(),e.remove()},captureScreenshot:function(n){this.captureFilename=n,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},addAndEditAnnotations:function(n,e,t,i){const r=Cx(this.annotator,this.userToken,t,n,e,this.url,i);if(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(s=>s.id!==r.item.id)),this.existDrawnFeatures.push(r.feature),this.offlineAnnotationEnabled){r.group=e;let s=n;s.slice(-1)==="/"&&(s=s.slice(0,-1)),r.region=s,this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations.push(r),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))}this.$emit("userPrimitivesUpdated",{region:n,group:e,zincObject:t})},primitivesUpdated:function(n){if(n.isZincObject&&n.isEditable){const e=n.groupName,t=n.region.getFullPath();this.addAndEditAnnotations(t,e,n,"Position Updated")}},confirmCreate:function(n){if(n){let e;if(n.shape==="Point")e=this.$module.scene.createPoints(n.region,n.group,this.createData.points,n.group,8942);else if(n.shape==="LineString")e=this.$module.scene.createLines(n.region,n.group,[this.createData.points[0],this.createData.points[1]],60962);else if(n.editingIndex>-1&&this._editingZincObject){this._editingZincObject.editVertices([this.createData.points[1]],n.editingIndex);const t=this._editingZincObject.region.getFullPath()+"/",i=this._editingZincObject.groupName;this.addAndEditAnnotations(t,i,this._editingZincObject,"Position Updated")}e&&(this.addAndEditAnnotations(n.region,n.group,e.zincObject,"Create"),e.zincObject.isEditable=!0,this.tData.region=n.region,this.tData.label=n.group,this.changeActiveByName([n.group],n.region,!1))}this.cancelCreate()},cancelCreate:function(){this.createData.points.length=0,this.createData.toBeConfirmed=!1,this._editingZincObject=void 0,this.createData.editingIndex=-1,this.createData.faceIndex=-1,this.tData.visible=!1,this.createData.toBeDeleted=!1,this._tempLine&&(this.$module.scene.removeTemporaryPrimitive(this._tempLine),this._tempLine=void 0),this._tempPoint&&(this.$module.scene.removeTemporaryPrimitive(this._tempPoint),this._tempPoint=void 0),this.annotationSidebar&&this.$emit("annotation-close")},confirmComment:function(n){if(this._editingZincObject){let e=n;this._editingZincObject.isEditable&&(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(t=>t.id!==e.item.id)),this.existDrawnFeatures.push(n.feature)),this.offlineAnnotationEnabled&&(e.group=this._editingZincObject.groupName,e.region=this._editingZincObject.region.getFullPath(),this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations.push(e),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations)))}},confirmDelete:function(){var n;if((n=this._editingZincObject)!=null&&n.isEditable){const e=this._editingZincObject.region.getFullPath()+"/",t=this._editingZincObject.groupName,i=Cx(this.annotator,this.userToken,this._editingZincObject,e,t,this.url,"Deleted");i&&(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(s=>s.id!==i.item.id)),this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject),this.offlineAnnotationEnabled&&(this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations=this.offlineAnnotations.filter(s=>s.item.id!==i.item.id),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))))}this.cancelCreate()},onTooltipHide:function(){this.createData.toBeConfirmed&&!this.annotationSidebar&&this.cancelCreate()},formatTooltip(n){if(this.timeMax>=1e3&&n){let e=(n%6e4/1e3).toFixed(2)+"s";return(n>6e4?(n/6e4).toFixed(0)+"m ":"")+e}return n?n.toFixed(2)+" ms":"0 ms"},fitWindow:function(){if(this.$module.scene){let n=!1;this._boundingBoxGeo&&(n=this._boundingBoxGeo.getVisibility(),this._boundingBoxGeo.setVisibility(!1)),this.$module.scene.viewAll(),this._boundingBoxGeo&&(lF(this._boundingBoxGeo,this.$module.scene),this._boundingBoxGeo.setVisibility(n))}},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(n){this.currentSpeed=n,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(n){let e=[];return n&&n!=""&&this.$module.scene&&(e=this.$module.scene.findObjectsWithGroupName(n)),e},toggleDrawing:function(n,e){this.createData.toBeDeleted=!1,n==="mode"?(this.cancelCreate(),this.activeDrawMode=e,this.createData.shape="",this.$module.selectObjectOnPick=!0):n==="tool"&&(this.activeDrawTool=e,this.createData.shape=this.activeDrawTool?this.activeDrawTool:"",this.$module.selectObjectOnPick=!1)},toggleDrawingBox:function(){this.createData.drawingBox=!this.createData.drawingBox},viewRegion:function(n){const e=this.$module.scene.getRootRegion(),t=Array.isArray(n)?n:[n],i=Ro(e,t,"",!0);let r=this.$module.scene.getBoundingBoxOfZincObjects(i);if(r){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(r);else{const s=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(r),this.$module.scene.camera.far=this.$module.scene.camera.near+s,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(n){n&&(this.isReady?this.viewRegion(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:n})))},updateViewURL:function(n){if(n)if(this.isReady){const e=new URL(n,this.url);this.$module.scene.loadViewURL(e)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:n}))},createEditTemporaryLines:function(n){const e=n[0].extraData.worldCoords;if(e&&(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.createData.points.length===1)if(this.showRegionTooltipWithAnnotations(n,!0,!1),this.tData.x=50,this.tData.y=200,this._tempLine){const t=this._tempLine.geometry.getAttribute("position");t.setXYZ(1,e[0],e[1],e[2]),t.needsUpdate=!0}else this._tempLine=this.$module.scene.addTemporaryLines([this.createData.points[0],e],65535)},draw:function(n){n&&n.length>0&&n[0].data.group&&n[0].extraData.worldCoords&&(this.createData.shape==="Point"?this.drawPoint(n[0].extraData.worldCoords,n):(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.drawLine(n[0].extraData.worldCoords,n))},drawPoint:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length=0,this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200,this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960))},drawLine:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length===1?(this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200):(this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960),this.createData.points.push(n)))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let n=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,n.enableAutoTumble(),n.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},activateAnnotationMode:function(n,e){if(this.authorisedUser||this.offlineAnnotationEnabled)if(this.createData.toBeDeleted=!1,this.createData.shape!==""||this.createData.editingIndex>-1)n.length>0&&e.identifiers[0].coords&&(this.createData.x=e.identifiers[0].coords.x,this.createData.y=e.identifiers[0].coords.y,this.draw(e.identifiers));else{if(this.activeDrawMode==="Edit"){const t=rF(e);t&&this.activateEditingMode(t.zincObject,t.faceIndex,t.vertexIndex,t.point)}else if(this.activeDrawMode==="Delete"){const t=oF(e);t&&(this.createData.toBeDeleted=!0,this._editingZincObject=t)}this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"?this.showRegionTooltipWithAnnotations(e.identifiers,!0,!1):this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)}else this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)},activateEditingMode:function(n,e,t,i){this._editingZincObject=n,this.createData.faceIndex=e,this.createData.editingIndex=t,this.drawLine(i,void 0)},eventNotifierCallback:function(n){if(!(this.createData.toBeConfirmed||this.createData.toBeDeleted)){const e=[];let t=[];(n.eventType==1||n.eventType==2)&&(n.identifiers.forEach(s=>{if(s){let o=s.data.id?s.data.id:s.data.group;e.push(o)}}),t=n.zincObjects);let i,r;if(n.identifiers.length>0&&n.identifiers[0]&&(i=n.identifiers[0].data.id?n.identifiers[0].data.id:n.identifiers[0].data.group,n.identifiers[0].data.region&&(r=n.identifiers[0].data.region)),n.eventType==1)if(this.viewingMode==="Annotation"){this.tData.label=i,this.tData.region=r;const s=sF(n);if(this._editingZincObject=s,s){const o=this._editingZincObject.region.getFullPath()+"/",l=this._editingZincObject.groupName;this.annotationFeature=Tx(this._editingZincObject,o,l,this.url,"").feature}this.activateAnnotationMode(e,n)}else this.$refs.scaffoldTreeControls&&(e.length>0?(this.$refs.scaffoldTreeControls.updateActiveUI(t),this.updatePrimitiveControls(t)):(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls.removeActive(!1))),n.identifiers.length===1?(this.lastSelected.isSearch=!1,this.lastSelected.region=r,this.lastSelected.group=n.identifiers[0].data.group):n.identifiers.length===0&&(this.lastSelected.isSearch=!1,this.lastSelected.region="",this.lastSelected.group=""),this.$emit("scaffold-selected",n.identifiers);else if(n.eventType==2)this.selectedObjects.length===0&&(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls&&(e.length>0?this.$refs.scaffoldTreeControls.updateHoverUI(t):this.$refs.scaffoldTreeControls.removeHover(!0)),n.identifiers.length>0&&n.identifiers[0]&&n.identifiers[0].coords&&(this.tData.active=!1,(this.viewingMode!=="Annotation"||!this.annotationSidebar)&&(this.tData.visible=!0),this.tData.label=i,this.tData.region=r,this.tData.x=n.identifiers[0].coords.x,this.tData.y=n.identifiers[0].coords.y,this.createEditTemporaryLines(n.identifiers)),this.$emit("scaffold-highlighted",n.identifiers));else if(n.eventType==3&&n.identifiers.length>0&&n.identifiers[0]){if(n.identifiers[0].coords){const s=this.$refs.scaffoldContainer.getBoundingClientRect();this.tData.x=n.identifiers[0].coords.x-s.left,this.tData.y=n.identifiers[0].coords.y-s.top}this.createEditTemporaryLines(n.identifiers)}}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(n){let e=n/this.timeMax*100;e!=this.currentTime&&this.$module.updateTime(e)},updatePrimitiveControls:function(n){this.selectedObjects=n,this.selectedObjects&&this.selectedObjects.length>0?this.$refs.primitiveControls.setObject(this.selectedObjects[0]):this.$refs.primitiveControls.setObject(void 0)},objectSelected:function(n,e){this.updatePrimitiveControls(n),this.$module.setSelectedByZincObjects(n,void 0,{},e)},objectHovered:function(n,e){this.hoveredObjects=n,this.$module.setHighlightedByZincObjects(n,void 0,{},e)},changeActiveByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeActive(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeActiveByNames(r,e,t)}},changeHighlightedByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeHover(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeHoverByNames(r,e,t)}},play:function(n){this.$module.playAnimation(n),this.isPlaying=n},setHelpMode:function(n){const e=this.hoverVisibilities.length,t=e-1,i=this.hoverVisibilities[this.helpModeActiveIndex];if(i){const r=i==null?void 0:i.refs,s=i==null?void 0:i.ref;this.$refs[r||s]||(this.helpModeActiveIndex+=1)}n||(this.helpModeActiveIndex=this.helpModeInitialIndex),n&&this.helpModeActiveIndex>=t&&this.$emit("help-mode-last-item",!0),n&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(r=>{r.value=!0})):n&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1&&setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}),this.showHelpText(this.helpModeActiveIndex,200)},300):(this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}))},displayTooltipOfObjectsCallback:function(n,e,t,i,r){const s=this;return function(){s.$module.zincRenderer.removePostRenderCallbackFunction(s.$_regionTooltipCallback),s.$_regionTooltipCallback=void 0,s.displayTooltipOfObjects(n,e,t,i,r)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(n,e,t,i,r){if(e.length>0){let s=e[0].getClosestVertexDOMElementCoords(this.$module.scene);if(s)return s.inView?(n.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=n,this.tData.x=s.position.x,this.tData.y=s.position.y,this.tData.region=t,this.$_liveCoordinatesUpdated&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),r&&(this.$module.setupLiveCoordinates(e),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),i&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(n,e,t,i,r)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(n,e,t,i,r){return n&&e&&e.length>0&&this.$module.scene?this.displayTooltipOfObjects(n,e,t,i,r):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(n,e,t){if(n&&this.$module.scene){const i=this.$module.scene.getRootRegion(),s=Ro(i,[n],"",!0);let o;return s&&s.length>0&&(o=s[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(n,s,o,e,t)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(n,e,t){if(this.$module.scene){const i=Ex(this.$module.scene,n);if(i&&i.objects.length>0)if(this.annotationSidebar){const s={featureId:(this.tData.region?this.tData.region+"/":"")+this.tData.label,resourceId:this.url,resource:this.url,feature:this.annotationFeature,offline:this.offlineAnnotationEnabled};this.$emit("annotation-open",{annotationEntry:s,createData:this.createData,confirmCreate:this.confirmCreate,cancelCreate:this.cancelCreate,confirmDelete:this.confirmDelete,confirmComment:this.confirmComment});return}else return this.showRegionTooltipWithObjects(i.label,i.objects,i.regionPath,e,t)}return this.hideRegionTooltip(),!1},clearAnnotationFeature:function(){const n=this.getOfflineAnnotations();this.existDrawnFeatures.map(t=>decodeURIComponent(t.id).split("/").pop()).forEach(t=>{const i=this.$module.scene.findObjectsWithGroupName(t,!1);if(i&&i.length){const r=i[0].region.getFullPath()+"/";this.$module.scene.getRootRegion().findChildFromPath(r).removeZincObject(i[0])}}),this.$refs.scaffoldTreeControls.removeRegion("__annotation"),this.offlineAnnotations=n},addAnnotationFeature:async function(){let n;if(this.offlineAnnotationEnabled)this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],n=this.offlineAnnotations.filter(e=>e.resource===this.url&&e.feature.properties.drawn).map(e=>e.feature);else{n=[];const e=await Ax(this.annotator,this.userToken,this.url);e&&e.features&&(n=[...e.features]);const t=await Ax(this.annotator,this.userToken,encodeURIComponent(this.url));t&&t.features&&(n=[...n,...t.features])}this.existDrawnFeatures=a.markRaw(n),Rx(this.$module.scene,n)},changeViewingMode:function(n){this.$module&&(n&&(this.viewingMode=n),this.clearAnnotationFeature(),this.viewingMode==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(e=>{e.name&&e.email&&e.canUpdate?(this.authorisedUser=e,this.offlineAnnotationEnabled=!1):(this.authorisedUser=void 0,this.offlineAnnotationEnabled=!0),this.addAnnotationFeature(),this.loading=!1})):this.viewingMode==="Exploration"&&(this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.createData.shape=""),this.viewingMode==="Exploration"||this.viewingMode==="Annotation"&&this.createData.shape===""?this.$module.selectObjectOnPick=!0:this.$module.selectObjectOnPick=!1,this.cancelCreate())},hideRegionTooltip:function(){this.$_liveCoordinatesUpdated&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),this.$module.setupLiveCoordinates(void 0)),this.tData.active=!1,this.tData.visible=!1,this.tData.region=void 0},setMarkerModeForObjectsWithName:function(n,e,t){if(n&&this.$module.scene){let i=e;typeof e=="number"&&(i={number:e,imgURL:void 0});const r=this.$module.scene.getRootRegion();Ro(r,[n],"",!0).forEach(l=>l.setMarkerMode(t,i))}},setMarkerModeWithAnnotations:function(n,e){if(this.$module.scene){const t=Ex(this.$module.scene,n);t&&t.objects.length>0&&t.objects.forEach(i=>i.setMarkerMode(e))}},showHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!0,this.$emit("shown-tooltip")},e))},hideHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!1},e))},search:function(n,e){if(this.$_searchIndex){if(n===void 0||n===""||Array.isArray(n)&&n.length===0)return this.lastSelected.region="",this.lastSelected.group="",this.lastSelected.isSearch=!0,this.objectSelected([],!0),!1;{this.lastSelected.region="",this.lastSelected.group=n,this.lastSelected.isSearch=!0;const t=this.$_searchIndex.searchAndProcessResult(n),i=t.zincObjects;if(i.length>0){if(this.objectSelected(i,!0),e)for(let r=0;r<i.length;r++)i[r]&&i[r].groupName&&this.showRegionTooltipWithObjects(t.label,i,t.regionPath,!0,!0);return!0}else this.objectSelected([],!0)}}return!1},fetchSuggestions:function(n){return this.$_searchIndex===void 0?[]:this.$_searchIndex.auto_suggest(n)},updateMinimapScissor:function(){Object.keys(this.minimapSettings).forEach(n=>{this.$module.scene.minimapScissor[n]=this.minimapSettings[n]}),this.$module.scene.minimapScissor.updateRequired=!0},updateSettingsfromScene:function(){this.currentSpeed=1,this.$module.setPlayRate(this.defaultRate),this.orginalDuration=this.$module.scene.getMetadataTag("OriginalDuration"),this.animateDuration=this.$module.scene.getMetadataTag("Duration");let n=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const e in n)this.timeStamps[n[e]]=e;this.timeMax=this.$module.scene.getDuration()},restoreSettings:function(n){if(n){if(n.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(n.viewport);else if(n.viewURL&&n.viewURL!==""){const t=new URL(n.viewURL,this.url);this.$module.scene.loadViewURL(t)}else n.region&&n.region!==""&&this.viewRegion(n.region);n.visibility&&this.$nextTick(()=>{this.$refs.scaffoldTreeControls.setState(n.visibility)}),n.background&&this.backgroundChangeCallback(n.background),n.offlineAnnotations&&sessionStorage.setItem("anonymous-annotation",n.offlineAnnotations),n.viewingMode&&this.changeViewingMode(n.viewingMode);const e=n.search;e&&e.group&&(e.isSearch?this.search(e.group,!0):this.changeActiveByName(e.group,e.region,!0))}},downloadErrorCallback:function(){return n=>{this.$emit("on-error",n)}},setURLFinishCallback:function(n){return()=>{this.offlineAnnotations.length=0,this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.$emit("on-ready"),this.setMarkers(),this._boundingBoxGeo=this.$module.scene.addBoundingBoxPrimitive("_helper","boundingBox",4251856,.15),this._slides=this.$module.scene.addSlicesPrimitive("_helper",["x-plane","y-plane","z-plane"],[16733525,5635925,5592575],.5);const{centre:e,size:t}=this.$module.getCentreAndSize();this.boundingDims.centre=e,this.boundingDims.size=t,this.$nextTick(()=>this.restoreSettings(n)),this.isReady=!0}},getState:function(){let n={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0,background:this.currentBackground,viewingMode:this.viewingMode};if(this.$refs.scaffoldTreeControls&&(n.visibility=this.$refs.scaffoldTreeControls.getState()),this.$module.scene){let e=this.$module.scene.getZincCameraControls();n.viewport=e.getCurrentViewport()}return this.lastSelected&&this.lastSelected.group&&(n.search={...this.lastSelected}),this.offlineAnnotationEnabled&&(n.offlineAnnotations=sessionStorage.getItem("anonymous-annotation")),n},setState:function(n){n&&(n.url&&n.url!==this._currentURL?this.setURLAndState(n.url,{fileFormat:n.fileFormat,viewport:n.viewport,visibility:n.visibility,background:n.background,viewingMode:n.viewingMode,search:n.search,offlineAnnotations:n.offlineAnnotations}):(n.background||n.search||n.viewport||n.viewingMode||n.visibility)&&(this.isReady&&this.$module.scene?this.restoreSettings(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:n.background,viewingMode:n.viewingMode,viewport:n.viewport,visibility:n.visibility,search:n.search,offlineAnnotations:n.offlineAnnotations}))))},exportGLTF:function(n){return this.$module.scene.exportGLTF(n)},getOfflineAnnotations:function(){return[...this.offlineAnnotations]},importOfflineAnnotations:function(n){if(this.offlineAnnotationEnabled){n.forEach(t=>{const i=t.group,r=t.region;let s=r.slice(-1)==="/"?r:r+"/";const o=s.slice(0,-1);t.region=o,s=s+i;const l=s;t.item.id=l,t.feature.id=l});const e=n.map(t=>t.feature);Rx(this.$module.scene,e),n.forEach(t=>{this.offlineAnnotations.push({...t})}),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))}},setURLAndState:function(n,e){n!=this._currentURL&&(e!=null&&e.format&&(this.fileFormat=e.format),this._currentURL=n,this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.loading=!0,this.timeVarying=!1,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setDownloadErrorCallback(this.downloadErrorCallback()),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:e==null?void 0:e.background,region:this.region,search:e==null?void 0:e.search,viewingMode:e==null?void 0:e.viewingMode,viewURL:this.viewURL,viewport:e==null?void 0:e.viewport,visibility:e==null?void 0:e.visibility,offlineAnnotations:e==null?void 0:e.offlineAnnotations})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(n,"scene",!0):this.$module.loadOrgansFromURL(n,void 0,void 0,"scene",void 0,!0),this.$module&&this.$module.scene&&(this.$module.scene.displayMarkers=this.displayMarkers,this.$module.scene.forcePickableObjectsUpdate=!0,this.$module.scene.displayMinimap=this.displayMinimap,this.updateMinimapScissor()))},setURL:function(n){this.setURLAndState(n,void 0)},drawerToggled:function(n){this.drawerOpen=n,this.adjustLayout()},adjustLayout:function(){if(this.$refs.scaffoldContainer){let n=this.$refs.scaffoldContainer.clientWidth;this.minimisedSlider=n<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""}},toggleRendering:function(n){this.$module.zincRenderer&&(n?this.$module.zincRenderer.animate():this.$module.zincRenderer.stopAnimate())},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const n=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",n)},toggleSyncControl:function(n,e){this.$module.toggleSyncControl(n,e),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){for(const[n,e]of Object.entries(this.markerLabels))this.setMarkerModeForObjectsWithName(n,e,"on")}}},fV={ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},pV={class:"primitive-controls-box"},mV={class:"animation-data"},gV={class:"purple"},yV={class:"animation-data"},vV={class:"purple"},bV={class:"animation-data"},xV={class:"bottom-right-control"},wV={style:{"margin-bottom":"2px"}},MV={key:0,class:"viewing-mode-title"},SV=["onClick"],_V=["onClick"];function EV(n,e,t,i,r,s){const o=a.resolveComponent("map-svg-sprite-color"),l=jx,u=a.resolveComponent("DrawToolbar"),c=om,f=ht,d=Pl,p=Bx,y=Dx,m=a.resolveComponent("map-svg-icon"),h=En,b=Jn,v=Hg,g=Rs,w=As,S=Gg,T=Cs,M=pd;return a.withDirectives((a.openBlock(),a.createElementBlock("div",fV,[a.createVNode(o),a.createVNode(l,{createData:n.createData,label:n.tData.label,region:n.tData.region,visible:n.tData.visible,x:n.tData.x,y:n.tData.y,annotationDisplay:s.annotationDisplay,annotationFeature:n.annotationFeature,offlineAnnotationEnabled:n.offlineAnnotationEnabled,onConfirmCreate:e[0]||(e[0]=_=>s.confirmCreate(_)),onCancelCreate:e[1]||(e[1]=_=>s.cancelCreate()),onConfirmComment:e[2]||(e[2]=_=>s.confirmComment(_)),onConfirmDelete:e[3]||(e[3]=_=>s.confirmDelete()),onTooltipHide:e[4]||(e[4]=_=>s.onTooltipHide())},null,8,["createData","label","region","visible","x","y","annotationDisplay","annotationFeature","offlineAnnotationEnabled"]),a.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:e[5]||(e[5]=a.withKeys((..._)=>s.backgroundChangeCallback&&s.backgroundChangeCallback(..._),["66"]))},null,544),a.withDirectives(a.createElementVNode("div",null,[n.viewingMode==="Annotation"&&(n.authorisedUser||n.offlineAnnotationEnabled)?(a.openBlock(),a.createBlock(u,{key:0,toolbarOptions:n.toolbarOptions,activeDrawTool:n.activeDrawTool,activeDrawMode:n.activeDrawMode,hoverVisibilities:n.hoverVisibilities,onClickToolbar:s.toggleDrawing,onShowTooltip:s.showHelpText,onHideTooltip:s.hideHelpText,ref:"toolbarPopover"},null,8,["toolbarOptions","activeDrawTool","activeDrawMode","hoverVisibilities","onClickToolbar","onShowTooltip","onHideTooltip"])):a.createCommentVNode("",!0),t.displayWarning?(a.openBlock(),a.createBlock(d,{key:1,ref:"warningPopover",visible:n.hoverVisibilities[7].value,content:t.warningMessage,placement:"right",width:"max-content",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[t.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-icon warning-icon",onMouseover:e[6]||(e[6]=_=>s.showHelpText(7)),onMouseout:e[7]||(e[7]=_=>s.hideHelpText(7))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),e[27]||(e[27]=a.createElementVNode("span",{class:"message-text"},"Beta",-1))],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),t.displayLatestChanges?(a.openBlock(),a.createBlock(d,{key:2,visible:n.hoverVisibilities[8].value,content:t.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable",ref:"whatsNewPopover"},{reference:a.withCtx(()=>[t.displayLatestChanges&&t.latestChangesMessage?(a.openBlock(),a.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon",onMouseover:e[8]||(e[8]=_=>s.showHelpText(8)),onMouseout:e[9]||(e[9]=_=>s.hideHelpText(8))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),e[28]||(e[28]=a.createElementVNode("span",{class:"message-text"},"What's new?",-1))],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),a.createVNode(d,{visible:n.hoverVisibilities[6].value,content:"Change region visibility",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"regionVisibilityPopover"},{reference:a.withCtx(()=>[a.createVNode(p,{ref:"scaffoldTreeControls",isReady:n.isReady,"show-colour-picker":t.showColourPicker,onObjectSelected:s.objectSelected,onObjectHovered:s.objectHovered,onDrawerToggled:s.drawerToggled},null,8,["isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),a.createElementVNode("div",pV,[a.createVNode(y,{ref:"primitiveControls",createData:n.createData,onPrimitivesUpdated:s.primitivesUpdated},null,8,["createData","onPrimitivesUpdated"])]),n.timeVarying?(a.openBlock(),a.createBlock(d,{key:3,ref:"sliderPopover",width:"max-content",visible:n.hoverVisibilities[5].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:a.withCtx(()=>[n.timeVarying?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["time-slider-container",[n.minimisedSlider?"minimised":"",n.sliderPosition]])},[a.createVNode(S,{type:"card"},{default:a.withCtx(()=>[a.createVNode(v,{label:"Animate scaffold"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[n.isPlaying?(a.openBlock(),a.createBlock(m,{key:0,icon:"pause",class:"icon-button video-button",onClick:e[10]||(e[10]=_=>s.play(!1))})):(a.openBlock(),a.createBlock(m,{key:1,icon:"play",class:"video-button icon-button",onClick:e[11]||(e[11]=_=>s.play(!0))})),a.createVNode(h,{min:0,max:n.timeMax,"model-value":n.currentTime/100*n.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":s.formatTooltip,marks:n.timeStamps,onInput:e[12]||(e[12]=_=>s.timeChange(_))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),a.createVNode(v,{label:"Animation data"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[a.createElementVNode("div",mV,[e[29]||(e[29]=a.createTextVNode(" Original duration: ")),a.createElementVNode("div",gV,a.toDisplayString(n.orginalDuration),1)]),a.createElementVNode("div",yV,[e[30]||(e[30]=a.createTextVNode(" Animation duration: ")),a.createElementVNode("div",vV,a.toDisplayString(n.animateDuration),1)]),a.createElementVNode("div",bV,[e[31]||(e[31]=a.createTextVNode(" Playback speed ")),a.createVNode(w,{teleported:!0,"model-value":n.currentSpeed,placeholder:"Select",class:"scaffold-select-box speed","popper-class":"scaffold_viewer_dropdown",onChange:e[13]||(e[13]=_=>s.speedChanged(_))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.playSpeed,_=>(a.openBlock(),a.createBlock(g,{key:_.value,label:_.label,value:_.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):a.createCommentVNode("",!0)]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createElementVNode("div",xV,[a.createVNode(d,{visible:n.hoverVisibilities[0].value,content:"Zoom in",width:"max-content",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable",ref:"zoomInPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[14]||(e[14]=_=>s.zoomIn()),onMouseover:e[15]||(e[15]=_=>s.showHelpText(0)),onMouseout:e[16]||(e[16]=_=>s.hideHelpText(0))})]),_:1},8,["visible"]),a.createVNode(d,{visible:n.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable",ref:"zoomOutPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[17]||(e[17]=_=>s.zoomOut()),onMouseover:e[18]||(e[18]=_=>s.showHelpText(1)),onMouseout:e[19]||(e[19]=_=>s.hideHelpText(1))})]),_:1},8,["visible"]),a.createVNode(d,{visible:n.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper non-selectable",ref:"zoomFitPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[20]||(e[20]=_=>s.fitWindow()),onMouseover:e[21]||(e[21]=_=>s.showHelpText(2)),onMouseout:e[22]||(e[22]=_=>s.hideHelpText(2))})]),default:a.withCtx(()=>[e[32]||(e[32]=a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1))]),_:1},8,["visible"])]),n.openMapRef?(a.openBlock(),a.createBlock(d,{key:4,ref:"open-map-popover","virtual-ref":n.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.openMapOptions,_=>(a.openBlock(),a.createBlock(b,{key:_.key},{default:a.withCtx(()=>[a.createVNode(T,{type:"primary",plain:"",onClick:C=>n.$emit("open-map",_.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(_.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(d,{ref:"backgroundPopover","virtual-ref":n.backgroundIconRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable h-auto","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[33]||(e[33]=[a.createTextVNode("Viewing Mode")])),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createElementVNode("div",wV,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.viewingModes,(_,C,I)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:C},[C===n.viewingMode?(a.openBlock(),a.createElementBlock("span",MV,[a.createElementVNode("b",null,a.toDisplayString(C),1)])):(a.openBlock(),a.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:E=>s.changeViewingMode(C)},a.toDisplayString(C),9,SV))],64))),128))]),a.createVNode(b,{class:"viewing-mode-description"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(s.modeDescription),1)]),_:1}),n.viewingMode==="Annotation"&&n.offlineAnnotationEnabled?(a.openBlock(),a.createBlock(b,{key:0,class:"viewing-mode-description"},{default:a.withCtx(()=>e[34]||(e[34]=[a.createTextVNode(" (Anonymous annotate) ")])),_:1})):a.createCommentVNode("",!0)]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[35]||(e[35]=[a.createTextVNode(" Change background ")])),_:1}),a.createVNode(b,{class:"backgroundChooser"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.availableBackground,_=>(a.openBlock(),a.createElementBlock("div",{key:_,class:a.normalizeClass(["backgroundChoice",_,_==n.currentBackground?"active":""]),onClick:C=>s.backgroundChangeCallback(_)},null,10,_V))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.createElementVNode("div",{class:a.normalizeClass(["settings-group",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createVNode(b,null,{default:a.withCtx(()=>[a.createVNode(d,{visible:n.hoverVisibilities[3].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper right-popper non-selectable",ref:"openMapPopover"},{reference:a.withCtx(()=>[t.enableOpenMapUI&&t.openMapOptions.length>0?(a.openBlock(),a.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[23]||(e[23]=_=>s.showHelpText(3)),onMouseout:e[24]||(e[24]=_=>s.hideHelpText(3))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),a.createVNode(b,null,{default:a.withCtx(()=>[a.createVNode(d,{visible:n.hoverVisibilities[4].value,content:"Change background color",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"settingsPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[25]||(e[25]=_=>s.showHelpText(4)),onMouseout:e[26]||(e[26]=_=>s.hideHelpText(4))},null,512)]),_:1},8,["visible"])]),_:1})],2)],512),[[a.vShow,t.displayUI&&!n.isTransitioning]])])),[[M,n.loading]])}const TV=Bi(hV,[["render",EV],["__scopeId","data-v-62fb1890"]]);Ht.ScaffoldVuer=TV,Object.defineProperty(Ht,Symbol.toStringTag,{value:"Module"})});
|