{"size": 109501, "ext": "js", "max_stars_repo_path": "dist/skylark-sphere.js", "max_stars_repo_name": "skylark-integration/skylark-sphere", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "dist/skylark-sphere.js", "max_issues_repo_name": "skylark-integration/skylark-sphere", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "dist/skylark-sphere.js", "max_forks_repo_name": "skylark-integration/skylark-sphere", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 10950.1, "max_line_length": 109236, "alphanum_fraction": 0.7534543064}
/**
 * skylark-sphere - A version of sphere that ported to running on skylarkjs
 * @author Hudaokeji, Inc.
 * @version v0.9.0
 * @link https://github.com/skylark-integration/skylark-sphere/
 * @license MIT
 */
!function(t,e){var o=e.define,require=e.require,i="function"==typeof o&&o.amd,n=!i&&"undefined"!=typeof exports;if(!i&&!o){var s={};o=e.define=function(t,e,o){"function"==typeof o?(s[t]={factory:o,deps:e.map(function(e){return function(t,e){if("."!==t[0])return t;var o=e.split("/"),i=t.split("/");o.pop();for(var n=0;n<i.length;n++)"."!=i[n]&&(".."==i[n]?o.pop():o.push(i[n]));return o.join("/")}(e,t)}),resolved:!1,exports:null},require(t)):s[t]={factory:null,resolved:!0,exports:o}},require=e.require=function(t){if(!s.hasOwnProperty(t))throw new Error("Module "+t+" has not been defined");var module=s[t];if(!module.resolved){var o=[];module.deps.forEach(function(t){o.push(require(t))}),module.exports=module.factory.apply(e,o)||null,module.resolved=!0}return module.exports}}if(!o)throw new Error("The module utility (ex: requirejs or skylark-utils) is not loaded!");if(function(t,require){t("skylark-sphere/_psv/ctoc",["skylark-langx/Emitter"],function(t){"use strict";var e=t.inherit({});return e.prototype.off=function(e,o){return t.prototype.off.call(this,e,o["$$"+e]||o)},e.prototype.on=function(e,o){return"object"==typeof o?t.prototype.on.call(this,e,o["$$"+e]=function(t){return t.args=Array.prototype.slice.call(arguments,1),o.handleEvent(t)}):t.prototype.on.call(this,e,o["$$"+e]=function(t,e,i,n){return o.call(this,e,i,n)},this)},e.prototype.one=function(e,o){return"object"==typeof o?t.prototype.on.call(this,e,"",null,o["$$"+e]=function(t){return t.args=Array.prototype.slice.call(arguments,1),o.handleEvent(t)},this,!0):t.prototype.on.call(this,e,"",null,o,this,!0)},e}),t("skylark-sphere/PSVError",[],function(){"use strict";function t(e){this.message=e,"captureStackTrace"in Error?Error.captureStackTrace(this,t):this.stack=(new Error).stack}return t.prototype=Object.create(Error.prototype),t.prototype.name="PSVError",t.prototype.constructor=t,t}),t("skylark-threejs-ex/controls/DeviceOrientationControls",["skylark-threejs"],function(t){"use strict";return function(e){var o=this;this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var i=function(t){o.deviceOrientation=t},n=function(){o.screenOrientation=window.orientation||0},s=(r=new t.Vector3(0,0,1),a=new t.Euler,h=new t.Quaternion,p=new t.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),function(t,e,o,i,n){a.set(o,e,-i,"YXZ"),t.setFromEuler(a),t.multiply(p),t.multiply(h.setFromAxisAngle(r,-n))});var r,a,h,p;this.connect=function(){n(),void 0!==window.DeviceOrientationEvent&&"function"==typeof window.DeviceOrientationEvent.requestPermission?window.DeviceOrientationEvent.requestPermission().then(function(t){"granted"==t&&(window.addEventListener("orientationchange",n,!1),window.addEventListener("deviceorientation",i,!1))}).catch(function(t){console.error("THREE.DeviceOrientationControls: Unable to use DeviceOrientation API:",t)}):(window.addEventListener("orientationchange",n,!1),window.addEventListener("deviceorientation",i,!1)),o.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",n,!1),window.removeEventListener("deviceorientation",i,!1),o.enabled=!1},this.update=function(){if(!1!==o.enabled){var e=o.deviceOrientation;if(e){var i=e.alpha?t.MathUtils.degToRad(e.alpha)+o.alphaOffset:0,n=e.beta?t.MathUtils.degToRad(e.beta):0,r=e.gamma?t.MathUtils.degToRad(e.gamma):0,a=o.screenOrientation?t.MathUtils.degToRad(o.screenOrientation):0;s(o.object.quaternion,i,n,r,a)}}},this.dispose=function(){o.disconnect()},this.connect()}}),t("skylark-threejs-ex/effects/StereoEffect",["skylark-threejs"],function(t){"use strict";return function(e){var o=new t.StereoCamera;o.aspect=.5;var i=new t.Vector2;this.setEyeSeparation=function(t){o.eyeSep=t},this.setSize=function(t,o){e.setSize(t,o)},this.render=function(t,n){t.updateMatrixWorld(),null===n.parent&&n.updateMatrixWorld(),o.update(n),e.getSize(i),e.autoClear&&e.clear(),e.setScissorTest(!0),e.setScissor(0,0,i.width/2,i.height),e.setViewport(0,0,i.width/2,i.height),e.render(t,o.cameraL),e.setScissor(i.width/2,0,i.width/2,i.height),e.setViewport(i.width/2,0,i.width/2,i.height),e.render(t,o.cameraR),e.setScissorTest(!1)}}}),t("skylark-sphere/PSVUtils",["skylark-langx-types","skylark-langx-objects","skylark-langx-strings","skylark-langx-funcs","skylark-domx-noder","skylark-domx-styler","skylark-domx-finder","skylark-devices-points/mouse","skylark-devices-points/touch","skylark-devices-orientation","skylark-devices-webgl","skylark-threejs","skylark-threejs-ex/controls/DeviceOrientationControls","skylark-threejs-ex/effects/StereoEffect","./_psv/ctoc"],function(t,e,o,i,n,s,r,a,h,p,c,l,u,d,f){"use strict";l.DeviceOrientationControls=u,l.StereoEffect=d;var g={};return f.Utils=g,g.TwoPI=2*Math.PI,g.HalfPI=Math.PI/2,g.svgNS="http://www.w3.org/2000/svg",g.checkTHREE=function(t){for(var e=0,o=arguments.length;e<o;e++)if(!(arguments[e]in l))return!1;return!0},g.isCanvasSupported=function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},g.getWebGLCtx=c.getWebGLCtx,g.isWebGLSupported=c.isWebGLSupported,g.isDeviceOrientationSupported=p.isDeviceOrientationSupported,g.isTouchEnabled=h.isTouchEnabled,g.getMaxTextureWidth=c.getMaxTextureWidth,g.toggleClass=s.toggleClass,g.addClasses=s.addClass,g.removeClasses=s.removeClass,g.hasParent=n.isChildOf,g.getClosest=r.closest,g.mouseWheelEvent=a.mouseWheelEvent,g.getEventKey=function(t){var e=t.key||g.getEventKey.KEYMAP[t.keyCode||t.which];return e&&g.getEventKey.MS_KEYMAP[e]&&(e=g.getEventKey.MS_KEYMAP[e]),e},g.getEventKey.KEYMAP={13:"Enter",27:"Escape",32:" ",33:"PageUp",34:"PageDown",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",46:"Delete",107:"+",109:"-"},g.getEventKey.MS_KEYMAP={Add:"+",Del:"Delete",Down:"ArrowDown",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Spacebar:" ",Subtract:"-",Up:"ArrowUp"},g.fullscreenEvent=function(){var t={exitFullscreen:"fullscreenchange",webkitExitFullscreen:"webkitfullscreenchange",mozCancelFullScreen:"mozfullscreenchange",msExitFullscreen:"MSFullscreenChange"};for(var e in t)if(t.hasOwnProperty(e)&&e in document)return t[e];return null},g.bound=function(t,e,o){return Math.max(e,Math.min(o,t))},g.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},g.sum=function(t){return t.reduce(function(t,e){return t+e},0)},g.dasherize=o.dasherize,g.getXMPValue=function(t,e){var o;return null!==(o=t.match("<GPano:"+e+">(.*)</GPano:"+e+">"))?o[1]:null!==(o=t.match("GPano:"+e+'="(.*?)"'))?o[1]:null},g.isFullscreenEnabled=function(t){return(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)===t},g.requestFullscreen=function(t){(t.requestFullscreen||t.mozRequestFullScreen||t.webkitRequestFullscreen||t.msRequestFullscreen).call(t)},g.exitFullscreen=function(){(document.exitFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.msExitFullscreen).call(document)},g.getStyle=s.css,g.getShortestArc=function(t,e){var o=[0,g.TwoPI,-g.TwoPI];return o.reduce(function(o,i){return i=e-t+i,Math.abs(i)<Math.abs(o)?i:o},1/0)},g.getAngle=function(t,e){return Math.acos(Math.cos(t.latitude)*Math.cos(e.latitude)*Math.cos(t.longitude-e.longitude)+Math.sin(t.latitude)*Math.sin(e.latitude))},g.parsePosition=function(t){if(!t)return{top:.5,left:.5};if("object"==typeof t)return t;var e=t.toLocaleLowerCase().split(" ").slice(0,2);1===e.length&&(e=void 0!==g.parsePosition.positions[e[0]]?[e[0],"center"]:[e[0],e[0]]);var o="left"!==e[1]&&"right"!==e[1]&&"top"!==e[0]&&"bottom"!==e[0];e=e.map(function(t){return g.parsePosition.positions[t]||t}),o||e.reverse();var i=e.join(" ").match(/^([0-9.]+)% ([0-9.]+)%$/);return i?{left:i[1]/100,top:i[2]/100}:{top:.5,left:.5}},g.parsePosition.positions={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},g.parseSpeed=function(t){if("string"==typeof t){t=t.toString().trim();var e=parseFloat(t.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/,"$1")),o=t.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim();switch(o.match(/(pm|per minute)$/)&&(e/=60),o){case"dpm":case"degrees per minute":case"dps":case"degrees per second":t=l.Math.degToRad(e);break;case"radians per minute":case"radians per second":t=e;break;case"rpm":case"revolutions per minute":case"rps":case"revolutions per second":t=e*g.TwoPI;break;default:throw new PSVError('unknown speed unit "'+o+'"')}}return t},g.parseAngle=function(t,e,o){if(void 0===o&&(o=e),"string"==typeof t){var i=t.toLowerCase().trim().match(/^(-?[0-9]+(?:\.[0-9]*)?)(.*)$/);if(!i)throw new PSVError('unknown angle "'+t+'"');var n=parseFloat(i[1]),s=i[2];if(s)switch(s){case"deg":case"degs":t=l.Math.degToRad(n);break;case"rad":case"rads":t=n;break;default:throw new PSVError('unknown angle unit "'+s+'"')}else t=n}return(t=(e?t+Math.PI:t)%g.TwoPI)<0&&(t=g.TwoPI+t),e?g.bound(t-Math.PI,-Math.PI/(o?2:1),Math.PI/(o?2:1)):t},g.cleanTHREEScene=function(t){t.children.forEach(function(t){t instanceof l.Mesh&&(t.geometry&&(t.geometry.dispose(),t.geometry=null),t.material&&(t.material.materials?(t.material.materials.forEach(function(t){t.map&&(t.map.dispose(),t.map=null),t.dispose()}),t.material.materials.length=0):(t.material.map&&(t.material.map.dispose(),t.material.map=null),t.material.dispose()),t.material=null))}),t.children.length=0},g.throttle=i.debounce,g.isPlainObject=t.isPlainObject,g.deepmerge=function(t,o){return e.mixin(t,o,!0)},g.clone=e.clone,g.normalizeWheel=a.normalizeWheel,g.forEach=function(t,o){return e.each(t,o,!0)},g}),t("skylark-sphere/PSVAnimation",[],function(){"use strict";function t(e){if(!(this instanceof t))return new t(e);this._cancelled=!1,this._resolved=!1;var o=this;this._promise=new Promise(function(t,e){o._resolve=t,o._reject=e}),e&&(e.easing&&"string"!=typeof e.easing||(e.easing=t.easings[e.easing||"linear"]),this._start=null,this._options=e,e.delay?this._delayTimeout=window.setTimeout(function(){this._delayTimeout=null,window.requestAnimationFrame(this._run.bind(this))}.bind(this),e.delay):window.requestAnimationFrame(this._run.bind(this)))}return t.easings={linear:function(t){return t},inQuad:function(t){return t*t},outQuad:function(t){return t*(2-t)},inOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},inCubic:function(t){return t*t*t},outCubic:function(t){return--t*t*t+1},inOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},inQuart:function(t){return t*t*t*t},outQuart:function(t){return 1- --t*t*t*t},inOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},inQuint:function(t){return t*t*t*t*t},outQuint:function(t){return 1+--t*t*t*t*t},inOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t},inSine:function(t){return 1-Math.cos(t*(Math.PI/2))},outSine:function(t){return Math.sin(t*(Math.PI/2))},inOutSine:function(t){return.5-.5*Math.cos(Math.PI*t)},inExpo:function(t){return Math.pow(2,10*(t-1))},outExpo:function(t){return 1-Math.pow(2,-10*t)},inOutExpo:function(t){return(t=2*t-1)<0?.5*Math.pow(2,10*t):1-.5*Math.pow(2,-10*t)},inCirc:function(t){return 1-Math.sqrt(1-t*t)},outCirc:function(t){return t--,Math.sqrt(1-t*t)},inOutCirc:function(t){return(t*=2)<1?.5-.5*Math.sqrt(1-t*t):.5+.5*Math.sqrt(1-(t-=2)*t)}},t.prototype._run=function(t){if(!this._cancelled){null===this._start&&(this._start=t);var e,o=(t-this._start)/this._options.duration,i={};if(o<1){for(e in this._options.properties)this._options.properties[e]&&(i[e]=this._options.properties[e].start+(this._options.properties[e].end-this._options.properties[e].start)*this._options.easing(o));this._options.onTick(i,o),window.requestAnimationFrame(this._run.bind(this))}else{for(e in this._options.properties)this._options.properties[e]&&(i[e]=this._options.properties[e].end);this._options.onTick(i,1),window.requestAnimationFrame(function(){this._resolved=!0,this._resolve()}.bind(this))}}},t.prototype.then=function(e,o){var i=new t;return i._promise.then(null,this.cancel.bind(this)),this._promise.then(function(){i._resolve(e?e():void 0)},function(){i._reject(o?o():void 0)}),i},t.prototype.catch=function(t){return this.then(void 0,t)},t.prototype.finally=function(t){return this.then(t,t)},t.prototype.cancel=function(){this._cancelled||this._resolved||(this._cancelled=!0,this._reject(),this._delayTimeout&&(window.cancelAnimationFrame(this._delayTimeout),this._delayTimeout=null))},t}),t("skylark-sphere/PSVMarker",["./PSVError","./PSVAnimation","./PSVUtils"],function(t,e,o){"use strict";function i(e,n){if(!e.id)throw new t("missing marker id");if(e.image&&(!e.width||!e.height))throw new t("missing marker width/height");if((e.image||e.html)&&!(e.hasOwnProperty("x")&&e.hasOwnProperty("y")||e.hasOwnProperty("latitude")&&e.hasOwnProperty("longitude")))throw new t("missing marker position, latitude/longitude or x/y");this.psv=n,this.visible=!0,this._dynamicSize=!1;var s,r=e.id,a=i.getType(e,!1);Object.defineProperties(this,{id:{configurable:!1,enumerable:!0,get:function(){return r},set:function(){}},type:{configurable:!1,enumerable:!0,get:function(){return a},set:function(){}},$el:{configurable:!1,enumerable:!0,get:function(){return s},set:function(){}},_def:{configurable:!1,enumerable:!0,get:function(){return this[a]},set:function(t){this[a]=t}}}),(s=this.isNormal()?document.createElement("div"):this.isPolygon()?document.createElementNS(o.svgNS,"polygon"):this.isPolyline()?document.createElementNS(o.svgNS,"polyline"):document.createElementNS(o.svgNS,this.type)).id="psv-marker-"+this.id,s.psvMarker=this,this.update(e)}return i.types=["image","html","polygon_px","polygon_rad","polyline_px","polyline_rad","rect","circle","ellipse","path"],i.getType=function(e,o){var n=[];if(i.types.forEach(function(t){e[t]&&n.push(t)}),0===n.length&&!o)throw new t("missing marker content, either "+i.types.join(", "));if(n.length>1)throw new t("multiple marker content, either "+i.types.join(", "));return n[0]},i.prototype.destroy=function(){delete this.$el.psvMarker},i.prototype.isNormal=function(){return"image"===this.type||"html"===this.type},i.prototype.isPoly=function(){return this.isPolygon()||this.isPolyline()},i.prototype.isPolygon=function(){return"polygon_px"===this.type||"polygon_rad"===this.type},i.prototype.isPolyline=function(){return"polyline_px"===this.type||"polyline_rad"===this.type},i.prototype.isSvg=function(){return"rect"===this.type||"circle"===this.type||"ellipse"===this.type||"path"===this.type},i.prototype.getScale=function(t){return Array.isArray(this.scale)?this.scale[0]+(this.scale[1]-this.scale[0])*e.easings.inQuad(t/100):"function"==typeof this.scale?this.scale(t):"number"==typeof this.scale?this.scale*e.easings.inQuad(t/100):1},i.prototype.update=function(e){if(e&&e!==this){var n=i.getType(e,!0);if(void 0!==n&&n!==this.type)throw new t("cannot change marker type");o.deepmerge(this,e)}this.isNormal()?this.$el.setAttribute("class","psv-marker psv-marker--normal"):this.$el.setAttribute("class","psv-marker psv-marker--svg"),this.className&&o.addClasses(this.$el,this.className),this.tooltip&&(o.addClasses(this.$el,"has-tooltip"),"string"==typeof this.tooltip&&(this.tooltip={content:this.tooltip})),this.style&&o.deepmerge(this.$el.style,this.style),this.anchor=o.parsePosition(this.anchor),this.isNormal()?this._updateNormal():this.isPolygon()?this._updatePoly("polygon_rad","polygon_px"):this.isPolyline()?this._updatePoly("polyline_rad","polyline_px"):this._updateSvg()},i.prototype._updateNormal=function(){this.width&&this.height?(this.$el.style.width=this.width+"px",this.$el.style.height=this.height+"px",this._dynamicSize=!1):this._dynamicSize=!0,this.image?this.$el.style.backgroundImage="url("+this.image+")":this.$el.innerHTML=this.html,this.$el.style.transformOrigin=100*this.anchor.left+"% "+100*this.anchor.top+"%",this.psv.cleanPosition(this),this.position3D=this.psv.sphericalCoordsToVector3(this)},i.prototype._updateSvg=function(){switch(this._dynamicSize=!0,this.type){case"rect":"number"==typeof this._def?this._def={x:0,y:0,width:this._def,height:this._def}:Array.isArray(this._def)?this._def={x:0,y:0,width:this._def[0],height:this._def[1]}:this._def.x=this._def.y=0;break;case"circle":"number"==typeof this._def?this._def={cx:this._def,cy:this._def,r:this._def}:Array.isArray(this._def)?this._def={cx:this._def[0],cy:this._def[0],r:this._def[0]}:this._def.cx=this._def.cy=this._def.r;break;case"ellipse":"number"==typeof this._def?this._def={cx:this._def,cy:this._def,rx:this._def,ry:this._def}:Array.isArray(this._def)?this._def={cx:this._def[0],cy:this._def[1],rx:this._def[0],ry:this._def[1]}:(this._def.cx=this._def.rx,this._def.cy=this._def.ry);break;case"path":"string"==typeof this._def&&(this._def={d:this._def})}Object.getOwnPropertyNames(this._def).forEach(function(t){this.$el.setAttributeNS(null,t,this._def[t])},this),this.svgStyle?Object.getOwnPropertyNames(this.svgStyle).forEach(function(t){this.$el.setAttributeNS(null,o.dasherize(t),this.svgStyle[t])},this):this.$el.setAttributeNS(null,"fill","rgba(0,0,0,0.5)"),this.psv.cleanPosition(this),this.position3D=this.psv.sphericalCoordsToVector3(this)},i.prototype._updatePoly=function(t,e){this._dynamicSize=!0,this.svgStyle?(Object.getOwnPropertyNames(this.svgStyle).forEach(function(t){this.$el.setAttributeNS(null,o.dasherize(t),this.svgStyle[t])},this),this.isPolyline()&&!this.svgStyle.fill&&this.$el.setAttributeNS(null,"fill","none")):this.isPolygon()?this.$el.setAttributeNS(null,"fill","rgba(0,0,0,0.5)"):this.isPolyline()&&(this.$el.setAttributeNS(null,"fill","none"),this.$el.setAttributeNS(null,"stroke","rgb(0,0,0)")),[this[t],this[e]].forEach(function(t){if(t&&"object"!=typeof t[0])for(var e=0;e<t.length;e++)t.splice(e,2,[t[e],t[e+1]])}),this[e]?this[t]=this[e].map(function(t){var e=this.psv.textureCoordsToSphericalCoords({x:t[0],y:t[1]});return[e.longitude,e.latitude]},this):this[t]=this[t].map(function(t){return[o.parseAngle(t[0]),o.parseAngle(t[1],!0)]}),this.longitude=this[t][0][0],this.latitude=this[t][0][1],this.positions3D=this[t].map(function(t){return this.psv.sphericalCoordsToVector3({longitude:t[0],latitude:t[1]})},this)},i}),t("skylark-sphere/doT",[],function(){"use strict";var t,e={name:"doT",version:"1.1.1",templateSettings:{evaluate:/\{\{([\s\S]+?(\}?)+)\}\}/g,interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,useParams:/(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,defineParams:/^\s*([\w$]+):([\s\S]+)/,conditional:/\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,varname:"it",strip:!0,append:!0,selfcontained:!1,doNotSkipEncoded:!1},template:void 0,compile:void 0,log:!0};e.encodeHTMLSource=function(t){var e={"&":"&#38;","<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","/":"&#47;"},o=t?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(t){return t?t.toString().replace(o,function(t){return e[t]||t}):""}},t=function(){return this||(0,eval)("this")}();var o={append:{start:"'+(",end:")+'",startencode:"'+encodeHTML("},split:{start:"';out+=(",end:");out+='",startencode:"';out+=encodeHTML("}},i=/$^/;function n(t){return t.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}return e.template=function(s,r,a){var h,p,c=(r=r||e.templateSettings).append?o.append:o.split,l=0,u=r.use||r.define?function t(e,o,n){return("string"==typeof o?o:o.toString()).replace(e.define||i,function(t,o,i,s){return 0===o.indexOf("def.")&&(o=o.substring(4)),o in n||(":"===i?(e.defineParams&&s.replace(e.defineParams,function(t,e,i){n[o]={arg:e,text:i}}),o in n||(n[o]=s)):new Function("def","def['"+o+"']="+s)(n)),""}).replace(e.use||i,function(o,i){e.useParams&&(i=i.replace(e.useParams,function(t,e,o,i){if(n[o]&&n[o].arg&&i){var s=(o+":"+i).replace(/'|\\/g,"_");return n.__exp=n.__exp||{},n.__exp[s]=n[o].text.replace(new RegExp("(^|[^\\w$])"+n[o].arg+"([^\\w$])","g"),"$1"+i+"$2"),e+"def.__exp['"+s+"']"}}));var s=new Function("def","return "+i)(n);return s?t(e,s,n):s})}(r,s,a||{}):s;u=("var out='"+(r.strip?u.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):u).replace(/'|\\/g,"\\$&").replace(r.interpolate||i,function(t,e){return c.start+n(e)+c.end}).replace(r.encode||i,function(t,e){return h=!0,c.startencode+n(e)+c.end}).replace(r.conditional||i,function(t,e,o){return e?o?"';}else if("+n(o)+"){out+='":"';}else{out+='":o?"';if("+n(o)+"){out+='":"';}out+='"}).replace(r.iterate||i,function(t,e,o,i){return e?(l+=1,p=i||"i"+l,e=n(e),"';var arr"+l+"="+e+";if(arr"+l+"){var "+o+","+p+"=-1,l"+l+"=arr"+l+".length-1;while("+p+"<l"+l+"){"+o+"=arr"+l+"["+p+"+=1];out+='"):"';} } out+='"}).replace(r.evaluate||i,function(t,e){return"';"+n(e)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|\}|^|\{)out\+='';/g,"$1").replace(/\+''/g,""),h&&(r.selfcontained||!t||t._encodeHTML||(t._encodeHTML=e.encodeHTMLSource(r.doNotSkipEncoded)),u="var encodeHTML = typeof _encodeHTML !== 'undefined' ? _encodeHTML : ("+e.encodeHTMLSource.toString()+"("+(r.doNotSkipEncoded||"")+"));"+u);try{return new Function(r.varname,u)}catch(t){throw"undefined"!=typeof console&&console.log("Could not create a template function: "+u),t}},e.compile=function(t,o){return e.template(t,null,o)},e}),t("skylark-sphere/components/PSVComponent",["../_psv/ctoc"],function(t){"use strict";function e(e){this.psv=e instanceof t?e:e.psv,this.parent=e,this.container=null,this.visible=!0,this.constructor.publicMethods&&this.constructor.publicMethods.forEach(function(t){this.psv[t]=this[t].bind(this)},this)}return e.className=null,e.publicMethods=[],e.prototype.create=function(){this.container=document.createElement("div"),this.constructor.className&&(this.container.className=this.constructor.className),this.parent.container.appendChild(this.container)},e.prototype.destroy=function(){this.parent.container.removeChild(this.container),this.constructor.publicMethods&&this.constructor.publicMethods.forEach(function(t){delete this.psv[t]},this),delete this.container,delete this.psv,delete this.parent},e.prototype.hide=function(){this.container.style.display="none",this.visible=!1},e.prototype.show=function(){this.container.style.display="",this.visible=!0},e}),t("skylark-sphere/components/PSVHUD",["skylark-threejs","../_psv/ctoc","../PSVError","../PSVUtils","../PSVMarker","./PSVComponent"],function(t,e,o,i,n,s){"use strict";function r(t){s.call(this,t),this.svgContainer=null,this.markers={},this.currentMarker=null,this.hoveringMarker=null,this.prop={panelOpened:!1,panelOpening:!1,markersButton:this.psv.navbar.getNavbarButton("markers",!0)},this.create()}return r.prototype=Object.create(s.prototype),r.prototype.constructor=r,r.className="psv-hud",r.publicMethods=["addMarker","removeMarker","updateMarker","clearMarkers","getMarker","getCurrentMarker","gotoMarker","hideMarker","showMarker","toggleMarker","toggleMarkersList","showMarkersList","hideMarkersList"],r.prototype.create=function(){s.prototype.create.call(this),this.svgContainer=document.createElementNS(i.svgNS,"svg"),this.svgContainer.setAttribute("class","psv-hud-svg-container"),this.container.appendChild(this.svgContainer),this.container.addEventListener("mouseenter",this,!0),this.container.addEventListener("mouseleave",this,!0),this.container.addEventListener("mousemove",this,!0),this.psv.on("click",this),this.psv.on("dblclick",this),this.psv.on("render",this),this.psv.on("open-panel",this),this.psv.on("close-panel",this)},r.prototype.destroy=function(){this.clearMarkers(!1),this.container.removeEventListener("mouseenter",this),this.container.removeEventListener("mouseleave",this),this.container.removeEventListener("mousemove",this),this.psv.off("click",this),this.psv.off("dblclick",this),this.psv.off("render",this),this.psv.off("open-panel",this),this.psv.off("close-panel",this),delete this.svgContainer,s.prototype.destroy.call(this)},r.prototype.handleEvent=function(t){switch(t.type){case"mouseenter":this._onMouseEnter(t);break;case"mouseleave":this._onMouseLeave(t);break;case"mousemove":this._onMouseMove(t);break;case"click":this._onClick(t.args[0],t,!1);break;case"dblclick":this._onClick(t.args[0],t,!0);break;case"render":this.renderMarkers();break;case"open-panel":this._onPanelOpened();break;case"close-panel":this._onPanelClosed()}},r.prototype.addMarker=function(t,e){if(!t.id)throw new o("missing marker id");if(this.markers[t.id])throw new o('marker "'+t.id+'" already exists');var i=new n(t,this.psv);return i.isNormal()?this.container.appendChild(i.$el):this.svgContainer.appendChild(i.$el),this.markers[i.id]=i,!1!==e&&this.renderMarkers(),i},r.prototype.getMarker=function(t){var e="object"==typeof t?t.id:t;if(!this.markers[e])throw new o('cannot find marker "'+e+'"');return this.markers[e]},r.prototype.getCurrentMarker=function(){return this.currentMarker},r.prototype.updateMarker=function(t,e){var o=this.getMarker(t);return o.update(t),!1!==e&&this.renderMarkers(),o},r.prototype.removeMarker=function(t,e){(t=this.getMarker(t)).isNormal()?this.container.removeChild(t.$el):this.svgContainer.removeChild(t.$el),this.hoveringMarker===t&&this.psv.tooltip.hideTooltip(),t.destroy(),delete this.markers[t.id],!1!==e&&this.renderMarkers()},r.prototype.clearMarkers=function(t){Object.keys(this.markers).forEach(function(t){this.removeMarker(t,!1)},this),!1!==t&&this.renderMarkers()},r.prototype.gotoMarker=function(t,e){return t=this.getMarker(t),this.psv.animate(t,e).then(function(){this.psv.trigger("goto-marker-done",t)}.bind(this))},r.prototype.hideMarker=function(t){this.getMarker(t).visible=!1,this.renderMarkers()},r.prototype.showMarker=function(t){this.getMarker(t).visible=!0,this.renderMarkers()},r.prototype.toggleMarker=function(t){this.getMarker(t).visible^=!0,this.renderMarkers()},r.prototype.toggleMarkersList=function(){this.prop.panelOpened?this.hideMarkersList():this.showMarkersList()},r.prototype.showMarkersList=function(){var t=[];i.forEach(this.markers,function(e){t.push(e)});var e=this.psv.config.templates.markersList({markers:t,config:this.psv.config});this.prop.panelOpening=!0,this.psv.panel.showPanel(e,!0),this.psv.panel.container.querySelector(".psv-markers-list").addEventListener("click",this._onClickItem.bind(this))},r.prototype.hideMarkersList=function(){this.prop.panelOpened&&this.psv.panel.hidePanel()},r.prototype.renderMarkers=function(){if(this.visible){var e=this.psv.isGyroscopeEnabled()?t.Math.radToDeg(this.psv.camera.rotation.z):0;i.forEach(this.markers,function(t){var o=t.visible;if(o&&t.isPoly()){var n=this._getPolyPositions(t);if(o=n.length>(t.isPolygon()?2:1)){t.position2D=this._getPolyDimensions(t,n);var s=n.map(function(t){return t.x+","+t.y}).join(" ");t.$el.setAttributeNS(null,"points",s)}}else if(o){var r=this._getMarkerPosition(t);if(o=this._isMarkerVisible(t,r)){t.position2D=r;var a=t.getScale(this.psv.getZoomLevel());t.isSvg()?t.$el.setAttributeNS(null,"transform","translate("+r.x+", "+r.y+")"+(1!==a?" scale("+a+", "+a+")":"")+(!t.lockRotation&&e?" rotate("+e+")":"")):t.$el.style.transform="translate3D("+r.x+"px, "+r.y+"px, 0px)"+(1!==a?" scale("+a+", "+a+")":"")+(!t.lockRotation&&e?" rotateZ("+e+"deg)":"")}}i.toggleClass(t.$el,"psv-marker--visible",o)}.bind(this))}},r.prototype._isMarkerVisible=function(t,e){return t.position3D.dot(this.psv.prop.direction)>0&&e.x+t.width>=0&&e.x-t.width<=this.psv.prop.size.width&&e.y+t.height>=0&&e.y-t.height<=this.psv.prop.size.height},r.prototype._getMarkerPosition=function(t){if(t._dynamicSize){i.toggleClass(t.$el,"psv-marker--transparent",!0);var e=t.$el.style.transform;t.$el.style.transform=null;var o=t.$el.getBoundingClientRect();t.$el.style.transform=e,i.toggleClass(t.$el,"psv-marker--transparent",!1),t.width=o.right-o.left,t.height=o.bottom-o.top}var n=this.psv.vector3ToViewerCoords(t.position3D);return n.x-=t.width*t.anchor.left,n.y-=t.height*t.anchor.top,n},r.prototype._getPolyPositions=function(t){var e=t.positions3D.length,o=t.positions3D.map(function(t){return{vector:t,visible:t.dot(this.psv.prop.direction)>0}},this),i=[];return o.forEach(function(t,n){if(!t.visible){var s=[0===n?o[e-1]:o[n-1],n===e-1?o[0]:o[n+1]];s.forEach(function(e){e.visible&&i.push({visible:e,invisible:t,index:n})})}}),i.reverse().forEach(function(t){o.splice(t.index,0,{vector:this._getPolyIntermediaryPoint(t.visible.vector,t.invisible.vector),visible:!0})},this),o.filter(function(t){return t.visible}).map(function(t){return this.psv.vector3ToViewerCoords(t.vector)},this)},r.prototype._getPolyIntermediaryPoint=function(o,i){var n=this.psv.prop.direction.clone().normalize(),s=(new t.Vector3).crossVectors(o,i).normalize(),r=(new t.Vector3).crossVectors(s,o).normalize(),a=(new t.Vector3).addVectors(o.clone().multiplyScalar(-n.dot(r)),r.clone().multiplyScalar(n.dot(o))).normalize(),h=(new t.Vector3).crossVectors(a,n);return a.applyAxisAngle(h,.01).multiplyScalar(e.SPHERE_RADIUS)},r.prototype._getPolyDimensions=function(t,e){var o=1/0,i=1/0,n=-1/0,s=-1/0;return e.forEach(function(t){o=Math.min(o,t.x),i=Math.min(i,t.y),n=Math.max(n,t.x),s=Math.max(s,t.y)}),t.width=n-o,t.height=s-i,{x:o,y:i}},r.prototype._onMouseEnter=function(t){var e;t.target&&(e=t.target.psvMarker)&&!e.isPoly()&&(this.hoveringMarker=e,this.psv.trigger("over-marker",e),e.tooltip&&this.psv.tooltip.showTooltip({content:e.tooltip.content,position:e.tooltip.position,left:e.position2D.x,top:e.position2D.y,box:{width:e.width,height:e.height}}))},r.prototype._onMouseLeave=function(t){var e;if(t.target&&(e=t.target.psvMarker)){if(e.isPoly()&&t.relatedTarget&&i.hasParent(t.relatedTarget,this.psv.tooltip.container))return;this.psv.trigger("leave-marker",e),this.hoveringMarker=null,this.psv.tooltip.hideTooltip()}},r.prototype._onMouseMove=function(t){var e;if(!this.psv.prop.moving)if(t.target&&(e=t.target.psvMarker)&&e.isPoly()||t.target&&i.hasParent(t.target,this.psv.tooltip.container)&&(e=this.hoveringMarker)){this.hoveringMarker||(this.psv.trigger("over-marker",e),this.hoveringMarker=e);var o=this.psv.container.getBoundingClientRect();e.tooltip&&this.psv.tooltip.showTooltip({content:e.tooltip.content,position:e.tooltip.position,top:t.clientY-o.top-this.psv.config.tooltip.arrow_size/2,left:t.clientX-o.left-this.psv.config.tooltip.arrow_size,box:{width:2*this.psv.config.tooltip.arrow_size,height:2*this.psv.config.tooltip.arrow_size}})}else this.hoveringMarker&&this.hoveringMarker.isPoly()&&(this.psv.trigger("leave-marker",this.hoveringMarker),this.hoveringMarker=null,this.psv.tooltip.hideTooltip())},r.prototype._onClick=function(t,e,o){var n;t.target&&(n=i.getClosest(t.target,".psv-marker"))&&n.psvMarker?(this.currentMarker=n.psvMarker,this.psv.trigger("select-marker",this.currentMarker,o),this.psv.config.click_event_on_marker?t.marker=n.psvMarker:e.stopImmediatePropagation()):this.currentMarker&&(this.psv.trigger("unselect-marker",this.currentMarker),this.currentMarker=null),n&&n.psvMarker&&n.psvMarker.content?this.psv.panel.showPanel(n.psvMarker.content):this.psv.panel.prop.opened&&(e.stopPropagation(),this.psv.panel.hidePanel())},r.prototype._onClickItem=function(t){var e;if(t.target&&(e=i.getClosest(t.target,"li"))&&e.dataset.psvMarker){var o=this.getMarker(e.dataset.psvMarker);this.psv.trigger("select-marker-list",o),this.gotoMarker(o,1e3),this.psv.panel.hidePanel()}},r.prototype._onPanelOpened=function(){this.prop.panelOpening?(this.prop.panelOpening=!1,this.prop.panelOpened=!0):this.prop.panelOpened=!1,this.prop.markersButton&&this.prop.markersButton.toggleActive(this.prop.panelOpened)},r.prototype._onPanelClosed=function(){this.prop.panelOpened=!1,this.prop.panelOpening=!1,this.prop.markersButton&&this.prop.markersButton.toggleActive(!1)},r}),t("skylark-sphere/components/PSVLoader",["../_psv/ctoc","../PSVUtils","./PSVComponent"],function(t,e,o){"use strict";function i(t){o.call(this,t),this.canvas=null,this.loader=null,this.create()}return i.prototype=Object.create(o.prototype),i.prototype.constructor=i,i.className="psv-loader-container",i.prototype.create=function(){o.prototype.create.call(this);var e,i=t.SYSTEM.pixelRatio;if(this.loader=document.createElement("div"),this.loader.className="psv-loader",this.container.appendChild(this.loader),this.canvas=document.createElement("canvas"),this.canvas.className="psv-loader-canvas",this.canvas.width=this.loader.clientWidth*i,this.canvas.height=this.loader.clientWidth*i,this.loader.appendChild(this.canvas),this.tickness=(this.loader.offsetWidth-this.loader.clientWidth)/2*i,this.psv.config.loading_img?((e=document.createElement("img")).className="psv-loader-image",e.src=this.psv.config.loading_img):this.psv.config.loading_txt&&((e=document.createElement("div")).className="psv-loader-text",e.innerHTML=this.psv.config.loading_txt),e){var n=Math.round(Math.sqrt(2*Math.pow((this.canvas.width/2-this.tickness/2)/i,2)));e.style.maxWidth=n+"px",e.style.maxHeight=n+"px",this.loader.appendChild(e)}},i.prototype.destroy=function(){delete this.loader,delete this.canvas,o.prototype.destroy.call(this)},i.prototype.setProgress=function(t){var o=this.canvas.getContext("2d");o.clearRect(0,0,this.canvas.width,this.canvas.height),o.lineWidth=this.tickness,o.strokeStyle=e.getStyle(this.loader,"color"),o.beginPath(),o.arc(this.canvas.width/2,this.canvas.height/2,this.canvas.width/2-this.tickness/2,-Math.PI/2,t/100*2*Math.PI-Math.PI/2),o.stroke()},i}),t("skylark-sphere/buttons/Button",["../_psv/ctoc","../components/PSVComponent","../PSVUtils"],function(t,e,o){"use strict";function i(t){e.call(this,t),this.id=void 0,this.constructor.id&&(this.id=this.constructor.id),this.enabled=!0}return i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.id=null,i.icon=null,i.iconActive=null,i.prototype.create=function(){e.prototype.create.call(this),this.constructor.icon&&this._setIcon(this.constructor.icon),this.id&&this.psv.config.lang[this.id]&&(this.container.title=this.psv.config.lang[this.id]),this.container.addEventListener("click",function(t){this.enabled&&this._onClick(),t.stopPropagation()}.bind(this));var t=this.supported();"function"==typeof t.then?(this.hide(),t.then(function(t){t&&this.show()}.bind(this))):t||this.hide()},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i.prototype.supported=function(){return!0},i.prototype.toggleActive=function(t){o.toggleClass(this.container,"psv-button--active",t),this.constructor.iconActive&&this._setIcon(t?this.constructor.iconActive:this.constructor.icon)},i.prototype.disable=function(){this.container.classList.add("psv-button--disabled"),this.enabled=!1},i.prototype.enable=function(){this.container.classList.remove("psv-button--disabled"),this.enabled=!0},i.prototype._setIcon=function(e,o){o||(o=this.container),e?(o.innerHTML=t.ICONS[e],o.querySelector("svg").setAttribute("class","psv-button-svg")):o.innerHTML=""},i.prototype._onClick=function(){},i}),t("skylark-sphere/buttons/AutorotateButton",["./Button"],function(t){"use strict";function e(e){t.call(this,e),this.create()}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.id="autorotate",e.className="psv-button psv-button--hover-scale psv-autorotate-button",e.icon="play.svg",e.iconActive="play-active.svg",e.prototype.create=function(){t.prototype.create.call(this),this.psv.on("autorotate",this)},e.prototype.destroy=function(){this.psv.off("autorotate",this),t.prototype.destroy.call(this)},e.prototype.handleEvent=function(t){switch(t.type){case"autorotate":this.toggleActive(t.args[0])}},e.prototype._onClick=function(){this.psv.toggleAutorotate()},e}),t("skylark-sphere/buttons/CustomButton",["../PSVUtils","./Button"],function(t,e){"use strict";function o(t,o){e.call(this,t),this.config=o,this.config.id&&(this.id=this.config.id),this.create()}return o.prototype=Object.create(e.prototype),o.prototype.constructor=o,o.className="psv-button psv-custom-button",o.prototype.create=function(){e.prototype.create.call(this),this.config.className&&t.addClasses(this.container,this.config.className),this.config.title&&(this.container.title=this.config.title),this.config.content&&(this.container.innerHTML=this.config.content),!1!==this.config.enabled&&!0!==this.config.disabled||this.disable(),!1!==this.config.visible&&!0!==this.config.hidden||this.hide()},o.prototype.destroy=function(){delete this.config,e.prototype.destroy.call(this)},o.prototype._onClick=function(){this.config.onClick&&this.config.onClick.apply(this.psv)},o}),t("skylark-sphere/buttons/DownloadButton",["./Button"],function(t){"use strict";function e(e){t.call(this,e),this.create()}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.id="download",e.className="psv-button psv-button--hover-scale psv-download-button",e.icon="download.svg",e.prototype._onClick=function(){var t=document.createElement("a");t.href=this.psv.config.panorama,t.download=this.psv.config.panorama,this.psv.container.appendChild(t),t.click()},e}),t("skylark-sphere/buttons/FullscreenButton",["../_psv/ctoc","./Button"],function(t,e){"use strict";function o(t){e.call(this,t),this.create()}return o.prototype=Object.create(e.prototype),o.prototype.constructor=o,o.id="fullscreen",o.className="psv-button psv-button--hover-scale psv-fullscreen-button",o.icon="fullscreen-in.svg",o.iconActive="fullscreen-out.svg",o.prototype.create=function(){e.prototype.create.call(this),this.psv.on("fullscreen-updated",this)},o.prototype.destroy=function(){this.psv.off("fullscreen-updated",this),e.prototype.destroy.call(this)},o.prototype.supported=function(){return!!t.SYSTEM.fullscreenEvent},o.prototype.handleEvent=function(t){switch(t.type){case"fullscreen-updated":this.toggleActive(t.args[0])}},o.prototype._onClick=function(){this.psv.toggleFullscreen()},o}),t("skylark-sphere/buttons/GyroscopeButton",["../_psv/ctoc","../PSVUtils","./Button"],function(t,e,o){"use strict";function i(t){o.call(this,t),this.create()}return i.prototype=Object.create(o.prototype),i.prototype.constructor=i,i.id="gyroscope",i.className="psv-button psv-button--hover-scale psv-gyroscope-button",i.icon="compass.svg",i.prototype.create=function(){o.prototype.create.call(this),this.psv.on("gyroscope-updated",this)},i.prototype.destroy=function(){this.psv.off("gyroscope-updated",this),o.prototype.destroy.call(this)},i.prototype.supported=function(){return!!e.checkTHREE("DeviceOrientationControls")&&t.SYSTEM.deviceOrientationSupported},i.prototype.handleEvent=function(t){switch(t.type){case"gyroscope-updated":this.toggleActive(t.args[0])}},i.prototype._onClick=function(){this.psv.toggleGyroscopeControl()},i}),t("skylark-sphere/buttons/MarkersButton",["./Button"],function(t){"use strict";function e(e){t.call(this,e),this.create()}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.id="markers",e.className="psv-button psv-button--hover-scale psv-markers-button",e.icon="pin.svg",e.prototype._onClick=function(){this.psv.hud.toggleMarkersList()},e}),t("skylark-sphere/buttons/StereoButton",["../_psv/ctoc","../PSVUtils","./Button"],function(t,e,o){"use strict";function i(t){o.call(this,t),this.create()}return i.prototype=Object.create(o.prototype),i.prototype.constructor=i,i.id="stereo",i.className="psv-button psv-button--hover-scale psv-stereo-button",i.icon="stereo.svg",i.prototype.create=function(){o.prototype.create.call(this),this.psv.on("stereo-updated",this)},i.prototype.destroy=function(){this.psv.off("stereo-updated",this),o.prototype.destroy.call(this)},i.prototype.supported=function(){return!(!t.SYSTEM.fullscreenEvent||!e.checkTHREE("DeviceOrientationControls"))&&t.SYSTEM.deviceOrientationSupported},i.prototype.handleEvent=function(t){switch(t.type){case"stereo-updated":this.toggleActive(t.args[0])}},i.prototype._onClick=function(){this.psv.toggleStereoView()},i}),t("skylark-sphere/buttons/ZoomButton",["./Button"],function(t){"use strict";function e(e){t.call(this,e),this.zoom_range=null,this.zoom_value=null,this.prop={mousedown:!1,buttondown:!1,longPressInterval:null,longPressTimeout:null},this.create()}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.id="zoom",e.className="psv-button psv-zoom-button",e.prototype.create=function(){t.prototype.create.call(this);var e=document.createElement("div");e.className="psv-zoom-button-minus",e.title=this.psv.config.lang.zoomOut,this._setIcon("zoom-out.svg",e),this.container.appendChild(e);var o=document.createElement("div");o.className="psv-zoom-button-range",this.container.appendChild(o),this.zoom_range=document.createElement("div"),this.zoom_range.className="psv-zoom-button-line",o.appendChild(this.zoom_range),this.zoom_value=document.createElement("div"),this.zoom_value.className="psv-zoom-button-handle",this.zoom_range.appendChild(this.zoom_value);var i=document.createElement("div");i.className="psv-zoom-button-plus",i.title=this.psv.config.lang.zoomIn,this._setIcon("zoom-in.svg",i),this.container.appendChild(i),this.zoom_range.addEventListener("mousedown",this),this.zoom_range.addEventListener("touchstart",this),this.psv.container.addEventListener("mousemove",this),this.psv.container.addEventListener("touchmove",this),this.psv.container.addEventListener("mouseup",this),this.psv.container.addEventListener("touchend",this),e.addEventListener("mousedown",this._zoomOut.bind(this)),i.addEventListener("mousedown",this._zoomIn.bind(this)),this.psv.on("zoom-updated",this),this.psv.one("ready",function(){this._moveZoomValue(this.psv.prop.zoom_lvl)}.bind(this))},e.prototype.destroy=function(){this._stopZoomChange(),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.zoom_range,delete this.zoom_value,this.psv.off("zoom-updated",this),t.prototype.destroy.call(this)},e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":this._initZoomChangeWithMouse(t);break;case"touchstart":this._initZoomChangeByTouch(t);break;case"mousemove":this._changeZoomWithMouse(t);break;case"touchmove":this._changeZoomByTouch(t);break;case"mouseup":case"touchend":this._stopZoomChange(t);break;case"zoom-updated":this._moveZoomValue(t.args[0])}},e.prototype._moveZoomValue=function(t){this.zoom_value.style.left=t/100*this.zoom_range.offsetWidth-this.zoom_value.offsetWidth/2+"px"},e.prototype._initZoomChangeWithMouse=function(t){this.enabled&&(this.prop.mousedown=!0,this._changeZoom(t.clientX))},e.prototype._initZoomChangeByTouch=function(t){this.enabled&&(this.prop.mousedown=!0,this._changeZoom(t.changedTouches[0].clientX))},e.prototype._zoomIn=function(){this.enabled&&(this.prop.buttondown=!0,this.psv.zoomIn(),this.prop.longPressTimeout=window.setTimeout(this._startLongPressInterval.bind(this,1),200))},e.prototype._zoomOut=function(){this.enabled&&(this.prop.buttondown=!0,this.psv.zoomOut(),this.prop.longPressTimeout=window.setTimeout(this._startLongPressInterval.bind(this,-1),200))},e.prototype._startLongPressInterval=function(t){this.prop.buttondown&&(this.prop.longPressInterval=window.setInterval(function(){this.psv.zoom(this.psv.prop.zoom_lvl+t)}.bind(this),50))},e.prototype._stopZoomChange=function(){this.enabled&&(window.clearInterval(this.prop.longPressInterval),window.clearTimeout(this.prop.longPressTimeout),this.prop.longPressInterval=null,this.prop.mousedown=!1,this.prop.buttondown=!1)},e.prototype._changeZoomWithMouse=function(t){this.enabled&&(t.preventDefault(),this._changeZoom(t.clientX))},e.prototype._changeZoomByTouch=function(t){this.enabled&&this._changeZoom(t.changedTouches[0].clientX)},e.prototype._changeZoom=function(t){if(this.prop.mousedown){var e=parseInt(t)-this.zoom_range.getBoundingClientRect().left,o=e/this.zoom_range.offsetWidth*100;this.psv.zoom(o)}},e}),t("skylark-sphere/buttons/CaptionButton",["./Button"],function(t){function e(e){t.call(this,e),this.create()}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.id="markers",e.className="psv-button psv-button--hover-scale psv-caption-button",e.icon="info.svg",e.prototype.create=function(){t.prototype.create.call(this),this.psv.on("hide-notification",this)},e.prototype.destroy=function(){this.psv.off("hide-notification",this),t.prototype.destroy.call(this)},e.prototype.handleEvent=function(t){switch(t.type){case"hide-notification":this.toggleActive(!1)}},e.prototype._onClick=function(){this.psv.isNotificationVisible()?this.psv.hideNotification():(this.psv.showNotification(this.parent.prop.caption),this.toggleActive(!0))},e}),t("skylark-sphere/components/PSVNavBarCaption",["../_psv/ctoc","../buttons/CaptionButton","../PSVUtils","./PSVComponent"],function(t,e,o,i){"use strict";function n(t,e){i.call(this,t),this.content=null,this.button=null,this.prop={caption:"",width:0},this.create(),this.setCaption(e)}return n.prototype=Object.create(i.prototype),n.prototype.constructor=n,n.className="psv-caption",n.publicMethods=["setCaption"],n.prototype.create=function(){i.prototype.create.call(this),this.button=new e(this),this.button.hide(),this.content=document.createElement("div"),this.content.className="psv-caption-content",this.container.appendChild(this.content),window.addEventListener("resize",this)},n.prototype.destroy=function(){window.removeEventListener("resize",this),delete this.content,i.prototype.destroy.call(this)},n.prototype.handleEvent=function(t){switch(t.type){case"resize":this._onResize()}},n.prototype.setCaption=function(t){this.prop.caption=t||"",this.content.innerHTML=this.prop.caption,this.content.style.display="",this.prop.width=this.content.offsetWidth,this._onResize()},n.prototype._onResize=function(){var t=parseInt(o.getStyle(this.container,"width"));t>=this.prop.width?(this.button.hide(),this.content.style.display=""):(this.button.show(),this.content.style.display="none")},n}),t("skylark-sphere/components/PSVNavBar",["../_psv/ctoc","../buttons/AutorotateButton","../buttons/CustomButton","../buttons/DownloadButton","../buttons/FullscreenButton","../buttons/GyroscopeButton","../buttons/MarkersButton","../buttons/StereoButton","../buttons/ZoomButton","../PSVUtils","../PSVError","./PSVComponent","./PSVNavBarCaption"],function(t,e,o,i,n,s,r,a,h,p,c,l,u){"use strict";function d(e){if(l.call(this,e),this.config=this.psv.config.navbar,this.items=[],!0===this.config)this.config=p.clone(t.DEFAULTS.navbar);else if("string"==typeof this.config)this.config=this.config.split(" ");else if(!Array.isArray(this.config)){console.warn('PhotoSphereViewer: hashmap form of "navbar" is deprecated, use an array instead.');var o=this.config;this.config=[],p.forEach(o,function(t,e){t&&this.config.push(e)}.bind(this)),this.config.sort(function(e,o){return t.DEFAULTS.navbar.indexOf(e)-t.DEFAULTS.navbar.indexOf(o)})}this.create()}return d.prototype=Object.create(l.prototype),d.prototype.constructor=d,d.className="psv-navbar psv-navbar--open",d.publicMethods=["showNavbar","hideNavbar","toggleNavbar","getNavbarButton"],d.prototype.create=function(){l.prototype.create.call(this),this.config.forEach(function(t){if("object"==typeof t)this.items.push(new o(this,t));else switch(t){case e.id:this.items.push(new e(this));break;case h.id:this.items.push(new h(this));break;case i.id:this.items.push(new i(this));break;case r.id:this.items.push(new r(this));break;case n.id:this.items.push(new n(this));break;case a.id:this.items.push(new a(this));break;case s.id:this.items.push(new s(this));break;case"caption":this.items.push(new u(this,this.psv.config.caption));break;default:if(0!==t.indexOf("spacer"))throw new c("Unknown button "+t);console.warn("PhotoSphereViewer: navbar spacers have been removed.")}},this)},d.prototype.destroy=function(){this.items.forEach(function(t){t.destroy()}),this.items.length=0,delete this.config,l.prototype.destroy.call(this)},d.prototype.getNavbarButton=function(t,e){var o=null;return this.items.some(function(e){return e.id===t&&(o=e,!0)}),o||e||console.warn('PhotoSphereViewer: button "'+t+'" not found in the navbar.'),o},d.prototype.showNavbar=function(){this.toggleNavbar(!0)},d.prototype.hideNavbar=function(){this.toggleNavbar(!1)},d.prototype.toggleNavbar=function(t){p.toggleClass(this.container,"psv-navbar--open",t)},d}),t("skylark-sphere/components/PSVNotification",["../_psv/ctoc","../PSVUtils","./PSVComponent"],function(t,e,o){"use strict";function i(t){o.call(this,t),this.create()}return i.prototype=Object.create(o.prototype),i.prototype.constructor=i,i.className="psv-notification",i.publicMethods=["showNotification","hideNotification","isNotificationVisible"],i.prototype.create=function(){o.prototype.create.call(this),this.content=document.createElement("div"),this.content.className="psv-notification-content",this.container.appendChild(this.content),this.content.addEventListener("click",this.hideNotification.bind(this))},i.prototype.destroy=function(){delete this.content,o.prototype.destroy.call(this)},i.prototype.isNotificationVisible=function(){return this.container.classList.contains("psv-notification--visible")},i.prototype.showNotification=function(t){"string"==typeof t&&(t={content:t}),this.content.innerHTML=t.content,this.container.classList.add("psv-notification--visible"),this.psv.trigger("show-notification"),t.timeout&&setTimeout(this.hideNotification.bind(this),t.timeout)},i.prototype.hideNotification=function(){this.isNotificationVisible()&&(this.container.classList.remove("psv-notification--visible"),this.psv.trigger("hide-notification"))},i}),t("skylark-sphere/components/PSVOverlay",["../_psv/ctoc","../PSVUtils","./PSVComponent"],function(t,e,o){"use strict";function i(t){o.call(this,t),this.create(),this.hide()}return i.prototype=Object.create(o.prototype),i.prototype.constructor=i,i.className="psv-overlay",i.publicMethods=["showOverlay","hideOverlay","isOverlayVisible"],i.prototype.create=function(){o.prototype.create.call(this),this.image=document.createElement("div"),this.image.className="psv-overlay-image",this.container.appendChild(this.image),this.text=document.createElement("div"),this.text.className="psv-overlay-text",this.container.appendChild(this.text),this.subtext=document.createElement("div"),this.subtext.className="psv-overlay-subtext",this.container.appendChild(this.subtext),this.container.addEventListener("click",this.hideOverlay.bind(this))},i.prototype.destroy=function(){delete this.image,delete this.text,delete this.subtext,o.prototype.destroy.call(this)},i.prototype.isOverlayVisible=function(){return this.visible},i.prototype.showOverlay=function(t){"string"==typeof t&&(t={text:t}),this.image.innerHTML=t.image||"",this.text.innerHTML=t.text||"",this.subtext.innerHTML=t.subtext||"",this.show(),this.psv.trigger("show-overlay")},i.prototype.hideOverlay=function(){this.isOverlayVisible()&&(this.hide(),this.psv.trigger("hide-overlay"))},i}),t("skylark-sphere/components/PSVPanel",["../_psv/ctoc","../PSVUtils","./PSVComponent"],function(t,e,o){"use strict";function i(t){o.call(this,t),this.content=null,this.prop={mouse_x:0,mouse_y:0,mousedown:!1,opened:!1},this.create()}return i.prototype=Object.create(o.prototype),i.prototype.constructor=i,i.className="psv-panel",i.publicMethods=["showPanel","hidePanel"],i.prototype.create=function(){o.prototype.create.call(this),this.container.innerHTML='<div class="psv-panel-resizer"></div><div class="psv-panel-close-button"></div><div class="psv-panel-content"></div>',this.content=this.container.querySelector(".psv-panel-content");var e=this.container.querySelector(".psv-panel-close-button");e.addEventListener("click",this.hidePanel.bind(this)),this.psv.config.mousewheel&&this.container.addEventListener(t.SYSTEM.mouseWheelEvent,function(t){t.stopPropagation()});var i=this.container.querySelector(".psv-panel-resizer");i.addEventListener("mousedown",this),i.addEventListener("touchstart",this),this.psv.container.addEventListener("mouseup",this),this.psv.container.addEventListener("touchend",this),this.psv.container.addEventListener("mousemove",this),this.psv.container.addEventListener("touchmove",this)},i.prototype.destroy=function(){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,o.prototype.destroy.call(this)},i.prototype.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)}},i.prototype.showPanel=function(t,o){this.content.innerHTML=t,this.content.scrollTop=0,this.container.classList.add("psv-panel--open"),e.toggleClass(this.content,"psv-panel-content--no-margin",!0===o),this.prop.opened=!0,this.psv.trigger("open-panel")},i.prototype.hidePanel=function(){this.content.innerHTML=null,this.prop.opened=!1,this.container.classList.remove("psv-panel--open"),this.psv.trigger("close-panel")},i.prototype._onMouseDown=function(t){t.stopPropagation(),this._startResize(t)},i.prototype._onTouchStart=function(t){t.stopPropagation(),this._startResize(t.changedTouches[0])},i.prototype._onMouseUp=function(t){this.prop.mousedown&&(t.stopPropagation(),this.prop.mousedown=!1,this.content.classList.remove("psv-panel-content--no-interaction"))},i.prototype._onMouseMove=function(t){this.prop.mousedown&&(t.stopPropagation(),this._resize(t))},i.prototype._onTouchMove=function(t){this.prop.mousedown&&this._resize(t.touches[0])},i.prototype._startResize=function(t){this.prop.mouse_x=parseInt(t.clientX),this.prop.mouse_y=parseInt(t.clientY),this.prop.mousedown=!0,this.content.classList.add("psv-panel-content--no-interaction")},i.prototype._resize=function(t){var e=parseInt(t.clientX),o=parseInt(t.clientY);this.container.style.width=this.container.offsetWidth-(e-this.prop.mouse_x)+"px",this.prop.mouse_x=e,this.prop.mouse_y=o},i}),t("skylark-sphere/components/PSVTooltip",["../_psv/ctoc","../PSVUtils","./PSVComponent"],function(t,e,o){"use strict";function i(t){o.call(this,t),this.config=this.psv.config.tooltip,this.prop={timeout:null},this.create()}return i.prototype=Object.create(o.prototype),i.prototype.constructor=i,i.className="psv-tooltip",i.publicMethods=["showTooltip","hideTooltip","isTooltipVisible"],i.leftMap={0:"left",.5:"center",1:"right"},i.topMap={0:"top",.5:"center",1:"bottom"},i.prototype.create=function(){o.prototype.create.call(this),this.container.innerHTML='<div class="psv-tooltip-arrow"></div><div class="psv-tooltip-content"></div>',this.container.style.top="-1000px",this.container.style.left="-1000px",this.content=this.container.querySelector(".psv-tooltip-content"),this.arrow=this.container.querySelector(".psv-tooltip-arrow"),this.psv.on("render",this)},i.prototype.destroy=function(){this.psv.off("render",this),delete this.config,delete this.prop,o.prototype.destroy.call(this)},i.prototype.handleEvent=function(t){switch(t.type){case"render":this.hideTooltip()}},i.prototype.isTooltipVisible=function(){return this.container.classList.contains("psv-tooltip--visible")},i.prototype.showTooltip=function(t){this.prop.timeout&&(window.clearTimeout(this.prop.timeout),this.prop.timeout=null);var o=this.isTooltipVisible(),n=this.container,s=this.content,r=this.arrow;if(t.position||(t.position=["top","center"]),t.box||(t.box={width:0,height:0}),"string"==typeof t.position){var a=e.parsePosition(t.position);if(!(a.left in i.leftMap&&a.top in i.topMap))throw new PSVError('unable to parse tooltip position "'+t.position+'"');t.position=[i.topMap[a.top],i.leftMap[a.left]]}if("center"===t.position[0]&&"center"===t.position[1])throw new PSVError('unable to parse tooltip position "center center"');if(o)for(var h=n.classList.length-1;h>=0;h--){var p=n.classList.item(h);"psv-tooltip"!==p&&"psv-tooltip--visible"!==p&&n.classList.remove(p)}else n.className="psv-tooltip";t.className&&e.addClasses(n,t.className),s.innerHTML=t.content,n.style.top="0px",n.style.left="0px";var c=n.getBoundingClientRect(),l={posClass:t.position.slice(),width:c.right-c.left,height:c.bottom-c.top,top:0,left:0,arrow_top:0,arrow_left:0};this._computeTooltipPosition(l,t);var u=!1;l.top<this.config.offset?(l.posClass[0]="bottom",u=!0):l.top+l.height>this.psv.prop.size.height-this.config.offset&&(l.posClass[0]="top",u=!0),l.left<this.config.offset?(l.posClass[1]="right",u=!0):l.left+l.width>this.psv.prop.size.width-this.config.offset&&(l.posClass[1]="left",u=!0),u&&this._computeTooltipPosition(l,t),n.style.top=l.top+"px",n.style.left=l.left+"px",r.style.top=l.arrow_top+"px",r.style.left=l.arrow_left+"px",n.classList.add("psv-tooltip--"+l.posClass.join("-")),o||(this.prop.timeout=window.setTimeout(function(){n.classList.add("psv-tooltip--visible"),this.prop.timeout=null,this.psv.trigger("show-tooltip")}.bind(this),this.config.delay))},i.prototype.hideTooltip=function(){this.prop.timeout&&(window.clearTimeout(this.prop.timeout),this.prop.timeout=null),this.isTooltipVisible()&&(this.container.classList.remove("psv-tooltip--visible"),this.prop.timeout=window.setTimeout(function(){this.content.innerHTML=null,this.container.style.top="-1000px",this.container.style.left="-1000px",this.prop.timeout=null}.bind(this),this.config.delay),this.psv.trigger("hide-tooltip"))},i.prototype._computeTooltipPosition=function(t,e){var o=!1;switch(t.posClass[0]){case"bottom":t.top=e.top+e.box.height+this.config.offset+this.config.arrow_size,t.arrow_top=2*-this.config.arrow_size,o=!0;break;case"center":t.top=e.top+e.box.height/2-t.height/2,t.arrow_top=t.height/2-this.config.arrow_size;break;case"top":t.top=e.top-t.height-this.config.offset-this.config.arrow_size,t.arrow_top=t.height,o=!0}switch(t.posClass[1]){case"right":o?(t.left=e.left+e.box.width/2-this.config.offset-this.config.arrow_size,t.arrow_left=this.config.offset):(t.left=e.left+e.box.width+this.config.offset+this.config.arrow_size,t.arrow_left=2*-this.config.arrow_size);break;case"center":t.left=e.left+e.box.width/2-t.width/2,t.arrow_left=t.width/2-this.config.arrow_size;break;case"left":o?(t.left=e.left-t.width+e.box.width/2+this.config.offset+this.config.arrow_size,t.arrow_left=t.width-this.config.offset-2*this.config.arrow_size):(t.left=e.left-t.width-this.config.offset-this.config.arrow_size,t.arrow_left=t.width)}},i}),t("skylark-sphere/_psv/core",["skylark-threejs","./ctoc","../doT","../PSVError","../PSVUtils","../PSVAnimation","../components/PSVHUD","../components/PSVLoader","../components/PSVNavBar","../components/PSVNotification","../components/PSVOverlay","../components/PSVPanel","../components/PSVTooltip"],function(t,e,o,i,n,s,r,a,h,p,c,l,u){"use strict";return e.prototype._construct=function(s){if(e.SYSTEM.loaded||e._loadSystem(),this.config=n.clone(e.DEFAULTS),n.deepmerge(this.config,s),!s.container)throw new i("No value given for container.");if(!e.SYSTEM.isCanvasSupported)throw new i("Canvas is not supported.");if(!e.SYSTEM.isWebGLSupported)throw new i("WebGL is not supported.");if(this.config.longitude_range&&2!==this.config.longitude_range.length&&(this.config.longitude_range=null,console.warn("PhotoSphereViewer: longitude_range must have exactly two elements.")),this.config.latitude_range?2!==this.config.latitude_range.length?(this.config.latitude_range=null,console.warn("PhotoSphereViewer: latitude_range must have exactly two elements.")):this.config.latitude_range[0]>this.config.latitude_range[1]&&(this.config.latitude_range=[this.config.latitude_range[1],this.config.latitude_range[0]],console.warn("PhotoSphereViewer: latitude_range values must be ordered.")):void 0===this.config.tilt_up_max&&void 0===this.config.tilt_down_max||(this.config.latitude_range=[void 0!==this.config.tilt_down_max?this.config.tilt_down_max-Math.PI/4:-n.HalfPI,void 0!==this.config.tilt_up_max?this.config.tilt_up_max+Math.PI/4:n.HalfPI],console.warn("PhotoSphereViewer: tilt_up_max and tilt_down_max are deprecated, use latitude_range instead.")),this.config.max_fov<this.config.min_fov){var d=this.config.max_fov;this.config.max_fov=this.config.min_fov,this.config.min_fov=d,console.warn("PhotoSphereViewer: max_fov cannot be lower than min_fov.")}this.config.cache_texture&&(!n.isInteger(this.config.cache_texture)||this.config.cache_texture<0)&&(this.config.cache_texture=e.DEFAULTS.cache_texture,console.warn("PhotoSphereViewer: invalid value for cache_texture")),"panorama_roll"in this.config&&(this.config.sphere_correction.roll=this.config.panorama_roll,console.warn("PhotoSphereViewer: panorama_roll is deprecated, use sphere_correction.roll instead")),"gyroscope"in this.config&&console.warn("PhotoSphereViewer: gyroscope is deprecated, the control is automatically created if DeviceOrientationControls.js is loaded"),!0===this.config.keyboard&&(this.config.keyboard=n.clone(e.DEFAULTS.keyboard)),this.config.min_fov=n.bound(this.config.min_fov,1,179),this.config.max_fov=n.bound(this.config.max_fov,1,179),null===this.config.default_fov?this.config.default_fov=this.config.max_fov/2+this.config.min_fov/2:this.config.default_fov=n.bound(this.config.default_fov,this.config.min_fov,this.config.max_fov),null===this.config.anim_lat?this.config.anim_lat=this.config.default_lat:this.config.anim_lat=n.parseAngle(this.config.anim_lat,!0),this.config.longitude_range&&(this.config.longitude_range=this.config.longitude_range.map(function(t){return n.parseAngle(t)})),this.config.latitude_range&&(this.config.latitude_range=this.config.latitude_range.map(function(t){return n.parseAngle(t,!0)})),this.config.anim_speed=n.parseSpeed(this.config.anim_speed),this.config.caption&&!this.config.navbar&&(this.config.navbar=["caption"]),!0===this.config.fisheye?this.config.fisheye=1:!1===this.config.fisheye&&(this.config.fisheye=0),this.parent="string"==typeof s.container?document.getElementById(s.container):s.container,this.container=null,this.loader=null,this.navbar=null,this.hud=null,this.panel=null,this.tooltip=null,this.notification=null,this.overlay=null,this.canvas_container=null,this.renderer=null,this.stereoEffect=null,this.noSleep=null,this.scene=null,this.camera=null,this.mesh=null,this.raycaster=null,this.doControls=null,this.prop={needsUpdate:!0,isCubemap:void 0,position:{longitude:0,latitude:0},ready:!1,direction:null,anim_speed:0,zoom_lvl:0,vFov:0,hFov:0,aspect:0,move_speed:.1,moving:!1,zooming:!1,start_mouse_x:0,start_mouse_y:0,mouse_x:0,mouse_y:0,mouse_history:[],gyro_alpha_offset:0,pinch_dist:0,main_reqid:null,orientation_cb:null,autorotate_cb:null,animation_promise:null,loading_promise:null,start_timeout:null,dblclick_data:null,dblclick_timeout:null,cache:[],size:{width:0,height:0},pano_data:{full_width:0,full_height:0,cropped_width:0,cropped_height:0,cropped_x:0,cropped_y:0}},Object.keys(e.TEMPLATES).forEach(function(t){this.config.templates[t]||(this.config.templates[t]=e.TEMPLATES[t]),"string"==typeof this.config.templates[t]&&(this.config.templates[t]=o.template(this.config.templates[t]))},this),this.parent.photoSphereViewer=this,this.container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),null!==this.config.size&&this._setViewerSize(this.config.size),this._onResize();var f=(this.config.default_fov-this.config.min_fov)/(this.config.max_fov-this.config.min_fov)*100;this.config.default_zoom_lvl=f-2*(f-50),this.prop.move_speed=t.Math.degToRad(this.config.move_speed/e.SYSTEM.pixelRatio),this.loader=new a(this),this.loader.hide(),this.navbar=new h(this),this.navbar.hide(),this.hud=new r(this),this.hud.hide(),this.panel=new l(this),this.tooltip=new u(this.hud),this.notification=new p(this),this.overlay=new c(this),this._bindEvents(),this.config.panorama&&this.setPanorama(this.config.panorama),this.one("render",function(){this.config.navbar&&(this.container.classList.add("psv-container--has-navbar"),this.navbar.show()),this.hud.show(),this.config.markers&&(this.config.markers.forEach(function(t){this.hud.addMarker(t,!1)},this),this.hud.renderMarkers()),!1!==this.config.time_anim&&(this.prop.start_timeout=window.setTimeout(this.startAutorotate.bind(this),this.config.time_anim)),setTimeout(function(){this._run(),this.trigger("ready")}.bind(this),0)}.bind(this)),e.SYSTEM.touchEnabled.then(function(t){t&&this.container.classList.add("psv-is-touch")}.bind(this))},e.prototype._run=function(t){this.trigger("before-render",t||+new Date),this.prop.needsUpdate&&(this._render(),this.prop.needsUpdate=!1),this.prop.main_reqid=window.requestAnimationFrame(this._run.bind(this))},e.prototype._render=function(){this.prop.direction=this.sphericalCoordsToVector3(this.prop.position),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.camera.aspect=this.prop.aspect,this.camera.fov=this.prop.vFov,this.camera.updateProjectionMatrix(),(this.stereoEffect||this.renderer).render(this.scene,this.camera),this.trigger("render")},e.prototype._loadXMP=function(t){return this.config.usexmpdata?new Promise(function(e){var o=0,s=new XMLHttpRequest;this.config.with_credentials&&(s.withCredentials=!0),s.onreadystatechange=function(){if(4===s.readyState){if(200!==s.status&&201!==s.status&&202!==s.status&&0!==s.status)throw this.container.textContent="Cannot load image",new i("Cannot load image");this.loader.setProgress(100);var t=s.responseText,r=t.indexOf("<x:xmpmeta"),a=t.indexOf("</x:xmpmeta>"),h=t.substring(r,a),p=null;-1!==r&&-1!==a&&-1!==h.indexOf("GPano:")&&((p={full_width:parseInt(n.getXMPValue(h,"FullPanoWidthPixels")),full_height:parseInt(n.getXMPValue(h,"FullPanoHeightPixels")),cropped_width:parseInt(n.getXMPValue(h,"CroppedAreaImageWidthPixels")),cropped_height:parseInt(n.getXMPValue(h,"CroppedAreaImageHeightPixels")),cropped_x:parseInt(n.getXMPValue(h,"CroppedAreaLeftPixels")),cropped_y:parseInt(n.getXMPValue(h,"CroppedAreaTopPixels"))}).full_width&&p.full_height&&p.cropped_width&&p.cropped_height||(console.warn("PhotoSphereViewer: invalid XMP data"),p=null)),e(p)}else 3===s.readyState&&this.loader.setProgress(o+=10)}.bind(this),s.onprogress=function(t){if(t.lengthComputable){var e=parseInt(t.loaded/t.total*100);e>o&&(o=e,this.loader.setProgress(o))}}.bind(this),s.onerror=function(t){throw this.container.textContent="Cannot load image",reject(t),new i("Cannot load image")}.bind(this),s.open("GET",t,!0),s.send(null)}.bind(this)):Promise.resolve(null)},e.prototype._loadTexture=function(t){var o=[];if(Array.isArray(t)){if(6!==t.length)throw new i("Must provide exactly 6 image paths when using cubemap.");for(var n=0;n<6;n++)o[n]=t[e.CUBE_MAP[n]];t=o}else if("object"==typeof t){if(!e.CUBE_HASHMAP.every(function(e){return!!t[e]}))throw new i("Must provide exactly left, front, right, back, top, bottom when using cubemap.");e.CUBE_HASHMAP.forEach(function(e,i){o[i]=t[e]}),t=o}if(Array.isArray(t)){if(!1===this.prop.isCubemap)throw new i("The viewer was initialized with an equirectangular panorama, cannot switch to cubemap.");return this.config.fisheye&&console.warn("PhotoSphereViewer: fisheye effect with cubemap texture can generate distorsions."),this.config.cache_texture===e.DEFAULTS.cache_texture&&(this.config.cache_texture*=6),this.prop.isCubemap=!0,this._loadCubemapTexture(t)}if(!0===this.prop.isCubemap)throw new i("The viewer was initialized with an cubemap, cannot switch to equirectangular panorama.");return this.prop.isCubemap=!1,this._loadEquirectangularTexture(t)},e.prototype._loadEquirectangularTexture=function(o){if(this.config.cache_texture){var s=this.getPanoramaCache(o);if(s)return this.prop.pano_data=s.pano_data,Promise.resolve(s.image)}return this._loadXMP(o).then(function(s){return new Promise(function(r,a){var h=new t.ImageLoader,p=s?100:0;this.config.with_credentials?h.setCrossOrigin("use-credentials"):h.setCrossOrigin("anonymous");h.load(o,function(i){p=100,this.loader.setProgress(p),this.trigger("panorama-load-progress",o,p),!s&&this.config.pano_data&&(s=n.clone(this.config.pano_data));s||(s={full_width:i.width,full_height:i.height,cropped_width:i.width,cropped_height:i.height,cropped_x:0,cropped_y:0});var a;this.prop.pano_data=s;var h=Math.min(s.full_width,e.SYSTEM.maxTextureWidth)/s.full_width;if(1!==h||s.cropped_width!==s.full_width||s.cropped_height!==s.full_height){var c=n.clone(s);c.full_width*=h,c.full_height*=h,c.cropped_width*=h,c.cropped_height*=h,c.cropped_x*=h,c.cropped_y*=h,i.width=c.cropped_width,i.height=c.cropped_height;var l=document.createElement("canvas");l.width=c.full_width,l.height=c.full_height;var u=l.getContext("2d");u.drawImage(i,c.cropped_x,c.cropped_y,c.cropped_width,c.cropped_height),a=new t.Texture(l)}else a=new t.Texture(i);a.needsUpdate=!0,a.minFilter=t.LinearFilter,a.generateMipmaps=!1,this.config.cache_texture&&this._putPanoramaCache({panorama:o,image:a,pano_data:s});r(a)}.bind(this),function(t){if(t.lengthComputable){var e=parseInt(t.loaded/t.total*100);e>p&&(p=e,this.loader.setProgress(p),this.trigger("panorama-load-progress",o,p))}}.bind(this),function(t){throw this.container.textContent="Cannot load image",a(t),new i("Cannot load image")}.bind(this))}.bind(this))}.bind(this))},e.prototype._loadCubemapTexture=function(o){return new Promise(function(s,r){var a=new t.ImageLoader,h=[0,0,0,0,0,0],p=[],c=0;this.config.with_credentials?a.setCrossOrigin("use-credentials"):a.setCrossOrigin("anonymous");for(var l=function(i,r){c++,h[i]=100,this.loader.setProgress(n.sum(h)/6),this.trigger("panorama-load-progress",o[i],h[i]);var a=Math.min(r.width,e.SYSTEM.maxTextureWidth/2)/r.width;if(1!==a){var l=document.createElement("canvas");l.width=r.width*a,l.height=r.height*a;var u=l.getContext("2d");u.drawImage(r,0,0,l.width,l.height),p[i]=new t.Texture(l)}else p[i]=new t.Texture(r);this.config.cache_texture&&this._putPanoramaCache({panorama:o[i],image:p[i]}),6===c&&(p.forEach(function(e){e.needsUpdate=!0,e.minFilter=t.LinearFilter,e.generateMipmaps=!1}),s(p))},u=function(t,e){if(e.lengthComputable){var i=parseInt(e.loaded/e.total*100);i>h[t]&&(h[t]=i,this.loader.setProgress(n.sum(h)/6),this.trigger("panorama-load-progress",o[t],h[t]))}},d=function(t,e){throw this.container.textContent="Cannot load image",r(e),new i("Cannot load image "+t)},f=0;f<6;f++){if(this.config.cache_texture){var g=this.getPanoramaCache(o[f]);if(g){c++,h[f]=100,p[f]=g.image;continue}}a.load(o[f],l.bind(this,f),u.bind(this,f),d.bind(this,f))}6===c&&s(p)}.bind(this))},e.prototype._setTexture=function(t){if(this.scene||this._createScene(),this.prop.isCubemap)for(var e=0;e<6;e++)this.mesh.material[e].map&&this.mesh.material[e].map.dispose(),this.mesh.material[e].map=t[e];else this.mesh.material.map&&this.mesh.material.map.dispose(),this.mesh.material.map=t;this.trigger("panorama-loaded"),this._render()},e.prototype._createScene=function(){this.raycaster=new t.Raycaster,this.renderer=new t.WebGLRenderer,this.renderer.setSize(this.prop.size.width,this.prop.size.height),this.renderer.setPixelRatio(e.SYSTEM.pixelRatio),this.camera=new t.PerspectiveCamera(this.config.default_fov,this.prop.size.width/this.prop.size.height,1,3*e.SPHERE_RADIUS),this.camera.position.set(0,0,0),this.scene=new t.Scene,this.scene.add(this.camera),this.prop.isCubemap?this.mesh=this._createCubemap():this.mesh=this._createSphere(),this.scene.add(this.mesh),this.canvas_container=document.createElement("div"),this.canvas_container.className="psv-canvas-container",this.renderer.domElement.className="psv-canvas",this.container.appendChild(this.canvas_container),this.canvas_container.appendChild(this.renderer.domElement)},e.prototype._createSphere=function(o){o=o||1;var i=new t.SphereGeometry(e.SPHERE_RADIUS*o,e.SPHERE_VERTICES,e.SPHERE_VERTICES,-n.HalfPI),s=new t.MeshBasicMaterial({side:t.DoubleSide}),r=new t.Mesh(i,s);return r.scale.x=-1,r},e.prototype._setSphereCorrection=function(t,e){this.cleanSphereCorrection(e),t.rotation.set(e.tilt,e.pan,e.roll)},e.prototype._createCubemap=function(o){o=o||1;for(var i=new t.BoxGeometry(2*e.SPHERE_RADIUS*o,2*e.SPHERE_RADIUS*o,2*e.SPHERE_RADIUS*o,e.CUBE_VERTICES,e.CUBE_VERTICES,e.CUBE_VERTICES),n=[],s=0;s<6;s++)n.push(new t.MeshBasicMaterial({side:t.BackSide}));var r=new t.Mesh(i,n);return r.scale.set(1,1,-1),r},e.prototype._transition=function(e,o){var i,n=this.isExtendedPosition(o),r=void 0!==o.zoom;if(this.prop.isCubemap?(n&&(console.warn("PhotoSphereViewer: cannot perform cubemap transition to different position."),n=!1),(i=this._createCubemap(.9)).material.forEach(function(t,o){t.map=e[o],t.transparent=!0,t.opacity=0})):((i=this._createSphere(.9)).material.map=e,i.material.transparent=!0,i.material.opacity=0,o.sphere_correction&&this._setSphereCorrection(i,o.sphere_correction)),n){this.cleanPosition(o);var a=new t.Vector3(0,1,0);i.rotateOnWorldAxis(a,o.longitude-this.prop.position.longitude);var h=new t.Vector3(0,1,0).cross(this.camera.getWorldDirection()).normalize();i.rotateOnWorldAxis(h,o.latitude-this.prop.position.latitude),(this.config.latitude_range||this.config.longitude_range)&&(this.config.longitude_range=this.config.latitude_range=null,console.warn("PhotoSphereViewer: trying to perform transition with longitude_range and/or latitude_range, ranges cleared."))}return this.scene.add(i),this.needsUpdate(),new s({properties:{opacity:{start:0,end:1},zoom:r?{start:this.prop.zoom_lvl,end:o.zoom}:void 0},duration:this.config.transition.duration,easing:"outCubic",onTick:function(t){if(this.prop.isCubemap)for(var e=0;e<6;e++)i.material[e].opacity=t.opacity;else i.material.opacity=t.opacity;r&&this.zoom(t.zoom),this.needsUpdate()}.bind(this)}).then(function(){this._setTexture(e),this.scene.remove(i),i.geometry.dispose(),i.geometry=null,n&&this.rotate(o),o.sphere_correction?this._setSphereCorrection(this.mesh,o.sphere_correction):this._setSphereCorrection(this.mesh,{})}.bind(this))},e.prototype._reverseAutorotate=function(){var t=this,e=-this.config.anim_speed,o=this.config.longitude_range;this.config.longitude_range=null,new s({properties:{speed:{start:this.config.anim_speed,end:0}},duration:300,easing:"inSine",onTick:function(e){t.config.anim_speed=e.speed}}).then(function(){return new s({properties:{speed:{start:0,end:e}},duration:300,easing:"outSine",onTick:function(e){t.config.anim_speed=e.speed}})}).then(function(){t.config.longitude_range=o,t.config.anim_speed=e})},e.prototype._putPanoramaCache=function(t){if(!this.config.cache_texture)throw new i("Cannot add panorama to cache, cache_texture is disabled");var e=this.getPanoramaCache(t.panorama);e?(e.image=t.image,e.pano_data=t.pano_data):(this.prop.cache=this.prop.cache.slice(0,this.config.cache_texture-1),this.prop.cache.unshift(t)),this.trigger("panorama-cached",t.panorama)},e.prototype._stopAll=function(){this.stopAutorotate(),this.stopAnimation(),this.stopGyroscopeControl(),this.stopStereoView()},e}),t("skylark-sphere/_psv/defaults",["./ctoc"],function(t){"use strict";return t.MOVE_THRESHOLD=4,t.ANGLE_THRESHOLD=.003,t.DBLCLICK_DELAY=300,t.INERTIA_WINDOW=300,t.SPHERE_RADIUS=100,t.SPHERE_VERTICES=64,t.CUBE_VERTICES=8,t.CUBE_MAP=[0,2,4,5,3,1],t.CUBE_HASHMAP=["left","right","top","bottom","back","front"],t.SYSTEM={loaded:!1,pixelRatio:1,isWebGLSupported:!1,isCanvasSupported:!1,deviceOrientationSupported:null,maxTextureWidth:0,mouseWheelEvent:null,fullscreenEvent:null},t.ICONS={},t.DEFAULTS={panorama:null,container:null,caption:null,usexmpdata:!0,pano_data:null,min_fov:30,max_fov:90,default_fov:null,default_long:0,default_lat:0,sphere_correction:{pan:0,tilt:0,roll:0},longitude_range:null,latitude_range:null,move_speed:1,zoom_speed:2,time_anim:2e3,anim_speed:"2rpm",anim_lat:null,fisheye:!1,navbar:["autorotate","zoom","download","markers","caption","gyroscope","stereo","fullscreen"],tooltip:{offset:5,arrow_size:7,delay:100},lang:{autorotate:"Automatic rotation",zoom:"Zoom",zoomOut:"Zoom out",zoomIn:"Zoom in",download:"Download",fullscreen:"Fullscreen",markers:"Markers",gyroscope:"Gyroscope",stereo:"Stereo view",stereo_notification:"Click anywhere to exit stereo view.",please_rotate:["Please rotate your device","(or tap to continue)"],two_fingers:["Use two fingers to navigate"]},mousewheel:!0,mousewheel_factor:1,mousemove:!0,mousemove_hover:!1,touchmove_two_fingers:!1,keyboard:{ArrowUp:"rotateLatitudeUp",ArrowDown:"rotateLatitudeDown",ArrowRight:"rotateLongitudeRight",ArrowLeft:"rotateLongitudeLeft",PageUp:"zoomIn",PageDown:"zoomOut","+":"zoomIn","-":"zoomOut"," ":"toggleAutorotate"},move_inertia:!0,click_event_on_marker:!1,transition:{duration:1500,loader:!0},loading_img:null,loading_txt:"Loading...",size:null,cache_texture:0,templates:{},markers:[],with_credentials:!1},t.TEMPLATES={markersList:'  <div class="psv-markers-list-container">     <h1 class="psv-markers-list-title">{{= it.config.lang.markers }}</h1>     <ul class="psv-markers-list">     {{~ it.markers: marker }}       <li data-psv-marker="{{= marker.id }}" class="psv-markers-list-item {{? marker.className }}{{= marker.className }}{{?}}">         {{? marker.image }}<img class="psv-markers-list-image" src="{{= marker.image }}"/>{{?}}         <p class="psv-markers-list-name">{{? marker.tooltip }}{{= marker.tooltip.content }}{{?? marker.html }}{{= marker.html }}{{??}}{{= marker.id }}{{?}}</p>       </li>     {{~}}     </ul>   </div>'},t.ICONS["compass.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 0a50 50 0 1 0 0 100A50 50 0 0 0 50 0zm0 88.81a38.86 38.86 0 0 1-38.81-38.8 38.86 38.86 0 0 1 38.8-38.82A38.86 38.86 0 0 1 88.82 50 38.87 38.87 0 0 1 50 88.81z"/><path d="M72.07 25.9L40.25 41.06 27.92 74.12l31.82-15.18v-.01l12.32-33.03zM57.84 54.4L44.9 42.58l21.1-10.06-8.17 21.9z"/>\x3c!--Created by iconoci from the Noun Project--\x3e</svg>',t.ICONS["download.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M83.3 35.6h-17V3H32.2v32.6H16.6l33.6 32.7 33-32.7z"/><path d="M83.3 64.2v16.3H16.6V64.2H-.1v32.6H100V64.2H83.3z"/>\x3c!--Created by Michael Zenaty from the Noun Project--\x3e</svg>',t.ICONS["fullscreen-in.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M100 40H87.1V18.8h-21V6H100zM100 93.2H66V80.3h21.1v-21H100zM34 93.2H0v-34h12.9v21.1h21zM12.9 40H0V6h34v12.9H12.8z"/>\x3c!--Created by Garrett Knoll from the Noun Project--\x3e</svg>',t.ICONS["fullscreen-out.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M66 7h13v21h21v13H66zM66 60.3h34v12.9H79v21H66zM0 60.3h34v34H21V73.1H0zM21 7h13v34H0V28h21z"/>\x3c!--Created by Garrett Knoll from the Noun Project--\x3e</svg>',t.ICONS["gesture.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M33.38 33.2a1.96 1.96 0 0 0 1.5-3.23 10.61 10.61 0 0 1 7.18-17.51c.7-.06 1.31-.49 1.61-1.12a13.02 13.02 0 0 1 11.74-7.43c7.14 0 12.96 5.8 12.96 12.9 0 3.07-1.1 6.05-3.1 8.38-.7.82-.61 2.05.21 2.76.83.7 2.07.6 2.78-.22a16.77 16.77 0 0 0 4.04-10.91C72.3 7.54 64.72 0 55.4 0a16.98 16.98 0 0 0-14.79 8.7 14.6 14.6 0 0 0-12.23 14.36c0 3.46 1.25 6.82 3.5 9.45.4.45.94.69 1.5.69m45.74 43.55a22.13 22.13 0 0 1-5.23 12.4c-4 4.55-9.53 6.86-16.42 6.86-12.6 0-20.1-10.8-20.17-10.91a1.82 1.82 0 0 0-.08-.1c-5.3-6.83-14.55-23.82-17.27-28.87-.05-.1 0-.21.02-.23a6.3 6.3 0 0 1 8.24 1.85l9.38 12.59a1.97 1.97 0 0 0 3.54-1.17V25.34a4 4 0 0 1 1.19-2.87 3.32 3.32 0 0 1 2.4-.95c1.88.05 3.4 1.82 3.4 3.94v24.32a1.96 1.96 0 0 0 3.93 0v-33.1a3.5 3.5 0 0 1 7 0v35.39a1.96 1.96 0 0 0 3.93 0v-.44c.05-2.05 1.6-3.7 3.49-3.7 1.93 0 3.5 1.7 3.5 3.82v5.63c0 .24.04.48.13.71l.1.26a1.97 1.97 0 0 0 3.76-.37c.33-1.78 1.77-3.07 3.43-3.07 1.9 0 3.45 1.67 3.5 3.74l-1.77 18.1zM77.39 51c-1.25 0-2.45.32-3.5.9v-.15c0-4.27-3.33-7.74-7.42-7.74-1.26 0-2.45.33-3.5.9V16.69a7.42 7.42 0 0 0-14.85 0v1.86a7 7 0 0 0-3.28-.94 7.21 7.21 0 0 0-5.26 2.07 7.92 7.92 0 0 0-2.38 5.67v37.9l-5.83-7.82a10.2 10.2 0 0 0-13.35-2.92 4.1 4.1 0 0 0-1.53 5.48C20 64.52 28.74 80.45 34.07 87.34c.72 1.04 9.02 12.59 23.4 12.59 7.96 0 14.66-2.84 19.38-8.2a26.06 26.06 0 0 0 6.18-14.6l1.78-18.2v-.2c0-4.26-3.32-7.73-7.42-7.73z" fill="#000" fill-rule="evenodd"/>\x3c!--Created by AomAm from the Noun Project--\x3e</svg>',t.ICONS["info.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M28.3 26.1c-1 2.6-1.9 4.8-2.6 7-2.5 7.4-5 14.7-7.2 22-1.3 4.4.5 7.2 4.3 7.8 1.3.2 2.8.2 4.2-.1 8.2-2 11.9-8.6 15.7-15.2l-2.2 2a18.8 18.8 0 0 1-7.4 5.2 2 2 0 0 1-1.6-.2c-.2-.1 0-1 0-1.4l.8-1.8L41.9 28c.5-1.4.9-3 .7-4.4-.2-2.6-3-4.4-6.3-4.4-8.8.2-15 4.5-19.5 11.8-.2.3-.2.6-.3 1.3 3.7-2.8 6.8-6.1 11.8-6.2z"/><circle cx="39.3" cy="9.2" r="8.2"/>\x3c!--Created by Arafat Uddin from the Noun Project--\x3e</svg>',t.ICONS["mobile-rotate.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M66.7 19a14 14 0 0 1 13.8 12.1l-3.9-2.7c-.5-.3-1.1-.2-1.4.3-.3.5-.2 1.1.3 1.4l5.7 3.9.6.2c.3 0 .6-.2.8-.4l3.9-5.7c.3-.5.2-1.1-.3-1.4-.5-.3-1.1-.2-1.4.3l-2.4 3.5A16 16 0 0 0 66.7 17c-.6 0-1 .4-1 1s.4 1 1 1zM25 15h10c.6 0 1-.4 1-1s-.4-1-1-1H25c-.6 0-1 .4-1 1s.4 1 1 1zm-6.9 30H16l-2 .2a1 1 0 0 0-.8 1.2c.1.5.5.8 1 .8h.2l1.7-.2h2.1c.6 0 1-.4 1-1s-.5-1-1.1-1zm10 0h-4c-.6 0-1 .4-1 1s.4 1 1 1h4c.6 0 1-.4 1-1s-.4-1-1-1zM84 45H55V16A11 11 0 0 0 44 5H16A11 11 0 0 0 5 16v68a11 11 0 0 0 11 11h68a11 11 0 0 0 11-11V56a11 11 0 0 0-11-11zM16 93c-5 0-9-4-9-9V53.2c.3-.1.6-.3.7-.6a9.8 9.8 0 0 1 2-3c.4-.4.4-1 0-1.4a1 1 0 0 0-1.4 0l-1.2 1.5V16c0-5 4-9 9-9h28c5 0 9 4 9 9v68c0 5-4 9-9 9H16zm77-9c0 5-4 9-9 9H50.3c2.8-2 4.7-5.3 4.7-9V47h29c5 0 9 4 9 9v28zM38.1 45h-4c-.6 0-1 .4-1 1s.4 1 1 1h4c.6 0 1-.4 1-1s-.5-1-1-1zm9.9 0h-4c-.6 0-1 .4-1 1s.4 1 1 1h4c.6 0 1-.4 1-1s-.4-1-1-1zm38 19c-.6 0-1 .4-1 1v10c0 .6.4 1 1 1s1-.4 1-1V65c0-.6-.4-1-1-1z"/>\x3c!--Created by Anthony Bresset from the Noun Project--\x3e</svg>',t.ICONS["pin.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M24 0C13.8 0 5.5 8.3 5.5 18.5c0 10.07 17.57 28.64 18.32 29.42a.25.25 0 0 0 .36 0c.75-.78 18.32-19.35 18.32-29.42C42.5 8.3 34.2 0 24 0zm0 7.14a10.35 10.35 0 0 1 0 20.68 10.35 10.35 0 0 1 0-20.68z"/>\x3c!--Created by Daniele Marucci from the Noun Project--\x3e</svg>',t.ICONS["play-active.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 41 41"><path d="M40.5 14.1c-.1-.1-1.2-.5-2.898-1-.102 0-.202-.1-.202-.2C34.5 6.5 28 2 20.5 2S6.6 6.5 3.7 12.9c0 .1-.1.1-.2.2-1.7.6-2.8 1-2.9 1l-.6.3v12.1l.6.2c.1 0 1.1.399 2.7.899.1 0 .2.101.2.199C6.3 34.4 12.9 39 20.5 39c7.602 0 14.102-4.6 16.9-11.1 0-.102.1-.102.199-.2 1.699-.601 2.699-1 2.801-1l.6-.3V14.3l-.5-.2zM6.701 11.5C9.7 7 14.8 4 20.5 4c5.8 0 10.9 3 13.8 7.5.2.3-.1.6-.399.5-3.799-1-8.799-2-13.6-2-4.7 0-9.5 1-13.2 2-.3.1-.5-.2-.4-.5zM25.1 20.3L18.7 24c-.3.2-.7 0-.7-.5v-7.4c0-.4.4-.6.7-.4l6.399 3.8c.301.1.301.6.001.8zm9.4 8.901A16.421 16.421 0 0 1 20.5 37c-5.9 0-11.1-3.1-14-7.898-.2-.302.1-.602.4-.5 3.9 1 8.9 2.1 13.6 2.1 5 0 9.9-1 13.602-2 .298-.1.5.198.398.499z"/>\x3c!--Created by Nick Bluth from the Noun Project--\x3e</svg>',t.ICONS["play.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 41 41"><path d="M40.5 14.1c-.1-.1-1.2-.5-2.899-1-.101 0-.2-.1-.2-.2C34.5 6.5 28 2 20.5 2S6.6 6.5 3.7 12.9c0 .1-.1.1-.2.2-1.7.6-2.8 1-2.9 1l-.6.3v12.1l.6.2c.1 0 1.1.4 2.7.9.1 0 .2.1.2.199C6.3 34.4 12.9 39 20.5 39c7.601 0 14.101-4.6 16.9-11.1 0-.101.1-.101.2-.2 1.699-.6 2.699-1 2.8-1l.6-.3V14.3l-.5-.2zM20.5 4c5.8 0 10.9 3 13.8 7.5.2.3-.1.6-.399.5-3.8-1-8.8-2-13.6-2-4.7 0-9.5 1-13.2 2-.3.1-.5-.2-.4-.5C9.7 7 14.8 4 20.5 4zm0 33c-5.9 0-11.1-3.1-14-7.899-.2-.301.1-.601.4-.5 3.9 1 8.9 2.1 13.6 2.1 5 0 9.9-1 13.601-2 .3-.1.5.2.399.5A16.422 16.422 0 0 1 20.5 37zm18.601-12.1c0 .1-.101.3-.2.3-2.5.9-10.4 3.6-18.4 3.6-7.1 0-15.6-2.699-18.3-3.6C2.1 25.2 2 25 2 24.9V16c0-.1.1-.3.2-.3 2.6-.9 10.6-3.6 18.2-3.6 7.5 0 15.899 2.7 18.5 3.6.1 0 .2.2.2.3v8.9z"/><path d="M18.7 24l6.4-3.7c.3-.2.3-.7 0-.8l-6.4-3.8c-.3-.2-.7 0-.7.4v7.4c0 .5.4.7.7.5z"/>\x3c!--Created by Nick Bluth from the Noun Project--\x3e</svg>',t.ICONS["stereo.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -2 16 16"><path d="M13.104 0H2.896C2.332 0 1 .392 1 .875h14C15 .392 13.668 0 13.104 0zM15 1H1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h3.534a2 2 0 0 0 1.821-1.172l1.19-2.618a.5.5 0 0 1 .91 0l1.19 2.618A2 2 0 0 0 11.466 11H15a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM4 7a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm8 0a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"/>\x3c!--Created by Idevã Batista from the Noun Project--\x3e</svg>',t.ICONS["zoom-in.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M14.043 12.22a7.738 7.738 0 1 0-1.823 1.822l4.985 4.985c.503.504 1.32.504 1.822 0a1.285 1.285 0 0 0 0-1.822l-4.984-4.985zm-6.305 1.043a5.527 5.527 0 1 1 0-11.053 5.527 5.527 0 0 1 0 11.053z"/><path d="M8.728 4.009H6.744v2.737H4.006V8.73h2.738v2.736h1.984V8.73h2.737V6.746H8.728z"/>\x3c!--Created by Ryan Canning from the Noun Project--\x3e</svg>',t.ICONS["zoom-out.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M14.043 12.22a7.738 7.738 0 1 0-1.823 1.822l4.985 4.985c.503.504 1.32.504 1.822 0a1.285 1.285 0 0 0 0-1.822l-4.984-4.985zm-6.305 1.043a5.527 5.527 0 1 1 0-11.053 5.527 5.527 0 0 1 0 11.053z"/><path d="M4.006 6.746h7.459V8.73H4.006z"/>\x3c!--Created by Ryan Canning from the Noun Project--\x3e</svg>',t}),t("skylark-sphere/_psv/events",["./ctoc","../PSVUtils","../PSVAnimation"],function(t,e,o){"use strict";return t.prototype._bindEvents=function(){window.addEventListener("resize",this),this.config.mousemove&&(this.hud.container.style.cursor="move",this.config.mousemove_hover?(this.hud.container.addEventListener("mouseenter",this),this.hud.container.addEventListener("mouseleave",this)):(this.hud.container.addEventListener("mousedown",this),window.addEventListener("mouseup",this)),this.hud.container.addEventListener("touchstart",this),window.addEventListener("touchend",this),this.hud.container.addEventListener("mousemove",this),this.hud.container.addEventListener("touchmove",this)),t.SYSTEM.fullscreenEvent&&document.addEventListener(t.SYSTEM.fullscreenEvent,this),this.config.mousewheel&&this.hud.container.addEventListener(t.SYSTEM.mouseWheelEvent,this),this.on("_side-reached",function(t){this.isAutorotateEnabled()&&("left"!==t&&"right"!==t||this._reverseAutorotate())})},t.prototype._unbindEvents=function(){window.removeEventListener("resize",this),this.config.mousemove&&(this.hud.container.removeEventListener("mousedown",this),this.hud.container.removeEventListener("mouseenter",this),this.hud.container.removeEventListener("touchstart",this),window.removeEventListener("mouseup",this),window.removeEventListener("touchend",this),this.hud.container.removeEventListener("mouseleave",this),this.hud.container.removeEventListener("mousemove",this),this.hud.container.removeEventListener("touchmove",this)),t.SYSTEM.fullscreenEvent&&document.removeEventListener(t.SYSTEM.fullscreenEvent,this),this.config.mousewheel&&this.hud.container.removeEventListener(t.SYSTEM.mouseWheelEvent,this),this.off("_side-reached")},t.prototype.handleEvent=function(o){switch(o.type){case"resize":e.throttle(this._onResize(),50);break;case"keydown":this._onKeyDown(o);break;case"mousedown":case"mouseenter":this._onMouseDown(o);break;case"touchstart":this._onTouchStart(o);break;case"mouseup":case"mouseleave":this._onMouseUp(o);break;case"touchend":this._onTouchEnd(o);break;case"mousemove":this._onMouseMove(o);break;case"touchmove":this._onTouchMove(o);break;case t.SYSTEM.fullscreenEvent:this._fullscreenToggled();break;case t.SYSTEM.mouseWheelEvent:this._onMouseWheel(o)}},t.prototype._onResize=function(){this.container.clientWidth===this.prop.size.width&&this.container.clientHeight===this.prop.size.height||(this.prop.size.width=parseInt(this.container.clientWidth),this.prop.size.height=parseInt(this.container.clientHeight),this.prop.aspect=this.prop.size.width/this.prop.size.height,this.needsUpdate(),this.renderer&&(this.stereoEffect||this.renderer).setSize(this.prop.size.width,this.prop.size.height),this.trigger("size-updated",this.getSize()))},t.prototype._onKeyDown=function(t){var o=0,i=0,n=0,s=e.getEventKey(t),r=this.config.keyboard[s];switch(r){case"rotateLatitudeUp":i=.01;break;case"rotateLatitudeDown":i=-.01;break;case"rotateLongitudeRight":o=.01;break;case"rotateLongitudeLeft":o=-.01;break;case"zoomIn":n=1;break;case"zoomOut":n=-1;break;case"toggleAutorotate":this.toggleAutorotate()}0!==n?this.zoom(this.prop.zoom_lvl+n*this.config.zoom_speed):0===i&&0===o||this.rotate({longitude:this.prop.position.longitude+o*this.prop.move_speed*this.prop.hFov,latitude:this.prop.position.latitude+i*this.prop.move_speed*this.prop.vFov})},t.prototype._onMouseDown=function(t){this._startMove(t)},t.prototype._onMouseUp=function(t){this._stopMove(t),this.isStereoEnabled()&&this.stopStereoView()},t.prototype._onMouseMove=function(t){0!==t.buttons?(t.preventDefault(),this._move(t)):this.config.mousemove_hover&&this._moveAbsolute(t)},t.prototype._onTouchStart=function(t){1===t.touches.length?this.config.touchmove_two_fingers||this._startMove(t.touches[0]):2===t.touches.length&&this._startMoveZoom(t)},t.prototype._onTouchEnd=function(t){1===t.touches.length?this._stopMoveZoom():0===t.touches.length&&(this._stopMove(t.changedTouches[0]),this.config.touchmove_two_fingers&&this.overlay.hideOverlay())},t.prototype._onTouchMove=function(e){1===e.touches.length?this.config.touchmove_two_fingers?this.overlay.showOverlay({image:t.ICONS["gesture.svg"],text:this.config.lang.two_fingers[0]}):(e.preventDefault(),this._move(e.touches[0])):2===e.touches.length&&(e.preventDefault(),this._moveZoom(e))},t.prototype._startMove=function(t){this.stopAutorotate(),this.stopAnimation().then(function(){this.prop.mouse_x=this.prop.start_mouse_x=parseInt(t.clientX),this.prop.mouse_y=this.prop.start_mouse_y=parseInt(t.clientY),this.prop.moving=!0,this.prop.zooming=!1,this.prop.mouse_history.length=0,this._logMouseMove(t)}.bind(this))},t.prototype._startMoveZoom=function(t){var e=[{x:parseInt(t.touches[0].clientX),y:parseInt(t.touches[0].clientY)},{x:parseInt(t.touches[1].clientX),y:parseInt(t.touches[1].clientY)}];this.prop.pinch_dist=Math.sqrt(Math.pow(e[0].x-e[1].x,2)+Math.pow(e[0].y-e[1].y,2)),this.prop.mouse_x=this.prop.start_mouse_x=(e[0].x+e[1].x)/2,this.prop.mouse_y=this.prop.start_mouse_x=(e[0].y+e[1].y)/2,this.prop.moving=!0,this.prop.zooming=!0},t.prototype._stopMove=function(o){e.getClosest(o.target,".psv-hud")&&this.prop.moving&&(Math.abs(o.clientX-this.prop.start_mouse_x)<t.MOVE_THRESHOLD&&Math.abs(o.clientY-this.prop.start_mouse_y)<t.MOVE_THRESHOLD?(this._click(o),this.prop.moving=!1):this.config.move_inertia&&!this.isGyroscopeEnabled()?(this._logMouseMove(o),this._stopMoveInertia(o)):this.prop.moving=!1,this.prop.mouse_history.length=0)},t.prototype._stopMoveZoom=function(){this.prop.mouse_history.length=0,this.prop.moving=!1,this.prop.zooming=!1},t.prototype._stopMoveInertia=function(e){var i={x:e.clientX-this.prop.mouse_history[0][1],y:e.clientY-this.prop.mouse_history[0][2]},n=Math.sqrt(i.x*i.x+i.y*i.y);this.prop.animation_promise=new o({properties:{clientX:{start:e.clientX,end:e.clientX+i.x},clientY:{start:e.clientY,end:e.clientY+i.y}},duration:n*t.INERTIA_WINDOW/100,easing:"outCirc",onTick:function(t){this._move(t,!1)}.bind(this)}).finally(function(){this.prop.moving=!1}.bind(this))},t.prototype._click=function(o){var i=this.container.getBoundingClientRect(),n={target:o.target,client_x:o.clientX,client_y:o.clientY,viewer_x:parseInt(o.clientX-i.left),viewer_y:parseInt(o.clientY-i.top)},s=this.viewerCoordsToVector3({x:n.viewer_x,y:n.viewer_y});if(s){var r=this.vector3ToSphericalCoords(s);if(n.longitude=r.longitude,n.latitude=r.latitude,!this.prop.isCubemap){var a=this.sphericalCoordsToTextureCoords({longitude:n.longitude,latitude:n.latitude});n.texture_x=a.x,n.texture_y=a.y}this.prop.dblclick_timeout?(Math.abs(this.prop.dblclick_data.client_x-n.client_x)<t.MOVE_THRESHOLD&&Math.abs(this.prop.dblclick_data.client_y-n.client_y)<t.MOVE_THRESHOLD&&this.trigger("dblclick",this.prop.dblclick_data),clearTimeout(this.prop.dblclick_timeout),this.prop.dblclick_timeout=null,this.prop.dblclick_data=null):(this.trigger("click",n),this.prop.dblclick_data=e.clone(n),this.prop.dblclick_timeout=setTimeout(function(){this.prop.dblclick_timeout=null,this.prop.dblclick_data=null}.bind(this),t.DBLCLICK_DELAY))}},t.prototype._move=function(e,o){if(this.prop.moving){var i=parseInt(e.clientX),n=parseInt(e.clientY),s={longitude:(i-this.prop.mouse_x)/this.prop.size.width*this.prop.move_speed*this.prop.hFov*t.SYSTEM.pixelRatio,latitude:(n-this.prop.mouse_y)/this.prop.size.height*this.prop.move_speed*this.prop.vFov*t.SYSTEM.pixelRatio};this.isGyroscopeEnabled()?this.prop.gyro_alpha_offset+=s.longitude:this.rotate({longitude:this.prop.position.longitude-s.longitude,latitude:this.prop.position.latitude+s.latitude}),this.prop.mouse_x=i,this.prop.mouse_y=n,!1!==o&&this._logMouseMove(e)}},t.prototype._moveAbsolute=function(t){this.prop.moving&&this.rotate({longitude:((t.clientX-this.container.offsetLeft)/this.container.offsetWidth-.5)*e.TwoPI,latitude:-((t.clientY-this.container.offsetTop)/this.container.offsetHeight-.5)*Math.PI})},t.prototype._moveZoom=function(t){if(this.prop.zooming&&this.prop.moving){var e=[{x:parseInt(t.touches[0].clientX),y:parseInt(t.touches[0].clientY)},{x:parseInt(t.touches[1].clientX),y:parseInt(t.touches[1].clientY)}],o=Math.sqrt(Math.pow(e[0].x-e[1].x,2)+Math.pow(e[0].y-e[1].y,2)),i=80*(o-this.prop.pinch_dist)/this.prop.size.width;this.zoom(this.prop.zoom_lvl+i),this._move({clientX:(e[0].x+e[1].x)/2,clientY:(e[0].y+e[1].y)/2}),this.prop.pinch_dist=o}},t.prototype._onMouseWheel=function(t){t.preventDefault(),t.stopPropagation();var o=5*e.normalizeWheel(t).spinY;0!==o&&this.zoom(this.prop.zoom_lvl-o*this.config.mousewheel_factor)},t.prototype._fullscreenToggled=function(){var t=this.isFullscreenEnabled();this.config.keyboard&&(t?this.startKeyboardControl():this.stopKeyboardControl()),this.trigger("fullscreen-updated",t)},t.prototype._logMouseMove=function(e){var o=Date.now();this.prop.mouse_history.push([o,e.clientX,e.clientY]);for(var i=null,n=0;n<this.prop.mouse_history.length;)this.prop.mouse_history[0][n]<o-t.INERTIA_WINDOW?this.prop.mouse_history.splice(n,1):i&&this.prop.mouse_history[0][n]-i>t.INERTIA_WINDOW/10?(this.prop.mouse_history.splice(0,n),n=0,i=this.prop.mouse_history[0][n]):(n++,i=this.prop.mouse_history[0][n])},t}),t("skylark-sphere/_psv/utils",["skylark-threejs","./ctoc","../PSVUtils","../PSVError"],function(t,e,o,i){"use strict";return e._loadSystem=function(){var t=e.SYSTEM;t.loaded=!0,t.pixelRatio=window.devicePixelRatio||1,t.isWebGLSupported=o.isWebGLSupported(),t.isCanvasSupported=o.isCanvasSupported(),t.maxTextureWidth=t.isWebGLSupported?o.getMaxTextureWidth():4096,t.mouseWheelEvent=o.mouseWheelEvent(),t.fullscreenEvent=o.fullscreenEvent(),t.deviceOrientationSupported=o.isDeviceOrientationSupported(),t.touchEnabled=o.isTouchEnabled()},e.prototype._setViewerSize=function(t){["width","height"].forEach(function(e){t[e]&&(/^[0-9.]+$/.test(t[e])&&(t[e]+="px"),this.parent.style[e]=t[e])},this)},e.prototype.speedToDuration=function(t,e){if(t&&"number"==typeof t)return Math.abs(t);var i=t?o.parseSpeed(t):this.config.anim_speed;return e/Math.abs(i)*1e3},e.prototype.textureCoordsToSphericalCoords=function(t){if(this.prop.isCubemap)throw new i("Unable to use texture coords with cubemap.");var e=(t.x+this.prop.pano_data.cropped_x)/this.prop.pano_data.full_width*o.TwoPI,n=(t.y+this.prop.pano_data.cropped_y)/this.prop.pano_data.full_height*Math.PI;return{longitude:e>=Math.PI?e-Math.PI:e+Math.PI,latitude:o.HalfPI-n}},e.prototype.sphericalCoordsToTextureCoords=function(t){if(this.prop.isCubemap)throw new i("Unable to use texture coords with cubemap.");var e=t.longitude/o.TwoPI*this.prop.pano_data.full_width,n=t.latitude/Math.PI*this.prop.pano_data.full_height;return{x:parseInt(t.longitude<Math.PI?e+this.prop.pano_data.full_width/2:e-this.prop.pano_data.full_width/2)-this.prop.pano_data.cropped_x,y:parseInt(this.prop.pano_data.full_height/2-n)-this.prop.pano_data.cropped_y}},e.prototype.sphericalCoordsToVector3=function(o){return new t.Vector3(e.SPHERE_RADIUS*-Math.cos(o.latitude)*Math.sin(o.longitude),e.SPHERE_RADIUS*Math.sin(o.latitude),e.SPHERE_RADIUS*Math.cos(o.latitude)*Math.cos(o.longitude))},e.prototype.vector3ToSphericalCoords=function(t){var e=Math.acos(t.y/Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)),i=Math.atan2(t.x,t.z);return{longitude:i<0?-i:o.TwoPI-i,latitude:o.HalfPI-e}},e.prototype.viewerCoordsToVector3=function(e){var o=new t.Vector2(2*e.x/this.prop.size.width-1,-2*e.y/this.prop.size.height+1);this.raycaster.setFromCamera(o,this.camera);var i=this.raycaster.intersectObjects(this.scene.children);return 1===i.length?i[0].point:null},e.prototype.vector3ToViewerCoords=function(t){return(t=t.clone()).project(this.camera),{x:parseInt((t.x+1)/2*this.prop.size.width),y:parseInt((1-t.y)/2*this.prop.size.height)}},e.prototype.cleanPosition=function(t){t.hasOwnProperty("x")&&t.hasOwnProperty("y")&&o.deepmerge(t,this.textureCoordsToSphericalCoords(t)),t.longitude=o.parseAngle(t.longitude),t.latitude=o.parseAngle(t.latitude,!0)},e.prototype.cleanSphereCorrection=function(t){t.pan=o.parseAngle(t.pan||0),t.tilt=o.parseAngle(t.tilt||0,!0),t.roll=o.parseAngle(t.roll||0,!0,!1)},e.prototype.isExtendedPosition=function(t){return[["x","y"],["longitude","latitude"]].some(function(e){return e[0]in t&&e[1]in t})},e.prototype.applyRanges=function(e){var i,n,s=[];return this.config.longitude_range&&(i=o.clone(this.config.longitude_range),n=t.Math.degToRad(this.prop.hFov)/2,i[0]=o.parseAngle(i[0]+n),i[1]=o.parseAngle(i[1]-n),i[0]>i[1]?e.longitude>i[1]&&e.longitude<i[0]&&(e.longitude>i[0]/2+i[1]/2?(e.longitude=i[0],s.push("left")):(e.longitude=i[1],s.push("right"))):e.longitude<i[0]?(e.longitude=i[0],s.push("left")):e.longitude>i[1]&&(e.longitude=i[1],s.push("right"))),this.config.latitude_range&&(i=o.clone(this.config.latitude_range),n=t.Math.degToRad(this.prop.vFov)/2,i[0]=o.parseAngle(Math.min(i[0]+n,i[1]),!0),i[1]=o.parseAngle(Math.max(i[1]-n,i[0]),!0),e.latitude<i[0]?(e.latitude=i[0],s.push("bottom")):e.latitude>i[1]&&(e.latitude=i[1],s.push("top"))),s},e}),t("skylark-sphere/PhotoSphereViewer",["skylark-threejs","./_psv/ctoc","./PSVError","./PSVUtils","./PSVMarker","./PSVAnimation","./_psv/core","./_psv/defaults","./_psv/events","./_psv/utils"],function(t,e,o,i,n,s){"use strict";return e.prototype.load=function(){if(!this.config.panorama)throw new o("No value given for panorama.");return this.setPanorama(this.config.panorama,!1)},e.prototype.getPosition=function(){return{longitude:this.prop.position.longitude,latitude:this.prop.position.latitude}},e.prototype.getZoomLevel=function(){return this.prop.zoom_lvl},e.prototype.getSize=function(){return{width:this.prop.size.width,height:this.prop.size.height}},e.prototype.isAutorotateEnabled=function(){return!!this.prop.autorotate_cb},e.prototype.isGyroscopeEnabled=function(){return!!this.prop.orientation_cb},e.prototype.isStereoEnabled=function(){return!!this.stereoEffect},e.prototype.isFullscreenEnabled=function(){return i.isFullscreenEnabled(this.container)},e.prototype.needsUpdate=function(){this.prop.needsUpdate=!0},e.prototype.render=function(){this._render()},e.prototype.destroy=function(){window.cancelAnimationFrame(this.prop.main_reqid),this._stopAll(),this.stopKeyboardControl(),this.stopNoSleep(),this.exitFullscreen(),this.unlockOrientation(),this._unbindEvents(),this.tooltip&&this.tooltip.destroy(),this.notification&&this.notification.destroy(),this.hud&&this.hud.destroy(),this.loader&&this.loader.destroy(),this.navbar&&this.navbar.destroy(),this.panel&&this.panel.destroy(),this.overlay&&this.overlay.destroy(),this.scene&&i.cleanTHREEScene(this.scene),this.canvas_container&&this.container.removeChild(this.canvas_container),this.parent.removeChild(this.container),delete this.parent.photoSphereViewer,delete this.parent,delete this.container,delete this.loader,delete this.navbar,delete this.hud,delete this.panel,delete this.tooltip,delete this.notification,delete this.overlay,delete this.canvas_container,delete this.renderer,delete this.noSleep,delete this.scene,delete this.camera,delete this.mesh,delete this.raycaster,delete this.passes,delete this.config,this.prop.cache.length=0},e.prototype.setPanorama=function(t,e,i){if(null!==this.prop.loading_promise)throw new o("Loading already in progress");"boolean"==typeof e&&(i=e,e=void 0),e||this.scene?e||(e={}):e={longitude:this.config.default_long,latitude:this.config.default_lat,zoom:this.config.default_zoom_lvl,sphere_correction:this.config.sphere_correction};var n=this.isExtendedPosition(e),s="zoom"in e;(n||s)&&this._stopAll(),this.config.panorama=t;var r=function(){this.loader.hide(),this.canvas_container.style.opacity=1,this.prop.loading_promise=null}.bind(this);return i&&this.config.transition&&this.scene?(this.config.transition.loader&&this.loader.show(),this.prop.loading_promise=this._loadTexture(this.config.panorama).then(function(t){return this.loader.hide(),this._transition(t,e)}.bind(this)).then(r,r)):(this.loader.show(),this.canvas_container&&(this.canvas_container.style.opacity=0),this.prop.loading_promise=this._loadTexture(this.config.panorama).then(function(t){this._setTexture(t),e.sphere_correction&&!this.prop.isCubemap&&this._setSphereCorrection(this.mesh,e.sphere_correction),n&&this.rotate(e),s&&this.zoom(e.zoom)}.bind(this)).then(r,r)),this.prop.loading_promise},e.prototype.startAutorotate=function(){this._stopAll(),this.prop.autorotate_cb=this._getAutorotateUpdate(),this.on("before-render",this.prop.autorotate_cb),this.trigger("autorotate",!0)},e.prototype._getAutorotateUpdate=function(){var t,e;return function(o){e=void 0===t?0:o-t,t=o,this.rotate({longitude:this.prop.position.longitude+this.config.anim_speed*e/1e3,latitude:this.prop.position.latitude-(this.prop.position.latitude-this.config.anim_lat)/200})}},e.prototype.stopAutorotate=function(){this.prop.start_timeout&&(window.clearTimeout(this.prop.start_timeout),this.prop.start_timeout=null),this.isAutorotateEnabled()&&(this.off("before-render",this.prop.autorotate_cb),this.prop.autorotate_cb=null,this.trigger("autorotate",!1))},e.prototype.toggleAutorotate=function(){this.isAutorotateEnabled()?this.stopAutorotate():this.startAutorotate()},e.prototype.startGyroscopeControl=function(){if(i.checkTHREE("DeviceOrientationControls"))return e.SYSTEM.deviceOrientationSupported.then(function(e){if(!e)return console.warn("PhotoSphereViewer: gyroscope not available"),Promise.reject();this._stopAll(),this.doControls=new t.DeviceOrientationControls(this.camera),this.doControls.alphaOffset=this.prop.position.longitude,this.doControls.update();var o=this.camera.getWorldDirection(new t.Vector3),i=this.vector3ToSphericalCoords(o);this.prop.gyro_alpha_offset=i.longitude,this.prop.orientation_cb=this._getOrientationUpdate(),this.on("before-render",this.prop.orientation_cb),this.trigger("gyroscope-updated",!0)}.bind(this));throw new o("Missing Three.js components: DeviceOrientationControls. Get them from three.js-examples package.")},e.prototype._getOrientationUpdate=function(){return function(){this.doControls.alphaOffset=this.prop.gyro_alpha_offset,this.doControls.update(),this.camera.getWorldDirection(this.prop.direction),this.prop.direction.multiplyScalar(e.SPHERE_RADIUS);var t=this.vector3ToSphericalCoords(this.prop.direction);this.prop.position.longitude=t.longitude,this.prop.position.latitude=t.latitude,this.needsUpdate()}},e.prototype.stopGyroscopeControl=function(){this.isGyroscopeEnabled()&&(this.off("before-render",this.prop.orientation_cb),this.prop.orientation_cb=null,this.doControls.disconnect(),this.doControls=null,this.trigger("gyroscope-updated",!1))},e.prototype.toggleGyroscopeControl=function(){this.isGyroscopeEnabled()?this.stopGyroscopeControl():this.startGyroscopeControl()},e.prototype.startNoSleep=function(){"NoSleep"in window?(this.noSleep||(this.noSleep=new NoSleep),this.noSleep.enable()):console.warn("PhotoSphereViewer: NoSleep is not available")},e.prototype.stopNoSleep=function(){this.noSleep&&this.noSleep.disable()},e.prototype.startStereoView=function(){if(!i.checkTHREE("DeviceOrientationControls","StereoEffect"))throw new o("Missing Three.js components: StereoEffect, DeviceOrientationControls. Get them from three.js-examples package.");this.startNoSleep(),this.enterFullscreen(),this.lockOrientation(),this.startGyroscopeControl().then(function(){this.stereoEffect=new t.StereoEffect(this.renderer),this.needsUpdate(),this.hud.hide(),this.navbar.hide(),this.panel.hidePanel(),this.trigger("stereo-updated",!0),this.notification.showNotification({content:this.config.lang.stereo_notification,timeout:3e3})}.bind(this),function(){this.unlockOrientation(),this.exitFullscreen(),this.stopNoSleep()}.bind(this))},e.prototype.stopStereoView=function(){this.isStereoEnabled()&&(this.stereoEffect=null,this.needsUpdate(),this.hud.show(),this.navbar.show(),this.unlockOrientation(),this.exitFullscreen(),this.stopNoSleep(),this.stopGyroscopeControl(),this.trigger("stereo-updated",!1))},e.prototype.lockOrientation=function(){var t,o=function(){this.isStereoEnabled()&&window.innerHeight>window.innerWidth&&this.overlay.showOverlay({image:e.ICONS["mobile-rotate.svg"],text:this.config.lang.please_rotate[0],subtext:this.config.lang.please_rotate[1]}),t&&window.clearTimeout(t)};window.screen&&window.screen.orientation?(window.screen.orientation.lock("landscape").then(null,o.bind(this)),t=setTimeout(o.bind(this),500)):o.apply(this)},e.prototype.unlockOrientation=function(){window.screen&&window.screen.orientation?window.screen.orientation.unlock():this.overlay.hideOverlay()},e.prototype.toggleStereoView=function(){this.isStereoEnabled()?this.stopStereoView():this.startStereoView()},e.prototype.rotate=function(t,e){this.cleanPosition(t),e||this.applyRanges(t).forEach(this.trigger.bind(this,"_side-reached")),this.prop.position.longitude=t.longitude,this.prop.position.latitude=t.latitude,this.needsUpdate(),this.trigger("position-updated",this.getPosition())},e.prototype.animate=function(t,o){this._stopAll();var n,r=this.isExtendedPosition(t),a="zoom"in t,h={};if(r){this.cleanPosition(t),this.applyRanges(t);var p=this.prop.position,c=Math.abs(t.longitude-p.longitude),l=Math.abs(t.latitude-p.latitude);if(c>=e.ANGLE_THRESHOLD||l>=e.ANGLE_THRESHOLD){var u=i.getShortestArc(this.prop.position.longitude,t.longitude);h.longitude={start:p.longitude,end:p.longitude+u},h.latitude={start:p.latitude,end:t.latitude},n=this.speedToDuration(o,i.getAngle(p,t))}}if(a){var d=Math.abs(t.zoom-this.prop.zoom_lvl);d>=1&&(h.zoom={start:this.prop.zoom_lvl,end:t.zoom},n||(n=this.speedToDuration(o,Math.PI/4*d/100)))}return n?(this.prop.animation_promise=new s({properties:h,duration:n,easing:"inOutSine",onTick:function(t){r&&this.rotate(t,!0),a&&this.zoom(t.zoom)}.bind(this)}),this.prop.animation_promise):(r&&this.rotate(t),a&&this.zoom(t.zoom),s.resolve())},e.prototype.stopAnimation=function(){return this.prop.animation_promise?new Promise(function(t){this.prop.animation_promise.finally(t),this.prop.animation_promise.cancel(),this.prop.animation_promise=null}.bind(this)):Promise.resolve()},e.prototype.zoom=function(e){this.prop.zoom_lvl=i.bound(e,0,100),this.prop.vFov=this.config.max_fov+this.prop.zoom_lvl/100*(this.config.min_fov-this.config.max_fov),this.prop.hFov=t.Math.radToDeg(2*Math.atan(Math.tan(t.Math.degToRad(this.prop.vFov)/2)*this.prop.aspect)),this.needsUpdate(),this.trigger("zoom-updated",this.getZoomLevel())},e.prototype.zoomIn=function(){this.prop.zoom_lvl<100&&this.zoom(this.prop.zoom_lvl+this.config.zoom_speed)},e.prototype.zoomOut=function(){this.prop.zoom_lvl>0&&this.zoom(this.prop.zoom_lvl-this.config.zoom_speed)},e.prototype.resize=function(t){t.width&&(this.container.style.width=t.width),t.height&&(this.container.style.height=t.height),this._onResize()},e.prototype.enterFullscreen=function(){i.requestFullscreen(this.container)},e.prototype.exitFullscreen=function(){this.isFullscreenEnabled()&&i.exitFullscreen()},e.prototype.toggleFullscreen=function(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()},e.prototype.startKeyboardControl=function(){window.addEventListener("keydown",this)},e.prototype.stopKeyboardControl=function(){window.removeEventListener("keydown",this)},e.prototype.preloadPanorama=function(t){if(!this.config.cache_texture)throw new o("Cannot preload panorama, cache_texture is disabled");return this._loadTexture(t)},e.prototype.clearPanoramaCache=function(t){if(!this.config.cache_texture)throw new o("Cannot clear cache, cache_texture is disabled");if(t){for(var e=0,i=this.prop.cache.length;e<i;e++)if(this.prop.cache[e].panorama===t){this.prop.cache.splice(e,1);break}}else this.prop.cache.length=0},e.prototype.getPanoramaCache=function(t){if(!this.config.cache_texture)throw new o("Cannot query cache, cache_texture is disabled");return this.prop.cache.filter(function(e){return e.panorama===t}).shift()},e.Error=o,e}),t("skylark-sphere/main",["./PhotoSphereViewer"],function(t){return t}),t("skylark-sphere",["skylark-sphere/main"],function(t){return t})}(o),!i){var r=require("skylark-langx-ns");n?module.exports=r:e.skylarkjs=r}}(0,this);
//# sourceMappingURL=sourcemaps/skylark-sphere.js.map
