/** * Minified by jsDelivr using Terser v5.15.1. * Original file: /npm/photo-sphere-viewer@4.8.1/dist/photo-sphere-viewer.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ /*! * Photo Sphere Viewer 4.8.1 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("three"),require("uevent")):"function"==typeof define&&define.amd?define(["exports","three","uevent"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).PhotoSphereViewer={},t.THREE,t.uEvent)}(this,(function(t,e,o){"use strict";function i(t,e){for(var o=0;o0;T in localStorage&&(t="true"===localStorage[T]);var e=new Promise((function(e){var o,i=function(){o(),localStorage[T]=!1,e(!1)},n=function(){o(),localStorage[T]=!0,e(!0)},r=function(){o(),localStorage[T]=t,e(t)};window.addEventListener("mousedown",i,!1),window.addEventListener("touchstart",n,!1);var s=setTimeout(r,1e4);o=function(){window.removeEventListener("mousedown",i),window.removeEventListener("touchstart",n),clearTimeout(s)}}));return{initial:t,promise:e}}(),b.maxTextureWidth=function(t){return null!==t?t.getParameter(t.MAX_TEXTURE_SIZE):0}(t),b.mouseWheelEvent="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",b.fullscreenEvent=(e=Object.keys(M).filter((function(t){return t in document}))).length?M[e[0]]:null}var e};var O=null;b.getMaxCanvasWidth=function(){return null===O&&(O=function(t){var e=document.createElement("canvas"),o=e.getContext("2d");e.width=t,e.height=t/2;for(;e.width>1024;){o.fillStyle="white",o.fillRect(0,0,1,1);try{if(o.getImageData(0,0,1,1).data[0]>0)return e.width}catch(t){}e.width/=2,e.height/=2}throw new l("Unable to detect system capabilities")}(b.maxTextureWidth)),O};var M={exitFullscreen:"fullscreenchange",webkitExitFullscreen:"webkitfullscreenchange",mozCancelFullScreen:"mozfullscreenchange",msExitFullscreen:"MSFullscreenChange"};function L(t,e,o){void 0===o?t.classList.toggle(e):o?t.classList.add(e):o||t.classList.remove(e)}function x(t,e){var o;(o=t.classList).add.apply(o,e.split(" "))}function P(t,e){var o=t;do{if(o===e)return!0;o=o.parentNode}while(o);return!1}function C(t,e){if(null==t||!t.matches)return null;var o=t;do{if(o.matches(e))return o;o=o instanceof SVGElement?o.parentNode:o.parentElement}while(o);return null}function A(t){for(var e=0,o=0,i=t;i;)e+=i.offsetLeft-i.scrollLeft+i.clientLeft,o+=i.offsetTop-i.scrollTop+i.clientTop,i=i.offsetParent;return{left:e,top:o}}function I(t){return(document.fullscreenElement||document.webkitFullscreenElement)===t}function S(t){(t.requestFullscreen||t.webkitRequestFullscreen).call(t)}function R(){(document.exitFullscreen||document.webkitExitFullscreen).call(document)}function k(t,e){return window.getComputedStyle(t,null)[e]} /** * @summary Normalize mousewheel values accross browsers * @memberOf PSV.utils * @description From Facebook's Fixed Data Table * {@link https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js} * @copyright Facebook * @param {WheelEvent} event * @returns {{spinX: number, spinY: number, pixelX: number, pixelY: number}} */function D(t){var e=0,o=0,i=0,n=0;return"detail"in t&&(o=t.detail),"wheelDelta"in t&&(o=-t.wheelDelta/120),"wheelDeltaY"in t&&(o=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=o,o=0),i=10*e,n=10*o,"deltaY"in t&&(n=t.deltaY),"deltaX"in t&&(i=t.deltaX),(i||n)&&t.deltaMode&&(1===t.deltaMode?(i*=40,n*=40):(i*=800,n*=800)),i&&!e&&(e=i<1?-1:1),n&&!o&&(o=n<1?-1:1),{spinX:e,spinY:o,pixelX:i,pixelY:n}}function N(t,e){var o=t%e;return o<0&&(o+=e),o}function U(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function H(t,e){return[0,2*Math.PI,2*-Math.PI].reduce((function(o,i){var n=e-t+i;return Math.abs(n)0?"-":"")+t.toLowerCase()}))} /** * @summary Returns a function, that, when invoked, will only be triggered at most once during a given window of time. * @memberOf PSV.utils * @copyright underscore.js - modified by Clément Prévost {@link http://stackoverflow.com/a/27078401} * @param {Function} func * @param {number} wait * @returns {Function} */function V(t,e){var o,i,n,r,s=0,a=function(){s=Date.now(),r=void 0,n=t.apply(o,i),r||(o=i=null)};return function(){var c=Date.now();s||(s=c);var l=e-(c-s);return o=this,i=arguments,l<=0||l>e?(r&&(clearTimeout(r),r=void 0),s=c,n=t.apply(o,i),r||(o=i=null)):r||(r=setTimeout(a,l)),n}}function W(t){if("object"==typeof t&&null!==t){if("function"==typeof Object.getPrototypeOf){var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}return"[object Object]"===Object.prototype.toString.call(t)}return!1} /** * @summary Merges the enumerable attributes of two objects * @memberOf PSV.utils * @description Replaces arrays and alters the target object. * @copyright Nicholas Fisher * @param {Object} target * @param {Object} src * @returns {Object} target */function Y(t,e){var o=e;return function t(e,i){return Array.isArray(i)?(e&&Array.isArray(e)?e.length=0:e=[],i.forEach((function(o,i){e[i]=t(null,o)}))):"object"==typeof i?(e&&!Array.isArray(e)||(e={}),Object.keys(i).forEach((function(n){"object"==typeof i[n]&&i[n]&&W(i[n])?i[n]!=o&&(e[n]?t(e[n],i[n]):e[n]=t(null,i[n])):e[n]=i[n]}))):e=i,e}(t,e)}function j(t){return Y(null,t)}function Z(t){return!t||0===Object.keys(t).length&&t.constructor===Object}function X(t,e){Object.keys(t).forEach((function(o){e(t[o],o)}))}function B(t){return null==t}function G(){for(var t=arguments.length,e=new Array(t),o=0;o(.*)");if(null!==o){var i=parseInt(o[1],10);return isNaN(i)?null:i}if(null!==(o=t.match("GPano:"+e+'="(.*?)"'))){var n=parseInt(o[1],10);return isNaN(n)?null:n}return null}var ot={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"};var it=["left","center","right"],nt=["top","center","bottom"],rt=[].concat(it,nt),st="center";function at(t,e){var o=void 0===e?{allowCenter:!0,cssOrder:!0}:e,i=o.allowCenter,n=o.cssOrder;return t?("string"==typeof t&&(t=t.split(" ")),1===t.length&&(t[0]===st?t=[st,st]:-1!==it.indexOf(t[0])?t=[st,t[0]]:-1!==nt.indexOf(t[0])&&(t=[t[0],st])),2!==t.length||-1===rt.indexOf(t[0])||-1===rt.indexOf(t[1])?(J("Unparsable position "+t),null):i||t[0]!==st||t[1]!==st?(n&&!ct(t)&&(t=[t[1],t[0]]),t[1]===st&&-1!==it.indexOf(t[0])&&(t=[st,t[0]]),t[0]===st&&-1!==nt.indexOf(t[1])&&(t=[t[1],st]),t):(J("Invalid position center center"),null)):null}function ct(t){return-1!==nt.indexOf(t[0])&&-1!==it.indexOf(t[1])}function lt(t){var o;if("string"==typeof t){var i=t.toString().trim(),n=parseFloat(i.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/,"$1")),r=i.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim();switch(r.match(/(pm|per minute)$/)&&(n/=60),r){case"dpm":case"degrees per minute":case"dps":case"degrees per second":o=e.MathUtils.degToRad(n);break;case"rdpm":case"radians per minute":case"rdps":case"radians per second":o=n;break;case"rpm":case"revolutions per minute":case"rps":case"revolutions per second":o=n*Math.PI*2;break;default:throw new l('Unknown speed unit "'+r+'"')}}else o=t;return o}function ht(t,o,i){var n;if(void 0===o&&(o=!1),void 0===i&&(i=o),"string"==typeof t){var r=t.toLowerCase().trim().match(/^(-?[0-9]+(?:\.[0-9]*)?)(.*)$/);if(!r)throw new l('Unknown angle "'+t+'"');var s=parseFloat(r[1]),a=r[2];if(a)switch(a){case"deg":case"degs":n=e.MathUtils.degToRad(s);break;case"rad":case"rads":n=s;break;default:throw new l('Unknown angle unit "'+a+'"')}else n=s}else{if("number"!=typeof t||isNaN(t))throw new l('Unknown angle "'+t+'"');n=t}return n=N(o?n+Math.PI:n,2*Math.PI),o?e.MathUtils.clamp(n-Math.PI,-Math.PI/(i?2:1),Math.PI/(i?2:1)):n}function pt(t){var o=new e.Texture(t);return o.needsUpdate=!0,o.minFilter=e.LinearFilter,o.generateMipmaps=!1,o}var ut=new e.Quaternion;function dt(t,e){ut.setFromEuler(e).invert(),t.applyQuaternion(ut)}var vt=function(){function t(t){var e=this;this.__callbacks=[],t?(t.easing&&"string"!=typeof t.easing||(t.easing=w[t.easing||"linear"]),this.__start=null,this.options=t,t.delay?this.__delayTimeout=setTimeout((function(){e.__delayTimeout=null,e.__animationFrame=window.requestAnimationFrame((function(t){return e.__run(t)}))}),t.delay):this.__animationFrame=window.requestAnimationFrame((function(t){return e.__run(t)}))):this.__resolved=!0}var e=t.prototype;return e.__run=function(t){var e=this;if(!this.__cancelled){null===this.__start&&(this.__start=t);var o=(t-this.__start)/this.options.duration,i={};o<1?(X(this.options.properties,(function(t,n){t&&(i[n]=t.start+(t.end-t.start)*e.options.easing(o))})),this.options.onTick(i,o),this.__animationFrame=window.requestAnimationFrame((function(t){return e.__run(t)}))):(X(this.options.properties,(function(t,e){t&&(i[e]=t.end)})),this.options.onTick(i,1),this.__animationFrame=window.requestAnimationFrame((function(){e.__resolved=!0,e.__resolve(!0)})))}},e.__resolve=function(t){this.__callbacks.forEach((function(e){return e(t)})),this.__callbacks.length=0},e.then=function(t){var e=this;return this.__resolved||this.__cancelled?Promise.resolve(this.__resolved).then(t):new Promise((function(t){e.__callbacks.push(t)})).then(t)},e.cancel=function(){this.__cancelled||this.__resolved||(this.__cancelled=!0,this.__resolve(!1),this.__delayTimeout&&(window.clearTimeout(this.__delayTimeout),this.__delayTimeout=null),this.__animationFrame&&(window.cancelAnimationFrame(this.__animationFrame),this.__animationFrame=null))},t}(),ft=function(){function t(e,o,i,n,r){if(void 0===o&&(o=0),void 0===i&&(i=-1/0),void 0===n&&(n=1/0),void 0===r&&(r=!1),this.fn=e,this.mode=t.STOP,this.speed=0,this.speedMult=1,this.currentSpeed=0,this.target=0,this.current=o,this.min=i,this.max=n,this.loopValue=r,r&&0!==i)throw new l("invalid config");this.fn&&this.fn(o)}var o=t.prototype;return o.setSpeed=function(t){this.speed=t},o.goto=function(o,i){void 0===i&&(i=1),this.mode=t.POSITION,this.target=this.loopValue?N(o,this.max):e.MathUtils.clamp(o,this.min,this.max),this.speedMult=i},o.step=function(e,o){void 0===o&&(o=1),this.mode!==t.POSITION&&(this.target=this.current),this.goto(this.target+e,o)},o.roll=function(e,o){void 0===e&&(e=!1),void 0===o&&(o=1),this.mode=t.INFINITE,this.target=e?-1/0:1/0,this.speedMult=o},o.stop=function(){this.mode=t.STOP},o.setValue=function(o){return this.target=this.loopValue?N(o,this.max):e.MathUtils.clamp(o,this.min,this.max),this.mode=t.STOP,this.target!==this.current&&(this.current=this.target,this.fn&&this.fn(this.current),!0)},o.update=function(o){if(this.mode===t.POSITION){this.loopValue&&Math.abs(this.target-this.current)>this.max/2&&(this.current=this.currentn&&(this.currentSpeed=Math.max(n,this.currentSpeed-o/1e3*this.speed*this.speedMult*2));var r=null;return this.current>this.target&&this.currentSpeed?r=Math.max(this.target,this.current+this.currentSpeed*o/1e3):this.current"),i=t.substring(e,o);return-1!==e&&-1!==o&&i.includes("GPano:")?{fullWidth:et(i,"FullPanoWidthPixels"),fullHeight:et(i,"FullPanoHeightPixels"),croppedWidth:et(i,"CroppedAreaImageWidthPixels"),croppedHeight:et(i,"CroppedAreaImageHeightPixels"),croppedX:et(i,"CroppedAreaLeftPixels"),croppedY:et(i,"CroppedAreaTopPixels"),poseHeading:et(i,"PoseHeadingDegrees"),posePitch:et(i,"PosePitchDegrees"),poseRoll:et(i,"PoseRollDegrees")}:null}))},i.__loadBlobAsString=function(t){return new Promise((function(e,o){var i=new FileReader;i.onload=function(){return e(i.result)},i.onerror=o,i.readAsText(t)}))},i.__createEquirectangularTexture=function(t,e){if(e.fullWidth>b.maxTextureWidth||e.croppedWidth!==e.fullWidth||e.croppedHeight!==e.fullHeight){var o=b.getMaxCanvasWidth()/e.fullWidth,i=r({},e);o<1&&(i.fullWidth*=o,i.fullHeight*=o,i.croppedWidth*=o,i.croppedHeight*=o,i.croppedX*=o,i.croppedY*=o);var n=document.createElement("canvas");return n.width=i.fullWidth,n.height=i.fullHeight,n.getContext("2d").drawImage(t,i.croppedX,i.croppedY,i.croppedWidth,i.croppedHeight),pt(n)}return pt(t)},i.createMesh=function(t){void 0===t&&(t=1);var o=new e.SphereGeometry(p*t,this.SPHERE_SEGMENTS,this.SPHERE_HORIZONTAL_SEGMENTS,-Math.PI/2).scale(-1,1,1),i=h.createOverlayMaterial();return new e.Mesh(o,i)},i.setTexture=function(t,e){this.__setUniform(t,h.OVERLAY_UNIFORMS.panorama,e.texture),this.setOverlay(t,null)},i.setOverlay=function(t,o,i){this.__setUniform(t,h.OVERLAY_UNIFORMS.overlayOpacity,i),o?this.__setUniform(t,h.OVERLAY_UNIFORMS.overlay,o.texture):this.__setUniform(t,h.OVERLAY_UNIFORMS.overlay,new e.Texture)},i.setTextureOpacity=function(t,e){this.__setUniform(t,h.OVERLAY_UNIFORMS.globalOpacity,e),t.material.transparent=e<1},i.disposeTexture=function(t){var e;null==(e=t.texture)||e.dispose()},i.__setUniform=function(t,o,i){t.material.uniforms[o].value instanceof e.Texture&&t.material.uniforms[o].value.dispose(),t.material.uniforms[o].value=i},o}(h);wt.id="equirectangular",wt.supportsDownload=!0,wt.supportsOverlay=!0;var yt=function(){function t(t,e){this.psv=t.psv||t,this.parent=t,this.parent.children.push(this),this.children=[],this.prop={visible:!0},this.container=document.createElement("div"),this.container.className=e,this.parent.container.appendChild(this.container)}var e=t.prototype;return e.destroy=function(){this.parent.container.removeChild(this.container);var t=this.parent.children.indexOf(this);-1!==t&&this.parent.children.splice(t,1),this.children.slice().forEach((function(t){return t.destroy()})),this.children.length=0,delete this.container,delete this.parent,delete this.psv,delete this.prop},e.refreshUi=function(){var t=this;this.children.every((function(e){return e.refreshUi(),!0===t.psv.prop.uiRefresh}))},e.toggle=function(t){!1===t||void 0===t&&this.isVisible()?this.hide():(!0===t||void 0===t&&!this.isVisible())&&this.show()},e.hide=function(){this.container.style.display="none",this.prop.visible=!1},e.show=function(){this.container.style.display="",this.prop.visible=!0},e.isVisible=function(){return this.prop.visible},t}(),Et=function(t){function e(e,o,i,n){var s;return void 0===o&&(o=""),void 0===i&&(i=!1),void 0===n&&(n=!0),(s=t.call(this,e,"psv-button "+o)||this).prop=r({},s.prop,{id:s.constructor.id,collapsable:i,enabled:!0,supported:!0,collapsed:!1,active:!1,width:s.container.offsetWidth}),s.constructor.icon&&s.__setIcon(s.constructor.icon),s.prop.id&&s.psv.config.lang[s.prop.id]&&(s.container.title=s.psv.config.lang[s.prop.id]),n&&(s.container.tabIndex=0),s.container.addEventListener("click",(function(t){s.prop.enabled&&s.onClick(),t.stopPropagation()})),s.container.addEventListener("keydown",(function(t){t.key===y.Enter&&s.prop.enabled&&(s.onClick(),t.stopPropagation())})),s}s(e,t);var o=e.prototype;return o.checkSupported=function(){var t=this,e=this.isSupported();W(e)?(!1===e.initial&&(this.hide(),this.prop.supported=!1),e.promise.then((function(e){t.prop&&(t.prop.supported=e,t.toggle(e))}))):(this.prop.supported=e,e||this.hide())},o.isSupported=function(){return!0},o.toggleActive=function(t){this.prop.active=void 0!==t?t:!this.prop.active,L(this.container,"psv-button--active",this.prop.active),this.constructor.iconActive&&this.__setIcon(this.prop.active?this.constructor.iconActive:this.constructor.icon)},o.show=function(t){void 0===t&&(t=!0),this.isVisible()||(this.prop.visible=!0,this.prop.collapsed||(this.container.style.display=""),t&&this.psv.refreshUi("show button "+this.prop.id))},o.hide=function(t){void 0===t&&(t=!0),this.isVisible()&&(this.prop.visible=!1,this.container.style.display="none",t&&this.psv.refreshUi("hide button "+this.prop.id))},o.disable=function(){this.container.classList.add("psv-button--disabled"),this.prop.enabled=!1},o.enable=function(){this.container.classList.remove("psv-button--disabled"),this.prop.enabled=!0},o.collapse=function(){this.prop.collapsed=!0,this.container.style.display="none"},o.uncollapse=function(){this.prop.collapsed=!1,this.prop.visible&&(this.container.style.display="")},o.__setIcon=function(t,e){void 0===e&&(e=this.container),t?(e.innerHTML=t,e.querySelector("svg").classList.add("psv-button-svg")):e.innerHTML=""},o.onClick=function(){throw new l('onClick not implemented for button "'+this.prop.id+'".')},e}(yt);Et.id=null,Et.groupId=null,Et.icon=null,Et.iconActive=null;var Tt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-autorotate-button",!0)||this).psv.on(f.AUTOROTATE,c(o)),o}s(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.AUTOROTATE,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){if(t.type===f.AUTOROTATE)this.toggleActive(t.args[0])},o.onClick=function(){this.psv.isAutorotateEnabled()&&(this.psv.config.autorotateIdle=!1,this.psv.resetIdleTimer()),this.psv.toggleAutorotate()},e}(Et);Tt.id="autorotate",Tt.icon='\x3c!--Created by Nick Bluth from the Noun Project--\x3e\n',Tt.iconActive='\x3c!--Created by Nick Bluth from the Noun Project--\x3e\n';var bt=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-custom-button",!1!==o.collapsable,!1!==o.tabbable)||this).config=o,i.config.id?i.prop.id=i.config.id:i.prop.id="psvButton-"+Math.random().toString(36).substr(2,9),i.config.className&&x(i.container,i.config.className),i.config.title&&(i.container.title=i.config.title),i.config.content&&(i.container.innerHTML=i.config.content),i.prop.width=i.container.offsetWidth,!1===i.config.enabled&&i.disable(),!1===i.config.visible&&i.hide(),i}s(e,t);var o=e.prototype;return o.destroy=function(){delete this.config,t.prototype.destroy.call(this)},o.onClick=function(){this.config.onClick&&this.config.onClick.call(this.psv,this.psv)},e}(Et),Ot=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-description-button")||this).prop=r({},o.prop,{mode:null}),o.psv.on(f.HIDE_NOTIFICATION,c(o)),o.psv.on(f.SHOW_NOTIFICATION,c(o)),o.psv.on(f.CLOSE_PANEL,c(o)),o.psv.on(f.OPEN_PANEL,c(o)),o}s(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.HIDE_NOTIFICATION,this),this.psv.off(f.SHOW_NOTIFICATION,this),this.psv.off(f.CLOSE_PANEL,this),this.psv.off(f.OPEN_PANEL,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){if(this.prop.mode){var e=!1;switch(t.type){case f.HIDE_NOTIFICATION:e=1===this.prop.mode;break;case f.SHOW_NOTIFICATION:e=1===this.prop.mode&&t.args[0]!==_.DESCRIPTION;break;case f.CLOSE_PANEL:e=2===this.prop.mode;break;case f.OPEN_PANEL:e=2===this.prop.mode&&t.args[0]!==_.DESCRIPTION}e&&(this.toggleActive(!1),this.prop.mode=null)}},o.hide=function(e){t.prototype.hide.call(this,e),this.prop.mode&&this.__close()},o.refreshUi=function(t){if(void 0===t&&(t=!1),t){var e=this.psv.navbar.getButton("caption",!1),o=e&&!e.isVisible(),i=!!this.psv.config.description;o||i?this.show(!1):this.hide(!1)}},o.onClick=function(){this.prop.mode?this.__close():this.__open()},o.__close=function(){switch(this.prop.mode){case 1:this.psv.notification.hide(_.DESCRIPTION);break;case 2:this.psv.panel.hide(_.DESCRIPTION)}},o.__open=function(){this.toggleActive(!0),this.psv.config.description?(this.prop.mode=2,this.psv.panel.show({id:_.DESCRIPTION,content:(this.psv.config.caption?"

"+this.psv.config.caption+"

":"")+this.psv.config.description})):(this.prop.mode=1,this.psv.notification.show({id:_.DESCRIPTION,content:this.psv.config.caption}))},e}(Et);Ot.id="description",Ot.icon='\x3c!--Created by Arafat Uddin from the Noun Project--\x3e\n';var Mt=function(t){function e(e){return t.call(this,e,"psv-button--hover-scale psv-download-button",!0)||this}s(e,t);var o=e.prototype;return o.onClick=function(){var t=this,e=document.createElement("a");e.href=this.psv.config.downloadUrl||this.psv.config.panorama,e.download=e.href.split("/").pop(),this.psv.container.appendChild(e),e.click(),setTimeout((function(){t.psv.container.removeChild(e)}),100)},o.refreshUi=function(){var t=this.psv.adapter.constructor.supportsDownload||this.psv.config.downloadUrl;t&&!this.prop.visible?this.show():!t&&this.prop.visible&&this.hide()},e}(Et);Mt.id="download",Mt.icon='\x3c!--Created by Michael Zenaty from the Noun Project--\x3e\n';var Lt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-fullscreen-button")||this).psv.on(f.FULLSCREEN_UPDATED,c(o)),o}s(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.FULLSCREEN_UPDATED,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){if(t.type===f.FULLSCREEN_UPDATED)this.toggleActive(t.args[0])},o.onClick=function(){this.psv.toggleFullscreen()},e}(Et);Lt.id="fullscreen",Lt.icon='\x3c!--Created by Garrett Knoll from the Noun Project--\x3e\n',Lt.iconActive='\x3c!--Created by Garrett Knoll from the Noun Project--\x3e\n';var xt='\x3c!-- Created by Richard Kunák from the Noun Project--\x3e\n',Pt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-menu-button")||this).psv.on(f.OPEN_PANEL,c(o)),o.psv.on(f.CLOSE_PANEL,c(o)),t.prototype.hide.call(c(o)),o}s(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.OPEN_PANEL,this),this.psv.off(f.CLOSE_PANEL,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case f.OPEN_PANEL:this.toggleActive(t.args[0]===_.MENU);break;case f.CLOSE_PANEL:this.toggleActive(!1)}},o.hide=function(e){t.prototype.hide.call(this,e),this.__hideMenu()},o.show=function(e){t.prototype.show.call(this,e),this.prop.active&&this.__showMenu()},o.onClick=function(){this.prop.active?this.__hideMenu():this.__showMenu()},o.__showMenu=function(){var t=this;this.psv.panel.show({id:_.MENU,content:e.MENU_TEMPLATE(this.parent.collapsed,this.psv,F(e.BUTTON_DATA)),noMargin:!0,clickHandler:function(o){var i=o.target?C(o.target,"li"):void 0,n=i?i.dataset[e.BUTTON_DATA]:void 0;n&&(t.parent.getButton(n).onClick(),t.__hideMenu())}})},o.__hideMenu=function(){this.psv.panel.hide(_.MENU)},e}(Et);Pt.id="menu",Pt.icon=xt,Pt.BUTTON_DATA="psvButton",Pt.MENU_TEMPLATE=function(t,e,o){return'\n
\n

'+xt+" "+e.config.lang.menu+'

\n
    \n '+t.map((function(t){return"\n
  • \n '+t.container.innerHTML+'\n '+t.container.title+"\n
  • \n "})).join("")+"\n
\n
\n"};var Ct=function(){function t(t){void 0===t&&(t=200),this.delay=t,this.time=0,this.timeout=null}var e=t.prototype;return e.down=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.time=(new Date).getTime()},e.up=function(t){var e=this;this.time&&((new Date).getTime()-this.time\x3c!-- Created by Flatart from the Noun Project --\x3e\n'.replace("rotate(0","rotate("+e)}var It=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-button--hover-scale psv-move-button")||this).container.title=i.psv.config.lang.move,i.prop=r({},i.prop,{value:o,handler:new Ct}),i.container.addEventListener("mousedown",c(i)),i.container.addEventListener("keydown",c(i)),i.container.addEventListener("keyup",c(i)),i.psv.container.addEventListener("mouseup",c(i)),i.psv.container.addEventListener("touchend",c(i)),i}s(e,t);var o=e.prototype;return o.destroy=function(){this.__onMouseUp(),this.psv.container.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchend",this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case"mousedown":this.__onMouseDown();break;case"mouseup":case"touchend":this.__onMouseUp();break;case"keydown":t.key===y.Enter&&this.__onMouseDown();break;case"keyup":t.key===y.Enter&&this.__onMouseUp()}},o.isSupported=function(){return{initial:!b.isTouchEnabled.initial,promise:b.isTouchEnabled.promise.then((function(t){return!t}))}},o.onClick=function(){},o.__onMouseDown=function(){this.prop.enabled&&(this.psv.__stopAll(),this.psv.dynamics.position.roll(this.prop.value),this.prop.handler.down())},o.__onMouseUp=function(){var t=this;this.prop.enabled&&this.prop.handler.up((function(){t.psv.dynamics.position.stop(),t.psv.resetIdleTimer()}))},e}(Et);It.groupId="move";var St=function(t){function e(e){return t.call(this,e,{latitude:!0})||this}return s(e,t),e}(It);St.id="moveDown",St.icon=At("down");var Rt=function(t){function e(e){return t.call(this,e,{longitude:!0})||this}return s(e,t),e}(It);Rt.id="moveLeft",Rt.icon=At("left");var kt=function(t){function e(e){return t.call(this,e,{longitude:!1})||this}return s(e,t),e}(It);kt.id="moveRight",kt.icon=At("right");var Dt=function(t){function e(e){return t.call(this,e,{latitude:!1})||this}return s(e,t),e}(It);Dt.id="moveUp",Dt.icon=At("up");var Nt=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-button--hover-scale psv-zoom-button")||this).prop=r({},i.prop,{value:o,handler:new Ct}),i.container.addEventListener("mousedown",c(i)),i.container.addEventListener("keydown",c(i)),i.container.addEventListener("keyup",c(i)),i.psv.container.addEventListener("mouseup",c(i)),i.psv.container.addEventListener("touchend",c(i)),i}s(e,t);var o=e.prototype;return o.destroy=function(){this.__onMouseUp(),this.psv.container.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchend",this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case"mousedown":this.__onMouseDown();break;case"mouseup":case"touchend":this.__onMouseUp();break;case"keydown":t.key===y.Enter&&this.__onMouseDown();break;case"keyup":t.key===y.Enter&&this.__onMouseUp()}},o.isSupported=function(){return{initial:!b.isTouchEnabled.initial,promise:b.isTouchEnabled.promise.then((function(t){return!t}))}},o.onClick=function(){},o.__onMouseDown=function(){this.prop.enabled&&(this.psv.dynamics.zoom.roll(this.prop.value),this.prop.handler.down())},o.__onMouseUp=function(){var t=this;this.prop.enabled&&this.prop.handler.up((function(){return t.psv.dynamics.zoom.stop()}))},e}(Et);Nt.groupId="zoom";var Ut=function(t){function e(e){return t.call(this,e,!1)||this}return s(e,t),e}(Nt);Ut.id="zoomIn",Ut.icon='\x3c!--Created by Ryan Canning from the Noun Project--\x3e\n';var Ht=function(t){function e(e){return t.call(this,e,!0)||this}return s(e,t),e}(Nt);Ht.id="zoomOut",Ht.icon='\x3c!--Created by Ryan Canning from the Noun Project--\x3e\n';var zt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-zoom-range",!1,!1)||this).prop=r({},o.prop,{mediaMinWidth:0}),o.zoomRange=document.createElement("div"),o.zoomRange.className="psv-zoom-range-line",o.container.appendChild(o.zoomRange),o.zoomValue=document.createElement("div"),o.zoomValue.className="psv-zoom-range-handle",o.zoomRange.appendChild(o.zoomValue),o.slider=new gt({container:o.container,direction:gt.HORIZONTAL,onUpdate:function(t){return o.__onSliderUpdate(t)}}),o.prop.mediaMinWidth=parseInt(k(o.container,"maxWidth"),10),o.psv.on(f.ZOOM_UPDATED,c(o)),o.psv.prop.ready?o.__moveZoomValue(o.psv.getZoomLevel()):o.psv.once(f.READY,c(o)),o.refreshUi(),o}s(e,t);var o=e.prototype;return o.destroy=function(){this.slider.destroy(),delete this.zoomRange,delete this.zoomValue,this.psv.off(f.ZOOM_UPDATED,this),this.psv.off(f.READY,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case f.ZOOM_UPDATED:this.__moveZoomValue(t.args[0]);break;case f.READY:this.__moveZoomValue(this.psv.getZoomLevel())}},o.isSupported=function(){return{initial:!b.isTouchEnabled.initial,promise:b.isTouchEnabled.promise.then((function(t){return!t}))}},o.refreshUi=function(){this.prop.supported&&(this.psv.prop.size.width<=this.prop.mediaMinWidth&&this.prop.visible?this.hide():this.psv.prop.size.width>this.prop.mediaMinWidth&&!this.prop.visible&&this.show())},o.onClick=function(){},o.__moveZoomValue=function(t){this.zoomValue.style.left=t/100*this.zoomRange.offsetWidth-this.zoomValue.offsetWidth/2+"px"},o.__onSliderUpdate=function(t){t.mousedown&&this.psv.zoom(100*t.value)},e}(Et);zt.id="zoomRange",zt.groupId="zoom";var Ft,Vt=function(t){function e(e){var o;return(o=t.call(this)||this).psv=e,o}s(e,t);var o=e.prototype;return o.init=function(){},o.destroy=function(){delete this.psv},e}(o.EventEmitter);Vt.id=null;var Wt={panorama:null,overlay:null,overlayOpacity:1,container:null,adapter:null,plugins:[],caption:null,description:null,downloadUrl:null,loadingImg:null,loadingTxt:"Loading...",size:null,fisheye:!1,minFov:30,maxFov:90,defaultZoomLvl:50,defaultLong:0,defaultLat:0,sphereCorrection:null,moveSpeed:1,zoomSpeed:1,autorotateDelay:null,autorotateIdle:!1,autorotateSpeed:"2rpm",autorotateLat:null,autorotateZoomLvl:null,moveInertia:!0,mousewheel:!0,mousemove:!0,mousewheelCtrlKey:!1,touchmoveTwoFingers:!1,useXmpData:!0,panoData:null,requestHeaders:null,canvasBackground:"#000",withCredentials:!1,navbar:["autorotate","zoom","move","download","description","caption","fullscreen"],lang:{autorotate:"Automatic rotation",zoom:"Zoom",zoomOut:"Zoom out",zoomIn:"Zoom in",move:"Move",download:"Download",fullscreen:"Fullscreen",menu:"Menu",twoFingers:"Use two fingers to navigate",ctrlZoom:"Use ctrl + scroll to zoom the image",loadError:"The panorama can't be loaded"},keyboard:(Ft={},Ft[y.ArrowUp]=v.ROTATE_LAT_UP,Ft[y.ArrowDown]=v.ROTATE_LAT_DOWN,Ft[y.ArrowRight]=v.ROTATE_LONG_RIGHT,Ft[y.ArrowLeft]=v.ROTATE_LONG_LEFT,Ft[y.PageUp]=v.ZOOM_IN,Ft[y.PageDown]=v.ZOOM_OUT,Ft[y.Plus]=v.ZOOM_IN,Ft[y.Minus]=v.ZOOM_OUT,Ft[y.Space]=v.TOGGLE_AUTOROTATE,Ft)},Yt={panorama:"Use setPanorama method to change the panorama",panoData:"Use setPanorama method to change the panorama",container:"Cannot change viewer container",adapter:"Cannot change adapter",plugins:"Cannot change plugins"},jt={captureCursor:"captureCursor is deprecated"},Zt={container:function(t){if(!t)throw new l("No value given for container.");return t},adapter:function(t){if(!(t=t?Array.isArray(t)?[K(t[0],h),t[1]]:[K(t,h)]:[wt])[0])throw new l("Un undefined value with given for adapter.");return t},overlayOpacity:function(t){return e.MathUtils.clamp(t,0,1)},defaultLong:function(t){return ht(t)},defaultLat:function(t){return ht(t,!0)},defaultZoomLvl:function(t){return e.MathUtils.clamp(t,0,100)},minFov:function(t,o){return o.maxFov=this.prop.contentWidth),this.__refreshButton()},o.hide=function(){this.content.style.display="none",this.prop.visible=!1},o.show=function(){this.content.style.display="",this.prop.visible=!0},o.__refreshButton=function(){var t;null==(t=this.psv.navbar.getButton(Ot.id,!1))||t.refreshUi(!0)},e}(yt);Xt.id="caption";var Bt={},Gt={};function qt(t,e){if(!t.id)throw new l("Button ID is required");if(Bt[t.id]=t,t.groupId&&(Gt[t.groupId]=Gt[t.groupId]||[],Gt[t.groupId].push(t)),"string"==typeof e)switch(e){case"start":Wt.navbar.unshift(t.id);break;case"end":Wt.navbar.push(t.id);break;default:var o=e.split(":"),i=o[0],n=o[1];Wt.navbar.splice(Wt.navbar.indexOf(i)+("right"===n?1:0),0,t.id)}}[Tt,Ht,zt,Ut,Ot,Mt,Lt,Rt,kt,Dt,St].forEach(qt);var Kt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-navbar psv--capture-event")||this).children=[],o.collapsed=[],o}s(e,t);var o=e.prototype;return o.setButtons=function(t){var e=this;this.children.slice().forEach((function(t){return t.destroy()})),this.children.length=0;var o=this.__cleanButtons(t);-1!==o.indexOf(Xt.id)&&-1===o.indexOf(Ot.id)&&o.splice(o.indexOf(Xt.id),0,Ot.id),o.forEach((function(t){if("object"==typeof t)new bt(e,t);else if(Bt[t])new Bt[t](e);else if(Gt[t])Gt[t].forEach((function(t){return new t(e)}));else{if(t!==Xt.id)throw new l("Unknown button "+t);new Xt(e,e.psv.config.caption)}})),new Pt(this),this.children.forEach((function(t){"function"==typeof t.checkSupported&&t.checkSupported()}))},o.setCaption=function(t){var e=this.getButton(Xt.id,!1);null==e||e.setCaption(t)},o.getButton=function(t,e){void 0===e&&(e=!0);var o=null;return this.children.some((function(e){return e.prop.id===t&&(o=e,!0)})),!o&&e&&J('button "'+t+'" not found in the navbar'),o},o.show=function(){this.container.classList.add("psv-navbar--open"),this.prop.visible=!0},o.hide=function(){this.container.classList.remove("psv-navbar--open"),this.prop.visible=!1},o.refreshUi=function(){if(t.prototype.refreshUi.call(this),!0===this.psv.prop.uiRefresh){var e=this.container.offsetWidth,o=0,i=[],n=[];if(this.children.forEach((function(t){t.prop.visible&&(o+=t.prop.width,i.push(t),t.prop.collapsable&&n.push(t))})),!i.length)return;e0?(n.forEach((function(t){return t.collapse()})),this.collapsed=n,this.getButton(Pt.id).show(!1)):e>=o&&this.collapsed.length>0&&(this.collapsed.forEach((function(t){return t.uncollapse()})),this.collapsed=[],this.getButton(Pt.id).hide(!1));var r=this.getButton(Xt.id,!1);r&&r.refreshUi()}},o.__cleanButtons=function(t){return!0===t?j(Wt.navbar):"string"==typeof t?t.split(/[ ,]/):t||[]},e}(yt),Qt=function(t){function o(e){var o;return(o=t.call(this,e,"psv-loader-container")||this).loader=document.createElement("div"),o.loader.className="psv-loader",o.container.appendChild(o.loader),o.canvas=document.createElement("canvas"),o.canvas.className="psv-loader-canvas",o.canvas.width=o.loader.clientWidth*b.pixelRatio,o.canvas.height=o.loader.clientWidth*b.pixelRatio,o.loader.appendChild(o.canvas),o.prop=r({},o.prop,{tickness:(o.loader.offsetWidth-o.loader.clientWidth)/2*b.pixelRatio,current:null}),o.refreshUi(),o.hide(),o}s(o,t);var i=o.prototype;return i.destroy=function(){delete this.loader,delete this.canvas,t.prototype.destroy.call(this)},i.refreshUi=function(){if(this.prop.current!==(this.psv.config.loadingImg||this.psv.config.loadingTxt)){var t;if(this.prop.current&&this.loader.removeChild(this.loader.lastChild),this.psv.config.loadingImg?((t=document.createElement("img")).className="psv-loader-image",t.src=this.psv.config.loadingImg):this.psv.config.loadingTxt&&((t=document.createElement("div")).className="psv-loader-text",t.innerHTML=this.psv.config.loadingTxt),t){var e=Math.round(Math.sqrt(2*Math.pow((this.canvas.width/2-this.prop.tickness/2)/b.pixelRatio,2)));t.style.maxWidth=e+"px",t.style.maxHeight=e+"px",this.loader.appendChild(t)}this.prop.current=this.psv.config.loadingImg||this.psv.config.loadingTxt}},i.setProgress=function(t){var o=this.canvas.getContext("2d");o.clearRect(0,0,this.canvas.width,this.canvas.height),o.lineWidth=this.prop.tickness,o.strokeStyle=k(this.loader,"color"),o.beginPath(),o.arc(this.canvas.width/2,this.canvas.height/2,this.canvas.width/2-this.prop.tickness/2,-Math.PI/2,e.MathUtils.clamp(t,0,100)/100*2*Math.PI-Math.PI/2),o.stroke(),this.psv.trigger(f.LOAD_PROGRESS,Math.round(t))},o}(yt),$t=function(t){function e(e){var o;return(o=t.call(this,e,"psv-notification")||this).prop=r({},o.prop,{visible:!1,contentId:void 0,timeout:null}),o.content=document.createElement("div"),o.content.className="psv-notification-content",o.container.appendChild(o.content),o.content.addEventListener("click",(function(){return o.hide()})),o}s(e,t);var o=e.prototype;return o.destroy=function(){delete this.content,t.prototype.destroy.call(this)},o.isVisible=function(t){return this.prop.visible&&(!t||!this.prop.contentId||this.prop.contentId===t)},o.toggle=function(){throw new l("Notification cannot be toggled")},o.show=function(t){var e=this;this.prop.timeout&&(clearTimeout(this.prop.timeout),this.prop.timeout=null),"string"==typeof t&&(t={content:t}),this.prop.contentId=t.id,this.content.innerHTML=t.content,this.container.classList.add("psv-notification--visible"),this.prop.visible=!0,this.psv.trigger(f.SHOW_NOTIFICATION,t.id),t.timeout&&(this.prop.timeout=setTimeout((function(){return e.hide(t.id)}),t.timeout))},o.hide=function(t){if(this.isVisible(t)){var e=this.prop.contentId;this.container.classList.remove("psv-notification--visible"),this.prop.visible=!1,this.prop.contentId=void 0,this.psv.trigger(f.HIDE_NOTIFICATION,e)}},e}(yt),Jt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-overlay")||this).prop=r({},o.prop,{contentId:void 0,dissmisable:!0}),o.image=document.createElement("div"),o.image.className="psv-overlay-image",o.container.appendChild(o.image),o.text=document.createElement("div"),o.text.className="psv-overlay-text",o.container.appendChild(o.text),o.subtext=document.createElement("div"),o.subtext.className="psv-overlay-subtext",o.container.appendChild(o.subtext),o.psv.on(f.CLICK,c(o)),o.psv.on(f.KEY_PRESS,c(o)),t.prototype.hide.call(c(o)),o}s(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.CLICK,this),this.psv.off(f.KEY_PRESS,this),delete this.image,delete this.text,delete this.subtext,t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case f.CLICK:this.isVisible()&&this.prop.dissmisable&&(this.hide(),t.stopPropagation());break;case f.KEY_PRESS:this.isVisible()&&this.prop.dissmisable&&t.args[0]===y.Escape&&(this.hide(),t.preventDefault())}},o.isVisible=function(t){return this.prop.visible&&(!t||!this.prop.contentId||this.prop.contentId===t)},o.toggle=function(){throw new l("Overlay cannot be toggled")},o.show=function(e){"string"==typeof e&&(e={text:e}),this.prop.contentId=e.id,this.prop.dissmisable=!1!==e.dissmisable,this.image.innerHTML=e.image||"",this.text.innerHTML=e.text||"",this.subtext.innerHTML=e.subtext||"",t.prototype.show.call(this),this.psv.trigger(f.SHOW_OVERLAY,e.id)},o.hide=function(e){if(this.isVisible(e)){var o=this.prop.contentId;t.prototype.hide.call(this),this.prop.contentId=void 0,this.psv.trigger(f.HIDE_OVERLAY,o)}},e}(yt),te=function(t){function e(e){var o;(o=t.call(this,e,"psv-panel psv--capture-event")||this).prop=r({},o.prop,{visible:!1,contentId:void 0,mouseX:0,mouseY:0,mousedown:!1,clickHandler:null,keyHandler:null,width:{}});var i=document.createElement("div");i.className="psv-panel-resizer",o.container.appendChild(i);var n=document.createElement("div");return n.className="psv-panel-close-button",o.container.appendChild(n),o.content=document.createElement("div"),o.content.className="psv-panel-content",o.container.appendChild(o.content),o.container.addEventListener(b.mouseWheelEvent,(function(t){return t.stopPropagation()})),n.addEventListener("click",(function(){return o.hide()})),i.addEventListener("mousedown",c(o)),i.addEventListener("touchstart",c(o)),o.psv.container.addEventListener("mouseup",c(o)),o.psv.container.addEventListener("touchend",c(o)),o.psv.container.addEventListener("mousemove",c(o)),o.psv.container.addEventListener("touchmove",c(o)),o.psv.on(f.KEY_PRESS,c(o)),o}s(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.KEY_PRESS,this),this.psv.container.removeEventListener("mousemove",this),this.psv.container.removeEventListener("touchmove",this),this.psv.container.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchend",this),delete this.prop,delete this.content,t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case"mousedown":this.__onMouseDown(t);break;case"touchstart":this.__onTouchStart(t);break;case"mousemove":this.__onMouseMove(t);break;case"touchmove":this.__onTouchMove(t);break;case"mouseup":case"touchend":this.__onMouseUp(t);break;case f.KEY_PRESS:this.isVisible()&&t.args[0]===y.Escape&&(this.hide(),t.preventDefault())}},o.isVisible=function(t){return this.prop.visible&&(!t||!this.prop.contentId||this.prop.contentId===t)},o.toggle=function(){throw new l("Panel cannot be toggled")},o.show=function(t){var e=this,o=this.isVisible(t.id);"string"==typeof t&&(t={content:t}),this.prop.contentId=t.id,this.prop.visible=!0,this.prop.clickHandler&&(this.content.removeEventListener("click",this.prop.clickHandler),this.content.removeEventListener("keydown",this.prop.keyHandler),this.prop.clickHandler=null,this.prop.keyHandler=null),t.id&&this.prop.width[t.id]?this.container.style.width=this.prop.width[t.id]:t.width?this.container.style.width=t.width:this.container.style.width=null,this.content.innerHTML=t.content,this.content.scrollTop=0,this.container.classList.add("psv-panel--open"),L(this.content,"psv-panel-content--no-margin",!0===t.noMargin),t.clickHandler&&(this.prop.clickHandler=t.clickHandler,this.prop.keyHandler=function(e){e.key===y.Enter&&t.clickHandler(e)},this.content.addEventListener("click",this.prop.clickHandler),this.content.addEventListener("keydown",this.prop.keyHandler),o||setTimeout((function(){var t;null==(t=e.content.querySelector("a,button,[tabindex]"))||t.focus()}),300)),this.psv.trigger(f.OPEN_PANEL,t.id)},o.hide=function(t){if(this.isVisible(t)){var e=this.prop.contentId;this.prop.visible=!1,this.prop.contentId=void 0,this.content.innerHTML=null,this.container.classList.remove("psv-panel--open"),this.prop.clickHandler&&(this.content.removeEventListener("click",this.prop.clickHandler),this.prop.clickHandler=null),this.psv.trigger(f.CLOSE_PANEL,e)}},o.__onMouseDown=function(t){t.stopPropagation(),this.__startResize(t)},o.__onTouchStart=function(t){t.stopPropagation(),this.__startResize(t.changedTouches[0])},o.__onMouseUp=function(t){this.prop.mousedown&&(t.stopPropagation(),this.prop.mousedown=!1,this.content.classList.remove("psv-panel-content--no-interaction"))},o.__onMouseMove=function(t){this.prop.mousedown&&(t.stopPropagation(),this.__resize(t))},o.__onTouchMove=function(t){this.prop.mousedown&&this.__resize(t.touches[0])},o.__startResize=function(t){this.prop.mouseX=t.clientX,this.prop.mouseY=t.clientY,this.prop.mousedown=!0,this.content.classList.add("psv-panel-content--no-interaction")},o.__resize=function(t){var e=t.clientX,o=t.clientY,i=Math.max(200,this.container.offsetWidth-(e-this.prop.mouseX))+"px";this.prop.contentId&&(this.prop.width[this.prop.contentId]=i),this.container.style.width=i,this.prop.mouseX=e,this.prop.mouseY=o},e}(yt),ee=function(){function t(t){this.psv=t,this.config=t.config,this.prop=t.prop}return t.prototype.destroy=function(){delete this.psv,delete this.config,delete this.prop},t}(),oe=new e.Vector2,ie=new e.Vector3,ne=new e.Euler(0,0,0,"ZXY"),re=function(t){function o(e){return t.call(this,e)||this}s(o,t);var i=o.prototype;return i.fovToZoomLevel=function(t){var e=Math.round((t-this.config.minFov)/(this.config.maxFov-this.config.minFov)*100);return e-2*(e-50)},i.zoomLevelToFov=function(t){return this.config.maxFov+t/100*(this.config.minFov-this.config.maxFov)},i.vFovToHFov=function(t){return e.MathUtils.radToDeg(2*Math.atan(Math.tan(e.MathUtils.degToRad(t)/2)*this.prop.aspect))},i.speedToDuration=function(t,e){if(t&&"number"==typeof t)return Math.abs(t);var o=t?lt(t):this.config.autorotateSpeed;return e/Math.abs(o)*1e3},i.textureCoordsToSphericalCoords=function(t){var e=this.prop.panoData;if(!e)throw new l("Current adapter does not support texture coordinates.");var o=(t.x+e.croppedX)/e.fullWidth*Math.PI*2,i=(t.y+e.croppedY)/e.fullHeight*Math.PI,n={longitude:o>=Math.PI?o-Math.PI:o+Math.PI,latitude:Math.PI/2-i};return ne.equals(this.psv.renderer.mesh.rotation)&&ne.equals(this.psv.renderer.meshContainer.rotation)?n:(this.sphericalCoordsToVector3(n,ie),ie.applyEuler(this.psv.renderer.mesh.rotation),ie.applyEuler(this.psv.renderer.meshContainer.rotation),this.vector3ToSphericalCoords(ie))},i.sphericalCoordsToTextureCoords=function(t){var e=this.prop.panoData;if(!e)throw new l("Current adapter does not support texture coordinates.");ne.equals(this.psv.renderer.mesh.rotation)&&ne.equals(this.psv.renderer.meshContainer.rotation)||(this.sphericalCoordsToVector3(t,ie),dt(ie,this.psv.renderer.meshContainer.rotation),dt(ie,this.psv.renderer.mesh.rotation),t=this.vector3ToSphericalCoords(ie));var o=t.longitude/Math.PI/2*e.fullWidth,i=t.latitude/Math.PI*e.fullHeight;return{x:Math.round(t.longitude\x3c!--Created by AomAm from the Noun Project--\x3e\n',text:e.config.lang.twoFingers})}),100));else if(this.state.mousedown||1===this.state.step){t.preventDefault();var o=t.touches[0];this.__move(o.clientX,o.clientY)}}else this.__moveZoom(t),this.__cancelTwoFingersOverlay()},i.__cancelLongTouch=function(){this.prop.longtouchTimeout&&(clearTimeout(this.prop.longtouchTimeout),this.prop.longtouchTimeout=null)},i.__cancelTwoFingersOverlay=function(){this.config.touchmoveTwoFingers&&(this.prop.twofingersTimeout&&(clearTimeout(this.prop.twofingersTimeout),this.prop.twofingersTimeout=null),this.psv.overlay.hide(_.TWO_FINGERS))},i.__onMouseWheel=function(t){var e=this;if(this.config.mousewheel){if(this.config.mousewheelCtrlKey&&!this.state.ctrlKeyDown)return this.psv.overlay.show({id:_.CTRL_ZOOM,image:'\x3c!-- Created by Icon Island from the Noun Project --\x3e\n',text:this.config.lang.ctrlZoom}),clearTimeout(this.state.ctrlZoomTimeout),void(this.state.ctrlZoomTimeout=setTimeout((function(){return e.psv.overlay.hide(_.CTRL_ZOOM)}),2e3));t.preventDefault(),t.stopPropagation();var o=5*D(t).spinY*this.config.zoomSpeed;0!==o&&this.psv.dynamics.zoom.step(-o,5)}},i.__fullscreenToggled=function(t){this.prop.fullscreen=void 0!==t?t:I(this.psv.container),this.config.keyboard&&(this.prop.fullscreen?this.psv.startKeyboardControl():this.psv.stopKeyboardControl()),this.psv.trigger(f.FULLSCREEN_UPDATED,this.prop.fullscreen)},i.__resetMove=function(){this.state.step=0,this.state.mousedown=!1,this.state.mouseX=0,this.state.mouseY=0,this.state.startMouseX=0,this.state.startMouseY=0,this.state.mouseHistory.length=0},i.__startMoveZoom=function(t){this.psv.__stopAll(),this.__resetMove();var e={x:t.touches[0].clientX,y:t.touches[0].clientY},o={x:t.touches[1].clientX,y:t.touches[1].clientY};this.state.step=1,this.state.pinchDist=U(e,o),this.state.mouseX=(e.x+o.x)/2,this.state.mouseY=(e.y+o.y)/2,this.__logMouseMove(this.state.mouseX,this.state.mouseY)},i.__stopMove=function(t,e,o,i){void 0===o&&(o=null),void 0===i&&(i=!1),1===this.state.step?this.config.moveInertia?(this.__logMouseMove(t,e),this.__stopMoveInertia(t,e)):(this.__resetMove(),this.psv.resetIdleTimer()):this.state.mousedown&&(this.psv.stopAnimation(),this.__click(t,e,o,i),this.__resetMove(),this.psv.resetIdleTimer())},i.__stopMoveInertia=function(t,o){var i=this,n=new e.SplineCurve(this.state.mouseHistory.map((function(t){var o=t[1],i=t[2];return new e.Vector2(o,i)}))).getTangent(1),r=this.state.mouseHistory.slice(1).reduce((function(t,e){var o=t.total,i=t.prev;return{total:o+U({x:i[1],y:i[2]},{x:e[1],y:e[2]})/(e[0]-i[0]),prev:e}}),{total:0,prev:this.state.mouseHistory[0]}).total/this.state.mouseHistory.length;if(!r)return this.__resetMove(),void this.psv.resetIdleTimer();this.state.step=2;var s=t,a=o;this.prop.animationPromise=new vt({properties:{speed:{start:r,end:0}},duration:1e3,easing:"outQuad",onTick:function(t){s+=t.speed*n.x*3*b.pixelRatio,a+=t.speed*n.y*3*b.pixelRatio,i.__applyMove(s,a)}}),this.prop.animationPromise.then((function(t){i.prop.animationPromise=null,t&&(i.__resetMove(),i.psv.resetIdleTimer())}))},i.__click=function(t,e,o,i){var n=this;void 0===i&&(i=!1);var r=this.psv.container.getBoundingClientRect(),s={rightclick:i,target:o,clientX:t,clientY:e,viewerX:t-r.left,viewerY:e-r.top},a=this.psv.dataHelper.getIntersections({x:s.viewerX,y:s.viewerY}),c=a.find((function(t){return t.object.userData.psvSphere}));if(c){var l=this.psv.dataHelper.vector3ToSphericalCoords(c.point);s.longitude=l.longitude,s.latitude=l.latitude,s.objects=a.map((function(t){return t.object})).filter((function(t){return!t.userData.psvSphere}));try{var h=this.psv.dataHelper.sphericalCoordsToTextureCoords(s);s.textureX=h.x,s.textureY=h.y}catch(t){s.textureX=NaN,s.textureY=NaN}this.state.dblclickTimeout?(Math.abs(this.state.dblclickData.clientX-s.clientX)=this.state.moveThreshold||Math.abs(e-this.state.startMouseY)>=this.state.moveThreshold)?(this.psv.__stopAll(),this.__resetMove(),this.state.step=1,this.state.mouseX=t,this.state.mouseY=e,this.__logMouseMove(t,e)):1===this.state.step&&(this.__applyMove(t,e),this.__logMouseMove(t,e))},i.__applyMove=function(t,o){var i=(t-this.state.mouseX)/this.prop.size.width*this.config.moveSpeed*e.MathUtils.degToRad(this.prop.littlePlanet?90:this.prop.hFov),n=(o-this.state.mouseY)/this.prop.size.height*this.config.moveSpeed*e.MathUtils.degToRad(this.prop.littlePlanet?90:this.prop.vFov),r=this.psv.getPosition();this.psv.rotate({longitude:r.longitude-i,latitude:r.latitude+n}),this.state.mouseX=t,this.state.mouseY=o},i.__moveZoom=function(t){if(1===this.state.step){t.preventDefault();var e={x:t.touches[0].clientX,y:t.touches[0].clientY},o={x:t.touches[1].clientX,y:t.touches[1].clientY},i=U(e,o),n=(i-this.state.pinchDist)/b.pixelRatio*this.config.zoomSpeed;this.psv.zoom(this.psv.getZoomLevel()+n),this.__move((e.x+o.x)/2,(e.y+o.y)/2),this.state.pinchDist=i}},i.__logMouseMove=function(t,e){var o=Date.now(),i=this.state.mouseHistory.length?this.state.mouseHistory[this.state.mouseHistory.length-1]:[0,-1,-1];i[1]===t&&i[2]===e?i[0]=o:o===i[0]?(i[1]=t,i[2]=e):this.state.mouseHistory.push([o,t,e]);for(var n=null,r=0;r30?(this.state.mouseHistory.splice(0,r),r=0,n=this.state.mouseHistory[r][0]):(n=this.state.mouseHistory[r][0],r++)},o}(ee),ae=function(t){function o(o){var i,n;return(n=t.call(this,o)||this).renderer=new e.WebGLRenderer({alpha:!0,antialias:!0}),n.renderer.setPixelRatio(b.pixelRatio),n.renderer.domElement.className="psv-canvas",n.scene=new e.Scene,n.camera=new e.PerspectiveCamera(50,16/9,.1,20),n.mesh=n.psv.adapter.createMesh(),n.mesh.userData=((i={}).psvSphere=!0,i),n.meshContainer=new e.Group,n.meshContainer.add(n.mesh),n.scene.add(n.meshContainer),n.raycaster=new e.Raycaster,n.timestamp=null,n.ready=!1,n.canvasContainer=document.createElement("div"),n.canvasContainer.className="psv-canvas-container",n.canvasContainer.style.background=n.psv.config.canvasBackground,n.canvasContainer.style.cursor=n.psv.config.mousemove?"move":"default",n.canvasContainer.appendChild(n.renderer.domElement),n.psv.container.appendChild(n.canvasContainer),o.on(f.SIZE_UPDATED,c(n)),o.on(f.ZOOM_UPDATED,c(n)),o.on(f.POSITION_UPDATED,c(n)),o.on(f.CONFIG_CHANGED,c(n)),n.hide(),n}s(o,t);var i=o.prototype;return i.destroy=function(){this.renderer.setAnimationLoop(null),this.__cleanTHREEScene(this.scene),this.psv.container.removeChild(this.canvasContainer),delete this.canvasContainer,delete this.renderer,delete this.scene,delete this.camera,delete this.mesh,delete this.meshContainer,delete this.raycaster,t.prototype.destroy.call(this)},i.handleEvent=function(t){switch(t.type){case f.SIZE_UPDATED:this.__onSizeUpdated();break;case f.ZOOM_UPDATED:this.__onZoomUpdated();break;case f.POSITION_UPDATED:this.__onPositionUpdated();break;case f.CONFIG_CHANGED:t.args[0].includes("fisheye")&&this.__onPositionUpdated(),t.args[0].includes("mousemove")&&(this.canvasContainer.style.cursor=this.psv.config.mousemove?"move":"default")}},i.hide=function(){this.canvasContainer.style.opacity=0},i.show=function(){this.canvasContainer.style.opacity=1},i.__onSizeUpdated=function(){this.renderer.setSize(this.prop.size.width,this.prop.size.height),this.camera.aspect=this.prop.aspect,this.camera.updateProjectionMatrix(),this.prop.needsUpdate=!0},i.__onZoomUpdated=function(){this.camera.fov=this.prop.vFov,this.camera.updateProjectionMatrix(),this.prop.needsUpdate=!0},i.__onPositionUpdated=function(){this.camera.position.set(0,0,0),this.camera.lookAt(this.prop.direction),this.config.fisheye&&this.camera.position.copy(this.prop.direction).multiplyScalar(this.config.fisheye/2).negate(),this.prop.needsUpdate=!0},i.__renderLoop=function(t){var e=null!==this.timestamp?t-this.timestamp:0;this.timestamp=t,this.psv.trigger(f.BEFORE_RENDER,t,e),X(this.psv.dynamics,(function(t){return t.update(e)})),this.prop.idleTime>0&&t-this.prop.idleTime>this.config.autorotateDelay&&this.psv.startAutorotate(),this.prop.needsUpdate&&(this.render(),this.prop.needsUpdate=!1)},i.render=function(){this.renderer.render(this.scene,this.camera),this.psv.trigger(f.RENDER)},i.setTexture=function(t){var e=this;this.prop.panoData=t.panoData,this.psv.adapter.setTexture(this.mesh,t),this.ready||(this.renderer.setAnimationLoop((function(t){return e.__renderLoop(t)})),this.ready=!0),this.psv.needsUpdate(),this.psv.trigger(f.PANORAMA_LOADED,t)},i.setOverlay=function(t,e){this.psv.adapter.setOverlay(this.mesh,t,e),this.psv.needsUpdate()},i.setPanoramaPose=function(t,e){void 0===e&&(e=this.mesh);var o=this.psv.dataHelper.cleanPanoramaPose(t);e.rotation.set(-o.tilt,-o.pan,-o.roll,"ZXY")},i.setSphereCorrection=function(t,e){void 0===e&&(e=this.meshContainer);var o=this.psv.dataHelper.cleanSphereCorrection(t);e.rotation.set(o.tilt,o.pan,o.roll,"ZXY")},i.transition=function(t,o){var i=this,n=tt(o),r="zoom"in o,s=new e.Group,a=this.psv.adapter.createMesh(.5);if(this.psv.adapter.setTexture(a,t,!0),this.psv.adapter.setTextureOpacity(a,0),this.setPanoramaPose(t.panoData,a),this.setSphereCorrection(o.sphereCorrection,s),n){var c=this.psv.dataHelper.cleanPosition(o),l=this.psv.getPosition(),h=new e.Vector3(0,1,0);s.rotateOnWorldAxis(h,c.longitude-l.longitude);var p=new e.Vector3(0,1,0).cross(this.camera.getWorldDirection(new e.Vector3)).normalize();s.rotateOnWorldAxis(p,c.latitude-l.latitude)}s.add(a),this.scene.add(s);var u=new vt({properties:{opacity:{start:0,end:1},zoom:r?{start:this.psv.getZoomLevel(),end:o.zoom}:void 0},duration:o.transition,easing:"outCubic",onTick:function(t){i.psv.adapter.setTextureOpacity(a,t.opacity),i.psv.adapter.setTextureOpacity(i.mesh,1-t.opacity),r&&i.psv.zoom(t.zoom),i.psv.needsUpdate()}});return u.then((function(e){e?(i.setTexture(t),i.psv.adapter.setTextureOpacity(i.mesh,1),i.setPanoramaPose(t.panoData),i.setSphereCorrection(o.sphereCorrection),n&&i.psv.rotate(o)):i.psv.adapter.disposeTexture(t),i.scene.remove(s),a.geometry.dispose(),a.geometry=null})),u},i.__cleanTHREEScene=function(t){var o=this;t.traverse((function(i){i.geometry&&i.geometry.dispose(),i.material&&(Array.isArray(i.material)?i.material.forEach((function(t){t.map&&t.map.dispose(),t.dispose()})):(i.material.map&&i.material.map.dispose(),i.material.dispose())),!i.dispose||i instanceof e.Scene||i.dispose(),i!==t&&o.__cleanTHREEScene(i)}))},o}(ee),ce=function(t){function o(o){var i;return(i=t.call(this,o)||this).loader=new e.FileLoader,i.loader.setResponseType("blob"),i.config.withCredentials&&i.loader.setWithCredentials(!0),i.config.requestHeaders&&"object"==typeof i.config.requestHeaders&&i.loader.setRequestHeader(i.config.requestHeaders),i}s(o,t);var i=o.prototype;return i.destroy=function(){this.abortLoading(),t.prototype.destroy.call(this)},i.abortLoading=function(){},i.loadFile=function(t,e){var o=this;return this.config.requestHeaders&&"function"==typeof this.config.requestHeaders&&this.loader.setRequestHeader(this.config.requestHeaders(t)),new Promise((function(i,n){var r=0;null==e||e(r),o.loader.load(t,(function(t){r=100,null==e||e(r),i(t)}),(function(t){if(t.lengthComputable){var o=t.loaded/t.total*100;o>r&&(r=o,null==e||e(r))}}),(function(t){n(t)}))}))},i.loadImage=function(t,e){return this.loadFile(t,e).then((function(t){return new Promise((function(e,o){var i=document.createElementNS("http://www.w3.org/1999/xhtml","img");i.onload=function(){URL.revokeObjectURL(i.src),e(i)},i.onerror=o,i.src=URL.createObjectURL(t)}))}))},i.preloadPanorama=function(t){return this.psv.adapter.supportsPreload(t)?this.psv.adapter.loadTexture(t):Promise.resolve()},o}(ee),le=0,he=1,pe=2,ue=3,de=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-tooltip")||this).prop=r({},i.prop,o,{state:le,width:0,height:0,pos:"",config:null,data:null}),i.content=document.createElement("div"),i.content.className="psv-tooltip-content",i.container.appendChild(i.content),i.arrow=document.createElement("div"),i.arrow.className="psv-tooltip-arrow",i.container.appendChild(i.arrow),i.container.addEventListener("transitionend",c(i)),i.container.style.top="-1000px",i.container.style.left="-1000px",i}s(e,t);var o=e.prototype;return o.destroy=function(){delete this.arrow,delete this.content,t.prototype.destroy.call(this)},o.handleEvent=function(t){if("transitionend"===t.type)this.__onTransitionEnd(t)},o.toggle=function(){throw new l("Tooltip cannot be toggled")},o.show=function(t){if(this.prop.state!==le)throw new l("Initialized tooltip cannot be re-initialized");t.className&&x(this.container,t.className),this.content.innerHTML=t.content;var e=this.container.getBoundingClientRect();this.prop.width=e.right-e.left,this.prop.height=e.bottom-e.top,this.prop.state=ue,this.move(t),this.prop.data=t.data,this.prop.state=he,this.psv.trigger(f.SHOW_TOOLTIP,this.prop.data,this),this.__waitImages()},o.move=function(t){if(this.prop.state!==he&&this.prop.state!==ue)throw new l("Uninitialized tooltip cannot be moved");t.box||(t.box={width:0,height:0}),this.config=t;var e=this.container,o=this.arrow,i={posClass:at(t.position,{allowCenter:!1,cssOrder:!1})||["top","center"],width:this.prop.width,height:this.prop.height,top:0,left:0,arrowTop:0,arrowLeft:0};this.__computeTooltipPosition(i,t);var n=null,r=null;if(i.top<0?n="bottom":i.top+i.height>this.psv.prop.size.height&&(n="top"),i.left<0?r="right":i.left+i.width>this.psv.prop.size.width&&(r="left"),r||n){var s=ct(i.posClass);n&&(i.posClass[s?0:1]=n),r&&(i.posClass[s?1:0]=r),this.__computeTooltipPosition(i,t)}e.style.top=i.top+"px",e.style.left=i.left+"px",o.style.top=i.arrowTop+"px",o.style.left=i.arrowLeft+"px";var a=i.posClass.join("-");a!==this.prop.pos&&(e.classList.remove("psv-tooltip--"+this.prop.pos),this.prop.pos=a,e.classList.add("psv-tooltip--"+this.prop.pos))},o.hide=function(){this.container.classList.remove("psv-tooltip--visible"),this.prop.state=pe,this.psv.trigger(f.HIDE_TOOLTIP,this.prop.data)},o.__onTransitionEnd=function(t){if("transform"===t.propertyName)switch(this.prop.state){case he:this.container.classList.add("psv-tooltip--visible"),this.prop.state=ue;break;case pe:this.prop.state=le,this.destroy()}},o.__computeTooltipPosition=function(t,e){var o=this.prop.arrow,i=e.top,n=t.height,r=e.left,s=t.width,a=o+this.prop.border,c=e.box.width/2+2*o,l=e.box.height/2+2*o;switch(t.posClass.join("-")){case"top-left":t.top=i-l-n,t.left=r+a-s,t.arrowTop=n,t.arrowLeft=s-a-o;break;case"top-center":t.top=i-l-n,t.left=r-s/2,t.arrowTop=n,t.arrowLeft=s/2-o;break;case"top-right":t.top=i-l-n,t.left=r-a,t.arrowTop=n,t.arrowLeft=o;break;case"bottom-left":t.top=i+l,t.left=r+a-s,t.arrowTop=2*-o,t.arrowLeft=s-a-o;break;case"bottom-center":t.top=i+l,t.left=r-s/2,t.arrowTop=2*-o,t.arrowLeft=s/2-o;break;case"bottom-right":t.top=i+l,t.left=r-a,t.arrowTop=2*-o,t.arrowLeft=o;break;case"left-top":t.top=i+a-n,t.left=r-c-s,t.arrowTop=n-a-o,t.arrowLeft=s;break;case"center-left":t.top=i-n/2,t.left=r-c-s,t.arrowTop=n/2-o,t.arrowLeft=s;break;case"left-bottom":t.top=i-a,t.left=r-c-s,t.arrowTop=o,t.arrowLeft=s;break;case"right-top":t.top=i+a-n,t.left=r+c,t.arrowTop=n-a-o,t.arrowLeft=2*-o;break;case"center-right":t.top=i-n/2,t.left=r+c,t.arrowTop=n/2-o,t.arrowLeft=2*-o;break;case"right-bottom":t.top=i-a,t.left=r+c,t.arrowTop=o,t.arrowLeft=2*-o}},o.__waitImages=function(){var t=this,e=this.content.querySelectorAll("img");if(e.length>0){var o=[];e.forEach((function(t){o.push(new Promise((function(e){t.onload=e,t.onerror=e})))})),Promise.all(o).then((function(){if(t.prop.state===he||t.prop.state===ue){var e=t.container.getBoundingClientRect();t.prop.width=e.right-e.left,t.prop.height=e.bottom-e.top,t.move(t.config)}}))}},e}(yt),ve=function(t){function e(e){var o;o=t.call(this,e)||this;var i=new de(o.psv,{arrow:0,border:0});return o.size={arrow:parseInt(k(i.arrow,"borderTopWidth"),10),border:parseInt(k(i.container,"borderTopLeftRadius"),10)},i.destroy(),o}s(e,t);var o=e.prototype;return o.destroy=function(){delete this.size,t.prototype.destroy.call(this)},o.create=function(t){var e=new de(this.psv,this.size);return e.show(t),e},e}(ee);e.Cache.enabled=!0;var fe=function(t){function o(o){var i;if(i=t.call(this)||this,b.load(),!b.isWebGLSupported)throw new l("WebGL is not supported.");if(0===b.maxTextureWidth)throw new l("Unable to detect system capabilities");return i.prop={ready:!1,uiRefresh:!1,needsUpdate:!1,fullscreen:!1,direction:new e.Vector3(0,0,p),vFov:null,hFov:null,aspect:null,autorotateEnabled:!1,animationPromise:null,loadingPromise:null,littlePlanet:!1,idleTime:-1,objectsObservers:{},size:{width:0,height:0},panoData:{fullWidth:0,fullHeight:0,croppedWidth:0,croppedHeight:0,croppedX:0,croppedY:0,poseHeading:0,posePitch:0,poseRoll:0}},i.config=function(t){var e=j(Wt);Y(e,t);var o={};return X(e,(function(t,i){if(jt[i])J(jt[i]);else{if(!Object.prototype.hasOwnProperty.call(Wt,i))throw new l("Unknown option "+i);Zt[i]?o[i]=Zt[i](t,e):o[i]=t}})),o}(o),i.parent="string"==typeof o.container?document.getElementById(o.container):o.container,i.parent[u]=c(i),i.container=document.createElement("div"),i.container.classList.add("psv-container"),i.parent.appendChild(i.container),i.adapter=new i.config.adapter[0](c(i),i.config.adapter[1]),i.children=[],i.plugins={},i.renderer=new ae(c(i)),i.textureLoader=new ce(c(i)),i.eventsHandler=new se(c(i)),i.dataHelper=new re(c(i)),i.loader=new Qt(c(i)),i.navbar=new Kt(c(i)),i.panel=new te(c(i)),i.tooltip=new ve(c(i)),i.notification=new $t(c(i)),i.overlay=new Jt(c(i)),i.dynamics={zoom:new ft((function(t){i.prop.vFov=i.dataHelper.zoomLevelToFov(t),i.prop.hFov=i.dataHelper.vFovToHFov(i.prop.vFov),i.trigger(f.ZOOM_UPDATED,t)}),i.config.defaultZoomLvl,0,100),position:new mt({longitude:new ft(null,i.config.defaultLong,0,2*Math.PI,!0),latitude:i.prop.littlePlanet?new ft(null,i.config.defaultLat,0,2*Math.PI,!0):new ft(null,i.config.defaultLat,-Math.PI/2,Math.PI/2)},(function(t){i.dataHelper.sphericalCoordsToVector3(t,i.prop.direction),i.trigger(f.POSITION_UPDATED,t)}))},i.__updateSpeeds(),i.eventsHandler.init(),i.__resizeRefresh=V((function(){return i.refreshUi("resize")}),500),i.resize(i.config.size),i.config.plugins.forEach((function(t){var e=t[0],o=t[1];i.plugins[e.id]=new e(c(i),o)})),X(i.plugins,(function(t){return null==t.init?void 0:t.init()})),i.navbar.setButtons(i.config.navbar),i.config.panorama&&i.setPanorama(i.config.panorama),L(i.container,"psv--is-touch",b.isTouchEnabled.initial),b.isTouchEnabled.promise.then((function(t){return L(i.container,"psv--is-touch",t)})),i.once(f.RENDER,(function(){i.config.navbar&&(i.container.classList.add("psv--has-navbar"),i.navbar.show()),B(i.config.autorotateDelay)||(i.prop.idleTime=performance.now()),i.prop.ready=!0,setTimeout((function(){i.refreshUi("init"),i.trigger(f.READY)}),0)})),i}s(o,t);var i=o.prototype;return i.destroy=function(){this.__stopAll(),this.stopKeyboardControl(),this.exitFullscreen(),X(this.plugins,(function(t){return t.destroy()})),delete this.plugins,this.children.slice().forEach((function(t){return t.destroy()})),this.children.length=0,this.eventsHandler.destroy(),this.renderer.destroy(),this.textureLoader.destroy(),this.dataHelper.destroy(),this.adapter.destroy(),this.parent.removeChild(this.container),delete this.parent[u],delete this.parent,delete this.container,delete this.loader,delete this.navbar,delete this.panel,delete this.tooltip,delete this.notification,delete this.overlay,delete this.dynamics,delete this.config},i.refreshUi=function(t){var e=this;this.prop.ready&&(this.prop.uiRefresh?"new"!==this.prop.uiRefresh&&(this.prop.uiRefresh="new",setTimeout((function(){e.prop.uiRefresh=!1,e.refreshUi(t)}))):(this.prop.uiRefresh=!0,this.children.every((function(t){return t.refreshUi(),!0===e.prop.uiRefresh})),this.prop.uiRefresh=!1))},i.getPlugin=function(t){if("string"==typeof t)return this.plugins[t];var e=K(t,Vt);return e?this.plugins[e.id]:void 0},i.getPosition=function(){return this.dataHelper.cleanPosition(this.dynamics.position.current)},i.getZoomLevel=function(){return this.dynamics.zoom.current},i.getSize=function(){return r({},this.prop.size)},i.isAutorotateEnabled=function(){return this.prop.autorotateEnabled},i.isFullscreenEnabled=function(){return b.fullscreenEvent?I(this.container):this.prop.fullscreen},i.needsUpdate=function(){this.prop.needsUpdate=!0},i.autoSize=function(){this.container.clientWidth===this.prop.size.width&&this.container.clientHeight===this.prop.size.height||(this.prop.size.width=Math.round(this.container.clientWidth),this.prop.size.height=Math.round(this.container.clientHeight),this.prop.aspect=this.prop.size.width/this.prop.size.height,this.prop.hFov=this.dataHelper.vFovToHFov(this.prop.vFov),this.trigger(f.SIZE_UPDATED,this.getSize()),this.__resizeRefresh())},i.setPanorama=function(t,e){var o,i=this;void 0===e&&(e={}),this.textureLoader.abortLoading(),null==(o=this.prop.transitionAnimation)||o.cancel(),this.prop.ready||["sphereCorrection","panoData","overlay","overlayOpacity"].forEach((function(t){t in e||(e[t]=i.config[t])})),void 0!==e.transition&&!0!==e.transition||(e.transition=1500),void 0===e.showLoader&&(e.showLoader=!0),void 0===e.caption&&(e.caption=this.config.caption),void 0===e.description&&(e.description=this.config.description),e.panoData||"function"!=typeof this.config.panoData||(e.panoData=this.config.panoData);var n=tt(e),r="zoom"in e;(n||r)&&this.__stopAll(),this.hideError(),this.config.panorama=t,this.config.caption=e.caption,this.config.description=e.description;var s=function(t){if(i.loader.hide(),i.prop.loadingPromise=null,$(t))return!1;if(t)throw i.navbar.setCaption(""),i.showError(i.config.lang.loadError),console.error(t),t;return i.resetIdleTimer(),i.setOverlay(e.overlay,e.overlayOpacity),i.navbar.setCaption(i.config.caption),!0};this.navbar.setCaption(""+(this.config.loadingTxt||"")+""),!e.showLoader&&this.prop.ready||this.loader.show();var a=this.adapter.loadTexture(this.config.panorama,e.panoData).then((function(t){if(t.panorama!==i.config.panorama)throw i.adapter.disposeTexture(t),Q();return t}));return e.transition&&this.prop.ready&&this.adapter.supportsTransition(this.config.panorama)?this.prop.loadingPromise=a.then((function(t){return i.loader.hide(),i.prop.transitionAnimation=i.renderer.transition(t,e),i.prop.transitionAnimation})).then((function(t){if(i.prop.transitionAnimation=null,!t)throw Q()})).then(s,s):this.prop.loadingPromise=a.then((function(t){i.renderer.show(),i.renderer.setTexture(t),i.renderer.setPanoramaPose(t.panoData),i.renderer.setSphereCorrection(e.sphereCorrection),r&&i.zoom(e.zoom),n&&i.rotate(e)})).then(s,s),this.prop.loadingPromise},i.setOverlay=function(t,e){var o=this;return void 0===e&&(e=1),t?this.adapter.constructor.supportsOverlay?this.adapter.loadTexture(t,(function(t){var e=o.prop.panoData,i=t.width/e.croppedWidth;return{fullWidth:i*e.fullWidth,fullHeight:i*e.fullHeight,croppedWidth:i*e.croppedWidth,croppedHeight:i*e.croppedHeight,croppedX:i*e.croppedX,croppedY:i*e.croppedY}}),!1).then((function(t){o.renderer.setOverlay(t,e)})):Promise.reject(new l(this.adapter.constructor.id+" adapter does not supports overlay")):(this.adapter.constructor.supportsOverlay&&this.renderer.setOverlay(null,0),Promise.resolve())},i.setOptions=function(t){var e=this,o=r({},this.config,t);X(t,(function(t,i){if(jt[i])J(jt[i]);else{if(!Object.prototype.hasOwnProperty.call(Wt,i))throw new l("Unknown option "+i);if(Yt[i])throw new l(Yt[i]);switch(Zt[i]?e.config[i]=Zt[i](t,o):e.config[i]=t,i){case"overlay":case"overlayOpacity":e.setOverlay(e.config.overlay,e.config.overlayOpacity);break;case"caption":case"description":e.navbar.setCaption(e.config.caption);break;case"size":e.resize(t);break;case"sphereCorrection":e.renderer.setSphereCorrection(t);break;case"navbar":case"lang":e.navbar.setButtons(e.config.navbar);break;case"moveSpeed":case"zoomSpeed":e.__updateSpeeds();break;case"minFov":case"maxFov":e.dynamics.zoom.setValue(e.dataHelper.fovToZoomLevel(e.prop.vFov)),e.trigger(f.ZOOM_UPDATED,e.getZoomLevel());break;case"canvasBackground":e.renderer.canvasContainer.style.background=e.config.canvasBackground;break;case"autorotateIdle":e.resetIdleTimer()}}})),this.needsUpdate(),this.refreshUi("set options"),this.trigger(f.CONFIG_CHANGED,Object.keys(t))},i.setOption=function(t,e){var o;this.setOptions(((o={})[t]=e,o))},i.resetIdleTimer=function(){this.prop.idleTime=this.config.autorotateIdle?performance.now():-1},i.disableIdleTimer=function(){this.prop.idleTime=-1},i.startAutorotate=function(t){void 0===t&&(t=!1),t&&!this.isAutorotateEnabled()||!t&&this.isAutorotateEnabled()||(t||this.__stopAll(),this.dynamics.position.roll({longitude:this.config.autorotateSpeed<0},Math.abs(this.config.autorotateSpeed/this.config.moveSpeed)),this.dynamics.position.goto({latitude:this.config.autorotateLat},Math.abs(this.config.autorotateSpeed/this.config.moveSpeed)),null!==this.config.autorotateZoomLvl&&this.dynamics.zoom.goto(this.config.autorotateZoomLvl),this.prop.autorotateEnabled=!0,t||this.trigger(f.AUTOROTATE,!0))},i.stopAutorotate=function(){this.isAutorotateEnabled()&&(this.dynamics.position.stop(),this.dynamics.zoom.stop(),this.prop.autorotateEnabled=!1,this.trigger(f.AUTOROTATE,!1))},i.toggleAutorotate=function(){this.isAutorotateEnabled()?this.stopAutorotate():this.startAutorotate()},i.showError=function(t){this.overlay.show({id:_.ERROR,image:'\x3c!--Created by Shastry from the Noun Project--\x3e\n',text:t,dissmisable:!1})},i.hideError=function(){this.overlay.hide(_.ERROR)},i.rotate=function(t){if(!this.trigger(f.BEFORE_ROTATE,t).isDefaultPrevented()){var e=this.change(m.GET_ROTATE_POSITION,this.dataHelper.cleanPosition(t));this.dynamics.position.setValue(e)}},i.animate=function(t){var e=this;this.__stopAll();var o,i=tt(t),n=void 0!==t.zoom,r={};if(i){var s=this.change(m.GET_ANIMATE_POSITION,this.dataHelper.cleanPosition(t)),a=this.getPosition(),c=H(a.longitude,s.longitude);r.longitude={start:a.longitude,end:a.longitude+c},r.latitude={start:a.latitude,end:s.latitude},o=this.dataHelper.speedToDuration(t.speed,z(a,s))}if(n){var l=Math.abs(t.zoom-this.getZoomLevel());r.zoom={start:this.getZoomLevel(),end:t.zoom},o||(o=this.dataHelper.speedToDuration(t.speed,Math.PI/4*l/100))}return o?(this.prop.animationPromise=new vt({properties:r,duration:Math.max(500,o),easing:"inOutSine",onTick:function(t){i&&e.rotate(t),n&&e.zoom(t.zoom)}}),this.prop.animationPromise.then((function(){e.prop.animationPromise=null,e.resetIdleTimer()})),this.prop.animationPromise):(i&&this.rotate(t),n&&this.zoom(t.zoom),new vt)},i.stopAnimation=function(){return this.prop.animationPromise?(this.prop.animationPromise.cancel(),this.prop.animationPromise):Promise.resolve()},i.zoom=function(t){this.dynamics.zoom.setValue(t)},i.zoomIn=function(t){void 0===t&&(t=1),this.dynamics.zoom.step(t)},i.zoomOut=function(t){void 0===t&&(t=1),this.dynamics.zoom.step(-t)},i.resize=function(t){var e=this;["width","height"].forEach((function(o){t&&t[o]&&(/^[0-9.]+$/.test(t[o])&&(t[o]+="px"),e.parent.style[o]=t[o])})),this.autoSize()},i.enterFullscreen=function(){b.fullscreenEvent?S(this.container):(this.container.classList.add("psv-container--fullscreen"),this.autoSize(),this.eventsHandler.__fullscreenToggled(!0))},i.exitFullscreen=function(){this.isFullscreenEnabled()&&(b.fullscreenEvent?R():(this.container.classList.remove("psv-container--fullscreen"),this.autoSize(),this.eventsHandler.__fullscreenToggled(!1)))},i.toggleFullscreen=function(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()},i.startKeyboardControl=function(){this.eventsHandler.enableKeyboard()},i.stopKeyboardControl=function(){this.eventsHandler.disableKeyboard()},i.observeObjects=function(t,e){var o=this;return this.prop.objectsObservers[t]={listener:e},function(){delete o.prop.objectsObservers[t]}},i.__stopAll=function(){return this.trigger(f.STOP_ALL),this.disableIdleTimer(),this.stopAutorotate(),this.stopAnimation()},i.__updateSpeeds=function(){this.dynamics.zoom.setSpeed(50*this.config.zoomSpeed),this.dynamics.position.setSpeed(e.MathUtils.degToRad(50*this.config.moveSpeed))},o}(o.EventEmitter);t.AbstractAdapter=h,t.AbstractButton=Et,t.AbstractComponent=yt,t.AbstractPlugin=Vt,t.CONSTANTS=E,t.DEFAULTS=Wt,t.EquirectangularAdapter=wt,t.PSVError=l,t.SYSTEM=b,t.Viewer=fe,t.registerButton=qt,t.utils=_t,Object.defineProperty(t,"__esModule",{value:!0})})); //# sourceMappingURL=/sm/5417b0b9edb4299d3b03655f52629fb2155e2b4a09bb7e30479484269b91fe82.map