@realsee/five 6.7.0-alpha.10 → 6.7.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +9 -9
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +9 -9
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +9 -9
- package/five/index.js +6 -6
- package/five/index.mjs +7 -7
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/package.json +1 -1
- package/plugins/index.js +2 -2
- package/plugins/index.mjs +2 -2
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.js +2 -2
- package/shader-lib/index.mjs +2 -2
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +2 -2
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +2 -2
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +6 -6
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
- package/work-downloader/index.js +2 -2
- package/work-downloader/index.mjs +2 -2
package/umd/five.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 10/
|
|
5
|
-
* Version: 6.7.0-alpha.
|
|
4
|
+
* Generated: 2025/10/29
|
|
5
|
+
* Version: 6.7.0-alpha.11
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -1570,7 +1570,7 @@ void main() {
|
|
|
1570
1570
|
float cameraDepth = length(cameraVertex);
|
|
1571
1571
|
gl_FragColor = packDepthToRGBA(clamp(cameraDepth / maxDepth, 0.0, 1.0));
|
|
1572
1572
|
}
|
|
1573
|
-
`,depthMaterial=new THREE__namespace.ShaderMaterial({vertexShader:depthVertexShader,fragmentShader:depthFragmentShader,uniforms:{maxDepth:new THREE__namespace.Uniform(0)}});function renderDepthCube(n,t,e,r){r===void 0&&(r=1e3),depthMaterial.uniforms.maxDepth.value=r,scratchPrevClearColor.copy(n.getClearColor());var o=n.getClearAlpha(),s=t.overrideMaterial;t.overrideMaterial=depthMaterial,n.setClearColor(clearColor,0),e.update(n,t),n.setClearColor(scratchPrevClearColor,o),t.overrideMaterial=s}function defaultEffectEase(n){return n}var scratchRaycaster$1=new THREE__namespace.Raycaster,scratchVector3$3=new THREE__namespace.Vector3,adjustPanoCircleMeshVectors=[new THREE__namespace.Vector3(0,0,0).multiplyScalar(.1),new THREE__namespace.Vector3(1,0,0).multiplyScalar(.1),new THREE__namespace.Vector3(-.5,0,-Math.sqrt(3)/2).multiplyScalar(.1),new THREE__namespace.Vector3(-.5,0,+Math.sqrt(3)/2).multiplyScalar(.1)],defaultPanoramaControllerCustomInitArgs=__assign(__assign({},defaultPanoramaLikeControllerCustomInitArgs),{maxAccessibleDistance:5,panoTapTriggerRadius:.5,panoCircleMeshCreator:function(n){return new PanoCircleMesh},adjustPanoCircleMeshPositionBasedOnModel:!1,tileLevelForFov:(function(n,t){var e,r=function(l){return l/180*Math.PI},o=(e=Math.log2)!==null&&e!==void 0?e:(function(l){return Math.log(l)*Math.LOG2E}),s=t.height/2/Math.tan(r(n/2))*Math.tan(r(45))*2,u=Math.max(o(s/512),0);return u<2.3&&u>.1&&(u=1),u=u%1>.75?Math.ceil(u):Math.floor(u),u}),tileAppearDuration:.5,tileMaxRequest:3,flyEffectUseDepthBuffer:!1}),PanoramaController=(function(n){__extends(t,n);function t(e){var r=this,o=t.parseArgs(e);r=n.call(this,o)||this,r.mode="Panorama",r.initAnimationed=!1,r.maxAccessibleDistance=o.maxAccessibleDistance,r.panoTapTriggerRadius=o.panoTapTriggerRadius,r.panoCircleMeshCreator=o.panoCircleMeshCreator,r.adjustPanoCircleMeshPositionBasedOnModel=o.adjustPanoCircleMeshPositionBasedOnModel,r.tileLevelForFov=o.tileLevelForFov,r.tileAppearDuration=o.tileAppearDuration,r.tileMaxRequest=o.tileMaxRequest,r.flyEffectUseDepthBuffer=o.flyEffectUseDepthBuffer,r.adjustPanoCircleMeshPositionFix=new Map;var s=r.modelScene.parameter.resolveValue(),u=s.pano0,l=s.pano1;u&&(l==null?void 0:l.map)!==u.map&&(r.modelScene.parameter.set({pano0:l}),u.map.dispose());var c=new Set;return u&&c.add(u),l&&c.add(l),r.panoMeshes=new Map,r.locationMotion=new Motion({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Motion({modelAlpha:r.modelScene.parameter.resolveValue().modelAlpha}),r.perspToOrthoMotion=new Motion({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=createUuid()]={panoId:panoStringify(r.currentPano),panoPicture:r.modelScene.parameter.resolveValue().pano1,position:r.camera.pose.offset.clone(),effect:"fly",effectEasing:defaultEffectEase,fixCameraTransform:new THREE__namespace.Matrix4},r.panoPictureObserverMap=new WeakMap,r.textureLoader=new TextureLoader,r.tiling=new Tiling,r.panoVideo=new PanoVideo,r.scene.add(r.panoVideo.object),r.accessibleObserverFloorCheckCount=0,r}return t.parseArgs=function(e){var r,o,s,u,l,c,p,f;if(e instanceof t)return e;var d=n.parseArgs.call(this,e);return __assign(__assign({},d),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:defaultPanoramaControllerCustomInitArgs.maxAccessibleDistance,panoTapTriggerRadius:(o=e.panoTapTriggerRadius)!==null&&o!==void 0?o:defaultPanoramaControllerCustomInitArgs.panoTapTriggerRadius,panoCircleMeshCreator:(s=e.panoCircleMeshCreator)!==null&&s!==void 0?s:defaultPanoramaControllerCustomInitArgs.panoCircleMeshCreator,adjustPanoCircleMeshPositionBasedOnModel:(u=e.adjustPanoCircleMeshPositionBasedOnModel)!==null&&u!==void 0?u:defaultPanoramaControllerCustomInitArgs.adjustPanoCircleMeshPositionBasedOnModel,tileLevelForFov:(l=e.tileLevelForFov)!==null&&l!==void 0?l:defaultPanoramaControllerCustomInitArgs.tileLevelForFov,tileAppearDuration:(c=e.tileAppearDuration)!==null&&c!==void 0?c:defaultPanoramaControllerCustomInitArgs.tileAppearDuration,tileMaxRequest:(p=e.tileMaxRequest)!==null&&p!==void 0?p:defaultPanoramaControllerCustomInitArgs.tileMaxRequest,flyEffectUseDepthBuffer:(f=e.flyEffectUseDepthBuffer)!==null&&f!==void 0?f:defaultPanoramaControllerCustomInitArgs.flyEffectUseDepthBuffer})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),o=n.initAnimationEndState.call(this,r);return __assign(__assign({},o),{mode:"Panorama"})},Object.defineProperty(t.prototype,"tileLevel",{get:function(){return this.tiling.level},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e){var r=this,o=n.prototype.updateConfiguration.call(this,e);return o===!1?!1:(e.maxAccessibleDistance!==void 0&&this.maxAccessibleDistance!==e.maxAccessibleDistance&&(this.maxAccessibleDistance=e.maxAccessibleDistance),e.panoTapTriggerRadius!==void 0&&this.panoTapTriggerRadius!==e.panoTapTriggerRadius&&(this.panoTapTriggerRadius=e.panoTapTriggerRadius),e.panoCircleMeshCreator!==void 0&&this.panoCircleMeshCreator!==e.panoCircleMeshCreator&&(this.panoCircleMeshCreator=e.panoCircleMeshCreator,this.panoMeshes&&(this.panoMeshes.forEach(function(s){r.helper.remove(s),s.dispose()}),this.panoMeshes.clear())),e.tileLevelForFov!==void 0&&this.tileLevelForFov!==e.tileLevelForFov&&(this.tileLevelForFov=e.tileLevelForFov),e.tileMaxRequest!==void 0&&this.tileMaxRequest!==e.tileMaxRequest&&(this.tileMaxRequest=e.tileMaxRequest),e.flyEffectUseDepthBuffer!==void 0&&this.flyEffectUseDepthBuffer!==e.flyEffectUseDepthBuffer&&(this.flyEffectUseDepthBuffer=e.flyEffectUseDepthBuffer),e.adjustPanoCircleMeshPositionBasedOnModel!==void 0&&this.adjustPanoCircleMeshPositionBasedOnModel!==e.adjustPanoCircleMeshPositionBasedOnModel&&(this.adjustPanoCircleMeshPositionBasedOnModel=e.adjustPanoCircleMeshPositionBasedOnModel,this.adjustPanoCircleMeshPositionBasedOnModel||this.adjustPanoCircleMeshPositionFix.clear()),!0)},t.prototype.destroy=function(){var e=this;n.prototype.destroy.call(this),this.tiling.dispose(),this.modelScene.parameter.set({refinedScreen:null,pano0Depth:null,pano1Depth:null}),this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0),this.locationMotion.dispose(),this.pendingTextureTask=void 0,this.panoMeshes&&(this.panoMeshes.forEach(function(h){e.helper.remove(h),h.dispose()}),this.panoMeshes.clear());var r=this.videoTexture.image;r.pause(),r.oncanplay=noop,r.ontimeupdate=noop,this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var o=this.modelScene.parameter.resolveValue(),s=o.pano0,u=o.pano1,l=0,c=Object.keys(this.panoResources);l<c.length;l++){var p=c[l],f=this.panoResources[p];if(f.panoPicture){var d=f.panoPicture.map;d&&d!==(s==null?void 0:s.map)&&d!==(u==null?void 0:u.map)&&(d.dispose(),f.panoPicture=null)}delete this.panoResources[p]}},t.prototype.isReady=function(){return this.locationMotion.ended!==!0?!1:n.prototype.isReady.call(this)},t.prototype.isTileReady=function(){var e=this.tiling.pedding,r=e<=0;return this.initAnimationed&&r},t.prototype.updateWork=function(e,r,o,s){var u=this;this.userAction=s,this.works=e;var l=t.initAnimationEndState(__assign(__assign({},this),{initial:{currentState:__assign(__assign({},this.currentPano),this.camera.pose),duration:o.duration,effect:o.effect,state:r,userAction:s}})),c={workCode:l.workCode,panoIndex:l.panoIndex};return this.initAnimationed=!1,this.hideIntersectMesh(),this.moveToPano(c,{effect:o.effect,duration:o.duration,longitude:r.longitude,latitude:r.latitude,fov:r.fov,moveEndCallback:function(){u.initAnimationed=!0},moveCancelCallback:function(){u.initAnimationed=!0}},s),!0},t.prototype.updateModel=function(e){this.modelScene=e,this.hideIntersectMesh()},t.prototype.updateTime=function(e,r){var o=this,s,u,l,c,p,f;if(!this.destroyed){var d={},h={},m=this.locationMotion.keyframes[0],A=this.locationMotion.keyframes[this.locationMotion.keyframes.length-1],g=this.locationMotion.getKeyFrameSegment(e),E=g[0],v=g[1],y=this.panoResourceFromLocationMotionKeyframe(E),b=this.panoResourceFromLocationMotionKeyframe(v),T=this.panoResourceFromLocationMotionKeyframe(m),_=this.panoResourceFromLocationMotionKeyframe(A),S=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),h.longitude=this.cameraMotion.value.longitude,h.latitude=this.cameraMotion.value.latitude,h.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),d.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=new THREE__namespace.Vector3().copy(y.position),R=new THREE__namespace.Vector3().copy(b.position),M=this.locationMotion.value.count-v.value.count+1;if(d.progress=b.effectEasing(M),b.panoPicture&&(M<1?y.panoPicture&&(d.pano0=y.panoPicture):d.pano0=b.panoPicture,d.pano1=b.panoPicture),b.effect==="montage"?d.transition="BLACK":b.effect==="spread"?d.transition="SPREAD":d.transition="FADE",b.effect==="zoomin"||b.effect==="zoomout")d.progress=Math.pow(M,3);else if(b.effect==="model"&&this.camera.pose.distance<.01){var B=1-Math.pow(clamp$1(Math.abs(M-.5)*2,0,1),4);d.modelAlpha=B}if(M<1&&b.effect!=="fly"&&b.effect!=="model"){if(d.pano0&&y.panoPicture){var C={panoId:d.pano0.panoId,map:d.pano0.map,mapSize:d.pano0.mapSize,zoom:d.pano0.zoom,matrix:y.panoPicture.matrix.clone().premultiply(y.fixCameraTransform).setPosition(b.position)},I=this.panoPictureObserverMap.get(d.pano0);I&&this.panoPictureObserverMap.set(C,I),d.pano0=C}w.copy(R),S=!0}h.distance=this.locationMotion.value.distance,h.offset=new THREE__namespace.Vector3(w.x+(R.x-w.x)*M,w.y+(R.y-w.y)*M,w.z+(R.z-w.z)*M);for(var L=[],O=[],F=0,N=this.locationMotion.keyframes;F<N.length;F++){var D=N[F],q=D.key,z=D.progress;q!==void 0&&(L.push(q),z>this.locationMotion.progress&&O.push(q))}for(var j=0,J=Object.keys(this.panoResources);j<J.length;j++){var V=J[j];if(!(O.indexOf(V)>=0)){var U=this.panoResources[V];if(U.panoPicture){var G=U.panoPicture.map;if(G){if(G===((s=d.pano0)===null||s===void 0?void 0:s.map)||G===((u=d.pano1)===null||u===void 0?void 0:u.map))continue;G.dispose(),U.panoPicture=null}}L.indexOf(V)>=0||delete this.panoResources[V]}}var Z=panoParse(b.panoId);Z!==this.currentPano&&(this.currentPano=Z,this.accessibleObserverFloorCheckCount=0),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(T.panoId),state:__assign(__assign(__assign(__assign({},panoParse(_.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),h),options:{},progress:this.locationMotion.progress,error:null}))}isEmptyObject(d)===!1&&this.modelScene.parameter.set(d),isEmptyObject(h)===!1&&this.setCamera(h);var W=this.works.getObserver(this.currentPano),ee=this.locationMotion.ended?this.getForwardObserverOrNot(this.camera):null,X=this.works.getObserver(y.panoId),K=this.works.getObserver(b.panoId);if(this.adjustPanoCircleMeshPositionBasedOnModel&&this.helper.visible&&W){for(var $=[],re=W.work.observers,ne=0,ae=W.accessibleNodes;ne<ae.length;ne++){var le=ae[ne],I=re[le];I&&$.push(I)}var se=new Map;if($.sort(function(ie,_e){var Pe=se.get(ie);typeof Pe=="undefined"&&(Pe=ie.standingPosition.distanceTo(W.standingPosition),se.set(ie,Pe));var Ce=se.get(ie);return typeof Ce=="undefined"&&(Ce=_e.standingPosition.distanceTo(W.standingPosition),se.set(_e,Ce)),Pe-Ce}),$.length){this.accessibleObserverFloorCheckCount=this.accessibleObserverFloorCheckCount%$.length;var ce=$[this.accessibleObserverFloorCheckCount],me=this.modelScene.models.find(function(ie){return ie.work===(ce==null?void 0:ce.work)});if(ce&&me&&me.visible){var Ae=.3,be=.05,de=.005,he=ce.standingPosition.clone().applyMatrix4(ce.work.transform),fe=panoStringify({panoIndex:ce.panoIndex,workCode:ce.work.workCode}),te=adjustPanoCircleMeshVectors.map(function(ie){scratchRaycaster$1.ray.origin.copy(he),scratchRaycaster$1.ray.origin.add(scratchVector3$3.copy(ie).setY(Ae)),scratchRaycaster$1.ray.direction.set(0,-1,0),scratchRaycaster$1.firstHitOnly=!0,scratchRaycaster$1.floorIndex=-1;var _e=me.intersectRaycaster(scratchRaycaster$1)[0];return _e&&_e.distance-de<=Ae?new THREE__namespace.Vector3().copy(he).setY(_e.point.y+de):he});te.sort(function(ie,_e){return _e.y-ie.y});var ue=te[Math.floor(te.length/2)],Te=te.filter(function(ie){return ie.distanceTo(ue)<=be})[0];if(Te){var xe=new THREE__namespace.Vector4(he.x,he.y,he.z,Te.y-he.y),Xe=this.adjustPanoCircleMeshPositionFix.get(fe);Xe&&!xe.equals(Xe)&&(this.needsRender=!0),this.adjustPanoCircleMeshPositionFix.set(fe,xe)}}this.accessibleObserverFloorCheckCount++}}var Je=new Map;if(X)for(var ze=0,ve=X.accessibleNodes;ze<ve.length;ze++){var le=ve[ze],I=X.work.observers[le];if(I){var fe=panoStringify({panoIndex:I.panoIndex,workCode:I.work.workCode});Je.set(fe,I)}}if(K)for(var Ge=0,ye=K.accessibleNodes;Ge<ye.length;Ge++){var le=ye[Ge],I=K.work.observers[le];if(I){var fe=panoStringify({panoIndex:I.panoIndex,workCode:I.work.workCode});Je.set(fe,I)}}if(this.panoMeshes.forEach(function(ie,_e){var Pe=Je.get(_e);if(Pe){ie.position.copy(Pe.standingPosition).applyMatrix4(Pe.work.transform);var Ce=o.adjustPanoCircleMeshPositionFix.get(_e);Ce&&(scratchVector3$3.set(Ce.x,Ce.y,Ce.z),scratchVector3$3.equals(ie.position)&&(ie.position.y+=Ce.w)),ie.scale.setScalar(1.2),Je.delete(_e)}else o.helper.remove(ie),ie.dispose(),o.panoMeshes.delete(_e)}),Je.forEach(function(ie,_e){var Pe=o.panoCircleMeshCreator(panoParse(_e));Pe.position.copy(ie.standingPosition).applyMatrix4(ie.work.transform);var Ce=o.adjustPanoCircleMeshPositionFix.get(_e);Ce&&(scratchVector3$3.set(Ce.x,Ce.y,Ce.z),scratchVector3$3.equals(Pe.position)&&(Pe.position.y+=Ce.w)),Pe.scale.setScalar(1.2),o.panoMeshes.set(_e,Pe),o.helper.add(Pe),Je.delete(_e)}),this.camera.pose.distance>.1||S)this.panoMeshes.forEach(function(ie){ie.setOpacity(0),ie.setCurrent(!1),ie.updateTime&&ie.updateTime(e,r),ie.visible=!1});else if(W){var Ne=W.work.observers,Be=arrayMin(W.accessibleNodes,function(ie){var _e=Ne[ie];return _e?W.standingPosition.distanceTo(_e.standingPosition):1/0},!0),Ye=Be[1];Ye=clamp$1(Ye,2.5,1/0);var nt=W.visibleNodes.concat(W.panoIndex).map(function(ie){return panoStringify({panoIndex:ie,workCode:W.work.workCode})}),De=this.camera.getDirection(new THREE__namespace.Vector3);this.panoMeshes.forEach(function(ie,_e){var Pe=o.works.getObserver(_e);if(nt.indexOf(_e)===-1)ie.setCurrent(!1),ie.setOpacity(0);else if(!Pe)ie.setCurrent(!1),ie.setOpacity(0);else if(!Pe.loadable&&!Pe.active)ie.setCurrent(!1),ie.setOpacity(0);else{var Ce=ie.position.clone().setY(o.camera.position.y).distanceTo(o.camera.position);ie.setCurrent(!ie.loading&&ie.progress===0&&ee!==null&&panoStringify({panoIndex:ee.panoIndex,workCode:ee.work.workCode})===_e),ie.setOpacity(Ce<.01?0:clamp$1(Ye/Ce*1.2,.4,.85));var yt=o.camera.position.clone().setY(ie.position.y),ct=new THREE__namespace.Vector3().copy(ie.position).sub(yt).normalize();if(_e===panoStringify(o.currentPano)){var Et=clamp$1((.5-yt.distanceTo(ie.position))/.5,0,1);ct.multiplyScalar(1-Et).add(De.clone().multiplyScalar(Et))}ct.length()>0&&ie.quaternion.setFromEuler(new THREE__namespace.Euler(0,Math.atan2(ct.x,ct.z),0))}ie.updateTime&&ie.updateTime(e,r)})}{var M=(l=this.modelScene.parameter.progress)!==null&&l!==void 0?l:1,qe=Math.round(M),He=this.modelScene.parameter.pano0,ge=this.modelScene.parameter.pano1,Se=qe===0?He:ge,I=void 0;if(Se&&(I=this.works.getObserver(Se.panoId),I||(I=this.panoPictureObserverMap.get(Se))),this.tiling.appearDuration=this.tileAppearDuration,this.tiling.maxRequest=M<.6?0:this.tileMaxRequest,this.tiling.imageOptions=this.imageOptions,!I||!Se||this.tileLevelForFov===!1||this.camera.perspToOrtho.x>0){this.tiling.setObserver(null);var Me={renderer:this.renderer,resolution:this.camera.resolution,pixelRatio:this.camera.pixelRatio,time:this.camera.time,cameraMatrix:this.camera.matrixWorld,cameraProjectionMatrix:this.camera.projectionMatrix,panoMap:null,panoMatrix:new THREE__namespace.Matrix4,panoZoom:1,minLevel:0,level:0};this.tiling.update(Me),this.modelScene.parameter.set("refinedScreen",null)}else{var je=getImageSizeLevel(Se.mapSize),Ue=je+1,tt=new THREE__namespace.Vector2().copy(this.camera.resolution).multiplyScalar(this.camera.pixelRatio),dt=Math.floor(this.tileLevelForFov(this.camera.fov,tt)),Ve=dt>je?dt:0;this.tiling.setObserver(I);var Me={renderer:this.renderer,resolution:this.camera.resolution,pixelRatio:this.camera.pixelRatio,time:this.camera.time,cameraMatrix:this.camera.matrixWorld,cameraProjectionMatrix:this.camera.projectionMatrix,panoMap:Se.map,panoMatrix:Se.matrix,panoZoom:Se.zoom,minLevel:Ue,level:Ve},Ct=this.tiling.update(Me),Ie={map:this.tiling.renderTarget.texture,matrixInverse:this.tiling.camera.matrixWorldInverse,projectionMatrix:this.tiling.camera.projectionMatrix,pano:qe,opacity:(He==null?void 0:He.panoId)===(ge==null?void 0:ge.panoId)?1:easeInQuart(Math.abs(((c=this.modelScene.parameter.progress)!==null&&c!==void 0?c:0)-.5)*2)},Oe=this.modelScene.parameter.refinedScreen;(Ct||Ie.pano!==(Oe==null?void 0:Oe.pano)||Ie.opacity!==(Oe==null?void 0:Oe.opacity))&&this.modelScene.parameter.set("refinedScreen",Ie)}}if(this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),W&&W.video&&(this.needsRender=!0),this.intersectMesh&&this.intersectMesh.parent&&W&&W.position.y-W.standingPosition.y>10){var gt=this.camera.position.distanceTo(this.intersectMesh.position),Mt=2*Math.tan(.5*this.camera.fov/180*Math.PI),At=gt*Mt/5;this.intersectMesh.scale.setScalar(At)}else this.intersectMesh.scale.setScalar(1);{var ht=b.effect,_t=this.modelScene.parameter,He=_t.pano0,ge=_t.pano1;if(He&&ge&&He!==ge&&(ht==="fly"||ht==="model")&&this.flyEffectUseDepthBuffer){if(((p=this.modelScene.parameter.pano0Depth)===null||p===void 0?void 0:p.panoId)!==He.panoId||((f=this.modelScene.parameter.pano1Depth)===null||f===void 0?void 0:f.panoId)!==ge.panoId){var Ke=500,Ze=512;this.pano0DepthCubeRenderTarget?this.pano0DepthCubeRenderTarget.width!==Ze&&this.pano0DepthCubeRenderTarget.setSize(Ze,Ze):this.pano0DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(Ze,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1}),this.pano1DepthCubeRenderTarget?this.pano1DepthCubeRenderTarget.width!==Ze&&this.pano1DepthCubeRenderTarget.setSize(Ze,Ze):this.pano1DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(Ze,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1});var at=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano0DepthCubeRenderTarget);at.matrix.copy(He.matrix),at.matrixWorld.copy(at.matrix),at.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,at,Ke);var Qe=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano1DepthCubeRenderTarget);Qe.matrix.copy(ge.matrix),Qe.matrixWorld.copy(Qe.matrix),Qe.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,Qe,Ke),this.modelScene.parameter.set({pano0Depth:{panoId:He.panoId,map:this.pano0DepthCubeRenderTarget.texture,mapSize:this.pano0DepthCubeRenderTarget.width,maxDepth:Ke},pano1Depth:{panoId:ge.panoId,map:this.pano1DepthCubeRenderTarget.texture,mapSize:this.pano1DepthCubeRenderTarget.width,maxDepth:Ke}})}}else this.modelScene.parameter.set({pano0Depth:null,pano1Depth:null}),this.flyEffectUseDepthBuffer||(this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0))}}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1],o=this.panoResourceFromLocationMotionKeyframe(r),s=this.works.getObserver(o.panoId);return{workCode:s?s.work.workCode:this.currentPano.workCode,panoIndex:s?s.panoIndex:this.currentPano.panoIndex,mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:s?s.position.clone().applyMatrix4(s.work.transform):this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,r,o){var s=this,u,l,c,p=(u=r.effect)!==null&&u!==void 0?u:"fly";this.userAction=o,this.stopMomentumMovement();var f=panoStringify(e),d=this.works.getObserver(e);if(!d)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));getImageSizeFromURL(d.images.up),this.imageOptions.size;var h=this.imageOptions.transform,m=__assign({key:"pano.".concat(f)},pick(this.imageOptions,["format","size","quality","sharpen","forceUseExifOrientation","mappings"])),A={right:d.images.work.getURL(d.images.right),left:d.images.work.getURL(d.images.left),up:d.images.work.getURL(d.images.up),down:d.images.work.getURL(d.images.down),front:d.images.work.getURL(d.images.front),back:d.images.work.getURL(d.images.back)},g="pano:"+jsonHash([A,m,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===g)return;var E=this.pendingTextureTask.panoId;(l=this.panoMeshes.get(E))===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",createEvent("pano.texture.abort",{error:null,progress:0,meta:null,pano:{panoIndex:d.panoIndex,workCode:d.work.workCode}}))}var v="move-to-pano-"+f;this.pending.add(v);var y=this.modelScene.parameter,b;if(y.pano0&&y.pano0.map.name===g?b=y.pano0:y.pano1&&y.pano1.map.name===g&&(b=y.pano1),b){var T={panoId:f,effect:p,effectEasing:(c=r.effectEasing)!==null&&c!==void 0?c:defaultEffectEase,panoPicture:{panoId:b.panoId,map:b.map,mapSize:b.mapSize,matrix:d.matrix.clone().premultiply(d.work.transform),zoom:1},position:d.position.clone().applyMatrix4(d.work.transform),fixCameraTransform:new THREE__namespace.Matrix4};T.panoPicture&&this.panoPictureObserverMap.set(T.panoPicture,d),this.pendingTextureTask=void 0,AnimationFrameLoop.shared.add(function(){s.pending.delete(v),s.doMoveToPano(e,T,r)},!0,1);return}this.pendingTextureTask={panoId:f,hash:g,onLoad:function(S){var w,R,M=S.body;if(s.destroyed)M.dispose();else{M.name=g;var B=Array.isArray(M.image)?M.image[0]:M.image,C=(w=B==null?void 0:B.width)!==null&&w!==void 0?w:2048,I={panoId:f,effect:p,effectEasing:(R=r.effectEasing)!==null&&R!==void 0?R:defaultEffectEase,panoPicture:{panoId:f,map:M,mapSize:C,matrix:d.matrix.clone().premultiply(d.work.transform),zoom:1},position:d.position.clone().applyMatrix4(d.work.transform),fixCameraTransform:new THREE__namespace.Matrix4};I.panoPicture&&s.panoPictureObserverMap.set(I.panoPicture,d),s.doMoveToPano(e,I,r)}},onError:function(S){var w=__assign(__assign(__assign({},e),{mode:s.mode}),clonePose(s.camera.pose));s.emit("pano.error",createEvent("pano.error",{error:S,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:w})),s.emit("pano.cancel",createEvent("pano.cancel",{error:S,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:w})),s.emit("error",S),r.moveCancelCallback&&r.moveCancelCallback()}};var _=this.panoMeshes.get(f);_&&_.tap&&_.tap(),this.textureLoader.loadCubeTexture(A,{imageURL:{transform:h,options:m},format:THREE__namespace.RGBAFormat,viaAjax:!0,fetcher:getFetcher(d.work)},void 0,void 0,function(S){var w,R;s.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:S,meta:null,pano:e})),((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===g&&((R=s.panoMeshes.get(f))===null||R===void 0||R.setProgress(S))},this.renderer).then(function(S){var w,R;s.pending.delete(v),((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===g?(s.pendingTextureTask.onLoad(S),s.pendingTextureTask=void 0,(R=s.panoMeshes.get(f))===null||R===void 0||R.setProgress(0)):S.body.dispose(),s.emit("pano.texture.success",createEvent("pano.texture.success",{error:null,progress:1,meta:S.meta,pano:e}))}).catch(function(S){var w,R;s.pending.delete(v),((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===g&&(s.pendingTextureTask.onError(S),s.pendingTextureTask=void 0,(R=s.panoMeshes.get(f))===null||R===void 0||R.setProgress(0)),s.emit("pano.texture.error",createEvent("pano.texture.error",{error:S,progress:0,meta:null,pano:e})),s.emit("error",S)}),this.emit("pano.texture.load",createEvent("pano.texture.load",{error:null,progress:0,meta:null,pano:e}))},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var o=e.initial,s=o.duration,u=o.effect,l=o.userAction;e.userAction=l;var c=t.initAnimationEndState(e),p={workCode:c.workCode,panoIndex:c.panoIndex},f={modelAlpha:0},d={perspToOrtho:0},h=!1;e.moveToPano(p,{longitude:c.longitude,latitude:c.latitude,fov:c.fov,effect:u,duration:s,moveStartCallback:function(m){h=!0,e.perspToOrthoMotion.set(d,s).catch(noop),e.modelAlphaMotion.setKeyframes([{progress:0,value:__assign({},e.modelAlphaMotion.value)},{progress:.6,value:__assign({},e.modelAlphaMotion.value)},{progress:1,value:f}],s).catch(noop),e.emit("initAnimation.start",createEvent("initAnimation.start",{state:m,userAction:e.userAction}))},moveEndCallback:function(m){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:m,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var m=__assign(__assign(__assign({},p),{mode:e.mode}),clonePose(e.camera.pose));h===!1&&e.emit("initAnimation.start",createEvent("initAnimation.start",{state:m,userAction:e.userAction})),e.emit("initAnimation.end",createEvent("initAnimation.end",{state:m,userAction:e.userAction})),e.initAnimationed=!0,r()}},l)})},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var r=0,o=1;o<e.length;o++){var s=this.panoResourceFromLocationMotionKeyframe(e[o-1]).position,u=this.panoResourceFromLocationMotionKeyframe(e[o]).position,l=s.distanceTo(u)*(e[o].value.count-e[o-1].value.count);r+=l}return r},t.prototype.doMoveToPano=function(e,r,o){var s=this,u,l,c,p,f,d,h,m,A,g,E;o===void 0&&(o={});var v=now(),y=createUuid();this.panoResources[y]=r;var b=1,T,_,S;if(this.locationMotion.ended){var w=this.locationMotion.getKeyFrameSegment(v);w[0];var R=w[1],M=this.locationMotion.value,B=((u=this.panoResourceFromLocationMotionKeyframe(R))!==null&&u!==void 0?u:this.camera).position,C=r.position;T=Math.max(B.distanceTo(C),b),_=[{key:R.key,progress:0,value:__assign(__assign({},M),{count:0})},{key:y,progress:1,value:{distance:0,count:1}}],S=0}else{var I=this.locationMotion.getKeyFrameSegment(v),L=I[0],R=I[1],M=this.locationMotion.value,O=this.panoResourceFromLocationMotionKeyframe(L).position,B=this.panoResourceFromLocationMotionKeyframe(R).position,C=r.position,F=R.value.count-M.count,N=Math.max(O.distanceTo(B),b)*F,D=Math.max(B.distanceTo(C),b);T=N+D,_=[{key:L.key,progress:0,value:__assign({},M)},{key:R.key,progress:N/T,value:R.value},{key:y,progress:1,value:{count:R.value.count+1,distance:0}}];var q=this.locationMotionKeyframesLength(this.locationMotion.keyframes),z=this.locationMotionKeyframesLength(_);q===0||q===0?S=0:S=this.locationMotion.getProgressVelocity(v)*q/z}var j=r.effect==="instant"?0:this.calculateMovingDuration(o.duration,r.effect==="fly"||r.effect==="model"?T:0),J={longitude:o.longitude,latitude:o.latitude,fov:o.fov},V=__assign(__assign({},e),{mode:this.mode,longitude:(l=J.longitude)!==null&&l!==void 0?l:this.camera.pose.longitude,latitude:(c=J.latitude)!==null&&c!==void 0?c:this.camera.pose.latitude,fov:(p=J.fov)!==null&&p!==void 0?p:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),U=this.currentPano;if(this.emit("pano.moveTo",createEvent("pano.moveTo",{options:o,prevPano:U,progress:0,state:V,userAction:this.userAction,error:null})),o.moveStartCallback&&o.moveStartCallback(V),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=noop,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly"||r.effect==="model")this.cameraMotion.set(J,j).catch(noop);else{var G=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),Z=coordinatesToVector({longitude:(f=J.longitude)!==null&&f!==void 0?f:this.cameraMotion.value.longitude,latitude:(d=J.latitude)!==null&&d!==void 0?d:this.cameraMotion.value.latitude}),W=new THREE__namespace.Object3D;W.lookAt(G);var ee=new THREE__namespace.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(Z);var X=new THREE__namespace.Matrix4().makeRotationFromQuaternion(W.quaternion),K=new THREE__namespace.Matrix4().getInverse(ee).premultiply(X),$=this.cameraMotion.value.fov,re=(h=J.fov)!==null&&h!==void 0?h:this.cameraMotion.value.fov,ne=1;r.effect==="zoomin"?ne=1.5:r.effect==="zoomout"&&(ne=.4);for(var ae=clamp$1(re*ne,1,170),le=0;le<_.length-1;le++){var se=_[le].key;if(se){var ce=this.panoResources[se];ce&&(ce.fixCameraTransform.copy(K),ce.panoPicture&&(ce.panoPicture.zoom=Math.tan(ae/2/180*Math.PI)/Math.tan($/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:(m=J.longitude)!==null&&m!==void 0?m:this.cameraMotion.value.longitude,latitude:(A=J.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:ae}},{progress:1,value:{longitude:(g=J.longitude)!==null&&g!==void 0?g:this.cameraMotion.value.longitude,latitude:(E=J.latitude)!==null&&E!==void 0?E:this.cameraMotion.value.latitude,fov:re}}],j).catch(noop)}var me=this.locationMotion.setKeyframes(_,j,S);me.then(function(){for(var Ae=0,be=s.modelScene.children;Ae<be.length;Ae++){var de=be[Ae];de instanceof Model&&de.show()}var he=__assign(__assign({},e),{mode:s.mode,longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:s.camera.pose.distance});s.emit("pano.arrived",createEvent("pano.arrived",{options:o,prevPano:U,progress:1,state:he,userAction:s.userAction,error:null})),o.moveEndCallback&&o.moveEndCallback(he);var fe=s.works.getObserver(e);if(fe&&fe.video&&s.videoTexture&&s.videoTexture.image instanceof HTMLVideoElement){var te={map:s.videoTexture,size:fe.video.size.clone(),matrix:fe.video.matrix.clone(),panoMatrix:fe.matrix.clone().premultiply(fe.work.transform),alpha:1},ue=createUuid(),Te=s.videoTexture.image;Te.setAttribute("uuid",ue),Te.oncanplay=noop,Te.ontimeupdate=noop,canplayVideo().then(function(Xe){Xe&&fe.video&&Te.getAttribute("uuid")===ue&&(Te.oncanplay=function(){Te.oncanplay=noop,Te.play()},Te.ontimeupdate=function(){Te.currentTime>.5&&(Te.ontimeupdate=noop,s.panoVideo.setMaterial(te))},Te.src=fe.video.source)}).catch((function(){Te.removeAttribute("uuid")}))}else{var xe=s.videoTexture.image;xe.removeAttribute("uuid"),xe.oncanplay=noop,xe.ontimeupdate=noop}},function(){s.emit("pano.cancel",createEvent("pano.cancel",{options:o,prevPano:U,progress:0,state:V,userAction:s.userAction,error:null})),o.moveCancelCallback&&o.moveCancelCallback()})},t.prototype.getForwardObserverOrNot=function(e,r){var o=this,s=this.works.getObserver(this.currentPano);if(!s)return null;var u=r!=null?r:new THREE__namespace.Raycaster(e.position.clone(),e.getWorldDirection(new THREE__namespace.Vector3));u.params.Points={threshold:.1},u.firstHitOnly=!0,u.floorIndex=-1;var l=s.standingPosition.clone().applyMatrix4(s.work.transform),c=s.position.clone().applyMatrix4(s.work.transform);if(c.distanceTo(u.ray.origin)>1){var p=new THREE__namespace.Raycaster(u.ray.origin,new THREE__namespace.Vector3(0,-1,0));p.firstHitOnly=u.firstHitOnly,p.floorIndex=u.floorIndex;var f=this.modelScene.intersectRaycaster(p)[0];f&&f.distance<=2?l.copy(f.point):l.copy(u.ray.origin).add(new THREE__namespace.Vector3(0,-1.5,0))}var d=this.modelScene.intersectRaycaster(u)[0],h=d?d.point:u.ray.origin.clone().add(u.ray.direction.clone().normalize().multiplyScalar(3)),m=h.clone().sub(l).normalize();if(m.length()===0)return null;var A=s.work.observers,g=s.accessibleNodes.filter(function(q){if(q===o.currentPano.panoIndex&&s.work.workCode===o.currentPano.workCode)return!1;var z=A[q];if(!z)return!1;var j=z.standingPosition.clone().applyMatrix4(z.work.transform).project(e);return Math.abs(j.z)>1||Math.abs(j.x)>1||Math.abs(j.y)>1?!1:z.loadable||z.active}),E=new Map,v=g.slice().sort(function(q,z){var j=A[q],J=E.get(j);typeof J=="undefined"&&(J=scratchVector3$3.copy(j.standingPosition).applyMatrix4(j.work.transform).distanceTo(l),E.set(j,J));var V=A[z],U=E.get(V);return typeof U=="undefined"&&(U=scratchVector3$3.copy(V.standingPosition).applyMatrix4(V.work.transform).distanceTo(l),E.set(V,U)),J-U});E.clear();for(var y=0,b=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];y<b.length;y++)for(var T=b[y],_=0,S=v;_<S.length;_++){var w=S[_],R=A[w];if(R){var M=scratchVector3$3.copy(R.standingPosition).applyMatrix4(R.work.transform).sub(l);if(M&&M.length()!==0&&m.angleTo(M)<T)return R}}var B=null;if(r){var C=r.ray.intersectBox(this.modelScene.boundingBox,scratchVector3$3);C&&(C.project(e),Math.abs(C.z)<=1&&(B=C.clone()))}else B=new THREE__namespace.Vector3(0,0,0);if(B){var I=.4,L=s.accessibleNodes.filter(function(q){if(q===o.currentPano.panoIndex&&s.work.workCode===o.currentPano.workCode)return!1;var z=A[q];if(!z)return!1;var j=z.position.clone().applyMatrix4(z.work.transform).project(e);return Math.abs(j.z)>1||Math.abs(j.x)>1||Math.abs(j.y)>1?!1:z.loadable||z.active}),O=new Map,F=L.slice().sort(function(q,z){var j=A[q],J=O.get(j);typeof J=="undefined"&&(J=scratchVector3$3.copy(j.position).applyMatrix4(j.work.transform).distanceTo(e.position),O.set(j,J));var V=A[z],U=O.get(V);return typeof U=="undefined"&&(U=scratchVector3$3.copy(V.position).applyMatrix4(V.work.transform).distanceTo(e.position),O.set(V,U)),J-U});O.clear();for(var N=0,D=F;N<D.length;N++){var w=D[N],R=A[w];if(R){var C=scratchVector3$3.copy(R.position).applyMatrix4(R.work.transform);if(C.project(e),Math.abs(C.z)>1)continue;if(Math.pow(B.x-C.x,2)+Math.pow(B.y-C.y,2)<Math.pow(I,2))return R}}}return null},t.prototype.onTapGesture=function(e){var r=this,o;if(this.userAction=e.userAction,this.stopMomentumMovement(),!!this.initAnimationed){var s=e.center.raycaster;s.floorIndex=-1;var u=this.camera.getDirection(new THREE__namespace.Vector3).setY(0),l=null,c=this.works.getObserver(this.currentPano);if(c){var p=c.work.observers,f=c.accessibleNodes.filter(function(U){if(U===r.currentPano.panoIndex&&c.work.workCode===r.currentPano.workCode)return!1;var G=p[U];if(!G)return!1;var Z=scratchVector3$3.copy(G.position).applyMatrix4(G.work.transform);return Z.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:G.loadable||G.active}),d=this.modelScene.intersectRaycaster(s)[0];if(d){var h=arrayMin(f,function(U){var G=p[U];if(!G)return 1/0;var Z=scratchVector3$3.copy(G.standingPosition).applyMatrix4(G.work.transform);return Z.distanceTo(d.point)},!0),m=h[0],A=h[1];typeof m=="number"&&A<this.panoTapTriggerRadius&&(l=(o=p[m])!==null&&o!==void 0?o:null)}if(l||(l=this.getForwardObserverOrNot(this.camera,s)),l&&l.panoId===panoStringify(this.currentPano)&&(l=null),l&&!this.locationMotion.ended)for(var g=0,E=this.locationMotion.keyframes;g<E.length;g++){var v=E[g],y=this.panoResourceFromLocationMotionKeyframe(v);if(y.panoId===l.panoId){l=null;break}}if(!l)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var b={},T=Math.PI/6,_=Math.PI/12,S=l.position.clone().applyMatrix4(l.work.transform).setY(0).sub(c.position.clone().applyMatrix4(l.work.transform).setY(0)).normalize(),w=[],R=[],M=[],B=l.work.observers,C=0,I=l.accessibleNodes;C<I.length;C++){var m=I[C];if(l.panoIndex!==m&&!(m===this.currentPano.panoIndex&&l.work.workCode===this.currentPano.workCode)){var L=B[m];if(L){var O=L.position.clone().applyMatrix4(L.work.transform).sub(l.position.clone().applyMatrix4(l.work.transform)).setY(0).normalize();S.angleTo(O)<T&&M.push(O)}}}var F=M.length>0?M:__spreadArray(__spreadArray([],w,!0),R,!0),N=F.slice().sort(function(U,G){return U.angleTo(S)-G.angleTo(S)})[0];if(N&&N.angleTo(u)>_&&(b.longitude=Math.atan2(-N.x,-N.z)),this.cameraMotion.value.latitude<-Math.PI/4){var D=e.state.fov,q=clamp$1(typeof this.minLatitude=="function"?this.minLatitude(D):this.minLatitude,-Math.PI/2,Math.PI/2),z=clamp$1(typeof this.maxLatitude=="function"?this.maxLatitude(D):this.maxLatitude,-Math.PI/2,Math.PI/2);b.latitude=clamp$1(0,q,z)}var j=__assign({},e.state);if(j.workCode=l.work.workCode,j.panoIndex=l.panoIndex,b.longitude!==void 0&&(j.longitude=b.longitude),b.latitude!==void 0&&(j.latitude=b.latitude),b.fov!==void 0&&(j.fov=b.fov),j.distance=0,j.offset=l.position.clone(),e.state=j,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:j,userAction:e.userAction,options:b,progress:0,error:null})),l&&!l.active){var J=panoStringify({panoIndex:l.panoIndex,workCode:l.work.workCode}),V=this.panoMeshes.get(J);V&&(V.setDisabled(!1),V.setLoading(!0))}l&&l.active&&this.emit("pano.request",createEvent("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:j,options:b,error:null}))}}}}},t})(PanoramaLikeController),DEG_TO_RAD=Math.PI/180,RAD_TO_DEG=180/Math.PI,MIN_TIMESTEP=.001,MAX_TIMESTEP=1,isIOS=(function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}})(),isSafari=(function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}})(),isFirefoxAndroid=(function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}})(),getChromeVersion=(function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}})(),isChromeWithoutDeviceMotion=(function(){var n=!1;if(getChromeVersion()===65){var t=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var e=t[1].split(".");e[0],e[1];var r=e[2],o=e[3];n=parseInt(r,10)===3325&&parseInt(o,10)<148}}return function(){return n}})(),isSafariWithoutDeviceMotion=(function(){var n=isIOS()&&isSafari()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}})(),isR7=(function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}})();function isLandscapeMode(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return isR7()?!n:n}function isTimestampDeltaValid(n){return!(isNaN(n)||n<=MIN_TIMESTEP||n>MAX_TIMESTEP)}function getQuaternionAngle(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var warnOnce=(function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}})();function getOriginFromUrl(n){var t,e=n.indexOf("://");e!==-1?t=e+3:t=0;var r=n.indexOf("/",t);return r===-1&&(r=n.length),n.substring(0,r)}function isInsideCrossOriginIFrame(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=getOriginFromUrl(document.referrer),e=getOriginFromUrl(window.location.href);return n&&t!==e}var updateEyeViewMatrices=(function(){function n(r,o,s){var u=o?o[0]:0,l=o?o[1]:0,c=o?o[2]:0,p=o?o[3]:1,f=u+u,d=l+l,h=c+c,m=u*f,A=u*d,g=u*h,E=l*d,v=l*h,y=c*h,b=p*f,T=p*d,_=p*h;return r[0]=1-(E+y),r[1]=A+_,r[2]=g-T,r[3]=0,r[4]=A-_,r[5]=1-(m+y),r[6]=v+b,r[7]=0,r[8]=g+T,r[9]=v-b,r[10]=1-(m+E),r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function t(r,o,s){var u=s[0],l=s[1],c=s[2],p,f,d,h,m,A,g,E,v,y,b,T;return o===r?(r[12]=o[0]*u+o[4]*l+o[8]*c+o[12],r[13]=o[1]*u+o[5]*l+o[9]*c+o[13],r[14]=o[2]*u+o[6]*l+o[10]*c+o[14],r[15]=o[3]*u+o[7]*l+o[11]*c+o[15]):(p=o[0],f=o[1],d=o[2],h=o[3],m=o[4],A=o[5],g=o[6],E=o[7],v=o[8],y=o[9],b=o[10],T=o[11],r[0]=p,r[1]=f,r[2]=d,r[3]=h,r[4]=m,r[5]=A,r[6]=g,r[7]=E,r[8]=v,r[9]=y,r[10]=b,r[11]=T,r[12]=p*u+m*l+v*c+o[12],r[13]=f*u+A*l+y*c+o[13],r[14]=d*u+g*l+b*c+o[14],r[15]=h*u+E*l+T*c+o[15]),r}function e(r,o){var s=o[0],u=o[1],l=o[2],c=o[3],p=o[4],f=o[5],d=o[6],h=o[7],m=o[8],A=o[9],g=o[10],E=o[11],v=o[12],y=o[13],b=o[14],T=o[15],_=s*f-u*p,S=s*d-l*p,w=s*h-c*p,R=u*d-l*f,M=u*h-c*f,B=l*h-c*d,C=m*y-A*v,I=m*b-g*v,L=m*T-E*v,O=A*b-g*y,F=A*T-E*y,N=g*T-E*b,D=_*N-S*F+w*O+R*L-M*I+B*C;return D?(D=1/D,r[0]=(f*N-d*F+h*O)*D,r[1]=(l*F-u*N-c*O)*D,r[2]=(y*B-b*M+T*R)*D,r[3]=(g*M-A*B-E*R)*D,r[4]=(d*L-p*N-h*I)*D,r[5]=(s*N-l*L+c*I)*D,r[6]=(b*w-v*B-T*S)*D,r[7]=(m*B-g*w+E*S)*D,r[8]=(p*F-f*L+h*C)*D,r[9]=(u*L-s*F-c*C)*D,r[10]=(v*M-y*w+T*_)*D,r[11]=(A*w-m*M-E*_)*D,r[12]=(f*I-p*O-d*C)*D,r[13]=(s*O-u*I+l*C)*D,r[14]=(y*S-v*R-b*_)*D,r[15]=(m*R-A*S+g*_)*D,r):null}return function(r,o,s){n(r,o),s&&t(r,r,s),e(r,r)}})(),SensorSample=(function(){function n(t,e){t===void 0&&(t=new THREE__namespace.Vector3),e===void 0&&(e=0),this.sample=t,this.timestampS=e}return n.prototype.set=function(t,e){this.sample=t,this.timestampS=e},n.prototype.copy=function(t){this.set(t.sample,t.timestampS)},n})(),ComplementaryFilter=(function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new SensorSample,this.currentGyroMeasurement=new SensorSample,this.previousGyroMeasurement=new SensorSample,isIOS()?this.filterQ=new THREE__namespace.Quaternion(-1,0,0,1):this.filterQ=new THREE__namespace.Quaternion(1,0,0,1),this.previousFilterQ=new THREE__namespace.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new THREE__namespace.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new THREE__namespace.Vector3,this.measuredGravity=new THREE__namespace.Vector3,this.gyroIntegralQ=new THREE__namespace.Quaternion}return n.prototype.addAccelMeasurement=function(t,e){this.currentAccelMeasurement.set(t,e)},n.prototype.addGyroMeasurement=function(t,e){this.currentGyroMeasurement.set(t,e);var r=e-this.previousGyroMeasurement.timestampS;isTimestampDeltaValid(r)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},n.prototype.getOrientation=function(){return this.filterQ},n.prototype.run_=function(){if(!this.isOrientationInitialized){this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),this.isOrientationInitialized=!0;return}var t=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,e=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,t);this.gyroIntegralQ.multiply(e),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(e);var r=new THREE__namespace.Quaternion;r.copy(this.filterQ),r.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(r),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var o=new THREE__namespace.Quaternion;o.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),o.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",RAD_TO_DEG*getQuaternionAngle(o),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var s=new THREE__namespace.Quaternion;s.copy(this.filterQ),s.multiply(o),this.filterQ.slerp(s,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},n.prototype.accelToQuaternion_=function(t){var e=new THREE__namespace.Vector3;e.copy(t),e.normalize();var r=new THREE__namespace.Quaternion;return r.setFromUnitVectors(new THREE__namespace.Vector3(0,0,-1),e),r.inverse(),r},n.prototype.gyroToQuaternionDelta_=function(t,e){var r=new THREE__namespace.Quaternion,o=new THREE__namespace.Vector3;return o.copy(t),o.normalize(),r.setFromAxisAngle(o,t.length()*e),r},n})(),PosePredictor=(function(){function n(t,e){this.predictionTimeS=t,this.isDebug=e,this.previousQ=new THREE__namespace.Quaternion,this.previousTimestampS=null,this.deltaQ=new THREE__namespace.Quaternion,this.outQ=new THREE__namespace.Quaternion}return n.prototype.getPrediction=function(t,e,r){if(!this.previousTimestampS)return this.previousQ.copy(t),this.previousTimestampS=r,t;var o=new THREE__namespace.Vector3;o.copy(e),o.normalize();var s=e.length();if(s<DEG_TO_RAD*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(RAD_TO_DEG*s).toFixed(1)),this.outQ.copy(t),this.previousQ.copy(t),this.outQ;var u=s*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(o,u),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(t),this.previousTimestampS=r,this.outQ},n})(),Distortion=(function(){function n(t){this.coefficients=t}return n.prototype.distortInverse=function(t){for(var e=0,r=1,o=t-this.distort(e);Math.abs(r-e)>1e-4;){var s=t-this.distort(r),u=r-s*((r-e)/(s-o));e=r,r=u,o=s}return r},n.prototype.distort=function(t){for(var e=t*t,r=0,o=0;o<this.coefficients.length;o++)r=e*(r+this.coefficients[o]);return(r+1)*t},n})(),Pose=(function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n})(),FieldOfView=(function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n})(),Sensor=(function(){function n(t,e,r,o){this.viewer={id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]},this.device={widthMeters:.11,heightMeters:.062,bevelMeters:.004},this.depthNear=.01,this.depthFar=1e4,this.yawOnly=r,this.accelerometer=new THREE__namespace.Vector3,this.gyroscope=new THREE__namespace.Vector3,this.filter=new ComplementaryFilter(t,o),this.posePredictor=new PosePredictor(e,o),this.isFirefoxAndroid=isFirefoxAndroid(),this.isIOS=isIOS();var s=getChromeVersion();this.isDeviceMotionInRadians=!this.isIOS&&s!==null&&s<66,this.isWithoutDeviceMotion=isChromeWithoutDeviceMotion()||isSafariWithoutDeviceMotion(),this.filterToWorldQ=new THREE__namespace.Quaternion,isIOS()?this.filterToWorldQ.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new THREE__namespace.Quaternion,this.worldToScreenQ=new THREE__namespace.Quaternion,this.originalPoseAdjustQ=new THREE__namespace.Quaternion;var u=typeof window!="undefined"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),u),this.setScreenTransform_(),isLandscapeMode()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new THREE__namespace.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return n.prototype.getPosition=function(){return null},n.prototype.getOrientation=function(){var t;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||(function(){var s=new THREE__namespace.Quaternion().setFromAxisAngle(new THREE__namespace.Vector3(0,0,-1),0),u=new THREE__namespace.Quaternion;return typeof window!="undefined"&&window.orientation===-90?u.setFromAxisAngle(new THREE__namespace.Vector3(0,1,0),Math.PI/-2):u.setFromAxisAngle(new THREE__namespace.Vector3(0,1,0),Math.PI/2),s.multiply(u)})(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||(function(){var s=new THREE__namespace.Quaternion;return s.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),-Math.PI/2),s})(),t=this._deviceOrientationQ;var e=new THREE__namespace.Quaternion;return e.copy(t),e.multiply(this.deviceOrientationFilterToWorldQ),e.multiply(this.resetQ),e.multiply(this.worldToScreenQ),e.multiplyQuaternions(this.deviceOrientationFixQ,e),this.yawOnly&&(e.x=0,e.z=0,e.normalize()),this.orientationOut_[0]=e.x,this.orientationOut_[1]=e.y,this.orientationOut_[2]=e.z,this.orientationOut_[3]=e.w,this.orientationOut_}else{var r=this.filter.getOrientation();t=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS)}var o=new THREE__namespace.Quaternion;return o.copy(this.filterToWorldQ),o.multiply(this.resetQ),o.multiply(t),o.multiply(this.worldToScreenQ),this.yawOnly&&(o.x=0,o.z=0,o.normalize()),this.orientationOut_[0]=o.x,this.orientationOut_[1]=o.y,this.orientationOut_[2]=o.z,this.orientationOut_[3]=o.w,this.orientationOut_},n.prototype.getPose=function(){var t=new Pose;return t.orientation=this.getOrientation(),t},n.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),isLandscapeMode()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},n.prototype.getFrameData=function(t){var e=this.getOrientation(),r=this.getEyeOffset(),o=this.getEyeProjectionMatrix();return t.pose.angularAcceleration=null,t.pose.angularVelocity=null,t.pose.linearAcceleration=null,t.pose.linearVelocity=null,t.pose.orientation=e,t.pose.position=null,t.timestamp=this.previousTimestampS,t.leftProjectionMatrix.set(o.left),t.rightProjectionMatrix.set(o.right),updateEyeViewMatrices(t.leftViewMatrix,e,r.left),updateEyeViewMatrices(t.rightViewMatrix,e,r.right),t},n.prototype.start=function(){if(typeof window=="undefined")return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),o=this.onDeviceOrientation_.bind(this);return isIOS()&&isInsideCrossOriginIFrame()&&window.addEventListener("message",r),window.addEventListener("orientationchange",e),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",o):window.addEventListener("devicemotion",t),function(){window.removeEventListener("devicemotion",t),window.removeEventListener("deviceorientation",e),window.removeEventListener("orientationchange",e),window.removeEventListener("message",r)}},n.prototype.getEyeOffset=function(){return{left:[-this.viewer.interLensDistance*.5,0,0],right:[this.viewer.interLensDistance*.5,0,0]}},n.prototype.getEyeProjectionMatrix=function(){var t=this.getEyeFieldOfView(),e=this.depthNear,r=this.depthFar,o={left:[],right:[]};{var s=t.left.upDegrees*DEG_TO_RAD,u=t.left.downDegrees*DEG_TO_RAD,l=t.left.leftDegrees*DEG_TO_RAD,c=t.left.rightDegrees*DEG_TO_RAD,p=2/(l+c),f=2/(s+u);o.left[0]=p,o.left[1]=0,o.left[2]=0,o.left[3]=0,o.left[4]=0,o.left[5]=f,o.left[6]=0,o.left[7]=0,o.left[8]=-((l-c)*p*.5),o.left[9]=(s-u)*f*.5,o.left[10]=r/(e-r),o.left[11]=-1,o.left[12]=0,o.left[13]=0,o.left[14]=r*e/(e-r),o.left[15]=0}{var s=t.right.upDegrees*DEG_TO_RAD,u=t.right.downDegrees*DEG_TO_RAD,l=t.right.leftDegrees*DEG_TO_RAD,c=t.right.rightDegrees*DEG_TO_RAD,p=2/(l+c),f=2/(s+u);o.right[0]=p,o.right[1]=0,o.right[2]=0,o.right[3]=0,o.right[4]=0,o.right[5]=f,o.right[6]=0,o.right[7]=0,o.right[8]=-((l-c)*p*.5),o.right[9]=(s-u)*f*.5,o.right[10]=r/(e-r),o.right[11]=-1,o.right[12]=0,o.right[13]=0,o.right[14]=r*e/(e-r),o.right[15]=0}return o},n.prototype.getEyeFieldOfView=function(){var t=this.viewer,e=this.device,r=new Distortion(t.distortionCoefficients),o=t.screenLensDistance,s=(e.widthMeters-t.interLensDistance)/2,u=t.interLensDistance/2,l=t.baselineLensDistance-e.bevelMeters,c=e.heightMeters-l,p=RAD_TO_DEG*Math.atan(r.distort(s/o)),f=RAD_TO_DEG*Math.atan(r.distort(u/o)),d=RAD_TO_DEG*Math.atan(r.distort(l/o)),h=RAD_TO_DEG*Math.atan(r.distort(c/o)),m=new FieldOfView,A=new FieldOfView;return m.leftDegrees=Math.min(p,t.fov),m.rightDegrees=Math.min(f,t.fov),m.downDegrees=Math.min(d,t.fov),m.upDegrees=Math.min(h,t.fov),A.leftDegrees=m.rightDegrees,A.rightDegrees=m.leftDegrees,A.upDegrees=m.upDegrees,A.downDegrees=m.downDegrees,{left:m,right:A}},n.prototype.onDeviceOrientation_=function(t){this._deviceOrientationQ=this._deviceOrientationQ||new THREE__namespace.Quaternion;var e=t.alpha,r=t.beta,o=t.gamma;e=(e||0)*Math.PI/180,r=(r||0)*Math.PI/180,o=(o||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new THREE__namespace.Euler(e,r,-o,"YXZ"))},n.prototype.onDeviceMotion_=function(t){this.updateDeviceMotion_(t)},n.prototype.updateDeviceMotion_=function(t){var e=t.accelerationIncludingGravity,r=t.rotationRate,o=t.timeStamp/1e3,s=o-this.previousTimestampS;if(s<0){warnOnce("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=o;return}else if(s<=MIN_TIMESTEP||s>MAX_TIMESTEP){warnOnce("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),this.previousTimestampS=o;return}e&&(this.accelerometer.set(-e.x,-e.y,-e.z),r&&(isR7()?this.gyroscope.set(-r.beta,r.alpha,r.gamma):this.gyroscope.set(r.alpha,r.beta,r.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,o)),this.filter.addAccelMeasurement(this.accelerometer,o)),this.previousTimestampS=o},n.prototype.onOrientationChange_=function(){this.setScreenTransform_()},n.prototype.onMessage_=function(t){var e=t.data;if(!(!e||!e.type)){var r=e.type.toLowerCase();r==="devicemotion"&&this.updateDeviceMotion_(e.deviceMotionEvent)}},n.prototype.setScreenTransform_=function(){this.worldToScreenQ.set(0,0,0,1);var t=typeof window!="undefined"?window.orientation:0;switch(t){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),Math.PI/2);break}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},n})(),defaultLeftBounds=[0,0,.5,1],defaultRightBounds=[.5,0,.5,1],Cardboard=(function(){function n(t){var e=this;this.renderer=t,this.sensor=new Sensor(.98,.04,!1,!1),this.scale=1,this.cameraL=new THREE__namespace.PerspectiveCamera,this.cameraR=new THREE__namespace.PerspectiveCamera;var r=this.sensor.start();this.dispose=function(){var o=e.renderer.getSize(new THREE__namespace.Vector2);e.renderer.setScissor(0,0,o.width,o.height),e.renderer.setViewport(0,0,o.width,o.height),e.renderer.setScissorTest(!1),r()}}return n.prototype.render=function(t,e){var r=this.renderer.getSize(new THREE__namespace.Vector2);if(r.width>r.height){var o=t.autoUpdate;o&&(t.updateMatrixWorld(),t.autoUpdate=!1);var s={x:Math.round(r.width*defaultLeftBounds[0]),y:Math.round(r.height*defaultLeftBounds[1]),width:Math.round(r.width*defaultLeftBounds[2]),height:Math.round(r.height*defaultLeftBounds[3])},u={x:Math.round(r.width*defaultRightBounds[0]),y:Math.round(r.height*defaultRightBounds[1]),width:Math.round(r.width*defaultRightBounds[2]),height:Math.round(r.height*defaultRightBounds[3])};this.renderer.setScissorTest(!0),this.renderer.autoClear&&this.renderer.clear(),e.parent===null&&e.updateMatrixWorld(),e.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),e.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale);var l=this.sensor.getEyeOffset();this.cameraL.translateOnAxis(new THREE__namespace.Vector3().fromArray(l.left),this.scale),this.cameraR.translateOnAxis(new THREE__namespace.Vector3().fromArray(l.right),this.scale);var c=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=c.left.slice(),this.cameraR.projectionMatrix.elements=c.right.slice(),this.renderer.setViewport(s.x,s.y,s.width,s.height),this.renderer.setScissor(s.x,s.y,s.width,s.height),this.renderer.render(t,this.cameraL),this.renderer.setViewport(u.x,u.y,u.width,u.height),this.renderer.setScissor(u.x,u.y,u.width,u.height),this.renderer.render(t,this.cameraR),this.renderer.setViewport(0,0,r.width,r.height),this.renderer.setScissor(0,0,r.width,r.height),this.renderer.setScissorTest(!1),o&&(t.autoUpdate=!0)}else this.renderer.render(t,e)},n.prototype.dispose=function(){},n})();const cardboard="data:image/png;base64,iVBORw0KGgoA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8Wn96UkNQpV2U6V0tUAaXW7jNwYswYxdL94y7VqSoKFhWiMDXnUBaHBwoQT9Prx4Szm3TyRodLupoMJHH5LyK+9es8+l/CKvDytukQQND8FSlFIOreGM0/omiATVapVo12xd0jhExKW5294RAc40RVoftY47cd2LKtMOFwkajzuAeVOlIhfJeKahLyiWJRhLr3Ai2BVzQYKG4lLYXfg8HCSI33a2nTH5OaVWmzYHJGhsdLmDuN2exAonBTzZIuzEUS+ec0ZMBQn+Ea5KlXNI4C/UAO/k6hKwBptJgn8fgmVckgFXML9YEEFLUKMvlqAp0eWyDEAL65dLqyWo6RekTZ2XNCsD6rgpTK/4p3WcrrPH1ghWJGhONC3JoGAkRHH1JKjpNEcCxOV2I8MWyiUJqNVajSVodgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var _a,LOCALE={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},TEXT=typeof navigator!="undefined"&&(_a=LOCALE[navigator.language.split("-")[0]])!==null&&_a!==void 0?_a:LOCALE.zh,CONTENTS=`
|
|
1573
|
+
`,depthMaterial=new THREE__namespace.ShaderMaterial({vertexShader:depthVertexShader,fragmentShader:depthFragmentShader,uniforms:{maxDepth:new THREE__namespace.Uniform(0)}});function renderDepthCube(n,t,e,r){r===void 0&&(r=1e3),depthMaterial.uniforms.maxDepth.value=r,scratchPrevClearColor.copy(n.getClearColor());var o=n.getClearAlpha(),s=t.overrideMaterial;t.overrideMaterial=depthMaterial,n.setClearColor(clearColor,0),e.update(n,t),n.setClearColor(scratchPrevClearColor,o),t.overrideMaterial=s}function defaultEffectEase(n){return n}var scratchRaycaster$1=new THREE__namespace.Raycaster,scratchVector3$3=new THREE__namespace.Vector3,adjustPanoCircleMeshVectors=[new THREE__namespace.Vector3(0,0,0).multiplyScalar(.1),new THREE__namespace.Vector3(1,0,0).multiplyScalar(.1),new THREE__namespace.Vector3(-.5,0,-Math.sqrt(3)/2).multiplyScalar(.1),new THREE__namespace.Vector3(-.5,0,+Math.sqrt(3)/2).multiplyScalar(.1)],defaultPanoramaControllerCustomInitArgs=__assign(__assign({},defaultPanoramaLikeControllerCustomInitArgs),{maxAccessibleDistance:5,panoTapTriggerRadius:.5,panoCircleMeshCreator:function(n){return new PanoCircleMesh},adjustPanoCircleMeshPositionBasedOnModel:!1,tileLevelForFov:(function(n,t){var e,r=function(l){return l/180*Math.PI},o=(e=Math.log2)!==null&&e!==void 0?e:(function(l){return Math.log(l)*Math.LOG2E}),s=t.height/2/Math.tan(r(n/2))*Math.tan(r(45))*2,u=Math.max(o(s/512),0);return u<2.3&&u>.1&&(u=1),u=u%1>.75?Math.ceil(u):Math.floor(u),u}),tileAppearDuration:.5,tileMaxRequest:3,flyEffectUseDepthBuffer:!1}),PanoramaController=(function(n){__extends(t,n);function t(e){var r=this,o=t.parseArgs(e);r=n.call(this,o)||this,r.mode="Panorama",r.initAnimationed=!1,r.maxAccessibleDistance=o.maxAccessibleDistance,r.panoTapTriggerRadius=o.panoTapTriggerRadius,r.panoCircleMeshCreator=o.panoCircleMeshCreator,r.adjustPanoCircleMeshPositionBasedOnModel=o.adjustPanoCircleMeshPositionBasedOnModel,r.tileLevelForFov=o.tileLevelForFov,r.tileAppearDuration=o.tileAppearDuration,r.tileMaxRequest=o.tileMaxRequest,r.flyEffectUseDepthBuffer=o.flyEffectUseDepthBuffer,r.adjustPanoCircleMeshPositionFix=new Map;var s=r.modelScene.parameter.resolveValue(),u=s.pano0,l=s.pano1;u&&(l==null?void 0:l.map)!==u.map&&(r.modelScene.parameter.set({pano0:l}),u.map.dispose());var c=new Set;return u&&c.add(u),l&&c.add(l),r.panoMeshes=new Map,r.locationMotion=new Motion({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Motion({modelAlpha:r.modelScene.parameter.resolveValue().modelAlpha}),r.perspToOrthoMotion=new Motion({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=createUuid()]={panoId:panoStringify(r.currentPano),panoPicture:r.modelScene.parameter.resolveValue().pano1,position:r.camera.pose.offset.clone(),effect:"fly",effectEasing:defaultEffectEase,fixCameraTransform:new THREE__namespace.Matrix4},r.panoPictureObserverMap=new WeakMap,r.textureLoader=new TextureLoader,r.tiling=new Tiling,r.panoVideo=new PanoVideo,r.scene.add(r.panoVideo.object),r.accessibleObserverFloorCheckCount=0,r}return t.parseArgs=function(e){var r,o,s,u,l,c,p,f;if(e instanceof t)return e;var d=n.parseArgs.call(this,e);return __assign(__assign({},d),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:defaultPanoramaControllerCustomInitArgs.maxAccessibleDistance,panoTapTriggerRadius:(o=e.panoTapTriggerRadius)!==null&&o!==void 0?o:defaultPanoramaControllerCustomInitArgs.panoTapTriggerRadius,panoCircleMeshCreator:(s=e.panoCircleMeshCreator)!==null&&s!==void 0?s:defaultPanoramaControllerCustomInitArgs.panoCircleMeshCreator,adjustPanoCircleMeshPositionBasedOnModel:(u=e.adjustPanoCircleMeshPositionBasedOnModel)!==null&&u!==void 0?u:defaultPanoramaControllerCustomInitArgs.adjustPanoCircleMeshPositionBasedOnModel,tileLevelForFov:(l=e.tileLevelForFov)!==null&&l!==void 0?l:defaultPanoramaControllerCustomInitArgs.tileLevelForFov,tileAppearDuration:(c=e.tileAppearDuration)!==null&&c!==void 0?c:defaultPanoramaControllerCustomInitArgs.tileAppearDuration,tileMaxRequest:(p=e.tileMaxRequest)!==null&&p!==void 0?p:defaultPanoramaControllerCustomInitArgs.tileMaxRequest,flyEffectUseDepthBuffer:(f=e.flyEffectUseDepthBuffer)!==null&&f!==void 0?f:defaultPanoramaControllerCustomInitArgs.flyEffectUseDepthBuffer})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),o=n.initAnimationEndState.call(this,r);return __assign(__assign({},o),{mode:"Panorama"})},Object.defineProperty(t.prototype,"tileLevel",{get:function(){return this.tiling.level},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e){var r=this,o=n.prototype.updateConfiguration.call(this,e);return o===!1?!1:(e.maxAccessibleDistance!==void 0&&this.maxAccessibleDistance!==e.maxAccessibleDistance&&(this.maxAccessibleDistance=e.maxAccessibleDistance),e.panoTapTriggerRadius!==void 0&&this.panoTapTriggerRadius!==e.panoTapTriggerRadius&&(this.panoTapTriggerRadius=e.panoTapTriggerRadius),e.panoCircleMeshCreator!==void 0&&this.panoCircleMeshCreator!==e.panoCircleMeshCreator&&(this.panoCircleMeshCreator=e.panoCircleMeshCreator,this.panoMeshes&&(this.panoMeshes.forEach(function(s){r.helper.remove(s),s.dispose()}),this.panoMeshes.clear())),e.tileLevelForFov!==void 0&&this.tileLevelForFov!==e.tileLevelForFov&&(this.tileLevelForFov=e.tileLevelForFov),e.tileMaxRequest!==void 0&&this.tileMaxRequest!==e.tileMaxRequest&&(this.tileMaxRequest=e.tileMaxRequest),e.flyEffectUseDepthBuffer!==void 0&&this.flyEffectUseDepthBuffer!==e.flyEffectUseDepthBuffer&&(this.flyEffectUseDepthBuffer=e.flyEffectUseDepthBuffer),e.adjustPanoCircleMeshPositionBasedOnModel!==void 0&&this.adjustPanoCircleMeshPositionBasedOnModel!==e.adjustPanoCircleMeshPositionBasedOnModel&&(this.adjustPanoCircleMeshPositionBasedOnModel=e.adjustPanoCircleMeshPositionBasedOnModel,this.adjustPanoCircleMeshPositionBasedOnModel||this.adjustPanoCircleMeshPositionFix.clear()),!0)},t.prototype.destroy=function(){var e=this;n.prototype.destroy.call(this),this.tiling.dispose(),this.modelScene.parameter.set({refinedScreen:null,pano0Depth:null,pano1Depth:null}),this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0),this.locationMotion.dispose(),this.pendingTextureTask=void 0,this.panoMeshes&&(this.panoMeshes.forEach(function(h){e.helper.remove(h),h.dispose()}),this.panoMeshes.clear());var r=this.videoTexture.image;r.pause(),r.oncanplay=noop,r.ontimeupdate=noop,this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var o=this.modelScene.parameter.resolveValue(),s=o.pano0,u=o.pano1,l=0,c=Object.keys(this.panoResources);l<c.length;l++){var p=c[l],f=this.panoResources[p];if(f.panoPicture){var d=f.panoPicture.map;d&&d!==(s==null?void 0:s.map)&&d!==(u==null?void 0:u.map)&&(d.dispose(),f.panoPicture=null)}delete this.panoResources[p]}},t.prototype.isReady=function(){return this.locationMotion.ended!==!0?!1:n.prototype.isReady.call(this)},t.prototype.isTileReady=function(){var e=this.tiling.pedding,r=e<=0;return this.initAnimationed&&r},t.prototype.updateWork=function(e,r,o,s){var u=this;this.userAction=s,this.works=e;var l=t.initAnimationEndState(__assign(__assign({},this),{initial:{currentState:__assign(__assign({},this.currentPano),this.camera.pose),duration:o.duration,effect:o.effect,state:r,userAction:s}})),c={workCode:l.workCode,panoIndex:l.panoIndex};return this.initAnimationed=!1,this.hideIntersectMesh(),this.moveToPano(c,{effect:o.effect,duration:o.duration,longitude:r.longitude,latitude:r.latitude,fov:r.fov,moveEndCallback:function(){u.initAnimationed=!0},moveCancelCallback:function(){u.initAnimationed=!0}},s),!0},t.prototype.updateModel=function(e){this.modelScene=e,this.hideIntersectMesh()},t.prototype.updateTime=function(e,r){var o=this,s,u,l,c,p,f;if(!this.destroyed){var d={},h={},m=this.locationMotion.keyframes[0],A=this.locationMotion.keyframes[this.locationMotion.keyframes.length-1],g=this.locationMotion.getKeyFrameSegment(e),E=g[0],v=g[1],y=this.panoResourceFromLocationMotionKeyframe(E),b=this.panoResourceFromLocationMotionKeyframe(v),T=this.panoResourceFromLocationMotionKeyframe(m),_=this.panoResourceFromLocationMotionKeyframe(A),S=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),h.longitude=this.cameraMotion.value.longitude,h.latitude=this.cameraMotion.value.latitude,h.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),d.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=new THREE__namespace.Vector3().copy(y.position),R=new THREE__namespace.Vector3().copy(b.position),M=this.locationMotion.value.count-v.value.count+1;if(d.progress=b.effectEasing(M),b.panoPicture&&(M<1?y.panoPicture&&(d.pano0=y.panoPicture):d.pano0=b.panoPicture,d.pano1=b.panoPicture),b.effect==="montage"?d.transition="BLACK":b.effect==="spread"?d.transition="SPREAD":d.transition="FADE",b.effect==="zoomin"||b.effect==="zoomout")d.progress=Math.pow(M,3);else if(b.effect==="model"&&this.camera.pose.distance<.01){var B=1-Math.pow(clamp$1(Math.abs(M-.5)*2,0,1),4);d.modelAlpha=B}if(M<1&&b.effect!=="fly"&&b.effect!=="model"){if(d.pano0&&y.panoPicture){var C={panoId:d.pano0.panoId,map:d.pano0.map,mapSize:d.pano0.mapSize,zoom:d.pano0.zoom,matrix:y.panoPicture.matrix.clone().premultiply(y.fixCameraTransform).setPosition(b.position)},I=this.panoPictureObserverMap.get(d.pano0);I&&this.panoPictureObserverMap.set(C,I),d.pano0=C}w.copy(R),S=!0}h.distance=this.locationMotion.value.distance,h.offset=new THREE__namespace.Vector3(w.x+(R.x-w.x)*M,w.y+(R.y-w.y)*M,w.z+(R.z-w.z)*M);for(var L=[],O=[],F=0,N=this.locationMotion.keyframes;F<N.length;F++){var D=N[F],q=D.key,z=D.progress;q!==void 0&&(L.push(q),z>this.locationMotion.progress&&O.push(q))}for(var j=0,J=Object.keys(this.panoResources);j<J.length;j++){var V=J[j];if(!(O.indexOf(V)>=0)){var U=this.panoResources[V];if(U.panoPicture){var G=U.panoPicture.map;if(G){if(G===((s=d.pano0)===null||s===void 0?void 0:s.map)||G===((u=d.pano1)===null||u===void 0?void 0:u.map))continue;G.dispose(),U.panoPicture=null}}L.indexOf(V)>=0||delete this.panoResources[V]}}var Z=panoParse(b.panoId);Z!==this.currentPano&&(this.currentPano=Z,this.accessibleObserverFloorCheckCount=0),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(T.panoId),state:__assign(__assign(__assign(__assign({},panoParse(_.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),h),options:{},progress:this.locationMotion.progress,error:null}))}isEmptyObject(d)===!1&&this.modelScene.parameter.set(d),isEmptyObject(h)===!1&&this.setCamera(h);var W=this.works.getObserver(this.currentPano),ee=this.locationMotion.ended?this.getForwardObserverOrNot(this.camera):null,X=this.works.getObserver(y.panoId),K=this.works.getObserver(b.panoId);if(this.adjustPanoCircleMeshPositionBasedOnModel&&this.helper.visible&&W){for(var $=[],re=W.work.observers,ne=0,ae=W.accessibleNodes;ne<ae.length;ne++){var le=ae[ne],I=re[le];I&&$.push(I)}var se=new Map;if($.sort(function(ie,_e){var Pe=se.get(ie);typeof Pe=="undefined"&&(Pe=ie.standingPosition.distanceTo(W.standingPosition),se.set(ie,Pe));var Ce=se.get(ie);return typeof Ce=="undefined"&&(Ce=_e.standingPosition.distanceTo(W.standingPosition),se.set(_e,Ce)),Pe-Ce}),$.length){this.accessibleObserverFloorCheckCount=this.accessibleObserverFloorCheckCount%$.length;var ce=$[this.accessibleObserverFloorCheckCount],me=this.modelScene.models.find(function(ie){return ie.work===(ce==null?void 0:ce.work)});if(ce&&me&&me.visible){var Ae=.3,be=.05,de=.005,he=ce.standingPosition.clone().applyMatrix4(ce.work.transform),fe=panoStringify({panoIndex:ce.panoIndex,workCode:ce.work.workCode}),te=adjustPanoCircleMeshVectors.map(function(ie){scratchRaycaster$1.ray.origin.copy(he),scratchRaycaster$1.ray.origin.add(scratchVector3$3.copy(ie).setY(Ae)),scratchRaycaster$1.ray.direction.set(0,-1,0),scratchRaycaster$1.firstHitOnly=!0,scratchRaycaster$1.floorIndex=-1;var _e=me.intersectRaycaster(scratchRaycaster$1)[0];return _e&&_e.distance-de<=Ae?new THREE__namespace.Vector3().copy(he).setY(_e.point.y+de):he});te.sort(function(ie,_e){return _e.y-ie.y});var ue=te[Math.floor(te.length/2)],Te=te.filter(function(ie){return ie.distanceTo(ue)<=be})[0];if(Te){var xe=new THREE__namespace.Vector4(he.x,he.y,he.z,Te.y-he.y),Xe=this.adjustPanoCircleMeshPositionFix.get(fe);Xe&&!xe.equals(Xe)&&(this.needsRender=!0),this.adjustPanoCircleMeshPositionFix.set(fe,xe)}}this.accessibleObserverFloorCheckCount++}}var Je=new Map;if(X)for(var ze=0,ve=X.accessibleNodes;ze<ve.length;ze++){var le=ve[ze],I=X.work.observers[le];if(I){var fe=panoStringify({panoIndex:I.panoIndex,workCode:I.work.workCode});Je.set(fe,I)}}if(K)for(var Ge=0,ye=K.accessibleNodes;Ge<ye.length;Ge++){var le=ye[Ge],I=K.work.observers[le];if(I){var fe=panoStringify({panoIndex:I.panoIndex,workCode:I.work.workCode});Je.set(fe,I)}}if(this.panoMeshes.forEach(function(ie,_e){var Pe=Je.get(_e);if(Pe){ie.position.copy(Pe.standingPosition).applyMatrix4(Pe.work.transform);var Ce=o.adjustPanoCircleMeshPositionFix.get(_e);Ce&&(scratchVector3$3.set(Ce.x,Ce.y,Ce.z),scratchVector3$3.equals(ie.position)&&(ie.position.y+=Ce.w)),ie.scale.setScalar(1.2),Je.delete(_e)}else o.helper.remove(ie),ie.dispose(),o.panoMeshes.delete(_e)}),Je.forEach(function(ie,_e){var Pe=o.panoCircleMeshCreator(panoParse(_e));Pe.position.copy(ie.standingPosition).applyMatrix4(ie.work.transform);var Ce=o.adjustPanoCircleMeshPositionFix.get(_e);Ce&&(scratchVector3$3.set(Ce.x,Ce.y,Ce.z),scratchVector3$3.equals(Pe.position)&&(Pe.position.y+=Ce.w)),Pe.scale.setScalar(1.2),o.panoMeshes.set(_e,Pe),o.helper.add(Pe),Je.delete(_e)}),this.camera.pose.distance>.1||S)this.panoMeshes.forEach(function(ie){ie.setOpacity(0),ie.setCurrent(!1),ie.updateTime&&ie.updateTime(e,r),ie.visible=!1});else if(W){var Ne=W.work.observers,Be=arrayMin(W.accessibleNodes,function(ie){var _e=Ne[ie];return _e?W.standingPosition.distanceTo(_e.standingPosition):1/0},!0),Ye=Be[1];Ye=clamp$1(Ye,2.5,1/0);var nt=W.visibleNodes.concat(W.panoIndex).map(function(ie){return panoStringify({panoIndex:ie,workCode:W.work.workCode})}),De=this.camera.getDirection(new THREE__namespace.Vector3);this.panoMeshes.forEach(function(ie,_e){var Pe=o.works.getObserver(_e);if(nt.indexOf(_e)===-1)ie.setCurrent(!1),ie.setOpacity(0);else if(!Pe)ie.setCurrent(!1),ie.setOpacity(0);else if(!Pe.loadable&&!Pe.active)ie.setCurrent(!1),ie.setOpacity(0);else{var Ce=ie.position.clone().setY(o.camera.position.y).distanceTo(o.camera.position);ie.setCurrent(!ie.loading&&ie.progress===0&&ee!==null&&panoStringify({panoIndex:ee.panoIndex,workCode:ee.work.workCode})===_e),ie.setOpacity(Ce<.01?0:clamp$1(Ye/Ce*1.2,.4,.85));var yt=o.camera.position.clone().setY(ie.position.y),ct=new THREE__namespace.Vector3().copy(ie.position).sub(yt).normalize();if(_e===panoStringify(o.currentPano)){var Et=clamp$1((.5-yt.distanceTo(ie.position))/.5,0,1);ct.multiplyScalar(1-Et).add(De.clone().multiplyScalar(Et))}ct.length()>0&&ie.quaternion.setFromEuler(new THREE__namespace.Euler(0,Math.atan2(ct.x,ct.z),0))}ie.updateTime&&ie.updateTime(e,r)})}{var M=(l=this.modelScene.parameter.progress)!==null&&l!==void 0?l:1,qe=Math.round(M),He=this.modelScene.parameter.pano0,ge=this.modelScene.parameter.pano1,Se=qe===0?He:ge,I=void 0;if(Se&&(I=this.works.getObserver(Se.panoId),I||(I=this.panoPictureObserverMap.get(Se))),this.tiling.appearDuration=this.tileAppearDuration,this.tiling.maxRequest=M<(canUseNativeImageBitmap()?.6:.99)?0:this.tileMaxRequest,this.tiling.imageOptions=this.imageOptions,!I||!Se||this.tileLevelForFov===!1||this.camera.perspToOrtho.x>0){this.tiling.setObserver(null);var Me={renderer:this.renderer,resolution:this.camera.resolution,pixelRatio:this.camera.pixelRatio,time:this.camera.time,cameraMatrix:this.camera.matrixWorld,cameraProjectionMatrix:this.camera.projectionMatrix,panoMap:null,panoMatrix:new THREE__namespace.Matrix4,panoZoom:1,minLevel:0,level:0};this.tiling.update(Me),this.modelScene.parameter.set("refinedScreen",null)}else{var je=getImageSizeLevel(Se.mapSize),Ue=je+1,tt=new THREE__namespace.Vector2().copy(this.camera.resolution).multiplyScalar(this.camera.pixelRatio),dt=Math.floor(this.tileLevelForFov(this.camera.fov,tt)),Ve=dt>je?dt:0;this.tiling.setObserver(I);var Me={renderer:this.renderer,resolution:this.camera.resolution,pixelRatio:this.camera.pixelRatio,time:this.camera.time,cameraMatrix:this.camera.matrixWorld,cameraProjectionMatrix:this.camera.projectionMatrix,panoMap:Se.map,panoMatrix:Se.matrix,panoZoom:Se.zoom,minLevel:Ue,level:Ve},Ct=this.tiling.update(Me),Ie={map:this.tiling.renderTarget.texture,matrixInverse:this.tiling.camera.matrixWorldInverse,projectionMatrix:this.tiling.camera.projectionMatrix,pano:qe,opacity:(He==null?void 0:He.panoId)===(ge==null?void 0:ge.panoId)?1:easeInQuart(Math.abs(((c=this.modelScene.parameter.progress)!==null&&c!==void 0?c:0)-.5)*2)},Oe=this.modelScene.parameter.refinedScreen;(Ct||Ie.pano!==(Oe==null?void 0:Oe.pano)||Ie.opacity!==(Oe==null?void 0:Oe.opacity))&&this.modelScene.parameter.set("refinedScreen",Ie)}}if(this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),W&&W.video&&(this.needsRender=!0),this.intersectMesh&&this.intersectMesh.parent&&W&&W.position.y-W.standingPosition.y>10){var gt=this.camera.position.distanceTo(this.intersectMesh.position),Mt=2*Math.tan(.5*this.camera.fov/180*Math.PI),At=gt*Mt/5;this.intersectMesh.scale.setScalar(At)}else this.intersectMesh.scale.setScalar(1);{var ht=b.effect,_t=this.modelScene.parameter,He=_t.pano0,ge=_t.pano1;if(He&&ge&&He!==ge&&(ht==="fly"||ht==="model")&&this.flyEffectUseDepthBuffer){if(((p=this.modelScene.parameter.pano0Depth)===null||p===void 0?void 0:p.panoId)!==He.panoId||((f=this.modelScene.parameter.pano1Depth)===null||f===void 0?void 0:f.panoId)!==ge.panoId){var Ke=500,Ze=512;this.pano0DepthCubeRenderTarget?this.pano0DepthCubeRenderTarget.width!==Ze&&this.pano0DepthCubeRenderTarget.setSize(Ze,Ze):this.pano0DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(Ze,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1}),this.pano1DepthCubeRenderTarget?this.pano1DepthCubeRenderTarget.width!==Ze&&this.pano1DepthCubeRenderTarget.setSize(Ze,Ze):this.pano1DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(Ze,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1});var at=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano0DepthCubeRenderTarget);at.matrix.copy(He.matrix),at.matrixWorld.copy(at.matrix),at.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,at,Ke);var Qe=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano1DepthCubeRenderTarget);Qe.matrix.copy(ge.matrix),Qe.matrixWorld.copy(Qe.matrix),Qe.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,Qe,Ke),this.modelScene.parameter.set({pano0Depth:{panoId:He.panoId,map:this.pano0DepthCubeRenderTarget.texture,mapSize:this.pano0DepthCubeRenderTarget.width,maxDepth:Ke},pano1Depth:{panoId:ge.panoId,map:this.pano1DepthCubeRenderTarget.texture,mapSize:this.pano1DepthCubeRenderTarget.width,maxDepth:Ke}})}}else this.modelScene.parameter.set({pano0Depth:null,pano1Depth:null}),this.flyEffectUseDepthBuffer||(this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0))}}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1],o=this.panoResourceFromLocationMotionKeyframe(r),s=this.works.getObserver(o.panoId);return{workCode:s?s.work.workCode:this.currentPano.workCode,panoIndex:s?s.panoIndex:this.currentPano.panoIndex,mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:s?s.position.clone().applyMatrix4(s.work.transform):this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,r,o){var s=this,u,l,c,p=(u=r.effect)!==null&&u!==void 0?u:"fly";this.userAction=o,this.stopMomentumMovement();var f=panoStringify(e),d=this.works.getObserver(e);if(!d)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));getImageSizeFromURL(d.images.up),this.imageOptions.size;var h=this.imageOptions.transform,m=__assign({key:"pano.".concat(f)},pick(this.imageOptions,["format","size","quality","sharpen","forceUseExifOrientation","mappings"])),A={right:d.images.work.getURL(d.images.right),left:d.images.work.getURL(d.images.left),up:d.images.work.getURL(d.images.up),down:d.images.work.getURL(d.images.down),front:d.images.work.getURL(d.images.front),back:d.images.work.getURL(d.images.back)},g="pano:"+jsonHash([A,m,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===g)return;var E=this.pendingTextureTask.panoId;(l=this.panoMeshes.get(E))===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",createEvent("pano.texture.abort",{error:null,progress:0,meta:null,pano:{panoIndex:d.panoIndex,workCode:d.work.workCode}}))}var v="move-to-pano-"+f;this.pending.add(v);var y=this.modelScene.parameter,b;if(y.pano0&&y.pano0.map.name===g?b=y.pano0:y.pano1&&y.pano1.map.name===g&&(b=y.pano1),b){var T={panoId:f,effect:p,effectEasing:(c=r.effectEasing)!==null&&c!==void 0?c:defaultEffectEase,panoPicture:{panoId:b.panoId,map:b.map,mapSize:b.mapSize,matrix:d.matrix.clone().premultiply(d.work.transform),zoom:1},position:d.position.clone().applyMatrix4(d.work.transform),fixCameraTransform:new THREE__namespace.Matrix4};T.panoPicture&&this.panoPictureObserverMap.set(T.panoPicture,d),this.pendingTextureTask=void 0,AnimationFrameLoop.shared.add(function(){s.pending.delete(v),s.doMoveToPano(e,T,r)},!0,1);return}this.pendingTextureTask={panoId:f,hash:g,onLoad:function(S){var w,R,M=S.body;if(s.destroyed)M.dispose();else{M.name=g;var B=Array.isArray(M.image)?M.image[0]:M.image,C=(w=B==null?void 0:B.width)!==null&&w!==void 0?w:2048,I={panoId:f,effect:p,effectEasing:(R=r.effectEasing)!==null&&R!==void 0?R:defaultEffectEase,panoPicture:{panoId:f,map:M,mapSize:C,matrix:d.matrix.clone().premultiply(d.work.transform),zoom:1},position:d.position.clone().applyMatrix4(d.work.transform),fixCameraTransform:new THREE__namespace.Matrix4};I.panoPicture&&s.panoPictureObserverMap.set(I.panoPicture,d),s.doMoveToPano(e,I,r)}},onError:function(S){var w=__assign(__assign(__assign({},e),{mode:s.mode}),clonePose(s.camera.pose));s.emit("pano.error",createEvent("pano.error",{error:S,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:w})),s.emit("pano.cancel",createEvent("pano.cancel",{error:S,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:w})),s.emit("error",S),r.moveCancelCallback&&r.moveCancelCallback()}};var _=this.panoMeshes.get(f);_&&_.tap&&_.tap(),this.textureLoader.loadCubeTexture(A,{imageURL:{transform:h,options:m},format:THREE__namespace.RGBAFormat,viaAjax:!0,fetcher:getFetcher(d.work)},void 0,void 0,function(S){var w,R;s.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:S,meta:null,pano:e})),((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===g&&((R=s.panoMeshes.get(f))===null||R===void 0||R.setProgress(S))},this.renderer).then(function(S){var w,R;s.pending.delete(v),((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===g?(s.pendingTextureTask.onLoad(S),s.pendingTextureTask=void 0,(R=s.panoMeshes.get(f))===null||R===void 0||R.setProgress(0)):S.body.dispose(),s.emit("pano.texture.success",createEvent("pano.texture.success",{error:null,progress:1,meta:S.meta,pano:e}))}).catch(function(S){var w,R;s.pending.delete(v),((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===g&&(s.pendingTextureTask.onError(S),s.pendingTextureTask=void 0,(R=s.panoMeshes.get(f))===null||R===void 0||R.setProgress(0)),s.emit("pano.texture.error",createEvent("pano.texture.error",{error:S,progress:0,meta:null,pano:e})),s.emit("error",S)}),this.emit("pano.texture.load",createEvent("pano.texture.load",{error:null,progress:0,meta:null,pano:e}))},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var o=e.initial,s=o.duration,u=o.effect,l=o.userAction;e.userAction=l;var c=t.initAnimationEndState(e),p={workCode:c.workCode,panoIndex:c.panoIndex},f={modelAlpha:0},d={perspToOrtho:0},h=!1;e.moveToPano(p,{longitude:c.longitude,latitude:c.latitude,fov:c.fov,effect:u,duration:s,moveStartCallback:function(m){h=!0,e.perspToOrthoMotion.set(d,s).catch(noop),e.modelAlphaMotion.setKeyframes([{progress:0,value:__assign({},e.modelAlphaMotion.value)},{progress:.6,value:__assign({},e.modelAlphaMotion.value)},{progress:1,value:f}],s).catch(noop),e.emit("initAnimation.start",createEvent("initAnimation.start",{state:m,userAction:e.userAction}))},moveEndCallback:function(m){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:m,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var m=__assign(__assign(__assign({},p),{mode:e.mode}),clonePose(e.camera.pose));h===!1&&e.emit("initAnimation.start",createEvent("initAnimation.start",{state:m,userAction:e.userAction})),e.emit("initAnimation.end",createEvent("initAnimation.end",{state:m,userAction:e.userAction})),e.initAnimationed=!0,r()}},l)})},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var r=0,o=1;o<e.length;o++){var s=this.panoResourceFromLocationMotionKeyframe(e[o-1]).position,u=this.panoResourceFromLocationMotionKeyframe(e[o]).position,l=s.distanceTo(u)*(e[o].value.count-e[o-1].value.count);r+=l}return r},t.prototype.doMoveToPano=function(e,r,o){var s=this,u,l,c,p,f,d,h,m,A,g,E;o===void 0&&(o={});var v=now(),y=createUuid();this.panoResources[y]=r;var b=1,T,_,S;if(this.locationMotion.ended){var w=this.locationMotion.getKeyFrameSegment(v);w[0];var R=w[1],M=this.locationMotion.value,B=((u=this.panoResourceFromLocationMotionKeyframe(R))!==null&&u!==void 0?u:this.camera).position,C=r.position;T=Math.max(B.distanceTo(C),b),_=[{key:R.key,progress:0,value:__assign(__assign({},M),{count:0})},{key:y,progress:1,value:{distance:0,count:1}}],S=0}else{var I=this.locationMotion.getKeyFrameSegment(v),L=I[0],R=I[1],M=this.locationMotion.value,O=this.panoResourceFromLocationMotionKeyframe(L).position,B=this.panoResourceFromLocationMotionKeyframe(R).position,C=r.position,F=R.value.count-M.count,N=Math.max(O.distanceTo(B),b)*F,D=Math.max(B.distanceTo(C),b);T=N+D,_=[{key:L.key,progress:0,value:__assign({},M)},{key:R.key,progress:N/T,value:R.value},{key:y,progress:1,value:{count:R.value.count+1,distance:0}}];var q=this.locationMotionKeyframesLength(this.locationMotion.keyframes),z=this.locationMotionKeyframesLength(_);q===0||q===0?S=0:S=this.locationMotion.getProgressVelocity(v)*q/z}var j=r.effect==="instant"?0:this.calculateMovingDuration(o.duration,r.effect==="fly"||r.effect==="model"?T:0),J={longitude:o.longitude,latitude:o.latitude,fov:o.fov},V=__assign(__assign({},e),{mode:this.mode,longitude:(l=J.longitude)!==null&&l!==void 0?l:this.camera.pose.longitude,latitude:(c=J.latitude)!==null&&c!==void 0?c:this.camera.pose.latitude,fov:(p=J.fov)!==null&&p!==void 0?p:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),U=this.currentPano;if(this.emit("pano.moveTo",createEvent("pano.moveTo",{options:o,prevPano:U,progress:0,state:V,userAction:this.userAction,error:null})),o.moveStartCallback&&o.moveStartCallback(V),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=noop,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly"||r.effect==="model")this.cameraMotion.set(J,j).catch(noop);else{var G=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),Z=coordinatesToVector({longitude:(f=J.longitude)!==null&&f!==void 0?f:this.cameraMotion.value.longitude,latitude:(d=J.latitude)!==null&&d!==void 0?d:this.cameraMotion.value.latitude}),W=new THREE__namespace.Object3D;W.lookAt(G);var ee=new THREE__namespace.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(Z);var X=new THREE__namespace.Matrix4().makeRotationFromQuaternion(W.quaternion),K=new THREE__namespace.Matrix4().getInverse(ee).premultiply(X),$=this.cameraMotion.value.fov,re=(h=J.fov)!==null&&h!==void 0?h:this.cameraMotion.value.fov,ne=1;r.effect==="zoomin"?ne=1.5:r.effect==="zoomout"&&(ne=.4);for(var ae=clamp$1(re*ne,1,170),le=0;le<_.length-1;le++){var se=_[le].key;if(se){var ce=this.panoResources[se];ce&&(ce.fixCameraTransform.copy(K),ce.panoPicture&&(ce.panoPicture.zoom=Math.tan(ae/2/180*Math.PI)/Math.tan($/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:(m=J.longitude)!==null&&m!==void 0?m:this.cameraMotion.value.longitude,latitude:(A=J.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:ae}},{progress:1,value:{longitude:(g=J.longitude)!==null&&g!==void 0?g:this.cameraMotion.value.longitude,latitude:(E=J.latitude)!==null&&E!==void 0?E:this.cameraMotion.value.latitude,fov:re}}],j).catch(noop)}var me=this.locationMotion.setKeyframes(_,j,S);me.then(function(){for(var Ae=0,be=s.modelScene.children;Ae<be.length;Ae++){var de=be[Ae];de instanceof Model&&de.show()}var he=__assign(__assign({},e),{mode:s.mode,longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:s.camera.pose.distance});s.emit("pano.arrived",createEvent("pano.arrived",{options:o,prevPano:U,progress:1,state:he,userAction:s.userAction,error:null})),o.moveEndCallback&&o.moveEndCallback(he);var fe=s.works.getObserver(e);if(fe&&fe.video&&s.videoTexture&&s.videoTexture.image instanceof HTMLVideoElement){var te={map:s.videoTexture,size:fe.video.size.clone(),matrix:fe.video.matrix.clone(),panoMatrix:fe.matrix.clone().premultiply(fe.work.transform),alpha:1},ue=createUuid(),Te=s.videoTexture.image;Te.setAttribute("uuid",ue),Te.oncanplay=noop,Te.ontimeupdate=noop,canplayVideo().then(function(Xe){Xe&&fe.video&&Te.getAttribute("uuid")===ue&&(Te.oncanplay=function(){Te.oncanplay=noop,Te.play()},Te.ontimeupdate=function(){Te.currentTime>.5&&(Te.ontimeupdate=noop,s.panoVideo.setMaterial(te))},Te.src=fe.video.source)}).catch((function(){Te.removeAttribute("uuid")}))}else{var xe=s.videoTexture.image;xe.removeAttribute("uuid"),xe.oncanplay=noop,xe.ontimeupdate=noop}},function(){s.emit("pano.cancel",createEvent("pano.cancel",{options:o,prevPano:U,progress:0,state:V,userAction:s.userAction,error:null})),o.moveCancelCallback&&o.moveCancelCallback()})},t.prototype.getForwardObserverOrNot=function(e,r){var o=this,s=this.works.getObserver(this.currentPano);if(!s)return null;var u=r!=null?r:new THREE__namespace.Raycaster(e.position.clone(),e.getWorldDirection(new THREE__namespace.Vector3));u.params.Points={threshold:.1},u.firstHitOnly=!0,u.floorIndex=-1;var l=s.standingPosition.clone().applyMatrix4(s.work.transform),c=s.position.clone().applyMatrix4(s.work.transform);if(c.distanceTo(u.ray.origin)>1){var p=new THREE__namespace.Raycaster(u.ray.origin,new THREE__namespace.Vector3(0,-1,0));p.firstHitOnly=u.firstHitOnly,p.floorIndex=u.floorIndex;var f=this.modelScene.intersectRaycaster(p)[0];f&&f.distance<=2?l.copy(f.point):l.copy(u.ray.origin).add(new THREE__namespace.Vector3(0,-1.5,0))}var d=this.modelScene.intersectRaycaster(u)[0],h=d?d.point:u.ray.origin.clone().add(u.ray.direction.clone().normalize().multiplyScalar(3)),m=h.clone().sub(l).normalize();if(m.length()===0)return null;var A=s.work.observers,g=s.accessibleNodes.filter(function(q){if(q===o.currentPano.panoIndex&&s.work.workCode===o.currentPano.workCode)return!1;var z=A[q];if(!z)return!1;var j=z.standingPosition.clone().applyMatrix4(z.work.transform).project(e);return Math.abs(j.z)>1||Math.abs(j.x)>1||Math.abs(j.y)>1?!1:z.loadable||z.active}),E=new Map,v=g.slice().sort(function(q,z){var j=A[q],J=E.get(j);typeof J=="undefined"&&(J=scratchVector3$3.copy(j.standingPosition).applyMatrix4(j.work.transform).distanceTo(l),E.set(j,J));var V=A[z],U=E.get(V);return typeof U=="undefined"&&(U=scratchVector3$3.copy(V.standingPosition).applyMatrix4(V.work.transform).distanceTo(l),E.set(V,U)),J-U});E.clear();for(var y=0,b=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];y<b.length;y++)for(var T=b[y],_=0,S=v;_<S.length;_++){var w=S[_],R=A[w];if(R){var M=scratchVector3$3.copy(R.standingPosition).applyMatrix4(R.work.transform).sub(l);if(M&&M.length()!==0&&m.angleTo(M)<T)return R}}var B=null;if(r){var C=r.ray.intersectBox(this.modelScene.boundingBox,scratchVector3$3);C&&(C.project(e),Math.abs(C.z)<=1&&(B=C.clone()))}else B=new THREE__namespace.Vector3(0,0,0);if(B){var I=.4,L=s.accessibleNodes.filter(function(q){if(q===o.currentPano.panoIndex&&s.work.workCode===o.currentPano.workCode)return!1;var z=A[q];if(!z)return!1;var j=z.position.clone().applyMatrix4(z.work.transform).project(e);return Math.abs(j.z)>1||Math.abs(j.x)>1||Math.abs(j.y)>1?!1:z.loadable||z.active}),O=new Map,F=L.slice().sort(function(q,z){var j=A[q],J=O.get(j);typeof J=="undefined"&&(J=scratchVector3$3.copy(j.position).applyMatrix4(j.work.transform).distanceTo(e.position),O.set(j,J));var V=A[z],U=O.get(V);return typeof U=="undefined"&&(U=scratchVector3$3.copy(V.position).applyMatrix4(V.work.transform).distanceTo(e.position),O.set(V,U)),J-U});O.clear();for(var N=0,D=F;N<D.length;N++){var w=D[N],R=A[w];if(R){var C=scratchVector3$3.copy(R.position).applyMatrix4(R.work.transform);if(C.project(e),Math.abs(C.z)>1)continue;if(Math.pow(B.x-C.x,2)+Math.pow(B.y-C.y,2)<Math.pow(I,2))return R}}}return null},t.prototype.onTapGesture=function(e){var r=this,o;if(this.userAction=e.userAction,this.stopMomentumMovement(),!!this.initAnimationed){var s=e.center.raycaster;s.floorIndex=-1;var u=this.camera.getDirection(new THREE__namespace.Vector3).setY(0),l=null,c=this.works.getObserver(this.currentPano);if(c){var p=c.work.observers,f=c.accessibleNodes.filter(function(U){if(U===r.currentPano.panoIndex&&c.work.workCode===r.currentPano.workCode)return!1;var G=p[U];if(!G)return!1;var Z=scratchVector3$3.copy(G.position).applyMatrix4(G.work.transform);return Z.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:G.loadable||G.active}),d=this.modelScene.intersectRaycaster(s)[0];if(d){var h=arrayMin(f,function(U){var G=p[U];if(!G)return 1/0;var Z=scratchVector3$3.copy(G.standingPosition).applyMatrix4(G.work.transform);return Z.distanceTo(d.point)},!0),m=h[0],A=h[1];typeof m=="number"&&A<this.panoTapTriggerRadius&&(l=(o=p[m])!==null&&o!==void 0?o:null)}if(l||(l=this.getForwardObserverOrNot(this.camera,s)),l&&l.panoId===panoStringify(this.currentPano)&&(l=null),l&&!this.locationMotion.ended)for(var g=0,E=this.locationMotion.keyframes;g<E.length;g++){var v=E[g],y=this.panoResourceFromLocationMotionKeyframe(v);if(y.panoId===l.panoId){l=null;break}}if(!l)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var b={},T=Math.PI/6,_=Math.PI/12,S=l.position.clone().applyMatrix4(l.work.transform).setY(0).sub(c.position.clone().applyMatrix4(l.work.transform).setY(0)).normalize(),w=[],R=[],M=[],B=l.work.observers,C=0,I=l.accessibleNodes;C<I.length;C++){var m=I[C];if(l.panoIndex!==m&&!(m===this.currentPano.panoIndex&&l.work.workCode===this.currentPano.workCode)){var L=B[m];if(L){var O=L.position.clone().applyMatrix4(L.work.transform).sub(l.position.clone().applyMatrix4(l.work.transform)).setY(0).normalize();S.angleTo(O)<T&&M.push(O)}}}var F=M.length>0?M:__spreadArray(__spreadArray([],w,!0),R,!0),N=F.slice().sort(function(U,G){return U.angleTo(S)-G.angleTo(S)})[0];if(N&&N.angleTo(u)>_&&(b.longitude=Math.atan2(-N.x,-N.z)),this.cameraMotion.value.latitude<-Math.PI/4){var D=e.state.fov,q=clamp$1(typeof this.minLatitude=="function"?this.minLatitude(D):this.minLatitude,-Math.PI/2,Math.PI/2),z=clamp$1(typeof this.maxLatitude=="function"?this.maxLatitude(D):this.maxLatitude,-Math.PI/2,Math.PI/2);b.latitude=clamp$1(0,q,z)}var j=__assign({},e.state);if(j.workCode=l.work.workCode,j.panoIndex=l.panoIndex,b.longitude!==void 0&&(j.longitude=b.longitude),b.latitude!==void 0&&(j.latitude=b.latitude),b.fov!==void 0&&(j.fov=b.fov),j.distance=0,j.offset=l.position.clone(),e.state=j,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:j,userAction:e.userAction,options:b,progress:0,error:null})),l&&!l.active){var J=panoStringify({panoIndex:l.panoIndex,workCode:l.work.workCode}),V=this.panoMeshes.get(J);V&&(V.setDisabled(!1),V.setLoading(!0))}l&&l.active&&this.emit("pano.request",createEvent("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:j,options:b,error:null}))}}}}},t})(PanoramaLikeController),DEG_TO_RAD=Math.PI/180,RAD_TO_DEG=180/Math.PI,MIN_TIMESTEP=.001,MAX_TIMESTEP=1,isIOS=(function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}})(),isSafari=(function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}})(),isFirefoxAndroid=(function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}})(),getChromeVersion=(function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}})(),isChromeWithoutDeviceMotion=(function(){var n=!1;if(getChromeVersion()===65){var t=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var e=t[1].split(".");e[0],e[1];var r=e[2],o=e[3];n=parseInt(r,10)===3325&&parseInt(o,10)<148}}return function(){return n}})(),isSafariWithoutDeviceMotion=(function(){var n=isIOS()&&isSafari()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}})(),isR7=(function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}})();function isLandscapeMode(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return isR7()?!n:n}function isTimestampDeltaValid(n){return!(isNaN(n)||n<=MIN_TIMESTEP||n>MAX_TIMESTEP)}function getQuaternionAngle(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var warnOnce=(function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}})();function getOriginFromUrl(n){var t,e=n.indexOf("://");e!==-1?t=e+3:t=0;var r=n.indexOf("/",t);return r===-1&&(r=n.length),n.substring(0,r)}function isInsideCrossOriginIFrame(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=getOriginFromUrl(document.referrer),e=getOriginFromUrl(window.location.href);return n&&t!==e}var updateEyeViewMatrices=(function(){function n(r,o,s){var u=o?o[0]:0,l=o?o[1]:0,c=o?o[2]:0,p=o?o[3]:1,f=u+u,d=l+l,h=c+c,m=u*f,A=u*d,g=u*h,E=l*d,v=l*h,y=c*h,b=p*f,T=p*d,_=p*h;return r[0]=1-(E+y),r[1]=A+_,r[2]=g-T,r[3]=0,r[4]=A-_,r[5]=1-(m+y),r[6]=v+b,r[7]=0,r[8]=g+T,r[9]=v-b,r[10]=1-(m+E),r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function t(r,o,s){var u=s[0],l=s[1],c=s[2],p,f,d,h,m,A,g,E,v,y,b,T;return o===r?(r[12]=o[0]*u+o[4]*l+o[8]*c+o[12],r[13]=o[1]*u+o[5]*l+o[9]*c+o[13],r[14]=o[2]*u+o[6]*l+o[10]*c+o[14],r[15]=o[3]*u+o[7]*l+o[11]*c+o[15]):(p=o[0],f=o[1],d=o[2],h=o[3],m=o[4],A=o[5],g=o[6],E=o[7],v=o[8],y=o[9],b=o[10],T=o[11],r[0]=p,r[1]=f,r[2]=d,r[3]=h,r[4]=m,r[5]=A,r[6]=g,r[7]=E,r[8]=v,r[9]=y,r[10]=b,r[11]=T,r[12]=p*u+m*l+v*c+o[12],r[13]=f*u+A*l+y*c+o[13],r[14]=d*u+g*l+b*c+o[14],r[15]=h*u+E*l+T*c+o[15]),r}function e(r,o){var s=o[0],u=o[1],l=o[2],c=o[3],p=o[4],f=o[5],d=o[6],h=o[7],m=o[8],A=o[9],g=o[10],E=o[11],v=o[12],y=o[13],b=o[14],T=o[15],_=s*f-u*p,S=s*d-l*p,w=s*h-c*p,R=u*d-l*f,M=u*h-c*f,B=l*h-c*d,C=m*y-A*v,I=m*b-g*v,L=m*T-E*v,O=A*b-g*y,F=A*T-E*y,N=g*T-E*b,D=_*N-S*F+w*O+R*L-M*I+B*C;return D?(D=1/D,r[0]=(f*N-d*F+h*O)*D,r[1]=(l*F-u*N-c*O)*D,r[2]=(y*B-b*M+T*R)*D,r[3]=(g*M-A*B-E*R)*D,r[4]=(d*L-p*N-h*I)*D,r[5]=(s*N-l*L+c*I)*D,r[6]=(b*w-v*B-T*S)*D,r[7]=(m*B-g*w+E*S)*D,r[8]=(p*F-f*L+h*C)*D,r[9]=(u*L-s*F-c*C)*D,r[10]=(v*M-y*w+T*_)*D,r[11]=(A*w-m*M-E*_)*D,r[12]=(f*I-p*O-d*C)*D,r[13]=(s*O-u*I+l*C)*D,r[14]=(y*S-v*R-b*_)*D,r[15]=(m*R-A*S+g*_)*D,r):null}return function(r,o,s){n(r,o),s&&t(r,r,s),e(r,r)}})(),SensorSample=(function(){function n(t,e){t===void 0&&(t=new THREE__namespace.Vector3),e===void 0&&(e=0),this.sample=t,this.timestampS=e}return n.prototype.set=function(t,e){this.sample=t,this.timestampS=e},n.prototype.copy=function(t){this.set(t.sample,t.timestampS)},n})(),ComplementaryFilter=(function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new SensorSample,this.currentGyroMeasurement=new SensorSample,this.previousGyroMeasurement=new SensorSample,isIOS()?this.filterQ=new THREE__namespace.Quaternion(-1,0,0,1):this.filterQ=new THREE__namespace.Quaternion(1,0,0,1),this.previousFilterQ=new THREE__namespace.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new THREE__namespace.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new THREE__namespace.Vector3,this.measuredGravity=new THREE__namespace.Vector3,this.gyroIntegralQ=new THREE__namespace.Quaternion}return n.prototype.addAccelMeasurement=function(t,e){this.currentAccelMeasurement.set(t,e)},n.prototype.addGyroMeasurement=function(t,e){this.currentGyroMeasurement.set(t,e);var r=e-this.previousGyroMeasurement.timestampS;isTimestampDeltaValid(r)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},n.prototype.getOrientation=function(){return this.filterQ},n.prototype.run_=function(){if(!this.isOrientationInitialized){this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),this.isOrientationInitialized=!0;return}var t=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,e=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,t);this.gyroIntegralQ.multiply(e),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(e);var r=new THREE__namespace.Quaternion;r.copy(this.filterQ),r.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(r),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var o=new THREE__namespace.Quaternion;o.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),o.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",RAD_TO_DEG*getQuaternionAngle(o),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var s=new THREE__namespace.Quaternion;s.copy(this.filterQ),s.multiply(o),this.filterQ.slerp(s,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},n.prototype.accelToQuaternion_=function(t){var e=new THREE__namespace.Vector3;e.copy(t),e.normalize();var r=new THREE__namespace.Quaternion;return r.setFromUnitVectors(new THREE__namespace.Vector3(0,0,-1),e),r.inverse(),r},n.prototype.gyroToQuaternionDelta_=function(t,e){var r=new THREE__namespace.Quaternion,o=new THREE__namespace.Vector3;return o.copy(t),o.normalize(),r.setFromAxisAngle(o,t.length()*e),r},n})(),PosePredictor=(function(){function n(t,e){this.predictionTimeS=t,this.isDebug=e,this.previousQ=new THREE__namespace.Quaternion,this.previousTimestampS=null,this.deltaQ=new THREE__namespace.Quaternion,this.outQ=new THREE__namespace.Quaternion}return n.prototype.getPrediction=function(t,e,r){if(!this.previousTimestampS)return this.previousQ.copy(t),this.previousTimestampS=r,t;var o=new THREE__namespace.Vector3;o.copy(e),o.normalize();var s=e.length();if(s<DEG_TO_RAD*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(RAD_TO_DEG*s).toFixed(1)),this.outQ.copy(t),this.previousQ.copy(t),this.outQ;var u=s*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(o,u),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(t),this.previousTimestampS=r,this.outQ},n})(),Distortion=(function(){function n(t){this.coefficients=t}return n.prototype.distortInverse=function(t){for(var e=0,r=1,o=t-this.distort(e);Math.abs(r-e)>1e-4;){var s=t-this.distort(r),u=r-s*((r-e)/(s-o));e=r,r=u,o=s}return r},n.prototype.distort=function(t){for(var e=t*t,r=0,o=0;o<this.coefficients.length;o++)r=e*(r+this.coefficients[o]);return(r+1)*t},n})(),Pose=(function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n})(),FieldOfView=(function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n})(),Sensor=(function(){function n(t,e,r,o){this.viewer={id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]},this.device={widthMeters:.11,heightMeters:.062,bevelMeters:.004},this.depthNear=.01,this.depthFar=1e4,this.yawOnly=r,this.accelerometer=new THREE__namespace.Vector3,this.gyroscope=new THREE__namespace.Vector3,this.filter=new ComplementaryFilter(t,o),this.posePredictor=new PosePredictor(e,o),this.isFirefoxAndroid=isFirefoxAndroid(),this.isIOS=isIOS();var s=getChromeVersion();this.isDeviceMotionInRadians=!this.isIOS&&s!==null&&s<66,this.isWithoutDeviceMotion=isChromeWithoutDeviceMotion()||isSafariWithoutDeviceMotion(),this.filterToWorldQ=new THREE__namespace.Quaternion,isIOS()?this.filterToWorldQ.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new THREE__namespace.Quaternion,this.worldToScreenQ=new THREE__namespace.Quaternion,this.originalPoseAdjustQ=new THREE__namespace.Quaternion;var u=typeof window!="undefined"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),u),this.setScreenTransform_(),isLandscapeMode()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new THREE__namespace.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return n.prototype.getPosition=function(){return null},n.prototype.getOrientation=function(){var t;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||(function(){var s=new THREE__namespace.Quaternion().setFromAxisAngle(new THREE__namespace.Vector3(0,0,-1),0),u=new THREE__namespace.Quaternion;return typeof window!="undefined"&&window.orientation===-90?u.setFromAxisAngle(new THREE__namespace.Vector3(0,1,0),Math.PI/-2):u.setFromAxisAngle(new THREE__namespace.Vector3(0,1,0),Math.PI/2),s.multiply(u)})(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||(function(){var s=new THREE__namespace.Quaternion;return s.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),-Math.PI/2),s})(),t=this._deviceOrientationQ;var e=new THREE__namespace.Quaternion;return e.copy(t),e.multiply(this.deviceOrientationFilterToWorldQ),e.multiply(this.resetQ),e.multiply(this.worldToScreenQ),e.multiplyQuaternions(this.deviceOrientationFixQ,e),this.yawOnly&&(e.x=0,e.z=0,e.normalize()),this.orientationOut_[0]=e.x,this.orientationOut_[1]=e.y,this.orientationOut_[2]=e.z,this.orientationOut_[3]=e.w,this.orientationOut_}else{var r=this.filter.getOrientation();t=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS)}var o=new THREE__namespace.Quaternion;return o.copy(this.filterToWorldQ),o.multiply(this.resetQ),o.multiply(t),o.multiply(this.worldToScreenQ),this.yawOnly&&(o.x=0,o.z=0,o.normalize()),this.orientationOut_[0]=o.x,this.orientationOut_[1]=o.y,this.orientationOut_[2]=o.z,this.orientationOut_[3]=o.w,this.orientationOut_},n.prototype.getPose=function(){var t=new Pose;return t.orientation=this.getOrientation(),t},n.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),isLandscapeMode()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},n.prototype.getFrameData=function(t){var e=this.getOrientation(),r=this.getEyeOffset(),o=this.getEyeProjectionMatrix();return t.pose.angularAcceleration=null,t.pose.angularVelocity=null,t.pose.linearAcceleration=null,t.pose.linearVelocity=null,t.pose.orientation=e,t.pose.position=null,t.timestamp=this.previousTimestampS,t.leftProjectionMatrix.set(o.left),t.rightProjectionMatrix.set(o.right),updateEyeViewMatrices(t.leftViewMatrix,e,r.left),updateEyeViewMatrices(t.rightViewMatrix,e,r.right),t},n.prototype.start=function(){if(typeof window=="undefined")return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),o=this.onDeviceOrientation_.bind(this);return isIOS()&&isInsideCrossOriginIFrame()&&window.addEventListener("message",r),window.addEventListener("orientationchange",e),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",o):window.addEventListener("devicemotion",t),function(){window.removeEventListener("devicemotion",t),window.removeEventListener("deviceorientation",e),window.removeEventListener("orientationchange",e),window.removeEventListener("message",r)}},n.prototype.getEyeOffset=function(){return{left:[-this.viewer.interLensDistance*.5,0,0],right:[this.viewer.interLensDistance*.5,0,0]}},n.prototype.getEyeProjectionMatrix=function(){var t=this.getEyeFieldOfView(),e=this.depthNear,r=this.depthFar,o={left:[],right:[]};{var s=t.left.upDegrees*DEG_TO_RAD,u=t.left.downDegrees*DEG_TO_RAD,l=t.left.leftDegrees*DEG_TO_RAD,c=t.left.rightDegrees*DEG_TO_RAD,p=2/(l+c),f=2/(s+u);o.left[0]=p,o.left[1]=0,o.left[2]=0,o.left[3]=0,o.left[4]=0,o.left[5]=f,o.left[6]=0,o.left[7]=0,o.left[8]=-((l-c)*p*.5),o.left[9]=(s-u)*f*.5,o.left[10]=r/(e-r),o.left[11]=-1,o.left[12]=0,o.left[13]=0,o.left[14]=r*e/(e-r),o.left[15]=0}{var s=t.right.upDegrees*DEG_TO_RAD,u=t.right.downDegrees*DEG_TO_RAD,l=t.right.leftDegrees*DEG_TO_RAD,c=t.right.rightDegrees*DEG_TO_RAD,p=2/(l+c),f=2/(s+u);o.right[0]=p,o.right[1]=0,o.right[2]=0,o.right[3]=0,o.right[4]=0,o.right[5]=f,o.right[6]=0,o.right[7]=0,o.right[8]=-((l-c)*p*.5),o.right[9]=(s-u)*f*.5,o.right[10]=r/(e-r),o.right[11]=-1,o.right[12]=0,o.right[13]=0,o.right[14]=r*e/(e-r),o.right[15]=0}return o},n.prototype.getEyeFieldOfView=function(){var t=this.viewer,e=this.device,r=new Distortion(t.distortionCoefficients),o=t.screenLensDistance,s=(e.widthMeters-t.interLensDistance)/2,u=t.interLensDistance/2,l=t.baselineLensDistance-e.bevelMeters,c=e.heightMeters-l,p=RAD_TO_DEG*Math.atan(r.distort(s/o)),f=RAD_TO_DEG*Math.atan(r.distort(u/o)),d=RAD_TO_DEG*Math.atan(r.distort(l/o)),h=RAD_TO_DEG*Math.atan(r.distort(c/o)),m=new FieldOfView,A=new FieldOfView;return m.leftDegrees=Math.min(p,t.fov),m.rightDegrees=Math.min(f,t.fov),m.downDegrees=Math.min(d,t.fov),m.upDegrees=Math.min(h,t.fov),A.leftDegrees=m.rightDegrees,A.rightDegrees=m.leftDegrees,A.upDegrees=m.upDegrees,A.downDegrees=m.downDegrees,{left:m,right:A}},n.prototype.onDeviceOrientation_=function(t){this._deviceOrientationQ=this._deviceOrientationQ||new THREE__namespace.Quaternion;var e=t.alpha,r=t.beta,o=t.gamma;e=(e||0)*Math.PI/180,r=(r||0)*Math.PI/180,o=(o||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new THREE__namespace.Euler(e,r,-o,"YXZ"))},n.prototype.onDeviceMotion_=function(t){this.updateDeviceMotion_(t)},n.prototype.updateDeviceMotion_=function(t){var e=t.accelerationIncludingGravity,r=t.rotationRate,o=t.timeStamp/1e3,s=o-this.previousTimestampS;if(s<0){warnOnce("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=o;return}else if(s<=MIN_TIMESTEP||s>MAX_TIMESTEP){warnOnce("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),this.previousTimestampS=o;return}e&&(this.accelerometer.set(-e.x,-e.y,-e.z),r&&(isR7()?this.gyroscope.set(-r.beta,r.alpha,r.gamma):this.gyroscope.set(r.alpha,r.beta,r.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,o)),this.filter.addAccelMeasurement(this.accelerometer,o)),this.previousTimestampS=o},n.prototype.onOrientationChange_=function(){this.setScreenTransform_()},n.prototype.onMessage_=function(t){var e=t.data;if(!(!e||!e.type)){var r=e.type.toLowerCase();r==="devicemotion"&&this.updateDeviceMotion_(e.deviceMotionEvent)}},n.prototype.setScreenTransform_=function(){this.worldToScreenQ.set(0,0,0,1);var t=typeof window!="undefined"?window.orientation:0;switch(t){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),Math.PI/2);break}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},n})(),defaultLeftBounds=[0,0,.5,1],defaultRightBounds=[.5,0,.5,1],Cardboard=(function(){function n(t){var e=this;this.renderer=t,this.sensor=new Sensor(.98,.04,!1,!1),this.scale=1,this.cameraL=new THREE__namespace.PerspectiveCamera,this.cameraR=new THREE__namespace.PerspectiveCamera;var r=this.sensor.start();this.dispose=function(){var o=e.renderer.getSize(new THREE__namespace.Vector2);e.renderer.setScissor(0,0,o.width,o.height),e.renderer.setViewport(0,0,o.width,o.height),e.renderer.setScissorTest(!1),r()}}return n.prototype.render=function(t,e){var r=this.renderer.getSize(new THREE__namespace.Vector2);if(r.width>r.height){var o=t.autoUpdate;o&&(t.updateMatrixWorld(),t.autoUpdate=!1);var s={x:Math.round(r.width*defaultLeftBounds[0]),y:Math.round(r.height*defaultLeftBounds[1]),width:Math.round(r.width*defaultLeftBounds[2]),height:Math.round(r.height*defaultLeftBounds[3])},u={x:Math.round(r.width*defaultRightBounds[0]),y:Math.round(r.height*defaultRightBounds[1]),width:Math.round(r.width*defaultRightBounds[2]),height:Math.round(r.height*defaultRightBounds[3])};this.renderer.setScissorTest(!0),this.renderer.autoClear&&this.renderer.clear(),e.parent===null&&e.updateMatrixWorld(),e.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),e.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale);var l=this.sensor.getEyeOffset();this.cameraL.translateOnAxis(new THREE__namespace.Vector3().fromArray(l.left),this.scale),this.cameraR.translateOnAxis(new THREE__namespace.Vector3().fromArray(l.right),this.scale);var c=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=c.left.slice(),this.cameraR.projectionMatrix.elements=c.right.slice(),this.renderer.setViewport(s.x,s.y,s.width,s.height),this.renderer.setScissor(s.x,s.y,s.width,s.height),this.renderer.render(t,this.cameraL),this.renderer.setViewport(u.x,u.y,u.width,u.height),this.renderer.setScissor(u.x,u.y,u.width,u.height),this.renderer.render(t,this.cameraR),this.renderer.setViewport(0,0,r.width,r.height),this.renderer.setScissor(0,0,r.width,r.height),this.renderer.setScissorTest(!1),o&&(t.autoUpdate=!0)}else this.renderer.render(t,e)},n.prototype.dispose=function(){},n})();const cardboard="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKr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Y47cd2LKtMOFwkajzuAeVOlIhfJeKahLyiWJRhLr3Ai2BVzQYKG4lLYXfg8HCSI33a2nTH5OaVWmzYHJGhsdLmDuN2exAonBTzZIuzEUS+ec0ZMBQn+Ea5KlXNI4C/UAO/k6hKwBptJgn8fgmVckgFXML9YEEFLUKMvlqAp0eWyDEAL65dLqyWo6RekTZ2XNCsD6rgpTK/4p3WcrrPH1ghWJGhONC3JoGAkRHH1JKjpNEcCxOV2I8MWyiUJqNVajSVodgiWcVMVLVeSS1ATCZoc88qjVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var _a,LOCALE={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},TEXT=typeof navigator!="undefined"&&(_a=LOCALE[navigator.language.split("-")[0]])!==null&&_a!==void 0?_a:LOCALE.zh,CONTENTS=`
|
|
1574
1574
|
<style>
|
|
1575
1575
|
.$id {
|
|
1576
1576
|
all: initial;
|
|
@@ -1931,7 +1931,7 @@ void main() {
|
|
|
1931
1931
|
|
|
1932
1932
|
gl_FragColor = vec4(gl_FragColor.rgb, gl_FragColor.a * opacity * outside * inside);
|
|
1933
1933
|
}
|
|
1934
|
-
`,PanoSphereMesh=(function(n){__extends(t,n);function t(){var e=n.call(this)||this;e.progress=0,e.opacity=0,e.loading=!1,e.current=!1,e.disabled=!1,e.currentMotion=new Motion({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new Motion({opacity:0}),e.loadingMotion=new Motion({opacity:0}),e.disableMotion=new Motion({opacity:0});var r={blending:THREE__namespace.CustomBlending,blendSrc:THREE__namespace.SrcAlphaFactor,blendDst:THREE__namespace.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE__namespace.OneFactor,blendDstAlpha:THREE__namespace.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return e.hitTestMesh=new THREE__namespace.Mesh(sharedGeometry,new THREE__namespace.MeshBasicMaterial(__assign(__assign({},r),{color:0,opacity:0}))),e.hitTestMesh.scale.set(1.5,1.5,1.5),e.ringMesh=new THREE__namespace.Mesh(sharedGeometry,new THREE__namespace.ShaderMaterial(__assign(__assign({},r),{vertexShader:ringVertexShader,fragmentShader:ringFragmentShader,uniforms:{opacity:{value:0}}}))),e.panoMesh=new THREE__namespace.Mesh(sharedGeometry,new THREE__namespace.ShaderMaterial(__assign(__assign({},r),{vertexShader:vertexShader$2,fragmentShader:fragmentShader$2,uniforms:{circleScale:{value:1.1},circleFade:{value:0},circleOpacity:{value:.5},loadingAngle:{value:0},loadingOpacity:{value:0},opacity:{value:0},disable:{value:0}}}))),e.add(e.hitTestMesh),e.add(e.ringMesh),e.add(e.panoMesh),e.renderOrder=1e4,e.needsRender=!0,e}return t.prototype.setProgress=function(e){this.progress=e,this.setLoading(e>0)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=clamp$1(e,0,1),this.opacityMotion.set({opacity:e},30).catch(noop))},t.prototype.setCurrent=function(e){if(this.current!==e){if(e){var r=[{progress:0,value:{ringScale:2,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.05,value:{ringScale:1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.15,value:{ringScale:1.2,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.25,value:{ringScale:1.1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.8,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1}},{progress:.9,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:.92,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:1,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1.1}}];this.currentMotion.setKeyframes(r,1500).catch(noop)}else{var r=[{progress:0,value:__assign({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(r,200).catch(noop)}this.current=e}},t.prototype.setLoading=function(e){this.loading!==e&&(e?this.loadingMotion.setKeyframes([{progress:0,value:{opacity:0}},{progress:.3,value:{opacity:0}},{progress:1,value:{opacity:.8}}],500).catch(noop):this.loadingMotion.set({opacity:0},0).catch(noop),this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.needsRender=!0)},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({opacity:e?1:0},300).catch(noop),this.needsRender=!0)},t.prototype.tap=function(){return Promise.resolve()},t.prototype.updateTime=function(e,r){this.opacityMotion.update(e),this.currentMotion.update(e),this.loadingMotion.update(e);var o=this.opacityMotion.value.opacity;this.visible=o!==0;var s=this.currentMotion.value,u=s.ringScale,l=s.ringOpacity,c=s.circleFade,p=s.circleOpacity,f=s.circleScale;this.ringMesh.scale.set(u,1,u),this.ringMesh.material.uniforms.opacity.value=l*o,this.panoMesh.material.uniforms.opacity.value=o,this.panoMesh.material.uniforms.circleOpacity.value=p,this.panoMesh.material.uniforms.circleScale.value=f,this.panoMesh.material.uniforms.circleFade.value=c,this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingMotion.value.opacity,this.panoMesh.material.uniforms.disable.value=this.disableMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0},t.prototype.dispose=function(){this.hitTestMesh.material.dispose(),this.ringMesh.material.dispose(),this.panoMesh.material.dispose()},t})(THREE__namespace.Object3D),ACTIVE_TO_CURRENT_DELAY=1500,defaultVRPanoramaControllerCustomInitArgs=__assign({},omit(defaultPanoramaControllerCustomInitArgs,["maxLatitude","minLatitude"])),VRPanoramaController=(function(n){__extends(t,n);function t(e){var r=this,o=t.parseArgs(e);r=n.call(this,o)||this,r.mode="VRPanorama",r.cardboard=new Cardboard(r.renderer);var s=createHelper();r.helperElement=s;var u=new Hammer(s);return r.element.parentNode&&(r.element.parentNode.insertBefore(s,r.element),r.updateHelperElementSize(),u.on("tap",function(){return r.emit("vr.requestExit",createEvent("vr.requestExit",{}))})),r.destroyHelper=function(){u.destroy(),s.parentNode&&s.parentNode.removeChild(s),r.helperElement=void 0},r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),o=n.initAnimationEndState.call(this,r);return __assign(__assign({},o),{mode:"VRPanorama"})},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2}))},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.cardboard.dispose(),this.destroyHelper()},t.prototype.isReady=function(){return!1},t.prototype.updateRenderSize=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0},t.prototype.updateCamera=function(e,r,o){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,o){return Promise.resolve()},t.prototype.updateTime=function(e,r){var o=this,s,u,l,c,p,f;if(!this.destroyed){this.updateHelperElementSize(),this.userAction=!0,this.needsRender=!0,this.modelSceneNeedsRender=!0;var d={},h={},m=this.locationMotion.keyframes[0],A=this.locationMotion.keyframes[this.locationMotion.keyframes.length-1],g=this.locationMotion.getKeyFrameSegment(e),E=g[0],v=g[1],y=this.panoResourceFromLocationMotionKeyframe(E),b=this.panoResourceFromLocationMotionKeyframe(v),T=this.panoResourceFromLocationMotionKeyframe(m),_=this.panoResourceFromLocationMotionKeyframe(A),S=!1;if(this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),d.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),R=w[0],M=w[1],B=this.panoResourceFromLocationMotionKeyframe(R),C=this.panoResourceFromLocationMotionKeyframe(M),I=B.position,L=C.position,O=this.locationMotion.value.count-M.value.count+1;if(d.progress=O,C.panoPicture&&(O<1?B.panoPicture&&(d.pano0=B.panoPicture):d.pano0=C.panoPicture,d.pano1=C.panoPicture),C.effect==="montage"?d.transition="BLACK":C.effect==="spread"?d.transition="SPREAD":d.transition="FADE",(C.effect==="zoomin"||C.effect==="zoomout")&&(d.progress=Math.pow(O,3)),O<1&&C.effect!=="fly"){if(d.pano0&&B.panoPicture){var F={panoId:d.pano0.panoId,map:d.pano0.map,mapSize:d.pano0.mapSize,zoom:d.pano0.zoom,matrix:B.panoPicture.matrix.clone().setPosition(C.position)},N=this.panoPictureObserverMap.get(d.pano0);N&&this.panoPictureObserverMap.set(F,N),d.pano0=F}I.copy(L),S=!0}h.distance=this.locationMotion.value.distance,h.offset=new THREE__namespace.Vector3(I.x+(L.x-I.x)*O,I.y+(L.y-I.y)*O,I.z+(L.z-I.z)*O);for(var D=[],q=[],z=0,j=this.locationMotion.keyframes;z<j.length;z++){var J=j[z],V=J.key,U=J.progress;V!==void 0&&(D.push(V),U>this.locationMotion.progress&&q.push(V))}for(var G=0,Z=Object.keys(this.panoResources);G<Z.length;G++){var W=Z[G];if(!(q.indexOf(W)>=0)){var ee=this.panoResources[W];if(ee.panoPicture){var X=ee.panoPicture.map;if(X){if(X===((s=d.pano0)===null||s===void 0?void 0:s.map)||X===((u=d.pano1)===null||u===void 0?void 0:u.map))continue;X.dispose(),ee.panoPicture=null}}D.indexOf(W)>=0||delete this.panoResources[W]}}this.currentPano=panoParse(C.panoId),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(T.panoId),state:__assign(__assign(__assign(__assign({},panoParse(_.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),h),options:{},progress:this.locationMotion.progress,error:null}))}isEmptyObject(d)===!1&&this.modelScene.parameter.set(d),h.offset&&this.camera.position.copy(h.offset);var K=this.camera.pose.longitude,$=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.computePose(),(K!==this.camera.pose.longitude||$!==this.camera.pose.latitude)&&(this.cameraMotion.set(pick(this.camera.pose,["longitude","latitude"]),0).catch(noop),this.emit("camera.update",createEvent("camera.update",{userAction:!0,state:__assign(__assign(__assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose))}))),this.works.getObserver(this.currentPano);var re=this.works.getObserver(y.panoId),ne=this.works.getObserver(b.panoId),ae=new Map;if(re)for(var le=0,se=re.accessibleNodes;le<se.length;le++){var ce=se[le],N=re.work.observers[ce];if(N){var me=panoStringify({panoIndex:N.panoIndex,workCode:N.work.workCode});ae.set(me,N)}}if(ne)for(var Ae=0,be=ne.accessibleNodes;Ae<be.length;Ae++){var ce=be[Ae],N=ne.work.observers[ce];if(N){var me=panoStringify({panoIndex:N.panoIndex,workCode:N.work.workCode});ae.set(me,N)}}if(this.panoMeshes.forEach(function(ge,Se){var Me=ae.get(Se);Me?(ge.position.copy(Me.position).applyMatrix4(Me.work.transform),ae.delete(Se)):(o.helper.remove(ge),ge.dispose(),o.panoMeshes.delete(Se))}),ae.forEach(function(ge,Se){var Me=new PanoSphereMesh;Me.position.copy(ge.position).applyMatrix4(ge.work.transform),o.panoMeshes.set(Se,Me),o.helper.add(Me),ae.delete(Se)}),this.camera.pose.distance>.1||S?this.panoMeshes.forEach(function(ge,Se){ge.setOpacity(0),ge.updateTime&&ge.updateTime(e,r),ge.visible=!1}):this.panoMeshes.forEach(function(ge,Se){var Me=panoParse(Se),je=o.works.getObserver(Me);if(je){if(!je.loadable&&!je.active){ge.setOpacity(0);return}var Ue=ge.position.clone().setY(o.camera.position.y).distanceTo(o.camera.position);Ue<.05?ge.setOpacity(0):ge.setOpacity(clamp$1(1.5/Ue,0,1)),panoEqual(o.currentPano,Me)&&ge.setOpacity(0),ge.lookAt(o.camera.position)}}),this.locationMotion.ended){var de=this.intersect(e);this.panoMeshes.forEach(function(ge,Se){ge.setCurrent(ge===de),ge.updateTime&&ge.updateTime(e,r)})}{var O=(l=this.modelScene.parameter.progress)!==null&&l!==void 0?l:1,he=Math.round(O),fe=this.modelScene.parameter.pano0,te=this.modelScene.parameter.pano1,ue=he===0?fe:te,N=void 0;if(ue&&(N=this.works.getObserver(ue.panoId),N||(N=this.panoPictureObserverMap.get(ue))),this.tiling.appearDuration=this.tileAppearDuration,this.tiling.maxRequest=O<.6?0:this.tileMaxRequest,this.tiling.imageOptions=this.imageOptions,!N||!ue||this.tileLevelForFov===!1||this.camera.perspToOrtho.x>0){this.tiling.setObserver(null);var Te={renderer:this.renderer,resolution:this.camera.resolution,pixelRatio:this.camera.pixelRatio,time:this.camera.time,cameraMatrix:this.camera.matrixWorld,cameraProjectionMatrix:this.camera.projectionMatrix,panoMap:null,panoMatrix:new THREE__namespace.Matrix4,panoZoom:1,minLevel:0,level:0};this.tiling.update(Te),this.modelScene.parameter.set("refinedScreen",null)}else{var xe=getImageSizeLevel(ue.mapSize),Xe=xe+1,Je=new THREE__namespace.Vector2().copy(this.camera.resolution).multiplyScalar(this.camera.pixelRatio),ze=Math.floor(this.tileLevelForFov(this.camera.fov,Je)),ve=ze>xe?ze:0;this.tiling.setObserver(N);var Te={renderer:this.renderer,resolution:this.camera.resolution,pixelRatio:this.camera.pixelRatio,time:this.camera.time,cameraMatrix:this.camera.matrixWorld,cameraProjectionMatrix:this.camera.projectionMatrix,panoMap:ue.map,panoMatrix:ue.matrix,panoZoom:ue.zoom,minLevel:Xe,level:ve},Ge=this.tiling.update(Te),ye={map:this.tiling.renderTarget.texture,matrixInverse:this.tiling.camera.matrixWorldInverse,projectionMatrix:this.tiling.camera.projectionMatrix,pano:he,opacity:(fe==null?void 0:fe.panoId)===(te==null?void 0:te.panoId)?1:easeInQuart(Math.abs(((c=this.modelScene.parameter.progress)!==null&&c!==void 0?c:0)-.5)*2)},Ne=this.modelScene.parameter.refinedScreen;(Ge||ye.pano!==(Ne==null?void 0:Ne.pano)||ye.opacity!==(Ne==null?void 0:Ne.opacity))&&this.modelScene.parameter.set("refinedScreen",ye)}}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e);{var Be=b.effect,Ye=this.modelScene.parameter,fe=Ye.pano0,te=Ye.pano1;if(fe&&te&&fe!==te&&Be==="fly"&&this.flyEffectUseDepthBuffer){if(((p=this.modelScene.parameter.pano0Depth)===null||p===void 0?void 0:p.panoId)!==fe.panoId||((f=this.modelScene.parameter.pano1Depth)===null||f===void 0?void 0:f.panoId)!==te.panoId){var nt=500,De=512;this.pano0DepthCubeRenderTarget?this.pano0DepthCubeRenderTarget.width!==De&&this.pano0DepthCubeRenderTarget.setSize(De,De):this.pano0DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(De,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1}),this.pano1DepthCubeRenderTarget?this.pano1DepthCubeRenderTarget.width!==De&&this.pano1DepthCubeRenderTarget.setSize(De,De):this.pano1DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(De,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1});var qe=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano0DepthCubeRenderTarget);qe.matrix.copy(fe.matrix),qe.matrixWorld.copy(qe.matrix),qe.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,qe,nt);var He=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano1DepthCubeRenderTarget);He.matrix.copy(te.matrix),He.matrixWorld.copy(He.matrix),He.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,He,nt),this.modelScene.parameter.set({pano0Depth:{panoId:fe.panoId,map:this.pano0DepthCubeRenderTarget.texture,mapSize:this.pano0DepthCubeRenderTarget.width,maxDepth:nt},pano1Depth:{panoId:te.panoId,map:this.pano1DepthCubeRenderTarget.texture,mapSize:this.pano1DepthCubeRenderTarget.width,maxDepth:nt}})}}else this.modelScene.parameter.set({pano0Depth:null,pano1Depth:null}),this.flyEffectUseDepthBuffer||(this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0))}}},t.prototype.render=function(){this.renderer.setScissorTest(!1),this.cardboard.render(this.modelScene,this.camera),this.renderer.autoClear=!1,this.cardboard.render(this.scene,this.camera),this.renderer.autoClear=!0},t.prototype.setCamera=function(e){},t.prototype.destroyHelper=function(){},t.prototype.updateHelperElementSize=function(){if(this.helperElement){var e=new THREE__namespace.Vector2(this.element.offsetWidth,this.element.offsetHeight),r=e.x*this.viewport.left,o=e.y*(1-this.viewport.bottom-this.viewport.height),s=e.x*this.viewport.width,u=e.y*this.viewport.height;this.helperElement.style.marginLeft!==r+"px"&&(this.helperElement.style.marginLeft=r+"px"),this.helperElement.style.marginTop!==o+"px"&&(this.helperElement.style.marginTop=o+"px"),this.helperElement.style.width!==s+"px"&&(this.helperElement.style.width=s+"px"),this.helperElement.style.height!==u+"px"&&(this.helperElement.style.height=u+"px")}},t.prototype.intersect=function(e){var r,o;if(this.locationMotion.ended===!1){this.intersectMesh.visible=!1,this.activePanoMesh=void 0,this.activeTime=void 0;return}if(this.activePanoMesh&&this.activeTime&&e-this.activeTime>ACTIVE_TO_CURRENT_DELAY){var s=this.activePanoMesh,u=null;return this.panoMeshes.forEach(function(R,M){R===s&&(u=M)}),u!==null&&this.moveToPano(panoParse(u),{},!0),this.activePanoMesh=void 0,this.activeTime=void 0,s}var l=this.camera.getDirection(new THREE__namespace.Vector3),c=new THREE__namespace.Raycaster(this.camera.position,l);c.params.Points={threshold:.1},c.firstHitOnly=!0,c.floorIndex=-1;for(var p=void 0,f=[],d=this.works.getObserver(this.currentPano),h=d?d.accessibleNodes.map(function(R){return panoStringify({panoIndex:R,workCode:d.work.workCode})}):[],m=0,A=h;m<A.length;m++){var g=A[m],E=this.panoMeshes.get(g);if(E){var v=c.intersectObject((r=E.hitTestMesh)!==null&&r!==void 0?r:E,!0)[0];if(v){var y=(o=d==null?void 0:d.floorIndex)!==null&&o!==void 0?o:0;f.push({panoMesh:E,intersection:__assign({floorIndex:y,floor:y},v)})}}}var b=f.sort(function(R,M){return R.intersection.distance-M.intersection.distance})[0];b?(p=b.intersection,this.activePanoMesh!==b.panoMesh&&(this.activePanoMesh=b.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(b.panoMesh.position),this.intersectMesh.lookAt(this.camera.position)):(this.activePanoMesh=void 0,this.activeTime=void 0),p||(p=this.modelScene.intersectRaycaster(c)[0]);var T=createEvent("intersect.update",{raycaster:c,intersection:p!=null?p:null,object:this.intersectMesh});if(this.emit("intersect.update",T),T.defaultPrevented){this.hideIntersectMesh();return}if(p&&p.face){var _=p.face.normal,S=new THREE__namespace.Quaternion;S.setFromUnitVectors(new THREE__namespace.Vector3(0,0,1),_),this.intersectMesh.quaternion.copy(S);var w=p.point.clone();this.intersectMesh.position.copy(w),b?this.intersectMesh.visible=!1:this.intersectMesh.visible=!0}else this.intersectMesh.visible=!1;return b==null?void 0:b.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t})(PanoramaController),HUMAN_EYE_POSITION=new THREE__namespace.Vector3(0,1.6,0),scratchObserverBox$1=new THREE__namespace.Box3,scratchVector3$2=new THREE__namespace.Vector3,defaultModelControllerCustomInitArgs=__assign({},defaultPanoramaLikeControllerCustomInitArgs),ModelController=(function(n){__extends(t,n);function t(e){var r=this,o=t.parseArgs(e);return r=n.call(this,o)||this,r.mode="Model",r.locationMotion=new Motion({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 Motion({modelAlpha:r.modelScene.parameter.resolveValue().modelAlpha}),r.perspToOrthoMotion=new Motion({perspToOrtho:r.camera.perspToOrtho.x}),r}return t.parseArgs=function(e){return e instanceof t?e:n.parseArgs.call(this,e)},t.initAnimationEndState=function(e){var r,o,s,u,l,c,p=this.parseArgs(e),f=p.works,d=e.initial,h=d.state,m=d.currentState,A=typeof h.panoIndex=="number"?{workCode:(s=(r=h.workCode)!==null&&r!==void 0?r:(o=p.works[0])===null||o===void 0?void 0:o.workCode)!==null&&s!==void 0?s:"",panoIndex:h.panoIndex}:{workCode:m.workCode,panoIndex:m.panoIndex},g=f.getObserver(A),E=clamp$1((u=h.fov)!==null&&u!==void 0?u:!g||isFristPersonMode(m.mode)?m.fov:p.defaultFov,p.minFov,p.maxFov),v=(l=h.longitude)!==null&&l!==void 0?l:m.longitude,y=clamp$1(typeof p.minLatitude=="function"?p.minLatitude(E):p.minLatitude,-Math.PI/2,Math.PI/2),b=clamp$1(typeof p.maxLatitude=="function"?p.maxLatitude(E):p.maxLatitude,-Math.PI/2,Math.PI/2),T=clamp$1((c=h.latitude)!==null&&c!==void 0?c:!g||isFristPersonMode(m.mode)?m.latitude:p.defaultLatitude,y,b),_=new THREE__namespace.Vector3;if(p.initial.state.offset)_.copy(p.initial.state.offset);else if(g)_.copy(g.position).applyMatrix4(g.work.transform);else{var S=coordinatesToVector(m).setLength(m.distance);_.copy(p.initial.currentState.offset).sub(S)}return{workCode:A.workCode,panoIndex:A.panoIndex,mode:"Model",longitude:v,latitude:T,fov:E,offset:_,distance:0}},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,e)},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,o,s){this.works=e;var u=t.initAnimationEndState(__assign(__assign({},this),{initial:{currentState:__assign(__assign({},this.currentPano),this.camera.pose),duration:o.duration,effect:o.effect,state:r,userAction:s}}));return this.hideIntersectMesh(),this.moveToPosition(u.offset,{duration:0,longitude:u.longitude,latitude:u.latitude,fov:u.fov},s),!0},t.prototype.updateCamera=function(e,r,o){var s=this;return this.initAnimationReady.then(function(){s.userAction=o,s.stopMomentumMovement();var u={},l={};return u.distance=0,e.offset!==void 0&&(u.x=e.offset.x,u.y=e.offset.y,u.z=e.offset.z),e.longitude!==void 0&&(l.longitude=e.longitude),e.latitude!==void 0&&(l.latitude=e.latitude),e.fov!==void 0&&(l.fov=e.fov),s.locationMotion.set(u,r).catch(noop),s.cameraMotion.set(l,r).catch(noop)})},t.prototype.updateCameraWithKeyframes=function(e,r,o){var s=this;return this.initAnimationReady.then(function(){s.userAction=o,s.stopMomentumMovement();for(var u=[],l=[],c=0,p=e;c<p.length;c++){var f=p[c];u.push({key:f.key,progress:f.progress,value:{distance:0,x:f.value.offset.x,y:f.value.offset.x,z:f.value.offset.x}}),l.push({key:f.key,progress:f.progress,value:{longitude:f.value.longitude,latitude:f.value.latitude,fov:f.value.fov}})}return s.locationMotion.setKeyframes(u,r).catch(noop),s.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var o={},s={};if(this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),o.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.modelScene.parameter.modelAlpha===0&&this.modelScene.parameter.progress!==1){var u=this.modelScene.parameter,l=u.pano0,c=u.pano1;l&&l.map!==(c==null?void 0:c.map)&&l.map.dispose(),o.progress=1,o.pano0=o.pano1=c}if(this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),!this.locationMotion.ended){this.locationMotion.update(e),s.distance=this.locationMotion.value.distance,s.offset=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);for(var p=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),f=[],d=function(_){var S=h.modelScene.models.find(function(B){return B.work===_});if(!S||S.visible===!1||_.observers.length<=0)return"continue";if(scratchObserverBox$1.copy(_.observerBox).expandByScalar(10).applyMatrix4(_.transform),scratchObserverBox$1.containsPoint(p))for(var w=0,R=_.observers;w<R.length;w++){var M=R[w];f.push(M)}},h=this,m=0,A=this.works;m<A.length;m++){var g=A[m];d(g)}var E=arrayMin(f,function(_){return scratchVector3$2.copy(_.position).applyMatrix4(_.work.transform).distanceTo(p)});this.currentPano=E?{workCode:E.work.workCode,panoIndex:E.panoIndex}:{workCode:"",panoIndex:0}}this.cameraMotion.ended||(this.cameraMotion.update(e),s.longitude=this.cameraMotion.value.longitude,s.latitude=this.cameraMotion.value.latitude,s.fov=this.cameraMotion.value.fov),isEmptyObject(o)||this.modelScene.parameter.set(o),isEmptyObject(s)||this.setCamera(s);var v=this.works.getObserver(this.currentPano);if(this.intersectMesh&&this.intersectMesh.parent&&v&&v.position.y-v.standingPosition.y>10){var y=this.camera.position.distanceTo(this.intersectMesh.position),b=2*Math.tan(.5*this.camera.fov/180*Math.PI),T=y*b/5;this.intersectMesh.scale.setScalar(T)}else this.intersectMesh.scale.setScalar(1)}},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var o=e.initial;o.state,o.currentState;var s=o.duration,u=o.userAction;e.userAction=u;var l=t.initAnimationEndState(e),c={modelAlpha:1},p={perspToOrtho:0},f={longitude:l.longitude,latitude:l.latitude,fov:l.fov,duration:s,moveStartCallback:function(d){e.perspToOrthoMotion.set(p,s).catch(noop),e.modelAlphaMotion.set(c,s).catch(noop),e.emit("initAnimation.start",createEvent("initAnimation.start",{state:d,userAction:e.userAction}))},moveEndCallback:function(d){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:d,userAction:e.userAction})),r()},moveCancelCallback:function(){var d=e.currentPano,h=__assign(__assign({},d),{mode:e.mode,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance});e.emit("initAnimation.end",createEvent("initAnimation.end",{state:h,userAction:e.userAction})),r()}};e.moveToPosition(l.offset,f,u)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1];return __assign(__assign({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new THREE__namespace.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.moveToPano=function(e,r,o){r===void 0&&(r={});var s=this.works.getObserver(e);if(s){var u=new THREE__namespace.Vector3().copy(s.position).applyMatrix4(s.work.transform);this.moveToPosition(u,r,o)}},t.prototype.moveToPosition=function(e,r,o){var s=this,u,l,c;r===void 0&&(r={}),this.userAction=o,this.stopMomentumMovement();for(var p=now(),f=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),d=f.distanceTo(e),h=this.locationMotion.getProgressVelocity(p),m=0,A=1;A<this.locationMotion.keyframes.length;A++){var g=this.locationMotion.keyframes[A-1].value,E=g.x,v=g.y,y=g.z,b=this.locationMotion.keyframes[A].value,T=b.x,_=b.y,S=b.z;m+=Math.sqrt(Math.pow(T-E,2)+Math.pow(_-v,2)+Math.pow(S-y,2))}for(var w=d===0?0:h*m/d,R=this.calculateMovingDuration(r.duration,d),M={x:e.x,y:e.y,z:e.z,distance:0},B={longitude:r.longitude,latitude:r.latitude,fov:r.fov},C=[],I=function(J){var V=L.modelScene.models.find(function(W){return W.work===J});if(!V||V.visible===!1||J.observers.length<=0)return"continue";if(scratchObserverBox$1.copy(J.observerBox).expandByScalar(10).applyMatrix4(J.transform),scratchObserverBox$1.containsPoint(f))for(var U=0,G=J.observers;U<G.length;U++){var Z=G[U];C.push(Z)}},L=this,O=0,F=this.works;O<F.length;O++){var N=F[O];I(N)}var D=arrayMin(C,function(J){return scratchVector3$2.copy(J.position).applyMatrix4(J.work.transform).distanceTo(f)}),q=D?{workCode:D.work.workCode,panoIndex:D.panoIndex}:{workCode:"",panoIndex:0},z=__assign(__assign({},q),{mode:this.mode,longitude:(u=B.longitude)!==null&&u!==void 0?u:this.camera.pose.longitude,latitude:(l=B.latitude)!==null&&l!==void 0?l:this.camera.pose.latitude,fov:(c=B.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:e.clone(),distance:0}),j=this.currentPano;this.emit("pano.moveTo",createEvent("pano.moveTo",{options:r,prevPano:j,progress:0,state:z,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(z),this.cameraMotion.set(B,R).catch(noop),this.locationMotion.set(M,R,w).then(function(){for(var J=0,V=s.modelScene.children;J<V.length;J++){var U=V[J];U instanceof Model&&U.show()}var G=__assign(__assign(__assign({},q),{mode:s.mode}),clonePose(s.camera.pose));s.emit("pano.arrived",createEvent("pano.arrived",{options:r,prevPano:j,progress:0,state:G,userAction:s.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(G)},function(){r.moveCancelCallback&&r.moveCancelCallback(),s.emit("pano.cancel",createEvent("pano.cancel",{options:r,prevPano:j,progress:0,state:z,userAction:s.userAction,error:null}))})},t.prototype.onTapGesture=function(e){var r=e.center.raycaster;this.stopMomentumMovement();var o=this.modelScene.intersectRaycaster(r)[0];if(o&&o.face){var s=o.face.normal,u=o.point;if(new THREE__namespace.Vector3(0,1,0).angleTo(s)>Math.PI/3){var l=new THREE__namespace.Raycaster;l.firstHitOnly=!0;var c=s.clone().setLength(.3).add(u);l.set(c,new THREE__namespace.Vector3(0,-1,0)),o=this.modelScene.intersectRaycaster(l)[0]}}if(o){for(var p=new THREE__namespace.Vector3().copy(o.point).add(HUMAN_EYE_POSITION),f=[],d=function(T){var _=h.modelScene.models.find(function(M){return M.work===T});if(!_||_.visible===!1||T.observers.length<=0)return"continue";if(scratchObserverBox$1.copy(T.observerBox).expandByScalar(10).applyMatrix4(T.transform),scratchObserverBox$1.containsPoint(p))for(var S=0,w=T.observers;S<w.length;S++){var R=w[S];f.push(R)}},h=this,m=0,A=this.works;m<A.length;m++){var g=A[m];d(g)}var E=arrayMin(f,function(T){return scratchVector3$2.copy(T.position).applyMatrix4(T.work.transform).distanceTo(p)},!0),v=E[0],y=E[1];if(v&&y<5){var b=scratchVector3$2.copy(v.position).applyMatrix4(v.work.transform);p.y=b.y}e.state.offset.copy(p),e.state.distance=0,this.emit("gesture.tap",e),e.defaultPrevented||this.moveToPosition(p,{},!0)}else this.emit("gesture.tap",e),e.defaultPrevented||this.cameraBounce()},t})(PanoramaLikeController),scratchObserverBox=new THREE__namespace.Box3,scratchVector3$1=new THREE__namespace.Vector3,minDistance=.5,PANGESTURE_FORWARD_ANGLE=Math.PI/7,defaultMapviewControllerCustomInitArgs={defaultLongitude:Math.PI/4,defaultLatitude:Math.PI/4,defaultDistance:150,maxLatitude:+Math.PI/2,minLatitude:0,cameraType:"auto",cameraFence:null,intersectMeshCreator:function(){return new IntersectMesh}},MapviewController=(function(n){__extends(t,n);function t(e){var r=this,o=t.parseArgs(e);return r=n.call(this,o)||this,r.mode="Mapview",r.defaultLongitude=o.defaultLongitude,r.defaultLatitude=o.defaultLatitude,r.defaultDistance=o.defaultDistance,r.maxLatitude=o.maxLatitude,r.minLatitude=o.minLatitude,r.cameraType=o.cameraType,r.cameraFence=o.cameraFence,r.locationMotion=new Motion({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 Motion({modelAlpha:r.modelScene.parameter.resolveValue().modelAlpha}),r.perspToOrthoMotion=new Motion({perspToOrtho:r.camera.perspToOrtho.x}),r.pendingTextureId=null,r.textureLoader=new TextureLoader,r.intersectMeshCreator=o.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.helper.add(r.intersectMesh),r}return t.parseArgs=function(e){var r,o,s,u,l,c,p,f;if(e instanceof t)return e;var d=n.parseArgs.call(this,e);return __assign(__assign({},d),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:defaultMapviewControllerCustomInitArgs.defaultLongitude,defaultLatitude:(o=e.defaultLatitude)!==null&&o!==void 0?o:defaultMapviewControllerCustomInitArgs.defaultLatitude,defaultDistance:(s=e.defaultDistance)!==null&&s!==void 0?s:defaultMapviewControllerCustomInitArgs.defaultDistance,maxLatitude:(u=e.maxLatitude)!==null&&u!==void 0?u:defaultMapviewControllerCustomInitArgs.maxLatitude,minLatitude:(l=e.minLatitude)!==null&&l!==void 0?l:defaultMapviewControllerCustomInitArgs.minLatitude,cameraType:(c=e.cameraType)!==null&&c!==void 0?c:defaultMapviewControllerCustomInitArgs.cameraType,cameraFence:(p=e.cameraFence)!==null&&p!==void 0?p:defaultMapviewControllerCustomInitArgs.cameraFence,intersectMeshCreator:(f=e.intersectMeshCreator)!==null&&f!==void 0?f:defaultMapviewControllerCustomInitArgs.intersectMeshCreator})},t.distanceFromModel=function(e,r,o){var s=e.boundingBox,u=s.isEmpty()?10:Math.pow(Math.pow(s.max.x-s.min.x+1,2)+Math.pow(s.max.y-s.min.y+1,2)+Math.pow(s.max.z-s.min.z+1,2),1/2);u=isNaN(u)||!isFinite(u)?1:u;var l=u/2/Math.tan(Math.PI*r/360);return o<1&&(l=l/o),isNaN(l)||!isFinite(l)?u:l},t.initAnimationEndState=function(e){var r,o,s,u,l,c,p,f=this.parseArgs(e),d=f.works,h=f.modelScene,m=e.initial,A=m.state,g=m.currentState,E=typeof A.panoIndex=="number"?{workCode:(s=(r=A.workCode)!==null&&r!==void 0?r:(o=f.works[0])===null||o===void 0?void 0:o.workCode)!==null&&s!==void 0?s:"",panoIndex:A.panoIndex}:{workCode:g.workCode,panoIndex:g.panoIndex},v=(u=A.fov)!==null&&u!==void 0?u:60,y=clamp$1(typeof f.minLatitude=="function"?f.minLatitude(v):f.minLatitude,-Math.PI/2,Math.PI/2),b=clamp$1(typeof f.maxLatitude=="function"?f.maxLatitude(v):f.maxLatitude,-Math.PI/2,Math.PI/2),T=clamp$1((l=A.latitude)!==null&&l!==void 0?l:isThirdPersonMode(g.mode)?g.latitude:f.defaultLatitude,y,b),_=t.distanceFromModel(f.modelScene,v,f.camera.aspect),S=new THREE__namespace.Vector3,w=(c=A.distance)!==null&&c!==void 0?c:Math.min(f.defaultDistance,_),R=(p=A.longitude)!==null&&p!==void 0?p:isThirdPersonMode(g.mode)?g.longitude:f.defaultLongitude;if(A.offset)S.copy(A.offset);else{var M=d.getObserver(E);f.defaultDistance<_&&M?(S.copy(M.position).applyMatrix4(M.work.transform),A.longitude===void 0&&(R=g.longitude)):(h.boundingBox.getCenter(S),w=_)}return __assign(__assign({},E),{mode:"Mapview",longitude:R,latitude:T,fov:v,offset:S,distance:w})},t.prototype.updateConfiguration=function(e){var r=n.prototype.updateConfiguration.call(this,e);if(r===!1)return!1;if(e.defaultLongitude!==void 0&&this.defaultLongitude!==e.defaultLongitude&&(this.defaultLongitude=e.defaultLongitude),e.defaultLatitude!==void 0&&this.defaultLatitude!==e.defaultLatitude&&(this.defaultLatitude=e.defaultLatitude),e.defaultDistance!==void 0&&this.defaultDistance!==e.defaultDistance&&(this.defaultDistance=e.defaultDistance),e.maxLatitude!==void 0&&this.maxLatitude!==e.maxLatitude&&(this.maxLatitude=e.maxLatitude),e.minLatitude!==void 0&&this.minLatitude!==e.minLatitude&&(this.minLatitude=e.minLatitude),e.cameraType!==void 0&&this.cameraType!==e.cameraType&&(this.cameraType=e.cameraType),this.cameraFence instanceof THREE__namespace.Box3&&e.cameraFence instanceof THREE__namespace.Box3?this.cameraFence.equals(e.cameraFence)||(this.cameraFence=e.cameraFence):this.cameraFence instanceof THREE__namespace.Sphere&&e.cameraFence instanceof THREE__namespace.Sphere?this.cameraFence.equals(e.cameraFence)||(this.cameraFence=e.cameraFence):e.cameraFence!==void 0&&(this.cameraFence=e.cameraFence),e.intersectMeshCreator!==void 0&&this.intersectMeshCreator!==e.intersectMeshCreator){this.intersectMeshCreator=e.intersectMeshCreator;var o=this.intersectMesh;this.intersectMesh=this.intersectMeshCreator(),this.intersectMesh.name=o.name,this.intersectMesh.visible=o.visible;var s=this.intersectMesh.parent;s&&s.add(this.intersectMesh),o.dispose()}return!0},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.pendingTextureId=null,this.locationMotion.dispose(),this.panState=void 0,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,o,s){this.userAction=s,this.works=e;var u=t.initAnimationEndState(__assign(__assign({},this),{initial:{currentState:__assign(__assign({},this.currentPano),this.camera.pose),duration:o.duration,effect:o.effect,state:r,userAction:s}}));this.currentPano={workCode:u.workCode,panoIndex:u.panoIndex};var l={longitude:u.longitude,latitude:u.latitude,fov:u.fov},c={x:u.offset.x,y:u.offset.y,z:u.offset.z,distance:u.distance,orthoDistance:u.distance};return this.locationMotion.set(c,o.duration).catch(noop),this.cameraMotion.set(l,o.duration).catch(noop),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.boundingBox.getCenter(new THREE__namespace.Vector3),o=t.distanceFromModel(e,this.cameraMotion.value.fov,this.camera.aspect);this.updateCamera({offset:r,distance:o},0,!0),this.hideIntersectMesh()},t.prototype.updateCamera=function(e,r,o){var s=this;return this.initAnimationReady.then(function(){s.userAction=o,s.stopMomentumMovement();var u={},l={};return e.distance!==void 0&&(u.distance=e.distance),e.offset!==void 0&&(u.x=e.offset.x,u.y=e.offset.y,u.z=e.offset.z),e.longitude!==void 0&&(l.longitude=e.longitude),e.latitude!==void 0&&(l.latitude=e.latitude),e.fov!==void 0&&(l.fov=e.fov),s.locationMotion.set(u,r).catch(noop),s.cameraMotion.set(l,r).catch(noop)})},t.prototype.updateCameraWithKeyframes=function(e,r,o){var s=this;return this.initAnimationReady.then(function(){s.userAction=o,s.stopMomentumMovement();for(var u=[],l=[],c=0,p=e;c<p.length;c++){var f=p[c];u.push({key:f.key,progress:f.progress,value:{distance:f.value.distance,x:f.value.offset.x,y:f.value.offset.x,z:f.value.offset.x}}),l.push({key:f.key,progress:f.progress,value:{longitude:f.value.longitude,latitude:f.value.latitude,fov:f.value.fov}})}return s.locationMotion.setKeyframes(u,r).catch(noop),s.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var o={},s={};if(this.locationMotion.ended||(this.locationMotion.update(e),s.distance=this.locationMotion.value.distance,s.offset=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),s.longitude=this.cameraMotion.value.longitude,s.latitude=this.cameraMotion.value.latitude,s.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),o.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.modelScene.parameter.modelAlpha===0&&this.modelScene.parameter.progress!==1){var u=this.modelScene.parameter,l=u.pano0,c=u.pano1;l&&l.map!==(c==null?void 0:c.map)&&l.map.dispose(),o.progress=1,o.pano0=o.pano1=c}var p=0;if(this.cameraType==="auto"?p=Math.abs(Math.PI/2-this.cameraMotion.value.latitude)<.02||Math.abs(-Math.PI/2-this.cameraMotion.value.latitude)<.02?1:0:this.cameraType==="perspective"?p=0:this.cameraType==="orthographic"&&(p=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==p&&this.perspToOrthoMotion.set({perspToOrtho:p},500).catch(noop),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),isEmptyObject(o)||this.modelScene.parameter.set(o),isEmptyObject(s)||this.setCamera(s),this.cameraFence&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&!this.inMomentumMovement&&this.locationMotion.ended&&this.perspToOrthoMotion.ended&&this.cameraMotion.ended){var f=coordinatesToVector(this.camera.pose,new THREE__namespace.Vector3),d=new THREE__namespace.Vector3().copy(this.camera.pose.offset).sub(f.clone().multiplyScalar(this.camera.pose.distance));if(this.cameraFence.distanceToPoint(d)>.01){var h=this.cameraFence.clampPoint(d,new THREE__namespace.Vector3),m=this.camera.pose.offset.clone().add(h).sub(d),A=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:m,distance:this.camera.pose.distance});this.fixFinalState(A),this.locationMotion.set({x:A.offset.x,y:A.offset.y,z:A.offset.z,distance:A.distance},300).catch(noop)}}if(this.intersectMesh&&this.intersectMesh.parent){var g=this.camera.position.distanceTo(this.intersectMesh.position),E=2*Math.tan(.5*this.camera.fov/180*Math.PI),v=g*E/5;this.intersectMesh.scale.setScalar(v)}else this.intersectMesh.scale.setScalar(1)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1];return __assign(__assign({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new THREE__namespace.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 o=e.initial;o.state,o.currentState;var s=o.duration,u=o.userAction;e.userAction=u;var l=t.initAnimationEndState(e),c={longitude:l.longitude,latitude:l.latitude,fov:l.fov},p={x:l.offset.x,y:l.offset.y,z:l.offset.z,distance:l.distance},f={modelAlpha:1},d={perspToOrtho:0};e.emit("initAnimation.start",createEvent("initAnimation.start",{state:l,userAction:e.userAction})),e.perspToOrthoMotion.set(d,s).catch(noop),e.modelAlphaMotion.set(f,s/3).catch(noop),e.cameraMotion.set(c,s).catch(noop),e.locationMotion.set(p,s).then(function(){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:l,userAction:e.userAction}))},function(h){var m=__assign(__assign(__assign({},e.currentPano),{mode:e.mode}),clonePose(e.camera.pose));e.emit("initAnimation.end",createEvent("initAnimation.end",{state:m,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this.modelScene.intersectRaycaster(e)[0];if(!r)return null;for(var o=[],s=function(m){var A=u.modelScene.models.find(function(y){return y.work===m});if(!A||A.visible===!1||m.observers.length<=0)return"continue";if(scratchObserverBox.copy(m.observerBox).expandByScalar(10).applyMatrix4(m.transform),scratchObserverBox.containsPoint(e.ray.origin)||e.ray.intersectsBox(scratchObserverBox))for(var g=0,E=m.observers;g<E.length;g++){var v=E[g];o.push(v)}},u=this,l=0,c=this.works;l<c.length;l++){var p=c[l];s(p)}var f=arrayMin(o,function(m){return scratchVector3$1.copy(m.standingPosition).applyMatrix4(m.work.transform).distanceTo(r.point)},!0),d=f[0],h=f[1];return d&&h<Math.max(d.standingPosition.distanceTo(this.camera.position)/5,10)?d:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new THREE__namespace.Vector2);return{longitude:-2*e.x/(r.x*this.viewport.width),latitude:2*e.y/(r.y*this.viewport.height)}},t.prototype.requestMomentumMovement=function(e,r,o,s){var u=this;if(this.inMomentumMovement!==null){s=Math.max(s,1);for(var l=__assign({},o),c={longitude:0,latitude:0,x:0,y:0,z:0},p=0;p<s;p++)l.longitude*=.996,l.latitude*=.996*.998,l.x*=.99,l.y*=.99,l.z*=.99,c.longitude+=l.longitude,c.latitude+=l.latitude,c.x+=l.x,c.y+=l.y,c.z+=l.z;var f=this.cameraMotion.value.fov,d=formatRad$1(this.cameraMotion.value.longitude+c.longitude),h=clamp$1(typeof this.minLatitude=="function"?this.minLatitude(f):this.minLatitude,-Math.PI/2,Math.PI/2),m=clamp$1(typeof this.maxLatitude=="function"?this.maxLatitude(f):this.maxLatitude,-Math.PI/2,Math.PI/2),A=clamp$1(this.cameraMotion.value.latitude+c.latitude,h,m),g=new THREE__namespace.Vector3(this.locationMotion.value.x+c.x,this.locationMotion.value.y+c.y,this.locationMotion.value.z+c.z),E=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:d,latitude:A,offset:g,fov:f,distance:this.locationMotion.value.distance}),v=e.state.offset.clone().sub(coordinatesToVector(e.state).setLength(E.distance)),y=!(Math.abs(l.longitude)>1e-4||Math.abs(l.latitude)>1e-4||Math.abs(l.x)>1e-4||Math.abs(l.y)>1e-4||Math.abs(l.z)>1e-4),b=this.cameraFence?this.cameraFence.containsPoint(v):!0;b===!1&&(y=!0);var T=createEvent("gesture.momentum",__assign(__assign({},e),{isFirst:r,isFinal:y,state:E}));if(this.inMomentumMovement.event=T,this.emit("gesture.momentum",T),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:d,latitude:A},0).catch(noop),this.locationMotion.set({x:E.offset.x,y:E.offset.y,z:E.offset.z,distance:E.distance},0).catch(noop),y?this.inMomentumMovement=null:AnimationFrameLoop.shared.add(function(_,S){u.requestMomentumMovement(e,!1,l,S|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=coordinatesToVector(e,new THREE__namespace.Vector3),o=new THREE__namespace.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),s=new THREE__namespace.Raycaster(o,r);s.params.Points={threshold:.1},s.firstHitOnly=!0,s.near=this.camera.near,s.far=this.camera.far;var u;if(u=this.modelScene.intersectRaycaster(s).filter(function(d){var h,m=(h=d.face)===null||h===void 0?void 0:h.normal;return m&&s.ray.direction.dot(m)>=0?!1:d.distance>minDistance+s.near})[0],!u){var l=new THREE__namespace.Plane(new THREE__namespace.Vector3(0,1,0),-this.modelScene.boundingBox.min.y),c=s.ray.intersectPlane(l,new THREE__namespace.Vector3);if(c){var p=c.distanceTo(s.ray.origin);p<1e3&&p>=s.near&&(u={distance:p,floorIndex:0,floor:0,point:c,object:this.scene,face:null})}}if(!u){var f=Math.max(e.distance,3);u={distance:f,floorIndex:0,floor:0,point:s.ray.direction.clone().setLength(f).add(s.ray.origin),object:this.scene,face:null}}u&&(e.distance=clamp$1(u.distance,0,1/0),e.offset.copy(o).add(r.clone().multiplyScalar(e.distance)))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.pointers.length,o=this.panState,s=0,u=!1;e.pointerType==="mouse"&&(s=e.srcEvent.buttons,u=e.srcEvent.shiftKey),o&&s===0&&o.buttons!==0&&(s=o.buttons);var l=o==null?void 0:o.target;if(!l){var c=this.relativeClientPosition(e.center),p=this.createRaycasterFromCamera(c,this.camera);l=new THREE__namespace.Vector3().copy(p.ray.direction).multiplyScalar(3).add(p.ray.origin);var f=this.modelScene.intersectRaycaster(p)[0];if(!f&&p.ray.direction.y<-.3){var d=new THREE__namespace.Plane(new THREE__namespace.Vector3(0,1,0),0),h=p.ray.intersectPlane(d,new THREE__namespace.Vector3);if(h){var m=h.distanceTo(p.ray.origin);m<1e4&&m>=p.near&&(f={distance:m,floorIndex:0,floor:0,point:h,object:this.scene})}}if(f)l.copy(f.point);else{var A=new THREE__namespace.Vector3().copy(this.camera.pose.offset).sub(this.camera.position).normalize(),d=new THREE__namespace.Plane().setFromNormalAndCoplanarPoint(A,this.camera.pose.offset);p.ray.intersectPlane(d,l)}}if(e.isFinal?this.panState=void 0:this.panState={target:l,buttons:s,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof o=="undefined"||o.pointerLength!==r)){var g=r>1||s===2||u;if(g){var E={x:e.center.x-o.x,y:e.center.y-o.y},v=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),y=coordinatesToVector(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(v),b=new THREE__namespace.Vector3().copy(y).sub(o.target).length();b*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var T=this.renderer.getSize(new THREE__namespace.Vector2),_=2*E.x*b/T.y,S=2*E.y*b/T.y,w=new THREE__namespace.Vector3;w.setFromMatrixColumn(this.camera.matrix,0),w.multiplyScalar(-_),v.add(w),this.camera.pose.latitude<PANGESTURE_FORWARD_ANGLE?w.setFromMatrixColumn(this.camera.matrix,1):(w.setFromMatrixColumn(this.camera.matrix,0),w.crossVectors(this.camera.up,w)),w.multiplyScalar(S),v.add(w);var R=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:v,distance:this.camera.pose.distance});if(e.state=R,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:R.offset.x,y:R.offset.y,z:R.offset.z},0).catch(noop),e.isFinal&&(this.fixFinalState(R),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:R.distance,x:R.offset.x,y:R.offset.y,z:R.offset.z},0).catch(noop)),e.isFinal){var M=this.renderer.getSize(new THREE__namespace.Vector2),B=2*e.velocityX*b/M.y,C=2*e.velocityY*b/M.y,I=new THREE__namespace.Vector3,L=new THREE__namespace.Vector3;I.setFromMatrixColumn(this.camera.matrix,0),I.multiplyScalar(-B),L.add(I),this.camera.pose.latitude<PANGESTURE_FORWARD_ANGLE?I.setFromMatrixColumn(this.camera.matrix,1):(I.setFromMatrixColumn(this.camera.matrix,0),I.crossVectors(this.camera.up,I)),I.multiplyScalar(C),L.add(I),this.inMomentumMovement={uuid:createUuid()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:L.x,y:L.y,z:L.z},0)}}else{var E={x:e.center.x-o.x,y:e.center.y-o.y},O=this.coordinatesForOffset(E),F=formatRad$1(this.cameraMotion.value.longitude+O.longitude),N=this.camera.pose.fov,D=clamp$1(typeof this.minLatitude=="function"?this.minLatitude(N):this.minLatitude,-Math.PI/2,Math.PI/2),q=clamp$1(typeof this.maxLatitude=="function"?this.maxLatitude(N):this.maxLatitude,-Math.PI/2,Math.PI/2),z=clamp$1(this.cameraMotion.value.latitude+O.latitude,D,q);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(z=this.cameraMotion.value.latitude);var R=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:F,latitude:z,fov:N,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&Object.assign(e,{__fixFinalState:!0}),e.state=R,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:R.distance,x:R.offset.x,y:R.offset.y,z:R.offset.z},0).catch(noop):this.cameraMotion.set({longitude:R.longitude,latitude:R.latitude},0).catch(noop),e.isFinal){var j=e.velocityX,J=e.velocityY;this.inMomentumMovement={uuid:createUuid()},this.requestMomentumMovement(e,!0,__assign(__assign({},this.coordinatesForOffset({x:j,y:J})),{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 o=(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 o!="undefined"){var s=this.modelScene.boundingBox.getCenter(new THREE__namespace.Vector3),u=t.distanceFromModel(this.modelScene,this.cameraMotion.value.fov,this.camera.aspect),l=clamp$1(o/e.scale,minDistance,1/0),c=e.state.offset.clone().sub(coordinatesToVector(e.state).setLength(l)),p=this.modelScene.boundingBox.containsPoint(c),f;if(!p&&this.pinchState&&this.pinchState.scale>e.scale&&s.distanceTo(c)>u?f=e.state.distance:(f=l,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=f,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(noop),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)),e.isFinal)){if(!("__fixFinalState"in e)){var d=e.state;this.fixFinalState(e.state);var h={x:d.offset.x,y:d.offset.y,z:d.offset.z,distance:d.distance};this.locationMotion.set(h,0).catch(noop)}this.panState=void 0,this.pinchState=void 0}}}},t.prototype.onMouseMove=function(e){var r,o;if(this.intersectMesh.parent&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var s=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var u=this.modelScene.intersectRaycaster(s)[0],l=createEvent("intersect.update",{raycaster:s,intersection:u!=null?u:null,object:this.intersectMesh});if(this.emit("intersect.update",l),l.defaultPrevented){this.hideIntersectMesh();return}if(u){var c=(o=(r=u.face)===null||r===void 0?void 0:r.normal)!==null&&o!==void 0?o:new THREE__namespace.Vector3().copy(s.ray.direction).multiplyScalar(-1),p=c.clone(),f=u.point.clone();this.intersectMesh.position.copy(f);var d=f.clone().add(p);if(this.intersectMesh.lookAt(d),Math.abs(c.y)>.99){var h=this.camera.position.clone().sub(f);this.intersectMesh.rotation.z=-Math.atan2(h.z,h.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 o={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(o,0).catch(noop)}else{var s=t.distanceFromModel(this.modelScene,this.cameraMotion.value.fov,this.camera.aspect),u=Math.max(this.locationMotion.value.distance-this.camera.near,0),l=e.center.delta/10*Math.max(u/5,.1);if(u<=s||l>0)if(this.locationMotion.value.distance-l>=minDistance){var c=this.locationMotion.value.distance-l;e.state.distance=c}else{var p=coordinatesToVector(this.cameraMotion.value);p.setLength(l),e.state.offset.add(p)}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(noop)}},t.prototype.onTapGesture=function(e){var r=this,o;this.userAction=e.userAction,this.stopMomentumMovement();var s=e.center.raycaster,u=this.getForwardObserverOrNot(s);if(!u)this.emit("gesture.tap",e);else{var l={longitude:this.camera.pose.longitude,latitude:0},c=__assign(__assign({},e.state),{mode:"Panorama",workCode:u.work.workCode,panoIndex:u.panoIndex,longitude:l.longitude,latitude:l.latitude,offset:u?u.position.clone():new THREE__namespace.Vector3,distance:0});if(e.state=c,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:c,userAction:e.userAction,options:l,progress:0,error:null})),u&&u.active)){var p=this.pendingTextureId=createUuid(),f={panoIndex:u.panoIndex,workCode:u.work.workCode},d=panoStringify(f),h={right:u.images.work.getURL(u.images.right),left:u.images.work.getURL(u.images.left),up:u.images.work.getURL(u.images.up),down:u.images.work.getURL(u.images.down),front:u.images.work.getURL(u.images.front),back:u.images.work.getURL(u.images.back)},m=this.imageOptions.transform,A=__assign({key:"pano.".concat(d)},pick(this.imageOptions,["format","size","quality","sharpen","forceUseExifOrientation","mappings"])),g="pano:"+jsonHash([h,A,m]),E=this.modelScene.parameter,v=void 0;E.pano0&&E.pano0.map.name===g?v=E.pano0:E.pano1&&E.pano1.map.name===g&&(v=E.pano1),v?(E.pano0&&E.pano0.map!==v.map&&E.pano0.map.dispose(),E.pano1&&E.pano1.map!==v.map&&E.pano1.map!==((o=E.pano0)===null||o===void 0?void 0:o.map)&&E.pano1.map.dispose(),E.set({pano0:v,pano1:v}),this.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:c,options:l,error:null}))):this.textureLoader.loadCubeTexture(h,{imageURL:{transform:m,options:A},format:THREE__namespace.RGBAFormat,viaAjax:!0,fetcher:getFetcher(u.work)},void 0,void 0,void 0,this.renderer).then(function(y){var b,T,_=y.body;if(r.destroyed||r.pendingTextureId!==p){_.dispose();return}r.pendingTextureId=null,_.name=g;var S=Array.isArray(_.image)?_.image[0]:_.image,w=(b=S==null?void 0:S.width)!==null&&b!==void 0?b:2048,R={panoId:d,map:_,mapSize:w,matrix:u.matrix.clone().premultiply(u.work.transform),zoom:1};E.pano0&&E.pano0.map.dispose(),E.pano1&&E.pano1.map!==((T=E.pano0)===null||T===void 0?void 0:T.map)&&E.pano1.map.dispose(),E.set({pano0:R,pano1:R}),r.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:c,options:l,error:null}))}).catch(function(y){r.destroyed||r.pendingTextureId!==p||(r.pendingTextureId=null)})}}},t.prototype.onDblTapGesture=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.state,o=e.center.raycaster,s=o.ray.origin.clone().add(o.ray.direction.clone().setLength(3)),u=1,l=3,c=u,p=this.modelScene.intersectRaycaster(o)[0];if(p&&(s=p.point.clone(),p.distance>(u+l)/2?c=u:c=l),e.state.distance=c,e.state.offset=s,this.emit("gesture.dbltap",e),!e.defaultPrevented){var f={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(f,360).catch(noop),this.hideIntersectMesh()}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible===!0&&(this.intersectMesh.visible=!1,this.needsRender=!0)},t})(BaseController);function isNil(n){return n==null}var _moveEvent={type:"move"},XRController=(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 THREE__namespace.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 THREE__namespace.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new THREE__namespace.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new THREE__namespace.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new THREE__namespace.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new THREE__namespace.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new THREE__namespace.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 o=null,s=null,u=null,l=this._targetRay,c=this._grip,p=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(l!==null&&(o=e.getPose(t.targetRaySpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(_moveEvent))),p&&t.hand){u=!0;for(var f=0,d=t.hand.values();f<d.length;f++){var h=d[f],m=e.getJointPose(h,r);if(p.joints[h.jointName]===void 0){var A=new THREE__namespace.Group;A.matrixAutoUpdate=!1,A.visible=!1,p.joints[h.jointName]=A,p.add(A)}var g=p.joints[h.jointName];m!==null&&(g.matrix.fromArray(m.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.jointRadius=m.radius),g.visible=m!==null}var E=p.joints["index-finger-tip"],v=p.joints["thumb-tip"],y=E.position.distanceTo(v.position),b=.02,T=.005;p.inputState.pinching&&y>b+T?(p.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!p.inputState.pinching&&y<=b-T&&(p.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else c!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,r),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));return l!==null&&(l.visible=o!==null),c!==null&&(c.visible=s!==null),p!==null&&(p.visible=u!==null),this},n})(),framebufferScaleFactor=1,isAppleVisionPro=function(){try{var n=/Macintosh/i.test(navigator.userAgent),t=navigator.maxTouchPoints===5;return n&&t}catch(e){return console.error("Error determining if the device is an Apple Vision Pro: ",e),!1}},isOculus=function(){try{return/Oculus/i.test(navigator.userAgent)}catch(n){return console.error("Error determining if the device is an Oculus: ",n),!1}},XRManager=(function(){function n(t,e,r){var o,s,u,l,c;this.isPanorama=(o=r==null?void 0:r.isPanorama)!==null&&o!==void 0?o:!0,navigator.userAgent.toLowerCase();var p;isAppleVisionPro()?p="VP":isOculus()?p="Oculus":p="Pico",this.machineType=(s=r==null?void 0:r.machineType)!==null&&s!==void 0?s:p,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(u=r==null?void 0:r.referenceSpaceType)!==null&&u!==void 0?u:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(l=r==null?void 0:r.onSessionStart)!==null&&l!==void 0?l:noop,this.onSessionEndCallback=(c=r==null?void 0:r.onSessionEnd)!==null&&c!==void 0?c:noop,this.controllers=[new XRController,new XRController],this.inputSourcesMap=new Map,this.cameraVR=new THREE__namespace.ArrayCamera,this.cameraL=new THREE__namespace.PerspectiveCamera,this.cameraR=new THREE__namespace.PerspectiveCamera,this.cameraVR.cameras.push(this.cameraL,this.cameraR),this.cameraL.viewport=new THREE__namespace.Vector4,this.cameraR.viewport=new THREE__namespace.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 THREE__namespace.Vector3,this.cameraRPos=new THREE__namespace.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 o=this.cameraLPos.distanceTo(this.cameraRPos),s=e.projectionMatrix.elements,u=r.projectionMatrix.elements,l=s[14]/(s[10]-1),c=s[14]/(s[10]+1),p=(s[9]+1)/s[5],f=(s[9]-1)/s[5],d=(s[8]-1)/s[0],h=(u[8]+1)/u[0],m=l*d,A=l*h,g=o/(-d+h),E=g*-d;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(E),t.translateZ(g),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var v=l+g,y=c+g,b=m-E,T=A+(o-E),_=p*c/y*v,S=f*c/y*v;t.projectionMatrix.makePerspective(b,T,_,S,v,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 o=0;o<r.length;o++)this.updateCamera(r[o],e);t.matrixWorld.copy(this.cameraVR.matrixWorld);for(var s=t.children,o=0,u=s.length;o<u;o++)s[o].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 o=t.removed[r],s=this.inputSourcesMap.get(o);s&&(s.dispatchEvent({type:"disconnected",data:o}),this.inputSourcesMap.delete(o))}for(var r=0;r<t.added.length;r++){var o=t.added[r],s=this.inputSourcesMap.get(o);s&&s.dispatchEvent({type:"connected",data:o})}},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,AnimationFrameLoop.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(o){e.onSessionEvent(o)}),this.session.addEventListener("selectstart",function(o){e.onSessionEvent(o)}),this.session.addEventListener("selectend",function(o){e.onSessionEvent(o)}),this.session.addEventListener("squeeze",function(o){e.onSessionEvent(o)}),this.session.addEventListener("squeezestart",function(o){e.onSessionEvent(o)}),this.session.addEventListener("squeezeend",function(o){e.onSessionEvent(o)}),this.session.addEventListener("end",function(o){e.onSessionEnd()});var r=this.gl.getContextAttributes();this.gl.makeXRCompatible().then(function(){var o={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};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,o)});break;case"Oculus":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,o)});break;default:e.machineType;break}e.session.requestReferenceSpace(e.referenceSpaceType).then(function(s){e.onRequestReferenceSpace(s)}),e.session.addEventListener("inputsourceschange",function(s){e.updateInputSources(s)})})}},n})(),LineSegmentsGeometry=(function(n){__extends(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],o=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],s=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(s),e.setAttribute("position",new THREE__namespace.Float32BufferAttribute(r,3)),e.setAttribute("uv",new THREE__namespace.Float32BufferAttribute(o,2)),e}return t.prototype.applyMatrix4=function(e){var r=this.attributes.instanceStart,o=this.attributes.instanceEnd;return r!==void 0&&(r.applyMatrix4(e),o.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 o=new THREE__namespace.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new THREE__namespace.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceEnd",new THREE__namespace.InterleavedBufferAttribute(o,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 o=new THREE__namespace.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new THREE__namespace.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceColorEnd",new THREE__namespace.InterleavedBufferAttribute(o,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 THREE__namespace.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof THREE__namespace.Geometry){var o=new THREE__namespace.BufferGeometry().fromGeometry(r);this.setPositions(o.attributes.position.array)}else r instanceof THREE__namespace.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new THREE__namespace.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var o=new THREE__namespace.Box3;this.boundingBox.setFromBufferAttribute(e),o.setFromBufferAttribute(r),this.boundingBox.union(o)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new THREE__namespace.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var o=this.boundingSphere.center;this.boundingBox.getCenter(o);for(var s=0,u=new THREE__namespace.Vector3,l=0,c=e.count;l<c;l++)u.fromBufferAttribute(e,l),s=Math.max(s,o.distanceToSquared(u)),u.fromBufferAttribute(r,l),s=Math.max(s,o.distanceToSquared(u));this.boundingSphere.radius=Math.sqrt(s),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})(THREE__namespace.InstancedBufferGeometry);Object.assign(LineSegmentsGeometry.prototype,{isLineSegmentsGeometry:!0});var lineShader={uniforms:THREE__namespace.UniformsUtils.merge([THREE__namespace.UniformsLib.common,THREE__namespace.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new THREE__namespace.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
|
|
1934
|
+
`,PanoSphereMesh=(function(n){__extends(t,n);function t(){var e=n.call(this)||this;e.progress=0,e.opacity=0,e.loading=!1,e.current=!1,e.disabled=!1,e.currentMotion=new Motion({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),e.opacityMotion=new Motion({opacity:0}),e.loadingMotion=new Motion({opacity:0}),e.disableMotion=new Motion({opacity:0});var r={blending:THREE__namespace.CustomBlending,blendSrc:THREE__namespace.SrcAlphaFactor,blendDst:THREE__namespace.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE__namespace.OneFactor,blendDstAlpha:THREE__namespace.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return e.hitTestMesh=new THREE__namespace.Mesh(sharedGeometry,new THREE__namespace.MeshBasicMaterial(__assign(__assign({},r),{color:0,opacity:0}))),e.hitTestMesh.scale.set(1.5,1.5,1.5),e.ringMesh=new THREE__namespace.Mesh(sharedGeometry,new THREE__namespace.ShaderMaterial(__assign(__assign({},r),{vertexShader:ringVertexShader,fragmentShader:ringFragmentShader,uniforms:{opacity:{value:0}}}))),e.panoMesh=new THREE__namespace.Mesh(sharedGeometry,new THREE__namespace.ShaderMaterial(__assign(__assign({},r),{vertexShader:vertexShader$2,fragmentShader:fragmentShader$2,uniforms:{circleScale:{value:1.1},circleFade:{value:0},circleOpacity:{value:.5},loadingAngle:{value:0},loadingOpacity:{value:0},opacity:{value:0},disable:{value:0}}}))),e.add(e.hitTestMesh),e.add(e.ringMesh),e.add(e.panoMesh),e.renderOrder=1e4,e.needsRender=!0,e}return t.prototype.setProgress=function(e){this.progress=e,this.setLoading(e>0)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=clamp$1(e,0,1),this.opacityMotion.set({opacity:e},30).catch(noop))},t.prototype.setCurrent=function(e){if(this.current!==e){if(e){var r=[{progress:0,value:{ringScale:2,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.05,value:{ringScale:1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.15,value:{ringScale:1.2,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.25,value:{ringScale:1.1,ringOpacity:1,circleFade:0,circleOpacity:.85,circleScale:1}},{progress:.8,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1}},{progress:.9,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:.92,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.65,circleScale:.8}},{progress:1,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.85,circleScale:1.1}}];this.currentMotion.setKeyframes(r,1500).catch(noop)}else{var r=[{progress:0,value:__assign({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(r,200).catch(noop)}this.current=e}},t.prototype.setLoading=function(e){this.loading!==e&&(e?this.loadingMotion.setKeyframes([{progress:0,value:{opacity:0}},{progress:.3,value:{opacity:0}},{progress:1,value:{opacity:.8}}],500).catch(noop):this.loadingMotion.set({opacity:0},0).catch(noop),this.loading=e,this.disabled===!0&&this.setDisabled(!1),this.needsRender=!0)},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,this.loading===!0&&this.setLoading(!1),this.disableMotion.set({opacity:e?1:0},300).catch(noop),this.needsRender=!0)},t.prototype.tap=function(){return Promise.resolve()},t.prototype.updateTime=function(e,r){this.opacityMotion.update(e),this.currentMotion.update(e),this.loadingMotion.update(e);var o=this.opacityMotion.value.opacity;this.visible=o!==0;var s=this.currentMotion.value,u=s.ringScale,l=s.ringOpacity,c=s.circleFade,p=s.circleOpacity,f=s.circleScale;this.ringMesh.scale.set(u,1,u),this.ringMesh.material.uniforms.opacity.value=l*o,this.panoMesh.material.uniforms.opacity.value=o,this.panoMesh.material.uniforms.circleOpacity.value=p,this.panoMesh.material.uniforms.circleScale.value=f,this.panoMesh.material.uniforms.circleFade.value=c,this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingMotion.value.opacity,this.panoMesh.material.uniforms.disable.value=this.disableMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(Math.PI*2),this.needsRender=!0},t.prototype.dispose=function(){this.hitTestMesh.material.dispose(),this.ringMesh.material.dispose(),this.panoMesh.material.dispose()},t})(THREE__namespace.Object3D),ACTIVE_TO_CURRENT_DELAY=1500,defaultVRPanoramaControllerCustomInitArgs=__assign({},omit(defaultPanoramaControllerCustomInitArgs,["maxLatitude","minLatitude"])),VRPanoramaController=(function(n){__extends(t,n);function t(e){var r=this,o=t.parseArgs(e);r=n.call(this,o)||this,r.mode="VRPanorama",r.cardboard=new Cardboard(r.renderer);var s=createHelper();r.helperElement=s;var u=new Hammer(s);return r.element.parentNode&&(r.element.parentNode.insertBefore(s,r.element),r.updateHelperElementSize(),u.on("tap",function(){return r.emit("vr.requestExit",createEvent("vr.requestExit",{}))})),r.destroyHelper=function(){u.destroy(),s.parentNode&&s.parentNode.removeChild(s),r.helperElement=void 0},r}return t.parseArgs=function(e){if(e instanceof t)return e;var r=__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),o=n.initAnimationEndState.call(this,r);return __assign(__assign({},o),{mode:"VRPanorama"})},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2}))},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.cardboard.dispose(),this.destroyHelper()},t.prototype.isReady=function(){return!1},t.prototype.updateRenderSize=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0},t.prototype.updateCamera=function(e,r,o){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,o){return Promise.resolve()},t.prototype.updateTime=function(e,r){var o=this,s,u,l,c,p,f;if(!this.destroyed){this.updateHelperElementSize(),this.userAction=!0,this.needsRender=!0,this.modelSceneNeedsRender=!0;var d={},h={},m=this.locationMotion.keyframes[0],A=this.locationMotion.keyframes[this.locationMotion.keyframes.length-1],g=this.locationMotion.getKeyFrameSegment(e),E=g[0],v=g[1],y=this.panoResourceFromLocationMotionKeyframe(E),b=this.panoResourceFromLocationMotionKeyframe(v),T=this.panoResourceFromLocationMotionKeyframe(m),_=this.panoResourceFromLocationMotionKeyframe(A),S=!1;if(this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),d.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var w=this.locationMotion.getKeyFrameSegment(e),R=w[0],M=w[1],B=this.panoResourceFromLocationMotionKeyframe(R),C=this.panoResourceFromLocationMotionKeyframe(M),I=B.position,L=C.position,O=this.locationMotion.value.count-M.value.count+1;if(d.progress=O,C.panoPicture&&(O<1?B.panoPicture&&(d.pano0=B.panoPicture):d.pano0=C.panoPicture,d.pano1=C.panoPicture),C.effect==="montage"?d.transition="BLACK":C.effect==="spread"?d.transition="SPREAD":d.transition="FADE",(C.effect==="zoomin"||C.effect==="zoomout")&&(d.progress=Math.pow(O,3)),O<1&&C.effect!=="fly"){if(d.pano0&&B.panoPicture){var F={panoId:d.pano0.panoId,map:d.pano0.map,mapSize:d.pano0.mapSize,zoom:d.pano0.zoom,matrix:B.panoPicture.matrix.clone().setPosition(C.position)},N=this.panoPictureObserverMap.get(d.pano0);N&&this.panoPictureObserverMap.set(F,N),d.pano0=F}I.copy(L),S=!0}h.distance=this.locationMotion.value.distance,h.offset=new THREE__namespace.Vector3(I.x+(L.x-I.x)*O,I.y+(L.y-I.y)*O,I.z+(L.z-I.z)*O);for(var D=[],q=[],z=0,j=this.locationMotion.keyframes;z<j.length;z++){var J=j[z],V=J.key,U=J.progress;V!==void 0&&(D.push(V),U>this.locationMotion.progress&&q.push(V))}for(var G=0,Z=Object.keys(this.panoResources);G<Z.length;G++){var W=Z[G];if(!(q.indexOf(W)>=0)){var ee=this.panoResources[W];if(ee.panoPicture){var X=ee.panoPicture.map;if(X){if(X===((s=d.pano0)===null||s===void 0?void 0:s.map)||X===((u=d.pano1)===null||u===void 0?void 0:u.map))continue;X.dispose(),ee.panoPicture=null}}D.indexOf(W)>=0||delete this.panoResources[W]}}this.currentPano=panoParse(C.panoId),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(T.panoId),state:__assign(__assign(__assign(__assign({},panoParse(_.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),h),options:{},progress:this.locationMotion.progress,error:null}))}isEmptyObject(d)===!1&&this.modelScene.parameter.set(d),h.offset&&this.camera.position.copy(h.offset);var K=this.camera.pose.longitude,$=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.computePose(),(K!==this.camera.pose.longitude||$!==this.camera.pose.latitude)&&(this.cameraMotion.set(pick(this.camera.pose,["longitude","latitude"]),0).catch(noop),this.emit("camera.update",createEvent("camera.update",{userAction:!0,state:__assign(__assign(__assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose))}))),this.works.getObserver(this.currentPano);var re=this.works.getObserver(y.panoId),ne=this.works.getObserver(b.panoId),ae=new Map;if(re)for(var le=0,se=re.accessibleNodes;le<se.length;le++){var ce=se[le],N=re.work.observers[ce];if(N){var me=panoStringify({panoIndex:N.panoIndex,workCode:N.work.workCode});ae.set(me,N)}}if(ne)for(var Ae=0,be=ne.accessibleNodes;Ae<be.length;Ae++){var ce=be[Ae],N=ne.work.observers[ce];if(N){var me=panoStringify({panoIndex:N.panoIndex,workCode:N.work.workCode});ae.set(me,N)}}if(this.panoMeshes.forEach(function(ge,Se){var Me=ae.get(Se);Me?(ge.position.copy(Me.position).applyMatrix4(Me.work.transform),ae.delete(Se)):(o.helper.remove(ge),ge.dispose(),o.panoMeshes.delete(Se))}),ae.forEach(function(ge,Se){var Me=new PanoSphereMesh;Me.position.copy(ge.position).applyMatrix4(ge.work.transform),o.panoMeshes.set(Se,Me),o.helper.add(Me),ae.delete(Se)}),this.camera.pose.distance>.1||S?this.panoMeshes.forEach(function(ge,Se){ge.setOpacity(0),ge.updateTime&&ge.updateTime(e,r),ge.visible=!1}):this.panoMeshes.forEach(function(ge,Se){var Me=panoParse(Se),je=o.works.getObserver(Me);if(je){if(!je.loadable&&!je.active){ge.setOpacity(0);return}var Ue=ge.position.clone().setY(o.camera.position.y).distanceTo(o.camera.position);Ue<.05?ge.setOpacity(0):ge.setOpacity(clamp$1(1.5/Ue,0,1)),panoEqual(o.currentPano,Me)&&ge.setOpacity(0),ge.lookAt(o.camera.position)}}),this.locationMotion.ended){var de=this.intersect(e);this.panoMeshes.forEach(function(ge,Se){ge.setCurrent(ge===de),ge.updateTime&&ge.updateTime(e,r)})}{var O=(l=this.modelScene.parameter.progress)!==null&&l!==void 0?l:1,he=Math.round(O),fe=this.modelScene.parameter.pano0,te=this.modelScene.parameter.pano1,ue=he===0?fe:te,N=void 0;if(ue&&(N=this.works.getObserver(ue.panoId),N||(N=this.panoPictureObserverMap.get(ue))),this.tiling.appearDuration=this.tileAppearDuration,this.tiling.maxRequest=O<(canUseNativeImageBitmap()?.6:.99)?0:this.tileMaxRequest,this.tiling.imageOptions=this.imageOptions,!N||!ue||this.tileLevelForFov===!1||this.camera.perspToOrtho.x>0){this.tiling.setObserver(null);var Te={renderer:this.renderer,resolution:this.camera.resolution,pixelRatio:this.camera.pixelRatio,time:this.camera.time,cameraMatrix:this.camera.matrixWorld,cameraProjectionMatrix:this.camera.projectionMatrix,panoMap:null,panoMatrix:new THREE__namespace.Matrix4,panoZoom:1,minLevel:0,level:0};this.tiling.update(Te),this.modelScene.parameter.set("refinedScreen",null)}else{var xe=getImageSizeLevel(ue.mapSize),Xe=xe+1,Je=new THREE__namespace.Vector2().copy(this.camera.resolution).multiplyScalar(this.camera.pixelRatio),ze=Math.floor(this.tileLevelForFov(this.camera.fov,Je)),ve=ze>xe?ze:0;this.tiling.setObserver(N);var Te={renderer:this.renderer,resolution:this.camera.resolution,pixelRatio:this.camera.pixelRatio,time:this.camera.time,cameraMatrix:this.camera.matrixWorld,cameraProjectionMatrix:this.camera.projectionMatrix,panoMap:ue.map,panoMatrix:ue.matrix,panoZoom:ue.zoom,minLevel:Xe,level:ve},Ge=this.tiling.update(Te),ye={map:this.tiling.renderTarget.texture,matrixInverse:this.tiling.camera.matrixWorldInverse,projectionMatrix:this.tiling.camera.projectionMatrix,pano:he,opacity:(fe==null?void 0:fe.panoId)===(te==null?void 0:te.panoId)?1:easeInQuart(Math.abs(((c=this.modelScene.parameter.progress)!==null&&c!==void 0?c:0)-.5)*2)},Ne=this.modelScene.parameter.refinedScreen;(Ge||ye.pano!==(Ne==null?void 0:Ne.pano)||ye.opacity!==(Ne==null?void 0:Ne.opacity))&&this.modelScene.parameter.set("refinedScreen",ye)}}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e);{var Be=b.effect,Ye=this.modelScene.parameter,fe=Ye.pano0,te=Ye.pano1;if(fe&&te&&fe!==te&&Be==="fly"&&this.flyEffectUseDepthBuffer){if(((p=this.modelScene.parameter.pano0Depth)===null||p===void 0?void 0:p.panoId)!==fe.panoId||((f=this.modelScene.parameter.pano1Depth)===null||f===void 0?void 0:f.panoId)!==te.panoId){var nt=500,De=512;this.pano0DepthCubeRenderTarget?this.pano0DepthCubeRenderTarget.width!==De&&this.pano0DepthCubeRenderTarget.setSize(De,De):this.pano0DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(De,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1}),this.pano1DepthCubeRenderTarget?this.pano1DepthCubeRenderTarget.width!==De&&this.pano1DepthCubeRenderTarget.setSize(De,De):this.pano1DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(De,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1});var qe=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano0DepthCubeRenderTarget);qe.matrix.copy(fe.matrix),qe.matrixWorld.copy(qe.matrix),qe.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,qe,nt);var He=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano1DepthCubeRenderTarget);He.matrix.copy(te.matrix),He.matrixWorld.copy(He.matrix),He.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,He,nt),this.modelScene.parameter.set({pano0Depth:{panoId:fe.panoId,map:this.pano0DepthCubeRenderTarget.texture,mapSize:this.pano0DepthCubeRenderTarget.width,maxDepth:nt},pano1Depth:{panoId:te.panoId,map:this.pano1DepthCubeRenderTarget.texture,mapSize:this.pano1DepthCubeRenderTarget.width,maxDepth:nt}})}}else this.modelScene.parameter.set({pano0Depth:null,pano1Depth:null}),this.flyEffectUseDepthBuffer||(this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0))}}},t.prototype.render=function(){this.renderer.setScissorTest(!1),this.cardboard.render(this.modelScene,this.camera),this.renderer.autoClear=!1,this.cardboard.render(this.scene,this.camera),this.renderer.autoClear=!0},t.prototype.setCamera=function(e){},t.prototype.destroyHelper=function(){},t.prototype.updateHelperElementSize=function(){if(this.helperElement){var e=new THREE__namespace.Vector2(this.element.offsetWidth,this.element.offsetHeight),r=e.x*this.viewport.left,o=e.y*(1-this.viewport.bottom-this.viewport.height),s=e.x*this.viewport.width,u=e.y*this.viewport.height;this.helperElement.style.marginLeft!==r+"px"&&(this.helperElement.style.marginLeft=r+"px"),this.helperElement.style.marginTop!==o+"px"&&(this.helperElement.style.marginTop=o+"px"),this.helperElement.style.width!==s+"px"&&(this.helperElement.style.width=s+"px"),this.helperElement.style.height!==u+"px"&&(this.helperElement.style.height=u+"px")}},t.prototype.intersect=function(e){var r,o;if(this.locationMotion.ended===!1){this.intersectMesh.visible=!1,this.activePanoMesh=void 0,this.activeTime=void 0;return}if(this.activePanoMesh&&this.activeTime&&e-this.activeTime>ACTIVE_TO_CURRENT_DELAY){var s=this.activePanoMesh,u=null;return this.panoMeshes.forEach(function(R,M){R===s&&(u=M)}),u!==null&&this.moveToPano(panoParse(u),{},!0),this.activePanoMesh=void 0,this.activeTime=void 0,s}var l=this.camera.getDirection(new THREE__namespace.Vector3),c=new THREE__namespace.Raycaster(this.camera.position,l);c.params.Points={threshold:.1},c.firstHitOnly=!0,c.floorIndex=-1;for(var p=void 0,f=[],d=this.works.getObserver(this.currentPano),h=d?d.accessibleNodes.map(function(R){return panoStringify({panoIndex:R,workCode:d.work.workCode})}):[],m=0,A=h;m<A.length;m++){var g=A[m],E=this.panoMeshes.get(g);if(E){var v=c.intersectObject((r=E.hitTestMesh)!==null&&r!==void 0?r:E,!0)[0];if(v){var y=(o=d==null?void 0:d.floorIndex)!==null&&o!==void 0?o:0;f.push({panoMesh:E,intersection:__assign({floorIndex:y,floor:y},v)})}}}var b=f.sort(function(R,M){return R.intersection.distance-M.intersection.distance})[0];b?(p=b.intersection,this.activePanoMesh!==b.panoMesh&&(this.activePanoMesh=b.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(b.panoMesh.position),this.intersectMesh.lookAt(this.camera.position)):(this.activePanoMesh=void 0,this.activeTime=void 0),p||(p=this.modelScene.intersectRaycaster(c)[0]);var T=createEvent("intersect.update",{raycaster:c,intersection:p!=null?p:null,object:this.intersectMesh});if(this.emit("intersect.update",T),T.defaultPrevented){this.hideIntersectMesh();return}if(p&&p.face){var _=p.face.normal,S=new THREE__namespace.Quaternion;S.setFromUnitVectors(new THREE__namespace.Vector3(0,0,1),_),this.intersectMesh.quaternion.copy(S);var w=p.point.clone();this.intersectMesh.position.copy(w),b?this.intersectMesh.visible=!1:this.intersectMesh.visible=!0}else this.intersectMesh.visible=!1;return b==null?void 0:b.panoMesh},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t})(PanoramaController),HUMAN_EYE_POSITION=new THREE__namespace.Vector3(0,1.6,0),scratchObserverBox$1=new THREE__namespace.Box3,scratchVector3$2=new THREE__namespace.Vector3,defaultModelControllerCustomInitArgs=__assign({},defaultPanoramaLikeControllerCustomInitArgs),ModelController=(function(n){__extends(t,n);function t(e){var r=this,o=t.parseArgs(e);return r=n.call(this,o)||this,r.mode="Model",r.locationMotion=new Motion({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 Motion({modelAlpha:r.modelScene.parameter.resolveValue().modelAlpha}),r.perspToOrthoMotion=new Motion({perspToOrtho:r.camera.perspToOrtho.x}),r}return t.parseArgs=function(e){return e instanceof t?e:n.parseArgs.call(this,e)},t.initAnimationEndState=function(e){var r,o,s,u,l,c,p=this.parseArgs(e),f=p.works,d=e.initial,h=d.state,m=d.currentState,A=typeof h.panoIndex=="number"?{workCode:(s=(r=h.workCode)!==null&&r!==void 0?r:(o=p.works[0])===null||o===void 0?void 0:o.workCode)!==null&&s!==void 0?s:"",panoIndex:h.panoIndex}:{workCode:m.workCode,panoIndex:m.panoIndex},g=f.getObserver(A),E=clamp$1((u=h.fov)!==null&&u!==void 0?u:!g||isFristPersonMode(m.mode)?m.fov:p.defaultFov,p.minFov,p.maxFov),v=(l=h.longitude)!==null&&l!==void 0?l:m.longitude,y=clamp$1(typeof p.minLatitude=="function"?p.minLatitude(E):p.minLatitude,-Math.PI/2,Math.PI/2),b=clamp$1(typeof p.maxLatitude=="function"?p.maxLatitude(E):p.maxLatitude,-Math.PI/2,Math.PI/2),T=clamp$1((c=h.latitude)!==null&&c!==void 0?c:!g||isFristPersonMode(m.mode)?m.latitude:p.defaultLatitude,y,b),_=new THREE__namespace.Vector3;if(p.initial.state.offset)_.copy(p.initial.state.offset);else if(g)_.copy(g.position).applyMatrix4(g.work.transform);else{var S=coordinatesToVector(m).setLength(m.distance);_.copy(p.initial.currentState.offset).sub(S)}return{workCode:A.workCode,panoIndex:A.panoIndex,mode:"Model",longitude:v,latitude:T,fov:E,offset:_,distance:0}},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,e)},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose()},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,o,s){this.works=e;var u=t.initAnimationEndState(__assign(__assign({},this),{initial:{currentState:__assign(__assign({},this.currentPano),this.camera.pose),duration:o.duration,effect:o.effect,state:r,userAction:s}}));return this.hideIntersectMesh(),this.moveToPosition(u.offset,{duration:0,longitude:u.longitude,latitude:u.latitude,fov:u.fov},s),!0},t.prototype.updateCamera=function(e,r,o){var s=this;return this.initAnimationReady.then(function(){s.userAction=o,s.stopMomentumMovement();var u={},l={};return u.distance=0,e.offset!==void 0&&(u.x=e.offset.x,u.y=e.offset.y,u.z=e.offset.z),e.longitude!==void 0&&(l.longitude=e.longitude),e.latitude!==void 0&&(l.latitude=e.latitude),e.fov!==void 0&&(l.fov=e.fov),s.locationMotion.set(u,r).catch(noop),s.cameraMotion.set(l,r).catch(noop)})},t.prototype.updateCameraWithKeyframes=function(e,r,o){var s=this;return this.initAnimationReady.then(function(){s.userAction=o,s.stopMomentumMovement();for(var u=[],l=[],c=0,p=e;c<p.length;c++){var f=p[c];u.push({key:f.key,progress:f.progress,value:{distance:0,x:f.value.offset.x,y:f.value.offset.x,z:f.value.offset.x}}),l.push({key:f.key,progress:f.progress,value:{longitude:f.value.longitude,latitude:f.value.latitude,fov:f.value.fov}})}return s.locationMotion.setKeyframes(u,r).catch(noop),s.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var o={},s={};if(this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),o.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.modelScene.parameter.modelAlpha===0&&this.modelScene.parameter.progress!==1){var u=this.modelScene.parameter,l=u.pano0,c=u.pano1;l&&l.map!==(c==null?void 0:c.map)&&l.map.dispose(),o.progress=1,o.pano0=o.pano1=c}if(this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),!this.locationMotion.ended){this.locationMotion.update(e),s.distance=this.locationMotion.value.distance,s.offset=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);for(var p=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),f=[],d=function(_){var S=h.modelScene.models.find(function(B){return B.work===_});if(!S||S.visible===!1||_.observers.length<=0)return"continue";if(scratchObserverBox$1.copy(_.observerBox).expandByScalar(10).applyMatrix4(_.transform),scratchObserverBox$1.containsPoint(p))for(var w=0,R=_.observers;w<R.length;w++){var M=R[w];f.push(M)}},h=this,m=0,A=this.works;m<A.length;m++){var g=A[m];d(g)}var E=arrayMin(f,function(_){return scratchVector3$2.copy(_.position).applyMatrix4(_.work.transform).distanceTo(p)});this.currentPano=E?{workCode:E.work.workCode,panoIndex:E.panoIndex}:{workCode:"",panoIndex:0}}this.cameraMotion.ended||(this.cameraMotion.update(e),s.longitude=this.cameraMotion.value.longitude,s.latitude=this.cameraMotion.value.latitude,s.fov=this.cameraMotion.value.fov),isEmptyObject(o)||this.modelScene.parameter.set(o),isEmptyObject(s)||this.setCamera(s);var v=this.works.getObserver(this.currentPano);if(this.intersectMesh&&this.intersectMesh.parent&&v&&v.position.y-v.standingPosition.y>10){var y=this.camera.position.distanceTo(this.intersectMesh.position),b=2*Math.tan(.5*this.camera.fov/180*Math.PI),T=y*b/5;this.intersectMesh.scale.setScalar(T)}else this.intersectMesh.scale.setScalar(1)}},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var o=e.initial;o.state,o.currentState;var s=o.duration,u=o.userAction;e.userAction=u;var l=t.initAnimationEndState(e),c={modelAlpha:1},p={perspToOrtho:0},f={longitude:l.longitude,latitude:l.latitude,fov:l.fov,duration:s,moveStartCallback:function(d){e.perspToOrthoMotion.set(p,s).catch(noop),e.modelAlphaMotion.set(c,s).catch(noop),e.emit("initAnimation.start",createEvent("initAnimation.start",{state:d,userAction:e.userAction}))},moveEndCallback:function(d){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:d,userAction:e.userAction})),r()},moveCancelCallback:function(){var d=e.currentPano,h=__assign(__assign({},d),{mode:e.mode,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance});e.emit("initAnimation.end",createEvent("initAnimation.end",{state:h,userAction:e.userAction})),r()}};e.moveToPosition(l.offset,f,u)})},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1];return __assign(__assign({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new THREE__namespace.Vector3(r.value.x,r.value.y,r.value.z),distance:r.value.distance})},t.prototype.moveToPano=function(e,r,o){r===void 0&&(r={});var s=this.works.getObserver(e);if(s){var u=new THREE__namespace.Vector3().copy(s.position).applyMatrix4(s.work.transform);this.moveToPosition(u,r,o)}},t.prototype.moveToPosition=function(e,r,o){var s=this,u,l,c;r===void 0&&(r={}),this.userAction=o,this.stopMomentumMovement();for(var p=now(),f=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),d=f.distanceTo(e),h=this.locationMotion.getProgressVelocity(p),m=0,A=1;A<this.locationMotion.keyframes.length;A++){var g=this.locationMotion.keyframes[A-1].value,E=g.x,v=g.y,y=g.z,b=this.locationMotion.keyframes[A].value,T=b.x,_=b.y,S=b.z;m+=Math.sqrt(Math.pow(T-E,2)+Math.pow(_-v,2)+Math.pow(S-y,2))}for(var w=d===0?0:h*m/d,R=this.calculateMovingDuration(r.duration,d),M={x:e.x,y:e.y,z:e.z,distance:0},B={longitude:r.longitude,latitude:r.latitude,fov:r.fov},C=[],I=function(J){var V=L.modelScene.models.find(function(W){return W.work===J});if(!V||V.visible===!1||J.observers.length<=0)return"continue";if(scratchObserverBox$1.copy(J.observerBox).expandByScalar(10).applyMatrix4(J.transform),scratchObserverBox$1.containsPoint(f))for(var U=0,G=J.observers;U<G.length;U++){var Z=G[U];C.push(Z)}},L=this,O=0,F=this.works;O<F.length;O++){var N=F[O];I(N)}var D=arrayMin(C,function(J){return scratchVector3$2.copy(J.position).applyMatrix4(J.work.transform).distanceTo(f)}),q=D?{workCode:D.work.workCode,panoIndex:D.panoIndex}:{workCode:"",panoIndex:0},z=__assign(__assign({},q),{mode:this.mode,longitude:(u=B.longitude)!==null&&u!==void 0?u:this.camera.pose.longitude,latitude:(l=B.latitude)!==null&&l!==void 0?l:this.camera.pose.latitude,fov:(c=B.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:e.clone(),distance:0}),j=this.currentPano;this.emit("pano.moveTo",createEvent("pano.moveTo",{options:r,prevPano:j,progress:0,state:z,userAction:this.userAction,error:null})),r.moveStartCallback&&r.moveStartCallback(z),this.cameraMotion.set(B,R).catch(noop),this.locationMotion.set(M,R,w).then(function(){for(var J=0,V=s.modelScene.children;J<V.length;J++){var U=V[J];U instanceof Model&&U.show()}var G=__assign(__assign(__assign({},q),{mode:s.mode}),clonePose(s.camera.pose));s.emit("pano.arrived",createEvent("pano.arrived",{options:r,prevPano:j,progress:0,state:G,userAction:s.userAction,error:null})),r.moveEndCallback&&r.moveEndCallback(G)},function(){r.moveCancelCallback&&r.moveCancelCallback(),s.emit("pano.cancel",createEvent("pano.cancel",{options:r,prevPano:j,progress:0,state:z,userAction:s.userAction,error:null}))})},t.prototype.onTapGesture=function(e){var r=e.center.raycaster;this.stopMomentumMovement();var o=this.modelScene.intersectRaycaster(r)[0];if(o&&o.face){var s=o.face.normal,u=o.point;if(new THREE__namespace.Vector3(0,1,0).angleTo(s)>Math.PI/3){var l=new THREE__namespace.Raycaster;l.firstHitOnly=!0;var c=s.clone().setLength(.3).add(u);l.set(c,new THREE__namespace.Vector3(0,-1,0)),o=this.modelScene.intersectRaycaster(l)[0]}}if(o){for(var p=new THREE__namespace.Vector3().copy(o.point).add(HUMAN_EYE_POSITION),f=[],d=function(T){var _=h.modelScene.models.find(function(M){return M.work===T});if(!_||_.visible===!1||T.observers.length<=0)return"continue";if(scratchObserverBox$1.copy(T.observerBox).expandByScalar(10).applyMatrix4(T.transform),scratchObserverBox$1.containsPoint(p))for(var S=0,w=T.observers;S<w.length;S++){var R=w[S];f.push(R)}},h=this,m=0,A=this.works;m<A.length;m++){var g=A[m];d(g)}var E=arrayMin(f,function(T){return scratchVector3$2.copy(T.position).applyMatrix4(T.work.transform).distanceTo(p)},!0),v=E[0],y=E[1];if(v&&y<5){var b=scratchVector3$2.copy(v.position).applyMatrix4(v.work.transform);p.y=b.y}e.state.offset.copy(p),e.state.distance=0,this.emit("gesture.tap",e),e.defaultPrevented||this.moveToPosition(p,{},!0)}else this.emit("gesture.tap",e),e.defaultPrevented||this.cameraBounce()},t})(PanoramaLikeController),scratchObserverBox=new THREE__namespace.Box3,scratchVector3$1=new THREE__namespace.Vector3,minDistance=.5,PANGESTURE_FORWARD_ANGLE=Math.PI/7,defaultMapviewControllerCustomInitArgs={defaultLongitude:Math.PI/4,defaultLatitude:Math.PI/4,defaultDistance:150,maxLatitude:+Math.PI/2,minLatitude:0,cameraType:"auto",cameraFence:null,intersectMeshCreator:function(){return new IntersectMesh}},MapviewController=(function(n){__extends(t,n);function t(e){var r=this,o=t.parseArgs(e);return r=n.call(this,o)||this,r.mode="Mapview",r.defaultLongitude=o.defaultLongitude,r.defaultLatitude=o.defaultLatitude,r.defaultDistance=o.defaultDistance,r.maxLatitude=o.maxLatitude,r.minLatitude=o.minLatitude,r.cameraType=o.cameraType,r.cameraFence=o.cameraFence,r.locationMotion=new Motion({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 Motion({modelAlpha:r.modelScene.parameter.resolveValue().modelAlpha}),r.perspToOrthoMotion=new Motion({perspToOrtho:r.camera.perspToOrtho.x}),r.pendingTextureId=null,r.textureLoader=new TextureLoader,r.intersectMeshCreator=o.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.helper.add(r.intersectMesh),r}return t.parseArgs=function(e){var r,o,s,u,l,c,p,f;if(e instanceof t)return e;var d=n.parseArgs.call(this,e);return __assign(__assign({},d),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:defaultMapviewControllerCustomInitArgs.defaultLongitude,defaultLatitude:(o=e.defaultLatitude)!==null&&o!==void 0?o:defaultMapviewControllerCustomInitArgs.defaultLatitude,defaultDistance:(s=e.defaultDistance)!==null&&s!==void 0?s:defaultMapviewControllerCustomInitArgs.defaultDistance,maxLatitude:(u=e.maxLatitude)!==null&&u!==void 0?u:defaultMapviewControllerCustomInitArgs.maxLatitude,minLatitude:(l=e.minLatitude)!==null&&l!==void 0?l:defaultMapviewControllerCustomInitArgs.minLatitude,cameraType:(c=e.cameraType)!==null&&c!==void 0?c:defaultMapviewControllerCustomInitArgs.cameraType,cameraFence:(p=e.cameraFence)!==null&&p!==void 0?p:defaultMapviewControllerCustomInitArgs.cameraFence,intersectMeshCreator:(f=e.intersectMeshCreator)!==null&&f!==void 0?f:defaultMapviewControllerCustomInitArgs.intersectMeshCreator})},t.distanceFromModel=function(e,r,o){var s=e.boundingBox,u=s.isEmpty()?10:Math.pow(Math.pow(s.max.x-s.min.x+1,2)+Math.pow(s.max.y-s.min.y+1,2)+Math.pow(s.max.z-s.min.z+1,2),1/2);u=isNaN(u)||!isFinite(u)?1:u;var l=u/2/Math.tan(Math.PI*r/360);return o<1&&(l=l/o),isNaN(l)||!isFinite(l)?u:l},t.initAnimationEndState=function(e){var r,o,s,u,l,c,p,f=this.parseArgs(e),d=f.works,h=f.modelScene,m=e.initial,A=m.state,g=m.currentState,E=typeof A.panoIndex=="number"?{workCode:(s=(r=A.workCode)!==null&&r!==void 0?r:(o=f.works[0])===null||o===void 0?void 0:o.workCode)!==null&&s!==void 0?s:"",panoIndex:A.panoIndex}:{workCode:g.workCode,panoIndex:g.panoIndex},v=(u=A.fov)!==null&&u!==void 0?u:60,y=clamp$1(typeof f.minLatitude=="function"?f.minLatitude(v):f.minLatitude,-Math.PI/2,Math.PI/2),b=clamp$1(typeof f.maxLatitude=="function"?f.maxLatitude(v):f.maxLatitude,-Math.PI/2,Math.PI/2),T=clamp$1((l=A.latitude)!==null&&l!==void 0?l:isThirdPersonMode(g.mode)?g.latitude:f.defaultLatitude,y,b),_=t.distanceFromModel(f.modelScene,v,f.camera.aspect),S=new THREE__namespace.Vector3,w=(c=A.distance)!==null&&c!==void 0?c:Math.min(f.defaultDistance,_),R=(p=A.longitude)!==null&&p!==void 0?p:isThirdPersonMode(g.mode)?g.longitude:f.defaultLongitude;if(A.offset)S.copy(A.offset);else{var M=d.getObserver(E);f.defaultDistance<_&&M?(S.copy(M.position).applyMatrix4(M.work.transform),A.longitude===void 0&&(R=g.longitude)):(h.boundingBox.getCenter(S),w=_)}return __assign(__assign({},E),{mode:"Mapview",longitude:R,latitude:T,fov:v,offset:S,distance:w})},t.prototype.updateConfiguration=function(e){var r=n.prototype.updateConfiguration.call(this,e);if(r===!1)return!1;if(e.defaultLongitude!==void 0&&this.defaultLongitude!==e.defaultLongitude&&(this.defaultLongitude=e.defaultLongitude),e.defaultLatitude!==void 0&&this.defaultLatitude!==e.defaultLatitude&&(this.defaultLatitude=e.defaultLatitude),e.defaultDistance!==void 0&&this.defaultDistance!==e.defaultDistance&&(this.defaultDistance=e.defaultDistance),e.maxLatitude!==void 0&&this.maxLatitude!==e.maxLatitude&&(this.maxLatitude=e.maxLatitude),e.minLatitude!==void 0&&this.minLatitude!==e.minLatitude&&(this.minLatitude=e.minLatitude),e.cameraType!==void 0&&this.cameraType!==e.cameraType&&(this.cameraType=e.cameraType),this.cameraFence instanceof THREE__namespace.Box3&&e.cameraFence instanceof THREE__namespace.Box3?this.cameraFence.equals(e.cameraFence)||(this.cameraFence=e.cameraFence):this.cameraFence instanceof THREE__namespace.Sphere&&e.cameraFence instanceof THREE__namespace.Sphere?this.cameraFence.equals(e.cameraFence)||(this.cameraFence=e.cameraFence):e.cameraFence!==void 0&&(this.cameraFence=e.cameraFence),e.intersectMeshCreator!==void 0&&this.intersectMeshCreator!==e.intersectMeshCreator){this.intersectMeshCreator=e.intersectMeshCreator;var o=this.intersectMesh;this.intersectMesh=this.intersectMeshCreator(),this.intersectMesh.name=o.name,this.intersectMesh.visible=o.visible;var s=this.intersectMesh.parent;s&&s.add(this.intersectMesh),o.dispose()}return!0},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.pendingTextureId=null,this.locationMotion.dispose(),this.panState=void 0,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,o,s){this.userAction=s,this.works=e;var u=t.initAnimationEndState(__assign(__assign({},this),{initial:{currentState:__assign(__assign({},this.currentPano),this.camera.pose),duration:o.duration,effect:o.effect,state:r,userAction:s}}));this.currentPano={workCode:u.workCode,panoIndex:u.panoIndex};var l={longitude:u.longitude,latitude:u.latitude,fov:u.fov},c={x:u.offset.x,y:u.offset.y,z:u.offset.z,distance:u.distance,orthoDistance:u.distance};return this.locationMotion.set(c,o.duration).catch(noop),this.cameraMotion.set(l,o.duration).catch(noop),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e);var r=e.boundingBox.getCenter(new THREE__namespace.Vector3),o=t.distanceFromModel(e,this.cameraMotion.value.fov,this.camera.aspect);this.updateCamera({offset:r,distance:o},0,!0),this.hideIntersectMesh()},t.prototype.updateCamera=function(e,r,o){var s=this;return this.initAnimationReady.then(function(){s.userAction=o,s.stopMomentumMovement();var u={},l={};return e.distance!==void 0&&(u.distance=e.distance),e.offset!==void 0&&(u.x=e.offset.x,u.y=e.offset.y,u.z=e.offset.z),e.longitude!==void 0&&(l.longitude=e.longitude),e.latitude!==void 0&&(l.latitude=e.latitude),e.fov!==void 0&&(l.fov=e.fov),s.locationMotion.set(u,r).catch(noop),s.cameraMotion.set(l,r).catch(noop)})},t.prototype.updateCameraWithKeyframes=function(e,r,o){var s=this;return this.initAnimationReady.then(function(){s.userAction=o,s.stopMomentumMovement();for(var u=[],l=[],c=0,p=e;c<p.length;c++){var f=p[c];u.push({key:f.key,progress:f.progress,value:{distance:f.value.distance,x:f.value.offset.x,y:f.value.offset.x,z:f.value.offset.x}}),l.push({key:f.key,progress:f.progress,value:{longitude:f.value.longitude,latitude:f.value.latitude,fov:f.value.fov}})}return s.locationMotion.setKeyframes(u,r).catch(noop),s.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var o={},s={};if(this.locationMotion.ended||(this.locationMotion.update(e),s.distance=this.locationMotion.value.distance,s.offset=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),s.longitude=this.cameraMotion.value.longitude,s.latitude=this.cameraMotion.value.latitude,s.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),o.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.modelScene.parameter.modelAlpha===0&&this.modelScene.parameter.progress!==1){var u=this.modelScene.parameter,l=u.pano0,c=u.pano1;l&&l.map!==(c==null?void 0:c.map)&&l.map.dispose(),o.progress=1,o.pano0=o.pano1=c}var p=0;if(this.cameraType==="auto"?p=Math.abs(Math.PI/2-this.cameraMotion.value.latitude)<.02||Math.abs(-Math.PI/2-this.cameraMotion.value.latitude)<.02?1:0:this.cameraType==="perspective"?p=0:this.cameraType==="orthographic"&&(p=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==p&&this.perspToOrthoMotion.set({perspToOrtho:p},500).catch(noop),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),isEmptyObject(o)||this.modelScene.parameter.set(o),isEmptyObject(s)||this.setCamera(s),this.cameraFence&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&!this.inMomentumMovement&&this.locationMotion.ended&&this.perspToOrthoMotion.ended&&this.cameraMotion.ended){var f=coordinatesToVector(this.camera.pose,new THREE__namespace.Vector3),d=new THREE__namespace.Vector3().copy(this.camera.pose.offset).sub(f.clone().multiplyScalar(this.camera.pose.distance));if(this.cameraFence.distanceToPoint(d)>.01){var h=this.cameraFence.clampPoint(d,new THREE__namespace.Vector3),m=this.camera.pose.offset.clone().add(h).sub(d),A=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:m,distance:this.camera.pose.distance});this.fixFinalState(A),this.locationMotion.set({x:A.offset.x,y:A.offset.y,z:A.offset.z,distance:A.distance},300).catch(noop)}}if(this.intersectMesh&&this.intersectMesh.parent){var g=this.camera.position.distanceTo(this.intersectMesh.position),E=2*Math.tan(.5*this.camera.fov/180*Math.PI),v=g*E/5;this.intersectMesh.scale.setScalar(v)}else this.intersectMesh.scale.setScalar(1)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1];return __assign(__assign({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new THREE__namespace.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 o=e.initial;o.state,o.currentState;var s=o.duration,u=o.userAction;e.userAction=u;var l=t.initAnimationEndState(e),c={longitude:l.longitude,latitude:l.latitude,fov:l.fov},p={x:l.offset.x,y:l.offset.y,z:l.offset.z,distance:l.distance},f={modelAlpha:1},d={perspToOrtho:0};e.emit("initAnimation.start",createEvent("initAnimation.start",{state:l,userAction:e.userAction})),e.perspToOrthoMotion.set(d,s).catch(noop),e.modelAlphaMotion.set(f,s/3).catch(noop),e.cameraMotion.set(c,s).catch(noop),e.locationMotion.set(p,s).then(function(){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:l,userAction:e.userAction}))},function(h){var m=__assign(__assign(__assign({},e.currentPano),{mode:e.mode}),clonePose(e.camera.pose));e.emit("initAnimation.end",createEvent("initAnimation.end",{state:m,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this.modelScene.intersectRaycaster(e)[0];if(!r)return null;for(var o=[],s=function(m){var A=u.modelScene.models.find(function(y){return y.work===m});if(!A||A.visible===!1||m.observers.length<=0)return"continue";if(scratchObserverBox.copy(m.observerBox).expandByScalar(10).applyMatrix4(m.transform),scratchObserverBox.containsPoint(e.ray.origin)||e.ray.intersectsBox(scratchObserverBox))for(var g=0,E=m.observers;g<E.length;g++){var v=E[g];o.push(v)}},u=this,l=0,c=this.works;l<c.length;l++){var p=c[l];s(p)}var f=arrayMin(o,function(m){return scratchVector3$1.copy(m.standingPosition).applyMatrix4(m.work.transform).distanceTo(r.point)},!0),d=f[0],h=f[1];return d&&h<Math.max(d.standingPosition.distanceTo(this.camera.position)/5,10)?d:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new THREE__namespace.Vector2);return{longitude:-2*e.x/(r.x*this.viewport.width),latitude:2*e.y/(r.y*this.viewport.height)}},t.prototype.requestMomentumMovement=function(e,r,o,s){var u=this;if(this.inMomentumMovement!==null){s=Math.max(s,1);for(var l=__assign({},o),c={longitude:0,latitude:0,x:0,y:0,z:0},p=0;p<s;p++)l.longitude*=.996,l.latitude*=.996*.998,l.x*=.99,l.y*=.99,l.z*=.99,c.longitude+=l.longitude,c.latitude+=l.latitude,c.x+=l.x,c.y+=l.y,c.z+=l.z;var f=this.cameraMotion.value.fov,d=formatRad$1(this.cameraMotion.value.longitude+c.longitude),h=clamp$1(typeof this.minLatitude=="function"?this.minLatitude(f):this.minLatitude,-Math.PI/2,Math.PI/2),m=clamp$1(typeof this.maxLatitude=="function"?this.maxLatitude(f):this.maxLatitude,-Math.PI/2,Math.PI/2),A=clamp$1(this.cameraMotion.value.latitude+c.latitude,h,m),g=new THREE__namespace.Vector3(this.locationMotion.value.x+c.x,this.locationMotion.value.y+c.y,this.locationMotion.value.z+c.z),E=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:d,latitude:A,offset:g,fov:f,distance:this.locationMotion.value.distance}),v=e.state.offset.clone().sub(coordinatesToVector(e.state).setLength(E.distance)),y=!(Math.abs(l.longitude)>1e-4||Math.abs(l.latitude)>1e-4||Math.abs(l.x)>1e-4||Math.abs(l.y)>1e-4||Math.abs(l.z)>1e-4),b=this.cameraFence?this.cameraFence.containsPoint(v):!0;b===!1&&(y=!0);var T=createEvent("gesture.momentum",__assign(__assign({},e),{isFirst:r,isFinal:y,state:E}));if(this.inMomentumMovement.event=T,this.emit("gesture.momentum",T),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:d,latitude:A},0).catch(noop),this.locationMotion.set({x:E.offset.x,y:E.offset.y,z:E.offset.z,distance:E.distance},0).catch(noop),y?this.inMomentumMovement=null:AnimationFrameLoop.shared.add(function(_,S){u.requestMomentumMovement(e,!1,l,S|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=coordinatesToVector(e,new THREE__namespace.Vector3),o=new THREE__namespace.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),s=new THREE__namespace.Raycaster(o,r);s.params.Points={threshold:.1},s.firstHitOnly=!0,s.near=this.camera.near,s.far=this.camera.far;var u;if(u=this.modelScene.intersectRaycaster(s).filter(function(d){var h,m=(h=d.face)===null||h===void 0?void 0:h.normal;return m&&s.ray.direction.dot(m)>=0?!1:d.distance>minDistance+s.near})[0],!u){var l=new THREE__namespace.Plane(new THREE__namespace.Vector3(0,1,0),-this.modelScene.boundingBox.min.y),c=s.ray.intersectPlane(l,new THREE__namespace.Vector3);if(c){var p=c.distanceTo(s.ray.origin);p<1e3&&p>=s.near&&(u={distance:p,floorIndex:0,floor:0,point:c,object:this.scene,face:null})}}if(!u){var f=Math.max(e.distance,3);u={distance:f,floorIndex:0,floor:0,point:s.ray.direction.clone().setLength(f).add(s.ray.origin),object:this.scene,face:null}}u&&(e.distance=clamp$1(u.distance,0,1/0),e.offset.copy(o).add(r.clone().multiplyScalar(e.distance)))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.pointers.length,o=this.panState,s=0,u=!1;e.pointerType==="mouse"&&(s=e.srcEvent.buttons,u=e.srcEvent.shiftKey),o&&s===0&&o.buttons!==0&&(s=o.buttons);var l=o==null?void 0:o.target;if(!l){var c=this.relativeClientPosition(e.center),p=this.createRaycasterFromCamera(c,this.camera);l=new THREE__namespace.Vector3().copy(p.ray.direction).multiplyScalar(3).add(p.ray.origin);var f=this.modelScene.intersectRaycaster(p)[0];if(!f&&p.ray.direction.y<-.3){var d=new THREE__namespace.Plane(new THREE__namespace.Vector3(0,1,0),0),h=p.ray.intersectPlane(d,new THREE__namespace.Vector3);if(h){var m=h.distanceTo(p.ray.origin);m<1e4&&m>=p.near&&(f={distance:m,floorIndex:0,floor:0,point:h,object:this.scene})}}if(f)l.copy(f.point);else{var A=new THREE__namespace.Vector3().copy(this.camera.pose.offset).sub(this.camera.position).normalize(),d=new THREE__namespace.Plane().setFromNormalAndCoplanarPoint(A,this.camera.pose.offset);p.ray.intersectPlane(d,l)}}if(e.isFinal?this.panState=void 0:this.panState={target:l,buttons:s,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof o=="undefined"||o.pointerLength!==r)){var g=r>1||s===2||u;if(g){var E={x:e.center.x-o.x,y:e.center.y-o.y},v=new THREE__namespace.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),y=coordinatesToVector(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(v),b=new THREE__namespace.Vector3().copy(y).sub(o.target).length();b*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var T=this.renderer.getSize(new THREE__namespace.Vector2),_=2*E.x*b/T.y,S=2*E.y*b/T.y,w=new THREE__namespace.Vector3;w.setFromMatrixColumn(this.camera.matrix,0),w.multiplyScalar(-_),v.add(w),this.camera.pose.latitude<PANGESTURE_FORWARD_ANGLE?w.setFromMatrixColumn(this.camera.matrix,1):(w.setFromMatrixColumn(this.camera.matrix,0),w.crossVectors(this.camera.up,w)),w.multiplyScalar(S),v.add(w);var R=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:v,distance:this.camera.pose.distance});if(e.state=R,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:R.offset.x,y:R.offset.y,z:R.offset.z},0).catch(noop),e.isFinal&&(this.fixFinalState(R),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:R.distance,x:R.offset.x,y:R.offset.y,z:R.offset.z},0).catch(noop)),e.isFinal){var M=this.renderer.getSize(new THREE__namespace.Vector2),B=2*e.velocityX*b/M.y,C=2*e.velocityY*b/M.y,I=new THREE__namespace.Vector3,L=new THREE__namespace.Vector3;I.setFromMatrixColumn(this.camera.matrix,0),I.multiplyScalar(-B),L.add(I),this.camera.pose.latitude<PANGESTURE_FORWARD_ANGLE?I.setFromMatrixColumn(this.camera.matrix,1):(I.setFromMatrixColumn(this.camera.matrix,0),I.crossVectors(this.camera.up,I)),I.multiplyScalar(C),L.add(I),this.inMomentumMovement={uuid:createUuid()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:L.x,y:L.y,z:L.z},0)}}else{var E={x:e.center.x-o.x,y:e.center.y-o.y},O=this.coordinatesForOffset(E),F=formatRad$1(this.cameraMotion.value.longitude+O.longitude),N=this.camera.pose.fov,D=clamp$1(typeof this.minLatitude=="function"?this.minLatitude(N):this.minLatitude,-Math.PI/2,Math.PI/2),q=clamp$1(typeof this.maxLatitude=="function"?this.maxLatitude(N):this.maxLatitude,-Math.PI/2,Math.PI/2),z=clamp$1(this.cameraMotion.value.latitude+O.latitude,D,q);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(z=this.cameraMotion.value.latitude);var R=__assign(__assign({},this.currentPano),{mode:this.mode,longitude:F,latitude:z,fov:N,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&Object.assign(e,{__fixFinalState:!0}),e.state=R,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:R.distance,x:R.offset.x,y:R.offset.y,z:R.offset.z},0).catch(noop):this.cameraMotion.set({longitude:R.longitude,latitude:R.latitude},0).catch(noop),e.isFinal){var j=e.velocityX,J=e.velocityY;this.inMomentumMovement={uuid:createUuid()},this.requestMomentumMovement(e,!0,__assign(__assign({},this.coordinatesForOffset({x:j,y:J})),{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 o=(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 o!="undefined"){var s=this.modelScene.boundingBox.getCenter(new THREE__namespace.Vector3),u=t.distanceFromModel(this.modelScene,this.cameraMotion.value.fov,this.camera.aspect),l=clamp$1(o/e.scale,minDistance,1/0),c=e.state.offset.clone().sub(coordinatesToVector(e.state).setLength(l)),p=this.modelScene.boundingBox.containsPoint(c),f;if(!p&&this.pinchState&&this.pinchState.scale>e.scale&&s.distanceTo(c)>u?f=e.state.distance:(f=l,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=f,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(noop),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)),e.isFinal)){if(!("__fixFinalState"in e)){var d=e.state;this.fixFinalState(e.state);var h={x:d.offset.x,y:d.offset.y,z:d.offset.z,distance:d.distance};this.locationMotion.set(h,0).catch(noop)}this.panState=void 0,this.pinchState=void 0}}}},t.prototype.onMouseMove=function(e){var r,o;if(this.intersectMesh.parent&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var s=e.center.raycaster;if(e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var u=this.modelScene.intersectRaycaster(s)[0],l=createEvent("intersect.update",{raycaster:s,intersection:u!=null?u:null,object:this.intersectMesh});if(this.emit("intersect.update",l),l.defaultPrevented){this.hideIntersectMesh();return}if(u){var c=(o=(r=u.face)===null||r===void 0?void 0:r.normal)!==null&&o!==void 0?o:new THREE__namespace.Vector3().copy(s.ray.direction).multiplyScalar(-1),p=c.clone(),f=u.point.clone();this.intersectMesh.position.copy(f);var d=f.clone().add(p);if(this.intersectMesh.lookAt(d),Math.abs(c.y)>.99){var h=this.camera.position.clone().sub(f);this.intersectMesh.rotation.z=-Math.atan2(h.z,h.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 o={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(o,0).catch(noop)}else{var s=t.distanceFromModel(this.modelScene,this.cameraMotion.value.fov,this.camera.aspect),u=Math.max(this.locationMotion.value.distance-this.camera.near,0),l=e.center.delta/10*Math.max(u/5,.1);if(u<=s||l>0)if(this.locationMotion.value.distance-l>=minDistance){var c=this.locationMotion.value.distance-l;e.state.distance=c}else{var p=coordinatesToVector(this.cameraMotion.value);p.setLength(l),e.state.offset.add(p)}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(noop)}},t.prototype.onTapGesture=function(e){var r=this,o;this.userAction=e.userAction,this.stopMomentumMovement();var s=e.center.raycaster,u=this.getForwardObserverOrNot(s);if(!u)this.emit("gesture.tap",e);else{var l={longitude:this.camera.pose.longitude,latitude:0},c=__assign(__assign({},e.state),{mode:"Panorama",workCode:u.work.workCode,panoIndex:u.panoIndex,longitude:l.longitude,latitude:l.latitude,offset:u?u.position.clone():new THREE__namespace.Vector3,distance:0});if(e.state=c,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:c,userAction:e.userAction,options:l,progress:0,error:null})),u&&u.active)){var p=this.pendingTextureId=createUuid(),f={panoIndex:u.panoIndex,workCode:u.work.workCode},d=panoStringify(f),h={right:u.images.work.getURL(u.images.right),left:u.images.work.getURL(u.images.left),up:u.images.work.getURL(u.images.up),down:u.images.work.getURL(u.images.down),front:u.images.work.getURL(u.images.front),back:u.images.work.getURL(u.images.back)},m=this.imageOptions.transform,A=__assign({key:"pano.".concat(d)},pick(this.imageOptions,["format","size","quality","sharpen","forceUseExifOrientation","mappings"])),g="pano:"+jsonHash([h,A,m]),E=this.modelScene.parameter,v=void 0;E.pano0&&E.pano0.map.name===g?v=E.pano0:E.pano1&&E.pano1.map.name===g&&(v=E.pano1),v?(E.pano0&&E.pano0.map!==v.map&&E.pano0.map.dispose(),E.pano1&&E.pano1.map!==v.map&&E.pano1.map!==((o=E.pano0)===null||o===void 0?void 0:o.map)&&E.pano1.map.dispose(),E.set({pano0:v,pano1:v}),this.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:c,options:l,error:null}))):this.textureLoader.loadCubeTexture(h,{imageURL:{transform:m,options:A},format:THREE__namespace.RGBAFormat,viaAjax:!0,fetcher:getFetcher(u.work)},void 0,void 0,void 0,this.renderer).then(function(y){var b,T,_=y.body;if(r.destroyed||r.pendingTextureId!==p){_.dispose();return}r.pendingTextureId=null,_.name=g;var S=Array.isArray(_.image)?_.image[0]:_.image,w=(b=S==null?void 0:S.width)!==null&&b!==void 0?b:2048,R={panoId:d,map:_,mapSize:w,matrix:u.matrix.clone().premultiply(u.work.transform),zoom:1};E.pano0&&E.pano0.map.dispose(),E.pano1&&E.pano1.map!==((T=E.pano0)===null||T===void 0?void 0:T.map)&&E.pano1.map.dispose(),E.set({pano0:R,pano1:R}),r.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:c,options:l,error:null}))}).catch(function(y){r.destroyed||r.pendingTextureId!==p||(r.pendingTextureId=null)})}}},t.prototype.onDblTapGesture=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.state,o=e.center.raycaster,s=o.ray.origin.clone().add(o.ray.direction.clone().setLength(3)),u=1,l=3,c=u,p=this.modelScene.intersectRaycaster(o)[0];if(p&&(s=p.point.clone(),p.distance>(u+l)/2?c=u:c=l),e.state.distance=c,e.state.offset=s,this.emit("gesture.dbltap",e),!e.defaultPrevented){var f={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(f,360).catch(noop),this.hideIntersectMesh()}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible===!0&&(this.intersectMesh.visible=!1,this.needsRender=!0)},t})(BaseController);function isNil(n){return n==null}var _moveEvent={type:"move"},XRController=(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 THREE__namespace.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 THREE__namespace.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new THREE__namespace.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new THREE__namespace.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new THREE__namespace.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new THREE__namespace.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new THREE__namespace.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 o=null,s=null,u=null,l=this._targetRay,c=this._grip,p=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(l!==null&&(o=e.getPose(t.targetRaySpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(_moveEvent))),p&&t.hand){u=!0;for(var f=0,d=t.hand.values();f<d.length;f++){var h=d[f],m=e.getJointPose(h,r);if(p.joints[h.jointName]===void 0){var A=new THREE__namespace.Group;A.matrixAutoUpdate=!1,A.visible=!1,p.joints[h.jointName]=A,p.add(A)}var g=p.joints[h.jointName];m!==null&&(g.matrix.fromArray(m.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.jointRadius=m.radius),g.visible=m!==null}var E=p.joints["index-finger-tip"],v=p.joints["thumb-tip"],y=E.position.distanceTo(v.position),b=.02,T=.005;p.inputState.pinching&&y>b+T?(p.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!p.inputState.pinching&&y<=b-T&&(p.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else c!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,r),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));return l!==null&&(l.visible=o!==null),c!==null&&(c.visible=s!==null),p!==null&&(p.visible=u!==null),this},n})(),framebufferScaleFactor=1,isAppleVisionPro=function(){try{var n=/Macintosh/i.test(navigator.userAgent),t=navigator.maxTouchPoints===5;return n&&t}catch(e){return console.error("Error determining if the device is an Apple Vision Pro: ",e),!1}},isOculus=function(){try{return/Oculus/i.test(navigator.userAgent)}catch(n){return console.error("Error determining if the device is an Oculus: ",n),!1}},XRManager=(function(){function n(t,e,r){var o,s,u,l,c;this.isPanorama=(o=r==null?void 0:r.isPanorama)!==null&&o!==void 0?o:!0,navigator.userAgent.toLowerCase();var p;isAppleVisionPro()?p="VP":isOculus()?p="Oculus":p="Pico",this.machineType=(s=r==null?void 0:r.machineType)!==null&&s!==void 0?s:p,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(u=r==null?void 0:r.referenceSpaceType)!==null&&u!==void 0?u:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(l=r==null?void 0:r.onSessionStart)!==null&&l!==void 0?l:noop,this.onSessionEndCallback=(c=r==null?void 0:r.onSessionEnd)!==null&&c!==void 0?c:noop,this.controllers=[new XRController,new XRController],this.inputSourcesMap=new Map,this.cameraVR=new THREE__namespace.ArrayCamera,this.cameraL=new THREE__namespace.PerspectiveCamera,this.cameraR=new THREE__namespace.PerspectiveCamera,this.cameraVR.cameras.push(this.cameraL,this.cameraR),this.cameraL.viewport=new THREE__namespace.Vector4,this.cameraR.viewport=new THREE__namespace.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 THREE__namespace.Vector3,this.cameraRPos=new THREE__namespace.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 o=this.cameraLPos.distanceTo(this.cameraRPos),s=e.projectionMatrix.elements,u=r.projectionMatrix.elements,l=s[14]/(s[10]-1),c=s[14]/(s[10]+1),p=(s[9]+1)/s[5],f=(s[9]-1)/s[5],d=(s[8]-1)/s[0],h=(u[8]+1)/u[0],m=l*d,A=l*h,g=o/(-d+h),E=g*-d;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(E),t.translateZ(g),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var v=l+g,y=c+g,b=m-E,T=A+(o-E),_=p*c/y*v,S=f*c/y*v;t.projectionMatrix.makePerspective(b,T,_,S,v,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 o=0;o<r.length;o++)this.updateCamera(r[o],e);t.matrixWorld.copy(this.cameraVR.matrixWorld);for(var s=t.children,o=0,u=s.length;o<u;o++)s[o].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 o=t.removed[r],s=this.inputSourcesMap.get(o);s&&(s.dispatchEvent({type:"disconnected",data:o}),this.inputSourcesMap.delete(o))}for(var r=0;r<t.added.length;r++){var o=t.added[r],s=this.inputSourcesMap.get(o);s&&s.dispatchEvent({type:"connected",data:o})}},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,AnimationFrameLoop.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(o){e.onSessionEvent(o)}),this.session.addEventListener("selectstart",function(o){e.onSessionEvent(o)}),this.session.addEventListener("selectend",function(o){e.onSessionEvent(o)}),this.session.addEventListener("squeeze",function(o){e.onSessionEvent(o)}),this.session.addEventListener("squeezestart",function(o){e.onSessionEvent(o)}),this.session.addEventListener("squeezeend",function(o){e.onSessionEvent(o)}),this.session.addEventListener("end",function(o){e.onSessionEnd()});var r=this.gl.getContextAttributes();this.gl.makeXRCompatible().then(function(){var o={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};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,o)});break;case"Oculus":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,o)});break;default:e.machineType;break}e.session.requestReferenceSpace(e.referenceSpaceType).then(function(s){e.onRequestReferenceSpace(s)}),e.session.addEventListener("inputsourceschange",function(s){e.updateInputSources(s)})})}},n})(),LineSegmentsGeometry=(function(n){__extends(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],o=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],s=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(s),e.setAttribute("position",new THREE__namespace.Float32BufferAttribute(r,3)),e.setAttribute("uv",new THREE__namespace.Float32BufferAttribute(o,2)),e}return t.prototype.applyMatrix4=function(e){var r=this.attributes.instanceStart,o=this.attributes.instanceEnd;return r!==void 0&&(r.applyMatrix4(e),o.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 o=new THREE__namespace.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new THREE__namespace.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceEnd",new THREE__namespace.InterleavedBufferAttribute(o,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 o=new THREE__namespace.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new THREE__namespace.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceColorEnd",new THREE__namespace.InterleavedBufferAttribute(o,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 THREE__namespace.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof THREE__namespace.Geometry){var o=new THREE__namespace.BufferGeometry().fromGeometry(r);this.setPositions(o.attributes.position.array)}else r instanceof THREE__namespace.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new THREE__namespace.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var o=new THREE__namespace.Box3;this.boundingBox.setFromBufferAttribute(e),o.setFromBufferAttribute(r),this.boundingBox.union(o)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new THREE__namespace.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var o=this.boundingSphere.center;this.boundingBox.getCenter(o);for(var s=0,u=new THREE__namespace.Vector3,l=0,c=e.count;l<c;l++)u.fromBufferAttribute(e,l),s=Math.max(s,o.distanceToSquared(u)),u.fromBufferAttribute(r,l),s=Math.max(s,o.distanceToSquared(u));this.boundingSphere.radius=Math.sqrt(s),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})(THREE__namespace.InstancedBufferGeometry);Object.assign(LineSegmentsGeometry.prototype,{isLineSegmentsGeometry:!0});var lineShader={uniforms:THREE__namespace.UniformsUtils.merge([THREE__namespace.UniformsLib.common,THREE__namespace.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new THREE__namespace.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
|
|
1935
1935
|
#include <common>
|
|
1936
1936
|
#include <color_pars_vertex>
|
|
1937
1937
|
#include <fog_pars_vertex>
|
|
@@ -2130,7 +2130,7 @@ void main() {
|
|
|
2130
2130
|
#include <premultiplied_alpha_fragment>
|
|
2131
2131
|
|
|
2132
2132
|
}
|
|
2133
|
-
`},LineMaterial=(function(n){__extends(t,n);function t(e){var r=n.call(this,{uniforms:THREE__namespace.UniformsUtils.clone(lineShader.uniforms),vertexShader:lineShader.vertexShader,fragmentShader:lineShader.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(o){this.uniforms.diffuse.value=o}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(o){this.uniforms.linewidth.value=o}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(o){this.uniforms.dashScale.value=o}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(o){this.uniforms.dashSize.value=o}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(o){this.uniforms.gapSize.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}}}),r.setValues(e),r}return t})(THREE__namespace.ShaderMaterial);Object.assign(LineMaterial.prototype,{isLineMaterial:!0});var LineSegments2=(function(n){__extends(t,n);function t(e,r){var o=n.call(this)||this;return o.type="LineSegments2",o.geometry=e!==void 0?e:new LineSegmentsGeometry,o.material=r!==void 0?r:new LineMaterial({color:Math.random()*16777215}),o}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,o=e.attributes.instanceEnd,s=new Float32Array(2*r.count),u=new THREE__namespace.Vector3,l=new THREE__namespace.Vector3,c=0,p=0,f=r.count;c<f;c++,p+=2)u.fromBufferAttribute(r,c),l.fromBufferAttribute(o,c),s[p]=p===0?0:s[p-1],s[p+1]=s[p]+u.distanceTo(l);var d=new THREE__namespace.InstancedInterleavedBuffer(s,2,1);return e.setAttribute("instanceDistanceStart",new THREE__namespace.InterleavedBufferAttribute(d,1,0)),e.setAttribute("instanceDistanceEnd",new THREE__namespace.InterleavedBufferAttribute(d,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 o=e.ray,s=e.camera,u=s.projectionMatrix,l=this.geometry,c=this.material,p=c.resolution,f=c.linewidth,d=l.attributes.instanceStart,h=l.attributes.instanceEnd,m=new THREE__namespace.Vector4,A=new THREE__namespace.Vector4,g=new THREE__namespace.Vector4,E=new THREE__namespace.Vector3,v=new THREE__namespace.Matrix4,y=new THREE__namespace.Line3,b=new THREE__namespace.Vector3;o.at(1,g),g.w=1,g.applyMatrix4(s.matrixWorldInverse),g.applyMatrix4(u),g.multiplyScalar(1/g.w),g.x*=p.x/2,g.y*=p.y/2,g.z=0,E.copy(g);var T=this.matrixWorld;v.multiplyMatrices(s.matrixWorldInverse,T);for(var _=0,S=d.count;_<S;_++){m.fromBufferAttribute(d,_),A.fromBufferAttribute(h,_),m.w=1,A.w=1,m.applyMatrix4(v),A.applyMatrix4(v),m.applyMatrix4(u),A.applyMatrix4(u),m.multiplyScalar(1/m.w),A.multiplyScalar(1/A.w);var w=m.z<-1&&A.z<-1,R=m.z>1&&A.z>1;if(!(w||R)){m.x*=p.x/2,m.y*=p.y/2,A.x*=p.x/2,A.y*=p.y/2,y.start.copy(m),y.start.z=0,y.end.copy(A),y.end.z=0;var M=y.closestPointToPointParameter(E,!0);y.at(M,b);var B=THREE__namespace.MathUtils.lerp(m.z,A.z,M),C=B>=-1&&B<=1,I=E.distanceTo(b)<f*.5;if(C&&I){y.start.fromBufferAttribute(d,_),y.end.fromBufferAttribute(h,_),y.start.applyMatrix4(T),y.end.applyMatrix4(T);var L=new THREE__namespace.Vector3,O=new THREE__namespace.Vector3;o.distanceSqToSegment(y.start,y.end,O,L),r.push({point:O,pointOnLine:L,distance:o.origin.distanceTo(O),object:this,faceIndex:_})}}}},t})(THREE__namespace.Mesh);Object.assign(LineSegments2.prototype,{isLineSegments2:!0});var Line2=(function(n){__extends(t,n);function t(e,r){var o=n.call(this,e,r)||this;return o.type="Line2",o}return t})(LineSegments2);Object.assign(Line2.prototype,{isLine2:!0});var LineGeometry=(function(n){__extends(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,o=new Float32Array(2*r),s=0;s<r;s+=3)o[2*s]=e[s],o[2*s+1]=e[s+1],o[2*s+2]=e[s+2],o[2*s+3]=e[s+3],o[2*s+4]=e[s+4],o[2*s+5]=e[s+5];return n.prototype.setPositions.call(this,o),this},t.prototype.setColors=function(e){for(var r=e.length-3,o=new Float32Array(2*r),s=0;s<r;s+=3)o[2*s]=e[s],o[2*s+1]=e[s+1],o[2*s+2]=e[s+2],o[2*s+3]=e[s+3],o[2*s+4]=e[s+4],o[2*s+5]=e[s+5];return n.prototype.setColors.call(this,o),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof THREE__namespace.Geometry){var o=new THREE__namespace.BufferGeometry().fromGeometry(r);this.setPositions(o.attributes.position.array)}else r instanceof THREE__namespace.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t})(LineSegmentsGeometry);Object.assign(LineGeometry.prototype,{isLineGeometry:!0});var circleImageURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4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+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",DEFAULT_COLOR=14467195,POINT_SIZE=8,DEFAULT_LINEWIDTH=2,DEFAULT_DASHSCALE=20,sharedCircleTexture=null,FiveLine=(function(n){__extends(t,n);function t(e,r){e===void 0&&(e=new THREE__namespace.Vector3),r===void 0&&(r=new THREE__namespace.Vector3);var o=n.call(this)||this;o.type="FiveLine",o.needsRender=!0;var s=new LineGeometry,u=new LineMaterial({color:DEFAULT_COLOR,linewidth:DEFAULT_LINEWIDTH,dashScale:DEFAULT_DASHSCALE,dashed:!1});o.line=new Line2(s,u);var l=new THREE__namespace.BufferGeometry,c=new THREE__namespace.PointsMaterial({color:DEFAULT_COLOR,size:POINT_SIZE,map:sharedCircleTexture||(sharedCircleTexture=new THREE__namespace.TextureLoader().load(circleImageURL)),sizeAttenuation:!1,transparent:!0});return o.points=new THREE__namespace.Points(l,c),o.points.renderOrder=11,o.points.frustumCulled=!1,o.setPoints(e,r),o.add(o.line,o.points),o}return Object.defineProperty(t,"version",{get:function(){return"6.7.0-alpha.10"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var o=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new THREE__namespace.BufferAttribute(new Float32Array(o),3)),this.line.geometry.setPositions(o),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new THREE__namespace.Vector3(e[0],e[1],e[2]),new THREE__namespace.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var o in e)if(e.hasOwnProperty(o)){var s=e[o];o==="dashed"?(r.dashed=s,s?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[o]=e[o]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var o=this.line.material.resolution;(o.x!==e||o.y!==r)&&(o.set(e,r),this.needsRender=!0)},t})(THREE__namespace.Object3D);Object.assign(FiveLine.prototype,{isFiveLine:!0});var Constants={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 fetchJsonFile(n){return __awaiter(this,void 0,void 0,function(){var t;return __generator(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 fetchProfilesList(n){return __awaiter(this,void 0,void 0,function(){var t,e;return __generator(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,fetchJsonFile("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function fetchProfile(n,t){return __awaiter(this,arguments,void 0,function(e,r,o,s){var u,l,c,p,f,d;return o===void 0&&(o=null),s===void 0&&(s=!0),__generator(this,function(h){switch(h.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,fetchProfilesList(r)];case 1:if(u=h.sent(),e.profiles.some(function(m){var A=u[m];return A&&(l={profileId:m,profilePath:"".concat(r,"/").concat(A.path),deprecated:!!A.deprecated}),!!l}),!l){if(!o)throw new Error("No matching profile name found");if(c=u[o],!c)throw new Error('No matching profile name found and default profile "'.concat(o,'" missing.'));l={profileId:o,profilePath:"".concat(r,"/").concat(c.path),deprecated:!!c.deprecated}}return[4,fetchJsonFile(l.profilePath)];case 2:if(p=h.sent(),s){if(d=void 0,d=p.layouts[e.handedness],!d)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(l.profileId));d.assetPath&&(f=l.profilePath.replace("profile.json",d.assetPath))}return[2,{profile:p,assetPath:f}]}})})}var defaultComponentValues={xAxis:0,yAxis:0,button:0,state:Constants.ComponentState.DEFAULT};function normalizeAxes(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,o=Math.sqrt(n*n+t*t);if(o>1){var s=Math.atan2(t,n);e=Math.cos(s),r=Math.sin(s)}var u={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return u}var VisualResponse=(function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Constants.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(defaultComponentValues)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,o=t.button,s=t.state,u=normalizeAxes(e,r),l=u.normalizedXAxis,c=u.normalizedYAxis;switch(this.componentProperty){case Constants.ComponentProperty.X_AXIS:this.value=this.states.includes(s)?l:.5;break;case Constants.ComponentProperty.Y_AXIS:this.value=this.states.includes(s)?c:.5;break;case Constants.ComponentProperty.BUTTON:this.value=this.states.includes(s)?o:0;break;case Constants.ComponentProperty.STATE:this.valueNodeProperty===Constants.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(s):this.value=this.states.includes(s)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n})(),Component=(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(o){var s=new VisualResponse(e.visualResponses[o]);r.visualResponses[o]=s}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Constants.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=__assign({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Constants.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=Constants.ComponentState.PRESSED:(r.touched||this.values.button>Constants.ButtonTouchThreshold)&&(this.values.state=Constants.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===Constants.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.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===Constants.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(o){o.updateFromComponent(e.values)})},n})(),MotionController=(function(){function n(t,e,r){var o=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(s){var u=o.layoutDescription.components[s];o.components[s]=new Component(s,u)}),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})(),DEFAULT_PROFILES_PATH="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",DEFAULT_PROFILE="generic-trigger",XRControllerModel=(function(n){__extends(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(o){o instanceof THREE__namespace.Mesh&&o.isMesh&&(o.material.envMap=r.envMap,o.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(o){var s=o.valueNode,u=o.minNode,l=o.maxNode,c=o.value,p=o.valueNodeProperty;s&&(p===Constants.VisualResponseProperty.VISIBILITY?s.visible=c:p===Constants.VisualResponseProperty.TRANSFORM&&(s.quaternion.copy(u.quaternion).slerp(l.quaternion,c),s.position.lerpVectors(u.position,l.position,c)))})}))},t})(THREE.Object3D);function findNodes(n,t){Object.values(n.components).forEach(function(e){var r=e.type,o=e.touchPointNodeName,s=e.visualResponses;if(r===Constants.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(o),e.touchPointNode){var u=new THREE.SphereGeometry(.001),l=new THREE.MeshBasicMaterial({color:255}),c=new THREE.Mesh(u,l);e.touchPointNode.add(c)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(s).forEach(function(p){var f=p.valueNodeName,d=p.minNodeName,h=p.maxNodeName,m=p.valueNodeProperty;if(m===Constants.VisualResponseProperty.TRANSFORM){if(p.minNode=t.getObjectByName(d),p.maxNode=t.getObjectByName(h),!p.minNode){console.warn("Could not find ".concat(d," in the model"));return}if(!p.maxNode){console.warn("Could not find ".concat(h," in the model"));return}}p.valueNode=t.getObjectByName(f),p.valueNode||console.warn("Could not find ".concat(f," in the model"))})})}function addAssetSceneToControllerModel(n,t){findNodes(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof THREE__namespace.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var XRControllerModelFactory=(function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=DEFAULT_PROFILES_PATH,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new XRControllerModel,o=null;return t.addEventListener("connected",function(s){var u=s.data;u.targetRayMode!=="tracked-pointer"||!u.gamepad||fetchProfile(u,e.path,DEFAULT_PROFILE).then(function(l){var c=l.profile,p=l.assetPath;r.motionController=new MotionController(u,c,p);var f=e._assetCache[r.motionController.assetUrl];if(f)o=f.scene.clone(),addAssetSceneToControllerModel(r,o);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(d){e._assetCache[r.motionController.assetUrl]=d,o=d.scene.clone(),addAssetSceneToControllerModel(r,o)})}}).catch(function(l){console.warn(l)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(o),o=null}),r},n})(),defaultXRPanoramaControllerInitArgs=__assign({},omit(defaultPanoramaControllerCustomInitArgs,["maxLatitude","minLatitude"]));function mapPanoResource(n,t){return n}var CONTROLLER_EVNET_DELTA_TIME=300,scratchRaycaster=new THREE__namespace.Raycaster,scratchVector3=new THREE__namespace.Vector3,XRPanoramaController=(function(n){__extends(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new XRManager(r.renderer,r.renderer.getContext(),{onSessionStart:function(c){r.emit("xr.session.start",createEvent("xr.session.start",{session:c,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",createEvent("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new THREE__namespace.Raycaster,right:new THREE__namespace.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.left.firstHitOnly=!0,r.xrControllerRay.left.floorIndex=-1,r.xrControllerRay.right.params.Points={threshold:.1},r.xrControllerRay.right.firstHitOnly=!0,r.xrControllerRay.right.floorIndex=-1,r.gazeRay=null,r.pointerLines={left:new FiveLine,right:new FiveLine},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new THREE__namespace.Group,new THREE__namespace.Group];var o=r.xrManager.getController(0);r.controllerWrappers[0].add(o);var s=r.xrManager.getController(1);r.controllerWrappers[1].add(s);var u=new XRControllerModelFactory;u.gltfLoader={load:function(c,p){internalFetcher.ajax(c,{responseType:"arraybuffer"}).then(function(f){var d;return parseGltf(f.body,{resourcePath:c.slice(0,c.lastIndexOf("/")+1),search:(d=c.split("?")[1])!==null&&d!==void 0?d:"",fetcher:internalFetcher})}).then(function(f){return p(f)})}},(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=createUuid()]={panoId:panoStringify(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new THREE__namespace.Matrix4},r.parallaxCameraMatrixs=[];var l=AnimationFrameLoop.shared.getContext();return l?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(l),r.on("xr.session.start",function(){var c=r.xrManager.getControllerGrip(0);c.add(u.createControllerModel(c)),r.controllerWrappers[0].add(c);var p=r.xrManager.getControllerGrip(1);p.add(u.createControllerModel(p)),r.controllerWrappers[1].add(p)}),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=__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),o=n.initAnimationEndState.call(this,r);return __assign(__assign({},o),{mode:"XRPanorama"})},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2}))},t.prototype.moveToPano=function(e,r,o){var s=this,u,l,c=(u=r.effect)!==null&&u!==void 0?u:"fade";this.userAction=o,this.stopMomentumMovement();var p=panoStringify(e),f=this.works.getObserver(e);if(!f)throw new Error("Invalid PanoIndex");getImageSizeFromURL(f.images.up),this.imageOptions.size;var d=this.imageOptions.transform,h=function(w,R){return mapPanoResource(applyImageURLOptions(w,d,R))},m=__assign({key:"pano.".concat(p)},pick(this.imageOptions,["format","size","quality"])),A={right:f.images.work.getURL(f.images.right),left:f.images.work.getURL(f.images.left),up:f.images.work.getURL(f.images.up),down:f.images.work.getURL(f.images.down),front:f.images.work.getURL(f.images.front),back:f.images.work.getURL(f.images.back)},g="pano:"+jsonHash([A,m,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===g)return;var E=this.pendingTextureTask.panoId;(l=this.panoMeshes.get(E))===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",createEvent("pano.texture.abort",{error:null,progress:0,meta:null,pano:e}))}var v=this.modelScene.parameter.resolveValue(),y=v.pano0,b=v.pano1,T;if((y==null?void 0:y.map.name)===g?T=y:(b==null?void 0:b.map.name)===g&&(T=b),T){var _={panoId:p,effect:c,leftPanoPicture:{panoId:T.panoId,map:T.map,mapSize:T.mapSize,matrix:f.matrix.clone().premultiply(f.work.transform),zoom:1},position:f.position.clone().applyMatrix4(f.work.transform),fixCameraTransform:new THREE__namespace.Matrix4};this.doMoveToPano(e,_,r);return}var S="move-to-pano-"+p;this.pending.add(S),this.pendingTextureTask={panoId:p,hash:g,onLoad:function(w){var R,M=w.body;if(s.destroyed)M.dispose();else{M.name=g;var B=Array.isArray(M.image)?M.image[0]:M.image,C=(R=B==null?void 0:B.width)!==null&&R!==void 0?R:2048,I={panoId:p,effect:c,leftPanoPicture:{panoId:p,map:M,mapSize:C,matrix:f.matrix.clone(),zoom:1},position:f.position.clone(),fixCameraTransform:new THREE__namespace.Matrix4};s.doMoveToPano(e,I,r)}},onError:function(w){var R=__assign(__assign(__assign({},e),{mode:s.mode}),clonePose(s.camera.pose));s.emit("pano.error",createEvent("pano.error",{error:w,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:R})),s.emit("pano.cancel",createEvent("pano.cancel",{error:null,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:R})),r.moveCancelCallback&&r.moveCancelCallback()}},this.textureLoader.loadCubeTexture(A,{imageURL:{transform:h,options:m},format:THREE__namespace.RGBAFormat,fetcher:getFetcher(f.work)},void 0,void 0,function(w){var R,M;((R=s.pendingTextureTask)===null||R===void 0?void 0:R.hash)===g&&((M=s.panoMeshes.get(p))===null||M===void 0||M.setProgress(w)),s.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:w,meta:null,pano:e}))},this.renderer).then(function(w){var R,M;s.pending.delete(S),((R=s.pendingTextureTask)===null||R===void 0?void 0:R.hash)===g?(s.pendingTextureTask.onLoad(w),s.pendingTextureTask=void 0,(M=s.panoMeshes.get(p))===null||M===void 0||M.setProgress(0)):w.body.dispose(),s.emit("pano.texture.success",createEvent("pano.texture.success",{error:null,progress:1,meta:w.meta,pano:e}))}).catch(function(w){var R,M;s.pending.delete(S),((R=s.pendingTextureTask)===null||R===void 0?void 0:R.hash)===g&&(s.pendingTextureTask.onError(w),s.pendingTextureTask=void 0,(M=s.panoMeshes.get(p))===null||M===void 0||M.setProgress(0)),s.emit("pano.texture.error",createEvent("pano.texture.error",{error:w,progress:0,meta:null,pano:e})),s.emit("error",w)}),this.emit("pano.texture.load",createEvent("pano.texture.load",{error:null,progress:0,meta:null,pano:e}))},t.prototype.doMoveToPano=function(e,r,o){var s=this,u,l,c,p,f,d,h,m,A,g;o===void 0&&(o={});var E=now(),v=createUuid();this.panoResources[v]=r;var y=1,b,T,_;if(this.locationMotion.ended){var S=this.locationMotion.getKeyFrameSegment(E);S[0];var w=S[1],R=this.locationMotion.value,M=this.panoResourceFromLocationMotionKeyframe(w).position,B=r.position;b=Math.max(M.distanceTo(B),y),T=[{key:w.key,progress:0,value:__assign(__assign({},R),{count:0})},{key:v,progress:1,value:{distance:0,count:1}}],_=0}else{var C=this.locationMotion.getKeyFrameSegment(E),I=C[0],w=C[1],R=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(I).position,M=this.panoResourceFromLocationMotionKeyframe(w).position,B=r.position,O=w.value.count-R.count,F=Math.max(L.distanceTo(M),y)*O,N=Math.max(M.distanceTo(B),y);b=F+N,T=[{key:I.key,progress:0,value:__assign({},R)},{key:w.key,progress:F/b,value:w.value},{key:v,progress:1,value:{count:w.value.count+1,distance:0}}];var D=this.locationMotionKeyframesLength(this.locationMotion.keyframes),q=this.locationMotionKeyframesLength(T);_=this.locationMotion.getProgressVelocity(E)*D/q}var z=r.effect==="instant"?0:this.calculateMovingDuration(o.duration,r.effect==="fly"?b:0),j={longitude:o.longitude,latitude:o.latitude,fov:o.fov},J=__assign(__assign({},e),{mode:this.mode,longitude:(u=j.longitude)!==null&&u!==void 0?u:this.camera.pose.longitude,latitude:(l=j.latitude)!==null&&l!==void 0?l:this.camera.pose.latitude,fov:(c=j.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:r.position.clone(),distance:0}),V=this.currentPano;if(this.emit("pano.moveTo",createEvent("pano.moveTo",{options:o,prevPano:V,progress:0,state:J,userAction:this.userAction,error:null})),o.moveStartCallback&&o.moveStartCallback(J),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=noop,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(j,z).catch(noop);else{var U=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),G=coordinatesToVector({longitude:(p=j.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(f=j.latitude)!==null&&f!==void 0?f:this.cameraMotion.value.latitude}),Z=new THREE__namespace.Object3D;Z.lookAt(U);var W=new THREE__namespace.Matrix4().makeRotationFromQuaternion(Z.quaternion);Z.lookAt(G);var ee=new THREE__namespace.Matrix4().makeRotationFromQuaternion(Z.quaternion),X=new THREE__namespace.Matrix4().getInverse(W).premultiply(ee),K=this.cameraMotion.value.fov,$=(d=j.fov)!==null&&d!==void 0?d:this.cameraMotion.value.fov,re=1;r.effect==="zoomin"?re=1.5:r.effect==="zoomout"&&(re=.4);for(var ne=$*re,ae=0;ae<T.length-1;ae++){var le=T[ae].key;if(le){var se=this.panoResources[le];se&&(se.fixCameraTransform.copy(X),se.leftPanoPicture&&(se.leftPanoPicture.zoom=Math.tan(ne/2/180*Math.PI)/Math.tan(K/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:(h=j.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(m=j.latitude)!==null&&m!==void 0?m:this.cameraMotion.value.latitude,fov:ne}},{progress:1,value:{longitude:(A=j.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(g=j.latitude)!==null&&g!==void 0?g:this.cameraMotion.value.latitude,fov:$}}],z).catch(noop)}var ce=this.locationMotion.setKeyframes(T,z,_);ce.then(function(){for(var me=0,Ae=s.modelScene.children;me<Ae.length;me++){var be=Ae[me];be instanceof Model&&be.show()}var de=__assign(__assign({},e),{mode:s.mode,longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:0});s.emit("pano.arrived",createEvent("pano.arrived",{options:o,prevPano:V,progress:1,state:de,userAction:s.userAction,error:null})),o.moveEndCallback&&o.moveEndCallback(de);var he=s.works.getObserver(s.currentPano);if(he&&he.video&&s.videoTexture&&s.videoTexture.image instanceof HTMLVideoElement){var fe={map:s.videoTexture,size:he.video.size.clone(),matrix:he.video.matrix.clone(),panoMatrix:he.matrix.clone().premultiply(he.work.transform),alpha:1},te=createUuid(),ue=s.videoTexture.image;ue.setAttribute("uuid",te),canplayVideo().then(function(Te){Te&&he.video&&ue.getAttribute("uuid")===te&&(ue.oncanplay=function(){ue.oncanplay=noop,ue.play()},ue.ontimeupdate=function(){ue.currentTime>.5&&(ue.ontimeupdate=noop,s.panoVideo.setMaterial(fe))},ue.src=he.video.source)}).catch((function(){ue.removeAttribute("uuid")}))}},function(){s.emit("pano.cancel",createEvent("pano.cancel",{options:o,prevPano:V,progress:0,state:J,userAction:s.userAction,error:null})),o.moveCancelCallback&&o.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,o;this.stopMomentumMovement(),this.camera.getDirection(new THREE__namespace.Vector3).setY(0);var s=null,u=this.works.getObserver(this.currentPano);if(!u)return null;var l=u.work.observers,c=u.accessibleNodes.filter(function(_){if(_===r.currentPano.panoIndex&&u.work.workCode===r.currentPano.workCode)return!1;var S=l[_];if(!S)return!1;var w=scratchVector3.copy(S.position).applyMatrix4(S.work.transform);return w.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:S.loadable||S.active}),p=this.modelScene.intersectRaycaster(e)[0];if(p){var f=arrayMin(c,function(_){var S=l[_];if(!S)return 1/0;var w=scratchVector3.copy(S.standingPosition).applyMatrix4(S.work.transform);return w.distanceTo(p.point)},!0),d=f[0],h=f[1];typeof d=="number"&&h<this.panoTapTriggerRadius&&(s=(o=l[d])!==null&&o!==void 0?o:null)}if(isNil(s)){var m=this.getForwardObserverOrNot(this.xrManager.cameraVR,e);m&&(s=m)}for(var A=0,g=this.locationMotion.keyframes;A<g.length;A++){var E=g[A],v=this.panoResourceFromLocationMotionKeyframe(E);if(!(E.progress<this.locationMotion.progress)&&s){var y=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode});if(v.panoId===y){s=null;break}}}if(isNil(s))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(!s.active){var y=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode}),b=this.panoMeshes.get(y);b&&(b.setDisabled(!1),b.setLoading(!0))}var T={workCode:s.work.workCode,panoIndex:s.panoIndex,mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:0,offset:s?s.position.clone():new THREE__namespace.Vector3};return this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:T,userAction:!0,options:{},progress:0,error:null})),s&&s.active?(this.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:T,options:{},error:null})),{workCode:s.work.workCode,panoIndex:s.panoIndex}):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,o){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,o){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var o=this,s,u,l,c,p,f,d,h,m,A=[],g=2;g<arguments.length;g++)A[g-2]=arguments[g];this.userAction=!0;var E={},v={},y=this.locationMotion.keyframes[0],b=this.locationMotion.keyframes[this.locationMotion.keyframes.length-1],T=this.locationMotion.getKeyFrameSegment(e),_=T[0],S=T[1],w=this.panoResourceFromLocationMotionKeyframe(_),R=this.panoResourceFromLocationMotionKeyframe(S),M=this.panoResourceFromLocationMotionKeyframe(y),B=this.panoResourceFromLocationMotionKeyframe(b),C=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),v.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),E.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var I=this.locationMotion.getKeyFrameSegment(e);I[0];var L=I[1],O=new THREE__namespace.Vector3().copy(w.position),F=new THREE__namespace.Vector3().copy(R.position),N=this.locationMotion.value.count-L.value.count+1;if(E.progress=N,R.leftPanoPicture&&(N<1?w.leftPanoPicture&&(E.pano0=w.leftPanoPicture):E.pano0=R.leftPanoPicture,E.pano1=R.leftPanoPicture),R.effect==="montage"?E.transition="BLACK":R.effect==="spread"?E.transition="SPREAD":E.transition="FADE",(R.effect==="zoomin"||R.effect==="zoomout")&&(E.progress=Math.pow(N,3)),N<1&&R.effect!=="fly"){if(E.pano0&&w.leftPanoPicture){var D={panoId:E.pano0.panoId,map:E.pano0.map,mapSize:E.pano0.mapSize,zoom:E.pano0.zoom,matrix:w.leftPanoPicture.matrix.clone().setPosition(R.position)},q=this.panoPictureObserverMap.get(E.pano0);q&&this.panoPictureObserverMap.set(D,q),E.pano0=D}O.copy(F),C=!0}v.distance=this.locationMotion.value.distance,v.offset=new THREE__namespace.Vector3(O.x+(F.x-O.x)*N,O.y+(F.y-O.y)*N,O.z+(F.z-O.z)*N);for(var z=[],j=[],J=0,V=this.locationMotion.keyframes;J<V.length;J++){var U=V[J],G=U.key,Z=U.progress;G!==void 0&&(z.push(G),Z>this.locationMotion.progress&&j.push(G))}for(var W=0,ee=Object.keys(this.panoResources);W<ee.length;W++){var X=ee[W];if(!(j.indexOf(X)>=0)){var K=this.panoResources[X];if(K.leftPanoPicture){var $=K.leftPanoPicture.map;if($){if($===((s=E.pano0)===null||s===void 0?void 0:s.map)||$===((u=E.pano1)===null||u===void 0?void 0:u.map))continue;$.dispose(),K.leftPanoPicture=null}}z.indexOf(X)>=0||delete this.panoResources[X]}}var re=panoParse(R.panoId);re!==this.currentPano&&(this.currentPano=re,this.accessibleObserverFloorCheckCount=0),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(M.panoId),state:__assign(__assign(__assign(__assign({},panoParse(B.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),v),options:{},progress:this.locationMotion.progress,error:null}))}this.camera.setFromPose(v),this.xrManager.cameraVR.projectionMatrix.copy(this.camera.projectionMatrix),this.xrManager.cameraVR.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.xrManager.cameraVR.matrix.copy(this.camera.matrix),this.xrManager.cameraVR.position.copy(this.camera.position),this.xrManager.cameraVR.quaternion.copy(this.camera.quaternion),this.xrManager.cameraVR.scale.copy(this.camera.scale),this.xrManager.cameraVR.matrixAutoUpdate=!1,this.xrManager.cameraVR.matrixWorld.copy(this.camera.matrixWorld);var ne=A,ae=ne[1],le=new THREE__namespace.Vector3(0,0,0),se=new THREE__namespace.Vector2().copy(this.camera.resolution);if(ae&&this.xrManager.session&&this.xrManager.referenceSpace&&this.xrManager.session.renderState.baseLayer){var ce=this.xrManager.cameraVR,me=this.xrManager.referenceSpace,Ae=this.xrManager.session.renderState.baseLayer,be=ae.getViewerPose(me),de=(l=be==null?void 0:be.views)!==null&&l!==void 0?l:[];this.renderer.setFramebuffer(Ae.framebuffer);for(var he=0;he<de.length;he++){var fe=de[he],te=ce.cameras[he],ue=Ae.getViewport(fe);ue&&(te.projectionMatrix.fromArray(fe.projectionMatrix),te.projectionMatrixInverse.getInverse(te.projectionMatrix),te.matrix.fromArray(fe.transform.matrix),te.matrix.setPosition(this.camera.position),te.matrix.decompose(te.position,te.quaternion,te.scale),te.matrixWorld.copy(te.matrix),te.matrixWorldInverse.getInverse(te.matrixWorld),te.matrixAutoUpdate=!1,le.copy(te.position),te.viewport.set(ue.x,ue.y,ue.width,ue.height),se.set(ue.width,ue.height))}if(this.xrManager.setProjectionFromUnion(this.xrManager.cameraVR,this.xrManager.cameraL,this.xrManager.cameraR),this.camera.quaternion.copy(this.xrManager.cameraVR.quaternion),this.camera.scale.copy(this.xrManager.cameraVR.scale),this.camera.matrix.compose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.computePose((c=v.distance)!==null&&c!==void 0?c:this.camera.pose.distance),this.xrManager.session&&this.xrManager.session.inputSources){for(var he=0;he<this.xrManager.session.inputSources.length;he++)if(this.xrManager.session.inputSources[he]&&this.xrManager.session.inputSources[he].targetRayMode==="transient-pointer"){var Te=ae.getPose(this.xrManager.session.inputSources[he].targetRaySpace,me);if(Te){var xe=Te.transform.orientation,Xe=new THREE__namespace.Quaternion(xe.x,xe.y,xe.z,xe.w),Je=new THREE__namespace.Vector3(0,0,-1).applyQuaternion(Xe),ze=new THREE__namespace.Raycaster(this.camera.position,Je);this.gazeRay=ze}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var ve=this.xrManager.session.inputSources,Ge=function(pe){var Re=ye.xrManager.controllers[pe],we=ve[pe];if(!we)return"continue";Re&&Re.update(we,ae,me);var Le=ye.xrManager.getController(pe),Bt=new THREE__namespace.Vector3(0,1.2,0),ut=Le.position.clone().add(le).sub(Bt);we.handedness==="left"?ye.xrControllerRay.left.set(ut,new THREE__namespace.Vector3(0,0,-1).applyEuler(Le.rotation)):we.handedness==="right"&&ye.xrControllerRay.right.set(ut,new THREE__namespace.Vector3(0,0,-1).applyEuler(Le.rotation)),ye.controllerWrappers[pe].position.copy(new THREE__namespace.Vector3(0,0,0).add(le).sub(Bt));var rt=ye.modelScene.intersectRaycaster(ye.xrControllerRay.right);if(rt.length===0){var Ft=ye.works.getResolvedObserver(ye.currentPano);rt=ye.xrControllerRay.right.intersectObject(ye.boundingMesh,!0).map(function($e){var Fe,lt=(Fe=Ft==null?void 0:Ft.floorIndex)!==null&&Fe!==void 0?Fe:0;return __assign({floorIndex:lt,floor:lt},$e)})}if(rt.length>=1&&rt[0].face)if(we.handedness==="right"){var P=ye.xrControllerRay.right.intersectObject(ye.xrCustomObjectsScene,!0),H=rt[0].face.normal,k=H.clone(),Q=rt[0].point.clone();ye.intersectMesh.position.copy(Q);var Y=Q.clone().add(k);if(ye.intersectMesh.lookAt(Y),Math.abs(H.y)>.99){var oe=ye.camera.position.clone().sub(Q);ye.intersectMesh.rotation.z=-Math.atan2(oe.z,oe.x)}ye.intersectMesh.visible=!0,ye.needsRender=!0,P.length>0?(ye.pointerLines.right.setPoints(ut,P[0].point),ye.pointerLines.right.points.visible=!0,ye.intersectMesh.visible=!1):(ye.pointerLines.right.points.visible=!1,ye.pointerLines.right.setPoints(ut,rt[0].point));var Ee=rt[0],ke=createEvent("intersect.update",{raycaster:(p=ye.xrControllerRay.right)!==null&&p!==void 0?p:null,intersection:Ee!=null?Ee:null,object:ye.intersectMesh});if(ye.emit("intersect.update",ke),ke.defaultPrevented)return ye.hideIntersectMesh(),{value:void 0}}else ye.pointerLines.left.setPoints(ut,rt[0].point)},ye=this,he=0;he<ve.length;he++){var Ne=Ge(he);if(typeof Ne=="object")return Ne.value}this.updateControllerHelper(ve,e,r)}}else ae||console.error("xrFrame丢失,请重试"),this.xrManager.session||console.error("session丢失,请重试"),this.xrManager.session&&!this.xrManager.session.renderState.baseLayer&&console.error("no layer found");isEmptyObject(E)===!1&&this.modelScene.parameter.set(E),this.emit("camera.update",createEvent("camera.update",{userAction:this.userAction,state:__assign(__assign(__assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose))}));var Be=this.works.getResolvedObserver(this.currentPano),Ye=this.locationMotion.ended?this.getForwardObserverOrNot(this.xrManager.cameraVR):null,nt=this.works.getObserver(w.panoId),De=this.works.getObserver(R.panoId);if(this.adjustPanoCircleMeshPositionBasedOnModel&&this.helper.visible&&Be){for(var qe=[],He=Be.work.observers,ge=0,Se=Be.accessibleNodes;ge<Se.length;ge++){var Me=Se[ge],q=He[Me];q&&qe.push(q)}var je=new Map;if(qe.sort(function(pe,Re){var we=je.get(pe);typeof we=="undefined"&&(we=pe.standingPosition.distanceTo(Be.standingPosition),je.set(pe,we));var Le=je.get(pe);return typeof Le=="undefined"&&(Le=Re.standingPosition.distanceTo(Be.standingPosition),je.set(Re,Le)),we-Le}),qe.length){this.accessibleObserverFloorCheckCount=this.accessibleObserverFloorCheckCount%qe.length;var Ue=qe[this.accessibleObserverFloorCheckCount],tt=this.modelScene.models.find(function(pe){return pe.work===(Ue==null?void 0:Ue.work)});if(Ue&&tt&&tt.visible){var dt=.3,Ve=.05,Ct=.005,Ie=Ue.standingPosition.clone().applyMatrix4(Ue.work.transform),Oe=panoStringify({panoIndex:Ue.panoIndex,workCode:Ue.work.workCode}),gt=adjustPanoCircleMeshVectors.map(function(pe){scratchRaycaster.ray.origin.copy(Ie),scratchRaycaster.ray.origin.add(scratchVector3.copy(pe).setY(dt)),scratchRaycaster.ray.direction.set(0,-1,0),scratchRaycaster.firstHitOnly=!0,scratchRaycaster.floorIndex=-1;var Re=tt.intersectRaycaster(scratchRaycaster)[0];return Re&&Re.distance-Ct<=dt?new THREE__namespace.Vector3().copy(Ie).setY(Re.point.y+Ct):Ie});gt.sort(function(pe,Re){return Re.y-pe.y});var Mt=gt[Math.floor(gt.length/2)],At=gt.filter(function(pe){return pe.distanceTo(Mt)<=Ve})[0];if(At){var ht=new THREE__namespace.Vector4(Ie.x,Ie.y,Ie.z,At.y-Ie.y),_t=this.adjustPanoCircleMeshPositionFix.get(Oe);_t&&!ht.equals(_t)&&(this.needsRender=!0),this.adjustPanoCircleMeshPositionFix.set(Oe,ht)}}this.accessibleObserverFloorCheckCount++}}var Ke=new Map;if(nt)for(var Ze=0,at=nt.accessibleNodes;Ze<at.length;Ze++){var Me=at[Ze],q=nt.work.observers[Me];if(q){var Oe=panoStringify({panoIndex:q.panoIndex,workCode:q.work.workCode});Ke.set(Oe,q)}}if(De)for(var Qe=0,ie=De.accessibleNodes;Qe<ie.length;Qe++){var Me=ie[Qe],q=De.work.observers[Me];if(q){var Oe=panoStringify({panoIndex:q.panoIndex,workCode:q.work.workCode});Ke.set(Oe,q)}}if(this.panoMeshes.forEach(function(pe,Re){var we=Ke.get(Re);if(we){pe.position.copy(we.standingPosition).applyMatrix4(we.work.transform);var Le=o.adjustPanoCircleMeshPositionFix.get(Re);Le&&(scratchVector3.set(Le.x,Le.y,Le.z),scratchVector3.equals(pe.position)&&(pe.position.y+=Le.w)),pe.scale.setScalar(1.2),Ke.delete(Re)}else o.helper.remove(pe),pe.dispose(),o.panoMeshes.delete(Re)}),Ke.forEach(function(pe,Re){var we=o.panoCircleMeshCreator(panoParse(Re));we.position.copy(pe.standingPosition).applyMatrix4(pe.work.transform);var Le=o.adjustPanoCircleMeshPositionFix.get(Re);Le&&(scratchVector3.set(Le.x,Le.y,Le.z),scratchVector3.equals(we.position)&&(we.position.y+=Le.w)),we.scale.setScalar(1.2),o.panoMeshes.set(Re,we),o.helper.add(we),Ke.delete(Re)}),this.camera.pose.distance>.1||C)this.panoMeshes.forEach(function(pe){pe.setOpacity(0),pe.setCurrent(!1),pe.updateTime&&pe.updateTime(e,r),pe.visible=!1});else if(Be){var _e=Be.work.observers,Pe=arrayMin(Be.accessibleNodes,function(pe){var Re=_e[pe];return Re?Be.standingPosition.distanceTo(Re.standingPosition):1/0},!0),Ce=Pe[1];Ce=clamp$1(Ce,2.5,1/0);var yt=Be.visibleNodes.concat(Be.panoIndex).map(function(pe){return panoStringify({panoIndex:pe,workCode:Be.work.workCode})}),ct=this.camera.getDirection(new THREE__namespace.Vector3);this.panoMeshes.forEach(function(pe,Re){var we=o.works.getObserver(Re);if(yt.indexOf(Re)===-1)pe.setCurrent(!1),pe.setOpacity(0);else if(!we)pe.setCurrent(!1),pe.setOpacity(0);else if(!we.loadable&&!we.active)pe.setCurrent(!1),pe.setOpacity(0);else{var Le=pe.position.clone().setY(o.camera.position.y).distanceTo(o.camera.position);pe.setCurrent(!pe.loading&&pe.progress===0&&Ye!==null&&panoStringify({panoIndex:Ye.panoIndex,workCode:Ye.work.workCode})===Re),pe.setOpacity(Le<.01?0:clamp$1(Ce/Le*1.2,.65,.98));var Bt=o.camera.position.clone().setY(pe.position.y),ut=new THREE__namespace.Vector3().copy(pe.position).sub(Bt).normalize();if(Re===panoStringify(o.currentPano)){var rt=clamp$1((.5-Bt.distanceTo(pe.position))/.5,0,1);ut.multiplyScalar(1-rt).add(ct.clone().multiplyScalar(rt))}ut.length()>0&&pe.quaternion.setFromEuler(new THREE__namespace.Euler(0,Math.atan2(ut.x,ut.z),0))}pe.updateTime&&pe.updateTime(e,r)})}{var N=(f=this.modelScene.parameter.progress)!==null&&f!==void 0?f:1,Et=Math.round(N),it=this.modelScene.parameter.pano0,pt=this.modelScene.parameter.pano1,bt=Et===0?it:pt,q=void 0;if(bt&&(q=this.works.getObserver(bt.panoId),q||(q=this.panoPictureObserverMap.get(bt))),this.tiling.appearDuration=this.tileAppearDuration,this.tiling.maxRequest=N<.6?0:this.tileMaxRequest,this.tiling.imageOptions=this.imageOptions,!q||!bt||this.tileLevelForFov===!1||this.camera.perspToOrtho.x>0){this.tiling.setObserver(null);var It={renderer:this.renderer,resolution:se,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:null,panoMatrix:new THREE__namespace.Matrix4,panoZoom:1,minLevel:0,level:0};this.tiling.update(It),this.modelScene.parameter.set("refinedScreen",null)}else{var ot=getImageSizeLevel(bt.mapSize),Pt=ot+1,Tt=4;this.tiling.setObserver(q);var It={renderer:this.renderer,resolution:se,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:bt.map,panoMatrix:bt.matrix,panoZoom:bt.zoom,minLevel:Pt,level:Tt},vt=this.tiling.update(It),xt={map:this.tiling.renderTarget.texture,matrixInverse:this.tiling.camera.matrixWorldInverse,projectionMatrix:this.tiling.camera.projectionMatrix,pano:Et,opacity:(it==null?void 0:it.panoId)===(pt==null?void 0:pt.panoId)?1:easeInQuart(Math.abs(((d=this.modelScene.parameter.progress)!==null&&d!==void 0?d:0)-.5)*2)},We=this.modelScene.parameter.refinedScreen;(vt||xt.pano!==(We==null?void 0:We.pano)||xt.opacity!==(We==null?void 0:We.opacity))&&this.modelScene.parameter.set("refinedScreen",xt)}}if(this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),this.intersectMesh&&this.intersectMesh.parent&&Be&&Be.position.y-Be.standingPosition.y>10){var mt=this.camera.position.distanceTo(this.intersectMesh.position),Ot=2*Math.tan(.5*this.camera.fov/180*Math.PI),Lt=mt*Ot/5;this.intersectMesh.scale.setScalar(Lt)}else this.intersectMesh.scale.setScalar(1);{var Ht=R.effect,st=this.modelScene.parameter,it=st.pano0,pt=st.pano1;if(it&&pt&&it!==pt&&Ht==="fly"&&this.flyEffectUseDepthBuffer){if(((h=this.modelScene.parameter.pano0Depth)===null||h===void 0?void 0:h.panoId)!==it.panoId||((m=this.modelScene.parameter.pano1Depth)===null||m===void 0?void 0:m.panoId)!==pt.panoId){var St=500,ft=512;this.pano0DepthCubeRenderTarget?this.pano0DepthCubeRenderTarget.width!==ft&&this.pano0DepthCubeRenderTarget.setSize(ft,ft):this.pano0DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(ft,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1}),this.pano1DepthCubeRenderTarget?this.pano1DepthCubeRenderTarget.width!==ft&&this.pano1DepthCubeRenderTarget.setSize(ft,ft):this.pano1DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(ft,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1});var Rt=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano0DepthCubeRenderTarget);Rt.matrix.copy(it.matrix),Rt.matrixWorld.copy(Rt.matrix),Rt.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,Rt,St);var wt=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano1DepthCubeRenderTarget);wt.matrix.copy(pt.matrix),wt.matrixWorld.copy(wt.matrix),wt.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,wt,St),this.modelScene.parameter.set({pano0Depth:{panoId:it.panoId,map:this.pano0DepthCubeRenderTarget.texture,mapSize:this.pano0DepthCubeRenderTarget.width,maxDepth:St},pano1Depth:{panoId:pt.panoId,map:this.pano1DepthCubeRenderTarget.texture,mapSize:this.pano1DepthCubeRenderTarget.width,maxDepth:St}})}}else this.modelScene.parameter.set({pano0Depth:null,pano1Depth:null}),this.flyEffectUseDepthBuffer||(this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0))}},t.prototype.render=function(){this.renderer.setScissorTest(!1);var e=this.xrManager.cameraVR;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,o){var s=this.xrControllerRay.left,u=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var l={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},c=0;c<e.length;c++){var p=e[c].handedness,f=e[c].gamepad;switch(p){case"left":f.axes&&(this.emitHandleEvent(f.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(f.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(f.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(f.axes[3]===1,"LeftAxesDown",r)),f!=null&&f.buttons&&(f.buttons[4]&&this.emitHandleEvent(f.buttons[4].pressed,"X",r),f.buttons[5]&&this.emitHandleEvent(f.buttons[5].pressed,"Y",r),f.buttons[0]&&this.emitHandleEvent(f.buttons[0].pressed,"LeftTrigger",r),f.buttons[1]&&this.emitHandleEvent(f.buttons[1].pressed,"LeftPinch",r));var d={raycaster:s,axes:{up:f.axes&&f.axes[3]<0?Math.abs(f.axes[3]):0,down:f.axes&&f.axes[3]<0?0:Math.abs(f.axes[3]),left:f.axes&&f.axes[2]<0?Math.abs(f.axes[2]):0,right:f.axes&&f.axes[2]<0?0:Math.abs(f.axes[2])},deltaTime:o};l.buttons.X=f.buttons&&f.buttons[4]?f.buttons[4].pressed:!1,l.buttons.Y=f.buttons&&f.buttons[5]?f==null?void 0:f.buttons[5].pressed:!1,l.buttons.LeftTrigger=f.buttons&&f.buttons[0]?f==null?void 0:f.buttons[0].pressed:!1,l.buttons.LeftPinch=f.buttons&&f.buttons[1]?f==null?void 0:f.buttons[1].pressed:!1,l.left=d;break;case"right":f.axes&&(this.emitHandleEvent(f.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(f.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(f.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(f.axes[3]===1,"RightAxesDown",r)),f.buttons&&(f.buttons[4]&&this.emitHandleEvent(f.buttons[4].pressed,"A",r),f.buttons[5]&&this.emitHandleEvent(f.buttons[5].pressed,"B",r),f.buttons[0]&&this.emitHandleEvent(f.buttons[0].pressed,"RightTrigger",r),f.buttons[1]&&this.emitHandleEvent(f.buttons[1].pressed,"RightPinch",r));var h={raycaster:u,axes:{up:f.axes&&f.axes[3]<0?Math.abs(f.axes[3]):0,down:f.axes&&f.axes[3]<0?0:Math.abs(f.axes[3]),left:f.axes&&f.axes[2]<0?Math.abs(f.axes[2]):0,right:f.axes&&f.axes[2]<0?0:Math.abs(f.axes[2])},deltaTime:o};l.right=h,l.buttons.A=f.buttons&&f.buttons[4]?f==null?void 0:f.buttons[4].pressed:!1,l.buttons.B=f.buttons&&f.buttons[5]?f==null?void 0:f.buttons[5].pressed:!1,l.buttons.RightTrigger=f.buttons&&f.buttons[0]?f==null?void 0:f.buttons[0].pressed:!1,l.buttons.RightPinch=f.buttons&&f.buttons[1]?f==null?void 0:f.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",createEvent("xr.controller.update",l))}},t.prototype.emitHandleEvent=function(e,r,o){var s=this.xrControllerRay.left,u=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=o,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",createEvent("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:s,rightRay:u}}}));else{var l=o-this.xrHandleState[r].touchStartTime;l>CONTROLLER_EVNET_DELTA_TIME&&this.emit("xr.gesture.press",createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:s,rightRay:u}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",createEvent("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:s,rightRay:u}}}));var l=o-this.xrHandleState[r].touchStartTime;if(l<=CONTROLLER_EVNET_DELTA_TIME){var c=createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:s,rightRay:u}}}),p=this.emit("xr.gesture.tap",c);!p&&!c.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})(PanoramaController),Controllers={Floorplan:FloorplanController,Topview:TopviewController,Panorama:PanoramaController,VRPanorama:VRPanoramaController,Model:ModelController,Mapview:MapviewController,XRPanorama:XRPanoramaController},controllersDefaultInitArgs={Floorplan:defaultFloorplanControllerCustomInitArgs,Topview:defaultTopviewControllerCustomInitArgs,Panorama:defaultPanoramaControllerCustomInitArgs,VRPanorama:defaultVRPanoramaControllerCustomInitArgs,Model:defaultModelControllerCustomInitArgs,Mapview:defaultMapviewControllerCustomInitArgs,XRPanorama:defaultXRPanoramaControllerInitArgs},PROXY_CONTROLLER_EVENT_NAMES=["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 initLegacyEvent(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=coordinatesToVector(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 generateDefaultVideoElement(){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 initLights(){var n=new THREE__namespace.Group;n.name="internalLights";{var t=new THREE__namespace.DirectionalLight(16777215,.1);t.name="direction0",t.position.copy(new THREE__namespace.Vector3(0,1,0)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.1);t.name="direction1",t.position.copy(new THREE__namespace.Vector3(-1,-1,-1)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.3);t.name="direction2",t.position.copy(new THREE__namespace.Vector3(1,1,1)),n.add(t)}{var t=new THREE__namespace.AmbientLight(16777215,.6);t.name="ambient0",n.add(t)}return n}function parseKeyValue(n){for(var t,e,r={},o=n.split(/(\;|\,)/),s=0,u=o;s<u.length;s++){var l=u[s],c=l.split("="),p=(t=c[0])===null||t===void 0?void 0:t.trim(),f=(e=c[1])===null||e===void 0?void 0:e.trim();p&&f&&(r[p]=f)}return r}function getViewportScale(){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 o=parseKeyValue((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),s=Number(o["initial-scale"]);if(!isNaN(s))return s}}return 1}const textureURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocPDjtUWQ6Tq1M2w7gC2EcrMGtWS6xlpGKEDDcb1vUQ25zT4lrC2s0dU4gFPppKkbeIYr7NMpqjStuFg5rNU9epGyt8PXyfX4DE1bKLhR/1XPxwJhp5DAV67T9ZPwFdovhBMIGUYoRBN4wim6S3eoXVEHXdLgmwY0x6BQnO4xPJ0Ar5OVxhQF0L9UslRM4yaQQfQImnBegi8vhY2A1k6YLlrj61TwDdNQnIISwiPvpD7TwYQTssZXK47vg8y9Gp2nxRcATkozOEmdCeObSt3IIo+xf/00ID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eIVJtOwgdgO/dOICHGK6jQHaIwdXN4Lwt0LWHr4d6kX8tV+ozqAs+uYCSmO2w+jd4zGNeUYL4nqZxeN5WKVgooSAClmEaYhqhdit89QC7niSbCEM2sdkBuHYxQg9ri5ZjkuhI6DMP+J7cTvEtokEx0aPscyddoFJKpSZqV7G1GTxcpmEthpnw5058c6GfwqpwzGOtGjXSJI3FLYhc+O+jSr9aGhPWQlRshS8AticLX7wnsgbXxt6gsWCpRBa0vRGQM8oB9dhmP3QAwFX4c079dJNq6Qi5xbuyTmpPSJ1Ur4UtF7GoTtmUL3zxaWqMU8P/k3cXSQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var imageSize=[351,63],imageOffset=[20,20],vertices=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),uvs=new Float32Array([0,0,1,0,0,1,1,1]),index=new Uint8Array([0,1,2,1,3,2]),geometry$4=new THREE__namespace.BufferGeometry;geometry$4.setAttribute("position",new THREE__namespace.BufferAttribute(vertices,3)),geometry$4.setAttribute("uv",new THREE__namespace.BufferAttribute(uvs,2)),geometry$4.setIndex(new THREE__namespace.BufferAttribute(index,1));var material=new THREE__namespace.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),mesh$4=new THREE__namespace.Mesh(geometry$4,material);mesh$4.matrixAutoUpdate=!1;var scene$2=new THREE__namespace.Scene;scene$2.add(mesh$4),scene$2.matrixAutoUpdate=!1;var camera$2=new THREE__namespace.OrthographicCamera(-.5,.5,.5,-.5,.1,1);camera$2.position.set(0,0,.5),camera$2.lookAt(0,0,0),camera$2.updateMatrixWorld(!0),camera$2.matrixAutoUpdate=!1;var prevViewport=new THREE__namespace.Vector4,prevScissor=new THREE__namespace.Vector4;function renderPoweredByRealsee(n){if(material.map){var r=n.getViewport(prevViewport),o=n.getScissor(prevScissor),s=n.getScissorTest(),u=n.autoClear,l=o.x+imageOffset[0]/3,c=o.y+imageOffset[1]/3,p=imageSize[0]/3,f=imageSize[1]/3;n.setViewport(l,c,p,f),n.setScissor(l,c,p,f),n.setScissorTest(!0),n.autoClear=!1,n.render(scene$2,camera$2),n.setViewport(r),n.setScissor(o),n.setScissorTest(s),n.autoClear=u}else{var t=new THREE__namespace.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=THREE__namespace.ClampToEdgeWrapping,t.wrapT=THREE__namespace.ClampToEdgeWrapping,t.minFilter=THREE__namespace.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,material.needsUpdate=!0,e.onload=noop},e.src=textureURL,material.map=t}}var FRAGMENT$2=`
|
|
2133
|
+
`},LineMaterial=(function(n){__extends(t,n);function t(e){var r=n.call(this,{uniforms:THREE__namespace.UniformsUtils.clone(lineShader.uniforms),vertexShader:lineShader.vertexShader,fragmentShader:lineShader.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(o){this.uniforms.diffuse.value=o}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(o){this.uniforms.linewidth.value=o}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(o){this.uniforms.dashScale.value=o}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(o){this.uniforms.dashSize.value=o}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(o){this.uniforms.gapSize.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}}}),r.setValues(e),r}return t})(THREE__namespace.ShaderMaterial);Object.assign(LineMaterial.prototype,{isLineMaterial:!0});var LineSegments2=(function(n){__extends(t,n);function t(e,r){var o=n.call(this)||this;return o.type="LineSegments2",o.geometry=e!==void 0?e:new LineSegmentsGeometry,o.material=r!==void 0?r:new LineMaterial({color:Math.random()*16777215}),o}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,o=e.attributes.instanceEnd,s=new Float32Array(2*r.count),u=new THREE__namespace.Vector3,l=new THREE__namespace.Vector3,c=0,p=0,f=r.count;c<f;c++,p+=2)u.fromBufferAttribute(r,c),l.fromBufferAttribute(o,c),s[p]=p===0?0:s[p-1],s[p+1]=s[p]+u.distanceTo(l);var d=new THREE__namespace.InstancedInterleavedBuffer(s,2,1);return e.setAttribute("instanceDistanceStart",new THREE__namespace.InterleavedBufferAttribute(d,1,0)),e.setAttribute("instanceDistanceEnd",new THREE__namespace.InterleavedBufferAttribute(d,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 o=e.ray,s=e.camera,u=s.projectionMatrix,l=this.geometry,c=this.material,p=c.resolution,f=c.linewidth,d=l.attributes.instanceStart,h=l.attributes.instanceEnd,m=new THREE__namespace.Vector4,A=new THREE__namespace.Vector4,g=new THREE__namespace.Vector4,E=new THREE__namespace.Vector3,v=new THREE__namespace.Matrix4,y=new THREE__namespace.Line3,b=new THREE__namespace.Vector3;o.at(1,g),g.w=1,g.applyMatrix4(s.matrixWorldInverse),g.applyMatrix4(u),g.multiplyScalar(1/g.w),g.x*=p.x/2,g.y*=p.y/2,g.z=0,E.copy(g);var T=this.matrixWorld;v.multiplyMatrices(s.matrixWorldInverse,T);for(var _=0,S=d.count;_<S;_++){m.fromBufferAttribute(d,_),A.fromBufferAttribute(h,_),m.w=1,A.w=1,m.applyMatrix4(v),A.applyMatrix4(v),m.applyMatrix4(u),A.applyMatrix4(u),m.multiplyScalar(1/m.w),A.multiplyScalar(1/A.w);var w=m.z<-1&&A.z<-1,R=m.z>1&&A.z>1;if(!(w||R)){m.x*=p.x/2,m.y*=p.y/2,A.x*=p.x/2,A.y*=p.y/2,y.start.copy(m),y.start.z=0,y.end.copy(A),y.end.z=0;var M=y.closestPointToPointParameter(E,!0);y.at(M,b);var B=THREE__namespace.MathUtils.lerp(m.z,A.z,M),C=B>=-1&&B<=1,I=E.distanceTo(b)<f*.5;if(C&&I){y.start.fromBufferAttribute(d,_),y.end.fromBufferAttribute(h,_),y.start.applyMatrix4(T),y.end.applyMatrix4(T);var L=new THREE__namespace.Vector3,O=new THREE__namespace.Vector3;o.distanceSqToSegment(y.start,y.end,O,L),r.push({point:O,pointOnLine:L,distance:o.origin.distanceTo(O),object:this,faceIndex:_})}}}},t})(THREE__namespace.Mesh);Object.assign(LineSegments2.prototype,{isLineSegments2:!0});var Line2=(function(n){__extends(t,n);function t(e,r){var o=n.call(this,e,r)||this;return o.type="Line2",o}return t})(LineSegments2);Object.assign(Line2.prototype,{isLine2:!0});var LineGeometry=(function(n){__extends(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,o=new Float32Array(2*r),s=0;s<r;s+=3)o[2*s]=e[s],o[2*s+1]=e[s+1],o[2*s+2]=e[s+2],o[2*s+3]=e[s+3],o[2*s+4]=e[s+4],o[2*s+5]=e[s+5];return n.prototype.setPositions.call(this,o),this},t.prototype.setColors=function(e){for(var r=e.length-3,o=new Float32Array(2*r),s=0;s<r;s+=3)o[2*s]=e[s],o[2*s+1]=e[s+1],o[2*s+2]=e[s+2],o[2*s+3]=e[s+3],o[2*s+4]=e[s+4],o[2*s+5]=e[s+5];return n.prototype.setColors.call(this,o),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof THREE__namespace.Geometry){var o=new THREE__namespace.BufferGeometry().fromGeometry(r);this.setPositions(o.attributes.position.array)}else r instanceof THREE__namespace.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t})(LineSegmentsGeometry);Object.assign(LineGeometry.prototype,{isLineGeometry:!0});var circleImageURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUO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ChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",DEFAULT_COLOR=14467195,POINT_SIZE=8,DEFAULT_LINEWIDTH=2,DEFAULT_DASHSCALE=20,sharedCircleTexture=null,FiveLine=(function(n){__extends(t,n);function t(e,r){e===void 0&&(e=new THREE__namespace.Vector3),r===void 0&&(r=new THREE__namespace.Vector3);var o=n.call(this)||this;o.type="FiveLine",o.needsRender=!0;var s=new LineGeometry,u=new LineMaterial({color:DEFAULT_COLOR,linewidth:DEFAULT_LINEWIDTH,dashScale:DEFAULT_DASHSCALE,dashed:!1});o.line=new Line2(s,u);var l=new THREE__namespace.BufferGeometry,c=new THREE__namespace.PointsMaterial({color:DEFAULT_COLOR,size:POINT_SIZE,map:sharedCircleTexture||(sharedCircleTexture=new THREE__namespace.TextureLoader().load(circleImageURL)),sizeAttenuation:!1,transparent:!0});return o.points=new THREE__namespace.Points(l,c),o.points.renderOrder=11,o.points.frustumCulled=!1,o.setPoints(e,r),o.add(o.line,o.points),o}return Object.defineProperty(t,"version",{get:function(){return"6.7.0-alpha.11"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var o=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new THREE__namespace.BufferAttribute(new Float32Array(o),3)),this.line.geometry.setPositions(o),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new THREE__namespace.Vector3(e[0],e[1],e[2]),new THREE__namespace.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var o in e)if(e.hasOwnProperty(o)){var s=e[o];o==="dashed"?(r.dashed=s,s?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[o]=e[o]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var o=this.line.material.resolution;(o.x!==e||o.y!==r)&&(o.set(e,r),this.needsRender=!0)},t})(THREE__namespace.Object3D);Object.assign(FiveLine.prototype,{isFiveLine:!0});var Constants={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 fetchJsonFile(n){return __awaiter(this,void 0,void 0,function(){var t;return __generator(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 fetchProfilesList(n){return __awaiter(this,void 0,void 0,function(){var t,e;return __generator(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,fetchJsonFile("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function fetchProfile(n,t){return __awaiter(this,arguments,void 0,function(e,r,o,s){var u,l,c,p,f,d;return o===void 0&&(o=null),s===void 0&&(s=!0),__generator(this,function(h){switch(h.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,fetchProfilesList(r)];case 1:if(u=h.sent(),e.profiles.some(function(m){var A=u[m];return A&&(l={profileId:m,profilePath:"".concat(r,"/").concat(A.path),deprecated:!!A.deprecated}),!!l}),!l){if(!o)throw new Error("No matching profile name found");if(c=u[o],!c)throw new Error('No matching profile name found and default profile "'.concat(o,'" missing.'));l={profileId:o,profilePath:"".concat(r,"/").concat(c.path),deprecated:!!c.deprecated}}return[4,fetchJsonFile(l.profilePath)];case 2:if(p=h.sent(),s){if(d=void 0,d=p.layouts[e.handedness],!d)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(l.profileId));d.assetPath&&(f=l.profilePath.replace("profile.json",d.assetPath))}return[2,{profile:p,assetPath:f}]}})})}var defaultComponentValues={xAxis:0,yAxis:0,button:0,state:Constants.ComponentState.DEFAULT};function normalizeAxes(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,o=Math.sqrt(n*n+t*t);if(o>1){var s=Math.atan2(t,n);e=Math.cos(s),r=Math.sin(s)}var u={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return u}var VisualResponse=(function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Constants.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(defaultComponentValues)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,o=t.button,s=t.state,u=normalizeAxes(e,r),l=u.normalizedXAxis,c=u.normalizedYAxis;switch(this.componentProperty){case Constants.ComponentProperty.X_AXIS:this.value=this.states.includes(s)?l:.5;break;case Constants.ComponentProperty.Y_AXIS:this.value=this.states.includes(s)?c:.5;break;case Constants.ComponentProperty.BUTTON:this.value=this.states.includes(s)?o:0;break;case Constants.ComponentProperty.STATE:this.valueNodeProperty===Constants.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(s):this.value=this.states.includes(s)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n})(),Component=(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(o){var s=new VisualResponse(e.visualResponses[o]);r.visualResponses[o]=s}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Constants.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=__assign({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Constants.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=Constants.ComponentState.PRESSED:(r.touched||this.values.button>Constants.ButtonTouchThreshold)&&(this.values.state=Constants.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===Constants.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.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===Constants.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(o){o.updateFromComponent(e.values)})},n})(),MotionController=(function(){function n(t,e,r){var o=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(s){var u=o.layoutDescription.components[s];o.components[s]=new Component(s,u)}),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})(),DEFAULT_PROFILES_PATH="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",DEFAULT_PROFILE="generic-trigger",XRControllerModel=(function(n){__extends(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(o){o instanceof THREE__namespace.Mesh&&o.isMesh&&(o.material.envMap=r.envMap,o.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(o){var s=o.valueNode,u=o.minNode,l=o.maxNode,c=o.value,p=o.valueNodeProperty;s&&(p===Constants.VisualResponseProperty.VISIBILITY?s.visible=c:p===Constants.VisualResponseProperty.TRANSFORM&&(s.quaternion.copy(u.quaternion).slerp(l.quaternion,c),s.position.lerpVectors(u.position,l.position,c)))})}))},t})(THREE.Object3D);function findNodes(n,t){Object.values(n.components).forEach(function(e){var r=e.type,o=e.touchPointNodeName,s=e.visualResponses;if(r===Constants.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(o),e.touchPointNode){var u=new THREE.SphereGeometry(.001),l=new THREE.MeshBasicMaterial({color:255}),c=new THREE.Mesh(u,l);e.touchPointNode.add(c)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(s).forEach(function(p){var f=p.valueNodeName,d=p.minNodeName,h=p.maxNodeName,m=p.valueNodeProperty;if(m===Constants.VisualResponseProperty.TRANSFORM){if(p.minNode=t.getObjectByName(d),p.maxNode=t.getObjectByName(h),!p.minNode){console.warn("Could not find ".concat(d," in the model"));return}if(!p.maxNode){console.warn("Could not find ".concat(h," in the model"));return}}p.valueNode=t.getObjectByName(f),p.valueNode||console.warn("Could not find ".concat(f," in the model"))})})}function addAssetSceneToControllerModel(n,t){findNodes(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof THREE__namespace.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var XRControllerModelFactory=(function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=DEFAULT_PROFILES_PATH,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new XRControllerModel,o=null;return t.addEventListener("connected",function(s){var u=s.data;u.targetRayMode!=="tracked-pointer"||!u.gamepad||fetchProfile(u,e.path,DEFAULT_PROFILE).then(function(l){var c=l.profile,p=l.assetPath;r.motionController=new MotionController(u,c,p);var f=e._assetCache[r.motionController.assetUrl];if(f)o=f.scene.clone(),addAssetSceneToControllerModel(r,o);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(d){e._assetCache[r.motionController.assetUrl]=d,o=d.scene.clone(),addAssetSceneToControllerModel(r,o)})}}).catch(function(l){console.warn(l)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(o),o=null}),r},n})(),defaultXRPanoramaControllerInitArgs=__assign({},omit(defaultPanoramaControllerCustomInitArgs,["maxLatitude","minLatitude"]));function mapPanoResource(n,t){return n}var CONTROLLER_EVNET_DELTA_TIME=300,scratchRaycaster=new THREE__namespace.Raycaster,scratchVector3=new THREE__namespace.Vector3,XRPanoramaController=(function(n){__extends(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new XRManager(r.renderer,r.renderer.getContext(),{onSessionStart:function(c){r.emit("xr.session.start",createEvent("xr.session.start",{session:c,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",createEvent("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new THREE__namespace.Raycaster,right:new THREE__namespace.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.left.firstHitOnly=!0,r.xrControllerRay.left.floorIndex=-1,r.xrControllerRay.right.params.Points={threshold:.1},r.xrControllerRay.right.firstHitOnly=!0,r.xrControllerRay.right.floorIndex=-1,r.gazeRay=null,r.pointerLines={left:new FiveLine,right:new FiveLine},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new THREE__namespace.Group,new THREE__namespace.Group];var o=r.xrManager.getController(0);r.controllerWrappers[0].add(o);var s=r.xrManager.getController(1);r.controllerWrappers[1].add(s);var u=new XRControllerModelFactory;u.gltfLoader={load:function(c,p){internalFetcher.ajax(c,{responseType:"arraybuffer"}).then(function(f){var d;return parseGltf(f.body,{resourcePath:c.slice(0,c.lastIndexOf("/")+1),search:(d=c.split("?")[1])!==null&&d!==void 0?d:"",fetcher:internalFetcher})}).then(function(f){return p(f)})}},(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=createUuid()]={panoId:panoStringify(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new THREE__namespace.Matrix4},r.parallaxCameraMatrixs=[];var l=AnimationFrameLoop.shared.getContext();return l?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(l),r.on("xr.session.start",function(){var c=r.xrManager.getControllerGrip(0);c.add(u.createControllerModel(c)),r.controllerWrappers[0].add(c);var p=r.xrManager.getControllerGrip(1);p.add(u.createControllerModel(p)),r.controllerWrappers[1].add(p)}),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=__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),o=n.initAnimationEndState.call(this,r);return __assign(__assign({},o),{mode:"XRPanorama"})},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2}))},t.prototype.moveToPano=function(e,r,o){var s=this,u,l,c=(u=r.effect)!==null&&u!==void 0?u:"fade";this.userAction=o,this.stopMomentumMovement();var p=panoStringify(e),f=this.works.getObserver(e);if(!f)throw new Error("Invalid PanoIndex");getImageSizeFromURL(f.images.up),this.imageOptions.size;var d=this.imageOptions.transform,h=function(w,R){return mapPanoResource(applyImageURLOptions(w,d,R))},m=__assign({key:"pano.".concat(p)},pick(this.imageOptions,["format","size","quality"])),A={right:f.images.work.getURL(f.images.right),left:f.images.work.getURL(f.images.left),up:f.images.work.getURL(f.images.up),down:f.images.work.getURL(f.images.down),front:f.images.work.getURL(f.images.front),back:f.images.work.getURL(f.images.back)},g="pano:"+jsonHash([A,m,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===g)return;var E=this.pendingTextureTask.panoId;(l=this.panoMeshes.get(E))===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",createEvent("pano.texture.abort",{error:null,progress:0,meta:null,pano:e}))}var v=this.modelScene.parameter.resolveValue(),y=v.pano0,b=v.pano1,T;if((y==null?void 0:y.map.name)===g?T=y:(b==null?void 0:b.map.name)===g&&(T=b),T){var _={panoId:p,effect:c,leftPanoPicture:{panoId:T.panoId,map:T.map,mapSize:T.mapSize,matrix:f.matrix.clone().premultiply(f.work.transform),zoom:1},position:f.position.clone().applyMatrix4(f.work.transform),fixCameraTransform:new THREE__namespace.Matrix4};this.doMoveToPano(e,_,r);return}var S="move-to-pano-"+p;this.pending.add(S),this.pendingTextureTask={panoId:p,hash:g,onLoad:function(w){var R,M=w.body;if(s.destroyed)M.dispose();else{M.name=g;var B=Array.isArray(M.image)?M.image[0]:M.image,C=(R=B==null?void 0:B.width)!==null&&R!==void 0?R:2048,I={panoId:p,effect:c,leftPanoPicture:{panoId:p,map:M,mapSize:C,matrix:f.matrix.clone(),zoom:1},position:f.position.clone(),fixCameraTransform:new THREE__namespace.Matrix4};s.doMoveToPano(e,I,r)}},onError:function(w){var R=__assign(__assign(__assign({},e),{mode:s.mode}),clonePose(s.camera.pose));s.emit("pano.error",createEvent("pano.error",{error:w,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:R})),s.emit("pano.cancel",createEvent("pano.cancel",{error:null,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:R})),r.moveCancelCallback&&r.moveCancelCallback()}},this.textureLoader.loadCubeTexture(A,{imageURL:{transform:h,options:m},format:THREE__namespace.RGBAFormat,fetcher:getFetcher(f.work)},void 0,void 0,function(w){var R,M;((R=s.pendingTextureTask)===null||R===void 0?void 0:R.hash)===g&&((M=s.panoMeshes.get(p))===null||M===void 0||M.setProgress(w)),s.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:w,meta:null,pano:e}))},this.renderer).then(function(w){var R,M;s.pending.delete(S),((R=s.pendingTextureTask)===null||R===void 0?void 0:R.hash)===g?(s.pendingTextureTask.onLoad(w),s.pendingTextureTask=void 0,(M=s.panoMeshes.get(p))===null||M===void 0||M.setProgress(0)):w.body.dispose(),s.emit("pano.texture.success",createEvent("pano.texture.success",{error:null,progress:1,meta:w.meta,pano:e}))}).catch(function(w){var R,M;s.pending.delete(S),((R=s.pendingTextureTask)===null||R===void 0?void 0:R.hash)===g&&(s.pendingTextureTask.onError(w),s.pendingTextureTask=void 0,(M=s.panoMeshes.get(p))===null||M===void 0||M.setProgress(0)),s.emit("pano.texture.error",createEvent("pano.texture.error",{error:w,progress:0,meta:null,pano:e})),s.emit("error",w)}),this.emit("pano.texture.load",createEvent("pano.texture.load",{error:null,progress:0,meta:null,pano:e}))},t.prototype.doMoveToPano=function(e,r,o){var s=this,u,l,c,p,f,d,h,m,A,g;o===void 0&&(o={});var E=now(),v=createUuid();this.panoResources[v]=r;var y=1,b,T,_;if(this.locationMotion.ended){var S=this.locationMotion.getKeyFrameSegment(E);S[0];var w=S[1],R=this.locationMotion.value,M=this.panoResourceFromLocationMotionKeyframe(w).position,B=r.position;b=Math.max(M.distanceTo(B),y),T=[{key:w.key,progress:0,value:__assign(__assign({},R),{count:0})},{key:v,progress:1,value:{distance:0,count:1}}],_=0}else{var C=this.locationMotion.getKeyFrameSegment(E),I=C[0],w=C[1],R=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(I).position,M=this.panoResourceFromLocationMotionKeyframe(w).position,B=r.position,O=w.value.count-R.count,F=Math.max(L.distanceTo(M),y)*O,N=Math.max(M.distanceTo(B),y);b=F+N,T=[{key:I.key,progress:0,value:__assign({},R)},{key:w.key,progress:F/b,value:w.value},{key:v,progress:1,value:{count:w.value.count+1,distance:0}}];var D=this.locationMotionKeyframesLength(this.locationMotion.keyframes),q=this.locationMotionKeyframesLength(T);_=this.locationMotion.getProgressVelocity(E)*D/q}var z=r.effect==="instant"?0:this.calculateMovingDuration(o.duration,r.effect==="fly"?b:0),j={longitude:o.longitude,latitude:o.latitude,fov:o.fov},J=__assign(__assign({},e),{mode:this.mode,longitude:(u=j.longitude)!==null&&u!==void 0?u:this.camera.pose.longitude,latitude:(l=j.latitude)!==null&&l!==void 0?l:this.camera.pose.latitude,fov:(c=j.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:r.position.clone(),distance:0}),V=this.currentPano;if(this.emit("pano.moveTo",createEvent("pano.moveTo",{options:o,prevPano:V,progress:0,state:J,userAction:this.userAction,error:null})),o.moveStartCallback&&o.moveStartCallback(J),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=noop,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(j,z).catch(noop);else{var U=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),G=coordinatesToVector({longitude:(p=j.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(f=j.latitude)!==null&&f!==void 0?f:this.cameraMotion.value.latitude}),Z=new THREE__namespace.Object3D;Z.lookAt(U);var W=new THREE__namespace.Matrix4().makeRotationFromQuaternion(Z.quaternion);Z.lookAt(G);var ee=new THREE__namespace.Matrix4().makeRotationFromQuaternion(Z.quaternion),X=new THREE__namespace.Matrix4().getInverse(W).premultiply(ee),K=this.cameraMotion.value.fov,$=(d=j.fov)!==null&&d!==void 0?d:this.cameraMotion.value.fov,re=1;r.effect==="zoomin"?re=1.5:r.effect==="zoomout"&&(re=.4);for(var ne=$*re,ae=0;ae<T.length-1;ae++){var le=T[ae].key;if(le){var se=this.panoResources[le];se&&(se.fixCameraTransform.copy(X),se.leftPanoPicture&&(se.leftPanoPicture.zoom=Math.tan(ne/2/180*Math.PI)/Math.tan(K/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:(h=j.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(m=j.latitude)!==null&&m!==void 0?m:this.cameraMotion.value.latitude,fov:ne}},{progress:1,value:{longitude:(A=j.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(g=j.latitude)!==null&&g!==void 0?g:this.cameraMotion.value.latitude,fov:$}}],z).catch(noop)}var ce=this.locationMotion.setKeyframes(T,z,_);ce.then(function(){for(var me=0,Ae=s.modelScene.children;me<Ae.length;me++){var be=Ae[me];be instanceof Model&&be.show()}var de=__assign(__assign({},e),{mode:s.mode,longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:0});s.emit("pano.arrived",createEvent("pano.arrived",{options:o,prevPano:V,progress:1,state:de,userAction:s.userAction,error:null})),o.moveEndCallback&&o.moveEndCallback(de);var he=s.works.getObserver(s.currentPano);if(he&&he.video&&s.videoTexture&&s.videoTexture.image instanceof HTMLVideoElement){var fe={map:s.videoTexture,size:he.video.size.clone(),matrix:he.video.matrix.clone(),panoMatrix:he.matrix.clone().premultiply(he.work.transform),alpha:1},te=createUuid(),ue=s.videoTexture.image;ue.setAttribute("uuid",te),canplayVideo().then(function(Te){Te&&he.video&&ue.getAttribute("uuid")===te&&(ue.oncanplay=function(){ue.oncanplay=noop,ue.play()},ue.ontimeupdate=function(){ue.currentTime>.5&&(ue.ontimeupdate=noop,s.panoVideo.setMaterial(fe))},ue.src=he.video.source)}).catch((function(){ue.removeAttribute("uuid")}))}},function(){s.emit("pano.cancel",createEvent("pano.cancel",{options:o,prevPano:V,progress:0,state:J,userAction:s.userAction,error:null})),o.moveCancelCallback&&o.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,o;this.stopMomentumMovement(),this.camera.getDirection(new THREE__namespace.Vector3).setY(0);var s=null,u=this.works.getObserver(this.currentPano);if(!u)return null;var l=u.work.observers,c=u.accessibleNodes.filter(function(_){if(_===r.currentPano.panoIndex&&u.work.workCode===r.currentPano.workCode)return!1;var S=l[_];if(!S)return!1;var w=scratchVector3.copy(S.position).applyMatrix4(S.work.transform);return w.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:S.loadable||S.active}),p=this.modelScene.intersectRaycaster(e)[0];if(p){var f=arrayMin(c,function(_){var S=l[_];if(!S)return 1/0;var w=scratchVector3.copy(S.standingPosition).applyMatrix4(S.work.transform);return w.distanceTo(p.point)},!0),d=f[0],h=f[1];typeof d=="number"&&h<this.panoTapTriggerRadius&&(s=(o=l[d])!==null&&o!==void 0?o:null)}if(isNil(s)){var m=this.getForwardObserverOrNot(this.xrManager.cameraVR,e);m&&(s=m)}for(var A=0,g=this.locationMotion.keyframes;A<g.length;A++){var E=g[A],v=this.panoResourceFromLocationMotionKeyframe(E);if(!(E.progress<this.locationMotion.progress)&&s){var y=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode});if(v.panoId===y){s=null;break}}}if(isNil(s))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(!s.active){var y=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode}),b=this.panoMeshes.get(y);b&&(b.setDisabled(!1),b.setLoading(!0))}var T={workCode:s.work.workCode,panoIndex:s.panoIndex,mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:0,offset:s?s.position.clone():new THREE__namespace.Vector3};return this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:T,userAction:!0,options:{},progress:0,error:null})),s&&s.active?(this.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:T,options:{},error:null})),{workCode:s.work.workCode,panoIndex:s.panoIndex}):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,o){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,o){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var o=this,s,u,l,c,p,f,d,h,m,A=[],g=2;g<arguments.length;g++)A[g-2]=arguments[g];this.userAction=!0;var E={},v={},y=this.locationMotion.keyframes[0],b=this.locationMotion.keyframes[this.locationMotion.keyframes.length-1],T=this.locationMotion.getKeyFrameSegment(e),_=T[0],S=T[1],w=this.panoResourceFromLocationMotionKeyframe(_),R=this.panoResourceFromLocationMotionKeyframe(S),M=this.panoResourceFromLocationMotionKeyframe(y),B=this.panoResourceFromLocationMotionKeyframe(b),C=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),v.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),E.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var I=this.locationMotion.getKeyFrameSegment(e);I[0];var L=I[1],O=new THREE__namespace.Vector3().copy(w.position),F=new THREE__namespace.Vector3().copy(R.position),N=this.locationMotion.value.count-L.value.count+1;if(E.progress=N,R.leftPanoPicture&&(N<1?w.leftPanoPicture&&(E.pano0=w.leftPanoPicture):E.pano0=R.leftPanoPicture,E.pano1=R.leftPanoPicture),R.effect==="montage"?E.transition="BLACK":R.effect==="spread"?E.transition="SPREAD":E.transition="FADE",(R.effect==="zoomin"||R.effect==="zoomout")&&(E.progress=Math.pow(N,3)),N<1&&R.effect!=="fly"){if(E.pano0&&w.leftPanoPicture){var D={panoId:E.pano0.panoId,map:E.pano0.map,mapSize:E.pano0.mapSize,zoom:E.pano0.zoom,matrix:w.leftPanoPicture.matrix.clone().setPosition(R.position)},q=this.panoPictureObserverMap.get(E.pano0);q&&this.panoPictureObserverMap.set(D,q),E.pano0=D}O.copy(F),C=!0}v.distance=this.locationMotion.value.distance,v.offset=new THREE__namespace.Vector3(O.x+(F.x-O.x)*N,O.y+(F.y-O.y)*N,O.z+(F.z-O.z)*N);for(var z=[],j=[],J=0,V=this.locationMotion.keyframes;J<V.length;J++){var U=V[J],G=U.key,Z=U.progress;G!==void 0&&(z.push(G),Z>this.locationMotion.progress&&j.push(G))}for(var W=0,ee=Object.keys(this.panoResources);W<ee.length;W++){var X=ee[W];if(!(j.indexOf(X)>=0)){var K=this.panoResources[X];if(K.leftPanoPicture){var $=K.leftPanoPicture.map;if($){if($===((s=E.pano0)===null||s===void 0?void 0:s.map)||$===((u=E.pano1)===null||u===void 0?void 0:u.map))continue;$.dispose(),K.leftPanoPicture=null}}z.indexOf(X)>=0||delete this.panoResources[X]}}var re=panoParse(R.panoId);re!==this.currentPano&&(this.currentPano=re,this.accessibleObserverFloorCheckCount=0),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(M.panoId),state:__assign(__assign(__assign(__assign({},panoParse(B.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),v),options:{},progress:this.locationMotion.progress,error:null}))}this.camera.setFromPose(v),this.xrManager.cameraVR.projectionMatrix.copy(this.camera.projectionMatrix),this.xrManager.cameraVR.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.xrManager.cameraVR.matrix.copy(this.camera.matrix),this.xrManager.cameraVR.position.copy(this.camera.position),this.xrManager.cameraVR.quaternion.copy(this.camera.quaternion),this.xrManager.cameraVR.scale.copy(this.camera.scale),this.xrManager.cameraVR.matrixAutoUpdate=!1,this.xrManager.cameraVR.matrixWorld.copy(this.camera.matrixWorld);var ne=A,ae=ne[1],le=new THREE__namespace.Vector3(0,0,0),se=new THREE__namespace.Vector2().copy(this.camera.resolution);if(ae&&this.xrManager.session&&this.xrManager.referenceSpace&&this.xrManager.session.renderState.baseLayer){var ce=this.xrManager.cameraVR,me=this.xrManager.referenceSpace,Ae=this.xrManager.session.renderState.baseLayer,be=ae.getViewerPose(me),de=(l=be==null?void 0:be.views)!==null&&l!==void 0?l:[];this.renderer.setFramebuffer(Ae.framebuffer);for(var he=0;he<de.length;he++){var fe=de[he],te=ce.cameras[he],ue=Ae.getViewport(fe);ue&&(te.projectionMatrix.fromArray(fe.projectionMatrix),te.projectionMatrixInverse.getInverse(te.projectionMatrix),te.matrix.fromArray(fe.transform.matrix),te.matrix.setPosition(this.camera.position),te.matrix.decompose(te.position,te.quaternion,te.scale),te.matrixWorld.copy(te.matrix),te.matrixWorldInverse.getInverse(te.matrixWorld),te.matrixAutoUpdate=!1,le.copy(te.position),te.viewport.set(ue.x,ue.y,ue.width,ue.height),se.set(ue.width,ue.height))}if(this.xrManager.setProjectionFromUnion(this.xrManager.cameraVR,this.xrManager.cameraL,this.xrManager.cameraR),this.camera.quaternion.copy(this.xrManager.cameraVR.quaternion),this.camera.scale.copy(this.xrManager.cameraVR.scale),this.camera.matrix.compose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.computePose((c=v.distance)!==null&&c!==void 0?c:this.camera.pose.distance),this.xrManager.session&&this.xrManager.session.inputSources){for(var he=0;he<this.xrManager.session.inputSources.length;he++)if(this.xrManager.session.inputSources[he]&&this.xrManager.session.inputSources[he].targetRayMode==="transient-pointer"){var Te=ae.getPose(this.xrManager.session.inputSources[he].targetRaySpace,me);if(Te){var xe=Te.transform.orientation,Xe=new THREE__namespace.Quaternion(xe.x,xe.y,xe.z,xe.w),Je=new THREE__namespace.Vector3(0,0,-1).applyQuaternion(Xe),ze=new THREE__namespace.Raycaster(this.camera.position,Je);this.gazeRay=ze}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var ve=this.xrManager.session.inputSources,Ge=function(pe){var Re=ye.xrManager.controllers[pe],we=ve[pe];if(!we)return"continue";Re&&Re.update(we,ae,me);var Le=ye.xrManager.getController(pe),Bt=new THREE__namespace.Vector3(0,1.2,0),ut=Le.position.clone().add(le).sub(Bt);we.handedness==="left"?ye.xrControllerRay.left.set(ut,new THREE__namespace.Vector3(0,0,-1).applyEuler(Le.rotation)):we.handedness==="right"&&ye.xrControllerRay.right.set(ut,new THREE__namespace.Vector3(0,0,-1).applyEuler(Le.rotation)),ye.controllerWrappers[pe].position.copy(new THREE__namespace.Vector3(0,0,0).add(le).sub(Bt));var rt=ye.modelScene.intersectRaycaster(ye.xrControllerRay.right);if(rt.length===0){var Ft=ye.works.getResolvedObserver(ye.currentPano);rt=ye.xrControllerRay.right.intersectObject(ye.boundingMesh,!0).map(function($e){var Fe,lt=(Fe=Ft==null?void 0:Ft.floorIndex)!==null&&Fe!==void 0?Fe:0;return __assign({floorIndex:lt,floor:lt},$e)})}if(rt.length>=1&&rt[0].face)if(we.handedness==="right"){var P=ye.xrControllerRay.right.intersectObject(ye.xrCustomObjectsScene,!0),H=rt[0].face.normal,k=H.clone(),Q=rt[0].point.clone();ye.intersectMesh.position.copy(Q);var Y=Q.clone().add(k);if(ye.intersectMesh.lookAt(Y),Math.abs(H.y)>.99){var oe=ye.camera.position.clone().sub(Q);ye.intersectMesh.rotation.z=-Math.atan2(oe.z,oe.x)}ye.intersectMesh.visible=!0,ye.needsRender=!0,P.length>0?(ye.pointerLines.right.setPoints(ut,P[0].point),ye.pointerLines.right.points.visible=!0,ye.intersectMesh.visible=!1):(ye.pointerLines.right.points.visible=!1,ye.pointerLines.right.setPoints(ut,rt[0].point));var Ee=rt[0],ke=createEvent("intersect.update",{raycaster:(p=ye.xrControllerRay.right)!==null&&p!==void 0?p:null,intersection:Ee!=null?Ee:null,object:ye.intersectMesh});if(ye.emit("intersect.update",ke),ke.defaultPrevented)return ye.hideIntersectMesh(),{value:void 0}}else ye.pointerLines.left.setPoints(ut,rt[0].point)},ye=this,he=0;he<ve.length;he++){var Ne=Ge(he);if(typeof Ne=="object")return Ne.value}this.updateControllerHelper(ve,e,r)}}else ae||console.error("xrFrame丢失,请重试"),this.xrManager.session||console.error("session丢失,请重试"),this.xrManager.session&&!this.xrManager.session.renderState.baseLayer&&console.error("no layer found");isEmptyObject(E)===!1&&this.modelScene.parameter.set(E),this.emit("camera.update",createEvent("camera.update",{userAction:this.userAction,state:__assign(__assign(__assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose))}));var Be=this.works.getResolvedObserver(this.currentPano),Ye=this.locationMotion.ended?this.getForwardObserverOrNot(this.xrManager.cameraVR):null,nt=this.works.getObserver(w.panoId),De=this.works.getObserver(R.panoId);if(this.adjustPanoCircleMeshPositionBasedOnModel&&this.helper.visible&&Be){for(var qe=[],He=Be.work.observers,ge=0,Se=Be.accessibleNodes;ge<Se.length;ge++){var Me=Se[ge],q=He[Me];q&&qe.push(q)}var je=new Map;if(qe.sort(function(pe,Re){var we=je.get(pe);typeof we=="undefined"&&(we=pe.standingPosition.distanceTo(Be.standingPosition),je.set(pe,we));var Le=je.get(pe);return typeof Le=="undefined"&&(Le=Re.standingPosition.distanceTo(Be.standingPosition),je.set(Re,Le)),we-Le}),qe.length){this.accessibleObserverFloorCheckCount=this.accessibleObserverFloorCheckCount%qe.length;var Ue=qe[this.accessibleObserverFloorCheckCount],tt=this.modelScene.models.find(function(pe){return pe.work===(Ue==null?void 0:Ue.work)});if(Ue&&tt&&tt.visible){var dt=.3,Ve=.05,Ct=.005,Ie=Ue.standingPosition.clone().applyMatrix4(Ue.work.transform),Oe=panoStringify({panoIndex:Ue.panoIndex,workCode:Ue.work.workCode}),gt=adjustPanoCircleMeshVectors.map(function(pe){scratchRaycaster.ray.origin.copy(Ie),scratchRaycaster.ray.origin.add(scratchVector3.copy(pe).setY(dt)),scratchRaycaster.ray.direction.set(0,-1,0),scratchRaycaster.firstHitOnly=!0,scratchRaycaster.floorIndex=-1;var Re=tt.intersectRaycaster(scratchRaycaster)[0];return Re&&Re.distance-Ct<=dt?new THREE__namespace.Vector3().copy(Ie).setY(Re.point.y+Ct):Ie});gt.sort(function(pe,Re){return Re.y-pe.y});var Mt=gt[Math.floor(gt.length/2)],At=gt.filter(function(pe){return pe.distanceTo(Mt)<=Ve})[0];if(At){var ht=new THREE__namespace.Vector4(Ie.x,Ie.y,Ie.z,At.y-Ie.y),_t=this.adjustPanoCircleMeshPositionFix.get(Oe);_t&&!ht.equals(_t)&&(this.needsRender=!0),this.adjustPanoCircleMeshPositionFix.set(Oe,ht)}}this.accessibleObserverFloorCheckCount++}}var Ke=new Map;if(nt)for(var Ze=0,at=nt.accessibleNodes;Ze<at.length;Ze++){var Me=at[Ze],q=nt.work.observers[Me];if(q){var Oe=panoStringify({panoIndex:q.panoIndex,workCode:q.work.workCode});Ke.set(Oe,q)}}if(De)for(var Qe=0,ie=De.accessibleNodes;Qe<ie.length;Qe++){var Me=ie[Qe],q=De.work.observers[Me];if(q){var Oe=panoStringify({panoIndex:q.panoIndex,workCode:q.work.workCode});Ke.set(Oe,q)}}if(this.panoMeshes.forEach(function(pe,Re){var we=Ke.get(Re);if(we){pe.position.copy(we.standingPosition).applyMatrix4(we.work.transform);var Le=o.adjustPanoCircleMeshPositionFix.get(Re);Le&&(scratchVector3.set(Le.x,Le.y,Le.z),scratchVector3.equals(pe.position)&&(pe.position.y+=Le.w)),pe.scale.setScalar(1.2),Ke.delete(Re)}else o.helper.remove(pe),pe.dispose(),o.panoMeshes.delete(Re)}),Ke.forEach(function(pe,Re){var we=o.panoCircleMeshCreator(panoParse(Re));we.position.copy(pe.standingPosition).applyMatrix4(pe.work.transform);var Le=o.adjustPanoCircleMeshPositionFix.get(Re);Le&&(scratchVector3.set(Le.x,Le.y,Le.z),scratchVector3.equals(we.position)&&(we.position.y+=Le.w)),we.scale.setScalar(1.2),o.panoMeshes.set(Re,we),o.helper.add(we),Ke.delete(Re)}),this.camera.pose.distance>.1||C)this.panoMeshes.forEach(function(pe){pe.setOpacity(0),pe.setCurrent(!1),pe.updateTime&&pe.updateTime(e,r),pe.visible=!1});else if(Be){var _e=Be.work.observers,Pe=arrayMin(Be.accessibleNodes,function(pe){var Re=_e[pe];return Re?Be.standingPosition.distanceTo(Re.standingPosition):1/0},!0),Ce=Pe[1];Ce=clamp$1(Ce,2.5,1/0);var yt=Be.visibleNodes.concat(Be.panoIndex).map(function(pe){return panoStringify({panoIndex:pe,workCode:Be.work.workCode})}),ct=this.camera.getDirection(new THREE__namespace.Vector3);this.panoMeshes.forEach(function(pe,Re){var we=o.works.getObserver(Re);if(yt.indexOf(Re)===-1)pe.setCurrent(!1),pe.setOpacity(0);else if(!we)pe.setCurrent(!1),pe.setOpacity(0);else if(!we.loadable&&!we.active)pe.setCurrent(!1),pe.setOpacity(0);else{var Le=pe.position.clone().setY(o.camera.position.y).distanceTo(o.camera.position);pe.setCurrent(!pe.loading&&pe.progress===0&&Ye!==null&&panoStringify({panoIndex:Ye.panoIndex,workCode:Ye.work.workCode})===Re),pe.setOpacity(Le<.01?0:clamp$1(Ce/Le*1.2,.65,.98));var Bt=o.camera.position.clone().setY(pe.position.y),ut=new THREE__namespace.Vector3().copy(pe.position).sub(Bt).normalize();if(Re===panoStringify(o.currentPano)){var rt=clamp$1((.5-Bt.distanceTo(pe.position))/.5,0,1);ut.multiplyScalar(1-rt).add(ct.clone().multiplyScalar(rt))}ut.length()>0&&pe.quaternion.setFromEuler(new THREE__namespace.Euler(0,Math.atan2(ut.x,ut.z),0))}pe.updateTime&&pe.updateTime(e,r)})}{var N=(f=this.modelScene.parameter.progress)!==null&&f!==void 0?f:1,Et=Math.round(N),it=this.modelScene.parameter.pano0,pt=this.modelScene.parameter.pano1,bt=Et===0?it:pt,q=void 0;if(bt&&(q=this.works.getObserver(bt.panoId),q||(q=this.panoPictureObserverMap.get(bt))),this.tiling.appearDuration=this.tileAppearDuration,this.tiling.maxRequest=N<(canUseNativeImageBitmap()?.6:.99)?0:this.tileMaxRequest,this.tiling.imageOptions=this.imageOptions,!q||!bt||this.tileLevelForFov===!1||this.camera.perspToOrtho.x>0){this.tiling.setObserver(null);var It={renderer:this.renderer,resolution:se,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:null,panoMatrix:new THREE__namespace.Matrix4,panoZoom:1,minLevel:0,level:0};this.tiling.update(It),this.modelScene.parameter.set("refinedScreen",null)}else{var ot=getImageSizeLevel(bt.mapSize),Pt=ot+1,Tt=4;this.tiling.setObserver(q);var It={renderer:this.renderer,resolution:se,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:bt.map,panoMatrix:bt.matrix,panoZoom:bt.zoom,minLevel:Pt,level:Tt},vt=this.tiling.update(It),xt={map:this.tiling.renderTarget.texture,matrixInverse:this.tiling.camera.matrixWorldInverse,projectionMatrix:this.tiling.camera.projectionMatrix,pano:Et,opacity:(it==null?void 0:it.panoId)===(pt==null?void 0:pt.panoId)?1:easeInQuart(Math.abs(((d=this.modelScene.parameter.progress)!==null&&d!==void 0?d:0)-.5)*2)},We=this.modelScene.parameter.refinedScreen;(vt||xt.pano!==(We==null?void 0:We.pano)||xt.opacity!==(We==null?void 0:We.opacity))&&this.modelScene.parameter.set("refinedScreen",xt)}}if(this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),this.intersectMesh&&this.intersectMesh.parent&&Be&&Be.position.y-Be.standingPosition.y>10){var mt=this.camera.position.distanceTo(this.intersectMesh.position),Ot=2*Math.tan(.5*this.camera.fov/180*Math.PI),Lt=mt*Ot/5;this.intersectMesh.scale.setScalar(Lt)}else this.intersectMesh.scale.setScalar(1);{var Ht=R.effect,st=this.modelScene.parameter,it=st.pano0,pt=st.pano1;if(it&&pt&&it!==pt&&Ht==="fly"&&this.flyEffectUseDepthBuffer){if(((h=this.modelScene.parameter.pano0Depth)===null||h===void 0?void 0:h.panoId)!==it.panoId||((m=this.modelScene.parameter.pano1Depth)===null||m===void 0?void 0:m.panoId)!==pt.panoId){var St=500,ft=512;this.pano0DepthCubeRenderTarget?this.pano0DepthCubeRenderTarget.width!==ft&&this.pano0DepthCubeRenderTarget.setSize(ft,ft):this.pano0DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(ft,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1}),this.pano1DepthCubeRenderTarget?this.pano1DepthCubeRenderTarget.width!==ft&&this.pano1DepthCubeRenderTarget.setSize(ft,ft):this.pano1DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(ft,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1});var Rt=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano0DepthCubeRenderTarget);Rt.matrix.copy(it.matrix),Rt.matrixWorld.copy(Rt.matrix),Rt.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,Rt,St);var wt=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano1DepthCubeRenderTarget);wt.matrix.copy(pt.matrix),wt.matrixWorld.copy(wt.matrix),wt.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,wt,St),this.modelScene.parameter.set({pano0Depth:{panoId:it.panoId,map:this.pano0DepthCubeRenderTarget.texture,mapSize:this.pano0DepthCubeRenderTarget.width,maxDepth:St},pano1Depth:{panoId:pt.panoId,map:this.pano1DepthCubeRenderTarget.texture,mapSize:this.pano1DepthCubeRenderTarget.width,maxDepth:St}})}}else this.modelScene.parameter.set({pano0Depth:null,pano1Depth:null}),this.flyEffectUseDepthBuffer||(this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0))}},t.prototype.render=function(){this.renderer.setScissorTest(!1);var e=this.xrManager.cameraVR;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,o){var s=this.xrControllerRay.left,u=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var l={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},c=0;c<e.length;c++){var p=e[c].handedness,f=e[c].gamepad;switch(p){case"left":f.axes&&(this.emitHandleEvent(f.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(f.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(f.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(f.axes[3]===1,"LeftAxesDown",r)),f!=null&&f.buttons&&(f.buttons[4]&&this.emitHandleEvent(f.buttons[4].pressed,"X",r),f.buttons[5]&&this.emitHandleEvent(f.buttons[5].pressed,"Y",r),f.buttons[0]&&this.emitHandleEvent(f.buttons[0].pressed,"LeftTrigger",r),f.buttons[1]&&this.emitHandleEvent(f.buttons[1].pressed,"LeftPinch",r));var d={raycaster:s,axes:{up:f.axes&&f.axes[3]<0?Math.abs(f.axes[3]):0,down:f.axes&&f.axes[3]<0?0:Math.abs(f.axes[3]),left:f.axes&&f.axes[2]<0?Math.abs(f.axes[2]):0,right:f.axes&&f.axes[2]<0?0:Math.abs(f.axes[2])},deltaTime:o};l.buttons.X=f.buttons&&f.buttons[4]?f.buttons[4].pressed:!1,l.buttons.Y=f.buttons&&f.buttons[5]?f==null?void 0:f.buttons[5].pressed:!1,l.buttons.LeftTrigger=f.buttons&&f.buttons[0]?f==null?void 0:f.buttons[0].pressed:!1,l.buttons.LeftPinch=f.buttons&&f.buttons[1]?f==null?void 0:f.buttons[1].pressed:!1,l.left=d;break;case"right":f.axes&&(this.emitHandleEvent(f.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(f.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(f.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(f.axes[3]===1,"RightAxesDown",r)),f.buttons&&(f.buttons[4]&&this.emitHandleEvent(f.buttons[4].pressed,"A",r),f.buttons[5]&&this.emitHandleEvent(f.buttons[5].pressed,"B",r),f.buttons[0]&&this.emitHandleEvent(f.buttons[0].pressed,"RightTrigger",r),f.buttons[1]&&this.emitHandleEvent(f.buttons[1].pressed,"RightPinch",r));var h={raycaster:u,axes:{up:f.axes&&f.axes[3]<0?Math.abs(f.axes[3]):0,down:f.axes&&f.axes[3]<0?0:Math.abs(f.axes[3]),left:f.axes&&f.axes[2]<0?Math.abs(f.axes[2]):0,right:f.axes&&f.axes[2]<0?0:Math.abs(f.axes[2])},deltaTime:o};l.right=h,l.buttons.A=f.buttons&&f.buttons[4]?f==null?void 0:f.buttons[4].pressed:!1,l.buttons.B=f.buttons&&f.buttons[5]?f==null?void 0:f.buttons[5].pressed:!1,l.buttons.RightTrigger=f.buttons&&f.buttons[0]?f==null?void 0:f.buttons[0].pressed:!1,l.buttons.RightPinch=f.buttons&&f.buttons[1]?f==null?void 0:f.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",createEvent("xr.controller.update",l))}},t.prototype.emitHandleEvent=function(e,r,o){var s=this.xrControllerRay.left,u=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=o,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",createEvent("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:s,rightRay:u}}}));else{var l=o-this.xrHandleState[r].touchStartTime;l>CONTROLLER_EVNET_DELTA_TIME&&this.emit("xr.gesture.press",createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:s,rightRay:u}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",createEvent("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:s,rightRay:u}}}));var l=o-this.xrHandleState[r].touchStartTime;if(l<=CONTROLLER_EVNET_DELTA_TIME){var c=createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:s,rightRay:u}}}),p=this.emit("xr.gesture.tap",c);!p&&!c.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})(PanoramaController),Controllers={Floorplan:FloorplanController,Topview:TopviewController,Panorama:PanoramaController,VRPanorama:VRPanoramaController,Model:ModelController,Mapview:MapviewController,XRPanorama:XRPanoramaController},controllersDefaultInitArgs={Floorplan:defaultFloorplanControllerCustomInitArgs,Topview:defaultTopviewControllerCustomInitArgs,Panorama:defaultPanoramaControllerCustomInitArgs,VRPanorama:defaultVRPanoramaControllerCustomInitArgs,Model:defaultModelControllerCustomInitArgs,Mapview:defaultMapviewControllerCustomInitArgs,XRPanorama:defaultXRPanoramaControllerInitArgs},PROXY_CONTROLLER_EVENT_NAMES=["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 initLegacyEvent(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=coordinatesToVector(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 generateDefaultVideoElement(){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 initLights(){var n=new THREE__namespace.Group;n.name="internalLights";{var t=new THREE__namespace.DirectionalLight(16777215,.1);t.name="direction0",t.position.copy(new THREE__namespace.Vector3(0,1,0)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.1);t.name="direction1",t.position.copy(new THREE__namespace.Vector3(-1,-1,-1)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.3);t.name="direction2",t.position.copy(new THREE__namespace.Vector3(1,1,1)),n.add(t)}{var t=new THREE__namespace.AmbientLight(16777215,.6);t.name="ambient0",n.add(t)}return n}function parseKeyValue(n){for(var t,e,r={},o=n.split(/(\;|\,)/),s=0,u=o;s<u.length;s++){var l=u[s],c=l.split("="),p=(t=c[0])===null||t===void 0?void 0:t.trim(),f=(e=c[1])===null||e===void 0?void 0:e.trim();p&&f&&(r[p]=f)}return r}function getViewportScale(){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 o=parseKeyValue((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),s=Number(o["initial-scale"]);if(!isNaN(s))return s}}return 1}const textureURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6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nsgbXxt6gsWCpRBa0vRGQM8oB9dhmP3QAwFX4c079dJNq6Qi5xbuyTmpPSJ1Ur4UtF7GoTtmUL3zxaWqMU8P/k3cXSQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var imageSize=[351,63],imageOffset=[20,20],vertices=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),uvs=new Float32Array([0,0,1,0,0,1,1,1]),index=new Uint8Array([0,1,2,1,3,2]),geometry$4=new THREE__namespace.BufferGeometry;geometry$4.setAttribute("position",new THREE__namespace.BufferAttribute(vertices,3)),geometry$4.setAttribute("uv",new THREE__namespace.BufferAttribute(uvs,2)),geometry$4.setIndex(new THREE__namespace.BufferAttribute(index,1));var material=new THREE__namespace.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),mesh$4=new THREE__namespace.Mesh(geometry$4,material);mesh$4.matrixAutoUpdate=!1;var scene$2=new THREE__namespace.Scene;scene$2.add(mesh$4),scene$2.matrixAutoUpdate=!1;var camera$2=new THREE__namespace.OrthographicCamera(-.5,.5,.5,-.5,.1,1);camera$2.position.set(0,0,.5),camera$2.lookAt(0,0,0),camera$2.updateMatrixWorld(!0),camera$2.matrixAutoUpdate=!1;var prevViewport=new THREE__namespace.Vector4,prevScissor=new THREE__namespace.Vector4;function renderPoweredByRealsee(n){if(material.map){var r=n.getViewport(prevViewport),o=n.getScissor(prevScissor),s=n.getScissorTest(),u=n.autoClear,l=o.x+imageOffset[0]/3,c=o.y+imageOffset[1]/3,p=imageSize[0]/3,f=imageSize[1]/3;n.setViewport(l,c,p,f),n.setScissor(l,c,p,f),n.setScissorTest(!0),n.autoClear=!1,n.render(scene$2,camera$2),n.setViewport(r),n.setScissor(o),n.setScissorTest(s),n.autoClear=u}else{var t=new THREE__namespace.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=THREE__namespace.ClampToEdgeWrapping,t.wrapT=THREE__namespace.ClampToEdgeWrapping,t.minFilter=THREE__namespace.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,material.needsUpdate=!0,e.onload=noop},e.src=textureURL,material.map=t}}var FRAGMENT$2=`
|
|
2134
2134
|
precision mediump float;
|
|
2135
2135
|
precision mediump int;
|
|
2136
2136
|
uniform sampler2D depthBuffer;
|
|
@@ -2246,4 +2246,4 @@ void main() {
|
|
|
2246
2246
|
rgb = clamp(lumCompressed * rgb, 0.0, 1.0);
|
|
2247
2247
|
gl_FragColor = mix(inputColor, vec4(rgb, alpha), progress * 0.9);
|
|
2248
2248
|
}
|
|
2249
|
-
`})||this;return r.material.transparent=!0,r}return Object.defineProperty(t.prototype,"luminanceAdaptiveBuffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBuffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(e){this.material.uniforms.progress.value=e},enumerable:!1,configurable:!0}),t})(Pass),LuminanceAdaptiveEffect=(function(n){__extends(t,n);function t(e,r,o,s){var u=n.call(this,e,r,o,s)||this;return u.enableTime=now(),u.renderer=e,u.valuePass=new ValuePass(u.renderer),u.luminancePass=new LuminancePass(u.renderer,Math.sqrt(1/3)),u.nextStepPass=new NextStepPass(u.renderer,.01),u.luminanceAdaptivePass=new LuminanceAdaptivePass(u.renderer),u}return t.prototype.render=function(e){this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.enableTime===null&&(this.enableTime=now()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new THREE__namespace.WebGLRenderTarget(128,128,{minFilter:THREE__namespace.LinearMipmapLinearFilter,magFilter:THREE__namespace.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:THREE__namespace.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e[0],this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new THREE__namespace.WebGLRenderTarget(1,1,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,type:THREE__namespace.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new THREE__namespace.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new THREE__namespace.WebGLRenderTarget(1,1,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,type:THREE__namespace.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new THREE__namespace.Vector3(.5,.5,.5),this.luminanceNextBuffer),this.luminanceAdaptivePass.luminanceAdaptiveBuffer=this.luminanceNextBuffer.texture),this.copyPass.render(this.luminanceNextBuffer,this.luminancePrevBuffer),this.nextStepPass.render(this.luminancePrevBuffer,this.luminanceNextBuffer),this.luminanceAdaptivePass.progress=Math.min((now()-this.enableTime)/100,1),this.luminanceAdaptivePass.render(e[0],e[1])},t.prototype.dispose=function(){var e,r,o;(e=this.luminanceTargetBuffer)===null||e===void 0||e.dispose(),(r=this.luminancePrevBuffer)===null||r===void 0||r.dispose(),(o=this.luminanceNextBuffer)===null||o===void 0||o.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},t})(Effect),sharedV2=new THREE__namespace.Vector2,LuminanceRenderer=(function(n){__extends(t,n);function t(e){var r,o,s=n.call(this,e)||this;s.type="default",s.luminanceAdaptiveEffect=new LuminanceAdaptiveEffect(s.renderer,s.modelScene,s.camera,s.modelScene);var u=s.renderer.getDrawingBufferSize(sharedV2);return s.screenBuffers=[new THREE__namespace.WebGLRenderTarget(u.x,u.y,{generateMipmaps:!1,encoding:(o=(r=s.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&o!==void 0?o:THREE__namespace.sRGBEncoding}),s.enableFragDepth?s.modelRenderTarget:null],s}return t.prototype.render=function(e){var r=this.renderer.getRenderTarget();this.enableFragDepth?(e&&(this.luminanceAdaptiveEffect.enable=!0,this.luminanceAdaptiveEffect.render(this.screenBuffers)),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,r),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,r),this.renderer.setRenderTarget(r),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0):(this.luminanceAdaptiveEffect.enable=!0,this.luminanceAdaptiveEffect.render(this.screenBuffers),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0),this.modelScene.needsRender=!0},t})(BaseRenderer),DEFAULT_MODE_CHANGE_DURATION=1e3,DEFAULT_CAMERA_FOV=90,DEFAULT_REQUEST_PROXY=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/")},scratchSphere=new THREE__namespace.Sphere,scratchBox3=new THREE__namespace.Box3,scratchViewport=new THREE__namespace.Vector4,scratchScissor=new THREE__namespace.Vector4,scratchClearColor=new THREE__namespace.Color,scratchRenderSize=new THREE__namespace.Vector2,worksMap=new WeakMap,emptyWorks=createWorks([parseWork(null)]),Five=(function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,o,s,u,l,c,p,f,d,h,m,A,g=n.call(this)||this;if(g.ident=createUuid(),typeof window!="undefined"&&(__FIVE_DEBUG__.instances[g.ident]=g),g.renderSwitch01=0,g.currentUpdateArgs={time:now(),args:[]},g.currentMode="Panorama",g.pano={workCode:"",panoIndex:0},g.needsRender=!1,g.modelSceneNeedsRender=!1,g.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,g.imageOptions=__assign({},(o=e.imageOptions)!==null&&o!==void 0?o:{}),g.textureOptions=__assign({},(s=e.textureOptions)!==null&&s!==void 0?s:{}),g.poweredByRealsee=(u=e.poweredByRealsee)!==null&&u!==void 0?u:!0,g.backgroundColor=new THREE__namespace.Color((l=e.backgroundColor)!==null&&l!==void 0?l:1579548),g.backgroundAlpha=(c=e.backgroundAlpha)!==null&&c!==void 0?c:1,g.extraElements=[],g.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)},g.fps={testCount:0,testTime:now()},g.modeChangeDuration=(p=e.modeChangeDuration)!==null&&p!==void 0?p:DEFAULT_MODE_CHANGE_DURATION,g.enableWheel=(f=e.enableWheel)!==null&&f!==void 0?f:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof InternalWebGLRenderer&&g.throwError(new Error("cannot render a internal renderer")),g.renderer=e.renderer;else try{g.renderer=new InternalWebGLRenderer({preserveDrawingBuffer:e.preserveDrawingBuffer,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision,powerPreference:e.powerPreference});var E=getViewportScale();g.renderer.setPixelRatio(E===1?window.devicePixelRatio:1),g.renderer.setSize(512,512),g.renderer.setClearColor(g.backgroundColor,g.backgroundAlpha)}catch(O){var v=O instanceof Error?O:new Error(String(O));g.throwError(v)}g.getPixelsRenderTarget=new THREE__namespace.WebGLRenderTarget(1,1,{encoding:(h=(d=g.renderer)===null||d===void 0?void 0:d.outputEncoding)!==null&&h!==void 0?h:THREE__namespace.sRGBEncoding,generateMipmaps:!1}),g.viewport=Object.assign({left:0,bottom:0,width:1,height:1},e.viewport),g.camera=new Camera(DEFAULT_CAMERA_FOV),g.scene=new Scene,g.xrCustomObjectsScene=new THREE__namespace.Scene,g.scene.add(g.xrCustomObjectsScene),g.scene.matrixAutoUpdate=!1,g.loadWorkTask=Promise.resolve(),g.requestProxy=(m=e.requestProxy)!==null&&m!==void 0?m:DEFAULT_REQUEST_PROXY,g.networkSubscribe=new NetworkSubscribe,g.networkSubscribe.on("network",function(O,F,N,D){var q;g.emit("network.resource",createEvent("network.resource",{source:O,requestType:F,requestState:N,detail:D})),(q=g.analysis)===null||q===void 0||q.network(g.works,O,F,N,D)}),g.boundingMesh=new BoundingMesh$1,g.boundingMesh.name="bounding",g.readyCallbacks=[],g.syncingState=!1,g.helperGroup=new THREE__namespace.Group,g.helperGroup.name="helper",g.helperGroup.matrixAutoUpdate=!1,g.scene.add(g.helperGroup);var y=new Model(emptyWorks[0]);worksMap.set(g,emptyWorks),g.modelScene=new ModelScene,g.modelScene.add(y),g.modelScene.add(g.boundingMesh),defineProperty(y,"loaded",{get:function(){return!1},set:function(O){}}),g.videoTexture=new THREE__namespace.VideoTexture(e.videoInstance||generateDefaultVideoElement());var b=initLights();g.scene.add(b);var T=new THREE__namespace.Group;defineProperty(T,"children",{get:function(){return b.children},set:function(O){b.children=O}}),defineProperty(T,"visible",{get:function(){return b.visible},set:function(O){b.visible=O}}),defineProperty(T,"name",{get:function(){return b.name},set:function(O){b.name=O}}),g.modelScene.add(T),g.state={mode:g.currentMode,workCode:g.pano.workCode,panoIndex:g.pano.panoIndex,longitude:g.camera.pose.longitude,latitude:g.camera.pose.latitude,fov:g.camera.pose.fov,offset:g.camera.pose.offset.clone(),distance:g.camera.pose.distance},g.stateSynced=!1,g.destroyed=!1,g.paused=!0,typeof window!="undefined"&&(e.play!==!1&&g.play(),g.stopAnimationLoop=AnimationFrameLoop.shared.add(function(O,F){for(var N=[],D=2;D<arguments.length;D++)N[D-2]=arguments[D];g.updateTime.apply(g,__spreadArray([O,F],N,!1))},!1,0,10));var _=function(){typeof document!="undefined"&&document.fullscreenElement===null&&g.currentMode==="VRPanorama"&&g.controller.emit("vr.requestExit",createEvent("vr.requestExit",{}))},S=function(){g.needsRender=!0,g.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",_,!1),g.renderer&&g.renderer.domElement.addEventListener("webglcontextrestored",S,!1),g.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",_,!1),g.renderer&&g.renderer.domElement.removeEventListener("webglcontextrestored",S,!1)},g.plugins={},e.plugins&&e.plugins.length)for(var w=0,R=e.plugins;w<R.length;w++){var M=R[w];if(typeof M=="function")M(g);else if(Array.isArray(M)){var B=M[0],C=M[1],I=M[2];if(typeof B=="function"){var L=B(g,I);typeof C=="string"&&(g.plugins[C]?g.throwError(new Error("plugin name ".concat(C," is exists."))):g.plugins[C]=L)}}}return initLegacyEvent(g),g.enableLayeringRendering=(A=e.enableLayeringRendering)!==null&&A!==void 0?A:!1,g._buildInRendererType="default",g._builtinRenderer=null,g}return Object.defineProperty(t,"version",{get:function(){return"6.7.0-alpha.10"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return draco.decoderPath},set:function(e){draco.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return ktx2.transcoderPath},set:function(e){ktx2.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"useNativeImageBitmap",{get:function(){return canUseNativeImageBitmap()},set:function(e){useNativeImageBitmap(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){var e;if(this.destroyed!==!0){delete __FIVE_DEBUG__.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),this.stopAnimationLoop=void 0),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var r=this.getElement();r&&r.parentNode&&r.parentNode.removeChild(r);var o=this.modelScene.parameter;o.pano0&&o.pano0.map.dispose(),o.pano1&&o.pano1.map!==((e=o.pano0)===null||e===void 0?void 0:e.map)&&o.pano1.map.dispose(),o.reset("pano0","pano1");for(var s=0,u=this.modelScene.children.slice();s<u.length;s++){var l=u[s];l.dispose&&l.dispose(),this.modelScene.remove(l)}this.modelScene.dispose(),this.scene.dispose(),this.xrCustomObjectsScene.dispose(),worksMap.set(this,emptyWorks),this.renderer&&(this.renderer.render(new THREE__namespace.Scene,new THREE__namespace.Camera),this.renderer.setAnimationLoop(null)),this.renderer instanceof InternalWebGLRenderer&&(this.renderer.forceContextLoss&&this.renderer.forceContextLoss(),this.renderer.dispose())}},t.prototype.setViewport=function(e){Object.assign(this.viewport,e),this.needsRender=!0,this.modelSceneNeedsRender=!0},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpers.visible",createEvent("helpers.visible",{object:this.helperGroup})),this.needsRender=!0)},enumerable:!1,configurable:!0}),t.prototype.getBuiltinRenderer=function(e){var r=this._builtinRenderer;if((r==null?void 0:r.type)!==this._buildInRendererType)switch(r&&r.dispose(),this._buildInRendererType){case"default":this._builtinRenderer=new DefaultRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"edl":this._builtinRenderer=new EDLRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"hq":this._builtinRenderer=new HQRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"luminance":this._builtinRenderer=new LuminanceRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break}return this._builtinRenderer},Object.defineProperty(t.prototype,"renderEffect",{get:function(){return this._buildInRendererType},set:function(e){this._buildInRendererType=e,this.modelSceneNeedsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e,r){r===void 0&&(r=!0);var o=!1,s=!1;if(e.panorama&&(Object.assign(this.controllerInits.Panorama,omitUndefinedFields(e.panorama)),this.currentMode==="Panorama"&&(o=!0)),e.model&&(Object.assign(this.controllerInits.Model,omitUndefinedFields(e.model)),this.currentMode==="Model"&&(o=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,omitUndefinedFields(e.floorplan)),this.currentMode==="Floorplan"&&(o=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,omitUndefinedFields(e.topview)),this.currentMode==="Topview"&&(o=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,omitUndefinedFields(e.mapview)),this.currentMode==="Mapview"&&(o=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,omitUndefinedFields(e.vrPanorama)),this.currentMode==="VRPanorama"&&(o=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(s=!0,o=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&o&&this.controller&&this.currentMode){var u=this.controller.updateConfiguration(this.controllerInits[this.currentMode]);(!u||s)&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)}},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof InternalWebGLRenderer)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var o=this.getElement();if(o){e.appendChild(o),this.refresh(r);var s=window.getComputedStyle(e).position;s!=="relative"&&s!=="absolute"&&s!=="fixed"&&s!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){var o,s;if(e===void 0&&(e={}),!!this.renderer){var u=this.renderer.domElement,l=u.parentNode,c=e.width,p=c===void 0?(o=l==null?void 0:l.offsetWidth)!==null&&o!==void 0?o:512:c,f=e.height,d=f===void 0?(s=l==null?void 0:l.offsetHeight)!==null&&s!==void 0?s:512:f;r=r!=null?r:this.renderer.getPixelRatio();var h=this.renderer.capabilities.maxTextureSize,m=Math.max(p,d)*r;m>h&&(r=r/m*h,r=Math.floor(r*100)/100),this.renderer.setPixelRatio(r),this.renderer.setSize(p,d),this.needsRender=!0,this.modelSceneNeedsRender=!0;var A=now(),g=A-this.currentUpdateArgs.time,E=this.currentUpdateArgs.args;this.updateTime(A,g,E)}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.viewport.width,e.y*=this.viewport.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.viewport.width,e.y*=this.viewport.height,e},t.prototype.updateCamera=function(e,r,o){if(o===void 0&&(o=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCamera(e,r,o)},t.prototype.updateCameraWithKeyframes=function(e,r,o){if(o===void 0&&(o=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCameraWithKeyframes(e,r,o)},Object.defineProperty(t.prototype,"works",{get:function(){var e=worksMap.get(this);return e||emptyWorks},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"observers",{get:function(){return this.work.observers},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"models",{get:function(){return this.modelScene.models},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.modelScene.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,o,s){var u=this;if(s===void 0&&(s=!0),!this.renderer)throw new Error("renderer is not initialized");var l=this.loadWorkTask.then(function(){return isPromise(e)?e.then(function(c){return u.load_(c,r,o,s)}):u.load_(e,r,o,s)});return this.loadWorkTask=l.catch(function(c){u.throwError(c)}),l},t.prototype.load_=function(e,r,o,s){var u=this,l,c,p,f,d,h,m,A,g,E;s===void 0&&(s=!0);var v={};typeof o=="number"?v.duration=o:typeof o=="object"&&Object.assign(v,o),this.works===emptyWorks&&(v.duration===void 0&&(v.duration=0),v.effect===void 0&&(v.effect="instant"));var y=[];if(Array.isArray(e))for(var b=0,T=e;b<T.length;b++){var _=T[b];_ instanceof Work?y.push(_):typeof _!="string"&&"work"in _?y.push(parseWork(_.work,_)):y.push(parseWork(_))}else e instanceof Work?y.push(e):y.push(parseWork(e));for(var S=createWorks(y),w=function(X){var K=R,$=new Fetcher({get networkSubscribe(){return K.networkSubscribe},requestProxy:function(re){return Promise.resolve(re).then(function(ne){return K.requestProxy(ne)}).then(function(ne){var ae=verifyURL(ne,X.allowHosts);if(ae instanceof Error)throw ae;return ae})}});registerFetcher(X,$)},R=this,M=0,B=S;M<B.length;M++){var C=B[M];w(C)}r===void 0&&(r="inherit"),r==="inherit"&&this.works===emptyWorks&&(r="initial");var I=S.initial,L=I.work.observers[0],O=L?{workCode:L.work.workCode,panoIndex:L.panoIndex}:{workCode:I.work.workCode,panoIndex:0},F=(l=I.mode)!==null&&l!==void 0?l:L?"Panorama":"Mapview",N={};if(r==="inherit"){F=this.currentMode;var D=(p=(c=S[0])===null||c===void 0?void 0:c.observers)===null||p===void 0?void 0:p[this.panoIndex];D?O={workCode:D.work.workCode,panoIndex:D.panoIndex}:typeof S.initial.panoIndex=="number"?O={workCode:S.initial.work.workCode,panoIndex:S.initial.panoIndex}:(F==="Panorama"||F==="VRPanorama"||F==="XRPanorama")&&(F="Mapview"),N={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:void 0,offset:void 0}}else if(r==="initial")typeof I.panoIndex=="number"&&(O={workCode:I.work.workCode,panoIndex:I.panoIndex}),I.mode&&(F=I.mode),N={longitude:I.longitude,latitude:I.latitude,fov:I.fov,distance:I.distance,offset:(f=I.offset)===null||f===void 0?void 0:f.clone()};else{if(F=(d=r.mode)!==null&&d!==void 0?d:this.currentMode,typeof r.panoIndex=="number"){var D=S.getObserver({workCode:(m=(h=r.workCode)!==null&&h!==void 0?h:I.work.workCode)!==null&&m!==void 0?m:"",panoIndex:r.panoIndex});D&&(O={workCode:D.work.workCode,panoIndex:D.panoIndex})}N={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var q=__assign(__assign(__assign({},O),{mode:F}),N),z=this.getCurrentState(),j=(A=v.duration)!==null&&A!==void 0?A:this.modeChangeDuration;(F==="Floorplan"||F==="Topview"||F==="Mapview")&&this.currentMode===F&&(j=0);var J="fly";(F==="Panorama"||F==="VRPanorama"||F==="XRPanorama")&&this.currentMode===F&&(J=(g=v.effect)!==null&&g!==void 0?g:"fade"),this.emit("works.request",createEvent("works.request",{input:e,works:S,state:q,userAction:s}));var V=function(){u.pano=O;var X=__assign(__assign({initial:{state:q,currentState:z,duration:j,effect:J,userAction:s}},u.commonParams()),u.controllerInits[F]),K=Controllers[F].initAnimationEndState(X);if(u.controller&&u.currentMode===F)u.controller.updateWork(S,K,{effect:J,duration:j},s)===!1&&(u.controller.destroy(),u.controller=u.applyController(F,X));else{var $=u.currentMode;if(u.controller)u.controller.destroy();else{var re=Controllers[F].initAnimationEndState(X);u.camera.setFromPose(re),u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s}))}u.controller=u.applyController(F,X);var ne=createEvent("mode.change",{prevMode:$,mode:F,state:K,userAction:s});try{u.emit("mode.change",ne)}catch(ae){console.error(ae)}}u.updateTime(u.currentUpdateArgs.time,0,u.currentUpdateArgs.args)};worksMap.set(this,S);var U=Promise.resolve();if(F===t.Mode.Floorplan||F===t.Mode.Topview||F===t.Mode.Mapview||F===t.Mode.Model){this.modelScene.loaded===!1&&(this.camera.setFromPose(q),assignPose(this.state,this.camera.pose)),this.controller||(this.currentMode=F);var G=this.loadModels(S,v);U=Promise.all(G.map(function(X){return X.loadedReady})).then(function(){u.needsRender=!0,u.modelSceneNeedsRender=!0,V(),u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s}))})}else{V();var Z=this.controller,W=!1;this.modelScene.autoRefine=!1;var ee=function(){u.works===S&&W===!1&&(u.needsRender=!0,u.modelSceneNeedsRender=!0,u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s})),W=!0,u.modelScene.autoRefine=!0),Z.off("pano.arrived",ee),Z.off("pano.cancel",ee)},G=this.loadModels(S,v);U=Promise.all(G.map(function(K){return K.initReady})).then(noop),Z.once("pano.arrived",ee),Z.once("pano.cancel",ee),setTimeout(ee,((E=v.duration)!==null&&E!==void 0?E:this.modeChangeDuration)+1e3)}return this.emit("works.load",createEvent("works.load",{input:e,state:this.getCurrentState(),userAction:s,works:S})),U.then(function(){return u.ready()}).then(function(){var X;u.emit("works.ready",createEvent("works.ready",{input:e,state:u.getCurrentState(),userAction:s,works:S})),(X=u.analysis)===null||X===void 0||X.work(S)})},t.prototype.reset=function(){var e=this,r=this.loadWorkTask.then(function(){return e.reset_()});return this.loadWorkTask=r.catch(function(o){e.throwError(o)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var o;e.controller&&(e.controller.destroy(),e.controller=void 0);var s=e.modelScene.parameter;s.pano0&&s.pano0.map.dispose(),s.pano1&&s.pano1.map!==((o=s.pano0)===null||o===void 0?void 0:o.map)&&s.pano1.map.dispose(),s.set({pano0:null,pano1:null,modelAlpha:1}),e.renderer&&e.modelScene.update(e.renderer,e.camera);for(var u=0,l=e.modelScene.children;u<l.length;u++){var c=l[u];c instanceof Model&&(c.dispose(),e.modelScene.remove(c))}e.needsRender=!0,e.modelSceneNeedsRender=!0,worksMap.delete(e);var p=parseWork(null),f=new Model(p);f.work=p,worksMap.set(e,createWorks([p])),e.currentMode="Mapview",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:DEFAULT_CAMERA_FOV,longitude:0,latitude:0,offset:new THREE__namespace.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,o,s,u){var l=this;return r===void 0&&(r={}),s===void 0&&(s=!0),u===void 0&&(u=!1),new Promise(function(c,p){var f,d,h,m;if(!l.renderer)throw new Error("renderer is not initialized.");r=__assign({},r);var A=0;l.controller&&(typeof o=="number"?A=o:A=(f=o==null?void 0:o.duration)!==null&&f!==void 0?f:l.modeChangeDuration);var g="fly";l.controller&&typeof o=="object"&&o.effect&&(g=o.effect);var E=typeof r.panoIndex=="number"?{workCode:(m=(d=r.workCode)!==null&&d!==void 0?d:(h=l.work)===null||h===void 0?void 0:h.workCode)!==null&&m!==void 0?m:"",panoIndex:r.panoIndex}:l.pano;if(!t.Mode.hasOwnProperty(e)){var v=new Error('mode "'.concat(e,'" is not existed'));l.throwError(v),p(v);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!l.works.getObserver(E)){var v=new Error("PanoId ".concat(panoStringify(E)," not existed."));l.throwError(v),p(v);return}(e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(l.modelScene.loaded||(A=0));var y=l.controller,b=l.currentMode,T=function(){if(l.controller&&l.controller.stopMomentumMovement(),l.controller&&u===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?!panoEqual(l.pano,E)&&"moveToPano"in l.controller&&typeof l.controller.moveToPano=="function"?l.controller.moveToPano(E,__assign({duration:A},r),s):l.controller.updateCamera(r,A,s).catch(noop):(panoEqual(l.pano,E)||(l.pano=E),l.controller.updateCamera(r,A,s).catch(noop));else{var S=__assign(__assign({},r),E),w=__assign(__assign({initial:{state:S,currentState:l.getCurrentState(),duration:A,effect:g,userAction:s}},l.commonParams()),l.controllerInits[e]),R=Controllers[e].initAnimationEndState(w),M=createEvent("mode.change.request",{prevMode:l.currentMode,mode:e,state:R,userAction:s});if(l.emit("mode.change.request",M),!M.defaultPrevented){y&&y.destroy(),l.controller=l.applyController(e,w);var B=createEvent("mode.change",{prevMode:l.currentMode,mode:e,state:R,userAction:s});l.emit("mode.change",B)}}c()};if(e===t.Mode.VRPanorama)l.requestFullscreen(),requestDeviceOrientationPermission().then(function(){return T()}).catch(function(S){var w=S instanceof Error?S:new Error(String(S));l.exitFullscreen(),l.throwError(w),p(w)});else if(e===t.Mode.XRPanorama){var _=AnimationFrameLoop.shared.getContext();_?_.end():requestXRSessionPermission().then(function(S){AnimationFrameLoop.shared.setContext(S),T()}).catch(function(S){var w=S instanceof Error?S:new Error(String(S));l.throwError(w),p(w)})}else T()})},t.prototype.getPixels=function(e,r,o,s,u,l,c){if(!this.renderer)throw new Error("renderer is not initialized.");var p=this.renderer.getPixelRatio(),f=this.renderer.getRenderTarget(),d=this.renderer.getSize(new THREE__namespace.Vector2),h=0,m=0,A=1,g=1,E,v,y,b,T;typeof e=="number"?(h=e,typeof r=="number"&&(m=r),typeof o=="number"&&(A=o),typeof s=="number"&&(g=s),E=u,v=l,T=c):(h=e.x,m=e.y,A=e.width,g=e.height,E=e.pixelRatio,v=e.flipY,y=e.helperVisible,b=e.skipPanorama,T=e.buffer),h=Math.ceil(h),m=Math.ceil(m),A=Math.ceil(A),g=Math.ceil(g),E=Math.ceil(E!=null?E:p),v=v!=null?v:!1;var _=this.helperVisible,S=this.modelScene.parameter.modelAlpha;this.helperVisible=y!=null?y:this.helperVisible,b&&(this.controller instanceof Controllers.Panorama||this.controller instanceof Controllers.VRPanorama||this.controller instanceof Controllers.XRPanorama)&&b===!0&&this.modelScene.parameter.set("modelAlpha",1),this.modelScene.update(this.renderer,this.camera);var w=this.getPixelsRenderTarget;w.setSize(A*E,g*E),this.renderer.setRenderTarget(w),this.camera.pixelRatio=E,this.camera.resolution.set(A,g),this.camera.setViewOffset(d.width,d.height,h,d.height-m-g,A,g),this.scene.update(this.renderer,this.camera),this.render(),this.helperVisible=_,S===void 0?this.modelScene.parameter.reset("modelAlpha"):this.modelScene.parameter.set("modelAlpha",S),this.renderer.setRenderTarget(f),this.camera.clearViewOffset(),this.camera.pixelRatio=p,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,this.modelScene.update(this.renderer,this.camera),this.scene.update(this.renderer,this.camera);var R=A*E,M=g*E,B=R*M,C=B*4;if(T){if(T.length!==C)throw new Error("buffer length is not equals pixels ".concat(C))}else T=new Uint8Array(C);if(this.renderer.readRenderTargetPixels(w,0,0,A*E,g*E,T),v)for(var I=B/2,L=0,O=0,F=0,N=0;O<I;O++)for(N=(M-Math.floor(O/R)-1)*R+O%R,F=0;F<4;F++)L=T[O*4+F],T[O*4+F]=T[N*4+F],T[N*4+F]=L;return T},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},t.prototype.render=function(e){var r=this.renderer;if(r){var o=r.getRenderTarget(),s=r.autoClear,u=r.autoClearColor,l=r.autoClearDepth,c=r.autoClearStencil,p=scratchClearColor.copy(r.getClearColor()),f=r.getClearAlpha(),d=r.getViewport(scratchViewport),h=r.getScissor(scratchScissor),m=r.getScissorTest(),A=r.getSize(scratchRenderSize),g=r.getPixelRatio(),E=Math.floor(A.x*this.viewport.left),v=Math.floor(A.y*this.viewport.bottom),y=Math.floor(A.x*this.viewport.width),b=Math.floor(A.y*this.viewport.height);r.setClearColor(this.backgroundColor,this.backgroundAlpha),r.setViewport(E,v,y,b),r.setScissor(E,v,y,b);var T=this.viewport.bottom!==0||this.viewport.left!==0||this.viewport.width!==1||this.viewport.height!==1;r.setScissorTest(T);var _=this.scene.background;this.modelScene.background=this.camera.isOrthographicCamera?null:_,this.modelScene.environment=this.scene.environment,this.scene.background=null;var S=this.getBuiltinRenderer(r);S.setSize(A.x,A.y,g),this.controller?this.controller.render(S,this.onlyRenderIfNeeds?this.modelSceneNeedsRender:!0):S.render(this.onlyRenderIfNeeds?this.modelSceneNeedsRender:!0),this.scene.background=_,this.modelScene.background=null,this.modelScene.environment=null,this.poweredByRealsee&&this.currentMode!=="VRPanorama"&&this.currentMode!=="XRPanorama"&&r.getRenderTarget()!==this.getPixelsRenderTarget&&renderPoweredByRealsee(r),r.setRenderTarget(o),r.autoClear=s,r.autoClearColor=u,r.autoClearDepth=l,r.autoClearStencil=c,r.setClearColor(p,f),r.setViewport(d),r.setScissor(h),r.setScissorTest(m),e&&AnimationFrameLoop.shared.add(e,!0)}},t.prototype.updateTime=function(e,r){for(var o,s=this,u=[],l=2;l<arguments.length;l++)u[l-2]=arguments[l];if(this.currentUpdateArgs={time:e,args:u},!this.destroyed){if(this.renderer&&ktx2.detectSupport(this.renderer),this.syncingState=this.syncState(e,r),this.controller&&(o=this.controller).updateTime.apply(o,__spreadArray([e,r],u,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.autoNearFar){scratchBox3.makeEmpty(),scratchBox3.expandByObject(this.boundingMesh);var c=scratchBox3.getBoundingSphere(scratchSphere),p=c.radius*2;c.containsPoint(this.camera.position)||(p=this.camera.position.distanceTo(c.center)+c.radius),p=clamp$1(p,800);var f=p/1e4;f=clamp$1(f,.03,.1),this.camera.near!==f&&(this.camera.near=f),this.camera.far!==p&&(this.camera.far=p)}if(this.camera.controllerMode=this.currentMode,this.camera.updateTime(e),this.renderer){var d=this.modelScene.loaded,h=this.modelScene.refined;if(this.modelScene.loaded){for(var m=[],A=0,g=this.modelScene.children;A<g.length;A++){var E=g[A];E instanceof Model&&E.outdated&&m.push(E)}for(var v=0,y=m;v<y.length;v++){var b=y[v];this.modelScene.remove(b),b.dispose()}if(m.length>0)for(var T=0,_=this.modelScene.children;T<_.length;T++){var E=_[T];E instanceof Model&&(E.visible=!0,this.modelSceneNeedsRender=!0)}}this.modelScene.update(this.renderer,this.camera),d===!1&&this.modelScene.loaded===!0&&(this.controller&&this.controller.updateModel(this.modelScene),AnimationFrameLoop.shared.add(function(){s.emit("models.load",createEvent("models.load",{modelScene:s.modelScene}))},!0,0,10)),h===!1&&this.modelScene.refined===!0&&AnimationFrameLoop.shared.add(function(){s.emit("models.refined",createEvent("models.refined",{modelScene:s.modelScene}))},!0,0,10)}this.renderer&&this.scene.update(this.renderer,this.camera),this.syncingState=!1,this.controller&&(this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.controller.modelSceneNeedsRender===!0&&(this.controller.modelSceneNeedsRender=!1,this.modelSceneNeedsRender=!0)),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.modelScene.needsRender===!0&&(this.modelScene.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.scene.needsRender===!0&&(this.scene.needsRender=!1,this.needsRender=!0),this.onlyRenderIfNeeds!==!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0),this.modelSceneNeedsRender===!0&&(this.needsRender=!0);var S=this.camera.resolution.width*this.camera.pixelRatio*this.camera.resolution.height*this.camera.pixelRatio;S>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderSwitch01!==0&&(this.needsRender=!1),this.paused===!0&&(this.needsRender=!1);var w=createEvent("render.prepare",{needsRender:this.needsRender});this.emit("render.prepare",w),w.defaultPrevented&&(this.needsRender=!1);var R=this.needsRender;this.renderer&&R&&this.render(),this.needsRender=!1,this.modelSceneNeedsRender=!1,this.emit("render",createEvent("render",{needsRender:R})),this.hasListener("fps")&&(this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0))}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof InternalWebGLRenderer&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,o){r===void 0&&(r={}),o===void 0&&(o=!0);var s=this,u=s.controller,l=s.renderer;if(!u)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!l)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var c=this.works.getObserver(e);if(!c)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var p={workCode:c.work.workCode,panoIndex:c.panoIndex};return"moveToPano"in u&&typeof u.moveToPano=="function"?u.moveToPano(p,r,o):c&&(this.pano=p,this.once("initAnimation.start",function(f){r.moveStartCallback&&r.moveStartCallback(f.state)}),this.once("initAnimation.end",function(f){r.moveEndCallback&&r.moveEndCallback(f.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},o)),this.ready()},t.prototype.preloadPano=function(e,r){var o=this;r===void 0&&(r=noop);var s=this.works.getObserver(e);if(!s)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var u=["right","left","up","down","front","back"],l=now();return Promise.all(u.map(function(c){var p=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode}),f=__assign({key:"pano.".concat(p,".").concat(c)},pick(o.imageOptions,["size","format","quality","forceUseExifOrientation","mappings"])),d=s.work.getURL(s.images[c]),h=o.imageOptions.transform?o.imageOptions.transform(d,f):imageURL(d,f);return getFetcher(s.work).preload(h)})).then(function(){var c=now()-l;return r(c),c})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var o=this.camera.position,s=e.clone().sub(o),u=new THREE__namespace.Raycaster(o,s.clone().normalize());u.params.Points={threshold:.1};var l=this.modelScene.intersectRaycaster(u)[0];if(l&&l.distance+.01<s.length())return null}var c=e.clone().project(this.camera);if(Math.abs(c.z)>1)return null;var p=this.renderer.getSize(new THREE__namespace.Vector2),f=p.x*this.viewport.width,d=p.y*this.viewport.height,h=p.x*this.viewport.left+(c.x+1)/2*f,m=p.y*(1-this.viewport.bottom-this.viewport.height)+(-c.y+1)/2*d;return new THREE__namespace.Vector2(h,m)},t.prototype.getCurrentState=function(){return __assign(__assign({},this.camera.copyPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,o){var s,u,l,c,p,f,d,h,m,A;r===void 0&&(r=!1),o===void 0&&(o=!0),e=pick(e,["mode","workCode","panoIndex","longitude","latitude","fov","offset","distance"]),e.offset&&!(e instanceof THREE__namespace.Vector3)&&(e.offset=new THREE__namespace.Vector3(e.offset.x,e.offset.y,e.offset.z));var g;if(typeof e.panoIndex=="number")if(e.workCode)g={workCode:e.workCode,panoIndex:e.panoIndex};else{var E=(u=(s=this.work)===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",v=this.state.workCode;this.works.filter(function(I){return I.workCode===v}).length>0&&(E=v),g={workCode:E,panoIndex:e.panoIndex}}var y=(l=e.mode)!==null&&l!==void 0?l:this.state.mode,b,T,_,S,w;if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==y){if(y==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var R={workCode:g==null?void 0:g.workCode,panoIndex:g==null?void 0:g.panoIndex};typeof e.longitude=="number"&&(R.longitude=e.longitude),typeof e.latitude=="number"&&(R.latitude=e.latitude),typeof e.fov=="number"&&(R.fov=e.fov),typeof e.distance=="number"&&(R.distance=e.distance),e.offset instanceof THREE__namespace.Vector3&&(R.offset=e.offset);var M=__assign(__assign({initial:{state:R,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[y]),B=Controllers[y].initAnimationEndState(M);b=B.longitude,T=B.latitude,_=B.fov,S=B.offset,w=B.distance}else b=(c=e.longitude)!==null&&c!==void 0?c:this.state.longitude,T=(p=e.latitude)!==null&&p!==void 0?p:this.state.latitude,_=(f=e.fov)!==null&&f!==void 0?f:this.state.fov,S=(d=e.offset)!==null&&d!==void 0?d:this.state.offset,w=(h=e.distance)!==null&&h!==void 0?h:this.state.distance;var C={workCode:(g!=null?g:this.pano).workCode,panoIndex:(g!=null?g:this.pano).panoIndex,mode:y,longitude:b,latitude:T,fov:_,offset:S,distance:w};this.emit("state.set",createEvent("state.set",{userAction:o,state:C})),stateEqual(this.state,C)||(this.controller&&C.mode==="VRPanorama"&&C.mode!==this.state.mode?(assignState(this.state,C),this.changeMode("VRPanorama")):this.controller&&C.mode==="XRPanorama"&&C.mode!==this.state.mode?(assignState(this.state,C),this.changeMode("XRPanorama")):(assignState(this.state,C),this.controller&&o&&(this.controller.userAction=!1),r&&this.state.mode===C.mode&&(this.syncingState=this.syncState(now(),0,r),this.syncingState&&((m=this.controller)===null||m===void 0||m.updateTime(now(),0),this.syncingState=!1)),this.emit("state.change",createEvent("state.change",{userAction:o,state:this.state})),(A=this.analysis)===null||A===void 0||A.state(this.works,this.state)))},t.prototype.syncState=function(e,r,o){o===void 0&&(o=!1);var s=this.stateSynced;if(this.stateSynced=!1,!this.controller)return!1;if(this.state.mode!==this.currentMode){var u={mode:this.state.mode,workCode:this.state.workCode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,u,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof Controllers.Model){if(notSimilarVector3(this.camera.pose.offset,this.state.offset)){var l={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,__assign(__assign({},l),{duration:o?0:void 0}),!1),!0}}else{var c={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!panoEqual(c,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var l={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(c,l,!1),!0}}if(this.controller instanceof Controllers.Floorplan||this.controller instanceof Controllers.Topview||this.controller instanceof Controllers.Mapview){var p=1,f=.2,d=.2,h=Math.PI/45,m=o?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,p),A=Math.abs(this.camera.pose.distance-this.state.distance),g=A>d*15?A/15:f,E=o?this.state.distance:stepNumber(this.camera.pose.distance,this.state.distance,g),v=this.camera.pose.offset.distanceTo(this.state.offset),y=v>d*15?v/15:d,b=o?new THREE__namespace.Vector3().copy(this.state.offset):stepVector(this.camera.pose.offset,this.state.offset,y),T=o?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},h),_=T.longitude,S=T.latitude;if(notSimilarValue(m,this.camera.pose.fov)||notSimilarVector3(b,this.camera.pose.offset)||notSimilarValue(E,this.camera.pose.distance)||notSimilarValue(_,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(S,this.camera.pose.latitude)){var w={x:b.x,y:b.y,z:b.z},R={fov:m};return Object.assign(w,{distance:E}),Object.assign(R,{longitude:_,latitude:S}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(R,0).catch(noop),this.controller.locationMotion.set(w,0).catch(noop),!0}}else{var M=1,B=Math.PI/45,m=o?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,M),C=o?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},B),_=C.longitude,S=C.latitude,E=this.state.distance,b=new THREE__namespace.Vector3().copy(this.state.offset);if(notSimilarValue(E,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),notSimilarVector3(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),notSimilarValue(_,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(S,this.camera.pose.latitude)||notSimilarValue(m,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:_,latitude:S,fov:m},0).catch(noop),!0}if(this.stateSynced=!0,s===!1&&this.emit("state.synced",createEvent("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var I=this.currentMode,L=I===t.Mode.Floorplan||I===t.Mode.Topview||I===t.Mode.Mapview||I===t.Mode.Model;if(!L||this.modelScene.loaded){var O=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var F=0,N=O;F<N.length;F++){var D=N[F];this.controller instanceof Controllers.Panorama&&D.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(D):D()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(o){var s;r.readyCallbacks.push(Object.assign(o,{tile:(s=e.tile)!==null&&s!==void 0?s:!1}))}).then(function(){return r.model.initReady})},t.prototype.requestFullscreen=function(){var e;if(isMobile){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModels=function(e,r){for(var o=this,s,u,l,c,p,f,d=new Map,h=!1,m=[],A=0,g=this.modelScene.children;A<g.length;A++){var E=g[A];E instanceof Model&&(E.outdated=!0,d.set(E.work.workCode,E),h=!0)}for(var v=function(T){var _=e[T],S=_.workCode&&d.get(_.workCode);if(S)S.work=_,S.outdated=!1,d.delete(_.workCode),m.push(S);else{var w=(l=(u=(s=r.model)===null||s===void 0?void 0:s.textureOptions)!==null&&u!==void 0?u:r.textureOptions)!==null&&l!==void 0?l:y.textureOptions,R=(p=(c=r.model)===null||c===void 0?void 0:c["3d-tiles"])!==null&&p!==void 0?p:r["3d-tiles"],M=new Model(_,{light:(f=r.model)===null||f===void 0?void 0:f.light,textureOptions:w});M.initReady.then(function(){if(R)if(typeof R=="function")for(var O=0,F=M.viewLayers;O<F.length;O++){var N=F[O],D=R(N,M,T);D&&(D.viewerRequestVolume&&(N.viewerRequestVolume=makeBoundingVolume(D.viewerRequestVolume)),N.parameter.set(omit(D,["showLayers"])),D.showLayers===!1?N.visible=!1:Array.isArray(D.showLayers)&&(N.visible=D.showLayers.includes(N.name)))}else for(var q=0,z=M.viewLayers;q<z.length;q++){var N=z[q];R.viewerRequestVolume&&(N.viewerRequestVolume=makeBoundingVolume(R.viewerRequestVolume)),N.parameter.set(omit(R,["showLayers"])),R.showLayers===!1?N.visible=!1:Array.isArray(R.showLayers)&&(N.visible=R.showLayers.includes(N.name))}}),m.push(M),h&&(M.visible=!1),y.modelScene.add(M);var B=function(){AnimationFrameLoop.shared.add(function(){o.emit("model.load",createEvent("model.load",{work:_,model:M,error:null}))},!0)},C=function(O){var F=O.error;o.emit("model.error",createEvent("model.error",{work:_,model:M,error:F})),o.throwError(F)},I=function(){o.emit("model.changeShownFloor",createEvent("model.changeShownFloor",{work:_,model:M,error:null}))},L=function(){M.removeEventListener("load",B),M.removeEventListener("error",C),M.removeEventListener("changeShownFloor",I),M.removeEventListener("dispose",L)};M.addEventListener("load",B),M.addEventListener("error",C),M.addEventListener("changeShownFloor",I),M.addEventListener("dispose",L),y.emit("model.request",createEvent("model.request",{work:_,model:M,error:null}))}},y=this,b=0;b<e.length;b++)v(b);return this.modelScene.loaded=!1,this.modelScene.refined=!1,m},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,viewport:this.viewport,element:this.getElement(),works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene}},t.prototype.applyController=function(e,r){var o=this;if(!this.renderer)throw new Error("renderer is not initialized.");var s=Controllers[e];this.currentMode=e;for(var u=new s(r),l=function(m){u.on(m,function(){for(var A=[],g=0;g<arguments.length;g++)A[g]=arguments[g];var E=o.emit.apply(o,__spreadArray([m],A,!1));if(E)return!1})},c=0,p=PROXY_CONTROLLER_EVENT_NAMES;c<p.length;c++){var f=p[c];l(f)}{var d=Controllers[e].initAnimationEndState(r),h=r.initial.userAction;stateEqual(this.state,d)||(assignState(this.state,d),this.emit("state.change",createEvent("state.change",{userAction:h,state:this.state}))),this.emit("currentState.change",createEvent("currentState.change",{userAction:h,state:this.getCurrentState()}))}return u.on("camera.update",function(m){var A;if(o.controller){var g=o.controller.getTargetState();m.userAction&&o.syncingState===!1&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:m.userAction,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}o.emit("currentState.change",createEvent("currentState.change",{userAction:m.userAction,state:o.getCurrentState()}))}),u.on("initAnimation.start",function(m){var A,g=m.state,E=m.userAction;E&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("initAnimation.end",function(m){var A,g=m.state,E=m.userAction;o.pano={workCode:g.workCode,panoIndex:g.panoIndex},E&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.moveTo",function(m){var A,g=m.state,E=m.userAction;o.pano={workCode:g.workCode,panoIndex:g.panoIndex},E&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.arrived",function(m){var A,g=m.state,E=m.userAction;o.pano={workCode:g.workCode,panoIndex:g.panoIndex},E&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.cancel",function(m){var A,g=m.state,E=m.userAction;E&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.moveTo",function(m){var A=m.userAction;o.emit("currentState.change",createEvent("currentState.change",{userAction:A,state:o.getCurrentState()}))}),u.on("pano.request",function(m){o.emit("pano.request",m),m.defaultPrevented||o.moveToPano(m.state,m.options,m.userAction)}),u.on("vr.requestExit",function(){o.currentMode===t.Mode.VRPanorama&&(o.exitFullscreen(),o.changeMode(t.Mode.Panorama))}),u.on("error",function(m){return o.throwError(m)}),u},t.prototype.removeEventListeners=function(){},Object.defineProperty(t.prototype,"internalLightsEnabled",{get:function(){var e=this.scene.children.find(function(r){return r.name==="internalLights"});return e?e.visible:!1},set:function(e){var r=this.scene.children.find(function(o){return o.name==="internalLights"});r&&(r.visible=e),r=this.modelScene.children.find(function(o){return o.name==="internalLights"}),r&&(r.visible=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scissor",{get:function(){return this.viewport},enumerable:!1,configurable:!0}),t.prototype.setScissor=function(e){return this.setViewport(e)},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,o=e.latitude,s=e.fov,u=e.offset,l=e.distance;return{longitude:r,latitude:o,fov:s,offset:u.clone(),distance:l}},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose(),r=e.longitude,o=e.latitude;return{longitude:r,latitude:o}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.pano.workCode&&this.controller&&this.works){var e=this.works.getObserver(this.pano);if(e){var r=new THREE__namespace.Object3D;r.matrix.copy(e.matrix).premultiply(e.work.transform),r.matrix.decompose(r.position,r.quaternion,r.scale),r.matrixAutoUpdate=!1;var o=new THREE__namespace.Vector3(0,0,-1);o.applyQuaternion(this.camera.quaternion);var s=r.quaternion.clone().inverse();o.applyQuaternion(s);var u=Math.atan2(o.x,-o.z),l=-Math.asin(o.y);return{theta:u,phi:l,lookAtVector:o}}}return null},Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this.renderEffect==="edl"},set:function(e){this.renderEffect=e?"edl":"default"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this.renderEffect==="hq"},set:function(e){this.renderEffect=e?"hq":"default"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t})(Subscribe),__FIVE_DEBUG__={constructor:Five,THREE:THREE__namespace,instances:{}};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__});var XRButton=(function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function o(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function s(){o(),e.textContent="VR NOT SUPPORTED"}function u(c){c.style.position="absolute",c.style.bottom="20px",c.style.padding="12px 6px",c.style.border="1px solid #fff",c.style.borderRadius="4px",c.style.background="rgba(0,0,0,0.1)",c.style.color="#fff",c.style.font="normal 13px sans-serif",c.style.textAlign="center",c.style.opacity="0.5",c.style.outline="none",c.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",u(e),navigator.xr.isSessionSupported("immersive-vr").then(function(c){c?r():s()}),e;var l=document.createElement("a");return window.isSecureContext===!1?(l.href=document.location.href.replace(/^http:/,"https:"),l.innerHTML="WEBXR NEEDS HTTPS"):(l.href="https://immersiveweb.dev/",l.innerHTML="WEBXR NOT AVAILABLE"),l.style.left="calc(50% - 90px)",l.style.width="180px",l.style.textDecoration="none",u(l),l},n})();exports.AnimationFrameLoop=AnimationFrameLoop,exports.Camera=Camera,exports.CustomShader=PBMCustomShader,exports.Fetcher=Fetcher,exports.Five=Five,exports.InternalWebGLRenderer=InternalWebGLRenderer,exports.Model=Model,exports.ModelScene=ModelScene,exports.Motion=Motion,exports.NetworkSubscribe=NetworkSubscribe,exports.PBMContainer=PBMContainer,exports.PBMCustomShader=PBMCustomShader,exports.PBMGroup=PBMGroup,exports.PBMMesh=PBMMesh,exports.PBMMeshMaterial=PBMMeshMaterial,exports.PBMPointCloud=PBMPointCloud,exports.PBMPointCloudMaterial=PBMPointCloudMaterial,exports.PBMSkinnedMesh=PBMSkinnedMesh,exports.PROXY_CONTROLLER_EVENT_NAMES=PROXY_CONTROLLER_EVENT_NAMES,exports.PanoCircleMesh=PanoCircleMesh,exports.PanoCircleMeshCustom=PanoCircleMeshCustom,exports.PanoCircleMeshSolid=PanoCircleMeshSolid,exports.Parameter=Parameter,exports.Scene=Scene,exports.Subscribe=Subscribe,exports.TextureLoader=TextureLoader,exports.Tile=Tile,exports.Tile3D=Tile3D,exports.Tile3DModel=Tile3D,exports.TileCache=TileCache,exports.TileNode=TileNode,exports.TileRequestScheduler=TileRequestScheduler,exports.Tileset=Tileset,exports.Trajectory=Trajectory,exports.TrajectoryNode=TrajectoryNode,exports.Work=Work,exports.WorkResolvedObserver=WorkResolvedObserver,exports.XRButton=XRButton,exports.controllersDefaultInitArgs=controllersDefaultInitArgs,exports.coordinatesToVector=coordinatesToVector,exports.createDebugBoundingMesh=createDebugBoundingMesh,exports.createWorks=createWorks,exports.defaultImageURLTransform=imageURL,exports.draco=draco,exports.getViewportScale=getViewportScale,exports.headingToLongitude=headingToLongitude,exports.imageSupport=imageSupport,exports.isBoundingVolume=isBoundingVolume,exports.isPanoId=isPanoId,exports.ktx2=ktx2,exports.loadAt3d=loadAt3d,exports.loadB3dm=loadB3dm,exports.loadDome=loadDome,exports.loadDomez=loadDomez,exports.loadFbx=loadFbx,exports.loadGltf=loadGltf,exports.loadPbm=loadPbm,exports.loadPly=loadPly,exports.loadPnts=loadPnts,exports.loadX3p=loadX3p,exports.longitudeToHeading=longitudeToHeading,exports.makeBoundingVolume=makeBoundingVolume,exports.panoEqual=panoEqual,exports.panoParse=panoParse,exports.panoStringify=panoStringify,exports.parseWork=parseWork,exports.vectorToCoordinates=vectorToCoordinates,exports.workToJson=workToJson,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
|
|
2249
|
+
`})||this;return r.material.transparent=!0,r}return Object.defineProperty(t.prototype,"luminanceAdaptiveBuffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBuffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(e){this.material.uniforms.progress.value=e},enumerable:!1,configurable:!0}),t})(Pass),LuminanceAdaptiveEffect=(function(n){__extends(t,n);function t(e,r,o,s){var u=n.call(this,e,r,o,s)||this;return u.enableTime=now(),u.renderer=e,u.valuePass=new ValuePass(u.renderer),u.luminancePass=new LuminancePass(u.renderer,Math.sqrt(1/3)),u.nextStepPass=new NextStepPass(u.renderer,.01),u.luminanceAdaptivePass=new LuminanceAdaptivePass(u.renderer),u}return t.prototype.render=function(e){this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.enableTime===null&&(this.enableTime=now()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new THREE__namespace.WebGLRenderTarget(128,128,{minFilter:THREE__namespace.LinearMipmapLinearFilter,magFilter:THREE__namespace.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:THREE__namespace.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e[0],this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new THREE__namespace.WebGLRenderTarget(1,1,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,type:THREE__namespace.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new THREE__namespace.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new THREE__namespace.WebGLRenderTarget(1,1,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,type:THREE__namespace.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new THREE__namespace.Vector3(.5,.5,.5),this.luminanceNextBuffer),this.luminanceAdaptivePass.luminanceAdaptiveBuffer=this.luminanceNextBuffer.texture),this.copyPass.render(this.luminanceNextBuffer,this.luminancePrevBuffer),this.nextStepPass.render(this.luminancePrevBuffer,this.luminanceNextBuffer),this.luminanceAdaptivePass.progress=Math.min((now()-this.enableTime)/100,1),this.luminanceAdaptivePass.render(e[0],e[1])},t.prototype.dispose=function(){var e,r,o;(e=this.luminanceTargetBuffer)===null||e===void 0||e.dispose(),(r=this.luminancePrevBuffer)===null||r===void 0||r.dispose(),(o=this.luminanceNextBuffer)===null||o===void 0||o.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},t})(Effect),sharedV2=new THREE__namespace.Vector2,LuminanceRenderer=(function(n){__extends(t,n);function t(e){var r,o,s=n.call(this,e)||this;s.type="default",s.luminanceAdaptiveEffect=new LuminanceAdaptiveEffect(s.renderer,s.modelScene,s.camera,s.modelScene);var u=s.renderer.getDrawingBufferSize(sharedV2);return s.screenBuffers=[new THREE__namespace.WebGLRenderTarget(u.x,u.y,{generateMipmaps:!1,encoding:(o=(r=s.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&o!==void 0?o:THREE__namespace.sRGBEncoding}),s.enableFragDepth?s.modelRenderTarget:null],s}return t.prototype.render=function(e){var r=this.renderer.getRenderTarget();this.enableFragDepth?(e&&(this.luminanceAdaptiveEffect.enable=!0,this.luminanceAdaptiveEffect.render(this.screenBuffers)),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,r),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,r),this.renderer.setRenderTarget(r),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0):(this.luminanceAdaptiveEffect.enable=!0,this.luminanceAdaptiveEffect.render(this.screenBuffers),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0),this.modelScene.needsRender=!0},t})(BaseRenderer),DEFAULT_MODE_CHANGE_DURATION=1e3,DEFAULT_CAMERA_FOV=90,DEFAULT_REQUEST_PROXY=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/")},scratchSphere=new THREE__namespace.Sphere,scratchBox3=new THREE__namespace.Box3,scratchViewport=new THREE__namespace.Vector4,scratchScissor=new THREE__namespace.Vector4,scratchClearColor=new THREE__namespace.Color,scratchRenderSize=new THREE__namespace.Vector2,worksMap=new WeakMap,emptyWorks=createWorks([parseWork(null)]),Five=(function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,o,s,u,l,c,p,f,d,h,m,A,g=n.call(this)||this;if(g.ident=createUuid(),typeof window!="undefined"&&(__FIVE_DEBUG__.instances[g.ident]=g),g.renderSwitch01=0,g.currentUpdateArgs={time:now(),args:[]},g.currentMode="Panorama",g.pano={workCode:"",panoIndex:0},g.needsRender=!1,g.modelSceneNeedsRender=!1,g.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,g.imageOptions=__assign({},(o=e.imageOptions)!==null&&o!==void 0?o:{}),g.textureOptions=__assign({},(s=e.textureOptions)!==null&&s!==void 0?s:{}),g.poweredByRealsee=(u=e.poweredByRealsee)!==null&&u!==void 0?u:!0,g.backgroundColor=new THREE__namespace.Color((l=e.backgroundColor)!==null&&l!==void 0?l:1579548),g.backgroundAlpha=(c=e.backgroundAlpha)!==null&&c!==void 0?c:1,g.extraElements=[],g.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)},g.fps={testCount:0,testTime:now()},g.modeChangeDuration=(p=e.modeChangeDuration)!==null&&p!==void 0?p:DEFAULT_MODE_CHANGE_DURATION,g.enableWheel=(f=e.enableWheel)!==null&&f!==void 0?f:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof InternalWebGLRenderer&&g.throwError(new Error("cannot render a internal renderer")),g.renderer=e.renderer;else try{g.renderer=new InternalWebGLRenderer({preserveDrawingBuffer:e.preserveDrawingBuffer,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision,powerPreference:e.powerPreference});var E=getViewportScale();g.renderer.setPixelRatio(E===1?window.devicePixelRatio:1),g.renderer.setSize(512,512),g.renderer.setClearColor(g.backgroundColor,g.backgroundAlpha)}catch(O){var v=O instanceof Error?O:new Error(String(O));g.throwError(v)}g.getPixelsRenderTarget=new THREE__namespace.WebGLRenderTarget(1,1,{encoding:(h=(d=g.renderer)===null||d===void 0?void 0:d.outputEncoding)!==null&&h!==void 0?h:THREE__namespace.sRGBEncoding,generateMipmaps:!1}),g.viewport=Object.assign({left:0,bottom:0,width:1,height:1},e.viewport),g.camera=new Camera(DEFAULT_CAMERA_FOV),g.scene=new Scene,g.xrCustomObjectsScene=new THREE__namespace.Scene,g.scene.add(g.xrCustomObjectsScene),g.scene.matrixAutoUpdate=!1,g.loadWorkTask=Promise.resolve(),g.requestProxy=(m=e.requestProxy)!==null&&m!==void 0?m:DEFAULT_REQUEST_PROXY,g.networkSubscribe=new NetworkSubscribe,g.networkSubscribe.on("network",function(O,F,N,D){var q;g.emit("network.resource",createEvent("network.resource",{source:O,requestType:F,requestState:N,detail:D})),(q=g.analysis)===null||q===void 0||q.network(g.works,O,F,N,D)}),g.boundingMesh=new BoundingMesh$1,g.boundingMesh.name="bounding",g.readyCallbacks=[],g.syncingState=!1,g.helperGroup=new THREE__namespace.Group,g.helperGroup.name="helper",g.helperGroup.matrixAutoUpdate=!1,g.scene.add(g.helperGroup);var y=new Model(emptyWorks[0]);worksMap.set(g,emptyWorks),g.modelScene=new ModelScene,g.modelScene.add(y),g.modelScene.add(g.boundingMesh),defineProperty(y,"loaded",{get:function(){return!1},set:function(O){}}),g.videoTexture=new THREE__namespace.VideoTexture(e.videoInstance||generateDefaultVideoElement());var b=initLights();g.scene.add(b);var T=new THREE__namespace.Group;defineProperty(T,"children",{get:function(){return b.children},set:function(O){b.children=O}}),defineProperty(T,"visible",{get:function(){return b.visible},set:function(O){b.visible=O}}),defineProperty(T,"name",{get:function(){return b.name},set:function(O){b.name=O}}),g.modelScene.add(T),g.state={mode:g.currentMode,workCode:g.pano.workCode,panoIndex:g.pano.panoIndex,longitude:g.camera.pose.longitude,latitude:g.camera.pose.latitude,fov:g.camera.pose.fov,offset:g.camera.pose.offset.clone(),distance:g.camera.pose.distance},g.stateSynced=!1,g.destroyed=!1,g.paused=!0,typeof window!="undefined"&&(e.play!==!1&&g.play(),g.stopAnimationLoop=AnimationFrameLoop.shared.add(function(O,F){for(var N=[],D=2;D<arguments.length;D++)N[D-2]=arguments[D];g.updateTime.apply(g,__spreadArray([O,F],N,!1))},!1,0,10));var _=function(){typeof document!="undefined"&&document.fullscreenElement===null&&g.currentMode==="VRPanorama"&&g.controller.emit("vr.requestExit",createEvent("vr.requestExit",{}))},S=function(){g.needsRender=!0,g.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",_,!1),g.renderer&&g.renderer.domElement.addEventListener("webglcontextrestored",S,!1),g.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",_,!1),g.renderer&&g.renderer.domElement.removeEventListener("webglcontextrestored",S,!1)},g.plugins={},e.plugins&&e.plugins.length)for(var w=0,R=e.plugins;w<R.length;w++){var M=R[w];if(typeof M=="function")M(g);else if(Array.isArray(M)){var B=M[0],C=M[1],I=M[2];if(typeof B=="function"){var L=B(g,I);typeof C=="string"&&(g.plugins[C]?g.throwError(new Error("plugin name ".concat(C," is exists."))):g.plugins[C]=L)}}}return initLegacyEvent(g),g.enableLayeringRendering=(A=e.enableLayeringRendering)!==null&&A!==void 0?A:!1,g._buildInRendererType="default",g._builtinRenderer=null,g}return Object.defineProperty(t,"version",{get:function(){return"6.7.0-alpha.11"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return draco.decoderPath},set:function(e){draco.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return ktx2.transcoderPath},set:function(e){ktx2.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"useNativeImageBitmap",{get:function(){return canUseNativeImageBitmap()},set:function(e){useNativeImageBitmap(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){var e;if(this.destroyed!==!0){delete __FIVE_DEBUG__.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),this.stopAnimationLoop=void 0),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var r=this.getElement();r&&r.parentNode&&r.parentNode.removeChild(r);var o=this.modelScene.parameter;o.pano0&&o.pano0.map.dispose(),o.pano1&&o.pano1.map!==((e=o.pano0)===null||e===void 0?void 0:e.map)&&o.pano1.map.dispose(),o.reset("pano0","pano1");for(var s=0,u=this.modelScene.children.slice();s<u.length;s++){var l=u[s];l.dispose&&l.dispose(),this.modelScene.remove(l)}this.modelScene.dispose(),this.scene.dispose(),this.xrCustomObjectsScene.dispose(),worksMap.set(this,emptyWorks),this.renderer&&(this.renderer.render(new THREE__namespace.Scene,new THREE__namespace.Camera),this.renderer.setAnimationLoop(null)),this.renderer instanceof InternalWebGLRenderer&&(this.renderer.forceContextLoss&&this.renderer.forceContextLoss(),this.renderer.dispose())}},t.prototype.setViewport=function(e){Object.assign(this.viewport,e),this.needsRender=!0,this.modelSceneNeedsRender=!0},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpers.visible",createEvent("helpers.visible",{object:this.helperGroup})),this.needsRender=!0)},enumerable:!1,configurable:!0}),t.prototype.getBuiltinRenderer=function(e){var r=this._builtinRenderer;if((r==null?void 0:r.type)!==this._buildInRendererType)switch(r&&r.dispose(),this._buildInRendererType){case"default":this._builtinRenderer=new DefaultRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"edl":this._builtinRenderer=new EDLRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"hq":this._builtinRenderer=new HQRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"luminance":this._builtinRenderer=new LuminanceRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break}return this._builtinRenderer},Object.defineProperty(t.prototype,"renderEffect",{get:function(){return this._buildInRendererType},set:function(e){this._buildInRendererType=e,this.modelSceneNeedsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e,r){r===void 0&&(r=!0);var o=!1,s=!1;if(e.panorama&&(Object.assign(this.controllerInits.Panorama,omitUndefinedFields(e.panorama)),this.currentMode==="Panorama"&&(o=!0)),e.model&&(Object.assign(this.controllerInits.Model,omitUndefinedFields(e.model)),this.currentMode==="Model"&&(o=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,omitUndefinedFields(e.floorplan)),this.currentMode==="Floorplan"&&(o=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,omitUndefinedFields(e.topview)),this.currentMode==="Topview"&&(o=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,omitUndefinedFields(e.mapview)),this.currentMode==="Mapview"&&(o=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,omitUndefinedFields(e.vrPanorama)),this.currentMode==="VRPanorama"&&(o=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(s=!0,o=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&o&&this.controller&&this.currentMode){var u=this.controller.updateConfiguration(this.controllerInits[this.currentMode]);(!u||s)&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)}},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof InternalWebGLRenderer)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var o=this.getElement();if(o){e.appendChild(o),this.refresh(r);var s=window.getComputedStyle(e).position;s!=="relative"&&s!=="absolute"&&s!=="fixed"&&s!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){var o,s;if(e===void 0&&(e={}),!!this.renderer){var u=this.renderer.domElement,l=u.parentNode,c=e.width,p=c===void 0?(o=l==null?void 0:l.offsetWidth)!==null&&o!==void 0?o:512:c,f=e.height,d=f===void 0?(s=l==null?void 0:l.offsetHeight)!==null&&s!==void 0?s:512:f;r=r!=null?r:this.renderer.getPixelRatio();var h=this.renderer.capabilities.maxTextureSize,m=Math.max(p,d)*r;m>h&&(r=r/m*h,r=Math.floor(r*100)/100),this.renderer.setPixelRatio(r),this.renderer.setSize(p,d),this.needsRender=!0,this.modelSceneNeedsRender=!0;var A=now(),g=A-this.currentUpdateArgs.time,E=this.currentUpdateArgs.args;this.updateTime(A,g,E)}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.viewport.width,e.y*=this.viewport.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.viewport.width,e.y*=this.viewport.height,e},t.prototype.updateCamera=function(e,r,o){if(o===void 0&&(o=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCamera(e,r,o)},t.prototype.updateCameraWithKeyframes=function(e,r,o){if(o===void 0&&(o=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCameraWithKeyframes(e,r,o)},Object.defineProperty(t.prototype,"works",{get:function(){var e=worksMap.get(this);return e||emptyWorks},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"observers",{get:function(){return this.work.observers},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"models",{get:function(){return this.modelScene.models},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.modelScene.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,o,s){var u=this;if(s===void 0&&(s=!0),!this.renderer)throw new Error("renderer is not initialized");var l=this.loadWorkTask.then(function(){return isPromise(e)?e.then(function(c){return u.load_(c,r,o,s)}):u.load_(e,r,o,s)});return this.loadWorkTask=l.catch(function(c){u.throwError(c)}),l},t.prototype.load_=function(e,r,o,s){var u=this,l,c,p,f,d,h,m,A,g,E;s===void 0&&(s=!0);var v={};typeof o=="number"?v.duration=o:typeof o=="object"&&Object.assign(v,o),this.works===emptyWorks&&(v.duration===void 0&&(v.duration=0),v.effect===void 0&&(v.effect="instant"));var y=[];if(Array.isArray(e))for(var b=0,T=e;b<T.length;b++){var _=T[b];_ instanceof Work?y.push(_):typeof _!="string"&&"work"in _?y.push(parseWork(_.work,_)):y.push(parseWork(_))}else e instanceof Work?y.push(e):y.push(parseWork(e));for(var S=createWorks(y),w=function(X){var K=R,$=new Fetcher({get networkSubscribe(){return K.networkSubscribe},requestProxy:function(re){return Promise.resolve(re).then(function(ne){return K.requestProxy(ne)}).then(function(ne){var ae=verifyURL(ne,X.allowHosts);if(ae instanceof Error)throw ae;return ae})}});registerFetcher(X,$)},R=this,M=0,B=S;M<B.length;M++){var C=B[M];w(C)}r===void 0&&(r="inherit"),r==="inherit"&&this.works===emptyWorks&&(r="initial");var I=S.initial,L=I.work.observers[0],O=L?{workCode:L.work.workCode,panoIndex:L.panoIndex}:{workCode:I.work.workCode,panoIndex:0},F=(l=I.mode)!==null&&l!==void 0?l:L?"Panorama":"Mapview",N={};if(r==="inherit"){F=this.currentMode;var D=(p=(c=S[0])===null||c===void 0?void 0:c.observers)===null||p===void 0?void 0:p[this.panoIndex];D?O={workCode:D.work.workCode,panoIndex:D.panoIndex}:typeof S.initial.panoIndex=="number"?O={workCode:S.initial.work.workCode,panoIndex:S.initial.panoIndex}:(F==="Panorama"||F==="VRPanorama"||F==="XRPanorama")&&(F="Mapview"),N={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:void 0,offset:void 0}}else if(r==="initial")typeof I.panoIndex=="number"&&(O={workCode:I.work.workCode,panoIndex:I.panoIndex}),I.mode&&(F=I.mode),N={longitude:I.longitude,latitude:I.latitude,fov:I.fov,distance:I.distance,offset:(f=I.offset)===null||f===void 0?void 0:f.clone()};else{if(F=(d=r.mode)!==null&&d!==void 0?d:this.currentMode,typeof r.panoIndex=="number"){var D=S.getObserver({workCode:(m=(h=r.workCode)!==null&&h!==void 0?h:I.work.workCode)!==null&&m!==void 0?m:"",panoIndex:r.panoIndex});D&&(O={workCode:D.work.workCode,panoIndex:D.panoIndex})}N={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var q=__assign(__assign(__assign({},O),{mode:F}),N),z=this.getCurrentState(),j=(A=v.duration)!==null&&A!==void 0?A:this.modeChangeDuration;(F==="Floorplan"||F==="Topview"||F==="Mapview")&&this.currentMode===F&&(j=0);var J="fly";(F==="Panorama"||F==="VRPanorama"||F==="XRPanorama")&&this.currentMode===F&&(J=(g=v.effect)!==null&&g!==void 0?g:"fade"),this.emit("works.request",createEvent("works.request",{input:e,works:S,state:q,userAction:s}));var V=function(){u.pano=O;var X=__assign(__assign({initial:{state:q,currentState:z,duration:j,effect:J,userAction:s}},u.commonParams()),u.controllerInits[F]),K=Controllers[F].initAnimationEndState(X);if(u.controller&&u.currentMode===F)u.controller.updateWork(S,K,{effect:J,duration:j},s)===!1&&(u.controller.destroy(),u.controller=u.applyController(F,X));else{var $=u.currentMode;if(u.controller)u.controller.destroy();else{var re=Controllers[F].initAnimationEndState(X);u.camera.setFromPose(re),u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s}))}u.controller=u.applyController(F,X);var ne=createEvent("mode.change",{prevMode:$,mode:F,state:K,userAction:s});try{u.emit("mode.change",ne)}catch(ae){console.error(ae)}}u.updateTime(u.currentUpdateArgs.time,0,u.currentUpdateArgs.args)};worksMap.set(this,S);var U=Promise.resolve();if(F===t.Mode.Floorplan||F===t.Mode.Topview||F===t.Mode.Mapview||F===t.Mode.Model){this.modelScene.loaded===!1&&(this.camera.setFromPose(q),assignPose(this.state,this.camera.pose)),this.controller||(this.currentMode=F);var G=this.loadModels(S,v);U=Promise.all(G.map(function(X){return X.loadedReady})).then(function(){u.needsRender=!0,u.modelSceneNeedsRender=!0,V(),u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s}))})}else{V();var Z=this.controller,W=!1;this.modelScene.autoRefine=!1;var ee=function(){u.works===S&&W===!1&&(u.needsRender=!0,u.modelSceneNeedsRender=!0,u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s})),W=!0,u.modelScene.autoRefine=!0),Z.off("pano.arrived",ee),Z.off("pano.cancel",ee)},G=this.loadModels(S,v);U=Promise.all(G.map(function(K){return K.initReady})).then(noop),Z.once("pano.arrived",ee),Z.once("pano.cancel",ee),setTimeout(ee,((E=v.duration)!==null&&E!==void 0?E:this.modeChangeDuration)+1e3)}return this.emit("works.load",createEvent("works.load",{input:e,state:this.getCurrentState(),userAction:s,works:S})),U.then(function(){return u.ready()}).then(function(){var X;u.emit("works.ready",createEvent("works.ready",{input:e,state:u.getCurrentState(),userAction:s,works:S})),(X=u.analysis)===null||X===void 0||X.work(S)})},t.prototype.reset=function(){var e=this,r=this.loadWorkTask.then(function(){return e.reset_()});return this.loadWorkTask=r.catch(function(o){e.throwError(o)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var o;e.controller&&(e.controller.destroy(),e.controller=void 0);var s=e.modelScene.parameter;s.pano0&&s.pano0.map.dispose(),s.pano1&&s.pano1.map!==((o=s.pano0)===null||o===void 0?void 0:o.map)&&s.pano1.map.dispose(),s.set({pano0:null,pano1:null,modelAlpha:1}),e.renderer&&e.modelScene.update(e.renderer,e.camera);for(var u=0,l=e.modelScene.children;u<l.length;u++){var c=l[u];c instanceof Model&&(c.dispose(),e.modelScene.remove(c))}e.needsRender=!0,e.modelSceneNeedsRender=!0,worksMap.delete(e);var p=parseWork(null),f=new Model(p);f.work=p,worksMap.set(e,createWorks([p])),e.currentMode="Mapview",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:DEFAULT_CAMERA_FOV,longitude:0,latitude:0,offset:new THREE__namespace.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,o,s,u){var l=this;return r===void 0&&(r={}),s===void 0&&(s=!0),u===void 0&&(u=!1),new Promise(function(c,p){var f,d,h,m;if(!l.renderer)throw new Error("renderer is not initialized.");r=__assign({},r);var A=0;l.controller&&(typeof o=="number"?A=o:A=(f=o==null?void 0:o.duration)!==null&&f!==void 0?f:l.modeChangeDuration);var g="fly";l.controller&&typeof o=="object"&&o.effect&&(g=o.effect);var E=typeof r.panoIndex=="number"?{workCode:(m=(d=r.workCode)!==null&&d!==void 0?d:(h=l.work)===null||h===void 0?void 0:h.workCode)!==null&&m!==void 0?m:"",panoIndex:r.panoIndex}:l.pano;if(!t.Mode.hasOwnProperty(e)){var v=new Error('mode "'.concat(e,'" is not existed'));l.throwError(v),p(v);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!l.works.getObserver(E)){var v=new Error("PanoId ".concat(panoStringify(E)," not existed."));l.throwError(v),p(v);return}(e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(l.modelScene.loaded||(A=0));var y=l.controller,b=l.currentMode,T=function(){if(l.controller&&l.controller.stopMomentumMovement(),l.controller&&u===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?!panoEqual(l.pano,E)&&"moveToPano"in l.controller&&typeof l.controller.moveToPano=="function"?l.controller.moveToPano(E,__assign({duration:A},r),s):l.controller.updateCamera(r,A,s).catch(noop):(panoEqual(l.pano,E)||(l.pano=E),l.controller.updateCamera(r,A,s).catch(noop));else{var S=__assign(__assign({},r),E),w=__assign(__assign({initial:{state:S,currentState:l.getCurrentState(),duration:A,effect:g,userAction:s}},l.commonParams()),l.controllerInits[e]),R=Controllers[e].initAnimationEndState(w),M=createEvent("mode.change.request",{prevMode:l.currentMode,mode:e,state:R,userAction:s});if(l.emit("mode.change.request",M),!M.defaultPrevented){y&&y.destroy(),l.controller=l.applyController(e,w);var B=createEvent("mode.change",{prevMode:l.currentMode,mode:e,state:R,userAction:s});l.emit("mode.change",B)}}c()};if(e===t.Mode.VRPanorama)l.requestFullscreen(),requestDeviceOrientationPermission().then(function(){return T()}).catch(function(S){var w=S instanceof Error?S:new Error(String(S));l.exitFullscreen(),l.throwError(w),p(w)});else if(e===t.Mode.XRPanorama){var _=AnimationFrameLoop.shared.getContext();_?_.end():requestXRSessionPermission().then(function(S){AnimationFrameLoop.shared.setContext(S),T()}).catch(function(S){var w=S instanceof Error?S:new Error(String(S));l.throwError(w),p(w)})}else T()})},t.prototype.getPixels=function(e,r,o,s,u,l,c){if(!this.renderer)throw new Error("renderer is not initialized.");var p=this.renderer.getPixelRatio(),f=this.renderer.getRenderTarget(),d=this.renderer.getSize(new THREE__namespace.Vector2),h=0,m=0,A=1,g=1,E,v,y,b,T;typeof e=="number"?(h=e,typeof r=="number"&&(m=r),typeof o=="number"&&(A=o),typeof s=="number"&&(g=s),E=u,v=l,T=c):(h=e.x,m=e.y,A=e.width,g=e.height,E=e.pixelRatio,v=e.flipY,y=e.helperVisible,b=e.skipPanorama,T=e.buffer),h=Math.ceil(h),m=Math.ceil(m),A=Math.ceil(A),g=Math.ceil(g),E=Math.ceil(E!=null?E:p),v=v!=null?v:!1;var _=this.helperVisible,S=this.modelScene.parameter.modelAlpha;this.helperVisible=y!=null?y:this.helperVisible,b&&(this.controller instanceof Controllers.Panorama||this.controller instanceof Controllers.VRPanorama||this.controller instanceof Controllers.XRPanorama)&&b===!0&&this.modelScene.parameter.set("modelAlpha",1),this.modelScene.update(this.renderer,this.camera);var w=this.getPixelsRenderTarget;w.setSize(A*E,g*E),this.renderer.setRenderTarget(w),this.camera.pixelRatio=E,this.camera.resolution.set(A,g),this.camera.setViewOffset(d.width,d.height,h,d.height-m-g,A,g),this.scene.update(this.renderer,this.camera),this.render(),this.helperVisible=_,S===void 0?this.modelScene.parameter.reset("modelAlpha"):this.modelScene.parameter.set("modelAlpha",S),this.renderer.setRenderTarget(f),this.camera.clearViewOffset(),this.camera.pixelRatio=p,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,this.modelScene.update(this.renderer,this.camera),this.scene.update(this.renderer,this.camera);var R=A*E,M=g*E,B=R*M,C=B*4;if(T){if(T.length!==C)throw new Error("buffer length is not equals pixels ".concat(C))}else T=new Uint8Array(C);if(this.renderer.readRenderTargetPixels(w,0,0,A*E,g*E,T),v)for(var I=B/2,L=0,O=0,F=0,N=0;O<I;O++)for(N=(M-Math.floor(O/R)-1)*R+O%R,F=0;F<4;F++)L=T[O*4+F],T[O*4+F]=T[N*4+F],T[N*4+F]=L;return T},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},t.prototype.render=function(e){var r=this.renderer;if(r){var o=r.getRenderTarget(),s=r.autoClear,u=r.autoClearColor,l=r.autoClearDepth,c=r.autoClearStencil,p=scratchClearColor.copy(r.getClearColor()),f=r.getClearAlpha(),d=r.getViewport(scratchViewport),h=r.getScissor(scratchScissor),m=r.getScissorTest(),A=r.getSize(scratchRenderSize),g=r.getPixelRatio(),E=Math.floor(A.x*this.viewport.left),v=Math.floor(A.y*this.viewport.bottom),y=Math.floor(A.x*this.viewport.width),b=Math.floor(A.y*this.viewport.height);r.setClearColor(this.backgroundColor,this.backgroundAlpha),r.setViewport(E,v,y,b),r.setScissor(E,v,y,b);var T=this.viewport.bottom!==0||this.viewport.left!==0||this.viewport.width!==1||this.viewport.height!==1;r.setScissorTest(T);var _=this.scene.background;this.modelScene.background=this.camera.isOrthographicCamera?null:_,this.modelScene.environment=this.scene.environment,this.scene.background=null;var S=this.getBuiltinRenderer(r);S.setSize(A.x,A.y,g),this.controller?this.controller.render(S,this.onlyRenderIfNeeds?this.modelSceneNeedsRender:!0):S.render(this.onlyRenderIfNeeds?this.modelSceneNeedsRender:!0),this.scene.background=_,this.modelScene.background=null,this.modelScene.environment=null,this.poweredByRealsee&&this.currentMode!=="VRPanorama"&&this.currentMode!=="XRPanorama"&&r.getRenderTarget()!==this.getPixelsRenderTarget&&renderPoweredByRealsee(r),r.setRenderTarget(o),r.autoClear=s,r.autoClearColor=u,r.autoClearDepth=l,r.autoClearStencil=c,r.setClearColor(p,f),r.setViewport(d),r.setScissor(h),r.setScissorTest(m),e&&AnimationFrameLoop.shared.add(e,!0)}},t.prototype.updateTime=function(e,r){for(var o,s=this,u=[],l=2;l<arguments.length;l++)u[l-2]=arguments[l];if(this.currentUpdateArgs={time:e,args:u},!this.destroyed){if(this.renderer&&ktx2.detectSupport(this.renderer),this.syncingState=this.syncState(e,r),this.controller&&(o=this.controller).updateTime.apply(o,__spreadArray([e,r],u,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.autoNearFar){scratchBox3.makeEmpty(),scratchBox3.expandByObject(this.boundingMesh);var c=scratchBox3.getBoundingSphere(scratchSphere),p=c.radius*2;c.containsPoint(this.camera.position)||(p=this.camera.position.distanceTo(c.center)+c.radius),p=clamp$1(p,800);var f=p/1e4;f=clamp$1(f,.03,.1),this.camera.near!==f&&(this.camera.near=f),this.camera.far!==p&&(this.camera.far=p)}if(this.camera.controllerMode=this.currentMode,this.camera.updateTime(e),this.renderer){var d=this.modelScene.loaded,h=this.modelScene.refined;if(this.modelScene.loaded){for(var m=[],A=0,g=this.modelScene.children;A<g.length;A++){var E=g[A];E instanceof Model&&E.outdated&&m.push(E)}for(var v=0,y=m;v<y.length;v++){var b=y[v];this.modelScene.remove(b),b.dispose()}if(m.length>0)for(var T=0,_=this.modelScene.children;T<_.length;T++){var E=_[T];E instanceof Model&&(E.visible=!0,this.modelSceneNeedsRender=!0)}}this.modelScene.update(this.renderer,this.camera),d===!1&&this.modelScene.loaded===!0&&(this.controller&&this.controller.updateModel(this.modelScene),AnimationFrameLoop.shared.add(function(){s.emit("models.load",createEvent("models.load",{modelScene:s.modelScene}))},!0,0,10)),h===!1&&this.modelScene.refined===!0&&AnimationFrameLoop.shared.add(function(){s.emit("models.refined",createEvent("models.refined",{modelScene:s.modelScene}))},!0,0,10)}this.renderer&&this.scene.update(this.renderer,this.camera),this.syncingState=!1,this.controller&&(this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.controller.modelSceneNeedsRender===!0&&(this.controller.modelSceneNeedsRender=!1,this.modelSceneNeedsRender=!0)),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.modelScene.needsRender===!0&&(this.modelScene.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.scene.needsRender===!0&&(this.scene.needsRender=!1,this.needsRender=!0),this.onlyRenderIfNeeds!==!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0),this.modelSceneNeedsRender===!0&&(this.needsRender=!0);var S=this.camera.resolution.width*this.camera.pixelRatio*this.camera.resolution.height*this.camera.pixelRatio;S>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderSwitch01!==0&&(this.needsRender=!1),this.paused===!0&&(this.needsRender=!1);var w=createEvent("render.prepare",{needsRender:this.needsRender});this.emit("render.prepare",w),w.defaultPrevented&&(this.needsRender=!1);var R=this.needsRender;this.renderer&&R&&this.render(),this.needsRender=!1,this.modelSceneNeedsRender=!1,this.emit("render",createEvent("render",{needsRender:R})),this.hasListener("fps")&&(this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0))}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof InternalWebGLRenderer&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,o){r===void 0&&(r={}),o===void 0&&(o=!0);var s=this,u=s.controller,l=s.renderer;if(!u)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!l)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var c=this.works.getObserver(e);if(!c)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var p={workCode:c.work.workCode,panoIndex:c.panoIndex};return"moveToPano"in u&&typeof u.moveToPano=="function"?u.moveToPano(p,r,o):c&&(this.pano=p,this.once("initAnimation.start",function(f){r.moveStartCallback&&r.moveStartCallback(f.state)}),this.once("initAnimation.end",function(f){r.moveEndCallback&&r.moveEndCallback(f.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},o)),this.ready()},t.prototype.preloadPano=function(e,r){var o=this;r===void 0&&(r=noop);var s=this.works.getObserver(e);if(!s)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var u=["right","left","up","down","front","back"],l=now();return Promise.all(u.map(function(c){var p=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode}),f=__assign({key:"pano.".concat(p,".").concat(c)},pick(o.imageOptions,["size","format","quality","forceUseExifOrientation","mappings"])),d=s.work.getURL(s.images[c]),h=o.imageOptions.transform?o.imageOptions.transform(d,f):imageURL(d,f);return getFetcher(s.work).preload(h)})).then(function(){var c=now()-l;return r(c),c})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var o=this.camera.position,s=e.clone().sub(o),u=new THREE__namespace.Raycaster(o,s.clone().normalize());u.params.Points={threshold:.1};var l=this.modelScene.intersectRaycaster(u)[0];if(l&&l.distance+.01<s.length())return null}var c=e.clone().project(this.camera);if(Math.abs(c.z)>1)return null;var p=this.renderer.getSize(new THREE__namespace.Vector2),f=p.x*this.viewport.width,d=p.y*this.viewport.height,h=p.x*this.viewport.left+(c.x+1)/2*f,m=p.y*(1-this.viewport.bottom-this.viewport.height)+(-c.y+1)/2*d;return new THREE__namespace.Vector2(h,m)},t.prototype.getCurrentState=function(){return __assign(__assign({},this.camera.copyPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,o){var s,u,l,c,p,f,d,h,m,A;r===void 0&&(r=!1),o===void 0&&(o=!0),e=pick(e,["mode","workCode","panoIndex","longitude","latitude","fov","offset","distance"]),e.offset&&!(e instanceof THREE__namespace.Vector3)&&(e.offset=new THREE__namespace.Vector3(e.offset.x,e.offset.y,e.offset.z));var g;if(typeof e.panoIndex=="number")if(e.workCode)g={workCode:e.workCode,panoIndex:e.panoIndex};else{var E=(u=(s=this.work)===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",v=this.state.workCode;this.works.filter(function(I){return I.workCode===v}).length>0&&(E=v),g={workCode:E,panoIndex:e.panoIndex}}var y=(l=e.mode)!==null&&l!==void 0?l:this.state.mode,b,T,_,S,w;if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==y){if(y==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var R={workCode:g==null?void 0:g.workCode,panoIndex:g==null?void 0:g.panoIndex};typeof e.longitude=="number"&&(R.longitude=e.longitude),typeof e.latitude=="number"&&(R.latitude=e.latitude),typeof e.fov=="number"&&(R.fov=e.fov),typeof e.distance=="number"&&(R.distance=e.distance),e.offset instanceof THREE__namespace.Vector3&&(R.offset=e.offset);var M=__assign(__assign({initial:{state:R,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[y]),B=Controllers[y].initAnimationEndState(M);b=B.longitude,T=B.latitude,_=B.fov,S=B.offset,w=B.distance}else b=(c=e.longitude)!==null&&c!==void 0?c:this.state.longitude,T=(p=e.latitude)!==null&&p!==void 0?p:this.state.latitude,_=(f=e.fov)!==null&&f!==void 0?f:this.state.fov,S=(d=e.offset)!==null&&d!==void 0?d:this.state.offset,w=(h=e.distance)!==null&&h!==void 0?h:this.state.distance;var C={workCode:(g!=null?g:this.pano).workCode,panoIndex:(g!=null?g:this.pano).panoIndex,mode:y,longitude:b,latitude:T,fov:_,offset:S,distance:w};this.emit("state.set",createEvent("state.set",{userAction:o,state:C})),stateEqual(this.state,C)||(this.controller&&C.mode==="VRPanorama"&&C.mode!==this.state.mode?(assignState(this.state,C),this.changeMode("VRPanorama")):this.controller&&C.mode==="XRPanorama"&&C.mode!==this.state.mode?(assignState(this.state,C),this.changeMode("XRPanorama")):(assignState(this.state,C),this.controller&&o&&(this.controller.userAction=!1),r&&this.state.mode===C.mode&&(this.syncingState=this.syncState(now(),0,r),this.syncingState&&((m=this.controller)===null||m===void 0||m.updateTime(now(),0),this.syncingState=!1)),this.emit("state.change",createEvent("state.change",{userAction:o,state:this.state})),(A=this.analysis)===null||A===void 0||A.state(this.works,this.state)))},t.prototype.syncState=function(e,r,o){o===void 0&&(o=!1);var s=this.stateSynced;if(this.stateSynced=!1,!this.controller)return!1;if(this.state.mode!==this.currentMode){var u={mode:this.state.mode,workCode:this.state.workCode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,u,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof Controllers.Model){if(notSimilarVector3(this.camera.pose.offset,this.state.offset)){var l={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,__assign(__assign({},l),{duration:o?0:void 0}),!1),!0}}else{var c={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!panoEqual(c,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var l={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(c,l,!1),!0}}if(this.controller instanceof Controllers.Floorplan||this.controller instanceof Controllers.Topview||this.controller instanceof Controllers.Mapview){var p=1,f=.2,d=.2,h=Math.PI/45,m=o?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,p),A=Math.abs(this.camera.pose.distance-this.state.distance),g=A>d*15?A/15:f,E=o?this.state.distance:stepNumber(this.camera.pose.distance,this.state.distance,g),v=this.camera.pose.offset.distanceTo(this.state.offset),y=v>d*15?v/15:d,b=o?new THREE__namespace.Vector3().copy(this.state.offset):stepVector(this.camera.pose.offset,this.state.offset,y),T=o?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},h),_=T.longitude,S=T.latitude;if(notSimilarValue(m,this.camera.pose.fov)||notSimilarVector3(b,this.camera.pose.offset)||notSimilarValue(E,this.camera.pose.distance)||notSimilarValue(_,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(S,this.camera.pose.latitude)){var w={x:b.x,y:b.y,z:b.z},R={fov:m};return Object.assign(w,{distance:E}),Object.assign(R,{longitude:_,latitude:S}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(R,0).catch(noop),this.controller.locationMotion.set(w,0).catch(noop),!0}}else{var M=1,B=Math.PI/45,m=o?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,M),C=o?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},B),_=C.longitude,S=C.latitude,E=this.state.distance,b=new THREE__namespace.Vector3().copy(this.state.offset);if(notSimilarValue(E,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),notSimilarVector3(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),notSimilarValue(_,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(S,this.camera.pose.latitude)||notSimilarValue(m,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:_,latitude:S,fov:m},0).catch(noop),!0}if(this.stateSynced=!0,s===!1&&this.emit("state.synced",createEvent("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var I=this.currentMode,L=I===t.Mode.Floorplan||I===t.Mode.Topview||I===t.Mode.Mapview||I===t.Mode.Model;if(!L||this.modelScene.loaded){var O=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var F=0,N=O;F<N.length;F++){var D=N[F];this.controller instanceof Controllers.Panorama&&D.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(D):D()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(o){var s;r.readyCallbacks.push(Object.assign(o,{tile:(s=e.tile)!==null&&s!==void 0?s:!1}))}).then(function(){return r.model.initReady})},t.prototype.requestFullscreen=function(){var e;if(isMobile){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModels=function(e,r){for(var o=this,s,u,l,c,p,f,d=new Map,h=!1,m=[],A=0,g=this.modelScene.children;A<g.length;A++){var E=g[A];E instanceof Model&&(E.outdated=!0,d.set(E.work.workCode,E),h=!0)}for(var v=function(T){var _=e[T],S=_.workCode&&d.get(_.workCode);if(S)S.work=_,S.outdated=!1,d.delete(_.workCode),m.push(S);else{var w=(l=(u=(s=r.model)===null||s===void 0?void 0:s.textureOptions)!==null&&u!==void 0?u:r.textureOptions)!==null&&l!==void 0?l:y.textureOptions,R=(p=(c=r.model)===null||c===void 0?void 0:c["3d-tiles"])!==null&&p!==void 0?p:r["3d-tiles"],M=new Model(_,{light:(f=r.model)===null||f===void 0?void 0:f.light,textureOptions:w});M.initReady.then(function(){if(R)if(typeof R=="function")for(var O=0,F=M.viewLayers;O<F.length;O++){var N=F[O],D=R(N,M,T);D&&(D.viewerRequestVolume&&(N.viewerRequestVolume=makeBoundingVolume(D.viewerRequestVolume)),N.parameter.set(omit(D,["showLayers"])),D.showLayers===!1?N.visible=!1:Array.isArray(D.showLayers)&&(N.visible=D.showLayers.includes(N.name)))}else for(var q=0,z=M.viewLayers;q<z.length;q++){var N=z[q];R.viewerRequestVolume&&(N.viewerRequestVolume=makeBoundingVolume(R.viewerRequestVolume)),N.parameter.set(omit(R,["showLayers"])),R.showLayers===!1?N.visible=!1:Array.isArray(R.showLayers)&&(N.visible=R.showLayers.includes(N.name))}}),m.push(M),h&&(M.visible=!1),y.modelScene.add(M);var B=function(){AnimationFrameLoop.shared.add(function(){o.emit("model.load",createEvent("model.load",{work:_,model:M,error:null}))},!0)},C=function(O){var F=O.error;o.emit("model.error",createEvent("model.error",{work:_,model:M,error:F})),o.throwError(F)},I=function(){o.emit("model.changeShownFloor",createEvent("model.changeShownFloor",{work:_,model:M,error:null}))},L=function(){M.removeEventListener("load",B),M.removeEventListener("error",C),M.removeEventListener("changeShownFloor",I),M.removeEventListener("dispose",L)};M.addEventListener("load",B),M.addEventListener("error",C),M.addEventListener("changeShownFloor",I),M.addEventListener("dispose",L),y.emit("model.request",createEvent("model.request",{work:_,model:M,error:null}))}},y=this,b=0;b<e.length;b++)v(b);return this.modelScene.loaded=!1,this.modelScene.refined=!1,m},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,viewport:this.viewport,element:this.getElement(),works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene}},t.prototype.applyController=function(e,r){var o=this;if(!this.renderer)throw new Error("renderer is not initialized.");var s=Controllers[e];this.currentMode=e;for(var u=new s(r),l=function(m){u.on(m,function(){for(var A=[],g=0;g<arguments.length;g++)A[g]=arguments[g];var E=o.emit.apply(o,__spreadArray([m],A,!1));if(E)return!1})},c=0,p=PROXY_CONTROLLER_EVENT_NAMES;c<p.length;c++){var f=p[c];l(f)}{var d=Controllers[e].initAnimationEndState(r),h=r.initial.userAction;stateEqual(this.state,d)||(assignState(this.state,d),this.emit("state.change",createEvent("state.change",{userAction:h,state:this.state}))),this.emit("currentState.change",createEvent("currentState.change",{userAction:h,state:this.getCurrentState()}))}return u.on("camera.update",function(m){var A;if(o.controller){var g=o.controller.getTargetState();m.userAction&&o.syncingState===!1&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:m.userAction,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}o.emit("currentState.change",createEvent("currentState.change",{userAction:m.userAction,state:o.getCurrentState()}))}),u.on("initAnimation.start",function(m){var A,g=m.state,E=m.userAction;E&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("initAnimation.end",function(m){var A,g=m.state,E=m.userAction;o.pano={workCode:g.workCode,panoIndex:g.panoIndex},E&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.moveTo",function(m){var A,g=m.state,E=m.userAction;o.pano={workCode:g.workCode,panoIndex:g.panoIndex},E&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.arrived",function(m){var A,g=m.state,E=m.userAction;o.pano={workCode:g.workCode,panoIndex:g.panoIndex},E&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.cancel",function(m){var A,g=m.state,E=m.userAction;E&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.moveTo",function(m){var A=m.userAction;o.emit("currentState.change",createEvent("currentState.change",{userAction:A,state:o.getCurrentState()}))}),u.on("pano.request",function(m){o.emit("pano.request",m),m.defaultPrevented||o.moveToPano(m.state,m.options,m.userAction)}),u.on("vr.requestExit",function(){o.currentMode===t.Mode.VRPanorama&&(o.exitFullscreen(),o.changeMode(t.Mode.Panorama))}),u.on("error",function(m){return o.throwError(m)}),u},t.prototype.removeEventListeners=function(){},Object.defineProperty(t.prototype,"internalLightsEnabled",{get:function(){var e=this.scene.children.find(function(r){return r.name==="internalLights"});return e?e.visible:!1},set:function(e){var r=this.scene.children.find(function(o){return o.name==="internalLights"});r&&(r.visible=e),r=this.modelScene.children.find(function(o){return o.name==="internalLights"}),r&&(r.visible=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scissor",{get:function(){return this.viewport},enumerable:!1,configurable:!0}),t.prototype.setScissor=function(e){return this.setViewport(e)},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,o=e.latitude,s=e.fov,u=e.offset,l=e.distance;return{longitude:r,latitude:o,fov:s,offset:u.clone(),distance:l}},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose(),r=e.longitude,o=e.latitude;return{longitude:r,latitude:o}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.pano.workCode&&this.controller&&this.works){var e=this.works.getObserver(this.pano);if(e){var r=new THREE__namespace.Object3D;r.matrix.copy(e.matrix).premultiply(e.work.transform),r.matrix.decompose(r.position,r.quaternion,r.scale),r.matrixAutoUpdate=!1;var o=new THREE__namespace.Vector3(0,0,-1);o.applyQuaternion(this.camera.quaternion);var s=r.quaternion.clone().inverse();o.applyQuaternion(s);var u=Math.atan2(o.x,-o.z),l=-Math.asin(o.y);return{theta:u,phi:l,lookAtVector:o}}}return null},Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this.renderEffect==="edl"},set:function(e){this.renderEffect=e?"edl":"default"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this.renderEffect==="hq"},set:function(e){this.renderEffect=e?"hq":"default"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t})(Subscribe),__FIVE_DEBUG__={constructor:Five,THREE:THREE__namespace,instances:{}};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__});var XRButton=(function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function o(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function s(){o(),e.textContent="VR NOT SUPPORTED"}function u(c){c.style.position="absolute",c.style.bottom="20px",c.style.padding="12px 6px",c.style.border="1px solid #fff",c.style.borderRadius="4px",c.style.background="rgba(0,0,0,0.1)",c.style.color="#fff",c.style.font="normal 13px sans-serif",c.style.textAlign="center",c.style.opacity="0.5",c.style.outline="none",c.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",u(e),navigator.xr.isSessionSupported("immersive-vr").then(function(c){c?r():s()}),e;var l=document.createElement("a");return window.isSecureContext===!1?(l.href=document.location.href.replace(/^http:/,"https:"),l.innerHTML="WEBXR NEEDS HTTPS"):(l.href="https://immersiveweb.dev/",l.innerHTML="WEBXR NOT AVAILABLE"),l.style.left="calc(50% - 90px)",l.style.width="180px",l.style.textDecoration="none",u(l),l},n})();exports.AnimationFrameLoop=AnimationFrameLoop,exports.Camera=Camera,exports.CustomShader=PBMCustomShader,exports.Fetcher=Fetcher,exports.Five=Five,exports.InternalWebGLRenderer=InternalWebGLRenderer,exports.Model=Model,exports.ModelScene=ModelScene,exports.Motion=Motion,exports.NetworkSubscribe=NetworkSubscribe,exports.PBMContainer=PBMContainer,exports.PBMCustomShader=PBMCustomShader,exports.PBMGroup=PBMGroup,exports.PBMMesh=PBMMesh,exports.PBMMeshMaterial=PBMMeshMaterial,exports.PBMPointCloud=PBMPointCloud,exports.PBMPointCloudMaterial=PBMPointCloudMaterial,exports.PBMSkinnedMesh=PBMSkinnedMesh,exports.PROXY_CONTROLLER_EVENT_NAMES=PROXY_CONTROLLER_EVENT_NAMES,exports.PanoCircleMesh=PanoCircleMesh,exports.PanoCircleMeshCustom=PanoCircleMeshCustom,exports.PanoCircleMeshSolid=PanoCircleMeshSolid,exports.Parameter=Parameter,exports.Scene=Scene,exports.Subscribe=Subscribe,exports.TextureLoader=TextureLoader,exports.Tile=Tile,exports.Tile3D=Tile3D,exports.Tile3DModel=Tile3D,exports.TileCache=TileCache,exports.TileNode=TileNode,exports.TileRequestScheduler=TileRequestScheduler,exports.Tileset=Tileset,exports.Trajectory=Trajectory,exports.TrajectoryNode=TrajectoryNode,exports.Work=Work,exports.WorkResolvedObserver=WorkResolvedObserver,exports.XRButton=XRButton,exports.controllersDefaultInitArgs=controllersDefaultInitArgs,exports.coordinatesToVector=coordinatesToVector,exports.createDebugBoundingMesh=createDebugBoundingMesh,exports.createWorks=createWorks,exports.defaultImageURLTransform=imageURL,exports.draco=draco,exports.getViewportScale=getViewportScale,exports.headingToLongitude=headingToLongitude,exports.imageSupport=imageSupport,exports.isBoundingVolume=isBoundingVolume,exports.isPanoId=isPanoId,exports.ktx2=ktx2,exports.loadAt3d=loadAt3d,exports.loadB3dm=loadB3dm,exports.loadDome=loadDome,exports.loadDomez=loadDomez,exports.loadFbx=loadFbx,exports.loadGltf=loadGltf,exports.loadPbm=loadPbm,exports.loadPly=loadPly,exports.loadPnts=loadPnts,exports.loadX3p=loadX3p,exports.longitudeToHeading=longitudeToHeading,exports.makeBoundingVolume=makeBoundingVolume,exports.panoEqual=panoEqual,exports.panoParse=panoParse,exports.panoStringify=panoStringify,exports.parseWork=parseWork,exports.vectorToCoordinates=vectorToCoordinates,exports.workToJson=workToJson,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
|