@abi-software/scaffoldvuer 0.4.0-vue3.2 → 0.4.0-vue3.3
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.
|
@@ -4597,4 +4597,4 @@ void main() {
|
|
|
4597
4597
|
`)!==-1&&(L=L.replace(/\r\n/g,`
|
|
4598
4598
|
`)),L.indexOf(`\\
|
|
4599
4599
|
`)!==-1&&(L=L.replace(/\\\n/g,""));for(var C=L.split(`
|
|
4600
|
-
`),A="",H="",k=0,B=[],D=typeof"".trimLeft=="function",z=0,q=C.length;z<q;z++)if(A=C[z],A=D?A.trimLeft():A.trim(),k=A.length,k!==0&&(H=A.charAt(0),H!=="#"))if(H==="v"){var F=A.split(/\s+/);switch(F[0]){case"v":S.vertices.push(parseFloat(F[1]),parseFloat(F[2]),parseFloat(F[3])),7<=F.length?S.colors.push(parseFloat(F[4]),parseFloat(F[5]),parseFloat(F[6])):S.colors.push(void 0,void 0,void 0);break;case"vn":S.normals.push(parseFloat(F[1]),parseFloat(F[2]),parseFloat(F[3]));break;case"vt":S.uvs.push(parseFloat(F[1]),parseFloat(F[2]))}}else if(H==="f"){for(var Z,K=A.substr(1).trim(),X=K.split(/\s+/),te=[],J=0,he=X.length;J<he;J++)if(Z=X[J],0<Z.length){var xe=Z.split("/");te.push(xe)}for(var ee=te[0],oe=1,de=te.length-1;oe<de;oe++){var fe=te[oe],Ae=te[oe+1];S.addFace(ee[0],fe[0],Ae[0],ee[1],fe[1],Ae[1],ee[2],fe[2],Ae[2])}}else if(H==="l"){var Se=A.substring(1).trim().split(" "),Qe=[],Le=[];if(A.indexOf("/")===-1)Qe=Se;else for(var Ce,je=0,me=Se.length;je<me;je++)Ce=Se[je].split("/"),Ce[0]!==""&&Qe.push(Ce[0]),Ce[1]!==""&&Le.push(Ce[1]);S.addLineGeometry(Qe,Le)}else if(H==="p"){var Ne=A.substr(1).trim(),Ie=Ne.split(" ");S.addPointGeometry(Ie)}else if((B=l.exec(A))!==null){var Ke=(" "+B[0].substr(1).trim()).substr(1);S.startObject(Ke)}else if(h.test(A))S.object.startMaterial(A.substring(7).trim(),S.materialLibraries);else if(s.test(A))S.materialLibraries.push(A.substring(7).trim());else if(u.test(A))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(H==="s"){if(B=A.split(" "),1<B.length){var Ye=B[1].trim().toLowerCase();S.object.smooth=Ye!=="0"&&Ye!=="off"}else S.object.smooth=!0;var ht=S.object.currentMaterial();ht&&(ht.smooth=S.object.smooth)}else{if(A==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+A+'"')}S.finalize();var dt=new a.Group;dt.materialLibraries=[].concat(S.materialLibraries);var Ee=S.objects.length!==1||S.objects[0].geometry.vertices.length!==0;if(Ee==!0)for(var ye=0,it=S.objects.length;ye<it;ye++){var Ve=S.objects[ye],yt=Ve.geometry,bt=Ve.materials,_t=yt.type==="Line",nt=yt.type==="Points",Je=!1;if(yt.vertices.length!==0){var et=new a.BufferGeometry;et.setAttribute("position",new a.Float32BufferAttribute(yt.vertices,3)),0<yt.normals.length&&et.setAttribute("normal",new a.Float32BufferAttribute(yt.normals,3)),0<yt.colors.length&&(Je=!0,et.setAttribute("color",new a.Float32BufferAttribute(yt.colors,3))),yt.hasUVIndices===!0&&et.setAttribute("uv",new a.Float32BufferAttribute(yt.uvs,2));for(var Xe=[],Lt=0,vt=bt.length;Lt<vt;Lt++){var Et=bt[Lt],kt=Et.name+"_"+Et.smooth+"_"+Je,pt=S.materials[kt];if(this.materials!==null){if(pt=this.materials.create(Et.name),_t&&pt&&!(pt instanceof a.LineBasicMaterial)){var Qn=new a.LineBasicMaterial;a.Material.prototype.copy.call(Qn,pt),Qn.color.copy(pt.color),pt=Qn}else if(nt&&pt&&!(pt instanceof a.PointsMaterial)){var Jt=new a.PointsMaterial({size:10,sizeAttenuation:!1});a.Material.prototype.copy.call(Jt,pt),Jt.color.copy(pt.color),Jt.map=pt.map,pt=Jt}}pt===void 0&&(pt=_t?new a.LineBasicMaterial:nt?new a.PointsMaterial({size:1,sizeAttenuation:!1}):new a.MeshPhongMaterial,pt.name=Et.name,pt.flatShading=!Et.smooth,pt.vertexColors=Je,S.materials[kt]=pt),Xe.push(pt)}var Mn=void 0;if(1<Xe.length){for(var ln,Mt=0,ze=bt.length;Mt<ze;Mt++)ln=bt[Mt],et.addGroup(ln.groupStart,ln.groupCount,Mt);Mn=_t?new a.LineSegments(et,Xe):nt?new a.Points(et,Xe):new a.Mesh(et,Xe)}else Mn=_t?new a.LineSegments(et,Xe[0]):nt?new a.Points(et,Xe[0]):new a.Mesh(et,Xe[0]);Mn.name=Ve.name,dt.add(Mn)}}else if(0<S.vertices.length){var mt=new a.PointsMaterial({size:1,sizeAttenuation:!1}),Ht=new a.BufferGeometry;Ht.setAttribute("position",new a.Float32BufferAttribute(S.vertices,3)),0<S.colors.length&&S.colors[0]!==void 0&&(Ht.setAttribute("color",new a.Float32BufferAttribute(S.colors,3)),mt.vertexColors=!0);var pn=new a.Points(Ht,mt);dt.add(pn)}return dt}}},function(n,r,o){var a=o(14).JSONLoader;r.PrimitivesLoader=function(){var l=0;this.crossOrigin="Anonymous";var s=new a,h=[];this.load=(d,p,f,m)=>{if(20>l){++l,s.crossOrigin=this.crossOrigin;var y=new u(p,this),v=new u(m,this);s.load(d,y,f,v)}else h.push({url:d,onLoad:p,onProgress:f,onError:m})},this.loadFromWaitingList=()=>{var d=h.shift();d&&this.load(d.url,d.onLoad,d.onProgress,d.onError)};var u=function(d,p){return function(){--l,d(...arguments),p.loadFromWaitingList()}};this.parse=d=>s.parse(d)}},function(n,r,o){o(3);var a=o(36).GLTFLoader,l=function(){var s=this;this.parseGLTFObjects=(h,u,d,p)=>{var f=u;if(d!==0){if(h.type!=="Object3D"){var m;if(h.type==="Mesh"?m=new(o(2)).Geometry:h.type==="LineSegments"?m=new(o(20)).Lines:h.type==="Points"&&(m=new(o(17)).Pointset),m){var y=!1,v=!1;h.geometry&&h.geometry.morphAttributes&&(y=!!h.geometry.morphAttributes.position,v=!!h.geometry.morphAttributes.color),m.setMesh(h.clone(),y,v),u.addZincObject(m),m.groupName=m.morph.name,m.morph.matrixAutoUpdate=!0,p!=null&&typeof p=="function"&&p(m)}}else if(h.name!==""&&(u&&(f=u.findOrCreateChildFromPath(h.name)),f)){var _=f.getGroup();_.position.copy(h.position),_.rotation.copy(h.rotation),_.quaternion.copy(h.quaternion),_.matrixAutoUpdate=!0}}d++,h.children.forEach(x=>{s.parseGLTFObjects(x,f,d,p)})},this.setCamera=h=>{h.viewAll();var u=h.getZincCameraControls(),d=u.getCurrentViewport();u.addViewport("default",d),u.setDefaultViewport("default")},this.load=(h,u,d,p,f)=>{var m=d.substring(0,d.lastIndexOf("/")+1),y=d.substring(d.lastIndexOf("/")+1,d.length),v=new a().setPath(m);v.load(y,function(_){console.log(_),s.parseGLTFObjects(_.scene,u,0,p),s.setCamera(h),f!=null&&typeof f=="function"&&f()})}};r.GLTFToZincJSLoader=l},function(n,r){n.exports=fMe},function(n,r,o){var a=o(38).GLTFExporter,l=function(s){var h=s;this.exportGLTF=u=>{var d=h.getRootRegion(),p=d.getAllObjects(!0),f=[];p.forEach(v=>{v.animationClip&&f.push({clip:v.animationClip[0],mesh:v.morph})});var m=new a,y={binary:u,animations:f};return new Promise(v=>{m.parse(h.getThreeJSScene(),function(_){v(_)},y)})}};r.SceneExporter=l},function(n,r,o){o.r(r),o.d(r,"GLTFExporter",function(){return l});var a=o(3);class l{constructor(){this.pluginCallbacks=[],this.register(function(F){return new B(F)}),this.register(function(F){return new D(F)}),this.register(function(F){return new z(F)})}register(F){return this.pluginCallbacks.indexOf(F)===-1&&this.pluginCallbacks.push(F),this}unregister(F){return this.pluginCallbacks.indexOf(F)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(F),1),this}parse(F,Z,K){for(var X=new k,te=[],J=0,he=this.pluginCallbacks.length;J<he;J++)te.push(this.pluginCallbacks[J](X));X.setPlugins(te),X.write(F,Z,K)}}var s={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},h={};h[a.NearestFilter]=s.NEAREST,h[a.NearestMipmapNearestFilter]=s.NEAREST_MIPMAP_NEAREST,h[a.NearestMipmapLinearFilter]=s.NEAREST_MIPMAP_LINEAR,h[a.LinearFilter]=s.LINEAR,h[a.LinearMipmapNearestFilter]=s.LINEAR_MIPMAP_NEAREST,h[a.LinearMipmapLinearFilter]=s.LINEAR_MIPMAP_LINEAR,h[a.ClampToEdgeWrapping]=s.CLAMP_TO_EDGE,h[a.RepeatWrapping]=s.REPEAT,h[a.MirroredRepeatWrapping]=s.MIRRORED_REPEAT;var u={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},d=12,p=1179937895,f=2,m=8,y=1313821514,v=5130562;function _(q,F){return q.length===F.length&&q.every(function(Z,K){return Z===F[K]})}function x(q){if(window.TextEncoder!==void 0)return new TextEncoder().encode(q).buffer;for(var F,Z=new Uint8Array(new ArrayBuffer(q.length)),K=0,X=q.length;K<X;K++)F=q.charCodeAt(K),Z[K]=255<F?32:F;return Z.buffer}function L(q){return _(q.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function S(q,F,Z){for(var K={min:Array(q.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(q.itemSize).fill(Number.NEGATIVE_INFINITY)},X=F;X<F+Z;X++)for(var te,J=0;J<q.itemSize;J++)te=void 0,4<q.itemSize?te=q.array[X*q.itemSize+J]:J===0?te=q.getX(X):J===1?te=q.getY(X):J===2?te=q.getZ(X):J==3&&(te=q.getW(X)),K.min[J]=Math.min(K.min[J],te),K.max[J]=Math.max(K.max[J],te);return K}function C(q){return 4*Math.ceil(q/4)}function A(q){var F=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,Z=C(q.byteLength);if(Z!==q.byteLength){var K=new Uint8Array(Z);if(K.set(new Uint8Array(q)),F!==0)for(var X=q.byteLength;X<Z;X++)K[X]=F;return K.buffer}return q}var H=null;class k{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(F){this.plugins=F}write(F,Z,K){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},K),0<this.options.animations.length&&(this.options.trs=!0),this.processInput(F);var X=this;Promise.all(this.pending).then(function(){var te=X.buffers,J=X.json,he=X.options,xe=X.extensionsUsed,ee=new Blob(te,{type:"application/octet-stream"}),oe=Object.keys(xe);if(0<oe.length&&(J.extensionsUsed=oe),J.buffers&&0<J.buffers.length&&(J.buffers[0].byteLength=ee.size),he.binary===!0){var de=new window.FileReader;de.readAsArrayBuffer(ee),de.onloadend=function(){var Ae=A(de.result),Se=new DataView(new ArrayBuffer(m));Se.setUint32(0,Ae.byteLength,!0),Se.setUint32(4,v,!0);var Qe=A(x(JSON.stringify(J)),32),Le=new DataView(new ArrayBuffer(m));Le.setUint32(0,Qe.byteLength,!0),Le.setUint32(4,y,!0);var Ce=new ArrayBuffer(d),je=new DataView(Ce);je.setUint32(0,p,!0),je.setUint32(4,f,!0);var me=d+Le.byteLength+Qe.byteLength+Se.byteLength+Ae.byteLength;je.setUint32(8,me,!0);var Ne=new Blob([Ce,Le,Qe,Se,Ae],{type:"application/octet-stream"}),Ie=new window.FileReader;Ie.readAsArrayBuffer(Ne),Ie.onloadend=function(){Z(Ie.result)}}}else if(J.buffers&&0<J.buffers.length){var fe=new window.FileReader;fe.readAsDataURL(ee),fe.onloadend=function(){var Ae=fe.result;J.buffers[0].uri=Ae,Z(J)}}else Z(J)})}serializeUserData(F,Z){if(!(F.userData&&F.userData.isZincObject)&&Object.keys(F.userData).length!==0){var K=this.options,X=this.extensionsUsed;try{var te=JSON.parse(JSON.stringify(F.userData));if(K.includeCustomExtensions&&te.gltfExtensions){for(var J in Z.extensions===void 0&&(Z.extensions={}),te.gltfExtensions)Z.extensions[J]=te.gltfExtensions[J],X[J]=!0;delete te.gltfExtensions}0<Object.keys(te).length&&(Z.extras=te)}catch(he){console.warn("THREE.GLTFExporter: userData of '"+F.name+"' won't be serialized because of JSON.stringify error - "+he.message)}}}getUID(F){return this.uids.has(F)||this.uids.set(F,this.uid++),this.uids.get(F)}isNormalizedNormalAttribute(F){var Z=this.cache;if(Z.attributesNormalized.has(F))return!1;for(var K=new a.Vector3,X=0,te=F.count;X<te;X++)if(5e-4<Math.abs(K.fromBufferAttribute(F,X).length()-1))return!1;return!0}createNormalizedNormalAttribute(F){var Z=this.cache;if(Z.attributesNormalized.has(F))return Z.attributesNormalized.get(F);for(var K=F.clone(),X=new a.Vector3,te=0,J=K.count;te<J;te++)X.fromBufferAttribute(K,te),X.x===0&&X.y===0&&X.z===0?X.setX(1):X.normalize(),K.setXYZ(te,X.x,X.y,X.z);return Z.attributesNormalized.set(F,K),K}applyTextureTransform(F,Z){var K=!1,X={};(Z.offset.x!==0||Z.offset.y!==0)&&(X.offset=Z.offset.toArray(),K=!0),Z.rotation!==0&&(X.rotation=Z.rotation,K=!0),(Z.repeat.x!==1||Z.repeat.y!==1)&&(X.scale=Z.repeat.toArray(),K=!0),K&&(F.extensions=F.extensions||{},F.extensions.KHR_texture_transform=X,this.extensionsUsed.KHR_texture_transform=!0)}processBuffer(F){var Z=this.json,K=this.buffers;return Z.buffers||(Z.buffers=[{byteLength:0}]),K.push(F),0}processBufferView(F,Z,K,X,te){var J=this.json;J.bufferViews||(J.bufferViews=[]);for(var he=Z===s.UNSIGNED_BYTE?1:Z===s.UNSIGNED_SHORT?2:4,xe=C(X*F.itemSize*he),ee=new DataView(new ArrayBuffer(xe)),oe=0,de=K;de<K+X;de++)for(var fe,Ae=0;Ae<F.itemSize;Ae++)fe=void 0,4<F.itemSize?fe=F.array[de*F.itemSize+Ae]:Ae===0?fe=F.getX(de):Ae===1?fe=F.getY(de):Ae===2?fe=F.getZ(de):Ae==3&&(fe=F.getW(de)),Z===s.FLOAT?ee.setFloat32(oe,fe,!0):Z===s.UNSIGNED_INT?ee.setUint32(oe,fe,!0):Z===s.UNSIGNED_SHORT?ee.setUint16(oe,fe,!0):Z===s.UNSIGNED_BYTE&&ee.setUint8(oe,fe),oe+=he;var Se={buffer:this.processBuffer(ee.buffer),byteOffset:this.byteOffset,byteLength:xe};te!==void 0&&(Se.target=te),te===s.ARRAY_BUFFER&&(Se.byteStride=F.itemSize*he),this.byteOffset+=xe,J.bufferViews.push(Se);var Qe={id:J.bufferViews.length-1,byteLength:0};return Qe}processBufferViewImage(F){var Z=this,K=Z.json;return K.bufferViews||(K.bufferViews=[]),new Promise(function(X){var te=new window.FileReader;te.readAsArrayBuffer(F),te.onloadend=function(){var J=A(te.result),he={buffer:Z.processBuffer(J),byteOffset:Z.byteOffset,byteLength:J.byteLength};Z.byteOffset+=J.byteLength,X(K.bufferViews.push(he)-1)}})}processAccessor(F,Z,K,X){var te,J=this.options,he=this.json;if(F.array.constructor===Float32Array)te=s.FLOAT;else if(F.array.constructor===Uint32Array)te=s.UNSIGNED_INT;else if(F.array.constructor===Uint16Array)te=s.UNSIGNED_SHORT;else if(F.array.constructor===Uint8Array)te=s.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(K===void 0&&(K=0),X===void 0&&(X=F.count),J.truncateDrawRange&&Z!==void 0&&Z.index===null){var xe=K+X,ee=Z.drawRange.count===1/0?F.count:Z.drawRange.start+Z.drawRange.count;K=Math.max(K,Z.drawRange.start),X=Math.min(xe,ee)-K,0>X&&(X=0)}if(X===0)return null;var oe,de=S(F,K,X);Z!==void 0&&(oe=F===Z.index?s.ELEMENT_ARRAY_BUFFER:s.ARRAY_BUFFER);var fe=this.processBufferView(F,te,K,X,oe),Ae={bufferView:fe.id,byteOffset:fe.byteOffset,componentType:te,count:X,max:de.max,min:de.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[F.itemSize]};return F.normalized===!0&&(Ae.normalized=!0),he.accessors||(he.accessors=[]),he.accessors.push(Ae)-1}processImage(F,Z,K){var X=this,te=X.cache,J=X.json,he=X.options,xe=X.pending;te.images.has(F)||te.images.set(F,{});var ee=te.images.get(F),oe=Z===a.RGBAFormat?"image/png":"image/jpeg",de=oe+":flipY/"+K.toString();if(ee[de]!==void 0)return ee[de];J.images||(J.images=[]);var fe={mimeType:oe};if(he.embedImages){var Ae=H=H||document.createElement("canvas");Ae.width=Math.min(F.width,he.maxTextureSize),Ae.height=Math.min(F.height,he.maxTextureSize);var Se=Ae.getContext("2d");if(K===!0&&(Se.translate(0,Ae.height),Se.scale(1,-1)),typeof HTMLImageElement<"u"&&F instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&F instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&F instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&F instanceof ImageBitmap)Se.drawImage(F,0,0,Ae.width,Ae.height);else{Z!==a.RGBAFormat&&Z!==a.RGBFormat&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(F.width>he.maxTextureSize||F.height>he.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",F);var Qe=new Uint8ClampedArray(4*(F.height*F.width));if(Z===a.RGBAFormat)for(var Le=0;Le<Qe.length;Le+=4)Qe[Le+0]=F.data[Le+0],Qe[Le+1]=F.data[Le+1],Qe[Le+2]=F.data[Le+2],Qe[Le+3]=F.data[Le+3];else for(var Ce=0,je=0;Ce<Qe.length;Ce+=4,je+=3)Qe[Ce+0]=F.data[je+0],Qe[Ce+1]=F.data[je+1],Qe[Ce+2]=F.data[je+2],Qe[Ce+3]=255;Se.putImageData(new ImageData(Qe,F.width,F.height),0,0)}he.binary===!0?xe.push(new Promise(function(Ne){Ae.toBlob(function(Ie){X.processBufferViewImage(Ie).then(function(Ke){fe.bufferView=Ke,Ne()})},oe)})):fe.uri=Ae.toDataURL(oe)}else fe.uri=F.src;var me=J.images.push(fe)-1;return ee[de]=me,me}processSampler(F){var Z=this.json;Z.samplers||(Z.samplers=[]);var K={magFilter:h[F.magFilter],minFilter:h[F.minFilter],wrapS:h[F.wrapS],wrapT:h[F.wrapT]};return Z.samplers.push(K)-1}processTexture(F){var Z=this.cache,K=this.json;if(Z.textures.has(F))return Z.textures.get(F);K.textures||(K.textures=[]);var X={sampler:this.processSampler(F),source:this.processImage(F.image,F.format,F.flipY)};F.name&&(X.name=F.name),this._invokeAll(function(J){J.writeTexture&&J.writeTexture(F,X)});var te=K.textures.push(X)-1;return Z.textures.set(F,te),te}processMaterial(F){var Z=this.cache,K=this.json;if(Z.materials.has(F))return Z.materials.get(F);if(F.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;K.materials||(K.materials=[]);var X={pbrMetallicRoughness:{}};F.isMeshStandardMaterial!==!0&&F.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");var te=F.color.toArray().concat([F.opacity]);if(_(te,[1,1,1,1])||(X.pbrMetallicRoughness.baseColorFactor=te),F.isMeshStandardMaterial?(X.pbrMetallicRoughness.metallicFactor=F.metalness,X.pbrMetallicRoughness.roughnessFactor=F.roughness):(X.pbrMetallicRoughness.metallicFactor=.5,X.pbrMetallicRoughness.roughnessFactor=.5),F.metalnessMap||F.roughnessMap)if(F.metalnessMap===F.roughnessMap){var J={index:this.processTexture(F.metalnessMap)};this.applyTextureTransform(J,F.metalnessMap),X.pbrMetallicRoughness.metallicRoughnessTexture=J}else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.");if(F.map){var he={index:this.processTexture(F.map)};this.applyTextureTransform(he,F.map),X.pbrMetallicRoughness.baseColorTexture=he}if(F.emissive){var xe=F.emissive.clone().multiplyScalar(F.emissiveIntensity),ee=Math.max(xe.r,xe.g,xe.b);if(1<ee&&(xe.multiplyScalar(1/ee),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),0<ee&&(X.emissiveFactor=xe.toArray()),F.emissiveMap){var oe={index:this.processTexture(F.emissiveMap)};this.applyTextureTransform(oe,F.emissiveMap),X.emissiveTexture=oe}}if(F.normalMap){var de={index:this.processTexture(F.normalMap)};F.normalScale&&F.normalScale.x!==-1&&(F.normalScale.x!==F.normalScale.y&&console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."),de.scale=F.normalScale.x),this.applyTextureTransform(de,F.normalMap),X.normalTexture=de}if(F.aoMap){var fe={index:this.processTexture(F.aoMap),texCoord:1};F.aoMapIntensity!==1&&(fe.strength=F.aoMapIntensity),this.applyTextureTransform(fe,F.aoMap),X.occlusionTexture=fe}F.transparent?X.alphaMode="BLEND":0<F.alphaTest&&(X.alphaMode="MASK",X.alphaCutoff=F.alphaTest),F.side===a.DoubleSide&&(X.doubleSided=!0),F.name!==""&&(X.name=F.name),this.serializeUserData(F,X),this._invokeAll(function(Se){Se.writeMaterial&&Se.writeMaterial(F,X)});var Ae=K.materials.push(X)-1;return Z.materials.set(F,Ae),Ae}processMesh(F){var Z=this.cache,K=this.json,X=[F.geometry.uuid];if(Array.isArray(F.material))for(var te=0,J=F.material.length;te<J;te++)X.push(F.material[te].uuid);else X.push(F.material.uuid);var he=X.join(":");if(Z.meshes.has(he))return Z.meshes.get(he);var xe,ee=F.geometry;if(xe=F.isLineSegments?s.LINES:F.isLineLoop?s.LINE_LOOP:F.isLine?s.LINE_STRIP:F.isPoints?s.POINTS:F.material.wireframe?s.LINES:s.TRIANGLES,ee.isBufferGeometry!==!0)throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry.");var oe={},de={},fe=[],Ae=[],Se={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},Qe=ee.getAttribute("normal");Qe===void 0||this.isNormalizedNormalAttribute(Qe)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),ee.setAttribute("normal",this.createNormalizedNormalAttribute(Qe)));var Le=null;for(var Ce in ee.attributes)if(Ce.substr(0,5)!=="morph"){var je=ee.attributes[Ce];Ce=Se[Ce]||Ce.toUpperCase();var me=/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;if(me.test(Ce)||(Ce="_"+Ce),Z.attributes.has(this.getUID(je))){de[Ce]=Z.attributes.get(this.getUID(je));continue}Le=null;var Ne=je.array;Ce!=="JOINTS_0"||Ne instanceof Uint16Array||Ne instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),Le=new a.BufferAttribute(new Uint16Array(Ne),je.itemSize,je.normalized));var Ie=this.processAccessor(Le||je,ee);Ie!==null&&(de[Ce]=Ie,Z.attributes.set(this.getUID(je),Ie))}if(Qe!==void 0&&ee.setAttribute("normal",Qe),Object.keys(de).length===0)return null;if(F.morphTargetInfluences!==void 0&&0<F.morphTargetInfluences.length){var Ke=[],Ye=[],ht={};if(F.morphTargetDictionary!==void 0)for(var dt in F.morphTargetDictionary)ht[F.morphTargetDictionary[dt]]=dt;for(var Ee=0;Ee<F.morphTargetInfluences.length;++Ee){var ye={},it=!1;for(var Ve in ee.morphAttributes){if(Ve!="position"&&Ve!=="normal"&&Ve!=="color"){it||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),it=!0);continue}var yt=ee.morphAttributes[Ve][Ee],bt=Ve.toUpperCase();Se[Ve]&&(bt=Se[Ve]);var _t=ee.attributes[Ve];if(Z.attributes.has(this.getUID(yt))){ye[bt]=Z.attributes.get(this.getUID(yt));continue}var nt=_t.clone();if(!ee.morphTargetsRelative)if(_t)for(var Je=0,et=yt.count;Je<et;Je++)_t.count>Je&&nt.setXYZ(Je,yt.getX(Je)-_t.getX(Je),yt.getY(Je)-_t.getY(Je),yt.getZ(Je)-_t.getZ(Je));else for(var Xe=0,Lt=yt.count;Xe<Lt;Xe++)nt.setXYZ(Xe,0,0,0);ye[bt]=this.processAccessor(nt,ee),Z.attributes.set(this.getUID(_t),ye[bt])}Ae.push(ye),Ke.push(F.morphTargetInfluences[Ee]),F.morphTargetDictionary!==void 0&&Ye.push(ht[Ee])}oe.weights=Ke,0<Ye.length&&(oe.extras={},oe.extras.targetNames=Ye)}var vt=Array.isArray(F.material);if(vt&&ee.groups.length===0)return null;for(var Et,kt=vt?F.material:[F.material],pt=vt?ee.groups:[{materialIndex:0,start:void 0,count:void 0}],Qn=0,Jt=pt.length;Qn<Jt;Qn++){if(Et={mode:xe,attributes:de},this.serializeUserData(ee,Et),0<Ae.length&&(Et.targets=Ae),ee.index!==null){var Mn=this.getUID(ee.index);(pt[Qn].start!==void 0||pt[Qn].count!==void 0)&&(Mn+=":"+pt[Qn].start+":"+pt[Qn].count),Z.attributes.has(Mn)?Et.indices=Z.attributes.get(Mn):(Et.indices=this.processAccessor(ee.index,ee,pt[Qn].start,pt[Qn].count),Z.attributes.set(Mn,Et.indices)),Et.indices===null&&delete Et.indices}var ln=this.processMaterial(kt[pt[Qn].materialIndex]);ln!==null&&(Et.material=ln),fe.push(Et)}oe.primitives=fe,K.meshes||(K.meshes=[]),this._invokeAll(function(ze){ze.writeMesh&&ze.writeMesh(F,oe)});var Mt=K.meshes.push(oe)-1;return Z.meshes.set(he,Mt),Mt}processCamera(F){var Z=this.json;Z.cameras||(Z.cameras=[]);var K=F.isOrthographicCamera,X={type:K?"orthographic":"perspective"};return K?X.orthographic={xmag:2*F.right,ymag:2*F.top,zfar:0>=F.far?.001:F.far,znear:0>F.near?0:F.near}:X.perspective={aspectRatio:F.aspect,yfov:a.MathUtils.degToRad(F.fov),zfar:0>=F.far?.001:F.far,znear:0>F.near?0:F.near},F.name!==""&&(X.name=F.type),Z.cameras.push(X)-1}processAnimation(F,Z){var K=this.json,X=this.nodeMap;K.animations||(K.animations=[]),F=l.Utils.mergeMorphTargetTracks(F.clone(),Z);for(var te=F.tracks,J=[],he=[],xe=0;xe<te.length;++xe){var ee=te[xe],oe=a.PropertyBinding.parseTrackName(ee.name),de=a.PropertyBinding.findNode(Z,oe.nodeName),fe=u[oe.propertyName];if(oe.objectName==="bones"&&(de.isSkinnedMesh===!0?de=de.skeleton.getBoneByName(oe.objectIndex):de=void 0),!de||!fe)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',ee.name),null;var Ae=ee.values.length/ee.times.length;fe===u.morphTargetInfluences&&(Ae/=de.morphTargetInfluences.length);var Se=void 0;ee.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(Se="CUBICSPLINE",Ae/=3):ee.getInterpolation()===a.InterpolateDiscrete?Se="STEP":Se="LINEAR",he.push({input:this.processAccessor(new a.BufferAttribute(ee.times,1)),output:this.processAccessor(new a.BufferAttribute(ee.values,Ae)),interpolation:Se}),J.push({sampler:he.length-1,target:{node:X.get(de),path:fe}})}return K.animations.push({name:F.name||"clip_"+K.animations.length,samplers:he,channels:J}),K.animations.length-1}processSkin(F){var Z=this.json,K=this.nodeMap,X=Z.nodes[K.get(F)],te=F.skeleton;if(te===void 0)return null;var J=F.skeleton.bones[0];if(J===void 0)return null;for(var he=[],xe=new Float32Array(16*te.bones.length),ee=new a.Matrix4,oe=0;oe<te.bones.length;++oe)he.push(K.get(te.bones[oe])),ee.copy(te.boneInverses[oe]),ee.multiply(F.bindMatrix).toArray(xe,16*oe);Z.skins===void 0&&(Z.skins=[]),Z.skins.push({inverseBindMatrices:this.processAccessor(new a.BufferAttribute(xe,16)),joints:he,skeleton:K.get(J)});var de=X.skin=Z.skins.length-1;return de}processNode(F){var Z=this.json,K=this.options,X=this.nodeMap;Z.nodes||(Z.nodes=[]);var te={};if(K.trs){var J=F.quaternion.toArray(),he=F.position.toArray(),xe=F.scale.toArray();_(J,[0,0,0,1])||(te.rotation=J),_(he,[0,0,0])||(te.translation=he),_(xe,[1,1,1])||(te.scale=xe)}else F.matrixAutoUpdate&&F.updateMatrix(),L(F.matrix)===!1&&(te.matrix=F.matrix.elements);if(F.name!==""&&(te.name=F.name+""),this.serializeUserData(F,te),F.isMesh||F.isLine||F.isPoints){var ee=this.processMesh(F);ee!==null&&(te.mesh=ee)}else F.isCamera&&(te.camera=this.processCamera(F));if(F.isSkinnedMesh&&this.skins.push(F),0<F.children.length){for(var oe,de=[],fe=0,Ae=F.children.length;fe<Ae;fe++)if(oe=F.children[fe],oe.visible||K.onlyVisible===!1){var Se=this.processNode(oe);Se!==null&&de.push(Se)}0<de.length&&(te.children=de)}this._invokeAll(function(Le){Le.writeNode&&Le.writeNode(F,te)});var Qe=Z.nodes.push(te)-1;return X.set(F,Qe),Qe}processScene(F){var Z=this.json,K=this.options;Z.scenes||(Z.scenes=[],Z.scene=0);var X={};F.name!==""&&(X.name=F.name),Z.scenes.push(X);for(var te,J=[],he=0,xe=F.children.length;he<xe;he++)if(te=F.children[he],te.visible||K.onlyVisible===!1){var ee=this.processNode(te);ee!==null&&J.push(ee)}0<J.length&&(X.nodes=J),this.serializeUserData(F,X)}processObjects(F){var Z=new a.Scene;Z.name="AuxScene";for(var K=0;K<F.length;K++)Z.children.push(F[K]);this.processScene(Z)}processInput(F){var Z=this.options;F=F instanceof Array?F:[F],this._invokeAll(function(he){he.beforeParse&&he.beforeParse(F)});for(var K=[],X=0;X<F.length;X++)F[X]instanceof a.Scene?this.processScene(F[X]):K.push(F[X]);0<K.length&&this.processObjects(K);for(var te=0;te<this.skins.length;++te)this.processSkin(this.skins[te]);for(var J=0;J<Z.animations.length;++J)this.processAnimation(Z.animations[J].clip,Z.animations[J].mesh);this._invokeAll(function(he){he.afterParse&&he.afterParse(F)})}_invokeAll(F){for(var Z=0,K=this.plugins.length;Z<K;Z++)F(this.plugins[Z])}}class B{constructor(F){this.writer=F,this.name="KHR_lights_punctual"}writeNode(F,Z){if(F.isLight){if(!F.isDirectionalLight&&!F.isPointLight&&!F.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",F);var K=this.writer,X=K.json,te=K.extensionsUsed,J={};F.name&&(J.name=F.name),J.color=F.color.toArray(),J.intensity=F.intensity,F.isDirectionalLight?J.type="directional":F.isPointLight?(J.type="point",0<F.distance&&(J.range=F.distance)):F.isSpotLight&&(J.type="spot",0<F.distance&&(J.range=F.distance),J.spot={},J.spot.innerConeAngle=-1*((F.penumbra-1)*F.angle),J.spot.outerConeAngle=F.angle),F.decay!==void 0&&F.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),F.target&&(F.target.parent!==F||F.target.position.x!==0||F.target.position.y!==0||F.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),te[this.name]||(X.extensions=X.extensions||{},X.extensions[this.name]={lights:[]},te[this.name]=!0);var he=X.extensions[this.name].lights;he.push(J),Z.extensions=Z.extensions||{},Z.extensions[this.name]={light:he.length-1}}}}class D{constructor(F){this.writer=F,this.name="KHR_materials_unlit"}writeMaterial(F,Z){if(F.isMeshBasicMaterial){var K=this.writer,X=K.extensionsUsed;Z.extensions=Z.extensions||{},Z.extensions[this.name]={},X[this.name]=!0,Z.pbrMetallicRoughness.metallicFactor=0,Z.pbrMetallicRoughness.roughnessFactor=.9}}}class z{constructor(F){this.writer=F,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(F,Z){if(F.isGLTFSpecularGlossinessMaterial){var K=this.writer,X=K.extensionsUsed,te={};Z.pbrMetallicRoughness.baseColorFactor&&(te.diffuseFactor=Z.pbrMetallicRoughness.baseColorFactor);var J=[1,1,1];if(F.specular.toArray(J,0),te.specularFactor=J,te.glossinessFactor=F.glossiness,Z.pbrMetallicRoughness.baseColorTexture&&(te.diffuseTexture=Z.pbrMetallicRoughness.baseColorTexture),F.specularMap){var he={index:K.processTexture(F.specularMap)};K.applyTextureTransform(he,F.specularMap),te.specularGlossinessTexture=he}Z.extensions=Z.extensions||{},Z.extensions[this.name]=te,X[this.name]=!0}}}l.Utils={insertKeyframe:function(F,Z){var K,X=.001,te=F.getValueSize(),J=new F.TimeBufferType(F.times.length+1),he=new F.ValueBufferType(F.values.length+te),xe=F.createInterpolant(new F.ValueBufferType(te));if(F.times.length===0){J[0]=Z;for(var ee=0;ee<te;ee++)he[ee]=0;K=0}else if(Z<F.times[0]){if(Math.abs(F.times[0]-Z)<X)return 0;J[0]=Z,J.set(F.times,1),he.set(xe.evaluate(Z),0),he.set(F.values,te),K=0}else if(Z>F.times[F.times.length-1]){if(Math.abs(F.times[F.times.length-1]-Z)<X)return F.times.length-1;J[J.length-1]=Z,J.set(F.times,0),he.set(F.values,0),he.set(xe.evaluate(Z),F.values.length),K=J.length-1}else for(var oe=0;oe<F.times.length;oe++){if(Math.abs(F.times[oe]-Z)<X)return oe;if(F.times[oe]<Z&&F.times[oe+1]>Z){J.set(F.times.slice(0,oe+1),0),J[oe+1]=Z,J.set(F.times.slice(oe+1),oe+2),he.set(F.values.slice(0,(oe+1)*te),0),he.set(xe.evaluate(Z),(oe+1)*te),he.set(F.values.slice((oe+1)*te),(oe+2)*te),K=oe+1;break}}return F.times=J,F.values=he,K},mergeMorphTargetTracks:function(F,Z){for(var K=[],X={},te=F.tracks,J=0;J<te.length;++J){var he=te[J],xe=a.PropertyBinding.parseTrackName(he.name),ee=a.PropertyBinding.findNode(Z,xe.nodeName);if(xe.propertyName!=="morphTargetInfluences"||xe.propertyIndex===void 0){K.push(he);continue}if(he.createInterpolant!==he.InterpolantFactoryMethodDiscrete&&he.createInterpolant!==he.InterpolantFactoryMethodLinear){if(he.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),he=he.clone(),he.setInterpolation(a.InterpolateLinear)}var oe=ee.morphTargetInfluences.length,de=ee.morphTargetDictionary[xe.propertyIndex];if(de===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+xe.propertyIndex);var fe=void 0;if(X[ee.uuid]===void 0){fe=he.clone();for(var Ae=new fe.ValueBufferType(oe*fe.times.length),Se=0;Se<fe.times.length;Se++)Ae[Se*oe+de]=fe.values[Se];fe.name=(xe.nodeName||"")+".morphTargetInfluences",fe.values=Ae,X[ee.uuid]=fe,K.push(fe);continue}var Qe=he.createInterpolant(new he.ValueBufferType(1));fe=X[ee.uuid];for(var Le=0;Le<fe.times.length;Le++)fe.values[Le*oe+de]=Qe.evaluate(fe.times[Le]);for(var Ce,je=0;je<he.times.length;je++)Ce=this.insertKeyframe(fe,he.times[je]),fe.values[Ce*oe+de]=he.values[je]}return F.tracks=K,F}}},function(n,r,o){var a=o(3),l=o(4).resolveURL,s=function(){this.nearPlane=.168248,this.farPlane=6.82906,this.eyePosition=[.5,-2.86496,.5],this.targetPosition=[.5,.5,.5],this.upVector=[0,0,1];var x=this;this.setFromObject=L=>{var{nearPlane:S,farPlane:C,eyePosition:A,targetPosition:H,upVector:k}=L;x.nearPlane=S,x.farPlane=C,x.eyePosition=A,x.targetPosition=H,x.upVector=k}},h=function(x,L,S,C){var A={NONE:-1,DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,ROTATE_TRANSITION:4,MINIMAP:5,SYNC_CONTROL:6},H={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6},k={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},B={};B.MAIN=H.ROTATE,B.AUXILIARY=H.ZOOM,B.SECONDARY=H.PAN,this.cameraObject=x,this.domElement=L===void 0?document:L,this.renderer=S,this.scene=C,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.scrollRate=50;var D=6e3,z=!0,q=0,F=void 0,Z=void 0,K=!1,X=500,te=void 0,J="default",he=A.DEFAULT,xe=void 0,ee=void 0,oe=void 0,de=0,fe=k.FREE;this._state=H.NONE;var Ae;this.targetTouchId=-1;var Se=void 0,Qe=new a.Vector3,Le=new a.Vector3,Ce=new a.Vector3,je=new a.Vector3,me=new a.Vector3,Ne=new a.Vector3,Ie=new a.Vector3,Ke=new a.Vector3,Ye=new a.Sphere,ht=new a.Vector3,dt=void 0,Ee=0,ye={default:new s};ye.default.nearPlane=.1,ye.default.farPlane=2e3,ye.default.eyePosition=[0,0,0],ye.default.targetPosition=[0,0,-1],ye.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new a.Vector3(...ye.default.targetPosition)),this.calculateMaxAllowedDistance=ze=>{var mt=ze.getBoundingBox();if(mt){mt.getBoundingSphere(Ye),Ee=6*Ye.radius;var Ht=0;this.cameraObject&&(Ht=this.cameraObject.position.distanceTo(Ye.center)),Ee=Ht>Ee?Ht:Ee}else Ee=0},this.addViewport=(ze,mt)=>{ze&&mt&&(ye[ze]=mt)},this.setDefaultViewport=ze=>!!(ze&&ze in ye)&&(J=ze,!0),this.getDefaultViewport=()=>J,this.getViewportOfName=ze=>ye[ze],this.setCurrentViewport=ze=>ze in ye&&(this.setCurrentCameraSettings(ye[ze]),!0),this.setRotationMode=ze=>{switch(ze){case"none":fe=k.NONE;break;case"horizontal":fe=k.HORIZONTAL;break;case"vertical":fe=k.VERTICAL;break;case"free":default:fe=k.FREE}},this.onResize=()=>{Se&&(Se=void 0),dt&&dt.setCurrentCameraSettings(this.cameraObject,ye[J])},this.getNDCFromDocumentCoords=(ze,mt,Ht)=>{vt(!1);var pn=Ht||new a.Vector2,Ft=2*((ze-Se.left)/Se.width)-1,ct=2*-((mt-Se.top)/Se.height)+1;return pn.set(Ft,ct)},this.getRelativeCoordsFromNDC=(ze,mt,Ht)=>{vt(!1);var pn=Ht||new a.Vector2;return pn.x=(ze+1)*Se.width/2,pn.y=(1-mt)*Se.height/2,pn},this.setMouseButtonAction=(ze,mt)=>{B[ze]=H[mt]};var it=()=>{if(0<Ee){var ze=ht.distanceTo(Ye.center);return Ee>ze||this.cameraObject.position.distanceTo(Ye.center)>ze}return!0},Ve=ze=>{ht.copy(this.cameraObject.position).add(ze),it()&&(this.cameraObject.target.add(ze),this.cameraObject.position.add(ze),this.updateDirectionalLight())},yt=ze=>{vt(!1);var mt;if(he===A.DEFAULT&&(mt=this.scene.getNormalisedMinimapCoordinates(this.renderer,ze)),!mt)ze.button==0?ze.ctrlKey?this._state=B.AUXILIARY:ze.shiftKey?this._state=B.SECONDARY:this._state=B.MAIN:ze.button==1?(ze.preventDefault(),this._state=B.AUXILIARY):ze.button==2&&(this._state=B.SECONDARY),this.pointer_x=ze.clientX-Se.left,this.pointer_y=ze.clientY-Se.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else{he=A.MINIMAP;var Ht=this.scene.getMinimapDiffFromNormalised(mt.x,mt.y);Ve(Ht)}},bt=ze=>{if(vt(!1),this.pointer_x=ze.clientX-Se.left,this.pointer_y=ze.clientY-Se.top,he===A.MINIMAP){var mt=this.scene.getNormalisedMinimapCoordinates(this.renderer,ze);if(mt){var Ht=this.scene.getMinimapDiffFromNormalised(mt.x,mt.y);Ve(Ht)}}else this._state===H.NONE&&Ae!==void 0&&Ae.move(this,ze.clientX,ze.clientY,this.renderer)},_t=ze=>{this._state=H.NONE,he==A.MINIMAP&&(he=A.DEFAULT),Ae!==void 0&&this.pointer_x_start==ze.clientX-Se.left&&this.pointer_y_start==ze.clientY-Se.top&&Ae.pick(this,ze.clientX,ze.clientY,this.renderer)},nt=()=>{this._state=H.NONE},Je=ze=>{vt(!1);var mt=ze.touches.length;if(mt==1)this._state=H.TOUCH_ROTATE,this.pointer_x=ze.touches[0].clientX-Se.left,this.pointer_y=ze.touches[0].clientY-Se.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else if(mt==2){this._state=H.TOUCH_ZOOM;var Ht=ze.touches[0].clientX-ze.touches[1].clientX,pn=ze.touches[0].clientY-ze.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(Ht*Ht+pn*pn)}else mt==3&&(this._state=H.TOUCH_PAN,this.targetTouchId=ze.touches[0].identifier,this.pointer_x=ze.touches[0].clientX-Se.left,this.pointer_y=ze.touches[0].clientY-Se.top,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y)},et=ze=>{ze.preventDefault(),ze.stopPropagation();var mt=ze.touches.length;if(mt==1)this.pointer_x=ze.touches[0].clientX-Se.left,this.pointer_y=ze.touches[0].clientY-Se.top;else if(mt==2){if(this._state===H.TOUCH_ZOOM){var Ht=ze.touches[0].clientX-ze.touches[1].clientX,pn=ze.touches[0].clientY-ze.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(Ht*Ht+pn*pn)}}else if(mt==3&&this._state===H.TOUCH_PAN)for(var Ft=0;3>Ft;Ft++)ze.touches[Ft].identifier==this.targetTouchId&&(this.pointer_x=ze.touches[0].clientX-Se.left,this.pointer_y=ze.touches[0].clientY-Se.top)},Xe=ze=>{var mt=ze.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=H.NONE,mt==1&&Ae!==void 0&&this.pointer_x_start==ze.touches[0].clientX-Se.left&&this.pointer_y_start==ze.touches[0].clientY-Se.top&&Ae.pick(this.cameraObject,ze.touches[0].clientX,ze.touches[0].clientY,this.renderer)},Lt=()=>{vt(!0)},vt=ze=>{if(ze||Se===void 0){var mt=new IntersectionObserver(Ht=>{for(var pn of Ht)Se=pn.boundingClientRect;mt.disconnect()});mt.observe(this.domElement)}},Et=ze=>{vt(!1),this._state=H.SCROLL;var mt=0;0<ze.deltaY?mt=this.scrollRate:0>ze.deltaY&&(mt=-1*this.scrollRate),de+=mt,ze.preventDefault(),ze.stopImmediatePropagation()},kt=()=>{if(typeof this.cameraObject<"u"){var ze=Se.height,mt=this.cameraObject.position.distanceTo(this.cameraObject.target),Ht=0;this.cameraObject.far>this.cameraObject.near&&mt>=this.cameraObject.near&&mt<=this.cameraObject.far&&(Ht=(mt-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),Le.set(this.previous_pointer_x,ze-this.previous_pointer_y,0),Ce.set(this.previous_pointer_x,ze-this.previous_pointer_y,1),je.set(this.pointer_x,ze-this.pointer_y,0),me.set(this.pointer_x,ze-this.pointer_y,1),Le.unproject(this.cameraObject),Ce.unproject(this.cameraObject),je.unproject(this.cameraObject),me.unproject(this.cameraObject),je.sub(Le).multiplyScalar(1-Ht),me.sub(Ce).multiplyScalar(Ht),je.add(me).multiplyScalar(-.002),Ve(je)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(ze,mt)=>{ze.normalize(),Ie.copy(this.cameraObject.position).sub(this.cameraObject.target),Ke.copy(Ie),Ie.normalize(),.8<Math.abs(Ie.dot(ze))&&Ie.copy(this.cameraObject.up),Le.crossVectors(ze,Ie).normalize(),Ce.crossVectors(ze,Le);var Ht=ze.dot(Ke),pn=Le.dot(Ke),Ft=Ce.dot(Ke),ct=ze.dot(this.cameraObject.up),ge=Le.dot(this.cameraObject.up),se=Ce.dot(this.cameraObject.up),pe=Math.cos(mt),He=Math.sin(mt);return je.set(pe*Le.x+He*Ce.x,pe*Le.y+He*Ce.y,pe*Le.z+He*Ce.z),me.set(pe*Ce.x-He*Le.x,pe*Ce.y-He*Le.y,pe*Ce.z-He*Le.z),Ie.copy(this.cameraObject.target),Ie.x=Ie.x+ze.x*Ht+je.x*pn+me.x*Ft,Ie.y=Ie.y+ze.y*Ht+je.y*pn+me.y*Ft,Ie.z=Ie.z+ze.z*Ht+je.z*pn+me.z*Ft,Qe.set(ze.x*ct+je.x*ge+me.x*se,ze.y*ct+je.y*ge+me.y*se,ze.z*ct+je.z*ge+me.z*se),{position:Ie,up:Qe}},this.rotateAboutLookAtpoint=(ze,mt)=>{var Ht=this.getVectorsFromRotateAboutLookAtPoints(ze,mt);this.cameraObject.position.copy(Ht.position),this.updateDirectionalLight(),this.cameraObject.up.copy(Ht.up)};var pt=()=>{if(typeof this.cameraObject<"u"){var ze=Se.width,mt=Se.height;if(0<ze&&0<mt){var Ht=.25*(ze+mt),pn=0,Ft=0;(fe===k.FREE||fe===k.HORIZONTAL)&&(pn=this.pointer_x-this.previous_pointer_x),(fe===k.FREE||fe===k.VERTICAL)&&(Ft=this.previous_pointer_y-this.pointer_y);var ct=Math.sqrt(pn*pn+Ft*Ft);if(0<ct){var ge=1*-Ft/ct,se=1*pn/ct;fe===k.FREE&&ge*(this.pointer_x-.5*(ze-1))+se*(.5*(mt-1)-this.pointer_y);var pe=Math.acos(0/Ht)-.5*Math.PI,He=this.tumble_rate*ct/Ht;Qe.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(),Le.copy(this.cameraObject.up).normalize(),Ce.copy(Le).cross(Qe).normalize().multiplyScalar(ge),Le.multiplyScalar(se),Ne.addVectors(Ce,Le).multiplyScalar(Math.cos(pe)),Qe.multiplyScalar(Math.sin(pe)),Ne.add(Qe),this.rotateAboutLookAtpoint(Ne,-He)}}}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y},Qn=()=>{var ze=0;return this._state===H.ZOOM?ze=this.previous_pointer_y-this.pointer_y:this._state===H.SCROLL?ze=de:(ze=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),ze};this.changeZoomByScrollRateUnit=ze=>{var mt=ze*this.scrollRate;this.changeZoomByValue(mt)},this.changeZoomByValue=ze=>{if(typeof this.cameraObject<"u"){Se.width;var mt=Se.height,Ht=this.cameraObject.position.clone();Ht.sub(this.cameraObject.target);var pn=Ht.length(),Ft=1.5*ze/mt;if(.01<pn+Ft*pn&&(Ht.normalize(),ht.copy(this.cameraObject.position),ht.x+=Ht.x*Ft*pn,ht.y+=Ht.y*Ft*pn,ht.z+=Ht.z*Ft*pn,it())){this.cameraObject.position.copy(ht),this.updateDirectionalLight();var ct=1e-5;if(ct*this.cameraObject.far<this.cameraObject.near+Ft*pn+this.near_plane_fly_debt)this.near_plane_fly_debt!=0&&(this.near_plane_fly_debt+=Ft*pn,0<this.near_plane_fly_debt?(this.cameraObject.near+=this.near_plane_fly_debt,this.cameraObject.far+=this.near_plane_fly_debt,this.near_plane_fly_debt=0):(this.cameraObject.near+=Ft*pn,this.cameraObject.far+=Ft*pn));else{if(this.near_plane_fly_debt==0){var ge=this.cameraObject.near-ct*this.cameraObject.far;this.cameraObject.near=ct*this.cameraObject.far,this.cameraObject.far-=ge,this.near_plane_fly_debt-=ct*this.cameraObject.far}this.near_plane_fly_debt+=Ft*pn}}}};var Jt=()=>{var ze=Qn();this.changeZoomByValue(ze),this._state===H.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),this._state===H.SCROLL&&(de=0,this._state=H.NONE)};this.setDirectionalLight=ze=>{this.directionalLight=ze},this.updateDirectionalLight=()=>{this.directionalLight!=0&&this.directionalLight.position.set(this.cameraObject.position.x,this.cameraObject.position.y,this.cameraObject.position.z)},this.enable=function(){z=!0,this.domElement&&this.domElement.addEventListener&&(this.domElement.addEventListener("mousedown",yt,!1),this.domElement.addEventListener("mousemove",bt,!1),this.domElement.addEventListener("mouseup",_t,!1),this.domElement.addEventListener("mouseleave",nt,!1),this.domElement.addEventListener("touchstart",Je,!1),this.domElement.addEventListener("touchmove",et,!1),this.domElement.addEventListener("touchend",Xe,!1),this.domElement.addEventListener("wheel",Et,!1),this.domElement.addEventListener("contextmenu",ze=>{ze.preventDefault()},!1),this.domElement.addEventListener("mouseenter",Lt,!1))},this.disable=function(){z=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",yt,!1),this.domElement.removeEventListener("mousemove",bt,!1),this.domElement.removeEventListener("mouseup",_t,!1),this.domElement.removeEventListener("mouseleave",nt,!1),this.domElement.removeEventListener("touchstart",Je,!1),this.domElement.removeEventListener("touchmove",et,!1),this.domElement.removeEventListener("touchend",Xe,!1),this.domElement.removeEventListener("wheel",Et,!1),this.domElement.removeEventListener("mouseenter",Lt,!1),this.domElement.removeEventListener("contextmenu",ze=>{ze.preventDefault()},!1))},this.loadPath=ze=>{F=ze.CameraPath,Z=ze.NumberOfPoints},this.loadPathURL=(ze,mt)=>{var Ht=new XMLHttpRequest;Ht.onreadystatechange=()=>{if(Ht.readyState==4&&Ht.status==200){var Ft=JSON.parse(Ht.responseText);this.loadPath(Ft),mt!=null&&typeof mt=="function"&&mt()}};var pn=l(ze);Ht.open("GET",pn,!0),Ht.send()},this.setPathDuration=ze=>{D=ze,xe&&xe.setDuration(D),ee&&ee.setDuration(D)},this.getPlayRate=()=>X,this.setPlayRate=ze=>{X=ze};var Mn=ze=>{var mt=q+ze;mt>D&&(mt-=D),q=mt};this.getTime=()=>q,this.setTime=ze=>{q=ze>D?D:0>ze?0:ze},this.getNumberOfTimeFrame=()=>Z,this.getCurrentTimeFrame=()=>{if(2<Z){var ze=q/D*(Z-1),mt=Math.floor(ze),Ht=Math.ceil(ze);return mt==Ht?mt==Z-1?[mt-1,Ht,0]:[mt,Ht+1,1]:[mt,Ht,1-(ze-mt)]}return Z==1?[0,0,0]:void 0},this.setCurrentTimeFrame=ze=>{2<Z&&(q=D*ze/(Z-1),0>q&&(q=0),q>D&&(q=D))};var ln=ze=>{if(he===A.PATH&&(Mn(ze),F)){for(var mt=this.getCurrentTimeFrame(),Ht=mt[0],pn=mt[1],Ft=mt[2],ct=[F[3*Ht],F[3*Ht+1],F[3*Ht+2]],ge=[F[3*pn],F[3*pn+1],F[3*pn+2]],se=[],pe=0;pe<ct.length;pe++)se.push(Ft*ct[pe]+(1-Ft)*ge[pe]);this.cameraObject.position.set(se[0],se[1],se[2]),this.cameraObject.target.set(ge[0],ge[1],ge[2]),te&&this.cameraObject.lookAt(this.cameraObject.target),K&&(this.directionalLight.position.set(se[0],se[1],se[2]),this.directionalLight.target.position.set(ge[0],ge[1],ge[2]))}};this.calculatePathNow=()=>{ln(0)};var Mt=()=>{this._state===H.ROTATE||this._state===H.TOUCH_ROTATE?pt():this._state===H.PAN||this._state===H.TOUCH_PAN?(kt(),dt.triggerCallback()):(this._state===H.ZOOM||this._state===H.TOUCH_ZOOM||this._state===H.SCROLL)&&(dt.zoom(Qn()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,this._state===H.SCROLL&&(this._state=H.NONE),de=0,dt.triggerCallback())};this.update=ze=>{var mt=ze*X,Ht=z;he===A.PATH?ln(mt):he===A.SMOOTH_CAMERA_TRANSITION&&xe?(xe.update(mt),xe.isTransitionCompleted()&&(he=A.DEFAULT),Ht=!1):he===A.ROTATE_CAMERA_TRANSITION&&ee?(ee.update(mt),ee.isTransitionCompleted()&&(he=A.DEFAULT),Ht=!1):he===A.AUTO_TUMBLE&&oe?oe.update(mt):he===A.SYNC_CONTROL&&dt&&(Mt(),Ht=!1),Ht&&(this._state===H.ROTATE||this._state===H.TOUCH_ROTATE?pt():this._state===H.PAN||this._state===H.TOUCH_PAN?kt():(this._state===H.ZOOM||this._state===H.TOUCH_ZOOM||this._state===H.SCROLL)&&Jt(),this._state!==H.NONE&&he===A.AUTO_TUMBLE&&oe&&oe.stopOnCameraInput,this._state===H.SCROLL&&(this._state=H.NONE)),te?te.update():this.cameraObject.lookAt(this.cameraObject.target)},this.playPath=()=>{he=A.PATH},this.stopPath=()=>{he=A.DEFAULT},this.isPlayingPath=()=>he===A.PATH,this.enableDirectionalLightUpdateWithPath=ze=>{K=ze},this.enableDeviceOrientation=()=>{te||(te=new v(this.cameraObject))},this.disableDeviceOrientation=()=>{te&&(te.dispose(),te=void 0)},this.isDeviceOrientationEnabled=()=>!!te,this.resetView=()=>{var ze=ye[J];this.cameraObject.near=ze.nearPlane,this.cameraObject.far=ze.farPlane,this.cameraObject.position.set(ze.eyePosition[0],ze.eyePosition[1],ze.eyePosition[2]),this.cameraObject.target.set(ze.targetPosition[0],ze.targetPosition[1],ze.targetPosition[2]),this.cameraObject.up.set(ze.upVector[0],ze.upVector[1],ze.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=ze=>{ze.nearPlane&&(this.cameraObject.near=ze.nearPlane),ze.farPlane&&(this.cameraObject.far=ze.farPlane),ze.eyePosition&&this.cameraObject.position.set(ze.eyePosition[0],ze.eyePosition[1],ze.eyePosition[2]),ze.targetPosition&&this.cameraObject.target.set(ze.targetPosition[0],ze.targetPosition[1],ze.targetPosition[2]),ze.upVector&&this.cameraObject.up.set(ze.upVector[0],ze.upVector[1],ze.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.getViewportFromCentreAndRadius=(ze,mt,Ht,pn,Ft,ct)=>{var ge=this.cameraObject.position.x-this.cameraObject.target.x,se=this.cameraObject.position.y-this.cameraObject.target.y,pe=this.cameraObject.position.z-this.cameraObject.target.z,He=1/Math.sqrt(ge*ge+se*se+pe*pe);ge*=He,se*=He,pe*=He;var Pe=pn/Math.tan(Ft*Math.PI/360),Ue=[ze+ge*Pe,mt+se*Pe,Ht+pe*Pe],ot=0,Me=.95;ot=ct>Me*Pe?(1-Me)*Pe:Pe-ct;var re=new s;return re.nearPlane=ot,re.farPlane=Pe+ct,re.eyePosition=Ue,re.targetPosition=[ze,mt,Ht],re.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],re},this.getCurrentViewport=()=>{var ze=new s;return ze.nearPlane=this.cameraObject.near,ze.farPlane=this.cameraObject.far,ze.eyePosition[0]=this.cameraObject.position.x,ze.eyePosition[1]=this.cameraObject.position.y,ze.eyePosition[2]=this.cameraObject.position.z,ze.targetPosition[0]=this.cameraObject.target.x,ze.targetPosition[1]=this.cameraObject.target.y,ze.targetPosition[2]=this.cameraObject.target.z,ze.upVector[0]=this.cameraObject.up.x,ze.upVector[1]=this.cameraObject.up.y,ze.upVector[2]=this.cameraObject.up.z,ze},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(ze,mt,Ht)=>{ee==null&&(xe=new u(ze,mt,this,Ht))},this.rotateCameraTransition=(ze,mt,Ht)=>{xe==null&&(ee=new d(ze,mt,this,Ht))},this.enableCameraTransition=()=>{xe&&(he=A.SMOOTH_CAMERA_TRANSITION),ee&&(he=A.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{he=A.DEFAULT},this.stopCameraTransition=()=>{he=A.DEFAULT,xe=void 0,ee=void 0},this.isTransitioningCamera=()=>he===A.SMOOTH_CAMERA_TRANSITION||he===A.ROTATE_CAMERA_TRANSITION,this.autoTumble=(ze,mt,Ht)=>{oe=new f(ze,mt,Ht,this)},this.enableAutoTumble=()=>{he=A.AUTO_TUMBLE},this.stopAutoTumble=()=>{he=A.DEFAULT,oe=void 0},this.updateAutoTumble=()=>{oe&&(oe.requireUpdate=!0)},this.isAutoTumble=()=>he===A.AUTO_TUMBLE,this.enableRaycaster=(ze,mt,Ht)=>{Ae==null&&(Ae=new p(ze,this.scene,mt,Ht,this.renderer))},this.disableRaycaster=()=>{Ae.disable(),Ae=void 0},this.isSyncControl=()=>currentMpde===A.SYNC_CONTROL,this.enableSyncControl=()=>(he=A.SYNC_CONTROL,dt||(dt=new _),dt.setCurrentCameraSettings(this.cameraObject,ye[J]),dt),this.disableSyncControl=()=>{he=A.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},u=function(x,L,S,C){var A=x.eyePosition,H=x.targetPosition,k=x.upVector,B=L.eyePosition,D=L.targetPosition,z=L.upVector,q=S,F=C,Z=0,K=!1;q.near=Math.min(x.nearPlane,L.nearPlane),q.far=Math.max(x.farPlane,L.farPlane),q.cameraObject.up.set(L.upVector[0],L.upVector[1],L.upVector[2]),this.setDuration=J=>{F=J};var X=J=>{var he=Z+J;he>F&&(he=F),Z=he},te=()=>{var J=Z/F,he=[A[0]*(1-J)+B[0]*J,A[1]*(1-J)+B[1]*J,A[2]*(1-J)+B[2]*J],xe=[H[0]*(1-J)+D[0]*J,H[1]*(1-J)+D[1]*J,H[2]*(1-J)+D[2]*J];k[0]*(1-J)+z[0]*J,k[1]*(1-J)+z[1]*J,k[2]*(1-J)+z[2]*J,q.cameraObject.position.set(he[0],he[1],he[2]),q.cameraObject.target.set(xe[0],xe[1],xe[2])};this.update=J=>{this.enabled===!1||(X(J),te(),Z==F&&(K=!0))},this.isTransitionCompleted=()=>K},d=function(x,L,S,C){var A=C,H=0,k=!1;this.setDuration=D=>{A=D};var B=D=>{var z=H,q=H+D;q>A&&(q=A),H=q;var F=H-z,Z=F/A;S.rotateAboutLookAtpoint(x,Z*L)};this.update=D=>{this.enabled===!1||(B(D),H==A&&(k=!0))},this.isTransitionCompleted=()=>k},p=function(x,L,S,C,A){var H=x,k=A,B=S,D=C,z=new a.Raycaster;z.params.Line.threshold=.1,z.params.Points.threshold=.1;var q=new a.Vector2,F=!1,Z=new Date,K=!1,X=0,te=[],J={zincCamera:void 0,x:-1,y:-1};this.enable=()=>{enable=!0},this.disable=()=>{enable=!1};var he=(oe,de,fe)=>{if(oe.getNDCFromDocumentCoords(de,fe,q),L!==H){var Ae=H.getThreeJSScene();k.render(Ae,oe.cameraObject)}z.setFromCamera(q,oe.cameraObject);var Se=H.getPickableThreeJSObjects();return te.length=0,z.intersectObjects(Se,!0,te)};this.pick=(oe,de,fe)=>{k&&H&&oe&&B&&(he(oe,de,fe),B(te,de,fe))};var xe=(oe,de,fe)=>{if(k&&H&&oe&&D){if(he(oe,de,fe),Z.setTime(Date.now()),te.length===0){if(K)return;K=!0}else K=!1;D(te,de,fe)}};this.move=(oe,de,fe)=>{k&&H&&oe&&D&&(H.displayMarkers?xe(oe,de,fe):(J.zincCamera=oe,J.x=de,J.y=fe,!F&&(X=Z?Date.now()-Z.getTime():250,250<=X?xe(oe,de,fe):(F=!0,setTimeout(ee(J),X)))))};var ee=oe=>function(){F=!1,xe(oe.zincCamera,oe.x,oe.y)}},f=function(x,L,S,C){var A=new a.Vector3,H=C;this.stopOnCameraInput=S,this.requireUpdate=!0;var k=new a.Vector3,B=new a.Vector3,D=z=>{var q=Math.sqrt(z[0]*z[0]+z[1]*z[1]),F=4*Math.abs(z[0]),Z=4*Math.abs(z[1]),K=.25*(F+Z),X=-z[1]/q,te=z[0]/q,J=X*z[0]+te*-z[1];J>K?J=K:J<-K&&(J=-K);var he=Math.acos(J/K)-.5*Math.PI;A.copy(H.cameraObject.position).sub(H.cameraObject.target).normalize(),k.copy(H.cameraObject.up).normalize(),B.crossVectors(k,A).normalize().multiplyScalar(X),k.multiplyScalar(te),k.add(B).multiplyScalar(Math.cos(he)),A.multiplyScalar(Math.sin(he)).add(k)};this.update=z=>{this.enabled===!1||(this.requireUpdate&&(D(x),this.requireUpdate=!1),H.rotateAboutLookAtpoint(A,-L*z/1e3))}},m=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new a.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new a.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1};Object.assign(m.prototype,{update:(()=>{var x,L,S,C,A,H,k=new a.Matrix4,B=new a.Matrix4;return function(D){var z=x!==D.focus||L!==D.fov||S!==D.aspect*this.aspect||C!==D.near||A!==D.far||H!==D.zoom;if(z){x=D.focus,L=D.fov,S=D.aspect*this.aspect,C=D.near,A=D.far,H=D.zoom;var q,F,Z=D.projectionMatrix.clone(),K=.064/2,X=K*C/x,te=C*Math.tan(.5*(a.Math.DEG2RAD*L))/D.zoom;B.elements[12]=-K,k.elements[12]=K,q=-te*S+X,F=te*S+X,Z.elements[0]=2*C/(F-q),Z.elements[8]=(F+q)/(F-q),this.cameraL.projectionMatrix.copy(Z),q=-te*S-X,F=te*S-X,Z.elements[0]=2*C/(F-q),Z.elements[8]=(F+q)/(F-q),this.cameraR.projectionMatrix.copy(Z)}this.cameraL.matrixWorld.copy(D.matrixWorld).multiply(B),this.cameraR.matrixWorld.copy(D.matrixWorld).multiply(k)}})()});var y=function(x){var L=new m;L.aspect=.5,this.setSize=(S,C)=>{x.setSize(S,C)},this.render=(S,C)=>{S.updateMatrixWorld(),C.parent===null&&C.updateMatrixWorld(),L.update(C);var A=x.getSize();x.setScissorTest(!0),x.clear(),x.setScissor(0,0,A.width/2,A.height),x.setViewport(0,0,A.width/2,A.height),x.render(S,L.cameraL),x.setScissor(A.width/2,0,A.width/2,A.height),x.setViewport(A.width/2,0,A.width/2,A.height),x.render(S,L.cameraR),x.setScissorTest(!1)}},v=function(x){var L=this;this.object=x,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var S=H=>{L.deviceOrientation=H},C=()=>{typeof window<"u"&&(L.screenOrientation=window.orientation||0)},A=(()=>{var H=new a.Vector3(0,0,1),k=new a.Euler,B=new a.Quaternion,D=new a.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return(z,q,F,Z,K)=>{var X=new a.Vector3(0,0,1);X.subVectors(z.target,z.position),k.set(F,q,-Z,"YXZ");var te=new a.Quaternion;te.setFromEuler(k),te.multiply(D),te.multiply(B.setFromAxisAngle(H,-K)),X.applyQuaternion(te),X.addVectors(z.position,X),z.lookAt(X)}})();this.connect=()=>{C(),typeof window<"u"&&(window.addEventListener("orientationchange",C,!1),window.addEventListener("deviceorientation",S,!1)),L.enabled=!0},this.disconnect=()=>{typeof window<"u"&&(window.removeEventListener("orientationchange",C,!1),window.removeEventListener("deviceorientation",S,!1)),L.enabled=!1},this.update=()=>{if(L.enabled!==!1){var H=L.deviceOrientation.alpha?a.Math.degToRad(L.deviceOrientation.alpha):0,k=L.deviceOrientation.beta?a.Math.degToRad(L.deviceOrientation.beta):0,B=L.deviceOrientation.gamma?a.Math.degToRad(L.deviceOrientation.gamma):0,D=L.screenOrientation?a.Math.degToRad(L.screenOrientation):0;A(L.object,H,k,B,D)}},this.dispose=function(){this.disconnect()},this.connect()},_=function(){var x=void 0,L=void 0,S=void 0,C=new a.Vector3,A=new a.Vector3,H=new a.Vector3,k=new a.Vector3,B=void 0;this.setCurrentCameraSettings=(D,z)=>{x=D.clone(),L=D,S=z,x.near=S.nearPlane,S.farPlane&&(x.far=S.farPlane),S.eyePosition&&x.position.set(S.eyePosition[0],S.eyePosition[1],S.eyePosition[2]),S.upVector&&x.up.set(S.upVector[0],S.upVector[1],S.upVector[2]),S.targetPosition&&(x.target=new a.Vector3(S.targetPosition[0],S.targetPosition[1],S.targetPosition[2]),x.lookAt(x.target)),x.updateProjectionMatrix(),C.copy(x.position).project(x),A.copy(x.target).project(x)},this.getCurrentPosition=()=>(A.copy(L.target).project(x),[A.x,A.y]),this.zoom=D=>{var z=Math.max(L.zoom-.002*D,1);L.zoom=z,L.updateProjectionMatrix()},this.zoomToBox=(D,z)=>{D.getCenter(H),H.project(x),this.setCenterZoom([H.x,H.y],z)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:L.zoom}),this.setCenterZoom=(D,z)=>{H.set(D[0],D[1],A.z).unproject(x),k.copy(H).sub(L.target),L.target.copy(H),L.lookAt(L.target),L.position.add(k),L.zoom=z,L.updateProjectionMatrix()},this.setEventCallback=D=>{(D===void 0||typeof D=="function")&&(B=D)},this.triggerCallback=()=>{B!==void 0&&typeof B=="function"&&B()}};r.Viewport=s,r.CameraControls=h,r.SmoothCameraTransition=u,r.RotateCameraTransition=d,r.RayCaster=p,r.CameraAutoTumble=f,r.StereoEffect=y,r.NDCCameraControl=_},function(n,r,o){var{Group:a,Matrix4:l}=o(3),s=0,h=function(){return"re"+s++},u=function(d){var p=d,f=new a;f.matrixAutoUpdate=!1,f.userData=this;var m=[],y="",v=[],_=new l,x=3e3;_.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.pickableUpdateRequired=!0,this.isRegion=!0,this.uuid=h(),this.hideAllPrimitives=()=>{m.forEach(L=>L.hideAllPrimitives()),v.forEach(L=>L.setVisibility(!1))},this.showAllPrimitives=()=>{m.forEach(L=>L.showAllPrimitives()),v.forEach(L=>L.setVisibility(!0))},this.setVisibility=L=>{f.visible=L},this.getVisibility=()=>f.visible,this.getGroup=()=>f,this.setTransformation=L=>{_.set(...L),f.matrix.copy(_),f.updateMatrixWorld()},this.setName=L=>{L&&L!==""&&(y=L)},this.getName=()=>y,this.getParent=()=>p,this.getFullSeparatedPath=()=>{var L=[];if(y!==""){L.push(y);for(var S,C=p;C!==void 0;)S=C.getName(),S!==""&&L.unshift(S),C=C.getParent()}return L},this.getFullPath=()=>{var L=this.getFullSeparatedPath();if(0<L.length){var S=L.shift();return L.forEach(C=>{S=S.concat("/",C)}),S}return""},this.createChild=L=>{var S=new u(this);return S.setName(L),m.push(S),f.add(S.getGroup()),S},this.getChildWithName=L=>{if(L){for(var S=L.toLowerCase(),C=0;C<m.length;C++)if(m[C].getName().toLowerCase()===S)return m[C]}},this.findChildFromSeparatedPath=L=>{if(L&&0<L.length&&L[0]===""&&L.shift(),L&&0<L.length){var S=this.getChildWithName(L[0]);return S?(L.shift(),S.findChildFromSeparatedPath(L)):void 0}return this},this.findChildFromPath=L=>{var S=L.split("/");return this.findChildFromSeparatedPath(S)},this.createChildFromSeparatedPath=L=>{if(0<L.length&&L[0]===""&&L.shift(),0<L.length){var S=this.getChildWithName(L[0]);return S||(S=this.createChild(L[0])),L.shift(),S.createChildFromSeparatedPath(L)}return this},this.createChildFromPath=L=>{var S=L.split("/");return this.createChildFromSeparatedPath(S)},this.findOrCreateChildFromPath=L=>{var S=this.findChildFromPath(L);return S||(S=this.createChildFromPath(L)),S},this.addZincObject=L=>{L&&(L.setRegion(this),f.add(L.morph),v.push(L),this.pickableUpdateRequired=!0)},this.removeZincObject=L=>{for(var S=0;S<v.length;S++)if(L===v[S])return f.remove(L.morph),v.splice(S,1),void L.dispose()},this.checkPickableUpdateRequred=L=>{if(this.pickableUpdateRequired)return!0;if(L){for(var S=!1,C=0;C<m.length;C++)if(S=m[C].checkPickableUpdateRequred(L),S)return!0}return!1},this.getPickableThreeJSObjects=(L,S)=>(v.forEach(C=>{if(C.morph&&C.morph.visible){var A=C.marker;A&&A.isEnabled()&&L.push(A.morph),L.push(C.morph)}}),S&&m.forEach(C=>{C.getPickableThreeJSObjects(L,S)}),this.pickableUpdateRequired=!1,L),this.setDuration=L=>{x=L,v.forEach(S=>S.setDuration(L)),m.forEach(S=>S.setDuration(L))},this.getDuration=()=>x,this.getBoundingBox=L=>{var S,C;return v.forEach(A=>{C=A.getBoundingBox(),C&&(S==null?S=C.clone():S.union(C))}),L&&m.forEach(A=>{C=A.getBoundingBox(L),C&&(S==null?S=C.clone():S.union(C))}),S},this.clear=L=>{L&&m.forEach(S=>S.clear(L)),v.forEach(S=>{f.remove(S.morph),S.dispose()}),m=[],v=[]},this.objectIsInRegion=(L,S)=>{for(var C=0;C<v.length;C++)if(L===v[C])return!0;if(S){for(var A=0;A<m.length;A++)if(m[A].objectIsInRegion(L,S))return!0}return!1},this.forEachGeometry=(L,S)=>{v.forEach(C=>{C.isGeometry&&L(C)}),S&&m.forEach(C=>C.forEachGeometry(L,S))},this.forEachGlyphset=(L,S)=>{v.forEach(C=>{C.isGlyphset&&L(C)}),S&&m.forEach(C=>C.forEachGlyphset(L,S))},this.forEachPointset=(L,S)=>{v.forEach(C=>{C.isPointset&&L(C)}),S&&m.forEach(C=>C.forEachPointset(L,S))},this.forEachLine=(L,S)=>{v.forEach(C=>{C.isLines&&L(C)}),S&&m.forEach(C=>C.forEachLine(L,S))},this.findObjectsWithAnatomicalId=(L,S)=>(v.forEach(C=>{C.anatomicalId===L&&objectsArray.push(C)}),S&&m.forEach(C=>{var A=C.findObjectsWithAnatomicalId(L,S);objectsArray.push(...A)}),objectsArray),this.findObjectsWithGroupName=(L,S)=>{var C=[];return v.forEach(A=>{var H=A.groupName?A.groupName.toLowerCase():A.groupName,k=L&&L.toLowerCase();H===k&&C.push(A)}),S&&m.forEach(A=>{var H=A.findObjectsWithGroupName(L,S);C.push(...H)}),C},this.findGeometriesWithGroupName=(L,S)=>{var C=this.findObjectsWithGroupName(L,S),A=C.filter(H=>H.isGeometry);return A},this.findPointsetsWithGroupName=(L,S)=>{var C=this.findObjectsWithGroupName(L,S),A=C.filter(H=>H.isPointset);return A},this.findGlyphsetsWithGroupName=(L,S)=>{var C=this.findObjectsWithGroupName(L,S),A=C.filter(H=>H.isGlyphset);return A},this.findLinesWithGroupName=(L,S)=>{var C=this.findObjectsWithGroupName(L,S),A=C.filter(H=>H.isLines);return A},this.getAllObjects=L=>{var S=[...v];return L&&m.forEach(C=>{var A=C.getAllObjects(L);S.push(...A)}),S},this.getChildRegions=L=>{var S=[...m];return L&&m.forEach(C=>{var A=C.getChildRegions(L);S.push(...A)}),S},this.getCurrentTime=()=>{if(v[0]!=null)return v[0].getCurrentTime();for(var L,S=0;S<m.length;S++)if(L=m[S].getCurrentTime(),L!==-1)return L;return-1},this.setMorphTime=(L,S)=>{v.forEach(C=>{C.setMorphTime(L)}),S&&m.forEach(C=>{C.setMorphTime(L)})},this.isTimeVarying=()=>{for(var L=0;L<v.length;L++)if(v[L].isTimeVarying())return!0;for(var S=0;S<m.length;S++)if(m[S].isTimeVarying())return!0;return!1},this.renderGeometries=(L,S,C,A,H)=>{var k=this.getAllObjects(H);if(k.forEach(z=>{z.render(L*S,C,A)}),A&&A.displayMarkers&&C===!1&&0<A.markerDepths.length){var B=Math.min(...A.markerDepths),D=Math.max(...A.markerDepths);k.forEach(z=>{z.processMarkerVisual(B,D,A)})}}};r.Region=u},function(n,r,o){var a=o(3);r.Minimap=function(l){var s=l;this.camera=new a.OrthographicCamera(-.5,.5,.5,-.5,.01,10),this.helper=void 0;var h=new a.BufferGeometry,u=new Float32Array([-1,-1,1,1,-1,1,1,1,1,1,1,1,-1,1,1,-1,-1,1]),d=new a.BufferAttribute(u,3);h.setAttribute("position",d);var p=new a.MeshBasicMaterial({color:3355443,depthTest:!1,depthWrite:!1,opacity:.5,transparent:!0});this.mask=new a.Mesh(h,p);var f=new a.Box3,m=new a.Vector3;this.getDiffFromNormalised=(v,_)=>{f.setFromBufferAttribute(d).getCenter(m);var x=m.clone().project(this.camera),L=new a.Vector3(v,_,x.z).unproject(this.camera);return L.sub(m)};var y=(v,_)=>{s.camera.near&&(this.camera.near=s.camera.near),_.farPlane&&(this.camera.far=_.farPlane),_.eyePosition&&this.camera.position.set(_.eyePosition[0],_.eyePosition[1],_.eyePosition[2]),_.upVector&&this.camera.up.set(_.upVector[0],_.upVector[1],_.upVector[2]),_.targetPosition&&this.camera.lookAt(new a.Vector3(_.targetPosition[0],_.targetPosition[1],_.targetPosition[2])),this.camera.zoom=1/v,this.camera.updateProjectionMatrix()};this.getBoundary=()=>{var v=new a.Vector3().copy(s.camera.target).project(s.camera),_=new a.Vector3(-1,-1,v.z).unproject(s.camera),x=new a.Vector3(1,-1,v.z).unproject(s.camera),L=new a.Vector3(1,1,v.z).unproject(s.camera),S=new a.Vector3(-1,1,v.z).unproject(s.camera);d.copyVector3sArray([_,x,L,L,S,_]),d.needsUpdate=!0},this.updateCamera=()=>{this.getBoundary();var v=s.getZincCameraControls(),_=s.getBoundingBox();if(_){var x=_.min.distanceTo(_.max),L=x/2,S=(_.min.x+_.max.x)/2,C=(_.min.y+_.max.y)/2,A=(_.min.z+_.max.z)/2,H=v.getViewportFromCentreAndRadius(S,C,A,L,40,L*4);y(x,H)}}}},function(n,r,o){var a=o(3),l=o(43)(a),s=o(2).Geometry,h=o(44),u=o(45).default,d=a.BufferGeometryLoader,p=function(f){var m;f&&f.isGeometry&&(m=f);var y=void 0,v=void 0,_=!1,x=void 0,L=k=>{var B=m.morph.material.clone();B.morphTargets=!1;var D=new s,z=new d,q=z.parse(k),F=new a.Mesh(q.geometry,B);return D.geometry=F.geometry,D.morph=F,D.morph.userData=D,D},S=k=>{switch(k.data.action){case"message":console.log(k.data.message);break;case"result":var B=new p(L(k.data.object));x&&x(B),x=void 0,_=!1;break;default:throw"Cannot handle specified action."}},C=k=>{if(h!==void 0&&(v=h(46)),!v)y=new(o(47)).GeometryCSGInternal(k);else if(k&&k.isGeometry){var B=k.morph,D=B.geometry.clone().applyMatrix(B.matrix).toJSON();v.addEventListener("message",function(z){S(z)}),v.postMessage({action:"initialise",object:D})}};this.getHostGeometry=()=>{var k=new l(m.morph);return new A(k)},this.getGeometry=()=>m;var A=k=>{var B=m.morph.material.clone();B.morphTargets=!1;var D=k.toMesh(B),z=new s;return z.geometry=D.geometry,z.morph=D,z.morph.userData=z,z};this.setCSG=k=>{y.setCSG(k)};var H=(k,B,D,z)=>{if(_)z("On progress");else{var q=k.morph,F=q.geometry.clone().applyMatrix(q.matrix).toJSON();x=D,_=!0,v.postMessage({action:B,object:F})}};this.intersect=k=>new u((B,D)=>{if(v)H(k,"intersect",B,D);else{var z=y.intersect(k),q=new p(A(z));q.setCSG(z),B(q)}}),this.subtract=k=>new u((B,D)=>{if(v)H(k,"intersect",B,D);else{var z=y.subtract(k),q=new p(A(z));q.setCSG(z),B(q)}}),this.union=k=>new u((B,D)=>{if(v)H(k,"intersect",B,D);else{var z=y.union(k),q=new p(A(z));q.setCSG(z),B(q)}}),this.terminateWorker=()=>{v&&v.terminate()},C(f)};r.GeometryCSG=p},function(n,r,o){var a=1e-5,l=0,s=1,h=2,u=3;n.exports=function(d){var p=function(f){var m,y,v,_,x,L,S,C=[];if(f.isBufferGeometry&&(f=new d.Geometry().fromBufferGeometry(f)),f instanceof d.Geometry)this.matrix=new d.Matrix4;else if(f.isMesh)f.updateMatrix(),this.matrix=f.matrix.clone(),f=f.geometry,f.isBufferGeometry&&(f=new d.Geometry().fromBufferGeometry(f)),f.mergeVertices(),f.computeVertexNormals(!1);else{if(f instanceof p.Node)return this.tree=f,this.matrix=new d.Matrix4,this;throw"ThreeBSP: Given geometry is unsupported"}for(m=0,y=f.faces.length;m<y;m++)v=f.faces[m],x=f.faceVertexUvs[0][m],S=new p.Polygon,v instanceof d.Face3?(_=f.vertices[v.a],L=x?new d.Vector2(x[0].x,x[0].y):null,_=new p.Vertex(_.x,_.y,_.z,v.vertexNormals[0],L),_.applyMatrix4(this.matrix),S.vertices.push(_),_=f.vertices[v.b],L=x?new d.Vector2(x[1].x,x[1].y):null,_=new p.Vertex(_.x,_.y,_.z,v.vertexNormals[2],L),_.applyMatrix4(this.matrix),S.vertices.push(_),_=f.vertices[v.c],L=x?new d.Vector2(x[2].x,x[2].y):null,_=new p.Vertex(_.x,_.y,_.z,v.vertexNormals[2],L),_.applyMatrix4(this.matrix),S.vertices.push(_)):(d.Face4,_=f.vertices[v.a],L=x?new d.Vector2(x[0].x,x[0].y):null,_=new p.Vertex(_.x,_.y,_.z,v.vertexNormals[0],L),_.applyMatrix4(this.matrix),S.vertices.push(_),_=f.vertices[v.b],L=x?new d.Vector2(x[1].x,x[1].y):null,_=new p.Vertex(_.x,_.y,_.z,v.vertexNormals[1],L),_.applyMatrix4(this.matrix),S.vertices.push(_),_=f.vertices[v.c],L=x?new d.Vector2(x[2].x,x[2].y):null,_=new p.Vertex(_.x,_.y,_.z,v.vertexNormals[2],L),_.applyMatrix4(this.matrix),S.vertices.push(_),_=f.vertices[v.d],L=x?new d.Vector2(x[3].x,x[3].y):null,_=new p.Vertex(_.x,_.y,_.z,v.vertexNormals[3],L),_.applyMatrix4(this.matrix),S.vertices.push(_)),S.calculateProperties(),C.push(S);this.tree=new p.Node(C)};return p.prototype.subtract=function(f){var m=this.tree.clone(),y=f.tree.clone();return m.invert(),m.clipTo(y),y.clipTo(m),y.invert(),y.clipTo(m),y.invert(),m.build(y.allPolygons()),m.invert(),m=new p(m),m.matrix=this.matrix,m},p.prototype.union=function(f){var m=this.tree.clone(),y=f.tree.clone();return m.clipTo(y),y.clipTo(m),y.invert(),y.clipTo(m),y.invert(),m.build(y.allPolygons()),m=new p(m),m.matrix=this.matrix,m},p.prototype.intersect=function(f){var m=this.tree.clone(),y=f.tree.clone();return m.invert(),y.clipTo(m),y.invert(),m.clipTo(y),y.clipTo(m),m.build(y.allPolygons()),m.invert(),m=new p(m),m.matrix=this.matrix,m},p.prototype.toGeometry=function(){var f,m,y,v,_,x,L,S,C,A,H=new d.Matrix4().getInverse(this.matrix),k=new d.Geometry,B=this.tree.allPolygons(),D=B.length,z={};for(f=0;f<D;f++)for(y=B[f],v=y.vertices.length,m=2;m<v;m++)A=[],S=y.vertices[0],A.push(new d.Vector2(S.uv.x,S.uv.y)),S=new d.Vector3(S.x,S.y,S.z),S.applyMatrix4(H),typeof z[S.x+","+S.y+","+S.z]>"u"?(k.vertices.push(S),_=z[S.x+","+S.y+","+S.z]=k.vertices.length-1):_=z[S.x+","+S.y+","+S.z],S=y.vertices[m-1],A.push(new d.Vector2(S.uv.x,S.uv.y)),S=new d.Vector3(S.x,S.y,S.z),S.applyMatrix4(H),typeof z[S.x+","+S.y+","+S.z]>"u"?(k.vertices.push(S),x=z[S.x+","+S.y+","+S.z]=k.vertices.length-1):x=z[S.x+","+S.y+","+S.z],S=y.vertices[m],A.push(new d.Vector2(S.uv.x,S.uv.y)),S=new d.Vector3(S.x,S.y,S.z),S.applyMatrix4(H),typeof z[S.x+","+S.y+","+S.z]>"u"?(k.vertices.push(S),L=z[S.x+","+S.y+","+S.z]=k.vertices.length-1):L=z[S.x+","+S.y+","+S.z],C=new d.Face3(_,x,L,new d.Vector3(y.normal.x,y.normal.y,y.normal.z)),k.faces.push(C),k.faceVertexUvs[0].push(A);return k},p.prototype.toBufferGeometry=function(){var f=this.toGeometry(),m=new d.BufferGeometry().fromGeometry(f);return m},p.prototype.toMesh=function(f){var m=this.toBufferGeometry(),y=new d.Mesh(m,f);return y.position.setFromMatrixPosition(this.matrix),y.rotation.setFromRotationMatrix(this.matrix),y},p.Polygon=function(f){f instanceof Array||(f=[]),this.vertices=f,0<f.length?this.calculateProperties():this.normal=this.w=void 0},p.Polygon.prototype.calculateProperties=function(){var f=this.vertices[0],m=this.vertices[1],y=this.vertices[2];return this.normal=m.clone().subtract(f).cross(y.clone().subtract(f)).normalize(),this.w=this.normal.clone().dot(f),this},p.Polygon.prototype.clone=function(){var f,m,y=new p.Polygon;for(f=0,m=this.vertices.length;f<m;f++)y.vertices.push(this.vertices[f].clone());return y.calculateProperties(),y},p.Polygon.prototype.flip=function(){var f,m=[];for(this.normal.multiplyScalar(-1),this.w*=-1,f=this.vertices.length-1;0<=f;f--)m.push(this.vertices[f]);return this.vertices=m,this},p.Polygon.prototype.classifyVertex=function(f){var m=this.normal.dot(f)-this.w;return m<-a?h:m>a?s:l},p.Polygon.prototype.classifySide=function(f){var m,y,v,_=0,x=0,L=f.vertices.length;for(m=0;m<L;m++)y=f.vertices[m],v=this.classifyVertex(y),v===s?_++:v===h&&x++;return 0<_&&x===0?s:_===0&&0<x?h:_===0&&x===0?l:u},p.Polygon.prototype.splitPolygon=function(f,m,y,v,_){var x=this.classifySide(f);if(x===l)(0<this.normal.dot(f.normal)?m:y).push(f);else if(x===s)v.push(f);else if(x===h)_.push(f);else{var L,S,C,A,H,k,B,D,z,q=[],F=[];for(S=0,L=f.vertices.length;S<L;S++)C=(S+1)%L,k=f.vertices[S],B=f.vertices[C],A=this.classifyVertex(k),H=this.classifyVertex(B),A!=h&&q.push(k),A!=s&&F.push(k),(A|H)===u&&(D=(this.w-this.normal.dot(k))/this.normal.dot(B.clone().subtract(k)),z=k.interpolate(B,D),q.push(z),F.push(z));3<=q.length&&v.push(new p.Polygon(q).calculateProperties()),3<=F.length&&_.push(new p.Polygon(F).calculateProperties())}},p.Vertex=function(f,m,y,v,_){this.x=f,this.y=m,this.z=y,this.normal=v||new d.Vector3,this.uv=_||new d.Vector2},p.Vertex.prototype.clone=function(){return new p.Vertex(this.x,this.y,this.z,this.normal.clone(),this.uv.clone())},p.Vertex.prototype.add=function(f){return this.x+=f.x,this.y+=f.y,this.z+=f.z,this},p.Vertex.prototype.subtract=function(f){return this.x-=f.x,this.y-=f.y,this.z-=f.z,this},p.Vertex.prototype.multiplyScalar=function(f){return this.x*=f,this.y*=f,this.z*=f,this},p.Vertex.prototype.cross=function(f){var m=this.x,y=this.y,v=this.z;return this.x=y*f.z-v*f.y,this.y=v*f.x-m*f.z,this.z=m*f.y-y*f.x,this},p.Vertex.prototype.normalize=function(){var f=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return this.x/=f,this.y/=f,this.z/=f,this},p.Vertex.prototype.dot=function(f){return this.x*f.x+this.y*f.y+this.z*f.z},p.Vertex.prototype.lerp=function(f,m){return this.add(f.clone().subtract(this).multiplyScalar(m)),this.normal.add(f.normal.clone().sub(this.normal).multiplyScalar(m)),this.uv.add(f.uv.clone().sub(this.uv).multiplyScalar(m)),this},p.Vertex.prototype.interpolate=function(f,m){return this.clone().lerp(f,m)},p.Vertex.prototype.applyMatrix4=function(f){var m=this.x,y=this.y,v=this.z,_=f.elements;return this.x=_[0]*m+_[4]*y+_[8]*v+_[12],this.y=_[1]*m+_[5]*y+_[9]*v+_[13],this.z=_[2]*m+_[6]*y+_[10]*v+_[14],this},p.Node=function(f){var m,y,v=[],_=[];if(this.polygons=[],this.front=this.back=void 0,f instanceof Array&&f.length!==0){for(this.divider=f[0].clone(),m=0,y=f.length;m<y;m++)this.divider.splitPolygon(f[m],this.polygons,this.polygons,v,_);0<v.length&&(this.front=new p.Node(v)),0<_.length&&(this.back=new p.Node(_))}},p.Node.isConvex=function(f){var m,y;for(m=0;m<f.length;m++)for(y=0;y<f.length;y++)if(m!==y&&f[m].classifySide(f[y])!==h)return!1;return!0},p.Node.prototype.build=function(f){var m,y,v=[],_=[];for(this.divider||(this.divider=f[0].clone()),m=0,y=f.length;m<y;m++)this.divider.splitPolygon(f[m],this.polygons,this.polygons,v,_);0<v.length&&(!this.front&&(this.front=new p.Node),this.front.build(v)),0<_.length&&(!this.back&&(this.back=new p.Node),this.back.build(_))},p.Node.prototype.allPolygons=function(){var f=this.polygons.slice();return this.front&&(f=f.concat(this.front.allPolygons())),this.back&&(f=f.concat(this.back.allPolygons())),f},p.Node.prototype.clone=function(){var f=new p.Node;return f.divider=this.divider.clone(),f.polygons=this.polygons.map(function(m){return m.clone()}),f.front=this.front&&this.front.clone(),f.back=this.back&&this.back.clone(),f},p.Node.prototype.invert=function(){var f,m,y;for(f=0,m=this.polygons.length;f<m;f++)this.polygons[f].flip();return this.divider.flip(),this.front&&this.front.invert(),this.back&&this.back.invert(),y=this.front,this.front=this.back,this.back=y,this},p.Node.prototype.clipPolygons=function(f){var m,y,v,_;if(!this.divider)return f.slice();for(v=[],_=[],m=0,y=f.length;m<y;m++)this.divider.splitPolygon(f[m],v,_,v,_);return this.front&&(v=this.front.clipPolygons(v)),_=this.back?this.back.clipPolygons(_):[],v.concat(_)},p.Node.prototype.clipTo=function(f){this.polygons=f.clipPolygons(this.polygons),this.front&&this.front.clipTo(f),this.back&&this.back.clipTo(f)},p}},function(n,r){n.exports=TMe()},function(n,r){n.exports=_Me},function(n,r,o){var a=o(2).Geometry,l=o(3),s=l.BufferGeometryLoader;n.exports=function(h){var u=void 0,d=function(v){var _=new s,x=_.parse(v),L=new l.MeshPhongMaterial,S=new l.Mesh(x.geometry,L),C=new a;return C.morph=S,C},p=function(v){var _=d(v);u=new(o(47)).GeometryCSGInternal(_),h.postMessage({action:"message",message:"Initialised"})},f=function(v){if(u){var _=d(v),x=u.intersect(_),L=x.toBufferGeometry().toJSON();h.postMessage({action:"result",object:L})}},m=function(v){if(u){var _=d(v),x=u.subtract(_),L=x.toBufferGeometry().toJSON();h.postMessage({action:"result",object:L})}},y=function(v){if(u){var _=d(v),x=u.union(_),L=x.toBufferGeometry().toJSON();h.postMessage({action:"result",object:L})}};h.addEventListener("message",function(v){switch(v.data.action){case"initialise":p(v.data.object);break;case"intersect":f(v.data.object);break;case"subtract":m(v.data.object);break;case"union":y(v.data.object);break;default:throw"Cannot handle specified action."}})}},function(n,r,o){var a=o(3),l=o(43)(a);o(2).Geometry,o(42).GeometryCSG;var s=function(h){var u;h&&h.isGeometry&&(u=h);var d;this.setGeometry=f=>{f&&f.isGeometry&&(u=f),d=void 0},this.setCSG=f=>{d=f};var p=f=>{if(u&&u.morph&&f&&f.morph){d===void 0&&(d=new l(u.morph));var m=new l(f.morph);return m}};this.intersect=f=>{var m=p(f);return d&&m?d.intersect(m):void 0},this.subtract=f=>{var m=p(f);return d&&m?d.subtract(m):void 0},this.union=f=>{var m=p(f);return d&&m?d.union(m):void 0}};r.GeometryCSGInternal=s},function(n,r,o){var a=o(3),l=o(43)(a);o(13).Glyphset;var s=function(h){var u;h&&h.isGlyphset&&(u=h);var d=[];this.setGlyphset=m=>{m&&m.isGlyphset&&(u=m),hostCSG=void 0},this.getGlyphset=()=>u;var p=()=>m=>{var y=m.getMesh(),v=m.getLabel();if(y){var _=new l(y.geometry.clone().applyMatrix(y.matrix)),x=[];x.csg=_,x.label=v,y.material&&(x.material=y.material.clone()),d.push(x)}},f=m=>{if(u&&m&&m.morph){d.length==0&&u.forEachGlyph(p());var y=new l(m.morph);return y}};this.intersect=m=>{var y=f(m);if(0<d.length&&y){for(var v=new(o(13)).Glyphset,_=0;_<d.length;_++){var x=d[_],L=x.csg.intersect(y),S=L.toMesh();if(S&&S.geometry&&0<S.geometry.vertices.length){x.material&&(S.material=x.material,S.material.side=a.DoubleSide,S.material.clippingPlanes=null);var C=v.addMeshAsGlyph(S,_+1);C.setLabel(x.label)}}var A=new s(v);return A}}};r.GlyphsetCSG=s}])})})(IN);var Tl=IN.exports;const SQ=qY(Tl),fU={isWebGLAvailable:function(){try{var t=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(t.getContext("webgl")||t.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var t=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&t.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(t){var e={1:"WebGL",2:"WebGL 2"},n={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},r='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.',o=document.createElement("div");return o.id="webglmessage",o.style.fontFamily="monospace",o.style.fontSize="20px",o.style.fontWeight="normal",o.style.textAlign="center",o.style.background="#fff",o.style.color="#000",o.style.padding="1.5em",o.style.width="400px",o.style.margin="5em auto 0",n[t]?r=r.replace("$0","graphics card"):r=r.replace("$0","browser"),r=r.replace("$1",e[t]),o.innerHTML=r,o}},sw={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},C1=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};C1.prototype.setName=function(t){if(t&&this.instanceName!==t){this.instanceName=t;const e=this.onChangedCallbacks.slice();for(let n=0;n<e.length;n++)e[n](this,sw.NAME_CHANGED)}},C1.prototype.settingsChanged=function(){const t=this.onChangedCallbacks.slice();for(let e=0;e<t.length;e++)t[e](this,sw.SETTINGS_CHANGED)},C1.prototype.exportSettings=function(){const t={};return t.dialog=this.typeName,t.name=this.instanceName,t},C1.prototype.importSettings=function(t){return t.dialog==this.typeName?(this.setName(t.name),!0):!1},C1.prototype.publishChanges=function(t,e,n){for(let r=0;r<this.eventNotifiers.length;r++)this.eventNotifiers[r].publish(this,e,t,n)},C1.prototype.getName=function(){return this.instanceName},C1.prototype.destroy=function(){const t=this.onChangedCallbacks.slice();for(let e=0;e<t.length;e++)t[e](this,sw.DESTROYED);delete this},C1.prototype.addChangedCallback=function(t){this.onChangedCallbacks.includes(t)==!1&&this.onChangedCallbacks.push(t)},C1.prototype.removeChangedCallback=function(t){const e=this.onChangedCallbacks.indexOf(t);e>-1&&this.onChangedCallbacks.splice(e,1)},C1.prototype.addNotifier=function(t){this.eventNotifiers.push(t)};const Qu={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},LMe=function(t,e,n){this.eventType=t,this.identifiers=e,this.zincObjects=n},wMe=function(t,e,n){this.targetedID=[];const r=t,o=e;this.targetEventType=n;const a=this;n===void 0&&(this.targetEventType=Qu.ALL),this.getEventType=function(){return n},this.notify=function(l,s,h,u){if(l!==r&&(a.targetEventType===Qu.ALL||a.targetEventType===s)){const d=new LMe(s,h,u);o(d)}}},MMe=function(){const t=[];this.publish=function(e,n,r,o){for(let a=0;a<t.length;a++)t[a].notify(e,n,r,o)},this.subscribe=function(e,n,r){if(typeof n=="function"){const o=new wMe(e,n,r);return t.push(o),o}},this.unsubscribe=function(e){for(let n=0;n<t.length;n++)if(e===t[n]){t.splice(n,1);return}}},SMe=function(){let t=[],e=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const n=[],r=[],o=this,a=function(h,u){if(h.length==0&&u.length==0)return!1;for(let d=0;d<h.length;d++){let p=!1;for(let f=0;f<u.length;f++)h[d]===u[f]&&(p=!0);if(!p)return!0}for(let d=0;d<u.length;d++){let p=!1;for(let f=0;f<h.length;f++)u[d]===h[f]&&(p=!0);if(!p)return!0}return!1},l=function(h,u){if(n.length=0,u.length==0)return h;for(let d=0;d<h.length;d++){let p=!1;for(let f=0;f<u.length;f++)h[d]===u[f]&&(p=!0);p||n.push(h[d])}return n};this.setHighlighted=function(h){const u=[...t];o.resetHighlighted();const d=l(h,e),p=s(d);for(let f=0;f<p.length;f++)p[f]&&p[f].material&&p[f].material.emissive&&p[f].material.emissive.setRGB(...o.highlightColour);return t=d,a(t,u)},this.setSelected=function(h){const u=[...e];l(t,h),o.resetHighlighted(),o.resetSelected();const d=s(h);for(let p=0;p<d.length;p++)d[p]&&d[p].material&&d[p].material.emissive&&d[p].material.emissive.setRGB(...o.selectColour);return e=h,a(e,u)};const s=function(h){r.length=0;for(let u=0;u<h.length;u++)h[u].material&&r.push(h[u]);return r};this.resetHighlighted=function(){const h=s(t);for(let u=0;u<h.length;u++)h[u]&&h[u].material&&(h[u].material.emissive&&h[u].material.emissive.setRGB(...o.originalColour),h[u].material.depthFunc&&(h[u].material.depthFunc=Tl.THREE.LessEqualDepth));t=[]},this.resetSelected=function(){const h=s(e);for(let u=0;u<h.length;u++)h[u]&&h[u].material&&(h[u].material.emissive&&h[u].material.emissive.setRGB(...o.originalColour),h[u].material.depthFunc&&(h[u].material.depthFunc=Tl.THREE.LessEqualDepth));e=[]},this.getSelected=function(){return e},this.reset=function(){o.resetSelected(),o.resetHighlighted()}},lw=SQ.THREE,CMe=function(){const t=document.createElement("div");let e;if(t.style.height="100%",fU.isWebGLAvailable())e=new SQ.Renderer(t,window),SQ.defaultMaterialColor=16777116,e.initialiseVisualisation(),e.playAnimation=!1;else{const n=fU.getWebGLErrorMessage();t.appendChild(n)}return{Zinc:SQ,renderer:e,container:t}},ii=function(){C1.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new SMe,this.zincRenderer=null,this.selectedScreenCoordinates=new lw.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0};ii.prototype=Object.create(C1.prototype),ii.prototype.getIntersectedObject=function(t){if(t){const e=t.map(r=>{if(r&&r.object&&r.object.userData){if(r.object.userData.isMarker)return 1;if(r.object.name&&r.object.userData.isZincObject)return 2}return 0});let n=e.indexOf(1);return n=n>-1?n:e.indexOf(2),t[n]}},ii.prototype.getAnnotationsFromObjects=function(t){const e=[];for(var n=0;n<t.length;n++){const r=t[n].userData;let o;if(r)if(r.isGlyph||r.isGlyphset){let a=r;r.isGlyph&&(a=r.getGlyphset()),o=a.userData?a.userData.annotation:void 0,o&&o.data&&(t[n].name&&t[n].name!=""?o.data.id=t[n].name:o.data.id=a.groupName)}else o=r.userData?r.userData.annotation:void 0,o&&o.data&&(o.data.id=t[n].name);o&&e.push(o)}return e},ii.prototype.setHighlightedByObjects=function(t,e,n){const r=this.graphicsHighlight.setHighlighted(t),o=this.objectsToZincObjects(t);if(n){let a=Qu.MOVE;r&&(a=Qu.HIGHLIGHTED);const l=this.getAnnotationsFromObjects(t);l.length>0&&(l[0].coords=e),this.publishChanges(l,a,o)}return r},ii.prototype.setHighlightedByZincObjects=function(t,e,n){let r=[];return t&&t.forEach(o=>{o&&o.morph&&r.push(o.morph)}),this.setHighlightedByObjects(r,e,n)},ii.prototype.setupLiveCoordinates=function(t){if(this.liveUpdatesObjects=t,t&&t.length>0){const e=this.scene.getBoundingBoxOfZincObjects(t);let n=new lw.Vector3;e.getCenter(n),this.selectedCenter==null?this.selectedCenter=n:this.selectedCenter.copy(n)}else this.selectedCenter=void 0},ii.prototype.objectsToZincObjects=function(t){const e=[];for(let n=0;n<t.length;n++){let r=t[n].userData;if(r)if(r.isGlyph||r.isGlyphset){let o=r;r.isGlyph&&(o=r.getGlyphset()),e.push(o)}else e.push(r)}return e},ii.prototype.setSelectedByObjects=function(t,e,n){const r=this.graphicsHighlight.setSelected(t);if(r){const o=this.objectsToZincObjects(t);if(this.setupLiveCoordinates(o),n){const a=Qu.SELECTED,l=this.getAnnotationsFromObjects(t);l.length>0&&(l[0].coords=e),this.publishChanges(l,a,o)}}return r},ii.prototype.setSelectedByZincObjects=function(t,e,n){let r=[];return t&&t.forEach(o=>{o&&o.morph&&r.push(o.morph)}),this.setSelectedByObjects(r,e,n)};const EMe=function(t){return function(e){t.push(e.getMesh())}};ii.prototype.findObjectsByGroupName=function(t){const e=this.scene.findGeometriesWithGroupName(t),n=[];for(let o=0;o<e.length;o++)n.push(e[o].morph);const r=this.scene.findGlyphsetsWithGroupName(t);for(let o=0;o<r.length;o++)r[o].forEachGlyph(EMe(n));return n},ii.prototype.setHighlightedByGroupName=function(t,e){const n=this.findObjectsByGroupName(t);return this.setHighlightedByObjects(n,void 0,e)},ii.prototype.setSelectedByGroupName=function(t,e){const n=this.findObjectsByGroupName(t);return this.setSelectedByObjects(n,void 0,e)},ii.prototype.changeBackgroundColour=function(t){const e=new lw.Color(t);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(e,1)},ii.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},ii.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},ii.prototype.playAnimation=function(t){this.zincRenderer&&(this.zincRenderer.playAnimation=t)},ii.prototype.setPlayRate=function(t){this.zincRenderer&&this.zincRenderer.setPlayRate(t)},ii.prototype.getPlayRate=function(t){return this.zincRenderer?this.zincRenderer.getPlayRate():0},ii.prototype.initialiseRenderer=function(t){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let e=CMe();this.Zinc=e.Zinc,this.zincRenderer=e.renderer,this.rendererContainer=e.container}t&&(this.displayArea=t,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},ii.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),C1.prototype.destroy.call(this)};const HMe=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},AMe=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.currentTime=0,this.timeVarying=!1},TU=function(t){ii.call(this);const e=this;let n;this.sceneData=new AMe;const r=new Array,o=new Array,a=new Array;let l;const s=t;this.NDCCameraControl=void 0,e.typeName="Organ Viewer",this.currentTime=0,this.getSceneData=function(){return e.sceneData},this.updateTime=function(A){let H=6e3;e.scene&&(H=e.scene.getDuration());const k=A/100*H;e.sceneData.nerveMapIsActive||e.scene&&e.scene.setMorphsTime(k),e.sceneData.currentTime=A,e.currentTime=A};const h=function(){let A=3e3;e.scene&&(A=e.scene.getDuration());const H=e.zincRenderer.getCurrentTime();for(let k=0;k<r.length;k++)r[k](H);!e.sceneData.nerveMapIsActive&&n&&n.setMorphsTime(H),e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setTime(H/A),e.sceneData.currentTime=H/A*100,e.currentTime=H/A*100};this.getCurrentTime=function(){return e.sceneData.currentTime},this.toggleSyncControl=(A,H)=>{let k=this.scene.getZincCameraControls();A?(k.resetView(),this.NDCCameraControl=k.enableSyncControl(),k.setRotationMode(H)):(k.disableSyncControl(),this.NDCCameraControl=void 0,k.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=A=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(A,2)},this.setSyncControlCallback=A=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(A)},this.setSyncControlCenterZoom=(A,H)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(A,H)};const u=function(){if(e.zincRenderer.playAnimation&&e.liveUpdatesObjects&&e.setupLiveCoordinates(e.liveUpdatesObjects),e.selectedCenter){const A=new Tl.THREE.Vector3;A.copy(e.selectedCenter);const H=e.scene.vectorToScreenXY(A);e.selectedScreenCoordinates.x=H.x,e.selectedScreenCoordinates.y=H.y}},d=function(){return function(){h()}},p=function(){return function(){u()}};this.addTimeChangedCallback=function(A){r.push(A)},this.setTexturePos=function(A){e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setSliderPos(A)},this.addSceneChangedCallback=function(A){o.push(A)},this.addOrganPartAddedCallback=function(A){a.push(A)},this.setFinishDownloadCallback=function(A){l=A},this.unsetFinishDownloadCallback=function(){l=void 0},this.getNamedObjectsToScreenCoordinates=function(A,H){const k=new Tl.THREE.Vector3;k.setFromMatrixPosition(obj.matrixWorld);const B=width/2,D=height/2;return k.project(H),k.x=k.x*B+B,k.y=-(k.y*D)+D,k};const f=function(A){let H,k;if(A!==void 0){let B=!1;A.object.userData&&A.object.userData.isMarker?(B=!0,k=A.object.userData.parent.morph):k=A.object;try{k.userData.userData.annotation.data.lastActionOnMarker=B}finally{}if(k)if(k.name)H=k.name;else{const D=e.getAnnotationsFromObjects([k]);D&&D[0]&&(H=D[0].data.group)}}return{id:H,object:k}},m=function(){return function(A,H,k){const B=e.getIntersectedObject(A),D=f(B),z={x:H,y:k};if(D.id){D.object.userData.isGlyph?D.object.name?e.setSelectedByObjects([D.object],z,!0):e.setSelectedByZincObjects(D.object.userData.getGlyphset(),z,!0):e.setSelectedByObjects([D.object],z,!0);return}else e.setSelectedByObjects([],z,!0)}},y=function(){return function(A,H,k){const B=e.getIntersectedObject(A),D=f(B),z={x:H,y:k};if(D.id){e.displayArea.style.cursor="pointer",e.setHighlightedByObjects([D.object],z,!0);return}else e.displayArea.style.cursor="auto",e.setHighlightedByObjects([],z,!0)}},v=function(A,H,k,B){if(B=="all"||B=="geometries"){const D=A.findGeometriesWithGroupName(H);for(let z=0;z<D.length;z++)D[z].setVisibility(k)}if(B=="all"||B=="glyphsets"){const D=A.findGlyphsetsWithGroupName(H);for(let z=0;z<D.length;z++)D[z].setVisibility(k)}if(B=="all"||B=="pointsets"){const D=A.findPointsetsWithGroupName(H);for(let z=0;z<D.length;z++)D[z].setVisibility(k)}if(B=="all"||B=="lines"){const D=A.findLinesWithGroupName(H);for(let z=0;z<D.length;z++)D[z].setVisibility(k)}};this.changeGeometriesVisibility=function(A,H){v(e.scene,A,H,"geometries")},this.changeGlyphsetsVisibility=function(A,H){v(e.scene,A,H,"glyphsets")},this.changeLinesVisibility=function(A,H){v(e.scene,A,H,"lines")},this.changePointsetsVisibility=function(A,H){v(e.scene,A,H,"pointsets")},this.changeOrganPartsVisibility=function(A,H,k){let B="all";k!==void 0&&(B=k),v(e.scene,A,H,B)},this.changeOrganPartsVisibilityCallback=function(A){return function(H){e.changeOrganPartsVisibility(A,H)}},this.changeBackgroundColour=function(A){const H=new Tl.THREE.Color(A);e.zincRenderer&&e.zincRenderer.getThreeJSRenderer().setClearColor(H,1)};const _=function(A,H,k,B){for(let q=0;q<a.length;q++)a[q](B,e.scene.isTimeVarying());k&&s.setGeometryColour(B,A,H);const D=new HMe,z=B.region.getFullPath();D.data={species:e.sceneData.currentSpecies,system:A,part:H,group:B.groupName,region:z,uuid:B.uuid,lastActionOnMarker:!1},B.userData.annotation=D},x=function(A,H,k){return function(B){_(A,H,k,B)}},L=function(){return function(){e.settingsChanged(),e.sceneData.timeVarying=e.scene.isTimeVarying(),l&&l()}};this.updateFieldvisibility=function(A,H){for(let k=0;k<A.length;k++)if(H!=k){const B=A[k].PartName;e.changeOrganPartsVisibility(B,!1)}if(H>-1){const k=A[H].PartName;if(e.scene.findGeometriesWithGroupName(k).length>0||e.scene.findGlyphsetsWithGroupName(k).length>0)e.changeOrganPartsVisibility(k,!0);else{const B=getOrganDetails(A[H].SystemName,k);B!=null&&e.scene.loadMetadataURL(s.getOrgansDirectoryPrefix()+"/"+B.meta)}}},this.getAvailableSpecies=function(A,H,k){const B=new Array;B.push("none");const D=Object.keys(organsFileMap);for(index in D){const z=D[index];z!=A&&organsFileMap[z].hasOwnProperty(H)&&organsFileMap[z][H].hasOwnProperty(k)&&B.push(z)}return B};const S=function(A,H,k,B){e.sceneData.nerveMapIsActive=!1,e.sceneData.nerveMap=void 0,e.sceneData.metaURL="",e.sceneData.viewURL="",e.sceneData.currentSpecies=A,e.sceneData.currentSystem=H,e.sceneData.currentPart=k,e.sceneData.currentTime=0,e.sceneData.timeVarying=!1,e.currentTime=0;let D="";A&&(D=A+"/"),H&&(D=H+"/"),k&&(D=k),e.sceneData.currentName=D};this.loadOrgansFromURL=function(A,H,k,B,D,z){if(e.zincRenderer&&B&&e.sceneData.metaURL!==A){S(H,k,B);const q=e.sceneData.currentName;let F=e.zincRenderer.getSceneByName(q);F?z&&F.clearAll():F=e.zincRenderer.createScene(q);for(let K=0;K<o.length;K++)o[K](e.sceneData);D&&D!=""?(e.sceneData.viewURL=D,F.loadViewURL(e.sceneData.viewURL)):e.sceneData.viewURL=void 0,e.sceneData.metaURL=A,F.loadMetadataURL(A,x(k,B,!1),L()),e.scene=F,e.zincRenderer.setCurrentScene(F),e.graphicsHighlight.reset();const Z=F.getZincCameraControls();Z.enableRaycaster(F,m(),y()),Z.setMouseButtonAction("AUXILIARY","ZOOM"),Z.setMouseButtonAction("SECONDARY","PAN")}},this.loadGLTFFromURL=function(A,H,k){if(e.zincRenderer&&H&&e.sceneData.metaURL!==A){S(void 0,void 0,H);const B=e.sceneData.currentName;let D=e.zincRenderer.getSceneByName(B);D?k&&D.clearAll():D=e.zincRenderer.createScene(B);for(let q=0;q<o.length;q++)o[q](e.sceneData);e.sceneData.viewURL=void 0,e.sceneData.metaURL=A,D.loadGLTF(A,x(void 0,H,!1),L()),e.scene=D,e.zincRenderer.setCurrentScene(D),e.graphicsHighlight.reset();const z=D.getZincCameraControls();z.enableRaycaster(D,m(),y()),z.setMouseButtonAction("AUXILIARY","ZOOM"),z.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(A){const H=e.graphicsHighlight.getSelected();H&&H[0]&&H[0].userData&&e.scene.alignObjectToCameraView(H[0].userData,A)},this.exportSettings=function(){const A={};return A.name=e.instanceName,e.sceneData.currentSystem&&(A.system=e.sceneData.currentSystem),e.sceneData.currentSpecies&&(A.species=e.sceneData.currentSpecies),e.sceneData.currentPart&&(A.part=e.sceneData.currentPart),A.metaURL=e.sceneData.metaURL,e.sceneData.viewURL&&(A.viewURL=e.sceneData.viewURL),A.dialog="Organ Viewer",A},this.importSettings=function(A){return A&&A.dialog==this.typeName?(e.setName(A.name),A.metaURL!==void 0&&A.metaURL!=""?e.loadOrgansFromURL(A.metaURL,A.species,A.system,A.part,A.viewURL,!0):e.loadOrgans(A.species,A.system,A.part),!0):!1},function(){e.initialiseRenderer(void 0),e.zincRenderer&&(e.zincRenderer.addPreRenderCallbackFunction(d()),e.zincRenderer.addPostRenderCallbackFunction(p()))}()};TU.prototype=Object.create(ii.prototype);const VMe={name:"ScaffoldVuer",components:{Button:ed,Col:_c,Loading:OE,Option:zg,Popover:ld,Row:u0,Select:Fg,Slider:d0,TabPane:ME,Tabs:wE,MapSvgIcon:jme,MapSvgSpriteColor:ege,PrimitiveControls:RE,ScaffoldTooltip:qR,TreeControls:FE,ElIconWarningFilled:CS,ElIconArrowDown:Ph,ElIconArrowLeft:cc},props:{url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},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},markerLabels:{type:Array,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}},data:function(){return{currentTime:0,timeVarying:void 0,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1}],inHelp:!1,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:[],viewingMode:"Exploration",viewingModes:["Annotation","Exploration"],openMapRef:void 0,backgroundIconRef:void 0}},watch:{format:{handler:function(t){this.fileFormat=t},immediate:!0},url:{handler:function(t){(this.state===void 0||this.state.url===void 0)&&this.setURL(t)},immediate:!0},region:{handler:function(t){this.state||this.viewURL||this.setFocusedRegion(t)},immediate:!0},state:{handler:function(t){this.setState(t)},immediate:!0,deep:!0},viewURL:{handler:function(t){this.updateViewURL(t)},immediate:!0},helpMode:function(t){this.setHelpMode(t)},displayMarkers:function(t){this.$module.scene.displayMarkers=t,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(t){this.$module.scene.displayMinimap=t},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(t){this.toggleRendering(t)},markerLabels:function(t){this.previousMarkerLabels.forEach(e=>{this.setMarkerModeForObjectsWithName(e,"off")}),t.forEach(e=>{this.setMarkerModeForObjectsWithName(e,"on")}),this.previousMarkerLabels=t}},beforeCreate:function(){this.$module=new TU,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new Qge},created:function(){this.timeVarying=c.toRef(this.$module.sceneData,"timeVarying")},mounted:function(){this.openMapRef=c.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=c.shallowRef(this.$refs.backgroundIconRef),this.$refs.treeControls.setModule(this.$module);let t=new MMe;t.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(t),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer),this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()})},beforeDestroy:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},methods:{addZincObject:function(t){this.$module.scene&&(this.$module.scene.addZincObject(t),this.zincObjectAdded(t),this.$refs.treeControls&&this.$refs.treeControls.zincObjectAdded(t))},zincObjectAdded:function(t){this.loading=!1,this.$_searchIndex.addZincObject(t,t.uuid),this.$emit("zinc-object-added",t)},addRegionsToSearchIndex:function(){this.$module.scene.getRootRegion().getChildRegions(!0).forEach(n=>{this.$_searchIndex.addRegion(n,n.uuid)})},backgroundChangeCallback:function(t){this.currentBackground=t,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let t=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=t,e.click(),e.remove()},captureScreenshot:function(t){this.captureFilename=t,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.treeControls&&this.$refs.treeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},formatTooltip(t){if(this.timeMax>=1e3&&t){let e=(t%6e4/1e3).toFixed(2)+"s";return(t>6e4?(t/6e4).toFixed(0)+"m ":"")+e}return t?t.toFixed(2)+" ms":"0 ms"},fitWindow:function(){this.$module.scene&&this.$module.scene.viewAll()},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(t){this.currentSpeed=t,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(t){let e=[];return t&&t!=""&&this.$module.scene&&(e=this.$module.scene.findObjectsWithGroupName(t)),e},viewRegion:function(t){const e=this.$module.scene.getRootRegion(),n=Array.isArray(t)?t:[t],r=T0(e,n,"",!0);let o=this.$module.scene.getBoundingBoxOfZincObjects(r);if(o){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(o);else{const a=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(o),this.$module.scene.camera.far=this.$module.scene.camera.near+a,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(t){t&&(this.isReady?this.viewRegion(t):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:t})))},updateViewURL:function(t){if(t)if(this.isReady){const e=new URL(t,this.url);this.$module.scene.loadViewURL(e)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:t}))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let t=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,t.enableAutoTumble(),t.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},eventNotifierCallback:function(t){const e=[];let n=[];if((t.eventType==1||t.eventType==2)&&(t.identifiers.forEach(r=>{if(r){let o=r.data.id?r.data.id:r.data.group;e.push(o)}}),n=t.zincObjects),t.eventType==1)this.$refs.treeControls&&(e.length>0?this.$refs.treeControls.updateActiveUI(n):(this.hideRegionTooltip(),this.$refs.treeControls.removeActive(!0))),this.viewingMode==="Annotation"&&this.showRegionTooltipWithAnnotations(t.identifiers,!0,!0),this.$emit("scaffold-selected",t.identifiers);else if(t.eventType==2){if(this.selectedObjects.length===0){if(this.hideRegionTooltip(),this.$refs.treeControls&&(e.length>0?this.$refs.treeControls.updateHoverUI(n):this.$refs.treeControls.removeHover(!0)),t.identifiers.length>0&&t.identifiers[0]){let r=t.identifiers[0].data.id?t.identifiers[0].data.id:t.identifiers[0].data.group;t.identifiers[0].coords&&(this.tData.active=!1,this.tData.visible=!0,this.tData.label=r,t.identifiers[0].data.region?this.tData.region=t.identifiers[0].data.region:this.tData.region=void 0,this.tData.x=t.identifiers[0].coords.x,this.tData.y=t.identifiers[0].coords.y)}this.$emit("scaffold-highlighted",t.identifiers)}}else if(t.eventType==3&&t.identifiers.length>0&&t.identifiers[0]&&t.identifiers[0].coords){const r=this.$refs.scaffoldContainer.getBoundingClientRect();this.tData.x=t.identifiers[0].coords.x-r.left,this.tData.y=t.identifiers[0].coords.y-r.top}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(t){let e=t/this.timeMax*100;e!=this.currentTime&&(this.$module.updateTime(e),console.log(this.currentTime))},objectSelected:function(t,e){this.selectedObjects=t,this.selectedObjects&&this.selectedObjects.length>0&&this.$refs.primitiveControls.setObject(this.selectedObjects[0]),this.$module.setSelectedByZincObjects(t,void 0,e)},objectHovered:function(t,e){this.hoveredObjects=t,this.$module.setHighlightedByZincObjects(t,void 0,e)},changeActiveByName:function(t,e,n){const r=Array.isArray(t);if(t===void 0||r&&t.length===0)this.$refs.treeControls.removeActive(n);else{let o=t;r||(o=[o]),this.$refs.treeControls.changeActiveByNames(o,e,n)}},changeHighlightedByName:function(t,e,n){const r=Array.isArray(t);if(t===void 0||r&&t.length===0)this.$refs.treeControls.removeHover(n);else{let o=t;r||(o=[o]),this.$refs.treeControls.changeHoverByNames(o,e,n)}},play:function(t){this.$module.playAnimation(t),this.isPlaying=t},setHelpMode:function(t){t?(this.inHelp=!0,this.hoverVisibilities.forEach(e=>{e.value=!0})):(this.inHelp=!1,this.hoverVisibilities.forEach(e=>{e.value=!1}))},displayTooltipOfObjectsCallback:function(t,e,n,r,o){const a=this;return function(){a.$module.zincRenderer.removePostRenderCallbackFunction(a.$_regionTooltipCallback),a.$_regionTooltipCallback=void 0,a.displayTooltipOfObjects(t,e,n,r,o)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(t,e,n,r,o){if(e.length>0){let a=e[0].getClosestVertexDOMElementCoords(this.$module.scene);if(a)return a.inView?(t.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=t,this.tData.x=a.position.x,this.tData.y=a.position.y,this.tData.region=n,this.$_liveCoordinatesUpdated&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),o&&(this.$module.setupLiveCoordinates(e),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),r&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(t,e,n,r,o)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(t,e,n,r,o){return t&&e&&e.length>0&&this.$module.scene?this.displayTooltipOfObjects(t,e,n,r,o):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(t,e,n){if(t&&this.$module.scene){const r=this.$module.scene.getRootRegion(),a=T0(r,[t],"",!0);let l;return a&&a.length>0&&(l=a[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(t,a,l,e,n)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(t,e,n){if(this.$module.scene){const r=DE(this.$module.scene,t);if(r&&r.objects.length>0)return this.showRegionTooltipWithObjects(r.label,r.objects,r.regionPath,e,n)}return this.hideRegionTooltip(),!1},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(t,e){if(t&&this.$module.scene){const n=this.$module.scene.getRootRegion();T0(n,[t],"",!0).forEach(a=>a.setMarkerMode(e))}},setMarkerModeWithAnnotations:function(t,e){if(this.$module.scene){const n=DE(this.$module.scene,t);n&&n.objects.length>0&&n.objects.forEach(r=>r.setMarkerMode(e))}},showHelpText:function(t){this.inHelp||(this.helpTextWait=setTimeout(()=>{this.hoverVisibilities[t].value=!0},500))},hideHelpText:function(t){this.inHelp||(this.hoverVisibilities[t].value=!1,clearTimeout(this.helpTextWait))},search:function(t,e){if(this.$_searchIndex){if(t===void 0||t===""||Array.isArray(t)&&t.length===0)return this.objectSelected([],!0),!1;{const n=this.$_searchIndex.searchAndProcessResult(t),r=n.zincObjects;if(r.length>0){if(this.objectSelected(r,!0),e)for(let o=0;o<r.length;o++)r[o]&&r[o].groupName&&this.showRegionTooltipWithObjects(n.label,r,n.regionPath,!0,!0);return!0}else this.objectSelected([],!0)}}return!1},fetchSuggestions:function(t){return this.$_searchIndex===void 0?[]:this.$_searchIndex.auto_suggest(t)},updateMinimapScissor:function(){Object.keys(this.minimapSettings).forEach(t=>{this.$module.scene.minimapScissor[t]=this.minimapSettings[t]}),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 t=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const e in t)this.timeStamps[t[e]]=e;this.timeMax=this.$module.scene.getDuration()},setURLFinishCallback:function(t){return()=>{if(t){if(t.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(t.viewport);else if(t.viewURL&&t.viewURL!==""){const e=new URL(t.viewURL,this.url);this.$module.scene.loadViewURL(e)}else t.region&&t.region!==""&&this.viewRegion(t.region);t.visibility&&this.$nextTick(()=>{this.$refs.treeControls.setState(t.visibility)})}this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.$emit("on-ready"),this.setMarkers(),this.isReady=!0}},getState:function(){let t={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0};if(this.$refs.treeControls&&(t.visibility=this.$refs.treeControls.getState()),this.$module.scene){let e=this.$module.scene.getZincCameraControls();t.viewport=e.getCurrentViewport()}return t},setState:function(t){t&&(t.url&&t.url!==this._currentURL?this.setURLAndState(t.url,{fileFormat:t.fileFormat,viewport:t.viewport,visibility:t.visibility}):(t.viewport||t.visibility)&&(this.isReady&&this.$module.scene?(t.viewport&&this.$module.scene.getZincCameraControls().setCurrentCameraSettings(t.viewport),t.visibility&&this.$refs.treeControls.setState(t.visibility)):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewport:t.viewport,visibility:t.visibility}))))},exportGLTF:function(t){return this.$module.scene.exportGLTF(t)},setURLAndState:function(t,e){if(t!=this._currentURL){e&&e.format&&(this.fileFormat=e.format);let n=e&&e.viewport?e.viewport:void 0,r=e&&e.visibility?e.visibility:void 0;this._currentURL=t,this.$refs.treeControls&&this.$refs.treeControls.clear(),this.loading=!0,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewport:n,region:this.region,viewURL:this.viewURL,visibility:r})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(t,"scene",!0):this.$module.loadOrgansFromURL(t,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(t){this.setURLAndState(t,void 0)},drawerToggled:function(t){this.drawerOpen=t,this.adjustLayout()},adjustLayout:function(){let t=this.$refs.scaffoldContainer.clientWidth;this.minimisedSlider=t<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""},toggleRendering:function(t){this.$module.zincRenderer&&(t?this.$module.zincRenderer.animate():this.$module.zincRenderer.stopAnimate())},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const t=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",t)},toggleSyncControl:function(t,e){this.$module.toggleSyncControl(t,e),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){this.markerLabels.forEach(t=>{this.setMarkerModeForObjectsWithName(t,"on")})}}},cw=t=>(c.pushScopeId("data-v-09fa62a2"),t=t(),c.popScopeId(),t),OMe={ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},kMe=cw(()=>c.createElementVNode("span",{class:"message-text"},"Beta",-1)),PMe=cw(()=>c.createElementVNode("span",{class:"message-text"},"What's new?",-1)),IMe={class:"primitive-controls-box"},RMe={class:"animation-data"},NMe={class:"purple"},BMe={class:"animation-data"},DMe={class:"purple"},FMe={class:"animation-data"},zMe={class:"bottom-right-control"},UMe=cw(()=>c.createElementVNode("div",null,[c.createTextVNode(" Fit to "),c.createElementVNode("br"),c.createTextVNode(" window ")],-1)),jMe=["onClick"];function GMe(t,e,n,r,o,a){const l=c.resolveComponent("map-svg-sprite-color"),s=qR,h=CS,u=zr,d=ld,p=FE,f=RE,m=c.resolveComponent("map-svg-icon"),y=d0,v=u0,_=ME,x=zg,L=Fg,S=wE,C=ed,A=_c,H=Td;return c.withDirectives((c.openBlock(),c.createElementBlock("div",OMe,[c.createVNode(l),c.createVNode(s,{label:t.tData.label,region:t.tData.region,visible:t.tData.visible,x:t.tData.x,y:t.tData.y,annotationDisplay:t.viewingMode==="Annotation"&&t.tData.active===!0},null,8,["label","region","visible","x","y","annotationDisplay"]),c.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:e[0]||(e[0]=c.withKeys((...k)=>a.backgroundChangeCallback&&a.backgroundChangeCallback(...k),["66"]))},null,544),c.withDirectives(c.createElementVNode("div",null,[n.displayWarning?(c.openBlock(),c.createBlock(d,{key:0,ref:"warningPopover",visible:t.hoverVisibilities[6].value,content:n.warningMessage,placement:"right",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:c.withCtx(()=>[n.displayWarning?(c.openBlock(),c.createElementBlock("div",{key:0,class:"message-icon warning-icon",onMouseover:e[1]||(e[1]=k=>a.showHelpText(6)),onMouseout:e[2]||(e[2]=k=>a.hideHelpText(6))},[c.createVNode(u,null,{default:c.withCtx(()=>[c.createVNode(h)]),_:1}),kMe],32)):c.createCommentVNode("",!0)]),_:1},8,["visible","content"])):c.createCommentVNode("",!0),n.displayLatestChanges?(c.openBlock(),c.createBlock(d,{key:1,visible:t.hoverVisibilities[7].value,content:n.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:c.withCtx(()=>[n.displayLatestChanges&&n.latestChangesMessage?(c.openBlock(),c.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon",onMouseover:e[3]||(e[3]=k=>a.showHelpText(7)),onMouseout:e[4]||(e[4]=k=>a.hideHelpText(7))},[c.createVNode(u,null,{default:c.withCtx(()=>[c.createVNode(h)]),_:1}),PMe],32)):c.createCommentVNode("",!0)]),_:1},8,["visible","content"])):c.createCommentVNode("",!0),c.createVNode(d,{visible:t.hoverVisibilities[5].value,content:"Change region visibility",placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable"},{reference:c.withCtx(()=>[c.createVNode(p,{ref:"treeControls","help-mode":n.helpMode,isReady:t.isReady,"show-colour-picker":n.showColourPicker,onObjectSelected:a.objectSelected,onObjectHovered:a.objectHovered,onDrawerToggled:a.drawerToggled},null,8,["help-mode","isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),c.createElementVNode("div",IMe,[c.createVNode(f,{ref:"primitiveControls"},null,512)]),t.timeVarying?(c.openBlock(),c.createBlock(d,{key:2,ref:"sliderPopover",visible:t.hoverVisibilities[4].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:c.withCtx(()=>[t.timeVarying?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["time-slider-container",[t.minimisedSlider?"minimised":"",t.sliderPosition]])},[c.createVNode(S,{type:"card"},{default:c.withCtx(()=>[c.createVNode(_,{label:"Animate scaffold"},{default:c.withCtx(()=>[c.createVNode(v,{class:"tab-content"},{default:c.withCtx(()=>[t.isPlaying?(c.openBlock(),c.createBlock(m,{key:0,icon:"pause",class:"icon-button video-button",onClick:e[5]||(e[5]=k=>a.play(!1))})):(c.openBlock(),c.createBlock(m,{key:1,icon:"play",class:"video-button icon-button",onClick:e[6]||(e[6]=k=>a.play(!0))})),c.createVNode(y,{min:0,max:t.timeMax,"model-value":t.currentTime/100*t.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":a.formatTooltip,marks:t.timeStamps,onInput:e[7]||(e[7]=k=>a.timeChange(k))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),c.createVNode(_,{label:"Animation data"},{default:c.withCtx(()=>[c.createVNode(v,{class:"tab-content"},{default:c.withCtx(()=>[c.createElementVNode("div",RMe,[c.createTextVNode(" Original duration: "),c.createElementVNode("div",NMe,c.toDisplayString(t.orginalDuration),1)]),c.createElementVNode("div",BMe,[c.createTextVNode(" Animation duration: "),c.createElementVNode("div",DMe,c.toDisplayString(t.animateDuration),1)]),c.createElementVNode("div",FMe,[c.createTextVNode(" Playback speed "),c.createVNode(L,{teleported:!0,"model-value":t.currentSpeed,placeholder:"Select",class:"select-box","popper-class":"scaffold_viewer_dropdown",onChange:e[8]||(e[8]=k=>a.speedChanged(k))},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(t.playSpeed,k=>(c.openBlock(),c.createBlock(x,{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):c.createCommentVNode("",!0)]),_:1},8,["visible"])):c.createCommentVNode("",!0),c.createElementVNode("div",zMe,[c.createVNode(d,{visible:t.hoverVisibilities[0].value,content:"Zoom in",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable"},{reference:c.withCtx(()=>[c.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[9]||(e[9]=k=>a.zoomIn()),onMouseover:e[10]||(e[10]=k=>a.showHelpText(0)),onMouseout:e[11]||(e[11]=k=>a.hideHelpText(0))})]),_:1},8,["visible"]),c.createVNode(d,{visible:t.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable"},{reference:c.withCtx(()=>[c.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[12]||(e[12]=k=>a.zoomOut()),onMouseover:e[13]||(e[13]=k=>a.showHelpText(1)),onMouseout:e[14]||(e[14]=k=>a.hideHelpText(1))})]),_:1},8,["visible"]),c.createVNode(d,{visible:t.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper non-selectable"},{reference:c.withCtx(()=>[c.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[15]||(e[15]=k=>a.fitWindow()),onMouseover:e[16]||(e[16]=k=>a.showHelpText(2)),onMouseout:e[17]||(e[17]=k=>a.hideHelpText(2))})]),default:c.withCtx(()=>[UMe]),_:1},8,["visible"])]),t.openMapRef?(c.openBlock(),c.createBlock(d,{key:3,ref:"open-map-popover","virtual-ref":t.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.openMapOptions,k=>(c.openBlock(),c.createBlock(v,{key:k.key},{default:c.withCtx(()=>[c.createVNode(C,{type:"primary",plain:"",onClick:B=>t.$emit("open-map",k.key)},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(k.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):c.createCommentVNode("",!0),c.createVNode(d,{ref:"backgroundPopover","virtual-ref":t.backgroundIconRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable","virtual-triggering":""},{default:c.withCtx(()=>[c.createElementVNode("div",null,[c.createVNode(v,{class:"backgroundText"},{default:c.withCtx(()=>[c.createTextVNode("Viewing Mode")]),_:1}),c.createVNode(v,{class:"backgroundControl"},{default:c.withCtx(()=>[c.createVNode(L,{teleported:!1,modelValue:t.viewingMode,"onUpdate:modelValue":e[18]||(e[18]=k=>t.viewingMode=k),placeholder:"Select",class:"select-box viewing-mode","popper-class":"scaffold_viewer_dropdown"},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(t.viewingModes,k=>(c.openBlock(),c.createBlock(x,{key:k,label:k,value:k},{default:c.withCtx(()=>[c.createVNode(v,null,{default:c.withCtx(()=>[c.createVNode(A,{span:12},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(k),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),c.createVNode(v,{class:"backgroundSpacer"}),c.createVNode(v,{class:"backgroundText"},{default:c.withCtx(()=>[c.createTextVNode(" Change background ")]),_:1}),c.createVNode(v,{class:"backgroundChooser"},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(t.availableBackground,k=>(c.openBlock(),c.createElementBlock("div",{key:k,class:c.normalizeClass(["backgroundChoice",k,k==t.currentBackground?"active":""]),onClick:B=>a.backgroundChangeCallback(k)},null,10,jMe))),128))]),_:1})])]),_:1},8,["virtual-ref"]),c.createElementVNode("div",{class:c.normalizeClass(["settings-group",{open:t.drawerOpen,close:!t.drawerOpen}])},[c.createVNode(v,null,{default:c.withCtx(()=>[c.createVNode(d,{visible:t.hoverVisibilities[8].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable"},{reference:c.withCtx(()=>[n.enableOpenMapUI&&n.openMapOptions.length>0?(c.openBlock(),c.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[19]||(e[19]=k=>a.showHelpText(8)),onMouseout:e[20]||(e[20]=k=>a.hideHelpText(8))},null,512)):c.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),c.createVNode(v,null,{default:c.withCtx(()=>[c.createVNode(d,{visible:t.hoverVisibilities[3].value,content:"Change background color",placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable"},{reference:c.withCtx(()=>[c.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[21]||(e[21]=k=>a.showHelpText(3)),onMouseout:e[22]||(e[22]=k=>a.hideHelpText(3))},null,512)]),_:1},8,["visible"])]),_:1})],2)],512),[[c.vShow,n.displayUI&&!t.isTransitioning]])])),[[H,t.loading]])}const WMe=f0(VMe,[["render",GMe],["__scopeId","data-v-09fa62a2"]]);$r.ScaffoldVuer=WMe,Object.defineProperty($r,Symbol.toStringTag,{value:"Module"})});
|
|
4600
|
+
`),A="",H="",k=0,B=[],D=typeof"".trimLeft=="function",z=0,q=C.length;z<q;z++)if(A=C[z],A=D?A.trimLeft():A.trim(),k=A.length,k!==0&&(H=A.charAt(0),H!=="#"))if(H==="v"){var F=A.split(/\s+/);switch(F[0]){case"v":S.vertices.push(parseFloat(F[1]),parseFloat(F[2]),parseFloat(F[3])),7<=F.length?S.colors.push(parseFloat(F[4]),parseFloat(F[5]),parseFloat(F[6])):S.colors.push(void 0,void 0,void 0);break;case"vn":S.normals.push(parseFloat(F[1]),parseFloat(F[2]),parseFloat(F[3]));break;case"vt":S.uvs.push(parseFloat(F[1]),parseFloat(F[2]))}}else if(H==="f"){for(var Z,K=A.substr(1).trim(),X=K.split(/\s+/),te=[],J=0,he=X.length;J<he;J++)if(Z=X[J],0<Z.length){var xe=Z.split("/");te.push(xe)}for(var ee=te[0],oe=1,de=te.length-1;oe<de;oe++){var fe=te[oe],Ae=te[oe+1];S.addFace(ee[0],fe[0],Ae[0],ee[1],fe[1],Ae[1],ee[2],fe[2],Ae[2])}}else if(H==="l"){var Se=A.substring(1).trim().split(" "),Qe=[],Le=[];if(A.indexOf("/")===-1)Qe=Se;else for(var Ce,je=0,me=Se.length;je<me;je++)Ce=Se[je].split("/"),Ce[0]!==""&&Qe.push(Ce[0]),Ce[1]!==""&&Le.push(Ce[1]);S.addLineGeometry(Qe,Le)}else if(H==="p"){var Ne=A.substr(1).trim(),Ie=Ne.split(" ");S.addPointGeometry(Ie)}else if((B=l.exec(A))!==null){var Ke=(" "+B[0].substr(1).trim()).substr(1);S.startObject(Ke)}else if(h.test(A))S.object.startMaterial(A.substring(7).trim(),S.materialLibraries);else if(s.test(A))S.materialLibraries.push(A.substring(7).trim());else if(u.test(A))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(H==="s"){if(B=A.split(" "),1<B.length){var Ye=B[1].trim().toLowerCase();S.object.smooth=Ye!=="0"&&Ye!=="off"}else S.object.smooth=!0;var ht=S.object.currentMaterial();ht&&(ht.smooth=S.object.smooth)}else{if(A==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+A+'"')}S.finalize();var dt=new a.Group;dt.materialLibraries=[].concat(S.materialLibraries);var Ee=S.objects.length!==1||S.objects[0].geometry.vertices.length!==0;if(Ee==!0)for(var ye=0,it=S.objects.length;ye<it;ye++){var Ve=S.objects[ye],yt=Ve.geometry,bt=Ve.materials,_t=yt.type==="Line",nt=yt.type==="Points",Je=!1;if(yt.vertices.length!==0){var et=new a.BufferGeometry;et.setAttribute("position",new a.Float32BufferAttribute(yt.vertices,3)),0<yt.normals.length&&et.setAttribute("normal",new a.Float32BufferAttribute(yt.normals,3)),0<yt.colors.length&&(Je=!0,et.setAttribute("color",new a.Float32BufferAttribute(yt.colors,3))),yt.hasUVIndices===!0&&et.setAttribute("uv",new a.Float32BufferAttribute(yt.uvs,2));for(var Xe=[],Lt=0,vt=bt.length;Lt<vt;Lt++){var Et=bt[Lt],kt=Et.name+"_"+Et.smooth+"_"+Je,pt=S.materials[kt];if(this.materials!==null){if(pt=this.materials.create(Et.name),_t&&pt&&!(pt instanceof a.LineBasicMaterial)){var Qn=new a.LineBasicMaterial;a.Material.prototype.copy.call(Qn,pt),Qn.color.copy(pt.color),pt=Qn}else if(nt&&pt&&!(pt instanceof a.PointsMaterial)){var Jt=new a.PointsMaterial({size:10,sizeAttenuation:!1});a.Material.prototype.copy.call(Jt,pt),Jt.color.copy(pt.color),Jt.map=pt.map,pt=Jt}}pt===void 0&&(pt=_t?new a.LineBasicMaterial:nt?new a.PointsMaterial({size:1,sizeAttenuation:!1}):new a.MeshPhongMaterial,pt.name=Et.name,pt.flatShading=!Et.smooth,pt.vertexColors=Je,S.materials[kt]=pt),Xe.push(pt)}var Mn=void 0;if(1<Xe.length){for(var ln,Mt=0,ze=bt.length;Mt<ze;Mt++)ln=bt[Mt],et.addGroup(ln.groupStart,ln.groupCount,Mt);Mn=_t?new a.LineSegments(et,Xe):nt?new a.Points(et,Xe):new a.Mesh(et,Xe)}else Mn=_t?new a.LineSegments(et,Xe[0]):nt?new a.Points(et,Xe[0]):new a.Mesh(et,Xe[0]);Mn.name=Ve.name,dt.add(Mn)}}else if(0<S.vertices.length){var mt=new a.PointsMaterial({size:1,sizeAttenuation:!1}),Ht=new a.BufferGeometry;Ht.setAttribute("position",new a.Float32BufferAttribute(S.vertices,3)),0<S.colors.length&&S.colors[0]!==void 0&&(Ht.setAttribute("color",new a.Float32BufferAttribute(S.colors,3)),mt.vertexColors=!0);var pn=new a.Points(Ht,mt);dt.add(pn)}return dt}}},function(n,r,o){var a=o(14).JSONLoader;r.PrimitivesLoader=function(){var l=0;this.crossOrigin="Anonymous";var s=new a,h=[];this.load=(d,p,f,m)=>{if(20>l){++l,s.crossOrigin=this.crossOrigin;var y=new u(p,this),v=new u(m,this);s.load(d,y,f,v)}else h.push({url:d,onLoad:p,onProgress:f,onError:m})},this.loadFromWaitingList=()=>{var d=h.shift();d&&this.load(d.url,d.onLoad,d.onProgress,d.onError)};var u=function(d,p){return function(){--l,d(...arguments),p.loadFromWaitingList()}};this.parse=d=>s.parse(d)}},function(n,r,o){o(3);var a=o(36).GLTFLoader,l=function(){var s=this;this.parseGLTFObjects=(h,u,d,p)=>{var f=u;if(d!==0){if(h.type!=="Object3D"){var m;if(h.type==="Mesh"?m=new(o(2)).Geometry:h.type==="LineSegments"?m=new(o(20)).Lines:h.type==="Points"&&(m=new(o(17)).Pointset),m){var y=!1,v=!1;h.geometry&&h.geometry.morphAttributes&&(y=!!h.geometry.morphAttributes.position,v=!!h.geometry.morphAttributes.color),m.setMesh(h.clone(),y,v),u.addZincObject(m),m.groupName=m.morph.name,m.morph.matrixAutoUpdate=!0,p!=null&&typeof p=="function"&&p(m)}}else if(h.name!==""&&(u&&(f=u.findOrCreateChildFromPath(h.name)),f)){var _=f.getGroup();_.position.copy(h.position),_.rotation.copy(h.rotation),_.quaternion.copy(h.quaternion),_.matrixAutoUpdate=!0}}d++,h.children.forEach(x=>{s.parseGLTFObjects(x,f,d,p)})},this.setCamera=h=>{h.viewAll();var u=h.getZincCameraControls(),d=u.getCurrentViewport();u.addViewport("default",d),u.setDefaultViewport("default")},this.load=(h,u,d,p,f)=>{var m=d.substring(0,d.lastIndexOf("/")+1),y=d.substring(d.lastIndexOf("/")+1,d.length),v=new a().setPath(m);v.load(y,function(_){console.log(_),s.parseGLTFObjects(_.scene,u,0,p),s.setCamera(h),f!=null&&typeof f=="function"&&f()})}};r.GLTFToZincJSLoader=l},function(n,r){n.exports=fMe},function(n,r,o){var a=o(38).GLTFExporter,l=function(s){var h=s;this.exportGLTF=u=>{var d=h.getRootRegion(),p=d.getAllObjects(!0),f=[];p.forEach(v=>{v.animationClip&&f.push({clip:v.animationClip[0],mesh:v.morph})});var m=new a,y={binary:u,animations:f};return new Promise(v=>{m.parse(h.getThreeJSScene(),function(_){v(_)},y)})}};r.SceneExporter=l},function(n,r,o){o.r(r),o.d(r,"GLTFExporter",function(){return l});var a=o(3);class l{constructor(){this.pluginCallbacks=[],this.register(function(F){return new B(F)}),this.register(function(F){return new D(F)}),this.register(function(F){return new z(F)})}register(F){return this.pluginCallbacks.indexOf(F)===-1&&this.pluginCallbacks.push(F),this}unregister(F){return this.pluginCallbacks.indexOf(F)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(F),1),this}parse(F,Z,K){for(var X=new k,te=[],J=0,he=this.pluginCallbacks.length;J<he;J++)te.push(this.pluginCallbacks[J](X));X.setPlugins(te),X.write(F,Z,K)}}var s={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},h={};h[a.NearestFilter]=s.NEAREST,h[a.NearestMipmapNearestFilter]=s.NEAREST_MIPMAP_NEAREST,h[a.NearestMipmapLinearFilter]=s.NEAREST_MIPMAP_LINEAR,h[a.LinearFilter]=s.LINEAR,h[a.LinearMipmapNearestFilter]=s.LINEAR_MIPMAP_NEAREST,h[a.LinearMipmapLinearFilter]=s.LINEAR_MIPMAP_LINEAR,h[a.ClampToEdgeWrapping]=s.CLAMP_TO_EDGE,h[a.RepeatWrapping]=s.REPEAT,h[a.MirroredRepeatWrapping]=s.MIRRORED_REPEAT;var u={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},d=12,p=1179937895,f=2,m=8,y=1313821514,v=5130562;function _(q,F){return q.length===F.length&&q.every(function(Z,K){return Z===F[K]})}function x(q){if(window.TextEncoder!==void 0)return new TextEncoder().encode(q).buffer;for(var F,Z=new Uint8Array(new ArrayBuffer(q.length)),K=0,X=q.length;K<X;K++)F=q.charCodeAt(K),Z[K]=255<F?32:F;return Z.buffer}function L(q){return _(q.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function S(q,F,Z){for(var K={min:Array(q.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(q.itemSize).fill(Number.NEGATIVE_INFINITY)},X=F;X<F+Z;X++)for(var te,J=0;J<q.itemSize;J++)te=void 0,4<q.itemSize?te=q.array[X*q.itemSize+J]:J===0?te=q.getX(X):J===1?te=q.getY(X):J===2?te=q.getZ(X):J==3&&(te=q.getW(X)),K.min[J]=Math.min(K.min[J],te),K.max[J]=Math.max(K.max[J],te);return K}function C(q){return 4*Math.ceil(q/4)}function A(q){var F=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,Z=C(q.byteLength);if(Z!==q.byteLength){var K=new Uint8Array(Z);if(K.set(new Uint8Array(q)),F!==0)for(var X=q.byteLength;X<Z;X++)K[X]=F;return K.buffer}return q}var H=null;class k{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(F){this.plugins=F}write(F,Z,K){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},K),0<this.options.animations.length&&(this.options.trs=!0),this.processInput(F);var X=this;Promise.all(this.pending).then(function(){var te=X.buffers,J=X.json,he=X.options,xe=X.extensionsUsed,ee=new Blob(te,{type:"application/octet-stream"}),oe=Object.keys(xe);if(0<oe.length&&(J.extensionsUsed=oe),J.buffers&&0<J.buffers.length&&(J.buffers[0].byteLength=ee.size),he.binary===!0){var de=new window.FileReader;de.readAsArrayBuffer(ee),de.onloadend=function(){var Ae=A(de.result),Se=new DataView(new ArrayBuffer(m));Se.setUint32(0,Ae.byteLength,!0),Se.setUint32(4,v,!0);var Qe=A(x(JSON.stringify(J)),32),Le=new DataView(new ArrayBuffer(m));Le.setUint32(0,Qe.byteLength,!0),Le.setUint32(4,y,!0);var Ce=new ArrayBuffer(d),je=new DataView(Ce);je.setUint32(0,p,!0),je.setUint32(4,f,!0);var me=d+Le.byteLength+Qe.byteLength+Se.byteLength+Ae.byteLength;je.setUint32(8,me,!0);var Ne=new Blob([Ce,Le,Qe,Se,Ae],{type:"application/octet-stream"}),Ie=new window.FileReader;Ie.readAsArrayBuffer(Ne),Ie.onloadend=function(){Z(Ie.result)}}}else if(J.buffers&&0<J.buffers.length){var fe=new window.FileReader;fe.readAsDataURL(ee),fe.onloadend=function(){var Ae=fe.result;J.buffers[0].uri=Ae,Z(J)}}else Z(J)})}serializeUserData(F,Z){if(!(F.userData&&F.userData.isZincObject)&&Object.keys(F.userData).length!==0){var K=this.options,X=this.extensionsUsed;try{var te=JSON.parse(JSON.stringify(F.userData));if(K.includeCustomExtensions&&te.gltfExtensions){for(var J in Z.extensions===void 0&&(Z.extensions={}),te.gltfExtensions)Z.extensions[J]=te.gltfExtensions[J],X[J]=!0;delete te.gltfExtensions}0<Object.keys(te).length&&(Z.extras=te)}catch(he){console.warn("THREE.GLTFExporter: userData of '"+F.name+"' won't be serialized because of JSON.stringify error - "+he.message)}}}getUID(F){return this.uids.has(F)||this.uids.set(F,this.uid++),this.uids.get(F)}isNormalizedNormalAttribute(F){var Z=this.cache;if(Z.attributesNormalized.has(F))return!1;for(var K=new a.Vector3,X=0,te=F.count;X<te;X++)if(5e-4<Math.abs(K.fromBufferAttribute(F,X).length()-1))return!1;return!0}createNormalizedNormalAttribute(F){var Z=this.cache;if(Z.attributesNormalized.has(F))return Z.attributesNormalized.get(F);for(var K=F.clone(),X=new a.Vector3,te=0,J=K.count;te<J;te++)X.fromBufferAttribute(K,te),X.x===0&&X.y===0&&X.z===0?X.setX(1):X.normalize(),K.setXYZ(te,X.x,X.y,X.z);return Z.attributesNormalized.set(F,K),K}applyTextureTransform(F,Z){var K=!1,X={};(Z.offset.x!==0||Z.offset.y!==0)&&(X.offset=Z.offset.toArray(),K=!0),Z.rotation!==0&&(X.rotation=Z.rotation,K=!0),(Z.repeat.x!==1||Z.repeat.y!==1)&&(X.scale=Z.repeat.toArray(),K=!0),K&&(F.extensions=F.extensions||{},F.extensions.KHR_texture_transform=X,this.extensionsUsed.KHR_texture_transform=!0)}processBuffer(F){var Z=this.json,K=this.buffers;return Z.buffers||(Z.buffers=[{byteLength:0}]),K.push(F),0}processBufferView(F,Z,K,X,te){var J=this.json;J.bufferViews||(J.bufferViews=[]);for(var he=Z===s.UNSIGNED_BYTE?1:Z===s.UNSIGNED_SHORT?2:4,xe=C(X*F.itemSize*he),ee=new DataView(new ArrayBuffer(xe)),oe=0,de=K;de<K+X;de++)for(var fe,Ae=0;Ae<F.itemSize;Ae++)fe=void 0,4<F.itemSize?fe=F.array[de*F.itemSize+Ae]:Ae===0?fe=F.getX(de):Ae===1?fe=F.getY(de):Ae===2?fe=F.getZ(de):Ae==3&&(fe=F.getW(de)),Z===s.FLOAT?ee.setFloat32(oe,fe,!0):Z===s.UNSIGNED_INT?ee.setUint32(oe,fe,!0):Z===s.UNSIGNED_SHORT?ee.setUint16(oe,fe,!0):Z===s.UNSIGNED_BYTE&&ee.setUint8(oe,fe),oe+=he;var Se={buffer:this.processBuffer(ee.buffer),byteOffset:this.byteOffset,byteLength:xe};te!==void 0&&(Se.target=te),te===s.ARRAY_BUFFER&&(Se.byteStride=F.itemSize*he),this.byteOffset+=xe,J.bufferViews.push(Se);var Qe={id:J.bufferViews.length-1,byteLength:0};return Qe}processBufferViewImage(F){var Z=this,K=Z.json;return K.bufferViews||(K.bufferViews=[]),new Promise(function(X){var te=new window.FileReader;te.readAsArrayBuffer(F),te.onloadend=function(){var J=A(te.result),he={buffer:Z.processBuffer(J),byteOffset:Z.byteOffset,byteLength:J.byteLength};Z.byteOffset+=J.byteLength,X(K.bufferViews.push(he)-1)}})}processAccessor(F,Z,K,X){var te,J=this.options,he=this.json;if(F.array.constructor===Float32Array)te=s.FLOAT;else if(F.array.constructor===Uint32Array)te=s.UNSIGNED_INT;else if(F.array.constructor===Uint16Array)te=s.UNSIGNED_SHORT;else if(F.array.constructor===Uint8Array)te=s.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(K===void 0&&(K=0),X===void 0&&(X=F.count),J.truncateDrawRange&&Z!==void 0&&Z.index===null){var xe=K+X,ee=Z.drawRange.count===1/0?F.count:Z.drawRange.start+Z.drawRange.count;K=Math.max(K,Z.drawRange.start),X=Math.min(xe,ee)-K,0>X&&(X=0)}if(X===0)return null;var oe,de=S(F,K,X);Z!==void 0&&(oe=F===Z.index?s.ELEMENT_ARRAY_BUFFER:s.ARRAY_BUFFER);var fe=this.processBufferView(F,te,K,X,oe),Ae={bufferView:fe.id,byteOffset:fe.byteOffset,componentType:te,count:X,max:de.max,min:de.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[F.itemSize]};return F.normalized===!0&&(Ae.normalized=!0),he.accessors||(he.accessors=[]),he.accessors.push(Ae)-1}processImage(F,Z,K){var X=this,te=X.cache,J=X.json,he=X.options,xe=X.pending;te.images.has(F)||te.images.set(F,{});var ee=te.images.get(F),oe=Z===a.RGBAFormat?"image/png":"image/jpeg",de=oe+":flipY/"+K.toString();if(ee[de]!==void 0)return ee[de];J.images||(J.images=[]);var fe={mimeType:oe};if(he.embedImages){var Ae=H=H||document.createElement("canvas");Ae.width=Math.min(F.width,he.maxTextureSize),Ae.height=Math.min(F.height,he.maxTextureSize);var Se=Ae.getContext("2d");if(K===!0&&(Se.translate(0,Ae.height),Se.scale(1,-1)),typeof HTMLImageElement<"u"&&F instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&F instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&F instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&F instanceof ImageBitmap)Se.drawImage(F,0,0,Ae.width,Ae.height);else{Z!==a.RGBAFormat&&Z!==a.RGBFormat&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(F.width>he.maxTextureSize||F.height>he.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",F);var Qe=new Uint8ClampedArray(4*(F.height*F.width));if(Z===a.RGBAFormat)for(var Le=0;Le<Qe.length;Le+=4)Qe[Le+0]=F.data[Le+0],Qe[Le+1]=F.data[Le+1],Qe[Le+2]=F.data[Le+2],Qe[Le+3]=F.data[Le+3];else for(var Ce=0,je=0;Ce<Qe.length;Ce+=4,je+=3)Qe[Ce+0]=F.data[je+0],Qe[Ce+1]=F.data[je+1],Qe[Ce+2]=F.data[je+2],Qe[Ce+3]=255;Se.putImageData(new ImageData(Qe,F.width,F.height),0,0)}he.binary===!0?xe.push(new Promise(function(Ne){Ae.toBlob(function(Ie){X.processBufferViewImage(Ie).then(function(Ke){fe.bufferView=Ke,Ne()})},oe)})):fe.uri=Ae.toDataURL(oe)}else fe.uri=F.src;var me=J.images.push(fe)-1;return ee[de]=me,me}processSampler(F){var Z=this.json;Z.samplers||(Z.samplers=[]);var K={magFilter:h[F.magFilter],minFilter:h[F.minFilter],wrapS:h[F.wrapS],wrapT:h[F.wrapT]};return Z.samplers.push(K)-1}processTexture(F){var Z=this.cache,K=this.json;if(Z.textures.has(F))return Z.textures.get(F);K.textures||(K.textures=[]);var X={sampler:this.processSampler(F),source:this.processImage(F.image,F.format,F.flipY)};F.name&&(X.name=F.name),this._invokeAll(function(J){J.writeTexture&&J.writeTexture(F,X)});var te=K.textures.push(X)-1;return Z.textures.set(F,te),te}processMaterial(F){var Z=this.cache,K=this.json;if(Z.materials.has(F))return Z.materials.get(F);if(F.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;K.materials||(K.materials=[]);var X={pbrMetallicRoughness:{}};F.isMeshStandardMaterial!==!0&&F.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");var te=F.color.toArray().concat([F.opacity]);if(_(te,[1,1,1,1])||(X.pbrMetallicRoughness.baseColorFactor=te),F.isMeshStandardMaterial?(X.pbrMetallicRoughness.metallicFactor=F.metalness,X.pbrMetallicRoughness.roughnessFactor=F.roughness):(X.pbrMetallicRoughness.metallicFactor=.5,X.pbrMetallicRoughness.roughnessFactor=.5),F.metalnessMap||F.roughnessMap)if(F.metalnessMap===F.roughnessMap){var J={index:this.processTexture(F.metalnessMap)};this.applyTextureTransform(J,F.metalnessMap),X.pbrMetallicRoughness.metallicRoughnessTexture=J}else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.");if(F.map){var he={index:this.processTexture(F.map)};this.applyTextureTransform(he,F.map),X.pbrMetallicRoughness.baseColorTexture=he}if(F.emissive){var xe=F.emissive.clone().multiplyScalar(F.emissiveIntensity),ee=Math.max(xe.r,xe.g,xe.b);if(1<ee&&(xe.multiplyScalar(1/ee),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),0<ee&&(X.emissiveFactor=xe.toArray()),F.emissiveMap){var oe={index:this.processTexture(F.emissiveMap)};this.applyTextureTransform(oe,F.emissiveMap),X.emissiveTexture=oe}}if(F.normalMap){var de={index:this.processTexture(F.normalMap)};F.normalScale&&F.normalScale.x!==-1&&(F.normalScale.x!==F.normalScale.y&&console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."),de.scale=F.normalScale.x),this.applyTextureTransform(de,F.normalMap),X.normalTexture=de}if(F.aoMap){var fe={index:this.processTexture(F.aoMap),texCoord:1};F.aoMapIntensity!==1&&(fe.strength=F.aoMapIntensity),this.applyTextureTransform(fe,F.aoMap),X.occlusionTexture=fe}F.transparent?X.alphaMode="BLEND":0<F.alphaTest&&(X.alphaMode="MASK",X.alphaCutoff=F.alphaTest),F.side===a.DoubleSide&&(X.doubleSided=!0),F.name!==""&&(X.name=F.name),this.serializeUserData(F,X),this._invokeAll(function(Se){Se.writeMaterial&&Se.writeMaterial(F,X)});var Ae=K.materials.push(X)-1;return Z.materials.set(F,Ae),Ae}processMesh(F){var Z=this.cache,K=this.json,X=[F.geometry.uuid];if(Array.isArray(F.material))for(var te=0,J=F.material.length;te<J;te++)X.push(F.material[te].uuid);else X.push(F.material.uuid);var he=X.join(":");if(Z.meshes.has(he))return Z.meshes.get(he);var xe,ee=F.geometry;if(xe=F.isLineSegments?s.LINES:F.isLineLoop?s.LINE_LOOP:F.isLine?s.LINE_STRIP:F.isPoints?s.POINTS:F.material.wireframe?s.LINES:s.TRIANGLES,ee.isBufferGeometry!==!0)throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry.");var oe={},de={},fe=[],Ae=[],Se={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},Qe=ee.getAttribute("normal");Qe===void 0||this.isNormalizedNormalAttribute(Qe)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),ee.setAttribute("normal",this.createNormalizedNormalAttribute(Qe)));var Le=null;for(var Ce in ee.attributes)if(Ce.substr(0,5)!=="morph"){var je=ee.attributes[Ce];Ce=Se[Ce]||Ce.toUpperCase();var me=/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;if(me.test(Ce)||(Ce="_"+Ce),Z.attributes.has(this.getUID(je))){de[Ce]=Z.attributes.get(this.getUID(je));continue}Le=null;var Ne=je.array;Ce!=="JOINTS_0"||Ne instanceof Uint16Array||Ne instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),Le=new a.BufferAttribute(new Uint16Array(Ne),je.itemSize,je.normalized));var Ie=this.processAccessor(Le||je,ee);Ie!==null&&(de[Ce]=Ie,Z.attributes.set(this.getUID(je),Ie))}if(Qe!==void 0&&ee.setAttribute("normal",Qe),Object.keys(de).length===0)return null;if(F.morphTargetInfluences!==void 0&&0<F.morphTargetInfluences.length){var Ke=[],Ye=[],ht={};if(F.morphTargetDictionary!==void 0)for(var dt in F.morphTargetDictionary)ht[F.morphTargetDictionary[dt]]=dt;for(var Ee=0;Ee<F.morphTargetInfluences.length;++Ee){var ye={},it=!1;for(var Ve in ee.morphAttributes){if(Ve!="position"&&Ve!=="normal"&&Ve!=="color"){it||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),it=!0);continue}var yt=ee.morphAttributes[Ve][Ee],bt=Ve.toUpperCase();Se[Ve]&&(bt=Se[Ve]);var _t=ee.attributes[Ve];if(Z.attributes.has(this.getUID(yt))){ye[bt]=Z.attributes.get(this.getUID(yt));continue}var nt=_t.clone();if(!ee.morphTargetsRelative)if(_t)for(var Je=0,et=yt.count;Je<et;Je++)_t.count>Je&&nt.setXYZ(Je,yt.getX(Je)-_t.getX(Je),yt.getY(Je)-_t.getY(Je),yt.getZ(Je)-_t.getZ(Je));else for(var Xe=0,Lt=yt.count;Xe<Lt;Xe++)nt.setXYZ(Xe,0,0,0);ye[bt]=this.processAccessor(nt,ee),Z.attributes.set(this.getUID(_t),ye[bt])}Ae.push(ye),Ke.push(F.morphTargetInfluences[Ee]),F.morphTargetDictionary!==void 0&&Ye.push(ht[Ee])}oe.weights=Ke,0<Ye.length&&(oe.extras={},oe.extras.targetNames=Ye)}var vt=Array.isArray(F.material);if(vt&&ee.groups.length===0)return null;for(var Et,kt=vt?F.material:[F.material],pt=vt?ee.groups:[{materialIndex:0,start:void 0,count:void 0}],Qn=0,Jt=pt.length;Qn<Jt;Qn++){if(Et={mode:xe,attributes:de},this.serializeUserData(ee,Et),0<Ae.length&&(Et.targets=Ae),ee.index!==null){var Mn=this.getUID(ee.index);(pt[Qn].start!==void 0||pt[Qn].count!==void 0)&&(Mn+=":"+pt[Qn].start+":"+pt[Qn].count),Z.attributes.has(Mn)?Et.indices=Z.attributes.get(Mn):(Et.indices=this.processAccessor(ee.index,ee,pt[Qn].start,pt[Qn].count),Z.attributes.set(Mn,Et.indices)),Et.indices===null&&delete Et.indices}var ln=this.processMaterial(kt[pt[Qn].materialIndex]);ln!==null&&(Et.material=ln),fe.push(Et)}oe.primitives=fe,K.meshes||(K.meshes=[]),this._invokeAll(function(ze){ze.writeMesh&&ze.writeMesh(F,oe)});var Mt=K.meshes.push(oe)-1;return Z.meshes.set(he,Mt),Mt}processCamera(F){var Z=this.json;Z.cameras||(Z.cameras=[]);var K=F.isOrthographicCamera,X={type:K?"orthographic":"perspective"};return K?X.orthographic={xmag:2*F.right,ymag:2*F.top,zfar:0>=F.far?.001:F.far,znear:0>F.near?0:F.near}:X.perspective={aspectRatio:F.aspect,yfov:a.MathUtils.degToRad(F.fov),zfar:0>=F.far?.001:F.far,znear:0>F.near?0:F.near},F.name!==""&&(X.name=F.type),Z.cameras.push(X)-1}processAnimation(F,Z){var K=this.json,X=this.nodeMap;K.animations||(K.animations=[]),F=l.Utils.mergeMorphTargetTracks(F.clone(),Z);for(var te=F.tracks,J=[],he=[],xe=0;xe<te.length;++xe){var ee=te[xe],oe=a.PropertyBinding.parseTrackName(ee.name),de=a.PropertyBinding.findNode(Z,oe.nodeName),fe=u[oe.propertyName];if(oe.objectName==="bones"&&(de.isSkinnedMesh===!0?de=de.skeleton.getBoneByName(oe.objectIndex):de=void 0),!de||!fe)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',ee.name),null;var Ae=ee.values.length/ee.times.length;fe===u.morphTargetInfluences&&(Ae/=de.morphTargetInfluences.length);var Se=void 0;ee.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(Se="CUBICSPLINE",Ae/=3):ee.getInterpolation()===a.InterpolateDiscrete?Se="STEP":Se="LINEAR",he.push({input:this.processAccessor(new a.BufferAttribute(ee.times,1)),output:this.processAccessor(new a.BufferAttribute(ee.values,Ae)),interpolation:Se}),J.push({sampler:he.length-1,target:{node:X.get(de),path:fe}})}return K.animations.push({name:F.name||"clip_"+K.animations.length,samplers:he,channels:J}),K.animations.length-1}processSkin(F){var Z=this.json,K=this.nodeMap,X=Z.nodes[K.get(F)],te=F.skeleton;if(te===void 0)return null;var J=F.skeleton.bones[0];if(J===void 0)return null;for(var he=[],xe=new Float32Array(16*te.bones.length),ee=new a.Matrix4,oe=0;oe<te.bones.length;++oe)he.push(K.get(te.bones[oe])),ee.copy(te.boneInverses[oe]),ee.multiply(F.bindMatrix).toArray(xe,16*oe);Z.skins===void 0&&(Z.skins=[]),Z.skins.push({inverseBindMatrices:this.processAccessor(new a.BufferAttribute(xe,16)),joints:he,skeleton:K.get(J)});var de=X.skin=Z.skins.length-1;return de}processNode(F){var Z=this.json,K=this.options,X=this.nodeMap;Z.nodes||(Z.nodes=[]);var te={};if(K.trs){var J=F.quaternion.toArray(),he=F.position.toArray(),xe=F.scale.toArray();_(J,[0,0,0,1])||(te.rotation=J),_(he,[0,0,0])||(te.translation=he),_(xe,[1,1,1])||(te.scale=xe)}else F.matrixAutoUpdate&&F.updateMatrix(),L(F.matrix)===!1&&(te.matrix=F.matrix.elements);if(F.name!==""&&(te.name=F.name+""),this.serializeUserData(F,te),F.isMesh||F.isLine||F.isPoints){var ee=this.processMesh(F);ee!==null&&(te.mesh=ee)}else F.isCamera&&(te.camera=this.processCamera(F));if(F.isSkinnedMesh&&this.skins.push(F),0<F.children.length){for(var oe,de=[],fe=0,Ae=F.children.length;fe<Ae;fe++)if(oe=F.children[fe],oe.visible||K.onlyVisible===!1){var Se=this.processNode(oe);Se!==null&&de.push(Se)}0<de.length&&(te.children=de)}this._invokeAll(function(Le){Le.writeNode&&Le.writeNode(F,te)});var Qe=Z.nodes.push(te)-1;return X.set(F,Qe),Qe}processScene(F){var Z=this.json,K=this.options;Z.scenes||(Z.scenes=[],Z.scene=0);var X={};F.name!==""&&(X.name=F.name),Z.scenes.push(X);for(var te,J=[],he=0,xe=F.children.length;he<xe;he++)if(te=F.children[he],te.visible||K.onlyVisible===!1){var ee=this.processNode(te);ee!==null&&J.push(ee)}0<J.length&&(X.nodes=J),this.serializeUserData(F,X)}processObjects(F){var Z=new a.Scene;Z.name="AuxScene";for(var K=0;K<F.length;K++)Z.children.push(F[K]);this.processScene(Z)}processInput(F){var Z=this.options;F=F instanceof Array?F:[F],this._invokeAll(function(he){he.beforeParse&&he.beforeParse(F)});for(var K=[],X=0;X<F.length;X++)F[X]instanceof a.Scene?this.processScene(F[X]):K.push(F[X]);0<K.length&&this.processObjects(K);for(var te=0;te<this.skins.length;++te)this.processSkin(this.skins[te]);for(var J=0;J<Z.animations.length;++J)this.processAnimation(Z.animations[J].clip,Z.animations[J].mesh);this._invokeAll(function(he){he.afterParse&&he.afterParse(F)})}_invokeAll(F){for(var Z=0,K=this.plugins.length;Z<K;Z++)F(this.plugins[Z])}}class B{constructor(F){this.writer=F,this.name="KHR_lights_punctual"}writeNode(F,Z){if(F.isLight){if(!F.isDirectionalLight&&!F.isPointLight&&!F.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",F);var K=this.writer,X=K.json,te=K.extensionsUsed,J={};F.name&&(J.name=F.name),J.color=F.color.toArray(),J.intensity=F.intensity,F.isDirectionalLight?J.type="directional":F.isPointLight?(J.type="point",0<F.distance&&(J.range=F.distance)):F.isSpotLight&&(J.type="spot",0<F.distance&&(J.range=F.distance),J.spot={},J.spot.innerConeAngle=-1*((F.penumbra-1)*F.angle),J.spot.outerConeAngle=F.angle),F.decay!==void 0&&F.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),F.target&&(F.target.parent!==F||F.target.position.x!==0||F.target.position.y!==0||F.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),te[this.name]||(X.extensions=X.extensions||{},X.extensions[this.name]={lights:[]},te[this.name]=!0);var he=X.extensions[this.name].lights;he.push(J),Z.extensions=Z.extensions||{},Z.extensions[this.name]={light:he.length-1}}}}class D{constructor(F){this.writer=F,this.name="KHR_materials_unlit"}writeMaterial(F,Z){if(F.isMeshBasicMaterial){var K=this.writer,X=K.extensionsUsed;Z.extensions=Z.extensions||{},Z.extensions[this.name]={},X[this.name]=!0,Z.pbrMetallicRoughness.metallicFactor=0,Z.pbrMetallicRoughness.roughnessFactor=.9}}}class z{constructor(F){this.writer=F,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(F,Z){if(F.isGLTFSpecularGlossinessMaterial){var K=this.writer,X=K.extensionsUsed,te={};Z.pbrMetallicRoughness.baseColorFactor&&(te.diffuseFactor=Z.pbrMetallicRoughness.baseColorFactor);var J=[1,1,1];if(F.specular.toArray(J,0),te.specularFactor=J,te.glossinessFactor=F.glossiness,Z.pbrMetallicRoughness.baseColorTexture&&(te.diffuseTexture=Z.pbrMetallicRoughness.baseColorTexture),F.specularMap){var he={index:K.processTexture(F.specularMap)};K.applyTextureTransform(he,F.specularMap),te.specularGlossinessTexture=he}Z.extensions=Z.extensions||{},Z.extensions[this.name]=te,X[this.name]=!0}}}l.Utils={insertKeyframe:function(F,Z){var K,X=.001,te=F.getValueSize(),J=new F.TimeBufferType(F.times.length+1),he=new F.ValueBufferType(F.values.length+te),xe=F.createInterpolant(new F.ValueBufferType(te));if(F.times.length===0){J[0]=Z;for(var ee=0;ee<te;ee++)he[ee]=0;K=0}else if(Z<F.times[0]){if(Math.abs(F.times[0]-Z)<X)return 0;J[0]=Z,J.set(F.times,1),he.set(xe.evaluate(Z),0),he.set(F.values,te),K=0}else if(Z>F.times[F.times.length-1]){if(Math.abs(F.times[F.times.length-1]-Z)<X)return F.times.length-1;J[J.length-1]=Z,J.set(F.times,0),he.set(F.values,0),he.set(xe.evaluate(Z),F.values.length),K=J.length-1}else for(var oe=0;oe<F.times.length;oe++){if(Math.abs(F.times[oe]-Z)<X)return oe;if(F.times[oe]<Z&&F.times[oe+1]>Z){J.set(F.times.slice(0,oe+1),0),J[oe+1]=Z,J.set(F.times.slice(oe+1),oe+2),he.set(F.values.slice(0,(oe+1)*te),0),he.set(xe.evaluate(Z),(oe+1)*te),he.set(F.values.slice((oe+1)*te),(oe+2)*te),K=oe+1;break}}return F.times=J,F.values=he,K},mergeMorphTargetTracks:function(F,Z){for(var K=[],X={},te=F.tracks,J=0;J<te.length;++J){var he=te[J],xe=a.PropertyBinding.parseTrackName(he.name),ee=a.PropertyBinding.findNode(Z,xe.nodeName);if(xe.propertyName!=="morphTargetInfluences"||xe.propertyIndex===void 0){K.push(he);continue}if(he.createInterpolant!==he.InterpolantFactoryMethodDiscrete&&he.createInterpolant!==he.InterpolantFactoryMethodLinear){if(he.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),he=he.clone(),he.setInterpolation(a.InterpolateLinear)}var oe=ee.morphTargetInfluences.length,de=ee.morphTargetDictionary[xe.propertyIndex];if(de===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+xe.propertyIndex);var fe=void 0;if(X[ee.uuid]===void 0){fe=he.clone();for(var Ae=new fe.ValueBufferType(oe*fe.times.length),Se=0;Se<fe.times.length;Se++)Ae[Se*oe+de]=fe.values[Se];fe.name=(xe.nodeName||"")+".morphTargetInfluences",fe.values=Ae,X[ee.uuid]=fe,K.push(fe);continue}var Qe=he.createInterpolant(new he.ValueBufferType(1));fe=X[ee.uuid];for(var Le=0;Le<fe.times.length;Le++)fe.values[Le*oe+de]=Qe.evaluate(fe.times[Le]);for(var Ce,je=0;je<he.times.length;je++)Ce=this.insertKeyframe(fe,he.times[je]),fe.values[Ce*oe+de]=he.values[je]}return F.tracks=K,F}}},function(n,r,o){var a=o(3),l=o(4).resolveURL,s=function(){this.nearPlane=.168248,this.farPlane=6.82906,this.eyePosition=[.5,-2.86496,.5],this.targetPosition=[.5,.5,.5],this.upVector=[0,0,1];var x=this;this.setFromObject=L=>{var{nearPlane:S,farPlane:C,eyePosition:A,targetPosition:H,upVector:k}=L;x.nearPlane=S,x.farPlane=C,x.eyePosition=A,x.targetPosition=H,x.upVector=k}},h=function(x,L,S,C){var A={NONE:-1,DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,ROTATE_TRANSITION:4,MINIMAP:5,SYNC_CONTROL:6},H={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6},k={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},B={};B.MAIN=H.ROTATE,B.AUXILIARY=H.ZOOM,B.SECONDARY=H.PAN,this.cameraObject=x,this.domElement=L===void 0?document:L,this.renderer=S,this.scene=C,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.scrollRate=50;var D=6e3,z=!0,q=0,F=void 0,Z=void 0,K=!1,X=500,te=void 0,J="default",he=A.DEFAULT,xe=void 0,ee=void 0,oe=void 0,de=0,fe=k.FREE;this._state=H.NONE;var Ae;this.targetTouchId=-1;var Se=void 0,Qe=new a.Vector3,Le=new a.Vector3,Ce=new a.Vector3,je=new a.Vector3,me=new a.Vector3,Ne=new a.Vector3,Ie=new a.Vector3,Ke=new a.Vector3,Ye=new a.Sphere,ht=new a.Vector3,dt=void 0,Ee=0,ye={default:new s};ye.default.nearPlane=.1,ye.default.farPlane=2e3,ye.default.eyePosition=[0,0,0],ye.default.targetPosition=[0,0,-1],ye.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new a.Vector3(...ye.default.targetPosition)),this.calculateMaxAllowedDistance=ze=>{var mt=ze.getBoundingBox();if(mt){mt.getBoundingSphere(Ye),Ee=6*Ye.radius;var Ht=0;this.cameraObject&&(Ht=this.cameraObject.position.distanceTo(Ye.center)),Ee=Ht>Ee?Ht:Ee}else Ee=0},this.addViewport=(ze,mt)=>{ze&&mt&&(ye[ze]=mt)},this.setDefaultViewport=ze=>!!(ze&&ze in ye)&&(J=ze,!0),this.getDefaultViewport=()=>J,this.getViewportOfName=ze=>ye[ze],this.setCurrentViewport=ze=>ze in ye&&(this.setCurrentCameraSettings(ye[ze]),!0),this.setRotationMode=ze=>{switch(ze){case"none":fe=k.NONE;break;case"horizontal":fe=k.HORIZONTAL;break;case"vertical":fe=k.VERTICAL;break;case"free":default:fe=k.FREE}},this.onResize=()=>{Se&&(Se=void 0),dt&&dt.setCurrentCameraSettings(this.cameraObject,ye[J])},this.getNDCFromDocumentCoords=(ze,mt,Ht)=>{vt(!1);var pn=Ht||new a.Vector2,Ft=2*((ze-Se.left)/Se.width)-1,ct=2*-((mt-Se.top)/Se.height)+1;return pn.set(Ft,ct)},this.getRelativeCoordsFromNDC=(ze,mt,Ht)=>{vt(!1);var pn=Ht||new a.Vector2;return pn.x=(ze+1)*Se.width/2,pn.y=(1-mt)*Se.height/2,pn},this.setMouseButtonAction=(ze,mt)=>{B[ze]=H[mt]};var it=()=>{if(0<Ee){var ze=ht.distanceTo(Ye.center);return Ee>ze||this.cameraObject.position.distanceTo(Ye.center)>ze}return!0},Ve=ze=>{ht.copy(this.cameraObject.position).add(ze),it()&&(this.cameraObject.target.add(ze),this.cameraObject.position.add(ze),this.updateDirectionalLight())},yt=ze=>{vt(!1);var mt;if(he===A.DEFAULT&&(mt=this.scene.getNormalisedMinimapCoordinates(this.renderer,ze)),!mt)ze.button==0?ze.ctrlKey?this._state=B.AUXILIARY:ze.shiftKey?this._state=B.SECONDARY:this._state=B.MAIN:ze.button==1?(ze.preventDefault(),this._state=B.AUXILIARY):ze.button==2&&(this._state=B.SECONDARY),this.pointer_x=ze.clientX-Se.left,this.pointer_y=ze.clientY-Se.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else{he=A.MINIMAP;var Ht=this.scene.getMinimapDiffFromNormalised(mt.x,mt.y);Ve(Ht)}},bt=ze=>{if(vt(!1),this.pointer_x=ze.clientX-Se.left,this.pointer_y=ze.clientY-Se.top,he===A.MINIMAP){var mt=this.scene.getNormalisedMinimapCoordinates(this.renderer,ze);if(mt){var Ht=this.scene.getMinimapDiffFromNormalised(mt.x,mt.y);Ve(Ht)}}else this._state===H.NONE&&Ae!==void 0&&Ae.move(this,ze.clientX,ze.clientY,this.renderer)},_t=ze=>{this._state=H.NONE,he==A.MINIMAP&&(he=A.DEFAULT),Ae!==void 0&&this.pointer_x_start==ze.clientX-Se.left&&this.pointer_y_start==ze.clientY-Se.top&&Ae.pick(this,ze.clientX,ze.clientY,this.renderer)},nt=()=>{this._state=H.NONE},Je=ze=>{vt(!1);var mt=ze.touches.length;if(mt==1)this._state=H.TOUCH_ROTATE,this.pointer_x=ze.touches[0].clientX-Se.left,this.pointer_y=ze.touches[0].clientY-Se.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else if(mt==2){this._state=H.TOUCH_ZOOM;var Ht=ze.touches[0].clientX-ze.touches[1].clientX,pn=ze.touches[0].clientY-ze.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(Ht*Ht+pn*pn)}else mt==3&&(this._state=H.TOUCH_PAN,this.targetTouchId=ze.touches[0].identifier,this.pointer_x=ze.touches[0].clientX-Se.left,this.pointer_y=ze.touches[0].clientY-Se.top,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y)},et=ze=>{ze.preventDefault(),ze.stopPropagation();var mt=ze.touches.length;if(mt==1)this.pointer_x=ze.touches[0].clientX-Se.left,this.pointer_y=ze.touches[0].clientY-Se.top;else if(mt==2){if(this._state===H.TOUCH_ZOOM){var Ht=ze.touches[0].clientX-ze.touches[1].clientX,pn=ze.touches[0].clientY-ze.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(Ht*Ht+pn*pn)}}else if(mt==3&&this._state===H.TOUCH_PAN)for(var Ft=0;3>Ft;Ft++)ze.touches[Ft].identifier==this.targetTouchId&&(this.pointer_x=ze.touches[0].clientX-Se.left,this.pointer_y=ze.touches[0].clientY-Se.top)},Xe=ze=>{var mt=ze.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=H.NONE,mt==1&&Ae!==void 0&&this.pointer_x_start==ze.touches[0].clientX-Se.left&&this.pointer_y_start==ze.touches[0].clientY-Se.top&&Ae.pick(this.cameraObject,ze.touches[0].clientX,ze.touches[0].clientY,this.renderer)},Lt=()=>{vt(!0)},vt=ze=>{if(ze||Se===void 0){var mt=new IntersectionObserver(Ht=>{for(var pn of Ht)Se=pn.boundingClientRect;mt.disconnect()});mt.observe(this.domElement)}},Et=ze=>{vt(!1),this._state=H.SCROLL;var mt=0;0<ze.deltaY?mt=this.scrollRate:0>ze.deltaY&&(mt=-1*this.scrollRate),de+=mt,ze.preventDefault(),ze.stopImmediatePropagation()},kt=()=>{if(typeof this.cameraObject<"u"){var ze=Se.height,mt=this.cameraObject.position.distanceTo(this.cameraObject.target),Ht=0;this.cameraObject.far>this.cameraObject.near&&mt>=this.cameraObject.near&&mt<=this.cameraObject.far&&(Ht=(mt-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),Le.set(this.previous_pointer_x,ze-this.previous_pointer_y,0),Ce.set(this.previous_pointer_x,ze-this.previous_pointer_y,1),je.set(this.pointer_x,ze-this.pointer_y,0),me.set(this.pointer_x,ze-this.pointer_y,1),Le.unproject(this.cameraObject),Ce.unproject(this.cameraObject),je.unproject(this.cameraObject),me.unproject(this.cameraObject),je.sub(Le).multiplyScalar(1-Ht),me.sub(Ce).multiplyScalar(Ht),je.add(me).multiplyScalar(-.002),Ve(je)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(ze,mt)=>{ze.normalize(),Ie.copy(this.cameraObject.position).sub(this.cameraObject.target),Ke.copy(Ie),Ie.normalize(),.8<Math.abs(Ie.dot(ze))&&Ie.copy(this.cameraObject.up),Le.crossVectors(ze,Ie).normalize(),Ce.crossVectors(ze,Le);var Ht=ze.dot(Ke),pn=Le.dot(Ke),Ft=Ce.dot(Ke),ct=ze.dot(this.cameraObject.up),ge=Le.dot(this.cameraObject.up),se=Ce.dot(this.cameraObject.up),pe=Math.cos(mt),He=Math.sin(mt);return je.set(pe*Le.x+He*Ce.x,pe*Le.y+He*Ce.y,pe*Le.z+He*Ce.z),me.set(pe*Ce.x-He*Le.x,pe*Ce.y-He*Le.y,pe*Ce.z-He*Le.z),Ie.copy(this.cameraObject.target),Ie.x=Ie.x+ze.x*Ht+je.x*pn+me.x*Ft,Ie.y=Ie.y+ze.y*Ht+je.y*pn+me.y*Ft,Ie.z=Ie.z+ze.z*Ht+je.z*pn+me.z*Ft,Qe.set(ze.x*ct+je.x*ge+me.x*se,ze.y*ct+je.y*ge+me.y*se,ze.z*ct+je.z*ge+me.z*se),{position:Ie,up:Qe}},this.rotateAboutLookAtpoint=(ze,mt)=>{var Ht=this.getVectorsFromRotateAboutLookAtPoints(ze,mt);this.cameraObject.position.copy(Ht.position),this.updateDirectionalLight(),this.cameraObject.up.copy(Ht.up)};var pt=()=>{if(typeof this.cameraObject<"u"){var ze=Se.width,mt=Se.height;if(0<ze&&0<mt){var Ht=.25*(ze+mt),pn=0,Ft=0;(fe===k.FREE||fe===k.HORIZONTAL)&&(pn=this.pointer_x-this.previous_pointer_x),(fe===k.FREE||fe===k.VERTICAL)&&(Ft=this.previous_pointer_y-this.pointer_y);var ct=Math.sqrt(pn*pn+Ft*Ft);if(0<ct){var ge=1*-Ft/ct,se=1*pn/ct;fe===k.FREE&&ge*(this.pointer_x-.5*(ze-1))+se*(.5*(mt-1)-this.pointer_y);var pe=Math.acos(0/Ht)-.5*Math.PI,He=this.tumble_rate*ct/Ht;Qe.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(),Le.copy(this.cameraObject.up).normalize(),Ce.copy(Le).cross(Qe).normalize().multiplyScalar(ge),Le.multiplyScalar(se),Ne.addVectors(Ce,Le).multiplyScalar(Math.cos(pe)),Qe.multiplyScalar(Math.sin(pe)),Ne.add(Qe),this.rotateAboutLookAtpoint(Ne,-He)}}}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y},Qn=()=>{var ze=0;return this._state===H.ZOOM?ze=this.previous_pointer_y-this.pointer_y:this._state===H.SCROLL?ze=de:(ze=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),ze};this.changeZoomByScrollRateUnit=ze=>{var mt=ze*this.scrollRate;this.changeZoomByValue(mt)},this.changeZoomByValue=ze=>{if(typeof this.cameraObject<"u"){Se.width;var mt=Se.height,Ht=this.cameraObject.position.clone();Ht.sub(this.cameraObject.target);var pn=Ht.length(),Ft=1.5*ze/mt;if(.01<pn+Ft*pn&&(Ht.normalize(),ht.copy(this.cameraObject.position),ht.x+=Ht.x*Ft*pn,ht.y+=Ht.y*Ft*pn,ht.z+=Ht.z*Ft*pn,it())){this.cameraObject.position.copy(ht),this.updateDirectionalLight();var ct=1e-5;if(ct*this.cameraObject.far<this.cameraObject.near+Ft*pn+this.near_plane_fly_debt)this.near_plane_fly_debt!=0&&(this.near_plane_fly_debt+=Ft*pn,0<this.near_plane_fly_debt?(this.cameraObject.near+=this.near_plane_fly_debt,this.cameraObject.far+=this.near_plane_fly_debt,this.near_plane_fly_debt=0):(this.cameraObject.near+=Ft*pn,this.cameraObject.far+=Ft*pn));else{if(this.near_plane_fly_debt==0){var ge=this.cameraObject.near-ct*this.cameraObject.far;this.cameraObject.near=ct*this.cameraObject.far,this.cameraObject.far-=ge,this.near_plane_fly_debt-=ct*this.cameraObject.far}this.near_plane_fly_debt+=Ft*pn}}}};var Jt=()=>{var ze=Qn();this.changeZoomByValue(ze),this._state===H.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),this._state===H.SCROLL&&(de=0,this._state=H.NONE)};this.setDirectionalLight=ze=>{this.directionalLight=ze},this.updateDirectionalLight=()=>{this.directionalLight!=0&&this.directionalLight.position.set(this.cameraObject.position.x,this.cameraObject.position.y,this.cameraObject.position.z)},this.enable=function(){z=!0,this.domElement&&this.domElement.addEventListener&&(this.domElement.addEventListener("mousedown",yt,!1),this.domElement.addEventListener("mousemove",bt,!1),this.domElement.addEventListener("mouseup",_t,!1),this.domElement.addEventListener("mouseleave",nt,!1),this.domElement.addEventListener("touchstart",Je,!1),this.domElement.addEventListener("touchmove",et,!1),this.domElement.addEventListener("touchend",Xe,!1),this.domElement.addEventListener("wheel",Et,!1),this.domElement.addEventListener("contextmenu",ze=>{ze.preventDefault()},!1),this.domElement.addEventListener("mouseenter",Lt,!1))},this.disable=function(){z=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",yt,!1),this.domElement.removeEventListener("mousemove",bt,!1),this.domElement.removeEventListener("mouseup",_t,!1),this.domElement.removeEventListener("mouseleave",nt,!1),this.domElement.removeEventListener("touchstart",Je,!1),this.domElement.removeEventListener("touchmove",et,!1),this.domElement.removeEventListener("touchend",Xe,!1),this.domElement.removeEventListener("wheel",Et,!1),this.domElement.removeEventListener("mouseenter",Lt,!1),this.domElement.removeEventListener("contextmenu",ze=>{ze.preventDefault()},!1))},this.loadPath=ze=>{F=ze.CameraPath,Z=ze.NumberOfPoints},this.loadPathURL=(ze,mt)=>{var Ht=new XMLHttpRequest;Ht.onreadystatechange=()=>{if(Ht.readyState==4&&Ht.status==200){var Ft=JSON.parse(Ht.responseText);this.loadPath(Ft),mt!=null&&typeof mt=="function"&&mt()}};var pn=l(ze);Ht.open("GET",pn,!0),Ht.send()},this.setPathDuration=ze=>{D=ze,xe&&xe.setDuration(D),ee&&ee.setDuration(D)},this.getPlayRate=()=>X,this.setPlayRate=ze=>{X=ze};var Mn=ze=>{var mt=q+ze;mt>D&&(mt-=D),q=mt};this.getTime=()=>q,this.setTime=ze=>{q=ze>D?D:0>ze?0:ze},this.getNumberOfTimeFrame=()=>Z,this.getCurrentTimeFrame=()=>{if(2<Z){var ze=q/D*(Z-1),mt=Math.floor(ze),Ht=Math.ceil(ze);return mt==Ht?mt==Z-1?[mt-1,Ht,0]:[mt,Ht+1,1]:[mt,Ht,1-(ze-mt)]}return Z==1?[0,0,0]:void 0},this.setCurrentTimeFrame=ze=>{2<Z&&(q=D*ze/(Z-1),0>q&&(q=0),q>D&&(q=D))};var ln=ze=>{if(he===A.PATH&&(Mn(ze),F)){for(var mt=this.getCurrentTimeFrame(),Ht=mt[0],pn=mt[1],Ft=mt[2],ct=[F[3*Ht],F[3*Ht+1],F[3*Ht+2]],ge=[F[3*pn],F[3*pn+1],F[3*pn+2]],se=[],pe=0;pe<ct.length;pe++)se.push(Ft*ct[pe]+(1-Ft)*ge[pe]);this.cameraObject.position.set(se[0],se[1],se[2]),this.cameraObject.target.set(ge[0],ge[1],ge[2]),te&&this.cameraObject.lookAt(this.cameraObject.target),K&&(this.directionalLight.position.set(se[0],se[1],se[2]),this.directionalLight.target.position.set(ge[0],ge[1],ge[2]))}};this.calculatePathNow=()=>{ln(0)};var Mt=()=>{this._state===H.ROTATE||this._state===H.TOUCH_ROTATE?pt():this._state===H.PAN||this._state===H.TOUCH_PAN?(kt(),dt.triggerCallback()):(this._state===H.ZOOM||this._state===H.TOUCH_ZOOM||this._state===H.SCROLL)&&(dt.zoom(Qn()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,this._state===H.SCROLL&&(this._state=H.NONE),de=0,dt.triggerCallback())};this.update=ze=>{var mt=ze*X,Ht=z;he===A.PATH?ln(mt):he===A.SMOOTH_CAMERA_TRANSITION&&xe?(xe.update(mt),xe.isTransitionCompleted()&&(he=A.DEFAULT),Ht=!1):he===A.ROTATE_CAMERA_TRANSITION&&ee?(ee.update(mt),ee.isTransitionCompleted()&&(he=A.DEFAULT),Ht=!1):he===A.AUTO_TUMBLE&&oe?oe.update(mt):he===A.SYNC_CONTROL&&dt&&(Mt(),Ht=!1),Ht&&(this._state===H.ROTATE||this._state===H.TOUCH_ROTATE?pt():this._state===H.PAN||this._state===H.TOUCH_PAN?kt():(this._state===H.ZOOM||this._state===H.TOUCH_ZOOM||this._state===H.SCROLL)&&Jt(),this._state!==H.NONE&&he===A.AUTO_TUMBLE&&oe&&oe.stopOnCameraInput,this._state===H.SCROLL&&(this._state=H.NONE)),te?te.update():this.cameraObject.lookAt(this.cameraObject.target)},this.playPath=()=>{he=A.PATH},this.stopPath=()=>{he=A.DEFAULT},this.isPlayingPath=()=>he===A.PATH,this.enableDirectionalLightUpdateWithPath=ze=>{K=ze},this.enableDeviceOrientation=()=>{te||(te=new v(this.cameraObject))},this.disableDeviceOrientation=()=>{te&&(te.dispose(),te=void 0)},this.isDeviceOrientationEnabled=()=>!!te,this.resetView=()=>{var ze=ye[J];this.cameraObject.near=ze.nearPlane,this.cameraObject.far=ze.farPlane,this.cameraObject.position.set(ze.eyePosition[0],ze.eyePosition[1],ze.eyePosition[2]),this.cameraObject.target.set(ze.targetPosition[0],ze.targetPosition[1],ze.targetPosition[2]),this.cameraObject.up.set(ze.upVector[0],ze.upVector[1],ze.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=ze=>{ze.nearPlane&&(this.cameraObject.near=ze.nearPlane),ze.farPlane&&(this.cameraObject.far=ze.farPlane),ze.eyePosition&&this.cameraObject.position.set(ze.eyePosition[0],ze.eyePosition[1],ze.eyePosition[2]),ze.targetPosition&&this.cameraObject.target.set(ze.targetPosition[0],ze.targetPosition[1],ze.targetPosition[2]),ze.upVector&&this.cameraObject.up.set(ze.upVector[0],ze.upVector[1],ze.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.getViewportFromCentreAndRadius=(ze,mt,Ht,pn,Ft,ct)=>{var ge=this.cameraObject.position.x-this.cameraObject.target.x,se=this.cameraObject.position.y-this.cameraObject.target.y,pe=this.cameraObject.position.z-this.cameraObject.target.z,He=1/Math.sqrt(ge*ge+se*se+pe*pe);ge*=He,se*=He,pe*=He;var Pe=pn/Math.tan(Ft*Math.PI/360),Ue=[ze+ge*Pe,mt+se*Pe,Ht+pe*Pe],ot=0,Me=.95;ot=ct>Me*Pe?(1-Me)*Pe:Pe-ct;var re=new s;return re.nearPlane=ot,re.farPlane=Pe+ct,re.eyePosition=Ue,re.targetPosition=[ze,mt,Ht],re.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],re},this.getCurrentViewport=()=>{var ze=new s;return ze.nearPlane=this.cameraObject.near,ze.farPlane=this.cameraObject.far,ze.eyePosition[0]=this.cameraObject.position.x,ze.eyePosition[1]=this.cameraObject.position.y,ze.eyePosition[2]=this.cameraObject.position.z,ze.targetPosition[0]=this.cameraObject.target.x,ze.targetPosition[1]=this.cameraObject.target.y,ze.targetPosition[2]=this.cameraObject.target.z,ze.upVector[0]=this.cameraObject.up.x,ze.upVector[1]=this.cameraObject.up.y,ze.upVector[2]=this.cameraObject.up.z,ze},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(ze,mt,Ht)=>{ee==null&&(xe=new u(ze,mt,this,Ht))},this.rotateCameraTransition=(ze,mt,Ht)=>{xe==null&&(ee=new d(ze,mt,this,Ht))},this.enableCameraTransition=()=>{xe&&(he=A.SMOOTH_CAMERA_TRANSITION),ee&&(he=A.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{he=A.DEFAULT},this.stopCameraTransition=()=>{he=A.DEFAULT,xe=void 0,ee=void 0},this.isTransitioningCamera=()=>he===A.SMOOTH_CAMERA_TRANSITION||he===A.ROTATE_CAMERA_TRANSITION,this.autoTumble=(ze,mt,Ht)=>{oe=new f(ze,mt,Ht,this)},this.enableAutoTumble=()=>{he=A.AUTO_TUMBLE},this.stopAutoTumble=()=>{he=A.DEFAULT,oe=void 0},this.updateAutoTumble=()=>{oe&&(oe.requireUpdate=!0)},this.isAutoTumble=()=>he===A.AUTO_TUMBLE,this.enableRaycaster=(ze,mt,Ht)=>{Ae==null&&(Ae=new p(ze,this.scene,mt,Ht,this.renderer))},this.disableRaycaster=()=>{Ae.disable(),Ae=void 0},this.isSyncControl=()=>currentMpde===A.SYNC_CONTROL,this.enableSyncControl=()=>(he=A.SYNC_CONTROL,dt||(dt=new _),dt.setCurrentCameraSettings(this.cameraObject,ye[J]),dt),this.disableSyncControl=()=>{he=A.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},u=function(x,L,S,C){var A=x.eyePosition,H=x.targetPosition,k=x.upVector,B=L.eyePosition,D=L.targetPosition,z=L.upVector,q=S,F=C,Z=0,K=!1;q.near=Math.min(x.nearPlane,L.nearPlane),q.far=Math.max(x.farPlane,L.farPlane),q.cameraObject.up.set(L.upVector[0],L.upVector[1],L.upVector[2]),this.setDuration=J=>{F=J};var X=J=>{var he=Z+J;he>F&&(he=F),Z=he},te=()=>{var J=Z/F,he=[A[0]*(1-J)+B[0]*J,A[1]*(1-J)+B[1]*J,A[2]*(1-J)+B[2]*J],xe=[H[0]*(1-J)+D[0]*J,H[1]*(1-J)+D[1]*J,H[2]*(1-J)+D[2]*J];k[0]*(1-J)+z[0]*J,k[1]*(1-J)+z[1]*J,k[2]*(1-J)+z[2]*J,q.cameraObject.position.set(he[0],he[1],he[2]),q.cameraObject.target.set(xe[0],xe[1],xe[2])};this.update=J=>{this.enabled===!1||(X(J),te(),Z==F&&(K=!0))},this.isTransitionCompleted=()=>K},d=function(x,L,S,C){var A=C,H=0,k=!1;this.setDuration=D=>{A=D};var B=D=>{var z=H,q=H+D;q>A&&(q=A),H=q;var F=H-z,Z=F/A;S.rotateAboutLookAtpoint(x,Z*L)};this.update=D=>{this.enabled===!1||(B(D),H==A&&(k=!0))},this.isTransitionCompleted=()=>k},p=function(x,L,S,C,A){var H=x,k=A,B=S,D=C,z=new a.Raycaster;z.params.Line.threshold=.1,z.params.Points.threshold=.1;var q=new a.Vector2,F=!1,Z=new Date,K=!1,X=0,te=[],J={zincCamera:void 0,x:-1,y:-1};this.enable=()=>{enable=!0},this.disable=()=>{enable=!1};var he=(oe,de,fe)=>{if(oe.getNDCFromDocumentCoords(de,fe,q),L!==H){var Ae=H.getThreeJSScene();k.render(Ae,oe.cameraObject)}z.setFromCamera(q,oe.cameraObject);var Se=H.getPickableThreeJSObjects();return te.length=0,z.intersectObjects(Se,!0,te)};this.pick=(oe,de,fe)=>{k&&H&&oe&&B&&(he(oe,de,fe),B(te,de,fe))};var xe=(oe,de,fe)=>{if(k&&H&&oe&&D){if(he(oe,de,fe),Z.setTime(Date.now()),te.length===0){if(K)return;K=!0}else K=!1;D(te,de,fe)}};this.move=(oe,de,fe)=>{k&&H&&oe&&D&&(H.displayMarkers?xe(oe,de,fe):(J.zincCamera=oe,J.x=de,J.y=fe,!F&&(X=Z?Date.now()-Z.getTime():250,250<=X?xe(oe,de,fe):(F=!0,setTimeout(ee(J),X)))))};var ee=oe=>function(){F=!1,xe(oe.zincCamera,oe.x,oe.y)}},f=function(x,L,S,C){var A=new a.Vector3,H=C;this.stopOnCameraInput=S,this.requireUpdate=!0;var k=new a.Vector3,B=new a.Vector3,D=z=>{var q=Math.sqrt(z[0]*z[0]+z[1]*z[1]),F=4*Math.abs(z[0]),Z=4*Math.abs(z[1]),K=.25*(F+Z),X=-z[1]/q,te=z[0]/q,J=X*z[0]+te*-z[1];J>K?J=K:J<-K&&(J=-K);var he=Math.acos(J/K)-.5*Math.PI;A.copy(H.cameraObject.position).sub(H.cameraObject.target).normalize(),k.copy(H.cameraObject.up).normalize(),B.crossVectors(k,A).normalize().multiplyScalar(X),k.multiplyScalar(te),k.add(B).multiplyScalar(Math.cos(he)),A.multiplyScalar(Math.sin(he)).add(k)};this.update=z=>{this.enabled===!1||(this.requireUpdate&&(D(x),this.requireUpdate=!1),H.rotateAboutLookAtpoint(A,-L*z/1e3))}},m=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new a.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new a.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1};Object.assign(m.prototype,{update:(()=>{var x,L,S,C,A,H,k=new a.Matrix4,B=new a.Matrix4;return function(D){var z=x!==D.focus||L!==D.fov||S!==D.aspect*this.aspect||C!==D.near||A!==D.far||H!==D.zoom;if(z){x=D.focus,L=D.fov,S=D.aspect*this.aspect,C=D.near,A=D.far,H=D.zoom;var q,F,Z=D.projectionMatrix.clone(),K=.064/2,X=K*C/x,te=C*Math.tan(.5*(a.Math.DEG2RAD*L))/D.zoom;B.elements[12]=-K,k.elements[12]=K,q=-te*S+X,F=te*S+X,Z.elements[0]=2*C/(F-q),Z.elements[8]=(F+q)/(F-q),this.cameraL.projectionMatrix.copy(Z),q=-te*S-X,F=te*S-X,Z.elements[0]=2*C/(F-q),Z.elements[8]=(F+q)/(F-q),this.cameraR.projectionMatrix.copy(Z)}this.cameraL.matrixWorld.copy(D.matrixWorld).multiply(B),this.cameraR.matrixWorld.copy(D.matrixWorld).multiply(k)}})()});var y=function(x){var L=new m;L.aspect=.5,this.setSize=(S,C)=>{x.setSize(S,C)},this.render=(S,C)=>{S.updateMatrixWorld(),C.parent===null&&C.updateMatrixWorld(),L.update(C);var A=x.getSize();x.setScissorTest(!0),x.clear(),x.setScissor(0,0,A.width/2,A.height),x.setViewport(0,0,A.width/2,A.height),x.render(S,L.cameraL),x.setScissor(A.width/2,0,A.width/2,A.height),x.setViewport(A.width/2,0,A.width/2,A.height),x.render(S,L.cameraR),x.setScissorTest(!1)}},v=function(x){var L=this;this.object=x,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var S=H=>{L.deviceOrientation=H},C=()=>{typeof window<"u"&&(L.screenOrientation=window.orientation||0)},A=(()=>{var H=new a.Vector3(0,0,1),k=new a.Euler,B=new a.Quaternion,D=new a.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return(z,q,F,Z,K)=>{var X=new a.Vector3(0,0,1);X.subVectors(z.target,z.position),k.set(F,q,-Z,"YXZ");var te=new a.Quaternion;te.setFromEuler(k),te.multiply(D),te.multiply(B.setFromAxisAngle(H,-K)),X.applyQuaternion(te),X.addVectors(z.position,X),z.lookAt(X)}})();this.connect=()=>{C(),typeof window<"u"&&(window.addEventListener("orientationchange",C,!1),window.addEventListener("deviceorientation",S,!1)),L.enabled=!0},this.disconnect=()=>{typeof window<"u"&&(window.removeEventListener("orientationchange",C,!1),window.removeEventListener("deviceorientation",S,!1)),L.enabled=!1},this.update=()=>{if(L.enabled!==!1){var H=L.deviceOrientation.alpha?a.Math.degToRad(L.deviceOrientation.alpha):0,k=L.deviceOrientation.beta?a.Math.degToRad(L.deviceOrientation.beta):0,B=L.deviceOrientation.gamma?a.Math.degToRad(L.deviceOrientation.gamma):0,D=L.screenOrientation?a.Math.degToRad(L.screenOrientation):0;A(L.object,H,k,B,D)}},this.dispose=function(){this.disconnect()},this.connect()},_=function(){var x=void 0,L=void 0,S=void 0,C=new a.Vector3,A=new a.Vector3,H=new a.Vector3,k=new a.Vector3,B=void 0;this.setCurrentCameraSettings=(D,z)=>{x=D.clone(),L=D,S=z,x.near=S.nearPlane,S.farPlane&&(x.far=S.farPlane),S.eyePosition&&x.position.set(S.eyePosition[0],S.eyePosition[1],S.eyePosition[2]),S.upVector&&x.up.set(S.upVector[0],S.upVector[1],S.upVector[2]),S.targetPosition&&(x.target=new a.Vector3(S.targetPosition[0],S.targetPosition[1],S.targetPosition[2]),x.lookAt(x.target)),x.updateProjectionMatrix(),C.copy(x.position).project(x),A.copy(x.target).project(x)},this.getCurrentPosition=()=>(A.copy(L.target).project(x),[A.x,A.y]),this.zoom=D=>{var z=Math.max(L.zoom-.002*D,1);L.zoom=z,L.updateProjectionMatrix()},this.zoomToBox=(D,z)=>{D.getCenter(H),H.project(x),this.setCenterZoom([H.x,H.y],z)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:L.zoom}),this.setCenterZoom=(D,z)=>{H.set(D[0],D[1],A.z).unproject(x),k.copy(H).sub(L.target),L.target.copy(H),L.lookAt(L.target),L.position.add(k),L.zoom=z,L.updateProjectionMatrix()},this.setEventCallback=D=>{(D===void 0||typeof D=="function")&&(B=D)},this.triggerCallback=()=>{B!==void 0&&typeof B=="function"&&B()}};r.Viewport=s,r.CameraControls=h,r.SmoothCameraTransition=u,r.RotateCameraTransition=d,r.RayCaster=p,r.CameraAutoTumble=f,r.StereoEffect=y,r.NDCCameraControl=_},function(n,r,o){var{Group:a,Matrix4:l}=o(3),s=0,h=function(){return"re"+s++},u=function(d){var p=d,f=new a;f.matrixAutoUpdate=!1,f.userData=this;var m=[],y="",v=[],_=new l,x=3e3;_.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.pickableUpdateRequired=!0,this.isRegion=!0,this.uuid=h(),this.hideAllPrimitives=()=>{m.forEach(L=>L.hideAllPrimitives()),v.forEach(L=>L.setVisibility(!1))},this.showAllPrimitives=()=>{m.forEach(L=>L.showAllPrimitives()),v.forEach(L=>L.setVisibility(!0))},this.setVisibility=L=>{f.visible=L},this.getVisibility=()=>f.visible,this.getGroup=()=>f,this.setTransformation=L=>{_.set(...L),f.matrix.copy(_),f.updateMatrixWorld()},this.setName=L=>{L&&L!==""&&(y=L)},this.getName=()=>y,this.getParent=()=>p,this.getFullSeparatedPath=()=>{var L=[];if(y!==""){L.push(y);for(var S,C=p;C!==void 0;)S=C.getName(),S!==""&&L.unshift(S),C=C.getParent()}return L},this.getFullPath=()=>{var L=this.getFullSeparatedPath();if(0<L.length){var S=L.shift();return L.forEach(C=>{S=S.concat("/",C)}),S}return""},this.createChild=L=>{var S=new u(this);return S.setName(L),m.push(S),f.add(S.getGroup()),S},this.getChildWithName=L=>{if(L){for(var S=L.toLowerCase(),C=0;C<m.length;C++)if(m[C].getName().toLowerCase()===S)return m[C]}},this.findChildFromSeparatedPath=L=>{if(L&&0<L.length&&L[0]===""&&L.shift(),L&&0<L.length){var S=this.getChildWithName(L[0]);return S?(L.shift(),S.findChildFromSeparatedPath(L)):void 0}return this},this.findChildFromPath=L=>{var S=L.split("/");return this.findChildFromSeparatedPath(S)},this.createChildFromSeparatedPath=L=>{if(0<L.length&&L[0]===""&&L.shift(),0<L.length){var S=this.getChildWithName(L[0]);return S||(S=this.createChild(L[0])),L.shift(),S.createChildFromSeparatedPath(L)}return this},this.createChildFromPath=L=>{var S=L.split("/");return this.createChildFromSeparatedPath(S)},this.findOrCreateChildFromPath=L=>{var S=this.findChildFromPath(L);return S||(S=this.createChildFromPath(L)),S},this.addZincObject=L=>{L&&(L.setRegion(this),f.add(L.morph),v.push(L),this.pickableUpdateRequired=!0)},this.removeZincObject=L=>{for(var S=0;S<v.length;S++)if(L===v[S])return f.remove(L.morph),v.splice(S,1),void L.dispose()},this.checkPickableUpdateRequred=L=>{if(this.pickableUpdateRequired)return!0;if(L){for(var S=!1,C=0;C<m.length;C++)if(S=m[C].checkPickableUpdateRequred(L),S)return!0}return!1},this.getPickableThreeJSObjects=(L,S)=>(v.forEach(C=>{if(C.morph&&C.morph.visible){var A=C.marker;A&&A.isEnabled()&&L.push(A.morph),L.push(C.morph)}}),S&&m.forEach(C=>{C.getPickableThreeJSObjects(L,S)}),this.pickableUpdateRequired=!1,L),this.setDuration=L=>{x=L,v.forEach(S=>S.setDuration(L)),m.forEach(S=>S.setDuration(L))},this.getDuration=()=>x,this.getBoundingBox=L=>{var S,C;return v.forEach(A=>{C=A.getBoundingBox(),C&&(S==null?S=C.clone():S.union(C))}),L&&m.forEach(A=>{C=A.getBoundingBox(L),C&&(S==null?S=C.clone():S.union(C))}),S},this.clear=L=>{L&&m.forEach(S=>S.clear(L)),v.forEach(S=>{f.remove(S.morph),S.dispose()}),m=[],v=[]},this.objectIsInRegion=(L,S)=>{for(var C=0;C<v.length;C++)if(L===v[C])return!0;if(S){for(var A=0;A<m.length;A++)if(m[A].objectIsInRegion(L,S))return!0}return!1},this.forEachGeometry=(L,S)=>{v.forEach(C=>{C.isGeometry&&L(C)}),S&&m.forEach(C=>C.forEachGeometry(L,S))},this.forEachGlyphset=(L,S)=>{v.forEach(C=>{C.isGlyphset&&L(C)}),S&&m.forEach(C=>C.forEachGlyphset(L,S))},this.forEachPointset=(L,S)=>{v.forEach(C=>{C.isPointset&&L(C)}),S&&m.forEach(C=>C.forEachPointset(L,S))},this.forEachLine=(L,S)=>{v.forEach(C=>{C.isLines&&L(C)}),S&&m.forEach(C=>C.forEachLine(L,S))},this.findObjectsWithAnatomicalId=(L,S)=>(v.forEach(C=>{C.anatomicalId===L&&objectsArray.push(C)}),S&&m.forEach(C=>{var A=C.findObjectsWithAnatomicalId(L,S);objectsArray.push(...A)}),objectsArray),this.findObjectsWithGroupName=(L,S)=>{var C=[];return v.forEach(A=>{var H=A.groupName?A.groupName.toLowerCase():A.groupName,k=L&&L.toLowerCase();H===k&&C.push(A)}),S&&m.forEach(A=>{var H=A.findObjectsWithGroupName(L,S);C.push(...H)}),C},this.findGeometriesWithGroupName=(L,S)=>{var C=this.findObjectsWithGroupName(L,S),A=C.filter(H=>H.isGeometry);return A},this.findPointsetsWithGroupName=(L,S)=>{var C=this.findObjectsWithGroupName(L,S),A=C.filter(H=>H.isPointset);return A},this.findGlyphsetsWithGroupName=(L,S)=>{var C=this.findObjectsWithGroupName(L,S),A=C.filter(H=>H.isGlyphset);return A},this.findLinesWithGroupName=(L,S)=>{var C=this.findObjectsWithGroupName(L,S),A=C.filter(H=>H.isLines);return A},this.getAllObjects=L=>{var S=[...v];return L&&m.forEach(C=>{var A=C.getAllObjects(L);S.push(...A)}),S},this.getChildRegions=L=>{var S=[...m];return L&&m.forEach(C=>{var A=C.getChildRegions(L);S.push(...A)}),S},this.getCurrentTime=()=>{if(v[0]!=null)return v[0].getCurrentTime();for(var L,S=0;S<m.length;S++)if(L=m[S].getCurrentTime(),L!==-1)return L;return-1},this.setMorphTime=(L,S)=>{v.forEach(C=>{C.setMorphTime(L)}),S&&m.forEach(C=>{C.setMorphTime(L)})},this.isTimeVarying=()=>{for(var L=0;L<v.length;L++)if(v[L].isTimeVarying())return!0;for(var S=0;S<m.length;S++)if(m[S].isTimeVarying())return!0;return!1},this.renderGeometries=(L,S,C,A,H)=>{var k=this.getAllObjects(H);if(k.forEach(z=>{z.render(L*S,C,A)}),A&&A.displayMarkers&&C===!1&&0<A.markerDepths.length){var B=Math.min(...A.markerDepths),D=Math.max(...A.markerDepths);k.forEach(z=>{z.processMarkerVisual(B,D,A)})}}};r.Region=u},function(n,r,o){var a=o(3);r.Minimap=function(l){var s=l;this.camera=new a.OrthographicCamera(-.5,.5,.5,-.5,.01,10),this.helper=void 0;var h=new a.BufferGeometry,u=new Float32Array([-1,-1,1,1,-1,1,1,1,1,1,1,1,-1,1,1,-1,-1,1]),d=new a.BufferAttribute(u,3);h.setAttribute("position",d);var p=new a.MeshBasicMaterial({color:3355443,depthTest:!1,depthWrite:!1,opacity:.5,transparent:!0});this.mask=new a.Mesh(h,p);var f=new a.Box3,m=new a.Vector3;this.getDiffFromNormalised=(v,_)=>{f.setFromBufferAttribute(d).getCenter(m);var x=m.clone().project(this.camera),L=new a.Vector3(v,_,x.z).unproject(this.camera);return L.sub(m)};var y=(v,_)=>{s.camera.near&&(this.camera.near=s.camera.near),_.farPlane&&(this.camera.far=_.farPlane),_.eyePosition&&this.camera.position.set(_.eyePosition[0],_.eyePosition[1],_.eyePosition[2]),_.upVector&&this.camera.up.set(_.upVector[0],_.upVector[1],_.upVector[2]),_.targetPosition&&this.camera.lookAt(new a.Vector3(_.targetPosition[0],_.targetPosition[1],_.targetPosition[2])),this.camera.zoom=1/v,this.camera.updateProjectionMatrix()};this.getBoundary=()=>{var v=new a.Vector3().copy(s.camera.target).project(s.camera),_=new a.Vector3(-1,-1,v.z).unproject(s.camera),x=new a.Vector3(1,-1,v.z).unproject(s.camera),L=new a.Vector3(1,1,v.z).unproject(s.camera),S=new a.Vector3(-1,1,v.z).unproject(s.camera);d.copyVector3sArray([_,x,L,L,S,_]),d.needsUpdate=!0},this.updateCamera=()=>{this.getBoundary();var v=s.getZincCameraControls(),_=s.getBoundingBox();if(_){var x=_.min.distanceTo(_.max),L=x/2,S=(_.min.x+_.max.x)/2,C=(_.min.y+_.max.y)/2,A=(_.min.z+_.max.z)/2,H=v.getViewportFromCentreAndRadius(S,C,A,L,40,L*4);y(x,H)}}}},function(n,r,o){var a=o(3),l=o(43)(a),s=o(2).Geometry,h=o(44),u=o(45).default,d=a.BufferGeometryLoader,p=function(f){var m;f&&f.isGeometry&&(m=f);var y=void 0,v=void 0,_=!1,x=void 0,L=k=>{var B=m.morph.material.clone();B.morphTargets=!1;var D=new s,z=new d,q=z.parse(k),F=new a.Mesh(q.geometry,B);return D.geometry=F.geometry,D.morph=F,D.morph.userData=D,D},S=k=>{switch(k.data.action){case"message":console.log(k.data.message);break;case"result":var B=new p(L(k.data.object));x&&x(B),x=void 0,_=!1;break;default:throw"Cannot handle specified action."}},C=k=>{if(h!==void 0&&(v=h(46)),!v)y=new(o(47)).GeometryCSGInternal(k);else if(k&&k.isGeometry){var B=k.morph,D=B.geometry.clone().applyMatrix(B.matrix).toJSON();v.addEventListener("message",function(z){S(z)}),v.postMessage({action:"initialise",object:D})}};this.getHostGeometry=()=>{var k=new l(m.morph);return new A(k)},this.getGeometry=()=>m;var A=k=>{var B=m.morph.material.clone();B.morphTargets=!1;var D=k.toMesh(B),z=new s;return z.geometry=D.geometry,z.morph=D,z.morph.userData=z,z};this.setCSG=k=>{y.setCSG(k)};var H=(k,B,D,z)=>{if(_)z("On progress");else{var q=k.morph,F=q.geometry.clone().applyMatrix(q.matrix).toJSON();x=D,_=!0,v.postMessage({action:B,object:F})}};this.intersect=k=>new u((B,D)=>{if(v)H(k,"intersect",B,D);else{var z=y.intersect(k),q=new p(A(z));q.setCSG(z),B(q)}}),this.subtract=k=>new u((B,D)=>{if(v)H(k,"intersect",B,D);else{var z=y.subtract(k),q=new p(A(z));q.setCSG(z),B(q)}}),this.union=k=>new u((B,D)=>{if(v)H(k,"intersect",B,D);else{var z=y.union(k),q=new p(A(z));q.setCSG(z),B(q)}}),this.terminateWorker=()=>{v&&v.terminate()},C(f)};r.GeometryCSG=p},function(n,r,o){var a=1e-5,l=0,s=1,h=2,u=3;n.exports=function(d){var p=function(f){var m,y,v,_,x,L,S,C=[];if(f.isBufferGeometry&&(f=new d.Geometry().fromBufferGeometry(f)),f instanceof d.Geometry)this.matrix=new d.Matrix4;else if(f.isMesh)f.updateMatrix(),this.matrix=f.matrix.clone(),f=f.geometry,f.isBufferGeometry&&(f=new d.Geometry().fromBufferGeometry(f)),f.mergeVertices(),f.computeVertexNormals(!1);else{if(f instanceof p.Node)return this.tree=f,this.matrix=new d.Matrix4,this;throw"ThreeBSP: Given geometry is unsupported"}for(m=0,y=f.faces.length;m<y;m++)v=f.faces[m],x=f.faceVertexUvs[0][m],S=new p.Polygon,v instanceof d.Face3?(_=f.vertices[v.a],L=x?new d.Vector2(x[0].x,x[0].y):null,_=new p.Vertex(_.x,_.y,_.z,v.vertexNormals[0],L),_.applyMatrix4(this.matrix),S.vertices.push(_),_=f.vertices[v.b],L=x?new d.Vector2(x[1].x,x[1].y):null,_=new p.Vertex(_.x,_.y,_.z,v.vertexNormals[2],L),_.applyMatrix4(this.matrix),S.vertices.push(_),_=f.vertices[v.c],L=x?new d.Vector2(x[2].x,x[2].y):null,_=new p.Vertex(_.x,_.y,_.z,v.vertexNormals[2],L),_.applyMatrix4(this.matrix),S.vertices.push(_)):(d.Face4,_=f.vertices[v.a],L=x?new d.Vector2(x[0].x,x[0].y):null,_=new p.Vertex(_.x,_.y,_.z,v.vertexNormals[0],L),_.applyMatrix4(this.matrix),S.vertices.push(_),_=f.vertices[v.b],L=x?new d.Vector2(x[1].x,x[1].y):null,_=new p.Vertex(_.x,_.y,_.z,v.vertexNormals[1],L),_.applyMatrix4(this.matrix),S.vertices.push(_),_=f.vertices[v.c],L=x?new d.Vector2(x[2].x,x[2].y):null,_=new p.Vertex(_.x,_.y,_.z,v.vertexNormals[2],L),_.applyMatrix4(this.matrix),S.vertices.push(_),_=f.vertices[v.d],L=x?new d.Vector2(x[3].x,x[3].y):null,_=new p.Vertex(_.x,_.y,_.z,v.vertexNormals[3],L),_.applyMatrix4(this.matrix),S.vertices.push(_)),S.calculateProperties(),C.push(S);this.tree=new p.Node(C)};return p.prototype.subtract=function(f){var m=this.tree.clone(),y=f.tree.clone();return m.invert(),m.clipTo(y),y.clipTo(m),y.invert(),y.clipTo(m),y.invert(),m.build(y.allPolygons()),m.invert(),m=new p(m),m.matrix=this.matrix,m},p.prototype.union=function(f){var m=this.tree.clone(),y=f.tree.clone();return m.clipTo(y),y.clipTo(m),y.invert(),y.clipTo(m),y.invert(),m.build(y.allPolygons()),m=new p(m),m.matrix=this.matrix,m},p.prototype.intersect=function(f){var m=this.tree.clone(),y=f.tree.clone();return m.invert(),y.clipTo(m),y.invert(),m.clipTo(y),y.clipTo(m),m.build(y.allPolygons()),m.invert(),m=new p(m),m.matrix=this.matrix,m},p.prototype.toGeometry=function(){var f,m,y,v,_,x,L,S,C,A,H=new d.Matrix4().getInverse(this.matrix),k=new d.Geometry,B=this.tree.allPolygons(),D=B.length,z={};for(f=0;f<D;f++)for(y=B[f],v=y.vertices.length,m=2;m<v;m++)A=[],S=y.vertices[0],A.push(new d.Vector2(S.uv.x,S.uv.y)),S=new d.Vector3(S.x,S.y,S.z),S.applyMatrix4(H),typeof z[S.x+","+S.y+","+S.z]>"u"?(k.vertices.push(S),_=z[S.x+","+S.y+","+S.z]=k.vertices.length-1):_=z[S.x+","+S.y+","+S.z],S=y.vertices[m-1],A.push(new d.Vector2(S.uv.x,S.uv.y)),S=new d.Vector3(S.x,S.y,S.z),S.applyMatrix4(H),typeof z[S.x+","+S.y+","+S.z]>"u"?(k.vertices.push(S),x=z[S.x+","+S.y+","+S.z]=k.vertices.length-1):x=z[S.x+","+S.y+","+S.z],S=y.vertices[m],A.push(new d.Vector2(S.uv.x,S.uv.y)),S=new d.Vector3(S.x,S.y,S.z),S.applyMatrix4(H),typeof z[S.x+","+S.y+","+S.z]>"u"?(k.vertices.push(S),L=z[S.x+","+S.y+","+S.z]=k.vertices.length-1):L=z[S.x+","+S.y+","+S.z],C=new d.Face3(_,x,L,new d.Vector3(y.normal.x,y.normal.y,y.normal.z)),k.faces.push(C),k.faceVertexUvs[0].push(A);return k},p.prototype.toBufferGeometry=function(){var f=this.toGeometry(),m=new d.BufferGeometry().fromGeometry(f);return m},p.prototype.toMesh=function(f){var m=this.toBufferGeometry(),y=new d.Mesh(m,f);return y.position.setFromMatrixPosition(this.matrix),y.rotation.setFromRotationMatrix(this.matrix),y},p.Polygon=function(f){f instanceof Array||(f=[]),this.vertices=f,0<f.length?this.calculateProperties():this.normal=this.w=void 0},p.Polygon.prototype.calculateProperties=function(){var f=this.vertices[0],m=this.vertices[1],y=this.vertices[2];return this.normal=m.clone().subtract(f).cross(y.clone().subtract(f)).normalize(),this.w=this.normal.clone().dot(f),this},p.Polygon.prototype.clone=function(){var f,m,y=new p.Polygon;for(f=0,m=this.vertices.length;f<m;f++)y.vertices.push(this.vertices[f].clone());return y.calculateProperties(),y},p.Polygon.prototype.flip=function(){var f,m=[];for(this.normal.multiplyScalar(-1),this.w*=-1,f=this.vertices.length-1;0<=f;f--)m.push(this.vertices[f]);return this.vertices=m,this},p.Polygon.prototype.classifyVertex=function(f){var m=this.normal.dot(f)-this.w;return m<-a?h:m>a?s:l},p.Polygon.prototype.classifySide=function(f){var m,y,v,_=0,x=0,L=f.vertices.length;for(m=0;m<L;m++)y=f.vertices[m],v=this.classifyVertex(y),v===s?_++:v===h&&x++;return 0<_&&x===0?s:_===0&&0<x?h:_===0&&x===0?l:u},p.Polygon.prototype.splitPolygon=function(f,m,y,v,_){var x=this.classifySide(f);if(x===l)(0<this.normal.dot(f.normal)?m:y).push(f);else if(x===s)v.push(f);else if(x===h)_.push(f);else{var L,S,C,A,H,k,B,D,z,q=[],F=[];for(S=0,L=f.vertices.length;S<L;S++)C=(S+1)%L,k=f.vertices[S],B=f.vertices[C],A=this.classifyVertex(k),H=this.classifyVertex(B),A!=h&&q.push(k),A!=s&&F.push(k),(A|H)===u&&(D=(this.w-this.normal.dot(k))/this.normal.dot(B.clone().subtract(k)),z=k.interpolate(B,D),q.push(z),F.push(z));3<=q.length&&v.push(new p.Polygon(q).calculateProperties()),3<=F.length&&_.push(new p.Polygon(F).calculateProperties())}},p.Vertex=function(f,m,y,v,_){this.x=f,this.y=m,this.z=y,this.normal=v||new d.Vector3,this.uv=_||new d.Vector2},p.Vertex.prototype.clone=function(){return new p.Vertex(this.x,this.y,this.z,this.normal.clone(),this.uv.clone())},p.Vertex.prototype.add=function(f){return this.x+=f.x,this.y+=f.y,this.z+=f.z,this},p.Vertex.prototype.subtract=function(f){return this.x-=f.x,this.y-=f.y,this.z-=f.z,this},p.Vertex.prototype.multiplyScalar=function(f){return this.x*=f,this.y*=f,this.z*=f,this},p.Vertex.prototype.cross=function(f){var m=this.x,y=this.y,v=this.z;return this.x=y*f.z-v*f.y,this.y=v*f.x-m*f.z,this.z=m*f.y-y*f.x,this},p.Vertex.prototype.normalize=function(){var f=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return this.x/=f,this.y/=f,this.z/=f,this},p.Vertex.prototype.dot=function(f){return this.x*f.x+this.y*f.y+this.z*f.z},p.Vertex.prototype.lerp=function(f,m){return this.add(f.clone().subtract(this).multiplyScalar(m)),this.normal.add(f.normal.clone().sub(this.normal).multiplyScalar(m)),this.uv.add(f.uv.clone().sub(this.uv).multiplyScalar(m)),this},p.Vertex.prototype.interpolate=function(f,m){return this.clone().lerp(f,m)},p.Vertex.prototype.applyMatrix4=function(f){var m=this.x,y=this.y,v=this.z,_=f.elements;return this.x=_[0]*m+_[4]*y+_[8]*v+_[12],this.y=_[1]*m+_[5]*y+_[9]*v+_[13],this.z=_[2]*m+_[6]*y+_[10]*v+_[14],this},p.Node=function(f){var m,y,v=[],_=[];if(this.polygons=[],this.front=this.back=void 0,f instanceof Array&&f.length!==0){for(this.divider=f[0].clone(),m=0,y=f.length;m<y;m++)this.divider.splitPolygon(f[m],this.polygons,this.polygons,v,_);0<v.length&&(this.front=new p.Node(v)),0<_.length&&(this.back=new p.Node(_))}},p.Node.isConvex=function(f){var m,y;for(m=0;m<f.length;m++)for(y=0;y<f.length;y++)if(m!==y&&f[m].classifySide(f[y])!==h)return!1;return!0},p.Node.prototype.build=function(f){var m,y,v=[],_=[];for(this.divider||(this.divider=f[0].clone()),m=0,y=f.length;m<y;m++)this.divider.splitPolygon(f[m],this.polygons,this.polygons,v,_);0<v.length&&(!this.front&&(this.front=new p.Node),this.front.build(v)),0<_.length&&(!this.back&&(this.back=new p.Node),this.back.build(_))},p.Node.prototype.allPolygons=function(){var f=this.polygons.slice();return this.front&&(f=f.concat(this.front.allPolygons())),this.back&&(f=f.concat(this.back.allPolygons())),f},p.Node.prototype.clone=function(){var f=new p.Node;return f.divider=this.divider.clone(),f.polygons=this.polygons.map(function(m){return m.clone()}),f.front=this.front&&this.front.clone(),f.back=this.back&&this.back.clone(),f},p.Node.prototype.invert=function(){var f,m,y;for(f=0,m=this.polygons.length;f<m;f++)this.polygons[f].flip();return this.divider.flip(),this.front&&this.front.invert(),this.back&&this.back.invert(),y=this.front,this.front=this.back,this.back=y,this},p.Node.prototype.clipPolygons=function(f){var m,y,v,_;if(!this.divider)return f.slice();for(v=[],_=[],m=0,y=f.length;m<y;m++)this.divider.splitPolygon(f[m],v,_,v,_);return this.front&&(v=this.front.clipPolygons(v)),_=this.back?this.back.clipPolygons(_):[],v.concat(_)},p.Node.prototype.clipTo=function(f){this.polygons=f.clipPolygons(this.polygons),this.front&&this.front.clipTo(f),this.back&&this.back.clipTo(f)},p}},function(n,r){n.exports=TMe()},function(n,r){n.exports=_Me},function(n,r,o){var a=o(2).Geometry,l=o(3),s=l.BufferGeometryLoader;n.exports=function(h){var u=void 0,d=function(v){var _=new s,x=_.parse(v),L=new l.MeshPhongMaterial,S=new l.Mesh(x.geometry,L),C=new a;return C.morph=S,C},p=function(v){var _=d(v);u=new(o(47)).GeometryCSGInternal(_),h.postMessage({action:"message",message:"Initialised"})},f=function(v){if(u){var _=d(v),x=u.intersect(_),L=x.toBufferGeometry().toJSON();h.postMessage({action:"result",object:L})}},m=function(v){if(u){var _=d(v),x=u.subtract(_),L=x.toBufferGeometry().toJSON();h.postMessage({action:"result",object:L})}},y=function(v){if(u){var _=d(v),x=u.union(_),L=x.toBufferGeometry().toJSON();h.postMessage({action:"result",object:L})}};h.addEventListener("message",function(v){switch(v.data.action){case"initialise":p(v.data.object);break;case"intersect":f(v.data.object);break;case"subtract":m(v.data.object);break;case"union":y(v.data.object);break;default:throw"Cannot handle specified action."}})}},function(n,r,o){var a=o(3),l=o(43)(a);o(2).Geometry,o(42).GeometryCSG;var s=function(h){var u;h&&h.isGeometry&&(u=h);var d;this.setGeometry=f=>{f&&f.isGeometry&&(u=f),d=void 0},this.setCSG=f=>{d=f};var p=f=>{if(u&&u.morph&&f&&f.morph){d===void 0&&(d=new l(u.morph));var m=new l(f.morph);return m}};this.intersect=f=>{var m=p(f);return d&&m?d.intersect(m):void 0},this.subtract=f=>{var m=p(f);return d&&m?d.subtract(m):void 0},this.union=f=>{var m=p(f);return d&&m?d.union(m):void 0}};r.GeometryCSGInternal=s},function(n,r,o){var a=o(3),l=o(43)(a);o(13).Glyphset;var s=function(h){var u;h&&h.isGlyphset&&(u=h);var d=[];this.setGlyphset=m=>{m&&m.isGlyphset&&(u=m),hostCSG=void 0},this.getGlyphset=()=>u;var p=()=>m=>{var y=m.getMesh(),v=m.getLabel();if(y){var _=new l(y.geometry.clone().applyMatrix(y.matrix)),x=[];x.csg=_,x.label=v,y.material&&(x.material=y.material.clone()),d.push(x)}},f=m=>{if(u&&m&&m.morph){d.length==0&&u.forEachGlyph(p());var y=new l(m.morph);return y}};this.intersect=m=>{var y=f(m);if(0<d.length&&y){for(var v=new(o(13)).Glyphset,_=0;_<d.length;_++){var x=d[_],L=x.csg.intersect(y),S=L.toMesh();if(S&&S.geometry&&0<S.geometry.vertices.length){x.material&&(S.material=x.material,S.material.side=a.DoubleSide,S.material.clippingPlanes=null);var C=v.addMeshAsGlyph(S,_+1);C.setLabel(x.label)}}var A=new s(v);return A}}};r.GlyphsetCSG=s}])})})(IN);var Tl=IN.exports;const SQ=qY(Tl),fU={isWebGLAvailable:function(){try{var t=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(t.getContext("webgl")||t.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var t=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&t.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(t){var e={1:"WebGL",2:"WebGL 2"},n={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},r='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.',o=document.createElement("div");return o.id="webglmessage",o.style.fontFamily="monospace",o.style.fontSize="20px",o.style.fontWeight="normal",o.style.textAlign="center",o.style.background="#fff",o.style.color="#000",o.style.padding="1.5em",o.style.width="400px",o.style.margin="5em auto 0",n[t]?r=r.replace("$0","graphics card"):r=r.replace("$0","browser"),r=r.replace("$1",e[t]),o.innerHTML=r,o}},sw={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},C1=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};C1.prototype.setName=function(t){if(t&&this.instanceName!==t){this.instanceName=t;const e=this.onChangedCallbacks.slice();for(let n=0;n<e.length;n++)e[n](this,sw.NAME_CHANGED)}},C1.prototype.settingsChanged=function(){const t=this.onChangedCallbacks.slice();for(let e=0;e<t.length;e++)t[e](this,sw.SETTINGS_CHANGED)},C1.prototype.exportSettings=function(){const t={};return t.dialog=this.typeName,t.name=this.instanceName,t},C1.prototype.importSettings=function(t){return t.dialog==this.typeName?(this.setName(t.name),!0):!1},C1.prototype.publishChanges=function(t,e,n){for(let r=0;r<this.eventNotifiers.length;r++)this.eventNotifiers[r].publish(this,e,t,n)},C1.prototype.getName=function(){return this.instanceName},C1.prototype.destroy=function(){const t=this.onChangedCallbacks.slice();for(let e=0;e<t.length;e++)t[e](this,sw.DESTROYED);delete this},C1.prototype.addChangedCallback=function(t){this.onChangedCallbacks.includes(t)==!1&&this.onChangedCallbacks.push(t)},C1.prototype.removeChangedCallback=function(t){const e=this.onChangedCallbacks.indexOf(t);e>-1&&this.onChangedCallbacks.splice(e,1)},C1.prototype.addNotifier=function(t){this.eventNotifiers.push(t)};const Qu={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},LMe=function(t,e,n){this.eventType=t,this.identifiers=e,this.zincObjects=n},wMe=function(t,e,n){this.targetedID=[];const r=t,o=e;this.targetEventType=n;const a=this;n===void 0&&(this.targetEventType=Qu.ALL),this.getEventType=function(){return n},this.notify=function(l,s,h,u){if(l!==r&&(a.targetEventType===Qu.ALL||a.targetEventType===s)){const d=new LMe(s,h,u);o(d)}}},MMe=function(){const t=[];this.publish=function(e,n,r,o){for(let a=0;a<t.length;a++)t[a].notify(e,n,r,o)},this.subscribe=function(e,n,r){if(typeof n=="function"){const o=new wMe(e,n,r);return t.push(o),o}},this.unsubscribe=function(e){for(let n=0;n<t.length;n++)if(e===t[n]){t.splice(n,1);return}}},SMe=function(){let t=[],e=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const n=[],r=[],o=this,a=function(h,u){if(h.length==0&&u.length==0)return!1;for(let d=0;d<h.length;d++){let p=!1;for(let f=0;f<u.length;f++)h[d]===u[f]&&(p=!0);if(!p)return!0}for(let d=0;d<u.length;d++){let p=!1;for(let f=0;f<h.length;f++)u[d]===h[f]&&(p=!0);if(!p)return!0}return!1},l=function(h,u){if(n.length=0,u.length==0)return h;for(let d=0;d<h.length;d++){let p=!1;for(let f=0;f<u.length;f++)h[d]===u[f]&&(p=!0);p||n.push(h[d])}return n};this.setHighlighted=function(h){const u=[...t];o.resetHighlighted();const d=l(h,e),p=s(d);for(let f=0;f<p.length;f++)p[f]&&p[f].material&&p[f].material.emissive&&p[f].material.emissive.setRGB(...o.highlightColour);return t=d,a(t,u)},this.setSelected=function(h){const u=[...e];l(t,h),o.resetHighlighted(),o.resetSelected();const d=s(h);for(let p=0;p<d.length;p++)d[p]&&d[p].material&&d[p].material.emissive&&d[p].material.emissive.setRGB(...o.selectColour);return e=h,a(e,u)};const s=function(h){r.length=0;for(let u=0;u<h.length;u++)h[u].material&&r.push(h[u]);return r};this.resetHighlighted=function(){const h=s(t);for(let u=0;u<h.length;u++)h[u]&&h[u].material&&(h[u].material.emissive&&h[u].material.emissive.setRGB(...o.originalColour),h[u].material.depthFunc&&(h[u].material.depthFunc=Tl.THREE.LessEqualDepth));t=[]},this.resetSelected=function(){const h=s(e);for(let u=0;u<h.length;u++)h[u]&&h[u].material&&(h[u].material.emissive&&h[u].material.emissive.setRGB(...o.originalColour),h[u].material.depthFunc&&(h[u].material.depthFunc=Tl.THREE.LessEqualDepth));e=[]},this.getSelected=function(){return e},this.reset=function(){o.resetSelected(),o.resetHighlighted()}},lw=SQ.THREE,CMe=function(){const t=document.createElement("div");let e;if(t.style.height="100%",fU.isWebGLAvailable())e=new SQ.Renderer(t,window),SQ.defaultMaterialColor=16777116,e.initialiseVisualisation(),e.playAnimation=!1;else{const n=fU.getWebGLErrorMessage();t.appendChild(n)}return{Zinc:SQ,renderer:e,container:t}},ii=function(){C1.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new SMe,this.zincRenderer=null,this.selectedScreenCoordinates=new lw.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0};ii.prototype=Object.create(C1.prototype),ii.prototype.getIntersectedObject=function(t){if(t){const e=t.map(r=>{if(r&&r.object&&r.object.userData){if(r.object.userData.isMarker)return 1;if(r.object.name&&r.object.userData.isZincObject)return 2}return 0});let n=e.indexOf(1);return n=n>-1?n:e.indexOf(2),t[n]}},ii.prototype.getAnnotationsFromObjects=function(t){const e=[];for(var n=0;n<t.length;n++){const r=t[n].userData;let o;if(r)if(r.isGlyph||r.isGlyphset){let a=r;r.isGlyph&&(a=r.getGlyphset()),o=a.userData?a.userData.annotation:void 0,o&&o.data&&(t[n].name&&t[n].name!=""?o.data.id=t[n].name:o.data.id=a.groupName)}else o=r.userData?r.userData.annotation:void 0,o&&o.data&&(o.data.id=t[n].name);o&&e.push(o)}return e},ii.prototype.setHighlightedByObjects=function(t,e,n){const r=this.graphicsHighlight.setHighlighted(t),o=this.objectsToZincObjects(t);if(n){let a=Qu.MOVE;r&&(a=Qu.HIGHLIGHTED);const l=this.getAnnotationsFromObjects(t);l.length>0&&(l[0].coords=e),this.publishChanges(l,a,o)}return r},ii.prototype.setHighlightedByZincObjects=function(t,e,n){let r=[];return t&&t.forEach(o=>{o&&o.morph&&r.push(o.morph)}),this.setHighlightedByObjects(r,e,n)},ii.prototype.setupLiveCoordinates=function(t){if(this.liveUpdatesObjects=t,t&&t.length>0){const e=this.scene.getBoundingBoxOfZincObjects(t);let n=new lw.Vector3;e.getCenter(n),this.selectedCenter==null?this.selectedCenter=n:this.selectedCenter.copy(n)}else this.selectedCenter=void 0},ii.prototype.objectsToZincObjects=function(t){const e=[];for(let n=0;n<t.length;n++){let r=t[n].userData;if(r)if(r.isGlyph||r.isGlyphset){let o=r;r.isGlyph&&(o=r.getGlyphset()),e.push(o)}else e.push(r)}return e},ii.prototype.setSelectedByObjects=function(t,e,n){const r=this.graphicsHighlight.setSelected(t);if(r){const o=this.objectsToZincObjects(t);if(this.setupLiveCoordinates(o),n){const a=Qu.SELECTED,l=this.getAnnotationsFromObjects(t);l.length>0&&(l[0].coords=e),this.publishChanges(l,a,o)}}return r},ii.prototype.setSelectedByZincObjects=function(t,e,n){let r=[];return t&&t.forEach(o=>{o&&o.morph&&r.push(o.morph)}),this.setSelectedByObjects(r,e,n)};const EMe=function(t){return function(e){t.push(e.getMesh())}};ii.prototype.findObjectsByGroupName=function(t){const e=this.scene.findGeometriesWithGroupName(t),n=[];for(let o=0;o<e.length;o++)n.push(e[o].morph);const r=this.scene.findGlyphsetsWithGroupName(t);for(let o=0;o<r.length;o++)r[o].forEachGlyph(EMe(n));return n},ii.prototype.setHighlightedByGroupName=function(t,e){const n=this.findObjectsByGroupName(t);return this.setHighlightedByObjects(n,void 0,e)},ii.prototype.setSelectedByGroupName=function(t,e){const n=this.findObjectsByGroupName(t);return this.setSelectedByObjects(n,void 0,e)},ii.prototype.changeBackgroundColour=function(t){const e=new lw.Color(t);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(e,1)},ii.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},ii.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},ii.prototype.playAnimation=function(t){this.zincRenderer&&(this.zincRenderer.playAnimation=t)},ii.prototype.setPlayRate=function(t){this.zincRenderer&&this.zincRenderer.setPlayRate(t)},ii.prototype.getPlayRate=function(t){return this.zincRenderer?this.zincRenderer.getPlayRate():0},ii.prototype.initialiseRenderer=function(t){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let e=CMe();this.Zinc=e.Zinc,this.zincRenderer=e.renderer,this.rendererContainer=e.container}t&&(this.displayArea=t,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},ii.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),C1.prototype.destroy.call(this)};const HMe=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},AMe=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.currentTime=0,this.timeVarying=!1},TU=function(t){ii.call(this);const e=this;let n;this.sceneData=new AMe;const r=new Array,o=new Array,a=new Array;let l;const s=t;this.NDCCameraControl=void 0,e.typeName="Organ Viewer",this.currentTime=0,this.getSceneData=function(){return e.sceneData},this.updateTime=function(A){let H=6e3;e.scene&&(H=e.scene.getDuration());const k=A/100*H;e.sceneData.nerveMapIsActive||e.scene&&e.scene.setMorphsTime(k),e.sceneData.currentTime=A,e.currentTime=A};const h=function(){let A=3e3;e.scene&&(A=e.scene.getDuration());const H=e.zincRenderer.getCurrentTime();for(let k=0;k<r.length;k++)r[k](H);!e.sceneData.nerveMapIsActive&&n&&n.setMorphsTime(H),e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setTime(H/A),e.sceneData.currentTime=H/A*100,e.currentTime=H/A*100};this.getCurrentTime=function(){return e.sceneData.currentTime},this.toggleSyncControl=(A,H)=>{let k=this.scene.getZincCameraControls();A?(k.resetView(),this.NDCCameraControl=k.enableSyncControl(),k.setRotationMode(H)):(k.disableSyncControl(),this.NDCCameraControl=void 0,k.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=A=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(A,2)},this.setSyncControlCallback=A=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(A)},this.setSyncControlCenterZoom=(A,H)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(A,H)};const u=function(){if(e.zincRenderer.playAnimation&&e.liveUpdatesObjects&&e.setupLiveCoordinates(e.liveUpdatesObjects),e.selectedCenter){const A=new Tl.THREE.Vector3;A.copy(e.selectedCenter);const H=e.scene.vectorToScreenXY(A);e.selectedScreenCoordinates.x=H.x,e.selectedScreenCoordinates.y=H.y}},d=function(){return function(){h()}},p=function(){return function(){u()}};this.addTimeChangedCallback=function(A){r.push(A)},this.setTexturePos=function(A){e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setSliderPos(A)},this.addSceneChangedCallback=function(A){o.push(A)},this.addOrganPartAddedCallback=function(A){a.push(A)},this.setFinishDownloadCallback=function(A){l=A},this.unsetFinishDownloadCallback=function(){l=void 0},this.getNamedObjectsToScreenCoordinates=function(A,H){const k=new Tl.THREE.Vector3;k.setFromMatrixPosition(obj.matrixWorld);const B=width/2,D=height/2;return k.project(H),k.x=k.x*B+B,k.y=-(k.y*D)+D,k};const f=function(A){let H,k;if(A!==void 0){let B=!1;A.object.userData&&A.object.userData.isMarker?(B=!0,k=A.object.userData.parent.morph):k=A.object;try{k.userData.userData.annotation.data.lastActionOnMarker=B}finally{}if(k)if(k.name)H=k.name;else{const D=e.getAnnotationsFromObjects([k]);D&&D[0]&&(H=D[0].data.group)}}return{id:H,object:k}},m=function(){return function(A,H,k){const B=e.getIntersectedObject(A),D=f(B),z={x:H,y:k};if(D.id){D.object.userData.isGlyph?D.object.name?e.setSelectedByObjects([D.object],z,!0):e.setSelectedByZincObjects(D.object.userData.getGlyphset(),z,!0):e.setSelectedByObjects([D.object],z,!0);return}else e.setSelectedByObjects([],z,!0)}},y=function(){return function(A,H,k){const B=e.getIntersectedObject(A),D=f(B),z={x:H,y:k};if(D.id){e.displayArea.style.cursor="pointer",e.setHighlightedByObjects([D.object],z,!0);return}else e.displayArea.style.cursor="auto",e.setHighlightedByObjects([],z,!0)}},v=function(A,H,k,B){if(B=="all"||B=="geometries"){const D=A.findGeometriesWithGroupName(H);for(let z=0;z<D.length;z++)D[z].setVisibility(k)}if(B=="all"||B=="glyphsets"){const D=A.findGlyphsetsWithGroupName(H);for(let z=0;z<D.length;z++)D[z].setVisibility(k)}if(B=="all"||B=="pointsets"){const D=A.findPointsetsWithGroupName(H);for(let z=0;z<D.length;z++)D[z].setVisibility(k)}if(B=="all"||B=="lines"){const D=A.findLinesWithGroupName(H);for(let z=0;z<D.length;z++)D[z].setVisibility(k)}};this.changeGeometriesVisibility=function(A,H){v(e.scene,A,H,"geometries")},this.changeGlyphsetsVisibility=function(A,H){v(e.scene,A,H,"glyphsets")},this.changeLinesVisibility=function(A,H){v(e.scene,A,H,"lines")},this.changePointsetsVisibility=function(A,H){v(e.scene,A,H,"pointsets")},this.changeOrganPartsVisibility=function(A,H,k){let B="all";k!==void 0&&(B=k),v(e.scene,A,H,B)},this.changeOrganPartsVisibilityCallback=function(A){return function(H){e.changeOrganPartsVisibility(A,H)}},this.changeBackgroundColour=function(A){const H=new Tl.THREE.Color(A);e.zincRenderer&&e.zincRenderer.getThreeJSRenderer().setClearColor(H,1)};const _=function(A,H,k,B){for(let q=0;q<a.length;q++)a[q](B,e.scene.isTimeVarying());k&&s.setGeometryColour(B,A,H);const D=new HMe,z=B.region.getFullPath();D.data={species:e.sceneData.currentSpecies,system:A,part:H,group:B.groupName,region:z,uuid:B.uuid,lastActionOnMarker:!1},B.userData.annotation=D},x=function(A,H,k){return function(B){_(A,H,k,B)}},L=function(){return function(){e.settingsChanged(),e.sceneData.timeVarying=e.scene.isTimeVarying(),l&&l()}};this.updateFieldvisibility=function(A,H){for(let k=0;k<A.length;k++)if(H!=k){const B=A[k].PartName;e.changeOrganPartsVisibility(B,!1)}if(H>-1){const k=A[H].PartName;if(e.scene.findGeometriesWithGroupName(k).length>0||e.scene.findGlyphsetsWithGroupName(k).length>0)e.changeOrganPartsVisibility(k,!0);else{const B=getOrganDetails(A[H].SystemName,k);B!=null&&e.scene.loadMetadataURL(s.getOrgansDirectoryPrefix()+"/"+B.meta)}}},this.getAvailableSpecies=function(A,H,k){const B=new Array;B.push("none");const D=Object.keys(organsFileMap);for(index in D){const z=D[index];z!=A&&organsFileMap[z].hasOwnProperty(H)&&organsFileMap[z][H].hasOwnProperty(k)&&B.push(z)}return B};const S=function(A,H,k,B){e.sceneData.nerveMapIsActive=!1,e.sceneData.nerveMap=void 0,e.sceneData.metaURL="",e.sceneData.viewURL="",e.sceneData.currentSpecies=A,e.sceneData.currentSystem=H,e.sceneData.currentPart=k,e.sceneData.currentTime=0,e.sceneData.timeVarying=!1,e.currentTime=0;let D="";A&&(D=A+"/"),H&&(D=H+"/"),k&&(D=k),e.sceneData.currentName=D};this.loadOrgansFromURL=function(A,H,k,B,D,z){if(e.zincRenderer&&B&&e.sceneData.metaURL!==A){S(H,k,B);const q=e.sceneData.currentName;let F=e.zincRenderer.getSceneByName(q);F?z&&F.clearAll():F=e.zincRenderer.createScene(q);for(let K=0;K<o.length;K++)o[K](e.sceneData);D&&D!=""?(e.sceneData.viewURL=D,F.loadViewURL(e.sceneData.viewURL)):e.sceneData.viewURL=void 0,e.sceneData.metaURL=A,F.loadMetadataURL(A,x(k,B,!1),L()),e.scene=F,e.zincRenderer.setCurrentScene(F),e.graphicsHighlight.reset();const Z=F.getZincCameraControls();Z.enableRaycaster(F,m(),y()),Z.setMouseButtonAction("AUXILIARY","ZOOM"),Z.setMouseButtonAction("SECONDARY","PAN")}},this.loadGLTFFromURL=function(A,H,k){if(e.zincRenderer&&H&&e.sceneData.metaURL!==A){S(void 0,void 0,H);const B=e.sceneData.currentName;let D=e.zincRenderer.getSceneByName(B);D?k&&D.clearAll():D=e.zincRenderer.createScene(B);for(let q=0;q<o.length;q++)o[q](e.sceneData);e.sceneData.viewURL=void 0,e.sceneData.metaURL=A,D.loadGLTF(A,x(void 0,H,!1),L()),e.scene=D,e.zincRenderer.setCurrentScene(D),e.graphicsHighlight.reset();const z=D.getZincCameraControls();z.enableRaycaster(D,m(),y()),z.setMouseButtonAction("AUXILIARY","ZOOM"),z.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(A){const H=e.graphicsHighlight.getSelected();H&&H[0]&&H[0].userData&&e.scene.alignObjectToCameraView(H[0].userData,A)},this.exportSettings=function(){const A={};return A.name=e.instanceName,e.sceneData.currentSystem&&(A.system=e.sceneData.currentSystem),e.sceneData.currentSpecies&&(A.species=e.sceneData.currentSpecies),e.sceneData.currentPart&&(A.part=e.sceneData.currentPart),A.metaURL=e.sceneData.metaURL,e.sceneData.viewURL&&(A.viewURL=e.sceneData.viewURL),A.dialog="Organ Viewer",A},this.importSettings=function(A){return A&&A.dialog==this.typeName?(e.setName(A.name),A.metaURL!==void 0&&A.metaURL!=""?e.loadOrgansFromURL(A.metaURL,A.species,A.system,A.part,A.viewURL,!0):e.loadOrgans(A.species,A.system,A.part),!0):!1},function(){e.initialiseRenderer(void 0),e.zincRenderer&&(e.zincRenderer.addPreRenderCallbackFunction(d()),e.zincRenderer.addPostRenderCallbackFunction(p()))}()};TU.prototype=Object.create(ii.prototype);const VMe={name:"ScaffoldVuer",components:{Button:ed,Col:_c,Loading:OE,Option:zg,Popover:ld,Row:u0,Select:Fg,Slider:d0,TabPane:ME,Tabs:wE,MapSvgIcon:jme,MapSvgSpriteColor:ege,PrimitiveControls:RE,ScaffoldTooltip:qR,TreeControls:FE,ElIconWarningFilled:CS,ElIconArrowDown:Ph,ElIconArrowLeft:cc},props:{url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},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},markerLabels:{type:Array,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}},data:function(){return{currentTime:0,timeVarying:void 0,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1}],inHelp:!1,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:[],viewingMode:"Exploration",viewingModes:["Annotation","Exploration"],openMapRef:void 0,backgroundIconRef:void 0}},watch:{format:{handler:function(t){this.fileFormat=t},immediate:!0},url:{handler:function(t){(this.state===void 0||this.state.url===void 0)&&this.setURL(t)},immediate:!0},region:{handler:function(t){this.state||this.viewURL||this.setFocusedRegion(t)},immediate:!0},state:{handler:function(t){this.setState(t)},immediate:!0,deep:!0},viewURL:{handler:function(t){this.updateViewURL(t)},immediate:!0},helpMode:function(t){this.setHelpMode(t)},displayMarkers:function(t){this.$module.scene.displayMarkers=t,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(t){this.$module.scene.displayMinimap=t},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(t){this.toggleRendering(t)},markerLabels:function(t){this.previousMarkerLabels.forEach(e=>{this.setMarkerModeForObjectsWithName(e,"off")}),t.forEach(e=>{this.setMarkerModeForObjectsWithName(e,"on")}),this.previousMarkerLabels=t}},beforeCreate:function(){this.$module=new TU,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new Qge},created:function(){this.timeVarying=c.toRef(this.$module.sceneData,"timeVarying")},mounted:function(){this.openMapRef=c.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=c.shallowRef(this.$refs.backgroundIconRef),this.$refs.treeControls.setModule(this.$module);let t=new MMe;t.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(t),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer),this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()})},beforeDestroy:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},methods:{addZincObject:function(t){this.$module.scene&&(this.$module.scene.addZincObject(t),this.zincObjectAdded(t),this.$refs.treeControls&&this.$refs.treeControls.zincObjectAdded(t))},zincObjectAdded:function(t){this.loading=!1,this.$_searchIndex.addZincObject(t,t.uuid),this.$emit("zinc-object-added",t)},addRegionsToSearchIndex:function(){this.$module.scene.getRootRegion().getChildRegions(!0).forEach(n=>{this.$_searchIndex.addRegion(n,n.uuid)})},backgroundChangeCallback:function(t){this.currentBackground=t,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let t=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=t,e.click(),e.remove()},captureScreenshot:function(t){this.captureFilename=t,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.treeControls&&this.$refs.treeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},formatTooltip(t){if(this.timeMax>=1e3&&t){let e=(t%6e4/1e3).toFixed(2)+"s";return(t>6e4?(t/6e4).toFixed(0)+"m ":"")+e}return t?t.toFixed(2)+" ms":"0 ms"},fitWindow:function(){this.$module.scene&&this.$module.scene.viewAll()},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(t){this.currentSpeed=t,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(t){let e=[];return t&&t!=""&&this.$module.scene&&(e=this.$module.scene.findObjectsWithGroupName(t)),e},viewRegion:function(t){const e=this.$module.scene.getRootRegion(),n=Array.isArray(t)?t:[t],r=T0(e,n,"",!0);let o=this.$module.scene.getBoundingBoxOfZincObjects(r);if(o){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(o);else{const a=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(o),this.$module.scene.camera.far=this.$module.scene.camera.near+a,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(t){t&&(this.isReady?this.viewRegion(t):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:t})))},updateViewURL:function(t){if(t)if(this.isReady){const e=new URL(t,this.url);this.$module.scene.loadViewURL(e)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:t}))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let t=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,t.enableAutoTumble(),t.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},eventNotifierCallback:function(t){const e=[];let n=[];if((t.eventType==1||t.eventType==2)&&(t.identifiers.forEach(r=>{if(r){let o=r.data.id?r.data.id:r.data.group;e.push(o)}}),n=t.zincObjects),t.eventType==1)this.$refs.treeControls&&(e.length>0?this.$refs.treeControls.updateActiveUI(n):(this.hideRegionTooltip(),this.$refs.treeControls.removeActive(!0))),this.viewingMode==="Annotation"&&this.showRegionTooltipWithAnnotations(t.identifiers,!0,!0),this.$emit("scaffold-selected",t.identifiers);else if(t.eventType==2){if(this.selectedObjects.length===0){if(this.hideRegionTooltip(),this.$refs.treeControls&&(e.length>0?this.$refs.treeControls.updateHoverUI(n):this.$refs.treeControls.removeHover(!0)),t.identifiers.length>0&&t.identifiers[0]){let r=t.identifiers[0].data.id?t.identifiers[0].data.id:t.identifiers[0].data.group;t.identifiers[0].coords&&(this.tData.active=!1,this.tData.visible=!0,this.tData.label=r,t.identifiers[0].data.region?this.tData.region=t.identifiers[0].data.region:this.tData.region=void 0,this.tData.x=t.identifiers[0].coords.x,this.tData.y=t.identifiers[0].coords.y)}this.$emit("scaffold-highlighted",t.identifiers)}}else if(t.eventType==3&&t.identifiers.length>0&&t.identifiers[0]&&t.identifiers[0].coords){const r=this.$refs.scaffoldContainer.getBoundingClientRect();this.tData.x=t.identifiers[0].coords.x-r.left,this.tData.y=t.identifiers[0].coords.y-r.top}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(t){let e=t/this.timeMax*100;e!=this.currentTime&&(this.$module.updateTime(e),console.log(this.currentTime))},objectSelected:function(t,e){this.selectedObjects=t,this.selectedObjects&&this.selectedObjects.length>0&&this.$refs.primitiveControls.setObject(this.selectedObjects[0]),this.$module.setSelectedByZincObjects(t,void 0,e)},objectHovered:function(t,e){this.hoveredObjects=t,this.$module.setHighlightedByZincObjects(t,void 0,e)},changeActiveByName:function(t,e,n){const r=Array.isArray(t);if(t===void 0||r&&t.length===0)this.$refs.treeControls.removeActive(n);else{let o=t;r||(o=[o]),this.$refs.treeControls.changeActiveByNames(o,e,n)}},changeHighlightedByName:function(t,e,n){const r=Array.isArray(t);if(t===void 0||r&&t.length===0)this.$refs.treeControls.removeHover(n);else{let o=t;r||(o=[o]),this.$refs.treeControls.changeHoverByNames(o,e,n)}},play:function(t){this.$module.playAnimation(t),this.isPlaying=t},setHelpMode:function(t){t?(this.inHelp=!0,this.hoverVisibilities.forEach(e=>{e.value=!0})):(this.inHelp=!1,this.hoverVisibilities.forEach(e=>{e.value=!1}))},displayTooltipOfObjectsCallback:function(t,e,n,r,o){const a=this;return function(){a.$module.zincRenderer.removePostRenderCallbackFunction(a.$_regionTooltipCallback),a.$_regionTooltipCallback=void 0,a.displayTooltipOfObjects(t,e,n,r,o)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(t,e,n,r,o){if(e.length>0){let a=e[0].getClosestVertexDOMElementCoords(this.$module.scene);if(a)return a.inView?(t.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=t,this.tData.x=a.position.x,this.tData.y=a.position.y,this.tData.region=n,this.$_liveCoordinatesUpdated&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),o&&(this.$module.setupLiveCoordinates(e),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),r&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(t,e,n,r,o)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(t,e,n,r,o){return t&&e&&e.length>0&&this.$module.scene?this.displayTooltipOfObjects(t,e,n,r,o):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(t,e,n){if(t&&this.$module.scene){const r=this.$module.scene.getRootRegion(),a=T0(r,[t],"",!0);let l;return a&&a.length>0&&(l=a[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(t,a,l,e,n)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(t,e,n){if(this.$module.scene){const r=DE(this.$module.scene,t);if(r&&r.objects.length>0)return this.showRegionTooltipWithObjects(r.label,r.objects,r.regionPath,e,n)}return this.hideRegionTooltip(),!1},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(t,e){if(t&&this.$module.scene){const n=this.$module.scene.getRootRegion();T0(n,[t],"",!0).forEach(a=>a.setMarkerMode(e))}},setMarkerModeWithAnnotations:function(t,e){if(this.$module.scene){const n=DE(this.$module.scene,t);n&&n.objects.length>0&&n.objects.forEach(r=>r.setMarkerMode(e))}},showHelpText:function(t){this.inHelp||(this.helpTextWait=setTimeout(()=>{this.hoverVisibilities[t].value=!0},500))},hideHelpText:function(t){this.inHelp||(this.hoverVisibilities[t].value=!1,clearTimeout(this.helpTextWait))},search:function(t,e){if(this.$_searchIndex){if(t===void 0||t===""||Array.isArray(t)&&t.length===0)return this.objectSelected([],!0),!1;{const n=this.$_searchIndex.searchAndProcessResult(t),r=n.zincObjects;if(r.length>0){if(this.objectSelected(r,!0),e)for(let o=0;o<r.length;o++)r[o]&&r[o].groupName&&this.showRegionTooltipWithObjects(n.label,r,n.regionPath,!0,!0);return!0}else this.objectSelected([],!0)}}return!1},fetchSuggestions:function(t){return this.$_searchIndex===void 0?[]:this.$_searchIndex.auto_suggest(t)},updateMinimapScissor:function(){Object.keys(this.minimapSettings).forEach(t=>{this.$module.scene.minimapScissor[t]=this.minimapSettings[t]}),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 t=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const e in t)this.timeStamps[t[e]]=e;this.timeMax=this.$module.scene.getDuration()},setURLFinishCallback:function(t){return()=>{if(t){if(t.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(t.viewport);else if(t.viewURL&&t.viewURL!==""){const e=new URL(t.viewURL,this.url);this.$module.scene.loadViewURL(e)}else t.region&&t.region!==""&&this.viewRegion(t.region);t.visibility&&this.$nextTick(()=>{this.$refs.treeControls.setState(t.visibility)})}this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.$emit("on-ready"),this.setMarkers(),this.isReady=!0}},getState:function(){let t={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0};if(this.$refs.treeControls&&(t.visibility=this.$refs.treeControls.getState()),this.$module.scene){let e=this.$module.scene.getZincCameraControls();t.viewport=e.getCurrentViewport()}return t},setState:function(t){t&&(t.url&&t.url!==this._currentURL?this.setURLAndState(t.url,{fileFormat:t.fileFormat,viewport:t.viewport,visibility:t.visibility}):(t.viewport||t.visibility)&&(this.isReady&&this.$module.scene?(t.viewport&&this.$module.scene.getZincCameraControls().setCurrentCameraSettings(t.viewport),t.visibility&&this.$refs.treeControls.setState(t.visibility)):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewport:t.viewport,visibility:t.visibility}))))},exportGLTF:function(t){return this.$module.scene.exportGLTF(t)},setURLAndState:function(t,e){if(t!=this._currentURL){e&&e.format&&(this.fileFormat=e.format);let n=e&&e.viewport?e.viewport:void 0,r=e&&e.visibility?e.visibility:void 0;this._currentURL=t,this.$refs.treeControls&&this.$refs.treeControls.clear(),this.loading=!0,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewport:n,region:this.region,viewURL:this.viewURL,visibility:r})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(t,"scene",!0):this.$module.loadOrgansFromURL(t,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(t){this.setURLAndState(t,void 0)},drawerToggled:function(t){this.drawerOpen=t,this.adjustLayout()},adjustLayout:function(){let t=this.$refs.scaffoldContainer.clientWidth;this.minimisedSlider=t<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""},toggleRendering:function(t){this.$module.zincRenderer&&(t?this.$module.zincRenderer.animate():this.$module.zincRenderer.stopAnimate())},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const t=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",t)},toggleSyncControl:function(t,e){this.$module.toggleSyncControl(t,e),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){this.markerLabels.forEach(t=>{this.setMarkerModeForObjectsWithName(t,"on")})}}},cw=t=>(c.pushScopeId("data-v-bcaab96b"),t=t(),c.popScopeId(),t),OMe={ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},kMe=cw(()=>c.createElementVNode("span",{class:"message-text"},"Beta",-1)),PMe=cw(()=>c.createElementVNode("span",{class:"message-text"},"What's new?",-1)),IMe={class:"primitive-controls-box"},RMe={class:"animation-data"},NMe={class:"purple"},BMe={class:"animation-data"},DMe={class:"purple"},FMe={class:"animation-data"},zMe={class:"bottom-right-control"},UMe=cw(()=>c.createElementVNode("div",null,[c.createTextVNode(" Fit to "),c.createElementVNode("br"),c.createTextVNode(" window ")],-1)),jMe=["onClick"];function GMe(t,e,n,r,o,a){const l=c.resolveComponent("map-svg-sprite-color"),s=qR,h=CS,u=zr,d=ld,p=FE,f=RE,m=c.resolveComponent("map-svg-icon"),y=d0,v=u0,_=ME,x=zg,L=Fg,S=wE,C=ed,A=_c,H=Td;return c.withDirectives((c.openBlock(),c.createElementBlock("div",OMe,[c.createVNode(l),c.createVNode(s,{label:t.tData.label,region:t.tData.region,visible:t.tData.visible,x:t.tData.x,y:t.tData.y,annotationDisplay:t.viewingMode==="Annotation"&&t.tData.active===!0},null,8,["label","region","visible","x","y","annotationDisplay"]),c.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:e[0]||(e[0]=c.withKeys((...k)=>a.backgroundChangeCallback&&a.backgroundChangeCallback(...k),["66"]))},null,544),c.withDirectives(c.createElementVNode("div",null,[n.displayWarning?(c.openBlock(),c.createBlock(d,{key:0,ref:"warningPopover",visible:t.hoverVisibilities[6].value,content:n.warningMessage,placement:"right",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:c.withCtx(()=>[n.displayWarning?(c.openBlock(),c.createElementBlock("div",{key:0,class:"message-icon warning-icon",onMouseover:e[1]||(e[1]=k=>a.showHelpText(6)),onMouseout:e[2]||(e[2]=k=>a.hideHelpText(6))},[c.createVNode(u,null,{default:c.withCtx(()=>[c.createVNode(h)]),_:1}),kMe],32)):c.createCommentVNode("",!0)]),_:1},8,["visible","content"])):c.createCommentVNode("",!0),n.displayLatestChanges?(c.openBlock(),c.createBlock(d,{key:1,visible:t.hoverVisibilities[7].value,content:n.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:c.withCtx(()=>[n.displayLatestChanges&&n.latestChangesMessage?(c.openBlock(),c.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon",onMouseover:e[3]||(e[3]=k=>a.showHelpText(7)),onMouseout:e[4]||(e[4]=k=>a.hideHelpText(7))},[c.createVNode(u,null,{default:c.withCtx(()=>[c.createVNode(h)]),_:1}),PMe],32)):c.createCommentVNode("",!0)]),_:1},8,["visible","content"])):c.createCommentVNode("",!0),c.createVNode(d,{visible:t.hoverVisibilities[5].value,content:"Change region visibility",placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable"},{reference:c.withCtx(()=>[c.createVNode(p,{ref:"treeControls","help-mode":n.helpMode,isReady:t.isReady,"show-colour-picker":n.showColourPicker,onObjectSelected:a.objectSelected,onObjectHovered:a.objectHovered,onDrawerToggled:a.drawerToggled},null,8,["help-mode","isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),c.createElementVNode("div",IMe,[c.createVNode(f,{ref:"primitiveControls"},null,512)]),t.timeVarying?(c.openBlock(),c.createBlock(d,{key:2,ref:"sliderPopover",visible:t.hoverVisibilities[4].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:c.withCtx(()=>[t.timeVarying?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["time-slider-container",[t.minimisedSlider?"minimised":"",t.sliderPosition]])},[c.createVNode(S,{type:"card"},{default:c.withCtx(()=>[c.createVNode(_,{label:"Animate scaffold"},{default:c.withCtx(()=>[c.createVNode(v,{class:"tab-content"},{default:c.withCtx(()=>[t.isPlaying?(c.openBlock(),c.createBlock(m,{key:0,icon:"pause",class:"icon-button video-button",onClick:e[5]||(e[5]=k=>a.play(!1))})):(c.openBlock(),c.createBlock(m,{key:1,icon:"play",class:"video-button icon-button",onClick:e[6]||(e[6]=k=>a.play(!0))})),c.createVNode(y,{min:0,max:t.timeMax,"model-value":t.currentTime/100*t.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":a.formatTooltip,marks:t.timeStamps,onInput:e[7]||(e[7]=k=>a.timeChange(k))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),c.createVNode(_,{label:"Animation data"},{default:c.withCtx(()=>[c.createVNode(v,{class:"tab-content"},{default:c.withCtx(()=>[c.createElementVNode("div",RMe,[c.createTextVNode(" Original duration: "),c.createElementVNode("div",NMe,c.toDisplayString(t.orginalDuration),1)]),c.createElementVNode("div",BMe,[c.createTextVNode(" Animation duration: "),c.createElementVNode("div",DMe,c.toDisplayString(t.animateDuration),1)]),c.createElementVNode("div",FMe,[c.createTextVNode(" Playback speed "),c.createVNode(L,{teleported:!0,"model-value":t.currentSpeed,placeholder:"Select",class:"select-box","popper-class":"scaffold_viewer_dropdown",onChange:e[8]||(e[8]=k=>a.speedChanged(k))},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(t.playSpeed,k=>(c.openBlock(),c.createBlock(x,{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):c.createCommentVNode("",!0)]),_:1},8,["visible"])):c.createCommentVNode("",!0),c.createElementVNode("div",zMe,[c.createVNode(d,{visible:t.hoverVisibilities[0].value,content:"Zoom in",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable"},{reference:c.withCtx(()=>[c.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[9]||(e[9]=k=>a.zoomIn()),onMouseover:e[10]||(e[10]=k=>a.showHelpText(0)),onMouseout:e[11]||(e[11]=k=>a.hideHelpText(0))})]),_:1},8,["visible"]),c.createVNode(d,{visible:t.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable"},{reference:c.withCtx(()=>[c.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[12]||(e[12]=k=>a.zoomOut()),onMouseover:e[13]||(e[13]=k=>a.showHelpText(1)),onMouseout:e[14]||(e[14]=k=>a.hideHelpText(1))})]),_:1},8,["visible"]),c.createVNode(d,{visible:t.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper non-selectable"},{reference:c.withCtx(()=>[c.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[15]||(e[15]=k=>a.fitWindow()),onMouseover:e[16]||(e[16]=k=>a.showHelpText(2)),onMouseout:e[17]||(e[17]=k=>a.hideHelpText(2))})]),default:c.withCtx(()=>[UMe]),_:1},8,["visible"])]),t.openMapRef?(c.openBlock(),c.createBlock(d,{key:3,ref:"open-map-popover","virtual-ref":t.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.openMapOptions,k=>(c.openBlock(),c.createBlock(v,{key:k.key},{default:c.withCtx(()=>[c.createVNode(C,{type:"primary",plain:"",onClick:B=>t.$emit("open-map",k.key)},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(k.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):c.createCommentVNode("",!0),c.createVNode(d,{ref:"backgroundPopover","virtual-ref":t.backgroundIconRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable","virtual-triggering":""},{default:c.withCtx(()=>[c.createElementVNode("div",null,[c.createVNode(v,{class:"backgroundText"},{default:c.withCtx(()=>[c.createTextVNode("Viewing Mode")]),_:1}),c.createVNode(v,{class:"backgroundControl"},{default:c.withCtx(()=>[c.createVNode(L,{teleported:!1,modelValue:t.viewingMode,"onUpdate:modelValue":e[18]||(e[18]=k=>t.viewingMode=k),placeholder:"Select",class:"select-box viewing-mode","popper-class":"scaffold_viewer_dropdown"},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(t.viewingModes,k=>(c.openBlock(),c.createBlock(x,{key:k,label:k,value:k},{default:c.withCtx(()=>[c.createVNode(v,null,{default:c.withCtx(()=>[c.createVNode(A,{span:12},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(k),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),c.createVNode(v,{class:"backgroundSpacer"}),c.createVNode(v,{class:"backgroundText"},{default:c.withCtx(()=>[c.createTextVNode(" Change background ")]),_:1}),c.createVNode(v,{class:"backgroundChooser"},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(t.availableBackground,k=>(c.openBlock(),c.createElementBlock("div",{key:k,class:c.normalizeClass(["backgroundChoice",k,k==t.currentBackground?"active":""]),onClick:B=>a.backgroundChangeCallback(k)},null,10,jMe))),128))]),_:1})])]),_:1},8,["virtual-ref"]),c.createElementVNode("div",{class:c.normalizeClass(["settings-group",{open:t.drawerOpen,close:!t.drawerOpen}])},[c.createVNode(v,null,{default:c.withCtx(()=>[c.createVNode(d,{visible:t.hoverVisibilities[8].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable"},{reference:c.withCtx(()=>[n.enableOpenMapUI&&n.openMapOptions.length>0?(c.openBlock(),c.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[19]||(e[19]=k=>a.showHelpText(8)),onMouseout:e[20]||(e[20]=k=>a.hideHelpText(8))},null,512)):c.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),c.createVNode(v,null,{default:c.withCtx(()=>[c.createVNode(d,{visible:t.hoverVisibilities[3].value,content:"Change background color",placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable"},{reference:c.withCtx(()=>[c.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[21]||(e[21]=k=>a.showHelpText(3)),onMouseout:e[22]||(e[22]=k=>a.hideHelpText(3))},null,512)]),_:1},8,["visible"])]),_:1})],2)],512),[[c.vShow,n.displayUI&&!t.isTransitioning]])])),[[H,t.loading]])}const WMe=f0(VMe,[["render",GMe],["__scopeId","data-v-bcaab96b"]]);$r.ScaffoldVuer=WMe,Object.defineProperty($r,Symbol.toStringTag,{value:"Module"})});
|