Current File : /home/inlingua/public_html/avconexpoarchitects.in/assets/js/panolens.min.js
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("three")):"function"==typeof define&&define.amd?define(["exports","three"],e):e((t=t||self).PANOLENS={},t.THREE)}(this,(function(t,e){function i(t){this.constraints=Object.assign({video:{width:{ideal:1920},height:{ideal:1080},facingMode:{exact:"environment"}},audio:!1},t),this.element=this.scene=this.container=null,this.devices=[],this.stream=null,this.ratioScalar=1,this.videoDeviceIndex=0}function n(t,i,n){t=void 0===t?16777215:t,i=void 0===i||i,n=void 0===n?1500:n,this.dpr=window.devicePixelRatio;var s=this.createCanvas(),o=s.canvas;s=s.context;var a=new e.SpriteMaterial({color:t,map:this.createCanvasTexture(o)});e.Sprite.call(this,a),this.canvasWidth=o.width,this.canvasHeight=o.height,this.context=s,this.color=t instanceof e.Color?t:new e.Color(t),this.autoSelect=i,this.dwellTime=n,this.rippleDuration=500,this.position.z=-10,this.center.set(.5,.5),this.scale.set(.5,.5,1),this.callback=this.timerId=this.startTimestamp=null,this.frustumCulled=!1,this.updateCanvasArcByProgress(0)}function s(t,i,n){t=void 0===t?300:t,i=i||I.Info,e.Sprite.call(this),this.type="infospot",this.animated=void 0===n||n,this.frustumCulled=this.isHovering=!1,this.cursorStyle=this.toPanorama=this.element=null,this.mode=M.NORMAL,this.scale.set(t,t,1),this.rotation.y=Math.PI,this.container=null,this.originalRaycast=this.raycast,this.HANDLER_FOCUS=null,this.material.side=e.DoubleSide,this.material.depthTest=!1,this.material.transparent=!0,this.material.opacity=0,this.scaleUpAnimation=new S.Tween,this.scaleDownAnimation=new S.Tween,n=function(i){if(this.material){var n=i.image.width/i.image.height,s=new e.Vector3;i.image.width=i.image.naturalWidth||64,i.image.height=i.image.naturalHeight||64,this.scale.set(n*t,t,1),s.copy(this.scale),this.scaleUpAnimation=new S.Tween(this.scale).to({x:1.3*s.x,y:1.3*s.y},500).easing(S.Easing.Elastic.Out),this.scaleDownAnimation=new S.Tween(this.scale).to({x:s.x,y:s.y},500).easing(S.Easing.Elastic.Out),this.material.map=i,this.material.needsUpdate=!0}}.bind(this),this.showAnimation=new S.Tween(this.material).to({opacity:1},500).onStart(this.enableRaycast.bind(this,!0)).easing(S.Easing.Quartic.Out),this.hideAnimation=new S.Tween(this.material).to({opacity:0},500).onStart(this.enableRaycast.bind(this,!1)).easing(S.Easing.Quartic.Out),this.addEventListener("click",this.onClick),this.addEventListener("hover",this.onHover),this.addEventListener("hoverenter",this.onHoverStart),this.addEventListener("hoverleave",this.onHoverEnd),this.addEventListener("panolens-dual-eye-effect",this.onDualEyeEffect),this.addEventListener("panolens-container",this.setContainer.bind(this)),this.addEventListener("dismiss",this.onDismiss),this.addEventListener("panolens-infospot-focus",this.setFocusMethod),L.load(i,n)}function o(t){t||console.warn("PANOLENS.Widget: No container specified"),e.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(t){t.preventDefault(),t.stopPropagation()},this.container=t,this.mask=this.activeSubMenu=this.activeMainItem=this.mainMenu=this.settingElement=this.videoElement=this.fullscreenElement=this.barElement=null}function a(t,i){e.Mesh.call(this,t,i),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.material.side=e.BackSide,this.material.opacity=0,this.scale.x*=-1,this.renderOrder=-1,this.active=!1,this.infospotAnimation=new S.Tween(this).to({},this.animationDuration/2),this.addEventListener("load",this.fadeIn.bind(this)),this.addEventListener("panolens-container",this.setContainer.bind(this)),this.addEventListener("click",this.onClick.bind(this)),this.setupTransitions()}function r(t,i,n){i=i||new e.SphereBufferGeometry(5e3,60,40),n=n||new e.MeshBasicMaterial({opacity:0,transparent:!0}),a.call(this,i,n),this.src=t,this.radius=5e3}function h(){var t=new e.BufferGeometry,i=new e.MeshBasicMaterial({color:0,opacity:0,transparent:!0});t.addAttribute("position",new e.BufferAttribute(new Float32Array,1)),a.call(this,t,i)}function c(t){t=void 0===t?[]:t;var i=Object.assign({},e.ShaderLib.cube),n=new e.BoxBufferGeometry(1e4,1e4,1e4);i=new e.ShaderMaterial({fragmentShader:i.fragmentShader,vertexShader:i.vertexShader,uniforms:i.uniforms,side:e.BackSide,transparent:!0}),a.call(this,n,i),this.images=t,this.edgeLength=1e4,this.material.uniforms.opacity.value=0}function l(){for(var t=[],e=0;6>e;e++)t.push(I.WhiteTile);c.call(this,t)}function d(t,i){i=void 0===i?{}:i;var n=new e.SphereBufferGeometry(5e3,60,40),s=new e.MeshBasicMaterial({opacity:0,transparent:!0});a.call(this,n,s),this.src=t,this.options={videoElement:document.createElement("video"),loop:!0,muted:!0,autoplay:!1,playsinline:!0,crossOrigin:"anonymous"},Object.assign(this.options,i),this.videoElement=this.options.videoElement,this.videoProgress=0,this.radius=5e3,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 u(t){var e;this._parameters=t=void 0===t?{}:t,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;try{var i=document.createElement("canvas");(e=i.getContext("experimental-webgl"))||(e=i.getContext("webgl"))}catch(t){}this.maxW=Math.max(e.getParameter(e.MAX_TEXTURE_SIZE),this.maxW),this.maxH=Math.max(e.getParameter(e.MAX_TEXTURE_SIZE),this.maxH)}function p(t,e){r.call(this),this.panoId=t,this.gsvLoader=null,this.loadRequested=!1,this.setupGoogleMapAPI(e)}function m(t,i,n,s){n=void 0===n?1e4:n,s=void 0===s?.5:s,"image"===(void 0===t?"image":t)&&r.call(this,i,this.createGeometry(n,s),this.createMaterial(n)),this.size=n,this.ratio=s,this.EPS=1e-6,this.frameId=null,this.dragging=!1,this.userMouse=new e.Vector2,this.quatA=new e.Quaternion,this.quatB=new e.Quaternion,this.quatCur=new e.Quaternion,this.quatSlerp=new e.Quaternion,this.vectorX=new e.Vector3(1,0,0),this.vectorY=new e.Vector3(0,1,0),this.addEventListener("window-resize",this.onWindowResize)}function v(t,e,i){m.call(this,"image",t,e,i)}function A(t){var n=new e.SphereBufferGeometry(5e3,60,40),s=new e.MeshBasicMaterial({visible:!1});a.call(this,n,s),this.media=new i(t),this.radius=5e3,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 g(t,i){function n(t){if(V=!1,U=_=0,!1!==g.enabled){if(t.preventDefault(),t.button===g.mouseButtons.ORBIT){if(!0===g.noRotate)return;H=B.ROTATE,f.set(t.clientX,t.clientY)}else if(t.button===g.mouseButtons.ZOOM){if(!0===g.noZoom)return;H=B.DOLLY,L.set(t.clientX,t.clientY)}else if(t.button===g.mouseButtons.PAN){if(!0===g.noPan)return;H=B.PAN,b.set(t.clientX,t.clientY)}H!==B.NONE&&(document.addEventListener("mousemove",s,!1),document.addEventListener("mouseup",o,!1),g.dispatchEvent(Z)),g.update()}}function s(t){if(!1!==g.enabled){t.preventDefault();var e=g.domElement===document?g.domElement.body:g.domElement;if(H===B.ROTATE){if(!0===g.noRotate)return;E.set(t.clientX,t.clientY),y.subVectors(E,f),g.rotateLeft(2*Math.PI*y.x/e.clientWidth*g.rotateSpeed),g.rotateUp(2*Math.PI*y.y/e.clientHeight*g.rotateSpeed),f.copy(E),u&&(U=t.clientX-u.clientX,_=t.clientY-u.clientY),u=t}else if(H===B.DOLLY){if(!0===g.noZoom)return;R.set(t.clientX,t.clientY),T.subVectors(R,L),0<T.y?g.dollyIn():0>T.y&&g.dollyOut(),L.copy(R)}else if(H===B.PAN){if(!0===g.noPan)return;w.set(t.clientX,t.clientY),M.subVectors(w,b),g.pan(M.x,M.y),b.copy(w)}H!==B.NONE&&g.update()}}function o(){V=!0,u=void 0,!1!==g.enabled&&(document.removeEventListener("mousemove",s,!1),document.removeEventListener("mouseup",o,!1),g.dispatchEvent(Q),H=B.NONE)}function a(t){if(!1!==g.enabled&&!0!==g.noZoom&&H===B.NONE){t.preventDefault(),t.stopPropagation();var e=0;void 0!==t.wheelDelta?e=t.wheelDelta:void 0!==t.detail&&(e=-t.detail),0<e?(g.object.fov=g.object.fov<g.maxFov?g.object.fov+1:g.maxFov,g.object.updateProjectionMatrix()):0>e&&(g.object.fov=g.object.fov>g.minFov?g.object.fov-1:g.minFov,g.object.updateProjectionMatrix()),g.update(),g.dispatchEvent(W),g.dispatchEvent(Z),g.dispatchEvent(Q)}}function r(t){switch(t.keyCode){case g.keys.UP:p=!1;break;case g.keys.BOTTOM:m=!1;break;case g.keys.LEFT:v=!1;break;case g.keys.RIGHT:A=!1}}function h(t){if(!1!==g.enabled&&!0!==g.noKeys&&!0!==g.noRotate){switch(t.keyCode){case g.keys.UP:p=!0;break;case g.keys.BOTTOM:m=!0;break;case g.keys.LEFT:v=!0;break;case g.keys.RIGHT:A=!0}(p||m||v||A)&&(V=!0,p&&(_=-g.rotateSpeed*g.momentumKeydownFactor),m&&(_=g.rotateSpeed*g.momentumKeydownFactor),v&&(U=-g.rotateSpeed*g.momentumKeydownFactor),A&&(U=g.rotateSpeed*g.momentumKeydownFactor))}}function c(t){if(V=!1,U=_=0,!1!==g.enabled){switch(t.touches.length){case 1:if(!0===g.noRotate)return;H=B.TOUCH_ROTATE,f.set(t.touches[0].pageX,t.touches[0].pageY);break;case 2:if(!0===g.noZoom)return;H=B.TOUCH_DOLLY;var e=t.touches[0].pageX-t.touches[1].pageX;t=t.touches[0].pageY-t.touches[1].pageY,L.set(0,Math.sqrt(e*e+t*t));break;case 3:if(!0===g.noPan)return;H=B.TOUCH_PAN,b.set(t.touches[0].pageX,t.touches[0].pageY);break;default:H=B.NONE}H!==B.NONE&&g.dispatchEvent(Z)}}function l(t){if(!1!==g.enabled){t.preventDefault(),t.stopPropagation();var e=g.domElement===document?g.domElement.body:g.domElement;switch(t.touches.length){case 1:if(!0===g.noRotate)break;if(H!==B.TOUCH_ROTATE)break;E.set(t.touches[0].pageX,t.touches[0].pageY),y.subVectors(E,f),g.rotateLeft(2*Math.PI*y.x/e.clientWidth*g.rotateSpeed),g.rotateUp(2*Math.PI*y.y/e.clientHeight*g.rotateSpeed),f.copy(E),u&&(U=t.touches[0].pageX-u.pageX,_=t.touches[0].pageY-u.pageY),u={pageX:t.touches[0].pageX,pageY:t.touches[0].pageY},g.update();break;case 2:if(!0===g.noZoom)break;if(H!==B.TOUCH_DOLLY)break;e=t.touches[0].pageX-t.touches[1].pageX,t=t.touches[0].pageY-t.touches[1].pageY,R.set(0,Math.sqrt(e*e+t*t)),T.subVectors(R,L),0>T.y?(g.object.fov=g.object.fov<g.maxFov?g.object.fov+1:g.maxFov,g.object.updateProjectionMatrix()):0<T.y&&(g.object.fov=g.object.fov>g.minFov?g.object.fov-1:g.minFov,g.object.updateProjectionMatrix()),L.copy(R),g.update(),g.dispatchEvent(W);break;case 3:if(!0===g.noPan)break;if(H!==B.TOUCH_PAN)break;w.set(t.touches[0].pageX,t.touches[0].pageY),M.subVectors(w,b),g.pan(M.x,M.y),b.copy(w),g.update();break;default:H=B.NONE}}}function d(){V=!0,u=void 0,!1!==g.enabled&&(g.dispatchEvent(Q),H=B.NONE)}this.object=t,this.domElement=void 0!==i?i:document,this.frameId=null,this.enabled=!0,this.center=this.target=new e.Vector3,this.noZoom=!1,this.zoomSpeed=1,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,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.momentumDampingFactor=.9,this.momentumScalingFactor=-.005,this.momentumKeydownFactor=20,this.minFov=30,this.maxFov=120,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.noKeys=!1,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:e.MOUSE.LEFT,ZOOM:e.MOUSE.MIDDLE,PAN:e.MOUSE.RIGHT};var u,p,m,v,A,g=this,f=new e.Vector2,E=new e.Vector2,y=new e.Vector2,b=new e.Vector2,w=new e.Vector2,M=new e.Vector2,I=new e.Vector3,C=new e.Vector3,L=new e.Vector2,R=new e.Vector2,T=new e.Vector2,S=0,O=0,D=0,x=0,k=1,P=new e.Vector3,j=new e.Vector3,N=new e.Quaternion,U=0,_=0,V=!1,B={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},H=B.NONE;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom;var z=(new e.Quaternion).setFromUnitVectors(t.up,new e.Vector3(0,1,0)),F=z.clone().inverse(),W={type:"change"},Z={type:"start"},Q={type:"end"};this.setLastQuaternion=function(t){N.copy(t),g.object.quaternion.copy(t)},this.getLastPosition=function(){return j},this.rotateLeft=function(t){void 0===t&&(t=2*Math.PI/60/60*g.autoRotateSpeed),x-=t},this.rotateUp=function(t){void 0===t&&(t=2*Math.PI/60/60*g.autoRotateSpeed),D-=t},this.panLeft=function(t){var e=this.object.matrix.elements;I.set(e[0],e[1],e[2]),I.multiplyScalar(-t),P.add(I)},this.panUp=function(t){var e=this.object.matrix.elements;I.set(e[4],e[5],e[6]),I.multiplyScalar(t),P.add(I)},this.pan=function(t,i){var n=g.domElement===document?g.domElement.body:g.domElement;if(g.object instanceof e.PerspectiveCamera){var s=g.object.position.clone().sub(g.target).length();s*=Math.tan(g.object.fov/2*Math.PI/180),g.panLeft(2*t*s/n.clientHeight),g.panUp(2*i*s/n.clientHeight)}else g.object instanceof e.OrthographicCamera?(g.panLeft(t*(g.object.right-g.object.left)/n.clientWidth),g.panUp(i*(g.object.top-g.object.bottom)/n.clientHeight)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.")},this.momentum=function(){V&&(1e-4>Math.abs(U)&&1e-4>Math.abs(_)?V=!1:(_*=this.momentumDampingFactor,U*=this.momentumDampingFactor,x-=this.momentumScalingFactor*U,D-=this.momentumScalingFactor*_))},this.dollyIn=function(t){void 0===t&&(t=Math.pow(.95,g.zoomSpeed)),g.object instanceof e.PerspectiveCamera?k/=t:g.object instanceof e.OrthographicCamera?(g.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*t)),g.object.updateProjectionMatrix(),g.dispatchEvent(W)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")},this.dollyOut=function(t){void 0===t&&(t=Math.pow(.95,g.zoomSpeed)),g.object instanceof e.PerspectiveCamera?k*=t:g.object instanceof e.OrthographicCamera?(g.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/t)),g.object.updateProjectionMatrix(),g.dispatchEvent(W)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")},this.update=function(t){var e=this.object.position;C.copy(e).sub(this.target),C.applyQuaternion(z),S=Math.atan2(C.x,C.z),O=Math.atan2(Math.sqrt(C.x*C.x+C.z*C.z),C.y),this.autoRotate&&H===B.NONE&&this.rotateLeft(2*Math.PI/60/60*g.autoRotateSpeed),this.momentum(),S+=x,O+=D,S=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,S)),O=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,O)),O=Math.max(1e-7,Math.min(Math.PI-1e-7,O));var i=C.length()*k;i=Math.max(this.minDistance,Math.min(this.maxDistance,i)),this.target.add(P),C.x=i*Math.sin(O)*Math.sin(S),C.y=i*Math.cos(O),C.z=i*Math.sin(O)*Math.cos(S),C.applyQuaternion(F),e.copy(this.target).add(C),this.object.lookAt(this.target),D=x=0,k=1,P.set(0,0,0),(1e-7<j.distanceToSquared(this.object.position)||1e-7<8*(1-N.dot(this.object.quaternion)))&&(!0!==t&&this.dispatchEvent(W),j.copy(this.object.position),N.copy(this.object.quaternion))},this.reset=function(){H=B.NONE,this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(W),this.update()},this.getPolarAngle=function(){return O},this.getAzimuthalAngle=function(){return S},this.dispose=function(){this.domElement.removeEventListener("mousedown",n),this.domElement.removeEventListener("mousewheel",a),this.domElement.removeEventListener("DOMMouseScroll",a),this.domElement.removeEventListener("touchstart",c),this.domElement.removeEventListener("touchend",d),this.domElement.removeEventListener("touchmove",l),window.removeEventListener("keyup",r),window.removeEventListener("keydown",h)},this.domElement.addEventListener("mousedown",n,{passive:!1}),this.domElement.addEventListener("mousewheel",a,{passive:!1}),this.domElement.addEventListener("DOMMouseScroll",a,{passive:!1}),this.domElement.addEventListener("touchstart",c,{passive:!1}),this.domElement.addEventListener("touchend",d,{passive:!1}),this.domElement.addEventListener("touchmove",l,{passive:!1}),window.addEventListener("keyup",r,{passive:!1}),window.addEventListener("keydown",h,{passive:!1}),this.update()}function f(t,i){var n=this,s={type:"change"},o=0,a=0,r=0,h=0;this.camera=t,this.camera.rotation.reorder("YXZ"),this.domElement=void 0!==i?i:document,this.enabled=!0,this.deviceOrientation={},this.alphaOffsetAngle=this.alpha=this.screenOrientation=0;var c=function(t){n.deviceOrientation=t},l=function(){n.screenOrientation=window.orientation||0},d=function(t){t.preventDefault(),t.stopPropagation(),r=t.touches[0].pageX,h=t.touches[0].pageY},u=function(t){t.preventDefault(),t.stopPropagation(),o+=e.Math.degToRad((t.touches[0].pageX-r)/4),a+=e.Math.degToRad((h-t.touches[0].pageY)/4),n.updateAlphaOffsetAngle(o),r=t.touches[0].pageX,h=t.touches[0].pageY};this.connect=function(){l(),window.addEventListener("orientationchange",l,{passive:!0}),window.addEventListener("deviceorientation",c,{passive:!0}),window.addEventListener("deviceorientation",this.update.bind(this),{passive:!0}),n.domElement.addEventListener("touchstart",d,{passive:!1}),n.domElement.addEventListener("touchmove",u,{passive:!1}),n.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",l,!1),window.removeEventListener("deviceorientation",c,!1),window.removeEventListener("deviceorientation",this.update.bind(this),!1),n.domElement.removeEventListener("touchstart",d,!1),n.domElement.removeEventListener("touchmove",u,!1),n.enabled=!1},this.update=function(t){if(!1!==n.enabled){var i=n.deviceOrientation.alpha?e.Math.degToRad(n.deviceOrientation.alpha)+n.alphaOffsetAngle:0,o=n.deviceOrientation.beta?e.Math.degToRad(n.deviceOrientation.beta):0,r=n.deviceOrientation.gamma?e.Math.degToRad(n.deviceOrientation.gamma):0,h=n.screenOrientation?e.Math.degToRad(n.screenOrientation):0,c=n.camera.quaternion,l=new e.Vector3(0,0,1),d=new e.Euler,u=new e.Quaternion,p=new e.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),m=new e.Quaternion,v=new e.Quaternion;if(0==n.screenOrientation){var A=new e.Vector3(1,0,0);m.setFromAxisAngle(A,-a)}else 180==n.screenOrientation?(A=new e.Vector3(1,0,0),m.setFromAxisAngle(A,a)):90==n.screenOrientation?(A=new e.Vector3(0,1,0),m.setFromAxisAngle(A,a)):-90==n.screenOrientation&&(A=new e.Vector3(0,1,0),m.setFromAxisAngle(A,-a));p.multiply(m),p.multiply(v),d.set(o,i,-r,"YXZ"),c.setFromEuler(d),c.multiply(p),c.multiply(u.setFromAxisAngle(l,-h)),n.alpha=i,!0!==t&&n.dispatchEvent(s)}},this.updateAlphaOffsetAngle=function(t){this.alphaOffsetAngle=t,this.update()},this.dispose=function(){this.disconnect()},this.connect()}function E(t){var i=new e.OrthographicCamera(-1,1,1,-1,0,1),n=new e.Scene,s=new e.StereoCamera;s.aspect=.5;var o=new e.WebGLRenderTarget(512,512,{minFilter:e.LinearFilter,magFilter:e.NearestFilter,format:e.RGBAFormat});o.scissorTest=!0,o.texture.generateMipmaps=!1;var a=new e.Vector2(.441,.156),r=new e.PlaneBufferGeometry(1,1,10,20).removeAttribute("normal").toNonIndexed(),h=r.attributes.position.array,c=r.attributes.uv.array;r.attributes.position.count*=2,r.attributes.uv.count*=2;var l=new Float32Array(2*h.length);l.set(h),l.set(h,h.length);var d=new Float32Array(2*c.length);d.set(c),d.set(c,c.length),c=new e.Vector2,h=h.length/3;for(var u=0,p=l.length/3;u<p;u++){c.x=l[3*u],c.y=l[3*u+1];var m=c.dot(c);m=1.5+(a.x+a.y*m)*m;var v=u<h?0:1;l[3*u]=c.x/m*1.5-.5+v,l[3*u+1]=c.y/m*3,d[2*u]=.5*(d[2*u]+v)}r.attributes.position.array=l,r.attributes.uv.array=d,a=new e.MeshBasicMaterial({map:o.texture}),r=new e.Mesh(r,a),n.add(r),this.setSize=function(e,i){t.setSize(e,i);var n=t.getPixelRatio();o.setSize(e*n,i*n)},this.render=function(e,a){e.updateMatrixWorld(),null===a.parent&&a.updateMatrixWorld(),s.update(a),a=o.width/2;var r=o.height;t.autoClear&&t.clear(),o.scissor.set(0,0,a,r),o.viewport.set(0,0,a,r),t.setRenderTarget(o),t.render(e,s.cameraL),t.clearDepth(),o.scissor.set(a,0,a,r),o.viewport.set(a,0,a,r),t.setRenderTarget(o),t.render(e,s.cameraR),t.clearDepth(),t.setRenderTarget(null),t.render(n,i)}}function y(t){if((t=t||{}).controlBar=void 0===t.controlBar||t.controlBar,t.controlButtons=t.controlButtons||["fullscreen","setting","video"],t.autoHideControlBar=void 0!==t.autoHideControlBar&&t.autoHideControlBar,t.autoHideInfospot=void 0===t.autoHideInfospot||t.autoHideInfospot,t.horizontalView=void 0!==t.horizontalView&&t.horizontalView,t.clickTolerance=t.clickTolerance||10,t.cameraFov=t.cameraFov||60,t.reverseDragging=t.reverseDragging||!1,t.enableReticle=t.enableReticle||!1,t.dwellTime=t.dwellTime||1500,t.autoReticleSelect=void 0===t.autoReticleSelect||t.autoReticleSelect,t.viewIndicator=void 0!==t.viewIndicator&&t.viewIndicator,t.indicatorSize=t.indicatorSize||30,t.output=t.output?t.output:"none",t.autoRotate=t.autoRotate||!1,t.autoRotateSpeed=t.autoRotateSpeed||2,t.autoRotateActivationDuration=t.autoRotateActivationDuration||5e3,this.options=t,t.container){var i=t.container;i._width=i.clientWidth,i._height=i.clientHeight}else(i=document.createElement("div")).classList.add("panolens-container"),i.style.width="100%",i.style.height="100%",i._width=window.innerWidth,i._height=window.innerHeight,document.body.appendChild(i);this.container=i,this.camera=t.camera||new e.PerspectiveCamera(this.options.cameraFov,this.container.clientWidth/this.container.clientHeight,1,1e4),this.scene=t.scene||new e.Scene,this.renderer=t.renderer||new e.WebGLRenderer({alpha:!0,antialias:!1}),this.sceneReticle=new e.Scene,this.viewIndicatorSize=this.options.indicatorSize,this.reticle={},this.tempEnableReticle=this.options.enableReticle,this.mode=M.NORMAL,this.pressObject=this.pressEntityObject=this.infospot=this.hoverObject=this.widget=this.panorama=null,this.raycaster=new e.Raycaster,this.raycasterPoint=new e.Vector2,this.userMouse=new e.Vector2,this.updateCallbacks=[],this.requestAnimationId=null,this.cameraFrustum=new e.Frustum,this.cameraViewProjectionMatrix=new e.Matrix4,this.outputDivElement=this.autoRotateRequestId=null,this.touchSupported="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,this.HANDLER_MOUSE_DOWN=this.onMouseDown.bind(this),this.HANDLER_MOUSE_UP=this.onMouseUp.bind(this),this.HANDLER_MOUSE_MOVE=this.onMouseMove.bind(this),this.HANDLER_WINDOW_RESIZE=this.onWindowResize.bind(this),this.HANDLER_KEY_DOWN=this.onKeyDown.bind(this),this.HANDLER_KEY_UP=this.onKeyUp.bind(this),this.HANDLER_TAP=this.onTap.bind(this,{clientX:this.container.clientWidth/2,clientY:this.container.clientHeight/2}),this.OUTPUT_INFOSPOT=!1,this.tweenLeftAnimation=new S.Tween,this.tweenUpAnimation=new S.Tween,this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.container.clientWidth,this.container.clientHeight),this.renderer.setClearColor(0,0),this.renderer.autoClear=!1,this.renderer.domElement.classList.add("panolens-canvas"),this.renderer.domElement.style.display="block",this.container.style.backgroundColor="#000",this.container.appendChild(this.renderer.domElement),this.OrbitControls=new g(this.camera,this.container),this.OrbitControls.id="orbit",this.OrbitControls.minDistance=1,this.OrbitControls.noPan=!0,this.OrbitControls.autoRotate=this.options.autoRotate,this.OrbitControls.autoRotateSpeed=this.options.autoRotateSpeed,this.DeviceOrientationControls=new f(this.camera,this.container),this.DeviceOrientationControls.id="device-orientation",this.DeviceOrientationControls.enabled=!1,this.camera.position.z=1,this.options.passiveRendering&&console.warn("passiveRendering is now deprecated"),this.controls=[this.OrbitControls,this.DeviceOrientationControls],this.control=this.OrbitControls,this.CardboardEffect=new E(this.renderer),this.CardboardEffect.setSize(this.container.clientWidth,this.container.clientHeight),this.StereoEffect=new D(this.renderer),this.StereoEffect.setSize(this.container.clientWidth,this.container.clientHeight),this.effect=this.CardboardEffect,this.addReticle(),this.options.horizontalView&&(this.OrbitControls.minPolarAngle=Math.PI/2,this.OrbitControls.maxPolarAngle=Math.PI/2),!1!==this.options.controlBar&&this.addDefaultControlBar(this.options.controlButtons),this.options.viewIndicator&&this.addViewIndicator(),this.options.reverseDragging&&this.reverseDraggingDirection(),this.options.enableReticle?this.enableReticleControl():this.registerMouseAndTouchEvents(),"overlay"===this.options.output&&this.addOutputElement(),this.registerEventListeners(),this.animate.call(this)}var b="^0.105.2".replace(/[^0-9.]/g,""),w={ORBIT:0,DEVICEORIENTATION:1},M={UNKNOWN:0,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ywxNS41KSI+PC9wYXRoPgoJCTxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik0gMTMgMCBMIDEwIDIgTCAxNiAyIFoiPjwvcGF0aD4KCQk8cGF0aCBjbGFzcz0ic3QyIiBkPSJNIDIgMCBBIDIgMiAwIDAgMCAtMiAwIEEgMiAyIDAgMCAwIDIgMCIgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwxMywxNS41KSI+PC9wYXRoPgoJCTxwYXRoIGNsYXNzPSJzdDEiIGlkPSJpbmRpY2F0b3IiIHRyYW5zZm9ybT0ibWF0cml4KDEsMCwwLDEsMTMsMTUuNSkiPjwvcGF0aD4KCTwvZz4KPC9zdmc+"},C={load:function(t,i,n,s){var o,a,r,h;for(h in i=void 0===i?function(){}:i,n=void 0===n?function(){}:n,s=void 0===s?function(){}:s,e.Cache.enabled=!0,I)I.hasOwnProperty(h)&&t===I[h]&&(o=h);var c=e.Cache.get(o||t);if(void 0!==c)return i&&setTimeout((function(){n({loaded:1,total:1}),i(c)}),0),c;var l=window.URL||window.webkitURL,d=document.createElementNS("http://www.w3.org/1999/xhtml","img");e.Cache.add(o||t,d);var u=function(){l.revokeObjectURL(d.src),i(d)};if(0===t.indexOf("data:"))return d.addEventListener("load",u,!1),d.src=t,d;d.crossOrigin=void 0!==this.crossOrigin?this.crossOrigin:"",(o=new window.XMLHttpRequest).open("GET",t,!0),o.responseType="arraybuffer",o.addEventListener("error",s),o.addEventListener("progress",(function(t){if(t){var e=t.loaded,i=t.total;t.lengthComputable&&n({loaded:e,total:i})}})),o.addEventListener("loadend",(function(t){t&&(a=new Uint8Array(t.currentTarget.response),r=new window.Blob([a]),d.addEventListener("load",u,!1),d.src=l.createObjectURL(r))})),o.send(null)}},L={load:function(t,i,n,s){i=void 0===i?function(){}:i;var o=new e.Texture;return C.load(t,(function(n){o.image=n,n=0<t.search(/\.(jpg|jpeg)$/)||0===t.search(/^data:image\/jpeg/),o.format=n?e.RGBFormat:e.RGBAFormat,o.needsUpdate=!0,i(o)}),n,s),o}},R={load:function(t,i,n,s){var o;i=void 0===i?function(){}:i,n=void 0===n?function(){}:n;var a=new e.CubeTexture([]),r=0,h={},c={};return t.map((function(t,e){C.load(t,(function(t){a.images[e]=t,6===++r&&(a.needsUpdate=!0,i(a))}),(function(t){for(var i in h[e]={loaded:t.loaded,total:t.total},c.loaded=0,o=c.total=0,h)o++,c.loaded+=h[i].loaded,c.total+=h[i].total;6>o&&(c.total=c.total/o*6),n(c)}),s)})),a}};i.prototype=Object.assign(Object.create(e.EventDispatcher.prototype),{setContainer:function(t){this.container=t},setScene:function(t){this.scene=t},enumerateDevices:function(){var t=this.devices,e=new Promise((function(e){e(t)}));return 0<t.length?e:window.navigator.mediaDevices.enumerateDevices()},switchNextVideoDevice:function(){var t=this.stop.bind(this),e=this.start.bind(this),i=this.setVideDeviceIndex.bind(this),n=this.videoDeviceIndex;this.getDevices("video").then((function(s){t(),++n>=s.length?(i(0),n--):i(n),e(s[n])}))},getDevices:function(t){t=void 0===t?"video":t;var e=this.devices;return this.enumerateDevices().then((function(t){return t.map((function(t){return e.includes(t)||e.push(t),t}))})).then((function(e){var i=new RegExp(t,"i");return e.filter((function(t){return i.test(t.kind)}))}))},getUserMedia:function(t){var e=this.setMediaStream.bind(this),i=this.playVideo.bind(this);return window.navigator.mediaDevices.getUserMedia(t).then(e).then(i).catch((function(t){console.warn("PANOLENS.Media: "+t)}))},setVideDeviceIndex:function(t){this.videoDeviceIndex=t},start:function(t){var e=this.constraints,i=this.getUserMedia.bind(this);return this.element=this.createVideoElement(),this.getDevices().then((function(n){if(!n||0===n.length)throw Error("no video device found");return e.video.deviceId=(t||n[0]).deviceId,i(e)}))},stop:function(){var t=this.stream;t&&t.active&&(t.getTracks()[0].stop(),window.removeEventListener("resize",this.onWindowResize.bind(this)),this.stream=this.element=null)},setMediaStream:function(t){this.stream=t,this.element.srcObject=t,this.scene&&(this.scene.background=this.createVideoTexture()),window.addEventListener("resize",this.onWindowResize.bind(this))},playVideo:function(){var t=this.element;t&&(t.play(),this.dispatchEvent({type:"play"}))},pauseVideo:function(){var t=this.element;t&&(t.pause(),this.dispatchEvent({type:"pause"}))},createVideoTexture:function(){var t=this.element,i=new e.VideoTexture(t);return i.generateMipmaps=!1,i.minFilter=e.LinearFilter,i.magFilter=e.LinearFilter,i.format=e.RGBFormat,i.center.set(.5,.5),t.addEventListener("canplay",this.onWindowResize.bind(this)),i},createVideoElement:function(){var t=this.dispatchEvent.bind(this),e=document.createElement("video");return e.setAttribute("autoplay",""),e.setAttribute("muted",""),e.setAttribute("playsinline",""),e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.objectPosition="center",e.style.objectFit="cover",e.style.display=this.scene?"none":"",e.addEventListener("canplay",(function(){return t({type:"canplay"})})),e},onWindowResize:function(){if(this.element&&this.element.videoWidth&&this.element.videoHeight&&this.scene){var t=this.container,e=t.clientWidth;t=t.clientHeight;var i=this.scene.background,n=this.element;n=n.videoHeight/n.videoWidth*(this.container?e/t:1)*this.ratioScalar,e>t?i.repeat.set(n,1):i.repeat.set(1,1/n)}}}),n.prototype=Object.assign(Object.create(e.Sprite.prototype),{constructor:n,setColor:function(t){this.material.color.copy(t instanceof e.Color?t:new e.Color(t))},createCanvasTexture:function(t){return(t=new e.CanvasTexture(t)).minFilter=e.LinearFilter,t.magFilter=e.LinearFilter,t.generateMipmaps=!1,t},createCanvas:function(){var t=document.createElement("canvas"),e=t.getContext("2d"),i=this.dpr;return t.width=32*i,t.height=32*i,e.scale(i,i),e.shadowBlur=5,e.shadowColor="rgba(200,200,200,0.9)",{canvas:t,context:e}},updateCanvasArcByProgress:function(t){var e=this.context,i=this.canvasWidth,n=this.canvasHeight,s=this.material,o=this.dpr,a=t*Math.PI*2,r=this.color.getStyle(),h=.5*i/o;o=.5*n/o,e.clearRect(0,0,i,n),e.beginPath(),0===t?(e.arc(h,o,i/16,0,2*Math.PI),e.fillStyle=r,e.fill()):(e.arc(h,o,i/4-3,-Math.PI/2,-Math.PI/2+a),e.strokeStyle=r,e.lineWidth=3,e.stroke()),e.closePath(),s.map.needsUpdate=!0},ripple:function(){var t=this,e=this.context,i=this.canvasWidth,n=this.canvasHeight,s=this.material,o=this.rippleDuration,a=performance.now(),r=this.color,h=this.dpr,c=.5*i/h,l=.5*n/h,d=function(){var u=window.requestAnimationFrame(d),p=(performance.now()-a)/o,m=0<1-p?1-p:0,v=p*i*.5/h;e.clearRect(0,0,i,n),e.beginPath(),e.arc(c,l,v,0,2*Math.PI),e.fillStyle="rgba("+255*r.r+", "+255*r.g+", "+255*r.b+", "+m+")",e.fill(),e.closePath(),1<=p&&(window.cancelAnimationFrame(u),t.updateCanvasArcByProgress(0),t.dispatchEvent({type:"reticle-ripple-end"})),s.map.needsUpdate=!0};this.dispatchEvent({type:"reticle-ripple-start"}),d()},show:function(){this.visible=!0},hide:function(){this.visible=!1},start:function(t){this.autoSelect&&(this.dispatchEvent({type:"reticle-start"}),this.startTimestamp=performance.now(),this.callback=t,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 t=(performance.now()-this.startTimestamp)/this.dwellTime;this.updateCanvasArcByProgress(t),this.dispatchEvent({type:"reticle-update",progress:t}),1<=t&&(window.cancelAnimationFrame(this.timerId),this.callback&&this.callback(),this.end(),this.ripple())}});var T,S=(function(t,e){(e=function(){this._tweens={},this._tweensAddedDuringUpdate={}}).prototype={getAll:function(){return Object.keys(this._tweens).map(function(t){return this._tweens[t]}.bind(this))},removeAll:function(){this._tweens={}},add:function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},remove:function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},update:function(t,e){var n=Object.keys(this._tweens);if(0===n.length)return!1;for(t=void 0!==t?t:i.now();0<n.length;){this._tweensAddedDuringUpdate={};for(var s=0;s<n.length;s++){var o=this._tweens[n[s]];o&&!1===o.update(t)&&(o._isPlaying=!1,e||delete this._tweens[n[s]])}n=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var i=new e;i.Group=e,i._nextId=0,i.nextId=function(){return i._nextId++},i.now="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},i.Tween=function(t,e){this._object=t,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._repeatDelayTime=void 0,this._reversed=this._isPlaying=this._yoyo=!1,this._delayTime=0,this._startTime=null,this._easingFunction=i.Easing.Linear.None,this._interpolationFunction=i.Interpolation.Linear,this._chainedTweens=[],this._onStartCallback=null,this._onStartCallbackFired=!1,this._onStopCallback=this._onCompleteCallback=this._onRepeatCallback=this._onUpdateCallback=null,this._group=e||i,this._id=i.nextId()},i.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},to:function(t,e){return this._valuesEnd=Object.create(t),void 0!==e&&(this._duration=e),this},duration:function(t){return this._duration=t,this},start:function(t){for(var e in this._group.add(this),this._isPlaying=!0,this._onStartCallbackFired=!1,this._startTime=void 0!==t?"string"==typeof t?i.now()+parseFloat(t):t:i.now(),this._startTime+=this._delayTime,this._valuesEnd){if(this._valuesEnd[e]instanceof Array){if(0===this._valuesEnd[e].length)continue;this._valuesEnd[e]=[this._object[e]].concat(this._valuesEnd[e])}void 0!==this._object[e]&&(this._valuesStart[e]=this._object[e],0==this._valuesStart[e]instanceof Array&&(this._valuesStart[e]*=1),this._valuesStartRepeat[e]=this._valuesStart[e]||0)}return this},stop:function(){return this._isPlaying?(this._group.remove(this),this._isPlaying=!1,null!==this._onStopCallback&&this._onStopCallback(this._object),this.stopChainedTweens(),this):this},end:function(){return this.update(1/0),this},stopChainedTweens:function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop()},group:function(t){return this._group=t,this},delay:function(t){return this._delayTime=t,this},repeat:function(t){return this._repeat=t,this},repeatDelay:function(t){return this._repeatDelayTime=t,this},yoyo:function(t){return this._yoyo=t,this},easing:function(t){return this._easingFunction=t,this},interpolation:function(t){return this._interpolationFunction=t,this},chain:function(){return this._chainedTweens=arguments,this},onStart:function(t){return this._onStartCallback=t,this},onUpdate:function(t){return this._onUpdateCallback=t,this},onRepeat:function(t){return this._onRepeatCallback=t,this},onComplete:function(t){return this._onCompleteCallback=t,this},onStop:function(t){return this._onStopCallback=t,this},update:function(t){var e;if(t<this._startTime)return!0;!1===this._onStartCallbackFired&&(null!==this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0);var i=(t-this._startTime)/this._duration;i=0===this._duration||1<i?1:i;var n=this._easingFunction(i);for(e in this._valuesEnd)if(void 0!==this._valuesStart[e]){var s=this._valuesStart[e]||0,o=this._valuesEnd[e];o instanceof Array?this._object[e]=this._interpolationFunction(o,n):("string"==typeof o&&(o="+"===o.charAt(0)||"-"===o.charAt(0)?s+parseFloat(o):parseFloat(o)),"number"==typeof o&&(this._object[e]=s+(o-s)*n))}if(null!==this._onUpdateCallback&&this._onUpdateCallback(this._object,i),1===i){if(!(0<this._repeat)){for(null!==this._onCompleteCallback&&this._onCompleteCallback(this._object),t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].start(this._startTime+this._duration);return!1}for(e in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)"string"==typeof this._valuesEnd[e]&&(this._valuesStartRepeat[e]+=parseFloat(this._valuesEnd[e])),this._yoyo&&(i=this._valuesStartRepeat[e],this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=i),this._valuesStart[e]=this._valuesStartRepeat[e];this._yoyo&&(this._reversed=!this._reversed),this._startTime=void 0!==this._repeatDelayTime?t+this._repeatDelayTime:t+this._delayTime,null!==this._onRepeatCallback&&this._onRepeatCallback(this._object)}return!0}},i.Easing={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return 1>(t*=2)?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return 1>(t*=2)?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return 1>(t*=2)?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return 1>(t*=2)?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:1>(t*=2)?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return 1>(t*=2)?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:1>(t*=2)?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){return t*t*(2.70158*t-1.70158)},Out:function(t){return--t*t*(2.70158*t+1.70158)+1},InOut:function(t){return 1>(t*=2)?.5*t*t*(3.5949095*t-2.5949095):.5*((t-=2)*t*(3.5949095*t+2.5949095)+2)}},Bounce:{In:function(t){return 1-i.Easing.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return.5>t?.5*i.Easing.Bounce.In(2*t):.5*i.Easing.Bounce.Out(2*t-1)+.5}}},i.Interpolation={Linear:function(t,e){var n=t.length-1,s=n*e,o=Math.floor(s),a=i.Interpolation.Utils.Linear;return 0>e?a(t[0],t[1],s):1<e?a(t[n],t[n-1],n-s):a(t[o],t[o+1>n?n:o+1],s-o)},Bezier:function(t,e){for(var n=0,s=t.length-1,o=Math.pow,a=i.Interpolation.Utils.Bernstein,r=0;r<=s;r++)n+=o(1-e,s-r)*o(e,r)*t[r]*a(s,r);return n},CatmullRom:function(t,e){var n=t.length-1,s=n*e,o=Math.floor(s),a=i.Interpolation.Utils.CatmullRom;return t[0]===t[n]?(0>e&&(o=Math.floor(s=n*(1+e))),a(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],s-o)):0>e?t[0]-(a(t[0],t[0],t[1],t[1],-s)-t[0]):1<e?t[n]-(a(t[n],t[n],t[n-1],t[n-1],s-n)-t[n]):a(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],s-o)},Utils:{Linear:function(t,e,i){return(e-t)*i+t},Bernstein:function(t,e){var n=i.Interpolation.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:function(){var t=[1];return function(e){var i=1;if(t[e])return t[e];for(var n=e;1<n;n--)i*=n;return t[e]=i}}(),CatmullRom:function(t,e,i,n,s){var o=s*s;return(2*e-2*i+(t=.5*(i-t))+(n=.5*(n-e)))*s*o+(-3*e+3*i-2*t-n)*o+t*s+e}}},t.exports=i}(T={exports:{}},T.exports),T.exports);s.prototype=Object.assign(Object.create(e.Sprite.prototype),{constructor:s,setContainer:function(t){if(t instanceof HTMLElement)var e=t;else t&&t.container&&(e=t.container);e&&this.element&&e.appendChild(this.element),this.container=e},getContainer:function(){return this.container},onClick:function(t){this.element&&this.getContainer()&&(this.onHoverStart(t),this.lockHoverElement())},onDismiss:function(){this.element&&(this.unlockHoverElement(),this.onHoverEnd())},onHover:function(){},onHoverStart:function(t){if(this.getContainer()){var e=this.cursorStyle||(this.mode===M.NORMAL?"pointer":"default"),i=this.scaleDownAnimation,n=this.scaleUpAnimation,s=this.element;this.isHovering=!0,this.container.style.cursor=e,this.animated&&(i.stop(),n.start()),s&&0<=t.mouseEvent.clientX&&0<=t.mouseEvent.clientY&&(t=s.left,e=s.right,i=s.style,this.mode===M.CARDBOARD||this.mode===M.STEREO?(i.display="none",t.style.display="block",e.style.display="block",s._width=t.clientWidth,s._height=t.clientHeight):(i.display="block",t&&(t.style.display="none"),e&&(e.style.display="none"),s._width=s.clientWidth,s._height=s.clientHeight))}},onHoverEnd:function(){if(this.getContainer()){var t=this.scaleDownAnimation,e=this.scaleUpAnimation,i=this.element;this.isHovering=!1,this.container.style.cursor="default",this.animated&&(e.stop(),t.start()),i&&!this.element.locked&&(t=i.left,e=i.right,i.style.display="none",t&&(t.style.display="none"),e&&(e.style.display="none"),this.unlockHoverElement())}},onDualEyeEffect:function(t){if(this.getContainer()){this.mode=t.mode,t=this.element;var e=this.container.clientWidth/2,i=this.container.clientHeight/2;t&&(t.left||t.right||(t.left=t.cloneNode(!0),t.right=t.cloneNode(!0)),this.mode===M.CARDBOARD||this.mode===M.STEREO?(t.left.style.display=t.style.display,t.right.style.display=t.style.display,t.style.display="none"):(t.style.display=t.left.style.display,t.left.style.display="none",t.right.style.display="none"),this.translateElement(e,i),this.container.appendChild(t.left),this.container.appendChild(t.right))}},translateElement:function(t,e){if(this.element._width&&this.element._height&&this.getContainer()){var i=this.container,n=this.element,s=n._width/2,o=n._height/2,a=void 0!==n.verticalDelta?n.verticalDelta:40,r=t-s,h=e-o-a;this.mode!==M.CARDBOARD&&this.mode!==M.STEREO||!n.left||!n.right||t===i.clientWidth/2&&e===i.clientHeight/2?this.setElementStyle("transform",n,"translate("+r+"px, "+h+"px)"):(r=i.clientWidth/4-s+(t-i.clientWidth/2),h=i.clientHeight/2-o-a+(e-i.clientHeight/2),this.setElementStyle("transform",n.left,"translate("+r+"px, "+h+"px)"),r+=i.clientWidth/2,this.setElementStyle("transform",n.right,"translate("+r+"px, "+h+"px)"))}},setElementStyle:function(t,e,i){e=e.style,"transform"===t&&(e.webkitTransform=e.msTransform=e.transform=i)},setText:function(t){this.element&&(this.element.textContent=t)},setCursorHoverStyle:function(t){this.cursorStyle=t},addHoverText:function(t,e){e=void 0===e?40:e,this.element||(this.element=document.createElement("div"),this.element.style.display="none",this.element.style.color="#fff",this.element.style.top=0,this.element.style.maxWidth="50%",this.element.style.maxHeight="50%",this.element.style.textShadow="0 0 3px #000000",this.element.style.fontFamily='"Trebuchet MS", Helvetica, sans-serif',this.element.style.position="absolute",this.element.classList.add("panolens-infospot"),this.element.verticalDelta=e),this.setText(t)},addHoverElement:function(t,e){e=void 0===e?40:e,this.element||(this.element=t.cloneNode(!0),this.element.style.display="none",this.element.style.top=0,this.element.style.position="absolute",this.element.classList.add("panolens-infospot"),this.element.verticalDelta=e)},removeHoverElement:function(){this.element&&(this.element.left&&(this.container.removeChild(this.element.left),this.element.left=null),this.element.right&&(this.container.removeChild(this.element.right),this.element.right=null),this.container.removeChild(this.element),this.element=null)},lockHoverElement:function(){this.element&&(this.element.locked=!0)},unlockHoverElement:function(){this.element&&(this.element.locked=!1)},enableRaycast:function(t){this.raycast=void 0===t||t?this.originalRaycast:function(){}},show:function(t){t=void 0===t?0:t;var e=this.hideAnimation,i=this.showAnimation,n=this.material;this.animated?(e.stop(),i.delay(t).start()):(this.enableRaycast(!0),n.opacity=1)},hide:function(t){t=void 0===t?0:t;var e=this.hideAnimation,i=this.showAnimation,n=this.material;this.animated?(i.stop(),e.delay(t).start()):(this.enableRaycast(!1),n.opacity=0)},setFocusMethod:function(t){t&&(this.HANDLER_FOCUS=t.method)},focus:function(t,e){this.HANDLER_FOCUS&&(this.HANDLER_FOCUS(this.position,t,e),this.onDismiss())},dispose:function(){var t=this.geometry,e=this.material,i=e.map;this.removeHoverElement(),this.parent&&this.parent.remove(this),i&&(i.dispose(),e.map=null),t&&(t.dispose(),this.geometry=null),e&&(e.dispose(),this.material=null)}}),o.prototype=Object.assign(Object.create(e.EventDispatcher.prototype),{constructor:o,addControlBar:function(){if(this.container){var t,e,i=this,n=document.createElement("div");n.style.width="100%",n.style.height="44px",n.style.float="left",n.style.transform=n.style.webkitTransform=n.style.msTransform="translateY(-100%)",n.style.background="-webkit-linear-gradient(bottom, rgba(0,0,0,0.2), rgba(0,0,0,0))",n.style.background="-moz-linear-gradient(bottom, rgba(0,0,0,0.2), rgba(0,0,0,0))",n.style.background="-o-linear-gradient(bottom, rgba(0,0,0,0.2), rgba(0,0,0,0))",n.style.background="-ms-linear-gradient(bottom, rgba(0,0,0,0.2), rgba(0,0,0,0))",n.style.background="linear-gradient(bottom, rgba(0,0,0,0.2), rgba(0,0,0,0))",n.style.transition=this.DEFAULT_TRANSITION,n.style.pointerEvents="none",n.isHidden=!1,n.toggle=function(){n.isHidden=!n.isHidden,t=n.isHidden?"translateY(0)":"translateY(-100%)",e=n.isHidden?0:1,n.style.transform=n.style.webkitTransform=n.style.msTransform=t,n.style.opacity=e};var s=this.createDefaultMenu();this.mainMenu=this.createMainMenu(s),n.appendChild(this.mainMenu),this.mask=s=this.createMask(),this.container.appendChild(s),n.dispose=function(){i.fullscreenElement&&(n.removeChild(i.fullscreenElement),i.fullscreenElement.dispose(),i.fullscreenElement=null),i.settingElement&&(n.removeChild(i.settingElement),i.settingElement.dispose(),i.settingElement=null),i.videoElement&&(n.removeChild(i.videoElement),i.videoElement.dispose(),i.videoElement=null)},this.container.appendChild(n),this.mask.addEventListener("mousemove",this.PREVENT_EVENT_HANDLER,!0),this.mask.addEventListener("mouseup",this.PREVENT_EVENT_HANDLER,!0),this.mask.addEventListener("mousedown",this.PREVENT_EVENT_HANDLER,!0),this.mask.addEventListener(i.TOUCH_ENABLED?"touchend":"click",(function(t){t.preventDefault(),t.stopPropagation(),i.mask.hide(),i.settingElement.deactivate()}),!1),this.addEventListener("control-bar-toggle",n.toggle),this.barElement=n}else console.warn("Widget container not set")},createDefaultMenu:function(){var t=this,e=function(e,i){return function(){t.dispatchEvent({type:"panolens-viewer-handler",method:e,data:i})}};return[{title:"Control",subMenu:[{title:this.TOUCH_ENABLED?"Touch":"Mouse",handler:e("enableControl",w.ORBIT)},{title:"Sensor",handler:e("enableControl",w.DEVICEORIENTATION)}]},{title:"Mode",subMenu:[{title:"Normal",handler:e("disableEffect")},{title:"Cardboard",handler:e("enableEffect",M.CARDBOARD)},{title:"Stereoscopic",handler:e("enableEffect",M.STEREO)}]}]},addControlButton:function(t){switch(t){case"fullscreen":this.fullscreenElement=t=this.createFullscreenButton();break;case"setting":this.settingElement=t=this.createSettingButton();break;case"video":this.videoElement=t=this.createVideoControl();break;default:return}t&&this.barElement.appendChild(t)},createMask:function(){var t=document.createElement("div");return t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.width="100%",t.style.height="100%",t.style.background="transparent",t.style.display="none",t.show=function(){this.style.display="block"},t.hide=function(){this.style.display="none"},t},createSettingButton:function(){var t=this,e=this.createCustomItem({style:{backgroundImage:'url("'+I.Setting+'")',webkitTransition:this.DEFAULT_TRANSITION,transition:this.DEFAULT_TRANSITION},onTap:function(e){e.preventDefault(),e.stopPropagation(),t.mainMenu.toggle(),this.activated?this.deactivate():this.activate()}});return e.activate=function(){this.style.transform="rotate3d(0,0,1,90deg)",this.activated=!0,t.mask.show()},e.deactivate=function(){this.style.transform="rotate3d(0,0,0,0)",this.activated=!1,t.mask.hide(),t.mainMenu&&t.mainMenu.visible&&t.mainMenu.hide(),t.activeSubMenu&&t.activeSubMenu.visible&&t.activeSubMenu.hide(),t.mainMenu&&t.mainMenu._width&&(t.mainMenu.changeSize(t.mainMenu._width),t.mainMenu.unslideAll())},e.activated=!1,e},createFullscreenButton:function(){function t(){n&&(i=!i,o.style.backgroundImage=i?'url("'+I.FullscreenLeave+'")':'url("'+I.FullscreenEnter+'")'),e.dispatchEvent({type:"panolens-viewer-handler",method:"onWindowResize"}),n=!0}var e=this,i=!1,n=!0,s=this.container;if(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled){document.addEventListener("fullscreenchange",t,!1),document.addEventListener("webkitfullscreenchange",t,!1),document.addEventListener("mozfullscreenchange",t,!1),document.addEventListener("MSFullscreenChange",t,!1);var o=this.createCustomItem({style:{backgroundImage:'url("'+I.FullscreenEnter+'")'},onTap:function(t){t.preventDefault(),t.stopPropagation(),n=!1,i?(document.exitFullscreen&&document.exitFullscreen(),document.msExitFullscreen&&document.msExitFullscreen(),document.mozCancelFullScreen&&document.mozCancelFullScreen(),document.webkitExitFullscreen&&document.webkitExitFullscreen(),i=!1):(s.requestFullscreen&&s.requestFullscreen(),s.msRequestFullscreen&&s.msRequestFullscreen(),s.mozRequestFullScreen&&s.mozRequestFullScreen(),s.webkitRequestFullscreen&&s.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT),i=!0),this.style.backgroundImage=i?'url("'+I.FullscreenLeave+'")':'url("'+I.FullscreenEnter+'")'}});if(!document.querySelector("panolens-style-addon")){var a=document.createElement("style");a.id="panolens-style-addon",a.innerHTML=":-webkit-full-screen { width: 100% !important; height: 100% !important }",document.body.appendChild(a)}return o}},createVideoControl:function(){var t=document.createElement("span");return t.style.display="none",t.show=function(){t.style.display=""},t.hide=function(){t.style.display="none",t.controlButton.paused=!0,t.controlButton.update()},t.controlButton=this.createVideoControlButton(),t.seekBar=this.createVideoControlSeekbar(),t.appendChild(t.controlButton),t.appendChild(t.seekBar),t.dispose=function(){t.removeChild(t.controlButton),t.removeChild(t.seekBar),t.controlButton.dispose(),t.controlButton=null,t.seekBar.dispose(),t.seekBar=null},this.addEventListener("video-control-show",t.show),this.addEventListener("video-control-hide",t.hide),t},createVideoControlButton:function(){var t=this,e=this.createCustomItem({style:{float:"left",backgroundImage:'url("'+I.VideoPlay+'")'},onTap:function(i){i.preventDefault(),i.stopPropagation(),t.dispatchEvent({type:"panolens-viewer-handler",method:"toggleVideoPlay",data:!this.paused}),this.paused=!this.paused,e.update()}});return e.paused=!0,e.update=function(t){this.paused=void 0!==t?t:this.paused,this.style.backgroundImage='url("'+(this.paused?I.VideoPlay:I.VideoPause)+'")'},e},createVideoControlSeekbar:function(){function t(t){t.stopPropagation(),h=!0,s=t.clientX||t.changedTouches&&t.changedTouches[0].clientX,o=parseInt(c.style.width)/100,r.container.addEventListener("mousemove",e,{passive:!0}),r.container.addEventListener("mouseup",i,{passive:!0}),r.container.addEventListener("touchmove",e,{passive:!0}),r.container.addEventListener("touchend",i,{passive:!0})}function e(t){h&&(a=((t.clientX||t.changedTouches&&t.changedTouches[0].clientX)-s)/d.clientWidth,a=1<(a=o+a)?1:0>a?0:a,d.setProgress(a),r.dispatchEvent({type:"panolens-viewer-handler",method:"setVideoCurrentTime",data:a}))}function i(t){t.stopPropagation(),h=!1,n()}function n(){r.container.removeEventListener("mousemove",e,!1),r.container.removeEventListener("mouseup",i,!1),r.container.removeEventListener("touchmove",e,!1),r.container.removeEventListener("touchend",i,!1)}var s,o,a,r=this,h=!1,c=document.createElement("div");c.style.width="0%",c.style.height="100%",c.style.backgroundColor="#fff";var l=document.createElement("div");l.style.float="right",l.style.width="14px",l.style.height="14px",l.style.transform="translate(7px, -5px)",l.style.borderRadius="50%",l.style.backgroundColor="#ddd",l.addEventListener("mousedown",t,{passive:!0}),l.addEventListener("touchstart",t,{passive:!0}),c.appendChild(l);var d=this.createCustomItem({style:{float:"left",width:"30%",height:"4px",marginTop:"20px",backgroundColor:"rgba(188,188,188,0.8)"},onTap:function(t){if(t.preventDefault(),t.stopPropagation(),t.target!==l){var e=t.changedTouches&&0<t.changedTouches.length?(t.changedTouches[0].pageX-t.target.getBoundingClientRect().left)/this.clientWidth:t.offsetX/this.clientWidth;r.dispatchEvent({type:"panolens-viewer-handler",method:"setVideoCurrentTime",data:e}),d.setProgress(t.offsetX/this.clientWidth)}},onDispose:function(){n(),l=c=null}});return d.appendChild(c),d.setProgress=function(t){c.style.width=100*t+"%"},this.addEventListener("video-update",(function(t){d.setProgress(t.percentage)})),d.progressElement=c,d.progressElementControl=l,d},createMenuItem:function(t){var e=this,i=document.createElement("a");return i.textContent=t,i.style.display="block",i.style.padding="10px",i.style.textDecoration="none",i.style.cursor="pointer",i.style.pointerEvents="auto",i.style.transition=this.DEFAULT_TRANSITION,i.slide=function(t){this.style.transform="translateX("+(t?"":"-")+"100%)"},i.unslide=function(){this.style.transform="translateX(0)"},i.setIcon=function(t){this.icon&&(this.icon.style.backgroundImage="url("+t+")")},i.setSelectionTitle=function(t){this.selection&&(this.selection.textContent=t)},i.addSelection=function(t){var e=document.createElement("span");return e.style.fontSize="13px",e.style.fontWeight="300",e.style.float="right",this.selection=e,this.setSelectionTitle(t),this.appendChild(e),this},i.addIcon=function(t,e,i){t=void 0===t?I.ChevronRight:t,e=void 0!==e&&e,i=void 0!==i&&i;var n=document.createElement("span");return n.style.float=e?"left":"right",n.style.width="17px",n.style.height="17px",n.style["margin"+(e?"Right":"Left")]="12px",n.style.backgroundSize="cover",i&&(n.style.transform="rotateZ(180deg)"),this.icon=n,this.setIcon(t),this.appendChild(n),this},i.addSubMenu=function(t,i){return this.subMenu=e.createSubMenu(t,i),this},i.addEventListener("mouseenter",(function(){this.style.backgroundColor="#e0e0e0"}),!1),i.addEventListener("mouseleave",(function(){this.style.backgroundColor="#fafafa"}),!1),i},createMenuItemHeader:function(t){return(t=this.createMenuItem(t)).style.borderBottom="1px solid #333",t.style.paddingBottom="15px",t},createMainMenu:function(t){function e(t){t.preventDefault(),t.stopPropagation();var e=i.mainMenu,n=this.subMenu;e.hide(),e.slideAll(),e.parentElement.appendChild(n),i.activeMainItem=this,i.activeSubMenu=n,window.requestAnimationFrame((function(){e.changeSize(n.clientWidth),n.show(),n.unslideAll()}))}var i=this,n=this.createMenu();n._width=200,n.changeSize(n._width);for(var s=0;s<t.length;s++){var o=n.addItem(t[s].title);o.style.paddingLeft="20px",o.addIcon().addEventListener(i.TOUCH_ENABLED?"touchend":"click",e,!1),t[s].subMenu&&0<t[s].subMenu.length&&o.addSelection(t[s].subMenu[0].title).addSubMenu(t[s].title,t[s].subMenu)}return n},createSubMenu:function(t,e){function i(t){t.preventDefault(),t.stopPropagation(),(n=s.mainMenu).changeSize(n._width),n.unslideAll(),n.show(),o.slideAll(!0),o.hide(),"header"!==this.type&&(o.setActiveItem(this),s.activeMainItem.setSelectionTitle(this.textContent),this.handler&&this.handler())}var n,s=this,o=this.createMenu();for(o.items=e,o.activeItem=null,o.addHeader(t).addIcon(void 0,!0,!0).addEventListener(s.TOUCH_ENABLED?"touchend":"click",i,!1),t=0;t<e.length;t++){var a=o.addItem(e[t].title);a.style.fontWeight=300,a.handler=e[t].handler,a.addIcon(" ",!0),a.addEventListener(s.TOUCH_ENABLED?"touchend":"click",i,!1),o.activeItem||o.setActiveItem(a)}return o.slideAll(!0),o},createMenu:function(){var t=this,e=document.createElement("span"),i=e.style;return i.padding="5px 0",i.position="fixed",i.bottom="100%",i.right="14px",i.backgroundColor="#fafafa",i.fontFamily="Helvetica Neue",i.fontSize="14px",i.visibility="hidden",i.opacity=0,i.boxShadow="0 0 12pt rgba(0,0,0,0.25)",i.borderRadius="2px",i.overflow="hidden",i.willChange="width, height, opacity",i.pointerEvents="auto",i.transition=this.DEFAULT_TRANSITION,e.visible=!1,e.changeSize=function(t,e){t&&(this.style.width=t+"px"),e&&(this.style.height=e+"px")},e.show=function(){this.style.opacity=1,this.style.visibility="visible",this.visible=!0},e.hide=function(){this.style.opacity=0,this.style.visibility="hidden",this.visible=!1},e.toggle=function(){this.visible?this.hide():this.show()},e.slideAll=function(t){for(var i=0;i<e.children.length;i++)e.children[i].slide&&e.children[i].slide(t)},e.unslideAll=function(){for(var t=0;t<e.children.length;t++)e.children[t].unslide&&e.children[t].unslide()},e.addHeader=function(e){return(e=t.createMenuItemHeader(e)).type="header",this.appendChild(e),e},e.addItem=function(e){return(e=t.createMenuItem(e)).type="item",this.appendChild(e),e},e.setActiveItem=function(t){this.activeItem&&this.activeItem.setIcon(" "),t.setIcon(I.Check),this.activeItem=t},e.addEventListener("mousemove",this.PREVENT_EVENT_HANDLER,!0),e.addEventListener("mouseup",this.PREVENT_EVENT_HANDLER,!0),e.addEventListener("mousedown",this.PREVENT_EVENT_HANDLER,!0),e},createCustomItem:function(t){var e=this,i=(t=void 0===t?{}:t).element||document.createElement("span"),n=t.onDispose;return i.style.cursor="pointer",i.style.float="right",i.style.width="44px",i.style.height="100%",i.style.backgroundSize="60%",i.style.backgroundRepeat="no-repeat",i.style.backgroundPosition="center",i.style.webkitUserSelect=i.style.MozUserSelect=i.style.userSelect="none",i.style.position="relative",i.style.pointerEvents="auto",i.addEventListener(e.TOUCH_ENABLED?"touchstart":"mouseenter",(function(){i.style.filter=i.style.webkitFilter="drop-shadow(0 0 5px rgba(255,255,255,1))"}),{passive:!0}),i.addEventListener(e.TOUCH_ENABLED?"touchend":"mouseleave",(function(){i.style.filter=i.style.webkitFilter=""}),{passive:!0}),this.mergeStyleOptions(i,t.style),t.onTap&&i.addEventListener(e.TOUCH_ENABLED?"touchend":"click",t.onTap,!1),i.dispose=function(){i.removeEventListener(e.TOUCH_ENABLED?"touchend":"click",t.onTap,!1),n&&t.onDispose()},i},mergeStyleOptions:function(t,e){for(var i in e=void 0===e?{}:e)e.hasOwnProperty(i)&&(t.style[i]=e[i]);return t},dispose:function(){this.barElement&&(this.container.removeChild(this.barElement),this.barElement.dispose(),this.barElement=null)}}),a.prototype=Object.assign(Object.create(e.Mesh.prototype),{constructor:a,add:function(t){var i;if(1<arguments.length){for(i=0;i<arguments.length;i++)this.add(arguments[i]);return this}if(t instanceof s){if(i=t,t.dispatchEvent){var n=this.container;n&&t.dispatchEvent({type:"panolens-container",container:n}),t.dispatchEvent({type:"panolens-infospot-focus",method:function(t,e,i){this.dispatchEvent({type:"panolens-viewer-handler",method:"tweenControlCenter",data:[t,e,i]})}.bind(this)})}}else(i=new e.Object3D).scale.x=-1,i.scalePlaceHolder=!0,i.add(t);e.Object3D.prototype.add.call(this,i)},load:function(){this.onLoad()},onClick:function(t){t.intersects&&0===t.intersects.length&&this.traverse((function(t){t.dispatchEvent({type:"dismiss"})}))},setContainer:function(t){if(t instanceof HTMLElement)var e=t;else t&&t.container&&(e=t.container);e&&(this.children.forEach((function(t){t instanceof s&&t.dispatchEvent&&t.dispatchEvent({type:"panolens-container",container:e})})),this.container=e)},onLoad:function(){this.loaded=!0,this.dispatchEvent({type:"load"})},onProgress:function(t){this.dispatchEvent({type:"progress",progress:t})},onError:function(){this.dispatchEvent({type:"error"})},getZoomLevel:function(){return 800>=window.innerWidth?this.ImageQualityFair:800<window.innerWidth&&1280>=window.innerWidth?this.ImageQualityMedium:1280<window.innerWidth&&1920>=window.innerWidth?this.ImageQualityHigh:1920<window.innerWidth?this.ImageQualitySuperHigh:this.ImageQualityLow},updateTexture:function(t){this.material.map=t,this.material.needsUpdate=!0},toggleInfospotVisibility:function(t,e){e=void 0!==e?e:0;var i=void 0!==t?t:!this.isInfospotVisible;this.traverse((function(t){t instanceof s&&(i?t.show(e):t.hide(e))})),this.isInfospotVisible=i,this.infospotAnimation.onComplete(function(){this.dispatchEvent({type:"infospot-animation-complete",visible:i})}.bind(this)).delay(e).start()},setLinkingImage:function(t,e){this.linkingImageURL=t,this.linkingImageScale=e},link:function(t,e,i,n){this.visible=!0,e?((n=new s(i=void 0!==i?i:void 0!==t.linkingImageScale?t.linkingImageScale:300,n=n||(t.linkingImageURL?t.linkingImageURL:I.Arrow))).position.copy(e),n.toPanorama=t,n.addEventListener("click",function(){this.dispatchEvent({type:"panolens-viewer-handler",method:"setPanorama",data:t})}.bind(this)),this.linkedSpots.push(n),this.add(n),this.visible=!1):console.warn("Please specify infospot position for linking")},reset:function(){this.children.length=0},setupTransitions:function(){this.fadeInAnimation=new S.Tween(this.material).easing(S.Easing.Quartic.Out).onStart(function(){this.visible=!0,this.dispatchEvent({type:"enter-fade-start"})}.bind(this)),this.fadeOutAnimation=new S.Tween(this.material).easing(S.Easing.Quartic.Out).onComplete(function(){this.visible=!1,this.dispatchEvent({type:"leave-complete"})}.bind(this)),this.enterTransition=new S.Tween(this).easing(S.Easing.Quartic.Out).onComplete(function(){this.dispatchEvent({type:"enter-complete"})}.bind(this)).start(),this.leaveTransition=new S.Tween(this).easing(S.Easing.Quartic.Out)},onFadeAnimationUpdate:function(){var t=this.material.opacity,e=this.material.uniforms;e&&e.opacity&&(e.opacity.value=t)},fadeIn:function(t){t=0<=t?t:this.animationDuration,this.fadeOutAnimation.stop(),this.fadeInAnimation.to({opacity:1},t).onUpdate(this.onFadeAnimationUpdate.bind(this)).onComplete(function(){this.toggleInfospotVisibility(!0,t/2),this.dispatchEvent({type:"enter-fade-complete"})}.bind(this)).start()},fadeOut:function(t){t=0<=t?t:this.animationDuration,this.fadeInAnimation.stop(),this.fadeOutAnimation.to({opacity:0},t).onUpdate(this.onFadeAnimationUpdate.bind(this)).start()},onEnter:function(){var t=this.animationDuration;this.leaveTransition.stop(),this.enterTransition.to({},t).onStart(function(){this.dispatchEvent({type:"enter-start"}),this.loaded?this.fadeIn(t):this.load()}.bind(this)).start(),this.dispatchEvent({type:"enter"}),this.children.forEach((function(t){t.dispatchEvent({type:"panorama-enter"})})),this.active=!0},onLeave:function(){var t=this.animationDuration;this.enterTransition.stop(),this.leaveTransition.to({},t).onStart(function(){this.dispatchEvent({type:"leave-start"}),this.fadeOut(t),this.toggleInfospotVisibility(!1)}.bind(this)).start(),this.dispatchEvent({type:"leave"}),this.children.forEach((function(t){t.dispatchEvent({type:"panorama-leave"})})),this.active=!1},dispose:function(){this.infospotAnimation.stop(),this.fadeInAnimation.stop(),this.fadeOutAnimation.stop(),this.enterTransition.stop(),this.leaveTransition.stop(),this.dispatchEvent({type:"panolens-viewer-handler",method:"onPanoramaDispose",data:this}),function t(e){for(var i=e.geometry,n=e.material,o=e.children.length-1;0<=o;o--)t(e.children[o]),e.remove(e.children[o]);e instanceof s&&e.dispose(),i&&(i.dispose(),e.geometry=null),n&&(n.dispose(),e.material=null)}(this),this.parent&&this.parent.remove(this)}}),r.prototype=Object.assign(Object.create(a.prototype),{constructor:r,load:function(t){(t=t||this.src)?"string"==typeof t?L.load(t,this.onLoad.bind(this),this.onProgress.bind(this),this.onError.bind(this)):t instanceof HTMLImageElement&&this.onLoad(new e.Texture(t)):console.warn("Image source undefined")},onLoad:function(t){t.minFilter=t.magFilter=e.LinearFilter,t.needsUpdate=!0,this.updateTexture(t),window.requestAnimationFrame(a.prototype.onLoad.bind(this))},reset:function(){a.prototype.reset.call(this)},dispose:function(){var t=this.material.map;e.Cache.remove(this.src),t&&t.dispose(),a.prototype.dispose.call(this)}}),h.prototype=Object.assign(Object.create(a.prototype),{constructor:h}),c.prototype=Object.assign(Object.create(a.prototype),{constructor:c,load:function(){R.load(this.images,this.onLoad.bind(this),this.onProgress.bind(this),this.onError.bind(this))},onLoad:function(t){this.material.uniforms.tCube.value=t,a.prototype.onLoad.call(this)},dispose:function(){var t=this.material.uniforms.tCube.value;this.images.forEach((function(t){e.Cache.remove(t)})),t instanceof e.CubeTexture&&t.dispose(),a.prototype.dispose.call(this)}}),l.prototype=Object.assign(Object.create(c.prototype),{constructor:l}),d.prototype=Object.assign(Object.create(a.prototype),{constructor:d,isMobile:function(){var t=!1,e=window.navigator.userAgent||window.navigator.vendor||window.opera;return(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),t},load:function(){var t=this.options,e=t.muted,i=t.loop,n=t.autoplay,s=t.playsinline;t=t.crossOrigin;var o=this.videoElement,a=this.material,r=this.onProgress.bind(this),h=this.onLoad.bind(this);o.loop=i,o.autoplay=n,o.playsinline=s,o.crossOrigin=t,o.muted=e,s&&(o.setAttribute("playsinline",""),o.setAttribute("webkit-playsinline","")),s=function(){this.setVideoTexture(o),n&&this.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!1}),this.isMobile()&&(o.pause(),n&&e?this.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!1}):this.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!0})),window.requestAnimationFrame((function(){a.map.needsUpdate=!0,r({loaded:1,total:1}),h()}))},2<o.readyState?s.call(this):(0===o.querySelectorAll("source").length&&((t=document.createElement("source")).src=this.src,o.appendChild(t)),o.load()),o.addEventListener("loadeddata",s.bind(this)),o.addEventListener("timeupdate",function(){this.videoProgress=0<=o.duration?o.currentTime/o.duration:0,this.dispatchEvent({type:"panolens-viewer-handler",method:"onVideoUpdate",data:this.videoProgress})}.bind(this)),o.addEventListener("ended",function(){i||(this.resetVideo(),this.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!0}))}.bind(this),!1)},setVideoTexture:function(t){t&&((t=new e.VideoTexture(t)).minFilter=e.LinearFilter,t.magFilter=e.LinearFilter,t.format=e.RGBFormat,this.updateTexture(t))},reset:function(){this.videoElement=void 0,a.prototype.reset.call(this)},isVideoPaused:function(){return this.videoElement.paused},toggleVideo:function(){var t=this.videoElement;t&&t[t.paused?"play":"pause"]()},setVideoCurrentTime:function(t){t=t.percentage;var e=this.videoElement;e&&!Number.isNaN(t)&&1!==t&&(e.currentTime=e.duration*t,this.dispatchEvent({type:"panolens-viewer-handler",method:"onVideoUpdate",data:t}))},playVideo:function(){var t=this.videoElement,e=this.playVideo.bind(this),i=this.dispatchEvent.bind(this);t&&t.paused&&t.play().then((function(){i({type:"play"})})).catch((function(t){window.requestAnimationFrame(e),i({type:"play-error",error:t})}))},pauseVideo:function(){var t=this.videoElement;t&&!t.paused&&t.pause(),this.dispatchEvent({type:"pause"})},resumeVideoProgress:function(){var t=this.videoElement;4<=t.readyState&&t.autoplay&&!this.isMobile()?(this.playVideo(),this.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!1})):(this.pauseVideo(),this.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!0})),this.setVideoCurrentTime({percentage:this.videoProgress})},resetVideo:function(){this.videoElement&&this.setVideoCurrentTime({percentage:0})},isVideoMuted:function(){return this.videoElement.muted},muteVideo:function(){var t=this.videoElement;t&&!t.muted&&(t.muted=!0),this.dispatchEvent({type:"volumechange"})},unmuteVideo:function(){var t=this.videoElement;t&&this.isVideoMuted()&&(t.muted=!1),this.dispatchEvent({type:"volumechange"})},getVideoElement:function(){return this.videoElement},dispose:function(){var t=this.material.map;this.pauseVideo(),this.removeEventListener("leave",this.pauseVideo.bind(this)),this.removeEventListener("enter-fade-start",this.resumeVideoProgress.bind(this)),this.removeEventListener("video-toggle",this.toggleVideo.bind(this)),this.removeEventListener("video-time",this.setVideoCurrentTime.bind(this)),t&&t.dispose(),a.prototype.dispose.call(this)}}),Object.assign(u.prototype,{constructor:u,setProgress:function(t,e){this.onProgress&&this.onProgress({loaded:t,total:e})},adaptTextureToZoom:function(){var t=this.widths[this._zoom],e=this.heights[this._zoom],i=this.maxW,n=this.maxH;this._wc=Math.ceil(t/i),this._hc=Math.ceil(e/n);for(var s=0;s<this._hc;s++)for(var o=0;o<this._wc;o++){var a=document.createElement("canvas");a.width=o<this._wc-1?i:t-i*o,a.height=s<this._hc-1?n:e-n*s,this._canvas.push(a),this._ctx.push(a.getContext("2d"))}},composeFromTile:function(t,e,i){var n=this.maxW,s=this.maxH;t*=512,e*=512;var o=Math.floor(t/n),a=Math.floor(e/s);this._ctx[a*this._wc+o].drawImage(i,0,0,i.width,i.height,t-o*n,e-a*s,512,512),this.progress()},progress:function(){this._count++,this.setProgress(this._count,this._total),this._count===this._total&&(this.canvas=this._canvas,this.panoId=this._panoId,this.zoom=this._zoom,this.onPanoramaLoad)&&this.onPanoramaLoad(this._canvas[0])},composePanorama:function(){this.setProgress(0,1);var t=this.levelsW[this._zoom],e=this.levelsH[this._zoom],i=this;this._count=0,this._total=t*e;for(var n=this._parameters.useWebGL,s=0;s<e;s++)for(var o={},a=0;a<t;o={$jscomp$loop$prop$url$1:o.$jscomp$loop$prop$url$1},a++)o.$jscomp$loop$prop$url$1="https://geo0.ggpht.com/cbk?cb_client=maps_sv.tactile&authuser=0&hl=en&output=tile&zoom="+this._zoom+"&x="+a+"&y="+s+"&panoid="+this._panoId+"&nbt&fover=2",function(t){return function(e,s){if(n)var o=L.load(t.$jscomp$loop$prop$url$1,null,(function(){i.composeFromTile(e,s,o)}));else{var a=new Image;a.addEventListener("load",(function(){i.composeFromTile(e,s,this)})),a.crossOrigin="",a.src=t.$jscomp$loop$prop$url$1}}}(o)(a,s)},load:function(t){this.loadPano(t)},loadPano:function(t){var e=this;this._panoClient.getPanoramaById(t,(function(t,i){i===google.maps.StreetViewStatus.OK&&(e.result=t,e.copyright=t.copyright,e._panoId=t.location.pano,e.composePanorama())}))},setZoom:function(t){this._zoom=t,this.adaptTextureToZoom()}}),p.prototype=Object.assign(Object.create(r.prototype),{constructor:p,load:function(t){this.loadRequested=!0,t=t||this.panoId||{},this.gsvLoader&&this.loadGSVLoader(t)},setupGoogleMapAPI:function(t){var e=document.createElement("script");e.src="https://maps.googleapis.com/maps/api/js?",e.src+=t?"key="+t:"",e.onreadystatechange=this.setGSVLoader.bind(this),e.onload=this.setGSVLoader.bind(this),document.querySelector("head").appendChild(e)},setGSVLoader:function(){this.gsvLoader=new u,this.loadRequested&&this.load()},getGSVLoader:function(){return this.gsvLoader},loadGSVLoader:function(t){this.loadRequested=!1,this.gsvLoader.onProgress=this.onProgress.bind(this),this.gsvLoader.onPanoramaLoad=this.onLoad.bind(this),this.gsvLoader.setZoom(this.getZoomLevel()),this.gsvLoader.load(t),this.gsvLoader.loaded=!0},onLoad:function(t){r.prototype.onLoad.call(this,new e.Texture(t))},reset:function(){this.gsvLoader=void 0,r.prototype.reset.call(this)}});var O={uniforms:{tDiffuse:{value:new e.Texture},resolution:{value:1},transform:{value:new e.Matrix4},zoom:{value:1},opacity:{value:1}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = uv;\ngl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D tDiffuse;\nuniform float resolution;\nuniform mat4 transform;\nuniform float zoom;\nuniform float opacity;\nvarying vec2 vUv;\nconst float PI = 3.141592653589793;\nvoid main(){\nvec2 position = -1.0 +  2.0 * vUv;\nposition *= vec2( zoom * resolution, zoom * 0.5 );\nfloat x2y2 = position.x * position.x + position.y * position.y;\nvec3 sphere_pnt = vec3( 2. * position, x2y2 - 1. ) / ( x2y2 + 1. );\nsphere_pnt = vec3( transform * vec4( sphere_pnt, 1.0 ) );\nvec2 sampleUV = vec2(\n(atan(sphere_pnt.y, sphere_pnt.x) / PI + 1.0) * 0.5,\n(asin(sphere_pnt.z) / PI + 0.5)\n);\ngl_FragColor = texture2D( tDiffuse, sampleUV );\ngl_FragColor.a *= opacity;\n}"};m.prototype=Object.assign(Object.create(r.prototype),{constructor:m,add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}t instanceof s&&(t.material.depthTest=!1),r.prototype.add.call(this,t)},createGeometry:function(t,i){return new e.PlaneBufferGeometry(t,t*i)},createMaterial:function(t){var i=Object.assign({},O),n=i.uniforms;return n.zoom.value=t,n.opacity.value=0,new e.ShaderMaterial({uniforms:n,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:e.BackSide,transparent:!0})},registerMouseEvents:function(){this.container.addEventListener("mousedown",this.onMouseDown.bind(this),{passive:!0}),this.container.addEventListener("mousemove",this.onMouseMove.bind(this),{passive:!0}),this.container.addEventListener("mouseup",this.onMouseUp.bind(this),{passive:!0}),this.container.addEventListener("touchstart",this.onMouseDown.bind(this),{passive:!0}),this.container.addEventListener("touchmove",this.onMouseMove.bind(this),{passive:!0}),this.container.addEventListener("touchend",this.onMouseUp.bind(this),{passive:!0}),this.container.addEventListener("mousewheel",this.onMouseWheel.bind(this),{passive:!1}),this.container.addEventListener("DOMMouseScroll",this.onMouseWheel.bind(this),{passive:!1}),this.container.addEventListener("contextmenu",this.onContextMenu.bind(this),{passive:!0})},unregisterMouseEvents:function(){this.container.removeEventListener("mousedown",this.onMouseDown.bind(this),!1),this.container.removeEventListener("mousemove",this.onMouseMove.bind(this),!1),this.container.removeEventListener("mouseup",this.onMouseUp.bind(this),!1),this.container.removeEventListener("touchstart",this.onMouseDown.bind(this),!1),this.container.removeEventListener("touchmove",this.onMouseMove.bind(this),!1),this.container.removeEventListener("touchend",this.onMouseUp.bind(this),!1),this.container.removeEventListener("mousewheel",this.onMouseWheel.bind(this),!1),this.container.removeEventListener("DOMMouseScroll",this.onMouseWheel.bind(this),!1),this.container.removeEventListener("contextmenu",this.onContextMenu.bind(this),!1)},onMouseDown:function(t){switch(t.touches&&t.touches.length||1){case 1:var e=0<=t.clientX?t.clientX:t.touches[0].clientX;t=0<=t.clientY?t.clientY:t.touches[0].clientY,this.dragging=!0,this.userMouse.set(e,t);break;case 2:e=t.touches[0].pageX-t.touches[1].pageX,t=t.touches[0].pageY-t.touches[1].pageY,this.userMouse.pinchDistance=Math.sqrt(e*e+t*t)}this.onUpdateCallback()},onMouseMove:function(t){switch(t.touches&&t.touches.length||1){case 1:var i=0<=t.clientX?t.clientX:t.touches[0].clientX;t=0<=t.clientY?t.clientY:t.touches[0].clientY;var n=.4*e.Math.degToRad(i-this.userMouse.x),s=.4*e.Math.degToRad(t-this.userMouse.y);this.dragging&&(this.quatA.setFromAxisAngle(this.vectorY,n),this.quatB.setFromAxisAngle(this.vectorX,s),this.quatCur.multiply(this.quatA).multiply(this.quatB),this.userMouse.set(i,t));break;case 2:i=t.touches[0].pageX-t.touches[1].pageX,t=t.touches[0].pageY-t.touches[1].pageY,this.addZoomDelta(this.userMouse.pinchDistance-Math.sqrt(i*i+t*t))}},onMouseUp:function(){this.dragging=!1},onMouseWheel:function(t){t.preventDefault(),t.stopPropagation();var e=0;void 0!==t.wheelDelta?e=t.wheelDelta:void 0!==t.detail&&(e=-t.detail),this.addZoomDelta(e),this.onUpdateCallback()},addZoomDelta:function(t){var e=this.material.uniforms,i=.1*this.size,n=10*this.size;e.zoom.value+=t,e.zoom.value<=i?e.zoom.value=i:e.zoom.value>=n&&(e.zoom.value=n)},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)<this.EPS&&window.cancelAnimationFrame(this.frameId)},reset:function(){this.quatCur.set(0,0,0,1),this.quatSlerp.set(0,0,0,1),this.onUpdateCallback()},onLoad:function(t){this.material.uniforms.resolution.value=this.container.clientWidth/this.container.clientHeight,this.registerMouseEvents(),this.onUpdateCallback(),this.dispatchEvent({type:"panolens-viewer-handler",method:"disableControl"}),r.prototype.onLoad.call(this,t)},onLeave:function(){this.unregisterMouseEvents(),this.dispatchEvent({type:"panolens-viewer-handler",method:"enableControl",data:w.ORBIT}),window.cancelAnimationFrame(this.frameId),r.prototype.onLeave.call(this)},onWindowResize:function(){this.material.uniforms.resolution.value=this.container.clientWidth/this.container.clientHeight},onContextMenu:function(){this.dragging=!1},dispose:function(){this.unregisterMouseEvents(),r.prototype.dispose.call(this)}}),v.prototype=Object.assign(Object.create(m.prototype),{constructor:v,onLoad:function(t){this.updateTexture(t),m.prototype.onLoad.call(this,t)},updateTexture:function(t){t.minFilter=t.magFilter=e.LinearFilter,this.material.uniforms.tDiffuse.value=t},dispose:function(){var t=this.material.uniforms.tDiffuse;t&&t.value&&t.value.dispose(),m.prototype.dispose.call(this)}}),A.prototype=Object.assign(Object.create(a.prototype),{constructor:A,onPanolensContainer:function(t){this.media.setContainer(t.container)},onPanolensScene:function(t){this.media.setScene(t.scene)},start:function(){return this.media.start()},stop:function(){this.media.stop()}}),g.prototype=Object.assign(Object.create(e.EventDispatcher.prototype),{constructor:g}),f.prototype=Object.assign(Object.create(e.EventDispatcher.prototype),{constructor:f});var D=function(t){var i=new e.StereoCamera;i.aspect=.5;var n=new e.Vector2;this.setEyeSeparation=function(t){i.eyeSep=t},this.setSize=function(e,i){t.setSize(e,i)},this.render=function(e,s){e.updateMatrixWorld(),null===s.parent&&s.updateMatrixWorld(),i.update(s),t.getSize(n),t.autoClear&&t.clear(),t.setScissorTest(!0),t.setScissor(0,0,n.width/2,n.height),t.setViewport(0,0,n.width/2,n.height),t.render(e,i.cameraL),t.setScissor(n.width/2,0,n.width/2,n.height),t.setViewport(n.width/2,0,n.width/2,n.height),t.render(e,i.cameraR),t.setScissorTest(!1)}};y.prototype=Object.assign(Object.create(e.EventDispatcher.prototype),{constructor:y,add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}this.scene.add(t),t.addEventListener&&t.addEventListener("panolens-viewer-handler",this.eventHandler.bind(this)),t instanceof a&&t.dispatchEvent&&t.dispatchEvent({type:"panolens-container",container:this.container}),t instanceof A&&t.dispatchEvent({type:"panolens-scene",scene:this.scene}),"panorama"===t.type&&(this.addPanoramaEventListener(t),this.panorama||this.setPanorama(t))},remove:function(t){t.removeEventListener&&t.removeEventListener("panolens-viewer-handler",this.eventHandler.bind(this)),this.scene.remove(t)},addDefaultControlBar:function(t){if(this.widget)console.warn("Default control bar exists");else{var e=new o(this.container);e.addEventListener("panolens-viewer-handler",this.eventHandler.bind(this)),e.addControlBar(),t.forEach((function(t){e.addControlButton(t)})),this.widget=e}},setPanorama:function(t){var e=this.panorama;if("panorama"===t.type&&e!==t){this.hideInfospot();var i=function(){e&&e.onLeave(),t.removeEventListener("enter-fade-start",i)};t.addEventListener("enter-fade-start",i),(this.panorama=t).onEnter()}},eventHandler:function(t){t.method&&this[t.method]&&this[t.method](t.data)},dispatchEventToChildren:function(t){this.scene.traverse((function(e){e.dispatchEvent&&e.dispatchEvent(t)}))},activateWidgetItem:function(t,e){var i=this.widget.mainMenu,n=i.children[0];if(i=i.children[1],void 0!==t){switch(t){case 0:t=n.subMenu.children[1];break;case 1:t=n.subMenu.children[2];break;default:t=n.subMenu.children[1]}n.subMenu.setActiveItem(t),n.setSelectionTitle(t.textContent)}if(void 0!==e){switch(e){case M.CARDBOARD:t=i.subMenu.children[2];break;case M.STEREO:t=i.subMenu.children[3];break;default:t=i.subMenu.children[1]}i.subMenu.setActiveItem(t),i.setSelectionTitle(t.textContent)}},enableEffect:function(t){if(this.mode!==t)if(t===M.NORMAL)this.disableEffect();else{this.mode=t;var e=this.camera.fov;switch(t){case M.CARDBOARD:this.effect=this.CardboardEffect,this.enableReticleControl();break;case M.STEREO:this.effect=this.StereoEffect,this.enableReticleControl();break;default:this.effect=null,this.disableReticleControl()}this.activateWidgetItem(void 0,this.mode),this.dispatchEventToChildren({type:"panolens-dual-eye-effect",mode:this.mode}),this.camera.fov=e+.01,this.effect.setSize(this.container.clientWidth,this.container.clientHeight),this.render(),this.camera.fov=e,this.dispatchEvent({type:"mode-change",mode:this.mode})}},disableEffect:function(){this.mode!==M.NORMAL&&(this.mode=M.NORMAL,this.disableReticleControl(),this.activateWidgetItem(void 0,this.mode),this.dispatchEventToChildren({type:"panolens-dual-eye-effect",mode:this.mode}),this.renderer.setSize(this.container.clientWidth,this.container.clientHeight),this.render(),this.dispatchEvent({type:"mode-change",mode:this.mode}))},enableReticleControl:function(){this.reticle.visible||(this.tempEnableReticle=!0,this.unregisterMouseAndTouchEvents(),this.reticle.show(),this.registerReticleEvent(),this.updateReticleEvent())},disableReticleControl:function(){this.tempEnableReticle=!1,this.options.enableReticle?this.updateReticleEvent():(this.reticle.hide(),this.unregisterReticleEvent(),this.registerMouseAndTouchEvents())},enableAutoRate:function(){this.options.autoRotate=!0,this.OrbitControls.autoRotate=!0},disableAutoRate:function(){clearTimeout(this.autoRotateRequestId),this.options.autoRotate=!1,this.OrbitControls.autoRotate=!1},toggleVideoPlay:function(t){this.panorama instanceof d&&this.panorama.dispatchEvent({type:"video-toggle",pause:t})},setVideoCurrentTime:function(t){this.panorama instanceof d&&this.panorama.dispatchEvent({type:"video-time",percentage:t})},onVideoUpdate:function(t){var e=this.widget;e&&e.dispatchEvent({type:"video-update",percentage:t})},addUpdateCallback:function(t){t&&this.updateCallbacks.push(t)},removeUpdateCallback:function(t){var e=this.updateCallbacks.indexOf(t);t&&0<=e&&this.updateCallbacks.splice(e,1)},showVideoWidget:function(){var t=this.widget;t&&t.dispatchEvent({type:"video-control-show"})},hideVideoWidget:function(){var t=this.widget;t&&t.dispatchEvent({type:"video-control-hide"})},updateVideoPlayButton:function(t){var e=this.widget;e&&e.videoElement&&e.videoElement.controlButton&&e.videoElement.controlButton.update(t)},addPanoramaEventListener:function(t){t.addEventListener("enter-fade-start",this.setCameraControl.bind(this)),t instanceof d&&(t.addEventListener("enter-fade-start",this.showVideoWidget.bind(this)),t.addEventListener("leave",function(){this.panorama instanceof d||this.hideVideoWidget.call(this)}.bind(this)))},setCameraControl:function(){this.OrbitControls.target.copy(this.panorama.position)},getControl:function(){return this.control},getScene:function(){return this.scene},getCamera:function(){return this.camera},getRenderer:function(){return this.renderer},getContainer:function(){return this.container},getControlId:function(){return this.control.id},getNextControlId:function(){return this.controls[this.getNextControlIndex()].id},getNextControlIndex:function(){var t=this.controls,e=t.indexOf(this.control)+1;return e>=t.length?0:e},setCameraFov:function(t){this.camera.fov=t,this.camera.updateProjectionMatrix()},enableControl:function(t){switch(t=0<=t&&t<this.controls.length?t:0,this.control.enabled=!1,this.control=this.controls[t],this.control.enabled=!0,t){case w.ORBIT:this.camera.position.copy(this.panorama.position),this.camera.position.z+=1;break;case w.DEVICEORIENTATION:this.camera.position.copy(this.panorama.position)}this.control.update(),this.activateWidgetItem(t,void 0)},disableControl:function(){this.control.enabled=!1},toggleNextControl:function(){this.enableControl(this.getNextControlIndex())},getScreenVector:function(t){t=t.clone();var e=this.container.clientWidth/2,i=this.container.clientHeight/2;return t.project(this.camera),t.x=t.x*e+e,t.y=-t.y*i+i,t.z=0,t},checkSpriteInViewport:function(t){return this.camera.matrixWorldInverse.getInverse(this.camera.matrixWorld),this.cameraViewProjectionMatrix.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.cameraFrustum.setFromMatrix(this.cameraViewProjectionMatrix),t.visible&&this.cameraFrustum.intersectsSprite(t)},reverseDraggingDirection:function(){this.OrbitControls.rotateSpeed*=-1,this.OrbitControls.momentumScalingFactor*=-1},addReticle:function(){this.reticle=new n(16777215,!0,this.options.dwellTime),this.reticle.hide(),this.camera.add(this.reticle),this.sceneReticle.add(this.camera)},tweenControlCenter:function(t,i,n){var s;if(this.control===this.OrbitControls){t instanceof Array&&(i=t[1],n=t[2],t=t[0]),i=void 0!==i?i:1e3,n=n||S.Easing.Exponential.Out;var o=this,a=this.camera.getWorldDirection(new e.Vector3),r=a.clone(),h=this.panorama.getWorldPosition(new e.Vector3).sub(this.camera.getWorldPosition(new e.Vector3));(t=t.clone()).x*=-1,t.add(h).normalize();var c=t.clone();a.y=0,t.y=0,h=(h=(h=Math.atan2(t.z,t.x)-Math.atan2(a.z,a.x))>Math.PI?h-2*Math.PI:h)<-Math.PI?h+2*Math.PI:h,a=Math.abs(r.angleTo(a)+(0>=r.y*c.y?c.angleTo(t):-c.angleTo(t))),a*=c.y<r.y?1:-1,r={left:0,up:0};var l=s=0;this.tweenLeftAnimation.stop(),this.tweenUpAnimation.stop(),this.tweenLeftAnimation=new S.Tween(r).to({left:h},i).easing(n).onUpdate((function(t){o.control.rotateLeft(t.left-s),s=t.left})).start(),this.tweenUpAnimation=new S.Tween(r).to({up:a},i).easing(n).onUpdate((function(t){o.control.rotateUp(t.up-l),l=t.up})).start()}},tweenControlCenterByObject:function(t,i,n){var s=!1;if(t.traverseAncestors((function(t){t.scalePlaceHolder&&(s=!0)})),s){var o=new e.Vector3(-1,1,1);this.tweenControlCenter(t.getWorldPosition(new e.Vector3).multiply(o),i,n)}else this.tweenControlCenter(t.getWorldPosition(new e.Vector3),i,n)},onWindowResize:function(t,e){var i=this.container.classList.contains("panolens-container")||this.container.isFullscreen;if(void 0!==t&&void 0!==e){var n=t,s=e;this.container._width=t,this.container._height=e}else t=(e=/(android)/i.test(window.navigator.userAgent))?Math.min(document.documentElement.clientWidth,window.innerWidth||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0),e=e?Math.min(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientHeight,window.innerHeight||0),n=i?t:this.container.clientWidth,s=i?e:this.container.clientHeight,this.container._width=n,this.container._height=s;this.camera.aspect=n/s,this.camera.updateProjectionMatrix(),this.renderer.setSize(n,s),(this.options.enableReticle||this.tempEnableReticle)&&this.updateReticleEvent(),this.dispatchEvent({type:"window-resize",width:n,height:s}),this.scene.traverse((function(t){t.dispatchEvent&&t.dispatchEvent({type:"window-resize",width:n,height:s})}))},addOutputElement:function(){var t=document.createElement("div");t.style.position="absolute",t.style.right="10px",t.style.top="10px",t.style.color="#fff",this.container.appendChild(t),this.outputDivElement=t},outputPosition:function(){var t=this.raycaster.intersectObject(this.panorama,!0);if(0<t.length){t=t[0].point.clone();var i=new e.Vector3(-1,1,1),n=this.panorama.getWorldPosition(new e.Vector3);if(t.sub(n).multiply(i),i=t.x.toFixed(2)+", "+t.y.toFixed(2)+", "+t.z.toFixed(2),0!==t.length())switch(this.options.output){case"console":console.info(i);break;case"overlay":this.outputDivElement.textContent=i}}},onMouseDown:function(t){t.preventDefault(),this.userMouse.x=0<=t.clientX?t.clientX:t.touches[0].clientX,this.userMouse.y=0<=t.clientY?t.clientY:t.touches[0].clientY,this.userMouse.type="mousedown",this.onTap(t)},onMouseMove:function(t){t.preventDefault(),this.userMouse.type="mousemove",this.onTap(t)},onMouseUp:function(t){this.userMouse.type="mouseup";var e=this.userMouse.x>=t.clientX-this.options.clickTolerance&&this.userMouse.x<=t.clientX+this.options.clickTolerance&&this.userMouse.y>=t.clientY-this.options.clickTolerance&&this.userMouse.y<=t.clientY+this.options.clickTolerance||t.changedTouches&&this.userMouse.x>=t.changedTouches[0].clientX-this.options.clickTolerance&&this.userMouse.x<=t.changedTouches[0].clientX+this.options.clickTolerance&&this.userMouse.y>=t.changedTouches[0].clientY-this.options.clickTolerance&&this.userMouse.y<=t.changedTouches[0].clientY+this.options.clickTolerance?"click":void 0;if((!t||!t.target||t.target.classList.contains("panolens-canvas"))&&(t.preventDefault(),t=t.changedTouches&&1===t.changedTouches.length?this.onTap({clientX:t.changedTouches[0].clientX,clientY:t.changedTouches[0].clientY},e):this.onTap(t,e),this.userMouse.type="none",!t&&"click"===e)){t=(e=this.options).autoHideControlBar;var i=this.panorama,n=this.toggleControlBar;e.autoHideInfospot&&i&&i.toggleInfospotVisibility(),t&&n()}},onTap:function(t,e){var i=this.container.getBoundingClientRect(),n=i.top,o=this.container,a=o.clientHeight;if(this.raycasterPoint.x=(t.clientX-i.left)/o.clientWidth*2-1,this.raycasterPoint.y=-(t.clientY-n)/a*2+1,this.raycaster.setFromCamera(this.raycasterPoint,this.camera),this.panorama){if(("mousedown"!==t.type&&this.touchSupported||this.OUTPUT_INFOSPOT)&&this.outputPosition(),i=this.raycaster.intersectObjects(this.panorama.children,!0),n=this.getConvertedIntersect(i),o=0<i.length?i[0].object:void 0,"mouseup"===this.userMouse.type&&(n&&this.pressEntityObject===n&&this.pressEntityObject.dispatchEvent&&this.pressEntityObject.dispatchEvent({type:"pressstop-entity",mouseEvent:t}),this.pressEntityObject=void 0),"mouseup"===this.userMouse.type&&(o&&this.pressObject===o&&this.pressObject.dispatchEvent&&this.pressObject.dispatchEvent({type:"pressstop",mouseEvent:t}),this.pressObject=void 0),"click"===e?(this.panorama.dispatchEvent({type:"click",intersects:i,mouseEvent:t}),n&&n.dispatchEvent&&n.dispatchEvent({type:"click-entity",mouseEvent:t}),o&&o.dispatchEvent&&o.dispatchEvent({type:"click",mouseEvent:t})):(this.panorama.dispatchEvent({type:"hover",intersects:i,mouseEvent:t}),(this.hoverObject&&0<i.length&&this.hoverObject!==n||this.hoverObject&&0===i.length)&&(this.hoverObject.dispatchEvent&&(this.hoverObject.dispatchEvent({type:"hoverleave",mouseEvent:t}),this.reticle.end()),this.hoverObject=void 0),n&&0<i.length&&(this.hoverObject!==n&&(this.hoverObject=n,this.hoverObject.dispatchEvent&&(this.hoverObject.dispatchEvent({type:"hoverenter",mouseEvent:t}),(this.options.autoReticleSelect&&this.options.enableReticle||this.tempEnableReticle)&&this.reticle.start(this.onTap.bind(this,t,"click")))),"mousedown"===this.userMouse.type&&this.pressEntityObject!=n&&(this.pressEntityObject=n,this.pressEntityObject.dispatchEvent&&this.pressEntityObject.dispatchEvent({type:"pressstart-entity",mouseEvent:t})),"mousedown"===this.userMouse.type&&this.pressObject!=o&&(this.pressObject=o,this.pressObject.dispatchEvent&&this.pressObject.dispatchEvent({type:"pressstart",mouseEvent:t})),"mousemove"===this.userMouse.type||this.options.enableReticle)&&(o&&o.dispatchEvent&&o.dispatchEvent({type:"hover",mouseEvent:t}),this.pressEntityObject&&this.pressEntityObject.dispatchEvent&&this.pressEntityObject.dispatchEvent({type:"pressmove-entity",mouseEvent:t}),this.pressObject&&this.pressObject.dispatchEvent&&this.pressObject.dispatchEvent({type:"pressmove",mouseEvent:t})),!n&&this.pressEntityObject&&this.pressEntityObject.dispatchEvent&&(this.pressEntityObject.dispatchEvent({type:"pressstop-entity",mouseEvent:t}),this.pressEntityObject=void 0),!o&&this.pressObject&&this.pressObject.dispatchEvent&&(this.pressObject.dispatchEvent({type:"pressstop",mouseEvent:t}),this.pressObject=void 0)),o&&o instanceof s){if(this.infospot=o,"click"===e)return!0}else this.infospot&&this.hideInfospot();this.options.autoRotate&&"mousemove"!==this.userMouse.type&&(clearTimeout(this.autoRotateRequestId),this.control===this.OrbitControls&&(this.OrbitControls.autoRotate=!1,this.autoRotateRequestId=window.setTimeout(this.enableAutoRate.bind(this),this.options.autoRotateActivationDuration)))}},getConvertedIntersect:function(t){for(var e,i=0;i<t.length;i++)if(0<=t[i].distance&&t[i].object&&!t[i].object.passThrough&&(!t[i].object.entity||!t[i].object.entity.passThrough)){e=t[i].object.entity&&!t[i].object.entity.passThrough?t[i].object.entity:t[i].object;break}return e},hideInfospot:function(){this.infospot&&(this.infospot.onHoverEnd(),this.infospot=void 0)},toggleControlBar:function(){var t=this.widget;t&&t.dispatchEvent({type:"control-bar-toggle"})},onKeyDown:function(t){this.options.output&&"none"!==this.options.output&&"Control"===t.key&&(this.OUTPUT_INFOSPOT=!0)},onKeyUp:function(){this.OUTPUT_INFOSPOT=!1},update:function(){S.update(),this.updateCallbacks.forEach((function(t){t()})),this.control.update(),this.scene.traverse(function(t){if(t instanceof s&&t.element&&(this.hoverObject===t||"none"!==t.element.style.display||t.element.left&&"none"!==t.element.left.style.display||t.element.right&&"none"!==t.element.right.style.display))if(this.checkSpriteInViewport(t)){var i=this.getScreenVector(t.getWorldPosition(new e.Vector3));t.translateElement(i.x,i.y)}else t.onDismiss()}.bind(this))},render:function(){this.mode===M.CARDBOARD||this.mode===M.STEREO?(this.renderer.clear(),this.effect.render(this.scene,this.camera),this.effect.render(this.sceneReticle,this.camera)):(this.renderer.clear(),this.renderer.render(this.scene,this.camera),this.renderer.clearDepth(),this.renderer.render(this.sceneReticle,this.camera))},animate:function(){this.requestAnimationId=window.requestAnimationFrame(this.animate.bind(this)),this.onChange()},onChange:function(){this.update(),this.render()},registerMouseAndTouchEvents:function(){var t={passive:!1};this.container.addEventListener("mousedown",this.HANDLER_MOUSE_DOWN,t),this.container.addEventListener("mousemove",this.HANDLER_MOUSE_MOVE,t),this.container.addEventListener("mouseup",this.HANDLER_MOUSE_UP,t),this.container.addEventListener("touchstart",this.HANDLER_MOUSE_DOWN,t),this.container.addEventListener("touchend",this.HANDLER_MOUSE_UP,t)},unregisterMouseAndTouchEvents:function(){this.container.removeEventListener("mousedown",this.HANDLER_MOUSE_DOWN,!1),this.container.removeEventListener("mousemove",this.HANDLER_MOUSE_MOVE,!1),this.container.removeEventListener("mouseup",this.HANDLER_MOUSE_UP,!1),this.container.removeEventListener("touchstart",this.HANDLER_MOUSE_DOWN,!1),this.container.removeEventListener("touchend",this.HANDLER_MOUSE_UP,!1)},registerReticleEvent:function(){this.addUpdateCallback(this.HANDLER_TAP)},unregisterReticleEvent:function(){this.removeUpdateCallback(this.HANDLER_TAP)},updateReticleEvent:function(){var t=this.container.clientWidth/2+this.container.offsetLeft,e=this.container.clientHeight/2;this.removeUpdateCallback(this.HANDLER_TAP),this.HANDLER_TAP=this.onTap.bind(this,{clientX:t,clientY:e}),this.addUpdateCallback(this.HANDLER_TAP)},registerEventListeners:function(){window.addEventListener("resize",this.HANDLER_WINDOW_RESIZE,!0),window.addEventListener("keydown",this.HANDLER_KEY_DOWN,!0),window.addEventListener("keyup",this.HANDLER_KEY_UP,!0)},unregisterEventListeners:function(){window.removeEventListener("resize",this.HANDLER_WINDOW_RESIZE,!0),window.removeEventListener("keydown",this.HANDLER_KEY_DOWN,!0),window.removeEventListener("keyup",this.HANDLER_KEY_UP,!0)},dispose:function(){this.tweenLeftAnimation.stop(),this.tweenUpAnimation.stop(),this.unregisterEventListeners(),function t(e){for(var i=e.children.length-1;0<=i;i--)t(e.children[i]),e.remove(e.children[i]);e instanceof a||e instanceof s?e.dispose():e.dispatchEvent&&e.dispatchEvent("dispose")}(this.scene),this.widget&&(this.widget.dispose(),this.widget=null),e.Cache&&e.Cache.enabled&&e.Cache.clear()},destroy:function(){this.dispose(),this.render(),window.cancelAnimationFrame(this.requestAnimationId)},onPanoramaDispose:function(t){t instanceof d&&this.hideVideoWidget(),t===this.panorama&&(this.panorama=null)},loadAsyncRequest:function(t,e){e=void 0===e?function(){}:e;var i=new window.XMLHttpRequest;i.onloadend=function(t){e(t)},i.open("GET",t,!0),i.send(null)},addViewIndicator:function(){var t=this;this.loadAsyncRequest(I.ViewIndicator,(function(i){if(0!==i.loaded){(i=i.target.responseXML.documentElement).style.width=t.viewIndicatorSize+"px",i.style.height=t.viewIndicatorSize+"px",i.style.position="absolute",i.style.top="10px",i.style.left="10px",i.style.opacity="0.5",i.style.cursor="pointer",i.id="panolens-view-indicator-container",t.container.appendChild(i);var n=i.querySelector("#indicator");t.addUpdateCallback((function(){t.radius=.225*t.viewIndicatorSize,t.currentPanoAngle=t.camera.rotation.y-e.Math.degToRad(90),t.fovAngle=e.Math.degToRad(t.camera.fov),t.leftAngle=-t.currentPanoAngle-t.fovAngle/2,t.rightAngle=-t.currentPanoAngle+t.fovAngle/2,t.leftX=t.radius*Math.cos(t.leftAngle),t.leftY=t.radius*Math.sin(t.leftAngle),t.rightX=t.radius*Math.cos(t.rightAngle),t.rightY=t.radius*Math.sin(t.rightAngle),t.indicatorD="M "+t.leftX+" "+t.leftY+" A "+t.radius+" "+t.radius+" 0 0 1 "+t.rightX+" "+t.rightY,t.leftX&&t.leftY&&t.rightX&&t.rightY&&t.radius&&n.setAttribute("d",t.indicatorD)})),i.addEventListener("mouseenter",(function(){this.style.opacity="1"})),i.addEventListener("mouseleave",(function(){this.style.opacity="0.5"}))}}))},appendControlItem:function(t){var e=this.widget.createCustomItem(t);return"video"===t.group?this.widget.videoElement.appendChild(e):this.widget.barElement.appendChild(e),e},clearAllCache:function(){e.Cache.clear()}}),"105"!=e.REVISION&&console.warn("three.js version is not matched. Please consider use the target revision 105"),window.TWEEN=S,t.BasicPanorama=l,t.CONTROLS=w,t.CameraPanorama=A,t.CubePanorama=c,t.CubeTextureLoader=R,t.DataImage=I,t.EmptyPanorama=h,t.GoogleStreetviewPanorama=p,t.ImageLittlePlanet=v,t.ImageLoader=C,t.ImagePanorama=r,t.Infospot=s,t.LittlePlanet=m,t.MODES=M,t.Media=i,t.Panorama=a,t.REVISION="11",t.Reticle=n,t.THREE_REVISION="105",t.THREE_VERSION=b,t.TextureLoader=L,t.VERSION="0.11.0",t.VideoPanorama=d,t.Viewer=y,t.Widget=o,Object.defineProperty(t,"__esModule",{value:!0})}));