Ver código fonte

Build eeb9383.

pull/952/head
strarsis 4 anos atrás
pai
commit
0aaa667121
3 arquivos alterados com 237 adições e 226 exclusões
  1. +2
    -2
      build/pannellum.css
  2. +119
    -113
      build/pannellum.htm
  3. +116
    -111
      build/pannellum.js

+ 2
- 2
build/pannellum.css
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 119
- 113
build/pannellum.htm
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 116
- 111
build/pannellum.js Ver arquivo

@@ -1,111 +1,116 @@
// Pannellum 0d32eea, https://github.com/mpetroff/pannellum
window.libpannellum=function(E,g,p){function Ba(K){function ja(a,e){return 1==a.level&&1!=e.level?-1:1==e.level&&1!=a.level?1:e.timestamp-a.timestamp}function Q(a,e){return a.level!=e.level?a.level-e.level:a.diff-e.diff}function ka(a,e,c,g,l,f){this.vertices=a;this.side=e;this.level=c;this.x=g;this.y=l;this.path=f.replace("%s",e).replace("%l",c).replace("%x",g).replace("%y",l)}function Ja(a,e,g,p,l){var f;var d=e.vertices;f=la(a,d.slice(0,3));var u=la(a,d.slice(3,6)),x=la(a,d.slice(6,9)),d=la(a,d.slice(9,
12)),t=f[0]+u[0]+x[0]+d[0];-4==t||4==t?f=!1:(t=f[1]+u[1]+x[1]+d[1],f=-4==t||4==t?!1:4!=f[2]+u[2]+x[2]+d[2]);if(f){f=e.vertices;u=f[0]+f[3]+f[6]+f[9];x=f[1]+f[4]+f[7]+f[10];d=f[2]+f[5]+f[8]+f[11];t=Math.sqrt(u*u+x*x+d*d);d=Math.asin(d/t);u=Math.atan2(x,u)-p;u+=u>Math.PI?-2*Math.PI:u<-Math.PI?2*Math.PI:0;u=Math.abs(u);e.diff=Math.acos(Math.sin(g)*Math.sin(d)+Math.cos(g)*Math.cos(d)*Math.cos(u));u=!1;for(x=0;x<c.nodeCache.length;x++)if(c.nodeCache[x].path==e.path){u=!0;c.nodeCache[x].timestamp=c.nodeCacheTimestamp++;
c.nodeCache[x].diff=e.diff;c.currentNodes.push(c.nodeCache[x]);break}u||(e.timestamp=c.nodeCacheTimestamp++,c.currentNodes.push(e),c.nodeCache.push(e));if(e.level<c.level){var d=m.cubeResolution*Math.pow(2,e.level-m.maxLevel),u=Math.ceil(d*m.invTileResolution)-1,x=d%m.tileResolution*2,k=2*d%m.tileResolution;0===k&&(k=m.tileResolution);0===x&&(x=2*m.tileResolution);t=0.5;if(e.x==u||e.y==u)t=1-m.tileResolution/(m.tileResolution+k);var y=1-t,d=[],r=t,z=t,D=t,I=y,A=y,B=y;if(k<m.tileResolution)if(e.x==
u&&e.y!=u){if(A=z=0.5,"d"==e.side||"u"==e.side)B=D=0.5}else e.x!=u&&e.y==u&&(I=r=0.5,"l"==e.side||"r"==e.side)&&(B=D=0.5);x<=m.tileResolution&&(e.x==u&&(r=0,I=1,"l"==e.side||"r"==e.side)&&(D=0,B=1),e.y==u&&(z=0,A=1,"d"==e.side||"u"==e.side)&&(D=0,B=1));k=[f[0],f[1],f[2],f[0]*r+f[3]*I,f[1]*t+f[4]*y,f[2]*D+f[5]*B,f[0]*r+f[6]*I,f[1]*z+f[7]*A,f[2]*D+f[8]*B,f[0]*t+f[9]*y,f[1]*z+f[10]*A,f[2]*D+f[11]*B];k=new ka(k,e.side,e.level+1,2*e.x,2*e.y,m.fullpath);d.push(k);e.x==u&&x<=m.tileResolution||(k=[f[0]*r+
f[3]*I,f[1]*t+f[4]*y,f[2]*D+f[5]*B,f[3],f[4],f[5],f[3]*t+f[6]*y,f[4]*z+f[7]*A,f[5]*D+f[8]*B,f[0]*r+f[6]*I,f[1]*z+f[7]*A,f[2]*D+f[8]*B],k=new ka(k,e.side,e.level+1,2*e.x+1,2*e.y,m.fullpath),d.push(k));e.x==u&&x<=m.tileResolution||e.y==u&&x<=m.tileResolution||(k=[f[0]*r+f[6]*I,f[1]*z+f[7]*A,f[2]*D+f[8]*B,f[3]*t+f[6]*y,f[4]*z+f[7]*A,f[5]*D+f[8]*B,f[6],f[7],f[8],f[9]*r+f[6]*I,f[10]*t+f[7]*y,f[11]*D+f[8]*B],k=new ka(k,e.side,e.level+1,2*e.x+1,2*e.y+1,m.fullpath),d.push(k));e.y==u&&x<=m.tileResolution||
(k=[f[0]*t+f[9]*y,f[1]*z+f[10]*A,f[2]*D+f[11]*B,f[0]*r+f[6]*I,f[1]*z+f[7]*A,f[2]*D+f[8]*B,f[9]*r+f[6]*I,f[10]*t+f[7]*y,f[11]*D+f[8]*B,f[9],f[10],f[11]],k=new ka(k,e.side,e.level+1,2*e.x,2*e.y+1,m.fullpath),d.push(k));for(e=0;e<d.length;e++)Ja(a,d[e],g,p,l)}}}function ta(){return[-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,1,1,-1,1,1,-1,-1]}function ua(a,e,c){var g=Math.sin(e);e=Math.cos(e);
if("x"==c)return[a[0],e*a[1]+g*a[2],e*a[2]-g*a[1],a[3],e*a[4]+g*a[5],e*a[5]-g*a[4],a[6],e*a[7]+g*a[8],e*a[8]-g*a[7]];if("y"==c)return[e*a[0]-g*a[2],a[1],e*a[2]+g*a[0],e*a[3]-g*a[5],a[4],e*a[5]+g*a[3],e*a[6]-g*a[8],a[7],e*a[8]+g*a[6]];if("z"==c)return[e*a[0]+g*a[1],e*a[1]-g*a[0],a[2],e*a[3]+g*a[4],e*a[4]-g*a[3],a[5],e*a[6]+g*a[7],e*a[7]-g*a[6],a[8]]}function ma(a){return[a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15]]}function Ka(a){La(a,a.path+"."+m.extension,
function(e,c){a.texture=e;a.textureLoaded=c?2:1},va.crossOrigin)}function la(a,e){var c=[a[0]*e[0]+a[1]*e[1]+a[2]*e[2],a[4]*e[0]+a[5]*e[1]+a[6]*e[2],a[11]+a[8]*e[0]+a[9]*e[1]+a[10]*e[2],1/(a[12]*e[0]+a[13]*e[1]+a[14]*e[2])],g=c[0]*c[3],l=c[1]*c[3],c=c[2]*c[3],f=[0,0,0];-1>g&&(f[0]=-1);1<g&&(f[0]=1);-1>l&&(f[1]=-1);1<l&&(f[1]=1);if(-1>c||1<c)f[2]=1;return f}function Ea(){console.log("Reducing canvas size due to error 1286!");A.width=Math.round(A.width/2);A.height=Math.round(A.height/2)}var A=g.createElement("canvas");
A.style.width=A.style.height="100%";K.appendChild(A);var c,a,U,V,$,R,wa,ga,m,z,F,ca,Fa,Y,na,va;this.init=function(L,e,Ca,H,l,f,d,u){function x(a){if(E){var e=a*a*4,f=new Uint8ClampedArray(e),c=u.backgroundColor?u.backgroundColor:[0,0,0];c[0]*=255;c[1]*=255;c[2]*=255;for(var b=0;b<e;b++)f[b++]=c[0],f[b++]=c[1],f[b++]=c[2];a=new ImageData(f,a,a);for(t=0;6>t;t++)0==m[t].width&&(m[t]=a)}}e===p&&(e="equirectangular");if("equirectangular"!=e&&"cubemap"!=e&&"multires"!=e)throw console.log("Error: invalid image type specified!"),
{type:"config error"};z=e;m=L;F=Ca;va=u||{};if(c){U&&(a.detachShader(c,U),a.deleteShader(U));V&&(a.detachShader(c,V),a.deleteShader(V));a.bindBuffer(a.ARRAY_BUFFER,null);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,null);c.texture&&a.deleteTexture(c.texture);if(c.nodeCache)for(L=0;L<c.nodeCache.length;L++)a.deleteTexture(c.nodeCache[L].texture);a.deleteProgram(c);c=p}ga=p;var t,E=!1,y;if("cubemap"==z)for(t=0;6>t;t++)0<m[t].width?(y===p&&(y=m[t].width),y!=m[t].width&&console.log("Cube faces have inconsistent widths: "+
y+" vs. "+m[t].width)):E=!0;"cubemap"==z&&0!==(y&y-1)&&(navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/)||navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 9_/)||navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 10_/)||navigator.userAgent.match(/Trident.*rv[ :]*11\./))||(a||(a=A.getContext("experimental-webgl",{alpha:!1,depth:!1})),a&&1286==a.getError()&&Ea());if(!a&&("multires"==z&&m.hasOwnProperty("fallbackPath")||"cubemap"==z)&&("WebkitAppearance"in
g.documentElement.style||navigator.userAgent.match(/Trident.*rv[ :]*11\./)||-1!==navigator.appVersion.indexOf("MSIE 10"))){R&&K.removeChild(R);R=g.createElement("div");R.className="pnlm-world";H=m.basePath?m.basePath+m.fallbackPath:m.fallbackPath;var Q="frblud".split(""),S=0;l=function(){var a=g.createElement("canvas");a.className="pnlm-face pnlm-"+Q[this.side]+"face";R.appendChild(a);var e=a.getContext("2d");a.style.width=this.width+4+"px";a.style.height=this.height+4+"px";a.width=this.width+4;a.height=
this.height+4;e.drawImage(this,2,2);var f=e.getImageData(0,0,a.width,a.height),c=f.data,b,d;for(b=2;b<a.width-2;b++)for(d=0;4>d;d++)c[4*(b+a.width)+d]=c[4*(b+2*a.width)+d],c[4*(b+a.width*(a.height-2))+d]=c[4*(b+a.width*(a.height-3))+d];for(b=2;b<a.height-2;b++)for(d=0;4>d;d++)c[4*(b*a.width+1)+d]=c[4*(b*a.width+2)+d],c[4*((b+1)*a.width-2)+d]=c[4*((b+1)*a.width-3)+d];for(d=0;4>d;d++)c[4*(a.width+1)+d]=c[4*(2*a.width+2)+d],c[4*(2*a.width-2)+d]=c[4*(3*a.width-3)+d],c[4*(a.width*(a.height-2)+1)+d]=c[4*
(a.width*(a.height-3)+2)+d],c[4*(a.width*(a.height-1)-2)+d]=c[4*(a.width*(a.height-2)-3)+d];for(b=1;b<a.width-1;b++)for(d=0;4>d;d++)c[4*b+d]=c[4*(b+a.width)+d],c[4*(b+a.width*(a.height-1))+d]=c[4*(b+a.width*(a.height-2))+d];for(b=1;b<a.height-1;b++)for(d=0;4>d;d++)c[b*a.width*4+d]=c[4*(b*a.width+1)+d],c[4*((b+1)*a.width-1)+d]=c[4*((b+1)*a.width-2)+d];for(d=0;4>d;d++)c[d]=c[4*(a.width+1)+d],c[4*(a.width-1)+d]=c[4*(2*a.width-2)+d],c[a.width*(a.height-1)*4+d]=c[4*(a.width*(a.height-2)+1)+d],c[4*(a.width*
a.height-1)+d]=c[4*(a.width*(a.height-1)-2)+d];e.putImageData(f,0,0);D.call(this)};var D=function(){0<this.width?($===p&&($=this.width),$!=this.width&&console.log("Fallback faces have inconsistent widths: "+$+" vs. "+this.width)):E=!0;S++;6==S&&($=this.width,K.appendChild(R),d())},E=!1;for(t=0;6>t;t++)f=new Image,f.crossOrigin=va.crossOrigin?va.crossOrigin:"anonymous",f.side=t,f.onload=l,f.onerror=D,f.src="multires"==z?H.replace("%s",Q[t])+"."+m.extension:m[t].src;x($)}else{if(!a)throw console.log("Error: no WebGL support detected!"),
{type:"no webgl"};"cubemap"==z&&x(y);m.fullpath=m.basePath?m.basePath+m.path:m.path;m.invTileResolution=1/m.tileResolution;L=ta();wa=[];for(t=0;6>t;t++)wa[t]=L.slice(12*t,12*t+12),L=ta();L=0;if("equirectangular"==z){if(L=a.getParameter(a.MAX_TEXTURE_SIZE),Math.max(m.width/2,m.height)>L)throw console.log("Error: The image is too big; it's "+m.width+"px wide, but this device's maximum supported size is "+2*L+"px."),{type:"webgl size error",width:m.width,maxWidth:2*L};}else if("cubemap"==z&&y>a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE))throw console.log("Error: The image is too big; it's "+
y+"px wide, but this device's maximum supported size is "+L+"px."),{type:"webgl size error",width:y,maxWidth:L};u!==p&&(y=isNaN(u.horizonPitch)?0:Number(u.horizonPitch),e=isNaN(u.horizonRoll)?0:Number(u.horizonRoll),0!=y||0!=e)&&(ga=[y,e]);y=a.TEXTURE_2D;a.viewport(0,0,a.drawingBufferWidth,a.drawingBufferHeight);a.getShaderPrecisionFormat&&(e=a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT))&&1>e.precision&&(oa=oa.replace("highp","mediump"));U=a.createShader(a.VERTEX_SHADER);e=r;"multires"==
z&&(e=k);a.shaderSource(U,e);a.compileShader(U);V=a.createShader(a.FRAGMENT_SHADER);e=pa;"cubemap"==z?(y=a.TEXTURE_CUBE_MAP,e=qa):"multires"==z&&(e=bb);a.shaderSource(V,e);a.compileShader(V);c=a.createProgram();a.attachShader(c,U);a.attachShader(c,V);a.linkProgram(c);a.getShaderParameter(U,a.COMPILE_STATUS)||console.log(a.getShaderInfoLog(U));a.getShaderParameter(V,a.COMPILE_STATUS)||console.log(a.getShaderInfoLog(V));a.getProgramParameter(c,a.LINK_STATUS)||console.log(a.getProgramInfoLog(c));a.useProgram(c);
c.drawInProgress=!1;e=u.backgroundColor?u.backgroundColor:[0,0,0];a.clearColor(e[0],e[1],e[2],1);a.clear(a.COLOR_BUFFER_BIT);c.texCoordLocation=a.getAttribLocation(c,"a_texCoord");a.enableVertexAttribArray(c.texCoordLocation);"multires"!=z?(ca||(ca=a.createBuffer()),a.bindBuffer(a.ARRAY_BUFFER,ca),a.bufferData(a.ARRAY_BUFFER,new Float32Array([-1,1,1,1,1,-1,-1,1,1,-1,-1,-1]),a.STATIC_DRAW),a.vertexAttribPointer(c.texCoordLocation,2,a.FLOAT,!1,0,0),c.aspectRatio=a.getUniformLocation(c,"u_aspectRatio"),
a.uniform1f(c.aspectRatio,a.drawingBufferWidth/a.drawingBufferHeight),c.psi=a.getUniformLocation(c,"u_psi"),c.theta=a.getUniformLocation(c,"u_theta"),c.f=a.getUniformLocation(c,"u_f"),c.h=a.getUniformLocation(c,"u_h"),c.v=a.getUniformLocation(c,"u_v"),c.vo=a.getUniformLocation(c,"u_vo"),c.rot=a.getUniformLocation(c,"u_rot"),a.uniform1f(c.h,H/(2*Math.PI)),a.uniform1f(c.v,l/Math.PI),a.uniform1f(c.vo,f/Math.PI*2),"equirectangular"==z&&(c.backgroundColor=a.getUniformLocation(c,"u_backgroundColor"),a.uniform4fv(c.backgroundColor,
e.concat([1]))),c.texture=a.createTexture(),a.bindTexture(y,c.texture),"cubemap"==z?(a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,m[1]),a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_X,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,m[3]),a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_Y,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,m[4]),a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,m[5]),a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_Z,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,m[0]),a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_Z,
0,a.RGB,a.RGB,a.UNSIGNED_BYTE,m[2])):m.width<=L?(a.uniform1i(a.getUniformLocation(c,"u_splitImage"),0),a.texImage2D(y,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,m)):(a.uniform1i(a.getUniformLocation(c,"u_splitImage"),1),H=g.createElement("canvas"),H.width=m.width/2,H.height=m.height,H=H.getContext("2d"),H.drawImage(m,0,0),l=H.getImageData(0,0,m.width/2,m.height),a.texImage2D(y,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,l),c.texture2=a.createTexture(),a.activeTexture(a.TEXTURE1),a.bindTexture(y,c.texture2),a.uniform1i(a.getUniformLocation(c,
"u_image1"),1),H.drawImage(m,-m.width/2,0),l=H.getImageData(0,0,m.width/2,m.height),a.texImage2D(y,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,l),a.texParameteri(y,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(y,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(y,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(y,a.TEXTURE_MAG_FILTER,a.LINEAR),a.activeTexture(a.TEXTURE0)),a.texParameteri(y,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(y,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(y,a.TEXTURE_MIN_FILTER,
a.LINEAR),a.texParameteri(y,a.TEXTURE_MAG_FILTER,a.LINEAR)):(c.vertPosLocation=a.getAttribLocation(c,"a_vertCoord"),a.enableVertexAttribArray(c.vertPosLocation),Fa||(Fa=a.createBuffer()),Y||(Y=a.createBuffer()),na||(na=a.createBuffer()),a.bindBuffer(a.ARRAY_BUFFER,Y),a.bufferData(a.ARRAY_BUFFER,new Float32Array([0,0,1,0,1,1,0,1]),a.STATIC_DRAW),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,na),a.bufferData(a.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,0,2,3]),a.STATIC_DRAW),c.perspUniform=a.getUniformLocation(c,
"u_perspMatrix"),c.cubeUniform=a.getUniformLocation(c,"u_cubeMatrix"),c.level=-1,c.currentNodes=[],c.nodeCache=[],c.nodeCacheTimestamp=0);H=a.getError();if(0!==H)throw console.log("Error: Something went wrong with WebGL!",H),{type:"webgl error"};d()}};this.destroy=function(){K!==p&&(A!==p&&K.contains(A)&&K.removeChild(A),R!==p&&K.contains(R)&&K.removeChild(R));if(a){var c=a.getExtension("WEBGL_lose_context");c&&c.loseContext()}};this.resize=function(){var g=E.devicePixelRatio||1;A.width=A.clientWidth*
g;A.height=A.clientHeight*g;a&&(1286==a.getError()&&Ea(),a.viewport(0,0,a.drawingBufferWidth,a.drawingBufferHeight),"multires"!=z&&a.uniform1f(c.aspectRatio,A.clientWidth/A.clientHeight))};this.resize();this.setPose=function(a,c){a=isNaN(a)?0:Number(a);c=isNaN(c)?0:Number(c);ga=0==a&&0==c?p:[a,c]};this.render=function(g,e,k,r){var l,f=0;r===p&&(r={});r.roll&&(f=r.roll);if(ga!==p){l=ga[0];var d=ga[1],u=g,x=e,t=Math.cos(d)*Math.sin(g)*Math.sin(l)+Math.cos(g)*(Math.cos(l)*Math.cos(e)+Math.sin(d)*Math.sin(l)*
Math.sin(e)),E=-Math.sin(g)*Math.sin(d)+Math.cos(g)*Math.cos(d)*Math.sin(e);g=Math.cos(d)*Math.cos(l)*Math.sin(g)+Math.cos(g)*(-Math.cos(e)*Math.sin(l)+Math.cos(l)*Math.sin(d)*Math.sin(e));g=Math.asin(Math.max(Math.min(g,1),-1));e=Math.atan2(E,t);l=[Math.cos(u)*(Math.sin(d)*Math.sin(l)*Math.cos(x)-Math.cos(l)*Math.sin(x)),Math.cos(u)*Math.cos(d)*Math.cos(x),Math.cos(u)*(Math.cos(l)*Math.sin(d)*Math.cos(x)+Math.sin(x)*Math.sin(l))];d=[-Math.cos(g)*Math.sin(e),Math.cos(g)*Math.cos(e)];d=Math.acos(Math.max(Math.min((l[0]*
d[0]+l[1]*d[1])/(Math.sqrt(l[0]*l[0]+l[1]*l[1]+l[2]*l[2])*Math.sqrt(d[0]*d[0]+d[1]*d[1])),1),-1));0>l[2]&&(d=2*Math.PI-d);f+=d}if(a||"multires"!=z&&"cubemap"!=z){if("multires"!=z)k=2*Math.atan(Math.tan(0.5*k)/(a.drawingBufferWidth/a.drawingBufferHeight)),k=1/Math.tan(0.5*k),a.uniform1f(c.psi,e),a.uniform1f(c.theta,g),a.uniform1f(c.rot,f),a.uniform1f(c.f,k),!0===F&&"equirectangular"==z&&(a.bindTexture(a.TEXTURE_2D,c.texture),a.texImage2D(a.TEXTURE_2D,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,m)),a.drawArrays(a.TRIANGLES,
0,6);else{l=a.drawingBufferWidth/a.drawingBufferHeight;d=2*Math.atan(Math.tan(k/2)*a.drawingBufferHeight/a.drawingBufferWidth);d=1/Math.tan(d/2);l=[d/l,0,0,0,0,d,0,0,0,0,100.1/-99.9,20/-99.9,0,0,-1,0];for(d=1;d<m.maxLevel&&a.drawingBufferWidth>m.tileResolution*Math.pow(2,d-1)*Math.tan(k/2)*0.707;)d++;c.level=d;d=[1,0,0,0,1,0,0,0,1];d=ua(d,-f,"z");d=ua(d,-g,"x");d=ua(d,e,"y");d=[d[0],d[1],d[2],0,d[3],d[4],d[5],0,d[6],d[7],d[8],0,0,0,0,1];a.uniformMatrix4fv(c.perspUniform,!1,new Float32Array(ma(l)));
a.uniformMatrix4fv(c.cubeUniform,!1,new Float32Array(ma(d)));f=[l[0]*d[0],l[0]*d[1],l[0]*d[2],0,l[5]*d[4],l[5]*d[5],l[5]*d[6],0,l[10]*d[8],l[10]*d[9],l[10]*d[10],l[11],-d[8],-d[9],-d[10],0];c.nodeCache.sort(ja);if(200<c.nodeCache.length&&c.nodeCache.length>c.currentNodes.length+50)for(l=c.nodeCache.splice(200,c.nodeCache.length-200),d=0;d<l.length;d++)a.deleteTexture(l[d].texture);c.currentNodes=[];d="fbudlr".split("");for(l=0;6>l;l++)u=new ka(wa[l],d[l],1,0,0,m.fullpath),Ja(f,u,g,e,k);c.currentNodes.sort(Q);
for(g=S.length-1;0<=g;g--)-1===c.currentNodes.indexOf(S[g].node)&&(S[g].node.textureLoad=!1,S.splice(g,1));if(0===S.length)for(g=0;g<c.currentNodes.length;g++)if(e=c.currentNodes[g],!e.texture&&!e.textureLoad){e.textureLoad=!0;setTimeout(Ka,0,e);break}if(!c.drawInProgress){c.drawInProgress=!0;a.clear(a.COLOR_BUFFER_BIT);for(g=0;g<c.currentNodes.length;g++)1<c.currentNodes[g].textureLoaded&&(a.bindBuffer(a.ARRAY_BUFFER,Fa),a.bufferData(a.ARRAY_BUFFER,new Float32Array(c.currentNodes[g].vertices),a.STATIC_DRAW),
a.vertexAttribPointer(c.vertPosLocation,3,a.FLOAT,!1,0,0),a.bindBuffer(a.ARRAY_BUFFER,Y),a.vertexAttribPointer(c.texCoordLocation,2,a.FLOAT,!1,0,0),a.bindTexture(a.TEXTURE_2D,c.currentNodes[g].texture),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0));c.drawInProgress=!1}}if(r.returnImage!==p)return A.toDataURL("image/png")}else for(l=$/2,r={f:"translate3d(-"+(l+2)+"px, -"+(l+2)+"px, -"+l+"px)",b:"translate3d("+(l+2)+"px, -"+(l+2)+"px, "+l+"px) rotateX(180deg) rotateZ(180deg)",u:"translate3d(-"+(l+
2)+"px, -"+l+"px, "+(l+2)+"px) rotateX(270deg)",d:"translate3d(-"+(l+2)+"px, "+l+"px, -"+(l+2)+"px) rotateX(90deg)",l:"translate3d(-"+l+"px, -"+(l+2)+"px, "+(l+2)+"px) rotateX(180deg) rotateY(90deg) rotateZ(180deg)",r:"translate3d("+l+"px, -"+(l+2)+"px, -"+(l+2)+"px) rotateY(270deg)"},k=1/Math.tan(k/2),k=k*A.clientWidth/2+"px",e="perspective("+k+") translateZ("+k+") rotateX("+g+"rad) rotateY("+e+"rad) ",k=Object.keys(r),g=0;6>g;g++)if(f=R.querySelector(".pnlm-"+k[g]+"face"))f.style.webkitTransform=
e+r[k[g]],f.style.transform=e+r[k[g]]};this.isLoading=function(){if(a&&"multires"==z)for(var g=0;g<c.currentNodes.length;g++)if(!c.currentNodes[g].textureLoaded)return!0;return!1};this.getCanvas=function(){return A};var S=[],La=function(){function c(){var d=this;this.texture=this.callback=null;this.image=new Image;this.image.crossOrigin=l?l:"anonymous";var e=function(){if(0<d.image.width&&0<d.image.height){var c=d.image;a.bindTexture(a.TEXTURE_2D,d.texture);a.texImage2D(a.TEXTURE_2D,0,a.RGB,a.RGB,
a.UNSIGNED_BYTE,c);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);a.bindTexture(a.TEXTURE_2D,null);d.callback(d.texture,!0)}else d.callback(d.texture,!1);S.length?(c=S.shift(),d.loadTexture(c.src,c.texture,c.callback)):k[g++]=d};this.image.addEventListener("load",e);this.image.addEventListener("error",
e)}function e(a,c,e,g){this.node=a;this.src=c;this.texture=e;this.callback=g}var g=4,k={},l;c.prototype.loadTexture=function(a,c,e){this.texture=c;this.callback=e;this.image.src=a};for(var f=0;f<g;f++)k[f]=new c;return function(c,f,m,p){l=p;p=a.createTexture();g?k[--g].loadTexture(f,p,m):S.push(new e(c,f,p,m));return p}}()}var r="attribute vec2 a_texCoord;varying vec2 v_texCoord;void main() {gl_Position = vec4(a_texCoord, 0.0, 1.0);v_texCoord = a_texCoord;}",k="attribute vec3 a_vertCoord;attribute vec2 a_texCoord;uniform mat4 u_cubeMatrix;uniform mat4 u_perspMatrix;varying mediump vec2 v_texCoord;void main(void) {gl_Position = u_perspMatrix * u_cubeMatrix * vec4(a_vertCoord, 1.0);v_texCoord = a_texCoord;}",
oa="precision highp float;\nuniform float u_aspectRatio;\nuniform float u_psi;\nuniform float u_theta;\nuniform float u_f;\nuniform float u_h;\nuniform float u_v;\nuniform float u_vo;\nuniform float u_rot;\nconst float PI = 3.14159265358979323846264;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nuniform bool u_splitImage;\nuniform samplerCube u_imageCube;\nvarying vec2 v_texCoord;\nuniform vec4 u_backgroundColor;\nvoid main() {\nfloat x = v_texCoord.x * u_aspectRatio;\nfloat y = v_texCoord.y;\nfloat sinrot = sin(u_rot);\nfloat cosrot = cos(u_rot);\nfloat rot_x = x * cosrot - y * sinrot;\nfloat rot_y = x * sinrot + y * cosrot;\nfloat sintheta = sin(u_theta);\nfloat costheta = cos(u_theta);\nfloat a = u_f * costheta - rot_y * sintheta;\nfloat root = sqrt(rot_x * rot_x + a * a);\nfloat lambda = atan(rot_x / root, a / root) + u_psi;\nfloat phi = atan((rot_y * costheta + u_f * sintheta) / root);",
qa=oa+"float cosphi = cos(phi);\ngl_FragColor = textureCube(u_imageCube, vec3(cosphi*sin(lambda), sin(phi), cosphi*cos(lambda)));\n}",pa=oa+"lambda = mod(lambda + PI, PI * 2.0) - PI;\nvec2 coord = vec2(lambda / PI, phi / (PI / 2.0));\nif(coord.x < -u_h || coord.x > u_h || coord.y < -u_v + u_vo || coord.y > u_v + u_vo)\ngl_FragColor = u_backgroundColor;\nelse {\nif(u_splitImage) {\nif(coord.x < 0.0)\ngl_FragColor = texture2D(u_image0, vec2((coord.x + u_h) / u_h, (-coord.y + u_v + u_vo) / (u_v * 2.0)));\nelse\ngl_FragColor = texture2D(u_image1, vec2((coord.x + u_h) / u_h - 1.0, (-coord.y + u_v + u_vo) / (u_v * 2.0)));\n} else {\ngl_FragColor = texture2D(u_image0, vec2((coord.x + u_h) / (u_h * 2.0), (-coord.y + u_v + u_vo) / (u_v * 2.0)));\n}\n}\n}",
bb="varying mediump vec2 v_texCoord;uniform sampler2D u_sampler;void main(void) {gl_FragColor = texture2D(u_sampler, v_texCoord);}";return{renderer:function(g,k,p,r){return new Ba(g,k,p,r)}}}(window,document);
window.pannellum=function(E,g,p){function Ba(r,k){function oa(){var a=g.createElement("div");a.innerHTML="\x3c!--[if lte IE 9]><i></i><![endif]--\x3e";if(1==a.getElementsByTagName("i").length)K();else{ra=b.hfov;Ga=b.pitch;var h;if("cubemap"==b.type){M=[];for(a=0;6>a;a++)M.push(new Image),M[a].crossOrigin=b.crossOrigin;q.load.lbox.style.display="block";q.load.lbar.style.display="none"}else if("multires"==b.type)a=JSON.parse(JSON.stringify(b.multiRes)),b.basePath&&b.multiRes.basePath&&!/^(?:[a-z]+:)?\/\//i.test(b.multiRes.basePath)?
a.basePath=b.basePath+b.multiRes.basePath:b.multiRes.basePath?a.basePath=b.multiRes.basePath:b.basePath&&(a.basePath=b.basePath),M=a;else if(!0===b.dynamic)M=b.panorama;else{if(b.panorama===p){K(b.strings.noPanoramaError);return}M=new Image}if("cubemap"==b.type)for(var n=6,c=function(){n--;0===n&&pa()},d=function(a){var ea=g.createElement("a");ea.href=a.target.src;ea.textContent=ea.href;K(b.strings.fileAccessError.replace("%s",ea.outerHTML))},a=0;a<M.length;a++)h=b.cubeMap[a],"null"==h?(console.log("Will use background instead of missing cubemap face "+
a),c()):(b.basePath&&!qa(h)&&(h=b.basePath+h),M[a].onload=c,M[a].onerror=d,M[a].src=I(h));else if("multires"==b.type)pa();else if(h="",b.basePath&&(h=b.basePath),!0!==b.dynamic){h=qa(b.panorama)?b.panorama:h+b.panorama;M.onload=function(){E.URL.revokeObjectURL(this.src);pa()};var e=new XMLHttpRequest;e.onloadend=function(){if(200!=e.status){var a=g.createElement("a");a.href=h;a.textContent=a.href;K(b.strings.fileAccessError.replace("%s",a.outerHTML))}Ba(this.response,h);q.load.msg.innerHTML=""};e.onprogress=
function(a){if(a.lengthComputable){q.load.lbarFill.style.width=a.loaded/a.total*100+"%";var b,ea;1E6<a.total?(b="MB",ea=(a.loaded/1E6).toFixed(2),a=(a.total/1E6).toFixed(2)):1E3<a.total?(b="kB",ea=(a.loaded/1E3).toFixed(1),a=(a.total/1E3).toFixed(1)):(b="B",ea=a.loaded,a=a.total);q.load.msg.innerHTML=ea+" / "+a+" "+b}else q.load.lbox.style.display="block",q.load.lbar.style.display="none"};try{e.open("GET",h,!0)}catch(f){K(b.strings.malformedURLError)}e.responseType="blob";e.setRequestHeader("Accept",
"image/*,*/*;q=0.9");e.withCredentials="use-credentials"===b.crossOrigin;e.send()}b.draggable&&J.classList.add("pnlm-grab");J.classList.remove("pnlm-grabbing");Ma=!0===b.dynamicUpdate;b.dynamic&&Ma&&(M=b.panorama,pa())}}function qa(a){return/^(?:[a-z]+:)?\/\//i.test(a)||"/"==a[0]||"blob:"==a.slice(0,5)}function pa(){C||(C=new libpannellum.renderer(N));Sa||(Sa=!0,W.addEventListener("mousedown",ka,!1),g.addEventListener("mousemove",ua,!1),g.addEventListener("mouseup",ma,!1),b.mouseZoom&&(J.addEventListener("mousewheel",
U,!1),J.addEventListener("DOMMouseScroll",U,!1)),b.doubleClickZoom&&W.addEventListener("dblclick",Ja,!1),r.addEventListener("mozfullscreenchange",d,!1),r.addEventListener("webkitfullscreenchange",d,!1),r.addEventListener("msfullscreenchange",d,!1),r.addEventListener("fullscreenchange",d,!1),E.addEventListener("resize",z,!1),E.addEventListener("orientationchange",z,!1),b.disableKeyboardCtrl||(r.addEventListener("keydown",V,!1),r.addEventListener("keyup",R,!1),r.addEventListener("blur",$,!1)),g.addEventListener("mouseleave",
ma,!1),""===g.documentElement.style.pointerAction&&""===g.documentElement.style.touchAction?(W.addEventListener("pointerdown",A,!1),W.addEventListener("pointermove",c,!1),W.addEventListener("pointerup",a,!1),W.addEventListener("pointerleave",a,!1)):(W.addEventListener("touchstart",Ka,!1),W.addEventListener("touchmove",la,!1),W.addEventListener("touchend",Ea,!1)),E.navigator.pointerEnabled&&(r.style.touchAction="none"));va();x(b.hfov);setTimeout(function(){},500)}function Ba(a,h){var n=new FileReader;
n.addEventListener("loadend",function(){var c=n.result;if(navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/)){var e=c.indexOf("\u00ff\u00c2");(0>e||65536<e)&&K(b.strings.iOS8WebGLError)}e=c.indexOf("<x:xmpmeta");if(-1<e&&!0!==b.ignoreGPanoXMP){var d=c.substring(e,c.indexOf("</x:xmpmeta>")+12),f=function(a){var b;0<=d.indexOf(a+'="')?(b=d.substring(d.indexOf(a+'="')+a.length+2),b=b.substring(0,b.indexOf('"'))):0<=d.indexOf(a+">")&&(b=d.substring(d.indexOf(a+">")+a.length+1),b=b.substring(0,
b.indexOf("<")));return b!==p?Number(b):null},c=f("GPano:FullPanoWidthPixels"),e=f("GPano:CroppedAreaImageWidthPixels"),l=f("GPano:FullPanoHeightPixels"),k=f("GPano:CroppedAreaImageHeightPixels"),m=f("GPano:CroppedAreaTopPixels"),q=f("GPano:PoseHeadingDegrees"),r=f("GPano:PosePitchDegrees"),f=f("GPano:PoseRollDegrees");null!==c&&null!==e&&null!==l&&null!==k&&null!==m&&(0>aa.indexOf("haov")&&(b.haov=e/c*360),0>aa.indexOf("vaov")&&(b.vaov=k/l*180),0>aa.indexOf("vOffset")&&(b.vOffset=-180*((m+k/2)/l-
0.5)),null!==q&&0>aa.indexOf("northOffset")&&(b.northOffset=q,!1!==b.compass&&(b.compass=!0)),null!==r&&null!==f&&(0>aa.indexOf("horizonPitch")&&(b.horizonPitch=r),0>aa.indexOf("horizonRoll")&&(b.horizonRoll=f)))}M.src=E.URL.createObjectURL(a);M.onerror=function(){(function(){return E.fetch?E.fetch(g.location.href).then(function(a){return a.headers.get("Content-Security-Policy")}):null})().then(function(a){a&&a.split(";").find(function(a){if(a=a.match(/img-src(.*)/))return!a[1].includes("blob")})&&
(console.log("CSP blocks blobs; reverting to URL."),M.crossOrigin=b.crossOrigin,M.src=h)})}});n.readAsBinaryString!==p?n.readAsBinaryString(a):n.readAsText(a)}function K(a){a===p&&(a=b.strings.genericWebGLError);q.errorMsg.innerHTML="<p>"+a+"</p>";v.load.style.display="none";q.load.box.style.display="none";q.errorMsg.style.display="table";Na=!0;G=p;N.style.display="none";B("error",a)}function ja(a){var b=Q(a);fa.style.left=b.x+"px";fa.style.top=b.y+"px";clearTimeout(ja.t1);clearTimeout(ja.t2);fa.style.display=
"block";fa.style.opacity=1;ja.t1=setTimeout(function(){fa.style.opacity=0},2E3);ja.t2=setTimeout(function(){fa.style.display="none"},2500);a.preventDefault()}function Q(a){var b=r.getBoundingClientRect(),n={};n.x=(a.clientX||a.pageX)-b.left;n.y=(a.clientY||a.pageY)-b.top;return n}function ka(a){a.preventDefault();r.focus();if(G&&b.draggable){var h=Q(a);if(b.hotSpotDebug){var n=ta(a);console.log("Pitch: "+n[0]+", Yaw: "+n[1]+", Center Pitch: "+b.pitch+", Center Yaw: "+b.yaw+", HFOV: "+b.hfov)}t();
Da();b.roll=0;w.hfov=0;ha=!0;O=Date.now();xa=h.x;ya=h.y;Oa=b.yaw;Pa=b.pitch;J.classList.add("pnlm-grabbing");J.classList.remove("pnlm-grab");B("mousedown",a);F()}}function Ja(a){b.minHfov===b.hfov?da.setHfov(ra,1E3):(a=ta(a),da.lookAt(a[0],a[1],b.minHfov,1E3))}function ta(a){var h=Q(a);a=C.getCanvas();var n=a.clientWidth,c=a.clientHeight;a=h.x/n*2-1;var c=(1-h.y/c*2)*c/n,e=1/Math.tan(b.hfov*Math.PI/360),d=Math.sin(b.pitch*Math.PI/180),f=Math.cos(b.pitch*Math.PI/180),h=e*f-c*d,n=Math.sqrt(a*a+h*h),
c=180*Math.atan((c*f+e*d)/n)/Math.PI;a=180*Math.atan2(a/n,h/n)/Math.PI+b.yaw;-180>a&&(a+=360);180<a&&(a-=360);return[c,a]}function ua(a){if(ha&&G){O=Date.now();var h=C.getCanvas(),n=h.clientWidth,h=h.clientHeight;a=Q(a);var c=180*(Math.atan(xa/n*2-1)-Math.atan(a.x/n*2-1))/Math.PI*b.hfov/90+Oa;w.yaw=(c-b.yaw)%360*0.2;b.yaw=c;n=360*Math.atan(Math.tan(b.hfov/360*Math.PI)*h/n)/Math.PI;n=180*(Math.atan(a.y/h*2-1)-Math.atan(ya/h*2-1))/Math.PI*n/90+Pa;w.pitch=0.2*(n-b.pitch);b.pitch=n}}function ma(a){ha&&
(ha=!1,15<Date.now()-O&&(w.pitch=w.yaw=0),J.classList.add("pnlm-grab"),J.classList.remove("pnlm-grabbing"),O=Date.now(),B("mouseup",a))}function Ka(a){if(G&&b.draggable){t();Da();b.roll=0;w.hfov=0;var h=Q(a.targetTouches[0]);xa=h.x;ya=h.y;if(2==a.targetTouches.length){var n=Q(a.targetTouches[1]);xa+=0.5*(n.x-h.x);ya+=0.5*(n.y-h.y);Ha=Math.sqrt((h.x-n.x)*(h.x-n.x)+(h.y-n.y)*(h.y-n.y))}ha=!0;O=Date.now();Oa=b.yaw;Pa=b.pitch;B("touchstart",a);F()}}function la(a){if(b.draggable&&(a.preventDefault(),G&&
(O=Date.now()),ha&&G)){var h=Q(a.targetTouches[0]),n=h.x,c=h.y;2==a.targetTouches.length&&-1!=Ha&&(a=Q(a.targetTouches[1]),n+=0.5*(a.x-h.x),c+=0.5*(a.y-h.y),h=Math.sqrt((h.x-a.x)*(h.x-a.x)+(h.y-a.y)*(h.y-a.y)),x(b.hfov+0.1*(Ha-h)),Ha=h);h=b.hfov/360*b.touchPanSpeedCoeffFactor;n=(xa-n)*h+Oa;w.yaw=(n-b.yaw)%360*0.2;b.yaw=n;c=(c-ya)*h+Pa;w.pitch=0.2*(c-b.pitch);b.pitch=c}}function Ea(){ha=!1;150<Date.now()-O&&(w.pitch=w.yaw=0);Ha=-1;O=Date.now();B("touchend",event)}function A(a){"touch"==a.pointerType&&
G&&b.draggable&&(ia.push(a.pointerId),za.push({clientX:a.clientX,clientY:a.clientY}),a.targetTouches=za,Ka(a),a.preventDefault())}function c(a){if("touch"==a.pointerType&&b.draggable)for(var h=0;h<ia.length;h++)if(a.pointerId==ia[h]){za[h].clientX=a.clientX;za[h].clientY=a.clientY;a.targetTouches=za;la(a);a.preventDefault();break}}function a(a){if("touch"==a.pointerType){for(var b=!1,n=0;n<ia.length;n++)a.pointerId==ia[n]&&(ia[n]=p),ia[n]&&(b=!0);b||(ia=[],za=[],Ea());a.preventDefault()}}function U(a){G&&
("fullscreenonly"!=b.mouseZoom||Aa)&&(a.preventDefault(),t(),O=Date.now(),a.wheelDeltaY?(x(b.hfov-0.05*a.wheelDeltaY),w.hfov=0>a.wheelDelta?1:-1):a.wheelDelta?(x(b.hfov-0.05*a.wheelDelta),w.hfov=0>a.wheelDelta?1:-1):a.detail&&(x(b.hfov+1.5*a.detail),w.hfov=0<a.detail?1:-1),F())}function V(a){t();O=Date.now();Da();b.roll=0;var h=a.which||a.keycode;0>b.capturedKeyNumbers.indexOf(h)||(a.preventDefault(),27==h?Aa&&f():wa(h,!0))}function $(){for(var a=0;10>a;a++)s[a]=!1}function R(a){var h=a.which||a.keycode;
0>b.capturedKeyNumbers.indexOf(h)||(a.preventDefault(),wa(h,!1))}function wa(a,b){var n=!1;switch(a){case 109:case 189:case 17:case 173:s[0]!=b&&(n=!0);s[0]=b;break;case 107:case 187:case 16:case 61:s[1]!=b&&(n=!0);s[1]=b;break;case 38:s[2]!=b&&(n=!0);s[2]=b;break;case 87:s[6]!=b&&(n=!0);s[6]=b;break;case 40:s[3]!=b&&(n=!0);s[3]=b;break;case 83:s[7]!=b&&(n=!0);s[7]=b;break;case 37:s[4]!=b&&(n=!0);s[4]=b;break;case 65:s[8]!=b&&(n=!0);s[8]=b;break;case 39:s[5]!=b&&(n=!0);s[5]=b;break;case 68:s[9]!=
b&&(n=!0),s[9]=b}n&&b&&(ba="undefined"!==typeof performance&&performance.now()?performance.now():Date.now(),F())}function ga(){if(G){var a=!1,h=b.pitch,n=b.yaw,c=b.hfov,e;e="undefined"!==typeof performance&&performance.now()?performance.now():Date.now();ba===p&&(ba=e);var d=(e-ba)*b.hfov/1700,d=Math.min(d,1);s[0]&&!0===b.keyboardZoom&&(x(b.hfov+(0.8*w.hfov+0.5)*d),a=!0);s[1]&&!0===b.keyboardZoom&&(x(b.hfov+(0.8*w.hfov-0.2)*d),a=!0);if(s[2]||s[6])b.pitch+=(0.8*w.pitch+0.2)*d,a=!0;if(s[3]||s[7])b.pitch+=
(0.8*w.pitch-0.2)*d,a=!0;if(s[4]||s[8])b.yaw+=(0.8*w.yaw-0.2)*d,a=!0;if(s[5]||s[9])b.yaw+=(0.8*w.yaw+0.2)*d,a=!0;a&&(O=Date.now());if(b.autoRotate){if(0.001<e-ba){var a=(e-ba)/1E3,f=(w.yaw/a*d-0.2*b.autoRotate)*a,f=(0<-b.autoRotate?1:-1)*Math.min(Math.abs(b.autoRotate*a),Math.abs(f));b.yaw+=f}b.autoRotateStopDelay&&(b.autoRotateStopDelay-=e-ba,0>=b.autoRotateStopDelay&&(b.autoRotateStopDelay=!1,Z=b.autoRotate,b.autoRotate=0))}P.pitch&&(m("pitch"),h=b.pitch);P.yaw&&(m("yaw"),n=b.yaw);P.hfov&&(m("hfov"),
c=b.hfov);0<d&&!b.autoRotate&&(a=1-b.friction,s[4]||s[5]||s[8]||s[9]||P.yaw||(b.yaw+=w.yaw*d*a),s[2]||s[3]||s[6]||s[7]||P.pitch||(b.pitch+=w.pitch*d*a),s[0]||s[1]||P.hfov||x(b.hfov+w.hfov*d*a));ba=e;0<d&&(w.yaw=0.8*w.yaw+(b.yaw-n)/d*0.2,w.pitch=0.8*w.pitch+(b.pitch-h)/d*0.2,w.hfov=0.8*w.hfov+(b.hfov-c)/d*0.2,h=b.autoRotate?Math.abs(b.autoRotate):5,w.yaw=Math.min(h,Math.max(w.yaw,-h)),w.pitch=Math.min(h,Math.max(w.pitch,-h)),w.hfov=Math.min(h,Math.max(w.hfov,-h)));s[0]&&s[1]&&(w.hfov=0);(s[2]||s[6])&&
(s[3]||s[7])&&(w.pitch=0);(s[4]||s[8])&&(s[5]||s[9])&&(w.yaw=0)}}function m(a){var h=P[a],n=Math.min(1,Math.max((Date.now()-h.startTime)/1E3/(h.duration/1E3),0)),n=h.startPosition+b.animationTimingFunction(n)*(h.endPosition-h.startPosition);if(h.endPosition>h.startPosition&&n>=h.endPosition||h.endPosition<h.startPosition&&n<=h.endPosition||h.endPosition===h.startPosition)n=h.endPosition,w[a]=0,delete P[a];b[a]=n}function z(){d("resize")}function F(){Ta||(Ta=!0,ca())}function ca(){if(!Za)if(Fa(),Qa&&
clearTimeout(Qa),ha||!0===X)requestAnimationFrame(ca);else if(s[0]||s[1]||s[2]||s[3]||s[4]||s[5]||s[6]||s[7]||s[8]||s[9]||b.autoRotate||P.pitch||P.yaw||P.hfov||0.01<Math.abs(w.yaw)||0.01<Math.abs(w.pitch)||0.01<Math.abs(w.hfov))ga(),0<=b.autoRotateInactivityDelay&&Z&&Date.now()-O>b.autoRotateInactivityDelay&&!b.autoRotate&&(b.autoRotate=Z,da.lookAt(Ga,p,ra,3E3)),requestAnimationFrame(ca);else if(C&&(C.isLoading()||!0===b.dynamic&&Ma))requestAnimationFrame(ca);else{B("animatefinished",{pitch:da.getPitch(),
yaw:da.getYaw(),hfov:da.getHfov()});Ta=!1;ba=p;var a=b.autoRotateInactivityDelay-(Date.now()-O);0<a?Qa=setTimeout(function(){b.autoRotate=Z;da.lookAt(Ga,p,ra,3E3);F()},a):0<=b.autoRotateInactivityDelay&&Z&&(b.autoRotate=Z,da.lookAt(Ga,p,ra,3E3),F())}}function Fa(){var a;if(G){var h=C.getCanvas();!1!==b.autoRotate&&(360<b.yaw?b.yaw-=360:-360>b.yaw&&(b.yaw+=360));a=b.yaw;var n=0;if(b.avoidShowingBackground){var c=b.hfov/2,d=180*Math.atan2(Math.tan(c/180*Math.PI),h.width/h.height)/Math.PI;b.vaov>b.haov?
Math.min(Math.cos((b.pitch-c)/180*Math.PI),Math.cos((b.pitch+c)/180*Math.PI)):n=c*(1-Math.min(Math.cos((b.pitch-d)/180*Math.PI),Math.cos((b.pitch+d)/180*Math.PI)))}var c=b.maxYaw-b.minYaw,d=-180,e=180;360>c&&(d=b.minYaw+b.hfov/2+n,e=b.maxYaw-b.hfov/2-n,c<b.hfov&&(d=e=(d+e)/2),b.yaw=Math.max(d,Math.min(e,b.yaw)));!1===b.autoRotate&&(360<b.yaw?b.yaw-=360:-360>b.yaw&&(b.yaw+=360));!1!==b.autoRotate&&a!=b.yaw&&ba!==p&&(b.autoRotate*=-1);a=2*Math.atan(Math.tan(b.hfov/180*Math.PI*0.5)/(h.width/h.height))/
Math.PI*180;h=b.minPitch+a/2;n=b.maxPitch-a/2;b.maxPitch-b.minPitch<a&&(h=n=(h+n)/2);isNaN(h)&&(h=-90);isNaN(n)&&(n=90);b.pitch=Math.max(h,Math.min(n,b.pitch));C.render(b.pitch*Math.PI/180,b.yaw*Math.PI/180,b.hfov*Math.PI/180,{roll:b.roll*Math.PI/180});b.hotSpots.forEach(Ca);b.compass&&(Ia.style.transform="rotate("+(-b.yaw-b.northOffset)+"deg)",Ia.style.webkitTransform="rotate("+(-b.yaw-b.northOffset)+"deg)")}}function Y(a,b,c,d){this.w=a;this.x=b;this.y=c;this.z=d}function na(a){var h;h=a.alpha;
var c=a.beta;a=a.gamma;c=[c?c*Math.PI/180/2:0,a?a*Math.PI/180/2:0,h?h*Math.PI/180/2:0];h=[Math.cos(c[0]),Math.cos(c[1]),Math.cos(c[2])];c=[Math.sin(c[0]),Math.sin(c[1]),Math.sin(c[2])];h=new Y(h[0]*h[1]*h[2]-c[0]*c[1]*c[2],c[0]*h[1]*h[2]-h[0]*c[1]*c[2],h[0]*c[1]*h[2]+c[0]*h[1]*c[2],h[0]*h[1]*c[2]+c[0]*c[1]*h[2]);h=h.multiply(new Y(Math.sqrt(0.5),-Math.sqrt(0.5),0,0));c=E.orientation?-E.orientation*Math.PI/180/2:0;h=h.multiply(new Y(Math.cos(c),0,-Math.sin(c),0)).toEulerAngles();"number"==typeof X&&
10>X?X+=1:10===X?($a=h[2]/Math.PI*180+b.yaw,X=!0,requestAnimationFrame(ca)):(b.pitch=h[0]/Math.PI*180,b.roll=-h[1]/Math.PI*180,b.yaw=-h[2]/Math.PI*180+$a)}function va(){try{var a={};b.horizonPitch!==p&&(a.horizonPitch=b.horizonPitch*Math.PI/180);b.horizonRoll!==p&&(a.horizonRoll=b.horizonRoll*Math.PI/180);b.backgroundColor!==p&&(a.backgroundColor=b.backgroundColor);C.init(M,b.type,b.dynamic,b.haov*Math.PI/180,b.vaov*Math.PI/180,b.vOffset*Math.PI/180,S,a);!0!==b.dynamic&&(M=p)}catch(h){if("webgl error"==
h.type||"no webgl"==h.type)K();else if("webgl size error"==h.type)K(b.strings.textureSizeError.replace("%s",h.width).replace("%s",h.maxWidth));else throw K(b.strings.unknownError),h;}}function S(){if(b.sceneFadeDuration&&C.fadeImg!==p){C.fadeImg.style.opacity=0;var a=C.fadeImg;delete C.fadeImg;setTimeout(function(){N.removeChild(a);B("scenechangefadedone")},b.sceneFadeDuration)}Ia.style.display=b.compass?"inline":"none";L();q.load.box.style.display="none";sa!==p&&(N.removeChild(sa),sa=p);G=!0;F();
B("load")}function La(a){a.pitch=Number(a.pitch)||0;a.yaw=Number(a.yaw)||0;var h=g.createElement("div");h.className="pnlm-hotspot-base";h.className=a.cssClass?h.className+(" "+a.cssClass):h.className+(" pnlm-hotspot pnlm-sprite pnlm-"+D(a.type));var c=g.createElement("span");a.text&&(c.innerHTML=D(a.text));var d;if(a.video){d=g.createElement("video");var e=a.video;b.basePath&&!qa(e)&&(e=b.basePath+e);d.src=I(e);d.controls=!0;d.style.width=a.width+"px";N.appendChild(h);c.appendChild(d)}else if(a.image){e=
a.image;b.basePath&&!qa(e)&&(e=b.basePath+e);d=g.createElement("a");d.href=I(a.URL?a.URL:e,!0);d.target="_blank";c.appendChild(d);var f=g.createElement("img");f.src=I(e);f.style.width=a.width+"px";f.style.paddingTop="5px";N.appendChild(h);d.appendChild(f);c.style.maxWidth="initial"}else if(a.URL){d=g.createElement("a");d.href=I(a.URL,!0);if(a.attributes)for(e in a.attributes)d.setAttribute(e,a.attributes[e]);else d.target="_blank";N.appendChild(d);h.className+=" pnlm-pointer";c.className+=" pnlm-pointer";
d.appendChild(h)}else a.sceneId&&(h.onclick=h.ontouchend=function(){h.clicked||(h.clicked=!0,y(a.sceneId,a.targetPitch,a.targetYaw,a.targetHfov));return!1},h.className+=" pnlm-pointer",c.className+=" pnlm-pointer"),N.appendChild(h);if(a.createTooltipFunc)a.createTooltipFunc(h,a.createTooltipArgs);else if(a.text||a.video||a.image)h.classList.add("pnlm-tooltip"),h.appendChild(c),c.style.width=c.scrollWidth-20+"px",c.style.marginLeft=-(c.scrollWidth-h.offsetWidth)/2+"px",c.style.marginTop=-c.scrollHeight-
12+"px";a.clickHandlerFunc&&(h.addEventListener("click",function(b){a.clickHandlerFunc(b,a.clickHandlerArgs)},"false"),h.className+=" pnlm-pointer",c.className+=" pnlm-pointer");a.div=h}function L(){Ua||(b.hotSpots?(b.hotSpots=b.hotSpots.sort(function(a,b){return a.pitch<b.pitch}),b.hotSpots.forEach(La)):b.hotSpots=[],Ua=!0,b.hotSpots.forEach(Ca))}function e(){var a=b.hotSpots;Ua=!1;delete b.hotSpots;if(a)for(var h=0;h<a.length;h++){var c=a[h].div;if(c){for(;c.parentNode&&c.parentNode!=N;)c=c.parentNode;
N.removeChild(c)}delete a[h].div}}function Ca(a){var h=Math.sin(a.pitch*Math.PI/180),c=Math.cos(a.pitch*Math.PI/180),d=Math.sin(b.pitch*Math.PI/180),e=Math.cos(b.pitch*Math.PI/180),f=Math.cos((-a.yaw+b.yaw)*Math.PI/180),g=h*d+c*f*e;if(90>=a.yaw&&-90<a.yaw&&0>=g||(90<a.yaw||-90>=a.yaw)&&0>=g)a.div.style.visibility="hidden";else{var l=Math.sin((-a.yaw+b.yaw)*Math.PI/180),k=Math.tan(b.hfov*Math.PI/360);a.div.style.visibility="visible";var m=C.getCanvas(),p=m.clientWidth,m=m.clientHeight,h=[-p/k*l*c/
g/2,-p/k*(h*e-c*f*d)/g/2],c=Math.sin(b.roll*Math.PI/180),d=Math.cos(b.roll*Math.PI/180),h=[h[0]*d-h[1]*c,h[0]*c+h[1]*d];h[0]+=(p-a.div.offsetWidth)/2;h[1]+=(m-a.div.offsetHeight)/2;p="translate("+h[0]+"px, "+h[1]+"px) translateZ(9999px) rotate("+b.roll+"deg)";a.scale&&(p+=" scale("+ra/b.hfov/g+")");a.div.style.webkitTransform=p;a.div.style.MozTransform=p;a.div.style.transform=p}}function H(a){b={};var c,d,e="haov vaov vOffset northOffset horizonPitch horizonRoll".split(" ");aa=[];for(c in Va)Va.hasOwnProperty(c)&&
(b[c]=Va[c]);for(c in k.default)if(k.default.hasOwnProperty(c))if("strings"==c)for(d in k.default.strings)k.default.strings.hasOwnProperty(d)&&(b.strings[d]=D(k.default.strings[d]));else b[c]=k.default[c],0<=e.indexOf(c)&&aa.push(c);if(null!==a&&""!==a&&k.scenes&&k.scenes[a]){var f=k.scenes[a];for(c in f)if(f.hasOwnProperty(c))if("strings"==c)for(d in f.strings)f.strings.hasOwnProperty(d)&&(b.strings[d]=D(f.strings[d]));else b[c]=f[c],0<=e.indexOf(c)&&aa.push(c);b.scene=a}for(c in k)if(k.hasOwnProperty(c))if("strings"==
c)for(d in k.strings)k.strings.hasOwnProperty(d)&&(b.strings[d]=D(k.strings[d]));else b[c]=k[c],0<=e.indexOf(c)&&aa.push(c)}function l(a){if((a=a?a:!1)&&"preview"in b){var c=b.preview;b.basePath&&!qa(c)&&(c=b.basePath+c);sa=g.createElement("div");sa.className="pnlm-preview-img";sa.style.backgroundImage="url('"+I(c).replace(/"/g,"%22").replace(/'/g,"%27")+"')";N.appendChild(sa)}var c=b.title,d=b.author;a&&("previewTitle"in b&&(b.title=b.previewTitle),"previewAuthor"in b&&(b.author=b.previewAuthor));
b.hasOwnProperty("title")||(q.title.innerHTML="");b.hasOwnProperty("author")||(q.author.innerHTML="");b.hasOwnProperty("title")||b.hasOwnProperty("author")||(q.container.style.display="none");v.load.innerHTML="<p>"+b.strings.loadButtonLabel+"</p>";q.load.boxp.innerHTML=b.strings.loadingLabel;for(var e in b)if(b.hasOwnProperty(e))switch(e){case "title":q.title.innerHTML=D(b[e]);q.container.style.display="inline";break;case "author":var f=D(b[e]);b.authorURL&&(f=g.createElement("a"),f.href=I(b.authorURL,
!0),f.target="_blank",f.innerHTML=D(b[e]),f=f.outerHTML);q.author.innerHTML=b.strings.bylineLabel.replace("%s",f);q.container.style.display="inline";break;case "fallback":f=g.createElement("a");f.href=I(b[e],!0);f.target="_blank";f.textContent="Click here to view this panorama in an alternative viewer.";var k=g.createElement("p");k.textContent="Your browser does not support WebGL.";k.appendChild(g.createElement("br"));k.appendChild(f);q.errorMsg.innerHTML="";q.errorMsg.appendChild(k);break;case "hfov":x(Number(b[e]));
break;case "autoLoad":!0===b[e]&&C===p&&(q.load.box.style.display="inline",v.load.style.display="none",oa());break;case "showZoomCtrl":v.zoom.style.display=b[e]&&!1!=b.showControls?"block":"none";break;case "showFullscreenCtrl":v.fullscreen.style.display=b[e]&&!1!=b.showControls&&("fullscreen"in g||"mozFullScreen"in g||"webkitIsFullScreen"in g||"msFullscreenElement"in g)?"block":"none";break;case "hotSpotDebug":Wa.style.display=b[e]?"block":"none";break;case "showControls":b[e]||(v.orientation.style.display=
"none",v.zoom.style.display="none",v.fullscreen.style.display="none");break;case "orientationOnByDefault":b[e]&&Ra()}a&&(c?b.title=c:delete b.title,d?b.author=d:delete b.author)}function f(){if(G&&!Na)if(Aa)g.exitFullscreen?g.exitFullscreen():g.mozCancelFullScreen?g.mozCancelFullScreen():g.webkitCancelFullScreen?g.webkitCancelFullScreen():g.msExitFullscreen&&g.msExitFullscreen();else try{r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.msRequestFullscreen?
r.msRequestFullscreen():r.webkitRequestFullScreen()}catch(a){}}function d(a){g.fullscreenElement||g.fullscreen||g.mozFullScreen||g.webkitIsFullScreen||g.msFullscreenElement?(v.fullscreen.classList.add("pnlm-fullscreen-toggle-button-active"),Aa=!0):(v.fullscreen.classList.remove("pnlm-fullscreen-toggle-button-active"),Aa=!1);"resize"!==a&&B("fullscreenchange",Aa);C.resize();x(b.hfov);F()}function u(a){var c=b.minHfov;"multires"==b.type&&C&&!b.multiResMinHfov&&(c=Math.min(c,C.getCanvas().width/(b.multiRes.cubeResolution/
90*0.9)));if(c>b.maxHfov)return console.log("HFOV bounds do not make sense (minHfov > maxHfov)."),b.hfov;var d=b.hfov,d=a<c?c:a>b.maxHfov?b.maxHfov:a;b.avoidShowingBackground&&C&&(a=C.getCanvas(),d=Math.min(d,360*Math.atan(Math.tan((b.maxPitch-b.minPitch)/360*Math.PI)/a.height*a.width)/Math.PI));return d}function x(a){b.hfov=u(a);B("zoomchange",b.hfov)}function t(){P={};Z=b.autoRotate?b.autoRotate:Z;b.autoRotate=!1}function Ya(){Na&&(q.load.box.style.display="none",q.errorMsg.style.display="none",
Na=!1,N.style.display="block",B("errorcleared"));G=!1;v.load.style.display="none";q.load.box.style.display="inline";oa()}function y(a,c,d,f,g){G||(g=!0);G=!1;P={};var m,q;if(b.sceneFadeDuration&&!g&&(m=C.render(b.pitch*Math.PI/180,b.yaw*Math.PI/180,b.hfov*Math.PI/180,{returnImage:!0}),m!==p)){g=new Image;g.className="pnlm-fade-img";g.style.transition="opacity "+b.sceneFadeDuration/1E3+"s";g.style.width="100%";g.style.height="100%";g.onload=function(){y(a,c,d,f,!0)};g.src=m;N.appendChild(g);C.fadeImg=
g;return}g="same"===c?b.pitch:c;m="same"===d?b.yaw:"sameAzimuth"===d?b.yaw+(b.northOffset||0)-(k.scenes[a].northOffset||0):d;q="same"===f?b.hfov:f;e();H(a);w.yaw=w.pitch=w.hfov=0;l();g!==p&&(b.pitch=g);m!==p&&(b.yaw=m);q!==p&&(b.hfov=q);B("scenechange",a);Ya()}function Da(){E.removeEventListener("deviceorientation",na);v.orientation.classList.remove("pnlm-orientation-button-active");X=!1}function Ra(){Xa&&(typeof DeviceMotionEvent!==p&&"function"===typeof DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(function(a){"granted"==
a&&(X=1,E.addEventListener("deviceorientation",na),v.orientation.classList.add("pnlm-orientation-button-active"))}):(X=1,E.addEventListener("deviceorientation",na),v.orientation.classList.add("pnlm-orientation-button-active")))}function D(a){return k.escapeHTML?String(a).split(/&/g).join("&amp;").split('"').join("&quot;").split("'").join("&#39;").split("<").join("&lt;").split(">").join("&gt;").split("/").join("&#x2f;").split("\n").join("<br>"):String(a).split("\n").join("<br>")}function I(a,b){try{var c=
decodeURIComponent(ab(a)).replace(/[^\w:]/g,"").toLowerCase()}catch(d){return"about:blank"}return 0===c.indexOf("javascript:")||0===c.indexOf("vbscript:")?(console.log("Script URL removed."),"about:blank"):b&&0===c.indexOf("data:")?(console.log("Data URI removed from link."),"about:blank"):a}function ab(a){return a.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,function(a,b){b=b.toLowerCase();return"colon"===b?":":"#"===b.charAt(0)?"x"===b.charAt(1)?String.fromCharCode(parseInt(b.substring(2),
16)):String.fromCharCode(+b.substring(1)):""})}function B(a){if(a in T)for(var b=T[a].length;0<b;b--)T[a][T[a].length-b].apply(null,[].slice.call(arguments,1))}var da=this,b,C,sa,ha=!1,O=Date.now(),xa=0,ya=0,Ha=-1,Oa=0,Pa=0,s=Array(10),Aa=!1,G,Na=!1,Sa=!1,M,ba,w={yaw:0,pitch:0,hfov:0},Ta=!1,X=!1,$a=0,Qa,Z=0,ra,Ga,P={},T={},aa=[],Ma=!1,Ua=!1,Za=!1,Va={hfov:100,minHfov:50,multiResMinHfov:!1,maxHfov:120,pitch:0,minPitch:p,maxPitch:p,yaw:0,minYaw:-180,maxYaw:180,roll:0,haov:360,vaov:180,vOffset:0,autoRotate:!1,
autoRotateInactivityDelay:-1,autoRotateStopDelay:p,type:"equirectangular",northOffset:0,showFullscreenCtrl:!0,dynamic:!1,dynamicUpdate:!1,doubleClickZoom:!0,keyboardZoom:!0,mouseZoom:!0,showZoomCtrl:!0,autoLoad:!1,showControls:!0,orientationOnByDefault:!1,hotSpotDebug:!1,backgroundColor:[0,0,0],avoidShowingBackground:!1,animationTimingFunction:function(a){return 0.5>a?2*a*a:-1+(4-2*a)*a},draggable:!0,disableKeyboardCtrl:!1,crossOrigin:"anonymous",touchPanSpeedCoeffFactor:1,capturedKeyNumbers:[16,
17,27,37,38,39,40,61,65,68,83,87,107,109,173,187,189],friction:0.15,strings:{loadButtonLabel:"Click to<br>Load<br>Panorama",loadingLabel:"Loading...",bylineLabel:"by %s",noPanoramaError:"No panorama image was specified.",fileAccessError:"The file %s could not be accessed.",malformedURLError:"There is something wrong with the panorama URL.",iOS8WebGLError:"Due to iOS 8's broken WebGL implementation, only progressive encoded JPEGs work for your device (this panorama uses standard encoding).",genericWebGLError:"Your browser does not have the necessary WebGL support to display this panorama.",
textureSizeError:"This panorama is too big for your device! It's %spx wide, but your device only supports images up to %spx wide. Try another device. (If you're the author, try scaling down the image.)",unknownError:"Unknown error. Check developer console."}};r="string"===typeof r?g.getElementById(r):r;r.classList.add("pnlm-container");r.tabIndex=0;var J=g.createElement("div");J.className="pnlm-ui";r.appendChild(J);var N=g.createElement("div");N.className="pnlm-render-container";r.appendChild(N);
var W=g.createElement("div");W.className="pnlm-dragfix";J.appendChild(W);var fa=g.createElement("span");fa.className="pnlm-about-msg";fa.innerHTML='<a href="https://pannellum.org/" target="_blank">Pannellum</a> 0d32eea';J.appendChild(fa);W.addEventListener("contextmenu",ja);var q={},Wa=g.createElement("div");Wa.className="pnlm-sprite pnlm-hot-spot-debug-indicator";J.appendChild(Wa);q.container=g.createElement("div");q.container.className="pnlm-panorama-info";q.title=g.createElement("div");q.title.className=
"pnlm-title-box";q.container.appendChild(q.title);q.author=g.createElement("div");q.author.className="pnlm-author-box";q.container.appendChild(q.author);J.appendChild(q.container);q.load={};q.load.box=g.createElement("div");q.load.box.className="pnlm-load-box";q.load.boxp=g.createElement("p");q.load.box.appendChild(q.load.boxp);q.load.lbox=g.createElement("div");q.load.lbox.className="pnlm-lbox";q.load.lbox.innerHTML='<div class="pnlm-loading"></div>';q.load.box.appendChild(q.load.lbox);q.load.lbar=
g.createElement("div");q.load.lbar.className="pnlm-lbar";q.load.lbarFill=g.createElement("div");q.load.lbarFill.className="pnlm-lbar-fill";q.load.lbar.appendChild(q.load.lbarFill);q.load.box.appendChild(q.load.lbar);q.load.msg=g.createElement("p");q.load.msg.className="pnlm-lmsg";q.load.box.appendChild(q.load.msg);J.appendChild(q.load.box);q.errorMsg=g.createElement("div");q.errorMsg.className="pnlm-error-msg pnlm-info-box";J.appendChild(q.errorMsg);var v={};v.container=g.createElement("div");v.container.className=
"pnlm-controls-container";J.appendChild(v.container);v.load=g.createElement("div");v.load.className="pnlm-load-button";v.load.addEventListener("click",function(){l();Ya()});J.appendChild(v.load);v.zoom=g.createElement("div");v.zoom.className="pnlm-zoom-controls pnlm-controls";v.zoomIn=g.createElement("div");v.zoomIn.className="pnlm-zoom-in pnlm-sprite pnlm-control";v.zoomIn.addEventListener("click",function(){G&&(x(b.hfov-5),F())});v.zoom.appendChild(v.zoomIn);v.zoomOut=g.createElement("div");v.zoomOut.className=
"pnlm-zoom-out pnlm-sprite pnlm-control";v.zoomOut.addEventListener("click",function(){G&&(x(b.hfov+5),F())});v.zoom.appendChild(v.zoomOut);v.container.appendChild(v.zoom);v.fullscreen=g.createElement("div");v.fullscreen.addEventListener("click",f);v.fullscreen.className="pnlm-fullscreen-toggle-button pnlm-sprite pnlm-fullscreen-toggle-button-inactive pnlm-controls pnlm-control";(g.fullscreenEnabled||g.mozFullScreenEnabled||g.webkitFullscreenEnabled||g.msFullscreenEnabled)&&v.container.appendChild(v.fullscreen);
v.orientation=g.createElement("div");v.orientation.addEventListener("click",function(a){X?Da():Ra()});v.orientation.addEventListener("mousedown",function(a){a.stopPropagation()});v.orientation.addEventListener("touchstart",function(a){a.stopPropagation()});v.orientation.addEventListener("pointerdown",function(a){a.stopPropagation()});v.orientation.className="pnlm-orientation-button pnlm-orientation-button-inactive pnlm-sprite pnlm-controls pnlm-control";var Xa=!1;E.DeviceOrientationEvent&&"https:"==
location.protocol&&0<=navigator.userAgent.toLowerCase().indexOf("mobi")&&(v.container.appendChild(v.orientation),Xa=!0);var Ia=g.createElement("div");Ia.className="pnlm-compass pnlm-controls pnlm-control";J.appendChild(Ia);k.firstScene?H(k.firstScene):k.default&&k.default.firstScene?H(k.default.firstScene):H(null);l(!0);var ia=[],za=[];Y.prototype.multiply=function(a){return new Y(this.w*a.w-this.x*a.x-this.y*a.y-this.z*a.z,this.x*a.w+this.w*a.x+this.y*a.z-this.z*a.y,this.y*a.w+this.w*a.y+this.z*
a.x-this.x*a.z,this.z*a.w+this.w*a.z+this.x*a.y-this.y*a.x)};Y.prototype.toEulerAngles=function(){var a=Math.atan2(2*(this.w*this.x+this.y*this.z),1-2*(this.x*this.x+this.y*this.y)),b=Math.asin(2*(this.w*this.y-this.z*this.x)),c=Math.atan2(2*(this.w*this.z+this.x*this.y),1-2*(this.y*this.y+this.z*this.z));return[a,b,c]};this.isLoaded=function(){return Boolean(G)};this.getPitch=function(){return b.pitch};this.setPitch=function(a,c,d,e){O=Date.now();if(1E-6>=Math.abs(a-b.pitch))return"function"==typeof d&&
d(e),this;(c=c==p?1E3:Number(c))?(P.pitch={startTime:Date.now(),startPosition:b.pitch,endPosition:a,duration:c},"function"==typeof d&&setTimeout(function(){d(e)},c)):b.pitch=a;F();return this};this.getPitchBounds=function(){return[b.minPitch,b.maxPitch]};this.setPitchBounds=function(a){b.minPitch=Math.max(-90,Math.min(a[0],90));b.maxPitch=Math.max(-90,Math.min(a[1],90));return this};this.getYaw=function(){return(b.yaw+540)%360-180};this.setYaw=function(a,c,d,e){O=Date.now();if(1E-6>=Math.abs(a-b.yaw))return"function"==
typeof d&&d(e),this;c=c==p?1E3:Number(c);a=(a+180)%360-180;c?(180<b.yaw-a?a+=360:180<a-b.yaw&&(a-=360),P.yaw={startTime:Date.now(),startPosition:b.yaw,endPosition:a,duration:c},"function"==typeof d&&setTimeout(function(){d(e)},c)):b.yaw=a;F();return this};this.getYawBounds=function(){return[b.minYaw,b.maxYaw]};this.setYawBounds=function(a){b.minYaw=Math.max(-360,Math.min(a[0],360));b.maxYaw=Math.max(-360,Math.min(a[1],360));return this};this.getHfov=function(){return b.hfov};this.setHfov=function(a,
c,d,e){O=Date.now();if(1E-6>=Math.abs(a-b.hfov))return"function"==typeof d&&d(e),this;(c=c==p?1E3:Number(c))?(P.hfov={startTime:Date.now(),startPosition:b.hfov,endPosition:u(a),duration:c},"function"==typeof d&&setTimeout(function(){d(e)},c)):x(a);F();return this};this.getHfovBounds=function(){return[b.minHfov,b.maxHfov]};this.setHfovBounds=function(a){b.minHfov=Math.max(0,a[0]);b.maxHfov=Math.max(0,a[1]);return this};this.lookAt=function(a,c,d,e,f,g){e=e==p?1E3:Number(e);a!==p&&1E-6<Math.abs(a-b.pitch)&&
(this.setPitch(a,e,f,g),f=p);c!==p&&1E-6<Math.abs(c-b.yaw)&&(this.setYaw(c,e,f,g),f=p);d!==p&&1E-6<Math.abs(d-b.hfov)&&(this.setHfov(d,e,f,g),f=p);"function"==typeof f&&f(g);return this};this.getNorthOffset=function(){return b.northOffset};this.setNorthOffset=function(a){b.northOffset=Math.min(360,Math.max(0,a));F();return this};this.getHorizonRoll=function(){return b.horizonRoll};this.setHorizonRoll=function(a){b.horizonRoll=Math.min(90,Math.max(-90,a));C.setPose(b.horizonPitch*Math.PI/180,b.horizonRoll*
Math.PI/180);F();return this};this.getHorizonPitch=function(){return b.horizonPitch};this.setHorizonPitch=function(a){b.horizonPitch=Math.min(90,Math.max(-90,a));C.setPose(b.horizonPitch*Math.PI/180,b.horizonRoll*Math.PI/180);F();return this};this.startAutoRotate=function(a,c){a=a||Z||1;c=c===p?Ga:c;b.autoRotate=a;da.lookAt(c,p,ra,3E3);F();return this};this.stopAutoRotate=function(){Z=b.autoRotate?b.autoRotate:Z;b.autoRotate=!1;b.autoRotateInactivityDelay=-1;return this};this.stopMovement=function(){t();
w={yaw:0,pitch:0,hfov:0}};this.getRenderer=function(){return C};this.setUpdate=function(a){Ma=!0===a;C===p?pa():F();return this};this.mouseEventToCoords=function(a){return ta(a)};this.loadScene=function(a,b,c,d){!1!==G&&y(a,b,c,d);return this};this.getScene=function(){return b.scene};this.addScene=function(a,b){k.scenes[a]=b;return this};this.removeScene=function(a){if(b.scene===a||!k.scenes.hasOwnProperty(a))return!1;delete k.scenes[a];return!0};this.toggleFullscreen=function(){f();return this};
this.getConfig=function(){return b};this.getContainer=function(){return r};this.addHotSpot=function(a,c){if(c===p&&b.scene===p)b.hotSpots.push(a);else{var d=c!==p?c:b.scene;if(k.scenes.hasOwnProperty(d))k.scenes[d].hasOwnProperty("hotSpots")||(k.scenes[d].hotSpots=[],d==b.scene&&(b.hotSpots=k.scenes[d].hotSpots)),k.scenes[d].hotSpots.push(a);else throw"Invalid scene ID!";}if(c===p||b.scene==c)La(a),G&&Ca(a);return this};this.removeHotSpot=function(a,c){if(c===p||b.scene==c){if(!b.hotSpots)return!1;
for(var d=0;d<b.hotSpots.length;d++)if(b.hotSpots[d].hasOwnProperty("id")&&b.hotSpots[d].id===a){for(var e=b.hotSpots[d].div;e.parentNode!=N;)e=e.parentNode;N.removeChild(e);delete b.hotSpots[d].div;b.hotSpots.splice(d,1);return!0}}else if(k.scenes.hasOwnProperty(c)){if(!k.scenes[c].hasOwnProperty("hotSpots"))return!1;for(d=0;d<k.scenes[c].hotSpots.length;d++)if(k.scenes[c].hotSpots[d].hasOwnProperty("id")&&k.scenes[c].hotSpots[d].id===a)return k.scenes[c].hotSpots.splice(d,1),!0}else return!1};this.resize=
function(){C&&z()};this.isLoaded=function(){return G};this.isOrientationSupported=function(){return Xa||!1};this.stopOrientation=function(){Da()};this.startOrientation=function(){Ra()};this.isOrientationActive=function(){return Boolean(X)};this.on=function(a,b){T[a]=T[a]||[];T[a].push(b);return this};this.off=function(a,b){if(!a)return T={},this;if(b){var c=T[a].indexOf(b);0<=c&&T[a].splice(c,1);0==T[a].length&&delete T[a]}else delete T[a];return this};this.destroy=function(){Za=!0;clearTimeout(Qa);
C&&C.destroy();Sa&&(g.removeEventListener("mousemove",ua,!1),g.removeEventListener("mouseup",ma,!1),r.removeEventListener("mozfullscreenchange",d,!1),r.removeEventListener("webkitfullscreenchange",d,!1),r.removeEventListener("msfullscreenchange",d,!1),r.removeEventListener("fullscreenchange",d,!1),E.removeEventListener("resize",z,!1),E.removeEventListener("orientationchange",z,!1),r.removeEventListener("keydown",V,!1),r.removeEventListener("keyup",R,!1),r.removeEventListener("blur",$,!1),g.removeEventListener("mouseleave",
ma,!1));r.innerHTML="";r.classList.remove("pnlm-container")}}return{viewer:function(g,k){return new Ba(g,k)}}}(window,document);
// Pannellum eeb9383, https://github.com/mpetroff/pannellum
window.libpannellum=function(D,f,h){function ka(G){function la(a,c){return 1==a.level&&1!=c.level?-1:1==c.level&&1!=a.level?1:c.timestamp-a.timestamp}function Z(a,c){return a.level!=c.level?a.level-c.level:a.diff-c.diff}function ma(a,c,e,f,k,d,g){this.vertices=a;this.side=c;this.level=e;this.x=f;this.y=k;this.path=d.replace("%s",c).replace("%l",e).replace("%x",f).replace("%y",k);this.parentPath=g}function Na(a,c,f,C,k){var d;var g=c.vertices;d=na(a,g.slice(0,3));var v=na(a,g.slice(3,6)),h=na(a,g.slice(6,
9)),g=na(a,g.slice(9,12)),u=d[0]+v[0]+h[0]+g[0];-4==u||4==u?d=!1:(u=d[1]+v[1]+h[1]+g[1],d=-4==u||4==u?!1:4!=d[2]+v[2]+h[2]+g[2]);if(d){d=c.vertices;v=d[0]+d[3]+d[6]+d[9];h=d[1]+d[4]+d[7]+d[10];g=d[2]+d[5]+d[8]+d[11];u=Math.sqrt(v*v+h*h+g*g);g=Math.asin(g/u);v=Math.atan2(h,v)-C;v+=v>Math.PI?-2*Math.PI:v<-Math.PI?2*Math.PI:0;v=Math.abs(v);c.diff=Math.acos(Math.sin(f)*Math.sin(g)+Math.cos(f)*Math.cos(g)*Math.cos(v));v=!1;for(h=0;h<e.nodeCache.length;h++)if(e.nodeCache[h].path==c.path){v=!0;e.nodeCache[h].timestamp=
e.nodeCacheTimestamp++;e.nodeCache[h].diff=c.diff;e.currentNodes.push(e.nodeCache[h]);break}v||(c.timestamp=e.nodeCacheTimestamp++,e.currentNodes.push(c),e.nodeCache.push(c));if(c.level<e.level){var g=l.cubeResolution*Math.pow(2,c.level-l.maxLevel),v=Math.ceil(g*l.invTileResolution)-1,h=g%l.tileResolution*2,s=2*g%l.tileResolution;0===s&&(s=l.tileResolution);0===h&&(h=2*l.tileResolution);u=0.5;if(c.x==v||c.y==v)u=1-l.tileResolution/(l.tileResolution+s);var z=1-u,g=[],m=u,q=u,b=u,A=z,K=z,B=z;if(s<l.tileResolution)if(c.x==
v&&c.y!=v){if(K=q=0.5,"d"==c.side||"u"==c.side)B=b=0.5}else c.x!=v&&c.y==v&&(A=m=0.5,"l"==c.side||"r"==c.side)&&(B=b=0.5);h<=l.tileResolution&&(c.x==v&&(m=0,A=1,"l"==c.side||"r"==c.side)&&(b=0,B=1),c.y==v&&(q=0,K=1,"d"==c.side||"u"==c.side)&&(b=0,B=1));s=new Float32Array([d[0],d[1],d[2],d[0]*m+d[3]*A,d[1]*u+d[4]*z,d[2]*b+d[5]*B,d[0]*m+d[6]*A,d[1]*q+d[7]*K,d[2]*b+d[8]*B,d[0]*u+d[9]*z,d[1]*q+d[10]*K,d[2]*b+d[11]*B]);s=new ma(s,c.side,c.level+1,2*c.x,2*c.y,l.fullpath,c.path);g.push(s);c.x==v&&h<=l.tileResolution||
(s=new Float32Array([d[0]*m+d[3]*A,d[1]*u+d[4]*z,d[2]*b+d[5]*B,d[3],d[4],d[5],d[3]*u+d[6]*z,d[4]*q+d[7]*K,d[5]*b+d[8]*B,d[0]*m+d[6]*A,d[1]*q+d[7]*K,d[2]*b+d[8]*B]),s=new ma(s,c.side,c.level+1,2*c.x+1,2*c.y,l.fullpath,c.path),g.push(s));c.x==v&&h<=l.tileResolution||c.y==v&&h<=l.tileResolution||(s=new Float32Array([d[0]*m+d[6]*A,d[1]*q+d[7]*K,d[2]*b+d[8]*B,d[3]*u+d[6]*z,d[4]*q+d[7]*K,d[5]*b+d[8]*B,d[6],d[7],d[8],d[9]*m+d[6]*A,d[10]*u+d[7]*z,d[11]*b+d[8]*B]),s=new ma(s,c.side,c.level+1,2*c.x+1,2*c.y+
1,l.fullpath,c.path),g.push(s));c.y==v&&h<=l.tileResolution||(s=new Float32Array([d[0]*u+d[9]*z,d[1]*q+d[10]*K,d[2]*b+d[11]*B,d[0]*m+d[6]*A,d[1]*q+d[7]*K,d[2]*b+d[8]*B,d[9]*m+d[6]*A,d[10]*u+d[7]*z,d[11]*b+d[8]*B,d[9],d[10],d[11]]),s=new ma(s,c.side,c.level+1,2*c.x,2*c.y+1,l.fullpath,c.path),g.push(s));for(c=0;c<g.length;c++)Na(a,g[c],f,C,k)}}}function oa(){return new Float32Array([-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,
1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,1,1,-1,1,1,-1,-1])}function xa(a,c,e){var f=Math.sin(c);c=Math.cos(c);if("x"==e)return new Float32Array([a[0],c*a[1]+f*a[2],c*a[2]-f*a[1],a[3],c*a[4]+f*a[5],c*a[5]-f*a[4],a[6],c*a[7]+f*a[8],c*a[8]-f*a[7]]);if("y"==e)return new Float32Array([c*a[0]-f*a[2],a[1],c*a[2]+f*a[0],c*a[3]-f*a[5],a[4],c*a[5]+f*a[3],c*a[6]-f*a[8],a[7],c*a[8]+f*a[6]]);if("z"==e)return new Float32Array([c*a[0]+f*a[1],c*a[1]-f*a[0],a[2],c*a[3]+f*a[4],c*a[4]-f*a[3],a[5],c*a[6]+f*a[7],
c*a[7]-f*a[6],a[8]])}function pa(a){return new Float32Array([a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15]])}function Ea(e,c){a.bindTexture(a.TEXTURE_2D,c);a.texImage2D(a.TEXTURE_2D,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,e);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);
a.bindTexture(a.TEXTURE_2D,null)}function Oa(a){ka(a,a.path+"."+l.extension,function(c,e){a.texture=c;a.textureLoaded=e?2:1},qa.crossOrigin)}function na(a,c){var e=new Float32Array([a[0]*c[0]+a[1]*c[1]+a[2]*c[2],a[4]*c[0]+a[5]*c[1]+a[6]*c[2],a[11]+a[8]*c[0]+a[9]*c[1]+a[10]*c[2],1/(a[12]*c[0]+a[13]*c[1]+a[14]*c[2])]),f=e[0]*e[3],k=e[1]*e[3],e=e[2]*e[3],d=[0,0,0];-1>f&&(d[0]=-1);1<f&&(d[0]=1);-1>k&&(d[1]=-1);1<k&&(d[1]=1);if(-1>e||1<e)d[2]=1;return d}function Pa(){console.log("Reducing canvas size due to error 1286!");
E.width=Math.round(E.width/2);E.height=Math.round(E.height/2)}var E=f.createElement("canvas");E.style.width=E.style.height="100%";G.appendChild(E);var e,a,T,U,$,Q,Fa,aa,l,s,ga,Ga,ba,ra,Ha,qa,ya="fbudlr".split("");this.init=function(H,c,Ma,C,k,d,g,v){function S(b){if(D){var a=b*b*4,c=new Uint8ClampedArray(a),d=v.backgroundColor?v.backgroundColor:[0,0,0];d[0]*=255;d[1]*=255;d[2]*=255;for(var e=0;e<a;e++)c[e++]=d[0],c[e++]=d[1],c[e++]=d[2];b=new ImageData(c,b,b);for(u=0;6>u;u++)0==l[u].width&&(l[u]=
b)}}c===h&&(c="equirectangular");if("equirectangular"!=c&&"cubemap"!=c&&"multires"!=c)throw console.log("Error: invalid image type specified!"),{type:"config error"};s=c;l=H;ga=Ma;qa=v||{};if(e){T&&(a.detachShader(e,T),a.deleteShader(T));U&&(a.detachShader(e,U),a.deleteShader(U));a.bindBuffer(a.ARRAY_BUFFER,null);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,null);e.texture&&a.deleteTexture(e.texture);if(e.nodeCache)for(H=0;H<e.nodeCache.length;H++)a.deleteTexture(e.nodeCache[H].texture);a.deleteProgram(e);
e=h}aa=h;var u,D=!1,z;if("cubemap"==s)for(u=0;6>u;u++)0<l[u].width?(z===h&&(z=l[u].width),z!=l[u].width&&console.log("Cube faces have inconsistent widths: "+z+" vs. "+l[u].width)):D=!0;"cubemap"==s&&0!==(z&z-1)&&(navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/)||navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 9_/)||navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 10_/)||navigator.userAgent.match(/Trident.*rv[ :]*11\./))||(a||(a=E.getContext("experimental-webgl",
{alpha:!1,depth:!1})),a&&1286==a.getError()&&Pa());if(!a&&("multires"==s&&l.hasOwnProperty("fallbackPath")||"cubemap"==s)&&("WebkitAppearance"in f.documentElement.style||navigator.userAgent.match(/Trident.*rv[ :]*11\./)||-1!==navigator.appVersion.indexOf("MSIE 10"))){Q&&G.removeChild(Q);Q=f.createElement("div");Q.className="pnlm-world";C=l.basePath?l.basePath+l.fallbackPath:l.fallbackPath;var O=0;k=function(){var b=f.createElement("canvas");b.className="pnlm-face pnlm-"+ya[this.side]+"face";Q.appendChild(b);
var a=b.getContext("2d");b.style.width=this.width+4+"px";b.style.height=this.height+4+"px";b.width=this.width+4;b.height=this.height+4;a.drawImage(this,2,2);var c=a.getImageData(0,0,b.width,b.height),d=c.data,e,g;for(e=2;e<b.width-2;e++)for(g=0;4>g;g++)d[4*(e+b.width)+g]=d[4*(e+2*b.width)+g],d[4*(e+b.width*(b.height-2))+g]=d[4*(e+b.width*(b.height-3))+g];for(e=2;e<b.height-2;e++)for(g=0;4>g;g++)d[4*(e*b.width+1)+g]=d[4*(e*b.width+2)+g],d[4*((e+1)*b.width-2)+g]=d[4*((e+1)*b.width-3)+g];for(g=0;4>g;g++)d[4*
(b.width+1)+g]=d[4*(2*b.width+2)+g],d[4*(2*b.width-2)+g]=d[4*(3*b.width-3)+g],d[4*(b.width*(b.height-2)+1)+g]=d[4*(b.width*(b.height-3)+2)+g],d[4*(b.width*(b.height-1)-2)+g]=d[4*(b.width*(b.height-2)-3)+g];for(e=1;e<b.width-1;e++)for(g=0;4>g;g++)d[4*e+g]=d[4*(e+b.width)+g],d[4*(e+b.width*(b.height-1))+g]=d[4*(e+b.width*(b.height-2))+g];for(e=1;e<b.height-1;e++)for(g=0;4>g;g++)d[e*b.width*4+g]=d[4*(e*b.width+1)+g],d[4*((e+1)*b.width-1)+g]=d[4*((e+1)*b.width-2)+g];for(g=0;4>g;g++)d[g]=d[4*(b.width+
1)+g],d[4*(b.width-1)+g]=d[4*(2*b.width-2)+g],d[b.width*(b.height-1)*4+g]=d[4*(b.width*(b.height-2)+1)+g],d[4*(b.width*b.height-1)+g]=d[4*(b.width*(b.height-1)-2)+g];a.putImageData(c,0,0);P.call(this)};var P=function(){0<this.width?($===h&&($=this.width),$!=this.width&&console.log("Fallback faces have inconsistent widths: "+$+" vs. "+this.width)):D=!0;O++;6==O&&($=this.width,G.appendChild(Q),g())},D=!1;for(u=0;6>u;u++)d=new Image,d.crossOrigin=qa.crossOrigin?qa.crossOrigin:"anonymous",d.side=u,d.onload=
k,d.onerror=P,d.src="multires"==s?C.replace("%s",ya[u])+"."+l.extension:l[u].src;S($)}else{if(!a)throw console.log("Error: no WebGL support detected!"),{type:"no webgl"};"cubemap"==s&&S(z);l.fullpath=l.basePath?l.basePath+l.path:l.path;l.invTileResolution=1/l.tileResolution;H=oa();Fa=[];for(u=0;6>u;u++)Fa[u]=H.slice(12*u,12*u+12),H=oa();H=0;if("equirectangular"==s){if(H=a.getParameter(a.MAX_TEXTURE_SIZE),Math.max(l.width/2,l.height)>H)throw console.log("Error: The image is too big; it's "+l.width+
"px wide, but this device's maximum supported size is "+2*H+"px."),{type:"webgl size error",width:l.width,maxWidth:2*H};}else if("cubemap"==s&&z>a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE))throw console.log("Error: The image is too big; it's "+z+"px wide, but this device's maximum supported size is "+H+"px."),{type:"webgl size error",width:z,maxWidth:H};v!==h&&(z=isNaN(v.horizonPitch)?0:Number(v.horizonPitch),c=isNaN(v.horizonRoll)?0:Number(v.horizonRoll),0!=z||0!=c)&&(aa=[z,c]);z=a.TEXTURE_2D;a.viewport(0,
0,a.drawingBufferWidth,a.drawingBufferHeight);a.getShaderPrecisionFormat&&(c=a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT))&&1>c.precision&&(sa=sa.replace("highp","mediump"));T=a.createShader(a.VERTEX_SHADER);c=m;"multires"==s&&(c=q);a.shaderSource(T,c);a.compileShader(T);U=a.createShader(a.FRAGMENT_SHADER);c=ia;"cubemap"==s?(z=a.TEXTURE_CUBE_MAP,c=ta):"multires"==s&&(c=eb);a.shaderSource(U,c);a.compileShader(U);e=a.createProgram();a.attachShader(e,T);a.attachShader(e,U);a.linkProgram(e);
a.getShaderParameter(T,a.COMPILE_STATUS)||console.log(a.getShaderInfoLog(T));a.getShaderParameter(U,a.COMPILE_STATUS)||console.log(a.getShaderInfoLog(U));a.getProgramParameter(e,a.LINK_STATUS)||console.log(a.getProgramInfoLog(e));a.useProgram(e);e.drawInProgress=!1;c=v.backgroundColor?v.backgroundColor:[0,0,0];a.clearColor(c[0],c[1],c[2],1);a.clear(a.COLOR_BUFFER_BIT);e.texCoordLocation=a.getAttribLocation(e,"a_texCoord");a.enableVertexAttribArray(e.texCoordLocation);"multires"!=s?(Ga||(Ga=a.createBuffer()),
a.bindBuffer(a.ARRAY_BUFFER,Ga),a.bufferData(a.ARRAY_BUFFER,new Float32Array([-1,1,1,1,1,-1,-1,1,1,-1,-1,-1]),a.STATIC_DRAW),a.vertexAttribPointer(e.texCoordLocation,2,a.FLOAT,!1,0,0),e.aspectRatio=a.getUniformLocation(e,"u_aspectRatio"),a.uniform1f(e.aspectRatio,a.drawingBufferWidth/a.drawingBufferHeight),e.psi=a.getUniformLocation(e,"u_psi"),e.theta=a.getUniformLocation(e,"u_theta"),e.f=a.getUniformLocation(e,"u_f"),e.h=a.getUniformLocation(e,"u_h"),e.v=a.getUniformLocation(e,"u_v"),e.vo=a.getUniformLocation(e,
"u_vo"),e.rot=a.getUniformLocation(e,"u_rot"),a.uniform1f(e.h,C/(2*Math.PI)),a.uniform1f(e.v,k/Math.PI),a.uniform1f(e.vo,d/Math.PI*2),"equirectangular"==s&&(e.backgroundColor=a.getUniformLocation(e,"u_backgroundColor"),a.uniform4fv(e.backgroundColor,c.concat([1]))),e.texture=a.createTexture(),a.bindTexture(z,e.texture),"cubemap"==s?(a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,l[1]),a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_X,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,l[3]),a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_Y,
0,a.RGB,a.RGB,a.UNSIGNED_BYTE,l[4]),a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,l[5]),a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_Z,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,l[0]),a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,l[2])):l.width<=H?(a.uniform1i(a.getUniformLocation(e,"u_splitImage"),0),a.texImage2D(z,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,l)):(a.uniform1i(a.getUniformLocation(e,"u_splitImage"),1),C=f.createElement("canvas"),C.width=l.width/2,C.height=l.height,
C=C.getContext("2d"),C.drawImage(l,0,0),k=C.getImageData(0,0,l.width/2,l.height),a.texImage2D(z,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,k),e.texture2=a.createTexture(),a.activeTexture(a.TEXTURE1),a.bindTexture(z,e.texture2),a.uniform1i(a.getUniformLocation(e,"u_image1"),1),C.drawImage(l,-l.width/2,0),k=C.getImageData(0,0,l.width/2,l.height),a.texImage2D(z,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,k),a.texParameteri(z,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(z,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(z,
a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(z,a.TEXTURE_MAG_FILTER,a.LINEAR),a.activeTexture(a.TEXTURE0)),a.texParameteri(z,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(z,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(z,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(z,a.TEXTURE_MAG_FILTER,a.LINEAR)):(e.vertPosLocation=a.getAttribLocation(e,"a_vertCoord"),a.enableVertexAttribArray(e.vertPosLocation),ba||(ba=a.createBuffer()),ra||(ra=a.createBuffer()),Ha||(Ha=a.createBuffer()),a.bindBuffer(a.ARRAY_BUFFER,
ra),a.bufferData(a.ARRAY_BUFFER,new Float32Array([0,0,1,0,1,1,0,1]),a.STATIC_DRAW),a.vertexAttribPointer(e.texCoordLocation,2,a.FLOAT,!1,0,0),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,Ha),a.bufferData(a.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,0,2,3]),a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,ba),a.vertexAttribPointer(e.vertPosLocation,3,a.FLOAT,!1,0,0),e.perspUniform=a.getUniformLocation(e,"u_perspMatrix"),e.cubeUniform=a.getUniformLocation(e,"u_cubeMatrix"),e.level=-1,e.currentNodes=[],e.nodeCache=
[],e.nodeCacheTimestamp=0,e.textureLoads=[]);C=a.getError();if(0!==C)throw console.log("Error: Something went wrong with WebGL!",C),{type:"webgl error"};g()}};this.destroy=function(){G!==h&&(E!==h&&G.contains(E)&&G.removeChild(E),Q!==h&&G.contains(Q)&&G.removeChild(Q));if(a){var e=a.getExtension("WEBGL_lose_context");e&&e.loseContext()}};this.resize=function(){var f=D.devicePixelRatio||1;E.width=E.clientWidth*f;E.height=E.clientHeight*f;a&&(1286==a.getError()&&Pa(),a.viewport(0,0,a.drawingBufferWidth,
a.drawingBufferHeight),"multires"!=s&&a.uniform1f(e.aspectRatio,E.clientWidth/E.clientHeight))};this.resize();this.setPose=function(a,c){a=isNaN(a)?0:Number(a);c=isNaN(c)?0:Number(c);aa=0==a&&0==c?h:[a,c]};this.render=function(f,c,m,q){var k,d=0;q===h&&(q={});q.roll&&(d=q.roll);if(aa!==h){k=aa[0];var g=aa[1],v=f,S=c,u=Math.cos(g)*Math.sin(f)*Math.sin(k)+Math.cos(f)*(Math.cos(k)*Math.cos(c)+Math.sin(g)*Math.sin(k)*Math.sin(c)),G=-Math.sin(f)*Math.sin(g)+Math.cos(f)*Math.cos(g)*Math.sin(c);f=Math.cos(g)*
Math.cos(k)*Math.sin(f)+Math.cos(f)*(-Math.cos(c)*Math.sin(k)+Math.cos(k)*Math.sin(g)*Math.sin(c));f=Math.asin(Math.max(Math.min(f,1),-1));c=Math.atan2(G,u);k=[Math.cos(v)*(Math.sin(g)*Math.sin(k)*Math.cos(S)-Math.cos(k)*Math.sin(S)),Math.cos(v)*Math.cos(g)*Math.cos(S),Math.cos(v)*(Math.cos(k)*Math.sin(g)*Math.cos(S)+Math.sin(S)*Math.sin(k))];g=[-Math.cos(f)*Math.sin(c),Math.cos(f)*Math.cos(c)];g=Math.acos(Math.max(Math.min((k[0]*g[0]+k[1]*g[1])/(Math.sqrt(k[0]*k[0]+k[1]*k[1]+k[2]*k[2])*Math.sqrt(g[0]*
g[0]+g[1]*g[1])),1),-1));0>k[2]&&(g=2*Math.PI-g);d+=g}if(a||"multires"!=s&&"cubemap"!=s){if("multires"!=s)m=2*Math.atan(Math.tan(0.5*m)/(a.drawingBufferWidth/a.drawingBufferHeight)),m=1/Math.tan(0.5*m),a.uniform1f(e.psi,c),a.uniform1f(e.theta,f),a.uniform1f(e.rot,d),a.uniform1f(e.f,m),!0===ga&&"equirectangular"==s&&(a.bindTexture(a.TEXTURE_2D,e.texture),a.texImage2D(a.TEXTURE_2D,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,l)),a.drawArrays(a.TRIANGLES,0,6);else{k=a.drawingBufferWidth/a.drawingBufferHeight;g=2*Math.atan(Math.tan(m/
2)*a.drawingBufferHeight/a.drawingBufferWidth);g=1/Math.tan(g/2);k=new Float32Array([g/k,0,0,0,0,g,0,0,0,0,100.1/-99.9,20/-99.9,0,0,-1,0]);for(g=1;g<l.maxLevel&&a.drawingBufferWidth>l.tileResolution*Math.pow(2,g-1)*Math.tan(m/2)*0.707;)g++;e.level=g;g=new Float32Array([1,0,0,0,1,0,0,0,1]);g=xa(g,-d,"z");g=xa(g,-f,"x");g=xa(g,c,"y");g=new Float32Array([g[0],g[1],g[2],0,g[3],g[4],g[5],0,g[6],g[7],g[8],0,0,0,0,1]);a.uniformMatrix4fv(e.perspUniform,!1,pa(k));a.uniformMatrix4fv(e.cubeUniform,!1,pa(g));
d=new Float32Array([k[0]*g[0],k[0]*g[1],k[0]*g[2],0,k[5]*g[4],k[5]*g[5],k[5]*g[6],0,k[10]*g[8],k[10]*g[9],k[10]*g[10],k[11],-g[8],-g[9],-g[10],0]);e.nodeCache.sort(la);if(200<e.nodeCache.length&&e.nodeCache.length>e.currentNodes.length+50)for(k=e.nodeCache.splice(200,e.nodeCache.length-200),g=0;g<k.length;g++)a.deleteTexture(k[g].texture);e.currentNodes=[];for(k=0;6>k;k++)g=new ma(Fa[k],ya[k],1,0,0,l.fullpath,null),Na(d,g,f,c,m);e.currentNodes.sort(Z);for(f=V.length-1;0<=f;f--)-1===e.currentNodes.indexOf(V[f].node)&&
(V[f].node.textureLoad=!1,V.splice(f,1));if(0===V.length)for(f=0;f<e.currentNodes.length;f++)if(c=e.currentNodes[f],!c.texture&&!c.textureLoad){c.textureLoad=!0;setTimeout(Ia,0,c);break}0<e.textureLoads.length&&e.textureLoads.shift()();if(!e.drawInProgress){e.drawInProgress=!0;a.clear(a.COLOR_BUFFER_BIT);f={};for(c=0;c<e.currentNodes.length;c++)f[e.currentNodes[c].parentPath]|=!(1<e.currentNodes[c].textureLoaded);for(c=0;c<e.currentNodes.length;c++)1<e.currentNodes[c].textureLoaded&&0!=f[e.currentNodes[c].path]&&
(a.bufferData(a.ARRAY_BUFFER,e.currentNodes[c].vertices,a.STATIC_DRAW),a.bindTexture(a.TEXTURE_2D,e.currentNodes[c].texture),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0));e.drawInProgress=!1}}if(q.returnImage!==h)return D.createImageBitmap&&"ImageBitmap"==q.returnImage?createImageBitmap(E):0==q.returnImage.toString().indexOf("image/")?E.toDataURL(q.returnImage):E.toDataURL("image/png")}else for(k=$/2,q={f:"translate3d(-"+(k+2)+"px, -"+(k+2)+"px, -"+k+"px)",b:"translate3d("+(k+2)+"px, -"+(k+2)+
"px, "+k+"px) rotateX(180deg) rotateZ(180deg)",u:"translate3d(-"+(k+2)+"px, -"+k+"px, "+(k+2)+"px) rotateX(270deg)",d:"translate3d(-"+(k+2)+"px, "+k+"px, -"+(k+2)+"px) rotateX(90deg)",l:"translate3d(-"+k+"px, -"+(k+2)+"px, "+(k+2)+"px) rotateX(180deg) rotateY(90deg) rotateZ(180deg)",r:"translate3d("+k+"px, -"+(k+2)+"px, -"+(k+2)+"px) rotateY(270deg)"},m=1/Math.tan(m/2),m=m*E.clientWidth/2+"px",c="perspective("+m+") translateZ("+m+") rotateX("+f+"rad) rotateY("+c+"rad) ",m=Object.keys(q),f=0;6>f;f++)if(d=
Q.querySelector(".pnlm-"+m[f]+"face"))d.style.webkitTransform=c+q[m[f]],d.style.transform=c+q[m[f]]};this.isLoading=function(){if(a&&"multires"==s)for(var f=0;f<e.currentNodes.length;f++)if(!e.currentNodes[f].textureLoaded)return!0;return!1};this.getCanvas=function(){return E};var V=[],ka=function(){function f(){var a=this;this.texture=this.callback=null;this.image=new Image;this.image.crossOrigin=k?k:"anonymous";var c=function(){e.textureLoads.push(function(){0<a.image.width&&0<a.image.height?(Ea(a.image,
a.texture),a.callback(a.texture,!0)):a.callback(a.texture,!1);if(V.length){var c=V.shift();a.loadTexture(c.src,c.texture,c.callback)}else l[h++]=a})};this.image.addEventListener("load",c);this.image.addEventListener("error",c)}function c(a,c,d,e){this.node=a;this.src=c;this.texture=d;this.callback=e}var h=4,l={},k;f.prototype.loadTexture=function(a,c,d){this.texture=c;this.callback=d;this.image.src=a};for(var d=0;d<h;d++)l[d]=new f;return function(d,e,f,m){k=m;m=a.createTexture();h?l[--h].loadTexture(e,
m,f):V.push(new c(d,e,m,f));return m}}(),Ia;if(D.Worker&&D.createImageBitmap){var za=new Blob(["("+function(){self.onmessage=function(a){var c=a.data[0];fetch(c,{mode:"cors",credentials:"use-credentials"==a.data[1]?"include":"same-origin"}).then(function(a){return a.blob()}).then(function(a){return createImageBitmap(a)}).then(function(a){postMessage([c,!0,a],[a])}).catch(function(){postMessage([c,!1])})}}.toString()+")()"],{type:"application/javascript"}),ua=new Worker(URL.createObjectURL(za)),va=
{};ua.onmessage=function(f){var c=f.data[0],h=f.data[1],l=f.data[2];e.textureLoads.push(function(){var e,d=!1;h&&(e=a.createTexture(),Ea(l,e),d=!0);var f=va[c];delete va[c];f.texture=e;f.textureLoaded=d?2:1})};Ia=function(a){var c=(new URL(a.path+"."+l.extension,D.location)).href;va[c]=a;ua.postMessage([c,qa.crossOrigin])}}else Ia=Oa}var m="attribute vec2 a_texCoord;varying vec2 v_texCoord;void main() {gl_Position = vec4(a_texCoord, 0.0, 1.0);v_texCoord = a_texCoord;}",q="attribute vec3 a_vertCoord;attribute vec2 a_texCoord;uniform mat4 u_cubeMatrix;uniform mat4 u_perspMatrix;varying mediump vec2 v_texCoord;void main(void) {gl_Position = u_perspMatrix * u_cubeMatrix * vec4(a_vertCoord, 1.0);v_texCoord = a_texCoord;}",
sa="precision highp float;\nuniform float u_aspectRatio;\nuniform float u_psi;\nuniform float u_theta;\nuniform float u_f;\nuniform float u_h;\nuniform float u_v;\nuniform float u_vo;\nuniform float u_rot;\nconst float PI = 3.14159265358979323846264;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nuniform bool u_splitImage;\nuniform samplerCube u_imageCube;\nvarying vec2 v_texCoord;\nuniform vec4 u_backgroundColor;\nvoid main() {\nfloat x = v_texCoord.x * u_aspectRatio;\nfloat y = v_texCoord.y;\nfloat sinrot = sin(u_rot);\nfloat cosrot = cos(u_rot);\nfloat rot_x = x * cosrot - y * sinrot;\nfloat rot_y = x * sinrot + y * cosrot;\nfloat sintheta = sin(u_theta);\nfloat costheta = cos(u_theta);\nfloat a = u_f * costheta - rot_y * sintheta;\nfloat root = sqrt(rot_x * rot_x + a * a);\nfloat lambda = atan(rot_x / root, a / root) + u_psi;\nfloat phi = atan((rot_y * costheta + u_f * sintheta) / root);",
ta=sa+"float cosphi = cos(phi);\ngl_FragColor = textureCube(u_imageCube, vec3(cosphi*sin(lambda), sin(phi), cosphi*cos(lambda)));\n}",ia=sa+"lambda = mod(lambda + PI, PI * 2.0) - PI;\nvec2 coord = vec2(lambda / PI, phi / (PI / 2.0));\nif(coord.x < -u_h || coord.x > u_h || coord.y < -u_v + u_vo || coord.y > u_v + u_vo)\ngl_FragColor = u_backgroundColor;\nelse {\nif(u_splitImage) {\nif(coord.x < 0.0)\ngl_FragColor = texture2D(u_image0, vec2((coord.x + u_h) / u_h, (-coord.y + u_v + u_vo) / (u_v * 2.0)));\nelse\ngl_FragColor = texture2D(u_image1, vec2((coord.x + u_h) / u_h - 1.0, (-coord.y + u_v + u_vo) / (u_v * 2.0)));\n} else {\ngl_FragColor = texture2D(u_image0, vec2((coord.x + u_h) / (u_h * 2.0), (-coord.y + u_v + u_vo) / (u_v * 2.0)));\n}\n}\n}",
eb="varying mediump vec2 v_texCoord;uniform sampler2D u_sampler;void main(void) {gl_FragColor = texture2D(u_sampler, v_texCoord);}";return{renderer:function(f,h,m,q){return new ka(f,h,m,q)}}}(window,document);
window.pannellum=function(D,f,h){function ka(m,q){function sa(){var n=f.createElement("div");n.innerHTML="\x3c!--[if lte IE 9]><i></i><![endif]--\x3e";if(1==n.getElementsByTagName("i").length)G();else{wa=b.hfov;Ja=b.pitch;var a;if("cubemap"==b.type){I=[];for(n=0;6>n;n++)I.push(new Image),I[n].crossOrigin=b.crossOrigin;r.load.lbox.style.display="block";r.load.lbar.style.display="none"}else if("multires"==b.type)n=JSON.parse(JSON.stringify(b.multiRes)),b.basePath&&b.multiRes.basePath&&!/^(?:[a-z]+:)?\/\//i.test(b.multiRes.basePath)?
n.basePath=b.basePath+b.multiRes.basePath:b.multiRes.basePath?n.basePath=b.multiRes.basePath:b.basePath&&(n.basePath=b.basePath),I=n;else if(!0===b.dynamic)I=b.panorama;else{if(b.panorama===h){G(b.strings.noPanoramaError);return}I=new Image}if("cubemap"==b.type)for(var y=6,c=function(){y--;0===y&&ia()},d=function(n){var a=f.createElement("a");a.href=n.target.src;a.textContent=a.href;G(b.strings.fileAccessError.replace("%s",a.outerHTML))},n=0;n<I.length;n++)a=b.cubeMap[n],"null"==a?(console.log("Will use background instead of missing cubemap face "+
n),c()):(b.basePath&&!ta(a)&&(a=b.basePath+a),I[n].onload=c,I[n].onerror=d,I[n].src=fa(a));else if("multires"==b.type)ia();else if(a="",b.basePath&&(a=b.basePath),!0!==b.dynamic){if(b.panorama instanceof Image||b.panorama instanceof ImageData||b.panorama instanceof ImageBitmap){I=b.panorama;ia();return}a=ta(b.panorama)?b.panorama:a+b.panorama;I.onload=function(){D.URL.revokeObjectURL(this.src);ia()};var e=new XMLHttpRequest;e.onloadend=function(){if(200!=e.status){var n=f.createElement("a");n.href=
a;n.textContent=n.href;G(b.strings.fileAccessError.replace("%s",n.outerHTML))}ka(this.response,a);r.load.msg.innerHTML=""};e.onprogress=function(b){if(b.lengthComputable){r.load.lbarFill.style.width=b.loaded/b.total*100+"%";var n,a;1E6<b.total?(n="MB",a=(b.loaded/1E6).toFixed(2),b=(b.total/1E6).toFixed(2)):1E3<b.total?(n="kB",a=(b.loaded/1E3).toFixed(1),b=(b.total/1E3).toFixed(1)):(n="B",a=b.loaded,b=b.total);r.load.msg.innerHTML=a+" / "+b+" "+n}else r.load.lbox.style.display="block",r.load.lbar.style.display=
"none"};try{e.open("GET",a,!0)}catch(g){G(b.strings.malformedURLError)}e.responseType="blob";e.setRequestHeader("Accept","image/*,*/*;q=0.9");e.withCredentials="use-credentials"===b.crossOrigin;e.send()}b.draggable&&J.classList.add("pnlm-grab");J.classList.remove("pnlm-grabbing");Qa=!0===b.dynamicUpdate;b.dynamic&&Qa&&(I=b.panorama,ia())}}function ta(b){return/^(?:[a-z]+:)?\/\//i.test(b)||"/"==b[0]||"blob:"==b.slice(0,5)}function ia(){A||(A=new libpannellum.renderer(L));Wa||(Wa=!0,W.addEventListener("mousedown",
ma,!1),f.addEventListener("mousemove",xa,!1),f.addEventListener("mouseup",pa,!1),b.mouseZoom&&(J.addEventListener("mousewheel",a,!1),J.addEventListener("DOMMouseScroll",a,!1)),b.doubleClickZoom&&W.addEventListener("dblclick",Na,!1),m.addEventListener("mozfullscreenchange",c,!1),m.addEventListener("webkitfullscreenchange",c,!1),m.addEventListener("msfullscreenchange",c,!1),m.addEventListener("fullscreenchange",c,!1),"function"===typeof ResizeObserver?(Ra=new ResizeObserver(l),Ra.observe(m)):(D.addEventListener("resize",
l,!1),D.addEventListener("orientationchange",l,!1)),b.disableKeyboardCtrl||(m.addEventListener("keydown",T,!1),m.addEventListener("keyup",$,!1),m.addEventListener("blur",U,!1)),f.addEventListener("mouseleave",pa,!1),""===f.documentElement.style.pointerAction&&""===f.documentElement.style.touchAction?(W.addEventListener("pointerdown",Pa,!1),W.addEventListener("pointermove",E,!1),W.addEventListener("pointerup",e,!1),W.addEventListener("pointerleave",e,!1)):(W.addEventListener("touchstart",Ea,!1),W.addEventListener("touchmove",
Oa,!1),W.addEventListener("touchend",na,!1)),D.navigator.pointerEnabled&&(m.style.touchAction="none"));Ha();C(b.hfov);setTimeout(function(){},500)}function ka(n,a){var y=new FileReader;y.addEventListener("loadend",function(){var c=y.result;if(navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/)){var e=c.indexOf("\u00ff\u00c2");(0>e||65536<e)&&G(b.strings.iOS8WebGLError)}e=c.indexOf("<x:xmpmeta");if(-1<e&&!0!==b.ignoreGPanoXMP){var d=c.substring(e,c.indexOf("</x:xmpmeta>")+12),g=function(b){var n;
0<=d.indexOf(b+'="')?(n=d.substring(d.indexOf(b+'="')+b.length+2),n=n.substring(0,n.indexOf('"'))):0<=d.indexOf(b+">")&&(n=d.substring(d.indexOf(b+">")+b.length+1),n=n.substring(0,n.indexOf("<")));return n!==h?Number(n):null},c=g("GPano:FullPanoWidthPixels"),e=g("GPano:CroppedAreaImageWidthPixels"),k=g("GPano:FullPanoHeightPixels"),l=g("GPano:CroppedAreaImageHeightPixels"),m=g("GPano:CroppedAreaTopPixels"),q=g("GPano:PoseHeadingDegrees"),r=g("GPano:PosePitchDegrees"),g=g("GPano:PoseRollDegrees");
null!==c&&null!==e&&null!==k&&null!==l&&null!==m&&(0>ca.indexOf("haov")&&(b.haov=e/c*360),0>ca.indexOf("vaov")&&(b.vaov=l/k*180),0>ca.indexOf("vOffset")&&(b.vOffset=-180*((m+l/2)/k-0.5)),null!==q&&0>ca.indexOf("northOffset")&&(b.northOffset=q,!1!==b.compass&&(b.compass=!0)),null!==r&&null!==g&&(0>ca.indexOf("horizonPitch")&&(b.horizonPitch=r),0>ca.indexOf("horizonRoll")&&(b.horizonRoll=g)))}I.src=D.URL.createObjectURL(n);I.onerror=function(){(function(){return D.fetch?D.fetch(f.location.href).then(function(b){return b.headers.get("Content-Security-Policy")}):
null})().then(function(n){n&&n.split(";").find(function(b){if(b=b.match(/img-src(.*)/))return!b[1].includes("blob")})&&(console.log("CSP blocks blobs; reverting to URL."),I.crossOrigin=b.crossOrigin,I.src=a)})}});y.readAsBinaryString!==h?y.readAsBinaryString(n):y.readAsText(n)}function G(n){n===h&&(n=b.strings.genericWebGLError);r.errorMsg.innerHTML="<p>"+n+"</p>";w.load.style.display="none";r.load.box.style.display="none";r.errorMsg.style.display="table";Sa=!0;F=h;L.style.display="none";O("error",
n)}function la(b){var a=Z(b);ea.style.left=a.x+"px";ea.style.top=a.y+"px";clearTimeout(la.t1);clearTimeout(la.t2);ea.style.display="block";ea.style.opacity=1;la.t1=setTimeout(function(){ea.style.opacity=0},2E3);la.t2=setTimeout(function(){ea.style.display="none"},2500);b.preventDefault()}function Z(b){var a=m.getBoundingClientRect(),y={};y.x=(b.clientX||b.pageX)-a.left;y.y=(b.clientY||b.pageY)-a.top;return y}function ma(n){n.preventDefault();m.focus();if(F&&b.draggable&&!b.draggingHotSpot){var a=
Z(n);if(b.hotSpotDebug){var y=oa(n);console.log("Pitch: "+y[0]+", Yaw: "+y[1]+", Center Pitch: "+b.pitch+", Center Yaw: "+b.yaw+", HFOV: "+b.hfov)}k();v();b.roll=0;x.hfov=0;ha=!0;M=Date.now();Aa=a.x;Ba=a.y;Ta=b.yaw;Ua=b.pitch;J.classList.add("pnlm-grabbing");J.classList.remove("pnlm-grab");O("mousedown",n);s()}}function Na(n){b.minHfov===b.hfov?P.setHfov(wa,1E3):(n=oa(n),P.lookAt(n[0],n[1],b.minHfov,1E3))}function oa(n){var a=Z(n);n=A.getCanvas();var y=n.clientWidth,c=n.clientHeight;n=a.x/y*2-1;var c=
(1-a.y/c*2)*c/y,e=1/Math.tan(b.hfov*Math.PI/360),d=Math.sin(b.pitch*Math.PI/180),f=Math.cos(b.pitch*Math.PI/180),a=e*f-c*d,y=Math.sqrt(n*n+a*a),c=180*Math.atan((c*f+e*d)/y)/Math.PI;n=180*Math.atan2(n/y,a/y)/Math.PI+b.yaw;-180>n&&(n+=360);180<n&&(n-=360);return[c,n]}function xa(a){if(B)V(B,a);else if(ha&&F){M=Date.now();var p=A.getCanvas(),y=p.clientWidth,p=p.clientHeight;a=Z(a);var c=180*(Math.atan(Aa/y*2-1)-Math.atan(a.x/y*2-1))/Math.PI*b.hfov/90+Ta;x.yaw=(c-b.yaw)%360*0.2;b.yaw=c;y=360*Math.atan(Math.tan(b.hfov/
360*Math.PI)*p/y)/Math.PI;y=180*(Math.atan(a.y/p*2-1)-Math.atan(Ba/p*2-1))/Math.PI*y/90+Ua;x.pitch=0.2*(y-b.pitch);b.pitch=y}}function pa(b){B&&B.dragHandlerFunc&&B.dragHandlerFunc(b,B.dragHandlerArgs);B=null;ha&&(ha=!1,15<Date.now()-M&&(x.pitch=x.yaw=0),J.classList.add("pnlm-grab"),J.classList.remove("pnlm-grabbing"),M=Date.now(),O("mouseup",b))}function Ea(a){if(F&&b.draggable&&!B){k();v();b.roll=0;x.hfov=0;var p=Z(a.targetTouches[0]);Aa=p.x;Ba=p.y;if(2==a.targetTouches.length){var y=Z(a.targetTouches[1]);
Aa+=0.5*(y.x-p.x);Ba+=0.5*(y.y-p.y);Ka=Math.sqrt((p.x-y.x)*(p.x-y.x)+(p.y-y.y)*(p.y-y.y))}ha=!0;M=Date.now();Ta=b.yaw;Ua=b.pitch;O("touchstart",a);s()}}function Oa(a){if(b.draggable&&(a.preventDefault(),F&&(M=Date.now()),ha&&F)){var p=Z(a.targetTouches[0]),y=p.x,c=p.y;2==a.targetTouches.length&&-1!=Ka&&(a=Z(a.targetTouches[1]),y+=0.5*(a.x-p.x),c+=0.5*(a.y-p.y),p=Math.sqrt((p.x-a.x)*(p.x-a.x)+(p.y-a.y)*(p.y-a.y)),C(b.hfov+0.1*(Ka-p)),Ka=p);p=b.hfov/360*b.touchPanSpeedCoeffFactor;y=(Aa-y)*p+Ta;x.yaw=
(y-b.yaw)%360*0.2;b.yaw=y;c=(c-Ba)*p+Ua;x.pitch=0.2*(c-b.pitch);b.pitch=c}}function na(){B=null;ha=!1;150<Date.now()-M&&(x.pitch=x.yaw=0);Ka=-1;M=Date.now();O("touchend",event)}function Pa(a){"touch"==a.pointerType&&F&&b.draggable&&(ja.push(a.pointerId),Ca.push({clientX:a.clientX,clientY:a.clientY}),a.targetTouches=Ca,Ea(a),a.preventDefault())}function E(a){if("touch"==a.pointerType)if(B)V(B,a);else if(b.draggable)for(var p=0;p<ja.length;p++)if(a.pointerId==ja[p]){Ca[p].clientX=a.clientX;Ca[p].clientY=
a.clientY;a.targetTouches=Ca;Oa(a);a.preventDefault();break}}function e(b){B&&B.dragHandlerFunc&&B.dragHandlerFunc(b,B.dragHandlerArgs);B=null;if("touch"==b.pointerType){for(var a=!1,c=0;c<ja.length;c++)b.pointerId==ja[c]&&(ja[c]=h),ja[c]&&(a=!0);a||(ja=[],Ca=[],na());b.preventDefault()}}function a(a){F&&("fullscreenonly"!=b.mouseZoom||Da)&&(a.preventDefault(),k(),M=Date.now(),a.wheelDeltaY?(C(b.hfov-0.05*a.wheelDeltaY),x.hfov=0>a.wheelDelta?1:-1):a.wheelDelta?(C(b.hfov-0.05*a.wheelDelta),x.hfov=
0>a.wheelDelta?1:-1):a.detail&&(C(b.hfov+1.5*a.detail),x.hfov=0<a.detail?1:-1),s())}function T(a){k();M=Date.now();v();b.roll=0;var p=a.which||a.keycode;0>b.capturedKeyNumbers.indexOf(p)||(a.preventDefault(),27==p?Da&&H():Q(p,!0))}function U(){for(var b=0;10>b;b++)t[b]=!1}function $(a){var p=a.which||a.keycode;0>b.capturedKeyNumbers.indexOf(p)||(a.preventDefault(),Q(p,!1))}function Q(b,a){var c=!1;switch(b){case 109:case 189:case 17:case 173:t[0]!=a&&(c=!0);t[0]=a;break;case 107:case 187:case 16:case 61:t[1]!=
a&&(c=!0);t[1]=a;break;case 38:t[2]!=a&&(c=!0);t[2]=a;break;case 87:t[6]!=a&&(c=!0);t[6]=a;break;case 40:t[3]!=a&&(c=!0);t[3]=a;break;case 83:t[7]!=a&&(c=!0);t[7]=a;break;case 37:t[4]!=a&&(c=!0);t[4]=a;break;case 65:t[8]!=a&&(c=!0);t[8]=a;break;case 39:t[5]!=a&&(c=!0);t[5]=a;break;case 68:t[9]!=a&&(c=!0),t[9]=a}c&&a&&(da="undefined"!==typeof performance&&performance.now()?performance.now():Date.now(),s())}function Fa(){if(F){var a=!1,p=b.pitch,c=b.yaw,e=b.hfov,d;d="undefined"!==typeof performance&&
performance.now()?performance.now():Date.now();da===h&&(da=d);var f=(d-da)*b.hfov/1700,f=Math.min(f,1);t[0]&&!0===b.keyboardZoom&&(C(b.hfov+(0.8*x.hfov+0.5)*f),a=!0);t[1]&&!0===b.keyboardZoom&&(C(b.hfov+(0.8*x.hfov-0.2)*f),a=!0);if(t[2]||t[6])b.pitch+=(0.8*x.pitch+0.2)*f,a=!0;if(t[3]||t[7])b.pitch+=(0.8*x.pitch-0.2)*f,a=!0;if(t[4]||t[8])b.yaw+=(0.8*x.yaw-0.2)*f,a=!0;if(t[5]||t[9])b.yaw+=(0.8*x.yaw+0.2)*f,a=!0;a&&(M=Date.now());if(b.autoRotate){if(0.001<d-da){var a=(d-da)/1E3,g=(x.yaw/a*f-0.2*b.autoRotate)*
a,g=(0<-b.autoRotate?1:-1)*Math.min(Math.abs(b.autoRotate*a),Math.abs(g));b.yaw+=g}b.autoRotateStopDelay&&(b.autoRotateStopDelay-=d-da,0>=b.autoRotateStopDelay&&(b.autoRotateStopDelay=!1,Y=b.autoRotate,b.autoRotate=0))}N.pitch&&(aa("pitch"),p=b.pitch);N.yaw&&(aa("yaw"),c=b.yaw);N.hfov&&(aa("hfov"),e=b.hfov);0<f&&!b.autoRotate&&(a=1-b.friction,t[4]||t[5]||t[8]||t[9]||N.yaw||(b.yaw+=x.yaw*f*a),t[2]||t[3]||t[6]||t[7]||N.pitch||(b.pitch+=x.pitch*f*a),t[0]||t[1]||N.hfov||C(b.hfov+x.hfov*f*a));da=d;0<f&&
(x.yaw=0.8*x.yaw+(b.yaw-c)/f*0.2,x.pitch=0.8*x.pitch+(b.pitch-p)/f*0.2,x.hfov=0.8*x.hfov+(b.hfov-e)/f*0.2,p=b.autoRotate?Math.abs(b.autoRotate):5,x.yaw=Math.min(p,Math.max(x.yaw,-p)),x.pitch=Math.min(p,Math.max(x.pitch,-p)),x.hfov=Math.min(p,Math.max(x.hfov,-p)));t[0]&&t[1]&&(x.hfov=0);(t[2]||t[6])&&(t[3]||t[7])&&(x.pitch=0);(t[4]||t[8])&&(t[5]||t[9])&&(x.yaw=0)}}function aa(a){var p=N[a],c=Math.min(1,Math.max((Date.now()-p.startTime)/1E3/(p.duration/1E3),0)),c=p.startPosition+b.animationTimingFunction(c)*
(p.endPosition-p.startPosition);if(p.endPosition>p.startPosition&&c>=p.endPosition||p.endPosition<p.startPosition&&c<=p.endPosition||p.endPosition===p.startPosition)c=p.endPosition,x[a]=0,delete N[a];b[a]=c}function l(){c("resize")}function s(){Xa||(Xa=!0,ga())}function ga(){if(!bb)if(Ga(),Va&&clearTimeout(Va),ha||!0===X)requestAnimationFrame(ga);else if(t[0]||t[1]||t[2]||t[3]||t[4]||t[5]||t[6]||t[7]||t[8]||t[9]||b.autoRotate||N.pitch||N.yaw||N.hfov||0.01<Math.abs(x.yaw)||0.01<Math.abs(x.pitch)||
0.01<Math.abs(x.hfov))Fa(),0<=b.autoRotateInactivityDelay&&Y&&Date.now()-M>b.autoRotateInactivityDelay&&!b.autoRotate&&(b.autoRotate=Y,P.lookAt(Ja,h,wa,3E3)),requestAnimationFrame(ga);else if(A&&(A.isLoading()||!0===b.dynamic&&Qa))requestAnimationFrame(ga);else{P.getPitch&&P.getYaw&&P.getHfov&&O("animatefinished",{pitch:P.getPitch(),yaw:P.getYaw(),hfov:P.getHfov()});Xa=!1;da=h;var a=b.autoRotateInactivityDelay-(Date.now()-M);0<a?Va=setTimeout(function(){b.autoRotate=Y;P.lookAt(Ja,h,wa,3E3);s()},a):
0<=b.autoRotateInactivityDelay&&Y&&(b.autoRotate=Y,P.lookAt(Ja,h,wa,3E3),s())}}function Ga(){var a;if(F){var p=A.getCanvas();!1!==b.autoRotate&&(360<b.yaw?b.yaw-=360:-360>b.yaw&&(b.yaw+=360));a=b.yaw;var c=0;if(b.avoidShowingBackground){var d=b.hfov/2,e=180*Math.atan2(Math.tan(d/180*Math.PI),p.width/p.height)/Math.PI;b.vaov>b.haov?Math.min(Math.cos((b.pitch-d)/180*Math.PI),Math.cos((b.pitch+d)/180*Math.PI)):c=d*(1-Math.min(Math.cos((b.pitch-e)/180*Math.PI),Math.cos((b.pitch+e)/180*Math.PI)))}var d=
b.maxYaw-b.minYaw,e=-180,f=180;360>d&&(e=b.minYaw+b.hfov/2+c,f=b.maxYaw-b.hfov/2-c,d<b.hfov&&(e=f=(e+f)/2),b.yaw=Math.max(e,Math.min(f,b.yaw)));!1===b.autoRotate&&(360<b.yaw?b.yaw-=360:-360>b.yaw&&(b.yaw+=360));!1!==b.autoRotate&&a!=b.yaw&&da!==h&&(b.autoRotate*=-1);a=2*Math.atan(Math.tan(b.hfov/180*Math.PI*0.5)/(p.width/p.height))/Math.PI*180;p=b.minPitch+a/2;c=b.maxPitch-a/2;b.maxPitch-b.minPitch<a&&(p=c=(p+c)/2);isNaN(p)&&(p=-90);isNaN(c)&&(c=90);b.pitch=Math.max(p,Math.min(c,b.pitch));A.render(b.pitch*
Math.PI/180,b.yaw*Math.PI/180,b.hfov*Math.PI/180,{roll:b.roll*Math.PI/180});b.hotSpots.forEach(za);b.compass&&(La.style.transform="rotate("+(-b.yaw-b.northOffset)+"deg)",La.style.webkitTransform="rotate("+(-b.yaw-b.northOffset)+"deg)")}}function ba(a,b,c,d){this.w=a;this.x=b;this.y=c;this.z=d}function ra(a){var c;c=a.alpha;var d=a.beta;a=a.gamma;d=[d?d*Math.PI/180/2:0,a?a*Math.PI/180/2:0,c?c*Math.PI/180/2:0];c=[Math.cos(d[0]),Math.cos(d[1]),Math.cos(d[2])];d=[Math.sin(d[0]),Math.sin(d[1]),Math.sin(d[2])];
c=new ba(c[0]*c[1]*c[2]-d[0]*d[1]*d[2],d[0]*c[1]*c[2]-c[0]*d[1]*d[2],c[0]*d[1]*c[2]+d[0]*c[1]*d[2],c[0]*c[1]*d[2]+d[0]*d[1]*c[2]);c=c.multiply(new ba(Math.sqrt(0.5),-Math.sqrt(0.5),0,0));d=D.orientation?-D.orientation*Math.PI/180/2:0;c=c.multiply(new ba(Math.cos(d),0,-Math.sin(d),0)).toEulerAngles();"number"==typeof X&&10>X?X+=1:10===X?(cb=c[2]/Math.PI*180+b.yaw,X=!0,requestAnimationFrame(ga)):(b.pitch=c[0]/Math.PI*180,b.roll=-c[1]/Math.PI*180,b.yaw=-c[2]/Math.PI*180+cb)}function Ha(){try{var a={};
b.horizonPitch!==h&&(a.horizonPitch=b.horizonPitch*Math.PI/180);b.horizonRoll!==h&&(a.horizonRoll=b.horizonRoll*Math.PI/180);b.backgroundColor!==h&&(a.backgroundColor=b.backgroundColor);A.init(I,b.type,b.dynamic,b.haov*Math.PI/180,b.vaov*Math.PI/180,b.vOffset*Math.PI/180,qa,a);!0!==b.dynamic&&(I=h)}catch(c){if("webgl error"==c.type||"no webgl"==c.type)G();else if("webgl size error"==c.type)G(b.strings.textureSizeError.replace("%s",c.width).replace("%s",c.maxWidth));else throw G(b.strings.unknownError),
c;}}function qa(){if(b.sceneFadeDuration&&A.fadeImg!==h){A.fadeImg.style.opacity=0;var a=A.fadeImg;delete A.fadeImg;setTimeout(function(){L.removeChild(a);O("scenechangefadedone")},b.sceneFadeDuration)}La.style.display=b.compass?"inline":"none";db();r.load.box.style.display="none";K!==h&&(L.removeChild(K),K=h);F=!0;s();O("load")}function ya(a){a.pitch=Number(a.pitch)||0;a.yaw=Number(a.yaw)||0;var c=f.createElement("div");c.className="pnlm-hotspot-base";c.className=a.cssClass?c.className+(" "+a.cssClass):
c.className+(" pnlm-hotspot pnlm-sprite pnlm-"+u(a.type));var d=f.createElement("span");a.text&&(d.innerHTML=u(a.text));var e;if(a.video){e=f.createElement("video");var h=a.video;b.basePath&&!ta(h)&&(h=b.basePath+h);e.src=fa(h);e.controls=!0;e.style.width=a.width+"px";L.appendChild(c);d.appendChild(e)}else if(a.image){h=a.image;b.basePath&&!ta(h)&&(h=b.basePath+h);e=f.createElement("a");e.href=fa(a.URL?a.URL:h,!0);e.target="_blank";d.appendChild(e);var k=f.createElement("img");k.src=fa(h);k.style.width=
a.width+"px";k.style.paddingTop="5px";L.appendChild(c);e.appendChild(k);d.style.maxWidth="initial"}else if(a.URL){e=f.createElement("a");e.href=fa(a.URL,!0);if(a.attributes)for(h in a.attributes)e.setAttribute(h,a.attributes[h]);else e.target="_blank";L.appendChild(e);c.className+=" pnlm-pointer";d.className+=" pnlm-pointer";e.appendChild(c)}else a.sceneId&&(c.onclick=c.ontouchend=function(){c.clicked||(c.clicked=!0,g(a.sceneId,a.targetPitch,a.targetYaw,a.targetHfov));return!1},c.className+=" pnlm-pointer",
d.className+=" pnlm-pointer"),L.appendChild(c);if(a.createTooltipFunc)a.createTooltipFunc(c,a.createTooltipArgs);else if(a.text||a.video||a.image)c.classList.add("pnlm-tooltip"),c.appendChild(d),d.style.width=d.scrollWidth-20+"px",d.style.marginLeft=-(d.scrollWidth-c.offsetWidth)/2+"px",d.style.marginTop=-d.scrollHeight-12+"px";a.clickHandlerFunc&&(c.addEventListener("click",function(b){a.clickHandlerFunc(b,a.clickHandlerArgs)},"false"),""===f.documentElement.style.pointerAction&&""===f.documentElement.style.touchAction?
c.addEventListener("pointerup",function(b){a.clickHandlerFunc(b,a.clickHandlerArgs)},!1):c.addEventListener("touchend",function(b){a.clickHandlerFunc(b,a.clickHandlerArgs)},!1),c.className+=" pnlm-pointer",d.className+=" pnlm-pointer");a.draggable&&(c.addEventListener("mousedown",function(b){a.dragHandlerFunc&&a.dragHandlerFunc(b,a.dragHandlerArgs);B=a}),""===f.documentElement.style.pointerAction&&""===f.documentElement.style.touchAction&&c.addEventListener("pointerdown",function(b){a.dragHandlerFunc&&
a.dragHandlerFunc(b,a.dragHandlerArgs);B=a}),c.addEventListener("touchmove",function(b){V(a,b.targetTouches[0])}),c.addEventListener("touchend",function(b){a.dragHandlerFunc&&a.dragHandlerFunc(b,a.dragHandlerArgs);B=null}));a.div=c}function V(a,b){var c=oa(b);a.pitch=c[0];a.yaw=c[1];za(a)}function db(){Ya||(b.hotSpots?(b.hotSpots=b.hotSpots.sort(function(a,b){return a.pitch<b.pitch}),b.hotSpots.forEach(ya)):b.hotSpots=[],Ya=!0,b.hotSpots.forEach(za))}function Ia(){var a=b.hotSpots;Ya=!1;delete b.hotSpots;
if(a)for(var c=0;c<a.length;c++){var d=a[c].div;if(d){for(;d.parentNode&&d.parentNode!=L;)d=d.parentNode;L.removeChild(d)}delete a[c].div}}function za(a){var c=Math.sin(a.pitch*Math.PI/180),d=Math.cos(a.pitch*Math.PI/180),e=Math.sin(b.pitch*Math.PI/180),f=Math.cos(b.pitch*Math.PI/180),g=Math.cos((-a.yaw+b.yaw)*Math.PI/180),h=c*e+d*g*f;if(90>=a.yaw&&-90<a.yaw&&0>=h||(90<a.yaw||-90>=a.yaw)&&0>=h)a.div.style.visibility="hidden";else{var k=Math.sin((-a.yaw+b.yaw)*Math.PI/180),l=Math.tan(b.hfov*Math.PI/
360);a.div.style.visibility="visible";var m=A.getCanvas(),q=m.clientWidth,m=m.clientHeight,c=[-q/l*k*d/h/2,-q/l*(c*f-d*g*e)/h/2],d=Math.sin(b.roll*Math.PI/180),e=Math.cos(b.roll*Math.PI/180),c=[c[0]*e-c[1]*d,c[0]*d+c[1]*e];c[0]+=(q-a.div.offsetWidth)/2;c[1]+=(m-a.div.offsetHeight)/2;q="translate("+c[0]+"px, "+c[1]+"px) translateZ(9999px) rotate("+b.roll+"deg)";a.scale&&(q+=" scale("+wa/b.hfov/h+")");a.div.style.webkitTransform=q;a.div.style.MozTransform=q;a.div.style.transform=q}}function ua(a){b=
{};var c,d,e="haov vaov vOffset northOffset horizonPitch horizonRoll".split(" ");ca=[];for(c in Za)Za.hasOwnProperty(c)&&(b[c]=Za[c]);for(c in q.default)if(q.default.hasOwnProperty(c))if("strings"==c)for(d in q.default.strings)q.default.strings.hasOwnProperty(d)&&(b.strings[d]=u(q.default.strings[d]));else b[c]=q.default[c],0<=e.indexOf(c)&&ca.push(c);if(null!==a&&""!==a&&q.scenes&&q.scenes[a]){var f=q.scenes[a];for(c in f)if(f.hasOwnProperty(c))if("strings"==c)for(d in f.strings)f.strings.hasOwnProperty(d)&&
(b.strings[d]=u(f.strings[d]));else b[c]=f[c],0<=e.indexOf(c)&&ca.push(c);b.scene=a}for(c in q)if(q.hasOwnProperty(c))if("strings"==c)for(d in q.strings)q.strings.hasOwnProperty(d)&&(b.strings[d]=u(q.strings[d]));else b[c]=q[c],0<=e.indexOf(c)&&ca.push(c)}function va(a){if((a=a?a:!1)&&"preview"in b){var c=b.preview;b.basePath&&!ta(c)&&(c=b.basePath+c);K=f.createElement("div");K.className="pnlm-preview-img";K.style.backgroundImage="url('"+fa(c).replace(/"/g,"%22").replace(/'/g,"%27")+"')";L.appendChild(K)}var c=
b.title,d=b.author;a&&("previewTitle"in b&&(b.title=b.previewTitle),"previewAuthor"in b&&(b.author=b.previewAuthor));b.hasOwnProperty("title")||(r.title.innerHTML="");b.hasOwnProperty("author")||(r.author.innerHTML="");b.hasOwnProperty("title")||b.hasOwnProperty("author")||(r.container.style.display="none");w.load.innerHTML="<div><p>"+b.strings.loadButtonLabel+"</p></div>";r.load.boxp.innerHTML=b.strings.loadingLabel;for(var e in b)if(b.hasOwnProperty(e))switch(e){case "title":r.title.innerHTML=u(b[e]);
r.container.style.display="inline";break;case "author":var g=u(b[e]);b.authorURL&&(g=f.createElement("a"),g.href=fa(b.authorURL,!0),g.target="_blank",g.innerHTML=u(b[e]),g=g.outerHTML);r.author.innerHTML=b.strings.bylineLabel.replace("%s",g);r.container.style.display="inline";break;case "fallback":g=f.createElement("a");g.href=fa(b[e],!0);g.target="_blank";g.textContent="Click here to view this panorama in an alternative viewer.";var k=f.createElement("p");k.textContent="Your browser does not support WebGL.";
k.appendChild(f.createElement("br"));k.appendChild(g);r.errorMsg.innerHTML="";r.errorMsg.appendChild(k);break;case "hfov":C(Number(b[e]));break;case "autoLoad":!0===b[e]&&A===h&&(r.load.box.style.display="inline",w.load.style.display="none",sa());break;case "showZoomCtrl":w.zoom.style.display=b[e]&&!1!=b.showControls?"block":"none";break;case "showFullscreenCtrl":w.fullscreen.style.display=b[e]&&!1!=b.showControls&&("fullscreen"in f||"mozFullScreen"in f||"webkitIsFullScreen"in f||"msFullscreenElement"in
f)?"block":"none";break;case "hotSpotDebug":$a.style.display=b[e]?"block":"none";break;case "showControls":b[e]||(w.orientation.style.display="none",w.zoom.style.display="none",w.fullscreen.style.display="none");break;case "orientationOnByDefault":b[e]&&S()}a&&(c?b.title=c:delete b.title,d?b.author=d:delete b.author)}function H(){if(F&&!Sa)if(Da)f.exitFullscreen?f.exitFullscreen():f.mozCancelFullScreen?f.mozCancelFullScreen():f.webkitCancelFullScreen?f.webkitCancelFullScreen():f.msExitFullscreen&&
f.msExitFullscreen();else try{m.requestFullscreen?m.requestFullscreen():m.mozRequestFullScreen?m.mozRequestFullScreen():m.msRequestFullscreen?m.msRequestFullscreen():m.webkitRequestFullScreen()}catch(a){}}function c(a){f.fullscreenElement||f.fullscreen||f.mozFullScreen||f.webkitIsFullScreen||f.msFullscreenElement?(w.fullscreen.classList.add("pnlm-fullscreen-toggle-button-active"),Da=!0):(w.fullscreen.classList.remove("pnlm-fullscreen-toggle-button-active"),Da=!1);"resize"!==a&&O("fullscreenchange",
Da);A.resize();C(b.hfov);s()}function Ma(a){var c=b.minHfov;"multires"==b.type&&A&&!b.multiResMinHfov&&(c=Math.min(c,A.getCanvas().width/(b.multiRes.cubeResolution/90*0.9)));if(c>b.maxHfov)return console.log("HFOV bounds do not make sense (minHfov > maxHfov)."),b.hfov;var d=b.hfov,d=a<c?c:a>b.maxHfov?b.maxHfov:a;b.avoidShowingBackground&&A&&!isNaN(b.maxPitch-b.minPitch)&&(a=A.getCanvas(),d=Math.min(d,360*Math.atan(Math.tan((b.maxPitch-b.minPitch)/360*Math.PI)/a.height*a.width)/Math.PI));return d}
function C(a){b.hfov=Ma(a);O("zoomchange",b.hfov)}function k(){N={};Y=b.autoRotate?b.autoRotate:Y;b.autoRotate=!1}function d(){Sa&&(r.load.box.style.display="none",r.errorMsg.style.display="none",Sa=!1,L.style.display="block",O("errorcleared"));F=!1;w.load.style.display="none";r.load.box.style.display="inline";sa()}function g(a,c,e,k,l){F||(l=!0);F=!1;N={};var m,r,s;if(b.sceneFadeDuration&&!l&&(l=A.render(b.pitch*Math.PI/180,b.yaw*Math.PI/180,b.hfov*Math.PI/180,{returnImage:"ImageBitmap"}),l!==h)){m=
l.then?f.createElement("canvas"):new Image;m.className="pnlm-fade-img";m.style.transition="opacity "+b.sceneFadeDuration/1E3+"s";m.style.width="100%";m.style.height="100%";l.then?l.then(function(b){m.width=b.width;m.height=b.height;m.getContext("2d").drawImage(b,0,0);g(a,c,e,k,!0)}):(m.onload=function(){g(a,c,e,k,!0)},m.src=l);L.appendChild(m);A.fadeImg=m;return}l="same"===c?b.pitch:c;r="same"===e?b.yaw:"sameAzimuth"===e?b.yaw+(b.northOffset||0)-(q.scenes[a].northOffset||0):e;s="same"===k?b.hfov:
k;Ia();ua(a);x.yaw=x.pitch=x.hfov=0;va();l!==h&&(b.pitch=l);r!==h&&(b.yaw=r);s!==h&&(b.hfov=s);O("scenechange",a);d()}function v(){D.removeEventListener("deviceorientation",ra);w.orientation.classList.remove("pnlm-orientation-button-active");X=!1}function S(){ab&&("undefined"!==typeof DeviceMotionEvent&&"function"===typeof DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(function(a){"granted"==a&&(X=1,D.addEventListener("deviceorientation",ra),w.orientation.classList.add("pnlm-orientation-button-active"))}):
(X=1,D.addEventListener("deviceorientation",ra),w.orientation.classList.add("pnlm-orientation-button-active")))}function u(a){return q.escapeHTML?String(a).split(/&/g).join("&amp;").split('"').join("&quot;").split("'").join("&#39;").split("<").join("&lt;").split(">").join("&gt;").split("/").join("&#x2f;").split("\n").join("<br>"):String(a).split("\n").join("<br>")}function fa(a,b){try{var c=decodeURIComponent(z(a)).replace(/[^\w:]/g,"").toLowerCase()}catch(d){return"about:blank"}return 0===c.indexOf("javascript:")||
0===c.indexOf("vbscript:")?(console.log("Script URL removed."),"about:blank"):b&&0===c.indexOf("data:")?(console.log("Data URI removed from link."),"about:blank"):a}function z(a){return a.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,function(a,b){b=b.toLowerCase();return"colon"===b?":":"#"===b.charAt(0)?"x"===b.charAt(1)?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""})}function O(a){if(a in R)for(var b=R[a].length;0<b;b--)R[a][R[a].length-b].apply(null,
[].slice.call(arguments,1))}var P=this,b,A,K,B,ha=!1,M=Date.now(),Aa=0,Ba=0,Ka=-1,Ta=0,Ua=0,t=Array(10),Da=!1,F,Sa=!1,Wa=!1,I,da,x={yaw:0,pitch:0,hfov:0},Xa=!1,X=!1,cb=0,Va,Y=0,wa,Ja,N={},R={},ca=[],Qa=!1,Ra,Ya=!1,bb=!1,Za={hfov:100,minHfov:50,multiResMinHfov:!1,maxHfov:120,pitch:0,minPitch:h,maxPitch:h,yaw:0,minYaw:-180,maxYaw:180,roll:0,haov:360,vaov:180,vOffset:0,autoRotate:!1,autoRotateInactivityDelay:-1,autoRotateStopDelay:h,type:"equirectangular",northOffset:0,showFullscreenCtrl:!0,dynamic:!1,
dynamicUpdate:!1,doubleClickZoom:!0,keyboardZoom:!0,mouseZoom:!0,showZoomCtrl:!0,autoLoad:!1,showControls:!0,orientationOnByDefault:!1,hotSpotDebug:!1,backgroundColor:[0,0,0],avoidShowingBackground:!1,animationTimingFunction:function(a){return 0.5>a?2*a*a:-1+(4-2*a)*a},draggable:!0,disableKeyboardCtrl:!1,crossOrigin:"anonymous",touchPanSpeedCoeffFactor:1,capturedKeyNumbers:[16,17,27,37,38,39,40,61,65,68,83,87,107,109,173,187,189],friction:0.15,strings:{loadButtonLabel:"Click to<br>Load<br>Panorama",
loadingLabel:"Loading...",bylineLabel:"by %s",noPanoramaError:"No panorama image was specified.",fileAccessError:"The file %s could not be accessed.",malformedURLError:"There is something wrong with the panorama URL.",iOS8WebGLError:"Due to iOS 8's broken WebGL implementation, only progressive encoded JPEGs work for your device (this panorama uses standard encoding).",genericWebGLError:"Your browser does not have the necessary WebGL support to display this panorama.",textureSizeError:"This panorama is too big for your device! It's %spx wide, but your device only supports images up to %spx wide. Try another device. (If you're the author, try scaling down the image.)",
unknownError:"Unknown error. Check developer console."}};m="string"===typeof m?f.getElementById(m):m;m.classList.add("pnlm-container");m.tabIndex=0;var J=f.createElement("div");J.className="pnlm-ui";m.appendChild(J);var L=f.createElement("div");L.className="pnlm-render-container";m.appendChild(L);var W=f.createElement("div");W.className="pnlm-dragfix";J.appendChild(W);var ea=f.createElement("span");ea.className="pnlm-about-msg";ea.innerHTML='<a href="https://pannellum.org/" target="_blank">Pannellum</a> eeb9383';
J.appendChild(ea);W.addEventListener("contextmenu",la);var r={},$a=f.createElement("div");$a.className="pnlm-sprite pnlm-hot-spot-debug-indicator";J.appendChild($a);r.container=f.createElement("div");r.container.className="pnlm-panorama-info";r.title=f.createElement("div");r.title.className="pnlm-title-box";r.container.appendChild(r.title);r.author=f.createElement("div");r.author.className="pnlm-author-box";r.container.appendChild(r.author);J.appendChild(r.container);r.load={};r.load.box=f.createElement("div");
r.load.box.className="pnlm-load-box";r.load.boxp=f.createElement("p");r.load.box.appendChild(r.load.boxp);r.load.lbox=f.createElement("div");r.load.lbox.className="pnlm-lbox";r.load.lbox.innerHTML='<div class="pnlm-loading"></div>';r.load.box.appendChild(r.load.lbox);r.load.lbar=f.createElement("div");r.load.lbar.className="pnlm-lbar";r.load.lbarFill=f.createElement("div");r.load.lbarFill.className="pnlm-lbar-fill";r.load.lbar.appendChild(r.load.lbarFill);r.load.box.appendChild(r.load.lbar);r.load.msg=
f.createElement("p");r.load.msg.className="pnlm-lmsg";r.load.box.appendChild(r.load.msg);J.appendChild(r.load.box);r.errorMsg=f.createElement("div");r.errorMsg.className="pnlm-error-msg pnlm-info-box";J.appendChild(r.errorMsg);var w={};w.container=f.createElement("div");w.container.className="pnlm-controls-container";J.appendChild(w.container);w.load=f.createElement("button");w.load.className="pnlm-load-button";w.load.addEventListener("click",function(){va();d()});J.appendChild(w.load);w.zoom=f.createElement("div");
w.zoom.className="pnlm-zoom-controls pnlm-controls";w.zoomIn=f.createElement("div");w.zoomIn.className="pnlm-zoom-in pnlm-sprite pnlm-control";w.zoomIn.addEventListener("click",function(){F&&(C(b.hfov-5),s())});w.zoom.appendChild(w.zoomIn);w.zoomOut=f.createElement("div");w.zoomOut.className="pnlm-zoom-out pnlm-sprite pnlm-control";w.zoomOut.addEventListener("click",function(){F&&(C(b.hfov+5),s())});w.zoom.appendChild(w.zoomOut);w.container.appendChild(w.zoom);w.fullscreen=f.createElement("div");
w.fullscreen.addEventListener("click",H);w.fullscreen.className="pnlm-fullscreen-toggle-button pnlm-sprite pnlm-fullscreen-toggle-button-inactive pnlm-controls pnlm-control";(f.fullscreenEnabled||f.mozFullScreenEnabled||f.webkitFullscreenEnabled||f.msFullscreenEnabled)&&w.container.appendChild(w.fullscreen);w.orientation=f.createElement("div");w.orientation.addEventListener("click",function(a){X?v():S()});w.orientation.addEventListener("mousedown",function(a){a.stopPropagation()});w.orientation.addEventListener("touchstart",
function(a){a.stopPropagation()});w.orientation.addEventListener("pointerdown",function(a){a.stopPropagation()});w.orientation.className="pnlm-orientation-button pnlm-orientation-button-inactive pnlm-sprite pnlm-controls pnlm-control";var ab=!1;D.DeviceOrientationEvent&&"https:"==location.protocol&&0<=navigator.userAgent.toLowerCase().indexOf("mobi")&&(w.container.appendChild(w.orientation),ab=!0);var La=f.createElement("div");La.className="pnlm-compass pnlm-controls pnlm-control";J.appendChild(La);
q.firstScene?ua(q.firstScene):q.default&&q.default.firstScene?ua(q.default.firstScene):ua(null);va(!0);var ja=[],Ca=[];ba.prototype.multiply=function(a){return new ba(this.w*a.w-this.x*a.x-this.y*a.y-this.z*a.z,this.x*a.w+this.w*a.x+this.y*a.z-this.z*a.y,this.y*a.w+this.w*a.y+this.z*a.x-this.x*a.z,this.z*a.w+this.w*a.z+this.x*a.y-this.y*a.x)};ba.prototype.toEulerAngles=function(){var a=Math.atan2(2*(this.w*this.x+this.y*this.z),1-2*(this.x*this.x+this.y*this.y)),b=Math.asin(2*(this.w*this.y-this.z*
this.x)),c=Math.atan2(2*(this.w*this.z+this.x*this.y),1-2*(this.y*this.y+this.z*this.z));return[a,b,c]};this.isLoaded=function(){return Boolean(F)};this.getPitch=function(){return b.pitch};this.setPitch=function(a,c,d,e){M=Date.now();if(1E-6>=Math.abs(a-b.pitch))return"function"==typeof d&&d(e),this;(c=c==h?1E3:Number(c))?(N.pitch={startTime:Date.now(),startPosition:b.pitch,endPosition:a,duration:c},"function"==typeof d&&setTimeout(function(){d(e)},c)):b.pitch=a;s();return this};this.getPitchBounds=
function(){return[b.minPitch,b.maxPitch]};this.setPitchBounds=function(a){b.minPitch=Math.max(-90,Math.min(a[0],90));b.maxPitch=Math.max(-90,Math.min(a[1],90));return this};this.getYaw=function(){return(b.yaw+540)%360-180};this.setYaw=function(a,c,d,e){M=Date.now();if(1E-6>=Math.abs(a-b.yaw))return"function"==typeof d&&d(e),this;c=c==h?1E3:Number(c);a=(a+180)%360-180;c?(180<b.yaw-a?a+=360:180<a-b.yaw&&(a-=360),N.yaw={startTime:Date.now(),startPosition:b.yaw,endPosition:a,duration:c},"function"==typeof d&&
setTimeout(function(){d(e)},c)):b.yaw=a;s();return this};this.getYawBounds=function(){return[b.minYaw,b.maxYaw]};this.setYawBounds=function(a){b.minYaw=Math.max(-360,Math.min(a[0],360));b.maxYaw=Math.max(-360,Math.min(a[1],360));return this};this.getHfov=function(){return b.hfov};this.setHfov=function(a,c,d,e){M=Date.now();if(1E-6>=Math.abs(a-b.hfov))return"function"==typeof d&&d(e),this;(c=c==h?1E3:Number(c))?(N.hfov={startTime:Date.now(),startPosition:b.hfov,endPosition:Ma(a),duration:c},"function"==
typeof d&&setTimeout(function(){d(e)},c)):C(a);s();return this};this.getHfovBounds=function(){return[b.minHfov,b.maxHfov]};this.setHfovBounds=function(a){b.minHfov=Math.max(0,a[0]);b.maxHfov=Math.max(0,a[1]);return this};this.lookAt=function(a,c,d,e,f,g){e=e==h?1E3:Number(e);a!==h&&1E-6<Math.abs(a-b.pitch)&&(this.setPitch(a,e,f,g),f=h);c!==h&&1E-6<Math.abs(c-b.yaw)&&(this.setYaw(c,e,f,g),f=h);d!==h&&1E-6<Math.abs(d-b.hfov)&&(this.setHfov(d,e,f,g),f=h);"function"==typeof f&&f(g);return this};this.getNorthOffset=
function(){return b.northOffset};this.setNorthOffset=function(a){b.northOffset=Math.min(360,Math.max(0,a));s();return this};this.getHorizonRoll=function(){return b.horizonRoll};this.setHorizonRoll=function(a){b.horizonRoll=Math.min(90,Math.max(-90,a));A.setPose(b.horizonPitch*Math.PI/180,b.horizonRoll*Math.PI/180);s();return this};this.getHorizonPitch=function(){return b.horizonPitch};this.setHorizonPitch=function(a){b.horizonPitch=Math.min(90,Math.max(-90,a));A.setPose(b.horizonPitch*Math.PI/180,
b.horizonRoll*Math.PI/180);s();return this};this.startAutoRotate=function(a,c,d){a=a||Y||1;c=c===h?Ja:c;d=d===h?wa:d;b.autoRotate=a;P.lookAt(c,h,d,3E3);s();return this};this.stopAutoRotate=function(){Y=b.autoRotate?b.autoRotate:Y;b.autoRotate=!1;b.autoRotateInactivityDelay=-1;return this};this.stopMovement=function(){k();x={yaw:0,pitch:0,hfov:0}};this.getRenderer=function(){return A};this.setUpdate=function(a){Qa=!0===a;A===h?ia():s();return this};this.mouseEventToCoords=function(a){return oa(a)};
this.loadScene=function(a,b,c,d){!1!==F&&g(a,b,c,d);return this};this.getScene=function(){return b.scene};this.addScene=function(a,b){q.scenes[a]=b;return this};this.removeScene=function(a){if(b.scene===a||!q.scenes.hasOwnProperty(a))return!1;delete q.scenes[a];return!0};this.toggleFullscreen=function(){H();return this};this.getConfig=function(){return b};this.getContainer=function(){return m};this.addHotSpot=function(a,c){if(c===h&&b.scene===h)b.hotSpots.push(a);else{var d=c!==h?c:b.scene;if(q.scenes.hasOwnProperty(d))q.scenes[d].hasOwnProperty("hotSpots")||
(q.scenes[d].hotSpots=[],d==b.scene&&(b.hotSpots=q.scenes[d].hotSpots)),q.scenes[d].hotSpots.push(a);else throw"Invalid scene ID!";}if(c===h||b.scene==c)ya(a),F&&za(a);return this};this.removeHotSpot=function(a,c){if(c===h||b.scene==c){if(!b.hotSpots)return!1;for(var d=0;d<b.hotSpots.length;d++)if(b.hotSpots[d].hasOwnProperty("id")&&b.hotSpots[d].id===a){for(var e=b.hotSpots[d].div;e.parentNode!=L;)e=e.parentNode;L.removeChild(e);delete b.hotSpots[d].div;b.hotSpots.splice(d,1);return!0}}else if(q.scenes.hasOwnProperty(c)){if(!q.scenes[c].hasOwnProperty("hotSpots"))return!1;
for(d=0;d<q.scenes[c].hotSpots.length;d++)if(q.scenes[c].hotSpots[d].hasOwnProperty("id")&&q.scenes[c].hotSpots[d].id===a)return q.scenes[c].hotSpots.splice(d,1),!0}else return!1};this.resize=function(){A&&l()};this.isLoaded=function(){return F};this.isOrientationSupported=function(){return ab||!1};this.stopOrientation=function(){v()};this.startOrientation=function(){S()};this.isOrientationActive=function(){return Boolean(X)};this.on=function(a,b){R[a]=R[a]||[];R[a].push(b);return this};this.off=
function(a,b){if(!a)return R={},this;if(b){var c=R[a].indexOf(b);0<=c&&R[a].splice(c,1);0==R[a].length&&delete R[a]}else delete R[a];return this};this.destroy=function(){bb=!0;clearTimeout(Va);A&&A.destroy();Wa&&(f.removeEventListener("mousemove",xa,!1),f.removeEventListener("mouseup",pa,!1),m.removeEventListener("mozfullscreenchange",c,!1),m.removeEventListener("webkitfullscreenchange",c,!1),m.removeEventListener("msfullscreenchange",c,!1),m.removeEventListener("fullscreenchange",c,!1),Ra?Ra.disconnect():
(D.removeEventListener("resize",l,!1),D.removeEventListener("orientationchange",l,!1)),m.removeEventListener("keydown",T,!1),m.removeEventListener("keyup",$,!1),m.removeEventListener("blur",U,!1),f.removeEventListener("mouseleave",pa,!1));m.innerHTML="";m.classList.remove("pnlm-container")}}return{viewer:function(f,h){return new ka(f,h)}}}(window,document);

Carregando…
Cancelar
Salvar