@realsee/five 6.3.0-alpha.5 → 6.3.0-alpha.6

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.
Files changed (50) hide show
  1. package/docs/assets/navigation.js +1 -1
  2. package/docs/assets/search.js +1 -1
  3. package/docs/classes/five.Model.html +2 -2
  4. package/docs/classes/five.Tile3DModel.html +2 -2
  5. package/docs/classes/plugins-1.BasePlugin.Controller.html +1 -1
  6. package/docs/classes/plugins-1.CSS3DRenderer.html +6 -0
  7. package/docs/classes/plugins-1.OrbitControls.html +41 -0
  8. package/docs/classes/plugins-1.OrientationPluginController.html +1 -1
  9. package/docs/classes/plugins-1.TrajectoryController.html +51 -0
  10. package/docs/functions/plugins-1.TrajectoryPlugin.html +1 -0
  11. package/docs/hierarchy.html +1 -1
  12. package/docs/interfaces/five.FiveLoadOptions.html +2 -2
  13. package/docs/interfaces/plugins-1.BasePlugin.State.html +1 -1
  14. package/docs/interfaces/plugins-1.Keyframe.html +3 -0
  15. package/docs/interfaces/plugins-1.PlayingState.html +3 -0
  16. package/docs/interfaces/plugins-1.PluginTemplateType.Config.html +3 -0
  17. package/docs/interfaces/plugins-1.PluginTemplateType.EventMap.html +10 -0
  18. package/docs/interfaces/plugins-1.PluginTemplateType.Params.html +4 -0
  19. package/docs/interfaces/plugins-1.PluginTemplateType.State.html +8 -0
  20. package/docs/modules/plugins-1.PluginTemplateType.html +7 -0
  21. package/docs/modules/plugins-1.html +7 -0
  22. package/docs/types/plugins-1.PluginTemplateType.PluginData.html +1 -0
  23. package/docs/types/plugins-1.PluginTemplateType.ServerData.html +1 -0
  24. package/five/index.d.ts +3 -3
  25. package/five/index.js +5 -5
  26. package/five/index.mjs +22 -10
  27. package/gltf-loader/index.js +3 -3
  28. package/gltf-loader/index.mjs +3 -3
  29. package/line/index.js +3 -3
  30. package/line/index.mjs +3 -3
  31. package/package.json +1 -1
  32. package/plugins/index.d.ts +112 -8
  33. package/plugins/index.js +12 -12
  34. package/plugins/index.mjs +1229 -1064
  35. package/react/index.js +2 -2
  36. package/react/index.mjs +2 -2
  37. package/sticker/index.js +3 -3
  38. package/sticker/index.mjs +3 -3
  39. package/umd/five-gltf-loader.js +3 -3
  40. package/umd/five-line.js +3 -3
  41. package/umd/five-plugins.js +13 -13
  42. package/umd/five-react.js +2 -2
  43. package/umd/five-sticker.js +3 -3
  44. package/umd/five-vfx.js +2 -2
  45. package/umd/five-vue.js +2 -2
  46. package/umd/five.js +25 -25
  47. package/vfx/index.js +2 -2
  48. package/vfx/index.mjs +2 -2
  49. package/vue/index.js +2 -2
  50. package/vue/index.mjs +2 -2
package/five/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 11/12/2024
5
- * Version: 6.3.0-alpha.5
4
+ * Generated: 2024/11/14
5
+ * Version: 6.3.0-alpha.6
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1024,7 +1024,7 @@ void main() {
1024
1024
  #include <fog_fragment>
1025
1025
  #include <premultiplied_alpha_fragment>
1026
1026
  }
1027
- `,uniforms:{diffuse:{value:new d.Color},size:{value:1}}},mh=function(n){se(t,n);function t(e,r,i,a){var o=new Float32Array([e.x,e.y,e.z,r.x,r.y,r.z]),s=new Float32Array([0,1]),l=new d.BufferGeometry;l.setAttribute("position",new d.BufferAttribute(o,3)),l.setAttribute("start",new d.BufferAttribute(s,1));var u=new d.ShaderMaterial({vertexShader:ma.vertexShader,fragmentShader:ma.fragmentShader,uniforms:d.UniformsUtils.clone(ma.uniforms)});return u.uniforms.size.value=i,u.uniforms.diffuse.value.copy(a),n.call(this,l,u)||this}return t}(d.Points);function gh(n,t){var e=n.name,r=po(n.content.uri,t.search),i=pt(r,{key:"model.0"}),a=n.content.color;return n.content.loadState="LOADING",go(i,{type:"geometry",fetcher:t.fetcher}).then(function(o){var s=o.scene,l=new d.ShaderMaterial({vertexShader:Aa.vertexShader,fragmentShader:Aa.fragmentShader,uniforms:d.UniformsUtils.clone(Aa.uniforms)});l.uniforms.diffuse.value.set(a),l.uniforms.totalSize.value=.2,l.uniforms.dashSize.value=l.uniforms.totalSize.value/2;var u=new d.Line(s,l);u.computeLineDistances(),u.applyMatrix4(n.transform),u.updateWorldMatrix(!1,!0),u.matrixAutoUpdate=!1;var c=s.attributes.position.array,f=new mh(new d.Vector3().fromArray(c,0),new d.Vector3().fromArray(c,c.length-3),12,a);f.applyMatrix4(n.transform),f.updateWorldMatrix(!1,!0),f.matrixAutoUpdate=!1;var v=new Bu(e,u,f);return n.content.data={byteLength:o.byteLength,object:v,uri:i},n.content.byteLength=o.byteLength,n.content.loadState="READY",n}).catch(function(o){return n.content.data=void 0,n.content.loadState="FAILED",n.content.byteLength=0,Promise.reject(o)})}function S0(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.byteLength=0)}function Ln(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=Ln(n[a],!1)+",";return i>-1&&(r+=Ln(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return Ln(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var l=o[a],u=Ln(n[l],!0);u!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(l)+":"+u),a++}return"{"+r+"}"}switch(e){case"function":return JSON.stringify(n.toString());case"undefined":return t?void 0:null;case"number":return n;default:return isFinite(n)?n:null}}function yo(n){return"hash::".concat(Ln(n,!1))}var M0=new d.Vector3,yh=new d.Matrix3,bh=new d.Matrix4,ut=6378137,Ru=298.257223563;function Fu(n){for(var t=ut-ut/Ru,e=(ut*ut-t*t)/(ut*ut),r=Math.sqrt(n.x*n.x+n.y*n.y),i=1e-12,a=1e3,o=0,s=Math.atan2(n.z,r),l=0;o++<a;){var u=Math.sin(s),c=ut/Math.sqrt(1-e*u*u);l=r/Math.cos(s)-c;var f=Math.atan2(n.z/(c*(1-e)+l),r/(c+l));if(isNaN(f))break;var v=Math.abs(f-s);if(v<i)break;s=f}return n.set(s,Math.atan2(n.y,n.x),l)}function xh(n){var t=n.x,e=n.y,r=n.z,i=ut-ut/Ru,a=(ut*ut-i*i)/(ut*ut),o=Math.sin(t),s=Math.cos(t),l=Math.sin(e),u=Math.cos(e),c=ut/Math.sqrt(1-a*o*o),f=(c+r)*s*u,v=(c+r)*s*l,m=(i*i/(ut*ut)*c+r)*o;return n.set(f,v,m)}function wh(n,t){var e=Fu(M0.copy(n)),r=e.x,i=e.y,a=e.z,o=Math.sin(r),s=Math.sin(i),l=Math.cos(r),u=Math.cos(i);t.fromArray([-s,-o*u,l*u,0,+u,-o*s,l*s,0,0,l,o,0,0,0,0,1]);var c=yh.setFromMatrix4(t),f=M0.copy(n).applyMatrix3(c).multiplyScalar(-1);t.setPosition(f);var v=bh.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return t.premultiply(v),t}var Wt={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15},I0=function(){var n=new d.MeshBasicMaterial;return n.side=d.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=Wt.TILE_MASK,n.stencilFunc=d.AlwaysStencilFunc,n.stencilFuncMask=Wt.TILE_MASK,n.stencilZPass=d.ReplaceStencilOp,n.stencilWriteMask=Wt.TILE_MASK,n}(),T0=function(){var n=new d.MeshBasicMaterial;return n.visible=!1,n}(),Eh=new d.BufferGeometry,Ch=new d.MeshBasicMaterial,nn=function(n){se(t,n);function t(e,r,i){var a,o,s,l=n.call(this)||this;return l.modelIndex=0,l.renderObjects=[],l.backfaceObjects=[],l.debugObjects=[],l.tileObjects=[],l.debug=!1,l.name=i.name,l.type=i.type,l.upAxis=i.upAxis,l.model=e,l.fetcher=i.fetcher,l.search=(a=i.search)!==null&&a!==void 0?a:"",l.groundHeight=i.groundHeight,l.coordinateTransform=i.coordinateTransform,l.boundingBox=new d.Box3,l.idle=!1,l.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,l.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,l.needsRefined=!0,l.refined=!1,l.refineProgress=[0,0],l.loaded=!1,l.disposed=!1,l.needsRender=!0,l.lastRenderHash="",l.matrixAutoUpdate=!1,l.cacheCameras=[],l.clearStencilObject=new d.Mesh(Eh,Ch),l.clearStencilObject.frustumCulled=!1,l.clearStencilObject.onAfterRender=function(u){return u.clearStencil()},l.tileset=new br((s=(o=l.model.work)===null||o===void 0?void 0:o.workCode)!==null&&s!==void 0?s:"",r,{referer:i.referer,tileLoader:function(u){return l.loadContent(u)},tileUnloader:function(u){return l.unloadContent(u)},onTileLoad:function(){},onTileUnload:function(u){},onTileError:function(u,c){i.onError&&i.onError(Object.assign(c,{error:c})),console.error("Tile error",u.id,c)},trajectoryLoader:function(u){return l.loadTrajectory(u)},trajectoryUnloader:function(u){return l.unloadTrajectory(u)},onTrajectoryLoad:function(){},onTrajectoryUnload:function(u){},onTrajectoryError:function(u,c){i.onError&&i.onError(Object.assign(c,{error:c})),console.error("Trajectory error",u,c)}}),l.tileset.root.boundingVolume&&l.tileset.root.boundingVolume.getBoundingBox(l.boundingBox),l}return t.prototype.getRenderHash=function(){return yo([this.tileset.id,this.tileset.skipLevelOfDetail,this.tileset.selectedTiles.map(function(e){return e.id}),this.tileset.trajectories.map(function(e){return e.index}),this.debug])},Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){return this.tileset.maxMemoryUsage},set:function(e){this.tileset.maxMemoryUsage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){return this.tileset.maxRequests},set:function(e){this.tileset.maxRequests=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"requestOrder",{get:function(){return this.tileset.tileRequestOrder},set:function(e){this.tileset.tileRequestOrder=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipLevelOfDetail",{get:function(){return this.tileset.skipLevelOfDetail},set:function(e){this.tileset.skipLevelOfDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mostDetail",{get:function(){return this.tileset.mostDetail},set:function(e){this.tileset.mostDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadSiblings",{get:function(){return this.tileset.loadSiblings},set:function(e){this.tileset.loadSiblings=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadAll",{get:function(){return this.tileset.loadAll},set:function(e){this.tileset.loadAll=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){return this.tileset.maxScreenSpaceError},set:function(e){this.tileset.maxScreenSpaceError=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trajectories",{get:function(){return this.tileset.trajectories},enumerable:!1,configurable:!0}),t.prototype.localToEnu=function(e){return e.applyMatrix4(this.coordinateTransform.localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.enuToLocalMatrix)},t.prototype.localToEcef=function(e){return e.applyMatrix4(this.coordinateTransform.localToEcefMatrix)},t.prototype.ecefToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.ecefToLocalMatrix)},t.prototype.localToLla=function(e){return Fu(this.localToEcef(e))},t.prototype.llaToLocal=function(e){return this.ecefToLocal(xh(e))},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},t.prototype.worldToEcef=function(e){return this.localToEcef(this.worldToLocal(e))},t.prototype.ecefToWorld=function(e){return this.localToWorld(this.ecefToLocal(e))},t.prototype.worldToLla=function(e){return this.localToLla(this.worldToLocal(e))},t.prototype.llaToWorld=function(e){return this.localToWorld(this.llaToLocal(e))},t.prototype.loadContent=function(e){var r=this;return Ah(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){e.type==="SCENEGRAPH"&&(r.disposed||!e.content?Ga(e):e.content.data&&r.boundingBox.expandByObject(e.content.data.object))})},t.prototype.unloadContent=function(e){return Ga(e),Promise.resolve()},t.prototype.loadAllTilesets=function(){var e=this,r=function(i){var a=[];return e.tileset.root.traverse(function(o){var s;o.type==="TILESET"&&((s=o.content)===null||s===void 0?void 0:s.loadState)!=="READY"&&a.push(o)}),Promise.all(a.map(function(o){return e.loadContent(o).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.loadTrajectory=function(e){var r=this;return gh(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){r.disposed&&S0(i)})},t.prototype.unloadTrajectory=function(e){return S0(e),Promise.resolve()},t.prototype.intersectRaycaster=function(e,r,i){var a=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var o=[this.tileset.root],s=this.tileset.transform,l=this.tileset.transformIsIdentity,u,c=[];u=o.pop();){var f=void 0;if(u.boundingVolume){var v=l?u.boundingVolume:u.boundingVolume.clone().applyMatrix4(s);f=v.intersectRay(e.ray,e.far)}else f=!0;if(f){for(var m=0,h=u.children.length;m<h;m++)o.push(u.children[m]);u.selected&&u.content&&u.content.data&&u.content.data.object.visible&&u.content.data.object.intersectRaycaster(e,!1,c)}}return this.model.shownFloorIndex>=0&&(c=c.filter(function(p){return p.floor===a.model.shownFloorIndex})),r&&c.sort(function(p,g){return p.distance-g.distance}),c.map(function(p){p.model=a.model,p.viewLayer=a.viewLayer}),i.push.apply(i,c),i},t.prototype.cloneSkipBackfaceObject=function(e){var r;e instanceof d.Mesh?r=new d.Mesh(e.geometry,Array.isArray(e.material)?e.material.map(function(s){return s.transparent?T0:I0}):e.material&&e.material.transparent?T0:I0):e instanceof d.Group?r=new d.Group:r=new d.Object3D,r.copy(e,!1);for(var i=0,a=e.children;i<a.length;i++){var o=a[i];r.add(this.cloneSkipBackfaceObject(o))}return r},t.prototype.update=function(e,r){var i,a,o,s=this,l,u,c;this.renderObjects.length=0,this.backfaceObjects.length=0,this.debugObjects.length=0,this.tileObjects.length=0,this.renderer=e,this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld),this.tileset.cache.reset();var f=this.tileset.frameNumber+1,v=this.visible,m=Math.max(this.maxLevelOfDetail,0),h=Math.min(this.minLevelOfDetail,m),p=Math.max(h,0),g={time:Ce(),camera:{type:r.type,position:new d.Vector3().copy(r.position),direction:r.getDirection(new d.Vector3),near:r.near,far:r.far,up:new d.Vector3().copy(r.up).applyQuaternion(r.quaternion),visible:r.visible,refine:r.refineModel},minLevelOfDetail:h,maxLevelOfDetail:v&&!this.idle&&this.loaded?m:p,height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:f,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new qn().setFromCamera(r)},A=this.cacheCameras.map(function(ee){return F(F({},g),{camera:{type:r.type,position:new d.Vector3().copy(ee.position),direction:ee.getWorldDirection(new d.Vector3),near:r.near,far:r.far,up:new d.Vector3().copy(ee.up),visible:ee.visible,refine:!0},cullingVolume:new qn().setFromCamera(ee)})});this.tileset.update(g,A),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(ee){if(s.refineProgress[1]++,ee.content){var Y=ee.content.loadState;if(Y==="UNLOADED"||Y==="LOADING"){s.refined=!1;return}}s.refineProgress[0]++}),this.loaded===!1&&this.tileset.needsRefinedTiles.size>0&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(ee){if(s.loaded!==!1){if(s.tileset.skipLevelOfDetail){if(ee.state.finalResolution&&ee.content){var Y=ee.state.ancestorWithContentAvailable,ne=Y&&Y.content?Y.content:ee.content,te=ne.loadState;(te==="UNLOADED"||te==="LOADING")&&(s.loaded=!1)}}else if(ee.state.visible&&ee.content&&ee.levelOfContent<=0){var te=ee.content.loadState;(te==="UNLOADED"||te==="LOADING")&&(s.loaded=!1)}}}),this.loaded===!0&&(this.refined=!1,this.refineProgress[1]++)),this.remove.apply(this,this.children),this.tileset.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(ee,Y){return ee.floor-Y.floor});for(var y=0,x=this.tileset.selectedTiles;y<x.length;y++){var b=x[y];this.debug&&b.boundingVolumeDebugObject&&this.debugObjects.push(b.boundingVolumeDebugObject);var w=(u=(l=b.content)===null||l===void 0?void 0:l.data)===null||u===void 0?void 0:u.object;if(w){if(w.update(e,r,this.model),this.tileset.hasMixedContent&&this.tileset.skipLevelOfDetail){if(!b.state.finalResolution){var E=this.cloneSkipBackfaceObject(w);this.backfaceObjects.push(E)}for(var S=b.state.selectionDepth,M=Wt.TILE_MASK|S<<Wt.SKIP_LOD_BIT_SHIFT,R=d.GreaterEqualStencilFunc,O=Wt.SKIP_LOD_MASK,C=d.ReplaceStencilOp,P=Wt.TILE_MASK|Wt.SKIP_LOD_MASK,z=0,T=w.materials;z<T.length;z++){var k=T[z];k.stencilWrite=!0,k.stencilRef=M,k.stencilFunc=R,k.stencilFuncMask=O,k.stencilZPass=C,k.stencilWriteMask=P}}else for(var L=0,V=w.materials;L<V.length;L++){var k=V[L];k.stencilWrite=!1,k.stencilRef=Wt.TILE_MASK,k.stencilFunc=d.AlwaysStencilFunc,k.stencilFuncMask=Wt.TILE_MASK,k.stencilZPass=d.ReplaceStencilOp,k.stencilWriteMask=Wt.TILE_MASK}this.tileObjects.push(w)}}this.tileset.skipLevelOfDetail&&this.backfaceObjects.length&&(i=this.renderObjects).push.apply(i,this.backfaceObjects),this.tileObjects.length&&(a=this.renderObjects).push.apply(a,this.tileObjects),this.tileset.skipLevelOfDetail&&this.renderObjects.push(this.clearStencilObject);for(var U=0,q=this.tileset.selectedTrajectories;U<q.length;U++){var N=q[U],H=(c=N.content.data)===null||c===void 0?void 0:c.object;H&&(H.update(e,r,this.model),this.renderObjects.push(H))}this.debug&&(o=this.renderObjects).push.apply(o,this.debugObjects);for(var J=this.modelIndex*1e4,j=function(ee){var Y=_.renderObjects[ee],ne=ee+J;Y.traverse(function(te){(te instanceof d.Mesh||te instanceof d.Line||te instanceof d.Points)&&(te.renderOrder=ne)}),_.add(Y)},_=this,Z=0;Z<this.renderObjects.length;Z++)j(Z);var W=this.getRenderHash();this.lastRenderHash!==W&&(this.needsRender=!0,this.lastRenderHash=W)},t.prototype.dispose=function(){this.disposed=!0,this.viewLayer=void 0,this.tileset.reset(),this.remove.apply(this,this.children),this.refineProgress[0]=0,this.refineProgress[1]=0,this.refined=!1,this.loaded=!1},t.DEFAULT_MIN_LEVEL_OF_DETAIL=0,t.DEFAULT_MAX_LEVEL_OF_DETAIL=20,t.DEFAULT_MAX_MEMORY_USAGE=16,t.DEFAULT_MAX_SCREEN_SPACE_ERROR=br.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_SKIP_LEVEL_OF_DETAIL=br.DEFAULT_SKIP_LEVEL_OF_DETAIL,t.DEFAULT_MOST_DETAIL=br.DEFAULT_MOST_DETAIL,t.DEFAULT_LOAD_SIBLINGS=br.DEFAULT_LOAD_SIBLINGS,t.DEFAULT_LOAD_ALL=br.DEFAULT_LOAD_ALL,t.DEFAULT_MAX_REQUESTS=br.DEFAULT_MAX_REQUESTS,t.DEFAULT_REQUEST_ORDER=br.DEFAULT_REQUEST_ORDER,t}(d.Object3D);function Sh(n){return-((n-.25)*360+90)/180*Math.PI}function Ka(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var e,r,i;if(Array.isArray(n)){if(e=n.length,e!=t.length)return!1;for(r=e;r--!==0;)if(!Ka(n[r],t[r]))return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===t.toString();if(i=Object.keys(n),e=i.length,e!==Object.keys(t).length)return!1;for(r=e;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=e;r--!==0;){var a=i[r];if(!Ka(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function Xt(n){return typeof n=="number"}var P0=function(){return new Error("Invalid input.")},B0=function(){return new Error("Invalid certificate.")},R0=function(){return new Error("Invalid signature.")},Mh=function(n){return new Error("date(".concat(n.toString(),") expired."))},Ih=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function Th(n,t){for(var e={},r=0,i=Object.keys(n);r<i.length;r++){var a=i[r];t.indexOf(a)===-1&&(e[a]=n[a])}return e}function On(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=On(n[a],!1)+",";return i>-1&&(r+=On(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return On(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var l=o[a],u=On(n[l],!0);u!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(l)+":"+u),a++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function Ph(n){return String(On(n,!1))}function ku(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return P0();for(var s=function(w){var E=ku(n[w]);if(E instanceof Error)return{value:E};if(!i)i=E.issuer;else if(i!==E.issuer)return{value:B0()};a?E.expire.getTime()<a.getTime()&&(a=E.expire):a=E.expire,o?o=o.filter(function(S){return E.allowHosts.indexOf(S)!==-1}):o=E.allowHosts},l=0;l<n.length;l++){var u=s(l);if(typeof u=="object")return u.value}return xn({issuer:i,expire:a,allowHosts:o})}var c=JSON.parse(n),f=typeof location!="undefined"?location.hostname:"",v=Date.now();if(typeof c!="object")return P0();var m=new Date(typeof c.expire_at=="string"&&/^\d+$/.test(c.expire_at)?Number(c.expire_at):c.expire_at),h=Array.isArray(c.allow_hosts)?c.allow_hosts:[];if(f.length===0||ln(f)||cr.filter(function(w){return Kr(w,f)}).length>0){var p=String((t=c.certificate)!==null&&t!==void 0?t:"");if(p){var g=new Ue;return g.readCertPEM(p),xn({issuer:g.getSubjectString(),expire:m,allowHosts:h})}return xn({issuer:"none",expire:m,allowHosts:h})}var A=String((e=c.certificate)!==null&&e!==void 0?e:"");if(!A)return B0();var y=new Ue;y.readCertPEM(A);var x=String((r=c._signature)!==null&&r!==void 0?r:"");if(!x)return R0();var b=Ph(Th(c,["_signature"]));return Ec(b,x,y)===!1?R0():v<m.getTime()?h.filter(function(w){return Kr(w,f)}).length===0?Ih(f):xn({issuer:y.getSubjectString(),expire:m,allowHosts:h}):Mh(m)}var F0=new d.Matrix4,bo=new WeakMap,xo=function(){function n(t,e){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={work:this},this.observers=[],this.issuer="none",this.raw={works:[""],options:""},this.transform=new d.Matrix4;{var r=this;this.options={get transform(){return r.transform},set transform(a){r.transform.copy(a)}}}var i=Rh(t,e,this);if(i instanceof Error)throw new Error("[PARSE FAILED]: "+i.message+`
1027
+ `,uniforms:{diffuse:{value:new d.Color},size:{value:1}}},mh=function(n){se(t,n);function t(e,r,i,a){var o=new Float32Array([e.x,e.y,e.z,r.x,r.y,r.z]),s=new Float32Array([0,1]),l=new d.BufferGeometry;l.setAttribute("position",new d.BufferAttribute(o,3)),l.setAttribute("start",new d.BufferAttribute(s,1));var u=new d.ShaderMaterial({vertexShader:ma.vertexShader,fragmentShader:ma.fragmentShader,uniforms:d.UniformsUtils.clone(ma.uniforms)});return u.uniforms.size.value=i,u.uniforms.diffuse.value.copy(a),n.call(this,l,u)||this}return t}(d.Points);function gh(n,t){var e=n.name,r=po(n.content.uri,t.search),i=pt(r,{key:"model.0"}),a=n.content.color;return n.content.loadState="LOADING",go(i,{type:"geometry",fetcher:t.fetcher}).then(function(o){var s=o.scene,l=new d.ShaderMaterial({vertexShader:Aa.vertexShader,fragmentShader:Aa.fragmentShader,uniforms:d.UniformsUtils.clone(Aa.uniforms)});l.uniforms.diffuse.value.set(a),l.uniforms.totalSize.value=.2,l.uniforms.dashSize.value=l.uniforms.totalSize.value/2;var u=new d.Line(s,l);u.computeLineDistances(),u.applyMatrix4(n.transform),u.updateWorldMatrix(!1,!0),u.matrixAutoUpdate=!1;var c=s.attributes.position.array,f=new mh(new d.Vector3().fromArray(c,0),new d.Vector3().fromArray(c,c.length-3),12,a);f.applyMatrix4(n.transform),f.updateWorldMatrix(!1,!0),f.matrixAutoUpdate=!1;var v=new Bu(e,u,f);return n.content.data={byteLength:o.byteLength,object:v,uri:i},n.content.byteLength=o.byteLength,n.content.loadState="READY",n}).catch(function(o){return n.content.data=void 0,n.content.loadState="FAILED",n.content.byteLength=0,Promise.reject(o)})}function S0(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.byteLength=0)}function Ln(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=Ln(n[a],!1)+",";return i>-1&&(r+=Ln(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return Ln(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var l=o[a],u=Ln(n[l],!0);u!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(l)+":"+u),a++}return"{"+r+"}"}switch(e){case"function":return JSON.stringify(n.toString());case"undefined":return t?void 0:null;case"number":return n;default:return isFinite(n)?n:null}}function yo(n){return"hash::".concat(Ln(n,!1))}var M0=new d.Vector3,yh=new d.Matrix3,bh=new d.Matrix4,ut=6378137,Ru=298.257223563;function Fu(n){for(var t=ut-ut/Ru,e=(ut*ut-t*t)/(ut*ut),r=Math.sqrt(n.x*n.x+n.y*n.y),i=1e-12,a=1e3,o=0,s=Math.atan2(n.z,r),l=0;o++<a;){var u=Math.sin(s),c=ut/Math.sqrt(1-e*u*u);l=r/Math.cos(s)-c;var f=Math.atan2(n.z/(c*(1-e)+l),r/(c+l));if(isNaN(f))break;var v=Math.abs(f-s);if(v<i)break;s=f}return n.set(s,Math.atan2(n.y,n.x),l)}function xh(n){var t=n.x,e=n.y,r=n.z,i=ut-ut/Ru,a=(ut*ut-i*i)/(ut*ut),o=Math.sin(t),s=Math.cos(t),l=Math.sin(e),u=Math.cos(e),c=ut/Math.sqrt(1-a*o*o),f=(c+r)*s*u,v=(c+r)*s*l,m=(i*i/(ut*ut)*c+r)*o;return n.set(f,v,m)}function wh(n,t){var e=Fu(M0.copy(n)),r=e.x,i=e.y,a=e.z,o=Math.sin(r),s=Math.sin(i),l=Math.cos(r),u=Math.cos(i);t.fromArray([-s,-o*u,l*u,0,+u,-o*s,l*s,0,0,l,o,0,0,0,0,1]);var c=yh.setFromMatrix4(t),f=M0.copy(n).applyMatrix3(c).multiplyScalar(-1);t.setPosition(f);var v=bh.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,a,1]);return t.premultiply(v),t}var Wt={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15},I0=function(){var n=new d.MeshBasicMaterial;return n.side=d.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=Wt.TILE_MASK,n.stencilFunc=d.AlwaysStencilFunc,n.stencilFuncMask=Wt.TILE_MASK,n.stencilZPass=d.ReplaceStencilOp,n.stencilWriteMask=Wt.TILE_MASK,n}(),T0=function(){var n=new d.MeshBasicMaterial;return n.visible=!1,n}(),Eh=new d.BufferGeometry,Ch=new d.MeshBasicMaterial,nn=function(n){se(t,n);function t(e,r,i){var a,o,s,l=n.call(this)||this;return l.modelIndex=0,l.renderObjects=[],l.backfaceObjects=[],l.debugObjects=[],l.tileObjects=[],l.debug="none",l.name=i.name,l.type=i.type,l.upAxis=i.upAxis,l.model=e,l.fetcher=i.fetcher,l.search=(a=i.search)!==null&&a!==void 0?a:"",l.groundHeight=i.groundHeight,l.coordinateTransform=i.coordinateTransform,l.boundingBox=new d.Box3,l.idle=!1,l.minLevelOfDetail=t.DEFAULT_MIN_LEVEL_OF_DETAIL,l.maxLevelOfDetail=t.DEFAULT_MAX_LEVEL_OF_DETAIL,l.needsRefined=!0,l.refined=!1,l.refineProgress=[0,0],l.loaded=!1,l.disposed=!1,l.needsRender=!0,l.lastRenderHash="",l.matrixAutoUpdate=!1,l.cacheCameras=[],l.clearStencilObject=new d.Mesh(Eh,Ch),l.clearStencilObject.frustumCulled=!1,l.clearStencilObject.onAfterRender=function(u){return u.clearStencil()},l.tileset=new br((s=(o=l.model.work)===null||o===void 0?void 0:o.workCode)!==null&&s!==void 0?s:"",r,{referer:i.referer,tileLoader:function(u){return l.loadContent(u)},tileUnloader:function(u){return l.unloadContent(u)},onTileLoad:function(){},onTileUnload:function(u){},onTileError:function(u,c){i.onError&&i.onError(Object.assign(c,{error:c})),console.error("Tile error",u.id,c)},trajectoryLoader:function(u){return l.loadTrajectory(u)},trajectoryUnloader:function(u){return l.unloadTrajectory(u)},onTrajectoryLoad:function(){},onTrajectoryUnload:function(u){},onTrajectoryError:function(u,c){i.onError&&i.onError(Object.assign(c,{error:c})),console.error("Trajectory error",u,c)}}),l.tileset.root.boundingVolume&&l.tileset.root.boundingVolume.getBoundingBox(l.boundingBox),l}return t.prototype.getRenderHash=function(){return yo([this.tileset.id,this.tileset.skipLevelOfDetail,this.tileset.selectedTiles.map(function(e){return e.id}),this.tileset.trajectories.map(function(e){return e.index}),this.debug])},Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){return this.tileset.maxMemoryUsage},set:function(e){this.tileset.maxMemoryUsage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){return this.tileset.maxRequests},set:function(e){this.tileset.maxRequests=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"requestOrder",{get:function(){return this.tileset.tileRequestOrder},set:function(e){this.tileset.tileRequestOrder=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipLevelOfDetail",{get:function(){return this.tileset.skipLevelOfDetail},set:function(e){this.tileset.skipLevelOfDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mostDetail",{get:function(){return this.tileset.mostDetail},set:function(e){this.tileset.mostDetail=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadSiblings",{get:function(){return this.tileset.loadSiblings},set:function(e){this.tileset.loadSiblings=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadAll",{get:function(){return this.tileset.loadAll},set:function(e){this.tileset.loadAll=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){return this.tileset.maxScreenSpaceError},set:function(e){this.tileset.maxScreenSpaceError=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trajectories",{get:function(){return this.tileset.trajectories},enumerable:!1,configurable:!0}),t.prototype.localToEnu=function(e){return e.applyMatrix4(this.coordinateTransform.localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.enuToLocalMatrix)},t.prototype.localToEcef=function(e){return e.applyMatrix4(this.coordinateTransform.localToEcefMatrix)},t.prototype.ecefToLocal=function(e){return e.applyMatrix4(this.coordinateTransform.ecefToLocalMatrix)},t.prototype.localToLla=function(e){return Fu(this.localToEcef(e))},t.prototype.llaToLocal=function(e){return this.ecefToLocal(xh(e))},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},t.prototype.worldToEcef=function(e){return this.localToEcef(this.worldToLocal(e))},t.prototype.ecefToWorld=function(e){return this.localToWorld(this.ecefToLocal(e))},t.prototype.worldToLla=function(e){return this.localToLla(this.worldToLocal(e))},t.prototype.llaToWorld=function(e){return this.localToWorld(this.llaToLocal(e))},t.prototype.loadContent=function(e){var r=this;return Ah(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){e.type==="SCENEGRAPH"&&(r.disposed||!e.content?Ga(e):e.content.data&&r.boundingBox.expandByObject(e.content.data.object))})},t.prototype.unloadContent=function(e){return Ga(e),Promise.resolve()},t.prototype.loadAllTilesets=function(){var e=this,r=function(i){var a=[];return e.tileset.root.traverse(function(o){var s;o.type==="TILESET"&&((s=o.content)===null||s===void 0?void 0:s.loadState)!=="READY"&&a.push(o)}),Promise.all(a.map(function(o){return e.loadContent(o).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.loadTrajectory=function(e){var r=this;return gh(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(i){r.disposed&&S0(i)})},t.prototype.unloadTrajectory=function(e){return S0(e),Promise.resolve()},t.prototype.intersectRaycaster=function(e,r,i){var a=this;r===void 0&&(r=!0),i===void 0&&(i=[]);for(var o=[this.tileset.root],s=this.tileset.transform,l=this.tileset.transformIsIdentity,u,c=[];u=o.pop();){var f=void 0;if(u.boundingVolume){var v=l?u.boundingVolume:u.boundingVolume.clone().applyMatrix4(s);f=v.intersectRay(e.ray,e.far)}else f=!0;if(f){for(var m=0,h=u.children.length;m<h;m++)o.push(u.children[m]);u.selected&&u.content&&u.content.data&&u.content.data.object.visible&&u.content.data.object.intersectRaycaster(e,!1,c)}}return this.model.shownFloorIndex>=0&&(c=c.filter(function(p){return p.floor===a.model.shownFloorIndex})),r&&c.sort(function(p,g){return p.distance-g.distance}),c.map(function(p){p.model=a.model,p.viewLayer=a.viewLayer}),i.push.apply(i,c),i},t.prototype.cloneSkipBackfaceObject=function(e){var r;e instanceof d.Mesh?r=new d.Mesh(e.geometry,Array.isArray(e.material)?e.material.map(function(s){return s.transparent?T0:I0}):e.material&&e.material.transparent?T0:I0):e instanceof d.Group?r=new d.Group:r=new d.Object3D,r.copy(e,!1);for(var i=0,a=e.children;i<a.length;i++){var o=a[i];r.add(this.cloneSkipBackfaceObject(o))}return r},t.prototype.update=function(e,r){var i,a,o,s=this,l,u,c;this.renderObjects.length=0,this.backfaceObjects.length=0,this.debugObjects.length=0,this.tileObjects.length=0,this.renderer=e,this.tileset.transform.equals(this.matrixWorld)||this.tileset.transform.copy(this.matrixWorld),this.tileset.cache.reset();var f=this.tileset.frameNumber+1,v=this.visible,m=Math.max(this.maxLevelOfDetail,0),h=Math.min(this.minLevelOfDetail,m),p=Math.max(h,0),g={time:Ce(),camera:{type:r.type,position:new d.Vector3().copy(r.position),direction:r.getDirection(new d.Vector3),near:r.near,far:r.far,up:new d.Vector3().copy(r.up).applyQuaternion(r.quaternion),visible:r.visible,refine:r.refineModel},minLevelOfDetail:h,maxLevelOfDetail:v&&!this.idle&&this.loaded?m:p,height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:f,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new qn().setFromCamera(r)},A=this.cacheCameras.map(function(ee){return F(F({},g),{camera:{type:r.type,position:new d.Vector3().copy(ee.position),direction:ee.getWorldDirection(new d.Vector3),near:r.near,far:r.far,up:new d.Vector3().copy(ee.up),visible:ee.visible,refine:!0},cullingVolume:new qn().setFromCamera(ee)})});this.tileset.update(g,A),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(ee){if(s.refineProgress[1]++,ee.content){var Y=ee.content.loadState;if(Y==="UNLOADED"||Y==="LOADING"){s.refined=!1;return}}s.refineProgress[0]++}),this.loaded===!1&&this.tileset.needsRefinedTiles.size>0&&(this.loaded=!0,this.tileset.needsRefinedTiles.forEach(function(ee){if(s.loaded!==!1){if(s.tileset.skipLevelOfDetail){if(ee.state.finalResolution&&ee.content){var Y=ee.state.ancestorWithContentAvailable,ne=Y&&Y.content?Y.content:ee.content,te=ne.loadState;(te==="UNLOADED"||te==="LOADING")&&(s.loaded=!1)}}else if(ee.state.visible&&ee.content&&ee.levelOfContent<=0){var te=ee.content.loadState;(te==="UNLOADED"||te==="LOADING")&&(s.loaded=!1)}}}),this.loaded===!0&&(this.refined=!1,this.refineProgress[1]++)),this.remove.apply(this,this.children),this.tileset.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(ee,Y){return ee.floor-Y.floor}),this.debug==="root-bounding-volume"&&this.tileset.root.boundingVolumeDebugObject&&this.debugObjects.push(this.tileset.root.boundingVolumeDebugObject);for(var y=0,x=this.tileset.selectedTiles;y<x.length;y++){var b=x[y];this.debug==="selected-bounding-volume"&&b.boundingVolumeDebugObject&&this.debugObjects.push(b.boundingVolumeDebugObject);var w=(u=(l=b.content)===null||l===void 0?void 0:l.data)===null||u===void 0?void 0:u.object;if(w){if(w.update(e,r,this.model),this.tileset.hasMixedContent&&this.tileset.skipLevelOfDetail){if(!b.state.finalResolution){var E=this.cloneSkipBackfaceObject(w);this.backfaceObjects.push(E)}for(var S=b.state.selectionDepth,M=Wt.TILE_MASK|S<<Wt.SKIP_LOD_BIT_SHIFT,R=d.GreaterEqualStencilFunc,O=Wt.SKIP_LOD_MASK,C=d.ReplaceStencilOp,P=Wt.TILE_MASK|Wt.SKIP_LOD_MASK,z=0,T=w.materials;z<T.length;z++){var k=T[z];k.stencilWrite=!0,k.stencilRef=M,k.stencilFunc=R,k.stencilFuncMask=O,k.stencilZPass=C,k.stencilWriteMask=P}}else for(var L=0,V=w.materials;L<V.length;L++){var k=V[L];k.stencilWrite=!1,k.stencilRef=Wt.TILE_MASK,k.stencilFunc=d.AlwaysStencilFunc,k.stencilFuncMask=Wt.TILE_MASK,k.stencilZPass=d.ReplaceStencilOp,k.stencilWriteMask=Wt.TILE_MASK}this.tileObjects.push(w)}}this.tileset.skipLevelOfDetail&&this.backfaceObjects.length&&(i=this.renderObjects).push.apply(i,this.backfaceObjects),this.tileObjects.length&&(a=this.renderObjects).push.apply(a,this.tileObjects),this.tileset.skipLevelOfDetail&&this.renderObjects.push(this.clearStencilObject);for(var U=0,q=this.tileset.selectedTrajectories;U<q.length;U++){var N=q[U],H=(c=N.content.data)===null||c===void 0?void 0:c.object;H&&(H.update(e,r,this.model),this.renderObjects.push(H))}this.debug&&(o=this.renderObjects).push.apply(o,this.debugObjects);for(var J=this.modelIndex*1e4,j=function(ee){var Y=_.renderObjects[ee],ne=ee+J;Y.traverse(function(te){(te instanceof d.Mesh||te instanceof d.Line||te instanceof d.Points)&&(te.renderOrder=ne)}),_.add(Y)},_=this,Z=0;Z<this.renderObjects.length;Z++)j(Z);var W=this.getRenderHash();this.lastRenderHash!==W&&(this.needsRender=!0,this.lastRenderHash=W)},t.prototype.dispose=function(){this.disposed=!0,this.viewLayer=void 0,this.tileset.reset(),this.remove.apply(this,this.children),this.refineProgress[0]=0,this.refineProgress[1]=0,this.refined=!1,this.loaded=!1},t.DEFAULT_MIN_LEVEL_OF_DETAIL=0,t.DEFAULT_MAX_LEVEL_OF_DETAIL=20,t.DEFAULT_MAX_MEMORY_USAGE=16,t.DEFAULT_MAX_SCREEN_SPACE_ERROR=br.DEFAULT_MAX_SCREEN_SPACE_ERROR,t.DEFAULT_SKIP_LEVEL_OF_DETAIL=br.DEFAULT_SKIP_LEVEL_OF_DETAIL,t.DEFAULT_MOST_DETAIL=br.DEFAULT_MOST_DETAIL,t.DEFAULT_LOAD_SIBLINGS=br.DEFAULT_LOAD_SIBLINGS,t.DEFAULT_LOAD_ALL=br.DEFAULT_LOAD_ALL,t.DEFAULT_MAX_REQUESTS=br.DEFAULT_MAX_REQUESTS,t.DEFAULT_REQUEST_ORDER=br.DEFAULT_REQUEST_ORDER,t}(d.Object3D);function Sh(n){return-((n-.25)*360+90)/180*Math.PI}function Ka(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var e,r,i;if(Array.isArray(n)){if(e=n.length,e!=t.length)return!1;for(r=e;r--!==0;)if(!Ka(n[r],t[r]))return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===t.toString();if(i=Object.keys(n),e=i.length,e!==Object.keys(t).length)return!1;for(r=e;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=e;r--!==0;){var a=i[r];if(!Ka(n[a],t[a]))return!1}return!0}return n!==n&&t!==t}function Xt(n){return typeof n=="number"}var P0=function(){return new Error("Invalid input.")},B0=function(){return new Error("Invalid certificate.")},R0=function(){return new Error("Invalid signature.")},Mh=function(n){return new Error("date(".concat(n.toString(),") expired."))},Ih=function(n){return new Error("host(".concat(JSON.stringify(n),") is not allowed."))};function Th(n,t){for(var e={},r=0,i=Object.keys(n);r<i.length;r++){var a=i[r];t.indexOf(a)===-1&&(e[a]=n[a])}return e}function On(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",i=n.length-1,a=0;a<i;a++)r+=On(n[a],!1)+",";return i>-1&&(r+=On(n[a],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return On(n.toJSON(),t);for(var o=Object.keys(n).sort(),s=o.length,r="",a=0;a<s;){var l=o[a],u=On(n[l],!0);u!==void 0&&(a&&r!==""&&(r+=","),r+=JSON.stringify(l)+":"+u),a++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function Ph(n){return String(On(n,!1))}function ku(n){var t,e,r;if(Array.isArray(n)){var i=void 0,a,o;if(n.length<=0)return P0();for(var s=function(w){var E=ku(n[w]);if(E instanceof Error)return{value:E};if(!i)i=E.issuer;else if(i!==E.issuer)return{value:B0()};a?E.expire.getTime()<a.getTime()&&(a=E.expire):a=E.expire,o?o=o.filter(function(S){return E.allowHosts.indexOf(S)!==-1}):o=E.allowHosts},l=0;l<n.length;l++){var u=s(l);if(typeof u=="object")return u.value}return xn({issuer:i,expire:a,allowHosts:o})}var c=JSON.parse(n),f=typeof location!="undefined"?location.hostname:"",v=Date.now();if(typeof c!="object")return P0();var m=new Date(typeof c.expire_at=="string"&&/^\d+$/.test(c.expire_at)?Number(c.expire_at):c.expire_at),h=Array.isArray(c.allow_hosts)?c.allow_hosts:[];if(f.length===0||ln(f)||cr.filter(function(w){return Kr(w,f)}).length>0){var p=String((t=c.certificate)!==null&&t!==void 0?t:"");if(p){var g=new Ue;return g.readCertPEM(p),xn({issuer:g.getSubjectString(),expire:m,allowHosts:h})}return xn({issuer:"none",expire:m,allowHosts:h})}var A=String((e=c.certificate)!==null&&e!==void 0?e:"");if(!A)return B0();var y=new Ue;y.readCertPEM(A);var x=String((r=c._signature)!==null&&r!==void 0?r:"");if(!x)return R0();var b=Ph(Th(c,["_signature"]));return Ec(b,x,y)===!1?R0():v<m.getTime()?h.filter(function(w){return Kr(w,f)}).length===0?Ih(f):xn({issuer:y.getSubjectString(),expire:m,allowHosts:h}):Mh(m)}var F0=new d.Matrix4,bo=new WeakMap,xo=function(){function n(t,e){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={work:this},this.observers=[],this.issuer="none",this.raw={works:[""],options:""},this.transform=new d.Matrix4;{var r=this;this.options={get transform(){return r.transform},set transform(a){r.transform.copy(a)}}}var i=Rh(t,e,this);if(i instanceof Error)throw new Error("[PARSE FAILED]: "+i.message+`
1028
1028
  Error work input:
