////////////////////////////////////////////////////////////////////// // Pano2VR 6.1.6/17950 HTML5/CSS3 & WebGL Panorama Player // // Trial License: For evaluation only! // // (c) 2020, Garden Gnome Software, http://ggnome.com // ////////////////////////////////////////////////////////////////////// var ll="function"==typeof Object.defineProperties?Object.defineProperty:function(x,p,m){x!=Array.prototype&&x!=Object.prototype&&(x[p]=m.value)},nl="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function ol(x,p){if(p){var m=nl;x=x.split(".");for(var d=0;dm&&(m=Math.max(0,c+m));if(null==d||d>c)d=c;d=Number(d);0>d&&(d=Math.max(0,c+d));for(m=Number(m||0);mm&&(m=Math.max(m+c,0));mf;)f+=360;for(;180h&&(h=a.fov.j);this.ac||(this.ac=new x.Ga,this.ac.Ul(this.pan,this.v));0!=this.mode&& 1!=this.mode||!b||this.ic&&this.ic.gain.setValueAtTime(this.level*a.ba*this.ta,b.currentTime);if(2==this.mode&&b){var l=.5*Math.cos(f*Math.PI/180)+.5;this.Rc=Math.sqrt(l)*this.ta*this.level*a.ba;this.Uc=Math.sqrt(l)*this.ta*this.level*a.ba;this.Sc=Math.sqrt(1-l)*this.ta*this.level*a.ba;this.Tc=Math.sqrt(1-l)*this.ta*this.level*a.ba;this.zh()}if(3==this.mode){f=0>f?f<-this.zb?f+this.zb:0:f>this.zb?f-this.zb:0;var k=this.level;e=Math.abs(e);e=eh||0>w)l= k*g*a.ba,b?(this.Rc=l*this.ta,this.Uc=l*this.ta,this.Tc=this.Sc=0,this.zh()):this.f.volume=k*g*a.ba;else if(l=1-Math.abs(f/h),b){var r=k*(g+(1-g)*w*l)*a.ba;l=k*g*a.ba;0<=f?(this.Rc=r*this.ta,this.Uc=l*this.ta):(this.Rc=l*this.ta,this.Uc=r*this.ta);2*Math.abs(f)f?f>-this.zb?0:f+this.zb:f no audio buffer -> playWhenReady"),this.hr=!0)};c.prototype.yj=function(){var a=this.m.va.currentTime-this.Ch;this.nf();this.Qe=a};c.prototype.nf=function(){this.fc&&this.Pf&&(this.stopped=!0,this.fc.disconnect(),this.fc.stop(0),this.fc=null);this.Ch=this.Qe= 0;this.Pf=!1};c.prototype.Ro=function(){var a=this.m.va;return this.Qe?this.Qe:this.Ch?a.currentTime-this.Ch:0};c.prototype.So=function(a){this.nf();this.Qe=a;this.Xd()};c.prototype.addElement=function(){var a=-1,b=this,e=this.m,f=this.m.va;try{for(var g=!1,h=0;ha.loop&&(a.f.preload="none"));a.f.volume=a.level*b.ba;1<=a.loop&&(a.ub=a.loop-1);e&&(this.Sd=!0);(1==a.mode||2==a.mode||3==a.mode||5==a.mode)&& 0<=a.loop&&(a.f.autoplay=!0,a.isRunning=!0,a.autoplay=!0,a.Yk());b.S.push(this);b.Nh?b.$.appendChild(a.f):(a.f.style.position="absolute",a.xc&&(a.f.width=a.xc),a.ad&&(a.f.height=a.ad),b.K.appendChild(a.f));a.f.addEventListener("ended",function(){a.Cs()},!1)}catch(h){b.N(h)}};c.prototype.registerElement=function(a,b){this.dd=!0;this.f=b;this.id=a;this.level=1;this.m.S.push(this)};c.prototype.Se=function(){var a=this.m;a.Nh&&(a.R.deleteTexture(this.texture),this.texture=0,a.$.removeChild(this.f));a.ho&& a.K.removeChild(this.f);this.f=null};return c}(m);x.nl=m;m=function(d){function c(a){a=d.call(this,a)||this;a.url="";a.Fa=0;a.Ka=0;a.lb=0;a.fov=50;a.hb=0;a.Qg=!1;a.xc=100;a.ad=100;a.Ic=1;return a}__extends(c,d);c.prototype.Yb=function(a){d.prototype.Yb.call(this,a);var b;if(b=a.getAttributeNode("url"))this.url=b.nodeValue.toString();if(b=a.getAttributeNode("rotx"))this.Fa=Number(b.nodeValue);if(b=a.getAttributeNode("roty"))this.Ka=Number(b.nodeValue);if(b=a.getAttributeNode("rotz"))this.lb=Number(b.nodeValue); if(b=a.getAttributeNode("fov"))this.fov=Number(b.nodeValue);if(b=a.getAttributeNode("width"))this.xc=Number(b.nodeValue);if(b=a.getAttributeNode("height"))this.ad=Number(b.nodeValue);this.Ic=(b=a.getAttributeNode("stretch"))?Number(b.nodeValue):1;if(b=a.getAttributeNode("clickmode"))this.hb=Number(b.nodeValue);if(b=a.getAttributeNode("handcursor"))this.Qg=1==Number(b.nodeValue);for(a=a.firstChild;a;)"source"==a.nodeName&&(b=a.getAttributeNode("url"))&&(this.url=b.nodeValue.toString()),a=a.nextSibling}; c.prototype.Og=function(){this.Lg=!1;this.f.style[this.m.Yc]="none"};c.prototype.Ie=function(){1!==this.hb&&4!==this.hb||this.Ng(!this.nb)};c.prototype.Ng=function(a){var b=this.m;if(1===this.hb||4===this.hb)this.nb=a,this.m.Nb?(a=this.m.qa)&&a.activateSound(this.id,this.nb?1:0):(this.nb?(this.f.style.pointerEvents="auto",this.f.style.cursor="pointer",this.f.style.zIndex=(b.Rh+8E4).toString()):(this.f.style.pointerEvents="none",this.f.style.cursor="default",this.f.style.zIndex=b.Rh.toString()),this.f.style[b.Yc]= "all 1s ease 0s",this.Lg=!0,b.ao())};c.prototype.addElement=function(){var a=this,b=this.m;try{a.f=document.createElement("img");a.f.setAttribute("style","-webkit-user-drag:none; max-width:none; pointer-events:none;");a.f.setAttribute("class","ggmedia");a.f.hidden=!0;a.f.addEventListener("click",function(e){e.stopPropagation()});b.Ef&&a.f.setAttribute("id",b.Ef+a.id);a.f.ondragstart=function(){return!1};if(1===a.hb||4===a.hb)a.f.addEventListener(b.po(),function(){a.Og()},!1),a.f.addEventListener("transitionend", function(){a.Og()},!1);a.f.setAttribute("src",b.Pb(a.url));a.xc&&(a.f.width=a.xc);a.ad&&(a.f.height=a.ad);b.eb.push(a);a.f.style.position="absolute";b.K.appendChild(a.f)}catch(e){b.N("Error addimage:"+e)}};c.prototype.Se=function(){this.m.K.removeChild(this.f);this.f=null};return c}(p);x.zo=m;p=function(d){function c(a){a=d.call(this,a)||this;a.vl=50;a.alpha=50;a.type=0;a.color=16777215;return a}__extends(c,d);c.prototype.Yb=function(a){d.prototype.Yb.call(this,a);var b;if(b=a.getAttributeNode("blinding"))this.vl= Number(b.nodeValue);if(b=a.getAttributeNode("alpha"))this.alpha=Number(b.nodeValue);if(b=a.getAttributeNode("type"))this.type=Number(b.nodeValue);if(b=a.getAttributeNode("color"))this.color=1*Number(b.nodeValue)};return c}(p);x.Ao=p;p=function(){function d(c){this.m=c;this.type="empty";this.Qk=this.id=this.target=this.description=this.title=this.url="";this.w=100;this.h=20;this.rj=!1;this.f=null;this.Ab=this.Xb=this.gb=this.wa=this.distance=this.v=this.pan=0;this.visible=!0;this.ec=c.H.ec;this.cc= c.H.cc;this.dc=c.H.dc;this.bc=c.H.bc;this.Bf=c.H.Bf;this.Xc="";this.Cd=this.Ae=0;this.eg=!1;this.fi=0;this.vertices=[]}d.prototype.uf=function(){this.id=this.id;this.pan=this.pan;this.tilt=this.v;this.url=this.url;this.target=this.target;this.title=this.title;this.distance=this.distance;this.description=this.description;this.skinid=this.Qk;this.obj=this.f;this.customimage=this.Xc;this.customimagewidth=this.Ae;this.customimageheight=this.Cd;this.use3D=this.eg;this.distance3D=this.fi;this.f&&this.f.__div&& (this.div=this.f.__div)};d.prototype.gs=function(){var c=this.url;return"{"==c.charAt(0)?c.substr(1,c.length-2):!1};d.prototype.Yb=function(c){var a;if(a=c.getAttributeNode("url"))this.url=a.nodeValue.toString();if(a=c.getAttributeNode("target"))this.target=a.nodeValue.toString();if(a=c.getAttributeNode("title"))this.title=a.nodeValue.toString();if(a=c.getAttributeNode("description"))this.description=a.nodeValue.toString();if(a=c.getAttributeNode("id"))this.id=a.nodeValue.toString();if(a=c.getAttributeNode("skinid"))this.Qk= a.nodeValue.toString();if(a=c.getAttributeNode("width"))this.w=Number(a.nodeValue);if(a=c.getAttributeNode("height"))this.h=Number(a.nodeValue);if(a=c.getAttributeNode("wordwrap"))this.rj=1==Number(a.nodeValue);a=c.getAttributeNode("pan");this.pan=1*(a?Number(a.nodeValue):0);a=c.getAttributeNode("tilt");this.v=1*(a?Number(a.nodeValue):0);a=c.getAttributeNode("fov");this.fov=1*(a?Number(a.nodeValue):0);a=c.getAttributeNode("distance");this.distance=1*(a?Number(a.nodeValue):0);if(a=c.getAttributeNode("bordercolor"))this.ec= 1*Number(a.nodeValue);if(a=c.getAttributeNode("backgroundcolor"))this.cc=1*Number(a.nodeValue);if(a=c.getAttributeNode("borderalpha"))this.dc=1*Number(a.nodeValue);if(a=c.getAttributeNode("backgroundalpha"))this.bc=1*Number(a.nodeValue);if(a=c.getAttributeNode("handcursor"))this.Bf=1==Number(a.nodeValue);if(a=c.getAttributeNode("customimage"))this.Xc=this.m.dm()+a.nodeValue;if(a=c.getAttributeNode("customimagewidth"))this.Ae=Number(a.nodeValue);if(a=c.getAttributeNode("customimageheight"))this.Cd= Number(a.nodeValue);if(a=c.getAttributeNode("use3D"))this.eg=1==Number(a.nodeValue);if(a=c.getAttributeNode("distance3D"))this.fi=Number(a.nodeValue);for(c=c.firstChild;c;){if("polystring"==c.nodeName){a=c.textContent.toString().split("|");for(var b=0;bc;c++)2>c%3&&(f[c]*=d);e.bufferData(e.ARRAY_BUFFER,new Float32Array(f),e.STATIC_DRAW);this.ze=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,this.ze);var g=[1,0,0,0,0,1,1,1];e.bufferData(e.ARRAY_BUFFER,new Float32Array(g),e.STATIC_DRAW);this.nd=e.createBuffer();e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, this.nd);var h=[0,1,2,0,2,3];e.bufferData(e.ELEMENT_ARRAY_BUFFER,new Uint16Array(h),e.STATIC_DRAW);f=[];h=[];g=[];var l=new x.Ga;for(d=0;6>d;d++){var k=d%3;var w=3>d?1:0;for(a=0;4>a;a++){l.x=-1;l.y=-1;l.z=1;for(c=0;cl.x?.33:0)+.33*k,(0>l.y?0:.5)+.5*w);if(4>d)for(c=0;ca;a++){var b=c.createTexture();this.rd++; b.Qf=null;b.Me=null;b.ym=!1;c.bindTexture(c.TEXTURE_2D,b);c.texImage2D(c.TEXTURE_2D,0,c.RGB,1,1,0,c.RGB,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);if(d.rf[a]){var e=new Image;e.crossOrigin=d.crossOrigin;e.src=d.Pb(d.rf[a]);b.Qf=e;e.addEventListener&&e.addEventListener("load",this.ek(b),!1);d.gc.push(e)}this.ib.push(b)}for(a=0;6>a;a++)d.vg[a]&& (e=new Image,e.crossOrigin=d.crossOrigin,e.src=d.Pb(d.vg[a]),e.addEventListener?e.addEventListener("load",this.ek(this.ib[a]),!1):e.onload=this.ek(this.ib[a]),this.ib[a].Me=e,d.gc.push(e));for(a=0;ad;d++)this.Zf(d),c.bindBuffer(c.ARRAY_BUFFER,this.Kj),c.vertexAttribPointer(this.O.ia,3,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,this.ze),c.vertexAttribPointer(this.O.La,2,c.FLOAT,!1,0,0),6<=this.ib.length&&this.ib[d].loaded&&(c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,this.ib[d]),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.nd),c.uniform1i(this.O.Vf,0),c.uniformMatrix4fv(this.O.oh, !1,this.ya),c.uniformMatrix4fv(this.O.fe,!1,this.yb),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0))}};m.prototype.mj=function(){var d=this.m;if(d.u.Rf&&6>16&255)/255,(c>>8&255)/255,(c>>0&255)/255,1)}};m.prototype.Zf=function(d,c){void 0===c&&(c=1);var a=this.m;x.ja.identity(this.ya);x.ja.rotate(this.ya,c*-a.U.j*Math.PI/180,[0,0,1]);x.ja.rotate(this.ya,c*-a.v.j*Math.PI/180,[1,0,0]);-1==c?x.ja.rotate(this.ya,-a.pan.j*Math.PI/180,[0,1,0]):x.ja.rotate(this.ya, (180-a.pan.j)*Math.PI/180,[0,1,0]);a.Na&&(x.ja.rotate(this.ya,-a.Na.pitch*Math.PI/180,[1,0,0]),x.ja.rotate(this.ya,a.Na.U*Math.PI/180,[0,0,1]));4>d?x.ja.rotate(this.ya,-Math.PI/2*d,[0,1,0]):x.ja.rotate(this.ya,Math.PI/2*(5==d?1:-1),[1,0,0])};m.prototype.ks=function(d){var c=this;return function(){c.Pj.push(d)}};m.prototype.jp=function(d){this.m.Ma=!0;this.m.od=!0;d.loaded=!0;d.Ik=0;d.je=0;var c=this.m.R;this.Ll();c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,1);if(null!=d.u&&d.u.complete){d.pb=c.createTexture(); this.m.rd++;c.bindTexture(c.TEXTURE_2D,d.pb);try{c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,d.u)}catch(a){c.texImage2D(c.TEXTURE_2D,0,c.RGBA,1,1,0,c.RGBA,c.UNSIGNED_BYTE,new Uint8Array([128,128,128,250])),this.m.N(a)}}this.m.update(2)};m.prototype.Ll=function(){this.m.$b&&this.m.$b--};m.prototype.kp=function(){if(0f;f++){var g=new x.Td;g.V=document.createElement("canvas");c.m.ga?(g.V.width=b.width+2*e,g.V.height=b.height+2*e):(g.V.width=a.M+2*e,g.V.height=a.M+2*e);g.bb=g.V.getContext("2d");g.V.style[c.m.Ua+"Origin"]="0% 0%";g.V.style.overflow="hidden";g.V.style.position="absolute";g.u=d;var h=b.width+2*e,l=b.height+2*e;g.bb&&g.bb.drawImage(d,0,f*l,h,l,0,0,h,l);if(c.m.ga&&c.m.R){var k=c.m.R;k.pixelStorei(k.UNPACK_FLIP_Y_WEBGL, 1);g.pb=k.createTexture();c.m.rd++;k.bindTexture(k.TEXTURE_2D,g.pb);try{k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,g.V)}catch(w){c.m.N(w)}k.bindTexture(k.TEXTURE_2D,null);k.pixelStorei(k.UNPACK_FLIP_Y_WEBGL,0)}c.m.jd&&(g.V.ae=-1,c.m.K.insertBefore(g.V,c.m.K.firstChild));b.aa[f]=g}b.loaded=!0}}catch(w){c.m.N(w)}c.m.update(2)}};m.prototype.Wn=function(d){var c=this;return function(){c.m.Ma=!0;c.m.od=!0;c.Ll();d.u=null}};m.prototype.Hs=function(){var d=this.m,c=d.u,a=d.u.levels;d.Ee&& (d.bd(0),d.Qc());if(d.R){var b=d.R;b.useProgram(this.O);this.mj();b.clear(b.DEPTH_BUFFER_BIT);b.enable(b.DEPTH_TEST);x.ja.identity(this.yb);x.ja.perspective(d.Tb(),d.xb.width/d.xb.height,.1,100,this.yb);b.uniformMatrix4fv(this.O.fe,!1,this.yb);d.co();d.wk();var e=d.Uj();var f=a.length-1;for(d.Ec=0;f>=e;){var g=a[f],h=1;f==a.length-1&&0==c.Da&&(h=c.M/(c.M-.5));for(var l=0;6>l;l++){var k=d.cube.faces[l];var w=k.Of;if(k.ob&&0sh;sh++)id[sh]=0==sh%3?h*ha*(-2*id[sh]/g.width+1):1==sh%3?h*ha*(-2*id[sh]/g.height+1):ha;b.bufferData(b.ARRAY_BUFFER,new Float32Array(id),b.STATIC_DRAW)}}else w=!1;ua.visible=k.ob}r.tk=w}}f--}for(l=0;6>l;l++)if(k=d.cube.faces[l],k.ob)for(w=k.Of,this.Zf(l),b.uniform1i(this.O.Vf,0),b.uniformMatrix4fv(this.O.fe,!1,this.yb),b.uniformMatrix4fv(this.O.oh,!1,this.ya),b.enableVertexAttribArray(this.O.ia),b.enableVertexAttribArray(this.O.La), b.bindBuffer(b.ARRAY_BUFFER,this.ze),b.vertexAttribPointer(this.O.La,2,b.FLOAT,!1,0,0),b.activeTexture(b.TEXTURE0),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.nd),b.useProgram(this.O),f=e;f<=a.length-1;){g=a[f];if(k.ob&&0f?sh.Ue(-90*f):sh.Od(5==f?90:-90);h.Na&&(sh.Ve(h.Na.U),sh.Od(-h.Na.pitch));sh.Ue(-h.pan.j);sh.Od(h.v.j);sh.Ve(h.U.j);for(f=0;f<=e;f++)for(var db=0;db<=e;db++){var gl=2*(w+db*r)-1;var tf=2*(a+f*y)-1;id.x=1*gl;id.y=1*tf;id.z=-1;id.normalize();sh.Iq(id);gl=this.pm(id,l,h.Ra());0!=h.Cc&&1>ua&&(gl=gl&&this.pm(id,z,h.Cc),l.x=l.x*ua+z.x*(1-ua),l.y=l.y*ua+z.y*(1-ua));gl?-1E10l.x&&-1E10l.y?-2l.x&&-2l.y&&(c+= l.x,b+=l.y,ha++):l.x=NaN:l.x=NaN;d.sd[d.pi++]=l.x;d.sd[d.pi++]=l.y}0h;h++)isNaN(d.sd[2*b[0]])&&(e=!1);if(e){var l=!1,k=!1,w=!1,r=!1;for(h=0;4>h;h++){var y=d.sd[2*b[h]];yy;y++)for(var z=0;z=f;){var id={};k=a[h];var sh=null;0>w-h),y,-(0!=d.Cc)?.3:.1);tf.visible=0d.fov.j&&h d.Ne){d.N("Excided painted tiles");this.cj=!1;break}tf.pb&&(l=y=c.M,ha==k.T-1&&(y=k.width-c.M*ha),z==k.da-1&&(l=k.height-c.M*z),y=(y+2*c.Da)/c.M,l=(l+2*c.Da)/c.M,b.bindTexture(b.TEXTURE_2D,tf.pb),b.uniform2f(b.getUniformLocation(e,"uCanvasDimensions"),d.C.width,d.C.height),w=b.getUniformLocation(e,"srcScale"),b.uniform2f(w,.5*k.width/c.M/y,.5*k.height/c.M/l),w=b.getUniformLocation(e,"srcOffset"),b.uniform2f(w,(.5*k.width+c.Da-c.M*ha)/c.M/y,-(.5*k.height+c.Da-c.M*z)/c.M/l+1),w=b.getUniformLocation(e, "zOffset"),b.uniform1f(w,(h+1)/(a.length+5)),y=b.getAttribLocation(e,"aVertexPosition"),b.disableVertexAttribArray(0),b.disableVertexAttribArray(1),b.disableVertexAttribArray(2),b.enableVertexAttribArray(y),b.activeTexture(b.TEXTURE0),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),b.bindBuffer(b.ARRAY_BUFFER, this.oq),b.vertexAttribPointer(y,2,b.FLOAT,!1,0,0),b.bufferData(b.ARRAY_BUFFER,new Float32Array(tf.sd),b.DYNAMIC_DRAW),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.nq),b.bufferData(b.ELEMENT_ARRAY_BUFFER,new Uint16Array(tf.Je),b.DYNAMIC_DRAW),b.drawElements(b.TRIANGLES,tf.Fd,b.UNSIGNED_SHORT,0),g++)}h++}b.disable(b.CULL_FACE);b.cullFace(b.FRONT_AND_BACK);d.od=!1}};m.prototype.nj=function(d,c){var a=this.m.R;x.ja.identity(this.ya);this.Zf(d,-1);a.uniformMatrix4fv(a.getUniformLocation(c,"matRotate"),!1, this.ya)};m.prototype.$q=function(){var d=this.m;if(d.R){var c=d.R,a=this.qn;c.useProgram(a);this.nj(0,a);c.uniform2f(c.getUniformLocation(a,"uCanvasDimensions"),d.C.width,d.C.height);var b=c.getUniformLocation(a,"srcOffset");c.uniform2f(b,.5,.5);1==d.D.format&&(b=c.getUniformLocation(a,"srcScale"),d.Jd?(c.uniform2f(b,-.5/Math.PI,(d.D.flipY?-.5:.5)/Math.PI),b=c.getUniformLocation(a,"srcOffset"),d.Eh?c.uniform2f(b,.5,.75):c.uniform2f(b,.5,.25)):c.uniform2f(b,-.5/Math.PI,(d.D.flipY?-1:1)/Math.PI)); 14==d.D.format&&(b=c.getUniformLocation(a,"srcScale"),c.uniform2f(b,1-2*d.D.kf/(d.D.width/3),1-2*d.D.kf/(d.D.height/2)));this.$k(a);b=c.getUniformLocation(a,"cubeTexture");c.uniform1i(b,0);b=c.getAttribLocation(a,"aVertexPosition");c.disableVertexAttribArray(0);c.disableVertexAttribArray(1);c.disableVertexAttribArray(2);c.enableVertexAttribArray(b);c.bindBuffer(c.ARRAY_BUFFER,this.Si);c.vertexAttribPointer(b,2,c.FLOAT,!1,0,0);c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,d.D.texture);c.texParameteri(c.TEXTURE_2D, c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.nd);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0)}};m.prototype.$k=function(d){var c=this.m,a=c.R,b=this.m.C,e=b.width/b.height;switch(c.fov.mode){case 1:e=1;break;case 2:e=b.width/Math.sqrt(b.width*b.width+b.height*b.height);break;case 3:4* b.height/3g;g++)this.ib[g].Me.complete?this.ci[g]||(f=!0):b=!1,this.ib[g].Qf.complete||(e=!1);if(e||b)if(!e||b||!this.Jc||f){g=Math.round(d.Fc/d.bf);e=(d.Fc-g)/2;d.N("paint cube single - isMain: "+b+" overlap: "+e);this.qf=0;this.Jc||(this.Jc=c.createTexture());d.rd++;c.bindTexture(c.TEXTURE_CUBE_MAP,this.Jc);c.texParameteri(c.TEXTURE_CUBE_MAP,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_CUBE_MAP,c.TEXTURE_WRAP_T, c.CLAMP_TO_EDGE);c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,1);f=document.createElement("canvas");f.width=g;f.height=g;var h=f.getContext("2d");for(g=0;6>g;g++){var l=a[g];this.ib[l].Me.complete?this.ci[l]||(h.drawImage(this.ib[l].Me,-e,-e),c.texImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+g,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,f),this.ci[l]=!0):(h.drawImage(this.ib[l].Qf,-e,-e,d.Fc,d.Fc),c.texImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+g,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,f))}this.Yg=!b}};m.prototype.hp=function(){var d=this.m, c=this.m.u,a=d.u.levels,b=d.R,e;var f=a.length-1;if(!(0>f)){a[f].Re&&f--;var g=512;d.Xg&&(g=256);!d.Uf&&2<=d.devicePixelRatio&&(g=512);for((e=b.getParameter(b.MAX_CUBE_MAP_TEXTURE_SIZE))&&ef){g=a[f];d.N("paint cube level "+f);this.qf=f;a=d.u.Da;f=0g.width&&(1500k;k++){for(var w=0;we;e++)for(var f=0;fc;c++)for(var a=0;a1.1*d.Un)for(this.Zd.sort(function(l,k){return k.bh-l.bh});this.Zd.length>d.Un;)h=this.Zd.pop(),h.pb&&(a.deleteTexture(h.pb),d.rd--,h.pb=0),h.u=null,h.Af&&(a.deleteBuffer(h.Af), h.Af=0),g=h.level.aa.indexOf(h),d.N("delete "+g+" "+(b-h.bh)),delete h.level.aa[g]};m.prototype.As=function(){var d=this.m;if(d.R){var c=this.m.R;c.disable(c.DEPTH_TEST);var a;for(a=0;ac;c++)this.Zf(0),a.bindBuffer(a.ARRAY_BUFFER,d.D.el),a.vertexAttribPointer(this.O.ia,3,a.FLOAT,!1,0,0),a.bindBuffer(a.ARRAY_BUFFER,d.D.ej),a.vertexAttribPointer(this.O.La,2,a.FLOAT,!1,0,0),a.activeTexture(a.TEXTURE0), a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,d.D.lk),a.uniform1i(this.O.Vf,0),a.uniformMatrix4fv(this.O.oh,!1,this.ya),a.uniformMatrix4fv(this.O.fe,!1,this.yb),a.drawElements(a.TRIANGLES,36,a.UNSIGNED_SHORT,0)}};m.prototype.ys=function(){var d=this.m,c=d.R,a=d.D;if(0=a.H.mode&&(e=0);3==a.H.mode&&(e=a.H.wa);for(d=0;d>16&255)/255,(c>>8&255)/255,(c&255)/255);var k=b.getUniformLocation(this.Md,"uAlpha");b.uniform1f(k,f.dc*h);b.vertexAttribPointer(this.Md.ia,3,b.FLOAT,!1,0,0);b.drawArrays(b.LINE_LOOP,0,l.length/3); c=f.cc;b.uniform3f(g,(c>>16&255)/255,(c>>8&255)/255,(c&255)/255);b.uniform1f(k,f.bc*h);b.enable(b.STENCIL_TEST);b.clearStencil(0);b.clear(b.STENCIL_BUFFER_BIT);b.colorMask(!1,!1,!1,!1);b.stencilFunc(b.ALWAYS,1,1);b.stencilOp(b.INCR,b.INCR,b.INCR);b.drawArrays(b.TRIANGLE_FAN,0,l.length/3);b.colorMask(!0,!0,!0,!0);b.stencilFunc(b.EQUAL,1,1);b.stencilOp(b.ZERO,b.ZERO,b.ZERO);b.drawArrays(b.TRIANGLE_FAN,0,l.length/3);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.disable(b.STENCIL_TEST);b.useProgram(this.O)}}}}}; m.prototype.Zk=function(){var d=this.m,c=d.u;if(d.C.width!=d.K.offsetWidth||d.C.height!=d.K.offsetHeight)d.C.width=d.K.offsetWidth,d.C.height=d.K.offsetHeight;d.Ee&&(d.bd(0),d.Qc());if(d.R){var a=d.R;this.mj();a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);a.disable(a.DEPTH_TEST);a.disable(a.CULL_FACE);a.useProgram(this.Cg);var b=a.getUniformLocation(this.Cg,"uRect");a.uniform2f(a.getUniformLocation(this.Cg,"uCanvasDimensions"),d.C.width,d.C.height);a.activeTexture(a.TEXTURE0);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.nd);var e=a.getAttribLocation(this.Cg,"aVertexPosition");a.disableVertexAttribArray(0);a.disableVertexAttribArray(1);a.disableVertexAttribArray(2);a.enableVertexAttribArray(e);a.bindBuffer(a.ARRAY_BUFFER,this.ze);a.vertexAttribPointer(e,2,a.FLOAT,!1,0,0);d.Ec=0;var f=100/d.fov.j;var g=c.width/c.height;e=d.C.height*f*g;f*=d.C.height;g=(d.pan.j/100/g-.5)*e+d.C.width/2;for(var h=(d.v.j/100-.5)*f+d.C.height/2,l,k,w,r=0;c.levels.length>=r+2&&c.levels[r+1].width>e;)r++;var y;var z=[];for(y=c.levels.length- 1;y>=r;){var ha=c.levels[y];if(ha.cache){var ua={jb:0,Gb:0};ua.Ib=ha.T-1;ua.Jb=ha.da-1}else{ua={};l=-h/f*(ha.height/d.u.M);k=(-g+d.C.width)/e*(ha.width/d.u.M);var id=(-h+d.C.height)/f*(ha.height/d.u.M);ua.jb=Math.min(Math.max(0,Math.floor(-g/e*(ha.width/d.u.M))),ha.T-1);ua.Gb=Math.min(Math.max(0,Math.floor(l)),ha.da-1);ua.Ib=Math.min(Math.max(0,Math.floor(k)),ha.T-1);ua.Jb=Math.min(Math.max(0,Math.floor(id)),ha.da-1)}z[y]=ua;var sh=!0;for(k=ua.Gb;k<=ua.Jb;k++)for(l=ua.jb;l<=ua.Ib;l++)w=l+k*ha.T,id= ha.aa[w],id||(id=new x.Td,ha.aa[w]=id),this.gi()?id.u||(this.Ei(id,ha,d.oe(0,y,l,k)),d.Ma=!0):this.m.Ec++,id.u&&id.u.complete||(sh=!1),id.visible=!0;ua.tk=sh;y--}for(y=c.levels.length-1;y>=r;){ha=c.levels[y];if(z[y]&&0<=z[y].jb)for(ua=z[y],k=ua.Gb;k<=ua.Jb;k++)for(l=ua.jb;l<=ua.Ib;l++)w=l+k*ha.T,(id=ha.aa[w])&&id.u&&id.u.complete&&(d=g+(-c.Da+c.M*l)*e/ha.width,a.uniform4f(b,d,h+(-c.Da+c.M*k)*f/ha.height,id.u.width*e/ha.width,id.u.height*f/ha.height),id&&id.pb&&(a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.nd),a.bindTexture(a.TEXTURE_2D,id.pb),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.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0)));y--}this.Jk()}};m.prototype.Te=function(){var d=this.m.R;if(d&&this.ib)for(;0c;c++)this.faces[c]=new p}d.prototype.ap=function(c,a,b,e){for(var f=0;6>f;f++){var g;if(g=this.faces[f]){var h=[];h.push(new x.Ga(-1,-1,-1,0,0));h.push(new x.Ga(1,-1,-1,1,0));h.push(new x.Ga(1,1,-1,1,1));h.push(new x.Ga(-1,1,-1,0,1));for(var l=0;lf?h[l].Ka(-Math.PI/2*f):h[l].Fa(Math.PI/2*(4===f?-1:1)), e&&(h[l].lb(e.U*Math.PI/180),h[l].Fa(-e.pitch*Math.PI/180)),h[l].Ka(-c*Math.PI/180),h[l].Fa(a*Math.PI/180),h[l].lb(b*Math.PI/180);g.ob=0 uRadius) {\n alpha = 1.0;\n } else {\n alpha = 1.0 - ((uRadius - distFromCenter) / uSoftEdge);\n };\n }\n else {\n float alphaFromLeft = 1.0 - ((gl_FragCoord.x -(uIrisCenter.x - uRectDim.x)) / uSoftEdge);\n float alphaFromRight = 1.0 - (((uIrisCenter.x + uRectDim.x) - gl_FragCoord.x) / uSoftEdge);\n float alphaFromTop = 1.0 - ((gl_FragCoord.y -(uIrisCenter.y - uRectDim.y)) / uSoftEdge);\n float alphaFromBottom = 1.0 - (((uIrisCenter.y + uRectDim.y) - gl_FragCoord.y) / uSoftEdge);\n alpha = max(max(alphaFromLeft, alphaFromRight), max(alphaFromTop, alphaFromBottom));\n }\n gl_FragColor = vec4(textureColor.x, textureColor.y, textureColor.z, alpha);\n}\n"); d.compileShader(a);d.getShaderParameter(a,d.COMPILE_STATUS)||(alert(d.getShaderInfoLog(a)),a=null);this.Ta=d.createProgram();d.attachShader(this.Ta,c);d.attachShader(this.Ta,a);d.linkProgram(this.Ta);d.getProgramParameter(this.Ta,d.LINK_STATUS)||alert("Could not initialise shaders");this.Ta.ia=d.getAttribLocation(this.Ta,"aVertexPosition");d.enableVertexAttribArray(this.Ta.ia);this.Ta.La=d.getAttribLocation(this.Ta,"aTextureCoord");d.enableVertexAttribArray(this.Ta.La);a=d.createShader(d.FRAGMENT_SHADER); d.shaderSource(a,"#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\nvarying vec2 vTextureCoord;\nuniform float uPercent;\nuniform int uDirection;\nuniform vec2 uCanvasDimensions;\nuniform float uSoftEdge;\nuniform sampler2D uSampler;\nvoid main(void) {\n vec4 textureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n float alpha = 0.0;\n if (uDirection == 1) {\n\t if (gl_FragCoord.x > uPercent) {\n alpha = 1.0; \n } else {\n alpha = 1.0 - ((uPercent - gl_FragCoord.x) / uSoftEdge);\n }\n }\n if (uDirection == 2) {\n\t if (gl_FragCoord.x < uCanvasDimensions.x - uPercent) {\n alpha = 1.0; \n } else {\n alpha = 1.0 - ((gl_FragCoord.x - (uCanvasDimensions.x - uPercent)) / uSoftEdge);\n }\n }\n if (uDirection == 3) {\n\t if (gl_FragCoord.y < uCanvasDimensions.y - uPercent) {\n alpha = 1.0; \n } else {\n alpha = 1.0 - ((gl_FragCoord.y - (uCanvasDimensions.y - uPercent)) / uSoftEdge);\n }\n }\n if (uDirection == 4) {\n\t if (gl_FragCoord.y > uPercent) {\n alpha = 1.0; \n } else {\n alpha = 1.0 - ((uPercent - gl_FragCoord.y) / uSoftEdge);\n }\n }\n gl_FragColor = vec4(textureColor.x, textureColor.y, textureColor.z, alpha);\n}\n"); d.compileShader(a);d.getShaderParameter(a,d.COMPILE_STATUS)||(alert(d.getShaderInfoLog(a)),a=null);this.Za=d.createProgram();d.attachShader(this.Za,c);d.attachShader(this.Za,a);d.linkProgram(this.Za);d.getProgramParameter(this.Za,d.LINK_STATUS)||alert("Could not initialise shaders");this.Za.ia=d.getAttribLocation(this.Za,"aVertexPosition");d.enableVertexAttribArray(this.Za.ia);this.Za.La=d.getAttribLocation(this.Za,"aTextureCoord");d.enableVertexAttribArray(this.Za.La)};m.prototype.bd=function(){var d= this.m.R;if(!d)return!1;if(this.rc=d.createFramebuffer()){d.bindFramebuffer(d.FRAMEBUFFER,this.rc);this.rc.width=1024;this.rc.height=1024;this.cf=d.createTexture();d.bindTexture(d.TEXTURE_2D,this.cf);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR);d.texImage2D(d.TEXTURE_2D,0,d.RGBA,this.rc.width,this.rc.height,0,d.RGBA,d.UNSIGNED_BYTE,null);var c=d.createRenderbuffer();d.bindRenderbuffer(d.RENDERBUFFER,c);d.renderbufferStorage(d.RENDERBUFFER, d.DEPTH_COMPONENT16,this.rc.width,this.rc.height);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,this.cf,0);d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER,c);d.bindTexture(d.TEXTURE_2D,null);d.bindRenderbuffer(d.RENDERBUFFER,null);d.bindFramebuffer(d.FRAMEBUFFER,null);this.qb=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,this.qb);d.bufferData(d.ARRAY_BUFFER,new Float32Array([-1,-1,0,1,-1,0,-1,1,0,1,1,0]),d.STATIC_DRAW);this.qb.itemSize=3;this.qb.ee= 4;this.Sf=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,this.Sf);d.bufferData(d.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),d.STATIC_DRAW);return!0}return!1};m.prototype.en=function(d){var c=this.m.R,a=this.m.xb;if(this.yd){c.useProgram(this.Aa);c.bindBuffer(c.ARRAY_BUFFER,this.qb);c.vertexAttribPointer(this.Aa.ia,this.qb.itemSize,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,this.Sf);c.vertexAttribPointer(this.Aa.La,2,c.FLOAT,!1,0,0);c.enableVertexAttribArray(this.Aa.ia);c.enableVertexAttribArray(this.Aa.La); c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,this.cf);a=1+(this.Fb-1)*d;var b=c.getUniformLocation(this.Aa,"uAlpha");c.uniform1f(b,1);b=c.getUniformLocation(this.Aa,"uZoomIn");c.uniform1i(b,1);b=c.getUniformLocation(this.Aa,"uZoomCenter");var e=.5+(this.Sh-.5)*Math.sqrt(d),f=.5+(this.Th-.5)*Math.sqrt(d);0>e-.5/a&&(e=.5/a);0>f-.5/a&&(f=.5/a);1e-.5/this.Fb&&(e=.5/this.Fb);0>f-.5/this.Fb&&(f=.5/this.Fb);1>16&255)/255,(this.lf>>8&255)/255,(this.lf&255)/255),b=c.getUniformLocation(this.fb,"uZoomIn"),c.uniform1i(b,1==this.ra||2==this.ra||6==this.ra?1:0),b=c.getUniformLocation(this.fb,"uZoomCenter"),c.uniform2f(b,e,f),e=c.getUniformLocation(this.fb,"uZoomFactor"),c.uniform1f(e,this.Fb),c.uniform1i(c.getUniformLocation(this.fb,"uSampler"),0);else if("irisround"==this.type||"irisroundcenter"==this.type||"irisrectangular"==this.type||"irisrectangularcenter"==this.type){c.useProgram(this.Ta); c.bindBuffer(c.ARRAY_BUFFER,this.qb);c.vertexAttribPointer(this.Ta.ia,this.qb.itemSize,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,this.Sf);c.vertexAttribPointer(this.Ta.La,2,c.FLOAT,!1,0,0);c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,this.cf);if(1==this.ra||2==this.ra||6==this.ra||"irisroundcenter"==this.type||"irisrectangularcenter"==this.type)var g=b=.5;else b=this.Sh,g=this.Th;var h=b*a.width,l=g*a.height;h=Math.max(h,a.width-h);l=Math.max(l,a.height-l);"irisround"==this.type||"irisroundcenter"== this.type?c.uniform1f(c.getUniformLocation(this.Ta,"uRadius"),(Math.sqrt(h*h+l*l)+this.Pc)*d):(h>l?(l=a.height/a.width*h+this.Pc,h+=this.Pc):(h=a.width/a.height*l+this.Pc,l+=this.Pc),c.uniform2f(c.getUniformLocation(this.Ta,"uRectDim"),h*d,l*d));d=c.getUniformLocation(this.Ta,"uSoftEdge");c.uniform1f(d,this.Pc);c.uniform1i(c.getUniformLocation(this.Ta,"uRound"),"irisround"==this.type||"irisroundcenter"==this.type?1:0);c.uniform2f(c.getUniformLocation(this.Ta,"uIrisCenter"),b*a.width,g*a.height);b= c.getUniformLocation(this.Ta,"uZoomIn");c.uniform1i(b,1==this.ra||2==this.ra||6==this.ra?1:0);b=c.getUniformLocation(this.Ta,"uZoomCenter");c.uniform2f(b,e,f);e=c.getUniformLocation(this.Ta,"uZoomFactor");c.uniform1f(e,this.Fb);c.uniform1i(c.getUniformLocation(this.Ta,"uSampler"),0)}else if("wipeleftright"==this.type||"wiperightleft"==this.type||"wipetopbottom"==this.type||"wipebottomtop"==this.type||"wiperandom"==this.type)c.useProgram(this.Za),c.bindBuffer(c.ARRAY_BUFFER,this.qb),c.vertexAttribPointer(this.Za.ia, this.qb.itemSize,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,this.Sf),c.vertexAttribPointer(this.Za.La,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,this.cf),c.uniform1f(c.getUniformLocation(this.Za,"uPercent"),3>this.Nj?d*(a.width+this.Pc):d*(a.height+this.Pc)),d=c.getUniformLocation(this.Za,"uSoftEdge"),c.uniform1f(d,this.Pc),c.uniform1i(c.getUniformLocation(this.Za,"uDirection"),this.Nj),c.uniform2f(c.getUniformLocation(this.Za,"uCanvasDimensions"),a.width,a.height), b=c.getUniformLocation(this.Za,"uZoomIn"),c.uniform1i(b,1==this.ra||2==this.ra||6==this.ra?1:0),b=c.getUniformLocation(this.Za,"uZoomCenter"),c.uniform2f(b,e,f),e=c.getUniformLocation(this.Za,"uZoomFactor"),c.uniform1f(e,this.Fb),c.uniform1i(c.getUniformLocation(this.Za,"uSampler"),0);c.drawArrays(c.TRIANGLE_STRIP,0,this.qb.ee);c.useProgram(this.m.za.O);c.disable(c.BLEND);c.enable(c.DEPTH_TEST)}};return m}();x.vo=p})(ggP2VR||(ggP2VR={})); (function(x){var p=function(){function m(d){this.Ih=[];this.m=d;this.enabled=!1;this.Db=2;this.Gl=!1}m.prototype.Ql=function(d){if(2==d.mode||3==d.mode||5==d.mode){var c=this.m.va.currentTime;if(d.Hb&&d.Hb.gain&&d.Sb&&d.Qb&&d.Rb){var a=d.Sb.gain.value,b=d.Qb.gain.value,e=d.Rb.gain.value;d.Hb.gain.linearRampToValueAtTime(d.Hb.gain.value,c);d.Hb.gain.linearRampToValueAtTime(0,c+this.Db);d.Sb.gain.linearRampToValueAtTime(a,c);d.Sb.gain.linearRampToValueAtTime(0,c+this.Db);d.Qb.gain.linearRampToValueAtTime(b, c);d.Qb.gain.linearRampToValueAtTime(0,c+this.Db);d.Rb.gain.linearRampToValueAtTime(e,c);d.Rb.gain.linearRampToValueAtTime(0,c+this.Db)}}else c=this.m.va.currentTime,d.ic&&d.ic.gain&&(d.ic.gain.linearRampToValueAtTime(d.ic.gain.value,c),d.ic.gain.linearRampToValueAtTime(0,c+this.Db));d.Tj=!0;setTimeout(function(){d.Se()},1E3*this.Db+5)};m.prototype.ds=function(){for(var d=0;da.ta&&(a.ta=d)}1==d&&clearInterval(this.Yr)};return m}();x.wo=p})(ggP2VR||(ggP2VR={})); (function(x){var p=function(){function m(d){this.gh=[];this.ld=null;this.pc=[];this.hc=[];this.qc=[];this.Pk=!0;this.m=d;this.fp()}m.prototype.Tg=function(){var d=this.m.R,c=d.createShader(d.VERTEX_SHADER);d.shaderSource(c,"attribute vec3 aVertexPosition;\nvoid main(void) {\n gl_Position = vec4(aVertexPosition, 1.0);\n}\n");d.compileShader(c);d.getShaderParameter(c,d.COMPILE_STATUS)||(alert(d.getShaderInfoLog(c)),c=null);var a=d.createShader(d.FRAGMENT_SHADER);d.shaderSource(a,"#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\nvarying vec4 vColor;\nuniform vec2 uCanvasDimensions;\nuniform vec2 uFlareCenterPosition;\nuniform float uBlindingValue;\nuniform float uAspectRatio;\nvoid main(void) {\n float canvasDiag = sqrt( (uCanvasDimensions.x * uCanvasDimensions.x) + (uCanvasDimensions.y * uCanvasDimensions.y) );\n vec2 diff = uFlareCenterPosition - gl_FragCoord.xy;\n diff.y = diff.y * uAspectRatio;\n float distFromFlarePoint = sqrt( (diff.x * diff.x) + (diff.y * diff.y) );\n float factor = (distFromFlarePoint / canvasDiag) / 10.0;\n gl_FragColor = vec4(1.0, 1.0, 1.0, pow(((1.0 - factor) * 0.8) * uBlindingValue, 2.0));\n}\n"); d.compileShader(a);d.getShaderParameter(a,d.COMPILE_STATUS)||(alert(d.getShaderInfoLog(a)),a=null);this.uc=d.createProgram();d.attachShader(this.uc,c);d.attachShader(this.uc,a);d.linkProgram(this.uc);d.getProgramParameter(this.uc,d.LINK_STATUS)||alert("Could not initialise shaders");this.uc.ia=d.getAttribLocation(this.uc,"aVertexPosition");d.enableVertexAttribArray(this.uc.ia);a=d.createShader(d.VERTEX_SHADER);c=d.createShader(d.VERTEX_SHADER);d.shaderSource(a,"#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\nattribute vec3 aVertexPosition;\nvarying vec4 vColor;\nuniform vec2 uCirclePosition;\nuniform float uCircleRadius;\nuniform vec2 uCanvasDimensions2;\nuniform float uAspectRatio;\nvoid main(void) {\n vec2 circleOnScreen = aVertexPosition.xy * uCircleRadius + uCirclePosition;\n circleOnScreen.y = circleOnScreen.y / uAspectRatio;\n vec2 circleNorm = (circleOnScreen / uCanvasDimensions2) * 2.0 - vec2(1.0, 1.0);\n gl_Position = vec4(circleNorm.x, circleNorm.y, 0.0, 1.0);\n}\n"); d.compileShader(a);d.getShaderParameter(a,d.COMPILE_STATUS)||(alert(d.getShaderInfoLog(a)),a=null);d.shaderSource(c,"#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\nattribute vec3 aVertexPosition;\nvarying vec4 vColor;\nuniform vec2 uCirclePosition;\nuniform float uCircleRadius;\nuniform vec2 uCanvasDimensions2;\nuniform float uAspectRatio;\nvoid main(void) {\n vec2 circleOnScreen = aVertexPosition.xy * uCircleRadius + uCirclePosition;\n circleOnScreen.y = circleOnScreen.y / uAspectRatio;\n vec2 circleNorm = (circleOnScreen / uCanvasDimensions2) * 2.0 - vec2(1.0, 1.0);\n gl_Position = vec4(circleNorm.x, circleNorm.y, 0.0, 1.0);\n}\n"); d.compileShader(c);d.getShaderParameter(c,d.COMPILE_STATUS)||(alert(d.getShaderInfoLog(c)),a=null);var b=d.createShader(d.FRAGMENT_SHADER);d.shaderSource(b,"#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\nvarying vec4 vColor;\nuniform vec2 uCircleTexturePosition;\nuniform vec3 uCircleColor;\nuniform float uCircleRadius;\nuniform float uCircleAlpha;\nuniform float uCircleSoftness;\nuniform float uAspectRatio;\nvoid main(void) {\n vec2 diff = uCircleTexturePosition - gl_FragCoord.xy;\n diff.y = diff.y * uAspectRatio;\n float distFromCircleCenter = sqrt( (diff.x * diff.x) + (diff.y * diff.y) );\n float softnessDistance = uCircleRadius * (1.0 - uCircleSoftness);\n if (distFromCircleCenter > uCircleRadius)\n {\n\t gl_FragColor = vec4(uCircleColor, 0.0);\n }\n else if (distFromCircleCenter <= (softnessDistance))\n {\n\t float factor = distFromCircleCenter / softnessDistance;\n\t gl_FragColor = vec4(uCircleColor, pow((1.0 - (0.2 * factor)) * uCircleAlpha, 1.8));\n }\n else\n {\n\t float factor = (distFromCircleCenter - softnessDistance) / (uCircleRadius - softnessDistance);\n\t gl_FragColor = vec4(uCircleColor, pow((0.8 - (0.8 * factor)) * uCircleAlpha, 1.8));\n }\n}\n"); d.compileShader(b);d.getShaderParameter(b,d.COMPILE_STATUS)||(alert(d.getShaderInfoLog(b)),b=null);this.Ba=d.createProgram();d.attachShader(this.Ba,a);d.attachShader(this.Ba,b);d.linkProgram(this.Ba);d.getProgramParameter(this.Ba,d.LINK_STATUS)||alert("Could not initialise shaders");this.Ba.ia=d.getAttribLocation(this.Ba,"aVertexPosition");d.enableVertexAttribArray(this.Ba.ia);a=d.createShader(d.FRAGMENT_SHADER);d.shaderSource(a,"#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\nvarying vec4 vColor;\nuniform vec2 uRingTexturePosition;\nuniform float uRingRadius;\nuniform float uRingAlpha;\nuniform float uAspectRatio;\nuniform sampler2D uSampler;\nvoid main(void) {\n vec2 diff = uRingTexturePosition - gl_FragCoord.xy;\n diff.y = diff.y * uAspectRatio;\n float distFromRingCenter = sqrt( (diff.x * diff.x) + (diff.y * diff.y) );\n float factor = distFromRingCenter / uRingRadius;\n if (distFromRingCenter > uRingRadius)\n {\n\t gl_FragColor = vec4(1.0, 1.0, 1.0, 0.0);\n }\n else\n {\n vec4 textureColor = texture2D(uSampler, vec2(factor / uAspectRatio, 0.5));\n gl_FragColor = vec4(textureColor.x, textureColor.y, textureColor.z, uRingAlpha);\n }\n}\n"); d.compileShader(a);d.getShaderParameter(a,d.COMPILE_STATUS)||(alert(d.getShaderInfoLog(a)),a=null);this.Cb=d.createProgram();d.attachShader(this.Cb,c);d.attachShader(this.Cb,a);d.linkProgram(this.Cb);d.getProgramParameter(this.Cb,d.LINK_STATUS)||alert("Could not initialise shaders");this.Cb.ia=d.getAttribLocation(this.Cb,"aVertexPosition")};m.prototype.bd=function(){var d=this.m.R;this.Ed=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,this.Ed);d.bufferData(d.ARRAY_BUFFER,new Float32Array([-1,-1,0,1, -1,0,1,1,0,-1,1,0]),d.STATIC_DRAW);this.Ed.itemSize=3;this.Ed.ee=4;this.xf=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,this.xf);for(var c=[0,0,0],a=2*Math.PI/6,b=Math.PI/180*35,e=1,f=b;f<=b+2*Math.PI;f+=a)c.push(Math.sin(f)),c.push(-Math.cos(f)),c.push(0),e++;d.bufferData(d.ARRAY_BUFFER,new Float32Array(c),d.STATIC_DRAW);this.xf.itemSize=3;this.xf.ee=e;this.un=d.createTexture();d.bindTexture(d.TEXTURE_2D,this.un);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR);d.texParameteri(d.TEXTURE_2D, d.TEXTURE_MAG_FILTER,d.LINEAR);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE);c=document.createElement("canvas");c.width=100;c.height=1;a=c.getContext("2d");a.width=100;a.height=1;b=a.createLinearGradient(0,0,100,0);b.addColorStop(0,this.m.ea(16777215,0));b.addColorStop(.88,this.m.ea(0,0));b.addColorStop(.9,this.m.ea(16654848,1));b.addColorStop(.92,this.m.ea(16776448,1));b.addColorStop(.94,this.m.ea(4849466,1));b.addColorStop(.96, this.m.ea(131071,1));b.addColorStop(.98,this.m.ea(8190,1));b.addColorStop(1,this.m.ea(0,0));a.fillStyle=b;a.fillRect(0,0,100,1);d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,c)};m.prototype.kr=function(){for(;0a.z){f=-b/a.z;e=a.x*f;f*=a.y;var y=Math.max(h,l);Math.abs(e)l?h:l;y=r.vl/100*((ua-ha)/ua);0>y&&(y=0);if(this.m.ga){d.useProgram(this.uc);d.bindBuffer(d.ARRAY_BUFFER,this.m.J.qb);d.vertexAttribPointer(this.uc.ia,this.m.J.qb.itemSize,d.FLOAT,!1,0,0);var id=d.getUniformLocation(this.uc,"uCanvasDimensions");d.uniform2f(id,d.drawingBufferWidth,d.drawingBufferHeight);d.uniform2f(d.getUniformLocation(this.uc, "uFlareCenterPosition"),d.drawingBufferWidth/h*e,l-d.drawingBufferHeight/l*f);d.uniform1f(d.getUniformLocation(this.uc,"uBlindingValue"),y);id=d.getUniformLocation(this.uc,"uAspectRatio");d.uniform1f(id,this.m.J.Hh?d.drawingBufferWidth/d.drawingBufferHeight:d.drawingBufferWidth/d.drawingBufferHeight/(h/l));d.drawArrays(d.TRIANGLE_STRIP,0,this.m.J.qb.ee)}else id=this.Z.createRadialGradient(e,f,1,e,f,z),id.addColorStop(0,"rgba(255, 255, 255, "+y+")"),id.addColorStop(.5,"rgba(255, 255, 255, "+.8*y+")"), id.addColorStop(1,"rgba(255, 255, 255, "+.6*y+")"),this.Z.fillStyle=id,this.Z.fillRect(0,0,this.Z.width,this.Z.height);if(0!=Number(r.type)&&!this.m.J.Hh){y=h/2-e;z=l/2-f;var sh=1,db=Number(r.type)-1;ha<.35*ua&&(sh=ha/(.35*ua),sh*=sh);ha>.7*ua&&(sh=(ua-ha)/(.3*ua));sh*=r.alpha/100;if(0tf&&(tf=0);var hl=gl.color;if(8==db||9==db||10==db)hl=r.color;if(this.m.ga)d.useProgram(this.Ba),d.bindBuffer(d.ARRAY_BUFFER, this.xf),d.vertexAttribPointer(this.Ba.ia,this.xf.itemSize,d.FLOAT,!1,0,0),id=d.getUniformLocation(this.Ba,"uCanvasDimensions2"),d.uniform2f(id,d.drawingBufferWidth,d.drawingBufferHeight),d.uniform2f(d.getUniformLocation(this.Ba,"uCirclePosition"),d.drawingBufferWidth/h*(e+y*gl.A),d.drawingBufferWidth/h*(l-(f+z*gl.A))),d.uniform2f(d.getUniformLocation(this.Ba,"uCircleTexturePosition"),d.drawingBufferWidth/h*(e+y*gl.A),l-(f+z*gl.A)),d.uniform1f(d.getUniformLocation(this.Ba,"uCircleRadius"),ua),d.uniform3f(d.getUniformLocation(this.Ba, "uCircleColor"),(hl>>16&255)/255,(hl>>8&255)/255,(hl&255)/255),d.uniform1f(d.getUniformLocation(this.Ba,"uCircleAlpha"),tf),d.uniform1f(d.getUniformLocation(this.Ba,"uCircleSoftness"),.1),id=d.getUniformLocation(this.Ba,"uAspectRatio"),d.uniform1f(id,d.drawingBufferWidth/d.drawingBufferHeight/(h/l)),d.drawArrays(d.TRIANGLE_FAN,0,this.xf.ee);else{this.Z.save();this.Z.translate(e+y*gl.A,f+z*gl.A);id=this.Z.createRadialGradient(0,0,1,0,0,1.1*ua);id.addColorStop(0,this.m.ea(hl,tf));id.addColorStop(.65, this.m.ea(hl,.9*tf));id.addColorStop(.8,this.m.ea(hl,.7*tf));id.addColorStop(1,this.m.ea(hl,.2*tf));this.Z.beginPath();hl=2*Math.PI/6;gl=Math.PI/180*35;var il=!0;for(tf=gl;tf<=gl+2*Math.PI;tf+=hl)il?(this.Z.moveTo(ua*Math.sin(tf),ua*Math.cos(tf)),il=!1):this.Z.lineTo(ua*Math.sin(tf),ua*Math.cos(tf));this.Z.closePath();this.Z.fillStyle=id;this.Z.fill();this.Z.restore()}}if(0tf&&(tf=0);hl=gl.color; if(8==db||9==db||10==db)hl=r.color;this.m.ga?(d.useProgram(this.Ba),d.bindBuffer(d.ARRAY_BUFFER,this.Ed),d.vertexAttribPointer(this.Ba.ia,this.Ed.itemSize,d.FLOAT,!1,0,0),id=d.getUniformLocation(this.Ba,"uCanvasDimensions2"),d.uniform2f(id,d.drawingBufferWidth,d.drawingBufferHeight),id=d.getUniformLocation(this.Ba,"uCirclePosition"),d.uniform2f(id,d.drawingBufferWidth/h*(e+y*gl.A),d.drawingBufferWidth/h*(l-(f+z*gl.A))),id=d.getUniformLocation(this.Ba,"uCircleTexturePosition"),d.uniform2f(id,d.drawingBufferWidth/ h*(e+y*gl.A),l-(f+z*gl.A)),id=d.getUniformLocation(this.Ba,"uCircleRadius"),d.uniform1f(id,ua),d.uniform3f(d.getUniformLocation(this.Ba,"uCircleColor"),(hl>>16&255)/255,(hl>>8&255)/255,(hl&255)/255),d.uniform1f(d.getUniformLocation(this.Ba,"uCircleAlpha"),tf),d.uniform1f(d.getUniformLocation(this.Ba,"uCircleSoftness"),gl.G),id=d.getUniformLocation(this.Ba,"uAspectRatio"),d.uniform1f(id,d.drawingBufferWidth/d.drawingBufferHeight/(h/l)),d.drawArrays(d.TRIANGLE_FAN,0,this.Ed.ee)):(this.Z.save(),this.Z.translate(e+ y*gl.A,f+z*gl.A),id=this.Z.createRadialGradient(0,0,1,0,0,ua),id.addColorStop(0,this.m.ea(hl,tf)),id.addColorStop(1-gl.G,this.m.ea(hl,.8*tf)),id.addColorStop(1,this.m.ea(hl,0)),this.Z.beginPath(),this.Z.arc(0,0,ua,0,2*Math.PI,!1),this.Z.closePath(),this.Z.fillStyle=id,this.Z.fill(),this.Z.restore())}if(0tf&&(tf=0),this.m.ga?(d.useProgram(this.Cb),d.activeTexture(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D, this.un),d.bindBuffer(d.ARRAY_BUFFER,this.Ed),d.vertexAttribPointer(this.Cb.ia,this.Ed.itemSize,d.FLOAT,!1,0,0),id=d.getUniformLocation(this.Cb,"uCanvasDimensions2"),d.uniform2f(id,h,l),id=d.getUniformLocation(this.Cb,"uCirclePosition"),d.uniform2f(id,e+y*r.A,l-(f+z*r.A)),id=d.getUniformLocation(this.Cb,"uRingTexturePosition"),d.uniform2f(id,d.drawingBufferWidth/h*(e+y*r.A),l-(f+z*r.A)),id=d.getUniformLocation(this.Cb,"uCircleRadius"),d.uniform1f(id,ua),d.uniform2f(d.getUniformLocation(this.Cb,"uRingPosition"), e+y*r.A,l-(f+z*r.A)),d.uniform1f(d.getUniformLocation(this.Cb,"uRingRadius"),ua),d.uniform1f(d.getUniformLocation(this.Cb,"uRingAlpha"),tf),id=d.getUniformLocation(this.Cb,"uAspectRatio"),d.uniform1f(id,d.drawingBufferWidth/d.drawingBufferHeight/(h/l)),d.uniform1i(d.getUniformLocation(this.Cb,"uSampler"),0),d.drawArrays(d.TRIANGLE_FAN,0,this.Ed.ee)):(this.Z.save(),this.Z.translate(e+y*r.A,f+z*r.A),id=this.Z.createRadialGradient(0,0,0,0,0,ua),id.addColorStop(0,this.m.ea(16777215,0)),id.addColorStop(.88, this.m.ea(0,0)),id.addColorStop(.9,this.m.ea(16654848,tf)),id.addColorStop(.92,this.m.ea(16776448,tf)),id.addColorStop(.94,this.m.ea(4849466,tf)),id.addColorStop(.96,this.m.ea(131071,tf)),id.addColorStop(.98,this.m.ea(8190,tf)),id.addColorStop(1,this.m.ea(0,0)),this.Z.beginPath(),this.Z.arc(0,0,ua,0,2*Math.PI,!1),this.Z.closePath(),this.Z.fillStyle=id,this.Z.fill(),this.Z.restore())}this.m.ga&&(d.useProgram(this.m.za.O),d.disable(d.BLEND),d.enable(d.DEPTH_TEST))}}}};return m}();x.uo=p})(ggP2VR||(ggP2VR= {}));var THREE; (function(x){var p=function(){function m(d){this.ud=[];this.oa={x:0,y:0};this.Mc={x:0,y:0};this.mh=0;this.ke=null;this.Xj=!1;this.fl=this.Pe=0;this.jk=this.cl=!1;this.m=null;this.Kk=!0;this.yf=1;this.si=[];this.frustumCulled=!1;this.Rg=0;this.zj=this.mo=!1;this.Jf=[-1,-1,-1,-1];this.Bi=[];this.Le=[];this.zm=180;this.m=d;var c=this;setTimeout(function(){if(window.WebXRPolyfill&&window.Promise){var a={cardboardConfig:{BUFFER_SCALE:1}};try{new window.WebXRPolyfill(a),d.N("WebXR Polyfill loaded!")}catch(b){}}c.qq()},0); THREE?this.ul():console.log("Three.js not available!")}m.prototype.gp=function(){this.init();this.animate()};m.prototype.ul=function(){this.Xk=new THREE.Matrix4;this.bn=new THREE.Euler};m.prototype.init=function(){"xr"in navigator||console.log("no WebXR support");if(THREE)if(this.Bb)console.log("already set up!");else{this.Xk||this.ul();var d=this,c=this.md=this.m.md,a=this.rr=new THREE.Scene,b=this.camera=new THREE.PerspectiveCamera(100,window.innerWidth/window.innerHeight,.001,2E4);108>THREE.REVISION&& (this.frustumCulled=!0);b.position.z=-.01;b.position.y=0;b.position.x=0;this.Bb=b=new THREE.WebGLRenderer({depth:!0,logarithmicDepthBuffer:!0,alpha:!0,antialias:!0,stencil:!0});b.setClearColor(new THREE.Color(0),1);b.setPixelRatio(window.devicePixelRatio);b.setSize(window.innerWidth,window.innerHeight);b.outputEncoding=THREE.GammaEncoding;b.shadowMap.enabled=!1;c.appendChild(b.domElement);"xr"in navigator&&(b.xr.enabled=!0,b.xr.setReferenceSpaceType("local"));var e=this.Bl=new THREE.Group;c=this.Hj= b.xr.getController(0);c.addEventListener("selectstart",function(g){d.cn(g)});c.addEventListener("selectend",function(){});c.visible=!0;e.add(c);b=this.Ij=b.xr.getController(1);b.addEventListener("selectstart",function(g){d.cn(g)});b.addEventListener("selectend",function(){});b.visible=!0;e.add(b);e.visible=!0;a.add(e);e=(new THREE.BufferGeometry).setFromPoints([new THREE.Vector3(0,0,0),new THREE.Vector3(0,0,-1)]);var f=new THREE.LineBasicMaterial({color:14737632});e=new THREE.Line(e,f);e.name="line"; e.scale.z=5;c.add(e.clone());b.add(e.clone());this.wh=new THREE.Raycaster;this.oa=new THREE.Vector2;this.Nf=new THREE.Group;this.Ff=new THREE.Group;this.td=new THREE.Group;this.Sj=new THREE.Group;this.Aj=new THREE.Group;this.Nf.add(this.td);this.Nf.add(this.Sj);this.Nf.add(this.Ff);a.add(this.Nf);a.add(this.Aj);a=document.createElement("canvas");a.width=64;a.height=64;c=a.getContext("2d");c.fillStyle="black";c.lineWidth=3;c.beginPath();c.arc(32,32,10,0,2*Math.PI);c.stroke();a=new THREE.Texture(a); a.needsUpdate=!0;a.encoding=THREE.sRGBEncoding;e=new THREE.PlaneBufferGeometry(2,2,8);a=new THREE.MeshBasicMaterial({map:a});a.transparent=!0;a=new THREE.Mesh(e,a);a.position.z=-50;this.Aj.add(a);window.addEventListener("resize",function(){d.Uq()},!1);document.addEventListener("mouseup",function(){d.Qq()},!1);document.addEventListener("mousedown",function(g){d.Oq(g)},!1);document.addEventListener("mousemove",function(g){d.Pq(g)},!1)}else console.log("Three.js not available!")};m.prototype.Jn=function(){var d= this.m;d.N("VR not found");d.P("vrchanged",{});d.P("playerstatechanged",{})};m.prototype.Vr=function(){this.jk=!0;var d=this.m;d.N("XR found");d.P("vrchanged",{});d.P("playerstatechanged",{})};m.prototype.qq=function(){if(!this.mo){this.mo=!0;var d=this;if("xr"in navigator)navigator.xr.isSessionSupported("immersive-vr").then(function(c){c?d.Vr():d.Jn()})["catch"](d.Jn)}};m.prototype.Wg=function(){return null!=this.ke?this.Bb.xr.isPresenting:!1};m.prototype.ik=function(){return this.jk&&THREE};m.prototype.Sq= function(d){var c=this;this.Vh();d.addEventListener("end",function(){c.Rq()});console.log("XR Session started.");this.Bb.xr.setSession(d);this.Xj=!0;this.ke=d};m.prototype.Rq=function(){console.log("XR Session ended.");this.Xj=!1;this.ke=null;this.Gj()};m.prototype.zg=function(){var d=this.m;if(this.jk){if(null===this.ke){var c=this;navigator.xr.requestSession("immersive-vr",{optionalFeatures:["local-floor","bounded-floor"]}).then(function(b){c.Sq(b)})["catch"](function(b){console.log(b);console.warn("'immersive-vr' isn't supported, or an error occurred activating VR!"); c.Gj()})}this.td&&this.td.translateY(-this.Rg);this.Rg=0;if(1==this.yf){var a=navigator.userAgent;0<=a.indexOf("OculusBrowser")&&(0<=a.indexOf("Pacific")&&(this.yf=1.7),0<=a.indexOf("Quest")&&(this.yf=1.5))}this.Bb.xr.setFramebufferScaleFactor(this.yf);d.zc("Enter VR - scaled "+this.yf)}else this.Vh()};m.prototype.Vq=function(){if(THREE&&this.Bb){var d=this.m;d.ef=!0;d.$.style.display="none";d.$a.style.display="none";this.Bb.domElement.style.display="inline";d.P("vrchanged",{});d.P("playerstatechanged", {})}};m.prototype.Gj=function(){if(THREE&&this.Bb){var d=this.m;d.ef=!1;d.$.style.display="inline";d.$a.style.display="inline";this.Bb.domElement.style.display="none";d.Yi(0);d.Qc();d.update();d.P("vrchanged",{});d.P("playerstatechanged",{})}};m.prototype.tf=function(){null!=this.ke&&this.ke.end()};m.prototype.Xn=function(){this.Wg()?this.tf():this.zg()};m.prototype.Sl=function(){var d=0,c=this.m;var a=1536;this.Bb&&c.N("Canvas: "+a);a*=Math.pow(2,0);if(0= d+2&&!c.u.levels[d+1].Re&&c.u.levels[d+1].width>a;)d++;c.N("Level "+d+" - width: "+c.u.levels[d].width);c.N(c.u.levels)}return d};m.prototype.om=function(d){var c=this.m,a=c.qe[d];d="";if(a){a=a.firstChild;for(var b;a;)"input"==a.nodeName&&(b=a)&&(b=0a;a++)d=c.Mb(d,"c","vr"),d=c.Mb(d,"s","vr"),d=c.Mb(d,"r",0),d=c.Mb(d,"l",0),d=c.Mb(d, "x",0),d=c.Mb(d,"y",0),d=c.Mb(d,"v",0),d=c.Mb(d,"h",0);return c.Pb(d)};m.prototype.ceilPowerOfTwo=function(d){return Math.pow(2,Math.ceil(Math.log(d)/Math.LN2))};m.prototype.loadTexture=function(d,c,a){var b=new THREE.ImageLoader;b.setCrossOrigin(this.m.crossOrigin);var e=this;b.load(c,function(f){var g=e.ceilPowerOfTwo(f.width),h=e.ceilPowerOfTwo(f.height);d.format=THREE.RGBFormat;d.encoding=THREE.sRGBEncoding;d.needsUpdate=!0;if(g==f.width&&h==f.height||!a)d.image=f;else{e.m.N("resizing "+f.width+ "/"+f.height+" -> "+g+"/"+h);var l=document.createElement("canvas");l.width=g;l.height=h;l.getContext("2d").drawImage(f,0,0,g,h);d.image=l}d.xm=!0;d.be&&d.be.xm&&(d.Mg.visible=!0,d.be.Mg.visible=!0)});this.si.push(d)};m.prototype.Vh=function(){if(THREE){var d=this.m;if(this.zj)d.N("vr panorama aleady added!");else{this.Sl();var c=this.Ff,a=this;d.N("add vr panorama");this.Te();this.camera.layers.enable(1);c.setRotationFromEuler(this.bn);c.rotateX(d.Na.pitch*Math.PI/180);c.rotateZ(-d.Na.U*Math.PI/ 180);var b=new THREE.SphereBufferGeometry(2E4/3*1.5,16,16),e=(new THREE.TextureLoader).load(this.om(d.Zj()));e.encoding=THREE.sRGBEncoding;e=new THREE.MeshBasicMaterial({map:e,side:THREE.DoubleSide});b=new THREE.Mesh(b,e);b.scale.x=-1;b.rotateZ(d.Na.U*Math.PI/180);b.rotateX(-d.Na.pitch*Math.PI/180);b.rotateY(-90*Math.PI/180);c.add(b);a.Pi=b;a.zj=!0;setTimeout(function(){d.N("Adding Main Pano");a.zj=!1;a.Ho();d.D.f?a.Ko():a.Io();a.Fo()});this.mr();this.Kk=!0}}};m.prototype.Ko=function(){var d=this.m, c=this.Ff,a=2E4/3;if(d.Jd){var b=new THREE.VideoTexture(d.D.f);b.wrapS=THREE.ClampToEdgeWrapping;b.wrapT=THREE.ClampToEdgeWrapping;b.minFilter=THREE.LinearFilter;b.encoding=THREE.sRGBEncoding;var e=new THREE.SphereBufferGeometry(a,60,40);e.scale(-1,1,1);for(var f=e.attributes.uv.array,g=1;ga)for(var g=d.u.levels[a],h=0;6>h;h++){c[h]=new THREE.Group;for(var l=0;lh?c[h].rotation.y=-h*Math.PI/2:c[h].rotation.x=(4==h?1:-1)*Math.PI/2;b.add(c[h])}else for(a=d.bf,h=0;6>h;h++)for(c[h]=new THREE.Group,w=0;wh?c[h].rotation.y=-h*Math.PI/2:c[h].rotation.x=(4==h?1:-1)*Math.PI/2,b.add(c[h])};m.prototype.Ho=function(){var d=this.m,c=this.td;new x.Ga(0,0,-100);for(var a=d.H.gj,b=0;b=e.distance?5:1>e.distance?1:5>e.distance? e.distance:5;if(e.Xc){var l=.005,k=(new THREE.TextureLoader).load(e.Xc);k.encoding=THREE.sRGBEncoding;var w=new THREE.MeshBasicMaterial({map:k});if(e.eg){h=100;g=2*h*Math.tan(e.fov/2*Math.PI/180);var r=new THREE.PlaneBufferGeometry(g,g*e.Cd/e.Ae,1,1);w.transparent=!0;w.opacity=1}else r=new THREE.PlaneBufferGeometry(l*e.Ae,l*e.Cd,1,1),w.transparent=!0,w.opacity=.25;g=l*e.Cd/2;w.side=THREE.DoubleSide}else r=new THREE.SphereBufferGeometry(.2,16,16),k=(new THREE.TextureLoader).load(this.om(f)),k.encoding= THREE.sRGBEncoding,w=new THREE.MeshBasicMaterial({map:k}),w.transparent=!0,w.opacity=.25;f=new THREE.Mesh(r,w);l=e.title;if(a.enabled&&""!=l){r=document.createElement("canvas");r.width=256;r.height=32;k=r.getContext("2d");this.Gh||(this.Gh=document.createElement("canvas"),this.Gh.width=r.width,this.Gh.height=r.height);var y=this.Gh.getContext("2d");y.clearRect(0,0,r.width,r.height);y.font="16px Helvetica";y.textAlign="center";y.textBaseline="top";w=y.measureText(l);var z=w.width;0d.clientX&&50> d.clientY&&this.m.tf();0this.wq+1E3){var b=this.qk.userData;b&&b.url&&this.m.ed(b.url,b.target)}}else this.qk=null;var e=[],f=!0;this.ke?this.ke.inputSources.forEach(function(y){var z=y.profiles;e.push(y.gamepad);0<=z.indexOf("oculus-go")&&(f=!1);0<=z.indexOf("generic-trigger-squeeze-thumbstick")&&(f=!0);0<=z.indexOf("oculus-touch")&&(f=!0)}):e=navigator.getGamepads&& navigator.getGamepads();b=!1;if(!c.Bl.visible&&0l&&(this.yh(20),this.Jf[h]=g);.3g?(b=!0, -1!=this.Le[h]&&(this.Le[h]=-1,this.Bi[h]=Date.now()-1E4)):this.Le[h]=0,0!=this.Le[h]&&400>";this.cube=new x.yo;this.al=!1;this.tg=function(f,g){if(0==f.length)return f;var h;var l=[];var k=g.Qi(f[0])-0;for(h=0;hz&&(z=0);1k||l.push(f[w]);l.push(ha)}k=y}return l};this.jn=new p;this.Rk=0;this.oc=!1;this.Ci=-1;this.Ig=function(f){return f?this.Vg()&&(f.clientX||f.clientY)?{x:f.clientX,y:f.clientY}:f.pageX||f.pageY?{x:f.pageX,y:f.pageY}:f.clientX||f.clientY?{x:f.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,y:f.clientY+document.body.scrollTop+document.documentElement.scrollTop}: f.touches&&f.touches[0]?{x:f.touches[0].pageX,y:f.touches[0].pageY}:{x:0,y:0}:{x:0,y:0}};this.Ji=1;this.op=this.ki=this.Nm=this.Rj=this.Gk=this.Ri=0;this.Om=!1;this.$d=!0;this.mb=new x.Uh(this);this.mb.Bf=!1;this.Ml();if(7=b&&(this.pa.blendtime=b));a.hasOwnProperty("waitfortransition")&&(this.pa.zoomoutpause=1==a.waitfortransition);a.hasOwnProperty("zoomedfov")&&(b=Number(a.zoomedfov),.01<=b&&50>=b&&(this.pa.zoomfov=b));a.hasOwnProperty("zoomspeed")&&(b=Number(a.zoomspeed),.01<=b&&99>=b&&(this.pa.zoomspeed=b));a.hasOwnProperty("dipcolor")&&(this.pa.blendcolor=a.dipcolor);a.hasOwnProperty("softedge")&&(a=Number(a.softedge),0<=a&&1E3>=a&&(this.pa.softedge=a));this.qg||this.Jj()}; c.prototype.Oc=function(a,b,e){var f=b?Number(b):0;if(0!=a&&4!=a&&12!=a&&9!=a)this.zc("Unsupported projection type: "+a);else if(b&&0!==f&&4!==f&&12!==f&&9!==f)this.zc("Unsupported projection2 type: "+f);else if(a==f&&(f=0),this.ph=e?Number(e):1,this.Va!=a||this.Cc!=f)this.Va=a,this.Cc=f,this.za.ui()};c.prototype.Ra=function(){return 0==this.Va?4:this.Va};c.prototype.Dj=function(a,b){if(0!=a&&4!=a&&12!=a&&9!=a)this.zc("Unsupported projection type: "+a);else if(this.ga||0==a||4==a||this.zc("Projection changes require WebGL!"), this.Ra()!=a){var e={};e.pan=this.pan.j;e.tilt=this.v.j;e.fov=this.fov.j;e.projection=a;e.timingFunction=3;e.speed=b;a=this.Hg(a);e.fov=Math.min(a,e.fov);this.Ii(e)}};c.prototype.addListener=function(a,b){(this.Ag[a]=this.Ag[a]||[]).push(b)};c.prototype.P=function(a,b){if(a=this.Ag[a])for(var e=a.length,f=0;f>4;g=(g&15)<<4|h>>2;var k=(h&3)<<6|l;b+=String.fromCharCode(f);64!=h&&(b+=String.fromCharCode(g));64!=l&&(b+=String.fromCharCode(k))}while(e>3&7];if(!(h&64&&l)||g+l>e)return null;for(h&=63>>l;0Number(this.fd))&&(this.va=null);this.yc&&!this.Id&&12<=Number(this.fd)&&13>Number(this.fd)&&(this.va=null);this.yc&&this.Id&&13==Number(this.Sg[0])&&(1==Number(this.Sg[1])||2<=Number(this.Sg[1]))&&(this.va=null);this.Mh=this.Hm?this.yc&&this.Mk&&10<=Number(this.fd)?!0:!1:!0};c.prototype.N=function(a){if(Il){var b=document.getElementById("gg_debug");b&&(b.innerHTML=a.toString()+"
");window.console&& window.console.log(a)}};c.prototype.Gs=function(a){if(Il){var b=document.getElementById("gg_debug");b&&(b.innerHTML=a.toString()+"
");window.console&&window.console.warn(a)}};c.prototype.zc=function(a){var b=document.getElementById("gg_debug");b&&(b.innerHTML=a+"
");window.console&&window.console.log(a)};c.prototype.En=function(a){this.Ne=a};c.prototype.setCrossOrigin=function(a){this.crossOrigin=a};c.prototype.wr=function(a){this.Ef=a};c.prototype.Vp=function(){return this.rh};c.prototype.tr= function(a){this.Wd=a};c.prototype.dm=function(){return this.Wd};c.prototype.Dp=function(){return this.Xg};c.prototype.yp=function(){return this.ri};c.prototype.Ep=function(){return this.Gf};c.prototype.Ap=function(){return this.B.active};c.prototype.yr=function(a){this.Xg=!!a};c.prototype.li=function(){return this.isLoaded};c.prototype.Cp=function(){return!this.isLoaded};c.prototype.qd=function(){return Number(this.C.height)/(2*Math.tan(Math.PI/180*(this.Tb()/2)))};c.prototype.Hn=function(a,b){this.isFullscreen&& (a=window.innerWidth,b=window.innerHeight);var e=a-this.margin.left-this.margin.right,f=b-this.margin.top-this.margin.bottom;if(!(10>e||10>f)){var g=window.devicePixelRatio||1;this.Uf&&(g=1);this.K.style.width=e+"px";this.K.style.height=f+"px";this.K.style.left=this.margin.left+"px";this.K.style.top=this.margin.top+"px";if(this.ga)try{this.$a&&(this.$a.style.position="absolute",this.$a.style.display="inline",this.$a.style.width=e+"px",this.$a.style.height=f+"px",this.$a.width=e*g,this.$a.height=f* g),this.R&&(this.xb.width=e*g,this.xb.height=f*g,this.R.viewport(0,0,this.R.drawingBufferWidth,this.R.drawingBufferHeight))}catch(h){alert(h)}this.vc&&(this.vc.style.width=a+"px",this.vc.style.height=b+"px",this.vc.width=a,this.vc.height=b);this.Qa&&(this.Qa.style.width=a+"px",this.Qa.style.height=b+"px",this.Ia.style.width=a+"px",this.Ia.style.height=b+"px",this.Ia.width=a,this.Ia.height=b,this.Ia.style.left=this.margin.left+"px",this.Ia.style.top=this.margin.top+"px",this.sa&&this.sa!=this.Qa&& (this.sa.style.width=a+"px",this.sa.style.height=b+"px"));this.Sa&&(e=this.Sa.ld,e.style.width=a+"px",e.style.height=b+"px",e.width=a,e.height=b,e.style.left=this.margin.left+"px",e.style.top=this.margin.top+"px");this.Cf&&(this.Ma=!0);e=this.K.offsetWidth;f=this.K.offsetHeight;if(this.C.width!=e||this.C.height!=f)this.C.width=e,this.C.height=f;this.Bs();this.sa&&this.sa.ggUpdateSize&&this.sa.ggUpdateSize(a,b);this.P("sizechanged",{w:a,h:b});this.P("playerstatechanged",{})}};c.prototype.df=function(){this.al= !0};c.prototype.Qc=function(){this.Hn(this.md.offsetWidth,this.md.offsetHeight)};c.prototype.jq=function(){var a={width:0,height:0};a.width=this.C.width;a.height=this.C.height;return a};c.prototype.He=function(){var a={x:0,y:0},b=this.K;if(b.offsetParent){do a.x+=b.offsetLeft,a.y+=b.offsetTop,b=b.offsetParent;while(b)}return a};c.prototype.Kr=function(a){this.ka=a};c.prototype.zr=function(a,b,e,f){this.margin.left=a;this.margin.top=b;this.margin.right=e;this.margin.bottom=f;this.ka=this.skinObj;this.df()}; c.prototype.Xo=function(a){0==a&&(this.L.Hd=!1);1==a&&(this.L.Hd=!0);2==a&&(this.L.Hd=!this.L.Hd);this.P("viewmodechanged",{});this.P("playerstatechanged",{})};c.prototype.hq=function(){return 1==this.L.Hd?1:0};c.prototype.zl=function(a,b){this.H.mode=1==b&&0a.z?(y=-b/a.z,r=a.x*y,y*=a.y,Math.abs(r)a.z?(y=-b/a.z,r=this.C.width/2+a.x*y,y=this.C.height/2+a.y*y):y=r=0,a.Xb=r,a.Ab=y;k.he=z}}}};c.prototype.tp=function(){for(var a=[],b=0;bb&&(b=0);1>16&255)+","+(a>>8&255)+","+(a&255)+","+b+")"};c.prototype.Yq=function(){var a;if(this.Ia&&(this.H.$g!=this.H.mode&&(this.H.$g=this.H.mode,this.Ia.style.visibility=0=this.H.mode&&(b=0);3==this.H.mode&&(b=this.H.wa);for(a=0;ae!=f.Ab>e&&b<(f.Xb-l.Xb)*(e-l.Ab)/(f.Ab-l.Ab)+l.Xb&&(g=!g)}return g};c.prototype.ai=function(a,b){var e=-1;if((0<=this.H.mode||0e.width?this.fov.j/2:4==b?180*Math.atan(4*e.height/(3*e.width)*Math.tan(this.fov.j/2*Math.PI/180))/Math.PI:4*e.height/(3*e.width)*(this.fov.j/2)}return 2*a};c.prototype.xp=function(a,b){a||(a=this.Tb());b||(b=this.Ra());return 4==b?180*Math.atan(this.aspect()*Math.tan(a/2*Math.PI/180))/Math.PI:a*this.aspect()};c.prototype.aspect=function(){return this.C.width/this.C.height};c.prototype.wl=function(a){var b=this.fov.j;a/=2;var e=this.Ra();switch(this.fov.mode){case 0:b=2*a;break; case 1:a=4==e?180*Math.atan(this.C.width/this.C.height*Math.tan(a*Math.PI/180))/Math.PI:this.C.width/this.C.height*a;b=2*a;break;case 2:b=Math.sqrt(this.C.width*this.C.width+this.C.height*this.C.height);a=4==e?180*Math.atan(b/this.C.height*Math.tan(a*Math.PI/180))/Math.PI:b/this.C.height*a;b=2*a;break;case 3:4*this.C.height/3>this.C.width?b=2*a:(b=3*this.C.width/(4*this.C.height),a=4==e?180*Math.atan(b*Math.tan(a*Math.PI/180))/Math.PI:b*a,b=2*a)}return b};c.prototype.$i=function(a){this.fov.j=this.wl(a)}; c.prototype.sg=function(){if(!this.ef){var a=this.jn;a.pan=this.pan.j;a.v=this.v.j;a.fov=this.fov.j;this.pf(a);this.pf(a);this.pf(a);this.pan.j=a.pan;this.v.j=a.v;this.fov.j=a.fov}};c.prototype.pf=function(a){var b=this.C.width/this.C.height;if(2==this.Wa){if(0b&&(a.fov=b);50a.v-f&&(a.v=-50+f));e>g?a.pan=0:(a.pan+e>g&&(a.pan=g-e,this.B.active&&(this.B.speed=-this.B.speed,this.pan.d=0)),a.pan-e<-g&&(a.pan=-g+e,this.B.active&&(this.B.speed=-this.B.speed,this.pan.d=0)))}else{0g&&(a.fov=g);12==this.Ra()&&(2*e>h&&(a.fov=h/b),f=this.Tb()/2,2*f>h&&(a.fov=h),f=this.Tb()/2,e=b*f);2*f>this.v.max-this.v.min&&180>this.v.max-this.v.min&&(f=(this.v.max-this.v.min)/2,a.fov=this.wl(2*f));90>this.v.max?a.v+f>this.v.max&&(a.v=this.v.max-f):a.v>this.v.max&&(a.v=this.v.max); -90b){g=90;h=Math.tan(f*Math.PI/180);var l=Math.tan((Math.abs(a.v)+f)*Math.PI/180);l=Math.sqrt(l*l+1)/Math.sqrt(h*h+1);f=180*Math.atan(l*Math.tan(e*Math.PI/180))/Math.PI;2*f>b&&(l=Math.tan(b*Math.PI/360)/Math.tan(e*Math.PI/180),b=l*Math.sqrt(h*h+1),l=Math.sqrt(b*b-1),g=180/Math.PI*Math.atan(l));a.pan+f>this.pan.max&&(a.pan=this.pan.max-f,this.B.active&&(this.B.speed=-this.B.speed, this.pan.d=0));a.pan-fg&&(a.v=g-e);a.v-e<-g&&(a.v=-g+e)}}};c.prototype.update=function(a){void 0===a&&(a=0);this.Ma=!0;a&&(this.xg=Math.max(1*a,this.xg))};c.prototype.hm=function(){return this.qa?!!this.qa.isTileLoading:0a;a++){var e;if(e=this.cube.faces[a]){var f="";this.Nc?(f+="translate3d("+this.C.width/2+"px,"+this.C.height/2+"px,0px) ",f+="perspective("+b+"px) ",f+="translate3d(0px,0px,"+b+"px) "):f+="translate3d("+this.C.width/2+"px,"+this.C.height/2+"px,"+b+"px) ";f+="rotateZ("+Number(this.U.j).toFixed(10)+"deg) ";f+="rotateX("+Number(this.v.j).toFixed(10)+"deg) ";f+="rotateY("+Number(-this.pan.j).toFixed(10)+ "deg) ";e.vm&&(f+=e.vm,e.ob||(f="translate3d(-10px,-10px,0px) scale(0.001,0.001)"),e.V.style[this.Ua]=f)}}};c.prototype.ss=function(){this.sg();var a;this.vc&&(a=this.vc.getContext("2d"));if(this.C.width!==this.K.offsetWidth||this.C.height!==this.K.offsetHeight)this.C.width=this.K.offsetWidth,this.C.height=this.K.offsetHeight;if(a){var b=a.canvas.width/2,e=a.canvas.height/2,f=a.createRadialGradient(b,e,5,b,e,Math.max(b,e));f.addColorStop(0,"#333");f.addColorStop(1,"#fff");a.rect(0,0,a.canvas.width, a.canvas.height);a.fillStyle=f;a.fill();a.fillStyle="#f00";a.font="20px Helvetica";a.textAlign="center";a.fillText("Pan: "+this.pan.j.toFixed(1),b,e-60);a.fillText("Tilt: "+this.v.j.toFixed(1),b,e-30);a.fillText("Fov: "+this.fov.j.toFixed(1),b,e+0);a.fillText("Node: "+this.Zj(),b,e+30);a.fillText("Title: "+this.hg.title,b,e+60)}};c.prototype.ts=function(){this.sg();if(this.C.width!==this.K.offsetWidth||this.C.height!==this.K.offsetHeight)this.C.width=this.K.offsetWidth,this.C.height=this.K.offsetHeight; this.qa&&this.qa.setPan&&(this.qa.setPan(this.pan.j),this.qa.setTilt(this.v.j),this.qa.setFov(this.fov.j))};c.prototype.Zk=function(){this.Ia.style.visibility="inherit";this.la||(this.la=this.Ia.getContext("2d"));if(this.la.width!=this.C.width||this.la.height!=this.C.height)this.la.width=this.C.width,this.la.height=this.C.height;this.la.clear?this.la.clear():this.la.clearRect(0,0,this.Ia.width,this.Ia.height);this.Ec=0;var a=100/this.fov.j;var b=this.u.width/this.u.height;var e=this.C.height*a*b; a*=this.C.height;var f=(this.pan.j/100/b-.5)*e+this.C.width/2;for(var g=(this.v.j/100-.5)*a+this.C.height/2,h,l,k,w,r=0;this.u.levels.length>=r+2&&this.u.levels[r+1].width>e;)r++;var y;var z=[];for(y=this.u.levels.length-1;y>=r;){b=this.u.levels[y];if(b.cache){var ha={jb:0,Gb:0};ha.Ib=b.T-1;ha.Jb=b.da-1}else{ha={};var ua=-g/a*(b.height/this.u.M);h=(-f+this.C.width)/e*(b.width/this.u.M);l=(-g+this.C.height)/a*(b.height/this.u.M);ha.jb=Math.min(Math.max(0,Math.floor(-f/e*(b.width/this.u.M))),b.T-1); ha.Gb=Math.min(Math.max(0,Math.floor(ua)),b.da-1);ha.Ib=Math.min(Math.max(0,Math.floor(h)),b.T-1);ha.Jb=Math.min(Math.max(0,Math.floor(l)),b.da-1)}z[y]=ha;var id=!0;for(l=ha.Gb;l<=ha.Jb;l++)for(h=ha.jb;h<=ha.Ib;h++)w=h+l*b.T,ua=b.aa[w],ua||(ua=new x.Td,b.aa[w]=ua),this.$b=r;){b=this.u.levels[y];if(z[y]&&0<=z[y].jb)for(ha=z[y],l=ha.Gb;l<=ha.Jb;l++)for(h=ha.jb;h<=ha.Ib;h++)w=h+l*b.T,(ua=b.aa[w])||(ua=b.aa[w]=new x.Td),ua.u&&ua.u.complete&&(w=f+(-this.u.Da+this.u.M*h)*e/b.width,this.la.drawImage(ua.u,w,g+(-this.u.Da+this.u.M*l)*a/b.height,ua.u.width*e/b.width,ua.u.height*a/b.height)),ua.visible=!0;y--}for(e=0;e=this.H.mode&&(e=0),3==this.H.mode&&(e=this.H.wa),k=0;kthis.cube.faces.length))for(var a=0;6>a;a++){var b=this.cube.faces[a];var e=[];e.push(new x.Ga(-1,-1,-1,0,0));e.push(new x.Ga(1,-1,-1,1,0));e.push(new x.Ga(1,1,-1,1,1));e.push(new x.Ga(-1,1,-1,0,1));for(var f=0;4>f;f++)4>a?e[f].Ka(-Math.PI/2*a):e[f].Fa(Math.PI/2*(4==a?-1:1)),this.Na&&(e[f].lb(this.Na.U*Math.PI/180),e[f].Fa(-this.Na.pitch*Math.PI/180)),e[f].Ue(-this.pan.j),e[f].Od(this.v.j),e[f].Ve(this.U.j); e=this.Fj(e);b.ob=0=a+2&&!this.u.levels[a+1].Re&&this.u.levels[a+1].width>e;)a++;return a};c.prototype.xs=function(){var a=!1,b,e,f;if(this.C.width!==this.K.offsetWidth||this.C.height!==this.K.offsetHeight)this.C.width=this.K.offsetWidth,this.C.height=this.K.offsetHeight,this.K.style[this.Ua+"OriginX"]=this.C.width/2+"px",this.K.style[this.Ua+ "OriginY"]=this.C.height/2+"px",a=!0;var g=Math.round(this.qd());if(this.ah!=g||a)this.ah=g,this.Nc||(this.K.style[this.Dd]=g+"px",this.K.style[this.Dd+"Origin"]="50% 50%");this.Ec=0;if(0b;b++){var l=this.cube.faces[b];l.ob&&(h=h+b+",")}h=this.Uj();var k;for(k=this.u.levels.length-1;k>=h;){a=this.u.levels[k];var w=1;k==this.u.levels.length-1&&0==this.u.Da&&(w=this.u.M/(this.u.M-2));for(b=0;6>b;b++){l=this.cube.faces[b];var r=l.Of;if(l.ob&& 0=k);)z=z.nextSibling;this.K.insertBefore(r.V,z);r.bb=r.V.getContext("2d")}else if(this.Vn=k);)z=z.nextSibling;this.K.insertBefore(r.V,z)}r.V&&(this.kk++,r.u=new Image,r.u.crossOrigin=this.crossOrigin,r.u.style[this.Ua+"Origin"]="0% 0%",r.u.style.position="absolute",r.u.style.overflow="hidden",r.V.ae=k,r.u.onload=this.hs(r),r.u.onerror=this.ij(r),r.u.onabort=this.ij(r),r.u.setAttribute("src", this.oe(b,k,e,f)),a.cache&&this.gc.push(r.u),this.$b++,this.Ma=!0)}else this.Ec++;if(r.V){z="";this.Nc?(z+="translate3d("+this.C.width/2+"px,"+this.C.height/2+"px,0px) ",z+=" perspective("+g+"px) ",z+="translate3d(0px,0px,"+g+"px) "):z+="translate3d("+this.C.width/2+"px,"+this.C.height/2+"px,"+g+"px) ";z+="rotateZ("+Number(this.U.j).toFixed(10)+"deg) ";z+="rotateX("+Number(this.v.j).toFixed(10)+"deg) ";z+="rotateY("+Number(-this.pan.j).toFixed(10)+"deg) ";this.Na&&(z+="rotateX("+Number(-this.Na.pitch).toFixed(10)+ "deg) ",z+="rotateZ("+Number(this.Na.U).toFixed(10)+"deg) ");z=4>b?z+("rotateY("+-90*b+"deg) "):z+("rotateX("+(4==b?-90:90)+"deg) ");if(this.Tf){var ha=this.u.M/a.width*(2*k+1)*(this.pg/this.u.M);ha=this.yc?2/Math.tan(this.fov.j*Math.PI/360)*ha:2*ha;z+=" scale("+ha*w*w+")"}else ha=1/(w*w);z+=" translate3d("+(1/w*e*this.u.M-this.u.Da-a.width/2)+"px,";z+=1/w*f*this.u.M-this.u.Da-a.width/2+"px,";z+=-a.width*ha/2+"px)";l.ob&&(r.visible=!0,r.V?r.V.style[this.Ua]=z:r.u&&(r.u.style[this.Ua]=z))}}}}k--}for(g= 0;gb||100>e)e=b=100;var f=window.devicePixelRatio||1;this.Uf&&(f=1);this.K.style.width=b+"px";this.K.style.height=e+"px";this.$a.style.width=b+"px";this.$a.style.height=e+"px";this.$a.width=b*f;this.$a.height=e*f;this.$a.style.display="none";this.$a.style.touchAction= "none";this.K.insertBefore(this.$a,this.K.firstChild);var g=this.no;g.stencil=!0;g.depth=!0;g.powerPreference="high-performance";g.alpha=this.yc?!0:!1;this.Id&&10<=this.Sg[0]&&(g.antialias=!1,g.alpha=!1);a={};a.flags=g;a.canvas=this.$a;this.P("beforewebglcontext",a);this.R=this.$a.getContext("webgl",g);this.R||(this.R=this.$a.getContext("experimental-webgl",g));if(this.R){var h=this.R;this.xb.width=b*f;this.xb.height=e*f;h.clearColor(0,0,0,0);h.enable(this.R.DEPTH_TEST);h.viewport(0,0,500,500);h.clear(h.COLOR_BUFFER_BIT| h.DEPTH_BUFFER_BIT);4096<=h.getParameter(h.MAX_TEXTURE_SIZE)&&!this.Xg&&(this.Ne=1g;g++)l=this.Mb(l,"c",a),l=this.Mb(l,"s",k),l=this.Mb(l,"r",b),l=this.Mb(l,"l",h),l=this.Mb(l,"x",e),l=this.Mb(l,"y",f),l=this.Mb(l,"v",f),l=this.Mb(l,"h",e);return this.Pb(l)};c.prototype.Kg=function(){return this.pan.j};c.prototype.Up=function(){return this.F.pan};c.prototype.mm=function(){for(var a=this.pan.j;-180>a;)a+=360;for(;180a;)a+=360;for(;180a&&-1E7b&&-1E7e&&-1E7e?Number(e):this.fov.j;this.F.speed=!isNaN(f)&&0=l?(this.Xi(b,e,f),this.Oc(g)):(a=new x.hl,a.ab="__AutoMove",a.me=this.mm(),a.Bh=this.v.j,a.Pd=this.fov.j,a.Ah=this.Va,a.Qd=b,a.ne=e,a.ag=f,a.xd=g,a.sf=!1,a.Be=!1,a.Ce=!1,0==h&&(a.Be=!0),1==h&&(a.sf=!0,a.Be=!0),2==h&&(a.Ce=!0),a.speed= l,this.F.pl=this.I,this.I=this.$l(a),this.F.ql=(new Date).getTime(),this.F.bl=!0,this.F.active=!0,this.F.aborted=!1,this.F.pan=b,this.F.v=e,this.F.fov=f,this.Ud=!1)};c.prototype.Fq=function(a){this.moveTo(this.pan.cb,this.v.cb,this.fov.cb,a)};c.prototype.Gq=function(a,b){var e={};e.pan=this.pan.cb;e.tilt=this.v.cb;e.fov=this.fov.cb;e.projection=this.Oi;e.timingFunction=b;e.speed=a;this.Ii(e)};c.prototype.Go=function(a,b,e,f){var g=new x.Uh(this);g.type="point";g.pan=b;g.v=e;g.id=a;g.f={};g.f.player= this;g.uf();g.f.hotspot=g;g.f.__div=document.createElement("div");g.f.__div.appendChild(f);this.W.push(g);g.f.__div.style.position="absolute";g.f.__div.style.left="-1000px";g.f.__div.style.top="-1000px";this.Qa.insertBefore(g.f.__div,this.Qa.firstChild);this.Ma=!0};c.prototype.us=function(a,b,e){for(var f=0;fa;)a+=360;b=e.No()}e={};e.pan=a;e.tilt=b;return e};c.prototype.Kc=function(a){return a==this.control||a&&void 0!==a.ggPermeableMap&&1==a.ggPermeableMap?!0:a&&void 0!==a.ggPermeable&&0==a.ggPermeable?!1:a&&a.ggType&&("container"==a.ggType||"cloner"==a.ggType||"timer"==a.ggType)?!0:!1};c.prototype.Ej=function(a,b){var e=this.qd(),f,g;for(f=0;fw;w++){switch(w){case 0:k.init(-g,-r,0);break;case 1:k.init(g,-r,0);break;case 2:k.init(g,r,0);break;case 3:k.init(-g,r,0)}k.Fa(h.Fa*Math.PI/180);k.Ka(-h.Ka*Math.PI/180);k.lb(h.lb*Math.PI/180);--k.z;k.Fa(-h.v*Math.PI/180);k.Ka(h.pan*Math.PI/180);k.Ka(-this.pan.j*Math.PI/180);k.Fa(this.v.j* Math.PI/180);k.lb(this.U.j*Math.PI/180);l.push(k.clone())}l=this.Fj(l);if(0k.z?(r=-e/k.z,g=this.C.width/2+k.x*r,r=this.C.height/2+k.y*r):r=g=0,k.Xb=g,k.Ab=r;if(this.Bm(l,a,b))return h}}return null};c.prototype.Vg=function(){return document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement&&null!=document.msFullscreenElement||document.fullScreen};c.prototype.Eq=function(a){this.bo(a);if(this.pd)this.pd.onclick();(this.vf||this.wf&& this.Ke)&&this.ii();this.Ob=null;if(!this.L.jc&&!this.oc){a=a?a:window.event;if(a.which||0==a.which||1==a.which){var b=(new Date).getTime();if(this.ie){this.Ob=this.ie;this.Y.Mc=!0;this.Y.startTime=b;a.stopPropagation();return}if(this.Kc(a.target)){var e;(e=this.Ej(this.oa.x,this.oa.y))&&e.Ie&&(this.Ob=e);this.lo(a.pageX,a.pageY);this.Y.Mc=!0;this.Y.startTime=b;a.preventDefault();this.Ea()}}this.fa.ma.x=0;this.fa.ma.y=0}};c.prototype.dg=function(a,b){var e=this.H.gj;e.enabled&&(this.Ca!=this.mb&& 0<=a&&0<=b&&""!=this.Ca.title?(this.Ha.innerHTML=this.Ca.title,this.Ha.style.color=this.ea(e.hj,e.fj),this.Ha.style.backgroundColor=e.background?this.ea(e.cc,e.bc):"transparent",this.Ha.style.border="solid "+this.ea(e.ec,e.dc)+" "+e.$h+"px",this.Ha.style.borderRadius=e.xj+"px",this.Ha.style.textAlign="center",0a-this.Y.startTime&&0<=b&&20>b){var e=this.ai(this.oa.x,this.oa.y);e&&this.Yn(e);b=Math.abs(this.fa.Ld.x-this.fa.na.x)+Math.abs(this.fa.Ld.y-this.fa.na.y);700>a-this.Zg&&0<=b&&20>b?(e?this.Zn(e):this.L.Oj&&this.kj(),this.Zg=0):this.Zg=a;this.fa.Ld.x=this.fa.na.x;this.fa.Ld.y=this.fa.na.y}}};c.prototype.Vm=function(a){if(!this.L.ce&&!this.oc&&(a=a?a:window.event,this.Kc(a.target))){var b=a.detail?-1*a.detail:a.wheelDelta/40;this.L.Fm&&(b=-b);a.axis&&(-1==this.Ci?this.Ci=a.axis: this.Ci!=a.axis&&(b=0));var e=0Math.abs(a.wheelDeltaY)&&(b=0);0!=b&&(this.Cj(e*this.L.Ln,!0),this.update());a.preventDefault();this.Ea()}};c.prototype.qs=function(a){a||(a=window.event);var b=a.touches,e=this.He();this.oa.x=b[0].pageX-e.x;this.oa.y=b[0].pageY-e.y;this.pe=this.Ob=null;this.ri||(this.ri=!0,this.P("hastouch",{}));!this.Km&&(this.vf||this.wf&&this.Ke)&&this.ii();if(!this.L.jc&&!this.oc){var f=(new Date).getTime();if(this.ie)this.Ob= this.ie,this.Y.Zc=!0,this.Y.startTime=f,a.preventDefault(),this.Y.th=!0;else{if(!this.Y.Zc&&b[0]){this.Y.startTime=f;this.Y.start.x=b[0].pageX;this.Y.start.y=b[0].pageY;this.Y.na.x=b[0].pageX;this.Y.na.y=b[0].pageY;this.tb=b[0].target;if(this.Kc(this.tb)){(f=this.Ej(this.oa.x,this.oa.y))&&f.Ie&&(this.Ob=f);if(f=this.ai(this.oa.x,this.oa.y))this.N(f),this.pe=f,this.Ui(f),f=this.Ig(a),this.dg(f.x-e.x,f.y-e.y);this.lo(b[0].pageX,b[0].pageY);this.Y.Tl=b[0].identifier;this.Y.Zc=!0;a.preventDefault();this.Y.th= !0;this.Ea()}if(this.tb){e=this.tb;for(f=!1;e&&e!=this.control;){if(e.onmouseover)e.onmouseover();e.onmousedown&&!f&&(e.onmousedown(),f=!0);e=e.parentNode}f&&(a.preventDefault(),this.Y.th=!0)}}1this.fov.max&&(this.Ja.fov.wc=this.fov.max),this.Ja.fov.wcg){e=!0;this.Kc(this.tb)&&(a.preventDefault(),this.Ob&&(this.Ob.Ie(),this.ie=this.Ob.nb?this.Ob:null));if(this.tb){for(g=this.tb;g&&g!=this.control;)g.onclick&&(g.onclick(),"hotspot"!=g.Ns&&(h=!0),e=!1),g=g.parentNode;h&&a.preventDefault()}g=Math.abs(this.Y.Ld.x-this.Y.na.x)+Math.abs(this.Y.Ld.y-this.Y.na.y);if(700>f-this.Zg&&0<=g&&20>g){if(this.Kc(this.tb))if(a.preventDefault(),this.pe)this.Zn(this.pe);else if(this.L.Oj){var l=this;setTimeout(function(){l.kj()},1)}if(this.tb){for(g= this.tb;g&&g!=this.control;)g.ondblclick&&(g.ondblclick(),h=!0,e=!1),g=g.parentNode;h&&a.preventDefault()}this.Zg=0}else this.Zg=f;this.Y.Ld.x=this.Y.na.x;this.Y.Ld.y=this.Y.na.y}if(this.tb)for(g=this.tb;g&&g!=this.control;){if(g.onmouseout)g.onmouseout();if(g.onmouseup)g.onmouseup();g=g.parentNode}a=this.Ig(a);this.dg(a.x-b.x,a.y-b.y);this.pe&&e&&this.Yn(this.pe);this.tb=null;this.Y.Zc=!1;this.Ui(this.mb);this.pe=null}};c.prototype.ns=function(a){var b=this.He();this.L.jc||this.oc||(this.Y.Zc=!1); this.pe=null;this.Ui(this.mb);a=this.Ig(a);this.dg(a.x-b.x,a.y-b.y)};c.prototype.Lm=function(){return null!=this.tb||this.Y.Zc||this.Y.Mc};c.prototype.Wm=function(a){!this.Oe&&window.MSGesture&&(this.N("setup gesture"),this.Oe=new MSGesture,this.Oe.target=this.control);this.Oe&&this.Oe.addPointer(a.pointerId)};c.prototype.bm=function(a){this.fk=!0;this.Ji=1;this.L.jc||this.L.ce||this.oc||(a.touches?(this.tb=a.touches.target,this.Kc(a.target)&&(a.preventDefault(),this.fov.prev=this.fov.j,this.Ea())): (a.preventDefault(),this.fov.prev=this.fov.j,this.Ea()))};c.prototype.qp=function(a){this.L.jc||this.L.ce||this.oc||!this.Kc(a.target)||(a.preventDefault(),this.Ja.fov.active=!0,this.Ja.fov.wc=this.fov.prev/Math.sqrt(a.scale),4==this.Ra()&&2!=this.Wa&&this.Ja.fov.wc>this.fov.max&&(this.Ja.fov.wc=this.fov.max),this.update(),this.Ea())};c.prototype.Hq=function(a){this.L.jc||this.L.ce||this.oc||(a.preventDefault(),1!=a.scale&&(this.Ja.fov.active=!0,this.Ji*=a.scale,this.Ja.fov.wc=this.fov.prev/Math.sqrt(this.Ji), 4==this.Ra()&&2!=this.Wa&&this.Ja.fov.wc>this.fov.max&&(this.Ja.fov.wc=this.fov.max),this.update(),this.Ea()))};c.prototype.am=function(a){this.L.jc||this.L.ce||this.oc||(this.Ja.fov.active=!1,a.preventDefault(),this.Ea(),this.Oe&&this.Oe.reset&&this.Oe.reset())};c.prototype.uq=function(a){this.L.hh||this.oc||(this.isFullscreen&&a.preventDefault(),this.Ai=a.keyCode,this.Ea())};c.prototype.vq=function(a){this.Ai&&(this.Ai=0,a.preventDefault())};c.prototype.Nq=function(){this.Ai=0};c.prototype.Ni=function(){this.isFullscreen&& (this.Vg()||this.exitFullscreen(),this.Vg()&&(this.$.style.left="0px",this.$.style.top="0px"))};c.prototype.Tq=function(a,b,e,f){f?(this.Pg.alpha=a,this.Pg.beta=b,this.Pg.gamma=e,this.Pg.gamma+=90):(this.kb.alpha=a,this.kb.beta=b,this.kb.gamma=e,this.kb.gamma+=90);this.kb.orientation=window.orientation?1*parseInt(""+window.orientation,10):0;e=new x.jl;a=this.kb;e.Ue(-a.alpha);e.Ve(-a.beta);e.Od(-a.gamma);e.Ve(90-a.orientation);1>e.Kb?-1this.kb.fadeIn&&(this.kb.fadeIn+=1,g=.1*this.kb.fadeIn);e=-e+this.kb.Pe;this.Xe(g*e+(1-g)*this.Kg());this.Ye(g*a+(1-g)*this.ni());this.io?this.Yi(g*b+(1-g)*this.qm()):this.Yi(0);this.sg();this.F.active=f}};c.prototype.Yn=function(a){this.ka&& this.ka.hotspotProxyClick&&this.ka.hotspotProxyClick(a.id,a.url);""!=a.url&&(this.Bk(a.url,a.target),this.dg(-1,-1))};c.prototype.Zn=function(a){this.ka&&this.ka.hotspotProxyDoubleClick&&this.ka.hotspotProxyDoubleClick(a.id,a.url)};c.prototype.ji=function(){return Math.min(1,2*Math.tan(Math.PI*Math.min(this.fov.j,90)/360))};c.prototype.fn=function(){var a=this;setTimeout(function(){a.fn()},100);9!=a.Ri||a.vi||window.requestAnimationFrame(function(){a.qh();a.zc("restart recover timer")});10k;)k+=360}e=k-l;2!=this.Wa&&(180e&&(e+=360));this.pan.j+=e*this.Ad}else this.pan.j=k;this.B.eh=this.pan.j;break;case 1:l=this.v.j;this.Ud&&3!=w.type?(f=k- l,this.v.j+=f*this.Ad):this.v.j=k;this.B.fh=this.v.j;break;case 2:l=this.fov.j,this.Ud&&3!=w.type?(g=k-l,this.fov.j+=g*this.Ad):this.fov.j=k,this.B.dh=this.fov.j}}b=this.Ra();for(h=Math.floor(a);!this.zf(h,3)&&0a?(b=this.Hg(this.ng),this.fov.j>b?this.Xh=a:(w=(a-this.Xh)/this.tj,w=Math.min(1,w),this.Oc(this.Va,this.ng,1-w))):(0==h.Db||w>h.Db-.3?this.Oc(h.value):(w/=h.Db,this.Oc(b,h.value,1-w)),this.B.Rm=h.value);this.Ud&&(e=Math.sqrt(e* e+f*f+g*g),.3>e&&(this.Ud=!1,this.Ad=.02,this.mg=0),0this.mg&&(this.Ad+=.01,this.Ad=Math.min(this.Ad,1)),this.mg=e);h=Math.floor(a);if(h!=this.rl)for(this.rl=h,a=this.rp(h),e=0;e=this.Ya.length&&(b=0),a=this.Ya[b];while(""!=this.B.Mf&&!this.Jg(a).tags.includes(this.B.Mf)&&a!=this.Pa);return a};c.prototype.ar=function(a){var b=this.F.speed;this.F.rk&&(b=b*(a.getTime()-this.F.rk)/60,5b&&(b=.2));this.F.rk=a.getTime();this.B.Dg&&(this.za.ready()||4==this.Va)&&this.li()&&(this.B.Dg=!1,this.B.active=!0,this.wb.running=!0,this.wb.Vj=!1);if(this.F.active|| 0!=this.F.Lb&&this.za.ready()){if(this.F.bl&&"__AutoMove"==this.I.ab){var e=a.getTime()-this.F.ql;b=e/100;if(b>=this.I.length){if(this.aj(this.I.length),this.xa.splice(this.xa.indexOf(this.I),1),this.F.active=!1,this.I=this.F.pl,this.F.Lb=0,this.Xi(this.F.pan,this.F.v,this.F.fov),this.pan.Wc=this.F.pan,this.v.Wc=this.F.v,this.F.nh&&(this.F.nh=!1,this.B.Hi=!0,this.B.active=!0,this.P("autorotatechanged",{})),this.onMoveComplete)this.onMoveComplete()}else this.aj(b)}else{this.pan.d=this.F.pan-this.pan.j; if(360==this.pan.max-this.pan.min){for(;-180>this.pan.d;)this.pan.d+=360;for(;1805*e?e/f:.2,this.pan.d*=f,this.v.d*=f,this.fov.d*=f;this.pan.j+=this.pan.d;this.v.j+=this.v.d;this.U.j+=this.U.d;this.fov.j+=this.fov.d;0!=this.F.Lb&&(this.F.Lb!=this.Va?(b=this.Hg(this.F.Lb),this.$j()>b?(this.fov.j+=-Math.max((2.5- 1.7*Math.min(Math.sqrt(this.pan.d*this.pan.d+this.v.d*this.v.d+this.U.d*this.U.d)/e,1))*e,this.fov.d)-this.fov.d,this.F.fov=this.fov.j):(this.Cc=this.Va,this.Va=this.F.Lb,this.N("New projection from Target:"+this.Va),this.ph=this.F.vh=0,this.za.ui())):1>this.F.vh?(this.F.vh=Math.min(1,this.F.vh+.05*b),this.ph=this.F.vh):(this.Cc=0,this.F.Lb=0,this.za.ui()))}this.Hf=a.getTime();this.update()}else if(this.B.active){e=a.getTime()-this.B.startTime;this.B.Dithis.D.f.duration-this.D.f.currentTime&&(this.vj=!0);f>=10*this.ff;)f-=10*this.ff;if(!g&&b>=this.I.length||g&&!e&&b>=this.I.length||g&&e&&(this.I.ab!=this.I.Xm||this.I.Ki!=this.Pa)&&b>=this.I.length){this.aj(this.I.length);this.B.Kd=0;this.gf=!1;if(this.wb.running){this.zn();return}this.Wb=this.I.Xm;this.Wb==this.I.ab&&this.Pa==this.I.Ki?1e.pan;)e.pan+=360;e.tilt=f.value;e.fov=g.value;e.projection=h?h.value:4}e.timingFunction= 3;e.speed=1;this.F.nh=!0;this.Ii(e);this.B.active=!0}}else 0=1E3*this.B.Li?11E3*this.B.timeout&&!this.B.Dg&&(this.B.Dh&&this.li()||!this.B.Dh)&&(this.B.active=!0,this.B.startTime=a.getTime(),this.B.wd=0,this.P("autorotatechanged",{}),this.pan.d=0,this.v.d= 0,this.fov.d=0),!this.Ja.enabled||this.Y.wi()||0==this.pan.d&&0==this.v.d&&0==this.fov.d||(this.F.ti=!0,this.pan.d*=.9,this.v.d*=.9,this.fov.d*=.9,this.pan.j+=this.pan.d,this.v.j+=this.v.d,this.Cj(this.fov.d),1E-4>this.pan.d*this.pan.d+this.v.d*this.v.d+this.fov.d*this.fov.d&&(this.pan.d=0,this.v.d=0,this.fov.d=0),this.update())};c.prototype.cr=function(a){var b=this.J;if(b.yd){var e=a.getTime()-b.ro;e/=1E3*b.qo;1<=e?(b.yd=!1,this.Rl(),b.Tk=a.getTime(),this.Pn(),b.re=!0,0==b.sc||b.kg||(4==b.sc?(this.I= this.Gg(!0,b.$e,b.af,b.Rd),this.Wb=this.I.ab,this.B.active=!0,this.wb.running=!0):this.moveTo(b.$e,b.af,b.Rd,b.te,0,b.xd))):b.en(e)}else b.re&&(e=a.getTime()-b.Tk,e/=1E3*b.og,1<=e?(b.re=!1,this.Hf=a.getTime(),this.update(),0!=b.sc&&b.kg&&(4==b.sc?(this.I=this.Gg(!0,b.$e,b.af,b.Rd),this.Wb=this.I.ab,this.B.active=!0,this.wb.running=!0):this.moveTo(b.$e,b.af,b.Rd,b.te,0,b.xd)),4!=b.sc&&(this.Vi(!1),this.B.active=b.ue,this.P("autorotatechanged",{}),b.ue=!1),this.B.wd=0,this.pa&&this.Jj(),this.qg=!1): b.en(e));b=this.Wq;b.Po&&(b.ei?a.getTime()-b.Qj>=1E3*b.delay&&(b.ei=!1):(b.current+=b.kd,0>b.current&&(b.current=0,b.kd=-b.kd,b.ei=!0,b.Qj=a.getTime()),1b.Zb[a]?(b.Zb[a]+=.05,b.gd[a]b.Zb[a]&&(b.Zb[a]=b.gd[a],-1!=b.bj.indexOf(b.sb[a])&&(b.bj.splice(b.bj.indexOf(b.sb[a]),1), b.sb.splice(a,1),b.gd.splice(a,1),b.Zb.splice(a,1)))));this.update()}if(2==b.mode)for(a=0;ae.wa?(e.wa+=b.kd,e.gbe.wa&&(e.wa=e.gb)),this.update())}3==b.mode&&b.gb!=b.wa&&(b.gb>b.wa?(b.wa+=b.kd,b.gbb.wa&&(b.wa=b.gb)),this.update())};c.prototype.er=function(){var a=this.Ja;this.Y.wi()&&(this.L.Hd?(a.ma.x=.4*(this.fa.na.x-a.na.x),a.ma.y=.4*(this.fa.na.y-a.na.y), a.na.x+=a.ma.x,a.na.y+=a.ma.y):(a.ma.x=.1*-this.fa.ma.x*this.L.sensitivity/8,a.ma.y=.1*-this.fa.ma.y*this.L.sensitivity/8),this.jo(a.ma.x,a.ma.y),this.update());a.fov.active&&(this.xl(.4*(a.fov.wc-this.fov.j)),.001>Math.abs(a.fov.wc-this.fov.j)/this.fov.j&&(a.fov.active=!1),this.update());if(a.enabled&&(0!=a.ma.x||0!=a.ma.y)&&!this.Y.wi()){var b=.9*(1-a.Lk);a.ma.x*=b;a.ma.y*=b;this.F.ti=!0;.01>a.ma.x*a.ma.x+a.ma.y*a.ma.y?(a.ma.x=0,a.ma.y=0):(this.jo(a.ma.x,a.ma.y),this.update())}};c.prototype.br= function(){if(this.L.wn&&this.L.Hd){var a=this.jn;a.pan=this.pan.j;a.v=this.v.j;a.fov=this.fov.j;this.pf(a);this.pf(a);this.pf(a);var b=a.pan-this.pan.j,e=a.v-this.v.j;a=a.fov-this.fov.j;if(0!=b||0!=e||0!=a){var f=.2+.9*Math.min((Math.abs(b)+Math.abs(e)+Math.abs(a))/Math.abs(Math.min(this.fov.j,90))*.3,1);this.pan.j+=b*f;this.v.j+=e*f;this.fov.j+=a*f;this.Ja.Lk=.3;this.update()}else this.Ja.Lk=0}else this.sg();if(isNaN(this.pan.j)||1E7this.pan.j)this.pan.j=0;if(isNaN(this.v.j)|| 1E7this.v.j)this.v.j=0;if(isNaN(this.U.j)||1E7this.U.j)this.U.j=0;if(2!=this.Wa){for(;360this.pan.j;)this.pan.j+=360}};c.prototype.dr=function(){if(!this.li()&&this.Cf&&5"+c.Kl(this.Fi).replace(/./gm,function(k){return"&#"+k.charCodeAt(0)+";"})),f.setAttribute("style","color: black; text-decoration: none;"),a.appendChild(f),g.appendChild(a));e.$.insertBefore(e.pd,e.$.firstChild);g.onclick=function(){e.pd&&(e.$.removeChild(e.pd), e.pd=null)};g.oncontextmenu=g.onclick}};c.prototype.Oo=function(){var a=this;var b=a.Qa;a.control=b;a.control=b;a.vs();setTimeout(function(){a.qh()},10);setTimeout(function(){a.fn()},200);setTimeout(function(){a.df();a.Kh()},10);b.addEventListener&&(b.addEventListener("touchstart",function(e){a.qs(e)},!1),b.addEventListener("touchmove",function(e){a.ps(e)},!1),b.addEventListener("touchend",function(e){a.os(e)},!1),b.addEventListener("touchcancel",function(e){a.ns(e)},!1),b.addEventListener("pointerdown", function(e){a.Wm(e)},!1),b.addEventListener("MSPointerDown",function(e){a.Wm(e)},!1),b.addEventListener("MSGestureStart",function(e){a.bm(e)},!1),b.addEventListener("MSGestureEnd",function(e){a.am(e)},!1),b.addEventListener("MSGestureChange",function(e){a.Hq(e)},!1),b.addEventListener("gesturestart",function(e){a.bm(e)},!1),b.addEventListener("gesturechange",function(e){a.qp(e)},!1),b.addEventListener("gestureend",function(e){a.am(e)},!1),b.addEventListener("mousedown",function(e){a.Eq(e)},!1),b.addEventListener("mousemove", function(e){a.Dq(e)},!1),document.addEventListener("mouseup",function(e){a.Cq(e)},!1),b.addEventListener("mousewheel",function(e){a.Vm(e)},!1),b.addEventListener("DOMMouseScroll",function(e){a.Vm(e)},!1),document.addEventListener("keydown",function(e){a.uq(e)},!1),document.addEventListener("keyup",function(e){a.vq(e)},!1),window.addEventListener("resize",function(){a.df()},!1),window.addEventListener("blur",function(){a.Nq()},!1),a.$.addEventListener("webkitfullscreenchange",function(){a.Ni()},!1), document.addEventListener("mozfullscreenchange",function(){a.Ni()},!1),window.addEventListener("webkitfullscreenchange",function(){a.Ni()},!1),document.addEventListener("MSFullscreenChange",function(){a.Ni()},!1));b.oncontextmenu=function(e){void 0===e&&(e=window.event);if(e.target&&!a.Kc(e.target))return!0;if(!e.ctrlKey){e=a.Ig(e);var f=a.He();a.Ur(e.x-f.x,e.y-f.y);return!1}return!0};window.addEventListener("deviceorientation",function(e){a.Tq(e.alpha,e.beta,e.gamma,e.absolute);null!=e.alpha&&null!= e.beta&&null!=e.gamma&&0==a.dk&&(a.dk=!0,a.P("gyroavailable",{available:!0}),a.P("playerstatechanged",{}))})};c.prototype.ol=function(){for(var a=0;ab&&(b=0),b> a.Zh.duration&&(b=a.Zh.duration-.1),a.So(b)):a.f&&(0>b&&(b=0),b>a.f.duration&&(b=a.f.duration-.1),a.f.currentTime=b))};c.prototype.setVolume=function(a,b){if(this.Nb){var e=this.qa;e&&e.setVolume(a,b)}else try{e=void 0;var f=Number(b);1f&&(f=0);"_videopanorama"===a&&this.D.f&&(this.D.f.volume=f);if("_main"===a){this.ba=f;for(e=0;ee&&(e=0);this.ba=e;for(f=0;fe&&(e=0);h.level=e;h.f&&null!=h.f.volume&&(h.f.volume=e*this.ba)}}}catch(l){this.N(l)}};c.prototype.Wi=function(a,b,e){a.f.style.opacity=0==b?1:0;a.f.style[this.Yc]="opacity "+e+"ms";a.f.style.opacity=0==b?0:1};c.prototype.Ar=function(a,b,e){function f(){var k=g[l];if(!k.f)return"continue";0==b?(h.Wi(k,b,e),setTimeout(function(){0==k.f.style.opacity&& k.Yf(!1)},e+10),k.ob=!1):1==b?(h.Wi(k,b,e),k.Yf(!0),k.ob=!0):2==b&&("visible"==k.f.style.visibility?(h.Wi(k,0,e),setTimeout(function(){0==k.f.style.opacity&&k.Yf(!1)},e+10),k.ob=!1):(h.Wi(k,1,e),k.Yf(!0),k.ob=!0))}for(var g=this.vb(a),h=this,l=0;le&&(e=this.Fc);for(b=0;6>b;b++){var f=this.cube.faces[b];a?(f.width=this.pg,f.height=this.pg):(f.V=document.createElement("canvas"),f.V.width=this.Fc,f.V.height=this.Fc,f.width=this.Fc,f.height=this.Fc,f.bb=f.V.getContext("2d"));var g="position:absolute;";g+="left: 0px;"; g+="top: 0px;";g+="width: "+e+"px;";g+="height: "+e+"px;";a&&(g+="outline: 1px solid transparent;");g+=this.Oa+"transform-origin: 0% 0%;";g+="-webkit-user-select: none;";g+=this.Oa+"transform: ";var h="";var l=1;this.Tf&&(l=100);h=4>b?h+("rotateY("+-90*b+"deg)"):h+("rotateX("+(4==b?-90:90)+"deg)");this.Tf&&(h+=" scale("+l+")");h+=" translate3d("+-e/2+"px,"+-e/2+"px,"+-e*l/(2*this.bf)+"px)";g+=h+";";f.vm=h;a||(f.V.setAttribute("style",g),this.K.insertBefore(f.V,this.K.firstChild))}if(!a){for(b=0;6> b;b++)f=this.cube.faces[b],""!=this.rf[b]&&(f.Nd=new Image,f.Nd.crossOrigin=this.crossOrigin,f.Nd.onload=this.Il(f),f.Nd.setAttribute("src",this.Pb(this.rf[b])),this.gc.push(f.Nd));for(b=0;6>b;b++)f=this.cube.faces[b],f.loaded=!1,f.u=new Image,f.u.crossOrigin=this.crossOrigin,f.u.onload=this.Il(f),f.u.setAttribute("src",this.Pb(this.vg[b])),this.gc.push(f.u)}};c.prototype.Te=function(){var a;this.Ja.ma.x=0;this.Ja.ma.y=0;if(this.jd){for(a=0;aa.h?a.w:a.h};c.prototype.Fk=function(a,b){var e=(new DOMParser).parseFromString(a,"text/xml");this.Mj=a;this.ln(e,b);this.qa&&(this.N("Apply to Flash player"),this.qa.readConfigString(this.Mj),this.qa.setLocked(!0),this.qa.setSlaveMode(!0))};c.prototype.kn=function(a,b,e){try{var f=void 0;f=new XMLHttpRequest;f.open("GET",a,!1);f.send(null);if(f.responseXML){var g=a.lastIndexOf("/");0<=g&&(this.Wd=a.substr(0, g+1));2<=arguments.length&&null!=b&&(this.Wd=b);this.Fk(f.responseText,e)}else alert("Error loading panorama XML")}catch(h){alert("Error:"+h)}};c.prototype.ir=function(a,b,e,f){var g=new XMLHttpRequest;var h=this;g.onload=function(l){if(4<=g.readyState)if(g.responseXML){var k=a.lastIndexOf("/");0<=k&&(h.Wd=a.substr(0,k+1));3<=arguments.length&&null!=e&&(h.Wd=e);h.Fk(g.responseText,f);b&&b()}else alert("Error loading panorama XML");else console.error("Wrong state loading XML:"+g.statusText)};g.onerror= function(){console.error("Error loading XML:"+g.statusText)};g.open("GET",a,!0);g.send(null)};c.prototype.Bj=function(a){var b="";"{"==a.charAt(0)&&(b=a.substr(1,a.length-2));(a=this.Yd[b])&&(b=a);a={oldNodeId:this.Pa,nodeId:b};this.P("beforechangenodeid",a);this.ck?this.ck=!1:this.zk.push(this.Pa);""!=this.Pa&&-1==this.qj.indexOf(this.Pa)&&(this.qj.push(this.Pa),this.P("changevisitednodes",{}));this.Qm=this.Pa;this.Pa=b;this.N("change active node: "+b);this.ka&&this.ka.changeActiveNode&&this.ka.changeActiveNode("{"+ b+"}");this.P("changenodeid",a);this.wf=!0};c.prototype.Zj=function(){return this.Pa};c.prototype.Np=function(){if(0=this.Ya.length&&(a=0);return this.Ya[a]}return""};c.prototype.Zp=function(){if(0a&&(a=this.Ya.length-1);return this.Ya[a]}return""};c.prototype.Gp=function(){return this.Qm};c.prototype.Lq=function(a){return-1!=this.qj.indexOf(a)};c.prototype.cp=function(){this.qj=[];this.P("changevisitednodes", {})};c.prototype.ln=function(a,b){var e=a.firstChild;this.qe=[];this.Ya=[];this.Yd=[];for(a=e.firstChild;a;){if("map"==a.nodeName){var f={},g=a.getAttributeNode("title");g&&(f.title=g.nodeValue.toString());g=a.getAttributeNode("type");f.type=g.nodeValue.toString();"web"==f.type?(g=a.getAttributeNode("mapprovider"),f.mapprovider=g.nodeValue.toString(),(g=a.getAttributeNode("mapstyle"))&&(f.mapstyle=g.nodeValue.toString()),(g=a.getAttributeNode("googlecustomstylecode"))&&(f.googlecustomstylecode=g.nodeValue.toString()), (g=a.getAttributeNode("mapurltemplate"))&&(f.mapurltemplate=g.nodeValue.toString()),(g=a.getAttributeNode("mapmaxzoom"))&&(f.mapmaxzoom=Number(g.nodeValue)),(g=a.getAttributeNode("mapkey"))&&(f.mapkey=g.nodeValue.toString()),(g=a.getAttributeNode("styleurl"))&&(f.styleurl=g.nodeValue.toString())):(g=a.getAttributeNode("width"),f.width=Number(g.nodeValue),g=a.getAttributeNode("height"),f.height=Number(g.nodeValue),g=a.getAttributeNode("zoomlevels"),f.zoomlevels=Number(g.nodeValue),g=a.getAttributeNode("tileformat"), f.tileformat=g.nodeValue.toString(),g=a.getAttributeNode("bgcolor"),f.bgcolor=g.nodeValue.toString(),g=a.getAttributeNode("transparent"),f.transparent=1==g.nodeValue,g=a.getAttributeNode("floorplannorth"),f.floorplannorth=Number(g.nodeValue));g=a.getAttributeNode("id");this.Gi[g.nodeValue.toString()]=f}a=a.nextSibling}if("tour"==e.nodeName){this.Gf=!0;a="";(g=e.getAttributeNode("start"))&&(a=g.nodeValue.toString());this.hasOwnProperty("startNode")&&this.startNode&&(a=String(this.startNode),this.startNode= "");this.hasOwnProperty("startView")&&this.startView&&("object"===typeof this.startView&&null!==this.startView?b=this.startView:""!=this.startView&&(b=String(this.startView)),this.startView="");f=e.firstChild;var h="";for(e="";f;){if("panorama"==f.nodeName){if(g=f.getAttributeNode("id"))h=g.nodeValue.toString(),""==a&&(a=h),""==e&&(e=h),this.qe[h]=f,this.Ya.push(h);for(g=f.firstChild;g;){if("userdata"==g.nodeName){var l=this.Bg(g);this.Ph[h]=l;h==a&&(this.Ph._first=l);l.customnodeid&&(this.Yd[l.customnodeid]= h);this.Lc[h]=this.Ol(g);this.Lf[h]=this.Pl(g)}g=g.nextSibling}}if("masternode"==f.nodeName)for(g=f.firstChild;g;)"userdata"==g.nodeName&&(l=this.Bg(g),this.Ph._master=l),g=g.nextSibling;f=f.nextSibling}this.qe.hasOwnProperty(a)||(g=this.Yd[a])&&(a=g);this.qe.hasOwnProperty(a)||(this.zc("Start node "+a+" not found!"),a=e);this.Ek(this.qe[a],b);this.Bj("{"+a+"}");this.Pa=a}else this.Gf=!1,this.Ek(e,b),this.Bj(""),this.Ya.push("");this.ef&&(this.N("add pano vr config"),this.Eb.Vh());this.P("configloaded", {});this.P("changenode",{});this.P("playerstatechanged",{})};c.prototype.Ek=function(a,b){var e=this;this.rn();this.Sa&&this.Sa.kr();this.Wf(this.mb);this.Te();this.ah=0;for(var f=a.firstChild,g,h,l=0;f;){if("view"==f.nodeName){if(g=f.getAttributeNode("fovmode"))this.fov.mode=Number(g.nodeValue);g=f.getAttributeNode("pannorth");this.pan.Ak=1*(g?g.nodeValue:0);for(var k=f.firstChild;k;){"start"==k.nodeName&&(g=k.getAttributeNode("pan"),this.pan.j=Number(g?g.nodeValue:0),this.pan.cb=this.pan.j,g=k.getAttributeNode("tilt"), this.v.j=Number(g?g.nodeValue:0),this.v.cb=this.v.j,g=k.getAttributeNode("roll"),this.U.j=Number(g?g.nodeValue:0),this.U.cb=this.U.j,g=k.getAttributeNode("fov"),this.fov.j=Number(g?g.nodeValue:70),this.fov.cb=this.fov.j,g=k.getAttributeNode("projection"),this.Oi=Number(g?g.nodeValue:4),this.Oc(this.Oi));"min"==k.nodeName&&(g=k.getAttributeNode("pan"),this.pan.min=1*(g?g.nodeValue:0),g=k.getAttributeNode("tilt"),this.v.min=1*(g?g.nodeValue:-90),g=k.getAttributeNode("fov"),this.fov.min=1*(g?g.nodeValue: 5),1E-20>this.fov.min&&(this.fov.min=1E-20),g=k.getAttributeNode("fovpixel"),this.fov.lh=1*(g?g.nodeValue:0));if("max"==k.nodeName){g=k.getAttributeNode("pan");this.pan.max=1*(g?g.nodeValue:0);g=k.getAttributeNode("tilt");this.v.max=1*(g?g.nodeValue:90);g=k.getAttributeNode("fov");this.fov.max=1*(g?g.nodeValue:120);180<=this.fov.max&&(this.fov.max=179.9);if(g=k.getAttributeNode("fovstereographic"))this.fov.yk=1*g.nodeValue;if(g=k.getAttributeNode("fovfisheye"))this.fov.xk=1*g.nodeValue;if(g=k.getAttributeNode("scaletofit"))this.L.xn= 1==g.nodeValue}if("flyin"==k.nodeName){if(g=k.getAttributeNode("projection"))this.Hc.Lb=Number(g.nodeValue);if(g=k.getAttributeNode("pan"))this.Hc.pan=parseFloat(g.nodeValue);if(g=k.getAttributeNode("tilt"))this.Hc.v=parseFloat(g.nodeValue);if(g=k.getAttributeNode("fov"))this.Hc.fov=parseFloat(g.nodeValue)}k=k.nextSibling}}if("autorotate"==f.nodeName){if(g=f.getAttributeNode("speed"))this.B.speed=1*g.nodeValue;if(g=f.getAttributeNode("delay"))this.B.timeout=1*g.nodeValue;if(g=f.getAttributeNode("returntohorizon"))this.B.jj= 1*g.nodeValue;if(g=f.getAttributeNode("nodedelay"))this.B.Li=1*g.nodeValue;if(g=f.getAttributeNode("noderandom"))this.B.an=1==g.nodeValue;(g=f.getAttributeNode("nodefilter"))&&!this.B.$m&&(this.B.Mf=g.nodeValue);this.$d&&(this.B.enabled=!0,this.B.jf=!0,this.B.active=!1);this.B.Kd=0;if(g=f.getAttributeNode("startloaded"))this.B.Dh=1==g.nodeValue,this.B.Dh&&(this.B.active=!1);if(g=f.getAttributeNode("useanimation"))this.B.Oh=1==g.nodeValue,this.B.gg=this.B.Oh;if(g=f.getAttributeNode("syncanimationwithvideo"))this.B.Vk= 1==g.nodeValue}if("animation"==f.nodeName){if(g=f.getAttributeNode("syncanimationwithvideo"))this.B.Vk=1==g.nodeValue;if(g=f.getAttributeNode("useinautorotation"))this.B.Oh=1==g.nodeValue;if(g=f.getAttributeNode("animsequence"))this.B.Yh=g.nodeValue,this.$d&&(this.B.Vd=this.B.Yh);this.xa=[];for(k=f.firstChild;k;){if("clip"==k.nodeName){this.I=new x.il;if(g=k.getAttributeNode("animtitle"))this.I.hf=g.nodeValue.toString();if(g=k.getAttributeNode("cliptitle"))this.I.ab=g.nodeValue.toString();if(g=k.getAttributeNode("nodeid"))this.I.Os= g.nodeValue.toString();if(g=k.getAttributeNode("length"))this.I.length=Number(g.nodeValue);if(g=k.getAttributeNode("animtype"))this.I.Lo=Number(g.nodeValue);if(g=k.getAttributeNode("nextcliptitle"))this.I.Xm=g.nodeValue.toString();if(g=k.getAttributeNode("nextclipnodeid"))this.I.Ki=g.nodeValue.toString();if(g=k.getAttributeNode("nextclipstartview"))this.I.Kq=g.nodeValue.toString();if(g=k.getAttributeNode("transitiontype"))this.I.rs=Number(g.nodeValue);var w=k.firstChild;for(this.I.ca=[];w;){if("keyframe"== w.nodeName){var r=new x.Vc;if(g=w.getAttributeNode("time"))r.time=Number(g.nodeValue);if(g=w.getAttributeNode("value"))r.value=Number(g.nodeValue);if(g=w.getAttributeNode("valuestring"))r.dl=g.nodeValue.toString();if(g=w.getAttributeNode("transitiontime"))r.Db=Number(g.nodeValue);g=w.getAttributeNode("type");var y=0;g&&(r.type=Number(g.nodeValue),y=Number(g.nodeValue));if(g=w.getAttributeNode("property"))r.rb=Number(g.nodeValue);if(g=w.getAttributeNode("additionaltrackid"))r.Wh=g.nodeValue.toString(); if(1==y||2==y){if(g=w.getAttributeNode("bezierintime"))r.ve=Number(g.nodeValue);if(g=w.getAttributeNode("bezierinvalue"))r.we=Number(g.nodeValue);if(g=w.getAttributeNode("bezierouttime"))r.xe=Number(g.nodeValue);if(g=w.getAttributeNode("bezieroutvalue"))r.ye=Number(g.nodeValue)}this.I.ca.push(r)}w=w.nextSibling}this.xa.push(this.I)}k=k.nextSibling}}"input"==f.nodeName&&(h||(h=f));if(h)for(w=0;6>w;w++)g=h.getAttributeNode("prev"+w+"url"),this.rf[w]=g?String(g.nodeValue):"";"altinput"==f.nodeName&& (k=0,(g=f.getAttributeNode("screensize"))&&(k=1*g.nodeValue),0l&&(l=k,h=f));if("control"==f.nodeName&&this.$d){if(g=f.getAttributeNode("simulatemass"))this.Ja.enabled=1==g.nodeValue;if(g=f.getAttributeNode("rubberband"))this.L.wn=1==g.nodeValue;if(g=f.getAttributeNode("locked"))this.L.jc=1==g.nodeValue;g&&(this.L.hh=1==g.nodeValue);if(g=f.getAttributeNode("lockedmouse"))this.L.jc=1==g.nodeValue;if(g=f.getAttributeNode("lockedkeyboard"))this.L.hh=1==g.nodeValue;if(g=f.getAttributeNode("lockedkeyboardzoom"))this.L.zq= 1==g.nodeValue;if(g=f.getAttributeNode("lockedwheel"))this.L.ce=1==g.nodeValue;if(g=f.getAttributeNode("invertwheel"))this.L.Fm=1==g.nodeValue;if(g=f.getAttributeNode("speedwheel"))this.L.Ln=1*g.nodeValue;if(g=f.getAttributeNode("invertcontrol"))this.L.Hd=1==g.nodeValue;if(g=f.getAttributeNode("sensitivity"))this.L.sensitivity=1*g.nodeValue,1>this.L.sensitivity&&(this.L.sensitivity=1);if(g=f.getAttributeNode("dblclickfullscreen"))this.L.Oj=1==g.nodeValue;if(g=f.getAttributeNode("contextfullscreen"))this.L.ug= 1==g.nodeValue;if(g=f.getAttributeNode("contextprojections"))this.L.bi=1==g.nodeValue;if(g=f.getAttributeNode("hideabout"))this.L.Df=1==g.nodeValue;for(k=f.firstChild;k;)"menulink"==k.nodeName&&(w={text:"",url:""},g=k.getAttributeNode("text"),w.text=g.nodeValue,g=k.getAttributeNode("url"),w.url=g.nodeValue,this.kh.push(w)),k=k.nextSibling}if("transition"==f.nodeName&&this.$d){if(g=f.getAttributeNode("enabled"))this.J.enabled=1==g.nodeValue;if(g=f.getAttributeNode("blendtime"))this.J.og=1*g.nodeValue; if(g=f.getAttributeNode("blendcolor"))this.J.lf=g.nodeValue.toString();if(g=f.getAttributeNode("type"))this.J.type=g.nodeValue.toString();if(g=f.getAttributeNode("softedge"))this.J.Pc=1*g.nodeValue;if(g=f.getAttributeNode("zoomin"))this.J.ra=1*g.nodeValue;if(g=f.getAttributeNode("zoomout"))this.J.sc=1*g.nodeValue;if(g=f.getAttributeNode("zoomfov"))this.J.jg=1*g.nodeValue;if(g=f.getAttributeNode("zoomspeed"))this.J.te=1*g.nodeValue;if(g=f.getAttributeNode("zoomoutpause"))this.J.kg=1==g.nodeValue;"cut"== this.J.type&&(this.J.og=0)}if("soundstransition"==f.nodeName){if(g=f.getAttributeNode("enabled"))this.Xa.enabled=1==g.nodeValue;if(g=f.getAttributeNode("transitiontime"))this.Xa.Db=1*g.nodeValue;if(g=f.getAttributeNode("crossfade"))this.Xa.Gl=1==g.nodeValue}if("flyintransition"==f.nodeName){if(g=f.getAttributeNode("enabled"))this.wb.enabled=1==g.nodeValue&&this.ga;if(g=f.getAttributeNode("speed"))this.wb.speed=1*g.nodeValue}"userdata"==f.nodeName&&(this.userdata=this.hg=this.Bg(f),this.Lc[a.id]|| (this.Lc[a.id]=this.Ol(f),this.Lf[a.id]=this.Pl(f)));if("hotspots"==f.nodeName)for(k=f.firstChild;k;){if("label"==k.nodeName&&this.$d){w=this.H.gj;if(g=k.getAttributeNode("enabled"))w.enabled=1==g.nodeValue;if(g=k.getAttributeNode("width"))w.width=1*g.nodeValue;if(g=k.getAttributeNode("height"))w.height=1*g.nodeValue;if(g=k.getAttributeNode("textcolor"))w.hj=1*g.nodeValue;if(g=k.getAttributeNode("textalpha"))w.fj=1*g.nodeValue;if(g=k.getAttributeNode("background"))w.background=1==g.nodeValue;if(g= k.getAttributeNode("backgroundalpha"))w.bc=1*g.nodeValue;if(g=k.getAttributeNode("backgroundcolor"))w.cc=1*g.nodeValue;if(g=k.getAttributeNode("border"))w.$h=1*g.nodeValue;if(g=k.getAttributeNode("bordercolor"))w.ec=1*g.nodeValue;if(g=k.getAttributeNode("borderalpha"))w.dc=1*g.nodeValue;if(g=k.getAttributeNode("borderradius"))w.xj=1*g.nodeValue;if(g=k.getAttributeNode("wordwrap"))w.rj=1==g.nodeValue}if("polystyle"==k.nodeName&&this.$d){if(g=k.getAttributeNode("mode"))this.H.mode=1*g.nodeValue;if(g= k.getAttributeNode("bordercolor"))this.H.ec=1*g.nodeValue;if(g=k.getAttributeNode("backgroundcolor"))this.H.cc=1*g.nodeValue;if(g=k.getAttributeNode("borderalpha"))this.H.dc=1*g.nodeValue;if(g=k.getAttributeNode("backgroundalpha"))this.H.bc=1*g.nodeValue;if(g=k.getAttributeNode("handcursor"))this.H.Bf=1==g.nodeValue}g=void 0;"hotspot"==k.nodeName&&(g=new x.Uh(this),g.type="point",g.Yb(k),this.W.push(g));"polyhotspot"==k.nodeName&&(g=new x.Uh(this),g.type="poly",g.Yb(k),this.W.push(g));k=k.nextSibling}if("sounds"== f.nodeName||"media"==f.nodeName)for(k=f.firstChild;k;){if("sound"==k.nodeName&&!this.Ym)for(g=new x.Bo(this),g.Yb(k),this.Nb||g.addElement(),w=0;ww;w++)(g=h.getAttributeNode("prev"+w+"url"))&&(this.rf[w]=String(g.nodeValue));if(g=h.getAttributeNode("tilevrurl"))this.Hl=String(g.nodeValue);if(g=h.getAttributeNode("tilesize"))this.Fc=1*g.nodeValue;if(g=h.getAttributeNode("canvassize"))this.pg=Number(g.nodeValue);if(g=h.getAttributeNode("tilescale"))this.bf=1*g.nodeValue;if(g=h.getAttributeNode("leveltileurl"))this.u.uk=g.nodeValue;if(g=h.getAttributeNode("leveltilesize"))this.u.M=Number(g.nodeValue);if(g=h.getAttributeNode("levelbias"))this.u.Tm= Number(g.nodeValue);if(g=h.getAttributeNode("levelbiashidpi"))this.u.Um=Number(g.nodeValue);g=h.getAttributeNode("overlap");this.Na.U=0;this.Na.pitch=0;g&&(this.u.Da=Number(g.nodeValue));if(g=h.getAttributeNode("levelingroll"))this.Na.U=Number(g.nodeValue);if(g=h.getAttributeNode("levelingpitch"))this.Na.pitch=Number(g.nodeValue);this.Wa=0;(g=h.getAttributeNode("flat"))&&1==g.nodeValue&&(this.Wa=2);g=h.getAttributeNode("width");this.u.width=1*(g?g.nodeValue:1);g=h.getAttributeNode("height");this.u.height= 1*(g?g.nodeValue:this.u.width);this.D.src=[];this.u.levels=[];for(k=h.firstChild;k;){if("preview"==k.nodeName){if(g=k.getAttributeNode("color"))this.u.Rf=g.nodeValue;if(g=k.getAttributeNode("strip"))this.u.hn=1==g.nodeValue}if("video"==k.nodeName){if(g=k.getAttributeNode("format"))"3x2"==g.nodeValue&&(this.D.format=14),"equirectangular"==g.nodeValue&&(this.D.format=1);if(g=k.getAttributeNode("flipy"))this.D.flipY=Number(g.nodeValue);if(g=k.getAttributeNode("startonload"))this.D.Sk=1==g.nodeValue; if(g=k.getAttributeNode("startmutedmobile"))this.D.Nn=1==g.nodeValue;if(g=k.getAttributeNode("bleed"))this.D.kf=Number(g.nodeValue);if(g=k.getAttributeNode("endaction"))this.D.De=String(g.nodeValue);if(g=k.getAttributeNode("targetview"))this.D.Wk=String(g.nodeValue);if(g=k.getAttributeNode("width"))this.D.width=Number(g.nodeValue);if(g=k.getAttributeNode("height"))this.D.height=Number(g.nodeValue);for(w=k.firstChild;w;)"source"==w.nodeName&&(g=w.getAttributeNode("url"))&&this.D.src.push(g.nodeValue.toString()), w=w.nextSibling}if("level"==k.nodeName){h=new x.ll;g=k.getAttributeNode("width");h.width=1*(g?g.nodeValue:1);g=k.getAttributeNode("height");h.height=1*(g?g.nodeValue:h.width);if(g=k.getAttributeNode("preload"))h.cache=1==g.nodeValue;if(g=k.getAttributeNode("preview"))h.Re=1==g.nodeValue;h.T=Math.floor((h.width+this.u.M-1)/this.u.M);h.da=Math.floor((h.height+this.u.M-1)/this.u.M);this.u.levels.push(h)}k=k.nextSibling}this.u.sk=this.u.levels.length}this.Cf=!0;this.Lh&&(this.ga=this.jd=!1,this.vc||(this.N("dummy rendering"), this.vc=document.createElement("canvas"),this.vc.width=100,this.vc.height=100,this.vc.id="dummycanvas",this.K.appendChild(this.vc)),this.Qc());this.ga&&this.R&&(this.za.Dm(this.bf),this.za.Em());this.jd&&(0ha;ha++){var tf=ha%3*gl+z.D.kf;var hl=tf+gl-2*z.D.kf;var il=4;3>ha&&(il+=gl);var kl=il+gl-2*z.D.kf;for(ua=0;4>ua;ua++){sh.x=-1;sh.y=-1;sh.z=1;for(var jl=0;jla.time&&this.I.ca[b].timea.Qd;)a.Qd+=360;for(;180f;)f+=360;for(;180id)for(;z<=l&&ua>id;)ua=new x.Gc,ua.wj(db,gl,hl,tf,z),ua=ua.y,z++;else z=1;z>=.8*l&&(y=z=Math.round(.8*l));0==z&&(z=1);id=4==a.Ah?120:this.Hg(a.Ah);ua=a.ag;if(ua>id)for(;ha>z&&ua>id;)ua=new x.Gc,ua.wj(db,gl,hl,tf,ha),ua=ua.y,ha--}db=new x.Vc;db.time=0;db.rb=0;db.value=a.me;db.type=1;db.xe=l/3;db.ye=a.sf?a.me:a.me+f/3;b.ca.push(db);db=new x.Vc;db.time=0;db.rb=1;db.value=a.Bh;db.type=1;db.xe=l/3;db.ye=a.sf?a.Bh:a.Bh+g/3;b.ca.push(db); db=new x.Vc;db.time=0;db.rb=2;db.value=a.Pd;db.type=1;db.xe=l/3;db.ye=a.sf?a.Pd:a.Pd+h/3;b.ca.push(db);db=new x.Vc;db.time=0;db.rb=3;db.value=a.Ah;db.type=0;db.Db=0;b.ca.push(db);e&&(db=new x.Vc,db.time=z,db.rb=3,db.value=a.xd,db.type=0,db.Db=ha-z,b.ca.push(db));db=new x.Vc;db.time=l;db.rb=0;db.value=a.me+f;db.type=1;db.ve=2*l/3;db.we=a.Be&&!a.Ce?db.value:db.value-f/3;a.Ce&&(db.xe=l+w,db.ye=db.value+w/l*f);b.ca.push(db);db=new x.Vc;db.time=l;db.rb=1;db.value=a.ne;db.type=1;db.ve=2*l/3;db.we=a.Be&& !a.Ce?a.ne:a.ne-g/3;a.Ce&&(db.xe=l+w,db.ye=db.value+w/l*g);b.ca.push(db);db=new x.Vc;db.time=y;db.rb=2;db.value=r;db.type=1;db.ve=2*y/3;db.we=a.Be?r:r-h/3;b.ca.push(db);a.Ce&&(db=new x.Vc,db.time=l+k,db.rb=0,db.value=a.me+f,db.type=1,db.ve=l+k-w,db.we=a.me+f,b.ca.push(db),db=new x.Vc,db.time=l+k,db.rb=1,db.value=a.ne,db.type=1,db.ve=l+k-w,db.we=a.ne,b.ca.push(db));this.xa.push(b);return b};c.prototype.Es=function(){this.D.f&&this.D.f.play()};c.prototype.Fs=function(){this.D.f&&(this.D.f.pause(),this.D.f.currentTime= 0)};c.prototype.Ds=function(){this.D.f&&this.D.f.pause()};c.prototype.Rr=function(a){this.D.f&&(0>a&&(a=0),a>this.D.f.duration&&(a=this.D.f.duration-.1),this.D.f.currentTime=a,this.update())};c.prototype.gq=function(){return this.D.f?this.D.f.currentTime:0};c.prototype.fq=function(){if(this.D.f)return this.D.f};c.prototype.Qr=function(a){if(this.D.f){var b=!this.D.f.paused&&!this.D.f.ended,e=this.D.f.currentTime;this.D.f.pause();this.D.f.src=isNaN(parseInt(a,10))?String(a):this.D.src[parseInt(a,10)]; b&&(this.D.f.onloadedmetadata=function(){this.currentTime=e;this.play();this.onloadedmetadata=null});this.D.f.currentTime=e}};c.prototype.lp=function(){this.Ym=!0};return c}();x.ml=d})(ggP2VR||(ggP2VR={}));window.ggHasHtml5Css3D=Gl;window.ggHasWebGL=Hl;window.pano2vrPlayer=ggP2VR.ml;var n=ggP2VR.ml.prototype;n.getVersion=n.um;n.readConfigString=n.Fk;n.readConfigUrl=n.kn;n.readConfigUrlAsync=n.ir;n.readConfigXml=n.ln;n.openUrl=n.Bk;n.openNext=n.ed;n.goBack=n.mq;n.setMargins=n.zr;n.addListener=n.addListener; n.on=n.addListener;n.removeEventListener=n.removeEventListener;n.off=n.removeEventListener;n.detectBrowser=n.Ml;n.initWebGL=n.bd;n.getPercentLoaded=n.Vp;n.setBasePath=n.tr;n.getBasePath=n.dm;n.setViewerSize=n.Hn;n.getViewerSize=n.jq;n.setSkinObject=n.Kr;n.changeViewMode=n.Xo;n.getViewMode=n.hq;n.changePolygonMode=n.zl;n.setPolygonMode=n.zl;n.getPolygonMode=n.Xp;n.showOnePolyHotspot=n.In;n.hideOnePolyHotspot=n.Am;n.changePolyHotspotColor=n.Vo;n.toggleOnePolyHotspot=n.ms;n.changeViewState=n.Yo; n.getViewState=n.iq;n.setRenderFlags=n.Dr;n.getRenderFlags=n.$p;n.setMaxTileCount=n.En;n.getVFov=n.Tb;n.setVFov=n.$i;n.getHFov=n.xp;n.updatePanorama=n.Kh;n.isTouching=n.Lm;n.getIsMobile=n.Dp;n.setIsMobile=n.yr;n.getIsTour=n.Ep;n.getIsAutorotating=n.Ap;n.getIsLoading=n.Cp;n.getIsLoaded=n.li;n.getIsTileLoading=n.hm;n.getLastActivity=n.Fp;n.getPan=n.Kg;n.getPanNorth=n.Ge;n.getPanDest=n.Up;n.getPanN=n.mm;n.setPan=n.Xe;n.setPanNorth=n.Nk;n.changePan=n.yl;n.changePanLog=n.Uo;n.getTilt=n.ni; n.getTiltDest=n.aq;n.setTilt=n.Ye;n.changeTilt=n.Al;n.changeTiltLog=n.Wo;n.getFov=n.$j;n.getFovDest=n.vp;n.setFov=n.We;n.changeFov=n.xl;n.changeFovLog=n.Cj;n.getRoll=n.qm;n.setRoll=n.Yi;n.setPanTilt=n.Br;n.setPanTiltFov=n.Xi;n.setDefaultView=n.ur;n.setLocked=n.setLocked;n.setLockedMouse=n.Cn;n.setLockedKeyboard=n.Bn;n.getLockedKeyboard=n.Hp;n.setLockedWheel=n.Dn;n.moveTo=n.moveTo;n.moveToEx=n.Ii;n.moveToDefaultView=n.Fq;n.moveToDefaultViewEx=n.Gq;n.addHotspotElements=n.ol;n.playSound=n.ge; n.playPauseSound=n.gn;n.playStopSound=n.gr;n.pauseSound=n.Ck;n.activateSound=n.Eo;n.soundGetTime=n.Wr;n.soundSetTime=n.Xr;n.setMediaVisibility=n.Ar;n.isPlaying=n.isPlaying;n.stopSound=n.dj;n.setVolume=n.setVolume;n.changeVolume=n.Zo;n.removeHotspots=n.rn;n.getHotspotsVisible=n.fm;n.getCurrentPerspective=n.qd;n.addHotspot=n.Go;n.updateHotspot=n.us;n.removeHotspot=n.jr;n.setActiveHotspot=n.Wf;n.getPointHotspotIds=n.Wp;n.getHotspot=n.zp;n.setFullscreen=n.Xf;n.toggleFullscreen=n.kj; n.enterFullscreen=n.mp;n.exitFullscreen=n.exitFullscreen;n.getIsFullscreen=n.Bp;n.startAutorotate=n.bs;n.stopAutorotate=n.es;n.toggleAutorotate=n.ls;n.setAutorotateNodeFilter=n.sr;n.startAnimation=n.$r;n.createLayers=n.Fl;n.removePanorama=n.Te;n.getScreenResolution=n.rm;n.getMaxScreenResolution=n.km;n.getNodeIds=n.Pp;n.getNodeUserdata=n.Jg;n.getNodeLatLng=n.ak;n.getNodeTitle=n.Sp;n.getNodeDistance=n.Op;n.getCurrentNode=n.Zj;n.getNextNode=n.Np;n.getPrevNode=n.Zp;n.getLastVisitedNode=n.Gp; n.getNodesWithTag=n.lm;n.getCurrentPointHotspots=n.tp;n.getPositionAngles=n.Yp;n.getPositionRawAngles=n.nm;n.nodeVisited=n.Lq;n.clearVisitedNodes=n.cp;n.setElementIdPrefix=n.wr;n.videoPanoPlay=n.Es;n.videoPanoStop=n.Fs;n.videoPanoPause=n.Ds;n.getVideoPanoTime=n.gq;n.setVideoPanoTime=n.Rr;n.getVideoPanoObject=n.fq;n.setVideoPanoSource=n.Qr;n.getMediaObject=n.Lp;n.registerVideoElement=n.mn;n.disableSoundLoading=n.lp;n.setCrossOrigin=n.setCrossOrigin;n.setProjection=n.Oc;n.getProjection=n.Ra; n.changeProjection=n.Dj;n.changeProjectionEx=n.Dj;n.changeLensflares=n.To;n.setTransition=n.Nr;n.getMapType=n.Kp;n.getMapDetails=n.Jp;n.getNodeMapCoords=n.Qp;n.getNodeMapCoordsInPercent=n.Rp;n.getMapContainingNode=n.Ip;n.getMapsContainingNode=n.jm;n.getMapIDs=n.im;n.addVariable=n.Jo;n.setVariableOptions=n.Fn;n.setVariableValue=n.le;n.getVariableValue=n.eq;n.setSuperCookie=n.Mr;n.getGyroAvailable=n.wp;n.setUseGyro=n.Or;n.getUseGyro=n.bq;n.getOS=n.Tp;n.getBrowser=n.sp;n.triggerEvent=n.P; n.requestRedraw=n.lr;n.getWebGlContext=n.kq;n.getHasTouch=n.yp;n.enterVR=n.zg;n.exitVR=n.tf;n.toggleVR=n.Xn;n.isInVR=n.Wg;n.hasVR=n.ik;n.getVRDisplayName=n.cq;n.setVRFrameBufferScaleFactor=n.Pr;