@xtctwins/tctwins-core 1.1.2 → 1.1.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.
|
@@ -14,7 +14,7 @@ var e=r().mark(Vx),t=r().mark(ek);function i(e,t){var i=Object.keys(e);if(Object
|
|
|
14
14
|
/**
|
|
15
15
|
* @author https://github.com/tmarti, with support from https://tribia.com/
|
|
16
16
|
* @license MIT
|
|
17
|
-
**/var Hc=8,jc=null;function Gc(e,t){var i,s,r,n,o,a,l=3*e,u=3*t,A=Math.min(i=jc[l],s=jc[l+1],r=jc[l+2]),c=Math.min(n=jc[u],o=jc[u+1],a=jc[u+2]);if(A!==c)return A-c;var h=Math.max(i,s,r),d=Math.max(n,o,a);return h!==d?h-d:0}var zc=null;function Wc(e,t){var i=zc[2*e]-zc[2*t];return 0!==i?i:zc[2*e+1]-zc[2*t+1]}function Kc(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=e.positionsCompressed||[],r=function(e,t){for(var i=new Int32Array(e.length/3),s=0,r=i.length;s<r;s++)i[s]=s;jc=new Int32Array(e.length);for(var n=0,o=e.length;n<o;n++)jc[n]=e[n]>>t;i.sort(Gc);for(var a=new Int32Array(e.length),l=0,u=i.length;l<u;l++)a[3*l+0]=e[3*i[l]+0],a[3*l+1]=e[3*i[l]+1],a[3*l+2]=e[3*i[l]+2];return a}(e.indices||[],t),n=function(e){if(0===(e||[]).length)return[];for(var t=new Int32Array(e.length/2),i=0,s=t.length;i<s;i++)t[i]=i;for(var r=0,n=e.length;r<n;r+=2)if(e[r]>e[r+1]){var o=e[r];e[r]=e[r+1],e[r+1]=o}zc=new Int32Array(e),t.sort(Wc);for(var a=new Int32Array(e.length),l=0,u=t.length;l<u;l++)a[2*l+0]=e[2*t[l]+0],a[2*l+1]=e[2*t[l]+1];return a}(e.edgeIndices||[]);function o(e,t){if(e>t){var i=e;e=t,t=i}function s(i,s){return i!==e?e-i:s!==t?t-s:0}for(var r=0,o=(n.length>>1)-1;r<=o;){var a=o+r>>1,l=s(n[2*a],n[2*a+1]);if(l>0)r=a+1;else{if(!(l<0))return a;o=a-1}}return-r-1}var a=new Int32Array(n.length/2);a.fill(0);var l=s.length/3;if(l>(1<<t)*Hc)return[e];var u=new Int32Array(l);u.fill(-1);var A=[];function c(){u.fill(-1);var e={positionsCompressed:[],indices:[],edgeIndices:[],maxNumPositions:(1<<t)-t,numPositions:0,bucketNumber:A.length};return A.push(e),e}for(var h=c(),d=0,p=r.length;d<p;d+=3){var f=0,v=r[d],g=r[d+1],m=r[d+2];if(-1===u[v]&&f++,-1===u[g]&&f++,-1===u[m]&&f++,f+h.numPositions>h.maxNumPositions&&(h=c()),h.bucketNumber>Hc)return[e];-1===u[v]&&(u[v]=h.numPositions++,h.positionsCompressed.push(s[3*v]),h.positionsCompressed.push(s[3*v+1]),h.positionsCompressed.push(s[3*v+2])),-1===u[g]&&(u[g]=h.numPositions++,h.positionsCompressed.push(s[3*g]),h.positionsCompressed.push(s[3*g+1]),h.positionsCompressed.push(s[3*g+2])),-1===u[m]&&(u[m]=h.numPositions++,h.positionsCompressed.push(s[3*m]),h.positionsCompressed.push(s[3*m+1]),h.positionsCompressed.push(s[3*m+2])),h.indices.push(u[v]),h.indices.push(u[g]),h.indices.push(u[m]);var _=void 0;(_=o(v,g))>=0&&0===a[_]&&(a[_]=1,h.edgeIndices.push(u[n[2*_]]),h.edgeIndices.push(u[n[2*_+1]])),(_=o(v,m))>=0&&0===a[_]&&(a[_]=1,h.edgeIndices.push(u[n[2*_]]),h.edgeIndices.push(u[n[2*_+1]])),(_=o(g,m))>=0&&0===a[_]&&(a[_]=1,h.edgeIndices.push(u[n[2*_]]),h.edgeIndices.push(u[n[2*_+1]]))}var y=t/8*2,b=t/8,B=2*s.length+(r.length+n.length)*y,x=0;s.length;return A.forEach((function(e){x+=2*e.positionsCompressed.length+(e.indices.length+e.edgeIndices.length)*b,e.positionsCompressed.length/3})),x>B?[e]:(i&&function(e,t){var i={};e.forEach((function(e){for(var t=e.indices,s=e.edgeIndices,r=e.positionsCompressed,n=0,o=t.length;n<o;n+=3){var a=r[3*t[n]]+"_"+r[3*t[n]+1]+"_"+r[3*t[n]+2]+"/"+r[3*t[n+1]]+"_"+r[3*t[n+1]+1]+"_"+r[3*t[n+1]+2]+"/"+r[3*t[n+2]]+"_"+r[3*t[n+2]+1]+"_"+r[3*t[n+2]+2];i[a]=!0}e.edgeIndices.length/2;for(var l=0,u=s.length;l<u;l+=2)r[3*s[l]],r[3*s[l]+1],r[3*s[l]+2],r[3*s[l+1]],r[3*s[l+1]+1],r[3*s[l+1]+2]}));var s=t.indices;t.edgeIndices;for(var r=t.positionsCompressed,n=0,o=s.length;n<o;n+=3){var a=r[3*s[n]]+"_"+r[3*s[n]+1]+"_"+r[3*s[n]+2]+"/"+r[3*s[n+1]]+"_"+r[3*s[n+1]+1]+"_"+r[3*s[n+1]+2]+"/"+r[3*s[n+2]]+"_"+r[3*s[n+2]+1]+"_"+r[3*s[n+2]+2];if(!(a in i))throw console.log("Not found "+a),"Ohhhh!"}}(A,e),A)}var Xc=J.vec4(4),Yc=J.vec4(),Jc=J.vec4(),Zc=J.vec3([1,0,0]),qc=J.vec3([0,1,0]),$c=J.vec3([0,0,1]);J.vec3(3),J.vec3(3);var eh=J.identityMat4(),th=function(){return w((function e(t){B(this,e),this._model=t.model,this.id=t.id,this._parentTransform=t.parent,this._childTransforms=[],this._meshes=[],this._scale=new Float32Array([1,1,1]),this._quaternion=J.identityQuaternion(new Float32Array(4)),this._rotation=new Float32Array(3),this._position=new Float32Array(3),this._localMatrix=J.identityMat4(new Float32Array(16)),this._worldMatrix=J.identityMat4(new Float32Array(16)),this._localMatrixDirty=!0,this._worldMatrixDirty=!0,t.matrix?this.matrix=t.matrix:(this.scale=t.scale,this.position=t.position,t.quaternion||(this.rotation=t.rotation)),t.parent&&t.parent._addChildTransform(this)}),[{key:"_addChildTransform",value:function(e){this._childTransforms.push(e),e._parentTransform=this,e._setWorldMatrixDirty(),e._setAABBDirty()}},{key:"_addMesh",value:function(e){this._meshes.push(e),e.transform=this}},{key:"parentTransform",get:function(){return this._parentTransform}},{key:"meshes",get:function(){return this._meshes}},{key:"position",get:function(){return this._position},set:function(e){this._position.set(e||[0,0,0]),this._setLocalMatrixDirty(),this._model.glRedraw()}},{key:"rotation",get:function(){return this._rotation},set:function(e){this._rotation.set(e||[0,0,0]),J.eulerToQuaternion(this._rotation,"XYZ",this._quaternion),this._setLocalMatrixDirty(),this._model.glRedraw()}},{key:"quaternion",get:function(){return this._quaternion},set:function(e){this._quaternion.set(e||[0,0,0,1]),J.quaternionToEuler(this._quaternion,"XYZ",this._rotation),this._setLocalMatrixDirty(),this._model.glRedraw()}},{key:"scale",get:function(){return this._scale},set:function(e){this._scale.set(e||[1,1,1]),this._setLocalMatrixDirty(),this._model.glRedraw()}},{key:"matrix",get:function(){return this._localMatrixDirty&&(this._localMatrix||(this._localMatrix=J.identityMat4()),J.composeMat4(this._position,this._quaternion,this._scale,this._localMatrix),this._localMatrixDirty=!1),this._localMatrix},set:function(e){this._localMatrix||(this._localMatrix=J.identityMat4()),this._localMatrix.set(e||eh),J.decomposeMat4(this._localMatrix,this._position,this._quaternion,this._scale),this._localMatrixDirty=!1,this._transformDirty(),this._model.glRedraw()}},{key:"worldMatrix",get:function(){return this._worldMatrixDirty&&this._buildWorldMatrix(),this._worldMatrix}},{key:"rotate",value:function(e,t){return Xc[0]=e[0],Xc[1]=e[1],Xc[2]=e[2],Xc[3]=t*J.DEGTORAD,J.angleAxisToQuaternion(Xc,Yc),J.mulQuaternions(this.quaternion,Yc,Jc),this.quaternion=Jc,this._setLocalMatrixDirty(),this._model.glRedraw(),this}},{key:"rotateOnWorldAxis",value:function(e,t){return Xc[0]=e[0],Xc[1]=e[1],Xc[2]=e[2],Xc[3]=t*J.DEGTORAD,J.angleAxisToQuaternion(Xc,Yc),J.mulQuaternions(Yc,this.quaternion,Yc),this}},{key:"rotateX",value:function(e){return this.rotate(Zc,e)}},{key:"rotateY",value:function(e){return this.rotate(qc,e)}},{key:"rotateZ",value:function(e){return this.rotate($c,e)}},{key:"translate",value:function(e){return this._position[0]+=e[0],this._position[1]+=e[1],this._position[2]+=e[2],this._setLocalMatrixDirty(),this._model.glRedraw(),this}},{key:"translateX",value:function(e){return this._position[0]+=e,this._setLocalMatrixDirty(),this._model.glRedraw(),this}},{key:"translateY",value:function(e){return this._position[1]+=e,this._setLocalMatrixDirty(),this._model.glRedraw(),this}},{key:"translateZ",value:function(e){return this._position[2]+=e,this._setLocalMatrixDirty(),this._model.glRedraw(),this}},{key:"_setLocalMatrixDirty",value:function(){this._localMatrixDirty=!0,this._transformDirty()}},{key:"_transformDirty",value:function(){this._worldMatrixDirty=!0;for(var e=0,t=this._childTransforms.length;e<t;e++){var i=this._childTransforms[e];if(i._transformDirty(),i._meshes&&i._meshes.length>0)for(var s=i._meshes,r=0,n=s.length;r<n;r++)s[r]._transformDirty()}if(this._meshes&&this._meshes.length>0)for(var o=this._meshes,a=0,l=o.length;a<l;a++)o[a]._transformDirty()}},{key:"_buildWorldMatrix",value:function(){var e=this.matrix;if(this._parentTransform)J.mulMat4(this._parentTransform.worldMatrix,e,this._worldMatrix);else for(var t=0,i=e.length;t<i;t++)this._worldMatrix[t]=e[t];this._worldMatrixDirty=!1}},{key:"_setSubtreeAABBsDirty",value:function(e){if(e._aabbDirty=!0,e._childTransforms)for(var t=0,i=e._childTransforms.length;t<i;t++)this._setSubtreeAABBsDirty(e._childTransforms[t])}}])}(),ih=J.vec3(),sh=J.OBB3(),rh=J.vec4(),nh=J.vec3([1,1,1]),oh=J.vec3([0,0,0]);J.vec3([0,0,0]);var ah=J.identityQuaternion(),lh=J.identityMat4(),uh="defaultColorTexture",Ah="defaultMetalRoughTexture",ch="defaultNormalsTexture",hh="defaultEmissiveTexture",dh="defaultOcclusionTexture",ph="defaultTextureSet",fh=new Uint8Array([255,255,255]),vh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s])).renderOrder=s.renderOrder||0,i._dtxEnabled=i.scene.dtxEnabled&&!1!==s.dtxEnabled,i._enableVertexWelding=!1,i._enableIndexBucketing=!1,i._vboBatchingLayerScratchMemory=(no++,ro),i._textureTranscoder=s.textureTranscoder||Uc(i.scene.viewer),i._maxGeometryBatchSize=s.maxGeometryBatchSize,i._aabb=J.collapseAABB3(),i._aabbDirty=!0,i._aabbUpdate=!1,i._exceptionIds=[],i._quantizationRanges={},i._vboInstancingLayers={},i._vboBatchingLayers={},i._dtxLayers={},i._meshList=[],i.layerList=[],i._layersToFinalize=[],i._entityList=[],i._entitiesToFinalize=[],i._geometries={},i._dtxBuckets={},i._textures={},i._textureSets={},i._transforms={},i._meshes={},i._unusedMeshes={},i._entities={},i._scheduledMeshes={},i._meshesCfgsBeforeMeshCreation={},i.renderFlags=new Kr,i.numGeometries=0,i.numPortions=0,i.numVisibleLayerPortions=0,i.numTransparentLayerPortions=0,i.numXRayedLayerPortions=0,i.numHighlightedLayerPortions=0,i.numSelectedLayerPortions=0,i.numEdgesLayerPortions=0,i.numPickableLayerPortions=0,i.numClippableLayerPortions=0,i.numCulledLayerPortions=0,i.numEntities=0,i._numTriangles=0,i._numLines=0,i._numPoints=0,i._layersFinalized=!1,i._edgeThreshold=s.edgeThreshold||10,i._origin=J.vec3(s.origin||[0,0,0]),i._position=J.vec3(s.position||[0,0,0]),i._rotation=J.vec3(s.rotation||[0,0,0]),i._quaternion=J.vec4(s.quaternion||[0,0,0,1]),i._conjugateQuaternion=J.vec4(s.quaternion||[0,0,0,1]),s.rotation&&J.eulerToQuaternion(i._rotation,"XYZ",i._quaternion),i._scale=J.vec3(s.scale||[1,1,1]),i._worldRotationMatrix=J.mat4(),i._worldRotationMatrixConjugate=J.mat4(),i._matrix=J.mat4(),i._matrixDirty=!0,i._rebuildMatrices(),i._worldNormalMatrix=J.mat4(),J.inverseMat4(i._matrix,i._worldNormalMatrix),J.transposeMat4(i._worldNormalMatrix),(s.matrix||s.position||s.rotation||s.scale||s.quaternion)&&(i._viewMatrix=J.mat4(),i._viewNormalMatrix=J.mat4(),i._viewMatrixDirty=!0,i._matrixNonIdentity=!0),i._opacity=1,i._colorize=[1,1,1],i._saoEnabled=!1!==s.saoEnabled,i._pbrEnabled=!1!==s.pbrEnabled,i._colorTextureEnabled=!1!==s.colorTextureEnabled,i._isModel=s.isModel,i._isModel&&i.scene._registerModel(i),i._onCameraViewMatrix=i.scene.camera.on("matrix",(function(){i._viewMatrixDirty=!0})),i._meshesWithDirtyMatrices=[],i._numMeshesWithDirtyMatrices=0,i._onTick=i.scene.on("tick",(function(){for(;i._numMeshesWithDirtyMatrices>0;)i._meshesWithDirtyMatrices[--i._numMeshesWithDirtyMatrices]._updateMatrix()})),i._createDefaultTextureSet(),i.visible=s.visible,i.culled=s.culled,i.pickable=s.pickable,i.clippable=s.clippable,i.collidable=s.collidable,i.castsShadow=s.castsShadow,i.receivesShadow=s.receivesShadow,i.xrayed=s.xrayed,i.highlighted=s.highlighted,i.selected=s.selected,i.edges=s.edges,i.colorize=s.colorize,i.opacity=s.opacity,i.backfaces=s.backfaces,i}return m(t,_e),w(t,[{key:"_meshMatrixDirty",value:function(e){this._meshesWithDirtyMatrices[this._numMeshesWithDirtyMatrices++]=e}},{key:"_createDefaultTextureSet",value:function(){var e=new Cc({id:uh,texture:new In({gl:this.scene.canvas.gl,preloadColor:[1,1,1,1]})}),t=new Cc({id:Ah,texture:new In({gl:this.scene.canvas.gl,preloadColor:[0,1,1,1]})}),i=new Cc({id:ch,texture:new In({gl:this.scene.canvas.gl,preloadColor:[0,0,0,0]})}),s=new Cc({id:hh,texture:new In({gl:this.scene.canvas.gl,preloadColor:[0,0,0,1]})}),r=new Cc({id:dh,texture:new In({gl:this.scene.canvas.gl,preloadColor:[1,1,1,1]})});this._textures[uh]=e,this._textures[Ah]=t,this._textures[ch]=i,this._textures[hh]=s,this._textures[dh]=r,this._textureSets[ph]=new Pc({id:ph,model:this,colorTexture:e,metallicRoughnessTexture:t,normalsTexture:i,emissiveTexture:s,occlusionTexture:r})}},{key:"isPerformanceModel",get:function(){return!0}},{key:"transforms",get:function(){return this._transforms}},{key:"textures",get:function(){return this._textures}},{key:"textureSets",get:function(){return this._textureSets}},{key:"meshes",get:function(){return this._meshes}},{key:"objects",get:function(){return this._entities}},{key:"origin",get:function(){return this._origin}},{key:"position",get:function(){return this._position},set:function(e){this._position.set(e||[0,0,0]),this._setWorldMatrixDirty(),this._sceneModelDirty(),this.glRedraw()}},{key:"rotation",get:function(){return this._rotation},set:function(e){this._rotation.set(e||[0,0,0]),J.eulerToQuaternion(this._rotation,"XYZ",this._quaternion),this._setWorldMatrixDirty(),this._sceneModelDirty(),this.glRedraw()}},{key:"quaternion",get:function(){return this._quaternion},set:function(e){this._quaternion.set(e||[0,0,0,1]),J.quaternionToEuler(this._quaternion,"XYZ",this._rotation),this._setWorldMatrixDirty(),this._sceneModelDirty(),this.glRedraw()}},{key:"scale",get:function(){return this._scale},set:function(e){}},{key:"matrix",get:function(){return this._rebuildMatrices(),this._matrix},set:function(e){this._matrix.set(e||lh),J.decomposeMat4(this._matrix,this._position,this._quaternion,this._scale),this._matrixDirty=!1,this._setWorldMatrixDirty(),this._sceneModelDirty(),this.glRedraw()}},{key:"rotationMatrix",get:function(){return this._rebuildMatrices(),this._worldRotationMatrix}},{key:"_rebuildMatrices",value:function(){this._matrixDirty&&(J.quaternionToRotationMat4(this._quaternion,this._worldRotationMatrix),J.conjugateQuaternion(this._quaternion,this._conjugateQuaternion),J.quaternionToRotationMat4(this._conjugateQuaternion,this._worldRotationMatrixConjugate),J.scaleMat4v(this._scale,this._worldRotationMatrix),J.scaleMat4v(this._scale,this._worldRotationMatrixConjugate),this._matrix.set(this._worldRotationMatrix),J.translateMat4v(this._position,this._matrix),this._matrixDirty=!1,this._viewMatrixDirty=!0)}},{key:"rotationMatrixConjugate",get:function(){return this._rebuildMatrices(),this._worldRotationMatrixConjugate}},{key:"_setWorldMatrixDirty",value:function(){this._matrixDirty=!0,this._aabbDirty=!0}},{key:"_transformDirty",value:function(){this._matrixDirty=!0,this._aabbDirty=!0,this.scene._aabbDirty=!0}},{key:"_sceneModelDirty",value:function(){this.scene._aabbDirty=!0,this._aabbDirty=!0,this.scene._aabbDirty=!0,this._matrixDirty=!0;for(var e=0,t=this._entityList.length;e<t;e++)this._entityList[e]._sceneModelDirty()}},{key:"worldMatrix",get:function(){return this.matrix}},{key:"worldNormalMatrix",get:function(){return this._worldNormalMatrix}},{key:"_rebuildViewMatrices",value:function(){this._rebuildMatrices(),this._viewMatrixDirty&&(J.mulMat4(this.scene.camera.viewMatrix,this._matrix,this._viewMatrix),J.inverseMat4(this._viewMatrix,this._viewNormalMatrix),J.transposeMat4(this._viewNormalMatrix),this._viewMatrixDirty=!1)}},{key:"viewMatrix",get:function(){return this._viewMatrix?(this._rebuildViewMatrices(),this._viewMatrix):this.scene.camera.viewMatrix}},{key:"viewNormalMatrix",get:function(){return this._viewNormalMatrix?(this._rebuildViewMatrices(),this._viewNormalMatrix):this.scene.camera.viewNormalMatrix}},{key:"backfaces",get:function(){return this._backfaces},set:function(e){e=!!e,this._backfaces=e,this.glRedraw()}},{key:"entityList",get:function(){return this._entityList}},{key:"isEntity",get:function(){return!0}},{key:"isModel",get:function(){return this._isModel}},{key:"isObject",get:function(){return!1}},{key:"aabb",get:function(){if(this._aabbDirty){if(this._aabbUpdate)return this._aabb;if(this._exceptionIds.length>0)this.updateAABBCullException(this._exceptionIds);else{J.collapseAABB3(this._aabb);for(var e=0,t=this._entityList.length;e<t;e++)J.expandAABB3(this._aabb,this._entityList[e].aabb)}this._aabbDirty=!1}return this._aabb}},{key:"exceptionIds",get:function(){return this._exceptionIds},set:function(e){this._exceptionIds=e,this._aabbDirty=!0,this._aabbUpdate=!1,this.scene._setAABBDirty()}},{key:"updateAABBCullException",value:function(e,t){function i(t){var i=!0;return e.forEach((function(e){e===t&&(i=!1)})),i}for(var s=J.collapseAABB3(),r=0,n=this._entityList.length;r<n;r++)i(this._entityList[r].id)&&J.expandAABB3(s,this._entityList[r].aabb);for(var o=0;o<s.length;o++)this._aabb[o]=s[o];this._aabbDirty=!1,this._aabbUpdate=!0,this.scene._setAABBDirty(),"function"==typeof t&&t()}},{key:"cancelCullException",value:function(e){this._exceptionIds=[],this._aabbDirty=!0,this._aabbUpdate=!1,this.aabb,this.scene._aabbUpdate=!1,this.scene._setAABBDirty(),"function"==typeof e&&e()}},{key:"aabbs",get:function(){for(var e=[],t=0,i=this._entityList.length;t<i;t++)e.push(this._entityList[t].aabb);return e}},{key:"numTriangles",get:function(){return this._numTriangles}},{key:"numLines",get:function(){return this._numLines}},{key:"numPoints",get:function(){return this._numPoints}},{key:"visible",get:function(){return this.numVisibleLayerPortions>0},set:function(e){e=!1!==e,this._visible=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].visible=e;this.glRedraw()}},{key:"xrayed",get:function(){return this.numXRayedLayerPortions>0},set:function(e){e=!!e,this._xrayed=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].xrayed=e;this.glRedraw()}},{key:"highlighted",get:function(){return this.numHighlightedLayerPortions>0},set:function(e){e=!!e,this._highlighted=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].highlighted=e;this.glRedraw()}},{key:"selected",get:function(){return this.numSelectedLayerPortions>0},set:function(e){e=!!e,this._selected=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].selected=e;this.glRedraw()}},{key:"edges",get:function(){return this.numEdgesLayerPortions>0},set:function(e){e=!!e,this._edges=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].edges=e;this.glRedraw()}},{key:"culled",get:function(){return this._culled},set:function(e){e=!!e,this._culled=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].culled=e;this.glRedraw()}},{key:"clippable",get:function(){return this._clippable},set:function(e){e=!1!==e,this._clippable=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].clippable=e;this.glRedraw()}},{key:"collidable",get:function(){return this._collidable},set:function(e){e=!1!==e,this._collidable=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].collidable=e}},{key:"pickable",get:function(){return this.numPickableLayerPortions>0},set:function(e){e=!1!==e,this._pickable=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].pickable=e}},{key:"colorize",get:function(){return this._colorize},set:function(e){this._colorize=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].colorize=e}},{key:"opacity",get:function(){return this._opacity},set:function(e){this._opacity=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].opacity=e}},{key:"castsShadow",get:function(){return this._castsShadow},set:function(e){(e=!1!==e)!==this._castsShadow&&(this._castsShadow=e,this.glRedraw())}},{key:"receivesShadow",get:function(){return this._receivesShadow},set:function(e){(e=!1!==e)!==this._receivesShadow&&(this._receivesShadow=e,this.glRedraw())}},{key:"saoEnabled",get:function(){return this._saoEnabled}},{key:"pbrEnabled",get:function(){return this._pbrEnabled}},{key:"colorTextureEnabled",get:function(){return this._colorTextureEnabled}},{key:"isDrawable",get:function(){return!0}},{key:"isStateSortable",get:function(){return!1}},{key:"xrayMaterial",get:function(){return this.scene.xrayMaterial}},{key:"highlightMaterial",get:function(){return this.scene.highlightMaterial}},{key:"selectedMaterial",get:function(){return this.scene.selectedMaterial}},{key:"edgeMaterial",get:function(){return this.scene.edgeMaterial}},{key:"getPickViewMatrix",value:function(e){return this._viewMatrix?this._viewMatrix:e}},{key:"createQuantizationRange",value:function(e){void 0!==e.id&&null!==e.id?e.aabb?this.error("[createQuantizationRange] Config missing: aabb"):this._quantizationRanges[e.id]?this.error("[createQuantizationRange] QuantizationRange already created: "+e.id):this._quantizationRanges[e.id]={id:e.id,aabb:e.aabb,matrix:ea(e.aabb,J.mat4())}:this.error("[createQuantizationRange] Config missing: id")}},{key:"createGeometry",value:function(e){if(void 0!==e.id&&null!==e.id)if(this._geometries[e.id])this.error("[createGeometry] Geometry already created: "+e.id);else if(void 0!==e.primitive&&null!==e.primitive||(e.primitive="triangles"),"points"===e.primitive||"lines"===e.primitive||"triangles"===e.primitive||"solid"===e.primitive||"surface"===e.primitive){if(!e.positions&&!e.positionsCompressed&&!e.buckets)return this.error("[createGeometry] Param expected: `positions`, `positionsCompressed' or 'buckets"),null;if(e.positionsCompressed&&!e.positionsDecodeMatrix&&!e.positionsDecodeBoundary)return this.error("[createGeometry] Param expected: `positionsDecodeMatrix` or 'positionsDecodeBoundary' (required for `positionsCompressed')"),null;if(e.positionsDecodeMatrix&&e.positionsDecodeBoundary)return this.error("[createGeometry] Only one of these params expected: `positionsDecodeMatrix` or 'positionsDecodeBoundary' (required for `positionsCompressed')"),null;if(e.uvCompressed&&!e.uvDecodeMatrix)return this.error("[createGeometry] Param expected: `uvDecodeMatrix` (required for `uvCompressed')"),null;if(!(e.buckets||e.indices||"triangles"!==e.primitive&&"solid"!==e.primitive&&"surface"!==e.primitive)){var t=(e.positions||e.positionsCompressed).length/3;e.indices=this._createDefaultIndices(t)}if(!e.buckets&&!e.indices&&"points"!==e.primitive)return this.error("[createGeometry] Param expected: indices (required for '".concat(e.primitive,"' primitive type)")),null;if(e.positionsDecodeBoundary&&(e.positionsDecodeMatrix=ea(e.positionsDecodeBoundary,J.mat4())),e.positions){var i=J.collapseAABB3();e.positionsDecodeMatrix=J.mat4(),J.expandAABB3Points3(i,e.positions),e.positionsCompressed=$o(e.positions,i,e.positionsDecodeMatrix),e.aabb=i}else if(e.positionsCompressed){var s=J.collapseAABB3();e.positionsDecodeMatrix=new Float64Array(e.positionsDecodeMatrix),e.positionsCompressed=new Uint16Array(e.positionsCompressed),J.expandAABB3Points3(s,e.positionsCompressed),Di.decompressAABB(s,e.positionsDecodeMatrix),e.aabb=s}else if(e.buckets){var r=J.collapseAABB3();this._dtxBuckets[e.id]=e.buckets;for(var n=0,o=e.buckets.length;n<o;n++){var a=e.buckets[n];a.positions?J.expandAABB3Points3(r,a.positions):a.positionsCompressed&&J.expandAABB3Points3(r,a.positionsCompressed)}e.positionsDecodeMatrix&&Di.decompressAABB(r,e.positionsDecodeMatrix),e.aabb=r}if(e.colorsCompressed&&e.colorsCompressed.length>0)e.colorsCompressed=new Uint8Array(e.colorsCompressed);else if(e.colors&&e.colors.length>0){for(var l=e.colors,u=new Uint8Array(l.length),A=0,c=l.length;A<c;A++)u[A]=255*l[A];e.colorsCompressed=u}if(e.buckets||e.edgeIndices||"triangles"!==e.primitive&&"solid"!==e.primitive&&"surface"!==e.primitive||(e.positions?e.edgeIndices=Bi(e.positions,e.indices,null,5):e.edgeIndices=Bi(e.positionsCompressed,e.indices,e.positionsDecodeMatrix,2)),e.uv){var h=Di.getUVBounds(e.uv),d=Di.compressUVs(e.uv,h.min,h.max);e.uvCompressed=d.quantized,e.uvDecodeMatrix=d.decodeMatrix}else e.uvCompressed&&(e.uvCompressed=new Uint16Array(e.uvCompressed),e.uvDecodeMatrix=new Float64Array(e.uvDecodeMatrix));e.normals&&(e.normals=null),this._geometries[e.id]=e,this._numTriangles+=e.indices?Math.round(e.indices.length/3):0,this.numGeometries++}else this.error("[createGeometry] Unsupported value for 'primitive': '".concat(e.primitive,"' - supported values are 'points', 'lines', 'triangles', 'solid' and 'surface'. Defaulting to 'triangles'."));else this.error("[createGeometry] Config missing: id")}},{key:"createTexture",value:function(e){var t=this,i=e.id;if(null!=i)if(this._textures[i])this.error("[createTexture] Texture already created: "+i);else{if(!(e.src||e.image||e.imageBuffer||e.buffers))return this.error("[createTexture] Param expected: `src`, `image' or 'buffers'"),null;var s=e.minFilter||cs;s!==ls&&s!==As&&s!==cs&&s!==as&&s!==rs&&(this.error("[createTexture] Unsupported value for 'minFilter' - \n supported values are LinearFilter, LinearMipMapNearestFilter, NearestMipMapNearestFilter, \n NearestMipMapLinearFilter and LinearMipmapLinearFilter. Defaulting to LinearMipmapLinearFilter."),s=cs);var r=e.magFilter||ls;r!==ls&&r!==ss&&(this.error("[createTexture] Unsupported value for 'magFilter' - supported values are LinearFilter and NearestFilter. Defaulting to LinearFilter."),r=ls);var n=e.wrapS||es;n!==ts&&n!==is&&n!==es&&(this.error("[createTexture] Unsupported value for 'wrapS' - supported values are ClampToEdgeWrapping, MirroredRepeatWrapping and RepeatWrapping. Defaulting to RepeatWrapping."),n=es);var o=e.wrapT||es;o!==ts&&o!==is&&o!==es&&(this.error("[createTexture] Unsupported value for 'wrapT' - supported values are ClampToEdgeWrapping, MirroredRepeatWrapping and RepeatWrapping. Defaulting to RepeatWrapping."),o=es);var a=e.wrapR||es;a!==ts&&a!==is&&a!==es&&(this.error("[createTexture] Unsupported value for 'wrapR' - supported values are ClampToEdgeWrapping, MirroredRepeatWrapping and RepeatWrapping. Defaulting to RepeatWrapping."),a=es);var l=e.encoding||lr;l!==lr&&l!==ur&&(this.error("[createTexture] Unsupported value for 'encoding' - supported values are LinearEncoding and sRGBEncoding. Defaulting to LinearEncoding."),l=lr);var u=new In({gl:this.scene.canvas.gl,minFilter:s,magFilter:r,wrapS:n,wrapT:o,wrapR:a,encoding:l},this.scene);if(e.preloadColor&&u.setPreloadColor(e.preloadColor),e.image){var A=e.image;if(A.crossOrigin="Anonymous",A.compressed){var c=A.data;u.setCompressedData({mipmaps:c,props:{format:c[0].format,minFilter:s,magFilter:r}})}else u.setImage(A,{minFilter:s,magFilter:r,wrapS:n,wrapT:o,wrapR:a,flipY:e.flipY,encoding:l})}else if(e.imageBuffer)u.setImageBuffer(e.imageBuffer,{minFilter:s,magFilter:r,wrapS:n,wrapT:o,wrapR:a,flipY:!1,encoding:l});else if(e.src){var h=e.src.split(".").pop();switch(h){case"jpeg":case"jpg":case"png":case"gif":var d=new Image;d.onload=function(){u.setImage(d,{minFilter:s,magFilter:r,wrapS:n,wrapT:o,wrapR:a,flipY:e.flipY,encoding:l}),t.glRedraw()},d.src=e.src;break;default:this._textureTranscoder?oe.loadArraybuffer(e.src,(function(e){e.byteLength?t._textureTranscoder.transcode([e],u).then((function(){t.glRedraw()})):t.error("[createTexture] Can't create texture from 'src': file data is zero length")}),(function(e){this.error("[createTexture] Can't create texture from 'src': ".concat(e))})):this.error("[createTexture] Can't create texture from 'src' - SceneModel needs to be configured with a TextureTranscoder for this file type ('".concat(h,"')"))}}else e.buffers&&(this._textureTranscoder?this._textureTranscoder.transcode(e.buffers,u).then((function(){t.glRedraw()})):this.error("[createTexture] Can't create texture from 'buffers' - SceneModel needs to be configured with a TextureTranscoder for this option"));this._textures[i]=new Cc({id:i,texture:u})}else this.error("[createTexture] Config missing: id")}},{key:"createTextureSet",value:function(e){var t=e.id;if(null!=t){if(!this._textureSets[t]){var i,s,r,n,o;if(void 0!==e.colorTextureId&&null!==e.colorTextureId){if(!(i=this._textures[e.colorTextureId]))return}else i=this._textures[uh];if(void 0!==e.metallicRoughnessTextureId&&null!==e.metallicRoughnessTextureId){if(!(s=this._textures[e.metallicRoughnessTextureId]))return void this.error("[createTextureSet] Texture not found: ".concat(e.metallicRoughnessTextureId," - ensure that you create it first with createTexture()"))}else s=this._textures[Ah];if(void 0!==e.normalsTextureId&&null!==e.normalsTextureId){if(!(r=this._textures[e.normalsTextureId]))return void this.error("[createTextureSet] Texture not found: ".concat(e.normalsTextureId," - ensure that you create it first with createTexture()"))}else r=this._textures[ch];if(void 0!==e.emissiveTextureId&&null!==e.emissiveTextureId){if(!(n=this._textures[e.emissiveTextureId]))return void this.error("[createTextureSet] Texture not found: ".concat(e.emissiveTextureId," - ensure that you create it first with createTexture()"))}else n=this._textures[hh];if(void 0!==e.occlusionTextureId&&null!==e.occlusionTextureId){if(!(o=this._textures[e.occlusionTextureId]))return void this.error("[createTextureSet] Texture not found: ".concat(e.occlusionTextureId," - ensure that you create it first with createTexture()"))}else o=this._textures[dh];var a=new Pc({id:t,model:this,colorTexture:i,alphaCutoff:e.alphaCutoff,metallicRoughnessTexture:s,normalsTexture:r,emissiveTexture:n,occlusionTexture:o});return this._textureSets[t]=a,a}this.error("[createTextureSet] Texture set already created: ".concat(t))}else this.error("[createTextureSet] Config missing: id")}},{key:"createTransform",value:function(e){if(void 0!==e.id&&null!==e.id)if(this._transforms[e.id])this.error("[createTransform] SceneModel already has a transform with this ID: ".concat(e.id));else{var t;if(!e.parentTransformId||(t=this._transforms[e.parentTransformId])){var i=new th({id:e.id,model:this,parent:t,matrix:e.matrix,position:e.position,scale:e.scale,rotation:e.rotation,quaternion:e.quaternion});return this._transforms[i.id]=i,i}this.error("[createTransform] SceneModel.createTransform() config missing: id")}else this.error("[createTransform] SceneModel.createTransform() config missing: id")}},{key:"createMesh",value:function(e){if(void 0===e.id||null===e.id)return this.error("[createMesh] SceneModel.createMesh() config missing: id"),!1;if(this._meshes[e.id])return this.error("[createMesh] SceneModel already has a mesh with this ID: ".concat(e.id)),!1;if(!(void 0!==e.geometryId)){if(void 0!==e.primitive&&null!==e.primitive||(e.primitive="triangles"),"points"!==e.primitive&&"lines"!==e.primitive&&"triangles"!==e.primitive&&"solid"!==e.primitive&&"surface"!==e.primitive)return this.error("Unsupported value for 'primitive': '".concat(primitive,"' ('geometryId' is absent) - supported values are 'points', 'lines', 'triangles', 'solid' and 'surface'.")),!1;if(!e.positions&&!e.positionsCompressed&&!e.buckets)return this.error("Param expected: 'positions', 'positionsCompressed' or `buckets` ('geometryId' is absent)"),!1;if(e.positions&&(e.positionsDecodeMatrix||e.positionsDecodeBoundary))return this.error("Illegal params: 'positions' not expected with 'positionsDecodeMatrix'/'positionsDecodeBoundary' ('geometryId' is absent)"),!1;if(e.positionsCompressed&&!e.positionsDecodeMatrix&&!e.positionsDecodeBoundary)return this.error("Param expected: 'positionsCompressed' should be accompanied by 'positionsDecodeMatrix'/'positionsDecodeBoundary' ('geometryId' is absent)"),!1;if(e.uvCompressed&&!e.uvDecodeMatrix)return this.error("Param expected: 'uvCompressed' should be accompanied by `uvDecodeMatrix` ('geometryId' is absent)"),!1;var t=(e.positions||e.positionsCompressed).length/3;if(e.buckets||e.indices||"triangles"!==e.primitive&&"solid"!==e.primitive&&"surface"!==e.primitive||(e.indices=this._createDefaultIndices(t)),!e.buckets&&!e.indices&&"points"!==e.primitive)return e.indices=this._createDefaultIndices(t),this.error("Param expected: indices (required for '".concat(e.primitive,"' primitive type)")),!1;if((e.matrix||e.position||e.rotation||e.scale)&&(e.positionsCompressed||e.positionsDecodeBoundary))return this.error("Unexpected params: 'matrix', 'rotation', 'scale', 'position' not allowed with 'positionsCompressed'"),!1;var i=!(!this._dtxEnabled||"triangles"!==e.primitive&&"solid"!==e.primitive&&"surface"!==e.primitive||e.textureSetId);if(e.origin=e.origin?J.addVec3(this._origin,e.origin,J.vec3()):this._origin,e.matrix)e.meshMatrix=e.matrix;else if(e.scale||e.rotation||e.position||e.quaternion){var s=e.scale||nh,r=e.position||oh;e.rotation?(J.eulerToQuaternion(e.rotation,"XYZ",rh),e.meshMatrix=J.composeMat4(r,rh,s,J.mat4())):e.meshMatrix=J.composeMat4(r,e.quaternion||ah,s,J.mat4())}if(e.positionsDecodeBoundary&&(e.positionsDecodeMatrix=ea(e.positionsDecodeBoundary,J.mat4())),i){if(e.type=2,e.color=e.color?new Uint8Array([Math.floor(255*e.color[0]),Math.floor(255*e.color[1]),Math.floor(255*e.color[2])]):fh,e.opacity=void 0!==e.opacity&&null!==e.opacity?Math.floor(255*e.opacity):255,e.positions){var n=J.vec3(),o=[];we(e.positions,o,n)&&(e.positions=o,e.origin=J.addVec3(e.origin,n,n))}if(e.positions){var a=J.collapseAABB3();e.positionsDecodeMatrix=J.mat4(),J.expandAABB3Points3(a,e.positions),e.positionsCompressed=$o(e.positions,a,e.positionsDecodeMatrix),e.aabb=a}else if(e.positionsCompressed){var l=J.collapseAABB3();J.expandAABB3Points3(l,e.positionsCompressed),Di.decompressAABB(l,e.positionsDecodeMatrix),e.aabb=l}if(e.buckets){for(var u=J.collapseAABB3(),A=0,c=e.buckets.length;A<c;A++){var h=e.buckets[A];h.positions?J.expandAABB3Points3(u,h.positions):h.positionsCompressed&&J.expandAABB3Points3(u,h.positionsCompressed)}e.positionsDecodeMatrix&&Di.decompressAABB(u,e.positionsDecodeMatrix),e.aabb=u}e.meshMatrix&&(J.AABB3ToOBB3(e.aabb,sh),J.transformOBB3(e.meshMatrix,sh),J.OBB3ToAABB3(sh,e.aabb)),e.buckets||e.edgeIndices||"triangles"!==e.primitive&&"solid"!==e.primitive&&"surface"!==e.primitive||(e.positions?e.edgeIndices=Bi(e.positions,e.indices,null,2):e.edgeIndices=Bi(e.positionsCompressed,e.indices,e.positionsDecodeMatrix,2)),e.buckets||(e.buckets=gh(e,this._enableVertexWelding&&this._enableIndexBucketing))}else{if(e.type=1,e.color=e.color?new Uint8Array([Math.floor(255*e.color[0]),Math.floor(255*e.color[1]),Math.floor(255*e.color[2])]):[255,255,255],e.opacity=void 0!==e.opacity&&null!==e.opacity?Math.floor(255*e.opacity):255,e.metallic=void 0!==e.metallic&&null!==e.metallic?Math.floor(255*e.metallic):0,e.roughness=void 0!==e.roughness&&null!==e.roughness?Math.floor(255*e.roughness):255,e.positions){var d=[];we(e.positions,d,ih)&&(e.positions=d,e.origin=J.addVec3(e.origin,ih,J.vec3()))}if(e.positions){var p=J.collapseAABB3();e.meshMatrix&&(J.transformPositions3(e.meshMatrix,e.positions,e.positions),e.meshMatrix=null),J.expandAABB3Points3(p,e.positions),e.aabb=p}else{var f=J.collapseAABB3();J.expandAABB3Points3(f,e.positionsCompressed),Di.decompressAABB(f,e.positionsDecodeMatrix),e.aabb=f}e.meshMatrix&&(J.AABB3ToOBB3(e.aabb,sh),J.transformOBB3(e.meshMatrix,sh),J.OBB3ToAABB3(sh,e.aabb)),e.buckets||e.edgeIndices||"triangles"!==e.primitive&&"solid"!==e.primitive&&"surface"!==e.primitive||(e.positions?e.edgeIndices=Bi(e.positions,e.indices,null,2):e.edgeIndices=Bi(e.positionsCompressed,e.indices,e.positionsDecodeMatrix,2)),e.textureSetId&&(e.textureSet=this._textureSets[e.textureSetId])}}else{if(e.positions||e.positionsCompressed||e.indices||e.edgeIndices||e.normals||e.normalsCompressed||e.uv||e.uvCompressed||e.positionsDecodeMatrix)return this.error("Mesh geometry parameters not expected when instancing a geometry (not expected: positions, positionsCompressed, indices, edgeIndices, normals, normalsCompressed, uv, uvCompressed, positionsDecodeMatrix)"),!1;if(e.geometry=this._geometries[e.geometryId],!e.geometry)return this.error("[createMesh] Geometry not found: ".concat(e.geometryId," - ensure that you create it first with createGeometry()")),!1;if(e.origin=e.origin?J.addVec3(this._origin,e.origin,J.vec3()):this._origin,e.positionsDecodeMatrix=e.geometry.positionsDecodeMatrix,e.transformId){if(e.transform=this._transforms[e.transformId],!e.transform)return this.error("[createMesh] Transform not found: ".concat(e.transformId," - ensure that you create it first with createTransform()")),!1;e.aabb=e.geometry.aabb}else{if(e.matrix)e.meshMatrix=e.matrix;else if(e.scale||e.rotation||e.position||e.quaternion){var v=e.scale||nh,g=e.position||oh;e.rotation?(J.eulerToQuaternion(e.rotation,"XYZ",rh),e.meshMatrix=J.composeMat4(g,rh,v,J.mat4())):e.meshMatrix=J.composeMat4(g,e.quaternion||ah,v,J.mat4())}J.AABB3ToOBB3(e.geometry.aabb,sh),J.transformOBB3(e.meshMatrix,sh),e.aabb=J.OBB3ToAABB3(sh,J.AABB3())}if(!(!this._dtxEnabled||"triangles"!==e.geometry.primitive&&"solid"!==e.geometry.primitive&&"surface"!==e.geometry.primitive||e.textureSetId)){e.type=2,e.color=e.color?new Uint8Array([Math.floor(255*e.color[0]),Math.floor(255*e.color[1]),Math.floor(255*e.color[2])]):fh,e.opacity=void 0!==e.opacity&&null!==e.opacity?Math.floor(255*e.opacity):255;var m=this._dtxBuckets[e.geometryId];m||(m=gh(e.geometry,this._enableVertexWelding,this._enableIndexBucketing),this._dtxBuckets[e.geometryId]=m),e.buckets=m}else e.type=0,e.color=e.color?new Uint8Array([Math.floor(255*e.color[0]),Math.floor(255*e.color[1]),Math.floor(255*e.color[2])]):fh,e.opacity=void 0!==e.opacity&&null!==e.opacity?Math.floor(255*e.opacity):255,e.metallic=void 0!==e.metallic&&null!==e.metallic?Math.floor(255*e.metallic):0,e.roughness=void 0!==e.roughness&&null!==e.roughness?Math.floor(255*e.roughness):255,e.textureSetId&&(e.textureSet=this._textureSets[e.textureSetId])}return e.numPrimitives=this._getNumPrimitives(e),this._createMesh(e)}},{key:"_createDefaultIndices",value:function(e){for(var t=[],i=0;i<e;i++)t.push(i);return t}},{key:"_createMesh",value:function(e){var t=new so(this,e.id,e.color,e.opacity,e.transform,e.textureSet);t.pickId=this.scene._renderer.getPickID(t);var i=t.pickId,s=i>>24&255,r=i>>16&255,n=i>>8&255,o=255&i;switch(e.pickColor=new Uint8Array([o,n,r,s]),e.solid="solid"===e.primitive,t.origin=J.vec3(e.origin),e.type){case 2:t.layer=this._getDTXLayer(e),t.aabb=e.aabb;break;case 1:t.layer=this._getVBOBatchingLayer(e),t.aabb=e.aabb;break;case 0:t.layer=this._getVBOInstancingLayer(e),t.aabb=e.aabb}return e.transform&&(e.meshMatrix=e.transform.worldMatrix),t.portionId=t.layer.createPortion(t,e),t.numPrimitives=e.numPrimitives,this._meshes[e.id]=t,this._unusedMeshes[e.id]=t,this._meshList.push(t),t}},{key:"_getNumPrimitives",value:function(e){var t=0;switch(e.geometry?e.geometry.primitive:e.primitive){case"triangles":case"solid":case"surface":switch(e.type){case 2:for(var i=0,s=e.buckets.length;i<s;i++)t+=e.buckets[i].indices.length;break;case 1:t+=e.indices.length;break;case 0:t+=e.geometry.indices.length}return Math.round(t/3);case"points":switch(e.type){case 2:for(var r=0,n=e.buckets.length;r<n;r++)t+=e.buckets[r].positionsCompressed.length;break;case 1:t+=e.positions?e.positions.length:e.positionsCompressed.length;break;case 0:var o=e.geometry;t+=o.positions?o.positions.length:o.positionsCompressed.length}return Math.round(t);case"lines":case"line-strip":switch(e.type){case 2:for(var a=0,l=e.buckets.length;a<l;a++)t+=e.buckets[a].indices.length;break;case 1:t+=e.indices.length;break;case 0:t+=e.geometry.indices.length}return Math.round(t/2)}return 0}},{key:"_getDTXLayer",value:function(e){var t=e.origin,i=e.geometry?e.geometry.primitive:e.primitive,s=".".concat(i,".").concat(Math.round(t[0]),".").concat(Math.round(t[1]),".").concat(Math.round(t[2])),r=this._dtxLayers[s];if(r){if(r.canCreatePortion(e))return r;delete this._dtxLayers[s],r=null}switch(i){case"triangles":case"solid":case"surface":r=new wc(this,{layerIndex:0,origin:t,primitive:i});break;case"lines":r=new tA(this,{layerIndex:0,origin:t,primitive:i});break;default:return}return this._dtxLayers[s]=r,this.layerList.push(r),this._layersToFinalize.push(r),r}},{key:"_getVBOBatchingLayer",value:function(e){var t=this,i=e.origin;e.renderLayer;var s=e.positionsDecodeMatrix||e.positionsDecodeBoundary?this._createHashStringFromMatrix(e.positionsDecodeMatrix||e.positionsDecodeBoundary):"-",r=e.textureSetId||"-",n="".concat(Math.round(i[0]),".").concat(Math.round(i[1]),".").concat(Math.round(i[2]),".").concat(e.primitive,".").concat(s,".").concat(r),o=this._vboBatchingLayers[n];if(o)return o;for(var a=e.textureSet;!o;){switch(e.primitive){case"triangles":case"solid":case"surface":o=new da({model:t,textureSet:a,layerIndex:0,scratchMemory:this._vboBatchingLayerScratchMemory,positionsDecodeMatrix:e.positionsDecodeMatrix,uvDecodeMatrix:e.uvDecodeMatrix,origin:i,maxGeometryBatchSize:this._maxGeometryBatchSize,solid:"solid"===e.primitive,autoNormals:!0,primitive:e.primitive});break;case"lines":o=new xl({model:t,layerIndex:0,scratchMemory:this._vboBatchingLayerScratchMemory,positionsDecodeMatrix:e.positionsDecodeMatrix,uvDecodeMatrix:e.uvDecodeMatrix,origin:i,maxGeometryBatchSize:this._maxGeometryBatchSize,primitive:e.primitive});break;case"points":o=new cu({model:t,layerIndex:0,scratchMemory:this._vboBatchingLayerScratchMemory,positionsDecodeMatrix:e.positionsDecodeMatrix,uvDecodeMatrix:e.uvDecodeMatrix,origin:i,maxGeometryBatchSize:this._maxGeometryBatchSize,primitive:e.primitive})}var l=e.positionsCompressed?e.positionsCompressed.length:e.positions.length;("points"===e.primitive?o.canCreatePortion(l):o.canCreatePortion(l,e.indices.length))||(o.finalize(),delete this._vboBatchingLayers[n],o=null)}return this._vboBatchingLayers[n]=o,this.layerList.push(o),this._layersToFinalize.push(o),o}},{key:"_createHashStringFromMatrix",value:function(e){for(var t=e.join(""),i=0,s=0;s<t.length;s++){i=(i<<5)-i+t.charCodeAt(s),i|=0}return(i>>>0).toString(16)}},{key:"_getVBOInstancingLayer",value:function(e){var t=this,i=e.origin,s=e.textureSetId||"-",r=e.geometryId,n="".concat(Math.round(i[0]),".").concat(Math.round(i[1]),".").concat(Math.round(i[2]),".").concat(s,".").concat(r),o=this._vboInstancingLayers[n];if(o)return o;for(var a=e.textureSet,l=e.geometry;!o;)switch(l.primitive){case"triangles":case"surface":o=new rl({model:t,textureSet:a,geometry:l,origin:i,layerIndex:0,solid:!1});break;case"solid":o=new rl({model:t,textureSet:a,geometry:l,origin:i,layerIndex:0,solid:!0});break;case"lines":o=new jl({model:t,textureSet:a,geometry:l,origin:i,layerIndex:0});break;case"points":o=new Ru({model:t,textureSet:a,geometry:l,origin:i,layerIndex:0})}return this._vboInstancingLayers[n]=o,this.layerList.push(o),this._layersToFinalize.push(o),o}},{key:"createEntity",value:function(e){if(void 0===e.id?e.id=J.createUUID():this.scene.components[e.id]&&(this.error("Scene already has a Component with this ID: ".concat(e.id," - will assign random ID")),e.id=J.createUUID()),void 0!==e.meshIds){var t=0;return this._visible&&!1!==e.visible&&(t|=Me),this._pickable&&!1!==e.pickable&&(t|=Fe),this._culled&&!1!==e.culled&&(t|=ke),this._clippable&&!1!==e.clippable&&(t|=Ee),this._collidable&&!1!==e.collidable&&(t|=De),this._edges&&!1!==e.edges&&(t|=Le),this._xrayed&&!1!==e.xrayed&&(t|=Ie),this._highlighted&&!1!==e.highlighted&&(t|=Se),this._selected&&!1!==e.selected&&(t|=Te),e.flags=t,this._createEntity(e)}this.error("Config missing: meshIds")}},{key:"_createEntity",value:function(e){for(var t=[],i=0,s=e.meshIds.length;i<s;i++){var r=e.meshIds[i],n=this._meshes[r];n?n.parent?this.error('Mesh with ID "'.concat(r,'" already belongs to object with ID "').concat(n.parent.id,'" - ignoring this mesh')):(t.push(n),delete this._unusedMeshes[r]):this.error('Mesh with this ID not found: "'.concat(r,'" - ignoring this mesh'))}var o=new Oe(this,e.isObject,e.id,t,e.flags,!0);return this._entityList.push(o),this._entities[e.id]=o,this._entitiesToFinalize.push(o),this.numEntities++,o}},{key:"preFinalize",value:function(){if(this.destroyed)return!1;if(0===this._layersToFinalize.length)return!1;this._createDummyEntityForUnusedMeshes();for(var e=0,t=this._layersToFinalize.length;e<t;e++){this._layersToFinalize[e].finalize()}this._vboBatchingLayers={},this._vboInstancingLayers={},this._dtxLayers={},this._layersToFinalize=[];for(var i=0,s=this._entitiesToFinalize.length;i<s;i++){this._entitiesToFinalize[i]._finalize()}for(var r=0,n=this._entitiesToFinalize.length;r<n;r++){this._entitiesToFinalize[r]._finalize2()}this._entitiesToFinalize=[],this.scene._aabbDirty=!0,this._viewMatrixDirty=!0,this._matrixDirty=!0,this._aabbDirty=!0,this._setWorldMatrixDirty(),this._sceneModelDirty(),this.position=this._position,this.layerList.sort((function(e,t){return e.sortId<t.sortId?-1:e.sortId>t.sortId?1:0}));for(var o=0,a=this.layerList.length;o<a;o++){this.layerList[o].layerIndex=o}this.glRedraw(),this._layersFinalized=!0}},{key:"finalize",value:function(){this.destroyed||(this.preFinalize(),this._geometries={},this._dtxBuckets={},this._textures={},this._textureSets={})}},{key:"stateSortCompare",value:function(e,t){}},{key:"rebuildRenderFlags",value:function(){this.renderFlags.reset(),this._updateRenderFlagsVisibleLayers(),this.renderFlags.numLayers>0&&0===this.renderFlags.numVisibleLayers?this.renderFlags.culled=!0:this._updateRenderFlags()}},{key:"_updateRenderFlagsVisibleLayers",value:function(){var e=this.renderFlags;e.numLayers=this.layerList.length,e.numVisibleLayers=0;for(var t=0,i=this.layerList.length;t<i;t++){var s=this.layerList[t];this._getActiveSectionPlanesForLayer(s)&&(e.visibleLayers[e.numVisibleLayers++]=t)}}},{key:"_createDummyEntityForUnusedMeshes",value:function(){var e=Object.keys(this._unusedMeshes);if(e.length>0){var t="".concat(this.id,"-").concat(J.createUUID());this.warn('Creating dummy SceneModelEntity "'.concat(t,'" for unused SceneMeshes: [').concat(e.join(","),"]")),this.createEntity({id:t,meshIds:e,isObject:!0})}this._unusedMeshes={}}},{key:"_getActiveSectionPlanesForLayer",value:function(e){var t=this.renderFlags,i=this.scene._sectionPlanesState.sectionPlanes,s=i.length,r=e.layerIndex*s;if(s>0)for(var n=0;n<s;n++){i[n].active?(t.sectionPlanesActivePerLayer[r+n]=!0,t.sectioned=!0):t.sectionPlanesActivePerLayer[r+n]=!1}return!0}},{key:"_updateRenderFlags",value:function(){if(0!==this.numVisibleLayerPortions&&this.numCulledLayerPortions!==this.numPortions){var e=this.renderFlags;if(e.colorOpaque=this.numTransparentLayerPortions<this.numPortions,this.numTransparentLayerPortions>0&&(e.colorTransparent=!0),this.numXRayedLayerPortions>0){var t=this.scene.xrayMaterial._state;t.fill&&(t.fillAlpha<1?e.xrayedSilhouetteTransparent=!0:e.xrayedSilhouetteOpaque=!0),t.edges&&(t.edgeAlpha<1?e.xrayedEdgesTransparent=!0:e.xrayedEdgesOpaque=!0)}if(this.numEdgesLayerPortions>0)this.scene.edgeMaterial._state.edges&&(e.edgesOpaque=this.numTransparentLayerPortions<this.numPortions,this.numTransparentLayerPortions>0&&(e.edgesTransparent=!0));if(this.numSelectedLayerPortions>0){var i=this.scene.selectedMaterial._state;i.fill&&(i.fillAlpha<1?e.selectedSilhouetteTransparent=!0:e.selectedSilhouetteOpaque=!0),i.edges&&(i.edgeAlpha<1?e.selectedEdgesTransparent=!0:e.selectedEdgesOpaque=!0)}if(this.numHighlightedLayerPortions>0){var s=this.scene.highlightMaterial._state;s.fill&&(s.fillAlpha<1?e.highlightedSilhouetteTransparent=!0:e.highlightedSilhouetteOpaque=!0),s.edges&&(s.edgeAlpha<1?e.highlightedEdgesTransparent=!0:e.highlightedEdgesOpaque=!0)}}}},{key:"drawColorOpaque",value:function(e,t){for(var i=this.renderFlags,s=0,r=i.visibleLayers.length;s<r;s++){var n=i.visibleLayers[s];this.layerList[n].drawColorOpaque(i,e)}}},{key:"drawColorTransparent",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawColorTransparent(t,e)}}},{key:"drawDepth",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawDepth(t,e)}}},{key:"drawNormals",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawNormals(t,e)}}},{key:"drawSilhouetteXRayed",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawSilhouetteXRayed(t,e)}}},{key:"drawSilhouetteHighlighted",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawSilhouetteHighlighted(t,e)}}},{key:"drawSilhouetteSelected",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawSilhouetteSelected(t,e)}}},{key:"drawEdgesColorOpaque",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawEdgesColorOpaque(t,e)}}},{key:"drawEdgesColorTransparent",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawEdgesColorTransparent(t,e)}}},{key:"drawEdgesXRayed",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawEdgesXRayed(t,e)}}},{key:"drawEdgesHighlighted",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawEdgesHighlighted(t,e)}}},{key:"drawEdgesSelected",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawEdgesSelected(t,e)}}},{key:"drawOcclusion",value:function(e){if(0!==this.numVisibleLayerPortions)for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawOcclusion(t,e)}}},{key:"drawShadow",value:function(e){if(0!==this.numVisibleLayerPortions)for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawShadow(t,e)}}},{key:"setPickMatrices",value:function(e,t){if(0!==this._numVisibleLayerPortions)for(var i=this.renderFlags,s=0,r=i.visibleLayers.length;s<r;s++){var n=i.visibleLayers[s],o=this.layerList[n];o.setPickMatrices&&o.setPickMatrices(e,t)}}},{key:"drawPickMesh",value:function(e){if(0!==this.numVisibleLayerPortions)for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawPickMesh(t,e)}}},{key:"drawPickDepths",value:function(e){if(0!==this.numVisibleLayerPortions)for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawPickDepths(t,e)}}},{key:"drawPickNormals",value:function(e){if(0!==this.numVisibleLayerPortions)for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawPickNormals(t,e)}}},{key:"drawSnapInit",value:function(e){if(0!==this.numVisibleLayerPortions)for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i],n=this.layerList[r];n.drawSnapInit&&(e.snapPickOrigin=[0,0,0],e.snapPickCoordinateScale=[1,1,1],e.snapPickLayerNumber++,n.drawSnapInit(t,e),e.snapPickLayerParams[e.snapPickLayerNumber]={origin:e.snapPickOrigin.slice(),coordinateScale:e.snapPickCoordinateScale.slice()})}}},{key:"drawSnap",value:function(e){if(0!==this.numVisibleLayerPortions)for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i],n=this.layerList[r];n.drawSnap&&(e.snapPickOrigin=[0,0,0],e.snapPickCoordinateScale=[1,1,1],e.snapPickLayerNumber++,n.drawSnap(t,e),e.snapPickLayerParams[e.snapPickLayerNumber]={origin:e.snapPickOrigin.slice(),coordinateScale:e.snapPickCoordinateScale.slice()})}}},{key:"destroy",value:function(){for(var e in this._vboBatchingLayers)this._vboBatchingLayers.hasOwnProperty(e)&&this._vboBatchingLayers[e].destroy();for(var i in this._vboBatchingLayers={},this._vboInstancingLayers)this._vboInstancingLayers.hasOwnProperty(i)&&this._vboInstancingLayers[i].destroy();this._vboInstancingLayers={},this.scene.camera.off(this._onCameraViewMatrix),this.scene.off(this._onTick);for(var s=0,r=this.layerList.length;s<r;s++)this.layerList[s].destroy();this.layerList=[];for(var n=0,o=this._entityList.length;n<o;n++)this._entityList[n]._destroy();this._layersToFinalize={},this._geometries={},this._dtxBuckets={},this._textures={},this._textureSets={},this._meshes={},this._entities={},this.scene._aabbDirty=!0,this._isModel&&this.scene._deregisterModel(this),0!==no&&0==--no&&ro._clear(),f(t,"destroy",this,3)([])}}])}();function gh(e,t,i){var s,r,n,o;if(t||i){var a=u(Vc({positionsCompressed:e.positionsCompressed,indices:e.indices,edgeIndices:e.edgeIndices}),3);s=a[0],r=a[1],n=a[2]}else s=e.positionsCompressed,r=e.indices,n=e.edgeIndices;i?o=Kc({positionsCompressed:s,indices:r,edgeIndices:n},s.length/3>65536?16:8):o=[{positionsCompressed:s,indices:r,edgeIndices:n}];return o}var mh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(B(this,t),(i=h(this,t,[e,s]))._positions=s.positions||[],s.indices)i._indices=s.indices;else{i._indices=[];for(var r=0,n=i._positions.length/3-1;r<n;r+=2)i._indices.push(r),i._indices.push(r+1)}return i._sceneModel=new vh(i,{isModel:!1}),i._sceneModel.createMesh({id:"linesMesh",primitive:"lines",positions:i._positions,indices:i._indices}),i._sceneModel.createEntity({meshIds:["linesMesh"],visible:s.visible,clippable:s.clippable,collidable:s.collidable}),i._sceneModel.finalize(),i.scene._lineSetCreated(i),i}return m(t,_e),w(t,[{key:"visible",get:function(){return this._sceneModel.visible},set:function(e){this._sceneModel.visible=e}},{key:"positions",get:function(){return this._positions}},{key:"indices",get:function(){return this._indices}},{key:"destroy",value:function(){f(t,"destroy",this,3)([]),this.scene._lineSetDestroyed(this)}}])}(),_h=J.vec3(),yh=J.vec3(),bh=J.vec3(),Bh=J.vec3(),xh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,["BCFViewpoints",e,s])).originatingSystem=s.originatingSystem||"tctwins.io",i.authoringTool=s.authoringTool||"tctwins.io",i}return m(t,me),w(t,[{key:"getViewpoint",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.viewer.scene,s=i.camera,r=i.realWorldOffset,n=!0===t.reverseClippingPlanes,o={},a=J.normalizeVec3(J.subVec3(s.look,s.eye,J.vec3())),l=s.eye,A=s.up;s.yUp&&(a=Ch(a),l=Ch(l),A=Ch(A));var c=wh(J.addVec3(l,r));"ortho"===s.projection?o.orthogonal_camera={camera_view_point:c,camera_direction:wh(a),camera_up_vector:wh(A),view_to_world_scale:s.ortho.scale}:o.perspective_camera={camera_view_point:c,camera_direction:wh(a),camera_up_vector:wh(A),field_of_view:s.perspective.fov};var h=i.sectionPlanes;for(var d in h)if(h.hasOwnProperty(d)){var p=h[d];if(!p.active)continue;var f=p.pos,v=void 0;v=n?J.negateVec3(p.dir,J.vec3()):p.dir,s.yUp&&(f=Ch(f),v=Ch(v)),J.addVec3(f,r),f=wh(f),v=wh(v),o.clipping_planes||(o.clipping_planes=[]),o.clipping_planes.push({location:f,direction:v})}var g=i.lineSets;for(var m in g)if(g.hasOwnProperty(m)){var _=g[m];o.lines||(o.lines=[]);for(var y=_.positions,b=_.indices,B=0,x=b.length/2;B<x;B++){var w=b[2*B],P=b[2*B+1];o.lines.push({start_point:{x:y[3*w+0],y:y[3*w+1],z:y[3*w+2]},end_point:{x:y[3*P+0],y:y[3*P+1],z:y[3*P+2]}})}}var C=i.bitmaps;for(var M in C)if(C.hasOwnProperty(M)){var k=C[M],F=k.pos,E=k.normal,D=k.up;s.yUp&&(F=Ch(F),E=Ch(E),D=Ch(D)),J.addVec3(F,r),o.bitmaps||(o.bitmaps=[]),o.bitmaps.push({bitmap_type:k.type,bitmap_data:k.imageData,location:wh(F),normal:wh(E),up:wh(D),height:k.height})}o.components={view_setup_hints:{spaces_visible:!!t.spacesVisible,space_boundaries_visible:!!t.spaceBoundariesVisible,openings_visible:!!t.openingsVisible,spaces_translucent:!!t.spaces_translucent,space_boundaries_translucent:!!t.space_boundaries_translucent,openings_translucent:!!t.openings_translucent},visibility:{}};var I=new Set(i.opacityObjectIds),S=new Set(i.xrayedObjectIds),T=new Set(i.colorizedObjectIds),L=Object.values(i.objects).filter((function(e){return I.has(e.id)||T.has(e.id)||S.has(e.id)})).reduce((function(t,s){var r,n=function(e){var t="";return t+=Math.round(255*e[0]).toString(16).padStart(2,"0"),t+=Math.round(255*e[1]).toString(16).padStart(2,"0"),t+=Math.round(255*e[2]).toString(16).padStart(2,"0"),t}(s.colorize);s.xrayed?(r=0===i.xrayMaterial.fillAlpha&&0!==i.xrayMaterial.edgeAlpha?.1:i.xrayMaterial.fillAlpha,n=(r=Math.round(255*r).toString(16).padStart(2,"0"))+n):I.has(s.id)&&(n=(r=Math.round(255*s.opacity).toString(16).padStart(2,"0"))+n),t[n]||(t[n]=[]);var o=s.id,a=s.originalSystemId,l={ifc_guid:a,originating_system:e.originatingSystem};return a!==o&&(l.authoring_tool_id=o),t[n].push(l),t}),{}),R=Object.entries(L).map((function(e){var t=u(e,2);return{color:t[0],components:t[1]}}));o.components.coloring=R;var U=i.objectIds,O=i.visibleObjects,Q=i.visibleObjectIds,N=U.filter((function(e){return!O[e]})),V=i.selectedObjectIds;return t.defaultInvisible||Q.length<N.length?(o.components.visibility.exceptions=this._createBCFComponents(Q),o.components.visibility.default_visibility=!1):(o.components.visibility.exceptions=this._createBCFComponents(N),o.components.visibility.default_visibility=!0),o.components.selection=this._createBCFComponents(V),o.components.translucency=this._createBCFComponents(i.xrayedObjectIds),!1!==t.snapshot&&(o.snapshot={snapshot_type:"png",snapshot_data:this.viewer.getSnapshot({format:"png"})}),o}},{key:"_createBCFComponents",value:function(e){for(var t=this.viewer.scene,i=[],s=0,r=e.length;s<r;s++){var n=e[s],o=t.objects[n];if(o){var a={ifc_guid:o.originalSystemId,originating_system:this.originatingSystem};o.originalSystemId!==n&&(a.authoring_tool_id=n),i.push(a)}}return i}},{key:"setViewpoint",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){var s=this.viewer,r=s.scene,n=r.camera,o=!1!==i.rayCast,a=!1!==i.immediate,l=!1!==i.reset,u=r.realWorldOffset,A=!0===i.reverseClippingPlanes;if(r.clearSectionPlanes(),e.clipping_planes&&e.clipping_planes.length>0&&e.clipping_planes.forEach((function(e){var t=Ph(e.location,_h),i=Ph(e.direction,_h);A&&J.negateVec3(i),J.subVec3(t,u),n.yUp&&(t=Mh(t),i=Mh(i)),new hn(r,{pos:t,dir:i})})),r.clearLines(),e.lines&&e.lines.length>0){var c=[],h=[],d=0;e.lines.forEach((function(e){e.start_point&&e.end_point&&(c.push(e.start_point.x),c.push(e.start_point.y),c.push(e.start_point.z),c.push(e.end_point.x),c.push(e.end_point.y),c.push(e.end_point.z),h.push(d++),h.push(d++))})),new mh(r,{positions:c,indices:h,clippable:!1,collidable:!0})}if(r.clearBitmaps(),e.bitmaps&&e.bitmaps.length>0&&e.bitmaps.forEach((function(e){var t=e.bitmap_type||"jpg",i=e.bitmap_data,s=Ph(e.location,yh),o=Ph(e.normal,bh),a=Ph(e.up,Bh),l=e.height||1;t&&i&&s&&o&&a&&(n.yUp&&(s=Mh(s),o=Mh(o),a=Mh(a)),new $n(r,{src:i,type:t,pos:s,normal:o,up:a,clippable:!1,collidable:!0,height:l}))})),l&&(r.setObjectsXRayed(r.xrayedObjectIds,!1),r.setObjectsHighlighted(r.highlightedObjectIds,!1),r.setObjectsSelected(r.selectedObjectIds,!1)),e.components){if(e.components.visibility){e.components.visibility.default_visibility?(r.setObjectsVisible(r.objectIds,!0),e.components.visibility.exceptions&&e.components.visibility.exceptions.forEach((function(e){return t._withBCFComponent(i,e,(function(e){return e.visible=!1}))}))):(r.setObjectsVisible(r.objectIds,!1),e.components.visibility.exceptions&&e.components.visibility.exceptions.forEach((function(e){return t._withBCFComponent(i,e,(function(e){return e.visible=!0}))})));var p=e.components.view_setup_hints;p&&(!1===p.spaces_visible&&r.setObjectsVisible(s.metaScene.getObjectIDsByType("IfcSpace"),!1),void 0!==p.spaces_translucent&&r.setObjectsXRayed(s.metaScene.getObjectIDsByType("IfcSpace"),!0),p.space_boundaries_visible,!1===p.openings_visible&&r.setObjectsVisible(s.metaScene.getObjectIDsByType("IfcOpening"),!0),p.space_boundaries_translucent,void 0!==p.openings_translucent&&r.setObjectsXRayed(s.metaScene.getObjectIDsByType("IfcOpening"),!0))}e.components.selection&&(r.setObjectsSelected(r.selectedObjectIds,!1),e.components.selection.forEach((function(e){return t._withBCFComponent(i,e,(function(e){return e.selected=!0}))}))),e.components.translucency&&(r.setObjectsXRayed(r.xrayedObjectIds,!1),e.components.translucency.forEach((function(e){return t._withBCFComponent(i,e,(function(e){return e.xrayed=!0}))}))),e.components.coloring&&e.components.coloring.forEach((function(e){var s=e.color,r=0,n=!1;8===s.length&&((r=parseInt(s.substring(0,2),16)/256)<=1&&r>=.95&&(r=1),s=s.substring(2),n=!0);var o=[parseInt(s.substring(0,2),16)/256,parseInt(s.substring(2,4),16)/256,parseInt(s.substring(4,6),16)/256];e.components.map((function(e){return t._withBCFComponent(i,e,(function(e){e.colorize=o,n&&(e.opacity=r)}))}))}))}if(e.perspective_camera||e.orthogonal_camera){var f,v,g,m;if(e.perspective_camera?(f=Ph(e.perspective_camera.camera_view_point,_h),v=Ph(e.perspective_camera.camera_direction,_h),g=Ph(e.perspective_camera.camera_up_vector,_h),n.perspective.fov=e.perspective_camera.field_of_view,m="perspective"):(f=Ph(e.orthogonal_camera.camera_view_point,_h),v=Ph(e.orthogonal_camera.camera_direction,_h),g=Ph(e.orthogonal_camera.camera_up_vector,_h),n.ortho.scale=e.orthogonal_camera.view_to_world_scale,m="ortho"),J.subVec3(f,u),n.yUp&&(f=Mh(f),v=Mh(v),g=Mh(g)),o){var _=r.pick({pickSurface:!0,origin:f,direction:v});v=_?_.worldPos:J.addVec3(f,v,_h)}else v=J.addVec3(f,v,_h);a?(n.eye=f,n.look=v,n.up=g,n.projection=m):s.cameraFlight.flyTo({eye:f,look:v,up:g,duration:i.duration,projection:m})}}}},{key:"_withBCFComponent",value:function(e,t,i){var s=this.viewer,r=s.scene;if(t.authoring_tool_id&&t.originating_system===this.originatingSystem){var n=t.authoring_tool_id,o=r.objects[n];if(o)return void i(o);if(e.updateCompositeObjects)if(s.metaScene.metaObjects[n])return void r.withObjects(s.metaScene.getObjectIDsInSubtree(n),i)}if(t.ifc_guid){var a=t.ifc_guid,l=r.objects[a];if(l)return void i(l);if(e.updateCompositeObjects)if(s.metaScene.metaObjects[a])return void r.withObjects(s.metaScene.getObjectIDsInSubtree(a),i);Object.keys(r.models).forEach((function(t){var n=J.globalizeObjectId(t,a),o=r.objects[n];o?i(o):e.updateCompositeObjects&&s.metaScene.metaObjects[n]&&r.withObjects(s.metaScene.getObjectIDsInSubtree(n),i)}))}}},{key:"getUUID",value:function(){return J.createUUID()}},{key:"destroy",value:function(){f(t,"destroy",this,3)([])}}])}();function wh(e){return{x:e[0],y:e[1],z:e[2]}}function Ph(e,t){return(t=new Float64Array(3))[0]=e.x,t[1]=e.y,t[2]=e.z,t}function Ch(e){return new Float64Array([e[0],-e[2],e[1]])}function Mh(e){return new Float64Array([e[0],e[2],-e[1]])}var kh=J.vec3(),Fh=function(e,t,i,s){var r=e-i,n=t-s;return Math.sqrt(r*r+n*n)},Eh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(B(this,t),(i=h(this,t,[e.viewer.scene,s])).plugin=e,i._container=s.container,!i._container)throw"config missing: container";i._eventSubs={},i._color=s.color?s.color:e.defaultColor,i._borderColor=e.defaultColor?e.defaultColor:"white";var r=i.plugin.viewer.scene;i._originMarker=new Ve(r,s.origin),i._targetMarker=new Ve(r,s.target),i._originWorld=J.vec3(),i._targetWorld=J.vec3(),i._wp=new Float64Array(24),i._vp=new Float64Array(24),i._pp=new Float64Array(24),i._cp=new Float64Array(8),i._xAxisLabelCulled=!1,i._yAxisLabelCulled=!1,i._zAxisLabelCulled=!1;var n=s.onMouseOver?function(e){s.onMouseOver(e,i),i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mouseover",e))}:null,o=s.onMouseLeave?function(e){s.onMouseLeave(e,i),i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mouseleave",e))}:null,a=s.onMouseClick?function(e){s.onMouseClick(e,i),i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("click",e))}:null,l=s.onTouchStart?function(e){s.onTouchStart(e,i),e.preventDefault(),i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("touchstart",e))}:null,u=function(e){i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mousedown",e))},A=function(e){i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mouseup",e))},c=function(e){i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mousemove",e))},d=s.onContextMenu?function(e){s.onContextMenu(e,i)}:null,p=function(e){i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent("wheel",e))};return i._originDot=new je(i._container,{fillColor:i._color,borderColor:i._borderColor,zIndex:void 0!==e.zIndex?e.zIndex+2:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._targetDot=new je(i._container,{fillColor:i._color,borderColor:i._borderColor,zIndex:void 0!==e.zIndex?e.zIndex+2:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._lengthWire=new He(i._container,{color:i._color,thickness:1,thicknessClickable:6,zIndex:void 0!==e.zIndex?e.zIndex+1:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._lengthLabel=new Ge(i._container,{fillColor:i._color||"#0065FC",prefix:"",text:"",zIndex:void 0!==e.zIndex?e.zIndex+4:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._xAxisWire=new He(i._container,{color:"#FF0000",thickness:1,thicknessClickable:6,zIndex:void 0!==e.zIndex?e.zIndex+1:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._yAxisWire=new He(i._container,{color:"green",thickness:1,thicknessClickable:6,zIndex:void 0!==e.zIndex?e.zIndex+1:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._zAxisWire=new He(i._container,{color:"blue",thickness:1,thicknessClickable:6,zIndex:void 0!==e.zIndex?e.zIndex+1:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._xAxisLabel=new Ge(i._container,{fillColor:"red",prefix:"X",text:"",zIndex:void 0!==e.zIndex?e.zIndex+3:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._yAxisLabel=new Ge(i._container,{fillColor:"green",prefix:"Y",text:"",zIndex:void 0!==e.zIndex?e.zIndex+3:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._zAxisLabel=new Ge(i._container,{fillColor:"blue",prefix:"Z",text:"",zIndex:void 0!==e.zIndex?e.zIndex+3:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._wpDirty=!1,i._vpDirty=!1,i._cpDirty=!1,i._sectionPlanesDirty=!0,i._visible=!1,i._originVisible=!1,i._targetVisible=!1,i._wireVisible=!1,i._axisVisible=!1,i._xAxisVisible=!1,i._yAxisVisible=!1,i._zAxisVisible=!1,i._axisEnabled=!0,i._labelsVisible=!1,i._labelsOnWires=!1,i._clickable=!1,i._originMarker.on("worldPos",(function(e){i._originWorld.set(e||[0,0,0]),i._wpDirty=!0,i._needUpdate(0)})),i._targetMarker.on("worldPos",(function(e){i._targetWorld.set(e||[0,0,0]),i._wpDirty=!0,i._needUpdate(0)})),i._onViewMatrix=r.camera.on("viewMatrix",(function(){i._vpDirty=!0,i._needUpdate(0)})),i._onProjMatrix=r.camera.on("projMatrix",(function(){i._cpDirty=!0,i._needUpdate()})),i._onCanvasBoundary=r.canvas.on("boundary",(function(){i._cpDirty=!0,i._needUpdate(0)})),i._onMetricsUnits=r.metrics.on("units",(function(){i._cpDirty=!0,i._needUpdate()})),i._onMetricsScale=r.metrics.on("scale",(function(){i._cpDirty=!0,i._needUpdate()})),i._onMetricsOrigin=r.metrics.on("origin",(function(){i._cpDirty=!0,i._needUpdate()})),i._onSectionPlaneUpdated=r.on("sectionPlaneUpdated",(function(){i._sectionPlanesDirty=!0,i._needUpdate()})),i.precision=void 0!==s.precision?s.precision:2,i.approximate=void 0===s.approximate||s.approximate,i.visible=s.visible,i.originVisible=s.originVisible,i.targetVisible=s.targetVisible,i.wireVisible=s.wireVisible,i.axisVisible=s.axisVisible,i.xAxisVisible=s.xAxisVisible,i.yAxisVisible=s.yAxisVisible,i.zAxisVisible=s.zAxisVisible,i.labelsVisible=s.labelsVisible,i.labelsOnWires=s.labelsOnWires,i._xLabel=null,i._yLabel=null,i._zLabel=null,i}return m(t,_e),w(t,[{key:"_update",value:function(){if(this._visible){var e=this.plugin.viewer.scene;if(this._wpDirty&&(this._wp[0]=this._originWorld[0],this._wp[1]=this._originWorld[1],this._wp[2]=this._originWorld[2],this._wp[3]=1,this._wp[4]=this._targetWorld[0],this._wp[5]=this._originWorld[1],this._wp[6]=this._originWorld[2],this._wp[7]=1,this._wp[8]=this._targetWorld[0],this._wp[9]=this._targetWorld[1],this._wp[10]=this._originWorld[2],this._wp[11]=1,this._wp[12]=this._targetWorld[0],this._wp[13]=this._targetWorld[1],this._wp[14]=this._targetWorld[2],this._wp[15]=1,this._wpDirty=!1,this._vpDirty=!0),this._vpDirty&&(J.transformPositions4(e.camera.viewMatrix,this._wp,this._vp),this._vp[3]=1,this._vp[7]=1,this._vp[11]=1,this._vp[15]=1,this._vpDirty=!1,this._cpDirty=!0),this._sectionPlanesDirty){if(this._isSliced(this._originWorld)||this._isSliced(this._targetWorld))return this._xAxisLabel.setCulled(!0),this._yAxisLabel.setCulled(!0),this._zAxisLabel.setCulled(!0),this._lengthLabel.setCulled(!0),this._xAxisWire.setCulled(!0),this._yAxisWire.setCulled(!0),this._zAxisWire.setCulled(!0),this._lengthWire.setCulled(!0),this._originDot.setCulled(!0),void this._targetDot.setCulled(!0);this._xAxisLabel.setCulled(!1),this._yAxisLabel.setCulled(!1),this._zAxisLabel.setCulled(!1),this._lengthLabel.setCulled(!1),this._xAxisWire.setCulled(!1),this._yAxisWire.setCulled(!1),this._zAxisWire.setCulled(!1),this._lengthWire.setCulled(!1),this._originDot.setCulled(!1),this._targetDot.setCulled(!1),this._sectionPlanesDirty=!0}var t=this._originMarker.viewPos[2],i=this._targetMarker.viewPos[2];if(t>-.3||i>-.3)return this._xAxisLabel.setCulled(!0),this._yAxisLabel.setCulled(!0),this._zAxisLabel.setCulled(!0),this._lengthLabel.setCulled(!0),this._xAxisWire.setVisible(!1),this._yAxisWire.setVisible(!1),this._zAxisWire.setVisible(!1),this._lengthWire.setVisible(!1),this._originDot.setVisible(!1),void this._targetDot.setVisible(!1);if(this._cpDirty){J.transformPositions4(e.camera.project.matrix,this._vp,this._pp);for(var s=this._pp,r=this._cp,n=e.canvas.canvas.getBoundingClientRect(),o=this._container.getBoundingClientRect(),a=n.top-o.top,l=n.left-o.left,u=e.canvas.boundary,A=u[2],c=u[3],h=0,d=this.plugin.viewer.scene.metrics,p=d.scale,f=d.units,v=d.unitsInfo[f].abbrev,g=0,m=s.length;g<m;g+=4)r[h]=l+Math.floor((1+s[g+0]/s[g+3])*A/2),r[h+1]=a+Math.floor((1-s[g+1]/s[g+3])*c/2),h+=2;if(this._originDot.setPos(r[0],r[1]),this._targetDot.setPos(r[6],r[7]),this._lengthWire.setStartAndEnd(r[0],r[1],r[6],r[7]),this._xAxisWire.setStartAndEnd(r[0],r[1],r[2],r[3]),this._yAxisWire.setStartAndEnd(r[2],r[3],r[4],r[5]),this._zAxisWire.setStartAndEnd(r[4],r[5],r[6],r[7]),this.labelsVisible){if(this._lengthLabel.setPosOnWire(r[0],r[1],r[6],r[7]),this.labelsOnWires)this._xAxisLabel.setPosOnWire(r[0],r[1],r[2],r[3]),this._yAxisLabel.setPosOnWire(r[2],r[3],r[4],r[5]),this._zAxisLabel.setPosOnWire(r[4],r[5],r[6],r[7]);else{var _=35;this._xAxisLabel.setPosOnWire(r[0],r[1]+_,r[6],r[7]+_),_+=35,this._yAxisLabel.setPosOnWire(r[0],r[1]+_,r[6],r[7]+_),_+=35,this._zAxisLabel.setPosOnWire(r[0],r[1]+_,r[6],r[7]+_)}var y=this._approximate?" ":" = ";this._length=Math.abs(J.lenVec3(J.subVec3(this._targetWorld,this._originWorld,kh))),this._lengthLabel.setText(y+(this._length*p).toFixed(this._precision)+v);var b=Math.abs(Fh(r[0],r[1],r[2],r[3])),B=Math.abs(Fh(r[2],r[3],r[4],r[5])),x=Math.abs(Fh(r[4],r[5],r[6],r[7])),w=this.plugin.labelMinAxisLength;this.labelsOnWires?(this._xAxisLabelCulled=b<w,this._yAxisLabelCulled=B<w,this._zAxisLabelCulled=x<w):(this._xAxisLabelCulled=!1,this._yAxisLabelCulled=!1,this._zAxisLabelCulled=!1),this._xAxisLabelCulled?this._xAxisLabel.setCulled(!0):(this._xLabel=Math.abs((this._targetWorld[0]-this._originWorld[0])*p).toFixed(this._precision),this._xAxisLabel.setText(y+this._xLabel+v),this._xAxisLabel.setCulled(!this.axisVisible)),this._yAxisLabelCulled?this._yAxisLabel.setCulled(!0):(this._yLabel=Math.abs((this._targetWorld[1]-this._originWorld[1])*p).toFixed(this._precision),this._yAxisLabel.setText(y+this._yLabel+v),this._yAxisLabel.setCulled(!this.axisVisible)),this._zAxisLabelCulled?this._zAxisLabel.setCulled(!0):(this._zLabel=Math.abs((this._targetWorld[2]-this._originWorld[2])*p).toFixed(this._precision),this._zAxisLabel.setText(y+this._zLabel+v),this._zAxisLabel.setCulled(!this.axisVisible))}else this._lengthLabel.setCulled(!0),this._xAxisLabel.setCulled(!0),this._yAxisLabel.setCulled(!0),this._zAxisLabel.setCulled(!0);this._originDot.setVisible(this._visible&&this._originVisible),this._targetDot.setVisible(this._visible&&this._targetVisible),this._xAxisWire.setVisible(this.axisVisible&&this.xAxisVisible),this._yAxisWire.setVisible(this.axisVisible&&this.yAxisVisible),this._zAxisWire.setVisible(this.axisVisible&&this.zAxisVisible),this._lengthWire.setVisible(this.wireVisible),this._lengthLabel.setCulled(!this.wireVisible),this._cpDirty=!1}}}},{key:"_isSliced",value:function(e){for(var t=this.scene._sectionPlanesState.sectionPlanes,i=0,s=t.length;i<s;i++){var r=t[i];if(J.planeClipsPositions3(r.pos,r.dir,e,4))return!0}return!1}},{key:"approximate",get:function(){return this._approximate},set:function(e){e=!1!==e,this._approximate!==e&&(this._approximate=e,this._cpDirty=!0,this._needUpdate(0))}},{key:"precision",get:function(){return this._precision},set:function(e){this._precision!==e&&(this._precision=e,this._cpDirty=!0,this._needUpdate(0))}},{key:"origin",get:function(){return this._originMarker}},{key:"target",get:function(){return this._targetMarker}},{key:"length",get:function(){this._update();var e=this.plugin.viewer.scene.metrics.scale;return this._length*e}},{key:"color",get:function(){return this._color},set:function(e){this._color=e,this._originDot.setFillColor(e),this._targetDot.setFillColor(e),this._lengthWire.setColor(e||"#0065FC"),this._lengthLabel.setFillColor(e||"#0065FC")}},{key:"visible",get:function(){return this._visible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultVisible,this._visible=e,this._originDot.setVisible(this._visible&&this._originVisible),this._targetDot.setVisible(this._visible&&this._targetVisible),this._lengthWire.setVisible(this._visible&&this._wireVisible),this._lengthLabel.setVisible(this._visible&&this._wireVisible);var t=this._visible&&this._axisVisible&&this._xAxisVisible,i=this._visible&&this._axisVisible&&this._yAxisVisible,s=this._visible&&this._axisVisible&&this._zAxisVisible;this._xAxisWire.setVisible(t),this._yAxisWire.setVisible(i),this._zAxisWire.setVisible(s),this._xAxisLabel.setVisible(t&&!this._xAxisLabelCulled),this._yAxisLabel.setVisible(i&&!this._yAxisLabelCulled),this._zAxisLabel.setVisible(s&&!this._zAxisLabelCulled),this._cpDirty=!0,this._needUpdate()}},{key:"originVisible",get:function(){return this._originVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultOriginVisible,this._originVisible=e,this._originDot.setVisible(this._visible&&this._originVisible)}},{key:"targetVisible",get:function(){return this._targetVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultTargetVisible,this._targetVisible=e,this._targetDot.setVisible(this._visible&&this._targetVisible)}},{key:"xLabel",get:function(){return this._xLabel}},{key:"yLabel",get:function(){return this._yLabel}},{key:"zLabel",get:function(){return this._zLabel}},{key:"axisEnabled",get:function(){return this._axisEnabled},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultAxisVisible,this._axisEnabled=e;var t=this._visible&&this._axisVisible&&this._axisEnabled;this._xAxisWire.setVisible(t&&this._xAxisVisible),this._yAxisWire.setVisible(t&&this._yAxisVisible),this._zAxisWire.setVisible(t&&this._zAxisVisible),this._xAxisLabel.setVisible(t&&!this._xAxisLabelCulled&&this._xAxisVisible),this._yAxisLabel.setVisible(t&&!this._yAxisLabelCulled&&this._xAxisVisible),this._zAxisLabel.setVisible(t&&!this._zAxisLabelCulled&&this._xAxisVisible),this._cpDirty=!0,this._needUpdate()}},{key:"axisVisible",get:function(){return this._axisVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultAxisVisible,this._axisVisible=e;var t=this._visible&&this._axisVisible&&this._axisEnabled;this._xAxisWire.setVisible(t&&this._xAxisVisible),this._yAxisWire.setVisible(t&&this._yAxisVisible),this._zAxisWire.setVisible(t&&this._zAxisVisible),this._xAxisLabel.setVisible(t&&!this._xAxisLabelCulled&&this._xAxisVisible),this._yAxisLabel.setVisible(t&&!this._yAxisLabelCulled&&this._yAxisVisible),this._zAxisLabel.setVisible(t&&!this._zAxisLabelCulled&&this._zAxisVisible),this._cpDirty=!0,this._needUpdate()}},{key:"xAxisVisible",get:function(){return this._xAxisVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultAxisVisible,this._xAxisVisible=e;var t=this._visible&&this._axisVisible&&this._xAxisVisible&&this._axisEnabled;this._xAxisWire.setVisible(t),this._xAxisLabel.setVisible(t&&!this._xAxisLabelCulled),this._cpDirty=!0,this._needUpdate()}},{key:"yAxisVisible",get:function(){return this._yAxisVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultAxisVisible,this._yAxisVisible=e;var t=this._visible&&this._axisVisible&&this._yAxisVisible&&this._axisEnabled;this._yAxisWire.setVisible(t),this._yAxisLabel.setVisible(t&&!this._yAxisLabelCulled),this._cpDirty=!0,this._needUpdate()}},{key:"zAxisVisible",get:function(){return this._zAxisVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultAxisVisible,this._zAxisVisible=e;var t=this._visible&&this._axisVisible&&this._zAxisVisible&&this._axisEnabled;this._zAxisWire.setVisible(t),this._zAxisLabel.setVisible(t&&!this._zAxisLabelCulled),this._cpDirty=!0,this._needUpdate()}},{key:"wireVisible",get:function(){return this._wireVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultWireVisible,this._wireVisible=e;var t=this._visible&&this._wireVisible;this._lengthLabel.setVisible(t),this._lengthWire.setVisible(t)}},{key:"labelsVisible",get:function(){return this._labelsVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultLabelsVisible,this._labelsVisible=e;var t=this._visible&&this._labelsVisible;this._xAxisLabel.setVisible(t&&!this._xAxisLabelCulled&&this._clickable&&this._axisEnabled),this._yAxisLabel.setVisible(t&&!this._yAxisLabelCulled&&this._clickable&&this._axisEnabled),this._zAxisLabel.setVisible(t&&!this._zAxisLabelCulled&&this._clickable&&this._axisEnabled),this._lengthLabel.setVisible(t),this._cpDirty=!0,this._needUpdate()}},{key:"labelsOnWires",get:function(){return this._labelsOnWires},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultLabelsOnWires,this._labelsOnWires=e}},{key:"setHighlighted",value:function(e){this._originDot.setHighlighted(e),this._targetDot.setHighlighted(e),this._xAxisWire.setHighlighted(e),this._yAxisWire.setHighlighted(e),this._zAxisWire.setHighlighted(e),this._xAxisLabel.setHighlighted(e),this._yAxisLabel.setHighlighted(e),this._zAxisLabel.setHighlighted(e),this._lengthWire.setHighlighted(e),this._lengthLabel.setHighlighted(e)}},{key:"clickable",get:function(){return this._clickable},set:function(e){e=!!e,this._clickable=e,this._originDot.setClickable(this._clickable),this._targetDot.setClickable(this._clickable),this._xAxisWire.setClickable(this._clickable),this._yAxisWire.setClickable(this._clickable),this._zAxisWire.setClickable(this._clickable),this._lengthWire.setClickable(this._clickable),this._xAxisLabel.setClickable(this._clickable),this._yAxisLabel.setClickable(this._clickable),this._zAxisLabel.setClickable(this._clickable),this._lengthLabel.setClickable(this._clickable)}},{key:"destroy",value:function(){var e=this.plugin.viewer.scene,i=e.metrics;this._onViewMatrix&&e.camera.off(this._onViewMatrix),this._onProjMatrix&&e.camera.off(this._onProjMatrix),this._onCanvasBoundary&&e.canvas.off(this._onCanvasBoundary),this._onMetricsUnits&&i.off(this._onMetricsUnits),this._onMetricsScale&&i.off(this._onMetricsScale),this._onMetricsOrigin&&i.off(this._onMetricsOrigin),this._onSectionPlaneUpdated&&e.off(this._onSectionPlaneUpdated),this._originDot.destroy(),this._targetDot.destroy(),this._xAxisWire.destroy(),this._yAxisWire.destroy(),this._zAxisWire.destroy(),this._lengthLabel.destroy(),this._xAxisLabel.destroy(),this._yAxisLabel.destroy(),this._zAxisLabel.destroy(),this._lengthWire.destroy(),f(t,"destroy",this,3)([])}}])}(),Dh=function(e){function t(){return B(this,t),h(this,t,arguments)}return m(t,_e),w(t,[{key:"active",get:function(){},set:function(e){}},{key:"snapping",get:function(){return!0},set:function(e){}},{key:"activate",value:function(){}},{key:"deactivate",value:function(){}},{key:"reset",value:function(){}},{key:"destroy",value:function(){}}])}(),Ih=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e.viewer.scene])).cfg=s,i.pointerLens=s.pointerLens,i._active=!1,i._activate=!1,i._currentDistanceMeasurement=null,i._currentDistanceMeasurementInitState={wireVisible:null,axisVisible:null,xAxisVisible:null,yaxisVisible:null,zAxisVisible:null,targetVisible:null},i._initMarkerDiv(),i._onMouseDown=null,i._onMouseUp=null,i._onCanvasTouchStart=null,i._onCanvasTouchEnd=null,i._snapping=!1!==s.snapping,i._mouseState=0,i._attachPlugin(e,s),i._offsetX=0|s._offsetX,i._offsetY=0|s._offsetY,i}return m(t,Dh),w(t,[{key:"_initMarkerDiv",value:function(){var e=document.createElement("div");e.setAttribute("id","myDistancePivotMarker");var t=this.scene.canvas.canvas;t.parentNode.insertBefore(e,t),e.style.background="black",e.style.border="2px solid blue",e.style.borderRadius="10px",e.style.width="5px",e.style.height="5px",e.style.margin="-200px -200px",e.style.zIndex="100",e.style.position="absolute",e.style.pointerEvents="none",this._markerDiv=e}},{key:"_destroyMarkerDiv",value:function(){this._markerDiv&&(this._markerDiv.parentNode.removeChild(this._markerDiv),this._markerDiv=null)}},{key:"_attachPlugin",value:function(e){this.distanceMeasurementsPlugin=e,this.plugin=e}},{key:"offsetX",get:function(){return this._offsetX},set:function(e){this._offsetX=e}},{key:"offsetY",get:function(){return this._offsetY},set:function(e){this._offsetY=e}},{key:"active",get:function(){return this._active},set:function(e){this._active=e}},{key:"snapping",get:function(){return this._snapping},set:function(e){this._snapping=e}},{key:"mouseState",get:function(){return this._mouseState},set:function(e){this._mouseState=e}},{key:"activate",value:function(){var e=this;if(!this._activate){this._markerDiv||this._initMarkerDiv(),this.fire("activated",!0);var t=this.distanceMeasurementsPlugin,i=!1;t.on("mouseOver",(function(e){i=!0})),t.on("mouseLeave",(function(e){i=!1})),t.on("measureDelete",(function(e){i=!1})),t.on("measurementDestroyed",(function(e){}));var s,r,n=this.scene,o=t.viewer.cameraControl,a=n.canvas.canvas,l=!1,u=J.vec3(),A=J.vec2(),c=null;this._mouseState=0;var h=function(t){if(e._active&&!i){var s=t.snappedCanvasPos||t.canvasPos;if(l=!0,u.set(t.worldPos),A.set(t.canvasPos),0===e._mouseState){var r=document.documentElement.scrollLeft,n=document.documentElement.scrollTop;e._markerDiv.style.marginLeft="".concat(e._offsetX+r+s[0]-5,"px"),e._markerDiv.style.marginTop="".concat(e._offsetY+n+s[1]-5,"px"),e._markerDiv.style.background="pink",t.snappedToVertex||t.snappedToEdge?(e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=t.canvasPos,e.pointerLens.snappedCanvasPos=t.snappedCanvasPos||t.canvasPos,e.pointerLens.snapped=!0),e._markerDiv.style.background="greenyellow",e._markerDiv.style.border="2px solid green"):(e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=t.canvasPos,e.pointerLens.snappedCanvasPos=t.canvasPos,e.pointerLens.snapped=!1),e._markerDiv.style.background="pink",e._markerDiv.style.border="2px solid red"),c=t.entity}else e._markerDiv.style.marginLeft="-10000px",e._markerDiv.style.marginTop="-10000px";a.style.cursor="pointer",e._currentDistanceMeasurement&&(e._currentDistanceMeasurement.wireVisible=e._currentDistanceMeasurementInitState.wireVisible,e._currentDistanceMeasurement.axisVisible=e._currentDistanceMeasurementInitState.axisVisible&&e.distanceMeasurementsPlugin.defaultAxisVisible,e._currentDistanceMeasurement.xAxisVisible=e._currentDistanceMeasurementInitState.xAxisVisible&&e.distanceMeasurementsPlugin.defaultXAxisVisible,e._currentDistanceMeasurement.yAxisVisible=e._currentDistanceMeasurementInitState.yAxisVisible&&e.distanceMeasurementsPlugin.defaultYAxisVisible,e._currentDistanceMeasurement.zAxisVisible=e._currentDistanceMeasurementInitState.zAxisVisible&&e.distanceMeasurementsPlugin.defaultZAxisVisible,e._currentDistanceMeasurement.targetVisible=e._currentDistanceMeasurementInitState.targetVisible,e._currentDistanceMeasurement.target.worldPos=u.slice(),e._markerDiv.style.marginLeft="-10000px",e._markerDiv.style.marginTop="-10000px")}};this._onHoverSnapOrSurface=o.on("hoverSnapOrSurface",(function(t){e._snapping&&h(t)})),this._onHoverSurface=o.on("hoverSurface",(function(t){e._snapping||h(t)})),a.addEventListener("mousedown",this._onMouseDown=function(t){e._active&&1===t.which&&(s=t.clientX,r=t.clientY)}),a.addEventListener("mouseup",this._onMouseUp=function(n){e._active&&(i||1===n.which&&(n.clientX>s+20||n.clientX<s-20||n.clientY>r+20||n.clientY<r-20||(e._currentDistanceMeasurement?l?(e._currentDistanceMeasurement.target.entity=c,c=null,e._currentDistanceMeasurement.clickable=!0,e.distanceMeasurementsPlugin.fire("measurementEnd",e._currentDistanceMeasurement),e._currentDistanceMeasurement=null):(e._currentDistanceMeasurement.destroy(),e.distanceMeasurementsPlugin.fire("measurementCancel",e._currentDistanceMeasurement),e._currentDistanceMeasurement=null,c=null):l&&(e._currentDistanceMeasurement=t.createMeasurement({id:J.createUUID(),origin:{worldPos:u.slice()},target:{worldPos:u.slice()},precision:t.precision,approximate:!0}),e._currentDistanceMeasurementInitState.axisVisible=e._currentDistanceMeasurement.axisVisible&&e.distanceMeasurementsPlugin.defaultAxisVisible,e._currentDistanceMeasurementInitState.xAxisVisible=e._currentDistanceMeasurement.xAxisVisible&&e.distanceMeasurementsPlugin.defaultXAxisVisible,e._currentDistanceMeasurementInitState.yAxisVisible=e._currentDistanceMeasurement.yAxisVisible&&e.distanceMeasurementsPlugin.defaultYAxisVisible,e._currentDistanceMeasurementInitState.zAxisVisible=e._currentDistanceMeasurement.zAxisVisible&&e.distanceMeasurementsPlugin.defaultZAxisVisible,e._currentDistanceMeasurementInitState.wireVisible=e._currentDistanceMeasurement.wireVisible,e._currentDistanceMeasurementInitState.targetVisible=e._currentDistanceMeasurement.targetVisible,e._currentDistanceMeasurement.clickable=!1,e._currentDistanceMeasurement.origin.entity=c,c=null,e.fire("measurementStart",e._currentDistanceMeasurement)))))}),this.markerHidden=function(t){e._markerDiv&&t.target!==a&&(e._markerDiv.style.marginLeft="-100px",e._markerDiv.style.marginTop="-100px")},document.addEventListener("mousemove",this.markerHidden);var d=function(t){e._active&&(e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=t.canvasPos,e.pointerLens.snappedCanvasPos=t.snappedCanvasPos||t.canvasPos),l=!1,e._markerDiv.style.marginLeft="-100px",e._markerDiv.style.marginTop="-100px",e._currentDistanceMeasurement&&(e._currentDistanceMeasurement.wireVisible=!1,e._currentDistanceMeasurement.targetVisible=!1,e._currentDistanceMeasurement.axisVisible=!1),a.style.cursor="default")};this._onHoverSnapOrSurfaceOff=o.on("hoverSnapOrSurfaceOff",(function(t){e._snapping&&d(t)})),this._onHoverOff=o.on("hoverOff",(function(t){e._snapping||d(t)})),this._activate=!0}}},{key:"deactivate",value:function(){if(this._active){this.fire("activated",!1),this.pointerLens&&(this.pointerLens.visible=!1),this.reset();var e=this.scene.canvas.canvas;e.removeEventListener("mousedown",this._onMouseDown),e.removeEventListener("mouseup",this._onMouseUp);var t=this.distanceMeasurementsPlugin.viewer.cameraControl;t.off(this._onHoverSnapOrSurface),t.off(this._onHoverSurface),t.off(this._onHoverSnapOrSurfaceOff),t.off(this._onHoverOff),document.removeEventListener("mousemove",this.markerHidden),this._currentDistanceMeasurement&&(this.distanceMeasurementsPlugin.fire("measurementCancel",this._currentDistanceMeasurement),this._currentDistanceMeasurement.destroy(),this._currentDistanceMeasurement=null),this._active=!1}}},{key:"reset",value:function(){this._active&&this._currentDistanceMeasurement&&(this.distanceMeasurementsPlugin.fire("measurementCancel",this._currentDistanceMeasurement),this._currentDistanceMeasurement.destroy(),this._currentDistanceMeasurement=null)}},{key:"destroy",value:function(){this.deactivate(),this._destroyMarkerDiv(),this.pointerLens&&this.pointerLens.destroy(),f(t,"destroy",this,3)([])}}])}(),Sh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,["DistanceMeasurements",e]))._pointerLens=s.pointerLens,i._container=s.container||e.viewerElement||document.body,i._defaultControl=null,i._measurements={},i.labelMinAxisLength=s.labelMinAxisLength,i.defaultVisible=!1!==s.defaultVisible,i.defaultOriginVisible=!1!==s.defaultOriginVisible,i.defaultTargetVisible=!1!==s.defaultTargetVisible,i.defaultWireVisible=!1!==s.defaultWireVisible,i.defaultLabelsVisible=!1!==s.defaultLabelsVisible,i.defaultAxisVisible=!1!==s.defaultAxisVisible,i.defaultXAxisVisible=!1!==s.defaultXAxisVisible,i.defaultYAxisVisible=!1!==s.defaultYAxisVisible,i.defaultZAxisVisible=!1!==s.defaultZAxisVisible,i.defaultLabelsOnWires=!1!==s.defaultLabelsOnWires,i.defaultColor=void 0!==s.defaultColor?s.defaultColor:"#0065fc",i.zIndex=s.zIndex||1e4,i.precision=void 0!==s.precision?s.precision:2,i._onMouseOver=function(e,t){i.fire("mouseOver",{plugin:i,distanceMeasurement:t,measurement:t,event:e})},i._onMouseLeave=function(e,t){i.fire("mouseLeave",{plugin:i,distanceMeasurement:t,measurement:t,event:e})},i._onMouseClick=function(e,t){i.fire("clickMeasure",{plugin:i,distanceMeasurement:t,measurement:t,event:e})},i._onTouchStart=function(e,t){i.fire("touchMeasure",{plugin:i,distanceMeasurement:t,measurement:t,event:e})},i._onContextMenu=function(e,t){i.fire("contextMenu",{plugin:i,distanceMeasurement:t,measurement:t,event:e})},i}return m(t,me),w(t,[{key:"precision",get:function(){return this._precision},set:function(e){if(this._precision!=e&&(this._precision=e,this.measureNum>0))for(var t in this.measurements)this.measurements[t].precision=e}},{key:"scale",get:function(){return this._scale},set:function(e){if(this._scale!=e&&(this._scale=e,this.measureNum>0))for(var t in this.measurements)this.measurements[t].scale=e}},{key:"measureNum",get:function(){return Object.keys(this.measurements).length}},{key:"getContainerElement",value:function(){return this._container}},{key:"send",value:function(e,t){}},{key:"pointerLens",get:function(){return this._pointerLens}},{key:"control",get:function(){return this._defaultControl||(this._defaultControl=new Ih(this,{})),this._defaultControl}},{key:"measurements",get:function(){return this._measurements}},{key:"labelMinAxisLength",get:function(){return this._labelMinAxisLength},set:function(e){e<1&&(this.error("labelMinAxisLength must be >= 1; defaulting to 25"),e=25),this._labelMinAxisLength=e||25}},{key:"createMeasurement",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.viewer.scene.components[t.id]&&(this.error("Viewer scene component with this ID already exists: "+t.id),delete t.id);var i=t.origin,s=t.target,r=new Eh(this,{id:t.id,plugin:this,container:this._container,origin:{entity:i.entity,worldPos:i.worldPos},target:{entity:s.entity,worldPos:s.worldPos},borderColor:t.borderColor,color:t.color,visible:t.visible,originVisible:t.originVisible,targetVisible:t.targetVisible,wireVisible:t.wireVisible,axisVisible:!1!==t.axisVisible&&!1!==this.defaultAxisVisible,xAxisVisible:!1!==t.xAxisVisible&&!1!==this.defaultXAxisVisible,yAxisVisible:!1!==t.yAxisVisible&&!1!==this.defaultYAxisVisible,zAxisVisible:!1!==t.zAxisVisible&&!1!==this.defaultZAxisVisible,labelsVisible:!1!==t.labelsVisible&&!1!==this.defaultLabelsVisible,labelsOnWires:!1!==t.labelsOnWires&&!1!==this.defaultLabelsOnWires,onMouseOver:this._onMouseOver,onMouseLeave:this._onMouseLeave,onMouseClick:this._onMouseClick,onTouchStart:this._onTouchStart,onContextMenu:this._onContextMenu,precision:this._precision});return this._measurements[r.id]=r,r.on("destroyed",(function(){delete e._measurements[r.id]})),this.fire("measurementCreated",r),r}},{key:"destroyMeasurement",value:function(e){var t=this._measurements[e];t?(t.destroy(),this.fire("measurementDestroyed",t)):this.log("DistanceMeasurement not found: "+e)}},{key:"setLabelsShown",value:function(e){for(var t=0,i=Object.entries(this.measurements);t<i.length;t++){var s=u(i[t],2);s[0];s[1].labelShown=e}}},{key:"setMeasurementsShown",value:function(e){for(var t in this.measurements)this.measurements[t].visible=e}},{key:"setAxisVisible",value:function(e){for(var t=0,i=Object.entries(this.measurements);t<i.length;t++){var s=u(i[t],2);s[0];s[1].axisVisible=e}this.defaultAxisVisible=e}},{key:"getAxisVisible",value:function(){return this.defaultAxisVisible}},{key:"clear",value:function(){for(var e=Object.keys(this._measurements),t=0,i=e.length;t<i;t++)this.destroyMeasurement(e[t])}},{key:"destroy",value:function(){this.clear(),f(t,"destroy",this,3)([])}}])}(),Th=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e.viewer.scene])).pointerLens=s.pointerLens,i.pointerCircle=new Ze(e.viewer,{id:"distanceMeasure_Circle"}),i._active=!1,i._activate=!1,i._initMarkerDiv(),i._currentDistanceMeasurement=null,i._currentDistanceMeasurementInitState={wireVisible:null,axisVisible:null,xAxisVisible:null,yaxisVisible:null,zAxisVisible:null,targetVisible:null},i._onCanvasTouchStart=null,i._onCanvasTouchEnd=null,i._longTouchTimeoutMs=300,i._snapping=!1!==s.snapping,i._snapToEdge=!1!==s.snapping,i._snapToVertex=!1!==s.snapping,i._touchState=0,i._attachPlugin(e,s),i._offsetX=0|s._offsetX,i._offsetY=0|s._offsetY,i}return m(t,Dh),w(t,[{key:"_initMarkerDiv",value:function(){var e=document.createElement("div");e.setAttribute("id","myDistanceMeasureTouchMarker");var t=this.scene.canvas.canvas;t.parentNode.insertBefore(e,t),e.style.background="black",e.style.border="2px solid blue",e.style.borderRadius="10px",e.style.width="5px",e.style.height="5px",e.style.margin="-200px -200px",e.style.zIndex="100",e.style.position="absolute",e.style.pointerEvents="none",this.markerDiv=e}},{key:"_destroyMarkerDiv",value:function(){this.markerDiv&&(this.markerDiv.parentNode.removeChild(this.markerDiv),this.markerDiv=null)}},{key:"_attachPlugin",value:function(e){this.distanceMeasurementsPlugin=e,this.plugin=e}},{key:"offsetX",get:function(){return this._offsetX},set:function(e){this._offsetX=e}},{key:"offsetY",get:function(){return this._offsetY},set:function(e){this._offsetY=e}},{key:"active",get:function(){return this._active},set:function(e){this._active=e}},{key:"snapping",get:function(){return this._snapping},set:function(e){e!==this._snapping?(this._snapping=e,this.deactivate(),this.activate()):this._snapping=e}},{key:"touchState",get:function(){return this._touchState},set:function(e){this._touchState=e}},{key:"activate",value:function(){var e=this;if(!this._activate){var t=this.plugin,i=this.scene,s=i.canvas.canvas;this.pointerLens;var r=J.vec3(),n=20,o=null;this._touchState=0;var a=J.vec2(),l=J.vec2(),u=J.vec2(),A=null,c=function(){e.plugin.viewer.cameraControl.active=!1},h=function(){e.plugin.viewer.cameraControl.active=!0};s.addEventListener("touchstart",this._onCanvasTouchStart=function(s){if(e._active&&s.isTrusted){var u=s.touches.length;if(1===u){var d=s.touches[0],p=d.clientX,f=d.clientY;switch(a.set([p+e.offsetX,f+e.offsetY]),l.set([p+e.offsetX,f+e.offsetY]),e._touchState){case 0:if(1!==u&&null!==o)return o&&(clearTimeout(o),o=null),e._currentDistanceMeasurement&&(e._currentDistanceMeasurement.destroy(),e._currentDistanceMeasurement=null),h(),void(e._touchState=0);var v=i.pick({canvasPos:l,snapping:e._snapping,snapToEdge:e._snapping});if(v&&v.snapped)r.set(v.worldPos),e.pointerCircle.start(v.snappedCanvasPos);else{var g=i.pick({canvasPos:l,pickSurface:!0});if(!g||!g.worldPos)return;r.set(g.worldPos),e.pointerCircle.start(g.canvasPos)}o=setTimeout((function(){1!==u||l[0]>a[0]+n||l[0]<a[0]-n||l[1]>a[1]+n||l[1]<a[1]-n||(e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=a,e.pointerLens.cursorPos=a),e.pointerLens&&(e.pointerLens.canvasPos=l,e.pointerLens.snapped=!1),e.pointerLens&&(e.pointerLens.cursorPos=v.canvasPos,e.pointerLens.snapped=!0),e._currentDistanceMeasurement?e._currentDistanceMeasurement.origin.worldPos=r:(e._currentDistanceMeasurement=t.createMeasurement({id:J.createUUID(),origin:{worldPos:r,entity:v.entity},target:{worldPos:r,entity:v.entity},precision:t.precision}),e._currentDistanceMeasurement.labelsVisible=!1,e._currentDistanceMeasurement.xAxisVisible=!1,e._currentDistanceMeasurement.yAxisVisible=!1,e._currentDistanceMeasurement.zAxisVisible=!1,e._currentDistanceMeasurement.wireVisible=!1,e._currentDistanceMeasurement.originVisible=!0,e._currentDistanceMeasurement.targetVisible=!1,e._currentDistanceMeasurement.clickable=!1),e.distanceMeasurementsPlugin.fire("measurementStart",e._currentDistanceMeasurement),e._touchState=2,c())}),e._longTouchTimeoutMs),e._touchState=1,A=d.identifier;break;case 3:if(1!==u&&null!==o)return clearTimeout(o),void(o=null);1===u&&(o=setTimeout((function(){if(o=null,!(1!==u||l[0]>a[0]+n||l[0]<a[0]-n||l[1]>a[1]+n||l[1]<a[1]-n)){e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=a,e.pointerLens.snapped=!1);var t=i.pick({canvasPos:l,snapToVertex:e._snapping,snapToEdge:e._snapping});if(t&&t.snapped)e.pointerLens&&(e.pointerLens.cursorPos=t.snappedCanvasPos,e.pointerLens.snapped=!0),e.pointerCircle.start(t.snappedCanvasPos),r.set(t.worldPos),e._currentDistanceMeasurement.target.worldPos=t.worldPos,e._currentDistanceMeasurement.target.entity=t.entity,e._currentDistanceMeasurement.targetVisible=!0,e._currentDistanceMeasurement.wireVisible=!0,e._currentDistanceMeasurement.labelsVisible=!0,e.distanceMeasurementsPlugin.fire("measurementStart",e._currentDistanceMeasurement);else{var s=i.pick({canvasPos:l,pickSurface:!0});s&&s.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=s.canvasPos,e.pointerLens.snapped=!1),e.pointerCircle.start(s.canvasPos),r.set(s.worldPos),e._currentDistanceMeasurement.target.worldPos=s.worldPos,e._currentDistanceMeasurement.target.entity=s.entity,e._currentDistanceMeasurement.targetVisible=!0,e._currentDistanceMeasurement.wireVisible=!0,e._currentDistanceMeasurement.labelsVisible=!0,e.distanceMeasurementsPlugin.fire("measurementStart",e._currentDistanceMeasurement)):e.pointerLens&&(e.pointerLens.cursorPos=null,e.pointerLens.snapped=!1)}e._touchState=5,c()}}),e._longTouchTimeoutMs),e._touchState=4),A=d.identifier;break;default:return null!==o&&(clearTimeout(o),o=null),void(e._touchState=7)}}else o&&(clearTimeout(o),o=null)}},{passive:!0}),s.addEventListener("touchmove",(function(s){if(e._active){e.pointerCircle.stop();var n=s.touches.length;if(1===n&&1===s.changedTouches.length){var a,u,c=s.touches[0],h=c.clientX,d=c.clientY;if(c.identifier===A)switch(l.set([h+e.offsetX,d+e.offsetY]),e._touchState){case 2:e.pointerLens&&(e.pointerLens.canvasPos=l),(a=i.pick({canvasPos:l,snapToVertex:e._snapping,snapToEdge:e._snapping}))&&a.snapped?(e.pointerLens&&(e.pointerLens.snappedCanvasPos=a.snappedCanvasPos,e.pointerLens.snapped=!0),r.set(a.worldPos),e._currentDistanceMeasurement?e._currentDistanceMeasurement.origin.worldPos=a.worldPos:(e._currentDistanceMeasurement=t.createMeasurement({id:J.createUUID(),origin:{worldPos:a.worldPos,entity:a.entity},target:{worldPos:a.worldPos,entity:a.entity},precision:t.precision}),e._currentDistanceMeasurement.labelsVisible=!1,e._currentDistanceMeasurement.xAxisVisible=!1,e._currentDistanceMeasurement.yAxisVisible=!1,e._currentDistanceMeasurement.zAxisVisible=!1,e._currentDistanceMeasurement.wireVisible=!1,e._currentDistanceMeasurement.originVisible=!0,e._currentDistanceMeasurement.targetVisible=!1,e._currentDistanceMeasurement.clickable=!1),e.distanceMeasurementsPlugin.fire("measurementStart",e._currentDistanceMeasurement)):(u=i.pick({canvasPos:l,pickSurface:!0}))&&u.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=u.canvasPos,e.pointerLens.snapped=!1),r.set(u.worldPos),e._currentDistanceMeasurement?e._currentDistanceMeasurement.origin.worldPos=u.worldPos:(e._currentDistanceMeasurement=t.createMeasurement({id:J.createUUID(),origin:{worldPos:u.worldPos,entity:u.entity},target:{worldPos:u.worldPos,entity:u.entity},precision:t.precision}),e._currentDistanceMeasurement.labelsVisible=!1,e._currentDistanceMeasurement.xAxisVisible=!1,e._currentDistanceMeasurement.yAxisVisible=!1,e._currentDistanceMeasurement.zAxisVisible=!1,e._currentDistanceMeasurement.wireVisible=!1,e._currentDistanceMeasurement.originVisible=!0,e._currentDistanceMeasurement.targetVisible=!1,e._currentDistanceMeasurement.clickable=!1),e.distanceMeasurementsPlugin.fire("measurementStart",e._currentDistanceMeasurement)):e.pointerLens&&(e.pointerLens.cursorPos=null,e.pointerLens.snapped=!1),e._touchState=2;break;case 5:if(1!==n&&null!==o)return clearTimeout(o),o=null,e.pointerLens&&(e.pointerLens.visible=!1),void(e._touchState=7);e.pointerLens&&(e.pointerLens.canvasPos=l),(a=i.pick({canvasPos:l,snapToVertex:e._snapping,snapToEdge:e._snapping}))&&a.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=a.snappedCanvasPos,e.pointerLens.snapped=!0),e._currentDistanceMeasurement.target.worldPos=a.worldPos,e._currentDistanceMeasurement.target.entity=a.entity,e._currentDistanceMeasurement.targetVisible=!0,e._currentDistanceMeasurement.wireVisible=!0,e._currentDistanceMeasurement.labelsVisible=!0):(u=i.pick({canvasPos:l,pickSurface:!0}))&&u.worldPos&&(e.pointerLens&&(e.pointerLens.cursorPos=u.canvasPos,e.pointerLens.snapped=!1),e._currentDistanceMeasurement.target.worldPos=u.worldPos,e._currentDistanceMeasurement.target.entity=u.entity,e._currentDistanceMeasurement.targetVisible=!0,e._currentDistanceMeasurement.wireVisible=!0,e._currentDistanceMeasurement.labelsVisible=!0),e._touchState=5}}else o&&(clearTimeout(o),o=null)}}),{passive:!0}),s.addEventListener("touchend",this._onCanvasTouchEnd=function(s){if(e._active){e.pointerCircle.stop();var r=s.changedTouches.length;if(1===r){var c=s.changedTouches[0],d=c.clientX,p=c.clientY;if(c.identifier===A)switch(o&&(clearTimeout(o),o=null),u.set([d,p]),e._touchState){case 1:if(1!==r||d>a[0]+n||d<a[0]-n||p>a[1]+n||p<a[1]-n)return void(e._touchState=0);var f=i.pick({canvasPos:l,pickSurface:!0});f&&f.worldPos?(e._currentDistanceMeasurement=t.createMeasurement({id:J.createUUID(),origin:{worldPos:f.worldPos,entity:f.entity},target:{worldPos:f.worldPos,entity:f.entity},precision:t.precision}),e._currentDistanceMeasurement.labelsVisible=!1,e._currentDistanceMeasurement.xAxisVisible=!1,e._currentDistanceMeasurement.yAxisVisible=!1,e._currentDistanceMeasurement.zAxisVisible=!1,e._currentDistanceMeasurement.wireVisible=!1,e._currentDistanceMeasurement.originVisible=!0,e._currentDistanceMeasurement.targetVisible=!1,e._touchState=3,e.distanceMeasurementsPlugin.fire("measurementStart",e._currentDistanceMeasurement)):(e._currentDistanceMeasurement&&e._currentDistanceMeasurement.destroy(),e._touchState=0),h();break;case 2:e.pointerLens&&(e.pointerLens.visible=!1),e._currentDistanceMeasurement?e._touchState=3:(e.pointerLens&&(e.pointerLens.snapped=!1,e.pointerLens.visible=!1),e._touchState=0),h();break;case 4:if(1!==r||d>a[0]+n||d<a[0]-n||p>a[1]+n||p<a[1]-n)return void(e._touchState=3);var v=i.pick({canvasPos:l,pickSurface:!0});v&&v.worldPos?(e._currentDistanceMeasurement.target.worldPos=v.worldPos,e._currentDistanceMeasurement.target.entity=v.entity,e._currentDistanceMeasurement.targetVisible=!0,e._currentDistanceMeasurement.wireVisible=!0,e._currentDistanceMeasurement.labelsVisible=!0,e._currentDistanceMeasurement.clickable=!0,e.distanceMeasurementsPlugin.fire("measurementEnd",e._currentDistanceMeasurement),e._currentDistanceMeasurement=null):e._currentDistanceMeasurement&&(e._currentDistanceMeasurement.destroy(),e._currentDistanceMeasurement=null),e._touchState=0,h();break;case 5:e.pointerLens&&(e.pointerLens.visible=!1),e._currentDistanceMeasurement&&e._currentDistanceMeasurement.targetVisible?(e._currentDistanceMeasurement.clickable=!0,e.distanceMeasurementsPlugin.fire("measurementEnd",e._currentDistanceMeasurement),e._currentDistanceMeasurement=null,e._touchState=0):(e._currentDistanceMeasurement&&(e._currentDistanceMeasurement.destroy(),e._currentDistanceMeasurement=null),e._touchState=0),h()}}}},{passive:!0}),s.addEventListener("touchcancel",this._onCanvasTouchEnd),this._activate=!0}}},{key:"deactivate",value:function(){if(this._active){this.pointerLens&&(this.pointerLens.visible=!1),this.reset();var e=this.plugin.viewer.scene.canvas.canvas;e.removeEventListener("touchstart",this._onCanvasTouchStart),e.removeEventListener("touchend",this._onCanvasTouchEnd),e.removeEventListener("touchcancel",this._onCanvasTouchEnd),this._currentDistanceMeasurement&&(this.distanceMeasurementsPlugin.fire("measurementCancel",this._currentDistanceMeasurement),this._currentDistanceMeasurement.destroy(),this._currentDistanceMeasurement=null),this._active=!1,this.plugin.viewer.cameraControl.active=!0}}},{key:"reset",value:function(){this._active&&this._currentDistanceMeasurement&&(this.distanceMeasurementsPlugin.fire("measurementCancel",this._currentDistanceMeasurement),this._currentDistanceMeasurement.destroy(),this._currentDistanceMeasurement=null)}},{key:"destroy",value:function(){this.deactivate(),this._destroyMarkerDiv(),this.pointerLens&&this.pointerLens.destroy(),this.pointerCircle&&this.pointerCircle.destroy(),f(t,"destroy",this,3)([])}}])}(),Lh=function(e){function t(e){var i,s,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(r=h(this,t,[e.viewer.scene])).cfg=n,r.snapRadius=n.snapRadius,r._active=!1,r._mouseState=0,r._currentDistanceMeasurement=null,r._currentDistanceMeasurementInitState={wireVisible:null,axisVisible:null,xAxisVisible:null,yAxisVisible:null,zAxisVisible:null,targetVisible:null},r.distanceMeasurementsPlugin=e,r.plugin=e,r._initMarkerDiv(),r._snapping=!1!==n.snapping,r._offsetX=null!==(i=n._offsetX)&&void 0!==i?i:0,r._offsetY=null!==(s=n._offsetY)&&void 0!==s?s:0,r.hover=!1,r.distanceMeasurementsPlugin.on("mouseOver",(function(e){r.hover=!0})),r.distanceMeasurementsPlugin.on("mouseLeave",(function(e){r.hover=!1})),r.distanceMeasurementsPlugin.on("measureDelete",(function(e){r.hover=!1})),r}return m(t,Dh),w(t,[{key:"_initMarkerDiv",value:function(){var e=document.createElement("div");e.setAttribute("id","myDistancePivotMarker");var t=this.scene.canvas.canvas;t.parentNode.insertBefore(e,t),e.style.background="black",e.style.border="2px solid blue",e.style.borderRadius="10px",e.style.width="5px",e.style.height="5px",e.style.margin="-200px -200px",e.style.zIndex=this.plugin.zIndex?this.plugin.zIndex+3:"1000",e.style.position="absolute",e.style.pointerEvents="none",this._markerDiv=e}},{key:"_destroyMarkerDiv",value:function(){this._markerDiv&&(this._markerDiv.parentNode.removeChild(this._markerDiv),this._markerDiv=null)}},{key:"offsetX",get:function(){return this._offsetX},set:function(e){this._offsetX=e}},{key:"offsetY",get:function(){return this._offsetY},set:function(e){this._offsetY=e}},{key:"active",get:function(){return this._active},set:function(e){this._active=e}},{key:"snapping",get:function(){return this._snapping},set:function(e){this._snapping=e}},{key:"mouseState",get:function(){return this._mouseState},set:function(e){this._mouseState=e}},{key:"activate",value:function(){var e=this;this._markerDiv||this._initMarkerDiv(),this.distanceMeasurementsPlugin.on("measurementDestroyed",(function(e){})),this.canvas=this.scene.canvas.canvas,this.mouseHovering=!1,this.pointerWorldPos=J.vec3(),this.pointerCanvasPos=J.vec2(),this.lastMouseCanvasX,this.lastMouseCanvasY,this.clickTolerance=20,this.hoveredEntity=null,this._mouseState=0,this.markerHidden=function(t){e._markerDiv&&t.target!==e.canvas&&(e._markerDiv.style.marginLeft="-100px",e._markerDiv.style.marginTop="-100px")},document.addEventListener("mousemove",this.markerHidden)}},{key:"onMousedown",value:function(e){this._active&&(this.hover||(this.mouseHovering?(this.lastMouseCanvasX=e[0],this.lastMouseCanvasY=e[1]):(this.lastMouseCanvasX=null,this.lastMouseCanvasY=null)))}},{key:"onMousemove",value:function(e){var t;if(this._active){this.pointerCanvasPos.set(e);var i=this.scene.pick({canvasPos:this.pointerCanvasPos,snapToVertex:!0,snapToEdge:!0,snapRadius:null!==(t=this.snapRadius)&&void 0!==t?t:20});if(i){this.mouseHovering=!0,this.hoveredEntity=i.entity,this.pointerWorldPos.set(i.worldPos);var s=document.documentElement.scrollLeft,r=document.documentElement.scrollTop;if(this._markerDiv.style.marginLeft="".concat(this._offsetX+s+e[0]-5,"px"),this._markerDiv.style.marginTop="".concat(this._offsetY+r+e[1]-5,"px"),this._markerDiv.style.background="pink",this._markerDiv.style.border="2px solid orangered",i.snappedCanvasPos){var n=i.snappedCanvasPos;this._markerDiv.style.marginLeft="".concat(this._offsetX+s+n[0]-5,"px"),this._markerDiv.style.marginTop="".concat(this._offsetY+r+n[1]-5,"px")}i.snappedToVertex&&(this._markerDiv.style.background="greenyellow",this._markerDiv.style.border="2px solid forestgreen"),i.snappedToEdge&&(this._markerDiv.style.background="lightblue",this._markerDiv.style.border="2px solid royalblue"),this._currentDistanceMeasurement&&(this._currentDistanceMeasurement.wireVisible=this._currentDistanceMeasurementInitState.wireVisible,this._currentDistanceMeasurement.axisVisible=this._currentDistanceMeasurementInitState.axisVisible&&this.distanceMeasurementsPlugin.defaultAxisVisible,this._currentDistanceMeasurement.xAxisVisible=this._currentDistanceMeasurementInitState.xAxisVisible&&this.distanceMeasurementsPlugin.defaultXAxisVisible,this._currentDistanceMeasurement.yAxisVisible=this._currentDistanceMeasurementInitState.yAxisVisible&&this.distanceMeasurementsPlugin.defaultYAxisVisible,this._currentDistanceMeasurement.zAxisVisible=this._currentDistanceMeasurementInitState.zAxisVisible&&this.distanceMeasurementsPlugin.defaultZAxisVisible,this._currentDistanceMeasurement.targetVisible=this._currentDistanceMeasurementInitState.targetVisible,this._currentDistanceMeasurement.target.worldPos=this.pointerWorldPos.slice(),this._markerDiv.style.marginLeft="-10000px",this._markerDiv.style.marginTop="-10000px")}else this.mouseHovering=!1,this._markerDiv.style.marginLeft="-10000px",this._markerDiv.style.marginTop="-10000px",this._currentDistanceMeasurement&&(this._currentDistanceMeasurement.wireVisible=!1,this._currentDistanceMeasurement.targetVisible=!1,this._currentDistanceMeasurement.axisVisible=!1)}}},{key:"onMouseup",value:function(e){this._active&&(this.hover||(this.lastMouseCanvasX||this.lastMouseCanvasY)&&(e[0]>this.lastMouseCanvasX+this.clickTolerance||e[0]<this.lastMouseCanvasX-this.clickTolerance||e[1]>this.lastMouseCanvasY+this.clickTolerance||e[1]<this.lastMouseCanvasY-this.clickTolerance||(this._currentDistanceMeasurement?this.mouseHovering?(this._currentDistanceMeasurement.target.entity=this.hoveredEntity,this.hoveredEntity=null,this._currentDistanceMeasurement.clickable=!0,this.distanceMeasurementsPlugin.fire("measurementEnd",this._currentDistanceMeasurement),this._currentDistanceMeasurement=null):(this._currentDistanceMeasurement.destroy(),this.distanceMeasurementsPlugin.fire("measurementCancel",this._currentDistanceMeasurement),this._currentDistanceMeasurement=null,this.hoveredEntity=null):this.mouseHovering&&(this._currentDistanceMeasurement=this.distanceMeasurementsPlugin.createMeasurement({id:J.createUUID(),origin:{worldPos:this.pointerWorldPos.slice()},target:{worldPos:this.pointerWorldPos.slice()},precision:this.distanceMeasurementsPlugin.precision,approximate:!0}),this._currentDistanceMeasurementInitState.axisVisible=this._currentDistanceMeasurement.axisVisible&&this.distanceMeasurementsPlugin.defaultAxisVisible,this._currentDistanceMeasurementInitState.xAxisVisible=this._currentDistanceMeasurement.xAxisVisible&&this.distanceMeasurementsPlugin.defaultXAxisVisible,this._currentDistanceMeasurementInitState.yAxisVisible=this._currentDistanceMeasurement.yAxisVisible&&this.distanceMeasurementsPlugin.defaultYAxisVisible,this._currentDistanceMeasurementInitState.zAxisVisible=this._currentDistanceMeasurement.zAxisVisible&&this.distanceMeasurementsPlugin.defaultZAxisVisible,this._currentDistanceMeasurementInitState.wireVisible=this._currentDistanceMeasurement.wireVisible,this._currentDistanceMeasurementInitState.targetVisible=this._currentDistanceMeasurement.targetVisible,this._currentDistanceMeasurement.clickable=!1,this._currentDistanceMeasurement.origin.entity=this.hoveredEntity,this.hoveredEntity=null,this.fire("measurementStart",this._currentDistanceMeasurement)))))}},{key:"deactivate",value:function(){this.reset(),document.removeEventListener("mousemove",this.markerHidden),this._currentDistanceMeasurement=null,this._active=!1}},{key:"reset",value:function(){this._active&&this._currentDistanceMeasurement&&(this.distanceMeasurementsPlugin.fire("measurementCancel",this._currentDistanceMeasurement),this._currentDistanceMeasurement.destroy(),this._currentDistanceMeasurement=null)}},{key:"destroy",value:function(){this.deactivate(),this._destroyMarkerDiv(),f(t,"destroy",this,3)([])}}])}(),Rh=function(){return w((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};B(this,e),this.cacheBuster=!1!==t.cacheBuster}),[{key:"_cacheBusterURL",value:function(e){if(!this.cacheBuster)return e;var t=(new Date).getTime();return e.indexOf("?")>-1?e+"&_="+t:e+"?_="+t}},{key:"getMetaModel",value:function(e,t,i){oe.loadJSON(this._cacheBusterURL(e),(function(e){t(e)}),(function(e){i(e)}))}},{key:"getGLTF",value:function(e,t,i){oe.loadArraybuffer(this._cacheBusterURL(e),(function(e){t(e)}),(function(e){i(e)}))}},{key:"getGLB",value:function(e,t,i){oe.loadArraybuffer(this._cacheBusterURL(e),(function(e){t(e)}),(function(e){i(e)}))}},{key:"getArrayBuffer",value:function(e,t,i,s){!function(e,t,i,s){var r=function(){};i=i||r,s=s||r;var n=/^data:(.*?)(;base64)?,(.*)$/,o=t.match(n);if(o){var a=!!o[2],l=o[3];l=window.decodeURIComponent(l),a&&(l=window.atob(l));try{for(var u=new ArrayBuffer(l.length),A=new Uint8Array(u),c=0;c<l.length;c++)A[c]=l.charCodeAt(c);pe.scheduleTask((function(){i(u)}))}catch(e){pe.scheduleTask((function(){s(e)}))}}else{var h=function(e){var t=e.lastIndexOf("/");return 0!==t?e.substring(0,t+1):""}(e),d=h+t,p=new XMLHttpRequest;p.open("GET",d,!0),p.responseType="arraybuffer",p.onreadystatechange=function(){4===p.readyState&&(200===p.status?i(p.response):s("loadArrayBuffer error : "+p.response))},p.send(null)}}(this._cacheBusterURL(e),t,(function(e){i(e)}),(function(e){s(e)}))}}])}();var Uh=function(){return w((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};B(this,e),this._eventSubIDMap=null,this._eventSubEvents=null,this._eventSubs=null,this._events=null,this._locale="en",this._messages={},this._locales=[],this._locale="en",this.messages=t.messages,this.locale=t.locale}),[{key:"messages",set:function(e){this._messages=e||{},this._locales=Object.keys(this._messages),this.fire("updated",this)}},{key:"loadMessages",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var t in e)this._messages[t]=e[t];this.messages=this._messages}},{key:"clearMessages",value:function(){this.messages={}}},{key:"locales",get:function(){return this._locales}},{key:"locale",get:function(){return this._locale},set:function(e){e=e||"de",this._locale!==e&&(this._locale=e,this.fire("updated",e))}},{key:"translate",value:function(e,t){var i=this._messages[this._locale];if(!i)return null;var s=Oh(e,i);return s?t?Qh(s,t):s:null}},{key:"translatePlurals",value:function(e,t,i){var s=this._messages[this._locale];if(!s)return null;var r=Oh(e,s);return(r=0===(t=parseInt(""+t,10))?r.zero:t>1?r.other:r.one)?(r=Qh(r,[t]),i&&(r=Qh(r,i)),r):null}},{key:"fire",value:function(e,t,i){this._events||(this._events={}),this._eventSubs||(this._eventSubs={}),!0!==i&&(this._events[e]=t||!0);var s=this._eventSubs[e];if(s)for(var r in s){if(s.hasOwnProperty(r))s[r].callback(t)}}},{key:"on",value:function(e,t){this._events||(this._events={}),this._eventSubIDMap||(this._eventSubIDMap=new $),this._eventSubEvents||(this._eventSubEvents={}),this._eventSubs||(this._eventSubs={});var i=this._eventSubs[e];i||(i={},this._eventSubs[e]=i);var s=this._eventSubIDMap.addItem();i[s]={callback:t},this._eventSubEvents[s]=e;var r=this._events[e];return void 0!==r&&t(r),s}},{key:"off",value:function(e){if(null!=e&&this._eventSubEvents){var t=this._eventSubEvents[e];if(t){delete this._eventSubEvents[e];var i=this._eventSubs[t];i&&delete i[e],this._eventSubIDMap.removeItem(e)}}}}])}();function Oh(e,t){if(t[e])return t[e];for(var i=e.split("."),s=t,r=0,n=i.length;s&&r<n;r++){s=s[i[r]]}return s}function Qh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.replace(/\{\{|\}\}|\{(\d+)\}/g,(function(e,i){return"{{"===e?"{":"}}"===e?"}":t[i]}))}var Nh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s])).t=s.t,i}return m(t,_e),w(t,[{key:"t",get:function(){return this._t},set:function(e){e=e||0,this._t=e<0?0:e>1?1:e}},{key:"tangent",get:function(){return this.getTangent(this._t)}},{key:"length",get:function(){var e=this._getLengths();return e[e.length-1]}},{key:"getTangent",value:function(e){var t=1e-4;void 0===e&&(e=this._t);var i=e-t,s=e+t;i<0&&(i=0),s>1&&(s=1);var r=this.getPoint(i),n=this.getPoint(s),o=J.subVec3(n,r,[]);return J.normalizeVec3(o,[])}},{key:"getPointAt",value:function(e){var t=this.getUToTMapping(e);return this.getPoint(t)}},{key:"getPoints",value:function(e){e||(e=5);var t,i=[];for(t=0;t<=e;t++)i.push(this.getPoint(t/e));return i}},{key:"_getLengths",value:function(e){if(e||(e=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,i,s=[],r=this.getPoint(0),n=0;for(s.push(0),i=1;i<=e;i++)t=this.getPoint(i/e),n+=J.lenVec3(J.subVec3(t,r,[])),s.push(n),r=t;return this.cacheArcLengths=s,s}},{key:"_updateArcLengths",value:function(){this.needsUpdate=!0,this._getLengths()}},{key:"getUToTMapping",value:function(e,t){var i,s=this._getLengths(),r=0,n=s.length;i=t||e*s[n-1];for(var o,a=0,l=n-1;a<=l;)if((o=s[r=Math.floor(a+(l-a)/2)]-i)<0)a=r+1;else{if(!(o>0)){l=r;break}l=r-1}if(s[r=l]===i)return r/(n-1);var u=s[r];return(r+(i-u)/(s[r+1]-u))/(n-1)}}])}(),Vh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s])).points=s.points,i.t=s.t,i}return m(t,Nh),w(t,[{key:"points",get:function(){return this._points},set:function(e){this._points=e||[]}},{key:"t",get:function(){return this._t},set:function(e){e=e||0,this._t=e<0?0:e>1?1:e}},{key:"point",get:function(){return this.getPoint(this._t)}},{key:"getPoint",value:function(e){var t=this.points;if(!(t.length<3)){var i=(t.length-1)*e,s=Math.floor(i),r=i-s,n=t[0===s?s:s-1],o=t[s],a=t[s>t.length-2?t.length-1:s+1],l=t[s>t.length-3?t.length-1:s+2],u=J.vec3();return u[0]=J.catmullRomInterpolate(n[0],o[0],a[0],l[0],r),u[1]=J.catmullRomInterpolate(n[1],o[1],a[1],l[1],r),u[2]=J.catmullRomInterpolate(n[2],o[2],a[2],l[2],r),u}this.error("Can't sample point from SplineCurve - not enough points on curve - returning [0,0,0].")}},{key:"getJSON",value:function(){return{points:points,t:this._t}}}])}(),Hh=J.vec3(),jh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s]))._frames=[],i._eyeCurve=new Vh(i),i._lookCurve=new Vh(i),i._upCurve=new Vh(i),s.frames&&(i.addFrames(s.frames),i.smoothFrameTimes(1)),i}return m(t,_e),w(t,[{key:"type",get:function(){return"CameraPath"}},{key:"frames",get:function(){return this._frames}},{key:"eyeCurve",get:function(){return this._eyeCurve}},{key:"lookCurve",get:function(){return this._lookCurve}},{key:"upCurve",get:function(){return this._upCurve}},{key:"saveFrame",value:function(e){var t=this.scene.camera;this.addFrame(e,t.eye,t.look,t.up)}},{key:"addFrame",value:function(e,t,i,s){var r={t:e,eye:t.slice(0),look:i.slice(0),up:s.slice(0)};this._frames.push(r),this._eyeCurve.points.push(r.eye),this._lookCurve.points.push(r.look),this._upCurve.points.push(r.up)}},{key:"addFrames",value:function(e){for(var t,i=0,s=e.length;i<s;i++)t=e[i],this.addFrame(t.t||0,t.eye,t.look,t.up)}},{key:"loadFrame",value:function(e){var t=this.scene.camera;e=(e/=this._frames[this._frames.length-1].t-this._frames[0].t)<0?0:e>1?1:e,t.eye=this._eyeCurve.getPoint(e,Hh),t.look=this._lookCurve.getPoint(e,Hh),t.up=this._upCurve.getPoint(e,Hh)}},{key:"sampleFrame",value:function(e,t,i,s){e=e<0?0:e>1?1:e,this._eyeCurve.getPoint(e,t),this._lookCurve.getPoint(e,i),this._upCurve.getPoint(e,s)}},{key:"smoothFrameTimes",value:function(e){if(0!==this._frames.length){var t=J.vec3(),i=0;this._frames[0].t=0;for(var s=[],r=1,n=this._frames.length;r<n;r++){var o=J.lenVec3(J.subVec3(this._frames[r].eye,this._frames[r-1].eye,t));s[r]=o,i+=o}for(var a=1,l=this._frames.length;a<l;a++){var u=s[a]/i*e;this._frames[a].t=this._frames[a-1].t+u}}}},{key:"clearFrames",value:function(){this._frames=[],this._eyeCurve.points=[],this._lookCurve.points=[],this._upCurve.points=[]}}])}(),Gh=J.vec3(),zh=J.vec3(),Wh=J.vec3(),Kh=J.vec3(),Xh=J.vec3(),Yh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s]))._look1=J.vec3(),i._eye1=J.vec3(),i._up1=J.vec3(),i._look2=J.vec3(),i._eye2=J.vec3(),i._up2=J.vec3(),i._orthoScale1=1,i._orthoScale2=1,i._flying=!1,i._flyEyeLookUp=!1,i._flyingEye=!1,i._flyingLook=!1,i._callback=null,i._callbackScope=null,i._time1=null,i._time2=null,i.easing=!1!==s.easing,i.duration=s.duration,i.fit=s.fit,i.fitFOV=s.fitFOV,i.trail=s.trail,i}return m(t,_e),w(t,[{key:"type",get:function(){return"CameraFlightAnimation"}},{key:"flyTo",value:function(e,t,i){e=e||this.scene,this._flying&&this.stop(),this._flying=!1,this._flyingEye=!1,this._flyingLook=!1,this._flyingEyeLookUp=!1,this._callback=t,this._callbackScope=i;var s,r,n,o,a,l=this.scene.camera,u=!!e.projection&&e.projection!==l.projection;if(this._eye1[0]=l.eye[0],this._eye1[1]=l.eye[1],this._eye1[2]=l.eye[2],this._look1[0]=l.look[0],this._look1[1]=l.look[1],this._look1[2]=l.look[2],this._up1[0]=l.up[0],this._up1[1]=l.up[1],this._up1[2]=l.up[2],this._orthoScale1=l.ortho.scale,this._orthoScale2=e.orthoScale||this._orthoScale1,e.aabb)s=e.aabb;else if(6===e.length)s=e;else if(e.eye&&e.look||e.up)r=e.eye,n=e.look,o=e.up;else if(e.eye)r=e.eye;else if(e.look)n=e.look;else{var A=e;if((oe.isNumeric(A)||oe.isString(A))&&(a=A,!(A=this.scene.components[a])))return this.error("Component not found: "+oe.inQuotes(a)),void(t&&(i?t.call(i):t()));u||(s=A.aabb||this.scene.aabb)}var c=e.poi;if(s){if(s[3]<s[0]||s[4]<s[1]||s[5]<s[2])return;if(s[3]===s[0]&&s[4]===s[1]&&s[5]===s[2])return;s=s.slice();var h=J.getAABB3Center(s);this._look2=c||h;var d=J.subVec3(this._eye1,this._look1,Gh),p=J.normalizeVec3(d),f=c?J.getAABB3DiagPoint(s,c):J.getAABB3Diag(s),v=e.fitFOV||this._fitFOV,g=Math.abs(f/Math.tan(v*J.DEGTORAD));this._orthoScale2=1.1*f,this._eye2[0]=this._look2[0]+p[0]*g,this._eye2[1]=this._look2[1]+p[1]*g,this._eye2[2]=this._look2[2]+p[2]*g,this._up2[0]=this._up1[0],this._up2[1]=this._up1[1],this._up2[2]=this._up1[2],this._flyingEyeLookUp=!0}else(r||n||o)&&(this._flyingEyeLookUp=!!r&&!!n&&!!o,this._flyingEye=!!r&&!n,this._flyingLook=!!n&&!r,r&&(this._eye2[0]=r[0],this._eye2[1]=r[1],this._eye2[2]=r[2]),n&&(this._look2[0]=n[0],this._look2[1]=n[1],this._look2[2]=n[2]),o&&(this._up2[0]=o[0],this._up2[1]=o[1],this._up2[2]=o[2]));u?("ortho"===e.projection&&"ortho"!==l.projection&&(this._projection2="ortho",this._projMatrix1=l.projMatrix.slice(),this._projMatrix2=l.ortho.matrix.slice(),l.projection="customProjection"),"perspective"===e.projection&&"perspective"!==l.projection&&(this._projection2="perspective",this._projMatrix1=l.projMatrix.slice(),this._projMatrix2=l.perspective.matrix.slice(),l.projection="customProjection")):this._projection2=null,this.fire("started",e,!0),this._time1=Date.now(),this._time2=this._time1+(e.duration?1e3*e.duration:this._duration),this._flying=!0,pe.scheduleTask(this._update,this)}},{key:"jumpTo",value:function(e){this._jumpTo(e)}},{key:"_jumpTo",value:function(e){this._flying&&this.stop();var t,i,s,r,n,o=this.scene.camera;if(e.aabb)t=e.aabb;else if(6===e.length)t=e;else if(e.eye||e.look||e.up)s=e.eye,r=e.look,n=e.up;else{var a=e;if((oe.isNumeric(a)||oe.isString(a))&&(i=a,!(a=this.scene.components[i])))return void this.error("Component not found: "+oe.inQuotes(i));t=a.aabb||this.scene.aabb}var l=e.poi;if(t){if(t[3]<=t[0]||t[4]<=t[1]||t[5]<=t[2])return;var u,A=l?J.getAABB3DiagPoint(t,l):J.getAABB3Diag(t);r=l||J.getAABB3Center(t,r),this._trail?J.subVec3(o.look,r,Xh):J.subVec3(o.eye,o.look,Xh),J.normalizeVec3(Xh),u=(void 0!==e.fit?e.fit:this._fit)?Math.abs(A/Math.tan((e.fitFOV||this._fitFOV)*J.DEGTORAD)):J.lenVec3(J.subVec3(o.eye,o.look,Gh)),J.mulVec3Scalar(Xh,u),o.eye=J.addVec3(r,Xh,Gh),o.look=r,this.scene.camera.ortho.scale=1.1*A}else(s||r||n)&&(s&&(o.eye=s),r&&(o.look=r),n&&(o.up=n));e.projection&&(o.projection=e.projection)}},{key:"_update",value:function(){if(this._flying){var e=(Date.now()-this._time1)/(this._time2-this._time1),i=e>=1;e>1&&(e=1);var s=this.easing?t._ease(e,0,1,1):e,r=this.scene.camera;if(this._flyingEye||this._flyingLook?this._flyingEye?(J.subVec3(r.eye,r.look,Xh),r.eye=J.lerpVec3(s,0,1,this._eye1,this._eye2,Wh),r.look=J.subVec3(Wh,Xh,zh)):this._flyingLook&&(r.look=J.lerpVec3(s,0,1,this._look1,this._look2,zh),r.up=J.lerpVec3(s,0,1,this._up1,this._up2,Kh)):this._flyingEyeLookUp&&(r.eye=J.lerpVec3(s,0,1,this._eye1,this._eye2,Wh),r.look=J.lerpVec3(s,0,1,this._look1,this._look2,zh),r.up=J.lerpVec3(s,0,1,this._up1,this._up2,Kh)),this._projection2){var n="ortho"===this._projection2?t._easeOutExpo(e,0,1,1):t._easeInCubic(e,0,1,1);r.customProjection.matrix=J.lerpMat4(n,0,1,this._projMatrix1,this._projMatrix2)}else r.ortho.scale=this._orthoScale1+e*(this._orthoScale2-this._orthoScale1);if(i)return r.ortho.scale=this._orthoScale2,void this.stop();pe.scheduleTask(this._update,this)}}},{key:"stop",value:function(){if(this._flying){this._flying=!1,this._time1=null,this._time2=null,this._projection2&&(this.scene.camera.projection=this._projection2);var e=this._callback;e&&(this._callback=null,this._callbackScope?e.call(this._callbackScope):e()),this.fire("stopped",!0,!0)}}},{key:"cancel",value:function(){this._flying&&(this._flying=!1,this._time1=null,this._time2=null,this._callback&&(this._callback=null),this.fire("canceled",!0,!0))}},{key:"duration",get:function(){return this._duration/1e3},set:function(e){this._duration=e?1e3*e:500,this.stop()}},{key:"fit",get:function(){return this._fit},set:function(e){this._fit=!1!==e}},{key:"fitFOV",get:function(){return this._fitFOV},set:function(e){this._fitFOV=e||45}},{key:"trail",get:function(){return this._trail},set:function(e){this._trail=!!e}},{key:"destroy",value:function(){this.stop(),f(t,"destroy",this,3)([])}}],[{key:"_ease",value:function(e,t,i,s){return-i*(e/=s)*(e-2)+t}},{key:"_easeInCubic",value:function(e,t,i,s){return i*(e/=s)*e*e+t}},{key:"_easeOutExpo",value:function(e,t,i,s){return i*(1-Math.pow(2,-10*e/s))+t}}])}(),Jh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s]))._cameraFlightAnimation=new Yh(i),i._t=0,i.state=t.SCRUBBING,i._playingFromT=0,i._playingToT=0,i._playingRate=s.playingRate||1,i._playingDir=1,i._lastTime=null,i.cameraPath=s.cameraPath,i._tick=i.scene.on("tick",i._updateT,i),i}return m(t,_e),w(t,[{key:"type",get:function(){return"CameraPathAnimation"}},{key:"_updateT",value:function(){var e=this._cameraPath;if(e){var i,s,r=performance.now(),n=this._lastTime?.001*(r-this._lastTime):0;if(this._lastTime=r,0!==n)switch(this.state){case t.SCRUBBING:return;case t.PLAYING:if(this._t+=this._playingRate*n,0===(i=this._cameraPath.frames.length)||this._playingDir<0&&this._t<=0||this._playingDir>0&&this._t>=this._cameraPath.frames[i-1].t)return this.state=t.SCRUBBING,this._t=this._cameraPath.frames[i-1].t,void this.fire("stopped");e.loadFrame(this._t);break;case t.PLAYING_TO:s=this._t+this._playingRate*n*this._playingDir,(this._playingDir<0&&s<=this._playingToT||this._playingDir>0&&s>=this._playingToT)&&(s=this._playingToT,this.state=t.SCRUBBING,this.fire("stopped")),this._t=s,e.loadFrame(this._t)}}}},{key:"_ease",value:function(e,t,i,s){return-i*(e/=s)*(e-2)+t}},{key:"cameraPath",get:function(){return this._cameraPath},set:function(e){this._cameraPath=e}},{key:"rate",get:function(){return this._playingRate},set:function(e){this._playingRate=e}},{key:"play",value:function(){this._cameraPath&&(this._lastTime=null,this.state=t.PLAYING)}},{key:"playToT",value:function(e){this._cameraPath&&(this._playingFromT=this._t,this._playingToT=e,this._playingDir=this._playingToT-this._playingFromT<0?-1:1,this._lastTime=null,this.state=t.PLAYING_TO)}},{key:"playToFrame",value:function(e){var t=this._cameraPath;if(t){var i=t.frames[e];i?this.playToT(i.t):this.error("playToFrame - frame index out of range: "+e)}}},{key:"flyToFrame",value:function(e,i){var s=this._cameraPath;if(s){var r=s.frames[e];r?(this.state=t.SCRUBBING,this._cameraFlightAnimation.flyTo(r,i)):this.error("flyToFrame - frame index out of range: "+e)}}},{key:"scrubToT",value:function(e){var i=this._cameraPath;i&&(this.scene.camera&&(this._t=e,i.loadFrame(this._t),this.state=t.SCRUBBING))}},{key:"scrubToFrame",value:function(e){var i=this._cameraPath;i&&(this.scene.camera&&(i.frames[e]?(i.loadFrame(this._t),this.state=t.SCRUBBING):this.error("playToFrame - frame index out of range: "+e)))}},{key:"stop",value:function(){this.state=t.SCRUBBING,this.fire("stopped")}},{key:"destroy",value:function(){f(t,"destroy",this,3)([]),this.scene.off(this._tick)}}])}();Jh.STOPPED=0,Jh.SCRUBBING=1,Jh.PLAYING=2,Jh.PLAYING_TO=3;var Zh=J.vec3(),qh=J.vec3();J.vec3();var $h=J.vec3([0,-1,0]),ed=J.vec4([0,0,0,1]),td=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s]))._src=null,i._image=null,i._pos=J.vec3(),i._origin=J.vec3(),i._rtcPos=J.vec3(),i._dir=J.vec3(),i._size=1,i._imageSize=J.vec2(),i._texture=new On(i),i._plane=new nn(i,{geometry:new Ti(i,Xn({center:[0,0,0],xSize:1,zSize:1,xSegments:10,zSegments:10})),material:new Qi(i,{diffuse:[0,0,0],ambient:[0,0,0],specular:[0,0,0],diffuseMap:i._texture,emissiveMap:i._texture,backfaces:!0}),clippable:s.clippable}),i._grid=new nn(i,{geometry:new Ti(i,Kn({size:1,divisions:10})),material:new Qi(i,{diffuse:[0,0,0],ambient:[0,0,0],emissive:[.2,.8,.2]}),position:[0,.001,0],clippable:s.clippable}),i._node=new Bn(i,{rotation:[0,0,0],position:[0,0,0],scale:[1,1,1],clippable:!1,children:[i._plane,i._grid]}),i._gridVisible=!1,i.visible=!0,i.gridVisible=s.gridVisible,i.position=s.position,i.rotation=s.rotation,i.dir=s.dir,i.size=s.size,i.collidable=s.collidable,i.clippable=s.clippable,i.pickable=s.pickable,i.opacity=s.opacity,s.image?i.image=s.image:i.src=s.src,i}return m(t,_e),w(t,[{key:"visible",get:function(){return this._plane.visible},set:function(e){this._plane.visible=e,this._grid.visible=this._gridVisible&&e}},{key:"gridVisible",get:function(){return this._gridVisible},set:function(e){e=!1!==e,this._gridVisible=e,this._grid.visible=this._gridVisible&&this.visible}},{key:"image",get:function(){return this._image},set:function(e){this._image=e,this._image&&(this._imageSize[0]=e.width,this._imageSize[1]=e.height,this._updatePlaneSizeFromImage(),this._src=null,this._texture.image=this._image)}},{key:"src",get:function(){return this._src},set:function(e){var t=this;if(this._src=e,this._src){this._image=null;var i=new Image;i.onload=function(){t._texture.image=i,t._imageSize[0]=i.width,t._imageSize[1]=i.height,t._updatePlaneSizeFromImage()},i.src=this._src}}},{key:"position",get:function(){return this._pos},set:function(e){this._pos.set(e||[0,0,0]),xe(this._pos,this._origin,this._rtcPos),this._node.origin=this._origin,this._node.position=this._rtcPos}},{key:"rotation",get:function(){return this._node.rotation},set:function(e){this._node.rotation=e}},{key:"size",get:function(){return this._size},set:function(e){this._size=null==e?1:e,this._image&&this._updatePlaneSizeFromImage()}},{key:"dir",get:function(){return this._dir},set:function(e){if(this._dir.set(e||[0,0,-1]),e){var t=this.scene.center,i=[-this._dir[0],-this._dir[1],-this._dir[2]];J.subVec3(t,this.position,Zh);var s=-J.dotVec3(i,Zh);J.normalizeVec3(i),J.mulVec3Scalar(i,s,qh),J.vec3PairToQuaternion($h,e,ed),this._node.quaternion=ed}}},{key:"collidable",get:function(){return this._node.collidable},set:function(e){this._node.collidable=!1!==e}},{key:"clippable",get:function(){return this._node.clippable},set:function(e){this._node.clippable=!1!==e}},{key:"pickable",get:function(){return this._node.pickable},set:function(e){this._node.pickable=!1!==e}},{key:"opacity",get:function(){return this._node.opacity},set:function(e){this._node.opacity=e}},{key:"destroy",value:function(){f(t,"destroy",this,3)([])}},{key:"_updatePlaneSizeFromImage",value:function(){var e=this._size,t=this._imageSize[0],i=this._imageSize[1];if(t>i){var s=i/t;this._node.scale=[e,1,e*s]}else{var r=t/i;this._node.scale=[e*r,1,e]}}}])}(),id=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};B(this,t);var r=i=h(this,t,[e,s]);i._shadowRenderBuf=null,i._shadowViewMatrix=null,i._shadowProjMatrix=null,i._shadowViewMatrixDirty=!0,i._shadowProjMatrixDirty=!0;var n=i.scene.camera,o=i.scene.canvas;return i._onCameraViewMatrix=n.on("viewMatrix",(function(){i._shadowViewMatrixDirty=!0})),i._onCameraProjMatrix=n.on("projMatrix",(function(){i._shadowProjMatrixDirty=!0})),i._onCanvasBoundary=o.on("boundary",(function(){i._shadowProjMatrixDirty=!0})),i._state=new Jt({type:"point",pos:J.vec3([1,1,1]),color:J.vec3([.7,.7,.8]),intensity:1,attenuation:[0,0,0],space:s.space||"view",castsShadow:!1,getShadowViewMatrix:function(){if(r._shadowViewMatrixDirty){r._shadowViewMatrix||(r._shadowViewMatrix=J.identityMat4());var e=r._state.pos,t=n.look,i=n.up;J.lookAtMat4v(e,t,i,r._shadowViewMatrix),r._shadowViewMatrixDirty=!1}return r._shadowViewMatrix},getShadowProjMatrix:function(){if(r._shadowProjMatrixDirty){r._shadowProjMatrix||(r._shadowProjMatrix=J.identityMat4());var e=r.scene.canvas.canvas;J.perspectiveMat4(Math.PI/180*70,e.clientWidth/e.clientHeight,.1,500,r._shadowProjMatrix),r._shadowProjMatrixDirty=!1}return r._shadowProjMatrix},getShadowRenderBuf:function(){return r._shadowRenderBuf||(r._shadowRenderBuf=new Gt(r.scene.canvas.canvas,r.scene.canvas.gl,{size:[1024,1024]})),r._shadowRenderBuf}}),i.pos=s.pos,i.color=s.color,i.intensity=s.intensity,i.constantAttenuation=s.constantAttenuation,i.linearAttenuation=s.linearAttenuation,i.quadraticAttenuation=s.quadraticAttenuation,i.castsShadow=s.castsShadow,i.scene._lightCreated(i),i}return m(t,mi),w(t,[{key:"type",get:function(){return"PointLight"}},{key:"pos",get:function(){return this._state.pos},set:function(e){this._state.pos.set(e||[1,1,1]),this._shadowViewMatrixDirty=!0,this.glRedraw()}},{key:"color",get:function(){return this._state.color},set:function(e){this._state.color.set(e||[.7,.7,.8]),this.glRedraw()}},{key:"intensity",get:function(){return this._state.intensity},set:function(e){e=void 0!==e?e:1,this._state.intensity=e,this.glRedraw()}},{key:"constantAttenuation",get:function(){return this._state.attenuation[0]},set:function(e){this._state.attenuation[0]=e||0,this.glRedraw()}},{key:"linearAttenuation",get:function(){return this._state.attenuation[1]},set:function(e){this._state.attenuation[1]=e||0,this.glRedraw()}},{key:"quadraticAttenuation",get:function(){return this._state.attenuation[2]},set:function(e){this._state.attenuation[2]=e||0,this.glRedraw()}},{key:"castsShadow",get:function(){return this._state.castsShadow},set:function(e){e=!!e,this._state.castsShadow!==e&&(this._state.castsShadow=e,this._shadowViewMatrixDirty=!0,this.glRedraw())}},{key:"destroy",value:function(){var e=this.scene.camera,i=this.scene.canvas;e.off(this._onCameraViewMatrix),e.off(this._onCameraProjMatrix),i.off(this._onCanvasBoundary),f(t,"destroy",this,3)([]),this._state.destroy(),this._shadowRenderBuf&&this._shadowRenderBuf.destroy(),this.scene._lightDestroyed(this),this.glRedraw()}}])}();function sd(e){return 0==(e&e-1)}function rd(e){--e;for(var t=1;t<32;t<<=1)e|=e>>t;return e+1}var nd=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};B(this,t);var r=(i=h(this,t,[e,s])).scene.canvas.gl;return i._state=new Jt({texture:new In({gl:r,target:r.TEXTURE_CUBE_MAP}),flipY:i._checkFlipY(s.minFilter),encoding:i._checkEncoding(s.encoding),minFilter:cs,magFilter:ls,wrapS:ts,wrapT:ts,mipmaps:!0}),i._src=s.src,i._images=[],i._loadSrc(s.src),te.memory.textures++,i}return m(t,_e),w(t,[{key:"type",get:function(){return"CubeTexture"}},{key:"_checkFlipY",value:function(e){return!!e}},{key:"_checkEncoding",value:function(e){return(e=e||lr)!==lr&&e!==ur&&(this.error("Unsupported value for 'encoding' - supported values are LinearEncoding and sRGBEncoding. Defaulting to LinearEncoding."),e=lr),e}},{key:"_webglContextRestored",value:function(){this.scene.canvas.gl,this._state.texture=null,this._src&&this._loadSrc(this._src)}},{key:"_loadSrc",value:function(e){var t=this,i=this.scene.canvas.gl;this._images=[];for(var s=!1,r=0,n=function(n){var o,a,l=new Image;l.onload=(o=l,a=n,function(){if(!s&&(o=function(e){if(!sd(e.width)||!sd(e.height)){var t=document.createElement("canvas");t.width=rd(e.width),t.height=rd(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),e=t}return e}(o),t._images[a]=o,6==++r)){var e=t._state.texture;e||(e=new In({gl:i,target:i.TEXTURE_CUBE_MAP}),t._state.texture=e),e.setImage(t._images,t._state),t.fire("loaded",t._src,!1),t.glRedraw()}}),l.onerror=function(){s=!0},l.src=e[n]},o=0;o<e.length;o++)n(o)}},{key:"destroy",value:function(){f(t,"destroy",this,3)([]),this._state.texture&&this._state.texture.destroy(),te.memory.textures--,this._state.destroy()}}])}(),od=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s])).scene._lightsState.addReflectionMap(i._state),i.scene._reflectionMapCreated(i),i}return m(t,nd),w(t,[{key:"type",get:function(){return"ReflectionMap"}},{key:"destroy",value:function(){f(t,"destroy",this,3)([]),this.scene._reflectionMapDestroyed(this)}}])}(),ad=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s])).scene._lightMapCreated(i),i}return m(t,nd),w(t,[{key:"type",get:function(){return"LightMap"}},{key:"destroy",value:function(){f(t,"destroy",this,3)([]),this.scene._lightMapDestroyed(this)}}])}(),ld=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,{entity:s.entity,occludable:s.occludable,worldPos:s.worldPos}]))._occluded=!1,i._visible=!0,i._src=null,i._image=null,i._pos=J.vec3(),i._origin=J.vec3(),i._rtcPos=J.vec3(),i._dir=J.vec3(),i._size=1,i._imageSize=J.vec2(),i._texture=new On(i,{src:s.src}),i._geometry=new Ti(i,{primitive:"triangles",positions:[3,3,0,-3,3,0,-3,-3,0,3,-3,0],normals:[-1,0,0,-1,0,0,-1,0,0,-1,0,0],uv:[1,-1,0,-1,0,0,1,0],indices:[0,1,2,0,2,3]}),i._mesh=new nn(i,{geometry:i._geometry,material:new Qi(i,{ambient:[.9,.3,.9],shininess:30,diffuseMap:i._texture,backfaces:!0}),scale:[1,1,1],position:s.worldPos,rotation:[90,0,0],billboard:"spherical",occluder:!1}),i.visible=!0,i.collidable=s.collidable,i.clippable=s.clippable,i.pickable=s.pickable,i.opacity=s.opacity,i.size=s.size,s.image?i.image=s.image:i.src=s.src,i}return m(t,Ve),w(t,[{key:"_setVisible",value:function(e){this._occluded=!e,this._mesh.visible=this._visible&&!this._occluded,f(t,"_setVisible",this,3)([e])}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=null==e||e,this._mesh.visible=this._visible&&!this._occluded}},{key:"image",get:function(){return this._image},set:function(e){this._image=e,this._image&&(this._imageSize[0]=this._image.width,this._imageSize[1]=this._image.height,this._updatePlaneSizeFromImage(),this._src=null,this._texture.image=this._image)}},{key:"src",get:function(){return this._src},set:function(e){var t=this;if(this._src=e,this._src){this._image=null;var i=new Image;i.onload=function(){t._texture.image=i,t._imageSize[0]=i.width,t._imageSize[1]=i.height,t._updatePlaneSizeFromImage()},i.src=this._src}}},{key:"size",get:function(){return this._size},set:function(e){this._size=null==e?1:e,this._image&&this._updatePlaneSizeFromImage()}},{key:"collidable",get:function(){return this._mesh.collidable},set:function(e){this._mesh.collidable=!1!==e}},{key:"clippable",get:function(){return this._mesh.clippable},set:function(e){this._mesh.clippable=!1!==e}},{key:"pickable",get:function(){return this._mesh.pickable},set:function(e){this._mesh.pickable=!1!==e}},{key:"opacity",get:function(){return this._mesh.opacity},set:function(e){this._mesh.opacity=e}},{key:"_updatePlaneSizeFromImage",value:function(){var e=.5*this._size,t=this._imageSize[0],i=this._imageSize[1],s=i/t;this._geometry.positions=t>i?[e,e*s,0,-e,e*s,0,-e,-e*s,0,e,-e*s,0]:[e/s,e,0,-e/s,e,0,-e/s,-e,0,e/s,-e,0]}}])}(),ud=function(){return w((function e(t){B(this,e),this._eye=J.vec3(),this._look=J.vec3(),this._up=J.vec3(),this._projection={},t&&this.saveCamera(t)}),[{key:"saveCamera",value:function(e){var t=e.camera,i=t.project;switch(this._eye.set(t.eye),this._look.set(t.look),this._up.set(t.up),t.projection){case"perspective":this._projection={projection:"perspective",fov:i.fov,fovAxis:i.fovAxis,near:i.near,far:i.far};break;case"ortho":this._projection={projection:"ortho",scale:i.scale,near:i.near,far:i.far};break;case"frustum":this._projection={projection:"frustum",left:i.left,right:i.right,top:i.top,bottom:i.bottom,near:i.near,far:i.far};break;case"custom":this._projection={projection:"custom",matrix:i.matrix.slice()}}}},{key:"restoreCamera",value:function(e,t){var i=e.camera,s=this._projection;function r(){switch(s.type){case"perspective":i.perspective.fov=s.fov,i.perspective.fovAxis=s.fovAxis,i.perspective.near=s.near,i.perspective.far=s.far;break;case"ortho":i.ortho.scale=s.scale,i.ortho.near=s.near,i.ortho.far=s.far;break;case"frustum":i.frustum.left=s.left,i.frustum.right=s.right,i.frustum.top=s.top,i.frustum.bottom=s.bottom,i.frustum.near=s.near,i.frustum.far=s.far;break;case"custom":i.customProjection.matrix=s.matrix}}t?e.viewer.cameraFlight.flyTo({eye:this._eye,look:this._look,up:this._up,orthoScale:s.scale,projection:s.projection},(function(){r(),t()})):(i.eye=this._eye,i.look=this._look,i.up=this._up,r(),i.projection=s.projection)}}])}(),Ad=J.vec3(),cd=function(){return w((function e(t){if(B(this,e),this.objectsVisible=[],this.objectsEdges=[],this.objectsXrayed=[],this.objectsHighlighted=[],this.objectsSelected=[],this.objectsClippable=[],this.objectsPickable=[],this.objectsColorize=[],this.objectsOpacity=[],this.numObjects=0,t){var i=t.metaScene.scene;this.saveObjects(i,t)}}),[{key:"saveObjects",value:function(e,t,i){this.numObjects=0,this._mask=i?oe.apply(i,{}):null;for(var s=!i||i.visible,r=!i||i.edges,n=!i||i.xrayed,o=!i||i.highlighted,a=!i||i.selected,l=!i||i.clippable,u=!i||i.pickable,A=!i||i.colorize,c=!i||i.opacity,h=t.metaObjects,d=e.objects,p=0,f=h.length;p<f;p++){var v=d[h[p].id];if(v){if(s&&(this.objectsVisible[p]=v.visible),r&&(this.objectsEdges[p]=v.edges),n&&(this.objectsXrayed[p]=v.xrayed),o&&(this.objectsHighlighted[p]=v.highlighted),a&&(this.objectsSelected[p]=v.selected),l&&(this.objectsClippable[p]=v.clippable),u&&(this.objectsPickable[p]=v.pickable),A){var g=v.colorize;this.objectsColorize[3*p+0]=g[0],this.objectsColorize[3*p+1]=g[1],this.objectsColorize[3*p+2]=g[2]}c&&(this.objectsOpacity[p]=v.opacity),this.numObjects++}}}},{key:"restoreObjects",value:function(e,t){for(var i=this._mask,s=!i||i.visible,r=!i||i.edges,n=!i||i.xrayed,o=!i||i.highlighted,a=!i||i.selected,l=!i||i.clippable,u=!i||i.pickable,A=!i||i.colorize,c=!i||i.opacity,h=t.metaObjects,d=e.objects,p=0,f=h.length;p<f;p++){var v=d[h[p].id];v&&(s&&(v.visible=this.objectsVisible[p]),r&&(v.edges=this.objectsEdges[p]),n&&(v.xrayed=this.objectsXrayed[p]),o&&(v.highlighted=this.objectsHighlighted[p]),a&&(v.selected=this.objectsSelected[p]),l&&(v.clippable=this.objectsClippable[p]),u&&(v.pickable=this.objectsPickable[p]),A&&(Ad[0]=this.objectsColorize[3*p+0],Ad[1]=this.objectsColorize[3*p+1],Ad[2]=this.objectsColorize[3*p+2],v.colorize=Ad),c&&(v.opacity=this.objectsOpacity[p]))}}}])}(),hd=J.vec3(),dd=function(){return w((function e(){B(this,e),this.objectsVisible=[],this.objectsEdges=[],this.objectsXrayed=[],this.objectsHighlighted=[],this.objectsSelected=[],this.objectsClippable=[],this.objectsPickable=[],this.objectsColorize=[],this.objectsHasColorize=[],this.objectsOpacity=[],this.numObjects=0}),[{key:"saveObjects",value:function(e,t){this.numObjects=0,this._mask=t?oe.apply(t,{}):null;var i=e.objects,s=!t||t.visible,r=!t||t.edges,n=!t||t.xrayed,o=!t||t.highlighted,a=!t||t.selected,l=!t||t.clippable,u=!t||t.pickable,A=!t||t.colorize,c=!t||t.opacity;for(var h in i)if(i.hasOwnProperty(h)){var d=i[h],p=this.numObjects;if(s&&(this.objectsVisible[p]=d.visible),r&&(this.objectsEdges[p]=d.edges),n&&(this.objectsXrayed[p]=d.xrayed),o&&(this.objectsHighlighted[p]=d.highlighted),a&&(this.objectsSelected[p]=d.selected),l&&(this.objectsClippable[p]=d.clippable),u&&(this.objectsPickable[p]=d.pickable),A){var f=d.colorize;f?(this.objectsColorize[3*p+0]=f[0],this.objectsColorize[3*p+1]=f[1],this.objectsColorize[3*p+2]=f[2],this.objectsHasColorize[p]=!0):this.objectsHasColorize[p]=!1}c&&(this.objectsOpacity[p]=d.opacity),this.numObjects++}}},{key:"restoreObjects",value:function(e){var t=this._mask,i=!t||t.visible,s=!t||t.edges,r=!t||t.xrayed,n=!t||t.highlighted,o=!t||t.selected,a=!t||t.clippable,l=!t||t.pickable,u=!t||t.colorize,A=!t||t.opacity,c=0,h=e.objects;for(var d in h)if(h.hasOwnProperty(d)){var p=h[d];i&&(p.visible=this.objectsVisible[c]),s&&(p.edges=this.objectsEdges[c]),r&&(p.xrayed=this.objectsXrayed[c]),n&&(p.highlighted=this.objectsHighlighted[c]),o&&(p.selected=this.objectsSelected[c]),a&&(p.clippable=this.objectsClippable[c]),l&&(p.pickable=this.objectsPickable[c]),u&&(this.objectsHasColorize[c]?(hd[0]=this.objectsColorize[3*c+0],hd[1]=this.objectsColorize[3*c+1],hd[2]=this.objectsColorize[3*c+2],p.colorize=hd):p.colorize=null),A&&(p.opacity=this.objectsOpacity[c]),c++}}}])}(),pd=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s])).v0=s.v0,i.v1=s.v1,i.v2=s.v2,i.v3=s.v3,i.t=s.t,i}return m(t,Nh),w(t,[{key:"v0",get:function(){return this._v0},set:function(e){this._v0=e||J.vec3([0,0,0])}},{key:"v1",get:function(){return this._v1},set:function(e){this._v1=e||J.vec3([0,0,0])}},{key:"v2",get:function(){return this._v2},set:function(e){this._v2=e||J.vec3([0,0,0])}},{key:"v3",get:function(){return this._v3},set:function(e){this.fire("v3",this._v3=e||J.vec3([0,0,0]))}},{key:"t",get:function(){return this._t},set:function(e){e=e||0,this._t=e<0?0:e>1?1:e}},{key:"point",get:function(){return this.getPoint(this._t)}},{key:"getPoint",value:function(e){var t=J.vec3();return t[0]=J.b3(e,this._v0[0],this._v1[0],this._v2[0],this._v3[0]),t[1]=J.b3(e,this._v0[1],this._v1[1],this._v2[1],this._v3[1]),t[2]=J.b3(e,this._v0[2],this._v1[2],this._v2[2],this._v3[2]),t}},{key:"getJSON",value:function(){return{v0:this._v0,v1:this._v1,v2:this._v2,v3:this._v3,t:this._t}}}])}(),fd=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s]))._cachedLengths=[],i._dirty=!0,i._curves=[],i._t=0,i._dirtySubs=[],i._destroyedSubs=[],i.curves=s.curves||[],i.t=s.t,i}return m(t,Nh),w(t,[{key:"addCurve",value:function(e){this._curves.push(e),this._dirty=!0}},{key:"curves",get:function(){return this._curves},set:function(e){var t,i,s;for(e=e||[],i=0,s=this._curves.length;i<s;i++)(t=this._curves[i]).off(this._dirtySubs[i]),t.off(this._destroyedSubs[i]);this._curves=[],this._dirtySubs=[],this._destroyedSubs=[];var r=this;function n(){r._dirty=!0}function o(){var e=this.id;for(i=0,s=r._curves.length;i<s;i++)if(r._curves[i].id===e)return r._curves=r._curves.slice(i,i+1),r._dirtySubs=r._dirtySubs.slice(i,i+1),r._destroyedSubs=r._destroyedSubs.slice(i,i+1),void(r._dirty=!0)}for(i=0,s=e.length;i<s;i++){if(t=e[i],oe.isNumeric(t)||oe.isString(t)){var a=t;if(!(t=this.scene.components[a])){this.error("Component not found: "+_inQuotes(a));continue}}var l=t.type;"xeokit.SplineCurve"===l||"xeokit.Path"===l||"xeokit.CubicBezierCurve"===l||"xeokit.QuadraticBezierCurve"===l?(this._curves.push(t),this._dirtySubs.push(t.on("dirty",n)),this._destroyedSubs.push(t.once("destroyed",o))):this.error("Component "+_inQuotes(t.id)+" is not a xeokit.SplineCurve, xeokit.Path or xeokit.QuadraticBezierCurve")}this._dirty=!0}},{key:"t",get:function(){return this._t},set:function(e){e=e||0,this._t=e<0?0:e>1?1:e}},{key:"point",get:function(){return this.getPoint(this._t)}},{key:"length",get:function(){var e=this._getCurveLengths();return e[e.length-1]}},{key:"getPoint",value:function(e){for(var t,i=e*this.length,s=this._getCurveLengths(),r=0;r<s.length;){if(s[r]>=i){var n=1-(s[r]-i)/(t=this._curves[r]).length;return t.getPointAt(n)}r++}return null}},{key:"_getCurveLengths",value:function(){if(!this._dirty)return this._cachedLengths;var e,t=[],i=0,s=this._curves.length;for(e=0;e<s;e++)i+=this._curves[e].length,t.push(i);return this._cachedLengths=t,this._dirty=!1,t}},{key:"_getJSON",value:function(){for(var e=[],t=0,i=this._curves.length;t<i;t++)e.push(this._curves[t].id);return{curves:e,t:this._t}}},{key:"destroy",value:function(){var e,i,s;for(f(t,"destroy",this,3)([]),e=0,i=this._curves.length;e<i;e++)(s=this._curves[e]).off(this._dirtySubs[e]),s.off(this._destroyedSubs[e])}}])}(),vd=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s])).v0=s.v0,i.v1=s.v1,i.v2=s.v2,i.t=s.t,i}return m(t,Nh),w(t,[{key:"v0",get:function(){return this._v0},set:function(e){this._v0=e||J.vec3([0,0,0])}},{key:"v1",get:function(){return this._v1},set:function(e){this._v1=e||J.vec3([0,0,0])}},{key:"v2",get:function(){return this._v2},set:function(e){this._v2=e||J.vec3([0,0,0])}},{key:"t",get:function(){return this._t},set:function(e){e=e||0,this._t=e<0?0:e>1?1:e}},{key:"point",get:function(){return this.getPoint(this._t)}},{key:"getPoint",value:function(e){var t=J.vec3();return t[0]=J.b2(e,this._v0[0],this._v1[0],this._v2[0]),t[1]=J.b2(e,this._v0[1],this._v1[1],this._v2[1]),t[2]=J.b2(e,this._v0[2],this._v1[2],this._v2[2]),t}},{key:"getJSON",value:function(){return{v0:this._v0,v1:this._v1,v2:this._v2,t:this._t}}}])}(),gd=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),h(this,t,[e,i])}return m(t,vh),w(t)}(),md=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s]))._state=new Jt({active:!0,pos:J.vec3(),dir:J.vec3(),dist:0}),i.active=!s.active||s.active,i.pickable=!!s.pickable&&s.pickable,i.enableClip=!s.enableClip||s.enableClip,i.controlIdName=s.controlIdName?s.controlIdName:"",i.lineBox=s.lineBox?s.lineBox:null,i.visible=!1,i.planes=[],i.boxRanges=[],i.scene._sectionBoxCreated(i),i._initBoxPlanes(),i}return m(t,_e),w(t,[{key:"type",get:function(){return"SectionBox"}},{key:"_initBoxPlanes",value:function(){var e=this,t=this,i=this.scene.aabb,s=this.scene.center,r=i[3]-i[0],n=i[4]-i[1],o=i[5]-i[2];function a(e){var t;switch(e){case 0:return t=1*r+0,[s[0]-r/2+t,s[1],s[2]];case 1:return t=1*n+0,[s[0],s[1]-n/2+t,s[2]];case 2:return t=1*o+0,[s[0],s[1],s[2]-o/2+t];case 3:return t=0*r-0,[s[0]-r/2+t,s[1],s[2]];case 4:return t=0*n-0,[s[0],s[1]-n/2+t,s[2]];case 5:return t=0*o-0,[s[0],s[1],s[2]-o/2+t]}}for(var l=function(i){e.boxRanges.push(a(i));var s=function(e){switch(e){case 0:return[-1,0,0];case 1:return[0,-1,0];case 2:return[0,0,-1];case 3:return[1,0,0];case 4:return[0,1,0];case 5:return[0,0,1]}}(i),r=new hn(e.scene,{active:e.active,controlId:e.controlIdName+i.toString(),planeId:i,box:t,dir:s,pos:a(i),enableClip:e.enableClip,pickable:e.pickable});e.planes.push(r),5==i&&(e.lineBox._maxRange=e.boxRanges),r.on("pos",(function(t){t!=e.boxRanges[i]&&(e.boxRanges.length<6||e.lineBox.updateBox(r.dir,e.boxRanges))}))},u=0;u<6;u++)l(u)}},{key:"active",get:function(){return this._state.active},set:function(e){this._state.active=!1!==e,e||(this.visible=e),this.planes&&this.planes.forEach((function(t){t.active=e})),this.glRedraw(),this.fire("active",this._state.active)}},{key:"visible",get:function(){return this._state.visible},set:function(e){this._state.visible=0!=e,e&&!this.active&&(this.active=!0),this.planes&&this.planes.forEach((function(t){t.control.setVisible(e)}))}},{key:"dist",get:function(){return this._state.dist}},{key:"destroy",value:function(){this.planes.forEach((function(e){e.destroy()})),this._state.destroy(),this.scene._sectionBoxDestroyed(this),f(t,"destroy",this,3)([])}}])}(),_d=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s]))._skyboxMesh=new nn(i,{geometry:new Ti(i,{primitive:"triangles",positions:[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1],uv:[.5,.6666,.25,.6666,.25,.3333,.5,.3333,.5,.6666,.5,.3333,.75,.3333,.75,.6666,.5,.6666,.5,1,.25,1,.25,.6666,.25,.6666,0,.6666,0,.3333,.25,.3333,.25,0,.5,0,.5,.3333,.25,.3333,.75,.3333,1,.3333,1,.6666,.75,.6666],indices:[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]}),background:!0,scale:[2e3,2e3,2e3],rotation:[0,-90,0],material:new Qi(i,{ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],emissive:[1,1,1],emissiveMap:new On(i,{scale:s.scale,src:s.src,image:s.image,flipY:!0,wrapS:1e3,wrapT:1e3,encoding:s.encoding||"sRGB"}),backfaces:!0}),visible:!1,pickable:!1,clippable:!1,collidable:!1}),i.size=s.size,i.active=s.active,i}return m(t,_e),w(t,[{key:"size",get:function(){return this._size},set:function(e){this._size=e||1e3,this._skyboxMesh.scale=[this._size,this._size,this._size]}},{key:"active",get:function(){return this._skyboxMesh.visible},set:function(e){this._skyboxMesh.visible=e}}])}(),yd=function(){return w((function e(){B(this,e)}),[{key:"transcode",value:function(e,t){}},{key:"destroy",value:function(){}}])}(),bd=J.vec4(),Bd=J.vec4(),xd=J.vec3(),wd=J.vec3(),Pd=J.vec3(),Cd=J.vec4(),Md=J.vec4(),kd=J.vec4(),Fd=function(){return w((function e(t){B(this,e),this._scene=t}),[{key:"dollyToCanvasPos",value:function(e,t,i){var s=!1,r=this._scene.camera;if(e){var n=J.subVec3(e,r.eye,xd);s=J.lenVec3(n)<i}if("perspective"===r.projection){r.ortho.scale=r.ortho.scale-i;var o=this._unproject(t,Cd),a=J.subVec3(o,r.eye,kd),l=J.mulVec3Scalar(J.normalizeVec3(a),-i,[]);if(r.eye=[r.eye[0]-l[0],r.eye[1]-l[1],r.eye[2]-l[2]],r.look=[r.look[0]-l[0],r.look[1]-l[1],r.look[2]-l[2]],e){var u=J.subVec3(e,r.eye,xd),A=J.lenVec3(u),c=J.mulVec3Scalar(J.normalizeVec3(J.subVec3(r.look,r.eye,wd)),A);r.look=[r.eye[0]+c[0],r.eye[1]+c[1],r.eye[2]+c[2]]}}else if("ortho"===r.projection){var h=this._unproject(t,Cd);r.ortho.scale=r.ortho.scale-i,r.ortho._update();var d=this._unproject(t,Md),p=J.subVec3(d,h,kd),f=J.mulVec3Scalar(J.normalizeVec3(J.subVec3(r.look,r.eye,xd)),-i,wd),v=J.addVec3(p,f,Pd);r.eye=[r.eye[0]-v[0],r.eye[1]-v[1],r.eye[2]-v[2]],r.look=[r.look[0]-v[0],r.look[1]-v[1],r.look[2]-v[2]]}return s}},{key:"_unproject",value:function(e,t){var i=this._scene.camera,s=i.project.transposedMatrix,r=s.subarray(8,12),n=s.subarray(12),o=[0,0,-1,1],a=J.dotVec4(o,r)/J.dotVec4(o,n);return i.project.unproject(e,a,bd,Bd,t),t}},{key:"destroy",value:function(){}}])}(),Ed=J.vec3(),Dd=J.vec3(),Id=J.vec3(),Sd=J.vec4(),Td=J.vec4(),Ld=J.vec4(),Rd=function(){return w((function e(t,i){var s=this;B(this,e),this._scene=t,this._configs=i,this._pivotWorldPos=J.vec3(),this._cameraOffset=J.vec3(),this._azimuth=0,this._polar=0,this._radius=0,this._pivotPosSet=!1,this._pivoting=!1,this._shown=!1,this._pivotSphereEnabled=!1,this._pivotSphere=null,this._pivotSphereSize=1,this._pivotSphereGeometry=null,this._pivotSphereMaterial=null,this._rtcCenter=J.vec3(),this._rtcPos=J.vec3(),this._pivotViewPos=J.vec4(),this._pivotProjPos=J.vec4(),this._pivotCanvasPos=J.vec2(),this._cameraDirty=!0,this._onViewMatrix=this._scene.camera.on("viewMatrix",(function(){s._cameraDirty=!0})),this._onProjMatrix=this._scene.camera.on("projMatrix",(function(){s._cameraDirty=!0})),this._onTick=this._scene.on("tick",(function(){s.updatePivotElement(),s.updatePivotSphere()}))}),[{key:"createPivotSphere",value:function(){var e=this.getPivotPos(),t=J.vec3();J.decomposeMat4(J.inverseMat4(this._scene.viewer.camera.viewMatrix,J.mat4()),t,J.vec4(),J.vec3());var i=J.distVec3(t,e),s=Math.tan(Math.PI/500)*i*this._pivotSphereSize;"ortho"==this._scene.camera.projection&&(s/=this._scene.camera.ortho.scale/2),xe(e,this._rtcCenter,this._rtcPos),this._pivotSphereGeometry=new Hn(this._scene,ln({radius:s})),this._pivotSphere=new nn(this._scene,{geometry:this._pivotSphereGeometry,material:this._pivotSphereMaterial,pickable:!1,position:this._rtcPos,rtcCenter:this._rtcCenter})}},{key:"destroyPivotSphere",value:function(){this._pivotSphere&&(this._pivotSphere.destroy(),this._pivotSphere=null),this._pivotSphereGeometry&&(this._pivotSphereGeometry.destroy(),this._pivotSphereGeometry=null)}},{key:"getPointScreenPos",value:function(e){var t=this._scene.camera,i=this._scene.canvas.boundary,s=i[2],r=i[3],n=J.vec4(),o=J.vec4(),a=J.vec2();return J.transformPoint3(t.viewMatrix,e,n),J.transformPoint4(t.projMatrix,e,o),a[0]=Math.floor((1+o[0]/o[3])*s/2),a[1]=Math.floor((1-o[1]/o[3])*r/2),a}},{key:"updatePivotElement",value:function(){var e=this._scene.camera,t=this._scene.canvas;if(this._pivoting&&this._cameraDirty){J.transformPoint3(e.viewMatrix,this.getPivotPos(),this._pivotViewPos),this._pivotViewPos[3]=1,J.transformPoint4(e.projMatrix,this._pivotViewPos,this._pivotProjPos);var i=t.boundary,s=i[2],r=i[3];this._pivotCanvasPos[0]=Math.floor((1+this._pivotProjPos[0]/this._pivotProjPos[3])*s/2),this._pivotCanvasPos[1]=Math.floor((1-this._pivotProjPos[1]/this._pivotProjPos[3])*r/2);var n=t._lastBoundingClientRect,o=t.canvas;n=t._lastBoundingClientRect=o.getBoundingClientRect(),this._pivotElement&&(this._pivotElement.style.left=Math.floor(n.left+this._pivotCanvasPos[0])-this._pivotElement.clientWidth/2+window.scrollX,this._pivotElement.style.top=Math.floor(n.top+this._pivotCanvasPos[1])-this._pivotElement.clientHeight/2+window.scrollY),this._cameraDirty=!1}}},{key:"updatePivotSphere",value:function(){this._pivoting&&this._pivotSphere&&(xe(this.getPivotPos(),this._rtcCenter,this._rtcPos),J.compareVec3(this._rtcPos,this._pivotSphere.position)||(this.destroyPivotSphere(),this.createPivotSphere()))}},{key:"setPivotElement",value:function(e){this._pivotElement=e}},{key:"enablePivotSphere",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.destroyPivotSphere(),this._pivotSphereEnabled=!0,e.size&&(this._pivotSphereSize=e.size);var t=e.color||[1,0,0];this._pivotSphereMaterial=new Qi(this._scene,{emissive:t,ambient:t,specular:[0,0,0],diffuse:[0,0,0]})}},{key:"disablePivotSphere",value:function(){this.destroyPivotSphere(),this._pivotSphereEnabled=!1}},{key:"startPivot",value:function(){if(this._cameraLookingDownwards())return this._pivoting=!1,!1;var e=this._scene.camera,t=J.lookAtMat4v(e.eye,e.look,e.worldUp);J.transformPoint3(t,this.getPivotPos(),this._cameraOffset);var i=this.getPivotPos();this._cameraOffset[2]+=J.distVec3(e.eye,i),t=J.inverseMat4(t);var s=J.transformVec3(t,this._cameraOffset),r=J.vec3();if(J.subVec3(e.eye,i,r),J.addVec3(r,s),e.zUp){var n=r[1];r[1]=r[2],r[2]=n}this._radius=J.lenVec3(r),this._polar=Math.acos(r[1]/this._radius),this._azimuth=Math.atan2(r[0],r[2]),this._pivoting=!0}},{key:"_cameraLookingDownwards",value:function(){var e=this._scene.camera,t=J.normalizeVec3(J.subVec3(e.look,e.eye,Ed)),i=J.cross3Vec3(t,e.worldUp,Dd);return J.sqLenVec3(i)<=1e-4}},{key:"getPivoting",value:function(){return this._pivoting}},{key:"setPivotPos",value:function(e){this._pivotWorldPos&&this._pivotWorldPos.set(e),this._pivotPosSet=!0}},{key:"setCanvasPivotPos",value:function(e){var t=this._scene.camera,i=Math.abs(J.distVec3(this._scene.center,t.eye)),s=t.project.transposedMatrix,r=s.subarray(8,12),n=s.subarray(12),o=[0,0,-1,1],a=J.dotVec4(o,r)/J.dotVec4(o,n),l=Sd;t.project.unproject(e,a,Td,Ld,l);var u=J.normalizeVec3(J.subVec3(l,t.eye,Ed)),A=J.addVec3(t.eye,J.mulVec3Scalar(u,i,Dd),Id);this.setPivotPos(A)}},{key:"getPivotPos",value:function(){return this._pivotPosSet?this._pivotWorldPos:this._scene.camera.look}},{key:"continuePivot",value:function(e,t){if(this._pivoting&&(0!==e||0!==t)){var i=this._scene.camera,s=-e,r=-t;1===i.worldUp[2]&&(s=-s),this._azimuth+=.01*-s,this._polar+=.01*r,this._polar=J.clamp(this._polar,.001,Math.PI-.001);var n=[this._radius*Math.sin(this._polar)*Math.sin(this._azimuth),this._radius*Math.cos(this._polar),this._radius*Math.sin(this._polar)*Math.cos(this._azimuth)];if(1===i.worldUp[2]){var o=n[1];n[1]=n[2],n[2]=o}var a=J.lenVec3(J.subVec3(i.look,i.eye,J.vec3())),l=this.getPivotPos();J.addVec3(n,l);var u=J.lookAtMat4v(n,l,i.worldUp);u=J.inverseMat4(u);var A=J.transformVec3(u,this._cameraOffset);u[12]-=A[0],u[13]-=A[1],u[14]-=A[2];var c=[u[8],u[9],u[10]];i.eye=[u[12],u[13],u[14]],J.subVec3(i.eye,J.mulVec3Scalar(c,a),i.look),i.up=[u[4],u[5],u[6]],this.showPivot()}}},{key:"showPivot",value:function(){this._shown||(this._pivotElement&&(this.updatePivotElement(),this._pivotElement.style.visibility="visible"),this._pivotSphereEnabled&&(this.destroyPivotSphere(),this.createPivotSphere()),this._shown=!0)}},{key:"hidePivot",value:function(){this._shown&&(this._pivotElement&&(this._pivotElement.style.visibility="hidden"),this._pivotSphereEnabled&&this.destroyPivotSphere(),this._shown=!1)}},{key:"endPivot",value:function(){this._pivoting=!1}},{key:"destroy",value:function(){this._pivotElement&&this._pivotElement.parentNode.removeChild(this._pivotElement),this.destroyPivotSphere(),this._scene.camera.off(this._onViewMatrix),this._scene.camera.off(this._onProjMatrix),this._scene.off(this._onTick)}}])}(),Ud=function(){return w((function e(t,i){B(this,e),this._scene=t.scene,this._cameraControl=t,this._scene.canvas.canvas.oncontextmenu=function(e){e.preventDefault()},this._configs=i,this.schedulePickEntity=!1,this.schedulePickSurface=!1,this.scheduleSnapOrPick=!1,this.pickCursorPos=J.vec2(),this.picked=!1,this.pickedSurface=!1,this.pickResult=null,this._lastPickedEntityId=null,this._lastHash=null,this._needFireEvents=0}),[{key:"update",value:function(){if(this._configs.pointerEnabled&&(this.schedulePickEntity||this.schedulePickSurface)){var e="".concat(~~this.pickCursorPos[0],"-").concat(~~this.pickCursorPos[1],"-").concat(this.scheduleSnapOrPick,"-").concat(this.schedulePickSurface,"-").concat(this.schedulePickEntity);if(this._lastHash!==e){this.picked=!1,this.pickedSurface=!1,this.snappedOrPicked=!1,this.hoveredSnappedOrSurfaceOff=!1;var t=this._cameraControl.hasSubs("hoverSurface");if(this.scheduleSnapOrPick){var i=this._scene.pick({canvasPos:this.pickCursorPos,snapRadius:this._configs.snapRadius,snapToVertex:this._configs.snapToVertex,snapToEdge:this._configs.snapToEdge});i&&(i.snappedToEdge||i.snappedToVertex)?(this.snapPickResult=i,this.snappedOrPicked=!0,this._needFireEvents++):(this.schedulePickSurface=!0,this.snapPickResult=null)}if(this.schedulePickSurface&&this.pickResult&&this.pickResult.worldPos){var s=this.pickResult.canvasPos;if(s){if(s[0]===this.pickCursorPos[0]&&s[1]===this.pickCursorPos[1])return this.picked=!0,this.pickedSurface=!0,this._needFireEvents+=t?1:0,this.schedulePickEntity=!1,this.schedulePickSurface=!1,this.scheduleSnapOrPick?this.snappedOrPicked=!0:this.hoveredSnappedOrSurfaceOff=!0,void(this.scheduleSnapOrPick=!1)}else console.log("no pickResultCanvasPos")}if(this.schedulePickEntity&&this.pickResult&&(this.pickResult.canvasPos||this.pickResult.snappedCanvasPos)){var r=this.pickResult.canvasPos||this.pickResult.snappedCanvasPos;if(r[0]===this.pickCursorPos[0]&&r[1]===this.pickCursorPos[1])return this.picked=!0,this.pickedSurface=!1,this.schedulePickEntity=!1,void(this.schedulePickSurface=!1)}this.schedulePickSurface||this.scheduleSnapOrPick&&!this.snapPickResult?(this.pickResult=this._scene.pick({pickSurface:!0,pickSurfaceNormal:!1,canvasPos:this.pickCursorPos}),this.pickResult?(this.picked=!0,this.scheduleSnapOrPick?this.snappedOrPicked=!0:this.pickedSurface=!0,this._needFireEvents++):this.scheduleSnapOrPick&&(this.hoveredSnappedOrSurfaceOff=!0,this._needFireEvents++)):(this.pickResult=this._scene.pick({canvasPos:this.pickCursorPos}),this.pickResult&&(this.picked=!0,this.pickedSurface=!1,this._needFireEvents++)),this.scheduleSnapOrPick=!1,this.schedulePickEntity=!1,this.schedulePickSurface=!1}}}},{key:"fireEvents",value:function(){if(0!==this._needFireEvents){if(this.hoveredSnappedOrSurfaceOff&&this._cameraControl.fire("hoverSnapOrSurfaceOff",{canvasPos:this.pickCursorPos,pointerPos:this.pickCursorPos},!0),this.snappedOrPicked)if(this.snapPickResult){var e=new Bt;e.snappedToVertex=this.snapPickResult.snappedToVertex,e.snappedToEdge=this.snapPickResult.snappedToEdge,e.worldPos=this.snapPickResult.worldPos,e.canvasPos=this.pickCursorPos,e.snappedCanvasPos=this.snapPickResult.snappedCanvasPos,this._cameraControl.fire("hoverSnapOrSurface",e,!0),this.snapPickResult=null}else this._cameraControl.fire("hoverSnapOrSurface",this.pickResult,!0);if(this.picked&&this.pickResult&&(this.pickResult.entity||this.pickResult.worldPos)){if(this.pickResult.entity){var t=this.pickResult.entity.id;this._lastPickedEntityId!==t&&(void 0!==this._lastPickedEntityId&&this._cameraControl.fire("hoverOut",{entity:this._scene.objects[this._lastPickedEntityId]},!0),this._cameraControl.fire("hoverEnter",this.pickResult,!0),this._lastPickedEntityId=t)}this._cameraControl.fire("hover",this.pickResult,!0),this.pickResult.worldPos&&(this.pickedSurface=!0,this._cameraControl.fire("hoverSurface",this.pickResult,!0))}else void 0!==this._lastPickedEntityId&&(this._cameraControl.fire("hoverOut",{entity:this._scene.objects[this._lastPickedEntityId]},!0),this._lastPickedEntityId=void 0),this._cameraControl.fire("hoverOff",{canvasPos:this.pickCursorPos},!0);this.pickResult=null,this._needFireEvents=0}}}])}(),Od=J.vec2(),Qd=function(){return w((function e(t,i,s,r,n){B(this,e),this._scene=t;var o,a,l,u=i.pickController,A=0,c=0,h=0,d=0,p=!1,f=J.vec3(),v=!0,g=this._scene.canvas.canvas,m=[];function _(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];g.style.cursor="move",A=r.pointerCanvasPos[0],c=r.pointerCanvasPos[1],h=r.pointerCanvasPos[0],d=r.pointerCanvasPos[1],e&&(u.pickCursorPos=r.pointerCanvasPos,u.schedulePickSurface=!0,u.update(),u.picked&&u.pickedSurface&&u.pickResult&&u.pickResult.worldPos?(p=!0,f.set(u.pickResult.worldPos)):p=!1)}document.addEventListener("keydown",this._documentKeyDownHandler=function(e){if(s.active&&s.pointerEnabled&&t.input.keyboardEnabled){var i=e.keyCode;m[i]=!0}}),document.addEventListener("keyup",this._documentKeyUpHandler=function(e){if(s.active&&s.pointerEnabled&&t.input.keyboardEnabled){var i=e.keyCode;m[i]=!1}}),g.addEventListener("mousedown",this._mouseDownHandler=function(e){if(s.active&&s.pointerEnabled)switch(e.which){case 1:m[t.input.KEY_SHIFT]||s.planView?(o=!0,_()):(o=!0,_(!1));break;case 2:a=!0,_();break;case 3:l=!0,s.panRightClick&&_()}}),document.addEventListener("mousemove",this._documentMouseMoveHandler=function(e){if(s.active&&s.pointerEnabled&&(o||a||l)){var i=t.canvas.boundary,u=i[2],h=i[3],d=r.pointerCanvasPos[0],v=r.pointerCanvasPos[1],g=m[t.input.KEY_SHIFT]||s.planView||!s.panRightClick&&a||s.panRightClick&&l,_=document.pointerLockElement?e.movementX:d-A,y=document.pointerLockElement?e.movementY:v-c;if(g){var b=t.camera;if("perspective"===b.projection){var B=Math.abs(p?J.lenVec3(J.subVec3(f,t.camera.eye,[])):t.camera.eyeLookDist)*Math.tan(b.perspective.fov/2*Math.PI/180);b.yUp&&(n.panDeltaX+=1.5*_*B/h,n.panDeltaY+=1.5*y*B/h),b.zUp&&(n.panDeltaX+=1.5*_*B/h,n.panDeltaY+=1.5*y*B/h)}else b.yUp&&(n.panDeltaX+=.5*b.ortho.scale*(_/h),n.panDeltaY+=.5*b.ortho.scale*(y/h)),b.zUp&&(n.panDeltaX+=.5*b.ortho.scale*(_/h),n.panDeltaY+=.5*b.ortho.scale*(y/h))}else!o||a||l||s.planView||(s.firstPerson?(n.rotateDeltaY-=_/u*(s.dragRotationRate/2),n.rotateDeltaX+=y/h*(s.dragRotationRate/4)):(n.rotateDeltaY-=_/u*(1.5*s.dragRotationRate),n.rotateDeltaX+=y/h*(1.5*s.dragRotationRate)));A=d,c=v}}),g.addEventListener("mousemove",this._canvasMouseMoveHandler=function(e){s.active&&s.pointerEnabled&&r.mouseover&&(v=!0)}),document.addEventListener("mouseup",this._documentMouseUpHandler=function(e){if(s.active&&s.pointerEnabled)switch(e.which){case 1:case 2:case 3:o=!1,a=!1,l=!1}}),g.addEventListener("mouseup",this._mouseUpHandler=function(e){if(s.active&&s.pointerEnabled){if(3===e.which){!function(e,t){if(e){for(var i=e.target,s=0,r=0,n=0,o=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,n+=i.scrollLeft,o+=i.scrollTop,i=i.offsetParent;t[0]=e.pageX+n-s,t[1]=e.pageY+o-r}else e=window.event,t[0]=e.x,t[1]=e.y}(e,Od);var t=Od[0],r=Od[1];Math.abs(t-h)<3&&Math.abs(r-d)<3&&i.cameraControl.fire("rightClick",{pagePos:[Math.round(e.pageX),Math.round(e.pageY)],canvasPos:Od,event:e},!0)}g.style.removeProperty("cursor")}}),g.addEventListener("mouseenter",this._mouseEnterHandler=function(){s.active&&s.pointerEnabled});var y=1/60,b=null;this._scene.on("collideWithEntity",(function(e){})),g.addEventListener("wheel",this._mouseWheelHandler=function(e){if(s.active&&s.pointerEnabled&&s.zoomOnMouseWheel){var t=performance.now()/1e3,i=null!==b?t-b:0;b=t,i>.05&&(i=.05),i<y&&(i=y);var o=Math.max(-1,Math.min(1,40*-e.deltaY));if(0!==o){var a=o/Math.abs(o);n.dollyDelta+=-a*i*s.mouseWheelDollyRate,v&&(r.followPointerDirty=!0,v=!1)}}},{passive:!0})}),[{key:"reset",value:function(){}},{key:"destroy",value:function(){var e=this._scene.canvas.canvas;document.removeEventListener("keydown",this._documentKeyDownHandler),document.removeEventListener("keyup",this._documentKeyUpHandler),e.removeEventListener("mousedown",this._mouseDownHandler),document.removeEventListener("mousemove",this._documentMouseMoveHandler),e.removeEventListener("mousemove",this._canvasMouseMoveHandler),document.removeEventListener("mouseup",this._documentMouseUpHandler),e.removeEventListener("mouseup",this._mouseUpHandler),e.removeEventListener("mouseenter",this._mouseEnterHandler),e.removeEventListener("wheel",this._mouseWheelHandler)}}])}(),Nd=J.vec3(),Vd=J.vec3(),Hd=J.vec3(),jd=J.vec3(),Gd=J.vec3(),zd={eye:J.vec3(),look:J.vec3(),up:J.vec3()},Wd=function(){return w((function e(t,i,s,r){B(this,e),this._scene=t,this.input=t.input;var n=i.cameraControl,o=t.camera;this._onSceneKeyDown=t.input.on("keydown",(function(){if(s.active&&s.pointerEnabled&&t.input.keyboardEnabled&&r.mouseover){var e=n._isKeyDownForAction(n.AXIS_VIEW_RIGHT),a=n._isKeyDownForAction(n.AXIS_VIEW_BACK),l=n._isKeyDownForAction(n.AXIS_VIEW_LEFT),u=n._isKeyDownForAction(n.AXIS_VIEW_FRONT),A=n._isKeyDownForAction(n.AXIS_VIEW_TOP),c=n._isKeyDownForAction(n.AXIS_VIEW_BOTTOM);if(e||a||l||u||A||c){var h=t.aabb,d=J.getAABB3Diag(h);J.getAABB3Center(h,Nd);var p=Math.abs(d/Math.tan(i.cameraFlight.fitFOV*J.DEGTORAD)),f=1.1*d;zd.orthoScale=f,e?(zd.eye.set(J.addVec3(Nd,J.mulVec3Scalar(o.worldRight,p,Vd),Gd)),zd.look.set(Nd),zd.up.set(o.worldUp)):a?(zd.eye.set(J.addVec3(Nd,J.mulVec3Scalar(o.worldForward,p,Vd),Gd)),zd.look.set(Nd),zd.up.set(o.worldUp)):l?(zd.eye.set(J.addVec3(Nd,J.mulVec3Scalar(o.worldRight,-p,Vd),Gd)),zd.look.set(Nd),zd.up.set(o.worldUp)):u?(zd.eye.set(J.addVec3(Nd,J.mulVec3Scalar(o.worldForward,-p,Vd),Gd)),zd.look.set(Nd),zd.up.set(o.worldUp)):A?(zd.eye.set(J.addVec3(Nd,J.mulVec3Scalar(o.worldUp,p,Vd),Gd)),zd.look.set(Nd),zd.up.set(J.normalizeVec3(J.mulVec3Scalar(o.worldForward,1,Hd),jd))):c&&(zd.eye.set(J.addVec3(Nd,J.mulVec3Scalar(o.worldUp,-p,Vd),Gd)),zd.look.set(Nd),zd.up.set(J.normalizeVec3(J.mulVec3Scalar(o.worldForward,-1,Hd)))),!s.firstPerson&&s.followPointer&&i.pivotController.setPivotPos(Nd),i.cameraFlight.duration>0?i.cameraFlight.flyTo(zd,(function(){i.pivotController.getPivoting()&&s.followPointer&&i.pivotController.showPivot()})):(i.cameraFlight.jumpTo(zd),i.pivotController.getPivoting()&&s.followPointer&&i.pivotController.showPivot())}}}))}),[{key:"reset",value:function(){}},{key:"destroy",value:function(){this.input.off(this._onSceneKeyDown)}}])}(),Kd=function(){return w((function e(t,i,s,r,n){var o=this;B(this,e),this._scene=t;var a=i.pickController,l=i.pivotController,u=i.cameraControl;this._clicks=0,this._timeout=null,this._lastPickedEntityId=null,this._lastClickedWorldPos=null;var A=!1,c=!1;this.canvas=this._scene.canvas.canvas;var h=function(e){var s;e&&e.worldPos&&(s=e.worldPos);var r=e&&e.entity?e.entity.aabb:t.aabb;if(s){var n=t.camera;J.subVec3(n.eye,n.look,[]),i.cameraFlight.flyTo({aabb:r})}else i.cameraFlight.flyTo({aabb:r})},d=t.tickify(this._canvasMouseMoveHandler=function(e){if(s.active&&s.pointerEnabled&&!A&&!c){if(u.hasSubs("rayMove")){var i=J.vec3(),n=J.vec3();J.canvasPosToWorldRay(t.canvas.canvas,t.camera.viewMatrix,t.camera.projMatrix,t.camera.projection,r.pointerCanvasPos,i,n),u.fire("rayMove",{canvasPos:r.pointerCanvasPos,ray:{origin:i,direction:n,canvasPos:r.pointerCanvasPos}},!0)}var l=u.hasSubs("hover"),h=u.hasSubs("hoverEnter"),d=u.hasSubs("hoverOut"),p=u.hasSubs("hoverOff"),f=u.hasSubs("hoverSurface"),v=u.hasSubs("hoverSnapOrSurface");if(l||h||d||p||f||v)if(a.pickCursorPos=r.pointerCanvasPos,a.schedulePickEntity=!0,a.schedulePickSurface=f,a.scheduleSnapOrPick=v,a.update(),a.pickResult){if(a.pickResult.entity){var g=a.pickResult.entity.id;o._lastPickedEntityId!==g&&(void 0!==o._lastPickedEntityId&&u.fire("hoverOut",{entity:t.objects[o._lastPickedEntityId]},!0),u.fire("hoverEnter",a.pickResult,!0),o._lastPickedEntityId=g)}u.fire("hover",a.pickResult,!0),(a.pickResult.worldPos||a.pickResult.snappedWorldPos)&&u.fire("hoverSurface",a.pickResult,!0)}else void 0!==o._lastPickedEntityId&&(u.fire("hoverOut",{entity:t.objects[o._lastPickedEntityId]},!0),o._lastPickedEntityId=void 0),u.fire("hoverOff",{canvasPos:a.pickCursorPos},!0)}});this.canvas.addEventListener("mousemove",d),this.canvas.addEventListener("dblclick",this._canvasDblClickHandler=function(e){r.mouseDownClientX=e.clientX,r.mouseDownClientY=e.clientY,r.mouseDownCursorX=r.pointerCanvasPos[0],r.mouseDownCursorY=r.pointerCanvasPos[1],s.followPointer&&(a.pickCursorPos=r.pointerCanvasPos,a.schedulePickSurface=!0,a.update()),a.pickResult?(u.fire("doublePicked",a.pickResult,!0),a.pickedSurface&&u.fire("doublePickedSurface",a.pickResult,!0)):u.fire("doublePickedNothing",{canvasPos:r.pointerCanvasPos},!0)}),this.canvas.addEventListener("mousedown",this._canvasMouseDownHandler=function(e){if(1===e.which&&(A=!0),3===e.which&&(c=!0),1===e.which&&s.active&&s.pointerEnabled&&(r.mouseDownClientX=e.clientX,r.mouseDownClientY=e.clientY,r.mouseDownCursorX=r.pointerCanvasPos[0],r.mouseDownCursorY=r.pointerCanvasPos[1],!s.firstPerson&&s.followPointer&&(a.pickCursorPos=r.pointerCanvasPos,a.schedulePickSurface=!0,a.update(),1===e.which))){var i=a.pickResult;i&&i.worldPos?(l.setCanvasPivotPos(r.pointerCanvasPos),u.fire("mouseDownEntity",a.pickResult,!0),o._lastClickedWorldPos=i.worldPos):(s.smartPivot?l.setCanvasPivotPos(r.pointerCanvasPos):o._lastClickedWorldPos?l.setPivotPos(o._lastClickedWorldPos):l.setPivotPos(t.camera.look),l.startPivot(),u.fire("mouseDownNothing",a.pickResult,!0))}}),document.addEventListener("mouseup",this._documentMouseUpHandler=function(e){1===e.which&&(A=!1),3===e.which&&(c=!1),l.getPivoting()&&l.endPivot()}),this.canvas.addEventListener("mouseup",this._canvasMouseUpHandler=function(e){if(s.active&&s.pointerEnabled&&(1===e.which&&(l.hidePivot(),!(Math.abs(e.clientX-r.mouseDownClientX)>3||Math.abs(e.clientY-r.mouseDownClientY)>3)))){var n=u.hasSubs("picked"),A=u.hasSubs("pickedNothing"),c=u.hasSubs("pickedSurface"),d=u.hasSubs("doublePicked"),p=u.hasSubs("doublePickedSurface"),f=u.hasSubs("doublePickedNothing");if(!(s.doublePickFlyTo||d||p||f))return(n||A||c)&&(a.pickCursorPos=r.pointerCanvasPos,a.schedulePickEntity=!0,a.schedulePickSurface=c,a.update(),a.pickResult?(u.fire("picked",a.pickResult,!0),a.pickedSurface&&u.fire("pickedSurface",a.pickResult,!0)):u.fire("pickedNothing",{canvasPos:r.pointerCanvasPos},!0)),void(o._clicks=0);if(o._clicks++,1===o._clicks){a.pickCursorPos=r.pointerCanvasPos,a.schedulePickEntity=s.doublePickFlyTo,a.schedulePickSurface=c,a.update();var v=a.pickResult,g=a.pickedSurface;o._timeout=setTimeout((function(){v&&v.worldPos?(u.fire("picked",v,!0),g&&(u.fire("pickedSurface",v,!0),!s.firstPerson&&s.followPointer&&(i.pivotController.setPivotPos(v.worldPos),i.pivotController.startPivot()&&i.pivotController.showPivot()))):u.fire("pickedNothing",{canvasPos:r.pointerCanvasPos},!0),o._clicks=0}),s.doubleClickTimeFrame)}else{if(null!==o._timeout&&(window.clearTimeout(o._timeout),o._timeout=null),a.pickCursorPos=r.pointerCanvasPos,a.schedulePickEntity=s.doublePickFlyTo||d||p,a.schedulePickSurface=a.schedulePickEntity&&p,a.update(),a.pickResult){if(u.fire("doublePicked",a.pickResult,!0),a.pickedSurface&&u.fire("doublePickedSurface",a.pickResult,!0),s.doublePickFlyTo&&(h(a.pickResult),!s.firstPerson&&s.followPointer)){var m=a.pickResult.entity.aabb,_=J.getAABB3Center(m);i.pivotController.setPivotPos(_),i.pivotController.startPivot()&&i.pivotController.showPivot()}}else if(u.fire("doublePickedNothing",{canvasPos:r.pointerCanvasPos},!0),s.doublePickFlyTo&&(h(),!s.firstPerson&&s.followPointer)){var y=t.aabb,b=J.getAABB3Center(y);i.pivotController.setPivotPos(b),i.pivotController.startPivot()&&i.pivotController.showPivot()}o._clicks=0}}},!1)}),[{key:"reset",value:function(){this._clicks=0,this._lastPickedEntityId=null,this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null)}},{key:"destroy",value:function(){null!=this.canvas&&(this.canvas.removeEventListener("mousemove",this._canvasMouseMoveHandler),this.canvas.removeEventListener("mousedown",this._canvasMouseDownHandler),this.canvas.removeEventListener("dblclick",this._canvasDblClickHandler),this.canvas.removeEventListener("mouseup",this._canvasMouseUpHandler)),document.removeEventListener("mouseup",this._documentMouseUpHandler),this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null)}}])}(),Xd=function(){return w((function e(t,i,s,r,n,o){var a=this;B(this,e),this._scene=t,this._updates=n,this._cameraControl=o;var l=t.input;this.input=l;var u=[];this._movespeed=6,this._movespeedList=[.02,.05,.1,.2,.3,.5,1,1.5,2,2.5,3,3.5,4,8,10,12,16,24,32];var A=t.canvas.canvas,c=!1,h=!1,d=!0;this._onSceneMouseMove=l.on("mousemove",(function(){d=!0})),this._onSceneKeyDown=l.on("keydown",(function(e){s.active&&s.pointerEnabled&&t.input.keyboardEnabled&&r.mouseover&&(u[e]=!0,e===l.KEY_SHIFT&&(A.style.cursor="move"),e===l.KEY_EQUAL_SIGN&&(c||(c=!0)),e===l.KEY_DASH&&(h||(h=!0)))})),this._onSceneKeyUp=l.on("keyup",(function(e){s.active&&s.pointerEnabled&&t.input.keyboardEnabled&&(u[e]=!1,e===l.KEY_SHIFT&&(A.style.cursor=null),i.pivotController.getPivoting()&&i.pivotController.endPivot(),e===l.KEY_ADD&&(c=!1),e===l.KEY_SUBTRACT&&(h=!1))}));var p=!0;this._scene.on("collideWithEntity",(function(e){p=!e})),this._onTick=t.on("tick",(function(e){if(s.active&&s.pointerEnabled&&t.input.keyboardEnabled&&r.mouseover){var o=i.cameraControl,A=e.deltaTime/1e3;if(!s.planView){var f=o._isKeyDownForAction(o.ROTATE_Y_POS,u),v=o._isKeyDownForAction(o.ROTATE_Y_NEG,u),g=o._isKeyDownForAction(o.ROTATE_X_POS,u),m=o._isKeyDownForAction(o.ROTATE_X_NEG,u),_=A*s.keyboardRotationRate;(f||v||g||m)&&(!s.firstPerson&&s.followPointer&&i.pivotController.startPivot(),f?n.rotateDeltaY+=_*a._movespeedList[a._movespeed]:v&&(n.rotateDeltaY-=_*a._movespeedList[a._movespeed]),g?n.rotateDeltaX+=_*a._movespeedList[a._movespeed]:m&&(n.rotateDeltaX-=_*a._movespeedList[a._movespeed]),!s.firstPerson&&s.followPointer&&i.pivotController.startPivot())}if(!u[l.KEY_CTRL]&&!u[l.KEY_ALT]){var y=o._isKeyDownForAction(o.DOLLY_BACKWARDS,u),b=o._isKeyDownForAction(o.DOLLY_FORWARDS,u);if(y||b){var B=A*s.keyboardDollyRate;if(!s.firstPerson&&s.followPointer&&i.pivotController.startPivot(),b){if(!p)return;n.dollyDelta-=B*a._movespeedList[a._movespeed]}else y&&(n.dollyDelta+=B*a._movespeedList[a._movespeed]);d&&(r.followPointerDirty=!0,d=!1)}}var x=o._isKeyDownForAction(o.SPEED_UP,u),w=o._isKeyDownForAction(o.SPEED_DOWN,u);(x||w)&&(c&&(a._movespeed<a._movespeedList.length-1&&(a._movespeed+=1),a._cameraControl.fire("personModeSpeedUp",a._movespeedList[a._movespeed]),c=!1),h&&(a._movespeed>0&&(a._movespeed-=1),a._cameraControl.fire("personModeSpeedDown",a._movespeedList[a._movespeed]),h=!1));var P=o._isKeyDownForAction(o.PAN_FORWARDS,u),C=o._isKeyDownForAction(o.PAN_BACKWARDS,u),M=o._isKeyDownForAction(o.PAN_LEFT,u),k=o._isKeyDownForAction(o.PAN_RIGHT,u),F=o._isKeyDownForAction(o.PAN_UP,u),E=o._isKeyDownForAction(o.PAN_DOWN,u),D=a._movespeedList[a._movespeed]*A*s.keyboardPanRate;(P||C||M||k||F||E)&&(!s.firstPerson&&s.followPointer&&i.pivotController.startPivot(),E?n.panDeltaY+=D:F&&(n.panDeltaY+=-D),k?n.panDeltaX+=-D:M&&(n.panDeltaX+=D),C?n.panDeltaZ+=D:P&&(n.panDeltaZ+=-D))}}))}),[{key:"movespeed",get:function(){return this._movespeed},set:function(e){this._movespeed=e}},{key:"moveRate",get:function(){return this._movespeedList[this._movespeed]}},{key:"speedUp",value:function(){this._movespeed<this._movespeedList.length-1&&(this._movespeed+=1),this._cameraControl.fire("personModeSpeedUp",this._movespeedList[this._movespeed])}},{key:"speedDown",value:function(){this._movespeed>0&&(this._movespeed-=1),this._cameraControl.fire("personModeSpeedDown",this._movespeedList[this._movespeed])}},{key:"reset",value:function(){}},{key:"destroy",value:function(){this._scene.off(this._onTick),this.input.off(this._onSceneMouseMove),this.input.off(this._onSceneKeyDown),this.input.off(this._onSceneKeyUp)}}])}(),Yd=.001,Jd=J.vec3(),Zd=function(){return w((function e(t,i,s,r,n){B(this,e),this._scene=t;var o=t.viewer,a=t.camera,l=i.pickController,u=i.pivotController,A=i.panController,c=1,h=1,d=1,p=null,f=1;this._scene.on("aabb",(function(e){var t=e[3]-e[0],i=e[4]-e[1],s=e[5]-e[2],r=Math.min(t,i,s),n=Math.max(t,i,s);n>500&&(d=parseInt((n+r)/2*10/500)),0==r?(f=.01,d=.01):r<10&&(f=.001*parseInt(.1/r),d=.01*parseInt(.1/r))})),this._onTick=t.on("tick",(function(){if(s.active&&s.pointerEnabled){var e="default";if(Math.abs(n.dollyDelta)<Yd*f&&(n.dollyDelta=0),Math.abs(n.rotateDeltaX)<Yd*f&&(n.rotateDeltaX=0),Math.abs(n.rotateDeltaY)<Yd*f&&(n.rotateDeltaY=0),0===n.rotateDeltaX&&0===n.rotateDeltaY||(n.dollyDelta=0),s.followPointer){if(--c<=0&&(c=1,0!==n.dollyDelta)){if(0===n.rotateDeltaY&&0===n.rotateDeltaX&&s.followPointer&&r.followPointerDirty&&(l.pickCursorPos=r.pointerCanvasPos,l.schedulePickSurface=!0,l.update(),l.pickResult&&l.pickResult.worldPos?p=l.pickResult.worldPos:(h=d,p=null),r.followPointerDirty=!1),p){var i=Math.abs(J.lenVec3(J.subVec3(p,t.camera.eye,Jd)));h=i/s.dollyProximityThreshold}h<s.dollyMinSpeed&&(h=s.dollyMinSpeed)}}else h=d,p=null;var v=n.dollyDelta*h;if(0===n.rotateDeltaY&&0===n.rotateDeltaX||(!s.firstPerson&&s.followPointer&&u.getPivoting()?a.yUp?u.continuePivot(n.rotateDeltaY*a.up[1],n.rotateDeltaX*a.up[1]):u.continuePivot(n.rotateDeltaY,n.rotateDeltaX):(0!==n.rotateDeltaX&&(s.firstPerson?a.pitch(-n.rotateDeltaX):a.orbitPitch(n.rotateDeltaX)),0!==n.rotateDeltaY&&(s.firstPerson?a.yaw(n.rotateDeltaY):a.orbitYaw(n.rotateDeltaY))),n.rotateDeltaX*=s.rotationInertia,n.rotateDeltaY*=s.rotationInertia,e="grabbing"),Math.abs(n.panDeltaX)<Yd*f&&(n.panDeltaX=0),Math.abs(n.panDeltaY)<Yd*f&&(n.panDeltaY=0),Math.abs(n.panDeltaZ)<Yd*f&&(n.panDeltaZ=0),0!==n.panDeltaX||0!==n.panDeltaY||0!==n.panDeltaZ){var g,m,_=J.vec3();if(_[0]=n.panDeltaX,_[1]=n.panDeltaY,_[2]=n.panDeltaZ,s.constrainVertical){a.xUp?(g=a.eye[0],m=a.look[0]):a.yUp?(g=a.eye[1],m=a.look[1]):a.zUp&&(g=a.eye[2],m=a.look[2]),a.pan(_);var y=a.eye,b=a.look;a.xUp?(y[0]=g,b[0]=m):a.yUp?(y[1]=g,b[1]=m):a.zUp&&(y[2]=g,b[2]=m),a.eye=y,a.look=b}else a.pan(_);e="grabbing"}if(n.panDeltaX*=s.panInertia,n.panDeltaY*=s.panInertia,n.panDeltaZ*=s.panInertia,0!==v){if(e=v<0?"zoom-in":"zoom-out",s.firstPerson){var B,x;if(s.constrainVertical&&(a.xUp?(B=a.eye[0],x=a.look[0]):a.yUp?(B=a.eye[1],x=a.look[1]):a.zUp&&(B=a.eye[2],x=a.look[2])),s.followPointer)A.dollyToCanvasPos(p,r.pointerCanvasPos,-v)&&(r.followPointerDirty=!0);else a.pan([0,0,v]),a.ortho.scale=a.ortho.scale-v;if(s.constrainVertical){var w=a.eye,P=a.look;a.xUp?(w[0]=B,P[0]=x):a.yUp?(w[1]=B,P[1]=x):a.zUp&&(w[2]=B,P[2]=x),a.eye=w,a.look=P}}else if(s.planView){if(s.followPointer)A.dollyToCanvasPos(p,r.pointerCanvasPos,-v)&&(r.followPointerDirty=!0);else a.ortho.scale=a.ortho.scale+v,a.zoom(v)}else{if(s.followPointer)A.dollyToCanvasPos(p,r.pointerCanvasPos,-v)&&(r.followPointerDirty=!0);else a.ortho.scale=a.ortho.scale+v,a.zoom(v)}n.dollyDelta*=s.dollyInertia}l.fireEvents(),o.navCube.MOUSEDOWN||o.navCube.MOUSEOVER||(document.body.style.cursor=e)}}))}),[{key:"destroy",value:function(){this._scene.off(this._onTick)}}])}(),qd=function(){return w((function e(t,i,s,r,n){var o=this;B(this,e),this._scene=t,this.canvas=this._scene.canvas.canvas,this.canvas.addEventListener("mouseenter",this._mouseEnterHandler=function(){r.mouseover=!0}),this.canvas.addEventListener("mouseleave",this._mouseLeaveHandler=function(){r.mouseover=!1,o.canvas.style.cursor=null}),document.addEventListener("mousemove",this._mouseMoveHandler=function(e){$d(e,o.canvas,r.pointerCanvasPos)}),this.canvas.addEventListener("mousedown",this._mouseDownHandler=function(e){s.active&&s.pointerEnabled&&($d(e,o.canvas,r.pointerCanvasPos),r.mouseover=!0)}),this.canvas.addEventListener("mouseup",this._mouseUpHandler=function(e){s.active&&s.pointerEnabled})}),[{key:"reset",value:function(){}},{key:"destroy",value:function(){null!=this.canvas&&(this.canvas.removeEventListener("mouseenter",this._mouseEnterHandler),this.canvas.removeEventListener("mouseleave",this._mouseLeaveHandler),this.canvas.removeEventListener("mousedown",this._mouseDownHandler),this.canvas.removeEventListener("mouseup",this._mouseUpHandler)),document.removeEventListener("mousemove",this._mouseMoveHandler)}}])}();function $d(e,t,i){if(e){var s=t.getBoundingClientRect(),r=s.x,n=s.y;i[0]=e.clientX-r,i[1]=e.clientY-n}else e=window.event,i[0]=e.x,i[1]=e.y;return i}var ep=function(e,t){if(e){for(var i=e.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;t[0]=e.pageX-s,t[1]=e.pageY-r}else e=window.event,t[0]=e.x,t[1]=e.y;return t},tp=function(){return w((function e(t,i,s,r,n,o){var a=this;B(this,e),this._scene=t,this._cameraControl=o;var l=i.pickController,u=i.pivotController,A=J.vec2(),c=J.vec2(),h=J.vec2(),d=J.vec2();this._dollyspeed=1,this._panspeed=1;var p=[];this.canvas=this._scene.canvas.canvas;var f=0,v=!1;this._onTick=t.on("tick",(function(){v=!1})),this.canvas.addEventListener("touchstart",this._canvasTouchStartHandler=function(e){if(s.active&&s.pointerEnabled&&e.isTrusted){e.preventDefault();var i=e.touches,n=e.changedTouches;for(r.touchStartTime=Date.now(),1===i.length&&1===n.length&&(r.touchStartTime,ep(i[0],A),s.followPointer&&(l.pickCursorPos=A,l.schedulePickSurface=!0,l.update(),u.setPivotPos(t.camera.look),s.planView||(l.picked&&l.pickedSurface&&l.pickResult&&l.pickResult.worldPos?(u.setPivotPos(t.camera.look),!s.firstPerson&&u.startPivot()):(s.smartPivot,u.setPivotPos(t.camera.look),!s.firstPerson&&u.startPivot()))));p.length<i.length;)p.push(J.vec2());for(var o=0,a=i.length;o<a;++o)ep(i[o],p[o]);f=i.length}}),this.canvas.addEventListener("touchend",this._canvasTouchEndHandler=function(){u.getPivoting()&&(u.endPivot(),u.hidePivot())}),this.canvas.addEventListener("touchcancel",this._canvasTouchEndHandler),this.canvas.addEventListener("touchmove",this._canvasTouchMoveHandler=function(e){if(s.active&&s.pointerEnabled&&(e.stopPropagation(),e.preventDefault(),!v)){v=!0;var i=t.canvas.boundary,o=i[2],A=i[3],g=e.touches;if(e.touches.length===f){if(1===f){ep(g[0],c),J.subVec2(c,p[0],d);var m=d[0],_=d[1];if(null!==r.longTouchTimeout&&(Math.abs(m)>s.longTapRadius||Math.abs(_)>s.longTapRadius)&&(clearTimeout(r.longTouchTimeout),r.longTouchTimeout=null),s.planView){var y=t.camera;if("perspective"===y.projection){var b=Math.abs(t.camera.eyeLookDist)*Math.tan(y.perspective.fov/2*Math.PI/180);n.panDeltaX+=m*b/A*s.touchPanRate*a._panspeed,n.panDeltaY+=_*b/A*s.touchPanRate*a._panspeed}else n.panDeltaX+=.5*y.ortho.scale*(m/A)*s.touchPanRate*a._panspeed,n.panDeltaY+=.5*y.ortho.scale*(_/A)*s.touchPanRate*a._panspeed}else n.rotateDeltaY-=m/o*(1*s.dragRotationRate),n.rotateDeltaX+=_/A*(1.5*s.dragRotationRate)}else if(2===f){u.hidePivot();var B=g[0],x=g[1];ep(B,c),ep(x,h);var w=J.geometricMeanVec2(p[0],p[1]),P=J.geometricMeanVec2(c,h),C=J.vec2();J.subVec2(w,P,C);var M=C[0],k=C[1],F=t.camera,E=J.distVec2([B.pageX,B.pageY],[x.pageX,x.pageY]),D=(J.distVec2(p[0],p[1])-E)*s.touchDollyRate*a._dollyspeed;if(n.dollyDelta=D,Math.abs(D)<1)if("perspective"===F.projection){var I=l.pickResult?l.pickResult.worldPos:t.center,S=Math.abs(J.lenVec3(J.subVec3(I,t.camera.eye,[])))*Math.tan(F.perspective.fov/2*Math.PI/180);n.panDeltaX-=M*S/A*s.touchPanRate*a._panspeed,n.panDeltaY-=k*S/A*s.touchPanRate*a._panspeed}else n.panDeltaX-=.5*F.ortho.scale*(M/A)*s.touchPanRate*a._panspeed,n.panDeltaY-=.5*F.ortho.scale*(k/A)*s.touchPanRate*a._panspeed;r.pointerCanvasPos=P}for(var T=0;T<f;++T)ep(g[T],p[T])}}})}),[{key:"dollyspeed",get:function(){return this._dollyspeed},set:function(e){e<=0||(this._dollyspeed=+e.toFixed(1),this._cameraControl.fire("touchDollySpeed",this._dollyspeed))}},{key:"panspeed",get:function(){return this._panspeed},set:function(e){e<=0||(this._panspeed=+e.toFixed(1),this._cameraControl.fire("touchPanSpeed",this._panspeed))}},{key:"reset",value:function(){}},{key:"destroy",value:function(){null!=this.canvas&&(this.canvas.removeEventListener("touchstart",this._canvasTouchStartHandler),this.canvas.removeEventListener("touchend",this._canvasTouchEndHandler),this.canvas.removeEventListener("touchcancel",this._canvasTouchEndHandler),this.canvas.removeEventListener("touchmove",this._canvasTouchMoveHandler)),this._scene.off(this._onTick)}}])}(),ip=function(e,t){if(e){for(var i=e.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;t[0]=e.pageX-s,t[1]=e.pageY-r}else e=window.event,t[0]=e.x,t[1]=e.y;return t},sp=function(){return w((function e(t,i,s,r,n){B(this,e),this._scene=t;var o,a=i.pickController,l=i.cameraControl,u=[],A=new Float32Array(2),c=-1,h=-1;this.canvas=this._scene.canvas.canvas;var d=function(e){var s;e&&e.worldPos&&(s=e.worldPos);var r=e?e.entity.aabb:t.aabb;if(s){var n=t.camera;J.subVec3(n.eye,n.look,[]),i.cameraFlight.flyTo({aabb:r})}else i.cameraFlight.flyTo({aabb:r})};this.canvas.addEventListener("touchstart",this._canvasTouchStartHandler=function(e){if(s.active&&s.pointerEnabled&&e.isTrusted){null!==r.longTouchTimeout&&(clearTimeout(r.longTouchTimeout),r.longTouchTimeout=null);var t=e.touches,n=e.changedTouches;if(o=Date.now(),1===t.length&&1===n.length){c=o;var h=A[0],d=A[1],p=t[0].pageX,f=t[0].pageY;r.longTouchTimeout=setTimeout((function(){i.cameraControl.fire("rightClick",{pagePos:[Math.round(p),Math.round(f)],canvasPos:[Math.round(h),Math.round(d)],event:e},!0),r.longTouchTimeout=null}),s.longTapTimeout);var v=l.hasSubs("pickedSurface");ip(t[0],a.pickCursorPos),a.schedulePickEntity=!0,a.schedulePickSurface=v,a.update(),a.pickResult?(l.fire("touchEntity",a.pickResult),a.pickedSurface&&l.fire("touchSurface",a.pickResult)):l.fire("touchNothing")}else c=-1;for(;u.length<t.length;)u.push(new Float32Array(2));for(var g=0,m=t.length;g<m;++g)ip(t[g],u[g]);u.length=t.length}},{passive:!0}),this.canvas.addEventListener("touchend",this._canvasTouchEndHandler=function(e){if(s.active&&s.pointerEnabled){var t=Date.now(),i=e.touches,n=e.changedTouches,o=l.hasSubs("pickedSurface");null!==r.longTouchTimeout&&(clearTimeout(r.longTouchTimeout),r.longTouchTimeout=null),0===i.length&&1===n.length&&c>-1&&t-c<150&&(h>-1&&c-h<325?(ip(n[0],a.pickCursorPos),a.schedulePickEntity=!0,a.schedulePickSurface=o,a.update(),a.pickResult?(a.pickResult.touchInput=!0,l.fire("touchDoublePicked",a.pickResult),a.pickedSurface&&l.fire("touchDoublePickedSurface",a.pickResult),s.doublePickFlyTo&&d(a.pickResult)):(l.fire("doublePickedNothing"),l.fire("touchDoublePickedNothing"),s.doublePickFlyTo&&d()),h=-1):J.distVec2(u[0],A)<1e3&&(ip(n[0],a.pickCursorPos),a.schedulePickEntity=!0,a.schedulePickSurface=o,a.update(),a.pickResult?(a.pickResult.touchInput=!0,l.fire("touchPicked",a.pickResult),a.pickedSurface&&l.fire("touchPickedSurface",a.pickResult)):l.fire("touchPickedNothing"),h=t),c=-1),u.length=i.length;for(var p=0,f=i.length;p<f;++p)u[p][0]=i[p].pageX,u[p][1]=i[p].pageY;e.stopPropagation()}},{passive:!0}),this.canvas.addEventListener("touchcancel",this._canvasTouchEndHandler)}),[{key:"reset",value:function(){}},{key:"destroy",value:function(){null!=this.canvas&&(this.canvas.removeEventListener("touchstart",this._canvasTouchStartHandler),this.canvas.removeEventListener("touchend",this._canvasTouchEndHandler),this.canvas.removeEventListener("touchcancel",this._canvasTouchEndHandler))}}])}(),rp=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};B(this,t),(i=h(this,t,[e,s])).PAN_LEFT=0,i.PAN_RIGHT=1,i.PAN_UP=2,i.PAN_DOWN=3,i.PAN_FORWARDS=4,i.PAN_BACKWARDS=5,i.ROTATE_X_POS=6,i.ROTATE_X_NEG=7,i.ROTATE_Y_POS=8,i.ROTATE_Y_NEG=9,i.DOLLY_FORWARDS=10,i.DOLLY_BACKWARDS=11,i.AXIS_VIEW_RIGHT=12,i.AXIS_VIEW_BACK=13,i.AXIS_VIEW_LEFT=14,i.AXIS_VIEW_FRONT=15,i.AXIS_VIEW_TOP=16,i.AXIS_VIEW_BOTTOM=17,i.SPEED_UP=107,i.SPEED_DOWN=109,i._keyMap={},i.scene.canvas.canvas.oncontextmenu=function(e){e.preventDefault()},i.scene.on("aabb",(function(e){var t=e[3]-e[0],s=e[4]-e[1],r=e[5]-e[2],n=Math.max(t,s,r),o=Math.min(t,s,r);if(n>100&&o>20){var a=parseInt((n+o)/2);i.mouseWheelDollyRate=a/n*100}if(n>50&&n<100){var l=2*parseInt(n/20);i.keyboardDollyRate=15*l,i.keyboardPanRate=1.5*l}if(n>100&&n<600){var u=4*parseInt(n/50);i.keyboardDollyRate=15*u,i.keyboardPanRate=1.5*u}if(n>600){var A=8*parseInt(n/100);i.keyboardDollyRate=15*A,i.keyboardPanRate=1.5*A}if(0==o){var c=parseInt((n+1e-4)/2*1e5)/1e5;return i.mouseWheelDollyRate=100*c,i.keyboardDollyRate=10*c,void(i.keyboardPanRate=1*c)}if((o+n)/2<10){var h=parseInt((n+o)/2*1e4)/1e4/4;i.mouseWheelDollyRate=100*h,i.keyboardDollyRate=10*h,i.keyboardPanRate=1*h}if((o+n)/2<.1){var d=parseInt((n+o)/2*1e4)/1e4;i.mouseWheelDollyRate=100*d,i.keyboardDollyRate=10*d,i.keyboardPanRate=1*d}})),i._configs={longTapTimeout:600,longTapRadius:5,active:!0,keyboardLayout:"qwerty",navMode:"orbit",planView:!1,firstPerson:!1,followPointer:!0,doublePickFlyTo:!1,panRightClick:!0,showPivot:!1,pointerEnabled:!0,constrainVertical:!1,smartPivot:!1,doubleClickTimeFrame:250,zoomOnMouseWheel:!0,snapToVertex:true,snapToEdge:true,snapRadius:s.snapRadius?s.snapRadius:20,dragRotationRate:360,keyboardRotationRate:90,rotationInertia:0,keyboardPanRate:1,touchPanRate:1,panInertia:.5,keyboardDollyRate:10,mouseWheelDollyRate:100,touchDollyRate:.2,dollyInertia:0,dollyProximityThreshold:30,dollyMinSpeed:.04},i._states={pointerCanvasPos:J.vec2(),mouseover:!1,followPointerDirty:!0,mouseDownClientX:0,mouseDownClientY:0,mouseDownCursorX:0,mouseDownCursorY:0,touchStartTime:null,touchEndTime:null,activeTouches:[],tapStartPos:J.vec2(),tapStartTime:-1,lastTapTime:-1,longTouchTimeout:null},i._updates={rotateDeltaX:0,rotateDeltaY:0,panDeltaX:0,panDeltaY:0,panDeltaZ:0,dollyDelta:0};var r=i.scene;return i._controllers={cameraControl:i,pickController:new Ud(i,i._configs),pivotController:new Rd(r,i._configs),panController:new Fd(r),cameraFlight:new Yh(i,{duration:.5})},i._handlers=[new qd(i.scene,i._controllers,i._configs,i._states,i._updates),new tp(i.scene,i._controllers,i._configs,i._states,i._updates,i),new Qd(i.scene,i._controllers,i._configs,i._states,i._updates),new Wd(i.scene,i._controllers,i._configs,i._states,i._updates),new Kd(i.scene,i._controllers,i._configs,i._states,i._updates),new sp(i.scene,i._controllers,i._configs,i._states,i._updates),new Xd(i.scene,i._controllers,i._configs,i._states,i._updates,i)],i._cameraUpdater=new Zd(i.scene,i._controllers,i._configs,i._states,i._updates),i.navMode=s.navMode,s.planView&&(i.planView=s.planView),i.constrainVertical=s.constrainVertical,s.keyboardLayout?i.keyboardLayout=s.keyboardLayout:i.keyMap=s.keyMap,i.doublePickFlyTo=s.doublePickFlyTo,i.panRightClick=s.panRightClick,i.active=s.active,i.followPointer=s.followPointer,i.rotationInertia=s.rotationInertia,i.keyboardPanRate=s.keyboardPanRate,i.touchPanRate=s.touchPanRate,i.keyboardRotationRate=s.keyboardRotationRate,i.dragRotationRate=s.dragRotationRate,i.touchDollyRate=s.touchDollyRate,i.dollyInertia=s.dollyInertia,i.dollyProximityThreshold=s.dollyProximityThreshold,i.dollyMinSpeed=s.dollyMinSpeed,i.panInertia=s.panInertia,i.pointerEnabled=!0,i.keyboardDollyRate=s.keyboardDollyRate,i.mouseWheelDollyRate=s.mouseWheelDollyRate,i._moveRate=1,i.scene.on("tick",(function(){(i._goLeft||i._goRight||i._goUp||i._goDown||i._goForward||i._goBackward)&&(i._goRight?i._updates.panDeltaX+=-.1*i._moveRate:i._goLeft&&(i._updates.panDeltaX+=.1*i._moveRate),i._goUp?i._updates.panDeltaY+=.1*i._moveRate:i._goDown&&(i._updates.panDeltaY+=-.1*i._moveRate),i._goForward?i._updates.panDeltaZ+=-.1*i._moveRate:i._goBackward&&(i._updates.panDeltaZ+=.1*i._moveRate))})),i}return m(t,_e),w(t,[{key:"setdirectionChangeCancel",value:function(){this._goLeft=!1,this._goRight=!1,this._goUp=!1,this._goDown=!1,this._goForward=!1,this._goBackward=!1}},{key:"customTouchDollyRate",get:function(){return this._handlers[1].dollyspeed},set:function(e){this._handlers[1].dollyspeed=e}},{key:"customTouchPanRate",get:function(){return this._handlers[1].panspeed},set:function(e){this._handlers[1].panspeed=e}},{key:"moveRate",get:function(){return this._moveRate},set:function(e){this._moveRate=e,this._handlers[6].movespeed=e}},{key:"speedUp",value:function(){this._handlers[6].speedUp(),this._moveRate=this._handlers[6].moveRate}},{key:"speedDown",value:function(){this._handlers[6].speedDown(),this._moveRate=this._handlers[6].moveRate}},{key:"goRight",set:function(e){this._goRight=e}},{key:"goLeft",set:function(e){this._goLeft=e}},{key:"goUp",set:function(e){this._goUp=e}},{key:"goDown",set:function(e){this._goDown=e}},{key:"goForward",set:function(e){this._goForward=e}},{key:"goBackward",set:function(e){this._goBackward=e}},{key:"updatePivotElement",value:function(){this._controllers.pivotController.updatePivotElement()}},{key:"keyMap",get:function(){return this._keyMap},set:function(e){if(e=e||"qwerty",oe.isString(e)){var t=this.scene.input,i={};switch(e){default:this.error("Unsupported value for 'keyMap': "+e+" defaulting to 'qwerty'");case"qwerty":i[this.PAN_UP]=[t.KEY_E],i[this.PAN_DOWN]=[t.KEY_Q],i[this.PAN_LEFT]=[t.KEY_A,t.KEY_LEFT_ARROW],i[this.PAN_RIGHT]=[t.KEY_D,t.KEY_RIGHT_ARROW],i[this.PAN_FORWARDS]=[t.KEY_W,t.KEY_UP_ARROW],i[this.PAN_BACKWARDS]=[t.KEY_S,t.KEY_DOWN_ARROW],i[this.DOLLY_FORWARDS]=[t.KEY_J],i[this.DOLLY_BACKWARDS]=[t.KEY_K],i[this.AXIS_VIEW_RIGHT]=[t.KEY_NUM_1],i[this.AXIS_VIEW_BACK]=[t.KEY_NUM_2],i[this.AXIS_VIEW_LEFT]=[t.KEY_NUM_3],i[this.AXIS_VIEW_FRONT]=[t.KEY_NUM_4],i[this.AXIS_VIEW_TOP]=[t.KEY_NUM_5],i[this.AXIS_VIEW_BOTTOM]=[t.KEY_NUM_6],i[this.SPEED_UP]=[t.KEY_EQUAL_SIGN],i[this.SPEED_DOWN]=[t.KEY_DASH];break;case"azerty":i[this.PAN_LEFT]=[t.KEY_Q],i[this.PAN_RIGHT]=[t.KEY_D],i[this.PAN_UP]=[t.KEY_W],i[this.PAN_DOWN]=[t.KEY_X],i[this.PAN_BACKWARDS]=[t.KEY_J],i[this.PAN_FORWARDS]=[t.KEY_K],i[this.DOLLY_FORWARDS]=[t.KEY_Z],i[this.DOLLY_BACKWARDS]=[t.KEY_S],i[this.ROTATE_X_POS]=[t.KEY_DOWN_ARROW],i[this.ROTATE_X_NEG]=[t.KEY_UP_ARROW],i[this.ROTATE_Y_POS]=[t.KEY_A,t.KEY_LEFT_ARROW],i[this.ROTATE_Y_NEG]=[t.KEY_E,t.KEY_RIGHT_ARROW],i[this.AXIS_VIEW_RIGHT]=[t.KEY_NUM_1],i[this.AXIS_VIEW_BACK]=[t.KEY_NUM_2],i[this.AXIS_VIEW_LEFT]=[t.KEY_NUM_3],i[this.AXIS_VIEW_FRONT]=[t.KEY_NUM_4],i[this.AXIS_VIEW_TOP]=[t.KEY_NUM_5],i[this.AXIS_VIEW_BOTTOM]=[t.KEY_NUM_6],i[this.SPEED_UP]=[t.KEY_EQUAL_SIGN],i[this.SPEED_DOWN]=[t.KEY_DASH]}this._keyMap=i}else{var s=e;this._keyMap=s}}},{key:"_isKeyDownForAction",value:function(e,t){var i=this._keyMap[e];if(!i)return!1;t||(t=this.scene.input.keyDown);for(var s=0,r=i.length;s<r;s++){if(t[i[s]])return!0}return!1}},{key:"pivotElement",set:function(e){this._controllers.pivotController.setPivotElement(e)}},{key:"active",get:function(){return this._configs.active},set:function(e){e=!1!==e,this._configs.active=e,this._handlers[1]._active=e,this._handlers[5]._active=e}},{key:"snapToVertex",get:function(){return this._configs.snapToVertex},set:function(e){this._configs.snapToVertex=!!e}},{key:"snapToEdge",get:function(){return this._configs.snapToEdge},set:function(e){this._configs.snapToEdge=!!e}},{key:"snapRadius",get:function(){return this._configs.snapRadius},set:function(e){e=e||20,this._configs.snapRadius=e}},{key:"navMode",get:function(){return this._configs.navMode},set:function(e){"firstPerson"!==(e=e||"orbit")&&"orbit"!==e&&"planView"!==e&&(this.error("Unsupported value for navMode: "+e+" - supported values are 'orbit', 'firstPerson' and 'planView' - defaulting to 'orbit'"),e="orbit"),this._configs.firstPerson="firstPerson"===e,this._configs.planView="planView"===e,(this._configs.firstPerson||this._configs.planView)&&(this._controllers.pivotController.hidePivot(),this._controllers.pivotController.endPivot()),this._configs.navMode=e}},{key:"pointerEnabled",get:function(){return this._configs.pointerEnabled},set:function(e){this._reset(),this._configs.pointerEnabled=!!e}},{key:"_reset",value:function(){for(var e=0,t=this._handlers.length;e<t;e++){var i=this._handlers[e];i.reset&&i.reset()}this._updates.panDeltaX=0,this._updates.panDeltaY=0,this._updates.rotateDeltaX=0,this._updates.rotateDeltaY=0,this._updates.dolyDelta=0}},{key:"followPointer",get:function(){return this._configs.followPointer},set:function(e){this._configs.followPointer=!1!==e}},{key:"pivotPos",get:function(){return this._controllers.pivotController.getPivotPos()},set:function(e){this._controllers.pivotController.setPivotPos(e)}},{key:"dollyToPointer",get:function(){return this.warn("dollyToPointer property is deprecated - replaced with followPointer"),this.followPointer},set:function(e){this.warn("dollyToPointer property is deprecated - replaced with followPointer"),this.followPointer=e}},{key:"panToPointer",get:function(){return this.warn("panToPointer property is deprecated - replaced with followPointer"),!1},set:function(e){this.warn("panToPointer property is deprecated - replaced with followPointer")}},{key:"planView",get:function(){return this._configs.planView},set:function(e){this._configs.planView=!!e,this._configs.firstPerson=!1,this._configs.planView&&(this._controllers.pivotController.hidePivot(),this._controllers.pivotController.endPivot()),this.warn("planView property is deprecated - replaced with navMode")}},{key:"firstPerson",get:function(){return this.warn("firstPerson property is deprecated - replaced with navMode"),this._configs.firstPerson},set:function(e){this.warn("firstPerson property is deprecated - replaced with navMode"),this._configs.firstPerson=!!e,this._configs.planView=!1,this._configs.firstPerson&&(this._controllers.pivotController.hidePivot(),this._controllers.pivotController.endPivot())}},{key:"constrainVertical",get:function(){return this._configs.constrainVertical},set:function(e){this._configs.constrainVertical=!!e}},{key:"doublePickFlyTo",get:function(){return this._configs.doublePickFlyTo},set:function(e){this._configs.doublePickFlyTo=!1!==e}},{key:"panRightClick",get:function(){return this._configs.panRightClick},set:function(e){this._configs.panRightClick=!1!==e}},{key:"rotationInertia",get:function(){return this._configs.rotationInertia},set:function(e){this._configs.rotationInertia=null!=e?e:0}},{key:"keyboardPanRate",get:function(){return this._configs.keyboardPanRate},set:function(e){this._configs.keyboardPanRate=null!=e?e:5}},{key:"touchPanRate",get:function(){return this._configs.touchPanRate},set:function(e){this._configs.touchPanRate=null!=e?e:1}},{key:"keyboardRotationRate",get:function(){return this._configs.keyboardRotationRate},set:function(e){this._configs.keyboardRotationRate=null!=e?e:90}},{key:"dragRotationRate",get:function(){return this._configs.dragRotationRate},set:function(e){this._configs.dragRotationRate=null!=e?e:360}},{key:"keyboardDollyRate",get:function(){return this._configs.keyboardDollyRate},set:function(e){this._configs.keyboardDollyRate=null!=e?e:15}},{key:"touchDollyRate",get:function(){return this._configs.touchDollyRate},set:function(e){this._configs.touchDollyRate=null!=e?e:.2}},{key:"mouseWheelDollyRate",get:function(){return this._configs.mouseWheelDollyRate},set:function(e){this._configs.mouseWheelDollyRate=null!=e?e:100}},{key:"dollyInertia",get:function(){return this._configs.dollyInertia},set:function(e){this._configs.dollyInertia=null!=e?e:0}},{key:"dollyProximityThreshold",get:function(){return this._configs.dollyProximityThreshold},set:function(e){this._configs.dollyProximityThreshold=null!=e?e:35}},{key:"dollyMinSpeed",get:function(){return this._configs.dollyMinSpeed},set:function(e){this._configs.dollyMinSpeed=null!=e?e:.04}},{key:"panInertia",get:function(){return this._configs.panInertia},set:function(e){this._configs.panInertia=null!=e?e:.5}},{key:"keyboardLayout",get:function(){return this._configs.keyboardLayout},set:function(e){"qwerty"!==(e=e||"qwerty")&&"azerty"!==e&&(this.error("Unsupported value for keyboardLayout - defaulting to 'qwerty'"),e="qwerty"),this._configs.keyboardLayout=e,this.keyMap=this._configs.keyboardLayout}},{key:"enablePivotSphere",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._controllers.pivotController.enablePivotSphere(e)}},{key:"disablePivotSphere",value:function(){this._controllers.pivotController.disablePivotSphere()}},{key:"smartPivot",get:function(){return this._configs.smartPivot},set:function(e){this._configs.smartPivot=!1!==e}},{key:"doubleClickTimeFrame",get:function(){return this._configs.doubleClickTimeFrame},set:function(e){this._configs.doubleClickTimeFrame=null!=e?e:250}},{key:"zoomOnMouseWheel",get:function(){return this._configs.zoomOnMouseWheel},set:function(e){this._configs.zoomOnMouseWheel=!!e}},{key:"destroy",value:function(){this._destroyHandlers(),this._destroyControllers(),this._cameraUpdater.destroy(),f(t,"destroy",this,3)([])}},{key:"_destroyHandlers",value:function(){for(var e=0,t=this._handlers.length;e<t;e++){var i=this._handlers[e];i.destroy&&i.destroy()}}},{key:"_destroyControllers",value:function(){for(var e=0,t=this._controllers.length;e<t;e++){var i=this._controllers[e];i.destroy&&i.destroy()}}}])}(),np=w((function e(t){B(this,e),this.id=t.id,this.originalSystemId=t.originalSystemId,this.metaModels=[],this.name=t.name,this.type=t.type,this.properties=[],t.properties&&(this.properties=t.properties)})),op=function(){return w((function e(t){B(this,e),this.metaModels=[],this.id=t.id,this.parentId=t.parentId,this.parent=null,this.originalSystemId=t.originalSystemId,this.name=t.name,this.type=t.type,this.propertySetIds=t.propertySetIds,this.propertySets=[],void 0!==t.external&&null!==t.external&&(this.external=t.external)}),[{key:"metaModel",get:function(){return 1==this.metaModels.length?this.metaModels[0]:null}},{key:"getObjectIDsInSubtree",value:function(){var e=[];return function t(i){if(i){e.push(i.id);var s=i.children;if(s)for(var r=0,n=s.length;r<n;r++)t(s[r])}}(this),e}},{key:"withMetaObjectsInSubtree",value:function(e){!function t(i){if(i){e(i);var s=i.children;if(s)for(var r=0,n=s.length;r<n;r++)t(s[r])}}(this)}},{key:"getObjectIDsInSubtreeByType",value:function(e){for(var t={},i=0,s=e.length;i<s;i++)t[e[i]]=e[i];var r=[];return function e(i){if(i){t[i.type]&&r.push(i.id);var s=i.children;if(s)for(var n=0,o=s.length;n<o;n++)e(s[n])}}(this),r}},{key:"getJSON",value:function(){var e={id:this.id,type:this.type,name:this.name};return this.parent&&(e.parent=this.parent.id),e}}])}(),ap=function(){return w((function e(t){B(this,e),this.id=t.id,this.projectId=t.projectId,this.revisionId=t.revisionId,this.author=t.author,this.createdAt=t.createdAt,this.creatingApplication=t.creatingApplication,this.schema=t.schema,this.metaScene=t.metaScene,this.propertySets=[],this.rootMetaObjects=[],this.metaObjects=[],this.objectCount=0,this.propertySetCount=0,this.graph=t.graph||{},this.metaScene.metaModels[this.id]=this,this._finalized=!1}),[{key:"finalized",get:function(){return this._finalized},set:function(e){this._finalized=e}},{key:"rootMetaObject",get:function(){return 1==this.rootMetaObjects.length?this.rootMetaObjects[0]:null}},{key:"loadData",value:function(e,t,i){if(this._finalized)throw"MetaScene already finalized - can't add more data";try{var s,r,n,o,a,l,u,A;if(null===e)throw"metaModelData is null!";this.author=null!==(s=e.author)&&void 0!==s?s:"",this.schema=null!==(r=e.schema)&&void 0!==r?r:"",this.createdAt=null!==(n=e.createdAt)&&void 0!==n?n:"",this.projectId=null!==(o=e.projectId)&&void 0!==o?o:"",this.revisionId=null!==(a=e.revisionId)&&void 0!==a?a:"",this.objectCount=null!==(l=e.objectCount)&&void 0!==l?l:"",this.propertySetCount=null!==(u=e.propertySetCount)&&void 0!==u?u:"",this.creatingApplication=null!==(A=e.creatingApplication)&&void 0!==A?A:"";var c=this.metaScene;if(e.propertySets)for(var h in e.propertySets){var d=e.propertySets[h],p=new np({id:d.id,originalSystemId:d.originalSystemId||d.id,type:d.type,name:d.name,properties:d.properties});c.propertySets[h]=p,this.propertySets.push(p)}if(e.metaObjects)for(var f in e.metaObjects){var v=e.metaObjects[f],g=new op({id:f,originalSystemId:f,parentId:v.parent,type:v.type,name:v.name,propertySetIds:v.propertySetIds,external:v.external});g.children=[],g.metaModels=[],g.metaModels.push(this),c.metaObjects[f]=g,this.metaObjects.push(g),v.parent||(this.rootMetaObjects.push(g),c.rootMetaObjects[f]=g)}"function"==typeof t&&t()}catch(e){"function"==typeof i?i(e):this.log(i)}}},{key:"_decompressProperties",value:function(e,t){for(var i=0,s=t.length;i<s;i++){var r=t[i];if(Number.isInteger(r)){var n=e[r];n&&(t[i]=n)}}}},{key:"finalize",value:function(){if(this._finalized)throw"MetaScene already finalized - can't re-finalize";var e=this.metaScene;for(var t in e.metaObjectsByType={},e.metaObjects){var i=e.metaObjects[t];if(i.parentId){var s=e.metaObjects[i.parentId];s&&(i.parent=s,(s.children||(s.children=[])).push(i))}if(i.propertySets&&(i.propertySets=[]),i.propertySetIds)for(var r=0,n=i.propertySetIds.length;r<n;r++){var o=i.propertySetIds[r],a=e.propertySets[o];i.propertySets.push(a)}var l=i.type;(e.metaObjectsByType[l]||(e.metaObjectsByType[l]={}))[t]=i}this._finalized=!0,this.metaScene.fire("metaModelCreated",this.id)}},{key:"getJSON",value:function(){for(var e={id:this.id,projectId:this.projectId,author:this.author,createdAt:this.createdAt,schema:this.schema,creatingApplication:this.creatingApplication,metaObjects:[],propertySets:[]},t=0,i=this.metaObjects.length;t<i;t++){var s=this.metaObjects[t],r={id:s.id,originalSystemId:s.originalSystemId,extId:s.extId,type:s.type,name:s.name};s.parent&&(r.parent=s.parent.id),s.attributes&&(r.attributes=s.attributes),s.propertySetIds&&(r.propertySetIds=s.propertySetIds),e.metaObjects.push(r)}for(var n=0,o=this.propertySets.length;n<o;n++){for(var a=this.propertySets[n],l={id:a.id,originalSystemId:a.originalSystemId,extId:a.extId,type:a.type,name:a.name,propertyies:[]},u=0,A=a.properties.length;u<A;u++){var c=a.properties[u],h={id:c.id,description:c.description,type:c.type,name:c.name,value:c.value,valueType:c.valueType};l.properties.push(h)}e.propertySets.push(l)}return e}},{key:"_globalizeIDs",value:function(e,t){var i=!!t.globalizeObjectIds;if(e.metaObjects)for(var s=0,r=e.metaObjects.length;s<r;s++){var n=e.metaObjects[s];if(n.originalSystemId=n.id,n.parent&&(n.originalParentSystemId=n.parent),i&&(n.id=J.globalizeObjectId(this.id,n.id),n.parent&&(n.parent=J.globalizeObjectId(this.id,n.parent))),i){var o=n.propertySetIds;if(o){for(var a=[],l=0,u=o.length;l<u;l++)a.push(J.globalizeObjectId(this.id,o[l]));n.propertySetIds=a,n.originalSystemPropertySetIds=o}}else n.originalSystemPropertySetIds=n.propertySetIds}if(e.propertySets)for(var A=0,c=e.propertySets.length;A<c;A++){var h=e.propertySets[A];h.originalSystemId=h.id,i&&(h.id=J.globalizeObjectId(this.id,h.id))}}}])}(),lp=function(){return w((function e(t,i){B(this,e),this.viewer=t,this.scene=i,this.metaModels={},this.propertySets={},this.metaObjects={},this.metaObjectsByType={},this.rootMetaObjects={},this._eventSubs={}}),[{key:"on",value:function(e,t){var i=this._eventSubs[e];i||(i=[],this._eventSubs[e]=i),i.push(t)}},{key:"fire",value:function(e,t){var i=this._eventSubs[e];if(i)for(var s=0,r=i.length;s<r;s++)i[s](t)}},{key:"off",value:function(e){}},{key:"createMetaModel",value:function(e,t){var i=new ap({metaScene:this,id:e,projectId:t.projectId||"none",revisionId:t.revisionId||"none",author:t.author||"none",createdAt:t.createdAt||"none",creatingApplication:t.creatingApplication||"none",schema:t.schema||"none",propertySets:[]});return i.loadData(t),i.finalize(),i}},{key:"destroyMetaModel",value:function(e){var t=this.metaModels[e];if(t){if(t.propertySets)for(var i=0,s=t.propertySets.length;i<s;i++){var r=t.propertySets[i];if(1===r.metaModels.length&&r.metaModels[0].id===e)delete this.propertySets[r.id];else{for(var n=[],o=0,a=r.metaModels.length;o<a;o++)r.metaModels[o].id!==e&&n.push(r.metaModels[o]);r.metaModels=n}}if(t.metaObjects)for(var l=0,u=t.metaObjects.length;l<u;l++){var A=t.metaObjects[l];A.type;var c=A.id;1===A.metaModels.length&&A.metaModels[0].id===e&&(delete this.metaObjects[c],A.parent||delete this.rootMetaObjects[c])}for(var h in this.metaObjects){var d=this.metaObjects[h];if(d.children&&(d.children=[]),d.propertySets&&(d.propertySets=[]),d.propertySetIds)for(var p=0,f=d.propertySetIds.length;p<f;p++){var v=d.propertySetIds[p],g=this.propertySets[v];d.propertySets.push(g)}}for(var m in this.metaObjectsByType={},this.metaObjects){var _=this.metaObjects[m],y=_.type;_.children&&(_.children=null),(this.metaObjectsByType[y]||(this.metaObjectsByType[y]={}))[m]=_}for(var b in this.metaObjects){var B=this.metaObjects[b];if(B.parentId){var x=this.metaObjects[B.parentId];x&&(B.parent=x,(x.children||(x.children=[])).push(B))}}delete this.metaModels[e],this.fire("metaModelDestroyed",e)}}},{key:"getObjectIDsByType",value:function(e){var t=this.metaObjectsByType[e];return t?Object.keys(t):[]}},{key:"getObjectIDsByTypes",value:function(e){for(var t=[],i=0;i<e.length;i++){var s=e[i];t=t.concat(this.getObjectIDsByType(s))}return t}},{key:"getObjectIDsInSubtree",value:function(e,t,i){var s=[],r=this.metaObjects[e],n=t&&t.length>0?up(t):null,o=i&&i.length>0?up(i):null,a=function(e){if(e){var t=!0;(o&&o[e.type]||n&&!n[e.type])&&(t=!1),t&&s.push(e.id);var i=e.children;if(i)for(var r=0,l=i.length;r<l;r++)a(i[r])}};return a(r),s}},{key:"withMetaObjectsInSubtree",value:function(e,t){var i=this.metaObjects[e];i&&i.withMetaObjectsInSubtree(t)}}])}();function up(e){for(var t={},i=0,s=e.length;i<s;i++)t[e[i]]=!0;return t}
|
|
17
|
+
**/var Hc=8,jc=null;function Gc(e,t){var i,s,r,n,o,a,l=3*e,u=3*t,A=Math.min(i=jc[l],s=jc[l+1],r=jc[l+2]),c=Math.min(n=jc[u],o=jc[u+1],a=jc[u+2]);if(A!==c)return A-c;var h=Math.max(i,s,r),d=Math.max(n,o,a);return h!==d?h-d:0}var zc=null;function Wc(e,t){var i=zc[2*e]-zc[2*t];return 0!==i?i:zc[2*e+1]-zc[2*t+1]}function Kc(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=e.positionsCompressed||[],r=function(e,t){for(var i=new Int32Array(e.length/3),s=0,r=i.length;s<r;s++)i[s]=s;jc=new Int32Array(e.length);for(var n=0,o=e.length;n<o;n++)jc[n]=e[n]>>t;i.sort(Gc);for(var a=new Int32Array(e.length),l=0,u=i.length;l<u;l++)a[3*l+0]=e[3*i[l]+0],a[3*l+1]=e[3*i[l]+1],a[3*l+2]=e[3*i[l]+2];return a}(e.indices||[],t),n=function(e){if(0===(e||[]).length)return[];for(var t=new Int32Array(e.length/2),i=0,s=t.length;i<s;i++)t[i]=i;for(var r=0,n=e.length;r<n;r+=2)if(e[r]>e[r+1]){var o=e[r];e[r]=e[r+1],e[r+1]=o}zc=new Int32Array(e),t.sort(Wc);for(var a=new Int32Array(e.length),l=0,u=t.length;l<u;l++)a[2*l+0]=e[2*t[l]+0],a[2*l+1]=e[2*t[l]+1];return a}(e.edgeIndices||[]);function o(e,t){if(e>t){var i=e;e=t,t=i}function s(i,s){return i!==e?e-i:s!==t?t-s:0}for(var r=0,o=(n.length>>1)-1;r<=o;){var a=o+r>>1,l=s(n[2*a],n[2*a+1]);if(l>0)r=a+1;else{if(!(l<0))return a;o=a-1}}return-r-1}var a=new Int32Array(n.length/2);a.fill(0);var l=s.length/3;if(l>(1<<t)*Hc)return[e];var u=new Int32Array(l);u.fill(-1);var A=[];function c(){u.fill(-1);var e={positionsCompressed:[],indices:[],edgeIndices:[],maxNumPositions:(1<<t)-t,numPositions:0,bucketNumber:A.length};return A.push(e),e}for(var h=c(),d=0,p=r.length;d<p;d+=3){var f=0,v=r[d],g=r[d+1],m=r[d+2];if(-1===u[v]&&f++,-1===u[g]&&f++,-1===u[m]&&f++,f+h.numPositions>h.maxNumPositions&&(h=c()),h.bucketNumber>Hc)return[e];-1===u[v]&&(u[v]=h.numPositions++,h.positionsCompressed.push(s[3*v]),h.positionsCompressed.push(s[3*v+1]),h.positionsCompressed.push(s[3*v+2])),-1===u[g]&&(u[g]=h.numPositions++,h.positionsCompressed.push(s[3*g]),h.positionsCompressed.push(s[3*g+1]),h.positionsCompressed.push(s[3*g+2])),-1===u[m]&&(u[m]=h.numPositions++,h.positionsCompressed.push(s[3*m]),h.positionsCompressed.push(s[3*m+1]),h.positionsCompressed.push(s[3*m+2])),h.indices.push(u[v]),h.indices.push(u[g]),h.indices.push(u[m]);var _=void 0;(_=o(v,g))>=0&&0===a[_]&&(a[_]=1,h.edgeIndices.push(u[n[2*_]]),h.edgeIndices.push(u[n[2*_+1]])),(_=o(v,m))>=0&&0===a[_]&&(a[_]=1,h.edgeIndices.push(u[n[2*_]]),h.edgeIndices.push(u[n[2*_+1]])),(_=o(g,m))>=0&&0===a[_]&&(a[_]=1,h.edgeIndices.push(u[n[2*_]]),h.edgeIndices.push(u[n[2*_+1]]))}var y=t/8*2,b=t/8,B=2*s.length+(r.length+n.length)*y,x=0;s.length;return A.forEach((function(e){x+=2*e.positionsCompressed.length+(e.indices.length+e.edgeIndices.length)*b,e.positionsCompressed.length/3})),x>B?[e]:(i&&function(e,t){var i={};e.forEach((function(e){for(var t=e.indices,s=e.edgeIndices,r=e.positionsCompressed,n=0,o=t.length;n<o;n+=3){var a=r[3*t[n]]+"_"+r[3*t[n]+1]+"_"+r[3*t[n]+2]+"/"+r[3*t[n+1]]+"_"+r[3*t[n+1]+1]+"_"+r[3*t[n+1]+2]+"/"+r[3*t[n+2]]+"_"+r[3*t[n+2]+1]+"_"+r[3*t[n+2]+2];i[a]=!0}e.edgeIndices.length/2;for(var l=0,u=s.length;l<u;l+=2)r[3*s[l]],r[3*s[l]+1],r[3*s[l]+2],r[3*s[l+1]],r[3*s[l+1]+1],r[3*s[l+1]+2]}));var s=t.indices;t.edgeIndices;for(var r=t.positionsCompressed,n=0,o=s.length;n<o;n+=3){var a=r[3*s[n]]+"_"+r[3*s[n]+1]+"_"+r[3*s[n]+2]+"/"+r[3*s[n+1]]+"_"+r[3*s[n+1]+1]+"_"+r[3*s[n+1]+2]+"/"+r[3*s[n+2]]+"_"+r[3*s[n+2]+1]+"_"+r[3*s[n+2]+2];if(!(a in i))throw console.log("Not found "+a),"Ohhhh!"}}(A,e),A)}var Xc=J.vec4(4),Yc=J.vec4(),Jc=J.vec4(),Zc=J.vec3([1,0,0]),qc=J.vec3([0,1,0]),$c=J.vec3([0,0,1]);J.vec3(3),J.vec3(3);var eh=J.identityMat4(),th=function(){return w((function e(t){B(this,e),this._model=t.model,this.id=t.id,this._parentTransform=t.parent,this._childTransforms=[],this._meshes=[],this._scale=new Float32Array([1,1,1]),this._quaternion=J.identityQuaternion(new Float32Array(4)),this._rotation=new Float32Array(3),this._position=new Float32Array(3),this._localMatrix=J.identityMat4(new Float32Array(16)),this._worldMatrix=J.identityMat4(new Float32Array(16)),this._localMatrixDirty=!0,this._worldMatrixDirty=!0,t.matrix?this.matrix=t.matrix:(this.scale=t.scale,this.position=t.position,t.quaternion||(this.rotation=t.rotation)),t.parent&&t.parent._addChildTransform(this)}),[{key:"_addChildTransform",value:function(e){this._childTransforms.push(e),e._parentTransform=this,e._setWorldMatrixDirty(),e._setAABBDirty()}},{key:"_addMesh",value:function(e){this._meshes.push(e),e.transform=this}},{key:"parentTransform",get:function(){return this._parentTransform}},{key:"meshes",get:function(){return this._meshes}},{key:"position",get:function(){return this._position},set:function(e){this._position.set(e||[0,0,0]),this._setLocalMatrixDirty(),this._model.glRedraw()}},{key:"rotation",get:function(){return this._rotation},set:function(e){this._rotation.set(e||[0,0,0]),J.eulerToQuaternion(this._rotation,"XYZ",this._quaternion),this._setLocalMatrixDirty(),this._model.glRedraw()}},{key:"quaternion",get:function(){return this._quaternion},set:function(e){this._quaternion.set(e||[0,0,0,1]),J.quaternionToEuler(this._quaternion,"XYZ",this._rotation),this._setLocalMatrixDirty(),this._model.glRedraw()}},{key:"scale",get:function(){return this._scale},set:function(e){this._scale.set(e||[1,1,1]),this._setLocalMatrixDirty(),this._model.glRedraw()}},{key:"matrix",get:function(){return this._localMatrixDirty&&(this._localMatrix||(this._localMatrix=J.identityMat4()),J.composeMat4(this._position,this._quaternion,this._scale,this._localMatrix),this._localMatrixDirty=!1),this._localMatrix},set:function(e){this._localMatrix||(this._localMatrix=J.identityMat4()),this._localMatrix.set(e||eh),J.decomposeMat4(this._localMatrix,this._position,this._quaternion,this._scale),this._localMatrixDirty=!1,this._transformDirty(),this._model.glRedraw()}},{key:"worldMatrix",get:function(){return this._worldMatrixDirty&&this._buildWorldMatrix(),this._worldMatrix}},{key:"rotate",value:function(e,t){return Xc[0]=e[0],Xc[1]=e[1],Xc[2]=e[2],Xc[3]=t*J.DEGTORAD,J.angleAxisToQuaternion(Xc,Yc),J.mulQuaternions(this.quaternion,Yc,Jc),this.quaternion=Jc,this._setLocalMatrixDirty(),this._model.glRedraw(),this}},{key:"rotateOnWorldAxis",value:function(e,t){return Xc[0]=e[0],Xc[1]=e[1],Xc[2]=e[2],Xc[3]=t*J.DEGTORAD,J.angleAxisToQuaternion(Xc,Yc),J.mulQuaternions(Yc,this.quaternion,Yc),this}},{key:"rotateX",value:function(e){return this.rotate(Zc,e)}},{key:"rotateY",value:function(e){return this.rotate(qc,e)}},{key:"rotateZ",value:function(e){return this.rotate($c,e)}},{key:"translate",value:function(e){return this._position[0]+=e[0],this._position[1]+=e[1],this._position[2]+=e[2],this._setLocalMatrixDirty(),this._model.glRedraw(),this}},{key:"translateX",value:function(e){return this._position[0]+=e,this._setLocalMatrixDirty(),this._model.glRedraw(),this}},{key:"translateY",value:function(e){return this._position[1]+=e,this._setLocalMatrixDirty(),this._model.glRedraw(),this}},{key:"translateZ",value:function(e){return this._position[2]+=e,this._setLocalMatrixDirty(),this._model.glRedraw(),this}},{key:"_setLocalMatrixDirty",value:function(){this._localMatrixDirty=!0,this._transformDirty()}},{key:"_transformDirty",value:function(){this._worldMatrixDirty=!0;for(var e=0,t=this._childTransforms.length;e<t;e++){var i=this._childTransforms[e];if(i._transformDirty(),i._meshes&&i._meshes.length>0)for(var s=i._meshes,r=0,n=s.length;r<n;r++)s[r]._transformDirty()}if(this._meshes&&this._meshes.length>0)for(var o=this._meshes,a=0,l=o.length;a<l;a++)o[a]._transformDirty()}},{key:"_buildWorldMatrix",value:function(){var e=this.matrix;if(this._parentTransform)J.mulMat4(this._parentTransform.worldMatrix,e,this._worldMatrix);else for(var t=0,i=e.length;t<i;t++)this._worldMatrix[t]=e[t];this._worldMatrixDirty=!1}},{key:"_setSubtreeAABBsDirty",value:function(e){if(e._aabbDirty=!0,e._childTransforms)for(var t=0,i=e._childTransforms.length;t<i;t++)this._setSubtreeAABBsDirty(e._childTransforms[t])}}])}(),ih=J.vec3(),sh=J.OBB3(),rh=J.vec4(),nh=J.vec3([1,1,1]),oh=J.vec3([0,0,0]);J.vec3([0,0,0]);var ah=J.identityQuaternion(),lh=J.identityMat4(),uh="defaultColorTexture",Ah="defaultMetalRoughTexture",ch="defaultNormalsTexture",hh="defaultEmissiveTexture",dh="defaultOcclusionTexture",ph="defaultTextureSet",fh=new Uint8Array([255,255,255]),vh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s])).renderOrder=s.renderOrder||0,i._dtxEnabled=i.scene.dtxEnabled&&!1!==s.dtxEnabled,i._enableVertexWelding=!1,i._enableIndexBucketing=!1,i._vboBatchingLayerScratchMemory=(no++,ro),i._textureTranscoder=s.textureTranscoder||Uc(i.scene.viewer),i._maxGeometryBatchSize=s.maxGeometryBatchSize,i._aabb=J.collapseAABB3(),i._aabbDirty=!0,i._aabbUpdate=!1,i._exceptionIds=[],i._quantizationRanges={},i._vboInstancingLayers={},i._vboBatchingLayers={},i._dtxLayers={},i._meshList=[],i.layerList=[],i._layersToFinalize=[],i._entityList=[],i._entitiesToFinalize=[],i._geometries={},i._dtxBuckets={},i._textures={},i._textureSets={},i._transforms={},i._meshes={},i._unusedMeshes={},i._entities={},i._scheduledMeshes={},i._meshesCfgsBeforeMeshCreation={},i.renderFlags=new Kr,i.numGeometries=0,i.numPortions=0,i.numVisibleLayerPortions=0,i.numTransparentLayerPortions=0,i.numXRayedLayerPortions=0,i.numHighlightedLayerPortions=0,i.numSelectedLayerPortions=0,i.numEdgesLayerPortions=0,i.numPickableLayerPortions=0,i.numClippableLayerPortions=0,i.numCulledLayerPortions=0,i.numEntities=0,i._numTriangles=0,i._numLines=0,i._numPoints=0,i._layersFinalized=!1,i._edgeThreshold=s.edgeThreshold||10,i._origin=J.vec3(s.origin||[0,0,0]),i._position=J.vec3(s.position||[0,0,0]),i._rotation=J.vec3(s.rotation||[0,0,0]),i._quaternion=J.vec4(s.quaternion||[0,0,0,1]),i._conjugateQuaternion=J.vec4(s.quaternion||[0,0,0,1]),s.rotation&&J.eulerToQuaternion(i._rotation,"XYZ",i._quaternion),i._scale=J.vec3(s.scale||[1,1,1]),i._worldRotationMatrix=J.mat4(),i._worldRotationMatrixConjugate=J.mat4(),i._matrix=J.mat4(),i._matrixDirty=!0,i._rebuildMatrices(),i._worldNormalMatrix=J.mat4(),J.inverseMat4(i._matrix,i._worldNormalMatrix),J.transposeMat4(i._worldNormalMatrix),(s.matrix||s.position||s.rotation||s.scale||s.quaternion)&&(i._viewMatrix=J.mat4(),i._viewNormalMatrix=J.mat4(),i._viewMatrixDirty=!0,i._matrixNonIdentity=!0),i._opacity=1,i._colorize=[1,1,1],i._saoEnabled=!1!==s.saoEnabled,i._pbrEnabled=!1!==s.pbrEnabled,i._colorTextureEnabled=!1!==s.colorTextureEnabled,i._isModel=s.isModel,i._isModel&&i.scene._registerModel(i),i._onCameraViewMatrix=i.scene.camera.on("matrix",(function(){i._viewMatrixDirty=!0})),i._meshesWithDirtyMatrices=[],i._numMeshesWithDirtyMatrices=0,i._onTick=i.scene.on("tick",(function(){for(;i._numMeshesWithDirtyMatrices>0;)i._meshesWithDirtyMatrices[--i._numMeshesWithDirtyMatrices]._updateMatrix()})),i._createDefaultTextureSet(),i.visible=s.visible,i.culled=s.culled,i.pickable=s.pickable,i.clippable=s.clippable,i.collidable=s.collidable,i.castsShadow=s.castsShadow,i.receivesShadow=s.receivesShadow,i.xrayed=s.xrayed,i.highlighted=s.highlighted,i.selected=s.selected,i.edges=s.edges,i.colorize=s.colorize,i.opacity=s.opacity,i.backfaces=s.backfaces,i}return m(t,_e),w(t,[{key:"_meshMatrixDirty",value:function(e){this._meshesWithDirtyMatrices[this._numMeshesWithDirtyMatrices++]=e}},{key:"_createDefaultTextureSet",value:function(){var e=new Cc({id:uh,texture:new In({gl:this.scene.canvas.gl,preloadColor:[1,1,1,1]})}),t=new Cc({id:Ah,texture:new In({gl:this.scene.canvas.gl,preloadColor:[0,1,1,1]})}),i=new Cc({id:ch,texture:new In({gl:this.scene.canvas.gl,preloadColor:[0,0,0,0]})}),s=new Cc({id:hh,texture:new In({gl:this.scene.canvas.gl,preloadColor:[0,0,0,1]})}),r=new Cc({id:dh,texture:new In({gl:this.scene.canvas.gl,preloadColor:[1,1,1,1]})});this._textures[uh]=e,this._textures[Ah]=t,this._textures[ch]=i,this._textures[hh]=s,this._textures[dh]=r,this._textureSets[ph]=new Pc({id:ph,model:this,colorTexture:e,metallicRoughnessTexture:t,normalsTexture:i,emissiveTexture:s,occlusionTexture:r})}},{key:"isPerformanceModel",get:function(){return!0}},{key:"transforms",get:function(){return this._transforms}},{key:"textures",get:function(){return this._textures}},{key:"textureSets",get:function(){return this._textureSets}},{key:"meshes",get:function(){return this._meshes}},{key:"objects",get:function(){return this._entities}},{key:"origin",get:function(){return this._origin}},{key:"position",get:function(){return this._position},set:function(e){this._position.set(e||[0,0,0]),this._setWorldMatrixDirty(),this._sceneModelDirty(),this.glRedraw()}},{key:"rotation",get:function(){return this._rotation},set:function(e){this._rotation.set(e||[0,0,0]),J.eulerToQuaternion(this._rotation,"XYZ",this._quaternion),this._setWorldMatrixDirty(),this._sceneModelDirty(),this.glRedraw()}},{key:"quaternion",get:function(){return this._quaternion},set:function(e){this._quaternion.set(e||[0,0,0,1]),J.quaternionToEuler(this._quaternion,"XYZ",this._rotation),this._setWorldMatrixDirty(),this._sceneModelDirty(),this.glRedraw()}},{key:"scale",get:function(){return this._scale},set:function(e){}},{key:"matrix",get:function(){return this._rebuildMatrices(),this._matrix},set:function(e){this._matrix.set(e||lh),J.decomposeMat4(this._matrix,this._position,this._quaternion,this._scale),this._matrixDirty=!1,this._setWorldMatrixDirty(),this._sceneModelDirty(),this.glRedraw()}},{key:"rotationMatrix",get:function(){return this._rebuildMatrices(),this._worldRotationMatrix}},{key:"_rebuildMatrices",value:function(){this._matrixDirty&&(J.quaternionToRotationMat4(this._quaternion,this._worldRotationMatrix),J.conjugateQuaternion(this._quaternion,this._conjugateQuaternion),J.quaternionToRotationMat4(this._conjugateQuaternion,this._worldRotationMatrixConjugate),J.scaleMat4v(this._scale,this._worldRotationMatrix),J.scaleMat4v(this._scale,this._worldRotationMatrixConjugate),this._matrix.set(this._worldRotationMatrix),J.translateMat4v(this._position,this._matrix),this._matrixDirty=!1,this._viewMatrixDirty=!0)}},{key:"rotationMatrixConjugate",get:function(){return this._rebuildMatrices(),this._worldRotationMatrixConjugate}},{key:"_setWorldMatrixDirty",value:function(){this._matrixDirty=!0,this._aabbDirty=!0}},{key:"_transformDirty",value:function(){this._matrixDirty=!0,this._aabbDirty=!0,this.scene._aabbDirty=!0}},{key:"_sceneModelDirty",value:function(){this.scene._aabbDirty=!0,this._aabbDirty=!0,this.scene._aabbDirty=!0,this._matrixDirty=!0;for(var e=0,t=this._entityList.length;e<t;e++)this._entityList[e]._sceneModelDirty()}},{key:"worldMatrix",get:function(){return this.matrix}},{key:"worldNormalMatrix",get:function(){return this._worldNormalMatrix}},{key:"_rebuildViewMatrices",value:function(){this._rebuildMatrices(),this._viewMatrixDirty&&(J.mulMat4(this.scene.camera.viewMatrix,this._matrix,this._viewMatrix),J.inverseMat4(this._viewMatrix,this._viewNormalMatrix),J.transposeMat4(this._viewNormalMatrix),this._viewMatrixDirty=!1)}},{key:"viewMatrix",get:function(){return this._viewMatrix?(this._rebuildViewMatrices(),this._viewMatrix):this.scene.camera.viewMatrix}},{key:"viewNormalMatrix",get:function(){return this._viewNormalMatrix?(this._rebuildViewMatrices(),this._viewNormalMatrix):this.scene.camera.viewNormalMatrix}},{key:"backfaces",get:function(){return this._backfaces},set:function(e){e=!!e,this._backfaces=e,this.glRedraw()}},{key:"entityList",get:function(){return this._entityList}},{key:"isEntity",get:function(){return!0}},{key:"isModel",get:function(){return this._isModel}},{key:"isObject",get:function(){return!1}},{key:"aabb",get:function(){if(this._aabbDirty){if(this._aabbUpdate)return this._aabb;if(this._exceptionIds.length>0)this.updateAABBCullException(this._exceptionIds);else{J.collapseAABB3(this._aabb);for(var e=0,t=this._entityList.length;e<t;e++)J.expandAABB3(this._aabb,this._entityList[e].aabb)}this._aabbDirty=!1}return this._aabb}},{key:"exceptionIds",get:function(){return this._exceptionIds},set:function(e){this._exceptionIds=e,this._aabbDirty=!0,this._aabbUpdate=!1,this.scene._setAABBDirty()}},{key:"updateAABBCullException",value:function(e,t){function i(t){var i=!0;return e.forEach((function(e){e===t&&(i=!1)})),i}for(var s=J.collapseAABB3(),r=0,n=this._entityList.length;r<n;r++)i(this._entityList[r].id)&&J.expandAABB3(s,this._entityList[r].aabb);for(var o=0;o<s.length;o++)this._aabb[o]=s[o];this._aabbDirty=!1,this._aabbUpdate=!0,this.scene._setAABBDirty(),"function"==typeof t&&t()}},{key:"cancelCullException",value:function(e){this._exceptionIds=[],this._aabbDirty=!0,this._aabbUpdate=!1,this.aabb,this.scene._aabbUpdate=!1,this.scene._setAABBDirty(),"function"==typeof e&&e()}},{key:"aabbs",get:function(){for(var e=[],t=0,i=this._entityList.length;t<i;t++)e.push(this._entityList[t].aabb);return e}},{key:"numTriangles",get:function(){return this._numTriangles}},{key:"numLines",get:function(){return this._numLines}},{key:"numPoints",get:function(){return this._numPoints}},{key:"visible",get:function(){return this.numVisibleLayerPortions>0},set:function(e){e=!1!==e,this._visible=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].visible=e;this.glRedraw()}},{key:"xrayed",get:function(){return this.numXRayedLayerPortions>0},set:function(e){e=!!e,this._xrayed=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].xrayed=e;this.glRedraw()}},{key:"highlighted",get:function(){return this.numHighlightedLayerPortions>0},set:function(e){e=!!e,this._highlighted=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].highlighted=e;this.glRedraw()}},{key:"selected",get:function(){return this.numSelectedLayerPortions>0},set:function(e){e=!!e,this._selected=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].selected=e;this.glRedraw()}},{key:"edges",get:function(){return this.numEdgesLayerPortions>0},set:function(e){e=!!e,this._edges=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].edges=e;this.glRedraw()}},{key:"culled",get:function(){return this._culled},set:function(e){e=!!e,this._culled=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].culled=e;this.glRedraw()}},{key:"clippable",get:function(){return this._clippable},set:function(e){e=!1!==e,this._clippable=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].clippable=e;this.glRedraw()}},{key:"collidable",get:function(){return this._collidable},set:function(e){e=!1!==e,this._collidable=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].collidable=e}},{key:"pickable",get:function(){return this.numPickableLayerPortions>0},set:function(e){e=!1!==e,this._pickable=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].pickable=e}},{key:"colorize",get:function(){return this._colorize},set:function(e){this._colorize=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].colorize=e}},{key:"opacity",get:function(){return this._opacity},set:function(e){this._opacity=e;for(var t=0,i=this._entityList.length;t<i;t++)this._entityList[t].opacity=e}},{key:"castsShadow",get:function(){return this._castsShadow},set:function(e){(e=!1!==e)!==this._castsShadow&&(this._castsShadow=e,this.glRedraw())}},{key:"receivesShadow",get:function(){return this._receivesShadow},set:function(e){(e=!1!==e)!==this._receivesShadow&&(this._receivesShadow=e,this.glRedraw())}},{key:"saoEnabled",get:function(){return this._saoEnabled}},{key:"pbrEnabled",get:function(){return this._pbrEnabled}},{key:"colorTextureEnabled",get:function(){return this._colorTextureEnabled}},{key:"isDrawable",get:function(){return!0}},{key:"isStateSortable",get:function(){return!1}},{key:"xrayMaterial",get:function(){return this.scene.xrayMaterial}},{key:"highlightMaterial",get:function(){return this.scene.highlightMaterial}},{key:"selectedMaterial",get:function(){return this.scene.selectedMaterial}},{key:"edgeMaterial",get:function(){return this.scene.edgeMaterial}},{key:"getPickViewMatrix",value:function(e){return this._viewMatrix?this._viewMatrix:e}},{key:"createQuantizationRange",value:function(e){void 0!==e.id&&null!==e.id?e.aabb?this.error("[createQuantizationRange] Config missing: aabb"):this._quantizationRanges[e.id]?this.error("[createQuantizationRange] QuantizationRange already created: "+e.id):this._quantizationRanges[e.id]={id:e.id,aabb:e.aabb,matrix:ea(e.aabb,J.mat4())}:this.error("[createQuantizationRange] Config missing: id")}},{key:"createGeometry",value:function(e){if(void 0!==e.id&&null!==e.id)if(this._geometries[e.id])this.error("[createGeometry] Geometry already created: "+e.id);else if(void 0!==e.primitive&&null!==e.primitive||(e.primitive="triangles"),"points"===e.primitive||"lines"===e.primitive||"triangles"===e.primitive||"solid"===e.primitive||"surface"===e.primitive){if(!e.positions&&!e.positionsCompressed&&!e.buckets)return this.error("[createGeometry] Param expected: `positions`, `positionsCompressed' or 'buckets"),null;if(e.positionsCompressed&&!e.positionsDecodeMatrix&&!e.positionsDecodeBoundary)return this.error("[createGeometry] Param expected: `positionsDecodeMatrix` or 'positionsDecodeBoundary' (required for `positionsCompressed')"),null;if(e.positionsDecodeMatrix&&e.positionsDecodeBoundary)return this.error("[createGeometry] Only one of these params expected: `positionsDecodeMatrix` or 'positionsDecodeBoundary' (required for `positionsCompressed')"),null;if(e.uvCompressed&&!e.uvDecodeMatrix)return this.error("[createGeometry] Param expected: `uvDecodeMatrix` (required for `uvCompressed')"),null;if(!(e.buckets||e.indices||"triangles"!==e.primitive&&"solid"!==e.primitive&&"surface"!==e.primitive)){var t=(e.positions||e.positionsCompressed).length/3;e.indices=this._createDefaultIndices(t)}if(!e.buckets&&!e.indices&&"points"!==e.primitive)return this.error("[createGeometry] Param expected: indices (required for '".concat(e.primitive,"' primitive type)")),null;if(e.positionsDecodeBoundary&&(e.positionsDecodeMatrix=ea(e.positionsDecodeBoundary,J.mat4())),e.positions){var i=J.collapseAABB3();e.positionsDecodeMatrix=J.mat4(),J.expandAABB3Points3(i,e.positions),e.positionsCompressed=$o(e.positions,i,e.positionsDecodeMatrix),e.aabb=i}else if(e.positionsCompressed){var s=J.collapseAABB3();e.positionsDecodeMatrix=new Float64Array(e.positionsDecodeMatrix),e.positionsCompressed=new Uint16Array(e.positionsCompressed),J.expandAABB3Points3(s,e.positionsCompressed),Di.decompressAABB(s,e.positionsDecodeMatrix),e.aabb=s}else if(e.buckets){var r=J.collapseAABB3();this._dtxBuckets[e.id]=e.buckets;for(var n=0,o=e.buckets.length;n<o;n++){var a=e.buckets[n];a.positions?J.expandAABB3Points3(r,a.positions):a.positionsCompressed&&J.expandAABB3Points3(r,a.positionsCompressed)}e.positionsDecodeMatrix&&Di.decompressAABB(r,e.positionsDecodeMatrix),e.aabb=r}if(e.colorsCompressed&&e.colorsCompressed.length>0)e.colorsCompressed=new Uint8Array(e.colorsCompressed);else if(e.colors&&e.colors.length>0){for(var l=e.colors,u=new Uint8Array(l.length),A=0,c=l.length;A<c;A++)u[A]=255*l[A];e.colorsCompressed=u}if(e.buckets||e.edgeIndices||"triangles"!==e.primitive&&"solid"!==e.primitive&&"surface"!==e.primitive||(e.positions?e.edgeIndices=Bi(e.positions,e.indices,null,5):e.edgeIndices=Bi(e.positionsCompressed,e.indices,e.positionsDecodeMatrix,2)),e.uv){var h=Di.getUVBounds(e.uv),d=Di.compressUVs(e.uv,h.min,h.max);e.uvCompressed=d.quantized,e.uvDecodeMatrix=d.decodeMatrix}else e.uvCompressed&&(e.uvCompressed=new Uint16Array(e.uvCompressed),e.uvDecodeMatrix=new Float64Array(e.uvDecodeMatrix));e.normals&&(e.normals=null),this._geometries[e.id]=e,this._numTriangles+=e.indices?Math.round(e.indices.length/3):0,this.numGeometries++}else this.error("[createGeometry] Unsupported value for 'primitive': '".concat(e.primitive,"' - supported values are 'points', 'lines', 'triangles', 'solid' and 'surface'. Defaulting to 'triangles'."));else this.error("[createGeometry] Config missing: id")}},{key:"createTexture",value:function(e){var t=this,i=e.id;if(null!=i)if(this._textures[i])this.error("[createTexture] Texture already created: "+i);else{if(!(e.src||e.image||e.imageBuffer||e.buffers))return this.error("[createTexture] Param expected: `src`, `image' or 'buffers'"),null;var s=e.minFilter||cs;s!==ls&&s!==As&&s!==cs&&s!==as&&s!==rs&&(this.error("[createTexture] Unsupported value for 'minFilter' - \n supported values are LinearFilter, LinearMipMapNearestFilter, NearestMipMapNearestFilter, \n NearestMipMapLinearFilter and LinearMipmapLinearFilter. Defaulting to LinearMipmapLinearFilter."),s=cs);var r=e.magFilter||ls;r!==ls&&r!==ss&&(this.error("[createTexture] Unsupported value for 'magFilter' - supported values are LinearFilter and NearestFilter. Defaulting to LinearFilter."),r=ls);var n=e.wrapS||es;n!==ts&&n!==is&&n!==es&&(this.error("[createTexture] Unsupported value for 'wrapS' - supported values are ClampToEdgeWrapping, MirroredRepeatWrapping and RepeatWrapping. Defaulting to RepeatWrapping."),n=es);var o=e.wrapT||es;o!==ts&&o!==is&&o!==es&&(this.error("[createTexture] Unsupported value for 'wrapT' - supported values are ClampToEdgeWrapping, MirroredRepeatWrapping and RepeatWrapping. Defaulting to RepeatWrapping."),o=es);var a=e.wrapR||es;a!==ts&&a!==is&&a!==es&&(this.error("[createTexture] Unsupported value for 'wrapR' - supported values are ClampToEdgeWrapping, MirroredRepeatWrapping and RepeatWrapping. Defaulting to RepeatWrapping."),a=es);var l=e.encoding||lr;l!==lr&&l!==ur&&(this.error("[createTexture] Unsupported value for 'encoding' - supported values are LinearEncoding and sRGBEncoding. Defaulting to LinearEncoding."),l=lr);var u=new In({gl:this.scene.canvas.gl,minFilter:s,magFilter:r,wrapS:n,wrapT:o,wrapR:a,encoding:l},this.scene);if(e.preloadColor&&u.setPreloadColor(e.preloadColor),e.image){var A=e.image;if(A.crossOrigin="Anonymous",A.compressed){var c=A.data;u.setCompressedData({mipmaps:c,props:{format:c[0].format,minFilter:s,magFilter:r}})}else u.setImage(A,{minFilter:s,magFilter:r,wrapS:n,wrapT:o,wrapR:a,flipY:e.flipY,encoding:l})}else if(e.imageBuffer)u.setImageBuffer(e.imageBuffer,{minFilter:s,magFilter:r,wrapS:n,wrapT:o,wrapR:a,flipY:!1,encoding:l});else if(e.src){var h=e.src.split(".").pop();switch(h){case"jpeg":case"jpg":case"png":case"gif":var d=new Image;d.onload=function(){u.setImage(d,{minFilter:s,magFilter:r,wrapS:n,wrapT:o,wrapR:a,flipY:e.flipY,encoding:l}),t.glRedraw()},d.src=e.src;break;default:this._textureTranscoder?oe.loadArraybuffer(e.src,(function(e){e.byteLength?t._textureTranscoder.transcode([e],u).then((function(){t.glRedraw()})):t.error("[createTexture] Can't create texture from 'src': file data is zero length")}),(function(e){this.error("[createTexture] Can't create texture from 'src': ".concat(e))})):this.error("[createTexture] Can't create texture from 'src' - SceneModel needs to be configured with a TextureTranscoder for this file type ('".concat(h,"')"))}}else e.buffers&&(this._textureTranscoder?this._textureTranscoder.transcode(e.buffers,u).then((function(){t.glRedraw()})):this.error("[createTexture] Can't create texture from 'buffers' - SceneModel needs to be configured with a TextureTranscoder for this option"));this._textures[i]=new Cc({id:i,texture:u})}else this.error("[createTexture] Config missing: id")}},{key:"createTextureSet",value:function(e){var t=e.id;if(null!=t){if(!this._textureSets[t]){var i,s,r,n,o;if(void 0!==e.colorTextureId&&null!==e.colorTextureId){if(!(i=this._textures[e.colorTextureId]))return}else i=this._textures[uh];if(void 0!==e.metallicRoughnessTextureId&&null!==e.metallicRoughnessTextureId){if(!(s=this._textures[e.metallicRoughnessTextureId]))return void this.error("[createTextureSet] Texture not found: ".concat(e.metallicRoughnessTextureId," - ensure that you create it first with createTexture()"))}else s=this._textures[Ah];if(void 0!==e.normalsTextureId&&null!==e.normalsTextureId){if(!(r=this._textures[e.normalsTextureId]))return void this.error("[createTextureSet] Texture not found: ".concat(e.normalsTextureId," - ensure that you create it first with createTexture()"))}else r=this._textures[ch];if(void 0!==e.emissiveTextureId&&null!==e.emissiveTextureId){if(!(n=this._textures[e.emissiveTextureId]))return void this.error("[createTextureSet] Texture not found: ".concat(e.emissiveTextureId," - ensure that you create it first with createTexture()"))}else n=this._textures[hh];if(void 0!==e.occlusionTextureId&&null!==e.occlusionTextureId){if(!(o=this._textures[e.occlusionTextureId]))return void this.error("[createTextureSet] Texture not found: ".concat(e.occlusionTextureId," - ensure that you create it first with createTexture()"))}else o=this._textures[dh];var a=new Pc({id:t,model:this,colorTexture:i,alphaCutoff:e.alphaCutoff,metallicRoughnessTexture:s,normalsTexture:r,emissiveTexture:n,occlusionTexture:o});return this._textureSets[t]=a,a}this.error("[createTextureSet] Texture set already created: ".concat(t))}else this.error("[createTextureSet] Config missing: id")}},{key:"createTransform",value:function(e){if(void 0!==e.id&&null!==e.id)if(this._transforms[e.id])this.error("[createTransform] SceneModel already has a transform with this ID: ".concat(e.id));else{var t;if(!e.parentTransformId||(t=this._transforms[e.parentTransformId])){var i=new th({id:e.id,model:this,parent:t,matrix:e.matrix,position:e.position,scale:e.scale,rotation:e.rotation,quaternion:e.quaternion});return this._transforms[i.id]=i,i}this.error("[createTransform] SceneModel.createTransform() config missing: id")}else this.error("[createTransform] SceneModel.createTransform() config missing: id")}},{key:"createMesh",value:function(e){if(void 0===e.id||null===e.id)return this.error("[createMesh] SceneModel.createMesh() config missing: id"),!1;if(this._meshes[e.id])return this.error("[createMesh] SceneModel already has a mesh with this ID: ".concat(e.id)),!1;if(!(void 0!==e.geometryId)){if(void 0!==e.primitive&&null!==e.primitive||(e.primitive="triangles"),"points"!==e.primitive&&"lines"!==e.primitive&&"triangles"!==e.primitive&&"solid"!==e.primitive&&"surface"!==e.primitive)return this.error("Unsupported value for 'primitive': '".concat(primitive,"' ('geometryId' is absent) - supported values are 'points', 'lines', 'triangles', 'solid' and 'surface'.")),!1;if(!e.positions&&!e.positionsCompressed&&!e.buckets)return this.error("Param expected: 'positions', 'positionsCompressed' or `buckets` ('geometryId' is absent)"),!1;if(e.positions&&(e.positionsDecodeMatrix||e.positionsDecodeBoundary))return this.error("Illegal params: 'positions' not expected with 'positionsDecodeMatrix'/'positionsDecodeBoundary' ('geometryId' is absent)"),!1;if(e.positionsCompressed&&!e.positionsDecodeMatrix&&!e.positionsDecodeBoundary)return this.error("Param expected: 'positionsCompressed' should be accompanied by 'positionsDecodeMatrix'/'positionsDecodeBoundary' ('geometryId' is absent)"),!1;if(e.uvCompressed&&!e.uvDecodeMatrix)return this.error("Param expected: 'uvCompressed' should be accompanied by `uvDecodeMatrix` ('geometryId' is absent)"),!1;var t=(e.positions||e.positionsCompressed).length/3;if(e.buckets||e.indices||"triangles"!==e.primitive&&"solid"!==e.primitive&&"surface"!==e.primitive||(e.indices=this._createDefaultIndices(t)),!e.buckets&&!e.indices&&"points"!==e.primitive)return e.indices=this._createDefaultIndices(t),this.error("Param expected: indices (required for '".concat(e.primitive,"' primitive type)")),!1;if((e.matrix||e.position||e.rotation||e.scale)&&(e.positionsCompressed||e.positionsDecodeBoundary))return this.error("Unexpected params: 'matrix', 'rotation', 'scale', 'position' not allowed with 'positionsCompressed'"),!1;var i=!(!this._dtxEnabled||"triangles"!==e.primitive&&"solid"!==e.primitive&&"surface"!==e.primitive||e.textureSetId);if(e.origin=e.origin?J.addVec3(this._origin,e.origin,J.vec3()):this._origin,e.matrix)e.meshMatrix=e.matrix;else if(e.scale||e.rotation||e.position||e.quaternion){var s=e.scale||nh,r=e.position||oh;e.rotation?(J.eulerToQuaternion(e.rotation,"XYZ",rh),e.meshMatrix=J.composeMat4(r,rh,s,J.mat4())):e.meshMatrix=J.composeMat4(r,e.quaternion||ah,s,J.mat4())}if(e.positionsDecodeBoundary&&(e.positionsDecodeMatrix=ea(e.positionsDecodeBoundary,J.mat4())),i){if(e.type=2,e.color=e.color?new Uint8Array([Math.floor(255*e.color[0]),Math.floor(255*e.color[1]),Math.floor(255*e.color[2])]):fh,e.opacity=void 0!==e.opacity&&null!==e.opacity?Math.floor(255*e.opacity):255,e.positions){var n=J.vec3(),o=[];we(e.positions,o,n)&&(e.positions=o,e.origin=J.addVec3(e.origin,n,n))}if(e.positions){var a=J.collapseAABB3();e.positionsDecodeMatrix=J.mat4(),J.expandAABB3Points3(a,e.positions),e.positionsCompressed=$o(e.positions,a,e.positionsDecodeMatrix),e.aabb=a}else if(e.positionsCompressed){var l=J.collapseAABB3();J.expandAABB3Points3(l,e.positionsCompressed),Di.decompressAABB(l,e.positionsDecodeMatrix),e.aabb=l}if(e.buckets){for(var u=J.collapseAABB3(),A=0,c=e.buckets.length;A<c;A++){var h=e.buckets[A];h.positions?J.expandAABB3Points3(u,h.positions):h.positionsCompressed&&J.expandAABB3Points3(u,h.positionsCompressed)}e.positionsDecodeMatrix&&Di.decompressAABB(u,e.positionsDecodeMatrix),e.aabb=u}e.meshMatrix&&(J.AABB3ToOBB3(e.aabb,sh),J.transformOBB3(e.meshMatrix,sh),J.OBB3ToAABB3(sh,e.aabb)),e.buckets||e.edgeIndices||"triangles"!==e.primitive&&"solid"!==e.primitive&&"surface"!==e.primitive||(e.positions?e.edgeIndices=Bi(e.positions,e.indices,null,2):e.edgeIndices=Bi(e.positionsCompressed,e.indices,e.positionsDecodeMatrix,2)),e.buckets||(e.buckets=gh(e,this._enableVertexWelding&&this._enableIndexBucketing))}else{if(e.type=1,e.color=e.color?new Uint8Array([Math.floor(255*e.color[0]),Math.floor(255*e.color[1]),Math.floor(255*e.color[2])]):[255,255,255],e.opacity=void 0!==e.opacity&&null!==e.opacity?Math.floor(255*e.opacity):255,e.metallic=void 0!==e.metallic&&null!==e.metallic?Math.floor(255*e.metallic):0,e.roughness=void 0!==e.roughness&&null!==e.roughness?Math.floor(255*e.roughness):255,e.positions){var d=[];we(e.positions,d,ih)&&(e.positions=d,e.origin=J.addVec3(e.origin,ih,J.vec3()))}if(e.positions){var p=J.collapseAABB3();e.meshMatrix&&(J.transformPositions3(e.meshMatrix,e.positions,e.positions),e.meshMatrix=null),J.expandAABB3Points3(p,e.positions),e.aabb=p}else{var f=J.collapseAABB3();J.expandAABB3Points3(f,e.positionsCompressed),Di.decompressAABB(f,e.positionsDecodeMatrix),e.aabb=f}e.meshMatrix&&(J.AABB3ToOBB3(e.aabb,sh),J.transformOBB3(e.meshMatrix,sh),J.OBB3ToAABB3(sh,e.aabb)),e.buckets||e.edgeIndices||"triangles"!==e.primitive&&"solid"!==e.primitive&&"surface"!==e.primitive||(e.positions?e.edgeIndices=Bi(e.positions,e.indices,null,2):e.edgeIndices=Bi(e.positionsCompressed,e.indices,e.positionsDecodeMatrix,2)),e.textureSetId&&(e.textureSet=this._textureSets[e.textureSetId])}}else{if(e.positions||e.positionsCompressed||e.indices||e.edgeIndices||e.normals||e.normalsCompressed||e.uv||e.uvCompressed||e.positionsDecodeMatrix)return this.error("Mesh geometry parameters not expected when instancing a geometry (not expected: positions, positionsCompressed, indices, edgeIndices, normals, normalsCompressed, uv, uvCompressed, positionsDecodeMatrix)"),!1;if(e.geometry=this._geometries[e.geometryId],!e.geometry)return this.error("[createMesh] Geometry not found: ".concat(e.geometryId," - ensure that you create it first with createGeometry()")),!1;if(e.origin=e.origin?J.addVec3(this._origin,e.origin,J.vec3()):this._origin,e.positionsDecodeMatrix=e.geometry.positionsDecodeMatrix,e.transformId){if(e.transform=this._transforms[e.transformId],!e.transform)return this.error("[createMesh] Transform not found: ".concat(e.transformId," - ensure that you create it first with createTransform()")),!1;e.aabb=e.geometry.aabb}else{if(e.matrix)e.meshMatrix=e.matrix;else if(e.scale||e.rotation||e.position||e.quaternion){var v=e.scale||nh,g=e.position||oh;e.rotation?(J.eulerToQuaternion(e.rotation,"XYZ",rh),e.meshMatrix=J.composeMat4(g,rh,v,J.mat4())):e.meshMatrix=J.composeMat4(g,e.quaternion||ah,v,J.mat4())}J.AABB3ToOBB3(e.geometry.aabb,sh),J.transformOBB3(e.meshMatrix,sh),e.aabb=J.OBB3ToAABB3(sh,J.AABB3())}if(!(!this._dtxEnabled||"triangles"!==e.geometry.primitive&&"solid"!==e.geometry.primitive&&"surface"!==e.geometry.primitive||e.textureSetId)){e.type=2,e.color=e.color?new Uint8Array([Math.floor(255*e.color[0]),Math.floor(255*e.color[1]),Math.floor(255*e.color[2])]):fh,e.opacity=void 0!==e.opacity&&null!==e.opacity?Math.floor(255*e.opacity):255;var m=this._dtxBuckets[e.geometryId];m||(m=gh(e.geometry,this._enableVertexWelding,this._enableIndexBucketing),this._dtxBuckets[e.geometryId]=m),e.buckets=m}else e.type=0,e.color=e.color?new Uint8Array([Math.floor(255*e.color[0]),Math.floor(255*e.color[1]),Math.floor(255*e.color[2])]):fh,e.opacity=void 0!==e.opacity&&null!==e.opacity?Math.floor(255*e.opacity):255,e.metallic=void 0!==e.metallic&&null!==e.metallic?Math.floor(255*e.metallic):0,e.roughness=void 0!==e.roughness&&null!==e.roughness?Math.floor(255*e.roughness):255,e.textureSetId&&(e.textureSet=this._textureSets[e.textureSetId])}return e.numPrimitives=this._getNumPrimitives(e),this._createMesh(e)}},{key:"_createDefaultIndices",value:function(e){for(var t=[],i=0;i<e;i++)t.push(i);return t}},{key:"_createMesh",value:function(e){var t=new so(this,e.id,e.color,e.opacity,e.transform,e.textureSet);t.pickId=this.scene._renderer.getPickID(t);var i=t.pickId,s=i>>24&255,r=i>>16&255,n=i>>8&255,o=255&i;switch(e.pickColor=new Uint8Array([o,n,r,s]),e.solid="solid"===e.primitive,t.origin=J.vec3(e.origin),e.type){case 2:t.layer=this._getDTXLayer(e),t.aabb=e.aabb;break;case 1:t.layer=this._getVBOBatchingLayer(e),t.aabb=e.aabb;break;case 0:t.layer=this._getVBOInstancingLayer(e),t.aabb=e.aabb}return e.transform&&(e.meshMatrix=e.transform.worldMatrix),t.portionId=t.layer.createPortion(t,e),t.numPrimitives=e.numPrimitives,this._meshes[e.id]=t,this._unusedMeshes[e.id]=t,this._meshList.push(t),t}},{key:"_getNumPrimitives",value:function(e){var t=0;switch(e.geometry?e.geometry.primitive:e.primitive){case"triangles":case"solid":case"surface":switch(e.type){case 2:for(var i=0,s=e.buckets.length;i<s;i++)t+=e.buckets[i].indices.length;break;case 1:t+=e.indices.length;break;case 0:t+=e.geometry.indices.length}return Math.round(t/3);case"points":switch(e.type){case 2:for(var r=0,n=e.buckets.length;r<n;r++)t+=e.buckets[r].positionsCompressed.length;break;case 1:t+=e.positions?e.positions.length:e.positionsCompressed.length;break;case 0:var o=e.geometry;t+=o.positions?o.positions.length:o.positionsCompressed.length}return Math.round(t);case"lines":case"line-strip":switch(e.type){case 2:for(var a=0,l=e.buckets.length;a<l;a++)t+=e.buckets[a].indices.length;break;case 1:t+=e.indices.length;break;case 0:t+=e.geometry.indices.length}return Math.round(t/2)}return 0}},{key:"_getDTXLayer",value:function(e){var t=e.origin,i=e.geometry?e.geometry.primitive:e.primitive,s=".".concat(i,".").concat(Math.round(t[0]),".").concat(Math.round(t[1]),".").concat(Math.round(t[2])),r=this._dtxLayers[s];if(r){if(r.canCreatePortion(e))return r;delete this._dtxLayers[s],r=null}switch(i){case"triangles":case"solid":case"surface":r=new wc(this,{layerIndex:0,origin:t,primitive:i});break;case"lines":r=new tA(this,{layerIndex:0,origin:t,primitive:i});break;default:return}return this._dtxLayers[s]=r,this.layerList.push(r),this._layersToFinalize.push(r),r}},{key:"_getVBOBatchingLayer",value:function(e){var t=this,i=e.origin;e.renderLayer;var s=e.positionsDecodeMatrix||e.positionsDecodeBoundary?this._createHashStringFromMatrix(e.positionsDecodeMatrix||e.positionsDecodeBoundary):"-",r=e.textureSetId||"-",n="".concat(Math.round(i[0]),".").concat(Math.round(i[1]),".").concat(Math.round(i[2]),".").concat(e.primitive,".").concat(s,".").concat(r),o=this._vboBatchingLayers[n];if(o)return o;for(var a=e.textureSet;!o;){switch(e.primitive){case"triangles":case"solid":case"surface":o=new da({model:t,textureSet:a,layerIndex:0,scratchMemory:this._vboBatchingLayerScratchMemory,positionsDecodeMatrix:e.positionsDecodeMatrix,uvDecodeMatrix:e.uvDecodeMatrix,origin:i,maxGeometryBatchSize:this._maxGeometryBatchSize,solid:"solid"===e.primitive,autoNormals:!0,primitive:e.primitive});break;case"lines":o=new xl({model:t,layerIndex:0,scratchMemory:this._vboBatchingLayerScratchMemory,positionsDecodeMatrix:e.positionsDecodeMatrix,uvDecodeMatrix:e.uvDecodeMatrix,origin:i,maxGeometryBatchSize:this._maxGeometryBatchSize,primitive:e.primitive});break;case"points":o=new cu({model:t,layerIndex:0,scratchMemory:this._vboBatchingLayerScratchMemory,positionsDecodeMatrix:e.positionsDecodeMatrix,uvDecodeMatrix:e.uvDecodeMatrix,origin:i,maxGeometryBatchSize:this._maxGeometryBatchSize,primitive:e.primitive})}var l=e.positionsCompressed?e.positionsCompressed.length:e.positions.length;("points"===e.primitive?o.canCreatePortion(l):o.canCreatePortion(l,e.indices.length))||(o.finalize(),delete this._vboBatchingLayers[n],o=null)}return this._vboBatchingLayers[n]=o,this.layerList.push(o),this._layersToFinalize.push(o),o}},{key:"_createHashStringFromMatrix",value:function(e){for(var t=e.join(""),i=0,s=0;s<t.length;s++){i=(i<<5)-i+t.charCodeAt(s),i|=0}return(i>>>0).toString(16)}},{key:"_getVBOInstancingLayer",value:function(e){var t=this,i=e.origin,s=e.textureSetId||"-",r=e.geometryId,n="".concat(Math.round(i[0]),".").concat(Math.round(i[1]),".").concat(Math.round(i[2]),".").concat(s,".").concat(r),o=this._vboInstancingLayers[n];if(o)return o;for(var a=e.textureSet,l=e.geometry;!o;)switch(l.primitive){case"triangles":case"surface":o=new rl({model:t,textureSet:a,geometry:l,origin:i,layerIndex:0,solid:!1});break;case"solid":o=new rl({model:t,textureSet:a,geometry:l,origin:i,layerIndex:0,solid:!0});break;case"lines":o=new jl({model:t,textureSet:a,geometry:l,origin:i,layerIndex:0});break;case"points":o=new Ru({model:t,textureSet:a,geometry:l,origin:i,layerIndex:0})}return this._vboInstancingLayers[n]=o,this.layerList.push(o),this._layersToFinalize.push(o),o}},{key:"createEntity",value:function(e){if(void 0===e.id?e.id=J.createUUID():this.scene.components[e.id]&&(this.error("Scene already has a Component with this ID: ".concat(e.id," - will assign random ID")),e.id=J.createUUID()),void 0!==e.meshIds){var t=0;return this._visible&&!1!==e.visible&&(t|=Me),this._pickable&&!1!==e.pickable&&(t|=Fe),this._culled&&!1!==e.culled&&(t|=ke),this._clippable&&!1!==e.clippable&&(t|=Ee),this._collidable&&!1!==e.collidable&&(t|=De),this._edges&&!1!==e.edges&&(t|=Le),this._xrayed&&!1!==e.xrayed&&(t|=Ie),this._highlighted&&!1!==e.highlighted&&(t|=Se),this._selected&&!1!==e.selected&&(t|=Te),e.flags=t,this._createEntity(e)}this.error("Config missing: meshIds")}},{key:"_createEntity",value:function(e){for(var t=[],i=0,s=e.meshIds.length;i<s;i++){var r=e.meshIds[i],n=this._meshes[r];n?n.parent?this.error('Mesh with ID "'.concat(r,'" already belongs to object with ID "').concat(n.parent.id,'" - ignoring this mesh')):(t.push(n),delete this._unusedMeshes[r]):this.error('Mesh with this ID not found: "'.concat(r,'" - ignoring this mesh'))}var o=new Oe(this,e.isObject,e.id,t,e.flags,!0);return this._entityList.push(o),this._entities[e.id]=o,this._entitiesToFinalize.push(o),this.numEntities++,o}},{key:"preFinalize",value:function(){if(this.destroyed)return!1;if(0===this._layersToFinalize.length)return!1;this._createDummyEntityForUnusedMeshes();for(var e=0,t=this._layersToFinalize.length;e<t;e++){this._layersToFinalize[e].finalize()}this._vboBatchingLayers={},this._vboInstancingLayers={},this._dtxLayers={},this._layersToFinalize=[];for(var i=0,s=this._entitiesToFinalize.length;i<s;i++){this._entitiesToFinalize[i]._finalize()}for(var r=0,n=this._entitiesToFinalize.length;r<n;r++){this._entitiesToFinalize[r]._finalize2()}this._entitiesToFinalize=[],this.scene._aabbDirty=!0,this._viewMatrixDirty=!0,this._matrixDirty=!0,this._aabbDirty=!0,this._setWorldMatrixDirty(),this._sceneModelDirty(),this.position=this._position,this.layerList.sort((function(e,t){return e.sortId<t.sortId?-1:e.sortId>t.sortId?1:0}));for(var o=0,a=this.layerList.length;o<a;o++){this.layerList[o].layerIndex=o}this.glRedraw(),this._layersFinalized=!0}},{key:"finalize",value:function(){this.destroyed||(this.preFinalize(),this._geometries={},this._dtxBuckets={},this._textures={},this._textureSets={})}},{key:"stateSortCompare",value:function(e,t){}},{key:"rebuildRenderFlags",value:function(){this.renderFlags.reset(),this._updateRenderFlagsVisibleLayers(),this.renderFlags.numLayers>0&&0===this.renderFlags.numVisibleLayers?this.renderFlags.culled=!0:this._updateRenderFlags()}},{key:"_updateRenderFlagsVisibleLayers",value:function(){var e=this.renderFlags;e.numLayers=this.layerList.length,e.numVisibleLayers=0;for(var t=0,i=this.layerList.length;t<i;t++){var s=this.layerList[t];this._getActiveSectionPlanesForLayer(s)&&(e.visibleLayers[e.numVisibleLayers++]=t)}}},{key:"_createDummyEntityForUnusedMeshes",value:function(){var e=Object.keys(this._unusedMeshes);if(e.length>0){var t="".concat(this.id,"-").concat(J.createUUID());this.warn('Creating dummy SceneModelEntity "'.concat(t,'" for unused SceneMeshes: [').concat(e.join(","),"]")),this.createEntity({id:t,meshIds:e,isObject:!0})}this._unusedMeshes={}}},{key:"_getActiveSectionPlanesForLayer",value:function(e){var t=this.renderFlags,i=this.scene._sectionPlanesState.sectionPlanes,s=i.length,r=e.layerIndex*s;if(s>0)for(var n=0;n<s;n++){i[n].active?(t.sectionPlanesActivePerLayer[r+n]=!0,t.sectioned=!0):t.sectionPlanesActivePerLayer[r+n]=!1}return!0}},{key:"_updateRenderFlags",value:function(){if(0!==this.numVisibleLayerPortions&&this.numCulledLayerPortions!==this.numPortions){var e=this.renderFlags;if(e.colorOpaque=this.numTransparentLayerPortions<this.numPortions,this.numTransparentLayerPortions>0&&(e.colorTransparent=!0),this.numXRayedLayerPortions>0){var t=this.scene.xrayMaterial._state;t.fill&&(t.fillAlpha<1?e.xrayedSilhouetteTransparent=!0:e.xrayedSilhouetteOpaque=!0),t.edges&&(t.edgeAlpha<1?e.xrayedEdgesTransparent=!0:e.xrayedEdgesOpaque=!0)}if(this.numEdgesLayerPortions>0)this.scene.edgeMaterial._state.edges&&(e.edgesOpaque=this.numTransparentLayerPortions<this.numPortions,this.numTransparentLayerPortions>0&&(e.edgesTransparent=!0));if(this.numSelectedLayerPortions>0){var i=this.scene.selectedMaterial._state;i.fill&&(i.fillAlpha<1?e.selectedSilhouetteTransparent=!0:e.selectedSilhouetteOpaque=!0),i.edges&&(i.edgeAlpha<1?e.selectedEdgesTransparent=!0:e.selectedEdgesOpaque=!0)}if(this.numHighlightedLayerPortions>0){var s=this.scene.highlightMaterial._state;s.fill&&(s.fillAlpha<1?e.highlightedSilhouetteTransparent=!0:e.highlightedSilhouetteOpaque=!0),s.edges&&(s.edgeAlpha<1?e.highlightedEdgesTransparent=!0:e.highlightedEdgesOpaque=!0)}}}},{key:"drawColorOpaque",value:function(e,t){for(var i=this.renderFlags,s=0,r=i.visibleLayers.length;s<r;s++){var n=i.visibleLayers[s];this.layerList[n].drawColorOpaque(i,e)}}},{key:"drawColorTransparent",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawColorTransparent(t,e)}}},{key:"drawDepth",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawDepth(t,e)}}},{key:"drawNormals",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawNormals(t,e)}}},{key:"drawSilhouetteXRayed",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawSilhouetteXRayed(t,e)}}},{key:"drawSilhouetteHighlighted",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawSilhouetteHighlighted(t,e)}}},{key:"drawSilhouetteSelected",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawSilhouetteSelected(t,e)}}},{key:"drawEdgesColorOpaque",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawEdgesColorOpaque(t,e)}}},{key:"drawEdgesColorTransparent",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawEdgesColorTransparent(t,e)}}},{key:"drawEdgesXRayed",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawEdgesXRayed(t,e)}}},{key:"drawEdgesHighlighted",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawEdgesHighlighted(t,e)}}},{key:"drawEdgesSelected",value:function(e){for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawEdgesSelected(t,e)}}},{key:"drawOcclusion",value:function(e){if(0!==this.numVisibleLayerPortions)for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawOcclusion(t,e)}}},{key:"drawShadow",value:function(e){if(0!==this.numVisibleLayerPortions)for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawShadow(t,e)}}},{key:"setPickMatrices",value:function(e,t){if(0!==this._numVisibleLayerPortions)for(var i=this.renderFlags,s=0,r=i.visibleLayers.length;s<r;s++){var n=i.visibleLayers[s],o=this.layerList[n];o.setPickMatrices&&o.setPickMatrices(e,t)}}},{key:"drawPickMesh",value:function(e){if(0!==this.numVisibleLayerPortions)for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawPickMesh(t,e)}}},{key:"drawPickDepths",value:function(e){if(0!==this.numVisibleLayerPortions)for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawPickDepths(t,e)}}},{key:"drawPickNormals",value:function(e){if(0!==this.numVisibleLayerPortions)for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i];this.layerList[r].drawPickNormals(t,e)}}},{key:"drawSnapInit",value:function(e){if(0!==this.numVisibleLayerPortions)for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i],n=this.layerList[r];n.drawSnapInit&&(e.snapPickOrigin=[0,0,0],e.snapPickCoordinateScale=[1,1,1],e.snapPickLayerNumber++,n.drawSnapInit(t,e),e.snapPickLayerParams[e.snapPickLayerNumber]={origin:e.snapPickOrigin.slice(),coordinateScale:e.snapPickCoordinateScale.slice()})}}},{key:"drawSnap",value:function(e){if(0!==this.numVisibleLayerPortions)for(var t=this.renderFlags,i=0,s=t.visibleLayers.length;i<s;i++){var r=t.visibleLayers[i],n=this.layerList[r];n.drawSnap&&(e.snapPickOrigin=[0,0,0],e.snapPickCoordinateScale=[1,1,1],e.snapPickLayerNumber++,n.drawSnap(t,e),e.snapPickLayerParams[e.snapPickLayerNumber]={origin:e.snapPickOrigin.slice(),coordinateScale:e.snapPickCoordinateScale.slice()})}}},{key:"destroy",value:function(){for(var e in this._vboBatchingLayers)this._vboBatchingLayers.hasOwnProperty(e)&&this._vboBatchingLayers[e].destroy();for(var i in this._vboBatchingLayers={},this._vboInstancingLayers)this._vboInstancingLayers.hasOwnProperty(i)&&this._vboInstancingLayers[i].destroy();this._vboInstancingLayers={},this.scene.camera.off(this._onCameraViewMatrix),this.scene.off(this._onTick);for(var s=0,r=this.layerList.length;s<r;s++)this.layerList[s].destroy();this.layerList=[];for(var n=0,o=this._entityList.length;n<o;n++)this._entityList[n]._destroy();this._layersToFinalize={},this._geometries={},this._dtxBuckets={},this._textures={},this._textureSets={},this._meshes={},this._entities={},this.scene._aabbDirty=!0,this._isModel&&this.scene._deregisterModel(this),0!==no&&0==--no&&ro._clear(),f(t,"destroy",this,3)([])}}])}();function gh(e,t,i){var s,r,n,o;if(t||i){var a=u(Vc({positionsCompressed:e.positionsCompressed,indices:e.indices,edgeIndices:e.edgeIndices}),3);s=a[0],r=a[1],n=a[2]}else s=e.positionsCompressed,r=e.indices,n=e.edgeIndices;i?o=Kc({positionsCompressed:s,indices:r,edgeIndices:n},s.length/3>65536?16:8):o=[{positionsCompressed:s,indices:r,edgeIndices:n}];return o}var mh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(B(this,t),(i=h(this,t,[e,s]))._positions=s.positions||[],s.indices)i._indices=s.indices;else{i._indices=[];for(var r=0,n=i._positions.length/3-1;r<n;r+=2)i._indices.push(r),i._indices.push(r+1)}return i._sceneModel=new vh(i,{isModel:!1}),i._sceneModel.createMesh({id:"linesMesh",primitive:"lines",positions:i._positions,indices:i._indices}),i._sceneModel.createEntity({meshIds:["linesMesh"],visible:s.visible,clippable:s.clippable,collidable:s.collidable}),i._sceneModel.finalize(),i.scene._lineSetCreated(i),i}return m(t,_e),w(t,[{key:"visible",get:function(){return this._sceneModel.visible},set:function(e){this._sceneModel.visible=e}},{key:"positions",get:function(){return this._positions}},{key:"indices",get:function(){return this._indices}},{key:"destroy",value:function(){f(t,"destroy",this,3)([]),this.scene._lineSetDestroyed(this)}}])}(),_h=J.vec3(),yh=J.vec3(),bh=J.vec3(),Bh=J.vec3(),xh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,["BCFViewpoints",e,s])).originatingSystem=s.originatingSystem||"tctwins.io",i.authoringTool=s.authoringTool||"tctwins.io",i}return m(t,me),w(t,[{key:"getViewpoint",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.viewer.scene,s=i.camera,r=i.realWorldOffset,n=!0===t.reverseClippingPlanes,o={},a=J.normalizeVec3(J.subVec3(s.look,s.eye,J.vec3())),l=s.eye,A=s.up;s.yUp&&(a=Ch(a),l=Ch(l),A=Ch(A));var c=wh(J.addVec3(l,r));"ortho"===s.projection?o.orthogonal_camera={camera_view_point:c,camera_direction:wh(a),camera_up_vector:wh(A),view_to_world_scale:s.ortho.scale}:o.perspective_camera={camera_view_point:c,camera_direction:wh(a),camera_up_vector:wh(A),field_of_view:s.perspective.fov};var h=i.sectionPlanes;for(var d in h)if(h.hasOwnProperty(d)){var p=h[d];if(!p.active)continue;var f=p.pos,v=void 0;v=n?J.negateVec3(p.dir,J.vec3()):p.dir,s.yUp&&(f=Ch(f),v=Ch(v)),J.addVec3(f,r),f=wh(f),v=wh(v),o.clipping_planes||(o.clipping_planes=[]),o.clipping_planes.push({location:f,direction:v})}var g=i.lineSets;for(var m in g)if(g.hasOwnProperty(m)){var _=g[m];o.lines||(o.lines=[]);for(var y=_.positions,b=_.indices,B=0,x=b.length/2;B<x;B++){var w=b[2*B],P=b[2*B+1];o.lines.push({start_point:{x:y[3*w+0],y:y[3*w+1],z:y[3*w+2]},end_point:{x:y[3*P+0],y:y[3*P+1],z:y[3*P+2]}})}}var C=i.bitmaps;for(var M in C)if(C.hasOwnProperty(M)){var k=C[M],F=k.pos,E=k.normal,D=k.up;s.yUp&&(F=Ch(F),E=Ch(E),D=Ch(D)),J.addVec3(F,r),o.bitmaps||(o.bitmaps=[]),o.bitmaps.push({bitmap_type:k.type,bitmap_data:k.imageData,location:wh(F),normal:wh(E),up:wh(D),height:k.height})}o.components={view_setup_hints:{spaces_visible:!!t.spacesVisible,space_boundaries_visible:!!t.spaceBoundariesVisible,openings_visible:!!t.openingsVisible,spaces_translucent:!!t.spaces_translucent,space_boundaries_translucent:!!t.space_boundaries_translucent,openings_translucent:!!t.openings_translucent},visibility:{}};var I=new Set(i.opacityObjectIds),S=new Set(i.xrayedObjectIds),T=new Set(i.colorizedObjectIds),L=Object.values(i.objects).filter((function(e){return I.has(e.id)||T.has(e.id)||S.has(e.id)})).reduce((function(t,s){var r,n=function(e){var t="";return t+=Math.round(255*e[0]).toString(16).padStart(2,"0"),t+=Math.round(255*e[1]).toString(16).padStart(2,"0"),t+=Math.round(255*e[2]).toString(16).padStart(2,"0"),t}(s.colorize);s.xrayed?(r=0===i.xrayMaterial.fillAlpha&&0!==i.xrayMaterial.edgeAlpha?.1:i.xrayMaterial.fillAlpha,n=(r=Math.round(255*r).toString(16).padStart(2,"0"))+n):I.has(s.id)&&(n=(r=Math.round(255*s.opacity).toString(16).padStart(2,"0"))+n),t[n]||(t[n]=[]);var o=s.id,a=s.originalSystemId,l={ifc_guid:a,originating_system:e.originatingSystem};return a!==o&&(l.authoring_tool_id=o),t[n].push(l),t}),{}),R=Object.entries(L).map((function(e){var t=u(e,2);return{color:t[0],components:t[1]}}));o.components.coloring=R;var U=i.objectIds,O=i.visibleObjects,Q=i.visibleObjectIds,N=U.filter((function(e){return!O[e]})),V=i.selectedObjectIds;return t.defaultInvisible||Q.length<N.length?(o.components.visibility.exceptions=this._createBCFComponents(Q),o.components.visibility.default_visibility=!1):(o.components.visibility.exceptions=this._createBCFComponents(N),o.components.visibility.default_visibility=!0),o.components.selection=this._createBCFComponents(V),o.components.translucency=this._createBCFComponents(i.xrayedObjectIds),!1!==t.snapshot&&(o.snapshot={snapshot_type:"png",snapshot_data:this.viewer.getSnapshot({format:"png"})}),o}},{key:"_createBCFComponents",value:function(e){for(var t=this.viewer.scene,i=[],s=0,r=e.length;s<r;s++){var n=e[s],o=t.objects[n];if(o){var a={ifc_guid:o.originalSystemId,originating_system:this.originatingSystem};o.originalSystemId!==n&&(a.authoring_tool_id=n),i.push(a)}}return i}},{key:"setViewpoint",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){var s=this.viewer,r=s.scene,n=r.camera,o=!1!==i.rayCast,a=!1!==i.immediate,l=!1!==i.reset,u=r.realWorldOffset,A=!0===i.reverseClippingPlanes;if(r.clearSectionPlanes(),e.clipping_planes&&e.clipping_planes.length>0&&e.clipping_planes.forEach((function(e){var t=Ph(e.location,_h),i=Ph(e.direction,_h);A&&J.negateVec3(i),J.subVec3(t,u),n.yUp&&(t=Mh(t),i=Mh(i)),new hn(r,{pos:t,dir:i})})),r.clearLines(),e.lines&&e.lines.length>0){var c=[],h=[],d=0;e.lines.forEach((function(e){e.start_point&&e.end_point&&(c.push(e.start_point.x),c.push(e.start_point.y),c.push(e.start_point.z),c.push(e.end_point.x),c.push(e.end_point.y),c.push(e.end_point.z),h.push(d++),h.push(d++))})),new mh(r,{positions:c,indices:h,clippable:!1,collidable:!0})}if(r.clearBitmaps(),e.bitmaps&&e.bitmaps.length>0&&e.bitmaps.forEach((function(e){var t=e.bitmap_type||"jpg",i=e.bitmap_data,s=Ph(e.location,yh),o=Ph(e.normal,bh),a=Ph(e.up,Bh),l=e.height||1;t&&i&&s&&o&&a&&(n.yUp&&(s=Mh(s),o=Mh(o),a=Mh(a)),new $n(r,{src:i,type:t,pos:s,normal:o,up:a,clippable:!1,collidable:!0,height:l}))})),l&&(r.setObjectsXRayed(r.xrayedObjectIds,!1),r.setObjectsHighlighted(r.highlightedObjectIds,!1),r.setObjectsSelected(r.selectedObjectIds,!1)),e.components){if(e.components.visibility){e.components.visibility.default_visibility?(r.setObjectsVisible(r.objectIds,!0),e.components.visibility.exceptions&&e.components.visibility.exceptions.forEach((function(e){return t._withBCFComponent(i,e,(function(e){return e.visible=!1}))}))):(r.setObjectsVisible(r.objectIds,!1),e.components.visibility.exceptions&&e.components.visibility.exceptions.forEach((function(e){return t._withBCFComponent(i,e,(function(e){return e.visible=!0}))})));var p=e.components.view_setup_hints;p&&(!1===p.spaces_visible&&r.setObjectsVisible(s.metaScene.getObjectIDsByType("IfcSpace"),!1),void 0!==p.spaces_translucent&&r.setObjectsXRayed(s.metaScene.getObjectIDsByType("IfcSpace"),!0),p.space_boundaries_visible,!1===p.openings_visible&&r.setObjectsVisible(s.metaScene.getObjectIDsByType("IfcOpening"),!0),p.space_boundaries_translucent,void 0!==p.openings_translucent&&r.setObjectsXRayed(s.metaScene.getObjectIDsByType("IfcOpening"),!0))}e.components.selection&&(r.setObjectsSelected(r.selectedObjectIds,!1),e.components.selection.forEach((function(e){return t._withBCFComponent(i,e,(function(e){return e.selected=!0}))}))),e.components.translucency&&(r.setObjectsXRayed(r.xrayedObjectIds,!1),e.components.translucency.forEach((function(e){return t._withBCFComponent(i,e,(function(e){return e.xrayed=!0}))}))),e.components.coloring&&e.components.coloring.forEach((function(e){var s=e.color,r=0,n=!1;8===s.length&&((r=parseInt(s.substring(0,2),16)/256)<=1&&r>=.95&&(r=1),s=s.substring(2),n=!0);var o=[parseInt(s.substring(0,2),16)/256,parseInt(s.substring(2,4),16)/256,parseInt(s.substring(4,6),16)/256];e.components.map((function(e){return t._withBCFComponent(i,e,(function(e){e.colorize=o,n&&(e.opacity=r)}))}))}))}if(e.perspective_camera||e.orthogonal_camera){var f,v,g,m;if(e.perspective_camera?(f=Ph(e.perspective_camera.camera_view_point,_h),v=Ph(e.perspective_camera.camera_direction,_h),g=Ph(e.perspective_camera.camera_up_vector,_h),n.perspective.fov=e.perspective_camera.field_of_view,m="perspective"):(f=Ph(e.orthogonal_camera.camera_view_point,_h),v=Ph(e.orthogonal_camera.camera_direction,_h),g=Ph(e.orthogonal_camera.camera_up_vector,_h),n.ortho.scale=e.orthogonal_camera.view_to_world_scale,m="ortho"),J.subVec3(f,u),n.yUp&&(f=Mh(f),v=Mh(v),g=Mh(g)),o){var _=r.pick({pickSurface:!0,origin:f,direction:v});v=_?_.worldPos:J.addVec3(f,v,_h)}else v=J.addVec3(f,v,_h);a?(n.eye=f,n.look=v,n.up=g,n.projection=m):s.cameraFlight.flyTo({eye:f,look:v,up:g,duration:i.duration,projection:m})}}}},{key:"_withBCFComponent",value:function(e,t,i){var s=this.viewer,r=s.scene;if(t.authoring_tool_id&&t.originating_system===this.originatingSystem){var n=t.authoring_tool_id,o=r.objects[n];if(o)return void i(o);if(e.updateCompositeObjects)if(s.metaScene.metaObjects[n])return void r.withObjects(s.metaScene.getObjectIDsInSubtree(n),i)}if(t.ifc_guid){var a=t.ifc_guid,l=r.objects[a];if(l)return void i(l);if(e.updateCompositeObjects)if(s.metaScene.metaObjects[a])return void r.withObjects(s.metaScene.getObjectIDsInSubtree(a),i);Object.keys(r.models).forEach((function(t){var n=J.globalizeObjectId(t,a),o=r.objects[n];o?i(o):e.updateCompositeObjects&&s.metaScene.metaObjects[n]&&r.withObjects(s.metaScene.getObjectIDsInSubtree(n),i)}))}}},{key:"getUUID",value:function(){return J.createUUID()}},{key:"destroy",value:function(){f(t,"destroy",this,3)([])}}])}();function wh(e){return{x:e[0],y:e[1],z:e[2]}}function Ph(e,t){return(t=new Float64Array(3))[0]=e.x,t[1]=e.y,t[2]=e.z,t}function Ch(e){return new Float64Array([e[0],-e[2],e[1]])}function Mh(e){return new Float64Array([e[0],e[2],-e[1]])}var kh=J.vec3(),Fh=function(e,t,i,s){var r=e-i,n=t-s;return Math.sqrt(r*r+n*n)},Eh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(B(this,t),(i=h(this,t,[e.viewer.scene,s])).plugin=e,i._container=s.container,!i._container)throw"config missing: container";i._eventSubs={},i._color=s.color?s.color:e.defaultColor,i._borderColor=e.defaultColor?e.defaultColor:"white";var r=i.plugin.viewer.scene;i._originMarker=new Ve(r,s.origin),i._targetMarker=new Ve(r,s.target),i._originWorld=J.vec3(),i._targetWorld=J.vec3(),i._wp=new Float64Array(24),i._vp=new Float64Array(24),i._pp=new Float64Array(24),i._cp=new Float64Array(8),i._xAxisLabelCulled=!1,i._yAxisLabelCulled=!1,i._zAxisLabelCulled=!1;var n=s.onMouseOver?function(e){s.onMouseOver(e,i),i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mouseover",e))}:null,o=s.onMouseLeave?function(e){s.onMouseLeave(e,i),i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mouseleave",e))}:null,a=s.onMouseClick?function(e){s.onMouseClick(e,i),i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("click",e))}:null,l=s.onTouchStart?function(e){s.onTouchStart(e,i),e.preventDefault(),i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("touchstart",e))}:null,u=function(e){i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mousedown",e))},A=function(e){i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mouseup",e))},c=function(e){i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mousemove",e))},d=s.onContextMenu?function(e){s.onContextMenu(e,i)}:null,p=function(e){i.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent("wheel",e))};return i._originDot=new je(i._container,{fillColor:i._color,borderColor:i._borderColor,zIndex:void 0!==e.zIndex?e.zIndex+2:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._targetDot=new je(i._container,{fillColor:i._color,borderColor:i._borderColor,zIndex:void 0!==e.zIndex?e.zIndex+2:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._lengthWire=new He(i._container,{color:i._color,thickness:1,thicknessClickable:6,zIndex:void 0!==e.zIndex?e.zIndex+1:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._lengthLabel=new Ge(i._container,{fillColor:i._color||"#0065FC",prefix:"",text:"",zIndex:void 0!==e.zIndex?e.zIndex+4:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._xAxisWire=new He(i._container,{color:"#FF0000",thickness:1,thicknessClickable:6,zIndex:void 0!==e.zIndex?e.zIndex+1:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._yAxisWire=new He(i._container,{color:"green",thickness:1,thicknessClickable:6,zIndex:void 0!==e.zIndex?e.zIndex+1:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._zAxisWire=new He(i._container,{color:"blue",thickness:1,thicknessClickable:6,zIndex:void 0!==e.zIndex?e.zIndex+1:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._xAxisLabel=new Ge(i._container,{fillColor:"red",prefix:"X",text:"",zIndex:void 0!==e.zIndex?e.zIndex+3:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._yAxisLabel=new Ge(i._container,{fillColor:"green",prefix:"Y",text:"",zIndex:void 0!==e.zIndex?e.zIndex+3:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._zAxisLabel=new Ge(i._container,{fillColor:"blue",prefix:"Z",text:"",zIndex:void 0!==e.zIndex?e.zIndex+3:void 0,onMouseOver:n,onMouseLeave:o,onMouseWheel:p,onMouseDown:u,onMouseClick:a,onTouchStart:l,onMouseUp:A,onMouseMove:c,onContextMenu:d}),i._wpDirty=!1,i._vpDirty=!1,i._cpDirty=!1,i._sectionPlanesDirty=!0,i._visible=!1,i._originVisible=!1,i._targetVisible=!1,i._wireVisible=!1,i._axisVisible=!1,i._xAxisVisible=!1,i._yAxisVisible=!1,i._zAxisVisible=!1,i._axisEnabled=!0,i._labelsVisible=!1,i._labelsOnWires=!1,i._clickable=!1,i._originMarker.on("worldPos",(function(e){i._originWorld.set(e||[0,0,0]),i._wpDirty=!0,i._needUpdate(0)})),i._targetMarker.on("worldPos",(function(e){i._targetWorld.set(e||[0,0,0]),i._wpDirty=!0,i._needUpdate(0)})),i._onViewMatrix=r.camera.on("viewMatrix",(function(){i._vpDirty=!0,i._needUpdate(0)})),i._onProjMatrix=r.camera.on("projMatrix",(function(){i._cpDirty=!0,i._needUpdate()})),i._onCanvasBoundary=r.canvas.on("boundary",(function(){i._cpDirty=!0,i._needUpdate(0)})),i._onMetricsUnits=r.metrics.on("units",(function(){i._cpDirty=!0,i._needUpdate()})),i._onMetricsScale=r.metrics.on("scale",(function(){i._cpDirty=!0,i._needUpdate()})),i._onMetricsOrigin=r.metrics.on("origin",(function(){i._cpDirty=!0,i._needUpdate()})),i._onSectionPlaneUpdated=r.on("sectionPlaneUpdated",(function(){i._sectionPlanesDirty=!0,i._needUpdate()})),i.precision=void 0!==s.precision?s.precision:2,i.approximate=void 0===s.approximate||s.approximate,i.visible=s.visible,i.originVisible=s.originVisible,i.targetVisible=s.targetVisible,i.wireVisible=s.wireVisible,i.axisVisible=s.axisVisible,i.xAxisVisible=s.xAxisVisible,i.yAxisVisible=s.yAxisVisible,i.zAxisVisible=s.zAxisVisible,i.labelsVisible=s.labelsVisible,i.labelsOnWires=s.labelsOnWires,i._xLabel=null,i._yLabel=null,i._zLabel=null,i}return m(t,_e),w(t,[{key:"_update",value:function(){if(this._visible){var e=this.plugin.viewer.scene;if(this._wpDirty&&(this._wp[0]=this._originWorld[0],this._wp[1]=this._originWorld[1],this._wp[2]=this._originWorld[2],this._wp[3]=1,this._wp[4]=this._targetWorld[0],this._wp[5]=this._originWorld[1],this._wp[6]=this._originWorld[2],this._wp[7]=1,this._wp[8]=this._targetWorld[0],this._wp[9]=this._targetWorld[1],this._wp[10]=this._originWorld[2],this._wp[11]=1,this._wp[12]=this._targetWorld[0],this._wp[13]=this._targetWorld[1],this._wp[14]=this._targetWorld[2],this._wp[15]=1,this._wpDirty=!1,this._vpDirty=!0),this._vpDirty&&(J.transformPositions4(e.camera.viewMatrix,this._wp,this._vp),this._vp[3]=1,this._vp[7]=1,this._vp[11]=1,this._vp[15]=1,this._vpDirty=!1,this._cpDirty=!0),this._sectionPlanesDirty){if(this._isSliced(this._originWorld)||this._isSliced(this._targetWorld))return this._xAxisLabel.setCulled(!0),this._yAxisLabel.setCulled(!0),this._zAxisLabel.setCulled(!0),this._lengthLabel.setCulled(!0),this._xAxisWire.setCulled(!0),this._yAxisWire.setCulled(!0),this._zAxisWire.setCulled(!0),this._lengthWire.setCulled(!0),this._originDot.setCulled(!0),void this._targetDot.setCulled(!0);this._xAxisLabel.setCulled(!1),this._yAxisLabel.setCulled(!1),this._zAxisLabel.setCulled(!1),this._lengthLabel.setCulled(!1),this._xAxisWire.setCulled(!1),this._yAxisWire.setCulled(!1),this._zAxisWire.setCulled(!1),this._lengthWire.setCulled(!1),this._originDot.setCulled(!1),this._targetDot.setCulled(!1),this._sectionPlanesDirty=!0}var t=this._originMarker.viewPos[2],i=this._targetMarker.viewPos[2];if(t>-.3||i>-.3)return this._xAxisLabel.setCulled(!0),this._yAxisLabel.setCulled(!0),this._zAxisLabel.setCulled(!0),this._lengthLabel.setCulled(!0),this._xAxisWire.setVisible(!1),this._yAxisWire.setVisible(!1),this._zAxisWire.setVisible(!1),this._lengthWire.setVisible(!1),this._originDot.setVisible(!1),void this._targetDot.setVisible(!1);if(this._cpDirty){J.transformPositions4(e.camera.project.matrix,this._vp,this._pp);for(var s=this._pp,r=this._cp,n=e.canvas.canvas.getBoundingClientRect(),o=this._container.getBoundingClientRect(),a=n.top-o.top,l=n.left-o.left,u=e.canvas.boundary,A=u[2],c=u[3],h=0,d=this.plugin.viewer.scene.metrics,p=d.scale,f=d.units,v=d.unitsInfo[f].abbrev,g=0,m=s.length;g<m;g+=4)r[h]=l+Math.floor((1+s[g+0]/s[g+3])*A/2),r[h+1]=a+Math.floor((1-s[g+1]/s[g+3])*c/2),h+=2;if(this._originDot.setPos(r[0],r[1]),this._targetDot.setPos(r[6],r[7]),this._lengthWire.setStartAndEnd(r[0],r[1],r[6],r[7]),this._xAxisWire.setStartAndEnd(r[0],r[1],r[2],r[3]),this._yAxisWire.setStartAndEnd(r[2],r[3],r[4],r[5]),this._zAxisWire.setStartAndEnd(r[4],r[5],r[6],r[7]),this.labelsVisible){if(this._lengthLabel.setPosOnWire(r[0],r[1],r[6],r[7]),this.labelsOnWires)this._xAxisLabel.setPosOnWire(r[0],r[1],r[2],r[3]),this._yAxisLabel.setPosOnWire(r[2],r[3],r[4],r[5]),this._zAxisLabel.setPosOnWire(r[4],r[5],r[6],r[7]);else{var _=35;this._xAxisLabel.setPosOnWire(r[0],r[1]+_,r[6],r[7]+_),_+=35,this._yAxisLabel.setPosOnWire(r[0],r[1]+_,r[6],r[7]+_),_+=35,this._zAxisLabel.setPosOnWire(r[0],r[1]+_,r[6],r[7]+_)}var y=this._approximate?" ":" = ";this._length=Math.abs(J.lenVec3(J.subVec3(this._targetWorld,this._originWorld,kh))),this._lengthLabel.setText(y+(this._length*p).toFixed(this._precision)+v);var b=Math.abs(Fh(r[0],r[1],r[2],r[3])),B=Math.abs(Fh(r[2],r[3],r[4],r[5])),x=Math.abs(Fh(r[4],r[5],r[6],r[7])),w=this.plugin.labelMinAxisLength;this.labelsOnWires?(this._xAxisLabelCulled=b<w,this._yAxisLabelCulled=B<w,this._zAxisLabelCulled=x<w):(this._xAxisLabelCulled=!1,this._yAxisLabelCulled=!1,this._zAxisLabelCulled=!1),this._xAxisLabelCulled?this._xAxisLabel.setCulled(!0):(this._xLabel=Math.abs((this._targetWorld[0]-this._originWorld[0])*p).toFixed(this._precision),this._xAxisLabel.setText(y+this._xLabel+v),this._xAxisLabel.setCulled(!this.axisVisible)),this._yAxisLabelCulled?this._yAxisLabel.setCulled(!0):(this._yLabel=Math.abs((this._targetWorld[1]-this._originWorld[1])*p).toFixed(this._precision),this._yAxisLabel.setText(y+this._yLabel+v),this._yAxisLabel.setCulled(!this.axisVisible)),this._zAxisLabelCulled?this._zAxisLabel.setCulled(!0):(this._zLabel=Math.abs((this._targetWorld[2]-this._originWorld[2])*p).toFixed(this._precision),this._zAxisLabel.setText(y+this._zLabel+v),this._zAxisLabel.setCulled(!this.axisVisible))}else this._lengthLabel.setCulled(!0),this._xAxisLabel.setCulled(!0),this._yAxisLabel.setCulled(!0),this._zAxisLabel.setCulled(!0);this._originDot.setVisible(this._visible&&this._originVisible),this._targetDot.setVisible(this._visible&&this._targetVisible),this._xAxisWire.setVisible(this.axisVisible&&this.xAxisVisible),this._yAxisWire.setVisible(this.axisVisible&&this.yAxisVisible),this._zAxisWire.setVisible(this.axisVisible&&this.zAxisVisible),this._lengthWire.setVisible(this.wireVisible),this._lengthLabel.setCulled(!this.wireVisible),this._cpDirty=!1}}}},{key:"_isSliced",value:function(e){for(var t=this.scene._sectionPlanesState.sectionPlanes,i=0,s=t.length;i<s;i++){var r=t[i];if(J.planeClipsPositions3(r.pos,r.dir,e,4))return!0}return!1}},{key:"approximate",get:function(){return this._approximate},set:function(e){e=!1!==e,this._approximate!==e&&(this._approximate=e,this._cpDirty=!0,this._needUpdate(0))}},{key:"precision",get:function(){return this._precision},set:function(e){this._precision!==e&&(this._precision=e,this._cpDirty=!0,this._needUpdate(0))}},{key:"origin",get:function(){return this._originMarker}},{key:"target",get:function(){return this._targetMarker}},{key:"length",get:function(){this._update();var e=this.plugin.viewer.scene.metrics.scale;return this._length*e}},{key:"color",get:function(){return this._color},set:function(e){this._color=e,this._originDot.setFillColor(e),this._targetDot.setFillColor(e),this._lengthWire.setColor(e||"#0065FC"),this._lengthLabel.setFillColor(e||"#0065FC")}},{key:"visible",get:function(){return this._visible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultVisible,this._visible=e,this._originDot.setVisible(this._visible&&this._originVisible),this._targetDot.setVisible(this._visible&&this._targetVisible),this._lengthWire.setVisible(this._visible&&this._wireVisible),this._lengthLabel.setVisible(this._visible&&this._wireVisible);var t=this._visible&&this._axisVisible&&this._xAxisVisible,i=this._visible&&this._axisVisible&&this._yAxisVisible,s=this._visible&&this._axisVisible&&this._zAxisVisible;this._xAxisWire.setVisible(t),this._yAxisWire.setVisible(i),this._zAxisWire.setVisible(s),this._xAxisLabel.setVisible(t&&!this._xAxisLabelCulled),this._yAxisLabel.setVisible(i&&!this._yAxisLabelCulled),this._zAxisLabel.setVisible(s&&!this._zAxisLabelCulled),this._cpDirty=!0,this._needUpdate()}},{key:"originVisible",get:function(){return this._originVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultOriginVisible,this._originVisible=e,this._originDot.setVisible(this._visible&&this._originVisible)}},{key:"targetVisible",get:function(){return this._targetVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultTargetVisible,this._targetVisible=e,this._targetDot.setVisible(this._visible&&this._targetVisible)}},{key:"xLabel",get:function(){return this._xLabel}},{key:"yLabel",get:function(){return this._yLabel}},{key:"zLabel",get:function(){return this._zLabel}},{key:"axisEnabled",get:function(){return this._axisEnabled},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultAxisVisible,this._axisEnabled=e;var t=this._visible&&this._axisVisible&&this._axisEnabled;this._xAxisWire.setVisible(t&&this._xAxisVisible),this._yAxisWire.setVisible(t&&this._yAxisVisible),this._zAxisWire.setVisible(t&&this._zAxisVisible),this._xAxisLabel.setVisible(t&&!this._xAxisLabelCulled&&this._xAxisVisible),this._yAxisLabel.setVisible(t&&!this._yAxisLabelCulled&&this._xAxisVisible),this._zAxisLabel.setVisible(t&&!this._zAxisLabelCulled&&this._xAxisVisible),this._cpDirty=!0,this._needUpdate()}},{key:"axisVisible",get:function(){return this._axisVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultAxisVisible,this._axisVisible=e;var t=this._visible&&this._axisVisible&&this._axisEnabled;this._xAxisWire.setVisible(t&&this._xAxisVisible),this._yAxisWire.setVisible(t&&this._yAxisVisible),this._zAxisWire.setVisible(t&&this._zAxisVisible),this._xAxisLabel.setVisible(t&&!this._xAxisLabelCulled&&this._xAxisVisible),this._yAxisLabel.setVisible(t&&!this._yAxisLabelCulled&&this._yAxisVisible),this._zAxisLabel.setVisible(t&&!this._zAxisLabelCulled&&this._zAxisVisible),this._cpDirty=!0,this._needUpdate()}},{key:"xAxisVisible",get:function(){return this._xAxisVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultAxisVisible,this._xAxisVisible=e;var t=this._visible&&this._axisVisible&&this._xAxisVisible&&this._axisEnabled;this._xAxisWire.setVisible(t),this._xAxisLabel.setVisible(t&&!this._xAxisLabelCulled),this._cpDirty=!0,this._needUpdate()}},{key:"yAxisVisible",get:function(){return this._yAxisVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultAxisVisible,this._yAxisVisible=e;var t=this._visible&&this._axisVisible&&this._yAxisVisible&&this._axisEnabled;this._yAxisWire.setVisible(t),this._yAxisLabel.setVisible(t&&!this._yAxisLabelCulled),this._cpDirty=!0,this._needUpdate()}},{key:"zAxisVisible",get:function(){return this._zAxisVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultAxisVisible,this._zAxisVisible=e;var t=this._visible&&this._axisVisible&&this._zAxisVisible&&this._axisEnabled;this._zAxisWire.setVisible(t),this._zAxisLabel.setVisible(t&&!this._zAxisLabelCulled),this._cpDirty=!0,this._needUpdate()}},{key:"wireVisible",get:function(){return this._wireVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultWireVisible,this._wireVisible=e;var t=this._visible&&this._wireVisible;this._lengthLabel.setVisible(t),this._lengthWire.setVisible(t)}},{key:"labelsVisible",get:function(){return this._labelsVisible},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultLabelsVisible,this._labelsVisible=e;var t=this._visible&&this._labelsVisible;this._xAxisLabel.setVisible(t&&!this._xAxisLabelCulled&&this._clickable&&this._axisEnabled),this._yAxisLabel.setVisible(t&&!this._yAxisLabelCulled&&this._clickable&&this._axisEnabled),this._zAxisLabel.setVisible(t&&!this._zAxisLabelCulled&&this._clickable&&this._axisEnabled),this._lengthLabel.setVisible(t),this._cpDirty=!0,this._needUpdate()}},{key:"labelsOnWires",get:function(){return this._labelsOnWires},set:function(e){e=void 0!==e?Boolean(e):this.plugin.defaultLabelsOnWires,this._labelsOnWires=e}},{key:"setHighlighted",value:function(e){this._originDot.setHighlighted(e),this._targetDot.setHighlighted(e),this._xAxisWire.setHighlighted(e),this._yAxisWire.setHighlighted(e),this._zAxisWire.setHighlighted(e),this._xAxisLabel.setHighlighted(e),this._yAxisLabel.setHighlighted(e),this._zAxisLabel.setHighlighted(e),this._lengthWire.setHighlighted(e),this._lengthLabel.setHighlighted(e)}},{key:"clickable",get:function(){return this._clickable},set:function(e){e=!!e,this._clickable=e,this._originDot.setClickable(this._clickable),this._targetDot.setClickable(this._clickable),this._xAxisWire.setClickable(this._clickable),this._yAxisWire.setClickable(this._clickable),this._zAxisWire.setClickable(this._clickable),this._lengthWire.setClickable(this._clickable),this._xAxisLabel.setClickable(this._clickable),this._yAxisLabel.setClickable(this._clickable),this._zAxisLabel.setClickable(this._clickable),this._lengthLabel.setClickable(this._clickable)}},{key:"destroy",value:function(){var e=this.plugin.viewer.scene,i=e.metrics;this._onViewMatrix&&e.camera.off(this._onViewMatrix),this._onProjMatrix&&e.camera.off(this._onProjMatrix),this._onCanvasBoundary&&e.canvas.off(this._onCanvasBoundary),this._onMetricsUnits&&i.off(this._onMetricsUnits),this._onMetricsScale&&i.off(this._onMetricsScale),this._onMetricsOrigin&&i.off(this._onMetricsOrigin),this._onSectionPlaneUpdated&&e.off(this._onSectionPlaneUpdated),this._originDot.destroy(),this._targetDot.destroy(),this._xAxisWire.destroy(),this._yAxisWire.destroy(),this._zAxisWire.destroy(),this._lengthLabel.destroy(),this._xAxisLabel.destroy(),this._yAxisLabel.destroy(),this._zAxisLabel.destroy(),this._lengthWire.destroy(),f(t,"destroy",this,3)([])}}])}(),Dh=function(e){function t(){return B(this,t),h(this,t,arguments)}return m(t,_e),w(t,[{key:"active",get:function(){},set:function(e){}},{key:"snapping",get:function(){return!0},set:function(e){}},{key:"activate",value:function(){}},{key:"deactivate",value:function(){}},{key:"reset",value:function(){}},{key:"destroy",value:function(){}}])}(),Ih=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e.viewer.scene])).cfg=s,i.pointerLens=s.pointerLens,i._active=!1,i._activate=!1,i._currentDistanceMeasurement=null,i._currentDistanceMeasurementInitState={wireVisible:null,axisVisible:null,xAxisVisible:null,yaxisVisible:null,zAxisVisible:null,targetVisible:null},i._initMarkerDiv(),i._onMouseDown=null,i._onMouseUp=null,i._onCanvasTouchStart=null,i._onCanvasTouchEnd=null,i._snapping=!1!==s.snapping,i._mouseState=0,i._attachPlugin(e,s),i._offsetX=0|s._offsetX,i._offsetY=0|s._offsetY,i}return m(t,Dh),w(t,[{key:"_initMarkerDiv",value:function(){var e=document.createElement("div");e.setAttribute("id","myDistancePivotMarker");var t=this.scene.canvas.canvas;t.parentNode.insertBefore(e,t),e.style.background="black",e.style.border="2px solid blue",e.style.borderRadius="10px",e.style.width="5px",e.style.height="5px",e.style.margin="-200px -200px",e.style.zIndex="100",e.style.position="absolute",e.style.pointerEvents="none",this._markerDiv=e}},{key:"_destroyMarkerDiv",value:function(){this._markerDiv&&(this._markerDiv.parentNode.removeChild(this._markerDiv),this._markerDiv=null)}},{key:"_attachPlugin",value:function(e){this.distanceMeasurementsPlugin=e,this.plugin=e}},{key:"offsetX",get:function(){return this._offsetX},set:function(e){this._offsetX=e}},{key:"offsetY",get:function(){return this._offsetY},set:function(e){this._offsetY=e}},{key:"active",get:function(){return this._active},set:function(e){this._active=e}},{key:"snapping",get:function(){return this._snapping},set:function(e){this._snapping=e}},{key:"mouseState",get:function(){return this._mouseState},set:function(e){this._mouseState=e}},{key:"activate",value:function(){var e=this;if(!this._activate){this._markerDiv||this._initMarkerDiv(),this.fire("activated",!0);var t=this.distanceMeasurementsPlugin,i=!1;t.on("mouseOver",(function(e){i=!0})),t.on("mouseLeave",(function(e){i=!1})),t.on("measureDelete",(function(e){i=!1})),t.on("measurementDestroyed",(function(e){}));var s,r,n=this.scene,o=t.viewer.cameraControl,a=n.canvas.canvas,l=!1,u=J.vec3(),A=J.vec2(),c=null;this._mouseState=0;var h=function(t){if(e._active&&!i){var s=t.snappedCanvasPos||t.canvasPos;if(l=!0,u.set(t.worldPos),A.set(t.canvasPos),0===e._mouseState){var r=document.documentElement.scrollLeft,n=document.documentElement.scrollTop;e._markerDiv.style.marginLeft="".concat(e._offsetX+r+s[0]-5,"px"),e._markerDiv.style.marginTop="".concat(e._offsetY+n+s[1]-5,"px"),e._markerDiv.style.background="pink",t.snappedToVertex||t.snappedToEdge?(e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=t.canvasPos,e.pointerLens.snappedCanvasPos=t.snappedCanvasPos||t.canvasPos,e.pointerLens.snapped=!0),e._markerDiv.style.background="greenyellow",e._markerDiv.style.border="2px solid green"):(e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=t.canvasPos,e.pointerLens.snappedCanvasPos=t.canvasPos,e.pointerLens.snapped=!1),e._markerDiv.style.background="pink",e._markerDiv.style.border="2px solid red"),c=t.entity}else e._markerDiv.style.marginLeft="-10000px",e._markerDiv.style.marginTop="-10000px";a.style.cursor="pointer",e._currentDistanceMeasurement&&(e._currentDistanceMeasurement.wireVisible=e._currentDistanceMeasurementInitState.wireVisible,e._currentDistanceMeasurement.axisVisible=e._currentDistanceMeasurementInitState.axisVisible&&e.distanceMeasurementsPlugin.defaultAxisVisible,e._currentDistanceMeasurement.xAxisVisible=e._currentDistanceMeasurementInitState.xAxisVisible&&e.distanceMeasurementsPlugin.defaultXAxisVisible,e._currentDistanceMeasurement.yAxisVisible=e._currentDistanceMeasurementInitState.yAxisVisible&&e.distanceMeasurementsPlugin.defaultYAxisVisible,e._currentDistanceMeasurement.zAxisVisible=e._currentDistanceMeasurementInitState.zAxisVisible&&e.distanceMeasurementsPlugin.defaultZAxisVisible,e._currentDistanceMeasurement.targetVisible=e._currentDistanceMeasurementInitState.targetVisible,e._currentDistanceMeasurement.target.worldPos=u.slice(),e._markerDiv.style.marginLeft="-10000px",e._markerDiv.style.marginTop="-10000px")}};this._onHoverSnapOrSurface=o.on("hoverSnapOrSurface",(function(t){e._snapping&&h(t)})),this._onHoverSurface=o.on("hoverSurface",(function(t){e._snapping||h(t)})),a.addEventListener("mousedown",this._onMouseDown=function(t){e._active&&1===t.which&&(s=t.clientX,r=t.clientY)}),a.addEventListener("mouseup",this._onMouseUp=function(n){e._active&&(i||1===n.which&&(n.clientX>s+20||n.clientX<s-20||n.clientY>r+20||n.clientY<r-20||(e._currentDistanceMeasurement?l?(e._currentDistanceMeasurement.target.entity=c,c=null,e._currentDistanceMeasurement.clickable=!0,e.distanceMeasurementsPlugin.fire("measurementEnd",e._currentDistanceMeasurement),e._currentDistanceMeasurement=null):(e._currentDistanceMeasurement.destroy(),e.distanceMeasurementsPlugin.fire("measurementCancel",e._currentDistanceMeasurement),e._currentDistanceMeasurement=null,c=null):l&&(e._currentDistanceMeasurement=t.createMeasurement({id:J.createUUID(),origin:{worldPos:u.slice()},target:{worldPos:u.slice()},precision:t.precision,approximate:!0}),e._currentDistanceMeasurementInitState.axisVisible=e._currentDistanceMeasurement.axisVisible&&e.distanceMeasurementsPlugin.defaultAxisVisible,e._currentDistanceMeasurementInitState.xAxisVisible=e._currentDistanceMeasurement.xAxisVisible&&e.distanceMeasurementsPlugin.defaultXAxisVisible,e._currentDistanceMeasurementInitState.yAxisVisible=e._currentDistanceMeasurement.yAxisVisible&&e.distanceMeasurementsPlugin.defaultYAxisVisible,e._currentDistanceMeasurementInitState.zAxisVisible=e._currentDistanceMeasurement.zAxisVisible&&e.distanceMeasurementsPlugin.defaultZAxisVisible,e._currentDistanceMeasurementInitState.wireVisible=e._currentDistanceMeasurement.wireVisible,e._currentDistanceMeasurementInitState.targetVisible=e._currentDistanceMeasurement.targetVisible,e._currentDistanceMeasurement.clickable=!1,e._currentDistanceMeasurement.origin.entity=c,c=null,e.fire("measurementStart",e._currentDistanceMeasurement)))))}),this.markerHidden=function(t){e._markerDiv&&t.target!==a&&(e._markerDiv.style.marginLeft="-100px",e._markerDiv.style.marginTop="-100px")},document.addEventListener("mousemove",this.markerHidden);var d=function(t){e._active&&(e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=t.canvasPos,e.pointerLens.snappedCanvasPos=t.snappedCanvasPos||t.canvasPos),l=!1,e._markerDiv.style.marginLeft="-100px",e._markerDiv.style.marginTop="-100px",e._currentDistanceMeasurement&&(e._currentDistanceMeasurement.wireVisible=!1,e._currentDistanceMeasurement.targetVisible=!1,e._currentDistanceMeasurement.axisVisible=!1),a.style.cursor="default")};this._onHoverSnapOrSurfaceOff=o.on("hoverSnapOrSurfaceOff",(function(t){e._snapping&&d(t)})),this._onHoverOff=o.on("hoverOff",(function(t){e._snapping||d(t)})),this._activate=!0}}},{key:"deactivate",value:function(){if(this._active){this.fire("activated",!1),this.pointerLens&&(this.pointerLens.visible=!1),this.reset();var e=this.scene.canvas.canvas;e.removeEventListener("mousedown",this._onMouseDown),e.removeEventListener("mouseup",this._onMouseUp);var t=this.distanceMeasurementsPlugin.viewer.cameraControl;t.off(this._onHoverSnapOrSurface),t.off(this._onHoverSurface),t.off(this._onHoverSnapOrSurfaceOff),t.off(this._onHoverOff),document.removeEventListener("mousemove",this.markerHidden),this._currentDistanceMeasurement&&(this.distanceMeasurementsPlugin.fire("measurementCancel",this._currentDistanceMeasurement),this._currentDistanceMeasurement.destroy(),this._currentDistanceMeasurement=null),this._active=!1}}},{key:"reset",value:function(){this._active&&this._currentDistanceMeasurement&&(this.distanceMeasurementsPlugin.fire("measurementCancel",this._currentDistanceMeasurement),this._currentDistanceMeasurement.destroy(),this._currentDistanceMeasurement=null)}},{key:"destroy",value:function(){this.deactivate(),this._destroyMarkerDiv(),this.pointerLens&&this.pointerLens.destroy(),f(t,"destroy",this,3)([])}}])}(),Sh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,["DistanceMeasurements",e]))._pointerLens=s.pointerLens,i._container=s.container||e.viewerElement||document.body,i._defaultControl=null,i._measurements={},i.labelMinAxisLength=s.labelMinAxisLength,i.defaultVisible=!1!==s.defaultVisible,i.defaultOriginVisible=!1!==s.defaultOriginVisible,i.defaultTargetVisible=!1!==s.defaultTargetVisible,i.defaultWireVisible=!1!==s.defaultWireVisible,i.defaultLabelsVisible=!1!==s.defaultLabelsVisible,i.defaultAxisVisible=!1!==s.defaultAxisVisible,i.defaultXAxisVisible=!1!==s.defaultXAxisVisible,i.defaultYAxisVisible=!1!==s.defaultYAxisVisible,i.defaultZAxisVisible=!1!==s.defaultZAxisVisible,i.defaultLabelsOnWires=!1!==s.defaultLabelsOnWires,i.defaultColor=void 0!==s.defaultColor?s.defaultColor:"#0065fc",i.zIndex=s.zIndex||1e4,i.precision=void 0!==s.precision?s.precision:2,i._onMouseOver=function(e,t){i.fire("mouseOver",{plugin:i,distanceMeasurement:t,measurement:t,event:e})},i._onMouseLeave=function(e,t){i.fire("mouseLeave",{plugin:i,distanceMeasurement:t,measurement:t,event:e})},i._onMouseClick=function(e,t){i.fire("clickMeasure",{plugin:i,distanceMeasurement:t,measurement:t,event:e})},i._onTouchStart=function(e,t){i.fire("touchMeasure",{plugin:i,distanceMeasurement:t,measurement:t,event:e})},i._onContextMenu=function(e,t){i.fire("contextMenu",{plugin:i,distanceMeasurement:t,measurement:t,event:e})},i}return m(t,me),w(t,[{key:"precision",get:function(){return this._precision},set:function(e){if(this._precision!=e&&(this._precision=e,this.measureNum>0))for(var t in this.measurements)this.measurements[t].precision=e}},{key:"scale",get:function(){return this._scale},set:function(e){if(this._scale!=e&&(this._scale=e,this.measureNum>0))for(var t in this.measurements)this.measurements[t].scale=e}},{key:"measureNum",get:function(){return Object.keys(this.measurements).length}},{key:"getContainerElement",value:function(){return this._container}},{key:"send",value:function(e,t){}},{key:"pointerLens",get:function(){return this._pointerLens}},{key:"control",get:function(){return this._defaultControl||(this._defaultControl=new Ih(this,{})),this._defaultControl}},{key:"measurements",get:function(){return this._measurements}},{key:"labelMinAxisLength",get:function(){return this._labelMinAxisLength},set:function(e){e<1&&(this.error("labelMinAxisLength must be >= 1; defaulting to 25"),e=25),this._labelMinAxisLength=e||25}},{key:"createMeasurement",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.viewer.scene.components[t.id]&&(this.error("Viewer scene component with this ID already exists: "+t.id),delete t.id);var i=t.origin,s=t.target,r=new Eh(this,{id:t.id,plugin:this,container:this._container,origin:{entity:i.entity,worldPos:i.worldPos},target:{entity:s.entity,worldPos:s.worldPos},borderColor:t.borderColor,color:t.color,visible:t.visible,originVisible:t.originVisible,targetVisible:t.targetVisible,wireVisible:t.wireVisible,axisVisible:!1!==t.axisVisible&&!1!==this.defaultAxisVisible,xAxisVisible:!1!==t.xAxisVisible&&!1!==this.defaultXAxisVisible,yAxisVisible:!1!==t.yAxisVisible&&!1!==this.defaultYAxisVisible,zAxisVisible:!1!==t.zAxisVisible&&!1!==this.defaultZAxisVisible,labelsVisible:!1!==t.labelsVisible&&!1!==this.defaultLabelsVisible,labelsOnWires:!1!==t.labelsOnWires&&!1!==this.defaultLabelsOnWires,onMouseOver:this._onMouseOver,onMouseLeave:this._onMouseLeave,onMouseClick:this._onMouseClick,onTouchStart:this._onTouchStart,onContextMenu:this._onContextMenu,precision:this._precision});return this._measurements[r.id]=r,r.on("destroyed",(function(){delete e._measurements[r.id]})),this.fire("measurementCreated",r),r}},{key:"destroyMeasurement",value:function(e){var t=this._measurements[e];t?(t.destroy(),this.fire("measurementDestroyed",t)):this.log("DistanceMeasurement not found: "+e)}},{key:"setLabelsShown",value:function(e){for(var t=0,i=Object.entries(this.measurements);t<i.length;t++){var s=u(i[t],2);s[0];s[1].labelShown=e}}},{key:"setMeasurementsShown",value:function(e){for(var t in this.measurements)this.measurements[t].visible=e}},{key:"setAxisVisible",value:function(e){for(var t=0,i=Object.entries(this.measurements);t<i.length;t++){var s=u(i[t],2);s[0];s[1].axisVisible=e}this.defaultAxisVisible=e}},{key:"getAxisVisible",value:function(){return this.defaultAxisVisible}},{key:"clear",value:function(){for(var e=Object.keys(this._measurements),t=0,i=e.length;t<i;t++)this.destroyMeasurement(e[t])}},{key:"destroy",value:function(){this.clear(),f(t,"destroy",this,3)([])}}])}(),Th=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e.viewer.scene])).pointerLens=s.pointerLens,i.pointerCircle=new Ze(e.viewer,{id:"distanceMeasure_Circle"}),i._active=!1,i._activate=!1,i._initMarkerDiv(),i._currentDistanceMeasurement=null,i._currentDistanceMeasurementInitState={wireVisible:null,axisVisible:null,xAxisVisible:null,yaxisVisible:null,zAxisVisible:null,targetVisible:null},i._onCanvasTouchStart=null,i._onCanvasTouchEnd=null,i._longTouchTimeoutMs=300,i._snapping=!1!==s.snapping,i._snapToEdge=!1!==s.snapping,i._snapToVertex=!1!==s.snapping,i._touchState=0,i._attachPlugin(e,s),i._offsetX=0|s._offsetX,i._offsetY=0|s._offsetY,i}return m(t,Dh),w(t,[{key:"_initMarkerDiv",value:function(){var e=document.createElement("div");e.setAttribute("id","myDistanceMeasureTouchMarker");var t=this.scene.canvas.canvas;t.parentNode.insertBefore(e,t),e.style.background="black",e.style.border="2px solid blue",e.style.borderRadius="10px",e.style.width="5px",e.style.height="5px",e.style.margin="-200px -200px",e.style.zIndex="100",e.style.position="absolute",e.style.pointerEvents="none",this.markerDiv=e}},{key:"_destroyMarkerDiv",value:function(){this.markerDiv&&(this.markerDiv.parentNode.removeChild(this.markerDiv),this.markerDiv=null)}},{key:"_attachPlugin",value:function(e){this.distanceMeasurementsPlugin=e,this.plugin=e}},{key:"offsetX",get:function(){return this._offsetX},set:function(e){this._offsetX=e}},{key:"offsetY",get:function(){return this._offsetY},set:function(e){this._offsetY=e}},{key:"active",get:function(){return this._active},set:function(e){this._active=e}},{key:"snapping",get:function(){return this._snapping},set:function(e){e!==this._snapping?(this._snapping=e,this.deactivate(),this.activate()):this._snapping=e}},{key:"touchState",get:function(){return this._touchState},set:function(e){this._touchState=e}},{key:"activate",value:function(){var e=this;if(!this._activate){var t=this.plugin,i=this.scene,s=i.canvas.canvas;this.pointerLens;var r=J.vec3(),n=20,o=null;this._touchState=0;var a=J.vec2(),l=J.vec2(),u=J.vec2(),A=null,c=function(){e.plugin.viewer.cameraControl.active=!1},h=function(){e.plugin.viewer.cameraControl.active=!0};s.addEventListener("touchstart",this._onCanvasTouchStart=function(s){if(e._active&&s.isTrusted){var u=s.touches.length;if(1===u){var d=s.touches[0],p=d.clientX,f=d.clientY;switch(a.set([p+e.offsetX,f+e.offsetY]),l.set([p+e.offsetX,f+e.offsetY]),e._touchState){case 0:if(1!==u&&null!==o)return o&&(clearTimeout(o),o=null),e._currentDistanceMeasurement&&(e._currentDistanceMeasurement.destroy(),e._currentDistanceMeasurement=null),h(),void(e._touchState=0);var v=i.pick({canvasPos:l,snapping:e._snapping,snapToEdge:e._snapping});if(v&&v.snapped)r.set(v.worldPos),e.pointerCircle.start(v.snappedCanvasPos);else{var g=i.pick({canvasPos:l,pickSurface:!0});if(!g||!g.worldPos)return;r.set(g.worldPos),e.pointerCircle.start(g.canvasPos)}o=setTimeout((function(){1!==u||l[0]>a[0]+n||l[0]<a[0]-n||l[1]>a[1]+n||l[1]<a[1]-n||(e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=a,e.pointerLens.cursorPos=a),e.pointerLens&&(e.pointerLens.canvasPos=l,e.pointerLens.snapped=!1),e.pointerLens&&(e.pointerLens.cursorPos=v.canvasPos,e.pointerLens.snapped=!0),e._currentDistanceMeasurement?e._currentDistanceMeasurement.origin.worldPos=r:(e._currentDistanceMeasurement=t.createMeasurement({id:J.createUUID(),origin:{worldPos:r,entity:v.entity},target:{worldPos:r,entity:v.entity},precision:t.precision}),e._currentDistanceMeasurement.labelsVisible=!1,e._currentDistanceMeasurement.xAxisVisible=!1,e._currentDistanceMeasurement.yAxisVisible=!1,e._currentDistanceMeasurement.zAxisVisible=!1,e._currentDistanceMeasurement.wireVisible=!1,e._currentDistanceMeasurement.originVisible=!0,e._currentDistanceMeasurement.targetVisible=!1,e._currentDistanceMeasurement.clickable=!1),e.distanceMeasurementsPlugin.fire("measurementStart",e._currentDistanceMeasurement),e._touchState=2,c())}),e._longTouchTimeoutMs),e._touchState=1,A=d.identifier;break;case 3:if(1!==u&&null!==o)return clearTimeout(o),void(o=null);1===u&&(o=setTimeout((function(){if(o=null,!(1!==u||l[0]>a[0]+n||l[0]<a[0]-n||l[1]>a[1]+n||l[1]<a[1]-n)){e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=a,e.pointerLens.snapped=!1);var t=i.pick({canvasPos:l,snapToVertex:e._snapping,snapToEdge:e._snapping});if(t&&t.snapped)e.pointerLens&&(e.pointerLens.cursorPos=t.snappedCanvasPos,e.pointerLens.snapped=!0),e.pointerCircle.start(t.snappedCanvasPos),r.set(t.worldPos),e._currentDistanceMeasurement.target.worldPos=t.worldPos,e._currentDistanceMeasurement.target.entity=t.entity,e._currentDistanceMeasurement.targetVisible=!0,e._currentDistanceMeasurement.wireVisible=!0,e._currentDistanceMeasurement.labelsVisible=!0,e.distanceMeasurementsPlugin.fire("measurementStart",e._currentDistanceMeasurement);else{var s=i.pick({canvasPos:l,pickSurface:!0});s&&s.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=s.canvasPos,e.pointerLens.snapped=!1),e.pointerCircle.start(s.canvasPos),r.set(s.worldPos),e._currentDistanceMeasurement.target.worldPos=s.worldPos,e._currentDistanceMeasurement.target.entity=s.entity,e._currentDistanceMeasurement.targetVisible=!0,e._currentDistanceMeasurement.wireVisible=!0,e._currentDistanceMeasurement.labelsVisible=!0,e.distanceMeasurementsPlugin.fire("measurementStart",e._currentDistanceMeasurement)):e.pointerLens&&(e.pointerLens.cursorPos=null,e.pointerLens.snapped=!1)}e._touchState=5,c()}}),e._longTouchTimeoutMs),e._touchState=4),A=d.identifier;break;default:return null!==o&&(clearTimeout(o),o=null),void(e._touchState=7)}}else o&&(clearTimeout(o),o=null)}},{passive:!0}),s.addEventListener("touchmove",(function(s){if(e._active){e.pointerCircle.stop();var n=s.touches.length;if(1===n&&1===s.changedTouches.length){var a,u,c=s.touches[0],h=c.clientX,d=c.clientY;if(c.identifier===A)switch(l.set([h+e.offsetX,d+e.offsetY]),e._touchState){case 2:e.pointerLens&&(e.pointerLens.canvasPos=l),(a=i.pick({canvasPos:l,snapToVertex:e._snapping,snapToEdge:e._snapping}))&&a.snapped?(e.pointerLens&&(e.pointerLens.snappedCanvasPos=a.snappedCanvasPos,e.pointerLens.snapped=!0),r.set(a.worldPos),e._currentDistanceMeasurement?e._currentDistanceMeasurement.origin.worldPos=a.worldPos:(e._currentDistanceMeasurement=t.createMeasurement({id:J.createUUID(),origin:{worldPos:a.worldPos,entity:a.entity},target:{worldPos:a.worldPos,entity:a.entity},precision:t.precision}),e._currentDistanceMeasurement.labelsVisible=!1,e._currentDistanceMeasurement.xAxisVisible=!1,e._currentDistanceMeasurement.yAxisVisible=!1,e._currentDistanceMeasurement.zAxisVisible=!1,e._currentDistanceMeasurement.wireVisible=!1,e._currentDistanceMeasurement.originVisible=!0,e._currentDistanceMeasurement.targetVisible=!1,e._currentDistanceMeasurement.clickable=!1),e.distanceMeasurementsPlugin.fire("measurementStart",e._currentDistanceMeasurement)):(u=i.pick({canvasPos:l,pickSurface:!0}))&&u.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=u.canvasPos,e.pointerLens.snapped=!1),r.set(u.worldPos),e._currentDistanceMeasurement?e._currentDistanceMeasurement.origin.worldPos=u.worldPos:(e._currentDistanceMeasurement=t.createMeasurement({id:J.createUUID(),origin:{worldPos:u.worldPos,entity:u.entity},target:{worldPos:u.worldPos,entity:u.entity},precision:t.precision}),e._currentDistanceMeasurement.labelsVisible=!1,e._currentDistanceMeasurement.xAxisVisible=!1,e._currentDistanceMeasurement.yAxisVisible=!1,e._currentDistanceMeasurement.zAxisVisible=!1,e._currentDistanceMeasurement.wireVisible=!1,e._currentDistanceMeasurement.originVisible=!0,e._currentDistanceMeasurement.targetVisible=!1,e._currentDistanceMeasurement.clickable=!1),e.distanceMeasurementsPlugin.fire("measurementStart",e._currentDistanceMeasurement)):e.pointerLens&&(e.pointerLens.cursorPos=null,e.pointerLens.snapped=!1),e._touchState=2;break;case 5:if(1!==n&&null!==o)return clearTimeout(o),o=null,e.pointerLens&&(e.pointerLens.visible=!1),void(e._touchState=7);e.pointerLens&&(e.pointerLens.canvasPos=l),(a=i.pick({canvasPos:l,snapToVertex:e._snapping,snapToEdge:e._snapping}))&&a.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=a.snappedCanvasPos,e.pointerLens.snapped=!0),e._currentDistanceMeasurement.target.worldPos=a.worldPos,e._currentDistanceMeasurement.target.entity=a.entity,e._currentDistanceMeasurement.targetVisible=!0,e._currentDistanceMeasurement.wireVisible=!0,e._currentDistanceMeasurement.labelsVisible=!0):(u=i.pick({canvasPos:l,pickSurface:!0}))&&u.worldPos&&(e.pointerLens&&(e.pointerLens.cursorPos=u.canvasPos,e.pointerLens.snapped=!1),e._currentDistanceMeasurement.target.worldPos=u.worldPos,e._currentDistanceMeasurement.target.entity=u.entity,e._currentDistanceMeasurement.targetVisible=!0,e._currentDistanceMeasurement.wireVisible=!0,e._currentDistanceMeasurement.labelsVisible=!0),e._touchState=5}}else o&&(clearTimeout(o),o=null)}}),{passive:!0}),s.addEventListener("touchend",this._onCanvasTouchEnd=function(s){if(e._active){e.pointerCircle.stop();var r=s.changedTouches.length;if(1===r){var c=s.changedTouches[0],d=c.clientX,p=c.clientY;if(c.identifier===A)switch(o&&(clearTimeout(o),o=null),u.set([d,p]),e._touchState){case 1:if(1!==r||d>a[0]+n||d<a[0]-n||p>a[1]+n||p<a[1]-n)return void(e._touchState=0);var f=i.pick({canvasPos:l,pickSurface:!0});f&&f.worldPos?(e._currentDistanceMeasurement=t.createMeasurement({id:J.createUUID(),origin:{worldPos:f.worldPos,entity:f.entity},target:{worldPos:f.worldPos,entity:f.entity},precision:t.precision}),e._currentDistanceMeasurement.labelsVisible=!1,e._currentDistanceMeasurement.xAxisVisible=!1,e._currentDistanceMeasurement.yAxisVisible=!1,e._currentDistanceMeasurement.zAxisVisible=!1,e._currentDistanceMeasurement.wireVisible=!1,e._currentDistanceMeasurement.originVisible=!0,e._currentDistanceMeasurement.targetVisible=!1,e._touchState=3,e.distanceMeasurementsPlugin.fire("measurementStart",e._currentDistanceMeasurement)):(e._currentDistanceMeasurement&&e._currentDistanceMeasurement.destroy(),e._touchState=0),h();break;case 2:e.pointerLens&&(e.pointerLens.visible=!1),e._currentDistanceMeasurement?e._touchState=3:(e.pointerLens&&(e.pointerLens.snapped=!1,e.pointerLens.visible=!1),e._touchState=0),h();break;case 4:if(1!==r||d>a[0]+n||d<a[0]-n||p>a[1]+n||p<a[1]-n)return void(e._touchState=3);var v=i.pick({canvasPos:l,pickSurface:!0});v&&v.worldPos?(e._currentDistanceMeasurement.target.worldPos=v.worldPos,e._currentDistanceMeasurement.target.entity=v.entity,e._currentDistanceMeasurement.targetVisible=!0,e._currentDistanceMeasurement.wireVisible=!0,e._currentDistanceMeasurement.labelsVisible=!0,e._currentDistanceMeasurement.clickable=!0,e.distanceMeasurementsPlugin.fire("measurementEnd",e._currentDistanceMeasurement),e._currentDistanceMeasurement=null):e._currentDistanceMeasurement&&(e._currentDistanceMeasurement.destroy(),e._currentDistanceMeasurement=null),e._touchState=0,h();break;case 5:e.pointerLens&&(e.pointerLens.visible=!1),e._currentDistanceMeasurement&&e._currentDistanceMeasurement.targetVisible?(e._currentDistanceMeasurement.clickable=!0,e.distanceMeasurementsPlugin.fire("measurementEnd",e._currentDistanceMeasurement),e._currentDistanceMeasurement=null,e._touchState=0):(e._currentDistanceMeasurement&&(e._currentDistanceMeasurement.destroy(),e._currentDistanceMeasurement=null),e._touchState=0),h()}}}},{passive:!0}),s.addEventListener("touchcancel",this._onCanvasTouchEnd),this._activate=!0}}},{key:"deactivate",value:function(){if(this._active){this.pointerLens&&(this.pointerLens.visible=!1),this.reset();var e=this.plugin.viewer.scene.canvas.canvas;e.removeEventListener("touchstart",this._onCanvasTouchStart),e.removeEventListener("touchend",this._onCanvasTouchEnd),e.removeEventListener("touchcancel",this._onCanvasTouchEnd),this._currentDistanceMeasurement&&(this.distanceMeasurementsPlugin.fire("measurementCancel",this._currentDistanceMeasurement),this._currentDistanceMeasurement.destroy(),this._currentDistanceMeasurement=null),this._active=!1,this.plugin.viewer.cameraControl.active=!0}}},{key:"reset",value:function(){this._active&&this._currentDistanceMeasurement&&(this.distanceMeasurementsPlugin.fire("measurementCancel",this._currentDistanceMeasurement),this._currentDistanceMeasurement.destroy(),this._currentDistanceMeasurement=null)}},{key:"destroy",value:function(){this.deactivate(),this._destroyMarkerDiv(),this.pointerLens&&this.pointerLens.destroy(),this.pointerCircle&&this.pointerCircle.destroy(),f(t,"destroy",this,3)([])}}])}(),Lh=function(e){function t(e){var i,s,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(r=h(this,t,[e.viewer.scene])).cfg=n,r.snapRadius=n.snapRadius,r._active=!1,r._mouseState=0,r._currentDistanceMeasurement=null,r._currentDistanceMeasurementInitState={wireVisible:null,axisVisible:null,xAxisVisible:null,yAxisVisible:null,zAxisVisible:null,targetVisible:null},r.distanceMeasurementsPlugin=e,r.plugin=e,r._initMarkerDiv(),r._snapping=!1!==n.snapping,r._offsetX=null!==(i=n._offsetX)&&void 0!==i?i:0,r._offsetY=null!==(s=n._offsetY)&&void 0!==s?s:0,r.hover=!1,r.distanceMeasurementsPlugin.on("mouseOver",(function(e){r.hover=!0})),r.distanceMeasurementsPlugin.on("mouseLeave",(function(e){r.hover=!1})),r.distanceMeasurementsPlugin.on("measureDelete",(function(e){r.hover=!1})),r}return m(t,Dh),w(t,[{key:"_initMarkerDiv",value:function(){var e=document.createElement("div");e.setAttribute("id","myDistancePivotMarker");var t=this.scene.canvas.canvas;t.parentNode.insertBefore(e,t),e.style.background="black",e.style.border="2px solid blue",e.style.borderRadius="10px",e.style.width="5px",e.style.height="5px",e.style.margin="-200px -200px",e.style.zIndex=this.plugin.zIndex?this.plugin.zIndex+3:"1000",e.style.position="absolute",e.style.pointerEvents="none",this._markerDiv=e}},{key:"_destroyMarkerDiv",value:function(){this._markerDiv&&(this._markerDiv.parentNode.removeChild(this._markerDiv),this._markerDiv=null)}},{key:"offsetX",get:function(){return this._offsetX},set:function(e){this._offsetX=e}},{key:"offsetY",get:function(){return this._offsetY},set:function(e){this._offsetY=e}},{key:"active",get:function(){return this._active},set:function(e){this._active=e}},{key:"snapping",get:function(){return this._snapping},set:function(e){this._snapping=e}},{key:"mouseState",get:function(){return this._mouseState},set:function(e){this._mouseState=e}},{key:"activate",value:function(){var e=this;this._markerDiv||this._initMarkerDiv(),this.distanceMeasurementsPlugin.on("measurementDestroyed",(function(e){})),this.canvas=this.scene.canvas.canvas,this.mouseHovering=!1,this.pointerWorldPos=J.vec3(),this.pointerCanvasPos=J.vec2(),this.lastMouseCanvasX,this.lastMouseCanvasY,this.clickTolerance=20,this.hoveredEntity=null,this._mouseState=0,this.markerHidden=function(t){e._markerDiv&&t.target!==e.canvas&&(e._markerDiv.style.marginLeft="-100px",e._markerDiv.style.marginTop="-100px")},document.addEventListener("mousemove",this.markerHidden)}},{key:"onMousedown",value:function(e){this._active&&(this.hover||(this.mouseHovering?(this.lastMouseCanvasX=e[0],this.lastMouseCanvasY=e[1]):(this.lastMouseCanvasX=null,this.lastMouseCanvasY=null)))}},{key:"onMousemove",value:function(e){var t;if(this._active){this.pointerCanvasPos.set(e);var i=this.scene.pick({canvasPos:this.pointerCanvasPos,snapToVertex:!0,snapToEdge:!0,snapRadius:null!==(t=this.snapRadius)&&void 0!==t?t:20});if(i){this.mouseHovering=!0,this.hoveredEntity=i.entity,this.pointerWorldPos.set(i.worldPos);var s=document.documentElement.scrollLeft,r=document.documentElement.scrollTop;if(this._markerDiv.style.marginLeft="".concat(this._offsetX+s+e[0]-5,"px"),this._markerDiv.style.marginTop="".concat(this._offsetY+r+e[1]-5,"px"),this._markerDiv.style.background="pink",this._markerDiv.style.border="2px solid orangered",i.snappedCanvasPos){var n=i.snappedCanvasPos;this._markerDiv.style.marginLeft="".concat(this._offsetX+s+n[0]-5,"px"),this._markerDiv.style.marginTop="".concat(this._offsetY+r+n[1]-5,"px")}i.snappedToVertex&&(this._markerDiv.style.background="greenyellow",this._markerDiv.style.border="2px solid forestgreen"),i.snappedToEdge&&(this._markerDiv.style.background="lightblue",this._markerDiv.style.border="2px solid royalblue"),this._currentDistanceMeasurement&&(this._currentDistanceMeasurement.wireVisible=this._currentDistanceMeasurementInitState.wireVisible,this._currentDistanceMeasurement.axisVisible=this._currentDistanceMeasurementInitState.axisVisible&&this.distanceMeasurementsPlugin.defaultAxisVisible,this._currentDistanceMeasurement.xAxisVisible=this._currentDistanceMeasurementInitState.xAxisVisible&&this.distanceMeasurementsPlugin.defaultXAxisVisible,this._currentDistanceMeasurement.yAxisVisible=this._currentDistanceMeasurementInitState.yAxisVisible&&this.distanceMeasurementsPlugin.defaultYAxisVisible,this._currentDistanceMeasurement.zAxisVisible=this._currentDistanceMeasurementInitState.zAxisVisible&&this.distanceMeasurementsPlugin.defaultZAxisVisible,this._currentDistanceMeasurement.targetVisible=this._currentDistanceMeasurementInitState.targetVisible,this._currentDistanceMeasurement.target.worldPos=this.pointerWorldPos.slice(),this._markerDiv.style.marginLeft="-10000px",this._markerDiv.style.marginTop="-10000px")}else this.mouseHovering=!1,this._markerDiv.style.marginLeft="-10000px",this._markerDiv.style.marginTop="-10000px",this._currentDistanceMeasurement&&(this._currentDistanceMeasurement.wireVisible=!1,this._currentDistanceMeasurement.targetVisible=!1,this._currentDistanceMeasurement.axisVisible=!1)}}},{key:"onMouseup",value:function(e){this._active&&(this.hover||(this.lastMouseCanvasX||this.lastMouseCanvasY)&&(e[0]>this.lastMouseCanvasX+this.clickTolerance||e[0]<this.lastMouseCanvasX-this.clickTolerance||e[1]>this.lastMouseCanvasY+this.clickTolerance||e[1]<this.lastMouseCanvasY-this.clickTolerance||(this._currentDistanceMeasurement?this.mouseHovering?(this._currentDistanceMeasurement.target.entity=this.hoveredEntity,this.hoveredEntity=null,this._currentDistanceMeasurement.clickable=!0,this.distanceMeasurementsPlugin.fire("measurementEnd",this._currentDistanceMeasurement),this._currentDistanceMeasurement=null):(this._currentDistanceMeasurement.destroy(),this.distanceMeasurementsPlugin.fire("measurementCancel",this._currentDistanceMeasurement),this._currentDistanceMeasurement=null,this.hoveredEntity=null):this.mouseHovering&&(this._currentDistanceMeasurement=this.distanceMeasurementsPlugin.createMeasurement({id:J.createUUID(),origin:{worldPos:this.pointerWorldPos.slice()},target:{worldPos:this.pointerWorldPos.slice()},precision:this.distanceMeasurementsPlugin.precision,approximate:!0}),this._currentDistanceMeasurementInitState.axisVisible=this._currentDistanceMeasurement.axisVisible&&this.distanceMeasurementsPlugin.defaultAxisVisible,this._currentDistanceMeasurementInitState.xAxisVisible=this._currentDistanceMeasurement.xAxisVisible&&this.distanceMeasurementsPlugin.defaultXAxisVisible,this._currentDistanceMeasurementInitState.yAxisVisible=this._currentDistanceMeasurement.yAxisVisible&&this.distanceMeasurementsPlugin.defaultYAxisVisible,this._currentDistanceMeasurementInitState.zAxisVisible=this._currentDistanceMeasurement.zAxisVisible&&this.distanceMeasurementsPlugin.defaultZAxisVisible,this._currentDistanceMeasurementInitState.wireVisible=this._currentDistanceMeasurement.wireVisible,this._currentDistanceMeasurementInitState.targetVisible=this._currentDistanceMeasurement.targetVisible,this._currentDistanceMeasurement.clickable=!1,this._currentDistanceMeasurement.origin.entity=this.hoveredEntity,this.hoveredEntity=null,this.fire("measurementStart",this._currentDistanceMeasurement)))))}},{key:"deactivate",value:function(){this.reset(),document.removeEventListener("mousemove",this.markerHidden),this._currentDistanceMeasurement=null,this._active=!1}},{key:"reset",value:function(){this._active&&this._currentDistanceMeasurement&&(this.distanceMeasurementsPlugin.fire("measurementCancel",this._currentDistanceMeasurement),this._currentDistanceMeasurement.destroy(),this._currentDistanceMeasurement=null)}},{key:"destroy",value:function(){this.deactivate(),this._destroyMarkerDiv(),f(t,"destroy",this,3)([])}}])}(),Rh=function(){return w((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};B(this,e),this.cacheBuster=!1!==t.cacheBuster}),[{key:"_cacheBusterURL",value:function(e){if(!this.cacheBuster)return e;var t=(new Date).getTime();return e.indexOf("?")>-1?e+"&_="+t:e+"?_="+t}},{key:"getMetaModel",value:function(e,t,i){oe.loadJSON(this._cacheBusterURL(e),(function(e){t(e)}),(function(e){i(e)}))}},{key:"getGLTF",value:function(e,t,i){oe.loadArraybuffer(this._cacheBusterURL(e),(function(e){t(e)}),(function(e){i(e)}))}},{key:"getGLB",value:function(e,t,i){oe.loadArraybuffer(this._cacheBusterURL(e),(function(e){t(e)}),(function(e){i(e)}))}},{key:"getArrayBuffer",value:function(e,t,i,s){!function(e,t,i,s){var r=function(){};i=i||r,s=s||r;var n=/^data:(.*?)(;base64)?,(.*)$/,o=t.match(n);if(o){var a=!!o[2],l=o[3];l=window.decodeURIComponent(l),a&&(l=window.atob(l));try{for(var u=new ArrayBuffer(l.length),A=new Uint8Array(u),c=0;c<l.length;c++)A[c]=l.charCodeAt(c);pe.scheduleTask((function(){i(u)}))}catch(e){pe.scheduleTask((function(){s(e)}))}}else{var h=function(e){var t=e.lastIndexOf("/");return 0!==t?e.substring(0,t+1):""}(e),d=h+t,p=new XMLHttpRequest;p.open("GET",d,!0),p.responseType="arraybuffer",p.onreadystatechange=function(){4===p.readyState&&(200===p.status?i(p.response):s("loadArrayBuffer error : "+p.response))},p.send(null)}}(this._cacheBusterURL(e),t,(function(e){i(e)}),(function(e){s(e)}))}}])}();var Uh=function(){return w((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};B(this,e),this._eventSubIDMap=null,this._eventSubEvents=null,this._eventSubs=null,this._events=null,this._locale="en",this._messages={},this._locales=[],this._locale="en",this.messages=t.messages,this.locale=t.locale}),[{key:"messages",set:function(e){this._messages=e||{},this._locales=Object.keys(this._messages),this.fire("updated",this)}},{key:"loadMessages",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var t in e)this._messages[t]=e[t];this.messages=this._messages}},{key:"clearMessages",value:function(){this.messages={}}},{key:"locales",get:function(){return this._locales}},{key:"locale",get:function(){return this._locale},set:function(e){e=e||"de",this._locale!==e&&(this._locale=e,this.fire("updated",e))}},{key:"translate",value:function(e,t){var i=this._messages[this._locale];if(!i)return null;var s=Oh(e,i);return s?t?Qh(s,t):s:null}},{key:"translatePlurals",value:function(e,t,i){var s=this._messages[this._locale];if(!s)return null;var r=Oh(e,s);return(r=0===(t=parseInt(""+t,10))?r.zero:t>1?r.other:r.one)?(r=Qh(r,[t]),i&&(r=Qh(r,i)),r):null}},{key:"fire",value:function(e,t,i){this._events||(this._events={}),this._eventSubs||(this._eventSubs={}),!0!==i&&(this._events[e]=t||!0);var s=this._eventSubs[e];if(s)for(var r in s){if(s.hasOwnProperty(r))s[r].callback(t)}}},{key:"on",value:function(e,t){this._events||(this._events={}),this._eventSubIDMap||(this._eventSubIDMap=new $),this._eventSubEvents||(this._eventSubEvents={}),this._eventSubs||(this._eventSubs={});var i=this._eventSubs[e];i||(i={},this._eventSubs[e]=i);var s=this._eventSubIDMap.addItem();i[s]={callback:t},this._eventSubEvents[s]=e;var r=this._events[e];return void 0!==r&&t(r),s}},{key:"off",value:function(e){if(null!=e&&this._eventSubEvents){var t=this._eventSubEvents[e];if(t){delete this._eventSubEvents[e];var i=this._eventSubs[t];i&&delete i[e],this._eventSubIDMap.removeItem(e)}}}}])}();function Oh(e,t){if(t[e])return t[e];for(var i=e.split("."),s=t,r=0,n=i.length;s&&r<n;r++){s=s[i[r]]}return s}function Qh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.replace(/\{\{|\}\}|\{(\d+)\}/g,(function(e,i){return"{{"===e?"{":"}}"===e?"}":t[i]}))}var Nh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s])).t=s.t,i}return m(t,_e),w(t,[{key:"t",get:function(){return this._t},set:function(e){e=e||0,this._t=e<0?0:e>1?1:e}},{key:"tangent",get:function(){return this.getTangent(this._t)}},{key:"length",get:function(){var e=this._getLengths();return e[e.length-1]}},{key:"getTangent",value:function(e){var t=1e-4;void 0===e&&(e=this._t);var i=e-t,s=e+t;i<0&&(i=0),s>1&&(s=1);var r=this.getPoint(i),n=this.getPoint(s),o=J.subVec3(n,r,[]);return J.normalizeVec3(o,[])}},{key:"getPointAt",value:function(e){var t=this.getUToTMapping(e);return this.getPoint(t)}},{key:"getPoints",value:function(e){e||(e=5);var t,i=[];for(t=0;t<=e;t++)i.push(this.getPoint(t/e));return i}},{key:"_getLengths",value:function(e){if(e||(e=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,i,s=[],r=this.getPoint(0),n=0;for(s.push(0),i=1;i<=e;i++)t=this.getPoint(i/e),n+=J.lenVec3(J.subVec3(t,r,[])),s.push(n),r=t;return this.cacheArcLengths=s,s}},{key:"_updateArcLengths",value:function(){this.needsUpdate=!0,this._getLengths()}},{key:"getUToTMapping",value:function(e,t){var i,s=this._getLengths(),r=0,n=s.length;i=t||e*s[n-1];for(var o,a=0,l=n-1;a<=l;)if((o=s[r=Math.floor(a+(l-a)/2)]-i)<0)a=r+1;else{if(!(o>0)){l=r;break}l=r-1}if(s[r=l]===i)return r/(n-1);var u=s[r];return(r+(i-u)/(s[r+1]-u))/(n-1)}}])}(),Vh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s])).points=s.points,i.t=s.t,i}return m(t,Nh),w(t,[{key:"points",get:function(){return this._points},set:function(e){this._points=e||[]}},{key:"t",get:function(){return this._t},set:function(e){e=e||0,this._t=e<0?0:e>1?1:e}},{key:"point",get:function(){return this.getPoint(this._t)}},{key:"getPoint",value:function(e){var t=this.points;if(!(t.length<3)){var i=(t.length-1)*e,s=Math.floor(i),r=i-s,n=t[0===s?s:s-1],o=t[s],a=t[s>t.length-2?t.length-1:s+1],l=t[s>t.length-3?t.length-1:s+2],u=J.vec3();return u[0]=J.catmullRomInterpolate(n[0],o[0],a[0],l[0],r),u[1]=J.catmullRomInterpolate(n[1],o[1],a[1],l[1],r),u[2]=J.catmullRomInterpolate(n[2],o[2],a[2],l[2],r),u}this.error("Can't sample point from SplineCurve - not enough points on curve - returning [0,0,0].")}},{key:"getJSON",value:function(){return{points:points,t:this._t}}}])}(),Hh=J.vec3(),jh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s]))._frames=[],i._eyeCurve=new Vh(i),i._lookCurve=new Vh(i),i._upCurve=new Vh(i),s.frames&&(i.addFrames(s.frames),i.smoothFrameTimes(1)),i}return m(t,_e),w(t,[{key:"type",get:function(){return"CameraPath"}},{key:"frames",get:function(){return this._frames}},{key:"eyeCurve",get:function(){return this._eyeCurve}},{key:"lookCurve",get:function(){return this._lookCurve}},{key:"upCurve",get:function(){return this._upCurve}},{key:"saveFrame",value:function(e){var t=this.scene.camera;this.addFrame(e,t.eye,t.look,t.up)}},{key:"addFrame",value:function(e,t,i,s){var r={t:e,eye:t.slice(0),look:i.slice(0),up:s.slice(0)};this._frames.push(r),this._eyeCurve.points.push(r.eye),this._lookCurve.points.push(r.look),this._upCurve.points.push(r.up)}},{key:"addFrames",value:function(e){for(var t,i=0,s=e.length;i<s;i++)t=e[i],this.addFrame(t.t||0,t.eye,t.look,t.up)}},{key:"loadFrame",value:function(e){var t=this.scene.camera;e=(e/=this._frames[this._frames.length-1].t-this._frames[0].t)<0?0:e>1?1:e,t.eye=this._eyeCurve.getPoint(e,Hh),t.look=this._lookCurve.getPoint(e,Hh),t.up=this._upCurve.getPoint(e,Hh)}},{key:"sampleFrame",value:function(e,t,i,s){e=e<0?0:e>1?1:e,this._eyeCurve.getPoint(e,t),this._lookCurve.getPoint(e,i),this._upCurve.getPoint(e,s)}},{key:"smoothFrameTimes",value:function(e){if(0!==this._frames.length){var t=J.vec3(),i=0;this._frames[0].t=0;for(var s=[],r=1,n=this._frames.length;r<n;r++){var o=J.lenVec3(J.subVec3(this._frames[r].eye,this._frames[r-1].eye,t));s[r]=o,i+=o}for(var a=1,l=this._frames.length;a<l;a++){var u=s[a]/i*e;this._frames[a].t=this._frames[a-1].t+u}}}},{key:"clearFrames",value:function(){this._frames=[],this._eyeCurve.points=[],this._lookCurve.points=[],this._upCurve.points=[]}}])}(),Gh=J.vec3(),zh=J.vec3(),Wh=J.vec3(),Kh=J.vec3(),Xh=J.vec3(),Yh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s]))._look1=J.vec3(),i._eye1=J.vec3(),i._up1=J.vec3(),i._look2=J.vec3(),i._eye2=J.vec3(),i._up2=J.vec3(),i._orthoScale1=1,i._orthoScale2=1,i._flying=!1,i._flyEyeLookUp=!1,i._flyingEye=!1,i._flyingLook=!1,i._callback=null,i._callbackScope=null,i._time1=null,i._time2=null,i.easing=!1!==s.easing,i.duration=s.duration,i.fit=s.fit,i.fitFOV=s.fitFOV,i.trail=s.trail,i}return m(t,_e),w(t,[{key:"type",get:function(){return"CameraFlightAnimation"}},{key:"flyTo",value:function(e,t,i){e=e||this.scene,this._flying&&this.stop(),this._flying=!1,this._flyingEye=!1,this._flyingLook=!1,this._flyingEyeLookUp=!1,this._callback=t,this._callbackScope=i;var s,r,n,o,a,l=this.scene.camera,u=!!e.projection&&e.projection!==l.projection;if(this._eye1[0]=l.eye[0],this._eye1[1]=l.eye[1],this._eye1[2]=l.eye[2],this._look1[0]=l.look[0],this._look1[1]=l.look[1],this._look1[2]=l.look[2],this._up1[0]=l.up[0],this._up1[1]=l.up[1],this._up1[2]=l.up[2],this._orthoScale1=l.ortho.scale,this._orthoScale2=e.orthoScale||this._orthoScale1,e.aabb)s=e.aabb;else if(6===e.length)s=e;else if(e.eye&&e.look||e.up)r=e.eye,n=e.look,o=e.up;else if(e.eye)r=e.eye;else if(e.look)n=e.look;else{var A=e;if((oe.isNumeric(A)||oe.isString(A))&&(a=A,!(A=this.scene.components[a])))return this.error("Component not found: "+oe.inQuotes(a)),void(t&&(i?t.call(i):t()));u||(s=A.aabb||this.scene.aabb)}var c=e.poi;if(s){if(s[3]<s[0]||s[4]<s[1]||s[5]<s[2])return;if(s[3]===s[0]&&s[4]===s[1]&&s[5]===s[2])return;s=s.slice();var h=J.getAABB3Center(s);this._look2=c||h;var d=J.subVec3(this._eye1,this._look1,Gh),p=J.normalizeVec3(d),f=c?J.getAABB3DiagPoint(s,c):J.getAABB3Diag(s),v=e.fitFOV||this._fitFOV,g=Math.abs(f/Math.tan(v*J.DEGTORAD));this._orthoScale2=1.1*f,this._eye2[0]=this._look2[0]+p[0]*g,this._eye2[1]=this._look2[1]+p[1]*g,this._eye2[2]=this._look2[2]+p[2]*g,this._up2[0]=this._up1[0],this._up2[1]=this._up1[1],this._up2[2]=this._up1[2],this._flyingEyeLookUp=!0}else(r||n||o)&&(this._flyingEyeLookUp=!!r&&!!n&&!!o,this._flyingEye=!!r&&!n,this._flyingLook=!!n&&!r,r&&(this._eye2[0]=r[0],this._eye2[1]=r[1],this._eye2[2]=r[2]),n&&(this._look2[0]=n[0],this._look2[1]=n[1],this._look2[2]=n[2]),o&&(this._up2[0]=o[0],this._up2[1]=o[1],this._up2[2]=o[2]));u?("ortho"===e.projection&&"ortho"!==l.projection&&(this._projection2="ortho",this._projMatrix1=l.projMatrix.slice(),this._projMatrix2=l.ortho.matrix.slice(),l.projection="customProjection"),"perspective"===e.projection&&"perspective"!==l.projection&&(this._projection2="perspective",this._projMatrix1=l.projMatrix.slice(),this._projMatrix2=l.perspective.matrix.slice(),l.projection="customProjection")):this._projection2=null,this.fire("started",e,!0),this._time1=Date.now(),this._time2=this._time1+(e.duration?1e3*e.duration:this._duration),this._flying=!0,pe.scheduleTask(this._update,this)}},{key:"jumpTo",value:function(e){this._jumpTo(e)}},{key:"_jumpTo",value:function(e){this._flying&&this.stop();var t,i,s,r,n,o=this.scene.camera;if(e.aabb)t=e.aabb;else if(6===e.length)t=e;else if(e.eye||e.look||e.up)s=e.eye,r=e.look,n=e.up;else{var a=e;if((oe.isNumeric(a)||oe.isString(a))&&(i=a,!(a=this.scene.components[i])))return void this.error("Component not found: "+oe.inQuotes(i));t=a.aabb||this.scene.aabb}var l=e.poi;if(t){if(t[3]<=t[0]||t[4]<=t[1]||t[5]<=t[2])return;var u,A=l?J.getAABB3DiagPoint(t,l):J.getAABB3Diag(t);r=l||J.getAABB3Center(t,r),this._trail?J.subVec3(o.look,r,Xh):J.subVec3(o.eye,o.look,Xh),J.normalizeVec3(Xh),u=(void 0!==e.fit?e.fit:this._fit)?Math.abs(A/Math.tan((e.fitFOV||this._fitFOV)*J.DEGTORAD)):J.lenVec3(J.subVec3(o.eye,o.look,Gh)),J.mulVec3Scalar(Xh,u),o.eye=J.addVec3(r,Xh,Gh),o.look=r,this.scene.camera.ortho.scale=1.1*A}else(s||r||n)&&(s&&(o.eye=s),r&&(o.look=r),n&&(o.up=n));e.projection&&(o.projection=e.projection)}},{key:"_update",value:function(){if(this._flying){var e=(Date.now()-this._time1)/(this._time2-this._time1),i=e>=1;e>1&&(e=1);var s=this.easing?t._ease(e,0,1,1):e,r=this.scene.camera;if(this._flyingEye||this._flyingLook?this._flyingEye?(J.subVec3(r.eye,r.look,Xh),r.eye=J.lerpVec3(s,0,1,this._eye1,this._eye2,Wh),r.look=J.subVec3(Wh,Xh,zh)):this._flyingLook&&(r.look=J.lerpVec3(s,0,1,this._look1,this._look2,zh),r.up=J.lerpVec3(s,0,1,this._up1,this._up2,Kh)):this._flyingEyeLookUp&&(r.eye=J.lerpVec3(s,0,1,this._eye1,this._eye2,Wh),r.look=J.lerpVec3(s,0,1,this._look1,this._look2,zh),r.up=J.lerpVec3(s,0,1,this._up1,this._up2,Kh)),this._projection2){var n="ortho"===this._projection2?t._easeOutExpo(e,0,1,1):t._easeInCubic(e,0,1,1);r.customProjection.matrix=J.lerpMat4(n,0,1,this._projMatrix1,this._projMatrix2)}else r.ortho.scale=this._orthoScale1+e*(this._orthoScale2-this._orthoScale1);if(i)return r.ortho.scale=this._orthoScale2,void this.stop();pe.scheduleTask(this._update,this)}}},{key:"stop",value:function(){if(this._flying){this._flying=!1,this._time1=null,this._time2=null,this._projection2&&(this.scene.camera.projection=this._projection2);var e=this._callback;e&&(this._callback=null,this._callbackScope?e.call(this._callbackScope):e()),this.fire("stopped",!0,!0)}}},{key:"cancel",value:function(){this._flying&&(this._flying=!1,this._time1=null,this._time2=null,this._callback&&(this._callback=null),this.fire("canceled",!0,!0))}},{key:"duration",get:function(){return this._duration/1e3},set:function(e){this._duration=e?1e3*e:500,this.stop()}},{key:"fit",get:function(){return this._fit},set:function(e){this._fit=!1!==e}},{key:"fitFOV",get:function(){return this._fitFOV},set:function(e){this._fitFOV=e||45}},{key:"trail",get:function(){return this._trail},set:function(e){this._trail=!!e}},{key:"destroy",value:function(){this.stop(),f(t,"destroy",this,3)([])}}],[{key:"_ease",value:function(e,t,i,s){return-i*(e/=s)*(e-2)+t}},{key:"_easeInCubic",value:function(e,t,i,s){return i*(e/=s)*e*e+t}},{key:"_easeOutExpo",value:function(e,t,i,s){return i*(1-Math.pow(2,-10*e/s))+t}}])}(),Jh=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s]))._cameraFlightAnimation=new Yh(i),i._t=0,i.state=t.SCRUBBING,i._playingFromT=0,i._playingToT=0,i._playingRate=s.playingRate||1,i._playingDir=1,i._lastTime=null,i.cameraPath=s.cameraPath,i._tick=i.scene.on("tick",i._updateT,i),i}return m(t,_e),w(t,[{key:"type",get:function(){return"CameraPathAnimation"}},{key:"_updateT",value:function(){var e=this._cameraPath;if(e){var i,s,r=performance.now(),n=this._lastTime?.001*(r-this._lastTime):0;if(this._lastTime=r,0!==n)switch(this.state){case t.SCRUBBING:return;case t.PLAYING:if(this._t+=this._playingRate*n,0===(i=this._cameraPath.frames.length)||this._playingDir<0&&this._t<=0||this._playingDir>0&&this._t>=this._cameraPath.frames[i-1].t)return this.state=t.SCRUBBING,this._t=this._cameraPath.frames[i-1].t,void this.fire("stopped");e.loadFrame(this._t);break;case t.PLAYING_TO:s=this._t+this._playingRate*n*this._playingDir,(this._playingDir<0&&s<=this._playingToT||this._playingDir>0&&s>=this._playingToT)&&(s=this._playingToT,this.state=t.SCRUBBING,this.fire("stopped")),this._t=s,e.loadFrame(this._t)}}}},{key:"_ease",value:function(e,t,i,s){return-i*(e/=s)*(e-2)+t}},{key:"cameraPath",get:function(){return this._cameraPath},set:function(e){this._cameraPath=e}},{key:"rate",get:function(){return this._playingRate},set:function(e){this._playingRate=e}},{key:"play",value:function(){this._cameraPath&&(this._lastTime=null,this.state=t.PLAYING)}},{key:"playToT",value:function(e){this._cameraPath&&(this._playingFromT=this._t,this._playingToT=e,this._playingDir=this._playingToT-this._playingFromT<0?-1:1,this._lastTime=null,this.state=t.PLAYING_TO)}},{key:"playToFrame",value:function(e){var t=this._cameraPath;if(t){var i=t.frames[e];i?this.playToT(i.t):this.error("playToFrame - frame index out of range: "+e)}}},{key:"flyToFrame",value:function(e,i){var s=this._cameraPath;if(s){var r=s.frames[e];r?(this.state=t.SCRUBBING,this._cameraFlightAnimation.flyTo(r,i)):this.error("flyToFrame - frame index out of range: "+e)}}},{key:"scrubToT",value:function(e){var i=this._cameraPath;i&&(this.scene.camera&&(this._t=e,i.loadFrame(this._t),this.state=t.SCRUBBING))}},{key:"scrubToFrame",value:function(e){var i=this._cameraPath;i&&(this.scene.camera&&(i.frames[e]?(i.loadFrame(this._t),this.state=t.SCRUBBING):this.error("playToFrame - frame index out of range: "+e)))}},{key:"stop",value:function(){this.state=t.SCRUBBING,this.fire("stopped")}},{key:"destroy",value:function(){f(t,"destroy",this,3)([]),this.scene.off(this._tick)}}])}();Jh.STOPPED=0,Jh.SCRUBBING=1,Jh.PLAYING=2,Jh.PLAYING_TO=3;var Zh=J.vec3(),qh=J.vec3();J.vec3();var $h=J.vec3([0,-1,0]),ed=J.vec4([0,0,0,1]),td=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s]))._src=null,i._image=null,i._pos=J.vec3(),i._origin=J.vec3(),i._rtcPos=J.vec3(),i._dir=J.vec3(),i._size=1,i._imageSize=J.vec2(),i._texture=new On(i),i._plane=new nn(i,{geometry:new Ti(i,Xn({center:[0,0,0],xSize:1,zSize:1,xSegments:10,zSegments:10})),material:new Qi(i,{diffuse:[0,0,0],ambient:[0,0,0],specular:[0,0,0],diffuseMap:i._texture,emissiveMap:i._texture,backfaces:!0}),clippable:s.clippable}),i._grid=new nn(i,{geometry:new Ti(i,Kn({size:1,divisions:10})),material:new Qi(i,{diffuse:[0,0,0],ambient:[0,0,0],emissive:[.2,.8,.2]}),position:[0,.001,0],clippable:s.clippable}),i._node=new Bn(i,{rotation:[0,0,0],position:[0,0,0],scale:[1,1,1],clippable:!1,children:[i._plane,i._grid]}),i._gridVisible=!1,i.visible=!0,i.gridVisible=s.gridVisible,i.position=s.position,i.rotation=s.rotation,i.dir=s.dir,i.size=s.size,i.collidable=s.collidable,i.clippable=s.clippable,i.pickable=s.pickable,i.opacity=s.opacity,s.image?i.image=s.image:i.src=s.src,i}return m(t,_e),w(t,[{key:"visible",get:function(){return this._plane.visible},set:function(e){this._plane.visible=e,this._grid.visible=this._gridVisible&&e}},{key:"gridVisible",get:function(){return this._gridVisible},set:function(e){e=!1!==e,this._gridVisible=e,this._grid.visible=this._gridVisible&&this.visible}},{key:"image",get:function(){return this._image},set:function(e){this._image=e,this._image&&(this._imageSize[0]=e.width,this._imageSize[1]=e.height,this._updatePlaneSizeFromImage(),this._src=null,this._texture.image=this._image)}},{key:"src",get:function(){return this._src},set:function(e){var t=this;if(this._src=e,this._src){this._image=null;var i=new Image;i.onload=function(){t._texture.image=i,t._imageSize[0]=i.width,t._imageSize[1]=i.height,t._updatePlaneSizeFromImage()},i.src=this._src}}},{key:"position",get:function(){return this._pos},set:function(e){this._pos.set(e||[0,0,0]),xe(this._pos,this._origin,this._rtcPos),this._node.origin=this._origin,this._node.position=this._rtcPos}},{key:"rotation",get:function(){return this._node.rotation},set:function(e){this._node.rotation=e}},{key:"size",get:function(){return this._size},set:function(e){this._size=null==e?1:e,this._image&&this._updatePlaneSizeFromImage()}},{key:"dir",get:function(){return this._dir},set:function(e){if(this._dir.set(e||[0,0,-1]),e){var t=this.scene.center,i=[-this._dir[0],-this._dir[1],-this._dir[2]];J.subVec3(t,this.position,Zh);var s=-J.dotVec3(i,Zh);J.normalizeVec3(i),J.mulVec3Scalar(i,s,qh),J.vec3PairToQuaternion($h,e,ed),this._node.quaternion=ed}}},{key:"collidable",get:function(){return this._node.collidable},set:function(e){this._node.collidable=!1!==e}},{key:"clippable",get:function(){return this._node.clippable},set:function(e){this._node.clippable=!1!==e}},{key:"pickable",get:function(){return this._node.pickable},set:function(e){this._node.pickable=!1!==e}},{key:"opacity",get:function(){return this._node.opacity},set:function(e){this._node.opacity=e}},{key:"destroy",value:function(){f(t,"destroy",this,3)([])}},{key:"_updatePlaneSizeFromImage",value:function(){var e=this._size,t=this._imageSize[0],i=this._imageSize[1];if(t>i){var s=i/t;this._node.scale=[e,1,e*s]}else{var r=t/i;this._node.scale=[e*r,1,e]}}}])}(),id=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};B(this,t);var r=i=h(this,t,[e,s]);i._shadowRenderBuf=null,i._shadowViewMatrix=null,i._shadowProjMatrix=null,i._shadowViewMatrixDirty=!0,i._shadowProjMatrixDirty=!0;var n=i.scene.camera,o=i.scene.canvas;return i._onCameraViewMatrix=n.on("viewMatrix",(function(){i._shadowViewMatrixDirty=!0})),i._onCameraProjMatrix=n.on("projMatrix",(function(){i._shadowProjMatrixDirty=!0})),i._onCanvasBoundary=o.on("boundary",(function(){i._shadowProjMatrixDirty=!0})),i._state=new Jt({type:"point",pos:J.vec3([1,1,1]),color:J.vec3([.7,.7,.8]),intensity:1,attenuation:[0,0,0],space:s.space||"view",castsShadow:!1,getShadowViewMatrix:function(){if(r._shadowViewMatrixDirty){r._shadowViewMatrix||(r._shadowViewMatrix=J.identityMat4());var e=r._state.pos,t=n.look,i=n.up;J.lookAtMat4v(e,t,i,r._shadowViewMatrix),r._shadowViewMatrixDirty=!1}return r._shadowViewMatrix},getShadowProjMatrix:function(){if(r._shadowProjMatrixDirty){r._shadowProjMatrix||(r._shadowProjMatrix=J.identityMat4());var e=r.scene.canvas.canvas;J.perspectiveMat4(Math.PI/180*70,e.clientWidth/e.clientHeight,.1,500,r._shadowProjMatrix),r._shadowProjMatrixDirty=!1}return r._shadowProjMatrix},getShadowRenderBuf:function(){return r._shadowRenderBuf||(r._shadowRenderBuf=new Gt(r.scene.canvas.canvas,r.scene.canvas.gl,{size:[1024,1024]})),r._shadowRenderBuf}}),i.pos=s.pos,i.color=s.color,i.intensity=s.intensity,i.constantAttenuation=s.constantAttenuation,i.linearAttenuation=s.linearAttenuation,i.quadraticAttenuation=s.quadraticAttenuation,i.castsShadow=s.castsShadow,i.scene._lightCreated(i),i}return m(t,mi),w(t,[{key:"type",get:function(){return"PointLight"}},{key:"pos",get:function(){return this._state.pos},set:function(e){this._state.pos.set(e||[1,1,1]),this._shadowViewMatrixDirty=!0,this.glRedraw()}},{key:"color",get:function(){return this._state.color},set:function(e){this._state.color.set(e||[.7,.7,.8]),this.glRedraw()}},{key:"intensity",get:function(){return this._state.intensity},set:function(e){e=void 0!==e?e:1,this._state.intensity=e,this.glRedraw()}},{key:"constantAttenuation",get:function(){return this._state.attenuation[0]},set:function(e){this._state.attenuation[0]=e||0,this.glRedraw()}},{key:"linearAttenuation",get:function(){return this._state.attenuation[1]},set:function(e){this._state.attenuation[1]=e||0,this.glRedraw()}},{key:"quadraticAttenuation",get:function(){return this._state.attenuation[2]},set:function(e){this._state.attenuation[2]=e||0,this.glRedraw()}},{key:"castsShadow",get:function(){return this._state.castsShadow},set:function(e){e=!!e,this._state.castsShadow!==e&&(this._state.castsShadow=e,this._shadowViewMatrixDirty=!0,this.glRedraw())}},{key:"destroy",value:function(){var e=this.scene.camera,i=this.scene.canvas;e.off(this._onCameraViewMatrix),e.off(this._onCameraProjMatrix),i.off(this._onCanvasBoundary),f(t,"destroy",this,3)([]),this._state.destroy(),this._shadowRenderBuf&&this._shadowRenderBuf.destroy(),this.scene._lightDestroyed(this),this.glRedraw()}}])}();function sd(e){return 0==(e&e-1)}function rd(e){--e;for(var t=1;t<32;t<<=1)e|=e>>t;return e+1}var nd=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};B(this,t);var r=(i=h(this,t,[e,s])).scene.canvas.gl;return i._state=new Jt({texture:new In({gl:r,target:r.TEXTURE_CUBE_MAP}),flipY:i._checkFlipY(s.minFilter),encoding:i._checkEncoding(s.encoding),minFilter:cs,magFilter:ls,wrapS:ts,wrapT:ts,mipmaps:!0}),i._src=s.src,i._images=[],i._loadSrc(s.src),te.memory.textures++,i}return m(t,_e),w(t,[{key:"type",get:function(){return"CubeTexture"}},{key:"_checkFlipY",value:function(e){return!!e}},{key:"_checkEncoding",value:function(e){return(e=e||lr)!==lr&&e!==ur&&(this.error("Unsupported value for 'encoding' - supported values are LinearEncoding and sRGBEncoding. Defaulting to LinearEncoding."),e=lr),e}},{key:"_webglContextRestored",value:function(){this.scene.canvas.gl,this._state.texture=null,this._src&&this._loadSrc(this._src)}},{key:"_loadSrc",value:function(e){var t=this,i=this.scene.canvas.gl;this._images=[];for(var s=!1,r=0,n=function(n){var o,a,l=new Image;l.onload=(o=l,a=n,function(){if(!s&&(o=function(e){if(!sd(e.width)||!sd(e.height)){var t=document.createElement("canvas");t.width=rd(e.width),t.height=rd(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),e=t}return e}(o),t._images[a]=o,6==++r)){var e=t._state.texture;e||(e=new In({gl:i,target:i.TEXTURE_CUBE_MAP}),t._state.texture=e),e.setImage(t._images,t._state),t.fire("loaded",t._src,!1),t.glRedraw()}}),l.onerror=function(){s=!0},l.src=e[n]},o=0;o<e.length;o++)n(o)}},{key:"destroy",value:function(){f(t,"destroy",this,3)([]),this._state.texture&&this._state.texture.destroy(),te.memory.textures--,this._state.destroy()}}])}(),od=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s])).scene._lightsState.addReflectionMap(i._state),i.scene._reflectionMapCreated(i),i}return m(t,nd),w(t,[{key:"type",get:function(){return"ReflectionMap"}},{key:"destroy",value:function(){f(t,"destroy",this,3)([]),this.scene._reflectionMapDestroyed(this)}}])}(),ad=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s])).scene._lightMapCreated(i),i}return m(t,nd),w(t,[{key:"type",get:function(){return"LightMap"}},{key:"destroy",value:function(){f(t,"destroy",this,3)([]),this.scene._lightMapDestroyed(this)}}])}(),ld=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,{entity:s.entity,occludable:s.occludable,worldPos:s.worldPos}]))._occluded=!1,i._visible=!0,i._src=null,i._image=null,i._pos=J.vec3(),i._origin=J.vec3(),i._rtcPos=J.vec3(),i._dir=J.vec3(),i._size=1,i._imageSize=J.vec2(),i._texture=new On(i,{src:s.src}),i._geometry=new Ti(i,{primitive:"triangles",positions:[3,3,0,-3,3,0,-3,-3,0,3,-3,0],normals:[-1,0,0,-1,0,0,-1,0,0,-1,0,0],uv:[1,-1,0,-1,0,0,1,0],indices:[0,1,2,0,2,3]}),i._mesh=new nn(i,{geometry:i._geometry,material:new Qi(i,{ambient:[.9,.3,.9],shininess:30,diffuseMap:i._texture,backfaces:!0}),scale:[1,1,1],position:s.worldPos,rotation:[90,0,0],billboard:"spherical",occluder:!1}),i.visible=!0,i.collidable=s.collidable,i.clippable=s.clippable,i.pickable=s.pickable,i.opacity=s.opacity,i.size=s.size,s.image?i.image=s.image:i.src=s.src,i}return m(t,Ve),w(t,[{key:"_setVisible",value:function(e){this._occluded=!e,this._mesh.visible=this._visible&&!this._occluded,f(t,"_setVisible",this,3)([e])}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=null==e||e,this._mesh.visible=this._visible&&!this._occluded}},{key:"image",get:function(){return this._image},set:function(e){this._image=e,this._image&&(this._imageSize[0]=this._image.width,this._imageSize[1]=this._image.height,this._updatePlaneSizeFromImage(),this._src=null,this._texture.image=this._image)}},{key:"src",get:function(){return this._src},set:function(e){var t=this;if(this._src=e,this._src){this._image=null;var i=new Image;i.onload=function(){t._texture.image=i,t._imageSize[0]=i.width,t._imageSize[1]=i.height,t._updatePlaneSizeFromImage()},i.src=this._src}}},{key:"size",get:function(){return this._size},set:function(e){this._size=null==e?1:e,this._image&&this._updatePlaneSizeFromImage()}},{key:"collidable",get:function(){return this._mesh.collidable},set:function(e){this._mesh.collidable=!1!==e}},{key:"clippable",get:function(){return this._mesh.clippable},set:function(e){this._mesh.clippable=!1!==e}},{key:"pickable",get:function(){return this._mesh.pickable},set:function(e){this._mesh.pickable=!1!==e}},{key:"opacity",get:function(){return this._mesh.opacity},set:function(e){this._mesh.opacity=e}},{key:"_updatePlaneSizeFromImage",value:function(){var e=.5*this._size,t=this._imageSize[0],i=this._imageSize[1],s=i/t;this._geometry.positions=t>i?[e,e*s,0,-e,e*s,0,-e,-e*s,0,e,-e*s,0]:[e/s,e,0,-e/s,e,0,-e/s,-e,0,e/s,-e,0]}}])}(),ud=function(){return w((function e(t){B(this,e),this._eye=J.vec3(),this._look=J.vec3(),this._up=J.vec3(),this._projection={},t&&this.saveCamera(t)}),[{key:"saveCamera",value:function(e){var t=e.camera,i=t.project;switch(this._eye.set(t.eye),this._look.set(t.look),this._up.set(t.up),t.projection){case"perspective":this._projection={projection:"perspective",fov:i.fov,fovAxis:i.fovAxis,near:i.near,far:i.far};break;case"ortho":this._projection={projection:"ortho",scale:i.scale,near:i.near,far:i.far};break;case"frustum":this._projection={projection:"frustum",left:i.left,right:i.right,top:i.top,bottom:i.bottom,near:i.near,far:i.far};break;case"custom":this._projection={projection:"custom",matrix:i.matrix.slice()}}}},{key:"restoreCamera",value:function(e,t){var i=e.camera,s=this._projection;function r(){switch(s.type){case"perspective":i.perspective.fov=s.fov,i.perspective.fovAxis=s.fovAxis,i.perspective.near=s.near,i.perspective.far=s.far;break;case"ortho":i.ortho.scale=s.scale,i.ortho.near=s.near,i.ortho.far=s.far;break;case"frustum":i.frustum.left=s.left,i.frustum.right=s.right,i.frustum.top=s.top,i.frustum.bottom=s.bottom,i.frustum.near=s.near,i.frustum.far=s.far;break;case"custom":i.customProjection.matrix=s.matrix}}t?e.viewer.cameraFlight.flyTo({eye:this._eye,look:this._look,up:this._up,orthoScale:s.scale,projection:s.projection},(function(){r(),t()})):(i.eye=this._eye,i.look=this._look,i.up=this._up,r(),i.projection=s.projection)}}])}(),Ad=J.vec3(),cd=function(){return w((function e(t){if(B(this,e),this.objectsVisible=[],this.objectsEdges=[],this.objectsXrayed=[],this.objectsHighlighted=[],this.objectsSelected=[],this.objectsClippable=[],this.objectsPickable=[],this.objectsColorize=[],this.objectsOpacity=[],this.numObjects=0,t){var i=t.metaScene.scene;this.saveObjects(i,t)}}),[{key:"saveObjects",value:function(e,t,i){this.numObjects=0,this._mask=i?oe.apply(i,{}):null;for(var s=!i||i.visible,r=!i||i.edges,n=!i||i.xrayed,o=!i||i.highlighted,a=!i||i.selected,l=!i||i.clippable,u=!i||i.pickable,A=!i||i.colorize,c=!i||i.opacity,h=t.metaObjects,d=e.objects,p=0,f=h.length;p<f;p++){var v=d[h[p].id];if(v){if(s&&(this.objectsVisible[p]=v.visible),r&&(this.objectsEdges[p]=v.edges),n&&(this.objectsXrayed[p]=v.xrayed),o&&(this.objectsHighlighted[p]=v.highlighted),a&&(this.objectsSelected[p]=v.selected),l&&(this.objectsClippable[p]=v.clippable),u&&(this.objectsPickable[p]=v.pickable),A){var g=v.colorize;this.objectsColorize[3*p+0]=g[0],this.objectsColorize[3*p+1]=g[1],this.objectsColorize[3*p+2]=g[2]}c&&(this.objectsOpacity[p]=v.opacity),this.numObjects++}}}},{key:"restoreObjects",value:function(e,t){for(var i=this._mask,s=!i||i.visible,r=!i||i.edges,n=!i||i.xrayed,o=!i||i.highlighted,a=!i||i.selected,l=!i||i.clippable,u=!i||i.pickable,A=!i||i.colorize,c=!i||i.opacity,h=t.metaObjects,d=e.objects,p=0,f=h.length;p<f;p++){var v=d[h[p].id];v&&(s&&(v.visible=this.objectsVisible[p]),r&&(v.edges=this.objectsEdges[p]),n&&(v.xrayed=this.objectsXrayed[p]),o&&(v.highlighted=this.objectsHighlighted[p]),a&&(v.selected=this.objectsSelected[p]),l&&(v.clippable=this.objectsClippable[p]),u&&(v.pickable=this.objectsPickable[p]),A&&(Ad[0]=this.objectsColorize[3*p+0],Ad[1]=this.objectsColorize[3*p+1],Ad[2]=this.objectsColorize[3*p+2],v.colorize=Ad),c&&(v.opacity=this.objectsOpacity[p]))}}}])}(),hd=J.vec3(),dd=function(){return w((function e(){B(this,e),this.objectsVisible=[],this.objectsEdges=[],this.objectsXrayed=[],this.objectsHighlighted=[],this.objectsSelected=[],this.objectsClippable=[],this.objectsPickable=[],this.objectsColorize=[],this.objectsHasColorize=[],this.objectsOpacity=[],this.numObjects=0}),[{key:"saveObjects",value:function(e,t){this.numObjects=0,this._mask=t?oe.apply(t,{}):null;var i=e.objects,s=!t||t.visible,r=!t||t.edges,n=!t||t.xrayed,o=!t||t.highlighted,a=!t||t.selected,l=!t||t.clippable,u=!t||t.pickable,A=!t||t.colorize,c=!t||t.opacity;for(var h in i)if(i.hasOwnProperty(h)){var d=i[h],p=this.numObjects;if(s&&(this.objectsVisible[p]=d.visible),r&&(this.objectsEdges[p]=d.edges),n&&(this.objectsXrayed[p]=d.xrayed),o&&(this.objectsHighlighted[p]=d.highlighted),a&&(this.objectsSelected[p]=d.selected),l&&(this.objectsClippable[p]=d.clippable),u&&(this.objectsPickable[p]=d.pickable),A){var f=d.colorize;f?(this.objectsColorize[3*p+0]=f[0],this.objectsColorize[3*p+1]=f[1],this.objectsColorize[3*p+2]=f[2],this.objectsHasColorize[p]=!0):this.objectsHasColorize[p]=!1}c&&(this.objectsOpacity[p]=d.opacity),this.numObjects++}}},{key:"restoreObjects",value:function(e){var t=this._mask,i=!t||t.visible,s=!t||t.edges,r=!t||t.xrayed,n=!t||t.highlighted,o=!t||t.selected,a=!t||t.clippable,l=!t||t.pickable,u=!t||t.colorize,A=!t||t.opacity,c=0,h=e.objects;for(var d in h)if(h.hasOwnProperty(d)){var p=h[d];i&&(p.visible=this.objectsVisible[c]),s&&(p.edges=this.objectsEdges[c]),r&&(p.xrayed=this.objectsXrayed[c]),n&&(p.highlighted=this.objectsHighlighted[c]),o&&(p.selected=this.objectsSelected[c]),a&&(p.clippable=this.objectsClippable[c]),l&&(p.pickable=this.objectsPickable[c]),u&&(this.objectsHasColorize[c]?(hd[0]=this.objectsColorize[3*c+0],hd[1]=this.objectsColorize[3*c+1],hd[2]=this.objectsColorize[3*c+2],p.colorize=hd):p.colorize=null),A&&(p.opacity=this.objectsOpacity[c]),c++}}}])}(),pd=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s])).v0=s.v0,i.v1=s.v1,i.v2=s.v2,i.v3=s.v3,i.t=s.t,i}return m(t,Nh),w(t,[{key:"v0",get:function(){return this._v0},set:function(e){this._v0=e||J.vec3([0,0,0])}},{key:"v1",get:function(){return this._v1},set:function(e){this._v1=e||J.vec3([0,0,0])}},{key:"v2",get:function(){return this._v2},set:function(e){this._v2=e||J.vec3([0,0,0])}},{key:"v3",get:function(){return this._v3},set:function(e){this.fire("v3",this._v3=e||J.vec3([0,0,0]))}},{key:"t",get:function(){return this._t},set:function(e){e=e||0,this._t=e<0?0:e>1?1:e}},{key:"point",get:function(){return this.getPoint(this._t)}},{key:"getPoint",value:function(e){var t=J.vec3();return t[0]=J.b3(e,this._v0[0],this._v1[0],this._v2[0],this._v3[0]),t[1]=J.b3(e,this._v0[1],this._v1[1],this._v2[1],this._v3[1]),t[2]=J.b3(e,this._v0[2],this._v1[2],this._v2[2],this._v3[2]),t}},{key:"getJSON",value:function(){return{v0:this._v0,v1:this._v1,v2:this._v2,v3:this._v3,t:this._t}}}])}(),fd=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s]))._cachedLengths=[],i._dirty=!0,i._curves=[],i._t=0,i._dirtySubs=[],i._destroyedSubs=[],i.curves=s.curves||[],i.t=s.t,i}return m(t,Nh),w(t,[{key:"addCurve",value:function(e){this._curves.push(e),this._dirty=!0}},{key:"curves",get:function(){return this._curves},set:function(e){var t,i,s;for(e=e||[],i=0,s=this._curves.length;i<s;i++)(t=this._curves[i]).off(this._dirtySubs[i]),t.off(this._destroyedSubs[i]);this._curves=[],this._dirtySubs=[],this._destroyedSubs=[];var r=this;function n(){r._dirty=!0}function o(){var e=this.id;for(i=0,s=r._curves.length;i<s;i++)if(r._curves[i].id===e)return r._curves=r._curves.slice(i,i+1),r._dirtySubs=r._dirtySubs.slice(i,i+1),r._destroyedSubs=r._destroyedSubs.slice(i,i+1),void(r._dirty=!0)}for(i=0,s=e.length;i<s;i++){if(t=e[i],oe.isNumeric(t)||oe.isString(t)){var a=t;if(!(t=this.scene.components[a])){this.error("Component not found: "+_inQuotes(a));continue}}var l=t.type;"xeokit.SplineCurve"===l||"xeokit.Path"===l||"xeokit.CubicBezierCurve"===l||"xeokit.QuadraticBezierCurve"===l?(this._curves.push(t),this._dirtySubs.push(t.on("dirty",n)),this._destroyedSubs.push(t.once("destroyed",o))):this.error("Component "+_inQuotes(t.id)+" is not a xeokit.SplineCurve, xeokit.Path or xeokit.QuadraticBezierCurve")}this._dirty=!0}},{key:"t",get:function(){return this._t},set:function(e){e=e||0,this._t=e<0?0:e>1?1:e}},{key:"point",get:function(){return this.getPoint(this._t)}},{key:"length",get:function(){var e=this._getCurveLengths();return e[e.length-1]}},{key:"getPoint",value:function(e){for(var t,i=e*this.length,s=this._getCurveLengths(),r=0;r<s.length;){if(s[r]>=i){var n=1-(s[r]-i)/(t=this._curves[r]).length;return t.getPointAt(n)}r++}return null}},{key:"_getCurveLengths",value:function(){if(!this._dirty)return this._cachedLengths;var e,t=[],i=0,s=this._curves.length;for(e=0;e<s;e++)i+=this._curves[e].length,t.push(i);return this._cachedLengths=t,this._dirty=!1,t}},{key:"_getJSON",value:function(){for(var e=[],t=0,i=this._curves.length;t<i;t++)e.push(this._curves[t].id);return{curves:e,t:this._t}}},{key:"destroy",value:function(){var e,i,s;for(f(t,"destroy",this,3)([]),e=0,i=this._curves.length;e<i;e++)(s=this._curves[e]).off(this._dirtySubs[e]),s.off(this._destroyedSubs[e])}}])}(),vd=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s])).v0=s.v0,i.v1=s.v1,i.v2=s.v2,i.t=s.t,i}return m(t,Nh),w(t,[{key:"v0",get:function(){return this._v0},set:function(e){this._v0=e||J.vec3([0,0,0])}},{key:"v1",get:function(){return this._v1},set:function(e){this._v1=e||J.vec3([0,0,0])}},{key:"v2",get:function(){return this._v2},set:function(e){this._v2=e||J.vec3([0,0,0])}},{key:"t",get:function(){return this._t},set:function(e){e=e||0,this._t=e<0?0:e>1?1:e}},{key:"point",get:function(){return this.getPoint(this._t)}},{key:"getPoint",value:function(e){var t=J.vec3();return t[0]=J.b2(e,this._v0[0],this._v1[0],this._v2[0]),t[1]=J.b2(e,this._v0[1],this._v1[1],this._v2[1]),t[2]=J.b2(e,this._v0[2],this._v1[2],this._v2[2]),t}},{key:"getJSON",value:function(){return{v0:this._v0,v1:this._v1,v2:this._v2,t:this._t}}}])}(),gd=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),h(this,t,[e,i])}return m(t,vh),w(t)}(),md=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s]))._state=new Jt({active:!0,pos:J.vec3(),dir:J.vec3(),dist:0}),i.active=!s.active||s.active,i.pickable=!!s.pickable&&s.pickable,i.enableClip=!s.enableClip||s.enableClip,i.controlIdName=s.controlIdName?s.controlIdName:"",i.lineBox=s.lineBox?s.lineBox:null,i.visible=!1,i.planes=[],i.boxRanges=[],i.scene._sectionBoxCreated(i),i._initBoxPlanes(),i}return m(t,_e),w(t,[{key:"type",get:function(){return"SectionBox"}},{key:"_initBoxPlanes",value:function(){var e=this,t=this,i=this.scene.aabb,s=this.scene.center,r=i[3]-i[0],n=i[4]-i[1],o=i[5]-i[2];function a(e){var t;switch(e){case 0:return t=1*r+0,[s[0]-r/2+t,s[1],s[2]];case 1:return t=1*n+0,[s[0],s[1]-n/2+t,s[2]];case 2:return t=1*o+0,[s[0],s[1],s[2]-o/2+t];case 3:return t=0*r-0,[s[0]-r/2+t,s[1],s[2]];case 4:return t=0*n-0,[s[0],s[1]-n/2+t,s[2]];case 5:return t=0*o-0,[s[0],s[1],s[2]-o/2+t]}}for(var l=function(i){e.boxRanges.push(a(i));var s=function(e){switch(e){case 0:return[-1,0,0];case 1:return[0,-1,0];case 2:return[0,0,-1];case 3:return[1,0,0];case 4:return[0,1,0];case 5:return[0,0,1]}}(i),r=new hn(e.scene,{active:e.active,controlId:e.controlIdName+i.toString(),planeId:i,box:t,dir:s,pos:a(i),enableClip:e.enableClip,pickable:e.pickable});e.planes.push(r),5==i&&(e.lineBox._maxRange=e.boxRanges),r.on("pos",(function(t){t!=e.boxRanges[i]&&(e.boxRanges.length<6||e.lineBox.updateBox(r.dir,e.boxRanges))}))},u=0;u<6;u++)l(u)}},{key:"active",get:function(){return this._state.active},set:function(e){this._state.active=!1!==e,e||(this.visible=e),this.planes&&this.planes.forEach((function(t){t.active=e})),this.glRedraw(),this.fire("active",this._state.active)}},{key:"visible",get:function(){return this._state.visible},set:function(e){this._state.visible=0!=e,e&&!this.active&&(this.active=!0),this.planes&&this.planes.forEach((function(t){t.control.setVisible(e)}))}},{key:"dist",get:function(){return this._state.dist}},{key:"destroy",value:function(){this.planes.forEach((function(e){e.destroy()})),this._state.destroy(),this.scene._sectionBoxDestroyed(this),f(t,"destroy",this,3)([])}}])}(),_d=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,[e,s]))._skyboxMesh=new nn(i,{geometry:new Ti(i,{primitive:"triangles",positions:[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1],uv:[.5,.6666,.25,.6666,.25,.3333,.5,.3333,.5,.6666,.5,.3333,.75,.3333,.75,.6666,.5,.6666,.5,1,.25,1,.25,.6666,.25,.6666,0,.6666,0,.3333,.25,.3333,.25,0,.5,0,.5,.3333,.25,.3333,.75,.3333,1,.3333,1,.6666,.75,.6666],indices:[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]}),background:!0,scale:[2e3,2e3,2e3],rotation:[0,-90,0],material:new Qi(i,{ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],emissive:[1,1,1],emissiveMap:new On(i,{scale:s.scale,src:s.src,image:s.image,flipY:!0,wrapS:1e3,wrapT:1e3,encoding:s.encoding||"sRGB"}),backfaces:!0}),visible:!1,pickable:!1,clippable:!1,collidable:!1}),i.size=s.size,i.active=s.active,i}return m(t,_e),w(t,[{key:"size",get:function(){return this._size},set:function(e){this._size=e||1e3,this._skyboxMesh.scale=[this._size,this._size,this._size]}},{key:"active",get:function(){return this._skyboxMesh.visible},set:function(e){this._skyboxMesh.visible=e}}])}(),yd=function(){return w((function e(){B(this,e)}),[{key:"transcode",value:function(e,t){}},{key:"destroy",value:function(){}}])}(),bd=J.vec4(),Bd=J.vec4(),xd=J.vec3(),wd=J.vec3(),Pd=J.vec3(),Cd=J.vec4(),Md=J.vec4(),kd=J.vec4(),Fd=function(){return w((function e(t){B(this,e),this._scene=t}),[{key:"dollyToCanvasPos",value:function(e,t,i){var s=!1,r=this._scene.camera;if(e){var n=J.subVec3(e,r.eye,xd);s=J.lenVec3(n)<i}if("perspective"===r.projection){r.ortho.scale=r.ortho.scale-i;var o=this._unproject(t,Cd),a=J.subVec3(o,r.eye,kd),l=J.mulVec3Scalar(J.normalizeVec3(a),-i,[]);if(r.eye=[r.eye[0]-l[0],r.eye[1]-l[1],r.eye[2]-l[2]],r.look=[r.look[0]-l[0],r.look[1]-l[1],r.look[2]-l[2]],e){var u=J.subVec3(e,r.eye,xd),A=J.lenVec3(u),c=J.mulVec3Scalar(J.normalizeVec3(J.subVec3(r.look,r.eye,wd)),A);r.look=[r.eye[0]+c[0],r.eye[1]+c[1],r.eye[2]+c[2]]}}else if("ortho"===r.projection){var h=this._unproject(t,Cd);r.ortho.scale=r.ortho.scale-i,r.ortho._update();var d=this._unproject(t,Md),p=J.subVec3(d,h,kd),f=J.mulVec3Scalar(J.normalizeVec3(J.subVec3(r.look,r.eye,xd)),-i,wd),v=J.addVec3(p,f,Pd);r.eye=[r.eye[0]-v[0],r.eye[1]-v[1],r.eye[2]-v[2]],r.look=[r.look[0]-v[0],r.look[1]-v[1],r.look[2]-v[2]]}return s}},{key:"_unproject",value:function(e,t){var i=this._scene.camera,s=i.project.transposedMatrix,r=s.subarray(8,12),n=s.subarray(12),o=[0,0,-1,1],a=J.dotVec4(o,r)/J.dotVec4(o,n);return i.project.unproject(e,a,bd,Bd,t),t}},{key:"destroy",value:function(){}}])}(),Ed=J.vec3(),Dd=J.vec3(),Id=J.vec3(),Sd=J.vec4(),Td=J.vec4(),Ld=J.vec4(),Rd=function(){return w((function e(t,i){var s=this;B(this,e),this._scene=t,this._configs=i,this._pivotWorldPos=J.vec3(),this._cameraOffset=J.vec3(),this._azimuth=0,this._polar=0,this._radius=0,this._pivotPosSet=!1,this._pivoting=!1,this._shown=!1,this._pivotSphereEnabled=!1,this._pivotSphere=null,this._pivotSphereSize=1,this._pivotSphereGeometry=null,this._pivotSphereMaterial=null,this._rtcCenter=J.vec3(),this._rtcPos=J.vec3(),this._pivotViewPos=J.vec4(),this._pivotProjPos=J.vec4(),this._pivotCanvasPos=J.vec2(),this._cameraDirty=!0,this._onViewMatrix=this._scene.camera.on("viewMatrix",(function(){s._cameraDirty=!0})),this._onProjMatrix=this._scene.camera.on("projMatrix",(function(){s._cameraDirty=!0})),this._onTick=this._scene.on("tick",(function(){s.updatePivotElement(),s.updatePivotSphere()}))}),[{key:"createPivotSphere",value:function(){var e=this.getPivotPos(),t=J.vec3();J.decomposeMat4(J.inverseMat4(this._scene.viewer.camera.viewMatrix,J.mat4()),t,J.vec4(),J.vec3());var i=J.distVec3(t,e),s=Math.tan(Math.PI/500)*i*this._pivotSphereSize;"ortho"==this._scene.camera.projection&&(s/=this._scene.camera.ortho.scale/2),xe(e,this._rtcCenter,this._rtcPos),this._pivotSphereGeometry=new Hn(this._scene,ln({radius:s})),this._pivotSphere=new nn(this._scene,{geometry:this._pivotSphereGeometry,material:this._pivotSphereMaterial,pickable:!1,position:this._rtcPos,rtcCenter:this._rtcCenter})}},{key:"destroyPivotSphere",value:function(){this._pivotSphere&&(this._pivotSphere.destroy(),this._pivotSphere=null),this._pivotSphereGeometry&&(this._pivotSphereGeometry.destroy(),this._pivotSphereGeometry=null)}},{key:"getPointScreenPos",value:function(e){var t=this._scene.camera,i=this._scene.canvas.boundary,s=i[2],r=i[3],n=J.vec4(),o=J.vec4(),a=J.vec2();return J.transformPoint3(t.viewMatrix,e,n),J.transformPoint4(t.projMatrix,e,o),a[0]=Math.floor((1+o[0]/o[3])*s/2),a[1]=Math.floor((1-o[1]/o[3])*r/2),a}},{key:"updatePivotElement",value:function(){var e=this._scene.camera,t=this._scene.canvas;if(this._pivoting&&this._cameraDirty){J.transformPoint3(e.viewMatrix,this.getPivotPos(),this._pivotViewPos),this._pivotViewPos[3]=1,J.transformPoint4(e.projMatrix,this._pivotViewPos,this._pivotProjPos);var i=t.boundary,s=i[2],r=i[3];this._pivotCanvasPos[0]=Math.floor((1+this._pivotProjPos[0]/this._pivotProjPos[3])*s/2),this._pivotCanvasPos[1]=Math.floor((1-this._pivotProjPos[1]/this._pivotProjPos[3])*r/2);var n=t._lastBoundingClientRect,o=t.canvas;n=t._lastBoundingClientRect=o.getBoundingClientRect(),this._pivotElement&&(this._pivotElement.style.left=Math.floor(n.left+this._pivotCanvasPos[0])-this._pivotElement.clientWidth/2+window.scrollX,this._pivotElement.style.top=Math.floor(n.top+this._pivotCanvasPos[1])-this._pivotElement.clientHeight/2+window.scrollY),this._cameraDirty=!1}}},{key:"updatePivotSphere",value:function(){this._pivoting&&this._pivotSphere&&(xe(this.getPivotPos(),this._rtcCenter,this._rtcPos),J.compareVec3(this._rtcPos,this._pivotSphere.position)||(this.destroyPivotSphere(),this.createPivotSphere()))}},{key:"setPivotElement",value:function(e){this._pivotElement=e}},{key:"enablePivotSphere",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.destroyPivotSphere(),this._pivotSphereEnabled=!0,e.size&&(this._pivotSphereSize=e.size);var t=e.color||[1,0,0];this._pivotSphereMaterial=new Qi(this._scene,{emissive:t,ambient:t,specular:[0,0,0],diffuse:[0,0,0]})}},{key:"disablePivotSphere",value:function(){this.destroyPivotSphere(),this._pivotSphereEnabled=!1}},{key:"startPivot",value:function(){if(this._cameraLookingDownwards())return this._pivoting=!1,!1;var e=this._scene.camera,t=J.lookAtMat4v(e.eye,e.look,e.worldUp);J.transformPoint3(t,this.getPivotPos(),this._cameraOffset);var i=this.getPivotPos();this._cameraOffset[2]+=J.distVec3(e.eye,i),t=J.inverseMat4(t);var s=J.transformVec3(t,this._cameraOffset),r=J.vec3();if(J.subVec3(e.eye,i,r),J.addVec3(r,s),e.zUp){var n=r[1];r[1]=r[2],r[2]=n}this._radius=J.lenVec3(r),this._polar=Math.acos(r[1]/this._radius),this._azimuth=Math.atan2(r[0],r[2]),this._pivoting=!0}},{key:"_cameraLookingDownwards",value:function(){var e=this._scene.camera,t=J.normalizeVec3(J.subVec3(e.look,e.eye,Ed)),i=J.cross3Vec3(t,e.worldUp,Dd);return J.sqLenVec3(i)<=1e-4}},{key:"getPivoting",value:function(){return this._pivoting}},{key:"setPivotPos",value:function(e){this._pivotWorldPos&&this._pivotWorldPos.set(e),this._pivotPosSet=!0}},{key:"setCanvasPivotPos",value:function(e){var t=this._scene.camera,i=Math.abs(J.distVec3(this._scene.center,t.eye)),s=t.project.transposedMatrix,r=s.subarray(8,12),n=s.subarray(12),o=[0,0,-1,1],a=J.dotVec4(o,r)/J.dotVec4(o,n),l=Sd;t.project.unproject(e,a,Td,Ld,l);var u=J.normalizeVec3(J.subVec3(l,t.eye,Ed)),A=J.addVec3(t.eye,J.mulVec3Scalar(u,i,Dd),Id);this.setPivotPos(A)}},{key:"getPivotPos",value:function(){return this._pivotPosSet?this._pivotWorldPos:this._scene.camera.look}},{key:"continuePivot",value:function(e,t){if(this._pivoting&&(0!==e||0!==t)){var i=this._scene.camera,s=-e,r=-t;1===i.worldUp[2]&&(s=-s),this._azimuth+=.01*-s,this._polar+=.01*r,this._polar=J.clamp(this._polar,.001,Math.PI-.001);var n=[this._radius*Math.sin(this._polar)*Math.sin(this._azimuth),this._radius*Math.cos(this._polar),this._radius*Math.sin(this._polar)*Math.cos(this._azimuth)];if(1===i.worldUp[2]){var o=n[1];n[1]=n[2],n[2]=o}var a=J.lenVec3(J.subVec3(i.look,i.eye,J.vec3())),l=this.getPivotPos();J.addVec3(n,l);var u=J.lookAtMat4v(n,l,i.worldUp);u=J.inverseMat4(u);var A=J.transformVec3(u,this._cameraOffset);u[12]-=A[0],u[13]-=A[1],u[14]-=A[2];var c=[u[8],u[9],u[10]];i.eye=[u[12],u[13],u[14]],J.subVec3(i.eye,J.mulVec3Scalar(c,a),i.look),i.up=[u[4],u[5],u[6]],this.showPivot()}}},{key:"showPivot",value:function(){this._shown||(this._pivotElement&&(this.updatePivotElement(),this._pivotElement.style.visibility="visible"),this._pivotSphereEnabled&&(this.destroyPivotSphere(),this.createPivotSphere()),this._shown=!0)}},{key:"hidePivot",value:function(){this._shown&&(this._pivotElement&&(this._pivotElement.style.visibility="hidden"),this._pivotSphereEnabled&&this.destroyPivotSphere(),this._shown=!1)}},{key:"endPivot",value:function(){this._pivoting=!1}},{key:"destroy",value:function(){this._pivotElement&&this._pivotElement.parentNode.removeChild(this._pivotElement),this.destroyPivotSphere(),this._scene.camera.off(this._onViewMatrix),this._scene.camera.off(this._onProjMatrix),this._scene.off(this._onTick)}}])}(),Ud=function(){return w((function e(t,i){B(this,e),this._scene=t.scene,this._cameraControl=t,this._scene.canvas.canvas.oncontextmenu=function(e){e.preventDefault()},this._configs=i,this.schedulePickEntity=!1,this.schedulePickSurface=!1,this.scheduleSnapOrPick=!1,this.pickCursorPos=J.vec2(),this.picked=!1,this.pickedSurface=!1,this.pickResult=null,this._lastPickedEntityId=null,this._lastHash=null,this._needFireEvents=0}),[{key:"update",value:function(){if(this._configs.pointerEnabled&&(this.schedulePickEntity||this.schedulePickSurface)){var e="".concat(~~this.pickCursorPos[0],"-").concat(~~this.pickCursorPos[1],"-").concat(this.scheduleSnapOrPick,"-").concat(this.schedulePickSurface,"-").concat(this.schedulePickEntity);if(this._lastHash!==e){this.picked=!1,this.pickedSurface=!1,this.snappedOrPicked=!1,this.hoveredSnappedOrSurfaceOff=!1;var t=this._cameraControl.hasSubs("hoverSurface");if(this.scheduleSnapOrPick){var i=this._scene.pick({canvasPos:this.pickCursorPos,snapRadius:this._configs.snapRadius,snapToVertex:this._configs.snapToVertex,snapToEdge:this._configs.snapToEdge});i&&(i.snappedToEdge||i.snappedToVertex)?(this.snapPickResult=i,this.snappedOrPicked=!0,this._needFireEvents++):(this.schedulePickSurface=!0,this.snapPickResult=null)}if(this.schedulePickSurface&&this.pickResult&&this.pickResult.worldPos){var s=this.pickResult.canvasPos;if(s){if(s[0]===this.pickCursorPos[0]&&s[1]===this.pickCursorPos[1])return this.picked=!0,this.pickedSurface=!0,this._needFireEvents+=t?1:0,this.schedulePickEntity=!1,this.schedulePickSurface=!1,this.scheduleSnapOrPick?this.snappedOrPicked=!0:this.hoveredSnappedOrSurfaceOff=!0,void(this.scheduleSnapOrPick=!1)}else console.log("no pickResultCanvasPos")}if(this.schedulePickEntity&&this.pickResult&&(this.pickResult.canvasPos||this.pickResult.snappedCanvasPos)){var r=this.pickResult.canvasPos||this.pickResult.snappedCanvasPos;if(r[0]===this.pickCursorPos[0]&&r[1]===this.pickCursorPos[1])return this.picked=!0,this.pickedSurface=!1,this.schedulePickEntity=!1,void(this.schedulePickSurface=!1)}this.schedulePickSurface||this.scheduleSnapOrPick&&!this.snapPickResult?(this.pickResult=this._scene.pick({pickSurface:!0,pickSurfaceNormal:!1,canvasPos:this.pickCursorPos}),this.pickResult?(this.picked=!0,this.scheduleSnapOrPick?this.snappedOrPicked=!0:this.pickedSurface=!0,this._needFireEvents++):this.scheduleSnapOrPick&&(this.hoveredSnappedOrSurfaceOff=!0,this._needFireEvents++)):(this.pickResult=this._scene.pick({canvasPos:this.pickCursorPos}),this.pickResult&&(this.picked=!0,this.pickedSurface=!1,this._needFireEvents++)),this.scheduleSnapOrPick=!1,this.schedulePickEntity=!1,this.schedulePickSurface=!1}}}},{key:"fireEvents",value:function(){if(0!==this._needFireEvents){if(this.hoveredSnappedOrSurfaceOff&&this._cameraControl.fire("hoverSnapOrSurfaceOff",{canvasPos:this.pickCursorPos,pointerPos:this.pickCursorPos},!0),this.snappedOrPicked)if(this.snapPickResult){var e=new Bt;e.snappedToVertex=this.snapPickResult.snappedToVertex,e.snappedToEdge=this.snapPickResult.snappedToEdge,e.worldPos=this.snapPickResult.worldPos,e.canvasPos=this.pickCursorPos,e.snappedCanvasPos=this.snapPickResult.snappedCanvasPos,this._cameraControl.fire("hoverSnapOrSurface",e,!0),this.snapPickResult=null}else this._cameraControl.fire("hoverSnapOrSurface",this.pickResult,!0);if(this.picked&&this.pickResult&&(this.pickResult.entity||this.pickResult.worldPos)){if(this.pickResult.entity){var t=this.pickResult.entity.id;this._lastPickedEntityId!==t&&(void 0!==this._lastPickedEntityId&&this._cameraControl.fire("hoverOut",{entity:this._scene.objects[this._lastPickedEntityId]},!0),this._cameraControl.fire("hoverEnter",this.pickResult,!0),this._lastPickedEntityId=t)}this._cameraControl.fire("hover",this.pickResult,!0),this.pickResult.worldPos&&(this.pickedSurface=!0,this._cameraControl.fire("hoverSurface",this.pickResult,!0))}else void 0!==this._lastPickedEntityId&&(this._cameraControl.fire("hoverOut",{entity:this._scene.objects[this._lastPickedEntityId]},!0),this._lastPickedEntityId=void 0),this._cameraControl.fire("hoverOff",{canvasPos:this.pickCursorPos},!0);this.pickResult=null,this._needFireEvents=0}}}])}(),Od=J.vec2(),Qd=function(){return w((function e(t,i,s,r,n){B(this,e),this._scene=t;var o,a,l,u=i.pickController,A=0,c=0,h=0,d=0,p=!1,f=J.vec3(),v=!0,g=this._scene.canvas.canvas,m=[];function _(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];g.style.cursor="move",A=r.pointerCanvasPos[0],c=r.pointerCanvasPos[1],h=r.pointerCanvasPos[0],d=r.pointerCanvasPos[1],e&&(u.pickCursorPos=r.pointerCanvasPos,u.schedulePickSurface=!0,u.update(),u.picked&&u.pickedSurface&&u.pickResult&&u.pickResult.worldPos?(p=!0,f.set(u.pickResult.worldPos)):p=!1)}document.addEventListener("keydown",this._documentKeyDownHandler=function(e){if(s.active&&s.pointerEnabled&&t.input.keyboardEnabled){var i=e.keyCode;m[i]=!0}}),document.addEventListener("keyup",this._documentKeyUpHandler=function(e){if(s.active&&s.pointerEnabled&&t.input.keyboardEnabled){var i=e.keyCode;m[i]=!1}}),g.addEventListener("mousedown",this._mouseDownHandler=function(e){if(s.active&&s.pointerEnabled)switch(e.which){case 1:m[t.input.KEY_SHIFT]||s.planView?(o=!0,_()):(o=!0,_(!1));break;case 2:a=!0,_();break;case 3:l=!0,s.panRightClick&&_()}}),document.addEventListener("mousemove",this._documentMouseMoveHandler=function(e){if(s.active&&s.pointerEnabled&&(o||a||l)){var i=t.canvas.boundary,u=i[2],h=i[3],d=r.pointerCanvasPos[0],v=r.pointerCanvasPos[1],g=m[t.input.KEY_SHIFT]||s.planView||!s.panRightClick&&a||s.panRightClick&&l,_=document.pointerLockElement?e.movementX:d-A,y=document.pointerLockElement?e.movementY:v-c;if(g){var b=t.camera;if("perspective"===b.projection){var B=Math.abs(p?J.lenVec3(J.subVec3(f,t.camera.eye,[])):t.camera.eyeLookDist)*Math.tan(b.perspective.fov/2*Math.PI/180);b.yUp&&(n.panDeltaX+=1.5*_*B/h,n.panDeltaY+=1.5*y*B/h),b.zUp&&(n.panDeltaX+=1.5*_*B/h,n.panDeltaY+=1.5*y*B/h)}else b.yUp&&(n.panDeltaX+=.5*b.ortho.scale*(_/h),n.panDeltaY+=.5*b.ortho.scale*(y/h)),b.zUp&&(n.panDeltaX+=.5*b.ortho.scale*(_/h),n.panDeltaY+=.5*b.ortho.scale*(y/h))}else!o||a||l||s.planView||(s.firstPerson?(n.rotateDeltaY-=_/u*(s.dragRotationRate/2),n.rotateDeltaX+=y/h*(s.dragRotationRate/4)):(n.rotateDeltaY-=_/u*(1.5*s.dragRotationRate),n.rotateDeltaX+=y/h*(1.5*s.dragRotationRate)));A=d,c=v}}),g.addEventListener("mousemove",this._canvasMouseMoveHandler=function(e){s.active&&s.pointerEnabled&&r.mouseover&&(v=!0)}),document.addEventListener("mouseup",this._documentMouseUpHandler=function(e){if(s.active&&s.pointerEnabled)switch(e.which){case 1:case 2:case 3:o=!1,a=!1,l=!1}}),g.addEventListener("mouseup",this._mouseUpHandler=function(e){if(s.active&&s.pointerEnabled){if(3===e.which){!function(e,t){if(e){for(var i=e.target,s=0,r=0,n=0,o=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,n+=i.scrollLeft,o+=i.scrollTop,i=i.offsetParent;t[0]=e.pageX+n-s,t[1]=e.pageY+o-r}else e=window.event,t[0]=e.x,t[1]=e.y}(e,Od);var t=Od[0],r=Od[1];Math.abs(t-h)<3&&Math.abs(r-d)<3&&i.cameraControl.fire("rightClick",{pagePos:[Math.round(e.pageX),Math.round(e.pageY)],canvasPos:Od,event:e},!0)}g.style.removeProperty("cursor")}}),g.addEventListener("mouseenter",this._mouseEnterHandler=function(){s.active&&s.pointerEnabled});var y=1/60,b=null;this._scene.on("collideWithEntity",(function(e){})),g.addEventListener("wheel",this._mouseWheelHandler=function(e){if(s.active&&s.pointerEnabled&&s.zoomOnMouseWheel){var t=performance.now()/1e3,i=null!==b?t-b:0;b=t,i>.05&&(i=.05),i<y&&(i=y);var o=Math.max(-1,Math.min(1,40*-e.deltaY));if(0!==o){var a=o/Math.abs(o);n.dollyDelta+=-a*i*s.mouseWheelDollyRate,v&&(r.followPointerDirty=!0,v=!1)}}},{passive:!0})}),[{key:"reset",value:function(){}},{key:"destroy",value:function(){var e=this._scene.canvas.canvas;document.removeEventListener("keydown",this._documentKeyDownHandler),document.removeEventListener("keyup",this._documentKeyUpHandler),e.removeEventListener("mousedown",this._mouseDownHandler),document.removeEventListener("mousemove",this._documentMouseMoveHandler),e.removeEventListener("mousemove",this._canvasMouseMoveHandler),document.removeEventListener("mouseup",this._documentMouseUpHandler),e.removeEventListener("mouseup",this._mouseUpHandler),e.removeEventListener("mouseenter",this._mouseEnterHandler),e.removeEventListener("wheel",this._mouseWheelHandler)}}])}(),Nd=J.vec3(),Vd=J.vec3(),Hd=J.vec3(),jd=J.vec3(),Gd=J.vec3(),zd={eye:J.vec3(),look:J.vec3(),up:J.vec3()},Wd=function(){return w((function e(t,i,s,r){B(this,e),this._scene=t,this.input=t.input;var n=i.cameraControl,o=t.camera;this._onSceneKeyDown=t.input.on("keydown",(function(){if(s.active&&s.pointerEnabled&&t.input.keyboardEnabled&&r.mouseover){var e=n._isKeyDownForAction(n.AXIS_VIEW_RIGHT),a=n._isKeyDownForAction(n.AXIS_VIEW_BACK),l=n._isKeyDownForAction(n.AXIS_VIEW_LEFT),u=n._isKeyDownForAction(n.AXIS_VIEW_FRONT),A=n._isKeyDownForAction(n.AXIS_VIEW_TOP),c=n._isKeyDownForAction(n.AXIS_VIEW_BOTTOM);if(e||a||l||u||A||c){var h=t.aabb,d=J.getAABB3Diag(h);J.getAABB3Center(h,Nd);var p=Math.abs(d/Math.tan(i.cameraFlight.fitFOV*J.DEGTORAD)),f=1.1*d;zd.orthoScale=f,e?(zd.eye.set(J.addVec3(Nd,J.mulVec3Scalar(o.worldRight,p,Vd),Gd)),zd.look.set(Nd),zd.up.set(o.worldUp)):a?(zd.eye.set(J.addVec3(Nd,J.mulVec3Scalar(o.worldForward,p,Vd),Gd)),zd.look.set(Nd),zd.up.set(o.worldUp)):l?(zd.eye.set(J.addVec3(Nd,J.mulVec3Scalar(o.worldRight,-p,Vd),Gd)),zd.look.set(Nd),zd.up.set(o.worldUp)):u?(zd.eye.set(J.addVec3(Nd,J.mulVec3Scalar(o.worldForward,-p,Vd),Gd)),zd.look.set(Nd),zd.up.set(o.worldUp)):A?(zd.eye.set(J.addVec3(Nd,J.mulVec3Scalar(o.worldUp,p,Vd),Gd)),zd.look.set(Nd),zd.up.set(J.normalizeVec3(J.mulVec3Scalar(o.worldForward,1,Hd),jd))):c&&(zd.eye.set(J.addVec3(Nd,J.mulVec3Scalar(o.worldUp,-p,Vd),Gd)),zd.look.set(Nd),zd.up.set(J.normalizeVec3(J.mulVec3Scalar(o.worldForward,-1,Hd)))),!s.firstPerson&&s.followPointer&&i.pivotController.setPivotPos(Nd),i.cameraFlight.duration>0?i.cameraFlight.flyTo(zd,(function(){i.pivotController.getPivoting()&&s.followPointer&&i.pivotController.showPivot()})):(i.cameraFlight.jumpTo(zd),i.pivotController.getPivoting()&&s.followPointer&&i.pivotController.showPivot())}}}))}),[{key:"reset",value:function(){}},{key:"destroy",value:function(){this.input.off(this._onSceneKeyDown)}}])}(),Kd=function(){return w((function e(t,i,s,r,n){var o=this;B(this,e),this._scene=t;var a=i.pickController,l=i.pivotController,u=i.cameraControl;this._clicks=0,this._timeout=null,this._lastPickedEntityId=null,this._lastClickedWorldPos=null;var A=!1,c=!1;this.canvas=this._scene.canvas.canvas;var h=function(e){var s;e&&e.worldPos&&(s=e.worldPos);var r=e&&e.entity?e.entity.aabb:t.aabb;if(s){var n=t.camera;J.subVec3(n.eye,n.look,[]),i.cameraFlight.flyTo({aabb:r})}else i.cameraFlight.flyTo({aabb:r})},d=t.tickify(this._canvasMouseMoveHandler=function(e){if(s.active&&s.pointerEnabled&&!A&&!c){if(u.hasSubs("rayMove")){var i=J.vec3(),n=J.vec3();J.canvasPosToWorldRay(t.canvas.canvas,t.camera.viewMatrix,t.camera.projMatrix,t.camera.projection,r.pointerCanvasPos,i,n),u.fire("rayMove",{canvasPos:r.pointerCanvasPos,ray:{origin:i,direction:n,canvasPos:r.pointerCanvasPos}},!0)}var l=u.hasSubs("hover"),h=u.hasSubs("hoverEnter"),d=u.hasSubs("hoverOut"),p=u.hasSubs("hoverOff"),f=u.hasSubs("hoverSurface"),v=u.hasSubs("hoverSnapOrSurface");if(l||h||d||p||f||v)if(a.pickCursorPos=r.pointerCanvasPos,a.schedulePickEntity=!0,a.schedulePickSurface=f,a.scheduleSnapOrPick=v,a.update(),a.pickResult){if(a.pickResult.entity){var g=a.pickResult.entity.id;o._lastPickedEntityId!==g&&(void 0!==o._lastPickedEntityId&&u.fire("hoverOut",{entity:t.objects[o._lastPickedEntityId]},!0),u.fire("hoverEnter",a.pickResult,!0),o._lastPickedEntityId=g)}u.fire("hover",a.pickResult,!0),(a.pickResult.worldPos||a.pickResult.snappedWorldPos)&&u.fire("hoverSurface",a.pickResult,!0)}else void 0!==o._lastPickedEntityId&&(u.fire("hoverOut",{entity:t.objects[o._lastPickedEntityId]},!0),o._lastPickedEntityId=void 0),u.fire("hoverOff",{canvasPos:a.pickCursorPos},!0)}});this.canvas.addEventListener("mousemove",d),this.canvas.addEventListener("dblclick",this._canvasDblClickHandler=function(e){r.mouseDownClientX=e.clientX,r.mouseDownClientY=e.clientY,r.mouseDownCursorX=r.pointerCanvasPos[0],r.mouseDownCursorY=r.pointerCanvasPos[1],s.followPointer&&(a.pickCursorPos=r.pointerCanvasPos,a.schedulePickSurface=!0,a.update()),a.pickResult?(u.fire("doublePicked",a.pickResult,!0),a.pickedSurface&&u.fire("doublePickedSurface",a.pickResult,!0)):u.fire("doublePickedNothing",{canvasPos:r.pointerCanvasPos},!0)}),this.canvas.addEventListener("mousedown",this._canvasMouseDownHandler=function(e){if(1===e.which&&(A=!0),3===e.which&&(c=!0),1===e.which&&s.active&&s.pointerEnabled&&(r.mouseDownClientX=e.clientX,r.mouseDownClientY=e.clientY,r.mouseDownCursorX=r.pointerCanvasPos[0],r.mouseDownCursorY=r.pointerCanvasPos[1],!s.firstPerson&&s.followPointer&&(a.pickCursorPos=r.pointerCanvasPos,a.schedulePickSurface=!0,a.update(),1===e.which))){var i=a.pickResult;i&&i.worldPos?(l.setCanvasPivotPos(r.pointerCanvasPos),u.fire("mouseDownEntity",a.pickResult,!0),o._lastClickedWorldPos=i.worldPos):(s.smartPivot?l.setCanvasPivotPos(r.pointerCanvasPos):o._lastClickedWorldPos?l.setPivotPos(o._lastClickedWorldPos):l.setPivotPos(t.camera.look),l.startPivot(),u.fire("mouseDownNothing",a.pickResult,!0))}}),document.addEventListener("mouseup",this._documentMouseUpHandler=function(e){1===e.which&&(A=!1),3===e.which&&(c=!1),l.getPivoting()&&l.endPivot()}),this.canvas.addEventListener("mouseup",this._canvasMouseUpHandler=function(e){if(s.active&&s.pointerEnabled&&(1===e.which&&(l.hidePivot(),!(Math.abs(e.clientX-r.mouseDownClientX)>3||Math.abs(e.clientY-r.mouseDownClientY)>3)))){var n=u.hasSubs("picked"),A=u.hasSubs("pickedNothing"),c=u.hasSubs("pickedSurface"),d=u.hasSubs("doublePicked"),p=u.hasSubs("doublePickedSurface"),f=u.hasSubs("doublePickedNothing");if(!(s.doublePickFlyTo||d||p||f))return(n||A||c)&&(a.pickCursorPos=r.pointerCanvasPos,a.schedulePickEntity=!0,a.schedulePickSurface=c,a.update(),a.pickResult?(u.fire("picked",a.pickResult,!0),a.pickedSurface&&u.fire("pickedSurface",a.pickResult,!0)):u.fire("pickedNothing",{canvasPos:r.pointerCanvasPos},!0)),void(o._clicks=0);if(o._clicks++,1===o._clicks){a.pickCursorPos=r.pointerCanvasPos,a.schedulePickEntity=s.doublePickFlyTo,a.schedulePickSurface=c,a.update();var v=a.pickResult,g=a.pickedSurface;o._timeout=setTimeout((function(){v&&v.worldPos?(u.fire("picked",v,!0),g&&(u.fire("pickedSurface",v,!0),!s.firstPerson&&s.followPointer&&(i.pivotController.setPivotPos(v.worldPos),i.pivotController.startPivot()&&i.pivotController.showPivot()))):u.fire("pickedNothing",{canvasPos:r.pointerCanvasPos},!0),o._clicks=0}),s.doubleClickTimeFrame)}else{if(null!==o._timeout&&(window.clearTimeout(o._timeout),o._timeout=null),a.pickCursorPos=r.pointerCanvasPos,a.schedulePickEntity=s.doublePickFlyTo||d||p,a.schedulePickSurface=a.schedulePickEntity&&p,a.update(),a.pickResult){if(u.fire("doublePicked",a.pickResult,!0),a.pickedSurface&&u.fire("doublePickedSurface",a.pickResult,!0),s.doublePickFlyTo&&(h(a.pickResult),!s.firstPerson&&s.followPointer)){var m=a.pickResult.entity.aabb,_=J.getAABB3Center(m);i.pivotController.setPivotPos(_),i.pivotController.startPivot()&&i.pivotController.showPivot()}}else if(u.fire("doublePickedNothing",{canvasPos:r.pointerCanvasPos},!0),s.doublePickFlyTo&&(h(),!s.firstPerson&&s.followPointer)){var y=t.aabb,b=J.getAABB3Center(y);i.pivotController.setPivotPos(b),i.pivotController.startPivot()&&i.pivotController.showPivot()}o._clicks=0}}},!1)}),[{key:"reset",value:function(){this._clicks=0,this._lastPickedEntityId=null,this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null)}},{key:"destroy",value:function(){null!=this.canvas&&(this.canvas.removeEventListener("mousemove",this._canvasMouseMoveHandler),this.canvas.removeEventListener("mousedown",this._canvasMouseDownHandler),this.canvas.removeEventListener("dblclick",this._canvasDblClickHandler),this.canvas.removeEventListener("mouseup",this._canvasMouseUpHandler)),document.removeEventListener("mouseup",this._documentMouseUpHandler),this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null)}}])}(),Xd=function(){return w((function e(t,i,s,r,n,o){var a=this;B(this,e),this._scene=t,this._updates=n,this._cameraControl=o;var l=t.input;this.input=l;var u=[];this._movespeed=6,this._movespeedList=[.02,.05,.1,.2,.3,.5,1,1.5,2,2.5,3,3.5,4,8,10,12,16,24,32];var A=t.canvas.canvas,c=!1,h=!1,d=!0;this._onSceneMouseMove=l.on("mousemove",(function(){d=!0})),this._onSceneKeyDown=l.on("keydown",(function(e){s.active&&s.pointerEnabled&&t.input.keyboardEnabled&&r.mouseover&&(u[e]=!0,e===l.KEY_SHIFT&&(A.style.cursor="move"),e===l.KEY_EQUAL_SIGN&&(c||(c=!0)),e===l.KEY_DASH&&(h||(h=!0)))})),this._onSceneKeyUp=l.on("keyup",(function(e){s.active&&s.pointerEnabled&&t.input.keyboardEnabled&&(u[e]=!1,e===l.KEY_SHIFT&&(A.style.cursor=null),i.pivotController.getPivoting()&&i.pivotController.endPivot(),e===l.KEY_ADD&&(c=!1),e===l.KEY_SUBTRACT&&(h=!1))}));var p=!0;this._scene.on("collideWithEntity",(function(e){p=!e})),this._onTick=t.on("tick",(function(e){if(s.active&&s.pointerEnabled&&t.input.keyboardEnabled&&r.mouseover){var o=i.cameraControl,A=e.deltaTime/1e3;if(!s.planView){var f=o._isKeyDownForAction(o.ROTATE_Y_POS,u),v=o._isKeyDownForAction(o.ROTATE_Y_NEG,u),g=o._isKeyDownForAction(o.ROTATE_X_POS,u),m=o._isKeyDownForAction(o.ROTATE_X_NEG,u),_=A*s.keyboardRotationRate;(f||v||g||m)&&(!s.firstPerson&&s.followPointer&&i.pivotController.startPivot(),f?n.rotateDeltaY+=_*a._movespeedList[a._movespeed]:v&&(n.rotateDeltaY-=_*a._movespeedList[a._movespeed]),g?n.rotateDeltaX+=_*a._movespeedList[a._movespeed]:m&&(n.rotateDeltaX-=_*a._movespeedList[a._movespeed]),!s.firstPerson&&s.followPointer&&i.pivotController.startPivot())}if(!u[l.KEY_CTRL]&&!u[l.KEY_ALT]){var y=o._isKeyDownForAction(o.DOLLY_BACKWARDS,u),b=o._isKeyDownForAction(o.DOLLY_FORWARDS,u);if(y||b){var B=A*s.keyboardDollyRate;if(!s.firstPerson&&s.followPointer&&i.pivotController.startPivot(),b){if(!p)return;n.dollyDelta-=B*a._movespeedList[a._movespeed]}else y&&(n.dollyDelta+=B*a._movespeedList[a._movespeed]);d&&(r.followPointerDirty=!0,d=!1)}}var x=o._isKeyDownForAction(o.SPEED_UP,u),w=o._isKeyDownForAction(o.SPEED_DOWN,u);(x||w)&&(c&&(a._movespeed<a._movespeedList.length-1&&(a._movespeed+=1),a._cameraControl.fire("personModeSpeedUp",a._movespeedList[a._movespeed]),c=!1),h&&(a._movespeed>0&&(a._movespeed-=1),a._cameraControl.fire("personModeSpeedDown",a._movespeedList[a._movespeed]),h=!1));var P=o._isKeyDownForAction(o.PAN_FORWARDS,u),C=o._isKeyDownForAction(o.PAN_BACKWARDS,u),M=o._isKeyDownForAction(o.PAN_LEFT,u),k=o._isKeyDownForAction(o.PAN_RIGHT,u),F=o._isKeyDownForAction(o.PAN_UP,u),E=o._isKeyDownForAction(o.PAN_DOWN,u),D=a._movespeedList[a._movespeed]*A*s.keyboardPanRate;(P||C||M||k||F||E)&&(!s.firstPerson&&s.followPointer&&i.pivotController.startPivot(),E?n.panDeltaY+=D:F&&(n.panDeltaY+=-D),k?n.panDeltaX+=-D:M&&(n.panDeltaX+=D),C?n.panDeltaZ+=D:P&&(n.panDeltaZ+=-D))}}))}),[{key:"movespeed",get:function(){return this._movespeed},set:function(e){this._movespeed=e}},{key:"moveRate",get:function(){return this._movespeedList[this._movespeed]}},{key:"speedUp",value:function(){this._movespeed<this._movespeedList.length-1&&(this._movespeed+=1),this._cameraControl.fire("personModeSpeedUp",this._movespeedList[this._movespeed])}},{key:"speedDown",value:function(){this._movespeed>0&&(this._movespeed-=1),this._cameraControl.fire("personModeSpeedDown",this._movespeedList[this._movespeed])}},{key:"reset",value:function(){}},{key:"destroy",value:function(){this._scene.off(this._onTick),this.input.off(this._onSceneMouseMove),this.input.off(this._onSceneKeyDown),this.input.off(this._onSceneKeyUp)}}])}(),Yd=.001,Jd=J.vec3(),Zd=function(){return w((function e(t,i,s,r,n){B(this,e),this._scene=t;var o=t.viewer,a=t.camera,l=i.pickController,u=i.pivotController,A=i.panController,c=1,h=1,d=1,p=null,f=1;this._scene.on("aabb",(function(e){var t=e[3]-e[0],i=e[4]-e[1],s=e[5]-e[2],r=Math.min(t,i,s),n=Math.max(t,i,s);n>500&&(d=parseInt((n+r)/2*10/500)),0==r?(f=.01,d=.01):r<10&&(f=.001*parseInt(.1/r),d=.01*parseInt(.1/r))})),this._onTick=t.on("tick",(function(){if(s.active&&s.pointerEnabled){var e="default";if(Math.abs(n.dollyDelta)<Yd*f&&(n.dollyDelta=0),Math.abs(n.rotateDeltaX)<Yd*f&&(n.rotateDeltaX=0),Math.abs(n.rotateDeltaY)<Yd*f&&(n.rotateDeltaY=0),0===n.rotateDeltaX&&0===n.rotateDeltaY||(n.dollyDelta=0),s.followPointer){if(--c<=0&&(c=1,0!==n.dollyDelta)){if(0===n.rotateDeltaY&&0===n.rotateDeltaX&&s.followPointer&&r.followPointerDirty&&(l.pickCursorPos=r.pointerCanvasPos,l.schedulePickSurface=!0,l.update(),l.pickResult&&l.pickResult.worldPos?p=l.pickResult.worldPos:(h=d,p=null),r.followPointerDirty=!1),p){var i=Math.abs(J.lenVec3(J.subVec3(p,t.camera.eye,Jd)));h=i/s.dollyProximityThreshold}h<s.dollyMinSpeed&&(h=s.dollyMinSpeed)}}else h=d,p=null;var v=n.dollyDelta*h;if(0===n.rotateDeltaY&&0===n.rotateDeltaX||(!s.firstPerson&&s.followPointer&&u.getPivoting()?a.yUp?u.continuePivot(n.rotateDeltaY*a.up[1],n.rotateDeltaX*a.up[1]):u.continuePivot(n.rotateDeltaY,n.rotateDeltaX):(0!==n.rotateDeltaX&&(s.firstPerson?a.pitch(-n.rotateDeltaX):a.orbitPitch(n.rotateDeltaX)),0!==n.rotateDeltaY&&(s.firstPerson?a.yaw(n.rotateDeltaY):a.orbitYaw(n.rotateDeltaY))),n.rotateDeltaX*=s.rotationInertia,n.rotateDeltaY*=s.rotationInertia,e="grabbing"),Math.abs(n.panDeltaX)<Yd*f&&(n.panDeltaX=0),Math.abs(n.panDeltaY)<Yd*f&&(n.panDeltaY=0),Math.abs(n.panDeltaZ)<Yd*f&&(n.panDeltaZ=0),0!==n.panDeltaX||0!==n.panDeltaY||0!==n.panDeltaZ){var g,m,_=J.vec3();if(_[0]=n.panDeltaX,_[1]=n.panDeltaY,_[2]=n.panDeltaZ,s.constrainVertical){a.xUp?(g=a.eye[0],m=a.look[0]):a.yUp?(g=a.eye[1],m=a.look[1]):a.zUp&&(g=a.eye[2],m=a.look[2]),a.pan(_);var y=a.eye,b=a.look;a.xUp?(y[0]=g,b[0]=m):a.yUp?(y[1]=g,b[1]=m):a.zUp&&(y[2]=g,b[2]=m),a.eye=y,a.look=b}else a.pan(_);e="grabbing"}if(n.panDeltaX*=s.panInertia,n.panDeltaY*=s.panInertia,n.panDeltaZ*=s.panInertia,0!==v){if(e=v<0?"zoom-in":"zoom-out",s.firstPerson){var B,x;if(s.constrainVertical&&(a.xUp?(B=a.eye[0],x=a.look[0]):a.yUp?(B=a.eye[1],x=a.look[1]):a.zUp&&(B=a.eye[2],x=a.look[2])),s.followPointer)A.dollyToCanvasPos(p,r.pointerCanvasPos,-v)&&(r.followPointerDirty=!0);else a.pan([0,0,v]),a.ortho.scale=a.ortho.scale-v;if(s.constrainVertical){var w=a.eye,P=a.look;a.xUp?(w[0]=B,P[0]=x):a.yUp?(w[1]=B,P[1]=x):a.zUp&&(w[2]=B,P[2]=x),a.eye=w,a.look=P}}else if(s.planView){if(s.followPointer)A.dollyToCanvasPos(p,r.pointerCanvasPos,-v)&&(r.followPointerDirty=!0);else a.ortho.scale=a.ortho.scale+v,a.zoom(v)}else{if(s.followPointer)A.dollyToCanvasPos(p,r.pointerCanvasPos,-v)&&(r.followPointerDirty=!0);else a.ortho.scale=a.ortho.scale+v,a.zoom(v)}n.dollyDelta*=s.dollyInertia}l.fireEvents(),o.navCube.MOUSEDOWN||o.navCube.MOUSEOVER||(document.body.style.cursor=e)}}))}),[{key:"destroy",value:function(){this._scene.off(this._onTick)}}])}(),qd=function(){return w((function e(t,i,s,r,n){var o=this;B(this,e),this._scene=t,this.canvas=this._scene.canvas.canvas,this.canvas.addEventListener("mouseenter",this._mouseEnterHandler=function(){r.mouseover=!0}),this.canvas.addEventListener("mouseleave",this._mouseLeaveHandler=function(){r.mouseover=!1,o.canvas.style.cursor=null}),document.addEventListener("mousemove",this._mouseMoveHandler=function(e){$d(e,o.canvas,r.pointerCanvasPos)}),this.canvas.addEventListener("mousedown",this._mouseDownHandler=function(e){s.active&&s.pointerEnabled&&($d(e,o.canvas,r.pointerCanvasPos),r.mouseover=!0)}),this.canvas.addEventListener("mouseup",this._mouseUpHandler=function(e){s.active&&s.pointerEnabled})}),[{key:"reset",value:function(){}},{key:"destroy",value:function(){null!=this.canvas&&(this.canvas.removeEventListener("mouseenter",this._mouseEnterHandler),this.canvas.removeEventListener("mouseleave",this._mouseLeaveHandler),this.canvas.removeEventListener("mousedown",this._mouseDownHandler),this.canvas.removeEventListener("mouseup",this._mouseUpHandler)),document.removeEventListener("mousemove",this._mouseMoveHandler)}}])}();function $d(e,t,i){if(e){var s=t.getBoundingClientRect(),r=s.x,n=s.y;i[0]=e.clientX-r,i[1]=e.clientY-n}else e=window.event,i[0]=e.x,i[1]=e.y;return i}var ep=function(e,t){if(e){for(var i=e.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;t[0]=e.pageX-s,t[1]=e.pageY-r}else e=window.event,t[0]=e.x,t[1]=e.y;return t},tp=function(){return w((function e(t,i,s,r,n,o){var a=this;B(this,e),this._scene=t,this._cameraControl=o;var l=i.pickController,u=i.pivotController,A=J.vec2(),c=J.vec2(),h=J.vec2(),d=J.vec2();this._dollyspeed=1,this._panspeed=1;var p=[];this.canvas=this._scene.canvas.canvas;var f=0,v=!1;this._onTick=t.on("tick",(function(){v=!1})),this.canvas.addEventListener("touchstart",this._canvasTouchStartHandler=function(e){if(s.active&&s.pointerEnabled&&e.isTrusted){e.preventDefault();var i=e.touches,n=e.changedTouches;for(r.touchStartTime=Date.now(),1===i.length&&1===n.length&&(r.touchStartTime,ep(i[0],A),s.followPointer&&(l.pickCursorPos=A,l.schedulePickSurface=!0,l.update(),u.setPivotPos(t.camera.look),s.planView||(l.picked&&l.pickedSurface&&l.pickResult&&l.pickResult.worldPos?(u.setPivotPos(t.camera.look),!s.firstPerson&&u.startPivot()):(s.smartPivot,u.setPivotPos(t.camera.look),!s.firstPerson&&u.startPivot()))));p.length<i.length;)p.push(J.vec2());for(var o=0,a=i.length;o<a;++o)ep(i[o],p[o]);f=i.length}}),this.canvas.addEventListener("touchend",this._canvasTouchEndHandler=function(){u.getPivoting()&&(u.endPivot(),u.hidePivot())}),this.canvas.addEventListener("touchcancel",this._canvasTouchEndHandler),this.canvas.addEventListener("touchmove",this._canvasTouchMoveHandler=function(e){if(s.active&&s.pointerEnabled&&(a._cameraControl.fire("touchmoveCanvas"),e.stopPropagation(),e.preventDefault(),!v)){v=!0;var i=t.canvas.boundary,o=i[2],A=i[3],g=e.touches;if(e.touches.length===f){if(1===f){ep(g[0],c),J.subVec2(c,p[0],d);var m=d[0],_=d[1];if(null!==r.longTouchTimeout&&(Math.abs(m)>s.longTapRadius||Math.abs(_)>s.longTapRadius)&&(clearTimeout(r.longTouchTimeout),r.longTouchTimeout=null),s.planView){var y=t.camera;if("perspective"===y.projection){var b=Math.abs(t.camera.eyeLookDist)*Math.tan(y.perspective.fov/2*Math.PI/180);n.panDeltaX+=m*b/A*s.touchPanRate*a._panspeed,n.panDeltaY+=_*b/A*s.touchPanRate*a._panspeed}else n.panDeltaX+=.5*y.ortho.scale*(m/A)*s.touchPanRate*a._panspeed,n.panDeltaY+=.5*y.ortho.scale*(_/A)*s.touchPanRate*a._panspeed}else n.rotateDeltaY-=m/o*(1*s.dragRotationRate),n.rotateDeltaX+=_/A*(1.5*s.dragRotationRate)}else if(2===f){u.hidePivot();var B=g[0],x=g[1];ep(B,c),ep(x,h);var w=J.geometricMeanVec2(p[0],p[1]),P=J.geometricMeanVec2(c,h),C=J.vec2();J.subVec2(w,P,C);var M=C[0],k=C[1],F=t.camera,E=J.distVec2([B.pageX,B.pageY],[x.pageX,x.pageY]),D=(J.distVec2(p[0],p[1])-E)*s.touchDollyRate*a._dollyspeed;if(n.dollyDelta=D,Math.abs(D)<1)if("perspective"===F.projection){var I=l.pickResult?l.pickResult.worldPos:t.center,S=Math.abs(J.lenVec3(J.subVec3(I,t.camera.eye,[])))*Math.tan(F.perspective.fov/2*Math.PI/180);n.panDeltaX-=M*S/A*s.touchPanRate*a._panspeed,n.panDeltaY-=k*S/A*s.touchPanRate*a._panspeed}else n.panDeltaX-=.5*F.ortho.scale*(M/A)*s.touchPanRate*a._panspeed,n.panDeltaY-=.5*F.ortho.scale*(k/A)*s.touchPanRate*a._panspeed;r.pointerCanvasPos=P}for(var T=0;T<f;++T)ep(g[T],p[T])}}})}),[{key:"dollyspeed",get:function(){return this._dollyspeed},set:function(e){e<=0||(this._dollyspeed=+e.toFixed(1),this._cameraControl.fire("touchDollySpeed",this._dollyspeed))}},{key:"panspeed",get:function(){return this._panspeed},set:function(e){e<=0||(this._panspeed=+e.toFixed(1),this._cameraControl.fire("touchPanSpeed",this._panspeed))}},{key:"reset",value:function(){}},{key:"destroy",value:function(){null!=this.canvas&&(this.canvas.removeEventListener("touchstart",this._canvasTouchStartHandler),this.canvas.removeEventListener("touchend",this._canvasTouchEndHandler),this.canvas.removeEventListener("touchcancel",this._canvasTouchEndHandler),this.canvas.removeEventListener("touchmove",this._canvasTouchMoveHandler)),this._scene.off(this._onTick)}}])}(),ip=function(e,t){if(e){for(var i=e.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;t[0]=e.pageX-s,t[1]=e.pageY-r}else e=window.event,t[0]=e.x,t[1]=e.y;return t},sp=function(){return w((function e(t,i,s,r,n){B(this,e),this._scene=t;var o,a=i.pickController,l=i.cameraControl,u=[],A=new Float32Array(2),c=-1,h=-1;this.canvas=this._scene.canvas.canvas;var d=function(e){var s;e&&e.worldPos&&(s=e.worldPos);var r=e?e.entity.aabb:t.aabb;if(s){var n=t.camera;J.subVec3(n.eye,n.look,[]),i.cameraFlight.flyTo({aabb:r})}else i.cameraFlight.flyTo({aabb:r})};this.canvas.addEventListener("touchstart",this._canvasTouchStartHandler=function(e){if(s.active&&s.pointerEnabled&&e.isTrusted){null!==r.longTouchTimeout&&(clearTimeout(r.longTouchTimeout),r.longTouchTimeout=null);var t=e.touches,n=e.changedTouches;if(o=Date.now(),1===t.length&&1===n.length){c=o;var h=A[0],d=A[1],p=t[0].pageX,f=t[0].pageY;r.longTouchTimeout=setTimeout((function(){i.cameraControl.fire("rightClick",{pagePos:[Math.round(p),Math.round(f)],canvasPos:[Math.round(h),Math.round(d)],event:e},!0),r.longTouchTimeout=null}),s.longTapTimeout);var v=l.hasSubs("pickedSurface");ip(t[0],a.pickCursorPos),a.schedulePickEntity=!0,a.schedulePickSurface=v,a.update(),a.pickResult?(l.fire("touchEntity",a.pickResult),a.pickedSurface&&l.fire("touchSurface",a.pickResult)):l.fire("touchNothing")}else c=-1;for(;u.length<t.length;)u.push(new Float32Array(2));for(var g=0,m=t.length;g<m;++g)ip(t[g],u[g]);u.length=t.length}},{passive:!0}),this.canvas.addEventListener("touchend",this._canvasTouchEndHandler=function(e){if(s.active&&s.pointerEnabled){var t=Date.now(),i=e.touches,n=e.changedTouches,o=l.hasSubs("pickedSurface");null!==r.longTouchTimeout&&(clearTimeout(r.longTouchTimeout),r.longTouchTimeout=null),0===i.length&&1===n.length&&c>-1&&t-c<150&&(h>-1&&c-h<325?(ip(n[0],a.pickCursorPos),a.schedulePickEntity=!0,a.schedulePickSurface=o,a.update(),a.pickResult?(a.pickResult.touchInput=!0,l.fire("touchDoublePicked",a.pickResult),a.pickedSurface&&l.fire("touchDoublePickedSurface",a.pickResult),s.doublePickFlyTo&&d(a.pickResult)):(l.fire("doublePickedNothing"),l.fire("touchDoublePickedNothing"),s.doublePickFlyTo&&d()),h=-1):J.distVec2(u[0],A)<1e3&&(ip(n[0],a.pickCursorPos),a.schedulePickEntity=!0,a.schedulePickSurface=o,a.update(),a.pickResult?(a.pickResult.touchInput=!0,l.fire("touchPicked",a.pickResult),a.pickedSurface&&l.fire("touchPickedSurface",a.pickResult)):l.fire("touchPickedNothing"),h=t),c=-1),u.length=i.length;for(var p=0,f=i.length;p<f;++p)u[p][0]=i[p].pageX,u[p][1]=i[p].pageY;e.stopPropagation()}},{passive:!0}),this.canvas.addEventListener("touchcancel",this._canvasTouchEndHandler)}),[{key:"reset",value:function(){}},{key:"destroy",value:function(){null!=this.canvas&&(this.canvas.removeEventListener("touchstart",this._canvasTouchStartHandler),this.canvas.removeEventListener("touchend",this._canvasTouchEndHandler),this.canvas.removeEventListener("touchcancel",this._canvasTouchEndHandler))}}])}(),rp=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};B(this,t),(i=h(this,t,[e,s])).PAN_LEFT=0,i.PAN_RIGHT=1,i.PAN_UP=2,i.PAN_DOWN=3,i.PAN_FORWARDS=4,i.PAN_BACKWARDS=5,i.ROTATE_X_POS=6,i.ROTATE_X_NEG=7,i.ROTATE_Y_POS=8,i.ROTATE_Y_NEG=9,i.DOLLY_FORWARDS=10,i.DOLLY_BACKWARDS=11,i.AXIS_VIEW_RIGHT=12,i.AXIS_VIEW_BACK=13,i.AXIS_VIEW_LEFT=14,i.AXIS_VIEW_FRONT=15,i.AXIS_VIEW_TOP=16,i.AXIS_VIEW_BOTTOM=17,i.SPEED_UP=107,i.SPEED_DOWN=109,i._keyMap={},i.scene.canvas.canvas.oncontextmenu=function(e){e.preventDefault()},i.scene.on("aabb",(function(e){var t=e[3]-e[0],s=e[4]-e[1],r=e[5]-e[2],n=Math.max(t,s,r),o=Math.min(t,s,r);if(n>100&&o>20){var a=parseInt((n+o)/2);i.mouseWheelDollyRate=a/n*100}if(n>50&&n<100){var l=2*parseInt(n/20);i.keyboardDollyRate=15*l,i.keyboardPanRate=1.5*l}if(n>100&&n<600){var u=4*parseInt(n/50);i.keyboardDollyRate=15*u,i.keyboardPanRate=1.5*u}if(n>600){var A=8*parseInt(n/100);i.keyboardDollyRate=15*A,i.keyboardPanRate=1.5*A}if(0==o){var c=parseInt((n+1e-4)/2*1e5)/1e5;return i.mouseWheelDollyRate=100*c,i.keyboardDollyRate=10*c,void(i.keyboardPanRate=1*c)}if((o+n)/2<10){var h=parseInt((n+o)/2*1e4)/1e4/4;i.mouseWheelDollyRate=100*h,i.keyboardDollyRate=10*h,i.keyboardPanRate=1*h}if((o+n)/2<.1){var d=parseInt((n+o)/2*1e4)/1e4;i.mouseWheelDollyRate=100*d,i.keyboardDollyRate=10*d,i.keyboardPanRate=1*d}})),i._configs={longTapTimeout:600,longTapRadius:5,active:!0,keyboardLayout:"qwerty",navMode:"orbit",planView:!1,firstPerson:!1,followPointer:!0,doublePickFlyTo:!1,panRightClick:!0,showPivot:!1,pointerEnabled:!0,constrainVertical:!1,smartPivot:!1,doubleClickTimeFrame:250,zoomOnMouseWheel:!0,snapToVertex:true,snapToEdge:true,snapRadius:s.snapRadius?s.snapRadius:20,dragRotationRate:360,keyboardRotationRate:90,rotationInertia:0,keyboardPanRate:1,touchPanRate:1,panInertia:.5,keyboardDollyRate:10,mouseWheelDollyRate:100,touchDollyRate:.2,dollyInertia:0,dollyProximityThreshold:30,dollyMinSpeed:.04},i._states={pointerCanvasPos:J.vec2(),mouseover:!1,followPointerDirty:!0,mouseDownClientX:0,mouseDownClientY:0,mouseDownCursorX:0,mouseDownCursorY:0,touchStartTime:null,touchEndTime:null,activeTouches:[],tapStartPos:J.vec2(),tapStartTime:-1,lastTapTime:-1,longTouchTimeout:null},i._updates={rotateDeltaX:0,rotateDeltaY:0,panDeltaX:0,panDeltaY:0,panDeltaZ:0,dollyDelta:0};var r=i.scene;return i._controllers={cameraControl:i,pickController:new Ud(i,i._configs),pivotController:new Rd(r,i._configs),panController:new Fd(r),cameraFlight:new Yh(i,{duration:.5})},i._handlers=[new qd(i.scene,i._controllers,i._configs,i._states,i._updates),new tp(i.scene,i._controllers,i._configs,i._states,i._updates,i),new Qd(i.scene,i._controllers,i._configs,i._states,i._updates),new Wd(i.scene,i._controllers,i._configs,i._states,i._updates),new Kd(i.scene,i._controllers,i._configs,i._states,i._updates),new sp(i.scene,i._controllers,i._configs,i._states,i._updates),new Xd(i.scene,i._controllers,i._configs,i._states,i._updates,i)],i._cameraUpdater=new Zd(i.scene,i._controllers,i._configs,i._states,i._updates),i.navMode=s.navMode,s.planView&&(i.planView=s.planView),i.constrainVertical=s.constrainVertical,s.keyboardLayout?i.keyboardLayout=s.keyboardLayout:i.keyMap=s.keyMap,i.doublePickFlyTo=s.doublePickFlyTo,i.panRightClick=s.panRightClick,i.active=s.active,i.followPointer=s.followPointer,i.rotationInertia=s.rotationInertia,i.keyboardPanRate=s.keyboardPanRate,i.touchPanRate=s.touchPanRate,i.keyboardRotationRate=s.keyboardRotationRate,i.dragRotationRate=s.dragRotationRate,i.touchDollyRate=s.touchDollyRate,i.dollyInertia=s.dollyInertia,i.dollyProximityThreshold=s.dollyProximityThreshold,i.dollyMinSpeed=s.dollyMinSpeed,i.panInertia=s.panInertia,i.pointerEnabled=!0,i.keyboardDollyRate=s.keyboardDollyRate,i.mouseWheelDollyRate=s.mouseWheelDollyRate,i._moveRate=1,i.scene.on("tick",(function(){(i._goLeft||i._goRight||i._goUp||i._goDown||i._goForward||i._goBackward)&&(i._goRight?i._updates.panDeltaX+=-.1*i._moveRate:i._goLeft&&(i._updates.panDeltaX+=.1*i._moveRate),i._goUp?i._updates.panDeltaY+=.1*i._moveRate:i._goDown&&(i._updates.panDeltaY+=-.1*i._moveRate),i._goForward?i._updates.panDeltaZ+=-.1*i._moveRate:i._goBackward&&(i._updates.panDeltaZ+=.1*i._moveRate))})),i}return m(t,_e),w(t,[{key:"setdirectionChangeCancel",value:function(){this._goLeft=!1,this._goRight=!1,this._goUp=!1,this._goDown=!1,this._goForward=!1,this._goBackward=!1}},{key:"customTouchDollyRate",get:function(){return this._handlers[1].dollyspeed},set:function(e){this._handlers[1].dollyspeed=e}},{key:"customTouchPanRate",get:function(){return this._handlers[1].panspeed},set:function(e){this._handlers[1].panspeed=e}},{key:"moveRate",get:function(){return this._moveRate},set:function(e){this._moveRate=e,this._handlers[6].movespeed=e}},{key:"speedUp",value:function(){this._handlers[6].speedUp(),this._moveRate=this._handlers[6].moveRate}},{key:"speedDown",value:function(){this._handlers[6].speedDown(),this._moveRate=this._handlers[6].moveRate}},{key:"goRight",set:function(e){this._goRight=e}},{key:"goLeft",set:function(e){this._goLeft=e}},{key:"goUp",set:function(e){this._goUp=e}},{key:"goDown",set:function(e){this._goDown=e}},{key:"goForward",set:function(e){this._goForward=e}},{key:"goBackward",set:function(e){this._goBackward=e}},{key:"updatePivotElement",value:function(){this._controllers.pivotController.updatePivotElement()}},{key:"keyMap",get:function(){return this._keyMap},set:function(e){if(e=e||"qwerty",oe.isString(e)){var t=this.scene.input,i={};switch(e){default:this.error("Unsupported value for 'keyMap': "+e+" defaulting to 'qwerty'");case"qwerty":i[this.PAN_UP]=[t.KEY_E],i[this.PAN_DOWN]=[t.KEY_Q],i[this.PAN_LEFT]=[t.KEY_A,t.KEY_LEFT_ARROW],i[this.PAN_RIGHT]=[t.KEY_D,t.KEY_RIGHT_ARROW],i[this.PAN_FORWARDS]=[t.KEY_W,t.KEY_UP_ARROW],i[this.PAN_BACKWARDS]=[t.KEY_S,t.KEY_DOWN_ARROW],i[this.DOLLY_FORWARDS]=[t.KEY_J],i[this.DOLLY_BACKWARDS]=[t.KEY_K],i[this.AXIS_VIEW_RIGHT]=[t.KEY_NUM_1],i[this.AXIS_VIEW_BACK]=[t.KEY_NUM_2],i[this.AXIS_VIEW_LEFT]=[t.KEY_NUM_3],i[this.AXIS_VIEW_FRONT]=[t.KEY_NUM_4],i[this.AXIS_VIEW_TOP]=[t.KEY_NUM_5],i[this.AXIS_VIEW_BOTTOM]=[t.KEY_NUM_6],i[this.SPEED_UP]=[t.KEY_EQUAL_SIGN],i[this.SPEED_DOWN]=[t.KEY_DASH];break;case"azerty":i[this.PAN_LEFT]=[t.KEY_Q],i[this.PAN_RIGHT]=[t.KEY_D],i[this.PAN_UP]=[t.KEY_W],i[this.PAN_DOWN]=[t.KEY_X],i[this.PAN_BACKWARDS]=[t.KEY_J],i[this.PAN_FORWARDS]=[t.KEY_K],i[this.DOLLY_FORWARDS]=[t.KEY_Z],i[this.DOLLY_BACKWARDS]=[t.KEY_S],i[this.ROTATE_X_POS]=[t.KEY_DOWN_ARROW],i[this.ROTATE_X_NEG]=[t.KEY_UP_ARROW],i[this.ROTATE_Y_POS]=[t.KEY_A,t.KEY_LEFT_ARROW],i[this.ROTATE_Y_NEG]=[t.KEY_E,t.KEY_RIGHT_ARROW],i[this.AXIS_VIEW_RIGHT]=[t.KEY_NUM_1],i[this.AXIS_VIEW_BACK]=[t.KEY_NUM_2],i[this.AXIS_VIEW_LEFT]=[t.KEY_NUM_3],i[this.AXIS_VIEW_FRONT]=[t.KEY_NUM_4],i[this.AXIS_VIEW_TOP]=[t.KEY_NUM_5],i[this.AXIS_VIEW_BOTTOM]=[t.KEY_NUM_6],i[this.SPEED_UP]=[t.KEY_EQUAL_SIGN],i[this.SPEED_DOWN]=[t.KEY_DASH]}this._keyMap=i}else{var s=e;this._keyMap=s}}},{key:"_isKeyDownForAction",value:function(e,t){var i=this._keyMap[e];if(!i)return!1;t||(t=this.scene.input.keyDown);for(var s=0,r=i.length;s<r;s++){if(t[i[s]])return!0}return!1}},{key:"pivotElement",set:function(e){this._controllers.pivotController.setPivotElement(e)}},{key:"active",get:function(){return this._configs.active},set:function(e){e=!1!==e,this._configs.active=e,this._handlers[1]._active=e,this._handlers[5]._active=e}},{key:"snapToVertex",get:function(){return this._configs.snapToVertex},set:function(e){this._configs.snapToVertex=!!e}},{key:"snapToEdge",get:function(){return this._configs.snapToEdge},set:function(e){this._configs.snapToEdge=!!e}},{key:"snapRadius",get:function(){return this._configs.snapRadius},set:function(e){e=e||20,this._configs.snapRadius=e}},{key:"navMode",get:function(){return this._configs.navMode},set:function(e){"firstPerson"!==(e=e||"orbit")&&"orbit"!==e&&"planView"!==e&&(this.error("Unsupported value for navMode: "+e+" - supported values are 'orbit', 'firstPerson' and 'planView' - defaulting to 'orbit'"),e="orbit"),this._configs.firstPerson="firstPerson"===e,this._configs.planView="planView"===e,(this._configs.firstPerson||this._configs.planView)&&(this._controllers.pivotController.hidePivot(),this._controllers.pivotController.endPivot()),this._configs.navMode=e}},{key:"pointerEnabled",get:function(){return this._configs.pointerEnabled},set:function(e){this._reset(),this._configs.pointerEnabled=!!e}},{key:"_reset",value:function(){for(var e=0,t=this._handlers.length;e<t;e++){var i=this._handlers[e];i.reset&&i.reset()}this._updates.panDeltaX=0,this._updates.panDeltaY=0,this._updates.rotateDeltaX=0,this._updates.rotateDeltaY=0,this._updates.dolyDelta=0}},{key:"followPointer",get:function(){return this._configs.followPointer},set:function(e){this._configs.followPointer=!1!==e}},{key:"pivotPos",get:function(){return this._controllers.pivotController.getPivotPos()},set:function(e){this._controllers.pivotController.setPivotPos(e)}},{key:"dollyToPointer",get:function(){return this.warn("dollyToPointer property is deprecated - replaced with followPointer"),this.followPointer},set:function(e){this.warn("dollyToPointer property is deprecated - replaced with followPointer"),this.followPointer=e}},{key:"panToPointer",get:function(){return this.warn("panToPointer property is deprecated - replaced with followPointer"),!1},set:function(e){this.warn("panToPointer property is deprecated - replaced with followPointer")}},{key:"planView",get:function(){return this._configs.planView},set:function(e){this._configs.planView=!!e,this._configs.firstPerson=!1,this._configs.planView&&(this._controllers.pivotController.hidePivot(),this._controllers.pivotController.endPivot()),this.warn("planView property is deprecated - replaced with navMode")}},{key:"firstPerson",get:function(){return this.warn("firstPerson property is deprecated - replaced with navMode"),this._configs.firstPerson},set:function(e){this.warn("firstPerson property is deprecated - replaced with navMode"),this._configs.firstPerson=!!e,this._configs.planView=!1,this._configs.firstPerson&&(this._controllers.pivotController.hidePivot(),this._controllers.pivotController.endPivot())}},{key:"constrainVertical",get:function(){return this._configs.constrainVertical},set:function(e){this._configs.constrainVertical=!!e}},{key:"doublePickFlyTo",get:function(){return this._configs.doublePickFlyTo},set:function(e){this._configs.doublePickFlyTo=!1!==e}},{key:"panRightClick",get:function(){return this._configs.panRightClick},set:function(e){this._configs.panRightClick=!1!==e}},{key:"rotationInertia",get:function(){return this._configs.rotationInertia},set:function(e){this._configs.rotationInertia=null!=e?e:0}},{key:"keyboardPanRate",get:function(){return this._configs.keyboardPanRate},set:function(e){this._configs.keyboardPanRate=null!=e?e:5}},{key:"touchPanRate",get:function(){return this._configs.touchPanRate},set:function(e){this._configs.touchPanRate=null!=e?e:1}},{key:"keyboardRotationRate",get:function(){return this._configs.keyboardRotationRate},set:function(e){this._configs.keyboardRotationRate=null!=e?e:90}},{key:"dragRotationRate",get:function(){return this._configs.dragRotationRate},set:function(e){this._configs.dragRotationRate=null!=e?e:360}},{key:"keyboardDollyRate",get:function(){return this._configs.keyboardDollyRate},set:function(e){this._configs.keyboardDollyRate=null!=e?e:15}},{key:"touchDollyRate",get:function(){return this._configs.touchDollyRate},set:function(e){this._configs.touchDollyRate=null!=e?e:.2}},{key:"mouseWheelDollyRate",get:function(){return this._configs.mouseWheelDollyRate},set:function(e){this._configs.mouseWheelDollyRate=null!=e?e:100}},{key:"dollyInertia",get:function(){return this._configs.dollyInertia},set:function(e){this._configs.dollyInertia=null!=e?e:0}},{key:"dollyProximityThreshold",get:function(){return this._configs.dollyProximityThreshold},set:function(e){this._configs.dollyProximityThreshold=null!=e?e:35}},{key:"dollyMinSpeed",get:function(){return this._configs.dollyMinSpeed},set:function(e){this._configs.dollyMinSpeed=null!=e?e:.04}},{key:"panInertia",get:function(){return this._configs.panInertia},set:function(e){this._configs.panInertia=null!=e?e:.5}},{key:"keyboardLayout",get:function(){return this._configs.keyboardLayout},set:function(e){"qwerty"!==(e=e||"qwerty")&&"azerty"!==e&&(this.error("Unsupported value for keyboardLayout - defaulting to 'qwerty'"),e="qwerty"),this._configs.keyboardLayout=e,this.keyMap=this._configs.keyboardLayout}},{key:"enablePivotSphere",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._controllers.pivotController.enablePivotSphere(e)}},{key:"disablePivotSphere",value:function(){this._controllers.pivotController.disablePivotSphere()}},{key:"smartPivot",get:function(){return this._configs.smartPivot},set:function(e){this._configs.smartPivot=!1!==e}},{key:"doubleClickTimeFrame",get:function(){return this._configs.doubleClickTimeFrame},set:function(e){this._configs.doubleClickTimeFrame=null!=e?e:250}},{key:"zoomOnMouseWheel",get:function(){return this._configs.zoomOnMouseWheel},set:function(e){this._configs.zoomOnMouseWheel=!!e}},{key:"destroy",value:function(){this._destroyHandlers(),this._destroyControllers(),this._cameraUpdater.destroy(),f(t,"destroy",this,3)([])}},{key:"_destroyHandlers",value:function(){for(var e=0,t=this._handlers.length;e<t;e++){var i=this._handlers[e];i.destroy&&i.destroy()}}},{key:"_destroyControllers",value:function(){for(var e=0,t=this._controllers.length;e<t;e++){var i=this._controllers[e];i.destroy&&i.destroy()}}}])}(),np=w((function e(t){B(this,e),this.id=t.id,this.originalSystemId=t.originalSystemId,this.metaModels=[],this.name=t.name,this.type=t.type,this.properties=[],t.properties&&(this.properties=t.properties)})),op=function(){return w((function e(t){B(this,e),this.metaModels=[],this.id=t.id,this.parentId=t.parentId,this.parent=null,this.originalSystemId=t.originalSystemId,this.name=t.name,this.type=t.type,this.propertySetIds=t.propertySetIds,this.propertySets=[],void 0!==t.external&&null!==t.external&&(this.external=t.external)}),[{key:"metaModel",get:function(){return 1==this.metaModels.length?this.metaModels[0]:null}},{key:"getObjectIDsInSubtree",value:function(){var e=[];return function t(i){if(i){e.push(i.id);var s=i.children;if(s)for(var r=0,n=s.length;r<n;r++)t(s[r])}}(this),e}},{key:"withMetaObjectsInSubtree",value:function(e){!function t(i){if(i){e(i);var s=i.children;if(s)for(var r=0,n=s.length;r<n;r++)t(s[r])}}(this)}},{key:"getObjectIDsInSubtreeByType",value:function(e){for(var t={},i=0,s=e.length;i<s;i++)t[e[i]]=e[i];var r=[];return function e(i){if(i){t[i.type]&&r.push(i.id);var s=i.children;if(s)for(var n=0,o=s.length;n<o;n++)e(s[n])}}(this),r}},{key:"getJSON",value:function(){var e={id:this.id,type:this.type,name:this.name};return this.parent&&(e.parent=this.parent.id),e}}])}(),ap=function(){return w((function e(t){B(this,e),this.id=t.id,this.projectId=t.projectId,this.revisionId=t.revisionId,this.author=t.author,this.createdAt=t.createdAt,this.creatingApplication=t.creatingApplication,this.schema=t.schema,this.metaScene=t.metaScene,this.propertySets=[],this.rootMetaObjects=[],this.metaObjects=[],this.objectCount=0,this.propertySetCount=0,this.graph=t.graph||{},this.metaScene.metaModels[this.id]=this,this._finalized=!1}),[{key:"finalized",get:function(){return this._finalized},set:function(e){this._finalized=e}},{key:"rootMetaObject",get:function(){return 1==this.rootMetaObjects.length?this.rootMetaObjects[0]:null}},{key:"loadData",value:function(e,t,i){if(this._finalized)throw"MetaScene already finalized - can't add more data";try{var s,r,n,o,a,l,u,A;if(null===e)throw"metaModelData is null!";this.author=null!==(s=e.author)&&void 0!==s?s:"",this.schema=null!==(r=e.schema)&&void 0!==r?r:"",this.createdAt=null!==(n=e.createdAt)&&void 0!==n?n:"",this.projectId=null!==(o=e.projectId)&&void 0!==o?o:"",this.revisionId=null!==(a=e.revisionId)&&void 0!==a?a:"",this.objectCount=null!==(l=e.objectCount)&&void 0!==l?l:"",this.propertySetCount=null!==(u=e.propertySetCount)&&void 0!==u?u:"",this.creatingApplication=null!==(A=e.creatingApplication)&&void 0!==A?A:"";var c=this.metaScene;if(e.propertySets)for(var h in e.propertySets){var d=e.propertySets[h],p=new np({id:d.id,originalSystemId:d.originalSystemId||d.id,type:d.type,name:d.name,properties:d.properties});c.propertySets[h]=p,this.propertySets.push(p)}if(e.metaObjects)for(var f in e.metaObjects){var v=e.metaObjects[f],g=new op({id:f,originalSystemId:f,parentId:v.parent,type:v.type,name:v.name,propertySetIds:v.propertySetIds,external:v.external});g.children=[],g.metaModels=[],g.metaModels.push(this),c.metaObjects[f]=g,this.metaObjects.push(g),v.parent||(this.rootMetaObjects.push(g),c.rootMetaObjects[f]=g)}"function"==typeof t&&t()}catch(e){"function"==typeof i?i(e):this.log(i)}}},{key:"_decompressProperties",value:function(e,t){for(var i=0,s=t.length;i<s;i++){var r=t[i];if(Number.isInteger(r)){var n=e[r];n&&(t[i]=n)}}}},{key:"finalize",value:function(){if(this._finalized)throw"MetaScene already finalized - can't re-finalize";var e=this.metaScene;for(var t in e.metaObjectsByType={},e.metaObjects){var i=e.metaObjects[t];if(i.children&&(i.children=[]),i.parentId){var s=e.metaObjects[i.parentId];s&&(i.parent=s,(s.children||(s.children=[])).push(i))}if(i.propertySets&&(i.propertySets=[]),i.propertySetIds)for(var r=0,n=i.propertySetIds.length;r<n;r++){var o=i.propertySetIds[r],a=e.propertySets[o];i.propertySets.push(a)}var l=i.type;(e.metaObjectsByType[l]||(e.metaObjectsByType[l]={}))[t]=i}this._finalized=!0,this.metaScene.fire("metaModelCreated",this.id)}},{key:"getJSON",value:function(){for(var e={id:this.id,projectId:this.projectId,author:this.author,createdAt:this.createdAt,schema:this.schema,creatingApplication:this.creatingApplication,metaObjects:[],propertySets:[]},t=0,i=this.metaObjects.length;t<i;t++){var s=this.metaObjects[t],r={id:s.id,originalSystemId:s.originalSystemId,extId:s.extId,type:s.type,name:s.name};s.parent&&(r.parent=s.parent.id),s.attributes&&(r.attributes=s.attributes),s.propertySetIds&&(r.propertySetIds=s.propertySetIds),e.metaObjects.push(r)}for(var n=0,o=this.propertySets.length;n<o;n++){for(var a=this.propertySets[n],l={id:a.id,originalSystemId:a.originalSystemId,extId:a.extId,type:a.type,name:a.name,propertyies:[]},u=0,A=a.properties.length;u<A;u++){var c=a.properties[u],h={id:c.id,description:c.description,type:c.type,name:c.name,value:c.value,valueType:c.valueType};l.properties.push(h)}e.propertySets.push(l)}return e}},{key:"_globalizeIDs",value:function(e,t){var i=!!t.globalizeObjectIds;if(e.metaObjects)for(var s=0,r=e.metaObjects.length;s<r;s++){var n=e.metaObjects[s];if(n.originalSystemId=n.id,n.parent&&(n.originalParentSystemId=n.parent),i&&(n.id=J.globalizeObjectId(this.id,n.id),n.parent&&(n.parent=J.globalizeObjectId(this.id,n.parent))),i){var o=n.propertySetIds;if(o){for(var a=[],l=0,u=o.length;l<u;l++)a.push(J.globalizeObjectId(this.id,o[l]));n.propertySetIds=a,n.originalSystemPropertySetIds=o}}else n.originalSystemPropertySetIds=n.propertySetIds}if(e.propertySets)for(var A=0,c=e.propertySets.length;A<c;A++){var h=e.propertySets[A];h.originalSystemId=h.id,i&&(h.id=J.globalizeObjectId(this.id,h.id))}}}])}(),lp=function(){return w((function e(t,i){B(this,e),this.viewer=t,this.scene=i,this.metaModels={},this.propertySets={},this.metaObjects={},this.metaObjectsByType={},this.rootMetaObjects={},this._eventSubs={}}),[{key:"on",value:function(e,t){var i=this._eventSubs[e];i||(i=[],this._eventSubs[e]=i),i.push(t)}},{key:"fire",value:function(e,t){var i=this._eventSubs[e];if(i)for(var s=0,r=i.length;s<r;s++)i[s](t)}},{key:"off",value:function(e){}},{key:"createMetaModel",value:function(e,t){var i=new ap({metaScene:this,id:e,projectId:t.projectId||"none",revisionId:t.revisionId||"none",author:t.author||"none",createdAt:t.createdAt||"none",creatingApplication:t.creatingApplication||"none",schema:t.schema||"none",propertySets:[]});return i.loadData(t),i.finalize(),i}},{key:"destroyMetaModel",value:function(e){var t=this.metaModels[e];if(t){if(t.propertySets)for(var i=0,s=t.propertySets.length;i<s;i++){var r=t.propertySets[i];if(1===r.metaModels.length&&r.metaModels[0].id===e)delete this.propertySets[r.id];else{for(var n=[],o=0,a=r.metaModels.length;o<a;o++)r.metaModels[o].id!==e&&n.push(r.metaModels[o]);r.metaModels=n}}if(t.metaObjects)for(var l=0,u=t.metaObjects.length;l<u;l++){var A=t.metaObjects[l];A.type;var c=A.id;1===A.metaModels.length&&A.metaModels[0].id===e&&(delete this.metaObjects[c],A.parent||delete this.rootMetaObjects[c])}for(var h in this.metaObjects){var d=this.metaObjects[h];if(d.children&&(d.children=[]),d.propertySets&&(d.propertySets=[]),d.propertySetIds)for(var p=0,f=d.propertySetIds.length;p<f;p++){var v=d.propertySetIds[p],g=this.propertySets[v];d.propertySets.push(g)}}for(var m in this.metaObjectsByType={},this.metaObjects){var _=this.metaObjects[m],y=_.type;_.children&&(_.children=null),(this.metaObjectsByType[y]||(this.metaObjectsByType[y]={}))[m]=_}for(var b in this.metaObjects){var B=this.metaObjects[b];if(B.parentId){var x=this.metaObjects[B.parentId];x&&(B.parent=x,(x.children||(x.children=[])).push(B))}}delete this.metaModels[e],this.fire("metaModelDestroyed",e)}}},{key:"getObjectIDsByType",value:function(e){var t=this.metaObjectsByType[e];return t?Object.keys(t):[]}},{key:"getObjectIDsByTypes",value:function(e){for(var t=[],i=0;i<e.length;i++){var s=e[i];t=t.concat(this.getObjectIDsByType(s))}return t}},{key:"getObjectIDsInSubtree",value:function(e,t,i){var s=[],r=this.metaObjects[e],n=t&&t.length>0?up(t):null,o=i&&i.length>0?up(i):null,a=function(e){if(e){var t=!0;(o&&o[e.type]||n&&!n[e.type])&&(t=!1),t&&s.push(e.id);var i=e.children;if(i)for(var r=0,l=i.length;r<l;r++)a(i[r])}};return a(r),s}},{key:"withMetaObjectsInSubtree",value:function(e,t){var i=this.metaObjects[e];i&&i.withMetaObjectsInSubtree(t)}}])}();function up(e){for(var t={},i=0,s=e.length;i<s;i++)t[e[i]]=!0;return t}
|
|
18
18
|
/*!
|
|
19
19
|
* html2canvas 1.4.1 <https://html2canvas.hertzen.com>
|
|
20
20
|
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
|
@@ -33,4 +33,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
33
33
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
34
34
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
35
35
|
PERFORMANCE OF THIS SOFTWARE.
|
|
36
|
-
***************************************************************************** */var Ap=function(e,t){return Ap=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},Ap(e,t)};function cp(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}Ap(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var hp=function(){return hp=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},hp.apply(this,arguments)};function dp(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}l((s=s.apply(e,t||[])).next())}))}function pp(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}}function fp(e,t,i){if(i||2===arguments.length)for(var s,r=0,n=t.length;r<n;r++)!s&&r in t||(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||t)}for(var vp=function(){function e(e,t,i,s){this.left=e,this.top=t,this.width=i,this.height=s}return e.prototype.add=function(t,i,s,r){return new e(this.left+t,this.top+i,this.width+s,this.height+r)},e.fromClientRect=function(t,i){return new e(i.left+t.windowBounds.left,i.top+t.windowBounds.top,i.width,i.height)},e.fromDOMRectList=function(t,i){var s=Array.from(i).find((function(e){return 0!==e.width}));return s?new e(s.left+t.windowBounds.left,s.top+t.windowBounds.top,s.width,s.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),gp=function(e,t){return vp.fromClientRect(e,t.getBoundingClientRect())},mp=function(e){for(var t=[],i=0,s=e.length;i<s;){var r=e.charCodeAt(i++);if(r>=55296&&r<=56319&&i<s){var n=e.charCodeAt(i++);56320==(64512&n)?t.push(((1023&r)<<10)+(1023&n)+65536):(t.push(r),i--)}else t.push(r)}return t},_p=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var i=e.length;if(!i)return"";for(var s=[],r=-1,n="";++r<i;){var o=e[r];o<=65535?s.push(o):(o-=65536,s.push(55296+(o>>10),o%1024+56320)),(r+1===i||s.length>16384)&&(n+=String.fromCharCode.apply(String,s),s.length=0)}return n},yp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bp="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Bp=0;Bp<64;Bp++)bp[yp.charCodeAt(Bp)]=Bp;for(var xp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wp="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Pp=0;Pp<64;Pp++)wp[xp.charCodeAt(Pp)]=Pp;for(var Cp=function(e,t,i){return e.slice?e.slice(t,i):new Uint16Array(Array.prototype.slice.call(e,t,i))},Mp=function(){function e(e,t,i,s,r,n){this.initialValue=e,this.errorValue=t,this.highStart=i,this.highValueIndex=s,this.index=r,this.data=n}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>5])<<2)+(31&e),this.data[t];if(e<=65535)return t=((t=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[t];if(e<this.highStart)return t=2080+(e>>11),t=this.index[t],t+=e>>5&63,t=((t=this.index[t])<<2)+(31&e),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),kp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fp="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ep=0;Ep<64;Ep++)Fp[kp.charCodeAt(Ep)]=Ep;var Dp=10,Ip=13,Sp=15,Tp=17,Lp=18,Rp=19,Up=20,Op=21,Qp=22,Np=24,Vp=25,Hp=26,jp=27,Gp=28,zp=30,Wp=32,Kp=33,Xp=34,Yp=35,Jp=37,Zp=38,qp=39,$p=40,ef=42,tf=[9001,65288],sf="×",rf="÷",nf=function(e,t){var i,s,r,n=function(e){var t,i,s,r,n,o=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var u="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(o):new Array(o),A=Array.isArray(u)?u:new Uint8Array(u);for(t=0;t<a;t+=4)i=wp[e.charCodeAt(t)],s=wp[e.charCodeAt(t+1)],r=wp[e.charCodeAt(t+2)],n=wp[e.charCodeAt(t+3)],A[l++]=i<<2|s>>4,A[l++]=(15&s)<<4|r>>2,A[l++]=(3&r)<<6|63&n;return u}(e),o=Array.isArray(n)?function(e){for(var t=e.length,i=[],s=0;s<t;s+=4)i.push(e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s]);return i}(n):new Uint32Array(n),a=Array.isArray(n)?function(e){for(var t=e.length,i=[],s=0;s<t;s+=2)i.push(e[s+1]<<8|e[s]);return i}(n):new Uint16Array(n),l=Cp(a,12,o[4]/2),u=2===o[5]?Cp(a,(24+o[4])/2):(i=o,s=Math.ceil((24+o[4])/4),i.slice?i.slice(s,r):new Uint32Array(Array.prototype.slice.call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IG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcs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GcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB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wAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMA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AAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAe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ARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBX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AeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFU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AQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgA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QABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJ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AB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),of=[zp,36],af=[1,2,3,5],lf=[Dp,8],uf=[jp,Hp],Af=af.concat(lf),cf=[Zp,qp,$p,Xp,Yp],hf=[Sp,Ip],df=function(e,t,i,s){var r=s[i];if(Array.isArray(e)?-1!==e.indexOf(r):e===r)for(var n=i;n<=s.length;){if((l=s[++n])===t)return!0;if(l!==Dp)break}if(r===Dp)for(n=i;n>0;){var o=s[--n];if(Array.isArray(e)?-1!==e.indexOf(o):e===o)for(var a=i;a<=s.length;){var l;if((l=s[++a])===t)return!0;if(l!==Dp)break}if(o!==Dp)break}return!1},pf=function(e,t){for(var i=e;i>=0;){var s=t[i];if(s!==Dp)return s;i--}return 0},ff=function(e,t,i,s,r){if(0===i[s])return sf;var n=s-1;if(Array.isArray(r)&&!0===r[n])return sf;var o=n-1,a=n+1,l=t[n],u=o>=0?t[o]:0,A=t[a];if(2===l&&3===A)return sf;if(-1!==af.indexOf(l))return"!";if(-1!==af.indexOf(A))return sf;if(-1!==lf.indexOf(A))return sf;if(8===pf(n,t))return rf;if(11===nf.get(e[n]))return sf;if((l===Wp||l===Kp)&&11===nf.get(e[a]))return sf;if(7===l||7===A)return sf;if(9===l)return sf;if(-1===[Dp,Ip,Sp].indexOf(l)&&9===A)return sf;if(-1!==[Tp,Lp,Rp,Np,Gp].indexOf(A))return sf;if(pf(n,t)===Qp)return sf;if(df(23,Qp,n,t))return sf;if(df([Tp,Lp],Op,n,t))return sf;if(df(12,12,n,t))return sf;if(l===Dp)return rf;if(23===l||23===A)return sf;if(16===A||16===l)return rf;if(-1!==[Ip,Sp,Op].indexOf(A)||14===l)return sf;if(36===u&&-1!==hf.indexOf(l))return sf;if(l===Gp&&36===A)return sf;if(A===Up)return sf;if(-1!==of.indexOf(A)&&l===Vp||-1!==of.indexOf(l)&&A===Vp)return sf;if(l===jp&&-1!==[Jp,Wp,Kp].indexOf(A)||-1!==[Jp,Wp,Kp].indexOf(l)&&A===Hp)return sf;if(-1!==of.indexOf(l)&&-1!==uf.indexOf(A)||-1!==uf.indexOf(l)&&-1!==of.indexOf(A))return sf;if(-1!==[jp,Hp].indexOf(l)&&(A===Vp||-1!==[Qp,Sp].indexOf(A)&&t[a+1]===Vp)||-1!==[Qp,Sp].indexOf(l)&&A===Vp||l===Vp&&-1!==[Vp,Gp,Np].indexOf(A))return sf;if(-1!==[Vp,Gp,Np,Tp,Lp].indexOf(A))for(var c=n;c>=0;){if((h=t[c])===Vp)return sf;if(-1===[Gp,Np].indexOf(h))break;c--}if(-1!==[jp,Hp].indexOf(A))for(c=-1!==[Tp,Lp].indexOf(l)?o:n;c>=0;){var h;if((h=t[c])===Vp)return sf;if(-1===[Gp,Np].indexOf(h))break;c--}if(Zp===l&&-1!==[Zp,qp,Xp,Yp].indexOf(A)||-1!==[qp,Xp].indexOf(l)&&-1!==[qp,$p].indexOf(A)||-1!==[$p,Yp].indexOf(l)&&A===$p)return sf;if(-1!==cf.indexOf(l)&&-1!==[Up,Hp].indexOf(A)||-1!==cf.indexOf(A)&&l===jp)return sf;if(-1!==of.indexOf(l)&&-1!==of.indexOf(A))return sf;if(l===Np&&-1!==of.indexOf(A))return sf;if(-1!==of.concat(Vp).indexOf(l)&&A===Qp&&-1===tf.indexOf(e[a])||-1!==of.concat(Vp).indexOf(A)&&l===Lp)return sf;if(41===l&&41===A){for(var d=i[n],p=1;d>0&&41===t[--d];)p++;if(p%2!=0)return sf}return l===Wp&&A===Kp?sf:rf},vf=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var i=function(e,t){void 0===t&&(t="strict");var i=[],s=[],r=[];return e.forEach((function(e,n){var o=nf.get(e);if(o>50?(r.push(!0),o-=50):r.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return s.push(n),i.push(16);if(4===o||11===o){if(0===n)return s.push(n),i.push(zp);var a=i[n-1];return-1===Af.indexOf(a)?(s.push(s[n-1]),i.push(a)):(s.push(n),i.push(zp))}return s.push(n),31===o?i.push("strict"===t?Op:Jp):o===ef||29===o?i.push(zp):43===o?e>=131072&&e<=196605||e>=196608&&e<=262141?i.push(Jp):i.push(zp):void i.push(o)})),[s,i,r]}(e,t.lineBreak),s=i[0],r=i[1],n=i[2];"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(r=r.map((function(e){return-1!==[Vp,zp,ef].indexOf(e)?Jp:e})));var o="keep-all"===t.wordBreak?n.map((function(t,i){return t&&e[i]>=19968&&e[i]<=40959})):void 0;return[s,r,o]},gf=function(){function e(e,t,i,s){this.codePoints=e,this.required="!"===t,this.start=i,this.end=s}return e.prototype.slice=function(){return _p.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),mf=45,_f=43,yf=-1,bf=function(e){return e>=48&&e<=57},Bf=function(e){return bf(e)||e>=65&&e<=70||e>=97&&e<=102},xf=function(e){return 10===e||9===e||32===e},wf=function(e){return function(e){return function(e){return e>=97&&e<=122}(e)||function(e){return e>=65&&e<=90}(e)}(e)||function(e){return e>=128}(e)||95===e},Pf=function(e){return wf(e)||bf(e)||e===mf},Cf=function(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e},Mf=function(e,t){return 92===e&&10!==t},kf=function(e,t,i){return e===mf?wf(t)||Mf(t,i):!!wf(e)||!(92!==e||!Mf(e,t))},Ff=function(e,t,i){return e===_f||e===mf?!!bf(t)||46===t&&bf(i):bf(46===e?t:e)},Ef=function(e){var t=0,i=1;e[t]!==_f&&e[t]!==mf||(e[t]===mf&&(i=-1),t++);for(var s=[];bf(e[t]);)s.push(e[t++]);var r=s.length?parseInt(_p.apply(void 0,s),10):0;46===e[t]&&t++;for(var n=[];bf(e[t]);)n.push(e[t++]);var o=n.length,a=o?parseInt(_p.apply(void 0,n),10):0;69!==e[t]&&101!==e[t]||t++;var l=1;e[t]!==_f&&e[t]!==mf||(e[t]===mf&&(l=-1),t++);for(var u=[];bf(e[t]);)u.push(e[t++]);var A=u.length?parseInt(_p.apply(void 0,u),10):0;return i*(r+a*Math.pow(10,-o))*Math.pow(10,l*A)},Df={type:2},If={type:3},Sf={type:4},Tf={type:13},Lf={type:8},Rf={type:21},Uf={type:9},Of={type:10},Qf={type:11},Nf={type:12},Vf={type:14},Hf={type:23},jf={type:1},Gf={type:25},zf={type:24},Wf={type:26},Kf={type:27},Xf={type:28},Yf={type:29},Jf={type:31},Zf={type:32},qf=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(mp(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==Zf;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case 34:return this.consumeStringToken(34);case 35:var t=this.peekCodePoint(0),i=this.peekCodePoint(1),s=this.peekCodePoint(2);if(Pf(t)||Mf(i,s)){var r=kf(t,i,s)?2:1;return{type:5,value:this.consumeName(),flags:r}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Tf;break;case 39:return this.consumeStringToken(39);case 40:return Df;case 41:return If;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Vf;break;case _f:if(Ff(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 44:return Sf;case mf:var n=e,o=this.peekCodePoint(0),a=this.peekCodePoint(1);if(Ff(n,o,a))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(kf(n,o,a))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(o===mf&&62===a)return this.consumeCodePoint(),this.consumeCodePoint(),zf;break;case 46:if(Ff(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var l=this.consumeCodePoint();if(42===l&&47===(l=this.consumeCodePoint()))return this.consumeToken();if(l===yf)return this.consumeToken()}break;case 58:return Wf;case 59:return Kf;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===mf&&this.peekCodePoint(2)===mf)return this.consumeCodePoint(),this.consumeCodePoint(),Gf;break;case 64:var u=this.peekCodePoint(0),A=this.peekCodePoint(1),c=this.peekCodePoint(2);if(kf(u,A,c))return{type:7,value:this.consumeName()};break;case 91:return Xf;case 92:if(Mf(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case 93:return Yf;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Lf;break;case 123:return Qf;case 125:return Nf;case 117:case 85:var h=this.peekCodePoint(0),d=this.peekCodePoint(1);return h!==_f||!Bf(d)&&63!==d||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Uf;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),Rf;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Of;break;case yf:return Zf}return xf(e)?(this.consumeWhiteSpace(),Jf):bf(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):wf(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:_p(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return void 0===e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();Bf(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var i=!1;63===t&&e.length<6;)e.push(t),t=this.consumeCodePoint(),i=!0;if(i)return{type:30,start:parseInt(_p.apply(void 0,e.map((function(e){return 63===e?48:e}))),16),end:parseInt(_p.apply(void 0,e.map((function(e){return 63===e?70:e}))),16)};var s=parseInt(_p.apply(void 0,e),16);if(this.peekCodePoint(0)===mf&&Bf(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var r=[];Bf(t)&&r.length<6;)r.push(t),t=this.consumeCodePoint();return{type:30,start:s,end:parseInt(_p.apply(void 0,r),16)}}return{type:30,start:s,end:s}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===yf)return{type:22,value:""};var t=this.peekCodePoint(0);if(39===t||34===t){var i=this.consumeStringToken(this.consumeCodePoint());return 0===i.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===yf||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:i.value}):(this.consumeBadUrlRemnants(),Hf)}for(;;){var s=this.consumeCodePoint();if(s===yf||41===s)return{type:22,value:_p.apply(void 0,e)};if(xf(s))return this.consumeWhiteSpace(),this.peekCodePoint(0)===yf||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:_p.apply(void 0,e)}):(this.consumeBadUrlRemnants(),Hf);if(34===s||39===s||40===s||Cf(s))return this.consumeBadUrlRemnants(),Hf;if(92===s){if(!Mf(s,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),Hf;e.push(this.consumeEscapedCodePoint())}else e.push(s)}},e.prototype.consumeWhiteSpace=function(){for(;xf(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(41===e||e===yf)return;Mf(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t="";e>0;){var i=Math.min(5e4,e);t+=_p.apply(void 0,this._value.splice(0,i)),e-=i}return this._value.shift(),t},e.prototype.consumeStringToken=function(e){for(var t="",i=0;;){var s=this._value[i];if(s===yf||void 0===s||s===e)return{type:0,value:t+=this.consumeStringSlice(i)};if(10===s)return this._value.splice(0,i),jf;if(92===s){var r=this._value[i+1];r!==yf&&void 0!==r&&(10===r?(t+=this.consumeStringSlice(i),i=-1,this._value.shift()):Mf(s,r)&&(t+=this.consumeStringSlice(i),t+=_p(this.consumeEscapedCodePoint()),i=-1))}i++}},e.prototype.consumeNumber=function(){var e=[],t=4,i=this.peekCodePoint(0);for(i!==_f&&i!==mf||e.push(this.consumeCodePoint());bf(this.peekCodePoint(0));)e.push(this.consumeCodePoint());i=this.peekCodePoint(0);var s=this.peekCodePoint(1);if(46===i&&bf(s))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;bf(this.peekCodePoint(0));)e.push(this.consumeCodePoint());i=this.peekCodePoint(0),s=this.peekCodePoint(1);var r=this.peekCodePoint(2);if((69===i||101===i)&&((s===_f||s===mf)&&bf(r)||bf(s)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;bf(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[Ef(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],i=e[1],s=this.peekCodePoint(0),r=this.peekCodePoint(1),n=this.peekCodePoint(2);return kf(s,r,n)?{type:15,number:t,flags:i,unit:this.consumeName()}:37===s?(this.consumeCodePoint(),{type:16,number:t,flags:i}):{type:17,number:t,flags:i}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(Bf(e)){for(var t=_p(e);Bf(this.peekCodePoint(0))&&t.length<6;)t+=_p(this.consumeCodePoint());xf(this.peekCodePoint(0))&&this.consumeCodePoint();var i=parseInt(t,16);return 0===i||function(e){return e>=55296&&e<=57343}(i)||i>1114111?65533:i}return e===yf?65533:e},e.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(Pf(t))e+=_p(t);else{if(!Mf(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=_p(this.consumeEscapedCodePoint())}}},e}(),$f=function(){function e(e){this._tokens=e}return e.create=function(t){var i=new qf;return i.write(t),new e(i.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();31===e.type;)e=this.consumeToken();if(32===e.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do{e=this.consumeToken()}while(31===e.type);if(32===e.type)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(32===t.type)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},i=this.consumeToken();;){if(32===i.type||lv(i,e))return t;this.reconsumeToken(i),t.values.push(this.consumeComponentValue()),i=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var i=this.consumeToken();if(32===i.type||3===i.type)return t;this.reconsumeToken(i),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return void 0===e?Zf:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),ev=function(e){return 15===e.type},tv=function(e){return 17===e.type},iv=function(e){return 20===e.type},sv=function(e){return 0===e.type},rv=function(e,t){return iv(e)&&e.value===t},nv=function(e){return 31!==e.type},ov=function(e){return 31!==e.type&&4!==e.type},av=function(e){var t=[],i=[];return e.forEach((function(e){if(4===e.type){if(0===i.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(i),void(i=[])}31!==e.type&&i.push(e)})),i.length&&t.push(i),t},lv=function(e,t){return 11===t&&12===e.type||(28===t&&29===e.type||2===t&&3===e.type)},uv=function(e){return 17===e.type||15===e.type},Av=function(e){return 16===e.type||uv(e)},cv=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},hv={type:17,number:0,flags:4},dv={type:16,number:50,flags:4},pv={type:16,number:100,flags:4},fv=function(e,t,i){var s=e[0],r=e[1];return[vv(s,t),vv(void 0!==r?r:s,i)]},vv=function(e,t){if(16===e.type)return e.number/100*t;if(ev(e))switch(e.unit){case"rem":case"em":return 16*e.number;default:return e.number}return e.number},gv="grad",mv="turn",_v=function(e,t){if(15===t.type)switch(t.unit){case"deg":return Math.PI*t.number/180;case gv:return Math.PI/200*t.number;case"rad":return t.number;case mv:return 2*Math.PI*t.number}throw new Error("Unsupported angle type")},yv=function(e){return 15===e.type&&("deg"===e.unit||e.unit===gv||"rad"===e.unit||e.unit===mv)},bv=function(e){switch(e.filter(iv).map((function(e){return e.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[hv,hv];case"to top":case"bottom":return Bv(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[hv,pv];case"to right":case"left":return Bv(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[pv,pv];case"to bottom":case"top":return Bv(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[pv,hv];case"to left":case"right":return Bv(270)}return 0},Bv=function(e){return Math.PI*e/180},xv=function(e,t){if(18===t.type){var i=Dv[t.name];if(void 0===i)throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return i(e,t.values)}if(5===t.type){if(3===t.value.length){var s=t.value.substring(0,1),r=t.value.substring(1,2),n=t.value.substring(2,3);return Cv(parseInt(s+s,16),parseInt(r+r,16),parseInt(n+n,16),1)}if(4===t.value.length){s=t.value.substring(0,1),r=t.value.substring(1,2),n=t.value.substring(2,3);var o=t.value.substring(3,4);return Cv(parseInt(s+s,16),parseInt(r+r,16),parseInt(n+n,16),parseInt(o+o,16)/255)}if(6===t.value.length){s=t.value.substring(0,2),r=t.value.substring(2,4),n=t.value.substring(4,6);return Cv(parseInt(s,16),parseInt(r,16),parseInt(n,16),1)}if(8===t.value.length){s=t.value.substring(0,2),r=t.value.substring(2,4),n=t.value.substring(4,6),o=t.value.substring(6,8);return Cv(parseInt(s,16),parseInt(r,16),parseInt(n,16),parseInt(o,16)/255)}}if(20===t.type){var a=Sv[t.value.toUpperCase()];if(void 0!==a)return a}return Sv.TRANSPARENT},wv=function(e){return 0==(255&e)},Pv=function(e){var t=255&e,i=255&e>>8,s=255&e>>16,r=255&e>>24;return t<255?"rgba("+r+","+s+","+i+","+t/255+")":"rgb("+r+","+s+","+i+")"},Cv=function(e,t,i,s){return(e<<24|t<<16|i<<8|Math.round(255*s)<<0)>>>0},Mv=function(e,t){if(17===e.type)return e.number;if(16===e.type){var i=3===t?1:255;return 3===t?e.number/100*i:Math.round(e.number/100*i)}return 0},kv=function(e,t){var i=t.filter(ov);if(3===i.length){var s=i.map(Mv),r=s[0],n=s[1],o=s[2];return Cv(r,n,o,1)}if(4===i.length){var a=i.map(Mv),l=(r=a[0],n=a[1],o=a[2],a[3]);return Cv(r,n,o,l)}return 0};function Fv(e,t,i){return i<0&&(i+=1),i>=1&&(i-=1),i<1/6?(t-e)*i*6+e:i<.5?t:i<2/3?6*(t-e)*(2/3-i)+e:e}var Ev=function(e,t){var i=t.filter(ov),s=i[0],r=i[1],n=i[2],o=i[3],a=(17===s.type?Bv(s.number):_v(e,s))/(2*Math.PI),l=Av(r)?r.number/100:0,u=Av(n)?n.number/100:0,A=void 0!==o&&Av(o)?vv(o,1):1;if(0===l)return Cv(255*u,255*u,255*u,1);var c=u<=.5?u*(l+1):u+l-u*l,h=2*u-c,d=Fv(h,c,a+1/3),p=Fv(h,c,a),f=Fv(h,c,a-1/3);return Cv(255*d,255*p,255*f,A)},Dv={hsl:Ev,hsla:Ev,rgb:kv,rgba:kv},Iv=function(e,t){return xv(e,$f.create(t).parseComponentValue())},Sv={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},Tv={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map((function(e){if(iv(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Lv={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Rv=function(e,t){var i=xv(e,t[0]),s=t[1];return s&&Av(s)?{color:i,stop:s}:{color:i,stop:null}},Uv=function(e,t){var i=e[0],s=e[e.length-1];null===i.stop&&(i.stop=hv),null===s.stop&&(s.stop=pv);for(var r=[],n=0,o=0;o<e.length;o++){var a=e[o].stop;if(null!==a){var l=vv(a,t);l>n?r.push(l):r.push(n),n=l}else r.push(null)}var u=null;for(o=0;o<r.length;o++){var A=r[o];if(null===A)null===u&&(u=o);else if(null!==u){for(var c=o-u,h=(A-r[u-1])/(c+1),d=1;d<=c;d++)r[u+d-1]=h*d;u=null}}return e.map((function(e,i){return{color:e.color,stop:Math.max(Math.min(1,r[i]/t),0)}}))},Ov=function(e,t,i){var s="number"==typeof e?e:function(e,t,i){var s=t/2,r=i/2,n=vv(e[0],t)-s,o=r-vv(e[1],i);return(Math.atan2(o,n)+2*Math.PI)%(2*Math.PI)}(e,t,i),r=Math.abs(t*Math.sin(s))+Math.abs(i*Math.cos(s)),n=t/2,o=i/2,a=r/2,l=Math.sin(s-Math.PI/2)*a,u=Math.cos(s-Math.PI/2)*a;return[r,n-u,n+u,o-l,o+l]},Qv=function(e,t){return Math.sqrt(e*e+t*t)},Nv=function(e,t,i,s,r){return[[0,0],[0,t],[e,0],[e,t]].reduce((function(e,t){var n=t[0],o=t[1],a=Qv(i-n,s-o);return(r?a<e.optimumDistance:a>e.optimumDistance)?{optimumCorner:t,optimumDistance:a}:e}),{optimumDistance:r?1/0:-1/0,optimumCorner:null}).optimumCorner},Vv=function(e,t){var i=Bv(180),s=[];return av(t).forEach((function(t,r){if(0===r){var n=t[0];if(20===n.type&&-1!==["top","left","right","bottom"].indexOf(n.value))return void(i=bv(t));if(yv(n))return void(i=(_v(e,n)+Bv(270))%Bv(360))}var o=Rv(e,t);s.push(o)})),{angle:i,stops:s,type:1}},Hv="closest-side",jv="farthest-side",Gv="closest-corner",zv="farthest-corner",Wv="circle",Kv="ellipse",Xv="cover",Yv="contain",Jv=function(e,t){var i=0,s=3,r=[],n=[];return av(t).forEach((function(t,o){var a=!0;if(0===o?a=t.reduce((function(e,t){if(iv(t))switch(t.value){case"center":return n.push(dv),!1;case"top":case"left":return n.push(hv),!1;case"right":case"bottom":return n.push(pv),!1}else if(Av(t)||uv(t))return n.push(t),!1;return e}),a):1===o&&(a=t.reduce((function(e,t){if(iv(t))switch(t.value){case Wv:return i=0,!1;case Kv:return i=1,!1;case Yv:case Hv:return s=0,!1;case jv:return s=1,!1;case Gv:return s=2,!1;case Xv:case zv:return s=3,!1}else if(uv(t)||Av(t))return Array.isArray(s)||(s=[]),s.push(t),!1;return e}),a)),a){var l=Rv(e,t);r.push(l)}})),{size:s,shape:i,stops:r,position:n,type:2}},Zv=function(e,t){if(22===t.type){var i={url:t.value,type:0};return e.cache.addImage(t.value),i}if(18===t.type){var s=$v[t.name];if(void 0===s)throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return s(e,t.values)}throw new Error("Unsupported image type "+t.type)};var qv,$v={"linear-gradient":function(e,t){var i=Bv(180),s=[];return av(t).forEach((function(t,r){if(0===r){var n=t[0];if(20===n.type&&"to"===n.value)return void(i=bv(t));if(yv(n))return void(i=_v(e,n))}var o=Rv(e,t);s.push(o)})),{angle:i,stops:s,type:1}},"-moz-linear-gradient":Vv,"-ms-linear-gradient":Vv,"-o-linear-gradient":Vv,"-webkit-linear-gradient":Vv,"radial-gradient":function(e,t){var i=0,s=3,r=[],n=[];return av(t).forEach((function(t,o){var a=!0;if(0===o){var l=!1;a=t.reduce((function(e,t){if(l)if(iv(t))switch(t.value){case"center":return n.push(dv),e;case"top":case"left":return n.push(hv),e;case"right":case"bottom":return n.push(pv),e}else(Av(t)||uv(t))&&n.push(t);else if(iv(t))switch(t.value){case Wv:return i=0,!1;case Kv:return i=1,!1;case"at":return l=!0,!1;case Hv:return s=0,!1;case Xv:case jv:return s=1,!1;case Yv:case Gv:return s=2,!1;case zv:return s=3,!1}else if(uv(t)||Av(t))return Array.isArray(s)||(s=[]),s.push(t),!1;return e}),a)}if(a){var u=Rv(e,t);r.push(u)}})),{size:s,shape:i,stops:r,position:n,type:2}},"-moz-radial-gradient":Jv,"-ms-radial-gradient":Jv,"-o-radial-gradient":Jv,"-webkit-radial-gradient":Jv,"-webkit-gradient":function(e,t){var i=Bv(180),s=[],r=1;return av(t).forEach((function(t,i){var n=t[0];if(0===i){if(iv(n)&&"linear"===n.value)return void(r=1);if(iv(n)&&"radial"===n.value)return void(r=2)}if(18===n.type)if("from"===n.name){var o=xv(e,n.values[0]);s.push({stop:hv,color:o})}else if("to"===n.name){o=xv(e,n.values[0]);s.push({stop:pv,color:o})}else if("color-stop"===n.name){var a=n.values.filter(ov);if(2===a.length){o=xv(e,a[1]);var l=a[0];tv(l)&&s.push({stop:{type:16,number:100*l.number,flags:l.flags},color:o})}}})),1===r?{angle:(i+Bv(180))%Bv(360),stops:s,type:r}:{size:3,shape:0,stops:s,position:[],type:r}}},eg={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var i=t[0];return 20===i.type&&"none"===i.value?[]:t.filter((function(e){return ov(e)&&function(e){return!(20===e.type&&"none"===e.value||18===e.type&&!$v[e.name])}(e)})).map((function(t){return Zv(e,t)}))}},tg={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map((function(e){if(iv(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},ig={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return av(t).map((function(e){return e.filter(Av)})).map(cv)}},sg={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return av(t).map((function(e){return e.filter(iv).map((function(e){return e.value})).join(" ")})).map(rg)}},rg=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(qv||(qv={}));var ng,og={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return av(t).map((function(e){return e.filter(ag)}))}},ag=function(e){return iv(e)||Av(e)},lg=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},ug=lg("top"),Ag=lg("right"),cg=lg("bottom"),hg=lg("left"),dg=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return cv(t.filter(Av))}}},pg=dg("top-left"),fg=dg("top-right"),vg=dg("bottom-right"),gg=dg("bottom-left"),mg=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},_g=mg("top"),yg=mg("right"),bg=mg("bottom"),Bg=mg("left"),xg=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return ev(t)?t.number:0}}},wg=xg("top"),Pg=xg("right"),Cg=xg("bottom"),Mg=xg("left"),kg={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Fg={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){return"rtl"===t?1:0}},Eg={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(iv).reduce((function(e,t){return e|Dg(t.value)}),0)}},Dg=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},Ig={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Sg={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return 20===t.type&&"normal"===t.value?0:17===t.type||15===t.type?t.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(ng||(ng={}));var Tg,Lg={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"strict"===t?ng.STRICT:ng.NORMAL}},Rg={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ug=function(e,t){return iv(e)&&"normal"===e.value?1.2*t:17===e.type?t*e.number:Av(e)?vv(e,t):t},Og={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return 20===t.type&&"none"===t.value?null:Zv(e,t)}},Qg={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){return"inside"===t?0:1}},Ng={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},Vg=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},Hg=Vg("top"),jg=Vg("right"),Gg=Vg("bottom"),zg=Vg("left"),Wg={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(iv).map((function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}}))}},Kg={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"break-word"===t?"break-word":"normal"}},Xg=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Yg=Xg("top"),Jg=Xg("right"),Zg=Xg("bottom"),qg=Xg("left"),$g={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},em={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},tm={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&rv(t[0],"none")?[]:av(t).map((function(t){for(var i={color:Sv.TRANSPARENT,offsetX:hv,offsetY:hv,blur:hv},s=0,r=0;r<t.length;r++){var n=t[r];uv(n)?(0===s?i.offsetX=n:1===s?i.offsetY=n:i.blur=n,s++):i.color=xv(e,n)}return i}))}},im={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},sm={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,t){if(20===t.type&&"none"===t.value)return null;if(18===t.type){var i=rm[t.name];if(void 0===i)throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return i(t.values)}return null}},rm={matrix:function(e){var t=e.filter((function(e){return 17===e.type})).map((function(e){return e.number}));return 6===t.length?t:null},matrix3d:function(e){var t=e.filter((function(e){return 17===e.type})).map((function(e){return e.number})),i=t[0],s=t[1];t[2],t[3];var r=t[4],n=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var o=t[12],a=t[13];return t[14],t[15],16===t.length?[i,s,r,n,o,a]:null}},nm={type:16,number:50,flags:4},om=[nm,nm],am={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var i=t.filter(Av);return 2!==i.length?om:[i[0],i[1]]}},lm={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"}(Tg||(Tg={}));for(var um={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return Tg.BREAK_ALL;case"keep-all":return Tg.KEEP_ALL;default:return Tg.NORMAL}}},Am={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(20===t.type)return{auto:!0,order:0};if(tv(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},cm=function(e,t){if(15===t.type)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")},hm={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return tv(t)?t.number:1}},dm={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},pm={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(iv).map((function(e){switch(e.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0})).filter((function(e){return 0!==e}))}},fm={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var i=[],s=[];return t.forEach((function(e){switch(e.type){case 20:case 0:i.push(e.value);break;case 17:i.push(e.number.toString());break;case 4:s.push(i.join(" ")),i.length=0}})),i.length&&s.push(i.join(" ")),s.map((function(e){return-1===e.indexOf(" ")?e:"'"+e+"'"}))}},vm={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},gm={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){return tv(t)?t.number:iv(t)&&"bold"===t.value?700:400}},mm={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(iv).map((function(e){return e.value}))}},_m={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},ym=function(e,t){return 0!=(e&t)},bm={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var i=t[0];return 20===i.type&&"none"===i.value?[]:t}},Bm={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var i=t[0];if(20===i.type&&"none"===i.value)return null;for(var s=[],r=t.filter(nv),n=0;n<r.length;n++){var o=r[n],a=r[n+1];if(20===o.type){var l=a&&tv(a)?a.number:1;s.push({counter:o.value,increment:l})}}return s}},xm={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return[];for(var i=[],s=t.filter(nv),r=0;r<s.length;r++){var n=s[r],o=s[r+1];if(iv(n)&&"none"!==n.value){var a=o&&tv(o)?o.number:0;i.push({counter:n.value,reset:a})}}return i}},wm={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(ev).map((function(t){return cm(e,t)}))}},Pm={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var i=t[0];if(20===i.type&&"none"===i.value)return null;var s=[],r=t.filter(sv);if(r.length%2!=0)return null;for(var n=0;n<r.length;n+=2){var o=r[n].value,a=r[n+1].value;s.push({open:o,close:a})}return s}},Cm=function(e,t,i){if(!e)return"";var s=e[Math.min(t,e.length-1)];return s?i?s.open:s.close:""},Mm={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&rv(t[0],"none")?[]:av(t).map((function(t){for(var i={color:255,offsetX:hv,offsetY:hv,blur:hv,spread:hv,inset:!1},s=0,r=0;r<t.length;r++){var n=t[r];rv(n,"inset")?i.inset=!0:uv(n)?(0===s?i.offsetX=n:1===s?i.offsetY=n:2===s?i.blur=n:i.spread=n,s++):i.color=xv(e,n)}return i}))}},km={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var i=[];return t.filter(iv).forEach((function(e){switch(e.value){case"stroke":i.push(1);break;case"fill":i.push(0);break;case"markers":i.push(2)}})),[0,1,2].forEach((function(e){-1===i.indexOf(e)&&i.push(e)})),i}},Fm={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},Em={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return ev(t)?t.number:0}},Dm=function(){function e(e,t){var i,s;this.animationDuration=Tm(e,wm,t.animationDuration),this.backgroundClip=Tm(e,Tv,t.backgroundClip),this.backgroundColor=Tm(e,Lv,t.backgroundColor),this.backgroundImage=Tm(e,eg,t.backgroundImage),this.backgroundOrigin=Tm(e,tg,t.backgroundOrigin),this.backgroundPosition=Tm(e,ig,t.backgroundPosition),this.backgroundRepeat=Tm(e,sg,t.backgroundRepeat),this.backgroundSize=Tm(e,og,t.backgroundSize),this.borderTopColor=Tm(e,ug,t.borderTopColor),this.borderRightColor=Tm(e,Ag,t.borderRightColor),this.borderBottomColor=Tm(e,cg,t.borderBottomColor),this.borderLeftColor=Tm(e,hg,t.borderLeftColor),this.borderTopLeftRadius=Tm(e,pg,t.borderTopLeftRadius),this.borderTopRightRadius=Tm(e,fg,t.borderTopRightRadius),this.borderBottomRightRadius=Tm(e,vg,t.borderBottomRightRadius),this.borderBottomLeftRadius=Tm(e,gg,t.borderBottomLeftRadius),this.borderTopStyle=Tm(e,_g,t.borderTopStyle),this.borderRightStyle=Tm(e,yg,t.borderRightStyle),this.borderBottomStyle=Tm(e,bg,t.borderBottomStyle),this.borderLeftStyle=Tm(e,Bg,t.borderLeftStyle),this.borderTopWidth=Tm(e,wg,t.borderTopWidth),this.borderRightWidth=Tm(e,Pg,t.borderRightWidth),this.borderBottomWidth=Tm(e,Cg,t.borderBottomWidth),this.borderLeftWidth=Tm(e,Mg,t.borderLeftWidth),this.boxShadow=Tm(e,Mm,t.boxShadow),this.color=Tm(e,kg,t.color),this.direction=Tm(e,Fg,t.direction),this.display=Tm(e,Eg,t.display),this.float=Tm(e,Ig,t.cssFloat),this.fontFamily=Tm(e,fm,t.fontFamily),this.fontSize=Tm(e,vm,t.fontSize),this.fontStyle=Tm(e,_m,t.fontStyle),this.fontVariant=Tm(e,mm,t.fontVariant),this.fontWeight=Tm(e,gm,t.fontWeight),this.letterSpacing=Tm(e,Sg,t.letterSpacing),this.lineBreak=Tm(e,Lg,t.lineBreak),this.lineHeight=Tm(e,Rg,t.lineHeight),this.listStyleImage=Tm(e,Og,t.listStyleImage),this.listStylePosition=Tm(e,Qg,t.listStylePosition),this.listStyleType=Tm(e,Ng,t.listStyleType),this.marginTop=Tm(e,Hg,t.marginTop),this.marginRight=Tm(e,jg,t.marginRight),this.marginBottom=Tm(e,Gg,t.marginBottom),this.marginLeft=Tm(e,zg,t.marginLeft),this.opacity=Tm(e,hm,t.opacity);var r=Tm(e,Wg,t.overflow);this.overflowX=r[0],this.overflowY=r[r.length>1?1:0],this.overflowWrap=Tm(e,Kg,t.overflowWrap),this.paddingTop=Tm(e,Yg,t.paddingTop),this.paddingRight=Tm(e,Jg,t.paddingRight),this.paddingBottom=Tm(e,Zg,t.paddingBottom),this.paddingLeft=Tm(e,qg,t.paddingLeft),this.paintOrder=Tm(e,km,t.paintOrder),this.position=Tm(e,em,t.position),this.textAlign=Tm(e,$g,t.textAlign),this.textDecorationColor=Tm(e,dm,null!==(i=t.textDecorationColor)&&void 0!==i?i:t.color),this.textDecorationLine=Tm(e,pm,null!==(s=t.textDecorationLine)&&void 0!==s?s:t.textDecoration),this.textShadow=Tm(e,tm,t.textShadow),this.textTransform=Tm(e,im,t.textTransform),this.transform=Tm(e,sm,t.transform),this.transformOrigin=Tm(e,am,t.transformOrigin),this.visibility=Tm(e,lm,t.visibility),this.webkitTextStrokeColor=Tm(e,Fm,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=Tm(e,Em,t.webkitTextStrokeWidth),this.wordBreak=Tm(e,um,t.wordBreak),this.zIndex=Tm(e,Am,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return wv(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return 0!==this.position},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return 0!==this.float},e.prototype.isInlineLevel=function(){return ym(this.display,4)||ym(this.display,33554432)||ym(this.display,268435456)||ym(this.display,536870912)||ym(this.display,67108864)||ym(this.display,134217728)},e}(),Im=function(e,t){this.content=Tm(e,bm,t.content),this.quotes=Tm(e,Pm,t.quotes)},Sm=function(e,t){this.counterIncrement=Tm(e,Bm,t.counterIncrement),this.counterReset=Tm(e,xm,t.counterReset)},Tm=function(e,t,i){var s=new qf,r=null!=i?i.toString():t.initialValue;s.write(r);var n=new $f(s.read());switch(t.type){case 2:var o=n.parseComponentValue();return t.parse(e,iv(o)?o.value:t.initialValue);case 0:return t.parse(e,n.parseComponentValue());case 1:return t.parse(e,n.parseComponentValues());case 4:return n.parseComponentValue();case 3:switch(t.format){case"angle":return _v(e,n.parseComponentValue());case"color":return xv(e,n.parseComponentValue());case"image":return Zv(e,n.parseComponentValue());case"length":var a=n.parseComponentValue();return uv(a)?a:hv;case"length-percentage":var l=n.parseComponentValue();return Av(l)?l:hv;case"time":return cm(e,n.parseComponentValue())}}},Lm=function(e,t){var i=function(e){switch(e.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(e);return 1===i||t===i},Rm=function(e,t){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Lm(t,3),this.styles=new Dm(e,window.getComputedStyle(t,null)),N_(t)&&(this.styles.animationDuration.some((function(e){return e>0}))&&(t.style.animationDuration="0s"),null!==this.styles.transform&&(t.style.transform="none")),this.bounds=gp(this.context,t),Lm(t,4)&&(this.flags|=16)},Um="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Om="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Qm=0;Qm<64;Qm++)Om[Um.charCodeAt(Qm)]=Qm;for(var Nm=function(e,t,i){return e.slice?e.slice(t,i):new Uint16Array(Array.prototype.slice.call(e,t,i))},Vm=function(){function e(e,t,i,s,r,n){this.initialValue=e,this.errorValue=t,this.highStart=i,this.highValueIndex=s,this.index=r,this.data=n}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>5])<<2)+(31&e),this.data[t];if(e<=65535)return t=((t=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[t];if(e<this.highStart)return t=2080+(e>>11),t=this.index[t],t+=e>>5&63,t=((t=this.index[t])<<2)+(31&e),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),Hm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jm="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Gm=0;Gm<64;Gm++)jm[Hm.charCodeAt(Gm)]=Gm;var zm,Wm=8,Km=9,Xm=11,Ym=12,Jm=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var i=e.length;if(!i)return"";for(var s=[],r=-1,n="";++r<i;){var o=e[r];o<=65535?s.push(o):(o-=65536,s.push(55296+(o>>10),o%1024+56320)),(r+1===i||s.length>16384)&&(n+=String.fromCharCode.apply(String,s),s.length=0)}return n},Zm=function(e,t){var i,s,r,n=function(e){var t,i,s,r,n,o=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var u="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(o):new Array(o),A=Array.isArray(u)?u:new Uint8Array(u);for(t=0;t<a;t+=4)i=Om[e.charCodeAt(t)],s=Om[e.charCodeAt(t+1)],r=Om[e.charCodeAt(t+2)],n=Om[e.charCodeAt(t+3)],A[l++]=i<<2|s>>4,A[l++]=(15&s)<<4|r>>2,A[l++]=(3&r)<<6|63&n;return u}(e),o=Array.isArray(n)?function(e){for(var t=e.length,i=[],s=0;s<t;s+=4)i.push(e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s]);return i}(n):new Uint32Array(n),a=Array.isArray(n)?function(e){for(var t=e.length,i=[],s=0;s<t;s+=2)i.push(e[s+1]<<8|e[s]);return i}(n):new Uint16Array(n),l=Nm(a,12,o[4]/2),u=2===o[5]?Nm(a,(24+o[4])/2):(i=o,s=Math.ceil((24+o[4])/4),i.slice?i.slice(s,r):new Uint32Array(Array.prototype.slice.call(i,s,r)));return new Vm(o[0],o[1],o[2],o[3],l,u)}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUF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AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGV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AGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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gAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),qm="×",$m=function(e){return Zm.get(e)},e_=function(e,t,i){var s=i-2,r=t[s],n=t[i-1],o=t[i];if(2===n&&3===o)return qm;if(2===n||3===n||4===n)return"÷";if(2===o||3===o||4===o)return"÷";if(n===Wm&&-1!==[Wm,Km,Xm,Ym].indexOf(o))return qm;if(!(n!==Xm&&n!==Km||o!==Km&&10!==o))return qm;if((n===Ym||10===n)&&10===o)return qm;if(13===o||5===o)return qm;if(7===o)return qm;if(1===n)return qm;if(13===n&&14===o){for(;5===r;)r=t[--s];if(14===r)return qm}if(15===n&&15===o){for(var a=0;15===r;)a++,r=t[--s];if(a%2==0)return qm}return"÷"},t_=function(e){var t=function(e){for(var t=[],i=0,s=e.length;i<s;){var r=e.charCodeAt(i++);if(r>=55296&&r<=56319&&i<s){var n=e.charCodeAt(i++);56320==(64512&n)?t.push(((1023&r)<<10)+(1023&n)+65536):(t.push(r),i--)}else t.push(r)}return t}(e),i=t.length,s=0,r=0,n=t.map($m);return{next:function(){if(s>=i)return{done:!0,value:null};for(var e=qm;s<i&&(e=e_(0,n,++s))===qm;);if(e!==qm||s===i){var o=Jm.apply(null,t.slice(r,s));return r=s,{value:o,done:!1}}return{done:!0,value:null}}}},i_=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},s_=function(e,t,i,s,r){var n="http://www.w3.org/2000/svg",o=document.createElementNS(n,"svg"),a=document.createElementNS(n,"foreignObject");return o.setAttributeNS(null,"width",e.toString()),o.setAttributeNS(null,"height",t.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",i.toString()),a.setAttributeNS(null,"y",s.toString()),a.setAttributeNS(null,"externalResourcesRequired","true"),o.appendChild(a),a.appendChild(r),o},r_=function(e){return new Promise((function(t,i){var s=new Image;s.onload=function(){return t(s)},s.onerror=i,s.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))}))},n_={get SUPPORT_RANGE_BOUNDS(){var e=function(e){if(e.createRange){var t=e.createRange();if(t.getBoundingClientRect){var i=e.createElement("boundtest");i.style.height="123px",i.style.display="block",e.body.appendChild(i),t.selectNode(i);var s=t.getBoundingClientRect(),r=Math.round(s.height);if(e.body.removeChild(i),123===r)return!0}}return!1}(document);return Object.defineProperty(n_,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=n_.SUPPORT_RANGE_BOUNDS&&function(e){var t=e.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",e.body.appendChild(t);var i=e.createRange();t.innerHTML="function"==typeof"".repeat?"👨".repeat(10):"";var s=t.firstChild,r=mp(s.data).map((function(e){return _p(e)})),n=0,o={},a=r.every((function(e,t){i.setStart(s,n),i.setEnd(s,n+e.length);var r=i.getBoundingClientRect();n+=e.length;var a=r.x>o.x||r.y>o.y;return o=r,0===t||a}));return e.body.removeChild(t),a}(document);return Object.defineProperty(n_,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var t=new Image,i=e.createElement("canvas"),s=i.getContext("2d");if(!s)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{s.drawImage(t,0,0),i.toDataURL()}catch(e){return!1}return!0}(document);return Object.defineProperty(n_,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"==typeof Array.from&&"function"==typeof window.fetch?function(e){var t=e.createElement("canvas"),i=100;t.width=i,t.height=i;var s=t.getContext("2d");if(!s)return Promise.reject(!1);s.fillStyle="rgb(0, 255, 0)",s.fillRect(0,0,i,i);var r=new Image,n=t.toDataURL();r.src=n;var o=s_(i,i,0,0,r);return s.fillStyle="red",s.fillRect(0,0,i,i),r_(o).then((function(t){s.drawImage(t,0,0);var r=s.getImageData(0,0,i,i).data;s.fillStyle="red",s.fillRect(0,0,i,i);var o=e.createElement("div");return o.style.backgroundImage="url("+n+")",o.style.height=i+"px",i_(r)?r_(s_(i,i,0,0,o)):Promise.reject(!1)})).then((function(e){return s.drawImage(e,0,0),i_(s.getImageData(0,0,i,i).data)})).catch((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(n_,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=void 0!==(new Image).crossOrigin;return Object.defineProperty(n_,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(n_,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(n_,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(n_,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},o_=function(e,t){this.text=e,this.bounds=t},a_=function(e,t){var i=t.ownerDocument;if(i){var s=i.createElement("html2canvaswrapper");s.appendChild(t.cloneNode(!0));var r=t.parentNode;if(r){r.replaceChild(s,t);var n=gp(e,s);return s.firstChild&&r.replaceChild(s.firstChild,s),n}}return vp.EMPTY},l_=function(e,t,i){var s=e.ownerDocument;if(!s)throw new Error("Node has no owner document");var r=s.createRange();return r.setStart(e,t),r.setEnd(e,t+i),r},u_=function(e){if(n_.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map((function(e){return e.segment}))}return function(e){for(var t,i=t_(e),s=[];!(t=i.next()).done;)t.value&&s.push(t.value.slice());return s}(e)},A_=function(e,t){return 0!==t.letterSpacing?u_(e):function(e,t){if(n_.SUPPORT_NATIVE_TEXT_SEGMENTATION){var i=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(i.segment(e)).map((function(e){return e.segment}))}return h_(e,t)}(e,t)},c_=[32,160,4961,65792,65793,4153,4241],h_=function(e,t){for(var i,s=function(e,t){var i=mp(e),s=vf(i,t),r=s[0],n=s[1],o=s[2],a=i.length,l=0,u=0;return{next:function(){if(u>=a)return{done:!0,value:null};for(var e=sf;u<a&&(e=ff(i,n,r,++u,o))===sf;);if(e!==sf||u===a){var t=new gf(i,e,l,u);return l=u,{value:t,done:!1}}return{done:!0,value:null}}}}(e,{lineBreak:t.lineBreak,wordBreak:"break-word"===t.overflowWrap?"break-word":t.wordBreak}),r=[],n=function(){if(i.value){var e=i.value.slice(),t=mp(e),s="";t.forEach((function(e){-1===c_.indexOf(e)?s+=_p(e):(s.length&&r.push(s),r.push(_p(e)),s="")})),s.length&&r.push(s)}};!(i=s.next()).done;)n();return r},d_=function(e,t,i){this.text=p_(t.data,i.textTransform),this.textBounds=function(e,t,i,s){var r=A_(t,i),n=[],o=0;return r.forEach((function(t){if(i.textDecorationLine.length||t.trim().length>0)if(n_.SUPPORT_RANGE_BOUNDS){var r=l_(s,o,t.length).getClientRects();if(r.length>1){var a=u_(t),l=0;a.forEach((function(t){n.push(new o_(t,vp.fromDOMRectList(e,l_(s,l+o,t.length).getClientRects()))),l+=t.length}))}else n.push(new o_(t,vp.fromDOMRectList(e,r)))}else{var u=s.splitText(t.length);n.push(new o_(t,a_(e,s))),s=u}else n_.SUPPORT_RANGE_BOUNDS||(s=s.splitText(t.length));o+=t.length})),n}(e,this.text,i,t)},p_=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(f_,v_);case 2:return e.toUpperCase();default:return e}},f_=/(^|\s|:|-|\(|\))([a-z])/g,v_=function(e,t,i){return e.length>0?t+i.toUpperCase():e},g_=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.src=i.currentSrc||i.src,s.intrinsicWidth=i.naturalWidth,s.intrinsicHeight=i.naturalHeight,s.context.cache.addImage(s.src),s}return cp(t,e),t}(Rm),m_=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.canvas=i,s.intrinsicWidth=i.width,s.intrinsicHeight=i.height,s}return cp(t,e),t}(Rm),__=function(e){function t(t,i){var s=e.call(this,t,i)||this,r=new XMLSerializer,n=gp(t,i);return i.setAttribute("width",n.width+"px"),i.setAttribute("height",n.height+"px"),s.svg="data:image/svg+xml,"+encodeURIComponent(r.serializeToString(i)),s.intrinsicWidth=i.width.baseVal.value,s.intrinsicHeight=i.height.baseVal.value,s.context.cache.addImage(s.svg),s}return cp(t,e),t}(Rm),y_=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.value=i.value,s}return cp(t,e),t}(Rm),b_=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.start=i.start,s.reversed="boolean"==typeof i.reversed&&!0===i.reversed,s}return cp(t,e),t}(Rm),B_=[{type:15,flags:0,unit:"px",number:3}],x_=[{type:16,flags:0,number:50}],w_="checkbox",P_="radio",C_="password",M_=707406591,k_=function(e){function t(t,i){var s,r=e.call(this,t,i)||this;switch(r.type=i.type.toLowerCase(),r.checked=i.checked,r.value=function(e){var t=e.type===C_?new Array(e.value.length+1).join("•"):e.value;return 0===t.length?e.placeholder||"":t}(i),r.type!==w_&&r.type!==P_||(r.styles.backgroundColor=3739148031,r.styles.borderTopColor=r.styles.borderRightColor=r.styles.borderBottomColor=r.styles.borderLeftColor=2779096575,r.styles.borderTopWidth=r.styles.borderRightWidth=r.styles.borderBottomWidth=r.styles.borderLeftWidth=1,r.styles.borderTopStyle=r.styles.borderRightStyle=r.styles.borderBottomStyle=r.styles.borderLeftStyle=1,r.styles.backgroundClip=[0],r.styles.backgroundOrigin=[0],r.bounds=(s=r.bounds).width>s.height?new vp(s.left+(s.width-s.height)/2,s.top,s.height,s.height):s.width<s.height?new vp(s.left,s.top+(s.height-s.width)/2,s.width,s.width):s),r.type){case w_:r.styles.borderTopRightRadius=r.styles.borderTopLeftRadius=r.styles.borderBottomRightRadius=r.styles.borderBottomLeftRadius=B_;break;case P_:r.styles.borderTopRightRadius=r.styles.borderTopLeftRadius=r.styles.borderBottomRightRadius=r.styles.borderBottomLeftRadius=x_}return r}return cp(t,e),t}(Rm),F_=function(e){function t(t,i){var s=e.call(this,t,i)||this,r=i.options[i.selectedIndex||0];return s.value=r&&r.text||"",s}return cp(t,e),t}(Rm),E_=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.value=i.value,s}return cp(t,e),t}(Rm),D_=function(e){function t(t,i){var s=e.call(this,t,i)||this;s.src=i.src,s.width=parseInt(i.width,10)||0,s.height=parseInt(i.height,10)||0,s.backgroundColor=s.styles.backgroundColor;try{if(i.contentWindow&&i.contentWindow.document&&i.contentWindow.document.documentElement){s.tree=L_(t,i.contentWindow.document.documentElement);var r=i.contentWindow.document.documentElement?Iv(t,getComputedStyle(i.contentWindow.document.documentElement).backgroundColor):Sv.TRANSPARENT,n=i.contentWindow.document.body?Iv(t,getComputedStyle(i.contentWindow.document.body).backgroundColor):Sv.TRANSPARENT;s.backgroundColor=wv(r)?wv(n)?s.styles.backgroundColor:n:r}}catch(e){}return s}return cp(t,e),t}(Rm),I_=["OL","UL","MENU"],S_=function(e,t,i,s){for(var r=t.firstChild,n=void 0;r;r=n)if(n=r.nextSibling,O_(r)&&r.data.trim().length>0)i.textNodes.push(new d_(e,r,i.styles));else if(Q_(r))if(ey(r)&&r.assignedNodes)r.assignedNodes().forEach((function(t){return S_(e,t,i,s)}));else{var o=T_(e,r);o.styles.isVisible()&&(R_(r,o,s)?o.flags|=4:U_(o.styles)&&(o.flags|=2),-1!==I_.indexOf(r.tagName)&&(o.flags|=8),i.elements.push(o),r.slot,r.shadowRoot?S_(e,r.shadowRoot,o,s):q_(r)||z_(r)||$_(r)||S_(e,r,o,s))}},T_=function(e,t){return Y_(t)?new g_(e,t):K_(t)?new m_(e,t):z_(t)?new __(e,t):H_(t)?new y_(e,t):j_(t)?new b_(e,t):G_(t)?new k_(e,t):$_(t)?new F_(e,t):q_(t)?new E_(e,t):J_(t)?new D_(e,t):new Rm(e,t)},L_=function(e,t){var i=T_(e,t);return i.flags|=4,S_(e,t,i,i),i},R_=function(e,t,i){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||W_(e)&&i.styles.isTransparent()},U_=function(e){return e.isPositioned()||e.isFloating()},O_=function(e){return e.nodeType===Node.TEXT_NODE},Q_=function(e){return e.nodeType===Node.ELEMENT_NODE},N_=function(e){return Q_(e)&&void 0!==e.style&&!V_(e)},V_=function(e){return"object"===b(e.className)},H_=function(e){return"LI"===e.tagName},j_=function(e){return"OL"===e.tagName},G_=function(e){return"INPUT"===e.tagName},z_=function(e){return"svg"===e.tagName},W_=function(e){return"BODY"===e.tagName},K_=function(e){return"CANVAS"===e.tagName},X_=function(e){return"VIDEO"===e.tagName},Y_=function(e){return"IMG"===e.tagName},J_=function(e){return"IFRAME"===e.tagName},Z_=function(e){return"STYLE"===e.tagName},q_=function(e){return"TEXTAREA"===e.tagName},$_=function(e){return"SELECT"===e.tagName},ey=function(e){return"SLOT"===e.tagName},ty=function(e){return e.tagName.indexOf("-")>0},iy=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},e.prototype.pop=function(e){var t=this;e.forEach((function(e){return t.counters[e].pop()}))},e.prototype.parse=function(e){var t=this,i=e.counterIncrement,s=e.counterReset,r=!0;null!==i&&i.forEach((function(e){var i=t.counters[e.counter];i&&0!==e.increment&&(r=!1,i.length||i.push(1),i[Math.max(0,i.length-1)]+=e.increment)}));var n=[];return r&&s.forEach((function(e){var i=t.counters[e.counter];n.push(e.counter),i||(i=t.counters[e.counter]=[]),i.push(e.reset)})),n},e}(),sy={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},ry={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},ny={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},oy={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},ay=function(e,t,i,s,r,n){return e<t||e>i?vy(e,r,n.length>0):s.integers.reduce((function(t,i,r){for(;e>=i;)e-=i,t+=s.values[r];return t}),"")+n},ly=function(e,t,i,s){var r="";do{i||e--,r=s(e)+r,e/=t}while(e*t>=t);return r},uy=function(e,t,i,s,r){var n=i-t+1;return(e<0?"-":"")+(ly(Math.abs(e),n,s,(function(e){return _p(Math.floor(e%n)+t)}))+r)},Ay=function(e,t,i){void 0===i&&(i=". ");var s=t.length;return ly(Math.abs(e),s,!1,(function(e){return t[Math.floor(e%s)]}))+i},cy=function(e,t,i,s,r,n){if(e<-9999||e>9999)return vy(e,4,r.length>0);var o=Math.abs(e),a=r;if(0===o)return t[0]+a;for(var l=0;o>0&&l<=4;l++){var u=o%10;0===u&&ym(n,1)&&""!==a?a=t[u]+a:u>1||1===u&&0===l||1===u&&1===l&&ym(n,2)||1===u&&1===l&&ym(n,4)&&e>100||1===u&&l>1&&ym(n,8)?a=t[u]+(l>0?i[l-1]:"")+a:1===u&&l>0&&(a=i[l-1]+a),o=Math.floor(o/10)}return(e<0?s:"")+a},hy="十百千萬",dy="拾佰仟萬",py="マイナス",fy="마이너스",vy=function(e,t,i){var s=i?". ":"",r=i?"、":"",n=i?", ":"",o=i?" ":"";switch(t){case 0:return"•"+o;case 1:return"◦"+o;case 2:return"◾"+o;case 5:var a=uy(e,48,57,!0,s);return a.length<4?"0"+a:a;case 4:return Ay(e,"〇一二三四五六七八九",r);case 6:return ay(e,1,3999,sy,3,s).toLowerCase();case 7:return ay(e,1,3999,sy,3,s);case 8:return uy(e,945,969,!1,s);case 9:return uy(e,97,122,!1,s);case 10:return uy(e,65,90,!1,s);case 11:return uy(e,1632,1641,!0,s);case 12:case 49:return ay(e,1,9999,ry,3,s);case 35:return ay(e,1,9999,ry,3,s).toLowerCase();case 13:return uy(e,2534,2543,!0,s);case 14:case 30:return uy(e,6112,6121,!0,s);case 15:return Ay(e,"子丑寅卯辰巳午未申酉戌亥",r);case 16:return Ay(e,"甲乙丙丁戊己庚辛壬癸",r);case 17:case 48:return cy(e,"零一二三四五六七八九",hy,"負",r,14);case 47:return cy(e,"零壹貳參肆伍陸柒捌玖",dy,"負",r,15);case 42:return cy(e,"零一二三四五六七八九",hy,"负",r,14);case 41:return cy(e,"零壹贰叁肆伍陆柒捌玖",dy,"负",r,15);case 26:return cy(e,"〇一二三四五六七八九","十百千万",py,r,0);case 25:return cy(e,"零壱弐参四伍六七八九","拾百千万",py,r,7);case 31:return cy(e,"영일이삼사오육칠팔구","십백천만",fy,n,7);case 33:return cy(e,"零一二三四五六七八九","十百千萬",fy,n,0);case 32:return cy(e,"零壹貳參四五六七八九","拾百千",fy,n,7);case 18:return uy(e,2406,2415,!0,s);case 20:return ay(e,1,19999,oy,3,s);case 21:return uy(e,2790,2799,!0,s);case 22:return uy(e,2662,2671,!0,s);case 22:return ay(e,1,10999,ny,3,s);case 23:return Ay(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Ay(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return uy(e,3302,3311,!0,s);case 28:return Ay(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",r);case 29:return Ay(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",r);case 34:return uy(e,3792,3801,!0,s);case 37:return uy(e,6160,6169,!0,s);case 38:return uy(e,4160,4169,!0,s);case 39:return uy(e,2918,2927,!0,s);case 40:return uy(e,1776,1785,!0,s);case 43:return uy(e,3046,3055,!0,s);case 44:return uy(e,3174,3183,!0,s);case 45:return uy(e,3664,3673,!0,s);case 46:return uy(e,3872,3881,!0,s);default:return uy(e,48,57,!0,s)}},gy="data-html2canvas-ignore",my=function(){function e(e,t,i){if(this.context=e,this.options=i,this.scrolledElements=[],this.referenceElement=t,this.counters=new iy,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,t){var i=this,s=yy(e,t);if(!s.contentWindow)return Promise.reject("Unable to find iframe window");var r=e.defaultView.pageXOffset,n=e.defaultView.pageYOffset,o=s.contentWindow,a=o.document,l=xy(s).then((function(){return dp(i,void 0,void 0,(function(){var e,i;return pp(this,(function(r){switch(r.label){case 0:return this.scrolledElements.forEach(ky),o&&(o.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||o.scrollY===t.top&&o.scrollX===t.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-t.left,o.scrollY-t.top,0,0))),e=this.options.onclone,void 0===(i=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:a.fonts&&a.fonts.ready?[4,a.fonts.ready]:[3,2];case 1:r.sent(),r.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,By(a)]:[3,4];case 3:r.sent(),r.label=4;case 4:return"function"==typeof e?[2,Promise.resolve().then((function(){return e(a,i)})).then((function(){return s}))]:[2,s]}}))}))}));return a.open(),a.write(Cy(document.doctype)+"<html></html>"),My(this.referenceElement.ownerDocument,r,n),a.replaceChild(a.adoptNode(this.documentElement),a.documentElement),a.close(),l},e.prototype.createElementClone=function(e){if(Lm(e,2),K_(e))return this.createCanvasClone(e);if(X_(e))return this.createVideoClone(e);if(Z_(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return Y_(t)&&(Y_(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager")),ty(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return Py(e.style,t),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var i=[].slice.call(t.cssRules,0).reduce((function(e,t){return t&&"string"==typeof t.cssText?e+t.cssText:e}),""),s=e.cloneNode(!1);return s.textContent=i,s}}catch(e){if(this.context.logger.error("Unable to access cssRules property",e),"SecurityError"!==e.name)throw e}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var i=e.ownerDocument.createElement("img");try{return i.src=e.toDataURL(),i}catch(t){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var s=e.cloneNode(!1);try{s.width=e.width,s.height=e.height;var r=e.getContext("2d"),n=s.getContext("2d");if(n)if(!this.options.allowTaint&&r)n.putImageData(r.getImageData(0,0,e.width,e.height),0,0);else{var o=null!==(t=e.getContext("webgl2"))&&void 0!==t?t:e.getContext("webgl");if(o){var a=o.getContextAttributes();!1===(null==a?void 0:a.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}n.drawImage(e,0,0)}return s}catch(t){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return s},e.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var i=t.getContext("2d");try{return i&&(i.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||i.getImageData(0,0,t.width,t.height)),t}catch(t){this.context.logger.info("Unable to clone video as it is tainted",e)}var s=e.ownerDocument.createElement("canvas");return s.width=e.offsetWidth,s.height=e.offsetHeight,s},e.prototype.appendChildNode=function(e,t,i){Q_(t)&&(function(e){return"SCRIPT"===e.tagName}(t)||t.hasAttribute(gy)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(t))||this.options.copyStyles&&Q_(t)&&Z_(t)||e.appendChild(this.cloneNode(t,i))},e.prototype.cloneChildNodes=function(e,t,i){for(var s=this,r=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;r;r=r.nextSibling)if(Q_(r)&&ey(r)&&"function"==typeof r.assignedNodes){var n=r.assignedNodes();n.length&&n.forEach((function(e){return s.appendChildNode(t,e,i)}))}else this.appendChildNode(t,r,i)},e.prototype.cloneNode=function(e,t){if(O_(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var i=e.ownerDocument.defaultView;if(i&&Q_(e)&&(N_(e)||V_(e))){var s=this.createElementClone(e);s.style.transitionProperty="none";var r=i.getComputedStyle(e),n=i.getComputedStyle(e,":before"),o=i.getComputedStyle(e,":after");this.referenceElement===e&&N_(s)&&(this.clonedReferenceElement=s),W_(s)&&Iy(s);var a=this.counters.parse(new Sm(this.context,r)),l=this.resolvePseudoContent(e,s,n,zm.BEFORE);ty(e)&&(t=!0),X_(e)||this.cloneChildNodes(e,s,t),l&&s.insertBefore(l,s.firstChild);var u=this.resolvePseudoContent(e,s,o,zm.AFTER);return u&&s.appendChild(u),this.counters.pop(a),(r&&(this.options.copyStyles||V_(e))&&!J_(e)||t)&&Py(r,s),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([s,e.scrollLeft,e.scrollTop]),(q_(e)||$_(e))&&(q_(s)||$_(s))&&(s.value=e.value),s}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,i,s){var r=this;if(i){var n=i.content,o=t.ownerDocument;if(o&&n&&"none"!==n&&"-moz-alt-content"!==n&&"none"!==i.display){this.counters.parse(new Sm(this.context,i));var a=new Im(this.context,i),l=o.createElement("html2canvaspseudoelement");Py(i,l),a.content.forEach((function(t){if(0===t.type)l.appendChild(o.createTextNode(t.value));else if(22===t.type){var i=o.createElement("img");i.src=t.value,i.style.opacity="1",l.appendChild(i)}else if(18===t.type){if("attr"===t.name){var s=t.values.filter(iv);s.length&&l.appendChild(o.createTextNode(e.getAttribute(s[0].value)||""))}else if("counter"===t.name){var n=t.values.filter(ov),u=n[0],A=n[1];if(u&&iv(u)){var c=r.counters.getCounterValue(u.value),h=A&&iv(A)?Ng.parse(r.context,A.value):3;l.appendChild(o.createTextNode(vy(c,h,!1)))}}else if("counters"===t.name){var d=t.values.filter(ov),p=(u=d[0],d[1]);A=d[2];if(u&&iv(u)){var f=r.counters.getCounterValues(u.value),v=A&&iv(A)?Ng.parse(r.context,A.value):3,g=p&&0===p.type?p.value:"",m=f.map((function(e){return vy(e,v,!1)})).join(g);l.appendChild(o.createTextNode(m))}}}else if(20===t.type)switch(t.value){case"open-quote":l.appendChild(o.createTextNode(Cm(a.quotes,r.quoteDepth++,!0)));break;case"close-quote":l.appendChild(o.createTextNode(Cm(a.quotes,--r.quoteDepth,!1)));break;default:l.appendChild(o.createTextNode(t.value))}})),l.className=Fy+" "+Ey;var u=s===zm.BEFORE?" "+Fy:" "+Ey;return V_(t)?t.className.baseValue+=u:t.className+=u,l}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(zm||(zm={}));var _y,yy=function(e,t){var i=e.createElement("iframe");return i.className="html2canvas-container",i.style.visibility="hidden",i.style.position="fixed",i.style.left="-10000px",i.style.top="0px",i.style.border="0",i.width=t.width.toString(),i.height=t.height.toString(),i.scrolling="no",i.setAttribute(gy,"true"),e.body.appendChild(i),i},by=function(e){return new Promise((function(t){e.complete?t():e.src?(e.onload=t,e.onerror=t):t()}))},By=function(e){return Promise.all([].slice.call(e.images,0).map(by))},xy=function(e){return new Promise((function(t,i){var s=e.contentWindow;if(!s)return i("No window assigned for iframe");var r=s.document;s.onload=e.onload=function(){s.onload=e.onload=null;var i=setInterval((function(){r.body.childNodes.length>0&&"complete"===r.readyState&&(clearInterval(i),t(e))}),50)}}))},wy=["all","d","content"],Py=function(e,t){for(var i=e.length-1;i>=0;i--){var s=e.item(i);-1===wy.indexOf(s)&&t.style.setProperty(s,e.getPropertyValue(s))}return t},Cy=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},My=function(e,t,i){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||i!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,i)},ky=function(e){var t=e[0],i=e[1],s=e[2];t.scrollLeft=i,t.scrollTop=s},Fy="___html2canvas___pseudoelement_before",Ey="___html2canvas___pseudoelement_after",Dy='{\n content: "" !important;\n display: none !important;\n}',Iy=function(e){Sy(e,"."+Fy+":before"+Dy+"\n ."+Ey+":after"+Dy)},Sy=function(e,t){var i=e.ownerDocument;if(i){var s=i.createElement("style");s.textContent=t,e.appendChild(s)}},Ty=function(){function e(){}return e.getOrigin=function(t){var i=e._link;return i?(i.href=t,i.href=i.href,i.protocol+i.hostname+i.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e}(),Ly=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)?t:Hy(e)||Qy(e)?((this._cache[e]=this.loadImage(e)).catch((function(){})),t):t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return dp(this,void 0,void 0,(function(){var t,i,s,r,n=this;return pp(this,(function(o){switch(o.label){case 0:return t=Ty.isSameOrigin(e),i=!Ny(e)&&!0===this._options.useCORS&&n_.SUPPORT_CORS_IMAGES&&!t,s=!Ny(e)&&!t&&!Hy(e)&&"string"==typeof this._options.proxy&&n_.SUPPORT_CORS_XHR&&!i,t||!1!==this._options.allowTaint||Ny(e)||Hy(e)||s||i?(r=e,s?[4,this.proxy(r)]:[3,2]):[2];case 1:r=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise((function(e,t){var s=new Image;s.onload=function(){return e(s)},s.onerror=t,(Vy(r)||i)&&(s.crossOrigin="anonymous"),s.src=r,!0===s.complete&&setTimeout((function(){return e(s)}),500),n._options.imageTimeout>0&&setTimeout((function(){return t("Timed out ("+n._options.imageTimeout+"ms) loading image")}),n._options.imageTimeout)}))];case 3:return[2,o.sent()]}}))}))},e.prototype.has=function(e){return void 0!==this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,i=this._options.proxy;if(!i)throw new Error("No proxy defined");var s=e.substring(0,256);return new Promise((function(r,n){var o=n_.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(200===a.status)if("text"===o)r(a.response);else{var e=new FileReader;e.addEventListener("load",(function(){return r(e.result)}),!1),e.addEventListener("error",(function(e){return n(e)}),!1),e.readAsDataURL(a.response)}else n("Failed to proxy resource "+s+" with status code "+a.status)},a.onerror=n;var l=i.indexOf("?")>-1?"&":"?";if(a.open("GET",""+i+l+"url="+encodeURIComponent(e)+"&responseType="+o),"text"!==o&&a instanceof XMLHttpRequest&&(a.responseType=o),t._options.imageTimeout){var u=t._options.imageTimeout;a.timeout=u,a.ontimeout=function(){return n("Timed out ("+u+"ms) proxying "+s)}}a.send()}))},e}(),Ry=/^data:image\/svg\+xml/i,Uy=/^data:image\/.*;base64,/i,Oy=/^data:image\/.*/i,Qy=function(e){return n_.SUPPORT_SVG_DRAWING||!jy(e)},Ny=function(e){return Oy.test(e)},Vy=function(e){return Uy.test(e)},Hy=function(e){return"blob"===e.substr(0,4)},jy=function(e){return"svg"===e.substr(-3).toLowerCase()||Ry.test(e)},Gy=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,i){return new e(this.x+t,this.y+i)},e}(),zy=function(e,t,i){return new Gy(e.x+(t.x-e.x)*i,e.y+(t.y-e.y)*i)},Wy=function(){function e(e,t,i,s){this.type=1,this.start=e,this.startControl=t,this.endControl=i,this.end=s}return e.prototype.subdivide=function(t,i){var s=zy(this.start,this.startControl,t),r=zy(this.startControl,this.endControl,t),n=zy(this.endControl,this.end,t),o=zy(s,r,t),a=zy(r,n,t),l=zy(o,a,t);return i?new e(this.start,s,o,l):new e(l,a,n,this.end)},e.prototype.add=function(t,i){return new e(this.start.add(t,i),this.startControl.add(t,i),this.endControl.add(t,i),this.end.add(t,i))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Ky=function(e){return 1===e.type},Xy=function(e){var t=e.styles,i=e.bounds,s=fv(t.borderTopLeftRadius,i.width,i.height),r=s[0],n=s[1],o=fv(t.borderTopRightRadius,i.width,i.height),a=o[0],l=o[1],u=fv(t.borderBottomRightRadius,i.width,i.height),A=u[0],c=u[1],h=fv(t.borderBottomLeftRadius,i.width,i.height),d=h[0],p=h[1],f=[];f.push((r+a)/i.width),f.push((d+A)/i.width),f.push((n+p)/i.height),f.push((l+c)/i.height);var v=Math.max.apply(Math,f);v>1&&(r/=v,n/=v,a/=v,l/=v,A/=v,c/=v,d/=v,p/=v);var g=i.width-a,m=i.height-c,_=i.width-A,y=i.height-p,b=t.borderTopWidth,B=t.borderRightWidth,x=t.borderBottomWidth,w=t.borderLeftWidth,P=vv(t.paddingTop,e.bounds.width),C=vv(t.paddingRight,e.bounds.width),M=vv(t.paddingBottom,e.bounds.width),k=vv(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=r>0||n>0?Yy(i.left+w/3,i.top+b/3,r-w/3,n-b/3,_y.TOP_LEFT):new Gy(i.left+w/3,i.top+b/3),this.topRightBorderDoubleOuterBox=r>0||n>0?Yy(i.left+g,i.top+b/3,a-B/3,l-b/3,_y.TOP_RIGHT):new Gy(i.left+i.width-B/3,i.top+b/3),this.bottomRightBorderDoubleOuterBox=A>0||c>0?Yy(i.left+_,i.top+m,A-B/3,c-x/3,_y.BOTTOM_RIGHT):new Gy(i.left+i.width-B/3,i.top+i.height-x/3),this.bottomLeftBorderDoubleOuterBox=d>0||p>0?Yy(i.left+w/3,i.top+y,d-w/3,p-x/3,_y.BOTTOM_LEFT):new Gy(i.left+w/3,i.top+i.height-x/3),this.topLeftBorderDoubleInnerBox=r>0||n>0?Yy(i.left+2*w/3,i.top+2*b/3,r-2*w/3,n-2*b/3,_y.TOP_LEFT):new Gy(i.left+2*w/3,i.top+2*b/3),this.topRightBorderDoubleInnerBox=r>0||n>0?Yy(i.left+g,i.top+2*b/3,a-2*B/3,l-2*b/3,_y.TOP_RIGHT):new Gy(i.left+i.width-2*B/3,i.top+2*b/3),this.bottomRightBorderDoubleInnerBox=A>0||c>0?Yy(i.left+_,i.top+m,A-2*B/3,c-2*x/3,_y.BOTTOM_RIGHT):new Gy(i.left+i.width-2*B/3,i.top+i.height-2*x/3),this.bottomLeftBorderDoubleInnerBox=d>0||p>0?Yy(i.left+2*w/3,i.top+y,d-2*w/3,p-2*x/3,_y.BOTTOM_LEFT):new Gy(i.left+2*w/3,i.top+i.height-2*x/3),this.topLeftBorderStroke=r>0||n>0?Yy(i.left+w/2,i.top+b/2,r-w/2,n-b/2,_y.TOP_LEFT):new Gy(i.left+w/2,i.top+b/2),this.topRightBorderStroke=r>0||n>0?Yy(i.left+g,i.top+b/2,a-B/2,l-b/2,_y.TOP_RIGHT):new Gy(i.left+i.width-B/2,i.top+b/2),this.bottomRightBorderStroke=A>0||c>0?Yy(i.left+_,i.top+m,A-B/2,c-x/2,_y.BOTTOM_RIGHT):new Gy(i.left+i.width-B/2,i.top+i.height-x/2),this.bottomLeftBorderStroke=d>0||p>0?Yy(i.left+w/2,i.top+y,d-w/2,p-x/2,_y.BOTTOM_LEFT):new Gy(i.left+w/2,i.top+i.height-x/2),this.topLeftBorderBox=r>0||n>0?Yy(i.left,i.top,r,n,_y.TOP_LEFT):new Gy(i.left,i.top),this.topRightBorderBox=a>0||l>0?Yy(i.left+g,i.top,a,l,_y.TOP_RIGHT):new Gy(i.left+i.width,i.top),this.bottomRightBorderBox=A>0||c>0?Yy(i.left+_,i.top+m,A,c,_y.BOTTOM_RIGHT):new Gy(i.left+i.width,i.top+i.height),this.bottomLeftBorderBox=d>0||p>0?Yy(i.left,i.top+y,d,p,_y.BOTTOM_LEFT):new Gy(i.left,i.top+i.height),this.topLeftPaddingBox=r>0||n>0?Yy(i.left+w,i.top+b,Math.max(0,r-w),Math.max(0,n-b),_y.TOP_LEFT):new Gy(i.left+w,i.top+b),this.topRightPaddingBox=a>0||l>0?Yy(i.left+Math.min(g,i.width-B),i.top+b,g>i.width+B?0:Math.max(0,a-B),Math.max(0,l-b),_y.TOP_RIGHT):new Gy(i.left+i.width-B,i.top+b),this.bottomRightPaddingBox=A>0||c>0?Yy(i.left+Math.min(_,i.width-w),i.top+Math.min(m,i.height-x),Math.max(0,A-B),Math.max(0,c-x),_y.BOTTOM_RIGHT):new Gy(i.left+i.width-B,i.top+i.height-x),this.bottomLeftPaddingBox=d>0||p>0?Yy(i.left+w,i.top+Math.min(y,i.height-x),Math.max(0,d-w),Math.max(0,p-x),_y.BOTTOM_LEFT):new Gy(i.left+w,i.top+i.height-x),this.topLeftContentBox=r>0||n>0?Yy(i.left+w+k,i.top+b+P,Math.max(0,r-(w+k)),Math.max(0,n-(b+P)),_y.TOP_LEFT):new Gy(i.left+w+k,i.top+b+P),this.topRightContentBox=a>0||l>0?Yy(i.left+Math.min(g,i.width+w+k),i.top+b+P,g>i.width+w+k?0:a-w+k,l-(b+P),_y.TOP_RIGHT):new Gy(i.left+i.width-(B+C),i.top+b+P),this.bottomRightContentBox=A>0||c>0?Yy(i.left+Math.min(_,i.width-(w+k)),i.top+Math.min(m,i.height+b+P),Math.max(0,A-(B+C)),c-(x+M),_y.BOTTOM_RIGHT):new Gy(i.left+i.width-(B+C),i.top+i.height-(x+M)),this.bottomLeftContentBox=d>0||p>0?Yy(i.left+w+k,i.top+y,Math.max(0,d-(w+k)),p-(x+M),_y.BOTTOM_LEFT):new Gy(i.left+w+k,i.top+i.height-(x+M))};!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(_y||(_y={}));var Yy=function(e,t,i,s,r){var n=(Math.sqrt(2)-1)/3*4,o=i*n,a=s*n,l=e+i,u=t+s;switch(r){case _y.TOP_LEFT:return new Wy(new Gy(e,u),new Gy(e,u-a),new Gy(l-o,t),new Gy(l,t));case _y.TOP_RIGHT:return new Wy(new Gy(e,t),new Gy(e+o,t),new Gy(l,u-a),new Gy(l,u));case _y.BOTTOM_RIGHT:return new Wy(new Gy(l,t),new Gy(l,t+a),new Gy(e+o,u),new Gy(e,u));case _y.BOTTOM_LEFT:default:return new Wy(new Gy(l,u),new Gy(l-o,u),new Gy(e,t+a),new Gy(e,t))}},Jy=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Zy=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},qy=function(e,t,i){this.offsetX=e,this.offsetY=t,this.matrix=i,this.type=0,this.target=6},$y=function(e,t){this.path=e,this.target=t,this.type=1},eb=function(e){this.opacity=e,this.type=2,this.target=6},tb=function(e){return 1===e.type},ib=function(e,t){return e.length===t.length&&e.some((function(e,i){return e===t[i]}))},sb=function(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},rb=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Xy(this.container),this.container.styles.opacity<1&&this.effects.push(new eb(this.container.styles.opacity)),null!==this.container.styles.transform){var i=this.container.bounds.left+this.container.styles.transformOrigin[0].number,s=this.container.bounds.top+this.container.styles.transformOrigin[1].number,r=this.container.styles.transform;this.effects.push(new qy(i,s,r))}if(0!==this.container.styles.overflowX){var n=Jy(this.curves),o=Zy(this.curves);ib(n,o)?this.effects.push(new $y(n,6)):(this.effects.push(new $y(n,2)),this.effects.push(new $y(o,4)))}}return e.prototype.getEffects=function(e){for(var t=-1===[2,3].indexOf(this.container.styles.position),i=this.parent,s=this.effects.slice(0);i;){var r=i.effects.filter((function(e){return!tb(e)}));if(t||0!==i.container.styles.position||!i.parent){if(s.unshift.apply(s,r),t=-1===[2,3].indexOf(i.container.styles.position),0!==i.container.styles.overflowX){var n=Jy(i.curves),o=Zy(i.curves);ib(n,o)||s.unshift(new $y(o,6))}}else s.unshift.apply(s,r);i=i.parent}return s.filter((function(t){return ym(t.target,e)}))},e}(),nb=function(e,t,i,s){e.container.elements.forEach((function(r){var n=ym(r.flags,4),o=ym(r.flags,2),a=new rb(r,e);ym(r.styles.display,2048)&&s.push(a);var l=ym(r.flags,8)?[]:s;if(n||o){var u=n||r.styles.isPositioned()?i:t,A=new sb(a);if(r.styles.isPositioned()||r.styles.opacity<1||r.styles.isTransformed()){var c=r.styles.zIndex.order;if(c<0){var h=0;u.negativeZIndex.some((function(e,t){return c>e.element.container.styles.zIndex.order?(h=t,!1):h>0})),u.negativeZIndex.splice(h,0,A)}else if(c>0){var d=0;u.positiveZIndex.some((function(e,t){return c>=e.element.container.styles.zIndex.order?(d=t+1,!1):d>0})),u.positiveZIndex.splice(d,0,A)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(A)}else r.styles.isFloating()?u.nonPositionedFloats.push(A):u.nonPositionedInlineLevel.push(A);nb(a,A,n?A:i,l)}else r.styles.isInlineLevel()?t.inlineLevel.push(a):t.nonInlineLevel.push(a),nb(a,t,i,l);ym(r.flags,8)&&ob(r,l)}))},ob=function(e,t){for(var i=e instanceof b_?e.start:1,s=e instanceof b_&&e.reversed,r=0;r<t.length;r++){var n=t[r];n.container instanceof y_&&"number"==typeof n.container.value&&0!==n.container.value&&(i=n.container.value),n.listValue=vy(i,n.container.styles.listStyleType,!0),i+=s?-1:1}},ab=function(e,t){switch(t){case 0:return ub(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return ub(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return ub(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return ub(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},lb=function(e,t){var i=[];return Ky(e)?i.push(e.subdivide(.5,!1)):i.push(e),Ky(t)?i.push(t.subdivide(.5,!0)):i.push(t),i},ub=function(e,t,i,s){var r=[];return Ky(e)?r.push(e.subdivide(.5,!1)):r.push(e),Ky(i)?r.push(i.subdivide(.5,!0)):r.push(i),Ky(s)?r.push(s.subdivide(.5,!0).reverse()):r.push(s),Ky(t)?r.push(t.subdivide(.5,!1).reverse()):r.push(t),r},Ab=function(e){var t=e.bounds,i=e.styles;return t.add(i.borderLeftWidth,i.borderTopWidth,-(i.borderRightWidth+i.borderLeftWidth),-(i.borderTopWidth+i.borderBottomWidth))},cb=function(e){var t=e.styles,i=e.bounds,s=vv(t.paddingLeft,i.width),r=vv(t.paddingRight,i.width),n=vv(t.paddingTop,i.width),o=vv(t.paddingBottom,i.width);return i.add(s+t.borderLeftWidth,n+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+s+r),-(t.borderTopWidth+t.borderBottomWidth+n+o))},hb=function(e,t,i){var s=function(e,t){return 0===e?t.bounds:2===e?cb(t):Ab(t)}(vb(e.styles.backgroundOrigin,t),e),r=function(e,t){return 0===e?t.bounds:2===e?cb(t):Ab(t)}(vb(e.styles.backgroundClip,t),e),n=fb(vb(e.styles.backgroundSize,t),i,s),o=n[0],a=n[1],l=fv(vb(e.styles.backgroundPosition,t),s.width-o,s.height-a);return[gb(vb(e.styles.backgroundRepeat,t),l,n,s,r),Math.round(s.left+l[0]),Math.round(s.top+l[1]),o,a]},db=function(e){return iv(e)&&e.value===qv.AUTO},pb=function(e){return"number"==typeof e},fb=function(e,t,i){var s=t[0],r=t[1],n=t[2],o=e[0],a=e[1];if(!o)return[0,0];if(Av(o)&&a&&Av(a))return[vv(o,i.width),vv(a,i.height)];var l=pb(n);if(iv(o)&&(o.value===qv.CONTAIN||o.value===qv.COVER))return pb(n)?i.width/i.height<n!=(o.value===qv.COVER)?[i.width,i.width/n]:[i.height*n,i.height]:[i.width,i.height];var u=pb(s),A=pb(r),c=u||A;if(db(o)&&(!a||db(a)))return u&&A?[s,r]:l||c?c&&l?[u?s:r*n,A?r:s/n]:[u?s:i.width,A?r:i.height]:[i.width,i.height];if(l){var h=0,d=0;return Av(o)?h=vv(o,i.width):Av(a)&&(d=vv(a,i.height)),db(o)?h=d*n:a&&!db(a)||(d=h/n),[h,d]}var p=null,f=null;if(Av(o)?p=vv(o,i.width):a&&Av(a)&&(f=vv(a,i.height)),null===p||a&&!db(a)||(f=u&&A?p/s*r:i.height),null!==f&&db(o)&&(p=u&&A?f/r*s:i.width),null!==p&&null!==f)return[p,f];throw new Error("Unable to calculate background-size for element")},vb=function(e,t){var i=e[t];return void 0===i?e[0]:i},gb=function(e,t,i,s,r){var n=t[0],o=t[1],a=i[0],l=i[1];switch(e){case 2:return[new Gy(Math.round(s.left),Math.round(s.top+o)),new Gy(Math.round(s.left+s.width),Math.round(s.top+o)),new Gy(Math.round(s.left+s.width),Math.round(l+s.top+o)),new Gy(Math.round(s.left),Math.round(l+s.top+o))];case 3:return[new Gy(Math.round(s.left+n),Math.round(s.top)),new Gy(Math.round(s.left+n+a),Math.round(s.top)),new Gy(Math.round(s.left+n+a),Math.round(s.height+s.top)),new Gy(Math.round(s.left+n),Math.round(s.height+s.top))];case 1:return[new Gy(Math.round(s.left+n),Math.round(s.top+o)),new Gy(Math.round(s.left+n+a),Math.round(s.top+o)),new Gy(Math.round(s.left+n+a),Math.round(s.top+o+l)),new Gy(Math.round(s.left+n),Math.round(s.top+o+l))];default:return[new Gy(Math.round(r.left),Math.round(r.top)),new Gy(Math.round(r.left+r.width),Math.round(r.top)),new Gy(Math.round(r.left+r.width),Math.round(r.height+r.top)),new Gy(Math.round(r.left),Math.round(r.height+r.top))]}},mb="Hidden Text",_b=function(){function e(e){this._data={},this._document=e}return e.prototype.parseMetrics=function(e,t){var i=this._document.createElement("div"),s=this._document.createElement("img"),r=this._document.createElement("span"),n=this._document.body;i.style.visibility="hidden",i.style.fontFamily=e,i.style.fontSize=t,i.style.margin="0",i.style.padding="0",i.style.whiteSpace="nowrap",n.appendChild(i),s.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",s.width=1,s.height=1,s.style.margin="0",s.style.padding="0",s.style.verticalAlign="baseline",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.appendChild(this._document.createTextNode(mb)),i.appendChild(r),i.appendChild(s);var o=s.offsetTop-r.offsetTop+2;i.removeChild(r),i.appendChild(this._document.createTextNode(mb)),i.style.lineHeight="normal",s.style.verticalAlign="super";var a=s.offsetTop-i.offsetTop+2;return n.removeChild(i),{baseline:o,middle:a}},e.prototype.getMetrics=function(e,t){var i=e+" "+t;return void 0===this._data[i]&&(this._data[i]=this.parseMetrics(e,t)),this._data[i]},e}(),yb=function(e,t){this.context=e,this.options=t},bb=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s._activeEffects=[],s.canvas=i.canvas?i.canvas:document.createElement("canvas"),s.ctx=s.canvas.getContext("2d"),i.canvas||(s.canvas.width=Math.floor(i.width*i.scale),s.canvas.height=Math.floor(i.height*i.scale),s.canvas.style.width=i.width+"px",s.canvas.style.height=i.height+"px"),s.fontMetrics=new _b(document),s.ctx.scale(s.options.scale,s.options.scale),s.ctx.translate(-i.x,-i.y),s.ctx.textBaseline="bottom",s._activeEffects=[],s.context.logger.debug("Canvas renderer initialized ("+i.width+"x"+i.height+") with scale "+i.scale),s}return cp(t,e),t.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach((function(e){return t.applyEffect(e)}))},t.prototype.applyEffect=function(e){this.ctx.save(),function(e){return 2===e.type}(e)&&(this.ctx.globalAlpha=e.opacity),function(e){return 0===e.type}(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),tb(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},t.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},t.prototype.renderStack=function(e){return dp(this,void 0,void 0,(function(){return pp(this,(function(t){switch(t.label){case 0:return e.element.container.styles.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.renderNode=function(e){return dp(this,void 0,void 0,(function(){return pp(this,(function(t){switch(t.label){case 0:return ym(e.container.flags,16),e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},t.prototype.renderTextWithLetterSpacing=function(e,t,i){var s=this;0===t?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+i):u_(e.text).reduce((function(t,r){return s.ctx.fillText(r,t,e.bounds.top+i),t+s.ctx.measureText(r).width}),e.bounds.left)},t.prototype.createFontStyle=function(e){var t=e.fontVariant.filter((function(e){return"normal"===e||"small-caps"===e})).join(""),i=Cb(e.fontFamily).join(", "),s=ev(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,s,i].join(" "),i,s]},t.prototype.renderTextNode=function(e,t){return dp(this,void 0,void 0,(function(){var i,s,r,n,o,a,l,u,A=this;return pp(this,(function(c){return i=this.createFontStyle(t),s=i[0],r=i[1],n=i[2],this.ctx.font=s,this.ctx.direction=1===t.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",o=this.fontMetrics.getMetrics(r,n),a=o.baseline,l=o.middle,u=t.paintOrder,e.textBounds.forEach((function(e){u.forEach((function(i){switch(i){case 0:A.ctx.fillStyle=Pv(t.color),A.renderTextWithLetterSpacing(e,t.letterSpacing,a);var s=t.textShadow;s.length&&e.text.trim().length&&(s.slice(0).reverse().forEach((function(i){A.ctx.shadowColor=Pv(i.color),A.ctx.shadowOffsetX=i.offsetX.number*A.options.scale,A.ctx.shadowOffsetY=i.offsetY.number*A.options.scale,A.ctx.shadowBlur=i.blur.number,A.renderTextWithLetterSpacing(e,t.letterSpacing,a)})),A.ctx.shadowColor="",A.ctx.shadowOffsetX=0,A.ctx.shadowOffsetY=0,A.ctx.shadowBlur=0),t.textDecorationLine.length&&(A.ctx.fillStyle=Pv(t.textDecorationColor||t.color),t.textDecorationLine.forEach((function(t){switch(t){case 1:A.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top+a),e.bounds.width,1);break;case 2:A.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1);break;case 3:A.ctx.fillRect(e.bounds.left,Math.ceil(e.bounds.top+l),e.bounds.width,1)}})));break;case 1:t.webkitTextStrokeWidth&&e.text.trim().length&&(A.ctx.strokeStyle=Pv(t.webkitTextStrokeColor),A.ctx.lineWidth=t.webkitTextStrokeWidth,A.ctx.lineJoin=window.chrome?"miter":"round",A.ctx.strokeText(e.text,e.bounds.left,e.bounds.top+a)),A.ctx.strokeStyle="",A.ctx.lineWidth=0,A.ctx.lineJoin="miter"}}))})),[2]}))}))},t.prototype.renderReplacedElement=function(e,t,i){if(i&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var s=cb(e),r=Zy(t);this.path(r),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(i,0,0,e.intrinsicWidth,e.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(e){return dp(this,void 0,void 0,(function(){var i,s,r,n,o,a,l,u,A,c,h,d,p,f,v,g,m,_;return pp(this,(function(y){switch(y.label){case 0:this.applyEffects(e.getEffects(4)),i=e.container,s=e.curves,r=i.styles,n=0,o=i.textNodes,y.label=1;case 1:return n<o.length?(a=o[n],[4,this.renderTextNode(a,r)]):[3,4];case 2:y.sent(),y.label=3;case 3:return n++,[3,1];case 4:if(!(i instanceof g_))return[3,8];y.label=5;case 5:return y.trys.push([5,7,,8]),[4,this.context.cache.match(i.src)];case 6:return v=y.sent(),this.renderReplacedElement(i,s,v),[3,8];case 7:return y.sent(),this.context.logger.error("Error loading image "+i.src),[3,8];case 8:if(i instanceof m_&&this.renderReplacedElement(i,s,i.canvas),!(i instanceof __))return[3,12];y.label=9;case 9:return y.trys.push([9,11,,12]),[4,this.context.cache.match(i.svg)];case 10:return v=y.sent(),this.renderReplacedElement(i,s,v),[3,12];case 11:return y.sent(),this.context.logger.error("Error loading svg "+i.svg.substring(0,255)),[3,12];case 12:return i instanceof D_&&i.tree?[4,new t(this.context,{scale:this.options.scale,backgroundColor:i.backgroundColor,x:0,y:0,width:i.width,height:i.height}).render(i.tree)]:[3,14];case 13:l=y.sent(),i.width&&i.height&&this.ctx.drawImage(l,0,0,i.width,i.height,i.bounds.left,i.bounds.top,i.bounds.width,i.bounds.height),y.label=14;case 14:if(i instanceof k_&&(u=Math.min(i.bounds.width,i.bounds.height),i.type===w_?i.checked&&(this.ctx.save(),this.path([new Gy(i.bounds.left+.39363*u,i.bounds.top+.79*u),new Gy(i.bounds.left+.16*u,i.bounds.top+.5549*u),new Gy(i.bounds.left+.27347*u,i.bounds.top+.44071*u),new Gy(i.bounds.left+.39694*u,i.bounds.top+.5649*u),new Gy(i.bounds.left+.72983*u,i.bounds.top+.23*u),new Gy(i.bounds.left+.84*u,i.bounds.top+.34085*u),new Gy(i.bounds.left+.39363*u,i.bounds.top+.79*u)]),this.ctx.fillStyle=Pv(M_),this.ctx.fill(),this.ctx.restore()):i.type===P_&&i.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(i.bounds.left+u/2,i.bounds.top+u/2,u/4,0,2*Math.PI,!0),this.ctx.fillStyle=Pv(M_),this.ctx.fill(),this.ctx.restore())),Bb(i)&&i.value.length){switch(A=this.createFontStyle(r),m=A[0],c=A[1],h=this.fontMetrics.getMetrics(m,c).baseline,this.ctx.font=m,this.ctx.fillStyle=Pv(r.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=wb(i.styles.textAlign),_=cb(i),d=0,i.styles.textAlign){case 1:d+=_.width/2;break;case 2:d+=_.width}p=_.add(d,0,0,-_.height/2+1),this.ctx.save(),this.path([new Gy(_.left,_.top),new Gy(_.left+_.width,_.top),new Gy(_.left+_.width,_.top+_.height),new Gy(_.left,_.top+_.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new o_(i.value,p),r.letterSpacing,h),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ym(i.styles.display,2048))return[3,20];if(null===i.styles.listStyleImage)return[3,19];if(0!==(f=i.styles.listStyleImage).type)return[3,18];v=void 0,g=f.url,y.label=15;case 15:return y.trys.push([15,17,,18]),[4,this.context.cache.match(g)];case 16:return v=y.sent(),this.ctx.drawImage(v,i.bounds.left-(v.width+10),i.bounds.top),[3,18];case 17:return y.sent(),this.context.logger.error("Error loading list-style-image "+g),[3,18];case 18:return[3,20];case 19:e.listValue&&-1!==i.styles.listStyleType&&(m=this.createFontStyle(r)[0],this.ctx.font=m,this.ctx.fillStyle=Pv(r.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",_=new vp(i.bounds.left,i.bounds.top+vv(i.styles.paddingTop,i.bounds.width),i.bounds.width,Ug(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new o_(e.listValue,_),r.letterSpacing,Ug(r.lineHeight,r.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),y.label=20;case 20:return[2]}}))}))},t.prototype.renderStackContent=function(e){return dp(this,void 0,void 0,(function(){var t,i,s,r,n,o,a,l,u,A,c,h,d,p,f;return pp(this,(function(v){switch(v.label){case 0:return ym(e.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:v.sent(),t=0,i=e.negativeZIndex,v.label=2;case 2:return t<i.length?(f=i[t],[4,this.renderStack(f)]):[3,5];case 3:v.sent(),v.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:v.sent(),s=0,r=e.nonInlineLevel,v.label=7;case 7:return s<r.length?(f=r[s],[4,this.renderNode(f)]):[3,10];case 8:v.sent(),v.label=9;case 9:return s++,[3,7];case 10:n=0,o=e.nonPositionedFloats,v.label=11;case 11:return n<o.length?(f=o[n],[4,this.renderStack(f)]):[3,14];case 12:v.sent(),v.label=13;case 13:return n++,[3,11];case 14:a=0,l=e.nonPositionedInlineLevel,v.label=15;case 15:return a<l.length?(f=l[a],[4,this.renderStack(f)]):[3,18];case 16:v.sent(),v.label=17;case 17:return a++,[3,15];case 18:u=0,A=e.inlineLevel,v.label=19;case 19:return u<A.length?(f=A[u],[4,this.renderNode(f)]):[3,22];case 20:v.sent(),v.label=21;case 21:return u++,[3,19];case 22:c=0,h=e.zeroOrAutoZIndexOrTransformedOrOpacity,v.label=23;case 23:return c<h.length?(f=h[c],[4,this.renderStack(f)]):[3,26];case 24:v.sent(),v.label=25;case 25:return c++,[3,23];case 26:d=0,p=e.positiveZIndex,v.label=27;case 27:return d<p.length?(f=p[d],[4,this.renderStack(f)]):[3,30];case 28:v.sent(),v.label=29;case 29:return d++,[3,27];case 30:return[2]}}))}))},t.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},t.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},t.prototype.formatPath=function(e){var t=this;e.forEach((function(e,i){var s=Ky(e)?e.start:e;0===i?t.ctx.moveTo(s.x,s.y):t.ctx.lineTo(s.x,s.y),Ky(e)&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)}))},t.prototype.renderRepeat=function(e,t,i,s){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(i,s),this.ctx.fill(),this.ctx.translate(-i,-s)},t.prototype.resizeImage=function(e,t,i){var s;if(e.width===t&&e.height===i)return e;var r=(null!==(s=this.canvas.ownerDocument)&&void 0!==s?s:document).createElement("canvas");return r.width=Math.max(1,t),r.height=Math.max(1,i),r.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t,i),r},t.prototype.renderBackgroundImage=function(e){return dp(this,void 0,void 0,(function(){var t,i,s,r,n,o;return pp(this,(function(a){switch(a.label){case 0:t=e.styles.backgroundImage.length-1,i=function(i){var r,n,o,a,l,u,A,c,h,d,p,f,v,g,m,_,y,b,B,x,w,P,C,M,k,F,E,D,I,S,T;return pp(this,(function(L){switch(L.label){case 0:if(0!==i.type)return[3,5];r=void 0,n=i.url,L.label=1;case 1:return L.trys.push([1,3,,4]),[4,s.context.cache.match(n)];case 2:return r=L.sent(),[3,4];case 3:return L.sent(),s.context.logger.error("Error loading background-image "+n),[3,4];case 4:return r&&(o=hb(e,t,[r.width,r.height,r.width/r.height]),_=o[0],P=o[1],C=o[2],B=o[3],x=o[4],g=s.ctx.createPattern(s.resizeImage(r,B,x),"repeat"),s.renderRepeat(_,g,P,C)),[3,6];case 5:1===i.type?(a=hb(e,t,[null,null,null]),_=a[0],P=a[1],C=a[2],B=a[3],x=a[4],l=Ov(i.angle,B,x),u=l[0],A=l[1],c=l[2],h=l[3],d=l[4],(p=document.createElement("canvas")).width=B,p.height=x,f=p.getContext("2d"),v=f.createLinearGradient(A,h,c,d),Uv(i.stops,u).forEach((function(e){return v.addColorStop(e.stop,Pv(e.color))})),f.fillStyle=v,f.fillRect(0,0,B,x),B>0&&x>0&&(g=s.ctx.createPattern(p,"repeat"),s.renderRepeat(_,g,P,C))):function(e){return 2===e.type}(i)&&(m=hb(e,t,[null,null,null]),_=m[0],y=m[1],b=m[2],B=m[3],x=m[4],w=0===i.position.length?[dv]:i.position,P=vv(w[0],B),C=vv(w[w.length-1],x),M=function(e,t,i,s,r){var n=0,o=0;switch(e.size){case 0:0===e.shape?n=o=Math.min(Math.abs(t),Math.abs(t-s),Math.abs(i),Math.abs(i-r)):1===e.shape&&(n=Math.min(Math.abs(t),Math.abs(t-s)),o=Math.min(Math.abs(i),Math.abs(i-r)));break;case 2:if(0===e.shape)n=o=Math.min(Qv(t,i),Qv(t,i-r),Qv(t-s,i),Qv(t-s,i-r));else if(1===e.shape){var a=Math.min(Math.abs(i),Math.abs(i-r))/Math.min(Math.abs(t),Math.abs(t-s)),l=Nv(s,r,t,i,!0),u=l[0],A=l[1];o=a*(n=Qv(u-t,(A-i)/a))}break;case 1:0===e.shape?n=o=Math.max(Math.abs(t),Math.abs(t-s),Math.abs(i),Math.abs(i-r)):1===e.shape&&(n=Math.max(Math.abs(t),Math.abs(t-s)),o=Math.max(Math.abs(i),Math.abs(i-r)));break;case 3:if(0===e.shape)n=o=Math.max(Qv(t,i),Qv(t,i-r),Qv(t-s,i),Qv(t-s,i-r));else if(1===e.shape){a=Math.max(Math.abs(i),Math.abs(i-r))/Math.max(Math.abs(t),Math.abs(t-s));var c=Nv(s,r,t,i,!1);u=c[0],A=c[1],o=a*(n=Qv(u-t,(A-i)/a))}}return Array.isArray(e.size)&&(n=vv(e.size[0],s),o=2===e.size.length?vv(e.size[1],r):n),[n,o]}(i,P,C,B,x),k=M[0],F=M[1],k>0&&F>0&&(E=s.ctx.createRadialGradient(y+P,b+C,0,y+P,b+C,k),Uv(i.stops,2*k).forEach((function(e){return E.addColorStop(e.stop,Pv(e.color))})),s.path(_),s.ctx.fillStyle=E,k!==F?(D=e.bounds.left+.5*e.bounds.width,I=e.bounds.top+.5*e.bounds.height,T=1/(S=F/k),s.ctx.save(),s.ctx.translate(D,I),s.ctx.transform(1,0,0,S,0,0),s.ctx.translate(-D,-I),s.ctx.fillRect(y,T*(b-I)+I,B,x*T),s.ctx.restore()):s.ctx.fill())),L.label=6;case 6:return t--,[2]}}))},s=this,r=0,n=e.styles.backgroundImage.slice(0).reverse(),a.label=1;case 1:return r<n.length?(o=n[r],[5,i(o)]):[3,4];case 2:a.sent(),a.label=3;case 3:return r++,[3,1];case 4:return[2]}}))}))},t.prototype.renderSolidBorder=function(e,t,i){return dp(this,void 0,void 0,(function(){return pp(this,(function(s){return this.path(ab(i,t)),this.ctx.fillStyle=Pv(e),this.ctx.fill(),[2]}))}))},t.prototype.renderDoubleBorder=function(e,t,i,s){return dp(this,void 0,void 0,(function(){var r,n;return pp(this,(function(o){switch(o.label){case 0:return t<3?[4,this.renderSolidBorder(e,i,s)]:[3,2];case 1:return o.sent(),[2];case 2:return r=function(e,t){switch(t){case 0:return ub(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return ub(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return ub(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return ub(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}}(s,i),this.path(r),this.ctx.fillStyle=Pv(e),this.ctx.fill(),n=function(e,t){switch(t){case 0:return ub(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return ub(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return ub(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return ub(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}}(s,i),this.path(n),this.ctx.fill(),[2]}}))}))},t.prototype.renderNodeBackgroundAndBorders=function(e){return dp(this,void 0,void 0,(function(){var t,i,s,r,n,o,a,l,u=this;return pp(this,(function(A){switch(A.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,i=!wv(t.backgroundColor)||t.backgroundImage.length,s=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],r=xb(vb(t.backgroundClip,0),e.curves),i||t.boxShadow.length?(this.ctx.save(),this.path(r),this.ctx.clip(),wv(t.backgroundColor)||(this.ctx.fillStyle=Pv(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:A.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach((function(t){u.ctx.save();var i,s,r,n,o,a=Jy(e.curves),l=t.inset?0:1e4,A=(i=a,s=-l+(t.inset?1:-1)*t.spread.number,r=(t.inset?1:-1)*t.spread.number,n=t.spread.number*(t.inset?-2:2),o=t.spread.number*(t.inset?-2:2),i.map((function(e,t){switch(t){case 0:return e.add(s,r);case 1:return e.add(s+n,r);case 2:return e.add(s+n,r+o);case 3:return e.add(s,r+o)}return e})));t.inset?(u.path(a),u.ctx.clip(),u.mask(A)):(u.mask(a),u.ctx.clip(),u.path(A)),u.ctx.shadowOffsetX=t.offsetX.number+l,u.ctx.shadowOffsetY=t.offsetY.number,u.ctx.shadowColor=Pv(t.color),u.ctx.shadowBlur=t.blur.number,u.ctx.fillStyle=t.inset?Pv(t.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()})),A.label=2;case 2:n=0,o=0,a=s,A.label=3;case 3:return o<a.length?0!==(l=a[o]).style&&!wv(l.color)&&l.width>0?2!==l.style?[3,5]:[4,this.renderDashedDottedBorder(l.color,l.width,n,e.curves,2)]:[3,11]:[3,13];case 4:return A.sent(),[3,11];case 5:return 3!==l.style?[3,7]:[4,this.renderDashedDottedBorder(l.color,l.width,n,e.curves,3)];case 6:return A.sent(),[3,11];case 7:return 4!==l.style?[3,9]:[4,this.renderDoubleBorder(l.color,l.width,n,e.curves)];case 8:return A.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,n,e.curves)];case 10:A.sent(),A.label=11;case 11:n++,A.label=12;case 12:return o++,[3,3];case 13:return[2]}}))}))},t.prototype.renderDashedDottedBorder=function(e,t,i,s,r){return dp(this,void 0,void 0,(function(){var n,o,a,l,u,A,c,h,d,p,f,v,g,m,_,y;return pp(this,(function(b){return this.ctx.save(),n=function(e,t){switch(t){case 0:return lb(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return lb(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return lb(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return lb(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}}(s,i),o=ab(s,i),2===r&&(this.path(o),this.ctx.clip()),Ky(o[0])?(a=o[0].start.x,l=o[0].start.y):(a=o[0].x,l=o[0].y),Ky(o[1])?(u=o[1].end.x,A=o[1].end.y):(u=o[1].x,A=o[1].y),c=0===i||2===i?Math.abs(a-u):Math.abs(l-A),this.ctx.beginPath(),3===r?this.formatPath(n):this.formatPath(o.slice(0,2)),h=t<3?3*t:2*t,d=t<3?2*t:t,3===r&&(h=t,d=t),p=!0,c<=2*h?p=!1:c<=2*h+d?(h*=f=c/(2*h+d),d*=f):(v=Math.floor((c+d)/(h+d)),g=(c-v*h)/(v-1),d=(m=(c-(v+1)*h)/v)<=0||Math.abs(d-g)<Math.abs(d-m)?g:m),p&&(3===r?this.ctx.setLineDash([0,h+d]):this.ctx.setLineDash([h,d])),3===r?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=2*t+1.1,this.ctx.strokeStyle=Pv(e),this.ctx.stroke(),this.ctx.setLineDash([]),2===r&&(Ky(o[0])&&(_=o[3],y=o[0],this.ctx.beginPath(),this.formatPath([new Gy(_.end.x,_.end.y),new Gy(y.start.x,y.start.y)]),this.ctx.stroke()),Ky(o[1])&&(_=o[1],y=o[2],this.ctx.beginPath(),this.formatPath([new Gy(_.end.x,_.end.y),new Gy(y.start.x,y.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]}))}))},t.prototype.render=function(e){return dp(this,void 0,void 0,(function(){var t;return pp(this,(function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Pv(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),s=new rb(e,null),r=new sb(s),nb(s,r,r,n=[]),ob(s.container,n),t=r,[4,this.renderStack(t)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}var s,r,n}))}))},t}(yb),Bb=function(e){return e instanceof E_||(e instanceof F_||e instanceof k_&&e.type!==P_&&e.type!==w_)},xb=function(e,t){switch(e){case 0:return Jy(t);case 2:return function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]}(t);default:return Zy(t)}},wb=function(e){switch(e){case 1:return"center";case 2:return"right";default:return"left"}},Pb=["-apple-system","system-ui"],Cb=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter((function(e){return-1===Pb.indexOf(e)})):e},Mb=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.canvas=i.canvas?i.canvas:document.createElement("canvas"),s.ctx=s.canvas.getContext("2d"),s.options=i,s.canvas.width=Math.floor(i.width*i.scale),s.canvas.height=Math.floor(i.height*i.scale),s.canvas.style.width=i.width+"px",s.canvas.style.height=i.height+"px",s.ctx.scale(s.options.scale,s.options.scale),s.ctx.translate(-i.x,-i.y),s.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+i.width+"x"+i.height+" at "+i.x+","+i.y+") with scale "+i.scale),s}return cp(t,e),t.prototype.render=function(e){return dp(this,void 0,void 0,(function(){var t,i;return pp(this,(function(s){switch(s.label){case 0:return t=s_(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,kb(t)];case 1:return i=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Pv(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}}))}))},t}(yb),kb=function(e){return new Promise((function(t,i){var s=new Image;s.onload=function(){t(s)},s.onerror=i,s.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))}))},Fb=function(){function e(e){var t=e.id,i=e.enabled;this.id=t,this.enabled=i,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,fp([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,fp([this.id,this.getTime()+"ms"],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,fp([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,fp([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.instances={},e}(),Eb=function(){function e(t,i){var s;this.windowBounds=i,this.instanceName="#"+e.instanceCount++,this.logger=new Fb({id:this.instanceName,enabled:t.logging}),this.cache=null!==(s=t.cache)&&void 0!==s?s:new Ly(this,t)}return e.instanceCount=1,e}(),Db=function(e,t){return void 0===t&&(t={}),Ib(e,t)};"undefined"!=typeof window&&Ty.setContext(window);var Ib=function(e,t){return dp(void 0,void 0,void 0,(function(){var i,s,r,n,o,a,l,u,A,c,h,d,p,f,v,g,m,_,y,B,x,w,P,C,M,k,F,E,D,I,S,T,L,R,U,O,Q,N;return pp(this,(function(V){switch(V.label){case 0:if(!e||"object"!==b(e))return[2,Promise.reject("Invalid element provided as first argument")];if(!(i=e.ownerDocument))throw new Error("Element is not attached to a Document");if(!(s=i.defaultView))throw new Error("Document is not attached to a Window");return r={allowTaint:null!==(w=t.allowTaint)&&void 0!==w&&w,imageTimeout:null!==(P=t.imageTimeout)&&void 0!==P?P:15e3,proxy:t.proxy,useCORS:null!==(C=t.useCORS)&&void 0!==C&&C},n=hp({logging:null===(M=t.logging)||void 0===M||M,cache:t.cache},r),o={windowWidth:null!==(k=t.windowWidth)&&void 0!==k?k:s.innerWidth,windowHeight:null!==(F=t.windowHeight)&&void 0!==F?F:s.innerHeight,scrollX:null!==(E=t.scrollX)&&void 0!==E?E:s.pageXOffset,scrollY:null!==(D=t.scrollY)&&void 0!==D?D:s.pageYOffset},a=new vp(o.scrollX,o.scrollY,o.windowWidth,o.windowHeight),l=new Eb(n,a),u=null!==(I=t.foreignObjectRendering)&&void 0!==I&&I,A={allowTaint:null!==(S=t.allowTaint)&&void 0!==S&&S,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:u,copyStyles:u},l.logger.debug("Starting document clone with size "+a.width+"x"+a.height+" scrolled to "+-a.left+","+-a.top),c=new my(l,e,A),(h=c.clonedReferenceElement)?[4,c.toIFrame(i,a)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return d=V.sent(),p=W_(h)||function(e){return"HTML"===e.tagName}(h)?function(e){var t=e.body,i=e.documentElement;if(!t||!i)throw new Error("Unable to get document size");var s=Math.max(Math.max(t.scrollWidth,i.scrollWidth),Math.max(t.offsetWidth,i.offsetWidth),Math.max(t.clientWidth,i.clientWidth)),r=Math.max(Math.max(t.scrollHeight,i.scrollHeight),Math.max(t.offsetHeight,i.offsetHeight),Math.max(t.clientHeight,i.clientHeight));return new vp(0,0,s,r)}(h.ownerDocument):gp(l,h),f=p.width,v=p.height,g=p.left,m=p.top,_=Sb(l,h,t.backgroundColor),y={canvas:t.canvas,backgroundColor:_,scale:null!==(L=null!==(T=t.scale)&&void 0!==T?T:s.devicePixelRatio)&&void 0!==L?L:1,x:(null!==(R=t.x)&&void 0!==R?R:0)+g,y:(null!==(U=t.y)&&void 0!==U?U:0)+m,width:null!==(O=t.width)&&void 0!==O?O:Math.ceil(f),height:null!==(Q=t.height)&&void 0!==Q?Q:Math.ceil(v)},u?(l.logger.debug("Document cloned, using foreign object rendering"),[4,new Mb(l,y).render(h)]):[3,3];case 2:return B=V.sent(),[3,5];case 3:return l.logger.debug("Document cloned, element located at "+g+","+m+" with size "+f+"x"+v+" using computed rendering"),l.logger.debug("Starting DOM parsing"),x=L_(l,h),_===x.styles.backgroundColor&&(x.styles.backgroundColor=Sv.TRANSPARENT),l.logger.debug("Starting renderer for element at "+y.x+","+y.y+" with size "+y.width+"x"+y.height),[4,new bb(l,y).render(x)];case 4:B=V.sent(),V.label=5;case 5:return(null===(N=t.removeContainer)||void 0===N||N)&&(my.destroy(d)||l.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),l.logger.debug("Finished rendering"),[2,B]}}))}))},Sb=function(e,t,i){var s=t.ownerDocument,r=s.documentElement?Iv(e,getComputedStyle(s.documentElement).backgroundColor):Sv.TRANSPARENT,n=s.body?Iv(e,getComputedStyle(s.body).backgroundColor):Sv.TRANSPARENT,o="string"==typeof i?Iv(e,i):null===i?Sv.TRANSPARENT:4294967295;return t===s.documentElement?wv(r)?wv(n)?o:n:r:o};function Tb(e,t,i){var s=e.getBoundingClientRect(),r=t.getBoundingClientRect();i[0]+=s.left-r.left,i[1]+=s.top-r.top}var Lb=function(){return w((function e(t){var i=this;B(this,e),this.container=t.viewerElement,this.language="en",this.localeService=t.localeService||new Uh,this.scene=new $i(this,{canvasId:t.canvasId,canvasElement:t.canvasElement,keyboardEventsElement:t.keyboardEventsElement,contextAttr:{preserveDrawingBuffer:!1!==t.preserveDrawingBuffer,premultipliedAlpha:!!t.premultipliedAlpha,antialias:!1!==t.antialias},spinnerElementId:t.spinnerElementId,transparent:!1!==t.transparent,gammaInput:!0,gammaOutput:!1,backgroundColor:t.backgroundColor,backgroundColorFromAmbientLight:t.backgroundColorFromAmbientLight,ticksPerRender:1,ticksPerOcclusionTest:20,units:t.units,scale:t.scale,origin:t.origin,lightIntensity:t.lightIntensity,saoEnabled:t.saoEnabled,alphaDepthMask:!1!==t.alphaDepthMask,entityOffsetsEnabled:!!t.entityOffsetsEnabled,pickSurfacePrecisionEnabled:!!t.pickSurfacePrecisionEnabled,readableGeometryEnabled:!!t.readableGeometryEnabled,logarithmicDepthBufferEnabled:!!t.logarithmicDepthBufferEnabled,pbrEnabled:!!t.pbrEnabled,colorTextureEnabled:!1!==t.colorTextureEnabled,dtxEnabled:!!t.dtxEnabled,edgesEnabled:t.edgesEnabled,markerZOffset:t.markerZOffset,numCachedSectionPlanes:t.numCachedSectionPlanes,lodEnabled:!!t.lodEnabled,resolutionScale:t.resolutionScale,offset:t.offset,worldAxis:t.worldAxis}),this.metaScene=new lp(this,this.scene),this.id=t.id||this.scene.id,this.camera=this.scene.camera,this.cameraFlight=new Yh(this.scene,{duration:.5}),this.cameraControl=new rp(this.scene,{snapRadius:t.snapRadius,doublePickFlyTo:!0}),this.scene.canvas.on("boundary",(function(e){i.cameraControl.updatePivotElement()})),this._plugins=[],this._eventSubs={}}),[{key:"capabilities",get:function(){return this.scene.capabilities}},{key:"on",value:function(e,t){var i=this._eventSubs[e];i||(i=[],this._eventSubs[e]=i),i.push(t)}},{key:"fire",value:function(e,t){var i=this._eventSubs[e];if(i)for(var s=0,r=i.length;s<r;s++)i[s](t)}},{key:"off",value:function(e){}},{key:"log",value:function(e){console.log("[xtctwins viewer ".concat(this.id,"]: ").concat(e))}},{key:"error",value:function(e){console.error("[xtctwins viewer ".concat(this.id,"]: ").concat(e))}},{key:"addPlugin",value:function(e){this._plugins.push(e)}},{key:"removePlugin",value:function(e){for(var t=0,i=this._plugins.length;t<i;t++){var s=this._plugins[t];if(s===e)return s.clear&&s.clear(),void this._plugins.splice(t,1)}}},{key:"sendToPlugins",value:function(e,t){for(var i=0,s=this._plugins.length;i<s;i++){var r=this._plugins[i];r.send&&r.send(e,t)}}},{key:"clear",value:function(){throw'Viewer#clear() no longer implemented - use \'#sendToPlugins("clear") instead'}},{key:"resetView",value:function(){throw"Viewer#resetView() no longer implemented - use CameraMemento & ObjectsMemento classes instead"}},{key:"beginSnapshot",value:function(){this._snapshotBegun||(this.scene._renderer.beginSnapshot(),this._snapshotBegun=!0)}},{key:"getSnapshot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!this._snapshotBegun,i=void 0!==e.width&&void 0!==e.height,s=this.scene.canvas.canvas,r=s.clientWidth,n=s.clientHeight,o=e.width?Math.floor(e.width):s.width,a=e.height?Math.floor(e.height):s.height;i&&(s.width=o,s.height=a),this._snapshotBegun||this.beginSnapshot({width:o,height:a}),e.includeGizmos||this.sendToPlugins("snapshotStarting");for(var l={},u=0,A=this._plugins.length;u<A;u++){var c=this._plugins[u];if(c.getContainerElement){var h=c.getContainerElement();h!==document.body&&(l[h.id]||(l[h.id]=!0,Db(h).then((function(e){document.body.appendChild(e),setTimeout((function(){document.body.removeChild(e)}),200)}))))}}this.scene.fire("rendering",{},!0),this.scene._renderer.renderSnapshot();var d=this.scene._renderer.readSnapshot(e);return i&&(s.width=r,s.height=n,this.scene.glRedraw()),e.includeGizmos||this.sendToPlugins("snapshotFinished"),t&&this.endSnapshot(),d}},{key:"getSnapshotWithPlugins",value:(e=o(r().mark((function e(){var t,i,s,n,o,a,l,u,A,c,h,d,p,f,v,g,m,_,y,b,B,x=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=x.length>0&&void 0!==x[0]?x[0]:{},i=!this._snapshotBegun,s=void 0!==t.width&&void 0!==t.height,n=this.scene.canvas.canvas,o=n.clientWidth,a=n.clientHeight,l=t.width?Math.floor(t.width):n.width,u=t.height?Math.floor(t.height):n.height,s&&(n.width=l,n.height=u),this._snapshotBegun||this.beginSnapshot(),t.includeGizmos||this.sendToPlugins("snapshotStarting"),this.scene._renderer.renderSnapshot(),A=this.scene._renderer.readSnapshotAsCanvas(),s&&(n.width=o,n.height=a,this.scene.glRedraw()),c={},h=[],d=0,p=this._plugins.length;d<p;d++)(f=this._plugins[d]).getContainerElement&&(v=f.getContainerElement())!==document.body&&(c[v.id]||(c[v.id]=!0,h.push(v)));g=0,m=h.length;case 18:if(!(g<m)){e.next=28;break}return _=h[g],y=0==g?A.width/_.clientWidth:1,b=J.vec2([0,0]),Tb(n,_,b),e.next=25,Db(_,{canvas:A,backgroundColor:null,x:b[0],y:b[1],scale:y});case 25:g++,e.next=18;break;case 28:return t.includeGizmos||this.sendToPlugins("snapshotFinished"),i&&this.endSnapshot(),"jpeg"!==(B=t.format||"png")&&"png"!==B&&"bmp"!==B&&(console.error("Unsupported image format: '"+B+"' - supported types are 'jpeg', 'bmp' and 'png' - defaulting to 'png'"),B="png"),t.includeGizmos||this.sendToPlugins("snapshotFinished"),i&&this.endSnapshot(),e.abrupt("return",A.toDataURL("image/".concat(B)));case 35:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"endSnapshot",value:function(){this._snapshotBegun&&(this.scene._renderer.endSnapshot(),this.scene._renderer.render({force:!0}),this._snapshotBegun=!1)}},{key:"destroy",value:function(e){var t=this._plugins.slice();if(t.length>0)for(var i=0,s=t.length;i<s;i++){t[i].destroy()}this.cameraControl.destroy(),this.scene.destroy(e)}}]);var e}();function Rb(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Ub=Boolean("object"!==("undefined"==typeof process?"undefined":b(process))||"[object process]"!==String(process)||process.browser),Ob="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);Ob&&parseFloat(Ob[1]);var Qb="3.4.15";function Nb(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Vb="object"!==("undefined"==typeof process?"undefined":b(process))||"[object process]"!==String(process)||process.browser,Hb="undefined"!=typeof window&&void 0!==window.orientation,jb="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);function Gb(e){return Gb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gb(e)}function zb(e){var t=function(e,t){if("object"!=Gb(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,t||"default");if("object"!=Gb(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Gb(t)?t:String(t)}function Wb(e,t,i){return(t=zb(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}jb&&parseFloat(jb[1]);var Kb=function(){return w((function e(t,i){var s=this;B(this,e),Wb(this,"name",void 0),Wb(this,"workerThread",void 0),Wb(this,"isRunning",!0),Wb(this,"result",void 0),Wb(this,"_resolve",(function(){})),Wb(this,"_reject",(function(){})),this.name=t,this.workerThread=i,this.result=new Promise((function(e,t){s._resolve=e,s._reject=t}))}),[{key:"postMessage",value:function(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}},{key:"done",value:function(e){Nb(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){Nb(this.isRunning),this.isRunning=!1,this._reject(e)}}])}(),Xb=function(){return w((function e(){B(this,e)}),[{key:"terminate",value:function(){}}])}(),Yb=new Map;function Jb(e){Nb(e.source&&!e.url||!e.source&&e.url);var t=Yb.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return Zb((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),Yb.set(e.url,t)),e.source&&(t=Zb(e.source),Yb.set(e.source,t))),Nb(t),t}function Zb(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function qb(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,s=i||new Set;if(e){if($b(e))s.add(e);else if($b(e.buffer))s.add(e.buffer);else if(ArrayBuffer.isView(e));else if(t&&"object"===b(e))for(var r in e)qb(e[r],t,s)}else;return void 0===i?Array.from(s):[]}function $b(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}var eB=function(){},tB=function(){return w((function e(t){B(this,e),Wb(this,"name",void 0),Wb(this,"source",void 0),Wb(this,"url",void 0),Wb(this,"terminated",!1),Wb(this,"worker",void 0),Wb(this,"onMessage",void 0),Wb(this,"onError",void 0),Wb(this,"_loadableURL","");var i=t.name,s=t.source,r=t.url;Nb(s||r),this.name=i,this.source=s,this.url=r,this.onMessage=eB,this.onError=function(e){return console.log(e)},this.worker=Vb?this._createBrowserWorker():this._createNodeWorker()}),[{key:"destroy",value:function(){this.onMessage=eB,this.onError=eB,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}},{key:"postMessage",value:function(e,t){t=t||qb(e),this.worker.postMessage(e,t)}},{key:"_getErrorFromErrorEvent",value:function(e){var t="Failed to load ";return t+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}},{key:"_createBrowserWorker",value:function(){var e=this;this._loadableURL=Jb({source:this.source,url:this.url});var t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=function(t){t.data?e.onMessage(t.data):e.onError(new Error("No data received"))},t.onerror=function(t){e.onError(e._getErrorFromErrorEvent(t)),e.terminated=!0},t.onmessageerror=function(e){return console.error(e)},t}},{key:"_createNodeWorker",value:function(){var e,t=this;if(this.url){var i=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);e=new Xb(i,{eval:!1})}else{if(!this.source)throw new Error("no worker");e=new Xb(this.source,{eval:!0})}return e.on("message",(function(e){t.onMessage(e)})),e.on("error",(function(e){t.onError(e)})),e.on("exit",(function(e){})),e}}],[{key:"isSupported",value:function(){return"undefined"!=typeof Worker&&Vb||void 0!==Xb&&!Vb}}])}(),iB=function(){return w((function e(t){B(this,e),Wb(this,"name","unnamed"),Wb(this,"source",void 0),Wb(this,"url",void 0),Wb(this,"maxConcurrency",1),Wb(this,"maxMobileConcurrency",1),Wb(this,"onDebug",(function(){})),Wb(this,"reuseWorkers",!0),Wb(this,"props",{}),Wb(this,"jobQueue",[]),Wb(this,"idleQueue",[]),Wb(this,"count",0),Wb(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}),[{key:"destroy",value:function(){this.idleQueue.forEach((function(e){return e.destroy()})),this.isDestroyed=!0}},{key:"setProps",value:function(e){this.props=s(s({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}},{key:"startJob",value:(t=o(r().mark((function e(t){var i,s,n,o=this,a=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:function(e,t,i){return e.done(i)},s=a.length>2&&void 0!==a[2]?a[2]:function(e,t){return e.error(t)},n=new Promise((function(e){return o.jobQueue.push({name:t,onMessage:i,onError:s,onStart:e}),o})),this._startQueuedJob(),e.next=6,n;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_startQueuedJob",value:(e=o(r().mark((function e(){var t,i,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.jobQueue.length){e.next=2;break}return e.abrupt("return");case 2:if(t=this._getAvailableWorker()){e.next=5;break}return e.abrupt("return");case 5:if(!(i=this.jobQueue.shift())){e.next=18;break}return this.onDebug({message:"Starting job",name:i.name,workerThread:t,backlog:this.jobQueue.length}),s=new Kb(i.name,t),t.onMessage=function(e){return i.onMessage(s,e.type,e.payload)},t.onError=function(e){return i.onError(s,e)},i.onStart(s),e.prev=12,e.next=15,s.result;case 15:return e.prev=15,this.returnWorkerToQueue(t),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[12,,15,18]])}))),function(){return e.apply(this,arguments)})},{key:"returnWorkerToQueue",value:function(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}},{key:"_getAvailableWorker",value:function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;var e="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new tB({name:e,source:this.source,url:this.url})}return null}},{key:"_getMaxConcurrency",value:function(){return Hb?this.maxMobileConcurrency:this.maxConcurrency}}],[{key:"isSupported",value:function(){return tB.isSupported()}}]);var e,t}(),sB={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:function(){}},rB=function(){function e(t){B(this,e),Wb(this,"props",void 0),Wb(this,"workerPools",new Map),this.props=s({},sB),this.setProps(t),this.workerPools=new Map}return w(e,[{key:"destroy",value:function(){var e,t=l(this.workerPools.values());try{for(t.s();!(e=t.n()).done;){e.value.destroy()}}catch(e){t.e(e)}finally{t.f()}this.workerPools=new Map}},{key:"setProps",value:function(e){this.props=s(s({},this.props),e);var t,i=l(this.workerPools.values());try{for(i.s();!(t=i.n()).done;){t.value.setProps(this._getWorkerPoolProps())}}catch(e){i.e(e)}finally{i.f()}}},{key:"getWorkerPool",value:function(e){var t=e.name,i=e.source,s=e.url,r=this.workerPools.get(t);return r||((r=new iB({name:t,source:i,url:s})).setProps(this._getWorkerPoolProps()),this.workerPools.set(t,r)),r}},{key:"_getWorkerPoolProps",value:function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}],[{key:"isSupported",value:function(){return tB.isSupported()}},{key:"getWorkerFarm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e._workerFarm=e._workerFarm||new e({}),e._workerFarm.setProps(t),e._workerFarm}}])}();Wb(rB,"_workerFarm",void 0);var nB="latest";function oB(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t[e.id]||{},s="".concat(e.id,"-worker.js"),r=i.workerUrl;if(r||"compression"!==e.id||(r=t.workerUrl),"test"===t._workerType&&(r="modules/".concat(e.module,"/dist/").concat(s)),!r){var n=e.version;"latest"===n&&(n=nB);var o=n?"@".concat(n):"";r="https://unpkg.com/@loaders.gl/".concat(e.module).concat(o,"/dist/").concat(s)}return Nb(r),r}function aB(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qb;Nb(e,"no worker provided");var i=e.version;return!(!t||!i)}function lB(e,t){return!!rB.isSupported()&&(!!(Vb||null!=t&&t._nodeWorkers)&&(e.worker&&(null==t?void 0:t.worker)))}function uB(e,t,i,s,r){return AB.apply(this,arguments)}function AB(){return AB=o(r().mark((function e(t,i,s,n,o){var a,l,u,A,c,h;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.id,l=oB(t,s),u=rB.getWorkerFarm(s),A=u.getWorkerPool({name:a,url:l}),s=JSON.parse(JSON.stringify(s)),n=JSON.parse(JSON.stringify(n||{})),e.next=8,A.startJob("process-on-worker",cB.bind(null,o));case 8:return(c=e.sent).postMessage("process",{input:i,options:s,context:n}),e.next=12,c.result;case 12:return h=e.sent,e.next=15,h.result;case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e)}))),AB.apply(this,arguments)}function cB(e,t,i,s){return hB.apply(this,arguments)}function hB(){return(hB=o(r().mark((function e(t,i,s,n){var o,a,l,u,A;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=s,e.next="done"===e.t0?3:"error"===e.t0?5:"process"===e.t0?7:20;break;case 3:return i.done(n),e.abrupt("break",21);case 5:return i.error(new Error(n.error)),e.abrupt("break",21);case 7:return o=n.id,a=n.input,l=n.options,e.prev=8,e.next=11,t(a,l);case 11:u=e.sent,i.postMessage("done",{id:o,result:u}),e.next=19;break;case 15:e.prev=15,e.t1=e.catch(8),A=e.t1 instanceof Error?e.t1.message:"unknown error",i.postMessage("error",{id:o,error:A});case 19:return e.abrupt("break",21);case 20:console.warn("parse-with-worker unknown message ".concat(s));case 21:case"end":return e.stop()}}),e,null,[[8,15]])})))).apply(this,arguments)}function dB(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var s,r=t.map((function(e){return e instanceof ArrayBuffer?new Uint8Array(e):e})),n=r.reduce((function(e,t){return e+t.byteLength}),0),o=new Uint8Array(n),a=0,u=l(r);try{for(u.s();!(s=u.n()).done;){var A=s.value;o.set(A,a),a+=A.byteLength}}catch(e){u.e(e)}finally{u.f()}return o.buffer}function pB(e){return fB.apply(this,arguments)}function fB(){return(fB=o(r().mark((function e(t){var i,s,n,o,a,l,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=[],s=!1,n=!1,e.prev=3,a=E(t);case 5:return e.next=7,a.next();case 7:if(!(s=!(l=e.sent).done)){e.next=13;break}u=l.value,i.push(u);case 10:s=!1,e.next=5;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(3),n=!0,o=e.t0;case 19:if(e.prev=19,e.prev=20,!s||null==a.return){e.next=24;break}return e.next=24,a.return();case 24:if(e.prev=24,!n){e.next=27;break}throw o;case 27:return e.finish(24);case 28:return e.finish(19);case 29:return e.abrupt("return",dB.apply(void 0,i));case 30:case"end":return e.stop()}}),e,null,[[3,15,19,29],[20,,24,28]])})))).apply(this,arguments)}var vB="",gB={};function mB(e){for(var t in gB)if(e.startsWith(t)){var i=gB[t];e=e.replace(t,i)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(vB).concat(e)),e}function _B(e){if((t=e)&&"object"===b(t)&&t.isBuffer)return e;var t;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if("string"==typeof e){var i=e;return(new TextEncoder).encode(i).buffer}if(e&&"object"===b(e)&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function yB(e){var t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}var bB=function(e){return"function"==typeof e},BB=function(e){return null!==e&&"object"===b(e)},xB=function(e){return BB(e)&&e.constructor==={}.constructor},wB=function(e){return e&&"function"==typeof e[Symbol.iterator]},PB=function(e){return e&&"function"==typeof e[Symbol.asyncIterator]},CB=function(e){return"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json},MB=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},kB=function(e){return e&&"object"===b(e)&&e.isBuffer},FB=function(e){return function(e){return"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||BB(e)&&bB(e.tee)&&bB(e.cancel)&&bB(e.getReader)}(e)||function(e){return BB(e)&&bB(e.read)&&bB(e.pipe)&&function(e){return"boolean"==typeof e}(e.readable)}(e)},EB=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,DB=/^([-\w.]+\/[-\w.+]+)/;function IB(e){var t=EB.exec(e);return t?t[1]:""}var SB=/\?.*/;function TB(e){return e.replace(SB,"")}function LB(e){return CB(e)?e.url:MB(e)?e.name||"":"string"==typeof e?e:""}function RB(e){if(CB(e)){var t=e,i=t.headers.get("content-type")||"",s=TB(t.url);return function(e){var t=DB.exec(e);return t?t[1]:e}(i)||IB(s)}return MB(e)?e.type||"":"string"==typeof e?IB(e):""}function UB(e){return CB(e)?e.headers["content-length"]||-1:MB(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}function OB(e){return QB.apply(this,arguments)}function QB(){return(QB=o(r().mark((function e(t){var i,s,n,o,a,l;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!CB(t)){e.next=2;break}return e.abrupt("return",t);case 2:return i={},(s=UB(t))>=0&&(i["content-length"]=String(s)),n=LB(t),(o=RB(t))&&(i["content-type"]=o),e.next=10,GB(t);case 10:return(a=e.sent)&&(i["x-first-bytes"]=a),"string"==typeof t&&(t=(new TextEncoder).encode(t)),l=new Response(t,{headers:i}),Object.defineProperty(l,"url",{value:n}),e.abrupt("return",l);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NB(e){return VB.apply(this,arguments)}function VB(){return(VB=o(r().mark((function e(t){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=5;break}return e.next=3,HB(t);case 3:throw i=e.sent,new Error(i);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function HB(e){return jB.apply(this,arguments)}function jB(){return(jB=o(r().mark((function e(t){var i,s,n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): "),e.prev=1,s=t.headers.get("Content-Type"),n=t.statusText,!s.includes("application/json")){e.next=11;break}return e.t0=n,e.t1=" ",e.next=9,t.text();case 9:e.t2=e.sent,n=e.t0+=e.t1.concat.call(e.t1,e.t2);case 11:i=(i+=n).length>60?"".concat(i.slice(0,60),"..."):i,e.next=17;break;case 15:e.prev=15,e.t3=e.catch(1);case 17:return e.abrupt("return",i);case 18:case"end":return e.stop()}}),e,null,[[1,15]])})))).apply(this,arguments)}function GB(e){return zB.apply(this,arguments)}function zB(){return(zB=o(r().mark((function e(t){var i,s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=5,"string"!=typeof t){e.next=3;break}return e.abrupt("return","data:,".concat(t.slice(0,i)));case 3:if(!(t instanceof Blob)){e.next=8;break}return s=t.slice(0,5),e.next=7,new Promise((function(e){var t=new FileReader;t.onload=function(t){var i;return e(null==t||null===(i=t.target)||void 0===i?void 0:i.result)},t.readAsDataURL(s)}));case 7:return e.abrupt("return",e.sent);case 8:if(!(t instanceof ArrayBuffer)){e.next=12;break}return n=t.slice(0,i),o=WB(n),e.abrupt("return","data:base64,".concat(o));case 12:return e.abrupt("return",null);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function WB(e){for(var t="",i=new Uint8Array(e),s=0;s<i.byteLength;s++)t+=String.fromCharCode(i[s]);return btoa(t)}function KB(e,t){return XB.apply(this,arguments)}function XB(){return(XB=o(r().mark((function e(t,i){var s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=7;break}return t=mB(t),s=i,null!=i&&i.fetch&&"function"!=typeof(null==i?void 0:i.fetch)&&(s=i.fetch),e.next=6,fetch(t,s);case 6:case 9:return e.abrupt("return",e.sent);case 7:return e.next=9,OB(t);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function YB(){return!("object"===("undefined"==typeof process?"undefined":b(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===b(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===b(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":b(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,i=e||t;return!!(i&&i.indexOf("Electron")>=0)}()}var JB={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":b(process))&&process},ZB=JB.window||JB.self||JB.global,qB=JB.process||{},$B="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source";YB();var ex,tx=function(){return w((function e(t,i){B(this,e);var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Wb(this,"storage",void 0),Wb(this,"id",void 0),Wb(this,"config",void 0),this.storage=function(e){try{var t=window[e],i="__storage_test__";return t.setItem(i,i),t.removeItem(i),t}catch(e){return null}}(s),this.id=t,this.config=i,this._loadConfiguration()}),[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}])}();function ix(e,t,i){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>s&&(i=Math.min(i,s/e.width));var n=e.width*i,o=e.height*i,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(n/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(n,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}function sx(e){return"string"==typeof e?ex[e.toUpperCase()]||ex.WHITE:e}function rx(e,t){if(!e)throw new Error(t||"Assertion failed")}function nx(){var e,t,i;if(YB&&"performance"in ZB)e=null==ZB||null===(t=ZB.performance)||void 0===t||null===(i=t.now)||void 0===i?void 0:i.call(t);else if("hrtime"in qB){var s,r=null==qB||null===(s=qB.hrtime)||void 0===s?void 0:s.call(qB);e=1e3*r[0]+r[1]/1e6}else e=Date.now();return e}!function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(ex||(ex={}));var ox={debug:YB&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},ax={enabled:!0,level:0};function lx(){}var ux={},Ax={once:!0},cx=function(){return w((function e(){B(this,e);var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""}).id;Wb(this,"id",void 0),Wb(this,"VERSION",$B),Wb(this,"_startTs",nx()),Wb(this,"_deltaTs",nx()),Wb(this,"_storage",void 0),Wb(this,"userData",{}),Wb(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new tx("__probe-".concat(this.id,"__"),ax),this.timeStamp("".concat(this.id," started")),function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],s=Object.getPrototypeOf(e),r=l(Object.getOwnPropertyNames(s));try{var n=function(){var s=t.value;"function"==typeof e[s]&&(i.find((function(e){return s===e}))||(e[s]=e[s].bind(e)))};for(r.s();!(t=r.n()).done;)n()}catch(e){r.e(e)}finally{r.f()}}(this),Object.seal(this)}),[{key:"level",get:function(){return this.getLevel()},set:function(e){this.setLevel(e)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((nx()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((nx()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(e){this.level=e}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.setConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.setConfiguration({level:e}),this}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.setConfiguration(y({},e,t))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(e,t){rx(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,ox.warn,arguments,Ax)}},{key:"error",value:function(e){return this._getLogFunction(0,e,ox.error,arguments)}},{key:"deprecated",value:function(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}},{key:"removed",value:function(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}},{key:"probe",value:function(e,t){return this._getLogFunction(e,t,ox.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,ox.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),r=2;r<i;r++)s[r-2]=arguments[r];return this._getLogFunction(e,t,ox.debug||ox.info,arguments,Ax)}},{key:"table",value:function(e,t,i){return t?this._getLogFunction(e,t,console.table||lx,i&&[i],{tag:px(t)}):lx}},{key:"image",value:function(e){var t=e.logLevel,i=e.priority,s=e.image,r=e.message,n=void 0===r?"":r,o=e.scale,l=void 0===o?1:o;return this._shouldLog(t||i)?YB?function(e){var t=e.image,i=e.message,s=void 0===i?"":i,r=e.scale,n=void 0===r?1:r;if("string"==typeof t){var o=new Image;return o.onload=function(){var e,t=ix(o,s,n);(e=console).log.apply(e,a(t))},o.src=t,lx}var l=t.nodeName||"";if("img"===l.toLowerCase()){var u;return(u=console).log.apply(u,a(ix(t,s,n))),lx}if("canvas"===l.toLowerCase()){var A=new Image;return A.onload=function(){var e;return(e=console).log.apply(e,a(ix(A,s,n)))},A.src=t.toDataURL(),lx}return lx}({image:s,message:n,scale:l}):(console.warn("removed"),lx):lx}},{key:"time",value:function(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,t){return this._getLogFunction(e,t,console.timeStamp||lx)}},{key:"group",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},s=dx({logLevel:e,message:t,opts:i}),r=i.collapsed;return s.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(s)}},{key:"groupCollapsed",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},i,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||lx)}},{key:"withGroup",value:function(e,t,i){this.group(e,t)();try{i()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=hx(e)}},{key:"_getLogFunction",value:function(e,t,i,s,r){if(this._shouldLog(e)){var n;r=dx({logLevel:e,message:t,args:s,opts:r}),rx(i=i||r.method),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=nx();var o=r.tag||r.message;if(r.once){if(ux[o])return lx;ux[o]=nx()}return t=function(e,t,i){if("string"==typeof t){var s=i.time?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,i=Math.max(t-e.length,0);return"".concat(" ".repeat(i)).concat(e)}((r=i.total)<10?"".concat(r.toFixed(2),"ms"):r<100?"".concat(r.toFixed(1),"ms"):r<1e3?"".concat(r.toFixed(0),"ms"):"".concat((r/1e3).toFixed(2),"s")):"";t=function(e,t,i){return YB||"string"!=typeof e||(t&&(t=sx(t),e="[".concat(t,"m").concat(e,"[39m")),i&&(t=sx(i),e="[".concat(i+10,"m").concat(e,"[49m"))),e}(t=i.time?"".concat(e,": ").concat(s," ").concat(t):"".concat(e,": ").concat(t),i.color,i.background)}var r;return t}(this.id,r.message,r),(n=i).bind.apply(n,[console,t].concat(a(r.args)))}return lx}}])}();function hx(e){if(!e)return 0;var t;switch(b(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return rx(Number.isFinite(t)&&t>=0),t}function dx(e){var t=e.logLevel,i=e.message;e.logLevel=hx(t);for(var s=e.args?Array.from(e.args):[];s.length&&s.shift()!==i;);switch(b(t)){case"string":case"function":void 0!==i&&s.unshift(i),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());var r=b(e.message);return rx("string"===r||"object"===r),Object.assign(e,{args:s},e.opts)}function px(e){for(var t in e)for(var i in e[t])return i||"untitled";return"empty"}Wb(cx,"VERSION",$B);var fx=new cx({id:"loaders.gl"}),vx=function(){return w((function e(){B(this,e)}),[{key:"log",value:function(){return function(){}}},{key:"info",value:function(){return function(){}}},{key:"warn",value:function(){return function(){}}},{key:"error",value:function(){return function(){}}}])}(),gx={fetch:null,mimeType:void 0,nothrow:!1,log:new(function(){return w((function e(){B(this,e),Wb(this,"console",void 0),this.console=console}),[{key:"log",value:function(){for(var e,t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return(e=this.console.log).bind.apply(e,[this.console].concat(i))}},{key:"info",value:function(){for(var e,t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return(e=this.console.info).bind.apply(e,[this.console].concat(i))}},{key:"warn",value:function(){for(var e,t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return(e=this.console.warn).bind.apply(e,[this.console].concat(i))}},{key:"error",value:function(){for(var e,t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return(e=this.console.error).bind.apply(e,[this.console].concat(i))}}])}()),CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Ub,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},mx={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function _x(){globalThis.loaders=globalThis.loaders||{};var e=globalThis.loaders;return e._state=e._state||{},e._state}var yx=function(){var e=_x();return e.globalOptions=e.globalOptions||s({},gx),e.globalOptions};function bx(e,t,i,r){return i=i||[],function(e,t){Bx(e,null,gx,mx,t);var i,s=l(t);try{for(s.s();!(i=s.n()).done;){var r=i.value,n=e&&e[r.id]||{},o=r.options&&r.options[r.id]||{},a=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};Bx(n,r.id,o,a,t)}}catch(e){s.e(e)}finally{s.f()}}(e,i=Array.isArray(i)?i:[i]),function(e,t,i){var r=e.options||{},n=s({},r);(function(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)})(n,i),null===n.log&&(n.log=new vx);return wx(n,yx()),wx(n,t),n}(t,e,r)}function Bx(e,t,i,s,r){var n=t||"Top level",o=t?"".concat(t,"."):"";for(var a in e){var l=!t&&BB(e[a]);if(!(a in i)&&!("baseUri"===a&&!t)&&!("workerUrl"===a&&t))if(a in s)fx.warn("".concat(n," loader option '").concat(o).concat(a,"' no longer supported, use '").concat(s[a],"'"))();else if(!l){var u=xx(a,r);fx.warn("".concat(n," loader option '").concat(o).concat(a,"' not recognized. ").concat(u))()}}}function xx(e,t){var i,s=e.toLowerCase(),r="",n=l(t);try{for(n.s();!(i=n.n()).done;){var o=i.value;for(var a in o.options){if(e===a)return"Did you mean '".concat(o.id,".").concat(a,"'?");var u=a.toLowerCase();(s.startsWith(u)||u.startsWith(s))&&(r=r||"Did you mean '".concat(o.id,".").concat(a,"'?"))}}}catch(e){n.e(e)}finally{n.f()}return r}function wx(e,t){for(var i in t)if(i in t){var r=t[i];xB(r)&&xB(e[i])?e[i]=s(s({},e[i]),t[i]):e[i]=t[i]}}function Px(e){var t;return!!e&&(Array.isArray(e)&&(e=e[0]),Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions))}function Cx(e){var t,i,r;return Rb(e,"null loader"),Rb(Px(e),"invalid loader"),Array.isArray(e)&&(r=e[1],e=s(s({},e=e[0]),{},{options:s(s({},e.options),r)})),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(i=e)&&void 0!==i&&i.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var Mx=function(){var e=_x();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};var kx=new cx({id:"loaders.gl"}),Fx=/\.([^.]+)$/;function Ex(e){return Dx.apply(this,arguments)}function Dx(){return Dx=o(r().mark((function e(t){var i,n,o,a,l=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=l.length>1&&void 0!==l[1]?l[1]:[],n=l.length>2?l[2]:void 0,o=l.length>3?l[3]:void 0,Sx(t)){e.next=5;break}return e.abrupt("return",null);case 5:if(!(a=Ix(t,i,s(s({},n),{},{nothrow:!0}),o))){e.next=8;break}return e.abrupt("return",a);case 8:if(!MB(t)){e.next=13;break}return e.next=11,t.slice(0,10).arrayBuffer();case 11:t=e.sent,a=Ix(t,i,n,o);case 13:if(a||null!=n&&n.nothrow){e.next=15;break}throw new Error(Tx(t));case 15:return e.abrupt("return",a);case 16:case"end":return e.stop()}}),e)}))),Dx.apply(this,arguments)}function Ix(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;if(!Sx(e))return null;if(t&&!Array.isArray(t))return Cx(t);var r,n=[];(t&&(n=n.concat(t)),null!=i&&i.ignoreRegisteredLoaders)||(r=n).push.apply(r,a(Mx()));!function(e){var t,i=l(e);try{for(i.s();!(t=i.n()).done;){Cx(t.value)}}catch(e){i.e(e)}finally{i.f()}}(n);var o=function(e,t,i,s){var r,n=LB(e),o=RB(e),a=TB(n)||(null==s?void 0:s.url),u=null,A="";null!=i&&i.mimeType&&(u=Lx(t,null==i?void 0:i.mimeType),A="match forced by supplied MIME type ".concat(null==i?void 0:i.mimeType));u=u||function(e,t){var i=t&&Fx.exec(t),s=i&&i[1];return s?function(e,t){t=t.toLowerCase();var i,s=l(e);try{for(s.s();!(i=s.n()).done;){var r,n=i.value,o=l(n.extensions);try{for(o.s();!(r=o.n()).done;){if(r.value.toLowerCase()===t)return n}}catch(e){o.e(e)}finally{o.f()}}}catch(e){s.e(e)}finally{s.f()}return null}(e,s):null}(t,a),A=A||(u?"matched url ".concat(a):""),u=u||Lx(t,o),A=A||(u?"matched MIME type ".concat(o):""),u=u||function(e,t){if(!t)return null;var i,s=l(e);try{for(s.s();!(i=s.n()).done;){var r=i.value;if("string"==typeof t){if(Rx(t,r))return r}else if(ArrayBuffer.isView(t)){if(Ux(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer){if(Ux(t,0,r))return r}}}catch(e){s.e(e)}finally{s.f()}return null}(t,e),A=A||(u?"matched initial data ".concat(Ox(e)):""),u=u||Lx(t,null==i?void 0:i.fallbackMimeType),A=A||(u?"matched fallback MIME type ".concat(o):""),A&&kx.log(1,"selectLoader selected ".concat(null===(r=u)||void 0===r?void 0:r.name,": ").concat(A,"."));return u}(e,n,i,s);if(!(o||null!=i&&i.nothrow))throw new Error(Tx(e));return o}function Sx(e){return!(e instanceof Response&&204===e.status)}function Tx(e){var t=LB(e),i=RB(e),s="No valid loader found (";s+=t?"".concat(yB(t),", "):"no url provided, ",s+="MIME type: ".concat(i?'"'.concat(i,'"'):"not provided",", ");var r=e?Ox(e):"";return s+=r?' first bytes: "'.concat(r,'"'):"first bytes: not available",s+=")"}function Lx(e,t){var i,s=l(e);try{for(s.s();!(i=s.n()).done;){var r=i.value;if(r.mimeTypes&&r.mimeTypes.includes(t))return r;if(t==="application/x.".concat(r.id))return r}}catch(e){s.e(e)}finally{s.f()}return null}function Rx(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some((function(t){return e.startsWith(t)}))}function Ux(e,t,i){return(Array.isArray(i.tests)?i.tests:[i.tests]).some((function(s){return function(e,t,i,s){if(s instanceof ArrayBuffer)return function(e,t,i){if(i=i||e.byteLength,e.byteLength<i||t.byteLength<i)return!1;for(var s=new Uint8Array(e),r=new Uint8Array(t),n=0;n<s.length;++n)if(s[n]!==r[n])return!1;return!0}(s,e,s.byteLength);switch(b(s)){case"function":return s(e,i);case"string":return s===Qx(e,t,s.length);default:return!1}}(e,t,i,s)}))}function Ox(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return Qx(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){return Qx(e,0,t)}return""}function Qx(e,t,i){if(e.byteLength<t+i)return"";for(var s=new DataView(e),r="",n=0;n<i;n++)r+=String.fromCharCode(s.getUint8(t+n));return r}var Nx=262144;function Vx(t,i){var s,n,o,a,l;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=(null==i?void 0:i.chunkSize)||Nx,n=0,o=new TextEncoder;case 3:if(!(n<t.length)){e.next=11;break}return a=Math.min(t.length-n,s),l=t.slice(n,n+a),n+=a,e.next=9,o.encode(l);case 9:e.next=3;break;case 11:case"end":return e.stop()}}),e)}var Hx=262144;var jx=1048576;function Gx(){return(Gx=M(r().mark((function e(t,i){var s,n,o,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=(null==i?void 0:i.chunkSize)||jx,n=0;case 2:if(!(n<t.size)){e.next=12;break}return o=n+s,e.next=6,C(t.slice(n,o).arrayBuffer());case 6:return a=e.sent,n=o,e.next=10,a;case 10:e.next=2;break;case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function zx(e,t){return Ub?function(e,t){return Wx.apply(this,arguments)}(e,t):function(e,t){return Kx.apply(this,arguments)}(e)}function Wx(){return(Wx=M(r().mark((function e(t,i){var s,n,o,a,l,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=t.getReader(),e.prev=1;case 2:return o=n||s.read(),null!=i&&i._streamReadAhead&&(n=s.read()),e.next=7,C(o);case 7:if(a=e.sent,l=a.done,u=a.value,!l){e.next=12;break}return e.abrupt("return");case 12:return e.next=14,_B(u);case 14:e.next=2;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(1),s.releaseLock();case 21:case"end":return e.stop()}}),e,null,[[1,18]])})))).apply(this,arguments)}function Kx(){return(Kx=M(r().mark((function e(t,i){var s,n,o,a,l,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=!1,n=!1,e.prev=2,a=E(t);case 4:return e.next=6,C(a.next());case 6:if(!(s=!(l=e.sent).done)){e.next=13;break}return u=l.value,e.next=10,_B(u);case 10:s=!1,e.next=4;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(2),n=!0,o=e.t0;case 19:if(e.prev=19,e.prev=20,!s||null==a.return){e.next=24;break}return e.next=24,C(a.return());case 24:if(e.prev=24,!n){e.next=27;break}throw o;case 27:return e.finish(24);case 28:return e.finish(19);case 29:case"end":return e.stop()}}),e,null,[[2,15,19,29],[20,,24,28]])})))).apply(this,arguments)}function Xx(e,t){if("string"==typeof e)return Vx(e,t);if(e instanceof ArrayBuffer)return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r().mark((function i(){var s,n,o,a,l,u;return r().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:s=t.chunkSize,n=void 0===s?Hx:s,o=0;case 2:if(!(o<e.byteLength)){i.next=13;break}return a=Math.min(e.byteLength-o,n),l=new ArrayBuffer(a),u=new Uint8Array(e,o,a),new Uint8Array(l).set(u),o+=a,i.next=11,l;case 11:i.next=2;break;case 13:case"end":return i.stop()}}),i)}))()}(e,t);if(MB(e))return function(e,t){return Gx.apply(this,arguments)}(e,t);if(FB(e))return zx(e,t);if(CB(e))return zx(e.body,t);throw new Error("makeIterator")}var Yx="Cannot convert supplied data type";function Jx(e,t,i){if(t.text&&"string"==typeof e)return e;if(kB(e)&&(e=e.buffer),e instanceof ArrayBuffer){var s=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(s):s}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);var r=e.buffer,n=e.byteLength||e.length;return 0===e.byteOffset&&n===r.byteLength||(r=r.slice(e.byteOffset,e.byteOffset+n)),r}throw new Error(Yx)}function Zx(e,t,i){return qx.apply(this,arguments)}function qx(){return(qx=o(r().mark((function e(t,i,s){var n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t instanceof ArrayBuffer||ArrayBuffer.isView(t),"string"!=typeof t&&!n){e.next=3;break}return e.abrupt("return",Jx(t,i));case 3:if(!MB(t)){e.next=7;break}return e.next=6,OB(t);case 6:t=e.sent;case 7:if(!CB(t)){e.next=21;break}return o=t,e.next=11,NB(o);case 11:if(!i.binary){e.next=17;break}return e.next=14,o.arrayBuffer();case 14:e.t0=e.sent,e.next=20;break;case 17:return e.next=19,o.text();case 19:e.t0=e.sent;case 20:return e.abrupt("return",e.t0);case 21:if(FB(t)&&(t=Xx(t,s)),!wB(t)&&!PB(t)){e.next=24;break}return e.abrupt("return",pB(t));case 24:throw new Error(Yx);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $x(e,t){var i=yx(),s=e||i;return"function"==typeof s.fetch?s.fetch:BB(s.fetch)?function(e){return KB(e,s)}:null!=t&&t.fetch?null==t?void 0:t.fetch:KB}function ew(e,t,i){if(i)return i;var r,n,o=s({fetch:$x(t,e)},e);if(o.url){var a=TB(o.url);o.baseUrl=a,o.queryString=function(e){var t=e.match(SB);return t&&t[0]}(o.url),o.filename=yB(a),o.baseUrl=(n=(r=a)?r.lastIndexOf("/"):-1)>=0?r.substr(0,n):""}return Array.isArray(o.loaders)||(o.loaders=null),o}function tw(e,t){if(!t&&e&&!Array.isArray(e))return e;var i;if(e&&(i=Array.isArray(e)?e:[e]),t&&t.loaders){var s=Array.isArray(t.loaders)?t.loaders:[t.loaders];i=i?[].concat(a(i),a(s)):s}return i&&i.length?i:null}function iw(e,t,i,s){return sw.apply(this,arguments)}function sw(){return(sw=o(r().mark((function e(t,i,s,n){var o,a,l;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Nb(!n||"object"===b(n)),!i||Array.isArray(i)||Px(i)||(n=void 0,s=i,i=void 0),e.next=4,t;case 4:return t=e.sent,s=s||{},o=LB(t),a=tw(i,n),e.next=11,Ex(t,a,s);case 11:if(l=e.sent){e.next=14;break}return e.abrupt("return",null);case 14:return s=bx(s,l,a,o),n=ew({url:o,parse:iw,loaders:a},s,n||null),e.next=18,rw(l,t,s,n);case 18:return e.abrupt("return",e.sent);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rw(e,t,i,s){return nw.apply(this,arguments)}function nw(){return(nw=o(r().mark((function e(t,i,s,n){var o,a,l,u,A,c,h,d;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return aB(t),CB(i)&&(a=(o=i).ok,l=o.redirected,u=o.status,A=o.statusText,c=o.type,h=o.url,d=Object.fromEntries(o.headers.entries()),n.response={headers:d,ok:a,redirected:l,status:u,statusText:A,type:c,url:h}),e.next=4,Zx(i,t,s);case 4:if(i=e.sent,!t.parseTextSync||"string"!=typeof i){e.next=8;break}return s.dataType="text",e.abrupt("return",t.parseTextSync(i,s,n,t));case 8:if(!lB(t,s)){e.next=12;break}return e.next=11,uB(t,i,s,n,iw);case 11:case 15:case 19:return e.abrupt("return",e.sent);case 12:if(!t.parseText||"string"!=typeof i){e.next=16;break}return e.next=15,t.parseText(i,s,n,t);case 16:if(!t.parse){e.next=20;break}return e.next=19,t.parse(i,s,n,t);case 20:throw Nb(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"));case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ow={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},aw=ow.global||ow.self||ow.window||{},lw="object"!==("undefined"==typeof process?"undefined":b(process))||"[object process]"!==String(process)||process.browser,uw="function"==typeof importScripts,Aw="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);Aw&&parseFloat(Aw[1]);var cw=null,hw=null,dw=Object.freeze({__proto__:null,readFileAsArrayBuffer:null,readFileAsText:null,requireFromFile:cw,requireFromString:hw}),pw="3.4.15",fw={};function vw(e){return gw.apply(this,arguments)}function gw(){return gw=o(r().mark((function e(t){var i,s,n=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.length>2&&void 0!==n[2]?n[2]:{},(i=n.length>1&&void 0!==n[1]?n[1]:null)&&(t=mw(t,i,s)),fw[t]=fw[t]||_w(t),e.next=6,fw[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)}))),gw.apply(this,arguments)}function mw(e,t,i){if(e.startsWith("http"))return e;var s=i.modules||{};return s[e]?s[e]:lw?i.CDN?(function(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}(i.CDN.startsWith("http")),"".concat(i.CDN,"/").concat(t,"@").concat(pw,"/dist/libs/").concat(e)):uw?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function _w(e){return yw.apply(this,arguments)}function yw(){return(yw=o(r().mark((function e(t){var i,s,n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.endsWith("wasm")){e.next=7;break}return e.next=3,fetch(t);case 3:return i=e.sent,e.next=6,i.arrayBuffer();case 6:return e.abrupt("return",e.sent);case 7:if(lw){e.next=20;break}if(e.prev=8,e.t0=dw&&cw,!e.t0){e.next=14;break}return e.next=13,cw(t);case 13:e.t0=e.sent;case 14:return e.abrupt("return",e.t0);case 17:return e.prev=17,e.t1=e.catch(8),e.abrupt("return",null);case 20:if(!uw){e.next=22;break}return e.abrupt("return",importScripts(t));case 22:return e.next=24,fetch(t);case 24:return s=e.sent,e.next=27,s.text();case 27:return n=e.sent,e.abrupt("return",bw(n,t));case 29:case"end":return e.stop()}}),e,null,[[8,17]])})))).apply(this,arguments)}function bw(e,t){if(!lw)return hw;if(uw)return eval.call(aw,e),null;var i=document.createElement("script");i.id=t;try{i.appendChild(document.createTextNode(e))}catch(t){i.text=e}return document.body.appendChild(i),null}var Bw,xw,ww="3.4.15",Pw="https://unpkg.com/@loaders.gl/textures@".concat(ww,"/dist/libs/basis_encoder.wasm"),Cw="https://unpkg.com/@loaders.gl/textures@".concat(ww,"/dist/libs/basis_encoder.js");function Mw(e){return kw.apply(this,arguments)}function kw(){return(kw=o(r().mark((function e(t){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=t.modules||{}).basis){e.next=3;break}return e.abrupt("return",i.basis);case 3:return Bw=Bw||Fw(t),e.next=6,Bw;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fw(e){return Ew.apply(this,arguments)}function Ew(){return(Ew=o(r().mark((function e(t){var i,s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null,s=null,e.t0=Promise,e.next=5,vw("basis_transcoder.js","textures",t);case 5:return e.t1=e.sent,e.next=8,vw("basis_transcoder.wasm","textures",t);case 8:return e.t2=e.sent,e.t3=[e.t1,e.t2],e.next=12,e.t0.all.call(e.t0,e.t3);case 12:return n=e.sent,o=u(n,2),i=o[0],s=o[1],i=i||globalThis.BASIS,e.next=19,Dw(i,s);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Dw(e,t){var i={};return t&&(i.wasmBinary=t),new Promise((function(t){e(i).then((function(e){var i=e.BasisFile;(0,e.initializeBasis)(),t({BasisFile:i})}))}))}function Iw(e){return Sw.apply(this,arguments)}function Sw(){return(Sw=o(r().mark((function e(t){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=t.modules||{}).basisEncoder){e.next=3;break}return e.abrupt("return",i.basisEncoder);case 3:return xw=xw||Tw(t),e.next=6,xw;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tw(e){return Lw.apply(this,arguments)}function Lw(){return(Lw=o(r().mark((function e(t){var i,s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null,s=null,e.t0=Promise,e.next=5,vw(Cw,"textures",t);case 5:return e.t1=e.sent,e.next=8,vw(Pw,"textures",t);case 8:return e.t2=e.sent,e.t3=[e.t1,e.t2],e.next=12,e.t0.all.call(e.t0,e.t3);case 12:return n=e.sent,o=u(n,2),i=o[0],s=o[1],i=i||globalThis.BASIS,e.next=19,Rw(i,s);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rw(e,t){var i={};return t&&(i.wasmBinary=t),new Promise((function(t){e(i).then((function(e){var i=e.BasisFile,s=e.KTX2File,r=e.initializeBasis,n=e.BasisEncoder;r(),t({BasisFile:i,KTX2File:s,BasisEncoder:n})}))}))}var Uw,Ow,Qw,Nw,Vw,Hw,jw,Gw,zw,Ww=33776,Kw=33779,Xw=35840,Yw=35842,Jw=36196,Zw=37808,qw=["","WEBKIT_","MOZ_"],$w={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},eP=null;function tP(e){if(!eP){e=e||function(){try{return document.createElement("canvas").getContext("webgl")}catch(e){return null}}()||void 0,eP=new Set;var t,i=l(qw);try{for(i.s();!(t=i.n()).done;){var s=t.value;for(var r in $w)if(e&&e.getExtension("".concat(s).concat(r))){var n=$w[r];eP.add(n)}}}catch(e){i.e(e)}finally{i.f()}}return eP}(zw=Uw||(Uw={}))[zw.NONE=0]="NONE",zw[zw.BASISLZ=1]="BASISLZ",zw[zw.ZSTD=2]="ZSTD",zw[zw.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(Ow||(Ow={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(Qw||(Qw={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(Nw||(Nw={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(Vw||(Vw={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(Hw||(Hw={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(jw||(jw={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(Gw||(Gw={}));var iP=[171,75,84,88,32,50,48,187,13,10,26,10];function sP(e){var t=new Uint8Array(e);return!(t.byteLength<iP.length||t[0]!==iP[0]||t[1]!==iP[1]||t[2]!==iP[2]||t[3]!==iP[3]||t[4]!==iP[4]||t[5]!==iP[5]||t[6]!==iP[6]||t[7]!==iP[7]||t[8]!==iP[8]||t[9]!==iP[9]||t[10]!==iP[10]||t[11]!==iP[11])}var rP={etc1:{basisFormat:0,compressed:!0,format:Jw},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Ww},bc3:{basisFormat:3,compressed:!0,format:Kw},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:Xw},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Yw},"astc-4x4":{basisFormat:10,compressed:!0,format:Zw},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function nP(){return(nP=o(r().mark((function e(t,i){var s,n,o,a,l,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("auto"!==i.basis.containerFormat){e.next=11;break}if(!sP(t)){e.next=6;break}return e.next=4,Iw(i);case 4:return s=e.sent,e.abrupt("return",lP(s.KTX2File,t,i));case 6:return e.next=8,Mw(i);case 8:return n=e.sent,o=n.BasisFile,e.abrupt("return",oP(o,t,i));case 11:e.t0=i.basis.module,e.next="encoder"===e.t0?14:(e.t0,22);break;case 14:return e.next=16,Iw(i);case 16:a=e.sent,e.t1=i.basis.containerFormat,e.next="ktx2"===e.t1?20:(e.t1,21);break;case 20:return e.abrupt("return",lP(a.KTX2File,t,i));case 21:return e.abrupt("return",oP(a.BasisFile,t,i));case 22:return e.next=24,Mw(i);case 24:return l=e.sent,u=l.BasisFile,e.abrupt("return",oP(u,t,i));case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oP(e,t,i){var s=new e(new Uint8Array(t));try{if(!s.startTranscoding())throw new Error("Failed to start basis transcoding");for(var r=s.getNumImages(),n=[],o=0;o<r;o++){for(var a=s.getNumLevels(o),l=[],u=0;u<a;u++)l.push(aP(s,o,u,i));n.push(l)}return n}finally{s.close(),s.delete()}}function aP(e,t,i,s){var r=e.getImageWidth(t,i),n=e.getImageHeight(t,i),o=e.getHasAlpha(),a=AP(s,o),l=a.compressed,u=a.format,A=a.basisFormat,c=e.getImageTranscodedSizeInBytes(t,i,A),h=new Uint8Array(c);if(!e.transcodeImage(h,t,i,A,0,0))throw new Error("failed to start Basis transcoding");return{width:r,height:n,data:h,compressed:l,format:u,hasAlpha:o}}function lP(e,t,i){var s=new e(new Uint8Array(t));try{if(!s.startTranscoding())throw new Error("failed to start KTX2 transcoding");for(var r=s.getLevels(),n=[],o=0;o<r;o++){n.push(uP(s,o,i));break}return[n]}finally{s.close(),s.delete()}}function uP(e,t,i){var s=e.getImageLevelInfo(t,0,0),r=s.alphaFlag,n=s.height,o=s.width,a=AP(i,r),l=a.compressed,u=a.format,A=a.basisFormat,c=e.getImageTranscodedSizeInBytes(t,0,0,A),h=new Uint8Array(c);if(!e.transcodeImage(h,t,0,0,A,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:n,data:h,compressed:l,levelSize:c,hasAlpha:r,format:u}}function AP(e,t){var i=e&&e.basis&&e.basis.format;return"auto"===i&&(i=cP()),"object"===b(i)&&(i=t?i.alpha:i.noAlpha),i=i.toLowerCase(),rP[i]}function cP(){var e=tP();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}var hP=s(s({},{name:"Basis",id:lw?"basis":"basis-nodejs",module:"textures",version:"3.4.15",worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}}),{},{parse:function(e,t){return nP.apply(this,arguments)}});function dP(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var pP=Boolean("object"!==("undefined"==typeof process?"undefined":b(process))||"[object process]"!==String(process)||process.browser),fP="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);fP&&parseFloat(fP[1]);var vP=globalThis._parseImageNode,gP="undefined"!=typeof Image,mP="undefined"!=typeof ImageBitmap,_P=Boolean(vP),yP=!!pP||_P;function bP(e){var t=function(e){if("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap)return"imagebitmap";if("undefined"!=typeof Image&&e instanceof Image)return"image";if(e&&"object"===b(e)&&e.data&&e.width&&e.height)return"data";return null}(e);if(!t)throw new Error("Not an image");return t}function BP(e){switch(bP(e)){case"data":return e;case"image":case"imagebitmap":var t=document.createElement("canvas"),i=t.getContext("2d");if(!i)throw new Error("getImageData");return t.width=e.width,t.height=e.height,i.drawImage(e,0,0),i.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}var xP=/^data:image\/svg\+xml/,wP=/\.svg((\?|#).*)?$/;function PP(e){return e&&(xP.test(e)||wP.test(e))}function CP(e,t){if(PP(t)){var i=(new TextDecoder).decode(e);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(i=unescape(encodeURIComponent(i)))}catch(e){throw new Error(e.message)}return"data:image/svg+xml;base64,".concat(btoa(i))}return MP(e,t)}function MP(e,t){if(PP(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function kP(e,t,i){return FP.apply(this,arguments)}function FP(){return(FP=o(r().mark((function e(t,i,s){var n,o,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=CP(t,s),o=self.URL||self.webkitURL,a="string"!=typeof n&&o.createObjectURL(n),e.prev=3,e.next=6,EP(a||n,i);case 6:return e.abrupt("return",e.sent);case 7:return e.prev=7,a&&o.revokeObjectURL(a),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[3,,7,10]])})))).apply(this,arguments)}function EP(e,t){return DP.apply(this,arguments)}function DP(){return DP=o(r().mark((function e(t,i){var s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((s=new Image).src=t,!(i.image&&i.image.decode&&s.decode)){e.next=6;break}return e.next=5,s.decode();case 5:return e.abrupt("return",s);case 6:return e.next=8,new Promise((function(e,i){try{s.onload=function(){return e(s)},s.onerror=function(e){return i(new Error("Could not load image ".concat(t,": ").concat(e)))}}catch(e){i(e)}}));case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)}))),DP.apply(this,arguments)}var IP={},SP=!0;function TP(e,t,i){return LP.apply(this,arguments)}function LP(){return(LP=o(r().mark((function e(t,i,s){var n,o,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!PP(s)){e.next=7;break}return e.next=3,kP(t,i,s);case 3:o=e.sent,n=o,e.next=8;break;case 7:n=MP(t,s);case 8:return a=i&&i.imagebitmap,e.next=11,RP(n,a);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function RP(e){return UP.apply(this,arguments)}function UP(){return UP=o(r().mark((function e(t){var i,s=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!OP(i=s.length>1&&void 0!==s[1]?s[1]:null)&&SP||(i=null),!i){e.next=13;break}return e.prev=3,e.next=6,createImageBitmap(t,i);case 6:return e.abrupt("return",e.sent);case 9:e.prev=9,e.t0=e.catch(3),console.warn(e.t0),SP=!1;case 13:return e.next=15,createImageBitmap(t);case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e,null,[[3,9]])}))),UP.apply(this,arguments)}function OP(e){for(var t in e||IP)return!1;return!0}function QP(e){return function(e,t){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=(n=t,a(n).map((function(e){return e.charCodeAt(0)}))),r=0;r<s.length;++r)if(s[r]!==e[r+i])return!1;var n;return!0}(e,"ftyp",4)?0==(96&e[8])?null:function(e){switch((t=e,i=8,s=12,String.fromCharCode.apply(String,a(t.slice(i,s)))).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}var t,i,s}(e):null}var NP=!1,VP=!0;function HP(e){var t=jP(e);return function(e){var t=jP(e),i=t.byteLength>=24&&2303741511===t.getUint32(0,NP);if(!i)return null;return{mimeType:"image/png",width:t.getUint32(16,NP),height:t.getUint32(20,NP)}}(t)||function(e){var t=jP(e),i=t.byteLength>=3&&65496===t.getUint16(0,NP)&&255===t.getUint8(2);if(!i)return null;var s=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var i=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:i}}(),r=s.tableMarkers,n=s.sofMarkers,o=2;for(;o+9<t.byteLength;){var a=t.getUint16(o,NP);if(n.has(a))return{mimeType:"image/jpeg",height:t.getUint16(o+5,NP),width:t.getUint16(o+7,NP)};if(!r.has(a))return null;o+=2,o+=t.getUint16(o,NP)}return null}(t)||function(e){var t=jP(e),i=t.byteLength>=10&&1195984440===t.getUint32(0,NP);if(!i)return null;return{mimeType:"image/gif",width:t.getUint16(6,VP),height:t.getUint16(8,VP)}}(t)||function(e){var t=jP(e),i=t.byteLength>=14&&16973===t.getUint16(0,NP)&&t.getUint32(2,VP)===t.byteLength;if(!i)return null;return{mimeType:"image/bmp",width:t.getUint32(18,VP),height:t.getUint32(22,VP)}}(t)||function(e){var t=new Uint8Array(e instanceof DataView?e.buffer:e),i=QP(t);if(!i)return null;return{mimeType:i.mimeType,width:0,height:0}}(t)}function jP(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}function GP(e,t){return zP.apply(this,arguments)}function zP(){return zP=o(r().mark((function e(t,i){var s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=HP(t)||{},n=s.mimeType,dP(o=globalThis._parseImageNode),e.next=5,o(t,n);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),zP.apply(this,arguments)}function WP(){return(WP=o(r().mark((function e(t,i,s){var n,o,a,l,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=(i=i||{}).image||{},o=n.type||"auto",a=(s||{}).url,l=KP(o),e.t0=l,e.next="imagebitmap"===e.t0?8:"image"===e.t0?12:"data"===e.t0?16:20;break;case 8:return e.next=10,TP(t,i,a);case 10:return u=e.sent,e.abrupt("break",21);case 12:return e.next=14,kP(t,i,a);case 14:return u=e.sent,e.abrupt("break",21);case 16:return e.next=18,GP(t);case 18:return u=e.sent,e.abrupt("break",21);case 20:dP(!1);case 21:return"data"===o&&(u=BP(u)),e.abrupt("return",u);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function KP(e){switch(e){case"auto":case"data":return function(){if(mP)return"imagebitmap";if(gP)return"image";if(yP)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return mP||gP||yP;case"imagebitmap":return mP;case"image":return gP;case"data":return yP;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}var XP={id:"image",module:"images",name:"Images",version:"3.4.15",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],parse:function(e,t,i){return WP.apply(this,arguments)},tests:[function(e){return Boolean(HP(new DataView(e)))}],options:{image:{type:"auto",decode:!0}}},YP={};function JP(e){if(void 0===YP[e]){var t=pP?function(e){switch(e){case"image/avif":case"image/webp":return function(e){try{return 0===document.createElement("canvas").toDataURL(e).indexOf("data:".concat(e))}catch(e){return!1}}(e);default:return!0}}(e):function(e){var t=["image/png","image/jpeg","image/gif"],i=globalThis._parseImageNode,s=globalThis._imageFormatsNode,r=void 0===s?t:s;return Boolean(i)&&r.includes(e)}(e);YP[e]=t}return YP[e]}function ZP(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function qP(e,t,i){if(e.byteLength<=t+i)return"";for(var s=new DataView(e),r="",n=0;n<i;n++)r+=String.fromCharCode(s.getUint8(t+n));return r}function $P(e){try{return JSON.parse(e)}catch(t){throw new Error('Failed to parse JSON from data starting with "'.concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return qP(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer)return qP(e,0,t);return""}(e),'"'))}}function eC(e,t,i){var s=void 0!==i?new Uint8Array(e).subarray(t,t+i):new Uint8Array(e).subarray(t);return new Uint8Array(s).buffer}function tC(e,t){return ZP(e>=0),ZP(t>0),e+(t-1)&~(t-1)}function iC(e,t,i){var s;if(e instanceof ArrayBuffer)s=new Uint8Array(e);else{var r=e.byteOffset,n=e.byteLength;s=new Uint8Array(e.buffer||e.arrayBuffer,r,n)}return t.set(s,i),i+tC(s.byteLength,4)}function sC(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function rC(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;var i=t.baseUri||t.uri;if(!i)throw new Error("'baseUri' must be provided to resolve relative url ".concat(e));return i.substr(0,i.lastIndexOf("/")+1)+e}function nC(e,t,i){var s=e.bufferViews[i];sC(s);var r=t[s.buffer];sC(r);var n=(s.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,s.byteLength)}var oC=["SCALAR","VEC2","VEC3","VEC4"],aC=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],lC=new Map(aC),uC={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},AC={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},cC={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function hC(e){return oC[e-1]||oC[0]}function dC(e){var t=lC.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function pC(e,t){var i=cC[e.componentType],s=uC[e.type],r=AC[e.componentType],n=e.count*s,o=e.count*s*r;return sC(o>=0&&o<=t.byteLength),{ArrayType:i,length:n,byteLength:o}}var fC,vC={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},gC=function(){return w((function e(t){B(this,e),Wb(this,"gltf",void 0),Wb(this,"sourceBuffers",void 0),Wb(this,"byteLength",void 0),this.gltf=t||{json:s({},vC),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}),[{key:"json",get:function(){return this.gltf.json}},{key:"getApplicationData",value:function(e){return this.json[e]}},{key:"getExtraData",value:function(e){return(this.json.extras||{})[e]}},{key:"getExtension",value:function(e){var t=this.getUsedExtensions().find((function(t){return t===e})),i=this.json.extensions||{};return t?i[e]||!0:null}},{key:"getRequiredExtension",value:function(e){var t=this.getRequiredExtensions().find((function(t){return t===e}));return t?this.getExtension(e):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getRemovedExtensions",value:function(){return this.json.extensionsRemoved||[]}},{key:"getObjectExtension",value:function(e,t){return(e.extensions||{})[t]}},{key:"getScene",value:function(e){return this.getObject("scenes",e)}},{key:"getNode",value:function(e){return this.getObject("nodes",e)}},{key:"getSkin",value:function(e){return this.getObject("skins",e)}},{key:"getMesh",value:function(e){return this.getObject("meshes",e)}},{key:"getMaterial",value:function(e){return this.getObject("materials",e)}},{key:"getAccessor",value:function(e){return this.getObject("accessors",e)}},{key:"getTexture",value:function(e){return this.getObject("textures",e)}},{key:"getSampler",value:function(e){return this.getObject("samplers",e)}},{key:"getImage",value:function(e){return this.getObject("images",e)}},{key:"getBufferView",value:function(e){return this.getObject("bufferViews",e)}},{key:"getBuffer",value:function(e){return this.getObject("buffers",e)}},{key:"getObject",value:function(e,t){if("object"===b(t))return t;var i=this.json[e]&&this.json[e][t];if(!i)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return i}},{key:"getTypedArrayForBufferView",value:function(e){var t=(e=this.getBufferView(e)).buffer,i=this.gltf.buffers[t];sC(i);var s=(e.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,s,e.byteLength)}},{key:"getTypedArrayForAccessor",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),i=this.getBuffer(t.buffer).data,s=pC(e,t),r=s.ArrayType,n=s.length;return new r(i,t.byteOffset+e.byteOffset,n)}},{key:"getTypedArrayForImageData",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),i=this.getBuffer(t.buffer).data,s=t.byteOffset||0;return new Uint8Array(i,s,t.byteLength)}},{key:"addApplicationData",value:function(e,t){return this.json[e]=t,this}},{key:"addExtraData",value:function(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}},{key:"addObjectExtension",value:function(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}},{key:"setObjectExtension",value:function(e,t,i){(e.extensions||{})[t]=i}},{key:"removeObjectExtension",value:function(e,t){var i=e.extensions||{},s=i[t];return delete i[t],s}},{key:"addExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return sC(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}},{key:"addRequiredExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return sC(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}},{key:"registerUsedExtension",value:function(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((function(t){return t===e}))||this.json.extensionsUsed.push(e)}},{key:"registerRequiredExtension",value:function(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((function(t){return t===e}))||this.json.extensionsRequired.push(e)}},{key:"removeExtension",value:function(e){if(this.getExtension(e)){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e],Array.isArray(this.json.extensionsRemoved)||(this.json.extensionsRemoved=[]);var t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}}},{key:"setDefaultScene",value:function(e){this.json.scene=e}},{key:"addScene",value:function(e){var t=e.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}},{key:"addNode",value:function(e){var t=e.meshIndex,i=e.matrix;this.json.nodes=this.json.nodes||[];var s={mesh:t};return i&&(s.matrix=i),this.json.nodes.push(s),this.json.nodes.length-1}},{key:"addMesh",value:function(e){var t=e.attributes,i=e.indices,s=e.material,r=e.mode,n=void 0===r?4:r,o={primitives:[{attributes:this._addAttributes(t),mode:n}]};if(i){var a=this._addIndices(i);o.primitives[0].indices=a}return Number.isFinite(s)&&(o.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}},{key:"addPointCloud",value:function(e){var t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}},{key:"addImage",value:function(e,t){var i=HP(e),s=t||(null==i?void 0:i.mimeType),r={bufferView:this.addBufferView(e),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}},{key:"addBufferView",value:function(e){var t=e.byteLength;sC(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=tC(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(e,t){var i={bufferView:e,type:hC(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}},{key:"addBinaryBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3},i=this.addBufferView(e),s={min:t.min,max:t.max};s.min&&s.max||(s=this._getAccessorMinMax(e,t.size));var r={size:t.size,componentType:dC(e),count:Math.round(e.length/t.size),min:s.min,max:s.max};return this.addAccessor(i,Object.assign(r,t))}},{key:"addTexture",value:function(e){var t={source:e.imageIndex};return this.json.textures=this.json.textures||[],this.json.textures.push(t),this.json.textures.length-1}},{key:"addMaterial",value:function(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var e,t;this.gltf.buffers=[];var i,s=this.byteLength,r=new ArrayBuffer(s),n=new Uint8Array(r),o=0,a=l(this.sourceBuffers||[]);try{for(a.s();!(i=a.n()).done;){o=iC(i.value,n,o)}}catch(e){a.e(e)}finally{a.f()}null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=s:this.json.buffers=[{byteLength:s}],this.gltf.binary=r,this.sourceBuffers=[r]}},{key:"_removeStringFromArray",value:function(e,t){for(var i=!0;i;){var s=e.indexOf(t);s>-1?e.splice(s,1):i=!1}}},{key:"_addAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};for(var i in e){var s=e[i],r=this._getGltfAttributeName(i),n=this.addBinaryBuffer(s.value,s);t[r]=n}return t}},{key:"_addIndices",value:function(e){return this.addBinaryBuffer(e,{size:1})}},{key:"_getGltfAttributeName",value:function(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}},{key:"_getAccessorMinMax",value:function(e,t){var i={min:null,max:null};if(e.length<t)return i;i.min=[],i.max=[];var s,r=l(e.subarray(0,t));try{for(r.s();!(s=r.n()).done;){var n=s.value;i.min.push(n),i.max.push(n)}}catch(e){r.e(e)}finally{r.f()}for(var o=t;o<e.length;o+=t)for(var a=0;a<t;a++)i.min[0+a]=Math.min(i.min[0+a],e[o+a]),i.max[0+a]=Math.max(i.max[0+a],e[o+a]);return i}}])}(),mC="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9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DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",yC=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),bC=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),BC={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},xC={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};function wC(e,t,i,s,r){return PC.apply(this,arguments)}function PC(){return PC=o(r().mark((function e(t,i,s,n,o){var a,l,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.length>5&&void 0!==u[5]?u[5]:"NONE",e.next=3,CC();case 3:DC(l=e.sent,l.exports[xC[o]],t,i,s,n,l.exports[BC[a||"NONE"]]);case 5:case"end":return e.stop()}}),e)}))),PC.apply(this,arguments)}function CC(){return MC.apply(this,arguments)}function MC(){return(MC=o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return fC||(fC=kC()),e.abrupt("return",fC);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kC(){return FC.apply(this,arguments)}function FC(){return(FC=o(r().mark((function e(){var t,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=mC,WebAssembly.validate(yC)&&(t=_C,console.log("Warning: meshopt_decoder is using experimental SIMD support")),e.next=4,WebAssembly.instantiate(EC(t),{});case 4:return i=e.sent,e.next=7,i.instance.exports.__wasm_call_ctors();case 7:return e.abrupt("return",i.instance);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function EC(e){for(var t=new Uint8Array(e.length),i=0;i<e.length;++i){var s=e.charCodeAt(i);t[i]=s>96?s-71:s>64?s-65:s>47?s+4:s>46?63:62}for(var r=0,n=0;n<e.length;++n)t[r++]=t[n]<60?bC[t[n]]:64*(t[n]-60)+t[++n];return t.buffer.slice(0,r)}function DC(e,t,i,s,r,n,o){var a=e.exports.sbrk,l=s+3&-4,u=a(l*r),A=a(n.length),c=new Uint8Array(e.exports.memory.buffer);c.set(n,A);var h=t(u,s,r,A,n.length);if(0===h&&o&&o(u,l,r),i.set(c.subarray(u,u+s*r)),a(u-a(0)),0!==h)throw new Error("Malformed buffer data: ".concat(h))}var IC="EXT_meshopt_compression",SC=IC;function TC(){return(TC=o(r().mark((function e(t,i){var s,n,o,a,u,A;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=new gC(t),null!=i&&null!==(s=i.gltf)&&void 0!==s&&s.decompressMeshes){e.next=3;break}return e.abrupt("return");case 3:o=[],a=l(t.json.bufferViews||[]);try{for(a.s();!(u=a.n()).done;)A=u.value,o.push(LC(n,A))}catch(e){a.e(e)}finally{a.f()}return e.next=8,Promise.all(o);case 8:n.removeExtension(IC);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function LC(e,t){return RC.apply(this,arguments)}function RC(){return(RC=o(r().mark((function e(t,i){var s,n,o,a,l,u,A,c,h,d,p,f,v,g;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(s=t.getObjectExtension(i,IC))){e.next=9;break}return n=s.byteOffset,o=void 0===n?0:n,a=s.byteLength,l=void 0===a?0:a,u=s.byteStride,A=s.count,c=s.mode,h=s.filter,d=void 0===h?"NONE":h,p=s.buffer,f=t.gltf.buffers[p],v=new Uint8Array(f.arrayBuffer,f.byteOffset+o,l),g=new Uint8Array(t.gltf.buffers[i.buffer].arrayBuffer,i.byteOffset,i.byteLength),e.next=8,wC(g,A,u,v,c,d);case 8:return e.abrupt("return",g);case 9:return e.abrupt("return",null);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var UC=Object.freeze({__proto__:null,name:SC,decode:function(e,t){return TC.apply(this,arguments)}}),OC="EXT_texture_webp",QC=OC;var NC=Object.freeze({__proto__:null,name:QC,preprocess:function(e,t){var i=new gC(e);if(JP("image/webp")){var s,r=l(i.json.textures||[]);try{for(r.s();!(s=r.n()).done;){var n=s.value,o=i.getObjectExtension(n,OC);o&&(n.source=o.source),i.removeObjectExtension(n,OC)}}catch(e){r.e(e)}finally{r.f()}i.removeExtension(OC)}else if(i.getRequiredExtensions().includes(OC))throw new Error("gltf: Required extension ".concat(OC," not supported by browser"))}}),VC="KHR_texture_basisu",HC=VC;var jC=Object.freeze({__proto__:null,name:HC,preprocess:function(e,t){var i,s=new gC(e),r=l(s.json.textures||[]);try{for(r.s();!(i=r.n()).done;){var n=i.value,o=s.getObjectExtension(n,VC);o&&(n.source=o.source),s.removeObjectExtension(n,VC)}}catch(e){r.e(e)}finally{r.f()}s.removeExtension(VC)}});var GC={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},zC=GC.global||GC.self||GC.window||{},WC="object"!==("undefined"==typeof process?"undefined":b(process))||"[object process]"!==String(process)||process.browser,KC="function"==typeof importScripts,XC="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);XC&&parseFloat(XC[1]);var YC=null,JC=null,ZC=Object.freeze({__proto__:null,readFileAsArrayBuffer:null,readFileAsText:null,requireFromFile:YC,requireFromString:JC}),qC="3.4.15",$C={};function eM(e){return tM.apply(this,arguments)}function tM(){return tM=o(r().mark((function e(t){var i,s,n=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.length>2&&void 0!==n[2]?n[2]:{},(i=n.length>1&&void 0!==n[1]?n[1]:null)&&(t=iM(t,i,s)),$C[t]=$C[t]||sM(t),e.next=6,$C[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)}))),tM.apply(this,arguments)}function iM(e,t,i){if(e.startsWith("http"))return e;var s=i.modules||{};return s[e]?s[e]:WC?i.CDN?(function(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}(i.CDN.startsWith("http")),"".concat(i.CDN,"/").concat(t,"@").concat(qC,"/dist/libs/").concat(e)):KC?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function sM(e){return rM.apply(this,arguments)}function rM(){return(rM=o(r().mark((function e(t){var i,s,n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.endsWith("wasm")){e.next=7;break}return e.next=3,fetch(t);case 3:return i=e.sent,e.next=6,i.arrayBuffer();case 6:return e.abrupt("return",e.sent);case 7:if(WC){e.next=20;break}if(e.prev=8,e.t0=ZC&&YC,!e.t0){e.next=14;break}return e.next=13,YC(t);case 13:e.t0=e.sent;case 14:return e.abrupt("return",e.t0);case 17:return e.prev=17,e.t1=e.catch(8),e.abrupt("return",null);case 20:if(!KC){e.next=22;break}return e.abrupt("return",importScripts(t));case 22:return e.next=24,fetch(t);case 24:return s=e.sent,e.next=27,s.text();case 27:return n=e.sent,e.abrupt("return",nM(n,t));case 29:case"end":return e.stop()}}),e,null,[[8,17]])})))).apply(this,arguments)}function nM(e,t){if(!WC)return JC;if(KC)return eval.call(zC,e),null;var i=document.createElement("script");i.id=t;try{i.appendChild(document.createTextNode(e))}catch(t){i.text=e}return document.body.appendChild(i),null}var oM="3.4.15",aM={draco:{decoderType:"object"===("undefined"==typeof WebAssembly?"undefined":b(WebAssembly))?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},lM={name:"Draco",id:WC?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:oM,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:aM};var uM=function(){function e(t,i){B(this,e),Wb(this,"fields",void 0),Wb(this,"metadata",void 0),function(e,t){if(!e)throw new Error(t||"loader assertion failed.")}(Array.isArray(t)),function(e){var t,i={},s=l(e);try{for(s.s();!(t=s.n()).done;){var r=t.value;i[r.name]&&console.warn("Schema: duplicated field name",r.name,r),i[r.name]=!0}}catch(e){s.e(e)}finally{s.f()}}(t),this.fields=t,this.metadata=i||new Map}return w(e,[{key:"compareTo",value:function(e){if(this.metadata!==e.metadata)return!1;if(this.fields.length!==e.fields.length)return!1;for(var t=0;t<this.fields.length;++t)if(!this.fields[t].compareTo(e.fields[t]))return!1;return!0}},{key:"select",value:function(){for(var t=Object.create(null),i=arguments.length,s=new Array(i),r=0;r<i;r++)s[r]=arguments[r];for(var n=0,o=s;n<o.length;n++){var a=o[n];t[a]=!0}return new e(this.fields.filter((function(e){return t[e.name]})),this.metadata)}},{key:"selectAt",value:function(){for(var t=this,i=arguments.length,s=new Array(i),r=0;r<i;r++)s[r]=arguments[r];return new e(s.map((function(e){return t.fields[e]})).filter(Boolean),this.metadata)}},{key:"assign",value:function(t){var i,s=this.metadata;if(t instanceof e){var r=t;i=r.fields,s=AM(AM(new Map,this.metadata),r.metadata)}else i=t;var n,o=Object.create(null),a=l(this.fields);try{for(a.s();!(n=a.n()).done;){var u=n.value;o[u.name]=u}}catch(e){a.e(e)}finally{a.f()}var A,c=l(i);try{for(c.s();!(A=c.n()).done;){var h=A.value;o[h.name]=h}}catch(e){c.e(e)}finally{c.f()}return new e(Object.values(o),s)}}])}();function AM(e,t){return new Map([].concat(a(e||new Map),a(t||new Map)))}var cM=function(){function e(t,i){B(this,e);var s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;Wb(this,"name",void 0),Wb(this,"type",void 0),Wb(this,"nullable",void 0),Wb(this,"metadata",void 0),this.name=t,this.type=i,this.nullable=s,this.metadata=r}return w(e,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new e(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}])}(),hM=function(e){return e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e}({}),dM=function(){return w((function e(){B(this,e)}),[{key:"typeId",get:function(){return hM.NONE}},{key:"compareTo",value:function(e){return this===e}}],[{key:"isNull",value:function(e){return e&&e.typeId===hM.Null}},{key:"isInt",value:function(e){return e&&e.typeId===hM.Int}},{key:"isFloat",value:function(e){return e&&e.typeId===hM.Float}},{key:"isBinary",value:function(e){return e&&e.typeId===hM.Binary}},{key:"isUtf8",value:function(e){return e&&e.typeId===hM.Utf8}},{key:"isBool",value:function(e){return e&&e.typeId===hM.Bool}},{key:"isDecimal",value:function(e){return e&&e.typeId===hM.Decimal}},{key:"isDate",value:function(e){return e&&e.typeId===hM.Date}},{key:"isTime",value:function(e){return e&&e.typeId===hM.Time}},{key:"isTimestamp",value:function(e){return e&&e.typeId===hM.Timestamp}},{key:"isInterval",value:function(e){return e&&e.typeId===hM.Interval}},{key:"isList",value:function(e){return e&&e.typeId===hM.List}},{key:"isStruct",value:function(e){return e&&e.typeId===hM.Struct}},{key:"isUnion",value:function(e){return e&&e.typeId===hM.Union}},{key:"isFixedSizeBinary",value:function(e){return e&&e.typeId===hM.FixedSizeBinary}},{key:"isFixedSizeList",value:function(e){return e&&e.typeId===hM.FixedSizeList}},{key:"isMap",value:function(e){return e&&e.typeId===hM.Map}},{key:"isDictionary",value:function(e){return e&&e.typeId===hM.Dictionary}}])}(),pM=function(e,t){function i(e,t){var s;return B(this,i),Wb(s=h(this,i),"isSigned",void 0),Wb(s,"bitWidth",void 0),s.isSigned=e,s.bitWidth=t,s}return m(i,dM),w(i,[{key:"typeId",get:function(){return hM.Int}},{key:t,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}])}(0,Symbol.toStringTag),fM=function(e){function t(){return B(this,t),h(this,t,[!0,8])}return m(t,pM),w(t)}(),vM=function(e){function t(){return B(this,t),h(this,t,[!0,16])}return m(t,pM),w(t)}(),gM=function(e){function t(){return B(this,t),h(this,t,[!0,32])}return m(t,pM),w(t)}(),mM=function(e){function t(){return B(this,t),h(this,t,[!1,8])}return m(t,pM),w(t)}(),_M=function(e){function t(){return B(this,t),h(this,t,[!1,16])}return m(t,pM),w(t)}(),yM=function(e){function t(){return B(this,t),h(this,t,[!1,32])}return m(t,pM),w(t)}(),bM=32,BM=64,xM=function(e,t){function i(e){var t;return B(this,i),Wb(t=h(this,i),"precision",void 0),t.precision=e,t}return m(i,dM),w(i,[{key:"typeId",get:function(){return hM.Float}},{key:t,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}])}(0,Symbol.toStringTag),wM=function(e){function t(){return B(this,t),h(this,t,[bM])}return m(t,xM),w(t)}(),PM=function(e){function t(){return B(this,t),h(this,t,[BM])}return m(t,xM),w(t)}(),CM=function(e,t){function i(e,t){var s;return B(this,i),Wb(s=h(this,i),"listSize",void 0),Wb(s,"children",void 0),s.listSize=e,s.children=[t],s}return m(i,dM),w(i,[{key:"typeId",get:function(){return hM.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:t,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}])}(0,Symbol.toStringTag);function MM(e,t,i){var s=function(e){switch(e.constructor){case Int8Array:return new fM;case Uint8Array:return new mM;case Int16Array:return new vM;case Uint16Array:return new _M;case Int32Array:return new gM;case Uint32Array:return new yM;case Float32Array:return new wM;case Float64Array:return new PM;default:throw new Error("array type not supported")}}(t.value),r=i||function(e){var t=new Map;"byteOffset"in e&&t.set("byteOffset",e.byteOffset.toString(10));"byteStride"in e&&t.set("byteStride",e.byteStride.toString(10));"normalized"in e&&t.set("normalized",e.normalized.toString());return t}(t);return new cM(e,new CM(t.size,new cM("value",s)),!1,r)}function kM(e,t,i){return MM(e,t,i?FM(i.metadata):void 0)}function FM(e){var t=new Map;for(var i in e)t.set("".concat(i,".string"),JSON.stringify(e[i]));return t}var EM={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},DM={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},IM=function(){return w((function e(t){B(this,e),Wb(this,"draco",void 0),Wb(this,"decoder",void 0),Wb(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}),[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);var r=this.decoder.GetEncodedGeometryType(i),n=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,n);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,n);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!n.ptr){var a="DRACO decompression failed: ".concat(o.error_msg());throw new Error(a)}var l=this._getDracoLoaderData(n,r,t),u=this._getMeshData(n,l,t),A=function(e){for(var t=1/0,i=1/0,s=1/0,r=-1/0,n=-1/0,o=-1/0,a=e.POSITION?e.POSITION.value:[],l=a&&a.length,u=0;u<l;u+=3){var A=a[u],c=a[u+1],h=a[u+2];t=A<t?A:t,i=c<i?c:i,s=h<s?h:s,r=A>r?A:r,n=c>n?c:n,o=h>o?h:o}return[[t,i,s],[r,n,o]]}(u.attributes),c=function(e,t,i){var s=FM(t.metadata),r=[],n=function(e){var t={};for(var i in e){var s=e[i];t[s.name||"undefined"]=s}return t}(t.attributes);for(var o in e){var a=kM(o,e[o],n[o]);r.push(a)}if(i){var l=kM("indices",i);r.push(l)}return new uM(r,s)}(u.attributes,l,u.indices);return s(s({loader:"draco",loaderData:l,header:{vertexCount:n.num_points(),boundingBox:A}},u),{},{schema:c})}finally{this.draco.destroy(i),n&&this.draco.destroy(n)}}},{key:"_getDracoLoaderData",value:function(e,t,i){var s=this._getTopLevelMetadata(e),r=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:s,attributes:r}}},{key:"_getDracoAttributes",value:function(e,t){for(var i={},s=0;s<e.num_attributes();s++){var r=this.decoder.GetAttribute(e,s),n=this._getAttributeMetadata(e,s);i[r.unique_id()]={unique_id:r.unique_id(),attribute_type:r.attribute_type(),data_type:r.data_type(),num_components:r.num_components(),byte_offset:r.byte_offset(),byte_stride:r.byte_stride(),normalized:r.normalized(),attribute_index:s,metadata:n};var o=this._getQuantizationTransform(r,t);o&&(i[r.unique_id()].quantization_transform=o);var a=this._getOctahedronTransform(r,t);a&&(i[r.unique_id()].octahedron_transform=a)}return i}},{key:"_getMeshData",value:function(e,t,i){var s=this._getMeshAttributes(t,e,i);if(!s.POSITION)throw new Error("DRACO: No position attribute found.");return e instanceof this.draco.Mesh?"triangle-strip"===i.topology?{topology:"triangle-strip",mode:4,attributes:s,indices:{value:this._getTriangleStripIndices(e),size:1}}:{topology:"triangle-list",mode:5,attributes:s,indices:{value:this._getTriangleListIndices(e),size:1}}:{topology:"point-list",mode:0,attributes:s}}},{key:"_getMeshAttributes",value:function(e,t,i){for(var s={},r=0,n=Object.values(e.attributes);r<n.length;r++){var o=n[r],a=this._deduceAttributeName(o,i);o.name=a;var l=this._getAttributeValues(t,o),u=l.value,A=l.size;s[a]={value:u,size:A,byteOffset:o.byte_offset,byteStride:o.byte_stride,normalized:o.normalized}}return s}},{key:"_getTriangleListIndices",value:function(e){var t=3*e.num_faces(),i=4*t,s=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(e,i,s),new Uint32Array(this.draco.HEAPF32.buffer,s,t).slice()}finally{this.draco._free(s)}}},{key:"_getTriangleStripIndices",value:function(e){var t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),function(e){for(var t=e.size(),i=new Int32Array(t),s=0;s<t;s++)i[s]=e.GetValue(s);return i}(t)}finally{this.draco.destroy(t)}}},{key:"_getAttributeValues",value:function(e,t){var i,s=DM[t.data_type],r=t.num_components,n=e.num_points()*r,o=n*s.BYTES_PER_ELEMENT,a=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}(this.draco,s),l=this.draco._malloc(o);try{var u=this.decoder.GetAttribute(e,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,u,a,o,l),i=new s(this.draco.HEAPF32.buffer,l,n).slice()}finally{this.draco._free(l)}return{value:i,size:r}}},{key:"_deduceAttributeName",value:function(e,t){for(var i=e.unique_id,s=0,r=Object.entries(t.extraAttributes||{});s<r.length;s++){var n=u(r[s],2),o=n[0];if(n[1]===i)return o}var a=e.attribute_type;for(var l in EM){if(this.draco[l]===a)return EM[l]}var A=t.attributeNameEntry||"name";return e.metadata[A]?e.metadata[A].string:"CUSTOM_ATTRIBUTE_".concat(i)}},{key:"_getTopLevelMetadata",value:function(e){var t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}},{key:"_getAttributeMetadata",value:function(e,t){var i=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(i)}},{key:"_getDracoMetadata",value:function(e){if(!e||!e.ptr)return{};for(var t={},i=this.metadataQuerier.NumEntries(e),s=0;s<i;s++){var r=this.metadataQuerier.GetEntryName(e,s);t[r]=this._getDracoMetadataField(e,r)}return t}},{key:"_getDracoMetadataField",value:function(e,t){var i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,i);var s=function(e){for(var t=e.size(),i=new Int32Array(t),s=0;s<t;s++)i[s]=e.GetValue(s);return i}(i);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:s}}finally{this.draco.destroy(i)}}},{key:"_disableAttributeTransforms",value:function(e){var t,i=e.quantizedAttributes,s=void 0===i?[]:i,r=e.octahedronAttributes,n=void 0===r?[]:r,o=l([].concat(a(s),a(n)));try{for(o.s();!(t=o.n()).done;){var u=t.value;this.decoder.SkipAttributeTransform(this.draco[u])}}catch(e){o.e(e)}finally{o.f()}}},{key:"_getQuantizationTransform",value:function(e,t){var i=this,s=t.quantizedAttributes,r=void 0===s?[]:s,n=e.attribute_type();if(r.map((function(e){return i.decoder[e]})).includes(n)){var o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map((function(e){return o.min_value(e)}))}}finally{this.draco.destroy(o)}}return null}},{key:"_getOctahedronTransform",value:function(e,t){var i=this,s=t.octahedronAttributes,r=void 0===s?[]:s,n=e.attribute_type();if(r.map((function(e){return i.decoder[e]})).includes(n)){var o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}])}();var SM,TM="https://www.gstatic.com/draco/versioned/decoders/".concat("1.5.5"),LM="".concat(TM,"/draco_decoder.js"),RM="".concat(TM,"/draco_wasm_wrapper.js"),UM="".concat(TM,"/draco_decoder.wasm");function OM(e){return QM.apply(this,arguments)}function QM(){return(QM=o(r().mark((function e(t){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.modules||{},SM=i.draco3d?SM||i.draco3d.createDecoderModule({}).then((function(e){return{draco:e}})):SM||NM(t),e.next=4,SM;case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NM(e){return VM.apply(this,arguments)}function VM(){return(VM=o(r().mark((function e(t){var i,s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.draco&&t.draco.decoderType,e.next="js"===e.t0?3:(e.t0,7);break;case 3:return e.next=5,eM(LM,"draco",t);case 5:return i=e.sent,e.abrupt("break",21);case 7:return e.t1=Promise,e.next=10,eM(RM,"draco",t);case 10:return e.t2=e.sent,e.next=13,eM(UM,"draco",t);case 13:return e.t3=e.sent,e.t4=[e.t2,e.t3],e.next=17,e.t1.all.call(e.t1,e.t4);case 17:n=e.sent,o=u(n,2),i=o[0],s=o[1];case 21:return i=i||globalThis.DracoDecoderModule,e.next=24,HM(i,s);case 24:return e.abrupt("return",e.sent);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function HM(e,t){var i={};return t&&(i.wasmBinary=t),new Promise((function(t){e(s(s({},i),{},{onModuleLoaded:function(e){return t({draco:e})}}))}))}var jM=s(s({},lM),{},{parse:function(e,t){return GM.apply(this,arguments)}});function GM(){return(GM=o(r().mark((function e(t,i){var s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,OM(i);case 2:return s=e.sent,n=s.draco,o=new IM(n),e.prev=5,e.abrupt("return",o.parseSync(t,null==i?void 0:i.draco));case 7:return e.prev=7,o.destroy(),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[5,,7,10]])})))).apply(this,arguments)}function zM(e){var t={};for(var i in e){var s=e[i];if("indices"!==i){var r=WM(s);t[i]=r}}return t}function WM(e){var t=function(e){var t=e,i=1,s=0;e&&e.value&&(t=e.value,i=e.size||1);t&&(ArrayBuffer.isView(t)||(t=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return null;if(Array.isArray(e))return new t(e);if(i&&!(e instanceof t))return new t(e);return e}(t,Float32Array)),s=t.length/i);return{buffer:t,size:i,count:s}}(e),i=t.buffer,s=t.size;return{value:i,size:s,byteOffset:0,count:t.count,type:hC(s),componentType:dC(i)}}var KM="KHR_draco_mesh_compression",XM=KM;function YM(){return(YM=o(r().mark((function e(t,i,s){var n,o,a,u,A,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=i&&null!==(n=i.gltf)&&void 0!==n&&n.decompressMeshes){e.next=2;break}return e.abrupt("return");case 2:o=new gC(t),a=[],u=l(ek(o));try{for(u.s();!(A=u.n()).done;)c=A.value,o.getObjectExtension(c,KM)&&a.push(JM(o,c,i,s))}catch(e){u.e(e)}finally{u.f()}return e.next=8,Promise.all(a);case 8:o.removeExtension(KM);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function JM(e,t,i,s){return ZM.apply(this,arguments)}function ZM(){return ZM=o(r().mark((function e(t,i,n,o){var a,l,A,c,h,d,p,f,v,g,m,_,y,b;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.getObjectExtension(i,KM)){e.next=3;break}return e.abrupt("return");case 3:return l=t.getTypedArrayForBufferView(a.bufferView),A=eC(l.buffer,l.byteOffset),c=o.parse,delete(h=s({},n))["3d-tiles"],e.next=10,c(A,jM,h,o);case 10:for(d=e.sent,p=zM(d.attributes),f=0,v=Object.entries(p);f<v.length;f++)g=u(v[f],2),m=g[0],_=g[1],m in i.attributes&&(y=i.attributes[m],null!=(b=t.getAccessor(y))&&b.min&&null!=b&&b.max&&(_.min=b.min,_.max=b.max));i.attributes=p,d.indices&&(i.indices=WM(d.indices)),$M(i);case 16:case"end":return e.stop()}}),e)}))),ZM.apply(this,arguments)}function qM(e,t){var i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;if(!r.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var o=r.DracoWriter.encodeSync({attributes:e}),a=null==n||null===(i=n.parseSync)||void 0===i?void 0:i.call(n,{attributes:e}),l=r._addFauxAttributes(a.attributes),u=r.addBufferView(o);return{primitives:[{attributes:l,mode:s,extensions:y({},KM,{bufferView:u,attributes:l})}]}}function $M(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function ek(e){var i,s,n,o,a,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=l(e.json.meshes||[]),t.prev=1,i.s();case 3:if((s=i.n()).done){t.next=24;break}n=s.value,o=l(n.primitives),t.prev=6,o.s();case 8:if((a=o.n()).done){t.next=14;break}return u=a.value,t.next=12,u;case 12:t.next=8;break;case 14:t.next=19;break;case 16:t.prev=16,t.t0=t.catch(6),o.e(t.t0);case 19:return t.prev=19,o.f(),t.finish(19);case 22:t.next=3;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(1),i.e(t.t1);case 29:return t.prev=29,i.f(),t.finish(29);case 32:case"end":return t.stop()}}),t,null,[[1,26,29,32],[6,16,19,22]])}var tk=Object.freeze({__proto__:null,name:XM,preprocess:function(e,t,i){var s,r=new gC(e),n=l(ek(r));try{for(n.s();!(s=n.n()).done;){var o=s.value;r.getObjectExtension(o,KM)}}catch(e){n.e(e)}finally{n.f()}},decode:function(e,t,i){return YM.apply(this,arguments)},encode:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=new gC(e),r=l(s.json.meshes||[]);try{for(r.s();!(t=r.n()).done;){qM(t.value,i),s.addRequiredExtension(KM)}}catch(e){r.e(e)}finally{r.f()}}});function ik(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var sk={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function rk(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).precision,i=void 0===t?sk.precision:t;return e=function(e){return Math.round(e/sk.EPSILON)*sk.EPSILON}(e),"".concat(parseFloat(e.toPrecision(i)))}function nk(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ok(e,t,i){var s=sk.EPSILON;i&&(sk.EPSILON=i);try{if(e===t)return!0;if(nk(e)&&nk(t)){if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!ok(e[r],t[r]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):"number"==typeof e&&"number"==typeof t&&Math.abs(e-t)<=sk.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{sk.EPSILON=s}}function ak(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var lk=function(e){function t(){return B(this,t),h(this,t,arguments)}return m(t,ak(Array)),w(t,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<this.ELEMENTS;++i)this[i]=e[i+t];return this.check()}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<this.ELEMENTS;++i)e[t+i]=this[i];return e}},{key:"from",value:function(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}},{key:"to",value:function(e){return e===this?this:nk(e)?this.toArray(e):this.toObject(e)}},{key:"toTarget",value:function(e){return e?this.to(e):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(sk)}},{key:"formatString",value:function(e){for(var t="",i=0;i<this.ELEMENTS;++i)t+=(i>0?", ":"")+rk(this[i],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(!ok(this[t],e[t]))return!1;return!0}},{key:"exactEquals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}},{key:"negate",value:function(){for(var e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}},{key:"lerp",value:function(e,t,i){if(void 0===i)return this.lerp(this,e,t);for(var s=0;s<this.ELEMENTS;++s){var r=e[s];this[s]=r+i*(t[s]-r)}return this.check()}},{key:"min",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}},{key:"max",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}},{key:"clamp",value:function(e,t){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],e[i]),t[i]);return this.check()}},{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(var s=0,r=t;s<r.length;s++)for(var n=r[s],o=0;o<this.ELEMENTS;++o)this[o]+=n[o];return this.check()}},{key:"subtract",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(var s=0,r=t;s<r.length;s++)for(var n=r[s],o=0;o<this.ELEMENTS;++o)this[o]-=n[o];return this.check()}},{key:"scale",value:function(e){if("number"==typeof e)for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;else for(var i=0;i<this.ELEMENTS&&i<e.length;++i)this[i]*=e[i];return this.check()}},{key:"multiplyByScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"check",value:function(){if(sk.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var e=this.length===this.ELEMENTS,t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}},{key:"addScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}},{key:"subScalar",value:function(e){return this.addScalar(-e)}},{key:"multiplyScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"divideScalar",value:function(e){return this.multiplyByScalar(1/e)}},{key:"clampScalar",value:function(e,t){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],e),t);return this.check()}},{key:"elements",get:function(){return this}}])}();function uk(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function Ak(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(sk.debug&&!function(e,t){if(e.length!==t)return!1;for(var i=0;i<e.length;++i)if(!Number.isFinite(e[i]))return!1;return!0}(e,t))throw new Error("math.gl: ".concat(i," some fields set to invalid numbers'"));return e}var ck=function(e){function t(){return B(this,t),h(this,t,arguments)}return m(t,lk),w(t,[{key:"x",get:function(){return this[0]},set:function(e){this[0]=uk(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=uk(e)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(e){return Math.sqrt(this.distanceSquared(e))}},{key:"distanceSquared",value:function(e){for(var t=0,i=0;i<this.ELEMENTS;++i){var s=this[i]-e[i];t+=s*s}return uk(t)}},{key:"dot",value:function(e){for(var t=0,i=0;i<this.ELEMENTS;++i)t+=this[i]*e[i];return uk(t)}},{key:"normalize",value:function(){var e=this.magnitude();if(0!==e)for(var t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}},{key:"multiply",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(var s=0,r=t;s<r.length;s++)for(var n=r[s],o=0;o<this.ELEMENTS;++o)this[o]*=n[o];return this.check()}},{key:"divide",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(var s=0,r=t;s<r.length;s++)for(var n=r[s],o=0;o<this.ELEMENTS;++o)this[o]/=n[o];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(e){return this.distance(e)}},{key:"distanceToSquared",value:function(e){return this.distanceSquared(e)}},{key:"getComponent",value:function(e){return ik(e>=0&&e<this.ELEMENTS,"index is out of range"),uk(this[e])}},{key:"setComponent",value:function(e,t){return ik(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}},{key:"addVectors",value:function(e,t){return this.copy(e).add(t)}},{key:"subVectors",value:function(e,t){return this.copy(e).subtract(t)}},{key:"multiplyVectors",value:function(e,t){return this.copy(e).multiply(t)}},{key:"addScaledVector",value:function(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}])}(),hk="undefined"!=typeof Float32Array?Float32Array:Array;function dk(e,t,i){var s=t[0],r=t[1],n=t[2];return e[0]=s*i[0]+r*i[3]+n*i[6],e[1]=s*i[1]+r*i[4]+n*i[7],e[2]=s*i[2]+r*i[5]+n*i[8],e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)}),function(){var e,t=(e=new hk(2),hk!=Float32Array&&(e[0]=0,e[1]=0),e)}(),function(){var e,t=(e=new hk(3),hk!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e)}();var pk,fk,vk=[0,0,0],gk=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return B(this,t),e=h(this,t,[-0,-0,-0]),1===arguments.length&&nk(i)?e.copy(i):(sk.debug&&(uk(i),uk(s),uk(r)),e[0]=i,e[1]=s,e[2]=r),e}return m(t,ck),w(t,[{key:"set",value:function(e,t,i){return this[0]=e,this[1]=t,this[2]=i,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}},{key:"fromObject",value:function(e){return sk.debug&&(uk(e.x),uk(e.y),uk(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=uk(e)}},{key:"angle",value:function(e){return function(e,t){var i=e[0],s=e[1],r=e[2],n=t[0],o=t[1],a=t[2],l=Math.sqrt(i*i+s*s+r*r)*Math.sqrt(n*n+o*o+a*a),u=l&&function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}(e,t)/l;return Math.acos(Math.min(Math.max(u,-1),1))}(this,e)}},{key:"cross",value:function(e){return function(e,t,i){var s=t[0],r=t[1],n=t[2],o=i[0],a=i[1],l=i[2];e[0]=r*l-n*a,e[1]=n*o-s*l,e[2]=s*a-r*o}(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,i=e.origin;return function(e,t,i,s){var r=[],n=[];r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],n[0]=r[0],n[1]=r[1]*Math.cos(s)-r[2]*Math.sin(s),n[2]=r[1]*Math.sin(s)+r[2]*Math.cos(s),e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2]}(this,this,void 0===i?vk:i,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,i=e.origin;return function(e,t,i,s){var r=[],n=[];r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],n[0]=r[2]*Math.sin(s)+r[0]*Math.cos(s),n[1]=r[1],n[2]=r[2]*Math.cos(s)-r[0]*Math.sin(s),e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2]}(this,this,void 0===i?vk:i,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,i=e.origin;return function(e,t,i,s){var r=[],n=[];r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],n[0]=r[0]*Math.cos(s)-r[1]*Math.sin(s),n[1]=r[0]*Math.sin(s)+r[1]*Math.cos(s),n[2]=r[2],e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2]}(this,this,void 0===i?vk:i,t),this.check()}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return function(e,t,i){var s=t[0],r=t[1],n=t[2],o=i[3]*s+i[7]*r+i[11]*n+i[15];o=o||1,e[0]=(i[0]*s+i[4]*r+i[8]*n+i[12])/o,e[1]=(i[1]*s+i[5]*r+i[9]*n+i[13])/o,e[2]=(i[2]*s+i[6]*r+i[10]*n+i[14])/o}(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return function(e,t,i){var s=t[0],r=t[1],n=t[2],o=i[3]*s+i[7]*r+i[11]*n||1;e[0]=(i[0]*s+i[4]*r+i[8]*n)/o,e[1]=(i[1]*s+i[5]*r+i[9]*n)/o,e[2]=(i[2]*s+i[6]*r+i[10]*n)/o}(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return dk(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,i){var s=t[0],r=t[1];e[0]=i[0]*s+i[2]*r,e[1]=i[1]*s+i[3]*r,e[2]=t[2]}(this,this,e),this.check()}},{key:"transformByQuaternion",value:function(e){return function(e,t,i){var s=i[0],r=i[1],n=i[2],o=i[3],a=t[0],l=t[1],u=t[2],A=r*u-n*l,c=n*a-s*u,h=s*l-r*a,d=r*h-n*c,p=n*A-s*h,f=s*c-r*A,v=2*o;A*=v,c*=v,h*=v,d*=2,p*=2,f*=2,e[0]=a+A+d,e[1]=l+c+p,e[2]=u+h+f}(this,this,e),this.check()}}],[{key:"ZERO",get:function(){return pk||(pk=new t(0,0,0),Object.freeze(pk)),pk}}])}(),mk=function(e){function t(){return B(this,t),h(this,t,arguments)}return m(t,lk),w(t,[{key:"toString",value:function(){var e="[";if(sk.printRowMajor){e+="row-major:";for(var t=0;t<this.RANK;++t)for(var i=0;i<this.RANK;++i)e+=" ".concat(this[i*this.RANK+t])}else{e+="column-major:";for(var s=0;s<this.ELEMENTS;++s)e+=" ".concat(this[s])}return e+="]"}},{key:"getElementIndex",value:function(e,t){return t*this.RANK+e}},{key:"getElement",value:function(e,t){return this[t*this.RANK+e]}},{key:"setElement",value:function(e,t,i){return this[t*this.RANK+e]=uk(i),this}},{key:"getColumn",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),i=e*this.RANK,s=0;s<this.RANK;++s)t[s]=this[i+s];return t}},{key:"setColumn",value:function(e,t){for(var i=e*this.RANK,s=0;s<this.RANK;++s)this[i+s]=t[s];return this}}])}();function _k(e,t,i){var s=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],u=t[6],A=t[7],c=t[8],h=i[0],d=i[1],p=i[2],f=i[3],v=i[4],g=i[5],m=i[6],_=i[7],y=i[8];return e[0]=h*s+d*o+p*u,e[1]=h*r+d*a+p*A,e[2]=h*n+d*l+p*c,e[3]=f*s+v*o+g*u,e[4]=f*r+v*a+g*A,e[5]=f*n+v*l+g*c,e[6]=m*s+_*o+y*u,e[7]=m*r+_*a+y*A,e[8]=m*n+_*l+y*c,e}function yk(e,t,i){var s=i[0],r=i[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}!function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"}(fk||(fk={}));var bk,Bk,xk=Object.freeze([1,0,0,0,1,0,0,0,1]),wk=function(e){function t(e){for(var i,s=arguments.length,r=new Array(s>1?s-1:0),n=1;n<s;n++)r[n-1]=arguments[n];return B(this,t),i=h(this,t,[-0,-0,-0,-0,-0,-0,-0,-0,-0]),1===arguments.length&&Array.isArray(e)?i.copy(e):r.length>0?i.copy([e].concat(r)):i.identity(),i}return m(t,mk),w(t,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return fk}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}},{key:"identity",value:function(){return this.copy(xk)}},{key:"fromObject",value:function(e){return this.check()}},{key:"fromQuaternion",value:function(e){return function(e,t){var i=t[0],s=t[1],r=t[2],n=t[3],o=i+i,a=s+s,l=r+r,u=i*o,A=s*o,c=s*a,h=r*o,d=r*a,p=r*l,f=n*o,v=n*a,g=n*l;e[0]=1-c-p,e[3]=A-g,e[6]=h+v,e[1]=A+g,e[4]=1-u-p,e[7]=d-f,e[2]=h-v,e[5]=d+f,e[8]=1-u-c}(this,e),this.check()}},{key:"set",value:function(e,t,i,s,r,n,o,a,l){return this[0]=e,this[1]=t,this[2]=i,this[3]=s,this[4]=r,this[5]=n,this[6]=o,this[7]=a,this[8]=l,this.check()}},{key:"setRowMajor",value:function(e,t,i,s,r,n,o,a,l){return this[0]=e,this[1]=s,this[2]=o,this[3]=t,this[4]=r,this[5]=a,this[6]=i,this[7]=n,this[8]=l,this.check()}},{key:"determinant",value:function(){return function(e){var t=e[0],i=e[1],s=e[2],r=e[3],n=e[4],o=e[5],a=e[6],l=e[7],u=e[8];return t*(u*n-o*l)+i*(-u*r+o*a)+s*(l*r-n*a)}(this)}},{key:"transpose",value:function(){return function(e,t){if(e===t){var i=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=i,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],a=t[5],l=t[6],u=t[7],A=t[8],c=A*o-a*u,h=-A*n+a*l,d=u*n-o*l,p=i*c+s*h+r*d;p&&(p=1/p,e[0]=c*p,e[1]=(-A*s+r*u)*p,e[2]=(a*s-r*o)*p,e[3]=h*p,e[4]=(A*i-r*l)*p,e[5]=(-a*i+r*n)*p,e[6]=d*p,e[7]=(-u*i+s*l)*p,e[8]=(o*i-s*n)*p)}(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return _k(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return _k(this,this,e),this.check()}},{key:"rotate",value:function(e){return function(e,t,i){var s=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],u=t[6],A=t[7],c=t[8],h=Math.sin(i),d=Math.cos(i);e[0]=d*s+h*o,e[1]=d*r+h*a,e[2]=d*n+h*l,e[3]=d*o-h*s,e[4]=d*a-h*r,e[5]=d*l-h*n,e[6]=u,e[7]=A,e[8]=c}(this,this,e),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?yk(this,this,e):yk(this,this,[e,e]),this.check()}},{key:"translate",value:function(e){return function(e,t,i){var s=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],u=t[6],A=t[7],c=t[8],h=i[0],d=i[1];e[0]=s,e[1]=r,e[2]=n,e[3]=o,e[4]=a,e[5]=l,e[6]=h*s+d*o+u,e[7]=h*r+d*a+A,e[8]=h*n+d*l+c}(this,this,e),this.check()}},{key:"transform",value:function(e,t){var i;switch(e.length){case 2:i=function(e,t,i){var s=t[0],r=t[1];return e[0]=i[0]*s+i[3]*r+i[6],e[1]=i[1]*s+i[4]*r+i[7],e}(t||[-0,-0],e,this);break;case 3:i=dk(t||[-0,-0,-0],e,this);break;case 4:i=function(e,t,i){var s=t[0],r=t[1],n=t[2];return e[0]=i[0]*s+i[3]*r+i[6]*n,e[1]=i[1]*s+i[4]*r+i[7]*n,e[2]=i[2]*s+i[5]*r+i[8]*n,e[3]=t[3],e}(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ak(i,e.length),i}},{key:"transformVector",value:function(e,t){return this.transform(e,t)}},{key:"transformVector2",value:function(e,t){return this.transform(e,t)}},{key:"transformVector3",value:function(e,t){return this.transform(e,t)}}],[{key:"IDENTITY",get:function(){return Ck()}},{key:"ZERO",get:function(){return Pk()}}])}();function Pk(){return bk||(bk=new wk([0,0,0,0,0,0,0,0,0]),Object.freeze(bk)),bk}function Ck(){return Bk||(Bk=new wk,Object.freeze(Bk)),Bk}var Mk={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},kk={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Fk="KHR_texture_transform",Ek=Fk,Dk=new gk,Ik=new wk,Sk=new wk;function Tk(){return(Tk=o(r().mark((function e(t,i){var s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=new gC(t),s.getExtension(Fk)){e.next=4;break}return e.abrupt("return");case 4:for(n=t.json.materials||[],o=0;o<n.length;o++)Lk(o,t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Lk(e,t){var i,s,r,n=[],o=null===(i=t.json.materials)||void 0===i?void 0:i[e],a=null==o||null===(s=o.pbrMetallicRoughness)||void 0===s?void 0:s.baseColorTexture;a&&Rk(t,e,a,n);var l=null==o?void 0:o.emissiveTexture;l&&Rk(t,e,l,n);var u=null==o?void 0:o.normalTexture;u&&Rk(t,e,u,n);var A=null==o?void 0:o.occlusionTexture;A&&Rk(t,e,A,n);var c=null==o||null===(r=o.pbrMetallicRoughness)||void 0===r?void 0:r.metallicRoughnessTexture;c&&Rk(t,e,c,n)}function Rk(e,t,i,s){var r=function(e,t){var i,s=null===(i=e.extensions)||void 0===i?void 0:i[Fk],r=e.texCoord,n=void 0===r?0:r,o=s.texCoord,a=void 0===o?n:o,l=-1!==t.findIndex((function(e){var t=u(e,2),i=t[0],s=t[1];return i===n&&s===a}));if(!l){var A=function(e){var t=e.offset,i=void 0===t?[0,0]:t,s=e.rotation,r=void 0===s?0:s,n=e.scale,o=void 0===n?[1,1]:n,a=(new wk).set(1,0,0,0,1,0,i[0],i[1],1),l=Ik.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),u=Sk.set(o[0],0,0,0,o[1],0,0,0,1);return a.multiplyRight(l).multiplyRight(u)}(s);return n!==a&&(e.texCoord=a),t.push([n,a]),{originalTexCoord:n,texCoord:a,matrix:A}}return null}(i,s);if(r){var n,o=l(e.json.meshes||[]);try{for(o.s();!(n=o.n()).done;){var a,A=l(n.value.primitives);try{for(A.s();!(a=A.n()).done;){var c=a.value,h=c.material;Number.isFinite(h)&&t===h&&Uk(e,c,r)}}catch(e){A.e(e)}finally{A.f()}}}catch(e){o.e(e)}finally{o.f()}}}function Uk(e,t,i){var s=i.originalTexCoord,r=i.texCoord,n=i.matrix,o=t.attributes["TEXCOORD_".concat(s)];if(Number.isFinite(o)){var a,l=null===(a=e.json.accessors)||void 0===a?void 0:a[o];if(l&&l.bufferView){var u,A=null===(u=e.json.bufferViews)||void 0===u?void 0:u[l.bufferView];if(A){for(var c=e.buffers[A.buffer],h=c.arrayBuffer,d=(c.byteOffset||0)+(l.byteOffset||0)+(A.byteOffset||0),p=pC(l,A),f=p.ArrayType,v=p.length,g=kk[l.componentType],m=Mk[l.type],_=A.byteStride||g*m,y=new Float32Array(v),b=0;b<l.count;b++){var B=new f(h,d+b*_,2);Dk.set(B[0],B[1],1),Dk.transformByMatrix3(n),y.set([Dk[0],Dk[1]],b*m)}s===r?function(e,t,i,s){e.componentType=5126,i.push({arrayBuffer:s.buffer,byteOffset:0,byteLength:s.buffer.byteLength}),t.buffer=i.length-1,t.byteLength=s.buffer.byteLength,t.byteOffset=0,delete t.byteStride}(l,A,e.buffers,y):function(e,t,i,s,r){s.buffers.push({arrayBuffer:r.buffer,byteOffset:0,byteLength:r.buffer.byteLength});var n=s.json.bufferViews;if(!n)return;n.push({buffer:s.buffers.length-1,byteLength:r.buffer.byteLength,byteOffset:0});var o=s.json.accessors;if(!o)return;o.push({bufferView:(null==n?void 0:n.length)-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),i.attributes["TEXCOORD_".concat(e)]=o.length-1}(r,l,t,e,y)}}}}var Ok=Object.freeze({__proto__:null,name:Ek,decode:function(e,t){return Tk.apply(this,arguments)}}),Qk="KHR_lights_punctual",Nk=Qk;function Vk(){return(Vk=o(r().mark((function e(t){var i,s,n,o,a,u,A;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=new gC(t),s=i.json,(n=i.getExtension(Qk))&&(i.json.lights=n.lights,i.removeExtension(Qk)),o=l(s.nodes||[]);try{for(o.s();!(a=o.n()).done;)u=a.value,(A=i.getObjectExtension(u,Qk))&&(u.light=A.light),i.removeObjectExtension(u,Qk)}catch(e){o.e(e)}finally{o.f()}case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Hk(){return(Hk=o(r().mark((function e(t){var i,s,n,o,a,u,A;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=new gC(t),(s=i.json).lights&&(sC(!(n=i.addExtension(Qk)).lights),n.lights=s.lights,delete s.lights),i.json.lights){o=l(i.json.lights);try{for(o.s();!(a=o.n()).done;)u=a.value,A=u.node,i.addObjectExtension(A,Qk,u)}catch(e){o.e(e)}finally{o.f()}delete i.json.lights}case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jk="KHR_materials_unlit",Gk=jk;function zk(){return(zk=o(r().mark((function e(t){var i,s,n,o,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=new gC(t),s=i.json,n=l(s.materials||[]);try{for(n.s();!(o=n.n()).done;)a=o.value,a.extensions&&a.extensions.KHR_materials_unlit&&(a.unlit=!0),i.removeObjectExtension(a,jk)}catch(e){n.e(e)}finally{n.f()}i.removeExtension(jk);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Wk="KHR_techniques_webgl",Kk=Wk;function Xk(){return(Xk=o(r().mark((function e(t){var i,s,n,o,a,u,A,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=new gC(t),s=i.json,n=i.getExtension(Wk)){o=Jk(n,i),a=l(s.materials||[]);try{for(a.s();!(u=a.n()).done;)A=u.value,(c=i.getObjectExtension(A,Wk))&&(A.technique=Object.assign({},c,o[c.technique]),A.technique.values=Zk(A.technique,i)),i.removeObjectExtension(A,Wk)}catch(e){a.e(e)}finally{a.f()}i.removeExtension(Wk)}case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yk(){return(Yk=o(r().mark((function e(t,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Jk(e,t){var i=e.programs,s=void 0===i?[]:i,r=e.shaders,n=void 0===r?[]:r,o=e.techniques,a=void 0===o?[]:o,l=new TextDecoder;return n.forEach((function(e){if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=l.decode(t.getTypedArrayForBufferView(e.bufferView))})),s.forEach((function(e){e.fragmentShader=n[e.fragmentShader],e.vertexShader=n[e.vertexShader]})),a.forEach((function(e){e.program=s[e.program]})),a}function Zk(e,t){var i=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach((function(t){e.uniforms[t].value&&!(t in i)&&(i[t]=e.uniforms[t].value)})),Object.keys(i).forEach((function(e){"object"===b(i[e])&&void 0!==i[e].index&&(i[e].texture=t.getTexture(i[e].index))})),i}var qk="EXT_feature_metadata",$k=qk;function eF(){return(eF=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:tF(new gC(t));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tF(e){var t,i=e.getExtension(qk),s=null==i||null===(t=i.schema)||void 0===t?void 0:t.classes,r=null==i?void 0:i.featureTables;if((null==i?void 0:i.featureTextures)&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.'),s&&r)for(var n in s){var o=s[n],a=rF(r,n);a&&iF(e,a,o)}}function iF(e,t,i){for(var s in i.properties){var r,n=i.properties[s],o=null==t||null===(r=t.properties)||void 0===r?void 0:r[s],a=t.count;if(o){var l=sF(e,n,a,o);o.data=l}}}function sF(e,t,i,s){var r=s.bufferView,n=e.getTypedArrayForBufferView(r);if("STRING"===t.type){var o=s.stringOffsetBufferView;n=function(e,t,i){for(var s=[],r=new TextDecoder("utf8"),n=0,o=4,a=0;a<i;a++){var l=t[(a+1)*o]-t[a*o],u=e.subarray(n,l+n),A=r.decode(u);s.push(A),n+=l}return s}(n,e.getTypedArrayForBufferView(o),i)}return n}function rF(e,t){for(var i in e){var s=e[i];if(s.class===t)return s}return null}var nF=[UC,NC,jC,tk,Object.freeze({__proto__:null,name:Nk,decode:function(e){return Vk.apply(this,arguments)},encode:function(e){return Hk.apply(this,arguments)}}),Object.freeze({__proto__:null,name:Gk,decode:function(e){return zk.apply(this,arguments)},encode:function(e){var t=new gC(e),i=t.json;if(t.materials){var s,r=l(i.materials||[]);try{for(r.s();!(s=r.n()).done;){var n=s.value;n.unlit&&(delete n.unlit,t.addObjectExtension(n,jk,{}),t.addExtension(jk))}}catch(e){r.e(e)}finally{r.f()}}}}),Object.freeze({__proto__:null,name:Kk,decode:function(e){return Xk.apply(this,arguments)},encode:function(e,t){return Yk.apply(this,arguments)}}),Ok,Object.freeze({__proto__:null,name:$k,decode:function(e){return eF.apply(this,arguments)}})];function oF(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,r=nF.filter((function(e){return uF(e.name,i)})),n=l(r);try{for(n.s();!(t=n.n()).done;){var o,a=t.value;null===(o=a.preprocess)||void 0===o||o.call(a,e,i,s)}}catch(e){n.e(e)}finally{n.f()}}function aF(e){return lF.apply(this,arguments)}function lF(){return lF=o(r().mark((function e(t){var i,s,n,o,a,u,A,c=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=c.length>1&&void 0!==c[1]?c[1]:{},s=c.length>2?c[2]:void 0,n=nF.filter((function(e){return uF(e.name,i)})),o=l(n),e.prev=4,o.s();case 6:if((a=o.n()).done){e.next=12;break}return u=a.value,e.next=10,null===(A=u.decode)||void 0===A?void 0:A.call(u,t,i,s);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),o.e(e.t0);case 17:return e.prev=17,o.f(),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,14,17,20]])}))),lF.apply(this,arguments)}function uF(e,t){var i,s=(null==t||null===(i=t.gltf)||void 0===i?void 0:i.excludeExtensions)||{};return!(e in s&&!s[e])}var AF="KHR_binary_glTF";var cF={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},hF={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},dF=function(){return w((function e(){B(this,e),Wb(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),Wb(this,"json",void 0)}),[{key:"normalize",value:function(e,t){this.json=e.json;var i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(i.asset.version))}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(e){var t,i=new gC(e),s=i.json,r=l(s.images||[]);try{for(r.s();!(t=r.n()).done;){var n=t.value,o=i.getObjectExtension(n,AF);o&&Object.assign(n,o),i.removeObjectExtension(n,AF)}}catch(e){r.e(e)}finally{r.f()}s.buffers&&s.buffers[0]&&delete s.buffers[0].uri,i.removeExtension(AF)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}},{key:"_addAsset",value:function(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(e){for(var t in cF)this._convertTopLevelObjectToArray(e,t)}},{key:"_convertTopLevelObjectToArray",value:function(e,t){var i=e[t];if(i&&!Array.isArray(i))for(var s in e[t]=[],i){var r=i[s];r.id=r.id||s;var n=e[t].length;e[t].push(r),this.idToIndexMap[t][s]=n}}},{key:"_convertObjectIdsToArrayIndices",value:function(e){for(var t in cF)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));var i,s=l(e.textures);try{for(s.s();!(i=s.n()).done;){var r=i.value;this._convertTextureIds(r)}}catch(e){s.e(e)}finally{s.f()}var n,o=l(e.meshes);try{for(o.s();!(n=o.n()).done;){var a=n.value;this._convertMeshIds(a)}}catch(e){o.e(e)}finally{o.f()}var u,A=l(e.nodes);try{for(A.s();!(u=A.n()).done;){var c=u.value;this._convertNodeIds(c)}}catch(e){A.e(e)}finally{A.f()}var h,d=l(e.scenes);try{for(d.s();!(h=d.n()).done;){var p=h.value;this._convertSceneIds(p)}}catch(e){d.e(e)}finally{d.f()}}},{key:"_convertTextureIds",value:function(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}},{key:"_convertMeshIds",value:function(e){var t,i=l(e.primitives);try{for(i.s();!(t=i.n()).done;){var s=t.value,r=s.attributes,n=s.indices,o=s.material;for(var a in r)r[a]=this._convertIdToIndex(r[a],"accessor");n&&(s.indices=this._convertIdToIndex(n,"accessor")),o&&(s.material=this._convertIdToIndex(o,"material"))}}catch(e){i.e(e)}finally{i.f()}}},{key:"_convertNodeIds",value:function(e){var t=this;e.children&&(e.children=e.children.map((function(e){return t._convertIdToIndex(e,"node")}))),e.meshes&&(e.meshes=e.meshes.map((function(e){return t._convertIdToIndex(e,"mesh")})))}},{key:"_convertSceneIds",value:function(e){var t=this;e.nodes&&(e.nodes=e.nodes.map((function(e){return t._convertIdToIndex(e,"node")})))}},{key:"_convertIdsToIndices",value:function(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);var i,s=l(e[t]);try{for(s.s();!(i=s.n()).done;){var r=i.value;for(var n in r){var o=r[n],a=this._convertIdToIndex(o,n);r[n]=a}}}catch(e){s.e(e)}finally{s.f()}}},{key:"_convertIdToIndex",value:function(e,t){var i=hF[t];if(i in this.idToIndexMap){var s=this.idToIndexMap[i][e];if(!Number.isFinite(s))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return s}return e}},{key:"_updateObjects",value:function(e){var t,i=l(this.json.buffers);try{for(i.s();!(t=i.n()).done;){delete t.value.type}}catch(e){i.e(e)}finally{i.f()}}},{key:"_updateMaterial",value:function(e){var t,i=l(e.materials);try{var s,r,n,o=function(){var i=t.value;i.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var o=(null===(s=i.values)||void 0===s?void 0:s.tex)||(null===(r=i.values)||void 0===r?void 0:r.texture2d_0)||(null===(n=i.values)||void 0===n?void 0:n.diffuseTex),a=e.textures.findIndex((function(e){return e.id===o}));-1!==a&&(i.pbrMetallicRoughness.baseColorTexture={index:a})};for(i.s();!(t=i.n()).done;)o()}catch(e){i.e(e)}finally{i.f()}}}])}();function pF(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new dF).normalize(e,t)}var fF={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},vF={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},gF=10240,mF=10241,_F=10242,yF=10243,bF=10497,BF=9986,xF={magFilter:gF,minFilter:mF,wrapS:_F,wrapT:yF},wF=y(y(y(y({},gF,9729),mF,BF),_F,bF),yF,bF);var PF=function(){return w((function e(){B(this,e),Wb(this,"baseUri",""),Wb(this,"json",{}),Wb(this,"buffers",[]),Wb(this,"images",[])}),[{key:"postProcess",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.json,s=e.buffers,r=void 0===s?[]:s,n=e.images,o=void 0===n?[]:n,a=e.baseUri,l=void 0===a?"":a;return sC(i),this.baseUri=l,this.json=i,this.buffers=r,this.images=o,this._resolveTree(this.json,t),this.json}},{key:"_resolveTree",value:function(e){var t=this;e.bufferViews&&(e.bufferViews=e.bufferViews.map((function(e,i){return t._resolveBufferView(e,i)}))),e.images&&(e.images=e.images.map((function(e,i){return t._resolveImage(e,i)}))),e.samplers&&(e.samplers=e.samplers.map((function(e,i){return t._resolveSampler(e,i)}))),e.textures&&(e.textures=e.textures.map((function(e,i){return t._resolveTexture(e,i)}))),e.accessors&&(e.accessors=e.accessors.map((function(e,i){return t._resolveAccessor(e,i)}))),e.materials&&(e.materials=e.materials.map((function(e,i){return t._resolveMaterial(e,i)}))),e.meshes&&(e.meshes=e.meshes.map((function(e,i){return t._resolveMesh(e,i)}))),e.nodes&&(e.nodes=e.nodes.map((function(e,i){return t._resolveNode(e,i)}))),e.skins&&(e.skins=e.skins.map((function(e,i){return t._resolveSkin(e,i)}))),e.scenes&&(e.scenes=e.scenes.map((function(e,i){return t._resolveScene(e,i)}))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}},{key:"getScene",value:function(e){return this._get("scenes",e)}},{key:"getNode",value:function(e){return this._get("nodes",e)}},{key:"getSkin",value:function(e){return this._get("skins",e)}},{key:"getMesh",value:function(e){return this._get("meshes",e)}},{key:"getMaterial",value:function(e){return this._get("materials",e)}},{key:"getAccessor",value:function(e){return this._get("accessors",e)}},{key:"getCamera",value:function(e){return null}},{key:"getTexture",value:function(e){return this._get("textures",e)}},{key:"getSampler",value:function(e){return this._get("samplers",e)}},{key:"getImage",value:function(e){return this._get("images",e)}},{key:"getBufferView",value:function(e){return this._get("bufferViews",e)}},{key:"getBuffer",value:function(e){return this._get("buffers",e)}},{key:"_get",value:function(e,t){if("object"===b(t))return t;var i=this.json[e]&&this.json[e][t];return i||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),i}},{key:"_resolveScene",value:function(e,t){var i=this;return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map((function(e){return i.getNode(e)})),e}},{key:"_resolveNode",value:function(e,t){var i=this;return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map((function(e){return i.getNode(e)}))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((function(e,t){var s=i.getMesh(t);return e.id=s.id,e.primitives=e.primitives.concat(s.primitives),e}),{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}},{key:"_resolveSkin",value:function(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}},{key:"_resolveMesh",value:function(e,t){var i=this;return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map((function(e){var t=(e=s({},e)).attributes;for(var r in e.attributes={},t)e.attributes[r]=i.getAccessor(t[r]);return void 0!==e.indices&&(e.indices=i.getAccessor(e.indices)),void 0!==e.material&&(e.material=i.getMaterial(e.material)),e}))),e}},{key:"_resolveMaterial",value:function(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture=s({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=s({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=s({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=s({},e.pbrMetallicRoughness);var i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=s({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=s({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}},{key:"_resolveAccessor",value:function(e,t){var i,s;if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(i=e.componentType,vF[i]),e.components=(s=e.type,fF[s]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var r=e.bufferView.buffer,n=pC(e,e.bufferView),o=n.ArrayType,a=n.byteLength,l=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+r.byteOffset,u=r.arrayBuffer.slice(l,l+a);e.bufferView.byteStride&&(u=this._getValueFromInterleavedBuffer(r,l,e.bufferView.byteStride,e.bytesPerElement,e.count)),e.value=new o(u)}return e}},{key:"_getValueFromInterleavedBuffer",value:function(e,t,i,s,r){for(var n=new Uint8Array(r*s),o=0;o<r;o++){var a=t+o*i;n.set(new Uint8Array(e.arrayBuffer.slice(a,a+s)),o*s)}return n.buffer}},{key:"_resolveTexture",value:function(e,t){return e.id=e.id||"texture-".concat(t),e.sampler="sampler"in e?this.getSampler(e.sampler):wF,e.source=this.getImage(e.source),e}},{key:"_resolveSampler",value:function(e,t){for(var i in e.id=e.id||"sampler-".concat(t),e.parameters={},e){var s=this._enumSamplerParameter(i);void 0!==s&&(e.parameters[s]=e[i])}return e}},{key:"_enumSamplerParameter",value:function(e){return xF[e]}},{key:"_resolveImage",value:function(e,t){e.id=e.id||"image-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));var i=this.images[t];return i&&(e.image=i),e}},{key:"_resolveBufferView",value:function(e,t){var i=e.buffer,r=s(s({id:"bufferView-".concat(t)},e),{},{buffer:this.buffers[i]}),n=this.buffers[i].arrayBuffer,o=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(o+=e.byteOffset),r.data=new Uint8Array(n,o,e.byteLength),r}},{key:"_resolveCamera",value:function(e,t){return e.id=e.id||"camera-".concat(t),e.perspective,e.orthographic,e}}])}();function CF(e,t){return(new PF).postProcess(e,t)}var MF=1735152710,kF=12,FF=8,EF=1313821514,DF=5130562,IF=0,SF=1,TF=0,LF=!0;function RF(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=new DataView(t),r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(e.getUint8(t+0))).concat(String.fromCharCode(e.getUint8(t+1))).concat(String.fromCharCode(e.getUint8(t+2))).concat(String.fromCharCode(e.getUint8(t+3)))}(s,i+0),n=s.getUint32(i+4,LF),o=s.getUint32(i+8,LF);switch(Object.assign(e,{header:{byteOffset:i,byteLength:o,hasBinChunk:!1},type:r,version:n,json:{},binChunks:[]}),i+=kF,e.version){case 1:return function(e,t,i){ZP(e.header.byteLength>kF+FF);var s=t.getUint32(i+0,LF),r=t.getUint32(i+4,LF);return i+=FF,ZP(r===TF),UF(e,t,i,s),i+=s,i+=OF(e,t,i,e.header.byteLength),i}(e,s,i);case 2:return function(e,t,i,s){return ZP(e.header.byteLength>kF+FF),function(e,t,i,s){for(;i+8<=e.header.byteLength;){var r=t.getUint32(i+0,LF),n=t.getUint32(i+4,LF);switch(i+=FF,n){case EF:UF(e,t,i,r);break;case DF:OF(e,t,i,r);break;case IF:s.strict||UF(e,t,i,r);break;case SF:s.strict||OF(e,t,i,r)}i+=tC(r,4)}}(e,t,i,s),i+e.header.byteLength}(e,s,i,{});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}function UF(e,t,i,s){var r=new Uint8Array(t.buffer,i,s),n=new TextDecoder("utf8").decode(r);return e.json=JSON.parse(n),tC(s,4)}function OF(e,t,i,s){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:i,byteLength:s,arrayBuffer:t.buffer}),tC(s,4)}function QF(e,t){return NF.apply(this,arguments)}function NF(){return NF=o(r().mark((function e(t,i){var s,n,o,a,l,u,A,c,h,d=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=d.length>4?d[4]:void 0,VF(t,i,d.length>2&&void 0!==d[2]?d[2]:0,l=d.length>3?d[3]:void 0),pF(t,{normalize:null==l||null===(s=l.gltf)||void 0===s?void 0:s.normalize}),oF(t,l,u),A=[],null==l||null===(n=l.gltf)||void 0===n||!n.loadBuffers||!t.json.buffers){e.next=10;break}return e.next=10,HF(t,l,u);case 10:return null!=l&&null!==(o=l.gltf)&&void 0!==o&&o.loadImages&&(c=GF(t,l,u),A.push(c)),h=aF(t,l,u),A.push(h),e.next=15,Promise.all(A);case 15:return e.abrupt("return",null!=l&&null!==(a=l.gltf)&&void 0!==a&&a.postProcess?CF(t,l):t);case 16:case"end":return e.stop()}}),e)}))),NF.apply(this,arguments)}function VF(e,t,i,s){(s.uri&&(e.baseUri=s.uri),t instanceof ArrayBuffer&&!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=new DataView(e),r=i.magic,n=void 0===r?MF:r,o=s.getUint32(t,!1);return o===n||o===MF}(t,i,s))&&(t=(new TextDecoder).decode(t));if("string"==typeof t)e.json=$P(t);else if(t instanceof ArrayBuffer){var r={};i=RF(r,t,i,s.glb),sC("glTF"===r.type,"Invalid GLB magic string ".concat(r.type)),e._glb=r,e.json=r.json}else sC(!1,"GLTF: must be ArrayBuffer or string");var n=e.json.buffers||[];if(e.buffers=new Array(n.length).fill(null),e._glb&&e._glb.header.hasBinChunk){var o=e._glb.binChunks;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}var a=e.json.images||[];e.images=new Array(a.length).fill({})}function HF(e,t,i){return jF.apply(this,arguments)}function jF(){return(jF=o(r().mark((function e(t,i,s){var n,o,a,l,u,A,c,h;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.json.buffers||[],o=0;case 2:if(!(o<n.length)){e.next=22;break}if(!(a=n[o]).uri){e.next=18;break}return sC(s.fetch),A=rC(a.uri,i),e.next=10,null==s||null===(l=s.fetch)||void 0===l?void 0:l.call(s,A);case 10:return c=e.sent,e.next=13,null==c||null===(u=c.arrayBuffer)||void 0===u?void 0:u.call(c);case 13:h=e.sent,t.buffers[o]={arrayBuffer:h,byteOffset:0,byteLength:h.byteLength},delete a.uri,e.next=19;break;case 18:null===t.buffers[o]&&(t.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength});case 19:++o,e.next=2;break;case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function GF(e,t,i){return zF.apply(this,arguments)}function zF(){return(zF=o(r().mark((function e(t,i,s){var n,o,a,u,A,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=WF(t),o=t.json.images||[],a=[],u=l(n);try{for(u.s();!(A=u.n()).done;)c=A.value,a.push(KF(t,o[c],c,i,s))}catch(e){u.e(e)}finally{u.f()}return e.next=7,Promise.all(a);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function WF(e){var t,i=new Set,s=l(e.json.textures||[]);try{for(s.s();!(t=s.n()).done;){var r=t.value;void 0!==r.source&&i.add(r.source)}}catch(e){s.e(e)}finally{s.f()}return Array.from(i).sort()}function KF(e,t,i,s,r){return XF.apply(this,arguments)}function XF(){return XF=o(r().mark((function e(t,i,s,n,o){var a,l,u,A,c,h,d;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=o.fetch,l=o.parse,!i.uri||i.hasOwnProperty("bufferView")){e.next=10;break}return A=rC(i.uri,n),e.next=5,a(A);case 5:return c=e.sent,e.next=8,c.arrayBuffer();case 8:u=e.sent,i.bufferView={data:u};case 10:return Number.isFinite(i.bufferView)&&(h=nC(t.json,t.buffers,i.bufferView),u=eC(h.buffer,h.byteOffset,h.byteLength)),sC(u,"glTF image has no data"),e.next=14,l(u,[XP,hP],{mimeType:i.mimeType,basis:n.basis||{format:cP()}},o);case 14:(d=e.sent)&&d[0]&&(d={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d[0]}),t.images=t.images||[],t.images[s]=d;case 18:case"end":return e.stop()}}),e)}))),XF.apply(this,arguments)}var YF={name:"glTF",id:"gltf",module:"gltf",version:"3.4.15",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:function(e){return JF.apply(this,arguments)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};function JF(){return JF=o(r().mark((function e(t){var i,n,o,a,l,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2?u[2]:void 0,(i=s(s({},YF.options),i)).gltf=s(s({},YF.options.gltf),i.gltf),o=i.byteOffset,a=void 0===o?0:o,l={},e.next=8,QF(l,t,a,i,n);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)}))),JF.apply(this,arguments)}var ZF=function(){return w((function e(t){B(this,e)}),[{key:"load",value:function(e,t,i,s,r,n,o){!function(e,t,i,s,r,n,o){var a=e.viewer.scene.canvas.spinner;a.processes++;var l="glb"===t.split(".").pop();l?e.dataSource.getGLB(t,(function(o){s.basePath=qF(t),$F(e,t,o,i,s,r,n),a.processes--}),(function(e){a.processes--,o(e)})):e.dataSource.getGLTF(t,(function(o){s.basePath=qF(t),$F(e,t,o,i,s,r,n),a.processes--}),(function(e){a.processes--,o(e)}))}(e,t,i,s=s||{},r,(function(){pe.scheduleTask((function(){r.scene.fire("modelLoaded",r.id),r.fire("loaded",!0,!1)})),n&&n()}),(function(t){e.error(t),o&&o(t),r.fire("error",t)}))}},{key:"parse",value:function(e,t,i,s,r,n,o){$F(e,"",t,i,s=s||{},r,(function(){r.scene.fire("modelLoaded",r.id),r.fire("loaded",!0,!1),n&&n()}))}}])}();function qF(e){var t=e.lastIndexOf("/");return 0!==t?e.substring(0,t+1):""}function $F(e,t,i,s,r,n,o){var a=e.viewer.scene.canvas.spinner;a.processes++,iw(i,YF,{baseUri:r.basePath}).then((function(i){var l={src:t,entityId:r.entityId,metaModelJSON:s,autoMetaModel:r.autoMetaModel,globalizeObjectIds:r.globalizeObjectIds,metaObjects:[],loadBuffer:r.loadBuffer,basePath:r.basePath,handlenode:r.handlenode,backfaces:!!r.backfaces,gltfData:i,scene:n.scene,plugin:e,sceneModel:n,numObjects:0,nodes:[],nextId:0,log:function(t){e.log(t)}};!function(e){var t=e.gltfData,i=t.textures;if(i)for(var s=0,r=i.length;s<r;s++)eE(e,i[s])}(l),function(e){var t=e.gltfData,i=t.materials;if(i)for(var s=0,r=i.length;s<r;s++){var n=i[s];n._textureSetId=tE(e,n),n._attributes=iE(e,n)}}(l),r.autoMetaModel&&l.metaObjects.push({id:n.id,type:"Default",name:n.id}),function(e){var t=e.gltfData,i=t.scene||t.scenes[0];if(!i)return void function(e,t){e.plugin.error(t)}(e,"glTF has no default scene");var s=i.nodes;if(!s)return;!function e(t){t.forEach((function(t){var i=t.mesh;i&&(i.instances||(i.instances=0),i.instances+=1),t.children&&e(t.children)}))}(s);var r=[],n=null;!function t(i,s,o){i.forEach((function(i){var a=i.name,l=null!=a&&a||0===s&&"entity-"+e.nextId++;if(l){for(;e.sceneModel.objects[l];)l="entity-"+e.nextId++;r.push(n),n=[]}var u=function(e,t){var i;e.matrix&&(i=e.matrix,t=t?J.mulMat4(t,i,J.mat4()):i);e.translation&&(i=J.translationMat4v(e.translation),t=t?J.mulMat4(t,i,J.mat4()):i);e.rotation&&(i=J.quaternionToMat4(e.rotation),t=t?J.mulMat4(t,i,J.mat4()):i);e.scale&&(i=J.scalingMat4v(e.scale),t=t?J.mulMat4(t,i,J.mat4()):i);return t}(i,o);if(i.mesh&&function(e,t,i,s){var r=e.mesh;if(!r)return;var n=r.primitives.length;if(n>0)for(var o=0;o<n;o++){var a=r.primitives[o];if(!(a.mode<4)){var l={id:t.sceneModel.id+"."+t.numObjects++},u=a.material;u?(l.textureSetId=u._textureSetId,l.color=u._attributes.color,l.opacity=u._attributes.opacity,l.metallic=u._attributes.metallic,l.roughness=u._attributes.roughness):(l.color=new Float32Array([1,1,1]),l.opacity=1);var A=!1!==t.backfaces||u&&!1!==u.doubleSided;switch(a.mode){case 0:l.primitive="points";break;case 1:case 2:case 3:l.primitive="lines";break;default:l.primitive=A?"triangles":"solid"}var c=a.attributes.POSITION;if(c){l.localPositions=c.value,l.positions=new Float64Array(l.localPositions.length),a.attributes.NORMAL&&(l.normals=a.attributes.NORMAL.value),a.attributes.TEXCOORD_0&&(l.uv=a.attributes.TEXCOORD_0.value),a.indices&&(l.indices=a.indices.value),i?J.transformPositions3(i,l.localPositions,l.positions):l.positions.set(l.localPositions);var h=J.vec3();we(l.positions,l.positions,h)&&(l.origin=h),t.sceneModel.createMesh(l),s.push(l.id)}}}}(i,e,u,n),i.children&&t(i.children,s+1,u),l){if(n.length>0){var A=e.globalizeObjectIds?J.globalizeObjectId(e.sceneModel.id,l):l;e.sceneModel.createEntity({id:A,meshIds:n,isObject:!0}),e.autoMetaModel&&e.metaObjects.push({id:A,type:"Default",name:A,parent:e.sceneModel.id})}n=r.pop()}}))}(s,0,null)}(l),n.finalize(),r.autoMetaModel&&e.viewer.metaScene.createMetaModel(n.id,{metaObjects:l.metaObjects}),a.processes--,o()}))}function eE(e,t){if(t.source&&t.source.image){var i="texture-".concat(e.nextId++),s=as;switch(t.sampler.minFilter){case 9728:s=ss;break;case 9729:s=ls;break;case 9984:s=rs;break;case 9985:s=As;break;case 9986:s=as;break;case 9987:s=hs}var r=ls;switch(t.sampler.magFilter){case 9728:r=ss;break;case 9729:r=ls}var n=es;switch(t.sampler.wrapS){case 33071:n=ts;break;case 33648:n=is;break;case 10497:n=es}var o=es;switch(t.sampler.wrapT){case 33071:o=ts;break;case 33648:o=is;break;case 10497:o=es}var a=es;switch(t.sampler.wrapR){case 33071:a=ts;break;case 33648:a=is;break;case 10497:a=es}e.sceneModel.createTexture({id:i,image:t.source.image,flipY:!!t.flipY,minFilter:s,magFilter:r,wrapS:n,wrapT:o,wrapR:a,encoding:ur}),t._textureId=i}}function tE(e,t){var i={};switch(t.normalTexture&&(i.normalTextureId=t.normalTexture.texture._textureId),t.occlusionTexture&&(i.occlusionTextureId=t.occlusionTexture.texture._textureId),t.emissiveTexture&&(i.emissiveTextureId=t.emissiveTexture.texture._textureId),t.alphaMode){case"OPAQUE":break;case"MASK":var s=t.alphaCutoff;i.alphaCutoff=void 0!==s?s:.5}var r=t.pbrMetallicRoughness;if(t.pbrMetallicRoughness){var n=t.pbrMetallicRoughness,o=n.baseColorTexture||n.colorTexture;o&&(o.texture?i.colorTextureId=o.texture._textureId:i.colorTextureId=e.gltfData.textures[o.index]._textureId),r.metallicRoughnessTexture&&(i.metallicRoughnessTextureId=r.metallicRoughnessTexture.texture._textureId)}var a=t.extensions;if(a){var l=a.KHR_materials_pbrSpecularGlossiness;if(l){l.specularTexture;var u=l.specularColorTexture;null!=u&&(i.colorTextureId=e.gltfData.textures[u.index]._textureId)}}return void 0!==i.normalTextureId||void 0!==i.occlusionTextureId||void 0!==i.emissiveTextureId||void 0!==i.colorTextureId||void 0!==i.metallicRoughnessTextureId?(i.id="textureSet-".concat(e.nextId++,";"),e.sceneModel.createTextureSet(i),i.id):null}function iE(e,t){var i=t.extensions,s={color:new Float32Array([1,1,1,1]),opacity:1,metallic:0,roughness:1,doubleSided:!0};if(i){var r=i.KHR_materials_pbrSpecularGlossiness;if(r){var n=r.diffuseFactor;null!=n&&s.color.set(n)}var o=i.KHR_materials_common;if(o){var a=o.technique,l=o.values||{},u="BLINN"===a,A="PHONG"===a,c="LAMBERT"===a,h=l.diffuse;h&&(u||A||c)&&(oe.isString(h)||s.color.set(h));var d=l.transparency;null!=d&&(s.opacity=d);var p=l.transparent;null!=p&&(s.opacity=p)}}var f=t.pbrMetallicRoughness;if(f){var v=f.baseColorFactor;v&&(s.color[0]=v[0],s.color[1]=v[1],s.color[2]=v[2],s.opacity=v[3]);var g=f.metallicFactor;null!=g&&(s.metallic=g);var m=f.roughnessFactor;null!=m&&(s.roughness=m)}return s.doubleSided=!1!==t.doubleSided,s}var sE={DEFAULT:{}},rE=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,["GLTFLoader",e,s]))._sceneModelLoader=new ZF(i,s),i.dataSource=s.dataSource,i.objectDefaults=s.objectDefaults,i}return m(t,me),w(t,[{key:"dataSource",get:function(){return this._dataSource},set:function(e){this._dataSource=e||new Rh}},{key:"objectDefaults",get:function(){return this._objectDefaults},set:function(e){this._objectDefaults=e||sE}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.id&&this.viewer.scene.components[t.id]&&(this.error("Component with this ID already exists in viewer: "+t.id+" - will autogenerate this ID"),delete t.id);var i=new vh(this.viewer.scene,oe.apply(t,{isModel:!0,dtxEnabled:t.dtxEnabled})),s=i.id;if(!t.src&&!t.gltf)return this.error("load() param expected: src or gltf"),i;if(t.metaModelSrc||t.metaModelJSON){var r=function(r){e.viewer.metaScene.createMetaModel(s,r,{}),e.viewer.scene.canvas.spinner.processes--,t.src?e._sceneModelLoader.load(e,t.src,r,t,i):e._sceneModelLoader.parse(e,t.gltf,r,t,i)};if(t.metaModelSrc){var n=t.metaModelSrc;this.viewer.scene.canvas.spinner.processes++,this._dataSource.getMetaModel(n,(function(t){e.viewer.scene.canvas.spinner.processes--,r(t)}),(function(t){e.error("load(): Failed to load model metadata for model '".concat(s," from '").concat(n,"' - ").concat(t)),e.viewer.scene.canvas.spinner.processes--}))}else t.metaModelJSON&&r(t.metaModelJSON)}else t.src?this._sceneModelLoader.load(this,t.src,null,t,i):this._sceneModelLoader.parse(this,t.gltf,null,t,i);return i.once("destroyed",(function(){e.viewer.metaScene.destroyMetaModel(s)})),i}},{key:"destroy",value:function(){f(t,"destroy",this,3)([])}}])}();function nE(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s="lightgrey",r=i.hoverColor||"rgba(60,120,125,0.3)",n=i.textColor||"rgba(15,75,80,0.8)",o=500,a=o+o/3,l=a/24,u=e.scene.camera.normalUp,A=[{boundary:[6,6,6,6],color:i.frontColor||i.color||"#55FF55"},{boundary:[18,6,6,6],color:i.backColor||i.color||"#55FF55"},{boundary:[12,6,6,6],color:i.rightColor||i.color||"#FF5555"},{boundary:[0,6,6,6],color:i.leftColor||i.color||"#FF5555"},{boundary:[6,0,6,6],color:i.topColor||i.color||"#7777FF"},{boundary:[6,12,6,6],color:i.bottomColor||i.color||"#7777FF"}],c=[{label:"NavCube.front",boundaries:[[7,7,4,4]],dir:[0,1,0],up:[0,0,1]},{label:"NavCube.back",boundaries:[[19,7,4,4]],dir:[0,-1,0],up:[0,0,1]},{label:"NavCube.right",boundaries:[[13,7,4,4]],dir:[-1,0,0],up:[0,0,1]},{label:"NavCube.left",boundaries:[[1,7,4,4]],dir:[1,0,0],up:[0,0,1]},{label:"NavCube.top",boundaries:[[7,1,4,4]],dir:[0,0,-1],up:[0,1,0]},{label:"NavCube.bottom",boundaries:[[7,13,4,4]],dir:[0,0,1],up:[0,-1,0]},{boundaries:[[7,5,4,2]],dir:[0,1,-1],up:[0,1,1]},{boundaries:[[1,6,4,1],[6,1,1,4]],dir:[1,0,-1],up:[1,0,1]},{boundaries:[[7,0,4,1],[19,6,4,1]],dir:[0,-1,-1],up:[0,-1,1]},{boundaries:[[13,6,4,1],[11,1,1,4]],dir:[-1,0,-1],up:[-1,0,1]},{boundaries:[[7,11,4,2]],dir:[0,1,1],up:[0,-1,1]},{boundaries:[[1,11,4,1],[6,13,1,4]],dir:[1,0,1],up:[-1,0,1]},{boundaries:[[7,17,4,1],[19,11,4,1]],dir:[0,-1,1],up:[0,1,1]},{boundaries:[[13,11,4,1],[11,13,1,4]],dir:[-1,0,1],up:[1,0,1]},{boundaries:[[5,7,2,4]],dir:[1,1,0],up:[0,0,1]},{boundaries:[[11,7,2,4]],dir:[-1,1,0],up:[0,0,1]},{boundaries:[[17,7,2,4]],dir:[-1,-1,0],up:[0,0,1]},{boundaries:[[0,7,1,4],[23,7,1,4]],dir:[1,-1,0],up:[0,0,1]},{boundaries:[[5,11,2,2]],dir:[1,1,1],up:[-1,-1,1]},{boundaries:[[23,11,1,1],[6,17,1,1],[0,11,1,1]],dir:[1,-1,1],up:[-1,1,1]},{boundaries:[[5,5,2,2]],dir:[1,1,-1],up:[1,1,1]},{boundaries:[[11,17,1,1],[17,11,2,1]],dir:[-1,-1,1],up:[1,1,1]},{boundaries:[[17,6,2,1],[11,0,1,1]],dir:[-1,-1,-1],up:[-1,-1,1]},{boundaries:[[11,11,2,2]],dir:[-1,1,1],up:[1,-1,1]},{boundaries:[[0,6,1,1],[6,0,1,1],[23,6,1,1]],dir:[1,-1,-1],up:[1,-1,1]},{boundaries:[[11,5,2,2]],dir:[-1,1,-1],up:[-1,1,1]}];i.frontColor||i.color,i.backColor||i.color,i.rightColor||i.color,i.leftColor||i.color,i.topColor||i.color,i.bottomColor||i.color;var h=[{areaId:0,label:"NavCube.front",boundaries:[[7,7,4,4]],dir:[0,0,-1],up:[0,1,0]},{areaId:1,label:"NavCube.back",boundaries:[[19,7,4,4]],dir:[0,0,1],up:[0,1,0]},{areaId:2,label:"NavCube.right",boundaries:[[13,7,4,4]],dir:[-1,0,0],up:[0,1,0]},{areaId:3,label:"NavCube.left",boundaries:[[1,7,4,4]],dir:[1,0,0],up:[0,1,0]},{areaId:4,label:"NavCube.top",boundaries:[[7,1,4,4]],dir:[0,-1,0],up:[0,0,-1]},{areaId:5,label:"NavCube.bottom",boundaries:[[7,13,4,4]],dir:[0,1,0],up:[0,0,1]},{areaId:6,boundaries:[[7,5,4,2]],dir:[0,-.7071,-.7071],up:[0,.7071,-.7071]},{areaId:7,boundaries:[[1,6,4,1],[6,1,1,4]],dir:[1,-1,0],up:[1,1,0]},{areaId:8,boundaries:[[7,0,4,1],[19,6,4,1]],dir:[0,-.7071,.7071],up:[0,.7071,.7071]},{areaId:9,boundaries:[[13,6,4,1],[11,1,1,4]],dir:[-1,-1,0],up:[-1,1,0]},{areaId:10,boundaries:[[7,11,4,2]],dir:[0,1,-1],up:[0,1,1]},{areaId:11,boundaries:[[1,11,4,1],[6,13,1,4]],dir:[1,1,0],up:[-1,1,0]},{areaId:12,boundaries:[[7,17,4,1],[19,11,4,1]],dir:[0,1,1],up:[0,1,-1]},{areaId:13,boundaries:[[13,11,4,1],[11,13,1,4]],dir:[-1,1,0],up:[1,1,0]},{areaId:14,boundaries:[[5,7,2,4]],dir:[1,0,-1],up:[0,1,0]},{areaId:15,boundaries:[[11,7,2,4]],dir:[-1,0,-1],up:[0,1,0]},{areaId:16,boundaries:[[17,7,2,4]],dir:[-1,0,1],up:[0,1,0]},{areaId:17,boundaries:[[0,7,1,4],[23,7,1,4]],dir:[1,0,1],up:[0,1,0]},{areaId:18,boundaries:[[5,11,2,2]],dir:[.5,.7071,-.5],up:[-.5,.7071,.5]},{areaId:19,boundaries:[[23,11,1,1],[6,17,1,1],[0,11,1,1]],dir:[.5,.7071,.5],up:[-.5,.7071,-.5]},{areaId:20,boundaries:[[5,5,2,2]],dir:[.5,-.7071,-.5],up:[.5,.7071,-.5]},{areaId:21,boundaries:[[11,17,1,1],[17,11,2,1]],dir:[-.5,.7071,.5],up:[.5,.7071,-.5]},{areaId:22,boundaries:[[17,6,2,1],[11,0,1,1]],dir:[-.5,-.7071,.5],up:[-.5,.7071,.5]},{areaId:23,boundaries:[[11,11,2,2]],dir:[-.5,.7071,-.5],up:[.5,.7071,.5]},{areaId:24,boundaries:[[0,6,1,1],[6,0,1,1],[23,6,1,1]],dir:[.5,-.7071,.5],up:[.5,.7071,.5]},{areaId:25,boundaries:[[11,5,2,2]],dir:[-.5,-.7071,-.5],up:[-.5,.7071,-.5]}],d=[{areaId:0,label:"NavCube.front",boundaries:[[7,7,4,4]],dir:[0,0,-1],up:[0,-1,0]},{areaId:1,label:"NavCube.back",boundaries:[[19,7,4,4]],dir:[0,0,1],up:[0,-1,0]},{areaId:2,label:"NavCube.right",boundaries:[[13,7,4,4]],dir:[1,0,0],up:[0,-1,0]},{areaId:3,label:"NavCube.left",boundaries:[[1,7,4,4]],dir:[-1,0,0],up:[0,-1,0]},{areaId:4,label:"NavCube.top",boundaries:[[7,1,4,4]],dir:[0,1,0],up:[0,0,-1]},{areaId:5,label:"NavCube.bottom",boundaries:[[7,13,4,4]],dir:[0,-1,0],up:[0,0,1]},{areaId:6,boundaries:[[7,5,4,2]],dir:[0,1,-1],up:[0,1,1]},{areaId:7,boundaries:[[1,6,4,1],[6,1,1,4]],dir:[-1,1,0],up:[1,1,0]},{areaId:8,boundaries:[[7,0,4,1],[19,6,4,1]],dir:[0,1,1],up:[0,1,-1]},{areaId:9,boundaries:[[13,6,4,1],[11,1,1,4]],dir:[1,1,0],up:[-1,1,0]},{areaId:10,boundaries:[[7,11,4,2]],dir:[0,-.7071,-.7071],up:[0,.7071,-.7071]},{areaId:11,boundaries:[[1,11,4,1],[6,13,1,4]],dir:[-1,-1,0],up:[-1,1,0]},{areaId:12,boundaries:[[7,17,4,1],[19,11,4,1]],dir:[0,-.7071,.7071],up:[0,.7071,.7071]},{areaId:13,boundaries:[[13,11,4,1],[11,13,1,4]],dir:[1,-1,0],up:[1,1,0]},{areaId:14,boundaries:[[5,7,2,4]],dir:[-1,0,-1],up:[0,1,0]},{areaId:15,boundaries:[[11,7,2,4]],dir:[1,0,-1],up:[0,1,0]},{areaId:16,boundaries:[[17,7,2,4]],dir:[1,0,1],up:[0,1,0]},{areaId:17,boundaries:[[0,7,1,4],[23,7,1,4]],dir:[-1,0,1],up:[0,1,0]},{areaId:18,boundaries:[[5,11,2,2]],dir:[-.5,-.7071,-.5],up:[-.5,.7071,-.5]},{areaId:19,boundaries:[[23,11,1,1],[6,17,1,1],[0,11,1,1]],dir:[-.5,-.7071,.5],up:[-.5,.7071,.5]},{areaId:20,boundaries:[[5,5,2,2]],dir:[-.5,.7071,-.5],up:[.5,.7071,.5]},{areaId:21,boundaries:[[11,17,1,1],[17,11,2,1]],dir:[.5,-.7071,.5],up:[.5,.7071,.5]},{areaId:22,boundaries:[[17,6,2,1],[11,0,1,1]],dir:[.5,.7071,.5],up:[-.5,.7071,-.5]},{areaId:23,boundaries:[[11,11,2,2]],dir:[.5,-.7071,-.5],up:[.5,.7071,-.5]},{areaId:24,boundaries:[[0,6,1,1],[6,0,1,1],[23,6,1,1]],dir:[-.5,.7071,.5],up:[.5,.7071,-.5]},{areaId:25,boundaries:[[11,5,2,2]],dir:[.5,.7071,-.5],up:[-.5,.7071,.5]}];d.forEach((function(e){e.areaId>5&&(e.up=[-1*e.up[0],-1*e.up[1],-1*e.up[2]])}));for(var p=u?h:d,f=0,v=c.length;f<v;f++)J.normalizeVec3(c[f].dir,c[f].dir),J.normalizeVec3(c[f].up,c[f].up);for(var g=0,m=p.length;g<m;g++)J.normalizeVec3(p[g].dir,p[g].dir),J.normalizeVec3(p[g].up,p[g].up);var _=p;this._textureCanvas=document.createElement("canvas"),this._textureCanvas.width=a,this._textureCanvas.height=o,this._textureCanvas.style.width=a+"px",this._textureCanvas.style.height=o+"px",this._textureCanvas.style.padding="0",this._textureCanvas.style.margin="0",this._textureCanvas.style.top="0",this._textureCanvas.style.background=s,this._textureCanvas.style.position="absolute",this._textureCanvas.style.opacity="1.0",this._textureCanvas.style.display="none",this._textureCanvas.style["z-index"]=-100,this._textureCanvas.setAttribute("id","myNavCubeRenderImage"),this.cubeParentDiv=document.createElement("div"),this.cubeParentDiv.setAttribute("id","myNavCubeRenderImage_parent"),this.cubeContainer=i.viewerElement,this.cubeParentDiv.appendChild(this._textureCanvas),this.cubeContainer.appendChild(this.cubeParentDiv);var y=this._textureCanvas.getContext("2d"),b=!1;function B(){for(var e=0,i=A.length;e<i;e++){var o=A[e],a=o.boundary,u=Math.round(a[0]*l),c=Math.round(a[1]*l),h=Math.round(a[2]*l),d=Math.round(a[3]*l);y.fillStyle=o.color,y.fillRect(u,c,h,d)}for(var p=0,f=_.length;p<f;p++){for(var v=void 0,g=void 0,m=void 0,b=void 0,B=_[p],x=B.boundaries,w=0,P=x.length;w<P;w++){var M=x[w];v=Math.round(M[0]*l),g=Math.round(M[1]*l),m=Math.round(M[2]*l),b=Math.round(M[3]*l),B.highlighted&&(y.fillStyle=B.highlighted?r:B.color||s,y.fillRect(v,g,m,b))}if(B.label){y.fillStyle=n,y.font="60px sans-serif",y.textAlign="center";var k=v+.5*m,F=g+.7*b;y.fillText(C(B.label),k,F,80)}}t.glRedraw()}var x,w,P,C=(x={"NavCube.front":"NavCube.front","NavCube.back":"NavCube.back","NavCube.right":"NavCube.right","NavCube.left":"NavCube.left","NavCube.top":"NavCube.top","NavCube.bottom":"NavCube.bottom"},w={"NavCube.front":"NavCube.front","NavCube.back":"NavCube.back","NavCube.right":"NavCube.right","NavCube.left":"NavCube.left","NavCube.top":"NavCube.top","NavCube.bottom":"NavCube.bottom"},P={"NavCube.front":"FRONT","NavCube.back":"BACK","NavCube.right":"RIGHT","NavCube.left":"LEFT","NavCube.top":"TOP","NavCube.bottom":"BOTTOM"},function(t){var i=b?w:x,s=i?i[t]:null;return s?e.localeService.translate(s)||P[s]||s:t});this.setZUp=function(){b=!0,_=c,this.clear()},this.setYUp=function(){u=e.scene.camera.normalUp,b=!1,_=u?h:d,this.clear()},this.clear=function(){y.fillStyle=s,y.fillRect(0,0,a,o);for(var e=0,t=_.length;e<t;e++){_[e].highlighted=!1}B()},this.getArea=function(e){for(var t=e[0]*a,i=o-e[1]*o,s=0,r=_.length;s<r;s++)for(var n=_[s].boundaries,u=0,A=n.length;u<A;u++){var c=n[u];if(t>=c[0]*l&&t<=(c[0]+c[2])*l&&i>=c[1]*l&&i<=(c[1]+c[3])*l)return s}return-1},this.setAreaHighlighted=function(e,t){var i=_[e];if(!i)throw"Area not found: "+e;i.highlighted=!!t,B()},this.getAreaDir=function(e){var t=_[e];if(!t)throw"Unknown area: "+e;return t.dir},this.getAreaUp=function(e){var t=_[e];if(!t)throw"Unknown area: "+e;return t.up},this.getImage=function(){return this._textureCanvas},this.destroy=function(){this._textureCanvas&&(this._textureCanvas.parentNode.removeChild(this._textureCanvas),this._textureCanvas=null),this.cubeParentDiv&&(this.cubeParentDiv.parentNode.removeChild(this.cubeParentDiv),this.cubeParentDiv=null)}}var oE=J.vec3(),aE=J.vec3();J.mat4();var lE=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};B(this,t),i=h(this,t,["NavCube",e,s]),e.navCube=i;try{i._navCubeScene=new $i(e,{canvasId:s.canvasId,canvasElement:s.canvasElement,transparent:!0,spinnerElementId:"navcube_spinner",edgesEnabled:!0,contextAttr:{antialias:!0},resolutionScale:window.devicePixelRatio,worldAxis:e.scene.camera.worldAxis}),i._navCubeCanvas=i._navCubeScene.canvas.canvas,i._navCubeScene.input.keyboardEnabled=!1}catch(e){return i.error(e),d(i)}var r=i._navCubeScene;r.clearLights(),new _i(r,{dir:[.4,-.4,.8],color:[.8,1,1],intensity:.8,space:"view"}),new _i(r,{dir:[-.8,-.3,-.4],color:[.8,.8,.8],intensity:.8,space:"view"}),new _i(r,{dir:[.8,-.6,-.8],color:[1,1,1],intensity:.8,space:"view"}),i._navCubeCamera=r.camera,i._navCubeCamera.ortho.scale=7,i._navCubeCamera.ortho.near=.1,i._navCubeCamera.ortho.far=2e3,r.edgeMaterial.edgeColor=[.47,.62,.67],r.edgeMaterial.edgeAlpha=.2,r.edgeMaterial.edgeWidth=1,i._zUp=Boolean(e.camera.zUp);var n=i;i.mousedown=!1,i.mouseover=!1,i.setIsProjectNorth(s.isProjectNorth),i.setProjectNorthOffsetAngle(s.projectNorthOffsetAngle);var o,a=i.rotateTrueNorth=(o=J.mat4(),function(e,t,i){return J.identityMat4(o),J.rotationMat4v(e*n._projectNorthOffsetAngle*J.DEGTORAD,[0,1,0],o),J.transformVec3(o,t,i)}),l=!1;e.scene.on("aabb",(function(){l=e.scene.camera.normalUp})),i._synchCamera=function(){var t=J.rotationMat4c(-90*J.DEGTORAD,1,0,0),i=J.vec3(),s=J.vec3(),r=J.vec3();return function(){var o=e.camera.eye,u=e.camera.look,A=e.camera.up;i=J.mulVec3Scalar(J.normalizeVec3(J.subVec3(o,u,i)),5),n._isProjectNorth&&n._projectNorthOffsetAngle&&(i=a(-1,i,oE),A=a(-1,A,aE)),n._zUp?(J.transformVec3(t,i,s),J.transformVec3(t,A,r),n._navCubeCamera.look=[0,0,0],n._navCubeCamera.eye=J.transformVec3(t,i,s),n._navCubeCamera.up=J.transformPoint3(t,A,r)):(n._navCubeCamera.look=[0,0,0],n._navCubeCamera.eye=l?i:J.mulVec3(i,[-1,-1,1]),n._navCubeCamera.up=A*(l?1:-1))}}(),i._cubeTextureCanvas=new nE(e,r,s),i._cubeSampler=new On(r,{image:i._cubeTextureCanvas.getImage(),flipY:!0,wrapS:ts,wrapT:ts}),i._cubeMesh=new nn(r,{geometry:new Ti(r,{primitive:"triangles",normals:[0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1],positions:[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1],uv:[.5,.6666,.25,.6666,.25,.3333,.5,.3333,.5,.6666,.5,.3333,.75,.3333,.75,.6666,.5,.6666,.5,1,.25,1,.25,.6666,.25,.6666,0,.6666,0,.3333,.25,.3333,.25,0,.5,0,.5,.3333,.25,.3333,.75,.3333,1,.3333,1,.6666,.75,.6666],indices:[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]}),material:new Qi(r,{diffuse:[.4,.4,.4],specular:[.4,.4,.4],emissive:[.6,.6,.6],diffuseMap:i._cubeSampler,emissiveMap:i._cubeSampler}),visible:!0,edges:!0}),i._shadow=!1===s.shadowVisible?null:new nn(r,{geometry:new Ti(r,an({center:[0,0,0],radiusTop:.001,radiusBottom:1.4,height:.01,radialSegments:20,heightSegments:1,openEnded:!0})),material:new Qi(r,{diffuse:[0,0,0],specular:[0,0,0],emissive:[0,0,0],alpha:.5}),position:[0,-1.5,0],visible:!0,pickable:!1,backfaces:!1}),i._onCameraMatrix=e.camera.on("matrix",i._synchCamera),i._onCameraWorldAxis=e.camera.on("worldAxis",(function(){e.camera.zUp?(i._zUp=!0,i._cubeTextureCanvas.setZUp(),i._repaint(),i._synchCamera()):e.camera.yUp&&(i._zUp=!1,i._cubeTextureCanvas.setYUp(),i._repaint(),i._synchCamera()),l=e.scene.camera.normalUp})),i._onCameraFOV=e.camera.perspective.on("fov",(function(e){i._synchProjection&&(i._navCubeCamera.perspective.fov=e)})),i._onCameraProjection=e.camera.on("projection",(function(e){i._synchProjection&&(i._navCubeCamera.projection="ortho"===e||"perspective"===e?e:"perspective")}));var u=-1;function A(e){var t=[0,0];if(e){for(var i=e.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;t[0]=e.pageX-s,t[1]=e.pageY-r}else e=window.event,t[0]=e.x,t[1]=e.y;return t}var c=null,p=null,f=!1;n.MOUSEDOWN=!1;var v=!1;n.MOUSEOVER=!1;var g,m,_=.5;n._navCubeCanvas.addEventListener("mouseenter",n._onMouseEnter=function(e){v=!0,n.MOUSEOVER=!0}),n._navCubeCanvas.addEventListener("mouseleave",n._onMouseLeave=function(e){v=!1,n.MOUSEOVER=!1}),n._navCubeCanvas.addEventListener("mousedown",n._onMouseDown=function(e){if(1===e.which){c=e.x,p=e.y,g=e.clientX,m=e.clientY;var t=A(e);r.pick({canvasPos:t})?(f=!0,n.MOUSEDOWN=!0):(f=!1,n.MOUSEDOWN=!1)}}),document.addEventListener("mouseup",n._onMouseUp=function(e){if(1===e.which&&(f=!1,n.MOUSEDOWN=!1,null!==c)){var t=A(e),i=r.pick({canvasPos:t,pickSurface:!0});if(i&&i.uv){var s=n._cubeTextureCanvas.getArea(i.uv);if(s>=0&&(u>=0&&(n._cubeTextureCanvas.setAreaHighlighted(u,!1),n._repaint(),u=-1),s>=0)){if(n._cubeTextureCanvas.setAreaHighlighted(s,!0),u=s,n._repaint(),e.x<c-3||e.x>c+3||e.y<p-3||e.y>p+3)return;var o=n._cubeTextureCanvas.getAreaDir(s);if(o){var l=n._cubeTextureCanvas.getAreaUp(s);n._isProjectNorth&&n._projectNorthOffsetAngle&&(o=a(1,o,oE),l=a(1,l,aE)),y(o,l,(function(){u>=0&&(n._cubeTextureCanvas.setAreaHighlighted(u,!1),n._repaint(),u=-1),u>=0&&(n._cubeTextureCanvas.setAreaHighlighted(u,!1),n._repaint(),u=-1),s>=0&&(n._cubeTextureCanvas.setAreaHighlighted(s,!1),u=-1,n._repaint())}))}}}}}),document.addEventListener("mousemove",n._onMouseMove=function(t){if(u>=0&&(n._cubeTextureCanvas.setAreaHighlighted(u,!1),n._repaint(),u=-1),1!==t.buttons||f){if(f){var i=t.clientX,s=t.clientY;return document.body.style.cursor="move",void function(t,i){var s=(t-g)*-_,r=(i-m)*-_;e.camera.orbitYaw(s),e.camera.orbitPitch(-r),g=t,m=i}(i,s)}if(v){var o=A(t),a=r.pick({canvasPos:o,pickSurface:!0});if(a){if(a.uv){document.body.style.cursor="pointer";var l=n._cubeTextureCanvas.getArea(a.uv);if(l===u)return;u>=0&&n._cubeTextureCanvas.setAreaHighlighted(u,!1),l>=0&&(n._cubeTextureCanvas.setAreaHighlighted(l,!0),n._repaint(),u=l)}}else document.body.style.cursor="default",u>=0&&(n._cubeTextureCanvas.setAreaHighlighted(u,!1),n._repaint(),u=-1)}}});var y=i.flyTo=function(){var t=J.vec3();return function(i,s,r){var o=n._fitVisible?e.scene.getAABB(e.scene.visibleObjectIds):e.scene.aabb,a=J.getAABB3Diag(o);J.getAABB3Center(o,t);var l=Math.abs(a/Math.tan(n._cameraFitFOV*J.DEGTORAD));e.cameraControl.pivotPos=t,n._cameraFly?e.cameraFlight.flyTo({look:t,eye:[t[0]-l*i[0],t[1]-l*i[1],t[2]-l*i[2]],up:s||[0,1,0],orthoScale:1.1*a,fitFOV:n._cameraFitFOV,duration:n._cameraFlyDuration},r):e.cameraFlight.jumpTo({look:t,eye:[t[0]-l*i[0],t[1]-l*i[1],t[2]-l*i[2]],up:s||[0,1,0],orthoScale:1.1*a,fitFOV:n._cameraFitFOV},r)}}();return i._onUpdated=e.localeService.on("updated",(function(){i._cubeTextureCanvas.clear(),i._repaint()})),i.setVisible(s.visible),i.setCameraFitFOV(s.cameraFitFOV),i.setCameraFly(s.cameraFly),i.setCameraFlyDuration(s.cameraFlyDuration),i.setFitVisible(s.fitVisible),i.setSynchProjection(s.synchProjection),i}return m(t,me),w(t,[{key:"flyByClick",value:function(e){if(e>=0){this._cubeTextureCanvas.setAreaHighlighted(e,!0),this._repaint();var t=this._cubeTextureCanvas.getAreaDir(e);if(t){var i=this._cubeTextureCanvas.getAreaUp(e);this._isProjectNorth&&this._projectNorthOffsetAngle&&(t=this.rotateTrueNorth(1,t,oE),i=this.rotateTrueNorth(1,i,aE)),this.flyTo(t,i,(function(){}))}}}},{key:"jumpByClick",value:function(e){this.setCameraFly(!1),this.flyByClick(e),this.setCameraFly(!0)}},{key:"navCubeScene",get:function(){return this._navCubeScene}},{key:"MOUSEDOWN",get:function(){return this.mousedown},set:function(e){this.mousedown=e}},{key:"MOUSEOVER",get:function(){return this.mouseover},set:function(e){this.mouseover=e}},{key:"send",value:function(e,t){if("language"===e)this._cubeTextureCanvas.clear(),this._repaint()}},{key:"_repaint",value:function(){var e=this._cubeTextureCanvas.getImage();this._cubeMesh.material.diffuseMap.image=e,this._cubeMesh.material.emissiveMap.image=e}},{key:"setVisible",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._navCubeCanvas&&(this._cubeMesh.visible=e,this._shadow&&(this._shadow.visible=e),this._navCubeCanvas.style.visibility=e?"visible":"hidden")}},{key:"getVisible",value:function(){return!!this._navCubeCanvas&&this._cubeMesh.visible}},{key:"setFitVisible",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._fitVisible=e}},{key:"getFitVisible",value:function(){return this._fitVisible}},{key:"setCameraFly",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._cameraFly=e}},{key:"getCameraFly",value:function(){return this._cameraFly}},{key:"setCameraFitFOV",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:45;this._cameraFitFOV=e}},{key:"getCameraFitFOV",value:function(){return this._cameraFitFOV}},{key:"setCameraFlyDuration",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5;this._cameraFlyDuration=e}},{key:"getCameraFlyDuration",value:function(){return this._cameraFlyDuration}},{key:"setSynchProjection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._synchProjection=e}},{key:"getSynchProjection",value:function(){return this._synchProjection}},{key:"setIsProjectNorth",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._isProjectNorth=e}},{key:"getIsProjectNorth",value:function(){return this._isProjectNorth}},{key:"setProjectNorthOffsetAngle",value:function(e){this._projectNorthOffsetAngle=e}},{key:"getProjectNorthOffsetAngle",value:function(){return this._projectNorthOffsetAngle}},{key:"destroy",value:function(){this._navCubeCanvas&&(this.viewer.localeService.off(this._onUpdated),this.viewer.camera.off(this._onCameraMatrix),this.viewer.camera.off(this._onCameraWorldAxis),this.viewer.camera.perspective.off(this._onCameraFOV),this.viewer.camera.off(this._onCameraProjection),this._navCubeCanvas.removeEventListener("mouseenter",this._onMouseEnter),this._navCubeCanvas.removeEventListener("mouseleave",this._onMouseLeave),this._navCubeCanvas.removeEventListener("mousedown",this._onMouseDown),document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp),this._navCubeCanvas=null,this._cubeTextureCanvas.destroy(),this._cubeTextureCanvas=null,this._onMouseEnter=null,this._onMouseLeave=null,this._onMouseDown=null,this._onMouseMove=null,this._onMouseUp=null),this._navCubeScene.destroy(),this._navCubeScene=null,this._cubeMesh=null,this._shadow=null,f(t,"destroy",this,3)([])}}])}(),uE=new Float64Array([0,0,1]),AE=new Float64Array(4),cE=function(){return w((function e(t){B(this,e),this.id=null,this.type="control",this.plugin=t,this._viewer=t.viewer,this._scene=t.viewer.scene,this._visible=!1,this._pos=J.vec3(),this._origin=J.vec3(),this._rtcPos=J.vec3(),this._baseDir=J.vec3(),this._rootNode=null,this._displayMeshes=null,this._affordanceMeshes=null,this._ignoreNextSectionPlaneDirUpdate=!1,this._createNodes(),this._bindEvents()}),[{key:"_setSectionPlane",value:function(e){var t=this;this._sectionPlane&&(this._sectionPlane.off(this._onSectionPlanePos),this._sectionPlane.off(this._onSectionPlaneDir),this._onSectionPlanePos=null,this._onSectionPlaneDir=null,this._sectionPlane=null),e&&(this.id=e.id,this._setPos(e.pos),this._setDir(e.dir),this._sectionPlane=e,this._onSectionPlanePos=e.on("pos",(function(){t._setPos(t._sectionPlane.pos)})),this._onSectionPlaneDir=e.on("dir",(function(){t._ignoreNextSectionPlaneDirUpdate?t._ignoreNextSectionPlaneDirUpdate=!1:t._setDir(t._sectionPlane.dir)})))}},{key:"sectionPlane",get:function(){return this._sectionPlane}},{key:"pos",get:function(){return this.posRate},set:function(e){if(!(e<0||e>100)){var t=this._scene.aabb,i=this._scene.camera.look,s=t[3]-t[0],r=t[4]-t[1],n=t[5]-t[2],o=J.vec3();o[0]=this.pos[0],o[1]=this.pos[1],o[2]=this.pos[2];var a,l=this._sectionPlane.dir;0!=l[0]?(a=e/100*s,o[0]=i[0]-s/2+a):0!=l[1]?(a=e/100*r,o[1]=i[1]-r/2+a):0!=l[2]&&(a=e/100*n,o[2]=i[2]-n/2+a),this._sectionPlane.pos=o}}},{key:"posRate",get:function(){var e=this._scene.aabb,t=this._scene.center,i=e[3]-e[0],s=e[4]-e[1],r=e[5]-e[2],n=this._sectionPlane.pos,o=this._sectionPlane.dir,a=0;if(0!=o[0])a=(n[0]-(t[0]-i/2))/i*100;else if(0!=o[1]){a=(n[1]-(t[1]-s/2))/s*100}else if(0!=o[2]){a=(n[2]-(t[2]-r/2))/r*100}return a=Math.max(0,Math.min(100,a)),parseInt(a)}},{key:"_setPos",value:function(e){this._pos.set(e),xe(this._pos,this._origin,this._rtcPos),this._rootNode.origin=this._origin,this._rootNode.position=this._rtcPos}},{key:"_setDir",value:function(e){this._baseDir.set(e),this._rootNode.quaternion=J.vec3PairToQuaternion(uE,e,AE)}},{key:"_setSectionPlaneDir",value:function(e){this._sectionPlane&&(this._ignoreNextSectionPlaneDirUpdate=!0,this._sectionPlane.dir=e)}},{key:"setVisible",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this._visible!==e){var t;for(t in this._visible=e,this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].visible=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].visible=e)}}},{key:"getVisible",value:function(){return this._visible}},{key:"setCulled",value:function(e){var t;for(t in this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].culled=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].culled=e)}},{key:"_createNodes",value:function(){var e=!1,t=this._viewer.scene,i=.01;this._rootNode=new Bn(t,{id:this.id,position:[0,0,0],scale:[5,5,5],isObject:!1});var s,r,n=this._rootNode,o={arrowHead:new Ti(n,an({radiusTop:.001,radiusBottom:.07,radialSegments:32,heightSegments:1,height:.2,openEnded:!1})),arrowHeadBig:new Ti(n,an({radiusTop:.001,radiusBottom:.09,radialSegments:32,heightSegments:1,height:.25,openEnded:!1})),arrowHeadHandle:new Ti(n,an({radiusTop:.09,radiusBottom:.09,radialSegments:8,heightSegments:1,height:.37,openEnded:!1})),curve:new Ti(n,Yn({radius:.8,tube:i,radialSegments:64,tubeSegments:14,arc:2*Math.PI/4})),curveHandle:new Ti(n,Yn({radius:.8,tube:.06,radialSegments:64,tubeSegments:14,arc:2*Math.PI/4})),hoop:new Ti(n,Yn({radius:.8,tube:i,radialSegments:64,tubeSegments:8,arc:2*Math.PI})),axis:new Ti(n,an({radiusTop:i,radiusBottom:i,radialSegments:20,heightSegments:1,height:1,openEnded:!1})),axisHandle:new Ti(n,an({radiusTop:.08,radiusBottom:.08,radialSegments:20,heightSegments:1,height:1,openEnded:!1}))},a={pickable:new Qi(n,{diffuse:[1,1,0],alpha:0,alphaMode:"blend"}),red:new Qi(n,{diffuse:[1,0,0],emissive:[1,0,0],ambient:[0,0,0],specular:[.6,.6,.3],shininess:80,lineWidth:2}),highlightRed:new Vi(n,{edges:!1,fill:!0,fillColor:[1,0,0],fillAlpha:.6}),green:new Qi(n,{diffuse:[0,1,0],emissive:[0,1,0],ambient:[0,0,0],specular:[.6,.6,.3],shininess:80,lineWidth:2}),highlightGreen:new Vi(n,{edges:!1,fill:!0,fillColor:[0,1,0],fillAlpha:.6}),blue:new Qi(n,{diffuse:[0,0,1],emissive:[0,0,1],ambient:[0,0,0],specular:[.6,.6,.3],shininess:80,lineWidth:2}),highlightBlue:new Vi(n,{edges:!1,fill:!0,fillColor:[0,0,1],fillAlpha:.2}),center:new Qi(n,{diffuse:[0,0,0],emissive:[0,0,0],ambient:[0,0,0],specular:[.6,.6,.3],shininess:80}),highlightBall:new Vi(n,{edges:!1,fill:!0,fillColor:[.5,.5,.5],fillAlpha:.5,vertices:!1}),highlightPlane:new Vi(n,{edges:!0,edgeWidth:3,fill:!1,fillColor:[.5,.5,.5],fillAlpha:.5,vertices:!1})};this._displayMeshes={plane:n.addChild(new nn(n,{geometry:new Ti(n,{primitive:"triangles",positions:[.5,.5,0,.5,-.5,0,-.5,-.5,0,-.5,.5,0,.5,.5,-0,.5,-.5,-0,-.5,-.5,-0,-.5,.5,-0],indices:[0,1,2,2,3,0]}),material:new Qi(n,{emissive:[0,0,0],diffuse:[0,0,0],backfaces:!0}),opacity:.6,ghosted:!0,ghostMaterial:new Vi(n,{edges:!1,filled:!0,fillColor:[1,1,0],edgeColor:[0,0,0],fillAlpha:.1,backfaces:!0}),pickable:!1,collidable:!1,clippable:!1,visible:!1,scale:[2.4,2.4,1],isObject:!1}),e),planeFrame:n.addChild(new nn(n,{geometry:new Ti(n,Yn({center:[0,0,0],radius:1.7,tube:.02,radialSegments:4,tubeSegments:4,arc:2*Math.PI})),material:new Qi(n,{emissive:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],shininess:0}),highlightMaterial:new Vi(n,{edges:!1,edgeColor:[0,0,0],filled:!0,fillColor:[.8,.8,.8],fillAlpha:1}),pickable:!1,collidable:!1,clippable:!1,visible:!1,scale:[1,1,.1],rotation:[0,0,45],isObject:!1}),e),xCurve:n.addChild(new nn(n,{geometry:o.curve,material:a.red,matrix:(s=J.rotationMat4v(90*J.DEGTORAD,[0,1,0],J.identityMat4()),r=J.rotationMat4v(270*J.DEGTORAD,[1,0,0],J.identityMat4()),J.mulMat4(r,s,J.identityMat4())),pickable:!1,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),xCurveHandle:n.addChild(new nn(n,{geometry:o.curveHandle,material:a.pickable,matrix:function(){var e=J.rotationMat4v(90*J.DEGTORAD,[0,1,0],J.identityMat4()),t=J.rotationMat4v(270*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),xCurveArrow1:n.addChild(new nn(n,{geometry:o.arrowHead,material:a.red,matrix:function(){var e=J.translateMat4c(0,-.07,-.8,J.identityMat4()),t=J.scaleMat4v([.6,.6,.6],J.identityMat4()),i=J.rotationMat4v(0*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(J.mulMat4(e,t,J.identityMat4()),i,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xCurveArrow2:n.addChild(new nn(n,{geometry:o.arrowHead,material:a.red,matrix:function(){var e=J.translateMat4c(0,-.8,-.07,J.identityMat4()),t=J.scaleMat4v([.6,.6,.6],J.identityMat4()),i=J.rotationMat4v(90*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(J.mulMat4(e,t,J.identityMat4()),i,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yCurve:n.addChild(new nn(n,{geometry:o.curve,material:a.green,rotation:[-90,0,0],pickable:!1,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),yCurveHandle:n.addChild(new nn(n,{geometry:o.curveHandle,material:a.pickable,rotation:[-90,0,0],pickable:!0,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),yCurveArrow1:n.addChild(new nn(n,{geometry:o.arrowHead,material:a.green,matrix:function(){var e=J.translateMat4c(.07,0,-.8,J.identityMat4()),t=J.scaleMat4v([.6,.6,.6],J.identityMat4()),i=J.rotationMat4v(90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(J.mulMat4(e,t,J.identityMat4()),i,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yCurveArrow2:n.addChild(new nn(n,{geometry:o.arrowHead,material:a.green,matrix:function(){var e=J.translateMat4c(.8,0,-.07,J.identityMat4()),t=J.scaleMat4v([.6,.6,.6],J.identityMat4()),i=J.rotationMat4v(90*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(J.mulMat4(e,t,J.identityMat4()),i,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),center:n.addChild(new nn(n,{geometry:new Ti(n,ln({radius:.05})),material:a.center,pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxisArrow:n.addChild(new nn(n,{geometry:o.arrowHead,material:a.red,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxisArrowHandle:n.addChild(new nn(n,{geometry:o.arrowHeadHandle,material:a.pickable,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxis:n.addChild(new nn(n,{geometry:o.axis,material:a.red,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxisHandle:n.addChild(new nn(n,{geometry:o.axisHandle,material:a.pickable,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yAxisArrow:n.addChild(new nn(n,{geometry:o.arrowHead,material:a.green,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yAxisArrowHandle:n.addChild(new nn(n,{geometry:o.arrowHeadHandle,material:a.pickable,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,opacity:.2,isObject:!1}),e),yShaft:n.addChild(new nn(n,{geometry:o.axis,material:a.green,position:[0,-.5,0],pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yShaftHandle:n.addChild(new nn(n,{geometry:o.axisHandle,material:a.pickable,position:[0,-.5,0],pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zAxisArrow:n.addChild(new nn(n,{geometry:o.arrowHead,material:a.blue,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[.8,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zAxisArrowHandle:n.addChild(new nn(n,{geometry:o.arrowHeadHandle,material:a.pickable,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[.8,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zShaft:n.addChild(new nn(n,{geometry:o.axis,material:a.blue,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),clippable:!1,pickable:!1,collidable:!1,visible:!1,isObject:!1}),e),zAxisHandle:n.addChild(new nn(n,{geometry:o.axisHandle,material:a.pickable,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),clippable:!1,pickable:!0,collidable:!1,visible:!1,isObject:!1}),e)},this._affordanceMeshes={planeFrame:n.addChild(new nn(n,{geometry:new Ti(n,Yn({center:[0,0,0],radius:2,tube:i,radialSegments:4,tubeSegments:4,arc:2*Math.PI})),material:new Qi(n,{ambient:[1,1,1],diffuse:[0,0,0],emissive:[1,1,0]}),highlighted:!0,highlightMaterial:new Vi(n,{edges:!1,filled:!0,fillColor:[1,1,0],fillAlpha:1}),pickable:!1,collidable:!1,clippable:!1,visible:!1,scale:[1,1,1],rotation:[0,0,45],isObject:!1}),e),xHoop:n.addChild(new nn(n,{geometry:o.hoop,material:a.red,highlighted:!0,highlightMaterial:a.highlightRed,matrix:function(){var e=J.rotationMat4v(90*J.DEGTORAD,[0,1,0],J.identityMat4()),t=J.rotationMat4v(270*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yHoop:n.addChild(new nn(n,{geometry:o.hoop,material:a.green,highlighted:!0,highlightMaterial:a.highlightGreen,rotation:[-90,0,0],pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zHoop:n.addChild(new nn(n,{geometry:o.hoop,material:a.blue,highlighted:!0,highlightMaterial:a.highlightBlue,matrix:J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4()),pickable:!1,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),xAxisArrow:n.addChild(new nn(n,{geometry:o.arrowHeadBig,material:a.red,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yAxisArrow:n.addChild(new nn(n,{geometry:o.arrowHeadBig,material:a.green,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zAxisArrow:n.addChild(new nn(n,{geometry:o.arrowHeadBig,material:a.blue,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[.8,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e)}}},{key:"_bindEvents",value:function(){var e=this,t=this,i=!1,s=-1,r=0,n=1,o=2,a=3,l=4,u=5,A=this._rootNode,c=null,h=null,d=J.vec2(),p=J.vec3([1,0,0]),f=J.vec3([0,1,0]),v=J.vec3([0,0,1]),g=this._viewer.scene.canvas.canvas,m=this._viewer.camera,_=this._viewer.scene,y=J.vec3([0,0,0]),b=-1;this._onCameraViewMatrix=_.camera.on("viewMatrix",(function(){})),this._onCameraProjMatrix=_.camera.on("projMatrix",(function(){})),this._onSceneTick=_.on("tick",(function(){var t=Math.abs(J.lenVec3(J.subVec3(_.camera.eye,e._pos,y)));if(t!==b&&"perspective"===m.projection){var i=.07*(Math.tan(m.perspective.fov*J.DEGTORAD)*t);A.scale=[i,i,i],b=t}if("ortho"===m.projection){var s=m.ortho.scale/10;A.scale=[s,s,s],b=t}}));var B,x,w,P,C,M=function(){var e=new Float64Array(2);return function(t){if(t){for(var i=t.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;e[0]=t.pageX-s,e[1]=t.pageY-r}else t=window.event,e[0]=t.x,e[1]=t.y;return e}}(),k=function(){var e=new Float64Array(2);return function(t){if(t||(t=window.event),t.touches&&t.touches.length)e[0]=t.touches[0].pageX,e[1]=t.touches[0].pageY;else{for(var i=t.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;e[0]=t.pageX-s,e[1]=t.pageY-r}return e}}(),F=function(){var e=J.mat4();return function(i,s){return J.quaternionToMat4(t._rootNode.quaternion,e),J.transformVec3(e,i,s),J.normalizeVec3(s),s}}(),E=(B=J.vec3(),function(e){var t=Math.abs(e[0]);return t>Math.abs(e[1])&&t>Math.abs(e[2])?J.cross3Vec3(e,[0,1,0],B):J.cross3Vec3(e,[1,0,0],B),J.cross3Vec3(B,e,B),J.normalizeVec3(B),B}),D=(x=J.vec3(),w=J.vec3(),P=J.vec4(),function(e,i,s){F(e,P);var r=E(P,i,s);S(i,r,x),S(s,r,w),J.subVec3(w,x);var n=J.dotVec3(w,P);t._pos[0]+=P[0]*n*.6,t._pos[1]+=P[1]*n*.6,t._pos[2]+=P[2]*n*.6,t._rootNode.position=t._pos,t._sectionPlane&&(t._sectionPlane.pos=t._pos)}),I=function(){var e=J.vec4(),i=J.vec4(),s=J.vec4(),r=J.vec4();return function(n,o,a){if(F(n,r),!(S(o,r,e)&&S(a,r,i))){var l=E(r,o,a);S(o,l,e,1),S(a,l,i,1);var u=J.dotVec3(e,r);e[0]-=u*r[0],e[1]-=u*r[1],e[2]-=u*r[2],u=J.dotVec3(i,r),i[0]-=u*r[0],i[1]-=u*r[1],i[2]-=u*r[2]}J.normalizeVec3(e),J.normalizeVec3(i),u=J.dotVec3(e,i),u=J.clamp(u,-1,1);var A=Math.acos(u)*J.RADTODEG;J.cross3Vec3(e,i,s),J.dotVec3(s,r)<0&&(A=-A),t._rootNode.rotate(n,A),T()}}(),S=function(){var e=J.vec4([0,0,0,1]),i=J.mat4();return function(s,r,n,o){o=o||0,e[0]=s[0]/g.width*2-1,e[1]=-(s[1]/g.height*2-1),e[2]=0,e[3]=1,J.mulMat4(m.projMatrix,m.viewMatrix,i),J.inverseMat4(i),J.transformVec4(i,e,e),J.mulVec4Scalar(e,1/e[3]);var a=m.eye;J.subVec4(e,a,e);var l=t._sectionPlane.pos,u=-J.dotVec3(l,r)-o,A=J.dotVec3(r,e);if(Math.abs(A)>.005){var c=-(J.dotVec3(r,a)+u)/A;return J.mulVec3Scalar(e,c,n),J.addVec3(n,a),J.subVec3(n,l,n),!0}return!1}}(),T=function(){var e=J.vec3(),i=J.mat4();return function(){t.sectionPlane&&(J.quaternionToMat4(A.quaternion,i),J.transformVec3(i,[0,0,1],e),t._setSectionPlaneDir(e))}}(),L=!1;this._onCameraControlHover=this._viewer.cameraControl.on("hoverEnter",(function(t){if(e._visible&&!L){var u;switch(i=!1,C&&(C.visible=!1),t.entity.id){case e._displayMeshes.xAxisArrowHandle.id:case e._displayMeshes.xAxisHandle.id:u=e._affordanceMeshes.xAxisArrow,c=r;break;case e._displayMeshes.yAxisArrowHandle.id:case e._displayMeshes.yShaftHandle.id:u=e._affordanceMeshes.yAxisArrow,c=n;break;case e._displayMeshes.zAxisArrowHandle.id:case e._displayMeshes.zAxisHandle.id:u=e._affordanceMeshes.zAxisArrow,c=o;break;case e._displayMeshes.xCurveHandle.id:u=e._affordanceMeshes.xHoop,c=a;break;case e._displayMeshes.yCurveHandle.id:u=e._affordanceMeshes.yHoop,c=l;break;default:return void(c=s)}u&&(u.visible=!0),C=u,i=!0}})),this._onCameraControlHoverLeave=this._viewer.cameraControl.on("hoverOut",(function(t){e._visible&&(C&&(C.visible=!1),C=null,c=s,i=!1)})),g.addEventListener("mousedown",this._canvasMouseDownListener=function(t){if(t.preventDefault(),e._visible&&i&&(e._viewer.cameraControl.pointerEnabled=!1,1===t.which)){L=!0;var s=M(t);h=c,d[0]=s[0],d[1]=s[1],e.plugin.fire("clickPlaneStart")}}),g.addEventListener("mousemove",this._canvasMouseMoveListener=function(t){if(e._visible&&L){var i=M(t),s=i[0],A=i[1];switch(h){case r:D(p,d,i);break;case n:D(f,d,i);break;case o:D(v,d,i);break;case a:I(p,d,i);break;case l:I(f,d,i);break;case u:I(v,d,i)}d[0]=s,d[1]=A}}),g.addEventListener("mouseup",this._canvasMouseUpListener=function(t){e._visible&&(e._viewer.cameraControl.pointerEnabled=!0,L&&(t.which,L=!1,i=!1,e.plugin.fire("clickPlaneEnd")))}),g.addEventListener("wheel",this._canvasWheelListener=function(t){if(e._visible)Math.max(-1,Math.min(1,40*-t.deltaY))}),this._onCameraControlHover=this._viewer.cameraControl.on("touchEntity",(function(t){if(e._visible&&!L&&!i){var u;switch(i=!1,C&&(C.visible=!1),t.entity.id){case e._displayMeshes.xAxisArrowHandle.id:case e._displayMeshes.xAxisHandle.id:u=e._affordanceMeshes.xAxisArrow,c=r;break;case e._displayMeshes.yAxisArrowHandle.id:case e._displayMeshes.yShaftHandle.id:u=e._affordanceMeshes.yAxisArrow,c=n;break;case e._displayMeshes.zAxisArrowHandle.id:case e._displayMeshes.zAxisHandle.id:u=e._affordanceMeshes.zAxisArrow,c=o;break;case e._displayMeshes.xCurveHandle.id:u=e._affordanceMeshes.xHoop,c=a;break;case e._displayMeshes.yCurveHandle.id:u=e._affordanceMeshes.yHoop,c=l;break;default:return void(c=s)}u&&(u.visible=!0),C=u,i=!0}})),g.addEventListener("touchstart",this._canvasMouseDownListener=function(t){if(t.preventDefault(),e._visible&&i){e._viewer.cameraControl.pointerEnabled=!1,L=!0;var s=k(t);h=c,d[0]=s[0],d[1]=s[1],e.plugin.fire("touchPlaneStart")}}),g.addEventListener("touchmove",this._canvasMouseMoveListener=function(t){if(e._visible&&L){var i=k(t),s=i[0],A=i[1];switch(h){case r:D(p,d,i);break;case n:D(f,d,i);break;case o:D(v,d,i);break;case a:I(p,d,i);break;case l:I(f,d,i);break;case u:I(v,d,i)}d[0]=s,d[1]=A}}),g.addEventListener("touchend",this._canvasTouchEndListener=function(t){e._visible&&(e._viewer.cameraControl.pointerEnabled=!0,C&&(C.visible=!1),C=null,c=s,L=!1,i=!1,e.plugin.fire("touchPlaneEnd"))}),g.addEventListener("touchcancel",this._canvasTouchEndListener)}},{key:"_destroy",value:function(){this._unbindEvents(),this._destroyNodes()}},{key:"_unbindEvents",value:function(){var e=this._viewer,t=e.scene,i=t.canvas.canvas,s=e.camera,r=e.cameraControl;t.off(this._onSceneTick),i.removeEventListener("mousedown",this._canvasMouseDownListener),i.removeEventListener("mousemove",this._canvasMouseMoveListener),i.removeEventListener("mouseup",this._canvasMouseUpListener),i.removeEventListener("wheel",this._canvasWheelListener),i.removeEventListener("touchend",this._canvasTouchEndListener),i.removeEventListener("touchcancel",this._canvasTouchEndListener),s.off(this._onCameraViewMatrix),s.off(this._onCameraProjMatrix),r.off(this._onCameraControlHover),r.off(this._onCameraControlHoverLeave)}},{key:"_destroyNodes",value:function(){this._setSectionPlane(null),this._rootNode.destroy(),this._displayMeshes={},this._affordanceMeshes={}}}])}(),hE=new Float64Array([0,0,1]),dE=new Float64Array(4),pE=function(){return w((function e(t,i){B(this,e),this.id=i.id,this.type="control",this.plugin=t,this._viewer=t.viewer,this._scene=t.viewer.scene,i||(i={}),this._xColor=i.xColor?i.xColor:[.5,.5,.5],this._yColor=i.yColor?i.yColor:[.5,.5,.5],this._zColor=i.zColor?i.zColor:[.5,.5,.5],this._controlFillColor=i.controlFillColor?i.controlFillColor:[.1,.4,.99],this._planeSize=i.planeSize?i.planeSize:1,this._controlSize=i.controlSize?i.controlSize:.07,this._planeOpacity=i.planeOpacity?i.planeOpacity:.4,this._visible=!1,this._pos=J.vec3(),this._origin=J.vec3(),this._rtcPos=J.vec3(),this._baseDir=J.vec3(),this._rootNode=null,this._displayMeshes=null,this._affordanceMeshes=null,this._ignoreNextSectionPlaneDirUpdate=!1}),[{key:"_createNodes",value:function(){var e=!1,t=this._viewer.scene,i=t.aabb,s=.01,r=i[3]-i[0],n=i[4]-i[1],o=i[5]-i[2];this._rootNode=new Bn(t,{id:"sectionControl",position:[0,0,0],scale:[5,5,5],isObject:!1});var a,l,u=this._rootNode,A={arrowHead:new Ti(u,an({radiusTop:.001,radiusBottom:.04,radialSegments:32,heightSegments:1,height:.15,openEnded:!1})),arrowHeadBig:new Ti(u,an({radiusTop:.001,radiusBottom:.05,radialSegments:32,heightSegments:1,height:.18,openEnded:!1})),arrowHeadHandle:new Ti(u,an({radiusTop:.09,radiusBottom:.09,radialSegments:8,heightSegments:1,height:.37,openEnded:!1})),curve:new Ti(u,Yn({radius:.5,tube:s,radialSegments:32,tubeSegments:7,arc:2*Math.PI/4})),curveHandle:new Ti(u,Yn({radius:.5,tube:.04,radialSegments:32,tubeSegments:7,arc:2*Math.PI/4})),hoop:new Ti(u,Yn({radius:.8,tube:s,radialSegments:64,tubeSegments:8,arc:2*Math.PI})),axis:new Ti(u,an({radiusTop:s,radiusBottom:s,radialSegments:20,heightSegments:1,height:1,openEnded:!1})),axisHandle:new Ti(u,an({radiusTop:.08,radiusBottom:.08,radialSegments:20,heightSegments:1,height:1,openEnded:!1}))},c={pickable:new Qi(u,{diffuse:[1,1,0],alpha:0,alphaMode:"opaque"}),red:new Qi(u,{diffuse:this._xColor,emissive:this._xColor,ambient:[0,0,0],specular:[.6,.6,.3],shininess:80,lineWidth:1.5}),highlightRed:new Vi(u,{edges:!1,fill:!0,fillColor:[.8,.8,.8],fillAlpha:.6}),green:new Qi(u,{diffuse:this._yColor,emissive:this._yColor,ambient:[0,0,0],specular:[.6,.6,.3],shininess:80,lineWidth:1.5}),highlightGreen:new Vi(u,{edges:!1,fill:!0,fillColor:[.8,.8,.8],fillAlpha:.6}),blue:new Qi(u,{diffuse:this._zColor,emissive:this._zColor,ambient:[0,0,0],specular:[.6,.6,.3],shininess:80,lineWidth:1.5}),highlightBlue:new Vi(u,{edges:!1,fill:!0,fillColor:[.8,.8,.8],fillAlpha:.2}),center:new Qi(u,{diffuse:[0,0,0],emissive:[0,0,0],ambient:[0,0,0],specular:[.6,.6,.3],shininess:80}),highlightBall:new Vi(u,{edges:!1,fill:!0,fillColor:[.5,.5,.5],fillAlpha:.5,vertices:!1}),highlightPlane:new Vi(u,{edges:!0,edgeWidth:3,fill:!1,fillColor:[.5,.5,.5],fillAlpha:.5,vertices:!1})};this._displayMeshes={plane:u.addChild(new nn(u,{geometry:new Ti(u,{primitive:"triangles",positions:[10,5,0,10,-5,0,-10,-5,0,-10,5,0],indices:[0,1,2,2,3,0]}),material:new Qi(u,{emissive:[0,0,0],diffuse:this._controlFillColor,backfaces:!0}),opacity:this._planeOpacity,ghosted:!1,ghostMaterial:new Vi(u,{edges:!1,filled:!0,fillColor:this._controlFillColor?this._controlFillColor:[.1,.4,.99],edgeColor:[0,0,0],fillAlpha:.1,backfaces:!0}),pickable:!0,collidable:!1,clippable:!1,visible:!1,scale:[this._planeSize,this._planeSize,this._planeSize],isObject:!1}),e),planeFrame:u.addChild(new nn(u,{geometry:new Ti(u,Wn({center:[0,0,0],xSize:.1*r,ySize:.1*n,zSize:.1*o})),material:new Qi(u,{emissive:[.5,.5,.5],diffuse:[.5,.5,.5],specular:[.5,.5,.5],alpha:.2,shininess:10}),highlightMaterial:new Vi(u,{edges:!1,edgeColor:[0,0,0],filled:!0,fillColor:[.8,.8,.8],fillAlpha:1}),pickable:!1,collidable:!1,clippable:!1,visible:!1,scale:[1,1,1],isObject:!1}),e),xCurve:u.addChild(new nn(u,{geometry:A.curve,material:c.red,matrix:(a=J.rotationMat4v(90*J.DEGTORAD,[0,1,0],J.identityMat4()),l=J.rotationMat4v(270*J.DEGTORAD,[1,0,0],J.identityMat4()),J.mulMat4(l,a,J.identityMat4())),pickable:!1,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),xCurveHandle:u.addChild(new nn(u,{geometry:A.curveHandle,material:c.pickable,matrix:function(){var e=J.rotationMat4v(90*J.DEGTORAD,[0,1,0],J.identityMat4()),t=J.rotationMat4v(270*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),yCurve:u.addChild(new nn(u,{geometry:A.curve,material:c.green,rotation:[-90,0,0],pickable:!1,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),yCurveHandle:u.addChild(new nn(u,{geometry:A.curveHandle,material:c.pickable,rotation:[-90,0,0],pickable:!0,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),center:u.addChild(new nn(u,{geometry:new Ti(u,ln({radius:.05})),material:c.center,pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxisArrow:u.addChild(new nn(u,{geometry:A.arrowHead,material:c.red,matrix:function(){var e=J.translateMat4c(0,1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxisArrowHandle:u.addChild(new nn(u,{geometry:A.arrowHeadHandle,material:c.pickable,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxis:u.addChild(new nn(u,{geometry:A.axis,material:c.red,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxisHandle:u.addChild(new nn(u,{geometry:A.axisHandle,material:c.pickable,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yAxisArrow:u.addChild(new nn(u,{geometry:A.arrowHead,material:c.green,matrix:function(){var e=J.translateMat4c(0,1,0,J.identityMat4()),t=J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yAxisArrowHandle:u.addChild(new nn(u,{geometry:A.arrowHeadHandle,material:c.pickable,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,opacity:.2,isObject:!1}),e),yShaft:u.addChild(new nn(u,{geometry:A.axis,material:c.green,position:[0,-.5,0],pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yShaftHandle:u.addChild(new nn(u,{geometry:A.axisHandle,material:c.pickable,position:[0,-.5,0],pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zAxisArrow:u.addChild(new nn(u,{geometry:A.arrowHead,material:c.blue,matrix:function(){var e=J.translateMat4c(0,1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[2,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zAxisArrowHandle:u.addChild(new nn(u,{geometry:A.arrowHeadHandle,material:c.pickable,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[.8,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zShaft:u.addChild(new nn(u,{geometry:A.axis,material:c.blue,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),clippable:!1,pickable:!1,collidable:!1,visible:!1,isObject:!1}),e),zAxisHandle:u.addChild(new nn(u,{geometry:A.axisHandle,material:c.pickable,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),clippable:!1,pickable:!0,collidable:!1,visible:!1,isObject:!1}),e)},this._affordanceMeshes={xHoop:u.addChild(new nn(u,{geometry:A.hoop,material:c.red,highlighted:!0,highlightMaterial:c.highlightRed,matrix:function(){var e=J.rotationMat4v(90*J.DEGTORAD,[0,1,0],J.identityMat4()),t=J.rotationMat4v(270*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yHoop:u.addChild(new nn(u,{geometry:A.hoop,material:c.green,highlighted:!0,highlightMaterial:c.highlightGreen,rotation:[-90,0,0],pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zHoop:u.addChild(new nn(u,{geometry:A.hoop,material:c.blue,highlighted:!0,highlightMaterial:c.highlightBlue,matrix:J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4()),pickable:!1,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),xAxisArrow:u.addChild(new nn(u,{geometry:A.arrowHeadBig,material:c.red,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yAxisArrow:u.addChild(new nn(u,{geometry:A.arrowHeadBig,material:c.green,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zAxisArrow:u.addChild(new nn(u,{geometry:A.arrowHeadBig,material:c.blue,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[.8,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e)}}},{key:"_setSectionPlane",value:function(e){var t=this;this._sectionPlane&&(this._sectionPlane.off(this._onSectionPlanePos),this._sectionPlane.off(this._onSectionPlaneDir),this._onSectionPlanePos=null,this._onSectionPlaneDir=null,this._sectionPlane=null),e&&(this.id=e.controlId,this._createNodes(),this._bindEvents(),this._setPos(e.pos),this._setDir(e.dir),this._sectionPlane=e,this._onSectionPlanePos=e.on("pos",(function(){t._setPos(t._sectionPlane.pos)})),this._onSectionPlaneDir=e.on("dir",(function(){t._ignoreNextSectionPlaneDirUpdate?t._ignoreNextSectionPlaneDirUpdate=!1:t._setDir(t._sectionPlane.dir)})))}},{key:"sectionPlane",get:function(){return this._sectionPlane}},{key:"pos",get:function(){return this.posRate},set:function(e){if(!(e<0||e>100)){var t=this._scene.aabb,i=this._scene.camera.look,s=t[3]-t[0],r=t[4]-t[1],n=t[5]-t[2],o=J.vec3();o[0]=this.pos[0],o[1]=this.pos[1],o[2]=this.pos[2];var a,l=this._sectionPlane.dir;0!=l[0]?(a=e/100*s,o[0]=i[0]-s/2+a):0!=l[1]?(a=e/100*r,o[1]=i[1]-r/2+a):0!=l[2]&&(a=e/100*n,o[2]=i[2]-n/2+a),this._sectionPlane.pos=o}}},{key:"posRate",get:function(){var e=this._scene.aabb,t=this._scene.center,i=e[3]-e[0],s=e[4]-e[1],r=e[5]-e[2],n=this._sectionPlane.pos,o=this._sectionPlane.dir,a=0;if(0!=o[0])a=(n[0]-(t[0]-i/2))/i*100;else if(0!=o[1]){a=(n[1]-(t[1]-s/2))/s*100}else if(0!=o[2]){a=(n[2]-(t[2]-r/2))/r*100}return a=Math.max(0,Math.min(100,a)),parseInt(a)}},{key:"_setPos",value:function(e){this._pos.set(e),xe(this._pos,this._origin,this._rtcPos),this._rootNode.origin=this._origin,this._rootNode.position=this._rtcPos}},{key:"_setDir",value:function(e){this._baseDir.set(e),this._rootNode.quaternion=J.vec3PairToQuaternion(hE,e,dE)}},{key:"_setSectionPlaneDir",value:function(e){this._sectionPlane&&(this._ignoreNextSectionPlaneDirUpdate=!0,this._sectionPlane.dir=e)}},{key:"setVisible",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this._visible!==e){var t;for(t in this._visible=e,this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].visible=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].visible=e)}}},{key:"getVisible",value:function(){return this._visible}},{key:"setCulled",value:function(e){var t;for(t in this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].culled=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].culled=e)}},{key:"_bindEvents",value:function(){var e=this,t=this,i=!1,s=-1,r=0,n=1,o=2,a=3,l=4,u=5,A=this._rootNode,c=null,h=null,d=J.vec2(),p=J.vec3([1,0,0]),f=J.vec3([0,1,0]),v=J.vec3([0,0,1]),g=this._viewer.scene.canvas.canvas,m=this._viewer.camera,_=this._viewer.scene,y=J.vec3([0,0,0]),b=-1;this._onCameraViewMatrix=_.camera.on("viewMatrix",(function(){})),this._onCameraProjMatrix=_.camera.on("projMatrix",(function(){})),this._onSceneTick=_.on("tick",(function(){var t=Math.abs(J.lenVec3(J.subVec3(_.camera.eye,e._pos,y)));t!==b&&"perspective"===m.projection&&(Math.tan(m.perspective.fov*J.DEGTORAD),b=t),"ortho"===m.projection&&(m.ortho.scale,b=t)}));var B,x,w,P,C,M=function(){var e=new Float64Array(2);return function(t){if(t){for(var i=t.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;e[0]=t.pageX-s,e[1]=t.pageY-r}else t=window.event,e[0]=t.x,e[1]=t.y;return e}}(),k=function(){var e=new Float64Array(2);return function(t){if(t||(t=window.event),t.touches&&t.touches.length)e[0]=t.touches[0].pageX,e[1]=t.touches[0].pageY;else{for(var i=t.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;e[0]=t.pageX-s,e[1]=t.pageY-r}return e}}(),F=function(){var e=J.mat4();return function(i,s){return J.quaternionToMat4(t._rootNode.quaternion,e),J.transformVec3(e,i,s),J.normalizeVec3(s),s}}(),E=(B=J.vec3(),function(e){var t=Math.abs(e[0]);return t>Math.abs(e[1])&&t>Math.abs(e[2])?J.cross3Vec3(e,[0,1,0],B):J.cross3Vec3(e,[1,0,0],B),J.cross3Vec3(B,e,B),J.normalizeVec3(B),B}),D=(x=J.vec3(),w=J.vec3(),P=J.vec4(),function(e,i,s){F(e,P);var r=E(P,i,s);S(i,r,x),S(s,r,w),J.subVec3(w,x);var n=J.dotVec3(w,P);t._pos[0]+=P[0]*n*.6,t._pos[1]+=P[1]*n*.6,t._pos[2]+=P[2]*n*.6,t._rootNode.position=t._pos,t._sectionPlane&&(t._sectionPlane.pos=t._pos)}),I=function(){var e=J.vec4(),i=J.vec4(),s=J.vec4(),r=J.vec4();return function(n,o,a){if(F(n,r),!(S(o,r,e)&&S(a,r,i))){var l=E(r,o,a);S(o,l,e,1),S(a,l,i,1);var u=J.dotVec3(e,r);e[0]-=u*r[0],e[1]-=u*r[1],e[2]-=u*r[2],u=J.dotVec3(i,r),i[0]-=u*r[0],i[1]-=u*r[1],i[2]-=u*r[2]}J.normalizeVec3(e),J.normalizeVec3(i),u=J.dotVec3(e,i),u=J.clamp(u,-1,1);var A=Math.acos(u)*J.RADTODEG;J.cross3Vec3(e,i,s),J.dotVec3(s,r)<0&&(A=-A),t._rootNode.rotate(n,A),T()}}(),S=function(){var e=J.vec4([0,0,0,1]),i=J.mat4();return function(s,r,n,o){o=o||0,e[0]=s[0]/g.width*2-1,e[1]=-(s[1]/g.height*2-1),e[2]=0,e[3]=1,J.mulMat4(m.projMatrix,m.viewMatrix,i),J.inverseMat4(i),J.transformVec4(i,e,e),J.mulVec4Scalar(e,1/e[3]);var a=m.eye;J.subVec4(e,a,e);var l=t._sectionPlane.pos,u=-J.dotVec3(l,r)-o,A=J.dotVec3(r,e);if(Math.abs(A)>.005){var c=-(J.dotVec3(r,a)+u)/A;return J.mulVec3Scalar(e,c,n),J.addVec3(n,a),J.subVec3(n,l,n),!0}return!1}}(),T=function(){var e=J.vec3(),i=J.mat4();return function(){t.sectionPlane&&(J.quaternionToMat4(A.quaternion,i),J.transformVec3(i,[0,0,1],e),t._setSectionPlaneDir(e))}}(),L=!1;this._onCameraControlHover=this._viewer.cameraControl.on("hoverEnter",(function(t){if(e._visible&&!L){var u;switch(i=!1,C&&(C.visible=!1),t.entity.id){case e._displayMeshes.xAxisArrowHandle.id:case e._displayMeshes.xAxisHandle.id:u=e._affordanceMeshes.xAxisArrow,c=r;break;case e._displayMeshes.yAxisArrowHandle.id:case e._displayMeshes.yShaftHandle.id:u=e._affordanceMeshes.yAxisArrow,c=n;break;case e._displayMeshes.zAxisArrowHandle.id:case e._displayMeshes.zAxisHandle.id:u=e._affordanceMeshes.zAxisArrow,c=o;break;case e._displayMeshes.xCurveHandle.id:u=e._affordanceMeshes.xHoop,c=a;break;case e._displayMeshes.yCurveHandle.id:u=e._affordanceMeshes.yHoop,c=l;break;default:return void(c=s)}u&&(u.visible=!0),C=u,i=!0}})),this._onCameraControlHoverLeave=this._viewer.cameraControl.on("hoverOut",(function(t){e._visible&&(C&&(C.visible=!1),C=null,c=s,i=!1)})),g.addEventListener("mousedown",this._canvasMouseDownListener=function(t){if(t.preventDefault(),e._visible&&i&&(e._viewer.cameraControl.pointerEnabled=!1,1===t.which)){L=!0;var s=M(t);h=c,d[0]=s[0],d[1]=s[1],e.plugin.fire("clickPlaneStart")}}),g.addEventListener("mousemove",this._canvasMouseMoveListener=function(t){if(e._visible&&L&&i){var s=M(t),A=s[0],c=s[1];switch(h){case r:D(p,d,s);break;case n:D(f,d,s);break;case o:D(v,d,s);break;case a:I(p,d,s);break;case l:I(f,d,s);break;case u:I(v,d,s)}d[0]=A,d[1]=c}}),g.addEventListener("mouseup",this._canvasMouseUpListener=function(t){e._visible&&(e._viewer.cameraControl.pointerEnabled=!0,L&&(L=!1,i=!1,e.plugin.fire("clickPlaneEnd")))}),g.addEventListener("wheel",this._canvasWheelListener=function(t){if(e._visible)Math.max(-1,Math.min(1,40*-t.deltaY))}),this._onCameraControlHover=this._viewer.cameraControl.on("touchEntity",(function(t){if(e._visible&&!L&&!i){var u;switch(i=!1,C&&(C.visible=!1),t.entity.id){case e._displayMeshes.xAxisArrowHandle.id:case e._displayMeshes.xAxisHandle.id:u=e._affordanceMeshes.xAxisArrow,c=r;break;case e._displayMeshes.yAxisArrowHandle.id:case e._displayMeshes.yShaftHandle.id:u=e._affordanceMeshes.yAxisArrow,c=n;break;case e._displayMeshes.zAxisArrowHandle.id:case e._displayMeshes.zAxisHandle.id:u=e._affordanceMeshes.zAxisArrow,c=o;break;case e._displayMeshes.xCurveHandle.id:u=e._affordanceMeshes.xHoop,c=a;break;case e._displayMeshes.yCurveHandle.id:u=e._affordanceMeshes.yHoop,c=l;break;default:return void(c=s)}u&&(u.visible=!0),C=u,i=!0}})),g.addEventListener("touchstart",this._canvasMouseDownListener=function(t){if(t.preventDefault(),e._visible&&i){e._viewer.cameraControl.pointerEnabled=!1,L=!0;var s=k(t);h=c,d[0]=s[0],d[1]=s[1],e.plugin.fire("touchPlaneStart")}}),g.addEventListener("touchmove",this._canvasMouseMoveListener=function(t){if(e._visible&&L){var i=k(t),s=i[0],A=i[1];switch(h){case r:D(p,d,i);break;case n:D(f,d,i);break;case o:D(v,d,i);break;case a:I(p,d,i);break;case l:I(f,d,i);break;case u:I(v,d,i)}d[0]=s,d[1]=A}}),g.addEventListener("touchend",this._canvasTouchEndListener=function(t){e._visible&&(e._viewer.cameraControl.pointerEnabled=!0,C&&(C.visible=!1),C=null,c=s,L=!1,i=!1,e.plugin.fire("touchPlaneEnd"))}),g.addEventListener("touchcancel",this._canvasTouchEndListener)}},{key:"_destroy",value:function(){this._unbindEvents(),this._destroyNodes()}},{key:"_unbindEvents",value:function(){var e=this._viewer,t=e.scene,i=t.canvas.canvas,s=e.camera,r=e.cameraControl;t.off(this._onSceneTick),i.removeEventListener("mousedown",this._canvasMouseDownListener),i.removeEventListener("mousemove",this._canvasMouseMoveListener),i.removeEventListener("mouseup",this._canvasMouseUpListener),i.removeEventListener("wheel",this._canvasWheelListener),i.removeEventListener("touchend",this._canvasTouchEndListener),i.removeEventListener("touchcancel",this._canvasTouchEndListener),s.off(this._onCameraViewMatrix),s.off(this._onCameraProjMatrix),r.off(this._onCameraControlHover),r.off(this._onCameraControlHoverLeave)}},{key:"_destroyNodes",value:function(){this._setSectionPlane(null),this._rootNode.destroy(),this._displayMeshes={},this._affordanceMeshes={}}}])}(),fE=new Float64Array([0,0,1]),vE=new Float64Array(4),gE=function(){return w((function e(t,i){B(this,e),this.id=i.id,this.type="plane",this.plugin=t,this._viewer=t.viewer,this._scene=t.viewer.scene,i?(this._controlFillColor=i.controlFillColor?i.controlFillColor:[.3,.6,1],this._planeSize=i.planeSize?i.planeSize:1,this._controlSize=i.controlSize?i.controlSize:.07,this._planeOpacity=i.planeOpacity?i.planeOpacity:.4,this._enableClip=!!i.enableClip):(this._controlFillColor=[.3,.6,1],this._planeSize=1,this._controlSize=.07,this._planeOpacity=.4,this._enableClip=!1),this._visible=!1,this._pos=J.vec3(),this._origin=J.vec3(),this._rtcPos=J.vec3(),this._baseDir=J.vec3(),this._rootNode=null,this._displayMeshes=null,this._affordanceMeshes=null,this._ignoreNextSectionPlaneDirUpdate=!1}),[{key:"_createNodes",value:function(){var e=this._viewer.scene;this._rootNode=new Bn(e,{id:this.id,position:[0,0,0],scale:[1,1,1],isObject:!1});var t,i,s=this._rootNode,r=e.aabb,n=r[3]-r[0],o=r[4]-r[1],a=r[5]-r[2];0!=this.dir[0]?(t=a>0?1*a:1*a*-1,i=o>0?1*o:1*o*-1):0!=this.dir[1]?(t=n>0?1*n:1*n*-1,i=a>0?1*a:1*a*-1):0!=this.dir[2]&&(t=n>0?1*n:1*n*-1,i=o>0?1*o:1*o*-1),t+=0,i+=0,this._displayMeshes={plane:s.addChild(new nn(s,{geometry:new Ti(s,{primitive:"triangles",positions:[t/2,i/2,.01,t/2,-i/2,.01,-t/2,-i/2,.01,-t/2,i/2,.01],indices:[0,1,2,2,3,0]}),material:new Qi(s,{emissive:[.1,.1,.1],diffuse:this._controlFillColor,backfaces:!0}),opacity:this._planeOpacity,ghosted:!0,ghostMaterial:new Vi(s,{edges:!1,filled:!0,fillColor:this._controlFillColor,fillAlpha:.1,backfaces:!0}),pickable:this.pickable,collidable:!1,clippable:this._enableClip,visible:!1,scale:[1*this._planeSize,1*this._planeSize,1*this._planeSize],isObject:!1}),false)},this._affordanceMeshes={plane:s.addChild(new nn(s,{geometry:new Ti(s,{primitive:"triangles",positions:[t/2,i/2,.012,t/2,-i/2,.012,-t/2,-i/2,.012,-t/2,i/2,.012],indices:[0,1,2,2,3,0]}),material:new Qi(s,{emissive:[.6,.6,5],diffuse:this._controlFillColor,backfaces:!0}),opacity:this._planeOpacity,ghosted:!0,ghostMaterial:new Vi(s,{edges:!1,filled:!0,fillColor:this._controlFillColor,fillAlpha:.1,backfaces:!0}),pickable:!0,collidable:!1,clippable:!0,visible:!1,scale:[1*this._planeSize,1*this._planeSize,1*this._planeSize],isObject:!1}),false)}}},{key:"_setSectionPlane",value:function(e){var t=this;this._sectionPlane&&(this._sectionPlane.off(this._onSectionPlanePos),this._sectionPlane.off(this._onSectionPlaneDir),this._onSectionPlanePos=null,this._onSectionPlaneDir=null,this._sectionPlane=null),e&&(this.id=e.controlId,this.dir=e.dir,this._createNodes(),this._bindEvents(),this._setPos(e.pos),this._setDir(e.dir),this._sectionPlane=e,e.control=this,this._onSectionPlanePos=e.on("pos",(function(){t._setPos(t._sectionPlane.pos)})),this._onSectionPlaneDir=e.on("dir",(function(){t._ignoreNextSectionPlaneDirUpdate?t._ignoreNextSectionPlaneDirUpdate=!1:t._setDir(t._sectionPlane.dir)})))}},{key:"sectionPlane",get:function(){return this._sectionPlane}},{key:"pos",get:function(){return this._pos},set:function(e){if(!(e<0||e>100)){var t=this._scene.aabb,i=this._scene.center,s=t[3]-t[0],r=t[4]-t[1],n=t[5]-t[2],o=J.vec3();o[0]=this.pos[0],o[1]=this.pos[1],o[2]=this.pos[2];var a,l=this._sectionPlane.dir;0!=l[0]?(a=e/100*s,o[0]=i[0]-s/2+a):0!=l[1]?(a=e/100*r,o[1]=i[1]-r/2+a):0!=l[2]&&(a=e/100*n,o[2]=i[2]-n/2+a),this._sectionPlane.pos=o}}},{key:"posRate",get:function(){var e=this._scene.aabb,t=this._scene.center,i=e[3]-e[0],s=e[4]-e[1],r=e[5]-e[2],n=this._sectionPlane.pos,o=this._sectionPlane.dir,a=0;if(0!=o[0])a=(n[0]-(t[0]-i/2))/i*100;else if(0!=o[1]){a=(n[1]-(t[1]-s/2))/s*100}else if(0!=o[2]){a=(n[2]-(t[2]-r/2))/r*100}return a=Math.max(0,Math.min(100,a)),parseInt(a)}},{key:"_setPos",value:function(e){this._pos.set(e),xe(this._pos,this._origin,this._rtcPos),this._rootNode.origin=this._origin,this._rootNode.position=this._rtcPos}},{key:"_setDir",value:function(e){this._baseDir.set(e),this._rootNode.quaternion=J.vec3PairToQuaternion(fE,e,vE)}},{key:"_setSectionPlaneDir",value:function(e){this._sectionPlane&&(this._ignoreNextSectionPlaneDirUpdate=!0,this._sectionPlane.dir=e)}},{key:"setVisible",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this._visible!==e){var t;for(t in this._visible=e,this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].visible=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].visible=e)}}},{key:"getVisible",value:function(){return this._visible}},{key:"setCulled",value:function(e){var t;for(t in this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].culled=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].culled=e)}},{key:"_bindEvents",value:function(){var e=this,t=this,i=!1,s=-1,r=0,n=1,o=2;this._rootNode;var a=null,l=null,u=J.vec2();this.lastCanvasPos=u;var A=J.vec3([1,0,0]),c=J.vec3([0,1,0]),h=J.vec3([0,0,1]),d=this._viewer.scene.canvas.canvas,p=this._viewer.camera,f=this._viewer.scene;this._onCameraViewMatrix=f.camera.on("viewMatrix",(function(){})),this._onCameraProjMatrix=f.camera.on("projMatrix",(function(){}));var v,g,m,_,y,b=function(){var e=new Float64Array(2);return function(t){if(t){for(var i=t.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;e[0]=t.pageX-s,e[1]=t.pageY-r}else t=window.event,e[0]=t.x,e[1]=t.y;return e}}(),B=function(){var e=J.mat4();return function(i,s){return J.quaternionToMat4(t._rootNode.quaternion,e),J.transformVec3(e,i,s),J.normalizeVec3(s),s}}(),x=(v=J.vec3(),function(e){var t=Math.abs(e[0]);return t>Math.abs(e[1])&&t>Math.abs(e[2])?J.cross3Vec3(e,[0,1,0],v):J.cross3Vec3(e,[1,0,0],v),J.cross3Vec3(v,e,v),J.normalizeVec3(v),v}),w=(g=J.vec3(),m=J.vec3(),_=J.vec4(),function(e,i,s){B(e,_);var r=x(_,i,s);P(i,r,g),P(s,r,m),J.subVec3(m,g);var n,o=J.dotVec3(m,_),a=t._sectionPlane.dir,l=t._sectionPlane.planeId,u=t._sectionPlane.posRangeMin;if(n=t._sectionPlane.box.boxRanges[(l+3)%6],0!=a[0]){if(a[0]>0){if(n=t._sectionPlane.box.boxRanges[(l+3)%6],t._pos[0]+_[0]*o*.6<u[0]||t._pos[0]+_[0]*o*.6>n[0]-.3)return}else if(t._pos[0]+_[0]*o*.6>u[0]||t._pos[0]+_[0]*o*.6<n[0]+.3)return}else if(0!=a[1]){if(a[1]>0){if(t._pos[1]+_[1]*o*.6<u[1]||t._pos[1]+_[1]*o*.6>n[1]-.3)return}else if(t._pos[1]+_[1]*o*.6>u[1]||t._pos[1]+_[1]*o*.6<n[1]+.3)return}else if(0!=a[2])if(a[2]>0){if(t._pos[2]+_[2]*o*.6<u[2]||t._pos[2]+_[2]*o*.6>n[2]-.3)return}else if(t._pos[2]+_[2]*o*.6>u[2]||t._pos[2]+_[2]*o*.6<n[2]+.3)return;t._pos[0]+=_[0]*o*.6,t._pos[1]+=_[1]*o*.6,t._pos[2]+=_[2]*o*.6,t._rootNode.position=t._pos,t._sectionPlane&&(t._sectionPlane.pos=t._pos)}),P=function(){var e=J.vec4([0,0,0,1]),i=J.mat4();return function(s,r,n,o){o=o||0,e[0]=s[0]/d.width*2-1,e[1]=-(s[1]/d.height*2-1),e[2]=0,e[3]=1,J.mulMat4(p.projMatrix,p.viewMatrix,i),J.inverseMat4(i),J.transformVec4(i,e,e),J.mulVec4Scalar(e,1/e[3]);var a=p.eye;J.subVec4(e,a,e);var l=t._sectionPlane.pos,u=-J.dotVec3(l,r)-o,A=J.dotVec3(r,e);if(Math.abs(A)>.005){var c=-(J.dotVec3(r,a)+u)/A;return J.mulVec3Scalar(e,c,n),J.addVec3(n,a),J.subVec3(n,l,n),!0}return!1}}(),C=!1;this._onCameraControlHover=this._viewer.cameraControl.on("hoverEnter",(function(t){var r;e._visible&&(C||(i=!1,y&&(y.visible=!1),t.entity.id===e._displayMeshes.plane.id?(r=e._affordanceMeshes.plane,a=o,r&&(r.visible=!0),y=r,i=!0):a=s))})),this._onCameraControlHoverLeave=this._viewer.cameraControl.on("hoverOut",(function(t){e._visible&&(y&&(y.visible=!1),a=s,i=!1)})),d.addEventListener("mousedown",this._canvasMouseDownListener=function(t){if(t.preventDefault(),e._visible&&i&&(e._viewer.cameraControl.pointerEnabled=!1,1===t.which)){C=!0;var s=b(t);l=a,u[0]=s[0],u[1]=s[1],e.plugin.fire("clickPlaneStart")}}),d.addEventListener("mousemove",this._canvasMouseMoveListener=function(t){if(e._visible&&C){var i=b(t),s=i[0],a=i[1];switch(l){case r:w(A,u,i);break;case n:w(c,u,i);break;case o:w(h,u,i)}u[0]=s,u[1]=a}}),d.addEventListener("mouseup",this._canvasMouseUpListener=function(t){e._visible&&(e._viewer.cameraControl.pointerEnabled=!0,C&&(C=!1,i=!1,e.plugin.fire("clickPlaneEnd")))}),d.addEventListener("wheel",this._canvasWheelListener=function(t){if(e._visible)Math.max(-1,Math.min(1,40*-t.deltaY))})}},{key:"_destroy",value:function(){this._unbindEvents(),this._destroyNodes()}},{key:"_unbindEvents",value:function(){var e=this._viewer,t=e.scene,i=t.canvas.canvas,s=e.camera,r=e.cameraControl;t.off(this._onSceneTick),i.removeEventListener("mousedown",this._canvasMouseDownListener),i.removeEventListener("mousemove",this._canvasMouseMoveListener),i.removeEventListener("mouseup",this._canvasMouseUpListener),i.removeEventListener("wheel",this._canvasWheelListener),i.removeEventListener("touchend",this._canvasTouchEndListener),i.removeEventListener("touchcancel",this._canvasTouchEndListener),s.off(this._onCameraViewMatrix),s.off(this._onCameraProjMatrix),r.off(this._onCameraControlHover),r.off(this._onCameraControlHoverLeave)}},{key:"_destroyNodes",value:function(){this._setSectionPlane(null),this._rootNode.destroy(),this._displayMeshes={},this._affordanceMeshes={}}}])}(),mE=new Float64Array([0,0,1]),_E=new Float64Array(4),yE=function(){return w((function e(t,i){B(this,e),this.id=null,this.type="plane",this.plugin=t,this._viewer=t.viewer,this._scene=t.viewer.scene,this._controlFillColor=i&&i.controlFillColor?i.controlFillColor:[.1,.4,.99],this._planeSize=i&&i.planeSize?i.planeSize:1,this._controlSize=i&&i.controlSize?i.controlSize:.07,this._planeOpacity=i&&i.planeOpacity?i.planeOpacity:.4,this._visible=!1,this._pos=J.vec3(),this._origin=J.vec3(),this._rtcPos=J.vec3(),this._baseDir=J.vec3(),this._rootNode=null,this._displayMeshes=null,this._affordanceMeshes=null,this._ignoreNextSectionPlaneDirUpdate=!1,this._createNodes(),this._bindEvents()}),[{key:"_createNodes",value:function(){var e=this._viewer.scene;this._rootNode=new Bn(e,{position:[0,0,0],scale:[5,5,5],isObject:!1});var t=this._rootNode;this._displayMeshes={plane:t.addChild(new nn(t,{geometry:new Ti(t,{primitive:"triangles",positions:[.5,.5,.02,.5,-.5,.02,-.5,-.5,.02,-.5,.5,.02],indices:[0,1,2,2,3,0]}),material:new Qi(t,{emissive:[0,0,0],diffuse:this._controlFillColor,backfaces:!0}),opacity:this._planeOpacity,ghosted:!0,ghostMaterial:new Vi(t,{edges:!1,filled:!0,fillColor:this._controlFillColor?this._controlFillColor:[.1,.4,.99],fillAlpha:.1,backfaces:!0}),pickable:!0,collidable:!1,clippable:!1,visible:!1,scale:[2.4*this._planeSize,2.4*this._planeSize,1*this._planeSize],isObject:!1}),!1)},this._affordanceMeshes={}}},{key:"_setSectionPlane",value:function(e){var t=this;this._sectionPlane&&(this._sectionPlane.off(this._onSectionPlanePos),this._sectionPlane.off(this._onSectionPlaneDir),this._onSectionPlanePos=null,this._onSectionPlaneDir=null,this._sectionPlane=null),e&&(this.id=e.id,this._setPos(e.pos),this._setDir(e.dir),this._sectionPlane=e,e.control=this,this._onSectionPlanePos=e.on("pos",(function(){t._setPos(t._sectionPlane.pos)})),this._onSectionPlaneDir=e.on("dir",(function(){t._ignoreNextSectionPlaneDirUpdate?t._ignoreNextSectionPlaneDirUpdate=!1:t._setDir(t._sectionPlane.dir)})))}},{key:"sectionPlane",get:function(){return this._sectionPlane}},{key:"pos",get:function(){return this._pos},set:function(e){if(!(e<0||e>100)){var t=this._scene.aabb,i=this._scene.center,s=t[3]-t[0],r=t[4]-t[1],n=t[5]-t[2],o=J.vec3();o[0]=this.pos[0],o[1]=this.pos[1],o[2]=this.pos[2];var a,l=this._sectionPlane.dir;0!=l[0]?(a=e/100*s,o[0]=i[0]-s/2+a):0!=l[1]?(a=e/100*r,o[1]=i[1]-r/2+a):0!=l[2]&&(a=e/100*n,o[2]=i[2]-n/2+a),this._sectionPlane.pos=o}}},{key:"posRate",get:function(){var e=this._scene.aabb,t=this._scene.center,i=e[3]-e[0],s=e[4]-e[1],r=e[5]-e[2],n=this._sectionPlane.pos,o=this._sectionPlane.dir,a=0;if(0!=o[0])a=(n[0]-(t[0]-i/2))/i*100;else if(0!=o[1]){a=(n[1]-(t[1]-s/2))/s*100}else if(0!=o[2]){a=(n[2]-(t[2]-r/2))/r*100}return a=Math.max(0,Math.min(100,a)),parseInt(a)}},{key:"_setPos",value:function(e){this._pos.set(e),xe(this._pos,this._origin,this._rtcPos),this._rootNode.origin=this._origin,this._rootNode.position=this._rtcPos}},{key:"_setDir",value:function(e){this._baseDir.set(e),this._rootNode.quaternion=J.vec3PairToQuaternion(mE,e,_E)}},{key:"_setSectionPlaneDir",value:function(e){this._sectionPlane&&(this._ignoreNextSectionPlaneDirUpdate=!0,this._sectionPlane.dir=e)}},{key:"setVisible",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this._visible!==e){var t;for(t in this._visible=e,this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].visible=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].visible=e)}}},{key:"getVisible",value:function(){return this._visible}},{key:"setCulled",value:function(e){var t;for(t in this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].culled=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].culled=e)}},{key:"_bindEvents",value:function(){var e=this,t=this,i=!1,s=-1,r=0,n=1,o=2;this._rootNode;var a=null,l=null,u=J.vec2();this.lastCanvasPos=u;var A=J.vec3([1,0,0]),c=J.vec3([0,1,0]),h=J.vec3([0,0,1]),d=this._viewer.scene.canvas.canvas,p=this._viewer.camera,f=this._viewer.scene,v=J.vec3([0,0,0]),g=-1;this._onCameraViewMatrix=f.camera.on("viewMatrix",(function(){})),this._onCameraProjMatrix=f.camera.on("projMatrix",(function(){})),this._onSceneTick=f.on("tick",(function(){var t=Math.abs(J.lenVec3(J.subVec3(f.camera.eye,e._pos,v)));t!==g&&"perspective"===p.projection&&(Math.tan(p.perspective.fov*J.DEGTORAD),g=t),"ortho"===p.projection&&(p.ortho.scale,g=t)}));var m,_,y,b,B=function(){var e=new Float64Array(2);return function(t){if(t){for(var i=t.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;e[0]=t.pageX-s,e[1]=t.pageY-r}else t=window.event,e[0]=t.x,e[1]=t.y;return e}}(),x=function(){var e=new Float64Array(2);return function(t){if(t||(t=window.event),t.touches&&t.touches.length)e[0]=t.touches[0].pageX,e[1]=t.touches[0].pageY;else{for(var i=t.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;e[0]=t.pageX-s,e[1]=t.pageY-r}return e}}(),w=function(){var e=J.mat4();return function(i,s){return J.quaternionToMat4(t._rootNode.quaternion,e),J.transformVec3(e,i,s),J.normalizeVec3(s),s}}(),P=(m=J.vec3(),function(e){var t=Math.abs(e[0]);return t>Math.abs(e[1])&&t>Math.abs(e[2])?J.cross3Vec3(e,[0,1,0],m):J.cross3Vec3(e,[1,0,0],m),J.cross3Vec3(m,e,m),J.normalizeVec3(m),m}),C=(_=J.vec3(),y=J.vec3(),b=J.vec4(),function(e,i,s){w(e,b);var r=P(b,i,s);M(i,r,_),M(s,r,y),J.subVec3(y,_);var n=J.dotVec3(y,b);t._pos[0]+=b[0]*n*.6,t._pos[1]+=b[1]*n*.6,t._pos[2]+=b[2]*n*.6,t._rootNode.position=t._pos,t._sectionPlane&&(t._sectionPlane.pos=t._pos)}),M=function(){var e=J.vec4([0,0,0,1]),i=J.mat4();return function(s,r,n,o){o=o||0,e[0]=s[0]/d.width*2-1,e[1]=-(s[1]/d.height*2-1),e[2]=0,e[3]=1,J.mulMat4(p.projMatrix,p.viewMatrix,i),J.inverseMat4(i),J.transformVec4(i,e,e),J.mulVec4Scalar(e,1/e[3]);var a=p.eye;J.subVec4(e,a,e);var l=t._sectionPlane.pos,u=-J.dotVec3(l,r)-o,A=J.dotVec3(r,e);if(Math.abs(A)>.005){var c=-(J.dotVec3(r,a)+u)/A;return J.mulVec3Scalar(e,c,n),J.addVec3(n,a),J.subVec3(n,l,n),!0}return!1}}(),k=!1;this._onCameraControlHover=this._viewer.cameraControl.on("hoverEnter",(function(t){e._visible&&(k||(i=!1,t.entity.id===e._displayMeshes.plane.id?(a=o,i=!0):a=s))})),this._onCameraControlHoverLeave=this._viewer.cameraControl.on("hoverOut",(function(t){e._visible&&(a=s,i=!1)})),d.addEventListener("mousedown",this._canvasMouseDownListener=function(t){if(t.preventDefault(),e._visible&&i&&(e._viewer.cameraControl.pointerEnabled=!1,1===t.which)){k=!0;var s=B(t);l=a,u[0]=s[0],u[1]=s[1],e.plugin.fire("clickPlaneStart")}}),d.addEventListener("mousemove",this._canvasMouseMoveListener=function(t){if(e._visible&&k){var i=B(t),s=i[0],a=i[1];switch(l){case r:C(A,u,i);break;case n:C(c,u,i);break;case o:C(h,u,i)}u[0]=s,u[1]=a}}),d.addEventListener("mouseup",this._canvasMouseUpListener=function(t){e._visible&&(e._viewer.cameraControl.pointerEnabled=!0,k&&(t.which,k=!1,i=!1,e.plugin.fire("clickPlaneEnd")))}),d.addEventListener("wheel",this._canvasWheelListener=function(t){if(e._visible)Math.max(-1,Math.min(1,40*-t.deltaY))}),this._onCameraControlHover=this._viewer.cameraControl.on("touchEntity",(function(t){var r;!e._visible||k||i||(t.entity.id===e._displayMeshes.plane.id?(r=e._affordanceMeshes.plane,a=o,r&&(r.visible=!0),i=!0,k=!0):a=s)})),d.addEventListener("touchstart",this._canvasMouseDownListener=function(t){if(t.preventDefault(),e._visible&&i&&k){e._viewer.cameraControl.pointerEnabled=!1;var s=x(t);l=a,u[0]=s[0],u[1]=s[1],e.plugin.fire("touchPlaneStart")}}),d.addEventListener("touchmove",this._canvasMouseMoveListener=function(t){if(e._visible&&k&&i){var s=x(t),a=s[0],d=s[1];switch(l){case r:C(A,u,s);break;case n:C(c,u,s);break;case o:C(h,u,s)}u[0]=a,u[1]=d}}),d.addEventListener("touchend",this._canvasTouchEndListener=function(t){e._visible&&(i&&(e._viewer.cameraControl.pointerEnabled=!0),a=s,k=!1,i=!1,e.plugin.fire("touchPlaneEnd"))}),d.addEventListener("touchcancel",this._canvasTouchEndListener)}},{key:"_destroy",value:function(){this._unbindEvents(),this._destroyNodes()}},{key:"_unbindEvents",value:function(){var e=this._viewer,t=e.scene,i=t.canvas.canvas,s=e.camera,r=e.cameraControl;t.off(this._onSceneTick),i.removeEventListener("mousedown",this._canvasMouseDownListener),i.removeEventListener("mousemove",this._canvasMouseMoveListener),i.removeEventListener("mouseup",this._canvasMouseUpListener),i.removeEventListener("wheel",this._canvasWheelListener),i.removeEventListener("touchend",this._canvasTouchEndListener),i.removeEventListener("touchcancel",this._canvasTouchEndListener),s.off(this._onCameraViewMatrix),s.off(this._onCameraProjMatrix),r.off(this._onCameraControlHover),r.off(this._onCameraControlHoverLeave)}},{key:"_destroyNodes",value:function(){this._setSectionPlane(null),this._rootNode.destroy(),this._displayMeshes={},this._affordanceMeshes={}}}])}(),bE=function(){return w((function e(t,i,s){var r=this;B(this,e),this.id=s.id,this._sectionPlane=s,this._mesh=new nn(i,{id:s.id,geometry:new Ti(i,Li({xSize:.5,ySize:.5,zSize:.001})),material:new Qi(i,{emissive:[1,1,1],diffuse:[0,0,0],backfaces:!1}),edgeMaterial:new ji(i,{edgeColor:[0,0,0],edgeAlpha:1,edgeWidth:1}),highlightMaterial:new Vi(i,{fill:!0,fillColor:[.5,1,.5],fillAlpha:.7,edges:!0,edgeColor:[0,0,0],edgeAlpha:1,edgeWidth:1}),selectedMaterial:new Vi(i,{fill:!0,fillColor:[0,0,1],fillAlpha:.7,edges:!0,edgeColor:[1,0,0],edgeAlpha:1,edgeWidth:1}),highlighted:!0,scale:[3,3,3],position:[0,0,0],rotation:[0,0,0],opacity:.3,edges:!0});var n=J.vec3([0,0,0]),o=J.vec3(),a=J.vec3([0,0,1]),l=J.vec4(4),u=J.vec3(),A=function(){var e=r._sectionPlane.scene.center,t=[-r._sectionPlane.dir[0],-r._sectionPlane.dir[1],-r._sectionPlane.dir[2]];J.subVec3(e,r._sectionPlane.pos,n);var i=-J.dotVec3(t,n);J.normalizeVec3(t),J.mulVec3Scalar(t,i,o);var s=J.vec3PairToQuaternion(a,r._sectionPlane.dir,l);u[0]=.1*o[0],u[1]=.1*o[1],u[2]=.1*o[2],r._mesh.quaternion=s,r._mesh.position=u};this._onSectionPlanePos=this._sectionPlane.on("pos",A),this._onSectionPlaneDir=this._sectionPlane.on("dir",A),this._highlighted=!1,this._selected=!1}),[{key:"setHighlighted",value:function(e){this._highlighted=!!e,this._mesh.highlighted=this._highlighted,this._mesh.highlightMaterial.fillColor=e?[0,.7,0]:[0,0,0]}},{key:"getHighlighted",value:function(){return this._highlighted}},{key:"setSelected",value:function(e){this._selected=!!e,this._mesh.edgeMaterial.edgeWidth=e?3:1,this._mesh.highlightMaterial.edgeWidth=e?3:1}},{key:"getSelected",value:function(){return this._selected}},{key:"destroy",value:function(){this._sectionPlane.off(this._onSectionPlanePos),this._sectionPlane.off(this._onSectionPlaneDir),this._mesh.destroy()}}])}(),BE=function(){return w((function e(t,i,s){var r=this;B(this,e),this.id=sectionPlane.id,this._sectionBox=s,this._mesh=new nn(i,{id:sectionPlane.id,geometry:new Ti(i,Li({xSize:.5,ySize:.5,zSize:.001})),material:new Qi(i,{emissive:[1,1,1],diffuse:[0,0,0],backfaces:!1}),edgeMaterial:new ji(i,{edgeColor:[0,0,0],edgeAlpha:1,edgeWidth:1}),highlightMaterial:new Vi(i,{fill:!0,fillColor:[.5,1,.5],fillAlpha:.7,edges:!0,edgeColor:[0,0,0],edgeAlpha:1,edgeWidth:1}),selectedMaterial:new Vi(i,{fill:!0,fillColor:[0,0,1],fillAlpha:.7,edges:!0,edgeColor:[1,0,0],edgeAlpha:1,edgeWidth:1}),highlighted:!0,scale:[3,3,3],position:[0,0,0],rotation:[0,0,0],opacity:.3,edges:!0});var n=J.vec3([0,0,0]),o=J.vec3(),a=J.vec3([0,0,1]),l=J.vec4(4),u=J.vec3(),A=function(){var e=r._sectionBox.scene.center,t=[-r._sectionBox.dir[0],-r._sectionBox.dir[1],-r._sectionBox.dir[2]];J.subVec3(e,r._sectionBox.pos,n);var i=-J.dotVec3(t,n);J.normalizeVec3(t),J.mulVec3Scalar(t,i,o);var s=J.vec3PairToQuaternion(a,r._sectionBox.dir,l);u[0]=.1*o[0],u[1]=.1*o[1],u[2]=.1*o[2],r._mesh.quaternion=s,r._mesh.position=u};this._onSectionPlanePos=this._sectionBox.on("pos",A),this._onSectionPlaneDir=this._sectionBox.on("dir",A),this._highlighted=!1,this._selected=!1}),[{key:"setHighlighted",value:function(e){this._highlighted=!!e,this._mesh.highlighted=this._highlighted,this._mesh.highlightMaterial.fillColor=e?[0,.7,0]:[0,0,0]}},{key:"getHighlighted",value:function(){return this._highlighted}},{key:"setSelected",value:function(e){this._selected=!!e,this._mesh.edgeMaterial.edgeWidth=e?3:1,this._mesh.highlightMaterial.edgeWidth=e?3:1}},{key:"getSelected",value:function(){return this._selected}},{key:"destroy",value:function(){this._sectionBox.off(this._onSectionPlanePos),this._sectionBox.off(this._onSectionPlaneDir),this._mesh.destroy()}}])}(),xE=function(){return w((function e(t,i){var s=this;if(B(this,e),!(i.onHoverEnterPlane&&i.onHoverLeavePlane&&i.onClickedNothing&&i.onClickedPlane))throw"Missing config(s): onHoverEnterPlane, onHoverLeavePlane, onClickedNothing || onClickedPlane";this.plugin=t,this._viewer=t.viewer,this._onHoverEnterPlane=i.onHoverEnterPlane,this._onHoverLeavePlane=i.onHoverLeavePlane,this._onClickedNothing=i.onClickedNothing,this._onClickedPlane=i.onClickedPlane,this._visible=!0,this._planes={},this._box=null,this._canvas=i.overviewCanvas,this._scene=new $i(this._viewer,{canvasId:this._canvas.id,transparent:!0,spinnerElementId:"overviewer_spinner"}),this._scene.clearLights(),new _i(this._scene,{dir:[.4,-.4,.8],color:[.8,1,1],intensity:1,space:"view"}),new _i(this._scene,{dir:[-.8,-.3,-.4],color:[.8,.8,.8],intensity:1,space:"view"}),new _i(this._scene,{dir:[.8,-.6,-.8],color:[1,1,1],intensity:1,space:"view"}),this._scene.camera,this._scene.camera.perspective.fov=70,this._zUp=!1;var r=this._scene.camera,n=J.rotationMat4c(-90*J.DEGTORAD,1,0,0),o=J.vec3(),a=J.vec3(),l=J.vec3();this._synchCamera=function(){var e=s._viewer.camera.eye,t=s._viewer.camera.look,i=s._viewer.camera.up;J.mulVec3Scalar(J.normalizeVec3(J.subVec3(e,t,o)),7),s._zUp?(J.transformVec3(n,o,a),J.transformVec3(n,i,l),r.look=[0,0,0],r.eye=J.transformVec3(n,o,a),r.up=J.transformPoint3(n,i,l)):(r.look=[0,0,0],r.eye=o,r.up=i)},this._onViewerCameraMatrix=this._viewer.camera.on("matrix",this._synchCamera),this._onViewerCameraWorldAxis=this._viewer.camera.on("worldAxis",this._synchCamera),this._onViewerCameraFOV=this._viewer.camera.perspective.on("fov",(function(e){s._scene.camera.perspective.fov=e}));var u=null;this._onInputMouseMove=this._scene.input.on("mousemove",(function(e){var t=s._scene.pick({canvasPos:e});if(t){if(!u||t.entity.id!==u.id){if(u)s._planes[u.id]&&s._onHoverLeavePlane(u.id);u=t.entity,s._planes[u.id]&&s._onHoverEnterPlane(u.id)}}else u&&(s._onHoverLeavePlane(u.id),u=null)})),this._scene.canvas.canvas.addEventListener("mouseup",this._onCanvasMouseUp=function(){u?s._planes[u.id]&&s._onClickedPlane(u.id):s._onClickedNothing()}),this._scene.canvas.canvas.addEventListener("mouseout",this._onCanvasMouseOut=function(){u&&(s._onHoverLeavePlane(u.id),u=null)}),this.setVisible(i.overviewVisible)}),[{key:"addSectionPlane",value:function(e){this._planes[e.id]=new bE(this,this._scene,e)}},{key:"setSectionBox",value:function(e){this._box=new BE(this,this._scene,e)}},{key:"setPlaneHighlighted",value:function(e,t){var i=this._planes[e];i&&i.setHighlighted(t)}},{key:"setPlaneSelected",value:function(e,t){var i=this._planes[e];i&&i.setSelected(t)}},{key:"removeSectionPlane",value:function(e){var t=this._planes[e.id];t&&(t.destroy(),delete this._planes[e.id])}},{key:"setVisible",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._visible=e,this._canvas.style.visibility=e?"visible":"hidden"}},{key:"getVisible",value:function(){return this._visible}},{key:"destroy",value:function(){this._viewer.camera.off(this._onViewerCameraMatrix),this._viewer.camera.off(this._onViewerCameraWorldAxis),this._viewer.camera.perspective.off(this._onViewerCameraFOV),this._scene.input.off(this._onInputMouseMove),this._scene.canvas.canvas.removeEventListener("mouseup",this._onCanvasMouseUp),this._scene.canvas.canvas.removeEventListener("mouseout",this._onCanvasMouseOut),this._scene.destroy()}}])}(),wE=function(){return w((function e(t){B(this,e),this._viewer=t.viewer,this._scene=t.viewer.scene,this._sectionPlugin=t,this._boxCenter=[0,0,0],this._maxRange=[],this._createNodes()}),[{key:"_createNodes",value:function(){var e=this._viewer.scene,t=e.aabb,i=e.center,s=t[3]-t[0],r=t[4]-t[1],n=t[5]-t[2];this._rootNode=new Bn(e,{id:"sectionControl",position:i,scale:[1,1,1],isObject:!1});var o=this._rootNode;this._displayMeshes={box:o.addChild(new nn(o,{geometry:new Ti(o,Wn({center:this._boxCenter,xSize:.5*(s>0?s:-1*s)+0,ySize:.5*(r>0?r:-1*r)+0,zSize:.5*(n>0?n:-1*n)+0})),material:new Qi(o,{emissive:[.5,6.5,9.5],diffuse:[.5,6.5,9.5],specular:[.5,.5,.5],alpha:.2,shininess:10}),pickable:!1,collidable:!1,clippable:!1,visible:!0,scale:[1,1,1],isObject:!1}),!1)}}},{key:"updateBox",value:function(e,t){if(!(t.length<6)){var i,s,r;i=t[3][0]-t[0][0],s=t[4][1]-t[1][1],r=t[5][2]-t[2][2];var n=this._getGeometryPoisition(e,i,s,r);this._setGeometryPosition(n)}}},{key:"_getGeometryPoisition",value:function(e,t,i,s){var r=.5,n=this._boxCenter;return 0!=e[0]&&(e[0]<0&&(n[0]-=((t>0?t:-1*t)*r+.2)/4),e[0]>0&&(n[0]+=((t>0?t:-1*t)*r+.2)/4)),0!=e[1]&&(e[1]<0&&(n[1]-=((i>0?i:-1*i)*r+.2)/4),e[1]>0&&(n[1]+=((i>0?i:-1*i)*r+.2)/4)),0!=e[2]&&(e[2]<0&&(n[2]-=((s>0?s:-1*s)*r+.2)/4),e[2]>0&&(n[2]+=((s>0?s:-1*s)*r+.2)/4)),Wn({center:n,xSize:(t>0?t:-1*t)*r+.2,ySize:(i>0?i:-1*i)*r+.2,zSize:(s>0?s:-1*s)*r+.2}).positions}},{key:"_setGeometryPosition",value:function(e){this._displayMeshes.box.geometry.positions=e}},{key:"setVisible",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this._visible!==e){var t;for(t in this._visible=e,this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].visible=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].visible=e)}}},{key:"getVisible",value:function(){return this._visible}},{key:"_destroy",value:function(){this._rootNode.destroy(),this._displayMeshes={}}}])}(),PE=J.AABB3(),CE=J.vec3(),ME=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(B(this,t),(i=h(this,t,["SectionPlanes",e]))._freeControls=[],i._controlBox=null,i._singleCtrlBox=null,i._sectionWay=null,i._sectionPlanes=e.scene.sectionPlanes,i._controls={},i._currentControl=null,i._shownControlId=null,i._shownControlIds=[],i._boxPlaneConfig={id:"",planeId:-1,enableClip:!1,controlFillColor:[3,9,9]},null!==s.overviewCanvasId&&void 0!==s.overviewCanvasId){var r=document.getElementById(s.overviewCanvasId);r?i._overview=new xE(i,{overviewCanvas:r,visible:s.overviewVisible,onHoverEnterPlane:function(e){i._overview.setPlaneHighlighted(e,!0)},onHoverLeavePlane:function(e){i._overview.setPlaneHighlighted(e,!1)},onClickedPlane:function(e){if(i.getShownControl()!==e){i.showControl(e);var t=i.sectionPlanes[e].pos;PE.set(i.viewer.scene.aabb),J.getAABB3Center(PE,CE),PE[0]+=t[0]-CE[0],PE[1]+=t[1]-CE[1],PE[2]+=t[2]-CE[2],PE[3]+=t[0]-CE[0],PE[4]+=t[1]-CE[1],PE[5]+=t[2]-CE[2],i.viewer.cameraFlight.flyTo({aabb:PE,fitFOV:65})}else i.hideControl()},onClickedNothing:function(){i.hideControl()}}):i.warn("Can't find overview canvas: '"+s.overviewCanvasId+"' - will create plugin without overview")}return i._onSceneSectionPlaneCreated=e.scene.on("sectionPlaneCreated",(function(e){i._sectionPlaneCreated(e)})),i._onSceneSectionBoxCreated=e.scene.on("sectionBoxCreated",(function(e){i._controlBox=e})),i.controlset=s.controlset,i}return m(t,me),w(t,[{key:"setOverviewVisible",value:function(e){this._overview&&this._overview.setVisible(e)}},{key:"getOverviewVisible",value:function(){if(this._overview)return this._overview.getVisible()}},{key:"sectionPlanes",get:function(){return this._sectionPlanes}},{key:"createSectionPlane",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==e.id&&null!==e.id&&this.viewer.scene.components[e.id]&&(this.error("Viewer component with this ID already exists: "+e.id),delete e.id),new hn(this.viewer.scene,{id:e.id,pos:e.pos,dir:e.dir,active:!0})}},{key:"createSectionBox",value:function(){this._sectionWay="box";var e=new wE(this);return new md(this.viewer.scene,{id:"sectionBox",active:!0,controlIdName:"sectionBoxPlane_",lineBox:e})}},{key:"createSectionSingle",value:function(){return this._sectionWay="box",new md(this.viewer.scene,{id:"sectionBox",active:!0,pickable:!1,enableClip:!1,controlIdName:"sectionBoxPlane_"})}},{key:"_sectionPlaneCreated",value:function(e){var t,i=this;switch(this._sectionWay){case"plane":t=this._freeControls.length>0?this._freeControls.pop():new yE(this,this._controlsConfig);break;case"box":this._boxPlaneConfig.enableClip=e.enableClip,this._boxPlaneConfig.pickable=e.pickable,this._boxPlaneConfig.controlFillColor=e.controlFillColor,t=this._freeControls.length>0?this._freeControls.pop():new gE(this,this._boxPlaneConfig);break;case"singleCtrl":t=this._freeControls.length>0?this._freeControls.pop():new pE(this,this.controlset);break;default:t=new cE(this)}var s=t;s._setSectionPlane(e),s.setVisible(!0),e.control=s,this._currentControl=s,null==e.box&&(this._controls[e.id]=s),this._overview&&this._overview.addSectionPlane(e),e.once("destroyed",(function(){i._sectionPlaneDestroyed(e)}))}},{key:"isTouch",set:function(e){this._isTouch=e,this.sectionWay=!0===e?"plane":this._sectionWay?this._sectionWay:"control"}},{key:"sectionConfigs",set:function(e){this._controlsConfig=e}},{key:"boxPlaneConfigs",set:function(e){this._boxPlaneConfig=e}},{key:"sectionWay",set:function(e){this._sectionWay=e}},{key:"sectionDirection",set:function(e){var t;switch(this.clear(),e){case 0:t=[0,0,-1];break;case 1:t=[-1,0,0];break;case 2:t=[0,-1,0]}var i=this.viewer.scene.center;this.createSectionPlane({pos:J.AABB3([i[0],i[1],i[2]]),dir:t})}},{key:"sectionSingleDirection",set:function(e){var t;switch(this.hideControl(),this._sectionWay="singleCtrl",e){case 0:t=[0,0,-1];break;case 1:t=[-1,0,0];break;case 2:t=[0,-1,0]}var i=this.viewer.scene.center;this.createSectionPlane({pos:J.AABB3([i[0],i[1],i[2]]),dir:t})}},{key:"controlBox",get:function(){return this._controlBox}},{key:"setControlPos",value:function(e){null!=this._currentControl&&(this._currentControl.pos=e)}},{key:"getControlPos",value:function(){return null==this._currentControl?-1:this._currentControl.posRate}},{key:"flipSectionPlanes",value:function(){var e=this.viewer.scene.sectionPlanes;for(var t in e){e[t].flipDir()}}},{key:"showControl",value:function(e){var t=this._controls[e];t?(t.setVisible(!0),this._overview&&this._overview.setPlaneSelected(e,!0),this._shownControlId=e,this._shownControlIds=[e]):this.error("Control not found: "+e)}},{key:"setControlsSize",value:function(e){for(var t in this._controls)this._controls[t].controlSize=e}},{key:"setControlSizeByID",value:function(e,t){this._controls[e]?this._controls[e].controlSize=t:this.error("Control not found: "+e)}},{key:"getShownControl",value:function(){return this._shownControlId}},{key:"getShownControls",value:function(){return this._shownControlIds}},{key:"showAllControl",value:function(){for(var e in this._controls)this._controls.hasOwnProperty(e)&&(this._shownControlIds.push(e),this._controls[e].setVisible(!1),this._overview&&this._overview.setPlaneSelected(e,!1))}},{key:"hideControl",value:function(){for(var e in this._controls)this._controls.hasOwnProperty(e)&&(this._controls[e].setVisible(!1),this._overview&&this._overview.setPlaneSelected(e,!1));this._shownControlId=null,this._shownControlIds=[]}},{key:"destroySectionPlane",value:function(e){var t=this.viewer.scene.sectionPlanes[e];t?(this._sectionPlaneDestroyed(t),t.destroy(),e===this._shownControlId&&(this._shownControlId=null,this._shownControlIds=[])):this.error("SectionPlane not found: "+e)}},{key:"_sectionPlaneDestroyed",value:function(e){this._overview&&this._overview.removeSectionPlane(e);var t=this._controls[e.id];t&&(t.setVisible(!1),t._setSectionPlane(null),delete this._controls[e.id],this._freeControls.push(t))}},{key:"clear",value:function(){this._controlBox&&this._controlBox.destroy();for(var e=Object.keys(this._sectionPlanes),t=0,i=e.length;t<i;t++)this.destroySectionPlane(e[t])}},{key:"send",value:function(e,t){switch(e){case"snapshotStarting":for(var i in this._controls)this._controls.hasOwnProperty(i)&&this._controls[i].setCulled(!0);break;case"snapshotFinished":for(var s in this._controls)this._controls.hasOwnProperty(s)&&this._controls[s].setCulled(!1);break;case"clearSectionPlanes":this.clear()}}},{key:"destroy",value:function(){this.clear(),this._overview&&this._overview.destroy(),this._destroyFreeControls(),f(t,"destroy",this,3)([])}},{key:"_destroyFreeControls",value:function(){for(var e=this._freeControls.pop();e;)e._destroy(),e=this._freeControls.pop();this.viewer.scene.off(this._onSceneSectionPlaneCreated)}}])}(),kE=w((function e(t,i,s,r,n,o){B(this,e),this.plugin=t,this.storeyId=n,this.modelId=r,this.storeyAABB=s.slice(),this.aabb=this.storeyAABB,this.modelAABB=i.slice(),this.numObjects=o})),FE=w((function e(t,i,s,r,n,o){B(this,e),this.storeyId=t,this.imageData=i,this.format=s,this.width=r,this.height=n})),EE=J.vec3(),DE=J.mat4(),IE=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,["StoreyViews",e]))._objectsMemento=new dd,i._cameraMemento=new ud,i.storeys={},i.modelStoreys={},i._fitStoreyMaps=!!s.fitStoreyMaps,i._onModelLoaded=i.viewer.scene.on("modelLoaded",(function(e){i._registerModelStoreys(e),i.fire("storeys",i.storeys)})),i}return m(t,me),w(t,[{key:"_registerModelStoreys",value:function(e){var t=this,i=this.viewer,s=i.scene,r=i.metaScene,n=r.metaModels[e],o=s.models[e];if(n&&n.rootMetaObjects)for(var a=n.rootMetaObjects,l=0,u=a.length;l<u;l++)for(var A=a[l].getObjectIDsInSubtreeByType(["IfcBuildingStorey"]),c=0,h=A.length;c<h;c++){var d=A[c],p=r.metaObjects[d].getObjectIDsInSubtree(),f=s.getAABB(p),v=Math.random()>.5?p.length:0,g=new kE(this,o.aabb,f,e,d,v);g._onModelDestroyed=o.once("destroyed",(function(){t._deregisterModelStoreys(e),t.fire("storeys",t.storeys)})),this.storeys[d]=g,this.modelStoreys[e]||(this.modelStoreys[e]={}),this.modelStoreys[e][d]=g}}},{key:"_deregisterModelStoreys",value:function(e){var t=this.modelStoreys[e];if(t){var i=this.viewer.scene;for(var s in t)if(t.hasOwnProperty(s)){var r=t[s],n=i.models[r.modelId];n&&n.off(r._onModelDestroyed),delete this.storeys[s]}delete this.modelStoreys[e]}}},{key:"fitStoreyMaps",get:function(){return this._fitStoreyMaps}},{key:"gotoStoreyCamera",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.storeys[e];if(!i)return this.error("IfcBuildingStorey not found with this ID: "+e),void(t.done&&t.done());var s=this.viewer,r=s.scene.camera,n=i.storeyAABB;if(n[3]<n[0]||n[4]<n[1]||n[5]<n[2])t.done&&t.done();else if(n[3]!==n[0]||n[4]!==n[1]||n[5]!==n[2]){var o=J.getAABB3Center(n),a=J.getAABB3Diag(n),l=Math.abs(a/Math.tan(45*J.DEGTORAD)),u=1.3*a,A=EE;A[0]=o[0]+r.worldUp[0]*l,A[1]=o[1]+r.worldUp[1]*l,A[2]=o[2]+r.worldUp[2]*l;var c=r.worldForward;t.done?s.cameraFlight.flyTo(oe.apply(t,{eye:A,look:o,up:c,orthoScale:u}),(function(){t.done()})):(s.cameraFlight.jumpTo(oe.apply(t,{eye:A,look:o,up:c,orthoScale:u})),s.camera.ortho.scale=u)}else t.done&&t.done()}},{key:"showStoreyObjects",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.storeys[e]){var i=this.viewer,s=i.scene;i.metaScene.metaObjects[e]&&(t.hideOthers&&s.setObjectsVisible(i.scene.visibleObjectIds,!1),this.withStoreyObjects(e,(function(e,t){e&&(e.visible=!0)})))}else this.error("IfcBuildingStorey not found with this ID: "+e)}},{key:"withStoreyObjects",value:function(e,t){var i=this.viewer,s=i.scene,r=i.metaScene,n=r.metaObjects[e];if(n)for(var o=n.getObjectIDsInSubtree(),a=0,l=o.length;a<l;a++){var u=o[a],A=r.metaObjects[u],c=s.objects[u];c&&t(c,A)}}},{key:"createStoreyMap",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.storeys[e];if(!i)return this.error("IfcBuildingStorey not found with this ID: "+e),"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==";var s,r,n=this.viewer,o=n.scene,a=t.format||"png",l=this._fitStoreyMaps?i.storeyAABB:i.modelAABB,u=Math.abs((l[5]-l[2])/(l[3]-l[0])),A=t.padding||0;t.width&&t.height?(s=t.width,r=t.height):t.height?(r=t.height,s=Math.round(r/u)):t.width?(s=t.width,r=Math.round(s*u)):(s=300,r=Math.round(s*u)),this._objectsMemento.saveObjects(o),this._cameraMemento.saveCamera(o),this.showStoreyObjects(e,oe.apply(t,{hideOthers:!0})),this._arrangeStoreyMapCamera(i);var c=n.getSnapshot({width:s,height:r,format:a});return this._objectsMemento.restoreObjects(o),this._cameraMemento.restoreCamera(o),new FE(e,c,a,s,r,A)}},{key:"_arrangeStoreyMapCamera",value:function(e){var t=this.viewer,i=t.scene.camera,s=this._fitStoreyMaps?e.storeyAABB:e.modelAABB,r=J.getAABB3Center(s),n=EE;n[0]=r[0]+.5*i.worldUp[0],n[1]=r[1]+.5*i.worldUp[1],n[2]=r[2]+.5*i.worldUp[2];var o=i.worldForward;t.cameraFlight.jumpTo({eye:n,look:r,up:o});var a=(s[3]-s[0])/2,l=(s[4]-s[1])/2,u=(s[5]-s[2])/2,A=-a,c=+a,h=-l,d=+l,p=-u,f=+u;t.camera.customProjection.matrix=J.orthoMat4c(A,c,p,f,h,d,DE),t.camera.projection="customProjection"}},{key:"pickStoreyMap",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=e.storeyId,r=this.storeys[s];if(!r)return this.error("IfcBuildingStorey not found with this ID: "+s),null;var n=1-t[0]/e.width,o=1-t[1]/e.height,a=this._fitStoreyMaps?r.storeyAABB:r.modelAABB,l=a[0],u=a[1],A=a[2],c=a[3]-l,h=a[4]-u,d=a[5]-A,p=J.vec3([l+c*n,u+.5*h,A+d*o]),f=J.vec3([0,-1,0]),v=J.addVec3(p,f,EE),g=this.viewer.camera.worldForward,m=J.lookAtMat4v(p,v,g,DE);return this.viewer.scene.pick({pickSurface:i.pickSurface,pickInvisible:!0,matrix:m})}},{key:"storeyMapToWorldPos",value:function(e,t){var i=e.storeyId,s=this.storeys[i];if(!s)return this.error("IfcBuildingStorey not found with this ID: "+i),null;var r=1-t[0]/e.width,n=1-t[1]/e.height,o=this._fitStoreyMaps?s.storeyAABB:s.modelAABB,a=o[0],l=o[1],u=o[2],A=o[3]-a,c=o[4]-l,h=o[5]-u;return J.vec3([a+A*r,l+.5*c,u+h*n])}},{key:"getStoreyContainingWorldPos",value:function(e){for(var t in this.storeys){var i=this.storeys[t];if(J.point3AABB3Intersect(i.storeyAABB,e))return t}return null}},{key:"worldPosToStoreyMap",value:function(e,t,i){var s=e.storeyId,r=this.storeys[s];if(!r)return this.error("IfcBuildingStorey not found with this ID: "+s),!1;var n=this._fitStoreyMaps?r.storeyAABB:r.modelAABB,o=n[0],a=n[1],l=n[2],u=n[3]-o,A=n[4]-a,c=n[5]-l,h=this.viewer.camera.worldUp,d=h[0]>h[1]&&h[0]>h[2],p=!d&&h[1]>h[0]&&h[1]>h[2];!d&&!p&&h[2]>h[0]&&(h[2],h[1]);var f=e.width/u,v=p?e.height/c:e.height/A;return i[0]=Math.floor(e.width-(t[0]-o)*f),i[1]=Math.floor(e.height-(t[2]-l)*v),i[0]>=0&&i[0]<e.width&&i[1]>=0&&i[1]<=e.height}},{key:"worldDirToStoreyMap",value:function(e,t,i){var s=this.viewer.camera,r=s.eye,n=s.look,o=J.subVec3(n,r,EE),a=s.worldUp,l=a[0]>a[1]&&a[0]>a[2],u=!l&&a[1]>a[0]&&a[1]>a[2];!l&&!u&&a[2]>a[0]&&(a[2],a[1]),l?(i[0]=o[1],i[1]=o[2]):u?(i[0]=o[0],i[1]=o[2]):(i[0]=o[0],i[1]=o[1]),J.normalizeVec2(i)}},{key:"destroy",value:function(){this.viewer.scene.off(this._onModelLoaded),f(t,"destroy",this,3)([])}}])}(),SE=function(e){function t(e){var i;return B(this,t),(i=h(this,t,["skyboxes",e])).skyboxes={},i._active=!1,i}return m(t,me),w(t,[{key:"send",value:function(e,t){if("clear"===e)this.clear()}},{key:"createSkybox",value:function(e,t){if(this.viewer.scene.components[e])return this.error("Component with this ID already exists: "+e),this;if(!t.src&&!t.image)return this.error("No legal skybox image or src: "+e),this;if(t.src){var i=new _d(this.viewer.scene,{id:e,size:t.size,scale:t.scale,src:t.src,active:t.active,encoding:3e3});return this.skyboxes[e]=i,i}if(t.image){i=new _d(this.viewer.scene,{id:e,size:t.size,scale:t.scale,image:t.image,active:t.active,encoding:3e3});return this.skyboxes[e]=i,i}}},{key:"setSkyBoxActiveById",value:function(e,t){this.skyboxes[e].active=t}},{key:"active",get:function(){return this._active},set:function(e){this._active=e;for(var t=0;t<this.skyboxes.length;t++)this.skyboxes[t].active=e}},{key:"getSkyBoxById",value:function(e){return this.skyboxes[e]}},{key:"destroySkybox",value:function(e){var t=this.skyboxes[e];t?t.destroy():this.error("Skybox not found: "+e)}},{key:"clear",value:function(){for(var e=Object.keys(this.skyboxes),t=0,i=e.length;t<i;t++)this.destroySkybox(e[t])}},{key:"destroy",value:function(){this.clear()}}])}(),TE=[],LE=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};B(this,t),(i=h(this,t,["TreeViewPlugin",e])).errors=[],i.valid=!0;for(var r=0;;r++)if(!TE[r]){TE[r]=i,i._index=r,i._id="tree-".concat(r);break}if(i._metaModels={},i._autoAddModels=!1!==s.autoAddModels,i._autoExpandDepth=s.autoExpandDepth||0,i._sortNodes=!1!==s.sortNodes,i._viewer=e,i._rootElement=null,i._muteSceneEvents=!1,i._muteTreeEvents=!1,i._rootNodes=[],i._objectNodes={},i._nodeNodes={},i._rootNames={},i._sortNodes=s.sortNodes,i._pruneEmptyNodes=s.pruneEmptyNodes,i._showListItemElementId=null,i._onObjectVisibility=i._viewer.scene.on("objectVisibility",(function(e){if(!i._muteSceneEvents){var t=e.id,s=i._objectNodes[t];if(s){var r=e.visible;if(r!==s.checked){i._muteTreeEvents=!0,s.checked=r,r?s.numVisibleEntities++:s.numVisibleEntities--;for(var n=s.parent;n;)n.checked=r,r?n.numVisibleEntities++:n.numVisibleEntities--,n=n.parent;i._muteTreeEvents=!1}}}})),i._onObjectXrayed=i._viewer.scene.on("objectXRayed",(function(e){if(!i._muteSceneEvents){var t=e.id,s=i._objectNodes[t];if(s){i._muteTreeEvents=!0;var r=e.xrayed;r!==s.xrayed&&(s.xrayed=r,i._muteTreeEvents=!1)}}})),i._hierarchy=s.hierarchy||"containment",i._autoExpandDepth=s.autoExpandDepth||0,i._autoAddModels){for(var n=Object.keys(i.viewer.metaScene.metaModels),o=0,a=n.length;o<a;o++){var l=n[o];i.viewer.metaScene.metaModels[l].finalized&&i.addModel(l)}i.viewer.scene.on("modelLoaded",(function(e){i.viewer.metaScene.metaModels[e]&&i.addModel(e)}))}return i.hierarchy=s.hierarchy,i}return m(t,me),w(t,[{key:"switchExpandHandler",value:function(e){e.preventDefault(),e.stopPropagation(),e.target,this.fire("ExpandHandler",e)}},{key:"switchCollapseHandler",value:function(e){e.preventDefault(),e.stopPropagation(),this.fire("CollapseHandler",e)}},{key:"checkboxChangeHandler",value:function(e){if(this.fire("checkBoxChanged",e),!this._muteTreeEvents){this._muteSceneEvents=!0;var t=e.target,i=t.checked,s=t.id.replace("checkbox-",""),r=this._nodeNodes[s],n=this._viewer.scene.objects,o=0;this._withNodeTree(r,(function(e){var t=e.objectId,s=n[t],r=0===e.children.length;e.numVisibleEntities=i?e.numEntities:0,r&&i!==e.checked&&o++,e.checked=i,function(e,t){var i=document.getElementById("checkbox-".concat(e));i&&t!==i.checked&&(i.checked=t)}(e.nodeId,i),s&&(s.visible=i)}));for(var a=r.parent;a;)a.checked=i,i?a.numVisibleEntities+=o:a.numVisibleEntities-=o,l(a.nodeId,a.numVisibleEntities>0),a=a.parent;this._muteSceneEvents=!1}function l(e,t){var i=document.getElementById("checkbox-".concat(e));i&&t!==i.checked&&(i.checked=t)}}},{key:"hierarchy",get:function(){return this._hierarchy},set:function(e){"containment"!==(e=e||"containment")&&"storeys"!==e&&"types"!==e&&(this.error("Unsupported value for `hierarchy' - defaulting to 'containment'"),e="containment"),this._hierarchy!==e&&(this._hierarchy=e,this._createNodes())}},{key:"muteTreeEvents",get:function(){return this._muteTreeEvents},set:function(e){this._muteTreeEvents=e}},{key:"nodeNodes",get:function(){return this._nodeNodes}},{key:"_createNodes",value:function(){this._rootElement&&(this._rootElement.parentNode.removeChild(this._rootElement),this._rootElement=null),this._rootNodes=[],this._objectNodes={},this._nodeNodes={},this._validate(),(this.valid||"storeys"!==this._hierarchy)&&this._createEnabledNodes()}},{key:"_createEnabledNodes",value:function(){switch(this._pruneEmptyNodes&&this._findEmptyNodes(),this._hierarchy){case"storeys":this._createStoreysNodes(),0===this._rootNodes.length&&this.error("Failed to build storeys hierarchy");break;case"types":this._createTypesNodes();break;default:this._createContainmentNodes()}this._sortNodes&&this._doSortNodes(),this._synchNodesToEntities(),this.fire("nodeNodes_Created",this._nodeNodes),this.fire("rootNodes_Created",this._rootNodes),this.fire("objectNodes_Created",this._objectNodes)}},{key:"_createStoreysNodes",value:function(){var e=this._viewer.metaScene.rootMetaObjects;for(var t in e)this._createStoreysNodes2(e[t],null,null,null)}},{key:"_createStoreysNodes2",value:function(e,t,i,s){if(!this._pruneEmptyNodes||0!==e._countEntities){var r=e.type,n=e.name,o=e.children,a=e.id;if("IfcBuilding"===r)t={nodeId:"".concat(this._id,"-").concat(a),objectId:a,title:0===e.metaModels.length?"na":this._rootNames[e.metaModels[0].id]||(n&&""!==n&&"Undefined"!==n&&"Default"!==n?n:r),type:r,parent:null,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]},this._rootNodes.push(t),this._objectNodes[t.objectId]=t,this._nodeNodes[t.nodeId]=t;else if("IfcBuildingStorey"===r){if(!t)return void this.error("Failed to build storeys hierarchy for model '"+this.metaModel.id+"' - model does not have an IfcBuilding object, or is not an IFC model");i={nodeId:"".concat(this._id,"-").concat(a),objectId:a,title:n&&""!==n&&"Undefined"!==n&&"Default"!==n?n:r,type:r,parent:t,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]},t.children.push(i),this._objectNodes[i.objectId]=i,this._nodeNodes[i.nodeId]=i,s={}}else{if(i)if(this._viewer.scene.objects[a]){var l=(s=s||{})[r];l||(l={nodeId:"".concat(this._id,"-").concat(i.objectId,"-").concat(r),objectId:"".concat(i.objectId,"-").concat(r),title:r,type:r,parent:i,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]},i.children.push(l),this._objectNodes[l.objectId]=l,this._nodeNodes[l.nodeId]=l,s[r]=l);var u={nodeId:"".concat(this._id,"-").concat(a),objectId:a,title:n&&""!==n&&"Undefined"!==n&&"Default"!==n?n:r,type:r,parent:l,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]};l.children.push(u),this._objectNodes[u.objectId]=u,this._nodeNodes[u.nodeId]=u}}if(o)for(var A=0,c=o.length;A<c;A++){var h=o[A];this._createStoreysNodes2(h,t,i,s)}}}},{key:"_createTypesNodes",value:function(){var e=this._viewer.metaScene.rootMetaObjects;for(var t in e)this._createTypesNodes2(e[t],null,null)}},{key:"_createTypesNodes2",value:function(e,t,i){if(!this._pruneEmptyNodes||0!==e._countEntities){var s=e.type,r=e.name,n=e.children,o=e.id;if(e.parent){if(t)if(this._viewer.scene.objects[o]){var a=i[s];a||(a={nodeId:"".concat(this._id,"-").concat(t.objectId,"-").concat(s),objectId:"".concat(t.objectId,"-").concat(s),title:s,type:s,parent:t,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]},t.children.push(a),this._objectNodes[a.objectId]=a,this._nodeNodes[a.nodeId]=a,i[s]=a);var l={nodeId:"".concat(this._id,"-").concat(o),objectId:o,title:r&&""!==r&&"Default"!==r?r:s,type:s,parent:a,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]};a.children.push(l),this._objectNodes[l.objectId]=l,this._nodeNodes[l.nodeId]=l}}else t={nodeId:"".concat(this._id,"-").concat(o),objectId:o,title:0===e.metaModels.length?"na":this._rootNames[e.metaModels[0].id]||(r&&""!==r&&"Undefined"!==r&&"Default"!==r?r:s),type:s,parent:null,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]},this._rootNodes.push(t),this._objectNodes[t.objectId]=t,this._nodeNodes[t.nodeId]=t,i={};if(n)for(var u=0,A=n.length;u<A;u++){var c=n[u];this._createTypesNodes2(c,t,i)}}}},{key:"_createContainmentNodes",value:function(){var e=this._viewer.metaScene.rootMetaObjects;for(var t in e)this._createContainmentNodes2(e[t],null)}},{key:"_createContainmentNodes2",value:function(e,t){if(!this._pruneEmptyNodes||0!==e._countEntities){var i=e.type,s=e.name||i,r=e.children,n=e.id,o={nodeId:"".concat(this._id,"-").concat(n),objectId:n,title:t?s&&""!==s&&"Undefined"!==s&&"Default"!==s?s:i:0===e.metaModels.length?"na":this._rootNames[e.metaModels[0].id]||s,type:i,parent:t,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]};if(t?t.children.push(o):this._rootNodes.push(o),this._objectNodes[o.objectId]=o,this._nodeNodes[o.nodeId]=o,r)for(var a=0,l=r.length;a<l;a++){var u=r[a];this._createContainmentNodes2(u,o)}}}},{key:"_synchNodesToEntities",value:function(){for(var e=Object.keys(this.viewer.metaScene.metaObjects),t=this._viewer.metaScene.metaObjects,i=this._viewer.scene.objects,s=0,r=e.length;s<r;s++){var n=e[s];if(t[n]){var o=this._objectNodes[n];if(o){var a=i[n];if(a){var l=a.visible;o.numEntities=1,o.xrayed=a.xrayed,l?(o.numVisibleEntities=1,o.checked=!0):(o.numVisibleEntities=0,o.checked=!1);for(var u=o.parent;u;)u.numEntities++,l&&(u.numVisibleEntities++,u.checked=!0),u=u.parent}}}}}},{key:"_validate",value:function(){if(this.errors=[],"storeys"===this._hierarchy)this.valid=this._validateMetaModelForStoreysHierarchy();else this.valid=this._rootNodes.length>0;return this.valid}},{key:"_validateMetaModelForStoreysHierarchy",value:function(){return!0}},{key:"addModel",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=this.viewer.scene.models[e];if(!s)throw"Model not found: "+e;var r=this.viewer.metaScene.metaModels[e];r?(this._metaModels[e]&&(this._metaModels[e]=null),this._metaModels[e]=r,i&&i.rootName&&(this._rootNames[e]=i.rootName),s.on("destroyed",(function(){t.removeModel(s.id)})),this._createNodes()):this.error("MetaModel not found: "+e)}},{key:"removeModel",value:function(e){this._metaModels[e]&&(this._rootNames[e]&&delete this._rootNames[e],delete this._metaModels[e],this._createNodes())}},{key:"showNode",value:function(e){this.unShowNode();var t=this._objectNodes[e];if(t){for(var i=t.nodeId,s=t.parent;s;)s=s.parent;this._showListItemElementId=i}}},{key:"unShowNode",value:function(){this._showListItemElementId&&(this._showListItemElementId=null)}},{key:"withNodeTree",value:function(e,t){t(e);var i=e.children;if(i)for(var s=0,r=i.length;s<r;s++)this.withNodeTree(i[s],t)}},{key:"_withNodeTree",value:function(e,t){t(e);var i=e.children;if(i)for(var s=0,r=i.length;s<r;s++)this._withNodeTree(i[s],t)}},{key:"getChildrenById",value:function(e){return this._nodeNodes[e].children}},{key:"getNodeById",value:function(e){return this._nodeNodes[e]}},{key:"destroy",value:function(){this._metaModels={},this._rootElement&&!this._destroyed&&(this._rootElement.parentNode.removeChild(this._rootElement),this._viewer.scene.off(this._onObjectVisibility),this._destroyed=!0),delete TE[this._index],f(t,"destroy",this,3)([])}},{key:"_findEmptyNodes",value:function(){var e=this._viewer.metaScene.rootMetaObjects;for(var t in e)this._findEmptyNodes2(e[t])}},{key:"_findEmptyNodes2",value:function(e){var t=this.viewer.scene,i=e.children,s=e.id,r=t.objects[s];if(e._countEntities=0,r&&e._countEntities++,i)for(var n=0,o=i.length;n<o;n++){var a=i[n];a._countEntities=this._findEmptyNodes2(a),e._countEntities+=a._countEntities}return e._countEntities}},{key:"_doSortNodes",value:function(){for(var e=0,t=this._rootNodes.length;e<t;e++){var i=this._rootNodes[e];this._sortChildren(i)}}},{key:"_sortChildren",value:function(e){var t=e.children;if(t&&0!==t.length){"storeys"===this._hierarchy&&"IfcBuilding"===e.type?t.sort(this._getSpatialSortFunc()):t.sort(this._alphaSortFunc);for(var i=0,s=t.length;i<s;i++){var r=t[i];this._sortChildren(r)}}}},{key:"_getSpatialSortFunc",value:function(){var e=this.viewer,t=e.scene,i=t.camera,s=e.metaScene;return this._spatialSortFunc||(this._spatialSortFunc=function(e,r){e.aabb&&r.aabb||(e.aabb||(e.aabb=t.getAABB(s.getObjectIDsInSubtree(e.objectId))),r.aabb||(r.aabb=t.getAABB(s.getObjectIDsInSubtree(r.objectId))));var n=0;return n=i.xUp?0:i.yUp?1:2,e.aabb[n]>r.aabb[n]?-1:e.aabb[n]<r.aabb[n]?1:0})}},{key:"_alphaSortFunc",value:function(e,t){var i=e.title.toUpperCase(),s=t.title.toUpperCase();return i<s?-1:i>s?1:0}}])}(),RE=function(){return w((function e(t){var i=this;B(this,e),this._scene=t,this._objects=[],this._objectsViewCulled=[],this._objectsDetailCulled=[],this._objectsChanged=[],this._objectsChangedList=[],this._modelInfos={},this._numObjects=0,this._lenObjectsChangedList=0,this._dirty=!0,this._onModelLoaded=t.on("modelLoaded",(function(e){var s=t.models[e];s&&i._addModel(s)})),this._onTick=t.on("tick",(function(){i._dirty&&i._build(),i._applyChanges()}))}),[{key:"_addModel",value:function(e){var t=this,i={model:e,onDestroyed:e.on("destroyed",(function(){t._removeModel(e)}))};this._modelInfos[e.id]=i,this._dirty=!0}},{key:"_removeModel",value:function(e){var t=this._modelInfos[e.id];t&&(t.model.off(t.onDestroyed),delete this._modelInfos[e.id],this._dirty=!0)}},{key:"_build",value:function(){if(this._dirty){this._applyChanges();for(var e=this._scene.objects,t=0;t<this._numObjects;t++)this._objects[t]=null;for(var i in this._numObjects=0,e){var s=e[i];this._objects[this._numObjects++]=s}this._lenObjectsChangedList=0,this._dirty=!1}}},{key:"_applyChanges",value:function(){if(this._lenObjectsChangedList>0){for(var e=0;e<this._lenObjectsChangedList;e++){var t=this._objectsChangedList[e],i=this._objects[t],s=this._objectsViewCulled[t],r=this._objectsDetailCulled[t],n=s||r;i.culled=n,this._objectsChanged[t]=!1}this._lenObjectsChangedList=0}}},{key:"objects",get:function(){return this._dirty&&this._build(),this._objects}},{key:"numObjects",get:function(){return this._dirty&&this._build(),this._numObjects}},{key:"setObjectViewCulled",value:function(e,t){this._dirty&&this._build(),this._objectsViewCulled[e]!==t&&(this._objectsViewCulled[e]=t,this._objectsChanged[e]||(this._objectsChanged[e]=!0,this._objectsChangedList[this._lenObjectsChangedList++]=e))}},{key:"setObjectDetailCulled",value:function(e,t){this._dirty&&this._build(),this._objectsDetailCulled[e]!==t&&(this._objectsDetailCulled[e]=t,this._objectsChanged[e]||(this._objectsChanged[e]=!0,this._objectsChangedList[this._lenObjectsChangedList++]=e))}},{key:"_destroy",value:function(){this._clear(),this._scene.off(this._onModelLoaded),this._scene.off(this._onTick)}},{key:"_clear",value:function(){for(var e in this._modelInfos){var t=this._modelInfos[e];t.model.off(t.onDestroyed)}this._modelInfos={},this._dirty=!0}}])}(),UE={};var OE=new Float32Array(3),QE=function(e){function t(e){var i,s,r,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};B(this,t),(i=h(this,t,["ViewCull",e]))._objectCullStates=(s=e.scene,r=s.id,(n=UE[r])||(n=new RE(s),UE[r]=n,s.on("destroyed",(function(){delete UE[r],n._destroy()}))),n),i._maxTreeDepth=o.maxTreeDepth||8,i._modelInfos={},i._frustum=new ut,i._kdRoot=null,i._frustumDirty=!1,i._kdTreeDirty=!1,i._insideView=!1,i.enabled=o.enabled;var a=e.scene.camera;return i._onViewMatrix=e.scene.camera.on("viewMatrix",(function(){i._frustumDirty=!0})),i._onProjMatrix=e.scene.camera.on("projMatMatrix",(function(){i._frustumDirty=!0})),i._onModelLoaded=e.scene.on("modelLoaded",(function(e){var t=i.viewer.scene.models[e];t&&i._addModel(t)})),i._onSceneTick=e.scene.on("tick",(function(){i._enabled&&i._doCull(),i.insideView=i.isBoxInFrustum(i.extractFrustumPlanes(a.projMatrix,a.viewMatrix),e.scene.aabb)})),i}return m(t,me),w(t,[{key:"isBoxInFrustum",value:function(e,t){for(var i=0;i<6;i++){var s=e[i],r=[s[0]>0?t[3]:t[0],s[1]>0?t[4]:t[1],s[2]>0?t[5]:t[2]];if(s[0]*r[0]+s[1]*r[1]+s[2]*r[2]+s[3]<0)return!1}return!0}},{key:"extractFrustumPlanes",value:function(e,t){var i=J.identityMat4();J.mulMat4(e,t,i);for(var s=[],r=0;r<6;r++)s.push(J.identityMat4());s[0][0]=i[3]+i[0],s[0][1]=i[7]+i[4],s[0][2]=i[11]+i[8],s[0][3]=i[15]+i[12],s[1][0]=i[3]-i[0],s[1][1]=i[7]-i[4],s[1][2]=i[11]-i[8],s[1][3]=i[15]-i[12],s[2][0]=i[3]+i[1],s[2][1]=i[7]+i[5],s[2][2]=i[11]+i[9],s[2][3]=i[15]+i[13],s[3][0]=i[3]-i[1],s[3][1]=i[7]-i[5],s[3][2]=i[11]-i[9],s[3][3]=i[15]-i[13],s[4][0]=i[3]+i[2],s[4][1]=i[7]+i[6],s[4][2]=i[11]+i[10],s[4][3]=i[15]+i[14],s[5][0]=i[3]-i[2],s[5][1]=i[7]-i[6],s[5][2]=i[11]-i[10],s[5][3]=i[15]-i[14];for(var n=0;n<6;n++){var o=Math.sqrt(s[n][0]*s[n][0]+s[n][1]*s[n][1]+s[n][2]*s[n][2]);s[n][0]/=o,s[n][1]/=o,s[n][2]/=o,s[n][3]/=o}return s}},{key:"insideView",get:function(){return this._insideView},set:function(e){this._insideView=e}},{key:"enabled",get:function(){return this._enabled},set:function(e){this._enabled=e}},{key:"_addModel",value:function(e){var t=this,i={model:e,onDestroyed:e.on("destroyed",(function(){t._removeModel(e)}))};this._modelInfos[e.id]=i,this._kdTreeDirty=!0}},{key:"_removeModel",value:function(e){var t=this._modelInfos[e.id];t&&(t.model.off(t.onDestroyed),delete this._modelInfos[e.id],this._kdTreeDirty=!0)}},{key:"_doCull",value:function(){var e=this._frustumDirty||this._kdTreeDirty;if(this._frustumDirty&&this._buildFrustum(),this._kdTreeDirty&&this._buildKDTree(),e){var t=this._kdRoot;t&&this._visitKDNode(t)}}},{key:"_buildFrustum",value:function(){var e=this.viewer.scene.camera;At(this._frustum,e.viewMatrix,e.projMatrix),this._frustumDirty=!1}},{key:"_buildKDTree",value:function(){var e=this.viewer.scene;this._kdRoot,this._kdRoot={aabb:e.getAABB(),intersection:ut.INTERSECT};for(var t=0,i=this._objectCullStates.numObjects;t<i;t++){var s=this._objectCullStates.objects[t];this._insertEntityIntoKDTree(this._kdRoot,s,t,1)}this._kdTreeDirty=!1}},{key:"_insertEntityIntoKDTree",value:function(e,t,i,s){var r=t.aabb;if(s>=this._maxTreeDepth)return e.objects=e.objects||[],e.objects.push(i),void J.expandAABB3(e.aabb,r);if(e.left&&J.containsAABB3(e.left.aabb,r))this._insertEntityIntoKDTree(e.left,t,i,s+1);else if(e.right&&J.containsAABB3(e.right.aabb,r))this._insertEntityIntoKDTree(e.right,t,i,s+1);else{var n=e.aabb;OE[0]=n[3]-n[0],OE[1]=n[4]-n[1],OE[2]=n[5]-n[2];var o=0;if(OE[1]>OE[o]&&(o=1),OE[2]>OE[o]&&(o=2),!e.left){var a=n.slice();if(a[o+3]=(n[o]+n[o+3])/2,e.left={aabb:a,intersection:ut.INTERSECT},J.containsAABB3(a,r))return void this._insertEntityIntoKDTree(e.left,t,i,s+1)}if(!e.right){var l=n.slice();if(l[o]=(n[o]+n[o+3])/2,e.right={aabb:l,intersection:ut.INTERSECT},J.containsAABB3(l,r))return void this._insertEntityIntoKDTree(e.right,t,i,s+1)}e.objects=e.objects||[],e.objects.push(i),J.expandAABB3(e.aabb,r)}}},{key:"_visitKDNode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ut.INTERSECT;if(t===ut.INTERSECT||e.intersects!==t){t===ut.INTERSECT&&(t=ct(this._frustum,e.aabb),e.intersects=t);var i=t===ut.OUTSIDE,s=e.objects;if(s&&s.length>0)for(var r=0,n=s.length;r<n;r++){var o=s[r];this._objectCullStates.setObjectViewCulled(o,i)}e.left&&this._visitKDNode(e.left,t),e.right&&this._visitKDNode(e.right,t)}}},{key:"send",value:function(e,t){}},{key:"destroy",value:function(){f(t,"destroy",this,3)([]),this._clear();var e=this.viewer.scene,i=e.camera;e.off(this._onModelLoaded),e.off(this._onSceneTick),i.off(this._onViewMatrix),i.off(this._onProjMatrix)}},{key:"_clear",value:function(){for(var e in this._modelInfos){var t=this._modelInfos[e];t.model.off(t.onDestroyed)}this._modelInfos={},this._kdRoot=null,this._kdTreeDirty=!0}}])}(),NE=function(){return w((function e(){B(this,e)}),[{key:"getManifest",value:function(e,t,i){oe.loadJSON(e,(function(e){t(e)}),(function(e){i(e)}))}},{key:"getMetaModel",value:function(e,t,i){oe.loadJSON(e,(function(e){t(e)}),(function(e){i(e)}))}},{key:"getXTC",value:function(e,t,i){var s=function(){};t=t||s,i=i||s;var r=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){var n=!!r[2],o=r[3];o=window.decodeURIComponent(o),n&&(o=window.atob(o));try{for(var a=new ArrayBuffer(o.length),l=new Uint8Array(a),u=0;u<o.length;u++)l[u]=o.charCodeAt(u);t(a)}catch(e){i(e)}}else{var A=new XMLHttpRequest;A.open("GET",e,!0),A.responseType="arraybuffer",A.onreadystatechange=function(){4===A.readyState&&(200===A.status?t(A.response):i("getXTC error : "+A.response))},A.send(null)}}}])}();!function(e,t){"object"==("undefined"==typeof exports?"undefined":b(exports))&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).pako={})}(void 0,(function(e){function t(e){for(var t=e.length;--t>=0;)e[t]=0}var i=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),s=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);t(o);var a=new Array(60);t(a);var l=new Array(512);t(l);var u=new Array(256);t(u);var A=new Array(29);t(A);var c,h,d,p=new Array(30);function f(e,t,i,s,r){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=s,this.max_length=r,this.has_stree=e&&e.length}function v(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}t(p);var g=function(e){return e<256?l[e]:l[256+(e>>>7)]},m=function(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},_=function(e,t,i){e.bi_valid>16-i?(e.bi_buf|=t<<e.bi_valid&65535,m(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)},y=function(e,t,i){_(e,i[2*t],i[2*t+1])},B=function(e,t){var i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1},x=function(e,t,i){var s,r,n=new Array(16),o=0;for(s=1;s<=15;s++)o=o+i[s-1]<<1,n[s]=o;for(r=0;r<=t;r++){var a=e[2*r+1];0!==a&&(e[2*r]=B(n[a]++,a))}},w=function(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},P=function(e){e.bi_valid>8?m(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},C=function(e,t,i,s){var r=2*t,n=2*i;return e[r]<e[n]||e[r]===e[n]&&s[t]<=s[i]},M=function(e,t,i){for(var s=e.heap[i],r=i<<1;r<=e.heap_len&&(r<e.heap_len&&C(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!C(t,s,e.heap[r],e.depth));)e.heap[i]=e.heap[r],i=r,r<<=1;e.heap[i]=s},k=function(e,t,r){var n,o,a,l,c=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+c++],n+=(255&e.pending_buf[e.sym_buf+c++])<<8,o=e.pending_buf[e.sym_buf+c++],0===n?y(e,o,t):(a=u[o],y(e,a+256+1,t),0!==(l=i[a])&&(o-=A[a],_(e,o,l)),n--,a=g(n),y(e,a,r),0!==(l=s[a])&&(n-=p[a],_(e,n,l)))}while(c<e.sym_next);y(e,256,t)},F=function(e,t){var i,s,r,n=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.has_stree,l=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,i=0;i<l;i++)0!==n[2*i]?(e.heap[++e.heap_len]=u=i,e.depth[i]=0):n[2*i+1]=0;for(;e.heap_len<2;)n[2*(r=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[r]=0,e.opt_len--,a&&(e.static_len-=o[2*r+1]);for(t.max_code=u,i=e.heap_len>>1;i>=1;i--)M(e,n,i);r=l;do{i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],M(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=s,n[2*r]=n[2*i]+n[2*s],e.depth[r]=(e.depth[i]>=e.depth[s]?e.depth[i]:e.depth[s])+1,n[2*i+1]=n[2*s+1]=r,e.heap[1]=r++,M(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var i,s,r,n,o,a,l=t.dyn_tree,u=t.max_code,A=t.stat_desc.static_tree,c=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,f=0;for(n=0;n<=15;n++)e.bl_count[n]=0;for(l[2*e.heap[e.heap_max]+1]=0,i=e.heap_max+1;i<573;i++)(n=l[2*l[2*(s=e.heap[i])+1]+1]+1)>p&&(n=p,f++),l[2*s+1]=n,s>u||(e.bl_count[n]++,o=0,s>=d&&(o=h[s-d]),a=l[2*s],e.opt_len+=a*(n+o),c&&(e.static_len+=a*(A[2*s+1]+o)));if(0!==f){do{for(n=p-1;0===e.bl_count[n];)n--;e.bl_count[n]--,e.bl_count[n+1]+=2,e.bl_count[p]--,f-=2}while(f>0);for(n=p;0!==n;n--)for(s=e.bl_count[n];0!==s;)(r=e.heap[--i])>u||(l[2*r+1]!==n&&(e.opt_len+=(n-l[2*r+1])*l[2*r],l[2*r+1]=n),s--)}}(e,t),x(n,u,e.bl_count)},E=function(e,t,i){var s,r,n=-1,o=t[1],a=0,l=7,u=4;for(0===o&&(l=138,u=3),t[2*(i+1)+1]=65535,s=0;s<=i;s++)r=o,o=t[2*(s+1)+1],++a<l&&r===o||(a<u?e.bl_tree[2*r]+=a:0!==r?(r!==n&&e.bl_tree[2*r]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,n=r,0===o?(l=138,u=3):r===o?(l=6,u=3):(l=7,u=4))},D=function(e,t,i){var s,r,n=-1,o=t[1],a=0,l=7,u=4;for(0===o&&(l=138,u=3),s=0;s<=i;s++)if(r=o,o=t[2*(s+1)+1],!(++a<l&&r===o)){if(a<u)do{y(e,r,e.bl_tree)}while(0!=--a);else 0!==r?(r!==n&&(y(e,r,e.bl_tree),a--),y(e,16,e.bl_tree),_(e,a-3,2)):a<=10?(y(e,17,e.bl_tree),_(e,a-3,3)):(y(e,18,e.bl_tree),_(e,a-11,7));a=0,n=r,0===o?(l=138,u=3):r===o?(l=6,u=3):(l=7,u=4)}},I=!1,S=function(e,t,i,s){_(e,0+(s?1:0),3),P(e),m(e,i),m(e,~i),i&&e.pending_buf.set(e.window.subarray(t,t+i),e.pending),e.pending+=i},T=function(e){I||(function(){var e,t,n,v,g,m=new Array(16);for(n=0,v=0;v<28;v++)for(A[v]=n,e=0;e<1<<i[v];e++)u[n++]=v;for(u[n-1]=v,g=0,v=0;v<16;v++)for(p[v]=g,e=0;e<1<<s[v];e++)l[g++]=v;for(g>>=7;v<30;v++)for(p[v]=g<<7,e=0;e<1<<s[v]-7;e++)l[256+g++]=v;for(t=0;t<=15;t++)m[t]=0;for(e=0;e<=143;)o[2*e+1]=8,e++,m[8]++;for(;e<=255;)o[2*e+1]=9,e++,m[9]++;for(;e<=279;)o[2*e+1]=7,e++,m[7]++;for(;e<=287;)o[2*e+1]=8,e++,m[8]++;for(x(o,287,m),e=0;e<30;e++)a[2*e+1]=5,a[2*e]=B(e,5);c=new f(o,i,257,286,15),h=new f(a,s,0,30,15),d=new f(new Array(0),r,0,19,7)}(),I=!0),e.l_desc=new v(e.dyn_ltree,c),e.d_desc=new v(e.dyn_dtree,h),e.bl_desc=new v(e.bl_tree,d),e.bi_buf=0,e.bi_valid=0,w(e)},L=S,R=function(e,t,i,s){var r,l,u=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),F(e,e.l_desc),F(e,e.d_desc),u=function(e){var t;for(E(e,e.dyn_ltree,e.l_desc.max_code),E(e,e.dyn_dtree,e.d_desc.max_code),F(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*n[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),r=e.opt_len+3+7>>>3,(l=e.static_len+3+7>>>3)<=r&&(r=l)):r=l=i+5,i+4<=r&&-1!==t?S(e,t,i,s):4===e.strategy||l===r?(_(e,2+(s?1:0),3),k(e,o,a)):(_(e,4+(s?1:0),3),function(e,t,i,s){var r;for(_(e,t-257,5),_(e,i-1,5),_(e,s-4,4),r=0;r<s;r++)_(e,e.bl_tree[2*n[r]+1],3);D(e,e.dyn_ltree,t-1),D(e,e.dyn_dtree,i-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),k(e,e.dyn_ltree,e.dyn_dtree)),w(e),s&&P(e)},U=function(e,t,i){return e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=i,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(u[i]+256+1)]++,e.dyn_dtree[2*g(t)]++),e.sym_next===e.sym_end},O=function(e){_(e,2,3),y(e,256,o),function(e){16===e.bi_valid?(m(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)},Q=function(e,t,i,s){for(var r=65535&e|0,n=e>>>16&65535|0,o=0;0!==i;){i-=o=i>2e3?2e3:i;do{n=n+(r=r+t[s++]|0)|0}while(--o);r%=65521,n%=65521}return r|n<<16|0},N=new Uint32Array(function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var s=0;s<8;s++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}()),V=function(e,t,i,s){var r=N,n=s+i;e^=-1;for(var o=s;o<n;o++)e=e>>>8^r[255&(e^t[o])];return-1^e},H={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},G=T,z=L,W=R,K=U,X=O,Y=j.Z_NO_FLUSH,J=j.Z_PARTIAL_FLUSH,Z=j.Z_FULL_FLUSH,q=j.Z_FINISH,$=j.Z_BLOCK,ee=j.Z_OK,te=j.Z_STREAM_END,ie=j.Z_STREAM_ERROR,se=j.Z_DATA_ERROR,re=j.Z_BUF_ERROR,ne=j.Z_DEFAULT_COMPRESSION,oe=j.Z_FILTERED,ae=j.Z_HUFFMAN_ONLY,le=j.Z_RLE,ue=j.Z_FIXED,Ae=j.Z_DEFAULT_STRATEGY,ce=j.Z_UNKNOWN,he=j.Z_DEFLATED,de=258,pe=262,fe=42,ve=113,ge=666,me=function(e,t){return e.msg=H[t],t},_e=function(e){return 2*e-(e>4?9:0)},ye=function(e){for(var t=e.length;--t>=0;)e[t]=0},be=function(e){var t,i,s,r=e.w_size;s=t=e.hash_size;do{i=e.head[--s],e.head[s]=i>=r?i-r:0}while(--t);s=t=r;do{i=e.prev[--s],e.prev[s]=i>=r?i-r:0}while(--t)},Be=function(e,t,i){return(t<<e.hash_shift^i)&e.hash_mask},xe=function(e){var t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+i),e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))},we=function(e,t){W(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,xe(e.strm)},Pe=function(e,t){e.pending_buf[e.pending++]=t},Ce=function(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Me=function(e,t,i,s){var r=e.avail_in;return r>s&&(r=s),0===r?0:(e.avail_in-=r,t.set(e.input.subarray(e.next_in,e.next_in+r),i),1===e.state.wrap?e.adler=Q(e.adler,t,r,i):2===e.state.wrap&&(e.adler=V(e.adler,t,r,i)),e.next_in+=r,e.total_in+=r,r)},ke=function(e,t){var i,s,r=e.max_chain_length,n=e.strstart,o=e.prev_length,a=e.nice_match,l=e.strstart>e.w_size-pe?e.strstart-(e.w_size-pe):0,u=e.window,A=e.w_mask,c=e.prev,h=e.strstart+de,d=u[n+o-1],p=u[n+o];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do{if(u[(i=t)+o]===p&&u[i+o-1]===d&&u[i]===u[n]&&u[++i]===u[n+1]){n+=2,i++;do{}while(u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&n<h);if(s=de-(h-n),n=h-de,s>o){if(e.match_start=t,o=s,s>=a)break;d=u[n+o-1],p=u[n+o]}}}while((t=c[t&A])>l&&0!=--r);return o<=e.lookahead?o:e.lookahead},Fe=function(e){var t,i,s,r=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=r+(r-pe)&&(e.window.set(e.window.subarray(r,r+r-i),0),e.match_start-=r,e.strstart-=r,e.block_start-=r,e.insert>e.strstart&&(e.insert=e.strstart),be(e),i+=r),0===e.strm.avail_in)break;if(t=Me(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=t,e.lookahead+e.insert>=3)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=Be(e,e.ins_h,e.window[s+1]);e.insert&&(e.ins_h=Be(e,e.ins_h,e.window[s+3-1]),e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<pe&&0!==e.strm.avail_in)},Ee=function(e,t){var i,s,r,n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,o=0,a=e.strm.avail_in;do{if(i=65535,r=e.bi_valid+42>>3,e.strm.avail_out<r)break;if(r=e.strm.avail_out-r,i>(s=e.strstart-e.block_start)+e.strm.avail_in&&(i=s+e.strm.avail_in),i>r&&(i=r),i<n&&(0===i&&t!==q||t===Y||i!==s+e.strm.avail_in))break;o=t===q&&i===s+e.strm.avail_in?1:0,z(e,0,0,o),e.pending_buf[e.pending-4]=i,e.pending_buf[e.pending-3]=i>>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,xe(e.strm),s&&(s>i&&(s=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+s),e.strm.next_out),e.strm.next_out+=s,e.strm.avail_out-=s,e.strm.total_out+=s,e.block_start+=s,i-=s),i&&(Me(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(0===o);return(a-=e.strm.avail_in)&&(a>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=a&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?4:t!==Y&&t!==q&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(r=e.window_size-e.strstart,e.strm.avail_in>r&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,r+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),r>e.strm.avail_in&&(r=e.strm.avail_in),r&&(Me(e.strm,e.window,e.strstart,r),e.strstart+=r,e.insert+=r>e.w_size-e.insert?e.w_size-e.insert:r),e.high_water<e.strstart&&(e.high_water=e.strstart),r=e.bi_valid+42>>3,n=(r=e.pending_buf_size-r>65535?65535:e.pending_buf_size-r)>e.w_size?e.w_size:r,((s=e.strstart-e.block_start)>=n||(s||t===q)&&t!==Y&&0===e.strm.avail_in&&s<=r)&&(i=s>r?r:s,o=t===q&&0===e.strm.avail_in&&i===s?1:0,z(e,e.block_start,i,o),e.block_start+=i,xe(e.strm)),o?3:1)},De=function(e,t){for(var i,s;;){if(e.lookahead<pe){if(Fe(e),e.lookahead<pe&&t===Y)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-pe&&(e.match_length=ke(e,i)),e.match_length>=3)if(s=K(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Be(e,e.ins_h,e.window[e.strstart+1]);else s=K(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(s&&(we(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===q?(we(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(we(e,!1),0===e.strm.avail_out)?1:2},Ie=function(e,t){for(var i,s,r;;){if(e.lookahead<pe){if(Fe(e),e.lookahead<pe&&t===Y)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-pe&&(e.match_length=ke(e,i),e.match_length<=5&&(e.strategy===oe||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-3,s=K(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,s&&(we(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((s=K(e,0,e.window[e.strstart-1]))&&we(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(s=K(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===q?(we(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(we(e,!1),0===e.strm.avail_out)?1:2};function Se(e,t,i,s,r){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=s,this.func=r}var Te=[new Se(0,0,0,0,Ee),new Se(4,4,8,4,De),new Se(4,5,16,8,De),new Se(4,6,32,32,De),new Se(4,4,16,16,Ie),new Se(8,16,32,32,Ie),new Se(8,16,128,128,Ie),new Se(8,32,128,256,Ie),new Se(32,128,258,1024,Ie),new Se(32,258,258,4096,Ie)];function Le(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=he,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ye(this.dyn_ltree),ye(this.dyn_dtree),ye(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ye(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ye(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Re=function(e){if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.status!==fe&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==ve&&t.status!==ge?1:0},Ue=function(e){if(Re(e))return me(e,ie);e.total_in=e.total_out=0,e.data_type=ce;var t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?fe:ve,e.adler=2===t.wrap?0:1,t.last_flush=-2,G(t),ee},Oe=function(e){var t,i=Ue(e);return i===ee&&((t=e.state).window_size=2*t.w_size,ye(t.head),t.max_lazy_match=Te[t.level].max_lazy,t.good_match=Te[t.level].good_length,t.nice_match=Te[t.level].nice_length,t.max_chain_length=Te[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),i},Qe=function(e,t,i,s,r,n){if(!e)return ie;var o=1;if(t===ne&&(t=6),s<0?(o=0,s=-s):s>15&&(o=2,s-=16),r<1||r>9||i!==he||s<8||s>15||t<0||t>9||n<0||n>ue||8===s&&1!==o)return me(e,ie);8===s&&(s=9);var a=new Le;return e.state=a,a.strm=e,a.status=fe,a.wrap=o,a.gzhead=null,a.w_bits=s,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=r+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<r+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=t,a.strategy=n,a.method=i,Oe(e)},Ne={deflateInit:function(e,t){return Qe(e,t,he,15,8,Ae)},deflateInit2:Qe,deflateReset:Oe,deflateResetKeep:Ue,deflateSetHeader:function(e,t){return Re(e)||2!==e.state.wrap?ie:(e.state.gzhead=t,ee)},deflate:function(e,t){if(Re(e)||t>$||t<0)return e?me(e,ie):ie;var i=e.state;if(!e.output||0!==e.avail_in&&!e.input||i.status===ge&&t!==q)return me(e,0===e.avail_out?re:ie);var s=i.last_flush;if(i.last_flush=t,0!==i.pending){if(xe(e),0===e.avail_out)return i.last_flush=-1,ee}else if(0===e.avail_in&&_e(t)<=_e(s)&&t!==q)return me(e,re);if(i.status===ge&&0!==e.avail_in)return me(e,re);if(i.status===fe&&0===i.wrap&&(i.status=ve),i.status===fe){var r=he+(i.w_bits-8<<4)<<8;if(r|=(i.strategy>=ae||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(r|=32),Ce(i,r+=31-r%31),0!==i.strstart&&(Ce(i,e.adler>>>16),Ce(i,65535&e.adler)),e.adler=1,i.status=ve,xe(e),0!==i.pending)return i.last_flush=-1,ee}if(57===i.status)if(e.adler=0,Pe(i,31),Pe(i,139),Pe(i,8),i.gzhead)Pe(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Pe(i,255&i.gzhead.time),Pe(i,i.gzhead.time>>8&255),Pe(i,i.gzhead.time>>16&255),Pe(i,i.gzhead.time>>24&255),Pe(i,9===i.level?2:i.strategy>=ae||i.level<2?4:0),Pe(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(Pe(i,255&i.gzhead.extra.length),Pe(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=V(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69;else if(Pe(i,0),Pe(i,0),Pe(i,0),Pe(i,0),Pe(i,0),Pe(i,9===i.level?2:i.strategy>=ae||i.level<2?4:0),Pe(i,3),i.status=ve,xe(e),0!==i.pending)return i.last_flush=-1,ee;if(69===i.status){if(i.gzhead.extra){for(var n=i.pending,o=(65535&i.gzhead.extra.length)-i.gzindex;i.pending+o>i.pending_buf_size;){var a=i.pending_buf_size-i.pending;if(i.pending_buf.set(i.gzhead.extra.subarray(i.gzindex,i.gzindex+a),i.pending),i.pending=i.pending_buf_size,i.gzhead.hcrc&&i.pending>n&&(e.adler=V(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex+=a,xe(e),0!==i.pending)return i.last_flush=-1,ee;n=0,o-=a}var l=new Uint8Array(i.gzhead.extra);i.pending_buf.set(l.subarray(i.gzindex,i.gzindex+o),i.pending),i.pending+=o,i.gzhead.hcrc&&i.pending>n&&(e.adler=V(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex=0}i.status=73}if(73===i.status){if(i.gzhead.name){var u,A=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>A&&(e.adler=V(e.adler,i.pending_buf,i.pending-A,A)),xe(e),0!==i.pending)return i.last_flush=-1,ee;A=0}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,Pe(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>A&&(e.adler=V(e.adler,i.pending_buf,i.pending-A,A)),i.gzindex=0}i.status=91}if(91===i.status){if(i.gzhead.comment){var c,h=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>h&&(e.adler=V(e.adler,i.pending_buf,i.pending-h,h)),xe(e),0!==i.pending)return i.last_flush=-1,ee;h=0}c=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,Pe(i,c)}while(0!==c);i.gzhead.hcrc&&i.pending>h&&(e.adler=V(e.adler,i.pending_buf,i.pending-h,h))}i.status=103}if(103===i.status){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size&&(xe(e),0!==i.pending))return i.last_flush=-1,ee;Pe(i,255&e.adler),Pe(i,e.adler>>8&255),e.adler=0}if(i.status=ve,xe(e),0!==i.pending)return i.last_flush=-1,ee}if(0!==e.avail_in||0!==i.lookahead||t!==Y&&i.status!==ge){var d=0===i.level?Ee(i,t):i.strategy===ae?function(e,t){for(var i;;){if(0===e.lookahead&&(Fe(e),0===e.lookahead)){if(t===Y)return 1;break}if(e.match_length=0,i=K(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(we(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===q?(we(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(we(e,!1),0===e.strm.avail_out)?1:2}(i,t):i.strategy===le?function(e,t){for(var i,s,r,n,o=e.window;;){if(e.lookahead<=de){if(Fe(e),e.lookahead<=de&&t===Y)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&((s=o[r=e.strstart-1])===o[++r]&&s===o[++r]&&s===o[++r])){n=e.strstart+de;do{}while(s===o[++r]&&s===o[++r]&&s===o[++r]&&s===o[++r]&&s===o[++r]&&s===o[++r]&&s===o[++r]&&s===o[++r]&&r<n);e.match_length=de-(n-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=K(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=K(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(we(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===q?(we(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(we(e,!1),0===e.strm.avail_out)?1:2}(i,t):Te[i.level].func(i,t);if(3!==d&&4!==d||(i.status=ge),1===d||3===d)return 0===e.avail_out&&(i.last_flush=-1),ee;if(2===d&&(t===J?X(i):t!==$&&(z(i,0,0,!1),t===Z&&(ye(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),xe(e),0===e.avail_out))return i.last_flush=-1,ee}return t!==q?ee:i.wrap<=0?te:(2===i.wrap?(Pe(i,255&e.adler),Pe(i,e.adler>>8&255),Pe(i,e.adler>>16&255),Pe(i,e.adler>>24&255),Pe(i,255&e.total_in),Pe(i,e.total_in>>8&255),Pe(i,e.total_in>>16&255),Pe(i,e.total_in>>24&255)):(Ce(i,e.adler>>>16),Ce(i,65535&e.adler)),xe(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?ee:te)},deflateEnd:function(e){if(Re(e))return ie;var t=e.state.status;return e.state=null,t===ve?me(e,se):ee},deflateSetDictionary:function(e,t){var i=t.length;if(Re(e))return ie;var s=e.state,r=s.wrap;if(2===r||1===r&&s.status!==fe||s.lookahead)return ie;if(1===r&&(e.adler=Q(e.adler,t,i,0)),s.wrap=0,i>=s.w_size){0===r&&(ye(s.head),s.strstart=0,s.block_start=0,s.insert=0);var n=new Uint8Array(s.w_size);n.set(t.subarray(i-s.w_size,i),0),t=n,i=s.w_size}var o=e.avail_in,a=e.next_in,l=e.input;for(e.avail_in=i,e.next_in=0,e.input=t,Fe(s);s.lookahead>=3;){var u=s.strstart,A=s.lookahead-2;do{s.ins_h=Be(s,s.ins_h,s.window[u+3-1]),s.prev[u&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=u,u++}while(--A);s.strstart=u,s.lookahead=2,Fe(s)}return s.strstart+=s.lookahead,s.block_start=s.strstart,s.insert=s.lookahead,s.lookahead=0,s.match_length=s.prev_length=2,s.match_available=0,e.next_in=a,e.input=l,e.avail_in=o,s.wrap=r,ee},deflateInfo:"pako deflate (from Nodeca project)"},Ve=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},He=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=b(i))throw new TypeError(i+"must be non-object");for(var s in i)Ve(i,s)&&(e[s]=i[s])}}return e},je=function(e){for(var t=0,i=0,s=e.length;i<s;i++)t+=e[i].length;for(var r=new Uint8Array(t),n=0,o=0,a=e.length;n<a;n++){var l=e[n];r.set(l,o),o+=l.length}return r},Ge=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Ge=!1}for(var ze=new Uint8Array(256),We=0;We<256;We++)ze[We]=We>=252?6:We>=248?5:We>=240?4:We>=224?3:We>=192?2:1;ze[254]=ze[254]=1;var Ke=function(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,i,s,r,n,o=e.length,a=0;for(r=0;r<o;r++)55296==(64512&(i=e.charCodeAt(r)))&&r+1<o&&(56320==(64512&(s=e.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++)),a+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(a),n=0,r=0;n<a;r++)55296==(64512&(i=e.charCodeAt(r)))&&r+1<o&&(56320==(64512&(s=e.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++)),i<128?t[n++]=i:i<2048?(t[n++]=192|i>>>6,t[n++]=128|63&i):i<65536?(t[n++]=224|i>>>12,t[n++]=128|i>>>6&63,t[n++]=128|63&i):(t[n++]=240|i>>>18,t[n++]=128|i>>>12&63,t[n++]=128|i>>>6&63,t[n++]=128|63&i);return t},Xe=function(e,t){var i,s,r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var n=new Array(2*r);for(s=0,i=0;i<r;){var o=e[i++];if(o<128)n[s++]=o;else{var a=ze[o];if(a>4)n[s++]=65533,i+=a-1;else{for(o&=2===a?31:3===a?15:7;a>1&&i<r;)o=o<<6|63&e[i++],a--;a>1?n[s++]=65533:o<65536?n[s++]=o:(o-=65536,n[s++]=55296|o>>10&1023,n[s++]=56320|1023&o)}}}return function(e,t){if(t<65534&&e.subarray&&Ge)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var i="",s=0;s<t;s++)i+=String.fromCharCode(e[s]);return i}(n,s)},Ye=function(e,t){(t=t||e.length)>e.length&&(t=e.length);for(var i=t-1;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+ze[e[i]]>t?i:t},Je=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Ze=Object.prototype.toString,qe=j.Z_NO_FLUSH,$e=j.Z_SYNC_FLUSH,et=j.Z_FULL_FLUSH,tt=j.Z_FINISH,it=j.Z_OK,st=j.Z_STREAM_END,rt=j.Z_DEFAULT_COMPRESSION,nt=j.Z_DEFAULT_STRATEGY,ot=j.Z_DEFLATED;function at(e){this.options=He({level:rt,method:ot,chunkSize:16384,windowBits:15,memLevel:8,strategy:nt},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Je,this.strm.avail_out=0;var i=Ne.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==it)throw new Error(H[i]);if(t.header&&Ne.deflateSetHeader(this.strm,t.header),t.dictionary){var s;if(s="string"==typeof t.dictionary?Ke(t.dictionary):"[object ArrayBuffer]"===Ze.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(i=Ne.deflateSetDictionary(this.strm,s))!==it)throw new Error(H[i]);this._dict_set=!0}}function lt(e,t){var i=new at(t);if(i.push(e,!0),i.err)throw i.msg||H[i.err];return i.result}at.prototype.push=function(e,t){var i,s,r=this.strm,n=this.options.chunkSize;if(this.ended)return!1;for(s=t===~~t?t:!0===t?tt:qe,"string"==typeof e?r.input=Ke(e):"[object ArrayBuffer]"===Ze.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(s===$e||s===et)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((i=Ne.deflate(r,s))===st)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Ne.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===it;if(0!==r.avail_out){if(s>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},at.prototype.onData=function(e){this.chunks.push(e)},at.prototype.onEnd=function(e){e===it&&(this.result=je(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ut=at,At=lt,ct=function(e,t){return(t=t||{}).raw=!0,lt(e,t)},ht=function(e,t){return(t=t||{}).gzip=!0,lt(e,t)},dt=16209,pt=function(e,t){var i,s,r,n,o,a,l,u,A,c,h,d,p,f,v,g,m,_,y,b,B,x,w,P,C=e.state;i=e.next_in,w=e.input,s=i+(e.avail_in-5),r=e.next_out,P=e.output,n=r-(t-e.avail_out),o=r+(e.avail_out-257),a=C.dmax,l=C.wsize,u=C.whave,A=C.wnext,c=C.window,h=C.hold,d=C.bits,p=C.lencode,f=C.distcode,v=(1<<C.lenbits)-1,g=(1<<C.distbits)-1;e:do{d<15&&(h+=w[i++]<<d,d+=8,h+=w[i++]<<d,d+=8),m=p[h&v];t:for(;;){if(h>>>=_=m>>>24,d-=_,0===(_=m>>>16&255))P[r++]=65535&m;else{if(!(16&_)){if(0==(64&_)){m=p[(65535&m)+(h&(1<<_)-1)];continue t}if(32&_){C.mode=16191;break e}e.msg="invalid literal/length code",C.mode=dt;break e}y=65535&m,(_&=15)&&(d<_&&(h+=w[i++]<<d,d+=8),y+=h&(1<<_)-1,h>>>=_,d-=_),d<15&&(h+=w[i++]<<d,d+=8,h+=w[i++]<<d,d+=8),m=f[h&g];i:for(;;){if(h>>>=_=m>>>24,d-=_,!(16&(_=m>>>16&255))){if(0==(64&_)){m=f[(65535&m)+(h&(1<<_)-1)];continue i}e.msg="invalid distance code",C.mode=dt;break e}if(b=65535&m,d<(_&=15)&&(h+=w[i++]<<d,(d+=8)<_&&(h+=w[i++]<<d,d+=8)),(b+=h&(1<<_)-1)>a){e.msg="invalid distance too far back",C.mode=dt;break e}if(h>>>=_,d-=_,b>(_=r-n)){if((_=b-_)>u&&C.sane){e.msg="invalid distance too far back",C.mode=dt;break e}if(B=0,x=c,0===A){if(B+=l-_,_<y){y-=_;do{P[r++]=c[B++]}while(--_);B=r-b,x=P}}else if(A<_){if(B+=l+A-_,(_-=A)<y){y-=_;do{P[r++]=c[B++]}while(--_);if(B=0,A<y){y-=_=A;do{P[r++]=c[B++]}while(--_);B=r-b,x=P}}}else if(B+=A-_,_<y){y-=_;do{P[r++]=c[B++]}while(--_);B=r-b,x=P}for(;y>2;)P[r++]=x[B++],P[r++]=x[B++],P[r++]=x[B++],y-=3;y&&(P[r++]=x[B++],y>1&&(P[r++]=x[B++]))}else{B=r-b;do{P[r++]=P[B++],P[r++]=P[B++],P[r++]=P[B++],y-=3}while(y>2);y&&(P[r++]=P[B++],y>1&&(P[r++]=P[B++]))}break}}break}}while(i<s&&r<o);i-=y=d>>3,h&=(1<<(d-=y<<3))-1,e.next_in=i,e.next_out=r,e.avail_in=i<s?s-i+5:5-(i-s),e.avail_out=r<o?o-r+257:257-(r-o),C.hold=h,C.bits=d},ft=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),vt=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),gt=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),mt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),_t=function(e,t,i,s,r,n,o,a){var l,u,A,c,h,d,p,f,v,g=a.bits,m=0,_=0,y=0,b=0,B=0,x=0,w=0,P=0,C=0,M=0,k=null,F=new Uint16Array(16),E=new Uint16Array(16),D=null;for(m=0;m<=15;m++)F[m]=0;for(_=0;_<s;_++)F[t[i+_]]++;for(B=g,b=15;b>=1&&0===F[b];b--);if(B>b&&(B=b),0===b)return r[n++]=20971520,r[n++]=20971520,a.bits=1,0;for(y=1;y<b&&0===F[y];y++);for(B<y&&(B=y),P=1,m=1;m<=15;m++)if(P<<=1,(P-=F[m])<0)return-1;if(P>0&&(0===e||1!==b))return-1;for(E[1]=0,m=1;m<15;m++)E[m+1]=E[m]+F[m];for(_=0;_<s;_++)0!==t[i+_]&&(o[E[t[i+_]]++]=_);if(0===e?(k=D=o,d=20):1===e?(k=ft,D=vt,d=257):(k=gt,D=mt,d=0),M=0,_=0,m=y,h=n,x=B,w=0,A=-1,c=(C=1<<B)-1,1===e&&C>852||2===e&&C>592)return 1;for(;;){p=m-w,o[_]+1<d?(f=0,v=o[_]):o[_]>=d?(f=D[o[_]-d],v=k[o[_]-d]):(f=96,v=0),l=1<<m-w,y=u=1<<x;do{r[h+(M>>w)+(u-=l)]=p<<24|f<<16|v|0}while(0!==u);for(l=1<<m-1;M&l;)l>>=1;if(0!==l?(M&=l-1,M+=l):M=0,_++,0==--F[m]){if(m===b)break;m=t[i+o[_]]}if(m>B&&(M&c)!==A){for(0===w&&(w=B),h+=y,P=1<<(x=m-w);x+w<b&&!((P-=F[x+w])<=0);)x++,P<<=1;if(C+=1<<x,1===e&&C>852||2===e&&C>592)return 1;r[A=M&c]=B<<24|x<<16|h-n|0}}return 0!==M&&(r[h+M]=m-w<<24|64<<16|0),a.bits=B,0},yt=j.Z_FINISH,bt=j.Z_BLOCK,Bt=j.Z_TREES,xt=j.Z_OK,wt=j.Z_STREAM_END,Pt=j.Z_NEED_DICT,Ct=j.Z_STREAM_ERROR,Mt=j.Z_DATA_ERROR,kt=j.Z_MEM_ERROR,Ft=j.Z_BUF_ERROR,Et=j.Z_DEFLATED,Dt=16180,It=16190,St=16191,Tt=16192,Lt=16194,Rt=16199,Ut=16200,Ot=16206,Qt=16209,Nt=function(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)};function Vt(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Ht,jt,Gt=function(e){if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.mode<Dt||t.mode>16211?1:0},zt=function(e){if(Gt(e))return Ct;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Dt,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,xt},Wt=function(e){if(Gt(e))return Ct;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,zt(e)},Kt=function(e,t){var i;if(Gt(e))return Ct;var s=e.state;return t<0?(i=0,t=-t):(i=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Ct:(null!==s.window&&s.wbits!==t&&(s.window=null),s.wrap=i,s.wbits=t,Wt(e))},Xt=function(e,t){if(!e)return Ct;var i=new Vt;e.state=i,i.strm=e,i.window=null,i.mode=Dt;var s=Kt(e,t);return s!==xt&&(e.state=null),s},Yt=!0,Jt=function(e){if(Yt){Ht=new Int32Array(512),jt=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(_t(1,e.lens,0,288,Ht,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;_t(2,e.lens,0,32,jt,0,e.work,{bits:5}),Yt=!1}e.lencode=Ht,e.lenbits=9,e.distcode=jt,e.distbits=5},Zt=function(e,t,i,s){var r,n=e.state;return null===n.window&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new Uint8Array(n.wsize)),s>=n.wsize?(n.window.set(t.subarray(i-n.wsize,i),0),n.wnext=0,n.whave=n.wsize):((r=n.wsize-n.wnext)>s&&(r=s),n.window.set(t.subarray(i-s,i-s+r),n.wnext),(s-=r)?(n.window.set(t.subarray(i-s,i),0),n.wnext=s,n.whave=n.wsize):(n.wnext+=r,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=r))),0},qt={inflateReset:Wt,inflateReset2:Kt,inflateResetKeep:zt,inflateInit:function(e){return Xt(e,15)},inflateInit2:Xt,inflate:function(e,t){var i,s,r,n,o,a,l,u,A,c,h,d,p,f,v,g,m,_,y,b,B,x,w,P,C=0,M=new Uint8Array(4),k=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Gt(e)||!e.output||!e.input&&0!==e.avail_in)return Ct;(i=e.state).mode===St&&(i.mode=Tt),o=e.next_out,r=e.output,l=e.avail_out,n=e.next_in,s=e.input,a=e.avail_in,u=i.hold,A=i.bits,c=a,h=l,x=xt;e:for(;;)switch(i.mode){case Dt:if(0===i.wrap){i.mode=Tt;break}for(;A<16;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(2&i.wrap&&35615===u){0===i.wbits&&(i.wbits=15),i.check=0,M[0]=255&u,M[1]=u>>>8&255,i.check=V(i.check,M,2,0),u=0,A=0,i.mode=16181;break}if(i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",i.mode=Qt;break}if((15&u)!==Et){e.msg="unknown compression method",i.mode=Qt;break}if(A-=4,B=8+(15&(u>>>=4)),0===i.wbits&&(i.wbits=B),B>15||B>i.wbits){e.msg="invalid window size",i.mode=Qt;break}i.dmax=1<<i.wbits,i.flags=0,e.adler=i.check=1,i.mode=512&u?16189:St,u=0,A=0;break;case 16181:for(;A<16;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(i.flags=u,(255&i.flags)!==Et){e.msg="unknown compression method",i.mode=Qt;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=Qt;break}i.head&&(i.head.text=u>>8&1),512&i.flags&&4&i.wrap&&(M[0]=255&u,M[1]=u>>>8&255,i.check=V(i.check,M,2,0)),u=0,A=0,i.mode=16182;case 16182:for(;A<32;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}i.head&&(i.head.time=u),512&i.flags&&4&i.wrap&&(M[0]=255&u,M[1]=u>>>8&255,M[2]=u>>>16&255,M[3]=u>>>24&255,i.check=V(i.check,M,4,0)),u=0,A=0,i.mode=16183;case 16183:for(;A<16;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}i.head&&(i.head.xflags=255&u,i.head.os=u>>8),512&i.flags&&4&i.wrap&&(M[0]=255&u,M[1]=u>>>8&255,i.check=V(i.check,M,2,0)),u=0,A=0,i.mode=16184;case 16184:if(1024&i.flags){for(;A<16;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}i.length=u,i.head&&(i.head.extra_len=u),512&i.flags&&4&i.wrap&&(M[0]=255&u,M[1]=u>>>8&255,i.check=V(i.check,M,2,0)),u=0,A=0}else i.head&&(i.head.extra=null);i.mode=16185;case 16185:if(1024&i.flags&&((d=i.length)>a&&(d=a),d&&(i.head&&(B=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(s.subarray(n,n+d),B)),512&i.flags&&4&i.wrap&&(i.check=V(i.check,s,d,n)),a-=d,n+=d,i.length-=d),i.length))break e;i.length=0,i.mode=16186;case 16186:if(2048&i.flags){if(0===a)break e;d=0;do{B=s[n+d++],i.head&&B&&i.length<65536&&(i.head.name+=String.fromCharCode(B))}while(B&&d<a);if(512&i.flags&&4&i.wrap&&(i.check=V(i.check,s,d,n)),a-=d,n+=d,B)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=16187;case 16187:if(4096&i.flags){if(0===a)break e;d=0;do{B=s[n+d++],i.head&&B&&i.length<65536&&(i.head.comment+=String.fromCharCode(B))}while(B&&d<a);if(512&i.flags&&4&i.wrap&&(i.check=V(i.check,s,d,n)),a-=d,n+=d,B)break e}else i.head&&(i.head.comment=null);i.mode=16188;case 16188:if(512&i.flags){for(;A<16;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(4&i.wrap&&u!==(65535&i.check)){e.msg="header crc mismatch",i.mode=Qt;break}u=0,A=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=St;break;case 16189:for(;A<32;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}e.adler=i.check=Nt(u),u=0,A=0,i.mode=It;case It:if(0===i.havedict)return e.next_out=o,e.avail_out=l,e.next_in=n,e.avail_in=a,i.hold=u,i.bits=A,Pt;e.adler=i.check=1,i.mode=St;case St:if(t===bt||t===Bt)break e;case Tt:if(i.last){u>>>=7&A,A-=7&A,i.mode=Ot;break}for(;A<3;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}switch(i.last=1&u,A-=1,3&(u>>>=1)){case 0:i.mode=16193;break;case 1:if(Jt(i),i.mode=Rt,t===Bt){u>>>=2,A-=2;break e}break;case 2:i.mode=16196;break;case 3:e.msg="invalid block type",i.mode=Qt}u>>>=2,A-=2;break;case 16193:for(u>>>=7&A,A-=7&A;A<32;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",i.mode=Qt;break}if(i.length=65535&u,u=0,A=0,i.mode=Lt,t===Bt)break e;case Lt:i.mode=16195;case 16195:if(d=i.length){if(d>a&&(d=a),d>l&&(d=l),0===d)break e;r.set(s.subarray(n,n+d),o),a-=d,n+=d,l-=d,o+=d,i.length-=d;break}i.mode=St;break;case 16196:for(;A<14;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(i.nlen=257+(31&u),u>>>=5,A-=5,i.ndist=1+(31&u),u>>>=5,A-=5,i.ncode=4+(15&u),u>>>=4,A-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=Qt;break}i.have=0,i.mode=16197;case 16197:for(;i.have<i.ncode;){for(;A<3;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}i.lens[k[i.have++]]=7&u,u>>>=3,A-=3}for(;i.have<19;)i.lens[k[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,w={bits:i.lenbits},x=_t(0,i.lens,0,19,i.lencode,0,i.work,w),i.lenbits=w.bits,x){e.msg="invalid code lengths set",i.mode=Qt;break}i.have=0,i.mode=16198;case 16198:for(;i.have<i.nlen+i.ndist;){for(;g=(C=i.lencode[u&(1<<i.lenbits)-1])>>>16&255,m=65535&C,!((v=C>>>24)<=A);){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(m<16)u>>>=v,A-=v,i.lens[i.have++]=m;else{if(16===m){for(P=v+2;A<P;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(u>>>=v,A-=v,0===i.have){e.msg="invalid bit length repeat",i.mode=Qt;break}B=i.lens[i.have-1],d=3+(3&u),u>>>=2,A-=2}else if(17===m){for(P=v+3;A<P;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}A-=v,B=0,d=3+(7&(u>>>=v)),u>>>=3,A-=3}else{for(P=v+7;A<P;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}A-=v,B=0,d=11+(127&(u>>>=v)),u>>>=7,A-=7}if(i.have+d>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=Qt;break}for(;d--;)i.lens[i.have++]=B}}if(i.mode===Qt)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=Qt;break}if(i.lenbits=9,w={bits:i.lenbits},x=_t(1,i.lens,0,i.nlen,i.lencode,0,i.work,w),i.lenbits=w.bits,x){e.msg="invalid literal/lengths set",i.mode=Qt;break}if(i.distbits=6,i.distcode=i.distdyn,w={bits:i.distbits},x=_t(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,w),i.distbits=w.bits,x){e.msg="invalid distances set",i.mode=Qt;break}if(i.mode=Rt,t===Bt)break e;case Rt:i.mode=Ut;case Ut:if(a>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=n,e.avail_in=a,i.hold=u,i.bits=A,pt(e,h),o=e.next_out,r=e.output,l=e.avail_out,n=e.next_in,s=e.input,a=e.avail_in,u=i.hold,A=i.bits,i.mode===St&&(i.back=-1);break}for(i.back=0;g=(C=i.lencode[u&(1<<i.lenbits)-1])>>>16&255,m=65535&C,!((v=C>>>24)<=A);){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(g&&0==(240&g)){for(_=v,y=g,b=m;g=(C=i.lencode[b+((u&(1<<_+y)-1)>>_)])>>>16&255,m=65535&C,!(_+(v=C>>>24)<=A);){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}u>>>=_,A-=_,i.back+=_}if(u>>>=v,A-=v,i.back+=v,i.length=m,0===g){i.mode=16205;break}if(32&g){i.back=-1,i.mode=St;break}if(64&g){e.msg="invalid literal/length code",i.mode=Qt;break}i.extra=15&g,i.mode=16201;case 16201:if(i.extra){for(P=i.extra;A<P;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}i.length+=u&(1<<i.extra)-1,u>>>=i.extra,A-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=16202;case 16202:for(;g=(C=i.distcode[u&(1<<i.distbits)-1])>>>16&255,m=65535&C,!((v=C>>>24)<=A);){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(0==(240&g)){for(_=v,y=g,b=m;g=(C=i.distcode[b+((u&(1<<_+y)-1)>>_)])>>>16&255,m=65535&C,!(_+(v=C>>>24)<=A);){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}u>>>=_,A-=_,i.back+=_}if(u>>>=v,A-=v,i.back+=v,64&g){e.msg="invalid distance code",i.mode=Qt;break}i.offset=m,i.extra=15&g,i.mode=16203;case 16203:if(i.extra){for(P=i.extra;A<P;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}i.offset+=u&(1<<i.extra)-1,u>>>=i.extra,A-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=Qt;break}i.mode=16204;case 16204:if(0===l)break e;if(d=h-l,i.offset>d){if((d=i.offset-d)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=Qt;break}d>i.wnext?(d-=i.wnext,p=i.wsize-d):p=i.wnext-d,d>i.length&&(d=i.length),f=i.window}else f=r,p=o-i.offset,d=i.length;d>l&&(d=l),l-=d,i.length-=d;do{r[o++]=f[p++]}while(--d);0===i.length&&(i.mode=Ut);break;case 16205:if(0===l)break e;r[o++]=i.length,l--,i.mode=Ut;break;case Ot:if(i.wrap){for(;A<32;){if(0===a)break e;a--,u|=s[n++]<<A,A+=8}if(h-=l,e.total_out+=h,i.total+=h,4&i.wrap&&h&&(e.adler=i.check=i.flags?V(i.check,r,h,o-h):Q(i.check,r,h,o-h)),h=l,4&i.wrap&&(i.flags?u:Nt(u))!==i.check){e.msg="incorrect data check",i.mode=Qt;break}u=0,A=0}i.mode=16207;case 16207:if(i.wrap&&i.flags){for(;A<32;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(4&i.wrap&&u!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=Qt;break}u=0,A=0}i.mode=16208;case 16208:x=wt;break e;case Qt:x=Mt;break e;case 16210:return kt;default:return Ct}return e.next_out=o,e.avail_out=l,e.next_in=n,e.avail_in=a,i.hold=u,i.bits=A,(i.wsize||h!==e.avail_out&&i.mode<Qt&&(i.mode<Ot||t!==yt))&&Zt(e,e.output,e.next_out,h-e.avail_out),c-=e.avail_in,h-=e.avail_out,e.total_in+=c,e.total_out+=h,i.total+=h,4&i.wrap&&h&&(e.adler=i.check=i.flags?V(i.check,r,h,e.next_out-h):Q(i.check,r,h,e.next_out-h)),e.data_type=i.bits+(i.last?64:0)+(i.mode===St?128:0)+(i.mode===Rt||i.mode===Lt?256:0),(0===c&&0===h||t===yt)&&x===xt&&(x=Ft),x},inflateEnd:function(e){if(Gt(e))return Ct;var t=e.state;return t.window&&(t.window=null),e.state=null,xt},inflateGetHeader:function(e,t){if(Gt(e))return Ct;var i=e.state;return 0==(2&i.wrap)?Ct:(i.head=t,t.done=!1,xt)},inflateSetDictionary:function(e,t){var i,s=t.length;return Gt(e)?Ct:0!==(i=e.state).wrap&&i.mode!==It?Ct:i.mode===It&&Q(1,t,s,0)!==i.check?Mt:Zt(e,t,s,s)?(i.mode=16210,kt):(i.havedict=1,xt)},inflateInfo:"pako inflate (from Nodeca project)"},$t=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},ei=Object.prototype.toString,ti=j.Z_NO_FLUSH,ii=j.Z_FINISH,si=j.Z_OK,ri=j.Z_STREAM_END,ni=j.Z_NEED_DICT,oi=j.Z_STREAM_ERROR,ai=j.Z_DATA_ERROR,li=j.Z_MEM_ERROR;function ui(e){this.options=He({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Je,this.strm.avail_out=0;var i=qt.inflateInit2(this.strm,t.windowBits);if(i!==si)throw new Error(H[i]);if(this.header=new $t,qt.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Ke(t.dictionary):"[object ArrayBuffer]"===ei.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=qt.inflateSetDictionary(this.strm,t.dictionary))!==si))throw new Error(H[i])}function Ai(e,t){var i=new ui(t);if(i.push(e),i.err)throw i.msg||H[i.err];return i.result}ui.prototype.push=function(e,t){var i,s,r,n=this.strm,o=this.options.chunkSize,a=this.options.dictionary;if(this.ended)return!1;for(s=t===~~t?t:!0===t?ii:ti,"[object ArrayBuffer]"===ei.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(o),n.next_out=0,n.avail_out=o),(i=qt.inflate(n,s))===ni&&a&&((i=qt.inflateSetDictionary(n,a))===si?i=qt.inflate(n,s):i===ai&&(i=ni));n.avail_in>0&&i===ri&&n.state.wrap>0&&0!==e[n.next_in];)qt.inflateReset(n),i=qt.inflate(n,s);switch(i){case oi:case ai:case ni:case li:return this.onEnd(i),this.ended=!0,!1}if(r=n.avail_out,n.next_out&&(0===n.avail_out||i===ri))if("string"===this.options.to){var l=Ye(n.output,n.next_out),u=n.next_out-l,A=Xe(n.output,l);n.next_out=u,n.avail_out=o-u,u&&n.output.set(n.output.subarray(l,l+u),0),this.onData(A)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(i!==si||0!==r){if(i===ri)return i=qt.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},ui.prototype.onData=function(e){this.chunks.push(e)},ui.prototype.onEnd=function(e){e===si&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=je(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ci=function(e,t){return(t=t||{}).raw=!0,Ai(e,t)},hi=ut,di=At,pi=ct,fi=ht,vi=ui,gi=Ai,mi=ci,_i=Ai,yi=j,bi={Deflate:hi,deflate:di,deflateRaw:pi,gzip:fi,Inflate:vi,inflate:gi,inflateRaw:mi,ungzip:_i,constants:yi};e.Deflate=hi,e.Inflate=vi,e.constants=yi,e.default=bi,e.deflate=di,e.deflateRaw=pi,e.gzip=fi,e.inflate=gi,e.inflateRaw=mi,e.ungzip=_i,Object.defineProperty(e,"__esModule",{value:!0})}));var VE=Object.freeze({__proto__:null}),HE=window.pako||VE;HE.inflate||(HE=HE.default);var jE=J.vec4(),GE=J.vec4();var zE,WE=(zE=new Float32Array(3),function(e){return zE[0]=e[0]/255,zE[1]=e[1]/255,zE[2]=e[2]/255,zE});function KE(e,t){var i=[];if(t.length>1)for(var s=0,r=t.length-1;s<r;s++)i.push(t[s]),i.push(t[s+1]);else if(e.length>1)for(var n=0,o=e.length/3-1;n<o;n++)i.push(n),i.push(n+1);return i}!function(){var e=document.createElement("canvas"),t=e.getContext("2d")}();var XE={version:10,parse:function(e,t,i,s,r,n){var o=function(e){var t=0;return{metadata:e[t++],textureData:e[t++],eachTextureDataPortion:e[t++],eachTextureAttributes:e[t++],positions:e[t++],normals:e[t++],colors:e[t++],uvs:e[t++],indices:e[t++],edgeIndices:e[t++],eachTextureSetTextures:e[t++],matrices:e[t++],reusedGeometriesDecodeMatrix:e[t++],eachGeometryPrimitiveType:e[t++],eachGeometryPositionsPortion:e[t++],eachGeometryNormalsPortion:e[t++],eachGeometryColorsPortion:e[t++],eachGeometryUVsPortion:e[t++],eachGeometryIndicesPortion:e[t++],eachGeometryEdgeIndicesPortion:e[t++],eachMeshGeometriesPortion:e[t++],eachMeshMatricesPortion:e[t++],eachMeshTextureSet:e[t++],eachMeshMaterialAttributes:e[t++],eachEntityId:e[t++],eachEntityMeshesPortion:e[t++],eachTileAABB:e[t++],eachTileEntitiesPortion:e[t++]}}(i),a=function(e){function t(e,t){return 0===e.length?[]:HE.inflate(e,t).buffer}return{metadata:JSON.parse(HE.inflate(e.metadata,{to:"string"})),textureData:new Uint8Array(t(e.textureData)),eachTextureDataPortion:new Uint32Array(t(e.eachTextureDataPortion)),eachTextureAttributes:new Uint16Array(t(e.eachTextureAttributes)),positions:new Uint16Array(t(e.positions)),normals:new Int8Array(t(e.normals)),colors:new Uint8Array(t(e.colors)),uvs:new Float32Array(t(e.uvs)),indices:new Uint32Array(t(e.indices)),edgeIndices:new Uint32Array(t(e.edgeIndices)),eachTextureSetTextures:new Int32Array(t(e.eachTextureSetTextures)),matrices:new Float32Array(t(e.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(t(e.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(t(e.eachGeometryPrimitiveType)),eachGeometryPositionsPortion:new Uint32Array(t(e.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(t(e.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(t(e.eachGeometryColorsPortion)),eachGeometryUVsPortion:new Uint32Array(t(e.eachGeometryUVsPortion)),eachGeometryIndicesPortion:new Uint32Array(t(e.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(t(e.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(t(e.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(t(e.eachMeshMatricesPortion)),eachMeshTextureSet:new Int32Array(t(e.eachMeshTextureSet)),eachMeshMaterialAttributes:new Uint8Array(t(e.eachMeshMaterialAttributes)),eachEntityId:JSON.parse(HE.inflate(e.eachEntityId,{to:"string"})),eachEntityMeshesPortion:new Uint32Array(t(e.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(t(e.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(t(e.eachTileEntitiesPortion))}}(o);!function(e,t,i,s,r,n){var o=n.getNextId(),a=i.metadata,l=i.textureData,u=i.eachTextureDataPortion,A=i.eachTextureAttributes,c=i.positions,h=i.normals,d=i.colors,p=i.uvs,f=i.indices,v=i.edgeIndices,g=i.eachTextureSetTextures,m=i.matrices,_=i.reusedGeometriesDecodeMatrix,y=i.eachGeometryPrimitiveType,b=i.eachGeometryPositionsPortion,B=i.eachGeometryNormalsPortion,x=i.eachGeometryColorsPortion,w=i.eachGeometryUVsPortion,P=i.eachGeometryIndicesPortion,C=i.eachGeometryEdgeIndicesPortion,M=i.eachMeshGeometriesPortion,k=i.eachMeshMatricesPortion,F=i.eachMeshTextureSet,E=i.eachMeshMaterialAttributes,D=i.eachEntityId,I=i.eachEntityMeshesPortion,S=i.eachTileAABB,T=i.eachTileEntitiesPortion,L=u.length,R=g.length/5,U=b.length,O=M.length,Q=I.length,N=T.length;r&&r.loadData(a,{includeTypes:t.includeTypes,excludeTypes:t.excludeTypes,globalizeObjectIds:t.globalizeObjectIds});for(var V=0;V<L;V++){var H=V===L-1,j=u[V],G=H?l.length:u[V+1],z=G-j>0,W=9*V,K=1===A[W+0];A[W+1],A[W+2],A[W+3];var X=A[W+4],Y=A[W+5],Z=A[W+6],q=A[W+7],$=A[W+8];if(z){var ee=new Uint8Array(l.subarray(j,G)).buffer,te="".concat(o,"-texture-").concat(V);K?s.createTexture({id:te,buffers:[ee],minFilter:X,magFilter:Y,wrapS:Z,wrapT:q,wrapR:$}):s.createTexture({id:te,imageBuffer:ee,minFilter:X,magFilter:Y,wrapS:Z,wrapT:q,wrapR:$})}}for(var ie=0;ie<R;ie++){var se=5*ie,re="".concat(o,"-textureSet-").concat(ie),ne=g[se+0],ae=g[se+1],le=g[se+2],ue=g[se+3],Ae=g[se+4];s.createTextureSet({id:re,colorTextureId:ne>=0?"".concat(o,"-texture-").concat(ne):null,normalsTextureId:le>=0?"".concat(o,"-texture-").concat(le):null,metallicRoughnessTextureId:ae>=0?"".concat(o,"-texture-").concat(ae):null,emissiveTextureId:ue>=0?"".concat(o,"-texture-").concat(ue):null,occlusionTextureId:Ae>=0?"".concat(o,"-texture-").concat(Ae):null})}for(var ce=new Uint32Array(U),he=0;he<O;he++){var de=M[he];void 0!==ce[de]?ce[de]++:ce[de]=1}for(var pe=J.vec3(),fe=J.AABB3(),ve={},ge=0;ge<N;ge++){var me=ge===N-1,_e=T[ge],ye=me?Q-1:T[ge+1]-1,be=6*ge,Be=S.subarray(be,be+6);J.getAABB3Center(Be,pe),fe[0]=Be[0]-pe[0],fe[1]=Be[1]-pe[1],fe[2]=Be[2]-pe[2],fe[3]=Be[3]-pe[0],fe[4]=Be[4]-pe[1],fe[5]=Be[5]-pe[2];for(var xe=Di.createPositionsDecodeMatrix(fe),we={},Pe=_e;Pe<=ye;Pe++){var Ce=D[Pe],Me=t.globalizeObjectIds?J.globalizeObjectId(s.id,Ce):Ce,ke=Pe===Q-1,Fe=I[Pe],Ee=ke?M.length-1:I[Pe+1]-1,De=[],Ie=e.metaScene.metaObjects[Me],Se={},Te={};if(Ie){if(t.excludeTypesMap&&Ie.type&&t.excludeTypesMap[Ie.type])continue;if(t.includeTypesMap&&Ie.type&&!t.includeTypesMap[Ie.type])continue;var Le=t.objectDefaults?t.objectDefaults[Ie.type]||t.objectDefaults.DEFAULT:null;Le&&(!1===Le.visible&&(Se.visible=!1),!1===Le.pickable&&(Se.pickable=!1),Le.colorize&&(Te.color=Le.colorize),void 0!==Le.opacity&&null!==Le.opacity&&(Te.opacity=Le.opacity),void 0!==Le.metallic&&null!==Le.metallic&&(Te.metallic=Le.metallic),void 0!==Le.roughness&&null!==Le.roughness&&(Te.roughness=Le.roughness))}else if(t.excludeUnclassifiedObjects)continue;for(var Re=Fe;Re<=Ee;Re++){var Ue=M[Re],Oe=ce[Ue]>1,Qe=Ue===U-1,Ne=F[Re],Ve=Ne>=0?"".concat(o,"-textureSet-").concat(Ne):null,He=WE(E.subarray(6*Re,6*Re+3)),je=E[6*Re+3]/255,Ge=E[6*Re+4]/255,ze=E[6*Re+5]/255,We=n.getNextId();if(Oe){var Ke=k[Re],Xe=m.slice(Ke,Ke+16),Ye="".concat(o,"-geometry.").concat(ge,".").concat(Ue),Je=ve[Ye];if(!Je){Je={batchThisMesh:!t.reuseGeometries};var Ze=!1;switch(y[Ue]){case 0:Je.primitiveName="solid",Je.geometryPositions=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),Je.geometryNormals=h.subarray(B[Ue],Qe?h.length:B[Ue+1]),Je.geometryUVs=p.subarray(w[Ue],Qe?p.length:w[Ue+1]),Je.geometryIndices=f.subarray(P[Ue],Qe?f.length:P[Ue+1]),Je.geometryEdgeIndices=v.subarray(C[Ue],Qe?v.length:C[Ue+1]),Ze=Je.geometryPositions.length>0&&Je.geometryIndices.length>0;break;case 1:Je.primitiveName="surface",Je.geometryPositions=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),Je.geometryNormals=h.subarray(B[Ue],Qe?h.length:B[Ue+1]),Je.geometryUVs=p.subarray(w[Ue],Qe?p.length:w[Ue+1]),Je.geometryIndices=f.subarray(P[Ue],Qe?f.length:P[Ue+1]),Je.geometryEdgeIndices=v.subarray(C[Ue],Qe?v.length:C[Ue+1]),Ze=Je.geometryPositions.length>0&&Je.geometryIndices.length>0;break;case 2:Je.primitiveName="points",Je.geometryPositions=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),Je.geometryColors=d.subarray(x[Ue],Qe?d.length:x[Ue+1]),Ze=Je.geometryPositions.length>0;break;case 3:Je.primitiveName="lines",Je.geometryPositions=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),Je.geometryIndices=f.subarray(P[Ue],Qe?f.length:P[Ue+1]),Ze=Je.geometryPositions.length>0&&Je.geometryIndices.length>0;break;case 4:Je.primitiveName="lines",Je.geometryPositions=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),Je.geometryIndices=KE(Je.geometryPositions,f.subarray(P[Ue],Qe?f.length:P[Ue+1])),Ze=Je.geometryPositions.length>0&&Je.geometryIndices.length>0;break;default:continue}if(Ze||(Je=null),Je&&(Je.geometryPositions.length,Je.batchThisMesh)){Je.decompressedPositions=new Float32Array(Je.geometryPositions.length),Je.transformedAndRecompressedPositions=new Uint16Array(Je.geometryPositions.length);for(var qe=Je.geometryPositions,$e=Je.decompressedPositions,et=0,tt=qe.length;et<tt;et+=3)$e[et+0]=qe[et+0]*_[0]+_[12],$e[et+1]=qe[et+1]*_[5]+_[13],$e[et+2]=qe[et+2]*_[10]+_[14];Je.geometryPositions=null,ve[Ye]=Je}}if(Je)if(Je.batchThisMesh){for(var it=Je.decompressedPositions,st=Je.transformedAndRecompressedPositions,rt=0,nt=it.length;rt<nt;rt+=3)jE[0]=it[rt+0],jE[1]=it[rt+1],jE[2]=it[rt+2],jE[3]=1,J.transformVec4(Xe,jE,GE),Di.compressPosition(GE,fe,jE),st[rt+0]=jE[0],st[rt+1]=jE[1],st[rt+2]=jE[2];s.createMesh(oe.apply(Te,{id:We,textureSetId:Ve,origin:pe,primitive:Je.primitiveName,positionsCompressed:st,normalsCompressed:Je.geometryNormals,uv:Je.geometryUVs,colorsCompressed:Je.geometryColors,indices:Je.geometryIndices,edgeIndices:Je.geometryEdgeIndices,positionsDecodeMatrix:xe,color:He,metallic:Ge,roughness:ze,opacity:je})),De.push(We)}else we[Ye]||(s.createGeometry({id:Ye,primitive:Je.primitiveName,positionsCompressed:Je.geometryPositions,normalsCompressed:Je.geometryNormals,uv:Je.geometryUVs,colorsCompressed:Je.geometryColors,indices:Je.geometryIndices,edgeIndices:Je.geometryEdgeIndices,positionsDecodeMatrix:_}),we[Ye]=!0),s.createMesh(oe.apply(Te,{id:We,geometryId:Ye,textureSetId:Ve,matrix:Xe,color:He,metallic:Ge,roughness:ze,opacity:je,origin:pe})),De.push(We)}else{var ot=void 0,at=void 0,lt=void 0,ut=void 0,At=void 0,ct=void 0,ht=void 0,dt=!1;switch(y[Ue]){case 0:ot="solid",at=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),lt=h.subarray(B[Ue],Qe?h.length:B[Ue+1]),ut=p.subarray(w[Ue],Qe?p.length:w[Ue+1]),ct=f.subarray(P[Ue],Qe?f.length:P[Ue+1]),ht=v.subarray(C[Ue],Qe?v.length:C[Ue+1]),dt=at.length>0&&ct.length>0;break;case 1:ot="surface",at=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),lt=h.subarray(B[Ue],Qe?h.length:B[Ue+1]),ut=p.subarray(w[Ue],Qe?p.length:w[Ue+1]),ct=f.subarray(P[Ue],Qe?f.length:P[Ue+1]),ht=v.subarray(C[Ue],Qe?v.length:C[Ue+1]),dt=at.length>0&&ct.length>0;break;case 2:ot="points",at=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),At=d.subarray(x[Ue],Qe?d.length:x[Ue+1]),dt=at.length>0;break;case 3:ot="lines",at=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),ct=f.subarray(P[Ue],Qe?f.length:P[Ue+1]),dt=at.length>0&&ct.length>0;break;case 4:ot="lines",ct=KE(at=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),f.subarray(P[Ue],Qe?f.length:P[Ue+1])),dt=at.length>0&&ct.length>0;break;default:continue}dt&&(s.createMesh(oe.apply(Te,{id:We,textureSetId:Ve,origin:pe,primitive:ot,positionsCompressed:at,normalsCompressed:lt,uv:ut&&ut.length>0?ut:null,colorsCompressed:At,indices:ct&&ct.length>0?ct:null,edgeIndices:ht,positionsDecodeMatrix:xe,color:He,metallic:Ge,roughness:ze,opacity:je})),De.push(We))}}De.length>0&&s.createEntity(oe.apply(Se,{id:Me,isObject:!0,meshIds:De}))}}}(e,t,a,s,r,n)},inflateMetadata:function(e){return JSON.parse(HE.inflate(e,{to:"string"}))}},YE={};YE[XE.version]=XE;var JE=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,["XTCLoader",e,s]))._maxGeometryBatchSize=s.maxGeometryBatchSize,i.textureTranscoder=s.textureTranscoder,i.dataSource=s.dataSource,i.objectDefaults=s.objectDefaults,i.includeTypes=s.includeTypes,i.excludeTypes=s.excludeTypes,i.excludeUnclassifiedObjects=s.excludeUnclassifiedObjects,i.reuseGeometries=s.reuseGeometries,i}return m(t,me),w(t,[{key:"supportedVersions",get:function(){return Object.keys(YE)}},{key:"textureTranscoder",get:function(){return this._textureTranscoder},set:function(e){this._textureTranscoder=e}},{key:"dataSource",get:function(){return this._dataSource},set:function(e){this._dataSource=e||new NE}},{key:"objectDefaults",get:function(){return this._objectDefaults},set:function(e){this._objectDefaults=e||sE}},{key:"includeTypes",get:function(){return this._includeTypes},set:function(e){this._includeTypes=e}},{key:"excludeTypes",get:function(){return this._excludeTypes},set:function(e){this._excludeTypes=e}},{key:"excludeUnclassifiedObjects",get:function(){return this._excludeUnclassifiedObjects},set:function(e){this._excludeUnclassifiedObjects=!!e}},{key:"globalizeObjectIds",get:function(){return this._globalizeObjectIds},set:function(e){this._globalizeObjectIds=!!e}},{key:"reuseGeometries",get:function(){return this._reuseGeometries},set:function(e){this._reuseGeometries=!1!==e}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.id&&this.viewer.scene.components[t.id]&&(this.error("Component with this ID already exists in viewer: "+t.id+" - will autogenerate this ID"),delete t.id),!(t.src||t.xtc||t.manifestSrc||t.manifest))return this.error("load() param expected: src, xtc, manifestSrc or manifestData"),A;var i={},s=t.includeTypes||this._includeTypes,r=t.excludeTypes||this._excludeTypes,n=t.objectDefaults||this._objectDefaults;if(i.reuseGeometries=null!==t.reuseGeometries&&void 0!==t.reuseGeometries?t.reuseGeometries:!1!==this._reuseGeometries,s){i.includeTypesMap={};for(var o=0,a=s.length;o<a;o++)i.includeTypesMap[s[o]]=!0}if(r){i.excludeTypesMap={};for(var l=0,u=r.length;l<u;l++)i.excludeTypesMap[r[l]]=!0}n&&(i.objectDefaults=n),i.excludeUnclassifiedObjects=void 0!==t.excludeUnclassifiedObjects?!!t.excludeUnclassifiedObjects:this._excludeUnclassifiedObjects,i.globalizeObjectIds=void 0!==t.globalizeObjectIds&&null!==t.globalizeObjectIds?!!t.globalizeObjectIds:this._globalizeObjectIds;var A=new vh(this.viewer.scene,oe.apply(t,{isModel:!0,textureTranscoder:this._textureTranscoder,maxGeometryBatchSize:this._maxGeometryBatchSize,origin:t.origin,disableVertexWelding:t.disableVertexWelding||!1,disableIndexRebucketing:t.disableIndexRebucketing||!1,dtxEnabled:t.dtxEnabled})),c=A.id,h=new ap({metaScene:this.viewer.metaScene,id:c});this.viewer.scene.canvas.spinner.processes++;var d,p,f=function(){A.destroyed||(A.finalize(),h.finalize(),e.viewer.scene.canvas.spinner.processes--,A.once("destroyed",(function(){e.viewer.metaScene.destroyMetaModel(h.id)})),e.scheduleTask((function(){A.destroyed||(A.scene.fire("modelLoaded",A.id),A.fire("loaded",!0,!1))})))},v=function(t){e.viewer.scene.canvas.spinner.processes--,e.error(t),A.fire("error",t)},g=0,m={getNextId:function(){return"".concat(c,".").concat(g++)}};if(t.metaModelSrc||t.metaModelData)if(t.metaModelSrc){var _=t.metaModelSrc;this._dataSource.getMetaModel(_,(function(n){A.destroyed||(h.loadData(n,{includeTypes:s,excludeTypes:r,globalizeObjectIds:i.globalizeObjectIds}),t.src?e._loadModel(t.src,t,i,A,null,m,f,v):(e._parseModel(t.xtc,t,i,A,null,m),f()))}),(function(e){v("load(): Failed to load model metadata for model '".concat(c," from '").concat(_,"' - ").concat(e))}))}else t.metaModelData&&(h.loadData(t.metaModelData,{includeTypes:s,excludeTypes:r,globalizeObjectIds:i.globalizeObjectIds}),t.src?this._loadModel(t.src,t,i,A,null,m,f,v):(this._parseModel(t.xtc,t,i,A,null,m),f()));else if(t.src)this._loadModel(t.src,t,i,A,h,m,f,v);else if(t.xtc)this._parseModel(t.xtc,t,i,A,h,m),f();else if(t.manifestSrc||t.manifest){var y=t.manifestSrc?(d=t.manifestSrc,(p=d.split("/")).pop(),p.join("/")+"/"):"",b=function(t,n,o){var a=0,l=function(){A.destroyed||a>=t.length?n():e._dataSource.getMetaModel("".concat(y).concat(t[a]),(function(t){h.loadData(t,{includeTypes:s,excludeTypes:r,globalizeObjectIds:i.globalizeObjectIds}),a++,e.scheduleTask(l,200)}),o)};l()},B=function(s,r,n){var o=0,a=function(){A.destroyed||o>=s.length?r():e._dataSource.getXTC("".concat(y).concat(s[o]),(function(s){e._parseModel(s,t,i,A,null,m),A.preFinalize(),o++,e.scheduleTask(a,200)}),n)};a()},x=function(s,r,n){var o=0,a=function(){A.destroyed||o>=s.length?r():e._dataSource.getXTC("".concat(y).concat(s[o]),(function(s){e._parseModel(s,t,i,A,h,m),A.preFinalize(),o++,e.scheduleTask(a,100)}),n)};a()};if(t.manifest){var w=t.manifest,P=w.xtcFiles;if(!P||0===P.length)return void v("load(): Failed to load model manifest - manifest not valid");var C=w.metaModelFiles;C?b(C,(function(){B(P,f,v)}),v):x(P,f,v)}else this._dataSource.getManifest(t.manifestSrc,(function(e){if(!A.destroyed){var t=e.xtcFiles;if(t&&0!==t.length){var i=e.metaModelFiles;i?b(i,(function(){B(t,f,v)}),v):x(t,f,v)}else v("load(): Failed to load model manifest - manifest not valid")}}),v)}return A}},{key:"_loadModel",value:function(e,t,i,s,r,n,o,a){var l=this;this._dataSource.getXTC(t.src,(function(e){l._parseModel(e,t,i,s,r,n),s.preFinalize(),o()}),a)}},{key:"_parseModel",value:(i=o(r().mark((function e(t,i,s,n,o,a){var l,u,A,c,h,d,p,f,v;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.destroyed){e.next=2;break}return e.abrupt("return");case 2:if(l=new DataView(t),u=new Uint8Array(t),A=l.getUint32(0,!0),c=YE[A]){e.next=9;break}return this.error("Unsupported .XTC file version: "+A+" - this XTCLoaderPlugin supports versions "+Object.keys(YE)),e.abrupt("return");case 9:for(this.log("Loading .xtc V"+A),h=l.getUint32(4,!0),d=[],p=4*(h+2),f=0;f<h;f++)v=l.getUint32(4*(f+2),!0),d.push(u.subarray(p,p+v)),p+=v;c.parse(this.viewer,s,d,n,o,a);case 15:case"end":return e.stop()}}),e,this)}))),function(e,t,s,r,n,o){return i.apply(this,arguments)})},{key:"loadMetadata",value:function(e,t,i,s){var r=this;e._finalized=!1;try{this._workerInflate(e,t,i,(function(t){t.terminate(),r.fire("metaLoaded",{result:"success",metaModel:e}),"function"==typeof s&&s()}),(function(t,i){t.terminate(),r.fire("metaLoaded",{result:"failed",message:i,metaModel:e})}))}catch(t){this.fire("metaloaded",{result:t,metaModel:e})}}},{key:"_workerInflate",value:function(e,t,i,s,r){var n,o,a=this,l=(n=new Blob(['\n self.importScripts(\'https://cdnjs.cloudflare.com/ajax/libs/pako/1.0.11/pako.min.js\');\n \n function inflateMetadata(deflatedData) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(self.pako.inflate(deflatedData, { to: "string" }));\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error("Error inflating metadata:", error);\n\t\t\t\tthrow error;\n\t\t\t} \n\t\t}\n \n self.onmessage = function (e) {\n console.log("start worker:");\n const metaJson = inflateMetadata(e.data.buffer);\n\n self.postMessage({\n metaJson,\n time: new Date().getTime()\n });\n };\n '],{type:"application/javascript"}),o=URL.createObjectURL(n),new Worker(o));l.postMessage({buffer:t}),l.onmessage=function(t){i?e.loadData(t.data.metaJson,(function(){e.finalize(),"function"==typeof s?s(l):l.terminate()}),(function(e){"function"==typeof r&&r(l,e)})):a.fire("metaLoading",(function(){e.loadData(t.data.metaJson,(function(){e.finalize(),"function"==typeof s?s(l):l.terminate()}),(function(e){"function"==typeof r&&r(l,e)}))}))},l.onerror=function(e){"function"==typeof r&&r(l,e.message),l.terminate()}}}]);var i}();var ZE=function(){return w((function e(){B(this,e)}),[{key:"getIFC",value:function(e,t,i){var s=function(){};t=t||s,i=i||s;var r=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){var n=!!r[2],o=r[3];o=window.decodeURIComponent(o),n&&(o=window.atob(o));try{for(var a=new ArrayBuffer(o.length),l=new Uint8Array(a),u=0;u<o.length;u++)l[u]=o.charCodeAt(u);t(a)}catch(e){i(e)}}else{var A=new XMLHttpRequest;A.open("GET",e,!0),A.responseType="arraybuffer",A.onreadystatechange=function(){4===A.readyState&&(200===A.status?t(A.response):i("getXTC error : "+A.response))},A.send(null)}}}])}(),qE=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,["ifcLoader",e,s])).dataSource=s.dataSource,i.objectDefaults=s.objectDefaults,i.includeTypes=s.includeTypes,i.excludeTypes=s.excludeTypes,i.excludeUnclassifiedObjects=s.excludeUnclassifiedObjects,s.WebIFC&&(i._webIFC=s.WebIFC,i._ifcAPI=s.IfcAPI,i.webIfcFroMOutside=!0),i}return m(t,me),w(t,[{key:"supportedVersions",get:function(){return["2x3","4"]}},{key:"dataSource",get:function(){return this._dataSource},set:function(e){this._dataSource=e||new ZE}},{key:"objectDefaults",get:function(){return this._objectDefaults},set:function(e){this._objectDefaults=e||sE}},{key:"includeTypes",get:function(){return this._includeTypes},set:function(e){this._includeTypes=e}},{key:"excludeTypes",get:function(){return this._excludeTypes},set:function(e){this._excludeTypes=e}},{key:"excludeUnclassifiedObjects",get:function(){return this._excludeUnclassifiedObjects},set:function(e){this._excludeUnclassifiedObjects=!!e}},{key:"globalizeObjectIds",get:function(){return this._globalizeObjectIds},set:function(e){this._globalizeObjectIds=!!e}},{key:"load",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.id&&this.viewer.scene.components[e.id]&&(this.error("Component with this ID already exists in viewer: "+e.id+" - will autogenerate this ID"),delete e.id);var t=new vh(this.viewer.scene,oe.apply(e,{isModel:!0}));if(!e.src&&!e.ifc)return this.error("load() param expected: src or IFC"),t;var i={autoNormals:!0};if(!1!==e.loadMetadata){var s=e.includeTypes||this._includeTypes,r=e.excludeTypes||this._excludeTypes,n=e.objectDefaults||this._objectDefaults;if(s){i.includeTypesMap={};for(var o=0,a=s.length;o<a;o++)i.includeTypesMap[s[o]]=!0}if(r){i.excludeTypesMap={};for(var l=0,u=r.length;l<u;l++)i.excludeTypesMap[r[l]]=!0}n&&(i.objectDefaults=n),i.excludeUnclassifiedObjects=void 0!==e.excludeUnclassifiedObjects?!!e.excludeUnclassifiedObjects:this._excludeUnclassifiedObjects,i.globalizeObjectIds=void 0!==e.globalizeObjectIds?!!e.globalizeObjectIds:this._globalizeObjectIds}if(this.webIfcFroMOutside)try{e.src?this._loadModel(e.src,e,i,t):this._parseModel(e.ifc,e,i,t)}catch(e){this.error(e),t.fire("error",e)}return t}},{key:"_loadModel",value:function(e,t,i,s){var r=this,n=this.viewer.scene.canvas.spinner;n.processes++,this._dataSource.getIFC(t.src,(function(e){r._parseModel(e,t,i,s),n.processes--}),(function(e){n.processes--,r.error(e),s.fire("error",e)}))}},{key:"_parseModel",value:function(e,t,i,s){if(!s.destroyed){var r=t.stats||{};if(r.sourceFormat="IFC",r.schemaVersion="",r.title="",r.author="",r.created="",r.numMetaObjects=0,r.numPropertySets=0,r.numObjects=0,r.numGeometries=0,r.numTriangles=0,r.numVertices=0,this.webIfcFroMOutside){if(!this._ifcAPI)throw"WebIFCLoaderPlugin has no WebIFC instance configured - please inject via WebIFCLoaderPlugin constructor"}else i.wasmPath&&this._ifcAPI.SetWasmPath(i.wasmPath);var n,o=new Uint8Array(e),a=this._ifcAPI.OpenModel(o),l=this._ifcAPI.GetModelSchema(a),u=this._ifcAPI.GetLineIDsWithType(a,this._webIFC.IFCPROJECT).get(0),A=!1!==t.loadMetadata,c=void 0!==t.metadata&&null!==t.metadata;n=c?t.metadata:null;var h={ifcProjectId:u,modelID:a,modelSchema:l,sceneModel:s,loadMetadata:A,metadata:A?{id:"",projectId:""+u,author:"",createdAt:"",schema:"",creatingApplication:"",metaObjects:[],propertySets:[]}:n,metaObjects:c?s.metaObjects:{},options:i,nextId:0,stats:r};if(A){if(i.includeTypes){h.includeTypes={};for(var d=0,p=i.includeTypes.length;d<p;d++)h.includeTypes[i.includeTypes[d]]=!0}if(i.excludeTypes){h.excludeTypes={};for(var f=0,v=i.excludeTypes.length;f<v;f++)h.excludeTypes[i.excludeTypes[f]]=!0}this._parseMetaObjects(h),this._parsePropertySets(h)}if(this._parseGeometry(h),s.finalize(),A||c){var g=s.id;this.viewer.metaScene.createMetaModel(g,h.metadata,i)}s.scene.once("tick",(function(){s.destroyed||(s.scene.fire("modelLoaded",s.id),s.fire("loaded",!0,!1))}))}}},{key:"_parseMetaObjects",value:function(e){var t=this._ifcAPI.GetLine(e.modelID,e.ifcProjectId);this._parseSpatialChildren(e,t)}},{key:"_parseSpatialChildren",value:function(e,t,i){var s=this._ifcAPI.GetNameFromTypeCode(t.type);if((!e.includeTypes||e.includeTypes[s])&&(!e.excludeTypes||!e.excludeTypes[s])){this._createMetaObject(e,t,i);var r=t.GlobalId.value;this._parseRelatedItemsOfType(e,t.expressID,"RelatingObject","RelatedObjects",this._webIFC.IFCRELAGGREGATES,r),this._parseRelatedItemsOfType(e,t.expressID,"RelatingStructure","RelatedElements",this._webIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,r)}}},{key:"_createMetaObject",value:function(e,t,i){var s,r=t.GlobalId.value;s=this.webIfcFroMOutside?this._ifcAPI.GetNameFromTypeCode(t.type):t.__proto__.constructor.name;var n={id:r,name:t.Name&&""!==t.Name.value?t.Name.value:s,type:s,parent:i};e.metadata.metaObjects.push(n),e.metaObjects[r]=n,e.stats.numMetaObjects++}},{key:"_parseRelatedItemsOfType",value:function(e,t,i,s,r,n){for(var o=this,a=this._ifcAPI.GetLineIDsWithType(e.modelID,r),l=0;l<a.size();l++){var u=a.get(l),A=this._ifcAPI.GetLine(e.modelID,u);if(null==A)return;var c=A[i],h=!1;if(Array.isArray(c))h=c.map((function(e){return e.value})).includes(t);else h=c.value===t;if(h){var d=A[s];if(Array.isArray(d))d.forEach((function(t){var i=o._ifcAPI.GetLine(e.modelID,t.value);null!=i&&o._parseSpatialChildren(e,i,n)}));else{var p=this._ifcAPI.GetLine(e.modelID,d.value);if(null==p)return;this._parseSpatialChildren(e,p,n)}}}}},{key:"_parsePropertySets",value:function(e){this.log("start parse property...");for(var t=this._ifcAPI.GetLineIDsWithType(e.modelID,this._webIFC.IFCRELDEFINESBYPROPERTIES),i=0;i<t.size();i++){var s=t.get(i),r=this._ifcAPI.GetLine(e.modelID,s,!0);if(r){var n=r.RelatingPropertyDefinition;if(!n)continue;var o=n.GlobalId.value,a=n.HasProperties;if(a&&a.length>0){for(var l=n.Name.value,u=[],A=0,c=a.length;A<c;A++){var h=a[A],d=h.Name,p=h.NominalValue;if(d&&p){var f={name:d.value,type:p.type,value:p.value,valueType:p.valueType};h.Description?f.description=h.Description.value:p.description&&(f.description=p.description),u.push(f)}}var v={id:o,type:"Default",name:l,properties:u};e.metadata.propertySets.push(v),e.stats.numPropertySets++;var g=r.RelatedObjects;if(!g||0===g.length)return;for(var m=0,_=g.length;m<_;m++){var y=g[m].GlobalId.value,b=e.metaObjects[y];b&&(b.propertySetIds||(b.propertySetIds=[]),b.propertySetIds.push(o))}}}}}},{key:"_parseGeometry",value:function(e){var t=this;this.log("start parse geometry"),this._ifcAPI.StreamAllMeshes(e.modelID,(function(i){var s=i.expressID,r=i.geometries,n=[],o=t._ifcAPI.GetLine(e.modelID,s);if(null!=o){var a=o.GlobalId.value;if(e.loadMetadata){var l=a,u=e.metaObjects[l];if(e.includeTypes&&(!u||!e.includeTypes[u.type]))return;if(e.excludeTypes&&(!u||e.excludeTypes[u.type]))return}for(var A=J.mat4(),c=J.vec3(),h=0,d=r.size();h<d;h++){for(var p=r.get(h),f=t._ifcAPI.GetGeometry(e.modelID,p.geometryExpressID),v=t._ifcAPI.GetVertexArray(f.GetVertexData(),f.GetVertexDataSize()),g=t._ifcAPI.GetIndexArray(f.GetIndexData(),f.GetIndexDataSize()),m=new Float64Array(v.length/2),_=new Float32Array(v.length/2),y=0,b=0,B=v.length/6;y<B;y++,b+=3)m[b+0]=v[6*y+0],m[b+1]=v[6*y+1],m[b+2]=v[6*y+2];A.set(p.flatTransformation),J.transformPositions3(A,m);var x=we(m,m,c);if(!e.options.autoNormals)for(var w=0,P=0,C=v.length/6;w<C;w++,P+=3)_[P+0]=v[6*w+3],_[P+1]=v[6*w+4],_[P+2]=v[6*w+5];e.stats.numGeometries++,e.stats.numVertices+=m.length/3,e.stats.numTriangles+=g.length/3;var M="mesh"+e.nextId++;e.sceneModel.createMesh({id:M,primitive:"triangles",origin:x?c:null,positions:m,normals:e.options.autoNormals?null:_,indices:g,color:[p.color.x,p.color.y,p.color.z],opacity:p.color.w}),n.push(M)}var k=e.options.globalizeObjectIds?J.globalizeObjectId(e.sceneModel.id,a):a;e.sceneModel.createEntity({id:k,meshIds:n,isObject:!0}),e.stats.numObjects++}})),this._ifcAPI.StreamAllMeshesWithTypes(e.modelID,[3856911033],(function(i,s,r){var n=i.expressID,o=t._ifcAPI.GetLine(e.modelID,n);if(null!=o){for(var a=o.GlobalId.value,l=i.geometries,u=[],A=J.mat4(),c=J.vec3(),h=0,d=l.size();h<d;h++){for(var p=l.get(h),f=t._ifcAPI.GetGeometry(e.modelID,p.geometryExpressID),v=t._ifcAPI.GetVertexArray(f.GetVertexData(),f.GetVertexDataSize()),g=t._ifcAPI.GetIndexArray(f.GetIndexData(),f.GetIndexDataSize()),m=new Float64Array(v.length/2),_=new Float32Array(v.length/2),y=0,b=0,B=v.length/6;y<B;y++,b+=3)m[b+0]=v[6*y+0],m[b+1]=v[6*y+1],m[b+2]=v[6*y+2];A.set(p.flatTransformation),J.transformPositions3(A,m);var x=we(m,m,c);if(!e.options.autoNormals)for(var w=0,P=0,C=v.length/6;w<C;w++,P+=3)_[P+0]=v[6*w+3],_[P+1]=v[6*w+4],_[P+2]=v[6*w+5];e.stats.numGeometries++,e.stats.numVertices+=m.length/3,e.stats.numTriangles+=g.length/3;var M="mesh"+e.nextId++;e.sceneModel.createMesh({id:M,primitive:"triangles",origin:x?c:null,positions:m,normals:e.options.autoNormals?null:_,indices:g,color:[p.color.x,p.color.y,p.color.z],opacity:p.color.w<1?p.color.w:.1}),u.push(M)}var k=e.options.globalizeObjectIds?J.globalizeObjectId(e.sceneModel.id,a):a;e.sceneModel.createEntity({id:k,meshIds:u,isObject:!0}),e.stats.numObjects++}}))}}])}(),$E=function(){return w((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};B(this,e),this.cacheBuster=!1!==t.cacheBuster}),[{key:"_cacheBusterURL",value:function(e){if(!this.cacheBuster)return e;var t=(new Date).getTime();return e.indexOf("?")>-1?e+"&_="+t:e+"?_="+t}},{key:"getLAS",value:function(e,t,i){e=this._cacheBusterURL(e);var s=function(){};t=t||s,i=i||s;var r=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){var n=!!r[2],o=r[3];o=window.decodeURIComponent(o),n&&(o=window.atob(o));try{for(var a=new ArrayBuffer(o.length),l=new Uint8Array(a),u=0;u<o.length;u++)l[u]=o.charCodeAt(u);t(a)}catch(e){i(e)}}else{var A=new XMLHttpRequest;A.open("GET",e,!0),A.responseType="arraybuffer",A.onreadystatechange=function(){4===A.readyState&&(200===A.status?t(A.response):i("getXKT error : "+A.response))},A.send(null)}}}])}(),eD={name:"LAS",id:"las",module:"las",version:"3.4.14",worker:!0,extensions:["las","laz"],mimeTypes:["application/octet-stream"],text:!0,binary:!0,tests:["LAS"],options:{las:{shape:"mesh",fp64:!1,skip:1,colorDepth:8}}},tD=[{item:"FileSignature",format:"char",size:4},{item:"FileSoureceID",format:"uShort",size:2},{item:"GlobalEncoding",format:"uShort",size:2},{item:"ProjectID1",format:"notUsed",size:4},{item:"ProjectID2",format:"notUsed",size:2},{item:"ProjectID3",format:"notUsed",size:2},{item:"ProjectID4",format:"notUsed",size:8},{item:"VersionMajor",format:"uChar",size:1},{item:"VersionMinor",format:"uChar",size:1},{item:"SystemIdentifier",format:"char",size:32},{item:"GeneratingSoftware",format:"char",size:32},{item:"CreationDay",format:"uShort",size:2},{item:"CreationYear",format:"uShort",size:2},{item:"HeaderSize",format:"uShort",size:2},{item:"OffsetToPointData",format:"uLong",size:4},{item:"NumberOfVariableLengthRecords",format:"uLong",size:4},{item:"PointDataFormatID",format:"uChar",size:1},{item:"PointDataRecordLength",format:"uShort",size:2},{item:"NumberOfPoints",format:"uLong",size:4},{item:"NumberOfPointByReturn",format:"uLong",size:20},{item:"ScaleFactorX",format:"double",size:8},{item:"ScaleFactorY",format:"double",size:8},{item:"ScaleFactorZ",format:"double",size:8},{item:"OffsetX",format:"double",size:8},{item:"OffsetY",format:"double",size:8},{item:"OffsetZ",format:"double",size:8},{item:"MaxX",format:"double",size:8},{item:"MinX",format:"double",size:8},{item:"MaxY",format:"double",size:8},{item:"MinY",format:"double",size:8},{item:"MaxZ",format:"double",size:8},{item:"MinZ",format:"double",size:8}],iD=[{item:"Reserved",format:"uShort",size:2},{item:"UserId",format:"char",size:16},{item:"RecordId",format:"uShort",size:2},{item:"RecordLengthAfterHeader",format:"uShort",size:2},{item:"Description",format:"char",size:32}],sD=function(e){var t=0,i=0,r=0,n=new DataView(e),o=new Uint8Array(6e3),a=function(s){var r,o,a=s.item,l=s.format,u=s.size;switch(l){case"char":return o=new Uint8Array(e,t,u),t+=u,[a,r=nD(o)];case"uShort":return r=n.getUint16(t,!0),t+=u,[a,r];case"uLong":return r=n.getUint32(t,!0),"NumberOfVariableLengthRecords"===a&&(i=r),t+=u,[a,r];case"uChar":return r=n.getUint8(t),t+=u,[a,r];case"double":return r=n.getFloat64(t,!0),t+=u,[a,r];default:t+=u}};return function(){var e={};tD.forEach((function(t){var i=a(s({},t));if(void 0!==i){if("FileSignature"===i[0]&&"LASF"!==i[1])throw new Error("Ivalid FileSignature. Is this a LAS/LAZ file");e[i[0]]=i[1]}}));for(var n=[],l=i,u=function(){var e={};iD.forEach((function(i){var n=a(s({},i));e[n[0]]=n[1],"UserId"===n[0]&&"LASF_Projection"===n[1]&&(r=t-18+54)})),n.push(e)};l--;)u();var A=function(e){if(void 0!==e){for(var t=r+e.RecordLengthAfterHeader,i=o.slice(r,t),s=rD(i),n=new DataView(s),a=6,l=Number(n.getUint16(a,!0)),u=[];l--;){var A={};A.key=n.getUint16(a+=2,!0),A.tiffTagLocation=n.getUint16(a+=2,!0),A.count=n.getUint16(a+=2,!0),A.valueOffset=n.getUint16(a+=2,!0),u.push(A)}var c=u.find((function(e){return 3072===e.key}));if(c&&c.hasOwnProperty("valueOffset"))return c.valueOffset}}(n.find((function(e){return"LASF_Projection"===e.UserId})));return A&&(e.epsg=A),e}()},rD=function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),s=0;s<e.length;++s)i[s]=e[s];return t},nD=function(e){var t="";return e.forEach((function(e){var i=String.fromCharCode(e);"\0"!==i&&(t+=i)})),t.trim()},oD=5e5,aD=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,["lasLoader",e,s])).dataSource=s.dataSource,i.skip=s.skip,i.fp64=s.fp64,i.colorDepth=s.colorDepth,i.center=s.center,i.rotate=s.rotate,i.rotateX=s.rotateX,i.transform=s.transform,i}return m(t,me),w(t,[{key:"dataSource",get:function(){return this._dataSource},set:function(e){this._dataSource=e||new $E}},{key:"skip",get:function(){return this._skip},set:function(e){this._skip=e||1}},{key:"fp64",get:function(){return this._fp64},set:function(e){this._fp64=!!e}},{key:"colorDepth",get:function(){return this._colorDepth},set:function(e){this._colorDepth=e||"auto"}},{key:"center",get:function(){return this._center},set:function(e){this._center=!!e}},{key:"transform",get:function(){return this._transform},set:function(e){this._transform=e}},{key:"rotate",get:function(){return this._rotate},set:function(e){this._rotate=e}},{key:"rotateX",get:function(){return this._rotateX},set:function(e){this._rotateX=e}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.id&&this.viewer.scene.components[t.id]&&(this.error("Component with this ID already exists in viewer: "+t.id+" - will autogenerate this ID"),delete t.id);var i=new vh(this.viewer.scene,oe.apply(t,{maxGeometryBatchSize:oD,isModel:!0}));if(!t.src&&!t.las)return this.error("load() param expected: src or las"),i;var s={las:{skip:this._skip,fp64:this._fp64,colorDepth:this._colorDepth}};if(t.src)this._loadModel(t.src,t,s,i);else{var r=this.viewer.scene.canvas.spinner;r.processes++,this._parseModel(t.las,t,s,i).then((function(){r.processes--}),(function(t){r.processes--,e.error(t),i.fire("error",t)}))}return i}},{key:"_loadModel",value:function(e,t,i,s){var r=this,n=this.viewer.scene.canvas.spinner;n.processes++,this._dataSource.getLAS(t.src,(function(e){r._parseModel(e,t,i,s).then((function(){n.processes--}),(function(e){n.processes--,r.error(e),s.fire("error",e)}))}),(function(e){n.processes--,r.error(e),s.fire("error",e)}))}},{key:"_parseModel",value:function(e,t,i,s){var r=this,n=function(e){var t=e.value;if(r._center){for(var i=J.vec3(),s=t.length,n=0,o=t.length;n<o;n+=3)i[0]+=t[n+0],i[1]+=t[n+1],i[2]+=t[n+2];i[0]/=s,i[1]/=s,i[2]/=s;for(var a=0,l=t.length;a<l;a+=3)t[a+0]-=i[0],t[a+1]-=i[1],t[a+2]-=i[2]}if(r._rotateX&&t)for(var u=0,A=t.length;u<A;u+=3){var c=t[u+1];t[u+1]=t[u+2],t[u+2]=c}if(r._rotate){var h=J.identityQuaternion(),d=J.mat4();J.eulerToQuaternion(r._rotate,"XYZ",h),J.quaternionToRotationMat4(h,d);for(var p=J.vec3(),f=0,v=t.length;f<v;f+=3)p[0]=t[f+0],p[1]=t[f+1],p[2]=t[f+2],J.transformPoint3(d,p,p),t[f+0]=p[0],t[f+1]=p[1],t[f+2]=p[2]}if(r._transform)for(var g=J.mat4(r._transform),m=J.vec3(),_=0,y=t.length;_<y;_+=3)m[0]=t[_+0],m[1]=t[_+1],m[2]=t[_+2],J.transformPoint3(g,m,m),t[_+0]=m[0],t[_+1]=m[1],t[_+2]=m[2];return t};function o(e,t){for(var i=e.value,s=e.size,r=t.value,n=4*r.length,o=new Uint8Array(n),a=0,l=0,u=0,A=r.length;a<A;a++,u+=s,l+=4)o[l+0]=i[u+0],o[l+1]=i[u+1],o[l+2]=i[u+2],o[l+3]=Math.round(r[a]/65536*255);return o}function a(e){for(var t=e.value,i=4*t.length,s=new Uint8Array(i),r=0,n=0,o=t.length;r<o;r++,3,n+=4)s[n+0]=0,s[n+1]=0,s[n+2]=0,s[n+3]=Math.round(t[r]/65536*255);return s}return new Promise((function(l,u){if(s.destroyed)u();else{var A=t.stats||{};A.sourceFormat="LAS",A.schemaVersion="",A.title="",A.author="",A.created="",A.numMetaObjects=0,A.numPropertySets=0,A.numObjects=0,A.numGeometries=0,A.numTriangles=0,A.numVertices=0;try{var c=sD(e);iw(e,eD,i).then((function(e){var A,h,d=e.attributes,p=e.loaderData,f=void 0!==p.pointsFormatId?p.pointsFormatId:-1;if(!d.POSITION)return s.finalize(),void u("No positions found in file");switch(f){case 0:A=n(d.POSITION),h=a(d.intensity);break;case 1:if(!d.intensity)return s.finalize(),void u("No positions found in file");A=n(d.POSITION),h=a(d.intensity);break;case 2:case 3:if(!d.intensity)return s.finalize(),void u("No positions found in file");A=n(d.POSITION),h=o(d.COLOR_0,d.intensity)}for(var v=lD(A,15e5),g=lD(h,2e6),m=[],_=0,y=v.length;_<y;_++){var b="pointsMesh".concat(_);m.push(b),s.createMesh({id:b,primitive:"points",positions:v[_],colorsCompressed:_<g.length?g[_]:null})}var B=t.entityId||J.createUUID();if(s.createEntity({id:B,meshIds:m,isObject:!0}),s.finalize(),t.metaModelJSON){var x=s.id;r.viewer.metaScene.createMetaModel(x,t.metaModelJSON,i)}else if(!1!==t.loadMetadata){var w=J.createUUID(),P={projectId:"",author:"",createdAt:"",schema:"",creatingApplication:"",metaObjects:[{id:w,name:"Model",type:"Model"},{id:B,name:"PointCloud (LAS)",type:"PointCloud",parent:w,attributes:c||{}}],propertySets:[]},C=s.id;r.viewer.metaScene.createMetaModel(C,P,i)}s.scene.once("tick",(function(){s.destroyed||(s.scene.fire("modelLoaded",s.id),s.fire("loaded",!0,!1))})),l()}))}catch(e){s.finalize(),u(e)}}}))}}])}();function lD(e,t){if(t>=e.length)return[e];for(var i=[],s=0;s<e.length;s+=t)i.push(e.slice(s,s+t));return i}export{ws as AlphaFormat,yi as AmbientLight,Xe as AngleMeasurementsControl,Ye as AngleMeasurementsMouseControl,Je as AngleMeasurementsPlugin,$e as AngleMeasurementsSimulateMouseControl,qe as AngleMeasurementsTouchControl,rt as AnnotationsPlugin,cn as AxisGizmoPlugin,xh as BCFViewpointsPlugin,$n as Bitmap,ps as ByteType,ud as CameraMemento,jh as CameraPath,Jh as CameraPathAnimation,gt as Canvas,ts as ClampToEdgeWrapping,_e as Component,dr as CompressedMediaType,Xo as Configs,pd as CubicBezierCurve,Nh as Curve,Fc as DefaultLoadingManager,Fs as DepthFormat,Es as DepthStencilFormat,_i as DirLight,Dh as DistanceMeasurementsControl,Ih as DistanceMeasurementsMouseControl,Sh as DistanceMeasurementsPlugin,Lh as DistanceMeasurementsSimulateMouseControl,Th as DistanceMeasurementsTouchControl,ji as EdgeMaterial,Vi as EmphasisMaterial,_s as FloatType,Qn as Fresnel,ut as Frustum,lt as FrustumPlane,Ar as GIFMediaType,Rh as GLTFDefaultDataSource,rE as GLTFLoaderPlugin,ys as HalfFloatType,td as ImagePlane,gs as IntType,cr as JPEGMediaType,Lc as KTX2TextureTranscoder,aD as LASLoaderPlugin,xn as LambertMaterial,ad as LightMap,mh as LineSet,lr as LinearEncoding,ls as LinearFilter,hs as LinearMipMapLinearFilter,As as LinearMipMapNearestFilter,cs as LinearMipmapLinearFilter,us as LinearMipmapNearestFilter,Ec as Loader,kc as LoadingManager,Uh as LocaleService,ks as LuminanceAlphaFormat,Ms as LuminanceFormat,$ as Map,Ve as Marker,nn as Mesh,Cn as MetallicMaterial,is as MirroredRepeatWrapping,cd as ModelMemento,lE as NavCubePlugin,ss as NearestFilter,as as NearestMipMapLinearFilter,rs as NearestMipMapNearestFilter,os as NearestMipmapLinearFilter,ns as NearestMipmapNearestFilter,Bn as Node,q as ObjectsKdTree3,dd as ObjectsMemento,hr as PNGMediaType,fd as Path,gd as PerformanceModel,Qi as PhongMaterial,me as Plugin,id as PointLight,j as PointerLens,vd as QuadraticBezierCurve,ee as Queue,Cs as RGBAFormat,Ls as RGBAIntegerFormat,rr as RGBA_ASTC_10x10_Format,tr as RGBA_ASTC_10x5_Format,ir as RGBA_ASTC_10x6_Format,sr as RGBA_ASTC_10x8_Format,nr as RGBA_ASTC_12x10_Format,or as RGBA_ASTC_12x12_Format,Ks as RGBA_ASTC_4x4_Format,Xs as RGBA_ASTC_5x4_Format,Ys as RGBA_ASTC_5x5_Format,Js as RGBA_ASTC_6x5_Format,Zs as RGBA_ASTC_6x6_Format,qs as RGBA_ASTC_8x5_Format,$s as RGBA_ASTC_8x6_Format,er as RGBA_ASTC_8x8_Format,ar as RGBA_BPTC_Format,Ws as RGBA_ETC2_EAC_Format,js as RGBA_PVRTC_2BPPV1_Format,Hs as RGBA_PVRTC_4BPPV1_Format,Us as RGBA_S3TC_DXT1_Format,Os as RGBA_S3TC_DXT3_Format,Qs as RGBA_S3TC_DXT5_Format,Ps as RGBFormat,Gs as RGB_ETC1_Format,zs as RGB_ETC2_Format,Vs as RGB_PVRTC_2BPPV1_Format,Ns as RGB_PVRTC_4BPPV1_Format,Rs as RGB_S3TC_DXT1_Format,Ss as RGFormat,Ts as RGIntegerFormat,Ti as ReadableGeometry,Ds as RedFormat,Is as RedIntegerFormat,od as ReflectionMap,Kt as Renderer,es as RepeatWrapping,$i as Scene,vh as SceneModel,so as SceneModelMesh,th as SceneModelTransform,md as SectionBox,hn as SectionPlane,ME as SectionPlanesPlugin,fs as ShortType,_d as Skybox,SE as SkyboxesPlugin,Fn as SpecularMaterial,Vh as SplineCurve,ld as SpriteMarker,IE as StoreyViewsPlugin,On as Texture,yd as TextureTranscoder,LE as TreeViewPlugin,ds as UnsignedByteType,xs as UnsignedInt248Type,ms as UnsignedIntType,bs as UnsignedShort4444Type,Bs as UnsignedShort5551Type,vs as UnsignedShortType,Hn as VBOGeometry,QE as ViewCullPlugin,Lb as Viewer,qE as WebIFCLoaderPlugin,Sc as WorkerPool,NE as XTCDefaultDataSource,JE as XTCLoaderPlugin,Li as buildBoxGeometry,Wn as buildBoxLinesGeometry,an as buildCylinderGeometry,Kn as buildGridGeometry,qn as buildLineGeometry,Xn as buildPlaneGeometry,Jn as buildPolylineGeometry,Zn as buildPolylineGeometryFromCurve,ln as buildSphereGeometry,Yn as buildTorusGeometry,An as buildVectorTextGeometry,Be as createRTCViewMat,ct as frustumIntersectsAABB3,Uc as getKTX2TextureTranscoder,Ce as getPlaneRTCPos,Gn as load3DSGeometry,zn as loadOBJGeometry,J as math,Pe as rtcToWorldPos,ur as sRGBEncoding,At as setFrustum,te as stats,oe as utils,xe as worldToRTCPos,we as worldToRTCPositions};
|
|
36
|
+
***************************************************************************** */var Ap=function(e,t){return Ap=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},Ap(e,t)};function cp(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}Ap(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var hp=function(){return hp=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},hp.apply(this,arguments)};function dp(e,t,i,s){return new(i||(i=Promise))((function(r,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}l((s=s.apply(e,t||[])).next())}))}function pp(e,t){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){o.label=n[1];break}if(6===n[0]&&o.label<r[1]){o.label=r[1],r=n;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(n);break}r[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],s=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}}function fp(e,t,i){if(i||2===arguments.length)for(var s,r=0,n=t.length;r<n;r++)!s&&r in t||(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||t)}for(var vp=function(){function e(e,t,i,s){this.left=e,this.top=t,this.width=i,this.height=s}return e.prototype.add=function(t,i,s,r){return new e(this.left+t,this.top+i,this.width+s,this.height+r)},e.fromClientRect=function(t,i){return new e(i.left+t.windowBounds.left,i.top+t.windowBounds.top,i.width,i.height)},e.fromDOMRectList=function(t,i){var s=Array.from(i).find((function(e){return 0!==e.width}));return s?new e(s.left+t.windowBounds.left,s.top+t.windowBounds.top,s.width,s.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),gp=function(e,t){return vp.fromClientRect(e,t.getBoundingClientRect())},mp=function(e){for(var t=[],i=0,s=e.length;i<s;){var r=e.charCodeAt(i++);if(r>=55296&&r<=56319&&i<s){var n=e.charCodeAt(i++);56320==(64512&n)?t.push(((1023&r)<<10)+(1023&n)+65536):(t.push(r),i--)}else t.push(r)}return t},_p=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var i=e.length;if(!i)return"";for(var s=[],r=-1,n="";++r<i;){var o=e[r];o<=65535?s.push(o):(o-=65536,s.push(55296+(o>>10),o%1024+56320)),(r+1===i||s.length>16384)&&(n+=String.fromCharCode.apply(String,s),s.length=0)}return n},yp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bp="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Bp=0;Bp<64;Bp++)bp[yp.charCodeAt(Bp)]=Bp;for(var xp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wp="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Pp=0;Pp<64;Pp++)wp[xp.charCodeAt(Pp)]=Pp;for(var Cp=function(e,t,i){return e.slice?e.slice(t,i):new Uint16Array(Array.prototype.slice.call(e,t,i))},Mp=function(){function e(e,t,i,s,r,n){this.initialValue=e,this.errorValue=t,this.highStart=i,this.highValueIndex=s,this.index=r,this.data=n}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>5])<<2)+(31&e),this.data[t];if(e<=65535)return t=((t=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[t];if(e<this.highStart)return t=2080+(e>>11),t=this.index[t],t+=e>>5&63,t=((t=this.index[t])<<2)+(31&e),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),kp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fp="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ep=0;Ep<64;Ep++)Fp[kp.charCodeAt(Ep)]=Ep;var Dp=10,Ip=13,Sp=15,Tp=17,Lp=18,Rp=19,Up=20,Op=21,Qp=22,Np=24,Vp=25,Hp=26,jp=27,Gp=28,zp=30,Wp=32,Kp=33,Xp=34,Yp=35,Jp=37,Zp=38,qp=39,$p=40,ef=42,tf=[9001,65288],sf="×",rf="÷",nf=function(e,t){var i,s,r,n=function(e){var t,i,s,r,n,o=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var u="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(o):new Array(o),A=Array.isArray(u)?u:new Uint8Array(u);for(t=0;t<a;t+=4)i=wp[e.charCodeAt(t)],s=wp[e.charCodeAt(t+1)],r=wp[e.charCodeAt(t+2)],n=wp[e.charCodeAt(t+3)],A[l++]=i<<2|s>>4,A[l++]=(15&s)<<4|r>>2,A[l++]=(3&r)<<6|63&n;return u}(e),o=Array.isArray(n)?function(e){for(var t=e.length,i=[],s=0;s<t;s+=4)i.push(e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s]);return i}(n):new Uint32Array(n),a=Array.isArray(n)?function(e){for(var t=e.length,i=[],s=0;s<t;s+=2)i.push(e[s+1]<<8|e[s]);return i}(n):new Uint16Array(n),l=Cp(a,12,o[4]/2),u=2===o[5]?Cp(a,(24+o[4])/2):(i=o,s=Math.ceil((24+o[4])/4),i.slice?i.slice(s,r):new Uint32Array(Array.prototype.slice.call(i,s,r)));return new Mp(o[0],o[1],o[2],o[3],l,u)}("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0Al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LAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc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GYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4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HUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAA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AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQAB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ArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgA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IAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),of=[zp,36],af=[1,2,3,5],lf=[Dp,8],uf=[jp,Hp],Af=af.concat(lf),cf=[Zp,qp,$p,Xp,Yp],hf=[Sp,Ip],df=function(e,t,i,s){var r=s[i];if(Array.isArray(e)?-1!==e.indexOf(r):e===r)for(var n=i;n<=s.length;){if((l=s[++n])===t)return!0;if(l!==Dp)break}if(r===Dp)for(n=i;n>0;){var o=s[--n];if(Array.isArray(e)?-1!==e.indexOf(o):e===o)for(var a=i;a<=s.length;){var l;if((l=s[++a])===t)return!0;if(l!==Dp)break}if(o!==Dp)break}return!1},pf=function(e,t){for(var i=e;i>=0;){var s=t[i];if(s!==Dp)return s;i--}return 0},ff=function(e,t,i,s,r){if(0===i[s])return sf;var n=s-1;if(Array.isArray(r)&&!0===r[n])return sf;var o=n-1,a=n+1,l=t[n],u=o>=0?t[o]:0,A=t[a];if(2===l&&3===A)return sf;if(-1!==af.indexOf(l))return"!";if(-1!==af.indexOf(A))return sf;if(-1!==lf.indexOf(A))return sf;if(8===pf(n,t))return rf;if(11===nf.get(e[n]))return sf;if((l===Wp||l===Kp)&&11===nf.get(e[a]))return sf;if(7===l||7===A)return sf;if(9===l)return sf;if(-1===[Dp,Ip,Sp].indexOf(l)&&9===A)return sf;if(-1!==[Tp,Lp,Rp,Np,Gp].indexOf(A))return sf;if(pf(n,t)===Qp)return sf;if(df(23,Qp,n,t))return sf;if(df([Tp,Lp],Op,n,t))return sf;if(df(12,12,n,t))return sf;if(l===Dp)return rf;if(23===l||23===A)return sf;if(16===A||16===l)return rf;if(-1!==[Ip,Sp,Op].indexOf(A)||14===l)return sf;if(36===u&&-1!==hf.indexOf(l))return sf;if(l===Gp&&36===A)return sf;if(A===Up)return sf;if(-1!==of.indexOf(A)&&l===Vp||-1!==of.indexOf(l)&&A===Vp)return sf;if(l===jp&&-1!==[Jp,Wp,Kp].indexOf(A)||-1!==[Jp,Wp,Kp].indexOf(l)&&A===Hp)return sf;if(-1!==of.indexOf(l)&&-1!==uf.indexOf(A)||-1!==uf.indexOf(l)&&-1!==of.indexOf(A))return sf;if(-1!==[jp,Hp].indexOf(l)&&(A===Vp||-1!==[Qp,Sp].indexOf(A)&&t[a+1]===Vp)||-1!==[Qp,Sp].indexOf(l)&&A===Vp||l===Vp&&-1!==[Vp,Gp,Np].indexOf(A))return sf;if(-1!==[Vp,Gp,Np,Tp,Lp].indexOf(A))for(var c=n;c>=0;){if((h=t[c])===Vp)return sf;if(-1===[Gp,Np].indexOf(h))break;c--}if(-1!==[jp,Hp].indexOf(A))for(c=-1!==[Tp,Lp].indexOf(l)?o:n;c>=0;){var h;if((h=t[c])===Vp)return sf;if(-1===[Gp,Np].indexOf(h))break;c--}if(Zp===l&&-1!==[Zp,qp,Xp,Yp].indexOf(A)||-1!==[qp,Xp].indexOf(l)&&-1!==[qp,$p].indexOf(A)||-1!==[$p,Yp].indexOf(l)&&A===$p)return sf;if(-1!==cf.indexOf(l)&&-1!==[Up,Hp].indexOf(A)||-1!==cf.indexOf(A)&&l===jp)return sf;if(-1!==of.indexOf(l)&&-1!==of.indexOf(A))return sf;if(l===Np&&-1!==of.indexOf(A))return sf;if(-1!==of.concat(Vp).indexOf(l)&&A===Qp&&-1===tf.indexOf(e[a])||-1!==of.concat(Vp).indexOf(A)&&l===Lp)return sf;if(41===l&&41===A){for(var d=i[n],p=1;d>0&&41===t[--d];)p++;if(p%2!=0)return sf}return l===Wp&&A===Kp?sf:rf},vf=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var i=function(e,t){void 0===t&&(t="strict");var i=[],s=[],r=[];return e.forEach((function(e,n){var o=nf.get(e);if(o>50?(r.push(!0),o-=50):r.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return s.push(n),i.push(16);if(4===o||11===o){if(0===n)return s.push(n),i.push(zp);var a=i[n-1];return-1===Af.indexOf(a)?(s.push(s[n-1]),i.push(a)):(s.push(n),i.push(zp))}return s.push(n),31===o?i.push("strict"===t?Op:Jp):o===ef||29===o?i.push(zp):43===o?e>=131072&&e<=196605||e>=196608&&e<=262141?i.push(Jp):i.push(zp):void i.push(o)})),[s,i,r]}(e,t.lineBreak),s=i[0],r=i[1],n=i[2];"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(r=r.map((function(e){return-1!==[Vp,zp,ef].indexOf(e)?Jp:e})));var o="keep-all"===t.wordBreak?n.map((function(t,i){return t&&e[i]>=19968&&e[i]<=40959})):void 0;return[s,r,o]},gf=function(){function e(e,t,i,s){this.codePoints=e,this.required="!"===t,this.start=i,this.end=s}return e.prototype.slice=function(){return _p.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),mf=45,_f=43,yf=-1,bf=function(e){return e>=48&&e<=57},Bf=function(e){return bf(e)||e>=65&&e<=70||e>=97&&e<=102},xf=function(e){return 10===e||9===e||32===e},wf=function(e){return function(e){return function(e){return e>=97&&e<=122}(e)||function(e){return e>=65&&e<=90}(e)}(e)||function(e){return e>=128}(e)||95===e},Pf=function(e){return wf(e)||bf(e)||e===mf},Cf=function(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e},Mf=function(e,t){return 92===e&&10!==t},kf=function(e,t,i){return e===mf?wf(t)||Mf(t,i):!!wf(e)||!(92!==e||!Mf(e,t))},Ff=function(e,t,i){return e===_f||e===mf?!!bf(t)||46===t&&bf(i):bf(46===e?t:e)},Ef=function(e){var t=0,i=1;e[t]!==_f&&e[t]!==mf||(e[t]===mf&&(i=-1),t++);for(var s=[];bf(e[t]);)s.push(e[t++]);var r=s.length?parseInt(_p.apply(void 0,s),10):0;46===e[t]&&t++;for(var n=[];bf(e[t]);)n.push(e[t++]);var o=n.length,a=o?parseInt(_p.apply(void 0,n),10):0;69!==e[t]&&101!==e[t]||t++;var l=1;e[t]!==_f&&e[t]!==mf||(e[t]===mf&&(l=-1),t++);for(var u=[];bf(e[t]);)u.push(e[t++]);var A=u.length?parseInt(_p.apply(void 0,u),10):0;return i*(r+a*Math.pow(10,-o))*Math.pow(10,l*A)},Df={type:2},If={type:3},Sf={type:4},Tf={type:13},Lf={type:8},Rf={type:21},Uf={type:9},Of={type:10},Qf={type:11},Nf={type:12},Vf={type:14},Hf={type:23},jf={type:1},Gf={type:25},zf={type:24},Wf={type:26},Kf={type:27},Xf={type:28},Yf={type:29},Jf={type:31},Zf={type:32},qf=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(mp(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==Zf;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case 34:return this.consumeStringToken(34);case 35:var t=this.peekCodePoint(0),i=this.peekCodePoint(1),s=this.peekCodePoint(2);if(Pf(t)||Mf(i,s)){var r=kf(t,i,s)?2:1;return{type:5,value:this.consumeName(),flags:r}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Tf;break;case 39:return this.consumeStringToken(39);case 40:return Df;case 41:return If;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Vf;break;case _f:if(Ff(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 44:return Sf;case mf:var n=e,o=this.peekCodePoint(0),a=this.peekCodePoint(1);if(Ff(n,o,a))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(kf(n,o,a))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(o===mf&&62===a)return this.consumeCodePoint(),this.consumeCodePoint(),zf;break;case 46:if(Ff(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var l=this.consumeCodePoint();if(42===l&&47===(l=this.consumeCodePoint()))return this.consumeToken();if(l===yf)return this.consumeToken()}break;case 58:return Wf;case 59:return Kf;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===mf&&this.peekCodePoint(2)===mf)return this.consumeCodePoint(),this.consumeCodePoint(),Gf;break;case 64:var u=this.peekCodePoint(0),A=this.peekCodePoint(1),c=this.peekCodePoint(2);if(kf(u,A,c))return{type:7,value:this.consumeName()};break;case 91:return Xf;case 92:if(Mf(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case 93:return Yf;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Lf;break;case 123:return Qf;case 125:return Nf;case 117:case 85:var h=this.peekCodePoint(0),d=this.peekCodePoint(1);return h!==_f||!Bf(d)&&63!==d||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Uf;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),Rf;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Of;break;case yf:return Zf}return xf(e)?(this.consumeWhiteSpace(),Jf):bf(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):wf(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:_p(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return void 0===e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();Bf(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var i=!1;63===t&&e.length<6;)e.push(t),t=this.consumeCodePoint(),i=!0;if(i)return{type:30,start:parseInt(_p.apply(void 0,e.map((function(e){return 63===e?48:e}))),16),end:parseInt(_p.apply(void 0,e.map((function(e){return 63===e?70:e}))),16)};var s=parseInt(_p.apply(void 0,e),16);if(this.peekCodePoint(0)===mf&&Bf(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var r=[];Bf(t)&&r.length<6;)r.push(t),t=this.consumeCodePoint();return{type:30,start:s,end:parseInt(_p.apply(void 0,r),16)}}return{type:30,start:s,end:s}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===yf)return{type:22,value:""};var t=this.peekCodePoint(0);if(39===t||34===t){var i=this.consumeStringToken(this.consumeCodePoint());return 0===i.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===yf||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:i.value}):(this.consumeBadUrlRemnants(),Hf)}for(;;){var s=this.consumeCodePoint();if(s===yf||41===s)return{type:22,value:_p.apply(void 0,e)};if(xf(s))return this.consumeWhiteSpace(),this.peekCodePoint(0)===yf||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:_p.apply(void 0,e)}):(this.consumeBadUrlRemnants(),Hf);if(34===s||39===s||40===s||Cf(s))return this.consumeBadUrlRemnants(),Hf;if(92===s){if(!Mf(s,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),Hf;e.push(this.consumeEscapedCodePoint())}else e.push(s)}},e.prototype.consumeWhiteSpace=function(){for(;xf(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(41===e||e===yf)return;Mf(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t="";e>0;){var i=Math.min(5e4,e);t+=_p.apply(void 0,this._value.splice(0,i)),e-=i}return this._value.shift(),t},e.prototype.consumeStringToken=function(e){for(var t="",i=0;;){var s=this._value[i];if(s===yf||void 0===s||s===e)return{type:0,value:t+=this.consumeStringSlice(i)};if(10===s)return this._value.splice(0,i),jf;if(92===s){var r=this._value[i+1];r!==yf&&void 0!==r&&(10===r?(t+=this.consumeStringSlice(i),i=-1,this._value.shift()):Mf(s,r)&&(t+=this.consumeStringSlice(i),t+=_p(this.consumeEscapedCodePoint()),i=-1))}i++}},e.prototype.consumeNumber=function(){var e=[],t=4,i=this.peekCodePoint(0);for(i!==_f&&i!==mf||e.push(this.consumeCodePoint());bf(this.peekCodePoint(0));)e.push(this.consumeCodePoint());i=this.peekCodePoint(0);var s=this.peekCodePoint(1);if(46===i&&bf(s))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;bf(this.peekCodePoint(0));)e.push(this.consumeCodePoint());i=this.peekCodePoint(0),s=this.peekCodePoint(1);var r=this.peekCodePoint(2);if((69===i||101===i)&&((s===_f||s===mf)&&bf(r)||bf(s)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;bf(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[Ef(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],i=e[1],s=this.peekCodePoint(0),r=this.peekCodePoint(1),n=this.peekCodePoint(2);return kf(s,r,n)?{type:15,number:t,flags:i,unit:this.consumeName()}:37===s?(this.consumeCodePoint(),{type:16,number:t,flags:i}):{type:17,number:t,flags:i}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(Bf(e)){for(var t=_p(e);Bf(this.peekCodePoint(0))&&t.length<6;)t+=_p(this.consumeCodePoint());xf(this.peekCodePoint(0))&&this.consumeCodePoint();var i=parseInt(t,16);return 0===i||function(e){return e>=55296&&e<=57343}(i)||i>1114111?65533:i}return e===yf?65533:e},e.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(Pf(t))e+=_p(t);else{if(!Mf(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=_p(this.consumeEscapedCodePoint())}}},e}(),$f=function(){function e(e){this._tokens=e}return e.create=function(t){var i=new qf;return i.write(t),new e(i.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();31===e.type;)e=this.consumeToken();if(32===e.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do{e=this.consumeToken()}while(31===e.type);if(32===e.type)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(32===t.type)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},i=this.consumeToken();;){if(32===i.type||lv(i,e))return t;this.reconsumeToken(i),t.values.push(this.consumeComponentValue()),i=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var i=this.consumeToken();if(32===i.type||3===i.type)return t;this.reconsumeToken(i),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return void 0===e?Zf:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),ev=function(e){return 15===e.type},tv=function(e){return 17===e.type},iv=function(e){return 20===e.type},sv=function(e){return 0===e.type},rv=function(e,t){return iv(e)&&e.value===t},nv=function(e){return 31!==e.type},ov=function(e){return 31!==e.type&&4!==e.type},av=function(e){var t=[],i=[];return e.forEach((function(e){if(4===e.type){if(0===i.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(i),void(i=[])}31!==e.type&&i.push(e)})),i.length&&t.push(i),t},lv=function(e,t){return 11===t&&12===e.type||(28===t&&29===e.type||2===t&&3===e.type)},uv=function(e){return 17===e.type||15===e.type},Av=function(e){return 16===e.type||uv(e)},cv=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},hv={type:17,number:0,flags:4},dv={type:16,number:50,flags:4},pv={type:16,number:100,flags:4},fv=function(e,t,i){var s=e[0],r=e[1];return[vv(s,t),vv(void 0!==r?r:s,i)]},vv=function(e,t){if(16===e.type)return e.number/100*t;if(ev(e))switch(e.unit){case"rem":case"em":return 16*e.number;default:return e.number}return e.number},gv="grad",mv="turn",_v=function(e,t){if(15===t.type)switch(t.unit){case"deg":return Math.PI*t.number/180;case gv:return Math.PI/200*t.number;case"rad":return t.number;case mv:return 2*Math.PI*t.number}throw new Error("Unsupported angle type")},yv=function(e){return 15===e.type&&("deg"===e.unit||e.unit===gv||"rad"===e.unit||e.unit===mv)},bv=function(e){switch(e.filter(iv).map((function(e){return e.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[hv,hv];case"to top":case"bottom":return Bv(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[hv,pv];case"to right":case"left":return Bv(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[pv,pv];case"to bottom":case"top":return Bv(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[pv,hv];case"to left":case"right":return Bv(270)}return 0},Bv=function(e){return Math.PI*e/180},xv=function(e,t){if(18===t.type){var i=Dv[t.name];if(void 0===i)throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return i(e,t.values)}if(5===t.type){if(3===t.value.length){var s=t.value.substring(0,1),r=t.value.substring(1,2),n=t.value.substring(2,3);return Cv(parseInt(s+s,16),parseInt(r+r,16),parseInt(n+n,16),1)}if(4===t.value.length){s=t.value.substring(0,1),r=t.value.substring(1,2),n=t.value.substring(2,3);var o=t.value.substring(3,4);return Cv(parseInt(s+s,16),parseInt(r+r,16),parseInt(n+n,16),parseInt(o+o,16)/255)}if(6===t.value.length){s=t.value.substring(0,2),r=t.value.substring(2,4),n=t.value.substring(4,6);return Cv(parseInt(s,16),parseInt(r,16),parseInt(n,16),1)}if(8===t.value.length){s=t.value.substring(0,2),r=t.value.substring(2,4),n=t.value.substring(4,6),o=t.value.substring(6,8);return Cv(parseInt(s,16),parseInt(r,16),parseInt(n,16),parseInt(o,16)/255)}}if(20===t.type){var a=Sv[t.value.toUpperCase()];if(void 0!==a)return a}return Sv.TRANSPARENT},wv=function(e){return 0==(255&e)},Pv=function(e){var t=255&e,i=255&e>>8,s=255&e>>16,r=255&e>>24;return t<255?"rgba("+r+","+s+","+i+","+t/255+")":"rgb("+r+","+s+","+i+")"},Cv=function(e,t,i,s){return(e<<24|t<<16|i<<8|Math.round(255*s)<<0)>>>0},Mv=function(e,t){if(17===e.type)return e.number;if(16===e.type){var i=3===t?1:255;return 3===t?e.number/100*i:Math.round(e.number/100*i)}return 0},kv=function(e,t){var i=t.filter(ov);if(3===i.length){var s=i.map(Mv),r=s[0],n=s[1],o=s[2];return Cv(r,n,o,1)}if(4===i.length){var a=i.map(Mv),l=(r=a[0],n=a[1],o=a[2],a[3]);return Cv(r,n,o,l)}return 0};function Fv(e,t,i){return i<0&&(i+=1),i>=1&&(i-=1),i<1/6?(t-e)*i*6+e:i<.5?t:i<2/3?6*(t-e)*(2/3-i)+e:e}var Ev=function(e,t){var i=t.filter(ov),s=i[0],r=i[1],n=i[2],o=i[3],a=(17===s.type?Bv(s.number):_v(e,s))/(2*Math.PI),l=Av(r)?r.number/100:0,u=Av(n)?n.number/100:0,A=void 0!==o&&Av(o)?vv(o,1):1;if(0===l)return Cv(255*u,255*u,255*u,1);var c=u<=.5?u*(l+1):u+l-u*l,h=2*u-c,d=Fv(h,c,a+1/3),p=Fv(h,c,a),f=Fv(h,c,a-1/3);return Cv(255*d,255*p,255*f,A)},Dv={hsl:Ev,hsla:Ev,rgb:kv,rgba:kv},Iv=function(e,t){return xv(e,$f.create(t).parseComponentValue())},Sv={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},Tv={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map((function(e){if(iv(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Lv={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Rv=function(e,t){var i=xv(e,t[0]),s=t[1];return s&&Av(s)?{color:i,stop:s}:{color:i,stop:null}},Uv=function(e,t){var i=e[0],s=e[e.length-1];null===i.stop&&(i.stop=hv),null===s.stop&&(s.stop=pv);for(var r=[],n=0,o=0;o<e.length;o++){var a=e[o].stop;if(null!==a){var l=vv(a,t);l>n?r.push(l):r.push(n),n=l}else r.push(null)}var u=null;for(o=0;o<r.length;o++){var A=r[o];if(null===A)null===u&&(u=o);else if(null!==u){for(var c=o-u,h=(A-r[u-1])/(c+1),d=1;d<=c;d++)r[u+d-1]=h*d;u=null}}return e.map((function(e,i){return{color:e.color,stop:Math.max(Math.min(1,r[i]/t),0)}}))},Ov=function(e,t,i){var s="number"==typeof e?e:function(e,t,i){var s=t/2,r=i/2,n=vv(e[0],t)-s,o=r-vv(e[1],i);return(Math.atan2(o,n)+2*Math.PI)%(2*Math.PI)}(e,t,i),r=Math.abs(t*Math.sin(s))+Math.abs(i*Math.cos(s)),n=t/2,o=i/2,a=r/2,l=Math.sin(s-Math.PI/2)*a,u=Math.cos(s-Math.PI/2)*a;return[r,n-u,n+u,o-l,o+l]},Qv=function(e,t){return Math.sqrt(e*e+t*t)},Nv=function(e,t,i,s,r){return[[0,0],[0,t],[e,0],[e,t]].reduce((function(e,t){var n=t[0],o=t[1],a=Qv(i-n,s-o);return(r?a<e.optimumDistance:a>e.optimumDistance)?{optimumCorner:t,optimumDistance:a}:e}),{optimumDistance:r?1/0:-1/0,optimumCorner:null}).optimumCorner},Vv=function(e,t){var i=Bv(180),s=[];return av(t).forEach((function(t,r){if(0===r){var n=t[0];if(20===n.type&&-1!==["top","left","right","bottom"].indexOf(n.value))return void(i=bv(t));if(yv(n))return void(i=(_v(e,n)+Bv(270))%Bv(360))}var o=Rv(e,t);s.push(o)})),{angle:i,stops:s,type:1}},Hv="closest-side",jv="farthest-side",Gv="closest-corner",zv="farthest-corner",Wv="circle",Kv="ellipse",Xv="cover",Yv="contain",Jv=function(e,t){var i=0,s=3,r=[],n=[];return av(t).forEach((function(t,o){var a=!0;if(0===o?a=t.reduce((function(e,t){if(iv(t))switch(t.value){case"center":return n.push(dv),!1;case"top":case"left":return n.push(hv),!1;case"right":case"bottom":return n.push(pv),!1}else if(Av(t)||uv(t))return n.push(t),!1;return e}),a):1===o&&(a=t.reduce((function(e,t){if(iv(t))switch(t.value){case Wv:return i=0,!1;case Kv:return i=1,!1;case Yv:case Hv:return s=0,!1;case jv:return s=1,!1;case Gv:return s=2,!1;case Xv:case zv:return s=3,!1}else if(uv(t)||Av(t))return Array.isArray(s)||(s=[]),s.push(t),!1;return e}),a)),a){var l=Rv(e,t);r.push(l)}})),{size:s,shape:i,stops:r,position:n,type:2}},Zv=function(e,t){if(22===t.type){var i={url:t.value,type:0};return e.cache.addImage(t.value),i}if(18===t.type){var s=$v[t.name];if(void 0===s)throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return s(e,t.values)}throw new Error("Unsupported image type "+t.type)};var qv,$v={"linear-gradient":function(e,t){var i=Bv(180),s=[];return av(t).forEach((function(t,r){if(0===r){var n=t[0];if(20===n.type&&"to"===n.value)return void(i=bv(t));if(yv(n))return void(i=_v(e,n))}var o=Rv(e,t);s.push(o)})),{angle:i,stops:s,type:1}},"-moz-linear-gradient":Vv,"-ms-linear-gradient":Vv,"-o-linear-gradient":Vv,"-webkit-linear-gradient":Vv,"radial-gradient":function(e,t){var i=0,s=3,r=[],n=[];return av(t).forEach((function(t,o){var a=!0;if(0===o){var l=!1;a=t.reduce((function(e,t){if(l)if(iv(t))switch(t.value){case"center":return n.push(dv),e;case"top":case"left":return n.push(hv),e;case"right":case"bottom":return n.push(pv),e}else(Av(t)||uv(t))&&n.push(t);else if(iv(t))switch(t.value){case Wv:return i=0,!1;case Kv:return i=1,!1;case"at":return l=!0,!1;case Hv:return s=0,!1;case Xv:case jv:return s=1,!1;case Yv:case Gv:return s=2,!1;case zv:return s=3,!1}else if(uv(t)||Av(t))return Array.isArray(s)||(s=[]),s.push(t),!1;return e}),a)}if(a){var u=Rv(e,t);r.push(u)}})),{size:s,shape:i,stops:r,position:n,type:2}},"-moz-radial-gradient":Jv,"-ms-radial-gradient":Jv,"-o-radial-gradient":Jv,"-webkit-radial-gradient":Jv,"-webkit-gradient":function(e,t){var i=Bv(180),s=[],r=1;return av(t).forEach((function(t,i){var n=t[0];if(0===i){if(iv(n)&&"linear"===n.value)return void(r=1);if(iv(n)&&"radial"===n.value)return void(r=2)}if(18===n.type)if("from"===n.name){var o=xv(e,n.values[0]);s.push({stop:hv,color:o})}else if("to"===n.name){o=xv(e,n.values[0]);s.push({stop:pv,color:o})}else if("color-stop"===n.name){var a=n.values.filter(ov);if(2===a.length){o=xv(e,a[1]);var l=a[0];tv(l)&&s.push({stop:{type:16,number:100*l.number,flags:l.flags},color:o})}}})),1===r?{angle:(i+Bv(180))%Bv(360),stops:s,type:r}:{size:3,shape:0,stops:s,position:[],type:r}}},eg={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var i=t[0];return 20===i.type&&"none"===i.value?[]:t.filter((function(e){return ov(e)&&function(e){return!(20===e.type&&"none"===e.value||18===e.type&&!$v[e.name])}(e)})).map((function(t){return Zv(e,t)}))}},tg={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map((function(e){if(iv(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},ig={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return av(t).map((function(e){return e.filter(Av)})).map(cv)}},sg={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return av(t).map((function(e){return e.filter(iv).map((function(e){return e.value})).join(" ")})).map(rg)}},rg=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(qv||(qv={}));var ng,og={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return av(t).map((function(e){return e.filter(ag)}))}},ag=function(e){return iv(e)||Av(e)},lg=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},ug=lg("top"),Ag=lg("right"),cg=lg("bottom"),hg=lg("left"),dg=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return cv(t.filter(Av))}}},pg=dg("top-left"),fg=dg("top-right"),vg=dg("bottom-right"),gg=dg("bottom-left"),mg=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},_g=mg("top"),yg=mg("right"),bg=mg("bottom"),Bg=mg("left"),xg=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return ev(t)?t.number:0}}},wg=xg("top"),Pg=xg("right"),Cg=xg("bottom"),Mg=xg("left"),kg={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Fg={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){return"rtl"===t?1:0}},Eg={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(iv).reduce((function(e,t){return e|Dg(t.value)}),0)}},Dg=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},Ig={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Sg={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return 20===t.type&&"normal"===t.value?0:17===t.type||15===t.type?t.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(ng||(ng={}));var Tg,Lg={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"strict"===t?ng.STRICT:ng.NORMAL}},Rg={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ug=function(e,t){return iv(e)&&"normal"===e.value?1.2*t:17===e.type?t*e.number:Av(e)?vv(e,t):t},Og={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return 20===t.type&&"none"===t.value?null:Zv(e,t)}},Qg={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){return"inside"===t?0:1}},Ng={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},Vg=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},Hg=Vg("top"),jg=Vg("right"),Gg=Vg("bottom"),zg=Vg("left"),Wg={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(iv).map((function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}}))}},Kg={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"break-word"===t?"break-word":"normal"}},Xg=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Yg=Xg("top"),Jg=Xg("right"),Zg=Xg("bottom"),qg=Xg("left"),$g={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},em={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},tm={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&rv(t[0],"none")?[]:av(t).map((function(t){for(var i={color:Sv.TRANSPARENT,offsetX:hv,offsetY:hv,blur:hv},s=0,r=0;r<t.length;r++){var n=t[r];uv(n)?(0===s?i.offsetX=n:1===s?i.offsetY=n:i.blur=n,s++):i.color=xv(e,n)}return i}))}},im={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},sm={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,t){if(20===t.type&&"none"===t.value)return null;if(18===t.type){var i=rm[t.name];if(void 0===i)throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return i(t.values)}return null}},rm={matrix:function(e){var t=e.filter((function(e){return 17===e.type})).map((function(e){return e.number}));return 6===t.length?t:null},matrix3d:function(e){var t=e.filter((function(e){return 17===e.type})).map((function(e){return e.number})),i=t[0],s=t[1];t[2],t[3];var r=t[4],n=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var o=t[12],a=t[13];return t[14],t[15],16===t.length?[i,s,r,n,o,a]:null}},nm={type:16,number:50,flags:4},om=[nm,nm],am={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var i=t.filter(Av);return 2!==i.length?om:[i[0],i[1]]}},lm={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"}(Tg||(Tg={}));for(var um={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return Tg.BREAK_ALL;case"keep-all":return Tg.KEEP_ALL;default:return Tg.NORMAL}}},Am={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(20===t.type)return{auto:!0,order:0};if(tv(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},cm=function(e,t){if(15===t.type)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")},hm={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return tv(t)?t.number:1}},dm={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},pm={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(iv).map((function(e){switch(e.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0})).filter((function(e){return 0!==e}))}},fm={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var i=[],s=[];return t.forEach((function(e){switch(e.type){case 20:case 0:i.push(e.value);break;case 17:i.push(e.number.toString());break;case 4:s.push(i.join(" ")),i.length=0}})),i.length&&s.push(i.join(" ")),s.map((function(e){return-1===e.indexOf(" ")?e:"'"+e+"'"}))}},vm={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},gm={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){return tv(t)?t.number:iv(t)&&"bold"===t.value?700:400}},mm={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(iv).map((function(e){return e.value}))}},_m={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},ym=function(e,t){return 0!=(e&t)},bm={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var i=t[0];return 20===i.type&&"none"===i.value?[]:t}},Bm={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var i=t[0];if(20===i.type&&"none"===i.value)return null;for(var s=[],r=t.filter(nv),n=0;n<r.length;n++){var o=r[n],a=r[n+1];if(20===o.type){var l=a&&tv(a)?a.number:1;s.push({counter:o.value,increment:l})}}return s}},xm={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return[];for(var i=[],s=t.filter(nv),r=0;r<s.length;r++){var n=s[r],o=s[r+1];if(iv(n)&&"none"!==n.value){var a=o&&tv(o)?o.number:0;i.push({counter:n.value,reset:a})}}return i}},wm={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(ev).map((function(t){return cm(e,t)}))}},Pm={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var i=t[0];if(20===i.type&&"none"===i.value)return null;var s=[],r=t.filter(sv);if(r.length%2!=0)return null;for(var n=0;n<r.length;n+=2){var o=r[n].value,a=r[n+1].value;s.push({open:o,close:a})}return s}},Cm=function(e,t,i){if(!e)return"";var s=e[Math.min(t,e.length-1)];return s?i?s.open:s.close:""},Mm={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&rv(t[0],"none")?[]:av(t).map((function(t){for(var i={color:255,offsetX:hv,offsetY:hv,blur:hv,spread:hv,inset:!1},s=0,r=0;r<t.length;r++){var n=t[r];rv(n,"inset")?i.inset=!0:uv(n)?(0===s?i.offsetX=n:1===s?i.offsetY=n:2===s?i.blur=n:i.spread=n,s++):i.color=xv(e,n)}return i}))}},km={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var i=[];return t.filter(iv).forEach((function(e){switch(e.value){case"stroke":i.push(1);break;case"fill":i.push(0);break;case"markers":i.push(2)}})),[0,1,2].forEach((function(e){-1===i.indexOf(e)&&i.push(e)})),i}},Fm={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},Em={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return ev(t)?t.number:0}},Dm=function(){function e(e,t){var i,s;this.animationDuration=Tm(e,wm,t.animationDuration),this.backgroundClip=Tm(e,Tv,t.backgroundClip),this.backgroundColor=Tm(e,Lv,t.backgroundColor),this.backgroundImage=Tm(e,eg,t.backgroundImage),this.backgroundOrigin=Tm(e,tg,t.backgroundOrigin),this.backgroundPosition=Tm(e,ig,t.backgroundPosition),this.backgroundRepeat=Tm(e,sg,t.backgroundRepeat),this.backgroundSize=Tm(e,og,t.backgroundSize),this.borderTopColor=Tm(e,ug,t.borderTopColor),this.borderRightColor=Tm(e,Ag,t.borderRightColor),this.borderBottomColor=Tm(e,cg,t.borderBottomColor),this.borderLeftColor=Tm(e,hg,t.borderLeftColor),this.borderTopLeftRadius=Tm(e,pg,t.borderTopLeftRadius),this.borderTopRightRadius=Tm(e,fg,t.borderTopRightRadius),this.borderBottomRightRadius=Tm(e,vg,t.borderBottomRightRadius),this.borderBottomLeftRadius=Tm(e,gg,t.borderBottomLeftRadius),this.borderTopStyle=Tm(e,_g,t.borderTopStyle),this.borderRightStyle=Tm(e,yg,t.borderRightStyle),this.borderBottomStyle=Tm(e,bg,t.borderBottomStyle),this.borderLeftStyle=Tm(e,Bg,t.borderLeftStyle),this.borderTopWidth=Tm(e,wg,t.borderTopWidth),this.borderRightWidth=Tm(e,Pg,t.borderRightWidth),this.borderBottomWidth=Tm(e,Cg,t.borderBottomWidth),this.borderLeftWidth=Tm(e,Mg,t.borderLeftWidth),this.boxShadow=Tm(e,Mm,t.boxShadow),this.color=Tm(e,kg,t.color),this.direction=Tm(e,Fg,t.direction),this.display=Tm(e,Eg,t.display),this.float=Tm(e,Ig,t.cssFloat),this.fontFamily=Tm(e,fm,t.fontFamily),this.fontSize=Tm(e,vm,t.fontSize),this.fontStyle=Tm(e,_m,t.fontStyle),this.fontVariant=Tm(e,mm,t.fontVariant),this.fontWeight=Tm(e,gm,t.fontWeight),this.letterSpacing=Tm(e,Sg,t.letterSpacing),this.lineBreak=Tm(e,Lg,t.lineBreak),this.lineHeight=Tm(e,Rg,t.lineHeight),this.listStyleImage=Tm(e,Og,t.listStyleImage),this.listStylePosition=Tm(e,Qg,t.listStylePosition),this.listStyleType=Tm(e,Ng,t.listStyleType),this.marginTop=Tm(e,Hg,t.marginTop),this.marginRight=Tm(e,jg,t.marginRight),this.marginBottom=Tm(e,Gg,t.marginBottom),this.marginLeft=Tm(e,zg,t.marginLeft),this.opacity=Tm(e,hm,t.opacity);var r=Tm(e,Wg,t.overflow);this.overflowX=r[0],this.overflowY=r[r.length>1?1:0],this.overflowWrap=Tm(e,Kg,t.overflowWrap),this.paddingTop=Tm(e,Yg,t.paddingTop),this.paddingRight=Tm(e,Jg,t.paddingRight),this.paddingBottom=Tm(e,Zg,t.paddingBottom),this.paddingLeft=Tm(e,qg,t.paddingLeft),this.paintOrder=Tm(e,km,t.paintOrder),this.position=Tm(e,em,t.position),this.textAlign=Tm(e,$g,t.textAlign),this.textDecorationColor=Tm(e,dm,null!==(i=t.textDecorationColor)&&void 0!==i?i:t.color),this.textDecorationLine=Tm(e,pm,null!==(s=t.textDecorationLine)&&void 0!==s?s:t.textDecoration),this.textShadow=Tm(e,tm,t.textShadow),this.textTransform=Tm(e,im,t.textTransform),this.transform=Tm(e,sm,t.transform),this.transformOrigin=Tm(e,am,t.transformOrigin),this.visibility=Tm(e,lm,t.visibility),this.webkitTextStrokeColor=Tm(e,Fm,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=Tm(e,Em,t.webkitTextStrokeWidth),this.wordBreak=Tm(e,um,t.wordBreak),this.zIndex=Tm(e,Am,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return wv(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return 0!==this.position},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return 0!==this.float},e.prototype.isInlineLevel=function(){return ym(this.display,4)||ym(this.display,33554432)||ym(this.display,268435456)||ym(this.display,536870912)||ym(this.display,67108864)||ym(this.display,134217728)},e}(),Im=function(e,t){this.content=Tm(e,bm,t.content),this.quotes=Tm(e,Pm,t.quotes)},Sm=function(e,t){this.counterIncrement=Tm(e,Bm,t.counterIncrement),this.counterReset=Tm(e,xm,t.counterReset)},Tm=function(e,t,i){var s=new qf,r=null!=i?i.toString():t.initialValue;s.write(r);var n=new $f(s.read());switch(t.type){case 2:var o=n.parseComponentValue();return t.parse(e,iv(o)?o.value:t.initialValue);case 0:return t.parse(e,n.parseComponentValue());case 1:return t.parse(e,n.parseComponentValues());case 4:return n.parseComponentValue();case 3:switch(t.format){case"angle":return _v(e,n.parseComponentValue());case"color":return xv(e,n.parseComponentValue());case"image":return Zv(e,n.parseComponentValue());case"length":var a=n.parseComponentValue();return uv(a)?a:hv;case"length-percentage":var l=n.parseComponentValue();return Av(l)?l:hv;case"time":return cm(e,n.parseComponentValue())}}},Lm=function(e,t){var i=function(e){switch(e.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(e);return 1===i||t===i},Rm=function(e,t){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Lm(t,3),this.styles=new Dm(e,window.getComputedStyle(t,null)),N_(t)&&(this.styles.animationDuration.some((function(e){return e>0}))&&(t.style.animationDuration="0s"),null!==this.styles.transform&&(t.style.transform="none")),this.bounds=gp(this.context,t),Lm(t,4)&&(this.flags|=16)},Um="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Om="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Qm=0;Qm<64;Qm++)Om[Um.charCodeAt(Qm)]=Qm;for(var Nm=function(e,t,i){return e.slice?e.slice(t,i):new Uint16Array(Array.prototype.slice.call(e,t,i))},Vm=function(){function e(e,t,i,s,r,n){this.initialValue=e,this.errorValue=t,this.highStart=i,this.highValueIndex=s,this.index=r,this.data=n}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>5])<<2)+(31&e),this.data[t];if(e<=65535)return t=((t=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[t];if(e<this.highStart)return t=2080+(e>>11),t=this.index[t],t+=e>>5&63,t=((t=this.index[t])<<2)+(31&e),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),Hm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jm="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Gm=0;Gm<64;Gm++)jm[Hm.charCodeAt(Gm)]=Gm;var zm,Wm=8,Km=9,Xm=11,Ym=12,Jm=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var i=e.length;if(!i)return"";for(var s=[],r=-1,n="";++r<i;){var o=e[r];o<=65535?s.push(o):(o-=65536,s.push(55296+(o>>10),o%1024+56320)),(r+1===i||s.length>16384)&&(n+=String.fromCharCode.apply(String,s),s.length=0)}return n},Zm=function(e,t){var i,s,r,n=function(e){var t,i,s,r,n,o=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var u="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(o):new Array(o),A=Array.isArray(u)?u:new Uint8Array(u);for(t=0;t<a;t+=4)i=Om[e.charCodeAt(t)],s=Om[e.charCodeAt(t+1)],r=Om[e.charCodeAt(t+2)],n=Om[e.charCodeAt(t+3)],A[l++]=i<<2|s>>4,A[l++]=(15&s)<<4|r>>2,A[l++]=(3&r)<<6|63&n;return u}(e),o=Array.isArray(n)?function(e){for(var t=e.length,i=[],s=0;s<t;s+=4)i.push(e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s]);return i}(n):new Uint32Array(n),a=Array.isArray(n)?function(e){for(var t=e.length,i=[],s=0;s<t;s+=2)i.push(e[s+1]<<8|e[s]);return i}(n):new Uint16Array(n),l=Nm(a,12,o[4]/2),u=2===o[5]?Nm(a,(24+o[4])/2):(i=o,s=Math.ceil((24+o[4])/4),i.slice?i.slice(s,r):new Uint32Array(Array.prototype.slice.call(i,s,r)));return new Vm(o[0],o[1],o[2],o[3],l,u)}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQF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ACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAI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AAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),qm="×",$m=function(e){return Zm.get(e)},e_=function(e,t,i){var s=i-2,r=t[s],n=t[i-1],o=t[i];if(2===n&&3===o)return qm;if(2===n||3===n||4===n)return"÷";if(2===o||3===o||4===o)return"÷";if(n===Wm&&-1!==[Wm,Km,Xm,Ym].indexOf(o))return qm;if(!(n!==Xm&&n!==Km||o!==Km&&10!==o))return qm;if((n===Ym||10===n)&&10===o)return qm;if(13===o||5===o)return qm;if(7===o)return qm;if(1===n)return qm;if(13===n&&14===o){for(;5===r;)r=t[--s];if(14===r)return qm}if(15===n&&15===o){for(var a=0;15===r;)a++,r=t[--s];if(a%2==0)return qm}return"÷"},t_=function(e){var t=function(e){for(var t=[],i=0,s=e.length;i<s;){var r=e.charCodeAt(i++);if(r>=55296&&r<=56319&&i<s){var n=e.charCodeAt(i++);56320==(64512&n)?t.push(((1023&r)<<10)+(1023&n)+65536):(t.push(r),i--)}else t.push(r)}return t}(e),i=t.length,s=0,r=0,n=t.map($m);return{next:function(){if(s>=i)return{done:!0,value:null};for(var e=qm;s<i&&(e=e_(0,n,++s))===qm;);if(e!==qm||s===i){var o=Jm.apply(null,t.slice(r,s));return r=s,{value:o,done:!1}}return{done:!0,value:null}}}},i_=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},s_=function(e,t,i,s,r){var n="http://www.w3.org/2000/svg",o=document.createElementNS(n,"svg"),a=document.createElementNS(n,"foreignObject");return o.setAttributeNS(null,"width",e.toString()),o.setAttributeNS(null,"height",t.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",i.toString()),a.setAttributeNS(null,"y",s.toString()),a.setAttributeNS(null,"externalResourcesRequired","true"),o.appendChild(a),a.appendChild(r),o},r_=function(e){return new Promise((function(t,i){var s=new Image;s.onload=function(){return t(s)},s.onerror=i,s.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))}))},n_={get SUPPORT_RANGE_BOUNDS(){var e=function(e){if(e.createRange){var t=e.createRange();if(t.getBoundingClientRect){var i=e.createElement("boundtest");i.style.height="123px",i.style.display="block",e.body.appendChild(i),t.selectNode(i);var s=t.getBoundingClientRect(),r=Math.round(s.height);if(e.body.removeChild(i),123===r)return!0}}return!1}(document);return Object.defineProperty(n_,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=n_.SUPPORT_RANGE_BOUNDS&&function(e){var t=e.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",e.body.appendChild(t);var i=e.createRange();t.innerHTML="function"==typeof"".repeat?"👨".repeat(10):"";var s=t.firstChild,r=mp(s.data).map((function(e){return _p(e)})),n=0,o={},a=r.every((function(e,t){i.setStart(s,n),i.setEnd(s,n+e.length);var r=i.getBoundingClientRect();n+=e.length;var a=r.x>o.x||r.y>o.y;return o=r,0===t||a}));return e.body.removeChild(t),a}(document);return Object.defineProperty(n_,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var t=new Image,i=e.createElement("canvas"),s=i.getContext("2d");if(!s)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{s.drawImage(t,0,0),i.toDataURL()}catch(e){return!1}return!0}(document);return Object.defineProperty(n_,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"==typeof Array.from&&"function"==typeof window.fetch?function(e){var t=e.createElement("canvas"),i=100;t.width=i,t.height=i;var s=t.getContext("2d");if(!s)return Promise.reject(!1);s.fillStyle="rgb(0, 255, 0)",s.fillRect(0,0,i,i);var r=new Image,n=t.toDataURL();r.src=n;var o=s_(i,i,0,0,r);return s.fillStyle="red",s.fillRect(0,0,i,i),r_(o).then((function(t){s.drawImage(t,0,0);var r=s.getImageData(0,0,i,i).data;s.fillStyle="red",s.fillRect(0,0,i,i);var o=e.createElement("div");return o.style.backgroundImage="url("+n+")",o.style.height=i+"px",i_(r)?r_(s_(i,i,0,0,o)):Promise.reject(!1)})).then((function(e){return s.drawImage(e,0,0),i_(s.getImageData(0,0,i,i).data)})).catch((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(n_,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=void 0!==(new Image).crossOrigin;return Object.defineProperty(n_,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(n_,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(n_,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(n_,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},o_=function(e,t){this.text=e,this.bounds=t},a_=function(e,t){var i=t.ownerDocument;if(i){var s=i.createElement("html2canvaswrapper");s.appendChild(t.cloneNode(!0));var r=t.parentNode;if(r){r.replaceChild(s,t);var n=gp(e,s);return s.firstChild&&r.replaceChild(s.firstChild,s),n}}return vp.EMPTY},l_=function(e,t,i){var s=e.ownerDocument;if(!s)throw new Error("Node has no owner document");var r=s.createRange();return r.setStart(e,t),r.setEnd(e,t+i),r},u_=function(e){if(n_.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map((function(e){return e.segment}))}return function(e){for(var t,i=t_(e),s=[];!(t=i.next()).done;)t.value&&s.push(t.value.slice());return s}(e)},A_=function(e,t){return 0!==t.letterSpacing?u_(e):function(e,t){if(n_.SUPPORT_NATIVE_TEXT_SEGMENTATION){var i=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(i.segment(e)).map((function(e){return e.segment}))}return h_(e,t)}(e,t)},c_=[32,160,4961,65792,65793,4153,4241],h_=function(e,t){for(var i,s=function(e,t){var i=mp(e),s=vf(i,t),r=s[0],n=s[1],o=s[2],a=i.length,l=0,u=0;return{next:function(){if(u>=a)return{done:!0,value:null};for(var e=sf;u<a&&(e=ff(i,n,r,++u,o))===sf;);if(e!==sf||u===a){var t=new gf(i,e,l,u);return l=u,{value:t,done:!1}}return{done:!0,value:null}}}}(e,{lineBreak:t.lineBreak,wordBreak:"break-word"===t.overflowWrap?"break-word":t.wordBreak}),r=[],n=function(){if(i.value){var e=i.value.slice(),t=mp(e),s="";t.forEach((function(e){-1===c_.indexOf(e)?s+=_p(e):(s.length&&r.push(s),r.push(_p(e)),s="")})),s.length&&r.push(s)}};!(i=s.next()).done;)n();return r},d_=function(e,t,i){this.text=p_(t.data,i.textTransform),this.textBounds=function(e,t,i,s){var r=A_(t,i),n=[],o=0;return r.forEach((function(t){if(i.textDecorationLine.length||t.trim().length>0)if(n_.SUPPORT_RANGE_BOUNDS){var r=l_(s,o,t.length).getClientRects();if(r.length>1){var a=u_(t),l=0;a.forEach((function(t){n.push(new o_(t,vp.fromDOMRectList(e,l_(s,l+o,t.length).getClientRects()))),l+=t.length}))}else n.push(new o_(t,vp.fromDOMRectList(e,r)))}else{var u=s.splitText(t.length);n.push(new o_(t,a_(e,s))),s=u}else n_.SUPPORT_RANGE_BOUNDS||(s=s.splitText(t.length));o+=t.length})),n}(e,this.text,i,t)},p_=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(f_,v_);case 2:return e.toUpperCase();default:return e}},f_=/(^|\s|:|-|\(|\))([a-z])/g,v_=function(e,t,i){return e.length>0?t+i.toUpperCase():e},g_=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.src=i.currentSrc||i.src,s.intrinsicWidth=i.naturalWidth,s.intrinsicHeight=i.naturalHeight,s.context.cache.addImage(s.src),s}return cp(t,e),t}(Rm),m_=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.canvas=i,s.intrinsicWidth=i.width,s.intrinsicHeight=i.height,s}return cp(t,e),t}(Rm),__=function(e){function t(t,i){var s=e.call(this,t,i)||this,r=new XMLSerializer,n=gp(t,i);return i.setAttribute("width",n.width+"px"),i.setAttribute("height",n.height+"px"),s.svg="data:image/svg+xml,"+encodeURIComponent(r.serializeToString(i)),s.intrinsicWidth=i.width.baseVal.value,s.intrinsicHeight=i.height.baseVal.value,s.context.cache.addImage(s.svg),s}return cp(t,e),t}(Rm),y_=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.value=i.value,s}return cp(t,e),t}(Rm),b_=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.start=i.start,s.reversed="boolean"==typeof i.reversed&&!0===i.reversed,s}return cp(t,e),t}(Rm),B_=[{type:15,flags:0,unit:"px",number:3}],x_=[{type:16,flags:0,number:50}],w_="checkbox",P_="radio",C_="password",M_=707406591,k_=function(e){function t(t,i){var s,r=e.call(this,t,i)||this;switch(r.type=i.type.toLowerCase(),r.checked=i.checked,r.value=function(e){var t=e.type===C_?new Array(e.value.length+1).join("•"):e.value;return 0===t.length?e.placeholder||"":t}(i),r.type!==w_&&r.type!==P_||(r.styles.backgroundColor=3739148031,r.styles.borderTopColor=r.styles.borderRightColor=r.styles.borderBottomColor=r.styles.borderLeftColor=2779096575,r.styles.borderTopWidth=r.styles.borderRightWidth=r.styles.borderBottomWidth=r.styles.borderLeftWidth=1,r.styles.borderTopStyle=r.styles.borderRightStyle=r.styles.borderBottomStyle=r.styles.borderLeftStyle=1,r.styles.backgroundClip=[0],r.styles.backgroundOrigin=[0],r.bounds=(s=r.bounds).width>s.height?new vp(s.left+(s.width-s.height)/2,s.top,s.height,s.height):s.width<s.height?new vp(s.left,s.top+(s.height-s.width)/2,s.width,s.width):s),r.type){case w_:r.styles.borderTopRightRadius=r.styles.borderTopLeftRadius=r.styles.borderBottomRightRadius=r.styles.borderBottomLeftRadius=B_;break;case P_:r.styles.borderTopRightRadius=r.styles.borderTopLeftRadius=r.styles.borderBottomRightRadius=r.styles.borderBottomLeftRadius=x_}return r}return cp(t,e),t}(Rm),F_=function(e){function t(t,i){var s=e.call(this,t,i)||this,r=i.options[i.selectedIndex||0];return s.value=r&&r.text||"",s}return cp(t,e),t}(Rm),E_=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.value=i.value,s}return cp(t,e),t}(Rm),D_=function(e){function t(t,i){var s=e.call(this,t,i)||this;s.src=i.src,s.width=parseInt(i.width,10)||0,s.height=parseInt(i.height,10)||0,s.backgroundColor=s.styles.backgroundColor;try{if(i.contentWindow&&i.contentWindow.document&&i.contentWindow.document.documentElement){s.tree=L_(t,i.contentWindow.document.documentElement);var r=i.contentWindow.document.documentElement?Iv(t,getComputedStyle(i.contentWindow.document.documentElement).backgroundColor):Sv.TRANSPARENT,n=i.contentWindow.document.body?Iv(t,getComputedStyle(i.contentWindow.document.body).backgroundColor):Sv.TRANSPARENT;s.backgroundColor=wv(r)?wv(n)?s.styles.backgroundColor:n:r}}catch(e){}return s}return cp(t,e),t}(Rm),I_=["OL","UL","MENU"],S_=function(e,t,i,s){for(var r=t.firstChild,n=void 0;r;r=n)if(n=r.nextSibling,O_(r)&&r.data.trim().length>0)i.textNodes.push(new d_(e,r,i.styles));else if(Q_(r))if(ey(r)&&r.assignedNodes)r.assignedNodes().forEach((function(t){return S_(e,t,i,s)}));else{var o=T_(e,r);o.styles.isVisible()&&(R_(r,o,s)?o.flags|=4:U_(o.styles)&&(o.flags|=2),-1!==I_.indexOf(r.tagName)&&(o.flags|=8),i.elements.push(o),r.slot,r.shadowRoot?S_(e,r.shadowRoot,o,s):q_(r)||z_(r)||$_(r)||S_(e,r,o,s))}},T_=function(e,t){return Y_(t)?new g_(e,t):K_(t)?new m_(e,t):z_(t)?new __(e,t):H_(t)?new y_(e,t):j_(t)?new b_(e,t):G_(t)?new k_(e,t):$_(t)?new F_(e,t):q_(t)?new E_(e,t):J_(t)?new D_(e,t):new Rm(e,t)},L_=function(e,t){var i=T_(e,t);return i.flags|=4,S_(e,t,i,i),i},R_=function(e,t,i){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||W_(e)&&i.styles.isTransparent()},U_=function(e){return e.isPositioned()||e.isFloating()},O_=function(e){return e.nodeType===Node.TEXT_NODE},Q_=function(e){return e.nodeType===Node.ELEMENT_NODE},N_=function(e){return Q_(e)&&void 0!==e.style&&!V_(e)},V_=function(e){return"object"===b(e.className)},H_=function(e){return"LI"===e.tagName},j_=function(e){return"OL"===e.tagName},G_=function(e){return"INPUT"===e.tagName},z_=function(e){return"svg"===e.tagName},W_=function(e){return"BODY"===e.tagName},K_=function(e){return"CANVAS"===e.tagName},X_=function(e){return"VIDEO"===e.tagName},Y_=function(e){return"IMG"===e.tagName},J_=function(e){return"IFRAME"===e.tagName},Z_=function(e){return"STYLE"===e.tagName},q_=function(e){return"TEXTAREA"===e.tagName},$_=function(e){return"SELECT"===e.tagName},ey=function(e){return"SLOT"===e.tagName},ty=function(e){return e.tagName.indexOf("-")>0},iy=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},e.prototype.pop=function(e){var t=this;e.forEach((function(e){return t.counters[e].pop()}))},e.prototype.parse=function(e){var t=this,i=e.counterIncrement,s=e.counterReset,r=!0;null!==i&&i.forEach((function(e){var i=t.counters[e.counter];i&&0!==e.increment&&(r=!1,i.length||i.push(1),i[Math.max(0,i.length-1)]+=e.increment)}));var n=[];return r&&s.forEach((function(e){var i=t.counters[e.counter];n.push(e.counter),i||(i=t.counters[e.counter]=[]),i.push(e.reset)})),n},e}(),sy={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},ry={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},ny={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},oy={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},ay=function(e,t,i,s,r,n){return e<t||e>i?vy(e,r,n.length>0):s.integers.reduce((function(t,i,r){for(;e>=i;)e-=i,t+=s.values[r];return t}),"")+n},ly=function(e,t,i,s){var r="";do{i||e--,r=s(e)+r,e/=t}while(e*t>=t);return r},uy=function(e,t,i,s,r){var n=i-t+1;return(e<0?"-":"")+(ly(Math.abs(e),n,s,(function(e){return _p(Math.floor(e%n)+t)}))+r)},Ay=function(e,t,i){void 0===i&&(i=". ");var s=t.length;return ly(Math.abs(e),s,!1,(function(e){return t[Math.floor(e%s)]}))+i},cy=function(e,t,i,s,r,n){if(e<-9999||e>9999)return vy(e,4,r.length>0);var o=Math.abs(e),a=r;if(0===o)return t[0]+a;for(var l=0;o>0&&l<=4;l++){var u=o%10;0===u&&ym(n,1)&&""!==a?a=t[u]+a:u>1||1===u&&0===l||1===u&&1===l&&ym(n,2)||1===u&&1===l&&ym(n,4)&&e>100||1===u&&l>1&&ym(n,8)?a=t[u]+(l>0?i[l-1]:"")+a:1===u&&l>0&&(a=i[l-1]+a),o=Math.floor(o/10)}return(e<0?s:"")+a},hy="十百千萬",dy="拾佰仟萬",py="マイナス",fy="마이너스",vy=function(e,t,i){var s=i?". ":"",r=i?"、":"",n=i?", ":"",o=i?" ":"";switch(t){case 0:return"•"+o;case 1:return"◦"+o;case 2:return"◾"+o;case 5:var a=uy(e,48,57,!0,s);return a.length<4?"0"+a:a;case 4:return Ay(e,"〇一二三四五六七八九",r);case 6:return ay(e,1,3999,sy,3,s).toLowerCase();case 7:return ay(e,1,3999,sy,3,s);case 8:return uy(e,945,969,!1,s);case 9:return uy(e,97,122,!1,s);case 10:return uy(e,65,90,!1,s);case 11:return uy(e,1632,1641,!0,s);case 12:case 49:return ay(e,1,9999,ry,3,s);case 35:return ay(e,1,9999,ry,3,s).toLowerCase();case 13:return uy(e,2534,2543,!0,s);case 14:case 30:return uy(e,6112,6121,!0,s);case 15:return Ay(e,"子丑寅卯辰巳午未申酉戌亥",r);case 16:return Ay(e,"甲乙丙丁戊己庚辛壬癸",r);case 17:case 48:return cy(e,"零一二三四五六七八九",hy,"負",r,14);case 47:return cy(e,"零壹貳參肆伍陸柒捌玖",dy,"負",r,15);case 42:return cy(e,"零一二三四五六七八九",hy,"负",r,14);case 41:return cy(e,"零壹贰叁肆伍陆柒捌玖",dy,"负",r,15);case 26:return cy(e,"〇一二三四五六七八九","十百千万",py,r,0);case 25:return cy(e,"零壱弐参四伍六七八九","拾百千万",py,r,7);case 31:return cy(e,"영일이삼사오육칠팔구","십백천만",fy,n,7);case 33:return cy(e,"零一二三四五六七八九","十百千萬",fy,n,0);case 32:return cy(e,"零壹貳參四五六七八九","拾百千",fy,n,7);case 18:return uy(e,2406,2415,!0,s);case 20:return ay(e,1,19999,oy,3,s);case 21:return uy(e,2790,2799,!0,s);case 22:return uy(e,2662,2671,!0,s);case 22:return ay(e,1,10999,ny,3,s);case 23:return Ay(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Ay(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return uy(e,3302,3311,!0,s);case 28:return Ay(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",r);case 29:return Ay(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",r);case 34:return uy(e,3792,3801,!0,s);case 37:return uy(e,6160,6169,!0,s);case 38:return uy(e,4160,4169,!0,s);case 39:return uy(e,2918,2927,!0,s);case 40:return uy(e,1776,1785,!0,s);case 43:return uy(e,3046,3055,!0,s);case 44:return uy(e,3174,3183,!0,s);case 45:return uy(e,3664,3673,!0,s);case 46:return uy(e,3872,3881,!0,s);default:return uy(e,48,57,!0,s)}},gy="data-html2canvas-ignore",my=function(){function e(e,t,i){if(this.context=e,this.options=i,this.scrolledElements=[],this.referenceElement=t,this.counters=new iy,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,t){var i=this,s=yy(e,t);if(!s.contentWindow)return Promise.reject("Unable to find iframe window");var r=e.defaultView.pageXOffset,n=e.defaultView.pageYOffset,o=s.contentWindow,a=o.document,l=xy(s).then((function(){return dp(i,void 0,void 0,(function(){var e,i;return pp(this,(function(r){switch(r.label){case 0:return this.scrolledElements.forEach(ky),o&&(o.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||o.scrollY===t.top&&o.scrollX===t.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-t.left,o.scrollY-t.top,0,0))),e=this.options.onclone,void 0===(i=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:a.fonts&&a.fonts.ready?[4,a.fonts.ready]:[3,2];case 1:r.sent(),r.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,By(a)]:[3,4];case 3:r.sent(),r.label=4;case 4:return"function"==typeof e?[2,Promise.resolve().then((function(){return e(a,i)})).then((function(){return s}))]:[2,s]}}))}))}));return a.open(),a.write(Cy(document.doctype)+"<html></html>"),My(this.referenceElement.ownerDocument,r,n),a.replaceChild(a.adoptNode(this.documentElement),a.documentElement),a.close(),l},e.prototype.createElementClone=function(e){if(Lm(e,2),K_(e))return this.createCanvasClone(e);if(X_(e))return this.createVideoClone(e);if(Z_(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return Y_(t)&&(Y_(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager")),ty(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return Py(e.style,t),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var i=[].slice.call(t.cssRules,0).reduce((function(e,t){return t&&"string"==typeof t.cssText?e+t.cssText:e}),""),s=e.cloneNode(!1);return s.textContent=i,s}}catch(e){if(this.context.logger.error("Unable to access cssRules property",e),"SecurityError"!==e.name)throw e}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var i=e.ownerDocument.createElement("img");try{return i.src=e.toDataURL(),i}catch(t){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var s=e.cloneNode(!1);try{s.width=e.width,s.height=e.height;var r=e.getContext("2d"),n=s.getContext("2d");if(n)if(!this.options.allowTaint&&r)n.putImageData(r.getImageData(0,0,e.width,e.height),0,0);else{var o=null!==(t=e.getContext("webgl2"))&&void 0!==t?t:e.getContext("webgl");if(o){var a=o.getContextAttributes();!1===(null==a?void 0:a.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}n.drawImage(e,0,0)}return s}catch(t){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return s},e.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var i=t.getContext("2d");try{return i&&(i.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||i.getImageData(0,0,t.width,t.height)),t}catch(t){this.context.logger.info("Unable to clone video as it is tainted",e)}var s=e.ownerDocument.createElement("canvas");return s.width=e.offsetWidth,s.height=e.offsetHeight,s},e.prototype.appendChildNode=function(e,t,i){Q_(t)&&(function(e){return"SCRIPT"===e.tagName}(t)||t.hasAttribute(gy)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(t))||this.options.copyStyles&&Q_(t)&&Z_(t)||e.appendChild(this.cloneNode(t,i))},e.prototype.cloneChildNodes=function(e,t,i){for(var s=this,r=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;r;r=r.nextSibling)if(Q_(r)&&ey(r)&&"function"==typeof r.assignedNodes){var n=r.assignedNodes();n.length&&n.forEach((function(e){return s.appendChildNode(t,e,i)}))}else this.appendChildNode(t,r,i)},e.prototype.cloneNode=function(e,t){if(O_(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var i=e.ownerDocument.defaultView;if(i&&Q_(e)&&(N_(e)||V_(e))){var s=this.createElementClone(e);s.style.transitionProperty="none";var r=i.getComputedStyle(e),n=i.getComputedStyle(e,":before"),o=i.getComputedStyle(e,":after");this.referenceElement===e&&N_(s)&&(this.clonedReferenceElement=s),W_(s)&&Iy(s);var a=this.counters.parse(new Sm(this.context,r)),l=this.resolvePseudoContent(e,s,n,zm.BEFORE);ty(e)&&(t=!0),X_(e)||this.cloneChildNodes(e,s,t),l&&s.insertBefore(l,s.firstChild);var u=this.resolvePseudoContent(e,s,o,zm.AFTER);return u&&s.appendChild(u),this.counters.pop(a),(r&&(this.options.copyStyles||V_(e))&&!J_(e)||t)&&Py(r,s),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([s,e.scrollLeft,e.scrollTop]),(q_(e)||$_(e))&&(q_(s)||$_(s))&&(s.value=e.value),s}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,i,s){var r=this;if(i){var n=i.content,o=t.ownerDocument;if(o&&n&&"none"!==n&&"-moz-alt-content"!==n&&"none"!==i.display){this.counters.parse(new Sm(this.context,i));var a=new Im(this.context,i),l=o.createElement("html2canvaspseudoelement");Py(i,l),a.content.forEach((function(t){if(0===t.type)l.appendChild(o.createTextNode(t.value));else if(22===t.type){var i=o.createElement("img");i.src=t.value,i.style.opacity="1",l.appendChild(i)}else if(18===t.type){if("attr"===t.name){var s=t.values.filter(iv);s.length&&l.appendChild(o.createTextNode(e.getAttribute(s[0].value)||""))}else if("counter"===t.name){var n=t.values.filter(ov),u=n[0],A=n[1];if(u&&iv(u)){var c=r.counters.getCounterValue(u.value),h=A&&iv(A)?Ng.parse(r.context,A.value):3;l.appendChild(o.createTextNode(vy(c,h,!1)))}}else if("counters"===t.name){var d=t.values.filter(ov),p=(u=d[0],d[1]);A=d[2];if(u&&iv(u)){var f=r.counters.getCounterValues(u.value),v=A&&iv(A)?Ng.parse(r.context,A.value):3,g=p&&0===p.type?p.value:"",m=f.map((function(e){return vy(e,v,!1)})).join(g);l.appendChild(o.createTextNode(m))}}}else if(20===t.type)switch(t.value){case"open-quote":l.appendChild(o.createTextNode(Cm(a.quotes,r.quoteDepth++,!0)));break;case"close-quote":l.appendChild(o.createTextNode(Cm(a.quotes,--r.quoteDepth,!1)));break;default:l.appendChild(o.createTextNode(t.value))}})),l.className=Fy+" "+Ey;var u=s===zm.BEFORE?" "+Fy:" "+Ey;return V_(t)?t.className.baseValue+=u:t.className+=u,l}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(zm||(zm={}));var _y,yy=function(e,t){var i=e.createElement("iframe");return i.className="html2canvas-container",i.style.visibility="hidden",i.style.position="fixed",i.style.left="-10000px",i.style.top="0px",i.style.border="0",i.width=t.width.toString(),i.height=t.height.toString(),i.scrolling="no",i.setAttribute(gy,"true"),e.body.appendChild(i),i},by=function(e){return new Promise((function(t){e.complete?t():e.src?(e.onload=t,e.onerror=t):t()}))},By=function(e){return Promise.all([].slice.call(e.images,0).map(by))},xy=function(e){return new Promise((function(t,i){var s=e.contentWindow;if(!s)return i("No window assigned for iframe");var r=s.document;s.onload=e.onload=function(){s.onload=e.onload=null;var i=setInterval((function(){r.body.childNodes.length>0&&"complete"===r.readyState&&(clearInterval(i),t(e))}),50)}}))},wy=["all","d","content"],Py=function(e,t){for(var i=e.length-1;i>=0;i--){var s=e.item(i);-1===wy.indexOf(s)&&t.style.setProperty(s,e.getPropertyValue(s))}return t},Cy=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},My=function(e,t,i){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||i!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,i)},ky=function(e){var t=e[0],i=e[1],s=e[2];t.scrollLeft=i,t.scrollTop=s},Fy="___html2canvas___pseudoelement_before",Ey="___html2canvas___pseudoelement_after",Dy='{\n content: "" !important;\n display: none !important;\n}',Iy=function(e){Sy(e,"."+Fy+":before"+Dy+"\n ."+Ey+":after"+Dy)},Sy=function(e,t){var i=e.ownerDocument;if(i){var s=i.createElement("style");s.textContent=t,e.appendChild(s)}},Ty=function(){function e(){}return e.getOrigin=function(t){var i=e._link;return i?(i.href=t,i.href=i.href,i.protocol+i.hostname+i.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e}(),Ly=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)?t:Hy(e)||Qy(e)?((this._cache[e]=this.loadImage(e)).catch((function(){})),t):t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return dp(this,void 0,void 0,(function(){var t,i,s,r,n=this;return pp(this,(function(o){switch(o.label){case 0:return t=Ty.isSameOrigin(e),i=!Ny(e)&&!0===this._options.useCORS&&n_.SUPPORT_CORS_IMAGES&&!t,s=!Ny(e)&&!t&&!Hy(e)&&"string"==typeof this._options.proxy&&n_.SUPPORT_CORS_XHR&&!i,t||!1!==this._options.allowTaint||Ny(e)||Hy(e)||s||i?(r=e,s?[4,this.proxy(r)]:[3,2]):[2];case 1:r=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise((function(e,t){var s=new Image;s.onload=function(){return e(s)},s.onerror=t,(Vy(r)||i)&&(s.crossOrigin="anonymous"),s.src=r,!0===s.complete&&setTimeout((function(){return e(s)}),500),n._options.imageTimeout>0&&setTimeout((function(){return t("Timed out ("+n._options.imageTimeout+"ms) loading image")}),n._options.imageTimeout)}))];case 3:return[2,o.sent()]}}))}))},e.prototype.has=function(e){return void 0!==this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,i=this._options.proxy;if(!i)throw new Error("No proxy defined");var s=e.substring(0,256);return new Promise((function(r,n){var o=n_.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(200===a.status)if("text"===o)r(a.response);else{var e=new FileReader;e.addEventListener("load",(function(){return r(e.result)}),!1),e.addEventListener("error",(function(e){return n(e)}),!1),e.readAsDataURL(a.response)}else n("Failed to proxy resource "+s+" with status code "+a.status)},a.onerror=n;var l=i.indexOf("?")>-1?"&":"?";if(a.open("GET",""+i+l+"url="+encodeURIComponent(e)+"&responseType="+o),"text"!==o&&a instanceof XMLHttpRequest&&(a.responseType=o),t._options.imageTimeout){var u=t._options.imageTimeout;a.timeout=u,a.ontimeout=function(){return n("Timed out ("+u+"ms) proxying "+s)}}a.send()}))},e}(),Ry=/^data:image\/svg\+xml/i,Uy=/^data:image\/.*;base64,/i,Oy=/^data:image\/.*/i,Qy=function(e){return n_.SUPPORT_SVG_DRAWING||!jy(e)},Ny=function(e){return Oy.test(e)},Vy=function(e){return Uy.test(e)},Hy=function(e){return"blob"===e.substr(0,4)},jy=function(e){return"svg"===e.substr(-3).toLowerCase()||Ry.test(e)},Gy=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,i){return new e(this.x+t,this.y+i)},e}(),zy=function(e,t,i){return new Gy(e.x+(t.x-e.x)*i,e.y+(t.y-e.y)*i)},Wy=function(){function e(e,t,i,s){this.type=1,this.start=e,this.startControl=t,this.endControl=i,this.end=s}return e.prototype.subdivide=function(t,i){var s=zy(this.start,this.startControl,t),r=zy(this.startControl,this.endControl,t),n=zy(this.endControl,this.end,t),o=zy(s,r,t),a=zy(r,n,t),l=zy(o,a,t);return i?new e(this.start,s,o,l):new e(l,a,n,this.end)},e.prototype.add=function(t,i){return new e(this.start.add(t,i),this.startControl.add(t,i),this.endControl.add(t,i),this.end.add(t,i))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Ky=function(e){return 1===e.type},Xy=function(e){var t=e.styles,i=e.bounds,s=fv(t.borderTopLeftRadius,i.width,i.height),r=s[0],n=s[1],o=fv(t.borderTopRightRadius,i.width,i.height),a=o[0],l=o[1],u=fv(t.borderBottomRightRadius,i.width,i.height),A=u[0],c=u[1],h=fv(t.borderBottomLeftRadius,i.width,i.height),d=h[0],p=h[1],f=[];f.push((r+a)/i.width),f.push((d+A)/i.width),f.push((n+p)/i.height),f.push((l+c)/i.height);var v=Math.max.apply(Math,f);v>1&&(r/=v,n/=v,a/=v,l/=v,A/=v,c/=v,d/=v,p/=v);var g=i.width-a,m=i.height-c,_=i.width-A,y=i.height-p,b=t.borderTopWidth,B=t.borderRightWidth,x=t.borderBottomWidth,w=t.borderLeftWidth,P=vv(t.paddingTop,e.bounds.width),C=vv(t.paddingRight,e.bounds.width),M=vv(t.paddingBottom,e.bounds.width),k=vv(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=r>0||n>0?Yy(i.left+w/3,i.top+b/3,r-w/3,n-b/3,_y.TOP_LEFT):new Gy(i.left+w/3,i.top+b/3),this.topRightBorderDoubleOuterBox=r>0||n>0?Yy(i.left+g,i.top+b/3,a-B/3,l-b/3,_y.TOP_RIGHT):new Gy(i.left+i.width-B/3,i.top+b/3),this.bottomRightBorderDoubleOuterBox=A>0||c>0?Yy(i.left+_,i.top+m,A-B/3,c-x/3,_y.BOTTOM_RIGHT):new Gy(i.left+i.width-B/3,i.top+i.height-x/3),this.bottomLeftBorderDoubleOuterBox=d>0||p>0?Yy(i.left+w/3,i.top+y,d-w/3,p-x/3,_y.BOTTOM_LEFT):new Gy(i.left+w/3,i.top+i.height-x/3),this.topLeftBorderDoubleInnerBox=r>0||n>0?Yy(i.left+2*w/3,i.top+2*b/3,r-2*w/3,n-2*b/3,_y.TOP_LEFT):new Gy(i.left+2*w/3,i.top+2*b/3),this.topRightBorderDoubleInnerBox=r>0||n>0?Yy(i.left+g,i.top+2*b/3,a-2*B/3,l-2*b/3,_y.TOP_RIGHT):new Gy(i.left+i.width-2*B/3,i.top+2*b/3),this.bottomRightBorderDoubleInnerBox=A>0||c>0?Yy(i.left+_,i.top+m,A-2*B/3,c-2*x/3,_y.BOTTOM_RIGHT):new Gy(i.left+i.width-2*B/3,i.top+i.height-2*x/3),this.bottomLeftBorderDoubleInnerBox=d>0||p>0?Yy(i.left+2*w/3,i.top+y,d-2*w/3,p-2*x/3,_y.BOTTOM_LEFT):new Gy(i.left+2*w/3,i.top+i.height-2*x/3),this.topLeftBorderStroke=r>0||n>0?Yy(i.left+w/2,i.top+b/2,r-w/2,n-b/2,_y.TOP_LEFT):new Gy(i.left+w/2,i.top+b/2),this.topRightBorderStroke=r>0||n>0?Yy(i.left+g,i.top+b/2,a-B/2,l-b/2,_y.TOP_RIGHT):new Gy(i.left+i.width-B/2,i.top+b/2),this.bottomRightBorderStroke=A>0||c>0?Yy(i.left+_,i.top+m,A-B/2,c-x/2,_y.BOTTOM_RIGHT):new Gy(i.left+i.width-B/2,i.top+i.height-x/2),this.bottomLeftBorderStroke=d>0||p>0?Yy(i.left+w/2,i.top+y,d-w/2,p-x/2,_y.BOTTOM_LEFT):new Gy(i.left+w/2,i.top+i.height-x/2),this.topLeftBorderBox=r>0||n>0?Yy(i.left,i.top,r,n,_y.TOP_LEFT):new Gy(i.left,i.top),this.topRightBorderBox=a>0||l>0?Yy(i.left+g,i.top,a,l,_y.TOP_RIGHT):new Gy(i.left+i.width,i.top),this.bottomRightBorderBox=A>0||c>0?Yy(i.left+_,i.top+m,A,c,_y.BOTTOM_RIGHT):new Gy(i.left+i.width,i.top+i.height),this.bottomLeftBorderBox=d>0||p>0?Yy(i.left,i.top+y,d,p,_y.BOTTOM_LEFT):new Gy(i.left,i.top+i.height),this.topLeftPaddingBox=r>0||n>0?Yy(i.left+w,i.top+b,Math.max(0,r-w),Math.max(0,n-b),_y.TOP_LEFT):new Gy(i.left+w,i.top+b),this.topRightPaddingBox=a>0||l>0?Yy(i.left+Math.min(g,i.width-B),i.top+b,g>i.width+B?0:Math.max(0,a-B),Math.max(0,l-b),_y.TOP_RIGHT):new Gy(i.left+i.width-B,i.top+b),this.bottomRightPaddingBox=A>0||c>0?Yy(i.left+Math.min(_,i.width-w),i.top+Math.min(m,i.height-x),Math.max(0,A-B),Math.max(0,c-x),_y.BOTTOM_RIGHT):new Gy(i.left+i.width-B,i.top+i.height-x),this.bottomLeftPaddingBox=d>0||p>0?Yy(i.left+w,i.top+Math.min(y,i.height-x),Math.max(0,d-w),Math.max(0,p-x),_y.BOTTOM_LEFT):new Gy(i.left+w,i.top+i.height-x),this.topLeftContentBox=r>0||n>0?Yy(i.left+w+k,i.top+b+P,Math.max(0,r-(w+k)),Math.max(0,n-(b+P)),_y.TOP_LEFT):new Gy(i.left+w+k,i.top+b+P),this.topRightContentBox=a>0||l>0?Yy(i.left+Math.min(g,i.width+w+k),i.top+b+P,g>i.width+w+k?0:a-w+k,l-(b+P),_y.TOP_RIGHT):new Gy(i.left+i.width-(B+C),i.top+b+P),this.bottomRightContentBox=A>0||c>0?Yy(i.left+Math.min(_,i.width-(w+k)),i.top+Math.min(m,i.height+b+P),Math.max(0,A-(B+C)),c-(x+M),_y.BOTTOM_RIGHT):new Gy(i.left+i.width-(B+C),i.top+i.height-(x+M)),this.bottomLeftContentBox=d>0||p>0?Yy(i.left+w+k,i.top+y,Math.max(0,d-(w+k)),p-(x+M),_y.BOTTOM_LEFT):new Gy(i.left+w+k,i.top+i.height-(x+M))};!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(_y||(_y={}));var Yy=function(e,t,i,s,r){var n=(Math.sqrt(2)-1)/3*4,o=i*n,a=s*n,l=e+i,u=t+s;switch(r){case _y.TOP_LEFT:return new Wy(new Gy(e,u),new Gy(e,u-a),new Gy(l-o,t),new Gy(l,t));case _y.TOP_RIGHT:return new Wy(new Gy(e,t),new Gy(e+o,t),new Gy(l,u-a),new Gy(l,u));case _y.BOTTOM_RIGHT:return new Wy(new Gy(l,t),new Gy(l,t+a),new Gy(e+o,u),new Gy(e,u));case _y.BOTTOM_LEFT:default:return new Wy(new Gy(l,u),new Gy(l-o,u),new Gy(e,t+a),new Gy(e,t))}},Jy=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Zy=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},qy=function(e,t,i){this.offsetX=e,this.offsetY=t,this.matrix=i,this.type=0,this.target=6},$y=function(e,t){this.path=e,this.target=t,this.type=1},eb=function(e){this.opacity=e,this.type=2,this.target=6},tb=function(e){return 1===e.type},ib=function(e,t){return e.length===t.length&&e.some((function(e,i){return e===t[i]}))},sb=function(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},rb=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Xy(this.container),this.container.styles.opacity<1&&this.effects.push(new eb(this.container.styles.opacity)),null!==this.container.styles.transform){var i=this.container.bounds.left+this.container.styles.transformOrigin[0].number,s=this.container.bounds.top+this.container.styles.transformOrigin[1].number,r=this.container.styles.transform;this.effects.push(new qy(i,s,r))}if(0!==this.container.styles.overflowX){var n=Jy(this.curves),o=Zy(this.curves);ib(n,o)?this.effects.push(new $y(n,6)):(this.effects.push(new $y(n,2)),this.effects.push(new $y(o,4)))}}return e.prototype.getEffects=function(e){for(var t=-1===[2,3].indexOf(this.container.styles.position),i=this.parent,s=this.effects.slice(0);i;){var r=i.effects.filter((function(e){return!tb(e)}));if(t||0!==i.container.styles.position||!i.parent){if(s.unshift.apply(s,r),t=-1===[2,3].indexOf(i.container.styles.position),0!==i.container.styles.overflowX){var n=Jy(i.curves),o=Zy(i.curves);ib(n,o)||s.unshift(new $y(o,6))}}else s.unshift.apply(s,r);i=i.parent}return s.filter((function(t){return ym(t.target,e)}))},e}(),nb=function(e,t,i,s){e.container.elements.forEach((function(r){var n=ym(r.flags,4),o=ym(r.flags,2),a=new rb(r,e);ym(r.styles.display,2048)&&s.push(a);var l=ym(r.flags,8)?[]:s;if(n||o){var u=n||r.styles.isPositioned()?i:t,A=new sb(a);if(r.styles.isPositioned()||r.styles.opacity<1||r.styles.isTransformed()){var c=r.styles.zIndex.order;if(c<0){var h=0;u.negativeZIndex.some((function(e,t){return c>e.element.container.styles.zIndex.order?(h=t,!1):h>0})),u.negativeZIndex.splice(h,0,A)}else if(c>0){var d=0;u.positiveZIndex.some((function(e,t){return c>=e.element.container.styles.zIndex.order?(d=t+1,!1):d>0})),u.positiveZIndex.splice(d,0,A)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(A)}else r.styles.isFloating()?u.nonPositionedFloats.push(A):u.nonPositionedInlineLevel.push(A);nb(a,A,n?A:i,l)}else r.styles.isInlineLevel()?t.inlineLevel.push(a):t.nonInlineLevel.push(a),nb(a,t,i,l);ym(r.flags,8)&&ob(r,l)}))},ob=function(e,t){for(var i=e instanceof b_?e.start:1,s=e instanceof b_&&e.reversed,r=0;r<t.length;r++){var n=t[r];n.container instanceof y_&&"number"==typeof n.container.value&&0!==n.container.value&&(i=n.container.value),n.listValue=vy(i,n.container.styles.listStyleType,!0),i+=s?-1:1}},ab=function(e,t){switch(t){case 0:return ub(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return ub(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return ub(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return ub(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},lb=function(e,t){var i=[];return Ky(e)?i.push(e.subdivide(.5,!1)):i.push(e),Ky(t)?i.push(t.subdivide(.5,!0)):i.push(t),i},ub=function(e,t,i,s){var r=[];return Ky(e)?r.push(e.subdivide(.5,!1)):r.push(e),Ky(i)?r.push(i.subdivide(.5,!0)):r.push(i),Ky(s)?r.push(s.subdivide(.5,!0).reverse()):r.push(s),Ky(t)?r.push(t.subdivide(.5,!1).reverse()):r.push(t),r},Ab=function(e){var t=e.bounds,i=e.styles;return t.add(i.borderLeftWidth,i.borderTopWidth,-(i.borderRightWidth+i.borderLeftWidth),-(i.borderTopWidth+i.borderBottomWidth))},cb=function(e){var t=e.styles,i=e.bounds,s=vv(t.paddingLeft,i.width),r=vv(t.paddingRight,i.width),n=vv(t.paddingTop,i.width),o=vv(t.paddingBottom,i.width);return i.add(s+t.borderLeftWidth,n+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+s+r),-(t.borderTopWidth+t.borderBottomWidth+n+o))},hb=function(e,t,i){var s=function(e,t){return 0===e?t.bounds:2===e?cb(t):Ab(t)}(vb(e.styles.backgroundOrigin,t),e),r=function(e,t){return 0===e?t.bounds:2===e?cb(t):Ab(t)}(vb(e.styles.backgroundClip,t),e),n=fb(vb(e.styles.backgroundSize,t),i,s),o=n[0],a=n[1],l=fv(vb(e.styles.backgroundPosition,t),s.width-o,s.height-a);return[gb(vb(e.styles.backgroundRepeat,t),l,n,s,r),Math.round(s.left+l[0]),Math.round(s.top+l[1]),o,a]},db=function(e){return iv(e)&&e.value===qv.AUTO},pb=function(e){return"number"==typeof e},fb=function(e,t,i){var s=t[0],r=t[1],n=t[2],o=e[0],a=e[1];if(!o)return[0,0];if(Av(o)&&a&&Av(a))return[vv(o,i.width),vv(a,i.height)];var l=pb(n);if(iv(o)&&(o.value===qv.CONTAIN||o.value===qv.COVER))return pb(n)?i.width/i.height<n!=(o.value===qv.COVER)?[i.width,i.width/n]:[i.height*n,i.height]:[i.width,i.height];var u=pb(s),A=pb(r),c=u||A;if(db(o)&&(!a||db(a)))return u&&A?[s,r]:l||c?c&&l?[u?s:r*n,A?r:s/n]:[u?s:i.width,A?r:i.height]:[i.width,i.height];if(l){var h=0,d=0;return Av(o)?h=vv(o,i.width):Av(a)&&(d=vv(a,i.height)),db(o)?h=d*n:a&&!db(a)||(d=h/n),[h,d]}var p=null,f=null;if(Av(o)?p=vv(o,i.width):a&&Av(a)&&(f=vv(a,i.height)),null===p||a&&!db(a)||(f=u&&A?p/s*r:i.height),null!==f&&db(o)&&(p=u&&A?f/r*s:i.width),null!==p&&null!==f)return[p,f];throw new Error("Unable to calculate background-size for element")},vb=function(e,t){var i=e[t];return void 0===i?e[0]:i},gb=function(e,t,i,s,r){var n=t[0],o=t[1],a=i[0],l=i[1];switch(e){case 2:return[new Gy(Math.round(s.left),Math.round(s.top+o)),new Gy(Math.round(s.left+s.width),Math.round(s.top+o)),new Gy(Math.round(s.left+s.width),Math.round(l+s.top+o)),new Gy(Math.round(s.left),Math.round(l+s.top+o))];case 3:return[new Gy(Math.round(s.left+n),Math.round(s.top)),new Gy(Math.round(s.left+n+a),Math.round(s.top)),new Gy(Math.round(s.left+n+a),Math.round(s.height+s.top)),new Gy(Math.round(s.left+n),Math.round(s.height+s.top))];case 1:return[new Gy(Math.round(s.left+n),Math.round(s.top+o)),new Gy(Math.round(s.left+n+a),Math.round(s.top+o)),new Gy(Math.round(s.left+n+a),Math.round(s.top+o+l)),new Gy(Math.round(s.left+n),Math.round(s.top+o+l))];default:return[new Gy(Math.round(r.left),Math.round(r.top)),new Gy(Math.round(r.left+r.width),Math.round(r.top)),new Gy(Math.round(r.left+r.width),Math.round(r.height+r.top)),new Gy(Math.round(r.left),Math.round(r.height+r.top))]}},mb="Hidden Text",_b=function(){function e(e){this._data={},this._document=e}return e.prototype.parseMetrics=function(e,t){var i=this._document.createElement("div"),s=this._document.createElement("img"),r=this._document.createElement("span"),n=this._document.body;i.style.visibility="hidden",i.style.fontFamily=e,i.style.fontSize=t,i.style.margin="0",i.style.padding="0",i.style.whiteSpace="nowrap",n.appendChild(i),s.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",s.width=1,s.height=1,s.style.margin="0",s.style.padding="0",s.style.verticalAlign="baseline",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.appendChild(this._document.createTextNode(mb)),i.appendChild(r),i.appendChild(s);var o=s.offsetTop-r.offsetTop+2;i.removeChild(r),i.appendChild(this._document.createTextNode(mb)),i.style.lineHeight="normal",s.style.verticalAlign="super";var a=s.offsetTop-i.offsetTop+2;return n.removeChild(i),{baseline:o,middle:a}},e.prototype.getMetrics=function(e,t){var i=e+" "+t;return void 0===this._data[i]&&(this._data[i]=this.parseMetrics(e,t)),this._data[i]},e}(),yb=function(e,t){this.context=e,this.options=t},bb=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s._activeEffects=[],s.canvas=i.canvas?i.canvas:document.createElement("canvas"),s.ctx=s.canvas.getContext("2d"),i.canvas||(s.canvas.width=Math.floor(i.width*i.scale),s.canvas.height=Math.floor(i.height*i.scale),s.canvas.style.width=i.width+"px",s.canvas.style.height=i.height+"px"),s.fontMetrics=new _b(document),s.ctx.scale(s.options.scale,s.options.scale),s.ctx.translate(-i.x,-i.y),s.ctx.textBaseline="bottom",s._activeEffects=[],s.context.logger.debug("Canvas renderer initialized ("+i.width+"x"+i.height+") with scale "+i.scale),s}return cp(t,e),t.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach((function(e){return t.applyEffect(e)}))},t.prototype.applyEffect=function(e){this.ctx.save(),function(e){return 2===e.type}(e)&&(this.ctx.globalAlpha=e.opacity),function(e){return 0===e.type}(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),tb(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},t.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},t.prototype.renderStack=function(e){return dp(this,void 0,void 0,(function(){return pp(this,(function(t){switch(t.label){case 0:return e.element.container.styles.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.renderNode=function(e){return dp(this,void 0,void 0,(function(){return pp(this,(function(t){switch(t.label){case 0:return ym(e.container.flags,16),e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},t.prototype.renderTextWithLetterSpacing=function(e,t,i){var s=this;0===t?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+i):u_(e.text).reduce((function(t,r){return s.ctx.fillText(r,t,e.bounds.top+i),t+s.ctx.measureText(r).width}),e.bounds.left)},t.prototype.createFontStyle=function(e){var t=e.fontVariant.filter((function(e){return"normal"===e||"small-caps"===e})).join(""),i=Cb(e.fontFamily).join(", "),s=ev(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,s,i].join(" "),i,s]},t.prototype.renderTextNode=function(e,t){return dp(this,void 0,void 0,(function(){var i,s,r,n,o,a,l,u,A=this;return pp(this,(function(c){return i=this.createFontStyle(t),s=i[0],r=i[1],n=i[2],this.ctx.font=s,this.ctx.direction=1===t.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",o=this.fontMetrics.getMetrics(r,n),a=o.baseline,l=o.middle,u=t.paintOrder,e.textBounds.forEach((function(e){u.forEach((function(i){switch(i){case 0:A.ctx.fillStyle=Pv(t.color),A.renderTextWithLetterSpacing(e,t.letterSpacing,a);var s=t.textShadow;s.length&&e.text.trim().length&&(s.slice(0).reverse().forEach((function(i){A.ctx.shadowColor=Pv(i.color),A.ctx.shadowOffsetX=i.offsetX.number*A.options.scale,A.ctx.shadowOffsetY=i.offsetY.number*A.options.scale,A.ctx.shadowBlur=i.blur.number,A.renderTextWithLetterSpacing(e,t.letterSpacing,a)})),A.ctx.shadowColor="",A.ctx.shadowOffsetX=0,A.ctx.shadowOffsetY=0,A.ctx.shadowBlur=0),t.textDecorationLine.length&&(A.ctx.fillStyle=Pv(t.textDecorationColor||t.color),t.textDecorationLine.forEach((function(t){switch(t){case 1:A.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top+a),e.bounds.width,1);break;case 2:A.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1);break;case 3:A.ctx.fillRect(e.bounds.left,Math.ceil(e.bounds.top+l),e.bounds.width,1)}})));break;case 1:t.webkitTextStrokeWidth&&e.text.trim().length&&(A.ctx.strokeStyle=Pv(t.webkitTextStrokeColor),A.ctx.lineWidth=t.webkitTextStrokeWidth,A.ctx.lineJoin=window.chrome?"miter":"round",A.ctx.strokeText(e.text,e.bounds.left,e.bounds.top+a)),A.ctx.strokeStyle="",A.ctx.lineWidth=0,A.ctx.lineJoin="miter"}}))})),[2]}))}))},t.prototype.renderReplacedElement=function(e,t,i){if(i&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var s=cb(e),r=Zy(t);this.path(r),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(i,0,0,e.intrinsicWidth,e.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(e){return dp(this,void 0,void 0,(function(){var i,s,r,n,o,a,l,u,A,c,h,d,p,f,v,g,m,_;return pp(this,(function(y){switch(y.label){case 0:this.applyEffects(e.getEffects(4)),i=e.container,s=e.curves,r=i.styles,n=0,o=i.textNodes,y.label=1;case 1:return n<o.length?(a=o[n],[4,this.renderTextNode(a,r)]):[3,4];case 2:y.sent(),y.label=3;case 3:return n++,[3,1];case 4:if(!(i instanceof g_))return[3,8];y.label=5;case 5:return y.trys.push([5,7,,8]),[4,this.context.cache.match(i.src)];case 6:return v=y.sent(),this.renderReplacedElement(i,s,v),[3,8];case 7:return y.sent(),this.context.logger.error("Error loading image "+i.src),[3,8];case 8:if(i instanceof m_&&this.renderReplacedElement(i,s,i.canvas),!(i instanceof __))return[3,12];y.label=9;case 9:return y.trys.push([9,11,,12]),[4,this.context.cache.match(i.svg)];case 10:return v=y.sent(),this.renderReplacedElement(i,s,v),[3,12];case 11:return y.sent(),this.context.logger.error("Error loading svg "+i.svg.substring(0,255)),[3,12];case 12:return i instanceof D_&&i.tree?[4,new t(this.context,{scale:this.options.scale,backgroundColor:i.backgroundColor,x:0,y:0,width:i.width,height:i.height}).render(i.tree)]:[3,14];case 13:l=y.sent(),i.width&&i.height&&this.ctx.drawImage(l,0,0,i.width,i.height,i.bounds.left,i.bounds.top,i.bounds.width,i.bounds.height),y.label=14;case 14:if(i instanceof k_&&(u=Math.min(i.bounds.width,i.bounds.height),i.type===w_?i.checked&&(this.ctx.save(),this.path([new Gy(i.bounds.left+.39363*u,i.bounds.top+.79*u),new Gy(i.bounds.left+.16*u,i.bounds.top+.5549*u),new Gy(i.bounds.left+.27347*u,i.bounds.top+.44071*u),new Gy(i.bounds.left+.39694*u,i.bounds.top+.5649*u),new Gy(i.bounds.left+.72983*u,i.bounds.top+.23*u),new Gy(i.bounds.left+.84*u,i.bounds.top+.34085*u),new Gy(i.bounds.left+.39363*u,i.bounds.top+.79*u)]),this.ctx.fillStyle=Pv(M_),this.ctx.fill(),this.ctx.restore()):i.type===P_&&i.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(i.bounds.left+u/2,i.bounds.top+u/2,u/4,0,2*Math.PI,!0),this.ctx.fillStyle=Pv(M_),this.ctx.fill(),this.ctx.restore())),Bb(i)&&i.value.length){switch(A=this.createFontStyle(r),m=A[0],c=A[1],h=this.fontMetrics.getMetrics(m,c).baseline,this.ctx.font=m,this.ctx.fillStyle=Pv(r.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=wb(i.styles.textAlign),_=cb(i),d=0,i.styles.textAlign){case 1:d+=_.width/2;break;case 2:d+=_.width}p=_.add(d,0,0,-_.height/2+1),this.ctx.save(),this.path([new Gy(_.left,_.top),new Gy(_.left+_.width,_.top),new Gy(_.left+_.width,_.top+_.height),new Gy(_.left,_.top+_.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new o_(i.value,p),r.letterSpacing,h),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ym(i.styles.display,2048))return[3,20];if(null===i.styles.listStyleImage)return[3,19];if(0!==(f=i.styles.listStyleImage).type)return[3,18];v=void 0,g=f.url,y.label=15;case 15:return y.trys.push([15,17,,18]),[4,this.context.cache.match(g)];case 16:return v=y.sent(),this.ctx.drawImage(v,i.bounds.left-(v.width+10),i.bounds.top),[3,18];case 17:return y.sent(),this.context.logger.error("Error loading list-style-image "+g),[3,18];case 18:return[3,20];case 19:e.listValue&&-1!==i.styles.listStyleType&&(m=this.createFontStyle(r)[0],this.ctx.font=m,this.ctx.fillStyle=Pv(r.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",_=new vp(i.bounds.left,i.bounds.top+vv(i.styles.paddingTop,i.bounds.width),i.bounds.width,Ug(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new o_(e.listValue,_),r.letterSpacing,Ug(r.lineHeight,r.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),y.label=20;case 20:return[2]}}))}))},t.prototype.renderStackContent=function(e){return dp(this,void 0,void 0,(function(){var t,i,s,r,n,o,a,l,u,A,c,h,d,p,f;return pp(this,(function(v){switch(v.label){case 0:return ym(e.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:v.sent(),t=0,i=e.negativeZIndex,v.label=2;case 2:return t<i.length?(f=i[t],[4,this.renderStack(f)]):[3,5];case 3:v.sent(),v.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:v.sent(),s=0,r=e.nonInlineLevel,v.label=7;case 7:return s<r.length?(f=r[s],[4,this.renderNode(f)]):[3,10];case 8:v.sent(),v.label=9;case 9:return s++,[3,7];case 10:n=0,o=e.nonPositionedFloats,v.label=11;case 11:return n<o.length?(f=o[n],[4,this.renderStack(f)]):[3,14];case 12:v.sent(),v.label=13;case 13:return n++,[3,11];case 14:a=0,l=e.nonPositionedInlineLevel,v.label=15;case 15:return a<l.length?(f=l[a],[4,this.renderStack(f)]):[3,18];case 16:v.sent(),v.label=17;case 17:return a++,[3,15];case 18:u=0,A=e.inlineLevel,v.label=19;case 19:return u<A.length?(f=A[u],[4,this.renderNode(f)]):[3,22];case 20:v.sent(),v.label=21;case 21:return u++,[3,19];case 22:c=0,h=e.zeroOrAutoZIndexOrTransformedOrOpacity,v.label=23;case 23:return c<h.length?(f=h[c],[4,this.renderStack(f)]):[3,26];case 24:v.sent(),v.label=25;case 25:return c++,[3,23];case 26:d=0,p=e.positiveZIndex,v.label=27;case 27:return d<p.length?(f=p[d],[4,this.renderStack(f)]):[3,30];case 28:v.sent(),v.label=29;case 29:return d++,[3,27];case 30:return[2]}}))}))},t.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},t.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},t.prototype.formatPath=function(e){var t=this;e.forEach((function(e,i){var s=Ky(e)?e.start:e;0===i?t.ctx.moveTo(s.x,s.y):t.ctx.lineTo(s.x,s.y),Ky(e)&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)}))},t.prototype.renderRepeat=function(e,t,i,s){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(i,s),this.ctx.fill(),this.ctx.translate(-i,-s)},t.prototype.resizeImage=function(e,t,i){var s;if(e.width===t&&e.height===i)return e;var r=(null!==(s=this.canvas.ownerDocument)&&void 0!==s?s:document).createElement("canvas");return r.width=Math.max(1,t),r.height=Math.max(1,i),r.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t,i),r},t.prototype.renderBackgroundImage=function(e){return dp(this,void 0,void 0,(function(){var t,i,s,r,n,o;return pp(this,(function(a){switch(a.label){case 0:t=e.styles.backgroundImage.length-1,i=function(i){var r,n,o,a,l,u,A,c,h,d,p,f,v,g,m,_,y,b,B,x,w,P,C,M,k,F,E,D,I,S,T;return pp(this,(function(L){switch(L.label){case 0:if(0!==i.type)return[3,5];r=void 0,n=i.url,L.label=1;case 1:return L.trys.push([1,3,,4]),[4,s.context.cache.match(n)];case 2:return r=L.sent(),[3,4];case 3:return L.sent(),s.context.logger.error("Error loading background-image "+n),[3,4];case 4:return r&&(o=hb(e,t,[r.width,r.height,r.width/r.height]),_=o[0],P=o[1],C=o[2],B=o[3],x=o[4],g=s.ctx.createPattern(s.resizeImage(r,B,x),"repeat"),s.renderRepeat(_,g,P,C)),[3,6];case 5:1===i.type?(a=hb(e,t,[null,null,null]),_=a[0],P=a[1],C=a[2],B=a[3],x=a[4],l=Ov(i.angle,B,x),u=l[0],A=l[1],c=l[2],h=l[3],d=l[4],(p=document.createElement("canvas")).width=B,p.height=x,f=p.getContext("2d"),v=f.createLinearGradient(A,h,c,d),Uv(i.stops,u).forEach((function(e){return v.addColorStop(e.stop,Pv(e.color))})),f.fillStyle=v,f.fillRect(0,0,B,x),B>0&&x>0&&(g=s.ctx.createPattern(p,"repeat"),s.renderRepeat(_,g,P,C))):function(e){return 2===e.type}(i)&&(m=hb(e,t,[null,null,null]),_=m[0],y=m[1],b=m[2],B=m[3],x=m[4],w=0===i.position.length?[dv]:i.position,P=vv(w[0],B),C=vv(w[w.length-1],x),M=function(e,t,i,s,r){var n=0,o=0;switch(e.size){case 0:0===e.shape?n=o=Math.min(Math.abs(t),Math.abs(t-s),Math.abs(i),Math.abs(i-r)):1===e.shape&&(n=Math.min(Math.abs(t),Math.abs(t-s)),o=Math.min(Math.abs(i),Math.abs(i-r)));break;case 2:if(0===e.shape)n=o=Math.min(Qv(t,i),Qv(t,i-r),Qv(t-s,i),Qv(t-s,i-r));else if(1===e.shape){var a=Math.min(Math.abs(i),Math.abs(i-r))/Math.min(Math.abs(t),Math.abs(t-s)),l=Nv(s,r,t,i,!0),u=l[0],A=l[1];o=a*(n=Qv(u-t,(A-i)/a))}break;case 1:0===e.shape?n=o=Math.max(Math.abs(t),Math.abs(t-s),Math.abs(i),Math.abs(i-r)):1===e.shape&&(n=Math.max(Math.abs(t),Math.abs(t-s)),o=Math.max(Math.abs(i),Math.abs(i-r)));break;case 3:if(0===e.shape)n=o=Math.max(Qv(t,i),Qv(t,i-r),Qv(t-s,i),Qv(t-s,i-r));else if(1===e.shape){a=Math.max(Math.abs(i),Math.abs(i-r))/Math.max(Math.abs(t),Math.abs(t-s));var c=Nv(s,r,t,i,!1);u=c[0],A=c[1],o=a*(n=Qv(u-t,(A-i)/a))}}return Array.isArray(e.size)&&(n=vv(e.size[0],s),o=2===e.size.length?vv(e.size[1],r):n),[n,o]}(i,P,C,B,x),k=M[0],F=M[1],k>0&&F>0&&(E=s.ctx.createRadialGradient(y+P,b+C,0,y+P,b+C,k),Uv(i.stops,2*k).forEach((function(e){return E.addColorStop(e.stop,Pv(e.color))})),s.path(_),s.ctx.fillStyle=E,k!==F?(D=e.bounds.left+.5*e.bounds.width,I=e.bounds.top+.5*e.bounds.height,T=1/(S=F/k),s.ctx.save(),s.ctx.translate(D,I),s.ctx.transform(1,0,0,S,0,0),s.ctx.translate(-D,-I),s.ctx.fillRect(y,T*(b-I)+I,B,x*T),s.ctx.restore()):s.ctx.fill())),L.label=6;case 6:return t--,[2]}}))},s=this,r=0,n=e.styles.backgroundImage.slice(0).reverse(),a.label=1;case 1:return r<n.length?(o=n[r],[5,i(o)]):[3,4];case 2:a.sent(),a.label=3;case 3:return r++,[3,1];case 4:return[2]}}))}))},t.prototype.renderSolidBorder=function(e,t,i){return dp(this,void 0,void 0,(function(){return pp(this,(function(s){return this.path(ab(i,t)),this.ctx.fillStyle=Pv(e),this.ctx.fill(),[2]}))}))},t.prototype.renderDoubleBorder=function(e,t,i,s){return dp(this,void 0,void 0,(function(){var r,n;return pp(this,(function(o){switch(o.label){case 0:return t<3?[4,this.renderSolidBorder(e,i,s)]:[3,2];case 1:return o.sent(),[2];case 2:return r=function(e,t){switch(t){case 0:return ub(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return ub(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return ub(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return ub(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}}(s,i),this.path(r),this.ctx.fillStyle=Pv(e),this.ctx.fill(),n=function(e,t){switch(t){case 0:return ub(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return ub(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return ub(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return ub(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}}(s,i),this.path(n),this.ctx.fill(),[2]}}))}))},t.prototype.renderNodeBackgroundAndBorders=function(e){return dp(this,void 0,void 0,(function(){var t,i,s,r,n,o,a,l,u=this;return pp(this,(function(A){switch(A.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,i=!wv(t.backgroundColor)||t.backgroundImage.length,s=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],r=xb(vb(t.backgroundClip,0),e.curves),i||t.boxShadow.length?(this.ctx.save(),this.path(r),this.ctx.clip(),wv(t.backgroundColor)||(this.ctx.fillStyle=Pv(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:A.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach((function(t){u.ctx.save();var i,s,r,n,o,a=Jy(e.curves),l=t.inset?0:1e4,A=(i=a,s=-l+(t.inset?1:-1)*t.spread.number,r=(t.inset?1:-1)*t.spread.number,n=t.spread.number*(t.inset?-2:2),o=t.spread.number*(t.inset?-2:2),i.map((function(e,t){switch(t){case 0:return e.add(s,r);case 1:return e.add(s+n,r);case 2:return e.add(s+n,r+o);case 3:return e.add(s,r+o)}return e})));t.inset?(u.path(a),u.ctx.clip(),u.mask(A)):(u.mask(a),u.ctx.clip(),u.path(A)),u.ctx.shadowOffsetX=t.offsetX.number+l,u.ctx.shadowOffsetY=t.offsetY.number,u.ctx.shadowColor=Pv(t.color),u.ctx.shadowBlur=t.blur.number,u.ctx.fillStyle=t.inset?Pv(t.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()})),A.label=2;case 2:n=0,o=0,a=s,A.label=3;case 3:return o<a.length?0!==(l=a[o]).style&&!wv(l.color)&&l.width>0?2!==l.style?[3,5]:[4,this.renderDashedDottedBorder(l.color,l.width,n,e.curves,2)]:[3,11]:[3,13];case 4:return A.sent(),[3,11];case 5:return 3!==l.style?[3,7]:[4,this.renderDashedDottedBorder(l.color,l.width,n,e.curves,3)];case 6:return A.sent(),[3,11];case 7:return 4!==l.style?[3,9]:[4,this.renderDoubleBorder(l.color,l.width,n,e.curves)];case 8:return A.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,n,e.curves)];case 10:A.sent(),A.label=11;case 11:n++,A.label=12;case 12:return o++,[3,3];case 13:return[2]}}))}))},t.prototype.renderDashedDottedBorder=function(e,t,i,s,r){return dp(this,void 0,void 0,(function(){var n,o,a,l,u,A,c,h,d,p,f,v,g,m,_,y;return pp(this,(function(b){return this.ctx.save(),n=function(e,t){switch(t){case 0:return lb(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return lb(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return lb(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return lb(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}}(s,i),o=ab(s,i),2===r&&(this.path(o),this.ctx.clip()),Ky(o[0])?(a=o[0].start.x,l=o[0].start.y):(a=o[0].x,l=o[0].y),Ky(o[1])?(u=o[1].end.x,A=o[1].end.y):(u=o[1].x,A=o[1].y),c=0===i||2===i?Math.abs(a-u):Math.abs(l-A),this.ctx.beginPath(),3===r?this.formatPath(n):this.formatPath(o.slice(0,2)),h=t<3?3*t:2*t,d=t<3?2*t:t,3===r&&(h=t,d=t),p=!0,c<=2*h?p=!1:c<=2*h+d?(h*=f=c/(2*h+d),d*=f):(v=Math.floor((c+d)/(h+d)),g=(c-v*h)/(v-1),d=(m=(c-(v+1)*h)/v)<=0||Math.abs(d-g)<Math.abs(d-m)?g:m),p&&(3===r?this.ctx.setLineDash([0,h+d]):this.ctx.setLineDash([h,d])),3===r?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=2*t+1.1,this.ctx.strokeStyle=Pv(e),this.ctx.stroke(),this.ctx.setLineDash([]),2===r&&(Ky(o[0])&&(_=o[3],y=o[0],this.ctx.beginPath(),this.formatPath([new Gy(_.end.x,_.end.y),new Gy(y.start.x,y.start.y)]),this.ctx.stroke()),Ky(o[1])&&(_=o[1],y=o[2],this.ctx.beginPath(),this.formatPath([new Gy(_.end.x,_.end.y),new Gy(y.start.x,y.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]}))}))},t.prototype.render=function(e){return dp(this,void 0,void 0,(function(){var t;return pp(this,(function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Pv(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),s=new rb(e,null),r=new sb(s),nb(s,r,r,n=[]),ob(s.container,n),t=r,[4,this.renderStack(t)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}var s,r,n}))}))},t}(yb),Bb=function(e){return e instanceof E_||(e instanceof F_||e instanceof k_&&e.type!==P_&&e.type!==w_)},xb=function(e,t){switch(e){case 0:return Jy(t);case 2:return function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]}(t);default:return Zy(t)}},wb=function(e){switch(e){case 1:return"center";case 2:return"right";default:return"left"}},Pb=["-apple-system","system-ui"],Cb=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter((function(e){return-1===Pb.indexOf(e)})):e},Mb=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.canvas=i.canvas?i.canvas:document.createElement("canvas"),s.ctx=s.canvas.getContext("2d"),s.options=i,s.canvas.width=Math.floor(i.width*i.scale),s.canvas.height=Math.floor(i.height*i.scale),s.canvas.style.width=i.width+"px",s.canvas.style.height=i.height+"px",s.ctx.scale(s.options.scale,s.options.scale),s.ctx.translate(-i.x,-i.y),s.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+i.width+"x"+i.height+" at "+i.x+","+i.y+") with scale "+i.scale),s}return cp(t,e),t.prototype.render=function(e){return dp(this,void 0,void 0,(function(){var t,i;return pp(this,(function(s){switch(s.label){case 0:return t=s_(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,kb(t)];case 1:return i=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Pv(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}}))}))},t}(yb),kb=function(e){return new Promise((function(t,i){var s=new Image;s.onload=function(){t(s)},s.onerror=i,s.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))}))},Fb=function(){function e(e){var t=e.id,i=e.enabled;this.id=t,this.enabled=i,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,fp([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,fp([this.id,this.getTime()+"ms"],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,fp([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,fp([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.instances={},e}(),Eb=function(){function e(t,i){var s;this.windowBounds=i,this.instanceName="#"+e.instanceCount++,this.logger=new Fb({id:this.instanceName,enabled:t.logging}),this.cache=null!==(s=t.cache)&&void 0!==s?s:new Ly(this,t)}return e.instanceCount=1,e}(),Db=function(e,t){return void 0===t&&(t={}),Ib(e,t)};"undefined"!=typeof window&&Ty.setContext(window);var Ib=function(e,t){return dp(void 0,void 0,void 0,(function(){var i,s,r,n,o,a,l,u,A,c,h,d,p,f,v,g,m,_,y,B,x,w,P,C,M,k,F,E,D,I,S,T,L,R,U,O,Q,N;return pp(this,(function(V){switch(V.label){case 0:if(!e||"object"!==b(e))return[2,Promise.reject("Invalid element provided as first argument")];if(!(i=e.ownerDocument))throw new Error("Element is not attached to a Document");if(!(s=i.defaultView))throw new Error("Document is not attached to a Window");return r={allowTaint:null!==(w=t.allowTaint)&&void 0!==w&&w,imageTimeout:null!==(P=t.imageTimeout)&&void 0!==P?P:15e3,proxy:t.proxy,useCORS:null!==(C=t.useCORS)&&void 0!==C&&C},n=hp({logging:null===(M=t.logging)||void 0===M||M,cache:t.cache},r),o={windowWidth:null!==(k=t.windowWidth)&&void 0!==k?k:s.innerWidth,windowHeight:null!==(F=t.windowHeight)&&void 0!==F?F:s.innerHeight,scrollX:null!==(E=t.scrollX)&&void 0!==E?E:s.pageXOffset,scrollY:null!==(D=t.scrollY)&&void 0!==D?D:s.pageYOffset},a=new vp(o.scrollX,o.scrollY,o.windowWidth,o.windowHeight),l=new Eb(n,a),u=null!==(I=t.foreignObjectRendering)&&void 0!==I&&I,A={allowTaint:null!==(S=t.allowTaint)&&void 0!==S&&S,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:u,copyStyles:u},l.logger.debug("Starting document clone with size "+a.width+"x"+a.height+" scrolled to "+-a.left+","+-a.top),c=new my(l,e,A),(h=c.clonedReferenceElement)?[4,c.toIFrame(i,a)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return d=V.sent(),p=W_(h)||function(e){return"HTML"===e.tagName}(h)?function(e){var t=e.body,i=e.documentElement;if(!t||!i)throw new Error("Unable to get document size");var s=Math.max(Math.max(t.scrollWidth,i.scrollWidth),Math.max(t.offsetWidth,i.offsetWidth),Math.max(t.clientWidth,i.clientWidth)),r=Math.max(Math.max(t.scrollHeight,i.scrollHeight),Math.max(t.offsetHeight,i.offsetHeight),Math.max(t.clientHeight,i.clientHeight));return new vp(0,0,s,r)}(h.ownerDocument):gp(l,h),f=p.width,v=p.height,g=p.left,m=p.top,_=Sb(l,h,t.backgroundColor),y={canvas:t.canvas,backgroundColor:_,scale:null!==(L=null!==(T=t.scale)&&void 0!==T?T:s.devicePixelRatio)&&void 0!==L?L:1,x:(null!==(R=t.x)&&void 0!==R?R:0)+g,y:(null!==(U=t.y)&&void 0!==U?U:0)+m,width:null!==(O=t.width)&&void 0!==O?O:Math.ceil(f),height:null!==(Q=t.height)&&void 0!==Q?Q:Math.ceil(v)},u?(l.logger.debug("Document cloned, using foreign object rendering"),[4,new Mb(l,y).render(h)]):[3,3];case 2:return B=V.sent(),[3,5];case 3:return l.logger.debug("Document cloned, element located at "+g+","+m+" with size "+f+"x"+v+" using computed rendering"),l.logger.debug("Starting DOM parsing"),x=L_(l,h),_===x.styles.backgroundColor&&(x.styles.backgroundColor=Sv.TRANSPARENT),l.logger.debug("Starting renderer for element at "+y.x+","+y.y+" with size "+y.width+"x"+y.height),[4,new bb(l,y).render(x)];case 4:B=V.sent(),V.label=5;case 5:return(null===(N=t.removeContainer)||void 0===N||N)&&(my.destroy(d)||l.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),l.logger.debug("Finished rendering"),[2,B]}}))}))},Sb=function(e,t,i){var s=t.ownerDocument,r=s.documentElement?Iv(e,getComputedStyle(s.documentElement).backgroundColor):Sv.TRANSPARENT,n=s.body?Iv(e,getComputedStyle(s.body).backgroundColor):Sv.TRANSPARENT,o="string"==typeof i?Iv(e,i):null===i?Sv.TRANSPARENT:4294967295;return t===s.documentElement?wv(r)?wv(n)?o:n:r:o};function Tb(e,t,i){var s=e.getBoundingClientRect(),r=t.getBoundingClientRect();i[0]+=s.left-r.left,i[1]+=s.top-r.top}var Lb=function(){return w((function e(t){var i=this;B(this,e),this.container=t.viewerElement,this.language="en",this.localeService=t.localeService||new Uh,this.scene=new $i(this,{canvasId:t.canvasId,canvasElement:t.canvasElement,keyboardEventsElement:t.keyboardEventsElement,contextAttr:{preserveDrawingBuffer:!1!==t.preserveDrawingBuffer,premultipliedAlpha:!!t.premultipliedAlpha,antialias:!1!==t.antialias},spinnerElementId:t.spinnerElementId,transparent:!1!==t.transparent,gammaInput:!0,gammaOutput:!1,backgroundColor:t.backgroundColor,backgroundColorFromAmbientLight:t.backgroundColorFromAmbientLight,ticksPerRender:1,ticksPerOcclusionTest:20,units:t.units,scale:t.scale,origin:t.origin,lightIntensity:t.lightIntensity,saoEnabled:t.saoEnabled,alphaDepthMask:!1!==t.alphaDepthMask,entityOffsetsEnabled:!!t.entityOffsetsEnabled,pickSurfacePrecisionEnabled:!!t.pickSurfacePrecisionEnabled,readableGeometryEnabled:!!t.readableGeometryEnabled,logarithmicDepthBufferEnabled:!!t.logarithmicDepthBufferEnabled,pbrEnabled:!!t.pbrEnabled,colorTextureEnabled:!1!==t.colorTextureEnabled,dtxEnabled:!!t.dtxEnabled,edgesEnabled:t.edgesEnabled,markerZOffset:t.markerZOffset,numCachedSectionPlanes:t.numCachedSectionPlanes,lodEnabled:!!t.lodEnabled,resolutionScale:t.resolutionScale,offset:t.offset,worldAxis:t.worldAxis}),this.metaScene=new lp(this,this.scene),this.id=t.id||this.scene.id,this.camera=this.scene.camera,this.cameraFlight=new Yh(this.scene,{duration:.5}),this.cameraControl=new rp(this.scene,{snapRadius:t.snapRadius,doublePickFlyTo:!0}),this.scene.canvas.on("boundary",(function(e){i.cameraControl.updatePivotElement()})),this._plugins=[],this._eventSubs={}}),[{key:"capabilities",get:function(){return this.scene.capabilities}},{key:"on",value:function(e,t){var i=this._eventSubs[e];i||(i=[],this._eventSubs[e]=i),i.push(t)}},{key:"fire",value:function(e,t){var i=this._eventSubs[e];if(i)for(var s=0,r=i.length;s<r;s++)i[s](t)}},{key:"off",value:function(e){}},{key:"log",value:function(e){console.log("[xtctwins viewer ".concat(this.id,"]: ").concat(e))}},{key:"error",value:function(e){console.error("[xtctwins viewer ".concat(this.id,"]: ").concat(e))}},{key:"addPlugin",value:function(e){this._plugins.push(e)}},{key:"removePlugin",value:function(e){for(var t=0,i=this._plugins.length;t<i;t++){var s=this._plugins[t];if(s===e)return s.clear&&s.clear(),void this._plugins.splice(t,1)}}},{key:"sendToPlugins",value:function(e,t){for(var i=0,s=this._plugins.length;i<s;i++){var r=this._plugins[i];r.send&&r.send(e,t)}}},{key:"clear",value:function(){throw'Viewer#clear() no longer implemented - use \'#sendToPlugins("clear") instead'}},{key:"resetView",value:function(){throw"Viewer#resetView() no longer implemented - use CameraMemento & ObjectsMemento classes instead"}},{key:"beginSnapshot",value:function(){this._snapshotBegun||(this.scene._renderer.beginSnapshot(),this._snapshotBegun=!0)}},{key:"getSnapshot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!this._snapshotBegun,i=void 0!==e.width&&void 0!==e.height,s=this.scene.canvas.canvas,r=s.clientWidth,n=s.clientHeight,o=e.width?Math.floor(e.width):s.width,a=e.height?Math.floor(e.height):s.height;i&&(s.width=o,s.height=a),this._snapshotBegun||this.beginSnapshot({width:o,height:a}),e.includeGizmos||this.sendToPlugins("snapshotStarting");for(var l={},u=0,A=this._plugins.length;u<A;u++){var c=this._plugins[u];if(c.getContainerElement){var h=c.getContainerElement();h!==document.body&&(l[h.id]||(l[h.id]=!0,Db(h).then((function(e){document.body.appendChild(e),setTimeout((function(){document.body.removeChild(e)}),200)}))))}}this.scene.fire("rendering",{},!0),this.scene._renderer.renderSnapshot();var d=this.scene._renderer.readSnapshot(e);return i&&(s.width=r,s.height=n,this.scene.glRedraw()),e.includeGizmos||this.sendToPlugins("snapshotFinished"),t&&this.endSnapshot(),d}},{key:"getSnapshotWithPlugins",value:(e=o(r().mark((function e(){var t,i,s,n,o,a,l,u,A,c,h,d,p,f,v,g,m,_,y,b,B,x=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=x.length>0&&void 0!==x[0]?x[0]:{},i=!this._snapshotBegun,s=void 0!==t.width&&void 0!==t.height,n=this.scene.canvas.canvas,o=n.clientWidth,a=n.clientHeight,l=t.width?Math.floor(t.width):n.width,u=t.height?Math.floor(t.height):n.height,s&&(n.width=l,n.height=u),this._snapshotBegun||this.beginSnapshot(),t.includeGizmos||this.sendToPlugins("snapshotStarting"),this.scene._renderer.renderSnapshot(),A=this.scene._renderer.readSnapshotAsCanvas(),s&&(n.width=o,n.height=a,this.scene.glRedraw()),c={},h=[],d=0,p=this._plugins.length;d<p;d++)(f=this._plugins[d]).getContainerElement&&(v=f.getContainerElement())!==document.body&&(c[v.id]||(c[v.id]=!0,h.push(v)));g=0,m=h.length;case 18:if(!(g<m)){e.next=28;break}return _=h[g],y=0==g?A.width/_.clientWidth:1,b=J.vec2([0,0]),Tb(n,_,b),e.next=25,Db(_,{canvas:A,backgroundColor:null,x:b[0],y:b[1],scale:y});case 25:g++,e.next=18;break;case 28:return t.includeGizmos||this.sendToPlugins("snapshotFinished"),i&&this.endSnapshot(),"jpeg"!==(B=t.format||"png")&&"png"!==B&&"bmp"!==B&&(console.error("Unsupported image format: '"+B+"' - supported types are 'jpeg', 'bmp' and 'png' - defaulting to 'png'"),B="png"),t.includeGizmos||this.sendToPlugins("snapshotFinished"),i&&this.endSnapshot(),e.abrupt("return",A.toDataURL("image/".concat(B)));case 35:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"endSnapshot",value:function(){this._snapshotBegun&&(this.scene._renderer.endSnapshot(),this.scene._renderer.render({force:!0}),this._snapshotBegun=!1)}},{key:"destroy",value:function(e){var t=this._plugins.slice();if(t.length>0)for(var i=0,s=t.length;i<s;i++){t[i].destroy()}this.cameraControl.destroy(),this.scene.destroy(e)}}]);var e}();function Rb(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Ub=Boolean("object"!==("undefined"==typeof process?"undefined":b(process))||"[object process]"!==String(process)||process.browser),Ob="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);Ob&&parseFloat(Ob[1]);var Qb="3.4.15";function Nb(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Vb="object"!==("undefined"==typeof process?"undefined":b(process))||"[object process]"!==String(process)||process.browser,Hb="undefined"!=typeof window&&void 0!==window.orientation,jb="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);function Gb(e){return Gb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gb(e)}function zb(e){var t=function(e,t){if("object"!=Gb(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,t||"default");if("object"!=Gb(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Gb(t)?t:String(t)}function Wb(e,t,i){return(t=zb(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}jb&&parseFloat(jb[1]);var Kb=function(){return w((function e(t,i){var s=this;B(this,e),Wb(this,"name",void 0),Wb(this,"workerThread",void 0),Wb(this,"isRunning",!0),Wb(this,"result",void 0),Wb(this,"_resolve",(function(){})),Wb(this,"_reject",(function(){})),this.name=t,this.workerThread=i,this.result=new Promise((function(e,t){s._resolve=e,s._reject=t}))}),[{key:"postMessage",value:function(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}},{key:"done",value:function(e){Nb(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){Nb(this.isRunning),this.isRunning=!1,this._reject(e)}}])}(),Xb=function(){return w((function e(){B(this,e)}),[{key:"terminate",value:function(){}}])}(),Yb=new Map;function Jb(e){Nb(e.source&&!e.url||!e.source&&e.url);var t=Yb.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return Zb((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),Yb.set(e.url,t)),e.source&&(t=Zb(e.source),Yb.set(e.source,t))),Nb(t),t}function Zb(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function qb(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,s=i||new Set;if(e){if($b(e))s.add(e);else if($b(e.buffer))s.add(e.buffer);else if(ArrayBuffer.isView(e));else if(t&&"object"===b(e))for(var r in e)qb(e[r],t,s)}else;return void 0===i?Array.from(s):[]}function $b(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}var eB=function(){},tB=function(){return w((function e(t){B(this,e),Wb(this,"name",void 0),Wb(this,"source",void 0),Wb(this,"url",void 0),Wb(this,"terminated",!1),Wb(this,"worker",void 0),Wb(this,"onMessage",void 0),Wb(this,"onError",void 0),Wb(this,"_loadableURL","");var i=t.name,s=t.source,r=t.url;Nb(s||r),this.name=i,this.source=s,this.url=r,this.onMessage=eB,this.onError=function(e){return console.log(e)},this.worker=Vb?this._createBrowserWorker():this._createNodeWorker()}),[{key:"destroy",value:function(){this.onMessage=eB,this.onError=eB,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}},{key:"postMessage",value:function(e,t){t=t||qb(e),this.worker.postMessage(e,t)}},{key:"_getErrorFromErrorEvent",value:function(e){var t="Failed to load ";return t+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}},{key:"_createBrowserWorker",value:function(){var e=this;this._loadableURL=Jb({source:this.source,url:this.url});var t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=function(t){t.data?e.onMessage(t.data):e.onError(new Error("No data received"))},t.onerror=function(t){e.onError(e._getErrorFromErrorEvent(t)),e.terminated=!0},t.onmessageerror=function(e){return console.error(e)},t}},{key:"_createNodeWorker",value:function(){var e,t=this;if(this.url){var i=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);e=new Xb(i,{eval:!1})}else{if(!this.source)throw new Error("no worker");e=new Xb(this.source,{eval:!0})}return e.on("message",(function(e){t.onMessage(e)})),e.on("error",(function(e){t.onError(e)})),e.on("exit",(function(e){})),e}}],[{key:"isSupported",value:function(){return"undefined"!=typeof Worker&&Vb||void 0!==Xb&&!Vb}}])}(),iB=function(){return w((function e(t){B(this,e),Wb(this,"name","unnamed"),Wb(this,"source",void 0),Wb(this,"url",void 0),Wb(this,"maxConcurrency",1),Wb(this,"maxMobileConcurrency",1),Wb(this,"onDebug",(function(){})),Wb(this,"reuseWorkers",!0),Wb(this,"props",{}),Wb(this,"jobQueue",[]),Wb(this,"idleQueue",[]),Wb(this,"count",0),Wb(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}),[{key:"destroy",value:function(){this.idleQueue.forEach((function(e){return e.destroy()})),this.isDestroyed=!0}},{key:"setProps",value:function(e){this.props=s(s({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}},{key:"startJob",value:(t=o(r().mark((function e(t){var i,s,n,o=this,a=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:function(e,t,i){return e.done(i)},s=a.length>2&&void 0!==a[2]?a[2]:function(e,t){return e.error(t)},n=new Promise((function(e){return o.jobQueue.push({name:t,onMessage:i,onError:s,onStart:e}),o})),this._startQueuedJob(),e.next=6,n;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_startQueuedJob",value:(e=o(r().mark((function e(){var t,i,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.jobQueue.length){e.next=2;break}return e.abrupt("return");case 2:if(t=this._getAvailableWorker()){e.next=5;break}return e.abrupt("return");case 5:if(!(i=this.jobQueue.shift())){e.next=18;break}return this.onDebug({message:"Starting job",name:i.name,workerThread:t,backlog:this.jobQueue.length}),s=new Kb(i.name,t),t.onMessage=function(e){return i.onMessage(s,e.type,e.payload)},t.onError=function(e){return i.onError(s,e)},i.onStart(s),e.prev=12,e.next=15,s.result;case 15:return e.prev=15,this.returnWorkerToQueue(t),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[12,,15,18]])}))),function(){return e.apply(this,arguments)})},{key:"returnWorkerToQueue",value:function(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}},{key:"_getAvailableWorker",value:function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;var e="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new tB({name:e,source:this.source,url:this.url})}return null}},{key:"_getMaxConcurrency",value:function(){return Hb?this.maxMobileConcurrency:this.maxConcurrency}}],[{key:"isSupported",value:function(){return tB.isSupported()}}]);var e,t}(),sB={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:function(){}},rB=function(){function e(t){B(this,e),Wb(this,"props",void 0),Wb(this,"workerPools",new Map),this.props=s({},sB),this.setProps(t),this.workerPools=new Map}return w(e,[{key:"destroy",value:function(){var e,t=l(this.workerPools.values());try{for(t.s();!(e=t.n()).done;){e.value.destroy()}}catch(e){t.e(e)}finally{t.f()}this.workerPools=new Map}},{key:"setProps",value:function(e){this.props=s(s({},this.props),e);var t,i=l(this.workerPools.values());try{for(i.s();!(t=i.n()).done;){t.value.setProps(this._getWorkerPoolProps())}}catch(e){i.e(e)}finally{i.f()}}},{key:"getWorkerPool",value:function(e){var t=e.name,i=e.source,s=e.url,r=this.workerPools.get(t);return r||((r=new iB({name:t,source:i,url:s})).setProps(this._getWorkerPoolProps()),this.workerPools.set(t,r)),r}},{key:"_getWorkerPoolProps",value:function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}],[{key:"isSupported",value:function(){return tB.isSupported()}},{key:"getWorkerFarm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e._workerFarm=e._workerFarm||new e({}),e._workerFarm.setProps(t),e._workerFarm}}])}();Wb(rB,"_workerFarm",void 0);var nB="latest";function oB(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t[e.id]||{},s="".concat(e.id,"-worker.js"),r=i.workerUrl;if(r||"compression"!==e.id||(r=t.workerUrl),"test"===t._workerType&&(r="modules/".concat(e.module,"/dist/").concat(s)),!r){var n=e.version;"latest"===n&&(n=nB);var o=n?"@".concat(n):"";r="https://unpkg.com/@loaders.gl/".concat(e.module).concat(o,"/dist/").concat(s)}return Nb(r),r}function aB(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qb;Nb(e,"no worker provided");var i=e.version;return!(!t||!i)}function lB(e,t){return!!rB.isSupported()&&(!!(Vb||null!=t&&t._nodeWorkers)&&(e.worker&&(null==t?void 0:t.worker)))}function uB(e,t,i,s,r){return AB.apply(this,arguments)}function AB(){return AB=o(r().mark((function e(t,i,s,n,o){var a,l,u,A,c,h;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.id,l=oB(t,s),u=rB.getWorkerFarm(s),A=u.getWorkerPool({name:a,url:l}),s=JSON.parse(JSON.stringify(s)),n=JSON.parse(JSON.stringify(n||{})),e.next=8,A.startJob("process-on-worker",cB.bind(null,o));case 8:return(c=e.sent).postMessage("process",{input:i,options:s,context:n}),e.next=12,c.result;case 12:return h=e.sent,e.next=15,h.result;case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e)}))),AB.apply(this,arguments)}function cB(e,t,i,s){return hB.apply(this,arguments)}function hB(){return(hB=o(r().mark((function e(t,i,s,n){var o,a,l,u,A;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=s,e.next="done"===e.t0?3:"error"===e.t0?5:"process"===e.t0?7:20;break;case 3:return i.done(n),e.abrupt("break",21);case 5:return i.error(new Error(n.error)),e.abrupt("break",21);case 7:return o=n.id,a=n.input,l=n.options,e.prev=8,e.next=11,t(a,l);case 11:u=e.sent,i.postMessage("done",{id:o,result:u}),e.next=19;break;case 15:e.prev=15,e.t1=e.catch(8),A=e.t1 instanceof Error?e.t1.message:"unknown error",i.postMessage("error",{id:o,error:A});case 19:return e.abrupt("break",21);case 20:console.warn("parse-with-worker unknown message ".concat(s));case 21:case"end":return e.stop()}}),e,null,[[8,15]])})))).apply(this,arguments)}function dB(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var s,r=t.map((function(e){return e instanceof ArrayBuffer?new Uint8Array(e):e})),n=r.reduce((function(e,t){return e+t.byteLength}),0),o=new Uint8Array(n),a=0,u=l(r);try{for(u.s();!(s=u.n()).done;){var A=s.value;o.set(A,a),a+=A.byteLength}}catch(e){u.e(e)}finally{u.f()}return o.buffer}function pB(e){return fB.apply(this,arguments)}function fB(){return(fB=o(r().mark((function e(t){var i,s,n,o,a,l,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=[],s=!1,n=!1,e.prev=3,a=E(t);case 5:return e.next=7,a.next();case 7:if(!(s=!(l=e.sent).done)){e.next=13;break}u=l.value,i.push(u);case 10:s=!1,e.next=5;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(3),n=!0,o=e.t0;case 19:if(e.prev=19,e.prev=20,!s||null==a.return){e.next=24;break}return e.next=24,a.return();case 24:if(e.prev=24,!n){e.next=27;break}throw o;case 27:return e.finish(24);case 28:return e.finish(19);case 29:return e.abrupt("return",dB.apply(void 0,i));case 30:case"end":return e.stop()}}),e,null,[[3,15,19,29],[20,,24,28]])})))).apply(this,arguments)}var vB="",gB={};function mB(e){for(var t in gB)if(e.startsWith(t)){var i=gB[t];e=e.replace(t,i)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(vB).concat(e)),e}function _B(e){if((t=e)&&"object"===b(t)&&t.isBuffer)return e;var t;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if("string"==typeof e){var i=e;return(new TextEncoder).encode(i).buffer}if(e&&"object"===b(e)&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function yB(e){var t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}var bB=function(e){return"function"==typeof e},BB=function(e){return null!==e&&"object"===b(e)},xB=function(e){return BB(e)&&e.constructor==={}.constructor},wB=function(e){return e&&"function"==typeof e[Symbol.iterator]},PB=function(e){return e&&"function"==typeof e[Symbol.asyncIterator]},CB=function(e){return"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json},MB=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},kB=function(e){return e&&"object"===b(e)&&e.isBuffer},FB=function(e){return function(e){return"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||BB(e)&&bB(e.tee)&&bB(e.cancel)&&bB(e.getReader)}(e)||function(e){return BB(e)&&bB(e.read)&&bB(e.pipe)&&function(e){return"boolean"==typeof e}(e.readable)}(e)},EB=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,DB=/^([-\w.]+\/[-\w.+]+)/;function IB(e){var t=EB.exec(e);return t?t[1]:""}var SB=/\?.*/;function TB(e){return e.replace(SB,"")}function LB(e){return CB(e)?e.url:MB(e)?e.name||"":"string"==typeof e?e:""}function RB(e){if(CB(e)){var t=e,i=t.headers.get("content-type")||"",s=TB(t.url);return function(e){var t=DB.exec(e);return t?t[1]:e}(i)||IB(s)}return MB(e)?e.type||"":"string"==typeof e?IB(e):""}function UB(e){return CB(e)?e.headers["content-length"]||-1:MB(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}function OB(e){return QB.apply(this,arguments)}function QB(){return(QB=o(r().mark((function e(t){var i,s,n,o,a,l;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!CB(t)){e.next=2;break}return e.abrupt("return",t);case 2:return i={},(s=UB(t))>=0&&(i["content-length"]=String(s)),n=LB(t),(o=RB(t))&&(i["content-type"]=o),e.next=10,GB(t);case 10:return(a=e.sent)&&(i["x-first-bytes"]=a),"string"==typeof t&&(t=(new TextEncoder).encode(t)),l=new Response(t,{headers:i}),Object.defineProperty(l,"url",{value:n}),e.abrupt("return",l);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NB(e){return VB.apply(this,arguments)}function VB(){return(VB=o(r().mark((function e(t){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=5;break}return e.next=3,HB(t);case 3:throw i=e.sent,new Error(i);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function HB(e){return jB.apply(this,arguments)}function jB(){return(jB=o(r().mark((function e(t){var i,s,n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): "),e.prev=1,s=t.headers.get("Content-Type"),n=t.statusText,!s.includes("application/json")){e.next=11;break}return e.t0=n,e.t1=" ",e.next=9,t.text();case 9:e.t2=e.sent,n=e.t0+=e.t1.concat.call(e.t1,e.t2);case 11:i=(i+=n).length>60?"".concat(i.slice(0,60),"..."):i,e.next=17;break;case 15:e.prev=15,e.t3=e.catch(1);case 17:return e.abrupt("return",i);case 18:case"end":return e.stop()}}),e,null,[[1,15]])})))).apply(this,arguments)}function GB(e){return zB.apply(this,arguments)}function zB(){return(zB=o(r().mark((function e(t){var i,s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=5,"string"!=typeof t){e.next=3;break}return e.abrupt("return","data:,".concat(t.slice(0,i)));case 3:if(!(t instanceof Blob)){e.next=8;break}return s=t.slice(0,5),e.next=7,new Promise((function(e){var t=new FileReader;t.onload=function(t){var i;return e(null==t||null===(i=t.target)||void 0===i?void 0:i.result)},t.readAsDataURL(s)}));case 7:return e.abrupt("return",e.sent);case 8:if(!(t instanceof ArrayBuffer)){e.next=12;break}return n=t.slice(0,i),o=WB(n),e.abrupt("return","data:base64,".concat(o));case 12:return e.abrupt("return",null);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function WB(e){for(var t="",i=new Uint8Array(e),s=0;s<i.byteLength;s++)t+=String.fromCharCode(i[s]);return btoa(t)}function KB(e,t){return XB.apply(this,arguments)}function XB(){return(XB=o(r().mark((function e(t,i){var s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=7;break}return t=mB(t),s=i,null!=i&&i.fetch&&"function"!=typeof(null==i?void 0:i.fetch)&&(s=i.fetch),e.next=6,fetch(t,s);case 6:case 9:return e.abrupt("return",e.sent);case 7:return e.next=9,OB(t);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function YB(){return!("object"===("undefined"==typeof process?"undefined":b(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===b(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===b(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":b(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,i=e||t;return!!(i&&i.indexOf("Electron")>=0)}()}var JB={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":b(process))&&process},ZB=JB.window||JB.self||JB.global,qB=JB.process||{},$B="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source";YB();var ex,tx=function(){return w((function e(t,i){B(this,e);var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Wb(this,"storage",void 0),Wb(this,"id",void 0),Wb(this,"config",void 0),this.storage=function(e){try{var t=window[e],i="__storage_test__";return t.setItem(i,i),t.removeItem(i),t}catch(e){return null}}(s),this.id=t,this.config=i,this._loadConfiguration()}),[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}])}();function ix(e,t,i){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>s&&(i=Math.min(i,s/e.width));var n=e.width*i,o=e.height*i,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(n/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(n,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}function sx(e){return"string"==typeof e?ex[e.toUpperCase()]||ex.WHITE:e}function rx(e,t){if(!e)throw new Error(t||"Assertion failed")}function nx(){var e,t,i;if(YB&&"performance"in ZB)e=null==ZB||null===(t=ZB.performance)||void 0===t||null===(i=t.now)||void 0===i?void 0:i.call(t);else if("hrtime"in qB){var s,r=null==qB||null===(s=qB.hrtime)||void 0===s?void 0:s.call(qB);e=1e3*r[0]+r[1]/1e6}else e=Date.now();return e}!function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(ex||(ex={}));var ox={debug:YB&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},ax={enabled:!0,level:0};function lx(){}var ux={},Ax={once:!0},cx=function(){return w((function e(){B(this,e);var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""}).id;Wb(this,"id",void 0),Wb(this,"VERSION",$B),Wb(this,"_startTs",nx()),Wb(this,"_deltaTs",nx()),Wb(this,"_storage",void 0),Wb(this,"userData",{}),Wb(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new tx("__probe-".concat(this.id,"__"),ax),this.timeStamp("".concat(this.id," started")),function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],s=Object.getPrototypeOf(e),r=l(Object.getOwnPropertyNames(s));try{var n=function(){var s=t.value;"function"==typeof e[s]&&(i.find((function(e){return s===e}))||(e[s]=e[s].bind(e)))};for(r.s();!(t=r.n()).done;)n()}catch(e){r.e(e)}finally{r.f()}}(this),Object.seal(this)}),[{key:"level",get:function(){return this.getLevel()},set:function(e){this.setLevel(e)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((nx()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((nx()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(e){this.level=e}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.setConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.setConfiguration({level:e}),this}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.setConfiguration(y({},e,t))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(e,t){rx(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,ox.warn,arguments,Ax)}},{key:"error",value:function(e){return this._getLogFunction(0,e,ox.error,arguments)}},{key:"deprecated",value:function(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}},{key:"removed",value:function(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}},{key:"probe",value:function(e,t){return this._getLogFunction(e,t,ox.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,ox.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),r=2;r<i;r++)s[r-2]=arguments[r];return this._getLogFunction(e,t,ox.debug||ox.info,arguments,Ax)}},{key:"table",value:function(e,t,i){return t?this._getLogFunction(e,t,console.table||lx,i&&[i],{tag:px(t)}):lx}},{key:"image",value:function(e){var t=e.logLevel,i=e.priority,s=e.image,r=e.message,n=void 0===r?"":r,o=e.scale,l=void 0===o?1:o;return this._shouldLog(t||i)?YB?function(e){var t=e.image,i=e.message,s=void 0===i?"":i,r=e.scale,n=void 0===r?1:r;if("string"==typeof t){var o=new Image;return o.onload=function(){var e,t=ix(o,s,n);(e=console).log.apply(e,a(t))},o.src=t,lx}var l=t.nodeName||"";if("img"===l.toLowerCase()){var u;return(u=console).log.apply(u,a(ix(t,s,n))),lx}if("canvas"===l.toLowerCase()){var A=new Image;return A.onload=function(){var e;return(e=console).log.apply(e,a(ix(A,s,n)))},A.src=t.toDataURL(),lx}return lx}({image:s,message:n,scale:l}):(console.warn("removed"),lx):lx}},{key:"time",value:function(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,t){return this._getLogFunction(e,t,console.timeStamp||lx)}},{key:"group",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},s=dx({logLevel:e,message:t,opts:i}),r=i.collapsed;return s.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(s)}},{key:"groupCollapsed",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},i,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||lx)}},{key:"withGroup",value:function(e,t,i){this.group(e,t)();try{i()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=hx(e)}},{key:"_getLogFunction",value:function(e,t,i,s,r){if(this._shouldLog(e)){var n;r=dx({logLevel:e,message:t,args:s,opts:r}),rx(i=i||r.method),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=nx();var o=r.tag||r.message;if(r.once){if(ux[o])return lx;ux[o]=nx()}return t=function(e,t,i){if("string"==typeof t){var s=i.time?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,i=Math.max(t-e.length,0);return"".concat(" ".repeat(i)).concat(e)}((r=i.total)<10?"".concat(r.toFixed(2),"ms"):r<100?"".concat(r.toFixed(1),"ms"):r<1e3?"".concat(r.toFixed(0),"ms"):"".concat((r/1e3).toFixed(2),"s")):"";t=function(e,t,i){return YB||"string"!=typeof e||(t&&(t=sx(t),e="[".concat(t,"m").concat(e,"[39m")),i&&(t=sx(i),e="[".concat(i+10,"m").concat(e,"[49m"))),e}(t=i.time?"".concat(e,": ").concat(s," ").concat(t):"".concat(e,": ").concat(t),i.color,i.background)}var r;return t}(this.id,r.message,r),(n=i).bind.apply(n,[console,t].concat(a(r.args)))}return lx}}])}();function hx(e){if(!e)return 0;var t;switch(b(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return rx(Number.isFinite(t)&&t>=0),t}function dx(e){var t=e.logLevel,i=e.message;e.logLevel=hx(t);for(var s=e.args?Array.from(e.args):[];s.length&&s.shift()!==i;);switch(b(t)){case"string":case"function":void 0!==i&&s.unshift(i),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());var r=b(e.message);return rx("string"===r||"object"===r),Object.assign(e,{args:s},e.opts)}function px(e){for(var t in e)for(var i in e[t])return i||"untitled";return"empty"}Wb(cx,"VERSION",$B);var fx=new cx({id:"loaders.gl"}),vx=function(){return w((function e(){B(this,e)}),[{key:"log",value:function(){return function(){}}},{key:"info",value:function(){return function(){}}},{key:"warn",value:function(){return function(){}}},{key:"error",value:function(){return function(){}}}])}(),gx={fetch:null,mimeType:void 0,nothrow:!1,log:new(function(){return w((function e(){B(this,e),Wb(this,"console",void 0),this.console=console}),[{key:"log",value:function(){for(var e,t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return(e=this.console.log).bind.apply(e,[this.console].concat(i))}},{key:"info",value:function(){for(var e,t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return(e=this.console.info).bind.apply(e,[this.console].concat(i))}},{key:"warn",value:function(){for(var e,t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return(e=this.console.warn).bind.apply(e,[this.console].concat(i))}},{key:"error",value:function(){for(var e,t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return(e=this.console.error).bind.apply(e,[this.console].concat(i))}}])}()),CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Ub,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},mx={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function _x(){globalThis.loaders=globalThis.loaders||{};var e=globalThis.loaders;return e._state=e._state||{},e._state}var yx=function(){var e=_x();return e.globalOptions=e.globalOptions||s({},gx),e.globalOptions};function bx(e,t,i,r){return i=i||[],function(e,t){Bx(e,null,gx,mx,t);var i,s=l(t);try{for(s.s();!(i=s.n()).done;){var r=i.value,n=e&&e[r.id]||{},o=r.options&&r.options[r.id]||{},a=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};Bx(n,r.id,o,a,t)}}catch(e){s.e(e)}finally{s.f()}}(e,i=Array.isArray(i)?i:[i]),function(e,t,i){var r=e.options||{},n=s({},r);(function(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)})(n,i),null===n.log&&(n.log=new vx);return wx(n,yx()),wx(n,t),n}(t,e,r)}function Bx(e,t,i,s,r){var n=t||"Top level",o=t?"".concat(t,"."):"";for(var a in e){var l=!t&&BB(e[a]);if(!(a in i)&&!("baseUri"===a&&!t)&&!("workerUrl"===a&&t))if(a in s)fx.warn("".concat(n," loader option '").concat(o).concat(a,"' no longer supported, use '").concat(s[a],"'"))();else if(!l){var u=xx(a,r);fx.warn("".concat(n," loader option '").concat(o).concat(a,"' not recognized. ").concat(u))()}}}function xx(e,t){var i,s=e.toLowerCase(),r="",n=l(t);try{for(n.s();!(i=n.n()).done;){var o=i.value;for(var a in o.options){if(e===a)return"Did you mean '".concat(o.id,".").concat(a,"'?");var u=a.toLowerCase();(s.startsWith(u)||u.startsWith(s))&&(r=r||"Did you mean '".concat(o.id,".").concat(a,"'?"))}}}catch(e){n.e(e)}finally{n.f()}return r}function wx(e,t){for(var i in t)if(i in t){var r=t[i];xB(r)&&xB(e[i])?e[i]=s(s({},e[i]),t[i]):e[i]=t[i]}}function Px(e){var t;return!!e&&(Array.isArray(e)&&(e=e[0]),Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions))}function Cx(e){var t,i,r;return Rb(e,"null loader"),Rb(Px(e),"invalid loader"),Array.isArray(e)&&(r=e[1],e=s(s({},e=e[0]),{},{options:s(s({},e.options),r)})),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(i=e)&&void 0!==i&&i.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var Mx=function(){var e=_x();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};var kx=new cx({id:"loaders.gl"}),Fx=/\.([^.]+)$/;function Ex(e){return Dx.apply(this,arguments)}function Dx(){return Dx=o(r().mark((function e(t){var i,n,o,a,l=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=l.length>1&&void 0!==l[1]?l[1]:[],n=l.length>2?l[2]:void 0,o=l.length>3?l[3]:void 0,Sx(t)){e.next=5;break}return e.abrupt("return",null);case 5:if(!(a=Ix(t,i,s(s({},n),{},{nothrow:!0}),o))){e.next=8;break}return e.abrupt("return",a);case 8:if(!MB(t)){e.next=13;break}return e.next=11,t.slice(0,10).arrayBuffer();case 11:t=e.sent,a=Ix(t,i,n,o);case 13:if(a||null!=n&&n.nothrow){e.next=15;break}throw new Error(Tx(t));case 15:return e.abrupt("return",a);case 16:case"end":return e.stop()}}),e)}))),Dx.apply(this,arguments)}function Ix(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;if(!Sx(e))return null;if(t&&!Array.isArray(t))return Cx(t);var r,n=[];(t&&(n=n.concat(t)),null!=i&&i.ignoreRegisteredLoaders)||(r=n).push.apply(r,a(Mx()));!function(e){var t,i=l(e);try{for(i.s();!(t=i.n()).done;){Cx(t.value)}}catch(e){i.e(e)}finally{i.f()}}(n);var o=function(e,t,i,s){var r,n=LB(e),o=RB(e),a=TB(n)||(null==s?void 0:s.url),u=null,A="";null!=i&&i.mimeType&&(u=Lx(t,null==i?void 0:i.mimeType),A="match forced by supplied MIME type ".concat(null==i?void 0:i.mimeType));u=u||function(e,t){var i=t&&Fx.exec(t),s=i&&i[1];return s?function(e,t){t=t.toLowerCase();var i,s=l(e);try{for(s.s();!(i=s.n()).done;){var r,n=i.value,o=l(n.extensions);try{for(o.s();!(r=o.n()).done;){if(r.value.toLowerCase()===t)return n}}catch(e){o.e(e)}finally{o.f()}}}catch(e){s.e(e)}finally{s.f()}return null}(e,s):null}(t,a),A=A||(u?"matched url ".concat(a):""),u=u||Lx(t,o),A=A||(u?"matched MIME type ".concat(o):""),u=u||function(e,t){if(!t)return null;var i,s=l(e);try{for(s.s();!(i=s.n()).done;){var r=i.value;if("string"==typeof t){if(Rx(t,r))return r}else if(ArrayBuffer.isView(t)){if(Ux(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer){if(Ux(t,0,r))return r}}}catch(e){s.e(e)}finally{s.f()}return null}(t,e),A=A||(u?"matched initial data ".concat(Ox(e)):""),u=u||Lx(t,null==i?void 0:i.fallbackMimeType),A=A||(u?"matched fallback MIME type ".concat(o):""),A&&kx.log(1,"selectLoader selected ".concat(null===(r=u)||void 0===r?void 0:r.name,": ").concat(A,"."));return u}(e,n,i,s);if(!(o||null!=i&&i.nothrow))throw new Error(Tx(e));return o}function Sx(e){return!(e instanceof Response&&204===e.status)}function Tx(e){var t=LB(e),i=RB(e),s="No valid loader found (";s+=t?"".concat(yB(t),", "):"no url provided, ",s+="MIME type: ".concat(i?'"'.concat(i,'"'):"not provided",", ");var r=e?Ox(e):"";return s+=r?' first bytes: "'.concat(r,'"'):"first bytes: not available",s+=")"}function Lx(e,t){var i,s=l(e);try{for(s.s();!(i=s.n()).done;){var r=i.value;if(r.mimeTypes&&r.mimeTypes.includes(t))return r;if(t==="application/x.".concat(r.id))return r}}catch(e){s.e(e)}finally{s.f()}return null}function Rx(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some((function(t){return e.startsWith(t)}))}function Ux(e,t,i){return(Array.isArray(i.tests)?i.tests:[i.tests]).some((function(s){return function(e,t,i,s){if(s instanceof ArrayBuffer)return function(e,t,i){if(i=i||e.byteLength,e.byteLength<i||t.byteLength<i)return!1;for(var s=new Uint8Array(e),r=new Uint8Array(t),n=0;n<s.length;++n)if(s[n]!==r[n])return!1;return!0}(s,e,s.byteLength);switch(b(s)){case"function":return s(e,i);case"string":return s===Qx(e,t,s.length);default:return!1}}(e,t,i,s)}))}function Ox(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return Qx(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){return Qx(e,0,t)}return""}function Qx(e,t,i){if(e.byteLength<t+i)return"";for(var s=new DataView(e),r="",n=0;n<i;n++)r+=String.fromCharCode(s.getUint8(t+n));return r}var Nx=262144;function Vx(t,i){var s,n,o,a,l;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=(null==i?void 0:i.chunkSize)||Nx,n=0,o=new TextEncoder;case 3:if(!(n<t.length)){e.next=11;break}return a=Math.min(t.length-n,s),l=t.slice(n,n+a),n+=a,e.next=9,o.encode(l);case 9:e.next=3;break;case 11:case"end":return e.stop()}}),e)}var Hx=262144;var jx=1048576;function Gx(){return(Gx=M(r().mark((function e(t,i){var s,n,o,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=(null==i?void 0:i.chunkSize)||jx,n=0;case 2:if(!(n<t.size)){e.next=12;break}return o=n+s,e.next=6,C(t.slice(n,o).arrayBuffer());case 6:return a=e.sent,n=o,e.next=10,a;case 10:e.next=2;break;case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function zx(e,t){return Ub?function(e,t){return Wx.apply(this,arguments)}(e,t):function(e,t){return Kx.apply(this,arguments)}(e)}function Wx(){return(Wx=M(r().mark((function e(t,i){var s,n,o,a,l,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=t.getReader(),e.prev=1;case 2:return o=n||s.read(),null!=i&&i._streamReadAhead&&(n=s.read()),e.next=7,C(o);case 7:if(a=e.sent,l=a.done,u=a.value,!l){e.next=12;break}return e.abrupt("return");case 12:return e.next=14,_B(u);case 14:e.next=2;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(1),s.releaseLock();case 21:case"end":return e.stop()}}),e,null,[[1,18]])})))).apply(this,arguments)}function Kx(){return(Kx=M(r().mark((function e(t,i){var s,n,o,a,l,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=!1,n=!1,e.prev=2,a=E(t);case 4:return e.next=6,C(a.next());case 6:if(!(s=!(l=e.sent).done)){e.next=13;break}return u=l.value,e.next=10,_B(u);case 10:s=!1,e.next=4;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(2),n=!0,o=e.t0;case 19:if(e.prev=19,e.prev=20,!s||null==a.return){e.next=24;break}return e.next=24,C(a.return());case 24:if(e.prev=24,!n){e.next=27;break}throw o;case 27:return e.finish(24);case 28:return e.finish(19);case 29:case"end":return e.stop()}}),e,null,[[2,15,19,29],[20,,24,28]])})))).apply(this,arguments)}function Xx(e,t){if("string"==typeof e)return Vx(e,t);if(e instanceof ArrayBuffer)return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r().mark((function i(){var s,n,o,a,l,u;return r().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:s=t.chunkSize,n=void 0===s?Hx:s,o=0;case 2:if(!(o<e.byteLength)){i.next=13;break}return a=Math.min(e.byteLength-o,n),l=new ArrayBuffer(a),u=new Uint8Array(e,o,a),new Uint8Array(l).set(u),o+=a,i.next=11,l;case 11:i.next=2;break;case 13:case"end":return i.stop()}}),i)}))()}(e,t);if(MB(e))return function(e,t){return Gx.apply(this,arguments)}(e,t);if(FB(e))return zx(e,t);if(CB(e))return zx(e.body,t);throw new Error("makeIterator")}var Yx="Cannot convert supplied data type";function Jx(e,t,i){if(t.text&&"string"==typeof e)return e;if(kB(e)&&(e=e.buffer),e instanceof ArrayBuffer){var s=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(s):s}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);var r=e.buffer,n=e.byteLength||e.length;return 0===e.byteOffset&&n===r.byteLength||(r=r.slice(e.byteOffset,e.byteOffset+n)),r}throw new Error(Yx)}function Zx(e,t,i){return qx.apply(this,arguments)}function qx(){return(qx=o(r().mark((function e(t,i,s){var n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t instanceof ArrayBuffer||ArrayBuffer.isView(t),"string"!=typeof t&&!n){e.next=3;break}return e.abrupt("return",Jx(t,i));case 3:if(!MB(t)){e.next=7;break}return e.next=6,OB(t);case 6:t=e.sent;case 7:if(!CB(t)){e.next=21;break}return o=t,e.next=11,NB(o);case 11:if(!i.binary){e.next=17;break}return e.next=14,o.arrayBuffer();case 14:e.t0=e.sent,e.next=20;break;case 17:return e.next=19,o.text();case 19:e.t0=e.sent;case 20:return e.abrupt("return",e.t0);case 21:if(FB(t)&&(t=Xx(t,s)),!wB(t)&&!PB(t)){e.next=24;break}return e.abrupt("return",pB(t));case 24:throw new Error(Yx);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $x(e,t){var i=yx(),s=e||i;return"function"==typeof s.fetch?s.fetch:BB(s.fetch)?function(e){return KB(e,s)}:null!=t&&t.fetch?null==t?void 0:t.fetch:KB}function ew(e,t,i){if(i)return i;var r,n,o=s({fetch:$x(t,e)},e);if(o.url){var a=TB(o.url);o.baseUrl=a,o.queryString=function(e){var t=e.match(SB);return t&&t[0]}(o.url),o.filename=yB(a),o.baseUrl=(n=(r=a)?r.lastIndexOf("/"):-1)>=0?r.substr(0,n):""}return Array.isArray(o.loaders)||(o.loaders=null),o}function tw(e,t){if(!t&&e&&!Array.isArray(e))return e;var i;if(e&&(i=Array.isArray(e)?e:[e]),t&&t.loaders){var s=Array.isArray(t.loaders)?t.loaders:[t.loaders];i=i?[].concat(a(i),a(s)):s}return i&&i.length?i:null}function iw(e,t,i,s){return sw.apply(this,arguments)}function sw(){return(sw=o(r().mark((function e(t,i,s,n){var o,a,l;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Nb(!n||"object"===b(n)),!i||Array.isArray(i)||Px(i)||(n=void 0,s=i,i=void 0),e.next=4,t;case 4:return t=e.sent,s=s||{},o=LB(t),a=tw(i,n),e.next=11,Ex(t,a,s);case 11:if(l=e.sent){e.next=14;break}return e.abrupt("return",null);case 14:return s=bx(s,l,a,o),n=ew({url:o,parse:iw,loaders:a},s,n||null),e.next=18,rw(l,t,s,n);case 18:return e.abrupt("return",e.sent);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rw(e,t,i,s){return nw.apply(this,arguments)}function nw(){return(nw=o(r().mark((function e(t,i,s,n){var o,a,l,u,A,c,h,d;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return aB(t),CB(i)&&(a=(o=i).ok,l=o.redirected,u=o.status,A=o.statusText,c=o.type,h=o.url,d=Object.fromEntries(o.headers.entries()),n.response={headers:d,ok:a,redirected:l,status:u,statusText:A,type:c,url:h}),e.next=4,Zx(i,t,s);case 4:if(i=e.sent,!t.parseTextSync||"string"!=typeof i){e.next=8;break}return s.dataType="text",e.abrupt("return",t.parseTextSync(i,s,n,t));case 8:if(!lB(t,s)){e.next=12;break}return e.next=11,uB(t,i,s,n,iw);case 11:case 15:case 19:return e.abrupt("return",e.sent);case 12:if(!t.parseText||"string"!=typeof i){e.next=16;break}return e.next=15,t.parseText(i,s,n,t);case 16:if(!t.parse){e.next=20;break}return e.next=19,t.parse(i,s,n,t);case 20:throw Nb(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"));case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ow={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},aw=ow.global||ow.self||ow.window||{},lw="object"!==("undefined"==typeof process?"undefined":b(process))||"[object process]"!==String(process)||process.browser,uw="function"==typeof importScripts,Aw="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);Aw&&parseFloat(Aw[1]);var cw=null,hw=null,dw=Object.freeze({__proto__:null,readFileAsArrayBuffer:null,readFileAsText:null,requireFromFile:cw,requireFromString:hw}),pw="3.4.15",fw={};function vw(e){return gw.apply(this,arguments)}function gw(){return gw=o(r().mark((function e(t){var i,s,n=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.length>2&&void 0!==n[2]?n[2]:{},(i=n.length>1&&void 0!==n[1]?n[1]:null)&&(t=mw(t,i,s)),fw[t]=fw[t]||_w(t),e.next=6,fw[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)}))),gw.apply(this,arguments)}function mw(e,t,i){if(e.startsWith("http"))return e;var s=i.modules||{};return s[e]?s[e]:lw?i.CDN?(function(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}(i.CDN.startsWith("http")),"".concat(i.CDN,"/").concat(t,"@").concat(pw,"/dist/libs/").concat(e)):uw?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function _w(e){return yw.apply(this,arguments)}function yw(){return(yw=o(r().mark((function e(t){var i,s,n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.endsWith("wasm")){e.next=7;break}return e.next=3,fetch(t);case 3:return i=e.sent,e.next=6,i.arrayBuffer();case 6:return e.abrupt("return",e.sent);case 7:if(lw){e.next=20;break}if(e.prev=8,e.t0=dw&&cw,!e.t0){e.next=14;break}return e.next=13,cw(t);case 13:e.t0=e.sent;case 14:return e.abrupt("return",e.t0);case 17:return e.prev=17,e.t1=e.catch(8),e.abrupt("return",null);case 20:if(!uw){e.next=22;break}return e.abrupt("return",importScripts(t));case 22:return e.next=24,fetch(t);case 24:return s=e.sent,e.next=27,s.text();case 27:return n=e.sent,e.abrupt("return",bw(n,t));case 29:case"end":return e.stop()}}),e,null,[[8,17]])})))).apply(this,arguments)}function bw(e,t){if(!lw)return hw;if(uw)return eval.call(aw,e),null;var i=document.createElement("script");i.id=t;try{i.appendChild(document.createTextNode(e))}catch(t){i.text=e}return document.body.appendChild(i),null}var Bw,xw,ww="3.4.15",Pw="https://unpkg.com/@loaders.gl/textures@".concat(ww,"/dist/libs/basis_encoder.wasm"),Cw="https://unpkg.com/@loaders.gl/textures@".concat(ww,"/dist/libs/basis_encoder.js");function Mw(e){return kw.apply(this,arguments)}function kw(){return(kw=o(r().mark((function e(t){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=t.modules||{}).basis){e.next=3;break}return e.abrupt("return",i.basis);case 3:return Bw=Bw||Fw(t),e.next=6,Bw;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fw(e){return Ew.apply(this,arguments)}function Ew(){return(Ew=o(r().mark((function e(t){var i,s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null,s=null,e.t0=Promise,e.next=5,vw("basis_transcoder.js","textures",t);case 5:return e.t1=e.sent,e.next=8,vw("basis_transcoder.wasm","textures",t);case 8:return e.t2=e.sent,e.t3=[e.t1,e.t2],e.next=12,e.t0.all.call(e.t0,e.t3);case 12:return n=e.sent,o=u(n,2),i=o[0],s=o[1],i=i||globalThis.BASIS,e.next=19,Dw(i,s);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Dw(e,t){var i={};return t&&(i.wasmBinary=t),new Promise((function(t){e(i).then((function(e){var i=e.BasisFile;(0,e.initializeBasis)(),t({BasisFile:i})}))}))}function Iw(e){return Sw.apply(this,arguments)}function Sw(){return(Sw=o(r().mark((function e(t){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=t.modules||{}).basisEncoder){e.next=3;break}return e.abrupt("return",i.basisEncoder);case 3:return xw=xw||Tw(t),e.next=6,xw;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tw(e){return Lw.apply(this,arguments)}function Lw(){return(Lw=o(r().mark((function e(t){var i,s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null,s=null,e.t0=Promise,e.next=5,vw(Cw,"textures",t);case 5:return e.t1=e.sent,e.next=8,vw(Pw,"textures",t);case 8:return e.t2=e.sent,e.t3=[e.t1,e.t2],e.next=12,e.t0.all.call(e.t0,e.t3);case 12:return n=e.sent,o=u(n,2),i=o[0],s=o[1],i=i||globalThis.BASIS,e.next=19,Rw(i,s);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rw(e,t){var i={};return t&&(i.wasmBinary=t),new Promise((function(t){e(i).then((function(e){var i=e.BasisFile,s=e.KTX2File,r=e.initializeBasis,n=e.BasisEncoder;r(),t({BasisFile:i,KTX2File:s,BasisEncoder:n})}))}))}var Uw,Ow,Qw,Nw,Vw,Hw,jw,Gw,zw,Ww=33776,Kw=33779,Xw=35840,Yw=35842,Jw=36196,Zw=37808,qw=["","WEBKIT_","MOZ_"],$w={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},eP=null;function tP(e){if(!eP){e=e||function(){try{return document.createElement("canvas").getContext("webgl")}catch(e){return null}}()||void 0,eP=new Set;var t,i=l(qw);try{for(i.s();!(t=i.n()).done;){var s=t.value;for(var r in $w)if(e&&e.getExtension("".concat(s).concat(r))){var n=$w[r];eP.add(n)}}}catch(e){i.e(e)}finally{i.f()}}return eP}(zw=Uw||(Uw={}))[zw.NONE=0]="NONE",zw[zw.BASISLZ=1]="BASISLZ",zw[zw.ZSTD=2]="ZSTD",zw[zw.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(Ow||(Ow={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(Qw||(Qw={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(Nw||(Nw={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(Vw||(Vw={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(Hw||(Hw={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(jw||(jw={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(Gw||(Gw={}));var iP=[171,75,84,88,32,50,48,187,13,10,26,10];function sP(e){var t=new Uint8Array(e);return!(t.byteLength<iP.length||t[0]!==iP[0]||t[1]!==iP[1]||t[2]!==iP[2]||t[3]!==iP[3]||t[4]!==iP[4]||t[5]!==iP[5]||t[6]!==iP[6]||t[7]!==iP[7]||t[8]!==iP[8]||t[9]!==iP[9]||t[10]!==iP[10]||t[11]!==iP[11])}var rP={etc1:{basisFormat:0,compressed:!0,format:Jw},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Ww},bc3:{basisFormat:3,compressed:!0,format:Kw},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:Xw},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Yw},"astc-4x4":{basisFormat:10,compressed:!0,format:Zw},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function nP(){return(nP=o(r().mark((function e(t,i){var s,n,o,a,l,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("auto"!==i.basis.containerFormat){e.next=11;break}if(!sP(t)){e.next=6;break}return e.next=4,Iw(i);case 4:return s=e.sent,e.abrupt("return",lP(s.KTX2File,t,i));case 6:return e.next=8,Mw(i);case 8:return n=e.sent,o=n.BasisFile,e.abrupt("return",oP(o,t,i));case 11:e.t0=i.basis.module,e.next="encoder"===e.t0?14:(e.t0,22);break;case 14:return e.next=16,Iw(i);case 16:a=e.sent,e.t1=i.basis.containerFormat,e.next="ktx2"===e.t1?20:(e.t1,21);break;case 20:return e.abrupt("return",lP(a.KTX2File,t,i));case 21:return e.abrupt("return",oP(a.BasisFile,t,i));case 22:return e.next=24,Mw(i);case 24:return l=e.sent,u=l.BasisFile,e.abrupt("return",oP(u,t,i));case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oP(e,t,i){var s=new e(new Uint8Array(t));try{if(!s.startTranscoding())throw new Error("Failed to start basis transcoding");for(var r=s.getNumImages(),n=[],o=0;o<r;o++){for(var a=s.getNumLevels(o),l=[],u=0;u<a;u++)l.push(aP(s,o,u,i));n.push(l)}return n}finally{s.close(),s.delete()}}function aP(e,t,i,s){var r=e.getImageWidth(t,i),n=e.getImageHeight(t,i),o=e.getHasAlpha(),a=AP(s,o),l=a.compressed,u=a.format,A=a.basisFormat,c=e.getImageTranscodedSizeInBytes(t,i,A),h=new Uint8Array(c);if(!e.transcodeImage(h,t,i,A,0,0))throw new Error("failed to start Basis transcoding");return{width:r,height:n,data:h,compressed:l,format:u,hasAlpha:o}}function lP(e,t,i){var s=new e(new Uint8Array(t));try{if(!s.startTranscoding())throw new Error("failed to start KTX2 transcoding");for(var r=s.getLevels(),n=[],o=0;o<r;o++){n.push(uP(s,o,i));break}return[n]}finally{s.close(),s.delete()}}function uP(e,t,i){var s=e.getImageLevelInfo(t,0,0),r=s.alphaFlag,n=s.height,o=s.width,a=AP(i,r),l=a.compressed,u=a.format,A=a.basisFormat,c=e.getImageTranscodedSizeInBytes(t,0,0,A),h=new Uint8Array(c);if(!e.transcodeImage(h,t,0,0,A,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:n,data:h,compressed:l,levelSize:c,hasAlpha:r,format:u}}function AP(e,t){var i=e&&e.basis&&e.basis.format;return"auto"===i&&(i=cP()),"object"===b(i)&&(i=t?i.alpha:i.noAlpha),i=i.toLowerCase(),rP[i]}function cP(){var e=tP();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}var hP=s(s({},{name:"Basis",id:lw?"basis":"basis-nodejs",module:"textures",version:"3.4.15",worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}}),{},{parse:function(e,t){return nP.apply(this,arguments)}});function dP(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var pP=Boolean("object"!==("undefined"==typeof process?"undefined":b(process))||"[object process]"!==String(process)||process.browser),fP="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);fP&&parseFloat(fP[1]);var vP=globalThis._parseImageNode,gP="undefined"!=typeof Image,mP="undefined"!=typeof ImageBitmap,_P=Boolean(vP),yP=!!pP||_P;function bP(e){var t=function(e){if("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap)return"imagebitmap";if("undefined"!=typeof Image&&e instanceof Image)return"image";if(e&&"object"===b(e)&&e.data&&e.width&&e.height)return"data";return null}(e);if(!t)throw new Error("Not an image");return t}function BP(e){switch(bP(e)){case"data":return e;case"image":case"imagebitmap":var t=document.createElement("canvas"),i=t.getContext("2d");if(!i)throw new Error("getImageData");return t.width=e.width,t.height=e.height,i.drawImage(e,0,0),i.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}var xP=/^data:image\/svg\+xml/,wP=/\.svg((\?|#).*)?$/;function PP(e){return e&&(xP.test(e)||wP.test(e))}function CP(e,t){if(PP(t)){var i=(new TextDecoder).decode(e);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(i=unescape(encodeURIComponent(i)))}catch(e){throw new Error(e.message)}return"data:image/svg+xml;base64,".concat(btoa(i))}return MP(e,t)}function MP(e,t){if(PP(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function kP(e,t,i){return FP.apply(this,arguments)}function FP(){return(FP=o(r().mark((function e(t,i,s){var n,o,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=CP(t,s),o=self.URL||self.webkitURL,a="string"!=typeof n&&o.createObjectURL(n),e.prev=3,e.next=6,EP(a||n,i);case 6:return e.abrupt("return",e.sent);case 7:return e.prev=7,a&&o.revokeObjectURL(a),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[3,,7,10]])})))).apply(this,arguments)}function EP(e,t){return DP.apply(this,arguments)}function DP(){return DP=o(r().mark((function e(t,i){var s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((s=new Image).src=t,!(i.image&&i.image.decode&&s.decode)){e.next=6;break}return e.next=5,s.decode();case 5:return e.abrupt("return",s);case 6:return e.next=8,new Promise((function(e,i){try{s.onload=function(){return e(s)},s.onerror=function(e){return i(new Error("Could not load image ".concat(t,": ").concat(e)))}}catch(e){i(e)}}));case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)}))),DP.apply(this,arguments)}var IP={},SP=!0;function TP(e,t,i){return LP.apply(this,arguments)}function LP(){return(LP=o(r().mark((function e(t,i,s){var n,o,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!PP(s)){e.next=7;break}return e.next=3,kP(t,i,s);case 3:o=e.sent,n=o,e.next=8;break;case 7:n=MP(t,s);case 8:return a=i&&i.imagebitmap,e.next=11,RP(n,a);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function RP(e){return UP.apply(this,arguments)}function UP(){return UP=o(r().mark((function e(t){var i,s=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!OP(i=s.length>1&&void 0!==s[1]?s[1]:null)&&SP||(i=null),!i){e.next=13;break}return e.prev=3,e.next=6,createImageBitmap(t,i);case 6:return e.abrupt("return",e.sent);case 9:e.prev=9,e.t0=e.catch(3),console.warn(e.t0),SP=!1;case 13:return e.next=15,createImageBitmap(t);case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e,null,[[3,9]])}))),UP.apply(this,arguments)}function OP(e){for(var t in e||IP)return!1;return!0}function QP(e){return function(e,t){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=(n=t,a(n).map((function(e){return e.charCodeAt(0)}))),r=0;r<s.length;++r)if(s[r]!==e[r+i])return!1;var n;return!0}(e,"ftyp",4)?0==(96&e[8])?null:function(e){switch((t=e,i=8,s=12,String.fromCharCode.apply(String,a(t.slice(i,s)))).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}var t,i,s}(e):null}var NP=!1,VP=!0;function HP(e){var t=jP(e);return function(e){var t=jP(e),i=t.byteLength>=24&&2303741511===t.getUint32(0,NP);if(!i)return null;return{mimeType:"image/png",width:t.getUint32(16,NP),height:t.getUint32(20,NP)}}(t)||function(e){var t=jP(e),i=t.byteLength>=3&&65496===t.getUint16(0,NP)&&255===t.getUint8(2);if(!i)return null;var s=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var i=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:i}}(),r=s.tableMarkers,n=s.sofMarkers,o=2;for(;o+9<t.byteLength;){var a=t.getUint16(o,NP);if(n.has(a))return{mimeType:"image/jpeg",height:t.getUint16(o+5,NP),width:t.getUint16(o+7,NP)};if(!r.has(a))return null;o+=2,o+=t.getUint16(o,NP)}return null}(t)||function(e){var t=jP(e),i=t.byteLength>=10&&1195984440===t.getUint32(0,NP);if(!i)return null;return{mimeType:"image/gif",width:t.getUint16(6,VP),height:t.getUint16(8,VP)}}(t)||function(e){var t=jP(e),i=t.byteLength>=14&&16973===t.getUint16(0,NP)&&t.getUint32(2,VP)===t.byteLength;if(!i)return null;return{mimeType:"image/bmp",width:t.getUint32(18,VP),height:t.getUint32(22,VP)}}(t)||function(e){var t=new Uint8Array(e instanceof DataView?e.buffer:e),i=QP(t);if(!i)return null;return{mimeType:i.mimeType,width:0,height:0}}(t)}function jP(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}function GP(e,t){return zP.apply(this,arguments)}function zP(){return zP=o(r().mark((function e(t,i){var s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=HP(t)||{},n=s.mimeType,dP(o=globalThis._parseImageNode),e.next=5,o(t,n);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),zP.apply(this,arguments)}function WP(){return(WP=o(r().mark((function e(t,i,s){var n,o,a,l,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=(i=i||{}).image||{},o=n.type||"auto",a=(s||{}).url,l=KP(o),e.t0=l,e.next="imagebitmap"===e.t0?8:"image"===e.t0?12:"data"===e.t0?16:20;break;case 8:return e.next=10,TP(t,i,a);case 10:return u=e.sent,e.abrupt("break",21);case 12:return e.next=14,kP(t,i,a);case 14:return u=e.sent,e.abrupt("break",21);case 16:return e.next=18,GP(t);case 18:return u=e.sent,e.abrupt("break",21);case 20:dP(!1);case 21:return"data"===o&&(u=BP(u)),e.abrupt("return",u);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function KP(e){switch(e){case"auto":case"data":return function(){if(mP)return"imagebitmap";if(gP)return"image";if(yP)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return mP||gP||yP;case"imagebitmap":return mP;case"image":return gP;case"data":return yP;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}var XP={id:"image",module:"images",name:"Images",version:"3.4.15",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],parse:function(e,t,i){return WP.apply(this,arguments)},tests:[function(e){return Boolean(HP(new DataView(e)))}],options:{image:{type:"auto",decode:!0}}},YP={};function JP(e){if(void 0===YP[e]){var t=pP?function(e){switch(e){case"image/avif":case"image/webp":return function(e){try{return 0===document.createElement("canvas").toDataURL(e).indexOf("data:".concat(e))}catch(e){return!1}}(e);default:return!0}}(e):function(e){var t=["image/png","image/jpeg","image/gif"],i=globalThis._parseImageNode,s=globalThis._imageFormatsNode,r=void 0===s?t:s;return Boolean(i)&&r.includes(e)}(e);YP[e]=t}return YP[e]}function ZP(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function qP(e,t,i){if(e.byteLength<=t+i)return"";for(var s=new DataView(e),r="",n=0;n<i;n++)r+=String.fromCharCode(s.getUint8(t+n));return r}function $P(e){try{return JSON.parse(e)}catch(t){throw new Error('Failed to parse JSON from data starting with "'.concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return qP(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer)return qP(e,0,t);return""}(e),'"'))}}function eC(e,t,i){var s=void 0!==i?new Uint8Array(e).subarray(t,t+i):new Uint8Array(e).subarray(t);return new Uint8Array(s).buffer}function tC(e,t){return ZP(e>=0),ZP(t>0),e+(t-1)&~(t-1)}function iC(e,t,i){var s;if(e instanceof ArrayBuffer)s=new Uint8Array(e);else{var r=e.byteOffset,n=e.byteLength;s=new Uint8Array(e.buffer||e.arrayBuffer,r,n)}return t.set(s,i),i+tC(s.byteLength,4)}function sC(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function rC(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;var i=t.baseUri||t.uri;if(!i)throw new Error("'baseUri' must be provided to resolve relative url ".concat(e));return i.substr(0,i.lastIndexOf("/")+1)+e}function nC(e,t,i){var s=e.bufferViews[i];sC(s);var r=t[s.buffer];sC(r);var n=(s.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,s.byteLength)}var oC=["SCALAR","VEC2","VEC3","VEC4"],aC=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],lC=new Map(aC),uC={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},AC={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},cC={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function hC(e){return oC[e-1]||oC[0]}function dC(e){var t=lC.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function pC(e,t){var i=cC[e.componentType],s=uC[e.type],r=AC[e.componentType],n=e.count*s,o=e.count*s*r;return sC(o>=0&&o<=t.byteLength),{ArrayType:i,length:n,byteLength:o}}var fC,vC={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},gC=function(){return w((function e(t){B(this,e),Wb(this,"gltf",void 0),Wb(this,"sourceBuffers",void 0),Wb(this,"byteLength",void 0),this.gltf=t||{json:s({},vC),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}),[{key:"json",get:function(){return this.gltf.json}},{key:"getApplicationData",value:function(e){return this.json[e]}},{key:"getExtraData",value:function(e){return(this.json.extras||{})[e]}},{key:"getExtension",value:function(e){var t=this.getUsedExtensions().find((function(t){return t===e})),i=this.json.extensions||{};return t?i[e]||!0:null}},{key:"getRequiredExtension",value:function(e){var t=this.getRequiredExtensions().find((function(t){return t===e}));return t?this.getExtension(e):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getRemovedExtensions",value:function(){return this.json.extensionsRemoved||[]}},{key:"getObjectExtension",value:function(e,t){return(e.extensions||{})[t]}},{key:"getScene",value:function(e){return this.getObject("scenes",e)}},{key:"getNode",value:function(e){return this.getObject("nodes",e)}},{key:"getSkin",value:function(e){return this.getObject("skins",e)}},{key:"getMesh",value:function(e){return this.getObject("meshes",e)}},{key:"getMaterial",value:function(e){return this.getObject("materials",e)}},{key:"getAccessor",value:function(e){return this.getObject("accessors",e)}},{key:"getTexture",value:function(e){return this.getObject("textures",e)}},{key:"getSampler",value:function(e){return this.getObject("samplers",e)}},{key:"getImage",value:function(e){return this.getObject("images",e)}},{key:"getBufferView",value:function(e){return this.getObject("bufferViews",e)}},{key:"getBuffer",value:function(e){return this.getObject("buffers",e)}},{key:"getObject",value:function(e,t){if("object"===b(t))return t;var i=this.json[e]&&this.json[e][t];if(!i)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return i}},{key:"getTypedArrayForBufferView",value:function(e){var t=(e=this.getBufferView(e)).buffer,i=this.gltf.buffers[t];sC(i);var s=(e.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,s,e.byteLength)}},{key:"getTypedArrayForAccessor",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),i=this.getBuffer(t.buffer).data,s=pC(e,t),r=s.ArrayType,n=s.length;return new r(i,t.byteOffset+e.byteOffset,n)}},{key:"getTypedArrayForImageData",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),i=this.getBuffer(t.buffer).data,s=t.byteOffset||0;return new Uint8Array(i,s,t.byteLength)}},{key:"addApplicationData",value:function(e,t){return this.json[e]=t,this}},{key:"addExtraData",value:function(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}},{key:"addObjectExtension",value:function(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}},{key:"setObjectExtension",value:function(e,t,i){(e.extensions||{})[t]=i}},{key:"removeObjectExtension",value:function(e,t){var i=e.extensions||{},s=i[t];return delete i[t],s}},{key:"addExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return sC(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}},{key:"addRequiredExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return sC(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}},{key:"registerUsedExtension",value:function(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((function(t){return t===e}))||this.json.extensionsUsed.push(e)}},{key:"registerRequiredExtension",value:function(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((function(t){return t===e}))||this.json.extensionsRequired.push(e)}},{key:"removeExtension",value:function(e){if(this.getExtension(e)){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e],Array.isArray(this.json.extensionsRemoved)||(this.json.extensionsRemoved=[]);var t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}}},{key:"setDefaultScene",value:function(e){this.json.scene=e}},{key:"addScene",value:function(e){var t=e.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}},{key:"addNode",value:function(e){var t=e.meshIndex,i=e.matrix;this.json.nodes=this.json.nodes||[];var s={mesh:t};return i&&(s.matrix=i),this.json.nodes.push(s),this.json.nodes.length-1}},{key:"addMesh",value:function(e){var t=e.attributes,i=e.indices,s=e.material,r=e.mode,n=void 0===r?4:r,o={primitives:[{attributes:this._addAttributes(t),mode:n}]};if(i){var a=this._addIndices(i);o.primitives[0].indices=a}return Number.isFinite(s)&&(o.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}},{key:"addPointCloud",value:function(e){var t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}},{key:"addImage",value:function(e,t){var i=HP(e),s=t||(null==i?void 0:i.mimeType),r={bufferView:this.addBufferView(e),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}},{key:"addBufferView",value:function(e){var t=e.byteLength;sC(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=tC(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(e,t){var i={bufferView:e,type:hC(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}},{key:"addBinaryBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3},i=this.addBufferView(e),s={min:t.min,max:t.max};s.min&&s.max||(s=this._getAccessorMinMax(e,t.size));var r={size:t.size,componentType:dC(e),count:Math.round(e.length/t.size),min:s.min,max:s.max};return this.addAccessor(i,Object.assign(r,t))}},{key:"addTexture",value:function(e){var t={source:e.imageIndex};return this.json.textures=this.json.textures||[],this.json.textures.push(t),this.json.textures.length-1}},{key:"addMaterial",value:function(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var e,t;this.gltf.buffers=[];var i,s=this.byteLength,r=new ArrayBuffer(s),n=new Uint8Array(r),o=0,a=l(this.sourceBuffers||[]);try{for(a.s();!(i=a.n()).done;){o=iC(i.value,n,o)}}catch(e){a.e(e)}finally{a.f()}null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=s:this.json.buffers=[{byteLength:s}],this.gltf.binary=r,this.sourceBuffers=[r]}},{key:"_removeStringFromArray",value:function(e,t){for(var i=!0;i;){var s=e.indexOf(t);s>-1?e.splice(s,1):i=!1}}},{key:"_addAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};for(var i in e){var s=e[i],r=this._getGltfAttributeName(i),n=this.addBinaryBuffer(s.value,s);t[r]=n}return t}},{key:"_addIndices",value:function(e){return this.addBinaryBuffer(e,{size:1})}},{key:"_getGltfAttributeName",value:function(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}},{key:"_getAccessorMinMax",value:function(e,t){var i={min:null,max:null};if(e.length<t)return i;i.min=[],i.max=[];var s,r=l(e.subarray(0,t));try{for(r.s();!(s=r.n()).done;){var n=s.value;i.min.push(n),i.max.push(n)}}catch(e){r.e(e)}finally{r.f()}for(var o=t;o<e.length;o+=t)for(var a=0;a<t;a++)i.min[0+a]=Math.min(i.min[0+a],e[o+a]),i.max[0+a]=Math.max(i.max[0+a],e[o+a]);return i}}])}(),mC="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9t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FD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",yC=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),bC=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),BC={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},xC={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};function wC(e,t,i,s,r){return PC.apply(this,arguments)}function PC(){return PC=o(r().mark((function e(t,i,s,n,o){var a,l,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.length>5&&void 0!==u[5]?u[5]:"NONE",e.next=3,CC();case 3:DC(l=e.sent,l.exports[xC[o]],t,i,s,n,l.exports[BC[a||"NONE"]]);case 5:case"end":return e.stop()}}),e)}))),PC.apply(this,arguments)}function CC(){return MC.apply(this,arguments)}function MC(){return(MC=o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return fC||(fC=kC()),e.abrupt("return",fC);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kC(){return FC.apply(this,arguments)}function FC(){return(FC=o(r().mark((function e(){var t,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=mC,WebAssembly.validate(yC)&&(t=_C,console.log("Warning: meshopt_decoder is using experimental SIMD support")),e.next=4,WebAssembly.instantiate(EC(t),{});case 4:return i=e.sent,e.next=7,i.instance.exports.__wasm_call_ctors();case 7:return e.abrupt("return",i.instance);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function EC(e){for(var t=new Uint8Array(e.length),i=0;i<e.length;++i){var s=e.charCodeAt(i);t[i]=s>96?s-71:s>64?s-65:s>47?s+4:s>46?63:62}for(var r=0,n=0;n<e.length;++n)t[r++]=t[n]<60?bC[t[n]]:64*(t[n]-60)+t[++n];return t.buffer.slice(0,r)}function DC(e,t,i,s,r,n,o){var a=e.exports.sbrk,l=s+3&-4,u=a(l*r),A=a(n.length),c=new Uint8Array(e.exports.memory.buffer);c.set(n,A);var h=t(u,s,r,A,n.length);if(0===h&&o&&o(u,l,r),i.set(c.subarray(u,u+s*r)),a(u-a(0)),0!==h)throw new Error("Malformed buffer data: ".concat(h))}var IC="EXT_meshopt_compression",SC=IC;function TC(){return(TC=o(r().mark((function e(t,i){var s,n,o,a,u,A;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=new gC(t),null!=i&&null!==(s=i.gltf)&&void 0!==s&&s.decompressMeshes){e.next=3;break}return e.abrupt("return");case 3:o=[],a=l(t.json.bufferViews||[]);try{for(a.s();!(u=a.n()).done;)A=u.value,o.push(LC(n,A))}catch(e){a.e(e)}finally{a.f()}return e.next=8,Promise.all(o);case 8:n.removeExtension(IC);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function LC(e,t){return RC.apply(this,arguments)}function RC(){return(RC=o(r().mark((function e(t,i){var s,n,o,a,l,u,A,c,h,d,p,f,v,g;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(s=t.getObjectExtension(i,IC))){e.next=9;break}return n=s.byteOffset,o=void 0===n?0:n,a=s.byteLength,l=void 0===a?0:a,u=s.byteStride,A=s.count,c=s.mode,h=s.filter,d=void 0===h?"NONE":h,p=s.buffer,f=t.gltf.buffers[p],v=new Uint8Array(f.arrayBuffer,f.byteOffset+o,l),g=new Uint8Array(t.gltf.buffers[i.buffer].arrayBuffer,i.byteOffset,i.byteLength),e.next=8,wC(g,A,u,v,c,d);case 8:return e.abrupt("return",g);case 9:return e.abrupt("return",null);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var UC=Object.freeze({__proto__:null,name:SC,decode:function(e,t){return TC.apply(this,arguments)}}),OC="EXT_texture_webp",QC=OC;var NC=Object.freeze({__proto__:null,name:QC,preprocess:function(e,t){var i=new gC(e);if(JP("image/webp")){var s,r=l(i.json.textures||[]);try{for(r.s();!(s=r.n()).done;){var n=s.value,o=i.getObjectExtension(n,OC);o&&(n.source=o.source),i.removeObjectExtension(n,OC)}}catch(e){r.e(e)}finally{r.f()}i.removeExtension(OC)}else if(i.getRequiredExtensions().includes(OC))throw new Error("gltf: Required extension ".concat(OC," not supported by browser"))}}),VC="KHR_texture_basisu",HC=VC;var jC=Object.freeze({__proto__:null,name:HC,preprocess:function(e,t){var i,s=new gC(e),r=l(s.json.textures||[]);try{for(r.s();!(i=r.n()).done;){var n=i.value,o=s.getObjectExtension(n,VC);o&&(n.source=o.source),s.removeObjectExtension(n,VC)}}catch(e){r.e(e)}finally{r.f()}s.removeExtension(VC)}});var GC={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},zC=GC.global||GC.self||GC.window||{},WC="object"!==("undefined"==typeof process?"undefined":b(process))||"[object process]"!==String(process)||process.browser,KC="function"==typeof importScripts,XC="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);XC&&parseFloat(XC[1]);var YC=null,JC=null,ZC=Object.freeze({__proto__:null,readFileAsArrayBuffer:null,readFileAsText:null,requireFromFile:YC,requireFromString:JC}),qC="3.4.15",$C={};function eM(e){return tM.apply(this,arguments)}function tM(){return tM=o(r().mark((function e(t){var i,s,n=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.length>2&&void 0!==n[2]?n[2]:{},(i=n.length>1&&void 0!==n[1]?n[1]:null)&&(t=iM(t,i,s)),$C[t]=$C[t]||sM(t),e.next=6,$C[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)}))),tM.apply(this,arguments)}function iM(e,t,i){if(e.startsWith("http"))return e;var s=i.modules||{};return s[e]?s[e]:WC?i.CDN?(function(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}(i.CDN.startsWith("http")),"".concat(i.CDN,"/").concat(t,"@").concat(qC,"/dist/libs/").concat(e)):KC?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function sM(e){return rM.apply(this,arguments)}function rM(){return(rM=o(r().mark((function e(t){var i,s,n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.endsWith("wasm")){e.next=7;break}return e.next=3,fetch(t);case 3:return i=e.sent,e.next=6,i.arrayBuffer();case 6:return e.abrupt("return",e.sent);case 7:if(WC){e.next=20;break}if(e.prev=8,e.t0=ZC&&YC,!e.t0){e.next=14;break}return e.next=13,YC(t);case 13:e.t0=e.sent;case 14:return e.abrupt("return",e.t0);case 17:return e.prev=17,e.t1=e.catch(8),e.abrupt("return",null);case 20:if(!KC){e.next=22;break}return e.abrupt("return",importScripts(t));case 22:return e.next=24,fetch(t);case 24:return s=e.sent,e.next=27,s.text();case 27:return n=e.sent,e.abrupt("return",nM(n,t));case 29:case"end":return e.stop()}}),e,null,[[8,17]])})))).apply(this,arguments)}function nM(e,t){if(!WC)return JC;if(KC)return eval.call(zC,e),null;var i=document.createElement("script");i.id=t;try{i.appendChild(document.createTextNode(e))}catch(t){i.text=e}return document.body.appendChild(i),null}var oM="3.4.15",aM={draco:{decoderType:"object"===("undefined"==typeof WebAssembly?"undefined":b(WebAssembly))?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},lM={name:"Draco",id:WC?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:oM,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:aM};var uM=function(){function e(t,i){B(this,e),Wb(this,"fields",void 0),Wb(this,"metadata",void 0),function(e,t){if(!e)throw new Error(t||"loader assertion failed.")}(Array.isArray(t)),function(e){var t,i={},s=l(e);try{for(s.s();!(t=s.n()).done;){var r=t.value;i[r.name]&&console.warn("Schema: duplicated field name",r.name,r),i[r.name]=!0}}catch(e){s.e(e)}finally{s.f()}}(t),this.fields=t,this.metadata=i||new Map}return w(e,[{key:"compareTo",value:function(e){if(this.metadata!==e.metadata)return!1;if(this.fields.length!==e.fields.length)return!1;for(var t=0;t<this.fields.length;++t)if(!this.fields[t].compareTo(e.fields[t]))return!1;return!0}},{key:"select",value:function(){for(var t=Object.create(null),i=arguments.length,s=new Array(i),r=0;r<i;r++)s[r]=arguments[r];for(var n=0,o=s;n<o.length;n++){var a=o[n];t[a]=!0}return new e(this.fields.filter((function(e){return t[e.name]})),this.metadata)}},{key:"selectAt",value:function(){for(var t=this,i=arguments.length,s=new Array(i),r=0;r<i;r++)s[r]=arguments[r];return new e(s.map((function(e){return t.fields[e]})).filter(Boolean),this.metadata)}},{key:"assign",value:function(t){var i,s=this.metadata;if(t instanceof e){var r=t;i=r.fields,s=AM(AM(new Map,this.metadata),r.metadata)}else i=t;var n,o=Object.create(null),a=l(this.fields);try{for(a.s();!(n=a.n()).done;){var u=n.value;o[u.name]=u}}catch(e){a.e(e)}finally{a.f()}var A,c=l(i);try{for(c.s();!(A=c.n()).done;){var h=A.value;o[h.name]=h}}catch(e){c.e(e)}finally{c.f()}return new e(Object.values(o),s)}}])}();function AM(e,t){return new Map([].concat(a(e||new Map),a(t||new Map)))}var cM=function(){function e(t,i){B(this,e);var s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;Wb(this,"name",void 0),Wb(this,"type",void 0),Wb(this,"nullable",void 0),Wb(this,"metadata",void 0),this.name=t,this.type=i,this.nullable=s,this.metadata=r}return w(e,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new e(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}])}(),hM=function(e){return e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e}({}),dM=function(){return w((function e(){B(this,e)}),[{key:"typeId",get:function(){return hM.NONE}},{key:"compareTo",value:function(e){return this===e}}],[{key:"isNull",value:function(e){return e&&e.typeId===hM.Null}},{key:"isInt",value:function(e){return e&&e.typeId===hM.Int}},{key:"isFloat",value:function(e){return e&&e.typeId===hM.Float}},{key:"isBinary",value:function(e){return e&&e.typeId===hM.Binary}},{key:"isUtf8",value:function(e){return e&&e.typeId===hM.Utf8}},{key:"isBool",value:function(e){return e&&e.typeId===hM.Bool}},{key:"isDecimal",value:function(e){return e&&e.typeId===hM.Decimal}},{key:"isDate",value:function(e){return e&&e.typeId===hM.Date}},{key:"isTime",value:function(e){return e&&e.typeId===hM.Time}},{key:"isTimestamp",value:function(e){return e&&e.typeId===hM.Timestamp}},{key:"isInterval",value:function(e){return e&&e.typeId===hM.Interval}},{key:"isList",value:function(e){return e&&e.typeId===hM.List}},{key:"isStruct",value:function(e){return e&&e.typeId===hM.Struct}},{key:"isUnion",value:function(e){return e&&e.typeId===hM.Union}},{key:"isFixedSizeBinary",value:function(e){return e&&e.typeId===hM.FixedSizeBinary}},{key:"isFixedSizeList",value:function(e){return e&&e.typeId===hM.FixedSizeList}},{key:"isMap",value:function(e){return e&&e.typeId===hM.Map}},{key:"isDictionary",value:function(e){return e&&e.typeId===hM.Dictionary}}])}(),pM=function(e,t){function i(e,t){var s;return B(this,i),Wb(s=h(this,i),"isSigned",void 0),Wb(s,"bitWidth",void 0),s.isSigned=e,s.bitWidth=t,s}return m(i,dM),w(i,[{key:"typeId",get:function(){return hM.Int}},{key:t,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}])}(0,Symbol.toStringTag),fM=function(e){function t(){return B(this,t),h(this,t,[!0,8])}return m(t,pM),w(t)}(),vM=function(e){function t(){return B(this,t),h(this,t,[!0,16])}return m(t,pM),w(t)}(),gM=function(e){function t(){return B(this,t),h(this,t,[!0,32])}return m(t,pM),w(t)}(),mM=function(e){function t(){return B(this,t),h(this,t,[!1,8])}return m(t,pM),w(t)}(),_M=function(e){function t(){return B(this,t),h(this,t,[!1,16])}return m(t,pM),w(t)}(),yM=function(e){function t(){return B(this,t),h(this,t,[!1,32])}return m(t,pM),w(t)}(),bM=32,BM=64,xM=function(e,t){function i(e){var t;return B(this,i),Wb(t=h(this,i),"precision",void 0),t.precision=e,t}return m(i,dM),w(i,[{key:"typeId",get:function(){return hM.Float}},{key:t,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}])}(0,Symbol.toStringTag),wM=function(e){function t(){return B(this,t),h(this,t,[bM])}return m(t,xM),w(t)}(),PM=function(e){function t(){return B(this,t),h(this,t,[BM])}return m(t,xM),w(t)}(),CM=function(e,t){function i(e,t){var s;return B(this,i),Wb(s=h(this,i),"listSize",void 0),Wb(s,"children",void 0),s.listSize=e,s.children=[t],s}return m(i,dM),w(i,[{key:"typeId",get:function(){return hM.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:t,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}])}(0,Symbol.toStringTag);function MM(e,t,i){var s=function(e){switch(e.constructor){case Int8Array:return new fM;case Uint8Array:return new mM;case Int16Array:return new vM;case Uint16Array:return new _M;case Int32Array:return new gM;case Uint32Array:return new yM;case Float32Array:return new wM;case Float64Array:return new PM;default:throw new Error("array type not supported")}}(t.value),r=i||function(e){var t=new Map;"byteOffset"in e&&t.set("byteOffset",e.byteOffset.toString(10));"byteStride"in e&&t.set("byteStride",e.byteStride.toString(10));"normalized"in e&&t.set("normalized",e.normalized.toString());return t}(t);return new cM(e,new CM(t.size,new cM("value",s)),!1,r)}function kM(e,t,i){return MM(e,t,i?FM(i.metadata):void 0)}function FM(e){var t=new Map;for(var i in e)t.set("".concat(i,".string"),JSON.stringify(e[i]));return t}var EM={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},DM={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},IM=function(){return w((function e(t){B(this,e),Wb(this,"draco",void 0),Wb(this,"decoder",void 0),Wb(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}),[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);var r=this.decoder.GetEncodedGeometryType(i),n=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,n);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,n);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!n.ptr){var a="DRACO decompression failed: ".concat(o.error_msg());throw new Error(a)}var l=this._getDracoLoaderData(n,r,t),u=this._getMeshData(n,l,t),A=function(e){for(var t=1/0,i=1/0,s=1/0,r=-1/0,n=-1/0,o=-1/0,a=e.POSITION?e.POSITION.value:[],l=a&&a.length,u=0;u<l;u+=3){var A=a[u],c=a[u+1],h=a[u+2];t=A<t?A:t,i=c<i?c:i,s=h<s?h:s,r=A>r?A:r,n=c>n?c:n,o=h>o?h:o}return[[t,i,s],[r,n,o]]}(u.attributes),c=function(e,t,i){var s=FM(t.metadata),r=[],n=function(e){var t={};for(var i in e){var s=e[i];t[s.name||"undefined"]=s}return t}(t.attributes);for(var o in e){var a=kM(o,e[o],n[o]);r.push(a)}if(i){var l=kM("indices",i);r.push(l)}return new uM(r,s)}(u.attributes,l,u.indices);return s(s({loader:"draco",loaderData:l,header:{vertexCount:n.num_points(),boundingBox:A}},u),{},{schema:c})}finally{this.draco.destroy(i),n&&this.draco.destroy(n)}}},{key:"_getDracoLoaderData",value:function(e,t,i){var s=this._getTopLevelMetadata(e),r=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:s,attributes:r}}},{key:"_getDracoAttributes",value:function(e,t){for(var i={},s=0;s<e.num_attributes();s++){var r=this.decoder.GetAttribute(e,s),n=this._getAttributeMetadata(e,s);i[r.unique_id()]={unique_id:r.unique_id(),attribute_type:r.attribute_type(),data_type:r.data_type(),num_components:r.num_components(),byte_offset:r.byte_offset(),byte_stride:r.byte_stride(),normalized:r.normalized(),attribute_index:s,metadata:n};var o=this._getQuantizationTransform(r,t);o&&(i[r.unique_id()].quantization_transform=o);var a=this._getOctahedronTransform(r,t);a&&(i[r.unique_id()].octahedron_transform=a)}return i}},{key:"_getMeshData",value:function(e,t,i){var s=this._getMeshAttributes(t,e,i);if(!s.POSITION)throw new Error("DRACO: No position attribute found.");return e instanceof this.draco.Mesh?"triangle-strip"===i.topology?{topology:"triangle-strip",mode:4,attributes:s,indices:{value:this._getTriangleStripIndices(e),size:1}}:{topology:"triangle-list",mode:5,attributes:s,indices:{value:this._getTriangleListIndices(e),size:1}}:{topology:"point-list",mode:0,attributes:s}}},{key:"_getMeshAttributes",value:function(e,t,i){for(var s={},r=0,n=Object.values(e.attributes);r<n.length;r++){var o=n[r],a=this._deduceAttributeName(o,i);o.name=a;var l=this._getAttributeValues(t,o),u=l.value,A=l.size;s[a]={value:u,size:A,byteOffset:o.byte_offset,byteStride:o.byte_stride,normalized:o.normalized}}return s}},{key:"_getTriangleListIndices",value:function(e){var t=3*e.num_faces(),i=4*t,s=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(e,i,s),new Uint32Array(this.draco.HEAPF32.buffer,s,t).slice()}finally{this.draco._free(s)}}},{key:"_getTriangleStripIndices",value:function(e){var t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),function(e){for(var t=e.size(),i=new Int32Array(t),s=0;s<t;s++)i[s]=e.GetValue(s);return i}(t)}finally{this.draco.destroy(t)}}},{key:"_getAttributeValues",value:function(e,t){var i,s=DM[t.data_type],r=t.num_components,n=e.num_points()*r,o=n*s.BYTES_PER_ELEMENT,a=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}(this.draco,s),l=this.draco._malloc(o);try{var u=this.decoder.GetAttribute(e,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,u,a,o,l),i=new s(this.draco.HEAPF32.buffer,l,n).slice()}finally{this.draco._free(l)}return{value:i,size:r}}},{key:"_deduceAttributeName",value:function(e,t){for(var i=e.unique_id,s=0,r=Object.entries(t.extraAttributes||{});s<r.length;s++){var n=u(r[s],2),o=n[0];if(n[1]===i)return o}var a=e.attribute_type;for(var l in EM){if(this.draco[l]===a)return EM[l]}var A=t.attributeNameEntry||"name";return e.metadata[A]?e.metadata[A].string:"CUSTOM_ATTRIBUTE_".concat(i)}},{key:"_getTopLevelMetadata",value:function(e){var t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}},{key:"_getAttributeMetadata",value:function(e,t){var i=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(i)}},{key:"_getDracoMetadata",value:function(e){if(!e||!e.ptr)return{};for(var t={},i=this.metadataQuerier.NumEntries(e),s=0;s<i;s++){var r=this.metadataQuerier.GetEntryName(e,s);t[r]=this._getDracoMetadataField(e,r)}return t}},{key:"_getDracoMetadataField",value:function(e,t){var i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,i);var s=function(e){for(var t=e.size(),i=new Int32Array(t),s=0;s<t;s++)i[s]=e.GetValue(s);return i}(i);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:s}}finally{this.draco.destroy(i)}}},{key:"_disableAttributeTransforms",value:function(e){var t,i=e.quantizedAttributes,s=void 0===i?[]:i,r=e.octahedronAttributes,n=void 0===r?[]:r,o=l([].concat(a(s),a(n)));try{for(o.s();!(t=o.n()).done;){var u=t.value;this.decoder.SkipAttributeTransform(this.draco[u])}}catch(e){o.e(e)}finally{o.f()}}},{key:"_getQuantizationTransform",value:function(e,t){var i=this,s=t.quantizedAttributes,r=void 0===s?[]:s,n=e.attribute_type();if(r.map((function(e){return i.decoder[e]})).includes(n)){var o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map((function(e){return o.min_value(e)}))}}finally{this.draco.destroy(o)}}return null}},{key:"_getOctahedronTransform",value:function(e,t){var i=this,s=t.octahedronAttributes,r=void 0===s?[]:s,n=e.attribute_type();if(r.map((function(e){return i.decoder[e]})).includes(n)){var o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}])}();var SM,TM="https://www.gstatic.com/draco/versioned/decoders/".concat("1.5.5"),LM="".concat(TM,"/draco_decoder.js"),RM="".concat(TM,"/draco_wasm_wrapper.js"),UM="".concat(TM,"/draco_decoder.wasm");function OM(e){return QM.apply(this,arguments)}function QM(){return(QM=o(r().mark((function e(t){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.modules||{},SM=i.draco3d?SM||i.draco3d.createDecoderModule({}).then((function(e){return{draco:e}})):SM||NM(t),e.next=4,SM;case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NM(e){return VM.apply(this,arguments)}function VM(){return(VM=o(r().mark((function e(t){var i,s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.draco&&t.draco.decoderType,e.next="js"===e.t0?3:(e.t0,7);break;case 3:return e.next=5,eM(LM,"draco",t);case 5:return i=e.sent,e.abrupt("break",21);case 7:return e.t1=Promise,e.next=10,eM(RM,"draco",t);case 10:return e.t2=e.sent,e.next=13,eM(UM,"draco",t);case 13:return e.t3=e.sent,e.t4=[e.t2,e.t3],e.next=17,e.t1.all.call(e.t1,e.t4);case 17:n=e.sent,o=u(n,2),i=o[0],s=o[1];case 21:return i=i||globalThis.DracoDecoderModule,e.next=24,HM(i,s);case 24:return e.abrupt("return",e.sent);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function HM(e,t){var i={};return t&&(i.wasmBinary=t),new Promise((function(t){e(s(s({},i),{},{onModuleLoaded:function(e){return t({draco:e})}}))}))}var jM=s(s({},lM),{},{parse:function(e,t){return GM.apply(this,arguments)}});function GM(){return(GM=o(r().mark((function e(t,i){var s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,OM(i);case 2:return s=e.sent,n=s.draco,o=new IM(n),e.prev=5,e.abrupt("return",o.parseSync(t,null==i?void 0:i.draco));case 7:return e.prev=7,o.destroy(),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[5,,7,10]])})))).apply(this,arguments)}function zM(e){var t={};for(var i in e){var s=e[i];if("indices"!==i){var r=WM(s);t[i]=r}}return t}function WM(e){var t=function(e){var t=e,i=1,s=0;e&&e.value&&(t=e.value,i=e.size||1);t&&(ArrayBuffer.isView(t)||(t=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return null;if(Array.isArray(e))return new t(e);if(i&&!(e instanceof t))return new t(e);return e}(t,Float32Array)),s=t.length/i);return{buffer:t,size:i,count:s}}(e),i=t.buffer,s=t.size;return{value:i,size:s,byteOffset:0,count:t.count,type:hC(s),componentType:dC(i)}}var KM="KHR_draco_mesh_compression",XM=KM;function YM(){return(YM=o(r().mark((function e(t,i,s){var n,o,a,u,A,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=i&&null!==(n=i.gltf)&&void 0!==n&&n.decompressMeshes){e.next=2;break}return e.abrupt("return");case 2:o=new gC(t),a=[],u=l(ek(o));try{for(u.s();!(A=u.n()).done;)c=A.value,o.getObjectExtension(c,KM)&&a.push(JM(o,c,i,s))}catch(e){u.e(e)}finally{u.f()}return e.next=8,Promise.all(a);case 8:o.removeExtension(KM);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function JM(e,t,i,s){return ZM.apply(this,arguments)}function ZM(){return ZM=o(r().mark((function e(t,i,n,o){var a,l,A,c,h,d,p,f,v,g,m,_,y,b;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.getObjectExtension(i,KM)){e.next=3;break}return e.abrupt("return");case 3:return l=t.getTypedArrayForBufferView(a.bufferView),A=eC(l.buffer,l.byteOffset),c=o.parse,delete(h=s({},n))["3d-tiles"],e.next=10,c(A,jM,h,o);case 10:for(d=e.sent,p=zM(d.attributes),f=0,v=Object.entries(p);f<v.length;f++)g=u(v[f],2),m=g[0],_=g[1],m in i.attributes&&(y=i.attributes[m],null!=(b=t.getAccessor(y))&&b.min&&null!=b&&b.max&&(_.min=b.min,_.max=b.max));i.attributes=p,d.indices&&(i.indices=WM(d.indices)),$M(i);case 16:case"end":return e.stop()}}),e)}))),ZM.apply(this,arguments)}function qM(e,t){var i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;if(!r.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var o=r.DracoWriter.encodeSync({attributes:e}),a=null==n||null===(i=n.parseSync)||void 0===i?void 0:i.call(n,{attributes:e}),l=r._addFauxAttributes(a.attributes),u=r.addBufferView(o);return{primitives:[{attributes:l,mode:s,extensions:y({},KM,{bufferView:u,attributes:l})}]}}function $M(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function ek(e){var i,s,n,o,a,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=l(e.json.meshes||[]),t.prev=1,i.s();case 3:if((s=i.n()).done){t.next=24;break}n=s.value,o=l(n.primitives),t.prev=6,o.s();case 8:if((a=o.n()).done){t.next=14;break}return u=a.value,t.next=12,u;case 12:t.next=8;break;case 14:t.next=19;break;case 16:t.prev=16,t.t0=t.catch(6),o.e(t.t0);case 19:return t.prev=19,o.f(),t.finish(19);case 22:t.next=3;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(1),i.e(t.t1);case 29:return t.prev=29,i.f(),t.finish(29);case 32:case"end":return t.stop()}}),t,null,[[1,26,29,32],[6,16,19,22]])}var tk=Object.freeze({__proto__:null,name:XM,preprocess:function(e,t,i){var s,r=new gC(e),n=l(ek(r));try{for(n.s();!(s=n.n()).done;){var o=s.value;r.getObjectExtension(o,KM)}}catch(e){n.e(e)}finally{n.f()}},decode:function(e,t,i){return YM.apply(this,arguments)},encode:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=new gC(e),r=l(s.json.meshes||[]);try{for(r.s();!(t=r.n()).done;){qM(t.value,i),s.addRequiredExtension(KM)}}catch(e){r.e(e)}finally{r.f()}}});function ik(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var sk={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function rk(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).precision,i=void 0===t?sk.precision:t;return e=function(e){return Math.round(e/sk.EPSILON)*sk.EPSILON}(e),"".concat(parseFloat(e.toPrecision(i)))}function nk(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ok(e,t,i){var s=sk.EPSILON;i&&(sk.EPSILON=i);try{if(e===t)return!0;if(nk(e)&&nk(t)){if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!ok(e[r],t[r]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):"number"==typeof e&&"number"==typeof t&&Math.abs(e-t)<=sk.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{sk.EPSILON=s}}function ak(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var lk=function(e){function t(){return B(this,t),h(this,t,arguments)}return m(t,ak(Array)),w(t,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<this.ELEMENTS;++i)this[i]=e[i+t];return this.check()}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<this.ELEMENTS;++i)e[t+i]=this[i];return e}},{key:"from",value:function(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}},{key:"to",value:function(e){return e===this?this:nk(e)?this.toArray(e):this.toObject(e)}},{key:"toTarget",value:function(e){return e?this.to(e):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(sk)}},{key:"formatString",value:function(e){for(var t="",i=0;i<this.ELEMENTS;++i)t+=(i>0?", ":"")+rk(this[i],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(!ok(this[t],e[t]))return!1;return!0}},{key:"exactEquals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}},{key:"negate",value:function(){for(var e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}},{key:"lerp",value:function(e,t,i){if(void 0===i)return this.lerp(this,e,t);for(var s=0;s<this.ELEMENTS;++s){var r=e[s];this[s]=r+i*(t[s]-r)}return this.check()}},{key:"min",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}},{key:"max",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}},{key:"clamp",value:function(e,t){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],e[i]),t[i]);return this.check()}},{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(var s=0,r=t;s<r.length;s++)for(var n=r[s],o=0;o<this.ELEMENTS;++o)this[o]+=n[o];return this.check()}},{key:"subtract",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(var s=0,r=t;s<r.length;s++)for(var n=r[s],o=0;o<this.ELEMENTS;++o)this[o]-=n[o];return this.check()}},{key:"scale",value:function(e){if("number"==typeof e)for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;else for(var i=0;i<this.ELEMENTS&&i<e.length;++i)this[i]*=e[i];return this.check()}},{key:"multiplyByScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"check",value:function(){if(sk.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var e=this.length===this.ELEMENTS,t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}},{key:"addScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}},{key:"subScalar",value:function(e){return this.addScalar(-e)}},{key:"multiplyScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"divideScalar",value:function(e){return this.multiplyByScalar(1/e)}},{key:"clampScalar",value:function(e,t){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],e),t);return this.check()}},{key:"elements",get:function(){return this}}])}();function uk(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function Ak(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(sk.debug&&!function(e,t){if(e.length!==t)return!1;for(var i=0;i<e.length;++i)if(!Number.isFinite(e[i]))return!1;return!0}(e,t))throw new Error("math.gl: ".concat(i," some fields set to invalid numbers'"));return e}var ck=function(e){function t(){return B(this,t),h(this,t,arguments)}return m(t,lk),w(t,[{key:"x",get:function(){return this[0]},set:function(e){this[0]=uk(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=uk(e)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(e){return Math.sqrt(this.distanceSquared(e))}},{key:"distanceSquared",value:function(e){for(var t=0,i=0;i<this.ELEMENTS;++i){var s=this[i]-e[i];t+=s*s}return uk(t)}},{key:"dot",value:function(e){for(var t=0,i=0;i<this.ELEMENTS;++i)t+=this[i]*e[i];return uk(t)}},{key:"normalize",value:function(){var e=this.magnitude();if(0!==e)for(var t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}},{key:"multiply",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(var s=0,r=t;s<r.length;s++)for(var n=r[s],o=0;o<this.ELEMENTS;++o)this[o]*=n[o];return this.check()}},{key:"divide",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(var s=0,r=t;s<r.length;s++)for(var n=r[s],o=0;o<this.ELEMENTS;++o)this[o]/=n[o];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(e){return this.distance(e)}},{key:"distanceToSquared",value:function(e){return this.distanceSquared(e)}},{key:"getComponent",value:function(e){return ik(e>=0&&e<this.ELEMENTS,"index is out of range"),uk(this[e])}},{key:"setComponent",value:function(e,t){return ik(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}},{key:"addVectors",value:function(e,t){return this.copy(e).add(t)}},{key:"subVectors",value:function(e,t){return this.copy(e).subtract(t)}},{key:"multiplyVectors",value:function(e,t){return this.copy(e).multiply(t)}},{key:"addScaledVector",value:function(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}])}(),hk="undefined"!=typeof Float32Array?Float32Array:Array;function dk(e,t,i){var s=t[0],r=t[1],n=t[2];return e[0]=s*i[0]+r*i[3]+n*i[6],e[1]=s*i[1]+r*i[4]+n*i[7],e[2]=s*i[2]+r*i[5]+n*i[8],e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)}),function(){var e,t=(e=new hk(2),hk!=Float32Array&&(e[0]=0,e[1]=0),e)}(),function(){var e,t=(e=new hk(3),hk!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e)}();var pk,fk,vk=[0,0,0],gk=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return B(this,t),e=h(this,t,[-0,-0,-0]),1===arguments.length&&nk(i)?e.copy(i):(sk.debug&&(uk(i),uk(s),uk(r)),e[0]=i,e[1]=s,e[2]=r),e}return m(t,ck),w(t,[{key:"set",value:function(e,t,i){return this[0]=e,this[1]=t,this[2]=i,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}},{key:"fromObject",value:function(e){return sk.debug&&(uk(e.x),uk(e.y),uk(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=uk(e)}},{key:"angle",value:function(e){return function(e,t){var i=e[0],s=e[1],r=e[2],n=t[0],o=t[1],a=t[2],l=Math.sqrt(i*i+s*s+r*r)*Math.sqrt(n*n+o*o+a*a),u=l&&function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}(e,t)/l;return Math.acos(Math.min(Math.max(u,-1),1))}(this,e)}},{key:"cross",value:function(e){return function(e,t,i){var s=t[0],r=t[1],n=t[2],o=i[0],a=i[1],l=i[2];e[0]=r*l-n*a,e[1]=n*o-s*l,e[2]=s*a-r*o}(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,i=e.origin;return function(e,t,i,s){var r=[],n=[];r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],n[0]=r[0],n[1]=r[1]*Math.cos(s)-r[2]*Math.sin(s),n[2]=r[1]*Math.sin(s)+r[2]*Math.cos(s),e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2]}(this,this,void 0===i?vk:i,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,i=e.origin;return function(e,t,i,s){var r=[],n=[];r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],n[0]=r[2]*Math.sin(s)+r[0]*Math.cos(s),n[1]=r[1],n[2]=r[2]*Math.cos(s)-r[0]*Math.sin(s),e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2]}(this,this,void 0===i?vk:i,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,i=e.origin;return function(e,t,i,s){var r=[],n=[];r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],n[0]=r[0]*Math.cos(s)-r[1]*Math.sin(s),n[1]=r[0]*Math.sin(s)+r[1]*Math.cos(s),n[2]=r[2],e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2]}(this,this,void 0===i?vk:i,t),this.check()}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return function(e,t,i){var s=t[0],r=t[1],n=t[2],o=i[3]*s+i[7]*r+i[11]*n+i[15];o=o||1,e[0]=(i[0]*s+i[4]*r+i[8]*n+i[12])/o,e[1]=(i[1]*s+i[5]*r+i[9]*n+i[13])/o,e[2]=(i[2]*s+i[6]*r+i[10]*n+i[14])/o}(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return function(e,t,i){var s=t[0],r=t[1],n=t[2],o=i[3]*s+i[7]*r+i[11]*n||1;e[0]=(i[0]*s+i[4]*r+i[8]*n)/o,e[1]=(i[1]*s+i[5]*r+i[9]*n)/o,e[2]=(i[2]*s+i[6]*r+i[10]*n)/o}(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return dk(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,i){var s=t[0],r=t[1];e[0]=i[0]*s+i[2]*r,e[1]=i[1]*s+i[3]*r,e[2]=t[2]}(this,this,e),this.check()}},{key:"transformByQuaternion",value:function(e){return function(e,t,i){var s=i[0],r=i[1],n=i[2],o=i[3],a=t[0],l=t[1],u=t[2],A=r*u-n*l,c=n*a-s*u,h=s*l-r*a,d=r*h-n*c,p=n*A-s*h,f=s*c-r*A,v=2*o;A*=v,c*=v,h*=v,d*=2,p*=2,f*=2,e[0]=a+A+d,e[1]=l+c+p,e[2]=u+h+f}(this,this,e),this.check()}}],[{key:"ZERO",get:function(){return pk||(pk=new t(0,0,0),Object.freeze(pk)),pk}}])}(),mk=function(e){function t(){return B(this,t),h(this,t,arguments)}return m(t,lk),w(t,[{key:"toString",value:function(){var e="[";if(sk.printRowMajor){e+="row-major:";for(var t=0;t<this.RANK;++t)for(var i=0;i<this.RANK;++i)e+=" ".concat(this[i*this.RANK+t])}else{e+="column-major:";for(var s=0;s<this.ELEMENTS;++s)e+=" ".concat(this[s])}return e+="]"}},{key:"getElementIndex",value:function(e,t){return t*this.RANK+e}},{key:"getElement",value:function(e,t){return this[t*this.RANK+e]}},{key:"setElement",value:function(e,t,i){return this[t*this.RANK+e]=uk(i),this}},{key:"getColumn",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),i=e*this.RANK,s=0;s<this.RANK;++s)t[s]=this[i+s];return t}},{key:"setColumn",value:function(e,t){for(var i=e*this.RANK,s=0;s<this.RANK;++s)this[i+s]=t[s];return this}}])}();function _k(e,t,i){var s=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],u=t[6],A=t[7],c=t[8],h=i[0],d=i[1],p=i[2],f=i[3],v=i[4],g=i[5],m=i[6],_=i[7],y=i[8];return e[0]=h*s+d*o+p*u,e[1]=h*r+d*a+p*A,e[2]=h*n+d*l+p*c,e[3]=f*s+v*o+g*u,e[4]=f*r+v*a+g*A,e[5]=f*n+v*l+g*c,e[6]=m*s+_*o+y*u,e[7]=m*r+_*a+y*A,e[8]=m*n+_*l+y*c,e}function yk(e,t,i){var s=i[0],r=i[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}!function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"}(fk||(fk={}));var bk,Bk,xk=Object.freeze([1,0,0,0,1,0,0,0,1]),wk=function(e){function t(e){for(var i,s=arguments.length,r=new Array(s>1?s-1:0),n=1;n<s;n++)r[n-1]=arguments[n];return B(this,t),i=h(this,t,[-0,-0,-0,-0,-0,-0,-0,-0,-0]),1===arguments.length&&Array.isArray(e)?i.copy(e):r.length>0?i.copy([e].concat(r)):i.identity(),i}return m(t,mk),w(t,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return fk}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}},{key:"identity",value:function(){return this.copy(xk)}},{key:"fromObject",value:function(e){return this.check()}},{key:"fromQuaternion",value:function(e){return function(e,t){var i=t[0],s=t[1],r=t[2],n=t[3],o=i+i,a=s+s,l=r+r,u=i*o,A=s*o,c=s*a,h=r*o,d=r*a,p=r*l,f=n*o,v=n*a,g=n*l;e[0]=1-c-p,e[3]=A-g,e[6]=h+v,e[1]=A+g,e[4]=1-u-p,e[7]=d-f,e[2]=h-v,e[5]=d+f,e[8]=1-u-c}(this,e),this.check()}},{key:"set",value:function(e,t,i,s,r,n,o,a,l){return this[0]=e,this[1]=t,this[2]=i,this[3]=s,this[4]=r,this[5]=n,this[6]=o,this[7]=a,this[8]=l,this.check()}},{key:"setRowMajor",value:function(e,t,i,s,r,n,o,a,l){return this[0]=e,this[1]=s,this[2]=o,this[3]=t,this[4]=r,this[5]=a,this[6]=i,this[7]=n,this[8]=l,this.check()}},{key:"determinant",value:function(){return function(e){var t=e[0],i=e[1],s=e[2],r=e[3],n=e[4],o=e[5],a=e[6],l=e[7],u=e[8];return t*(u*n-o*l)+i*(-u*r+o*a)+s*(l*r-n*a)}(this)}},{key:"transpose",value:function(){return function(e,t){if(e===t){var i=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=i,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],a=t[5],l=t[6],u=t[7],A=t[8],c=A*o-a*u,h=-A*n+a*l,d=u*n-o*l,p=i*c+s*h+r*d;p&&(p=1/p,e[0]=c*p,e[1]=(-A*s+r*u)*p,e[2]=(a*s-r*o)*p,e[3]=h*p,e[4]=(A*i-r*l)*p,e[5]=(-a*i+r*n)*p,e[6]=d*p,e[7]=(-u*i+s*l)*p,e[8]=(o*i-s*n)*p)}(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return _k(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return _k(this,this,e),this.check()}},{key:"rotate",value:function(e){return function(e,t,i){var s=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],u=t[6],A=t[7],c=t[8],h=Math.sin(i),d=Math.cos(i);e[0]=d*s+h*o,e[1]=d*r+h*a,e[2]=d*n+h*l,e[3]=d*o-h*s,e[4]=d*a-h*r,e[5]=d*l-h*n,e[6]=u,e[7]=A,e[8]=c}(this,this,e),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?yk(this,this,e):yk(this,this,[e,e]),this.check()}},{key:"translate",value:function(e){return function(e,t,i){var s=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],u=t[6],A=t[7],c=t[8],h=i[0],d=i[1];e[0]=s,e[1]=r,e[2]=n,e[3]=o,e[4]=a,e[5]=l,e[6]=h*s+d*o+u,e[7]=h*r+d*a+A,e[8]=h*n+d*l+c}(this,this,e),this.check()}},{key:"transform",value:function(e,t){var i;switch(e.length){case 2:i=function(e,t,i){var s=t[0],r=t[1];return e[0]=i[0]*s+i[3]*r+i[6],e[1]=i[1]*s+i[4]*r+i[7],e}(t||[-0,-0],e,this);break;case 3:i=dk(t||[-0,-0,-0],e,this);break;case 4:i=function(e,t,i){var s=t[0],r=t[1],n=t[2];return e[0]=i[0]*s+i[3]*r+i[6]*n,e[1]=i[1]*s+i[4]*r+i[7]*n,e[2]=i[2]*s+i[5]*r+i[8]*n,e[3]=t[3],e}(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ak(i,e.length),i}},{key:"transformVector",value:function(e,t){return this.transform(e,t)}},{key:"transformVector2",value:function(e,t){return this.transform(e,t)}},{key:"transformVector3",value:function(e,t){return this.transform(e,t)}}],[{key:"IDENTITY",get:function(){return Ck()}},{key:"ZERO",get:function(){return Pk()}}])}();function Pk(){return bk||(bk=new wk([0,0,0,0,0,0,0,0,0]),Object.freeze(bk)),bk}function Ck(){return Bk||(Bk=new wk,Object.freeze(Bk)),Bk}var Mk={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},kk={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Fk="KHR_texture_transform",Ek=Fk,Dk=new gk,Ik=new wk,Sk=new wk;function Tk(){return(Tk=o(r().mark((function e(t,i){var s,n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=new gC(t),s.getExtension(Fk)){e.next=4;break}return e.abrupt("return");case 4:for(n=t.json.materials||[],o=0;o<n.length;o++)Lk(o,t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Lk(e,t){var i,s,r,n=[],o=null===(i=t.json.materials)||void 0===i?void 0:i[e],a=null==o||null===(s=o.pbrMetallicRoughness)||void 0===s?void 0:s.baseColorTexture;a&&Rk(t,e,a,n);var l=null==o?void 0:o.emissiveTexture;l&&Rk(t,e,l,n);var u=null==o?void 0:o.normalTexture;u&&Rk(t,e,u,n);var A=null==o?void 0:o.occlusionTexture;A&&Rk(t,e,A,n);var c=null==o||null===(r=o.pbrMetallicRoughness)||void 0===r?void 0:r.metallicRoughnessTexture;c&&Rk(t,e,c,n)}function Rk(e,t,i,s){var r=function(e,t){var i,s=null===(i=e.extensions)||void 0===i?void 0:i[Fk],r=e.texCoord,n=void 0===r?0:r,o=s.texCoord,a=void 0===o?n:o,l=-1!==t.findIndex((function(e){var t=u(e,2),i=t[0],s=t[1];return i===n&&s===a}));if(!l){var A=function(e){var t=e.offset,i=void 0===t?[0,0]:t,s=e.rotation,r=void 0===s?0:s,n=e.scale,o=void 0===n?[1,1]:n,a=(new wk).set(1,0,0,0,1,0,i[0],i[1],1),l=Ik.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),u=Sk.set(o[0],0,0,0,o[1],0,0,0,1);return a.multiplyRight(l).multiplyRight(u)}(s);return n!==a&&(e.texCoord=a),t.push([n,a]),{originalTexCoord:n,texCoord:a,matrix:A}}return null}(i,s);if(r){var n,o=l(e.json.meshes||[]);try{for(o.s();!(n=o.n()).done;){var a,A=l(n.value.primitives);try{for(A.s();!(a=A.n()).done;){var c=a.value,h=c.material;Number.isFinite(h)&&t===h&&Uk(e,c,r)}}catch(e){A.e(e)}finally{A.f()}}}catch(e){o.e(e)}finally{o.f()}}}function Uk(e,t,i){var s=i.originalTexCoord,r=i.texCoord,n=i.matrix,o=t.attributes["TEXCOORD_".concat(s)];if(Number.isFinite(o)){var a,l=null===(a=e.json.accessors)||void 0===a?void 0:a[o];if(l&&l.bufferView){var u,A=null===(u=e.json.bufferViews)||void 0===u?void 0:u[l.bufferView];if(A){for(var c=e.buffers[A.buffer],h=c.arrayBuffer,d=(c.byteOffset||0)+(l.byteOffset||0)+(A.byteOffset||0),p=pC(l,A),f=p.ArrayType,v=p.length,g=kk[l.componentType],m=Mk[l.type],_=A.byteStride||g*m,y=new Float32Array(v),b=0;b<l.count;b++){var B=new f(h,d+b*_,2);Dk.set(B[0],B[1],1),Dk.transformByMatrix3(n),y.set([Dk[0],Dk[1]],b*m)}s===r?function(e,t,i,s){e.componentType=5126,i.push({arrayBuffer:s.buffer,byteOffset:0,byteLength:s.buffer.byteLength}),t.buffer=i.length-1,t.byteLength=s.buffer.byteLength,t.byteOffset=0,delete t.byteStride}(l,A,e.buffers,y):function(e,t,i,s,r){s.buffers.push({arrayBuffer:r.buffer,byteOffset:0,byteLength:r.buffer.byteLength});var n=s.json.bufferViews;if(!n)return;n.push({buffer:s.buffers.length-1,byteLength:r.buffer.byteLength,byteOffset:0});var o=s.json.accessors;if(!o)return;o.push({bufferView:(null==n?void 0:n.length)-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),i.attributes["TEXCOORD_".concat(e)]=o.length-1}(r,l,t,e,y)}}}}var Ok=Object.freeze({__proto__:null,name:Ek,decode:function(e,t){return Tk.apply(this,arguments)}}),Qk="KHR_lights_punctual",Nk=Qk;function Vk(){return(Vk=o(r().mark((function e(t){var i,s,n,o,a,u,A;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=new gC(t),s=i.json,(n=i.getExtension(Qk))&&(i.json.lights=n.lights,i.removeExtension(Qk)),o=l(s.nodes||[]);try{for(o.s();!(a=o.n()).done;)u=a.value,(A=i.getObjectExtension(u,Qk))&&(u.light=A.light),i.removeObjectExtension(u,Qk)}catch(e){o.e(e)}finally{o.f()}case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Hk(){return(Hk=o(r().mark((function e(t){var i,s,n,o,a,u,A;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=new gC(t),(s=i.json).lights&&(sC(!(n=i.addExtension(Qk)).lights),n.lights=s.lights,delete s.lights),i.json.lights){o=l(i.json.lights);try{for(o.s();!(a=o.n()).done;)u=a.value,A=u.node,i.addObjectExtension(A,Qk,u)}catch(e){o.e(e)}finally{o.f()}delete i.json.lights}case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jk="KHR_materials_unlit",Gk=jk;function zk(){return(zk=o(r().mark((function e(t){var i,s,n,o,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=new gC(t),s=i.json,n=l(s.materials||[]);try{for(n.s();!(o=n.n()).done;)a=o.value,a.extensions&&a.extensions.KHR_materials_unlit&&(a.unlit=!0),i.removeObjectExtension(a,jk)}catch(e){n.e(e)}finally{n.f()}i.removeExtension(jk);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Wk="KHR_techniques_webgl",Kk=Wk;function Xk(){return(Xk=o(r().mark((function e(t){var i,s,n,o,a,u,A,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=new gC(t),s=i.json,n=i.getExtension(Wk)){o=Jk(n,i),a=l(s.materials||[]);try{for(a.s();!(u=a.n()).done;)A=u.value,(c=i.getObjectExtension(A,Wk))&&(A.technique=Object.assign({},c,o[c.technique]),A.technique.values=Zk(A.technique,i)),i.removeObjectExtension(A,Wk)}catch(e){a.e(e)}finally{a.f()}i.removeExtension(Wk)}case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yk(){return(Yk=o(r().mark((function e(t,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Jk(e,t){var i=e.programs,s=void 0===i?[]:i,r=e.shaders,n=void 0===r?[]:r,o=e.techniques,a=void 0===o?[]:o,l=new TextDecoder;return n.forEach((function(e){if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=l.decode(t.getTypedArrayForBufferView(e.bufferView))})),s.forEach((function(e){e.fragmentShader=n[e.fragmentShader],e.vertexShader=n[e.vertexShader]})),a.forEach((function(e){e.program=s[e.program]})),a}function Zk(e,t){var i=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach((function(t){e.uniforms[t].value&&!(t in i)&&(i[t]=e.uniforms[t].value)})),Object.keys(i).forEach((function(e){"object"===b(i[e])&&void 0!==i[e].index&&(i[e].texture=t.getTexture(i[e].index))})),i}var qk="EXT_feature_metadata",$k=qk;function eF(){return(eF=o(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:tF(new gC(t));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tF(e){var t,i=e.getExtension(qk),s=null==i||null===(t=i.schema)||void 0===t?void 0:t.classes,r=null==i?void 0:i.featureTables;if((null==i?void 0:i.featureTextures)&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.'),s&&r)for(var n in s){var o=s[n],a=rF(r,n);a&&iF(e,a,o)}}function iF(e,t,i){for(var s in i.properties){var r,n=i.properties[s],o=null==t||null===(r=t.properties)||void 0===r?void 0:r[s],a=t.count;if(o){var l=sF(e,n,a,o);o.data=l}}}function sF(e,t,i,s){var r=s.bufferView,n=e.getTypedArrayForBufferView(r);if("STRING"===t.type){var o=s.stringOffsetBufferView;n=function(e,t,i){for(var s=[],r=new TextDecoder("utf8"),n=0,o=4,a=0;a<i;a++){var l=t[(a+1)*o]-t[a*o],u=e.subarray(n,l+n),A=r.decode(u);s.push(A),n+=l}return s}(n,e.getTypedArrayForBufferView(o),i)}return n}function rF(e,t){for(var i in e){var s=e[i];if(s.class===t)return s}return null}var nF=[UC,NC,jC,tk,Object.freeze({__proto__:null,name:Nk,decode:function(e){return Vk.apply(this,arguments)},encode:function(e){return Hk.apply(this,arguments)}}),Object.freeze({__proto__:null,name:Gk,decode:function(e){return zk.apply(this,arguments)},encode:function(e){var t=new gC(e),i=t.json;if(t.materials){var s,r=l(i.materials||[]);try{for(r.s();!(s=r.n()).done;){var n=s.value;n.unlit&&(delete n.unlit,t.addObjectExtension(n,jk,{}),t.addExtension(jk))}}catch(e){r.e(e)}finally{r.f()}}}}),Object.freeze({__proto__:null,name:Kk,decode:function(e){return Xk.apply(this,arguments)},encode:function(e,t){return Yk.apply(this,arguments)}}),Ok,Object.freeze({__proto__:null,name:$k,decode:function(e){return eF.apply(this,arguments)}})];function oF(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,r=nF.filter((function(e){return uF(e.name,i)})),n=l(r);try{for(n.s();!(t=n.n()).done;){var o,a=t.value;null===(o=a.preprocess)||void 0===o||o.call(a,e,i,s)}}catch(e){n.e(e)}finally{n.f()}}function aF(e){return lF.apply(this,arguments)}function lF(){return lF=o(r().mark((function e(t){var i,s,n,o,a,u,A,c=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=c.length>1&&void 0!==c[1]?c[1]:{},s=c.length>2?c[2]:void 0,n=nF.filter((function(e){return uF(e.name,i)})),o=l(n),e.prev=4,o.s();case 6:if((a=o.n()).done){e.next=12;break}return u=a.value,e.next=10,null===(A=u.decode)||void 0===A?void 0:A.call(u,t,i,s);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),o.e(e.t0);case 17:return e.prev=17,o.f(),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,14,17,20]])}))),lF.apply(this,arguments)}function uF(e,t){var i,s=(null==t||null===(i=t.gltf)||void 0===i?void 0:i.excludeExtensions)||{};return!(e in s&&!s[e])}var AF="KHR_binary_glTF";var cF={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},hF={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},dF=function(){return w((function e(){B(this,e),Wb(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),Wb(this,"json",void 0)}),[{key:"normalize",value:function(e,t){this.json=e.json;var i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(i.asset.version))}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(e){var t,i=new gC(e),s=i.json,r=l(s.images||[]);try{for(r.s();!(t=r.n()).done;){var n=t.value,o=i.getObjectExtension(n,AF);o&&Object.assign(n,o),i.removeObjectExtension(n,AF)}}catch(e){r.e(e)}finally{r.f()}s.buffers&&s.buffers[0]&&delete s.buffers[0].uri,i.removeExtension(AF)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}},{key:"_addAsset",value:function(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(e){for(var t in cF)this._convertTopLevelObjectToArray(e,t)}},{key:"_convertTopLevelObjectToArray",value:function(e,t){var i=e[t];if(i&&!Array.isArray(i))for(var s in e[t]=[],i){var r=i[s];r.id=r.id||s;var n=e[t].length;e[t].push(r),this.idToIndexMap[t][s]=n}}},{key:"_convertObjectIdsToArrayIndices",value:function(e){for(var t in cF)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));var i,s=l(e.textures);try{for(s.s();!(i=s.n()).done;){var r=i.value;this._convertTextureIds(r)}}catch(e){s.e(e)}finally{s.f()}var n,o=l(e.meshes);try{for(o.s();!(n=o.n()).done;){var a=n.value;this._convertMeshIds(a)}}catch(e){o.e(e)}finally{o.f()}var u,A=l(e.nodes);try{for(A.s();!(u=A.n()).done;){var c=u.value;this._convertNodeIds(c)}}catch(e){A.e(e)}finally{A.f()}var h,d=l(e.scenes);try{for(d.s();!(h=d.n()).done;){var p=h.value;this._convertSceneIds(p)}}catch(e){d.e(e)}finally{d.f()}}},{key:"_convertTextureIds",value:function(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}},{key:"_convertMeshIds",value:function(e){var t,i=l(e.primitives);try{for(i.s();!(t=i.n()).done;){var s=t.value,r=s.attributes,n=s.indices,o=s.material;for(var a in r)r[a]=this._convertIdToIndex(r[a],"accessor");n&&(s.indices=this._convertIdToIndex(n,"accessor")),o&&(s.material=this._convertIdToIndex(o,"material"))}}catch(e){i.e(e)}finally{i.f()}}},{key:"_convertNodeIds",value:function(e){var t=this;e.children&&(e.children=e.children.map((function(e){return t._convertIdToIndex(e,"node")}))),e.meshes&&(e.meshes=e.meshes.map((function(e){return t._convertIdToIndex(e,"mesh")})))}},{key:"_convertSceneIds",value:function(e){var t=this;e.nodes&&(e.nodes=e.nodes.map((function(e){return t._convertIdToIndex(e,"node")})))}},{key:"_convertIdsToIndices",value:function(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);var i,s=l(e[t]);try{for(s.s();!(i=s.n()).done;){var r=i.value;for(var n in r){var o=r[n],a=this._convertIdToIndex(o,n);r[n]=a}}}catch(e){s.e(e)}finally{s.f()}}},{key:"_convertIdToIndex",value:function(e,t){var i=hF[t];if(i in this.idToIndexMap){var s=this.idToIndexMap[i][e];if(!Number.isFinite(s))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return s}return e}},{key:"_updateObjects",value:function(e){var t,i=l(this.json.buffers);try{for(i.s();!(t=i.n()).done;){delete t.value.type}}catch(e){i.e(e)}finally{i.f()}}},{key:"_updateMaterial",value:function(e){var t,i=l(e.materials);try{var s,r,n,o=function(){var i=t.value;i.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var o=(null===(s=i.values)||void 0===s?void 0:s.tex)||(null===(r=i.values)||void 0===r?void 0:r.texture2d_0)||(null===(n=i.values)||void 0===n?void 0:n.diffuseTex),a=e.textures.findIndex((function(e){return e.id===o}));-1!==a&&(i.pbrMetallicRoughness.baseColorTexture={index:a})};for(i.s();!(t=i.n()).done;)o()}catch(e){i.e(e)}finally{i.f()}}}])}();function pF(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new dF).normalize(e,t)}var fF={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},vF={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},gF=10240,mF=10241,_F=10242,yF=10243,bF=10497,BF=9986,xF={magFilter:gF,minFilter:mF,wrapS:_F,wrapT:yF},wF=y(y(y(y({},gF,9729),mF,BF),_F,bF),yF,bF);var PF=function(){return w((function e(){B(this,e),Wb(this,"baseUri",""),Wb(this,"json",{}),Wb(this,"buffers",[]),Wb(this,"images",[])}),[{key:"postProcess",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.json,s=e.buffers,r=void 0===s?[]:s,n=e.images,o=void 0===n?[]:n,a=e.baseUri,l=void 0===a?"":a;return sC(i),this.baseUri=l,this.json=i,this.buffers=r,this.images=o,this._resolveTree(this.json,t),this.json}},{key:"_resolveTree",value:function(e){var t=this;e.bufferViews&&(e.bufferViews=e.bufferViews.map((function(e,i){return t._resolveBufferView(e,i)}))),e.images&&(e.images=e.images.map((function(e,i){return t._resolveImage(e,i)}))),e.samplers&&(e.samplers=e.samplers.map((function(e,i){return t._resolveSampler(e,i)}))),e.textures&&(e.textures=e.textures.map((function(e,i){return t._resolveTexture(e,i)}))),e.accessors&&(e.accessors=e.accessors.map((function(e,i){return t._resolveAccessor(e,i)}))),e.materials&&(e.materials=e.materials.map((function(e,i){return t._resolveMaterial(e,i)}))),e.meshes&&(e.meshes=e.meshes.map((function(e,i){return t._resolveMesh(e,i)}))),e.nodes&&(e.nodes=e.nodes.map((function(e,i){return t._resolveNode(e,i)}))),e.skins&&(e.skins=e.skins.map((function(e,i){return t._resolveSkin(e,i)}))),e.scenes&&(e.scenes=e.scenes.map((function(e,i){return t._resolveScene(e,i)}))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}},{key:"getScene",value:function(e){return this._get("scenes",e)}},{key:"getNode",value:function(e){return this._get("nodes",e)}},{key:"getSkin",value:function(e){return this._get("skins",e)}},{key:"getMesh",value:function(e){return this._get("meshes",e)}},{key:"getMaterial",value:function(e){return this._get("materials",e)}},{key:"getAccessor",value:function(e){return this._get("accessors",e)}},{key:"getCamera",value:function(e){return null}},{key:"getTexture",value:function(e){return this._get("textures",e)}},{key:"getSampler",value:function(e){return this._get("samplers",e)}},{key:"getImage",value:function(e){return this._get("images",e)}},{key:"getBufferView",value:function(e){return this._get("bufferViews",e)}},{key:"getBuffer",value:function(e){return this._get("buffers",e)}},{key:"_get",value:function(e,t){if("object"===b(t))return t;var i=this.json[e]&&this.json[e][t];return i||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),i}},{key:"_resolveScene",value:function(e,t){var i=this;return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map((function(e){return i.getNode(e)})),e}},{key:"_resolveNode",value:function(e,t){var i=this;return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map((function(e){return i.getNode(e)}))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((function(e,t){var s=i.getMesh(t);return e.id=s.id,e.primitives=e.primitives.concat(s.primitives),e}),{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}},{key:"_resolveSkin",value:function(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}},{key:"_resolveMesh",value:function(e,t){var i=this;return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map((function(e){var t=(e=s({},e)).attributes;for(var r in e.attributes={},t)e.attributes[r]=i.getAccessor(t[r]);return void 0!==e.indices&&(e.indices=i.getAccessor(e.indices)),void 0!==e.material&&(e.material=i.getMaterial(e.material)),e}))),e}},{key:"_resolveMaterial",value:function(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture=s({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=s({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=s({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=s({},e.pbrMetallicRoughness);var i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=s({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=s({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}},{key:"_resolveAccessor",value:function(e,t){var i,s;if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(i=e.componentType,vF[i]),e.components=(s=e.type,fF[s]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var r=e.bufferView.buffer,n=pC(e,e.bufferView),o=n.ArrayType,a=n.byteLength,l=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+r.byteOffset,u=r.arrayBuffer.slice(l,l+a);e.bufferView.byteStride&&(u=this._getValueFromInterleavedBuffer(r,l,e.bufferView.byteStride,e.bytesPerElement,e.count)),e.value=new o(u)}return e}},{key:"_getValueFromInterleavedBuffer",value:function(e,t,i,s,r){for(var n=new Uint8Array(r*s),o=0;o<r;o++){var a=t+o*i;n.set(new Uint8Array(e.arrayBuffer.slice(a,a+s)),o*s)}return n.buffer}},{key:"_resolveTexture",value:function(e,t){return e.id=e.id||"texture-".concat(t),e.sampler="sampler"in e?this.getSampler(e.sampler):wF,e.source=this.getImage(e.source),e}},{key:"_resolveSampler",value:function(e,t){for(var i in e.id=e.id||"sampler-".concat(t),e.parameters={},e){var s=this._enumSamplerParameter(i);void 0!==s&&(e.parameters[s]=e[i])}return e}},{key:"_enumSamplerParameter",value:function(e){return xF[e]}},{key:"_resolveImage",value:function(e,t){e.id=e.id||"image-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));var i=this.images[t];return i&&(e.image=i),e}},{key:"_resolveBufferView",value:function(e,t){var i=e.buffer,r=s(s({id:"bufferView-".concat(t)},e),{},{buffer:this.buffers[i]}),n=this.buffers[i].arrayBuffer,o=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(o+=e.byteOffset),r.data=new Uint8Array(n,o,e.byteLength),r}},{key:"_resolveCamera",value:function(e,t){return e.id=e.id||"camera-".concat(t),e.perspective,e.orthographic,e}}])}();function CF(e,t){return(new PF).postProcess(e,t)}var MF=1735152710,kF=12,FF=8,EF=1313821514,DF=5130562,IF=0,SF=1,TF=0,LF=!0;function RF(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=new DataView(t),r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(e.getUint8(t+0))).concat(String.fromCharCode(e.getUint8(t+1))).concat(String.fromCharCode(e.getUint8(t+2))).concat(String.fromCharCode(e.getUint8(t+3)))}(s,i+0),n=s.getUint32(i+4,LF),o=s.getUint32(i+8,LF);switch(Object.assign(e,{header:{byteOffset:i,byteLength:o,hasBinChunk:!1},type:r,version:n,json:{},binChunks:[]}),i+=kF,e.version){case 1:return function(e,t,i){ZP(e.header.byteLength>kF+FF);var s=t.getUint32(i+0,LF),r=t.getUint32(i+4,LF);return i+=FF,ZP(r===TF),UF(e,t,i,s),i+=s,i+=OF(e,t,i,e.header.byteLength),i}(e,s,i);case 2:return function(e,t,i,s){return ZP(e.header.byteLength>kF+FF),function(e,t,i,s){for(;i+8<=e.header.byteLength;){var r=t.getUint32(i+0,LF),n=t.getUint32(i+4,LF);switch(i+=FF,n){case EF:UF(e,t,i,r);break;case DF:OF(e,t,i,r);break;case IF:s.strict||UF(e,t,i,r);break;case SF:s.strict||OF(e,t,i,r)}i+=tC(r,4)}}(e,t,i,s),i+e.header.byteLength}(e,s,i,{});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}function UF(e,t,i,s){var r=new Uint8Array(t.buffer,i,s),n=new TextDecoder("utf8").decode(r);return e.json=JSON.parse(n),tC(s,4)}function OF(e,t,i,s){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:i,byteLength:s,arrayBuffer:t.buffer}),tC(s,4)}function QF(e,t){return NF.apply(this,arguments)}function NF(){return NF=o(r().mark((function e(t,i){var s,n,o,a,l,u,A,c,h,d=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=d.length>4?d[4]:void 0,VF(t,i,d.length>2&&void 0!==d[2]?d[2]:0,l=d.length>3?d[3]:void 0),pF(t,{normalize:null==l||null===(s=l.gltf)||void 0===s?void 0:s.normalize}),oF(t,l,u),A=[],null==l||null===(n=l.gltf)||void 0===n||!n.loadBuffers||!t.json.buffers){e.next=10;break}return e.next=10,HF(t,l,u);case 10:return null!=l&&null!==(o=l.gltf)&&void 0!==o&&o.loadImages&&(c=GF(t,l,u),A.push(c)),h=aF(t,l,u),A.push(h),e.next=15,Promise.all(A);case 15:return e.abrupt("return",null!=l&&null!==(a=l.gltf)&&void 0!==a&&a.postProcess?CF(t,l):t);case 16:case"end":return e.stop()}}),e)}))),NF.apply(this,arguments)}function VF(e,t,i,s){(s.uri&&(e.baseUri=s.uri),t instanceof ArrayBuffer&&!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=new DataView(e),r=i.magic,n=void 0===r?MF:r,o=s.getUint32(t,!1);return o===n||o===MF}(t,i,s))&&(t=(new TextDecoder).decode(t));if("string"==typeof t)e.json=$P(t);else if(t instanceof ArrayBuffer){var r={};i=RF(r,t,i,s.glb),sC("glTF"===r.type,"Invalid GLB magic string ".concat(r.type)),e._glb=r,e.json=r.json}else sC(!1,"GLTF: must be ArrayBuffer or string");var n=e.json.buffers||[];if(e.buffers=new Array(n.length).fill(null),e._glb&&e._glb.header.hasBinChunk){var o=e._glb.binChunks;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}var a=e.json.images||[];e.images=new Array(a.length).fill({})}function HF(e,t,i){return jF.apply(this,arguments)}function jF(){return(jF=o(r().mark((function e(t,i,s){var n,o,a,l,u,A,c,h;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.json.buffers||[],o=0;case 2:if(!(o<n.length)){e.next=22;break}if(!(a=n[o]).uri){e.next=18;break}return sC(s.fetch),A=rC(a.uri,i),e.next=10,null==s||null===(l=s.fetch)||void 0===l?void 0:l.call(s,A);case 10:return c=e.sent,e.next=13,null==c||null===(u=c.arrayBuffer)||void 0===u?void 0:u.call(c);case 13:h=e.sent,t.buffers[o]={arrayBuffer:h,byteOffset:0,byteLength:h.byteLength},delete a.uri,e.next=19;break;case 18:null===t.buffers[o]&&(t.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength});case 19:++o,e.next=2;break;case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function GF(e,t,i){return zF.apply(this,arguments)}function zF(){return(zF=o(r().mark((function e(t,i,s){var n,o,a,u,A,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=WF(t),o=t.json.images||[],a=[],u=l(n);try{for(u.s();!(A=u.n()).done;)c=A.value,a.push(KF(t,o[c],c,i,s))}catch(e){u.e(e)}finally{u.f()}return e.next=7,Promise.all(a);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function WF(e){var t,i=new Set,s=l(e.json.textures||[]);try{for(s.s();!(t=s.n()).done;){var r=t.value;void 0!==r.source&&i.add(r.source)}}catch(e){s.e(e)}finally{s.f()}return Array.from(i).sort()}function KF(e,t,i,s,r){return XF.apply(this,arguments)}function XF(){return XF=o(r().mark((function e(t,i,s,n,o){var a,l,u,A,c,h,d;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=o.fetch,l=o.parse,!i.uri||i.hasOwnProperty("bufferView")){e.next=10;break}return A=rC(i.uri,n),e.next=5,a(A);case 5:return c=e.sent,e.next=8,c.arrayBuffer();case 8:u=e.sent,i.bufferView={data:u};case 10:return Number.isFinite(i.bufferView)&&(h=nC(t.json,t.buffers,i.bufferView),u=eC(h.buffer,h.byteOffset,h.byteLength)),sC(u,"glTF image has no data"),e.next=14,l(u,[XP,hP],{mimeType:i.mimeType,basis:n.basis||{format:cP()}},o);case 14:(d=e.sent)&&d[0]&&(d={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d[0]}),t.images=t.images||[],t.images[s]=d;case 18:case"end":return e.stop()}}),e)}))),XF.apply(this,arguments)}var YF={name:"glTF",id:"gltf",module:"gltf",version:"3.4.15",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:function(e){return JF.apply(this,arguments)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};function JF(){return JF=o(r().mark((function e(t){var i,n,o,a,l,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2?u[2]:void 0,(i=s(s({},YF.options),i)).gltf=s(s({},YF.options.gltf),i.gltf),o=i.byteOffset,a=void 0===o?0:o,l={},e.next=8,QF(l,t,a,i,n);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)}))),JF.apply(this,arguments)}var ZF=function(){return w((function e(t){B(this,e)}),[{key:"load",value:function(e,t,i,s,r,n,o){!function(e,t,i,s,r,n,o){var a=e.viewer.scene.canvas.spinner;a.processes++;var l="glb"===t.split(".").pop();l?e.dataSource.getGLB(t,(function(o){s.basePath=qF(t),$F(e,t,o,i,s,r,n),a.processes--}),(function(e){a.processes--,o(e)})):e.dataSource.getGLTF(t,(function(o){s.basePath=qF(t),$F(e,t,o,i,s,r,n),a.processes--}),(function(e){a.processes--,o(e)}))}(e,t,i,s=s||{},r,(function(){pe.scheduleTask((function(){r.scene.fire("modelLoaded",r.id),r.fire("loaded",!0,!1)})),n&&n()}),(function(t){e.error(t),o&&o(t),r.fire("error",t)}))}},{key:"parse",value:function(e,t,i,s,r,n,o){$F(e,"",t,i,s=s||{},r,(function(){r.scene.fire("modelLoaded",r.id),r.fire("loaded",!0,!1),n&&n()}))}}])}();function qF(e){var t=e.lastIndexOf("/");return 0!==t?e.substring(0,t+1):""}function $F(e,t,i,s,r,n,o){var a=e.viewer.scene.canvas.spinner;a.processes++,iw(i,YF,{baseUri:r.basePath}).then((function(i){var l={src:t,entityId:r.entityId,metaModelJSON:s,autoMetaModel:r.autoMetaModel,globalizeObjectIds:r.globalizeObjectIds,metaObjects:[],loadBuffer:r.loadBuffer,basePath:r.basePath,handlenode:r.handlenode,backfaces:!!r.backfaces,gltfData:i,scene:n.scene,plugin:e,sceneModel:n,numObjects:0,nodes:[],nextId:0,log:function(t){e.log(t)}};!function(e){var t=e.gltfData,i=t.textures;if(i)for(var s=0,r=i.length;s<r;s++)eE(e,i[s]);else console.log("no texture")}(l),function(e){var t=e.gltfData,i=t.materials;if(i)for(var s=0,r=i.length;s<r;s++){var n=i[s];n._textureSetId=tE(e,n),n._attributes=iE(e,n)}}(l),r.autoMetaModel&&l.metaObjects.push({id:n.id,type:"Default",name:n.id}),function(e){var t=e.gltfData,i=t.scene||t.scenes[0];if(!i)return void function(e,t){e.plugin.error(t)}(e,"glTF has no default scene");var s=i.nodes;if(!s)return;!function e(t){t.forEach((function(t){var i=t.mesh;i&&(i.instances||(i.instances=0),i.instances+=1),t.children&&e(t.children)}))}(s);var r=[],n=null;!function t(i,s,o){i.forEach((function(i){var a=i.name,l=null!=a&&a||0===s&&"entity-"+e.nextId++;if(l){for(;e.sceneModel.objects[l];)l="entity-"+e.nextId++;r.push(n),n=[]}var u=function(e,t){var i;e.matrix&&(i=e.matrix,t=t?J.mulMat4(t,i,J.mat4()):i);e.translation&&(i=J.translationMat4v(e.translation),t=t?J.mulMat4(t,i,J.mat4()):i);e.rotation&&(i=J.quaternionToMat4(e.rotation),t=t?J.mulMat4(t,i,J.mat4()):i);e.scale&&(i=J.scalingMat4v(e.scale),t=t?J.mulMat4(t,i,J.mat4()):i);return t}(i,o);if(i.mesh&&function(e,t,i,s){var r=e.mesh;if(!r)return;var n=r.primitives.length;if(n>0)for(var o=0;o<n;o++){var a=r.primitives[o];if(!(a.mode<4)){var l={id:t.sceneModel.id+"."+t.numObjects++},u=a.material;u?(l.textureSetId=u._textureSetId,l.color=u._attributes.color,l.opacity=u._attributes.opacity,l.metallic=u._attributes.metallic,l.roughness=u._attributes.roughness):(l.color=new Float32Array([1,1,1]),l.opacity=1);var A=!1!==t.backfaces||u&&!1!==u.doubleSided;switch(a.mode){case 0:l.primitive="points";break;case 1:case 2:case 3:l.primitive="lines";break;default:l.primitive=A?"triangles":"solid"}var c=a.attributes.POSITION;if(c){l.localPositions=c.value,l.positions=new Float64Array(l.localPositions.length),a.attributes.NORMAL&&(l.normals=a.attributes.NORMAL.value),a.attributes.TEXCOORD_0&&(l.uv=a.attributes.TEXCOORD_0.value),a.indices&&(l.indices=a.indices.value),i?J.transformPositions3(i,l.localPositions,l.positions):l.positions.set(l.localPositions);var h=J.vec3();we(l.positions,l.positions,h)&&(l.origin=h),t.sceneModel.createMesh(l),s.push(l.id)}}}}(i,e,u,n),i.children&&t(i.children,s+1,u),l){if(n.length>0){var A=e.globalizeObjectIds?J.globalizeObjectId(e.sceneModel.id,l):l;e.sceneModel.createEntity({id:A,meshIds:n,isObject:!0}),e.autoMetaModel&&e.metaObjects.push({id:A,type:"Default",name:A,parent:e.sceneModel.id})}n=r.pop()}}))}(s,0,null)}(l),n.finalize(),r.autoMetaModel&&e.viewer.metaScene.createMetaModel(n.id,{metaObjects:l.metaObjects}),a.processes--,o()}))}function eE(e,t){if(t.source&&t.source.image){var i="texture-".concat(e.nextId++),s=as;switch(t.sampler.minFilter){case 9728:s=ss;break;case 9729:s=ls;break;case 9984:s=rs;break;case 9985:s=As;break;case 9986:s=as;break;case 9987:s=hs}var r=ls;switch(t.sampler.magFilter){case 9728:r=ss;break;case 9729:r=ls}var n=es;switch(t.sampler.wrapS){case 33071:n=ts;break;case 33648:n=is;break;case 10497:n=es}var o=es;switch(t.sampler.wrapT){case 33071:o=ts;break;case 33648:o=is;break;case 10497:o=es}var a=es;switch(t.sampler.wrapR){case 33071:a=ts;break;case 33648:a=is;break;case 10497:a=es}e.sceneModel.createTexture({id:i,image:t.source.image,flipY:!!t.flipY,minFilter:s,magFilter:r,wrapS:n,wrapT:o,wrapR:a,encoding:ur}),t._textureId=i}}function tE(e,t){var i={};switch(t.normalTexture&&(i.normalTextureId=t.normalTexture.texture._textureId),t.occlusionTexture&&(i.occlusionTextureId=t.occlusionTexture.texture._textureId),t.emissiveTexture&&(i.emissiveTextureId=t.emissiveTexture.texture._textureId),t.alphaMode){case"OPAQUE":break;case"MASK":var s=t.alphaCutoff;i.alphaCutoff=void 0!==s?s:.5}var r=t.pbrMetallicRoughness;if(t.pbrMetallicRoughness){var n=t.pbrMetallicRoughness,o=n.baseColorTexture||n.colorTexture;o&&(o.texture?i.colorTextureId=o.texture._textureId:i.colorTextureId=e.gltfData.textures[o.index]._textureId),r.metallicRoughnessTexture&&(i.metallicRoughnessTextureId=r.metallicRoughnessTexture.texture._textureId)}var a=t.extensions;if(a){var l=a.KHR_materials_pbrSpecularGlossiness;if(l){l.specularTexture;var u=l.specularColorTexture;null!=u&&(i.colorTextureId=e.gltfData.textures[u.index]._textureId)}}return void 0!==i.normalTextureId||void 0!==i.occlusionTextureId||void 0!==i.emissiveTextureId||void 0!==i.colorTextureId||void 0!==i.metallicRoughnessTextureId?(i.id="textureSet-".concat(e.nextId++,";"),e.sceneModel.createTextureSet(i),i.id):null}function iE(e,t){var i=t.extensions,s={color:new Float32Array([1,1,1,1]),opacity:1,metallic:0,roughness:1,doubleSided:!0};if(i){var r=i.KHR_materials_pbrSpecularGlossiness;if(r){var n=r.diffuseFactor;null!=n&&s.color.set(n)}var o=i.KHR_materials_common;if(o){var a=o.technique,l=o.values||{},u="BLINN"===a,A="PHONG"===a,c="LAMBERT"===a,h=l.diffuse;h&&(u||A||c)&&(oe.isString(h)||s.color.set(h));var d=l.transparency;null!=d&&(s.opacity=d);var p=l.transparent;null!=p&&(s.opacity=p)}}var f=t.pbrMetallicRoughness;if(f){var v=f.baseColorFactor;v&&(s.color[0]=v[0],s.color[1]=v[1],s.color[2]=v[2],s.opacity=v[3]);var g=f.metallicFactor;null!=g&&(s.metallic=g);var m=f.roughnessFactor;null!=m&&(s.roughness=m)}return s.doubleSided=!1!==t.doubleSided,s}var sE={DEFAULT:{}},rE=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,["GLTFLoader",e,s]))._sceneModelLoader=new ZF(i,s),i.dataSource=s.dataSource,i.objectDefaults=s.objectDefaults,i}return m(t,me),w(t,[{key:"dataSource",get:function(){return this._dataSource},set:function(e){this._dataSource=e||new Rh}},{key:"objectDefaults",get:function(){return this._objectDefaults},set:function(e){this._objectDefaults=e||sE}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.id&&this.viewer.scene.components[t.id]&&(this.error("Component with this ID already exists in viewer: "+t.id+" - will autogenerate this ID"),delete t.id);var i=new vh(this.viewer.scene,oe.apply(t,{isModel:!0,dtxEnabled:t.dtxEnabled})),s=i.id;if(!t.src&&!t.gltf)return this.error("load() param expected: src or gltf"),i;if(t.metaModelSrc||t.metaModelJSON){var r=function(r){e.viewer.metaScene.createMetaModel(s,r,{}),e.viewer.scene.canvas.spinner.processes--,t.src?e._sceneModelLoader.load(e,t.src,r,t,i):e._sceneModelLoader.parse(e,t.gltf,r,t,i)};if(t.metaModelSrc){var n=t.metaModelSrc;this.viewer.scene.canvas.spinner.processes++,this._dataSource.getMetaModel(n,(function(t){e.viewer.scene.canvas.spinner.processes--,r(t)}),(function(t){e.error("load(): Failed to load model metadata for model '".concat(s," from '").concat(n,"' - ").concat(t)),e.viewer.scene.canvas.spinner.processes--}))}else t.metaModelJSON&&r(t.metaModelJSON)}else t.src?this._sceneModelLoader.load(this,t.src,null,t,i):this._sceneModelLoader.parse(this,t.gltf,null,t,i);return i.once("destroyed",(function(){e.viewer.metaScene.destroyMetaModel(s)})),i}},{key:"destroy",value:function(){f(t,"destroy",this,3)([])}}])}();function nE(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s="lightgrey",r=i.hoverColor||"rgba(60,120,125,0.3)",n=i.textColor||"rgba(15,75,80,0.8)",o=500,a=o+o/3,l=a/24,u=e.scene.camera.normalUp,A=[{boundary:[6,6,6,6],color:i.frontColor||i.color||"#55FF55"},{boundary:[18,6,6,6],color:i.backColor||i.color||"#55FF55"},{boundary:[12,6,6,6],color:i.rightColor||i.color||"#FF5555"},{boundary:[0,6,6,6],color:i.leftColor||i.color||"#FF5555"},{boundary:[6,0,6,6],color:i.topColor||i.color||"#7777FF"},{boundary:[6,12,6,6],color:i.bottomColor||i.color||"#7777FF"}],c=[{label:"NavCube.front",boundaries:[[7,7,4,4]],dir:[0,1,0],up:[0,0,1]},{label:"NavCube.back",boundaries:[[19,7,4,4]],dir:[0,-1,0],up:[0,0,1]},{label:"NavCube.right",boundaries:[[13,7,4,4]],dir:[-1,0,0],up:[0,0,1]},{label:"NavCube.left",boundaries:[[1,7,4,4]],dir:[1,0,0],up:[0,0,1]},{label:"NavCube.top",boundaries:[[7,1,4,4]],dir:[0,0,-1],up:[0,1,0]},{label:"NavCube.bottom",boundaries:[[7,13,4,4]],dir:[0,0,1],up:[0,-1,0]},{boundaries:[[7,5,4,2]],dir:[0,1,-1],up:[0,1,1]},{boundaries:[[1,6,4,1],[6,1,1,4]],dir:[1,0,-1],up:[1,0,1]},{boundaries:[[7,0,4,1],[19,6,4,1]],dir:[0,-1,-1],up:[0,-1,1]},{boundaries:[[13,6,4,1],[11,1,1,4]],dir:[-1,0,-1],up:[-1,0,1]},{boundaries:[[7,11,4,2]],dir:[0,1,1],up:[0,-1,1]},{boundaries:[[1,11,4,1],[6,13,1,4]],dir:[1,0,1],up:[-1,0,1]},{boundaries:[[7,17,4,1],[19,11,4,1]],dir:[0,-1,1],up:[0,1,1]},{boundaries:[[13,11,4,1],[11,13,1,4]],dir:[-1,0,1],up:[1,0,1]},{boundaries:[[5,7,2,4]],dir:[1,1,0],up:[0,0,1]},{boundaries:[[11,7,2,4]],dir:[-1,1,0],up:[0,0,1]},{boundaries:[[17,7,2,4]],dir:[-1,-1,0],up:[0,0,1]},{boundaries:[[0,7,1,4],[23,7,1,4]],dir:[1,-1,0],up:[0,0,1]},{boundaries:[[5,11,2,2]],dir:[1,1,1],up:[-1,-1,1]},{boundaries:[[23,11,1,1],[6,17,1,1],[0,11,1,1]],dir:[1,-1,1],up:[-1,1,1]},{boundaries:[[5,5,2,2]],dir:[1,1,-1],up:[1,1,1]},{boundaries:[[11,17,1,1],[17,11,2,1]],dir:[-1,-1,1],up:[1,1,1]},{boundaries:[[17,6,2,1],[11,0,1,1]],dir:[-1,-1,-1],up:[-1,-1,1]},{boundaries:[[11,11,2,2]],dir:[-1,1,1],up:[1,-1,1]},{boundaries:[[0,6,1,1],[6,0,1,1],[23,6,1,1]],dir:[1,-1,-1],up:[1,-1,1]},{boundaries:[[11,5,2,2]],dir:[-1,1,-1],up:[-1,1,1]}];i.frontColor||i.color,i.backColor||i.color,i.rightColor||i.color,i.leftColor||i.color,i.topColor||i.color,i.bottomColor||i.color;var h=[{areaId:0,label:"NavCube.front",boundaries:[[7,7,4,4]],dir:[0,0,-1],up:[0,1,0]},{areaId:1,label:"NavCube.back",boundaries:[[19,7,4,4]],dir:[0,0,1],up:[0,1,0]},{areaId:2,label:"NavCube.right",boundaries:[[13,7,4,4]],dir:[-1,0,0],up:[0,1,0]},{areaId:3,label:"NavCube.left",boundaries:[[1,7,4,4]],dir:[1,0,0],up:[0,1,0]},{areaId:4,label:"NavCube.top",boundaries:[[7,1,4,4]],dir:[0,-1,0],up:[0,0,-1]},{areaId:5,label:"NavCube.bottom",boundaries:[[7,13,4,4]],dir:[0,1,0],up:[0,0,1]},{areaId:6,boundaries:[[7,5,4,2]],dir:[0,-.7071,-.7071],up:[0,.7071,-.7071]},{areaId:7,boundaries:[[1,6,4,1],[6,1,1,4]],dir:[1,-1,0],up:[1,1,0]},{areaId:8,boundaries:[[7,0,4,1],[19,6,4,1]],dir:[0,-.7071,.7071],up:[0,.7071,.7071]},{areaId:9,boundaries:[[13,6,4,1],[11,1,1,4]],dir:[-1,-1,0],up:[-1,1,0]},{areaId:10,boundaries:[[7,11,4,2]],dir:[0,1,-1],up:[0,1,1]},{areaId:11,boundaries:[[1,11,4,1],[6,13,1,4]],dir:[1,1,0],up:[-1,1,0]},{areaId:12,boundaries:[[7,17,4,1],[19,11,4,1]],dir:[0,1,1],up:[0,1,-1]},{areaId:13,boundaries:[[13,11,4,1],[11,13,1,4]],dir:[-1,1,0],up:[1,1,0]},{areaId:14,boundaries:[[5,7,2,4]],dir:[1,0,-1],up:[0,1,0]},{areaId:15,boundaries:[[11,7,2,4]],dir:[-1,0,-1],up:[0,1,0]},{areaId:16,boundaries:[[17,7,2,4]],dir:[-1,0,1],up:[0,1,0]},{areaId:17,boundaries:[[0,7,1,4],[23,7,1,4]],dir:[1,0,1],up:[0,1,0]},{areaId:18,boundaries:[[5,11,2,2]],dir:[.5,.7071,-.5],up:[-.5,.7071,.5]},{areaId:19,boundaries:[[23,11,1,1],[6,17,1,1],[0,11,1,1]],dir:[.5,.7071,.5],up:[-.5,.7071,-.5]},{areaId:20,boundaries:[[5,5,2,2]],dir:[.5,-.7071,-.5],up:[.5,.7071,-.5]},{areaId:21,boundaries:[[11,17,1,1],[17,11,2,1]],dir:[-.5,.7071,.5],up:[.5,.7071,-.5]},{areaId:22,boundaries:[[17,6,2,1],[11,0,1,1]],dir:[-.5,-.7071,.5],up:[-.5,.7071,.5]},{areaId:23,boundaries:[[11,11,2,2]],dir:[-.5,.7071,-.5],up:[.5,.7071,.5]},{areaId:24,boundaries:[[0,6,1,1],[6,0,1,1],[23,6,1,1]],dir:[.5,-.7071,.5],up:[.5,.7071,.5]},{areaId:25,boundaries:[[11,5,2,2]],dir:[-.5,-.7071,-.5],up:[-.5,.7071,-.5]}],d=[{areaId:0,label:"NavCube.front",boundaries:[[7,7,4,4]],dir:[0,0,-1],up:[0,-1,0]},{areaId:1,label:"NavCube.back",boundaries:[[19,7,4,4]],dir:[0,0,1],up:[0,-1,0]},{areaId:2,label:"NavCube.right",boundaries:[[13,7,4,4]],dir:[1,0,0],up:[0,-1,0]},{areaId:3,label:"NavCube.left",boundaries:[[1,7,4,4]],dir:[-1,0,0],up:[0,-1,0]},{areaId:4,label:"NavCube.top",boundaries:[[7,1,4,4]],dir:[0,1,0],up:[0,0,-1]},{areaId:5,label:"NavCube.bottom",boundaries:[[7,13,4,4]],dir:[0,-1,0],up:[0,0,1]},{areaId:6,boundaries:[[7,5,4,2]],dir:[0,1,-1],up:[0,1,1]},{areaId:7,boundaries:[[1,6,4,1],[6,1,1,4]],dir:[-1,1,0],up:[1,1,0]},{areaId:8,boundaries:[[7,0,4,1],[19,6,4,1]],dir:[0,1,1],up:[0,1,-1]},{areaId:9,boundaries:[[13,6,4,1],[11,1,1,4]],dir:[1,1,0],up:[-1,1,0]},{areaId:10,boundaries:[[7,11,4,2]],dir:[0,-.7071,-.7071],up:[0,.7071,-.7071]},{areaId:11,boundaries:[[1,11,4,1],[6,13,1,4]],dir:[-1,-1,0],up:[-1,1,0]},{areaId:12,boundaries:[[7,17,4,1],[19,11,4,1]],dir:[0,-.7071,.7071],up:[0,.7071,.7071]},{areaId:13,boundaries:[[13,11,4,1],[11,13,1,4]],dir:[1,-1,0],up:[1,1,0]},{areaId:14,boundaries:[[5,7,2,4]],dir:[-1,0,-1],up:[0,1,0]},{areaId:15,boundaries:[[11,7,2,4]],dir:[1,0,-1],up:[0,1,0]},{areaId:16,boundaries:[[17,7,2,4]],dir:[1,0,1],up:[0,1,0]},{areaId:17,boundaries:[[0,7,1,4],[23,7,1,4]],dir:[-1,0,1],up:[0,1,0]},{areaId:18,boundaries:[[5,11,2,2]],dir:[-.5,-.7071,-.5],up:[-.5,.7071,-.5]},{areaId:19,boundaries:[[23,11,1,1],[6,17,1,1],[0,11,1,1]],dir:[-.5,-.7071,.5],up:[-.5,.7071,.5]},{areaId:20,boundaries:[[5,5,2,2]],dir:[-.5,.7071,-.5],up:[.5,.7071,.5]},{areaId:21,boundaries:[[11,17,1,1],[17,11,2,1]],dir:[.5,-.7071,.5],up:[.5,.7071,.5]},{areaId:22,boundaries:[[17,6,2,1],[11,0,1,1]],dir:[.5,.7071,.5],up:[-.5,.7071,-.5]},{areaId:23,boundaries:[[11,11,2,2]],dir:[.5,-.7071,-.5],up:[.5,.7071,-.5]},{areaId:24,boundaries:[[0,6,1,1],[6,0,1,1],[23,6,1,1]],dir:[-.5,.7071,.5],up:[.5,.7071,-.5]},{areaId:25,boundaries:[[11,5,2,2]],dir:[.5,.7071,-.5],up:[-.5,.7071,.5]}];d.forEach((function(e){e.areaId>5&&(e.up=[-1*e.up[0],-1*e.up[1],-1*e.up[2]])}));for(var p=u?h:d,f=0,v=c.length;f<v;f++)J.normalizeVec3(c[f].dir,c[f].dir),J.normalizeVec3(c[f].up,c[f].up);for(var g=0,m=p.length;g<m;g++)J.normalizeVec3(p[g].dir,p[g].dir),J.normalizeVec3(p[g].up,p[g].up);var _=p;this._textureCanvas=document.createElement("canvas"),this._textureCanvas.width=a,this._textureCanvas.height=o,this._textureCanvas.style.width=a+"px",this._textureCanvas.style.height=o+"px",this._textureCanvas.style.padding="0",this._textureCanvas.style.margin="0",this._textureCanvas.style.top="0",this._textureCanvas.style.background=s,this._textureCanvas.style.position="absolute",this._textureCanvas.style.opacity="1.0",this._textureCanvas.style.display="none",this._textureCanvas.style["z-index"]=-100,this._textureCanvas.setAttribute("id","myNavCubeRenderImage"),this.cubeParentDiv=document.createElement("div"),this.cubeParentDiv.setAttribute("id","myNavCubeRenderImage_parent"),this.cubeContainer=i.viewerElement,this.cubeParentDiv.appendChild(this._textureCanvas),this.cubeContainer.appendChild(this.cubeParentDiv);var y=this._textureCanvas.getContext("2d"),b=!1;function B(){for(var e=0,i=A.length;e<i;e++){var o=A[e],a=o.boundary,u=Math.round(a[0]*l),c=Math.round(a[1]*l),h=Math.round(a[2]*l),d=Math.round(a[3]*l);y.fillStyle=o.color,y.fillRect(u,c,h,d)}for(var p=0,f=_.length;p<f;p++){for(var v=void 0,g=void 0,m=void 0,b=void 0,B=_[p],x=B.boundaries,w=0,P=x.length;w<P;w++){var M=x[w];v=Math.round(M[0]*l),g=Math.round(M[1]*l),m=Math.round(M[2]*l),b=Math.round(M[3]*l),B.highlighted&&(y.fillStyle=B.highlighted?r:B.color||s,y.fillRect(v,g,m,b))}if(B.label){y.fillStyle=n,y.font="60px sans-serif",y.textAlign="center";var k=v+.5*m,F=g+.7*b;y.fillText(C(B.label),k,F,80)}}t.glRedraw()}var x,w,P,C=(x={"NavCube.front":"NavCube.front","NavCube.back":"NavCube.back","NavCube.right":"NavCube.right","NavCube.left":"NavCube.left","NavCube.top":"NavCube.top","NavCube.bottom":"NavCube.bottom"},w={"NavCube.front":"NavCube.front","NavCube.back":"NavCube.back","NavCube.right":"NavCube.right","NavCube.left":"NavCube.left","NavCube.top":"NavCube.top","NavCube.bottom":"NavCube.bottom"},P={"NavCube.front":"FRONT","NavCube.back":"BACK","NavCube.right":"RIGHT","NavCube.left":"LEFT","NavCube.top":"TOP","NavCube.bottom":"BOTTOM"},function(t){var i=b?w:x,s=i?i[t]:null;return s?e.localeService.translate(s)||P[s]||s:t});this.setZUp=function(){b=!0,_=c,this.clear()},this.setYUp=function(){u=e.scene.camera.normalUp,b=!1,_=u?h:d,this.clear()},this.clear=function(){y.fillStyle=s,y.fillRect(0,0,a,o);for(var e=0,t=_.length;e<t;e++){_[e].highlighted=!1}B()},this.getArea=function(e){for(var t=e[0]*a,i=o-e[1]*o,s=0,r=_.length;s<r;s++)for(var n=_[s].boundaries,u=0,A=n.length;u<A;u++){var c=n[u];if(t>=c[0]*l&&t<=(c[0]+c[2])*l&&i>=c[1]*l&&i<=(c[1]+c[3])*l)return s}return-1},this.setAreaHighlighted=function(e,t){var i=_[e];if(!i)throw"Area not found: "+e;i.highlighted=!!t,B()},this.getAreaDir=function(e){var t=_[e];if(!t)throw"Unknown area: "+e;return t.dir},this.getAreaUp=function(e){var t=_[e];if(!t)throw"Unknown area: "+e;return t.up},this.getImage=function(){return this._textureCanvas},this.destroy=function(){this._textureCanvas&&(this._textureCanvas.parentNode.removeChild(this._textureCanvas),this._textureCanvas=null),this.cubeParentDiv&&(this.cubeParentDiv.parentNode.removeChild(this.cubeParentDiv),this.cubeParentDiv=null)}}var oE=J.vec3(),aE=J.vec3();J.mat4();var lE=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};B(this,t),i=h(this,t,["NavCube",e,s]),e.navCube=i;try{i._navCubeScene=new $i(e,{canvasId:s.canvasId,canvasElement:s.canvasElement,transparent:!0,spinnerElementId:"navcube_spinner",edgesEnabled:!0,contextAttr:{antialias:!0},resolutionScale:window.devicePixelRatio,worldAxis:e.scene.camera.worldAxis}),i._navCubeCanvas=i._navCubeScene.canvas.canvas,i._navCubeScene.input.keyboardEnabled=!1}catch(e){return i.error(e),d(i)}var r=i._navCubeScene;r.clearLights(),new _i(r,{dir:[.4,-.4,.8],color:[.8,1,1],intensity:.8,space:"view"}),new _i(r,{dir:[-.8,-.3,-.4],color:[.8,.8,.8],intensity:.8,space:"view"}),new _i(r,{dir:[.8,-.6,-.8],color:[1,1,1],intensity:.8,space:"view"}),i._navCubeCamera=r.camera,i._navCubeCamera.ortho.scale=7,i._navCubeCamera.ortho.near=.1,i._navCubeCamera.ortho.far=2e3,r.edgeMaterial.edgeColor=[.47,.62,.67],r.edgeMaterial.edgeAlpha=.2,r.edgeMaterial.edgeWidth=1,i._zUp=Boolean(e.camera.zUp);var n=i;i.mousedown=!1,i.mouseover=!1,i.setIsProjectNorth(s.isProjectNorth),i.setProjectNorthOffsetAngle(s.projectNorthOffsetAngle);var o,a=i.rotateTrueNorth=(o=J.mat4(),function(e,t,i){return J.identityMat4(o),J.rotationMat4v(e*n._projectNorthOffsetAngle*J.DEGTORAD,[0,1,0],o),J.transformVec3(o,t,i)}),l=!1;e.scene.on("aabb",(function(){l=e.scene.camera.normalUp})),i._synchCamera=function(){var t=J.rotationMat4c(-90*J.DEGTORAD,1,0,0),i=J.vec3(),s=J.vec3(),r=J.vec3();return function(){var o=e.camera.eye,u=e.camera.look,A=e.camera.up;i=J.mulVec3Scalar(J.normalizeVec3(J.subVec3(o,u,i)),5),n._isProjectNorth&&n._projectNorthOffsetAngle&&(i=a(-1,i,oE),A=a(-1,A,aE)),n._zUp?(J.transformVec3(t,i,s),J.transformVec3(t,A,r),n._navCubeCamera.look=[0,0,0],n._navCubeCamera.eye=J.transformVec3(t,i,s),n._navCubeCamera.up=J.transformPoint3(t,A,r)):(n._navCubeCamera.look=[0,0,0],n._navCubeCamera.eye=l?i:J.mulVec3(i,[-1,-1,1]),n._navCubeCamera.up=l?A:J.mulVec3Scalar(A,-1))}}(),i._cubeTextureCanvas=new nE(e,r,s),i._cubeSampler=new On(r,{image:i._cubeTextureCanvas.getImage(),flipY:!0,wrapS:ts,wrapT:ts}),i._cubeMesh=new nn(r,{geometry:new Ti(r,{primitive:"triangles",normals:[0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1],positions:[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1],uv:[.5,.6666,.25,.6666,.25,.3333,.5,.3333,.5,.6666,.5,.3333,.75,.3333,.75,.6666,.5,.6666,.5,1,.25,1,.25,.6666,.25,.6666,0,.6666,0,.3333,.25,.3333,.25,0,.5,0,.5,.3333,.25,.3333,.75,.3333,1,.3333,1,.6666,.75,.6666],indices:[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]}),material:new Qi(r,{diffuse:[.4,.4,.4],specular:[.4,.4,.4],emissive:[.6,.6,.6],diffuseMap:i._cubeSampler,emissiveMap:i._cubeSampler}),visible:!0,edges:!0}),i._shadow=!1===s.shadowVisible?null:new nn(r,{geometry:new Ti(r,an({center:[0,0,0],radiusTop:.001,radiusBottom:1.4,height:.01,radialSegments:20,heightSegments:1,openEnded:!0})),material:new Qi(r,{diffuse:[0,0,0],specular:[0,0,0],emissive:[0,0,0],alpha:.5}),position:[0,-1.5,0],visible:!0,pickable:!1,backfaces:!1}),i._onCameraMatrix=e.camera.on("matrix",i._synchCamera),i._onCameraWorldAxis=e.camera.on("worldAxis",(function(){e.camera.zUp?(i._zUp=!0,i._cubeTextureCanvas.setZUp(),i._repaint(),i._synchCamera()):e.camera.yUp&&(i._zUp=!1,i._cubeTextureCanvas.setYUp(),i._repaint(),i._synchCamera()),l=e.scene.camera.normalUp})),i._onCameraFOV=e.camera.perspective.on("fov",(function(e){i._synchProjection&&(i._navCubeCamera.perspective.fov=e)})),i._onCameraProjection=e.camera.on("projection",(function(e){i._synchProjection&&(i._navCubeCamera.projection="ortho"===e||"perspective"===e?e:"perspective")}));var u=-1;function A(e){var t=[0,0];if(e){for(var i=e.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;t[0]=e.pageX-s,t[1]=e.pageY-r}else e=window.event,t[0]=e.x,t[1]=e.y;return t}var c=null,p=null,f=!1;n.MOUSEDOWN=!1;var v=!1;n.MOUSEOVER=!1;var g,m,_=.5;n._navCubeCanvas.addEventListener("mouseenter",n._onMouseEnter=function(e){v=!0,n.MOUSEOVER=!0}),n._navCubeCanvas.addEventListener("mouseleave",n._onMouseLeave=function(e){v=!1,n.MOUSEOVER=!1}),n._navCubeCanvas.addEventListener("mousedown",n._onMouseDown=function(e){if(1===e.which){c=e.x,p=e.y,g=e.clientX,m=e.clientY;var t=A(e);r.pick({canvasPos:t})?(f=!0,n.MOUSEDOWN=!0):(f=!1,n.MOUSEDOWN=!1)}}),document.addEventListener("mouseup",n._onMouseUp=function(e){if(1===e.which&&(f=!1,n.MOUSEDOWN=!1,null!==c)){var t=A(e),i=r.pick({canvasPos:t,pickSurface:!0});if(i&&i.uv){var s=n._cubeTextureCanvas.getArea(i.uv);if(s>=0&&(u>=0&&(n._cubeTextureCanvas.setAreaHighlighted(u,!1),n._repaint(),u=-1),s>=0)){if(n._cubeTextureCanvas.setAreaHighlighted(s,!0),u=s,n._repaint(),e.x<c-3||e.x>c+3||e.y<p-3||e.y>p+3)return;var o=n._cubeTextureCanvas.getAreaDir(s);if(o){var l=n._cubeTextureCanvas.getAreaUp(s);n._isProjectNorth&&n._projectNorthOffsetAngle&&(o=a(1,o,oE),l=a(1,l,aE)),y(o,l,(function(){u>=0&&(n._cubeTextureCanvas.setAreaHighlighted(u,!1),n._repaint(),u=-1),u>=0&&(n._cubeTextureCanvas.setAreaHighlighted(u,!1),n._repaint(),u=-1),s>=0&&(n._cubeTextureCanvas.setAreaHighlighted(s,!1),u=-1,n._repaint())}))}}}}}),document.addEventListener("mousemove",n._onMouseMove=function(t){if(u>=0&&(n._cubeTextureCanvas.setAreaHighlighted(u,!1),n._repaint(),u=-1),1!==t.buttons||f){if(f){var i=t.clientX,s=t.clientY;return document.body.style.cursor="move",void function(t,i){var s=(t-g)*-_,r=(i-m)*-_;e.camera.orbitYaw(s),e.camera.orbitPitch(-r),g=t,m=i}(i,s)}if(v){var o=A(t),a=r.pick({canvasPos:o,pickSurface:!0});if(a){if(a.uv){document.body.style.cursor="pointer";var l=n._cubeTextureCanvas.getArea(a.uv);if(l===u)return;u>=0&&n._cubeTextureCanvas.setAreaHighlighted(u,!1),l>=0&&(n._cubeTextureCanvas.setAreaHighlighted(l,!0),n._repaint(),u=l)}}else document.body.style.cursor="default",u>=0&&(n._cubeTextureCanvas.setAreaHighlighted(u,!1),n._repaint(),u=-1)}}});var y=i.flyTo=function(){var t=J.vec3();return function(i,s,r){var o=n._fitVisible?e.scene.getAABB(e.scene.visibleObjectIds):e.scene.aabb,a=J.getAABB3Diag(o);J.getAABB3Center(o,t);var l=Math.abs(a/Math.tan(n._cameraFitFOV*J.DEGTORAD));e.cameraControl.pivotPos=t,n._cameraFly?e.cameraFlight.flyTo({look:t,eye:[t[0]-l*i[0],t[1]-l*i[1],t[2]-l*i[2]],up:s||[0,1,0],orthoScale:1.1*a,fitFOV:n._cameraFitFOV,duration:n._cameraFlyDuration},r):e.cameraFlight.jumpTo({look:t,eye:[t[0]-l*i[0],t[1]-l*i[1],t[2]-l*i[2]],up:s||[0,1,0],orthoScale:1.1*a,fitFOV:n._cameraFitFOV},r)}}();return i._onUpdated=e.localeService.on("updated",(function(){i._cubeTextureCanvas.clear(),i._repaint()})),i.setVisible(s.visible),i.setCameraFitFOV(s.cameraFitFOV),i.setCameraFly(s.cameraFly),i.setCameraFlyDuration(s.cameraFlyDuration),i.setFitVisible(s.fitVisible),i.setSynchProjection(s.synchProjection),i}return m(t,me),w(t,[{key:"flyByClick",value:function(e,t){if(e>=0){this._cubeTextureCanvas.setAreaHighlighted(e,!0),this._repaint();var i=this._cubeTextureCanvas.getAreaDir(e);if(i){var s=this._cubeTextureCanvas.getAreaUp(e);this._isProjectNorth&&this._projectNorthOffsetAngle&&(i=this.rotateTrueNorth(1,i,oE),s=this.rotateTrueNorth(1,s,aE)),this.flyTo(i,s,t)}}}},{key:"jumpByClick",value:function(e){this.setCameraFly(!1),this.flyByClick(e),this.setCameraFly(!0)}},{key:"navCubeScene",get:function(){return this._navCubeScene}},{key:"MOUSEDOWN",get:function(){return this.mousedown},set:function(e){this.mousedown=e}},{key:"MOUSEOVER",get:function(){return this.mouseover},set:function(e){this.mouseover=e}},{key:"send",value:function(e,t){if("language"===e)this._cubeTextureCanvas.clear(),this._repaint()}},{key:"_repaint",value:function(){var e=this._cubeTextureCanvas.getImage();this._cubeMesh.material.diffuseMap.image=e,this._cubeMesh.material.emissiveMap.image=e}},{key:"setVisible",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._navCubeCanvas&&(this._cubeMesh.visible=e,this._shadow&&(this._shadow.visible=e),this._navCubeCanvas.style.visibility=e?"visible":"hidden")}},{key:"getVisible",value:function(){return!!this._navCubeCanvas&&this._cubeMesh.visible}},{key:"setFitVisible",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._fitVisible=e}},{key:"getFitVisible",value:function(){return this._fitVisible}},{key:"setCameraFly",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._cameraFly=e}},{key:"getCameraFly",value:function(){return this._cameraFly}},{key:"setCameraFitFOV",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:45;this._cameraFitFOV=e}},{key:"getCameraFitFOV",value:function(){return this._cameraFitFOV}},{key:"setCameraFlyDuration",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5;this._cameraFlyDuration=e}},{key:"getCameraFlyDuration",value:function(){return this._cameraFlyDuration}},{key:"setSynchProjection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._synchProjection=e}},{key:"getSynchProjection",value:function(){return this._synchProjection}},{key:"setIsProjectNorth",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._isProjectNorth=e}},{key:"getIsProjectNorth",value:function(){return this._isProjectNorth}},{key:"setProjectNorthOffsetAngle",value:function(e){this._projectNorthOffsetAngle=e}},{key:"getProjectNorthOffsetAngle",value:function(){return this._projectNorthOffsetAngle}},{key:"destroy",value:function(){this._navCubeCanvas&&(this.viewer.localeService.off(this._onUpdated),this.viewer.camera.off(this._onCameraMatrix),this.viewer.camera.off(this._onCameraWorldAxis),this.viewer.camera.perspective.off(this._onCameraFOV),this.viewer.camera.off(this._onCameraProjection),this._navCubeCanvas.removeEventListener("mouseenter",this._onMouseEnter),this._navCubeCanvas.removeEventListener("mouseleave",this._onMouseLeave),this._navCubeCanvas.removeEventListener("mousedown",this._onMouseDown),document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp),this._navCubeCanvas=null,this._cubeTextureCanvas.destroy(),this._cubeTextureCanvas=null,this._onMouseEnter=null,this._onMouseLeave=null,this._onMouseDown=null,this._onMouseMove=null,this._onMouseUp=null),this._navCubeScene.destroy(),this._navCubeScene=null,this._cubeMesh=null,this._shadow=null,f(t,"destroy",this,3)([])}}])}(),uE=new Float64Array([0,0,1]),AE=new Float64Array(4),cE=function(){return w((function e(t){B(this,e),this.id=null,this.type="control",this.plugin=t,this._viewer=t.viewer,this._scene=t.viewer.scene,this._visible=!1,this._pos=J.vec3(),this._origin=J.vec3(),this._rtcPos=J.vec3(),this._baseDir=J.vec3(),this._rootNode=null,this._displayMeshes=null,this._affordanceMeshes=null,this._ignoreNextSectionPlaneDirUpdate=!1,this._createNodes(),this._bindEvents()}),[{key:"_setSectionPlane",value:function(e){var t=this;this._sectionPlane&&(this._sectionPlane.off(this._onSectionPlanePos),this._sectionPlane.off(this._onSectionPlaneDir),this._onSectionPlanePos=null,this._onSectionPlaneDir=null,this._sectionPlane=null),e&&(this.id=e.id,this._setPos(e.pos),this._setDir(e.dir),this._sectionPlane=e,this._onSectionPlanePos=e.on("pos",(function(){t._setPos(t._sectionPlane.pos)})),this._onSectionPlaneDir=e.on("dir",(function(){t._ignoreNextSectionPlaneDirUpdate?t._ignoreNextSectionPlaneDirUpdate=!1:t._setDir(t._sectionPlane.dir)})))}},{key:"sectionPlane",get:function(){return this._sectionPlane}},{key:"pos",get:function(){return this.posRate},set:function(e){if(!(e<0||e>100)){var t=this._scene.aabb,i=this._scene.camera.look,s=t[3]-t[0],r=t[4]-t[1],n=t[5]-t[2],o=J.vec3();o[0]=this.pos[0],o[1]=this.pos[1],o[2]=this.pos[2];var a,l=this._sectionPlane.dir;0!=l[0]?(a=e/100*s,o[0]=i[0]-s/2+a):0!=l[1]?(a=e/100*r,o[1]=i[1]-r/2+a):0!=l[2]&&(a=e/100*n,o[2]=i[2]-n/2+a),this._sectionPlane.pos=o}}},{key:"posRate",get:function(){var e=this._scene.aabb,t=this._scene.center,i=e[3]-e[0],s=e[4]-e[1],r=e[5]-e[2],n=this._sectionPlane.pos,o=this._sectionPlane.dir,a=0;if(0!=o[0])a=(n[0]-(t[0]-i/2))/i*100;else if(0!=o[1]){a=(n[1]-(t[1]-s/2))/s*100}else if(0!=o[2]){a=(n[2]-(t[2]-r/2))/r*100}return a=Math.max(0,Math.min(100,a)),parseInt(a)}},{key:"_setPos",value:function(e){this._pos.set(e),xe(this._pos,this._origin,this._rtcPos),this._rootNode.origin=this._origin,this._rootNode.position=this._rtcPos}},{key:"_setDir",value:function(e){this._baseDir.set(e),this._rootNode.quaternion=J.vec3PairToQuaternion(uE,e,AE)}},{key:"_setSectionPlaneDir",value:function(e){this._sectionPlane&&(this._ignoreNextSectionPlaneDirUpdate=!0,this._sectionPlane.dir=e)}},{key:"setVisible",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this._visible!==e){var t;for(t in this._visible=e,this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].visible=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].visible=e)}}},{key:"getVisible",value:function(){return this._visible}},{key:"setCulled",value:function(e){var t;for(t in this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].culled=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].culled=e)}},{key:"_createNodes",value:function(){var e=!1,t=this._viewer.scene,i=.01;this._rootNode=new Bn(t,{id:this.id,position:[0,0,0],scale:[5,5,5],isObject:!1});var s,r,n=this._rootNode,o={arrowHead:new Ti(n,an({radiusTop:.001,radiusBottom:.07,radialSegments:32,heightSegments:1,height:.2,openEnded:!1})),arrowHeadBig:new Ti(n,an({radiusTop:.001,radiusBottom:.09,radialSegments:32,heightSegments:1,height:.25,openEnded:!1})),arrowHeadHandle:new Ti(n,an({radiusTop:.09,radiusBottom:.09,radialSegments:8,heightSegments:1,height:.37,openEnded:!1})),curve:new Ti(n,Yn({radius:.8,tube:i,radialSegments:64,tubeSegments:14,arc:2*Math.PI/4})),curveHandle:new Ti(n,Yn({radius:.8,tube:.06,radialSegments:64,tubeSegments:14,arc:2*Math.PI/4})),hoop:new Ti(n,Yn({radius:.8,tube:i,radialSegments:64,tubeSegments:8,arc:2*Math.PI})),axis:new Ti(n,an({radiusTop:i,radiusBottom:i,radialSegments:20,heightSegments:1,height:1,openEnded:!1})),axisHandle:new Ti(n,an({radiusTop:.08,radiusBottom:.08,radialSegments:20,heightSegments:1,height:1,openEnded:!1}))},a={pickable:new Qi(n,{diffuse:[1,1,0],alpha:0,alphaMode:"blend"}),red:new Qi(n,{diffuse:[1,0,0],emissive:[1,0,0],ambient:[0,0,0],specular:[.6,.6,.3],shininess:80,lineWidth:2}),highlightRed:new Vi(n,{edges:!1,fill:!0,fillColor:[1,0,0],fillAlpha:.6}),green:new Qi(n,{diffuse:[0,1,0],emissive:[0,1,0],ambient:[0,0,0],specular:[.6,.6,.3],shininess:80,lineWidth:2}),highlightGreen:new Vi(n,{edges:!1,fill:!0,fillColor:[0,1,0],fillAlpha:.6}),blue:new Qi(n,{diffuse:[0,0,1],emissive:[0,0,1],ambient:[0,0,0],specular:[.6,.6,.3],shininess:80,lineWidth:2}),highlightBlue:new Vi(n,{edges:!1,fill:!0,fillColor:[0,0,1],fillAlpha:.2}),center:new Qi(n,{diffuse:[0,0,0],emissive:[0,0,0],ambient:[0,0,0],specular:[.6,.6,.3],shininess:80}),highlightBall:new Vi(n,{edges:!1,fill:!0,fillColor:[.5,.5,.5],fillAlpha:.5,vertices:!1}),highlightPlane:new Vi(n,{edges:!0,edgeWidth:3,fill:!1,fillColor:[.5,.5,.5],fillAlpha:.5,vertices:!1})};this._displayMeshes={plane:n.addChild(new nn(n,{geometry:new Ti(n,{primitive:"triangles",positions:[.5,.5,0,.5,-.5,0,-.5,-.5,0,-.5,.5,0,.5,.5,-0,.5,-.5,-0,-.5,-.5,-0,-.5,.5,-0],indices:[0,1,2,2,3,0]}),material:new Qi(n,{emissive:[0,0,0],diffuse:[0,0,0],backfaces:!0}),opacity:.6,ghosted:!0,ghostMaterial:new Vi(n,{edges:!1,filled:!0,fillColor:[1,1,0],edgeColor:[0,0,0],fillAlpha:.1,backfaces:!0}),pickable:!1,collidable:!1,clippable:!1,visible:!1,scale:[2.4,2.4,1],isObject:!1}),e),planeFrame:n.addChild(new nn(n,{geometry:new Ti(n,Yn({center:[0,0,0],radius:1.7,tube:.02,radialSegments:4,tubeSegments:4,arc:2*Math.PI})),material:new Qi(n,{emissive:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],shininess:0}),highlightMaterial:new Vi(n,{edges:!1,edgeColor:[0,0,0],filled:!0,fillColor:[.8,.8,.8],fillAlpha:1}),pickable:!1,collidable:!1,clippable:!1,visible:!1,scale:[1,1,.1],rotation:[0,0,45],isObject:!1}),e),xCurve:n.addChild(new nn(n,{geometry:o.curve,material:a.red,matrix:(s=J.rotationMat4v(90*J.DEGTORAD,[0,1,0],J.identityMat4()),r=J.rotationMat4v(270*J.DEGTORAD,[1,0,0],J.identityMat4()),J.mulMat4(r,s,J.identityMat4())),pickable:!1,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),xCurveHandle:n.addChild(new nn(n,{geometry:o.curveHandle,material:a.pickable,matrix:function(){var e=J.rotationMat4v(90*J.DEGTORAD,[0,1,0],J.identityMat4()),t=J.rotationMat4v(270*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),xCurveArrow1:n.addChild(new nn(n,{geometry:o.arrowHead,material:a.red,matrix:function(){var e=J.translateMat4c(0,-.07,-.8,J.identityMat4()),t=J.scaleMat4v([.6,.6,.6],J.identityMat4()),i=J.rotationMat4v(0*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(J.mulMat4(e,t,J.identityMat4()),i,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xCurveArrow2:n.addChild(new nn(n,{geometry:o.arrowHead,material:a.red,matrix:function(){var e=J.translateMat4c(0,-.8,-.07,J.identityMat4()),t=J.scaleMat4v([.6,.6,.6],J.identityMat4()),i=J.rotationMat4v(90*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(J.mulMat4(e,t,J.identityMat4()),i,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yCurve:n.addChild(new nn(n,{geometry:o.curve,material:a.green,rotation:[-90,0,0],pickable:!1,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),yCurveHandle:n.addChild(new nn(n,{geometry:o.curveHandle,material:a.pickable,rotation:[-90,0,0],pickable:!0,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),yCurveArrow1:n.addChild(new nn(n,{geometry:o.arrowHead,material:a.green,matrix:function(){var e=J.translateMat4c(.07,0,-.8,J.identityMat4()),t=J.scaleMat4v([.6,.6,.6],J.identityMat4()),i=J.rotationMat4v(90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(J.mulMat4(e,t,J.identityMat4()),i,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yCurveArrow2:n.addChild(new nn(n,{geometry:o.arrowHead,material:a.green,matrix:function(){var e=J.translateMat4c(.8,0,-.07,J.identityMat4()),t=J.scaleMat4v([.6,.6,.6],J.identityMat4()),i=J.rotationMat4v(90*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(J.mulMat4(e,t,J.identityMat4()),i,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),center:n.addChild(new nn(n,{geometry:new Ti(n,ln({radius:.05})),material:a.center,pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxisArrow:n.addChild(new nn(n,{geometry:o.arrowHead,material:a.red,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxisArrowHandle:n.addChild(new nn(n,{geometry:o.arrowHeadHandle,material:a.pickable,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxis:n.addChild(new nn(n,{geometry:o.axis,material:a.red,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxisHandle:n.addChild(new nn(n,{geometry:o.axisHandle,material:a.pickable,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yAxisArrow:n.addChild(new nn(n,{geometry:o.arrowHead,material:a.green,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yAxisArrowHandle:n.addChild(new nn(n,{geometry:o.arrowHeadHandle,material:a.pickable,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,opacity:.2,isObject:!1}),e),yShaft:n.addChild(new nn(n,{geometry:o.axis,material:a.green,position:[0,-.5,0],pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yShaftHandle:n.addChild(new nn(n,{geometry:o.axisHandle,material:a.pickable,position:[0,-.5,0],pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zAxisArrow:n.addChild(new nn(n,{geometry:o.arrowHead,material:a.blue,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[.8,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zAxisArrowHandle:n.addChild(new nn(n,{geometry:o.arrowHeadHandle,material:a.pickable,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[.8,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zShaft:n.addChild(new nn(n,{geometry:o.axis,material:a.blue,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),clippable:!1,pickable:!1,collidable:!1,visible:!1,isObject:!1}),e),zAxisHandle:n.addChild(new nn(n,{geometry:o.axisHandle,material:a.pickable,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),clippable:!1,pickable:!0,collidable:!1,visible:!1,isObject:!1}),e)},this._affordanceMeshes={planeFrame:n.addChild(new nn(n,{geometry:new Ti(n,Yn({center:[0,0,0],radius:2,tube:i,radialSegments:4,tubeSegments:4,arc:2*Math.PI})),material:new Qi(n,{ambient:[1,1,1],diffuse:[0,0,0],emissive:[1,1,0]}),highlighted:!0,highlightMaterial:new Vi(n,{edges:!1,filled:!0,fillColor:[1,1,0],fillAlpha:1}),pickable:!1,collidable:!1,clippable:!1,visible:!1,scale:[1,1,1],rotation:[0,0,45],isObject:!1}),e),xHoop:n.addChild(new nn(n,{geometry:o.hoop,material:a.red,highlighted:!0,highlightMaterial:a.highlightRed,matrix:function(){var e=J.rotationMat4v(90*J.DEGTORAD,[0,1,0],J.identityMat4()),t=J.rotationMat4v(270*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yHoop:n.addChild(new nn(n,{geometry:o.hoop,material:a.green,highlighted:!0,highlightMaterial:a.highlightGreen,rotation:[-90,0,0],pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zHoop:n.addChild(new nn(n,{geometry:o.hoop,material:a.blue,highlighted:!0,highlightMaterial:a.highlightBlue,matrix:J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4()),pickable:!1,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),xAxisArrow:n.addChild(new nn(n,{geometry:o.arrowHeadBig,material:a.red,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yAxisArrow:n.addChild(new nn(n,{geometry:o.arrowHeadBig,material:a.green,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zAxisArrow:n.addChild(new nn(n,{geometry:o.arrowHeadBig,material:a.blue,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[.8,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e)}}},{key:"_bindEvents",value:function(){var e=this,t=this,i=!1,s=-1,r=0,n=1,o=2,a=3,l=4,u=5,A=this._rootNode,c=null,h=null,d=J.vec2(),p=J.vec3([1,0,0]),f=J.vec3([0,1,0]),v=J.vec3([0,0,1]),g=this._viewer.scene.canvas.canvas,m=this._viewer.camera,_=this._viewer.scene,y=J.vec3([0,0,0]),b=-1;this._onCameraViewMatrix=_.camera.on("viewMatrix",(function(){})),this._onCameraProjMatrix=_.camera.on("projMatrix",(function(){})),this._onSceneTick=_.on("tick",(function(){var t=Math.abs(J.lenVec3(J.subVec3(_.camera.eye,e._pos,y)));if(t!==b&&"perspective"===m.projection){var i=.07*(Math.tan(m.perspective.fov*J.DEGTORAD)*t);A.scale=[i,i,i],b=t}if("ortho"===m.projection){var s=m.ortho.scale/10;A.scale=[s,s,s],b=t}}));var B,x,w,P,C,M=function(){var e=new Float64Array(2);return function(t){if(t){for(var i=t.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;e[0]=t.pageX-s,e[1]=t.pageY-r}else t=window.event,e[0]=t.x,e[1]=t.y;return e}}(),k=function(){var e=new Float64Array(2);return function(t){if(t||(t=window.event),t.touches&&t.touches.length)e[0]=t.touches[0].pageX,e[1]=t.touches[0].pageY;else{for(var i=t.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;e[0]=t.pageX-s,e[1]=t.pageY-r}return e}}(),F=function(){var e=J.mat4();return function(i,s){return J.quaternionToMat4(t._rootNode.quaternion,e),J.transformVec3(e,i,s),J.normalizeVec3(s),s}}(),E=(B=J.vec3(),function(e){var t=Math.abs(e[0]);return t>Math.abs(e[1])&&t>Math.abs(e[2])?J.cross3Vec3(e,[0,1,0],B):J.cross3Vec3(e,[1,0,0],B),J.cross3Vec3(B,e,B),J.normalizeVec3(B),B}),D=(x=J.vec3(),w=J.vec3(),P=J.vec4(),function(e,i,s){F(e,P);var r=E(P,i,s);S(i,r,x),S(s,r,w),J.subVec3(w,x);var n=J.dotVec3(w,P);t._pos[0]+=P[0]*n*.6,t._pos[1]+=P[1]*n*.6,t._pos[2]+=P[2]*n*.6,t._rootNode.position=t._pos,t._sectionPlane&&(t._sectionPlane.pos=t._pos)}),I=function(){var e=J.vec4(),i=J.vec4(),s=J.vec4(),r=J.vec4();return function(n,o,a){if(F(n,r),!(S(o,r,e)&&S(a,r,i))){var l=E(r,o,a);S(o,l,e,1),S(a,l,i,1);var u=J.dotVec3(e,r);e[0]-=u*r[0],e[1]-=u*r[1],e[2]-=u*r[2],u=J.dotVec3(i,r),i[0]-=u*r[0],i[1]-=u*r[1],i[2]-=u*r[2]}J.normalizeVec3(e),J.normalizeVec3(i),u=J.dotVec3(e,i),u=J.clamp(u,-1,1);var A=Math.acos(u)*J.RADTODEG;J.cross3Vec3(e,i,s),J.dotVec3(s,r)<0&&(A=-A),t._rootNode.rotate(n,A),T()}}(),S=function(){var e=J.vec4([0,0,0,1]),i=J.mat4();return function(s,r,n,o){o=o||0,e[0]=s[0]/g.width*2-1,e[1]=-(s[1]/g.height*2-1),e[2]=0,e[3]=1,J.mulMat4(m.projMatrix,m.viewMatrix,i),J.inverseMat4(i),J.transformVec4(i,e,e),J.mulVec4Scalar(e,1/e[3]);var a=m.eye;J.subVec4(e,a,e);var l=t._sectionPlane.pos,u=-J.dotVec3(l,r)-o,A=J.dotVec3(r,e);if(Math.abs(A)>.005){var c=-(J.dotVec3(r,a)+u)/A;return J.mulVec3Scalar(e,c,n),J.addVec3(n,a),J.subVec3(n,l,n),!0}return!1}}(),T=function(){var e=J.vec3(),i=J.mat4();return function(){t.sectionPlane&&(J.quaternionToMat4(A.quaternion,i),J.transformVec3(i,[0,0,1],e),t._setSectionPlaneDir(e))}}(),L=!1;this._onCameraControlHover=this._viewer.cameraControl.on("hoverEnter",(function(t){if(e._visible&&!L){var u;switch(i=!1,C&&(C.visible=!1),t.entity.id){case e._displayMeshes.xAxisArrowHandle.id:case e._displayMeshes.xAxisHandle.id:u=e._affordanceMeshes.xAxisArrow,c=r;break;case e._displayMeshes.yAxisArrowHandle.id:case e._displayMeshes.yShaftHandle.id:u=e._affordanceMeshes.yAxisArrow,c=n;break;case e._displayMeshes.zAxisArrowHandle.id:case e._displayMeshes.zAxisHandle.id:u=e._affordanceMeshes.zAxisArrow,c=o;break;case e._displayMeshes.xCurveHandle.id:u=e._affordanceMeshes.xHoop,c=a;break;case e._displayMeshes.yCurveHandle.id:u=e._affordanceMeshes.yHoop,c=l;break;default:return void(c=s)}u&&(u.visible=!0),C=u,i=!0}})),this._onCameraControlHoverLeave=this._viewer.cameraControl.on("hoverOut",(function(t){e._visible&&(C&&(C.visible=!1),C=null,c=s,i=!1)})),g.addEventListener("mousedown",this._canvasMouseDownListener=function(t){if(t.preventDefault(),e._visible&&i&&(e._viewer.cameraControl.pointerEnabled=!1,1===t.which)){L=!0;var s=M(t);h=c,d[0]=s[0],d[1]=s[1],e.plugin.fire("clickPlaneStart")}}),g.addEventListener("mousemove",this._canvasMouseMoveListener=function(t){if(e._visible&&L){var i=M(t),s=i[0],A=i[1];switch(h){case r:D(p,d,i);break;case n:D(f,d,i);break;case o:D(v,d,i);break;case a:I(p,d,i);break;case l:I(f,d,i);break;case u:I(v,d,i)}d[0]=s,d[1]=A}}),g.addEventListener("mouseup",this._canvasMouseUpListener=function(t){e._visible&&(e._viewer.cameraControl.pointerEnabled=!0,L&&(t.which,L=!1,i=!1,e.plugin.fire("clickPlaneEnd")))}),g.addEventListener("wheel",this._canvasWheelListener=function(t){if(e._visible)Math.max(-1,Math.min(1,40*-t.deltaY))}),this._onCameraControlHover=this._viewer.cameraControl.on("touchEntity",(function(t){if(e._visible&&!L&&!i){var u;switch(i=!1,C&&(C.visible=!1),t.entity.id){case e._displayMeshes.xAxisArrowHandle.id:case e._displayMeshes.xAxisHandle.id:u=e._affordanceMeshes.xAxisArrow,c=r;break;case e._displayMeshes.yAxisArrowHandle.id:case e._displayMeshes.yShaftHandle.id:u=e._affordanceMeshes.yAxisArrow,c=n;break;case e._displayMeshes.zAxisArrowHandle.id:case e._displayMeshes.zAxisHandle.id:u=e._affordanceMeshes.zAxisArrow,c=o;break;case e._displayMeshes.xCurveHandle.id:u=e._affordanceMeshes.xHoop,c=a;break;case e._displayMeshes.yCurveHandle.id:u=e._affordanceMeshes.yHoop,c=l;break;default:return void(c=s)}u&&(u.visible=!0),C=u,i=!0}})),g.addEventListener("touchstart",this._canvasMouseDownListener=function(t){if(t.preventDefault(),e._visible&&i){e._viewer.cameraControl.pointerEnabled=!1,L=!0;var s=k(t);h=c,d[0]=s[0],d[1]=s[1],e.plugin.fire("touchPlaneStart")}}),g.addEventListener("touchmove",this._canvasMouseMoveListener=function(t){if(e._visible&&L){var i=k(t),s=i[0],A=i[1];switch(h){case r:D(p,d,i);break;case n:D(f,d,i);break;case o:D(v,d,i);break;case a:I(p,d,i);break;case l:I(f,d,i);break;case u:I(v,d,i)}d[0]=s,d[1]=A}}),g.addEventListener("touchend",this._canvasTouchEndListener=function(t){e._visible&&(e._viewer.cameraControl.pointerEnabled=!0,C&&(C.visible=!1),C=null,c=s,L=!1,i=!1,e.plugin.fire("touchPlaneEnd"))}),g.addEventListener("touchcancel",this._canvasTouchEndListener)}},{key:"_destroy",value:function(){this._unbindEvents(),this._destroyNodes()}},{key:"_unbindEvents",value:function(){var e=this._viewer,t=e.scene,i=t.canvas.canvas,s=e.camera,r=e.cameraControl;t.off(this._onSceneTick),i.removeEventListener("mousedown",this._canvasMouseDownListener),i.removeEventListener("mousemove",this._canvasMouseMoveListener),i.removeEventListener("mouseup",this._canvasMouseUpListener),i.removeEventListener("wheel",this._canvasWheelListener),i.removeEventListener("touchend",this._canvasTouchEndListener),i.removeEventListener("touchcancel",this._canvasTouchEndListener),s.off(this._onCameraViewMatrix),s.off(this._onCameraProjMatrix),r.off(this._onCameraControlHover),r.off(this._onCameraControlHoverLeave)}},{key:"_destroyNodes",value:function(){this._setSectionPlane(null),this._rootNode.destroy(),this._displayMeshes={},this._affordanceMeshes={}}}])}(),hE=new Float64Array([0,0,1]),dE=new Float64Array(4),pE=function(){return w((function e(t,i){B(this,e),this.id=i.id,this.type="control",this.plugin=t,this._viewer=t.viewer,this._scene=t.viewer.scene,i||(i={}),this._xColor=i.xColor?i.xColor:[.5,.5,.5],this._yColor=i.yColor?i.yColor:[.5,.5,.5],this._zColor=i.zColor?i.zColor:[.5,.5,.5],this._controlFillColor=i.controlFillColor?i.controlFillColor:[.1,.4,.99],this._planeSize=i.planeSize?i.planeSize:1,this._controlSize=i.controlSize?i.controlSize:.07,this._planeOpacity=i.planeOpacity?i.planeOpacity:.4,this._visible=!1,this._pos=J.vec3(),this._origin=J.vec3(),this._rtcPos=J.vec3(),this._baseDir=J.vec3(),this._rootNode=null,this._displayMeshes=null,this._affordanceMeshes=null,this._ignoreNextSectionPlaneDirUpdate=!1}),[{key:"_createNodes",value:function(){var e=!1,t=this._viewer.scene,i=t.aabb,s=.01,r=i[3]-i[0],n=i[4]-i[1],o=i[5]-i[2];this._rootNode=new Bn(t,{id:"sectionControl",position:[0,0,0],scale:[5,5,5],isObject:!1});var a,l,u=this._rootNode,A={arrowHead:new Ti(u,an({radiusTop:.001,radiusBottom:.04,radialSegments:32,heightSegments:1,height:.15,openEnded:!1})),arrowHeadBig:new Ti(u,an({radiusTop:.001,radiusBottom:.05,radialSegments:32,heightSegments:1,height:.18,openEnded:!1})),arrowHeadHandle:new Ti(u,an({radiusTop:.09,radiusBottom:.09,radialSegments:8,heightSegments:1,height:.37,openEnded:!1})),curve:new Ti(u,Yn({radius:.5,tube:s,radialSegments:32,tubeSegments:7,arc:2*Math.PI/4})),curveHandle:new Ti(u,Yn({radius:.5,tube:.04,radialSegments:32,tubeSegments:7,arc:2*Math.PI/4})),hoop:new Ti(u,Yn({radius:.8,tube:s,radialSegments:64,tubeSegments:8,arc:2*Math.PI})),axis:new Ti(u,an({radiusTop:s,radiusBottom:s,radialSegments:20,heightSegments:1,height:1,openEnded:!1})),axisHandle:new Ti(u,an({radiusTop:.08,radiusBottom:.08,radialSegments:20,heightSegments:1,height:1,openEnded:!1}))},c={pickable:new Qi(u,{diffuse:[1,1,0],alpha:0,alphaMode:"opaque"}),red:new Qi(u,{diffuse:this._xColor,emissive:this._xColor,ambient:[0,0,0],specular:[.6,.6,.3],shininess:80,lineWidth:1.5}),highlightRed:new Vi(u,{edges:!1,fill:!0,fillColor:[.8,.8,.8],fillAlpha:.6}),green:new Qi(u,{diffuse:this._yColor,emissive:this._yColor,ambient:[0,0,0],specular:[.6,.6,.3],shininess:80,lineWidth:1.5}),highlightGreen:new Vi(u,{edges:!1,fill:!0,fillColor:[.8,.8,.8],fillAlpha:.6}),blue:new Qi(u,{diffuse:this._zColor,emissive:this._zColor,ambient:[0,0,0],specular:[.6,.6,.3],shininess:80,lineWidth:1.5}),highlightBlue:new Vi(u,{edges:!1,fill:!0,fillColor:[.8,.8,.8],fillAlpha:.2}),center:new Qi(u,{diffuse:[0,0,0],emissive:[0,0,0],ambient:[0,0,0],specular:[.6,.6,.3],shininess:80}),highlightBall:new Vi(u,{edges:!1,fill:!0,fillColor:[.5,.5,.5],fillAlpha:.5,vertices:!1}),highlightPlane:new Vi(u,{edges:!0,edgeWidth:3,fill:!1,fillColor:[.5,.5,.5],fillAlpha:.5,vertices:!1})};this._displayMeshes={plane:u.addChild(new nn(u,{geometry:new Ti(u,{primitive:"triangles",positions:[10,5,0,10,-5,0,-10,-5,0,-10,5,0],indices:[0,1,2,2,3,0]}),material:new Qi(u,{emissive:[0,0,0],diffuse:this._controlFillColor,backfaces:!0}),opacity:this._planeOpacity,ghosted:!1,ghostMaterial:new Vi(u,{edges:!1,filled:!0,fillColor:this._controlFillColor?this._controlFillColor:[.1,.4,.99],edgeColor:[0,0,0],fillAlpha:.1,backfaces:!0}),pickable:!0,collidable:!1,clippable:!1,visible:!1,scale:[this._planeSize,this._planeSize,this._planeSize],isObject:!1}),e),planeFrame:u.addChild(new nn(u,{geometry:new Ti(u,Wn({center:[0,0,0],xSize:.1*r,ySize:.1*n,zSize:.1*o})),material:new Qi(u,{emissive:[.5,.5,.5],diffuse:[.5,.5,.5],specular:[.5,.5,.5],alpha:.2,shininess:10}),highlightMaterial:new Vi(u,{edges:!1,edgeColor:[0,0,0],filled:!0,fillColor:[.8,.8,.8],fillAlpha:1}),pickable:!1,collidable:!1,clippable:!1,visible:!1,scale:[1,1,1],isObject:!1}),e),xCurve:u.addChild(new nn(u,{geometry:A.curve,material:c.red,matrix:(a=J.rotationMat4v(90*J.DEGTORAD,[0,1,0],J.identityMat4()),l=J.rotationMat4v(270*J.DEGTORAD,[1,0,0],J.identityMat4()),J.mulMat4(l,a,J.identityMat4())),pickable:!1,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),xCurveHandle:u.addChild(new nn(u,{geometry:A.curveHandle,material:c.pickable,matrix:function(){var e=J.rotationMat4v(90*J.DEGTORAD,[0,1,0],J.identityMat4()),t=J.rotationMat4v(270*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),yCurve:u.addChild(new nn(u,{geometry:A.curve,material:c.green,rotation:[-90,0,0],pickable:!1,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),yCurveHandle:u.addChild(new nn(u,{geometry:A.curveHandle,material:c.pickable,rotation:[-90,0,0],pickable:!0,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),center:u.addChild(new nn(u,{geometry:new Ti(u,ln({radius:.05})),material:c.center,pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxisArrow:u.addChild(new nn(u,{geometry:A.arrowHead,material:c.red,matrix:function(){var e=J.translateMat4c(0,1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxisArrowHandle:u.addChild(new nn(u,{geometry:A.arrowHeadHandle,material:c.pickable,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxis:u.addChild(new nn(u,{geometry:A.axis,material:c.red,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),xAxisHandle:u.addChild(new nn(u,{geometry:A.axisHandle,material:c.pickable,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yAxisArrow:u.addChild(new nn(u,{geometry:A.arrowHead,material:c.green,matrix:function(){var e=J.translateMat4c(0,1,0,J.identityMat4()),t=J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yAxisArrowHandle:u.addChild(new nn(u,{geometry:A.arrowHeadHandle,material:c.pickable,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,opacity:.2,isObject:!1}),e),yShaft:u.addChild(new nn(u,{geometry:A.axis,material:c.green,position:[0,-.5,0],pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yShaftHandle:u.addChild(new nn(u,{geometry:A.axisHandle,material:c.pickable,position:[0,-.5,0],pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zAxisArrow:u.addChild(new nn(u,{geometry:A.arrowHead,material:c.blue,matrix:function(){var e=J.translateMat4c(0,1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[2,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zAxisArrowHandle:u.addChild(new nn(u,{geometry:A.arrowHeadHandle,material:c.pickable,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[.8,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!0,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zShaft:u.addChild(new nn(u,{geometry:A.axis,material:c.blue,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),clippable:!1,pickable:!1,collidable:!1,visible:!1,isObject:!1}),e),zAxisHandle:u.addChild(new nn(u,{geometry:A.axisHandle,material:c.pickable,matrix:function(){var e=J.translateMat4c(0,.5,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),clippable:!1,pickable:!0,collidable:!1,visible:!1,isObject:!1}),e)},this._affordanceMeshes={xHoop:u.addChild(new nn(u,{geometry:A.hoop,material:c.red,highlighted:!0,highlightMaterial:c.highlightRed,matrix:function(){var e=J.rotationMat4v(90*J.DEGTORAD,[0,1,0],J.identityMat4()),t=J.rotationMat4v(270*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yHoop:u.addChild(new nn(u,{geometry:A.hoop,material:c.green,highlighted:!0,highlightMaterial:c.highlightGreen,rotation:[-90,0,0],pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zHoop:u.addChild(new nn(u,{geometry:A.hoop,material:c.blue,highlighted:!0,highlightMaterial:c.highlightBlue,matrix:J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4()),pickable:!1,collidable:!1,clippable:!1,backfaces:!0,visible:!1,isObject:!1}),e),xAxisArrow:u.addChild(new nn(u,{geometry:A.arrowHeadBig,material:c.red,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[0,0,1],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),yAxisArrow:u.addChild(new nn(u,{geometry:A.arrowHeadBig,material:c.green,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(180*J.DEGTORAD,[1,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e),zAxisArrow:u.addChild(new nn(u,{geometry:A.arrowHeadBig,material:c.blue,matrix:function(){var e=J.translateMat4c(0,1.1,0,J.identityMat4()),t=J.rotationMat4v(-90*J.DEGTORAD,[.8,0,0],J.identityMat4());return J.mulMat4(t,e,J.identityMat4())}(),pickable:!1,collidable:!1,clippable:!1,visible:!1,isObject:!1}),e)}}},{key:"_setSectionPlane",value:function(e){var t=this;this._sectionPlane&&(this._sectionPlane.off(this._onSectionPlanePos),this._sectionPlane.off(this._onSectionPlaneDir),this._onSectionPlanePos=null,this._onSectionPlaneDir=null,this._sectionPlane=null),e&&(this.id=e.controlId,this._createNodes(),this._bindEvents(),this._setPos(e.pos),this._setDir(e.dir),this._sectionPlane=e,this._onSectionPlanePos=e.on("pos",(function(){t._setPos(t._sectionPlane.pos)})),this._onSectionPlaneDir=e.on("dir",(function(){t._ignoreNextSectionPlaneDirUpdate?t._ignoreNextSectionPlaneDirUpdate=!1:t._setDir(t._sectionPlane.dir)})))}},{key:"sectionPlane",get:function(){return this._sectionPlane}},{key:"pos",get:function(){return this.posRate},set:function(e){if(!(e<0||e>100)){var t=this._scene.aabb,i=this._scene.camera.look,s=t[3]-t[0],r=t[4]-t[1],n=t[5]-t[2],o=J.vec3();o[0]=this.pos[0],o[1]=this.pos[1],o[2]=this.pos[2];var a,l=this._sectionPlane.dir;0!=l[0]?(a=e/100*s,o[0]=i[0]-s/2+a):0!=l[1]?(a=e/100*r,o[1]=i[1]-r/2+a):0!=l[2]&&(a=e/100*n,o[2]=i[2]-n/2+a),this._sectionPlane.pos=o}}},{key:"posRate",get:function(){var e=this._scene.aabb,t=this._scene.center,i=e[3]-e[0],s=e[4]-e[1],r=e[5]-e[2],n=this._sectionPlane.pos,o=this._sectionPlane.dir,a=0;if(0!=o[0])a=(n[0]-(t[0]-i/2))/i*100;else if(0!=o[1]){a=(n[1]-(t[1]-s/2))/s*100}else if(0!=o[2]){a=(n[2]-(t[2]-r/2))/r*100}return a=Math.max(0,Math.min(100,a)),parseInt(a)}},{key:"_setPos",value:function(e){this._pos.set(e),xe(this._pos,this._origin,this._rtcPos),this._rootNode.origin=this._origin,this._rootNode.position=this._rtcPos}},{key:"_setDir",value:function(e){this._baseDir.set(e),this._rootNode.quaternion=J.vec3PairToQuaternion(hE,e,dE)}},{key:"_setSectionPlaneDir",value:function(e){this._sectionPlane&&(this._ignoreNextSectionPlaneDirUpdate=!0,this._sectionPlane.dir=e)}},{key:"setVisible",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this._visible!==e){var t;for(t in this._visible=e,this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].visible=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].visible=e)}}},{key:"getVisible",value:function(){return this._visible}},{key:"setCulled",value:function(e){var t;for(t in this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].culled=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].culled=e)}},{key:"_bindEvents",value:function(){var e=this,t=this,i=!1,s=-1,r=0,n=1,o=2,a=3,l=4,u=5,A=this._rootNode,c=null,h=null,d=J.vec2(),p=J.vec3([1,0,0]),f=J.vec3([0,1,0]),v=J.vec3([0,0,1]),g=this._viewer.scene.canvas.canvas,m=this._viewer.camera,_=this._viewer.scene,y=J.vec3([0,0,0]),b=-1;this._onCameraViewMatrix=_.camera.on("viewMatrix",(function(){})),this._onCameraProjMatrix=_.camera.on("projMatrix",(function(){})),this._onSceneTick=_.on("tick",(function(){var t=Math.abs(J.lenVec3(J.subVec3(_.camera.eye,e._pos,y)));t!==b&&"perspective"===m.projection&&(Math.tan(m.perspective.fov*J.DEGTORAD),b=t),"ortho"===m.projection&&(m.ortho.scale,b=t)}));var B,x,w,P,C,M=function(){var e=new Float64Array(2);return function(t){if(t){for(var i=t.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;e[0]=t.pageX-s,e[1]=t.pageY-r}else t=window.event,e[0]=t.x,e[1]=t.y;return e}}(),k=function(){var e=new Float64Array(2);return function(t){if(t||(t=window.event),t.touches&&t.touches.length)e[0]=t.touches[0].pageX,e[1]=t.touches[0].pageY;else{for(var i=t.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;e[0]=t.pageX-s,e[1]=t.pageY-r}return e}}(),F=function(){var e=J.mat4();return function(i,s){return J.quaternionToMat4(t._rootNode.quaternion,e),J.transformVec3(e,i,s),J.normalizeVec3(s),s}}(),E=(B=J.vec3(),function(e){var t=Math.abs(e[0]);return t>Math.abs(e[1])&&t>Math.abs(e[2])?J.cross3Vec3(e,[0,1,0],B):J.cross3Vec3(e,[1,0,0],B),J.cross3Vec3(B,e,B),J.normalizeVec3(B),B}),D=(x=J.vec3(),w=J.vec3(),P=J.vec4(),function(e,i,s){F(e,P);var r=E(P,i,s);S(i,r,x),S(s,r,w),J.subVec3(w,x);var n=J.dotVec3(w,P);t._pos[0]+=P[0]*n*.6,t._pos[1]+=P[1]*n*.6,t._pos[2]+=P[2]*n*.6,t._rootNode.position=t._pos,t._sectionPlane&&(t._sectionPlane.pos=t._pos)}),I=function(){var e=J.vec4(),i=J.vec4(),s=J.vec4(),r=J.vec4();return function(n,o,a){if(F(n,r),!(S(o,r,e)&&S(a,r,i))){var l=E(r,o,a);S(o,l,e,1),S(a,l,i,1);var u=J.dotVec3(e,r);e[0]-=u*r[0],e[1]-=u*r[1],e[2]-=u*r[2],u=J.dotVec3(i,r),i[0]-=u*r[0],i[1]-=u*r[1],i[2]-=u*r[2]}J.normalizeVec3(e),J.normalizeVec3(i),u=J.dotVec3(e,i),u=J.clamp(u,-1,1);var A=Math.acos(u)*J.RADTODEG;J.cross3Vec3(e,i,s),J.dotVec3(s,r)<0&&(A=-A),t._rootNode.rotate(n,A),T()}}(),S=function(){var e=J.vec4([0,0,0,1]),i=J.mat4();return function(s,r,n,o){o=o||0,e[0]=s[0]/g.width*2-1,e[1]=-(s[1]/g.height*2-1),e[2]=0,e[3]=1,J.mulMat4(m.projMatrix,m.viewMatrix,i),J.inverseMat4(i),J.transformVec4(i,e,e),J.mulVec4Scalar(e,1/e[3]);var a=m.eye;J.subVec4(e,a,e);var l=t._sectionPlane.pos,u=-J.dotVec3(l,r)-o,A=J.dotVec3(r,e);if(Math.abs(A)>.005){var c=-(J.dotVec3(r,a)+u)/A;return J.mulVec3Scalar(e,c,n),J.addVec3(n,a),J.subVec3(n,l,n),!0}return!1}}(),T=function(){var e=J.vec3(),i=J.mat4();return function(){t.sectionPlane&&(J.quaternionToMat4(A.quaternion,i),J.transformVec3(i,[0,0,1],e),t._setSectionPlaneDir(e))}}(),L=!1;this._onCameraControlHover=this._viewer.cameraControl.on("hoverEnter",(function(t){if(e._visible&&!L){var u;switch(i=!1,C&&(C.visible=!1),t.entity.id){case e._displayMeshes.xAxisArrowHandle.id:case e._displayMeshes.xAxisHandle.id:u=e._affordanceMeshes.xAxisArrow,c=r;break;case e._displayMeshes.yAxisArrowHandle.id:case e._displayMeshes.yShaftHandle.id:u=e._affordanceMeshes.yAxisArrow,c=n;break;case e._displayMeshes.zAxisArrowHandle.id:case e._displayMeshes.zAxisHandle.id:u=e._affordanceMeshes.zAxisArrow,c=o;break;case e._displayMeshes.xCurveHandle.id:u=e._affordanceMeshes.xHoop,c=a;break;case e._displayMeshes.yCurveHandle.id:u=e._affordanceMeshes.yHoop,c=l;break;default:return void(c=s)}u&&(u.visible=!0),C=u,i=!0}})),this._onCameraControlHoverLeave=this._viewer.cameraControl.on("hoverOut",(function(t){e._visible&&(C&&(C.visible=!1),C=null,c=s,i=!1)})),g.addEventListener("mousedown",this._canvasMouseDownListener=function(t){if(t.preventDefault(),e._visible&&i&&(e._viewer.cameraControl.pointerEnabled=!1,1===t.which)){L=!0;var s=M(t);h=c,d[0]=s[0],d[1]=s[1],e.plugin.fire("clickPlaneStart")}}),g.addEventListener("mousemove",this._canvasMouseMoveListener=function(t){if(e._visible&&L&&i){var s=M(t),A=s[0],c=s[1];switch(h){case r:D(p,d,s);break;case n:D(f,d,s);break;case o:D(v,d,s);break;case a:I(p,d,s);break;case l:I(f,d,s);break;case u:I(v,d,s)}d[0]=A,d[1]=c}}),g.addEventListener("mouseup",this._canvasMouseUpListener=function(t){e._visible&&(e._viewer.cameraControl.pointerEnabled=!0,L&&(L=!1,i=!1,e.plugin.fire("clickPlaneEnd")))}),g.addEventListener("wheel",this._canvasWheelListener=function(t){if(e._visible)Math.max(-1,Math.min(1,40*-t.deltaY))}),this._onCameraControlHover=this._viewer.cameraControl.on("touchEntity",(function(t){if(e._visible&&!L&&!i){var u;switch(i=!1,C&&(C.visible=!1),t.entity.id){case e._displayMeshes.xAxisArrowHandle.id:case e._displayMeshes.xAxisHandle.id:u=e._affordanceMeshes.xAxisArrow,c=r;break;case e._displayMeshes.yAxisArrowHandle.id:case e._displayMeshes.yShaftHandle.id:u=e._affordanceMeshes.yAxisArrow,c=n;break;case e._displayMeshes.zAxisArrowHandle.id:case e._displayMeshes.zAxisHandle.id:u=e._affordanceMeshes.zAxisArrow,c=o;break;case e._displayMeshes.xCurveHandle.id:u=e._affordanceMeshes.xHoop,c=a;break;case e._displayMeshes.yCurveHandle.id:u=e._affordanceMeshes.yHoop,c=l;break;default:return void(c=s)}u&&(u.visible=!0),C=u,i=!0}})),g.addEventListener("touchstart",this._canvasMouseDownListener=function(t){if(t.preventDefault(),e._visible&&i){e._viewer.cameraControl.pointerEnabled=!1,L=!0;var s=k(t);h=c,d[0]=s[0],d[1]=s[1],e.plugin.fire("touchPlaneStart")}}),g.addEventListener("touchmove",this._canvasMouseMoveListener=function(t){if(e._visible&&L){var i=k(t),s=i[0],A=i[1];switch(h){case r:D(p,d,i);break;case n:D(f,d,i);break;case o:D(v,d,i);break;case a:I(p,d,i);break;case l:I(f,d,i);break;case u:I(v,d,i)}d[0]=s,d[1]=A}}),g.addEventListener("touchend",this._canvasTouchEndListener=function(t){e._visible&&(e._viewer.cameraControl.pointerEnabled=!0,C&&(C.visible=!1),C=null,c=s,L=!1,i=!1,e.plugin.fire("touchPlaneEnd"))}),g.addEventListener("touchcancel",this._canvasTouchEndListener)}},{key:"_destroy",value:function(){this._unbindEvents(),this._destroyNodes()}},{key:"_unbindEvents",value:function(){var e=this._viewer,t=e.scene,i=t.canvas.canvas,s=e.camera,r=e.cameraControl;t.off(this._onSceneTick),i.removeEventListener("mousedown",this._canvasMouseDownListener),i.removeEventListener("mousemove",this._canvasMouseMoveListener),i.removeEventListener("mouseup",this._canvasMouseUpListener),i.removeEventListener("wheel",this._canvasWheelListener),i.removeEventListener("touchend",this._canvasTouchEndListener),i.removeEventListener("touchcancel",this._canvasTouchEndListener),s.off(this._onCameraViewMatrix),s.off(this._onCameraProjMatrix),r.off(this._onCameraControlHover),r.off(this._onCameraControlHoverLeave)}},{key:"_destroyNodes",value:function(){this._setSectionPlane(null),this._rootNode.destroy(),this._displayMeshes={},this._affordanceMeshes={}}}])}(),fE=new Float64Array([0,0,1]),vE=new Float64Array(4),gE=function(){return w((function e(t,i){B(this,e),this.id=i.id,this.type="plane",this.plugin=t,this._viewer=t.viewer,this._scene=t.viewer.scene,i?(this._controlFillColor=i.controlFillColor?i.controlFillColor:[.3,.6,1],this._planeSize=i.planeSize?i.planeSize:1,this._controlSize=i.controlSize?i.controlSize:.07,this._planeOpacity=i.planeOpacity?i.planeOpacity:.4,this._enableClip=!!i.enableClip):(this._controlFillColor=[.3,.6,1],this._planeSize=1,this._controlSize=.07,this._planeOpacity=.4,this._enableClip=!1),this._visible=!1,this._pos=J.vec3(),this._origin=J.vec3(),this._rtcPos=J.vec3(),this._baseDir=J.vec3(),this._rootNode=null,this._displayMeshes=null,this._affordanceMeshes=null,this._ignoreNextSectionPlaneDirUpdate=!1}),[{key:"_createNodes",value:function(){var e=this._viewer.scene;this._rootNode=new Bn(e,{id:this.id,position:[0,0,0],scale:[1,1,1],isObject:!1});var t,i,s=this._rootNode,r=e.aabb,n=r[3]-r[0],o=r[4]-r[1],a=r[5]-r[2];0!=this.dir[0]?(t=a>0?1*a:1*a*-1,i=o>0?1*o:1*o*-1):0!=this.dir[1]?(t=n>0?1*n:1*n*-1,i=a>0?1*a:1*a*-1):0!=this.dir[2]&&(t=n>0?1*n:1*n*-1,i=o>0?1*o:1*o*-1),t+=0,i+=0,this._displayMeshes={plane:s.addChild(new nn(s,{geometry:new Ti(s,{primitive:"triangles",positions:[t/2,i/2,.01,t/2,-i/2,.01,-t/2,-i/2,.01,-t/2,i/2,.01],indices:[0,1,2,2,3,0]}),material:new Qi(s,{emissive:[.1,.1,.1],diffuse:this._controlFillColor,backfaces:!0}),opacity:this._planeOpacity,ghosted:!0,ghostMaterial:new Vi(s,{edges:!1,filled:!0,fillColor:this._controlFillColor,fillAlpha:.1,backfaces:!0}),pickable:this.pickable,collidable:!1,clippable:this._enableClip,visible:!1,scale:[1*this._planeSize,1*this._planeSize,1*this._planeSize],isObject:!1}),false)},this._affordanceMeshes={plane:s.addChild(new nn(s,{geometry:new Ti(s,{primitive:"triangles",positions:[t/2,i/2,.012,t/2,-i/2,.012,-t/2,-i/2,.012,-t/2,i/2,.012],indices:[0,1,2,2,3,0]}),material:new Qi(s,{emissive:[.6,.6,5],diffuse:this._controlFillColor,backfaces:!0}),opacity:this._planeOpacity,ghosted:!0,ghostMaterial:new Vi(s,{edges:!1,filled:!0,fillColor:this._controlFillColor,fillAlpha:.1,backfaces:!0}),pickable:!0,collidable:!1,clippable:!0,visible:!1,scale:[1*this._planeSize,1*this._planeSize,1*this._planeSize],isObject:!1}),false)}}},{key:"_setSectionPlane",value:function(e){var t=this;this._sectionPlane&&(this._sectionPlane.off(this._onSectionPlanePos),this._sectionPlane.off(this._onSectionPlaneDir),this._onSectionPlanePos=null,this._onSectionPlaneDir=null,this._sectionPlane=null),e&&(this.id=e.controlId,this.dir=e.dir,this._createNodes(),this._bindEvents(),this._setPos(e.pos),this._setDir(e.dir),this._sectionPlane=e,e.control=this,this._onSectionPlanePos=e.on("pos",(function(){t._setPos(t._sectionPlane.pos)})),this._onSectionPlaneDir=e.on("dir",(function(){t._ignoreNextSectionPlaneDirUpdate?t._ignoreNextSectionPlaneDirUpdate=!1:t._setDir(t._sectionPlane.dir)})))}},{key:"sectionPlane",get:function(){return this._sectionPlane}},{key:"pos",get:function(){return this._pos},set:function(e){if(!(e<0||e>100)){var t=this._scene.aabb,i=this._scene.center,s=t[3]-t[0],r=t[4]-t[1],n=t[5]-t[2],o=J.vec3();o[0]=this.pos[0],o[1]=this.pos[1],o[2]=this.pos[2];var a,l=this._sectionPlane.dir;0!=l[0]?(a=e/100*s,o[0]=i[0]-s/2+a):0!=l[1]?(a=e/100*r,o[1]=i[1]-r/2+a):0!=l[2]&&(a=e/100*n,o[2]=i[2]-n/2+a),this._sectionPlane.pos=o}}},{key:"posRate",get:function(){var e=this._scene.aabb,t=this._scene.center,i=e[3]-e[0],s=e[4]-e[1],r=e[5]-e[2],n=this._sectionPlane.pos,o=this._sectionPlane.dir,a=0;if(0!=o[0])a=(n[0]-(t[0]-i/2))/i*100;else if(0!=o[1]){a=(n[1]-(t[1]-s/2))/s*100}else if(0!=o[2]){a=(n[2]-(t[2]-r/2))/r*100}return a=Math.max(0,Math.min(100,a)),parseInt(a)}},{key:"_setPos",value:function(e){this._pos.set(e),xe(this._pos,this._origin,this._rtcPos),this._rootNode.origin=this._origin,this._rootNode.position=this._rtcPos}},{key:"_setDir",value:function(e){this._baseDir.set(e),this._rootNode.quaternion=J.vec3PairToQuaternion(fE,e,vE)}},{key:"_setSectionPlaneDir",value:function(e){this._sectionPlane&&(this._ignoreNextSectionPlaneDirUpdate=!0,this._sectionPlane.dir=e)}},{key:"setVisible",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this._visible!==e){var t;for(t in this._visible=e,this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].visible=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].visible=e)}}},{key:"getVisible",value:function(){return this._visible}},{key:"setCulled",value:function(e){var t;for(t in this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].culled=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].culled=e)}},{key:"_bindEvents",value:function(){var e=this,t=this,i=!1,s=-1,r=0,n=1,o=2;this._rootNode;var a=null,l=null,u=J.vec2();this.lastCanvasPos=u;var A=J.vec3([1,0,0]),c=J.vec3([0,1,0]),h=J.vec3([0,0,1]),d=this._viewer.scene.canvas.canvas,p=this._viewer.camera,f=this._viewer.scene;this._onCameraViewMatrix=f.camera.on("viewMatrix",(function(){})),this._onCameraProjMatrix=f.camera.on("projMatrix",(function(){}));var v,g,m,_,y,b=function(){var e=new Float64Array(2);return function(t){if(t){for(var i=t.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;e[0]=t.pageX-s,e[1]=t.pageY-r}else t=window.event,e[0]=t.x,e[1]=t.y;return e}}(),B=function(){var e=J.mat4();return function(i,s){return J.quaternionToMat4(t._rootNode.quaternion,e),J.transformVec3(e,i,s),J.normalizeVec3(s),s}}(),x=(v=J.vec3(),function(e){var t=Math.abs(e[0]);return t>Math.abs(e[1])&&t>Math.abs(e[2])?J.cross3Vec3(e,[0,1,0],v):J.cross3Vec3(e,[1,0,0],v),J.cross3Vec3(v,e,v),J.normalizeVec3(v),v}),w=(g=J.vec3(),m=J.vec3(),_=J.vec4(),function(e,i,s){B(e,_);var r=x(_,i,s);P(i,r,g),P(s,r,m),J.subVec3(m,g);var n,o=J.dotVec3(m,_),a=t._sectionPlane.dir,l=t._sectionPlane.planeId,u=t._sectionPlane.posRangeMin;if(n=t._sectionPlane.box.boxRanges[(l+3)%6],0!=a[0]){if(a[0]>0){if(n=t._sectionPlane.box.boxRanges[(l+3)%6],t._pos[0]+_[0]*o*.6<u[0]||t._pos[0]+_[0]*o*.6>n[0]-.3)return}else if(t._pos[0]+_[0]*o*.6>u[0]||t._pos[0]+_[0]*o*.6<n[0]+.3)return}else if(0!=a[1]){if(a[1]>0){if(t._pos[1]+_[1]*o*.6<u[1]||t._pos[1]+_[1]*o*.6>n[1]-.3)return}else if(t._pos[1]+_[1]*o*.6>u[1]||t._pos[1]+_[1]*o*.6<n[1]+.3)return}else if(0!=a[2])if(a[2]>0){if(t._pos[2]+_[2]*o*.6<u[2]||t._pos[2]+_[2]*o*.6>n[2]-.3)return}else if(t._pos[2]+_[2]*o*.6>u[2]||t._pos[2]+_[2]*o*.6<n[2]+.3)return;t._pos[0]+=_[0]*o*.6,t._pos[1]+=_[1]*o*.6,t._pos[2]+=_[2]*o*.6,t._rootNode.position=t._pos,t._sectionPlane&&(t._sectionPlane.pos=t._pos)}),P=function(){var e=J.vec4([0,0,0,1]),i=J.mat4();return function(s,r,n,o){o=o||0,e[0]=s[0]/d.width*2-1,e[1]=-(s[1]/d.height*2-1),e[2]=0,e[3]=1,J.mulMat4(p.projMatrix,p.viewMatrix,i),J.inverseMat4(i),J.transformVec4(i,e,e),J.mulVec4Scalar(e,1/e[3]);var a=p.eye;J.subVec4(e,a,e);var l=t._sectionPlane.pos,u=-J.dotVec3(l,r)-o,A=J.dotVec3(r,e);if(Math.abs(A)>.005){var c=-(J.dotVec3(r,a)+u)/A;return J.mulVec3Scalar(e,c,n),J.addVec3(n,a),J.subVec3(n,l,n),!0}return!1}}(),C=!1;this._onCameraControlHover=this._viewer.cameraControl.on("hoverEnter",(function(t){var r;e._visible&&(C||(i=!1,y&&(y.visible=!1),t.entity.id===e._displayMeshes.plane.id?(r=e._affordanceMeshes.plane,a=o,r&&(r.visible=!0),y=r,i=!0):a=s))})),this._onCameraControlHoverLeave=this._viewer.cameraControl.on("hoverOut",(function(t){e._visible&&(y&&(y.visible=!1),a=s,i=!1)})),d.addEventListener("mousedown",this._canvasMouseDownListener=function(t){if(t.preventDefault(),e._visible&&i&&(e._viewer.cameraControl.pointerEnabled=!1,1===t.which)){C=!0;var s=b(t);l=a,u[0]=s[0],u[1]=s[1],e.plugin.fire("clickPlaneStart")}}),d.addEventListener("mousemove",this._canvasMouseMoveListener=function(t){if(e._visible&&C){var i=b(t),s=i[0],a=i[1];switch(l){case r:w(A,u,i);break;case n:w(c,u,i);break;case o:w(h,u,i)}u[0]=s,u[1]=a}}),d.addEventListener("mouseup",this._canvasMouseUpListener=function(t){e._visible&&(e._viewer.cameraControl.pointerEnabled=!0,C&&(C=!1,i=!1,e.plugin.fire("clickPlaneEnd")))}),d.addEventListener("wheel",this._canvasWheelListener=function(t){if(e._visible)Math.max(-1,Math.min(1,40*-t.deltaY))})}},{key:"_destroy",value:function(){this._unbindEvents(),this._destroyNodes()}},{key:"_unbindEvents",value:function(){var e=this._viewer,t=e.scene,i=t.canvas.canvas,s=e.camera,r=e.cameraControl;t.off(this._onSceneTick),i.removeEventListener("mousedown",this._canvasMouseDownListener),i.removeEventListener("mousemove",this._canvasMouseMoveListener),i.removeEventListener("mouseup",this._canvasMouseUpListener),i.removeEventListener("wheel",this._canvasWheelListener),i.removeEventListener("touchend",this._canvasTouchEndListener),i.removeEventListener("touchcancel",this._canvasTouchEndListener),s.off(this._onCameraViewMatrix),s.off(this._onCameraProjMatrix),r.off(this._onCameraControlHover),r.off(this._onCameraControlHoverLeave)}},{key:"_destroyNodes",value:function(){this._setSectionPlane(null),this._rootNode.destroy(),this._displayMeshes={},this._affordanceMeshes={}}}])}(),mE=new Float64Array([0,0,1]),_E=new Float64Array(4),yE=function(){return w((function e(t,i){B(this,e),this.id=null,this.type="plane",this.plugin=t,this._viewer=t.viewer,this._scene=t.viewer.scene,this._controlFillColor=i&&i.controlFillColor?i.controlFillColor:[.1,.4,.99],this._planeSize=i&&i.planeSize?i.planeSize:1,this._controlSize=i&&i.controlSize?i.controlSize:.07,this._planeOpacity=i&&i.planeOpacity?i.planeOpacity:.4,this._visible=!1,this._pos=J.vec3(),this._origin=J.vec3(),this._rtcPos=J.vec3(),this._baseDir=J.vec3(),this._rootNode=null,this._displayMeshes=null,this._affordanceMeshes=null,this._ignoreNextSectionPlaneDirUpdate=!1,this._createNodes(),this._bindEvents()}),[{key:"_createNodes",value:function(){var e=this._viewer.scene;this._rootNode=new Bn(e,{position:[0,0,0],scale:[5,5,5],isObject:!1});var t=this._rootNode;this._displayMeshes={plane:t.addChild(new nn(t,{geometry:new Ti(t,{primitive:"triangles",positions:[.5,.5,.02,.5,-.5,.02,-.5,-.5,.02,-.5,.5,.02],indices:[0,1,2,2,3,0]}),material:new Qi(t,{emissive:[0,0,0],diffuse:this._controlFillColor,backfaces:!0}),opacity:this._planeOpacity,ghosted:!0,ghostMaterial:new Vi(t,{edges:!1,filled:!0,fillColor:this._controlFillColor?this._controlFillColor:[.1,.4,.99],fillAlpha:.1,backfaces:!0}),pickable:!0,collidable:!1,clippable:!1,visible:!1,scale:[2.4*this._planeSize,2.4*this._planeSize,1*this._planeSize],isObject:!1}),!1)},this._affordanceMeshes={}}},{key:"_setSectionPlane",value:function(e){var t=this;this._sectionPlane&&(this._sectionPlane.off(this._onSectionPlanePos),this._sectionPlane.off(this._onSectionPlaneDir),this._onSectionPlanePos=null,this._onSectionPlaneDir=null,this._sectionPlane=null),e&&(this.id=e.id,this._setPos(e.pos),this._setDir(e.dir),this._sectionPlane=e,e.control=this,this._onSectionPlanePos=e.on("pos",(function(){t._setPos(t._sectionPlane.pos)})),this._onSectionPlaneDir=e.on("dir",(function(){t._ignoreNextSectionPlaneDirUpdate?t._ignoreNextSectionPlaneDirUpdate=!1:t._setDir(t._sectionPlane.dir)})))}},{key:"sectionPlane",get:function(){return this._sectionPlane}},{key:"pos",get:function(){return this._pos},set:function(e){if(!(e<0||e>100)){var t=this._scene.aabb,i=this._scene.center,s=t[3]-t[0],r=t[4]-t[1],n=t[5]-t[2],o=J.vec3();o[0]=this.pos[0],o[1]=this.pos[1],o[2]=this.pos[2];var a,l=this._sectionPlane.dir;0!=l[0]?(a=e/100*s,o[0]=i[0]-s/2+a):0!=l[1]?(a=e/100*r,o[1]=i[1]-r/2+a):0!=l[2]&&(a=e/100*n,o[2]=i[2]-n/2+a),this._sectionPlane.pos=o}}},{key:"posRate",get:function(){var e=this._scene.aabb,t=this._scene.center,i=e[3]-e[0],s=e[4]-e[1],r=e[5]-e[2],n=this._sectionPlane.pos,o=this._sectionPlane.dir,a=0;if(0!=o[0])a=(n[0]-(t[0]-i/2))/i*100;else if(0!=o[1]){a=(n[1]-(t[1]-s/2))/s*100}else if(0!=o[2]){a=(n[2]-(t[2]-r/2))/r*100}return a=Math.max(0,Math.min(100,a)),parseInt(a)}},{key:"_setPos",value:function(e){this._pos.set(e),xe(this._pos,this._origin,this._rtcPos),this._rootNode.origin=this._origin,this._rootNode.position=this._rtcPos}},{key:"_setDir",value:function(e){this._baseDir.set(e),this._rootNode.quaternion=J.vec3PairToQuaternion(mE,e,_E)}},{key:"_setSectionPlaneDir",value:function(e){this._sectionPlane&&(this._ignoreNextSectionPlaneDirUpdate=!0,this._sectionPlane.dir=e)}},{key:"setVisible",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this._visible!==e){var t;for(t in this._visible=e,this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].visible=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].visible=e)}}},{key:"getVisible",value:function(){return this._visible}},{key:"setCulled",value:function(e){var t;for(t in this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].culled=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].culled=e)}},{key:"_bindEvents",value:function(){var e=this,t=this,i=!1,s=-1,r=0,n=1,o=2;this._rootNode;var a=null,l=null,u=J.vec2();this.lastCanvasPos=u;var A=J.vec3([1,0,0]),c=J.vec3([0,1,0]),h=J.vec3([0,0,1]),d=this._viewer.scene.canvas.canvas,p=this._viewer.camera,f=this._viewer.scene,v=J.vec3([0,0,0]),g=-1;this._onCameraViewMatrix=f.camera.on("viewMatrix",(function(){})),this._onCameraProjMatrix=f.camera.on("projMatrix",(function(){})),this._onSceneTick=f.on("tick",(function(){var t=Math.abs(J.lenVec3(J.subVec3(f.camera.eye,e._pos,v)));t!==g&&"perspective"===p.projection&&(Math.tan(p.perspective.fov*J.DEGTORAD),g=t),"ortho"===p.projection&&(p.ortho.scale,g=t)}));var m,_,y,b,B=function(){var e=new Float64Array(2);return function(t){if(t){for(var i=t.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;e[0]=t.pageX-s,e[1]=t.pageY-r}else t=window.event,e[0]=t.x,e[1]=t.y;return e}}(),x=function(){var e=new Float64Array(2);return function(t){if(t||(t=window.event),t.touches&&t.touches.length)e[0]=t.touches[0].pageX,e[1]=t.touches[0].pageY;else{for(var i=t.target,s=0,r=0;i.offsetParent;)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;e[0]=t.pageX-s,e[1]=t.pageY-r}return e}}(),w=function(){var e=J.mat4();return function(i,s){return J.quaternionToMat4(t._rootNode.quaternion,e),J.transformVec3(e,i,s),J.normalizeVec3(s),s}}(),P=(m=J.vec3(),function(e){var t=Math.abs(e[0]);return t>Math.abs(e[1])&&t>Math.abs(e[2])?J.cross3Vec3(e,[0,1,0],m):J.cross3Vec3(e,[1,0,0],m),J.cross3Vec3(m,e,m),J.normalizeVec3(m),m}),C=(_=J.vec3(),y=J.vec3(),b=J.vec4(),function(e,i,s){w(e,b);var r=P(b,i,s);M(i,r,_),M(s,r,y),J.subVec3(y,_);var n=J.dotVec3(y,b);t._pos[0]+=b[0]*n*.6,t._pos[1]+=b[1]*n*.6,t._pos[2]+=b[2]*n*.6,t._rootNode.position=t._pos,t._sectionPlane&&(t._sectionPlane.pos=t._pos)}),M=function(){var e=J.vec4([0,0,0,1]),i=J.mat4();return function(s,r,n,o){o=o||0,e[0]=s[0]/d.width*2-1,e[1]=-(s[1]/d.height*2-1),e[2]=0,e[3]=1,J.mulMat4(p.projMatrix,p.viewMatrix,i),J.inverseMat4(i),J.transformVec4(i,e,e),J.mulVec4Scalar(e,1/e[3]);var a=p.eye;J.subVec4(e,a,e);var l=t._sectionPlane.pos,u=-J.dotVec3(l,r)-o,A=J.dotVec3(r,e);if(Math.abs(A)>.005){var c=-(J.dotVec3(r,a)+u)/A;return J.mulVec3Scalar(e,c,n),J.addVec3(n,a),J.subVec3(n,l,n),!0}return!1}}(),k=!1;this._onCameraControlHover=this._viewer.cameraControl.on("hoverEnter",(function(t){e._visible&&(k||(i=!1,t.entity.id===e._displayMeshes.plane.id?(a=o,i=!0):a=s))})),this._onCameraControlHoverLeave=this._viewer.cameraControl.on("hoverOut",(function(t){e._visible&&(a=s,i=!1)})),d.addEventListener("mousedown",this._canvasMouseDownListener=function(t){if(t.preventDefault(),e._visible&&i&&(e._viewer.cameraControl.pointerEnabled=!1,1===t.which)){k=!0;var s=B(t);l=a,u[0]=s[0],u[1]=s[1],e.plugin.fire("clickPlaneStart")}}),d.addEventListener("mousemove",this._canvasMouseMoveListener=function(t){if(e._visible&&k){var i=B(t),s=i[0],a=i[1];switch(l){case r:C(A,u,i);break;case n:C(c,u,i);break;case o:C(h,u,i)}u[0]=s,u[1]=a}}),d.addEventListener("mouseup",this._canvasMouseUpListener=function(t){e._visible&&(e._viewer.cameraControl.pointerEnabled=!0,k&&(t.which,k=!1,i=!1,e.plugin.fire("clickPlaneEnd")))}),d.addEventListener("wheel",this._canvasWheelListener=function(t){if(e._visible)Math.max(-1,Math.min(1,40*-t.deltaY))}),this._onCameraControlHover=this._viewer.cameraControl.on("touchEntity",(function(t){var r;!e._visible||k||i||(t.entity.id===e._displayMeshes.plane.id?(r=e._affordanceMeshes.plane,a=o,r&&(r.visible=!0),i=!0,k=!0):a=s)})),d.addEventListener("touchstart",this._canvasMouseDownListener=function(t){if(t.preventDefault(),e._visible&&i&&k){e._viewer.cameraControl.pointerEnabled=!1;var s=x(t);l=a,u[0]=s[0],u[1]=s[1],e.plugin.fire("touchPlaneStart")}}),d.addEventListener("touchmove",this._canvasMouseMoveListener=function(t){if(e._visible&&k&&i){var s=x(t),a=s[0],d=s[1];switch(l){case r:C(A,u,s);break;case n:C(c,u,s);break;case o:C(h,u,s)}u[0]=a,u[1]=d}}),d.addEventListener("touchend",this._canvasTouchEndListener=function(t){e._visible&&(i&&(e._viewer.cameraControl.pointerEnabled=!0),a=s,k=!1,i=!1,e.plugin.fire("touchPlaneEnd"))}),d.addEventListener("touchcancel",this._canvasTouchEndListener)}},{key:"_destroy",value:function(){this._unbindEvents(),this._destroyNodes()}},{key:"_unbindEvents",value:function(){var e=this._viewer,t=e.scene,i=t.canvas.canvas,s=e.camera,r=e.cameraControl;t.off(this._onSceneTick),i.removeEventListener("mousedown",this._canvasMouseDownListener),i.removeEventListener("mousemove",this._canvasMouseMoveListener),i.removeEventListener("mouseup",this._canvasMouseUpListener),i.removeEventListener("wheel",this._canvasWheelListener),i.removeEventListener("touchend",this._canvasTouchEndListener),i.removeEventListener("touchcancel",this._canvasTouchEndListener),s.off(this._onCameraViewMatrix),s.off(this._onCameraProjMatrix),r.off(this._onCameraControlHover),r.off(this._onCameraControlHoverLeave)}},{key:"_destroyNodes",value:function(){this._setSectionPlane(null),this._rootNode.destroy(),this._displayMeshes={},this._affordanceMeshes={}}}])}(),bE=function(){return w((function e(t,i,s){var r=this;B(this,e),this.id=s.id,this._sectionPlane=s,this._mesh=new nn(i,{id:s.id,geometry:new Ti(i,Li({xSize:.5,ySize:.5,zSize:.001})),material:new Qi(i,{emissive:[1,1,1],diffuse:[0,0,0],backfaces:!1}),edgeMaterial:new ji(i,{edgeColor:[0,0,0],edgeAlpha:1,edgeWidth:1}),highlightMaterial:new Vi(i,{fill:!0,fillColor:[.5,1,.5],fillAlpha:.7,edges:!0,edgeColor:[0,0,0],edgeAlpha:1,edgeWidth:1}),selectedMaterial:new Vi(i,{fill:!0,fillColor:[0,0,1],fillAlpha:.7,edges:!0,edgeColor:[1,0,0],edgeAlpha:1,edgeWidth:1}),highlighted:!0,scale:[3,3,3],position:[0,0,0],rotation:[0,0,0],opacity:.3,edges:!0});var n=J.vec3([0,0,0]),o=J.vec3(),a=J.vec3([0,0,1]),l=J.vec4(4),u=J.vec3(),A=function(){var e=r._sectionPlane.scene.center,t=[-r._sectionPlane.dir[0],-r._sectionPlane.dir[1],-r._sectionPlane.dir[2]];J.subVec3(e,r._sectionPlane.pos,n);var i=-J.dotVec3(t,n);J.normalizeVec3(t),J.mulVec3Scalar(t,i,o);var s=J.vec3PairToQuaternion(a,r._sectionPlane.dir,l);u[0]=.1*o[0],u[1]=.1*o[1],u[2]=.1*o[2],r._mesh.quaternion=s,r._mesh.position=u};this._onSectionPlanePos=this._sectionPlane.on("pos",A),this._onSectionPlaneDir=this._sectionPlane.on("dir",A),this._highlighted=!1,this._selected=!1}),[{key:"setHighlighted",value:function(e){this._highlighted=!!e,this._mesh.highlighted=this._highlighted,this._mesh.highlightMaterial.fillColor=e?[0,.7,0]:[0,0,0]}},{key:"getHighlighted",value:function(){return this._highlighted}},{key:"setSelected",value:function(e){this._selected=!!e,this._mesh.edgeMaterial.edgeWidth=e?3:1,this._mesh.highlightMaterial.edgeWidth=e?3:1}},{key:"getSelected",value:function(){return this._selected}},{key:"destroy",value:function(){this._sectionPlane.off(this._onSectionPlanePos),this._sectionPlane.off(this._onSectionPlaneDir),this._mesh.destroy()}}])}(),BE=function(){return w((function e(t,i,s){var r=this;B(this,e),this.id=sectionPlane.id,this._sectionBox=s,this._mesh=new nn(i,{id:sectionPlane.id,geometry:new Ti(i,Li({xSize:.5,ySize:.5,zSize:.001})),material:new Qi(i,{emissive:[1,1,1],diffuse:[0,0,0],backfaces:!1}),edgeMaterial:new ji(i,{edgeColor:[0,0,0],edgeAlpha:1,edgeWidth:1}),highlightMaterial:new Vi(i,{fill:!0,fillColor:[.5,1,.5],fillAlpha:.7,edges:!0,edgeColor:[0,0,0],edgeAlpha:1,edgeWidth:1}),selectedMaterial:new Vi(i,{fill:!0,fillColor:[0,0,1],fillAlpha:.7,edges:!0,edgeColor:[1,0,0],edgeAlpha:1,edgeWidth:1}),highlighted:!0,scale:[3,3,3],position:[0,0,0],rotation:[0,0,0],opacity:.3,edges:!0});var n=J.vec3([0,0,0]),o=J.vec3(),a=J.vec3([0,0,1]),l=J.vec4(4),u=J.vec3(),A=function(){var e=r._sectionBox.scene.center,t=[-r._sectionBox.dir[0],-r._sectionBox.dir[1],-r._sectionBox.dir[2]];J.subVec3(e,r._sectionBox.pos,n);var i=-J.dotVec3(t,n);J.normalizeVec3(t),J.mulVec3Scalar(t,i,o);var s=J.vec3PairToQuaternion(a,r._sectionBox.dir,l);u[0]=.1*o[0],u[1]=.1*o[1],u[2]=.1*o[2],r._mesh.quaternion=s,r._mesh.position=u};this._onSectionPlanePos=this._sectionBox.on("pos",A),this._onSectionPlaneDir=this._sectionBox.on("dir",A),this._highlighted=!1,this._selected=!1}),[{key:"setHighlighted",value:function(e){this._highlighted=!!e,this._mesh.highlighted=this._highlighted,this._mesh.highlightMaterial.fillColor=e?[0,.7,0]:[0,0,0]}},{key:"getHighlighted",value:function(){return this._highlighted}},{key:"setSelected",value:function(e){this._selected=!!e,this._mesh.edgeMaterial.edgeWidth=e?3:1,this._mesh.highlightMaterial.edgeWidth=e?3:1}},{key:"getSelected",value:function(){return this._selected}},{key:"destroy",value:function(){this._sectionBox.off(this._onSectionPlanePos),this._sectionBox.off(this._onSectionPlaneDir),this._mesh.destroy()}}])}(),xE=function(){return w((function e(t,i){var s=this;if(B(this,e),!(i.onHoverEnterPlane&&i.onHoverLeavePlane&&i.onClickedNothing&&i.onClickedPlane))throw"Missing config(s): onHoverEnterPlane, onHoverLeavePlane, onClickedNothing || onClickedPlane";this.plugin=t,this._viewer=t.viewer,this._onHoverEnterPlane=i.onHoverEnterPlane,this._onHoverLeavePlane=i.onHoverLeavePlane,this._onClickedNothing=i.onClickedNothing,this._onClickedPlane=i.onClickedPlane,this._visible=!0,this._planes={},this._box=null,this._canvas=i.overviewCanvas,this._scene=new $i(this._viewer,{canvasId:this._canvas.id,transparent:!0,spinnerElementId:"overviewer_spinner"}),this._scene.clearLights(),new _i(this._scene,{dir:[.4,-.4,.8],color:[.8,1,1],intensity:1,space:"view"}),new _i(this._scene,{dir:[-.8,-.3,-.4],color:[.8,.8,.8],intensity:1,space:"view"}),new _i(this._scene,{dir:[.8,-.6,-.8],color:[1,1,1],intensity:1,space:"view"}),this._scene.camera,this._scene.camera.perspective.fov=70,this._zUp=!1;var r=this._scene.camera,n=J.rotationMat4c(-90*J.DEGTORAD,1,0,0),o=J.vec3(),a=J.vec3(),l=J.vec3();this._synchCamera=function(){var e=s._viewer.camera.eye,t=s._viewer.camera.look,i=s._viewer.camera.up;J.mulVec3Scalar(J.normalizeVec3(J.subVec3(e,t,o)),7),s._zUp?(J.transformVec3(n,o,a),J.transformVec3(n,i,l),r.look=[0,0,0],r.eye=J.transformVec3(n,o,a),r.up=J.transformPoint3(n,i,l)):(r.look=[0,0,0],r.eye=o,r.up=i)},this._onViewerCameraMatrix=this._viewer.camera.on("matrix",this._synchCamera),this._onViewerCameraWorldAxis=this._viewer.camera.on("worldAxis",this._synchCamera),this._onViewerCameraFOV=this._viewer.camera.perspective.on("fov",(function(e){s._scene.camera.perspective.fov=e}));var u=null;this._onInputMouseMove=this._scene.input.on("mousemove",(function(e){var t=s._scene.pick({canvasPos:e});if(t){if(!u||t.entity.id!==u.id){if(u)s._planes[u.id]&&s._onHoverLeavePlane(u.id);u=t.entity,s._planes[u.id]&&s._onHoverEnterPlane(u.id)}}else u&&(s._onHoverLeavePlane(u.id),u=null)})),this._scene.canvas.canvas.addEventListener("mouseup",this._onCanvasMouseUp=function(){u?s._planes[u.id]&&s._onClickedPlane(u.id):s._onClickedNothing()}),this._scene.canvas.canvas.addEventListener("mouseout",this._onCanvasMouseOut=function(){u&&(s._onHoverLeavePlane(u.id),u=null)}),this.setVisible(i.overviewVisible)}),[{key:"addSectionPlane",value:function(e){this._planes[e.id]=new bE(this,this._scene,e)}},{key:"setSectionBox",value:function(e){this._box=new BE(this,this._scene,e)}},{key:"setPlaneHighlighted",value:function(e,t){var i=this._planes[e];i&&i.setHighlighted(t)}},{key:"setPlaneSelected",value:function(e,t){var i=this._planes[e];i&&i.setSelected(t)}},{key:"removeSectionPlane",value:function(e){var t=this._planes[e.id];t&&(t.destroy(),delete this._planes[e.id])}},{key:"setVisible",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._visible=e,this._canvas.style.visibility=e?"visible":"hidden"}},{key:"getVisible",value:function(){return this._visible}},{key:"destroy",value:function(){this._viewer.camera.off(this._onViewerCameraMatrix),this._viewer.camera.off(this._onViewerCameraWorldAxis),this._viewer.camera.perspective.off(this._onViewerCameraFOV),this._scene.input.off(this._onInputMouseMove),this._scene.canvas.canvas.removeEventListener("mouseup",this._onCanvasMouseUp),this._scene.canvas.canvas.removeEventListener("mouseout",this._onCanvasMouseOut),this._scene.destroy()}}])}(),wE=function(){return w((function e(t){B(this,e),this._viewer=t.viewer,this._scene=t.viewer.scene,this._sectionPlugin=t,this._boxCenter=[0,0,0],this._maxRange=[],this._createNodes()}),[{key:"_createNodes",value:function(){var e=this._viewer.scene,t=e.aabb,i=e.center,s=t[3]-t[0],r=t[4]-t[1],n=t[5]-t[2];this._rootNode=new Bn(e,{id:"sectionControl",position:i,scale:[1,1,1],isObject:!1});var o=this._rootNode;this._displayMeshes={box:o.addChild(new nn(o,{geometry:new Ti(o,Wn({center:this._boxCenter,xSize:.5*(s>0?s:-1*s)+0,ySize:.5*(r>0?r:-1*r)+0,zSize:.5*(n>0?n:-1*n)+0})),material:new Qi(o,{emissive:[.5,6.5,9.5],diffuse:[.5,6.5,9.5],specular:[.5,.5,.5],alpha:.2,shininess:10}),pickable:!1,collidable:!1,clippable:!1,visible:!0,scale:[1,1,1],isObject:!1}),!1)}}},{key:"updateBox",value:function(e,t){if(!(t.length<6)){var i,s,r;i=t[3][0]-t[0][0],s=t[4][1]-t[1][1],r=t[5][2]-t[2][2];var n=this._getGeometryPoisition(e,i,s,r);this._setGeometryPosition(n)}}},{key:"_getGeometryPoisition",value:function(e,t,i,s){var r=.5,n=this._boxCenter;return 0!=e[0]&&(e[0]<0&&(n[0]-=((t>0?t:-1*t)*r+.2)/4),e[0]>0&&(n[0]+=((t>0?t:-1*t)*r+.2)/4)),0!=e[1]&&(e[1]<0&&(n[1]-=((i>0?i:-1*i)*r+.2)/4),e[1]>0&&(n[1]+=((i>0?i:-1*i)*r+.2)/4)),0!=e[2]&&(e[2]<0&&(n[2]-=((s>0?s:-1*s)*r+.2)/4),e[2]>0&&(n[2]+=((s>0?s:-1*s)*r+.2)/4)),Wn({center:n,xSize:(t>0?t:-1*t)*r+.2,ySize:(i>0?i:-1*i)*r+.2,zSize:(s>0?s:-1*s)*r+.2}).positions}},{key:"_setGeometryPosition",value:function(e){this._displayMeshes.box.geometry.positions=e}},{key:"setVisible",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this._visible!==e){var t;for(t in this._visible=e,this._displayMeshes)this._displayMeshes.hasOwnProperty(t)&&(this._displayMeshes[t].visible=e);if(!e)for(t in this._affordanceMeshes)this._affordanceMeshes.hasOwnProperty(t)&&(this._affordanceMeshes[t].visible=e)}}},{key:"getVisible",value:function(){return this._visible}},{key:"_destroy",value:function(){this._rootNode.destroy(),this._displayMeshes={}}}])}(),PE=J.AABB3(),CE=J.vec3(),ME=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(B(this,t),(i=h(this,t,["SectionPlanes",e]))._freeControls=[],i._controlBox=null,i._singleCtrlBox=null,i._sectionWay=null,i._sectionPlanes=e.scene.sectionPlanes,i._controls={},i._currentControl=null,i._shownControlId=null,i._shownControlIds=[],i._boxPlaneConfig={id:"",planeId:-1,enableClip:!1,controlFillColor:[3,9,9]},null!==s.overviewCanvasId&&void 0!==s.overviewCanvasId){var r=document.getElementById(s.overviewCanvasId);r?i._overview=new xE(i,{overviewCanvas:r,visible:s.overviewVisible,onHoverEnterPlane:function(e){i._overview.setPlaneHighlighted(e,!0)},onHoverLeavePlane:function(e){i._overview.setPlaneHighlighted(e,!1)},onClickedPlane:function(e){if(i.getShownControl()!==e){i.showControl(e);var t=i.sectionPlanes[e].pos;PE.set(i.viewer.scene.aabb),J.getAABB3Center(PE,CE),PE[0]+=t[0]-CE[0],PE[1]+=t[1]-CE[1],PE[2]+=t[2]-CE[2],PE[3]+=t[0]-CE[0],PE[4]+=t[1]-CE[1],PE[5]+=t[2]-CE[2],i.viewer.cameraFlight.flyTo({aabb:PE,fitFOV:65})}else i.hideControl()},onClickedNothing:function(){i.hideControl()}}):i.warn("Can't find overview canvas: '"+s.overviewCanvasId+"' - will create plugin without overview")}return i._onSceneSectionPlaneCreated=e.scene.on("sectionPlaneCreated",(function(e){i._sectionPlaneCreated(e)})),i._onSceneSectionBoxCreated=e.scene.on("sectionBoxCreated",(function(e){i._controlBox=e})),i.controlset=s.controlset,i}return m(t,me),w(t,[{key:"setOverviewVisible",value:function(e){this._overview&&this._overview.setVisible(e)}},{key:"getOverviewVisible",value:function(){if(this._overview)return this._overview.getVisible()}},{key:"sectionPlanes",get:function(){return this._sectionPlanes}},{key:"createSectionPlane",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==e.id&&null!==e.id&&this.viewer.scene.components[e.id]&&(this.error("Viewer component with this ID already exists: "+e.id),delete e.id),new hn(this.viewer.scene,{id:e.id,pos:e.pos,dir:e.dir,active:!0})}},{key:"createSectionBox",value:function(){this._sectionWay="box";var e=new wE(this);return new md(this.viewer.scene,{id:"sectionBox",active:!0,controlIdName:"sectionBoxPlane_",lineBox:e})}},{key:"createSectionSingle",value:function(){return this._sectionWay="box",new md(this.viewer.scene,{id:"sectionBox",active:!0,pickable:!1,enableClip:!1,controlIdName:"sectionBoxPlane_"})}},{key:"_sectionPlaneCreated",value:function(e){var t,i=this;switch(this._sectionWay){case"plane":t=this._freeControls.length>0?this._freeControls.pop():new yE(this,this._controlsConfig);break;case"box":this._boxPlaneConfig.enableClip=e.enableClip,this._boxPlaneConfig.pickable=e.pickable,this._boxPlaneConfig.controlFillColor=e.controlFillColor,t=this._freeControls.length>0?this._freeControls.pop():new gE(this,this._boxPlaneConfig);break;case"singleCtrl":t=this._freeControls.length>0?this._freeControls.pop():new pE(this,this.controlset);break;default:t=new cE(this)}var s=t;s._setSectionPlane(e),s.setVisible(!0),e.control=s,this._currentControl=s,null==e.box&&(this._controls[e.id]=s),this._overview&&this._overview.addSectionPlane(e),e.once("destroyed",(function(){i._sectionPlaneDestroyed(e)}))}},{key:"isTouch",set:function(e){this._isTouch=e,this.sectionWay=!0===e?"plane":this._sectionWay?this._sectionWay:"control"}},{key:"sectionConfigs",set:function(e){this._controlsConfig=e}},{key:"boxPlaneConfigs",set:function(e){this._boxPlaneConfig=e}},{key:"sectionWay",set:function(e){this._sectionWay=e}},{key:"sectionDirection",set:function(e){var t;switch(this.clear(),e){case 0:t=[0,0,-1];break;case 1:t=[-1,0,0];break;case 2:t=[0,-1,0]}var i=this.viewer.scene.center;this.createSectionPlane({pos:J.AABB3([i[0],i[1],i[2]]),dir:t})}},{key:"sectionSingleDirection",set:function(e){var t;switch(this.hideControl(),this._sectionWay="singleCtrl",e){case 0:t=[0,0,-1];break;case 1:t=[-1,0,0];break;case 2:t=[0,-1,0]}var i=this.viewer.scene.center;this.createSectionPlane({pos:J.AABB3([i[0],i[1],i[2]]),dir:t})}},{key:"controlBox",get:function(){return this._controlBox}},{key:"setControlPos",value:function(e){null!=this._currentControl&&(this._currentControl.pos=e)}},{key:"getControlPos",value:function(){return null==this._currentControl?-1:this._currentControl.posRate}},{key:"flipSectionPlanes",value:function(){var e=this.viewer.scene.sectionPlanes;for(var t in e){e[t].flipDir()}}},{key:"showControl",value:function(e){var t=this._controls[e];t?(t.setVisible(!0),this._overview&&this._overview.setPlaneSelected(e,!0),this._shownControlId=e,this._shownControlIds=[e]):this.error("Control not found: "+e)}},{key:"setControlsSize",value:function(e){for(var t in this._controls)this._controls[t].controlSize=e}},{key:"setControlSizeByID",value:function(e,t){this._controls[e]?this._controls[e].controlSize=t:this.error("Control not found: "+e)}},{key:"getShownControl",value:function(){return this._shownControlId}},{key:"getShownControls",value:function(){return this._shownControlIds}},{key:"showAllControl",value:function(){for(var e in this._controls)this._controls.hasOwnProperty(e)&&(this._shownControlIds.push(e),this._controls[e].setVisible(!1),this._overview&&this._overview.setPlaneSelected(e,!1))}},{key:"hideControl",value:function(){for(var e in this._controls)this._controls.hasOwnProperty(e)&&(this._controls[e].setVisible(!1),this._overview&&this._overview.setPlaneSelected(e,!1));this._shownControlId=null,this._shownControlIds=[]}},{key:"destroySectionPlane",value:function(e){var t=this.viewer.scene.sectionPlanes[e];t?(this._sectionPlaneDestroyed(t),t.destroy(),e===this._shownControlId&&(this._shownControlId=null,this._shownControlIds=[])):this.error("SectionPlane not found: "+e)}},{key:"_sectionPlaneDestroyed",value:function(e){this._overview&&this._overview.removeSectionPlane(e);var t=this._controls[e.id];t&&(t.setVisible(!1),t._setSectionPlane(null),delete this._controls[e.id],this._freeControls.push(t))}},{key:"clear",value:function(){this._controlBox&&this._controlBox.destroy();for(var e=Object.keys(this._sectionPlanes),t=0,i=e.length;t<i;t++)this.destroySectionPlane(e[t])}},{key:"send",value:function(e,t){switch(e){case"snapshotStarting":for(var i in this._controls)this._controls.hasOwnProperty(i)&&this._controls[i].setCulled(!0);break;case"snapshotFinished":for(var s in this._controls)this._controls.hasOwnProperty(s)&&this._controls[s].setCulled(!1);break;case"clearSectionPlanes":this.clear()}}},{key:"destroy",value:function(){this.clear(),this._overview&&this._overview.destroy(),this._destroyFreeControls(),f(t,"destroy",this,3)([])}},{key:"_destroyFreeControls",value:function(){for(var e=this._freeControls.pop();e;)e._destroy(),e=this._freeControls.pop();this.viewer.scene.off(this._onSceneSectionPlaneCreated)}}])}(),kE=w((function e(t,i,s,r,n,o){B(this,e),this.plugin=t,this.storeyId=n,this.modelId=r,this.storeyAABB=s.slice(),this.aabb=this.storeyAABB,this.modelAABB=i.slice(),this.numObjects=o})),FE=w((function e(t,i,s,r,n,o){B(this,e),this.storeyId=t,this.imageData=i,this.format=s,this.width=r,this.height=n})),EE=J.vec3(),DE=J.mat4(),IE=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,["StoreyViews",e]))._objectsMemento=new dd,i._cameraMemento=new ud,i.storeys={},i.modelStoreys={},i._fitStoreyMaps=!!s.fitStoreyMaps,i._onModelLoaded=i.viewer.scene.on("modelLoaded",(function(e){i._registerModelStoreys(e),i.fire("storeys",i.storeys)})),i}return m(t,me),w(t,[{key:"_registerModelStoreys",value:function(e){var t=this,i=this.viewer,s=i.scene,r=i.metaScene,n=r.metaModels[e],o=s.models[e];if(n&&n.rootMetaObjects)for(var a=n.rootMetaObjects,l=0,u=a.length;l<u;l++)for(var A=a[l].getObjectIDsInSubtreeByType(["IfcBuildingStorey"]),c=0,h=A.length;c<h;c++){var d=A[c],p=r.metaObjects[d].getObjectIDsInSubtree(),f=s.getAABB(p),v=Math.random()>.5?p.length:0,g=new kE(this,o.aabb,f,e,d,v);g._onModelDestroyed=o.once("destroyed",(function(){t._deregisterModelStoreys(e),t.fire("storeys",t.storeys)})),this.storeys[d]=g,this.modelStoreys[e]||(this.modelStoreys[e]={}),this.modelStoreys[e][d]=g}}},{key:"_deregisterModelStoreys",value:function(e){var t=this.modelStoreys[e];if(t){var i=this.viewer.scene;for(var s in t)if(t.hasOwnProperty(s)){var r=t[s],n=i.models[r.modelId];n&&n.off(r._onModelDestroyed),delete this.storeys[s]}delete this.modelStoreys[e]}}},{key:"fitStoreyMaps",get:function(){return this._fitStoreyMaps}},{key:"gotoStoreyCamera",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.storeys[e];if(!i)return this.error("IfcBuildingStorey not found with this ID: "+e),void(t.done&&t.done());var s=this.viewer,r=s.scene.camera,n=i.storeyAABB;if(n[3]<n[0]||n[4]<n[1]||n[5]<n[2])t.done&&t.done();else if(n[3]!==n[0]||n[4]!==n[1]||n[5]!==n[2]){var o=J.getAABB3Center(n),a=J.getAABB3Diag(n),l=Math.abs(a/Math.tan(45*J.DEGTORAD)),u=1.3*a,A=EE;A[0]=o[0]+r.worldUp[0]*l,A[1]=o[1]+r.worldUp[1]*l,A[2]=o[2]+r.worldUp[2]*l;var c=r.worldForward;t.done?s.cameraFlight.flyTo(oe.apply(t,{eye:A,look:o,up:c,orthoScale:u}),(function(){t.done()})):(s.cameraFlight.jumpTo(oe.apply(t,{eye:A,look:o,up:c,orthoScale:u})),s.camera.ortho.scale=u)}else t.done&&t.done()}},{key:"showStoreyObjects",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.storeys[e]){var i=this.viewer,s=i.scene;i.metaScene.metaObjects[e]&&(t.hideOthers&&s.setObjectsVisible(i.scene.visibleObjectIds,!1),this.withStoreyObjects(e,(function(e,t){e&&(e.visible=!0)})))}else this.error("IfcBuildingStorey not found with this ID: "+e)}},{key:"withStoreyObjects",value:function(e,t){var i=this.viewer,s=i.scene,r=i.metaScene,n=r.metaObjects[e];if(n)for(var o=n.getObjectIDsInSubtree(),a=0,l=o.length;a<l;a++){var u=o[a],A=r.metaObjects[u],c=s.objects[u];c&&t(c,A)}}},{key:"createStoreyMap",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.storeys[e];if(!i)return this.error("IfcBuildingStorey not found with this ID: "+e),"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==";var s,r,n=this.viewer,o=n.scene,a=t.format||"png",l=this._fitStoreyMaps?i.storeyAABB:i.modelAABB,u=Math.abs((l[5]-l[2])/(l[3]-l[0])),A=t.padding||0;t.width&&t.height?(s=t.width,r=t.height):t.height?(r=t.height,s=Math.round(r/u)):t.width?(s=t.width,r=Math.round(s*u)):(s=300,r=Math.round(s*u)),this._objectsMemento.saveObjects(o),this._cameraMemento.saveCamera(o),this.showStoreyObjects(e,oe.apply(t,{hideOthers:!0})),this._arrangeStoreyMapCamera(i);var c=n.getSnapshot({width:s,height:r,format:a});return this._objectsMemento.restoreObjects(o),this._cameraMemento.restoreCamera(o),new FE(e,c,a,s,r,A)}},{key:"_arrangeStoreyMapCamera",value:function(e){var t=this.viewer,i=t.scene.camera,s=this._fitStoreyMaps?e.storeyAABB:e.modelAABB,r=J.getAABB3Center(s),n=EE;n[0]=r[0]+.5*i.worldUp[0],n[1]=r[1]+.5*i.worldUp[1],n[2]=r[2]+.5*i.worldUp[2];var o=i.worldForward;t.cameraFlight.jumpTo({eye:n,look:r,up:o});var a=(s[3]-s[0])/2,l=(s[4]-s[1])/2,u=(s[5]-s[2])/2,A=-a,c=+a,h=-l,d=+l,p=-u,f=+u;t.camera.customProjection.matrix=J.orthoMat4c(A,c,p,f,h,d,DE),t.camera.projection="customProjection"}},{key:"pickStoreyMap",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=e.storeyId,r=this.storeys[s];if(!r)return this.error("IfcBuildingStorey not found with this ID: "+s),null;var n=1-t[0]/e.width,o=1-t[1]/e.height,a=this._fitStoreyMaps?r.storeyAABB:r.modelAABB,l=a[0],u=a[1],A=a[2],c=a[3]-l,h=a[4]-u,d=a[5]-A,p=J.vec3([l+c*n,u+.5*h,A+d*o]),f=J.vec3([0,-1,0]),v=J.addVec3(p,f,EE),g=this.viewer.camera.worldForward,m=J.lookAtMat4v(p,v,g,DE);return this.viewer.scene.pick({pickSurface:i.pickSurface,pickInvisible:!0,matrix:m})}},{key:"storeyMapToWorldPos",value:function(e,t){var i=e.storeyId,s=this.storeys[i];if(!s)return this.error("IfcBuildingStorey not found with this ID: "+i),null;var r=1-t[0]/e.width,n=1-t[1]/e.height,o=this._fitStoreyMaps?s.storeyAABB:s.modelAABB,a=o[0],l=o[1],u=o[2],A=o[3]-a,c=o[4]-l,h=o[5]-u;return J.vec3([a+A*r,l+.5*c,u+h*n])}},{key:"getStoreyContainingWorldPos",value:function(e){for(var t in this.storeys){var i=this.storeys[t];if(J.point3AABB3Intersect(i.storeyAABB,e))return t}return null}},{key:"worldPosToStoreyMap",value:function(e,t,i){var s=e.storeyId,r=this.storeys[s];if(!r)return this.error("IfcBuildingStorey not found with this ID: "+s),!1;var n=this._fitStoreyMaps?r.storeyAABB:r.modelAABB,o=n[0],a=n[1],l=n[2],u=n[3]-o,A=n[4]-a,c=n[5]-l,h=this.viewer.camera.worldUp,d=h[0]>h[1]&&h[0]>h[2],p=!d&&h[1]>h[0]&&h[1]>h[2];!d&&!p&&h[2]>h[0]&&(h[2],h[1]);var f=e.width/u,v=p?e.height/c:e.height/A;return i[0]=Math.floor(e.width-(t[0]-o)*f),i[1]=Math.floor(e.height-(t[2]-l)*v),i[0]>=0&&i[0]<e.width&&i[1]>=0&&i[1]<=e.height}},{key:"worldDirToStoreyMap",value:function(e,t,i){var s=this.viewer.camera,r=s.eye,n=s.look,o=J.subVec3(n,r,EE),a=s.worldUp,l=a[0]>a[1]&&a[0]>a[2],u=!l&&a[1]>a[0]&&a[1]>a[2];!l&&!u&&a[2]>a[0]&&(a[2],a[1]),l?(i[0]=o[1],i[1]=o[2]):u?(i[0]=o[0],i[1]=o[2]):(i[0]=o[0],i[1]=o[1]),J.normalizeVec2(i)}},{key:"destroy",value:function(){this.viewer.scene.off(this._onModelLoaded),f(t,"destroy",this,3)([])}}])}(),SE=function(e){function t(e){var i;return B(this,t),(i=h(this,t,["skyboxes",e])).skyboxes={},i._active=!1,i}return m(t,me),w(t,[{key:"send",value:function(e,t){if("clear"===e)this.clear()}},{key:"createSkybox",value:function(e,t){if(this.viewer.scene.components[e])return this.error("Component with this ID already exists: "+e),this;if(!t.src&&!t.image)return this.error("No legal skybox image or src: "+e),this;if(t.src){var i=new _d(this.viewer.scene,{id:e,size:t.size,scale:t.scale,src:t.src,active:t.active,encoding:3e3});return this.skyboxes[e]=i,i}if(t.image){i=new _d(this.viewer.scene,{id:e,size:t.size,scale:t.scale,image:t.image,active:t.active,encoding:3e3});return this.skyboxes[e]=i,i}}},{key:"setSkyBoxActiveById",value:function(e,t){this.skyboxes[e].active=t}},{key:"active",get:function(){return this._active},set:function(e){this._active=e;for(var t=0;t<this.skyboxes.length;t++)this.skyboxes[t].active=e}},{key:"getSkyBoxById",value:function(e){return this.skyboxes[e]}},{key:"destroySkybox",value:function(e){var t=this.skyboxes[e];t?t.destroy():this.error("Skybox not found: "+e)}},{key:"clear",value:function(){for(var e=Object.keys(this.skyboxes),t=0,i=e.length;t<i;t++)this.destroySkybox(e[t])}},{key:"destroy",value:function(){this.clear()}}])}(),TE=[],LE=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};B(this,t),(i=h(this,t,["TreeViewPlugin",e])).errors=[],i.valid=!0;for(var r=0;;r++)if(!TE[r]){TE[r]=i,i._index=r,i._id="tree-".concat(r);break}if(i._metaModels={},i._autoAddModels=!1!==s.autoAddModels,i._autoExpandDepth=s.autoExpandDepth||0,i._sortNodes=!1!==s.sortNodes,i._viewer=e,i._rootElement=null,i._muteSceneEvents=!1,i._muteTreeEvents=!1,i._rootNodes=[],i._objectNodes={},i._nodeNodes={},i._rootNames={},i._sortNodes=s.sortNodes,i._pruneEmptyNodes=s.pruneEmptyNodes,i._showListItemElementId=null,i._onObjectVisibility=i._viewer.scene.on("objectVisibility",(function(e){if(!i._muteSceneEvents){var t=e.id,s=i._objectNodes[t];if(s){var r=e.visible;if(r!==s.checked){i._muteTreeEvents=!0,s.checked=r,r?s.numVisibleEntities++:s.numVisibleEntities--;for(var n=s.parent;n;)n.checked=r,r?n.numVisibleEntities++:n.numVisibleEntities--,n=n.parent;i._muteTreeEvents=!1}}}})),i._onObjectXrayed=i._viewer.scene.on("objectXRayed",(function(e){if(!i._muteSceneEvents){var t=e.id,s=i._objectNodes[t];if(s){i._muteTreeEvents=!0;var r=e.xrayed;r!==s.xrayed&&(s.xrayed=r,i._muteTreeEvents=!1)}}})),i._hierarchy=s.hierarchy||"containment",i._autoExpandDepth=s.autoExpandDepth||0,i._autoAddModels){for(var n=Object.keys(i.viewer.metaScene.metaModels),o=0,a=n.length;o<a;o++){var l=n[o];i.viewer.metaScene.metaModels[l].finalized&&i.addModel(l)}i.viewer.scene.on("modelLoaded",(function(e){i.viewer.metaScene.metaModels[e]&&i.addModel(e)}))}return i}return m(t,me),w(t,[{key:"switchExpandHandler",value:function(e){e.preventDefault(),e.stopPropagation(),e.target,this.fire("ExpandHandler",e)}},{key:"switchCollapseHandler",value:function(e){e.preventDefault(),e.stopPropagation(),this.fire("CollapseHandler",e)}},{key:"checkboxChangeHandler",value:function(e){if(this.fire("checkBoxChanged",e),!this._muteTreeEvents){this._muteSceneEvents=!0;var t=e.target,i=t.checked,s=t.id.replace("checkbox-",""),r=this._nodeNodes[s],n=this._viewer.scene.objects,o=0;this._withNodeTree(r,(function(e){var t=e.objectId,s=n[t],r=0===e.children.length;e.numVisibleEntities=i?e.numEntities:0,r&&i!==e.checked&&o++,e.checked=i,function(e,t){var i=document.getElementById("checkbox-".concat(e));i&&t!==i.checked&&(i.checked=t)}(e.nodeId,i),s&&(s.visible=i)}));for(var a=r.parent;a;)a.checked=i,i?a.numVisibleEntities+=o:a.numVisibleEntities-=o,l(a.nodeId,a.numVisibleEntities>0),a=a.parent;this._muteSceneEvents=!1}function l(e,t){var i=document.getElementById("checkbox-".concat(e));i&&t!==i.checked&&(i.checked=t)}}},{key:"hierarchy",get:function(){return this._hierarchy},set:function(e){"containment"!==(e=e||"containment")&&"storeys"!==e&&"types"!==e&&(this.error("Unsupported value for `hierarchy' - defaulting to 'containment'"),e="containment"),this._hierarchy!==e&&(this._hierarchy=e,this._createNodes())}},{key:"muteTreeEvents",get:function(){return this._muteTreeEvents},set:function(e){this._muteTreeEvents=e}},{key:"nodeNodes",get:function(){return this._nodeNodes}},{key:"_createNodes",value:function(){this._rootElement&&(this._rootElement.parentNode.removeChild(this._rootElement),this._rootElement=null),this._rootNodes=[],this._objectNodes={},this._nodeNodes={},this._validate(),(this.valid||"storeys"!==this._hierarchy)&&this._createEnabledNodes()}},{key:"_createEnabledNodes",value:function(){switch(this._pruneEmptyNodes&&this._findEmptyNodes(),this._hierarchy){case"storeys":this._createStoreysNodes(),0===this._rootNodes.length&&this.error("Failed to build storeys hierarchy");break;case"types":this._createTypesNodes();break;default:this._createContainmentNodes()}this._sortNodes&&this._doSortNodes(),this._synchNodesToEntities(),this.fire("nodeNodes_Created",this._nodeNodes),this.fire("rootNodes_Created",this._rootNodes),this.fire("objectNodes_Created",this._objectNodes)}},{key:"_createStoreysNodes",value:function(){var e=this._viewer.metaScene.rootMetaObjects;for(var t in e)this._createStoreysNodes2(e[t],null,null,null)}},{key:"_createStoreysNodes2",value:function(e,t,i,s){if(!this._pruneEmptyNodes||0!==e._countEntities){var r=e.type,n=e.name,o=e.children,a=e.id;if("IfcBuilding"===r)t={nodeId:"".concat(this._id,"-").concat(a),objectId:a,title:0===e.metaModels.length?"na":this._rootNames[e.metaModels[0].id]||(n&&""!==n&&"Undefined"!==n&&"Default"!==n?n:r),type:r,parent:null,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]},this._rootNodes.push(t),this._objectNodes[t.objectId]=t,this._nodeNodes[t.nodeId]=t;else if("IfcBuildingStorey"===r){if(!t)return void this.error("Failed to build storeys hierarchy for model '"+this.metaModel.id+"' - model does not have an IfcBuilding object, or is not an IFC model");i={nodeId:"".concat(this._id,"-").concat(a),objectId:a,title:n&&""!==n&&"Undefined"!==n&&"Default"!==n?n:r,type:r,parent:t,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]},t.children.push(i),this._objectNodes[i.objectId]=i,this._nodeNodes[i.nodeId]=i,s={}}else{if(i)if(this._viewer.scene.objects[a]){var l=(s=s||{})[r];l||(l={nodeId:"".concat(this._id,"-").concat(i.objectId,"-").concat(r),objectId:"".concat(i.objectId,"-").concat(r),title:r,type:r,parent:i,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]},i.children.push(l),this._objectNodes[l.objectId]=l,this._nodeNodes[l.nodeId]=l,s[r]=l);var u={nodeId:"".concat(this._id,"-").concat(a),objectId:a,title:n&&""!==n&&"Undefined"!==n&&"Default"!==n?n:r,type:r,parent:l,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]};l.children.push(u),this._objectNodes[u.objectId]=u,this._nodeNodes[u.nodeId]=u}}if(o)for(var A=0,c=o.length;A<c;A++){var h=o[A];this._createStoreysNodes2(h,t,i,s)}}}},{key:"_createTypesNodes",value:function(){var e=this._viewer.metaScene.rootMetaObjects;for(var t in e)this._createTypesNodes2(e[t],null,null)}},{key:"_createTypesNodes2",value:function(e,t,i){if(!this._pruneEmptyNodes||0!==e._countEntities){var s=e.type,r=e.name,n=e.children,o=e.id;if(e.parent){if(t)if(this._viewer.scene.objects[o]){var a=i[s];a||(a={nodeId:"".concat(this._id,"-").concat(t.objectId,"-").concat(s),objectId:"".concat(t.objectId,"-").concat(s),title:s,type:s,parent:t,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]},t.children.push(a),this._objectNodes[a.objectId]=a,this._nodeNodes[a.nodeId]=a,i[s]=a);var l={nodeId:"".concat(this._id,"-").concat(o),objectId:o,title:r&&""!==r&&"Default"!==r?r:s,type:s,parent:a,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]};a.children.push(l),this._objectNodes[l.objectId]=l,this._nodeNodes[l.nodeId]=l}}else t={nodeId:"".concat(this._id,"-").concat(o),objectId:o,title:0===e.metaModels.length?"na":this._rootNames[e.metaModels[0].id]||(r&&""!==r&&"Undefined"!==r&&"Default"!==r?r:s),type:s,parent:null,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]},this._rootNodes.push(t),this._objectNodes[t.objectId]=t,this._nodeNodes[t.nodeId]=t,i={};if(n)for(var u=0,A=n.length;u<A;u++){var c=n[u];this._createTypesNodes2(c,t,i)}}}},{key:"_createContainmentNodes",value:function(){var e=this._viewer.metaScene.rootMetaObjects;for(var t in e)this._createContainmentNodes2(e[t],null)}},{key:"_createContainmentNodes2",value:function(e,t){if(!this._pruneEmptyNodes||0!==e._countEntities){var i=e.type,s=e.name||i,r=e.children,n=e.id,o={nodeId:"".concat(this._id,"-").concat(n),objectId:n,title:t?s&&""!==s&&"Undefined"!==s&&"Default"!==s?s:i:0===e.metaModels.length?"na":this._rootNames[e.metaModels[0].id]||s,type:i,parent:t,numEntities:0,numVisibleEntities:0,checked:!1,xrayed:!1,children:[]};if(t?t.children.push(o):this._rootNodes.push(o),this._objectNodes[o.objectId]=o,this._nodeNodes[o.nodeId]=o,r)for(var a=0,l=r.length;a<l;a++){var u=r[a];this._createContainmentNodes2(u,o)}}}},{key:"_synchNodesToEntities",value:function(){for(var e=Object.keys(this.viewer.metaScene.metaObjects),t=this._viewer.metaScene.metaObjects,i=this._viewer.scene.objects,s=0,r=e.length;s<r;s++){var n=e[s];if(t[n]){var o=this._objectNodes[n];if(o){var a=i[n];if(a){var l=a.visible;o.numEntities=1,o.xrayed=a.xrayed,l?(o.numVisibleEntities=1,o.checked=!0):(o.numVisibleEntities=0,o.checked=!1);for(var u=o.parent;u;)u.numEntities++,l&&(u.numVisibleEntities++,u.checked=!0),u=u.parent}}}}}},{key:"_validate",value:function(){if(this.errors=[],"storeys"===this._hierarchy)this.valid=this._validateMetaModelForStoreysHierarchy();else this.valid=this._rootNodes.length>0;return this.valid}},{key:"_validateMetaModelForStoreysHierarchy",value:function(){return!0}},{key:"addModel",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=this.viewer.scene.models[e];if(!s)throw"Model not found: "+e;var r=this.viewer.metaScene.metaModels[e];r?this._metaModels[e]?this._metaModels[e]=null:(this._metaModels[e]=r,i&&i.rootName&&(this._rootNames[e]=i.rootName),s.on("destroyed",(function(){t.removeModel(s.id)})),this._createNodes()):this.error("MetaModel not found: "+e)}},{key:"removeModel",value:function(e){this._metaModels[e]&&(this._rootNames[e]&&delete this._rootNames[e],delete this._metaModels[e],this._createNodes())}},{key:"showNode",value:function(e){this.unShowNode();var t=this._objectNodes[e];if(t){for(var i=t.nodeId,s=t.parent;s;)s=s.parent;this._showListItemElementId=i}}},{key:"unShowNode",value:function(){this._showListItemElementId&&(this._showListItemElementId=null)}},{key:"withNodeTree",value:function(e,t){t(e);var i=e.children;if(i)for(var s=0,r=i.length;s<r;s++)this.withNodeTree(i[s],t)}},{key:"_withNodeTree",value:function(e,t){t(e);var i=e.children;if(i)for(var s=0,r=i.length;s<r;s++)this._withNodeTree(i[s],t)}},{key:"getChildrenById",value:function(e){return this._nodeNodes[e].children}},{key:"getNodeById",value:function(e){return this._nodeNodes[e]}},{key:"destroy",value:function(){this._metaModels={},this._rootElement&&!this._destroyed&&(this._rootElement.parentNode.removeChild(this._rootElement),this._viewer.scene.off(this._onObjectVisibility),this._destroyed=!0),delete TE[this._index],f(t,"destroy",this,3)([])}},{key:"_findEmptyNodes",value:function(){var e=this._viewer.metaScene.rootMetaObjects;for(var t in e)this._findEmptyNodes2(e[t])}},{key:"_findEmptyNodes2",value:function(e){var t=this.viewer.scene,i=e.children,s=e.id,r=t.objects[s];if(e._countEntities=0,r&&e._countEntities++,i)for(var n=0,o=i.length;n<o;n++){var a=i[n];a._countEntities=this._findEmptyNodes2(a),e._countEntities+=a._countEntities}return e._countEntities}},{key:"_doSortNodes",value:function(){for(var e=0,t=this._rootNodes.length;e<t;e++){var i=this._rootNodes[e];this._sortChildren(i)}}},{key:"_sortChildren",value:function(e){var t=e.children;if(t&&0!==t.length){"storeys"===this._hierarchy&&"IfcBuilding"===e.type?t.sort(this._getSpatialSortFunc()):t.sort(this._alphaSortFunc);for(var i=0,s=t.length;i<s;i++){var r=t[i];this._sortChildren(r)}}}},{key:"_getSpatialSortFunc",value:function(){var e=this.viewer,t=e.scene,i=t.camera,s=e.metaScene;return this._spatialSortFunc||(this._spatialSortFunc=function(e,r){e.aabb&&r.aabb||(e.aabb||(e.aabb=t.getAABB(s.getObjectIDsInSubtree(e.objectId))),r.aabb||(r.aabb=t.getAABB(s.getObjectIDsInSubtree(r.objectId))));var n=0;return n=i.xUp?0:i.yUp?1:2,e.aabb[n]>r.aabb[n]?-1:e.aabb[n]<r.aabb[n]?1:0})}},{key:"_alphaSortFunc",value:function(e,t){var i=e.title.toUpperCase(),s=t.title.toUpperCase();return i<s?-1:i>s?1:0}}])}(),RE=function(){return w((function e(t){var i=this;B(this,e),this._scene=t,this._objects=[],this._objectsViewCulled=[],this._objectsDetailCulled=[],this._objectsChanged=[],this._objectsChangedList=[],this._modelInfos={},this._numObjects=0,this._lenObjectsChangedList=0,this._dirty=!0,this._onModelLoaded=t.on("modelLoaded",(function(e){var s=t.models[e];s&&i._addModel(s)})),this._onTick=t.on("tick",(function(){i._dirty&&i._build(),i._applyChanges()}))}),[{key:"_addModel",value:function(e){var t=this,i={model:e,onDestroyed:e.on("destroyed",(function(){t._removeModel(e)}))};this._modelInfos[e.id]=i,this._dirty=!0}},{key:"_removeModel",value:function(e){var t=this._modelInfos[e.id];t&&(t.model.off(t.onDestroyed),delete this._modelInfos[e.id],this._dirty=!0)}},{key:"_build",value:function(){if(this._dirty){this._applyChanges();for(var e=this._scene.objects,t=0;t<this._numObjects;t++)this._objects[t]=null;for(var i in this._numObjects=0,e){var s=e[i];this._objects[this._numObjects++]=s}this._lenObjectsChangedList=0,this._dirty=!1}}},{key:"_applyChanges",value:function(){if(this._lenObjectsChangedList>0){for(var e=0;e<this._lenObjectsChangedList;e++){var t=this._objectsChangedList[e],i=this._objects[t],s=this._objectsViewCulled[t],r=this._objectsDetailCulled[t],n=s||r;i.culled=n,this._objectsChanged[t]=!1}this._lenObjectsChangedList=0}}},{key:"objects",get:function(){return this._dirty&&this._build(),this._objects}},{key:"numObjects",get:function(){return this._dirty&&this._build(),this._numObjects}},{key:"setObjectViewCulled",value:function(e,t){this._dirty&&this._build(),this._objectsViewCulled[e]!==t&&(this._objectsViewCulled[e]=t,this._objectsChanged[e]||(this._objectsChanged[e]=!0,this._objectsChangedList[this._lenObjectsChangedList++]=e))}},{key:"setObjectDetailCulled",value:function(e,t){this._dirty&&this._build(),this._objectsDetailCulled[e]!==t&&(this._objectsDetailCulled[e]=t,this._objectsChanged[e]||(this._objectsChanged[e]=!0,this._objectsChangedList[this._lenObjectsChangedList++]=e))}},{key:"_destroy",value:function(){this._clear(),this._scene.off(this._onModelLoaded),this._scene.off(this._onTick)}},{key:"_clear",value:function(){for(var e in this._modelInfos){var t=this._modelInfos[e];t.model.off(t.onDestroyed)}this._modelInfos={},this._dirty=!0}}])}(),UE={};var OE=new Float32Array(3),QE=function(e){function t(e){var i,s,r,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};B(this,t),(i=h(this,t,["ViewCull",e]))._objectCullStates=(s=e.scene,r=s.id,(n=UE[r])||(n=new RE(s),UE[r]=n,s.on("destroyed",(function(){delete UE[r],n._destroy()}))),n),i._maxTreeDepth=o.maxTreeDepth||8,i._modelInfos={},i._frustum=new ut,i._kdRoot=null,i._frustumDirty=!1,i._kdTreeDirty=!1,i._insideView=!1,i.enabled=o.enabled;var a=e.scene.camera;return i._onViewMatrix=e.scene.camera.on("viewMatrix",(function(){i._frustumDirty=!0})),i._onProjMatrix=e.scene.camera.on("projMatMatrix",(function(){i._frustumDirty=!0})),i._onModelLoaded=e.scene.on("modelLoaded",(function(e){var t=i.viewer.scene.models[e];t&&i._addModel(t)})),i._onSceneTick=e.scene.on("tick",(function(){i._enabled&&i._doCull(),i.insideView=i.isBoxInFrustum(i.extractFrustumPlanes(a.projMatrix,a.viewMatrix),e.scene.aabb)})),i}return m(t,me),w(t,[{key:"isBoxInFrustum",value:function(e,t){for(var i=0;i<6;i++){var s=e[i],r=[s[0]>0?t[3]:t[0],s[1]>0?t[4]:t[1],s[2]>0?t[5]:t[2]];if(s[0]*r[0]+s[1]*r[1]+s[2]*r[2]+s[3]<0)return!1}return!0}},{key:"extractFrustumPlanes",value:function(e,t){var i=J.identityMat4();J.mulMat4(e,t,i);for(var s=[],r=0;r<6;r++)s.push(J.identityMat4());s[0][0]=i[3]+i[0],s[0][1]=i[7]+i[4],s[0][2]=i[11]+i[8],s[0][3]=i[15]+i[12],s[1][0]=i[3]-i[0],s[1][1]=i[7]-i[4],s[1][2]=i[11]-i[8],s[1][3]=i[15]-i[12],s[2][0]=i[3]+i[1],s[2][1]=i[7]+i[5],s[2][2]=i[11]+i[9],s[2][3]=i[15]+i[13],s[3][0]=i[3]-i[1],s[3][1]=i[7]-i[5],s[3][2]=i[11]-i[9],s[3][3]=i[15]-i[13],s[4][0]=i[3]+i[2],s[4][1]=i[7]+i[6],s[4][2]=i[11]+i[10],s[4][3]=i[15]+i[14],s[5][0]=i[3]-i[2],s[5][1]=i[7]-i[6],s[5][2]=i[11]-i[10],s[5][3]=i[15]-i[14];for(var n=0;n<6;n++){var o=Math.sqrt(s[n][0]*s[n][0]+s[n][1]*s[n][1]+s[n][2]*s[n][2]);s[n][0]/=o,s[n][1]/=o,s[n][2]/=o,s[n][3]/=o}return s}},{key:"insideView",get:function(){return this._insideView},set:function(e){this._insideView=e}},{key:"enabled",get:function(){return this._enabled},set:function(e){this._enabled=e}},{key:"_addModel",value:function(e){var t=this,i={model:e,onDestroyed:e.on("destroyed",(function(){t._removeModel(e)}))};this._modelInfos[e.id]=i,this._kdTreeDirty=!0}},{key:"_removeModel",value:function(e){var t=this._modelInfos[e.id];t&&(t.model.off(t.onDestroyed),delete this._modelInfos[e.id],this._kdTreeDirty=!0)}},{key:"_doCull",value:function(){var e=this._frustumDirty||this._kdTreeDirty;if(this._frustumDirty&&this._buildFrustum(),this._kdTreeDirty&&this._buildKDTree(),e){var t=this._kdRoot;t&&this._visitKDNode(t)}}},{key:"_buildFrustum",value:function(){var e=this.viewer.scene.camera;At(this._frustum,e.viewMatrix,e.projMatrix),this._frustumDirty=!1}},{key:"_buildKDTree",value:function(){var e=this.viewer.scene;this._kdRoot,this._kdRoot={aabb:e.getAABB(),intersection:ut.INTERSECT};for(var t=0,i=this._objectCullStates.numObjects;t<i;t++){var s=this._objectCullStates.objects[t];this._insertEntityIntoKDTree(this._kdRoot,s,t,1)}this._kdTreeDirty=!1}},{key:"_insertEntityIntoKDTree",value:function(e,t,i,s){var r=t.aabb;if(s>=this._maxTreeDepth)return e.objects=e.objects||[],e.objects.push(i),void J.expandAABB3(e.aabb,r);if(e.left&&J.containsAABB3(e.left.aabb,r))this._insertEntityIntoKDTree(e.left,t,i,s+1);else if(e.right&&J.containsAABB3(e.right.aabb,r))this._insertEntityIntoKDTree(e.right,t,i,s+1);else{var n=e.aabb;OE[0]=n[3]-n[0],OE[1]=n[4]-n[1],OE[2]=n[5]-n[2];var o=0;if(OE[1]>OE[o]&&(o=1),OE[2]>OE[o]&&(o=2),!e.left){var a=n.slice();if(a[o+3]=(n[o]+n[o+3])/2,e.left={aabb:a,intersection:ut.INTERSECT},J.containsAABB3(a,r))return void this._insertEntityIntoKDTree(e.left,t,i,s+1)}if(!e.right){var l=n.slice();if(l[o]=(n[o]+n[o+3])/2,e.right={aabb:l,intersection:ut.INTERSECT},J.containsAABB3(l,r))return void this._insertEntityIntoKDTree(e.right,t,i,s+1)}e.objects=e.objects||[],e.objects.push(i),J.expandAABB3(e.aabb,r)}}},{key:"_visitKDNode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ut.INTERSECT;if(t===ut.INTERSECT||e.intersects!==t){t===ut.INTERSECT&&(t=ct(this._frustum,e.aabb),e.intersects=t);var i=t===ut.OUTSIDE,s=e.objects;if(s&&s.length>0)for(var r=0,n=s.length;r<n;r++){var o=s[r];this._objectCullStates.setObjectViewCulled(o,i)}e.left&&this._visitKDNode(e.left,t),e.right&&this._visitKDNode(e.right,t)}}},{key:"send",value:function(e,t){}},{key:"destroy",value:function(){f(t,"destroy",this,3)([]),this._clear();var e=this.viewer.scene,i=e.camera;e.off(this._onModelLoaded),e.off(this._onSceneTick),i.off(this._onViewMatrix),i.off(this._onProjMatrix)}},{key:"_clear",value:function(){for(var e in this._modelInfos){var t=this._modelInfos[e];t.model.off(t.onDestroyed)}this._modelInfos={},this._kdRoot=null,this._kdTreeDirty=!0}}])}(),NE=function(){return w((function e(){B(this,e)}),[{key:"getManifest",value:function(e,t,i){oe.loadJSON(e,(function(e){t(e)}),(function(e){i(e)}))}},{key:"getMetaModel",value:function(e,t,i){oe.loadJSON(e,(function(e){t(e)}),(function(e){i(e)}))}},{key:"getXTC",value:function(e,t,i){var s=function(){};t=t||s,i=i||s;var r=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){var n=!!r[2],o=r[3];o=window.decodeURIComponent(o),n&&(o=window.atob(o));try{for(var a=new ArrayBuffer(o.length),l=new Uint8Array(a),u=0;u<o.length;u++)l[u]=o.charCodeAt(u);t(a)}catch(e){i(e)}}else{var A=new XMLHttpRequest;A.open("GET",e,!0),A.responseType="arraybuffer",A.onreadystatechange=function(){4===A.readyState&&(200===A.status?t(A.response):i("getXTC error : "+A.response))},A.send(null)}}}])}();!function(e,t){"object"==("undefined"==typeof exports?"undefined":b(exports))&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).pako={})}(void 0,(function(e){function t(e){for(var t=e.length;--t>=0;)e[t]=0}var i=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),s=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);t(o);var a=new Array(60);t(a);var l=new Array(512);t(l);var u=new Array(256);t(u);var A=new Array(29);t(A);var c,h,d,p=new Array(30);function f(e,t,i,s,r){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=s,this.max_length=r,this.has_stree=e&&e.length}function v(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}t(p);var g=function(e){return e<256?l[e]:l[256+(e>>>7)]},m=function(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},_=function(e,t,i){e.bi_valid>16-i?(e.bi_buf|=t<<e.bi_valid&65535,m(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)},y=function(e,t,i){_(e,i[2*t],i[2*t+1])},B=function(e,t){var i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1},x=function(e,t,i){var s,r,n=new Array(16),o=0;for(s=1;s<=15;s++)o=o+i[s-1]<<1,n[s]=o;for(r=0;r<=t;r++){var a=e[2*r+1];0!==a&&(e[2*r]=B(n[a]++,a))}},w=function(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},P=function(e){e.bi_valid>8?m(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},C=function(e,t,i,s){var r=2*t,n=2*i;return e[r]<e[n]||e[r]===e[n]&&s[t]<=s[i]},M=function(e,t,i){for(var s=e.heap[i],r=i<<1;r<=e.heap_len&&(r<e.heap_len&&C(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!C(t,s,e.heap[r],e.depth));)e.heap[i]=e.heap[r],i=r,r<<=1;e.heap[i]=s},k=function(e,t,r){var n,o,a,l,c=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+c++],n+=(255&e.pending_buf[e.sym_buf+c++])<<8,o=e.pending_buf[e.sym_buf+c++],0===n?y(e,o,t):(a=u[o],y(e,a+256+1,t),0!==(l=i[a])&&(o-=A[a],_(e,o,l)),n--,a=g(n),y(e,a,r),0!==(l=s[a])&&(n-=p[a],_(e,n,l)))}while(c<e.sym_next);y(e,256,t)},F=function(e,t){var i,s,r,n=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.has_stree,l=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,i=0;i<l;i++)0!==n[2*i]?(e.heap[++e.heap_len]=u=i,e.depth[i]=0):n[2*i+1]=0;for(;e.heap_len<2;)n[2*(r=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[r]=0,e.opt_len--,a&&(e.static_len-=o[2*r+1]);for(t.max_code=u,i=e.heap_len>>1;i>=1;i--)M(e,n,i);r=l;do{i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],M(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=s,n[2*r]=n[2*i]+n[2*s],e.depth[r]=(e.depth[i]>=e.depth[s]?e.depth[i]:e.depth[s])+1,n[2*i+1]=n[2*s+1]=r,e.heap[1]=r++,M(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var i,s,r,n,o,a,l=t.dyn_tree,u=t.max_code,A=t.stat_desc.static_tree,c=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,f=0;for(n=0;n<=15;n++)e.bl_count[n]=0;for(l[2*e.heap[e.heap_max]+1]=0,i=e.heap_max+1;i<573;i++)(n=l[2*l[2*(s=e.heap[i])+1]+1]+1)>p&&(n=p,f++),l[2*s+1]=n,s>u||(e.bl_count[n]++,o=0,s>=d&&(o=h[s-d]),a=l[2*s],e.opt_len+=a*(n+o),c&&(e.static_len+=a*(A[2*s+1]+o)));if(0!==f){do{for(n=p-1;0===e.bl_count[n];)n--;e.bl_count[n]--,e.bl_count[n+1]+=2,e.bl_count[p]--,f-=2}while(f>0);for(n=p;0!==n;n--)for(s=e.bl_count[n];0!==s;)(r=e.heap[--i])>u||(l[2*r+1]!==n&&(e.opt_len+=(n-l[2*r+1])*l[2*r],l[2*r+1]=n),s--)}}(e,t),x(n,u,e.bl_count)},E=function(e,t,i){var s,r,n=-1,o=t[1],a=0,l=7,u=4;for(0===o&&(l=138,u=3),t[2*(i+1)+1]=65535,s=0;s<=i;s++)r=o,o=t[2*(s+1)+1],++a<l&&r===o||(a<u?e.bl_tree[2*r]+=a:0!==r?(r!==n&&e.bl_tree[2*r]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,n=r,0===o?(l=138,u=3):r===o?(l=6,u=3):(l=7,u=4))},D=function(e,t,i){var s,r,n=-1,o=t[1],a=0,l=7,u=4;for(0===o&&(l=138,u=3),s=0;s<=i;s++)if(r=o,o=t[2*(s+1)+1],!(++a<l&&r===o)){if(a<u)do{y(e,r,e.bl_tree)}while(0!=--a);else 0!==r?(r!==n&&(y(e,r,e.bl_tree),a--),y(e,16,e.bl_tree),_(e,a-3,2)):a<=10?(y(e,17,e.bl_tree),_(e,a-3,3)):(y(e,18,e.bl_tree),_(e,a-11,7));a=0,n=r,0===o?(l=138,u=3):r===o?(l=6,u=3):(l=7,u=4)}},I=!1,S=function(e,t,i,s){_(e,0+(s?1:0),3),P(e),m(e,i),m(e,~i),i&&e.pending_buf.set(e.window.subarray(t,t+i),e.pending),e.pending+=i},T=function(e){I||(function(){var e,t,n,v,g,m=new Array(16);for(n=0,v=0;v<28;v++)for(A[v]=n,e=0;e<1<<i[v];e++)u[n++]=v;for(u[n-1]=v,g=0,v=0;v<16;v++)for(p[v]=g,e=0;e<1<<s[v];e++)l[g++]=v;for(g>>=7;v<30;v++)for(p[v]=g<<7,e=0;e<1<<s[v]-7;e++)l[256+g++]=v;for(t=0;t<=15;t++)m[t]=0;for(e=0;e<=143;)o[2*e+1]=8,e++,m[8]++;for(;e<=255;)o[2*e+1]=9,e++,m[9]++;for(;e<=279;)o[2*e+1]=7,e++,m[7]++;for(;e<=287;)o[2*e+1]=8,e++,m[8]++;for(x(o,287,m),e=0;e<30;e++)a[2*e+1]=5,a[2*e]=B(e,5);c=new f(o,i,257,286,15),h=new f(a,s,0,30,15),d=new f(new Array(0),r,0,19,7)}(),I=!0),e.l_desc=new v(e.dyn_ltree,c),e.d_desc=new v(e.dyn_dtree,h),e.bl_desc=new v(e.bl_tree,d),e.bi_buf=0,e.bi_valid=0,w(e)},L=S,R=function(e,t,i,s){var r,l,u=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),F(e,e.l_desc),F(e,e.d_desc),u=function(e){var t;for(E(e,e.dyn_ltree,e.l_desc.max_code),E(e,e.dyn_dtree,e.d_desc.max_code),F(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*n[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),r=e.opt_len+3+7>>>3,(l=e.static_len+3+7>>>3)<=r&&(r=l)):r=l=i+5,i+4<=r&&-1!==t?S(e,t,i,s):4===e.strategy||l===r?(_(e,2+(s?1:0),3),k(e,o,a)):(_(e,4+(s?1:0),3),function(e,t,i,s){var r;for(_(e,t-257,5),_(e,i-1,5),_(e,s-4,4),r=0;r<s;r++)_(e,e.bl_tree[2*n[r]+1],3);D(e,e.dyn_ltree,t-1),D(e,e.dyn_dtree,i-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),k(e,e.dyn_ltree,e.dyn_dtree)),w(e),s&&P(e)},U=function(e,t,i){return e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=i,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(u[i]+256+1)]++,e.dyn_dtree[2*g(t)]++),e.sym_next===e.sym_end},O=function(e){_(e,2,3),y(e,256,o),function(e){16===e.bi_valid?(m(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)},Q=function(e,t,i,s){for(var r=65535&e|0,n=e>>>16&65535|0,o=0;0!==i;){i-=o=i>2e3?2e3:i;do{n=n+(r=r+t[s++]|0)|0}while(--o);r%=65521,n%=65521}return r|n<<16|0},N=new Uint32Array(function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var s=0;s<8;s++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}()),V=function(e,t,i,s){var r=N,n=s+i;e^=-1;for(var o=s;o<n;o++)e=e>>>8^r[255&(e^t[o])];return-1^e},H={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},G=T,z=L,W=R,K=U,X=O,Y=j.Z_NO_FLUSH,J=j.Z_PARTIAL_FLUSH,Z=j.Z_FULL_FLUSH,q=j.Z_FINISH,$=j.Z_BLOCK,ee=j.Z_OK,te=j.Z_STREAM_END,ie=j.Z_STREAM_ERROR,se=j.Z_DATA_ERROR,re=j.Z_BUF_ERROR,ne=j.Z_DEFAULT_COMPRESSION,oe=j.Z_FILTERED,ae=j.Z_HUFFMAN_ONLY,le=j.Z_RLE,ue=j.Z_FIXED,Ae=j.Z_DEFAULT_STRATEGY,ce=j.Z_UNKNOWN,he=j.Z_DEFLATED,de=258,pe=262,fe=42,ve=113,ge=666,me=function(e,t){return e.msg=H[t],t},_e=function(e){return 2*e-(e>4?9:0)},ye=function(e){for(var t=e.length;--t>=0;)e[t]=0},be=function(e){var t,i,s,r=e.w_size;s=t=e.hash_size;do{i=e.head[--s],e.head[s]=i>=r?i-r:0}while(--t);s=t=r;do{i=e.prev[--s],e.prev[s]=i>=r?i-r:0}while(--t)},Be=function(e,t,i){return(t<<e.hash_shift^i)&e.hash_mask},xe=function(e){var t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+i),e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))},we=function(e,t){W(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,xe(e.strm)},Pe=function(e,t){e.pending_buf[e.pending++]=t},Ce=function(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Me=function(e,t,i,s){var r=e.avail_in;return r>s&&(r=s),0===r?0:(e.avail_in-=r,t.set(e.input.subarray(e.next_in,e.next_in+r),i),1===e.state.wrap?e.adler=Q(e.adler,t,r,i):2===e.state.wrap&&(e.adler=V(e.adler,t,r,i)),e.next_in+=r,e.total_in+=r,r)},ke=function(e,t){var i,s,r=e.max_chain_length,n=e.strstart,o=e.prev_length,a=e.nice_match,l=e.strstart>e.w_size-pe?e.strstart-(e.w_size-pe):0,u=e.window,A=e.w_mask,c=e.prev,h=e.strstart+de,d=u[n+o-1],p=u[n+o];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do{if(u[(i=t)+o]===p&&u[i+o-1]===d&&u[i]===u[n]&&u[++i]===u[n+1]){n+=2,i++;do{}while(u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&n<h);if(s=de-(h-n),n=h-de,s>o){if(e.match_start=t,o=s,s>=a)break;d=u[n+o-1],p=u[n+o]}}}while((t=c[t&A])>l&&0!=--r);return o<=e.lookahead?o:e.lookahead},Fe=function(e){var t,i,s,r=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=r+(r-pe)&&(e.window.set(e.window.subarray(r,r+r-i),0),e.match_start-=r,e.strstart-=r,e.block_start-=r,e.insert>e.strstart&&(e.insert=e.strstart),be(e),i+=r),0===e.strm.avail_in)break;if(t=Me(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=t,e.lookahead+e.insert>=3)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=Be(e,e.ins_h,e.window[s+1]);e.insert&&(e.ins_h=Be(e,e.ins_h,e.window[s+3-1]),e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<pe&&0!==e.strm.avail_in)},Ee=function(e,t){var i,s,r,n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,o=0,a=e.strm.avail_in;do{if(i=65535,r=e.bi_valid+42>>3,e.strm.avail_out<r)break;if(r=e.strm.avail_out-r,i>(s=e.strstart-e.block_start)+e.strm.avail_in&&(i=s+e.strm.avail_in),i>r&&(i=r),i<n&&(0===i&&t!==q||t===Y||i!==s+e.strm.avail_in))break;o=t===q&&i===s+e.strm.avail_in?1:0,z(e,0,0,o),e.pending_buf[e.pending-4]=i,e.pending_buf[e.pending-3]=i>>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,xe(e.strm),s&&(s>i&&(s=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+s),e.strm.next_out),e.strm.next_out+=s,e.strm.avail_out-=s,e.strm.total_out+=s,e.block_start+=s,i-=s),i&&(Me(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(0===o);return(a-=e.strm.avail_in)&&(a>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=a&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?4:t!==Y&&t!==q&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(r=e.window_size-e.strstart,e.strm.avail_in>r&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,r+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),r>e.strm.avail_in&&(r=e.strm.avail_in),r&&(Me(e.strm,e.window,e.strstart,r),e.strstart+=r,e.insert+=r>e.w_size-e.insert?e.w_size-e.insert:r),e.high_water<e.strstart&&(e.high_water=e.strstart),r=e.bi_valid+42>>3,n=(r=e.pending_buf_size-r>65535?65535:e.pending_buf_size-r)>e.w_size?e.w_size:r,((s=e.strstart-e.block_start)>=n||(s||t===q)&&t!==Y&&0===e.strm.avail_in&&s<=r)&&(i=s>r?r:s,o=t===q&&0===e.strm.avail_in&&i===s?1:0,z(e,e.block_start,i,o),e.block_start+=i,xe(e.strm)),o?3:1)},De=function(e,t){for(var i,s;;){if(e.lookahead<pe){if(Fe(e),e.lookahead<pe&&t===Y)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-pe&&(e.match_length=ke(e,i)),e.match_length>=3)if(s=K(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Be(e,e.ins_h,e.window[e.strstart+1]);else s=K(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(s&&(we(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===q?(we(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(we(e,!1),0===e.strm.avail_out)?1:2},Ie=function(e,t){for(var i,s,r;;){if(e.lookahead<pe){if(Fe(e),e.lookahead<pe&&t===Y)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-pe&&(e.match_length=ke(e,i),e.match_length<=5&&(e.strategy===oe||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-3,s=K(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,s&&(we(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((s=K(e,0,e.window[e.strstart-1]))&&we(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(s=K(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===q?(we(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(we(e,!1),0===e.strm.avail_out)?1:2};function Se(e,t,i,s,r){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=s,this.func=r}var Te=[new Se(0,0,0,0,Ee),new Se(4,4,8,4,De),new Se(4,5,16,8,De),new Se(4,6,32,32,De),new Se(4,4,16,16,Ie),new Se(8,16,32,32,Ie),new Se(8,16,128,128,Ie),new Se(8,32,128,256,Ie),new Se(32,128,258,1024,Ie),new Se(32,258,258,4096,Ie)];function Le(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=he,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ye(this.dyn_ltree),ye(this.dyn_dtree),ye(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ye(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ye(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Re=function(e){if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.status!==fe&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==ve&&t.status!==ge?1:0},Ue=function(e){if(Re(e))return me(e,ie);e.total_in=e.total_out=0,e.data_type=ce;var t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?fe:ve,e.adler=2===t.wrap?0:1,t.last_flush=-2,G(t),ee},Oe=function(e){var t,i=Ue(e);return i===ee&&((t=e.state).window_size=2*t.w_size,ye(t.head),t.max_lazy_match=Te[t.level].max_lazy,t.good_match=Te[t.level].good_length,t.nice_match=Te[t.level].nice_length,t.max_chain_length=Te[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),i},Qe=function(e,t,i,s,r,n){if(!e)return ie;var o=1;if(t===ne&&(t=6),s<0?(o=0,s=-s):s>15&&(o=2,s-=16),r<1||r>9||i!==he||s<8||s>15||t<0||t>9||n<0||n>ue||8===s&&1!==o)return me(e,ie);8===s&&(s=9);var a=new Le;return e.state=a,a.strm=e,a.status=fe,a.wrap=o,a.gzhead=null,a.w_bits=s,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=r+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<r+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=t,a.strategy=n,a.method=i,Oe(e)},Ne={deflateInit:function(e,t){return Qe(e,t,he,15,8,Ae)},deflateInit2:Qe,deflateReset:Oe,deflateResetKeep:Ue,deflateSetHeader:function(e,t){return Re(e)||2!==e.state.wrap?ie:(e.state.gzhead=t,ee)},deflate:function(e,t){if(Re(e)||t>$||t<0)return e?me(e,ie):ie;var i=e.state;if(!e.output||0!==e.avail_in&&!e.input||i.status===ge&&t!==q)return me(e,0===e.avail_out?re:ie);var s=i.last_flush;if(i.last_flush=t,0!==i.pending){if(xe(e),0===e.avail_out)return i.last_flush=-1,ee}else if(0===e.avail_in&&_e(t)<=_e(s)&&t!==q)return me(e,re);if(i.status===ge&&0!==e.avail_in)return me(e,re);if(i.status===fe&&0===i.wrap&&(i.status=ve),i.status===fe){var r=he+(i.w_bits-8<<4)<<8;if(r|=(i.strategy>=ae||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(r|=32),Ce(i,r+=31-r%31),0!==i.strstart&&(Ce(i,e.adler>>>16),Ce(i,65535&e.adler)),e.adler=1,i.status=ve,xe(e),0!==i.pending)return i.last_flush=-1,ee}if(57===i.status)if(e.adler=0,Pe(i,31),Pe(i,139),Pe(i,8),i.gzhead)Pe(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Pe(i,255&i.gzhead.time),Pe(i,i.gzhead.time>>8&255),Pe(i,i.gzhead.time>>16&255),Pe(i,i.gzhead.time>>24&255),Pe(i,9===i.level?2:i.strategy>=ae||i.level<2?4:0),Pe(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(Pe(i,255&i.gzhead.extra.length),Pe(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=V(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69;else if(Pe(i,0),Pe(i,0),Pe(i,0),Pe(i,0),Pe(i,0),Pe(i,9===i.level?2:i.strategy>=ae||i.level<2?4:0),Pe(i,3),i.status=ve,xe(e),0!==i.pending)return i.last_flush=-1,ee;if(69===i.status){if(i.gzhead.extra){for(var n=i.pending,o=(65535&i.gzhead.extra.length)-i.gzindex;i.pending+o>i.pending_buf_size;){var a=i.pending_buf_size-i.pending;if(i.pending_buf.set(i.gzhead.extra.subarray(i.gzindex,i.gzindex+a),i.pending),i.pending=i.pending_buf_size,i.gzhead.hcrc&&i.pending>n&&(e.adler=V(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex+=a,xe(e),0!==i.pending)return i.last_flush=-1,ee;n=0,o-=a}var l=new Uint8Array(i.gzhead.extra);i.pending_buf.set(l.subarray(i.gzindex,i.gzindex+o),i.pending),i.pending+=o,i.gzhead.hcrc&&i.pending>n&&(e.adler=V(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex=0}i.status=73}if(73===i.status){if(i.gzhead.name){var u,A=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>A&&(e.adler=V(e.adler,i.pending_buf,i.pending-A,A)),xe(e),0!==i.pending)return i.last_flush=-1,ee;A=0}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,Pe(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>A&&(e.adler=V(e.adler,i.pending_buf,i.pending-A,A)),i.gzindex=0}i.status=91}if(91===i.status){if(i.gzhead.comment){var c,h=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>h&&(e.adler=V(e.adler,i.pending_buf,i.pending-h,h)),xe(e),0!==i.pending)return i.last_flush=-1,ee;h=0}c=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,Pe(i,c)}while(0!==c);i.gzhead.hcrc&&i.pending>h&&(e.adler=V(e.adler,i.pending_buf,i.pending-h,h))}i.status=103}if(103===i.status){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size&&(xe(e),0!==i.pending))return i.last_flush=-1,ee;Pe(i,255&e.adler),Pe(i,e.adler>>8&255),e.adler=0}if(i.status=ve,xe(e),0!==i.pending)return i.last_flush=-1,ee}if(0!==e.avail_in||0!==i.lookahead||t!==Y&&i.status!==ge){var d=0===i.level?Ee(i,t):i.strategy===ae?function(e,t){for(var i;;){if(0===e.lookahead&&(Fe(e),0===e.lookahead)){if(t===Y)return 1;break}if(e.match_length=0,i=K(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(we(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===q?(we(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(we(e,!1),0===e.strm.avail_out)?1:2}(i,t):i.strategy===le?function(e,t){for(var i,s,r,n,o=e.window;;){if(e.lookahead<=de){if(Fe(e),e.lookahead<=de&&t===Y)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&((s=o[r=e.strstart-1])===o[++r]&&s===o[++r]&&s===o[++r])){n=e.strstart+de;do{}while(s===o[++r]&&s===o[++r]&&s===o[++r]&&s===o[++r]&&s===o[++r]&&s===o[++r]&&s===o[++r]&&s===o[++r]&&r<n);e.match_length=de-(n-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=K(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=K(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(we(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===q?(we(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(we(e,!1),0===e.strm.avail_out)?1:2}(i,t):Te[i.level].func(i,t);if(3!==d&&4!==d||(i.status=ge),1===d||3===d)return 0===e.avail_out&&(i.last_flush=-1),ee;if(2===d&&(t===J?X(i):t!==$&&(z(i,0,0,!1),t===Z&&(ye(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),xe(e),0===e.avail_out))return i.last_flush=-1,ee}return t!==q?ee:i.wrap<=0?te:(2===i.wrap?(Pe(i,255&e.adler),Pe(i,e.adler>>8&255),Pe(i,e.adler>>16&255),Pe(i,e.adler>>24&255),Pe(i,255&e.total_in),Pe(i,e.total_in>>8&255),Pe(i,e.total_in>>16&255),Pe(i,e.total_in>>24&255)):(Ce(i,e.adler>>>16),Ce(i,65535&e.adler)),xe(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?ee:te)},deflateEnd:function(e){if(Re(e))return ie;var t=e.state.status;return e.state=null,t===ve?me(e,se):ee},deflateSetDictionary:function(e,t){var i=t.length;if(Re(e))return ie;var s=e.state,r=s.wrap;if(2===r||1===r&&s.status!==fe||s.lookahead)return ie;if(1===r&&(e.adler=Q(e.adler,t,i,0)),s.wrap=0,i>=s.w_size){0===r&&(ye(s.head),s.strstart=0,s.block_start=0,s.insert=0);var n=new Uint8Array(s.w_size);n.set(t.subarray(i-s.w_size,i),0),t=n,i=s.w_size}var o=e.avail_in,a=e.next_in,l=e.input;for(e.avail_in=i,e.next_in=0,e.input=t,Fe(s);s.lookahead>=3;){var u=s.strstart,A=s.lookahead-2;do{s.ins_h=Be(s,s.ins_h,s.window[u+3-1]),s.prev[u&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=u,u++}while(--A);s.strstart=u,s.lookahead=2,Fe(s)}return s.strstart+=s.lookahead,s.block_start=s.strstart,s.insert=s.lookahead,s.lookahead=0,s.match_length=s.prev_length=2,s.match_available=0,e.next_in=a,e.input=l,e.avail_in=o,s.wrap=r,ee},deflateInfo:"pako deflate (from Nodeca project)"},Ve=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},He=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=b(i))throw new TypeError(i+"must be non-object");for(var s in i)Ve(i,s)&&(e[s]=i[s])}}return e},je=function(e){for(var t=0,i=0,s=e.length;i<s;i++)t+=e[i].length;for(var r=new Uint8Array(t),n=0,o=0,a=e.length;n<a;n++){var l=e[n];r.set(l,o),o+=l.length}return r},Ge=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Ge=!1}for(var ze=new Uint8Array(256),We=0;We<256;We++)ze[We]=We>=252?6:We>=248?5:We>=240?4:We>=224?3:We>=192?2:1;ze[254]=ze[254]=1;var Ke=function(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,i,s,r,n,o=e.length,a=0;for(r=0;r<o;r++)55296==(64512&(i=e.charCodeAt(r)))&&r+1<o&&(56320==(64512&(s=e.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++)),a+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(a),n=0,r=0;n<a;r++)55296==(64512&(i=e.charCodeAt(r)))&&r+1<o&&(56320==(64512&(s=e.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++)),i<128?t[n++]=i:i<2048?(t[n++]=192|i>>>6,t[n++]=128|63&i):i<65536?(t[n++]=224|i>>>12,t[n++]=128|i>>>6&63,t[n++]=128|63&i):(t[n++]=240|i>>>18,t[n++]=128|i>>>12&63,t[n++]=128|i>>>6&63,t[n++]=128|63&i);return t},Xe=function(e,t){var i,s,r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var n=new Array(2*r);for(s=0,i=0;i<r;){var o=e[i++];if(o<128)n[s++]=o;else{var a=ze[o];if(a>4)n[s++]=65533,i+=a-1;else{for(o&=2===a?31:3===a?15:7;a>1&&i<r;)o=o<<6|63&e[i++],a--;a>1?n[s++]=65533:o<65536?n[s++]=o:(o-=65536,n[s++]=55296|o>>10&1023,n[s++]=56320|1023&o)}}}return function(e,t){if(t<65534&&e.subarray&&Ge)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var i="",s=0;s<t;s++)i+=String.fromCharCode(e[s]);return i}(n,s)},Ye=function(e,t){(t=t||e.length)>e.length&&(t=e.length);for(var i=t-1;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+ze[e[i]]>t?i:t},Je=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Ze=Object.prototype.toString,qe=j.Z_NO_FLUSH,$e=j.Z_SYNC_FLUSH,et=j.Z_FULL_FLUSH,tt=j.Z_FINISH,it=j.Z_OK,st=j.Z_STREAM_END,rt=j.Z_DEFAULT_COMPRESSION,nt=j.Z_DEFAULT_STRATEGY,ot=j.Z_DEFLATED;function at(e){this.options=He({level:rt,method:ot,chunkSize:16384,windowBits:15,memLevel:8,strategy:nt},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Je,this.strm.avail_out=0;var i=Ne.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==it)throw new Error(H[i]);if(t.header&&Ne.deflateSetHeader(this.strm,t.header),t.dictionary){var s;if(s="string"==typeof t.dictionary?Ke(t.dictionary):"[object ArrayBuffer]"===Ze.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(i=Ne.deflateSetDictionary(this.strm,s))!==it)throw new Error(H[i]);this._dict_set=!0}}function lt(e,t){var i=new at(t);if(i.push(e,!0),i.err)throw i.msg||H[i.err];return i.result}at.prototype.push=function(e,t){var i,s,r=this.strm,n=this.options.chunkSize;if(this.ended)return!1;for(s=t===~~t?t:!0===t?tt:qe,"string"==typeof e?r.input=Ke(e):"[object ArrayBuffer]"===Ze.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(s===$e||s===et)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((i=Ne.deflate(r,s))===st)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Ne.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===it;if(0!==r.avail_out){if(s>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},at.prototype.onData=function(e){this.chunks.push(e)},at.prototype.onEnd=function(e){e===it&&(this.result=je(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ut=at,At=lt,ct=function(e,t){return(t=t||{}).raw=!0,lt(e,t)},ht=function(e,t){return(t=t||{}).gzip=!0,lt(e,t)},dt=16209,pt=function(e,t){var i,s,r,n,o,a,l,u,A,c,h,d,p,f,v,g,m,_,y,b,B,x,w,P,C=e.state;i=e.next_in,w=e.input,s=i+(e.avail_in-5),r=e.next_out,P=e.output,n=r-(t-e.avail_out),o=r+(e.avail_out-257),a=C.dmax,l=C.wsize,u=C.whave,A=C.wnext,c=C.window,h=C.hold,d=C.bits,p=C.lencode,f=C.distcode,v=(1<<C.lenbits)-1,g=(1<<C.distbits)-1;e:do{d<15&&(h+=w[i++]<<d,d+=8,h+=w[i++]<<d,d+=8),m=p[h&v];t:for(;;){if(h>>>=_=m>>>24,d-=_,0===(_=m>>>16&255))P[r++]=65535&m;else{if(!(16&_)){if(0==(64&_)){m=p[(65535&m)+(h&(1<<_)-1)];continue t}if(32&_){C.mode=16191;break e}e.msg="invalid literal/length code",C.mode=dt;break e}y=65535&m,(_&=15)&&(d<_&&(h+=w[i++]<<d,d+=8),y+=h&(1<<_)-1,h>>>=_,d-=_),d<15&&(h+=w[i++]<<d,d+=8,h+=w[i++]<<d,d+=8),m=f[h&g];i:for(;;){if(h>>>=_=m>>>24,d-=_,!(16&(_=m>>>16&255))){if(0==(64&_)){m=f[(65535&m)+(h&(1<<_)-1)];continue i}e.msg="invalid distance code",C.mode=dt;break e}if(b=65535&m,d<(_&=15)&&(h+=w[i++]<<d,(d+=8)<_&&(h+=w[i++]<<d,d+=8)),(b+=h&(1<<_)-1)>a){e.msg="invalid distance too far back",C.mode=dt;break e}if(h>>>=_,d-=_,b>(_=r-n)){if((_=b-_)>u&&C.sane){e.msg="invalid distance too far back",C.mode=dt;break e}if(B=0,x=c,0===A){if(B+=l-_,_<y){y-=_;do{P[r++]=c[B++]}while(--_);B=r-b,x=P}}else if(A<_){if(B+=l+A-_,(_-=A)<y){y-=_;do{P[r++]=c[B++]}while(--_);if(B=0,A<y){y-=_=A;do{P[r++]=c[B++]}while(--_);B=r-b,x=P}}}else if(B+=A-_,_<y){y-=_;do{P[r++]=c[B++]}while(--_);B=r-b,x=P}for(;y>2;)P[r++]=x[B++],P[r++]=x[B++],P[r++]=x[B++],y-=3;y&&(P[r++]=x[B++],y>1&&(P[r++]=x[B++]))}else{B=r-b;do{P[r++]=P[B++],P[r++]=P[B++],P[r++]=P[B++],y-=3}while(y>2);y&&(P[r++]=P[B++],y>1&&(P[r++]=P[B++]))}break}}break}}while(i<s&&r<o);i-=y=d>>3,h&=(1<<(d-=y<<3))-1,e.next_in=i,e.next_out=r,e.avail_in=i<s?s-i+5:5-(i-s),e.avail_out=r<o?o-r+257:257-(r-o),C.hold=h,C.bits=d},ft=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),vt=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),gt=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),mt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),_t=function(e,t,i,s,r,n,o,a){var l,u,A,c,h,d,p,f,v,g=a.bits,m=0,_=0,y=0,b=0,B=0,x=0,w=0,P=0,C=0,M=0,k=null,F=new Uint16Array(16),E=new Uint16Array(16),D=null;for(m=0;m<=15;m++)F[m]=0;for(_=0;_<s;_++)F[t[i+_]]++;for(B=g,b=15;b>=1&&0===F[b];b--);if(B>b&&(B=b),0===b)return r[n++]=20971520,r[n++]=20971520,a.bits=1,0;for(y=1;y<b&&0===F[y];y++);for(B<y&&(B=y),P=1,m=1;m<=15;m++)if(P<<=1,(P-=F[m])<0)return-1;if(P>0&&(0===e||1!==b))return-1;for(E[1]=0,m=1;m<15;m++)E[m+1]=E[m]+F[m];for(_=0;_<s;_++)0!==t[i+_]&&(o[E[t[i+_]]++]=_);if(0===e?(k=D=o,d=20):1===e?(k=ft,D=vt,d=257):(k=gt,D=mt,d=0),M=0,_=0,m=y,h=n,x=B,w=0,A=-1,c=(C=1<<B)-1,1===e&&C>852||2===e&&C>592)return 1;for(;;){p=m-w,o[_]+1<d?(f=0,v=o[_]):o[_]>=d?(f=D[o[_]-d],v=k[o[_]-d]):(f=96,v=0),l=1<<m-w,y=u=1<<x;do{r[h+(M>>w)+(u-=l)]=p<<24|f<<16|v|0}while(0!==u);for(l=1<<m-1;M&l;)l>>=1;if(0!==l?(M&=l-1,M+=l):M=0,_++,0==--F[m]){if(m===b)break;m=t[i+o[_]]}if(m>B&&(M&c)!==A){for(0===w&&(w=B),h+=y,P=1<<(x=m-w);x+w<b&&!((P-=F[x+w])<=0);)x++,P<<=1;if(C+=1<<x,1===e&&C>852||2===e&&C>592)return 1;r[A=M&c]=B<<24|x<<16|h-n|0}}return 0!==M&&(r[h+M]=m-w<<24|64<<16|0),a.bits=B,0},yt=j.Z_FINISH,bt=j.Z_BLOCK,Bt=j.Z_TREES,xt=j.Z_OK,wt=j.Z_STREAM_END,Pt=j.Z_NEED_DICT,Ct=j.Z_STREAM_ERROR,Mt=j.Z_DATA_ERROR,kt=j.Z_MEM_ERROR,Ft=j.Z_BUF_ERROR,Et=j.Z_DEFLATED,Dt=16180,It=16190,St=16191,Tt=16192,Lt=16194,Rt=16199,Ut=16200,Ot=16206,Qt=16209,Nt=function(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)};function Vt(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Ht,jt,Gt=function(e){if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.mode<Dt||t.mode>16211?1:0},zt=function(e){if(Gt(e))return Ct;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Dt,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,xt},Wt=function(e){if(Gt(e))return Ct;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,zt(e)},Kt=function(e,t){var i;if(Gt(e))return Ct;var s=e.state;return t<0?(i=0,t=-t):(i=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Ct:(null!==s.window&&s.wbits!==t&&(s.window=null),s.wrap=i,s.wbits=t,Wt(e))},Xt=function(e,t){if(!e)return Ct;var i=new Vt;e.state=i,i.strm=e,i.window=null,i.mode=Dt;var s=Kt(e,t);return s!==xt&&(e.state=null),s},Yt=!0,Jt=function(e){if(Yt){Ht=new Int32Array(512),jt=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(_t(1,e.lens,0,288,Ht,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;_t(2,e.lens,0,32,jt,0,e.work,{bits:5}),Yt=!1}e.lencode=Ht,e.lenbits=9,e.distcode=jt,e.distbits=5},Zt=function(e,t,i,s){var r,n=e.state;return null===n.window&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new Uint8Array(n.wsize)),s>=n.wsize?(n.window.set(t.subarray(i-n.wsize,i),0),n.wnext=0,n.whave=n.wsize):((r=n.wsize-n.wnext)>s&&(r=s),n.window.set(t.subarray(i-s,i-s+r),n.wnext),(s-=r)?(n.window.set(t.subarray(i-s,i),0),n.wnext=s,n.whave=n.wsize):(n.wnext+=r,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=r))),0},qt={inflateReset:Wt,inflateReset2:Kt,inflateResetKeep:zt,inflateInit:function(e){return Xt(e,15)},inflateInit2:Xt,inflate:function(e,t){var i,s,r,n,o,a,l,u,A,c,h,d,p,f,v,g,m,_,y,b,B,x,w,P,C=0,M=new Uint8Array(4),k=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Gt(e)||!e.output||!e.input&&0!==e.avail_in)return Ct;(i=e.state).mode===St&&(i.mode=Tt),o=e.next_out,r=e.output,l=e.avail_out,n=e.next_in,s=e.input,a=e.avail_in,u=i.hold,A=i.bits,c=a,h=l,x=xt;e:for(;;)switch(i.mode){case Dt:if(0===i.wrap){i.mode=Tt;break}for(;A<16;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(2&i.wrap&&35615===u){0===i.wbits&&(i.wbits=15),i.check=0,M[0]=255&u,M[1]=u>>>8&255,i.check=V(i.check,M,2,0),u=0,A=0,i.mode=16181;break}if(i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",i.mode=Qt;break}if((15&u)!==Et){e.msg="unknown compression method",i.mode=Qt;break}if(A-=4,B=8+(15&(u>>>=4)),0===i.wbits&&(i.wbits=B),B>15||B>i.wbits){e.msg="invalid window size",i.mode=Qt;break}i.dmax=1<<i.wbits,i.flags=0,e.adler=i.check=1,i.mode=512&u?16189:St,u=0,A=0;break;case 16181:for(;A<16;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(i.flags=u,(255&i.flags)!==Et){e.msg="unknown compression method",i.mode=Qt;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=Qt;break}i.head&&(i.head.text=u>>8&1),512&i.flags&&4&i.wrap&&(M[0]=255&u,M[1]=u>>>8&255,i.check=V(i.check,M,2,0)),u=0,A=0,i.mode=16182;case 16182:for(;A<32;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}i.head&&(i.head.time=u),512&i.flags&&4&i.wrap&&(M[0]=255&u,M[1]=u>>>8&255,M[2]=u>>>16&255,M[3]=u>>>24&255,i.check=V(i.check,M,4,0)),u=0,A=0,i.mode=16183;case 16183:for(;A<16;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}i.head&&(i.head.xflags=255&u,i.head.os=u>>8),512&i.flags&&4&i.wrap&&(M[0]=255&u,M[1]=u>>>8&255,i.check=V(i.check,M,2,0)),u=0,A=0,i.mode=16184;case 16184:if(1024&i.flags){for(;A<16;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}i.length=u,i.head&&(i.head.extra_len=u),512&i.flags&&4&i.wrap&&(M[0]=255&u,M[1]=u>>>8&255,i.check=V(i.check,M,2,0)),u=0,A=0}else i.head&&(i.head.extra=null);i.mode=16185;case 16185:if(1024&i.flags&&((d=i.length)>a&&(d=a),d&&(i.head&&(B=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(s.subarray(n,n+d),B)),512&i.flags&&4&i.wrap&&(i.check=V(i.check,s,d,n)),a-=d,n+=d,i.length-=d),i.length))break e;i.length=0,i.mode=16186;case 16186:if(2048&i.flags){if(0===a)break e;d=0;do{B=s[n+d++],i.head&&B&&i.length<65536&&(i.head.name+=String.fromCharCode(B))}while(B&&d<a);if(512&i.flags&&4&i.wrap&&(i.check=V(i.check,s,d,n)),a-=d,n+=d,B)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=16187;case 16187:if(4096&i.flags){if(0===a)break e;d=0;do{B=s[n+d++],i.head&&B&&i.length<65536&&(i.head.comment+=String.fromCharCode(B))}while(B&&d<a);if(512&i.flags&&4&i.wrap&&(i.check=V(i.check,s,d,n)),a-=d,n+=d,B)break e}else i.head&&(i.head.comment=null);i.mode=16188;case 16188:if(512&i.flags){for(;A<16;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(4&i.wrap&&u!==(65535&i.check)){e.msg="header crc mismatch",i.mode=Qt;break}u=0,A=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=St;break;case 16189:for(;A<32;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}e.adler=i.check=Nt(u),u=0,A=0,i.mode=It;case It:if(0===i.havedict)return e.next_out=o,e.avail_out=l,e.next_in=n,e.avail_in=a,i.hold=u,i.bits=A,Pt;e.adler=i.check=1,i.mode=St;case St:if(t===bt||t===Bt)break e;case Tt:if(i.last){u>>>=7&A,A-=7&A,i.mode=Ot;break}for(;A<3;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}switch(i.last=1&u,A-=1,3&(u>>>=1)){case 0:i.mode=16193;break;case 1:if(Jt(i),i.mode=Rt,t===Bt){u>>>=2,A-=2;break e}break;case 2:i.mode=16196;break;case 3:e.msg="invalid block type",i.mode=Qt}u>>>=2,A-=2;break;case 16193:for(u>>>=7&A,A-=7&A;A<32;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",i.mode=Qt;break}if(i.length=65535&u,u=0,A=0,i.mode=Lt,t===Bt)break e;case Lt:i.mode=16195;case 16195:if(d=i.length){if(d>a&&(d=a),d>l&&(d=l),0===d)break e;r.set(s.subarray(n,n+d),o),a-=d,n+=d,l-=d,o+=d,i.length-=d;break}i.mode=St;break;case 16196:for(;A<14;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(i.nlen=257+(31&u),u>>>=5,A-=5,i.ndist=1+(31&u),u>>>=5,A-=5,i.ncode=4+(15&u),u>>>=4,A-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=Qt;break}i.have=0,i.mode=16197;case 16197:for(;i.have<i.ncode;){for(;A<3;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}i.lens[k[i.have++]]=7&u,u>>>=3,A-=3}for(;i.have<19;)i.lens[k[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,w={bits:i.lenbits},x=_t(0,i.lens,0,19,i.lencode,0,i.work,w),i.lenbits=w.bits,x){e.msg="invalid code lengths set",i.mode=Qt;break}i.have=0,i.mode=16198;case 16198:for(;i.have<i.nlen+i.ndist;){for(;g=(C=i.lencode[u&(1<<i.lenbits)-1])>>>16&255,m=65535&C,!((v=C>>>24)<=A);){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(m<16)u>>>=v,A-=v,i.lens[i.have++]=m;else{if(16===m){for(P=v+2;A<P;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(u>>>=v,A-=v,0===i.have){e.msg="invalid bit length repeat",i.mode=Qt;break}B=i.lens[i.have-1],d=3+(3&u),u>>>=2,A-=2}else if(17===m){for(P=v+3;A<P;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}A-=v,B=0,d=3+(7&(u>>>=v)),u>>>=3,A-=3}else{for(P=v+7;A<P;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}A-=v,B=0,d=11+(127&(u>>>=v)),u>>>=7,A-=7}if(i.have+d>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=Qt;break}for(;d--;)i.lens[i.have++]=B}}if(i.mode===Qt)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=Qt;break}if(i.lenbits=9,w={bits:i.lenbits},x=_t(1,i.lens,0,i.nlen,i.lencode,0,i.work,w),i.lenbits=w.bits,x){e.msg="invalid literal/lengths set",i.mode=Qt;break}if(i.distbits=6,i.distcode=i.distdyn,w={bits:i.distbits},x=_t(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,w),i.distbits=w.bits,x){e.msg="invalid distances set",i.mode=Qt;break}if(i.mode=Rt,t===Bt)break e;case Rt:i.mode=Ut;case Ut:if(a>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=n,e.avail_in=a,i.hold=u,i.bits=A,pt(e,h),o=e.next_out,r=e.output,l=e.avail_out,n=e.next_in,s=e.input,a=e.avail_in,u=i.hold,A=i.bits,i.mode===St&&(i.back=-1);break}for(i.back=0;g=(C=i.lencode[u&(1<<i.lenbits)-1])>>>16&255,m=65535&C,!((v=C>>>24)<=A);){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(g&&0==(240&g)){for(_=v,y=g,b=m;g=(C=i.lencode[b+((u&(1<<_+y)-1)>>_)])>>>16&255,m=65535&C,!(_+(v=C>>>24)<=A);){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}u>>>=_,A-=_,i.back+=_}if(u>>>=v,A-=v,i.back+=v,i.length=m,0===g){i.mode=16205;break}if(32&g){i.back=-1,i.mode=St;break}if(64&g){e.msg="invalid literal/length code",i.mode=Qt;break}i.extra=15&g,i.mode=16201;case 16201:if(i.extra){for(P=i.extra;A<P;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}i.length+=u&(1<<i.extra)-1,u>>>=i.extra,A-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=16202;case 16202:for(;g=(C=i.distcode[u&(1<<i.distbits)-1])>>>16&255,m=65535&C,!((v=C>>>24)<=A);){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(0==(240&g)){for(_=v,y=g,b=m;g=(C=i.distcode[b+((u&(1<<_+y)-1)>>_)])>>>16&255,m=65535&C,!(_+(v=C>>>24)<=A);){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}u>>>=_,A-=_,i.back+=_}if(u>>>=v,A-=v,i.back+=v,64&g){e.msg="invalid distance code",i.mode=Qt;break}i.offset=m,i.extra=15&g,i.mode=16203;case 16203:if(i.extra){for(P=i.extra;A<P;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}i.offset+=u&(1<<i.extra)-1,u>>>=i.extra,A-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=Qt;break}i.mode=16204;case 16204:if(0===l)break e;if(d=h-l,i.offset>d){if((d=i.offset-d)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=Qt;break}d>i.wnext?(d-=i.wnext,p=i.wsize-d):p=i.wnext-d,d>i.length&&(d=i.length),f=i.window}else f=r,p=o-i.offset,d=i.length;d>l&&(d=l),l-=d,i.length-=d;do{r[o++]=f[p++]}while(--d);0===i.length&&(i.mode=Ut);break;case 16205:if(0===l)break e;r[o++]=i.length,l--,i.mode=Ut;break;case Ot:if(i.wrap){for(;A<32;){if(0===a)break e;a--,u|=s[n++]<<A,A+=8}if(h-=l,e.total_out+=h,i.total+=h,4&i.wrap&&h&&(e.adler=i.check=i.flags?V(i.check,r,h,o-h):Q(i.check,r,h,o-h)),h=l,4&i.wrap&&(i.flags?u:Nt(u))!==i.check){e.msg="incorrect data check",i.mode=Qt;break}u=0,A=0}i.mode=16207;case 16207:if(i.wrap&&i.flags){for(;A<32;){if(0===a)break e;a--,u+=s[n++]<<A,A+=8}if(4&i.wrap&&u!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=Qt;break}u=0,A=0}i.mode=16208;case 16208:x=wt;break e;case Qt:x=Mt;break e;case 16210:return kt;default:return Ct}return e.next_out=o,e.avail_out=l,e.next_in=n,e.avail_in=a,i.hold=u,i.bits=A,(i.wsize||h!==e.avail_out&&i.mode<Qt&&(i.mode<Ot||t!==yt))&&Zt(e,e.output,e.next_out,h-e.avail_out),c-=e.avail_in,h-=e.avail_out,e.total_in+=c,e.total_out+=h,i.total+=h,4&i.wrap&&h&&(e.adler=i.check=i.flags?V(i.check,r,h,e.next_out-h):Q(i.check,r,h,e.next_out-h)),e.data_type=i.bits+(i.last?64:0)+(i.mode===St?128:0)+(i.mode===Rt||i.mode===Lt?256:0),(0===c&&0===h||t===yt)&&x===xt&&(x=Ft),x},inflateEnd:function(e){if(Gt(e))return Ct;var t=e.state;return t.window&&(t.window=null),e.state=null,xt},inflateGetHeader:function(e,t){if(Gt(e))return Ct;var i=e.state;return 0==(2&i.wrap)?Ct:(i.head=t,t.done=!1,xt)},inflateSetDictionary:function(e,t){var i,s=t.length;return Gt(e)?Ct:0!==(i=e.state).wrap&&i.mode!==It?Ct:i.mode===It&&Q(1,t,s,0)!==i.check?Mt:Zt(e,t,s,s)?(i.mode=16210,kt):(i.havedict=1,xt)},inflateInfo:"pako inflate (from Nodeca project)"},$t=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},ei=Object.prototype.toString,ti=j.Z_NO_FLUSH,ii=j.Z_FINISH,si=j.Z_OK,ri=j.Z_STREAM_END,ni=j.Z_NEED_DICT,oi=j.Z_STREAM_ERROR,ai=j.Z_DATA_ERROR,li=j.Z_MEM_ERROR;function ui(e){this.options=He({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Je,this.strm.avail_out=0;var i=qt.inflateInit2(this.strm,t.windowBits);if(i!==si)throw new Error(H[i]);if(this.header=new $t,qt.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Ke(t.dictionary):"[object ArrayBuffer]"===ei.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=qt.inflateSetDictionary(this.strm,t.dictionary))!==si))throw new Error(H[i])}function Ai(e,t){var i=new ui(t);if(i.push(e),i.err)throw i.msg||H[i.err];return i.result}ui.prototype.push=function(e,t){var i,s,r,n=this.strm,o=this.options.chunkSize,a=this.options.dictionary;if(this.ended)return!1;for(s=t===~~t?t:!0===t?ii:ti,"[object ArrayBuffer]"===ei.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(o),n.next_out=0,n.avail_out=o),(i=qt.inflate(n,s))===ni&&a&&((i=qt.inflateSetDictionary(n,a))===si?i=qt.inflate(n,s):i===ai&&(i=ni));n.avail_in>0&&i===ri&&n.state.wrap>0&&0!==e[n.next_in];)qt.inflateReset(n),i=qt.inflate(n,s);switch(i){case oi:case ai:case ni:case li:return this.onEnd(i),this.ended=!0,!1}if(r=n.avail_out,n.next_out&&(0===n.avail_out||i===ri))if("string"===this.options.to){var l=Ye(n.output,n.next_out),u=n.next_out-l,A=Xe(n.output,l);n.next_out=u,n.avail_out=o-u,u&&n.output.set(n.output.subarray(l,l+u),0),this.onData(A)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(i!==si||0!==r){if(i===ri)return i=qt.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},ui.prototype.onData=function(e){this.chunks.push(e)},ui.prototype.onEnd=function(e){e===si&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=je(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ci=function(e,t){return(t=t||{}).raw=!0,Ai(e,t)},hi=ut,di=At,pi=ct,fi=ht,vi=ui,gi=Ai,mi=ci,_i=Ai,yi=j,bi={Deflate:hi,deflate:di,deflateRaw:pi,gzip:fi,Inflate:vi,inflate:gi,inflateRaw:mi,ungzip:_i,constants:yi};e.Deflate=hi,e.Inflate=vi,e.constants=yi,e.default=bi,e.deflate=di,e.deflateRaw=pi,e.gzip=fi,e.inflate=gi,e.inflateRaw=mi,e.ungzip=_i,Object.defineProperty(e,"__esModule",{value:!0})}));var VE=Object.freeze({__proto__:null}),HE=window.pako||VE;HE.inflate||(HE=HE.default);var jE=J.vec4(),GE=J.vec4();var zE,WE=(zE=new Float32Array(3),function(e){return zE[0]=e[0]/255,zE[1]=e[1]/255,zE[2]=e[2]/255,zE});function KE(e,t){var i=[];if(t.length>1)for(var s=0,r=t.length-1;s<r;s++)i.push(t[s]),i.push(t[s+1]);else if(e.length>1)for(var n=0,o=e.length/3-1;n<o;n++)i.push(n),i.push(n+1);return i}!function(){var e=document.createElement("canvas"),t=e.getContext("2d")}();var XE={version:10,parse:function(e,t,i,s,r,n){var o=function(e){var t=0;return{metadata:e[t++],textureData:e[t++],eachTextureDataPortion:e[t++],eachTextureAttributes:e[t++],positions:e[t++],normals:e[t++],colors:e[t++],uvs:e[t++],indices:e[t++],edgeIndices:e[t++],eachTextureSetTextures:e[t++],matrices:e[t++],reusedGeometriesDecodeMatrix:e[t++],eachGeometryPrimitiveType:e[t++],eachGeometryPositionsPortion:e[t++],eachGeometryNormalsPortion:e[t++],eachGeometryColorsPortion:e[t++],eachGeometryUVsPortion:e[t++],eachGeometryIndicesPortion:e[t++],eachGeometryEdgeIndicesPortion:e[t++],eachMeshGeometriesPortion:e[t++],eachMeshMatricesPortion:e[t++],eachMeshTextureSet:e[t++],eachMeshMaterialAttributes:e[t++],eachEntityId:e[t++],eachEntityMeshesPortion:e[t++],eachTileAABB:e[t++],eachTileEntitiesPortion:e[t++]}}(i),a=function(e){function t(e,t){return 0===e.length?[]:HE.inflate(e,t).buffer}return{metadata:JSON.parse(HE.inflate(e.metadata,{to:"string"})),textureData:new Uint8Array(t(e.textureData)),eachTextureDataPortion:new Uint32Array(t(e.eachTextureDataPortion)),eachTextureAttributes:new Uint16Array(t(e.eachTextureAttributes)),positions:new Uint16Array(t(e.positions)),normals:new Int8Array(t(e.normals)),colors:new Uint8Array(t(e.colors)),uvs:new Float32Array(t(e.uvs)),indices:new Uint32Array(t(e.indices)),edgeIndices:new Uint32Array(t(e.edgeIndices)),eachTextureSetTextures:new Int32Array(t(e.eachTextureSetTextures)),matrices:new Float32Array(t(e.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(t(e.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(t(e.eachGeometryPrimitiveType)),eachGeometryPositionsPortion:new Uint32Array(t(e.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(t(e.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(t(e.eachGeometryColorsPortion)),eachGeometryUVsPortion:new Uint32Array(t(e.eachGeometryUVsPortion)),eachGeometryIndicesPortion:new Uint32Array(t(e.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(t(e.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(t(e.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(t(e.eachMeshMatricesPortion)),eachMeshTextureSet:new Int32Array(t(e.eachMeshTextureSet)),eachMeshMaterialAttributes:new Uint8Array(t(e.eachMeshMaterialAttributes)),eachEntityId:JSON.parse(HE.inflate(e.eachEntityId,{to:"string"})),eachEntityMeshesPortion:new Uint32Array(t(e.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(t(e.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(t(e.eachTileEntitiesPortion))}}(o);!function(e,t,i,s,r,n){var o=n.getNextId(),a=i.metadata,l=i.textureData,u=i.eachTextureDataPortion,A=i.eachTextureAttributes,c=i.positions,h=i.normals,d=i.colors,p=i.uvs,f=i.indices,v=i.edgeIndices,g=i.eachTextureSetTextures,m=i.matrices,_=i.reusedGeometriesDecodeMatrix,y=i.eachGeometryPrimitiveType,b=i.eachGeometryPositionsPortion,B=i.eachGeometryNormalsPortion,x=i.eachGeometryColorsPortion,w=i.eachGeometryUVsPortion,P=i.eachGeometryIndicesPortion,C=i.eachGeometryEdgeIndicesPortion,M=i.eachMeshGeometriesPortion,k=i.eachMeshMatricesPortion,F=i.eachMeshTextureSet,E=i.eachMeshMaterialAttributes,D=i.eachEntityId,I=i.eachEntityMeshesPortion,S=i.eachTileAABB,T=i.eachTileEntitiesPortion,L=u.length,R=g.length/5,U=b.length,O=M.length,Q=I.length,N=T.length;r&&r.loadData(a,{includeTypes:t.includeTypes,excludeTypes:t.excludeTypes,globalizeObjectIds:t.globalizeObjectIds});for(var V=0;V<L;V++){var H=V===L-1,j=u[V],G=H?l.length:u[V+1],z=G-j>0,W=9*V,K=1===A[W+0];A[W+1],A[W+2],A[W+3];var X=A[W+4],Y=A[W+5],Z=A[W+6],q=A[W+7],$=A[W+8];if(z){var ee=new Uint8Array(l.subarray(j,G)).buffer,te="".concat(o,"-texture-").concat(V);K?s.createTexture({id:te,buffers:[ee],minFilter:X,magFilter:Y,wrapS:Z,wrapT:q,wrapR:$}):s.createTexture({id:te,imageBuffer:ee,minFilter:X,magFilter:Y,wrapS:Z,wrapT:q,wrapR:$})}}for(var ie=0;ie<R;ie++){var se=5*ie,re="".concat(o,"-textureSet-").concat(ie),ne=g[se+0],ae=g[se+1],le=g[se+2],ue=g[se+3],Ae=g[se+4];s.createTextureSet({id:re,colorTextureId:ne>=0?"".concat(o,"-texture-").concat(ne):null,normalsTextureId:le>=0?"".concat(o,"-texture-").concat(le):null,metallicRoughnessTextureId:ae>=0?"".concat(o,"-texture-").concat(ae):null,emissiveTextureId:ue>=0?"".concat(o,"-texture-").concat(ue):null,occlusionTextureId:Ae>=0?"".concat(o,"-texture-").concat(Ae):null})}for(var ce=new Uint32Array(U),he=0;he<O;he++){var de=M[he];void 0!==ce[de]?ce[de]++:ce[de]=1}for(var pe=J.vec3(),fe=J.AABB3(),ve={},ge=0;ge<N;ge++){var me=ge===N-1,_e=T[ge],ye=me?Q-1:T[ge+1]-1,be=6*ge,Be=S.subarray(be,be+6);J.getAABB3Center(Be,pe),fe[0]=Be[0]-pe[0],fe[1]=Be[1]-pe[1],fe[2]=Be[2]-pe[2],fe[3]=Be[3]-pe[0],fe[4]=Be[4]-pe[1],fe[5]=Be[5]-pe[2];for(var xe=Di.createPositionsDecodeMatrix(fe),we={},Pe=_e;Pe<=ye;Pe++){var Ce=D[Pe],Me=t.globalizeObjectIds?J.globalizeObjectId(s.id,Ce):Ce,ke=Pe===Q-1,Fe=I[Pe],Ee=ke?M.length-1:I[Pe+1]-1,De=[],Ie=e.metaScene.metaObjects[Me],Se={},Te={};if(Ie){if(t.excludeTypesMap&&Ie.type&&t.excludeTypesMap[Ie.type])continue;if(t.includeTypesMap&&Ie.type&&!t.includeTypesMap[Ie.type])continue;var Le=t.objectDefaults?t.objectDefaults[Ie.type]||t.objectDefaults.DEFAULT:null;Le&&(!1===Le.visible&&(Se.visible=!1),!1===Le.pickable&&(Se.pickable=!1),Le.colorize&&(Te.color=Le.colorize),void 0!==Le.opacity&&null!==Le.opacity&&(Te.opacity=Le.opacity),void 0!==Le.metallic&&null!==Le.metallic&&(Te.metallic=Le.metallic),void 0!==Le.roughness&&null!==Le.roughness&&(Te.roughness=Le.roughness))}else if(t.excludeUnclassifiedObjects)continue;for(var Re=Fe;Re<=Ee;Re++){var Ue=M[Re],Oe=ce[Ue]>1,Qe=Ue===U-1,Ne=F[Re],Ve=Ne>=0?"".concat(o,"-textureSet-").concat(Ne):null,He=WE(E.subarray(6*Re,6*Re+3)),je=E[6*Re+3]/255,Ge=E[6*Re+4]/255,ze=E[6*Re+5]/255,We=n.getNextId();if(Oe){var Ke=k[Re],Xe=m.slice(Ke,Ke+16),Ye="".concat(o,"-geometry.").concat(ge,".").concat(Ue),Je=ve[Ye];if(!Je){Je={batchThisMesh:!t.reuseGeometries};var Ze=!1;switch(y[Ue]){case 0:Je.primitiveName="solid",Je.geometryPositions=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),Je.geometryNormals=h.subarray(B[Ue],Qe?h.length:B[Ue+1]),Je.geometryUVs=p.subarray(w[Ue],Qe?p.length:w[Ue+1]),Je.geometryIndices=f.subarray(P[Ue],Qe?f.length:P[Ue+1]),Je.geometryEdgeIndices=v.subarray(C[Ue],Qe?v.length:C[Ue+1]),Ze=Je.geometryPositions.length>0&&Je.geometryIndices.length>0;break;case 1:Je.primitiveName="surface",Je.geometryPositions=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),Je.geometryNormals=h.subarray(B[Ue],Qe?h.length:B[Ue+1]),Je.geometryUVs=p.subarray(w[Ue],Qe?p.length:w[Ue+1]),Je.geometryIndices=f.subarray(P[Ue],Qe?f.length:P[Ue+1]),Je.geometryEdgeIndices=v.subarray(C[Ue],Qe?v.length:C[Ue+1]),Ze=Je.geometryPositions.length>0&&Je.geometryIndices.length>0;break;case 2:Je.primitiveName="points",Je.geometryPositions=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),Je.geometryColors=d.subarray(x[Ue],Qe?d.length:x[Ue+1]),Ze=Je.geometryPositions.length>0;break;case 3:Je.primitiveName="lines",Je.geometryPositions=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),Je.geometryIndices=f.subarray(P[Ue],Qe?f.length:P[Ue+1]),Ze=Je.geometryPositions.length>0&&Je.geometryIndices.length>0;break;case 4:Je.primitiveName="lines",Je.geometryPositions=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),Je.geometryIndices=KE(Je.geometryPositions,f.subarray(P[Ue],Qe?f.length:P[Ue+1])),Ze=Je.geometryPositions.length>0&&Je.geometryIndices.length>0;break;default:continue}if(Ze||(Je=null),Je&&(Je.geometryPositions.length,Je.batchThisMesh)){Je.decompressedPositions=new Float32Array(Je.geometryPositions.length),Je.transformedAndRecompressedPositions=new Uint16Array(Je.geometryPositions.length);for(var qe=Je.geometryPositions,$e=Je.decompressedPositions,et=0,tt=qe.length;et<tt;et+=3)$e[et+0]=qe[et+0]*_[0]+_[12],$e[et+1]=qe[et+1]*_[5]+_[13],$e[et+2]=qe[et+2]*_[10]+_[14];Je.geometryPositions=null,ve[Ye]=Je}}if(Je)if(Je.batchThisMesh){for(var it=Je.decompressedPositions,st=Je.transformedAndRecompressedPositions,rt=0,nt=it.length;rt<nt;rt+=3)jE[0]=it[rt+0],jE[1]=it[rt+1],jE[2]=it[rt+2],jE[3]=1,J.transformVec4(Xe,jE,GE),Di.compressPosition(GE,fe,jE),st[rt+0]=jE[0],st[rt+1]=jE[1],st[rt+2]=jE[2];s.createMesh(oe.apply(Te,{id:We,textureSetId:Ve,origin:pe,primitive:Je.primitiveName,positionsCompressed:st,normalsCompressed:Je.geometryNormals,uv:Je.geometryUVs,colorsCompressed:Je.geometryColors,indices:Je.geometryIndices,edgeIndices:Je.geometryEdgeIndices,positionsDecodeMatrix:xe,color:He,metallic:Ge,roughness:ze,opacity:je})),De.push(We)}else we[Ye]||(s.createGeometry({id:Ye,primitive:Je.primitiveName,positionsCompressed:Je.geometryPositions,normalsCompressed:Je.geometryNormals,uv:Je.geometryUVs,colorsCompressed:Je.geometryColors,indices:Je.geometryIndices,edgeIndices:Je.geometryEdgeIndices,positionsDecodeMatrix:_}),we[Ye]=!0),s.createMesh(oe.apply(Te,{id:We,geometryId:Ye,textureSetId:Ve,matrix:Xe,color:He,metallic:Ge,roughness:ze,opacity:je,origin:pe})),De.push(We)}else{var ot=void 0,at=void 0,lt=void 0,ut=void 0,At=void 0,ct=void 0,ht=void 0,dt=!1;switch(y[Ue]){case 0:ot="solid",at=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),lt=h.subarray(B[Ue],Qe?h.length:B[Ue+1]),ut=p.subarray(w[Ue],Qe?p.length:w[Ue+1]),ct=f.subarray(P[Ue],Qe?f.length:P[Ue+1]),ht=v.subarray(C[Ue],Qe?v.length:C[Ue+1]),dt=at.length>0&&ct.length>0;break;case 1:ot="surface",at=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),lt=h.subarray(B[Ue],Qe?h.length:B[Ue+1]),ut=p.subarray(w[Ue],Qe?p.length:w[Ue+1]),ct=f.subarray(P[Ue],Qe?f.length:P[Ue+1]),ht=v.subarray(C[Ue],Qe?v.length:C[Ue+1]),dt=at.length>0&&ct.length>0;break;case 2:ot="points",at=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),At=d.subarray(x[Ue],Qe?d.length:x[Ue+1]),dt=at.length>0;break;case 3:ot="lines",at=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),ct=f.subarray(P[Ue],Qe?f.length:P[Ue+1]),dt=at.length>0&&ct.length>0;break;case 4:ot="lines",ct=KE(at=c.subarray(b[Ue],Qe?c.length:b[Ue+1]),f.subarray(P[Ue],Qe?f.length:P[Ue+1])),dt=at.length>0&&ct.length>0;break;default:continue}dt&&(s.createMesh(oe.apply(Te,{id:We,textureSetId:Ve,origin:pe,primitive:ot,positionsCompressed:at,normalsCompressed:lt,uv:ut&&ut.length>0?ut:null,colorsCompressed:At,indices:ct&&ct.length>0?ct:null,edgeIndices:ht,positionsDecodeMatrix:xe,color:He,metallic:Ge,roughness:ze,opacity:je})),De.push(We))}}De.length>0&&s.createEntity(oe.apply(Se,{id:Me,isObject:!0,meshIds:De}))}}}(e,t,a,s,r,n)},inflateMetadata:function(e){return JSON.parse(HE.inflate(e,{to:"string"}))}},YE={};YE[XE.version]=XE;var JE=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,["XTCLoader",e,s]))._maxGeometryBatchSize=s.maxGeometryBatchSize,i.textureTranscoder=s.textureTranscoder,i.dataSource=s.dataSource,i.objectDefaults=s.objectDefaults,i.includeTypes=s.includeTypes,i.excludeTypes=s.excludeTypes,i.excludeUnclassifiedObjects=s.excludeUnclassifiedObjects,i.reuseGeometries=s.reuseGeometries,i}return m(t,me),w(t,[{key:"supportedVersions",get:function(){return Object.keys(YE)}},{key:"textureTranscoder",get:function(){return this._textureTranscoder},set:function(e){this._textureTranscoder=e}},{key:"dataSource",get:function(){return this._dataSource},set:function(e){this._dataSource=e||new NE}},{key:"objectDefaults",get:function(){return this._objectDefaults},set:function(e){this._objectDefaults=e||sE}},{key:"includeTypes",get:function(){return this._includeTypes},set:function(e){this._includeTypes=e}},{key:"excludeTypes",get:function(){return this._excludeTypes},set:function(e){this._excludeTypes=e}},{key:"excludeUnclassifiedObjects",get:function(){return this._excludeUnclassifiedObjects},set:function(e){this._excludeUnclassifiedObjects=!!e}},{key:"globalizeObjectIds",get:function(){return this._globalizeObjectIds},set:function(e){this._globalizeObjectIds=!!e}},{key:"reuseGeometries",get:function(){return this._reuseGeometries},set:function(e){this._reuseGeometries=!1!==e}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.id&&this.viewer.scene.components[t.id]&&(this.error("Component with this ID already exists in viewer: "+t.id+" - will autogenerate this ID"),delete t.id),!(t.src||t.xtc||t.manifestSrc||t.manifest))return this.error("load() param expected: src, xtc, manifestSrc or manifestData"),A;var i={},s=t.includeTypes||this._includeTypes,r=t.excludeTypes||this._excludeTypes,n=t.objectDefaults||this._objectDefaults;if(i.reuseGeometries=null!==t.reuseGeometries&&void 0!==t.reuseGeometries?t.reuseGeometries:!1!==this._reuseGeometries,s){i.includeTypesMap={};for(var o=0,a=s.length;o<a;o++)i.includeTypesMap[s[o]]=!0}if(r){i.excludeTypesMap={};for(var l=0,u=r.length;l<u;l++)i.excludeTypesMap[r[l]]=!0}n&&(i.objectDefaults=n),i.excludeUnclassifiedObjects=void 0!==t.excludeUnclassifiedObjects?!!t.excludeUnclassifiedObjects:this._excludeUnclassifiedObjects,i.globalizeObjectIds=void 0!==t.globalizeObjectIds&&null!==t.globalizeObjectIds?!!t.globalizeObjectIds:this._globalizeObjectIds;var A=new vh(this.viewer.scene,oe.apply(t,{isModel:!0,textureTranscoder:this._textureTranscoder,maxGeometryBatchSize:this._maxGeometryBatchSize,origin:t.origin,disableVertexWelding:t.disableVertexWelding||!1,disableIndexRebucketing:t.disableIndexRebucketing||!1,dtxEnabled:t.dtxEnabled})),c=A.id,h=new ap({metaScene:this.viewer.metaScene,id:c});this.viewer.scene.canvas.spinner.processes++;var d,p,f=function(){A.destroyed||(A.finalize(),h.finalize(),e.viewer.scene.canvas.spinner.processes--,A.once("destroyed",(function(){e.viewer.metaScene.destroyMetaModel(h.id)})),e.scheduleTask((function(){A.destroyed||(A.scene.fire("modelLoaded",A.id),A.fire("loaded",!0,!1))})))},v=function(t){e.viewer.scene.canvas.spinner.processes--,e.error(t),A.fire("error",t)},g=0,m={getNextId:function(){return"".concat(c,".").concat(g++)}};if(t.metaModelSrc||t.metaModelData)if(t.metaModelSrc){var _=t.metaModelSrc;this._dataSource.getMetaModel(_,(function(n){A.destroyed||(h.loadData(n,{includeTypes:s,excludeTypes:r,globalizeObjectIds:i.globalizeObjectIds}),t.src?e._loadModel(t.src,t,i,A,null,m,f,v):(e._parseModel(t.xtc,t,i,A,null,m),f()))}),(function(e){v("load(): Failed to load model metadata for model '".concat(c," from '").concat(_,"' - ").concat(e))}))}else t.metaModelData&&(h.loadData(t.metaModelData,{includeTypes:s,excludeTypes:r,globalizeObjectIds:i.globalizeObjectIds}),t.src?this._loadModel(t.src,t,i,A,null,m,f,v):(this._parseModel(t.xtc,t,i,A,null,m),f()));else if(t.src)this._loadModel(t.src,t,i,A,h,m,f,v);else if(t.xtc)this._parseModel(t.xtc,t,i,A,h,m),f();else if(t.manifestSrc||t.manifest){var y=t.manifestSrc?(d=t.manifestSrc,(p=d.split("/")).pop(),p.join("/")+"/"):"",b=function(t,n,o){var a=0,l=function(){A.destroyed||a>=t.length?n():e._dataSource.getMetaModel("".concat(y).concat(t[a]),(function(t){h.loadData(t,{includeTypes:s,excludeTypes:r,globalizeObjectIds:i.globalizeObjectIds}),a++,e.scheduleTask(l,200)}),o)};l()},B=function(s,r,n){var o=0,a=function(){A.destroyed||o>=s.length?r():e._dataSource.getXTC("".concat(y).concat(s[o]),(function(s){e._parseModel(s,t,i,A,null,m),A.preFinalize(),o++,e.scheduleTask(a,200)}),n)};a()},x=function(s,r,n){var o=0,a=function(){A.destroyed||o>=s.length?r():e._dataSource.getXTC("".concat(y).concat(s[o]),(function(s){e._parseModel(s,t,i,A,h,m),A.preFinalize(),o++,e.scheduleTask(a,100)}),n)};a()};if(t.manifest){var w=t.manifest,P=w.xtcFiles;if(!P||0===P.length)return void v("load(): Failed to load model manifest - manifest not valid");var C=w.metaModelFiles;C?b(C,(function(){B(P,f,v)}),v):x(P,f,v)}else this._dataSource.getManifest(t.manifestSrc,(function(e){if(!A.destroyed){var t=e.xtcFiles;if(t&&0!==t.length){var i=e.metaModelFiles;i?b(i,(function(){B(t,f,v)}),v):x(t,f,v)}else v("load(): Failed to load model manifest - manifest not valid")}}),v)}return A}},{key:"_loadModel",value:function(e,t,i,s,r,n,o,a){var l=this;this._dataSource.getXTC(t.src,(function(e){l._parseModel(e,t,i,s,r,n),s.preFinalize(),o()}),a)}},{key:"_parseModel",value:(i=o(r().mark((function e(t,i,s,n,o,a){var l,u,A,c,h,d,p,f,v;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.destroyed){e.next=2;break}return e.abrupt("return");case 2:if(l=new DataView(t),u=new Uint8Array(t),A=l.getUint32(0,!0),c=YE[A]){e.next=9;break}return this.error("Unsupported .XTC file version: "+A+" - this XTCLoaderPlugin supports versions "+Object.keys(YE)),e.abrupt("return");case 9:for(this.log("Loading .xtc V"+A),h=l.getUint32(4,!0),d=[],p=4*(h+2),f=0;f<h;f++)v=l.getUint32(4*(f+2),!0),d.push(u.subarray(p,p+v)),p+=v;c.parse(this.viewer,s,d,n,o,a);case 15:case"end":return e.stop()}}),e,this)}))),function(e,t,s,r,n,o){return i.apply(this,arguments)})},{key:"loadMetadata",value:function(e,t,i,s){var r=this;e._finalized=!1;try{this._workerInflate(e,t,i,(function(t){t.terminate(),r.fire("metaLoaded",{result:"success",metaModel:e}),"function"==typeof s&&s()}),(function(t,i){t.terminate(),r.fire("metaLoaded",{result:"failed",message:i,metaModel:e})}))}catch(t){this.fire("metaloaded",{result:t,metaModel:e})}}},{key:"_workerInflate",value:function(e,t,i,s,r){var n,o,a=this,l=(n=new Blob(['\n self.importScripts(\'https://cdnjs.cloudflare.com/ajax/libs/pako/1.0.11/pako.min.js\');\n \n function inflateMetadata(deflatedData) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(self.pako.inflate(deflatedData, { to: "string" }));\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error("Error inflating metadata:", error);\n\t\t\t\tthrow error;\n\t\t\t} \n\t\t}\n \n self.onmessage = function (e) {\n console.log("start worker:");\n const metaJson = inflateMetadata(e.data.buffer);\n\n self.postMessage({\n metaJson,\n time: new Date().getTime()\n });\n };\n '],{type:"application/javascript"}),o=URL.createObjectURL(n),new Worker(o));l.postMessage({buffer:t}),l.onmessage=function(t){i?e.loadData(t.data.metaJson,(function(){e.finalize(),"function"==typeof s?s(l):l.terminate()}),(function(e){"function"==typeof r&&r(l,e)})):a.fire("metaLoading",(function(){e.loadData(t.data.metaJson,(function(){e.finalize(),"function"==typeof s?s(l):l.terminate()}),(function(e){"function"==typeof r&&r(l,e)}))}))},l.onerror=function(e){"function"==typeof r&&r(l,e.message),l.terminate()}}}]);var i}();var ZE=function(){return w((function e(){B(this,e)}),[{key:"getIFC",value:function(e,t,i){var s=function(){};t=t||s,i=i||s;var r=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){var n=!!r[2],o=r[3];o=window.decodeURIComponent(o),n&&(o=window.atob(o));try{for(var a=new ArrayBuffer(o.length),l=new Uint8Array(a),u=0;u<o.length;u++)l[u]=o.charCodeAt(u);t(a)}catch(e){i(e)}}else{var A=new XMLHttpRequest;A.open("GET",e,!0),A.responseType="arraybuffer",A.onreadystatechange=function(){4===A.readyState&&(200===A.status?t(A.response):i("getXTC error : "+A.response))},A.send(null)}}}])}(),qE=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,["ifcLoader",e,s])).dataSource=s.dataSource,i.objectDefaults=s.objectDefaults,i.includeTypes=s.includeTypes,i.excludeTypes=s.excludeTypes,i.excludeUnclassifiedObjects=s.excludeUnclassifiedObjects,s.WebIFC&&(i._webIFC=s.WebIFC,i._ifcAPI=s.IfcAPI,i.webIfcFroMOutside=!0),i}return m(t,me),w(t,[{key:"supportedVersions",get:function(){return["2x3","4"]}},{key:"dataSource",get:function(){return this._dataSource},set:function(e){this._dataSource=e||new ZE}},{key:"objectDefaults",get:function(){return this._objectDefaults},set:function(e){this._objectDefaults=e||sE}},{key:"includeTypes",get:function(){return this._includeTypes},set:function(e){this._includeTypes=e}},{key:"excludeTypes",get:function(){return this._excludeTypes},set:function(e){this._excludeTypes=e}},{key:"excludeUnclassifiedObjects",get:function(){return this._excludeUnclassifiedObjects},set:function(e){this._excludeUnclassifiedObjects=!!e}},{key:"globalizeObjectIds",get:function(){return this._globalizeObjectIds},set:function(e){this._globalizeObjectIds=!!e}},{key:"load",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.id&&this.viewer.scene.components[e.id]&&(this.error("Component with this ID already exists in viewer: "+e.id+" - will autogenerate this ID"),delete e.id);var t=new vh(this.viewer.scene,oe.apply(e,{isModel:!0}));if(!e.src&&!e.ifc)return this.error("load() param expected: src or IFC"),t;var i={autoNormals:!0};if(!1!==e.loadMetadata){var s=e.includeTypes||this._includeTypes,r=e.excludeTypes||this._excludeTypes,n=e.objectDefaults||this._objectDefaults;if(s){i.includeTypesMap={};for(var o=0,a=s.length;o<a;o++)i.includeTypesMap[s[o]]=!0}if(r){i.excludeTypesMap={};for(var l=0,u=r.length;l<u;l++)i.excludeTypesMap[r[l]]=!0}n&&(i.objectDefaults=n),i.excludeUnclassifiedObjects=void 0!==e.excludeUnclassifiedObjects?!!e.excludeUnclassifiedObjects:this._excludeUnclassifiedObjects,i.globalizeObjectIds=void 0!==e.globalizeObjectIds?!!e.globalizeObjectIds:this._globalizeObjectIds}if(this.webIfcFroMOutside)try{e.src?this._loadModel(e.src,e,i,t):this._parseModel(e.ifc,e,i,t)}catch(e){this.error(e),t.fire("error",e)}return t}},{key:"_loadModel",value:function(e,t,i,s){var r=this,n=this.viewer.scene.canvas.spinner;n.processes++,this._dataSource.getIFC(t.src,(function(e){r._parseModel(e,t,i,s),n.processes--}),(function(e){n.processes--,r.error(e),s.fire("error",e)}))}},{key:"_parseModel",value:function(e,t,i,s){if(!s.destroyed){var r=t.stats||{};if(r.sourceFormat="IFC",r.schemaVersion="",r.title="",r.author="",r.created="",r.numMetaObjects=0,r.numPropertySets=0,r.numObjects=0,r.numGeometries=0,r.numTriangles=0,r.numVertices=0,this.webIfcFroMOutside){if(!this._ifcAPI)throw"WebIFCLoaderPlugin has no WebIFC instance configured - please inject via WebIFCLoaderPlugin constructor"}else i.wasmPath&&this._ifcAPI.SetWasmPath(i.wasmPath);var n,o=new Uint8Array(e),a=this._ifcAPI.OpenModel(o),l=this._ifcAPI.GetModelSchema(a),u=this._ifcAPI.GetLineIDsWithType(a,this._webIFC.IFCPROJECT).get(0),A=!1!==t.loadMetadata,c=void 0!==t.metadata&&null!==t.metadata;n=c?t.metadata:null;var h={ifcProjectId:u,modelID:a,modelSchema:l,sceneModel:s,loadMetadata:A,metadata:A?{id:"",projectId:""+u,author:"",createdAt:"",schema:"",creatingApplication:"",metaObjects:[],propertySets:[]}:n,metaObjects:c?s.metaObjects:{},options:i,nextId:0,stats:r};if(A){if(i.includeTypes){h.includeTypes={};for(var d=0,p=i.includeTypes.length;d<p;d++)h.includeTypes[i.includeTypes[d]]=!0}if(i.excludeTypes){h.excludeTypes={};for(var f=0,v=i.excludeTypes.length;f<v;f++)h.excludeTypes[i.excludeTypes[f]]=!0}this._parseMetaObjects(h),this._parsePropertySets(h)}if(this._parseGeometry(h),s.finalize(),A||c){var g=s.id;this.viewer.metaScene.createMetaModel(g,h.metadata,i)}s.scene.once("tick",(function(){s.destroyed||(s.scene.fire("modelLoaded",s.id),s.fire("loaded",!0,!1))}))}}},{key:"_parseMetaObjects",value:function(e){var t=this._ifcAPI.GetLine(e.modelID,e.ifcProjectId);this._parseSpatialChildren(e,t)}},{key:"_parseSpatialChildren",value:function(e,t,i){var s=this._ifcAPI.GetNameFromTypeCode(t.type);if((!e.includeTypes||e.includeTypes[s])&&(!e.excludeTypes||!e.excludeTypes[s])){this._createMetaObject(e,t,i);var r=t.GlobalId.value;this._parseRelatedItemsOfType(e,t.expressID,"RelatingObject","RelatedObjects",this._webIFC.IFCRELAGGREGATES,r),this._parseRelatedItemsOfType(e,t.expressID,"RelatingStructure","RelatedElements",this._webIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,r)}}},{key:"_createMetaObject",value:function(e,t,i){var s,r=t.GlobalId.value;s=this.webIfcFroMOutside?this._ifcAPI.GetNameFromTypeCode(t.type):t.__proto__.constructor.name;var n={id:r,name:t.Name&&""!==t.Name.value?t.Name.value:s,type:s,parent:i};e.metadata.metaObjects.push(n),e.metaObjects[r]=n,e.stats.numMetaObjects++}},{key:"_parseRelatedItemsOfType",value:function(e,t,i,s,r,n){for(var o=this,a=this._ifcAPI.GetLineIDsWithType(e.modelID,r),l=0;l<a.size();l++){var u=a.get(l),A=this._ifcAPI.GetLine(e.modelID,u);if(null==A)return;var c=A[i],h=!1;if(Array.isArray(c))h=c.map((function(e){return e.value})).includes(t);else h=c.value===t;if(h){var d=A[s];if(Array.isArray(d))d.forEach((function(t){var i=o._ifcAPI.GetLine(e.modelID,t.value);null!=i&&o._parseSpatialChildren(e,i,n)}));else{var p=this._ifcAPI.GetLine(e.modelID,d.value);if(null==p)return;this._parseSpatialChildren(e,p,n)}}}}},{key:"_parsePropertySets",value:function(e){this.log("start parse property...");for(var t=this._ifcAPI.GetLineIDsWithType(e.modelID,this._webIFC.IFCRELDEFINESBYPROPERTIES),i=0;i<t.size();i++){var s=t.get(i),r=this._ifcAPI.GetLine(e.modelID,s,!0);if(r){var n=r.RelatingPropertyDefinition;if(!n)continue;var o=n.GlobalId.value,a=n.HasProperties;if(a&&a.length>0){for(var l=n.Name.value,u=[],A=0,c=a.length;A<c;A++){var h=a[A],d=h.Name,p=h.NominalValue;if(d&&p){var f={name:d.value,type:p.type,value:p.value,valueType:p.valueType};h.Description?f.description=h.Description.value:p.description&&(f.description=p.description),u.push(f)}}var v={id:o,type:"Default",name:l,properties:u};e.metadata.propertySets.push(v),e.stats.numPropertySets++;var g=r.RelatedObjects;if(!g||0===g.length)return;for(var m=0,_=g.length;m<_;m++){var y=g[m].GlobalId.value,b=e.metaObjects[y];b&&(b.propertySetIds||(b.propertySetIds=[]),b.propertySetIds.push(o))}}}}}},{key:"_parseGeometry",value:function(e){var t=this;this.log("start parse geometry"),this._ifcAPI.StreamAllMeshes(e.modelID,(function(i){var s=i.expressID,r=i.geometries,n=[],o=t._ifcAPI.GetLine(e.modelID,s);if(null!=o){var a=o.GlobalId.value;if(e.loadMetadata){var l=a,u=e.metaObjects[l];if(e.includeTypes&&(!u||!e.includeTypes[u.type]))return;if(e.excludeTypes&&(!u||e.excludeTypes[u.type]))return}for(var A=J.mat4(),c=J.vec3(),h=0,d=r.size();h<d;h++){for(var p=r.get(h),f=t._ifcAPI.GetGeometry(e.modelID,p.geometryExpressID),v=t._ifcAPI.GetVertexArray(f.GetVertexData(),f.GetVertexDataSize()),g=t._ifcAPI.GetIndexArray(f.GetIndexData(),f.GetIndexDataSize()),m=new Float64Array(v.length/2),_=new Float32Array(v.length/2),y=0,b=0,B=v.length/6;y<B;y++,b+=3)m[b+0]=v[6*y+0],m[b+1]=v[6*y+1],m[b+2]=v[6*y+2];A.set(p.flatTransformation),J.transformPositions3(A,m);var x=we(m,m,c);if(!e.options.autoNormals)for(var w=0,P=0,C=v.length/6;w<C;w++,P+=3)_[P+0]=v[6*w+3],_[P+1]=v[6*w+4],_[P+2]=v[6*w+5];e.stats.numGeometries++,e.stats.numVertices+=m.length/3,e.stats.numTriangles+=g.length/3;var M="mesh"+e.nextId++;e.sceneModel.createMesh({id:M,primitive:"triangles",origin:x?c:null,positions:m,normals:e.options.autoNormals?null:_,indices:g,color:[p.color.x,p.color.y,p.color.z],opacity:p.color.w}),n.push(M)}var k=e.options.globalizeObjectIds?J.globalizeObjectId(e.sceneModel.id,a):a;e.sceneModel.createEntity({id:k,meshIds:n,isObject:!0}),e.stats.numObjects++}})),this._ifcAPI.StreamAllMeshesWithTypes(e.modelID,[3856911033],(function(i,s,r){var n=i.expressID,o=t._ifcAPI.GetLine(e.modelID,n);if(null!=o){for(var a=o.GlobalId.value,l=i.geometries,u=[],A=J.mat4(),c=J.vec3(),h=0,d=l.size();h<d;h++){for(var p=l.get(h),f=t._ifcAPI.GetGeometry(e.modelID,p.geometryExpressID),v=t._ifcAPI.GetVertexArray(f.GetVertexData(),f.GetVertexDataSize()),g=t._ifcAPI.GetIndexArray(f.GetIndexData(),f.GetIndexDataSize()),m=new Float64Array(v.length/2),_=new Float32Array(v.length/2),y=0,b=0,B=v.length/6;y<B;y++,b+=3)m[b+0]=v[6*y+0],m[b+1]=v[6*y+1],m[b+2]=v[6*y+2];A.set(p.flatTransformation),J.transformPositions3(A,m);var x=we(m,m,c);if(!e.options.autoNormals)for(var w=0,P=0,C=v.length/6;w<C;w++,P+=3)_[P+0]=v[6*w+3],_[P+1]=v[6*w+4],_[P+2]=v[6*w+5];e.stats.numGeometries++,e.stats.numVertices+=m.length/3,e.stats.numTriangles+=g.length/3;var M="mesh"+e.nextId++;e.sceneModel.createMesh({id:M,primitive:"triangles",origin:x?c:null,positions:m,normals:e.options.autoNormals?null:_,indices:g,color:[p.color.x,p.color.y,p.color.z],opacity:p.color.w<1?p.color.w:.1}),u.push(M)}var k=e.options.globalizeObjectIds?J.globalizeObjectId(e.sceneModel.id,a):a;e.sceneModel.createEntity({id:k,meshIds:u,isObject:!0}),e.stats.numObjects++}}))}}])}(),$E=function(){return w((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};B(this,e),this.cacheBuster=!1!==t.cacheBuster}),[{key:"_cacheBusterURL",value:function(e){if(!this.cacheBuster)return e;var t=(new Date).getTime();return e.indexOf("?")>-1?e+"&_="+t:e+"?_="+t}},{key:"getLAS",value:function(e,t,i){e=this._cacheBusterURL(e);var s=function(){};t=t||s,i=i||s;var r=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){var n=!!r[2],o=r[3];o=window.decodeURIComponent(o),n&&(o=window.atob(o));try{for(var a=new ArrayBuffer(o.length),l=new Uint8Array(a),u=0;u<o.length;u++)l[u]=o.charCodeAt(u);t(a)}catch(e){i(e)}}else{var A=new XMLHttpRequest;A.open("GET",e,!0),A.responseType="arraybuffer",A.onreadystatechange=function(){4===A.readyState&&(200===A.status?t(A.response):i("getXKT error : "+A.response))},A.send(null)}}}])}(),eD={name:"LAS",id:"las",module:"las",version:"3.4.14",worker:!0,extensions:["las","laz"],mimeTypes:["application/octet-stream"],text:!0,binary:!0,tests:["LAS"],options:{las:{shape:"mesh",fp64:!1,skip:1,colorDepth:8}}},tD=[{item:"FileSignature",format:"char",size:4},{item:"FileSoureceID",format:"uShort",size:2},{item:"GlobalEncoding",format:"uShort",size:2},{item:"ProjectID1",format:"notUsed",size:4},{item:"ProjectID2",format:"notUsed",size:2},{item:"ProjectID3",format:"notUsed",size:2},{item:"ProjectID4",format:"notUsed",size:8},{item:"VersionMajor",format:"uChar",size:1},{item:"VersionMinor",format:"uChar",size:1},{item:"SystemIdentifier",format:"char",size:32},{item:"GeneratingSoftware",format:"char",size:32},{item:"CreationDay",format:"uShort",size:2},{item:"CreationYear",format:"uShort",size:2},{item:"HeaderSize",format:"uShort",size:2},{item:"OffsetToPointData",format:"uLong",size:4},{item:"NumberOfVariableLengthRecords",format:"uLong",size:4},{item:"PointDataFormatID",format:"uChar",size:1},{item:"PointDataRecordLength",format:"uShort",size:2},{item:"NumberOfPoints",format:"uLong",size:4},{item:"NumberOfPointByReturn",format:"uLong",size:20},{item:"ScaleFactorX",format:"double",size:8},{item:"ScaleFactorY",format:"double",size:8},{item:"ScaleFactorZ",format:"double",size:8},{item:"OffsetX",format:"double",size:8},{item:"OffsetY",format:"double",size:8},{item:"OffsetZ",format:"double",size:8},{item:"MaxX",format:"double",size:8},{item:"MinX",format:"double",size:8},{item:"MaxY",format:"double",size:8},{item:"MinY",format:"double",size:8},{item:"MaxZ",format:"double",size:8},{item:"MinZ",format:"double",size:8}],iD=[{item:"Reserved",format:"uShort",size:2},{item:"UserId",format:"char",size:16},{item:"RecordId",format:"uShort",size:2},{item:"RecordLengthAfterHeader",format:"uShort",size:2},{item:"Description",format:"char",size:32}],sD=function(e){var t=0,i=0,r=0,n=new DataView(e),o=new Uint8Array(6e3),a=function(s){var r,o,a=s.item,l=s.format,u=s.size;switch(l){case"char":return o=new Uint8Array(e,t,u),t+=u,[a,r=nD(o)];case"uShort":return r=n.getUint16(t,!0),t+=u,[a,r];case"uLong":return r=n.getUint32(t,!0),"NumberOfVariableLengthRecords"===a&&(i=r),t+=u,[a,r];case"uChar":return r=n.getUint8(t),t+=u,[a,r];case"double":return r=n.getFloat64(t,!0),t+=u,[a,r];default:t+=u}};return function(){var e={};tD.forEach((function(t){var i=a(s({},t));if(void 0!==i){if("FileSignature"===i[0]&&"LASF"!==i[1])throw new Error("Ivalid FileSignature. Is this a LAS/LAZ file");e[i[0]]=i[1]}}));for(var n=[],l=i,u=function(){var e={};iD.forEach((function(i){var n=a(s({},i));e[n[0]]=n[1],"UserId"===n[0]&&"LASF_Projection"===n[1]&&(r=t-18+54)})),n.push(e)};l--;)u();var A=function(e){if(void 0!==e){for(var t=r+e.RecordLengthAfterHeader,i=o.slice(r,t),s=rD(i),n=new DataView(s),a=6,l=Number(n.getUint16(a,!0)),u=[];l--;){var A={};A.key=n.getUint16(a+=2,!0),A.tiffTagLocation=n.getUint16(a+=2,!0),A.count=n.getUint16(a+=2,!0),A.valueOffset=n.getUint16(a+=2,!0),u.push(A)}var c=u.find((function(e){return 3072===e.key}));if(c&&c.hasOwnProperty("valueOffset"))return c.valueOffset}}(n.find((function(e){return"LASF_Projection"===e.UserId})));return A&&(e.epsg=A),e}()},rD=function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),s=0;s<e.length;++s)i[s]=e[s];return t},nD=function(e){var t="";return e.forEach((function(e){var i=String.fromCharCode(e);"\0"!==i&&(t+=i)})),t.trim()},oD=5e5,aD=function(e){function t(e){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),(i=h(this,t,["lasLoader",e,s])).dataSource=s.dataSource,i.skip=s.skip,i.fp64=s.fp64,i.colorDepth=s.colorDepth,i.center=s.center,i.rotate=s.rotate,i.rotateX=s.rotateX,i.transform=s.transform,i}return m(t,me),w(t,[{key:"dataSource",get:function(){return this._dataSource},set:function(e){this._dataSource=e||new $E}},{key:"skip",get:function(){return this._skip},set:function(e){this._skip=e||1}},{key:"fp64",get:function(){return this._fp64},set:function(e){this._fp64=!!e}},{key:"colorDepth",get:function(){return this._colorDepth},set:function(e){this._colorDepth=e||"auto"}},{key:"center",get:function(){return this._center},set:function(e){this._center=!!e}},{key:"transform",get:function(){return this._transform},set:function(e){this._transform=e}},{key:"rotate",get:function(){return this._rotate},set:function(e){this._rotate=e}},{key:"rotateX",get:function(){return this._rotateX},set:function(e){this._rotateX=e}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.id&&this.viewer.scene.components[t.id]&&(this.error("Component with this ID already exists in viewer: "+t.id+" - will autogenerate this ID"),delete t.id);var i=new vh(this.viewer.scene,oe.apply(t,{maxGeometryBatchSize:oD,isModel:!0}));if(!t.src&&!t.las)return this.error("load() param expected: src or las"),i;var s={las:{skip:this._skip,fp64:this._fp64,colorDepth:this._colorDepth}};if(t.src)this._loadModel(t.src,t,s,i);else{var r=this.viewer.scene.canvas.spinner;r.processes++,this._parseModel(t.las,t,s,i).then((function(){r.processes--}),(function(t){r.processes--,e.error(t),i.fire("error",t)}))}return i}},{key:"_loadModel",value:function(e,t,i,s){var r=this,n=this.viewer.scene.canvas.spinner;n.processes++,this._dataSource.getLAS(t.src,(function(e){r._parseModel(e,t,i,s).then((function(){n.processes--}),(function(e){n.processes--,r.error(e),s.fire("error",e)}))}),(function(e){n.processes--,r.error(e),s.fire("error",e)}))}},{key:"_parseModel",value:function(e,t,i,s){var r=this,n=function(e){var t=e.value;if(r._center){for(var i=J.vec3(),s=t.length,n=0,o=t.length;n<o;n+=3)i[0]+=t[n+0],i[1]+=t[n+1],i[2]+=t[n+2];i[0]/=s,i[1]/=s,i[2]/=s;for(var a=0,l=t.length;a<l;a+=3)t[a+0]-=i[0],t[a+1]-=i[1],t[a+2]-=i[2]}if(r._rotateX&&t)for(var u=0,A=t.length;u<A;u+=3){var c=t[u+1];t[u+1]=t[u+2],t[u+2]=c}if(r._rotate){var h=J.identityQuaternion(),d=J.mat4();J.eulerToQuaternion(r._rotate,"XYZ",h),J.quaternionToRotationMat4(h,d);for(var p=J.vec3(),f=0,v=t.length;f<v;f+=3)p[0]=t[f+0],p[1]=t[f+1],p[2]=t[f+2],J.transformPoint3(d,p,p),t[f+0]=p[0],t[f+1]=p[1],t[f+2]=p[2]}if(r._transform)for(var g=J.mat4(r._transform),m=J.vec3(),_=0,y=t.length;_<y;_+=3)m[0]=t[_+0],m[1]=t[_+1],m[2]=t[_+2],J.transformPoint3(g,m,m),t[_+0]=m[0],t[_+1]=m[1],t[_+2]=m[2];return t};function o(e,t){for(var i=e.value,s=e.size,r=t.value,n=4*r.length,o=new Uint8Array(n),a=0,l=0,u=0,A=r.length;a<A;a++,u+=s,l+=4)o[l+0]=i[u+0],o[l+1]=i[u+1],o[l+2]=i[u+2],o[l+3]=Math.round(r[a]/65536*255);return o}function a(e){for(var t=e.value,i=4*t.length,s=new Uint8Array(i),r=0,n=0,o=t.length;r<o;r++,3,n+=4)s[n+0]=0,s[n+1]=0,s[n+2]=0,s[n+3]=Math.round(t[r]/65536*255);return s}return new Promise((function(l,u){if(s.destroyed)u();else{var A=t.stats||{};A.sourceFormat="LAS",A.schemaVersion="",A.title="",A.author="",A.created="",A.numMetaObjects=0,A.numPropertySets=0,A.numObjects=0,A.numGeometries=0,A.numTriangles=0,A.numVertices=0;try{var c=sD(e);iw(e,eD,i).then((function(e){var A,h,d=e.attributes,p=e.loaderData,f=void 0!==p.pointsFormatId?p.pointsFormatId:-1;if(!d.POSITION)return s.finalize(),void u("No positions found in file");switch(f){case 0:A=n(d.POSITION),h=a(d.intensity);break;case 1:if(!d.intensity)return s.finalize(),void u("No positions found in file");A=n(d.POSITION),h=a(d.intensity);break;case 2:case 3:if(!d.intensity)return s.finalize(),void u("No positions found in file");A=n(d.POSITION),h=o(d.COLOR_0,d.intensity)}for(var v=lD(A,15e5),g=lD(h,2e6),m=[],_=0,y=v.length;_<y;_++){var b="pointsMesh".concat(_);m.push(b),s.createMesh({id:b,primitive:"points",positions:v[_],colorsCompressed:_<g.length?g[_]:null})}var B=t.entityId||J.createUUID();if(s.createEntity({id:B,meshIds:m,isObject:!0}),s.finalize(),t.metaModelJSON){var x=s.id;r.viewer.metaScene.createMetaModel(x,t.metaModelJSON,i)}else if(!1!==t.loadMetadata){var w=J.createUUID(),P={projectId:"",author:"",createdAt:"",schema:"",creatingApplication:"",metaObjects:[{id:w,name:"Model",type:"Model"},{id:B,name:"PointCloud (LAS)",type:"PointCloud",parent:w,attributes:c||{}}],propertySets:[]},C=s.id;r.viewer.metaScene.createMetaModel(C,P,i)}s.scene.once("tick",(function(){s.destroyed||(s.scene.fire("modelLoaded",s.id),s.fire("loaded",!0,!1))})),l()}))}catch(e){s.finalize(),u(e)}}}))}}])}();function lD(e,t){if(t>=e.length)return[e];for(var i=[],s=0;s<e.length;s+=t)i.push(e.slice(s,s+t));return i}export{ws as AlphaFormat,yi as AmbientLight,Xe as AngleMeasurementsControl,Ye as AngleMeasurementsMouseControl,Je as AngleMeasurementsPlugin,$e as AngleMeasurementsSimulateMouseControl,qe as AngleMeasurementsTouchControl,rt as AnnotationsPlugin,cn as AxisGizmoPlugin,xh as BCFViewpointsPlugin,$n as Bitmap,ps as ByteType,ud as CameraMemento,jh as CameraPath,Jh as CameraPathAnimation,gt as Canvas,ts as ClampToEdgeWrapping,_e as Component,dr as CompressedMediaType,Xo as Configs,pd as CubicBezierCurve,Nh as Curve,Fc as DefaultLoadingManager,Fs as DepthFormat,Es as DepthStencilFormat,_i as DirLight,Dh as DistanceMeasurementsControl,Ih as DistanceMeasurementsMouseControl,Sh as DistanceMeasurementsPlugin,Lh as DistanceMeasurementsSimulateMouseControl,Th as DistanceMeasurementsTouchControl,ji as EdgeMaterial,Vi as EmphasisMaterial,_s as FloatType,Qn as Fresnel,ut as Frustum,lt as FrustumPlane,Ar as GIFMediaType,Rh as GLTFDefaultDataSource,rE as GLTFLoaderPlugin,ys as HalfFloatType,td as ImagePlane,gs as IntType,cr as JPEGMediaType,Lc as KTX2TextureTranscoder,aD as LASLoaderPlugin,xn as LambertMaterial,ad as LightMap,mh as LineSet,lr as LinearEncoding,ls as LinearFilter,hs as LinearMipMapLinearFilter,As as LinearMipMapNearestFilter,cs as LinearMipmapLinearFilter,us as LinearMipmapNearestFilter,Ec as Loader,kc as LoadingManager,Uh as LocaleService,ks as LuminanceAlphaFormat,Ms as LuminanceFormat,$ as Map,Ve as Marker,nn as Mesh,Cn as MetallicMaterial,is as MirroredRepeatWrapping,cd as ModelMemento,lE as NavCubePlugin,ss as NearestFilter,as as NearestMipMapLinearFilter,rs as NearestMipMapNearestFilter,os as NearestMipmapLinearFilter,ns as NearestMipmapNearestFilter,Bn as Node,q as ObjectsKdTree3,dd as ObjectsMemento,hr as PNGMediaType,fd as Path,gd as PerformanceModel,Qi as PhongMaterial,me as Plugin,id as PointLight,j as PointerLens,vd as QuadraticBezierCurve,ee as Queue,Cs as RGBAFormat,Ls as RGBAIntegerFormat,rr as RGBA_ASTC_10x10_Format,tr as RGBA_ASTC_10x5_Format,ir as RGBA_ASTC_10x6_Format,sr as RGBA_ASTC_10x8_Format,nr as RGBA_ASTC_12x10_Format,or as RGBA_ASTC_12x12_Format,Ks as RGBA_ASTC_4x4_Format,Xs as RGBA_ASTC_5x4_Format,Ys as RGBA_ASTC_5x5_Format,Js as RGBA_ASTC_6x5_Format,Zs as RGBA_ASTC_6x6_Format,qs as RGBA_ASTC_8x5_Format,$s as RGBA_ASTC_8x6_Format,er as RGBA_ASTC_8x8_Format,ar as RGBA_BPTC_Format,Ws as RGBA_ETC2_EAC_Format,js as RGBA_PVRTC_2BPPV1_Format,Hs as RGBA_PVRTC_4BPPV1_Format,Us as RGBA_S3TC_DXT1_Format,Os as RGBA_S3TC_DXT3_Format,Qs as RGBA_S3TC_DXT5_Format,Ps as RGBFormat,Gs as RGB_ETC1_Format,zs as RGB_ETC2_Format,Vs as RGB_PVRTC_2BPPV1_Format,Ns as RGB_PVRTC_4BPPV1_Format,Rs as RGB_S3TC_DXT1_Format,Ss as RGFormat,Ts as RGIntegerFormat,Ti as ReadableGeometry,Ds as RedFormat,Is as RedIntegerFormat,od as ReflectionMap,Kt as Renderer,es as RepeatWrapping,$i as Scene,vh as SceneModel,so as SceneModelMesh,th as SceneModelTransform,md as SectionBox,hn as SectionPlane,ME as SectionPlanesPlugin,fs as ShortType,_d as Skybox,SE as SkyboxesPlugin,Fn as SpecularMaterial,Vh as SplineCurve,ld as SpriteMarker,IE as StoreyViewsPlugin,On as Texture,yd as TextureTranscoder,LE as TreeViewPlugin,ds as UnsignedByteType,xs as UnsignedInt248Type,ms as UnsignedIntType,bs as UnsignedShort4444Type,Bs as UnsignedShort5551Type,vs as UnsignedShortType,Hn as VBOGeometry,QE as ViewCullPlugin,Lb as Viewer,qE as WebIFCLoaderPlugin,Sc as WorkerPool,NE as XTCDefaultDataSource,JE as XTCLoaderPlugin,Li as buildBoxGeometry,Wn as buildBoxLinesGeometry,an as buildCylinderGeometry,Kn as buildGridGeometry,qn as buildLineGeometry,Xn as buildPlaneGeometry,Jn as buildPolylineGeometry,Zn as buildPolylineGeometryFromCurve,ln as buildSphereGeometry,Yn as buildTorusGeometry,An as buildVectorTextGeometry,Be as createRTCViewMat,ct as frustumIntersectsAABB3,Uc as getKTX2TextureTranscoder,Ce as getPlaneRTCPos,Gn as load3DSGeometry,zn as loadOBJGeometry,J as math,Pe as rtcToWorldPos,ur as sRGBEncoding,At as setFrustum,te as stats,oe as utils,xe as worldToRTCPos,we as worldToRTCPositions};
|