1029
1029
  `+JSON.stringify(t))}return n.prototype.toJSON=function(){return this.raw},n.parse=Gn,n}();function k0(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function Ja(n,t){var e=k0(n),r=k0(t);if(r==="null")return n;if(r==="value")return t;if(r!==e)return JSON.parse(JSON.stringify(t));if(r==="array")for(var i=0;i<t.length;i++)n[i]=Ja(n[i],t[i]);else if(r==="dict")for(var a in t)n[a]=Ja(n[a],t[a]);return n}function wo(n,t){return n.indexOf(t)===0}function Eo(n,t,e,r){var i,a=t;if(r.jsonp===!0){a=t.replace(/([\?\#].*)?$/i,"");var o=Jo("".concat(a)).slice(0,7);a="".concat(a,".").concat(o,".jsonp")}if(r.shortPath===!0){var s=a.replace(n,"").split("."),l=(i=s.shift())!==null&&i!==void 0?i:"",u=s.join(".");a=mt(n,Jo(l))+(u?"."+u:"")}var c=a.replace(n,"");return r.baseURL&&(a=mt(r.baseURL,c)),r.traverseResource&&r.traverseResource({origin:t,absolute:a,relative:c,type:e}),a}function tt(n,t,e,r,i){var a=e;return Sr(e)||(t&&(t=mt(t,String(r))),a=mt(t,a)),Sr(a)||(a=mt(n,a)),wo(a,n)||console.warn("".concat(a," is not start with base_url(").concat(n,").")),Eo(n,a,"panorama",i)}function Fn(n,t,e){var r=t;return Sr(r)||(r=mt(n,t)),wo(r,n)||console.warn("".concat(r," is not start with base_url(").concat(n,").")),Eo(n,r,"model",e)}function fi(n,t,e,r){var i=t;return Sr(i)||(i=mt(e,i)),Sr(i)||(i=mt(n,i)),wo(i,n)||console.warn("".concat(i," is not start with base_url(").concat(n,").")),Eo(n,i,"texture",r)}var L0=function(n){for(var t=10;t>=0;t--){var e=512*Math.pow(2,t);if(e<=n)return t}return null},Bh=function(n){n=n.slice().sort(function(o,s){return o.level-s.level});for(var t=[],e=0,r=n;e<r.length;e++){var i=r[e];if(t.length===0){t.push(i);continue}var a=t[t.length-1];if(i.level>a.level){t.push(i);continue}if(i.size>a.size){t[t.length-1]=i;continue}}return t};function Rh(n,t,e){for(var r,i,a,o,s,l,u,c,f,v,m,h,p,g,A,y,x,b,w,E=JSON.stringify(t),S=[],M=0,R=[].concat(n);M<R.length;M++){var O=R[M];O instanceof xo?S.push.apply(S,O.raw.works):typeof O=="string"?S.push(O):S.push(JSON.stringify(O))}var C=ku(S);if(C instanceof Error)return C;Array.isArray(t.transform)?e.transform.fromArray(t.transform):t.transform&&e.transform.copy(t.transform),n=S.map(function(re){return JSON.parse(re)}).reduce(function(re,ae){return Ja(re,ae)}),Object.defineProperty(e,"raw",{configurable:!1,get:function(){return{works:S,options:E}}});{var P;if(t.workCode&&(typeof t.workCode=="string"?P=t.workCode:typeof t.workCode=="function"&&(P=t.workCode(n))),typeof P=="undefined"&&(P=String(n.resource_code||n.basic_code||n.vr_code||n.code||n.project_id||n.work_code||n.workCode)),typeof P=="undefined")return new Error("WorkCode never matched.");Object.defineProperty(e,"workCode",{configurable:!1,get:function(){return P}})}{var z=String(n.name);Object.defineProperty(e,"name",{configurable:!1,get:function(){return z}})}if(C instanceof Error)return C;Object.defineProperty(e,"issuer",{configurable:!1,get:function(){return C.issuer}}),Object.defineProperty(e,"expire",{configurable:!1,get:function(){return C.expire}}),Object.defineProperty(e,"allowHosts",{configurable:!1,get:function(){return C.allowHosts}});var T=(r=n.base_url)!==null&&r!==void 0?r:"";if(T&&T[T.length-1]!=="/"&&(T+="/"),C instanceof Error)return C;if(n.model){var k={work:e,layers:[]},L;n.model.file?L=Fn(T,n.model.file,t):n.model.file_url&&(L=Fn(T,n.model.file_url,t)),Object.defineProperty(k,"file",{configurable:!1,get:function(){return L}});var V;n.model.textureBase?V=fi(T,"",n.model.textureBase,t):n.model.material_base_url?V=fi(T,"",n.model.material_base_url,t):k.file&&(V=k.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Object.defineProperty(k,"textureBase",{configurable:!1,get:function(){return V}});var U;Array.isArray(n.model.textures)?(U=n.model.textures.map(function(re){var ae,G;return fi(T,re,(G=(ae=n.model.textureBase)!==null&&ae!==void 0?ae:n.model.material_base_url)!==null&&G!==void 0?G:"",t)}),Object.freeze(U)):Array.isArray(n.model.material_textures)&&(U=n.model.material_textures.map(function(re){var ae,G;return fi(T,re,(G=(ae=n.model.textureBase)!==null&&ae!==void 0?ae:n.model.material_base_url)!==null&&G!==void 0?G:"",t)}),Object.freeze(U)),Object.defineProperty(k,"textures",{configurable:!1,get:function(){return U}});var q=[];if(Array.isArray(n.model.tiles))for(var N=0,H=n.model.tiles;N<H.length;N++){var J=H[N];J&&(J.tileset||J.tileset_url)&&q.push(Object.freeze({type:(i=J.type)!==null&&i!==void 0?i:"mesh",name:(a=J.name)!==null&&a!==void 0?a:"",upAxis:(s=(o=J.upAxis)!==null&&o!==void 0?o:J.up_axis)!==null&&s!==void 0?s:"-Y",tileset:Fn(T,J.tileset||J.tileset_url,t)}))}else n.model.tiles&&(n.model.tiles.tileset||n.model.tiles.tileset_url)&&q.push(Object.freeze({type:(l=n.model.tiles.type)!==null&&l!==void 0?l:"mesh",name:(u=n.model.tiles.name)!==null&&u!==void 0?u:"lod",upAxis:(f=(c=n.model.tiles.upAxis)!==null&&c!==void 0?c:n.model.tiles.up_axis)!==null&&f!==void 0?f:"-Y",tileset:Fn(T,n.model.tiles.tileset||n.model.tiles.tileset_url,t)}));if(Array.isArray(n.model.layers))for(var j=0,_=n.model.layers;j<_.length;j++){var Z=_[j];Z&&(Z.tileset||Z.tileset_url)&&q.push(Object.freeze({type:(v=Z.type)!==null&&v!==void 0?v:"mesh",name:(m=Z.name)!==null&&m!==void 0?m:"",upAxis:(h=Z.upAxis)!==null&&h!==void 0?h:Z.up_axis,tileset:Fn(T,Z.tileset||Z.tileset_url,t)}))}Object.freeze(q),Object.defineProperty(k,"layers",{configurable:!1,get:function(){return q}}),Object.defineProperty(e,"model",{configurable:!1,get:function(){if(k.file||k.layers.length)return k}})}if(C instanceof Error)return C;var W=new Set,ee=new Set;{var Y=[];if(n.observers&&Array.isArray(n.observers)){var ne=[];n.panorama&&(Array.isArray(n.panorama)?ne=n.panorama:Array.isArray(n.panorama.list)?ne=n.panorama.list:Array.isArray(n.panorama.info)&&(ne=n.panorama.info));for(var te=function(re){var ae={},G=n.observers[re];if(!G)return"break";var Fe=ne[re];if(!Fe)return"break";G=Object.assign({},G,Fe,{active:G.active!==!1&&Fe.active!==!1}),Object.defineProperty(ae,"work",{configurable:!1,get:function(){return e}}),Object.defineProperty(ae,"index",{configurable:!1,get:function(){return re}}),ee.add(re),Object.defineProperty(ae,"panoIndex",{configurable:!1,get:function(){return re}});var ke=De({workCode:e.workCode,panoIndex:re});W.add(ke),Object.defineProperty(ae,"panoId",{configurable:!1,get:function(){return ke}});var Te=Object.freeze({workCode:e.workCode,panoIndex:re});Object.defineProperty(ae,"pano",{configurable:!1,get:function(){return Te}});var Ge=G.active!==!1;Object.defineProperty(ae,"active",{configurable:!1,get:function(){return Ge}});var be=G.loadable===!0;Object.defineProperty(ae,"loadable",{configurable:!1,get:function(){return be}});var ve=G.derived_id;Object.defineProperty(ae,"derivedId",{configurable:!1,get:function(){return ve}});var xe=G.derived_id_str;Object.defineProperty(ae,"derivedIdStr",{configurable:!1,get:function(){return xe}});var ge=(b=(y=(g=(p=n.panorama)===null||p===void 0?void 0:p.pano_high_cube_base_url)!==null&&g!==void 0?g:(A=n.panorama)===null||A===void 0?void 0:A.pano_cube_base_url)!==null&&y!==void 0?y:(x=n.panorama)===null||x===void 0?void 0:x.base_url)!==null&&b!==void 0?b:"",me={up:tt(T,ge,G.images?G.images.up:G.up,re,t),down:tt(T,ge,G.images?G.images.down:G.down,re,t),right:tt(T,ge,G.images?G.images.right:G.right,re,t),left:tt(T,ge,G.images?G.images.left:G.left,re,t),front:tt(T,ge,G.images?G.images.front:G.front,re,t),back:tt(T,ge,G.images?G.images.back:G.back,re,t)};if(G.size_list)me.sizeList=G.size_list.slice();else{var Qe=Jn(me.up);if(Qe&&(me.sizeList=[Qe],G.tiles))for(var Ke=G.tiles.slice().sort(function(He,nt){return He-nt}).map(function(He){return 512*Math.pow(2,He)}),rt=0,Xr=Ke;rt<Xr.length;rt++){var Le=Xr[rt];Le>Qe&&me.sizeList.push(Le)}}var Ze=G.images?G.images.luminance:G.luminance;Ze&&(me.luminance=Object.freeze({up:tt(T,ge,Ze.up,re,t),down:tt(T,ge,Ze.down,re,t),right:tt(T,ge,Ze.right,re,t),left:tt(T,ge,Ze.left,re,t),front:tt(T,ge,Ze.front,re,t),back:tt(T,ge,Ze.back,re,t)}));var ot=void 0;if(G.images)ot=G.images.tiles;else if(Array.isArray(G.size_list)){var tr=G.size_list.slice().sort(function(He,nt){return He-nt});if(tr[0]){var dn=L0(tr[0]);if(dn)for(var rr=dn-1;rr>=0;rr--)tr.unshift(512*Math.pow(2,rr));ot=tr}}else Array.isArray(G.tiles)&&(ot=G.tiles.slice(),typeof ot[0]=="number"&&(ot=ot.sort(function(He,nt){return He-nt}).map(function(He){return 512*Math.pow(2,He)})));if(ot){for(var Tt=[],nr=0,Mr=ot;nr<Mr.length;nr++){var Le=Mr[nr];if(typeof Le=="number"){var Ht=L0(Le);if(typeof Ht!="number")continue;var ir=Jn(me.front);if(!ir)continue;if(Le>ir){var Ut=Lt(me.up,Le),ct=Lt(me.down,Le),Oe=Lt(me.right,Le),hr=Lt(me.left,Le),gt=Lt(me.front,Le),pr=Lt(me.back,Le);Tt.push(Object.freeze({level:Ht,size:Le,scale:1,up:Ut,down:ct,right:Oe,left:hr,front:gt,back:pr}))}else{var Ut=me.up,ct=me.down,Oe=me.right,hr=me.left,gt=me.front,pr=me.back;Tt.push(Object.freeze({level:Ht,size:ir,scale:Le/ir,up:Ut,down:ct,right:Oe,left:hr,front:gt,back:pr}))}}else{var Ht=Le.level;if(typeof Ht!="number")continue;var Qe=Le.size;if(typeof Qe!="number")continue;var Ut=tt(T,ge,Le.up,re,t),ct=tt(T,ge,Le.down,re,t),Oe=tt(T,ge,Le.right,re,t),hr=tt(T,ge,Le.left,re,t),gt=tt(T,ge,Le.front,re,t),pr=tt(T,ge,Le.back,re,t);Tt.push(Object.freeze({level:Ht,size:Qe,scale:(w=Le.scale)!==null&&w!==void 0?w:1,up:Ut,down:ct,right:Oe,left:hr,front:gt,back:pr}))}}Tt=Bh(Tt),Object.freeze(Tt),Object.defineProperty(me,"tiles",{configurable:!1,get:function(){return Tt}})}Object.freeze(me),Object.defineProperty(ae,"images",{configurable:!1,get:function(){return me}});var vr=new d.Vector3;if(G.position instanceof d.Vector3)vr.copy(G.position);else if(Array.isArray(G.position))vr.fromArray(G.position);else return"break";Object.freeze(vr),Object.defineProperty(ae,"position",{configurable:!1,get:function(){return vr}});var Gt=new d.Vector3;if(G.standingPosition instanceof d.Vector3)Gt.copy(G.standingPosition);else if(Array.isArray(G.standingPosition))Gt.fromArray(G.standingPosition);else if(G.standing_position instanceof d.Vector3)Gt.copy(G.standing_position);else if(Array.isArray(G.standing_position))Gt.fromArray(G.standing_position);else return"break";Object.freeze(Gt),Object.defineProperty(ae,"standingPosition",{configurable:!1,get:function(){return Gt}});var St=new d.Quaternion;if(G.quaternion instanceof d.Quaternion)St.copy(G.quaternion);else if(Array.isArray(G.quaternion))St.fromArray(G.quaternion);else if(G.quaternion){var Ar=G.quaternion,Ir=Ar.x,fn=Ar.y,_r=Ar.z,Wr=Ar.w;St.set(Ir,fn,_r,Wr)}else return"break";Object.freeze(St),Object.defineProperty(ae,"quaternion",{configurable:!1,get:function(){return St}});var Kt=0;Xt(G.floorIndex)?Kt=G.floorIndex:Xt(G.floor_index)?Kt=G.floor_index:Xt(G.floor)&&(Kt=G.floor),Object.defineProperty(ae,"floorIndex",{configurable:!1,get:function(){return Kt}});var Ye;G.video&&(Ye={},typeof G.video.source=="string"&&(Ye.source=G.video.source),G.video.matrix instanceof d.Matrix4?Ye.matrix=G.video.matrix.clone():Array.isArray(G.video.matrix)&&(Ye.matrix=new d.Matrix4().fromArray(G.video.matrix)),G.video.size instanceof d.Vector2?Ye.size=G.video.size.clone():Array.isArray(G.video.size)&&(Ye.size=new d.Vector2().fromArray(G.video.size)),Ye.source&&Ye.matrix&&Ye.size&&(ae.video=Ye)),Object.freeze(Ye),Object.defineProperty(ae,"video",{configurable:!1,get:function(){return Ye}}),Array.isArray(G.accessibleNodes)?(ae.accessibleNodes=G.accessibleNodes.slice(),ae.accessibleIds=G.accessibleNodes.map(function(He){return De({workCode:e.workCode,panoIndex:He})})):Array.isArray(G.accessible_nodes)&&(ae.accessibleNodes=G.accessible_nodes.slice(),ae.accessibleIds=G.accessible_nodes.map(function(He){return De({workCode:e.workCode,panoIndex:He})})),Array.isArray(G.visibleNodes)?(ae.visibleNodes=G.visibleNodes.slice(),ae.visibleIds=G.visibleNodes.map(function(He){return De({workCode:e.workCode,panoIndex:He})})):Array.isArray(G.visible_nodes)&&(ae.visibleNodes=G.visible_nodes.slice(),ae.visibleIds=G.visible_nodes.map(function(He){return De({workCode:e.workCode,panoIndex:He})})),Y[re]=ae},ue=0;ue<n.observers.length;ue++){var ie=te(ue);if(ie==="break")break}}for(var ye=function(re){if(re.accessibleIds){var Fe=re.accessibleIds.filter(function(ge){return W.has(ge)});Object.freeze(Fe),Object.defineProperty(re,"accessibleIds",{configurable:!1,get:function(){return Fe}})}else{for(var ae=[],G=0;G<Y.length;G++)Y[G]!==re&&(Math.abs(Y[G].position.y-re.position.y)>3||Y[G].position.distanceTo(re.position)>10||ae.push(Y[G].panoId));Object.freeze(ae),Object.defineProperty(re,"accessibleIds",{configurable:!1,get:function(){return ae}})}if(re.accessibleNodes){var Te=re.accessibleNodes.filter(function(ge){return ee.has(ge)});Object.freeze(Te),Object.defineProperty(re,"accessibleNodes",{configurable:!1,get:function(){return Te}})}else{for(var ke=[],G=0;G<Y.length;G++)Y[G]!==re&&(Math.abs(Y[G].position.y-re.position.y)>3||Y[G].position.distanceTo(re.position)>10||ke.push(Y[G].panoIndex));Object.freeze(ke),Object.defineProperty(re,"accessibleNodes",{configurable:!1,get:function(){return ke}})}if(re.visibleIds){var be=re.visibleIds.filter(function(ge){return W.has(ge)});Object.freeze(be),Object.defineProperty(re,"visibleIds",{configurable:!1,get:function(){return be}})}else{var Ge=re.accessibleIds.slice();Object.freeze(Ge),Object.defineProperty(re,"visibleIds",{configurable:!1,get:function(){return Ge}})}if(re.visibleNodes){var xe=re.visibleNodes.filter(function(ge){return ee.has(ge)});Object.freeze(xe),Object.defineProperty(re,"visibleNodes",{configurable:!1,get:function(){return xe}})}else{var ve=re.accessibleNodes.slice();Object.freeze(ve),Object.defineProperty(re,"visibleNodes",{configurable:!1,get:function(){return ve}})}},fe=0,Ae=Y;fe<Ae.length;fe++){var Pe=Ae[fe];ye(Pe)}Object.freeze(Y),Object.defineProperty(e,"observers",{configurable:!1,get:function(){return Y}})}if(C instanceof Error)return C;if(n.initial){if((n.initial.mode==="Panorama"&&e.observers.length===0||n.initial.mode==="Floorplan"||n.initial.mode==="Topview"||n.initial.mode==="Model"||n.initial.mode==="Mapview"||n.initial.mode==="DepthPanorama")&&(e.initial.mode=n.initial.mode),Xt(n.initial.latitude)&&(e.initial.latitude=n.initial.latitude),Xt(n.initial.longitude)?e.initial.longitude=n.initial.longitude:Xt(n.initial.heading)&&(e.initial.longitude=Sh(n.initial.heading)),Xt(n.initial.fov)&&(e.initial.fov=n.initial.fov),e.observers.length>0){var we=void 0;Xt(n.initial.panoIndex)?we=n.initial.panoIndex:Xt(n.initial.pano_index)?we=n.initial.pano_index:Xt(n.initial.pano)&&(we=n.initial.pano),typeof we=="number"&&(we=he(we,0,e.observers.length-1),e.initial.panoIndex=we)}if(Xt(n.initial.distance)&&(e.initial.distance=n.initial.distance),Array.isArray(n.initial.offset)){var Me=[0,0,0].map(function(re,ae){var G=Number(n.initial.offset[ae]);return isNaN(G)||!isFinite(G)?0:G});e.initial.offset=new d.Vector3().fromArray(Me)}!e.initial.mode&&typeof e.initial.panoIndex=="number"&&(e.initial.mode="Panorama")}return C instanceof Error?C:(bo.set(e,{works:S,options:E}),e)}function Gn(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));var e=bo.get(n);if(e){if(t&&!Ka(JSON.parse(e.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return n}else try{return new xo(n,t!=null?t:{})}catch(r){throw new Error("[PARSE FAILED]: "+r.message+`
