diff --git a/build/panolens.js b/build/panolens.js index d60e02ee..75c01d18 100644 --- a/build/panolens.js +++ b/build/panolens.js @@ -8565,7 +8565,7 @@ * @param {THREE.Vector3} [options.initialLookAt=new THREE.Vector3( 0, 0, -Number.MAX_SAFE_INTEGER )] - Initial looking at vector * @param {boolean} [options.momentum=true] - Use momentum even during mouse/touch move * @param {number} [options.rotateSpeed=-1.0] - Drag Rotation Speed - * @param {number} [options.dampingFactor=.1] - Damping factor + * @param {number} [options.dampingFactor=.15] - Damping factor */ function Viewer ( options = {} ) { @@ -8592,7 +8592,7 @@ initialLookAt: new THREE.Vector3( 0, 0, -Number.MAX_SAFE_INTEGER ), momentum: true, rotateSpeed: -1.0, - dampingFactor: 0.1 + dampingFactor: 0.15 }, options ); @@ -8665,7 +8665,8 @@ }, setupCamera: function ( cameraFov, ratio, camera = new THREE.PerspectiveCamera( cameraFov, ratio, 1, 10000 ) ) { - + + camera.position.set( 0, 0, 1 ); return camera; }, @@ -9777,6 +9778,8 @@ duration = duration !== undefined ? duration : 1000; easing = easing || TWEEN.Easing.Exponential.Out; + const MEPS = 10e-5; + const { left, up } = this.calculateCameraDirectionDelta( vector ); const rotateControlLeft = this.rotateControlLeft.bind( this ); const rotateControlUp = this.rotateControlUp.bind( this ); @@ -9791,18 +9794,22 @@ .to( { left }, duration ) .easing( easing ) .onUpdate(function(ov){ - rotateControlLeft( ov.left - nv.left ); + const diff = ov.left - nv.left; + if( Math.abs( diff ) < MEPS ) this.tweenLeftAnimation.stop(); + rotateControlLeft( diff ); nv.left = ov.left; - }) + }.bind(this)) .start(); this.tweenUpAnimation = new TWEEN.Tween( ov ) .to( { up }, duration ) .easing( easing ) .onUpdate(function(ov){ - rotateControlUp( ov.up - nv.up ); + const diff = ov.up - nv.up; + if( Math.abs( diff ) < MEPS ) this.tweenUpAnimation.stop(); + rotateControlUp( diff ); nv.up = ov.up; - }) + }.bind(this)) .start(); }, diff --git a/build/panolens.min.js b/build/panolens.min.js index d821ba4c..f59bb793 100644 --- a/build/panolens.min.js +++ b/build/panolens.min.js @@ -1,97 +1,97 @@ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(e){return e.raw=e};$jscomp.createTemplateTagFirstArgWithRaw=function(e,c){e.raw=c;return e};$jscomp.arrayIteratorImpl=function(e){var c=0;return function(){return cb;b++)a.push(z.WhiteTile);Q.call(this,a);this.type="basic_panorama"}function C(a,b){b=void 0===b?{}:b;h.call(this);this.src=a;this.options=Object.assign({videoElement:document.createElement("video"), +c.EventDispatcher.call(this);this.DEFAULT_TRANSITION="all 0.27s ease";this.TOUCH_ENABLED=!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch);this.PREVENT_EVENT_HANDLER=function(a){a.preventDefault();a.stopPropagation()};this.container=a;this.mask=this.activeSubMenu=this.activeMainItem=this.mainMenu=this.settingElement=this.videoElement=this.fullscreenElement=this.barElement=null}function n(){this.edgeLength=1E4;c.Mesh.call(this,this.createGeometry(this.edgeLength), +this.createMaterial());this.type="panorama";this.ImageQualityLow=1;this.ImageQualityFair=2;this.ImageQualityMedium=3;this.ImageQualityHigh=4;this.ImageQualitySuperHigh=5;this.animationDuration=1E3;this.defaultInfospotSize=350;this.container=void 0;this.loaded=!1;this.linkedSpots=[];this.isInfospotVisible=!1;this.linkingImageScale=this.linkingImageURL=void 0;this.renderOrder=-1;this.active=this.visible=!1;this.infospotAnimation=(new h.Tween(this)).to({},this.animationDuration/2);this.addEventListener("panolens-container", +this.setContainer.bind(this));this.addEventListener("click",this.onClick.bind(this));this.setupTransitions()}function l(a){n.call(this);this.src=a;this.type="image_panorama"}function N(){n.call(this);this.type="empty_panorama"}function Q(a){a=void 0===a?[]:a;n.call(this);this.images=a;this.type="cube_panorama"}function ia(){for(var a=[],b=0;6>b;b++)a.push(B.WhiteTile);Q.call(this,a);this.type="basic_panorama"}function F(a,b){b=void 0===b?{}:b;n.call(this);this.src=a;this.options=Object.assign({videoElement:document.createElement("video"), loop:!0,muted:!0,autoplay:!1,playsinline:!0,crossOrigin:"anonymous"},b);this.videoElement=this.options.videoElement;this.videoProgress=0;this.type="video_panorama";this.addEventListener("leave",this.pauseVideo.bind(this));this.addEventListener("enter-fade-start",this.resumeVideoProgress.bind(this));this.addEventListener("video-toggle",this.toggleVideo.bind(this));this.addEventListener("video-time",this.setVideoCurrentTime.bind(this))}function X(a){this._parameters=a=void 0===a?{}:a;this._panoId=this._zoom= null;this._panoClient=new google.maps.StreetViewService;this._total=this._count=0;this._canvas=[];this._ctx=[];this._hc=this._wc=0;this.result=null;this.rotation=0;this.copyright="";this.onPanoramaLoad=this.onSizeChange=null;this.levelsW=[1,2,4,7,13,26];this.levelsH=[1,1,2,4,7,13];this.widths=[416,832,1664,3328,6656,13312];this.heights=[416,416,832,1664,3328,6656];this.maxH=this.maxW=6656;var b;try{var d=document.createElement("canvas");(b=d.getContext("experimental-webgl"))||(b=d.getContext("webgl"))}catch(g){}this.maxW= -Math.max(b.getParameter(b.MAX_TEXTURE_SIZE),this.maxW);this.maxH=Math.max(b.getParameter(b.MAX_TEXTURE_SIZE),this.maxH)}function Y(a,b){t.call(this);this.panoId=a;this.gsvLoader=null;this.loadRequested=!1;this.setupGoogleMapAPI(b);this.type="google_streetview_panorama"}function J(a,b){"image"===(void 0===a?"image":a)&&t.call(this,b);this.EPS=1E-6;this.frameId=null;this.dragging=!1;this.userMouse=new c.Vector2;this.quatA=new c.Quaternion;this.quatB=new c.Quaternion;this.quatCur=new c.Quaternion;this.quatSlerp= -new c.Quaternion;this.vectorX=new c.Vector3(1,0,0);this.vectorY=new c.Vector3(0,1,0);this.type="little_planet";this.addEventListener("window-resize",this.onWindowResize)}function ka(a){J.call(this,"image",a);this.type="image_little_planet"}function la(a){h.call(this);this.media=new l(a);this.type="camera_panorama";this.addEventListener("enter",this.start.bind(this));this.addEventListener("leave",this.stop.bind(this));this.addEventListener("panolens-container",this.onPanolensContainer.bind(this)); -this.addEventListener("panolens-scene",this.onPanolensScene.bind(this))}function Z(a,b){b=void 0===b?new m:b;t.call(this,a);this.stereo=b;this.type="stereo_image_panorama"}function R(a,b,d){b=void 0===b?{}:b;d=void 0===d?new m:d;C.call(this,a,b);this.stereo=d;this.type="stereo_video_panorama"}function xa(a,b,d,g){function c(){m=Q.addSourceBuffer('video/mp4; codecs="avc1.640033"');m.mode="sequence"}function e(){G(O,{responseType:"text",onreadystatechange:function(a){if((a=a.target)&&a.readyState== -a.DONE){a=(new DOMParser).parseFromString(a.response,"text/xml",0);try{a.querySelectorAll("Representation"),v=1,K=a.querySelectorAll("SegmentURL"),da=a.querySelectorAll("Initialization"),A.frameCount=K.length}catch(ya){console.log(ya)}z=E.allow_streaming?Math.min(60,A.frameCount):A.frameCount;Z(U)}}})}function r(a,b){C=ea.length;H=ma=0;var c=8;ia&&(c=4);for(b=0;bg)||c){x.jumpTo(1);break}e=new Headers;e.append("Range",u.content);e.append("cache-control","no-store");e.append("pragma","no-cache");e.append("cache-control","no-cache");x.setCatchFinallyBlocks(6,7);return x.yield(fetch(a,{headers:e,method:"GET"}),9);case 9:return f=x.yieldResult,x.yield(f.arrayBuffer(),10);case 10:k= -x.yieldResult,w[u.index]=k,H++,c=!0;case 7:x.enterFinallyBlock();x.leaveFinallyBlock(4);break;case 6:r=x.enterCatchBlock();console.log("exception during chunk download, retrying",++g,r);g++;x.jumpTo(7);break;case 3:H===b&&d(),x.jumpToEnd()}})}function n(){q.removeEventListener("canplay",l,!1);q.currentTime=A.currentIndex}function l(){q.removeEventListener("loadeddata",n,!1);q.currentTime=A.currentIndex}function f(){q.currentTime=A.currentIndex;ca=ba=!0;d(q,E);g(q,E);q.removeEventListener("loadeddata", -n,!1);q.removeEventListener("canplay",l,!1);q.removeEventListener("timeupdate",f,!1)}function G(a,b){if(null!=a&&""!==a){var d=new XMLHttpRequest;d.open("GET",a,!0);b&&(d.responseType=b.responseType,b.onreadystatechange&&(d.onreadystatechange=b.onreadystatechange.bind(d)),b.onload&&(d.onload=b.onload));d.addEventListener("error",function(a){console.log("Error: "+a+" Could not load url.")},!1);d.send();return d}}function h(a,b,d,g,c){return{header:"Range",content:"bytes="+a.getAttribute("mediaRange").toString(), -index:b,countPosition:d,firstPass:g,firstPassCompleteIndex:c}}function p(a,b,d,g){var c=[],u=0;if(void 0===g?0:g){for(b=0;b>24,(a&16711680)>>16,(a&65280)>>8,a&255])}var A=this,m,v,K=[],q=document.createElement("video"),y=[],z,F,ia,C,ma,H,da=[],J=-1,ea,w=[],D=0,N=0,ba,E={},O,U,L,x,fa,na,M,S=[112,97,115,112],T=[116,107,104, -100],ca;navigator.userAgent.match(/Android/i)?ia=!0:navigator.userAgent.match(/iPhone|iPad|iPod/i)&&(F=!0);if(/Chrome/i.test(navigator.userAgent.toLowerCase())||/Chrome WebView/i.test(navigator.userAgent.toLowerCase())||/Chromium/i.test(navigator.userAgent.toLowerCase()))var W=!0;else if(/Firefox/i.test(navigator.userAgent.toLowerCase())||/Supermedium/i.test(navigator.userAgent.toLowerCase())){var P=!0;ia||(W=!0)}else/Safari/i.test(navigator.userAgent.toLowerCase())&&/Chrome/i.test(navigator.userAgent.toLowerCase()); +Math.max(b.getParameter(b.MAX_TEXTURE_SIZE),this.maxW);this.maxH=Math.max(b.getParameter(b.MAX_TEXTURE_SIZE),this.maxH)}function Y(a,b){l.call(this);this.panoId=a;this.gsvLoader=null;this.loadRequested=!1;this.setupGoogleMapAPI(b);this.type="google_streetview_panorama"}function J(a,b){"image"===(void 0===a?"image":a)&&l.call(this,b);this.EPS=1E-6;this.frameId=null;this.dragging=!1;this.userMouse=new c.Vector2;this.quatA=new c.Quaternion;this.quatB=new c.Quaternion;this.quatCur=new c.Quaternion;this.quatSlerp= +new c.Quaternion;this.vectorX=new c.Vector3(1,0,0);this.vectorY=new c.Vector3(0,1,0);this.type="little_planet";this.addEventListener("window-resize",this.onWindowResize)}function ja(a){J.call(this,"image",a);this.type="image_little_planet"}function ka(a){n.call(this);this.media=new m(a);this.type="camera_panorama";this.addEventListener("enter",this.start.bind(this));this.addEventListener("leave",this.stop.bind(this));this.addEventListener("panolens-container",this.onPanolensContainer.bind(this)); +this.addEventListener("panolens-scene",this.onPanolensScene.bind(this))}function Z(a,b){b=void 0===b?new u:b;l.call(this,a);this.stereo=b;this.type="stereo_image_panorama"}function R(a,b,d){b=void 0===b?{}:b;d=void 0===d?new u:d;F.call(this,a,b);this.stereo=d;this.type="stereo_video_panorama"}function wa(a,b,d,g){function c(){l=Q.addSourceBuffer('video/mp4; codecs="avc1.640033"');l.mode="sequence"}function e(){z(N,{responseType:"text",onreadystatechange:function(a){if((a=a.target)&&a.readyState== +a.DONE){a=(new DOMParser).parseFromString(a.response,"text/xml",0);try{a.querySelectorAll("Representation"),u=1,w=a.querySelectorAll("SegmentURL"),da=a.querySelectorAll("Initialization"),C.frameCount=w.length}catch(xa){console.log(xa)}B=E.allow_streaming?Math.min(60,C.frameCount):C.frameCount;Z(U)}}})}function r(a,b){F=ea.length;H=la=0;var c=8;O&&(c=4);for(b=0;bg)||c){y.jumpTo(1);break}e=new Headers;e.append("Range",t.content);e.append("cache-control","no-store");e.append("pragma","no-cache");e.append("cache-control","no-cache");y.setCatchFinallyBlocks(6,7);return y.yield(fetch(a,{headers:e,method:"GET"}),9);case 9:return f=y.yieldResult,y.yield(f.arrayBuffer(),10);case 10:k= +y.yieldResult,x[t.index]=k,H++,c=!0;case 7:y.enterFinallyBlock();y.leaveFinallyBlock(4);break;case 6:r=y.enterCatchBlock();console.log("exception during chunk download, retrying",++g,r);g++;y.jumpTo(7);break;case 3:H===b&&d(),y.jumpToEnd()}})}function h(){q.removeEventListener("canplay",V,!1);q.currentTime=C.currentIndex}function V(){q.removeEventListener("loadeddata",h,!1);q.currentTime=C.currentIndex}function f(){q.currentTime=C.currentIndex;ca=ba=!0;d(q,E);g(q,E);q.removeEventListener("loadeddata", +h,!1);q.removeEventListener("canplay",V,!1);q.removeEventListener("timeupdate",f,!1)}function z(a,b){if(null!=a&&""!==a){var d=new XMLHttpRequest;d.open("GET",a,!0);b&&(d.responseType=b.responseType,b.onreadystatechange&&(d.onreadystatechange=b.onreadystatechange.bind(d)),b.onload&&(d.onload=b.onload));d.addEventListener("error",function(a){console.log("Error: "+a+" Could not load url.")},!1);d.send();return d}}function m(a,b,d,g,c){return{header:"Range",content:"bytes="+a.getAttribute("mediaRange").toString(), +index:b,countPosition:d,firstPass:g,firstPassCompleteIndex:c}}function n(a,b,d,g){var c=[],t=0;if(void 0===g?0:g){for(b=0;b>24,(a&16711680)>>16,(a&65280)>>8,a&255])}var C=this,l,u,w=[],q=document.createElement("video"),v=[],B,G,O,F,la,H,da=[],J=-1,ea,x=[],D=0,M=0,ba,E={},N,U,K,y,fa,ma,L,S=[112,97,115,112],T=[116,107,104, +100],ca;navigator.userAgent.match(/Android/i)?O=!0:navigator.userAgent.match(/iPhone|iPad|iPod/i)&&(G=!0);if(/Chrome/i.test(navigator.userAgent.toLowerCase())||/Chrome WebView/i.test(navigator.userAgent.toLowerCase())||/Chromium/i.test(navigator.userAgent.toLowerCase()))var W=!0;else if(/Firefox/i.test(navigator.userAgent.toLowerCase())||/Supermedium/i.test(navigator.userAgent.toLowerCase())){var P=!0;O||(W=!0)}else/Safari/i.test(navigator.userAgent.toLowerCase())&&/Chrome/i.test(navigator.userAgent.toLowerCase()); if(W){var Q=new MediaSource;q.src=window.URL.createObjectURL(Q);q.preload="auto";Q.addEventListener("sourceopen",c)}else q.setAttribute("playsinline",""),q.muted=!0,q.autoplay=!0;fetch("https://my.panomoments.com/sdk/moment",{method:"POST",body:"private_api_key="+a.private_api_key+"&public_api_key="+a.public_api_key+"&moment_id="+a.moment_id+"&variation="+a.variation+"&sdk_client_type=web",headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(a){return a.json()}).then(function(a){E= -a;O=E.web_mpd_url;U=E.web_video_url;e()});this.frameCount=this.currentIndex=0;this.render=function(a){if(ba){x=a/A.frameCount*360;fa=360/A.frameCount;E.clockwise?0>x&&(x=360+x):(x=-x,x=540+x);x%=360;L=parseInt(Math.round(x/fa),10);if(L==A.frameCount&&E.moment_type)L=A.frameCount-1;else if(L==A.frameCount&&!E.moment_type||!L)L=0;if(A.textureReady()&&J!=L){if(W){if(0==ea.length||w[L])var d=L;else{var g=!1,c=!1;for(a=L;!g&&ag)||c){V.jumpTo(0);break}V.setCatchFinallyBlocks(4);return V.yield(fetch(a,{headers:b,method:"GET"}),6);case 6:return u=V.yieldResult, -V.yield(u.arrayBuffer(),7);case 7:e=V.yieldResult;M=new Uint8Array(e);f=ha(M,S);k=ha(M,T);0g&&(g=360+g),A.currentIndex=parseInt(Math.round(g/fa),10),c="bytes="+K[A.currentIndex].getAttribute("mediaRange").toString(),d.append("Range",c),-1 -u)||e){h.jumpTo(0);break}h.setCatchFinallyBlocks(4);return h.yield(fetch(a,{headers:d,method:"GET"}),6);case 6:return k=h.yieldResult,h.yield(k.arrayBuffer(),7);case 7:x=h.yieldResult;I=new Uint8Array(x);B=new Int8Array(M.length+I.length);B.set(M);B.set(I,M.length);W?(w[A.currentIndex]=x,R(B),b(q,E),ea=p(K,z,y,!1),r(U,1)):(q.addEventListener("loadeddata",X),q.addEventListener("canplay",Y),q.src=window.URL.createObjectURL(new Blob([B],{type:"video/mp4"})),q.pause(),fetch(U).then(function(a){a.arrayBuffer().then(function(a){ca= -!1;q.addEventListener("loadeddata",n,!1);q.addEventListener("canplay",l,!1);q.addEventListener("timeupdate",f,!1);a=new Uint8Array(a);var b=ha(M,S),d=ha(M,T);if(0y&&(y=360+y):(y=-y,y=540+y);y%=360;K=parseInt(Math.round(y/fa),10);if(K==C.frameCount&&E.moment_type)K=C.frameCount-1;else if(K==C.frameCount&&!E.moment_type||!K)K=0;if(C.textureReady()&&J!=K){if(W){if(0==ea.length||x[K])var d=K;else{var g=!1,c=!1;for(a=K;!g&&ag)||c){l.jumpTo(0);break}l.setCatchFinallyBlocks(4);return l.yield(fetch(a,{headers:b,method:"GET"}),6);case 6:return t=l.yieldResult, +l.yield(t.arrayBuffer(),7);case 7:e=l.yieldResult;L=new Uint8Array(e);f=ha(L,S);k=ha(L,T);0g&&(g=360+g),C.currentIndex=parseInt(Math.round(g/fa),10),c="bytes="+w[C.currentIndex].getAttribute("mediaRange").toString(),d.append("Range",c),-1 +t)||e){z.jumpTo(0);break}z.setCatchFinallyBlocks(4);return z.yield(fetch(a,{headers:d,method:"GET"}),6);case 6:return k=z.yieldResult,z.yield(k.arrayBuffer(),7);case 7:y=z.yieldResult;I=new Uint8Array(y);A=new Int8Array(L.length+I.length);A.set(L);A.set(I,L.length);W?(x[C.currentIndex]=y,R(A),b(q,E),ea=n(w,B,v,!1),r(U,1)):(q.addEventListener("loadeddata",X),q.addEventListener("canplay",Y),q.src=window.URL.createObjectURL(new Blob([A],{type:"video/mp4"})),q.pause(),fetch(U).then(function(a){a.arrayBuffer().then(function(a){ca= +!1;q.addEventListener("loadeddata",h,!1);q.addEventListener("canplay",V,!1);q.addEventListener("timeupdate",f,!1);a=new Uint8Array(a);var b=ha(L,S),d=ha(L,T);if(0z.y&&f.dollyOut(),q.copy(y)):D===w.PAN&&!0!==f.noPan&&(A.set(a.clientX,a.clientY),t.subVectors(A,p),f.pan(t.x,t.y),p.copy(A))}}function u(){!1!==f.enabled&&(document.removeEventListener("mousemove",g,!1),document.removeEventListener("mouseup",u,!1),f.dispatchEvent(U),D=w.NONE)}function e(a){if(!1!==f.enabled&&!0!==f.noZoom&&D===w.NONE){a.preventDefault(); -a.stopPropagation();var b=0;void 0!==a.wheelDelta?b=a.wheelDelta:void 0!==a.detail&&(b=-a.detail);0b&&(f.object.fov=f.object.fov>f.minFov?f.object.fov-1:f.minFov,f.object.updateProjectionMatrix());f.dispatchEvent(E);f.dispatchEvent(R);f.dispatchEvent(U);f.dispatchEvent(L)}}function r(a){}function I(a){if(!1!==f.enabled&&!0!==f.noKeys&&!0!==f.noRotate&&!f.autoRotate){var b=f.momentum&&!f.autoRotate? -f.momentumKeydownFactor*f.momentumFactor:f.momentumKeydownFactor;switch(a.keyCode){case f.keys.UP:f.rotateUp(f.rotateSpeed*b);break;case f.keys.BOTTOM:f.rotateUp(-f.rotateSpeed*b);break;case f.keys.LEFT:f.rotateLeft(f.rotateSpeed*b);break;case f.keys.RIGHT:f.rotateLeft(-f.rotateSpeed*b)}}}function B(a){if(!1!==f.enabled){switch(a.touches.length){case 1:if(!0===f.noRotate)return;D=w.TOUCH_ROTATE;G.set(a.touches[0].pageX,a.touches[0].pageY);break;case 2:if(!0===f.noZoom)return;D=w.TOUCH_DOLLY;var b= -a.touches[0].pageX-a.touches[1].pageX;a=a.touches[0].pageY-a.touches[1].pageY;q.set(0,Math.sqrt(b*b+a*a));break;case 3:if(!0===f.noPan)return;D=w.TOUCH_PAN;p.set(a.touches[0].pageX,a.touches[0].pageY);break;default:D=w.NONE}D!==w.NONE&&f.dispatchEvent(R)}}function h(a){if(!1!==f.enabled){a.preventDefault();a.stopPropagation();var b=f.domElement===document?f.domElement.body:f.domElement;switch(a.touches.length){case 1:if(!0===f.noRotate)break;if(D!==w.TOUCH_ROTATE)break;l.set(a.touches[0].pageX,a.touches[0].pageY); -m.subVectors(l,G);f.rotateLeft(2*Math.PI*m.x/b.clientHeight*f.rotateSpeed);f.rotateUp(2*Math.PI*m.y/b.clientHeight*f.rotateSpeed);G.copy(l);break;case 2:if(!0===f.noZoom)break;if(D!==w.TOUCH_DOLLY)break;b=a.touches[0].pageX-a.touches[1].pageX;a=a.touches[0].pageY-a.touches[1].pageY;y.set(0,Math.sqrt(b*b+a*a));z.subVectors(y,q);0>z.y?(f.object.fov=f.object.fovf.minFov?f.object.fov-1:f.minFov,f.object.updateProjectionMatrix()); -q.copy(y);f.dispatchEvent(E);f.dispatchEvent(L);break;case 3:if(!0===f.noPan)break;if(D!==w.TOUCH_PAN)break;A.set(a.touches[0].pageX,a.touches[0].pageY);t.subVectors(A,p);f.pan(t.x,t.y);p.copy(A);break;default:D=w.NONE}}}function n(){!1!==f.enabled&&(f.dispatchEvent(U),D=w.NONE)}this.object=a;this.domElement=void 0!==b?b:document;this.frameId=null;this.enabled=!0;this.center=this.target=new c.Vector3;this.noZoom=!1;this.zoomSpeed=1;this.minDistance=0;this.maxDistance=Infinity;this.minZoom=0;this.maxZoom= +function(){return b.enableControl()})}function na(a){var b=this;G.call(this,a);this.viewerResetControlLimits=function(){return b.resetControlLimits(!1)}}function oa(a){G.call(this,a);this.scale2D=new c.Vector2(1,1)}function pa(a,b){function d(a){if(!1!==f.enabled){a.preventDefault();if(a.button===f.mouseButtons.ORBIT){if(!0===f.noRotate)return;D=x.ROTATE;z.set(a.clientX,a.clientY)}else if(a.button===f.mouseButtons.ZOOM){if(!0===f.noZoom)return;D=x.DOLLY;q.set(a.clientX,a.clientY)}else if(a.button=== +f.mouseButtons.PAN){if(!0===f.noPan)return;D=x.PAN;p.set(a.clientX,a.clientY)}D!==x.NONE&&(document.addEventListener("mousemove",g,!1),document.addEventListener("mouseup",t,!1),f.dispatchEvent(R))}}function g(a){if(!1!==f.enabled){a.preventDefault();var b=f.domElement===document?f.domElement.body:f.domElement;D===x.ROTATE?!0!==f.noRotate&&(m.set(a.clientX,a.clientY),n.subVectors(m,z),0==z.x&&0==z.y?(z.set(m.x,m.y),n.subVectors(m,z)):(f.rotateLeft(2*Math.PI*n.x/b.clientHeight*f.rotateSpeed),f.rotateUp(2* +Math.PI*n.y/b.clientHeight*f.rotateSpeed),z.copy(m))):D===x.DOLLY?!0!==f.noZoom&&(B.set(a.clientX,a.clientY),G.subVectors(B,q),0G.y&&f.dollyOut(),q.copy(B)):D===x.PAN&&!0!==f.noPan&&(C.set(a.clientX,a.clientY),u.subVectors(C,p),f.pan(u.x,u.y),p.copy(C))}}function t(){!1!==f.enabled&&(document.removeEventListener("mousemove",g,!1),document.removeEventListener("mouseup",t,!1),f.dispatchEvent(U),D=x.NONE)}function e(a){if(!1!==f.enabled&&!0!==f.noZoom&&D===x.NONE){a.preventDefault(); +a.stopPropagation();var b=0;void 0!==a.wheelDelta?b=a.wheelDelta:void 0!==a.detail&&(b=-a.detail);0b&&(f.object.fov=f.object.fov>f.minFov?f.object.fov-1:f.minFov,f.object.updateProjectionMatrix());f.dispatchEvent(E);f.dispatchEvent(R);f.dispatchEvent(U);f.dispatchEvent(K)}}function r(a){}function I(a){if(!1!==f.enabled&&!0!==f.noKeys&&!0!==f.noRotate&&!f.autoRotate){var b=f.momentum&&!f.autoRotate? +f.momentumKeydownFactor*f.momentumFactor:f.momentumKeydownFactor;switch(a.keyCode){case f.keys.UP:f.rotateUp(f.rotateSpeed*b);break;case f.keys.BOTTOM:f.rotateUp(-f.rotateSpeed*b);break;case f.keys.LEFT:f.rotateLeft(f.rotateSpeed*b);break;case f.keys.RIGHT:f.rotateLeft(-f.rotateSpeed*b)}}}function A(a){if(!1!==f.enabled){switch(a.touches.length){case 1:if(!0===f.noRotate)return;D=x.TOUCH_ROTATE;z.set(a.touches[0].pageX,a.touches[0].pageY);break;case 2:if(!0===f.noZoom)return;D=x.TOUCH_DOLLY;var b= +a.touches[0].pageX-a.touches[1].pageX;a=a.touches[0].pageY-a.touches[1].pageY;q.set(0,Math.sqrt(b*b+a*a));break;case 3:if(!0===f.noPan)return;D=x.TOUCH_PAN;p.set(a.touches[0].pageX,a.touches[0].pageY);break;default:D=x.NONE}D!==x.NONE&&f.dispatchEvent(R)}}function h(a){if(!1!==f.enabled){a.preventDefault();a.stopPropagation();var b=f.domElement===document?f.domElement.body:f.domElement;switch(a.touches.length){case 1:if(!0===f.noRotate)break;if(D!==x.TOUCH_ROTATE)break;m.set(a.touches[0].pageX,a.touches[0].pageY); +n.subVectors(m,z);f.rotateLeft(2*Math.PI*n.x/b.clientHeight*f.rotateSpeed);f.rotateUp(2*Math.PI*n.y/b.clientHeight*f.rotateSpeed);z.copy(m);break;case 2:if(!0===f.noZoom)break;if(D!==x.TOUCH_DOLLY)break;b=a.touches[0].pageX-a.touches[1].pageX;a=a.touches[0].pageY-a.touches[1].pageY;B.set(0,Math.sqrt(b*b+a*a));G.subVectors(B,q);0>G.y?(f.object.fov=f.object.fovf.minFov?f.object.fov-1:f.minFov,f.object.updateProjectionMatrix()); +q.copy(B);f.dispatchEvent(E);f.dispatchEvent(K);break;case 3:if(!0===f.noPan)break;if(D!==x.TOUCH_PAN)break;C.set(a.touches[0].pageX,a.touches[0].pageY);u.subVectors(C,p);f.pan(u.x,u.y);p.copy(C);break;default:D=x.NONE}}}function l(){!1!==f.enabled&&(f.dispatchEvent(U),D=x.NONE)}this.object=a;this.domElement=void 0!==b?b:document;this.frameId=null;this.enabled=!0;this.center=this.target=new c.Vector3;this.noZoom=!1;this.zoomSpeed=1;this.minDistance=0;this.maxDistance=Infinity;this.minZoom=0;this.maxZoom= Infinity;this.noRotate=!1;this.rotateSpeed=-.15;this.noPan=!0;this.keyPanSpeed=7;this.autoRotate=!1;this.autoRotateSpeed=2;this.minPolarAngle=0;this.maxPolarAngle=Math.PI;this.spherical=new c.Spherical;this.momentumKeydownFactor=.05;this.momentum=!0;this.momentumFactor=7.5;this.speedLimit=.04;this.enableDamping=!0;this.dampingFactor=.03;this.minFov=30;this.maxFov=120;this.minAzimuthAngle=-Infinity;this.maxAzimuthAngle=Infinity;this.noKeys=!1;this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40};this.mouseButtons= -{ORBIT:c.MOUSE.LEFT,ZOOM:c.MOUSE.MIDDLE,PAN:c.MOUSE.RIGHT};var f=this,G=new c.Vector2,l=new c.Vector2,m=new c.Vector2,p=new c.Vector2,A=new c.Vector2,t=new c.Vector2,v=new c.Vector3,K=new c.Vector3,q=new c.Vector2,y=new c.Vector2,z=new c.Vector2,F=0,C=0,H=0,J=0,N=1,O=new c.Vector3,P=new c.Vector3,Q=new c.Quaternion,w={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},D=w.NONE;this.target0=this.target.clone();this.position0=this.object.position.clone();this.zoom0=this.object.zoom; -var S=(new c.Quaternion).setFromUnitVectors(a.up,new c.Vector3(0,1,0)),T=S.clone().inverse(),E={type:"change"},R={type:"start"},U={type:"end"},L={type:"fov"};this.setLastQuaternion=function(a){Q.copy(a);f.object.quaternion.copy(a)};this.getLastPosition=function(){return P};this.rotateLeft=function(a){void 0===a&&(a=2*Math.PI/60/60*f.autoRotateSpeed);a=this.momentum&&!this.autoRotate?a/=this.momentumFactor:a;J-=a};this.rotateUp=function(a){void 0===a&&(a=2*Math.PI/60/60*f.autoRotateSpeed);a=this.momentum&& -!this.autoRotate?a/=this.momentumFactor:a;H-=a};this.rotateLeftStatic=function(a){this.enableDamping=!1;J-=a;this.update();this.enableDamping=!0};this.rotateUpStatic=function(a){this.enableDamping=!1;H-=a;this.update();this.enableDamping=!0};this.panLeft=function(a){var b=this.object.matrix.elements;v.set(b[0],b[1],b[2]);v.multiplyScalar(-a);O.add(v)};this.panUp=function(a){var b=this.object.matrix.elements;v.set(b[4],b[5],b[6]);v.multiplyScalar(a);O.add(v)};this.pan=function(a,b){var d=f.domElement=== +{ORBIT:c.MOUSE.LEFT,ZOOM:c.MOUSE.MIDDLE,PAN:c.MOUSE.RIGHT};var f=this,z=new c.Vector2,m=new c.Vector2,n=new c.Vector2,p=new c.Vector2,C=new c.Vector2,u=new c.Vector2,w=new c.Vector3,v=new c.Vector3,q=new c.Vector2,B=new c.Vector2,G=new c.Vector2,F=0,O=0,H=0,J=0,M=1,N=new c.Vector3,P=new c.Vector3,Q=new c.Quaternion,x={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},D=x.NONE;this.target0=this.target.clone();this.position0=this.object.position.clone();this.zoom0=this.object.zoom; +var S=(new c.Quaternion).setFromUnitVectors(a.up,new c.Vector3(0,1,0)),T=S.clone().inverse(),E={type:"change"},R={type:"start"},U={type:"end"},K={type:"fov"};this.setLastQuaternion=function(a){Q.copy(a);f.object.quaternion.copy(a)};this.getLastPosition=function(){return P};this.rotateLeft=function(a){void 0===a&&(a=2*Math.PI/60/60*f.autoRotateSpeed);a=this.momentum&&!this.autoRotate?a/=this.momentumFactor:a;J-=a};this.rotateUp=function(a){void 0===a&&(a=2*Math.PI/60/60*f.autoRotateSpeed);a=this.momentum&& +!this.autoRotate?a/=this.momentumFactor:a;H-=a};this.rotateLeftStatic=function(a){this.enableDamping=!1;J-=a;this.update();this.enableDamping=!0};this.rotateUpStatic=function(a){this.enableDamping=!1;H-=a;this.update();this.enableDamping=!0};this.panLeft=function(a){var b=this.object.matrix.elements;w.set(b[0],b[1],b[2]);w.multiplyScalar(-a);N.add(w)};this.panUp=function(a){var b=this.object.matrix.elements;w.set(b[4],b[5],b[6]);w.multiplyScalar(a);N.add(w)};this.pan=function(a,b){var d=f.domElement=== document?f.domElement.body:f.domElement;if(f.object instanceof c.PerspectiveCamera){var g=f.object.position.clone().sub(f.target).length();g*=Math.tan(f.object.fov/2*Math.PI/180);f.panLeft(2*a*g/d.clientHeight);f.panUp(2*b*g/d.clientHeight)}else f.object instanceof c.OrthographicCamera?(f.panLeft(a*(f.object.right-f.object.left)/d.clientWidth),f.panUp(b*(f.object.top-f.object.bottom)/d.clientHeight)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.")};this.dollyIn= -function(a){void 0===a&&(a=Math.pow(.95,f.zoomSpeed));f.object instanceof c.PerspectiveCamera?N/=a:f.object instanceof c.OrthographicCamera?(f.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*a)),f.object.updateProjectionMatrix(),f.dispatchEvent(E)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")};this.dollyOut=function(a){void 0===a&&(a=Math.pow(.95,f.zoomSpeed));f.object instanceof c.PerspectiveCamera?N*=a:f.object instanceof -c.OrthographicCamera?(f.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/a)),f.object.updateProjectionMatrix(),f.dispatchEvent(E)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")};this.update=function(a){var b=this.object.position;K.copy(b).sub(this.target);K.applyQuaternion(S);F=Math.atan2(K.x,K.z);C=Math.atan2(Math.sqrt(K.x*K.x+K.z*K.z),K.y);this.autoRotate&&D===w.NONE&&this.rotateLeft(2*Math.PI/60/60*f.autoRotateSpeed); -!0===this.enableDamping&&(J=c.Math.clamp(J,-this.speedLimit,this.speedLimit),H=c.Math.clamp(H,-this.speedLimit,this.speedLimit));F+=J;C+=H;F=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,F));C=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,C));C=Math.max(1E-7,Math.min(Math.PI-1E-7,C));var d=K.length()*N;d=Math.max(this.minDistance,Math.min(this.maxDistance,d));this.target.add(O);K.x=d*Math.sin(C)*Math.sin(F);K.y=d*Math.cos(C);K.z=d*Math.sin(C)*Math.cos(F);K.applyQuaternion(T); -b.copy(this.target).add(K);this.object.lookAt(this.target);f.spherical.set(d,C,F);this.autoRotate||!0!==this.enableDamping||(!this.momentum||D!==w.ROTATE&&D!==w.TOUCH_ROTATE)&&D!==w.NONE?H=J=0:(J*=1-this.dampingFactor,H*=1-this.dampingFactor);N=1;O.set(0,0,0);if(1E-7d&&(d+=360);b.deviceOrientation={alpha:d,beta:g,gamma:a}},g=function(){b.screenOrientation= -window.orientation||0},u=function(){window.addEventListener("orientationchange",g,!1);window.addEventListener("deviceorientation",d,!1)}.bind(this),e=function(){var a=new c.Vector3(0,0,1),b=new c.Euler,d=new c.Quaternion,g=new c.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return function(c,u,e,k,r){b.set(e,u,-k,"YXZ");c.setFromEuler(b);c.multiply(g);c.multiply(d.setFromAxisAngle(a,-r))}}();this.connect=function(){g();void 0!==window.DeviceOrientationEvent&&"function"===typeof window.DeviceOrientationEvent.requestPermission? -window.DeviceOrientationEvent.requestPermission().then(function(a){"granted"==a&&u()}).catch(function(a){console.error("THREE.DeviceOrientationControls: Unable to use DeviceOrientation API:",a)}):u();b.enabled=!0};this.disconnect=function(){window.removeEventListener("orientationchange",g,!1);window.removeEventListener("deviceorientation",d,!1);b.enabled=!1;b.deviceOrientation=null;b.initialOffset=null};this.update=function(a){a=void 0===a?{theta:0}:a;a=void 0===a.theta?0:a.theta;if(!1!==b.enabled){var d= -b.deviceOrientation;if(d){var g=d.alpha?c.Math.degToRad(d.alpha)+b.alphaOffset:0,u=d.beta?c.Math.degToRad(d.beta):0;d=d.gamma?c.Math.degToRad(d.gamma):0;var k=b.screenOrientation?c.Math.degToRad(b.screenOrientation):0;e(b.object.quaternion,g+a,u,d,k)}}};this.dispose=function(){b.disconnect()};this.getAlpha=function(){var a=b.deviceOrientation;return a&&a.alpha?c.Math.degToRad(a.alpha)+b.alphaOffset:0};this.getBeta=function(){var a=b.deviceOrientation;return a&&a.beta?c.Math.degToRad(a.beta):0}}function za(a){var b= -new c.OrthographicCamera(-1,1,1,-1,0,1),d=new c.Scene,g=new c.StereoCamera;g.aspect=.5;var u=new c.WebGLRenderTarget(512,512,{minFilter:c.LinearFilter,magFilter:c.NearestFilter,format:c.RGBAFormat});u.scissorTest=!0;u.texture.generateMipmaps=!1;var e=new c.Vector2(.441,.156),r=(new c.PlaneBufferGeometry(1,1,10,20)).removeAttribute("normal").toNonIndexed(),I=r.attributes.position.array,B=r.attributes.uv.array;r.attributes.position.count*=2;r.attributes.uv.count*=2;var h=new Float32Array(2*I.length); -h.set(I);h.set(I,I.length);var l=new Float32Array(2*B.length);l.set(B);l.set(B,B.length);B=new c.Vector2;I=I.length/3;for(var f=0,n=h.length/3;fd&&(d+=360);b.deviceOrientation={alpha:d,beta:g,gamma:a}},g=function(){b.screenOrientation= +window.orientation||0},t=function(){window.addEventListener("orientationchange",g,!1);window.addEventListener("deviceorientation",d,!1)}.bind(this),e=function(){var a=new c.Vector3(0,0,1),b=new c.Euler,d=new c.Quaternion,g=new c.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return function(c,t,e,k,r){b.set(e,t,-k,"YXZ");c.setFromEuler(b);c.multiply(g);c.multiply(d.setFromAxisAngle(a,-r))}}();this.connect=function(){g();void 0!==window.DeviceOrientationEvent&&"function"===typeof window.DeviceOrientationEvent.requestPermission? +window.DeviceOrientationEvent.requestPermission().then(function(a){"granted"==a&&t()}).catch(function(a){console.error("THREE.DeviceOrientationControls: Unable to use DeviceOrientation API:",a)}):t();b.enabled=!0};this.disconnect=function(){window.removeEventListener("orientationchange",g,!1);window.removeEventListener("deviceorientation",d,!1);b.enabled=!1;b.deviceOrientation=null;b.initialOffset=null};this.update=function(a){a=void 0===a?{theta:0}:a;a=void 0===a.theta?0:a.theta;if(!1!==b.enabled){var d= +b.deviceOrientation;if(d){var g=d.alpha?c.Math.degToRad(d.alpha)+b.alphaOffset:0,t=d.beta?c.Math.degToRad(d.beta):0;d=d.gamma?c.Math.degToRad(d.gamma):0;var k=b.screenOrientation?c.Math.degToRad(b.screenOrientation):0;e(b.object.quaternion,g+a,t,d,k)}}};this.dispose=function(){b.disconnect()};this.getAlpha=function(){var a=b.deviceOrientation;return a&&a.alpha?c.Math.degToRad(a.alpha)+b.alphaOffset:0};this.getBeta=function(){var a=b.deviceOrientation;return a&&a.beta?c.Math.degToRad(a.beta):0}}function ya(a){var b= +new c.OrthographicCamera(-1,1,1,-1,0,1),d=new c.Scene,g=new c.StereoCamera;g.aspect=.5;var t=new c.WebGLRenderTarget(512,512,{minFilter:c.LinearFilter,magFilter:c.NearestFilter,format:c.RGBAFormat});t.scissorTest=!0;t.texture.generateMipmaps=!1;var e=new c.Vector2(.441,.156),r=(new c.PlaneBufferGeometry(1,1,10,20)).removeAttribute("normal").toNonIndexed(),I=r.attributes.position.array,A=r.attributes.uv.array;r.attributes.position.count*=2;r.attributes.uv.count*=2;var h=new Float32Array(2*I.length); +h.set(I);h.set(I,I.length);var m=new Float32Array(2*A.length);m.set(A);m.set(A,A.length);A=new c.Vector2;I=I.length/3;for(var f=0,z=h.length/3;fe&&(l.total=l.total/e*6);d(l)},g)});return k}};l.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{setContainer:function(a){this.container=a},setScene:function(a){this.scene=a},enumerateDevices:function(){var a=this.devices,b=new Promise(function(b){b(a)});return 0e&&(h.total=h.total/e*6);d(h)},g)});return k}};m.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{setContainer:function(a){this.container=a},setScene:function(a){this.scene=a},enumerateDevices:function(){var a=this.devices,b=new Promise(function(b){b(a)});return 0=c.length?(d(0),g--):d(g);b(c[g])})},getDevices:function(a){a=void 0===a?"video":a;var b=this.devices;return this.enumerateDevices().then(function(a){return a.map(function(a){b.includes(a)||b.push(a);return a})}).then(function(b){var d=new RegExp(a,"i");return b.filter(function(a){return d.test(a.kind)})})},getUserMedia:function(a){var b=this.setMediaStream.bind(this),d=this.playVideo.bind(this); return window.navigator.mediaDevices.getUserMedia(a).then(b).then(d).catch(function(a){console.warn("PANOLENS.Media: "+a)})},setVideDeviceIndex:function(a){this.videoDeviceIndex=a},start:function(a){var b=this.constraints,d=this.getUserMedia.bind(this);this.element=this.createVideoElement();return this.getDevices().then(function(g){if(!g||0===g.length)throw Error("no video device found");b.video.deviceId=(a||g[0]).deviceId;return d(b)})},stop:function(){var a=this.stream;a&&a.active&&(a.getTracks()[0].stop(), window.removeEventListener("resize",this.onWindowResize.bind(this)),this.stream=this.element=null)},setMediaStream:function(a){this.stream=a;this.element.srcObject=a;this.scene&&(this.scene.background=this.createVideoTexture());window.addEventListener("resize",this.onWindowResize.bind(this))},playVideo:function(){var a=this.element;a&&(a.play(),this.dispatchEvent({type:"play"}))},pauseVideo:function(){var a=this.element;a&&(a.pause(),this.dispatchEvent({type:"pause"}))},createVideoTexture:function(){var a= this.element,b=new c.VideoTexture(a);b.generateMipmaps=!1;b.minFilter=c.LinearFilter;b.magFilter=c.LinearFilter;b.format=c.RGBFormat;b.center.set(.5,.5);a.addEventListener("canplay",this.onWindowResize.bind(this));return b},createVideoElement:function(){var a=this.dispatchEvent.bind(this),b=document.createElement("video");b.setAttribute("autoplay","");b.setAttribute("muted","");b.setAttribute("playsinline","");b.style.position="absolute";b.style.top="0";b.style.left="0";b.style.width="100%";b.style.height= -"100%";b.style.objectPosition="center";b.style.objectFit="cover";b.style.display=this.scene?"none":"";b.addEventListener("canplay",function(){return a({type:"canplay"})});return b},onWindowResize:function(){if(this.element&&this.element.videoWidth&&this.element.videoHeight&&this.scene){var a=this.container,b=a.clientWidth;a=a.clientHeight;var d=this.scene.background,g=this.element;g=g.videoHeight/g.videoWidth*(this.container?b/a:1)*this.ratioScalar;b>a?d.repeat.set(g,1):d.repeat.set(1,1/g)}}});Object.assign(m.prototype, -{constructor:m,updateUniformByFormat:function(a,b){this.format=a;var d=b.repeat.value;b=b.offset.value;var g=this.loffset,c=this.roffset;switch(a){case S.TAB:d.set(1,.5);b.set(0,.5);g.set(0,.5);c.set(0,0);break;case S.SBS:d.set(.5,1),b.set(0,0),g.set(0,0),c.set(.5,0)}},updateTextureToLeft:function(a){a.copy(this.loffset)},updateTextureToRight:function(a){a.copy(this.roffset)}});p.prototype=Object.assign(Object.create(c.Sprite.prototype),{constructor:p,setColor:function(a){this.material.color.copy(a instanceof +"100%";b.style.objectPosition="center";b.style.objectFit="cover";b.style.display=this.scene?"none":"";b.addEventListener("canplay",function(){return a({type:"canplay"})});return b},onWindowResize:function(){if(this.element&&this.element.videoWidth&&this.element.videoHeight&&this.scene){var a=this.container,b=a.clientWidth;a=a.clientHeight;var d=this.scene.background,g=this.element;g=g.videoHeight/g.videoWidth*(this.container?b/a:1)*this.ratioScalar;b>a?d.repeat.set(g,1):d.repeat.set(1,1/g)}}});Object.assign(u.prototype, +{constructor:u,updateUniformByFormat:function(a,b){this.format=a;var d=b.repeat.value;b=b.offset.value;var g=this.loffset,c=this.roffset;switch(a){case S.TAB:d.set(1,.5);b.set(0,.5);g.set(0,.5);c.set(0,0);break;case S.SBS:d.set(.5,1),b.set(0,0),g.set(0,0),c.set(.5,0)}},updateTextureToLeft:function(a){a.copy(this.loffset)},updateTextureToRight:function(a){a.copy(this.roffset)}});p.prototype=Object.assign(Object.create(c.Sprite.prototype),{constructor:p,setColor:function(a){this.material.color.copy(a instanceof c.Color?a:new c.Color(a))},createCanvasTexture:function(a){a=new c.CanvasTexture(a);a.minFilter=c.LinearFilter;a.magFilter=c.LinearFilter;a.generateMipmaps=!1;return a},createCanvas:function(){var a=document.createElement("canvas"),b=a.getContext("2d"),d=this.dpr;a.width=32*d;a.height=32*d;b.scale(d,d);b.shadowBlur=5;b.shadowColor="rgba(200,200,200,0.9)";return{canvas:a,context:b}},updateCanvasArcByProgress:function(a){var b=this.context,d=this.canvasWidth,g=this.canvasHeight,c=this.material,e=this.dpr, -r=a*Math.PI*2,h=this.color.getStyle(),l=.5*d/e;e=.5*g/e;b.clearRect(0,0,d,g);b.beginPath();0===a?(b.arc(l,e,d/16,0,2*Math.PI),b.fillStyle=h,b.fill()):(b.arc(l,e,d/4-3,-Math.PI/2,-Math.PI/2+r),b.strokeStyle=h,b.lineWidth=3,b.stroke());b.closePath();c.map.needsUpdate=!0},ripple:function(){var a=this,b=this.context,d=this.canvasWidth,g=this.canvasHeight,c=this.material,e=this.rippleDuration,r=performance.now(),h=this.color,l=this.dpr,m=.5*d/l,n=.5*g/l,f=function(){var u=window.requestAnimationFrame(f), -k=(performance.now()-r)/e,B=0<1-k?1-k:0,p=k*d*.5/l;b.clearRect(0,0,d,g);b.beginPath();b.arc(m,n,p,0,2*Math.PI);b.fillStyle="rgba("+255*h.r+", "+255*h.g+", "+255*h.b+", "+B+")";b.fill();b.closePath();1<=k&&(window.cancelAnimationFrame(u),a.updateCanvasArcByProgress(0),a.dispatchEvent({type:"reticle-ripple-end"}));c.map.needsUpdate=!0};this.dispatchEvent({type:"reticle-ripple-start"});f()},show:function(){this.visible=!0},hide:function(){this.visible=!1},start:function(a){this.autoSelect&&(this.dispatchEvent({type:"reticle-start"}), +r=a*Math.PI*2,h=this.color.getStyle(),l=.5*d/e;e=.5*g/e;b.clearRect(0,0,d,g);b.beginPath();0===a?(b.arc(l,e,d/16,0,2*Math.PI),b.fillStyle=h,b.fill()):(b.arc(l,e,d/4-3,-Math.PI/2,-Math.PI/2+r),b.strokeStyle=h,b.lineWidth=3,b.stroke());b.closePath();c.map.needsUpdate=!0},ripple:function(){var a=this,b=this.context,d=this.canvasWidth,g=this.canvasHeight,c=this.material,e=this.rippleDuration,r=performance.now(),h=this.color,l=this.dpr,m=.5*d/l,n=.5*g/l,f=function(){var t=window.requestAnimationFrame(f), +k=(performance.now()-r)/e,A=0<1-k?1-k:0,p=k*d*.5/l;b.clearRect(0,0,d,g);b.beginPath();b.arc(m,n,p,0,2*Math.PI);b.fillStyle="rgba("+255*h.r+", "+255*h.g+", "+255*h.b+", "+A+")";b.fill();b.closePath();1<=k&&(window.cancelAnimationFrame(t),a.updateCanvasArcByProgress(0),a.dispatchEvent({type:"reticle-ripple-end"}));c.map.needsUpdate=!0};this.dispatchEvent({type:"reticle-ripple-start"});f()},show:function(){this.visible=!0},hide:function(){this.visible=!1},start:function(a){this.autoSelect&&(this.dispatchEvent({type:"reticle-start"}), this.startTimestamp=performance.now(),this.callback=a,this.update())},end:function(){this.startTimestamp&&(window.cancelAnimationFrame(this.timerId),this.updateCanvasArcByProgress(0),this.startTimestamp=this.timerId=this.callback=null,this.dispatchEvent({type:"reticle-end"}))},update:function(){this.timerId=window.requestAnimationFrame(this.update.bind(this));var a=(performance.now()-this.startTimestamp)/this.dwellTime;this.updateCanvasArcByProgress(a);this.dispatchEvent({type:"reticle-update",progress:a}); 1<=a&&(window.cancelAnimationFrame(this.timerId),this.callback&&this.callback(),this.end(),this.ripple())}});var T=function(){this._tweens={};this._tweensAddedDuringUpdate={}};T.prototype={getAll:function(){return Object.keys(this._tweens).map(function(a){return this._tweens[a]}.bind(this))},removeAll:function(){this._tweens={}},add:function(a){this._tweens[a.getId()]=a;this._tweensAddedDuringUpdate[a.getId()]=a},remove:function(a){delete this._tweens[a.getId()];delete this._tweensAddedDuringUpdate[a.getId()]}, -update:function(a,b){var d=Object.keys(this._tweens);if(0===d.length)return!1;for(a=void 0!==a?a:n.now();0(a*=2)?.5*a*a:-.5*(--a*(a-2)-1)}},Cubic:{In:function(a){return a*a*a},Out:function(a){return--a*a*a+1},InOut:function(a){return 1>(a*=2)?.5*a*a*a:.5*((a-=2)*a*a+2)}},Quartic:{In:function(a){return a*a*a*a},Out:function(a){return 1- --a*a*a*a},InOut:function(a){return 1>(a*=2)?.5*a*a*a*a:-.5*((a-=2)*a*a*a-2)}},Quintic:{In:function(a){return a* +this._duration);return!1}return!0}};h.Easing={Linear:{None:function(a){return a}},Quadratic:{In:function(a){return a*a},Out:function(a){return a*(2-a)},InOut:function(a){return 1>(a*=2)?.5*a*a:-.5*(--a*(a-2)-1)}},Cubic:{In:function(a){return a*a*a},Out:function(a){return--a*a*a+1},InOut:function(a){return 1>(a*=2)?.5*a*a*a:.5*((a-=2)*a*a+2)}},Quartic:{In:function(a){return a*a*a*a},Out:function(a){return 1- --a*a*a*a},InOut:function(a){return 1>(a*=2)?.5*a*a*a*a:-.5*((a-=2)*a*a*a-2)}},Quintic:{In:function(a){return a* a*a*a*a},Out:function(a){return--a*a*a*a*a+1},InOut:function(a){return 1>(a*=2)?.5*a*a*a*a*a:.5*((a-=2)*a*a*a*a+2)}},Sinusoidal:{In:function(a){return 1-Math.cos(a*Math.PI/2)},Out:function(a){return Math.sin(a*Math.PI/2)},InOut:function(a){return.5*(1-Math.cos(Math.PI*a))}},Exponential:{In:function(a){return 0===a?0:Math.pow(1024,a-1)},Out:function(a){return 1===a?1:1-Math.pow(2,-10*a)},InOut:function(a){return 0===a?0:1===a?1:1>(a*=2)?.5*Math.pow(1024,a-1):.5*(-Math.pow(2,-10*(a-1))+2)}},Circular:{In:function(a){return 1- Math.sqrt(1-a*a)},Out:function(a){return Math.sqrt(1- --a*a)},InOut:function(a){return 1>(a*=2)?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)}},Elastic:{In:function(a){return 0===a?0:1===a?1:-Math.pow(2,10*(a-1))*Math.sin(5*(a-1.1)*Math.PI)},Out:function(a){return 0===a?0:1===a?1:Math.pow(2,-10*a)*Math.sin(5*(a-.1)*Math.PI)+1},InOut:function(a){if(0===a)return 0;if(1===a)return 1;a*=2;return 1>a?-.5*Math.pow(2,10*(a-1))*Math.sin(5*(a-1.1)*Math.PI):.5*Math.pow(2,-10*(a-1))*Math.sin(5*(a-1.1)* -Math.PI)+1}},Back:{In:function(a){return a*a*(2.70158*a-1.70158)},Out:function(a){return--a*a*(2.70158*a+1.70158)+1},InOut:function(a){return 1>(a*=2)?.5*a*a*(3.5949095*a-2.5949095):.5*((a-=2)*a*(3.5949095*a+2.5949095)+2)}},Bounce:{In:function(a){return 1-n.Easing.Bounce.Out(1-a)},Out:function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},InOut:function(a){return.5>a?.5*n.Easing.Bounce.In(2*a):.5*n.Easing.Bounce.Out(2* -a-1)+.5}}};n.Interpolation={Linear:function(a,b){var d=a.length-1,c=d*b,e=Math.floor(c),k=n.Interpolation.Utils.Linear;return 0>b?k(a[0],a[1],c):1d?d:e+1],c-e)},Bezier:function(a,b){for(var d=0,c=a.length-1,e=Math.pow,k=n.Interpolation.Utils.Bernstein,r=0;r<=c;r++)d+=e(1-b,c-r)*e(b,r)*a[r]*k(c,r);return d},CatmullRom:function(a,b){var d=a.length-1,c=d*b,e=Math.floor(c),k=n.Interpolation.Utils.CatmullRom;return a[0]===a[d]?(0>b&&(e=Math.floor(c=d*(1+b))),k(a[(e-1+ -d)%d],a[e],a[(e+1)%d],a[(e+2)%d],c-e)):0>b?a[0]-(k(a[0],a[0],a[1],a[1],-c)-a[0]):1(a*=2)?.5*a*a*(3.5949095*a-2.5949095):.5*((a-=2)*a*(3.5949095*a+2.5949095)+2)}},Bounce:{In:function(a){return 1-h.Easing.Bounce.Out(1-a)},Out:function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},InOut:function(a){return.5>a?.5*h.Easing.Bounce.In(2*a):.5*h.Easing.Bounce.Out(2* +a-1)+.5}}};h.Interpolation={Linear:function(a,b){var d=a.length-1,c=d*b,e=Math.floor(c),k=h.Interpolation.Utils.Linear;return 0>b?k(a[0],a[1],c):1d?d:e+1],c-e)},Bezier:function(a,b){for(var d=0,c=a.length-1,e=Math.pow,k=h.Interpolation.Utils.Bernstein,r=0;r<=c;r++)d+=e(1-b,c-r)*e(b,r)*a[r]*k(c,r);return d},CatmullRom:function(a,b){var d=a.length-1,c=d*b,e=Math.floor(c),k=h.Interpolation.Utils.CatmullRom;return a[0]===a[d]?(0>b&&(e=Math.floor(c=d*(1+b))),k(a[(e-1+ +d)%d],a[e],a[(e+1)%d],a[(e+2)%d],c-e)):0>b?a[0]-(k(a[0],a[0],a[1],a[1],-c)-a[0]):1m?0:m,f.setProgress(m),e.dispatchEvent({type:"panolens-viewer-handler",method:"setVideoCurrentTime",data:m}))}function d(a){a.stopPropagation();k=!1;c()}function c(){e.container.removeEventListener("mousemove",b,!1);e.container.removeEventListener("mouseup",d, !1);e.container.removeEventListener("touchmove",b,!1);e.container.removeEventListener("touchend",d,!1)}var e=this,k=!1,h,l,m;var n=document.createElement("div");n.style.width="0%";n.style.height="100%";n.style.backgroundColor="#fff";var p=document.createElement("div");p.style.float="right";p.style.width="14px";p.style.height="14px";p.style.transform="translate(7px, -5px)";p.style.borderRadius="50%";p.style.backgroundColor="#ddd";p.addEventListener("mousedown",a,{passive:!0});p.addEventListener("touchstart", a,{passive:!0});n.appendChild(p);var f=this.createCustomItem({style:{float:"left",width:"30%",height:"4px",marginTop:"20px",backgroundColor:"rgba(188,188,188,0.8)"},onTap:function(a){a.preventDefault();a.stopPropagation();if(a.target!==p){var b=a.changedTouches&&0\n void main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV;\n sampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n sampleUV *= repeat;\n sampleUV += offset;\n sampleUV.x = fract(sampleUV.x);\n sampleUV.y = fract(sampleUV.y);\n gl_FragColor = vec4(texture2D( texture, sampleUV ).rgb, opacity);\n }\n ", -vertexShader:"\n varying vec3 vWorldDirection;\n #include \n void main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n }\n ",uniforms:d,side:c.BackSide,transparent:!0})},add:function(a){if(1\n void main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV;\n sampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n sampleUV *= repeat;\n sampleUV += offset;\n sampleUV.x = fract(sampleUV.x);\n sampleUV.y = fract(sampleUV.y);\n gl_FragColor = vec4(texture2D( texture, sampleUV ).rgb, opacity);\n }\n ", +vertexShader:"\n varying vec3 vWorldDirection;\n #include \n void main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n }\n ",uniforms:d,side:c.BackSide,transparent:!0})},add:function(a){if(1= -window.innerWidth?this.ImageQualityFair:800=window.innerWidth?this.ImageQualityMedium:1280=window.innerWidth?this.ImageQualityHigh:1920= +window.innerWidth?this.ImageQualityFair:800=window.innerWidth?this.ImageQualityMedium:1280=window.innerWidth?this.ImageQualityHigh:1920=c&&(b.zoom.value=c)},onUpdateCallback:function(){this.frameId=window.requestAnimationFrame(this.onUpdateCallback.bind(this));this.quatSlerp.slerp(this.quatCur,.1);this.material&& this.material.uniforms.transform.value.makeRotationFromQuaternion(this.quatSlerp);!this.dragging&&1-this.quatSlerp.clone().dot(this.quatCur).95*b.min_horizontal_fov?d.fov=this.calculateFOV(.95*b.min_horizontal_fov,!1):k.95*b.min_horizontal_fov?d.fov=this.calculateFOV(.95*b.min_horizontal_fov,!1):k\n \n void main() {\n \n vUv = uv;\n gl_Position = vec4( position, 1.0 );\n #include \n #include \n \n }\n ",uniforms:d,transparent:!0})},update2DGeometryScale:function(a){a=void 0===a?!1:a;if(this.momentData)if(this.geometry.scale(1/this.scale2D.x,1/this.scale2D.y,1),a)this.scale2D.set(1,1);else{a=this.momentData.aspect_ratio; -var b=this.camera;b=2*Math.tan(b.fov*Math.PI/360)*Math.min(a,b.aspect);this.scale2D.set(b,b/a);this.geometry.scale(this.scale2D.x,this.scale2D.y,1)}},enter:function(){this.position.set(0,0,-1);this._parent=this.parent;this.camera.add(this);this.update2DGeometryScale();F.prototype.enter.call(this)},leave:function(){this.position.set(0,0,0);this._parent.add(this);delete this._parent;F.prototype.leave.call(this)}});qa.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:qa}); -ra.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:ra});var Ea=function(a){var b=new c.StereoCamera;b.aspect=.5;var d=new c.Vector2;this.setEyeSeparation=function(a){b.eyeSep=a};this.setSize=function(b,d){a.setSize(b,d)};this.render=function(c,e,k){var g=k instanceof Z||k instanceof R;c.updateMatrixWorld();null===e.parent&&e.updateMatrixWorld();g&&this.setEyeSeparation(k.stereo.eyeSep);b.update(e);a.getSize(d);a.autoClear&&a.clear();a.setScissorTest(!0);g&&k.updateTextureToLeft(); -a.setScissor(0,0,d.width/2,d.height);a.setViewport(0,0,d.width/2,d.height);a.render(c,b.cameraL);g&&k.updateTextureToRight();a.setScissor(d.width/2,0,d.width/2,d.height);a.setViewport(d.width/2,0,d.width/2,d.height);a.render(c,b.cameraR);a.setScissorTest(!1);g&&k.updateTextureToLeft()}};sa.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:sa,setupScene:function(a){return a=void 0===a?new c.Scene:a},setupCamera:function(a,b,d){return d=void 0===d?new c.PerspectiveCamera(a, -b,1,1E4):d},setupRenderer:function(a,b){a=void 0===a?new c.WebGLRenderer({alpha:!0,antialias:!1}):a;var d=b.clientWidth,e=b.clientHeight;a.setPixelRatio(window.devicePixelRatio);a.setSize(d,e);a.setClearColor(0,0);a.autoClear=!1;a.domElement.classList.add("panolens-canvas");a.domElement.style.display="block";a.domElement.style.transition="opacity 0.5s ease";b.style.backgroundColor="#000";b.appendChild(a.domElement);return a},setupControls:function(a,b){var d=this.options,c=d.autoRotate,e=d.autoRotateSpeed, -k=d.horizontalView,h=d.momentum,l=d.rotateSpeed;d=d.dampingFactor;b=new qa(a,b);b.id="orbit";b.index=N.ORBIT;b.minDistance=1;b.noPan=!0;b.autoRotate=c;b.autoRotateSpeed=e;b.momentum=h;b.rotateSpeed=l;b.dampingFactor=d;k&&(b.minPolarAngle=Math.PI/2,b.maxPolarAngle=Math.PI/2);a=new ra(a);a.id="device-orientation";a.index=N.DEVICEORIENTATION;a.enabled=!1;this.controls=[b,a];this.OrbitControls=b;this.DeviceOrientationControls=a;return b},setupEffects:function(a,b){var d=b.clientWidth;b=b.clientHeight; -var c=new za(a);c.setSize(d,b);a=new Ea(a);a.setSize(d,b);this.CardboardEffect=c;this.StereoEffect=a;return c},setupContainer:function(a){if(a)return a._width=a.clientWidth,a._height=a.clientHeight,a;a=document.createElement("div");a.classList.add("panolens-container");a.style.width="100%";a.style.height="100%";document.body.appendChild(a);return a},setupTween:function(){this.tweenCanvasOpacityOut.to({},500).easing(n.Easing.Exponential.Out);this.tweenCanvasOpacityIn.to({},500).easing(n.Easing.Exponential.Out); -this.tweenCanvasOpacityOut.chain(this.tweenCanvasOpacityIn)},add:function(a){var b=this.container,d=this.scene,c=this.camera,e=this.controls;if(1=a.length?0:b},setCameraFov:function(a){this.camera.fov=a;this.camera.updateProjectionMatrix()},getRaycastViewCenter:function(){var a=new c.Raycaster;a.setFromCamera(new c.Vector2(0,0),this.camera);a=a.intersectObject(this.panorama);return 0=a.length?0:b},setCameraFov:function(a){this.camera.fov=a;this.camera.updateProjectionMatrix()},getRaycastViewCenter:function(){var a=new c.Raycaster;a.setFromCamera(new c.Vector2(0,0),this.camera);a=a.intersectObject(this.panorama);return 0Math.PI?e-2*Math.PI:e;e=e<-Math.PI?e+2*Math.PI:e;b=Math.abs(d.angleTo(b)+(0>=d.y*h.y?h.angleTo(a):-h.angleTo(a)));b*=h.y=a.clientX-this.options.clickTolerance&&this.userMouse.x<=a.clientX+ -this.options.clickTolerance&&this.userMouse.y>=a.clientY-this.options.clickTolerance&&this.userMouse.y<=a.clientY+this.options.clickTolerance||a.changedTouches&&this.userMouse.x>=a.changedTouches[0].clientX-this.options.clickTolerance&&this.userMouse.x<=a.changedTouches[0].clientX+this.options.clickTolerance&&this.userMouse.y>=a.changedTouches[0].clientY-this.options.clickTolerance&&this.userMouse.y<=a.changedTouches[0].clientY+this.options.clickTolerance?"click":void 0;if(!a||!a.target||a.target.classList.contains("panolens-canvas"))if(a.preventDefault(), -a=a.changedTouches&&1===a.changedTouches.length?this.onTap({clientX:a.changedTouches[0].clientX,clientY:a.changedTouches[0].clientY},b):this.onTap(a,b),this.userMouse.type="none",!a&&"click"===b){b=this.options;a=b.autoHideControlBar;var d=this.panorama,c=this.toggleControlBar;b.autoHideInfospot&&d&&d.toggleInfospotVisibility();a&&c()}},onTap:function(a,b){var d=this.container.getBoundingClientRect(),c=d.top,e=this.container,h=e.clientHeight;this.raycasterPoint.x=(a.clientX-d.left)/e.clientWidth* -2-1;this.raycasterPoint.y=2*-((a.clientY-c)/h)+1;this.raycaster.setFromCamera(this.raycasterPoint,this.camera);if(this.panorama){("mousedown"!==a.type&&this.touchSupported||this.outputEnabled)&&this.outputPosition();d=this.raycaster.intersectObjects(this.panorama.children,!0);c=this.getConvertedIntersect(d);e=0Math.abs(b)&&this.tweenLeftAnimation.stop();e(b);m=a.left}.bind(this)).start();this.tweenUpAnimation=(new h.Tween(l)).to({up:c},b).easing(d).onUpdate(function(a){var b= +a.up-n;1E-4>Math.abs(b)&&this.tweenUpAnimation.stop();k(b);n=a.up}.bind(this)).start()},tweenControlCenterByObject:function(a,b,d){this.tweenControlCenter(a.getWorldPosition(new c.Vector3),b,d)},onWindowResize:function(a,b){var d=this.container.classList.contains("panolens-container")||this.container.isFullscreen;if(void 0!==a&&void 0!==b){var c=a;var e=b;this.container._width=a;this.container._height=b}else a=va?Math.min(document.documentElement.clientWidth,window.innerWidth||0):Math.max(document.documentElement.clientWidth, +window.innerWidth||0),b=va?Math.min(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientHeight,window.innerHeight||0),c=d?a:this.container.clientWidth,e=d?b:this.container.clientHeight,this.container._width=c,this.container._height=e;this.camera.aspect=c/e;this.camera.updateProjectionMatrix();this.renderer.setSize(c,e);(this.options.enableReticle||this.tempEnableReticle)&&this.updateReticleEvent();this.dispatchEvent({type:"window-resize",width:c,height:e}); +this.scene.traverse(function(a){a.dispatchEvent&&a.dispatchEvent({type:"window-resize",width:c,height:e})})},addOutputElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="10px";a.style.top="10px";a.style.color="#fff";this.container.appendChild(a);this.outputDivElement=a},outputPosition:function(){var a=this.raycaster.intersectObject(this.panorama,!0);if(0=a.clientX-this.options.clickTolerance&&this.userMouse.x<=a.clientX+this.options.clickTolerance&&this.userMouse.y>=a.clientY-this.options.clickTolerance&&this.userMouse.y<=a.clientY+this.options.clickTolerance||a.changedTouches&&this.userMouse.x>=a.changedTouches[0].clientX-this.options.clickTolerance&&this.userMouse.x<=a.changedTouches[0].clientX+this.options.clickTolerance&&this.userMouse.y>=a.changedTouches[0].clientY-this.options.clickTolerance&&this.userMouse.y<= +a.changedTouches[0].clientY+this.options.clickTolerance?"click":void 0;if(!a||!a.target||a.target.classList.contains("panolens-canvas"))if(a.preventDefault(),a=a.changedTouches&&1===a.changedTouches.length?this.onTap({clientX:a.changedTouches[0].clientX,clientY:a.changedTouches[0].clientY},b):this.onTap(a,b),this.userMouse.type="none",!a&&"click"===b){b=this.options;a=b.autoHideControlBar;var d=this.panorama,c=this.toggleControlBar;b.autoHideInfospot&&d&&d.toggleInfospotVisibility();a&&c()}},onTap:function(a, +b){var d=this.container.getBoundingClientRect(),c=d.top,e=this.container,h=e.clientHeight;this.raycasterPoint.x=(a.clientX-d.left)/e.clientWidth*2-1;this.raycasterPoint.y=2*-((a.clientY-c)/h)+1;this.raycaster.setFromCamera(this.raycasterPoint,this.camera);if(this.panorama){("mousedown"!==a.type&&this.touchSupported||this.outputEnabled)&&this.outputPosition();d=this.raycaster.intersectObjects(this.panorama.children,!0);c=this.getConvertedIntersect(d);e=0