!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),0T.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),0e&&(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.fovg.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-7o&&(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=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(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):1n?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]):1a?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=window.innerWidth?this.ImageQualityFair:800=window.innerWidth?this.ImageQualityMedium:1280=window.innerWidth?this.ImageQualityHigh:1920=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)=t.length?0:e},setCameraFov:function(t){this.camera.fov=t,this.camera.updateProjectionMatrix()},enableControl:function(t){switch(t=0<=t&&tMath.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=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