1030
1030
  Error work input:
@@ -1958,7 +1958,7 @@ void main() {
1958
1958
  `,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+uv,r=this.getDefines()+lv;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},Mt([_t("screenWidth"),It("design:type",Number)],t.prototype,"screenWidth",void 0),Mt([_t("screenHeight"),It("design:type",Number)],t.prototype,"screenHeight",void 0),Mt([_t("edlStrength"),It("design:type",Number)],t.prototype,"edlStrength",void 0),Mt([_t("uNear"),It("design:type",Number)],t.prototype,"uNear",void 0),Mt([_t("uFar"),It("design:type",Number)],t.prototype,"uFar",void 0),Mt([_t("radius"),It("design:type",Number)],t.prototype,"radius",void 0),Mt([_t("neighbours",!0),It("design:type",Float32Array)],t.prototype,"neighbours",void 0),Mt([_t("depthMap"),It("design:type",d.Texture)],t.prototype,"depthMap",void 0),Mt([_t("uEDLColor"),It("design:type",d.Texture)],t.prototype,"uEDLColor",void 0),Mt([_t("uEDLDepth"),It("design:type",d.Texture)],t.prototype,"uEDLDepth",void 0),Mt([_t("uProj"),It("design:type",Array)],t.prototype,"uProj",void 0),t}(d.RawShaderMaterial);function Bt(n,t){return{type:n,value:t}}function _t(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var dv=new d.OrthographicCamera(-1,1,1,-1,0,1),Ro=new d.BufferGeometry;Ro.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Ro.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var Xu=new d.Mesh(Ro),_u=new d.Scene;_u.add(Xu);var fv=function(n){se(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new d.Vector2,o.renderer=e,o.material=new cv,Xu.material=o.material,o.material.needsUpdate=!0,o}return t.prototype.render=function(e){this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera);var r=this.camera,i=this.material.uniforms,a=this.renderer.getSize(this.sharedV2);i.screenWidth.value=a.x,i.screenHeight.value=a.y;var o=r.projectionMatrix,s=new Float32Array(16);s.set(o.elements);for(var l=new Float32Array(this.material.neighbourCount*2),u=0;u<this.material.neighbourCount;u++)l[2*u+0]=Math.cos(2*u*Math.PI/this.material.neighbourCount),l[2*u+1]=Math.sin(2*u*Math.PI/this.material.neighbourCount);i.neighbours.value=l,i.uNear.value=r.near,i.uFar.value=r.far,i.uEDLColor.value=e[0].texture,i.uProj.value=s,i.edlStrength.value=.25,i.radius.value=1,i.opacity.value=1,this.renderer.setRenderTarget(e[1]),this.renderer.render(_u,dv)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(To);const hv=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{H{vs|z-nz}yr?Q-drvtuZn}H{vs|z-nz}yr?Q-Qr}uZn}Hn\bv{t-rp?-bH|vq-znv{56-
1959
1959
  sy|n-qr}u-J-r\x07r?Q5Qr}uZn}9-b6;Hvs5qr}u-KJ->;=6
1960
1960
  qvpnqH\frpA-p|y|-J-r\x07r?Q5drvtuZn}9-b6H-p|y|-J-p|y|-<-p|y|;HtylSntP|y|-J-rpA5p|y|;\x07\b 9->;=6H-\f`),pv=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{Hnvor-rp@-}|vv|{Hnvor-rp?-H{vs|z-znA-}|wrpv|{Znv\x07H{vs|z-znA-z|qrycvrZnv\x07Hn\bv{t-rp?-bH|vq-znv{56-
1961
- b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var vv=function(n){se(t,n);function t(e){var r=n.call(this,{vertexShader:pv,fragmentShader:hv})||this;return r.uniforms={uDepthMap:rs("t",null),uWeightMap:rs("t",null)},r.depthTest=!0,r.depthWrite=!0,r.opacity=1,r}return t.prototype.getUniform=function(e){return this.uniforms===void 0?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,r){if(this.uniforms!==void 0){var i=this.uniforms[e];i.value=r}},Mt([ns("uDepthMap"),It("design:type",Number)],t.prototype,"uDepthMap",void 0),Mt([ns("uWeightMap"),It("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(d.RawShaderMaterial);function rs(n,t){return{type:n,value:t}}function ns(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var Av=new d.OrthographicCamera(-1,1,1,-1,0,1),Fo=new d.BufferGeometry;Fo.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Fo.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var Wu=new d.Mesh(Fo),Zu=new d.Scene;Zu.add(Wu);var mv=function(n){se(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new d.Vector2,o.renderer=e,o.material=new vv,o.camera=i,Wu.material=o.material,o}return t.prototype.render=function(e){this.models.setMaterial({useHQDepth:!0,useHQWeight:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.models.setMaterial({useHQWeight:!0,useHQDepth:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new d.Color(0,0,0)),this.renderer.setClearAlpha(0),this.renderer.setRenderTarget(e[1]),this.renderer.render(this.scene,this.camera),this.material.uniforms.uWeightMap.value=e[1].texture,this.material.uniforms.uDepthMap.value=e[0].depthTexture,this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new d.Color(0,0,0)),this.renderer.setClearAlpha(1),this.renderer.setRenderTarget(e[2]),this.renderer.render(Zu,Av)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(To),Pa=.5,Ba=.5,is=Math.PI/7,gv=function(n){se(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Mapview",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultDistance=a.defaultDistance,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.cameraType=a.cameraType,r.modelInScreen=a.modelInScreen,r.locationMotion=new Se({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Se({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Se({perspToOrtho:r.camera.perspToOrtho.x}),r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.currentTapId=null,r.helper.add(r.intersectMesh),r.edlTarget=new d.WebGLRenderTarget(1024,1024,{generateMipmaps:!1,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:new d.DepthTexture(1024,1024,d.UnsignedIntType)}),r.edlEffect=new fv(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new mv(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,l,u,c;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return F(F({},f),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultDistance:(a=e.defaultDistance)!==null&&a!==void 0?a:150,maxLatitude:(o=e.maxLatitude)!==null&&o!==void 0?o:+Math.PI/2,minLatitude:(s=e.minLatitude)!==null&&s!==void 0?s:0,cameraType:(l=e.cameraType)!==null&&l!==void 0?l:"auto",modelInScreen:(u=e.modelInScreen)!==null&&u!==void 0?u:"boundingbox-center",intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new qi}})},t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u,c=this.parseArgs(e),f=c.works,v=c.models,m=e.initial,h=m.state,p=m.currentState,g=typeof h.panoIndex=="number"?{workCode:(a=(r=h.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:h.panoIndex}:{workCode:p.workCode,panoIndex:p.panoIndex},A=f.getResolvedObserver(g),y=(o=h.fov)!==null&&o!==void 0?o:60,x=he((s=h.latitude)!==null&&s!==void 0?s:Xa(p.mode)?p.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),b=t.distanceFromModel(c.models,y,c.camera.aspect),w=new d.Vector3,E=(l=h.distance)!==null&&l!==void 0?l:Math.min(c.defaultDistance,b),S=(u=h.longitude)!==null&&u!==void 0?u:Xa(p.mode)?p.longitude:c.defaultLongitude;return h.offset?w.copy(h.offset):c.defaultDistance<b&&A?(w.copy(A.position),h.longitude===void 0&&(S=p.longitude)):w.copy(v.bounding.getCenter(w)),F(F({},g),{mode:"Mapview",longitude:S,latitude:x,fov:y,offset:w,distance:E})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.userAction=a,this.works=e;var o=t.initAnimationEndState(F(F({},this),{initial:{currentState:F(F({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},l={x:o.offset.x,y:o.offset.y,z:o.offset.z,distance:o.distance,orthoDistance:o.distance};return this.locationMotion.set(l,i.duration).catch(Q),this.cameraMotion.set(s,i.duration).catch(Q),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var c=u[l];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha);var o=0;this.cameraType==="auto"?o=Math.PI/2-this.cameraMotion.value.latitude<.02?1:0:this.cameraType==="perspective"?o=0:this.cameraType==="orthographic"&&(o=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==o&&this.perspToOrthoMotion.set({perspToOrtho:o},500).catch(Q),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),qt(i)||this.models.setMaterial(i),qt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Ce())[1],r=this.locationMotion.getKeyFrameSegment(Ce())[1];return F(F({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new d.Vector3(r.value.x,r.value.y,r.value.z)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={longitude:s.longitude,latitude:s.latitude,fov:s.fov},u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",X("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(f,a).catch(Q),e.modelAlphaMotion.set(c,a/3).catch(Q),e.cameraMotion.set(l,a).catch(Q),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",X("initAnimation.end",{state:s,userAction:e.userAction}))},function(v){var m=F(F(F({},e.currentPano),{mode:e.mode}),je(e.camera.pose));e.emit("initAnimation.end",X("initAnimation.end",{state:m,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.models.intersectRaycaster(e)[0];if(!i)return null;var a=this.works.resolvedObservers.filter(function(u){for(var c,f=0,v=r.models;f<v.length;f++){var m=v[f];if(m.visible&&((c=m.work)===null||c===void 0?void 0:c.workCode)===u.work.workCode)return!0}return!1}),o=dr(a,function(u){return u.standingPosition.distanceTo(i.point)},!0),s=o[0],l=o[1];return s&&l<10?s:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new d.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=F({},i),l={longitude:0,latitude:0,x:0,y:0,z:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.998,s.x*=.99,s.y*=.99,s.z*=.99,l.longitude+=s.longitude,l.latitude+=s.latitude,l.x+=s.x,l.y+=s.y,l.z+=s.z;var c=jr(this.cameraMotion.value.longitude+l.longitude),f=he(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),v=new d.Vector3(this.locationMotion.value.x+l.x,this.locationMotion.value.y+l.y,this.locationMotion.value.z+l.z),m=F(F({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,offset:v,fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),h=!(Math.abs(s.longitude)>1e-4||Math.abs(s.latitude)>1e-4||Math.abs(s.x)>1e-4||Math.abs(s.y)>1e-4||Math.abs(s.z)>1e-4),p=X("gesture.momentum",F(F({},e),{isFirst:r,isFinal:h,state:m}));if(this.inMomentumMovement.event=p,this.emit("gesture.momentum",p),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:f},0).catch(Q),this.locationMotion.set({x:m.offset.x,y:m.offset.y,z:m.offset.z},0).catch(Q),h?this.inMomentumMovement=null:lt.shared.add(function(g,A){o.requestMomentumMovement(e,!1,s,A|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=zt(e,new d.Vector3),i=new d.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),a=new d.Raycaster(i,r);a.params.Points={threshold:.1},a.near=Pa;var o;if(a.ray.direction.y<-.3&&(o=this.models.intersectRaycaster(a).filter(function(f){var v,m=(v=f.face)===null||v===void 0?void 0:v.normal;return m&&a.ray.direction.dot(m)>=0?!1:f.distance>Ba+a.near})[0],!o)){var s=new d.Plane(new d.Vector3(0,1,0),-this.models.bounding.min.y),l=a.ray.intersectPlane(s,new d.Vector3);if(l){var u=l.distanceTo(a.ray.origin);u<1e4&&u>=a.near&&(o={distance:u,floor:0,point:l,object:this.scene,face:null})}}if(!o){var c=Math.max(e.distance,3);o={distance:c,floor:0,point:a.ray.direction.clone().setLength(c).add(a.ray.origin),object:this.scene,face:null}}o&&(e.distance=he(o.distance,0,1/0),e.offset.copy(i).add(r.clone().multiplyScalar(e.distance)))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.pointers.length,i=this.panState,a=0;e.pointerType==="mouse"&&(a=e.srcEvent.buttons),i&&a===0&&i.buttons!==0&&(a=i.buttons);var o=i==null?void 0:i.target;if(!o){var s=this.relativeClientPosition(e.center),l=new d.Raycaster;l.params.Points={threshold:.1},l.setFromCamera(s,this.camera),l.near=Pa,o=new d.Vector3().copy(l.ray.direction).multiplyScalar(3).add(l.ray.origin);var u=this.models.intersectRaycaster(l)[0];if(!u&&l.ray.direction.y<-.3){var c=new d.Plane(new d.Vector3(0,1,0),0),f=l.ray.intersectPlane(c,new d.Vector3);if(f){var v=f.distanceTo(l.ray.origin);v<1e4&&v>=l.near&&(u={distance:v,floor:0,point:f,object:this.scene})}}if(u)o.copy(u.point);else{var m=new d.Vector3().copy(this.camera.pose.offset).sub(this.camera.position).normalize(),c=new d.Plane().setFromNormalAndCoplanarPoint(m,this.camera.pose.offset);l.ray.intersectPlane(c,o)}}if(e.isFinal?delete this.panState:this.panState={target:o,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var h=r>1||a===2;if(h){var p={x:e.center.x-i.x,y:e.center.y-i.y},g=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),A=zt(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(g),y=new d.Vector3().copy(A).sub(i.target).length();y*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var x=this.renderer.getSize(new d.Vector2),b=2*p.x*y/x.y,w=2*p.y*y/x.y,E=new d.Vector3;if(E.setFromMatrixColumn(this.camera.matrix,0),E.multiplyScalar(-b),g.add(E),this.camera.pose.latitude<is?E.setFromMatrixColumn(this.camera.matrix,1):(E.setFromMatrixColumn(this.camera.matrix,0),E.crossVectors(this.camera.up,E)),E.multiplyScalar(w),g.add(E),this.modelInScreen==="boundingbox-center"){var S=this.models.bounding.clone();S.expandByScalar(this.camera.pose.distance),g.clamp(S.min,S.max)}var M=F(F({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:g,distance:this.camera.pose.distance});if(e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(Q),e.isFinal&&(this.fixFinalState(M),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(Q)),e.isFinal){var R=this.renderer.getSize(new d.Vector2),O=2*e.velocityX*y/R.y,C=2*e.velocityY*y/R.y,P=new d.Vector3,z=new d.Vector3;P.setFromMatrixColumn(this.camera.matrix,0),P.multiplyScalar(-O),z.add(P),this.camera.pose.latitude<is?P.setFromMatrixColumn(this.camera.matrix,1):(P.setFromMatrixColumn(this.camera.matrix,0),P.crossVectors(this.camera.up,P)),P.multiplyScalar(C),z.add(P),this.inMomentumMovement={uuid:Ct()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:z.x,y:z.y,z:z.z},0)}}else{var p={x:e.center.x-i.x,y:e.center.y-i.y},T=this.coordinatesForOffset(p),k=jr(this.cameraMotion.value.longitude+T.longitude),L=he(this.cameraMotion.value.latitude+T.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(L=this.cameraMotion.value.latitude);var M=F(F({},this.currentPano),{mode:this.mode,longitude:k,latitude:L,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&Object.assign(e,{__fixFinalState:!0}),e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(Q):this.cameraMotion.set({longitude:M.longitude,latitude:M.latitude},0).catch(Q),e.isFinal){var V=e.velocityX,U=e.velocityY;this.inMomentumMovement={uuid:Ct()},this.requestMomentumMovement(e,!0,F(F({},this.coordinatesForOffset({x:V,y:U})),{x:0,y:0,z:0}),0)}}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var i=(r=this.pinchState)===null||r===void 0?void 0:r.distance;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,scale:1,distance:this.locationMotion.value.distance};return}if(typeof i!="undefined"){var a=this.models.bounding.getCenter(new d.Vector3),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),s=he(i/e.scale,Ba,1/0),l=e.state.offset.clone().sub(zt(e.state).setLength(s)),u=this.models.bounding.containsPoint(l),c;if(!u&&this.pinchState&&this.pinchState.scale>e.scale&&a.distanceTo(l)>o?c=e.state.distance:(c=s,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=c,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(Q),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)),e.isFinal)){if(!("__fixFinalState"in e)){var f=e.state;this.fixFinalState(e.state);var v={x:f.offset.x,y:f.offset.y,z:f.offset.z,distance:f.distance};this.locationMotion.set(v,0).catch(Q)}delete this.panState,delete this.pinchState}}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(a.near=Pa,a.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=X("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new d.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var f=a.ray.origin.distanceTo(c),v=2*Math.tan(.5*this.camera.fov/180*Math.PI),m=Math.max(f*v/10,1);this.intersectMesh.scale.set(m,m,m);var h=c.clone().add(u);if(this.intersectMesh.lookAt(h),Math.abs(l.y)>.99){var p=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady)if(this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh(),e.isFinal){var r=e.state;if(this.fixFinalState(r),this.emit("gesture.mousewheel",e),e.defaultPrevented)return;var i={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(i,0).catch(Q)}else{var a=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1),o=this.models.bounding.getCenter(new d.Vector3),s=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),l=he(this.locationMotion.value.distance-a,Ba,1/0),u=e.state.offset.clone().sub(zt(e.state).setLength(l)),c=this.models.bounding.containsPoint(u);if(this.modelInScreen!=="none"&&(l=!c&&a<0&&o.distanceTo(u)>s?e.state.distance:l),e.state.distance=l,this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:l},0).catch(Q)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=F(F({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new d.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var l=this.currentTapId=Ct();this.preloadPano(a.pano).then(function(u){r.currentTapId===l&&r.emit("pano.request",X("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.onDblTapGesture=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.state,i=e.center.raycaster,a=i.ray.origin.clone().add(i.ray.direction.clone().setLength(3)),o=1,s=3,l=o,u=this.models.intersectRaycaster(i)[0];if(u&&(a=u.point.clone(),u.distance>(o+s)/2?l=o:l=s),e.state.distance=l,e.state.offset=a,this.emit("gesture.dbltap",e),!e.defaultPrevented){var c={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(c,360).catch(Q),this.hideIntersectMesh()}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(r==="edl"?this.edlEffect.render(this.screenBuffers):r==="hq"?this.hqEffect.render(this.screenBuffers):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t}(Io);function as(n){return n==null}var yv={type:"move"},os=function(){function n(){this._targetRay=null,this._grip=null,this._hand=null,this._axes=[0,0]}return n.prototype.getHandSpace=function(){return this._hand===null&&(this._hand=new d.Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},n.prototype.getTargetRaySpace=function(){return this._targetRay===null&&(this._targetRay=new d.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new d.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new d.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new d.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new d.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new d.Vector3),this._grip},n.prototype.dispatchEvent=function(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this},n.prototype.disconnect=function(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this},n.prototype.getAxes=function(){return this._axes},n.prototype.update=function(t,e,r){var i=null,a=null,o=null,s=this._targetRay,l=this._grip,u=this._hand;if(t&&t.gamepad&&t.gamepad.axes&&(this._axes=[t.gamepad.axes[2],t.gamepad.axes[3]]),t&&e.session.visibilityState!=="visible-blurred")if(s!==null&&(i=e.getPose(t.targetRaySpace,r),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(yv))),u&&t.hand){o=!0;for(var c=0,f=t.hand.values();c<f.length;c++){var v=f[c],m=e.getJointPose(v,r);if(u.joints[v.jointName]===void 0){var h=new d.Group;h.matrixAutoUpdate=!1,h.visible=!1,u.joints[v.jointName]=h,u.add(h)}var p=u.joints[v.jointName];m!==null&&(p.matrix.fromArray(m.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=m.radius),p.visible=m!==null}var g=u.joints["index-finger-tip"],A=u.joints["thumb-tip"],y=g.position.distanceTo(A.position),x=.02,b=.005;u.inputState.pinching&&y>x+b?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&y<=x-b&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,r),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this},n}(),bv=1,xv=function(){function n(t,e,r){var i,a,o,s,l;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0;var u=navigator.userAgent.toLowerCase(),c;u.includes("pico")?c="Pico":u.includes("oculus")?c="Oculus":c="VP",this.machineType=(a=r==null?void 0:r.machineType)!==null&&a!==void 0?a:c,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(o=r==null?void 0:r.referenceSpaceType)!==null&&o!==void 0?o:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(s=r==null?void 0:r.onSessionStart)!==null&&s!==void 0?s:Q,this.onSessionEndCallback=(l=r==null?void 0:r.onSessionEnd)!==null&&l!==void 0?l:Q,this.controllers=[new os,new os],this.inputSourcesMap=new Map,this.cameraVR=new d.ArrayCamera,this.cameraL=new d.PerspectiveCamera,this.cameraR=new d.PerspectiveCamera,this.cameraL.viewport=new d.Vector4,this.cameraR.viewport=new d.Vector4,this.cameraL.layers.enable(1),this.cameraR.layers.enable(2),this.cameraVR.layers.enable(1),this.cameraVR.layers.enable(2),this.isPresenting=!1,this.currentDepthNear=null,this.currentDepthFar=null,this.cameraLPos=new d.Vector3,this.cameraRPos=new d.Vector3}return n.prototype.getController=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getRightController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="right"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getLeftController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="left"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getControllerGrip=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getGripSpace()},n.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},n.prototype.updateCamera=function(t,e){e===null?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)},n.prototype.setProjectionFromUnion=function(t,e,r){this.cameraLPos.setFromMatrixPosition(e.matrixWorld),this.cameraRPos.setFromMatrixPosition(r.matrixWorld);var i=this.cameraLPos.distanceTo(this.cameraRPos),a=e.projectionMatrix.elements,o=r.projectionMatrix.elements,s=a[14]/(a[10]-1),l=a[14]/(a[10]+1),u=(a[9]+1)/a[5],c=(a[9]-1)/a[5],f=(a[8]-1)/a[0],v=(o[8]+1)/o[0],m=s*f,h=s*v,p=i/(-f+v),g=p*-f;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(g),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var A=s+p,y=l+p,x=m-g,b=h+(i-g),w=u*l/y*A,E=c*l/y*A;t.projectionMatrix.makePerspective(x,b,w,E,A,y)},n.prototype.getCamera=function(t){this.cameraVR.near=this.cameraR.near=this.cameraL.near=t.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=t.far,this.session&&(this.currentDepthNear!==this.cameraVR.near||this.currentDepthFar!==this.cameraVR.far)&&(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var e=t.parent,r=this.cameraVR.cameras;this.updateCamera(this.cameraVR,e);for(var i=0;i<r.length;i++)this.updateCamera(r[i],e);t.matrixWorld.copy(this.cameraVR.matrixWorld);for(var a=t.children,i=0,o=a.length;i<o;i++)a[i].updateMatrixWorld(!0);return r.length===2?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},n.prototype.updateInputSources=function(t){if(!this.session){console.warn("session is lose!");return}for(var e=this.session.inputSources,r=0;r<this.controllers.length;r++)this.inputSourcesMap.set(e[r],this.controllers[r]);for(var r=0;r<t.removed.length;r++){var i=t.removed[r],a=this.inputSourcesMap.get(i);a&&(a.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(var r=0;r<t.added.length;r++){var i=t.added[r],a=this.inputSourcesMap.get(i);a&&a.dispatchEvent({type:"connected",data:i})}},n.prototype.onSessionEvent=function(t){var e=this.inputSourcesMap.get(t.inputSource);e&&e.dispatchEvent({type:t.type})},n.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach(function(t,e){t.disconnect(e)}),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,lt.shared.setContext(null),this.onSessionEndCallback()},n.prototype.onRequestReferenceSpace=function(t){this.referenceSpace=t,this.isPresenting=!0,this.session&&this.onSessionStartCallback(this.session)},n.prototype.setSession=function(t){var e=this;if(this.session=t,this.session){this.session.addEventListener("select",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectstart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeeze",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezestart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezeend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("end",function(i){e.onSessionEnd()});var r=this.gl.getContextAttributes();this.gl.makeXRCompatible().then(function(){var i={antialias:r==null?void 0:r.antialias,alpha:r==null?void 0:r.alpha,depth:r==null?void 0:r.depth,stencil:r==null?void 0:r.stencil,framebufferScaleFactor:bv};if(!e.session){console.error("session is lose while set session!");return}switch(e.machineType){case"Pico":case"VP":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;case"Oculus":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;default:e.machineType;break}e.session.requestReferenceSpace(e.referenceSpaceType).then(function(a){e.onRequestReferenceSpace(a)}),e.session.addEventListener("inputsourceschange",function(a){e.updateInputSources(a)})})}},n}(),ko=function(n){se(t,n);function t(){var e=n.call(this)||this;e.type="LineSegmentsGeometry";var r=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],a=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(a),e.setAttribute("position",new d.Float32BufferAttribute(r,3)),e.setAttribute("uv",new d.Float32BufferAttribute(i,2)),e}return t.prototype.applyMatrix4=function(e){var r=this.attributes.instanceStart,i=this.attributes.instanceEnd;return r!==void 0&&(r.applyMatrix4(e),i.applyMatrix4(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},t.prototype.setPositions=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new d.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new d.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new d.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},t.prototype.setColors=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new d.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new d.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new d.InterleavedBufferAttribute(i,3,3)),this},t.prototype.fromWireframeGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromEdgesGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromMesh=function(e){return this.fromWireframeGeometry(new d.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof d.Geometry){var i=new d.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof d.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new d.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=new d.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(r),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new d.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var a=0,o=new d.Vector3,s=0,l=e.count;s<l;s++)o.fromBufferAttribute(e,s),a=Math.max(a,i.distanceToSquared(o)),o.fromBufferAttribute(r,s),a=Math.max(a,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(d.InstancedBufferGeometry);Object.assign(ko.prototype,{isLineSegmentsGeometry:!0});var Ra={uniforms:d.UniformsUtils.merge([d.UniformsLib.common,d.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new d.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
1961
+ b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var vv=function(n){se(t,n);function t(e){var r=n.call(this,{vertexShader:pv,fragmentShader:hv})||this;return r.uniforms={uDepthMap:rs("t",null),uWeightMap:rs("t",null)},r.depthTest=!0,r.depthWrite=!0,r.opacity=1,r}return t.prototype.getUniform=function(e){return this.uniforms===void 0?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,r){if(this.uniforms!==void 0){var i=this.uniforms[e];i.value=r}},Mt([ns("uDepthMap"),It("design:type",Number)],t.prototype,"uDepthMap",void 0),Mt([ns("uWeightMap"),It("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(d.RawShaderMaterial);function rs(n,t){return{type:n,value:t}}function ns(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var Av=new d.OrthographicCamera(-1,1,1,-1,0,1),Fo=new d.BufferGeometry;Fo.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Fo.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var Wu=new d.Mesh(Fo),Zu=new d.Scene;Zu.add(Wu);var mv=function(n){se(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new d.Vector2,o.renderer=e,o.material=new vv,o.camera=i,Wu.material=o.material,o}return t.prototype.render=function(e){this.models.setMaterial({useHQDepth:!0,useHQWeight:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.models.setMaterial({useHQWeight:!0,useHQDepth:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new d.Color(0,0,0)),this.renderer.setClearAlpha(0),this.renderer.setRenderTarget(e[1]),this.renderer.render(this.scene,this.camera),this.material.uniforms.uWeightMap.value=e[1].texture,this.material.uniforms.uDepthMap.value=e[0].depthTexture,this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new d.Color(0,0,0)),this.renderer.setClearAlpha(1),this.renderer.setRenderTarget(e[2]),this.renderer.render(Zu,Av)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(To),Pa=.5,Ba=.5,is=Math.PI/7,gv=function(n){se(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Mapview",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultDistance=a.defaultDistance,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.cameraType=a.cameraType,r.modelInScreen=a.modelInScreen,r.locationMotion=new Se({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Se({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Se({perspToOrtho:r.camera.perspToOrtho.x}),r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.currentTapId=null,r.helper.add(r.intersectMesh),r.edlTarget=new d.WebGLRenderTarget(1024,1024,{generateMipmaps:!1,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:new d.DepthTexture(1024,1024,d.UnsignedIntType)}),r.edlEffect=new fv(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new mv(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,l,u,c;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return F(F({},f),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultDistance:(a=e.defaultDistance)!==null&&a!==void 0?a:150,maxLatitude:(o=e.maxLatitude)!==null&&o!==void 0?o:+Math.PI/2,minLatitude:(s=e.minLatitude)!==null&&s!==void 0?s:0,cameraType:(l=e.cameraType)!==null&&l!==void 0?l:"auto",modelInScreen:(u=e.modelInScreen)!==null&&u!==void 0?u:"boundingbox-center",intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new qi}})},t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u,c=this.parseArgs(e),f=c.works,v=c.models,m=e.initial,h=m.state,p=m.currentState,g=typeof h.panoIndex=="number"?{workCode:(a=(r=h.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:h.panoIndex}:{workCode:p.workCode,panoIndex:p.panoIndex},A=f.getResolvedObserver(g),y=(o=h.fov)!==null&&o!==void 0?o:60,x=he((s=h.latitude)!==null&&s!==void 0?s:Xa(p.mode)?p.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),b=t.distanceFromModel(c.models,y,c.camera.aspect),w=new d.Vector3,E=(l=h.distance)!==null&&l!==void 0?l:Math.min(c.defaultDistance,b),S=(u=h.longitude)!==null&&u!==void 0?u:Xa(p.mode)?p.longitude:c.defaultLongitude;return h.offset?w.copy(h.offset):c.defaultDistance<b&&A?(w.copy(A.position),h.longitude===void 0&&(S=p.longitude)):w.copy(v.bounding.getCenter(w)),F(F({},g),{mode:"Mapview",longitude:S,latitude:x,fov:y,offset:w,distance:E})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.userAction=a,this.works=e;var o=t.initAnimationEndState(F(F({},this),{initial:{currentState:F(F({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},l={x:o.offset.x,y:o.offset.y,z:o.offset.z,distance:o.distance,orthoDistance:o.distance};return this.locationMotion.set(l,i.duration).catch(Q),this.cameraMotion.set(s,i.duration).catch(Q),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(Q),a.cameraMotion.set(s,r).catch(Q)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var c=u[l];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(Q),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha);var o=0;this.cameraType==="auto"?o=Math.PI/2-this.cameraMotion.value.latitude<.02?1:0:this.cameraType==="perspective"?o=0:this.cameraType==="orthographic"&&(o=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==o&&this.perspToOrthoMotion.set({perspToOrtho:o},500).catch(Q),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),qt(i)||this.models.setMaterial(i),qt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Ce())[1],r=this.locationMotion.getKeyFrameSegment(Ce())[1];return F(F({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new d.Vector3(r.value.x,r.value.y,r.value.z)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={longitude:s.longitude,latitude:s.latitude,fov:s.fov},u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",X("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(f,a).catch(Q),e.modelAlphaMotion.set(c,a/3).catch(Q),e.cameraMotion.set(l,a).catch(Q),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",X("initAnimation.end",{state:s,userAction:e.userAction}))},function(v){var m=F(F(F({},e.currentPano),{mode:e.mode}),je(e.camera.pose));e.emit("initAnimation.end",X("initAnimation.end",{state:m,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this,i=this.models.intersectRaycaster(e)[0];if(!i)return null;var a=this.works.resolvedObservers.filter(function(u){for(var c,f=0,v=r.models;f<v.length;f++){var m=v[f];if(m.visible&&((c=m.work)===null||c===void 0?void 0:c.workCode)===u.work.workCode)return!0}return!1}),o=dr(a,function(u){return u.standingPosition.distanceTo(i.point)},!0),s=o[0],l=o[1];return s&&l<10?s:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new d.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=F({},i),l={longitude:0,latitude:0,x:0,y:0,z:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.998,s.x*=.99,s.y*=.99,s.z*=.99,l.longitude+=s.longitude,l.latitude+=s.latitude,l.x+=s.x,l.y+=s.y,l.z+=s.z;var c=jr(this.cameraMotion.value.longitude+l.longitude),f=he(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),v=new d.Vector3(this.locationMotion.value.x+l.x,this.locationMotion.value.y+l.y,this.locationMotion.value.z+l.z),m=F(F({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,offset:v,fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),h=!(Math.abs(s.longitude)>1e-4||Math.abs(s.latitude)>1e-4||Math.abs(s.x)>1e-4||Math.abs(s.y)>1e-4||Math.abs(s.z)>1e-4),p=X("gesture.momentum",F(F({},e),{isFirst:r,isFinal:h,state:m}));if(this.inMomentumMovement.event=p,this.emit("gesture.momentum",p),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:f},0).catch(Q),this.locationMotion.set({x:m.offset.x,y:m.offset.y,z:m.offset.z},0).catch(Q),h?this.inMomentumMovement=null:lt.shared.add(function(g,A){o.requestMomentumMovement(e,!1,s,A|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=zt(e,new d.Vector3),i=new d.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),a=new d.Raycaster(i,r);a.params.Points={threshold:.1},a.near=Pa;var o;if(a.ray.direction.y<-.3&&(o=this.models.intersectRaycaster(a).filter(function(f){var v,m=(v=f.face)===null||v===void 0?void 0:v.normal;return m&&a.ray.direction.dot(m)>=0?!1:f.distance>Ba+a.near})[0],!o)){var s=new d.Plane(new d.Vector3(0,1,0),-this.models.bounding.min.y),l=a.ray.intersectPlane(s,new d.Vector3);if(l){var u=l.distanceTo(a.ray.origin);u<1e4&&u>=a.near&&(o={distance:u,floor:0,point:l,object:this.scene,face:null})}}if(!o){var c=Math.max(e.distance,3);o={distance:c,floor:0,point:a.ray.direction.clone().setLength(c).add(a.ray.origin),object:this.scene,face:null}}o&&(e.distance=he(o.distance,0,1/0),e.offset.copy(i).add(r.clone().multiplyScalar(e.distance)))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.pointers.length,i=this.panState,a=0;e.pointerType==="mouse"&&(a=e.srcEvent.buttons),i&&a===0&&i.buttons!==0&&(a=i.buttons);var o=i==null?void 0:i.target;if(!o){var s=this.relativeClientPosition(e.center),l=new d.Raycaster;l.params.Points={threshold:.1},l.setFromCamera(s,this.camera),l.near=Pa,o=new d.Vector3().copy(l.ray.direction).multiplyScalar(3).add(l.ray.origin);var u=this.models.intersectRaycaster(l)[0];if(!u&&l.ray.direction.y<-.3){var c=new d.Plane(new d.Vector3(0,1,0),0),f=l.ray.intersectPlane(c,new d.Vector3);if(f){var v=f.distanceTo(l.ray.origin);v<1e4&&v>=l.near&&(u={distance:v,floor:0,point:f,object:this.scene})}}if(u)o.copy(u.point);else{var m=new d.Vector3().copy(this.camera.pose.offset).sub(this.camera.position).normalize(),c=new d.Plane().setFromNormalAndCoplanarPoint(m,this.camera.pose.offset);l.ray.intersectPlane(c,o)}}if(e.isFinal?delete this.panState:this.panState={target:o,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var h=r>1||a===2;if(h){var p={x:e.center.x-i.x,y:e.center.y-i.y},g=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),A=zt(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(g),y=new d.Vector3().copy(A).sub(i.target).length();y*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var x=this.renderer.getSize(new d.Vector2),b=2*p.x*y/x.y,w=2*p.y*y/x.y,E=new d.Vector3;if(E.setFromMatrixColumn(this.camera.matrix,0),E.multiplyScalar(-b),g.add(E),this.camera.pose.latitude<is?E.setFromMatrixColumn(this.camera.matrix,1):(E.setFromMatrixColumn(this.camera.matrix,0),E.crossVectors(this.camera.up,E)),E.multiplyScalar(w),g.add(E),this.modelInScreen==="boundingbox-center"){var S=this.models.bounding.clone();S.expandByScalar(this.camera.pose.distance),g.clamp(S.min,S.max)}var M=F(F({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:g,distance:this.camera.pose.distance});if(e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(Q),e.isFinal&&(this.fixFinalState(M),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(Q)),e.isFinal){var R=this.renderer.getSize(new d.Vector2),O=2*e.velocityX*y/R.y,C=2*e.velocityY*y/R.y,P=new d.Vector3,z=new d.Vector3;P.setFromMatrixColumn(this.camera.matrix,0),P.multiplyScalar(-O),z.add(P),this.camera.pose.latitude<is?P.setFromMatrixColumn(this.camera.matrix,1):(P.setFromMatrixColumn(this.camera.matrix,0),P.crossVectors(this.camera.up,P)),P.multiplyScalar(C),z.add(P),this.inMomentumMovement={uuid:Ct()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:z.x,y:z.y,z:z.z},0)}}else{var p={x:e.center.x-i.x,y:e.center.y-i.y},T=this.coordinatesForOffset(p),k=jr(this.cameraMotion.value.longitude+T.longitude),L=he(this.cameraMotion.value.latitude+T.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(L=this.cameraMotion.value.latitude);var M=F(F({},this.currentPano),{mode:this.mode,longitude:k,latitude:L,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&Object.assign(e,{__fixFinalState:!0}),e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(Q):this.cameraMotion.set({longitude:M.longitude,latitude:M.latitude},0).catch(Q),e.isFinal){var V=e.velocityX,U=e.velocityY;this.inMomentumMovement={uuid:Ct()},this.requestMomentumMovement(e,!0,F(F({},this.coordinatesForOffset({x:V,y:U})),{x:0,y:0,z:0}),0)}}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var i=(r=this.pinchState)===null||r===void 0?void 0:r.distance;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,scale:1,distance:this.locationMotion.value.distance};return}if(typeof i!="undefined"){var a=this.models.bounding.getCenter(new d.Vector3),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),s=he(i/e.scale,Ba,1/0),l=e.state.offset.clone().sub(zt(e.state).setLength(s)),u=this.models.bounding.containsPoint(l),c;if(!u&&this.pinchState&&this.pinchState.scale>e.scale&&a.distanceTo(l)>o?c=e.state.distance:(c=s,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=c,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(Q),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)),e.isFinal)){if(!("__fixFinalState"in e)){var f=e.state;this.fixFinalState(e.state);var v={x:f.offset.x,y:f.offset.y,z:f.offset.z,distance:f.distance};this.locationMotion.set(v,0).catch(Q)}delete this.panState,delete this.pinchState}}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(a.near=Pa,a.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=X("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new d.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var f=a.ray.origin.distanceTo(c),v=2*Math.tan(.5*this.camera.fov/180*Math.PI),m=Math.max(f*v/10,1);this.intersectMesh.scale.set(m,m,m);var h=c.clone().add(u);if(this.intersectMesh.lookAt(h),Math.abs(l.y)>.99){var p=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady)if(this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh(),e.isFinal){var r=e.state;if(this.fixFinalState(r),this.emit("gesture.mousewheel",e),e.defaultPrevented)return;var i={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(i,0).catch(Q)}else{var a=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1);if(this.locationMotion.value.distance-a>=Ba){var o=this.locationMotion.value.distance-a;e.state.distance=o}else{var s=zt(this.cameraMotion.value);s.setLength(a),e.state.offset.add(s),this.modelInScreen==="boundingbox-center"&&e.state.offset.clamp(this.models.bounding.min,this.models.bounding.max)}if(this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:e.state.distance,x:e.state.offset.x,y:e.state.offset.y,z:e.state.offset.z},0).catch(Q)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=F(F({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new d.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var l=this.currentTapId=Ct();this.preloadPano(a.pano).then(function(u){r.currentTapId===l&&r.emit("pano.request",X("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.onDblTapGesture=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.state,i=e.center.raycaster,a=i.ray.origin.clone().add(i.ray.direction.clone().setLength(3)),o=1,s=3,l=o,u=this.models.intersectRaycaster(i)[0];if(u&&(a=u.point.clone(),u.distance>(o+s)/2?l=o:l=s),e.state.distance=l,e.state.offset=a,this.emit("gesture.dbltap",e),!e.defaultPrevented){var c={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(c,360).catch(Q),this.hideIntersectMesh()}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(r==="edl"?this.edlEffect.render(this.screenBuffers):r==="hq"?this.hqEffect.render(this.screenBuffers):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t}(Io);function as(n){return n==null}var yv={type:"move"},os=function(){function n(){this._targetRay=null,this._grip=null,this._hand=null,this._axes=[0,0]}return n.prototype.getHandSpace=function(){return this._hand===null&&(this._hand=new d.Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},n.prototype.getTargetRaySpace=function(){return this._targetRay===null&&(this._targetRay=new d.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new d.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new d.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new d.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new d.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new d.Vector3),this._grip},n.prototype.dispatchEvent=function(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this},n.prototype.disconnect=function(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this},n.prototype.getAxes=function(){return this._axes},n.prototype.update=function(t,e,r){var i=null,a=null,o=null,s=this._targetRay,l=this._grip,u=this._hand;if(t&&t.gamepad&&t.gamepad.axes&&(this._axes=[t.gamepad.axes[2],t.gamepad.axes[3]]),t&&e.session.visibilityState!=="visible-blurred")if(s!==null&&(i=e.getPose(t.targetRaySpace,r),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(yv))),u&&t.hand){o=!0;for(var c=0,f=t.hand.values();c<f.length;c++){var v=f[c],m=e.getJointPose(v,r);if(u.joints[v.jointName]===void 0){var h=new d.Group;h.matrixAutoUpdate=!1,h.visible=!1,u.joints[v.jointName]=h,u.add(h)}var p=u.joints[v.jointName];m!==null&&(p.matrix.fromArray(m.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=m.radius),p.visible=m!==null}var g=u.joints["index-finger-tip"],A=u.joints["thumb-tip"],y=g.position.distanceTo(A.position),x=.02,b=.005;u.inputState.pinching&&y>x+b?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&y<=x-b&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,r),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this},n}(),bv=1,xv=function(){function n(t,e,r){var i,a,o,s,l;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0;var u=navigator.userAgent.toLowerCase(),c;u.includes("pico")?c="Pico":u.includes("oculus")?c="Oculus":c="VP",this.machineType=(a=r==null?void 0:r.machineType)!==null&&a!==void 0?a:c,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(o=r==null?void 0:r.referenceSpaceType)!==null&&o!==void 0?o:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(s=r==null?void 0:r.onSessionStart)!==null&&s!==void 0?s:Q,this.onSessionEndCallback=(l=r==null?void 0:r.onSessionEnd)!==null&&l!==void 0?l:Q,this.controllers=[new os,new os],this.inputSourcesMap=new Map,this.cameraVR=new d.ArrayCamera,this.cameraL=new d.PerspectiveCamera,this.cameraR=new d.PerspectiveCamera,this.cameraL.viewport=new d.Vector4,this.cameraR.viewport=new d.Vector4,this.cameraL.layers.enable(1),this.cameraR.layers.enable(2),this.cameraVR.layers.enable(1),this.cameraVR.layers.enable(2),this.isPresenting=!1,this.currentDepthNear=null,this.currentDepthFar=null,this.cameraLPos=new d.Vector3,this.cameraRPos=new d.Vector3}return n.prototype.getController=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getRightController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="right"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getLeftController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="left"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getControllerGrip=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getGripSpace()},n.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},n.prototype.updateCamera=function(t,e){e===null?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)},n.prototype.setProjectionFromUnion=function(t,e,r){this.cameraLPos.setFromMatrixPosition(e.matrixWorld),this.cameraRPos.setFromMatrixPosition(r.matrixWorld);var i=this.cameraLPos.distanceTo(this.cameraRPos),a=e.projectionMatrix.elements,o=r.projectionMatrix.elements,s=a[14]/(a[10]-1),l=a[14]/(a[10]+1),u=(a[9]+1)/a[5],c=(a[9]-1)/a[5],f=(a[8]-1)/a[0],v=(o[8]+1)/o[0],m=s*f,h=s*v,p=i/(-f+v),g=p*-f;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(g),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var A=s+p,y=l+p,x=m-g,b=h+(i-g),w=u*l/y*A,E=c*l/y*A;t.projectionMatrix.makePerspective(x,b,w,E,A,y)},n.prototype.getCamera=function(t){this.cameraVR.near=this.cameraR.near=this.cameraL.near=t.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=t.far,this.session&&(this.currentDepthNear!==this.cameraVR.near||this.currentDepthFar!==this.cameraVR.far)&&(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var e=t.parent,r=this.cameraVR.cameras;this.updateCamera(this.cameraVR,e);for(var i=0;i<r.length;i++)this.updateCamera(r[i],e);t.matrixWorld.copy(this.cameraVR.matrixWorld);for(var a=t.children,i=0,o=a.length;i<o;i++)a[i].updateMatrixWorld(!0);return r.length===2?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},n.prototype.updateInputSources=function(t){if(!this.session){console.warn("session is lose!");return}for(var e=this.session.inputSources,r=0;r<this.controllers.length;r++)this.inputSourcesMap.set(e[r],this.controllers[r]);for(var r=0;r<t.removed.length;r++){var i=t.removed[r],a=this.inputSourcesMap.get(i);a&&(a.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(var r=0;r<t.added.length;r++){var i=t.added[r],a=this.inputSourcesMap.get(i);a&&a.dispatchEvent({type:"connected",data:i})}},n.prototype.onSessionEvent=function(t){var e=this.inputSourcesMap.get(t.inputSource);e&&e.dispatchEvent({type:t.type})},n.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach(function(t,e){t.disconnect(e)}),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,lt.shared.setContext(null),this.onSessionEndCallback()},n.prototype.onRequestReferenceSpace=function(t){this.referenceSpace=t,this.isPresenting=!0,this.session&&this.onSessionStartCallback(this.session)},n.prototype.setSession=function(t){var e=this;if(this.session=t,this.session){this.session.addEventListener("select",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectstart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeeze",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezestart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezeend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("end",function(i){e.onSessionEnd()});var r=this.gl.getContextAttributes();this.gl.makeXRCompatible().then(function(){var i={antialias:r==null?void 0:r.antialias,alpha:r==null?void 0:r.alpha,depth:r==null?void 0:r.depth,stencil:r==null?void 0:r.stencil,framebufferScaleFactor:bv};if(!e.session){console.error("session is lose while set session!");return}switch(e.machineType){case"Pico":case"VP":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;case"Oculus":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;default:e.machineType;break}e.session.requestReferenceSpace(e.referenceSpaceType).then(function(a){e.onRequestReferenceSpace(a)}),e.session.addEventListener("inputsourceschange",function(a){e.updateInputSources(a)})})}},n}(),ko=function(n){se(t,n);function t(){var e=n.call(this)||this;e.type="LineSegmentsGeometry";var r=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],a=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(a),e.setAttribute("position",new d.Float32BufferAttribute(r,3)),e.setAttribute("uv",new d.Float32BufferAttribute(i,2)),e}return t.prototype.applyMatrix4=function(e){var r=this.attributes.instanceStart,i=this.attributes.instanceEnd;return r!==void 0&&(r.applyMatrix4(e),i.applyMatrix4(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},t.prototype.setPositions=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new d.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new d.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new d.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},t.prototype.setColors=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new d.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new d.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new d.InterleavedBufferAttribute(i,3,3)),this},t.prototype.fromWireframeGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromEdgesGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromMesh=function(e){return this.fromWireframeGeometry(new d.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof d.Geometry){var i=new d.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof d.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new d.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=new d.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(r),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new d.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var a=0,o=new d.Vector3,s=0,l=e.count;s<l;s++)o.fromBufferAttribute(e,s),a=Math.max(a,i.distanceToSquared(o)),o.fromBufferAttribute(r,s),a=Math.max(a,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(d.InstancedBufferGeometry);Object.assign(ko.prototype,{isLineSegmentsGeometry:!0});var Ra={uniforms:d.UniformsUtils.merge([d.UniformsLib.common,d.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new d.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
1962
1962
  #include <common>
1963
1963
  #include <color_pars_vertex>
1964
1964
  #include <fog_pars_vertex>
@@ -2157,7 +2157,7 @@ void main() {
2157
2157
  #include <premultiplied_alpha_fragment>
2158
2158
 
2159
2159
  }
2160
- `},Lo=function(n){se(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(Ra.uniforms),vertexShader:Ra.vertexShader,fragmentShader:Ra.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(i){this.uniforms.diffuse.value=i}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(i){this.uniforms.linewidth.value=i}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(i){this.uniforms.dashScale.value=i}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(i){this.uniforms.dashSize.value=i}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(i){this.uniforms.gapSize.value=i}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(i){this.uniforms.opacity.value=i}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(i){this.uniforms.resolution.value.copy(i)}}}),r.setValues(e),r}return t}(d.ShaderMaterial);Object.assign(Lo.prototype,{isLineMaterial:!0});var Yu=function(n){se(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new ko,i.material=r!==void 0?r:new Lo({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,a=new Float32Array(2*r.count),o=new d.Vector3,s=new d.Vector3,l=0,u=0,c=r.count;l<c;l++,u+=2)o.fromBufferAttribute(r,l),s.fromBufferAttribute(i,l),a[u]=u===0?0:a[u-1],a[u+1]=a[u]+o.distanceTo(s);var f=new d.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new d.InterleavedBufferAttribute(f,1,0)),e.setAttribute("instanceDistanceEnd",new d.InterleavedBufferAttribute(f,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,l=this.material,u=l.resolution,c=l.linewidth,f=s.attributes.instanceStart,v=s.attributes.instanceEnd,m=new d.Vector4,h=new d.Vector4,p=new d.Vector4,g=new d.Vector3,A=new d.Matrix4,y=new d.Line3,x=new d.Vector3;i.at(1,p),p.w=1,p.applyMatrix4(a.matrixWorldInverse),p.applyMatrix4(o),p.multiplyScalar(1/p.w),p.x*=u.x/2,p.y*=u.y/2,p.z=0,g.copy(p);var b=this.matrixWorld;A.multiplyMatrices(a.matrixWorldInverse,b);for(var w=0,E=f.count;w<E;w++){m.fromBufferAttribute(f,w),h.fromBufferAttribute(v,w),m.w=1,h.w=1,m.applyMatrix4(A),h.applyMatrix4(A),m.applyMatrix4(o),h.applyMatrix4(o),m.multiplyScalar(1/m.w),h.multiplyScalar(1/h.w);var S=m.z<-1&&h.z<-1,M=m.z>1&&h.z>1;if(!(S||M)){m.x*=u.x/2,m.y*=u.y/2,h.x*=u.x/2,h.y*=u.y/2,y.start.copy(m),y.start.z=0,y.end.copy(h),y.end.z=0;var R=y.closestPointToPointParameter(g,!0);y.at(R,x);var O=d.MathUtils.lerp(m.z,h.z,R),C=O>=-1&&O<=1,P=g.distanceTo(x)<c*.5;if(C&&P){y.start.fromBufferAttribute(f,w),y.end.fromBufferAttribute(v,w),y.start.applyMatrix4(b),y.end.applyMatrix4(b);var z=new d.Vector3,T=new d.Vector3;i.distanceSqToSegment(y.start,y.end,T,z),r.push({point:T,pointOnLine:z,distance:i.origin.distanceTo(T),object:this,faceIndex:w})}}}},t}(d.Mesh);Object.assign(Yu.prototype,{isLineSegments2:!0});var $u=function(n){se(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(Yu);Object.assign($u.prototype,{isLine2:!0});var el=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof d.Geometry){var i=new d.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof d.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(ko);Object.assign(el.prototype,{isLineGeometry:!0});var wv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",ss=14467195,Ev=8,Cv=2,Sv=20,us=null,$a=function(n){se(t,n);function t(e,r){e===void 0&&(e=new d.Vector3),r===void 0&&(r=new d.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var a=new el,o=new Lo({color:ss,linewidth:Cv,dashScale:Sv,dashed:!1});i.line=new $u(a,o);var s=new d.BufferGeometry,l=new d.PointsMaterial({color:ss,size:Ev,map:us||(us=new d.TextureLoader().load(wv)),sizeAttenuation:!1,transparent:!0});return i.points=new d.Points(s,l),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,r),i.add(i.line,i.points),i}return Object.defineProperty(t,"version",{get:function(){return"6.3.0-alpha.5"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new d.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new d.Vector3(e[0],e[1],e[2]),new d.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];i==="dashed"?(r.dashed=a,a?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var i=this.line.material.resolution;(i.x!==e||i.y!==r)&&(i.set(e,r),this.needsRender=!0)},t}(d.Object3D);Object.assign($a.prototype,{isFiveLine:!0});var Xe={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function tl(n){return Di(this,void 0,void 0,function(){var t;return Ni(this,function(e){switch(e.label){case 0:return[4,fetch(n)];case 1:if(t=e.sent(),t.ok)return[2,t.json()];throw new Error(t.statusText)}})})}function Mv(n){return Di(this,void 0,void 0,function(){var t,e;return Ni(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,tl("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function Iv(n,t){return Di(this,arguments,void 0,function(e,r,i,a){var o,s,l,u,c,f;return i===void 0&&(i=null),a===void 0&&(a=!0),Ni(this,function(v){switch(v.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,Mv(r)];case 1:if(o=v.sent(),e.profiles.some(function(m){var h=o[m];return h&&(s={profileId:m,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");if(l=o[i],!l)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));s={profileId:i,profilePath:"".concat(r,"/").concat(l.path),deprecated:!!l.deprecated}}return[4,tl(s.profilePath)];case 2:if(u=v.sent(),a){if(f=void 0,f=u.layouts[e.handedness],!f)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(s.profileId));f.assetPath&&(c=s.profilePath.replace("profile.json",f.assetPath))}return[2,{profile:u,assetPath:c}]}})})}var Tv={xAxis:0,yAxis:0,button:0,state:Xe.ComponentState.DEFAULT};function Pv(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,i=Math.sqrt(n*n+t*t);if(i>1){var a=Math.atan2(t,n);e=Math.cos(a),r=Math.sin(a)}var o={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return o}var Bv=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Xe.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(Tv)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=Pv(e,r),s=o.normalizedXAxis,l=o.normalizedYAxis;switch(this.componentProperty){case Xe.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case Xe.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?l:.5;break;case Xe.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case Xe.ComponentProperty.STATE:this.valueNodeProperty===Xe.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),Rv=function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(i){var a=new Bv(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Xe.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=F({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Xe.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){var r=t.buttons[this.gamepadIndices.button];this.values.button=r.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,r.pressed||this.values.button===1?this.values.state=Xe.ComponentState.PRESSED:(r.touched||this.values.button>Xe.ButtonTouchThreshold)&&(this.values.state=Xe.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Xe.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Xe.AxisTouchThreshold&&(this.values.state=Xe.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Xe.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Xe.AxisTouchThreshold&&(this.values.state=Xe.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),Fv=function(){function n(t,e,r){var i=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(a){var o=i.layoutDescription.components[a];i.components[a]=new Rv(a,o)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n}(),kv="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Lv="generic-trigger",Ov=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(i){i instanceof d.Mesh&&i.isMesh&&(i.material.envMap=r.envMap,i.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(i){var a=i.valueNode,o=i.minNode,s=i.maxNode,l=i.value,u=i.valueNodeProperty;a&&(u===Xe.VisualResponseProperty.VISIBILITY?a.visible=l:u===Xe.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,l),a.position.lerpVectors(o.position,s.position,l)))})}))},t}(Nn.Object3D);function zv(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===Xe.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Nn.SphereGeometry(.001),s=new Nn.MeshBasicMaterial({color:255}),l=new Nn.Mesh(o,s);e.touchPointNode.add(l)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(u){var c=u.valueNodeName,f=u.minNodeName,v=u.maxNodeName,m=u.valueNodeProperty;if(m===Xe.VisualResponseProperty.TRANSFORM){if(u.minNode=t.getObjectByName(f),u.maxNode=t.getObjectByName(v),!u.minNode){console.warn("Could not find ".concat(f," in the model"));return}if(!u.maxNode){console.warn("Could not find ".concat(v," in the model"));return}}u.valueNode=t.getObjectByName(c),u.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function ls(n,t){zv(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof d.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var Vv=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=kv,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new Ov,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||Iv(o,e.path,Lv).then(function(s){var l=s.profile,u=s.assetPath;r.motionController=new Fv(o,l,u);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),ls(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(f){e._assetCache[r.motionController.assetUrl]=f,i=f.scene.clone(),ls(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function Dv(n,t){return n}var cs=300,Nv=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),ds=new d.Vector3(-1,1,1),Qv=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new xv(r.renderer,r.renderer.getContext(),{onSessionStart:function(l){r.emit("xr.session.start",X("xr.session.start",{session:l,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",X("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new d.Raycaster,right:new d.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new $a,right:new $a},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new d.Group,new d.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var o=new Vv;o.gltfLoader={load:function(l,u){Ti.ajax(l,{responseType:"arraybuffer"}).then(function(c){var f;return vo(c.body,{resourcePath:l.slice(0,l.lastIndexOf("/")+1),search:(f=l.split("?")[1])!==null&&f!==void 0?f:"",fetcher:Ti})}).then(function(c){return u(c)})}},(r.xrManager.machineType==="Oculus"||r.xrManager.machineType==="Pico")&&r.scene.add(r.pointerLines.left,r.pointerLines.right,r.controllerWrappers[0],r.controllerWrappers[1]),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=Ct()]={panoId:De(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new d.Matrix4},r.parallaxCameraMatrixs=[];var s=lt.shared.getContext();return s?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(s),r.on("xr.session.start",function(){var l=r.xrManager.getControllerGrip(0);l.add(o.createControllerModel(l)),r.controllerWrappers[0].add(l);var u=r.xrManager.getControllerGrip(1);u.add(o.createControllerModel(u)),r.controllerWrappers[1].add(u)}),r.xrHandleState={LeftAxesUp:{touchStartTime:0,touchStart:!1},LeftAxesDown:{touchStartTime:0,touchStart:!1},LeftAxesLeft:{touchStartTime:0,touchStart:!1},LeftAxesRight:{touchStartTime:0,touchStart:!1},LeftTrigger:{touchStartTime:0,touchStart:!1},LeftPinch:{touchStartTime:0,touchStart:!1},RightAxesUp:{touchStartTime:0,touchStart:!1},RightAxesDown:{touchStartTime:0,touchStart:!1},RightAxesLeft:{touchStartTime:0,touchStart:!1},RightAxesRight:{touchStartTime:0,touchStart:!1},RightTrigger:{touchStartTime:0,touchStart:!1},RightPinch:{touchStartTime:0,touchStart:!1},Y:{touchStartTime:0,touchStart:!1},X:{touchStartTime:0,touchStart:!1},A:{touchStartTime:0,touchStart:!1},B:{touchStartTime:0,touchStart:!1}},r.xrManager.machineType==="VP"&&r.initHandEvent(),r):(console.error("获取session失败,请退出重试"),r)}return t.parseArgs=function(e){if(e instanceof t)return e;var r=F(F({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return F(F({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,l,u,c=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoIndex");var v=Jn(f.images.up),m=this.imageOptions.size;typeof m=="undefined"&&f&&v&&(m=Number(v)),typeof m=="undefined"&&(m=2048);var h=this.imageOptions.transform,p=function(C,P){return Dv(on(C,h,P))},g=F({key:"pano.".concat(f.panoId)},Vt(this.imageOptions,["format","size","quality"])),A=f.images,y=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(C){return C.size>m}))!==null&&l!==void 0?l:null,x="pano:"+yo([A,g,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===x)return;var b=this.pendingTextureTask.panoId;(u=this.panoMeshes[b])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",X("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano}))}var w=this.models.getMaterial()||{},E=w.pano0,S=w.pano1,M;if((E==null?void 0:E.map.name)===x?M=E:(S==null?void 0:S.map.name)===x&&(M=S),M){var R={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:M.map,luminanceMap:M.luminanceMap,matrix:new d.Matrix4().compose(f.position,f.quaternion,ds)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};this.doMoveToPano(f.pano,R,r);return}var O="move-to-pano-"+f.panoId;this.pending.add(O),this.pendingTextureTask={panoId:f.panoId,hash:x,onLoad:function(C){if(a.pending.delete(O),a.destroyed)C.body.dispose();else{C.body.name=x;var P={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:C.body,luminanceMap:null,matrix:new d.Matrix4().compose(f.position,f.quaternion,ds)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};a.doMoveToPano(f.pano,P,r)}},onError:function(C){a.pending.delete(O);var P=F(F(F({},f.pano),{mode:a.mode}),je(a.camera.pose));a.emit("pano.error",X("pano.error",{error:C,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:P})),a.emit("pano.cancel",X("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:P})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(A,y,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:g},format:d.RGBAFormat,minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(C){var P,z;a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:C,meta:null,pano:f.pano})),((P=a.pendingTextureTask)===null||P===void 0?void 0:P.hash)===x&&((z=a.panoMeshes[f.panoId])===null||z===void 0||z.setProgress(C))},this.renderer):this.textureLoader.loadCubeTexture(A,{imageURL:{transform:p,options:g},format:d.RGBAFormat,fetcher:it(f.work)},void 0,void 0,function(C){var P,z;((P=a.pendingTextureTask)===null||P===void 0?void 0:P.hash)===x&&((z=a.panoMeshes[f.panoId])===null||z===void 0||z.setProgress(C)),a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:C,meta:null,pano:f.pano}))},this.renderer)]).then(function(C){var P,z,T=C[0];((P=a.pendingTextureTask)===null||P===void 0?void 0:P.hash)===x?(a.pendingTextureTask.onLoad(T),(z=a.panoMeshes[f.panoId])===null||z===void 0||z.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",X("pano.texture.success",{error:null,progress:1,meta:T.meta,pano:f.pano}))):T.body.dispose()}).catch(function(C){var P,z;((P=a.pendingTextureTask)===null||P===void 0?void 0:P.hash)===x&&(a.pendingTextureTask.onError(C),(z=a.panoMeshes[f.panoId])===null||z===void 0||z.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",X("pano.texture.error",{error:C,progress:0,meta:null,pano:f.pano})),a.emit("error",C))}),this.emit("pano.texture.load",X("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,l,u,c,f,v,m,h,p;i===void 0&&(i={});var g=Ce(),A=Ct();this.panoResources[A]=r;var y=1,x,b,w;if(this.locationMotion.ended){var E=this.locationMotion.getKeyFrameSegment(g);E[0];var S=E[1],M=this.locationMotion.value,R=this.panoResourceFromLocationMotionKeyframe(S).position,O=r.position;x=Math.max(R.distanceTo(O),y),b=[{key:S.key,progress:0,value:F(F({},M),{count:0})},{key:A,progress:1,value:{distance:0,count:1}}],w=0}else{var C=this.locationMotion.getKeyFrameSegment(g),P=C[0],S=C[1],M=this.locationMotion.value,z=this.panoResourceFromLocationMotionKeyframe(P).position,R=this.panoResourceFromLocationMotionKeyframe(S).position,O=r.position,T=S.value.count-M.count,k=Math.max(z.distanceTo(R),y)*T,L=Math.max(R.distanceTo(O),y);x=k+L,b=[{key:P.key,progress:0,value:F({},M)},{key:S.key,progress:k/x,value:S.value},{key:A,progress:1,value:{count:S.value.count+1,distance:0}}];var V=this.locationMotionKeyframesLength(this.locationMotion.keyframes),U=this.locationMotionKeyframesLength(b);w=this.locationMotion.getProgressVelocity(g)*V/U}var q=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?x:0),N={longitude:i.longitude,latitude:i.latitude,fov:i.fov},H=F(F({},e),{mode:this.mode,longitude:(o=N.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=N.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=N.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:0}),J=this.currentPano;if(this.emit("pano.moveTo",X("pano.moveTo",{options:i,prevPano:J,progress:0,state:H,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(H),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=Q,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(N,q).catch(Q);else{var j=zt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),_=zt({longitude:(u=N.longitude)!==null&&u!==void 0?u:this.cameraMotion.value.longitude,latitude:(c=N.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),Z=new d.Object3D;Z.lookAt(j);var W=new d.Matrix4().makeRotationFromQuaternion(Z.quaternion);Z.lookAt(_);var ee=new d.Matrix4().makeRotationFromQuaternion(Z.quaternion),Y=new d.Matrix4().getInverse(W).premultiply(ee),ne=this.cameraMotion.value.fov,te=(f=N.fov)!==null&&f!==void 0?f:this.cameraMotion.value.fov,ue=1;r.effect==="zoomin"?ue=1.5:r.effect==="zoomout"&&(ue=.4);for(var ie=te*ue,ye=0;ye<b.length-1;ye++){var fe=b[ye].key;if(fe){var Ae=this.panoResources[fe];Ae&&(Ae.fixCameraTransform.copy(Y),Ae.leftPanoPicture&&(Ae.leftPanoPicture.zoom=Math.tan(ne/2/180*Math.PI)/Math.tan(ie/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(v=N.longitude)!==null&&v!==void 0?v:this.cameraMotion.value.longitude,latitude:(m=N.latitude)!==null&&m!==void 0?m:this.cameraMotion.value.latitude,fov:ie}},{progress:1,value:{longitude:(h=N.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(p=N.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude,fov:te}}],q).catch(Q)}var Pe=this.locationMotion.setKeyframes(b,q,w);Pe.then(function(){for(var we,Me,re,ae=0,G=a.models;ae<G.length;ae++){var Fe=G[ae];Fe.show()}var ke=F(F({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",X("pano.arrived",{options:i,prevPano:J,progress:1,state:ke,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(ke);var Te=a.works.getResolvedObserver(a.currentPano);if(Te&&Te.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ge=Nv.clone().multiply((re=(Me=(we=a.models.getMaterial())===null||we===void 0?void 0:we.pano1)===null||Me===void 0?void 0:Me.matrix)!==null&&re!==void 0?re:new d.Matrix4).multiply(Te.video.matrix),be={map:a.videoTexture,size:Te.video.size,matrix:Ge,alpha:1},ve=Ct(),xe=a.videoTexture.image;xe.setAttribute("uuid",ve),Uu().then(function(ge){ge&&Te.video&&xe.getAttribute("uuid")===ve&&(xe.oncanplay=function(){xe.oncanplay=Q,xe.play()},xe.ontimeupdate=function(){xe.currentTime>.5&&(xe.ontimeupdate=Q,a.panoVideo.setMaterial(be))},xe.src=Te.video.source)}).catch(function(){xe.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",X("pano.cancel",{options:i,prevPano:J,progress:0,state:H,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var l=this.camera.getDirection(new d.Vector3).setY(0),u=null,c=this.works.getResolvedObserver(this.currentPano);if(!c)return null;var f=c.accessibleIds.filter(function(_){var Z=At(_);if(Yt(Z,r.currentPano))return!1;var W=r.works.getResolvedObserver(Z);return!W||W.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:W.loadable||W.active}),v=this.models.intersectRaycaster(e)[0];if(v){var m=dr(f,function(_){var Z=r.works.getResolvedObserver(_);if(!Z)return 1/0;var W=Z.standingPosition.clone();return W.distanceTo(v.point)},!0),h=m[0],p=m[1];h&&p<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(as(u)){var g=this.getForwardObserverOrNot(e);g&&(u=g)}for(var A=0,y=this.locationMotion.keyframes;A<y.length;A++){var x=y[A],b=this.panoResourceFromLocationMotionKeyframe(x);if(!(x.progress<this.locationMotion.progress)&&u&&b.panoId===u.panoId){u=null;break}}if(as(u))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(u&&!u.active){var w=u.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var E={};if(u){for(var S=Math.PI/6,M=Math.PI/12,R=new d.Vector3(0,1,0),O=u.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),C=O.clone().applyAxisAngle(R,S),P=O.clone().applyAxisAngle(R,-S),z=[],T=[],k=[],L=0,V=u.accessibleIds;L<V.length;L++){var h=V[L],U=At(h);if(!(Yt(U,this.currentPano)||Yt(U,u.pano))){var q=this.works.getResolvedObserver(h);if(q){var N=q.position.clone().sub(u.position).setY(0);O.angleTo(N)<S?k.push(N):C.angleTo(N)<S?z.push(N):P.angleTo(N)<S&&T.push(N)}}}var H=k.length>0?k:Et(Et([],z,!0),T,!0),J=H.slice().sort(function(_,Z){return _.angleTo(O)-Z.angleTo(O)})[0];J&&J.angleTo(l)>M&&(E.longitude=Math.atan2(-J.x,-J.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=he(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var j={workCode:u.pano.workCode,panoIndex:u.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:u?u.position.clone():new d.Vector3};return this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:j,userAction:!0,options:E,progress:0,error:null})),u&&u.active?(this.emit("pano.request",X("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:j,options:E,error:null})),u.pano):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var i=this,a,o,s,l,u,c,f,v,m=[],h=2;h<arguments.length;h++)m[h-2]=arguments[h];this.userAction=!0;var p={},g={},A=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),x=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),w=b[0],E=b[1],S=this.panoResourceFromLocationMotionKeyframe(w),M=this.panoResourceFromLocationMotionKeyframe(E),R=new d.Vector3().copy(S.position),O=new d.Vector3().copy(M.position),C=this.locationMotion.value.count-E.value.count+1;p.progress=C,M.leftPanoPicture&&(C<1?S.leftPanoPicture&&(p.pano0=S.leftPanoPicture):p.pano0=M.leftPanoPicture,p.pano1=M.leftPanoPicture),M.effect==="montage"?p.transition="BLACK":M.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(M.effect==="zoomin"||M.effect==="zoomout")&&(p.progress=Math.pow(C,3)),C<1&&M.effect!=="fly"&&(p.pano0&&S.leftPanoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:S.leftPanoPicture.matrix.clone().setPosition(M.position)}),R.copy(O),x=!0),g.distance=this.locationMotion.value.distance,g.offset=new d.Vector3(R.x+(O.x-R.x)*C,R.y+(O.y-R.y)*C,R.z+(O.z-R.z)*C);for(var P=[],z=[],T=0,k=this.locationMotion.keyframes;T<k.length;T++){var L=k[T],V=L.key,U=L.progress;V!==void 0&&(P.push(V),U>this.locationMotion.progress&&z.push(V))}for(var q=0,N=Object.keys(this.panoResources);q<N.length;q++){var H=N[q];if(!(z.indexOf(H)>=0)){var J=this.panoResources[H];if(J.leftPanoPicture){var j=J.leftPanoPicture.map;if(j){if(j===((a=p.pano0)===null||a===void 0?void 0:a.map)||j===((o=p.pano1)===null||o===void 0?void 0:o.map))continue;j instanceof Ve&&j.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(j.cubeRenderTarget),j.dispose(),J.leftPanoPicture=null}}P.indexOf(H)>=0||delete this.panoResources[H]}}this.currentPano=At(M.panoId),this.emit("pano.moving",X("pano.moving",{userAction:this.userAction,prevPano:At(A.panoId),state:F(F(F(F({},At(y.panoId)),{mode:this.mode}),je(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}qt(p)===!1&&(!((s=p.pano0)===null||s===void 0)&&s.map&&p.pano0.map instanceof Ve&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=p.pano1)===null||l===void 0)&&l.map&&p.pano1.map instanceof Ve&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(p)),qt(g)===!1&&this.setCamera(g);var _=this.works.getResolvedObserver(this.currentPano),Z=m[1];if(!Z){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var W=this.xrManager.referenceSpace;if(W){var ee=this.xrManager.cameraVR,Y=this.xrManager.cameraL,ne=this.xrManager.cameraR,te=[Y,ne],ue=Z.getViewerPose(W),ie=new d.Vector3(0,0,0);if(ue){var ye;ye=this.xrManager.session.renderState.baseLayer;var fe=ue.views;if(!ye){console.error("no layer found");return}this.renderer.setFramebuffer(ye.framebuffer);var Ae=!1;fe.length!==ee.cameras.length&&(ee.cameras.length=0,Ae=!0),this.parallaxCameraMatrixs=[];var Pe=new d.Vector3,we=new d.Vector3;new d.Matrix4().fromArray(fe[0].transform.matrix).decompose(Pe,new d.Quaternion,new d.Vector3),new d.Matrix4().fromArray(fe[1].transform.matrix).decompose(we,new d.Quaternion,new d.Vector3),we.clone().sub(Pe).normalize();var Me=new d.Vector3,re=new d.Quaternion,ae=new d.Vector3;this.camera.matrix.decompose(Me,re,ae);for(var G=0;G<fe.length;G++){var Fe=fe[G],ke=ye.getViewport(Fe),Te=te[G];Te.matrix.fromArray(Fe.transform.matrix);var Ge=new d.Vector3,be=new d.Quaternion,ve=new d.Vector3;Te.matrix.decompose(Ge,be,ve),ie.copy(Me),Te.position.copy(Me),Te.quaternion.copy(be),Te.scale.copy(ve),Te.updateMatrix(),Te.projectionMatrix.fromArray(Fe.projectionMatrix),Te.viewport.set(ke.x,ke.y,ke.width,ke.height),Ae===!0&&ee.cameras.push(Te)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var G=0;G<this.xrManager.session.inputSources.length;G++)if(this.xrManager.session.inputSources[G]&&this.xrManager.session.inputSources[G].targetRayMode==="transient-pointer"){var xe=Z.getPose(this.xrManager.session.inputSources[G].targetRaySpace,W);if(xe){var ge=new d.Vector3(0,0,-1).applyQuaternion(xe.transform.orientation),me=new d.Raycaster(this.camera.position,ge);this.gazeRay=me}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Qe=this.xrManager.session.inputSources,G=0;G<Qe.length;G++){var Ke=this.xrManager.controllers[G],rt=Qe[G];if(rt){Ke&&Ke.update(rt,Z,W);var me=this.xrManager.getController(G),Xr=new d.Vector3(0,1.2,0),Le=me.position.clone().add(ie).sub(Xr);rt.handedness==="left"?this.xrControllerRay.left.set(Le,new d.Vector3(0,0,-1).applyEuler(me.rotation)):rt.handedness==="right"&&this.xrControllerRay.right.set(Le,new d.Vector3(0,0,-1).applyEuler(me.rotation)),this.controllerWrappers[G].position.copy(new d.Vector3(0,0,0).add(ie).sub(Xr));var Ze=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ze.length===0&&(Ze=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(Tr){var Zr;return F({floor:(Zr=_==null?void 0:_.floorIndex)!==null&&Zr!==void 0?Zr:0},Tr)})),Ze.length>=1&&Ze[0].face)if(rt.handedness==="right"){var ot=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),tr=Ze[0].face.normal,dn=tr.clone(),rr=Ze[0].point.clone();this.intersectMesh.position.copy(rr);var Tt=rr.clone().add(dn);if(this.intersectMesh.lookAt(Tt),Math.abs(tr.y)>.99){var nr=this.camera.position.clone().sub(rr);this.intersectMesh.rotation.z=-Math.atan2(nr.z,nr.x)}this.intersectMesh.visible=!0,this.needsRender=!0,ot.length>0?(this.pointerLines.right.setPoints(Le,ot[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(Le,Ze[0].point));var Mr=Ze[0],Ht=X("intersect.update",{raycaster:(u=this.xrControllerRay.right)!==null&&u!==void 0?u:null,intersection:Mr!=null?Mr:null,object:this.intersectMesh});if(this.emit("intersect.update",Ht),Ht.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(Le,Ze[0].point)}}this.updateControllerHelper(Qe,e,r)}if(this.camera.pose.distance>.1||x)for(var ir=0,Ut=Object.keys(this.panoMeshes);ir<Ut.length;ir++){var ct=Ut[ir],Oe=this.panoMeshes[ct];Oe.setOpacity(0),Oe.setCurrent(!1),Oe.updateTime&&Oe.updateTime(e,r),Oe.visible=!1}else if(_){var hr=dr(_.visibleIds,function(dt){var Jt=i.works.getResolvedObserver(dt);return Jt?_.standingPosition.distanceTo(Jt.standingPosition):1/0},!0),gt=hr[1];gt=he(gt,2.5,1/0);for(var pr=_.visibleIds.concat(De(this.currentPano)),vr=this.getForwardObserverOrNot(),Gt=this.camera.getDirection(new d.Vector3),St=0,Ar=Object.keys(this.panoMeshes);St<Ar.length;St++){var ct=Ar[St],Oe=this.panoMeshes[ct],Ir=this.works.getResolvedObserver(ct);if(pr.indexOf(ct)===-1)Oe.setCurrent(!1),Oe.setOpacity(0);else if(!Ir)Oe.setCurrent(!1),Oe.setOpacity(0);else if(!Ir.loadable&&!Ir.active)Oe.setCurrent(!1),Oe.setOpacity(0);else{var fn=Oe.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Oe.setCurrent(!Oe.loading&&Oe.progress===0&&vr!==null&&vr.panoId===ct),Oe.setOpacity(fn<.01?0:he(gt/fn*1.2,.65,.98));var _r=this.camera.position.clone().setY(Oe.position.y),ge=new d.Vector3().copy(Oe.position).sub(_r).normalize();if(ct===De(this.currentPano)){var Wr=he((.5-_r.distanceTo(Oe.position))/.5,0,1);ge.multiplyScalar(1-Wr).add(Gt.clone().multiplyScalar(Wr))}ge.length()>0&&Oe.quaternion.setFromEuler(new d.Euler(0,Math.atan2(ge.x,ge.z),0))}Oe.updateTime&&Oe.updateTime(e,r)}}var Kt=function(){return 4}(),Ye=function(){var dt=new d.PerspectiveCamera;dt.applyMatrix4(ee.matrix),dt.position.set(0,0,0);var Jt=i.works.getResolvedObserver(y.panoId),Tr=Jt!=null?Jt:_;Tr&&dt.quaternion.premultiply(Tr.quaternion.clone().inverse()),dt.updateProjectionMatrix(),dt.updateMatrixWorld(!0);var Zr=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(dt.projectionMatrix,dt.matrixWorldInverse));return Zr}();y.panoId===De(this.currentPano)&&((c=y.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof Ve&&(y.leftPanoPicture.map.maxRequest=this.tileMaxRequest,y.leftPanoPicture.map.update(Ye,Kt),y.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var He=this.tiling.object.visible;if(this.initAnimationed){var nt=y.panoId,yt=this.works.getResolvedObserver(nt);yt?ii(this.camera.position,yt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==nt&&this.tiling.cleanup(),this.tiling.panoId=nt,this.tiling.setResource((v=(f=yt.images)===null||f===void 0?void 0:f.tiles)!==null&&v!==void 0?v:[],this.enableIOSEDR&&yt.images.luminance?yt.images.luminance:null),this.tiling.setFetcher(it(yt.work)),this.tiling.setRotation(yt.quaternion),this.tiling.setPosition(yt.position),this.tiling.maxRequest=this.tileMaxRequest,Kt>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Ye,Kt,e):this.tiling.update(Ye,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;He!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},l=0;l<e.length;l++){var u=e[l].handedness,c=e[l].gamepad;switch(u){case"left":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"LeftAxesDown",r)),c!=null&&c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"X",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"Y",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"LeftTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"LeftPinch",r));var f={raycaster:a,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.buttons.X=c.buttons&&c.buttons[4]?c.buttons[4].pressed:!1,s.buttons.Y=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.LeftTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.LeftPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1,s.left=f;break;case"right":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"RightAxesDown",r)),c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"A",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"B",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"RightTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"RightPinch",r));var v={raycaster:o,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.right=v,s.buttons.A=c.buttons&&c.buttons[4]?c==null?void 0:c.buttons[4].pressed:!1,s.buttons.B=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.RightTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.RightPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",X("xr.controller.update",s))}},t.prototype.emitHandleEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=i,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",X("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}));else{var s=i-this.xrHandleState[r].touchStartTime;s>cs&&this.emit("xr.gesture.press",X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",X("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));var s=i-this.xrHandleState[r].touchStartTime;if(s<=cs){var l=X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}),u=this.emit("xr.gesture.tap",l);!u&&!l.defaultPrevented&&r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[r].touchStart=!1,this.xrHandleState[r].touchStartTime=0}},t.prototype.initHandEvent=function(){var e=this;if(!this.xrManager.session)throw new Error("初始化失败");this.xrManager.session.addEventListener("select",function(r){e.gazeRay&&e.checkSelectedPano(e.gazeRay)})},t}(Bo),Rt={Floorplan:Ya,Topview:fp,Panorama:Bo,VRPanorama:av,Model:sv,Mapview:gv,XRPanorama:Qv},rl=["gesture.pan","gesture.tap","gesture.dbltap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function qv(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=zt(t.state);e.setLength(t.state.distance);var r=t.state.offset.clone().sub(e);n.emit("cameraPositionUpdate",r,t.userAction),n.emit("cameraUpdate",t.state,t.userAction)}),n.on("intersect.update",function(t){if(t.intersection){var e=!1;e=n.emit("wantsShowIntersectionOnModel",t.raycaster),e&&t.preventDefault(),t.defaultPrevented||n.emit("intersectionOnModelUpdate",t.intersection,t.object)}else n.emit("intersectionHidden")}),n.on("pano.request",function(t){var e=n.emit("wantsMoveToPano",t.state.panoIndex,t.options,t.userAction);e||(e=n.emit("wantsToMoveToPano",t.state.panoIndex,t.options,t.userAction)),e&&t.preventDefault(),t.defaultPrevented||n.emit("panoWillLoad",t.state.panoIndex)}),n.on("pano.select",function(t){n.emit("panoSelected",t.state.panoIndex)}),n.on("pano.moveTo",function(t){n.emit("panoLoaded",t.state.panoIndex),n.emit("moveToPano",t.state.panoIndex,t.userAction),n.emit("panoWillArrive",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.moving",function(t){n.emit("movingToPano",t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),n.on("pano.arrived",function(t){n.emit("panoArrived",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.cancel",function(t){n.emit("moveToPanoCanceled",t.state.panoIndex)}),n.on("pano.error",function(t){n.emit("panoLoadError",t.error,t.state.panoIndex)}),n.on("pano.texture.load",function(t){n.emit("textureStartLoad",t.pano.panoIndex)}),n.on("pano.texture.success",function(t){n.emit("textureLoaded",t.pano.panoIndex,t.meta)}),n.on("pano.texture.error",function(t){n.emit("textureError",t.error,t.pano.panoIndex)}),n.on("pano.texture.abort",function(t){n.emit("textureAbort",t.pano.panoIndex)}),n.on("pano.texture.progress",function(t){n.emit("textureLoading",t.progress,t.pano.panoIndex)}),n.on("xr.session.start",function(t){n.emit("webXRSessionStart")}),n.on("xr.session.end",function(t){n.emit("webXRSessionEnd")}),n.on("xr.gesture.tap",function(t){n.emit("webXRControllerEvent","tap",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.press",function(t){n.emit("webXRControllerEvent","press",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonUp",function(t){n.emit("webXRControllerEvent","buttonUp",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonDown",function(t){n.emit("webXRControllerEvent","buttonDown",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.controller.update",function(t){n.emit("webXRControllerRayUpdate",{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&n.emit("webXRAxesUpdate","left",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.left.axes.up,down:t.left.axes.down,left:t.left.axes.left,right:t.left.axes.right},deltaTime:t.left.deltaTime}),t.right&&n.emit("webXRAxesUpdate","right",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.right.axes.up,down:t.right.axes.down,left:t.right.axes.left,right:t.right.axes.right},deltaTime:t.right.deltaTime})}),n.on("works.request",function(t){n.emit("willLoad",t.input,t.works[0],t.state)}),n.on("works.load",function(t){n.emit("load",t.input,t.works[0],t.state)}),n.on("works.ready",function(t){n.emit("loaded",t.input,t.works[0])}),n.on("state.change",function(t){n.emit("stateChange",t.state,t.userAction)}),n.on("currentState.change",function(t){n.emit("currentStateChange",t.state,t.userAction)}),n.on("state.set",function(t){n.emit("setState",t.state)}),n.on("state.synced",function(t){n.emit("stateSynced",t.state)}),n.on("model.request",function(t){n.emit("modelWillLoad",t.work.model)}),n.on("model.error",function(t){n.emit("modelLoadError",t.error,t.model)}),n.on("model.load",function(t){n.emit("modelLoaded",t.model)}),n.on("model.changeShownFloor",function(t){n.emit("modelShownFloorChange",t.model.shownFloor,t.model.floorLength)}),n.on("render",function(t){n.emit("renderFrame",t.needsRender)}),n.on("mode.change.request",function(t){n.emit("wantsChangeMode",t.mode,t.prevMode)}),n.on("mode.change",function(t){n.emit("modeChange",t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),n.on("helpers.visible",function(t){n.emit("helpersVisibleChange",t.object.visible)}),n.on("network.resource",function(t){n.emit("network",t.source,t.requestType,t.requestState,t.detail)})}function Hv(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function fs(n){{var t=new d.DirectionalLight(16777215,.3);t.position.copy(new d.Vector3(1,1,1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);t.position.copy(new d.Vector3(-1,-1,-1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);n.add(t)}{var t=new d.AmbientLight(16777215,.6);n.add(t)}}function Uv(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],l=s.split("="),u=(t=l[0])===null||t===void 0?void 0:t.trim(),c=(e=l[1])===null||e===void 0?void 0:e.trim();u&&c&&(r[u]=c)}return r}function nl(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=Uv((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const Gv="data:image/png;base64,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";var hs=[351,63],ps=[20,20],Kv=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Jv=new Float32Array([0,0,1,0,0,1,1,1]),jv=new Uint8Array([0,1,2,1,3,2]),Gi=new d.BufferGeometry;Gi.setAttribute("position",new d.BufferAttribute(Kv,3));Gi.setAttribute("uv",new d.BufferAttribute(Jv,2));Gi.setIndex(new d.BufferAttribute(jv,1));var Mi=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),il=new d.Mesh(Gi,Mi);il.matrixAutoUpdate=!1;var Oo=new d.Scene;Oo.add(il);Oo.matrixAutoUpdate=!1;var ai=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);ai.position.set(0,0,.5);ai.lookAt(0,0,0);ai.updateMatrixWorld(!0);ai.matrixAutoUpdate=!1;var Xv=new d.Vector4,_v=new d.Vector4;function Wv(n){if(Mi.map){var r=n.getViewport(Xv),i=n.getScissor(_v),a=n.getScissorTest(),o=n.autoClear,s=i.x+ps[0]/3,l=i.y+ps[1]/3,u=hs[0]/3,c=hs[1]/3;n.setViewport(s,l,u,c),n.setScissor(s,l,u,c),n.setScissorTest(!0),n.autoClear=!1,n.render(Oo,ai),n.setViewport(r),n.setScissor(i),n.setScissorTest(a),n.autoClear=o}else{var t=new d.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=d.ClampToEdgeWrapping,t.wrapT=d.ClampToEdgeWrapping,t.minFilter=d.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,Mi.needsUpdate=!0,e.onload=Q},e.src=Gv,Mi.map=t}}var Zv=800,vs=90,Yv=function(n){return n.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},$v=new d.Vector2,Ai=new d.Frustum,mi=new d.Matrix4,As=new WeakMap,Fa=new WeakMap,ms=ja([]),al=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,c,f,v,m,h=n.call(this)||this;if(h.ident=Ct(),typeof window!="undefined"&&(eo.instances[h.ident]=h),h.renderSwitch01=0,h.currentMode="Panorama",h.pano={workCode:"",panoIndex:0},h.needsRender=!1,h.modelSceneNeedsRender=!1,h.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,h.imageOptions=F({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=F({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),h.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,h.extraElements=[],h.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},h.fps={testCount:0,testTime:Ce()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:Zv,h.enableWheel=(l=e.enableWheel)!==null&&l!==void 0?l:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof rn&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new rn({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision});var p=nl();h.renderer.setPixelRatio(p===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(O){O instanceof Error&&h.throwError(O)}h.getPixelsRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(c=(u=h.renderer)===null||u===void 0?void 0:u.outputEncoding)!==null&&c!==void 0?c:d.sRGBEncoding,generateMipmaps:!1});var g=new d.DepthTexture(1,1);g.generateMipmaps=!1,g.format=d.DepthStencilFormat,g.type=d.UnsignedInt248Type,h.modelRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(v=(f=h.renderer)===null||f===void 0?void 0:f.outputEncoding)!==null&&v!==void 0?v:d.sRGBEncoding,depthTexture:g,generateMipmaps:!1,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new Vs(vs),h.scene=new zs,h.xrCustomObjectsScene=new d.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(m=e.requestProxy)!==null&&m!==void 0?m:Yv,h.networkSubscribe=new Ss,h.networkSubscribe.on("network",function(O,C,P,z){var T;h.emit("network.resource",X("network.resource",{source:O,requestType:C,requestState:P,detail:z})),(T=h.analysis)===null||T===void 0||T.network(h.works,O,C,P,z)}),h.boundingMesh=Wh(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=N0(),h.models.push(new _a),h.lastModels=N0(),h.lastWorks=ja([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new d.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new d.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new d.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new d.VideoTexture(e.videoInstance||Hv()),fs(h.scene),fs(h.modelScene),h.state={mode:h.currentMode,workCode:h.pano.workCode,panoIndex:h.pano.panoIndex,longitude:h.camera.pose.longitude,latitude:h.camera.pose.latitude,fov:h.camera.pose.fov,offset:h.camera.pose.offset.clone(),distance:h.camera.pose.distance},h.stateSynced=!1,h._enablePostProcessing=!1,h._enableIOSEDR=!1,h._enableEDL=!1,h._enableHQ=!1,h.destroyed=!1,h.paused=!0,typeof window!="undefined"&&(e.play!==!1&&h.play(),h.stopAnimationLoop=lt.shared.add(function(O,C){for(var P=[],z=2;z<arguments.length;z++)P[z-2]=arguments[z];h.updateTime.apply(h,Et([O,C],P,!1))},!1,0,10));var A=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",X("vr.requestExit",{}))},y=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",A,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",y,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",A,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",y,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var x=0,b=e.plugins;x<b.length;x++){var w=b[x];if(typeof w=="function")w(h);else if(Array.isArray(w)){var E=w[0],S=w[1],M=w[2];if(typeof E=="function"){var R=E(h,M);typeof S=="string"&&(h.plugins[S]?h.throwError(new Error("plugin name ".concat(S," is exists."))):h.plugins[S]=R)}}}return h.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,qv(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.3.0-alpha.5"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Li.decoderPath},set:function(e){Li.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return Un.transcoderPath},set:function(e){Un.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new d.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.models.setMaterial({constantColor:o}),this.scene.traverse(function(f){if(!(!(f instanceof d.Mesh)||f instanceof Qt)){var v=Object.keys(i).filter(function(h){return h===f.uuid})[0];if(v)if(s.meshOriginMaterialMap.set(v,f.material),s.meshReplaceMaterialMap.get(v))f.material=s.meshReplaceMaterialMap.get(v);else{var m=new d.ShaderMaterial({uniforms:{color:{value:i[v]}},vertexShader:`
2160
+ `},Lo=function(n){se(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(Ra.uniforms),vertexShader:Ra.vertexShader,fragmentShader:Ra.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(i){this.uniforms.diffuse.value=i}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(i){this.uniforms.linewidth.value=i}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(i){this.uniforms.dashScale.value=i}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(i){this.uniforms.dashSize.value=i}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(i){this.uniforms.gapSize.value=i}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(i){this.uniforms.opacity.value=i}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(i){this.uniforms.resolution.value.copy(i)}}}),r.setValues(e),r}return t}(d.ShaderMaterial);Object.assign(Lo.prototype,{isLineMaterial:!0});var Yu=function(n){se(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new ko,i.material=r!==void 0?r:new Lo({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,a=new Float32Array(2*r.count),o=new d.Vector3,s=new d.Vector3,l=0,u=0,c=r.count;l<c;l++,u+=2)o.fromBufferAttribute(r,l),s.fromBufferAttribute(i,l),a[u]=u===0?0:a[u-1],a[u+1]=a[u]+o.distanceTo(s);var f=new d.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new d.InterleavedBufferAttribute(f,1,0)),e.setAttribute("instanceDistanceEnd",new d.InterleavedBufferAttribute(f,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,l=this.material,u=l.resolution,c=l.linewidth,f=s.attributes.instanceStart,v=s.attributes.instanceEnd,m=new d.Vector4,h=new d.Vector4,p=new d.Vector4,g=new d.Vector3,A=new d.Matrix4,y=new d.Line3,x=new d.Vector3;i.at(1,p),p.w=1,p.applyMatrix4(a.matrixWorldInverse),p.applyMatrix4(o),p.multiplyScalar(1/p.w),p.x*=u.x/2,p.y*=u.y/2,p.z=0,g.copy(p);var b=this.matrixWorld;A.multiplyMatrices(a.matrixWorldInverse,b);for(var w=0,E=f.count;w<E;w++){m.fromBufferAttribute(f,w),h.fromBufferAttribute(v,w),m.w=1,h.w=1,m.applyMatrix4(A),h.applyMatrix4(A),m.applyMatrix4(o),h.applyMatrix4(o),m.multiplyScalar(1/m.w),h.multiplyScalar(1/h.w);var S=m.z<-1&&h.z<-1,M=m.z>1&&h.z>1;if(!(S||M)){m.x*=u.x/2,m.y*=u.y/2,h.x*=u.x/2,h.y*=u.y/2,y.start.copy(m),y.start.z=0,y.end.copy(h),y.end.z=0;var R=y.closestPointToPointParameter(g,!0);y.at(R,x);var O=d.MathUtils.lerp(m.z,h.z,R),C=O>=-1&&O<=1,P=g.distanceTo(x)<c*.5;if(C&&P){y.start.fromBufferAttribute(f,w),y.end.fromBufferAttribute(v,w),y.start.applyMatrix4(b),y.end.applyMatrix4(b);var z=new d.Vector3,T=new d.Vector3;i.distanceSqToSegment(y.start,y.end,T,z),r.push({point:T,pointOnLine:z,distance:i.origin.distanceTo(T),object:this,faceIndex:w})}}}},t}(d.Mesh);Object.assign(Yu.prototype,{isLineSegments2:!0});var $u=function(n){se(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(Yu);Object.assign($u.prototype,{isLine2:!0});var el=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof d.Geometry){var i=new d.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof d.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(ko);Object.assign(el.prototype,{isLineGeometry:!0});var wv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",ss=14467195,Ev=8,Cv=2,Sv=20,us=null,$a=function(n){se(t,n);function t(e,r){e===void 0&&(e=new d.Vector3),r===void 0&&(r=new d.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var a=new el,o=new Lo({color:ss,linewidth:Cv,dashScale:Sv,dashed:!1});i.line=new $u(a,o);var s=new d.BufferGeometry,l=new d.PointsMaterial({color:ss,size:Ev,map:us||(us=new d.TextureLoader().load(wv)),sizeAttenuation:!1,transparent:!0});return i.points=new d.Points(s,l),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,r),i.add(i.line,i.points),i}return Object.defineProperty(t,"version",{get:function(){return"6.3.0-alpha.6"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new d.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new d.Vector3(e[0],e[1],e[2]),new d.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];i==="dashed"?(r.dashed=a,a?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var i=this.line.material.resolution;(i.x!==e||i.y!==r)&&(i.set(e,r),this.needsRender=!0)},t}(d.Object3D);Object.assign($a.prototype,{isFiveLine:!0});var Xe={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function tl(n){return Di(this,void 0,void 0,function(){var t;return Ni(this,function(e){switch(e.label){case 0:return[4,fetch(n)];case 1:if(t=e.sent(),t.ok)return[2,t.json()];throw new Error(t.statusText)}})})}function Mv(n){return Di(this,void 0,void 0,function(){var t,e;return Ni(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,tl("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function Iv(n,t){return Di(this,arguments,void 0,function(e,r,i,a){var o,s,l,u,c,f;return i===void 0&&(i=null),a===void 0&&(a=!0),Ni(this,function(v){switch(v.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,Mv(r)];case 1:if(o=v.sent(),e.profiles.some(function(m){var h=o[m];return h&&(s={profileId:m,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");if(l=o[i],!l)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));s={profileId:i,profilePath:"".concat(r,"/").concat(l.path),deprecated:!!l.deprecated}}return[4,tl(s.profilePath)];case 2:if(u=v.sent(),a){if(f=void 0,f=u.layouts[e.handedness],!f)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(s.profileId));f.assetPath&&(c=s.profilePath.replace("profile.json",f.assetPath))}return[2,{profile:u,assetPath:c}]}})})}var Tv={xAxis:0,yAxis:0,button:0,state:Xe.ComponentState.DEFAULT};function Pv(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,i=Math.sqrt(n*n+t*t);if(i>1){var a=Math.atan2(t,n);e=Math.cos(a),r=Math.sin(a)}var o={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return o}var Bv=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Xe.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(Tv)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=Pv(e,r),s=o.normalizedXAxis,l=o.normalizedYAxis;switch(this.componentProperty){case Xe.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case Xe.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?l:.5;break;case Xe.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case Xe.ComponentProperty.STATE:this.valueNodeProperty===Xe.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),Rv=function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(i){var a=new Bv(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Xe.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=F({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Xe.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){var r=t.buttons[this.gamepadIndices.button];this.values.button=r.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,r.pressed||this.values.button===1?this.values.state=Xe.ComponentState.PRESSED:(r.touched||this.values.button>Xe.ButtonTouchThreshold)&&(this.values.state=Xe.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Xe.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Xe.AxisTouchThreshold&&(this.values.state=Xe.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Xe.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Xe.AxisTouchThreshold&&(this.values.state=Xe.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),Fv=function(){function n(t,e,r){var i=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(a){var o=i.layoutDescription.components[a];i.components[a]=new Rv(a,o)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n}(),kv="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Lv="generic-trigger",Ov=function(n){se(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(i){i instanceof d.Mesh&&i.isMesh&&(i.material.envMap=r.envMap,i.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(i){var a=i.valueNode,o=i.minNode,s=i.maxNode,l=i.value,u=i.valueNodeProperty;a&&(u===Xe.VisualResponseProperty.VISIBILITY?a.visible=l:u===Xe.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,l),a.position.lerpVectors(o.position,s.position,l)))})}))},t}(Nn.Object3D);function zv(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===Xe.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Nn.SphereGeometry(.001),s=new Nn.MeshBasicMaterial({color:255}),l=new Nn.Mesh(o,s);e.touchPointNode.add(l)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(u){var c=u.valueNodeName,f=u.minNodeName,v=u.maxNodeName,m=u.valueNodeProperty;if(m===Xe.VisualResponseProperty.TRANSFORM){if(u.minNode=t.getObjectByName(f),u.maxNode=t.getObjectByName(v),!u.minNode){console.warn("Could not find ".concat(f," in the model"));return}if(!u.maxNode){console.warn("Could not find ".concat(v," in the model"));return}}u.valueNode=t.getObjectByName(c),u.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function ls(n,t){zv(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof d.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var Vv=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=kv,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new Ov,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||Iv(o,e.path,Lv).then(function(s){var l=s.profile,u=s.assetPath;r.motionController=new Fv(o,l,u);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),ls(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(f){e._assetCache[r.motionController.assetUrl]=f,i=f.scene.clone(),ls(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function Dv(n,t){return n}var cs=300,Nv=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),ds=new d.Vector3(-1,1,1),Qv=function(n){se(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new xv(r.renderer,r.renderer.getContext(),{onSessionStart:function(l){r.emit("xr.session.start",X("xr.session.start",{session:l,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",X("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new d.Raycaster,right:new d.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new $a,right:new $a},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new d.Group,new d.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var o=new Vv;o.gltfLoader={load:function(l,u){Ti.ajax(l,{responseType:"arraybuffer"}).then(function(c){var f;return vo(c.body,{resourcePath:l.slice(0,l.lastIndexOf("/")+1),search:(f=l.split("?")[1])!==null&&f!==void 0?f:"",fetcher:Ti})}).then(function(c){return u(c)})}},(r.xrManager.machineType==="Oculus"||r.xrManager.machineType==="Pico")&&r.scene.add(r.pointerLines.left,r.pointerLines.right,r.controllerWrappers[0],r.controllerWrappers[1]),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=Ct()]={panoId:De(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new d.Matrix4},r.parallaxCameraMatrixs=[];var s=lt.shared.getContext();return s?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(s),r.on("xr.session.start",function(){var l=r.xrManager.getControllerGrip(0);l.add(o.createControllerModel(l)),r.controllerWrappers[0].add(l);var u=r.xrManager.getControllerGrip(1);u.add(o.createControllerModel(u)),r.controllerWrappers[1].add(u)}),r.xrHandleState={LeftAxesUp:{touchStartTime:0,touchStart:!1},LeftAxesDown:{touchStartTime:0,touchStart:!1},LeftAxesLeft:{touchStartTime:0,touchStart:!1},LeftAxesRight:{touchStartTime:0,touchStart:!1},LeftTrigger:{touchStartTime:0,touchStart:!1},LeftPinch:{touchStartTime:0,touchStart:!1},RightAxesUp:{touchStartTime:0,touchStart:!1},RightAxesDown:{touchStartTime:0,touchStart:!1},RightAxesLeft:{touchStartTime:0,touchStart:!1},RightAxesRight:{touchStartTime:0,touchStart:!1},RightTrigger:{touchStartTime:0,touchStart:!1},RightPinch:{touchStartTime:0,touchStart:!1},Y:{touchStartTime:0,touchStart:!1},X:{touchStartTime:0,touchStart:!1},A:{touchStartTime:0,touchStart:!1},B:{touchStartTime:0,touchStart:!1}},r.xrManager.machineType==="VP"&&r.initHandEvent(),r):(console.error("获取session失败,请退出重试"),r)}return t.parseArgs=function(e){if(e instanceof t)return e;var r=F(F({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return F(F({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,l,u,c=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoIndex");var v=Jn(f.images.up),m=this.imageOptions.size;typeof m=="undefined"&&f&&v&&(m=Number(v)),typeof m=="undefined"&&(m=2048);var h=this.imageOptions.transform,p=function(C,P){return Dv(on(C,h,P))},g=F({key:"pano.".concat(f.panoId)},Vt(this.imageOptions,["format","size","quality"])),A=f.images,y=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(C){return C.size>m}))!==null&&l!==void 0?l:null,x="pano:"+yo([A,g,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===x)return;var b=this.pendingTextureTask.panoId;(u=this.panoMeshes[b])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",X("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano}))}var w=this.models.getMaterial()||{},E=w.pano0,S=w.pano1,M;if((E==null?void 0:E.map.name)===x?M=E:(S==null?void 0:S.map.name)===x&&(M=S),M){var R={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:M.map,luminanceMap:M.luminanceMap,matrix:new d.Matrix4().compose(f.position,f.quaternion,ds)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};this.doMoveToPano(f.pano,R,r);return}var O="move-to-pano-"+f.panoId;this.pending.add(O),this.pendingTextureTask={panoId:f.panoId,hash:x,onLoad:function(C){if(a.pending.delete(O),a.destroyed)C.body.dispose();else{C.body.name=x;var P={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:C.body,luminanceMap:null,matrix:new d.Matrix4().compose(f.position,f.quaternion,ds)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};a.doMoveToPano(f.pano,P,r)}},onError:function(C){a.pending.delete(O);var P=F(F(F({},f.pano),{mode:a.mode}),je(a.camera.pose));a.emit("pano.error",X("pano.error",{error:C,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:P})),a.emit("pano.cancel",X("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:P})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(A,y,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:g},format:d.RGBAFormat,minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(C){var P,z;a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:C,meta:null,pano:f.pano})),((P=a.pendingTextureTask)===null||P===void 0?void 0:P.hash)===x&&((z=a.panoMeshes[f.panoId])===null||z===void 0||z.setProgress(C))},this.renderer):this.textureLoader.loadCubeTexture(A,{imageURL:{transform:p,options:g},format:d.RGBAFormat,fetcher:it(f.work)},void 0,void 0,function(C){var P,z;((P=a.pendingTextureTask)===null||P===void 0?void 0:P.hash)===x&&((z=a.panoMeshes[f.panoId])===null||z===void 0||z.setProgress(C)),a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:C,meta:null,pano:f.pano}))},this.renderer)]).then(function(C){var P,z,T=C[0];((P=a.pendingTextureTask)===null||P===void 0?void 0:P.hash)===x?(a.pendingTextureTask.onLoad(T),(z=a.panoMeshes[f.panoId])===null||z===void 0||z.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",X("pano.texture.success",{error:null,progress:1,meta:T.meta,pano:f.pano}))):T.body.dispose()}).catch(function(C){var P,z;((P=a.pendingTextureTask)===null||P===void 0?void 0:P.hash)===x&&(a.pendingTextureTask.onError(C),(z=a.panoMeshes[f.panoId])===null||z===void 0||z.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",X("pano.texture.error",{error:C,progress:0,meta:null,pano:f.pano})),a.emit("error",C))}),this.emit("pano.texture.load",X("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,l,u,c,f,v,m,h,p;i===void 0&&(i={});var g=Ce(),A=Ct();this.panoResources[A]=r;var y=1,x,b,w;if(this.locationMotion.ended){var E=this.locationMotion.getKeyFrameSegment(g);E[0];var S=E[1],M=this.locationMotion.value,R=this.panoResourceFromLocationMotionKeyframe(S).position,O=r.position;x=Math.max(R.distanceTo(O),y),b=[{key:S.key,progress:0,value:F(F({},M),{count:0})},{key:A,progress:1,value:{distance:0,count:1}}],w=0}else{var C=this.locationMotion.getKeyFrameSegment(g),P=C[0],S=C[1],M=this.locationMotion.value,z=this.panoResourceFromLocationMotionKeyframe(P).position,R=this.panoResourceFromLocationMotionKeyframe(S).position,O=r.position,T=S.value.count-M.count,k=Math.max(z.distanceTo(R),y)*T,L=Math.max(R.distanceTo(O),y);x=k+L,b=[{key:P.key,progress:0,value:F({},M)},{key:S.key,progress:k/x,value:S.value},{key:A,progress:1,value:{count:S.value.count+1,distance:0}}];var V=this.locationMotionKeyframesLength(this.locationMotion.keyframes),U=this.locationMotionKeyframesLength(b);w=this.locationMotion.getProgressVelocity(g)*V/U}var q=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?x:0),N={longitude:i.longitude,latitude:i.latitude,fov:i.fov},H=F(F({},e),{mode:this.mode,longitude:(o=N.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=N.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=N.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:0}),J=this.currentPano;if(this.emit("pano.moveTo",X("pano.moveTo",{options:i,prevPano:J,progress:0,state:H,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(H),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=Q,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(N,q).catch(Q);else{var j=zt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),_=zt({longitude:(u=N.longitude)!==null&&u!==void 0?u:this.cameraMotion.value.longitude,latitude:(c=N.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),Z=new d.Object3D;Z.lookAt(j);var W=new d.Matrix4().makeRotationFromQuaternion(Z.quaternion);Z.lookAt(_);var ee=new d.Matrix4().makeRotationFromQuaternion(Z.quaternion),Y=new d.Matrix4().getInverse(W).premultiply(ee),ne=this.cameraMotion.value.fov,te=(f=N.fov)!==null&&f!==void 0?f:this.cameraMotion.value.fov,ue=1;r.effect==="zoomin"?ue=1.5:r.effect==="zoomout"&&(ue=.4);for(var ie=te*ue,ye=0;ye<b.length-1;ye++){var fe=b[ye].key;if(fe){var Ae=this.panoResources[fe];Ae&&(Ae.fixCameraTransform.copy(Y),Ae.leftPanoPicture&&(Ae.leftPanoPicture.zoom=Math.tan(ne/2/180*Math.PI)/Math.tan(ie/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(v=N.longitude)!==null&&v!==void 0?v:this.cameraMotion.value.longitude,latitude:(m=N.latitude)!==null&&m!==void 0?m:this.cameraMotion.value.latitude,fov:ie}},{progress:1,value:{longitude:(h=N.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(p=N.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude,fov:te}}],q).catch(Q)}var Pe=this.locationMotion.setKeyframes(b,q,w);Pe.then(function(){for(var we,Me,re,ae=0,G=a.models;ae<G.length;ae++){var Fe=G[ae];Fe.show()}var ke=F(F({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",X("pano.arrived",{options:i,prevPano:J,progress:1,state:ke,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(ke);var Te=a.works.getResolvedObserver(a.currentPano);if(Te&&Te.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ge=Nv.clone().multiply((re=(Me=(we=a.models.getMaterial())===null||we===void 0?void 0:we.pano1)===null||Me===void 0?void 0:Me.matrix)!==null&&re!==void 0?re:new d.Matrix4).multiply(Te.video.matrix),be={map:a.videoTexture,size:Te.video.size,matrix:Ge,alpha:1},ve=Ct(),xe=a.videoTexture.image;xe.setAttribute("uuid",ve),Uu().then(function(ge){ge&&Te.video&&xe.getAttribute("uuid")===ve&&(xe.oncanplay=function(){xe.oncanplay=Q,xe.play()},xe.ontimeupdate=function(){xe.currentTime>.5&&(xe.ontimeupdate=Q,a.panoVideo.setMaterial(be))},xe.src=Te.video.source)}).catch(function(){xe.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",X("pano.cancel",{options:i,prevPano:J,progress:0,state:H,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var l=this.camera.getDirection(new d.Vector3).setY(0),u=null,c=this.works.getResolvedObserver(this.currentPano);if(!c)return null;var f=c.accessibleIds.filter(function(_){var Z=At(_);if(Yt(Z,r.currentPano))return!1;var W=r.works.getResolvedObserver(Z);return!W||W.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:W.loadable||W.active}),v=this.models.intersectRaycaster(e)[0];if(v){var m=dr(f,function(_){var Z=r.works.getResolvedObserver(_);if(!Z)return 1/0;var W=Z.standingPosition.clone();return W.distanceTo(v.point)},!0),h=m[0],p=m[1];h&&p<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(as(u)){var g=this.getForwardObserverOrNot(e);g&&(u=g)}for(var A=0,y=this.locationMotion.keyframes;A<y.length;A++){var x=y[A],b=this.panoResourceFromLocationMotionKeyframe(x);if(!(x.progress<this.locationMotion.progress)&&u&&b.panoId===u.panoId){u=null;break}}if(as(u))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(u&&!u.active){var w=u.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var E={};if(u){for(var S=Math.PI/6,M=Math.PI/12,R=new d.Vector3(0,1,0),O=u.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),C=O.clone().applyAxisAngle(R,S),P=O.clone().applyAxisAngle(R,-S),z=[],T=[],k=[],L=0,V=u.accessibleIds;L<V.length;L++){var h=V[L],U=At(h);if(!(Yt(U,this.currentPano)||Yt(U,u.pano))){var q=this.works.getResolvedObserver(h);if(q){var N=q.position.clone().sub(u.position).setY(0);O.angleTo(N)<S?k.push(N):C.angleTo(N)<S?z.push(N):P.angleTo(N)<S&&T.push(N)}}}var H=k.length>0?k:Et(Et([],z,!0),T,!0),J=H.slice().sort(function(_,Z){return _.angleTo(O)-Z.angleTo(O)})[0];J&&J.angleTo(l)>M&&(E.longitude=Math.atan2(-J.x,-J.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=he(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var j={workCode:u.pano.workCode,panoIndex:u.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:u?u.position.clone():new d.Vector3};return this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:j,userAction:!0,options:E,progress:0,error:null})),u&&u.active?(this.emit("pano.request",X("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:j,options:E,error:null})),u.pano):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var i=this,a,o,s,l,u,c,f,v,m=[],h=2;h<arguments.length;h++)m[h-2]=arguments[h];this.userAction=!0;var p={},g={},A=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),x=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),p.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(he(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),w=b[0],E=b[1],S=this.panoResourceFromLocationMotionKeyframe(w),M=this.panoResourceFromLocationMotionKeyframe(E),R=new d.Vector3().copy(S.position),O=new d.Vector3().copy(M.position),C=this.locationMotion.value.count-E.value.count+1;p.progress=C,M.leftPanoPicture&&(C<1?S.leftPanoPicture&&(p.pano0=S.leftPanoPicture):p.pano0=M.leftPanoPicture,p.pano1=M.leftPanoPicture),M.effect==="montage"?p.transition="BLACK":M.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(M.effect==="zoomin"||M.effect==="zoomout")&&(p.progress=Math.pow(C,3)),C<1&&M.effect!=="fly"&&(p.pano0&&S.leftPanoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:S.leftPanoPicture.matrix.clone().setPosition(M.position)}),R.copy(O),x=!0),g.distance=this.locationMotion.value.distance,g.offset=new d.Vector3(R.x+(O.x-R.x)*C,R.y+(O.y-R.y)*C,R.z+(O.z-R.z)*C);for(var P=[],z=[],T=0,k=this.locationMotion.keyframes;T<k.length;T++){var L=k[T],V=L.key,U=L.progress;V!==void 0&&(P.push(V),U>this.locationMotion.progress&&z.push(V))}for(var q=0,N=Object.keys(this.panoResources);q<N.length;q++){var H=N[q];if(!(z.indexOf(H)>=0)){var J=this.panoResources[H];if(J.leftPanoPicture){var j=J.leftPanoPicture.map;if(j){if(j===((a=p.pano0)===null||a===void 0?void 0:a.map)||j===((o=p.pano1)===null||o===void 0?void 0:o.map))continue;j instanceof Ve&&j.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(j.cubeRenderTarget),j.dispose(),J.leftPanoPicture=null}}P.indexOf(H)>=0||delete this.panoResources[H]}}this.currentPano=At(M.panoId),this.emit("pano.moving",X("pano.moving",{userAction:this.userAction,prevPano:At(A.panoId),state:F(F(F(F({},At(y.panoId)),{mode:this.mode}),je(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}qt(p)===!1&&(!((s=p.pano0)===null||s===void 0)&&s.map&&p.pano0.map instanceof Ve&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=p.pano1)===null||l===void 0)&&l.map&&p.pano1.map instanceof Ve&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(p)),qt(g)===!1&&this.setCamera(g);var _=this.works.getResolvedObserver(this.currentPano),Z=m[1];if(!Z){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var W=this.xrManager.referenceSpace;if(W){var ee=this.xrManager.cameraVR,Y=this.xrManager.cameraL,ne=this.xrManager.cameraR,te=[Y,ne],ue=Z.getViewerPose(W),ie=new d.Vector3(0,0,0);if(ue){var ye;ye=this.xrManager.session.renderState.baseLayer;var fe=ue.views;if(!ye){console.error("no layer found");return}this.renderer.setFramebuffer(ye.framebuffer);var Ae=!1;fe.length!==ee.cameras.length&&(ee.cameras.length=0,Ae=!0),this.parallaxCameraMatrixs=[];var Pe=new d.Vector3,we=new d.Vector3;new d.Matrix4().fromArray(fe[0].transform.matrix).decompose(Pe,new d.Quaternion,new d.Vector3),new d.Matrix4().fromArray(fe[1].transform.matrix).decompose(we,new d.Quaternion,new d.Vector3),we.clone().sub(Pe).normalize();var Me=new d.Vector3,re=new d.Quaternion,ae=new d.Vector3;this.camera.matrix.decompose(Me,re,ae);for(var G=0;G<fe.length;G++){var Fe=fe[G],ke=ye.getViewport(Fe),Te=te[G];Te.matrix.fromArray(Fe.transform.matrix);var Ge=new d.Vector3,be=new d.Quaternion,ve=new d.Vector3;Te.matrix.decompose(Ge,be,ve),ie.copy(Me),Te.position.copy(Me),Te.quaternion.copy(be),Te.scale.copy(ve),Te.updateMatrix(),Te.projectionMatrix.fromArray(Fe.projectionMatrix),Te.viewport.set(ke.x,ke.y,ke.width,ke.height),Ae===!0&&ee.cameras.push(Te)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var G=0;G<this.xrManager.session.inputSources.length;G++)if(this.xrManager.session.inputSources[G]&&this.xrManager.session.inputSources[G].targetRayMode==="transient-pointer"){var xe=Z.getPose(this.xrManager.session.inputSources[G].targetRaySpace,W);if(xe){var ge=new d.Vector3(0,0,-1).applyQuaternion(xe.transform.orientation),me=new d.Raycaster(this.camera.position,ge);this.gazeRay=me}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Qe=this.xrManager.session.inputSources,G=0;G<Qe.length;G++){var Ke=this.xrManager.controllers[G],rt=Qe[G];if(rt){Ke&&Ke.update(rt,Z,W);var me=this.xrManager.getController(G),Xr=new d.Vector3(0,1.2,0),Le=me.position.clone().add(ie).sub(Xr);rt.handedness==="left"?this.xrControllerRay.left.set(Le,new d.Vector3(0,0,-1).applyEuler(me.rotation)):rt.handedness==="right"&&this.xrControllerRay.right.set(Le,new d.Vector3(0,0,-1).applyEuler(me.rotation)),this.controllerWrappers[G].position.copy(new d.Vector3(0,0,0).add(ie).sub(Xr));var Ze=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ze.length===0&&(Ze=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(Tr){var Zr;return F({floor:(Zr=_==null?void 0:_.floorIndex)!==null&&Zr!==void 0?Zr:0},Tr)})),Ze.length>=1&&Ze[0].face)if(rt.handedness==="right"){var ot=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),tr=Ze[0].face.normal,dn=tr.clone(),rr=Ze[0].point.clone();this.intersectMesh.position.copy(rr);var Tt=rr.clone().add(dn);if(this.intersectMesh.lookAt(Tt),Math.abs(tr.y)>.99){var nr=this.camera.position.clone().sub(rr);this.intersectMesh.rotation.z=-Math.atan2(nr.z,nr.x)}this.intersectMesh.visible=!0,this.needsRender=!0,ot.length>0?(this.pointerLines.right.setPoints(Le,ot[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(Le,Ze[0].point));var Mr=Ze[0],Ht=X("intersect.update",{raycaster:(u=this.xrControllerRay.right)!==null&&u!==void 0?u:null,intersection:Mr!=null?Mr:null,object:this.intersectMesh});if(this.emit("intersect.update",Ht),Ht.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(Le,Ze[0].point)}}this.updateControllerHelper(Qe,e,r)}if(this.camera.pose.distance>.1||x)for(var ir=0,Ut=Object.keys(this.panoMeshes);ir<Ut.length;ir++){var ct=Ut[ir],Oe=this.panoMeshes[ct];Oe.setOpacity(0),Oe.setCurrent(!1),Oe.updateTime&&Oe.updateTime(e,r),Oe.visible=!1}else if(_){var hr=dr(_.visibleIds,function(dt){var Jt=i.works.getResolvedObserver(dt);return Jt?_.standingPosition.distanceTo(Jt.standingPosition):1/0},!0),gt=hr[1];gt=he(gt,2.5,1/0);for(var pr=_.visibleIds.concat(De(this.currentPano)),vr=this.getForwardObserverOrNot(),Gt=this.camera.getDirection(new d.Vector3),St=0,Ar=Object.keys(this.panoMeshes);St<Ar.length;St++){var ct=Ar[St],Oe=this.panoMeshes[ct],Ir=this.works.getResolvedObserver(ct);if(pr.indexOf(ct)===-1)Oe.setCurrent(!1),Oe.setOpacity(0);else if(!Ir)Oe.setCurrent(!1),Oe.setOpacity(0);else if(!Ir.loadable&&!Ir.active)Oe.setCurrent(!1),Oe.setOpacity(0);else{var fn=Oe.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Oe.setCurrent(!Oe.loading&&Oe.progress===0&&vr!==null&&vr.panoId===ct),Oe.setOpacity(fn<.01?0:he(gt/fn*1.2,.65,.98));var _r=this.camera.position.clone().setY(Oe.position.y),ge=new d.Vector3().copy(Oe.position).sub(_r).normalize();if(ct===De(this.currentPano)){var Wr=he((.5-_r.distanceTo(Oe.position))/.5,0,1);ge.multiplyScalar(1-Wr).add(Gt.clone().multiplyScalar(Wr))}ge.length()>0&&Oe.quaternion.setFromEuler(new d.Euler(0,Math.atan2(ge.x,ge.z),0))}Oe.updateTime&&Oe.updateTime(e,r)}}var Kt=function(){return 4}(),Ye=function(){var dt=new d.PerspectiveCamera;dt.applyMatrix4(ee.matrix),dt.position.set(0,0,0);var Jt=i.works.getResolvedObserver(y.panoId),Tr=Jt!=null?Jt:_;Tr&&dt.quaternion.premultiply(Tr.quaternion.clone().inverse()),dt.updateProjectionMatrix(),dt.updateMatrixWorld(!0);var Zr=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(dt.projectionMatrix,dt.matrixWorldInverse));return Zr}();y.panoId===De(this.currentPano)&&((c=y.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof Ve&&(y.leftPanoPicture.map.maxRequest=this.tileMaxRequest,y.leftPanoPicture.map.update(Ye,Kt),y.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var He=this.tiling.object.visible;if(this.initAnimationed){var nt=y.panoId,yt=this.works.getResolvedObserver(nt);yt?ii(this.camera.position,yt.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==nt&&this.tiling.cleanup(),this.tiling.panoId=nt,this.tiling.setResource((v=(f=yt.images)===null||f===void 0?void 0:f.tiles)!==null&&v!==void 0?v:[],this.enableIOSEDR&&yt.images.luminance?yt.images.luminance:null),this.tiling.setFetcher(it(yt.work)),this.tiling.setRotation(yt.quaternion),this.tiling.setPosition(yt.position),this.tiling.maxRequest=this.tileMaxRequest,Kt>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Ye,Kt,e):this.tiling.update(Ye,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;He!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},l=0;l<e.length;l++){var u=e[l].handedness,c=e[l].gamepad;switch(u){case"left":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"LeftAxesDown",r)),c!=null&&c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"X",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"Y",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"LeftTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"LeftPinch",r));var f={raycaster:a,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.buttons.X=c.buttons&&c.buttons[4]?c.buttons[4].pressed:!1,s.buttons.Y=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.LeftTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.LeftPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1,s.left=f;break;case"right":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"RightAxesDown",r)),c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"A",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"B",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"RightTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"RightPinch",r));var v={raycaster:o,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.right=v,s.buttons.A=c.buttons&&c.buttons[4]?c==null?void 0:c.buttons[4].pressed:!1,s.buttons.B=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.RightTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.RightPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",X("xr.controller.update",s))}},t.prototype.emitHandleEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=i,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",X("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}));else{var s=i-this.xrHandleState[r].touchStartTime;s>cs&&this.emit("xr.gesture.press",X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",X("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));var s=i-this.xrHandleState[r].touchStartTime;if(s<=cs){var l=X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}),u=this.emit("xr.gesture.tap",l);!u&&!l.defaultPrevented&&r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[r].touchStart=!1,this.xrHandleState[r].touchStartTime=0}},t.prototype.initHandEvent=function(){var e=this;if(!this.xrManager.session)throw new Error("初始化失败");this.xrManager.session.addEventListener("select",function(r){e.gazeRay&&e.checkSelectedPano(e.gazeRay)})},t}(Bo),Rt={Floorplan:Ya,Topview:fp,Panorama:Bo,VRPanorama:av,Model:sv,Mapview:gv,XRPanorama:Qv},rl=["gesture.pan","gesture.tap","gesture.dbltap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function qv(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=zt(t.state);e.setLength(t.state.distance);var r=t.state.offset.clone().sub(e);n.emit("cameraPositionUpdate",r,t.userAction),n.emit("cameraUpdate",t.state,t.userAction)}),n.on("intersect.update",function(t){if(t.intersection){var e=!1;e=n.emit("wantsShowIntersectionOnModel",t.raycaster),e&&t.preventDefault(),t.defaultPrevented||n.emit("intersectionOnModelUpdate",t.intersection,t.object)}else n.emit("intersectionHidden")}),n.on("pano.request",function(t){var e=n.emit("wantsMoveToPano",t.state.panoIndex,t.options,t.userAction);e||(e=n.emit("wantsToMoveToPano",t.state.panoIndex,t.options,t.userAction)),e&&t.preventDefault(),t.defaultPrevented||n.emit("panoWillLoad",t.state.panoIndex)}),n.on("pano.select",function(t){n.emit("panoSelected",t.state.panoIndex)}),n.on("pano.moveTo",function(t){n.emit("panoLoaded",t.state.panoIndex),n.emit("moveToPano",t.state.panoIndex,t.userAction),n.emit("panoWillArrive",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.moving",function(t){n.emit("movingToPano",t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),n.on("pano.arrived",function(t){n.emit("panoArrived",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.cancel",function(t){n.emit("moveToPanoCanceled",t.state.panoIndex)}),n.on("pano.error",function(t){n.emit("panoLoadError",t.error,t.state.panoIndex)}),n.on("pano.texture.load",function(t){n.emit("textureStartLoad",t.pano.panoIndex)}),n.on("pano.texture.success",function(t){n.emit("textureLoaded",t.pano.panoIndex,t.meta)}),n.on("pano.texture.error",function(t){n.emit("textureError",t.error,t.pano.panoIndex)}),n.on("pano.texture.abort",function(t){n.emit("textureAbort",t.pano.panoIndex)}),n.on("pano.texture.progress",function(t){n.emit("textureLoading",t.progress,t.pano.panoIndex)}),n.on("xr.session.start",function(t){n.emit("webXRSessionStart")}),n.on("xr.session.end",function(t){n.emit("webXRSessionEnd")}),n.on("xr.gesture.tap",function(t){n.emit("webXRControllerEvent","tap",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.press",function(t){n.emit("webXRControllerEvent","press",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonUp",function(t){n.emit("webXRControllerEvent","buttonUp",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonDown",function(t){n.emit("webXRControllerEvent","buttonDown",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.controller.update",function(t){n.emit("webXRControllerRayUpdate",{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&n.emit("webXRAxesUpdate","left",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.left.axes.up,down:t.left.axes.down,left:t.left.axes.left,right:t.left.axes.right},deltaTime:t.left.deltaTime}),t.right&&n.emit("webXRAxesUpdate","right",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.right.axes.up,down:t.right.axes.down,left:t.right.axes.left,right:t.right.axes.right},deltaTime:t.right.deltaTime})}),n.on("works.request",function(t){n.emit("willLoad",t.input,t.works[0],t.state)}),n.on("works.load",function(t){n.emit("load",t.input,t.works[0],t.state)}),n.on("works.ready",function(t){n.emit("loaded",t.input,t.works[0])}),n.on("state.change",function(t){n.emit("stateChange",t.state,t.userAction)}),n.on("currentState.change",function(t){n.emit("currentStateChange",t.state,t.userAction)}),n.on("state.set",function(t){n.emit("setState",t.state)}),n.on("state.synced",function(t){n.emit("stateSynced",t.state)}),n.on("model.request",function(t){n.emit("modelWillLoad",t.work.model)}),n.on("model.error",function(t){n.emit("modelLoadError",t.error,t.model)}),n.on("model.load",function(t){n.emit("modelLoaded",t.model)}),n.on("model.changeShownFloor",function(t){n.emit("modelShownFloorChange",t.model.shownFloor,t.model.floorLength)}),n.on("render",function(t){n.emit("renderFrame",t.needsRender)}),n.on("mode.change.request",function(t){n.emit("wantsChangeMode",t.mode,t.prevMode)}),n.on("mode.change",function(t){n.emit("modeChange",t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),n.on("helpers.visible",function(t){n.emit("helpersVisibleChange",t.object.visible)}),n.on("network.resource",function(t){n.emit("network",t.source,t.requestType,t.requestState,t.detail)})}function Hv(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function fs(n){{var t=new d.DirectionalLight(16777215,.3);t.position.copy(new d.Vector3(1,1,1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);t.position.copy(new d.Vector3(-1,-1,-1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);n.add(t)}{var t=new d.AmbientLight(16777215,.6);n.add(t)}}function Uv(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],l=s.split("="),u=(t=l[0])===null||t===void 0?void 0:t.trim(),c=(e=l[1])===null||e===void 0?void 0:e.trim();u&&c&&(r[u]=c)}return r}function nl(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var i=Uv((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const Gv="data:image/png;base64,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";var hs=[351,63],ps=[20,20],Kv=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Jv=new Float32Array([0,0,1,0,0,1,1,1]),jv=new Uint8Array([0,1,2,1,3,2]),Gi=new d.BufferGeometry;Gi.setAttribute("position",new d.BufferAttribute(Kv,3));Gi.setAttribute("uv",new d.BufferAttribute(Jv,2));Gi.setIndex(new d.BufferAttribute(jv,1));var Mi=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),il=new d.Mesh(Gi,Mi);il.matrixAutoUpdate=!1;var Oo=new d.Scene;Oo.add(il);Oo.matrixAutoUpdate=!1;var ai=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);ai.position.set(0,0,.5);ai.lookAt(0,0,0);ai.updateMatrixWorld(!0);ai.matrixAutoUpdate=!1;var Xv=new d.Vector4,_v=new d.Vector4;function Wv(n){if(Mi.map){var r=n.getViewport(Xv),i=n.getScissor(_v),a=n.getScissorTest(),o=n.autoClear,s=i.x+ps[0]/3,l=i.y+ps[1]/3,u=hs[0]/3,c=hs[1]/3;n.setViewport(s,l,u,c),n.setScissor(s,l,u,c),n.setScissorTest(!0),n.autoClear=!1,n.render(Oo,ai),n.setViewport(r),n.setScissor(i),n.setScissorTest(a),n.autoClear=o}else{var t=new d.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=d.ClampToEdgeWrapping,t.wrapT=d.ClampToEdgeWrapping,t.minFilter=d.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,Mi.needsUpdate=!0,e.onload=Q},e.src=Gv,Mi.map=t}}var Zv=800,vs=90,Yv=function(n){return n.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},$v=new d.Vector2,Ai=new d.Frustum,mi=new d.Matrix4,As=new WeakMap,Fa=new WeakMap,ms=ja([]),al=function(n){se(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,c,f,v,m,h=n.call(this)||this;if(h.ident=Ct(),typeof window!="undefined"&&(eo.instances[h.ident]=h),h.renderSwitch01=0,h.currentMode="Panorama",h.pano={workCode:"",panoIndex:0},h.needsRender=!1,h.modelSceneNeedsRender=!1,h.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,h.imageOptions=F({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=F({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),h.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,h.extraElements=[],h.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},h.fps={testCount:0,testTime:Ce()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:Zv,h.enableWheel=(l=e.enableWheel)!==null&&l!==void 0?l:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof rn&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new rn({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision});var p=nl();h.renderer.setPixelRatio(p===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(O){O instanceof Error&&h.throwError(O)}h.getPixelsRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(c=(u=h.renderer)===null||u===void 0?void 0:u.outputEncoding)!==null&&c!==void 0?c:d.sRGBEncoding,generateMipmaps:!1});var g=new d.DepthTexture(1,1);g.generateMipmaps=!1,g.format=d.DepthStencilFormat,g.type=d.UnsignedInt248Type,h.modelRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(v=(f=h.renderer)===null||f===void 0?void 0:f.outputEncoding)!==null&&v!==void 0?v:d.sRGBEncoding,depthTexture:g,generateMipmaps:!1,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new Vs(vs),h.scene=new zs,h.xrCustomObjectsScene=new d.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(m=e.requestProxy)!==null&&m!==void 0?m:Yv,h.networkSubscribe=new Ss,h.networkSubscribe.on("network",function(O,C,P,z){var T;h.emit("network.resource",X("network.resource",{source:O,requestType:C,requestState:P,detail:z})),(T=h.analysis)===null||T===void 0||T.network(h.works,O,C,P,z)}),h.boundingMesh=Wh(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=N0(),h.models.push(new _a),h.lastModels=N0(),h.lastWorks=ja([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new d.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new d.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new d.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new d.VideoTexture(e.videoInstance||Hv()),fs(h.scene),fs(h.modelScene),h.state={mode:h.currentMode,workCode:h.pano.workCode,panoIndex:h.pano.panoIndex,longitude:h.camera.pose.longitude,latitude:h.camera.pose.latitude,fov:h.camera.pose.fov,offset:h.camera.pose.offset.clone(),distance:h.camera.pose.distance},h.stateSynced=!1,h._enablePostProcessing=!1,h._enableIOSEDR=!1,h._enableEDL=!1,h._enableHQ=!1,h.destroyed=!1,h.paused=!0,typeof window!="undefined"&&(e.play!==!1&&h.play(),h.stopAnimationLoop=lt.shared.add(function(O,C){for(var P=[],z=2;z<arguments.length;z++)P[z-2]=arguments[z];h.updateTime.apply(h,Et([O,C],P,!1))},!1,0,10));var A=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",X("vr.requestExit",{}))},y=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",A,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",y,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",A,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",y,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var x=0,b=e.plugins;x<b.length;x++){var w=b[x];if(typeof w=="function")w(h);else if(Array.isArray(w)){var E=w[0],S=w[1],M=w[2];if(typeof E=="function"){var R=E(h,M);typeof S=="string"&&(h.plugins[S]?h.throwError(new Error("plugin name ".concat(S," is exists."))):h.plugins[S]=R)}}}return h.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,qv(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.3.0-alpha.6"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Li.decoderPath},set:function(e){Li.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return Un.transcoderPath},set:function(e){Un.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new d.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.models.setMaterial({constantColor:o}),this.scene.traverse(function(f){if(!(!(f instanceof d.Mesh)||f instanceof Qt)){var v=Object.keys(i).filter(function(h){return h===f.uuid})[0];if(v)if(s.meshOriginMaterialMap.set(v,f.material),s.meshReplaceMaterialMap.get(v))f.material=s.meshReplaceMaterialMap.get(v);else{var m=new d.ShaderMaterial({uniforms:{color:{value:i[v]}},vertexShader:`
2161
2161
  void main() {
2162
2162
  vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
2163
2163
  gl_Position = projectionMatrix * mvPosition;